create-avalon 0.1.0 → 0.1.2

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 (2) hide show
  1. package/dist/cli.js +894 -544
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -75,663 +75,1011 @@ var require_src = __commonJS((exports, module) => {
75
75
  module.exports = { cursor, scroll, erase, beep };
76
76
  });
77
77
 
78
- // ../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js
79
- var require_picocolors = __commonJS((exports, module) => {
80
- var p = process || {};
81
- var argv = p.argv || [];
82
- var env = p.env || {};
83
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
84
- var formatter = (open, close, replace = open) => (input) => {
85
- let string = "" + input, index = string.indexOf(close, open.length);
86
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
87
- };
88
- var replaceClose = (string, close, replace, index) => {
89
- let result = "", cursor = 0;
90
- do {
91
- result += string.substring(cursor, index) + replace;
92
- cursor = index + close.length;
93
- index = string.indexOf(close, cursor);
94
- } while (~index);
95
- return result + string.substring(cursor);
96
- };
97
- var createColors = (enabled = isColorSupported) => {
98
- let f = enabled ? formatter : () => String;
99
- return {
100
- isColorSupported: enabled,
101
- reset: f("\x1B[0m", "\x1B[0m"),
102
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
103
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
104
- italic: f("\x1B[3m", "\x1B[23m"),
105
- underline: f("\x1B[4m", "\x1B[24m"),
106
- inverse: f("\x1B[7m", "\x1B[27m"),
107
- hidden: f("\x1B[8m", "\x1B[28m"),
108
- strikethrough: f("\x1B[9m", "\x1B[29m"),
109
- black: f("\x1B[30m", "\x1B[39m"),
110
- red: f("\x1B[31m", "\x1B[39m"),
111
- green: f("\x1B[32m", "\x1B[39m"),
112
- yellow: f("\x1B[33m", "\x1B[39m"),
113
- blue: f("\x1B[34m", "\x1B[39m"),
114
- magenta: f("\x1B[35m", "\x1B[39m"),
115
- cyan: f("\x1B[36m", "\x1B[39m"),
116
- white: f("\x1B[37m", "\x1B[39m"),
117
- gray: f("\x1B[90m", "\x1B[39m"),
118
- bgBlack: f("\x1B[40m", "\x1B[49m"),
119
- bgRed: f("\x1B[41m", "\x1B[49m"),
120
- bgGreen: f("\x1B[42m", "\x1B[49m"),
121
- bgYellow: f("\x1B[43m", "\x1B[49m"),
122
- bgBlue: f("\x1B[44m", "\x1B[49m"),
123
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
124
- bgCyan: f("\x1B[46m", "\x1B[49m"),
125
- bgWhite: f("\x1B[47m", "\x1B[49m"),
126
- blackBright: f("\x1B[90m", "\x1B[39m"),
127
- redBright: f("\x1B[91m", "\x1B[39m"),
128
- greenBright: f("\x1B[92m", "\x1B[39m"),
129
- yellowBright: f("\x1B[93m", "\x1B[39m"),
130
- blueBright: f("\x1B[94m", "\x1B[39m"),
131
- magentaBright: f("\x1B[95m", "\x1B[39m"),
132
- cyanBright: f("\x1B[96m", "\x1B[39m"),
133
- whiteBright: f("\x1B[97m", "\x1B[39m"),
134
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
135
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
136
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
137
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
138
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
139
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
140
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
141
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
142
- };
143
- };
144
- module.exports = createColors();
145
- module.exports.createColors = createColors;
146
- });
147
-
148
78
  // src/cli.ts
149
79
  import { parseArgs } from "node:util";
150
80
  import { existsSync, readdirSync } from "node:fs";
151
81
  import { resolve } from "node:path";
152
82
  import { createRequire } from "node:module";
153
83
 
154
- // ../../node_modules/.bun/@clack+core@0.4.2/node_modules/@clack/core/dist/index.mjs
84
+ // ../../node_modules/.bun/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
85
+ import { styleText as D } from "node:util";
86
+ import { stdout as R, stdin as q } from "node:process";
155
87
  var import_sisteransi = __toESM(require_src(), 1);
