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.
- package/dist/cli.js +894 -544
- 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@
|
|
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
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
161
|
+
}
|
|
162
|
+
c += g, C = h, w = o, o = h = P.lastIndex;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
o += 1;
|
|
200
166
|
}
|
|
201
|
-
|
|
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
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
!
|
|
210
|
+
u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
301
211
|
};
|
|
302
|
-
var
|
|
303
|
-
const
|
|
304
|
-
let
|
|
305
|
-
for (;
|
|
306
|
-
|
|
307
|
-
return
|
|
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
|
|
310
|
-
if (
|
|
219
|
+
var Et = (t, e, s = {}) => {
|
|
220
|
+
if (s.trim !== false && t.trim() === "")
|
|
311
221
|
return "";
|
|
312
|
-
let
|
|
313
|
-
const
|
|
314
|
-
let
|
|
315
|
-
for (const [
|
|
316
|
-
|
|
317
|
-
let
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
Math.floor((
|
|
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 (
|
|
324
|
-
if (
|
|
325
|
-
|
|
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
|
-
|
|
238
|
+
l.push("");
|
|
329
239
|
}
|
|
330
|
-
if (
|
|
331
|
-
|
|
240
|
+
if (p + a[h] > e && s.wordWrap === false) {
|
|
241
|
+
G(l, o, e);
|
|
332
242
|
continue;
|
|
333
243
|
}
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
`)];
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
-
|
|
259
|
+
F?.uri !== undefined && (n = F.uri.length === 0 ? undefined : F.uri);
|
|
347
260
|
}
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
` ? (
|
|
351
|
-
` && (
|
|
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
|
|
266
|
+
return i;
|
|
354
267
|
};
|
|
355
|
-
function
|
|
356
|
-
return String(
|
|
268
|
+
function K(t, e, s) {
|
|
269
|
+
return String(t).normalize().replaceAll(`\r
|
|
270
|
+
`, `
|
|
357
271
|
`).split(`
|
|
358
|
-
`).map((
|
|
272
|
+
`).map((i) => Et(i, e, s)).join(`
|
|
359
273
|
`);
|
|
360
274
|
}
|
|
361
|
-
var
|
|
362
|
-
var
|
|
363
|
-
function
|
|
364
|
-
if (typeof
|
|
365
|
-
return
|
|
366
|
-
for (const
|
|
367
|
-
if (
|
|
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
|
|
372
|
-
if (
|
|
285
|
+
function _t(t, e) {
|
|
286
|
+
if (t === e)
|
|
373
287
|
return;
|
|
374
|
-
const
|
|
375
|
-
`),
|
|
376
|
-
`), s = [];
|
|
377
|
-
for (let
|
|
378
|
-
|
|
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
|
|
382
|
-
var
|
|
383
|
-
function
|
|
384
|
-
return
|
|
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
|
|
387
|
-
const
|
|
388
|
-
|
|
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
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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(
|
|
404
|
-
const
|
|
405
|
-
|
|
335
|
+
setSubscriber(e, s) {
|
|
336
|
+
const i = this._subscribers.get(e) ?? [];
|
|
337
|
+
i.push(s), this._subscribers.set(e, i);
|
|
406
338
|
}
|
|
407
|
-
on(
|
|
408
|
-
this.setSubscriber(
|
|
339
|
+
on(e, s) {
|
|
340
|
+
this.setSubscriber(e, { cb: s });
|
|
409
341
|
}
|
|
410
|
-
once(
|
|
411
|
-
this.setSubscriber(
|
|
342
|
+
once(e, s) {
|
|
343
|
+
this.setSubscriber(e, { cb: s, once: true });
|
|
412
344
|
}
|
|
413
|
-
emit(
|
|
414
|
-
const
|
|
415
|
-
for (const
|
|
416
|
-
|
|
417
|
-
for (const
|
|
418
|
-
|
|
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((
|
|
353
|
+
return new Promise((e) => {
|
|
422
354
|
if (this._abortSignal) {
|
|
423
355
|
if (this._abortSignal.aborted)
|
|
424
|
-
return this.state = "cancel", this.close(),
|
|
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
|
-
|
|
430
|
-
|
|
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),
|
|
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
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
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
|
-
|
|
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
|
-
`),
|
|
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
|
|
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,
|
|
397
|
+
this.output.write(import_sisteransi.cursor.move(-999, e * -1));
|
|
457
398
|
}
|
|
458
399
|
render() {
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
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
|
|
465
|
-
if (this.restoreCursor(),
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
|
|
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
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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(
|
|
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
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
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
|
|
518
|
-
this.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
|
-
|
|
522
|
-
|
|
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
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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.
|
|
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
|
|
553
|
-
get
|
|
636
|
+
class $t extends B {
|
|
637
|
+
get userInputWithCursor() {
|
|
554
638
|
if (this.state === "submit")
|
|
555
|
-
return this.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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(
|
|
565
|
-
super(
|
|
566
|
-
this.
|
|
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@
|
|
572
|
-
|
|
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
|
-
|
|
575
|
-
|
|
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
|
|
579
|
-
var
|
|
580
|
-
var
|
|
581
|
-
var
|
|
582
|
-
var
|
|
583
|
-
var
|
|
584
|
-
var
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
var
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var
|
|
594
|
-
var
|
|
595
|
-
var
|
|
596
|
-
var pe =
|
|
597
|
-
var
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var
|
|
602
|
-
|
|
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
|
|
696
|
+
return t("cyan", Re);
|
|
606
697
|
case "cancel":
|
|
607
|
-
return
|
|
698
|
+
return t("red", $e);
|
|
608
699
|
case "error":
|
|
609
|
-
return
|
|
700
|
+
return t("yellow", de);
|
|
610
701
|
case "submit":
|
|
611
|
-
return
|
|
702
|
+
return t("green", V);
|
|
612
703
|
}
|
|
613
704
|
};
|
|
614
|
-
var
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
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
|
|
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
|
|
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
|
-
}
|
|
645
|
-
var
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
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
|
-
|
|
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
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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
|
-
${
|
|
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
|
|
688
|
-
${
|
|
689
|
-
`,
|
|
690
|
-
|
|
691
|
-
|
|
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
|
-
|
|
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
|
|
698
|
-
|
|
699
|
-
${
|
|
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
|
|
703
|
-
`).map((
|
|
704
|
-
`)
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
${
|
|
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
|
-
|
|
712
|
-
|
|
713
|
-
${
|
|
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
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
`)
|
|
722
|
-
|
|
723
|
-
var
|
|
724
|
-
|
|
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
|
|
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
|
-
|
|
1079
|
+
Wt2("create-avalon");
|
|
732
1080
|
let projectName = initialName;
|
|
733
1081
|
if (!projectName) {
|
|
734
|
-
const nameResult = await
|
|
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 (
|
|
743
|
-
|
|
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
|
|
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 (
|
|
761
|
-
|
|
1108
|
+
if (Ct(integrationsResult)) {
|
|
1109
|
+
Nt("Operation cancelled.");
|
|
762
1110
|
process.exit(1);
|
|
763
1111
|
}
|
|
764
|
-
const stylingResult = await
|
|
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 (
|
|
773
|
-
|
|
1120
|
+
if (Ct(stylingResult)) {
|
|
1121
|
+
Nt("Operation cancelled.");
|
|
774
1122
|
process.exit(1);
|
|
775
1123
|
}
|
|
776
|
-
const pluginsResult = await
|
|
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 (
|
|
784
|
-
|
|
1131
|
+
if (Ct(pluginsResult)) {
|
|
1132
|
+
Nt("Operation cancelled.");
|
|
785
1133
|
process.exit(1);
|
|
786
1134
|
}
|
|
787
|
-
const middlewareResult = await
|
|
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 (
|
|
796
|
-
|
|
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) =>
|
|
1276
|
+
const integrationsList = allIntegrations.map((i) => `'${i}'`).join(", ");
|
|
933
1277
|
const pluginEntries = [];
|
|
934
|
-
|
|
935
|
-
`
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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,
|