create-vue 3.16.3 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/bundle.js +736 -687
- package/locales/en-US.json +11 -1
- package/locales/fr-FR.json +11 -1
- package/locales/tr-TR.json +11 -1
- package/locales/zh-Hans.json +11 -1
- package/locales/zh-Hant.json +11 -1
- package/package.json +11 -10
- package/template/base/package.json +4 -4
- package/template/config/cypress/package.json +2 -2
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/jsx/package.json +3 -3
- package/template/config/nightwatch/package.json +4 -4
- package/template/config/nightwatch-ct/package.json +1 -1
- package/template/config/pinia/package.json +2 -2
- package/template/config/playwright/package.json +1 -1
- package/template/config/router/package.json +2 -2
- package/template/config/typescript/package.json +3 -3
- package/template/config/vitest/package.json +3 -3
- package/template/eslint/package.json +2 -2
- package/template/tsconfig/base/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "module";
|
|
3
|
-
import * as fs$5 from "node:fs";
|
|
4
|
-
import * as fs$4 from "node:fs";
|
|
5
|
-
import * as fs$3 from "node:fs";
|
|
6
|
-
import * as fs$2 from "node:fs";
|
|
7
|
-
import * as fs$1 from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
8
3
|
import * as fs from "node:fs";
|
|
9
|
-
import * as path$5 from "node:path";
|
|
10
|
-
import * as path$4 from "node:path";
|
|
11
|
-
import * as path$3 from "node:path";
|
|
12
|
-
import * as path$2 from "node:path";
|
|
13
4
|
import * as path from "node:path";
|
|
14
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
15
6
|
import { parseArgs, stripVTControlCharacters } from "node:util";
|
|
16
|
-
import
|
|
17
|
-
import * as
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
7
|
+
import y, { stdin, stdout } from "node:process";
|
|
8
|
+
import * as g from "node:readline";
|
|
9
|
+
import O from "node:readline";
|
|
10
|
+
import { Writable } from "node:stream";
|
|
20
11
|
import * as path$1 from "path";
|
|
21
12
|
|
|
22
13
|
//#region rolldown:runtime
|
|
@@ -52,16 +43,16 @@ var require_src = __commonJS({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules
|
|
|
52
43
|
const CSI = `${ESC}[`;
|
|
53
44
|
const beep = "\x07";
|
|
54
45
|
const cursor = {
|
|
55
|
-
to(x$
|
|
56
|
-
if (!y$
|
|
57
|
-
return `${CSI}${y$
|
|
46
|
+
to(x$2, y$2) {
|
|
47
|
+
if (!y$2) return `${CSI}${x$2 + 1}G`;
|
|
48
|
+
return `${CSI}${y$2 + 1};${x$2 + 1}H`;
|
|
58
49
|
},
|
|
59
|
-
move(x$
|
|
50
|
+
move(x$2, y$2) {
|
|
60
51
|
let ret = "";
|
|
61
|
-
if (x$
|
|
62
|
-
else if (x$
|
|
63
|
-
if (y$
|
|
64
|
-
else if (y$
|
|
52
|
+
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
53
|
+
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
54
|
+
if (y$2 < 0) ret += `${CSI}${-y$2}A`;
|
|
55
|
+
else if (y$2 > 0) ret += `${CSI}${y$2}B`;
|
|
65
56
|
return ret;
|
|
66
57
|
},
|
|
67
58
|
up: (count = 1) => `${CSI}${count}A`,
|
|
@@ -101,13 +92,12 @@ var require_src = __commonJS({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules
|
|
|
101
92
|
beep
|
|
102
93
|
};
|
|
103
94
|
} });
|
|
104
|
-
var import_src = __toESM(require_src(), 1);
|
|
105
95
|
|
|
106
96
|
//#endregion
|
|
107
97
|
//#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
108
98
|
var require_picocolors = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
109
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
110
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
99
|
+
let p$1 = process || {}, argv = p$1.argv || [], env = p$1.env || {};
|
|
100
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p$1.platform === "win32" || (p$1.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
111
101
|
let formatter = (open, close, replace = open) => (input) => {
|
|
112
102
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
113
103
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
@@ -122,129 +112,130 @@ var require_picocolors = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_
|
|
|
122
112
|
return result + string.substring(cursor$1);
|
|
123
113
|
};
|
|
124
114
|
let createColors = (enabled = isColorSupported) => {
|
|
125
|
-
let f
|
|
115
|
+
let f = enabled ? formatter : () => String;
|
|
126
116
|
return {
|
|
127
117
|
isColorSupported: enabled,
|
|
128
|
-
reset: f
|
|
129
|
-
bold: f
|
|
130
|
-
dim: f
|
|
131
|
-
italic: f
|
|
132
|
-
underline: f
|
|
133
|
-
inverse: f
|
|
134
|
-
hidden: f
|
|
135
|
-
strikethrough: f
|
|
136
|
-
black: f
|
|
137
|
-
red: f
|
|
138
|
-
green: f
|
|
139
|
-
yellow: f
|
|
140
|
-
blue: f
|
|
141
|
-
magenta: f
|
|
142
|
-
cyan: f
|
|
143
|
-
white: f
|
|
144
|
-
gray: f
|
|
145
|
-
bgBlack: f
|
|
146
|
-
bgRed: f
|
|
147
|
-
bgGreen: f
|
|
148
|
-
bgYellow: f
|
|
149
|
-
bgBlue: f
|
|
150
|
-
bgMagenta: f
|
|
151
|
-
bgCyan: f
|
|
152
|
-
bgWhite: f
|
|
153
|
-
blackBright: f
|
|
154
|
-
redBright: f
|
|
155
|
-
greenBright: f
|
|
156
|
-
yellowBright: f
|
|
157
|
-
blueBright: f
|
|
158
|
-
magentaBright: f
|
|
159
|
-
cyanBright: f
|
|
160
|
-
whiteBright: f
|
|
161
|
-
bgBlackBright: f
|
|
162
|
-
bgRedBright: f
|
|
163
|
-
bgGreenBright: f
|
|
164
|
-
bgYellowBright: f
|
|
165
|
-
bgBlueBright: f
|
|
166
|
-
bgMagentaBright: f
|
|
167
|
-
bgCyanBright: f
|
|
168
|
-
bgWhiteBright: f
|
|
118
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
119
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
120
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
121
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
122
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
123
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
124
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
125
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
126
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
127
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
128
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
129
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
130
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
131
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
132
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
133
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
134
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
135
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
136
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
137
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
138
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
139
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
140
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
141
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
142
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
143
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
144
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
145
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
146
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
147
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
148
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
149
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
150
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
151
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
152
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
153
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
154
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
155
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
156
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
157
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
158
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
169
159
|
};
|
|
170
160
|
};
|
|
171
161
|
module.exports = createColors();
|
|
172
162
|
module.exports.createColors = createColors;
|
|
173
163
|
} });
|
|
174
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
175
164
|
|
|
176
165
|
//#endregion
|
|
177
|
-
//#region node_modules/.pnpm/@clack+core@0.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
166
|
+
//#region node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
|
|
167
|
+
var import_src$1 = __toESM(require_src(), 1);
|
|
168
|
+
var import_picocolors$2 = __toESM(require_picocolors(), 1);
|
|
169
|
+
function DD({ onlyFirst: e$1 = !1 } = {}) {
|
|
170
|
+
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
171
|
+
return new RegExp(t, e$1 ? void 0 : "g");
|
|
181
172
|
}
|
|
182
|
-
const
|
|
183
|
-
function
|
|
184
|
-
if (typeof
|
|
185
|
-
return
|
|
173
|
+
const uD = DD();
|
|
174
|
+
function P$1(e$1) {
|
|
175
|
+
if (typeof e$1 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e$1}\``);
|
|
176
|
+
return e$1.replace(uD, "");
|
|
186
177
|
}
|
|
187
|
-
function
|
|
188
|
-
return
|
|
178
|
+
function L$1(e$1) {
|
|
179
|
+
return e$1 && e$1.__esModule && Object.prototype.hasOwnProperty.call(e$1, "default") ? e$1.default : e$1;
|
|
189
180
|
}
|
|
190
|
-
var
|
|
191
|
-
(function(
|
|
181
|
+
var W$1 = { exports: {} };
|
|
182
|
+
(function(e$1) {
|
|
192
183
|
var u$1 = {};
|
|
193
|
-
|
|
194
|
-
var s =
|
|
184
|
+
e$1.exports = u$1, u$1.eastAsianWidth = function(F$1) {
|
|
185
|
+
var s = F$1.charCodeAt(0), i = F$1.length == 2 ? F$1.charCodeAt(1) : 0, D$1 = s;
|
|
195
186
|
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D$1 = s << 10 | i, D$1 += 65536), D$1 == 12288 || 65281 <= D$1 && D$1 <= 65376 || 65504 <= D$1 && D$1 <= 65510 ? "F" : D$1 == 8361 || 65377 <= D$1 && D$1 <= 65470 || 65474 <= D$1 && D$1 <= 65479 || 65482 <= D$1 && D$1 <= 65487 || 65490 <= D$1 && D$1 <= 65495 || 65498 <= D$1 && D$1 <= 65500 || 65512 <= D$1 && D$1 <= 65518 ? "H" : 4352 <= D$1 && D$1 <= 4447 || 4515 <= D$1 && D$1 <= 4519 || 4602 <= D$1 && D$1 <= 4607 || 9001 <= D$1 && D$1 <= 9002 || 11904 <= D$1 && D$1 <= 11929 || 11931 <= D$1 && D$1 <= 12019 || 12032 <= D$1 && D$1 <= 12245 || 12272 <= D$1 && D$1 <= 12283 || 12289 <= D$1 && D$1 <= 12350 || 12353 <= D$1 && D$1 <= 12438 || 12441 <= D$1 && D$1 <= 12543 || 12549 <= D$1 && D$1 <= 12589 || 12593 <= D$1 && D$1 <= 12686 || 12688 <= D$1 && D$1 <= 12730 || 12736 <= D$1 && D$1 <= 12771 || 12784 <= D$1 && D$1 <= 12830 || 12832 <= D$1 && D$1 <= 12871 || 12880 <= D$1 && D$1 <= 13054 || 13056 <= D$1 && D$1 <= 19903 || 19968 <= D$1 && D$1 <= 42124 || 42128 <= D$1 && D$1 <= 42182 || 43360 <= D$1 && D$1 <= 43388 || 44032 <= D$1 && D$1 <= 55203 || 55216 <= D$1 && D$1 <= 55238 || 55243 <= D$1 && D$1 <= 55291 || 63744 <= D$1 && D$1 <= 64255 || 65040 <= D$1 && D$1 <= 65049 || 65072 <= D$1 && D$1 <= 65106 || 65108 <= D$1 && D$1 <= 65126 || 65128 <= D$1 && D$1 <= 65131 || 110592 <= D$1 && D$1 <= 110593 || 127488 <= D$1 && D$1 <= 127490 || 127504 <= D$1 && D$1 <= 127546 || 127552 <= D$1 && D$1 <= 127560 || 127568 <= D$1 && D$1 <= 127569 || 131072 <= D$1 && D$1 <= 194367 || 177984 <= D$1 && D$1 <= 196605 || 196608 <= D$1 && D$1 <= 262141 ? "W" : 32 <= D$1 && D$1 <= 126 || 162 <= D$1 && D$1 <= 163 || 165 <= D$1 && D$1 <= 166 || D$1 == 172 || D$1 == 175 || 10214 <= D$1 && D$1 <= 10221 || 10629 <= D$1 && D$1 <= 10630 ? "Na" : D$1 == 161 || D$1 == 164 || 167 <= D$1 && D$1 <= 168 || D$1 == 170 || 173 <= D$1 && D$1 <= 174 || 176 <= D$1 && D$1 <= 180 || 182 <= D$1 && D$1 <= 186 || 188 <= D$1 && D$1 <= 191 || D$1 == 198 || D$1 == 208 || 215 <= D$1 && D$1 <= 216 || 222 <= D$1 && D$1 <= 225 || D$1 == 230 || 232 <= D$1 && D$1 <= 234 || 236 <= D$1 && D$1 <= 237 || D$1 == 240 || 242 <= D$1 && D$1 <= 243 || 247 <= D$1 && D$1 <= 250 || D$1 == 252 || D$1 == 254 || D$1 == 257 || D$1 == 273 || D$1 == 275 || D$1 == 283 || 294 <= D$1 && D$1 <= 295 || D$1 == 299 || 305 <= D$1 && D$1 <= 307 || D$1 == 312 || 319 <= D$1 && D$1 <= 322 || D$1 == 324 || 328 <= D$1 && D$1 <= 331 || D$1 == 333 || 338 <= D$1 && D$1 <= 339 || 358 <= D$1 && D$1 <= 359 || D$1 == 363 || D$1 == 462 || D$1 == 464 || D$1 == 466 || D$1 == 468 || D$1 == 470 || D$1 == 472 || D$1 == 474 || D$1 == 476 || D$1 == 593 || D$1 == 609 || D$1 == 708 || D$1 == 711 || 713 <= D$1 && D$1 <= 715 || D$1 == 717 || D$1 == 720 || 728 <= D$1 && D$1 <= 731 || D$1 == 733 || D$1 == 735 || 768 <= D$1 && D$1 <= 879 || 913 <= D$1 && D$1 <= 929 || 931 <= D$1 && D$1 <= 937 || 945 <= D$1 && D$1 <= 961 || 963 <= D$1 && D$1 <= 969 || D$1 == 1025 || 1040 <= D$1 && D$1 <= 1103 || D$1 == 1105 || D$1 == 8208 || 8211 <= D$1 && D$1 <= 8214 || 8216 <= D$1 && D$1 <= 8217 || 8220 <= D$1 && D$1 <= 8221 || 8224 <= D$1 && D$1 <= 8226 || 8228 <= D$1 && D$1 <= 8231 || D$1 == 8240 || 8242 <= D$1 && D$1 <= 8243 || D$1 == 8245 || D$1 == 8251 || D$1 == 8254 || D$1 == 8308 || D$1 == 8319 || 8321 <= D$1 && D$1 <= 8324 || D$1 == 8364 || D$1 == 8451 || D$1 == 8453 || D$1 == 8457 || D$1 == 8467 || D$1 == 8470 || 8481 <= D$1 && D$1 <= 8482 || D$1 == 8486 || D$1 == 8491 || 8531 <= D$1 && D$1 <= 8532 || 8539 <= D$1 && D$1 <= 8542 || 8544 <= D$1 && D$1 <= 8555 || 8560 <= D$1 && D$1 <= 8569 || D$1 == 8585 || 8592 <= D$1 && D$1 <= 8601 || 8632 <= D$1 && D$1 <= 8633 || D$1 == 8658 || D$1 == 8660 || D$1 == 8679 || D$1 == 8704 || 8706 <= D$1 && D$1 <= 8707 || 8711 <= D$1 && D$1 <= 8712 || D$1 == 8715 || D$1 == 8719 || D$1 == 8721 || D$1 == 8725 || D$1 == 8730 || 8733 <= D$1 && D$1 <= 8736 || D$1 == 8739 || D$1 == 8741 || 8743 <= D$1 && D$1 <= 8748 || D$1 == 8750 || 8756 <= D$1 && D$1 <= 8759 || 8764 <= D$1 && D$1 <= 8765 || D$1 == 8776 || D$1 == 8780 || D$1 == 8786 || 8800 <= D$1 && D$1 <= 8801 || 8804 <= D$1 && D$1 <= 8807 || 8810 <= D$1 && D$1 <= 8811 || 8814 <= D$1 && D$1 <= 8815 || 8834 <= D$1 && D$1 <= 8835 || 8838 <= D$1 && D$1 <= 8839 || D$1 == 8853 || D$1 == 8857 || D$1 == 8869 || D$1 == 8895 || D$1 == 8978 || 9312 <= D$1 && D$1 <= 9449 || 9451 <= D$1 && D$1 <= 9547 || 9552 <= D$1 && D$1 <= 9587 || 9600 <= D$1 && D$1 <= 9615 || 9618 <= D$1 && D$1 <= 9621 || 9632 <= D$1 && D$1 <= 9633 || 9635 <= D$1 && D$1 <= 9641 || 9650 <= D$1 && D$1 <= 9651 || 9654 <= D$1 && D$1 <= 9655 || 9660 <= D$1 && D$1 <= 9661 || 9664 <= D$1 && D$1 <= 9665 || 9670 <= D$1 && D$1 <= 9672 || D$1 == 9675 || 9678 <= D$1 && D$1 <= 9681 || 9698 <= D$1 && D$1 <= 9701 || D$1 == 9711 || 9733 <= D$1 && D$1 <= 9734 || D$1 == 9737 || 9742 <= D$1 && D$1 <= 9743 || 9748 <= D$1 && D$1 <= 9749 || D$1 == 9756 || D$1 == 9758 || D$1 == 9792 || D$1 == 9794 || 9824 <= D$1 && D$1 <= 9825 || 9827 <= D$1 && D$1 <= 9829 || 9831 <= D$1 && D$1 <= 9834 || 9836 <= D$1 && D$1 <= 9837 || D$1 == 9839 || 9886 <= D$1 && D$1 <= 9887 || 9918 <= D$1 && D$1 <= 9919 || 9924 <= D$1 && D$1 <= 9933 || 9935 <= D$1 && D$1 <= 9953 || D$1 == 9955 || 9960 <= D$1 && D$1 <= 9983 || D$1 == 10045 || D$1 == 10071 || 10102 <= D$1 && D$1 <= 10111 || 11093 <= D$1 && D$1 <= 11097 || 12872 <= D$1 && D$1 <= 12879 || 57344 <= D$1 && D$1 <= 63743 || 65024 <= D$1 && D$1 <= 65039 || D$1 == 65533 || 127232 <= D$1 && D$1 <= 127242 || 127248 <= D$1 && D$1 <= 127277 || 127280 <= D$1 && D$1 <= 127337 || 127344 <= D$1 && D$1 <= 127386 || 917760 <= D$1 && D$1 <= 917999 || 983040 <= D$1 && D$1 <= 1048573 || 1048576 <= D$1 && D$1 <= 1114109 ? "A" : "N";
|
|
196
|
-
}, u$1.characterLength = function(
|
|
197
|
-
var s = this.eastAsianWidth(
|
|
187
|
+
}, u$1.characterLength = function(F$1) {
|
|
188
|
+
var s = this.eastAsianWidth(F$1);
|
|
198
189
|
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
199
190
|
};
|
|
200
|
-
function F$1
|
|
201
|
-
return
|
|
191
|
+
function t(F$1) {
|
|
192
|
+
return F$1.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
202
193
|
}
|
|
203
|
-
u$1.length = function(
|
|
204
|
-
for (var s = F$1
|
|
194
|
+
u$1.length = function(F$1) {
|
|
195
|
+
for (var s = t(F$1), i = 0, D$1 = 0; D$1 < s.length; D$1++) i = i + this.characterLength(s[D$1]);
|
|
205
196
|
return i;
|
|
206
|
-
}, u$1.slice = function(
|
|
207
|
-
textLen = u$1.length(
|
|
208
|
-
for (var D$1 = "", C$1 = 0,
|
|
209
|
-
var a =
|
|
210
|
-
if (C$1 >= s - (
|
|
197
|
+
}, u$1.slice = function(F$1, s, i) {
|
|
198
|
+
textLen = u$1.length(F$1), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
199
|
+
for (var D$1 = "", C$1 = 0, n = t(F$1), E = 0; E < n.length; E++) {
|
|
200
|
+
var a = n[E], o$1 = u$1.length(a);
|
|
201
|
+
if (C$1 >= s - (o$1 == 2 ? 1 : 0)) if (C$1 + o$1 <= i) D$1 += a;
|
|
211
202
|
else break;
|
|
212
|
-
C$1 +=
|
|
203
|
+
C$1 += o$1;
|
|
213
204
|
}
|
|
214
205
|
return D$1;
|
|
215
206
|
};
|
|
216
|
-
})(
|
|
217
|
-
var
|
|
218
|
-
const
|
|
219
|
-
var
|
|
207
|
+
})(W$1);
|
|
208
|
+
var tD = W$1.exports;
|
|
209
|
+
const eD = L$1(tD);
|
|
210
|
+
var FD = function() {
|
|
220
211
|
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;
|
|
221
212
|
};
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
if (typeof
|
|
213
|
+
const sD = L$1(FD);
|
|
214
|
+
function p(e$1, u$1 = {}) {
|
|
215
|
+
if (typeof e$1 != "string" || e$1.length === 0 || (u$1 = {
|
|
225
216
|
ambiguousIsNarrow: !0,
|
|
226
217
|
...u$1
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
for (const s of
|
|
218
|
+
}, e$1 = P$1(e$1), e$1.length === 0)) return 0;
|
|
219
|
+
e$1 = e$1.replace(sD(), " ");
|
|
220
|
+
const t = u$1.ambiguousIsNarrow ? 1 : 2;
|
|
221
|
+
let F$1 = 0;
|
|
222
|
+
for (const s of e$1) {
|
|
232
223
|
const i = s.codePointAt(0);
|
|
233
224
|
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
234
|
-
switch (
|
|
225
|
+
switch (eD.eastAsianWidth(s)) {
|
|
235
226
|
case "F":
|
|
236
227
|
case "W":
|
|
237
|
-
|
|
228
|
+
F$1 += 2;
|
|
238
229
|
break;
|
|
239
230
|
case "A":
|
|
240
|
-
|
|
231
|
+
F$1 += t;
|
|
241
232
|
break;
|
|
242
|
-
default:
|
|
233
|
+
default: F$1 += 1;
|
|
243
234
|
}
|
|
244
235
|
}
|
|
245
|
-
return
|
|
236
|
+
return F$1;
|
|
246
237
|
}
|
|
247
|
-
const
|
|
238
|
+
const w = 10, N = (e$1 = 0) => (u$1) => `\x1B[${u$1 + e$1}m`, I = (e$1 = 0) => (u$1) => `\x1B[${38 + e$1};5;${u$1}m`, R = (e$1 = 0) => (u$1, t, F$1) => `\x1B[${38 + e$1};2;${u$1};${t};${F$1}m`, r = {
|
|
248
239
|
modifier: {
|
|
249
240
|
reset: [0, 0],
|
|
250
241
|
bold: [1, 22],
|
|
@@ -298,39 +289,39 @@ const m = 10, L$1 = (t = 0) => (u$1) => `\x1B[${u$1 + t}m`, N = (t = 0) => (u$1)
|
|
|
298
289
|
}
|
|
299
290
|
};
|
|
300
291
|
Object.keys(r.modifier);
|
|
301
|
-
const
|
|
302
|
-
[...
|
|
303
|
-
function
|
|
304
|
-
const
|
|
305
|
-
for (const [u$1,
|
|
306
|
-
for (const [
|
|
292
|
+
const iD = Object.keys(r.color), CD = Object.keys(r.bgColor);
|
|
293
|
+
[...iD, ...CD];
|
|
294
|
+
function rD() {
|
|
295
|
+
const e$1 = /* @__PURE__ */ new Map();
|
|
296
|
+
for (const [u$1, t] of Object.entries(r)) {
|
|
297
|
+
for (const [F$1, s] of Object.entries(t)) r[F$1] = {
|
|
307
298
|
open: `\x1B[${s[0]}m`,
|
|
308
299
|
close: `\x1B[${s[1]}m`
|
|
309
|
-
}, F$1
|
|
300
|
+
}, t[F$1] = r[F$1], e$1.set(s[0], s[1]);
|
|
310
301
|
Object.defineProperty(r, u$1, {
|
|
311
|
-
value:
|
|
302
|
+
value: t,
|
|
312
303
|
enumerable: !1
|
|
313
304
|
});
|
|
314
305
|
}
|
|
315
306
|
return Object.defineProperty(r, "codes", {
|
|
316
|
-
value:
|
|
307
|
+
value: e$1,
|
|
317
308
|
enumerable: !1
|
|
318
|
-
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi =
|
|
309
|
+
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, {
|
|
319
310
|
rgbToAnsi256: {
|
|
320
|
-
value: (u$1, F$1
|
|
311
|
+
value: (u$1, t, F$1) => u$1 === t && t === F$1 ? u$1 < 8 ? 16 : u$1 > 248 ? 231 : Math.round((u$1 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$1 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F$1 / 255 * 5),
|
|
321
312
|
enumerable: !1
|
|
322
313
|
},
|
|
323
314
|
hexToRgb: {
|
|
324
315
|
value: (u$1) => {
|
|
325
|
-
const
|
|
326
|
-
if (!
|
|
316
|
+
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$1.toString(16));
|
|
317
|
+
if (!t) return [
|
|
327
318
|
0,
|
|
328
319
|
0,
|
|
329
320
|
0
|
|
330
321
|
];
|
|
331
|
-
let [
|
|
332
|
-
|
|
333
|
-
const s = Number.parseInt(
|
|
322
|
+
let [F$1] = t;
|
|
323
|
+
F$1.length === 3 && (F$1 = [...F$1].map((i) => i + i).join(""));
|
|
324
|
+
const s = Number.parseInt(F$1, 16);
|
|
334
325
|
return [
|
|
335
326
|
s >> 16 & 255,
|
|
336
327
|
s >> 8 & 255,
|
|
@@ -347,22 +338,22 @@ function sD() {
|
|
|
347
338
|
value: (u$1) => {
|
|
348
339
|
if (u$1 < 8) return 30 + u$1;
|
|
349
340
|
if (u$1 < 16) return 90 + (u$1 - 8);
|
|
350
|
-
let F$1,
|
|
351
|
-
if (u$1 >= 232)
|
|
341
|
+
let t, F$1, s;
|
|
342
|
+
if (u$1 >= 232) t = ((u$1 - 232) * 10 + 8) / 255, F$1 = t, s = t;
|
|
352
343
|
else {
|
|
353
344
|
u$1 -= 16;
|
|
354
345
|
const C$1 = u$1 % 36;
|
|
355
|
-
|
|
346
|
+
t = Math.floor(u$1 / 36) / 5, F$1 = Math.floor(C$1 / 6) / 5, s = C$1 % 6 / 5;
|
|
356
347
|
}
|
|
357
|
-
const i = Math.max(F$1,
|
|
348
|
+
const i = Math.max(t, F$1, s) * 2;
|
|
358
349
|
if (i === 0) return 30;
|
|
359
|
-
let D$1 = 30 + (Math.round(s) << 2 | Math.round(
|
|
350
|
+
let D$1 = 30 + (Math.round(s) << 2 | Math.round(F$1) << 1 | Math.round(t));
|
|
360
351
|
return i === 2 && (D$1 += 60), D$1;
|
|
361
352
|
},
|
|
362
353
|
enumerable: !1
|
|
363
354
|
},
|
|
364
355
|
rgbToAnsi: {
|
|
365
|
-
value: (u$1, F$1
|
|
356
|
+
value: (u$1, t, F$1) => r.ansi256ToAnsi(r.rgbToAnsi256(u$1, t, F$1)),
|
|
366
357
|
enumerable: !1
|
|
367
358
|
},
|
|
368
359
|
hexToAnsi: {
|
|
@@ -371,74 +362,74 @@ function sD() {
|
|
|
371
362
|
}
|
|
372
363
|
}), r;
|
|
373
364
|
}
|
|
374
|
-
const
|
|
375
|
-
const
|
|
376
|
-
let s = !1, i = !1, D$1 =
|
|
377
|
-
for (const [C$1,
|
|
378
|
-
const E =
|
|
379
|
-
if (D$1 + E <=
|
|
380
|
-
i ?
|
|
365
|
+
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$1) => p(u$1)), k$1 = (e$1, u$1, t) => {
|
|
366
|
+
const F$1 = [...u$1];
|
|
367
|
+
let s = !1, i = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
368
|
+
for (const [C$1, n] of F$1.entries()) {
|
|
369
|
+
const E = p(n);
|
|
370
|
+
if (D$1 + E <= t ? e$1[e$1.length - 1] += n : (e$1.push(n), D$1 = 0), d$1.has(n) && (s = !0, i = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
|
|
371
|
+
i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
|
|
381
372
|
continue;
|
|
382
373
|
}
|
|
383
|
-
D$1 += E, D$1 ===
|
|
384
|
-
}
|
|
385
|
-
!D$1 &&
|
|
386
|
-
},
|
|
387
|
-
const u$1 =
|
|
388
|
-
let
|
|
389
|
-
for (;
|
|
390
|
-
return
|
|
391
|
-
},
|
|
392
|
-
if (
|
|
393
|
-
let
|
|
394
|
-
const D$1 =
|
|
374
|
+
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
375
|
+
}
|
|
376
|
+
!D$1 && e$1[e$1.length - 1].length > 0 && e$1.length > 1 && (e$1[e$1.length - 2] += e$1.pop());
|
|
377
|
+
}, hD = (e$1) => {
|
|
378
|
+
const u$1 = e$1.split(" ");
|
|
379
|
+
let t = u$1.length;
|
|
380
|
+
for (; t > 0 && !(p(u$1[t - 1]) > 0);) t--;
|
|
381
|
+
return t === u$1.length ? e$1 : u$1.slice(0, t).join(" ") + u$1.slice(t).join("");
|
|
382
|
+
}, lD = (e$1, u$1, t = {}) => {
|
|
383
|
+
if (t.trim !== !1 && e$1.trim() === "") return "";
|
|
384
|
+
let F$1 = "", s, i;
|
|
385
|
+
const D$1 = aD(e$1);
|
|
395
386
|
let C$1 = [""];
|
|
396
|
-
for (const [E, a] of
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
if (E !== 0 && (
|
|
400
|
-
const
|
|
401
|
-
Math.floor((D$1[E] - 1) / u$1) <
|
|
387
|
+
for (const [E, a] of e$1.split(" ").entries()) {
|
|
388
|
+
t.trim !== !1 && (C$1[C$1.length - 1] = C$1[C$1.length - 1].trimStart());
|
|
389
|
+
let o$1 = p(C$1[C$1.length - 1]);
|
|
390
|
+
if (E !== 0 && (o$1 >= u$1 && (t.wordWrap === !1 || t.trim === !1) && (C$1.push(""), o$1 = 0), (o$1 > 0 || t.trim === !1) && (C$1[C$1.length - 1] += " ", o$1++)), t.hard && D$1[E] > u$1) {
|
|
391
|
+
const c = u$1 - o$1, f = 1 + Math.floor((D$1[E] - c - 1) / u$1);
|
|
392
|
+
Math.floor((D$1[E] - 1) / u$1) < f && C$1.push(""), k$1(C$1, a, u$1);
|
|
402
393
|
continue;
|
|
403
394
|
}
|
|
404
|
-
if (
|
|
405
|
-
if (
|
|
406
|
-
|
|
395
|
+
if (o$1 + D$1[E] > u$1 && o$1 > 0 && D$1[E] > 0) {
|
|
396
|
+
if (t.wordWrap === !1 && o$1 < u$1) {
|
|
397
|
+
k$1(C$1, a, u$1);
|
|
407
398
|
continue;
|
|
408
399
|
}
|
|
409
400
|
C$1.push("");
|
|
410
401
|
}
|
|
411
|
-
if (
|
|
412
|
-
|
|
402
|
+
if (o$1 + D$1[E] > u$1 && t.wordWrap === !1) {
|
|
403
|
+
k$1(C$1, a, u$1);
|
|
413
404
|
continue;
|
|
414
405
|
}
|
|
415
406
|
C$1[C$1.length - 1] += a;
|
|
416
407
|
}
|
|
417
|
-
|
|
418
|
-
const
|
|
408
|
+
t.trim !== !1 && (C$1 = C$1.map((E) => hD(E)));
|
|
409
|
+
const n = [...C$1.join(`
|
|
419
410
|
`)];
|
|
420
|
-
for (const [E, a] of
|
|
421
|
-
if (
|
|
422
|
-
const { groups:
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
425
|
-
s =
|
|
426
|
-
} else
|
|
411
|
+
for (const [E, a] of n.entries()) {
|
|
412
|
+
if (F$1 += a, d$1.has(a)) {
|
|
413
|
+
const { groups: c } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n.slice(E).join("")) || { groups: {} };
|
|
414
|
+
if (c.code !== void 0) {
|
|
415
|
+
const f = Number.parseFloat(c.code);
|
|
416
|
+
s = f === oD ? void 0 : f;
|
|
417
|
+
} else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
|
|
427
418
|
}
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
` ? (i && (
|
|
431
|
-
` && (s &&
|
|
419
|
+
const o$1 = ED.codes.get(Number(s));
|
|
420
|
+
n[E + 1] === `
|
|
421
|
+
` ? (i && (F$1 += K$1("")), s && o$1 && (F$1 += z(o$1))) : a === `
|
|
422
|
+
` && (s && o$1 && (F$1 += z(s)), i && (F$1 += K$1(i)));
|
|
432
423
|
}
|
|
433
|
-
return
|
|
424
|
+
return F$1;
|
|
434
425
|
};
|
|
435
|
-
function
|
|
436
|
-
return String(
|
|
426
|
+
function Y$1(e$1, u$1, t) {
|
|
427
|
+
return String(e$1).normalize().replace(/\r\n/g, `
|
|
437
428
|
`).split(`
|
|
438
|
-
`).map((
|
|
429
|
+
`).map((F$1) => lD(F$1, u$1, t)).join(`
|
|
439
430
|
`);
|
|
440
431
|
}
|
|
441
|
-
const
|
|
432
|
+
const xD = [
|
|
442
433
|
"up",
|
|
443
434
|
"down",
|
|
444
435
|
"left",
|
|
@@ -446,8 +437,8 @@ const aD = [
|
|
|
446
437
|
"space",
|
|
447
438
|
"enter",
|
|
448
439
|
"cancel"
|
|
449
|
-
],
|
|
450
|
-
actions: new Set(
|
|
440
|
+
], B = {
|
|
441
|
+
actions: new Set(xD),
|
|
451
442
|
aliases: new Map([
|
|
452
443
|
["k", "up"],
|
|
453
444
|
["j", "down"],
|
|
@@ -457,167 +448,168 @@ const aD = [
|
|
|
457
448
|
["escape", "cancel"]
|
|
458
449
|
])
|
|
459
450
|
};
|
|
460
|
-
function
|
|
461
|
-
if (typeof
|
|
462
|
-
for (const
|
|
451
|
+
function $(e$1, u$1) {
|
|
452
|
+
if (typeof e$1 == "string") return B.aliases.get(e$1) === u$1;
|
|
453
|
+
for (const t of e$1) if (t !== void 0 && $(t, u$1)) return !0;
|
|
463
454
|
return !1;
|
|
464
455
|
}
|
|
465
|
-
function
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
`),
|
|
456
|
+
function BD(e$1, u$1) {
|
|
457
|
+
if (e$1 === u$1) return;
|
|
458
|
+
const t = e$1.split(`
|
|
459
|
+
`), F$1 = u$1.split(`
|
|
469
460
|
`), s = [];
|
|
470
|
-
for (let i = 0; i < Math.max(
|
|
461
|
+
for (let i = 0; i < Math.max(t.length, F$1.length); i++) t[i] !== F$1[i] && s.push(i);
|
|
471
462
|
return s;
|
|
472
463
|
}
|
|
473
|
-
const
|
|
474
|
-
function
|
|
475
|
-
return
|
|
464
|
+
const AD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
|
|
465
|
+
function pD(e$1) {
|
|
466
|
+
return e$1 === S;
|
|
476
467
|
}
|
|
477
|
-
function
|
|
478
|
-
const
|
|
479
|
-
|
|
468
|
+
function m(e$1, u$1) {
|
|
469
|
+
const t = e$1;
|
|
470
|
+
t.isTTY && t.setRawMode(u$1);
|
|
480
471
|
}
|
|
481
|
-
function
|
|
482
|
-
const s =
|
|
483
|
-
input:
|
|
472
|
+
function fD({ input: e$1 = stdin, output: u$1 = stdout, overwrite: t = !0, hideCursor: F$1 = !0 } = {}) {
|
|
473
|
+
const s = g.createInterface({
|
|
474
|
+
input: e$1,
|
|
484
475
|
output: u$1,
|
|
485
476
|
prompt: "",
|
|
486
477
|
tabSize: 1
|
|
487
478
|
});
|
|
488
|
-
|
|
489
|
-
const i = (D$1, { name: C$1, sequence:
|
|
479
|
+
g.emitKeypressEvents(e$1, s), e$1.isTTY && e$1.setRawMode(!0);
|
|
480
|
+
const i = (D$1, { name: C$1, sequence: n }) => {
|
|
490
481
|
const E = String(D$1);
|
|
491
|
-
if (
|
|
482
|
+
if ($([
|
|
492
483
|
E,
|
|
493
484
|
C$1,
|
|
494
|
-
|
|
485
|
+
n
|
|
495
486
|
], "cancel")) {
|
|
496
|
-
|
|
487
|
+
F$1 && u$1.write(import_src$1.cursor.show), process.exit(0);
|
|
497
488
|
return;
|
|
498
489
|
}
|
|
499
|
-
if (!
|
|
500
|
-
const a = C$1 === "return" ? 0 : -1,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
490
|
+
if (!t) return;
|
|
491
|
+
const a = C$1 === "return" ? 0 : -1, o$1 = C$1 === "return" ? -1 : 0;
|
|
492
|
+
g.moveCursor(u$1, a, o$1, () => {
|
|
493
|
+
g.clearLine(u$1, 1, () => {
|
|
494
|
+
e$1.once("keypress", i);
|
|
504
495
|
});
|
|
505
496
|
});
|
|
506
497
|
};
|
|
507
|
-
return
|
|
508
|
-
|
|
498
|
+
return F$1 && u$1.write(import_src$1.cursor.hide), e$1.once("keypress", i), () => {
|
|
499
|
+
e$1.off("keypress", i), F$1 && u$1.write(import_src$1.cursor.show), e$1.isTTY && !AD && e$1.setRawMode(!1), s.terminal = !1, s.close();
|
|
509
500
|
};
|
|
510
501
|
}
|
|
511
|
-
var
|
|
502
|
+
var gD = Object.defineProperty, vD = (e$1, u$1, t) => u$1 in e$1 ? gD(e$1, u$1, {
|
|
512
503
|
enumerable: !0,
|
|
513
504
|
configurable: !0,
|
|
514
505
|
writable: !0,
|
|
515
|
-
value:
|
|
516
|
-
}) :
|
|
517
|
-
var x = class {
|
|
518
|
-
constructor(u$1,
|
|
519
|
-
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", !1), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
520
|
-
const { input:
|
|
521
|
-
this.opts = C$1, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track =
|
|
506
|
+
value: t
|
|
507
|
+
}) : e$1[u$1] = t, h = (e$1, u$1, t) => (vD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
|
|
508
|
+
var x$1 = class {
|
|
509
|
+
constructor(u$1, t = !0) {
|
|
510
|
+
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", !1), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
511
|
+
const { input: F$1 = stdin, output: s = stdout, render: i, signal: D$1,...C$1 } = u$1;
|
|
512
|
+
this.opts = C$1, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D$1, this.input = F$1, this.output = s;
|
|
522
513
|
}
|
|
523
514
|
unsubscribe() {
|
|
524
515
|
this._subscribers.clear();
|
|
525
516
|
}
|
|
526
|
-
setSubscriber(u$1,
|
|
527
|
-
const
|
|
528
|
-
|
|
517
|
+
setSubscriber(u$1, t) {
|
|
518
|
+
const F$1 = this._subscribers.get(u$1) ?? [];
|
|
519
|
+
F$1.push(t), this._subscribers.set(u$1, F$1);
|
|
529
520
|
}
|
|
530
|
-
on(u$1,
|
|
531
|
-
this.setSubscriber(u$1, { cb:
|
|
521
|
+
on(u$1, t) {
|
|
522
|
+
this.setSubscriber(u$1, { cb: t });
|
|
532
523
|
}
|
|
533
|
-
once(u$1,
|
|
524
|
+
once(u$1, t) {
|
|
534
525
|
this.setSubscriber(u$1, {
|
|
535
|
-
cb:
|
|
526
|
+
cb: t,
|
|
536
527
|
once: !0
|
|
537
528
|
});
|
|
538
529
|
}
|
|
539
|
-
emit(u$1, ...
|
|
540
|
-
const
|
|
541
|
-
for (const i of
|
|
530
|
+
emit(u$1, ...t) {
|
|
531
|
+
const F$1 = this._subscribers.get(u$1) ?? [], s = [];
|
|
532
|
+
for (const i of F$1) i.cb(...t), i.once && s.push(() => F$1.splice(F$1.indexOf(i), 1));
|
|
542
533
|
for (const i of s) i();
|
|
543
534
|
}
|
|
544
535
|
prompt() {
|
|
545
|
-
return new Promise((u$1,
|
|
536
|
+
return new Promise((u$1, t) => {
|
|
546
537
|
if (this._abortSignal) {
|
|
547
538
|
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$1(S);
|
|
548
539
|
this._abortSignal.addEventListener("abort", () => {
|
|
549
540
|
this.state = "cancel", this.close();
|
|
550
541
|
}, { once: !0 });
|
|
551
542
|
}
|
|
552
|
-
const
|
|
553
|
-
|
|
543
|
+
const F$1 = new Writable();
|
|
544
|
+
F$1._write = (s, i, D$1) => {
|
|
554
545
|
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$1();
|
|
555
|
-
}, this.input.pipe(
|
|
546
|
+
}, this.input.pipe(F$1), this.rl = O.createInterface({
|
|
556
547
|
input: this.input,
|
|
557
|
-
output:
|
|
548
|
+
output: F$1,
|
|
558
549
|
tabSize: 2,
|
|
559
550
|
prompt: "",
|
|
560
|
-
escapeCodeTimeout: 50
|
|
561
|
-
|
|
562
|
-
|
|
551
|
+
escapeCodeTimeout: 50,
|
|
552
|
+
terminal: !0
|
|
553
|
+
}), O.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), m(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
554
|
+
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(this.value);
|
|
563
555
|
}), this.once("cancel", () => {
|
|
564
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
556
|
+
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(S);
|
|
565
557
|
});
|
|
566
558
|
});
|
|
567
559
|
}
|
|
568
|
-
onKeypress(u$1,
|
|
569
|
-
if (this.state === "error" && (this.state = "active"),
|
|
560
|
+
onKeypress(u$1, t) {
|
|
561
|
+
if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u$1 && (u$1.toLowerCase() === "y" || u$1.toLowerCase() === "n") && this.emit("confirm", u$1.toLowerCase() === "y"), u$1 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$1 && this.emit("key", u$1.toLowerCase()), t?.name === "return") {
|
|
570
562
|
if (this.opts.validate) {
|
|
571
|
-
const
|
|
572
|
-
|
|
563
|
+
const F$1 = this.opts.validate(this.value);
|
|
564
|
+
F$1 && (this.error = F$1 instanceof Error ? F$1.message : F$1, this.state = "error", this.rl?.write(this.value));
|
|
573
565
|
}
|
|
574
566
|
this.state !== "error" && (this.state = "submit");
|
|
575
567
|
}
|
|
576
|
-
|
|
568
|
+
$([
|
|
577
569
|
u$1,
|
|
578
|
-
|
|
579
|
-
|
|
570
|
+
t?.name,
|
|
571
|
+
t?.sequence
|
|
580
572
|
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
581
573
|
}
|
|
582
574
|
close() {
|
|
583
575
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
584
|
-
`),
|
|
576
|
+
`), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
585
577
|
}
|
|
586
578
|
restoreCursor() {
|
|
587
|
-
const u$1 =
|
|
579
|
+
const u$1 = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
|
|
588
580
|
`).length - 1;
|
|
589
|
-
this.output.write(import_src.cursor.move(-999, u$1 * -1));
|
|
581
|
+
this.output.write(import_src$1.cursor.move(-999, u$1 * -1));
|
|
590
582
|
}
|
|
591
583
|
render() {
|
|
592
|
-
const u$1 =
|
|
584
|
+
const u$1 = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
|
|
593
585
|
if (u$1 !== this._prevFrame) {
|
|
594
|
-
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
586
|
+
if (this.state === "initial") this.output.write(import_src$1.cursor.hide);
|
|
595
587
|
else {
|
|
596
|
-
const
|
|
597
|
-
if (this.restoreCursor(),
|
|
598
|
-
const
|
|
599
|
-
this.output.write(import_src.cursor.move(0,
|
|
588
|
+
const t = BD(this._prevFrame, u$1);
|
|
589
|
+
if (this.restoreCursor(), t && t?.length === 1) {
|
|
590
|
+
const F$1 = t[0];
|
|
591
|
+
this.output.write(import_src$1.cursor.move(0, F$1)), this.output.write(import_src$1.erase.lines(1));
|
|
600
592
|
const s = u$1.split(`
|
|
601
593
|
`);
|
|
602
|
-
this.output.write(s[
|
|
594
|
+
this.output.write(s[F$1]), this._prevFrame = u$1, this.output.write(import_src$1.cursor.move(0, s.length - F$1 - 1));
|
|
603
595
|
return;
|
|
604
596
|
}
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
this.output.write(import_src.cursor.move(0,
|
|
597
|
+
if (t && t?.length > 1) {
|
|
598
|
+
const F$1 = t[0];
|
|
599
|
+
this.output.write(import_src$1.cursor.move(0, F$1)), this.output.write(import_src$1.erase.down());
|
|
608
600
|
const s = u$1.split(`
|
|
609
|
-
`).slice(
|
|
601
|
+
`).slice(F$1);
|
|
610
602
|
this.output.write(s.join(`
|
|
611
603
|
`)), this._prevFrame = u$1;
|
|
612
604
|
return;
|
|
613
605
|
}
|
|
614
|
-
this.output.write(import_src.erase.down());
|
|
606
|
+
this.output.write(import_src$1.erase.down());
|
|
615
607
|
}
|
|
616
608
|
this.output.write(u$1), this.state === "initial" && (this.state = "active"), this._prevFrame = u$1;
|
|
617
609
|
}
|
|
618
610
|
}
|
|
619
611
|
};
|
|
620
|
-
var
|
|
612
|
+
var dD = class extends x$1 {
|
|
621
613
|
get cursor() {
|
|
622
614
|
return this.value ? 0 : 1;
|
|
623
615
|
}
|
|
@@ -627,40 +619,51 @@ var fD = class extends x {
|
|
|
627
619
|
constructor(u$1) {
|
|
628
620
|
super(u$1, !1), this.value = !!u$1.initialValue, this.on("value", () => {
|
|
629
621
|
this.value = this._value;
|
|
630
|
-
}), this.on("confirm", (
|
|
631
|
-
this.output.write(import_src.cursor.move(0, -1)), this.value =
|
|
622
|
+
}), this.on("confirm", (t) => {
|
|
623
|
+
this.output.write(import_src$1.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
632
624
|
}), this.on("cursor", () => {
|
|
633
625
|
this.value = !this.value;
|
|
634
626
|
});
|
|
635
627
|
}
|
|
636
628
|
};
|
|
637
|
-
var
|
|
629
|
+
var mD = Object.defineProperty, bD = (e$1, u$1, t) => u$1 in e$1 ? mD(e$1, u$1, {
|
|
638
630
|
enumerable: !0,
|
|
639
631
|
configurable: !0,
|
|
640
632
|
writable: !0,
|
|
641
|
-
value:
|
|
642
|
-
}) :
|
|
643
|
-
|
|
633
|
+
value: t
|
|
634
|
+
}) : e$1[u$1] = t, Z = (e$1, u$1, t) => (bD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t), q$1 = (e$1, u$1, t) => {
|
|
635
|
+
if (!u$1.has(e$1)) throw TypeError("Cannot " + t);
|
|
636
|
+
}, T$1 = (e$1, u$1, t) => (q$1(e$1, u$1, "read from private field"), t ? t.call(e$1) : u$1.get(e$1)), wD = (e$1, u$1, t) => {
|
|
637
|
+
if (u$1.has(e$1)) throw TypeError("Cannot add the same private member more than once");
|
|
638
|
+
u$1 instanceof WeakSet ? u$1.add(e$1) : u$1.set(e$1, t);
|
|
639
|
+
}, yD = (e$1, u$1, t, F$1) => (q$1(e$1, u$1, "write to private field"), F$1 ? F$1.call(e$1, t) : u$1.set(e$1, t), t), A$1;
|
|
640
|
+
let _D = class extends x$1 {
|
|
644
641
|
constructor(u$1) {
|
|
645
|
-
super(u$1, !1),
|
|
646
|
-
const { options:
|
|
647
|
-
this.options = Object.entries(
|
|
648
|
-
value:
|
|
642
|
+
super(u$1, !1), Z(this, "options"), Z(this, "cursor", 0), wD(this, A$1, void 0);
|
|
643
|
+
const { options: t } = u$1;
|
|
644
|
+
yD(this, A$1, u$1.selectableGroups !== !1), this.options = Object.entries(t).flatMap(([F$1, s]) => [{
|
|
645
|
+
value: F$1,
|
|
649
646
|
group: !0,
|
|
650
|
-
label:
|
|
647
|
+
label: F$1
|
|
651
648
|
}, ...s.map((i) => ({
|
|
652
649
|
...i,
|
|
653
|
-
group:
|
|
654
|
-
}))]), this.value = [...u$1.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value:
|
|
655
|
-
switch (
|
|
650
|
+
group: F$1
|
|
651
|
+
}))]), this.value = [...u$1.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F$1 }) => F$1 === u$1.cursorAt), T$1(this, A$1) ? 0 : 1), this.on("cursor", (F$1) => {
|
|
652
|
+
switch (F$1) {
|
|
656
653
|
case "left":
|
|
657
|
-
case "up":
|
|
654
|
+
case "up": {
|
|
658
655
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
656
|
+
const s = this.options[this.cursor]?.group === !0;
|
|
657
|
+
!T$1(this, A$1) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
659
658
|
break;
|
|
659
|
+
}
|
|
660
660
|
case "down":
|
|
661
|
-
case "right":
|
|
661
|
+
case "right": {
|
|
662
662
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
663
|
+
const s = this.options[this.cursor]?.group === !0;
|
|
664
|
+
!T$1(this, A$1) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
663
665
|
break;
|
|
666
|
+
}
|
|
664
667
|
case "space":
|
|
665
668
|
this.toggleValue();
|
|
666
669
|
break;
|
|
@@ -668,34 +671,35 @@ let dD = class extends x {
|
|
|
668
671
|
});
|
|
669
672
|
}
|
|
670
673
|
getGroupItems(u$1) {
|
|
671
|
-
return this.options.filter((
|
|
674
|
+
return this.options.filter((t) => t.group === u$1);
|
|
672
675
|
}
|
|
673
676
|
isGroupSelected(u$1) {
|
|
674
|
-
return this.getGroupItems(u$1).every((
|
|
677
|
+
return this.getGroupItems(u$1).every((t) => this.value.includes(t.value));
|
|
675
678
|
}
|
|
676
679
|
toggleValue() {
|
|
677
680
|
const u$1 = this.options[this.cursor];
|
|
678
681
|
if (u$1.group === !0) {
|
|
679
|
-
const
|
|
680
|
-
this.isGroupSelected(
|
|
682
|
+
const t = u$1.value, F$1 = this.getGroupItems(t);
|
|
683
|
+
this.isGroupSelected(t) ? this.value = this.value.filter((s) => F$1.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
681
684
|
} else {
|
|
682
|
-
const
|
|
683
|
-
this.value =
|
|
685
|
+
const t = this.value.includes(u$1.value);
|
|
686
|
+
this.value = t ? this.value.filter((F$1) => F$1 !== u$1.value) : [...this.value, u$1.value];
|
|
684
687
|
}
|
|
685
688
|
}
|
|
686
689
|
};
|
|
687
|
-
|
|
690
|
+
A$1 = /* @__PURE__ */ new WeakMap();
|
|
691
|
+
var kD = Object.defineProperty, $D = (e$1, u$1, t) => u$1 in e$1 ? kD(e$1, u$1, {
|
|
688
692
|
enumerable: !0,
|
|
689
693
|
configurable: !0,
|
|
690
694
|
writable: !0,
|
|
691
|
-
value:
|
|
692
|
-
}) :
|
|
693
|
-
let
|
|
695
|
+
value: t
|
|
696
|
+
}) : e$1[u$1] = t, H = (e$1, u$1, t) => ($D(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
|
|
697
|
+
let SD = class extends x$1 {
|
|
694
698
|
constructor(u$1) {
|
|
695
|
-
super(u$1, !1),
|
|
696
|
-
|
|
697
|
-
}), this.on("cursor", (
|
|
698
|
-
switch (
|
|
699
|
+
super(u$1, !1), H(this, "options"), H(this, "cursor", 0), this.options = u$1.options, this.value = [...u$1.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u$1.cursorAt), 0), this.on("key", (t) => {
|
|
700
|
+
t === "a" && this.toggleAll();
|
|
701
|
+
}), this.on("cursor", (t) => {
|
|
702
|
+
switch (t) {
|
|
699
703
|
case "left":
|
|
700
704
|
case "up":
|
|
701
705
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
@@ -715,28 +719,28 @@ let wD = class extends x {
|
|
|
715
719
|
}
|
|
716
720
|
toggleAll() {
|
|
717
721
|
const u$1 = this.value.length === this.options.length;
|
|
718
|
-
this.value = u$1 ? [] : this.options.map((
|
|
722
|
+
this.value = u$1 ? [] : this.options.map((t) => t.value);
|
|
719
723
|
}
|
|
720
724
|
toggleValue() {
|
|
721
725
|
const u$1 = this.value.includes(this._value);
|
|
722
|
-
this.value = u$1 ? this.value.filter((
|
|
726
|
+
this.value = u$1 ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
|
|
723
727
|
}
|
|
724
728
|
};
|
|
725
|
-
var
|
|
729
|
+
var TD = Object.defineProperty, jD = (e$1, u$1, t) => u$1 in e$1 ? TD(e$1, u$1, {
|
|
726
730
|
enumerable: !0,
|
|
727
731
|
configurable: !0,
|
|
728
732
|
writable: !0,
|
|
729
|
-
value:
|
|
730
|
-
}) :
|
|
731
|
-
var
|
|
732
|
-
constructor({ mask: u$1,...
|
|
733
|
-
super(
|
|
733
|
+
value: t
|
|
734
|
+
}) : e$1[u$1] = t, U$1 = (e$1, u$1, t) => (jD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
|
|
735
|
+
var MD = class extends x$1 {
|
|
736
|
+
constructor({ mask: u$1,...t }) {
|
|
737
|
+
super(t), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u$1 ?? "•", this.on("finalize", () => {
|
|
734
738
|
this.valueWithCursor = this.masked;
|
|
735
739
|
}), this.on("value", () => {
|
|
736
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
740
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors$2.default.inverse(import_picocolors$2.default.hidden("_"))}`;
|
|
737
741
|
else {
|
|
738
|
-
const
|
|
739
|
-
this.valueWithCursor = `${
|
|
742
|
+
const F$1 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
743
|
+
this.valueWithCursor = `${F$1}${import_picocolors$2.default.inverse(s[0])}${s.slice(1)}`;
|
|
740
744
|
}
|
|
741
745
|
});
|
|
742
746
|
}
|
|
@@ -747,16 +751,16 @@ var kD = class extends x {
|
|
|
747
751
|
return this.value.replaceAll(/./g, this._mask);
|
|
748
752
|
}
|
|
749
753
|
};
|
|
750
|
-
var
|
|
754
|
+
var OD = Object.defineProperty, PD = (e$1, u$1, t) => u$1 in e$1 ? OD(e$1, u$1, {
|
|
751
755
|
enumerable: !0,
|
|
752
756
|
configurable: !0,
|
|
753
757
|
writable: !0,
|
|
754
|
-
value:
|
|
755
|
-
}) :
|
|
756
|
-
var
|
|
758
|
+
value: t
|
|
759
|
+
}) : e$1[u$1] = t, J$1 = (e$1, u$1, t) => (PD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
|
|
760
|
+
var LD = class extends x$1 {
|
|
757
761
|
constructor(u$1) {
|
|
758
|
-
super(u$1, !1),
|
|
759
|
-
switch (
|
|
762
|
+
super(u$1, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u$1.options, this.cursor = this.options.findIndex(({ value: t }) => t === u$1.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
|
|
763
|
+
switch (t) {
|
|
760
764
|
case "left":
|
|
761
765
|
case "up":
|
|
762
766
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
@@ -776,29 +780,29 @@ var jD = class extends x {
|
|
|
776
780
|
this.value = this._value.value;
|
|
777
781
|
}
|
|
778
782
|
};
|
|
779
|
-
var
|
|
783
|
+
var WD = Object.defineProperty, ND = (e$1, u$1, t) => u$1 in e$1 ? WD(e$1, u$1, {
|
|
780
784
|
enumerable: !0,
|
|
781
785
|
configurable: !0,
|
|
782
786
|
writable: !0,
|
|
783
|
-
value:
|
|
784
|
-
}) :
|
|
785
|
-
var
|
|
787
|
+
value: t
|
|
788
|
+
}) : e$1[u$1] = t, Q = (e$1, u$1, t) => (ND(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
|
|
789
|
+
var ID = class extends x$1 {
|
|
786
790
|
constructor(u$1) {
|
|
787
|
-
super(u$1, !1),
|
|
788
|
-
const
|
|
789
|
-
this.cursor = Math.max(
|
|
790
|
-
if (!F$1
|
|
791
|
-
const s = this.options.find(({ value: [i] }) => i?.toLowerCase() ===
|
|
791
|
+
super(u$1, !1), Q(this, "options"), Q(this, "cursor", 0), this.options = u$1.options;
|
|
792
|
+
const t = this.options.map(({ value: [F$1] }) => F$1?.toLowerCase());
|
|
793
|
+
this.cursor = Math.max(t.indexOf(u$1.initialValue), 0), this.on("key", (F$1) => {
|
|
794
|
+
if (!t.includes(F$1)) return;
|
|
795
|
+
const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F$1);
|
|
792
796
|
s && (this.value = s.value, this.state = "submit", this.emit("submit"));
|
|
793
797
|
});
|
|
794
798
|
}
|
|
795
799
|
};
|
|
796
|
-
var
|
|
800
|
+
var RD = class extends x$1 {
|
|
797
801
|
get valueWithCursor() {
|
|
798
802
|
if (this.state === "submit") return this.value;
|
|
799
803
|
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
800
|
-
const u$1 = this.value.slice(0, this.cursor), [F$1
|
|
801
|
-
return `${u$1}${import_picocolors.default.inverse(
|
|
804
|
+
const u$1 = this.value.slice(0, this.cursor), [t, ...F$1] = this.value.slice(this.cursor);
|
|
805
|
+
return `${u$1}${import_picocolors$2.default.inverse(t)}${F$1.join("")}`;
|
|
802
806
|
}
|
|
803
807
|
get cursor() {
|
|
804
808
|
return this._cursor;
|
|
@@ -811,325 +815,339 @@ var PD = class extends x {
|
|
|
811
815
|
};
|
|
812
816
|
|
|
813
817
|
//#endregion
|
|
814
|
-
//#region node_modules/.pnpm/@clack+prompts@0.
|
|
818
|
+
//#region node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
819
|
+
var import_picocolors$1 = __toESM(require_picocolors(), 1);
|
|
820
|
+
var import_src = __toESM(require_src(), 1);
|
|
815
821
|
function ce() {
|
|
816
|
-
return
|
|
822
|
+
return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
817
823
|
}
|
|
818
|
-
const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), $e = u("▪", "•"), _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"),
|
|
824
|
+
const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), $e = u("▪", "•"), _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
|
|
819
825
|
switch (t) {
|
|
820
826
|
case "initial":
|
|
821
|
-
case "active": return import_picocolors.default.cyan(le);
|
|
822
|
-
case "cancel": return import_picocolors.default.red(L);
|
|
823
|
-
case "error": return import_picocolors.default.yellow(W);
|
|
824
|
-
case "submit": return import_picocolors.default.green(C);
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
const { cursor: n, options:
|
|
828
|
-
let l = 0;
|
|
829
|
-
n >= l +
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
const j = v$1 === 0 &&
|
|
833
|
-
return j || E ? import_picocolors.default.dim("...") :
|
|
827
|
+
case "active": return import_picocolors$1.default.cyan(le);
|
|
828
|
+
case "cancel": return import_picocolors$1.default.red(L);
|
|
829
|
+
case "error": return import_picocolors$1.default.yellow(W);
|
|
830
|
+
case "submit": return import_picocolors$1.default.green(C);
|
|
831
|
+
}
|
|
832
|
+
}, G = (t) => {
|
|
833
|
+
const { cursor: n, options: r$1, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
834
|
+
let l$1 = 0;
|
|
835
|
+
n >= l$1 + a - 3 ? l$1 = Math.max(Math.min(n - a + 3, r$1.length - a), 0) : n < l$1 + 2 && (l$1 = Math.max(n - 2, 0));
|
|
836
|
+
const $$1 = a < r$1.length && l$1 > 0, g$1 = a < r$1.length && l$1 + a < r$1.length;
|
|
837
|
+
return r$1.slice(l$1, l$1 + a).map((p$2, v$1, f) => {
|
|
838
|
+
const j = v$1 === 0 && $$1, E = v$1 === f.length - 1 && g$1;
|
|
839
|
+
return j || E ? import_picocolors$1.default.dim("...") : i(p$2, v$1 + l$1 === n);
|
|
834
840
|
});
|
|
835
|
-
}, he = (t) => new
|
|
841
|
+
}, he = (t) => new RD({
|
|
836
842
|
validate: t.validate,
|
|
837
843
|
placeholder: t.placeholder,
|
|
838
844
|
defaultValue: t.defaultValue,
|
|
839
845
|
initialValue: t.initialValue,
|
|
840
846
|
render() {
|
|
841
|
-
const n = `${import_picocolors.default.gray(o)}
|
|
842
|
-
${
|
|
843
|
-
`,
|
|
847
|
+
const n = `${import_picocolors$1.default.gray(o)}
|
|
848
|
+
${b(this.state)} ${t.message}
|
|
849
|
+
`, r$1 = t.placeholder ? import_picocolors$1.default.inverse(t.placeholder[0]) + import_picocolors$1.default.dim(t.placeholder.slice(1)) : import_picocolors$1.default.inverse(import_picocolors$1.default.hidden("_")), i = this.value ? this.valueWithCursor : r$1;
|
|
844
850
|
switch (this.state) {
|
|
845
851
|
case "error": return `${n.trim()}
|
|
846
|
-
${import_picocolors.default.yellow(o)} ${
|
|
847
|
-
${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
|
|
852
|
+
${import_picocolors$1.default.yellow(o)} ${i}
|
|
853
|
+
${import_picocolors$1.default.yellow(d)} ${import_picocolors$1.default.yellow(this.error)}
|
|
848
854
|
`;
|
|
849
|
-
case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
|
|
850
|
-
case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
851
|
-
${import_picocolors.default.gray(o)}` : ""}`;
|
|
852
|
-
default: return `${n}${import_picocolors.default.cyan(o)} ${
|
|
853
|
-
${import_picocolors.default.cyan(d)}
|
|
855
|
+
case "submit": return `${n}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(this.value || t.placeholder)}`;
|
|
856
|
+
case "cancel": return `${n}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
857
|
+
${import_picocolors$1.default.gray(o)}` : ""}`;
|
|
858
|
+
default: return `${n}${import_picocolors$1.default.cyan(o)} ${i}
|
|
859
|
+
${import_picocolors$1.default.cyan(d)}
|
|
854
860
|
`;
|
|
855
861
|
}
|
|
856
862
|
}
|
|
857
|
-
}).prompt(), ge = (t) => new
|
|
863
|
+
}).prompt(), ge = (t) => new MD({
|
|
858
864
|
validate: t.validate,
|
|
859
865
|
mask: t.mask ?? $e,
|
|
860
866
|
render() {
|
|
861
|
-
const n = `${import_picocolors.default.gray(o)}
|
|
862
|
-
${
|
|
863
|
-
`,
|
|
867
|
+
const n = `${import_picocolors$1.default.gray(o)}
|
|
868
|
+
${b(this.state)} ${t.message}
|
|
869
|
+
`, r$1 = this.valueWithCursor, i = this.masked;
|
|
864
870
|
switch (this.state) {
|
|
865
871
|
case "error": return `${n.trim()}
|
|
866
|
-
${import_picocolors.default.yellow(o)} ${
|
|
867
|
-
${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
|
|
872
|
+
${import_picocolors$1.default.yellow(o)} ${i}
|
|
873
|
+
${import_picocolors$1.default.yellow(d)} ${import_picocolors$1.default.yellow(this.error)}
|
|
868
874
|
`;
|
|
869
|
-
case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(
|
|
870
|
-
case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(
|
|
871
|
-
${import_picocolors.default.gray(o)}` : ""}`;
|
|
872
|
-
default: return `${n}${import_picocolors.default.cyan(o)} ${
|
|
873
|
-
${import_picocolors.default.cyan(d)}
|
|
875
|
+
case "submit": return `${n}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(i)}`;
|
|
876
|
+
case "cancel": return `${n}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(i ?? ""))}${i ? `
|
|
877
|
+
${import_picocolors$1.default.gray(o)}` : ""}`;
|
|
878
|
+
default: return `${n}${import_picocolors$1.default.cyan(o)} ${r$1}
|
|
879
|
+
${import_picocolors$1.default.cyan(d)}
|
|
874
880
|
`;
|
|
875
881
|
}
|
|
876
882
|
}
|
|
877
883
|
}).prompt(), ye = (t) => {
|
|
878
|
-
const n = t.active ?? "Yes",
|
|
879
|
-
return new
|
|
884
|
+
const n = t.active ?? "Yes", r$1 = t.inactive ?? "No";
|
|
885
|
+
return new dD({
|
|
880
886
|
active: n,
|
|
881
|
-
inactive:
|
|
887
|
+
inactive: r$1,
|
|
882
888
|
initialValue: t.initialValue ?? !0,
|
|
883
889
|
render() {
|
|
884
|
-
const
|
|
885
|
-
${
|
|
886
|
-
`,
|
|
890
|
+
const i = `${import_picocolors$1.default.gray(o)}
|
|
891
|
+
${b(this.state)} ${t.message}
|
|
892
|
+
`, s = this.value ? n : r$1;
|
|
887
893
|
switch (this.state) {
|
|
888
|
-
case "submit": return `${
|
|
889
|
-
case "cancel": return `${
|
|
890
|
-
${import_picocolors.default.gray(o)}`;
|
|
891
|
-
default: return `${
|
|
892
|
-
${import_picocolors.default.cyan(d)}
|
|
894
|
+
case "submit": return `${i}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(s)}`;
|
|
895
|
+
case "cancel": return `${i}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(s))}
|
|
896
|
+
${import_picocolors$1.default.gray(o)}`;
|
|
897
|
+
default: return `${i}${import_picocolors$1.default.cyan(o)} ${this.value ? `${import_picocolors$1.default.green(k)} ${n}` : `${import_picocolors$1.default.dim(P)} ${import_picocolors$1.default.dim(n)}`} ${import_picocolors$1.default.dim("/")} ${this.value ? `${import_picocolors$1.default.dim(P)} ${import_picocolors$1.default.dim(r$1)}` : `${import_picocolors$1.default.green(k)} ${r$1}`}
|
|
898
|
+
${import_picocolors$1.default.cyan(d)}
|
|
893
899
|
`;
|
|
894
900
|
}
|
|
895
901
|
}
|
|
896
902
|
}).prompt();
|
|
897
903
|
}, ve = (t) => {
|
|
898
|
-
const n = (
|
|
899
|
-
const
|
|
900
|
-
switch (
|
|
901
|
-
case "selected": return `${import_picocolors.default.dim(
|
|
902
|
-
case "active": return `${import_picocolors.default.green(k)} ${
|
|
903
|
-
case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(
|
|
904
|
-
default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(
|
|
904
|
+
const n = (r$1, i) => {
|
|
905
|
+
const s = r$1.label ?? String(r$1.value);
|
|
906
|
+
switch (i) {
|
|
907
|
+
case "selected": return `${import_picocolors$1.default.dim(s)}`;
|
|
908
|
+
case "active": return `${import_picocolors$1.default.green(k)} ${s} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}`;
|
|
909
|
+
case "cancelled": return `${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(s))}`;
|
|
910
|
+
default: return `${import_picocolors$1.default.dim(P)} ${import_picocolors$1.default.dim(s)}`;
|
|
905
911
|
}
|
|
906
912
|
};
|
|
907
|
-
return new
|
|
913
|
+
return new LD({
|
|
908
914
|
options: t.options,
|
|
909
915
|
initialValue: t.initialValue,
|
|
910
916
|
render() {
|
|
911
|
-
const
|
|
912
|
-
${
|
|
917
|
+
const r$1 = `${import_picocolors$1.default.gray(o)}
|
|
918
|
+
${b(this.state)} ${t.message}
|
|
913
919
|
`;
|
|
914
920
|
switch (this.state) {
|
|
915
|
-
case "submit": return `${
|
|
916
|
-
case "cancel": return `${
|
|
917
|
-
${import_picocolors.default.gray(o)}`;
|
|
918
|
-
default: return `${
|
|
921
|
+
case "submit": return `${r$1}${import_picocolors$1.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
922
|
+
case "cancel": return `${r$1}${import_picocolors$1.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
923
|
+
${import_picocolors$1.default.gray(o)}`;
|
|
924
|
+
default: return `${r$1}${import_picocolors$1.default.cyan(o)} ${G({
|
|
919
925
|
cursor: this.cursor,
|
|
920
926
|
options: this.options,
|
|
921
927
|
maxItems: t.maxItems,
|
|
922
|
-
style: (
|
|
928
|
+
style: (i, s) => n(i, s ? "active" : "inactive")
|
|
923
929
|
}).join(`
|
|
924
|
-
${import_picocolors.default.cyan(o)} `)}
|
|
925
|
-
${import_picocolors.default.cyan(d)}
|
|
930
|
+
${import_picocolors$1.default.cyan(o)} `)}
|
|
931
|
+
${import_picocolors$1.default.cyan(d)}
|
|
926
932
|
`;
|
|
927
933
|
}
|
|
928
934
|
}
|
|
929
935
|
}).prompt();
|
|
930
936
|
}, we = (t) => {
|
|
931
|
-
const n = (
|
|
932
|
-
const
|
|
933
|
-
return
|
|
937
|
+
const n = (r$1, i = "inactive") => {
|
|
938
|
+
const s = r$1.label ?? String(r$1.value);
|
|
939
|
+
return i === "selected" ? `${import_picocolors$1.default.dim(s)}` : i === "cancelled" ? `${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(s))}` : i === "active" ? `${import_picocolors$1.default.bgCyan(import_picocolors$1.default.gray(` ${r$1.value} `))} ${s} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}` : `${import_picocolors$1.default.gray(import_picocolors$1.default.bgWhite(import_picocolors$1.default.inverse(` ${r$1.value} `)))} ${s} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}`;
|
|
934
940
|
};
|
|
935
|
-
return new
|
|
941
|
+
return new ID({
|
|
936
942
|
options: t.options,
|
|
937
943
|
initialValue: t.initialValue,
|
|
938
944
|
render() {
|
|
939
|
-
const
|
|
940
|
-
${
|
|
945
|
+
const r$1 = `${import_picocolors$1.default.gray(o)}
|
|
946
|
+
${b(this.state)} ${t.message}
|
|
941
947
|
`;
|
|
942
948
|
switch (this.state) {
|
|
943
|
-
case "submit": return `${
|
|
944
|
-
case "cancel": return `${
|
|
945
|
-
${import_picocolors.default.gray(o)}`;
|
|
946
|
-
default: return `${
|
|
947
|
-
${import_picocolors.default.cyan(o)} `)}
|
|
948
|
-
${import_picocolors.default.cyan(d)}
|
|
949
|
+
case "submit": return `${r$1}${import_picocolors$1.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
|
|
950
|
+
case "cancel": return `${r$1}${import_picocolors$1.default.gray(o)} ${n(this.options[0], "cancelled")}
|
|
951
|
+
${import_picocolors$1.default.gray(o)}`;
|
|
952
|
+
default: return `${r$1}${import_picocolors$1.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
|
|
953
|
+
${import_picocolors$1.default.cyan(o)} `)}
|
|
954
|
+
${import_picocolors$1.default.cyan(d)}
|
|
949
955
|
`;
|
|
950
956
|
}
|
|
951
957
|
}
|
|
952
958
|
}).prompt();
|
|
953
959
|
}, fe = (t) => {
|
|
954
|
-
const n = (
|
|
955
|
-
const
|
|
956
|
-
return
|
|
960
|
+
const n = (r$1, i) => {
|
|
961
|
+
const s = r$1.label ?? String(r$1.value);
|
|
962
|
+
return i === "active" ? `${import_picocolors$1.default.cyan(A)} ${s} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}` : i === "selected" ? `${import_picocolors$1.default.green(T)} ${import_picocolors$1.default.dim(s)} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(s))}` : i === "active-selected" ? `${import_picocolors$1.default.green(T)} ${s} ${r$1.hint ? import_picocolors$1.default.dim(`(${r$1.hint})`) : ""}` : i === "submitted" ? `${import_picocolors$1.default.dim(s)}` : `${import_picocolors$1.default.dim(F)} ${import_picocolors$1.default.dim(s)}`;
|
|
957
963
|
};
|
|
958
|
-
return new
|
|
964
|
+
return new SD({
|
|
959
965
|
options: t.options,
|
|
960
966
|
initialValues: t.initialValues,
|
|
961
967
|
required: t.required ?? !0,
|
|
962
968
|
cursorAt: t.cursorAt,
|
|
963
|
-
validate(
|
|
964
|
-
if (this.required &&
|
|
965
|
-
${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
|
|
969
|
+
validate(r$1) {
|
|
970
|
+
if (this.required && r$1.length === 0) return `Please select at least one option.
|
|
971
|
+
${import_picocolors$1.default.reset(import_picocolors$1.default.dim(`Press ${import_picocolors$1.default.gray(import_picocolors$1.default.bgWhite(import_picocolors$1.default.inverse(" space ")))} to select, ${import_picocolors$1.default.gray(import_picocolors$1.default.bgWhite(import_picocolors$1.default.inverse(" enter ")))} to submit`))}`;
|
|
966
972
|
},
|
|
967
973
|
render() {
|
|
968
|
-
const
|
|
969
|
-
${
|
|
970
|
-
`,
|
|
971
|
-
const
|
|
972
|
-
return
|
|
974
|
+
const r$1 = `${import_picocolors$1.default.gray(o)}
|
|
975
|
+
${b(this.state)} ${t.message}
|
|
976
|
+
`, i = (s, c) => {
|
|
977
|
+
const a = this.value.includes(s.value);
|
|
978
|
+
return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
|
|
973
979
|
};
|
|
974
980
|
switch (this.state) {
|
|
975
|
-
case "submit": return `${
|
|
981
|
+
case "submit": return `${r$1}${import_picocolors$1.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors$1.default.dim(", ")) || import_picocolors$1.default.dim("none")}`;
|
|
976
982
|
case "cancel": {
|
|
977
|
-
const
|
|
978
|
-
return `${
|
|
979
|
-
${import_picocolors.default.gray(o)}` : ""}`;
|
|
983
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors$1.default.dim(", "));
|
|
984
|
+
return `${r$1}${import_picocolors$1.default.gray(o)} ${s.trim() ? `${s}
|
|
985
|
+
${import_picocolors$1.default.gray(o)}` : ""}`;
|
|
980
986
|
}
|
|
981
987
|
case "error": {
|
|
982
|
-
const
|
|
983
|
-
`).map((
|
|
988
|
+
const s = this.error.split(`
|
|
989
|
+
`).map((c, a) => a === 0 ? `${import_picocolors$1.default.yellow(d)} ${import_picocolors$1.default.yellow(c)}` : ` ${c}`).join(`
|
|
984
990
|
`);
|
|
985
|
-
return `${
|
|
991
|
+
return `${r$1 + import_picocolors$1.default.yellow(o)} ${G({
|
|
986
992
|
options: this.options,
|
|
987
993
|
cursor: this.cursor,
|
|
988
994
|
maxItems: t.maxItems,
|
|
989
|
-
style:
|
|
995
|
+
style: i
|
|
990
996
|
}).join(`
|
|
991
|
-
${import_picocolors.default.yellow(o)} `)}
|
|
992
|
-
${
|
|
997
|
+
${import_picocolors$1.default.yellow(o)} `)}
|
|
998
|
+
${s}
|
|
993
999
|
`;
|
|
994
1000
|
}
|
|
995
|
-
default: return `${
|
|
1001
|
+
default: return `${r$1}${import_picocolors$1.default.cyan(o)} ${G({
|
|
996
1002
|
options: this.options,
|
|
997
1003
|
cursor: this.cursor,
|
|
998
1004
|
maxItems: t.maxItems,
|
|
999
|
-
style:
|
|
1005
|
+
style: i
|
|
1000
1006
|
}).join(`
|
|
1001
|
-
${import_picocolors.default.cyan(o)} `)}
|
|
1002
|
-
${import_picocolors.default.cyan(d)}
|
|
1007
|
+
${import_picocolors$1.default.cyan(o)} `)}
|
|
1008
|
+
${import_picocolors$1.default.cyan(d)}
|
|
1003
1009
|
`;
|
|
1004
1010
|
}
|
|
1005
1011
|
}
|
|
1006
1012
|
}).prompt();
|
|
1007
1013
|
}, be = (t) => {
|
|
1008
|
-
const n =
|
|
1009
|
-
const a =
|
|
1010
|
-
|
|
1014
|
+
const { selectableGroups: n = !0 } = t, r$1 = (i, s, c = []) => {
|
|
1015
|
+
const a = i.label ?? String(i.value), l$1 = typeof i.group == "string", $$1 = l$1 && (c[c.indexOf(i) + 1] ?? { group: !0 }), g$1 = l$1 && $$1.group === !0, p$2 = l$1 ? n ? `${g$1 ? d : o} ` : " " : "";
|
|
1016
|
+
if (s === "active") return `${import_picocolors$1.default.dim(p$2)}${import_picocolors$1.default.cyan(A)} ${a} ${i.hint ? import_picocolors$1.default.dim(`(${i.hint})`) : ""}`;
|
|
1017
|
+
if (s === "group-active") return `${p$2}${import_picocolors$1.default.cyan(A)} ${import_picocolors$1.default.dim(a)}`;
|
|
1018
|
+
if (s === "group-active-selected") return `${p$2}${import_picocolors$1.default.green(T)} ${import_picocolors$1.default.dim(a)}`;
|
|
1019
|
+
if (s === "selected") {
|
|
1020
|
+
const f = l$1 || n ? import_picocolors$1.default.green(T) : "";
|
|
1021
|
+
return `${import_picocolors$1.default.dim(p$2)}${f} ${import_picocolors$1.default.dim(a)} ${i.hint ? import_picocolors$1.default.dim(`(${i.hint})`) : ""}`;
|
|
1022
|
+
}
|
|
1023
|
+
if (s === "cancelled") return `${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(a))}`;
|
|
1024
|
+
if (s === "active-selected") return `${import_picocolors$1.default.dim(p$2)}${import_picocolors$1.default.green(T)} ${a} ${i.hint ? import_picocolors$1.default.dim(`(${i.hint})`) : ""}`;
|
|
1025
|
+
if (s === "submitted") return `${import_picocolors$1.default.dim(a)}`;
|
|
1026
|
+
const v$1 = l$1 || n ? import_picocolors$1.default.dim(F) : "";
|
|
1027
|
+
return `${import_picocolors$1.default.dim(p$2)}${v$1} ${import_picocolors$1.default.dim(a)}`;
|
|
1011
1028
|
};
|
|
1012
|
-
return new
|
|
1029
|
+
return new _D({
|
|
1013
1030
|
options: t.options,
|
|
1014
1031
|
initialValues: t.initialValues,
|
|
1015
1032
|
required: t.required ?? !0,
|
|
1016
1033
|
cursorAt: t.cursorAt,
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1034
|
+
selectableGroups: n,
|
|
1035
|
+
validate(i) {
|
|
1036
|
+
if (this.required && i.length === 0) return `Please select at least one option.
|
|
1037
|
+
${import_picocolors$1.default.reset(import_picocolors$1.default.dim(`Press ${import_picocolors$1.default.gray(import_picocolors$1.default.bgWhite(import_picocolors$1.default.inverse(" space ")))} to select, ${import_picocolors$1.default.gray(import_picocolors$1.default.bgWhite(import_picocolors$1.default.inverse(" enter ")))} to submit`))}`;
|
|
1020
1038
|
},
|
|
1021
1039
|
render() {
|
|
1022
|
-
const
|
|
1023
|
-
${
|
|
1040
|
+
const i = `${import_picocolors$1.default.gray(o)}
|
|
1041
|
+
${b(this.state)} ${t.message}
|
|
1024
1042
|
`;
|
|
1025
1043
|
switch (this.state) {
|
|
1026
|
-
case "submit": return `${
|
|
1044
|
+
case "submit": return `${i}${import_picocolors$1.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r$1(s, "submitted")).join(import_picocolors$1.default.dim(", "))}`;
|
|
1027
1045
|
case "cancel": {
|
|
1028
|
-
const
|
|
1029
|
-
return `${
|
|
1030
|
-
${import_picocolors.default.gray(o)}` : ""}`;
|
|
1046
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r$1(c, "cancelled")).join(import_picocolors$1.default.dim(", "));
|
|
1047
|
+
return `${i}${import_picocolors$1.default.gray(o)} ${s.trim() ? `${s}
|
|
1048
|
+
${import_picocolors$1.default.gray(o)}` : ""}`;
|
|
1031
1049
|
}
|
|
1032
1050
|
case "error": {
|
|
1033
|
-
const
|
|
1034
|
-
`).map((
|
|
1051
|
+
const s = this.error.split(`
|
|
1052
|
+
`).map((c, a) => a === 0 ? `${import_picocolors$1.default.yellow(d)} ${import_picocolors$1.default.yellow(c)}` : ` ${c}`).join(`
|
|
1035
1053
|
`);
|
|
1036
|
-
return `${
|
|
1037
|
-
const
|
|
1038
|
-
return
|
|
1054
|
+
return `${i}${import_picocolors$1.default.yellow(o)} ${this.options.map((c, a, l$1) => {
|
|
1055
|
+
const $$1 = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g$1 = a === this.cursor;
|
|
1056
|
+
return !g$1 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r$1(c, $$1 ? "group-active-selected" : "group-active", l$1) : g$1 && $$1 ? r$1(c, "active-selected", l$1) : $$1 ? r$1(c, "selected", l$1) : r$1(c, g$1 ? "active" : "inactive", l$1);
|
|
1039
1057
|
}).join(`
|
|
1040
|
-
${import_picocolors.default.yellow(o)} `)}
|
|
1041
|
-
${
|
|
1058
|
+
${import_picocolors$1.default.yellow(o)} `)}
|
|
1059
|
+
${s}
|
|
1042
1060
|
`;
|
|
1043
1061
|
}
|
|
1044
|
-
default: return `${
|
|
1045
|
-
const
|
|
1046
|
-
return
|
|
1062
|
+
default: return `${i}${import_picocolors$1.default.cyan(o)} ${this.options.map((s, c, a) => {
|
|
1063
|
+
const l$1 = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $$1 = c === this.cursor;
|
|
1064
|
+
return !$$1 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r$1(s, l$1 ? "group-active-selected" : "group-active", a) : $$1 && l$1 ? r$1(s, "active-selected", a) : l$1 ? r$1(s, "selected", a) : r$1(s, $$1 ? "active" : "inactive", a);
|
|
1047
1065
|
}).join(`
|
|
1048
|
-
${import_picocolors.default.cyan(o)} `)}
|
|
1049
|
-
${import_picocolors.default.cyan(d)}
|
|
1066
|
+
${import_picocolors$1.default.cyan(o)} `)}
|
|
1067
|
+
${import_picocolors$1.default.cyan(d)}
|
|
1050
1068
|
`;
|
|
1051
1069
|
}
|
|
1052
1070
|
}
|
|
1053
1071
|
}).prompt();
|
|
1054
1072
|
}, Me = (t = "", n = "") => {
|
|
1055
|
-
const
|
|
1073
|
+
const r$1 = `
|
|
1056
1074
|
${t}
|
|
1057
1075
|
`.split(`
|
|
1058
|
-
`),
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1061
|
-
}, 0),
|
|
1076
|
+
`), i = stripVTControlCharacters(n).length, s = Math.max(r$1.reduce((a, l$1) => {
|
|
1077
|
+
const $$1 = stripVTControlCharacters(l$1);
|
|
1078
|
+
return $$1.length > a ? $$1.length : a;
|
|
1079
|
+
}, 0), i) + 2, c = r$1.map((a) => `${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors$1.default.gray(o)}`).join(`
|
|
1062
1080
|
`);
|
|
1063
|
-
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1064
|
-
${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(
|
|
1065
|
-
${
|
|
1066
|
-
${import_picocolors.default.gray(de + _.repeat(
|
|
1081
|
+
process.stdout.write(`${import_picocolors$1.default.gray(o)}
|
|
1082
|
+
${import_picocolors$1.default.green(C)} ${import_picocolors$1.default.reset(n)} ${import_picocolors$1.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
1083
|
+
${c}
|
|
1084
|
+
${import_picocolors$1.default.gray(de + _.repeat(s + 2) + pe)}
|
|
1067
1085
|
`);
|
|
1068
1086
|
}, xe = (t = "") => {
|
|
1069
|
-
process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
|
|
1087
|
+
process.stdout.write(`${import_picocolors$1.default.gray(d)} ${import_picocolors$1.default.red(t)}
|
|
1070
1088
|
|
|
1071
1089
|
`);
|
|
1072
1090
|
}, Ie = (t = "") => {
|
|
1073
|
-
process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
|
|
1091
|
+
process.stdout.write(`${import_picocolors$1.default.gray(ue)} ${t}
|
|
1074
1092
|
`);
|
|
1075
1093
|
}, Se = (t = "") => {
|
|
1076
|
-
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1077
|
-
${import_picocolors.default.gray(d)} ${t}
|
|
1094
|
+
process.stdout.write(`${import_picocolors$1.default.gray(o)}
|
|
1095
|
+
${import_picocolors$1.default.gray(d)} ${t}
|
|
1078
1096
|
|
|
1079
1097
|
`);
|
|
1080
|
-
},
|
|
1081
|
-
message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
1082
|
-
const
|
|
1098
|
+
}, M = {
|
|
1099
|
+
message: (t = "", { symbol: n = import_picocolors$1.default.gray(o) } = {}) => {
|
|
1100
|
+
const r$1 = [`${import_picocolors$1.default.gray(o)}`];
|
|
1083
1101
|
if (t) {
|
|
1084
|
-
const [
|
|
1102
|
+
const [i, ...s] = t.split(`
|
|
1085
1103
|
`);
|
|
1086
|
-
|
|
1104
|
+
r$1.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors$1.default.gray(o)} ${c}`));
|
|
1087
1105
|
}
|
|
1088
|
-
process.stdout.write(`${
|
|
1106
|
+
process.stdout.write(`${r$1.join(`
|
|
1089
1107
|
`)}
|
|
1090
1108
|
`);
|
|
1091
1109
|
},
|
|
1092
1110
|
info: (t) => {
|
|
1093
|
-
|
|
1111
|
+
M.message(t, { symbol: import_picocolors$1.default.blue(q) });
|
|
1094
1112
|
},
|
|
1095
1113
|
success: (t) => {
|
|
1096
|
-
|
|
1114
|
+
M.message(t, { symbol: import_picocolors$1.default.green(D) });
|
|
1097
1115
|
},
|
|
1098
1116
|
step: (t) => {
|
|
1099
|
-
|
|
1117
|
+
M.message(t, { symbol: import_picocolors$1.default.green(C) });
|
|
1100
1118
|
},
|
|
1101
1119
|
warn: (t) => {
|
|
1102
|
-
|
|
1120
|
+
M.message(t, { symbol: import_picocolors$1.default.yellow(U) });
|
|
1103
1121
|
},
|
|
1104
1122
|
warning: (t) => {
|
|
1105
|
-
|
|
1123
|
+
M.warn(t);
|
|
1106
1124
|
},
|
|
1107
1125
|
error: (t) => {
|
|
1108
|
-
|
|
1126
|
+
M.message(t, { symbol: import_picocolors$1.default.red(K) });
|
|
1109
1127
|
}
|
|
1110
|
-
}, J = `${import_picocolors.default.gray(o)} `,
|
|
1111
|
-
message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
1112
|
-
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1128
|
+
}, J = `${import_picocolors$1.default.gray(o)} `, x = {
|
|
1129
|
+
message: async (t, { symbol: n = import_picocolors$1.default.gray(o) } = {}) => {
|
|
1130
|
+
process.stdout.write(`${import_picocolors$1.default.gray(o)}
|
|
1113
1131
|
${n} `);
|
|
1114
|
-
let
|
|
1115
|
-
for await (let
|
|
1116
|
-
|
|
1117
|
-
${J}`),
|
|
1118
|
-
`) && (
|
|
1132
|
+
let r$1 = 3;
|
|
1133
|
+
for await (let i of t) {
|
|
1134
|
+
i = i.replace(/\n/g, `
|
|
1135
|
+
${J}`), i.includes(`
|
|
1136
|
+
`) && (r$1 = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
|
|
1119
1137
|
`))).length);
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1122
|
-
${J}${
|
|
1138
|
+
const s = stripVTControlCharacters(i).length;
|
|
1139
|
+
r$1 + s < process.stdout.columns ? (r$1 += s, process.stdout.write(i)) : (process.stdout.write(`
|
|
1140
|
+
${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length);
|
|
1123
1141
|
}
|
|
1124
1142
|
process.stdout.write(`
|
|
1125
1143
|
`);
|
|
1126
1144
|
},
|
|
1127
|
-
info: (t) =>
|
|
1128
|
-
success: (t) =>
|
|
1129
|
-
step: (t) =>
|
|
1130
|
-
warn: (t) =>
|
|
1131
|
-
warning: (t) =>
|
|
1132
|
-
error: (t) =>
|
|
1145
|
+
info: (t) => x.message(t, { symbol: import_picocolors$1.default.blue(q) }),
|
|
1146
|
+
success: (t) => x.message(t, { symbol: import_picocolors$1.default.green(D) }),
|
|
1147
|
+
step: (t) => x.message(t, { symbol: import_picocolors$1.default.green(C) }),
|
|
1148
|
+
warn: (t) => x.message(t, { symbol: import_picocolors$1.default.yellow(U) }),
|
|
1149
|
+
warning: (t) => x.warn(t),
|
|
1150
|
+
error: (t) => x.message(t, { symbol: import_picocolors$1.default.red(K) })
|
|
1133
1151
|
}, Y = ({ indicator: t = "dots" } = {}) => {
|
|
1134
1152
|
const n = V ? [
|
|
1135
1153
|
"◒",
|
|
@@ -1141,75 +1159,75 @@ ${J}${r$1.trimStart()}`), s = 3 + stripVTControlCharacters(r$1.trimStart()).leng
|
|
|
1141
1159
|
"o",
|
|
1142
1160
|
"O",
|
|
1143
1161
|
"0"
|
|
1144
|
-
],
|
|
1145
|
-
let
|
|
1146
|
-
const
|
|
1162
|
+
], r$1 = V ? 80 : 120, i = process.env.CI === "true";
|
|
1163
|
+
let s, c, a = !1, l$1 = "", $$1, g$1 = performance.now();
|
|
1164
|
+
const p$2 = (m$1) => {
|
|
1147
1165
|
const h$1 = m$1 > 1 ? "Something went wrong" : "Canceled";
|
|
1148
|
-
|
|
1149
|
-
}, v$1 = () =>
|
|
1150
|
-
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT",
|
|
1166
|
+
a && N$1(h$1, m$1);
|
|
1167
|
+
}, v$1 = () => p$2(2), f = () => p$2(1), j = () => {
|
|
1168
|
+
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p$2);
|
|
1151
1169
|
}, E = () => {
|
|
1152
|
-
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT",
|
|
1153
|
-
},
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1170
|
+
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p$2);
|
|
1171
|
+
}, B$1 = () => {
|
|
1172
|
+
if ($$1 === void 0) return;
|
|
1173
|
+
i && process.stdout.write(`
|
|
1156
1174
|
`);
|
|
1157
|
-
const m$1 =
|
|
1175
|
+
const m$1 = $$1.split(`
|
|
1158
1176
|
`);
|
|
1159
1177
|
process.stdout.write(import_src.cursor.move(-999, m$1.length - 1)), process.stdout.write(import_src.erase.down(m$1.length));
|
|
1160
|
-
}, R$1 = (m$1) => m$1.replace(/\.+$/, ""),
|
|
1161
|
-
const h$1 = (performance.now() - m$1) / 1e3,
|
|
1162
|
-
return
|
|
1178
|
+
}, R$1 = (m$1) => m$1.replace(/\.+$/, ""), O$1 = (m$1) => {
|
|
1179
|
+
const h$1 = (performance.now() - m$1) / 1e3, w$1 = Math.floor(h$1 / 60), I$1 = Math.floor(h$1 % 60);
|
|
1180
|
+
return w$1 > 0 ? `[${w$1}m ${I$1}s]` : `[${I$1}s]`;
|
|
1163
1181
|
}, H$1 = (m$1 = "") => {
|
|
1164
|
-
|
|
1182
|
+
a = !0, s = fD(), l$1 = R$1(m$1), g$1 = performance.now(), process.stdout.write(`${import_picocolors$1.default.gray(o)}
|
|
1165
1183
|
`);
|
|
1166
|
-
let h$1 = 0,
|
|
1167
|
-
j(),
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1170
|
-
const I$1 = import_picocolors.default.magenta(n[h$1]);
|
|
1171
|
-
if (
|
|
1172
|
-
else if (t === "timer") process.stdout.write(`${I$1} ${l} ${
|
|
1184
|
+
let h$1 = 0, w$1 = 0;
|
|
1185
|
+
j(), c = setInterval(() => {
|
|
1186
|
+
if (i && l$1 === $$1) return;
|
|
1187
|
+
B$1(), $$1 = l$1;
|
|
1188
|
+
const I$1 = import_picocolors$1.default.magenta(n[h$1]);
|
|
1189
|
+
if (i) process.stdout.write(`${I$1} ${l$1}...`);
|
|
1190
|
+
else if (t === "timer") process.stdout.write(`${I$1} ${l$1} ${O$1(g$1)}`);
|
|
1173
1191
|
else {
|
|
1174
|
-
const z$1 = ".".repeat(Math.floor(
|
|
1175
|
-
process.stdout.write(`${I$1} ${l}${z$1}`);
|
|
1192
|
+
const z$1 = ".".repeat(Math.floor(w$1)).slice(0, 3);
|
|
1193
|
+
process.stdout.write(`${I$1} ${l$1}${z$1}`);
|
|
1176
1194
|
}
|
|
1177
|
-
h$1 = h$1 + 1 < n.length ? h$1 + 1 : 0,
|
|
1178
|
-
},
|
|
1195
|
+
h$1 = h$1 + 1 < n.length ? h$1 + 1 : 0, w$1 = w$1 < n.length ? w$1 + .125 : 0;
|
|
1196
|
+
}, r$1);
|
|
1179
1197
|
}, N$1 = (m$1 = "", h$1 = 0) => {
|
|
1180
|
-
|
|
1181
|
-
const
|
|
1182
|
-
l = R$1(m$1 ?? l), t === "timer" ? process.stdout.write(`${
|
|
1183
|
-
`) : process.stdout.write(`${
|
|
1184
|
-
`), E(),
|
|
1198
|
+
a = !1, clearInterval(c), B$1();
|
|
1199
|
+
const w$1 = h$1 === 0 ? import_picocolors$1.default.green(C) : h$1 === 1 ? import_picocolors$1.default.red(L) : import_picocolors$1.default.red(W);
|
|
1200
|
+
l$1 = R$1(m$1 ?? l$1), t === "timer" ? process.stdout.write(`${w$1} ${l$1} ${O$1(g$1)}
|
|
1201
|
+
`) : process.stdout.write(`${w$1} ${l$1}
|
|
1202
|
+
`), E(), s();
|
|
1185
1203
|
};
|
|
1186
1204
|
return {
|
|
1187
1205
|
start: H$1,
|
|
1188
1206
|
stop: N$1,
|
|
1189
1207
|
message: (m$1 = "") => {
|
|
1190
|
-
l = R$1(m$1 ?? l);
|
|
1208
|
+
l$1 = R$1(m$1 ?? l$1);
|
|
1191
1209
|
}
|
|
1192
1210
|
};
|
|
1193
1211
|
}, Ce = async (t, n) => {
|
|
1194
|
-
const
|
|
1195
|
-
for (const
|
|
1196
|
-
const
|
|
1197
|
-
throw l;
|
|
1212
|
+
const r$1 = {}, i = Object.keys(t);
|
|
1213
|
+
for (const s of i) {
|
|
1214
|
+
const c = t[s], a = await c({ results: r$1 })?.catch((l$1) => {
|
|
1215
|
+
throw l$1;
|
|
1198
1216
|
});
|
|
1199
|
-
if (typeof n?.onCancel == "function" &&
|
|
1200
|
-
s
|
|
1217
|
+
if (typeof n?.onCancel == "function" && pD(a)) {
|
|
1218
|
+
r$1[s] = "canceled", n.onCancel({ results: r$1 });
|
|
1201
1219
|
continue;
|
|
1202
1220
|
}
|
|
1203
|
-
s
|
|
1221
|
+
r$1[s] = a;
|
|
1204
1222
|
}
|
|
1205
|
-
return
|
|
1223
|
+
return r$1;
|
|
1206
1224
|
}, Te = async (t) => {
|
|
1207
1225
|
for (const n of t) {
|
|
1208
1226
|
if (n.enabled === !1) continue;
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1227
|
+
const r$1 = Y();
|
|
1228
|
+
r$1.start(n.title);
|
|
1229
|
+
const i = await n.task(r$1.message);
|
|
1230
|
+
r$1.stop(i || n.title);
|
|
1213
1231
|
}
|
|
1214
1232
|
};
|
|
1215
1233
|
|
|
@@ -1232,6 +1250,7 @@ var require_utils = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs
|
|
|
1232
1250
|
* @private
|
|
1233
1251
|
*/
|
|
1234
1252
|
exports.escapeRegExpChars = function(string) {
|
|
1253
|
+
// istanbul ignore if
|
|
1235
1254
|
if (!string) return "";
|
|
1236
1255
|
return String(string).replace(regExpChars, "\\$&");
|
|
1237
1256
|
};
|
|
@@ -1243,8 +1262,8 @@ var require_utils = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs
|
|
|
1243
1262
|
"'": "'"
|
|
1244
1263
|
};
|
|
1245
1264
|
var _MATCH_HTML = /[&<>'"]/g;
|
|
1246
|
-
function encode_char(c
|
|
1247
|
-
return _ENCODE_HTML_RULES[c
|
|
1265
|
+
function encode_char(c) {
|
|
1266
|
+
return _ENCODE_HTML_RULES[c] || c;
|
|
1248
1267
|
}
|
|
1249
1268
|
/**
|
|
1250
1269
|
* Stringified version of constants used by {@link module:utils.escapeXML}.
|
|
@@ -1291,10 +1310,10 @@ var require_utils = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs
|
|
|
1291
1310
|
*/
|
|
1292
1311
|
exports.shallowCopy = function(to, from) {
|
|
1293
1312
|
from = from || {};
|
|
1294
|
-
if (to !== null && to !== void 0) for (var p$
|
|
1295
|
-
if (!hasOwn(from, p$
|
|
1296
|
-
if (p$
|
|
1297
|
-
to[p$
|
|
1313
|
+
if (to !== null && to !== void 0) for (var p$2 in from) {
|
|
1314
|
+
if (!hasOwn(from, p$2)) continue;
|
|
1315
|
+
if (p$2 === "__proto__" || p$2 === "constructor") continue;
|
|
1316
|
+
to[p$2] = from[p$2];
|
|
1298
1317
|
}
|
|
1299
1318
|
return to;
|
|
1300
1319
|
};
|
|
@@ -1314,11 +1333,11 @@ var require_utils = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs
|
|
|
1314
1333
|
list = list || [];
|
|
1315
1334
|
from = from || {};
|
|
1316
1335
|
if (to !== null && to !== void 0) for (var i = 0; i < list.length; i++) {
|
|
1317
|
-
var p$
|
|
1318
|
-
if (typeof from[p$
|
|
1319
|
-
if (!hasOwn(from, p$
|
|
1320
|
-
if (p$
|
|
1321
|
-
to[p$
|
|
1336
|
+
var p$2 = list[i];
|
|
1337
|
+
if (typeof from[p$2] != "undefined") {
|
|
1338
|
+
if (!hasOwn(from, p$2)) continue;
|
|
1339
|
+
if (p$2 === "__proto__" || p$2 === "constructor") continue;
|
|
1340
|
+
to[p$2] = from[p$2];
|
|
1322
1341
|
}
|
|
1323
1342
|
}
|
|
1324
1343
|
return to;
|
|
@@ -1376,7 +1395,7 @@ var require_utils = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs
|
|
|
1376
1395
|
}();
|
|
1377
1396
|
exports.hasOwnOnlyObject = function(obj) {
|
|
1378
1397
|
var o$1 = exports.createNullProtoObjWherePossible();
|
|
1379
|
-
for (var p$
|
|
1398
|
+
for (var p$2 in obj) if (hasOwn(obj, p$2)) o$1[p$2] = obj[p$2];
|
|
1380
1399
|
return o$1;
|
|
1381
1400
|
};
|
|
1382
1401
|
} });
|
|
@@ -1446,8 +1465,8 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1446
1465
|
* @module ejs
|
|
1447
1466
|
* @public
|
|
1448
1467
|
*/
|
|
1449
|
-
var fs$
|
|
1450
|
-
var path$
|
|
1468
|
+
var fs$1 = __require("fs");
|
|
1469
|
+
var path$2 = __require("path");
|
|
1451
1470
|
var utils = require_utils();
|
|
1452
1471
|
var scopeOptionWarned = false;
|
|
1453
1472
|
/** @type {string} */
|
|
@@ -1488,7 +1507,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1488
1507
|
*
|
|
1489
1508
|
* @type {fileLoader}
|
|
1490
1509
|
*/
|
|
1491
|
-
exports.fileLoader = fs$
|
|
1510
|
+
exports.fileLoader = fs$1.readFileSync;
|
|
1492
1511
|
/**
|
|
1493
1512
|
* Name of the object containing the locals.
|
|
1494
1513
|
*
|
|
@@ -1517,9 +1536,9 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1517
1536
|
* @return {String}
|
|
1518
1537
|
*/
|
|
1519
1538
|
exports.resolveInclude = function(name$2, filename, isDir) {
|
|
1520
|
-
var dirname = path$
|
|
1521
|
-
var extname = path$
|
|
1522
|
-
var resolve = path$
|
|
1539
|
+
var dirname = path$2.dirname;
|
|
1540
|
+
var extname = path$2.extname;
|
|
1541
|
+
var resolve = path$2.resolve;
|
|
1523
1542
|
var includePath = resolve(isDir ? filename : dirname(filename), name$2);
|
|
1524
1543
|
var ext = extname(name$2);
|
|
1525
1544
|
if (!ext) includePath += ".ejs";
|
|
@@ -1536,7 +1555,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1536
1555
|
var filePath;
|
|
1537
1556
|
if (paths.some(function(v$1) {
|
|
1538
1557
|
filePath = exports.resolveInclude(name$2, v$1, true);
|
|
1539
|
-
return fs$
|
|
1558
|
+
return fs$1.existsSync(filePath);
|
|
1540
1559
|
})) return filePath;
|
|
1541
1560
|
}
|
|
1542
1561
|
/**
|
|
@@ -1546,22 +1565,22 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1546
1565
|
* @param {Options} options compilation options
|
|
1547
1566
|
* @return {String}
|
|
1548
1567
|
*/
|
|
1549
|
-
function getIncludePath(path$
|
|
1568
|
+
function getIncludePath(path$3, options) {
|
|
1550
1569
|
var includePath;
|
|
1551
1570
|
var filePath;
|
|
1552
1571
|
var views = options.views;
|
|
1553
|
-
var match = /^[A-Za-z]+:\\|^\//.exec(path$
|
|
1572
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path$3);
|
|
1554
1573
|
if (match && match.length) {
|
|
1555
|
-
path$
|
|
1556
|
-
if (Array.isArray(options.root)) includePath = resolvePaths(path$
|
|
1557
|
-
else includePath = exports.resolveInclude(path$
|
|
1574
|
+
path$3 = path$3.replace(/^\/*/, "");
|
|
1575
|
+
if (Array.isArray(options.root)) includePath = resolvePaths(path$3, options.root);
|
|
1576
|
+
else includePath = exports.resolveInclude(path$3, options.root || "/", true);
|
|
1558
1577
|
} else {
|
|
1559
1578
|
if (options.filename) {
|
|
1560
|
-
filePath = exports.resolveInclude(path$
|
|
1561
|
-
if (fs$
|
|
1579
|
+
filePath = exports.resolveInclude(path$3, options.filename);
|
|
1580
|
+
if (fs$1.existsSync(filePath)) includePath = filePath;
|
|
1562
1581
|
}
|
|
1563
|
-
if (!includePath && Array.isArray(views)) includePath = resolvePaths(path$
|
|
1564
|
-
if (!includePath && typeof options.includer !== "function") throw new Error("Could not find the include file \"" + options.escapeFunction(path$
|
|
1582
|
+
if (!includePath && Array.isArray(views)) includePath = resolvePaths(path$3, views);
|
|
1583
|
+
if (!includePath && typeof options.includer !== "function") throw new Error("Could not find the include file \"" + options.escapeFunction(path$3) + "\"");
|
|
1565
1584
|
}
|
|
1566
1585
|
return includePath;
|
|
1567
1586
|
}
|
|
@@ -1592,6 +1611,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1592
1611
|
if (func) return func;
|
|
1593
1612
|
if (!hasTemplate) template = fileLoader(filename).toString().replace(_BOM, "");
|
|
1594
1613
|
} else if (!hasTemplate) {
|
|
1614
|
+
// istanbul ignore if: should not happen at all
|
|
1595
1615
|
if (!filename) throw new Error("Internal EJS error: no file name or template provided");
|
|
1596
1616
|
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
1597
1617
|
}
|
|
@@ -1652,11 +1672,11 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1652
1672
|
* Depending on the value of `options.client`, either type might be returned
|
|
1653
1673
|
* @static
|
|
1654
1674
|
*/
|
|
1655
|
-
function includeFile(path$
|
|
1675
|
+
function includeFile(path$3, options) {
|
|
1656
1676
|
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
|
|
1657
|
-
opts.filename = getIncludePath(path$
|
|
1677
|
+
opts.filename = getIncludePath(path$3, opts);
|
|
1658
1678
|
if (typeof options.includer === "function") {
|
|
1659
|
-
var includerResult = options.includer(path$
|
|
1679
|
+
var includerResult = options.includer(path$3, opts.filename);
|
|
1660
1680
|
if (includerResult) {
|
|
1661
1681
|
if (includerResult.filename) opts.filename = includerResult.filename;
|
|
1662
1682
|
if (includerResult.template) return handleCache(opts, includerResult.template);
|
|
@@ -1886,30 +1906,31 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1886
1906
|
try {
|
|
1887
1907
|
if (opts.async) try {
|
|
1888
1908
|
ctor = new Function("return (async function(){}).constructor;")();
|
|
1889
|
-
} catch (e) {
|
|
1890
|
-
if (e instanceof SyntaxError) throw new Error("This environment does not support async/await");
|
|
1891
|
-
else throw e;
|
|
1909
|
+
} catch (e$1) {
|
|
1910
|
+
if (e$1 instanceof SyntaxError) throw new Error("This environment does not support async/await");
|
|
1911
|
+
else throw e$1;
|
|
1892
1912
|
}
|
|
1893
1913
|
else ctor = Function;
|
|
1894
1914
|
fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
|
|
1895
|
-
} catch (e) {
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
e.message += "
|
|
1899
|
-
e.message += "
|
|
1900
|
-
e.message += "
|
|
1915
|
+
} catch (e$1) {
|
|
1916
|
+
// istanbul ignore else
|
|
1917
|
+
if (e$1 instanceof SyntaxError) {
|
|
1918
|
+
if (opts.filename) e$1.message += " in " + opts.filename;
|
|
1919
|
+
e$1.message += " while compiling ejs\n\n";
|
|
1920
|
+
e$1.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
|
|
1921
|
+
e$1.message += "https://github.com/RyanZim/EJS-Lint";
|
|
1901
1922
|
if (!opts.async) {
|
|
1902
|
-
e.message += "\n";
|
|
1903
|
-
e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
|
|
1923
|
+
e$1.message += "\n";
|
|
1924
|
+
e$1.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
|
|
1904
1925
|
}
|
|
1905
1926
|
}
|
|
1906
|
-
throw e;
|
|
1927
|
+
throw e$1;
|
|
1907
1928
|
}
|
|
1908
1929
|
var returnedFn = opts.client ? fn : function anonymous(data) {
|
|
1909
|
-
var include = function(path$
|
|
1930
|
+
var include = function(path$3, includeData) {
|
|
1910
1931
|
var d$2 = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
1911
1932
|
if (includeData) d$2 = utils.shallowCopy(d$2, includeData);
|
|
1912
|
-
return includeFile(path$
|
|
1933
|
+
return includeFile(path$3, opts)(d$2);
|
|
1913
1934
|
};
|
|
1914
1935
|
return fn.apply(opts.context, [
|
|
1915
1936
|
data || utils.createNullProtoObjWherePossible(),
|
|
@@ -1920,7 +1941,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1920
1941
|
};
|
|
1921
1942
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
1922
1943
|
var filename = opts.filename;
|
|
1923
|
-
var basename = path$
|
|
1944
|
+
var basename = path$2.basename(filename, path$2.extname(filename));
|
|
1924
1945
|
try {
|
|
1925
1946
|
Object.defineProperty(returnedFn, "name", {
|
|
1926
1947
|
value: basename,
|
|
@@ -1928,7 +1949,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1928
1949
|
enumerable: false,
|
|
1929
1950
|
configurable: true
|
|
1930
1951
|
});
|
|
1931
|
-
} catch (e) {}
|
|
1952
|
+
} catch (e$1) {}
|
|
1932
1953
|
}
|
|
1933
1954
|
return returnedFn;
|
|
1934
1955
|
},
|
|
@@ -1940,12 +1961,12 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1940
1961
|
var matches = this.parseTemplateText();
|
|
1941
1962
|
var d$2 = this.opts.delimiter;
|
|
1942
1963
|
var o$1 = this.opts.openDelimiter;
|
|
1943
|
-
var c
|
|
1964
|
+
var c = this.opts.closeDelimiter;
|
|
1944
1965
|
if (matches && matches.length) matches.forEach(function(line, index) {
|
|
1945
1966
|
var closing;
|
|
1946
1967
|
if (line.indexOf(o$1 + d$2) === 0 && line.indexOf(o$1 + d$2 + d$2) !== 0) {
|
|
1947
1968
|
closing = matches[index + 2];
|
|
1948
|
-
if (!(closing == d$2 + c
|
|
1969
|
+
if (!(closing == d$2 + c || closing == "-" + d$2 + c || closing == "_" + d$2 + c)) throw new Error("Could not find matching close tag for \"" + line + "\".");
|
|
1949
1970
|
}
|
|
1950
1971
|
self.scanLine(line);
|
|
1951
1972
|
});
|
|
@@ -1985,7 +2006,7 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
1985
2006
|
var self = this;
|
|
1986
2007
|
var d$2 = this.opts.delimiter;
|
|
1987
2008
|
var o$1 = this.opts.openDelimiter;
|
|
1988
|
-
var c
|
|
2009
|
+
var c = this.opts.closeDelimiter;
|
|
1989
2010
|
var newLineCount = 0;
|
|
1990
2011
|
newLineCount = line.split("\n").length - 1;
|
|
1991
2012
|
switch (line) {
|
|
@@ -2006,13 +2027,13 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
2006
2027
|
this.mode = Template.modes.LITERAL;
|
|
2007
2028
|
this.source += " ; __append(\"" + line.replace(o$1 + d$2 + d$2, o$1 + d$2) + "\")\n";
|
|
2008
2029
|
break;
|
|
2009
|
-
case d$2 + d$2 + c
|
|
2030
|
+
case d$2 + d$2 + c:
|
|
2010
2031
|
this.mode = Template.modes.LITERAL;
|
|
2011
|
-
this.source += " ; __append(\"" + line.replace(d$2 + d$2 + c
|
|
2032
|
+
this.source += " ; __append(\"" + line.replace(d$2 + d$2 + c, d$2 + c) + "\")\n";
|
|
2012
2033
|
break;
|
|
2013
|
-
case d$2 + c
|
|
2014
|
-
case "-" + d$2 + c
|
|
2015
|
-
case "_" + d$2 + c
|
|
2034
|
+
case d$2 + c:
|
|
2035
|
+
case "-" + d$2 + c:
|
|
2036
|
+
case "_" + d$2 + c:
|
|
2016
2037
|
if (this.mode == Template.modes.LITERAL) this._addOutput(line);
|
|
2017
2038
|
this.mode = null;
|
|
2018
2039
|
this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
|
|
@@ -2084,9 +2105,9 @@ var require_ejs = __commonJS({ "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/l
|
|
|
2084
2105
|
* @public
|
|
2085
2106
|
*/
|
|
2086
2107
|
exports.name = _NAME;
|
|
2108
|
+
/* istanbul ignore if */
|
|
2087
2109
|
if (typeof window != "undefined") window.ejs = exports;
|
|
2088
2110
|
} });
|
|
2089
|
-
var import_ejs = __toESM(require_ejs(), 1);
|
|
2090
2111
|
|
|
2091
2112
|
//#endregion
|
|
2092
2113
|
//#region utils/banners.ts
|
|
@@ -2096,7 +2117,7 @@ const gradientBanner = "\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B
|
|
|
2096
2117
|
//#endregion
|
|
2097
2118
|
//#region utils/deepMerge.ts
|
|
2098
2119
|
const isObject$1 = (val) => val && typeof val === "object";
|
|
2099
|
-
const mergeArrayWithDedupe$1 = (a, b$
|
|
2120
|
+
const mergeArrayWithDedupe$1 = (a, b$2) => Array.from(new Set([...a, ...b$2]));
|
|
2100
2121
|
/**
|
|
2101
2122
|
* Recursively merge the content of the new object to the existing one
|
|
2102
2123
|
* @param {Object} target the existing object
|
|
@@ -2148,40 +2169,40 @@ function sortDependencies(packageJson) {
|
|
|
2148
2169
|
* @param {string} dest destination filename of the copy operation
|
|
2149
2170
|
*/
|
|
2150
2171
|
function renderTemplate(src, dest, callbacks) {
|
|
2151
|
-
const stats = fs
|
|
2172
|
+
const stats = fs.statSync(src);
|
|
2152
2173
|
if (stats.isDirectory()) {
|
|
2153
|
-
if (path
|
|
2154
|
-
fs
|
|
2155
|
-
for (const file of fs
|
|
2174
|
+
if (path.basename(src) === "node_modules") return;
|
|
2175
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
2176
|
+
for (const file of fs.readdirSync(src)) renderTemplate(path.resolve(src, file), path.resolve(dest, file), callbacks);
|
|
2156
2177
|
return;
|
|
2157
2178
|
}
|
|
2158
|
-
const filename = path
|
|
2159
|
-
if (filename === "package.json" && fs
|
|
2160
|
-
const existing = JSON.parse(fs
|
|
2161
|
-
const newPackage = JSON.parse(fs
|
|
2179
|
+
const filename = path.basename(src);
|
|
2180
|
+
if (filename === "package.json" && fs.existsSync(dest)) {
|
|
2181
|
+
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
2182
|
+
const newPackage = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
2162
2183
|
const pkg = sortDependencies(deepMerge_default(existing, newPackage));
|
|
2163
|
-
fs
|
|
2184
|
+
fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
|
|
2164
2185
|
return;
|
|
2165
2186
|
}
|
|
2166
|
-
if (filename === "extensions.json" && fs
|
|
2167
|
-
const existing = JSON.parse(fs
|
|
2168
|
-
const newExtensions = JSON.parse(fs
|
|
2187
|
+
if (filename === "extensions.json" && fs.existsSync(dest)) {
|
|
2188
|
+
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
2189
|
+
const newExtensions = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
2169
2190
|
const extensions = deepMerge_default(existing, newExtensions);
|
|
2170
|
-
fs
|
|
2191
|
+
fs.writeFileSync(dest, JSON.stringify(extensions, null, 2) + "\n");
|
|
2171
2192
|
return;
|
|
2172
2193
|
}
|
|
2173
|
-
if (filename === "settings.json" && fs
|
|
2174
|
-
const existing = JSON.parse(fs
|
|
2175
|
-
const newSettings = JSON.parse(fs
|
|
2194
|
+
if (filename === "settings.json" && fs.existsSync(dest)) {
|
|
2195
|
+
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
2196
|
+
const newSettings = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
2176
2197
|
const settings = deepMerge_default(existing, newSettings);
|
|
2177
|
-
fs
|
|
2198
|
+
fs.writeFileSync(dest, JSON.stringify(settings, null, 2) + "\n");
|
|
2178
2199
|
return;
|
|
2179
2200
|
}
|
|
2180
|
-
if (filename.startsWith("_")) dest = path
|
|
2181
|
-
if (filename === "_gitignore" && fs
|
|
2182
|
-
const existing = fs
|
|
2183
|
-
const newGitignore = fs
|
|
2184
|
-
fs
|
|
2201
|
+
if (filename.startsWith("_")) dest = path.resolve(path.dirname(dest), filename.replace(/^_/, "."));
|
|
2202
|
+
if (filename === "_gitignore" && fs.existsSync(dest)) {
|
|
2203
|
+
const existing = fs.readFileSync(dest, "utf8");
|
|
2204
|
+
const newGitignore = fs.readFileSync(src, "utf8");
|
|
2205
|
+
fs.writeFileSync(dest, existing + "\n" + newGitignore);
|
|
2185
2206
|
return;
|
|
2186
2207
|
}
|
|
2187
2208
|
if (filename.endsWith(".data.mjs")) {
|
|
@@ -2192,29 +2213,29 @@ function renderTemplate(src, dest, callbacks) {
|
|
|
2192
2213
|
});
|
|
2193
2214
|
return;
|
|
2194
2215
|
}
|
|
2195
|
-
fs
|
|
2216
|
+
fs.copyFileSync(src, dest);
|
|
2196
2217
|
}
|
|
2197
2218
|
var renderTemplate_default = renderTemplate;
|
|
2198
2219
|
|
|
2199
2220
|
//#endregion
|
|
2200
2221
|
//#region utils/directoryTraverse.ts
|
|
2201
2222
|
function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
2202
|
-
for (const filename of fs
|
|
2223
|
+
for (const filename of fs.readdirSync(dir)) {
|
|
2203
2224
|
if (filename === ".git") continue;
|
|
2204
|
-
const fullpath = path
|
|
2205
|
-
if (fs
|
|
2225
|
+
const fullpath = path.resolve(dir, filename);
|
|
2226
|
+
if (fs.lstatSync(fullpath).isDirectory()) {
|
|
2206
2227
|
dirCallback(fullpath);
|
|
2207
|
-
if (fs
|
|
2228
|
+
if (fs.existsSync(fullpath)) preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
2208
2229
|
continue;
|
|
2209
2230
|
}
|
|
2210
2231
|
fileCallback(fullpath);
|
|
2211
2232
|
}
|
|
2212
2233
|
}
|
|
2213
2234
|
function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
2214
|
-
for (const filename of fs
|
|
2235
|
+
for (const filename of fs.readdirSync(dir)) {
|
|
2215
2236
|
if (filename === ".git") continue;
|
|
2216
|
-
const fullpath = path
|
|
2217
|
-
if (fs
|
|
2237
|
+
const fullpath = path.resolve(dir, filename);
|
|
2238
|
+
if (fs.lstatSync(fullpath).isDirectory()) {
|
|
2218
2239
|
postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
2219
2240
|
dirCallback(fullpath);
|
|
2220
2241
|
continue;
|
|
@@ -2399,19 +2420,23 @@ function getLocale() {
|
|
|
2399
2420
|
return linkLocale(shellLocale.split(".")[0].replace("_", "-"));
|
|
2400
2421
|
}
|
|
2401
2422
|
async function loadLanguageFile(filePath) {
|
|
2402
|
-
return
|
|
2423
|
+
return await fs.promises.readFile(filePath, "utf-8").then((data) => {
|
|
2424
|
+
const parsedData = JSON.parse(data);
|
|
2425
|
+
if (parsedData) return parsedData;
|
|
2426
|
+
});
|
|
2403
2427
|
}
|
|
2404
2428
|
async function getLanguage(localesRoot) {
|
|
2405
2429
|
const locale = getLocale();
|
|
2406
|
-
const languageFilePath = path
|
|
2407
|
-
const fallbackPath = path
|
|
2408
|
-
const doesLanguageExist = fs
|
|
2430
|
+
const languageFilePath = path.resolve(localesRoot, `${locale}.json`);
|
|
2431
|
+
const fallbackPath = path.resolve(localesRoot, "en-US.json");
|
|
2432
|
+
const doesLanguageExist = fs.existsSync(languageFilePath);
|
|
2409
2433
|
const lang = doesLanguageExist ? await loadLanguageFile(languageFilePath) : await loadLanguageFile(fallbackPath);
|
|
2410
2434
|
return lang;
|
|
2411
2435
|
}
|
|
2412
2436
|
|
|
2413
2437
|
//#endregion
|
|
2414
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.
|
|
2438
|
+
//#region node_modules/.pnpm/@vue+create-eslint-config@0.11.1/node_modules/@vue/create-eslint-config/renderEjsFile.js
|
|
2439
|
+
var import_ejs$1 = __toESM(require_ejs(), 1);
|
|
2415
2440
|
const templates = {
|
|
2416
2441
|
"./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]\ncharset = utf-8\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n<%_ if (styleGuide !== 'standard' || needsPrettier) { _%>\n<%#\n// standard doesn't have an opinion on line endings\n// https://github.com/standard/standard/issues/140\n// or maximum line length\n// https://github.com/standard/standard/issues/1559\n// Prettier enforces these things, though.\n%>\nend_of_line = lf\nmax_line_length = 100\n<%_ } _%>\n",
|
|
2417
2442
|
"./templates/_gitattributes": "* text=auto eol=lf\n",
|
|
@@ -2420,13 +2445,13 @@ const templates = {
|
|
|
2420
2445
|
"./templates/eslint.config.ts.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport { globalIgnores } from 'eslint/config'\nimport { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'\nimport pluginVue from 'eslint-plugin-vue'\n<%_ for (const { importer } of configsAfterVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\n\n// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:\n// import { configureVueProject } from '@vue/eslint-config-typescript'\n// configureVueProject({ scriptLangs: ['ts', 'tsx'] })\n// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup\n\nexport default defineConfigWithVueTs(\n {\n name: 'app/files-to-lint',\n files: ['**/*.{<%= fileExtensions.join(',') %>}'],\n },\n\n globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),\n\n<%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n pluginVue.configs['flat/essential'],\n vueTsConfigs.recommended,\n<%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n)\n"
|
|
2421
2446
|
};
|
|
2422
2447
|
function renderEjsFile(filePath, data) {
|
|
2423
|
-
return import_ejs.render(templates[filePath], data, {});
|
|
2448
|
+
return import_ejs$1.render(templates[filePath], data, {});
|
|
2424
2449
|
}
|
|
2425
2450
|
|
|
2426
2451
|
//#endregion
|
|
2427
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.
|
|
2452
|
+
//#region node_modules/.pnpm/@vue+create-eslint-config@0.11.1/node_modules/@vue/create-eslint-config/package.json
|
|
2428
2453
|
var name$1 = "@vue/create-eslint-config";
|
|
2429
|
-
var version$1 = "0.
|
|
2454
|
+
var version$1 = "0.11.1";
|
|
2430
2455
|
var description$1 = "Utility to setup ESLint in Vue.js projects.";
|
|
2431
2456
|
var type$1 = "module";
|
|
2432
2457
|
var main = "index.js";
|
|
@@ -2459,17 +2484,17 @@ var dependencies = {
|
|
|
2459
2484
|
"kolorist": "^1.8.0"
|
|
2460
2485
|
};
|
|
2461
2486
|
var devDependencies$2 = {
|
|
2462
|
-
"@eslint/js": "^9.
|
|
2463
|
-
"@types/node": "^22.
|
|
2487
|
+
"@eslint/js": "^9.29.0",
|
|
2488
|
+
"@types/node": "^22.15.32",
|
|
2464
2489
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
2465
|
-
"@vue/eslint-config-typescript": "^14.5.
|
|
2466
|
-
"eslint": "^9.
|
|
2467
|
-
"eslint-plugin-oxlint": "
|
|
2468
|
-
"eslint-plugin-vue": "~10.
|
|
2469
|
-
"globals": "^16.
|
|
2490
|
+
"@vue/eslint-config-typescript": "^14.5.1",
|
|
2491
|
+
"eslint": "^9.29.0",
|
|
2492
|
+
"eslint-plugin-oxlint": "~1.1.0",
|
|
2493
|
+
"eslint-plugin-vue": "~10.2.0",
|
|
2494
|
+
"globals": "^16.2.0",
|
|
2470
2495
|
"jiti": "^2.4.2",
|
|
2471
|
-
"npm-run-all2": "^
|
|
2472
|
-
"oxlint": "
|
|
2496
|
+
"npm-run-all2": "^8.0.4",
|
|
2497
|
+
"oxlint": "~1.1.0",
|
|
2473
2498
|
"prettier": "3.5.3",
|
|
2474
2499
|
"typescript": "~5.8.2"
|
|
2475
2500
|
};
|
|
@@ -2494,7 +2519,7 @@ var package_default$2 = {
|
|
|
2494
2519
|
};
|
|
2495
2520
|
|
|
2496
2521
|
//#endregion
|
|
2497
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.
|
|
2522
|
+
//#region node_modules/.pnpm/@vue+create-eslint-config@0.11.1/node_modules/@vue/create-eslint-config/index.js
|
|
2498
2523
|
const versionMap = package_default$2.devDependencies;
|
|
2499
2524
|
function createConfig({ styleGuide = "default", hasTypeScript = false, needsPrettier = false, needsOxlint = false, additionalConfigs = [] }) {
|
|
2500
2525
|
const pickDependencies = (keys) => pickKeysFromObject(versionMap, keys);
|
|
@@ -2573,7 +2598,12 @@ function pickKeysFromObject(obj, keys) {
|
|
|
2573
2598
|
}, {});
|
|
2574
2599
|
}
|
|
2575
2600
|
const isObject = (val) => val && typeof val === "object";
|
|
2576
|
-
const mergeArrayWithDedupe = (a, b$
|
|
2601
|
+
const mergeArrayWithDedupe = (a, b$2) => Array.from(new Set([...a, ...b$2]));
|
|
2602
|
+
/**
|
|
2603
|
+
* Recursively merge the content of the new object to the existing one
|
|
2604
|
+
* @param {object} target the existing object
|
|
2605
|
+
* @param {object} obj the new object
|
|
2606
|
+
*/
|
|
2577
2607
|
function deepMerge(target, obj) {
|
|
2578
2608
|
for (const key of Object.keys(obj)) {
|
|
2579
2609
|
const oldVal = target[key];
|
|
@@ -2588,8 +2618,8 @@ function deepMerge(target, obj) {
|
|
|
2588
2618
|
//#endregion
|
|
2589
2619
|
//#region template/eslint/package.json
|
|
2590
2620
|
var devDependencies$1 = {
|
|
2591
|
-
"@vitest/eslint-plugin": "^1.
|
|
2592
|
-
"eslint-plugin-cypress": "^
|
|
2621
|
+
"@vitest/eslint-plugin": "^1.2.7",
|
|
2622
|
+
"eslint-plugin-cypress": "^5.1.0",
|
|
2593
2623
|
"eslint-plugin-playwright": "^2.2.0"
|
|
2594
2624
|
};
|
|
2595
2625
|
var package_default$1 = { devDependencies: devDependencies$1 };
|
|
@@ -2612,13 +2642,13 @@ function renderEslint(rootDir, { needsTypeScript, needsVitest, needsCypress, nee
|
|
|
2612
2642
|
needsPrettier,
|
|
2613
2643
|
additionalConfigs
|
|
2614
2644
|
});
|
|
2615
|
-
const packageJsonPath = path
|
|
2616
|
-
const existingPkg = JSON.parse(fs
|
|
2645
|
+
const packageJsonPath = path.resolve(rootDir, "package.json");
|
|
2646
|
+
const existingPkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
2617
2647
|
const updatedPkg = sortDependencies(deepMerge_default(existingPkg, pkg));
|
|
2618
|
-
fs
|
|
2648
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(updatedPkg, null, 2) + "\n", "utf8");
|
|
2619
2649
|
for (const [fileName, content] of Object.entries(files$1)) {
|
|
2620
|
-
const fullPath = path
|
|
2621
|
-
fs
|
|
2650
|
+
const fullPath = path.resolve(rootDir, fileName);
|
|
2651
|
+
fs.writeFileSync(fullPath, content, "utf8");
|
|
2622
2652
|
}
|
|
2623
2653
|
}
|
|
2624
2654
|
function getAdditionalConfigs({ needsTypeScript, needsVitest, needsCypress, needsCypressCT, needsPlaywright }) {
|
|
@@ -2637,7 +2667,7 @@ function getAdditionalConfigs({ needsTypeScript, needsVitest, needsCypress, need
|
|
|
2637
2667
|
if (needsCypress) additionalConfigs.push({
|
|
2638
2668
|
devDependencies: { "eslint-plugin-cypress": eslintDeps["eslint-plugin-cypress"] },
|
|
2639
2669
|
afterVuePlugin: [{
|
|
2640
|
-
importer: (needsTypeScript ? "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n" : "") + "import pluginCypress from 'eslint-plugin-cypress
|
|
2670
|
+
importer: (needsTypeScript ? "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n" : "") + "import pluginCypress from 'eslint-plugin-cypress'",
|
|
2641
2671
|
content: `
|
|
2642
2672
|
{
|
|
2643
2673
|
...pluginCypress.configs.recommended,
|
|
@@ -2646,11 +2676,7 @@ function getAdditionalConfigs({ needsTypeScript, needsVitest, needsCypress, need
|
|
|
2646
2676
|
...needsCypressCT ? ["**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}"] : [],
|
|
2647
2677
|
"cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}",
|
|
2648
2678
|
"cypress/support/**/*.{js,ts,jsx,tsx}"
|
|
2649
|
-
].map(JSON.stringify.bind(JSON)).join(",\n ").replace(
|
|
2650
|
-
/"/g,
|
|
2651
|
-
"'"
|
|
2652
|
-
/* use single quotes as in the other configs */
|
|
2653
|
-
)}
|
|
2679
|
+
].map(JSON.stringify.bind(JSON)).join(",\n ").replace(/"/g, "'")}
|
|
2654
2680
|
],
|
|
2655
2681
|
},`
|
|
2656
2682
|
}]
|
|
@@ -2672,12 +2698,12 @@ function getAdditionalConfigs({ needsTypeScript, needsVitest, needsCypress, need
|
|
|
2672
2698
|
//#endregion
|
|
2673
2699
|
//#region utils/trimBoilerplate.ts
|
|
2674
2700
|
function replaceContent(filepath, replacer) {
|
|
2675
|
-
const content = fs
|
|
2676
|
-
fs
|
|
2701
|
+
const content = fs.readFileSync(filepath, "utf8");
|
|
2702
|
+
fs.writeFileSync(filepath, replacer(content));
|
|
2677
2703
|
}
|
|
2678
2704
|
function trimBoilerplate(rootDir) {
|
|
2679
2705
|
const srcDir = path$1.resolve(rootDir, "src");
|
|
2680
|
-
for (const filename of fs
|
|
2706
|
+
for (const filename of fs.readdirSync(srcDir)) {
|
|
2681
2707
|
if ([
|
|
2682
2708
|
"main.js",
|
|
2683
2709
|
"main.ts",
|
|
@@ -2685,7 +2711,7 @@ function trimBoilerplate(rootDir) {
|
|
|
2685
2711
|
"stores"
|
|
2686
2712
|
].includes(filename)) continue;
|
|
2687
2713
|
const fullpath = path$1.resolve(srcDir, filename);
|
|
2688
|
-
fs
|
|
2714
|
+
fs.rmSync(fullpath, { recursive: true });
|
|
2689
2715
|
}
|
|
2690
2716
|
}
|
|
2691
2717
|
function removeCSSImport(rootDir, needsTypeScript, needsCypressCT) {
|
|
@@ -2705,10 +2731,10 @@ function emptyRouterConfig(rootDir, needsTypeScript) {
|
|
|
2705
2731
|
//#endregion
|
|
2706
2732
|
//#region package.json
|
|
2707
2733
|
var name = "create-vue";
|
|
2708
|
-
var version = "3.
|
|
2734
|
+
var version = "3.17.0";
|
|
2709
2735
|
var description = "🛠️ The recommended way to start a Vite-powered Vue project";
|
|
2710
2736
|
var type = "module";
|
|
2711
|
-
var packageManager = "pnpm@10.
|
|
2737
|
+
var packageManager = "pnpm@10.12.2";
|
|
2712
2738
|
var bin = { "create-vue": "bundle.js" };
|
|
2713
2739
|
var files = [
|
|
2714
2740
|
"locales",
|
|
@@ -2716,7 +2742,7 @@ var files = [
|
|
|
2716
2742
|
"template",
|
|
2717
2743
|
"!template/**/node_modules/.bin/*"
|
|
2718
2744
|
];
|
|
2719
|
-
var engines = { "node": ">=
|
|
2745
|
+
var engines = { "node": ">=v20.0.0" };
|
|
2720
2746
|
var scripts = {
|
|
2721
2747
|
"prepare": "husky",
|
|
2722
2748
|
"format": "prettier --write .",
|
|
@@ -2725,6 +2751,7 @@ var scripts = {
|
|
|
2725
2751
|
"pretest": "pnpm run build && pnpm run snapshot",
|
|
2726
2752
|
"test": "zx ./scripts/test.mjs",
|
|
2727
2753
|
"test:unit": "vitest",
|
|
2754
|
+
"preversion": "git fetch && git status -uno | grep -q 'Your branch is up to date'",
|
|
2728
2755
|
"postversion": "zx ./scripts/postversion.mjs",
|
|
2729
2756
|
"prepublishOnly": "pnpm run build"
|
|
2730
2757
|
};
|
|
@@ -2738,22 +2765,22 @@ var license = "MIT";
|
|
|
2738
2765
|
var bugs = { "url": "https://github.com/vuejs/create-vue/issues" };
|
|
2739
2766
|
var homepage = "https://github.com/vuejs/create-vue#readme";
|
|
2740
2767
|
var devDependencies = {
|
|
2741
|
-
"@clack/prompts": "^0.
|
|
2742
|
-
"@tsconfig/node22": "^22.0.
|
|
2768
|
+
"@clack/prompts": "^0.11.0",
|
|
2769
|
+
"@tsconfig/node22": "^22.0.2",
|
|
2743
2770
|
"@types/eslint": "^9.6.1",
|
|
2744
|
-
"@types/node": "^22.
|
|
2771
|
+
"@types/node": "^22.15.32",
|
|
2745
2772
|
"@types/prompts": "^2.4.9",
|
|
2746
|
-
"@vue/create-eslint-config": "^0.
|
|
2773
|
+
"@vue/create-eslint-config": "^0.11.1",
|
|
2747
2774
|
"@vue/tsconfig": "^0.7.0",
|
|
2748
2775
|
"ejs": "^3.1.10",
|
|
2749
2776
|
"husky": "^9.1.7",
|
|
2750
|
-
"lint-staged": "^
|
|
2777
|
+
"lint-staged": "^16.1.2",
|
|
2751
2778
|
"picocolors": "^1.1.1",
|
|
2752
2779
|
"prettier": "3.5.3",
|
|
2753
|
-
"rolldown": "1.0.0-beta.
|
|
2780
|
+
"rolldown": "1.0.0-beta.19",
|
|
2754
2781
|
"rollup-plugin-license": "^3.6.0",
|
|
2755
|
-
"vitest": "^3.
|
|
2756
|
-
"zx": "^8.
|
|
2782
|
+
"vitest": "^3.2.4",
|
|
2783
|
+
"zx": "^8.5.5"
|
|
2757
2784
|
};
|
|
2758
2785
|
var lint_staged = { "*.{js,ts,vue,json}": ["prettier --write"] };
|
|
2759
2786
|
var publishConfig = {
|
|
@@ -2783,6 +2810,8 @@ var package_default = {
|
|
|
2783
2810
|
|
|
2784
2811
|
//#endregion
|
|
2785
2812
|
//#region index.ts
|
|
2813
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
2814
|
+
var import_ejs = __toESM(require_ejs(), 1);
|
|
2786
2815
|
const language = await getLanguage(fileURLToPath(new URL("./locales", import.meta.url)));
|
|
2787
2816
|
const FEATURE_FLAGS = [
|
|
2788
2817
|
"default",
|
|
@@ -2800,8 +2829,9 @@ const FEATURE_FLAGS = [
|
|
|
2800
2829
|
"playwright",
|
|
2801
2830
|
"eslint",
|
|
2802
2831
|
"prettier",
|
|
2803
|
-
"eslint-with-
|
|
2804
|
-
"
|
|
2832
|
+
"eslint-with-prettier",
|
|
2833
|
+
"oxlint",
|
|
2834
|
+
"rolldown-vite"
|
|
2805
2835
|
];
|
|
2806
2836
|
const FEATURE_OPTIONS = [
|
|
2807
2837
|
{
|
|
@@ -2837,6 +2867,13 @@ const FEATURE_OPTIONS = [
|
|
|
2837
2867
|
label: language.needsPrettier.message
|
|
2838
2868
|
}
|
|
2839
2869
|
];
|
|
2870
|
+
const EXPERIMENTAL_FEATURE_OPTIONS = [{
|
|
2871
|
+
value: "oxlint",
|
|
2872
|
+
label: language.needsOxlint.message
|
|
2873
|
+
}, {
|
|
2874
|
+
value: "rolldown-vite",
|
|
2875
|
+
label: language.needsRolldownVite.message
|
|
2876
|
+
}];
|
|
2840
2877
|
function isValidPackageName(projectName) {
|
|
2841
2878
|
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
|
|
2842
2879
|
}
|
|
@@ -2856,7 +2893,7 @@ function emptyDir(dir) {
|
|
|
2856
2893
|
}
|
|
2857
2894
|
async function unwrapPrompt(maybeCancelPromise) {
|
|
2858
2895
|
const result = await maybeCancelPromise;
|
|
2859
|
-
if (
|
|
2896
|
+
if (pD(result)) {
|
|
2860
2897
|
xe((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
|
|
2861
2898
|
process.exit(0);
|
|
2862
2899
|
}
|
|
@@ -2901,12 +2938,14 @@ Available feature flags:
|
|
|
2901
2938
|
If used without ${(0, import_picocolors.cyan)("--vitest")}, it will also add Nightwatch Component Testing.
|
|
2902
2939
|
--eslint
|
|
2903
2940
|
Add ESLint for code quality.
|
|
2904
|
-
--eslint-with-oxlint
|
|
2905
|
-
Add ESLint for code quality, and use Oxlint to speed up the linting process.
|
|
2906
2941
|
--eslint-with-prettier (Deprecated in favor of ${(0, import_picocolors.cyan)("--eslint --prettier")})
|
|
2907
2942
|
Add Prettier for code formatting in addition to ESLint.
|
|
2908
2943
|
--prettier
|
|
2909
2944
|
Add Prettier for code formatting.
|
|
2945
|
+
--oxlint
|
|
2946
|
+
Add Oxlint for code quality and formatting.
|
|
2947
|
+
--rolldown-vite
|
|
2948
|
+
Use Rolldown Vite instead of Vite for building the project.
|
|
2910
2949
|
|
|
2911
2950
|
Unstable feature flags:
|
|
2912
2951
|
--tests, --with-tests
|
|
@@ -2948,14 +2987,15 @@ async function init() {
|
|
|
2948
2987
|
packageName: defaultProjectName,
|
|
2949
2988
|
features: [],
|
|
2950
2989
|
e2eFramework: void 0,
|
|
2951
|
-
|
|
2990
|
+
experimentFeatures: []
|
|
2952
2991
|
};
|
|
2953
2992
|
Ie(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
|
|
2954
2993
|
if (!targetDir) {
|
|
2955
2994
|
const _result = await unwrapPrompt(he({
|
|
2956
2995
|
message: language.projectName.message,
|
|
2957
2996
|
placeholder: defaultProjectName,
|
|
2958
|
-
|
|
2997
|
+
defaultValue: defaultProjectName,
|
|
2998
|
+
validate: (value) => value.length === 0 || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
|
|
2959
2999
|
}));
|
|
2960
3000
|
targetDir = result.projectName = result.packageName = _result.trim();
|
|
2961
3001
|
}
|
|
@@ -3003,20 +3043,22 @@ async function init() {
|
|
|
3003
3043
|
]
|
|
3004
3044
|
}));
|
|
3005
3045
|
}
|
|
3006
|
-
|
|
3007
|
-
message: language.
|
|
3008
|
-
|
|
3046
|
+
result.experimentFeatures = await unwrapPrompt(fe({
|
|
3047
|
+
message: `${language.needsExperimentalFeatures.message} ${(0, import_picocolors.dim)(language.needsExperimentalFeatures.hint)}`,
|
|
3048
|
+
options: EXPERIMENTAL_FEATURE_OPTIONS,
|
|
3049
|
+
required: false
|
|
3009
3050
|
}));
|
|
3010
3051
|
}
|
|
3011
|
-
const { features } = result;
|
|
3052
|
+
const { features, experimentFeatures } = result;
|
|
3012
3053
|
const needsTypeScript = argv$1.ts || argv$1.typescript || features.includes("typescript");
|
|
3013
3054
|
const needsJsx = argv$1.jsx || features.includes("jsx");
|
|
3014
3055
|
const needsRouter = argv$1.router || argv$1["vue-router"] || features.includes("router");
|
|
3015
3056
|
const needsPinia = argv$1.pinia || features.includes("pinia");
|
|
3016
3057
|
const needsVitest = argv$1.vitest || argv$1.tests || features.includes("vitest");
|
|
3017
|
-
const needsEslint = argv$1.eslint || argv$1["eslint-with-
|
|
3058
|
+
const needsEslint = argv$1.eslint || argv$1["eslint-with-prettier"] || features.includes("eslint");
|
|
3018
3059
|
const needsPrettier = argv$1.prettier || argv$1["eslint-with-prettier"] || features.includes("prettier");
|
|
3019
|
-
const needsOxlint = argv$1["
|
|
3060
|
+
const needsOxlint = experimentFeatures.includes("oxlint") || argv$1["oxlint"];
|
|
3061
|
+
const needsRolldownVite = experimentFeatures.includes("rolldown-vite") || argv$1["rolldown-vite"];
|
|
3020
3062
|
const { e2eFramework } = result;
|
|
3021
3063
|
const needsCypress = argv$1.cypress || argv$1.tests || e2eFramework === "cypress";
|
|
3022
3064
|
const needsCypressCT = needsCypress && !needsVitest;
|
|
@@ -3038,6 +3080,12 @@ async function init() {
|
|
|
3038
3080
|
const templateDir = path.resolve(templateRoot, templateName);
|
|
3039
3081
|
renderTemplate_default(templateDir, root, callbacks);
|
|
3040
3082
|
};
|
|
3083
|
+
const replaceVite = () => {
|
|
3084
|
+
const content = fs.readFileSync(path.resolve(root, "package.json"), "utf-8");
|
|
3085
|
+
const json = JSON.parse(content);
|
|
3086
|
+
json.devDependencies.vite = "npm:rolldown-vite@latest";
|
|
3087
|
+
fs.writeFileSync(path.resolve(root, "package.json"), JSON.stringify(json, null, 2));
|
|
3088
|
+
};
|
|
3041
3089
|
render("base");
|
|
3042
3090
|
if (needsJsx) render("config/jsx");
|
|
3043
3091
|
if (needsRouter) render("config/router");
|
|
@@ -3075,7 +3123,7 @@ async function init() {
|
|
|
3075
3123
|
if (needsNightwatchCT) render("tsconfig/nightwatch-ct");
|
|
3076
3124
|
fs.writeFileSync(path.resolve(root, "tsconfig.json"), JSON.stringify(rootTsConfig, null, 2) + "\n", "utf-8");
|
|
3077
3125
|
}
|
|
3078
|
-
if (needsEslint) {
|
|
3126
|
+
if (needsEslint || needsOxlint) {
|
|
3079
3127
|
renderEslint(root, {
|
|
3080
3128
|
needsTypeScript,
|
|
3081
3129
|
needsOxlint,
|
|
@@ -3089,6 +3137,7 @@ async function init() {
|
|
|
3089
3137
|
}
|
|
3090
3138
|
if (needsOxlint) render("config/oxlint");
|
|
3091
3139
|
if (needsPrettier) render("config/prettier");
|
|
3140
|
+
if (needsRolldownVite) replaceVite();
|
|
3092
3141
|
const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
|
|
3093
3142
|
render(`code/${codeTemplate}`);
|
|
3094
3143
|
if (needsPinia && needsRouter) render("entry/router-and-pinia");
|
|
@@ -3160,8 +3209,8 @@ ${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
|
|
|
3160
3209
|
${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
|
|
3161
3210
|
Se(outroMessage);
|
|
3162
3211
|
}
|
|
3163
|
-
init().catch((e) => {
|
|
3164
|
-
console.error(e);
|
|
3212
|
+
init().catch((e$1) => {
|
|
3213
|
+
console.error(e$1);
|
|
3165
3214
|
process.exit(1);
|
|
3166
3215
|
});
|
|
3167
3216
|
|