156
- import { stdin as j, stdout as M } from "node:process";
157
- var import_picocolors = __toESM(require_picocolors(), 1);
158
- import O from "node:readline";
159
- import { Writable as X } from "node:stream";
160
- function DD({ onlyFirst: e = false } = {}) {
161
- const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
162
- return new RegExp(t, e ? undefined : "g");
163
- }
164
- var uD = DD();
165
- function P(e) {
166
- if (typeof e != "string")
167
- throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
168
- return e.replace(uD, "");
88
+ import ot from "node:readline";
89
+ function x(t, e, s) {
90
+ if (!s.some((u) => !u.disabled))
91
+ return t;
92
+ const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
93
+ return s[n].disabled ? x(n, e < 0 ? -1 : 1, s) : n;
169
94
  }
170
- function L(e) {
171
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
172
- }
173
- var W = { exports: {} };
174
- (function(e) {
175
- var u = {};
176
- e.exports = u, u.eastAsianWidth = function(F) {
177
- var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
178
- return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
179
- }, u.characterLength = function(F) {
180
- var s = this.eastAsianWidth(F);
181
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
182
- };
183
- function t(F) {
184
- return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
185
- }
186
- u.length = function(F) {
187
- for (var s = t(F), i = 0, D = 0;D < s.length; D++)
188
- i = i + this.characterLength(s[D]);
189
- return i;
190
- }, u.slice = function(F, s, i) {
191
- textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
192
- for (var D = "", r = 0, n = t(F), E = 0;E < n.length; E++) {
193
- var a = n[E], o = u.length(a);
194
- if (r >= s - (o == 2 ? 1 : 0))
195
- if (r + o <= i)
196
- D += a;
197
- else
95
+ var at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109;
96
+ var lt = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510;
97
+ var ht = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141;
98
+ var O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
99
+ var y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
100
+ var L = /\t{1,1000}/y;
101
+ var P = /[\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;
102
+ var M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
103
+ var ct = /\p{M}+/gu;
104
+ var ft = { limit: 1 / 0, ellipsis: "" };
105
+ var X = (t, e = {}, s = {}) => {
106
+ const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, ft, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
107
+ let h = 0, o = 0, p = t.length, v = 0, F = false, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
108
+ t:
109
+ for (;; ) {
110
+ if (w > C || o >= p && o > h) {
111
+ const ut = t.slice(C, w) || t.slice(h, o);
112
+ v = 0;
113
+ for (const Y of ut.replaceAll(ct, "")) {
114
+ const $ = Y.codePointAt(0) || 0;
115
+ if (lt($) ? f = m : ht($) ? f = V : E !== A && at($) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h) + v)), c + f > i) {
116
+ F = true;
117
+ break t;
118
+ }
119
+ v += Y.length, c += f;
120
+ }
121
+ C = w = 0;
122
+ }
123
+ if (o >= p)
124
+ break;
125
+ if (M.lastIndex = o, M.test(t)) {
126
+ if (v = M.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
127
+ F = true;
128
+ break;
129
+ }
130
+ c += f, C = h, w = o, o = h = M.lastIndex;
131
+ continue;
132
+ }
133
+ if (O.lastIndex = o, O.test(t)) {
134
+ if (c + u > b && (d = Math.min(d, o)), c + u > i) {
135
+ F = true;
136
+ break;
137
+ }
138
+ c += u, C = h, w = o, o = h = O.lastIndex;
139
+ continue;
140
+ }
141
+ if (y.lastIndex = o, y.test(t)) {
142
+ if (v = y.lastIndex - o, f = v * a, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + f > i) {
143
+ F = true;
144
+ break;
145
+ }
146
+ c += f, C = h, w = o, o = h = y.lastIndex;
147
+ continue;
148
+ }
149
+ if (L.lastIndex = o, L.test(t)) {
150
+ if (v = L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
151
+ F = true;
152
+ break;
153
+ }
154
+ c += f, C = h, w = o, o = h = L.lastIndex;
155
+ continue;
156
+ }
157
+ if (P.lastIndex = o, P.test(t)) {
158
+ if (c + g > b && (d = Math.min(d, o)), c + g > i) {
159
+ F = true;
198
160
  break;
199
- r += o;
161
+ }
162
+ c += g, C = h, w = o, o = h = P.lastIndex;
163
+ continue;
164
+ }
165
+ o += 1;
200
166
  }
201
- return D;
202
- };
203
- })(W);
204
- var tD = W.exports;
205
- var eD = L(tD);
206
- var FD = function() {
207
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
167
+ return { width: F ? b : c, index: F ? d : p, truncated: F, ellipsed: F && i >= n };
208
168
  };
209
- var sD = L(FD);
210
- function p(e, u = {}) {
211
- if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = P(e), e.length === 0))
169
+ var pt = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
170
+ var S = (t, e = {}) => X(t, pt, e).width;
171
+ var T = "\x1B";
172
+ var Z = "›";
173
+ var Ft = 39;
174
+ var j = "\x07";
175
+ var Q = "[";
176
+ var dt = "]";
177
+ var tt = "m";
178
+ var U = `${dt}8;;`;
179
+ var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
180
+ var mt = (t) => {
181
+ if (t >= 30 && t <= 37 || t >= 90 && t <= 97)
182
+ return 39;
183
+ if (t >= 40 && t <= 47 || t >= 100 && t <= 107)
184
+ return 49;
185
+ if (t === 1 || t === 2)
186
+ return 22;
187
+ if (t === 3)
188
+ return 23;
189
+ if (t === 4)
190
+ return 24;
191
+ if (t === 7)
192
+ return 27;
193
+ if (t === 8)
194
+ return 28;
195
+ if (t === 9)
196
+ return 29;
197
+ if (t === 0)
212
198
  return 0;
213
- e = e.replace(sD(), " ");
214
- const t = u.ambiguousIsNarrow ? 1 : 2;
215
- let F = 0;
216
- for (const s of e) {
217
- const i = s.codePointAt(0);
218
- if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
219
- continue;
220
- switch (eD.eastAsianWidth(s)) {
221
- case "F":
222
- case "W":
223
- F += 2;
224
- break;
225
- case "A":
226
- F += t;
227
- break;
228
- default:
229
- F += 1;
230
- }
231
- }
232
- return F;
233
- }
234
- var w = 10;
235
- var N = (e = 0) => (u) => `\x1B[${u + e}m`;
236
- var I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
237
- var R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`;
238
- var C = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
239
- Object.keys(C.modifier);
240
- var iD = Object.keys(C.color);
241
- var rD = Object.keys(C.bgColor);
242
- [...iD, ...rD];
243
- function CD() {
244
- const e = new Map;
245
- for (const [u, t] of Object.entries(C)) {
246
- for (const [F, s] of Object.entries(t))
247
- C[F] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F] = C[F], e.set(s[0], s[1]);
248
- Object.defineProperty(C, u, { value: t, enumerable: false });
249
- }
250
- return Object.defineProperty(C, "codes", { value: e, enumerable: false }), C.color.close = "\x1B[39m", C.bgColor.close = "\x1B[49m", C.color.ansi = N(), C.color.ansi256 = I(), C.color.ansi16m = R(), C.bgColor.ansi = N(w), C.bgColor.ansi256 = I(w), C.bgColor.ansi16m = R(w), Object.defineProperties(C, { rgbToAnsi256: { value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
251
- const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
252
- if (!t)
253
- return [0, 0, 0];
254
- let [F] = t;
255
- F.length === 3 && (F = [...F].map((i) => i + i).join(""));
256
- const s = Number.parseInt(F, 16);
257
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
258
- }, enumerable: false }, hexToAnsi256: { value: (u) => C.rgbToAnsi256(...C.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
259
- if (u < 8)
260
- return 30 + u;
261
- if (u < 16)
262
- return 90 + (u - 8);
263
- let t, F, s;
264
- if (u >= 232)
265
- t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
266
- else {
267
- u -= 16;
268
- const r = u % 36;
269
- t = Math.floor(u / 36) / 5, F = Math.floor(r / 6) / 5, s = r % 6 / 5;
270
- }
271
- const i = Math.max(t, F, s) * 2;
272
- if (i === 0)
273
- return 30;
274
- let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
275
- return i === 2 && (D += 60), D;
276
- }, enumerable: false }, rgbToAnsi: { value: (u, t, F) => C.ansi256ToAnsi(C.rgbToAnsi256(u, t, F)), enumerable: false }, hexToAnsi: { value: (u) => C.ansi256ToAnsi(C.hexToAnsi256(u)), enumerable: false } }), C;
277
- }
278
- var ED = CD();
279
- var d = new Set(["\x1B", "›"]);
280
- var oD = 39;
281
- var y = "\x07";
282
- var V = "[";
283
- var nD = "]";
284
- var G = "m";
285
- var _ = `${nD}8;;`;
286
- var z = (e) => `${d.values().next().value}${V}${e}${G}`;
287
- var K = (e) => `${d.values().next().value}${_}${e}${y}`;
288
- var aD = (e) => e.split(" ").map((u) => p(u));
289
- var k = (e, u, t) => {
290
- const F = [...u];
291
- let s = false, i = false, D = p(P(e[e.length - 1]));
292
- for (const [r, n] of F.entries()) {
293
- const E = p(n);
294
- if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d.has(n) && (s = true, i = F.slice(r + 1).join("").startsWith(_)), s) {
295
- i ? n === y && (s = false, i = false) : n === G && (s = false);
296
- continue;
297
- }
298
- D += E, D === t && r < F.length - 1 && (e.push(""), D = 0);
199
+ };
200
+ var st = (t) => `${T}${Q}${t}${tt}`;
201
+ var it = (t) => `${T}${U}${t}${j}`;
202
+ var gt = (t) => t.map((e) => S(e));
203
+ var G = (t, e, s) => {
204
+ const i = e[Symbol.iterator]();
205
+ let r = false, n = false, u = t.at(-1), a = u === undefined ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
206
+ for (;!l.done; ) {
207
+ const m = l.value, A = S(m);
208
+ a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === T || m === Z) && (r = true, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = false, n = false) : m === tt && (r = false) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
299
209
  }
300
- !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
210
+ u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
301
211
  };
302
- var hD = (e) => {
303
- const u = e.split(" ");
304
- let t = u.length;
305
- for (;t > 0 && !(p(u[t - 1]) > 0); )
306
- t--;
307
- return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
212
+ var vt = (t) => {
213
+ const e = t.split(" ");
214
+ let s = e.length;
215
+ for (;s > 0 && !(S(e[s - 1]) > 0); )
216
+ s--;
217
+ return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
308
218
  };
309
- var lD = (e, u, t = {}) => {
310
- if (t.trim !== false && e.trim() === "")
219
+ var Et = (t, e, s = {}) => {
220
+ if (s.trim !== false && t.trim() === "")
311
221
  return "";
312
- let F = "", s, i;
313
- const D = aD(e);
314
- let r = [""];
315
- for (const [E, a] of e.split(" ").entries()) {
316
- t.trim !== false && (r[r.length - 1] = r[r.length - 1].trimStart());
317
- let o = p(r[r.length - 1]);
318
- if (E !== 0 && (o >= u && (t.wordWrap === false || t.trim === false) && (r.push(""), o = 0), (o > 0 || t.trim === false) && (r[r.length - 1] += " ", o++)), t.hard && D[E] > u) {
319
- const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
320
- Math.floor((D[E] - 1) / u) < f && r.push(""), k(r, a, u);
222
+ let i = "", r, n;
223
+ const u = t.split(" "), a = gt(u);
224
+ let l = [""];
225
+ for (const [h, o] of u.entries()) {
226
+ s.trim !== false && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
227
+ let p = S(l.at(-1) ?? "");
228
+ if (h !== 0 && (p >= e && (s.wordWrap === false || s.trim === false) && (l.push(""), p = 0), (p > 0 || s.trim === false) && (l[l.length - 1] += " ", p++)), s.hard && a[h] > e) {
229
+ const v = e - p, F = 1 + Math.floor((a[h] - v - 1) / e);
230
+ Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
321
231
  continue;
322
232
  }
323
- if (o + D[E] > u && o > 0 && D[E] > 0) {
324
- if (t.wordWrap === false && o < u) {
325
- k(r, a, u);
233
+ if (p + a[h] > e && p > 0 && a[h] > 0) {
234
+ if (s.wordWrap === false && p < e) {
235
+ G(l, o, e);
326
236
  continue;
327
237
  }
328
- r.push("");
238
+ l.push("");
329
239
  }
330
- if (o + D[E] > u && t.wordWrap === false) {
331
- k(r, a, u);
240
+ if (p + a[h] > e && s.wordWrap === false) {
241
+ G(l, o, e);
332
242
  continue;
333
243
  }
334
- r[r.length - 1] += a;
335
- }
336
- t.trim !== false && (r = r.map((E) => hD(E)));
337
- const n = [...r.join(`
338
- `)];
339
- for (const [E, a] of n.entries()) {
340
- if (F += a, d.has(a)) {
341
- const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
342
- if (c.code !== undefined) {
343
- const f = Number.parseFloat(c.code);
344
- s = f === oD ? undefined : f;
244
+ l[l.length - 1] += o;
245
+ }
246
+ s.trim !== false && (l = l.map((h) => vt(h)));
247
+ const E = l.join(`
248
+ `), g = E[Symbol.iterator]();
249
+ let m = g.next(), A = g.next(), V = 0;
250
+ for (;!m.done; ) {
251
+ const h = m.value, o = A.value;
252
+ if (i += h, h === T || h === Z) {
253
+ et.lastIndex = V + 1;
254
+ const F = et.exec(E)?.groups;
255
+ if (F?.code !== undefined) {
256
+ const d = Number.parseFloat(F.code);
257
+ r = d === Ft ? undefined : d;
345
258
  } else
346
- c.uri !== undefined && (i = c.uri.length === 0 ? undefined : c.uri);
259
+ F?.uri !== undefined && (n = F.uri.length === 0 ? undefined : F.uri);
347
260
  }
348
- const o = ED.codes.get(Number(s));
349
- n[E + 1] === `
350
- ` ? (i && (F += K("")), s && o && (F += z(o))) : a === `
351
- ` && (s && o && (F += z(s)), i && (F += K(i)));
261
+ const p = r ? mt(r) : undefined;
262
+ o === `
263
+ ` ? (n && (i += it("")), r && p && (i += st(p))) : h === `
264
+ ` && (r && p && (i += st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
352
265
  }
353
- return F;
266
+ return i;
354
267
  };
355
- function Y(e, u, t) {
356
- return String(e).normalize().replace(/\r\n/g, `
268
+ function K(t, e, s) {
269
+ return String(t).normalize().replaceAll(`\r
270
+ `, `
357
271
  `).split(`
358
- `).map((F) => lD(F, u, t)).join(`
272
+ `).map((i) => Et(i, e, s)).join(`
359
273
  `);
360
274
  }
