@donotdev/cli 0.1.45 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dependencies-matrix.json +191 -150
  2. package/dist/bin/commands/agent-setup.js +632 -524
  3. package/dist/bin/commands/build.js +1239 -935
  4. package/dist/bin/commands/bump.js +1285 -946
  5. package/dist/bin/commands/cacheout.js +543 -405
  6. package/dist/bin/commands/coach.js +546 -408
  7. package/dist/bin/commands/create-app.js +1198 -862
  8. package/dist/bin/commands/create-project.js +1238 -902
  9. package/dist/bin/commands/db.js +139128 -93775
  10. package/dist/bin/commands/deploy.js +2308 -1936
  11. package/dist/bin/commands/dev.js +912 -662
  12. package/dist/bin/commands/doctor.js +634 -526
  13. package/dist/bin/commands/emu.js +1093 -785
  14. package/dist/bin/commands/format.js +588 -450
  15. package/dist/bin/commands/get-demo.js +1043 -756
  16. package/dist/bin/commands/make-admin.js +20974 -38424
  17. package/dist/bin/commands/preview.js +913 -663
  18. package/dist/bin/commands/seed.js +139129 -93776
  19. package/dist/bin/commands/setup-cicd.js +1130 -817
  20. package/dist/bin/commands/setup.js +1299 -960
  21. package/dist/bin/commands/staging.js +2308 -1936
  22. package/dist/bin/commands/sync-secrets.js +996 -733
  23. package/dist/bin/commands/type-check.js +733 -598
  24. package/dist/bin/commands/wai.js +533 -395
  25. package/dist/bin/dndev.js +9 -8
  26. package/dist/index.js +2720 -2290
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  31. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  32. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  33. package/templates/functions-firebase/src/index.ts.example +0 -1
  34. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  35. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  36. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  37. package/templates/functions-vercel/.env.example +9 -0
  38. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  39. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  40. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  41. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  42. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  43. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  44. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  45. package/templates/root-consumer/.claude/settings.json.example +11 -1
  46. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  47. package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
@@ -5,16 +5,25 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
8
+ get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
9
9
  }) : x)(function(x) {
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
18
27
  };
19
28
  var __export = (target, all) => {
20
29
  for (var name in all)
@@ -37,31 +46,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
46
  mod
38
47
  ));
39
48
 
40
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
41
- var isAmbiguous, isFullWidth, isWide;
49
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
50
+ var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
42
51
  var init_utils = __esm({
43
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
52
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
44
53
  init_utils2();
45
- isAmbiguous = (x) => {
46
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
47
- };
54
+ getCodePointsLength = /* @__PURE__ */ (() => {
55
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
56
+ return (input) => {
57
+ let surrogatePairsNr = 0;
58
+ SURROGATE_PAIR_RE.lastIndex = 0;
59
+ while (SURROGATE_PAIR_RE.test(input)) {
60
+ surrogatePairsNr += 1;
61
+ }
62
+ return input.length - surrogatePairsNr;
63
+ };
64
+ })();
48
65
  isFullWidth = (x) => {
49
66
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
50
67
  };
51
- isWide = (x) => {
52
- 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 >= 9800 && x <= 9811 || x === 9855 || 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 <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && 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 >= 101632 && 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 === 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 <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
68
+ isWideNotCJKTNotEmoji = (x) => {
69
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
53
70
  };
54
71
  }
55
72
  });
56
73
 
