create-rsbuild 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -2
- package/dist/index.js +780 -30
- package/package.json +11 -6
- package/CHANGELOG.md +0 -51
- package/modern.config.ts +0 -3
- package/tsconfig.json +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function main(): Promise<void>;
|
|
2
|
+
|
|
3
|
+
export { main };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
var require = createRequire(import.meta['url']);
|
|
4
|
+
|
|
3
5
|
var __create = Object.create;
|
|
4
6
|
var __defProp = Object.defineProperty;
|
|
5
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __require = /* @__PURE__ */ ((x4) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x4, {
|
|
12
|
+
get: (a2, b3) => (typeof require !== "undefined" ? require : a2)[b3]
|
|
13
|
+
}) : x4)(function(x4) {
|
|
14
|
+
if (typeof require !== "undefined")
|
|
15
|
+
return require.apply(this, arguments);
|
|
16
|
+
throw Error('Dynamic require of "' + x4 + '" is not supported');
|
|
17
|
+
});
|
|
18
|
+
var __esm = (fn, res) => function __init() {
|
|
19
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
20
|
+
};
|
|
21
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
22
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
23
|
+
};
|
|
9
24
|
var __copyProps = (to, from, except, desc) => {
|
|
10
25
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
26
|
for (let key of __getOwnPropNames(from))
|
|
@@ -22,13 +37,745 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
37
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
38
|
mod
|
|
24
39
|
));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
|
|
41
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.46.1_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js
|
|
42
|
+
import { fileURLToPath } from "url";
|
|
43
|
+
import path from "path";
|
|
44
|
+
var getFilename, getDirname, __dirname;
|
|
45
|
+
var init_esm = __esm({
|
|
46
|
+
"../../node_modules/.pnpm/@modern-js+module-tools@2.46.1_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
47
|
+
"use strict";
|
|
48
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
49
|
+
getDirname = () => path.dirname(getFilename());
|
|
50
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
55
|
+
var require_src = __commonJS({
|
|
56
|
+
"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
|
|
57
|
+
"use strict";
|
|
58
|
+
init_esm();
|
|
59
|
+
var ESC = "\x1B";
|
|
60
|
+
var CSI = `${ESC}[`;
|
|
61
|
+
var beep = "\x07";
|
|
62
|
+
var cursor = {
|
|
63
|
+
to(x4, y4) {
|
|
64
|
+
if (!y4)
|
|
65
|
+
return `${CSI}${x4 + 1}G`;
|
|
66
|
+
return `${CSI}${y4 + 1};${x4 + 1}H`;
|
|
67
|
+
},
|
|
68
|
+
move(x4, y4) {
|
|
69
|
+
let ret = "";
|
|
70
|
+
if (x4 < 0)
|
|
71
|
+
ret += `${CSI}${-x4}D`;
|
|
72
|
+
else if (x4 > 0)
|
|
73
|
+
ret += `${CSI}${x4}C`;
|
|
74
|
+
if (y4 < 0)
|
|
75
|
+
ret += `${CSI}${-y4}A`;
|
|
76
|
+
else if (y4 > 0)
|
|
77
|
+
ret += `${CSI}${y4}B`;
|
|
78
|
+
return ret;
|
|
79
|
+
},
|
|
80
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
81
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
82
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
83
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
84
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
85
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
86
|
+
left: `${CSI}G`,
|
|
87
|
+
hide: `${CSI}?25l`,
|
|
88
|
+
show: `${CSI}?25h`,
|
|
89
|
+
save: `${ESC}7`,
|
|
90
|
+
restore: `${ESC}8`
|
|
91
|
+
};
|
|
92
|
+
var scroll = {
|
|
93
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
94
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
95
|
+
};
|
|
96
|
+
var erase = {
|
|
97
|
+
screen: `${CSI}2J`,
|
|
98
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
99
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
100
|
+
line: `${CSI}2K`,
|
|
101
|
+
lineEnd: `${CSI}K`,
|
|
102
|
+
lineStart: `${CSI}1K`,
|
|
103
|
+
lines(count) {
|
|
104
|
+
let clear = "";
|
|
105
|
+
for (let i = 0; i < count; i++)
|
|
106
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
107
|
+
if (count)
|
|
108
|
+
clear += cursor.left;
|
|
109
|
+
return clear;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// ../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js
|
|
117
|
+
var require_picocolors = __commonJS({
|
|
118
|
+
"../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
119
|
+
"use strict";
|
|
120
|
+
init_esm();
|
|
121
|
+
var tty = __require("tty");
|
|
122
|
+
var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
|
|
123
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
124
|
+
let string = "" + input;
|
|
125
|
+
let index = string.indexOf(close, open.length);
|
|
126
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
127
|
+
};
|
|
128
|
+
var replaceClose = (string, close, replace, index) => {
|
|
129
|
+
let start = string.substring(0, index) + replace;
|
|
130
|
+
let end = string.substring(index + close.length);
|
|
131
|
+
let nextIndex = end.indexOf(close);
|
|
132
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
133
|
+
};
|
|
134
|
+
var createColors = (enabled = isColorSupported) => ({
|
|
135
|
+
isColorSupported: enabled,
|
|
136
|
+
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
137
|
+
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
138
|
+
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
139
|
+
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
140
|
+
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
141
|
+
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
142
|
+
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
143
|
+
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
144
|
+
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
145
|
+
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
146
|
+
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
147
|
+
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
148
|
+
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
149
|
+
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
150
|
+
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
151
|
+
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
152
|
+
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
153
|
+
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
154
|
+
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
155
|
+
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
156
|
+
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
157
|
+
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
158
|
+
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
159
|
+
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
160
|
+
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
161
|
+
});
|
|
162
|
+
module.exports = createColors();
|
|
163
|
+
module.exports.createColors = createColors;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// src/index.ts
|
|
168
|
+
init_esm();
|
|
169
|
+
import fs from "fs";
|
|
170
|
+
import path2 from "path";
|
|
171
|
+
|
|
172
|
+
// ../../node_modules/.pnpm/rslog@1.2.0/node_modules/rslog/dist/index.mjs
|
|
173
|
+
init_esm();
|
|
174
|
+
import R from "process";
|
|
175
|
+
import P from "os";
|
|
176
|
+
import M from "tty";
|
|
177
|
+
function c(r2, l2 = globalThis.Deno ? globalThis.Deno.args : R.argv) {
|
|
178
|
+
let i = r2.startsWith("-") ? "" : r2.length === 1 ? "-" : "--", n = l2.indexOf(i + r2), e2 = l2.indexOf("--");
|
|
179
|
+
return n !== -1 && (e2 === -1 || n < e2);
|
|
180
|
+
}
|
|
181
|
+
var { env: o } = R;
|
|
182
|
+
var E;
|
|
183
|
+
c("no-color") || c("no-colors") || c("color=false") || c("color=never") ? E = 0 : (c("color") || c("colors") || c("color=true") || c("color=always")) && (E = 1);
|
|
184
|
+
function Y() {
|
|
185
|
+
if ("FORCE_COLOR" in o)
|
|
186
|
+
return o.FORCE_COLOR === "true" ? 1 : o.FORCE_COLOR === "false" ? 0 : o.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(o.FORCE_COLOR, 10), 3);
|
|
187
|
+
}
|
|
188
|
+
function k(r2) {
|
|
189
|
+
return r2 === 0 ? false : { level: r2, hasBasic: true, has256: r2 >= 2, has16m: r2 >= 3 };
|
|
190
|
+
}
|
|
191
|
+
function V(r2, { streamIsTTY: l2, sniffFlags: i = true } = {}) {
|
|
192
|
+
let n = Y();
|
|
193
|
+
n !== void 0 && (E = n);
|
|
194
|
+
let e2 = i ? E : n;
|
|
195
|
+
if (e2 === 0)
|
|
196
|
+
return 0;
|
|
197
|
+
if (i) {
|
|
198
|
+
if (c("color=16m") || c("color=full") || c("color=truecolor"))
|
|
199
|
+
return 3;
|
|
200
|
+
if (c("color=256"))
|
|
201
|
+
return 2;
|
|
202
|
+
}
|
|
203
|
+
if ("TF_BUILD" in o && "AGENT_NAME" in o)
|
|
204
|
+
return 1;
|
|
205
|
+
if (r2 && !l2 && e2 === void 0)
|
|
206
|
+
return 0;
|
|
207
|
+
let t = e2 || 0;
|
|
208
|
+
if (o.TERM === "dumb")
|
|
209
|
+
return t;
|
|
210
|
+
if (R.platform === "win32") {
|
|
211
|
+
let s = P.release().split(".");
|
|
212
|
+
return Number(s[0]) >= 10 && Number(s[2]) >= 10586 ? Number(s[2]) >= 14931 ? 3 : 2 : 1;
|
|
213
|
+
}
|
|
214
|
+
if ("CI" in o)
|
|
215
|
+
return "GITHUB_ACTIONS" in o || "GITEA_ACTIONS" in o ? 3 : ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((s) => s in o) || o.CI_NAME === "codeship" ? 1 : t;
|
|
216
|
+
if ("TEAMCITY_VERSION" in o)
|
|
217
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION) ? 1 : 0;
|
|
218
|
+
if (o.COLORTERM === "truecolor" || o.TERM === "xterm-kitty")
|
|
219
|
+
return 3;
|
|
220
|
+
if ("TERM_PROGRAM" in o) {
|
|
221
|
+
let s = Number.parseInt((o.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
222
|
+
switch (o.TERM_PROGRAM) {
|
|
223
|
+
case "iTerm.app":
|
|
224
|
+
return s >= 3 ? 3 : 2;
|
|
225
|
+
case "Apple_Terminal":
|
|
226
|
+
return 2;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return /-256(color)?$/i.test(o.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM) || "COLORTERM" in o ? 1 : t;
|
|
230
|
+
}
|
|
231
|
+
function y(r2, l2 = {}) {
|
|
232
|
+
let i = V(r2, { streamIsTTY: r2 && r2.isTTY, ...l2 });
|
|
233
|
+
return k(i);
|
|
234
|
+
}
|
|
235
|
+
var j = { stdout: y({ isTTY: M.isatty(1) }), stderr: y({ isTTY: M.isatty(2) }) };
|
|
236
|
+
var T = j;
|
|
237
|
+
var x = T.stdout ? T.stdout.level : 0;
|
|
238
|
+
var B = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
|
239
|
+
var D = /^\s*at\s.*\(<anonymous>\)$/;
|
|
240
|
+
var S = (r2) => B.test(r2) || D.test(r2);
|
|
241
|
+
var m = (r2, l2, i = r2) => x >= 2 ? (n) => {
|
|
242
|
+
let e2 = "" + n, t = e2.indexOf(l2, r2.length);
|
|
243
|
+
return ~t ? r2 + A(e2, l2, i, t) + l2 : r2 + e2 + l2;
|
|
244
|
+
} : String;
|
|
245
|
+
var A = (r2, l2, i, n) => {
|
|
246
|
+
let e2 = r2.substring(0, n) + i, t = r2.substring(n + l2.length), s = t.indexOf(l2);
|
|
247
|
+
return ~s ? e2 + A(t, l2, i, s) : e2 + t;
|
|
248
|
+
};
|
|
249
|
+
var d = m("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
|
|
250
|
+
var N = m("\x1B[31m", "\x1B[39m");
|
|
251
|
+
var C = m("\x1B[32m", "\x1B[39m");
|
|
252
|
+
var $ = m("\x1B[33m", "\x1B[39m");
|
|
253
|
+
var G = m("\x1B[35m", "\x1B[39m");
|
|
254
|
+
var g = m("\x1B[36m", "\x1B[39m");
|
|
255
|
+
var L = m("\x1B[90m", "\x1B[39m");
|
|
256
|
+
var v = [189, 255, 243];
|
|
257
|
+
var h = [74, 194, 154];
|
|
258
|
+
var w = (r2) => !/[\s\n]/.test(r2);
|
|
259
|
+
var F = (r2) => {
|
|
260
|
+
if (x < 3)
|
|
261
|
+
return x === 2 ? d(g(r2)) : r2;
|
|
262
|
+
let l2 = [...r2], i = l2.filter(w).length, n = v[0], e2 = v[1], t = v[2], s = (h[0] - n) / i, p2 = (h[1] - e2) / i, f2 = (h[2] - t) / i, a2 = "";
|
|
263
|
+
for (let u of l2)
|
|
264
|
+
w(u) && (n += s, e2 += p2, t += f2), a2 += `\x1B[38;2;${Math.round(n)};${Math.round(e2)};${Math.round(t)}m${u}\x1B[39m`;
|
|
265
|
+
return d(a2);
|
|
266
|
+
};
|
|
267
|
+
var I = { error: 0, warn: 1, info: 2, log: 3, verbose: 4 };
|
|
268
|
+
var O = { error: { label: "error", level: "error", color: N }, warn: { label: "warn", level: "warn", color: $ }, info: { label: "info", level: "info", color: g }, start: { label: "start", level: "info", color: g }, ready: { label: "ready", level: "info", color: C }, success: { label: "success", level: "info", color: C }, log: { level: "log" }, debug: { label: "debug", level: "verbose", color: G } };
|
|
269
|
+
var _ = (r2 = {}) => {
|
|
270
|
+
let l2 = r2.level || "log", i = (e2, t, ...s) => {
|
|
271
|
+
if (I[O[e2].level] > I[l2])
|
|
272
|
+
return;
|
|
273
|
+
if (t == null)
|
|
274
|
+
return console.log();
|
|
275
|
+
let p2 = O[e2], f2 = "", a2 = "";
|
|
276
|
+
if ("label" in p2 && (f2 = (p2.label || "").padEnd(7), f2 = d(p2.color ? p2.color(f2) : f2)), t instanceof Error)
|
|
277
|
+
if (t.stack) {
|
|
278
|
+
let [u, ...b3] = t.stack.split(`
|
|
279
|
+
`);
|
|
280
|
+
u.startsWith("Error: ") && (u = u.slice(7)), a2 = `${u}
|
|
281
|
+
${L(b3.join(`
|
|
282
|
+
`))}`;
|
|
283
|
+
} else
|
|
284
|
+
a2 = t.message;
|
|
285
|
+
else
|
|
286
|
+
p2.level === "error" && typeof t == "string" ? a2 = t.split(`
|
|
287
|
+
`).map((b3) => S(b3) ? L(b3) : b3).join(`
|
|
288
|
+
`) : a2 = `${t}`;
|
|
289
|
+
console.log(f2.length ? `${f2} ${a2}` : a2, ...s);
|
|
290
|
+
}, n = { greet: (e2) => i("log", F(e2)) };
|
|
291
|
+
return Object.keys(O).forEach((e2) => {
|
|
292
|
+
n[e2] = (...t) => i(e2, ...t);
|
|
293
|
+
}), Object.defineProperty(n, "level", { get: () => l2, set(e2) {
|
|
294
|
+
l2 = e2;
|
|
295
|
+
} }), n.override = (e2) => {
|
|
296
|
+
Object.assign(n, e2);
|
|
297
|
+
}, n;
|
|
298
|
+
};
|
|
299
|
+
var ar = _();
|
|
300
|
+
|
|
301
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
302
|
+
init_esm();
|
|
303
|
+
|
|
304
|
+
// ../../node_modules/.pnpm/@clack+core@0.3.3/node_modules/@clack/core/dist/index.mjs
|
|
305
|
+
init_esm();
|
|
306
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
307
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
308
|
+
import { stdin as k2, stdout as y2 } from "process";
|
|
309
|
+
import * as f from "readline";
|
|
310
|
+
import S2 from "readline";
|
|
311
|
+
import { WriteStream as O2 } from "tty";
|
|
312
|
+
function z({ onlyFirst: t = false } = {}) {
|
|
313
|
+
const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
314
|
+
return new RegExp(u, t ? void 0 : "g");
|
|
315
|
+
}
|
|
316
|
+
function $2(t) {
|
|
317
|
+
if (typeof t != "string")
|
|
318
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
319
|
+
return t.replace(z(), "");
|
|
320
|
+
}
|
|
321
|
+
var m2 = {};
|
|
322
|
+
var G2 = { get exports() {
|
|
323
|
+
return m2;
|
|
324
|
+
}, set exports(t) {
|
|
325
|
+
m2 = t;
|
|
326
|
+
} };
|
|
327
|
+
(function(t) {
|
|
328
|
+
var u = {};
|
|
329
|
+
t.exports = u, u.eastAsianWidth = function(e2) {
|
|
330
|
+
var s = e2.charCodeAt(0), C3 = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s;
|
|
331
|
+
return 55296 <= s && s <= 56319 && 56320 <= C3 && C3 <= 57343 && (s &= 1023, C3 &= 1023, D2 = s << 10 | C3, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
|
|
332
|
+
}, u.characterLength = function(e2) {
|
|
333
|
+
var s = this.eastAsianWidth(e2);
|
|
334
|
+
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
335
|
+
};
|
|
336
|
+
function F2(e2) {
|
|
337
|
+
return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
338
|
+
}
|
|
339
|
+
u.length = function(e2) {
|
|
340
|
+
for (var s = F2(e2), C3 = 0, D2 = 0; D2 < s.length; D2++)
|
|
341
|
+
C3 = C3 + this.characterLength(s[D2]);
|
|
342
|
+
return C3;
|
|
343
|
+
}, u.slice = function(e2, s, C3) {
|
|
344
|
+
textLen = u.length(e2), s = s || 0, C3 = C3 || 1, s < 0 && (s = textLen + s), C3 < 0 && (C3 = textLen + C3);
|
|
345
|
+
for (var D2 = "", i = 0, o3 = F2(e2), E3 = 0; E3 < o3.length; E3++) {
|
|
346
|
+
var a2 = o3[E3], n = u.length(a2);
|
|
347
|
+
if (i >= s - (n == 2 ? 1 : 0))
|
|
348
|
+
if (i + n <= C3)
|
|
349
|
+
D2 += a2;
|
|
350
|
+
else
|
|
351
|
+
break;
|
|
352
|
+
i += n;
|
|
353
|
+
}
|
|
354
|
+
return D2;
|
|
355
|
+
};
|
|
356
|
+
})(G2);
|
|
357
|
+
var K = m2;
|
|
358
|
+
var Y2 = function() {
|
|
359
|
+
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;
|
|
360
|
+
};
|
|
361
|
+
function c2(t, u = {}) {
|
|
362
|
+
if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $2(t), t.length === 0))
|
|
363
|
+
return 0;
|
|
364
|
+
t = t.replace(Y2(), " ");
|
|
365
|
+
const F2 = u.ambiguousIsNarrow ? 1 : 2;
|
|
366
|
+
let e2 = 0;
|
|
367
|
+
for (const s of t) {
|
|
368
|
+
const C3 = s.codePointAt(0);
|
|
369
|
+
if (C3 <= 31 || C3 >= 127 && C3 <= 159 || C3 >= 768 && C3 <= 879)
|
|
370
|
+
continue;
|
|
371
|
+
switch (K.eastAsianWidth(s)) {
|
|
372
|
+
case "F":
|
|
373
|
+
case "W":
|
|
374
|
+
e2 += 2;
|
|
375
|
+
break;
|
|
376
|
+
case "A":
|
|
377
|
+
e2 += F2;
|
|
378
|
+
break;
|
|
379
|
+
default:
|
|
380
|
+
e2 += 1;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return e2;
|
|
384
|
+
}
|
|
385
|
+
var v2 = 10;
|
|
386
|
+
var M2 = (t = 0) => (u) => `\x1B[${u + t}m`;
|
|
387
|
+
var L2 = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
|
|
388
|
+
var T2 = (t = 0) => (u, F2, e2) => `\x1B[${38 + t};2;${u};${F2};${e2}m`;
|
|
389
|
+
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
390
|
+
Object.keys(r.modifier);
|
|
391
|
+
var Z = Object.keys(r.color);
|
|
392
|
+
var H = Object.keys(r.bgColor);
|
|
393
|
+
[...Z, ...H];
|
|
394
|
+
function U() {
|
|
395
|
+
const t = /* @__PURE__ */ new Map();
|
|
396
|
+
for (const [u, F2] of Object.entries(r)) {
|
|
397
|
+
for (const [e2, s] of Object.entries(F2))
|
|
398
|
+
r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F2[e2] = r[e2], t.set(s[0], s[1]);
|
|
399
|
+
Object.defineProperty(r, u, { value: F2, enumerable: false });
|
|
400
|
+
}
|
|
401
|
+
return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = M2(), r.color.ansi256 = L2(), r.color.ansi16m = T2(), r.bgColor.ansi = M2(v2), r.bgColor.ansi256 = L2(v2), r.bgColor.ansi16m = T2(v2), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F2, e2) => u === F2 && F2 === e2 ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F2 / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
|
|
402
|
+
const F2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
403
|
+
if (!F2)
|
|
404
|
+
return [0, 0, 0];
|
|
405
|
+
let [e2] = F2;
|
|
406
|
+
e2.length === 3 && (e2 = [...e2].map((C3) => C3 + C3).join(""));
|
|
407
|
+
const s = Number.parseInt(e2, 16);
|
|
408
|
+
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
409
|
+
}, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
|
|
410
|
+
if (u < 8)
|
|
411
|
+
return 30 + u;
|
|
412
|
+
if (u < 16)
|
|
413
|
+
return 90 + (u - 8);
|
|
414
|
+
let F2, e2, s;
|
|
415
|
+
if (u >= 232)
|
|
416
|
+
F2 = ((u - 232) * 10 + 8) / 255, e2 = F2, s = F2;
|
|
417
|
+
else {
|
|
418
|
+
u -= 16;
|
|
419
|
+
const i = u % 36;
|
|
420
|
+
F2 = Math.floor(u / 36) / 5, e2 = Math.floor(i / 6) / 5, s = i % 6 / 5;
|
|
421
|
+
}
|
|
422
|
+
const C3 = Math.max(F2, e2, s) * 2;
|
|
423
|
+
if (C3 === 0)
|
|
424
|
+
return 30;
|
|
425
|
+
let D2 = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F2));
|
|
426
|
+
return C3 === 2 && (D2 += 60), D2;
|
|
427
|
+
}, enumerable: false }, rgbToAnsi: { value: (u, F2, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F2, e2)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
|
|
428
|
+
}
|
|
429
|
+
var q = U();
|
|
430
|
+
var p = /* @__PURE__ */ new Set(["\x1B", ""]);
|
|
431
|
+
var J = 39;
|
|
432
|
+
var b = "\x07";
|
|
433
|
+
var W = "[";
|
|
434
|
+
var Q = "]";
|
|
435
|
+
var I2 = "m";
|
|
436
|
+
var w2 = `${Q}8;;`;
|
|
437
|
+
var N2 = (t) => `${p.values().next().value}${W}${t}${I2}`;
|
|
438
|
+
var j2 = (t) => `${p.values().next().value}${w2}${t}${b}`;
|
|
439
|
+
var X = (t) => t.split(" ").map((u) => c2(u));
|
|
440
|
+
var _2 = (t, u, F2) => {
|
|
441
|
+
const e2 = [...u];
|
|
442
|
+
let s = false, C3 = false, D2 = c2($2(t[t.length - 1]));
|
|
443
|
+
for (const [i, o3] of e2.entries()) {
|
|
444
|
+
const E3 = c2(o3);
|
|
445
|
+
if (D2 + E3 <= F2 ? t[t.length - 1] += o3 : (t.push(o3), D2 = 0), p.has(o3) && (s = true, C3 = e2.slice(i + 1).join("").startsWith(w2)), s) {
|
|
446
|
+
C3 ? o3 === b && (s = false, C3 = false) : o3 === I2 && (s = false);
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
D2 += E3, D2 === F2 && i < e2.length - 1 && (t.push(""), D2 = 0);
|
|
450
|
+
}
|
|
451
|
+
!D2 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
452
|
+
};
|
|
453
|
+
var DD = (t) => {
|
|
454
|
+
const u = t.split(" ");
|
|
455
|
+
let F2 = u.length;
|
|
456
|
+
for (; F2 > 0 && !(c2(u[F2 - 1]) > 0); )
|
|
457
|
+
F2--;
|
|
458
|
+
return F2 === u.length ? t : u.slice(0, F2).join(" ") + u.slice(F2).join("");
|
|
459
|
+
};
|
|
460
|
+
var uD = (t, u, F2 = {}) => {
|
|
461
|
+
if (F2.trim !== false && t.trim() === "")
|
|
462
|
+
return "";
|
|
463
|
+
let e2 = "", s, C3;
|
|
464
|
+
const D2 = X(t);
|
|
465
|
+
let i = [""];
|
|
466
|
+
for (const [E3, a2] of t.split(" ").entries()) {
|
|
467
|
+
F2.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
|
|
468
|
+
let n = c2(i[i.length - 1]);
|
|
469
|
+
if (E3 !== 0 && (n >= u && (F2.wordWrap === false || F2.trim === false) && (i.push(""), n = 0), (n > 0 || F2.trim === false) && (i[i.length - 1] += " ", n++)), F2.hard && D2[E3] > u) {
|
|
470
|
+
const B3 = u - n, A3 = 1 + Math.floor((D2[E3] - B3 - 1) / u);
|
|
471
|
+
Math.floor((D2[E3] - 1) / u) < A3 && i.push(""), _2(i, a2, u);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
if (n + D2[E3] > u && n > 0 && D2[E3] > 0) {
|
|
475
|
+
if (F2.wordWrap === false && n < u) {
|
|
476
|
+
_2(i, a2, u);
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
i.push("");
|
|
480
|
+
}
|
|
481
|
+
if (n + D2[E3] > u && F2.wordWrap === false) {
|
|
482
|
+
_2(i, a2, u);
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
i[i.length - 1] += a2;
|
|
486
|
+
}
|
|
487
|
+
F2.trim !== false && (i = i.map((E3) => DD(E3)));
|
|
488
|
+
const o3 = [...i.join(`
|
|
489
|
+
`)];
|
|
490
|
+
for (const [E3, a2] of o3.entries()) {
|
|
491
|
+
if (e2 += a2, p.has(a2)) {
|
|
492
|
+
const { groups: B3 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w2}(?<uri>.*)${b})`).exec(o3.slice(E3).join("")) || { groups: {} };
|
|
493
|
+
if (B3.code !== void 0) {
|
|
494
|
+
const A3 = Number.parseFloat(B3.code);
|
|
495
|
+
s = A3 === J ? void 0 : A3;
|
|
496
|
+
} else
|
|
497
|
+
B3.uri !== void 0 && (C3 = B3.uri.length === 0 ? void 0 : B3.uri);
|
|
498
|
+
}
|
|
499
|
+
const n = q.codes.get(Number(s));
|
|
500
|
+
o3[E3 + 1] === `
|
|
501
|
+
` ? (C3 && (e2 += j2("")), s && n && (e2 += N2(n))) : a2 === `
|
|
502
|
+
` && (s && n && (e2 += N2(s)), C3 && (e2 += j2(C3)));
|
|
503
|
+
}
|
|
504
|
+
return e2;
|
|
505
|
+
};
|
|
506
|
+
function P2(t, u, F2) {
|
|
507
|
+
return String(t).normalize().replace(/\r\n/g, `
|
|
508
|
+
`).split(`
|
|
509
|
+
`).map((e2) => uD(e2, u, F2)).join(`
|
|
510
|
+
`);
|
|
511
|
+
}
|
|
512
|
+
function FD(t, u) {
|
|
513
|
+
if (t === u)
|
|
514
|
+
return;
|
|
515
|
+
const F2 = t.split(`
|
|
516
|
+
`), e2 = u.split(`
|
|
517
|
+
`), s = [];
|
|
518
|
+
for (let C3 = 0; C3 < Math.max(F2.length, e2.length); C3++)
|
|
519
|
+
F2[C3] !== e2[C3] && s.push(C3);
|
|
520
|
+
return s;
|
|
521
|
+
}
|
|
522
|
+
var R2 = Symbol("clack:cancel");
|
|
523
|
+
function eD(t) {
|
|
524
|
+
return t === R2;
|
|
525
|
+
}
|
|
526
|
+
function g2(t, u) {
|
|
527
|
+
t.isTTY && t.setRawMode(u);
|
|
528
|
+
}
|
|
529
|
+
var V2 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
530
|
+
var tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
531
|
+
var h2 = class {
|
|
532
|
+
constructor({ render: u, input: F2 = k2, output: e2 = y2, ...s }, C3 = true) {
|
|
533
|
+
this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C3, this.input = F2, this.output = e2;
|
|
534
|
+
}
|
|
535
|
+
prompt() {
|
|
536
|
+
const u = new O2(0);
|
|
537
|
+
return u._write = (F2, e2, s) => {
|
|
538
|
+
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
|
|
539
|
+
}, this.input.pipe(u), this.rl = S2.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), S2.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g2(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F2, e2) => {
|
|
540
|
+
this.once("submit", () => {
|
|
541
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g2(this.input, false), F2(this.value);
|
|
542
|
+
}), this.once("cancel", () => {
|
|
543
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g2(this.input, false), F2(R2);
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
on(u, F2) {
|
|
548
|
+
const e2 = this.subscribers.get(u) ?? [];
|
|
549
|
+
e2.push({ cb: F2 }), this.subscribers.set(u, e2);
|
|
550
|
+
}
|
|
551
|
+
once(u, F2) {
|
|
552
|
+
const e2 = this.subscribers.get(u) ?? [];
|
|
553
|
+
e2.push({ cb: F2, once: true }), this.subscribers.set(u, e2);
|
|
554
|
+
}
|
|
555
|
+
emit(u, ...F2) {
|
|
556
|
+
const e2 = this.subscribers.get(u) ?? [], s = [];
|
|
557
|
+
for (const C3 of e2)
|
|
558
|
+
C3.cb(...F2), C3.once && s.push(() => e2.splice(e2.indexOf(C3), 1));
|
|
559
|
+
for (const C3 of s)
|
|
560
|
+
C3();
|
|
561
|
+
}
|
|
562
|
+
unsubscribe() {
|
|
563
|
+
this.subscribers.clear();
|
|
564
|
+
}
|
|
565
|
+
onKeypress(u, F2) {
|
|
566
|
+
if (this.state === "error" && (this.state = "active"), F2?.name && !this._track && V2.has(F2.name) && this.emit("cursor", V2.get(F2.name)), F2?.name && tD.has(F2.name) && this.emit("cursor", F2.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), F2?.name === "return") {
|
|
567
|
+
if (this.opts.validate) {
|
|
568
|
+
const e2 = this.opts.validate(this.value);
|
|
569
|
+
e2 && (this.error = e2, this.state = "error", this.rl.write(this.value));
|
|
570
|
+
}
|
|
571
|
+
this.state !== "error" && (this.state = "submit");
|
|
572
|
+
}
|
|
573
|
+
u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
574
|
+
}
|
|
575
|
+
close() {
|
|
576
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
577
|
+
`), g2(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
578
|
+
}
|
|
579
|
+
restoreCursor() {
|
|
580
|
+
const u = P2(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
581
|
+
`).length - 1;
|
|
582
|
+
this.output.write(import_sisteransi.cursor.move(-999, u * -1));
|
|
583
|
+
}
|
|
584
|
+
render() {
|
|
585
|
+
const u = P2(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
586
|
+
if (u !== this._prevFrame) {
|
|
587
|
+
if (this.state === "initial")
|
|
588
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
589
|
+
else {
|
|
590
|
+
const F2 = FD(this._prevFrame, u);
|
|
591
|
+
if (this.restoreCursor(), F2 && F2?.length === 1) {
|
|
592
|
+
const e2 = F2[0];
|
|
593
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
594
|
+
const s = u.split(`
|
|
595
|
+
`);
|
|
596
|
+
this.output.write(s[e2]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - e2 - 1));
|
|
597
|
+
return;
|
|
598
|
+
} else if (F2 && F2?.length > 1) {
|
|
599
|
+
const e2 = F2[0];
|
|
600
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
|
|
601
|
+
const C3 = u.split(`
|
|
602
|
+
`).slice(e2);
|
|
603
|
+
this.output.write(C3.join(`
|
|
604
|
+
`)), this._prevFrame = u;
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
this.output.write(import_sisteransi.erase.down());
|
|
608
|
+
}
|
|
609
|
+
this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
var ED = class extends h2 {
|
|
614
|
+
constructor(u) {
|
|
615
|
+
super(u, false), this.cursor = 0, this.options = u.options, this.cursor = this.options.findIndex(({ value: F2 }) => F2 === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F2) => {
|
|
616
|
+
switch (F2) {
|
|
617
|
+
case "left":
|
|
618
|
+
case "up":
|
|
619
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
620
|
+
break;
|
|
621
|
+
case "down":
|
|
622
|
+
case "right":
|
|
623
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
this.changeValue();
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
get _value() {
|
|
630
|
+
return this.options[this.cursor];
|
|
631
|
+
}
|
|
632
|
+
changeValue() {
|
|
633
|
+
this.value = this._value.value;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
var oD = class extends h2 {
|
|
637
|
+
constructor(u) {
|
|
638
|
+
super(u), this.valueWithCursor = "", this.on("finalize", () => {
|
|
639
|
+
this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
|
|
640
|
+
}), this.on("value", () => {
|
|
641
|
+
if (this.cursor >= this.value.length)
|
|
642
|
+
this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
643
|
+
else {
|
|
644
|
+
const F2 = this.value.slice(0, this.cursor), e2 = this.value.slice(this.cursor);
|
|
645
|
+
this.valueWithCursor = `${F2}${import_picocolors.default.inverse(e2[0])}${e2.slice(1)}`;
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
get cursor() {
|
|
650
|
+
return this._cursor;
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
655
|
+
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
656
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
657
|
+
import h3 from "process";
|
|
658
|
+
function q2() {
|
|
659
|
+
return h3.platform !== "win32" ? h3.env.TERM !== "linux" : Boolean(h3.env.CI) || Boolean(h3.env.WT_SESSION) || Boolean(h3.env.TERMINUS_SUBLIME) || h3.env.ConEmuTask === "{cmd::Cmder}" || h3.env.TERM_PROGRAM === "Terminus-Sublime" || h3.env.TERM_PROGRAM === "vscode" || h3.env.TERM === "xterm-256color" || h3.env.TERM === "alacritty" || h3.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
660
|
+
}
|
|
661
|
+
var _3 = q2();
|
|
662
|
+
var o2 = (r2, n) => _3 ? r2 : n;
|
|
663
|
+
var H2 = o2("◆", "*");
|
|
664
|
+
var I3 = o2("■", "x");
|
|
665
|
+
var x3 = o2("▲", "x");
|
|
666
|
+
var S3 = o2("◇", "o");
|
|
667
|
+
var K2 = o2("┌", "T");
|
|
668
|
+
var a = o2("│", "|");
|
|
669
|
+
var d3 = o2("└", "—");
|
|
670
|
+
var b2 = o2("●", ">");
|
|
671
|
+
var E2 = o2("○", " ");
|
|
672
|
+
var C2 = o2("◻", "[•]");
|
|
673
|
+
var w3 = o2("◼", "[+]");
|
|
674
|
+
var M3 = o2("◻", "[ ]");
|
|
675
|
+
var U2 = o2("▪", "•");
|
|
676
|
+
var B2 = o2("─", "-");
|
|
677
|
+
var Z2 = o2("╮", "+");
|
|
678
|
+
var z2 = o2("├", "+");
|
|
679
|
+
var X2 = o2("╯", "+");
|
|
680
|
+
var J2 = o2("●", "•");
|
|
681
|
+
var Y3 = o2("◆", "*");
|
|
682
|
+
var Q2 = o2("▲", "!");
|
|
683
|
+
var ee = o2("■", "x");
|
|
684
|
+
var y3 = (r2) => {
|
|
685
|
+
switch (r2) {
|
|
686
|
+
case "initial":
|
|
687
|
+
case "active":
|
|
688
|
+
return import_picocolors2.default.cyan(H2);
|
|
689
|
+
case "cancel":
|
|
690
|
+
return import_picocolors2.default.red(I3);
|
|
691
|
+
case "error":
|
|
692
|
+
return import_picocolors2.default.yellow(x3);
|
|
693
|
+
case "submit":
|
|
694
|
+
return import_picocolors2.default.green(S3);
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
var te = (r2) => new oD({ validate: r2.validate, placeholder: r2.placeholder, defaultValue: r2.defaultValue, initialValue: r2.initialValue, render() {
|
|
698
|
+
const n = `${import_picocolors2.default.gray(a)}
|
|
699
|
+
${y3(this.state)} ${r2.message}
|
|
700
|
+
`, i = r2.placeholder ? import_picocolors2.default.inverse(r2.placeholder[0]) + import_picocolors2.default.dim(r2.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t = this.value ? this.valueWithCursor : i;
|
|
701
|
+
switch (this.state) {
|
|
702
|
+
case "error":
|
|
703
|
+
return `${n.trim()}
|
|
704
|
+
${import_picocolors2.default.yellow(a)} ${t}
|
|
705
|
+
${import_picocolors2.default.yellow(d3)} ${import_picocolors2.default.yellow(this.error)}
|
|
706
|
+
`;
|
|
707
|
+
case "submit":
|
|
708
|
+
return `${n}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.dim(this.value || r2.placeholder)}`;
|
|
709
|
+
case "cancel":
|
|
710
|
+
return `${n}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
711
|
+
` + import_picocolors2.default.gray(a) : ""}`;
|
|
712
|
+
default:
|
|
713
|
+
return `${n}${import_picocolors2.default.cyan(a)} ${t}
|
|
714
|
+
${import_picocolors2.default.cyan(d3)}
|
|
715
|
+
`;
|
|
716
|
+
}
|
|
717
|
+
} }).prompt();
|
|
718
|
+
var ie = (r2) => {
|
|
719
|
+
const n = (t, s) => {
|
|
720
|
+
const c3 = t.label ?? String(t.value);
|
|
721
|
+
return s === "active" ? `${import_picocolors2.default.green(b2)} ${c3} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : s === "selected" ? `${import_picocolors2.default.dim(c3)}` : s === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c3))}` : `${import_picocolors2.default.dim(E2)} ${import_picocolors2.default.dim(c3)}`;
|
|
722
|
+
};
|
|
723
|
+
let i = 0;
|
|
724
|
+
return new ED({ options: r2.options, initialValue: r2.initialValue, render() {
|
|
725
|
+
const t = `${import_picocolors2.default.gray(a)}
|
|
726
|
+
${y3(this.state)} ${r2.message}
|
|
727
|
+
`;
|
|
728
|
+
switch (this.state) {
|
|
729
|
+
case "submit":
|
|
730
|
+
return `${t}${import_picocolors2.default.gray(a)} ${n(this.options[this.cursor], "selected")}`;
|
|
731
|
+
case "cancel":
|
|
732
|
+
return `${t}${import_picocolors2.default.gray(a)} ${n(this.options[this.cursor], "cancelled")}
|
|
733
|
+
${import_picocolors2.default.gray(a)}`;
|
|
734
|
+
default: {
|
|
735
|
+
const s = r2.maxItems === void 0 ? 1 / 0 : Math.max(r2.maxItems, 5);
|
|
736
|
+
this.cursor >= i + s - 3 ? i = Math.max(Math.min(this.cursor - s + 3, this.options.length - s), 0) : this.cursor < i + 2 && (i = Math.max(this.cursor - 2, 0));
|
|
737
|
+
const c3 = s < this.options.length && i > 0, l2 = s < this.options.length && i + s < this.options.length;
|
|
738
|
+
return `${t}${import_picocolors2.default.cyan(a)} ${this.options.slice(i, i + s).map((u, m3, $3) => m3 === 0 && c3 ? import_picocolors2.default.dim("...") : m3 === $3.length - 1 && l2 ? import_picocolors2.default.dim("...") : n(u, m3 + i === this.cursor ? "active" : "inactive")).join(`
|
|
739
|
+
${import_picocolors2.default.cyan(a)} `)}
|
|
740
|
+
${import_picocolors2.default.cyan(d3)}
|
|
741
|
+
`;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
} }).prompt();
|
|
745
|
+
};
|
|
746
|
+
var R3 = (r2) => r2.replace(me(), "");
|
|
747
|
+
var le = (r2 = "", n = "") => {
|
|
748
|
+
const i = `
|
|
749
|
+
${r2}
|
|
750
|
+
`.split(`
|
|
751
|
+
`), t = R3(n).length, s = Math.max(i.reduce((l2, u) => (u = R3(u), u.length > l2 ? u.length : l2), 0), t) + 2, c3 = i.map((l2) => `${import_picocolors2.default.gray(a)} ${import_picocolors2.default.dim(l2)}${" ".repeat(s - R3(l2).length)}${import_picocolors2.default.gray(a)}`).join(`
|
|
752
|
+
`);
|
|
753
|
+
process.stdout.write(`${import_picocolors2.default.gray(a)}
|
|
754
|
+
${import_picocolors2.default.green(S3)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(B2.repeat(Math.max(s - t - 1, 1)) + Z2)}
|
|
755
|
+
${c3}
|
|
756
|
+
${import_picocolors2.default.gray(z2 + B2.repeat(s + 2) + X2)}
|
|
757
|
+
`);
|
|
758
|
+
};
|
|
759
|
+
var ue = (r2 = "") => {
|
|
760
|
+
process.stdout.write(`${import_picocolors2.default.gray(d3)} ${import_picocolors2.default.red(r2)}
|
|
761
|
+
|
|
762
|
+
`);
|
|
763
|
+
};
|
|
764
|
+
var $e = (r2 = "") => {
|
|
765
|
+
process.stdout.write(`${import_picocolors2.default.gray(a)}
|
|
766
|
+
${import_picocolors2.default.gray(d3)} ${r2}
|
|
767
|
+
|
|
768
|
+
`);
|
|
769
|
+
};
|
|
770
|
+
function me() {
|
|
771
|
+
const r2 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
772
|
+
return new RegExp(r2, "g");
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// src/index.ts
|
|
29
776
|
function checkCancel(value) {
|
|
30
|
-
if ((
|
|
31
|
-
(
|
|
777
|
+
if (eD(value)) {
|
|
778
|
+
ue("Operation cancelled.");
|
|
32
779
|
process.exit(0);
|
|
33
780
|
}
|
|
34
781
|
}
|
|
@@ -47,28 +794,28 @@ function pkgFromUserAgent(userAgent) {
|
|
|
47
794
|
}
|
|
48
795
|
async function main() {
|
|
49
796
|
console.log("");
|
|
50
|
-
|
|
797
|
+
ar.greet("◆ Create Rsbuild Project");
|
|
51
798
|
const cwd = process.cwd();
|
|
52
799
|
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
|
|
53
800
|
const pkgManager = pkgInfo ? pkgInfo.name : "npm";
|
|
54
|
-
const packageRoot =
|
|
55
|
-
const packageJsonPath =
|
|
56
|
-
const { version } =
|
|
57
|
-
let targetDir = await (
|
|
801
|
+
const packageRoot = path2.resolve(__dirname, "..");
|
|
802
|
+
const packageJsonPath = path2.join(packageRoot, "package.json");
|
|
803
|
+
const { version } = __require(packageJsonPath);
|
|
804
|
+
let targetDir = await te({
|
|
58
805
|
message: "Input target folder",
|
|
59
806
|
placeholder: "my-project",
|
|
60
807
|
validate(value) {
|
|
61
808
|
if (value.length === 0) {
|
|
62
809
|
return "Target folder is required";
|
|
63
810
|
}
|
|
64
|
-
if (
|
|
811
|
+
if (fs.existsSync(path2.join(cwd, value))) {
|
|
65
812
|
return `"${value}" is not empty, please input another folder`;
|
|
66
813
|
}
|
|
67
814
|
}
|
|
68
815
|
});
|
|
69
816
|
checkCancel(targetDir);
|
|
70
817
|
targetDir = formatTargetDir(targetDir);
|
|
71
|
-
const framework = await (
|
|
818
|
+
const framework = await ie({
|
|
72
819
|
message: "Select framework",
|
|
73
820
|
options: [
|
|
74
821
|
{ value: "react", label: "React" },
|
|
@@ -82,7 +829,7 @@ async function main() {
|
|
|
82
829
|
]
|
|
83
830
|
});
|
|
84
831
|
checkCancel(framework);
|
|
85
|
-
const language = await (
|
|
832
|
+
const language = await ie({
|
|
86
833
|
message: "Select language",
|
|
87
834
|
options: [
|
|
88
835
|
{ value: "ts", label: "TypeScript" },
|
|
@@ -90,48 +837,51 @@ async function main() {
|
|
|
90
837
|
]
|
|
91
838
|
});
|
|
92
839
|
checkCancel(language);
|
|
93
|
-
const srcFolder =
|
|
94
|
-
const commonFolder =
|
|
95
|
-
const distFolder =
|
|
840
|
+
const srcFolder = path2.join(packageRoot, `template-${framework}-${language}`);
|
|
841
|
+
const commonFolder = path2.join(packageRoot, "template-common");
|
|
842
|
+
const distFolder = path2.join(cwd, targetDir);
|
|
96
843
|
copyFolder(commonFolder, distFolder, version);
|
|
97
|
-
copyFolder(srcFolder, distFolder, version,
|
|
844
|
+
copyFolder(srcFolder, distFolder, version, path2.basename(targetDir));
|
|
98
845
|
const nextSteps = [
|
|
99
846
|
`cd ${targetDir}`,
|
|
100
847
|
`${pkgManager} i`,
|
|
101
848
|
`${pkgManager} run dev`
|
|
102
849
|
];
|
|
103
|
-
(
|
|
104
|
-
(
|
|
850
|
+
le(nextSteps.join("\n"), "Next steps");
|
|
851
|
+
$e("Done.");
|
|
105
852
|
}
|
|
106
853
|
function copyFolder(src, dist, version, name) {
|
|
107
854
|
const renameFiles = {
|
|
108
855
|
gitignore: ".gitignore"
|
|
109
856
|
};
|
|
110
857
|
const skipFiles = ["node_modules", "dist"];
|
|
111
|
-
|
|
112
|
-
for (const file of
|
|
858
|
+
fs.mkdirSync(dist, { recursive: true });
|
|
859
|
+
for (const file of fs.readdirSync(src)) {
|
|
113
860
|
if (skipFiles.includes(file)) {
|
|
114
861
|
continue;
|
|
115
862
|
}
|
|
116
|
-
const srcFile =
|
|
117
|
-
const distFile = renameFiles[file] ?
|
|
118
|
-
const stat =
|
|
863
|
+
const srcFile = path2.resolve(src, file);
|
|
864
|
+
const distFile = renameFiles[file] ? path2.resolve(dist, renameFiles[file]) : path2.resolve(dist, file);
|
|
865
|
+
const stat = fs.statSync(srcFile);
|
|
119
866
|
if (stat.isDirectory()) {
|
|
120
867
|
copyFolder(srcFile, distFile, version);
|
|
121
868
|
} else {
|
|
122
|
-
|
|
869
|
+
fs.copyFileSync(srcFile, distFile);
|
|
123
870
|
if (file === "package.json") {
|
|
124
871
|
updatePackageJson(distFile, version, name);
|
|
125
872
|
}
|
|
126
873
|
}
|
|
127
874
|
}
|
|
128
875
|
}
|
|
129
|
-
|
|
130
|
-
let content =
|
|
876
|
+
var updatePackageJson = (pkgJsonPath, version, name) => {
|
|
877
|
+
let content = fs.readFileSync(pkgJsonPath, "utf-8");
|
|
131
878
|
content = content.replace(/workspace:\*/g, `^${version}`);
|
|
132
879
|
const pkg = JSON.parse(content);
|
|
133
880
|
if (name)
|
|
134
881
|
pkg.name = name;
|
|
135
|
-
|
|
882
|
+
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2));
|
|
136
883
|
};
|
|
137
884
|
main();
|
|
885
|
+
export {
|
|
886
|
+
main
|
|
887
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rsbuild",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Create a new Rsbuild project",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -9,24 +9,29 @@
|
|
|
9
9
|
"directory": "packages/create-rsbuild"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"type": "
|
|
12
|
+
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16.0.0"
|
|
21
|
+
},
|
|
19
22
|
"main": "./dist/index.js",
|
|
20
23
|
"types": "./dist/index.d.ts",
|
|
21
24
|
"bin": {
|
|
22
25
|
"create-rsbuild": "./dist/index.js"
|
|
23
26
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
27
|
+
"files": [
|
|
28
|
+
"template-*",
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
28
31
|
"devDependencies": {
|
|
32
|
+
"@clack/prompts": "^0.7.0",
|
|
29
33
|
"@types/node": "16.x",
|
|
34
|
+
"rslog": "^1.2.0",
|
|
30
35
|
"typescript": "^5.3.0"
|
|
31
36
|
},
|
|
32
37
|
"publishConfig": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# create-rsbuild
|
|
2
|
-
|
|
3
|
-
## 0.3.3
|
|
4
|
-
|
|
5
|
-
## 0.3.2
|
|
6
|
-
|
|
7
|
-
## 0.3.1
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- 7b877865: feat(create-rsbuild): add extensions config for Vue projects
|
|
12
|
-
|
|
13
|
-
## 0.3.0
|
|
14
|
-
|
|
15
|
-
## 0.2.18
|
|
16
|
-
|
|
17
|
-
## 0.2.17
|
|
18
|
-
|
|
19
|
-
## 0.2.16
|
|
20
|
-
|
|
21
|
-
## 0.2.15
|
|
22
|
-
|
|
23
|
-
## 0.2.14
|
|
24
|
-
|
|
25
|
-
## 0.2.13
|
|
26
|
-
|
|
27
|
-
## 0.2.12
|
|
28
|
-
|
|
29
|
-
## 0.2.11
|
|
30
|
-
|
|
31
|
-
## 0.2.10
|
|
32
|
-
|
|
33
|
-
## 0.2.9
|
|
34
|
-
|
|
35
|
-
## 0.2.8
|
|
36
|
-
|
|
37
|
-
## 0.2.7
|
|
38
|
-
|
|
39
|
-
## 0.2.6
|
|
40
|
-
|
|
41
|
-
## 0.2.5
|
|
42
|
-
|
|
43
|
-
## 0.2.4
|
|
44
|
-
|
|
45
|
-
## 0.2.3
|
|
46
|
-
|
|
47
|
-
## 0.2.2
|
|
48
|
-
|
|
49
|
-
## 0.2.1
|
|
50
|
-
|
|
51
|
-
## 0.2.0
|
package/modern.config.ts
DELETED