361
- var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
362
- var B = { actions: new Set(xD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
363
- function $(e, u) {
364
- if (typeof e == "string")
365
- return B.aliases.get(e) === u;
366
- for (const t of e)
367
- if (t !== undefined && $(t, u))
275
+ var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
276
+ var _ = { actions: new Set(At), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true };
277
+ function H(t, e) {
278
+ if (typeof t == "string")
279
+ return _.aliases.get(t) === e;
280
+ for (const s of t)
281
+ if (s !== undefined && H(s, e))
368
282
  return true;
369
283
  return false;
370
284
  }
371
- function BD(e, u) {
372
- if (e === u)
285
+ function _t(t, e) {
286
+ if (t === e)
373
287
  return;
374
- const t = e.split(`
375
- `), F = u.split(`
376
- `), s = [];
377
- for (let i = 0;i < Math.max(t.length, F.length); i++)
378
- t[i] !== F[i] && s.push(i);
379
- return s;
288
+ const s = t.split(`
289
+ `), i = e.split(`
290
+ `), r = Math.max(s.length, i.length), n = [];
291
+ for (let u = 0;u < r; u++)
292
+ s[u] !== i[u] && n.push(u);
293
+ return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
380
294
  }
381
- var AD = globalThis.process.platform.startsWith("win");
382
- var S = Symbol("clack:cancel");
383
- function pD(e) {
384
- return e === S;
295
+ var bt = globalThis.process.platform.startsWith("win");
296
+ var z = Symbol("clack:cancel");
297
+ function Ct(t) {
298
+ return t === z;
385
299
  }
386
- function m(e, u) {
387
- const t = e;
388
- t.isTTY && t.setRawMode(u);
300
+ function W(t, e) {
301
+ const s = t;
302
+ s.isTTY && s.setRawMode(e);
303
+ }
304
+ var rt = (t) => ("columns" in t) && typeof t.columns == "number" ? t.columns : 80;
305
+ var nt = (t) => ("rows" in t) && typeof t.rows == "number" ? t.rows : 20;
306
+ function Bt(t, e, s, i = s) {
307
+ const r = rt(t ?? R);
308
+ return K(e, r - s.length, { hard: true, trim: false }).split(`
309
+ `).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
310
+ `);
389
311
  }
390
- var gD = Object.defineProperty;
391
- var vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
392
- var h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
393
312
 
394
- class x {
395
- constructor(u, t = true) {
396
- h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
397
- const { input: F = j, output: s = M, render: i, signal: D, ...r } = u;
398
- this.opts = r, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D, this.input = F, this.output = s;
313
+ class B {
314
+ input;
315
+ output;
316
+ _abortSignal;
317
+ rl;
318
+ opts;
319
+ _render;
320
+ _track = false;
321
+ _prevFrame = "";
322
+ _subscribers = new Map;
323
+ _cursor = 0;
324
+ state = "initial";
325
+ error = "";
326
+ value;
327
+ userInput = "";
328
+ constructor(e, s = true) {
329
+ const { input: i = q, output: r = R, render: n, signal: u, ...a } = e;
330
+ 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 = s, this._abortSignal = u, this.input = i, this.output = r;
399
331
  }
400
332
  unsubscribe() {
401
333
  this._subscribers.clear();
402
334
  }
403
- setSubscriber(u, t) {
404
- const F = this._subscribers.get(u) ?? [];
405
- F.push(t), this._subscribers.set(u, F);
335
+ setSubscriber(e, s) {
336
+ const i = this._subscribers.get(e) ?? [];
337
+ i.push(s), this._subscribers.set(e, i);
406
338
  }
407
- on(u, t) {
408
- this.setSubscriber(u, { cb: t });
339
+ on(e, s) {
340
+ this.setSubscriber(e, { cb: s });
409
341
  }
410
- once(u, t) {
411
- this.setSubscriber(u, { cb: t, once: true });
342
+ once(e, s) {
343
+ this.setSubscriber(e, { cb: s, once: true });
412
344
  }
413
- emit(u, ...t) {
414
- const F = this._subscribers.get(u) ?? [], s = [];
415
- for (const i of F)
416
- i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
417
- for (const i of s)
418
- i();
345
+ emit(e, ...s) {
346
+ const i = this._subscribers.get(e) ?? [], r = [];
347
+ for (const n of i)
348
+ n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
349
+ for (const n of r)
350
+ n();
419
351
  }
420
352
  prompt() {
421
- return new Promise((u, t) => {
353
+ return new Promise((e) => {
422
354
  if (this._abortSignal) {
423
355
  if (this._abortSignal.aborted)
424
- return this.state = "cancel", this.close(), u(S);
356
+ return this.state = "cancel", this.close(), e(z);
425
357
  this._abortSignal.addEventListener("abort", () => {
426
358
  this.state = "cancel", this.close();
427
359
  }, { once: true });
428
360
  }
429
- const F = new X;
430
- F._write = (s, i, D) => {
431
- this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
432
- }, this.input.pipe(F), this.rl = O.createInterface({ input: this.input, output: F, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
433
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(this.value);
361
+ this.rl = ot.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && 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", () => {
362
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), e(this.value);
434
363
  }), this.once("cancel", () => {
435
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(S);
364
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), e(z);
436
365
  });
437
366
  });
438
367
  }
439
- onKeypress(u, t) {
440
- if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
441
- if (!this.value && this.opts.placeholder && (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder)), this.opts.validate) {
442
- const F = this.opts.validate(this.value);
443
- F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
368
+ _isActionKey(e, s) {
369
+ return e === "\t";
370
+ }
371
+ _setValue(e) {
372
+ this.value = e, this.emit("value", this.value);
373
+ }
374
+ _setUserInput(e, s) {
375
+ this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
376
+ }
377
+ _clearUserInput() {
378
+ this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
379
+ }
380
+ onKeypress(e, s) {
381
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(e, s) && 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"), s?.name && (!this._track && _.aliases.has(s.name) && this.emit("cursor", _.aliases.get(s.name)), _.actions.has(s.name) && this.emit("cursor", s.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
382
+ if (this.opts.validate) {
383
+ const i = this.opts.validate(this.value);
384
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
444
385
  }
445
386
  this.state !== "error" && (this.state = "submit");
446
387
  }
447
- $([u, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
388
+ H([e, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
448
389
  }
449
390
  close() {
450
391
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
451
- `), m(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
392
+ `), W(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
452
393
  }
453
394
  restoreCursor() {
454
- const u = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
395
+ const e = K(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
455
396
  `).length - 1;
456
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
397
+ this.output.write(import_sisteransi.cursor.move(-999, e * -1));
457
398
  }
458
399
  render() {
459
- const u = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
460
- if (u !== this._prevFrame) {
400
+ const e = K(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
401
+ if (e !== this._prevFrame) {
461
402
  if (this.state === "initial")
462
403
  this.output.write(import_sisteransi.cursor.hide);
463
404
  else {
464
- const t = BD(this._prevFrame, u);
465
- if (this.restoreCursor(), t && t?.length === 1) {
466
- const F = t[0];
467
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.lines(1));
468
- const s = u.split(`
405
+ const s = _t(this._prevFrame, e), i = nt(this.output);
406
+ if (this.restoreCursor(), s) {
407
+ const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
408
+ let u = s.lines.find((a) => a >= r);
409
+ if (u === undefined) {
410
+ this._prevFrame = e;
411
+ return;
412
+ }
413
+ if (s.lines.length === 1) {
414
+ this.output.write(import_sisteransi.cursor.move(0, u - n)), this.output.write(import_sisteransi.erase.lines(1));
415
+ const a = e.split(`
469
416
  `);
470
- this.output.write(s[F]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - F - 1));
471
- return;
472
- }
473
- if (t && t?.length > 1) {
474
- const F = t[0];
475
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.down());
476
- const s = u.split(`
477
- `).slice(F);
478
- this.output.write(s.join(`
479
- `)), this._prevFrame = u;
480
- return;
417
+ this.output.write(a[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - u - 1));
418
+ return;
419
+ } else if (s.lines.length > 1) {
420
+ if (r < n)
421
+ u = r;
422
+ else {
423
+ const l = u - n;
424
+ l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
425
+ }
426
+ this.output.write(import_sisteransi.erase.down());
427
+ const a = e.split(`
428
+ `).slice(u);
429
+ this.output.write(a.join(`
430
+ `)), this._prevFrame = e;
431
+ return;
432
+ }
481
433
  }
482
434
  this.output.write(import_sisteransi.erase.down());
483
435
  }
484
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
436
+ this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
437
+ }
438
+ }
439
+ }
440
+ function wt(t, e) {
441
+ if (t === undefined || e.length === 0)
442
+ return 0;
443
+ const s = e.findIndex((i) => i.value === t);
444
+ return s !== -1 ? s : 0;
445
+ }
446
+ function Dt(t, e) {
447
+ return (e.label ?? String(e.value)).toLowerCase().includes(t.toLowerCase());
448
+ }
449
+ function St(t, e) {
450
+ if (e)
451
+ return t ? e : e[0];
452
+ }
453
+
454
+ class Vt extends B {
455
+ filteredOptions;
456
+ multiple;
457
+ isNavigating = false;
458
+ selectedValues = [];
459
+ focusedValue;
460
+ #t = 0;
461
+ #s = "";
462
+ #i;
463
+ #e;
464
+ get cursor() {
465
+ return this.#t;
466
+ }
467
+ get userInputWithCursor() {
468
+ if (!this.userInput)
469
+ return D(["inverse", "hidden"], "_");
470
+ if (this._cursor >= this.userInput.length)
471
+ return `${this.userInput}█`;
472
+ const e = this.userInput.slice(0, this._cursor), [s, ...i] = this.userInput.slice(this._cursor);
473
+ return `${e}${D("inverse", s)}${i.join("")}`;
474
+ }
475
+ get options() {
476
+ return typeof this.#e == "function" ? this.#e() : this.#e;
477
+ }
478
+ constructor(e) {
479
+ super(e), this.#e = e.options;
480
+ const s = this.options;
481
+ this.filteredOptions = [...s], this.multiple = e.multiple === true, this.#i = e.filter ?? Dt;
482
+ let i;
483
+ if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i)
484
+ for (const r of i) {
485
+ const n = s.findIndex((u) => u.value === r);
486
+ n !== -1 && (this.toggleSelected(r), this.#t = n);
487
+ }
488
+ this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n) => this.#r(r, n)), this.on("userInput", (r) => this.#n(r));
489
+ }
490
+ _isActionKey(e, s) {
491
+ return e === "\t" || this.multiple && this.isNavigating && s.name === "space" && e !== undefined && e !== "";
492
+ }
493
+ #r(e, s) {
494
+ const i = s.name === "up", r = s.name === "down", n = s.name === "return";
495
+ i || r ? (this.#t = x(this.#t, i ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = St(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
496
+ }
497
+ deselectAll() {
498
+ this.selectedValues = [];
499
+ }
500
+ toggleSelected(e) {
501
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((s) => s !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
502
+ }
503
+ #n(e) {
504
+ if (e !== this.#s) {
505
+ this.#s = e;
506
+ const s = this.options;
507
+ e ? this.filteredOptions = s.filter((n) => this.#i(e, n)) : this.filteredOptions = [...s];
508
+ const i = wt(this.focusedValue, this.filteredOptions);
509
+ this.#t = x(i, 0, this.filteredOptions);
510
+ const r = this.filteredOptions[this.#t];
511
+ r && !r.disabled ? this.focusedValue = r.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
485
512
  }
486
513
  }
487
514
  }
488
- var A;
489
- A = new WeakMap;
490
- var kD = Object.defineProperty;
491
- var $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
492
- var H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
493
- var SD = class extends x {
494
- constructor(u) {
495
- super(u, false), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
496
- t === "a" && this.toggleAll();
497
- }), this.on("cursor", (t) => {
498
- switch (t) {
515
+ class yt extends B {
516
+ options;
517
+ cursor = 0;
518
+ #t;
519
+ getGroupItems(e) {
520
+ return this.options.filter((s) => s.group === e);
521
+ }
522
+ isGroupSelected(e) {
523
+ const s = this.getGroupItems(e), i = this.value;
524
+ return i === undefined ? false : s.every((r) => i.includes(r.value));
525
+ }
526
+ toggleValue() {
527
+ const e = this.options[this.cursor];
528
+ if (this.value === undefined && (this.value = []), e.group === true) {
529
+ const s = e.value, i = this.getGroupItems(s);
530
+ this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n) => n.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
531
+ } else {
532
+ const s = this.value.includes(e.value);
533
+ this.value = s ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
534
+ }
535
+ }
536
+ constructor(e) {
537
+ super(e, false);
538
+ const { options: s } = e;
539
+ this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((n) => ({ ...n, group: i }))]), this.value = [...e.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), this.#t ? 0 : 1), this.on("cursor", (i) => {
540
+ switch (i) {
499
541
  case "left":
500
- case "up":
542
+ case "up": {
501
543
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
544
+ const r = this.options[this.cursor]?.group === true;
545
+ !this.#t && r && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
502
546
  break;
547
+ }
503
548
  case "down":
504
- case "right":
549
+ case "right": {
505
550
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
551
+ const r = this.options[this.cursor]?.group === true;
552
+ !this.#t && r && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
506
553
  break;
554
+ }
507
555
  case "space":
508
556
  this.toggleValue();
509
557
  break;
510
558
  }
511
559
  });
512
560
  }
561
+ }
562
+ var Lt = class extends B {
563
+ options;
564
+ cursor = 0;
513
565
  get _value() {
514
566
  return this.options[this.cursor].value;
515
567
  }
568
+ get _enabledOptions() {
569
+ return this.options.filter((e) => e.disabled !== true);
570
+ }
516
571
  toggleAll() {
517
- const u = this.value.length === this.options.length;
518
- this.value = u ? [] : this.options.map((t) => t.value);
572
+ const e = this._enabledOptions, s = this.value !== undefined && this.value.length === e.length;
573
+ this.value = s ? [] : e.map((i) => i.value);
574
+ }
575
+ toggleInvert() {
576
+ const e = this.value;
577
+ if (!e)
578
+ return;
579
+ const s = this._enabledOptions.filter((i) => !e.includes(i.value));
580
+ this.value = s.map((i) => i.value);
519
581
  }
520
582
  toggleValue() {
521
- const u = this.value.includes(this._value);
522
- this.value = u ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
583
+ this.value === undefined && (this.value = []);
584
+ const e = this.value.includes(this._value);
585
+ this.value = e ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
523
586
  }
524
- };
525
- var OD = Object.defineProperty;
526
- var PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
527
- var J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
528
-
529
- class LD extends x {
530
- constructor(u) {
531
- super(u, false), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
532
- switch (t) {
587
+ constructor(e) {
588
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
589
+ const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
590
+ this.cursor = this.options[s].disabled ? x(s, 1, this.options) : s, this.on("key", (i) => {
591
+ i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
592
+ }), this.on("cursor", (i) => {
593
+ switch (i) {
533
594
  case "left":
534
595
  case "up":
535
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
596
+ this.cursor = x(this.cursor, -1, this.options);
536
597
  break;
537
598
  case "down":
538
599
  case "right":
539
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
600
+ this.cursor = x(this.cursor, 1, this.options);
601
+ break;
602
+ case "space":
603
+ this.toggleValue();
540
604
  break;
541
605
  }
542
- this.changeValue();
543
606
  });
544
607
  }
545
- get _value() {
608
+ };
609
+ class Tt extends B {
610
+ options;
611
+ cursor = 0;
612
+ get _selectedValue() {
546
613
  return this.options[this.cursor];
547
614
  }
548
615
  changeValue() {
549
- this.value = this._value.value;
616
+ this.value = this._selectedValue.value;
617
+ }
618
+ constructor(e) {
619
+ super(e, false), this.options = e.options;
620
+ const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
621
+ this.cursor = this.options[i].disabled ? x(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
622
+ switch (r) {
623
+ case "left":
624
+ case "up":
625
+ this.cursor = x(this.cursor, -1, this.options);
626
+ break;
627
+ case "down":
628
+ case "right":
629
+ this.cursor = x(this.cursor, 1, this.options);
630
+ break;
631
+ }
632
+ this.changeValue();
633
+ });
550
634
  }
551
635
  }
552
- class RD extends x {
553
- get valueWithCursor() {
636
+ class $t extends B {
637
+ get userInputWithCursor() {
554
638
  if (this.state === "submit")
555
- return this.value;
556
- if (this.cursor >= this.value.length)
557
- return `${this.value}█`;
558
- const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
559
- return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
639
+ return this.userInput;
640
+ const e = this.userInput;
641
+ if (this.cursor >= e.length)
642
+ return `${this.userInput}█`;
643
+ const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
644
+ return `${s}${D("inverse", i)}${r.join("")}`;
560
645
  }
561
646
  get cursor() {
562
647
  return this._cursor;
563
648
  }
564
- constructor(u) {
565
- super(u), this.on("finalize", () => {
566
- this.value || (this.value = u.defaultValue);
649
+ constructor(e) {
650
+ super({ ...e, initialUserInput: e.initialUserInput ?? e.initialValue }), this.on("userInput", (s) => {
651
+ this._setValue(s);
652
+ }), this.on("finalize", () => {
653
+ this.value || (this.value = e.defaultValue), this.value === undefined && (this.value = "");
567
654
  });
568
655
  }
569
656
  }
570
657
 
571
- // ../../node_modules/.bun/@clack+prompts@0.10.1/node_modules/@clack/prompts/dist/index.mjs
572
- var import_picocolors2 = __toESM(require_picocolors(), 1);
658
+ // ../../node_modules/.bun/@clack+prompts@1.1.0/node_modules/@clack/prompts/dist/index.mjs
659
+ import { styleText as t, stripVTControlCharacters as ue } from "node:util";
660
+ import N2 from "node:process";
573
661
  var import_sisteransi2 = __toESM(require_src(), 1);
574
- import y2 from "node:process";
575
- function ce() {
576
- return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
662
+ function pt2() {
663
+ return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
577
664
  }
578
- var V2 = ce();
579
- var u = (t, n) => V2 ? t : n;
580
- var le = u("◆", "*");
581
- var L2 = u("■", "x");
582
- var W2 = u("▲", "x");
583
- var C2 = u("◇", "o");
584
- var ue = u("┌", "T");
585
- var o = u("│", "|");
586
- var d2 = u("└", "—");
587
- var k2 = u("", ">");
588
- var P2 = u("", " ");
589
- var A2 = u("", "[•]");
590
- var T = u("", "[+]");
591
- var F = u("◻", "[ ]");
592
- var $e = u("", "");
593
- var _2 = u("", "-");
594
- var me = u("", "+");
595
- var de = u("", "+");
596
- var pe = u("", "+");
597
- var q = u("", "");
598
- var D = u("", "*");
599
- var U = u("", "!");
600
- var K2 = u("", "x");
601
- var b2 = (t) => {
602
- switch (t) {
665
+ var ee = pt2();
666
+ var I2 = (e, r) => ee ? e : r;
667
+ var Re = I2("◆", "*");
668
+ var $e = I2("■", "x");
669
+ var de = I2("▲", "x");
670
+ var V = I2("◇", "o");
671
+ var he = I2("┌", "T");
672
+ var h = I2("│", "|");
673
+ var x2 = I2("└", "—");
674
+ var Oe = I2("", "T");
675
+ var Pe = I2("", "");
676
+ var z2 = I2("", ">");
677
+ var H2 = I2("", " ");
678
+ var te = I2("◻", "[]");
679
+ var U2 = I2("", "[+]");
680
+ var q2 = I2("", "[ ]");
681
+ var Ne = I2("", "");
682
+ var se = I2("", "-");
683
+ var pe = I2("", "+");
684
+ var We = I2("", "+");
685
+ var me = I2("", "+");
686
+ var ge = I2("", "+");
687
+ var Ge = I2("", "+");
688
+ var fe = I2("●", "•");
689
+ var Fe = I2("◆", "*");
690
+ var ye = I2("▲", "!");
691
+ var Ee = I2("■", "x");
692
+ var W2 = (e) => {
693
+ switch (e) {
603
694
  case "initial":
604
695
  case "active":
605
- return import_picocolors2.default.cyan(le);
696
+ return t("cyan", Re);
606
697
  case "cancel":
607
- return import_picocolors2.default.red(L2);
698
+ return t("red", $e);
608
699
  case "error":
609
- return import_picocolors2.default.yellow(W2);
700
+ return t("yellow", de);
610
701
  case "submit":
611
- return import_picocolors2.default.green(C2);
702
+ return t("green", V);
612
703
  }
613
704
  };
614
- var G2 = (t) => {
615
- const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
616
- let l2 = 0;
617
- n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
618
- const $2 = a < r.length && l2 > 0, g = a < r.length && l2 + a < r.length;
619
- return r.slice(l2, l2 + a).map((p2, v2, f) => {
620
- const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g;
621
- return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
622
- });
623
- };
624
- var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
625
- const n = `${import_picocolors2.default.gray(o)}
626
- ${b2(this.state)} ${t.message}
627
- `, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
628
- switch (this.state) {
705
+ var ve = (e) => {
706
+ switch (e) {
707
+ case "initial":
708
+ case "active":
709
+ return t("cyan", h);
710
+ case "cancel":
711
+ return t("red", h);
629
712
  case "error":
630
- return `${n.trim()}
631
- ${import_picocolors2.default.yellow(o)} ${i}
632
- ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
633
- `;
713
+ return t("yellow", h);
634
714
  case "submit":
635
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
636
- case "cancel":
637
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
638
- ${import_picocolors2.default.gray(o)}` : ""}`;
639
- default:
640
- return `${n}${import_picocolors2.default.cyan(o)} ${i}
641
- ${import_picocolors2.default.cyan(d2)}
642
- `;
715
+ return t("green", h);
643
716
  }
644
- } }).prompt();
645
- var ve = (t) => {
646
- const n = (r, i) => {
647
- const s = r.label ?? String(r.value);
648
- switch (i) {
649
- case "selected":
650
- return `${import_picocolors2.default.dim(s)}`;
651
- case "active":
652
- return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
653
- case "cancelled":
654
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
655
- default:
656
- return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
717
+ };
718
+ var mt2 = (e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109;
719
+ var gt2 = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
720
+ var ft2 = (e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
721
+ var we = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
722
+ var re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
723
+ var ie = /\t{1,1000}/y;
724
+ var Ae = /[\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;
725
+ var ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
726
+ var Ft2 = /\p{M}+/gu;
727
+ var yt2 = { limit: 1 / 0, ellipsis: "" };
728
+ var Le = (e, r = {}, s = {}) => {
729
+ const i = r.limit ?? 1 / 0, a = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a ? Le(a, yt2, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, p = s.emojiWidth ?? 2, f = s.fullWidthWidth ?? 2, g = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
730
+ let $ = 0, m = 0, d = e.length, F = 0, y2 = false, v = d, C = Math.max(0, i - o), A = 0, b = 0, w = 0, S2 = 0;
731
+ e:
732
+ for (;; ) {
733
+ if (b > A || m >= d && m > $) {
734
+ const T2 = e.slice(A, b) || e.slice($, m);
735
+ F = 0;
736
+ for (const M2 of T2.replaceAll(Ft2, "")) {
737
+ const O2 = M2.codePointAt(0) || 0;
738
+ if (gt2(O2) ? S2 = f : ft2(O2) ? S2 = E : c !== g && mt2(O2) ? S2 = c : S2 = g, w + S2 > C && (v = Math.min(v, Math.max(A, $) + F)), w + S2 > i) {
739
+ y2 = true;
740
+ break e;
741
+ }
742
+ F += M2.length, w += S2;
743
+ }
744
+ A = b = 0;
745
+ }
746
+ if (m >= d)
747
+ break;
748
+ if (ne.lastIndex = m, ne.test(e)) {
749
+ if (F = ne.lastIndex - m, S2 = F * g, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / g))), w + S2 > i) {
750
+ y2 = true;
751
+ break;
752
+ }
753
+ w += S2, A = $, b = m, m = $ = ne.lastIndex;
754
+ continue;
755
+ }
756
+ if (we.lastIndex = m, we.test(e)) {
757
+ if (w + u > C && (v = Math.min(v, m)), w + u > i) {
758
+ y2 = true;
759
+ break;
760
+ }
761
+ w += u, A = $, b = m, m = $ = we.lastIndex;
762
+ continue;
763
+ }
764
+ if (re.lastIndex = m, re.test(e)) {
765
+ if (F = re.lastIndex - m, S2 = F * l, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / l))), w + S2 > i) {
766
+ y2 = true;
767
+ break;
768
+ }
769
+ w += S2, A = $, b = m, m = $ = re.lastIndex;
770
+ continue;
771
+ }
772
+ if (ie.lastIndex = m, ie.test(e)) {
773
+ if (F = ie.lastIndex - m, S2 = F * n, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / n))), w + S2 > i) {
774
+ y2 = true;
775
+ break;
776
+ }
777
+ w += S2, A = $, b = m, m = $ = ie.lastIndex;
778
+ continue;
779
+ }
780
+ if (Ae.lastIndex = m, Ae.test(e)) {
781
+ if (w + p > C && (v = Math.min(v, m)), w + p > i) {
782
+ y2 = true;
783
+ break;
784
+ }
785
+ w += p, A = $, b = m, m = $ = Ae.lastIndex;
786
+ continue;
787
+ }
788
+ m += 1;
657
789
  }
658
- };
659
- return new LD({ options: t.options, initialValue: t.initialValue, render() {
660
- const r = `${import_picocolors2.default.gray(o)}
661
- ${b2(this.state)} ${t.message}
662
- `;
663
- switch (this.state) {
664
- case "submit":
665
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
666
- case "cancel":
667
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
668
- ${import_picocolors2.default.gray(o)}`;
669
- default:
670
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
671
- ${import_picocolors2.default.cyan(o)} `)}
672
- ${import_picocolors2.default.cyan(d2)}
673
- `;
790
+ return { width: y2 ? C : w, index: y2 ? v : d, truncated: y2, ellipsed: y2 && i >= o };
791
+ };
792
+ var Et2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
793
+ var D2 = (e, r = {}) => Le(e, Et2, r).width;
794
+ var ae = "\x1B";
795
+ var je = "›";
796
+ var vt2 = 39;
797
+ var Ce = "\x07";
798
+ var ke = "[";
799
+ var wt2 = "]";
800
+ var Ve = "m";
801
+ var Se = `${wt2}8;;`;
802
+ var He = new RegExp(`(?:\\${ke}(?<code>\\d+)m|\\${Se}(?<uri>.*)${Ce})`, "y");
803
+ var At2 = (e) => {
804
+ if (e >= 30 && e <= 37 || e >= 90 && e <= 97)
805
+ return 39;
806
+ if (e >= 40 && e <= 47 || e >= 100 && e <= 107)
807
+ return 49;
808
+ if (e === 1 || e === 2)
809
+ return 22;
810
+ if (e === 3)
811
+ return 23;
812
+ if (e === 4)
813
+ return 24;
814
+ if (e === 7)
815
+ return 27;
816
+ if (e === 8)
817
+ return 28;
818
+ if (e === 9)
819
+ return 29;
820
+ if (e === 0)
821
+ return 0;
822
+ };
823
+ var Ue = (e) => `${ae}${ke}${e}${Ve}`;
824
+ var Ke = (e) => `${ae}${Se}${e}${Ce}`;
825
+ var Ct2 = (e) => e.map((r) => D2(r));
826
+ var Ie = (e, r, s) => {
827
+ const i = r[Symbol.iterator]();
828
+ let a = false, o = false, u = e.at(-1), l = u === undefined ? 0 : D2(u), n = i.next(), c = i.next(), p = 0;
829
+ for (;!n.done; ) {
830
+ const f = n.value, g = D2(f);
831
+ l + g <= s ? e[e.length - 1] += f : (e.push(f), l = 0), (f === ae || f === je) && (a = true, o = r.startsWith(Se, p + 1)), a ? o ? f === Ce && (a = false, o = false) : f === Ve && (a = false) : (l += g, l === s && !c.done && (e.push(""), l = 0)), n = c, c = i.next(), p += f.length;
832
+ }
833
+ u = e.at(-1), !l && u !== undefined && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
834
+ };
835
+ var St2 = (e) => {
836
+ const r = e.split(" ");
837
+ let s = r.length;
838
+ for (;s > 0 && !(D2(r[s - 1]) > 0); )
839
+ s--;
840
+ return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
841
+ };
842
+ var It2 = (e, r, s = {}) => {
843
+ if (s.trim !== false && e.trim() === "")
844
+ return "";
845
+ let i = "", a, o;
846
+ const u = e.split(" "), l = Ct2(u);
847
+ let n = [""];
848
+ for (const [$, m] of u.entries()) {
849
+ s.trim !== false && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
850
+ let d = D2(n.at(-1) ?? "");
851
+ if ($ !== 0 && (d >= r && (s.wordWrap === false || s.trim === false) && (n.push(""), d = 0), (d > 0 || s.trim === false) && (n[n.length - 1] += " ", d++)), s.hard && l[$] > r) {
852
+ const F = r - d, y2 = 1 + Math.floor((l[$] - F - 1) / r);
853
+ Math.floor((l[$] - 1) / r) < y2 && n.push(""), Ie(n, m, r);
854
+ continue;
674
855
  }
675
- } }).prompt();
856
+ if (d + l[$] > r && d > 0 && l[$] > 0) {
857
+ if (s.wordWrap === false && d < r) {
858
+ Ie(n, m, r);
859
+ continue;
860
+ }
861
+ n.push("");
862
+ }
863
+ if (d + l[$] > r && s.wordWrap === false) {
864
+ Ie(n, m, r);
865
+ continue;
866
+ }
867
+ n[n.length - 1] += m;
868
+ }
869
+ s.trim !== false && (n = n.map(($) => St2($)));
870
+ const c = n.join(`
871
+ `), p = c[Symbol.iterator]();
872
+ let f = p.next(), g = p.next(), E = 0;
873
+ for (;!f.done; ) {
874
+ const $ = f.value, m = g.value;
875
+ if (i += $, $ === ae || $ === je) {
876
+ He.lastIndex = E + 1;
877
+ const y2 = He.exec(c)?.groups;
878
+ if (y2?.code !== undefined) {
879
+ const v = Number.parseFloat(y2.code);
880
+ a = v === vt2 ? undefined : v;
881
+ } else
882
+ y2?.uri !== undefined && (o = y2.uri.length === 0 ? undefined : y2.uri);
883
+ }
884
+ const d = a ? At2(a) : undefined;
885
+ m === `
886
+ ` ? (o && (i += Ke("")), a && d && (i += Ue(d))) : $ === `
887
+ ` && (a && d && (i += Ue(a)), o && (i += Ke(o))), E += $.length, f = g, g = p.next();
888
+ }
889
+ return i;
676
890
  };
677
- var fe = (t) => {
678
- const n = (r, i) => {
679
- const s = r.label ?? String(r.value);
680
- return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T)} ${import_picocolors2.default.dim(s)} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
681
- };
682
- return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
683
- if (this.required && r.length === 0)
891
+ function J(e, r, s) {
892
+ return String(e).normalize().replaceAll(`\r
893
+ `, `
894
+ `).split(`
895
+ `).map((i) => It2(i, r, s)).join(`
896
+ `);
897
+ }
898
+ var bt2 = (e, r, s, i, a) => {
899
+ let o = r, u = 0;
900
+ for (let l = s;l < i; l++) {
901
+ const n = e[l];
902
+ if (o = o - n.length, u++, o <= a)
903
+ break;
904
+ }
905
+ return { lineCount: o, removals: u };
906
+ };
907
+ var X2 = ({ cursor: e, options: r, style: s, output: i = process.stdout, maxItems: a = Number.POSITIVE_INFINITY, columnPadding: o = 0, rowPadding: u = 4 }) => {
908
+ const l = rt(i) - o, n = nt(i), c = t("dim", "..."), p = Math.max(n - u, 0), f = Math.max(Math.min(a, p), 5);
909
+ let g = 0;
910
+ e >= f - 3 && (g = Math.max(Math.min(e - f + 3, r.length - f), 0));
911
+ let E = f < r.length && g > 0, $ = f < r.length && g + f < r.length;
912
+ const m = Math.min(g + f, r.length), d = [];
913
+ let F = 0;
914
+ E && F++, $ && F++;
915
+ const y2 = g + (E ? 1 : 0), v = m - ($ ? 1 : 0);
916
+ for (let A = y2;A < v; A++) {
917
+ const b = J(s(r[A], A === e), l, { hard: true, trim: false }).split(`
918
+ `);
919
+ d.push(b), F += b.length;
920
+ }
921
+ if (F > p) {
922
+ let A = 0, b = 0, w = F;
923
+ const S2 = e - y2, T2 = (M2, O2) => bt2(d, w, M2, O2, p);
924
+ E ? ({ lineCount: w, removals: A } = T2(0, S2), w > p && ({ lineCount: w, removals: b } = T2(S2 + 1, d.length))) : ({ lineCount: w, removals: b } = T2(S2 + 1, d.length), w > p && ({ lineCount: w, removals: A } = T2(0, S2))), A > 0 && (E = true, d.splice(0, A)), b > 0 && ($ = true, d.splice(d.length - b, b));
925
+ }
926
+ const C = [];
927
+ E && C.push(c);
928
+ for (const A of d)
929
+ for (const b of A)
930
+ C.push(b);
931
+ return $ && C.push(c), C;
932
+ };
933
+ var Nt = (e = "", r) => {
934
+ const s = r?.output ?? process.stdout, i = r?.withGuide ?? _.withGuide ? `${t("gray", x2)} ` : "";
935
+ s.write(`${i}${t("red", e)}
936
+
937
+ `);
938
+ };
939
+ var Wt2 = (e = "", r) => {
940
+ const s = r?.output ?? process.stdout, i = r?.withGuide ?? _.withGuide ? `${t("gray", he)} ` : "";
941
+ s.write(`${i}${e}
942
+ `);
943
+ };
944
+ var Q2 = (e, r) => e.split(`
945
+ `).map((s) => r(s)).join(`
946
+ `);
947
+ var Lt2 = (e) => {
948
+ const r = (i, a) => {
949
+ const o = i.label ?? String(i.value);
950
+ return a === "disabled" ? `${t("gray", q2)} ${Q2(o, (u) => t(["strikethrough", "gray"], u))}${i.hint ? ` ${t("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${t("cyan", te)} ${o}${i.hint ? ` ${t("dim", `(${i.hint})`)}` : ""}` : a === "selected" ? `${t("green", U2)} ${Q2(o, (u) => t("dim", u))}${i.hint ? ` ${t("dim", `(${i.hint})`)}` : ""}` : a === "cancelled" ? `${Q2(o, (u) => t(["strikethrough", "dim"], u))}` : a === "active-selected" ? `${t("green", U2)} ${o}${i.hint ? ` ${t("dim", `(${i.hint})`)}` : ""}` : a === "submitted" ? `${Q2(o, (u) => t("dim", u))}` : `${t("dim", q2)} ${Q2(o, (u) => t("dim", u))}`;
951
+ }, s = e.required ?? true;
952
+ return new Lt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(i) {
953
+ if (s && (i === undefined || i.length === 0))
684
954
  return `Please select at least one option.
685
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
955
+ ${t("reset", t("dim", `Press ${t(["gray", "bgWhite", "inverse"], " space ")} to select, ${t("gray", t("bgWhite", t("inverse", " enter ")))} to submit`))}`;
686
956
  }, render() {
687
- const r = `${import_picocolors2.default.gray(o)}
688
- ${b2(this.state)} ${t.message}
689
- `, i = (s, c) => {
690
- const a = this.value.includes(s.value);
691
- return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
957
+ const i = Bt(e.output, e.message, `${ve(this.state)} `, `${W2(this.state)} `), a = `${t("gray", h)}
958
+ ${i}
959
+ `, o = this.value ?? [], u = (l, n) => {
960
+ if (l.disabled)
961
+ return r(l, "disabled");
962
+ const c = o.includes(l.value);
963
+ return n && c ? r(l, "active-selected") : c ? r(l, "selected") : r(l, n ? "active" : "inactive");
692
964
  };
693
965
  switch (this.state) {
694
- case "submit":
695
- return `${r}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
966
+ case "submit": {
967
+ const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "submitted")).join(t("dim", ", ")) || t("dim", "none"), n = Bt(e.output, l, `${t("gray", h)} `);
968
+ return `${a}${n}`;
969
+ }
696
970
  case "cancel": {
697
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
698
- return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
699
- ${import_picocolors2.default.gray(o)}` : ""}`;
971
+ const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "cancelled")).join(t("dim", ", "));
972
+ if (l.trim() === "")
973
+ return `${a}${t("gray", h)}`;
974
+ const n = Bt(e.output, l, `${t("gray", h)} `);
975
+ return `${a}${n}
976
+ ${t("gray", h)}`;
700
977
  }
701
978
  case "error": {
702
- const s = this.error.split(`
703
- `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
704
- `);
705
- return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
706
- ${import_picocolors2.default.yellow(o)} `)}
707
- ${s}
979
+ const l = `${t("yellow", h)} `, n = this.error.split(`
980
+ `).map((f, g) => g === 0 ? `${t("yellow", x2)} ${t("yellow", f)}` : ` ${f}`).join(`
981
+ `), c = a.split(`
982
+ `).length, p = n.split(`
983
+ `).length + 1;
984
+ return `${a}${l}${X2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: c + p, style: u }).join(`
985
+ ${l}`)}
986
+ ${n}
708
987
  `;
709
988
  }
710
- default:
711
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
712
- ${import_picocolors2.default.cyan(o)} `)}
713
- ${import_picocolors2.default.cyan(d2)}
989
+ default: {
990
+ const l = `${t("cyan", h)} `, n = a.split(`
991
+ `).length;
992
+ return `${a}${l}${X2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: n + 2, style: u }).join(`
993
+ ${l}`)}
994
+ ${t("cyan", x2)}
714
995
  `;
996
+ }
715
997
  }
716
998
  } }).prompt();
717
999
  };