57
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
58
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
74
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
75
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
59
76
  var init_dist = __esm({
60
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
77
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
61
78
  init_utils2();
62
79
  init_utils();
63
- ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
80
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
64
81
  CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
82
+ CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
65
83
  TAB_RE = /\t{1,1000}/y;
66
84
  EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
67
85
  LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -71,14 +89,21 @@ var init_dist = __esm({
71
89
  const LIMIT = truncationOptions.limit ?? Infinity;
72
90
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
73
91
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
74
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
92
+ const ANSI_WIDTH = 0;
75
93
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
76
94
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
77
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
78
95
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
79
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
96
+ const FULL_WIDTH_WIDTH = 2;
80
97
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
81
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
98
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
99
+ const PARSE_BLOCKS = [
100
+ [LATIN_RE, REGULAR_WIDTH],
101
+ [ANSI_RE, ANSI_WIDTH],
102
+ [CONTROL_RE, CONTROL_WIDTH],
103
+ [TAB_RE, TAB_WIDTH],
104
+ [EMOJI_RE, EMOJI_WIDTH],
105
+ [CJKT_WIDE_RE, WIDE_WIDTH]
106
+ ];
82
107
  let indexPrev = 0;
83
108
  let index = 0;
84
109
  let length = input.length;
@@ -98,10 +123,8 @@ var init_dist = __esm({
98
123
  const codePoint = char.codePointAt(0) || 0;
99
124
  if (isFullWidth(codePoint)) {
100
125
  widthExtra = FULL_WIDTH_WIDTH;
101
- } else if (isWide(codePoint)) {
126
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
102
127
  widthExtra = WIDE_WIDTH;
103
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
104
- widthExtra = AMBIGUOUS_WIDTH;
105
128
  } else {
106
129
  widthExtra = REGULAR_WIDTH;
107
130
  }
@@ -117,88 +140,28 @@ var init_dist = __esm({
117
140
  }
118
141
  unmatchedStart = unmatchedEnd = 0;
119
142
  }
120
- if (index >= length)
121
- break;
122
- LATIN_RE.lastIndex = index;
123
- if (LATIN_RE.test(input)) {
124
- lengthExtra = LATIN_RE.lastIndex - index;
125
- widthExtra = lengthExtra * REGULAR_WIDTH;
126
- if (width + widthExtra > truncationLimit) {
127
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
128
- }
129
- if (width + widthExtra > LIMIT) {
130
- truncationEnabled = true;
131
- break;
132
- }
133
- width += widthExtra;
134
- unmatchedStart = indexPrev;
135
- unmatchedEnd = index;
136
- index = indexPrev = LATIN_RE.lastIndex;
137
- continue;
143
+ if (index >= length) {
144
+ break outer;
138
145
  }
139
- ANSI_RE.lastIndex = index;
140
- if (ANSI_RE.test(input)) {
141
- if (width + ANSI_WIDTH > truncationLimit) {
142
- truncationIndex = Math.min(truncationIndex, index);
143
- }
144
- if (width + ANSI_WIDTH > LIMIT) {
145
- truncationEnabled = true;
146
- break;
147
- }
148
- width += ANSI_WIDTH;
149
- unmatchedStart = indexPrev;
150
- unmatchedEnd = index;
151
- index = indexPrev = ANSI_RE.lastIndex;
152
- continue;
153
- }
154
- CONTROL_RE.lastIndex = index;
155
- if (CONTROL_RE.test(input)) {
156
- lengthExtra = CONTROL_RE.lastIndex - index;
157
- widthExtra = lengthExtra * CONTROL_WIDTH;
158
- if (width + widthExtra > truncationLimit) {
159
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
160
- }
161
- if (width + widthExtra > LIMIT) {
162
- truncationEnabled = true;
163
- break;
164
- }
165
- width += widthExtra;
166
- unmatchedStart = indexPrev;
167
- unmatchedEnd = index;
168
- index = indexPrev = CONTROL_RE.lastIndex;
169
- continue;
170
- }
171
- TAB_RE.lastIndex = index;
172
- if (TAB_RE.test(input)) {
173
- lengthExtra = TAB_RE.lastIndex - index;
174
- widthExtra = lengthExtra * TAB_WIDTH;
175
- if (width + widthExtra > truncationLimit) {
176
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
177
- }
178
- if (width + widthExtra > LIMIT) {
179
- truncationEnabled = true;
180
- break;
181
- }
182
- width += widthExtra;
183
- unmatchedStart = indexPrev;
184
- unmatchedEnd = index;
185
- index = indexPrev = TAB_RE.lastIndex;
186
- continue;
187
- }
188
- EMOJI_RE.lastIndex = index;
189
- if (EMOJI_RE.test(input)) {
190
- if (width + EMOJI_WIDTH > truncationLimit) {
191
- truncationIndex = Math.min(truncationIndex, index);
192
- }
193
- if (width + EMOJI_WIDTH > LIMIT) {
194
- truncationEnabled = true;
195
- break;
146
+ for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
147
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
148
+ BLOCK_RE.lastIndex = index;
149
+ if (BLOCK_RE.test(input)) {
150
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
151
+ widthExtra = lengthExtra * BLOCK_WIDTH;
152
+ if (width + widthExtra > truncationLimit) {
153
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
154
+ }
155
+ if (width + widthExtra > LIMIT) {
156
+ truncationEnabled = true;
157
+ break outer;
158
+ }
159
+ width += widthExtra;
160
+ unmatchedStart = indexPrev;
161
+ unmatchedEnd = index;
162
+ index = indexPrev = BLOCK_RE.lastIndex;
163
+ continue outer;
196
164
  }
197
- width += EMOJI_WIDTH;
198
- unmatchedStart = indexPrev;
199
- unmatchedEnd = index;
200
- index = indexPrev = EMOJI_RE.lastIndex;
201
- continue;
202
165
  }
203
166
  index += 1;
204
167
  }
@@ -213,10 +176,10 @@ var init_dist = __esm({
213
176
  }
214
177
  });
215
178
 
216
- // node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
179
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
217
180
  var NO_TRUNCATION2, fastStringWidth, dist_default2;
218
181
  var init_dist2 = __esm({
219
- "node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
182
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
220
183
  init_utils2();
221
184
  init_dist();
222
185
  NO_TRUNCATION2 = {
@@ -231,13 +194,13 @@ var init_dist2 = __esm({
231
194
  }
232
195
  });
233
196
 
234
- // node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
197
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
235
198
  function wrapAnsi(string, columns, options) {
236
199
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
237
200
  }
238
201
  var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
239
202
  var init_main = __esm({
240
- "node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
203
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
241
204
  init_utils2();
242
205
  init_dist2();
243
206
  ESC = "\x1B";
@@ -401,16 +364,19 @@ var init_main = __esm({
401
364
  }
402
365
  const preString = rows.join("\n");
403
366
  let inSurrogate = false;
404
- for (let i = 0; i < preString.length; i++) {
405
- const character = preString[i];
367
+ for (let i2 = 0; i2 < preString.length; i2++) {
368
+ const character = preString[i2];
406
369
  returnValue += character;
407
370
  if (!inSurrogate) {
408
371
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
372
+ if (inSurrogate) {
373
+ continue;
374
+ }
409
375
  } else {
410
- continue;
376
+ inSurrogate = false;
411
377
  }
412
378
  if (character === ESC || character === CSI) {
413
- GROUP_REGEX.lastIndex = i + 1;
379
+ GROUP_REGEX.lastIndex = i2 + 1;
414
380
  const groupsResult = GROUP_REGEX.exec(preString);
415
381
  const groups = groupsResult?.groups;
416
382
  if (groups?.code !== void 0) {
@@ -420,7 +386,7 @@ var init_main = __esm({
420
386
  escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
421
387
  }
422
388
  }
423
- if (preString[i + 1] === "\n") {
389
+ if (preString[i2 + 1] === "\n") {
424
390
  if (escapeUrl) {
425
391
  returnValue += wrapAnsiHyperlink("");
426
392
  }
@@ -451,7 +417,7 @@ var require_src = __commonJS({
451
417
  var ESC2 = "\x1B";
452
418
  var CSI2 = `${ESC2}[`;
453
419
  var beep = "\x07";
454
- var cursor = {
420
+ var cursor3 = {
455
421
  to(x, y2) {
456
422
  if (!y2) return `${CSI2}${x + 1}G`;
457
423
  return `${CSI2}${y2 + 1};${x + 1}H`;
@@ -480,7 +446,7 @@ var require_src = __commonJS({
480
446
  up: (count = 1) => `${CSI2}S`.repeat(count),
481
447
  down: (count = 1) => `${CSI2}T`.repeat(count)
482
448
  };
483
- var erase = {
449
+ var erase3 = {
484
450
  screen: `${CSI2}2J`,
485
451
  up: (count = 1) => `${CSI2}1J`.repeat(count),
486
452
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -489,89 +455,169 @@ var require_src = __commonJS({
489
455
  lineStart: `${CSI2}1K`,
490
456
  lines(count) {
491
457
  let clear = "";
492
- for (let i = 0; i < count; i++)
493
- clear += this.line + (i < count - 1 ? cursor.up() : "");
458
+ for (let i2 = 0; i2 < count; i2++)
459
+ clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
494
460
  if (count)
495
- clear += cursor.left;
461
+ clear += cursor3.left;
496
462
  return clear;
497
463
  }
498
464
  };
499
- module.exports = { cursor, scroll, erase, beep };
465
+ module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
500
466
  }
501
467
  });
502
468
 
503
- // node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
504
- import { styleText as y } from "node:util";
505
- import { stdout as S, stdin as $ } from "node:process";
506
- import * as _ from "node:readline";
507
- import P from "node:readline";
508
- import { ReadStream as D } from "node:tty";
509
- function d(r, t2, e) {
510
- if (!e.some((o) => !o.disabled)) return r;
511
- const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
512
- return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
469
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
470
+ import { styleText } from "node:util";
471
+ import { stdout, stdin } from "node:process";
472
+ import * as l from "node:readline";
473
+ import l__default from "node:readline";
474
+ import { ReadStream } from "node:tty";
475
+ function findCursor(s, o, l2) {
476
+ if (!l2.some((r2) => !r2.disabled))
477
+ return s;
478
+ const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
479
+ return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
480
+ }
481
+ function isAccessible(n3) {
482
+ if (n3 !== void 0) return n3;
483
+ if (settings.accessible !== void 0) return settings.accessible;
484
+ const e = process.env.ACCESSIBLE;
485
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
513
486
  }
514
- function V(r, t2) {
515
- if (typeof r == "string") return u.aliases.get(r) === t2;
516
- for (const e of r) if (e !== void 0 && V(e, t2)) return true;
487
+ function isActionKey(n3, e) {
488
+ if (typeof n3 == "string")
489
+ return settings.aliases.get(n3) === e;
490
+ for (const s of n3)
491
+ if (s !== void 0 && isActionKey(s, e))
492
+ return true;
517
493
  return false;
518
494
  }
519
- function j(r, t2) {
520
- if (r === t2) return;
521
- const e = r.split(`
522
- `), s = t2.split(`
523
- `), i = Math.max(e.length, s.length), n = [];
524
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
525
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
495
+ function diffLines(i2, s) {
496
+ if (i2 === s) return;
497
+ const e = i2.split(`
498
+ `), t2 = s.split(`
499
+ `), r2 = Math.max(e.length, t2.length), f = [];
500
+ for (let n3 = 0; n3 < r2; n3++)
501
+ e[n3] !== t2[n3] && f.push(n3);
502
+ return {
503
+ lines: f,
504
+ numLinesBefore: e.length,
505
+ numLinesAfter: t2.length,
506
+ numLines: r2
507
+ };
526
508
  }
527
- function q(r) {
528
- return r === C;
509
+ function isCancel(e) {
510
+ return e === CANCEL_SYMBOL;
529
511
  }
530
- function w(r, t2) {
531
- const e = r;
532
- e.isTTY && e.setRawMode(t2);
512
+ function setRawMode(e, r2) {
513
+ const o = e;
514
+ o.isTTY && o.setRawMode(r2);
533
515
  }
534
- function z({ input: r = $, output: t2 = S, overwrite: e = true, hideCursor: s = true } = {}) {
535
- const i = _.createInterface({ input: r, output: t2, prompt: "", tabSize: 1 });
536
- _.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
537
- const n = (o, { name: a, sequence: h }) => {
538
- const l = String(o);
539
- if (V([l, a, h], "cancel")) {
540
- s && t2.write(import_sisteransi.cursor.show), process.exit(0);
516
+ function block({
517
+ input: e = stdin,
518
+ output: r2 = stdout,
519
+ overwrite: o = true,
520
+ hideCursor: n3 = true
521
+ } = {}) {
522
+ const s = l.createInterface({
523
+ input: e,
524
+ output: r2,
525
+ prompt: "",
526
+ tabSize: 1
527
+ });
528
+ l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
529
+ const t2 = (f, { name: a2, sequence: w }) => {
530
+ const c2 = String(f);
531
+ if (isActionKey([c2, a2, w], "cancel")) {
532
+ n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
541
533
  return;
542
534
  }
543
- if (!e) return;
544
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
545
- _.moveCursor(t2, f, v, () => {
546
- _.clearLine(t2, 1, () => {
547
- r.once("keypress", n);
535
+ if (!o) return;
536
+ const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
537
+ l.moveCursor(r2, i2, m, () => {
538
+ l.clearLine(r2, 1, () => {
539
+ e.once("keypress", t2);
548
540
  });
549
541
  });
550
542
  };
551
- return s && t2.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
552
- r.off("keypress", n), s && t2.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
543
+ return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
544
+ e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
553
545
  };
554
546
  }
555
- function R(r, t2, e, s = e) {
556
- const i = O(r ?? S);
557
- return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
558
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
547
+ function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
548
+ const f = getColumns(e ?? stdout);
549
+ return wrapAnsi(r2, f - o.length, {
550
+ hard: true,
551
+ trim: false
552
+ }).split(`
553
+ `).map((c2, i2, m) => {
554
+ const d = t2 ? t2(c2, i2) : c2;
555
+ return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
556
+ }).join(`
559
557
  `);
560
558
  }
561
- var import_sisteransi, E, G, u, Y, C, O, A, p, nt;
559
+ function runValidation(e, a2) {
560
+ if ("~standard" in e) {
561
+ const n3 = e["~standard"].validate(a2);
562
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
563
+ }
564
+ return e(a2);
565
+ }
566
+ var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
562
567
  var init_dist3 = __esm({
563
- "node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
568
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
564
569
  init_utils2();
565
570
  init_main();
566
571
  import_sisteransi = __toESM(require_src(), 1);
567
- E = ["up", "down", "left", "right", "space", "enter", "cancel"];
568
- G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
569
- u = { actions: new Set(E), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t2) => `There are only ${r} days in ${t2}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
570
- Y = globalThis.process.platform.startsWith("win");
571
- C = /* @__PURE__ */ Symbol("clack:cancel");
572
- O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
573
- A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
574
- p = class {
572
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
573
+ t = [
574
+ "January",
575
+ "February",
576
+ "March",
577
+ "April",
578
+ "May",
579
+ "June",
580
+ "July",
581
+ "August",
582
+ "September",
583
+ "October",
584
+ "November",
585
+ "December"
586
+ ];
587
+ settings = {
588
+ actions: new Set(a$1),
589
+ aliases: /* @__PURE__ */ new Map([
590
+ // vim support
591
+ ["k", "up"],
592
+ ["j", "down"],
593
+ ["h", "left"],
594
+ ["l", "right"],
595
+ ["", "cancel"],
596
+ // opinionated defaults!
597
+ ["escape", "cancel"]
598
+ ]),
599
+ messages: {
600
+ cancel: "Canceled",
601
+ error: "Something went wrong"
602
+ },
603
+ withGuide: true,
604
+ accessible: void 0,
605
+ date: {
606
+ monthNames: [...t],
607
+ messages: {
608
+ required: "Please enter a valid date",
609
+ invalidMonth: "There are only 12 months in a year",
610
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
611
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
612
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
613
+ }
614
+ }
615
+ };
616
+ R = globalThis.process.platform.startsWith("win");
617
+ CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
618
+ getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
619
+ getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
620
+ y = class {
575
621
  input;
576
622
  output;
577
623
  _abortSignal;
@@ -586,46 +632,92 @@ var init_dist3 = __esm({
586
632
  error = "";
587
633
  value;
588
634
  userInput = "";
635
+ /**
636
+ * Whether accessible (static, screen-reader friendly) output is enabled for
637
+ * this prompt, resolved from the `accessible` option, the global setting,
638
+ * and the `ACCESSIBLE` env var.
639
+ */
640
+ get accessible() {
641
+ return isAccessible(this.opts.accessible);
642
+ }
589
643
  constructor(t2, e = true) {
590
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
591
- this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
644
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
645
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
592
646
  }
647
+ /**
648
+ * Unsubscribe all listeners
649
+ */
593
650
  unsubscribe() {
594
651
  this._subscribers.clear();
595
652
  }
653
+ /**
654
+ * Set a subscriber with opts
655
+ * @param event - The event name
656
+ */
596
657
  setSubscriber(t2, e) {
597
- const s = this._subscribers.get(t2) ?? [];
598
- s.push(e), this._subscribers.set(t2, s);
658
+ const i2 = this._subscribers.get(t2) ?? [];
659
+ i2.push(e), this._subscribers.set(t2, i2);
599
660
  }
661
+ /**
662
+ * Subscribe to an event
663
+ * @param event - The event name
664
+ * @param cb - The callback
665
+ */
600
666
  on(t2, e) {
601
667
  this.setSubscriber(t2, { cb: e });
602
668
  }
669
+ /**
670
+ * Subscribe to an event once
671
+ * @param event - The event name
672
+ * @param cb - The callback
673
+ */
603
674
  once(t2, e) {
604
675
  this.setSubscriber(t2, { cb: e, once: true });
605
676
  }
677
+ /**
678
+ * Emit an event with data
679
+ * @param event - The event name
680
+ * @param data - The data to pass to the callback
681
+ */
606
682
  emit(t2, ...e) {
607
- const s = this._subscribers.get(t2) ?? [], i = [];
608
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
609
- for (const n of i) n();
683
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
684
+ for (const r2 of i2)
685
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
686
+ for (const r2 of s)
687
+ r2();
610
688
  }
611
689
  prompt() {
612
690
  return new Promise((t2) => {
613
691
  if (this._abortSignal) {
614
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
615
- this._abortSignal.addEventListener("abort", () => {
616
- this.state = "cancel", this.close();
617
- }, { once: true });
692
+ if (this._abortSignal.aborted)
693
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
694
+ this._abortSignal.addEventListener(
695
+ "abort",
696
+ () => {
697
+ this.state = "cancel", this.close();
698
+ },
699
+ { once: true }
700
+ );
618
701
  }
619
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
620
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
702
+ this.rl = l__default.createInterface({
703
+ input: this.input,
704
+ tabSize: 2,
705
+ prompt: "",
706
+ escapeCodeTimeout: 50,
707
+ terminal: true
708
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
709
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
621
710
  }), this.once("cancel", () => {
622
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
711
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
623
712
  });
624
713
  });
625
714
  }
626
715
  _isActionKey(t2, e) {
627
716
  return t2 === " ";
628
717
  }
718
+ _shouldSubmit(t2, e) {
719
+ return true;
720
+ }
629
721
  _setValue(t2) {
630
722
  this.value = t2, this.emit("value", this.value);
631
723
  }
@@ -635,19 +727,22 @@ var init_dist3 = __esm({
635
727
  _clearUserInput() {
636
728
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
637
729
  }
638
- onKeypress(t2, e) {
639
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
640
- if (this.opts.validate) {
641
- const s = this.opts.validate(this.value);
642
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
730
+ async onKeypress(t2, e) {
731
+ if (this.state !== "validating") {
732
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
733
+ if (this.opts.validate) {
734
+ const i2 = runValidation(this.opts.validate, this.value);
735
+ let s;
736
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
737
+ }
738
+ this.state !== "error" && (this.state = "submit");
643
739
  }
644
- this.state !== "error" && (this.state = "submit");
740
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
645
741
  }
646
- V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
647
742
  }
648
743
  close() {
649
744
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
650
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
745
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
651
746
  }
652
747
  restoreCursor() {
653
748
  const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
@@ -655,34 +750,39 @@ var init_dist3 = __esm({
655
750
  this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
656
751
  }
657
752
  render() {
658
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
753
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
754
+ hard: true,
755
+ trim: false
756
+ });
659
757
  if (t2 !== this._prevFrame) {
660
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
758
+ if (this.state === "initial")
759
+ this.output.write(import_sisteransi.cursor.hide);
661
760
  else {
662
- const e = j(this._prevFrame, t2), s = A(this.output);
761
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
663
762
  if (this.restoreCursor(), e) {
664
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
665
- let o = e.lines.find((a) => a >= i);
666
- if (o === void 0) {
763
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
764
+ let n3 = e.lines.find((o) => o >= s);
765
+ if (n3 === void 0) {
667
766
  this._prevFrame = t2;
668
767
  return;
669
768
  }
670
769
  if (e.lines.length === 1) {
671
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
672
- const a = t2.split(`
770
+ this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
771
+ const o = t2.split(`
673
772
  `);
674
- this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
773
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
675
774
  return;
676
775
  } else if (e.lines.length > 1) {
677
- if (i < n) o = i;
776
+ if (s < r2)
777
+ n3 = s;
678
778
  else {
679
- const h = o - n;
680
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
779
+ const h2 = n3 - r2;
780
+ h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
681
781
  }
682
782
  this.output.write(import_sisteransi.erase.down());
683
- const a = t2.split(`
684
- `).slice(o);
685
- this.output.write(a.join(`
783
+ const f = t2.split(`
784
+ `).slice(n3);
785
+ this.output.write(f.join(`
686
786
  `)), this._prevFrame = t2;
687
787
  return;
688
788
  }
@@ -693,27 +793,28 @@ var init_dist3 = __esm({
693
793
  }
694
794
  }
695
795
  };
696
- nt = class extends p {
796
+ n$1 = class n extends y {
697
797
  options;
698
798
  cursor = 0;
699
799
  get _selectedValue() {
700
800
  return this.options[this.cursor];
701
801
  }
702
802
  changeValue() {
703
- this.value = this._selectedValue.value;
704
- }
705
- constructor(t2) {
706
- super(t2, false), this.options = t2.options;
707
- const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
708
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
709
- switch (i) {
803
+ const e = this._selectedValue;
804
+ this.value = e === void 0 ? void 0 : e.value;
805
+ }
806
+ constructor(e) {
807
+ super(e, false), this.options = e.options;
808
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
809
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
810
+ switch (s) {
710
811
  case "left":
711
812
  case "up":
712
- this.cursor = d(this.cursor, -1, this.options);
813
+ this.cursor = findCursor(this.cursor, -1, this.options);
713
814
  break;
714
815
  case "down":
715
816
  case "right":
716
- this.cursor = d(this.cursor, 1, this.options);
817
+ this.cursor = findCursor(this.cursor, 1, this.options);
717
818
  break;
718
819
  }
719
820
  this.changeValue();
@@ -723,260 +824,404 @@ var init_dist3 = __esm({
723
824
  }
724
825
  });
725
826
 
726
- // node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
727
- import { styleText as t, stripVTControlCharacters as ne } from "node:util";
728
- import P2 from "node:process";
729
- import { existsSync as Xe, lstatSync as we, readdirSync as ze } from "node:fs";
730
- import { dirname as be, join as Qe } from "node:path";
731
- function Ze() {
732
- return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
827
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
828
+ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
829
+ import process$1 from "node:process";
830
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
831
+ import { dirname, join } from "node:path";
832
+ function isUnicodeSupported() {
833
+ if (process$1.platform !== "win32") {
834
+ return process$1.env.TERM !== "linux";
835
+ }
836
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
837
+ }
838
+ function formatInstructionFooter(o, e) {
839
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
840
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
733
841
  }
734
- var import_sisteransi2, ee, ae, w2, _e, oe, ue, F, le, d2, E2, Ie, Ee, z2, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ye, et2, Y2, O2, pt, ft, vt, wt, Ct, fe, Ve, re, _t, je;
842
+ var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, cancel, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
735
843
  var init_dist4 = __esm({
736
- "node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
844
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
737
845
  init_utils2();
738
846
  init_dist3();
739
847
  init_dist3();
740
848
  init_main();
741
849
  init_dist2();
742
850
  import_sisteransi2 = __toESM(require_src(), 1);
743
- ee = Ze();
744
- ae = () => process.env.CI === "true";
745
- w2 = (e, i) => ee ? e : i;
746
- _e = w2("\u25C6", "*");
747
- oe = w2("\u25A0", "x");
748
- ue = w2("\u25B2", "x");
749
- F = w2("\u25C7", "o");
750
- le = w2("\u250C", "T");
751
- d2 = w2("\u2502", "|");
752
- E2 = w2("\u2514", "\u2014");
753
- Ie = w2("\u2510", "T");
754
- Ee = w2("\u2518", "\u2014");
755
- z2 = w2("\u25CF", ">");
756
- H2 = w2("\u25CB", " ");
757
- te = w2("\u25FB", "[\u2022]");
758
- U = w2("\u25FC", "[+]");
759
- J = w2("\u25FB", "[ ]");
760
- xe = w2("\u25AA", "\u2022");
761
- se = w2("\u2500", "-");
762
- ce = w2("\u256E", "+");
763
- Ge = w2("\u251C", "+");
764
- $e = w2("\u256F", "+");
765
- de = w2("\u2570", "+");
766
- Oe = w2("\u256D", "+");
767
- he = w2("\u25CF", "\u2022");
768
- pe = w2("\u25C6", "*");
769
- me = w2("\u25B2", "!");
770
- ge = w2("\u25A0", "x");
771
- V2 = (e) => {
772
- switch (e) {
851
+ unicode = isUnicodeSupported();
852
+ isCI = () => process.env.CI === "true";
853
+ unicodeOr = (o, e) => unicode ? o : e;
854
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
855
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
856
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
857
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
858
+ S_BAR_START = unicodeOr("\u250C", "T");
859
+ S_BAR = unicodeOr("\u2502", "|");
860
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
861
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
862
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
863
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
864
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
865
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
866
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
867
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
868
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
869
+ S_BAR_H = unicodeOr("\u2500", "-");
870
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
871
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
872
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
873
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
874
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
875
+ S_INFO = unicodeOr("\u25CF", "\u2022");
876
+ S_SUCCESS = unicodeOr("\u25C6", "*");
877
+ S_WARN = unicodeOr("\u25B2", "!");
878
+ S_ERROR = unicodeOr("\u25A0", "x");
879
+ symbol = (o) => {
880
+ switch (o) {
773
881
  case "initial":
774
882
  case "active":
775
- return t("cyan", _e);
883
+ return styleText2("cyan", S_STEP_ACTIVE);
776
884
  case "cancel":
777
- return t("red", oe);
885
+ return styleText2("red", S_STEP_CANCEL);
778
886
  case "error":
779
- return t("yellow", ue);
887
+ return styleText2("yellow", S_STEP_ERROR);
780
888
  case "submit":
781
- return t("green", F);
889
+ return styleText2("green", S_STEP_SUBMIT);
890
+ case "validating":
891
+ return styleText2("dim", S_STEP_ACTIVE);
782
892
  }
783
893
  };
784
- ye = (e) => {
785
- switch (e) {
894
+ symbolBar = (o) => {
895
+ switch (o) {
786
896
  case "initial":
787
897
  case "active":
788
- return t("cyan", d2);
898
+ return styleText2("cyan", S_BAR);
789
899
  case "cancel":
790
- return t("red", d2);
900
+ return styleText2("red", S_BAR);
791
901
  case "error":
792
- return t("yellow", d2);
902
+ return styleText2("yellow", S_BAR);
793
903
  case "submit":
794
- return t("green", d2);
795
- }
796
- };
797
- et2 = (e, i, s, r, u2) => {
798
- let n = i, o = 0;
799
- for (let c2 = s; c2 < r; c2++) {
800
- const a = e[c2];
801
- if (n = n - a.length, o++, n <= u2) break;
802
- }
803
- return { lineCount: n, removals: o };
804
- };
805
- Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
806
- const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
807
- let p2 = 0;
808
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
809
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
810
- const S2 = Math.min(p2 + y2, i.length), h = [];
904
+ return styleText2("green", S_BAR);
905
+ }
906
+ };
907
+ I = (l2, e, w, p, b, C2 = false) => {
908
+ let r2 = e, O = 0;
909
+ if (C2)
910
+ for (let i2 = p - 1; i2 >= w; i2--) {
911
+ const m = l2[i2];
912
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
913
+ }
914
+ else
915
+ for (let i2 = w; i2 < p; i2++) {
916
+ const m = l2[i2];
917
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
918
+ }
919
+ return { lineCount: r2, removals: O };
920
+ };
921
+ limitOptions = ({
922
+ cursor: l2,
923
+ options: e,
924
+ style: w,
925
+ output: p = process.stdout,
926
+ maxItems: b = Number.POSITIVE_INFINITY,
927
+ columnPadding: C2 = 0,
928
+ rowPadding: r2 = 4
929
+ }) => {
930
+ const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
811
931
  let f = 0;
812
- m && f++, g && f++;
813
- const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
814
- for (let b = v; b < T; b++) {
815
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
932
+ l2 >= a2 - 3 && (f = Math.max(
933
+ Math.min(l2 - a2 + 3, e.length - a2),
934
+ 0
935
+ ));
936
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
937
+ const W2 = Math.min(
938
+ f + a2,
939
+ e.length
940
+ ), s = [];
941
+ let g = 0;
942
+ d && g++, c2 && g++;
943
+ const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
944
+ for (let t2 = T; t2 < y2; t2++) {
945
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
946
+ hard: true,
947
+ trim: false
948
+ }).split(`
816
949
  `);
817
- h.push(x), f += x.length;
818
- }
819
- if (f > $2) {
820
- let b = 0, x = 0, G2 = f;
821
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
822
- m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
823
- }
824
- const C2 = [];
825
- m && C2.push(l);
826
- for (const b of h) for (const x of b) C2.push(x);
827
- return g && C2.push(l), C2;
828
- };
829
- O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
830
- const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
831
- for (let p2 = 0; p2 < u2; p2++) o.push(a);
832
- const y2 = Array.isArray(e) ? e : e.split(`
950
+ s.push(h2), g += h2.length;
951
+ }
952
+ if (g > v) {
953
+ let t2 = 0, n3 = 0, o = g;
954
+ const h2 = l2 - T;
955
+ let u3 = v;
956
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
957
+ s,
958
+ o,
959
+ h2 + 1,
960
+ s.length,
961
+ u3,
962
+ true
963
+ );
964
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
965
+ }
966
+ const x = [];
967
+ d && x.push(M);
968
+ for (const t2 of s)
969
+ for (const n3 of t2)
970
+ x.push(n3);
971
+ return c2 && x.push(M), x;
972
+ };
973
+ MULTISELECT_INSTRUCTIONS = [
974
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
975
+ `${styleText2("dim", "Space:")} select`,
976
+ `${styleText2("dim", "Enter:")} confirm`
977
+ ];
978
+ log = {
979
+ message: (s = [], {
980
+ symbol: e = styleText2("gray", S_BAR),
981
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
982
+ output: m = process.stdout,
983
+ spacing: l2 = 1,
984
+ withGuide: c2
985
+ } = {}) => {
986
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
987
+ for (let i2 = 0; i2 < l2; i2++)
988
+ t2.push(f);
989
+ const g = Array.isArray(s) ? s : s.split(`
833
990
  `);
834
- if (y2.length > 0) {
835
- const [p2, ...m] = y2;
836
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
837
- for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
838
- }
839
- r.write(`${o.join(`
991
+ if (g.length > 0) {
992
+ const [i2, ...y2] = g;
993
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
994
+ for (const p of y2)
995
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
996
+ }
997
+ m.write(`${t2.join(`
840
998
  `)}
841
999
  `);
842
- }, info: (e, i) => {
843
- O2.message(e, { ...i, symbol: t("blue", he) });
844
- }, success: (e, i) => {
845
- O2.message(e, { ...i, symbol: t("green", pe) });
846
- }, step: (e, i) => {
847
- O2.message(e, { ...i, symbol: t("green", F) });
848
- }, warn: (e, i) => {
849
- O2.message(e, { ...i, symbol: t("yellow", me) });
850
- }, warning: (e, i) => {
851
- O2.warn(e, i);
852
- }, error: (e, i) => {
853
- O2.message(e, { ...i, symbol: t("red", ge) });
854
- } };
855
- pt = (e = "", i) => {
856
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
857
- s.write(`${r}${t("red", e)}
1000
+ },
1001
+ info: (s, e) => {
1002
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
1003
+ },
1004
+ success: (s, e) => {
1005
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
1006
+ },
1007
+ step: (s, e) => {
1008
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
1009
+ },
1010
+ warn: (s, e) => {
1011
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
1012
+ },
1013
+ /** alias for `log.warn()`. */
1014
+ warning: (s, e) => {
1015
+ log.warn(s, e);
1016
+ },
1017
+ error: (s, e) => {
1018
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
1019
+ }
1020
+ };
1021
+ cancel = (o = "", t2) => {
1022
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
1023
+ i2.write(`${e}${styleText2("red", o)}
858
1024
 
859
1025
  `);
860
1026
  };
861
- ft = (e) => t("dim", e);
862
- vt = (e, i, s) => {
863
- const r = { hard: true, trim: false }, u2 = wrapAnsi(e, i, r).split(`
864
- `), n = u2.reduce((a, l) => Math.max(dist_default2(l), a), 0), o = u2.map(s).reduce((a, l) => Math.max(dist_default2(l), a), 0), c2 = i - (o - n);
865
- return wrapAnsi(e, c2, r);
866
- };
867
- wt = (e = "", i = "", s) => {
868
- const r = s?.output ?? P2.stdout, u2 = s?.withGuide ?? u.withGuide, n = s?.format ?? ft, o = ["", ...vt(e, O(r) - 6, n).split(`
869
- `).map(n), ""], c2 = dist_default2(i), a = Math.max(o.reduce((p2, m) => {
870
- const g = dist_default2(m);
871
- return g > p2 ? g : p2;
872
- }, 0), c2) + 2, l = o.map((p2) => `${t("gray", d2)} ${p2}${" ".repeat(a - dist_default2(p2))}${t("gray", d2)}`).join(`
873
- `), $2 = u2 ? `${t("gray", d2)}
874
- ` : "", y2 = u2 ? Ge : de;
875
- r.write(`${$2}${t("green", F)} ${t("reset", i)} ${t("gray", se.repeat(Math.max(a - c2 - 1, 1)) + ce)}
876
- ${l}
877
- ${t("gray", y2 + se.repeat(a + 2) + $e)}
878
- `);
1027
+ W$1 = (o) => o;
1028
+ C = (o, e, s) => {
1029
+ const a2 = {
1030
+ hard: true,
1031
+ trim: false
1032
+ }, i2 = wrapAnsi(o, e, a2).split(`
1033
+ `), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
1034
+ return wrapAnsi(o, g, a2);
1035
+ };
1036
+ note = (o = "", e = "", s) => {
1037
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
1038
+ `).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
1039
+ g.reduce((m, F) => {
1040
+ const O = dist_default2(F);
1041
+ return O > m ? O : m;
1042
+ }, 0),
1043
+ n3
1044
+ ) + 2, h2 = g.map(
1045
+ (m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
1046
+ ).join(`
1047
+ `), T = i2 ? `${styleText2("gray", S_BAR)}
1048
+ ` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
1049
+ a2.write(
1050
+ `${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
1051
+ "gray",
1052
+ S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
1053
+ )}
1054
+ ${h2}
1055
+ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1056
+ `
1057
+ );
879
1058
  };
880
- Ct = (e) => t("magenta", e);
881
- fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u2, frames: n = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = ee ? 80 : 120, signal: c2, ...a } = {}) => {
882
- const l = ae();
883
- let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
884
- const f = O(s), v = a?.styleFrame ?? Ct, T = (_2) => {
885
- const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
886
- m = _2 === 1, p2 && (W(A2, _2), m && typeof i == "function" && i());
887
- }, C2 = () => T(2), b = () => T(1), x = () => {
888
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T), c2 && c2.addEventListener("abort", b);
889
- }, G2 = () => {
890
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T), c2 && c2.removeEventListener("abort", b);
891
- }, M2 = () => {
892
- if (S2 === void 0) return;
893
- l && s.write(`
1059
+ W = (l2) => styleText2("magenta", l2);
1060
+ spinner = ({
1061
+ indicator: l2 = "dots",
1062
+ onCancel: h2,
1063
+ output: n3 = process.stdout,
1064
+ cancelMessage: G,
1065
+ errorMessage: O,
1066
+ frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1067
+ delay: F = unicode ? 80 : 120,
1068
+ signal: m,
1069
+ ...I2
1070
+ } = {}) => {
1071
+ const u3 = isCI();
1072
+ let M, T, d = false, S = false, s = "", p, w = performance.now();
1073
+ const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
1074
+ const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1075
+ S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
1076
+ }, f = () => g(2), i2 = () => g(1), A = () => {
1077
+ process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
1078
+ }, H = () => {
1079
+ process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
1080
+ }, y2 = () => {
1081
+ if (p === void 0) return;
1082
+ u3 && n3.write(`
894
1083
  `);
895
- const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1084
+ const r2 = wrapAnsi(p, x, {
1085
+ hard: true,
1086
+ trim: false
1087
+ }).split(`
896
1088
  `);
897
- _2.length > 1 && s.write(import_sisteransi2.cursor.up(_2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
898
- }, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
899
- const A2 = (performance.now() - _2) / 1e3, k = Math.floor(A2 / 60), L = Math.floor(A2 % 60);
900
- return k > 0 ? `[${k}m ${L}s]` : `[${L}s]`;
901
- }, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
902
- p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
1089
+ r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
1090
+ }, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
1091
+ const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
1092
+ return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
1093
+ }, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
1094
+ d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
903
1095
  `);
904
- let A2 = 0, k = 0;
905
- x(), y2 = setInterval(() => {
906
- if (l && g === S2) return;
907
- M2(), S2 = g;
908
- const L = v(n[A2]);
909
- let Z;
910
- if (l) Z = `${L} ${g}...`;
911
- else if (e === "timer") Z = `${L} ${g} ${j2(h)}`;
1096
+ let r2 = 0, t2 = 0;
1097
+ A(), T = setInterval(() => {
1098
+ if (u3 && s === p)
1099
+ return;
1100
+ y2(), p = s;
1101
+ const o = k(E[r2]);
1102
+ let v;
1103
+ if (u3)
1104
+ v = `${o} ${s}...`;
1105
+ else if (l2 === "timer")
1106
+ v = `${o} ${s} ${_(w)}`;
912
1107
  else {
913
- const Be = ".".repeat(Math.floor(k)).slice(0, 3);
914
- Z = `${L} ${g}${Be}`;
915
- }
916
- const Ne = wrapAnsi(Z, f, { hard: true, trim: false });
917
- s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k = k < 4 ? k + 0.125 : 0;
918
- }, o);
919
- }, W = (_2 = "", A2 = 0, k = false) => {
920
- if (!p2) return;
921
- p2 = false, clearInterval(y2), M2();
922
- const L = A2 === 0 ? t("green", F) : A2 === 1 ? t("red", oe) : t("red", ue);
923
- g = _2 ?? g, k || (e === "timer" ? s.write(`${L} ${g} ${j2(h)}
924
- `) : s.write(`${L} ${g}
925
- `)), G2(), $2();
1108
+ const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1109
+ v = `${o} ${s}${B}`;
1110
+ }
1111
+ const j = wrapAnsi(v, x, {
1112
+ hard: true,
1113
+ trim: false
1114
+ });
1115
+ n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1116
+ }, F);
1117
+ }, a2 = (e = "", r2 = 0, t2 = false) => {
1118
+ if (!d) return;
1119
+ d = false, clearInterval(T), y2();
1120
+ const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1121
+ s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
1122
+ `) : n3.write(`${o} ${s}
1123
+ `)), H(), M();
1124
+ };
1125
+ return {
1126
+ start: P,
1127
+ stop: (e = "") => a2(e, 0),
1128
+ message: (e = "") => {
1129
+ s = C2(e ?? s);
1130
+ },
1131
+ cancel: (e = "") => a2(e, 1),
1132
+ error: (e = "") => a2(e, 2),
1133
+ clear: () => a2("", 0, true),
1134
+ get isCancelled() {
1135
+ return S;
1136
+ }
926
1137
  };
927
- return { start: ie, stop: (_2 = "") => W(_2, 0), message: (_2 = "") => {
928
- g = R2(_2 ?? g);
929
- }, cancel: (_2 = "") => W(_2, 1), error: (_2 = "") => W(_2, 2), clear: () => W("", 0, true), get isCancelled() {
930
- return m;
931
- } };
932
- };
933
- Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
934
- re = (e, i) => e.includes(`
935
- `) ? e.split(`
936
- `).map((s) => i(s)).join(`
937
- `) : i(e);
938
- _t = (e) => {
939
- const i = (s, r) => {
940
- const u2 = s.label ?? String(s.value);
941
- switch (r) {
1138
+ };
1139
+ u2 = {
1140
+ light: unicodeOr("\u2500", "-"),
1141
+ heavy: unicodeOr("\u2501", "="),
1142
+ block: unicodeOr("\u2588", "#")
1143
+ };
1144
+ SELECT_INSTRUCTIONS = [
1145
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1146
+ `${styleText2("dim", "Enter:")} confirm`
1147
+ ];
1148
+ c = (t2, o) => t2.includes(`
1149
+ `) ? t2.split(`
1150
+ `).map((d) => o(d)).join(`
1151
+ `) : o(t2);
1152
+ select = (t2) => {
1153
+ const o = (n3, m) => {
1154
+ if (n3 === void 0)
1155
+ return "";
1156
+ const s = n3.label ?? String(n3.value);
1157
+ switch (m) {
942
1158
  case "disabled":
943
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1159
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
944
1160
  case "selected":
945
- return `${re(u2, (n) => t("dim", n))}`;
1161
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
946
1162
  case "active":
947
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1163
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
948
1164
  case "cancelled":
949
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1165
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
950
1166
  default:
951
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
952
- }
953
- };
954
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
955
- const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
956
- ` : ""}${n}
1167
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1168
+ }
1169
+ }, d = t2.showInstructions ?? true;
1170
+ return new n$1({
1171
+ options: t2.options,
1172
+ signal: t2.signal,
1173
+ input: t2.input,
1174
+ output: t2.output,
1175
+ initialValue: t2.initialValue,
1176
+ render() {
1177
+ const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
1178
+ t2.output,
1179
+ t2.message,
1180
+ s,
1181
+ m
1182
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
1183
+ ` : ""}${i2}
957
1184
  `;
958
- switch (this.state) {
959
- case "submit": {
960
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
961
- return `${o}${a}`;
962
- }
963
- case "cancel": {
964
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
965
- return `${o}${a}${s ? `
966
- ${t("gray", d2)}` : ""}`;
967
- }
968
- default: {
969
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
970
- `).length, $2 = s ? 2 : 1;
971
- return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
972
- ${c2}`)}
973
- ${a}
1185
+ switch (this.state) {
1186
+ case "submit": {
1187
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1188
+ t2.output,
1189
+ o(this.options[this.cursor], "selected"),
1190
+ r2
1191
+ );
1192
+ return `${u3}${a2}`;
1193
+ }
1194
+ case "cancel": {
1195
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1196
+ t2.output,
1197
+ o(this.options[this.cursor], "cancelled"),
1198
+ r2
1199
+ );
1200
+ return `${u3}${a2}${n3 ? `
1201
+ ${styleText2("gray", S_BAR)}` : ""}`;
1202
+ }
1203
+ default: {
1204
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1205
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1206
+ `), b = p.length + 1;
1207
+ return `${u3}${r2}${limitOptions({
1208
+ output: t2.output,
1209
+ cursor: this.cursor,
1210
+ options: this.options,
1211
+ maxItems: t2.maxItems,
1212
+ columnPadding: r2.length,
1213
+ rowPadding: a2 + b,
1214
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1215
+ }).join(`
1216
+ ${r2}`)}
1217
+ ${f}
974
1218
  `;
1219
+ }
975
1220
  }
976
1221
  }
977
- } }).prompt();
1222
+ }).prompt();
978
1223
  };
979
- je = `${t("gray", d2)} `;
1224
+ i = `${styleText2("gray", S_BAR)} `;
980
1225
  }
981
1226
  });
982
1227
 
@@ -989,9 +1234,9 @@ function supportsColor() {
989
1234
  }
990
1235
  return process.stdout.isTTY === true;
991
1236
  }
992
- function colorize(text, color) {
993
- if (!supportsColor()) return text;
994
- return `${color}${text}${colors.reset}`;
1237
+ function colorize(text2, color) {
1238
+ if (!supportsColor()) return text2;
1239
+ return `${color}${text2}${colors.reset}`;
995
1240
  }
996
1241
  function stringify(value) {
997
1242
  if (typeof value === "string") return value;
@@ -1021,7 +1266,7 @@ function stringify(value) {
1021
1266
  function formatMessage(...args) {
1022
1267
  return args.map(stringify).join(" ");
1023
1268
  }
1024
- var colors, currentLogLevel, log, error, warn, info, success;
1269
+ var colors, currentLogLevel, log2, error, warn, info, success;
1025
1270
  var init_cli_output = __esm({
1026
1271
  "packages/tooling/src/utils/cli-output.ts"() {
1027
1272
  "use strict";
@@ -1054,7 +1299,7 @@ var init_cli_output = __esm({
1054
1299
  currentLogLevel = envLevel;
1055
1300
  }
1056
1301
  }
1057
- log = {
1302
+ log2 = {
1058
1303
  /**
1059
1304
  * Logs an error message (always shows unless Quiet level)
1060
1305
  * Uses clack's log.error + explicit red color
@@ -1062,7 +1307,7 @@ var init_cli_output = __esm({
1062
1307
  error(...args) {
1063
1308
  if (currentLogLevel < 0 /* Quiet */) return;
1064
1309
  const message = formatMessage(...args);
1065
- O2.error(colorize(message, colors.brightRed));
1310
+ log.error(colorize(message, colors.brightRed));
1066
1311
  },
1067
1312
  /**
1068
1313
  * Logs a warning message (shows at Normal level and above)
@@ -1071,7 +1316,7 @@ var init_cli_output = __esm({
1071
1316
  warn(...args) {
1072
1317
  if (currentLogLevel < 1 /* Normal */) return;
1073
1318
  const message = formatMessage(...args);
1074
- O2.warn(colorize(message, colors.brightYellow));
1319
+ log.warn(colorize(message, colors.brightYellow));
1075
1320
  },
1076
1321
  /**
1077
1322
  * Logs an info message (shows at Normal level and above)
@@ -1080,7 +1325,7 @@ var init_cli_output = __esm({
1080
1325
  info(...args) {
1081
1326
  if (currentLogLevel < 1 /* Normal */) return;
1082
1327
  const message = formatMessage(...args);
1083
- O2.info(colorize(message, colors.brightCyan));
1328
+ log.info(colorize(message, colors.brightCyan));
1084
1329
  },
1085
1330
  /**
1086
1331
  * Logs a success message (shows at Normal level and above)
@@ -1089,7 +1334,7 @@ var init_cli_output = __esm({
1089
1334
  success(...args) {
1090
1335
  if (currentLogLevel < 1 /* Normal */) return;
1091
1336
  const message = formatMessage(...args);
1092
- O2.success(colorize(message, colors.brightGreen));
1337
+ log.success(colorize(message, colors.brightGreen));
1093
1338
  },
1094
1339
  /**
1095
1340
  * Logs a debug message (only shows at Verbose level and above)
@@ -1098,7 +1343,7 @@ var init_cli_output = __esm({
1098
1343
  debug(...args) {
1099
1344
  if (currentLogLevel < 2 /* Verbose */) return;
1100
1345
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1101
- O2.message(
1346
+ log.message(
1102
1347
  colorize(
1103
1348
  `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
1104
1349
  colors.gray
@@ -1112,7 +1357,7 @@ var init_cli_output = __esm({
1112
1357
  trace(...args) {
1113
1358
  if (currentLogLevel < 3 /* Debug */) return;
1114
1359
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1115
- O2.message(
1360
+ log.message(
1116
1361
  colorize(
1117
1362
  `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
1118
1363
  colors.gray
@@ -1120,10 +1365,10 @@ var init_cli_output = __esm({
1120
1365
  );
1121
1366
  }
1122
1367
  };
1123
- error = log.error.bind(log);
1124
- warn = log.warn.bind(log);
1125
- info = log.info.bind(log);
1126
- success = log.success.bind(log);
1368
+ error = log2.error.bind(log2);
1369
+ warn = log2.warn.bind(log2);
1370
+ info = log2.info.bind(log2);
1371
+ success = log2.success.bind(log2);
1127
1372
  }
1128
1373
  });
1129
1374
 
@@ -1483,9 +1728,9 @@ var require_is_glob = __commonJS({
1483
1728
  index += 2;
1484
1729
  var close = chars[open];
1485
1730
  if (close) {
1486
- var n = str.indexOf(close, index);
1487
- if (n !== -1) {
1488
- index = n + 1;
1731
+ var n3 = str.indexOf(close, index);
1732
+ if (n3 !== -1) {
1733
+ index = n3 + 1;
1489
1734
  }
1490
1735
  }
1491
1736
  if (str[index] === "!") {
@@ -1511,9 +1756,9 @@ var require_is_glob = __commonJS({
1511
1756
  index += 2;
1512
1757
  var close = chars[open];
1513
1758
  if (close) {
1514
- var n = str.indexOf(close, index);
1515
- if (n !== -1) {
1516
- index = n + 1;
1759
+ var n3 = str.indexOf(close, index);
1760
+ if (n3 !== -1) {
1761
+ index = n3 + 1;
1517
1762
  }
1518
1763
  }
1519
1764
  if (str[index] === "!") {
@@ -1591,8 +1836,8 @@ var require_utils = __commonJS({
1591
1836
  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
1592
1837
  return (Number(max) - Number(min)) / Number(step) >= limit;
1593
1838
  };
1594
- exports.escapeNode = (block, n = 0, type) => {
1595
- const node = block.nodes[n];
1839
+ exports.escapeNode = (block2, n3 = 0, type) => {
1840
+ const node = block2.nodes[n3];
1596
1841
  if (!node) return;
1597
1842
  if (type && node.type === type || node.type === "open" || node.type === "close") {
1598
1843
  if (node.escaped !== true) {
@@ -1609,15 +1854,15 @@ var require_utils = __commonJS({
1609
1854
  }
1610
1855
  return false;
1611
1856
  };
1612
- exports.isInvalidBrace = (block) => {
1613
- if (block.type !== "brace") return false;
1614
- if (block.invalid === true || block.dollar) return true;
1615
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
1616
- block.invalid = true;
1857
+ exports.isInvalidBrace = (block2) => {
1858
+ if (block2.type !== "brace") return false;
1859
+ if (block2.invalid === true || block2.dollar) return true;
1860
+ if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
1861
+ block2.invalid = true;
1617
1862
  return true;
1618
1863
  }
1619
- if (block.open !== true || block.close !== true) {
1620
- block.invalid = true;
1864
+ if (block2.open !== true || block2.close !== true) {
1865
+ block2.invalid = true;
1621
1866
  return true;
1622
1867
  }
1623
1868
  return false;
@@ -1636,8 +1881,8 @@ var require_utils = __commonJS({
1636
1881
  exports.flatten = (...args) => {
1637
1882
  const result = [];
1638
1883
  const flat = (arr) => {
1639
- for (let i = 0; i < arr.length; i++) {
1640
- const ele = arr[i];
1884
+ for (let i2 = 0; i2 < arr.length; i2++) {
1885
+ const ele = arr[i2];
1641
1886
  if (Array.isArray(ele)) {
1642
1887
  flat(ele);
1643
1888
  continue;
@@ -1731,9 +1976,9 @@ var require_to_regex_range = __commonJS({
1731
1976
  if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
1732
1977
  return toRegexRange.cache[cacheKey].result;
1733
1978
  }
1734
- let a = Math.min(min, max);
1979
+ let a2 = Math.min(min, max);
1735
1980
  let b = Math.max(min, max);
1736
- if (Math.abs(a - b) === 1) {
1981
+ if (Math.abs(a2 - b) === 1) {
1737
1982
  let result = min + "|" + max;
1738
1983
  if (opts.capture) {
1739
1984
  return `(${result})`;
@@ -1744,20 +1989,20 @@ var require_to_regex_range = __commonJS({
1744
1989
  return `(?:${result})`;
1745
1990
  }
1746
1991
  let isPadded = hasPadding(min) || hasPadding(max);
1747
- let state = { min, max, a, b };
1992
+ let state = { min, max, a: a2, b };
1748
1993
  let positives = [];
1749
1994
  let negatives = [];
1750
1995
  if (isPadded) {
1751
1996
  state.isPadded = isPadded;
1752
1997
  state.maxLen = String(state.max).length;
1753
1998
  }
1754
- if (a < 0) {
1999
+ if (a2 < 0) {
1755
2000
  let newMin = b < 0 ? Math.abs(b) : 1;
1756
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
1757
- a = state.a = 0;
2001
+ negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
2002
+ a2 = state.a = 0;
1758
2003
  }
1759
2004
  if (b >= 0) {
1760
- positives = splitToPatterns(a, b, state, opts);
2005
+ positives = splitToPatterns(a2, b, state, opts);
1761
2006
  }
1762
2007
  state.negatives = negatives;
1763
2008
  state.positives = positives;
@@ -1805,8 +2050,8 @@ var require_to_regex_range = __commonJS({
1805
2050
  let digits = zipped.length;
1806
2051
  let pattern = "";
1807
2052
  let count = 0;
1808
- for (let i = 0; i < digits; i++) {
1809
- let [startDigit, stopDigit] = zipped[i];
2053
+ for (let i2 = 0; i2 < digits; i2++) {
2054
+ let [startDigit, stopDigit] = zipped[i2];
1810
2055
  if (startDigit === stopDigit) {
1811
2056
  pattern += startDigit;
1812
2057
  } else if (startDigit !== "0" || stopDigit !== "9") {
@@ -1825,8 +2070,8 @@ var require_to_regex_range = __commonJS({
1825
2070
  let tokens = [];
1826
2071
  let start = min;
1827
2072
  let prev;
1828
- for (let i = 0; i < ranges.length; i++) {
1829
- let max2 = ranges[i];
2073
+ for (let i2 = 0; i2 < ranges.length; i2++) {
2074
+ let max2 = ranges[i2];
1830
2075
  let obj = rangeToPattern(String(start), String(max2), options);
1831
2076
  let zeros = "";
1832
2077
  if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
@@ -1861,13 +2106,13 @@ var require_to_regex_range = __commonJS({
1861
2106
  }
1862
2107
  return result;
1863
2108
  }
1864
- function zip(a, b) {
2109
+ function zip(a2, b) {
1865
2110
  let arr = [];
1866
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
2111
+ for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
1867
2112
  return arr;
1868
2113
  }
1869
- function compare(a, b) {
1870
- return a > b ? 1 : b > a ? -1 : 0;
2114
+ function compare(a2, b) {
2115
+ return a2 > b ? 1 : b > a2 ? -1 : 0;
1871
2116
  }
1872
2117
  function contains(arr, key, val) {
1873
2118
  return arr.some((ele) => ele[key] === val);
@@ -1885,8 +2130,8 @@ var require_to_regex_range = __commonJS({
1885
2130
  }
1886
2131
  return "";
1887
2132
  }
1888
- function toCharacterClass(a, b, options) {
1889
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
2133
+ function toCharacterClass(a2, b, options) {
2134
+ return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
1890
2135
  }
1891
2136
  function hasPadding(str) {
1892
2137
  return /^-?(0+)\d/.test(str);
@@ -1965,8 +2210,8 @@ var require_fill_range = __commonJS({
1965
2210
  return negative ? "-" + input : input;
1966
2211
  };
1967
2212
  var toSequence = (parts, options, maxLen) => {
1968
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1969
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
2213
+ parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
2214
+ parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
1970
2215
  let prefix = options.capture ? "" : "?:";
1971
2216
  let positives = "";
1972
2217
  let negatives = "";
@@ -1987,12 +2232,12 @@ var require_fill_range = __commonJS({
1987
2232
  }
1988
2233
  return result;
1989
2234
  };
1990
- var toRange = (a, b, isNumbers, options) => {
2235
+ var toRange = (a2, b, isNumbers, options) => {
1991
2236
  if (isNumbers) {
1992
- return toRegexRange(a, b, { wrap: false, ...options });
2237
+ return toRegexRange(a2, b, { wrap: false, ...options });
1993
2238
  }
1994
- let start = String.fromCharCode(a);
1995
- if (a === b) return start;
2239
+ let start = String.fromCharCode(a2);
2240
+ if (a2 === b) return start;
1996
2241
  let stop = String.fromCharCode(b);
1997
2242
  return `[${start}-${stop}]`;
1998
2243
  };
@@ -2018,15 +2263,15 @@ var require_fill_range = __commonJS({
2018
2263
  return [];
2019
2264
  };
2020
2265
  var fillNumbers = (start, end, step = 1, options = {}) => {
2021
- let a = Number(start);
2266
+ let a2 = Number(start);
2022
2267
  let b = Number(end);
2023
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
2268
+ if (!Number.isInteger(a2) || !Number.isInteger(b)) {
2024
2269
  if (options.strictRanges === true) throw rangeError([start, end]);
2025
2270
  return [];
2026
2271
  }
2027
- if (a === 0) a = 0;
2272
+ if (a2 === 0) a2 = 0;
2028
2273
  if (b === 0) b = 0;
2029
- let descending = a > b;
2274
+ let descending = a2 > b;
2030
2275
  let startString = String(start);
2031
2276
  let endString = String(end);
2032
2277
  let stepString = String(step);
@@ -2042,13 +2287,13 @@ var require_fill_range = __commonJS({
2042
2287
  let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
2043
2288
  let range = [];
2044
2289
  let index = 0;
2045
- while (descending ? a >= b : a <= b) {
2290
+ while (descending ? a2 >= b : a2 <= b) {
2046
2291
  if (options.toRegex === true && step > 1) {
2047
- push(a);
2292
+ push(a2);
2048
2293
  } else {
2049
- range.push(pad(format(a, index), maxLen, toNumber));
2294
+ range.push(pad(format(a2, index), maxLen, toNumber));
2050
2295
  }
2051
- a = descending ? a - step : a + step;
2296
+ a2 = descending ? a2 - step : a2 + step;
2052
2297
  index++;
2053
2298
  }
2054
2299
  if (options.toRegex === true) {
@@ -2061,19 +2306,19 @@ var require_fill_range = __commonJS({
2061
2306
  return invalidRange(start, end, options);
2062
2307
  }
2063
2308
  let format = options.transform || ((val) => String.fromCharCode(val));
2064
- let a = `${start}`.charCodeAt(0);
2309
+ let a2 = `${start}`.charCodeAt(0);
2065
2310
  let b = `${end}`.charCodeAt(0);
2066
- let descending = a > b;
2067
- let min = Math.min(a, b);
2068
- let max = Math.max(a, b);
2311
+ let descending = a2 > b;
2312
+ let min = Math.min(a2, b);
2313
+ let max = Math.max(a2, b);
2069
2314
  if (options.toRegex && step === 1) {
2070
2315
  return toRange(min, max, false, options);
2071
2316
  }
2072
2317
  let range = [];
2073
2318
  let index = 0;
2074
- while (descending ? a >= b : a <= b) {
2075
- range.push(format(a, index));
2076
- a = descending ? a - step : a + step;
2319
+ while (descending ? a2 >= b : a2 <= b) {
2320
+ range.push(format(a2, index));
2321
+ a2 = descending ? a2 - step : a2 + step;
2077
2322
  index++;
2078
2323
  }
2079
2324
  if (options.toRegex === true) {
@@ -2196,18 +2441,18 @@ var require_expand = __commonJS({
2196
2441
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
2197
2442
  const walk = (node, parent = {}) => {
2198
2443
  node.queue = [];
2199
- let p2 = parent;
2200
- let q2 = parent.queue;
2201
- while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
2202
- p2 = p2.parent;
2203
- q2 = p2.queue;
2444
+ let p = parent;
2445
+ let q = parent.queue;
2446
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
2447
+ p = p.parent;
2448
+ q = p.queue;
2204
2449
  }
2205
2450
  if (node.invalid || node.dollar) {
2206
- q2.push(append(q2.pop(), stringify2(node, options)));
2451
+ q.push(append(q.pop(), stringify2(node, options)));
2207
2452
  return;
2208
2453
  }
2209
2454
  if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
2210
- q2.push(append(q2.pop(), ["{}"]));
2455
+ q.push(append(q.pop(), ["{}"]));
2211
2456
  return;
2212
2457
  }
2213
2458
  if (node.nodes && node.ranges > 0) {
@@ -2219,26 +2464,26 @@ var require_expand = __commonJS({
2219
2464
  if (range.length === 0) {
2220
2465
  range = stringify2(node, options);
2221
2466
  }
2222
- q2.push(append(q2.pop(), range));
2467
+ q.push(append(q.pop(), range));
2223
2468
  node.nodes = [];
2224
2469
  return;
2225
2470
  }
2226
2471
  const enclose = utils.encloseBrace(node);
2227
2472
  let queue = node.queue;
2228
- let block = node;
2229
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
2230
- block = block.parent;
2231
- queue = block.queue;
2473
+ let block2 = node;
2474
+ while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
2475
+ block2 = block2.parent;
2476
+ queue = block2.queue;
2232
2477
  }
2233
- for (let i = 0; i < node.nodes.length; i++) {
2234
- const child = node.nodes[i];
2478
+ for (let i2 = 0; i2 < node.nodes.length; i2++) {
2479
+ const child = node.nodes[i2];
2235
2480
  if (child.type === "comma" && node.type === "brace") {
2236
- if (i === 1) queue.push("");
2481
+ if (i2 === 1) queue.push("");
2237
2482
  queue.push("");
2238
2483
  continue;
2239
2484
  }
2240
2485
  if (child.type === "close") {
2241
- q2.push(append(q2.pop(), queue, enclose));
2486
+ q.push(append(q.pop(), queue, enclose));
2242
2487
  continue;
2243
2488
  }
2244
2489
  if (child.value && child.type !== "open") {
@@ -2405,7 +2650,7 @@ var require_parse = __commonJS({
2405
2650
  }
2406
2651
  const ast = { type: "root", input, nodes: [] };
2407
2652
  const stack = [ast];
2408
- let block = ast;
2653
+ let block2 = ast;
2409
2654
  let prev = ast;
2410
2655
  let brackets = 0;
2411
2656
  const length = input.length;
@@ -2421,15 +2666,15 @@ var require_parse = __commonJS({
2421
2666
  prev.value += node.value;
2422
2667
  return;
2423
2668
  }
2424
- block.nodes.push(node);
2425
- node.parent = block;
2669
+ block2.nodes.push(node);
2670
+ node.parent = block2;
2426
2671
  node.prev = prev;
2427
2672
  prev = node;
2428
2673
  return node;
2429
2674
  };
2430
2675
  push({ type: "bos" });
2431
2676
  while (index < length) {
2432
- block = stack[stack.length - 1];
2677
+ block2 = stack[stack.length - 1];
2433
2678
  value = advance();
2434
2679
  if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
2435
2680
  continue;
@@ -2466,19 +2711,19 @@ var require_parse = __commonJS({
2466
2711
  continue;
2467
2712
  }
2468
2713
  if (value === CHAR_LEFT_PARENTHESES) {
2469
- block = push({ type: "paren", nodes: [] });
2470
- stack.push(block);
2714
+ block2 = push({ type: "paren", nodes: [] });
2715
+ stack.push(block2);
2471
2716
  push({ type: "text", value });
2472
2717
  continue;
2473
2718
  }
2474
2719
  if (value === CHAR_RIGHT_PARENTHESES) {
2475
- if (block.type !== "paren") {
2720
+ if (block2.type !== "paren") {
2476
2721
  push({ type: "text", value });
2477
2722
  continue;
2478
2723
  }
2479
- block = stack.pop();
2724
+ block2 = stack.pop();
2480
2725
  push({ type: "text", value });
2481
- block = stack[stack.length - 1];
2726
+ block2 = stack[stack.length - 1];
2482
2727
  continue;
2483
2728
  }
2484
2729
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
@@ -2503,7 +2748,7 @@ var require_parse = __commonJS({
2503
2748
  }
2504
2749
  if (value === CHAR_LEFT_CURLY_BRACE) {
2505
2750
  depth++;
2506
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
2751
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
2507
2752
  const brace = {
2508
2753
  type: "brace",
2509
2754
  open: true,
@@ -2514,52 +2759,52 @@ var require_parse = __commonJS({
2514
2759
  ranges: 0,
2515
2760
  nodes: []
2516
2761
  };
2517
- block = push(brace);
2518
- stack.push(block);
2762
+ block2 = push(brace);
2763
+ stack.push(block2);
2519
2764
  push({ type: "open", value });
2520
2765
  continue;
2521
2766
  }
2522
2767
  if (value === CHAR_RIGHT_CURLY_BRACE) {
2523
- if (block.type !== "brace") {
2768
+ if (block2.type !== "brace") {
2524
2769
  push({ type: "text", value });
2525
2770
  continue;
2526
2771
  }
2527
2772
  const type = "close";
2528
- block = stack.pop();
2529
- block.close = true;
2773
+ block2 = stack.pop();
2774
+ block2.close = true;
2530
2775
  push({ type, value });
2531
2776
  depth--;
2532
- block = stack[stack.length - 1];
2777
+ block2 = stack[stack.length - 1];
2533
2778
  continue;
2534
2779
  }
2535
2780
  if (value === CHAR_COMMA && depth > 0) {
2536
- if (block.ranges > 0) {
2537
- block.ranges = 0;
2538
- const open = block.nodes.shift();
2539
- block.nodes = [open, { type: "text", value: stringify2(block) }];
2781
+ if (block2.ranges > 0) {
2782
+ block2.ranges = 0;
2783
+ const open = block2.nodes.shift();
2784
+ block2.nodes = [open, { type: "text", value: stringify2(block2) }];
2540
2785
  }
2541
2786
  push({ type: "comma", value });
2542
- block.commas++;
2787
+ block2.commas++;
2543
2788
  continue;
2544
2789
  }
2545
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
2546
- const siblings = block.nodes;
2790
+ if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
2791
+ const siblings = block2.nodes;
2547
2792
  if (depth === 0 || siblings.length === 0) {
2548
2793
  push({ type: "text", value });
2549
2794
  continue;
2550
2795
  }
2551
2796
  if (prev.type === "dot") {
2552
- block.range = [];
2797
+ block2.range = [];
2553
2798
  prev.value += value;
2554
2799
  prev.type = "range";
2555
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
2556
- block.invalid = true;
2557
- block.ranges = 0;
2800
+ if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
2801
+ block2.invalid = true;
2802
+ block2.ranges = 0;
2558
2803
  prev.type = "text";
2559
2804
  continue;
2560
2805
  }
2561
- block.ranges++;
2562
- block.args = [];
2806
+ block2.ranges++;
2807
+ block2.args = [];
2563
2808
  continue;
2564
2809
  }
2565
2810
  if (prev.type === "range") {
@@ -2567,7 +2812,7 @@ var require_parse = __commonJS({
2567
2812
  const before = siblings[siblings.length - 1];
2568
2813
  before.value += prev.value + value;
2569
2814
  prev = before;
2570
- block.ranges--;
2815
+ block2.ranges--;
2571
2816
  continue;
2572
2817
  }
2573
2818
  push({ type: "dot", value });
@@ -2576,9 +2821,9 @@ var require_parse = __commonJS({
2576
2821
  push({ type: "text", value });
2577
2822
  }
2578
2823
  do {
2579
- block = stack.pop();
2580
- if (block.type !== "root") {
2581
- block.nodes.forEach((node) => {
2824
+ block2 = stack.pop();
2825
+ if (block2.type !== "root") {
2826
+ block2.nodes.forEach((node) => {
2582
2827
  if (!node.nodes) {
2583
2828
  if (node.type === "open") node.isOpen = true;
2584
2829
  if (node.type === "close") node.isClose = true;
@@ -2587,8 +2832,8 @@ var require_parse = __commonJS({
2587
2832
  }
2588
2833
  });
2589
2834
  const parent = stack[stack.length - 1];
2590
- const index2 = parent.nodes.indexOf(block);
2591
- parent.nodes.splice(index2, 1, ...block.nodes);
2835
+ const index2 = parent.nodes.indexOf(block2);
2836
+ parent.nodes.splice(index2, 1, ...block2.nodes);
2592
2837
  }
2593
2838
  } while (stack.length > 0);
2594
2839
  push({ type: "eos" });
@@ -3221,9 +3466,9 @@ var require_scan = __commonJS({
3221
3466
  if (opts.parts === true || opts.tokens === true) {
3222
3467
  let prevIndex;
3223
3468
  for (let idx = 0; idx < slashes.length; idx++) {
3224
- const n = prevIndex ? prevIndex + 1 : start;
3225
- const i = slashes[idx];
3226
- const value = input.slice(n, i);
3469
+ const n3 = prevIndex ? prevIndex + 1 : start;
3470
+ const i2 = slashes[idx];
3471
+ const value = input.slice(n3, i2);
3227
3472
  if (opts.tokens) {
3228
3473
  if (idx === 0 && start !== 0) {
3229
3474
  tokens[idx].isPrefix = true;
@@ -3237,7 +3482,7 @@ var require_scan = __commonJS({
3237
3482
  if (idx !== 0 || value !== "") {
3238
3483
  parts.push(value);
3239
3484
  }
3240
- prevIndex = i;
3485
+ prevIndex = i2;
3241
3486
  }
3242
3487
  if (prevIndex && prevIndex + 1 < input.length) {
3243
3488
  const value = input.slice(prevIndex + 1);
@@ -3366,15 +3611,15 @@ var require_parse2 = __commonJS({
3366
3611
  };
3367
3612
  var hasRepeatedCharPrefixOverlap = (branches) => {
3368
3613
  const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3369
- for (let i = 0; i < values.length; i++) {
3370
- for (let j2 = i + 1; j2 < values.length; j2++) {
3371
- const a = values[i];
3372
- const b = values[j2];
3373
- const char = a[0];
3374
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
3614
+ for (let i2 = 0; i2 < values.length; i2++) {
3615
+ for (let j = i2 + 1; j < values.length; j++) {
3616
+ const a2 = values[i2];
3617
+ const b = values[j];
3618
+ const char = a2[0];
3619
+ if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
3375
3620
  continue;
3376
3621
  }
3377
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
3622
+ if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
3378
3623
  return true;
3379
3624
  }
3380
3625
  }
@@ -3389,8 +3634,8 @@ var require_parse2 = __commonJS({
3389
3634
  let paren = 0;
3390
3635
  let quote = 0;
3391
3636
  let escaped = false;
3392
- for (let i = 1; i < pattern.length; i++) {
3393
- const ch = pattern[i];
3637
+ for (let i2 = 1; i2 < pattern.length; i2++) {
3638
+ const ch = pattern[i2];
3394
3639
  if (escaped === true) {
3395
3640
  escaped = false;
3396
3641
  continue;
@@ -3424,13 +3669,13 @@ var require_parse2 = __commonJS({
3424
3669
  if (ch === ")") {
3425
3670
  paren--;
3426
3671
  if (paren === 0) {
3427
- if (requireEnd === true && i !== pattern.length - 1) {
3672
+ if (requireEnd === true && i2 !== pattern.length - 1) {
3428
3673
  return;
3429
3674
  }
3430
3675
  return {
3431
3676
  type: pattern[0],
3432
- body: pattern.slice(2, i),
3433
- end: i
3677
+ body: pattern.slice(2, i2),
3678
+ end: i2
3434
3679
  };
3435
3680
  }
3436
3681
  }
@@ -3562,7 +3807,7 @@ var require_parse2 = __commonJS({
3562
3807
  let prev = bos;
3563
3808
  let value;
3564
3809
  const eos = () => state.index === len - 1;
3565
- const peek = state.peek = (n = 1) => input[state.index + n];
3810
+ const peek = state.peek = (n3 = 1) => input[state.index + n3];
3566
3811
  const advance = state.advance = () => input[++state.index] || "";
3567
3812
  const remaining = () => input.slice(state.index + 1);
3568
3813
  const consume = (value2 = "", num = 0) => {
@@ -3643,10 +3888,10 @@ var require_parse2 = __commonJS({
3643
3888
  open.type = "text";
3644
3889
  open.value = literal;
3645
3890
  open.output = safeOutput || utils.escapeRegex(literal);
3646
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3647
- tokens[i].value = "";
3648
- tokens[i].output = "";
3649
- delete tokens[i].suffix;
3891
+ for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
3892
+ tokens[i2].value = "";
3893
+ tokens[i2].output = "";
3894
+ delete tokens[i2].suffix;
3650
3895
  }
3651
3896
  state.output = token.output + open.output;
3652
3897
  state.backtrack = true;
@@ -3889,13 +4134,13 @@ var require_parse2 = __commonJS({
3889
4134
  if (brace.dots === true) {
3890
4135
  const arr = tokens.slice();
3891
4136
  const range = [];
3892
- for (let i = arr.length - 1; i >= 0; i--) {
4137
+ for (let i2 = arr.length - 1; i2 >= 0; i2--) {
3893
4138
  tokens.pop();
3894
- if (arr[i].type === "brace") {
4139
+ if (arr[i2].type === "brace") {
3895
4140
  break;
3896
4141
  }
3897
- if (arr[i].type !== "dots") {
3898
- range.unshift(arr[i].value);
4142
+ if (arr[i2].type !== "dots") {
4143
+ range.unshift(arr[i2].value);
3899
4144
  }
3900
4145
  }
3901
4146
  output = expandRange(range, opts);
@@ -4354,7 +4599,7 @@ var require_picomatch = __commonJS({
4354
4599
  };
4355
4600
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
4356
4601
  picomatch.parse = (pattern, options) => {
4357
- if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
4602
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
4358
4603
  return parse2(pattern, { ...options, fastpaths: false });
4359
4604
  };
4360
4605
  picomatch.scan = (input, options) => scan(input, options);
@@ -4438,8 +4683,8 @@ var require_micromatch = __commonJS({
4438
4683
  options.onResult(state);
4439
4684
  }
4440
4685
  };
4441
- for (let i = 0; i < patterns.length; i++) {
4442
- let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
4686
+ for (let i2 = 0; i2 < patterns.length; i2++) {
4687
+ let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
4443
4688
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
4444
4689
  if (negated) negatives++;
4445
4690
  for (let item of list) {
@@ -4461,7 +4706,7 @@ var require_micromatch = __commonJS({
4461
4706
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
4462
4707
  }
4463
4708
  if (options.nonull === true || options.nullglob === true) {
4464
- return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
4709
+ return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
4465
4710
  }
4466
4711
  }
4467
4712
  return matches;
@@ -4491,7 +4736,7 @@ var require_micromatch = __commonJS({
4491
4736
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4492
4737
  }
4493
4738
  if (Array.isArray(pattern)) {
4494
- return pattern.some((p2) => micromatch.contains(str, p2, options));
4739
+ return pattern.some((p) => micromatch.contains(str, p, options));
4495
4740
  }
4496
4741
  if (typeof pattern === "string") {
4497
4742
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -4536,7 +4781,7 @@ var require_micromatch = __commonJS({
4536
4781
  if (typeof str !== "string") {
4537
4782
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4538
4783
  }
4539
- return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4784
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
4540
4785
  };
4541
4786
  micromatch.capture = (glob, input, options) => {
4542
4787
  let posix = utils.isWindows(options);
@@ -4687,7 +4932,7 @@ var require_pattern = __commonJS({
4687
4932
  exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4688
4933
  function expandBraceExpansion(pattern) {
4689
4934
  const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
4690
- patterns.sort((a, b) => a.length - b.length);
4935
+ patterns.sort((a2, b) => a2.length - b.length);
4691
4936
  return patterns.filter((pattern2) => pattern2 !== "");
4692
4937
  }
4693
4938
  exports.expandBraceExpansion = expandBraceExpansion;
@@ -4768,8 +5013,8 @@ var require_merge2 = __commonJS({
4768
5013
  }
4769
5014
  const mergedStream = PassThrough(options);
4770
5015
  function addStream() {
4771
- for (let i = 0, len = arguments.length; i < len; i++) {
4772
- streamsQueue.push(pauseStreams(arguments[i], options));
5016
+ for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
5017
+ streamsQueue.push(pauseStreams(arguments[i2], options));
4773
5018
  }
4774
5019
  mergeStream();
4775
5020
  return this;
@@ -4818,8 +5063,8 @@ var require_merge2 = __commonJS({
4818
5063
  stream.pipe(mergedStream, { end: false });
4819
5064
  stream.resume();
4820
5065
  }
4821
- for (let i = 0; i < streams.length; i++) {
4822
- pipe(streams[i]);
5066
+ for (let i2 = 0; i2 < streams.length; i2++) {
5067
+ pipe(streams[i2]);
4823
5068
  }
4824
5069
  next();
4825
5070
  }
@@ -4850,8 +5095,8 @@ var require_merge2 = __commonJS({
4850
5095
  }
4851
5096
  streams.pause();
4852
5097
  } else {
4853
- for (let i = 0, len = streams.length; i < len; i++) {
4854
- streams[i] = pauseStreams(streams[i], options);
5098
+ for (let i2 = 0, len = streams.length; i2 < len; i2++) {
5099
+ streams[i2] = pauseStreams(streams[i2], options);
4855
5100
  }
4856
5101
  }
4857
5102
  return streams;
@@ -4933,13 +5178,13 @@ var require_tasks = __commonJS({
4933
5178
  Object.defineProperty(exports, "__esModule", { value: true });
4934
5179
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
4935
5180
  var utils = require_utils3();
4936
- function generate(input, settings) {
4937
- const patterns = processPatterns(input, settings);
4938
- const ignore = processPatterns(settings.ignore, settings);
5181
+ function generate(input, settings2) {
5182
+ const patterns = processPatterns(input, settings2);
5183
+ const ignore = processPatterns(settings2.ignore, settings2);
4939
5184
  const positivePatterns = getPositivePatterns(patterns);
4940
5185
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
4941
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
4942
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
5186
+ const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
5187
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
4943
5188
  const staticTasks = convertPatternsToTasks(
4944
5189
  staticPatterns,
4945
5190
  negativePatterns,
@@ -4955,12 +5200,12 @@ var require_tasks = __commonJS({
4955
5200
  return staticTasks.concat(dynamicTasks);
4956
5201
  }
4957
5202
  exports.generate = generate;
4958
- function processPatterns(input, settings) {
5203
+ function processPatterns(input, settings2) {
4959
5204
  let patterns = input;
4960
- if (settings.braceExpansion) {
5205
+ if (settings2.braceExpansion) {
4961
5206
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
4962
5207
  }
4963
- if (settings.baseNameMatch) {
5208
+ if (settings2.baseNameMatch) {
4964
5209
  patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
4965
5210
  }
4966
5211
  return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
@@ -4991,7 +5236,7 @@ var require_tasks = __commonJS({
4991
5236
  }
4992
5237
  exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
4993
5238
  function groupPatternsByBaseDirectory(patterns) {
4994
- const group = {};
5239
+ const group2 = {};
4995
5240
  return patterns.reduce((collection, pattern) => {
4996
5241
  const base = utils.pattern.getBaseDirectory(pattern);
4997
5242
  if (base in collection) {
@@ -5000,7 +5245,7 @@ var require_tasks = __commonJS({
5000
5245
  collection[base] = [pattern];
5001
5246
  }
5002
5247
  return collection;
5003
- }, group);
5248
+ }, group2);
5004
5249
  }
5005
5250
  exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
5006
5251
  function convertPatternGroupsToTasks(positive, negative, dynamic) {
@@ -5029,26 +5274,26 @@ var require_async = __commonJS({
5029
5274
  init_utils2();
5030
5275
  Object.defineProperty(exports, "__esModule", { value: true });
5031
5276
  exports.read = void 0;
5032
- function read(path, settings, callback) {
5033
- settings.fs.lstat(path, (lstatError, lstat) => {
5277
+ function read(path, settings2, callback) {
5278
+ settings2.fs.lstat(path, (lstatError, lstat) => {
5034
5279
  if (lstatError !== null) {
5035
5280
  callFailureCallback(callback, lstatError);
5036
5281
  return;
5037
5282
  }
5038
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5283
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5039
5284
  callSuccessCallback(callback, lstat);
5040
5285
  return;
5041
5286
  }
5042
- settings.fs.stat(path, (statError, stat) => {
5287
+ settings2.fs.stat(path, (statError, stat) => {
5043
5288
  if (statError !== null) {
5044
- if (settings.throwErrorOnBrokenSymbolicLink) {
5289
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5045
5290
  callFailureCallback(callback, statError);
5046
5291
  return;
5047
5292
  }
5048
5293
  callSuccessCallback(callback, lstat);
5049
5294
  return;
5050
5295
  }
5051
- if (settings.markSymbolicLink) {
5296
+ if (settings2.markSymbolicLink) {
5052
5297
  stat.isSymbolicLink = () => true;
5053
5298
  }
5054
5299
  callSuccessCallback(callback, stat);
@@ -5072,19 +5317,19 @@ var require_sync = __commonJS({
5072
5317
  init_utils2();
5073
5318
  Object.defineProperty(exports, "__esModule", { value: true });
5074
5319
  exports.read = void 0;
5075
- function read(path, settings) {
5076
- const lstat = settings.fs.lstatSync(path);
5077
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5320
+ function read(path, settings2) {
5321
+ const lstat = settings2.fs.lstatSync(path);
5322
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5078
5323
  return lstat;
5079
5324
  }
5080
5325
  try {
5081
- const stat = settings.fs.statSync(path);
5082
- if (settings.markSymbolicLink) {
5326
+ const stat = settings2.fs.statSync(path);
5327
+ if (settings2.markSymbolicLink) {
5083
5328
  stat.isSymbolicLink = () => true;
5084
5329
  }
5085
5330
  return stat;
5086
5331
  } catch (error2) {
5087
- if (!settings.throwErrorOnBrokenSymbolicLink) {
5332
+ if (!settings2.throwErrorOnBrokenSymbolicLink) {
5088
5333
  return lstat;
5089
5334
  }
5090
5335
  throw error2;
@@ -5161,8 +5406,8 @@ var require_out = __commonJS({
5161
5406
  }
5162
5407
  exports.stat = stat;
5163
5408
  function statSync3(path, optionsOrSettings) {
5164
- const settings = getSettings(optionsOrSettings);
5165
- return sync.read(path, settings);
5409
+ const settings2 = getSettings(optionsOrSettings);
5410
+ return sync.read(path, settings2);
5166
5411
  }
5167
5412
  exports.statSync = statSync3;
5168
5413
  function getSettings(settingsOrOptions = {}) {
@@ -5210,8 +5455,8 @@ var require_run_parallel = __commonJS({
5210
5455
  if (isSync) queueMicrotask2(end);
5211
5456
  else end();
5212
5457
  }
5213
- function each(i, err, result) {
5214
- results[i] = result;
5458
+ function each(i2, err, result) {
5459
+ results[i2] = result;
5215
5460
  if (--pending === 0 || err) {
5216
5461
  done(err);
5217
5462
  }
@@ -5225,9 +5470,9 @@ var require_run_parallel = __commonJS({
5225
5470
  });
5226
5471
  });
5227
5472
  } else {
5228
- tasks.forEach(function(task, i) {
5473
+ tasks.forEach(function(task, i2) {
5229
5474
  task(function(err, result) {
5230
- each(i, err, result);
5475
+ each(i2, err, result);
5231
5476
  });
5232
5477
  });
5233
5478
  }
@@ -5302,11 +5547,11 @@ var require_common = __commonJS({
5302
5547
  init_utils2();
5303
5548
  Object.defineProperty(exports, "__esModule", { value: true });
5304
5549
  exports.joinPathSegments = void 0;
5305
- function joinPathSegments(a, b, separator) {
5306
- if (a.endsWith(separator)) {
5307
- return a + b;
5550
+ function joinPathSegments(a2, b, separator) {
5551
+ if (a2.endsWith(separator)) {
5552
+ return a2 + b;
5308
5553
  }
5309
- return a + separator + b;
5554
+ return a2 + separator + b;
5310
5555
  }
5311
5556
  exports.joinPathSegments = joinPathSegments;
5312
5557
  }
@@ -5324,16 +5569,16 @@ var require_async2 = __commonJS({
5324
5569
  var constants_1 = require_constants3();
5325
5570
  var utils = require_utils4();
5326
5571
  var common = require_common();
5327
- function read(directory, settings, callback) {
5328
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5329
- readdirWithFileTypes(directory, settings, callback);
5572
+ function read(directory, settings2, callback) {
5573
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5574
+ readdirWithFileTypes(directory, settings2, callback);
5330
5575
  return;
5331
5576
  }
5332
- readdir(directory, settings, callback);
5577
+ readdir(directory, settings2, callback);
5333
5578
  }
5334
5579
  exports.read = read;
5335
- function readdirWithFileTypes(directory, settings, callback) {
5336
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5580
+ function readdirWithFileTypes(directory, settings2, callback) {
5581
+ settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5337
5582
  if (readdirError !== null) {
5338
5583
  callFailureCallback(callback, readdirError);
5339
5584
  return;
@@ -5341,13 +5586,13 @@ var require_async2 = __commonJS({
5341
5586
  const entries = dirents.map((dirent) => ({
5342
5587
  dirent,
5343
5588
  name: dirent.name,
5344
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5589
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5345
5590
  }));
5346
- if (!settings.followSymbolicLinks) {
5591
+ if (!settings2.followSymbolicLinks) {
5347
5592
  callSuccessCallback(callback, entries);
5348
5593
  return;
5349
5594
  }
5350
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
5595
+ const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
5351
5596
  rpl(tasks, (rplError, rplEntries) => {
5352
5597
  if (rplError !== null) {
5353
5598
  callFailureCallback(callback, rplError);
@@ -5358,15 +5603,15 @@ var require_async2 = __commonJS({
5358
5603
  });
5359
5604
  }
5360
5605
  exports.readdirWithFileTypes = readdirWithFileTypes;
5361
- function makeRplTaskEntry(entry, settings) {
5606
+ function makeRplTaskEntry(entry, settings2) {
5362
5607
  return (done) => {
5363
5608
  if (!entry.dirent.isSymbolicLink()) {
5364
5609
  done(null, entry);
5365
5610
  return;
5366
5611
  }
5367
- settings.fs.stat(entry.path, (statError, stats) => {
5612
+ settings2.fs.stat(entry.path, (statError, stats) => {
5368
5613
  if (statError !== null) {
5369
- if (settings.throwErrorOnBrokenSymbolicLink) {
5614
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5370
5615
  done(statError);
5371
5616
  return;
5372
5617
  }
@@ -5378,16 +5623,16 @@ var require_async2 = __commonJS({
5378
5623
  });
5379
5624
  };
5380
5625
  }
5381
- function readdir(directory, settings, callback) {
5382
- settings.fs.readdir(directory, (readdirError, names) => {
5626
+ function readdir(directory, settings2, callback) {
5627
+ settings2.fs.readdir(directory, (readdirError, names) => {
5383
5628
  if (readdirError !== null) {
5384
5629
  callFailureCallback(callback, readdirError);
5385
5630
  return;
5386
5631
  }
5387
5632
  const tasks = names.map((name) => {
5388
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5633
+ const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5389
5634
  return (done) => {
5390
- fsStat.stat(path, settings.fsStatSettings, (error2, stats) => {
5635
+ fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
5391
5636
  if (error2 !== null) {
5392
5637
  done(error2);
5393
5638
  return;
@@ -5397,7 +5642,7 @@ var require_async2 = __commonJS({
5397
5642
  path,
5398
5643
  dirent: utils.fs.createDirentFromStats(name, stats)
5399
5644
  };
5400
- if (settings.stats) {
5645
+ if (settings2.stats) {
5401
5646
  entry.stats = stats;
5402
5647
  }
5403
5648
  done(null, entry);
@@ -5434,27 +5679,27 @@ var require_sync2 = __commonJS({
5434
5679
  var constants_1 = require_constants3();
5435
5680
  var utils = require_utils4();
5436
5681
  var common = require_common();
5437
- function read(directory, settings) {
5438
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5439
- return readdirWithFileTypes(directory, settings);
5682
+ function read(directory, settings2) {
5683
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5684
+ return readdirWithFileTypes(directory, settings2);
5440
5685
  }
5441
- return readdir(directory, settings);
5686
+ return readdir(directory, settings2);
5442
5687
  }
5443
5688
  exports.read = read;
5444
- function readdirWithFileTypes(directory, settings) {
5445
- const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
5689
+ function readdirWithFileTypes(directory, settings2) {
5690
+ const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
5446
5691
  return dirents.map((dirent) => {
5447
5692
  const entry = {
5448
5693
  dirent,
5449
5694
  name: dirent.name,
5450
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5695
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5451
5696
  };
5452
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
5697
+ if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
5453
5698
  try {
5454
- const stats = settings.fs.statSync(entry.path);
5699
+ const stats = settings2.fs.statSync(entry.path);
5455
5700
  entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
5456
5701
  } catch (error2) {
5457
- if (settings.throwErrorOnBrokenSymbolicLink) {
5702
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5458
5703
  throw error2;
5459
5704
  }
5460
5705
  }
@@ -5463,17 +5708,17 @@ var require_sync2 = __commonJS({
5463
5708
  });
5464
5709
  }
5465
5710
  exports.readdirWithFileTypes = readdirWithFileTypes;
5466
- function readdir(directory, settings) {
5467
- const names = settings.fs.readdirSync(directory);
5711
+ function readdir(directory, settings2) {
5712
+ const names = settings2.fs.readdirSync(directory);
5468
5713
  return names.map((name) => {
5469
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5470
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
5714
+ const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5715
+ const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
5471
5716
  const entry = {
5472
5717
  name,
5473
5718
  path: entryPath,
5474
5719
  dirent: utils.fs.createDirentFromStats(name, stats)
5475
5720
  };
5476
- if (settings.stats) {
5721
+ if (settings2.stats) {
5477
5722
  entry.stats = stats;
5478
5723
  }
5479
5724
  return entry;
@@ -5560,8 +5805,8 @@ var require_out2 = __commonJS({
5560
5805
  }
5561
5806
  exports.scandir = scandir;
5562
5807
  function scandirSync(path, optionsOrSettings) {
5563
- const settings = getSettings(optionsOrSettings);
5564
- return sync.read(path, settings);
5808
+ const settings2 = getSettings(optionsOrSettings);
5809
+ return sync.read(path, settings2);
5565
5810
  }
5566
5811
  exports.scandirSync = scandirSync;
5567
5812
  function getSettings(settingsOrOptions = {}) {
@@ -5605,9 +5850,9 @@ var require_reusify = __commonJS({
5605
5850
  }
5606
5851
  });
5607
5852
 
5608
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5853
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5609
5854
  var require_queue = __commonJS({
5610
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5855
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5611
5856
  "use strict";
5612
5857
  init_utils2();
5613
5858
  var reusify = require_reusify();
@@ -5787,11 +6032,12 @@ var require_queue = __commonJS({
5787
6032
  current.value = null;
5788
6033
  current.callback = noop;
5789
6034
  current.errorHandler = null;
6035
+ current.next = null;
5790
6036
  if (errorHandler2) {
5791
6037
  errorHandler2(new Error("abort"), val);
5792
6038
  }
5793
6039
  callback.call(context2, new Error("abort"));
5794
- current.release(current);
6040
+ cache.release(current);
5795
6041
  current = next;
5796
6042
  }
5797
6043
  self.drain = noop;
@@ -5842,7 +6088,7 @@ var require_queue = __commonJS({
5842
6088
  queue.drained = drained;
5843
6089
  return queue;
5844
6090
  function push(value) {
5845
- var p2 = new Promise(function(resolve5, reject) {
6091
+ var p = new Promise(function(resolve5, reject) {
5846
6092
  pushCb(value, function(err, result) {
5847
6093
  if (err) {
5848
6094
  reject(err);
@@ -5851,11 +6097,11 @@ var require_queue = __commonJS({
5851
6097
  resolve5(result);
5852
6098
  });
5853
6099
  });
5854
- p2.catch(noop);
5855
- return p2;
6100
+ p.catch(noop);
6101
+ return p;
5856
6102
  }
5857
6103
  function unshift(value) {
5858
- var p2 = new Promise(function(resolve5, reject) {
6104
+ var p = new Promise(function(resolve5, reject) {
5859
6105
  unshiftCb(value, function(err, result) {
5860
6106
  if (err) {
5861
6107
  reject(err);
@@ -5864,11 +6110,11 @@ var require_queue = __commonJS({
5864
6110
  resolve5(result);
5865
6111
  });
5866
6112
  });
5867
- p2.catch(noop);
5868
- return p2;
6113
+ p.catch(noop);
6114
+ return p;
5869
6115
  }
5870
6116
  function drained() {
5871
- var p2 = new Promise(function(resolve5) {
6117
+ var p = new Promise(function(resolve5) {
5872
6118
  process.nextTick(function() {
5873
6119
  if (queue.idle()) {
5874
6120
  resolve5();
@@ -5882,7 +6128,7 @@ var require_queue = __commonJS({
5882
6128
  }
5883
6129
  });
5884
6130
  });
5885
- return p2;
6131
+ return p;
5886
6132
  }
5887
6133
  }
5888
6134
  module.exports = fastqueue;
@@ -5897,11 +6143,11 @@ var require_common2 = __commonJS({
5897
6143
  init_utils2();
5898
6144
  Object.defineProperty(exports, "__esModule", { value: true });
5899
6145
  exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
5900
- function isFatalError(settings, error2) {
5901
- if (settings.errorFilter === null) {
6146
+ function isFatalError(settings2, error2) {
6147
+ if (settings2.errorFilter === null) {
5902
6148
  return true;
5903
6149
  }
5904
- return !settings.errorFilter(error2);
6150
+ return !settings2.errorFilter(error2);
5905
6151
  }
5906
6152
  exports.isFatalError = isFatalError;
5907
6153
  function isAppliedFilter(filter, value) {
@@ -5912,14 +6158,14 @@ var require_common2 = __commonJS({
5912
6158
  return filepath.split(/[/\\]/).join(separator);
5913
6159
  }
5914
6160
  exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
5915
- function joinPathSegments(a, b, separator) {
5916
- if (a === "") {
6161
+ function joinPathSegments(a2, b, separator) {
6162
+ if (a2 === "") {
5917
6163
  return b;
5918
6164
  }
5919
- if (a.endsWith(separator)) {
5920
- return a + b;
6165
+ if (a2.endsWith(separator)) {
6166
+ return a2 + b;
5921
6167
  }
5922
- return a + separator + b;
6168
+ return a2 + separator + b;
5923
6169
  }
5924
6170
  exports.joinPathSegments = joinPathSegments;
5925
6171
  }
@@ -6266,14 +6512,14 @@ var require_out3 = __commonJS({
6266
6512
  }
6267
6513
  exports.walk = walk;
6268
6514
  function walkSync(directory, optionsOrSettings) {
6269
- const settings = getSettings(optionsOrSettings);
6270
- const provider = new sync_1.default(directory, settings);
6515
+ const settings2 = getSettings(optionsOrSettings);
6516
+ const provider = new sync_1.default(directory, settings2);
6271
6517
  return provider.read();
6272
6518
  }
6273
6519
  exports.walkSync = walkSync;
6274
6520
  function walkStream(directory, optionsOrSettings) {
6275
- const settings = getSettings(optionsOrSettings);
6276
- const provider = new stream_1.default(directory, settings);
6521
+ const settings2 = getSettings(optionsOrSettings);
6522
+ const provider = new stream_1.default(directory, settings2);
6277
6523
  return provider.read();
6278
6524
  }
6279
6525
  exports.walkStream = walkStream;
@@ -6359,8 +6605,8 @@ var require_stream3 = __commonJS({
6359
6605
  done();
6360
6606
  }).catch(done);
6361
6607
  };
6362
- for (let i = 0; i < filepaths.length; i++) {
6363
- stream.write(i);
6608
+ for (let i2 = 0; i2 < filepaths.length; i2++) {
6609
+ stream.write(i2);
6364
6610
  }
6365
6611
  return stream;
6366
6612
  }
@@ -7021,14 +7267,14 @@ var require_out4 = __commonJS({
7021
7267
  function generateTasks(source, options) {
7022
7268
  assertPatternsInput(source);
7023
7269
  const patterns = [].concat(source);
7024
- const settings = new settings_1.default(options);
7025
- return taskManager.generate(patterns, settings);
7270
+ const settings2 = new settings_1.default(options);
7271
+ return taskManager.generate(patterns, settings2);
7026
7272
  }
7027
7273
  FastGlob2.generateTasks = generateTasks;
7028
7274
  function isDynamicPattern(source, options) {
7029
7275
  assertPatternsInput(source);
7030
- const settings = new settings_1.default(options);
7031
- return utils.pattern.isDynamicPattern(source, settings);
7276
+ const settings2 = new settings_1.default(options);
7277
+ return utils.pattern.isDynamicPattern(source, settings2);
7032
7278
  }
7033
7279
  FastGlob2.isDynamicPattern = isDynamicPattern;
7034
7280
  function escapePath(source) {
@@ -7070,9 +7316,9 @@ var require_out4 = __commonJS({
7070
7316
  })(FastGlob || (FastGlob = {}));
7071
7317
  function getWorks(source, _Provider, options) {
7072
7318
  const patterns = [].concat(source);
7073
- const settings = new settings_1.default(options);
7074
- const tasks = taskManager.generate(patterns, settings);
7075
- const provider = new _Provider(settings);
7319
+ const settings2 = new settings_1.default(options);
7320
+ const tasks = taskManager.generate(patterns, settings2);
7321
+ const provider = new _Provider(settings2);
7076
7322
  return tasks.map(provider.read, provider);
7077
7323
  }
7078
7324
  function assertPatternsInput(input) {
@@ -7250,14 +7496,14 @@ import "node:fs";
7250
7496
  import { createRequire } from "node:module";
7251
7497
  import {
7252
7498
  resolve,
7253
- join,
7254
- dirname,
7499
+ join as join2,
7500
+ dirname as dirname2,
7255
7501
  relative,
7256
7502
  normalize,
7257
7503
  sep,
7258
7504
  extname
7259
7505
  } from "node:path";
7260
- import "node:url";
7506
+ import { fileURLToPath } from "node:url";
7261
7507
  function safeExecuteAsync(fn, message) {
7262
7508
  return fn().catch((error2) => {
7263
7509
  throw new Error(
@@ -7265,7 +7511,7 @@ function safeExecuteAsync(fn, message) {
7265
7511
  );
7266
7512
  });
7267
7513
  }
7268
- var import_fast_glob, constants, log2, PACKAGE_PATHS, PathResolver;
7514
+ var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
7269
7515
  var init_PathResolver = __esm({
7270
7516
  "packages/core/config/utils/PathResolver.ts"() {
7271
7517
  "use strict";
@@ -7278,7 +7524,7 @@ var init_PathResolver = __esm({
7278
7524
  getPatternsFor: getPatternsFor || void 0,
7279
7525
  I18N_PATHS: I18N_PATHS || void 0
7280
7526
  };
7281
- log2 = {
7527
+ log3 = {
7282
7528
  error: (message, error2) => {
7283
7529
  },
7284
7530
  warn: (message, error2) => {
@@ -7314,6 +7560,7 @@ var init_PathResolver = __esm({
7314
7560
  options;
7315
7561
  _repoRoot;
7316
7562
  _appRoot = null;
7563
+ _writtenPaths = null;
7317
7564
  /**
7318
7565
  * Get or create singleton instance
7319
7566
  * @param options - Configuration options
@@ -7399,7 +7646,7 @@ var init_PathResolver = __esm({
7399
7646
  */
7400
7647
  getDirname(path) {
7401
7648
  if (!path) return "";
7402
- return this.normalizePath(dirname(path));
7649
+ return this.normalizePath(dirname2(path));
7403
7650
  }
7404
7651
  /**
7405
7652
  * Resolve package path using Node's module resolution
@@ -7411,7 +7658,7 @@ var init_PathResolver = __esm({
7411
7658
  resolvePackage(packageSpecifier, fromPath = null) {
7412
7659
  try {
7413
7660
  const basePath = fromPath || this.getAppRoot();
7414
- const require3 = createRequire(join(basePath, "package.json"));
7661
+ const require3 = createRequire(join2(basePath, "package.json"));
7415
7662
  const resolved = require3.resolve(packageSpecifier);
7416
7663
  return this.normalizePath(resolved);
7417
7664
  } catch (error2) {
@@ -7563,7 +7810,7 @@ var init_PathResolver = __esm({
7563
7810
  return cleanContent;
7564
7811
  } catch (error2) {
7565
7812
  if (this.options.debug) {
7566
- log2.warn(`Failed to read file: ${filePath}`, error2);
7813
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7567
7814
  }
7568
7815
  return null;
7569
7816
  }
@@ -7591,7 +7838,7 @@ var init_PathResolver = __esm({
7591
7838
  return cleanContent;
7592
7839
  } catch (error2) {
7593
7840
  if (this.options.debug) {
7594
- log2.warn(`Failed to read file: ${filePath}`, error2);
7841
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7595
7842
  }
7596
7843
  return null;
7597
7844
  }
@@ -7613,16 +7860,16 @@ var init_PathResolver = __esm({
7613
7860
  verbose = false
7614
7861
  } = options;
7615
7862
  const normalizedPath = this.normalizePath(filePath);
7616
- const dir = this.normalizePath(dirname(normalizedPath));
7863
+ const dir = this.normalizePath(dirname2(normalizedPath));
7617
7864
  const fileExists = this.pathExists(normalizedPath);
7618
7865
  if (fileExists && !overwrite) {
7619
7866
  if (verbose) {
7620
- log2.info(`Skipping existing file: ${normalizedPath}`);
7867
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7621
7868
  }
7622
7869
  return false;
7623
7870
  }
7624
7871
  if (dryRun) {
7625
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7872
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7626
7873
  return true;
7627
7874
  }
7628
7875
  try {
@@ -7632,22 +7879,23 @@ var init_PathResolver = __esm({
7632
7879
  }
7633
7880
  const detectedFormat = this._detectFormat(filePath, format);
7634
7881
  let writeContent;
7635
- if (Buffer.isBuffer(content)) {
7882
+ if (Buffer2.isBuffer(content)) {
7636
7883
  writeContent = content;
7637
7884
  } else if (detectedFormat === "json" && typeof content === "object") {
7638
- writeContent = JSON.stringify(content, null, 2);
7885
+ writeContent = `${JSON.stringify(content, null, 2)}
7886
+ `;
7639
7887
  } else {
7640
7888
  writeContent = String(content);
7641
7889
  }
7642
7890
  try {
7643
7891
  return await safeExecuteAsync(async () => {
7644
- if (Buffer.isBuffer(writeContent)) {
7892
+ if (Buffer2.isBuffer(writeContent)) {
7645
7893
  await fs.promises.writeFile(normalizedPath, writeContent);
7646
7894
  } else {
7647
7895
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
7648
7896
  }
7649
7897
  if (verbose) {
7650
- log2.info(
7898
+ log3.info(
7651
7899
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7652
7900
  );
7653
7901
  }
@@ -7674,16 +7922,16 @@ var init_PathResolver = __esm({
7674
7922
  verbose = false
7675
7923
  } = options;
7676
7924
  const normalizedPath = this.normalizePath(filePath);
7677
- const dir = this.normalizePath(dirname(normalizedPath));
7925
+ const dir = this.normalizePath(dirname2(normalizedPath));
7678
7926
  const fileExists = this.pathExists(normalizedPath);
7679
7927
  if (fileExists && !overwrite) {
7680
7928
  if (verbose) {
7681
- log2.info(`Skipping existing file: ${normalizedPath}`);
7929
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7682
7930
  }
7683
7931
  return false;
7684
7932
  }
7685
7933
  if (dryRun) {
7686
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7934
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7687
7935
  return true;
7688
7936
  }
7689
7937
  try {
@@ -7693,21 +7941,23 @@ var init_PathResolver = __esm({
7693
7941
  }
7694
7942
  const detectedFormat = this._detectFormat(filePath, format);
7695
7943
  let writeContent;
7696
- if (Buffer.isBuffer(content)) {
7944
+ if (Buffer2.isBuffer(content)) {
7697
7945
  writeContent = content;
7698
7946
  } else if (detectedFormat === "json" && typeof content === "object") {
7699
- writeContent = JSON.stringify(content, null, 2);
7947
+ writeContent = `${JSON.stringify(content, null, 2)}
7948
+ `;
7700
7949
  } else {
7701
7950
  writeContent = String(content);
7702
7951
  }
7703
7952
  try {
7704
- if (Buffer.isBuffer(writeContent)) {
7953
+ if (Buffer2.isBuffer(writeContent)) {
7705
7954
  fs.writeFileSync(normalizedPath, writeContent);
7706
7955
  } else {
7707
7956
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7708
7957
  }
7958
+ this._writtenPaths?.add(normalizedPath);
7709
7959
  if (verbose) {
7710
- log2.info(
7960
+ log3.info(
7711
7961
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7712
7962
  );
7713
7963
  }
@@ -7732,15 +7982,15 @@ var init_PathResolver = __esm({
7732
7982
  const fileExists = this.pathExists(normalizedDestPath);
7733
7983
  if (fileExists && !overwrite) {
7734
7984
  if (verbose) {
7735
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7985
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7736
7986
  }
7737
7987
  return false;
7738
7988
  }
7739
7989
  if (dryRun) {
7740
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7990
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7741
7991
  return true;
7742
7992
  }
7743
- const dir = this.normalizePath(dirname(normalizedDestPath));
7993
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7744
7994
  try {
7745
7995
  await fs.promises.mkdir(dir, { recursive: true });
7746
7996
  } catch (error2) {
@@ -7750,7 +8000,7 @@ var init_PathResolver = __esm({
7750
8000
  return await safeExecuteAsync(async () => {
7751
8001
  await fs.promises.copyFile(srcPath, normalizedDestPath);
7752
8002
  if (verbose) {
7753
- log2.info(
8003
+ log3.info(
7754
8004
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7755
8005
  );
7756
8006
  }
@@ -7774,15 +8024,15 @@ var init_PathResolver = __esm({
7774
8024
  const fileExists = this.pathExists(normalizedDestPath);
7775
8025
  if (fileExists && !overwrite) {
7776
8026
  if (verbose) {
7777
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
8027
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7778
8028
  }
7779
8029
  return false;
7780
8030
  }
7781
8031
  if (dryRun) {
7782
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
8032
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7783
8033
  return true;
7784
8034
  }
7785
- const dir = this.normalizePath(dirname(normalizedDestPath));
8035
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7786
8036
  try {
7787
8037
  fs.mkdirSync(dir, { recursive: true });
7788
8038
  } catch (error2) {
@@ -7790,8 +8040,9 @@ var init_PathResolver = __esm({
7790
8040
  }
7791
8041
  try {
7792
8042
  fs.copyFileSync(srcPath, normalizedDestPath);
8043
+ this._writtenPaths?.add(normalizedDestPath);
7793
8044
  if (verbose) {
7794
- log2.info(
8045
+ log3.info(
7795
8046
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7796
8047
  );
7797
8048
  }
@@ -7808,7 +8059,7 @@ var init_PathResolver = __esm({
7808
8059
  return fs.existsSync(filePath);
7809
8060
  } catch (error2) {
7810
8061
  if (!silent) {
7811
- log2.error(`Error checking path existence: ${filePath}`, error2);
8062
+ log3.error(`Error checking path existence: ${filePath}`, error2);
7812
8063
  }
7813
8064
  return false;
7814
8065
  }
@@ -7834,7 +8085,7 @@ var init_PathResolver = __esm({
7834
8085
  return fs.readdirSync(dirPath, options);
7835
8086
  } catch (error2) {
7836
8087
  if (this.options.debug) {
7837
- log2.warn(`Failed to read directory: ${dirPath}`, error2);
8088
+ log3.warn(`Failed to read directory: ${dirPath}`, error2);
7838
8089
  }
7839
8090
  const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
7840
8091
  return isObjectOptions && options.withFileTypes ? [] : [];
@@ -7852,11 +8103,29 @@ var init_PathResolver = __esm({
7852
8103
  return fs.statSync(filePath);
7853
8104
  } catch (error2) {
7854
8105
  if (this.options.debug) {
7855
- log2.warn(`Failed to stat file: ${filePath}`, error2);
8106
+ log3.warn(`Failed to stat file: ${filePath}`, error2);
7856
8107
  }
7857
8108
  return null;
7858
8109
  }
7859
8110
  }
8111
+ /**
8112
+ * Resolve the real path of a file, following symlinks
8113
+ * @param filePath - Path to resolve
8114
+ * @returns Resolved real path
8115
+ */
8116
+ realpathSync(filePath) {
8117
+ return fs.realpathSync(filePath);
8118
+ }
8119
+ /**
8120
+ * Watch a directory for changes
8121
+ * @param dirPath - Directory to watch
8122
+ * @param options - fs.watch options
8123
+ * @param callback - Callback for change events
8124
+ * @returns FSWatcher instance
8125
+ */
8126
+ watch(dirPath, options, callback) {
8127
+ return fs.watch(dirPath, options, callback);
8128
+ }
7860
8129
  /**
7861
8130
  * Get file stats synchronously (follows symlinks)
7862
8131
  * Returns null if file doesn't exist (graceful degradation)
@@ -7869,7 +8138,7 @@ var init_PathResolver = __esm({
7869
8138
  return fs.lstatSync(filePath);
7870
8139
  } catch (error2) {
7871
8140
  if (this.options.debug) {
7872
- log2.warn(`Failed to lstat file: ${filePath}`, error2);
8141
+ log3.warn(`Failed to lstat file: ${filePath}`, error2);
7873
8142
  }
7874
8143
  return null;
7875
8144
  }
@@ -7936,6 +8205,28 @@ var init_PathResolver = __esm({
7936
8205
  * Get app root (where vite.config.ts is, Vite's config.root)
7937
8206
  * Falls back to repoRoot if not set
7938
8207
  */
8208
+ /**
8209
+ * Start recording every path written by writeSync/copySync.
8210
+ * Lets a generator know exactly which files the current run produced,
8211
+ * without comparing file timestamps to a clock.
8212
+ */
8213
+ startWriteRecording() {
8214
+ this._writtenPaths = /* @__PURE__ */ new Set();
8215
+ }
8216
+ /**
8217
+ * Stop recording and return the normalized paths written since
8218
+ * startWriteRecording().
8219
+ */
8220
+ stopWriteRecording() {
8221
+ if (!this._writtenPaths) {
8222
+ throw new Error(
8223
+ "stopWriteRecording() called without startWriteRecording()"
8224
+ );
8225
+ }
8226
+ const written = this._writtenPaths;
8227
+ this._writtenPaths = null;
8228
+ return written;
8229
+ }
7939
8230
  getAppRoot() {
7940
8231
  if (!this._appRoot) {
7941
8232
  return this._repoRoot;
@@ -7958,7 +8249,7 @@ var init_PathResolver = __esm({
7958
8249
  * @returns True if repoRoot is the monorepo (has packages directory)
7959
8250
  */
7960
8251
  isMonorepo() {
7961
- const packagesDir = join(this._repoRoot, "packages");
8252
+ const packagesDir = join2(this._repoRoot, "packages");
7962
8253
  return this.pathExists(packagesDir);
7963
8254
  }
7964
8255
  /**
@@ -7975,7 +8266,7 @@ var init_PathResolver = __esm({
7975
8266
  * Find files matching pattern within directory
7976
8267
  */
7977
8268
  async findFiles(directory, pattern, options = {}) {
7978
- const searchPattern = this.normalizePath(join(directory, pattern));
8269
+ const searchPattern = this.normalizePath(join2(directory, pattern));
7979
8270
  const appRoot = this.getAppRoot();
7980
8271
  const normalizeAppRoot = this.normalizePath(appRoot);
7981
8272
  const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
@@ -8022,7 +8313,7 @@ var init_PathResolver = __esm({
8022
8313
  return null;
8023
8314
  }
8024
8315
  const resolvedPath = this.normalizePath(
8025
- join(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8316
+ join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8026
8317
  );
8027
8318
  const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
8028
8319
  if (this.pathExists(resolvedDir)) {
@@ -8193,6 +8484,15 @@ var init_PathResolver = __esm({
8193
8484
  const cjsPath = this.getEmptyCjsModulePath();
8194
8485
  return cjsPath.replace(/\.cjs$/, ".js");
8195
8486
  }
8487
+ /**
8488
+ * Get absolute path to empty flag component module.
8489
+ * Returns `export default () => null;` — used by flag filtering plugins
8490
+ * to replace unused flag files at build time.
8491
+ */
8492
+ getEmptyFlagModulePath() {
8493
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8494
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8495
+ }
8196
8496
  /**
8197
8497
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8198
8498
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8218,13 +8518,13 @@ var init_PathResolver = __esm({
8218
8518
  const maxLevels = this.options.maxLevels;
8219
8519
  while (levelsChecked < maxLevels) {
8220
8520
  const toolingPath = this.normalizePath(
8221
- join(currentDir, PACKAGE_PATHS.TOOLING)
8521
+ join2(currentDir, PACKAGE_PATHS.TOOLING)
8222
8522
  );
8223
- const corePath = this.normalizePath(join(currentDir, PACKAGE_PATHS.CORE));
8523
+ const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
8224
8524
  if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
8225
8525
  return currentDir;
8226
8526
  }
8227
- const appsDir = join(currentDir, "apps");
8527
+ const appsDir = join2(currentDir, "apps");
8228
8528
  if (this.pathExists(appsDir)) {
8229
8529
  const appsDirStat = this.statSync(appsDir);
8230
8530
  if (appsDirStat?.isDirectory()) {
@@ -8232,15 +8532,15 @@ var init_PathResolver = __esm({
8232
8532
  }
8233
8533
  }
8234
8534
  const packageJsonPath = this.normalizePath(
8235
- join(currentDir, "package.json")
8535
+ join2(currentDir, "package.json")
8236
8536
  );
8237
8537
  if (this.pathExists(packageJsonPath)) {
8238
- const parentDir2 = this.normalizePath(dirname(currentDir));
8538
+ const parentDir2 = this.normalizePath(dirname2(currentDir));
8239
8539
  if (parentDir2 === currentDir) {
8240
8540
  return currentDir;
8241
8541
  }
8242
8542
  }
8243
- const parentDir = this.normalizePath(dirname(currentDir));
8543
+ const parentDir = this.normalizePath(dirname2(currentDir));
8244
8544
  if (parentDir === currentDir) {
8245
8545
  break;
8246
8546
  }
@@ -8256,8 +8556,8 @@ var init_PathResolver = __esm({
8256
8556
  // packages/tooling/src/utils/pathResolver.ts
8257
8557
  import { createRequire as createRequire2 } from "node:module";
8258
8558
  import {
8259
- join as join2,
8260
- dirname as dirname2,
8559
+ join as join3,
8560
+ dirname as dirname3,
8261
8561
  basename as basename2,
8262
8562
  extname as extname2,
8263
8563
  relative as relative2,
@@ -8266,7 +8566,7 @@ import {
8266
8566
  isAbsolute as pathIsAbsolute
8267
8567
  } from "node:path";
8268
8568
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8269
- function readdirSync2(dirPath, options) {
8569
+ function readdirSync3(dirPath, options) {
8270
8570
  return pathResolverInstance.readdirSync(dirPath, options);
8271
8571
  }
8272
8572
  var pathResolverInstance, getRepoRoot, resolvePackage, normalizePath, pathExists, readSync, statSync2, joinPath;
@@ -8279,7 +8579,7 @@ var init_pathResolver = __esm({
8279
8579
  getRepoRoot = () => pathResolverInstance.getRepoRoot();
8280
8580
  resolvePackage = (spec, from) => pathResolverInstance.resolvePackage(spec, from || null);
8281
8581
  normalizePath = (...pathSegments) => {
8282
- return pathResolverInstance.normalizePath(join2(...pathSegments));
8582
+ return pathResolverInstance.normalizePath(join3(...pathSegments));
8283
8583
  };
8284
8584
  pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
8285
8585
  readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
@@ -8337,10 +8637,10 @@ var init_typed_file_operations = __esm({
8337
8637
  });
8338
8638
 
8339
8639
  // packages/tooling/src/bundler/utils.ts
8340
- import { Buffer } from "node:buffer";
8640
+ import { Buffer as Buffer2 } from "node:buffer";
8341
8641
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8342
8642
  import { createRequire as createRequire3 } from "node:module";
8343
- import { dirname as dirname3, resolve as resolve3 } from "node:path";
8643
+ import { dirname as dirname4, resolve as resolve3 } from "node:path";
8344
8644
  import process from "node:process";
8345
8645
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8346
8646
  var require2, __filename, __dirname;
@@ -8349,12 +8649,12 @@ var init_utils2 = __esm({
8349
8649
  "use strict";
8350
8650
  require2 = createRequire3(import.meta.url);
8351
8651
  __filename = fileURLToPath3(import.meta.url);
8352
- __dirname = dirname3(__filename);
8652
+ __dirname = dirname4(__filename);
8353
8653
  if (typeof globalThis !== "undefined") {
8354
8654
  globalThis.require = require2;
8355
8655
  globalThis.__filename = __filename;
8356
8656
  globalThis.__dirname = __dirname;
8357
- globalThis.Buffer = Buffer;
8657
+ globalThis.Buffer = Buffer2;
8358
8658
  globalThis.process = process;
8359
8659
  if (typeof global === "undefined") {
8360
8660
  globalThis.global = globalThis;
@@ -8381,7 +8681,7 @@ function detectApps(projectRoot) {
8381
8681
  const appsDir = joinPath(projectRoot, "apps");
8382
8682
  const appsDirStat = statSync2(appsDir);
8383
8683
  if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
8384
- const appDirs = readdirSync2(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
8684
+ const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
8385
8685
  for (const appDir of appDirs) {
8386
8686
  const appPath = joinPath(appsDir, appDir);
8387
8687
  const packageJsonPath = joinPath(appPath, "package.json");
@@ -8558,17 +8858,17 @@ var init_app_detection = __esm({
8558
8858
  async function selectApp(projectRoot, appName) {
8559
8859
  const apps = detectApps(projectRoot);
8560
8860
  if (apps.length === 0) {
8561
- log.error("No apps found in this project.");
8562
- log.info('Run "dndev init" to create a new project.');
8861
+ log2.error("No apps found in this project.");
8862
+ log2.info('Run "dndev init" to create a new project.');
8563
8863
  return null;
8564
8864
  }
8565
8865
  if (appName) {
8566
- const app = apps.find((a) => a.name === appName);
8866
+ const app = apps.find((a2) => a2.name === appName);
8567
8867
  if (!app) {
8568
- log.warn(`App "${appName}" not found.`);
8569
- log.info("Available apps:");
8570
- apps.forEach((a) => log.info(` - ${a.name}`));
8571
- log.info("Please select from the list:");
8868
+ log2.warn(`App "${appName}" not found.`);
8869
+ log2.info("Available apps:");
8870
+ apps.forEach((a2) => log2.info(` - ${a2.name}`));
8871
+ log2.info("Please select from the list:");
8572
8872
  } else {
8573
8873
  return app;
8574
8874
  }
@@ -8576,7 +8876,7 @@ async function selectApp(projectRoot, appName) {
8576
8876
  if (apps.length === 1) {
8577
8877
  return apps[0] || null;
8578
8878
  }
8579
- const selected = await _t({
8879
+ const selected = await select({
8580
8880
  message: "Select app:",
8581
8881
  options: apps.map((app) => ({
8582
8882
  value: app.name,
@@ -8586,7 +8886,7 @@ async function selectApp(projectRoot, appName) {
8586
8886
  if (typeof selected !== "string") {
8587
8887
  return null;
8588
8888
  }
8589
- return apps.find((a) => a.name === selected) || null;
8889
+ return apps.find((a2) => a2.name === selected) || null;
8590
8890
  }
8591
8891
  var init_app_selector = __esm({
8592
8892
  "packages/tooling/src/utils/app-selector.ts"() {
@@ -8605,13 +8905,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
8605
8905
  label: choice.title,
8606
8906
  hint: choice.hint
8607
8907
  }));
8608
- const result = await _t({
8908
+ const result = await select({
8609
8909
  message,
8610
8910
  options,
8611
8911
  initialValue: choices[defaultValue]?.value
8612
8912
  });
8613
- if (q(result)) {
8614
- pt("Operation cancelled.");
8913
+ if (isCancel(result)) {
8914
+ cancel("Operation cancelled.");
8615
8915
  process.exit(0);
8616
8916
  }
8617
8917
  return result;
@@ -8624,9 +8924,9 @@ var init_cli_input = __esm({
8624
8924
  }
8625
8925
  });
8626
8926
 
8627
- // node_modules/.bun/esbuild@0.27.7/node_modules/esbuild/lib/main.js
8927
+ // node_modules/.bun/esbuild@0.28.2/node_modules/esbuild/lib/main.js
8628
8928
  var require_main = __commonJS({
8629
- "node_modules/.bun/esbuild@0.27.7/node_modules/esbuild/lib/main.js"(exports, module) {
8929
+ "node_modules/.bun/esbuild@0.28.2/node_modules/esbuild/lib/main.js"(exports, module) {
8630
8930
  "use strict";
8631
8931
  init_utils2();
8632
8932
  var __defProp2 = Object.defineProperty;
@@ -8718,7 +9018,7 @@ var require_main = __commonJS({
8718
9018
  case 5: {
8719
9019
  let count = bb.read32();
8720
9020
  let value2 = [];
8721
- for (let i = 0; i < count; i++) {
9021
+ for (let i2 = 0; i2 < count; i2++) {
8722
9022
  value2.push(visit());
8723
9023
  }
8724
9024
  return value2;
@@ -8726,7 +9026,7 @@ var require_main = __commonJS({
8726
9026
  case 6: {
8727
9027
  let count = bb.read32();
8728
9028
  let value2 = {};
8729
- for (let i = 0; i < count; i++) {
9029
+ for (let i2 = 0; i2 < count; i2++) {
8730
9030
  value2[decodeUTF8(bb.read())] = visit();
8731
9031
  }
8732
9032
  return value2;
@@ -8800,14 +9100,14 @@ var require_main = __commonJS({
8800
9100
  if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") {
8801
9101
  let encoder = new TextEncoder();
8802
9102
  let decoder = new TextDecoder();
8803
- encodeUTF8 = (text) => encoder.encode(text);
9103
+ encodeUTF8 = (text2) => encoder.encode(text2);
8804
9104
  decodeUTF8 = (bytes) => decoder.decode(bytes);
8805
9105
  encodeInvariant = 'new TextEncoder().encode("")';
8806
- } else if (typeof Buffer !== "undefined") {
8807
- encodeUTF8 = (text) => Buffer.from(text);
9106
+ } else if (typeof Buffer2 !== "undefined") {
9107
+ encodeUTF8 = (text2) => Buffer2.from(text2);
8808
9108
  decodeUTF8 = (bytes) => {
8809
9109
  let { buffer, byteOffset, byteLength } = bytes;
8810
- return Buffer.from(buffer, byteOffset, byteLength).toString();
9110
+ return Buffer2.from(buffer, byteOffset, byteLength).toString();
8811
9111
  };
8812
9112
  encodeInvariant = 'Buffer.from("")';
8813
9113
  } else {
@@ -8834,8 +9134,8 @@ is not a problem with esbuild. You need to fix your environment instead.
8834
9134
  const c2 = bytes[index];
8835
9135
  let line = 1;
8836
9136
  let column = 0;
8837
- for (let i = 0; i < index; i++) {
8838
- if (bytes[i] === 10) {
9137
+ for (let i2 = 0; i2 < index; i2++) {
9138
+ if (bytes[i2] === 10) {
8839
9139
  line++;
8840
9140
  column = 0;
8841
9141
  } else {
@@ -8857,37 +9157,37 @@ is not a problem with esbuild. You need to fix your environment instead.
8857
9157
  let property = null;
8858
9158
  let state = 0;
8859
9159
  let object;
8860
- let i = 0;
8861
- while (i < length) {
8862
- let c2 = bytes[i++];
9160
+ let i2 = 0;
9161
+ while (i2 < length) {
9162
+ let c2 = bytes[i2++];
8863
9163
  if (c2 <= 32) {
8864
9164
  continue;
8865
9165
  }
8866
9166
  let value;
8867
9167
  if (state === 2 && property === null && c2 !== 34 && c2 !== 125) {
8868
- throwSyntaxError(bytes, --i);
9168
+ throwSyntaxError(bytes, --i2);
8869
9169
  }
8870
9170
  switch (c2) {
8871
9171
  // True
8872
9172
  case 116: {
8873
- if (bytes[i++] !== 114 || bytes[i++] !== 117 || bytes[i++] !== 101) {
8874
- throwSyntaxError(bytes, --i);
9173
+ if (bytes[i2++] !== 114 || bytes[i2++] !== 117 || bytes[i2++] !== 101) {
9174
+ throwSyntaxError(bytes, --i2);
8875
9175
  }
8876
9176
  value = true;
8877
9177
  break;
8878
9178
  }
8879
9179
  // False
8880
9180
  case 102: {
8881
- if (bytes[i++] !== 97 || bytes[i++] !== 108 || bytes[i++] !== 115 || bytes[i++] !== 101) {
8882
- throwSyntaxError(bytes, --i);
9181
+ if (bytes[i2++] !== 97 || bytes[i2++] !== 108 || bytes[i2++] !== 115 || bytes[i2++] !== 101) {
9182
+ throwSyntaxError(bytes, --i2);
8883
9183
  }
8884
9184
  value = false;
8885
9185
  break;
8886
9186
  }
8887
9187
  // Null
8888
9188
  case 110: {
8889
- if (bytes[i++] !== 117 || bytes[i++] !== 108 || bytes[i++] !== 108) {
8890
- throwSyntaxError(bytes, --i);
9189
+ if (bytes[i2++] !== 117 || bytes[i2++] !== 108 || bytes[i2++] !== 108) {
9190
+ throwSyntaxError(bytes, --i2);
8891
9191
  }
8892
9192
  value = null;
8893
9193
  break;
@@ -8905,9 +9205,9 @@ is not a problem with esbuild. You need to fix your environment instead.
8905
9205
  case 55:
8906
9206
  case 56:
8907
9207
  case 57: {
8908
- let index = i;
9208
+ let index = i2;
8909
9209
  value = fromCharCode(c2);
8910
- c2 = bytes[i];
9210
+ c2 = bytes[i2];
8911
9211
  while (true) {
8912
9212
  switch (c2) {
8913
9213
  case 43:
@@ -8926,7 +9226,7 @@ is not a problem with esbuild. You need to fix your environment instead.
8926
9226
  case 101:
8927
9227
  case 69: {
8928
9228
  value += fromCharCode(c2);
8929
- c2 = bytes[++i];
9229
+ c2 = bytes[++i2];
8930
9230
  continue;
8931
9231
  }
8932
9232
  }
@@ -8942,14 +9242,14 @@ is not a problem with esbuild. You need to fix your environment instead.
8942
9242
  case 34: {
8943
9243
  value = "";
8944
9244
  while (true) {
8945
- if (i >= length) {
9245
+ if (i2 >= length) {
8946
9246
  throwSyntaxError(bytes, length);
8947
9247
  }
8948
- c2 = bytes[i++];
9248
+ c2 = bytes[i2++];
8949
9249
  if (c2 === 34) {
8950
9250
  break;
8951
9251
  } else if (c2 === 92) {
8952
- switch (bytes[i++]) {
9252
+ switch (bytes[i2++]) {
8953
9253
  // Normal escape sequence
8954
9254
  case 34:
8955
9255
  value += '"';
@@ -8978,30 +9278,30 @@ is not a problem with esbuild. You need to fix your environment instead.
8978
9278
  // Unicode escape sequence
8979
9279
  case 117: {
8980
9280
  let code = 0;
8981
- for (let j2 = 0; j2 < 4; j2++) {
8982
- c2 = bytes[i++];
9281
+ for (let j = 0; j < 4; j++) {
9282
+ c2 = bytes[i2++];
8983
9283
  code <<= 4;
8984
9284
  if (c2 >= 48 && c2 <= 57) code |= c2 - 48;
8985
9285
  else if (c2 >= 97 && c2 <= 102) code |= c2 + (10 - 97);
8986
9286
  else if (c2 >= 65 && c2 <= 70) code |= c2 + (10 - 65);
8987
- else throwSyntaxError(bytes, --i);
9287
+ else throwSyntaxError(bytes, --i2);
8988
9288
  }
8989
9289
  value += fromCharCode(code);
8990
9290
  break;
8991
9291
  }
8992
9292
  // Invalid escape sequence
8993
9293
  default:
8994
- throwSyntaxError(bytes, --i);
9294
+ throwSyntaxError(bytes, --i2);
8995
9295
  break;
8996
9296
  }
8997
9297
  } else if (c2 <= 127) {
8998
9298
  value += fromCharCode(c2);
8999
9299
  } else if ((c2 & 224) === 192) {
9000
- value += fromCharCode((c2 & 31) << 6 | bytes[i++] & 63);
9300
+ value += fromCharCode((c2 & 31) << 6 | bytes[i2++] & 63);
9001
9301
  } else if ((c2 & 240) === 224) {
9002
- value += fromCharCode((c2 & 15) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63);
9302
+ value += fromCharCode((c2 & 15) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63);
9003
9303
  } else if ((c2 & 248) == 240) {
9004
- let codePoint = (c2 & 7) << 18 | (bytes[i++] & 63) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63;
9304
+ let codePoint = (c2 & 7) << 18 | (bytes[i2++] & 63) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63;
9005
9305
  if (codePoint > 65535) {
9006
9306
  codePoint -= 65536;
9007
9307
  value += fromCharCode(codePoint >> 10 & 1023 | 55296);
@@ -9038,7 +9338,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9038
9338
  // Array end
9039
9339
  case 93: {
9040
9340
  if (state !== 1) {
9041
- throwSyntaxError(bytes, --i);
9341
+ throwSyntaxError(bytes, --i2);
9042
9342
  }
9043
9343
  value = object;
9044
9344
  property = propertyStack.pop();
@@ -9049,7 +9349,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9049
9349
  // Object end
9050
9350
  case 125: {
9051
9351
  if (state !== 2) {
9052
- throwSyntaxError(bytes, --i);
9352
+ throwSyntaxError(bytes, --i2);
9053
9353
  }
9054
9354
  value = object;
9055
9355
  property = propertyStack.pop();
@@ -9058,16 +9358,16 @@ is not a problem with esbuild. You need to fix your environment instead.
9058
9358
  break;
9059
9359
  }
9060
9360
  default: {
9061
- throwSyntaxError(bytes, --i);
9361
+ throwSyntaxError(bytes, --i2);
9062
9362
  }
9063
9363
  }
9064
- c2 = bytes[i];
9364
+ c2 = bytes[i2];
9065
9365
  while (c2 <= 32) {
9066
- c2 = bytes[++i];
9366
+ c2 = bytes[++i2];
9067
9367
  }
9068
9368
  switch (state) {
9069
9369
  case 0: {
9070
- if (i === length) {
9370
+ if (i2 === length) {
9071
9371
  return value;
9072
9372
  }
9073
9373
  break;
@@ -9075,7 +9375,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9075
9375
  case 1: {
9076
9376
  object.push(value);
9077
9377
  if (c2 === 44) {
9078
- i++;
9378
+ i2++;
9079
9379
  continue;
9080
9380
  }
9081
9381
  if (c2 === 93) {
@@ -9087,14 +9387,14 @@ is not a problem with esbuild. You need to fix your environment instead.
9087
9387
  if (property === null) {
9088
9388
  property = value;
9089
9389
  if (c2 === 58) {
9090
- i++;
9390
+ i2++;
9091
9391
  continue;
9092
9392
  }
9093
9393
  } else {
9094
9394
  object[property] = value;
9095
9395
  property = null;
9096
9396
  if (c2 === 44) {
9097
- i++;
9397
+ i2++;
9098
9398
  continue;
9099
9399
  }
9100
9400
  if (c2 === 125) {
@@ -9106,7 +9406,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9106
9406
  }
9107
9407
  break;
9108
9408
  }
9109
- throwSyntaxError(bytes, i);
9409
+ throwSyntaxError(bytes, i2);
9110
9410
  }
9111
9411
  var quote = JSON.stringify;
9112
9412
  var buildLogLevelDefault = "warning";
@@ -9184,10 +9484,12 @@ is not a problem with esbuild. You need to fix your environment instead.
9184
9484
  let color = getFlag(options, keys, "color", mustBeBoolean);
9185
9485
  let logLevel = getFlag(options, keys, "logLevel", mustBeString);
9186
9486
  let logLimit = getFlag(options, keys, "logLimit", mustBeInteger);
9487
+ let logStyle = getFlag(options, keys, "logStyle", mustBeString);
9187
9488
  if (color !== void 0) flags.push(`--color=${color}`);
9188
9489
  else if (isTTY2) flags.push(`--color=true`);
9189
9490
  flags.push(`--log-level=${logLevel || logLevelDefault}`);
9190
9491
  flags.push(`--log-limit=${logLimit || 0}`);
9492
+ if (logStyle) flags.push(`--log-style=${logStyle}`);
9191
9493
  }
9192
9494
  function validateStringValue(value, what, key) {
9193
9495
  if (typeof value !== "string") {
@@ -9316,7 +9618,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9316
9618
  let footer = getFlag(options, keys, "footer", mustBeObject);
9317
9619
  let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
9318
9620
  let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString);
9319
- let stdin = getFlag(options, keys, "stdin", mustBeObject);
9621
+ let stdin2 = getFlag(options, keys, "stdin", mustBeObject);
9320
9622
  let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
9321
9623
  let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean);
9322
9624
  let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
@@ -9374,18 +9676,18 @@ is not a problem with esbuild. You need to fix your environment instead.
9374
9676
  }
9375
9677
  if (entryPoints) {
9376
9678
  if (Array.isArray(entryPoints)) {
9377
- for (let i = 0, n = entryPoints.length; i < n; i++) {
9378
- let entryPoint = entryPoints[i];
9679
+ for (let i2 = 0, n3 = entryPoints.length; i2 < n3; i2++) {
9680
+ let entryPoint = entryPoints[i2];
9379
9681
  if (typeof entryPoint === "object" && entryPoint !== null) {
9380
9682
  let entryPointKeys = /* @__PURE__ */ Object.create(null);
9381
9683
  let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString);
9382
9684
  let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
9383
- checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i);
9384
- if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i);
9385
- if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i);
9685
+ checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i2);
9686
+ if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i2);
9687
+ if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i2);
9386
9688
  entries.push([output, input]);
9387
9689
  } else {
9388
- entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]);
9690
+ entries.push(["", validateStringValue(entryPoint, "entry point at index " + i2)]);
9389
9691
  }
9390
9692
  }
9391
9693
  } else {
@@ -9394,13 +9696,13 @@ is not a problem with esbuild. You need to fix your environment instead.
9394
9696
  }
9395
9697
  }
9396
9698
  }
9397
- if (stdin) {
9699
+ if (stdin2) {
9398
9700
  let stdinKeys = /* @__PURE__ */ Object.create(null);
9399
- let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
9400
- let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
9401
- let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
9402
- let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
9403
- checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object');
9701
+ let contents = getFlag(stdin2, stdinKeys, "contents", mustBeStringOrUint8Array);
9702
+ let resolveDir = getFlag(stdin2, stdinKeys, "resolveDir", mustBeString);
9703
+ let sourcefile = getFlag(stdin2, stdinKeys, "sourcefile", mustBeString);
9704
+ let loader2 = getFlag(stdin2, stdinKeys, "loader", mustBeString);
9705
+ checkForInvalidFlags(stdin2, stdinKeys, 'in "stdin" object');
9404
9706
  if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
9405
9707
  if (loader2) flags.push(`--loader=${loader2}`);
9406
9708
  if (resolveDir) stdinResolveDir = resolveDir;
@@ -9453,38 +9755,38 @@ is not a problem with esbuild. You need to fix your environment instead.
9453
9755
  let responseCallbacks = {};
9454
9756
  let nextRequestID = 0;
9455
9757
  let nextBuildKey = 0;
9456
- let stdout = new Uint8Array(16 * 1024);
9758
+ let stdout2 = new Uint8Array(16 * 1024);
9457
9759
  let stdoutUsed = 0;
9458
9760
  let readFromStdout = (chunk) => {
9459
9761
  let limit = stdoutUsed + chunk.length;
9460
- if (limit > stdout.length) {
9762
+ if (limit > stdout2.length) {
9461
9763
  let swap = new Uint8Array(limit * 2);
9462
- swap.set(stdout);
9463
- stdout = swap;
9764
+ swap.set(stdout2);
9765
+ stdout2 = swap;
9464
9766
  }
9465
- stdout.set(chunk, stdoutUsed);
9767
+ stdout2.set(chunk, stdoutUsed);
9466
9768
  stdoutUsed += chunk.length;
9467
9769
  let offset = 0;
9468
9770
  while (offset + 4 <= stdoutUsed) {
9469
- let length = readUInt32LE(stdout, offset);
9771
+ let length = readUInt32LE(stdout2, offset);
9470
9772
  if (offset + 4 + length > stdoutUsed) {
9471
9773
  break;
9472
9774
  }
9473
9775
  offset += 4;
9474
- handleIncomingPacket(stdout.subarray(offset, offset + length));
9776
+ handleIncomingPacket(stdout2.subarray(offset, offset + length));
9475
9777
  offset += length;
9476
9778
  }
9477
9779
  if (offset > 0) {
9478
- stdout.copyWithin(0, offset, stdoutUsed);
9780
+ stdout2.copyWithin(0, offset, stdoutUsed);
9479
9781
  stdoutUsed -= offset;
9480
9782
  }
9481
9783
  };
9482
9784
  let afterClose = (error2) => {
9483
9785
  closeData.didClose = true;
9484
9786
  if (error2) closeData.reason = ": " + (error2.message || error2);
9485
- const text = "The service was stopped" + closeData.reason;
9787
+ const text2 = "The service was stopped" + closeData.reason;
9486
9788
  for (let id in responseCallbacks) {
9487
- responseCallbacks[id](text, null);
9789
+ responseCallbacks[id](text2, null);
9488
9790
  }
9489
9791
  responseCallbacks = {};
9490
9792
  };
@@ -9536,8 +9838,8 @@ is not a problem with esbuild. You need to fix your environment instead.
9536
9838
  if (isFirstPacket) {
9537
9839
  isFirstPacket = false;
9538
9840
  let binaryVersion = String.fromCharCode(...bytes);
9539
- if (binaryVersion !== "0.27.7") {
9540
- throw new Error(`Cannot start service: Host version "${"0.27.7"}" does not match binary version ${quote(binaryVersion)}`);
9841
+ if (binaryVersion !== "0.28.2") {
9842
+ throw new Error(`Cannot start service: Host version "${"0.28.2"}" does not match binary version ${quote(binaryVersion)}`);
9541
9843
  }
9542
9844
  return;
9543
9845
  }
@@ -9676,6 +9978,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9676
9978
  let kind = getFlag(options, keys, "kind", mustBeString);
9677
9979
  let color = getFlag(options, keys, "color", mustBeBoolean);
9678
9980
  let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger);
9981
+ let logStyle = getFlag(options, keys, "logStyle", mustBeString);
9679
9982
  checkForInvalidFlags(options, keys, `in ${callName}() call`);
9680
9983
  if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`);
9681
9984
  if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
@@ -9686,6 +9989,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9686
9989
  };
9687
9990
  if (color !== void 0) request.color = color;
9688
9991
  if (terminalWidth !== void 0) request.terminalWidth = terminalWidth;
9992
+ if (logStyle !== void 0) request.logStyle = logStyle;
9689
9993
  sendRequest(refs, request, (error2, response) => {
9690
9994
  if (error2) return callback(new Error(error2), null);
9691
9995
  callback(null, response.messages);
@@ -9968,15 +10272,15 @@ is not a problem with esbuild. You need to fix your environment instead.
9968
10272
  let onLoadCallbacks = {};
9969
10273
  let onDisposeCallbacks = [];
9970
10274
  let nextCallbackID = 0;
9971
- let i = 0;
10275
+ let i2 = 0;
9972
10276
  let requestPlugins = [];
9973
10277
  let isSetupDone = false;
9974
10278
  plugins = [...plugins];
9975
10279
  for (let item of plugins) {
9976
10280
  let keys = {};
9977
- if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`);
10281
+ if (typeof item !== "object") throw new Error(`Plugin at index ${i2} must be an object`);
9978
10282
  const name = getFlag(item, keys, "name", mustBeString);
9979
- if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`);
10283
+ if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i2} is missing a name`);
9980
10284
  try {
9981
10285
  let setup = getFlag(item, keys, "setup", mustBeFunction);
9982
10286
  if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
@@ -9988,7 +10292,7 @@ is not a problem with esbuild. You need to fix your environment instead.
9988
10292
  onResolve: [],
9989
10293
  onLoad: []
9990
10294
  };
9991
- i++;
10295
+ i2++;
9992
10296
  let resolve5 = (path3, options = {}) => {
9993
10297
  if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
9994
10298
  if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
@@ -10084,7 +10388,7 @@ is not a problem with esbuild. You need to fix your environment instead.
10084
10388
  requestCallbacks["on-start"] = async (id, request) => {
10085
10389
  details.clear();
10086
10390
  let response = { errors: [], warnings: [] };
10087
- await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
10391
+ await Promise.all(onStartCallbacks.map(async ({ name, callback, note: note2 }) => {
10088
10392
  try {
10089
10393
  let result = await callback();
10090
10394
  if (result != null) {
@@ -10097,16 +10401,16 @@ is not a problem with esbuild. You need to fix your environment instead.
10097
10401
  if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
10098
10402
  }
10099
10403
  } catch (e) {
10100
- response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name));
10404
+ response.errors.push(extractErrorMessageV8(e, streamIn, details, note2 && note2(), name));
10101
10405
  }
10102
10406
  }));
10103
10407
  sendResponse(id, response);
10104
10408
  };
10105
10409
  requestCallbacks["on-resolve"] = async (id, request) => {
10106
- let response = {}, name = "", callback, note;
10410
+ let response = {}, name = "", callback, note2;
10107
10411
  for (let id2 of request.ids) {
10108
10412
  try {
10109
- ({ name, callback, note } = onResolveCallbacks[id2]);
10413
+ ({ name, callback, note: note2 } = onResolveCallbacks[id2]);
10110
10414
  let result = await callback({
10111
10415
  path: request.path,
10112
10416
  importer: request.importer,
@@ -10146,17 +10450,17 @@ is not a problem with esbuild. You need to fix your environment instead.
10146
10450
  break;
10147
10451
  }
10148
10452
  } catch (e) {
10149
- response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
10453
+ response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)] };
10150
10454
  break;
10151
10455
  }
10152
10456
  }
10153
10457
  sendResponse(id, response);
10154
10458
  };
10155
10459
  requestCallbacks["on-load"] = async (id, request) => {
10156
- let response = {}, name = "", callback, note;
10460
+ let response = {}, name = "", callback, note2;
10157
10461
  for (let id2 of request.ids) {
10158
10462
  try {
10159
- ({ name, callback, note } = onLoadCallbacks[id2]);
10463
+ ({ name, callback, note: note2 } = onLoadCallbacks[id2]);
10160
10464
  let result = await callback({
10161
10465
  path: request.path,
10162
10466
  namespace: request.namespace,
@@ -10191,7 +10495,7 @@ is not a problem with esbuild. You need to fix your environment instead.
10191
10495
  break;
10192
10496
  }
10193
10497
  } catch (e) {
10194
- response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
10498
+ response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)] };
10195
10499
  break;
10196
10500
  }
10197
10501
  }
@@ -10203,7 +10507,7 @@ is not a problem with esbuild. You need to fix your environment instead.
10203
10507
  (async () => {
10204
10508
  const onEndErrors = [];
10205
10509
  const onEndWarnings = [];
10206
- for (const { name, callback, note } of onEndCallbacks) {
10510
+ for (const { name, callback, note: note2 } of onEndCallbacks) {
10207
10511
  let newErrors;
10208
10512
  let newWarnings;
10209
10513
  try {
@@ -10218,7 +10522,7 @@ is not a problem with esbuild. You need to fix your environment instead.
10218
10522
  if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
10219
10523
  }
10220
10524
  } catch (e) {
10221
- newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)];
10525
+ newErrors = [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)];
10222
10526
  }
10223
10527
  if (newErrors) {
10224
10528
  onEndErrors.push(...newErrors);
@@ -10271,43 +10575,43 @@ is not a problem with esbuild. You need to fix your environment instead.
10271
10575
  };
10272
10576
  }
10273
10577
  function extractCallerV8(e, streamIn, ident) {
10274
- let note;
10578
+ let note2;
10275
10579
  let tried = false;
10276
10580
  return () => {
10277
- if (tried) return note;
10581
+ if (tried) return note2;
10278
10582
  tried = true;
10279
10583
  try {
10280
10584
  let lines = (e.stack + "").split("\n");
10281
10585
  lines.splice(1, 1);
10282
10586
  let location = parseStackLinesV8(streamIn, lines, ident);
10283
10587
  if (location) {
10284
- note = { text: e.message, location };
10285
- return note;
10588
+ note2 = { text: e.message, location };
10589
+ return note2;
10286
10590
  }
10287
10591
  } catch {
10288
10592
  }
10289
10593
  };
10290
10594
  }
10291
- function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
10292
- let text = "Internal error";
10595
+ function extractErrorMessageV8(e, streamIn, stash, note2, pluginName) {
10596
+ let text2 = "Internal error";
10293
10597
  let location = null;
10294
10598
  try {
10295
- text = (e && e.message || e) + "";
10599
+ text2 = (e && e.message || e) + "";
10296
10600
  } catch {
10297
10601
  }
10298
10602
  try {
10299
10603
  location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
10300
10604
  } catch {
10301
10605
  }
10302
- return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
10606
+ return { id: "", pluginName, text: text2, location, notes: note2 ? [note2] : [], detail: stash ? stash.store(e) : -1 };
10303
10607
  }
10304
10608
  function parseStackLinesV8(streamIn, lines, ident) {
10305
- let at2 = " at ";
10306
- if (streamIn.readFileSync && !lines[0].startsWith(at2) && lines[1].startsWith(at2)) {
10307
- for (let i = 1; i < lines.length; i++) {
10308
- let line = lines[i];
10309
- if (!line.startsWith(at2)) continue;
10310
- line = line.slice(at2.length);
10609
+ let at = " at ";
10610
+ if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) {
10611
+ for (let i2 = 1; i2 < lines.length; i2++) {
10612
+ let line = lines[i2];
10613
+ if (!line.startsWith(at)) continue;
10614
+ line = line.slice(at.length);
10311
10615
  while (true) {
10312
10616
  let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line);
10313
10617
  if (match) {
@@ -10346,10 +10650,10 @@ is not a problem with esbuild. You need to fix your environment instead.
10346
10650
  }
10347
10651
  return null;
10348
10652
  }
10349
- function failureErrorWithLog(text, errors, warnings) {
10653
+ function failureErrorWithLog(text2, errors, warnings) {
10350
10654
  let limit = 5;
10351
- text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
10352
- if (i === limit) return "\n...";
10655
+ text2 += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i2) => {
10656
+ if (i2 === limit) return "\n...";
10353
10657
  if (!e.location) return `
10354
10658
  error: ${e.text}`;
10355
10659
  let { file, line, column } = e.location;
@@ -10357,7 +10661,7 @@ error: ${e.text}`;
10357
10661
  return `
10358
10662
  ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10359
10663
  }).join("");
10360
- let error2 = new Error(text);
10664
+ let error2 = new Error(text2);
10361
10665
  for (const [key, value] of [["errors", errors], ["warnings", warnings]]) {
10362
10666
  Object.defineProperty(error2, key, {
10363
10667
  configurable: true,
@@ -10415,7 +10719,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10415
10719
  let keys = {};
10416
10720
  let id = getFlag(message, keys, "id", mustBeString);
10417
10721
  let pluginName = getFlag(message, keys, "pluginName", mustBeString);
10418
- let text = getFlag(message, keys, "text", mustBeString);
10722
+ let text2 = getFlag(message, keys, "text", mustBeString);
10419
10723
  let location = getFlag(message, keys, "location", mustBeObjectOrNull);
10420
10724
  let notes = getFlag(message, keys, "notes", mustBeArray);
10421
10725
  let detail = getFlag(message, keys, "detail", canBeAnything);
@@ -10423,11 +10727,11 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10423
10727
  checkForInvalidFlags(message, keys, where);
10424
10728
  let notesClone = [];
10425
10729
  if (notes) {
10426
- for (const note of notes) {
10730
+ for (const note2 of notes) {
10427
10731
  let noteKeys = {};
10428
- let noteText = getFlag(note, noteKeys, "text", mustBeString);
10429
- let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull);
10430
- checkForInvalidFlags(note, noteKeys, where);
10732
+ let noteText = getFlag(note2, noteKeys, "text", mustBeString);
10733
+ let noteLocation = getFlag(note2, noteKeys, "location", mustBeObjectOrNull);
10734
+ checkForInvalidFlags(note2, noteKeys, where);
10431
10735
  notesClone.push({
10432
10736
  text: noteText || "",
10433
10737
  location: sanitizeLocation(noteLocation, where, terminalWidth)
@@ -10437,7 +10741,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10437
10741
  messagesClone.push({
10438
10742
  id: id || "",
10439
10743
  pluginName: pluginName || fallbackPluginName,
10440
- text: text || "",
10744
+ text: text2 || "",
10441
10745
  location: sanitizeLocation(location, where, terminalWidth),
10442
10746
  notes: notesClone,
10443
10747
  detail: stash ? stash.store(detail) : -1
@@ -10464,18 +10768,18 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10464
10768
  return result;
10465
10769
  }
10466
10770
  function convertOutputFiles({ path: path3, contents, hash }) {
10467
- let text = null;
10771
+ let text2 = null;
10468
10772
  return {
10469
10773
  path: path3,
10470
10774
  contents,
10471
10775
  hash,
10472
10776
  get text() {
10473
10777
  const binary = this.contents;
10474
- if (text === null || binary !== contents) {
10778
+ if (text2 === null || binary !== contents) {
10475
10779
  contents = binary;
10476
- text = decodeUTF8(binary);
10780
+ text2 = decodeUTF8(binary);
10477
10781
  }
10478
- return text;
10782
+ return text2;
10479
10783
  }
10480
10784
  };
10481
10785
  }
@@ -10485,13 +10789,13 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
10485
10789
  return result;
10486
10790
  }
10487
10791
  function parseJSON(bytes) {
10488
- let text;
10792
+ let text2;
10489
10793
  try {
10490
- text = decodeUTF8(bytes);
10794
+ text2 = decodeUTF8(bytes);
10491
10795
  } catch {
10492
10796
  return JSON_parse(bytes);
10493
10797
  }
10494
- return JSON.parse(text);
10798
+ return JSON.parse(text2);
10495
10799
  }
10496
10800
  var fs3 = __require("fs");
10497
10801
  var os = __require("os");
@@ -10669,7 +10973,7 @@ for your current platform.`);
10669
10973
  "node_modules",
10670
10974
  ".cache",
10671
10975
  "esbuild",
10672
- `pnpapi-${pkg.replace("/", "-")}-${"0.27.7"}-${path.basename(subpath)}`
10976
+ `pnpapi-${pkg.replace("/", "-")}-${"0.28.2"}-${path.basename(subpath)}`
10673
10977
  );
10674
10978
  if (!fs3.existsSync(binTargetPath)) {
10675
10979
  fs3.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -10702,7 +11006,7 @@ for your current platform.`);
10702
11006
  }
10703
11007
  }
10704
11008
  var _a;
10705
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.27.7";
11009
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.28.2";
10706
11010
  var esbuildCommandAndArgs = () => {
10707
11011
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
10708
11012
  throw new Error(
@@ -10769,7 +11073,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10769
11073
  }
10770
11074
  }
10771
11075
  };
10772
- var version = "0.27.7";
11076
+ var version = "0.28.2";
10773
11077
  var build2 = (options) => ensureServiceIsRunning().build(options);
10774
11078
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
10775
11079
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -10872,7 +11176,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10872
11176
  var ensureServiceIsRunning = () => {
10873
11177
  if (longLivedService) return longLivedService;
10874
11178
  let [command, args] = esbuildCommandAndArgs();
10875
- let child = child_process.spawn(command, args.concat(`--service=${"0.27.7"}`, "--ping"), {
11179
+ let child = child_process.spawn(command, args.concat(`--service=${"0.28.2"}`, "--ping"), {
10876
11180
  windowsHide: true,
10877
11181
  stdio: ["pipe", "pipe", "inherit"],
10878
11182
  cwd: defaultWD
@@ -10890,13 +11194,13 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10890
11194
  });
10891
11195
  child.stdin.on("error", afterClose);
10892
11196
  child.on("error", afterClose);
10893
- const stdin = child.stdin;
10894
- const stdout = child.stdout;
10895
- stdout.on("data", readFromStdout);
10896
- stdout.on("end", afterClose);
11197
+ const stdin2 = child.stdin;
11198
+ const stdout2 = child.stdout;
11199
+ stdout2.on("data", readFromStdout);
11200
+ stdout2.on("end", afterClose);
10897
11201
  stopService = () => {
10898
- stdin.destroy();
10899
- stdout.destroy();
11202
+ stdin2.destroy();
11203
+ stdout2.destroy();
10900
11204
  child.kill();
10901
11205
  initializeWasCalled = false;
10902
11206
  longLivedService = void 0;
@@ -10904,11 +11208,11 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10904
11208
  };
10905
11209
  let refCount = 0;
10906
11210
  child.unref();
10907
- if (stdin.unref) {
10908
- stdin.unref();
11211
+ if (stdin2.unref) {
11212
+ stdin2.unref();
10909
11213
  }
10910
- if (stdout.unref) {
10911
- stdout.unref();
11214
+ if (stdout2.unref) {
11215
+ stdout2.unref();
10912
11216
  }
10913
11217
  const refs = {
10914
11218
  ref() {
@@ -10965,28 +11269,28 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10965
11269
  };
10966
11270
  var runServiceSync = (callback) => {
10967
11271
  let [command, args] = esbuildCommandAndArgs();
10968
- let stdin = new Uint8Array();
11272
+ let stdin2 = new Uint8Array();
10969
11273
  let { readFromStdout, afterClose, service } = createChannel({
10970
11274
  writeToStdin(bytes) {
10971
- if (stdin.length !== 0) throw new Error("Must run at most one command");
10972
- stdin = bytes;
11275
+ if (stdin2.length !== 0) throw new Error("Must run at most one command");
11276
+ stdin2 = bytes;
10973
11277
  },
10974
11278
  isSync: true,
10975
11279
  hasFS: true,
10976
11280
  esbuild: node_exports
10977
11281
  });
10978
11282
  callback(service);
10979
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.27.7"}`), {
11283
+ let stdout2 = child_process.execFileSync(command, args.concat(`--service=${"0.28.2"}`), {
10980
11284
  cwd: defaultWD,
10981
11285
  windowsHide: true,
10982
- input: stdin,
11286
+ input: stdin2,
10983
11287
  // We don't know how large the output could be. If it's too large, the
10984
11288
  // command will fail with ENOBUFS. Reserve 16mb for now since that feels
10985
11289
  // like it should be enough. Also allow overriding this with an environment
10986
11290
  // variable.
10987
11291
  maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024
10988
11292
  });
10989
- readFromStdout(stdout);
11293
+ readFromStdout(stdout2);
10990
11294
  afterClose(null);
10991
11295
  };
10992
11296
  var randomFileName = () => {
@@ -10996,7 +11300,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
10996
11300
  var startWorkerThreadService = (worker_threads2) => {
10997
11301
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
10998
11302
  let worker = new worker_threads2.Worker(__filename, {
10999
- workerData: { workerPort, defaultWD, esbuildVersion: "0.27.7" },
11303
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.28.2" },
11000
11304
  transferList: [workerPort],
11001
11305
  // From node's documentation: https://nodejs.org/api/worker_threads.html
11002
11306
  //
@@ -11010,10 +11314,10 @@ More information: The file containing the code for esbuild's JavaScript API (${_
11010
11314
  execArgv: []
11011
11315
  });
11012
11316
  let nextID = 0;
11013
- let fakeBuildError = (text) => {
11317
+ let fakeBuildError = (text2) => {
11014
11318
  let error2 = new Error(`Build failed with 1 error:
11015
- error: ${text}`);
11016
- let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
11319
+ error: ${text2}`);
11320
+ let errors = [{ id: "", pluginName: "", text: text2, location: null, notes: [], detail: void 0 }];
11017
11321
  error2.errors = errors;
11018
11322
  error2.warnings = [];
11019
11323
  return error2;
@@ -11131,13 +11435,13 @@ __export(bundle_edge_function_exports, {
11131
11435
  buildSupabaseEdgeFunctions: () => buildSupabaseEdgeFunctions,
11132
11436
  bundleEdgeFunction: () => bundleEdgeFunction
11133
11437
  });
11134
- import { resolve as resolve4, dirname as dirname4, join as join3 } from "node:path";
11135
11438
  import fs2 from "node:fs";
11439
+ import { resolve as resolve4, dirname as dirname5, join as join4 } from "node:path";
11136
11440
  function detectWorkspace() {
11137
11441
  let currentDir = process.cwd();
11138
11442
  const maxDepth = 10;
11139
- for (let i = 0; i < maxDepth; i++) {
11140
- const packageJsonPath = join3(currentDir, "package.json");
11443
+ for (let i2 = 0; i2 < maxDepth; i2++) {
11444
+ const packageJsonPath = join4(currentDir, "package.json");
11141
11445
  if (fs2.existsSync(packageJsonPath)) {
11142
11446
  try {
11143
11447
  const packageJson = JSON.parse(
@@ -11145,20 +11449,20 @@ function detectWorkspace() {
11145
11449
  );
11146
11450
  const hasWorkspaces = Array.isArray(packageJson.workspaces);
11147
11451
  const hasDndevPackages = hasWorkspaces && packageJson.workspaces.some(
11148
- (w3) => w3 === "packages/**" || w3.startsWith("packages/")
11452
+ (w) => w === "packages/**" || w.startsWith("packages/")
11149
11453
  );
11150
- const isDndevRepo = hasDndevPackages && (fs2.existsSync(join3(currentDir, "packages", "core")) || fs2.existsSync(join3(currentDir, "packages", "functions")));
11454
+ const isDndevRepo = hasDndevPackages && (fs2.existsSync(join4(currentDir, "packages", "core")) || fs2.existsSync(join4(currentDir, "packages", "functions")));
11151
11455
  if (isDndevRepo) {
11152
11456
  return { type: "dndev", root: currentDir };
11153
11457
  }
11154
11458
  if (hasWorkspaces) {
11155
11459
  const dndevPattern = packageJson.workspaces.find(
11156
- (w3) => w3.includes("dndev/packages")
11460
+ (w) => w.includes("dndev/packages")
11157
11461
  );
11158
11462
  if (dndevPattern) {
11159
11463
  const dndevRelPath = dndevPattern.replace(/\/packages.*$/, "");
11160
11464
  const dndevRoot = resolve4(currentDir, dndevRelPath);
11161
- if (fs2.existsSync(join3(dndevRoot, "packages", "core"))) {
11465
+ if (fs2.existsSync(join4(dndevRoot, "packages", "core"))) {
11162
11466
  return { type: "dndev", root: dndevRoot };
11163
11467
  }
11164
11468
  }
@@ -11166,14 +11470,14 @@ function detectWorkspace() {
11166
11470
  } catch {
11167
11471
  }
11168
11472
  }
11169
- const parentDir = dirname4(currentDir);
11473
+ const parentDir = dirname5(currentDir);
11170
11474
  if (parentDir === currentDir) break;
11171
11475
  currentDir = parentDir;
11172
11476
  }
11173
11477
  return { type: "npm", root: process.cwd() };
11174
11478
  }
11175
11479
  function readDenoImports(functionsDir) {
11176
- const denoJsonPath = join3(functionsDir, "deno.json");
11480
+ const denoJsonPath = join4(functionsDir, "deno.json");
11177
11481
  if (!fs2.existsSync(denoJsonPath)) {
11178
11482
  throw new Error(
11179
11483
  `deno.json not found in ${functionsDir}. Required for edge function bundling.`
@@ -11194,7 +11498,7 @@ function resolvePackageExport(packageName, subpath, fromDir) {
11194
11498
  if (!pkgDir) return null;
11195
11499
  try {
11196
11500
  const pkgJson = JSON.parse(
11197
- fs2.readFileSync(join3(pkgDir, "package.json"), "utf8")
11501
+ fs2.readFileSync(join4(pkgDir, "package.json"), "utf8")
11198
11502
  );
11199
11503
  const exports = pkgJson.exports;
11200
11504
  if (!exports) return null;
@@ -11371,34 +11675,34 @@ async function bundleEdgeFunction(options) {
11371
11675
  const denoImports = readDenoImports(functionsDir);
11372
11676
  const alias = {};
11373
11677
  if (workspace.type === "dndev") {
11374
- alias["@donotdev/types"] = join3(
11678
+ alias["@donotdev/types"] = join4(
11375
11679
  workspace.root,
11376
11680
  "packages",
11377
11681
  "core",
11378
11682
  "types",
11379
11683
  "src"
11380
11684
  );
11381
- alias["@donotdev/functions"] = join3(
11685
+ alias["@donotdev/functions"] = join4(
11382
11686
  workspace.root,
11383
11687
  "packages",
11384
11688
  "functions",
11385
11689
  "src"
11386
11690
  );
11387
- alias["@donotdev/utils"] = join3(
11691
+ alias["@donotdev/utils"] = join4(
11388
11692
  workspace.root,
11389
11693
  "packages",
11390
11694
  "core",
11391
11695
  "utils",
11392
11696
  "src"
11393
11697
  );
11394
- alias["@donotdev/schemas"] = join3(
11698
+ alias["@donotdev/schemas"] = join4(
11395
11699
  workspace.root,
11396
11700
  "packages",
11397
11701
  "core",
11398
11702
  "schemas",
11399
11703
  "src"
11400
11704
  );
11401
- alias["@donotdev/core"] = join3(workspace.root, "packages", "core");
11705
+ alias["@donotdev/core"] = join4(workspace.root, "packages", "core");
11402
11706
  }
11403
11707
  const config = {
11404
11708
  entryPoints: [entryPointPath],
@@ -11431,7 +11735,7 @@ ${errorMessages}`);
11431
11735
  }
11432
11736
  if (result.warnings.length > 0) {
11433
11737
  for (const warning of result.warnings) {
11434
- log.debug(`[bundle-edge] Warning: ${warning.text}`);
11738
+ log2.debug(`[bundle-edge] Warning: ${warning.text}`);
11435
11739
  }
11436
11740
  }
11437
11741
  if (!result.outputFiles?.[0]) {
@@ -11440,45 +11744,45 @@ ${errorMessages}`);
11440
11744
  return result.outputFiles[0].text;
11441
11745
  }
11442
11746
  async function buildSupabaseEdgeFunctions(functionsDir) {
11443
- const buildDir = join3(functionsDir, ".build");
11747
+ const buildDir = join4(functionsDir, ".build");
11444
11748
  fs2.mkdirSync(buildDir, { recursive: true });
11445
11749
  const entries = fs2.readdirSync(functionsDir).filter((item) => {
11446
- const itemPath = join3(functionsDir, item);
11750
+ const itemPath = join4(functionsDir, item);
11447
11751
  if (!fs2.statSync(itemPath).isDirectory()) return false;
11448
11752
  if (item === ".build") return false;
11449
- return fs2.existsSync(join3(itemPath, "index.ts"));
11753
+ return fs2.existsSync(join4(itemPath, "index.ts"));
11450
11754
  });
11451
11755
  if (entries.length === 0) {
11452
- log.warn("No edge functions found (no index.ts in any subdirectory)");
11756
+ log2.warn("No edge functions found (no index.ts in any subdirectory)");
11453
11757
  return { success: true, functions: [], errors: [] };
11454
11758
  }
11455
- log.info(`Bundling ${entries.length} edge function(s)...`);
11759
+ log2.info(`Bundling ${entries.length} edge function(s)...`);
11456
11760
  const results = [];
11457
11761
  const errors = [];
11458
11762
  for (const functionName of entries) {
11459
- const entryPointPath = join3(functionsDir, functionName, "index.ts");
11763
+ const entryPointPath = join4(functionsDir, functionName, "index.ts");
11460
11764
  try {
11461
11765
  const bundled = await bundleEdgeFunction({
11462
11766
  entryPointPath,
11463
11767
  functionsDir
11464
11768
  });
11465
- const outputPath = join3(buildDir, `${functionName}.js`);
11769
+ const outputPath = join4(buildDir, `${functionName}.js`);
11466
11770
  fs2.writeFileSync(outputPath, bundled, "utf8");
11467
- const size = Buffer.byteLength(bundled, "utf8");
11771
+ const size = Buffer2.byteLength(bundled, "utf8");
11468
11772
  results.push({ name: functionName, outputPath, size });
11469
- log.info(` ${functionName} \u2192 ${(size / 1024).toFixed(1)} KB`);
11773
+ log2.info(` ${functionName} \u2192 ${(size / 1024).toFixed(1)} KB`);
11470
11774
  } catch (error2) {
11471
11775
  const msg = error2 instanceof Error ? error2.message : String(error2);
11472
11776
  errors.push(`${functionName}: ${msg}`);
11473
- log.error(` ${functionName} \u2014 FAILED: ${msg}`);
11777
+ log2.error(` ${functionName} \u2014 FAILED: ${msg}`);
11474
11778
  }
11475
11779
  }
11476
11780
  if (errors.length > 0) {
11477
- log.error(`
11781
+ log2.error(`
11478
11782
  ${errors.length} function(s) failed to bundle`);
11479
11783
  return { success: false, functions: results, errors };
11480
11784
  }
11481
- log.info(`
11785
+ log2.info(`
11482
11786
  All ${results.length} function(s) built to ${buildDir}`);
11483
11787
  return { success: true, functions: results, errors: [] };
11484
11788
  }
@@ -11505,13 +11809,6 @@ init_utils2();
11505
11809
 
11506
11810
  // packages/tooling/src/apps/build.ts
11507
11811
  init_utils2();
11508
- init_app_detection();
11509
- init_app_selector();
11510
- init_cli_input();
11511
- init_cli_output();
11512
- init_errors();
11513
- init_pathResolver();
11514
- init_typed_file_operations();
11515
11812
  import { execSync, spawnSync as spawnSync2 } from "node:child_process";
11516
11813
 
11517
11814
  // packages/tooling/src/apps/deploy-utils.ts
@@ -11530,14 +11827,21 @@ function checkConfigPlaceholders(appDir) {
11530
11827
  }
11531
11828
  }
11532
11829
  if (bad.length > 0) {
11533
- log.warn(`Unreplaced template placeholders found in: ${bad.join(", ")}`);
11534
- log.warn(` Fix manually or re-run "dndev init" to regenerate.
11830
+ log2.warn(`Unreplaced template placeholders found in: ${bad.join(", ")}`);
11831
+ log2.warn(` Fix manually or re-run "dndev init" to regenerate.
11535
11832
  `);
11536
11833
  }
11537
11834
  return bad.length > 0;
11538
11835
  }
11539
11836
 
11540
11837
  // packages/tooling/src/apps/build.ts
11838
+ init_app_detection();
11839
+ init_app_selector();
11840
+ init_cli_input();
11841
+ init_cli_output();
11842
+ init_errors();
11843
+ init_pathResolver();
11844
+ init_typed_file_operations();
11541
11845
  function validateFirebaseJson(appDir) {
11542
11846
  const firebaseJsonPath = joinPath(appDir, "firebase.json");
11543
11847
  if (!pathExists(firebaseJsonPath)) {
@@ -11600,8 +11904,8 @@ async function main(options = {}) {
11600
11904
  const { appName: parsedAppName, buildType: parsedBuildType } = parseBuildArgs(args);
11601
11905
  const debugMode = process.env.DEBUG === "true" || process.env.DEBUG === "1" || args.includes("--debug") || args.includes("-d");
11602
11906
  if (debugMode) {
11603
- log.debug(` Args: ${args.join(" ")}`);
11604
- log.debug(
11907
+ log2.debug(` Args: ${args.join(" ")}`);
11908
+ log2.debug(
11605
11909
  ` Parsed app: ${parsedAppName || "none"}, build type: ${parsedBuildType || "none"}
11606
11910
  `
11607
11911
  );
@@ -11647,12 +11951,12 @@ async function main(options = {}) {
11647
11951
  });
11648
11952
  }
11649
11953
  if (choices.length === 0) {
11650
- log.error("No build targets found. App must have frontend or functions.");
11954
+ log2.error("No build targets found. App must have frontend or functions.");
11651
11955
  throw new DoNotDevError("No build targets found", "validation-error");
11652
11956
  }
11653
11957
  if (choices.length === 1) {
11654
11958
  buildType = choices[0].value;
11655
- wt(`Building: ${choices[0].title}`, "Auto-selected");
11959
+ note(`Building: ${choices[0].title}`, "Auto-selected");
11656
11960
  } else {
11657
11961
  buildType = await askForSelection(
11658
11962
  "What would you like to build?",
@@ -11662,7 +11966,7 @@ async function main(options = {}) {
11662
11966
  }
11663
11967
  if (buildType === "frontend" || buildType === "both") {
11664
11968
  if (!hasFrontend) {
11665
- log.error(
11969
+ log2.error(
11666
11970
  "Frontend build requested but app has no frontend configuration."
11667
11971
  );
11668
11972
  throw new DoNotDevError(
@@ -11670,7 +11974,7 @@ async function main(options = {}) {
11670
11974
  "validation-error"
11671
11975
  );
11672
11976
  }
11673
- log.info(`Building ${app.name} frontend...
11977
+ log2.info(`Building ${app.name} frontend...
11674
11978
  `);
11675
11979
  const turboArgs = ["build", "--filter", app.packageName];
11676
11980
  if (options.mode) {
@@ -11691,7 +11995,7 @@ async function main(options = {}) {
11691
11995
  }
11692
11996
  if (buildType === "functions" || buildType === "both") {
11693
11997
  if (!hasFunc) {
11694
- log.error(
11998
+ log2.error(
11695
11999
  "Functions build requested but app has no functions directory."
11696
12000
  );
11697
12001
  throw new DoNotDevError(
@@ -11701,13 +12005,13 @@ async function main(options = {}) {
11701
12005
  }
11702
12006
  const funcPath = getFunctionsPath(app);
11703
12007
  if (!funcPath || !pathExists(funcPath)) {
11704
- log.error(`Functions directory not found: ${funcPath}`);
12008
+ log2.error(`Functions directory not found: ${funcPath}`);
11705
12009
  throw new DoNotDevError(
11706
12010
  `Functions directory not found: ${funcPath}`,
11707
12011
  "file-not-found"
11708
12012
  );
11709
12013
  }
11710
- log.info(`Building ${app.name} functions (${app.functions})...
12014
+ log2.info(`Building ${app.name} functions (${app.functions})...
11711
12015
  `);
11712
12016
  if (app.functions === "supabase") {
11713
12017
  const { buildSupabaseEdgeFunctions: buildSupabaseEdgeFunctions2 } = await Promise.resolve().then(() => (init_bundle_edge_function(), bundle_edge_function_exports));
@@ -11719,7 +12023,7 @@ async function main(options = {}) {
11719
12023
  );
11720
12024
  }
11721
12025
  } else {
11722
- const s = fe();
12026
+ const s = spinner();
11723
12027
  s.start("Building functions...");
11724
12028
  try {
11725
12029
  execSync("bun run build", {
@@ -11737,7 +12041,7 @@ async function main(options = {}) {
11737
12041
  }
11738
12042
  }
11739
12043
  }
11740
- log.success(`Build complete for ${app.name}`);
12044
+ log2.success(`Build complete for ${app.name}`);
11741
12045
  return 0;
11742
12046
  }
11743
12047
  export {