@lynx-js/qrcode-rsbuild-plugin 0.4.0 → 0.4.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/CHANGELOG.md +12 -0
- package/dist/472.js +940 -0
- package/dist/543.js +45 -0
- package/dist/640.js +24 -933
- package/dist/759.js +2005 -0
- package/dist/generateDevUrls.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -34
- package/dist/shortcuts.d.ts +3 -0
- package/dist/shortcuts.js +12 -34
- package/package.json +5 -5
- package/dist/204.js +0 -20
- package/dist/441.js +0 -1910
package/dist/441.js
DELETED
|
@@ -1,1910 +0,0 @@
|
|
|
1
|
-
export const __webpack_ids__ = [
|
|
2
|
-
"441"
|
|
3
|
-
];
|
|
4
|
-
export const __webpack_modules__ = {
|
|
5
|
-
"../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
6
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
7
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
8
|
-
let formatter = (open, close, replace = open)=>(input)=>{
|
|
9
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
10
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
11
|
-
};
|
|
12
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
13
|
-
let result = "", cursor = 0;
|
|
14
|
-
do {
|
|
15
|
-
result += string.substring(cursor, index) + replace;
|
|
16
|
-
cursor = index + close.length;
|
|
17
|
-
index = string.indexOf(close, cursor);
|
|
18
|
-
}while (~index);
|
|
19
|
-
return result + string.substring(cursor);
|
|
20
|
-
};
|
|
21
|
-
let createColors = (enabled = isColorSupported)=>{
|
|
22
|
-
let f = enabled ? formatter : ()=>String;
|
|
23
|
-
return {
|
|
24
|
-
isColorSupported: enabled,
|
|
25
|
-
reset: f("\x1b[0m", "\x1b[0m"),
|
|
26
|
-
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
27
|
-
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
28
|
-
italic: f("\x1b[3m", "\x1b[23m"),
|
|
29
|
-
underline: f("\x1b[4m", "\x1b[24m"),
|
|
30
|
-
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
31
|
-
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
32
|
-
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
33
|
-
black: f("\x1b[30m", "\x1b[39m"),
|
|
34
|
-
red: f("\x1b[31m", "\x1b[39m"),
|
|
35
|
-
green: f("\x1b[32m", "\x1b[39m"),
|
|
36
|
-
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
37
|
-
blue: f("\x1b[34m", "\x1b[39m"),
|
|
38
|
-
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
39
|
-
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
40
|
-
white: f("\x1b[37m", "\x1b[39m"),
|
|
41
|
-
gray: f("\x1b[90m", "\x1b[39m"),
|
|
42
|
-
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
43
|
-
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
44
|
-
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
45
|
-
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
46
|
-
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
47
|
-
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
48
|
-
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
49
|
-
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
50
|
-
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
51
|
-
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
52
|
-
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
53
|
-
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
54
|
-
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
55
|
-
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
56
|
-
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
57
|
-
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
58
|
-
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
59
|
-
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
60
|
-
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
61
|
-
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
62
|
-
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
63
|
-
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
64
|
-
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
65
|
-
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
module.exports = createColors();
|
|
69
|
-
module.exports.createColors = createColors;
|
|
70
|
-
},
|
|
71
|
-
"../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js": function(module) {
|
|
72
|
-
const ESC = '\x1B';
|
|
73
|
-
const CSI = `${ESC}[`;
|
|
74
|
-
const beep = '\u0007';
|
|
75
|
-
const cursor = {
|
|
76
|
-
to (x, y) {
|
|
77
|
-
if (!y) return `${CSI}${x + 1}G`;
|
|
78
|
-
return `${CSI}${y + 1};${x + 1}H`;
|
|
79
|
-
},
|
|
80
|
-
move (x, y) {
|
|
81
|
-
let ret = '';
|
|
82
|
-
if (x < 0) ret += `${CSI}${-x}D`;
|
|
83
|
-
else if (x > 0) ret += `${CSI}${x}C`;
|
|
84
|
-
if (y < 0) ret += `${CSI}${-y}A`;
|
|
85
|
-
else if (y > 0) ret += `${CSI}${y}B`;
|
|
86
|
-
return ret;
|
|
87
|
-
},
|
|
88
|
-
up: (count = 1)=>`${CSI}${count}A`,
|
|
89
|
-
down: (count = 1)=>`${CSI}${count}B`,
|
|
90
|
-
forward: (count = 1)=>`${CSI}${count}C`,
|
|
91
|
-
backward: (count = 1)=>`${CSI}${count}D`,
|
|
92
|
-
nextLine: (count = 1)=>`${CSI}E`.repeat(count),
|
|
93
|
-
prevLine: (count = 1)=>`${CSI}F`.repeat(count),
|
|
94
|
-
left: `${CSI}G`,
|
|
95
|
-
hide: `${CSI}?25l`,
|
|
96
|
-
show: `${CSI}?25h`,
|
|
97
|
-
save: `${ESC}7`,
|
|
98
|
-
restore: `${ESC}8`
|
|
99
|
-
};
|
|
100
|
-
const scroll = {
|
|
101
|
-
up: (count = 1)=>`${CSI}S`.repeat(count),
|
|
102
|
-
down: (count = 1)=>`${CSI}T`.repeat(count)
|
|
103
|
-
};
|
|
104
|
-
const erase = {
|
|
105
|
-
screen: `${CSI}2J`,
|
|
106
|
-
up: (count = 1)=>`${CSI}1J`.repeat(count),
|
|
107
|
-
down: (count = 1)=>`${CSI}J`.repeat(count),
|
|
108
|
-
line: `${CSI}2K`,
|
|
109
|
-
lineEnd: `${CSI}K`,
|
|
110
|
-
lineStart: `${CSI}1K`,
|
|
111
|
-
lines (count) {
|
|
112
|
-
let clear = '';
|
|
113
|
-
for(let i = 0; i < count; i++)clear += this.line + (i < count - 1 ? cursor.up() : '');
|
|
114
|
-
if (count) clear += cursor.left;
|
|
115
|
-
return clear;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
module.exports = {
|
|
119
|
-
cursor,
|
|
120
|
-
scroll,
|
|
121
|
-
erase,
|
|
122
|
-
beep
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
"../../../node_modules/.pnpm/@clack+prompts@1.0.0-alpha.1/node_modules/@clack/prompts/dist/index.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
126
|
-
__webpack_require__.r(__webpack_exports__);
|
|
127
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
128
|
-
selectKey: ()=>Ye,
|
|
129
|
-
S_STEP_SUBMIT: ()=>dist_O,
|
|
130
|
-
S_INFO: ()=>dist_H,
|
|
131
|
-
S_CORNER_TOP_RIGHT: ()=>ue,
|
|
132
|
-
S_ERROR: ()=>dist_X,
|
|
133
|
-
S_STEP_ACTIVE: ()=>ne,
|
|
134
|
-
log: ()=>dist_T,
|
|
135
|
-
groupMultiselect: ()=>Be,
|
|
136
|
-
S_BAR_H: ()=>U,
|
|
137
|
-
S_CORNER_BOTTOM_RIGHT: ()=>le,
|
|
138
|
-
note: ()=>Ke,
|
|
139
|
-
S_WARN: ()=>dist_q,
|
|
140
|
-
group: ()=>We,
|
|
141
|
-
password: ()=>qe,
|
|
142
|
-
S_CHECKBOX_ACTIVE: ()=>dist_k,
|
|
143
|
-
autocomplete: ()=>me,
|
|
144
|
-
isCI: ()=>dist_D,
|
|
145
|
-
spinner: ()=>dist_J,
|
|
146
|
-
S_CONNECT_LEFT: ()=>ce,
|
|
147
|
-
S_CHECKBOX_SELECTED: ()=>dist_x,
|
|
148
|
-
S_CHECKBOX_INACTIVE: ()=>dist_B,
|
|
149
|
-
limitOptions: ()=>dist_j,
|
|
150
|
-
multiselect: ()=>Ue,
|
|
151
|
-
unicodeOr: ()=>dist_v,
|
|
152
|
-
S_STEP_ERROR: ()=>dist_F,
|
|
153
|
-
S_RADIO_ACTIVE: ()=>dist_P,
|
|
154
|
-
S_BAR_START: ()=>oe,
|
|
155
|
-
settings: ()=>dist_c,
|
|
156
|
-
taskLog: ()=>Ze,
|
|
157
|
-
intro: ()=>Ge,
|
|
158
|
-
S_STEP_CANCEL: ()=>G,
|
|
159
|
-
stream: ()=>dist_R,
|
|
160
|
-
path: ()=>Xe,
|
|
161
|
-
autocompleteMultiselect: ()=>Ne,
|
|
162
|
-
S_BAR_END: ()=>f,
|
|
163
|
-
cancel: ()=>De,
|
|
164
|
-
outro: ()=>Fe,
|
|
165
|
-
progress: ()=>Je,
|
|
166
|
-
confirm: ()=>ke,
|
|
167
|
-
select: ()=>ze,
|
|
168
|
-
tasks: ()=>Qe,
|
|
169
|
-
S_BAR: ()=>dist_o,
|
|
170
|
-
symbol: ()=>dist_E,
|
|
171
|
-
text: ()=>et,
|
|
172
|
-
unicode: ()=>dist_N,
|
|
173
|
-
isCancel: ()=>Vu,
|
|
174
|
-
S_SUCCESS: ()=>dist_K,
|
|
175
|
-
updateSettings: ()=>Su,
|
|
176
|
-
S_PASSWORD_MASK: ()=>ae,
|
|
177
|
-
S_RADIO_INACTIVE: ()=>dist_L
|
|
178
|
-
});
|
|
179
|
-
var src = __webpack_require__("../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
180
|
-
var external_node_process_ = __webpack_require__("node:process");
|
|
181
|
-
var external_node_readline_ = __webpack_require__("node:readline");
|
|
182
|
-
var external_node_tty_ = __webpack_require__("node:tty");
|
|
183
|
-
var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
184
|
-
function hu({ onlyFirst: e = !1 } = {}) {
|
|
185
|
-
const t = "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))";
|
|
186
|
-
return new RegExp(t, e ? void 0 : "g");
|
|
187
|
-
}
|
|
188
|
-
const cu = hu();
|
|
189
|
-
function dist_Y(e) {
|
|
190
|
-
if ("string" != typeof e) throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
|
|
191
|
-
return e.replace(cu, "");
|
|
192
|
-
}
|
|
193
|
-
function dist_Z(e) {
|
|
194
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
195
|
-
}
|
|
196
|
-
var q = {
|
|
197
|
-
exports: {}
|
|
198
|
-
};
|
|
199
|
-
(function(e) {
|
|
200
|
-
var D = {};
|
|
201
|
-
e.exports = D, D.eastAsianWidth = function(s) {
|
|
202
|
-
var i = s.charCodeAt(0), F = 2 == s.length ? s.charCodeAt(1) : 0, u = i;
|
|
203
|
-
return 55296 <= i && i <= 56319 && 56320 <= F && F <= 57343 && (i &= 1023, F &= 1023, u = i << 10 | F, u += 65536), 12288 == u || 65281 <= u && u <= 65376 || 65504 <= u && u <= 65510 ? "F" : 8361 == u || 65377 <= u && u <= 65470 || 65474 <= u && u <= 65479 || 65482 <= u && u <= 65487 || 65490 <= u && u <= 65495 || 65498 <= u && u <= 65500 || 65512 <= u && u <= 65518 ? "H" : 4352 <= u && u <= 4447 || 4515 <= u && u <= 4519 || 4602 <= u && u <= 4607 || 9001 <= u && u <= 9002 || 11904 <= u && u <= 11929 || 11931 <= u && u <= 12019 || 12032 <= u && u <= 12245 || 12272 <= u && u <= 12283 || 12289 <= u && u <= 12350 || 12353 <= u && u <= 12438 || 12441 <= u && u <= 12543 || 12549 <= u && u <= 12589 || 12593 <= u && u <= 12686 || 12688 <= u && u <= 12730 || 12736 <= u && u <= 12771 || 12784 <= u && u <= 12830 || 12832 <= u && u <= 12871 || 12880 <= u && u <= 13054 || 13056 <= u && u <= 19903 || 19968 <= u && u <= 42124 || 42128 <= u && u <= 42182 || 43360 <= u && u <= 43388 || 44032 <= u && u <= 55203 || 55216 <= u && u <= 55238 || 55243 <= u && u <= 55291 || 63744 <= u && u <= 64255 || 65040 <= u && u <= 65049 || 65072 <= u && u <= 65106 || 65108 <= u && u <= 65126 || 65128 <= u && u <= 65131 || 110592 <= u && u <= 110593 || 127488 <= u && u <= 127490 || 127504 <= u && u <= 127546 || 127552 <= u && u <= 127560 || 127568 <= u && u <= 127569 || 131072 <= u && u <= 194367 || 177984 <= u && u <= 196605 || 196608 <= u && u <= 262141 ? "W" : 32 <= u && u <= 126 || 162 <= u && u <= 163 || 165 <= u && u <= 166 || 172 == u || 175 == u || 10214 <= u && u <= 10221 || 10629 <= u && u <= 10630 ? "Na" : 161 == u || 164 == u || 167 <= u && u <= 168 || 170 == u || 173 <= u && u <= 174 || 176 <= u && u <= 180 || 182 <= u && u <= 186 || 188 <= u && u <= 191 || 198 == u || 208 == u || 215 <= u && u <= 216 || 222 <= u && u <= 225 || 230 == u || 232 <= u && u <= 234 || 236 <= u && u <= 237 || 240 == u || 242 <= u && u <= 243 || 247 <= u && u <= 250 || 252 == u || 254 == u || 257 == u || 273 == u || 275 == u || 283 == u || 294 <= u && u <= 295 || 299 == u || 305 <= u && u <= 307 || 312 == u || 319 <= u && u <= 322 || 324 == u || 328 <= u && u <= 331 || 333 == u || 338 <= u && u <= 339 || 358 <= u && u <= 359 || 363 == u || 462 == u || 464 == u || 466 == u || 468 == u || 470 == u || 472 == u || 474 == u || 476 == u || 593 == u || 609 == u || 708 == u || 711 == u || 713 <= u && u <= 715 || 717 == u || 720 == u || 728 <= u && u <= 731 || 733 == u || 735 == u || 768 <= u && u <= 879 || 913 <= u && u <= 929 || 931 <= u && u <= 937 || 945 <= u && u <= 961 || 963 <= u && u <= 969 || 1025 == u || 1040 <= u && u <= 1103 || 1105 == u || 8208 == u || 8211 <= u && u <= 8214 || 8216 <= u && u <= 8217 || 8220 <= u && u <= 8221 || 8224 <= u && u <= 8226 || 8228 <= u && u <= 8231 || 8240 == u || 8242 <= u && u <= 8243 || 8245 == u || 8251 == u || 8254 == u || 8308 == u || 8319 == u || 8321 <= u && u <= 8324 || 8364 == u || 8451 == u || 8453 == u || 8457 == u || 8467 == u || 8470 == u || 8481 <= u && u <= 8482 || 8486 == u || 8491 == u || 8531 <= u && u <= 8532 || 8539 <= u && u <= 8542 || 8544 <= u && u <= 8555 || 8560 <= u && u <= 8569 || 8585 == u || 8592 <= u && u <= 8601 || 8632 <= u && u <= 8633 || 8658 == u || 8660 == u || 8679 == u || 8704 == u || 8706 <= u && u <= 8707 || 8711 <= u && u <= 8712 || 8715 == u || 8719 == u || 8721 == u || 8725 == u || 8730 == u || 8733 <= u && u <= 8736 || 8739 == u || 8741 == u || 8743 <= u && u <= 8748 || 8750 == u || 8756 <= u && u <= 8759 || 8764 <= u && u <= 8765 || 8776 == u || 8780 == u || 8786 == u || 8800 <= u && u <= 8801 || 8804 <= u && u <= 8807 || 8810 <= u && u <= 8811 || 8814 <= u && u <= 8815 || 8834 <= u && u <= 8835 || 8838 <= u && u <= 8839 || 8853 == u || 8857 == u || 8869 == u || 8895 == u || 8978 == u || 9312 <= u && u <= 9449 || 9451 <= u && u <= 9547 || 9552 <= u && u <= 9587 || 9600 <= u && u <= 9615 || 9618 <= u && u <= 9621 || 9632 <= u && u <= 9633 || 9635 <= u && u <= 9641 || 9650 <= u && u <= 9651 || 9654 <= u && u <= 9655 || 9660 <= u && u <= 9661 || 9664 <= u && u <= 9665 || 9670 <= u && u <= 9672 || 9675 == u || 9678 <= u && u <= 9681 || 9698 <= u && u <= 9701 || 9711 == u || 9733 <= u && u <= 9734 || 9737 == u || 9742 <= u && u <= 9743 || 9748 <= u && u <= 9749 || 9756 == u || 9758 == u || 9792 == u || 9794 == u || 9824 <= u && u <= 9825 || 9827 <= u && u <= 9829 || 9831 <= u && u <= 9834 || 9836 <= u && u <= 9837 || 9839 == u || 9886 <= u && u <= 9887 || 9918 <= u && u <= 9919 || 9924 <= u && u <= 9933 || 9935 <= u && u <= 9953 || 9955 == u || 9960 <= u && u <= 9983 || 10045 == u || 10071 == u || 10102 <= u && u <= 10111 || 11093 <= u && u <= 11097 || 12872 <= u && u <= 12879 || 57344 <= u && u <= 63743 || 65024 <= u && u <= 65039 || 65533 == u || 127232 <= u && u <= 127242 || 127248 <= u && u <= 127277 || 127280 <= u && u <= 127337 || 127344 <= u && u <= 127386 || 917760 <= u && u <= 917999 || 983040 <= u && u <= 1048573 || 1048576 <= u && u <= 1114109 ? "A" : "N";
|
|
204
|
-
}, D.characterLength = function(s) {
|
|
205
|
-
var i = this.eastAsianWidth(s);
|
|
206
|
-
return "F" == i || "W" == i || "A" == i ? 2 : 1;
|
|
207
|
-
};
|
|
208
|
-
function t(s) {
|
|
209
|
-
return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
210
|
-
}
|
|
211
|
-
D.length = function(s) {
|
|
212
|
-
for(var i = t(s), F = 0, u = 0; u < i.length; u++)F += this.characterLength(i[u]);
|
|
213
|
-
return F;
|
|
214
|
-
}, D.slice = function(s, i, F) {
|
|
215
|
-
textLen = D.length(s), i = i || 0, F = F || 1, i < 0 && (i = textLen + i), F < 0 && (F = textLen + F);
|
|
216
|
-
for(var u = "", r = 0, a = t(s), n = 0; n < a.length; n++){
|
|
217
|
-
var l = a[n], o = D.length(l);
|
|
218
|
-
if (r >= i - (2 == o ? 1 : 0)) if (r + o <= F) u += l;
|
|
219
|
-
else break;
|
|
220
|
-
r += o;
|
|
221
|
-
}
|
|
222
|
-
return u;
|
|
223
|
-
};
|
|
224
|
-
})(q);
|
|
225
|
-
var xu = q.exports;
|
|
226
|
-
const Bu = dist_Z(xu);
|
|
227
|
-
var pu = function() {
|
|
228
|
-
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;
|
|
229
|
-
};
|
|
230
|
-
const Au = dist_Z(pu);
|
|
231
|
-
function dist_b(e, D = {}) {
|
|
232
|
-
if ("string" != typeof e || 0 === e.length || (D = {
|
|
233
|
-
ambiguousIsNarrow: !0,
|
|
234
|
-
...D
|
|
235
|
-
}, e = dist_Y(e), 0 === e.length)) return 0;
|
|
236
|
-
e = e.replace(Au(), " ");
|
|
237
|
-
const t = D.ambiguousIsNarrow ? 1 : 2;
|
|
238
|
-
let s = 0;
|
|
239
|
-
for (const i of e){
|
|
240
|
-
const F = i.codePointAt(0);
|
|
241
|
-
if (!(F <= 31) && (!(F >= 127) || !(F <= 159)) && (!(F >= 768) || !(F <= 879))) switch(Bu.eastAsianWidth(i)){
|
|
242
|
-
case "F":
|
|
243
|
-
case "W":
|
|
244
|
-
s += 2;
|
|
245
|
-
break;
|
|
246
|
-
case "A":
|
|
247
|
-
s += t;
|
|
248
|
-
break;
|
|
249
|
-
default:
|
|
250
|
-
s += 1;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return s;
|
|
254
|
-
}
|
|
255
|
-
const dist_M = 10, H = (e = 0)=>(D)=>`\x1B[${D + e}m`, J = (e = 0)=>(D)=>`\x1B[${38 + e};5;${D}m`, dist_Q = (e = 0)=>(D, t, s)=>`\x1B[${38 + e};2;${D};${t};${s}m`, C = {
|
|
256
|
-
modifier: {
|
|
257
|
-
reset: [
|
|
258
|
-
0,
|
|
259
|
-
0
|
|
260
|
-
],
|
|
261
|
-
bold: [
|
|
262
|
-
1,
|
|
263
|
-
22
|
|
264
|
-
],
|
|
265
|
-
dim: [
|
|
266
|
-
2,
|
|
267
|
-
22
|
|
268
|
-
],
|
|
269
|
-
italic: [
|
|
270
|
-
3,
|
|
271
|
-
23
|
|
272
|
-
],
|
|
273
|
-
underline: [
|
|
274
|
-
4,
|
|
275
|
-
24
|
|
276
|
-
],
|
|
277
|
-
overline: [
|
|
278
|
-
53,
|
|
279
|
-
55
|
|
280
|
-
],
|
|
281
|
-
inverse: [
|
|
282
|
-
7,
|
|
283
|
-
27
|
|
284
|
-
],
|
|
285
|
-
hidden: [
|
|
286
|
-
8,
|
|
287
|
-
28
|
|
288
|
-
],
|
|
289
|
-
strikethrough: [
|
|
290
|
-
9,
|
|
291
|
-
29
|
|
292
|
-
]
|
|
293
|
-
},
|
|
294
|
-
color: {
|
|
295
|
-
black: [
|
|
296
|
-
30,
|
|
297
|
-
39
|
|
298
|
-
],
|
|
299
|
-
red: [
|
|
300
|
-
31,
|
|
301
|
-
39
|
|
302
|
-
],
|
|
303
|
-
green: [
|
|
304
|
-
32,
|
|
305
|
-
39
|
|
306
|
-
],
|
|
307
|
-
yellow: [
|
|
308
|
-
33,
|
|
309
|
-
39
|
|
310
|
-
],
|
|
311
|
-
blue: [
|
|
312
|
-
34,
|
|
313
|
-
39
|
|
314
|
-
],
|
|
315
|
-
magenta: [
|
|
316
|
-
35,
|
|
317
|
-
39
|
|
318
|
-
],
|
|
319
|
-
cyan: [
|
|
320
|
-
36,
|
|
321
|
-
39
|
|
322
|
-
],
|
|
323
|
-
white: [
|
|
324
|
-
37,
|
|
325
|
-
39
|
|
326
|
-
],
|
|
327
|
-
blackBright: [
|
|
328
|
-
90,
|
|
329
|
-
39
|
|
330
|
-
],
|
|
331
|
-
gray: [
|
|
332
|
-
90,
|
|
333
|
-
39
|
|
334
|
-
],
|
|
335
|
-
grey: [
|
|
336
|
-
90,
|
|
337
|
-
39
|
|
338
|
-
],
|
|
339
|
-
redBright: [
|
|
340
|
-
91,
|
|
341
|
-
39
|
|
342
|
-
],
|
|
343
|
-
greenBright: [
|
|
344
|
-
92,
|
|
345
|
-
39
|
|
346
|
-
],
|
|
347
|
-
yellowBright: [
|
|
348
|
-
93,
|
|
349
|
-
39
|
|
350
|
-
],
|
|
351
|
-
blueBright: [
|
|
352
|
-
94,
|
|
353
|
-
39
|
|
354
|
-
],
|
|
355
|
-
magentaBright: [
|
|
356
|
-
95,
|
|
357
|
-
39
|
|
358
|
-
],
|
|
359
|
-
cyanBright: [
|
|
360
|
-
96,
|
|
361
|
-
39
|
|
362
|
-
],
|
|
363
|
-
whiteBright: [
|
|
364
|
-
97,
|
|
365
|
-
39
|
|
366
|
-
]
|
|
367
|
-
},
|
|
368
|
-
bgColor: {
|
|
369
|
-
bgBlack: [
|
|
370
|
-
40,
|
|
371
|
-
49
|
|
372
|
-
],
|
|
373
|
-
bgRed: [
|
|
374
|
-
41,
|
|
375
|
-
49
|
|
376
|
-
],
|
|
377
|
-
bgGreen: [
|
|
378
|
-
42,
|
|
379
|
-
49
|
|
380
|
-
],
|
|
381
|
-
bgYellow: [
|
|
382
|
-
43,
|
|
383
|
-
49
|
|
384
|
-
],
|
|
385
|
-
bgBlue: [
|
|
386
|
-
44,
|
|
387
|
-
49
|
|
388
|
-
],
|
|
389
|
-
bgMagenta: [
|
|
390
|
-
45,
|
|
391
|
-
49
|
|
392
|
-
],
|
|
393
|
-
bgCyan: [
|
|
394
|
-
46,
|
|
395
|
-
49
|
|
396
|
-
],
|
|
397
|
-
bgWhite: [
|
|
398
|
-
47,
|
|
399
|
-
49
|
|
400
|
-
],
|
|
401
|
-
bgBlackBright: [
|
|
402
|
-
100,
|
|
403
|
-
49
|
|
404
|
-
],
|
|
405
|
-
bgGray: [
|
|
406
|
-
100,
|
|
407
|
-
49
|
|
408
|
-
],
|
|
409
|
-
bgGrey: [
|
|
410
|
-
100,
|
|
411
|
-
49
|
|
412
|
-
],
|
|
413
|
-
bgRedBright: [
|
|
414
|
-
101,
|
|
415
|
-
49
|
|
416
|
-
],
|
|
417
|
-
bgGreenBright: [
|
|
418
|
-
102,
|
|
419
|
-
49
|
|
420
|
-
],
|
|
421
|
-
bgYellowBright: [
|
|
422
|
-
103,
|
|
423
|
-
49
|
|
424
|
-
],
|
|
425
|
-
bgBlueBright: [
|
|
426
|
-
104,
|
|
427
|
-
49
|
|
428
|
-
],
|
|
429
|
-
bgMagentaBright: [
|
|
430
|
-
105,
|
|
431
|
-
49
|
|
432
|
-
],
|
|
433
|
-
bgCyanBright: [
|
|
434
|
-
106,
|
|
435
|
-
49
|
|
436
|
-
],
|
|
437
|
-
bgWhiteBright: [
|
|
438
|
-
107,
|
|
439
|
-
49
|
|
440
|
-
]
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
Object.keys(C.modifier);
|
|
444
|
-
const fu = Object.keys(C.color), du = Object.keys(C.bgColor);
|
|
445
|
-
[
|
|
446
|
-
...fu,
|
|
447
|
-
...du
|
|
448
|
-
];
|
|
449
|
-
function gu() {
|
|
450
|
-
const e = new Map;
|
|
451
|
-
for (const [D, t] of Object.entries(C)){
|
|
452
|
-
for (const [s, i] of Object.entries(t))C[s] = {
|
|
453
|
-
open: `\x1B[${i[0]}m`,
|
|
454
|
-
close: `\x1B[${i[1]}m`
|
|
455
|
-
}, t[s] = C[s], e.set(i[0], i[1]);
|
|
456
|
-
Object.defineProperty(C, D, {
|
|
457
|
-
value: t,
|
|
458
|
-
enumerable: !1
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
return Object.defineProperty(C, "codes", {
|
|
462
|
-
value: e,
|
|
463
|
-
enumerable: !1
|
|
464
|
-
}), C.color.close = "\x1B[39m", C.bgColor.close = "\x1B[49m", C.color.ansi = H(), C.color.ansi256 = J(), C.color.ansi16m = dist_Q(), C.bgColor.ansi = H(dist_M), C.bgColor.ansi256 = J(dist_M), C.bgColor.ansi16m = dist_Q(dist_M), Object.defineProperties(C, {
|
|
465
|
-
rgbToAnsi256: {
|
|
466
|
-
value: (D, t, s)=>D === t && t === s ? D < 8 ? 16 : D > 248 ? 231 : Math.round((D - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(D / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(s / 255 * 5),
|
|
467
|
-
enumerable: !1
|
|
468
|
-
},
|
|
469
|
-
hexToRgb: {
|
|
470
|
-
value: (D)=>{
|
|
471
|
-
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));
|
|
472
|
-
if (!t) return [
|
|
473
|
-
0,
|
|
474
|
-
0,
|
|
475
|
-
0
|
|
476
|
-
];
|
|
477
|
-
let [s] = t;
|
|
478
|
-
3 === s.length && (s = [
|
|
479
|
-
...s
|
|
480
|
-
].map((F)=>F + F).join(""));
|
|
481
|
-
const i = Number.parseInt(s, 16);
|
|
482
|
-
return [
|
|
483
|
-
i >> 16 & 255,
|
|
484
|
-
i >> 8 & 255,
|
|
485
|
-
255 & i
|
|
486
|
-
];
|
|
487
|
-
},
|
|
488
|
-
enumerable: !1
|
|
489
|
-
},
|
|
490
|
-
hexToAnsi256: {
|
|
491
|
-
value: (D)=>C.rgbToAnsi256(...C.hexToRgb(D)),
|
|
492
|
-
enumerable: !1
|
|
493
|
-
},
|
|
494
|
-
ansi256ToAnsi: {
|
|
495
|
-
value: (D)=>{
|
|
496
|
-
if (D < 8) return 30 + D;
|
|
497
|
-
if (D < 16) return 90 + (D - 8);
|
|
498
|
-
let t, s, i;
|
|
499
|
-
if (D >= 232) t = ((D - 232) * 10 + 8) / 255, s = t, i = t;
|
|
500
|
-
else {
|
|
501
|
-
D -= 16;
|
|
502
|
-
const r = D % 36;
|
|
503
|
-
t = Math.floor(D / 36) / 5, s = Math.floor(r / 6) / 5, i = r % 6 / 5;
|
|
504
|
-
}
|
|
505
|
-
const F = 2 * Math.max(t, s, i);
|
|
506
|
-
if (0 === F) return 30;
|
|
507
|
-
let u = 30 + (Math.round(i) << 2 | Math.round(s) << 1 | Math.round(t));
|
|
508
|
-
return 2 === F && (u += 60), u;
|
|
509
|
-
},
|
|
510
|
-
enumerable: !1
|
|
511
|
-
},
|
|
512
|
-
rgbToAnsi: {
|
|
513
|
-
value: (D, t, s)=>C.ansi256ToAnsi(C.rgbToAnsi256(D, t, s)),
|
|
514
|
-
enumerable: !1
|
|
515
|
-
},
|
|
516
|
-
hexToAnsi: {
|
|
517
|
-
value: (D)=>C.ansi256ToAnsi(C.hexToAnsi256(D)),
|
|
518
|
-
enumerable: !1
|
|
519
|
-
}
|
|
520
|
-
}), C;
|
|
521
|
-
}
|
|
522
|
-
const mu = gu(), dist_$ = new Set([
|
|
523
|
-
"\x1B",
|
|
524
|
-
"\x9B"
|
|
525
|
-
]), vu = 39, O = "\x07", X = "[", bu = "]", uu = "m", T = `${bu}8;;`, Du = (e)=>`${dist_$.values().next().value}${X}${e}${uu}`, tu = (e)=>`${dist_$.values().next().value}${T}${e}${O}`, wu = (e)=>e.split(" ").map((D)=>dist_b(D)), j = (e, D, t)=>{
|
|
526
|
-
const s = [
|
|
527
|
-
...D
|
|
528
|
-
];
|
|
529
|
-
let i = !1, F = !1, u = dist_b(dist_Y(e[e.length - 1]));
|
|
530
|
-
for (const [r, a] of s.entries()){
|
|
531
|
-
const n = dist_b(a);
|
|
532
|
-
if (u + n <= t ? e[e.length - 1] += a : (e.push(a), u = 0), dist_$.has(a) && (i = !0, F = s.slice(r + 1).join("").startsWith(T)), i) {
|
|
533
|
-
F ? a === O && (i = !1, F = !1) : a === uu && (i = !1);
|
|
534
|
-
continue;
|
|
535
|
-
}
|
|
536
|
-
u += n, u === t && r < s.length - 1 && (e.push(""), u = 0);
|
|
537
|
-
}
|
|
538
|
-
!u && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
539
|
-
}, yu = (e)=>{
|
|
540
|
-
const D = e.split(" ");
|
|
541
|
-
let t = D.length;
|
|
542
|
-
for(; t > 0 && !(dist_b(D[t - 1]) > 0);)t--;
|
|
543
|
-
return t === D.length ? e : D.slice(0, t).join(" ") + D.slice(t).join("");
|
|
544
|
-
}, _u = (e, D, t = {})=>{
|
|
545
|
-
if (!1 !== t.trim && "" === e.trim()) return "";
|
|
546
|
-
let s = "", i, F;
|
|
547
|
-
const u = wu(e);
|
|
548
|
-
let r = [
|
|
549
|
-
""
|
|
550
|
-
];
|
|
551
|
-
for (const [n, l] of e.split(" ").entries()){
|
|
552
|
-
!1 !== t.trim && (r[r.length - 1] = r[r.length - 1].trimStart());
|
|
553
|
-
let o = dist_b(r[r.length - 1]);
|
|
554
|
-
if (0 !== n && (o >= D && (!1 === t.wordWrap || !1 === t.trim) && (r.push(""), o = 0), (o > 0 || !1 === t.trim) && (r[r.length - 1] += " ", o++)), t.hard && u[n] > D) {
|
|
555
|
-
const A = D - o, y = 1 + Math.floor((u[n] - A - 1) / D);
|
|
556
|
-
Math.floor((u[n] - 1) / D) < y && r.push(""), j(r, l, D);
|
|
557
|
-
continue;
|
|
558
|
-
}
|
|
559
|
-
if (o + u[n] > D && o > 0 && u[n] > 0) {
|
|
560
|
-
if (!1 === t.wordWrap && o < D) {
|
|
561
|
-
j(r, l, D);
|
|
562
|
-
continue;
|
|
563
|
-
}
|
|
564
|
-
r.push("");
|
|
565
|
-
}
|
|
566
|
-
if (o + u[n] > D && !1 === t.wordWrap) {
|
|
567
|
-
j(r, l, D);
|
|
568
|
-
continue;
|
|
569
|
-
}
|
|
570
|
-
r[r.length - 1] += l;
|
|
571
|
-
}
|
|
572
|
-
!1 !== t.trim && (r = r.map((n)=>yu(n)));
|
|
573
|
-
const a = [
|
|
574
|
-
...r.join(`
|
|
575
|
-
`)
|
|
576
|
-
];
|
|
577
|
-
for (const [n, l] of a.entries()){
|
|
578
|
-
if (s += l, dist_$.has(l)) {
|
|
579
|
-
const { groups: A } = new RegExp(`(?:\\${X}(?<code>\\d+)m|\\${T}(?<uri>.*)${O})`).exec(a.slice(n).join("")) || {
|
|
580
|
-
groups: {}
|
|
581
|
-
};
|
|
582
|
-
if (void 0 !== A.code) {
|
|
583
|
-
const y = Number.parseFloat(A.code);
|
|
584
|
-
i = y === vu ? void 0 : y;
|
|
585
|
-
} else void 0 !== A.uri && (F = 0 === A.uri.length ? void 0 : A.uri);
|
|
586
|
-
}
|
|
587
|
-
const o = mu.codes.get(Number(i));
|
|
588
|
-
a[n + 1] === `
|
|
589
|
-
` ? (F && (s += tu("")), i && o && (s += Du(o))) : l === `
|
|
590
|
-
` && (i && o && (s += Du(i)), F && (s += tu(F)));
|
|
591
|
-
}
|
|
592
|
-
return s;
|
|
593
|
-
};
|
|
594
|
-
function eu(e, D, t) {
|
|
595
|
-
return String(e).normalize().replace(/\r\n/g, `
|
|
596
|
-
`).split(`
|
|
597
|
-
`).map((s)=>_u(s, D, t)).join(`
|
|
598
|
-
`);
|
|
599
|
-
}
|
|
600
|
-
const $u = [
|
|
601
|
-
"up",
|
|
602
|
-
"down",
|
|
603
|
-
"left",
|
|
604
|
-
"right",
|
|
605
|
-
"space",
|
|
606
|
-
"enter",
|
|
607
|
-
"cancel"
|
|
608
|
-
], dist_c = {
|
|
609
|
-
actions: new Set($u),
|
|
610
|
-
aliases: new Map([
|
|
611
|
-
[
|
|
612
|
-
"k",
|
|
613
|
-
"up"
|
|
614
|
-
],
|
|
615
|
-
[
|
|
616
|
-
"j",
|
|
617
|
-
"down"
|
|
618
|
-
],
|
|
619
|
-
[
|
|
620
|
-
"h",
|
|
621
|
-
"left"
|
|
622
|
-
],
|
|
623
|
-
[
|
|
624
|
-
"l",
|
|
625
|
-
"right"
|
|
626
|
-
],
|
|
627
|
-
[
|
|
628
|
-
"",
|
|
629
|
-
"cancel"
|
|
630
|
-
],
|
|
631
|
-
[
|
|
632
|
-
"escape",
|
|
633
|
-
"cancel"
|
|
634
|
-
]
|
|
635
|
-
]),
|
|
636
|
-
messages: {
|
|
637
|
-
cancel: "Canceled",
|
|
638
|
-
error: "Something went wrong"
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
function Su(e) {
|
|
642
|
-
if (void 0 !== e.aliases) {
|
|
643
|
-
const D = e.aliases;
|
|
644
|
-
for(const t in D){
|
|
645
|
-
if (!Object.hasOwn(D, t)) continue;
|
|
646
|
-
const s = D[t];
|
|
647
|
-
dist_c.actions.has(s) && (dist_c.aliases.has(t) || dist_c.aliases.set(t, s));
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
if (void 0 !== e.messages) {
|
|
651
|
-
const D = e.messages;
|
|
652
|
-
void 0 !== D.cancel && (dist_c.messages.cancel = D.cancel), void 0 !== D.error && (dist_c.messages.error = D.error);
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
function W(e, D) {
|
|
656
|
-
if ("string" == typeof e) return dist_c.aliases.get(e) === D;
|
|
657
|
-
for (const t of e)if (void 0 !== t && W(t, D)) return !0;
|
|
658
|
-
return !1;
|
|
659
|
-
}
|
|
660
|
-
function ku(e, D) {
|
|
661
|
-
if (e === D) return;
|
|
662
|
-
const t = e.split(`
|
|
663
|
-
`), s = D.split(`
|
|
664
|
-
`), i = [];
|
|
665
|
-
for(let F = 0; F < Math.max(t.length, s.length); F++)t[F] !== s[F] && i.push(F);
|
|
666
|
-
return i;
|
|
667
|
-
}
|
|
668
|
-
const Iu = globalThis.process.platform.startsWith("win"), L = Symbol("clack:cancel");
|
|
669
|
-
function Vu(e) {
|
|
670
|
-
return e === L;
|
|
671
|
-
}
|
|
672
|
-
function dist_S(e, D) {
|
|
673
|
-
const t = e;
|
|
674
|
-
t.isTTY && t.setRawMode(D);
|
|
675
|
-
}
|
|
676
|
-
function Mu({ input: e = external_node_process_.stdin, output: D = external_node_process_.stdout, overwrite: t = !0, hideCursor: s = !0 } = {}) {
|
|
677
|
-
const i = external_node_readline_.createInterface({
|
|
678
|
-
input: e,
|
|
679
|
-
output: D,
|
|
680
|
-
prompt: "",
|
|
681
|
-
tabSize: 1
|
|
682
|
-
});
|
|
683
|
-
external_node_readline_.emitKeypressEvents(e, i), e instanceof external_node_tty_.ReadStream && e.isTTY && e.setRawMode(!0);
|
|
684
|
-
const F = (u, { name: r, sequence: a })=>{
|
|
685
|
-
const n = String(u);
|
|
686
|
-
if (W([
|
|
687
|
-
n,
|
|
688
|
-
r,
|
|
689
|
-
a
|
|
690
|
-
], "cancel")) {
|
|
691
|
-
s && D.write(src.cursor.show), process.exit(0);
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
|
-
if (!t) return;
|
|
695
|
-
const l = "return" === r ? 0 : -1, o = "return" === r ? -1 : 0;
|
|
696
|
-
external_node_readline_.moveCursor(D, l, o, ()=>{
|
|
697
|
-
external_node_readline_.clearLine(D, 1, ()=>{
|
|
698
|
-
e.once("keypress", F);
|
|
699
|
-
});
|
|
700
|
-
});
|
|
701
|
-
};
|
|
702
|
-
return s && D.write(src.cursor.hide), e.once("keypress", F), ()=>{
|
|
703
|
-
e.off("keypress", F), s && D.write(src.cursor.show), e instanceof external_node_tty_.ReadStream && e.isTTY && !Iu && e.setRawMode(!1), i.terminal = !1, i.close();
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
const Ou = (e)=>e instanceof external_node_tty_.WriteStream && e.columns ? e.columns : 80;
|
|
707
|
-
var Tu = Object.defineProperty, ju = (e, D, t)=>D in e ? Tu(e, D, {
|
|
708
|
-
enumerable: !0,
|
|
709
|
-
configurable: !0,
|
|
710
|
-
writable: !0,
|
|
711
|
-
value: t
|
|
712
|
-
}) : e[D] = t, E = (e, D, t)=>(ju(e, "symbol" != typeof D ? D + "" : D, t), t);
|
|
713
|
-
let dist_p = class {
|
|
714
|
-
constructor(D, t = !0){
|
|
715
|
-
E(this, "input"), E(this, "output"), E(this, "_abortSignal"), E(this, "rl"), E(this, "opts"), E(this, "_render"), E(this, "_track", !1), E(this, "_prevFrame", ""), E(this, "_subscribers", new Map), E(this, "_cursor", 0), E(this, "state", "initial"), E(this, "error", ""), E(this, "value"), E(this, "userInput", "");
|
|
716
|
-
const { input: s = external_node_process_.stdin, output: i = external_node_process_.stdout, render: F, signal: u, ...r } = D;
|
|
717
|
-
this.opts = r, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = F.bind(this), this._track = t, this._abortSignal = u, this.input = s, this.output = i;
|
|
718
|
-
}
|
|
719
|
-
unsubscribe() {
|
|
720
|
-
this._subscribers.clear();
|
|
721
|
-
}
|
|
722
|
-
setSubscriber(D, t) {
|
|
723
|
-
const s = this._subscribers.get(D) ?? [];
|
|
724
|
-
s.push(t), this._subscribers.set(D, s);
|
|
725
|
-
}
|
|
726
|
-
on(D, t) {
|
|
727
|
-
this.setSubscriber(D, {
|
|
728
|
-
cb: t
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
once(D, t) {
|
|
732
|
-
this.setSubscriber(D, {
|
|
733
|
-
cb: t,
|
|
734
|
-
once: !0
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
emit(D, ...t) {
|
|
738
|
-
const s = this._subscribers.get(D) ?? [], i = [];
|
|
739
|
-
for (const F of s)F.cb(...t), F.once && i.push(()=>s.splice(s.indexOf(F), 1));
|
|
740
|
-
for (const F of i)F();
|
|
741
|
-
}
|
|
742
|
-
prompt() {
|
|
743
|
-
return new Promise((D)=>{
|
|
744
|
-
if (this._abortSignal) {
|
|
745
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), D(L);
|
|
746
|
-
this._abortSignal.addEventListener("abort", ()=>{
|
|
747
|
-
this.state = "cancel", this.close();
|
|
748
|
-
}, {
|
|
749
|
-
once: !0
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
this.rl = external_node_readline_["default"].createInterface({
|
|
753
|
-
input: this.input,
|
|
754
|
-
tabSize: 2,
|
|
755
|
-
prompt: "",
|
|
756
|
-
escapeCodeTimeout: 50,
|
|
757
|
-
terminal: !0
|
|
758
|
-
}), this.rl.prompt(), void 0 !== this.opts.initialUserInput && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), dist_S(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", ()=>{
|
|
759
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render), dist_S(this.input, !1), D(this.value);
|
|
760
|
-
}), this.once("cancel", ()=>{
|
|
761
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render), dist_S(this.input, !1), D(L);
|
|
762
|
-
});
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
_isActionKey(D, t) {
|
|
766
|
-
return " " === D;
|
|
767
|
-
}
|
|
768
|
-
_setValue(D) {
|
|
769
|
-
this.value = D, this.emit("value", this.value);
|
|
770
|
-
}
|
|
771
|
-
_setUserInput(D, t) {
|
|
772
|
-
this.userInput = D ?? "", this.emit("userInput", this.userInput), t && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
773
|
-
}
|
|
774
|
-
onKeypress(D, t) {
|
|
775
|
-
if (this._track && "return" !== t.name && (t.name && this._isActionKey(D, t) && this.rl?.write(null, {
|
|
776
|
-
ctrl: !0,
|
|
777
|
-
name: "h"
|
|
778
|
-
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), "error" === this.state && (this.state = "active"), t?.name && (!this._track && dist_c.aliases.has(t.name) && this.emit("cursor", dist_c.aliases.get(t.name)), dist_c.actions.has(t.name) && this.emit("cursor", t.name)), D && ("y" === D.toLowerCase() || "n" === D.toLowerCase()) && this.emit("confirm", "y" === D.toLowerCase()), this.emit("key", D?.toLowerCase(), t), t?.name === "return") {
|
|
779
|
-
if (this.opts.validate) {
|
|
780
|
-
const s = this.opts.validate(this.value);
|
|
781
|
-
s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
782
|
-
}
|
|
783
|
-
"error" !== this.state && (this.state = "submit");
|
|
784
|
-
}
|
|
785
|
-
W([
|
|
786
|
-
D,
|
|
787
|
-
t?.name,
|
|
788
|
-
t?.sequence
|
|
789
|
-
], "cancel") && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"), this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
|
|
790
|
-
}
|
|
791
|
-
close() {
|
|
792
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
793
|
-
`), dist_S(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
794
|
-
}
|
|
795
|
-
restoreCursor() {
|
|
796
|
-
const D = eu(this._prevFrame, process.stdout.columns, {
|
|
797
|
-
hard: !0
|
|
798
|
-
}).split(`
|
|
799
|
-
`).length - 1;
|
|
800
|
-
this.output.write(src.cursor.move(-999, -1 * D));
|
|
801
|
-
}
|
|
802
|
-
render() {
|
|
803
|
-
const D = eu(this._render(this) ?? "", process.stdout.columns, {
|
|
804
|
-
hard: !0
|
|
805
|
-
});
|
|
806
|
-
if (D !== this._prevFrame) {
|
|
807
|
-
if ("initial" === this.state) this.output.write(src.cursor.hide);
|
|
808
|
-
else {
|
|
809
|
-
const t = ku(this._prevFrame, D);
|
|
810
|
-
if (this.restoreCursor(), t && t?.length === 1) {
|
|
811
|
-
const s = t[0];
|
|
812
|
-
this.output.write(src.cursor.move(0, s)), this.output.write(src.erase.lines(1));
|
|
813
|
-
const i = D.split(`
|
|
814
|
-
`);
|
|
815
|
-
this.output.write(i[s]), this._prevFrame = D, this.output.write(src.cursor.move(0, i.length - s - 1));
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
if (t && t?.length > 1) {
|
|
819
|
-
const s = t[0];
|
|
820
|
-
this.output.write(src.cursor.move(0, s)), this.output.write(src.erase.down());
|
|
821
|
-
const i = D.split(`
|
|
822
|
-
`).slice(s);
|
|
823
|
-
this.output.write(i.join(`
|
|
824
|
-
`)), this._prevFrame = D;
|
|
825
|
-
return;
|
|
826
|
-
}
|
|
827
|
-
this.output.write(src.erase.down());
|
|
828
|
-
}
|
|
829
|
-
this.output.write(D), "initial" === this.state && (this.state = "active"), this._prevFrame = D;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
}, Wu = class extends dist_p {
|
|
833
|
-
get cursor() {
|
|
834
|
-
return this.value ? 0 : 1;
|
|
835
|
-
}
|
|
836
|
-
get _value() {
|
|
837
|
-
return 0 === this.cursor;
|
|
838
|
-
}
|
|
839
|
-
constructor(D){
|
|
840
|
-
super(D, !1), this.value = !!D.initialValue, this.on("userInput", ()=>{
|
|
841
|
-
this.value = this._value;
|
|
842
|
-
}), this.on("confirm", (t)=>{
|
|
843
|
-
this.output.write(src.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
844
|
-
}), this.on("cursor", ()=>{
|
|
845
|
-
this.value = !this.value;
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
var Lu = Object.defineProperty, Nu = (e, D, t)=>D in e ? Lu(e, D, {
|
|
850
|
-
enumerable: !0,
|
|
851
|
-
configurable: !0,
|
|
852
|
-
writable: !0,
|
|
853
|
-
value: t
|
|
854
|
-
}) : e[D] = t, su = (e, D, t)=>(Nu(e, "symbol" != typeof D ? D + "" : D, t), t), iu = (e, D, t)=>{
|
|
855
|
-
if (!D.has(e)) throw TypeError("Cannot " + t);
|
|
856
|
-
}, N = (e, D, t)=>(iu(e, D, "read from private field"), t ? t.call(e) : D.get(e)), Pu = (e, D, t)=>{
|
|
857
|
-
if (D.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
858
|
-
D instanceof WeakSet ? D.add(e) : D.set(e, t);
|
|
859
|
-
}, Ru = (e, D, t, s)=>(iu(e, D, "write to private field"), s ? s.call(e, t) : D.set(e, t), t), dist_d;
|
|
860
|
-
let Ku = class extends dist_p {
|
|
861
|
-
constructor(D){
|
|
862
|
-
super(D, !1), su(this, "options"), su(this, "cursor", 0), Pu(this, dist_d, void 0);
|
|
863
|
-
const { options: t } = D;
|
|
864
|
-
Ru(this, dist_d, !1 !== D.selectableGroups), this.options = Object.entries(t).flatMap(([s, i])=>[
|
|
865
|
-
{
|
|
866
|
-
value: s,
|
|
867
|
-
group: !0,
|
|
868
|
-
label: s
|
|
869
|
-
},
|
|
870
|
-
...i.map((F)=>({
|
|
871
|
-
...F,
|
|
872
|
-
group: s
|
|
873
|
-
}))
|
|
874
|
-
]), this.value = [
|
|
875
|
-
...D.initialValues ?? []
|
|
876
|
-
], this.cursor = Math.max(this.options.findIndex(({ value: s })=>s === D.cursorAt), N(this, dist_d) ? 0 : 1), this.on("cursor", (s)=>{
|
|
877
|
-
switch(s){
|
|
878
|
-
case "left":
|
|
879
|
-
case "up":
|
|
880
|
-
{
|
|
881
|
-
this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
|
|
882
|
-
const i = this.options[this.cursor]?.group === !0;
|
|
883
|
-
!N(this, dist_d) && i && (this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1);
|
|
884
|
-
break;
|
|
885
|
-
}
|
|
886
|
-
case "down":
|
|
887
|
-
case "right":
|
|
888
|
-
{
|
|
889
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
890
|
-
const i = this.options[this.cursor]?.group === !0;
|
|
891
|
-
!N(this, dist_d) && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
892
|
-
break;
|
|
893
|
-
}
|
|
894
|
-
case "space":
|
|
895
|
-
this.toggleValue();
|
|
896
|
-
break;
|
|
897
|
-
}
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
getGroupItems(D) {
|
|
901
|
-
return this.options.filter((t)=>t.group === D);
|
|
902
|
-
}
|
|
903
|
-
isGroupSelected(D) {
|
|
904
|
-
const t = this.getGroupItems(D), s = this.value;
|
|
905
|
-
return void 0 === s ? !1 : t.every((i)=>s.includes(i.value));
|
|
906
|
-
}
|
|
907
|
-
toggleValue() {
|
|
908
|
-
const D = this.options[this.cursor];
|
|
909
|
-
if (void 0 === this.value && (this.value = []), !0 === D.group) {
|
|
910
|
-
const t = D.value, s = this.getGroupItems(t);
|
|
911
|
-
this.isGroupSelected(t) ? this.value = this.value.filter((i)=>-1 === s.findIndex((F)=>F.value === i)) : this.value = [
|
|
912
|
-
...this.value,
|
|
913
|
-
...s.map((i)=>i.value)
|
|
914
|
-
], this.value = Array.from(new Set(this.value));
|
|
915
|
-
} else {
|
|
916
|
-
const t = this.value.includes(D.value);
|
|
917
|
-
this.value = t ? this.value.filter((s)=>s !== D.value) : [
|
|
918
|
-
...this.value,
|
|
919
|
-
D.value
|
|
920
|
-
];
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
dist_d = new WeakMap;
|
|
925
|
-
var Gu = Object.defineProperty, zu = (e, D, t)=>D in e ? Gu(e, D, {
|
|
926
|
-
enumerable: !0,
|
|
927
|
-
configurable: !0,
|
|
928
|
-
writable: !0,
|
|
929
|
-
value: t
|
|
930
|
-
}) : e[D] = t, Fu = (e, D, t)=>(zu(e, "symbol" != typeof D ? D + "" : D, t), t);
|
|
931
|
-
let Uu = class extends dist_p {
|
|
932
|
-
constructor(D){
|
|
933
|
-
super(D, !1), Fu(this, "options"), Fu(this, "cursor", 0), this.options = D.options, this.value = [
|
|
934
|
-
...D.initialValues ?? []
|
|
935
|
-
], this.cursor = Math.max(this.options.findIndex(({ value: t })=>t === D.cursorAt), 0), this.on("key", (t)=>{
|
|
936
|
-
"a" === t && this.toggleAll();
|
|
937
|
-
}), this.on("cursor", (t)=>{
|
|
938
|
-
switch(t){
|
|
939
|
-
case "left":
|
|
940
|
-
case "up":
|
|
941
|
-
this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
|
|
942
|
-
break;
|
|
943
|
-
case "down":
|
|
944
|
-
case "right":
|
|
945
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
946
|
-
break;
|
|
947
|
-
case "space":
|
|
948
|
-
this.toggleValue();
|
|
949
|
-
break;
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
get _value() {
|
|
954
|
-
return this.options[this.cursor].value;
|
|
955
|
-
}
|
|
956
|
-
toggleAll() {
|
|
957
|
-
const D = void 0 !== this.value && this.value.length === this.options.length;
|
|
958
|
-
this.value = D ? [] : this.options.map((t)=>t.value);
|
|
959
|
-
}
|
|
960
|
-
toggleValue() {
|
|
961
|
-
void 0 === this.value && (this.value = []);
|
|
962
|
-
const D = this.value.includes(this._value);
|
|
963
|
-
this.value = D ? this.value.filter((t)=>t !== this._value) : [
|
|
964
|
-
...this.value,
|
|
965
|
-
this._value
|
|
966
|
-
];
|
|
967
|
-
}
|
|
968
|
-
};
|
|
969
|
-
var Yu = Object.defineProperty, Zu = (e, D, t)=>D in e ? Yu(e, D, {
|
|
970
|
-
enumerable: !0,
|
|
971
|
-
configurable: !0,
|
|
972
|
-
writable: !0,
|
|
973
|
-
value: t
|
|
974
|
-
}) : e[D] = t, qu = (e, D, t)=>(Zu(e, "symbol" != typeof D ? D + "" : D, t), t);
|
|
975
|
-
let Hu = class extends dist_p {
|
|
976
|
-
constructor({ mask: D, ...t }){
|
|
977
|
-
super(t), qu(this, "_mask", "\u2022"), this._mask = D ?? "\u2022", this.on("userInput", (s)=>{
|
|
978
|
-
this._setValue(s);
|
|
979
|
-
});
|
|
980
|
-
}
|
|
981
|
-
get cursor() {
|
|
982
|
-
return this._cursor;
|
|
983
|
-
}
|
|
984
|
-
get masked() {
|
|
985
|
-
return this.userInput.replaceAll(/./g, this._mask);
|
|
986
|
-
}
|
|
987
|
-
get userInputWithCursor() {
|
|
988
|
-
if ("submit" === this.state || "cancel" === this.state) return this.masked;
|
|
989
|
-
const D = this.userInput;
|
|
990
|
-
if (this.cursor >= D.length) return `${this.masked}${picocolors.inverse(picocolors.hidden("_"))}`;
|
|
991
|
-
const t = this.masked, s = t.slice(0, this.cursor), i = t.slice(this.cursor);
|
|
992
|
-
return `${s}${picocolors.inverse(i[0])}${i.slice(1)}`;
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
var Ju = Object.defineProperty, Qu = (e, D, t)=>D in e ? Ju(e, D, {
|
|
996
|
-
enumerable: !0,
|
|
997
|
-
configurable: !0,
|
|
998
|
-
writable: !0,
|
|
999
|
-
value: t
|
|
1000
|
-
}) : e[D] = t, ru = (e, D, t)=>(Qu(e, "symbol" != typeof D ? D + "" : D, t), t);
|
|
1001
|
-
let Xu = class extends dist_p {
|
|
1002
|
-
constructor(D){
|
|
1003
|
-
super(D, !1), ru(this, "options"), ru(this, "cursor", 0), this.options = D.options, this.cursor = this.options.findIndex(({ value: t })=>t === D.initialValue), -1 === this.cursor && (this.cursor = 0), this.changeValue(), this.on("cursor", (t)=>{
|
|
1004
|
-
switch(t){
|
|
1005
|
-
case "left":
|
|
1006
|
-
case "up":
|
|
1007
|
-
this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
|
|
1008
|
-
break;
|
|
1009
|
-
case "down":
|
|
1010
|
-
case "right":
|
|
1011
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1012
|
-
break;
|
|
1013
|
-
}
|
|
1014
|
-
this.changeValue();
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
get _selectedValue() {
|
|
1018
|
-
return this.options[this.cursor];
|
|
1019
|
-
}
|
|
1020
|
-
changeValue() {
|
|
1021
|
-
this.value = this._selectedValue.value;
|
|
1022
|
-
}
|
|
1023
|
-
};
|
|
1024
|
-
var uD = Object.defineProperty, DD = (e, D, t)=>D in e ? uD(e, D, {
|
|
1025
|
-
enumerable: !0,
|
|
1026
|
-
configurable: !0,
|
|
1027
|
-
writable: !0,
|
|
1028
|
-
value: t
|
|
1029
|
-
}) : e[D] = t, Cu = (e, D, t)=>(DD(e, "symbol" != typeof D ? D + "" : D, t), t);
|
|
1030
|
-
let tD = class extends dist_p {
|
|
1031
|
-
constructor(D){
|
|
1032
|
-
super(D, !1), Cu(this, "options"), Cu(this, "cursor", 0), this.options = D.options;
|
|
1033
|
-
const t = this.options.map(({ value: [s] })=>s?.toLowerCase());
|
|
1034
|
-
this.cursor = Math.max(t.indexOf(D.initialValue), 0), this.on("key", (s)=>{
|
|
1035
|
-
if (!s || !t.includes(s)) return;
|
|
1036
|
-
const i = this.options.find(({ value: [F] })=>F?.toLowerCase() === s);
|
|
1037
|
-
i && (this.value = i.value, this.state = "submit", this.emit("submit"));
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1041
|
-
class eD extends dist_p {
|
|
1042
|
-
get userInputWithCursor() {
|
|
1043
|
-
if ("submit" === this.state) return this.userInput;
|
|
1044
|
-
const D = this.userInput;
|
|
1045
|
-
if (this.cursor >= D.length) return `${this.userInput}\u2588`;
|
|
1046
|
-
const t = D.slice(0, this.cursor), [s, ...i] = D.slice(this.cursor);
|
|
1047
|
-
return `${t}${picocolors.inverse(s)}${i.join("")}`;
|
|
1048
|
-
}
|
|
1049
|
-
get cursor() {
|
|
1050
|
-
return this._cursor;
|
|
1051
|
-
}
|
|
1052
|
-
constructor(D){
|
|
1053
|
-
super({
|
|
1054
|
-
...D,
|
|
1055
|
-
initialUserInput: D.initialUserInput ?? D.initialValue
|
|
1056
|
-
}), this.on("userInput", (t)=>{
|
|
1057
|
-
this._setValue(t);
|
|
1058
|
-
}), this.on("finalize", ()=>{
|
|
1059
|
-
this.value || (this.value = D.defaultValue), void 0 === this.value && (this.value = "");
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
var sD = Object.defineProperty, iD = (e, D, t)=>D in e ? sD(e, D, {
|
|
1064
|
-
enumerable: !0,
|
|
1065
|
-
configurable: !0,
|
|
1066
|
-
writable: !0,
|
|
1067
|
-
value: t
|
|
1068
|
-
}) : e[D] = t, dist_w = (e, D, t)=>(iD(e, "symbol" != typeof D ? D + "" : D, t), t), P = (e, D, t)=>{
|
|
1069
|
-
if (!D.has(e)) throw TypeError("Cannot " + t);
|
|
1070
|
-
}, x = (e, D, t)=>(P(e, D, "read from private field"), t ? t.call(e) : D.get(e)), dist_g = (e, D, t)=>{
|
|
1071
|
-
if (D.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
1072
|
-
D instanceof WeakSet ? D.add(e) : D.set(e, t);
|
|
1073
|
-
}, dist_m = (e, D, t, s)=>(P(e, D, "write to private field"), s ? s.call(e, t) : D.set(e, t), t), nu = (e, D, t)=>(P(e, D, "access private method"), t), B, k, dist_I, v, R, ou, K, au;
|
|
1074
|
-
function FD(e, D) {
|
|
1075
|
-
if (void 0 === e || 0 === D.length) return 0;
|
|
1076
|
-
const t = D.findIndex((s)=>s.value === e);
|
|
1077
|
-
return -1 !== t ? t : 0;
|
|
1078
|
-
}
|
|
1079
|
-
function rD(e, D) {
|
|
1080
|
-
return (D.label ?? String(D.value)).toLowerCase().includes(e.toLowerCase());
|
|
1081
|
-
}
|
|
1082
|
-
function CD(e, D) {
|
|
1083
|
-
if (D) return e ? D : D[0];
|
|
1084
|
-
}
|
|
1085
|
-
class nD extends dist_p {
|
|
1086
|
-
constructor(D){
|
|
1087
|
-
super(D), dist_g(this, R), dist_g(this, K), dist_w(this, "filteredOptions"), dist_w(this, "multiple"), dist_w(this, "isNavigating", !1), dist_w(this, "selectedValues", []), dist_w(this, "focusedValue"), dist_g(this, B, 0), dist_g(this, k, ""), dist_g(this, dist_I, void 0), dist_g(this, v, void 0), dist_m(this, v, D.options);
|
|
1088
|
-
const t = this.options;
|
|
1089
|
-
this.filteredOptions = [
|
|
1090
|
-
...t
|
|
1091
|
-
], this.multiple = !0 === D.multiple, dist_m(this, dist_I, D.filter ?? rD);
|
|
1092
|
-
let s;
|
|
1093
|
-
if (D.initialValue && Array.isArray(D.initialValue) ? this.multiple ? s = D.initialValue : s = D.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [
|
|
1094
|
-
this.options[0].value
|
|
1095
|
-
]), s) for (const i of s){
|
|
1096
|
-
const F = t.findIndex((u)=>u.value === i);
|
|
1097
|
-
-1 !== F && (this.toggleSelected(i), dist_m(this, B, F));
|
|
1098
|
-
}
|
|
1099
|
-
this.focusedValue = this.options[x(this, B)]?.value, this.on("key", (i, F)=>nu(this, R, ou).call(this, i, F)), this.on("userInput", (i)=>nu(this, K, au).call(this, i));
|
|
1100
|
-
}
|
|
1101
|
-
get cursor() {
|
|
1102
|
-
return x(this, B);
|
|
1103
|
-
}
|
|
1104
|
-
get userInputWithCursor() {
|
|
1105
|
-
if (!this.userInput) return picocolors.inverse(picocolors.hidden("_"));
|
|
1106
|
-
if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
|
|
1107
|
-
const D = this.userInput.slice(0, this._cursor), [t, ...s] = this.userInput.slice(this._cursor);
|
|
1108
|
-
return `${D}${picocolors.inverse(t)}${s.join("")}`;
|
|
1109
|
-
}
|
|
1110
|
-
get options() {
|
|
1111
|
-
return "function" == typeof x(this, v) ? x(this, v).call(this) : x(this, v);
|
|
1112
|
-
}
|
|
1113
|
-
_isActionKey(D, t) {
|
|
1114
|
-
return " " === D || this.multiple && this.isNavigating && "space" === t.name && void 0 !== D && "" !== D;
|
|
1115
|
-
}
|
|
1116
|
-
deselectAll() {
|
|
1117
|
-
this.selectedValues = [];
|
|
1118
|
-
}
|
|
1119
|
-
toggleSelected(D) {
|
|
1120
|
-
0 !== this.filteredOptions.length && (this.multiple ? this.selectedValues.includes(D) ? this.selectedValues = this.selectedValues.filter((t)=>t !== D) : this.selectedValues = [
|
|
1121
|
-
...this.selectedValues,
|
|
1122
|
-
D
|
|
1123
|
-
] : this.selectedValues = [
|
|
1124
|
-
D
|
|
1125
|
-
]);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
B = new WeakMap, k = new WeakMap, dist_I = new WeakMap, v = new WeakMap, R = new WeakSet, ou = function(e, D) {
|
|
1129
|
-
const t = "up" === D.name, s = "down" === D.name, i = "return" === D.name;
|
|
1130
|
-
t || s ? (dist_m(this, B, Math.max(0, Math.min(x(this, B) + (t ? -1 : 1), this.filteredOptions.length - 1))), this.focusedValue = this.filteredOptions[x(this, B)]?.value, this.multiple || (this.selectedValues = [
|
|
1131
|
-
this.focusedValue
|
|
1132
|
-
]), this.isNavigating = !0) : i ? this.value = CD(this.multiple, this.selectedValues) : this.multiple ? void 0 !== this.focusedValue && ("tab" === D.name || this.isNavigating && "space" === D.name) ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : this.focusedValue && (this.selectedValues = [
|
|
1133
|
-
this.focusedValue
|
|
1134
|
-
]);
|
|
1135
|
-
}, K = new WeakSet, au = function(e) {
|
|
1136
|
-
if (e !== x(this, k)) {
|
|
1137
|
-
dist_m(this, k, e);
|
|
1138
|
-
const D = this.options;
|
|
1139
|
-
e ? this.filteredOptions = D.filter((t)=>x(this, dist_I).call(this, e, t)) : this.filteredOptions = [
|
|
1140
|
-
...D
|
|
1141
|
-
], dist_m(this, B, FD(this.focusedValue, this.filteredOptions)), this.focusedValue = this.filteredOptions[x(this, B)]?.value, this.multiple || (void 0 !== this.focusedValue ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
var external_node_util_ = __webpack_require__("node:util");
|
|
1145
|
-
var external_node_fs_ = __webpack_require__("node:fs");
|
|
1146
|
-
var external_node_path_ = __webpack_require__("node:path");
|
|
1147
|
-
function Pe() {
|
|
1148
|
-
return "win32" !== external_node_process_["default"].platform ? "linux" !== external_node_process_["default"].env.TERM : !!external_node_process_["default"].env.CI || !!external_node_process_["default"].env.WT_SESSION || !!external_node_process_["default"].env.TERMINUS_SUBLIME || "{cmd::Cmder}" === external_node_process_["default"].env.ConEmuTask || "Terminus-Sublime" === external_node_process_["default"].env.TERM_PROGRAM || "vscode" === external_node_process_["default"].env.TERM_PROGRAM || "xterm-256color" === external_node_process_["default"].env.TERM || "alacritty" === external_node_process_["default"].env.TERM || "JetBrains-JediTerm" === external_node_process_["default"].env.TERMINAL_EMULATOR;
|
|
1149
|
-
}
|
|
1150
|
-
const dist_N = Pe(), dist_D = ()=>"true" === process.env.CI, dist_v = (t, i)=>dist_N ? t : i, ne = dist_v("\u25C6", "*"), G = dist_v("\u25A0", "x"), dist_F = dist_v("\u25B2", "x"), dist_O = dist_v("\u25C7", "o"), oe = dist_v("\u250C", "T"), dist_o = dist_v("\u2502", "|"), f = dist_v("\u2514", "\u2014"), dist_P = dist_v("\u25CF", ">"), dist_L = dist_v("\u25CB", " "), dist_k = dist_v("\u25FB", "[\u2022]"), dist_x = dist_v("\u25FC", "[+]"), dist_B = dist_v("\u25FB", "[ ]"), ae = dist_v("\u25AA", "\u2022"), U = dist_v("\u2500", "-"), ue = dist_v("\u256E", "+"), ce = dist_v("\u251C", "+"), le = dist_v("\u256F", "+"), dist_H = dist_v("\u25CF", "\u2022"), dist_K = dist_v("\u25C6", "*"), dist_q = dist_v("\u25B2", "!"), dist_X = dist_v("\u25A0", "x"), dist_E = (t)=>{
|
|
1151
|
-
switch(t){
|
|
1152
|
-
case "initial":
|
|
1153
|
-
case "active":
|
|
1154
|
-
return picocolors.cyan(ne);
|
|
1155
|
-
case "cancel":
|
|
1156
|
-
return picocolors.red(G);
|
|
1157
|
-
case "error":
|
|
1158
|
-
return picocolors.yellow(dist_F);
|
|
1159
|
-
case "submit":
|
|
1160
|
-
return picocolors.green(dist_O);
|
|
1161
|
-
}
|
|
1162
|
-
}, dist_j = (t)=>{
|
|
1163
|
-
const { cursor: i, options: r, style: s } = t, n = t.output ?? process.stdout, a = n instanceof external_node_tty_.WriteStream && void 0 !== n.rows ? n.rows : 10, l = picocolors.dim("..."), c = t.maxItems ?? Number.POSITIVE_INFINITY, u = Math.max(a - 4, 0), $ = Math.min(u, Math.max(c, 5));
|
|
1164
|
-
let m = 0;
|
|
1165
|
-
i >= m + $ - 3 ? m = Math.max(Math.min(i - $ + 3, r.length - $), 0) : i < m + 2 && (m = Math.max(i - 2, 0));
|
|
1166
|
-
const h = $ < r.length && m > 0, g = $ < r.length && m + $ < r.length;
|
|
1167
|
-
return r.slice(m, m + $).map((p, d, y)=>{
|
|
1168
|
-
const w = 0 === d && h, b = d === y.length - 1 && g;
|
|
1169
|
-
return w || b ? l : s(p, d + m === i);
|
|
1170
|
-
});
|
|
1171
|
-
};
|
|
1172
|
-
function $e(t) {
|
|
1173
|
-
return t.label ?? String(t.value ?? "");
|
|
1174
|
-
}
|
|
1175
|
-
function pe(t, i) {
|
|
1176
|
-
if (!t) return !0;
|
|
1177
|
-
const r = (i.label ?? String(i.value ?? "")).toLowerCase(), s = (i.hint ?? "").toLowerCase(), n = String(i.value).toLowerCase(), a = t.toLowerCase();
|
|
1178
|
-
return r.includes(a) || s.includes(a) || n.includes(a);
|
|
1179
|
-
}
|
|
1180
|
-
function Le(t, i) {
|
|
1181
|
-
const r = [];
|
|
1182
|
-
for (const s of i)t.includes(s.value) && r.push(s);
|
|
1183
|
-
return r;
|
|
1184
|
-
}
|
|
1185
|
-
const me = (t)=>new nD({
|
|
1186
|
-
options: t.options,
|
|
1187
|
-
initialValue: t.initialValue ? [
|
|
1188
|
-
t.initialValue
|
|
1189
|
-
] : void 0,
|
|
1190
|
-
initialUserInput: t.initialUserInput,
|
|
1191
|
-
filter: (i, r)=>pe(i, r),
|
|
1192
|
-
signal: t.signal,
|
|
1193
|
-
input: t.input,
|
|
1194
|
-
output: t.output,
|
|
1195
|
-
validate: t.validate,
|
|
1196
|
-
render () {
|
|
1197
|
-
const i = `${picocolors.gray(dist_o)}
|
|
1198
|
-
${dist_E(this.state)} ${t.message}
|
|
1199
|
-
`, r = this.userInput, s = String(this.value ?? ""), n = this.options, a = t.placeholder, l = "" === s && void 0 !== a;
|
|
1200
|
-
switch(this.state){
|
|
1201
|
-
case "submit":
|
|
1202
|
-
{
|
|
1203
|
-
const c = Le(this.selectedValues, n), u = c.length > 0 ? c.map($e).join(", ") : "";
|
|
1204
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.dim(u)}`;
|
|
1205
|
-
}
|
|
1206
|
-
case "cancel":
|
|
1207
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.strikethrough(picocolors.dim(r))}`;
|
|
1208
|
-
default:
|
|
1209
|
-
{
|
|
1210
|
-
const c = this.isNavigating || l ? picocolors.dim(l ? a : r) : this.userInputWithCursor, u = this.filteredOptions.length !== n.length ? picocolors.dim(` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", $ = 0 === this.filteredOptions.length ? [] : dist_j({
|
|
1211
|
-
cursor: this.cursor,
|
|
1212
|
-
options: this.filteredOptions,
|
|
1213
|
-
style: (p, d)=>{
|
|
1214
|
-
const y = $e(p), w = p.hint && p.value === this.focusedValue ? picocolors.dim(` (${p.hint})`) : "";
|
|
1215
|
-
return d ? `${picocolors.green(dist_P)} ${y}${w}` : `${picocolors.dim(dist_L)} ${picocolors.dim(y)}${w}`;
|
|
1216
|
-
},
|
|
1217
|
-
maxItems: t.maxItems,
|
|
1218
|
-
output: t.output
|
|
1219
|
-
}), m = [
|
|
1220
|
-
`${picocolors.dim("\u2191/\u2193")} to select`,
|
|
1221
|
-
`${picocolors.dim("Enter:")} confirm`,
|
|
1222
|
-
`${picocolors.dim("Type:")} to search`
|
|
1223
|
-
], h = 0 === this.filteredOptions.length && r ? [
|
|
1224
|
-
`${picocolors.cyan(dist_o)} ${picocolors.yellow("No matches found")}`
|
|
1225
|
-
] : [], g = "error" === this.state ? [
|
|
1226
|
-
`${picocolors.yellow(dist_o)} ${picocolors.yellow(this.error)}`
|
|
1227
|
-
] : [];
|
|
1228
|
-
return [
|
|
1229
|
-
i,
|
|
1230
|
-
`${picocolors.cyan(dist_o)} ${picocolors.dim("Search:")} ${c}${u}`,
|
|
1231
|
-
...h,
|
|
1232
|
-
...g,
|
|
1233
|
-
...$.map((p)=>`${picocolors.cyan(dist_o)} ${p}`),
|
|
1234
|
-
`${picocolors.cyan(dist_o)} ${picocolors.dim(m.join(" \u2022 "))}`,
|
|
1235
|
-
`${picocolors.cyan(f)}`
|
|
1236
|
-
].join(`
|
|
1237
|
-
`);
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
}).prompt(), Ne = (t)=>{
|
|
1242
|
-
const i = (s, n, a, l)=>{
|
|
1243
|
-
const c = a.includes(s.value), u = s.label ?? String(s.value ?? ""), $ = s.hint && void 0 !== l && s.value === l ? picocolors.dim(` (${s.hint})`) : "", m = c ? picocolors.green(dist_x) : picocolors.dim(dist_B);
|
|
1244
|
-
return n ? `${m} ${u}${$}` : `${m} ${picocolors.dim(u)}`;
|
|
1245
|
-
}, r = new nD({
|
|
1246
|
-
options: t.options,
|
|
1247
|
-
multiple: !0,
|
|
1248
|
-
filter: (s, n)=>pe(s, n),
|
|
1249
|
-
validate: ()=>{
|
|
1250
|
-
if (t.required && 0 === r.selectedValues.length) return "Please select at least one item";
|
|
1251
|
-
},
|
|
1252
|
-
initialValue: t.initialValues,
|
|
1253
|
-
signal: t.signal,
|
|
1254
|
-
input: t.input,
|
|
1255
|
-
output: t.output,
|
|
1256
|
-
render () {
|
|
1257
|
-
const s = `${picocolors.gray(dist_o)}
|
|
1258
|
-
${dist_E(this.state)} ${t.message}
|
|
1259
|
-
`, n = this.userInput, a = t.placeholder, l = "" === n && void 0 !== a, c = this.isNavigating || l ? picocolors.dim(l ? a : n) : this.userInputWithCursor, u = this.options, $ = this.filteredOptions.length !== u.length ? picocolors.dim(` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "";
|
|
1260
|
-
switch(this.state){
|
|
1261
|
-
case "submit":
|
|
1262
|
-
return `${s}${picocolors.gray(dist_o)} ${picocolors.dim(`${this.selectedValues.length} items selected`)}`;
|
|
1263
|
-
case "cancel":
|
|
1264
|
-
return `${s}${picocolors.gray(dist_o)} ${picocolors.strikethrough(picocolors.dim(n))}`;
|
|
1265
|
-
default:
|
|
1266
|
-
{
|
|
1267
|
-
const m = [
|
|
1268
|
-
`${picocolors.dim("\u2191/\u2193")} to navigate`,
|
|
1269
|
-
`${picocolors.dim("Space:")} select`,
|
|
1270
|
-
`${picocolors.dim("Enter:")} confirm`,
|
|
1271
|
-
`${picocolors.dim("Type:")} to search`
|
|
1272
|
-
], h = 0 === this.filteredOptions.length && n ? [
|
|
1273
|
-
`${picocolors.cyan(dist_o)} ${picocolors.yellow("No matches found")}`
|
|
1274
|
-
] : [], g = "error" === this.state ? [
|
|
1275
|
-
`${picocolors.cyan(dist_o)} ${picocolors.yellow(this.error)}`
|
|
1276
|
-
] : [], p = dist_j({
|
|
1277
|
-
cursor: this.cursor,
|
|
1278
|
-
options: this.filteredOptions,
|
|
1279
|
-
style: (d, y)=>i(d, y, this.selectedValues, this.focusedValue),
|
|
1280
|
-
maxItems: t.maxItems,
|
|
1281
|
-
output: t.output
|
|
1282
|
-
});
|
|
1283
|
-
return [
|
|
1284
|
-
s,
|
|
1285
|
-
`${picocolors.cyan(dist_o)} ${picocolors.dim("Search:")} ${c}${$}`,
|
|
1286
|
-
...h,
|
|
1287
|
-
...g,
|
|
1288
|
-
...p.map((d)=>`${picocolors.cyan(dist_o)} ${d}`),
|
|
1289
|
-
`${picocolors.cyan(dist_o)} ${picocolors.dim(m.join(" \u2022 "))}`,
|
|
1290
|
-
`${picocolors.cyan(f)}`
|
|
1291
|
-
].join(`
|
|
1292
|
-
`);
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
});
|
|
1297
|
-
return r.prompt();
|
|
1298
|
-
}, ke = (t)=>{
|
|
1299
|
-
const i = t.active ?? "Yes", r = t.inactive ?? "No";
|
|
1300
|
-
return new Wu({
|
|
1301
|
-
active: i,
|
|
1302
|
-
inactive: r,
|
|
1303
|
-
signal: t.signal,
|
|
1304
|
-
input: t.input,
|
|
1305
|
-
output: t.output,
|
|
1306
|
-
initialValue: t.initialValue ?? !0,
|
|
1307
|
-
render () {
|
|
1308
|
-
const s = `${picocolors.gray(dist_o)}
|
|
1309
|
-
${dist_E(this.state)} ${t.message}
|
|
1310
|
-
`, n = this.value ? i : r;
|
|
1311
|
-
switch(this.state){
|
|
1312
|
-
case "submit":
|
|
1313
|
-
return `${s}${picocolors.gray(dist_o)} ${picocolors.dim(n)}`;
|
|
1314
|
-
case "cancel":
|
|
1315
|
-
return `${s}${picocolors.gray(dist_o)} ${picocolors.strikethrough(picocolors.dim(n))}
|
|
1316
|
-
${picocolors.gray(dist_o)}`;
|
|
1317
|
-
default:
|
|
1318
|
-
return `${s}${picocolors.cyan(dist_o)} ${this.value ? `${picocolors.green(dist_P)} ${i}` : `${picocolors.dim(dist_L)} ${picocolors.dim(i)}`} ${picocolors.dim("/")} ${this.value ? `${picocolors.dim(dist_L)} ${picocolors.dim(r)}` : `${picocolors.green(dist_P)} ${r}`}
|
|
1319
|
-
${picocolors.cyan(f)}
|
|
1320
|
-
`;
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
}).prompt();
|
|
1324
|
-
}, Be = (t)=>{
|
|
1325
|
-
const { selectableGroups: i = !0, groupSpacing: r = 0 } = t, s = (a, l, c = [])=>{
|
|
1326
|
-
const u = a.label ?? String(a.value), $ = "string" == typeof a.group, m = $ && (c[c.indexOf(a) + 1] ?? {
|
|
1327
|
-
group: !0
|
|
1328
|
-
}), h = $ && !0 === m.group, g = $ ? i ? `${h ? f : dist_o} ` : " " : "", p = r > 0 && !$ ? `
|
|
1329
|
-
${picocolors.cyan(dist_o)} `.repeat(r) : "";
|
|
1330
|
-
if ("active" === l) return `${p}${picocolors.dim(g)}${picocolors.cyan(dist_k)} ${u} ${a.hint ? picocolors.dim(`(${a.hint})`) : ""}`;
|
|
1331
|
-
if ("group-active" === l) return `${p}${g}${picocolors.cyan(dist_k)} ${picocolors.dim(u)}`;
|
|
1332
|
-
if ("group-active-selected" === l) return `${p}${g}${picocolors.green(dist_x)} ${picocolors.dim(u)}`;
|
|
1333
|
-
if ("selected" === l) {
|
|
1334
|
-
const y = $ || i ? picocolors.green(dist_x) : "";
|
|
1335
|
-
return `${p}${picocolors.dim(g)}${y} ${picocolors.dim(u)} ${a.hint ? picocolors.dim(`(${a.hint})`) : ""}`;
|
|
1336
|
-
}
|
|
1337
|
-
if ("cancelled" === l) return `${picocolors.strikethrough(picocolors.dim(u))}`;
|
|
1338
|
-
if ("active-selected" === l) return `${p}${picocolors.dim(g)}${picocolors.green(dist_x)} ${u} ${a.hint ? picocolors.dim(`(${a.hint})`) : ""}`;
|
|
1339
|
-
if ("submitted" === l) return `${picocolors.dim(u)}`;
|
|
1340
|
-
const d = $ || i ? picocolors.dim(dist_B) : "";
|
|
1341
|
-
return `${p}${picocolors.dim(g)}${d} ${picocolors.dim(u)}`;
|
|
1342
|
-
}, n = t.required ?? !0;
|
|
1343
|
-
return new Ku({
|
|
1344
|
-
options: t.options,
|
|
1345
|
-
signal: t.signal,
|
|
1346
|
-
input: t.input,
|
|
1347
|
-
output: t.output,
|
|
1348
|
-
initialValues: t.initialValues,
|
|
1349
|
-
required: n,
|
|
1350
|
-
cursorAt: t.cursorAt,
|
|
1351
|
-
selectableGroups: i,
|
|
1352
|
-
validate (a) {
|
|
1353
|
-
if (n && (void 0 === a || 0 === a.length)) return `Please select at least one option.
|
|
1354
|
-
${picocolors.reset(picocolors.dim(`Press ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" space ")))} to select, ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" enter ")))} to submit`))}`;
|
|
1355
|
-
},
|
|
1356
|
-
render () {
|
|
1357
|
-
const a = `${picocolors.gray(dist_o)}
|
|
1358
|
-
${dist_E(this.state)} ${t.message}
|
|
1359
|
-
`, l = this.value ?? [];
|
|
1360
|
-
switch(this.state){
|
|
1361
|
-
case "submit":
|
|
1362
|
-
return `${a}${picocolors.gray(dist_o)} ${this.options.filter(({ value: c })=>l.includes(c)).map((c)=>s(c, "submitted")).join(picocolors.dim(", "))}`;
|
|
1363
|
-
case "cancel":
|
|
1364
|
-
{
|
|
1365
|
-
const c = this.options.filter(({ value: u })=>l.includes(u)).map((u)=>s(u, "cancelled")).join(picocolors.dim(", "));
|
|
1366
|
-
return `${a}${picocolors.gray(dist_o)} ${c.trim() ? `${c}
|
|
1367
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1368
|
-
}
|
|
1369
|
-
case "error":
|
|
1370
|
-
{
|
|
1371
|
-
const c = this.error.split(`
|
|
1372
|
-
`).map((u, $)=>0 === $ ? `${picocolors.yellow(f)} ${picocolors.yellow(u)}` : ` ${u}`).join(`
|
|
1373
|
-
`);
|
|
1374
|
-
return `${a}${picocolors.yellow(dist_o)} ${this.options.map((u, $, m)=>{
|
|
1375
|
-
const h = l.includes(u.value) || !0 === u.group && this.isGroupSelected(`${u.value}`), g = $ === this.cursor;
|
|
1376
|
-
return g || "string" != typeof u.group || this.options[this.cursor].value !== u.group ? g && h ? s(u, "active-selected", m) : h ? s(u, "selected", m) : s(u, g ? "active" : "inactive", m) : s(u, h ? "group-active-selected" : "group-active", m);
|
|
1377
|
-
}).join(`
|
|
1378
|
-
${picocolors.yellow(dist_o)} `)}
|
|
1379
|
-
${c}
|
|
1380
|
-
`;
|
|
1381
|
-
}
|
|
1382
|
-
default:
|
|
1383
|
-
return `${a}${picocolors.cyan(dist_o)} ${this.options.map((c, u, $)=>{
|
|
1384
|
-
const m = l.includes(c.value) || !0 === c.group && this.isGroupSelected(`${c.value}`), h = u === this.cursor;
|
|
1385
|
-
return h || "string" != typeof c.group || this.options[this.cursor].value !== c.group ? h && m ? s(c, "active-selected", $) : m ? s(c, "selected", $) : s(c, h ? "active" : "inactive", $) : s(c, m ? "group-active-selected" : "group-active", $);
|
|
1386
|
-
}).join(`
|
|
1387
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1388
|
-
${picocolors.cyan(f)}
|
|
1389
|
-
`;
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
}).prompt();
|
|
1393
|
-
}, We = async (t, i)=>{
|
|
1394
|
-
const r = {}, s = Object.keys(t);
|
|
1395
|
-
for (const n of s){
|
|
1396
|
-
const a = t[n], l = await a({
|
|
1397
|
-
results: r
|
|
1398
|
-
})?.catch((c)=>{
|
|
1399
|
-
throw c;
|
|
1400
|
-
});
|
|
1401
|
-
if ("function" == typeof i?.onCancel && Vu(l)) {
|
|
1402
|
-
r[n] = "canceled", i.onCancel({
|
|
1403
|
-
results: r
|
|
1404
|
-
});
|
|
1405
|
-
continue;
|
|
1406
|
-
}
|
|
1407
|
-
r[n] = l;
|
|
1408
|
-
}
|
|
1409
|
-
return r;
|
|
1410
|
-
}, dist_T = {
|
|
1411
|
-
message: (t = [], { symbol: i = picocolors.gray(dist_o), secondarySymbol: r = picocolors.gray(dist_o), output: s = process.stdout, spacing: n = 1 } = {})=>{
|
|
1412
|
-
const a = [];
|
|
1413
|
-
for(let c = 0; c < n; c++)a.push(`${r}`);
|
|
1414
|
-
const l = Array.isArray(t) ? t : t.split(`
|
|
1415
|
-
`);
|
|
1416
|
-
if (l.length > 0) {
|
|
1417
|
-
const [c, ...u] = l;
|
|
1418
|
-
c.length > 0 ? a.push(`${i} ${c}`) : a.push(i);
|
|
1419
|
-
for (const $ of u)$.length > 0 ? a.push(`${r} ${$}`) : a.push(r);
|
|
1420
|
-
}
|
|
1421
|
-
s.write(`${a.join(`
|
|
1422
|
-
`)}
|
|
1423
|
-
`);
|
|
1424
|
-
},
|
|
1425
|
-
info: (t, i)=>{
|
|
1426
|
-
dist_T.message(t, {
|
|
1427
|
-
...i,
|
|
1428
|
-
symbol: picocolors.blue(dist_H)
|
|
1429
|
-
});
|
|
1430
|
-
},
|
|
1431
|
-
success: (t, i)=>{
|
|
1432
|
-
dist_T.message(t, {
|
|
1433
|
-
...i,
|
|
1434
|
-
symbol: picocolors.green(dist_K)
|
|
1435
|
-
});
|
|
1436
|
-
},
|
|
1437
|
-
step: (t, i)=>{
|
|
1438
|
-
dist_T.message(t, {
|
|
1439
|
-
...i,
|
|
1440
|
-
symbol: picocolors.green(dist_O)
|
|
1441
|
-
});
|
|
1442
|
-
},
|
|
1443
|
-
warn: (t, i)=>{
|
|
1444
|
-
dist_T.message(t, {
|
|
1445
|
-
...i,
|
|
1446
|
-
symbol: picocolors.yellow(dist_q)
|
|
1447
|
-
});
|
|
1448
|
-
},
|
|
1449
|
-
warning: (t, i)=>{
|
|
1450
|
-
dist_T.warn(t, i);
|
|
1451
|
-
},
|
|
1452
|
-
error: (t, i)=>{
|
|
1453
|
-
dist_T.message(t, {
|
|
1454
|
-
...i,
|
|
1455
|
-
symbol: picocolors.red(dist_X)
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
}, De = (t = "", i)=>{
|
|
1459
|
-
(i?.output ?? process.stdout).write(`${picocolors.gray(f)} ${picocolors.red(t)}
|
|
1460
|
-
|
|
1461
|
-
`);
|
|
1462
|
-
}, Ge = (t = "", i)=>{
|
|
1463
|
-
(i?.output ?? process.stdout).write(`${picocolors.gray(oe)} ${t}
|
|
1464
|
-
`);
|
|
1465
|
-
}, Fe = (t = "", i)=>{
|
|
1466
|
-
(i?.output ?? process.stdout).write(`${picocolors.gray(dist_o)}
|
|
1467
|
-
${picocolors.gray(f)} ${t}
|
|
1468
|
-
|
|
1469
|
-
`);
|
|
1470
|
-
}, Ue = (t)=>{
|
|
1471
|
-
const i = (s, n)=>{
|
|
1472
|
-
const a = s.label ?? String(s.value);
|
|
1473
|
-
return "active" === n ? `${picocolors.cyan(dist_k)} ${a} ${s.hint ? picocolors.dim(`(${s.hint})`) : ""}` : "selected" === n ? `${picocolors.green(dist_x)} ${picocolors.dim(a)} ${s.hint ? picocolors.dim(`(${s.hint})`) : ""}` : "cancelled" === n ? `${picocolors.strikethrough(picocolors.dim(a))}` : "active-selected" === n ? `${picocolors.green(dist_x)} ${a} ${s.hint ? picocolors.dim(`(${s.hint})`) : ""}` : "submitted" === n ? `${picocolors.dim(a)}` : `${picocolors.dim(dist_B)} ${picocolors.dim(a)}`;
|
|
1474
|
-
}, r = t.required ?? !0;
|
|
1475
|
-
return new Uu({
|
|
1476
|
-
options: t.options,
|
|
1477
|
-
signal: t.signal,
|
|
1478
|
-
input: t.input,
|
|
1479
|
-
output: t.output,
|
|
1480
|
-
initialValues: t.initialValues,
|
|
1481
|
-
required: r,
|
|
1482
|
-
cursorAt: t.cursorAt,
|
|
1483
|
-
validate (s) {
|
|
1484
|
-
if (r && (void 0 === s || 0 === s.length)) return `Please select at least one option.
|
|
1485
|
-
${picocolors.reset(picocolors.dim(`Press ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" space ")))} to select, ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" enter ")))} to submit`))}`;
|
|
1486
|
-
},
|
|
1487
|
-
render () {
|
|
1488
|
-
const s = `${picocolors.gray(dist_o)}
|
|
1489
|
-
${dist_E(this.state)} ${t.message}
|
|
1490
|
-
`, n = this.value ?? [], a = (l, c)=>{
|
|
1491
|
-
const u = n.includes(l.value);
|
|
1492
|
-
return c && u ? i(l, "active-selected") : u ? i(l, "selected") : i(l, c ? "active" : "inactive");
|
|
1493
|
-
};
|
|
1494
|
-
switch(this.state){
|
|
1495
|
-
case "submit":
|
|
1496
|
-
return `${s}${picocolors.gray(dist_o)} ${this.options.filter(({ value: l })=>n.includes(l)).map((l)=>i(l, "submitted")).join(picocolors.dim(", ")) || picocolors.dim("none")}`;
|
|
1497
|
-
case "cancel":
|
|
1498
|
-
{
|
|
1499
|
-
const l = this.options.filter(({ value: c })=>n.includes(c)).map((c)=>i(c, "cancelled")).join(picocolors.dim(", "));
|
|
1500
|
-
return `${s}${picocolors.gray(dist_o)} ${l.trim() ? `${l}
|
|
1501
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1502
|
-
}
|
|
1503
|
-
case "error":
|
|
1504
|
-
{
|
|
1505
|
-
const l = this.error.split(`
|
|
1506
|
-
`).map((c, u)=>0 === u ? `${picocolors.yellow(f)} ${picocolors.yellow(c)}` : ` ${c}`).join(`
|
|
1507
|
-
`);
|
|
1508
|
-
return `${s + picocolors.yellow(dist_o)} ${dist_j({
|
|
1509
|
-
output: t.output,
|
|
1510
|
-
options: this.options,
|
|
1511
|
-
cursor: this.cursor,
|
|
1512
|
-
maxItems: t.maxItems,
|
|
1513
|
-
style: a
|
|
1514
|
-
}).join(`
|
|
1515
|
-
${picocolors.yellow(dist_o)} `)}
|
|
1516
|
-
${l}
|
|
1517
|
-
`;
|
|
1518
|
-
}
|
|
1519
|
-
default:
|
|
1520
|
-
return `${s}${picocolors.cyan(dist_o)} ${dist_j({
|
|
1521
|
-
output: t.output,
|
|
1522
|
-
options: this.options,
|
|
1523
|
-
cursor: this.cursor,
|
|
1524
|
-
maxItems: t.maxItems,
|
|
1525
|
-
style: a
|
|
1526
|
-
}).join(`
|
|
1527
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1528
|
-
${picocolors.cyan(f)}
|
|
1529
|
-
`;
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
}).prompt();
|
|
1533
|
-
}, He = (t)=>picocolors.dim(t), Ke = (t = "", i = "", r)=>{
|
|
1534
|
-
const s = r?.format ?? He, n = [
|
|
1535
|
-
"",
|
|
1536
|
-
...t.split(`
|
|
1537
|
-
`).map(s),
|
|
1538
|
-
""
|
|
1539
|
-
], a = (0, external_node_util_.stripVTControlCharacters)(i).length, l = r?.output ?? process.stdout, c = Math.max(n.reduce(($, m)=>{
|
|
1540
|
-
const h = (0, external_node_util_.stripVTControlCharacters)(m);
|
|
1541
|
-
return h.length > $ ? h.length : $;
|
|
1542
|
-
}, 0), a) + 2, u = n.map(($)=>`${picocolors.gray(dist_o)} ${$}${" ".repeat(c - (0, external_node_util_.stripVTControlCharacters)($).length)}${picocolors.gray(dist_o)}`).join(`
|
|
1543
|
-
`);
|
|
1544
|
-
l.write(`${picocolors.gray(dist_o)}
|
|
1545
|
-
${picocolors.green(dist_O)} ${picocolors.reset(i)} ${picocolors.gray(U.repeat(Math.max(c - a - 1, 1)) + ue)}
|
|
1546
|
-
${u}
|
|
1547
|
-
${picocolors.gray(ce + U.repeat(c + 2) + le)}
|
|
1548
|
-
`);
|
|
1549
|
-
}, qe = (t)=>new Hu({
|
|
1550
|
-
validate: t.validate,
|
|
1551
|
-
mask: t.mask ?? ae,
|
|
1552
|
-
signal: t.signal,
|
|
1553
|
-
input: t.input,
|
|
1554
|
-
output: t.output,
|
|
1555
|
-
render () {
|
|
1556
|
-
const i = `${picocolors.gray(dist_o)}
|
|
1557
|
-
${dist_E(this.state)} ${t.message}
|
|
1558
|
-
`, r = this.userInputWithCursor, s = this.masked;
|
|
1559
|
-
switch(this.state){
|
|
1560
|
-
case "error":
|
|
1561
|
-
return `${i.trim()}
|
|
1562
|
-
${picocolors.yellow(dist_o)} ${s}
|
|
1563
|
-
${picocolors.yellow(f)} ${picocolors.yellow(this.error)}
|
|
1564
|
-
`;
|
|
1565
|
-
case "submit":
|
|
1566
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.dim(s)}`;
|
|
1567
|
-
case "cancel":
|
|
1568
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.strikethrough(picocolors.dim(s))}${s ? `
|
|
1569
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1570
|
-
default:
|
|
1571
|
-
return `${i}${picocolors.cyan(dist_o)} ${r}
|
|
1572
|
-
${picocolors.cyan(f)}
|
|
1573
|
-
`;
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
}).prompt(), Xe = (t)=>{
|
|
1577
|
-
const i = t.validate;
|
|
1578
|
-
return me({
|
|
1579
|
-
...t,
|
|
1580
|
-
initialUserInput: t.initialValue ?? t.root ?? process.cwd(),
|
|
1581
|
-
maxItems: 5,
|
|
1582
|
-
validate (r) {
|
|
1583
|
-
if (!Array.isArray(r)) {
|
|
1584
|
-
if (!r) return "Please select a path";
|
|
1585
|
-
if (i) return i(r);
|
|
1586
|
-
}
|
|
1587
|
-
},
|
|
1588
|
-
options () {
|
|
1589
|
-
const r = this.userInput;
|
|
1590
|
-
if ("" === r) return [];
|
|
1591
|
-
try {
|
|
1592
|
-
let s;
|
|
1593
|
-
return (0, external_node_fs_.existsSync)(r) ? (0, external_node_fs_.lstatSync)(r).isDirectory() ? s = r : s = (0, external_node_path_.dirname)(r) : s = (0, external_node_path_.dirname)(r), (0, external_node_fs_.readdirSync)(s).map((n)=>{
|
|
1594
|
-
const a = (0, external_node_path_.join)(s, n), l = (0, external_node_fs_.lstatSync)(a);
|
|
1595
|
-
return {
|
|
1596
|
-
name: n,
|
|
1597
|
-
path: a,
|
|
1598
|
-
isDirectory: l.isDirectory()
|
|
1599
|
-
};
|
|
1600
|
-
}).filter(({ path: n, isDirectory: a })=>n.startsWith(r) && (t.directory || !a)).map((n)=>({
|
|
1601
|
-
value: n.path
|
|
1602
|
-
}));
|
|
1603
|
-
} catch {
|
|
1604
|
-
return [];
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
});
|
|
1608
|
-
}, dist_J = ({ indicator: t = "dots", onCancel: i, output: r = process.stdout, cancelMessage: s, errorMessage: n, frames: a = dist_N ? [
|
|
1609
|
-
"\u25D2",
|
|
1610
|
-
"\u25D0",
|
|
1611
|
-
"\u25D3",
|
|
1612
|
-
"\u25D1"
|
|
1613
|
-
] : [
|
|
1614
|
-
"\u2022",
|
|
1615
|
-
"o",
|
|
1616
|
-
"O",
|
|
1617
|
-
"0"
|
|
1618
|
-
], delay: l = dist_N ? 80 : 120, signal: c } = {})=>{
|
|
1619
|
-
const u = dist_D();
|
|
1620
|
-
let $, m, h = !1, g = !1, p = "", d, y = performance.now();
|
|
1621
|
-
const w = (S)=>{
|
|
1622
|
-
const I = S > 1 ? n ?? dist_c.messages.error : s ?? dist_c.messages.cancel;
|
|
1623
|
-
g = 1 === S, h && (Z(I, S), g && "function" == typeof i && i());
|
|
1624
|
-
}, b = ()=>w(2), M = ()=>w(1), ge = ()=>{
|
|
1625
|
-
process.on("uncaughtExceptionMonitor", b), process.on("unhandledRejection", b), process.on("SIGINT", M), process.on("SIGTERM", M), process.on("exit", w), c && c.addEventListener("abort", M);
|
|
1626
|
-
}, ye = ()=>{
|
|
1627
|
-
process.removeListener("uncaughtExceptionMonitor", b), process.removeListener("unhandledRejection", b), process.removeListener("SIGINT", M), process.removeListener("SIGTERM", M), process.removeListener("exit", w), c && c.removeEventListener("abort", M);
|
|
1628
|
-
}, Y = ()=>{
|
|
1629
|
-
if (void 0 === d) return;
|
|
1630
|
-
u && r.write(`
|
|
1631
|
-
`);
|
|
1632
|
-
const S = d.split(`
|
|
1633
|
-
`);
|
|
1634
|
-
r.write(src.cursor.move(-999, S.length - 1)), r.write(src.erase.down(S.length));
|
|
1635
|
-
}, z = (S)=>S.replace(/\.+$/, ""), Q = (S)=>{
|
|
1636
|
-
const I = (performance.now() - S) / 1e3, _ = Math.floor(I / 60), A = Math.floor(I % 60);
|
|
1637
|
-
return _ > 0 ? `[${_}m ${A}s]` : `[${A}s]`;
|
|
1638
|
-
}, ve = (S = "")=>{
|
|
1639
|
-
h = !0, $ = Mu({
|
|
1640
|
-
output: r
|
|
1641
|
-
}), p = z(S), y = performance.now(), r.write(`${picocolors.gray(dist_o)}
|
|
1642
|
-
`);
|
|
1643
|
-
let I = 0, _ = 0;
|
|
1644
|
-
ge(), m = setInterval(()=>{
|
|
1645
|
-
if (u && p === d) return;
|
|
1646
|
-
Y(), d = p;
|
|
1647
|
-
const A = picocolors.magenta(a[I]);
|
|
1648
|
-
if (u) r.write(`${A} ${p}...`);
|
|
1649
|
-
else if ("timer" === t) r.write(`${A} ${p} ${Q(y)}`);
|
|
1650
|
-
else {
|
|
1651
|
-
const fe = ".".repeat(Math.floor(_)).slice(0, 3);
|
|
1652
|
-
r.write(`${A} ${p}${fe}`);
|
|
1653
|
-
}
|
|
1654
|
-
I = I + 1 < a.length ? I + 1 : 0, _ = _ < 4 ? _ + .125 : 0;
|
|
1655
|
-
}, l);
|
|
1656
|
-
}, Z = (S = "", I = 0)=>{
|
|
1657
|
-
h = !1, clearInterval(m), Y();
|
|
1658
|
-
const _ = 0 === I ? picocolors.green(dist_O) : 1 === I ? picocolors.red(G) : picocolors.red(dist_F);
|
|
1659
|
-
p = S ?? p, "timer" === t ? r.write(`${_} ${p} ${Q(y)}
|
|
1660
|
-
`) : r.write(`${_} ${p}
|
|
1661
|
-
`), ye(), $();
|
|
1662
|
-
};
|
|
1663
|
-
return {
|
|
1664
|
-
start: ve,
|
|
1665
|
-
stop: Z,
|
|
1666
|
-
message: (S = "")=>{
|
|
1667
|
-
p = z(S ?? p);
|
|
1668
|
-
},
|
|
1669
|
-
get isCancelled () {
|
|
1670
|
-
return g;
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
|
-
}, de = {
|
|
1674
|
-
light: dist_v("\u2500", "-"),
|
|
1675
|
-
heavy: dist_v("\u2501", "="),
|
|
1676
|
-
block: dist_v("\u2588", "#")
|
|
1677
|
-
};
|
|
1678
|
-
function Je({ style: t = "heavy", max: i = 100, size: r = 40, ...s } = {}) {
|
|
1679
|
-
const n = dist_J(s);
|
|
1680
|
-
let a = 0, l = "";
|
|
1681
|
-
const c = Math.max(1, i), u = Math.max(1, r), $ = (p)=>{
|
|
1682
|
-
switch(p){
|
|
1683
|
-
case "initial":
|
|
1684
|
-
case "active":
|
|
1685
|
-
return picocolors.magenta;
|
|
1686
|
-
case "error":
|
|
1687
|
-
case "cancel":
|
|
1688
|
-
return picocolors.red;
|
|
1689
|
-
case "submit":
|
|
1690
|
-
return picocolors.green;
|
|
1691
|
-
default:
|
|
1692
|
-
return picocolors.magenta;
|
|
1693
|
-
}
|
|
1694
|
-
}, m = (p, d)=>{
|
|
1695
|
-
const y = Math.floor(a / c * u);
|
|
1696
|
-
return `${$(p)(de[t].repeat(y))}${picocolors.dim(de[t].repeat(u - y))} ${d}`;
|
|
1697
|
-
}, h = (p = "")=>(l = p, n.start(m("initial", p))), g = (p = 1, d)=>{
|
|
1698
|
-
a = Math.min(c, p + a), n.message(m("active", d ?? l)), l = d ?? l;
|
|
1699
|
-
};
|
|
1700
|
-
return {
|
|
1701
|
-
start: h,
|
|
1702
|
-
stop: n.stop,
|
|
1703
|
-
advance: g,
|
|
1704
|
-
isCancelled: n.isCancelled,
|
|
1705
|
-
message: (p)=>g(0, p)
|
|
1706
|
-
};
|
|
1707
|
-
}
|
|
1708
|
-
const Ye = (t)=>{
|
|
1709
|
-
const i = (r, s = "inactive")=>{
|
|
1710
|
-
const n = r.label ?? String(r.value);
|
|
1711
|
-
return "selected" === s ? `${picocolors.dim(n)}` : "cancelled" === s ? `${picocolors.strikethrough(picocolors.dim(n))}` : "active" === s ? `${picocolors.bgCyan(picocolors.gray(` ${r.value} `))} ${n} ${r.hint ? picocolors.dim(`(${r.hint})`) : ""}` : `${picocolors.gray(picocolors.bgWhite(picocolors.inverse(` ${r.value} `)))} ${n} ${r.hint ? picocolors.dim(`(${r.hint})`) : ""}`;
|
|
1712
|
-
};
|
|
1713
|
-
return new tD({
|
|
1714
|
-
options: t.options,
|
|
1715
|
-
signal: t.signal,
|
|
1716
|
-
input: t.input,
|
|
1717
|
-
output: t.output,
|
|
1718
|
-
initialValue: t.initialValue,
|
|
1719
|
-
render () {
|
|
1720
|
-
const r = `${picocolors.gray(dist_o)}
|
|
1721
|
-
${dist_E(this.state)} ${t.message}
|
|
1722
|
-
`;
|
|
1723
|
-
switch(this.state){
|
|
1724
|
-
case "submit":
|
|
1725
|
-
return `${r}${picocolors.gray(dist_o)} ${i(this.options.find((s)=>s.value === this.value) ?? t.options[0], "selected")}`;
|
|
1726
|
-
case "cancel":
|
|
1727
|
-
return `${r}${picocolors.gray(dist_o)} ${i(this.options[0], "cancelled")}
|
|
1728
|
-
${picocolors.gray(dist_o)}`;
|
|
1729
|
-
default:
|
|
1730
|
-
return `${r}${picocolors.cyan(dist_o)} ${this.options.map((s, n)=>i(s, n === this.cursor ? "active" : "inactive")).join(`
|
|
1731
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1732
|
-
${picocolors.cyan(f)}
|
|
1733
|
-
`;
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
}).prompt();
|
|
1737
|
-
}, ze = (t)=>{
|
|
1738
|
-
const i = (r, s)=>{
|
|
1739
|
-
const n = r.label ?? String(r.value);
|
|
1740
|
-
switch(s){
|
|
1741
|
-
case "selected":
|
|
1742
|
-
return `${picocolors.dim(n)}`;
|
|
1743
|
-
case "active":
|
|
1744
|
-
return `${picocolors.green(dist_P)} ${n} ${r.hint ? picocolors.dim(`(${r.hint})`) : ""}`;
|
|
1745
|
-
case "cancelled":
|
|
1746
|
-
return `${picocolors.strikethrough(picocolors.dim(n))}`;
|
|
1747
|
-
default:
|
|
1748
|
-
return `${picocolors.dim(dist_L)} ${picocolors.dim(n)}`;
|
|
1749
|
-
}
|
|
1750
|
-
};
|
|
1751
|
-
return new Xu({
|
|
1752
|
-
options: t.options,
|
|
1753
|
-
signal: t.signal,
|
|
1754
|
-
input: t.input,
|
|
1755
|
-
output: t.output,
|
|
1756
|
-
initialValue: t.initialValue,
|
|
1757
|
-
render () {
|
|
1758
|
-
const r = `${picocolors.gray(dist_o)}
|
|
1759
|
-
${dist_E(this.state)} ${t.message}
|
|
1760
|
-
`;
|
|
1761
|
-
switch(this.state){
|
|
1762
|
-
case "submit":
|
|
1763
|
-
return `${r}${picocolors.gray(dist_o)} ${i(this.options[this.cursor], "selected")}`;
|
|
1764
|
-
case "cancel":
|
|
1765
|
-
return `${r}${picocolors.gray(dist_o)} ${i(this.options[this.cursor], "cancelled")}
|
|
1766
|
-
${picocolors.gray(dist_o)}`;
|
|
1767
|
-
default:
|
|
1768
|
-
return `${r}${picocolors.cyan(dist_o)} ${dist_j({
|
|
1769
|
-
output: t.output,
|
|
1770
|
-
cursor: this.cursor,
|
|
1771
|
-
options: this.options,
|
|
1772
|
-
maxItems: t.maxItems,
|
|
1773
|
-
style: (s, n)=>i(s, n ? "active" : "inactive")
|
|
1774
|
-
}).join(`
|
|
1775
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1776
|
-
${picocolors.cyan(f)}
|
|
1777
|
-
`;
|
|
1778
|
-
}
|
|
1779
|
-
}
|
|
1780
|
-
}).prompt();
|
|
1781
|
-
}, he = `${picocolors.gray(dist_o)} `, dist_R = {
|
|
1782
|
-
message: async (t, { symbol: i = picocolors.gray(dist_o) } = {})=>{
|
|
1783
|
-
process.stdout.write(`${picocolors.gray(dist_o)}
|
|
1784
|
-
${i} `);
|
|
1785
|
-
let r = 3;
|
|
1786
|
-
for await (let s of t){
|
|
1787
|
-
s = s.replace(/\n/g, `
|
|
1788
|
-
${he}`), s.includes(`
|
|
1789
|
-
`) && (r = 3 + (0, external_node_util_.stripVTControlCharacters)(s.slice(s.lastIndexOf(`
|
|
1790
|
-
`))).length);
|
|
1791
|
-
const n = (0, external_node_util_.stripVTControlCharacters)(s).length;
|
|
1792
|
-
r + n < process.stdout.columns ? (r += n, process.stdout.write(s)) : (process.stdout.write(`
|
|
1793
|
-
${he}${s.trimStart()}`), r = 3 + (0, external_node_util_.stripVTControlCharacters)(s.trimStart()).length);
|
|
1794
|
-
}
|
|
1795
|
-
process.stdout.write(`
|
|
1796
|
-
`);
|
|
1797
|
-
},
|
|
1798
|
-
info: (t)=>dist_R.message(t, {
|
|
1799
|
-
symbol: picocolors.blue(dist_H)
|
|
1800
|
-
}),
|
|
1801
|
-
success: (t)=>dist_R.message(t, {
|
|
1802
|
-
symbol: picocolors.green(dist_K)
|
|
1803
|
-
}),
|
|
1804
|
-
step: (t)=>dist_R.message(t, {
|
|
1805
|
-
symbol: picocolors.green(dist_O)
|
|
1806
|
-
}),
|
|
1807
|
-
warn: (t)=>dist_R.message(t, {
|
|
1808
|
-
symbol: picocolors.yellow(dist_q)
|
|
1809
|
-
}),
|
|
1810
|
-
warning: (t)=>dist_R.warn(t),
|
|
1811
|
-
error: (t)=>dist_R.message(t, {
|
|
1812
|
-
symbol: picocolors.red(dist_X)
|
|
1813
|
-
})
|
|
1814
|
-
}, Qe = async (t, i)=>{
|
|
1815
|
-
for (const r of t){
|
|
1816
|
-
if (!1 === r.enabled) continue;
|
|
1817
|
-
const s = dist_J(i);
|
|
1818
|
-
s.start(r.title);
|
|
1819
|
-
const n = await r.task(s.message);
|
|
1820
|
-
s.stop(n || r.title);
|
|
1821
|
-
}
|
|
1822
|
-
}, Ze = (t)=>{
|
|
1823
|
-
const i = t.output ?? process.stdout, r = Ou(i), s = picocolors.gray(dist_o), n = t.spacing ?? 1, a = 3, l = !0 === t.retainLog, c = dist_D();
|
|
1824
|
-
i.write(`${s}
|
|
1825
|
-
`), i.write(`${picocolors.green(dist_O)} ${t.title}
|
|
1826
|
-
`);
|
|
1827
|
-
for(let d = 0; d < n; d++)i.write(`${s}
|
|
1828
|
-
`);
|
|
1829
|
-
let u = "", $ = "", m = !1;
|
|
1830
|
-
const h = (d)=>{
|
|
1831
|
-
if (0 === u.length) return;
|
|
1832
|
-
const y = u.split(`
|
|
1833
|
-
`).reduce((w, b)=>"" === b ? w + 1 : w + Math.ceil((b.length + a) / r), 0) + 1 + (d ? n + 2 : 0);
|
|
1834
|
-
i.write(src.erase.lines(y));
|
|
1835
|
-
}, g = (d, y)=>{
|
|
1836
|
-
dist_T.message(d.split(`
|
|
1837
|
-
`).map(picocolors.dim), {
|
|
1838
|
-
output: i,
|
|
1839
|
-
secondarySymbol: s,
|
|
1840
|
-
symbol: s,
|
|
1841
|
-
spacing: y ?? n
|
|
1842
|
-
});
|
|
1843
|
-
}, p = ()=>{
|
|
1844
|
-
!0 === l && $.length > 0 ? g(`${$}
|
|
1845
|
-
${u}`) : g(u);
|
|
1846
|
-
};
|
|
1847
|
-
return {
|
|
1848
|
-
message (d, y) {
|
|
1849
|
-
if (h(!1), y?.raw === !0 && m || "" === u || (u += `
|
|
1850
|
-
`), u += d, m = y?.raw === !0, void 0 !== t.limit) {
|
|
1851
|
-
const w = u.split(`
|
|
1852
|
-
`), b = w.length - t.limit;
|
|
1853
|
-
if (b > 0) {
|
|
1854
|
-
const M = w.splice(0, b);
|
|
1855
|
-
l && ($ += ("" === $ ? "" : `
|
|
1856
|
-
`) + M.join(`
|
|
1857
|
-
`));
|
|
1858
|
-
}
|
|
1859
|
-
u = w.join(`
|
|
1860
|
-
`);
|
|
1861
|
-
}
|
|
1862
|
-
c || g(u, 0);
|
|
1863
|
-
},
|
|
1864
|
-
error (d, y) {
|
|
1865
|
-
h(!0), dist_T.error(d, {
|
|
1866
|
-
output: i,
|
|
1867
|
-
secondarySymbol: s,
|
|
1868
|
-
spacing: 1
|
|
1869
|
-
}), y?.showLog !== !1 && p(), u = $ = "";
|
|
1870
|
-
},
|
|
1871
|
-
success (d, y) {
|
|
1872
|
-
h(!0), dist_T.success(d, {
|
|
1873
|
-
output: i,
|
|
1874
|
-
secondarySymbol: s,
|
|
1875
|
-
spacing: 1
|
|
1876
|
-
}), y?.showLog === !0 && p(), u = $ = "";
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
}, et = (t)=>new eD({
|
|
1880
|
-
validate: t.validate,
|
|
1881
|
-
placeholder: t.placeholder,
|
|
1882
|
-
defaultValue: t.defaultValue,
|
|
1883
|
-
initialValue: t.initialValue,
|
|
1884
|
-
output: t.output,
|
|
1885
|
-
signal: t.signal,
|
|
1886
|
-
input: t.input,
|
|
1887
|
-
render () {
|
|
1888
|
-
const i = `${picocolors.gray(dist_o)}
|
|
1889
|
-
${dist_E(this.state)} ${t.message}
|
|
1890
|
-
`, r = t.placeholder ? picocolors.inverse(t.placeholder[0]) + picocolors.dim(t.placeholder.slice(1)) : picocolors.inverse(picocolors.hidden("_")), s = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
1891
|
-
switch(this.state){
|
|
1892
|
-
case "error":
|
|
1893
|
-
return `${i.trim()}
|
|
1894
|
-
${picocolors.yellow(dist_o)} ${s}
|
|
1895
|
-
${picocolors.yellow(f)} ${picocolors.yellow(this.error)}
|
|
1896
|
-
`;
|
|
1897
|
-
case "submit":
|
|
1898
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.dim(n)}`;
|
|
1899
|
-
case "cancel":
|
|
1900
|
-
return `${i}${picocolors.gray(dist_o)} ${picocolors.strikethrough(picocolors.dim(n))}${n.trim() ? `
|
|
1901
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1902
|
-
default:
|
|
1903
|
-
return `${i}${picocolors.cyan(dist_o)} ${s}
|
|
1904
|
-
${picocolors.cyan(f)}
|
|
1905
|
-
`;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
}).prompt();
|
|
1909
|
-
}
|
|
1910
|
-
};
|