718
- var xe = (t = "") => {
719
- process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
720
-
721
- `);
722
- };
723
- var Ie = (t = "") => {
724
- process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
725
- `);
1000
+ var ze = { light: I2("─", "-"), heavy: I2("━", "="), block: I2("", "#") };
1001
+ var oe = (e, r) => e.includes(`
1002
+ `) ? e.split(`
1003
+ `).map((s) => r(s)).join(`
1004
+ `) : r(e);
1005
+ var Jt = (e) => {
1006
+ const r = (s, i) => {
1007
+ const a = s.label ?? String(s.value);
1008
+ switch (i) {
1009
+ case "disabled":
1010
+ return `${t("gray", H2)} ${oe(a, (o) => t("gray", o))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1011
+ case "selected":
1012
+ return `${oe(a, (o) => t("dim", o))}`;
1013
+ case "active":
1014
+ return `${t("green", z2)} ${a}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1015
+ case "cancelled":
1016
+ return `${oe(a, (o) => t(["strikethrough", "dim"], o))}`;
1017
+ default:
1018
+ return `${t("dim", H2)} ${oe(a, (o) => t("dim", o))}`;
1019
+ }
1020
+ };
1021
+ return new Tt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
1022
+ const s = e.withGuide ?? _.withGuide, i = `${W2(this.state)} `, a = `${ve(this.state)} `, o = Bt(e.output, e.message, a, i), u = `${s ? `${t("gray", h)}
1023
+ ` : ""}${o}
1024
+ `;
1025
+ switch (this.state) {
1026
+ case "submit": {
1027
+ const l = s ? `${t("gray", h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "selected"), l);
1028
+ return `${u}${n}`;
1029
+ }
1030
+ case "cancel": {
1031
+ const l = s ? `${t("gray", h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "cancelled"), l);
1032
+ return `${u}${n}${s ? `
1033
+ ${t("gray", h)}` : ""}`;
1034
+ }
1035
+ default: {
1036
+ const l = s ? `${t("cyan", h)} ` : "", n = s ? t("cyan", x2) : "", c = u.split(`
1037
+ `).length, p = s ? 2 : 1;
1038
+ return `${u}${l}${X2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: l.length, rowPadding: c + p, style: (f, g) => r(f, f.disabled ? "disabled" : g ? "active" : "inactive") }).join(`
1039
+ ${l}`)}
1040
+ ${n}
1041
+ `;
1042
+ }
1043
+ }
1044
+ } }).prompt();
726
1045
  };
727
- var J2 = `${import_picocolors2.default.gray(o)} `;
1046
+ var Qe = `${t("gray", h)} `;
1047
+ var Zt = (e) => new $t({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
1048
+ const r = e?.withGuide ?? _.withGuide, s = `${`${r ? `${t("gray", h)}
1049
+ ` : ""}${W2(this.state)} `}${e.message}
1050
+ `, i = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), a = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
1051
+ switch (this.state) {
1052
+ case "error": {
1053
+ const u = this.error ? ` ${t("yellow", this.error)}` : "", l = r ? `${t("yellow", h)} ` : "", n = r ? t("yellow", x2) : "";
1054
+ return `${s.trim()}
1055
+ ${l}${a}
1056
+ ${n}${u}
1057
+ `;
1058
+ }
1059
+ case "submit": {
1060
+ const u = o ? ` ${t("dim", o)}` : "", l = r ? t("gray", h) : "";
1061
+ return `${s}${l}${u}`;
1062
+ }
1063
+ case "cancel": {
1064
+ const u = o ? ` ${t(["strikethrough", "dim"], o)}` : "", l = r ? t("gray", h) : "";
1065
+ return `${s}${l}${u}${o.trim() ? `
1066
+ ${l}` : ""}`;
1067
+ }
1068
+ default: {
1069
+ const u = r ? `${t("cyan", h)} ` : "", l = r ? t("cyan", x2) : "";
1070
+ return `${s}${u}${a}
1071
+ ${l}
1072
+ `;
1073
+ }
1074
+ }
1075
+ } }).prompt();
728
1076
 
729
1077
  // src/prompts.ts
730
1078
  async function collectProjectConfig(initialName) {
731
- Ie("create-avalon");
1079
+ Wt2("create-avalon");
732
1080
  let projectName = initialName;
733
1081
  if (!projectName) {
734
- const nameResult = await he({
1082
+ const nameResult = await Zt({
735
1083
  message: "What is your project name?",
736
1084
  placeholder: "my-avalon-app",
737
1085
  validate(value) {
@@ -739,13 +1087,13 @@ async function collectProjectConfig(initialName) {
739
1087
  return "Project name is required.";
740
1088
  }
741
1089
  });
742
- if (pD(nameResult)) {
743
- xe("Operation cancelled.");
1090
+ if (Ct(nameResult)) {
1091
+ Nt("Operation cancelled.");
744
1092
  process.exit(1);
745
1093
  }
746
1094
  projectName = nameResult;
747
1095
  }
748
- const integrationsResult = await fe({
1096
+ const integrationsResult = await Lt2({
749
1097
  message: "Which additional integrations would you like to include? (use space to toggle, enter to confirm)",
750
1098
  options: [
751
1099
  { value: "react", label: "react", hint: "React 19" },
@@ -757,11 +1105,11 @@ async function collectProjectConfig(initialName) {
757
1105
  ],
758
1106
  required: false
759
1107
  });
760
- if (pD(integrationsResult)) {
761
- xe("Operation cancelled.");
1108
+ if (Ct(integrationsResult)) {
1109
+ Nt("Operation cancelled.");
762
1110
  process.exit(1);
763
1111
  }
764
- const stylingResult = await ve({
1112
+ const stylingResult = await Jt({
765
1113
  message: "Which styling approach would you like to use?",
766
1114
  options: [
767
1115
  { value: "css-modules", label: "CSS Modules" },
@@ -769,22 +1117,22 @@ async function collectProjectConfig(initialName) {
769
1117
  { value: "shadcn", label: "shadcn" }
770
1118
  ]
771
1119
  });
772
- if (pD(stylingResult)) {
773
- xe("Operation cancelled.");
1120
+ if (Ct(stylingResult)) {
1121
+ Nt("Operation cancelled.");
774
1122
  process.exit(1);
775
1123
  }
776
- const pluginsResult = await fe({
1124
+ const pluginsResult = await Lt2({
777
1125
  message: "Which plugins would you like to include? (use space to toggle, enter to confirm)",
778
1126
  options: [
779
1127
  { value: "agent-optimization", label: "agent-optimization", hint: "LLM/AI optimization" }
780
1128
  ],
781
1129
  required: false
782
1130
  });
783
- if (pD(pluginsResult)) {
784
- xe("Operation cancelled.");
1131
+ if (Ct(pluginsResult)) {
1132
+ Nt("Operation cancelled.");
785
1133
  process.exit(1);
786
1134
  }
787
- const middlewareResult = await ve({
1135
+ const middlewareResult = await Jt({
788
1136
  message: "Which middleware framework would you like to use?",
789
1137
  options: [
790
1138
  { value: "h3", label: "h3" },
@@ -792,8 +1140,8 @@ async function collectProjectConfig(initialName) {
792
1140
  { value: "elysia", label: "elysia" }
793
1141
  ]
794
1142
  });
795
- if (pD(middlewareResult)) {
796
- xe("Operation cancelled.");
1143
+ if (Ct(middlewareResult)) {
1144
+ Nt("Operation cancelled.");
797
1145
  process.exit(1);
798
1146
  }
799
1147
  return {
@@ -913,13 +1261,9 @@ function generateTsConfig() {
913
1261
  // src/templates/vite-config.ts
914
1262
  function generateViteConfig(config) {
915
1263
  const imports = [
916
- `import { defineConfig } from 'vite';`,
917
- `import { avalon } from '@useavalon/avalon';`,
918
- `import { preact } from '@useavalon/preact';`
1264
+ `import { defineConfig, type UserConfig } from 'vite';`,
1265
+ `import { avalon } from '@useavalon/avalon';`
919
1266
  ];
920
- for (const integration of config.integrations) {
921
- imports.push(`import { ${integration} } from '@useavalon/${integration}';`);
922
- }
923
1267
  const needsTailwind = config.styling === "tailwind" || config.styling === "shadcn";
924
1268
  if (needsTailwind) {
925
1269
  imports.push(`import tailwindcss from '@tailwindcss/vite';`);
@@ -929,37 +1273,42 @@ function generateViteConfig(config) {
929
1273
  imports.push(`import { agentOptimization } from '@useavalon/agent-optimization';`);
930
1274
  }
931
1275
  const allIntegrations = ["preact", ...config.integrations];
932
- const integrationsList = allIntegrations.map((i) => `${i}()`).join(", ");
1276
+ const integrationsList = allIntegrations.map((i) => `'${i}'`).join(", ");
933
1277
  const pluginEntries = [];
934
- const avalonLines = [
935
- ` avalon({`,
936
- ` integrations: [${integrationsList}],`,
937
- ` modules: 'app/modules',`,
938
- ` layoutsDir: 'app/shared/layouts',`,
939
- ` }),`
940
- ];
941
- pluginEntries.push(avalonLines.join(`
942
- `));
1278
+ if (hasAgentOptimization) {
1279
+ pluginEntries.push(` agentOptimization({
1280
+ sitemap: { siteUrl: 'http://localhost:3000' },
1281
+ markdown: true,
1282
+ structuredData: true,
1283
+ llms: {
1284
+ siteUrl: 'http://localhost:3000',
1285
+ siteName: 'My Avalon App',
1286
+ siteDescription: 'Built with Avalon',
1287
+ sections: { 'Pages': ['/'] },
1288
+ },
1289
+ }),`);
1290
+ }
1291
+ pluginEntries.push(` ...avalonPlugins,`);
943
1292
  if (needsTailwind) {
944
1293
  pluginEntries.push(` tailwindcss(),`);
945
1294
  }
946
- if (hasAgentOptimization) {
947
- pluginEntries.push(` agentOptimization(),`);
948
- }
949
1295
  const lines = [
950
1296
  imports.join(`
951
1297
  `),
952
1298
  "",
953
- `export default defineConfig({`,
954
- ` plugins: [`,
1299
+ `export default defineConfig(async (): Promise<UserConfig> => {`,
1300
+ ` const avalonPlugins = await avalon({`,
1301
+ ` integrations: [${integrationsList}],`,
1302
+ ` modules: 'app/modules',`,
1303
+ ` layoutsDir: 'app/shared/layouts',`,
1304
+ ` });`,
1305
+ "",
1306
+ ` return {`,
1307
+ ` plugins: [`,
955
1308
  pluginEntries.join(`
956
1309
  `),
957
- ` ],`,
958
- ` server: {`,
959
- ` nitro: {`,
960
- ` middleware: '${config.middleware}',`,
961
- ` },`,
962
- ` },`,
1310
+ ` ],`,
1311
+ ` };`,
963
1312
  `});`,
964
1313
  ""
965
1314
  ];
@@ -1400,6 +1749,7 @@ Options:
1400
1749
  printSummary(config);
1401
1750
  process.exit(0);
1402
1751
  }
1752
+ main();
1403
1753
  export {
1404
1754
  validateDirectory,
1405
1755
  parseCliArgs,