@hot-updater/aws 0.13.1 → 0.13.3-rc.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/dist/iac/index.cjs +1008 -285
- package/dist/iac/index.js +955 -232
- package/package.json +5 -13
package/dist/iac/index.cjs
CHANGED
|
@@ -31,6 +31,135 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
));
|
|
32
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
33
|
|
|
34
|
+
// ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
35
|
+
var require_src = __commonJS({
|
|
36
|
+
"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
|
|
37
|
+
"use strict";
|
|
38
|
+
var ESC = "\x1B";
|
|
39
|
+
var CSI = `${ESC}[`;
|
|
40
|
+
var beep = "\x07";
|
|
41
|
+
var cursor = {
|
|
42
|
+
to(x2, y2) {
|
|
43
|
+
if (!y2) return `${CSI}${x2 + 1}G`;
|
|
44
|
+
return `${CSI}${y2 + 1};${x2 + 1}H`;
|
|
45
|
+
},
|
|
46
|
+
move(x2, y2) {
|
|
47
|
+
let ret = "";
|
|
48
|
+
if (x2 < 0) ret += `${CSI}${-x2}D`;
|
|
49
|
+
else if (x2 > 0) ret += `${CSI}${x2}C`;
|
|
50
|
+
if (y2 < 0) ret += `${CSI}${-y2}A`;
|
|
51
|
+
else if (y2 > 0) ret += `${CSI}${y2}B`;
|
|
52
|
+
return ret;
|
|
53
|
+
},
|
|
54
|
+
up: (count2 = 1) => `${CSI}${count2}A`,
|
|
55
|
+
down: (count2 = 1) => `${CSI}${count2}B`,
|
|
56
|
+
forward: (count2 = 1) => `${CSI}${count2}C`,
|
|
57
|
+
backward: (count2 = 1) => `${CSI}${count2}D`,
|
|
58
|
+
nextLine: (count2 = 1) => `${CSI}E`.repeat(count2),
|
|
59
|
+
prevLine: (count2 = 1) => `${CSI}F`.repeat(count2),
|
|
60
|
+
left: `${CSI}G`,
|
|
61
|
+
hide: `${CSI}?25l`,
|
|
62
|
+
show: `${CSI}?25h`,
|
|
63
|
+
save: `${ESC}7`,
|
|
64
|
+
restore: `${ESC}8`
|
|
65
|
+
};
|
|
66
|
+
var scroll = {
|
|
67
|
+
up: (count2 = 1) => `${CSI}S`.repeat(count2),
|
|
68
|
+
down: (count2 = 1) => `${CSI}T`.repeat(count2)
|
|
69
|
+
};
|
|
70
|
+
var erase = {
|
|
71
|
+
screen: `${CSI}2J`,
|
|
72
|
+
up: (count2 = 1) => `${CSI}1J`.repeat(count2),
|
|
73
|
+
down: (count2 = 1) => `${CSI}J`.repeat(count2),
|
|
74
|
+
line: `${CSI}2K`,
|
|
75
|
+
lineEnd: `${CSI}K`,
|
|
76
|
+
lineStart: `${CSI}1K`,
|
|
77
|
+
lines(count2) {
|
|
78
|
+
let clear = "";
|
|
79
|
+
for (let i2 = 0; i2 < count2; i2++)
|
|
80
|
+
clear += this.line + (i2 < count2 - 1 ? cursor.up() : "");
|
|
81
|
+
if (count2)
|
|
82
|
+
clear += cursor.left;
|
|
83
|
+
return clear;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
module2.exports = { cursor, scroll, erase, beep };
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
91
|
+
var require_picocolors = __commonJS({
|
|
92
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
93
|
+
"use strict";
|
|
94
|
+
var p = process || {};
|
|
95
|
+
var argv = p.argv || [];
|
|
96
|
+
var env = p.env || {};
|
|
97
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
98
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
99
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
100
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
101
|
+
};
|
|
102
|
+
var replaceClose = (string, close, replace, index) => {
|
|
103
|
+
let result = "", cursor = 0;
|
|
104
|
+
do {
|
|
105
|
+
result += string.substring(cursor, index) + replace;
|
|
106
|
+
cursor = index + close.length;
|
|
107
|
+
index = string.indexOf(close, cursor);
|
|
108
|
+
} while (~index);
|
|
109
|
+
return result + string.substring(cursor);
|
|
110
|
+
};
|
|
111
|
+
var createColors = (enabled = isColorSupported) => {
|
|
112
|
+
let f3 = enabled ? formatter : () => String;
|
|
113
|
+
return {
|
|
114
|
+
isColorSupported: enabled,
|
|
115
|
+
reset: f3("\x1B[0m", "\x1B[0m"),
|
|
116
|
+
bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
117
|
+
dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
118
|
+
italic: f3("\x1B[3m", "\x1B[23m"),
|
|
119
|
+
underline: f3("\x1B[4m", "\x1B[24m"),
|
|
120
|
+
inverse: f3("\x1B[7m", "\x1B[27m"),
|
|
121
|
+
hidden: f3("\x1B[8m", "\x1B[28m"),
|
|
122
|
+
strikethrough: f3("\x1B[9m", "\x1B[29m"),
|
|
123
|
+
black: f3("\x1B[30m", "\x1B[39m"),
|
|
124
|
+
red: f3("\x1B[31m", "\x1B[39m"),
|
|
125
|
+
green: f3("\x1B[32m", "\x1B[39m"),
|
|
126
|
+
yellow: f3("\x1B[33m", "\x1B[39m"),
|
|
127
|
+
blue: f3("\x1B[34m", "\x1B[39m"),
|
|
128
|
+
magenta: f3("\x1B[35m", "\x1B[39m"),
|
|
129
|
+
cyan: f3("\x1B[36m", "\x1B[39m"),
|
|
130
|
+
white: f3("\x1B[37m", "\x1B[39m"),
|
|
131
|
+
gray: f3("\x1B[90m", "\x1B[39m"),
|
|
132
|
+
bgBlack: f3("\x1B[40m", "\x1B[49m"),
|
|
133
|
+
bgRed: f3("\x1B[41m", "\x1B[49m"),
|
|
134
|
+
bgGreen: f3("\x1B[42m", "\x1B[49m"),
|
|
135
|
+
bgYellow: f3("\x1B[43m", "\x1B[49m"),
|
|
136
|
+
bgBlue: f3("\x1B[44m", "\x1B[49m"),
|
|
137
|
+
bgMagenta: f3("\x1B[45m", "\x1B[49m"),
|
|
138
|
+
bgCyan: f3("\x1B[46m", "\x1B[49m"),
|
|
139
|
+
bgWhite: f3("\x1B[47m", "\x1B[49m"),
|
|
140
|
+
blackBright: f3("\x1B[90m", "\x1B[39m"),
|
|
141
|
+
redBright: f3("\x1B[91m", "\x1B[39m"),
|
|
142
|
+
greenBright: f3("\x1B[92m", "\x1B[39m"),
|
|
143
|
+
yellowBright: f3("\x1B[93m", "\x1B[39m"),
|
|
144
|
+
blueBright: f3("\x1B[94m", "\x1B[39m"),
|
|
145
|
+
magentaBright: f3("\x1B[95m", "\x1B[39m"),
|
|
146
|
+
cyanBright: f3("\x1B[96m", "\x1B[39m"),
|
|
147
|
+
whiteBright: f3("\x1B[97m", "\x1B[39m"),
|
|
148
|
+
bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
|
|
149
|
+
bgRedBright: f3("\x1B[101m", "\x1B[49m"),
|
|
150
|
+
bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
|
|
151
|
+
bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
|
|
152
|
+
bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
|
|
153
|
+
bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
|
|
154
|
+
bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
|
|
155
|
+
bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
module2.exports = createColors();
|
|
159
|
+
module2.exports.createColors = createColors;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
34
163
|
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
35
164
|
var require_windows = __commonJS({
|
|
36
165
|
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
|
|
@@ -48,8 +177,8 @@ var require_windows = __commonJS({
|
|
|
48
177
|
return true;
|
|
49
178
|
}
|
|
50
179
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
51
|
-
var
|
|
52
|
-
if (
|
|
180
|
+
var p = pathext[i2].toLowerCase();
|
|
181
|
+
if (p && path7.substr(-p.length).toLowerCase() === p) {
|
|
53
182
|
return true;
|
|
54
183
|
}
|
|
55
184
|
}
|
|
@@ -96,11 +225,11 @@ var require_mode = __commonJS({
|
|
|
96
225
|
var gid = stat.gid;
|
|
97
226
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
98
227
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var ug =
|
|
103
|
-
var ret = mod &
|
|
228
|
+
var u3 = parseInt("100", 8);
|
|
229
|
+
var g3 = parseInt("010", 8);
|
|
230
|
+
var o3 = parseInt("001", 8);
|
|
231
|
+
var ug = u3 | g3;
|
|
232
|
+
var ret = mod & o3 || mod & g3 && gid === myGid || mod & u3 && uid === myUid || mod & ug && myUid === 0;
|
|
104
233
|
return ret;
|
|
105
234
|
}
|
|
106
235
|
}
|
|
@@ -206,21 +335,21 @@ var require_which = __commonJS({
|
|
|
206
335
|
const ppRaw = pathEnv[i2];
|
|
207
336
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
208
337
|
const pCmd = path7.join(pathPart, cmd);
|
|
209
|
-
const
|
|
210
|
-
resolve(subStep(
|
|
338
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
339
|
+
resolve(subStep(p, i2, 0));
|
|
211
340
|
});
|
|
212
|
-
const subStep = (
|
|
341
|
+
const subStep = (p, i2, ii) => new Promise((resolve, reject) => {
|
|
213
342
|
if (ii === pathExt.length)
|
|
214
343
|
return resolve(step(i2 + 1));
|
|
215
344
|
const ext = pathExt[ii];
|
|
216
|
-
isexe(
|
|
345
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
217
346
|
if (!er && is) {
|
|
218
347
|
if (opt.all)
|
|
219
|
-
found.push(
|
|
348
|
+
found.push(p + ext);
|
|
220
349
|
else
|
|
221
|
-
return resolve(
|
|
350
|
+
return resolve(p + ext);
|
|
222
351
|
}
|
|
223
|
-
return resolve(subStep(
|
|
352
|
+
return resolve(subStep(p, i2, ii + 1));
|
|
224
353
|
});
|
|
225
354
|
});
|
|
226
355
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -233,9 +362,9 @@ var require_which = __commonJS({
|
|
|
233
362
|
const ppRaw = pathEnv[i2];
|
|
234
363
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
235
364
|
const pCmd = path7.join(pathPart, cmd);
|
|
236
|
-
const
|
|
237
|
-
for (let
|
|
238
|
-
const cur =
|
|
365
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
366
|
+
for (let j2 = 0; j2 < pathExt.length; j2++) {
|
|
367
|
+
const cur = p + pathExt[j2];
|
|
239
368
|
try {
|
|
240
369
|
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
241
370
|
if (is) {
|
|
@@ -300,7 +429,7 @@ var require_resolveCommand = __commonJS({
|
|
|
300
429
|
path: env[getPathKey({ env })],
|
|
301
430
|
pathExt: withoutPathExt ? path7.delimiter : void 0
|
|
302
431
|
});
|
|
303
|
-
} catch (
|
|
432
|
+
} catch (e2) {
|
|
304
433
|
} finally {
|
|
305
434
|
if (shouldSwitchCwd) {
|
|
306
435
|
process.chdir(cwd);
|
|
@@ -385,7 +514,7 @@ var require_readShebang = __commonJS({
|
|
|
385
514
|
fd = fs3.openSync(command, "r");
|
|
386
515
|
fs3.readSync(fd, buffer, 0, size, 0);
|
|
387
516
|
fs3.closeSync(fd);
|
|
388
|
-
} catch (
|
|
517
|
+
} catch (e2) {
|
|
389
518
|
}
|
|
390
519
|
return shebangCommand(buffer.toString());
|
|
391
520
|
}
|
|
@@ -532,79 +661,6 @@ var require_cross_spawn = __commonJS({
|
|
|
532
661
|
}
|
|
533
662
|
});
|
|
534
663
|
|
|
535
|
-
// ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
536
|
-
var require_picocolors = __commonJS({
|
|
537
|
-
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
538
|
-
"use strict";
|
|
539
|
-
var p7 = process || {};
|
|
540
|
-
var argv = p7.argv || [];
|
|
541
|
-
var env = p7.env || {};
|
|
542
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p7.platform === "win32" || (p7.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
543
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
544
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
545
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
546
|
-
};
|
|
547
|
-
var replaceClose = (string, close, replace, index) => {
|
|
548
|
-
let result = "", cursor = 0;
|
|
549
|
-
do {
|
|
550
|
-
result += string.substring(cursor, index) + replace;
|
|
551
|
-
cursor = index + close.length;
|
|
552
|
-
index = string.indexOf(close, cursor);
|
|
553
|
-
} while (~index);
|
|
554
|
-
return result + string.substring(cursor);
|
|
555
|
-
};
|
|
556
|
-
var createColors = (enabled = isColorSupported) => {
|
|
557
|
-
let f = enabled ? formatter : () => String;
|
|
558
|
-
return {
|
|
559
|
-
isColorSupported: enabled,
|
|
560
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
561
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
562
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
563
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
564
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
565
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
566
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
567
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
568
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
569
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
570
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
571
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
572
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
573
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
574
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
575
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
576
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
577
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
578
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
579
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
580
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
581
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
582
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
583
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
584
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
585
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
586
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
587
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
588
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
589
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
590
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
591
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
592
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
593
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
594
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
595
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
596
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
597
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
598
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
599
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
600
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
601
|
-
};
|
|
602
|
-
};
|
|
603
|
-
module2.exports = createColors();
|
|
604
|
-
module2.exports.createColors = createColors;
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
|
|
608
664
|
// iac/index.ts
|
|
609
665
|
var index_exports = {};
|
|
610
666
|
__export(index_exports, {
|
|
@@ -613,7 +669,679 @@ __export(index_exports, {
|
|
|
613
669
|
module.exports = __toCommonJS(index_exports);
|
|
614
670
|
var import_fs = __toESM(require("fs"), 1);
|
|
615
671
|
var import_credential_providers = require("@aws-sdk/credential-providers");
|
|
616
|
-
|
|
672
|
+
|
|
673
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
674
|
+
var import_node_util = require("util");
|
|
675
|
+
|
|
676
|
+
// ../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
677
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
678
|
+
var import_node_process = require("process");
|
|
679
|
+
var f = __toESM(require("readline"), 1);
|
|
680
|
+
var import_node_readline = __toESM(require("readline"), 1);
|
|
681
|
+
var import_node_tty = require("tty");
|
|
682
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
683
|
+
function J({ onlyFirst: t = false } = {}) {
|
|
684
|
+
const F2 = ["[\\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("|");
|
|
685
|
+
return new RegExp(F2, t ? void 0 : "g");
|
|
686
|
+
}
|
|
687
|
+
var Q = J();
|
|
688
|
+
function T(t) {
|
|
689
|
+
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
690
|
+
return t.replace(Q, "");
|
|
691
|
+
}
|
|
692
|
+
function O(t) {
|
|
693
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
694
|
+
}
|
|
695
|
+
var P = { exports: {} };
|
|
696
|
+
(function(t) {
|
|
697
|
+
var u3 = {};
|
|
698
|
+
t.exports = u3, u3.eastAsianWidth = function(e2) {
|
|
699
|
+
var s = e2.charCodeAt(0), i2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s;
|
|
700
|
+
return 55296 <= s && s <= 56319 && 56320 <= i2 && i2 <= 57343 && (s &= 1023, i2 &= 1023, D2 = s << 10 | i2, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
|
|
701
|
+
}, u3.characterLength = function(e2) {
|
|
702
|
+
var s = this.eastAsianWidth(e2);
|
|
703
|
+
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
704
|
+
};
|
|
705
|
+
function F2(e2) {
|
|
706
|
+
return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
707
|
+
}
|
|
708
|
+
u3.length = function(e2) {
|
|
709
|
+
for (var s = F2(e2), i2 = 0, D2 = 0; D2 < s.length; D2++) i2 = i2 + this.characterLength(s[D2]);
|
|
710
|
+
return i2;
|
|
711
|
+
}, u3.slice = function(e2, s, i2) {
|
|
712
|
+
textLen = u3.length(e2), s = s || 0, i2 = i2 || 1, s < 0 && (s = textLen + s), i2 < 0 && (i2 = textLen + i2);
|
|
713
|
+
for (var D2 = "", C2 = 0, o3 = F2(e2), E = 0; E < o3.length; E++) {
|
|
714
|
+
var a2 = o3[E], n2 = u3.length(a2);
|
|
715
|
+
if (C2 >= s - (n2 == 2 ? 1 : 0)) if (C2 + n2 <= i2) D2 += a2;
|
|
716
|
+
else break;
|
|
717
|
+
C2 += n2;
|
|
718
|
+
}
|
|
719
|
+
return D2;
|
|
720
|
+
};
|
|
721
|
+
})(P);
|
|
722
|
+
var X = P.exports;
|
|
723
|
+
var DD = O(X);
|
|
724
|
+
var uD = function() {
|
|
725
|
+
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;
|
|
726
|
+
};
|
|
727
|
+
var FD = O(uD);
|
|
728
|
+
function A(t, u3 = {}) {
|
|
729
|
+
if (typeof t != "string" || t.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t = T(t), t.length === 0)) return 0;
|
|
730
|
+
t = t.replace(FD(), " ");
|
|
731
|
+
const F2 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
732
|
+
let e2 = 0;
|
|
733
|
+
for (const s of t) {
|
|
734
|
+
const i2 = s.codePointAt(0);
|
|
735
|
+
if (i2 <= 31 || i2 >= 127 && i2 <= 159 || i2 >= 768 && i2 <= 879) continue;
|
|
736
|
+
switch (DD.eastAsianWidth(s)) {
|
|
737
|
+
case "F":
|
|
738
|
+
case "W":
|
|
739
|
+
e2 += 2;
|
|
740
|
+
break;
|
|
741
|
+
case "A":
|
|
742
|
+
e2 += F2;
|
|
743
|
+
break;
|
|
744
|
+
default:
|
|
745
|
+
e2 += 1;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return e2;
|
|
749
|
+
}
|
|
750
|
+
var m = 10;
|
|
751
|
+
var L = (t = 0) => (u3) => `\x1B[${u3 + t}m`;
|
|
752
|
+
var N = (t = 0) => (u3) => `\x1B[${38 + t};5;${u3}m`;
|
|
753
|
+
var I = (t = 0) => (u3, F2, e2) => `\x1B[${38 + t};2;${u3};${F2};${e2}m`;
|
|
754
|
+
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
755
|
+
Object.keys(r.modifier);
|
|
756
|
+
var tD = Object.keys(r.color);
|
|
757
|
+
var eD = Object.keys(r.bgColor);
|
|
758
|
+
[...tD, ...eD];
|
|
759
|
+
function sD() {
|
|
760
|
+
const t = /* @__PURE__ */ new Map();
|
|
761
|
+
for (const [u3, F2] of Object.entries(r)) {
|
|
762
|
+
for (const [e2, s] of Object.entries(F2)) r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F2[e2] = r[e2], t.set(s[0], s[1]);
|
|
763
|
+
Object.defineProperty(r, u3, { value: F2, enumerable: false });
|
|
764
|
+
}
|
|
765
|
+
return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F2, e2) => u3 === F2 && F2 === e2 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F2 / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
|
|
766
|
+
const F2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
767
|
+
if (!F2) return [0, 0, 0];
|
|
768
|
+
let [e2] = F2;
|
|
769
|
+
e2.length === 3 && (e2 = [...e2].map((i2) => i2 + i2).join(""));
|
|
770
|
+
const s = Number.parseInt(e2, 16);
|
|
771
|
+
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
772
|
+
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
773
|
+
if (u3 < 8) return 30 + u3;
|
|
774
|
+
if (u3 < 16) return 90 + (u3 - 8);
|
|
775
|
+
let F2, e2, s;
|
|
776
|
+
if (u3 >= 232) F2 = ((u3 - 232) * 10 + 8) / 255, e2 = F2, s = F2;
|
|
777
|
+
else {
|
|
778
|
+
u3 -= 16;
|
|
779
|
+
const C2 = u3 % 36;
|
|
780
|
+
F2 = Math.floor(u3 / 36) / 5, e2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
|
|
781
|
+
}
|
|
782
|
+
const i2 = Math.max(F2, e2, s) * 2;
|
|
783
|
+
if (i2 === 0) return 30;
|
|
784
|
+
let D2 = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F2));
|
|
785
|
+
return i2 === 2 && (D2 += 60), D2;
|
|
786
|
+
}, enumerable: false }, rgbToAnsi: { value: (u3, F2, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F2, e2)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
|
|
787
|
+
}
|
|
788
|
+
var iD = sD();
|
|
789
|
+
var v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
790
|
+
var CD = 39;
|
|
791
|
+
var w = "\x07";
|
|
792
|
+
var W = "[";
|
|
793
|
+
var rD = "]";
|
|
794
|
+
var R = "m";
|
|
795
|
+
var y = `${rD}8;;`;
|
|
796
|
+
var V = (t) => `${v.values().next().value}${W}${t}${R}`;
|
|
797
|
+
var z = (t) => `${v.values().next().value}${y}${t}${w}`;
|
|
798
|
+
var ED = (t) => t.split(" ").map((u3) => A(u3));
|
|
799
|
+
var _ = (t, u3, F2) => {
|
|
800
|
+
const e2 = [...u3];
|
|
801
|
+
let s = false, i2 = false, D2 = A(T(t[t.length - 1]));
|
|
802
|
+
for (const [C2, o3] of e2.entries()) {
|
|
803
|
+
const E = A(o3);
|
|
804
|
+
if (D2 + E <= F2 ? t[t.length - 1] += o3 : (t.push(o3), D2 = 0), v.has(o3) && (s = true, i2 = e2.slice(C2 + 1).join("").startsWith(y)), s) {
|
|
805
|
+
i2 ? o3 === w && (s = false, i2 = false) : o3 === R && (s = false);
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
D2 += E, D2 === F2 && C2 < e2.length - 1 && (t.push(""), D2 = 0);
|
|
809
|
+
}
|
|
810
|
+
!D2 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
811
|
+
};
|
|
812
|
+
var nD = (t) => {
|
|
813
|
+
const u3 = t.split(" ");
|
|
814
|
+
let F2 = u3.length;
|
|
815
|
+
for (; F2 > 0 && !(A(u3[F2 - 1]) > 0); ) F2--;
|
|
816
|
+
return F2 === u3.length ? t : u3.slice(0, F2).join(" ") + u3.slice(F2).join("");
|
|
817
|
+
};
|
|
818
|
+
var oD = (t, u3, F2 = {}) => {
|
|
819
|
+
if (F2.trim !== false && t.trim() === "") return "";
|
|
820
|
+
let e2 = "", s, i2;
|
|
821
|
+
const D2 = ED(t);
|
|
822
|
+
let C2 = [""];
|
|
823
|
+
for (const [E, a2] of t.split(" ").entries()) {
|
|
824
|
+
F2.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
|
|
825
|
+
let n2 = A(C2[C2.length - 1]);
|
|
826
|
+
if (E !== 0 && (n2 >= u3 && (F2.wordWrap === false || F2.trim === false) && (C2.push(""), n2 = 0), (n2 > 0 || F2.trim === false) && (C2[C2.length - 1] += " ", n2++)), F2.hard && D2[E] > u3) {
|
|
827
|
+
const B2 = u3 - n2, p = 1 + Math.floor((D2[E] - B2 - 1) / u3);
|
|
828
|
+
Math.floor((D2[E] - 1) / u3) < p && C2.push(""), _(C2, a2, u3);
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
831
|
+
if (n2 + D2[E] > u3 && n2 > 0 && D2[E] > 0) {
|
|
832
|
+
if (F2.wordWrap === false && n2 < u3) {
|
|
833
|
+
_(C2, a2, u3);
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
C2.push("");
|
|
837
|
+
}
|
|
838
|
+
if (n2 + D2[E] > u3 && F2.wordWrap === false) {
|
|
839
|
+
_(C2, a2, u3);
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
C2[C2.length - 1] += a2;
|
|
843
|
+
}
|
|
844
|
+
F2.trim !== false && (C2 = C2.map((E) => nD(E)));
|
|
845
|
+
const o3 = [...C2.join(`
|
|
846
|
+
`)];
|
|
847
|
+
for (const [E, a2] of o3.entries()) {
|
|
848
|
+
if (e2 += a2, v.has(a2)) {
|
|
849
|
+
const { groups: B2 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y}(?<uri>.*)${w})`).exec(o3.slice(E).join("")) || { groups: {} };
|
|
850
|
+
if (B2.code !== void 0) {
|
|
851
|
+
const p = Number.parseFloat(B2.code);
|
|
852
|
+
s = p === CD ? void 0 : p;
|
|
853
|
+
} else B2.uri !== void 0 && (i2 = B2.uri.length === 0 ? void 0 : B2.uri);
|
|
854
|
+
}
|
|
855
|
+
const n2 = iD.codes.get(Number(s));
|
|
856
|
+
o3[E + 1] === `
|
|
857
|
+
` ? (i2 && (e2 += z("")), s && n2 && (e2 += V(n2))) : a2 === `
|
|
858
|
+
` && (s && n2 && (e2 += V(s)), i2 && (e2 += z(i2)));
|
|
859
|
+
}
|
|
860
|
+
return e2;
|
|
861
|
+
};
|
|
862
|
+
function G(t, u3, F2) {
|
|
863
|
+
return String(t).normalize().replace(/\r\n/g, `
|
|
864
|
+
`).split(`
|
|
865
|
+
`).map((e2) => oD(e2, u3, F2)).join(`
|
|
866
|
+
`);
|
|
867
|
+
}
|
|
868
|
+
var aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
869
|
+
var c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
870
|
+
function k(t, u3) {
|
|
871
|
+
if (typeof t == "string") return c.aliases.get(t) === u3;
|
|
872
|
+
for (const F2 of t) if (F2 !== void 0 && k(F2, u3)) return true;
|
|
873
|
+
return false;
|
|
874
|
+
}
|
|
875
|
+
function lD(t, u3) {
|
|
876
|
+
if (t === u3) return;
|
|
877
|
+
const F2 = t.split(`
|
|
878
|
+
`), e2 = u3.split(`
|
|
879
|
+
`), s = [];
|
|
880
|
+
for (let i2 = 0; i2 < Math.max(F2.length, e2.length); i2++) F2[i2] !== e2[i2] && s.push(i2);
|
|
881
|
+
return s;
|
|
882
|
+
}
|
|
883
|
+
var xD = globalThis.process.platform.startsWith("win");
|
|
884
|
+
var S = Symbol("clack:cancel");
|
|
885
|
+
function BD(t) {
|
|
886
|
+
return t === S;
|
|
887
|
+
}
|
|
888
|
+
function d(t, u3) {
|
|
889
|
+
const F2 = t;
|
|
890
|
+
F2.isTTY && F2.setRawMode(u3);
|
|
891
|
+
}
|
|
892
|
+
function cD({ input: t = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F2 = true, hideCursor: e2 = true } = {}) {
|
|
893
|
+
const s = f.createInterface({ input: t, output: u3, prompt: "", tabSize: 1 });
|
|
894
|
+
f.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(true);
|
|
895
|
+
const i2 = (D2, { name: C2, sequence: o3 }) => {
|
|
896
|
+
const E = String(D2);
|
|
897
|
+
if (k([E, C2, o3], "cancel")) {
|
|
898
|
+
e2 && u3.write(import_sisteransi.cursor.show), process.exit(0);
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
if (!F2) return;
|
|
902
|
+
const a2 = C2 === "return" ? 0 : -1, n2 = C2 === "return" ? -1 : 0;
|
|
903
|
+
f.moveCursor(u3, a2, n2, () => {
|
|
904
|
+
f.clearLine(u3, 1, () => {
|
|
905
|
+
t.once("keypress", i2);
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
};
|
|
909
|
+
return e2 && u3.write(import_sisteransi.cursor.hide), t.once("keypress", i2), () => {
|
|
910
|
+
t.off("keypress", i2), e2 && u3.write(import_sisteransi.cursor.show), t.isTTY && !xD && t.setRawMode(false), s.terminal = false, s.close();
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
var AD = Object.defineProperty;
|
|
914
|
+
var pD = (t, u3, F2) => u3 in t ? AD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
915
|
+
var h = (t, u3, F2) => (pD(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
916
|
+
var x = class {
|
|
917
|
+
constructor(u3, F2 = true) {
|
|
918
|
+
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
919
|
+
const { input: e2 = import_node_process.stdin, output: s = import_node_process.stdout, render: i2, signal: D2, ...C2 } = u3;
|
|
920
|
+
this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i2.bind(this), this._track = F2, this._abortSignal = D2, this.input = e2, this.output = s;
|
|
921
|
+
}
|
|
922
|
+
unsubscribe() {
|
|
923
|
+
this._subscribers.clear();
|
|
924
|
+
}
|
|
925
|
+
setSubscriber(u3, F2) {
|
|
926
|
+
const e2 = this._subscribers.get(u3) ?? [];
|
|
927
|
+
e2.push(F2), this._subscribers.set(u3, e2);
|
|
928
|
+
}
|
|
929
|
+
on(u3, F2) {
|
|
930
|
+
this.setSubscriber(u3, { cb: F2 });
|
|
931
|
+
}
|
|
932
|
+
once(u3, F2) {
|
|
933
|
+
this.setSubscriber(u3, { cb: F2, once: true });
|
|
934
|
+
}
|
|
935
|
+
emit(u3, ...F2) {
|
|
936
|
+
const e2 = this._subscribers.get(u3) ?? [], s = [];
|
|
937
|
+
for (const i2 of e2) i2.cb(...F2), i2.once && s.push(() => e2.splice(e2.indexOf(i2), 1));
|
|
938
|
+
for (const i2 of s) i2();
|
|
939
|
+
}
|
|
940
|
+
prompt() {
|
|
941
|
+
return new Promise((u3, F2) => {
|
|
942
|
+
if (this._abortSignal) {
|
|
943
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u3(S);
|
|
944
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
945
|
+
this.state = "cancel", this.close();
|
|
946
|
+
}, { once: true });
|
|
947
|
+
}
|
|
948
|
+
const e2 = new import_node_tty.WriteStream(0);
|
|
949
|
+
e2._write = (s, i2, D2) => {
|
|
950
|
+
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
|
|
951
|
+
}, this.input.pipe(e2), this.rl = import_node_readline.default.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.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), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
952
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u3(this.value);
|
|
953
|
+
}), this.once("cancel", () => {
|
|
954
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u3(S);
|
|
955
|
+
});
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
onKeypress(u3, F2) {
|
|
959
|
+
if (this.state === "error" && (this.state = "active"), F2?.name && (!this._track && c.aliases.has(F2.name) && this.emit("cursor", c.aliases.get(F2.name)), c.actions.has(F2.name) && this.emit("cursor", F2.name)), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F2?.name === "return") {
|
|
960
|
+
if (this.opts.validate) {
|
|
961
|
+
const e2 = this.opts.validate(this.value);
|
|
962
|
+
e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.value));
|
|
963
|
+
}
|
|
964
|
+
this.state !== "error" && (this.state = "submit");
|
|
965
|
+
}
|
|
966
|
+
k([u3, F2?.name, F2?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
967
|
+
}
|
|
968
|
+
close() {
|
|
969
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
970
|
+
`), d(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
971
|
+
}
|
|
972
|
+
restoreCursor() {
|
|
973
|
+
const u3 = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
974
|
+
`).length - 1;
|
|
975
|
+
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
976
|
+
}
|
|
977
|
+
render() {
|
|
978
|
+
const u3 = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
979
|
+
if (u3 !== this._prevFrame) {
|
|
980
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
981
|
+
else {
|
|
982
|
+
const F2 = lD(this._prevFrame, u3);
|
|
983
|
+
if (this.restoreCursor(), F2 && F2?.length === 1) {
|
|
984
|
+
const e2 = F2[0];
|
|
985
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
986
|
+
const s = u3.split(`
|
|
987
|
+
`);
|
|
988
|
+
this.output.write(s[e2]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s.length - e2 - 1));
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
if (F2 && F2?.length > 1) {
|
|
992
|
+
const e2 = F2[0];
|
|
993
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
|
|
994
|
+
const s = u3.split(`
|
|
995
|
+
`).slice(e2);
|
|
996
|
+
this.output.write(s.join(`
|
|
997
|
+
`)), this._prevFrame = u3;
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
this.output.write(import_sisteransi.erase.down());
|
|
1001
|
+
}
|
|
1002
|
+
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
var fD = class extends x {
|
|
1007
|
+
get cursor() {
|
|
1008
|
+
return this.value ? 0 : 1;
|
|
1009
|
+
}
|
|
1010
|
+
get _value() {
|
|
1011
|
+
return this.cursor === 0;
|
|
1012
|
+
}
|
|
1013
|
+
constructor(u3) {
|
|
1014
|
+
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
1015
|
+
this.value = this._value;
|
|
1016
|
+
}), this.on("confirm", (F2) => {
|
|
1017
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F2, this.state = "submit", this.close();
|
|
1018
|
+
}), this.on("cursor", () => {
|
|
1019
|
+
this.value = !this.value;
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
var yD = Object.defineProperty;
|
|
1024
|
+
var _D = (t, u3, F2) => u3 in t ? yD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
1025
|
+
var Z = (t, u3, F2) => (_D(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
1026
|
+
var kD = class extends x {
|
|
1027
|
+
constructor({ mask: u3, ...F2 }) {
|
|
1028
|
+
super(F2), Z(this, "valueWithCursor", ""), Z(this, "_mask", "\u2022"), this._mask = u3 ?? "\u2022", this.on("finalize", () => {
|
|
1029
|
+
this.valueWithCursor = this.masked;
|
|
1030
|
+
}), this.on("value", () => {
|
|
1031
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
1032
|
+
else {
|
|
1033
|
+
const e2 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
1034
|
+
this.valueWithCursor = `${e2}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
get cursor() {
|
|
1039
|
+
return this._cursor;
|
|
1040
|
+
}
|
|
1041
|
+
get masked() {
|
|
1042
|
+
return this.value.replaceAll(/./g, this._mask);
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
var SD = Object.defineProperty;
|
|
1046
|
+
var $D = (t, u3, F2) => u3 in t ? SD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
1047
|
+
var q = (t, u3, F2) => ($D(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
1048
|
+
var jD = class extends x {
|
|
1049
|
+
constructor(u3) {
|
|
1050
|
+
super(u3, false), q(this, "options"), q(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F2 }) => F2 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F2) => {
|
|
1051
|
+
switch (F2) {
|
|
1052
|
+
case "left":
|
|
1053
|
+
case "up":
|
|
1054
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1055
|
+
break;
|
|
1056
|
+
case "down":
|
|
1057
|
+
case "right":
|
|
1058
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
this.changeValue();
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
get _value() {
|
|
1065
|
+
return this.options[this.cursor];
|
|
1066
|
+
}
|
|
1067
|
+
changeValue() {
|
|
1068
|
+
this.value = this._value.value;
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
var PD = class extends x {
|
|
1072
|
+
get valueWithCursor() {
|
|
1073
|
+
if (this.state === "submit") return this.value;
|
|
1074
|
+
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
1075
|
+
const u3 = this.value.slice(0, this.cursor), [F2, ...e2] = this.value.slice(this.cursor);
|
|
1076
|
+
return `${u3}${import_picocolors.default.inverse(F2)}${e2.join("")}`;
|
|
1077
|
+
}
|
|
1078
|
+
get cursor() {
|
|
1079
|
+
return this._cursor;
|
|
1080
|
+
}
|
|
1081
|
+
constructor(u3) {
|
|
1082
|
+
super(u3), this.on("finalize", () => {
|
|
1083
|
+
this.value || (this.value = u3.defaultValue);
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1088
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1089
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
1090
|
+
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
1091
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1092
|
+
function ce() {
|
|
1093
|
+
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : !!import_node_process2.default.env.CI || !!import_node_process2.default.env.WT_SESSION || !!import_node_process2.default.env.TERMINUS_SUBLIME || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1094
|
+
}
|
|
1095
|
+
var V2 = ce();
|
|
1096
|
+
var u = (t, n2) => V2 ? t : n2;
|
|
1097
|
+
var le = u("\u25C6", "*");
|
|
1098
|
+
var L2 = u("\u25A0", "x");
|
|
1099
|
+
var W2 = u("\u25B2", "x");
|
|
1100
|
+
var C = u("\u25C7", "o");
|
|
1101
|
+
var ue = u("\u250C", "T");
|
|
1102
|
+
var o = u("\u2502", "|");
|
|
1103
|
+
var d2 = u("\u2514", "\u2014");
|
|
1104
|
+
var k2 = u("\u25CF", ">");
|
|
1105
|
+
var P2 = u("\u25CB", " ");
|
|
1106
|
+
var A2 = u("\u25FB", "[\u2022]");
|
|
1107
|
+
var T2 = u("\u25FC", "[+]");
|
|
1108
|
+
var F = u("\u25FB", "[ ]");
|
|
1109
|
+
var $e = u("\u25AA", "\u2022");
|
|
1110
|
+
var _2 = u("\u2500", "-");
|
|
1111
|
+
var me = u("\u256E", "+");
|
|
1112
|
+
var de = u("\u251C", "+");
|
|
1113
|
+
var pe = u("\u256F", "+");
|
|
1114
|
+
var q2 = u("\u25CF", "\u2022");
|
|
1115
|
+
var D = u("\u25C6", "*");
|
|
1116
|
+
var U2 = u("\u25B2", "!");
|
|
1117
|
+
var K = u("\u25A0", "x");
|
|
1118
|
+
var w2 = (t) => {
|
|
1119
|
+
switch (t) {
|
|
1120
|
+
case "initial":
|
|
1121
|
+
case "active":
|
|
1122
|
+
return import_picocolors2.default.cyan(le);
|
|
1123
|
+
case "cancel":
|
|
1124
|
+
return import_picocolors2.default.red(L2);
|
|
1125
|
+
case "error":
|
|
1126
|
+
return import_picocolors2.default.yellow(W2);
|
|
1127
|
+
case "submit":
|
|
1128
|
+
return import_picocolors2.default.green(C);
|
|
1129
|
+
}
|
|
1130
|
+
};
|
|
1131
|
+
var B = (t) => {
|
|
1132
|
+
const { cursor: n2, options: s, style: r2 } = t, i2 = t.maxItems ?? Number.POSITIVE_INFINITY, a2 = Math.max(process.stdout.rows - 4, 0), c4 = Math.min(a2, Math.max(i2, 5));
|
|
1133
|
+
let l2 = 0;
|
|
1134
|
+
n2 >= l2 + c4 - 3 ? l2 = Math.max(Math.min(n2 - c4 + 3, s.length - c4), 0) : n2 < l2 + 2 && (l2 = Math.max(n2 - 2, 0));
|
|
1135
|
+
const $3 = c4 < s.length && l2 > 0, p = c4 < s.length && l2 + c4 < s.length;
|
|
1136
|
+
return s.slice(l2, l2 + c4).map((M2, v2, x2) => {
|
|
1137
|
+
const j2 = v2 === 0 && $3, E = v2 === x2.length - 1 && p;
|
|
1138
|
+
return j2 || E ? import_picocolors2.default.dim("...") : r2(M2, v2 + l2 === n2);
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
1141
|
+
var he = (t) => new PD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
1142
|
+
const n2 = `${import_picocolors2.default.gray(o)}
|
|
1143
|
+
${w2(this.state)} ${t.message}
|
|
1144
|
+
`, s = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), r2 = this.value ? this.valueWithCursor : s;
|
|
1145
|
+
switch (this.state) {
|
|
1146
|
+
case "error":
|
|
1147
|
+
return `${n2.trim()}
|
|
1148
|
+
${import_picocolors2.default.yellow(o)} ${r2}
|
|
1149
|
+
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1150
|
+
`;
|
|
1151
|
+
case "submit":
|
|
1152
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
|
|
1153
|
+
case "cancel":
|
|
1154
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
1155
|
+
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1156
|
+
default:
|
|
1157
|
+
return `${n2}${import_picocolors2.default.cyan(o)} ${r2}
|
|
1158
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1159
|
+
`;
|
|
1160
|
+
}
|
|
1161
|
+
} }).prompt();
|
|
1162
|
+
var ge = (t) => new kD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
1163
|
+
const n2 = `${import_picocolors2.default.gray(o)}
|
|
1164
|
+
${w2(this.state)} ${t.message}
|
|
1165
|
+
`, s = this.valueWithCursor, r2 = this.masked;
|
|
1166
|
+
switch (this.state) {
|
|
1167
|
+
case "error":
|
|
1168
|
+
return `${n2.trim()}
|
|
1169
|
+
${import_picocolors2.default.yellow(o)} ${r2}
|
|
1170
|
+
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1171
|
+
`;
|
|
1172
|
+
case "submit":
|
|
1173
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(r2)}`;
|
|
1174
|
+
case "cancel":
|
|
1175
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2 ?? ""))}${r2 ? `
|
|
1176
|
+
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1177
|
+
default:
|
|
1178
|
+
return `${n2}${import_picocolors2.default.cyan(o)} ${s}
|
|
1179
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1180
|
+
`;
|
|
1181
|
+
}
|
|
1182
|
+
} }).prompt();
|
|
1183
|
+
var ye = (t) => {
|
|
1184
|
+
const n2 = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
1185
|
+
return new fD({ active: n2, inactive: s, initialValue: t.initialValue ?? true, render() {
|
|
1186
|
+
const r2 = `${import_picocolors2.default.gray(o)}
|
|
1187
|
+
${w2(this.state)} ${t.message}
|
|
1188
|
+
`, i2 = this.value ? n2 : s;
|
|
1189
|
+
switch (this.state) {
|
|
1190
|
+
case "submit":
|
|
1191
|
+
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i2)}`;
|
|
1192
|
+
case "cancel":
|
|
1193
|
+
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i2))}
|
|
1194
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1195
|
+
default:
|
|
1196
|
+
return `${r2}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n2}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n2)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(k2)} ${s}`}
|
|
1197
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1198
|
+
`;
|
|
1199
|
+
}
|
|
1200
|
+
} }).prompt();
|
|
1201
|
+
};
|
|
1202
|
+
var ve = (t) => {
|
|
1203
|
+
const n2 = (s, r2) => {
|
|
1204
|
+
const i2 = s.label ?? String(s.value);
|
|
1205
|
+
switch (r2) {
|
|
1206
|
+
case "selected":
|
|
1207
|
+
return `${import_picocolors2.default.dim(i2)}`;
|
|
1208
|
+
case "active":
|
|
1209
|
+
return `${import_picocolors2.default.green(k2)} ${i2} ${s.hint ? import_picocolors2.default.dim(`(${s.hint})`) : ""}`;
|
|
1210
|
+
case "cancelled":
|
|
1211
|
+
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i2))}`;
|
|
1212
|
+
default:
|
|
1213
|
+
return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(i2)}`;
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
return new jD({ options: t.options, initialValue: t.initialValue, render() {
|
|
1217
|
+
const s = `${import_picocolors2.default.gray(o)}
|
|
1218
|
+
${w2(this.state)} ${t.message}
|
|
1219
|
+
`;
|
|
1220
|
+
switch (this.state) {
|
|
1221
|
+
case "submit":
|
|
1222
|
+
return `${s}${import_picocolors2.default.gray(o)} ${n2(this.options[this.cursor], "selected")}`;
|
|
1223
|
+
case "cancel":
|
|
1224
|
+
return `${s}${import_picocolors2.default.gray(o)} ${n2(this.options[this.cursor], "cancelled")}
|
|
1225
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1226
|
+
default:
|
|
1227
|
+
return `${s}${import_picocolors2.default.cyan(o)} ${B({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (r2, i2) => n2(r2, i2 ? "active" : "inactive") }).join(`
|
|
1228
|
+
${import_picocolors2.default.cyan(o)} `)}
|
|
1229
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1230
|
+
`;
|
|
1231
|
+
}
|
|
1232
|
+
} }).prompt();
|
|
1233
|
+
};
|
|
1234
|
+
var Me = (t = "", n2 = "") => {
|
|
1235
|
+
const s = `
|
|
1236
|
+
${t}
|
|
1237
|
+
`.split(`
|
|
1238
|
+
`), r2 = (0, import_node_util.stripVTControlCharacters)(n2).length, i2 = Math.max(s.reduce((c4, l2) => {
|
|
1239
|
+
const $3 = (0, import_node_util.stripVTControlCharacters)(l2);
|
|
1240
|
+
return $3.length > c4 ? $3.length : c4;
|
|
1241
|
+
}, 0), r2) + 2, a2 = s.map((c4) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(c4)}${" ".repeat(i2 - (0, import_node_util.stripVTControlCharacters)(c4).length)}${import_picocolors2.default.gray(o)}`).join(`
|
|
1242
|
+
`);
|
|
1243
|
+
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1244
|
+
${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(_2.repeat(Math.max(i2 - r2 - 1, 1)) + me)}
|
|
1245
|
+
${a2}
|
|
1246
|
+
${import_picocolors2.default.gray(de + _2.repeat(i2 + 2) + pe)}
|
|
1247
|
+
`);
|
|
1248
|
+
};
|
|
1249
|
+
var f2 = { message: (t = "", { symbol: n2 = import_picocolors2.default.gray(o) } = {}) => {
|
|
1250
|
+
const s = [`${import_picocolors2.default.gray(o)}`];
|
|
1251
|
+
if (t) {
|
|
1252
|
+
const [r2, ...i2] = t.split(`
|
|
1253
|
+
`);
|
|
1254
|
+
s.push(`${n2} ${r2}`, ...i2.map((a2) => `${import_picocolors2.default.gray(o)} ${a2}`));
|
|
1255
|
+
}
|
|
1256
|
+
process.stdout.write(`${s.join(`
|
|
1257
|
+
`)}
|
|
1258
|
+
`);
|
|
1259
|
+
}, info: (t) => {
|
|
1260
|
+
f2.message(t, { symbol: import_picocolors2.default.blue(q2) });
|
|
1261
|
+
}, success: (t) => {
|
|
1262
|
+
f2.message(t, { symbol: import_picocolors2.default.green(D) });
|
|
1263
|
+
}, step: (t) => {
|
|
1264
|
+
f2.message(t, { symbol: import_picocolors2.default.green(C) });
|
|
1265
|
+
}, warn: (t) => {
|
|
1266
|
+
f2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
|
|
1267
|
+
}, warning: (t) => {
|
|
1268
|
+
f2.warn(t);
|
|
1269
|
+
}, error: (t) => {
|
|
1270
|
+
f2.message(t, { symbol: import_picocolors2.default.red(K) });
|
|
1271
|
+
} };
|
|
1272
|
+
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
1273
|
+
var Y = ({ indicator: t = "dots" } = {}) => {
|
|
1274
|
+
const n2 = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], s = V2 ? 80 : 120, r2 = process.env.CI === "true";
|
|
1275
|
+
let i2, a2, c4 = false, l2 = "", $3, p = performance.now();
|
|
1276
|
+
const M2 = (m2) => {
|
|
1277
|
+
const h3 = m2 > 1 ? "Something went wrong" : "Canceled";
|
|
1278
|
+
c4 && N2(h3, m2);
|
|
1279
|
+
}, v2 = () => M2(2), x2 = () => M2(1), j2 = () => {
|
|
1280
|
+
process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", x2), process.on("SIGTERM", x2), process.on("exit", M2);
|
|
1281
|
+
}, E = () => {
|
|
1282
|
+
process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", x2), process.removeListener("SIGTERM", x2), process.removeListener("exit", M2);
|
|
1283
|
+
}, O2 = () => {
|
|
1284
|
+
if ($3 === void 0) return;
|
|
1285
|
+
r2 && process.stdout.write(`
|
|
1286
|
+
`);
|
|
1287
|
+
const m2 = $3.split(`
|
|
1288
|
+
`);
|
|
1289
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
|
|
1290
|
+
}, R2 = (m2) => m2.replace(/\.+$/, ""), G2 = (m2) => {
|
|
1291
|
+
const h3 = (performance.now() - m2) / 1e3, y2 = Math.floor(h3 / 60), I2 = Math.floor(h3 % 60);
|
|
1292
|
+
return y2 > 0 ? `[${y2}m ${I2}s]` : `[${I2}s]`;
|
|
1293
|
+
}, H = (m2 = "") => {
|
|
1294
|
+
c4 = true, i2 = cD(), l2 = R2(m2), p = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1295
|
+
`);
|
|
1296
|
+
let h3 = 0, y2 = 0;
|
|
1297
|
+
j2(), a2 = setInterval(() => {
|
|
1298
|
+
if (r2 && l2 === $3) return;
|
|
1299
|
+
O2(), $3 = l2;
|
|
1300
|
+
const I2 = import_picocolors2.default.magenta(n2[h3]);
|
|
1301
|
+
if (r2) process.stdout.write(`${I2} ${l2}...`);
|
|
1302
|
+
else if (t === "timer") process.stdout.write(`${I2} ${l2} ${G2(p)}`);
|
|
1303
|
+
else {
|
|
1304
|
+
const z2 = ".".repeat(Math.floor(y2)).slice(0, 3);
|
|
1305
|
+
process.stdout.write(`${I2} ${l2}${z2}`);
|
|
1306
|
+
}
|
|
1307
|
+
h3 = h3 + 1 < n2.length ? h3 + 1 : 0, y2 = y2 < n2.length ? y2 + 0.125 : 0;
|
|
1308
|
+
}, s);
|
|
1309
|
+
}, N2 = (m2 = "", h3 = 0) => {
|
|
1310
|
+
c4 = false, clearInterval(a2), O2();
|
|
1311
|
+
const y2 = h3 === 0 ? import_picocolors2.default.green(C) : h3 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
|
|
1312
|
+
l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${y2} ${l2} ${G2(p)}
|
|
1313
|
+
`) : process.stdout.write(`${y2} ${l2}
|
|
1314
|
+
`), E(), i2();
|
|
1315
|
+
};
|
|
1316
|
+
return { start: H, stop: N2, message: (m2 = "") => {
|
|
1317
|
+
l2 = R2(m2 ?? l2);
|
|
1318
|
+
} };
|
|
1319
|
+
};
|
|
1320
|
+
var Ce = async (t, n2) => {
|
|
1321
|
+
const s = {}, r2 = Object.keys(t);
|
|
1322
|
+
for (const i2 of r2) {
|
|
1323
|
+
const a2 = t[i2], c4 = await a2({ results: s })?.catch((l2) => {
|
|
1324
|
+
throw l2;
|
|
1325
|
+
});
|
|
1326
|
+
if (typeof n2?.onCancel == "function" && BD(c4)) {
|
|
1327
|
+
s[i2] = "canceled", n2.onCancel({ results: s });
|
|
1328
|
+
continue;
|
|
1329
|
+
}
|
|
1330
|
+
s[i2] = c4;
|
|
1331
|
+
}
|
|
1332
|
+
return s;
|
|
1333
|
+
};
|
|
1334
|
+
var Te = async (t) => {
|
|
1335
|
+
for (const n2 of t) {
|
|
1336
|
+
if (n2.enabled === false) continue;
|
|
1337
|
+
const s = Y();
|
|
1338
|
+
s.start(n2.title);
|
|
1339
|
+
const r2 = await n2.task(s.message);
|
|
1340
|
+
s.stop(r2 || n2.title);
|
|
1341
|
+
}
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
// iac/index.ts
|
|
617
1345
|
var import_plugin_core2 = require("@hot-updater/plugin-core");
|
|
618
1346
|
|
|
619
1347
|
// ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
@@ -813,12 +1541,12 @@ var getSubprocessResult = ({ stdout }) => {
|
|
|
813
1541
|
var import_node_child_process3 = require("child_process");
|
|
814
1542
|
|
|
815
1543
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/specific.js
|
|
816
|
-
var
|
|
1544
|
+
var import_node_util2 = require("util");
|
|
817
1545
|
|
|
818
1546
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/standard-stream.js
|
|
819
|
-
var
|
|
1547
|
+
var import_node_process3 = __toESM(require("process"), 1);
|
|
820
1548
|
var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
821
|
-
var STANDARD_STREAMS = [
|
|
1549
|
+
var STANDARD_STREAMS = [import_node_process3.default.stdin, import_node_process3.default.stdout, import_node_process3.default.stderr];
|
|
822
1550
|
var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
|
|
823
1551
|
var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
|
|
824
1552
|
|
|
@@ -881,7 +1609,7 @@ var parseFd = (fdName) => {
|
|
|
881
1609
|
};
|
|
882
1610
|
var FD_REGEXP = /^fd(\d+)$/;
|
|
883
1611
|
var addDefaultValue = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
884
|
-
var verboseDefault = (0,
|
|
1612
|
+
var verboseDefault = (0, import_node_util2.debuglog)("execa").enabled ? "full" : "none";
|
|
885
1613
|
var DEFAULT_OPTIONS = {
|
|
886
1614
|
lines: false,
|
|
887
1615
|
buffer: true,
|
|
@@ -905,18 +1633,18 @@ var isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function";
|
|
|
905
1633
|
var VERBOSE_VALUES = ["none", "short", "full"];
|
|
906
1634
|
|
|
907
1635
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
908
|
-
var
|
|
1636
|
+
var import_node_util4 = require("util");
|
|
909
1637
|
|
|
910
1638
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
911
|
-
var
|
|
912
|
-
var
|
|
1639
|
+
var import_node_process4 = require("process");
|
|
1640
|
+
var import_node_util3 = require("util");
|
|
913
1641
|
var joinCommand = (filePath, rawArguments) => {
|
|
914
1642
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
915
1643
|
const command = fileAndArguments.join(" ");
|
|
916
1644
|
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
917
1645
|
return { command, escapedCommand };
|
|
918
1646
|
};
|
|
919
|
-
var escapeLines = (lines) => (0,
|
|
1647
|
+
var escapeLines = (lines) => (0, import_node_util3.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
920
1648
|
var escapeControlCharacters = (line) => line.replaceAll(SPECIAL_CHAR_REGEXP, (character) => escapeControlCharacter(character));
|
|
921
1649
|
var escapeControlCharacter = (character) => {
|
|
922
1650
|
const commonEscape = COMMON_ESCAPES[character];
|
|
@@ -948,16 +1676,16 @@ var quoteString = (escapedArgument) => {
|
|
|
948
1676
|
if (NO_ESCAPE_REGEXP.test(escapedArgument)) {
|
|
949
1677
|
return escapedArgument;
|
|
950
1678
|
}
|
|
951
|
-
return
|
|
1679
|
+
return import_node_process4.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
952
1680
|
};
|
|
953
1681
|
var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
954
1682
|
|
|
955
1683
|
// ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
956
|
-
var
|
|
1684
|
+
var import_node_process5 = __toESM(require("process"), 1);
|
|
957
1685
|
function isUnicodeSupported() {
|
|
958
|
-
const { env } =
|
|
1686
|
+
const { env } = import_node_process5.default;
|
|
959
1687
|
const { TERM, TERM_PROGRAM } = env;
|
|
960
|
-
if (
|
|
1688
|
+
if (import_node_process5.default.platform !== "win32") {
|
|
961
1689
|
return TERM !== "linux";
|
|
962
1690
|
}
|
|
963
1691
|
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -1240,8 +1968,8 @@ var figures_default = figures;
|
|
|
1240
1968
|
var replacements = Object.entries(specialMainSymbols);
|
|
1241
1969
|
|
|
1242
1970
|
// ../../node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
|
|
1243
|
-
var
|
|
1244
|
-
var hasColors =
|
|
1971
|
+
var import_node_tty2 = __toESM(require("tty"), 1);
|
|
1972
|
+
var hasColors = import_node_tty2.default?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
1245
1973
|
var format = (open, close) => {
|
|
1246
1974
|
if (!hasColors) {
|
|
1247
1975
|
return (input) => input;
|
|
@@ -1391,7 +2119,7 @@ var getPrintedLine = (verboseObject) => {
|
|
|
1391
2119
|
return { verboseLine, verboseObject };
|
|
1392
2120
|
};
|
|
1393
2121
|
var serializeVerboseMessage = (message) => {
|
|
1394
|
-
const messageString = typeof message === "string" ? message : (0,
|
|
2122
|
+
const messageString = typeof message === "string" ? message : (0, import_node_util4.inspect)(message);
|
|
1395
2123
|
const escapedMessage = escapeLines(messageString);
|
|
1396
2124
|
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
1397
2125
|
};
|
|
@@ -1438,9 +2166,9 @@ var validateVerbose = (verbose) => {
|
|
|
1438
2166
|
};
|
|
1439
2167
|
|
|
1440
2168
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/duration.js
|
|
1441
|
-
var
|
|
1442
|
-
var getStartTime = () =>
|
|
1443
|
-
var getDurationMs = (startTime) => Number(
|
|
2169
|
+
var import_node_process6 = require("process");
|
|
2170
|
+
var getStartTime = () => import_node_process6.hrtime.bigint();
|
|
2171
|
+
var getDurationMs = (startTime) => Number(import_node_process6.hrtime.bigint() - startTime) / 1e6;
|
|
1444
2172
|
|
|
1445
2173
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/command.js
|
|
1446
2174
|
var handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
@@ -1459,11 +2187,11 @@ var handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
1459
2187
|
|
|
1460
2188
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/options.js
|
|
1461
2189
|
var import_node_path5 = __toESM(require("path"), 1);
|
|
1462
|
-
var
|
|
2190
|
+
var import_node_process10 = __toESM(require("process"), 1);
|
|
1463
2191
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
1464
2192
|
|
|
1465
2193
|
// ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
1466
|
-
var
|
|
2194
|
+
var import_node_process7 = __toESM(require("process"), 1);
|
|
1467
2195
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
1468
2196
|
|
|
1469
2197
|
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
@@ -1479,11 +2207,11 @@ function pathKey(options = {}) {
|
|
|
1479
2207
|
}
|
|
1480
2208
|
|
|
1481
2209
|
// ../../node_modules/.pnpm/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
|
|
1482
|
-
var
|
|
2210
|
+
var import_node_util5 = require("util");
|
|
1483
2211
|
var import_node_child_process2 = require("child_process");
|
|
1484
2212
|
var import_node_path = __toESM(require("path"), 1);
|
|
1485
2213
|
var import_node_url2 = require("url");
|
|
1486
|
-
var execFileOriginal = (0,
|
|
2214
|
+
var execFileOriginal = (0, import_node_util5.promisify)(import_node_child_process2.execFile);
|
|
1487
2215
|
function toPath(urlOrPath) {
|
|
1488
2216
|
return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
1489
2217
|
}
|
|
@@ -1504,10 +2232,10 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
1504
2232
|
|
|
1505
2233
|
// ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
1506
2234
|
var npmRunPath = ({
|
|
1507
|
-
cwd =
|
|
1508
|
-
path: pathOption =
|
|
2235
|
+
cwd = import_node_process7.default.cwd(),
|
|
2236
|
+
path: pathOption = import_node_process7.default.env[pathKey()],
|
|
1509
2237
|
preferLocal = true,
|
|
1510
|
-
execPath: execPath2 =
|
|
2238
|
+
execPath: execPath2 = import_node_process7.default.execPath,
|
|
1511
2239
|
addExecPath = true
|
|
1512
2240
|
} = {}) => {
|
|
1513
2241
|
const cwdPath = import_node_path2.default.resolve(toPath(cwd));
|
|
@@ -1535,7 +2263,7 @@ var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
|
1535
2263
|
result.push(pathPart);
|
|
1536
2264
|
}
|
|
1537
2265
|
};
|
|
1538
|
-
var npmRunPathEnv = ({ env =
|
|
2266
|
+
var npmRunPathEnv = ({ env = import_node_process7.default.env, ...options } = {}) => {
|
|
1539
2267
|
env = { ...env };
|
|
1540
2268
|
const pathName = pathKey({ env });
|
|
1541
2269
|
options.path = env[pathName];
|
|
@@ -2085,7 +2813,7 @@ var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) =>
|
|
|
2085
2813
|
var import_promises3 = require("timers/promises");
|
|
2086
2814
|
|
|
2087
2815
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/send.js
|
|
2088
|
-
var
|
|
2816
|
+
var import_node_util6 = require("util");
|
|
2089
2817
|
|
|
2090
2818
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/validation.js
|
|
2091
2819
|
var validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected: isConnected2 }) => {
|
|
@@ -2555,7 +3283,7 @@ var getSendMethod = (anyProcess) => {
|
|
|
2555
3283
|
if (PROCESS_SEND_METHODS.has(anyProcess)) {
|
|
2556
3284
|
return PROCESS_SEND_METHODS.get(anyProcess);
|
|
2557
3285
|
}
|
|
2558
|
-
const sendMethod = (0,
|
|
3286
|
+
const sendMethod = (0, import_node_util6.promisify)(anyProcess.send.bind(anyProcess));
|
|
2559
3287
|
PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
|
|
2560
3288
|
return sendMethod;
|
|
2561
3289
|
};
|
|
@@ -2684,7 +3412,7 @@ var killAfterTimeout = async (subprocess, timeout, context, { signal }) => {
|
|
|
2684
3412
|
};
|
|
2685
3413
|
|
|
2686
3414
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/node.js
|
|
2687
|
-
var
|
|
3415
|
+
var import_node_process8 = require("process");
|
|
2688
3416
|
var import_node_path3 = __toESM(require("path"), 1);
|
|
2689
3417
|
var mapNode = ({ options }) => {
|
|
2690
3418
|
if (options.node === false) {
|
|
@@ -2694,8 +3422,8 @@ var mapNode = ({ options }) => {
|
|
|
2694
3422
|
};
|
|
2695
3423
|
var handleNodeOption = (file, commandArguments, {
|
|
2696
3424
|
node: shouldHandleNode = false,
|
|
2697
|
-
nodePath =
|
|
2698
|
-
nodeOptions =
|
|
3425
|
+
nodePath = import_node_process8.execPath,
|
|
3426
|
+
nodeOptions = import_node_process8.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
|
|
2699
3427
|
cwd,
|
|
2700
3428
|
execPath: formerNodePath,
|
|
2701
3429
|
...options
|
|
@@ -2805,14 +3533,14 @@ var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encodin
|
|
|
2805
3533
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
|
|
2806
3534
|
var import_node_fs = require("fs");
|
|
2807
3535
|
var import_node_path4 = __toESM(require("path"), 1);
|
|
2808
|
-
var
|
|
3536
|
+
var import_node_process9 = __toESM(require("process"), 1);
|
|
2809
3537
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
2810
3538
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
2811
3539
|
return import_node_path4.default.resolve(cwdString);
|
|
2812
3540
|
};
|
|
2813
3541
|
var getDefaultCwd = () => {
|
|
2814
3542
|
try {
|
|
2815
|
-
return
|
|
3543
|
+
return import_node_process9.default.cwd();
|
|
2816
3544
|
} catch (error) {
|
|
2817
3545
|
error.message = `The current directory does not exist.
|
|
2818
3546
|
${error.message}`;
|
|
@@ -2855,7 +3583,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2855
3583
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
2856
3584
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
2857
3585
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
2858
|
-
if (
|
|
3586
|
+
if (import_node_process10.default.platform === "win32" && import_node_path5.default.basename(file, ".exe") === "cmd") {
|
|
2859
3587
|
commandArguments.unshift("/q");
|
|
2860
3588
|
}
|
|
2861
3589
|
return { file, commandArguments, options };
|
|
@@ -2896,7 +3624,7 @@ var addDefaultOptions = ({
|
|
|
2896
3624
|
serialization
|
|
2897
3625
|
});
|
|
2898
3626
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
2899
|
-
const env = extendEnv ? { ...
|
|
3627
|
+
const env = extendEnv ? { ...import_node_process10.default.env, ...envOption } : envOption;
|
|
2900
3628
|
if (preferLocal || node) {
|
|
2901
3629
|
return npmRunPathEnv({
|
|
2902
3630
|
env,
|
|
@@ -2910,7 +3638,7 @@ var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, no
|
|
|
2910
3638
|
};
|
|
2911
3639
|
|
|
2912
3640
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/message.js
|
|
2913
|
-
var
|
|
3641
|
+
var import_node_util7 = require("util");
|
|
2914
3642
|
|
|
2915
3643
|
// ../../node_modules/.pnpm/strip-final-newline@4.0.0/node_modules/strip-final-newline/index.js
|
|
2916
3644
|
function stripFinalNewline(input) {
|
|
@@ -2955,20 +3683,20 @@ var a = Object.getPrototypeOf(
|
|
|
2955
3683
|
}
|
|
2956
3684
|
).prototype
|
|
2957
3685
|
);
|
|
2958
|
-
var
|
|
3686
|
+
var c2 = class {
|
|
2959
3687
|
#t;
|
|
2960
3688
|
#n;
|
|
2961
3689
|
#r = false;
|
|
2962
3690
|
#e = void 0;
|
|
2963
|
-
constructor(
|
|
2964
|
-
this.#t =
|
|
3691
|
+
constructor(e2, t) {
|
|
3692
|
+
this.#t = e2, this.#n = t;
|
|
2965
3693
|
}
|
|
2966
3694
|
next() {
|
|
2967
|
-
const
|
|
2968
|
-
return this.#e = this.#e ? this.#e.then(
|
|
3695
|
+
const e2 = () => this.#s();
|
|
3696
|
+
return this.#e = this.#e ? this.#e.then(e2, e2) : e2(), this.#e;
|
|
2969
3697
|
}
|
|
2970
|
-
return(
|
|
2971
|
-
const t = () => this.#i(
|
|
3698
|
+
return(e2) {
|
|
3699
|
+
const t = () => this.#i(e2);
|
|
2972
3700
|
return this.#e ? this.#e.then(t, t) : t();
|
|
2973
3701
|
}
|
|
2974
3702
|
async #s() {
|
|
@@ -2977,30 +3705,30 @@ var c = class {
|
|
|
2977
3705
|
done: true,
|
|
2978
3706
|
value: void 0
|
|
2979
3707
|
};
|
|
2980
|
-
let
|
|
3708
|
+
let e2;
|
|
2981
3709
|
try {
|
|
2982
|
-
|
|
3710
|
+
e2 = await this.#t.read();
|
|
2983
3711
|
} catch (t) {
|
|
2984
3712
|
throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t;
|
|
2985
3713
|
}
|
|
2986
|
-
return
|
|
3714
|
+
return e2.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e2;
|
|
2987
3715
|
}
|
|
2988
|
-
async #i(
|
|
3716
|
+
async #i(e2) {
|
|
2989
3717
|
if (this.#r)
|
|
2990
3718
|
return {
|
|
2991
3719
|
done: true,
|
|
2992
|
-
value:
|
|
3720
|
+
value: e2
|
|
2993
3721
|
};
|
|
2994
3722
|
if (this.#r = true, !this.#n) {
|
|
2995
|
-
const t = this.#t.cancel(
|
|
3723
|
+
const t = this.#t.cancel(e2);
|
|
2996
3724
|
return this.#t.releaseLock(), await t, {
|
|
2997
3725
|
done: true,
|
|
2998
|
-
value:
|
|
3726
|
+
value: e2
|
|
2999
3727
|
};
|
|
3000
3728
|
}
|
|
3001
3729
|
return this.#t.releaseLock(), {
|
|
3002
3730
|
done: true,
|
|
3003
|
-
value:
|
|
3731
|
+
value: e2
|
|
3004
3732
|
};
|
|
3005
3733
|
}
|
|
3006
3734
|
};
|
|
@@ -3009,11 +3737,11 @@ function i() {
|
|
|
3009
3737
|
return this[n].next();
|
|
3010
3738
|
}
|
|
3011
3739
|
Object.defineProperty(i, "name", { value: "next" });
|
|
3012
|
-
function
|
|
3013
|
-
return this[n].return(
|
|
3740
|
+
function o2(r2) {
|
|
3741
|
+
return this[n].return(r2);
|
|
3014
3742
|
}
|
|
3015
|
-
Object.defineProperty(
|
|
3016
|
-
var
|
|
3743
|
+
Object.defineProperty(o2, "name", { value: "return" });
|
|
3744
|
+
var u2 = Object.create(a, {
|
|
3017
3745
|
next: {
|
|
3018
3746
|
enumerable: true,
|
|
3019
3747
|
configurable: true,
|
|
@@ -3024,14 +3752,14 @@ var u = Object.create(a, {
|
|
|
3024
3752
|
enumerable: true,
|
|
3025
3753
|
configurable: true,
|
|
3026
3754
|
writable: true,
|
|
3027
|
-
value:
|
|
3755
|
+
value: o2
|
|
3028
3756
|
}
|
|
3029
3757
|
});
|
|
3030
|
-
function
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
), s = Object.create(
|
|
3758
|
+
function h2({ preventCancel: r2 = false } = {}) {
|
|
3759
|
+
const e2 = this.getReader(), t = new c2(
|
|
3760
|
+
e2,
|
|
3761
|
+
r2
|
|
3762
|
+
), s = Object.create(u2);
|
|
3035
3763
|
return s[n] = t, s;
|
|
3036
3764
|
}
|
|
3037
3765
|
|
|
@@ -3044,7 +3772,7 @@ var getAsyncIterable = (stream) => {
|
|
|
3044
3772
|
return stream;
|
|
3045
3773
|
}
|
|
3046
3774
|
if (toString.call(stream) === "[object ReadableStream]") {
|
|
3047
|
-
return
|
|
3775
|
+
return h2.call(stream);
|
|
3048
3776
|
}
|
|
3049
3777
|
throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
3050
3778
|
};
|
|
@@ -3464,7 +4192,7 @@ var getOriginalMessage = (originalError, cwd) => {
|
|
|
3464
4192
|
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
3465
4193
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
3466
4194
|
};
|
|
3467
|
-
var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0,
|
|
4195
|
+
var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, import_node_util7.inspect)(ipcMessage);
|
|
3468
4196
|
var serializeMessagePart = (messagePart) => Array.isArray(messagePart) ? messagePart.map((messageItem) => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join("\n") : serializeMessageItem(messagePart);
|
|
3469
4197
|
var serializeMessageItem = (messageItem) => {
|
|
3470
4198
|
if (typeof messageItem === "string") {
|
|
@@ -4070,7 +4798,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
|
|
|
4070
4798
|
var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms;
|
|
4071
4799
|
|
|
4072
4800
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/direction.js
|
|
4073
|
-
var
|
|
4801
|
+
var import_node_process11 = __toESM(require("process"), 1);
|
|
4074
4802
|
var getStreamDirection = (stdioItems, fdNumber, optionName) => {
|
|
4075
4803
|
const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber));
|
|
4076
4804
|
if (directions.includes("input") && directions.includes("output")) {
|
|
@@ -4110,10 +4838,10 @@ var guessStreamDirection = {
|
|
|
4110
4838
|
}
|
|
4111
4839
|
};
|
|
4112
4840
|
var getStandardStreamDirection = (value) => {
|
|
4113
|
-
if ([0,
|
|
4841
|
+
if ([0, import_node_process11.default.stdin].includes(value)) {
|
|
4114
4842
|
return "input";
|
|
4115
4843
|
}
|
|
4116
|
-
if ([1, 2,
|
|
4844
|
+
if ([1, 2, import_node_process11.default.stdout, import_node_process11.default.stderr].includes(value)) {
|
|
4117
4845
|
return "output";
|
|
4118
4846
|
}
|
|
4119
4847
|
};
|
|
@@ -4141,7 +4869,7 @@ var getStdioArray = (stdio, options) => {
|
|
|
4141
4869
|
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
4142
4870
|
}
|
|
4143
4871
|
const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);
|
|
4144
|
-
return Array.from({ length }, (
|
|
4872
|
+
return Array.from({ length }, (_3, fdNumber) => stdio[fdNumber]);
|
|
4145
4873
|
};
|
|
4146
4874
|
var hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0);
|
|
4147
4875
|
var addDefaultValue2 = (stdioOption, fdNumber) => {
|
|
@@ -4158,7 +4886,7 @@ var isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(
|
|
|
4158
4886
|
|
|
4159
4887
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/native.js
|
|
4160
4888
|
var import_node_fs2 = require("fs");
|
|
4161
|
-
var
|
|
4889
|
+
var import_node_tty3 = __toESM(require("tty"), 1);
|
|
4162
4890
|
var handleNativeStream = ({ stdioItem, stdioItem: { type }, isStdioArray, fdNumber, direction, isSync }) => {
|
|
4163
4891
|
if (!isStdioArray || type !== "native") {
|
|
4164
4892
|
return stdioItem;
|
|
@@ -4188,7 +4916,7 @@ var getTargetFd = ({ value, optionName, fdNumber, direction }) => {
|
|
|
4188
4916
|
if (direction === "output") {
|
|
4189
4917
|
return { type: "fileNumber", value: targetFdNumber, optionName };
|
|
4190
4918
|
}
|
|
4191
|
-
if (
|
|
4919
|
+
if (import_node_tty3.default.isatty(targetFdNumber)) {
|
|
4192
4920
|
throw new TypeError(`The \`${optionName}: ${serializeOptionValue(value)}\` option is invalid: it cannot be a TTY with synchronous methods.`);
|
|
4193
4921
|
}
|
|
4194
4922
|
return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs2.readFileSync)(targetFdNumber)), optionName };
|
|
@@ -4694,8 +5422,8 @@ var encodingStringFinal = function* (stringDecoder) {
|
|
|
4694
5422
|
};
|
|
4695
5423
|
|
|
4696
5424
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/run-async.js
|
|
4697
|
-
var
|
|
4698
|
-
var pushChunks = (0,
|
|
5425
|
+
var import_node_util8 = require("util");
|
|
5426
|
+
var pushChunks = (0, import_node_util8.callbackify)(async (getChunks, state, getChunksArguments, transformStream) => {
|
|
4699
5427
|
state.currentIterable = getChunks(...getChunksArguments);
|
|
4700
5428
|
try {
|
|
4701
5429
|
for await (const chunk of state.currentIterable) {
|
|
@@ -4728,7 +5456,7 @@ var generatorFinalChunks = async function* (final, index, generators) {
|
|
|
4728
5456
|
yield* transformChunk(finalChunk, generators, index + 1);
|
|
4729
5457
|
}
|
|
4730
5458
|
};
|
|
4731
|
-
var destroyTransform = (0,
|
|
5459
|
+
var destroyTransform = (0, import_node_util8.callbackify)(async ({ currentIterable }, error) => {
|
|
4732
5460
|
if (currentIterable !== void 0) {
|
|
4733
5461
|
await (error ? currentIterable.throw(error) : currentIterable.return());
|
|
4734
5462
|
return;
|
|
@@ -5217,7 +5945,7 @@ var import_node_events14 = require("events");
|
|
|
5217
5945
|
var import_node_child_process5 = require("child_process");
|
|
5218
5946
|
|
|
5219
5947
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/methods.js
|
|
5220
|
-
var
|
|
5948
|
+
var import_node_process12 = __toESM(require("process"), 1);
|
|
5221
5949
|
|
|
5222
5950
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/get-one.js
|
|
5223
5951
|
var import_node_events8 = require("events");
|
|
@@ -5358,9 +6086,9 @@ var addIpcMethods = (subprocess, { ipc }) => {
|
|
|
5358
6086
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
5359
6087
|
};
|
|
5360
6088
|
var getIpcExport = () => {
|
|
5361
|
-
const anyProcess =
|
|
6089
|
+
const anyProcess = import_node_process12.default;
|
|
5362
6090
|
const isSubprocess = true;
|
|
5363
|
-
const ipc =
|
|
6091
|
+
const ipc = import_node_process12.default.channel !== void 0;
|
|
5364
6092
|
return {
|
|
5365
6093
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
5366
6094
|
getCancelSignal: getCancelSignal.bind(void 0, {
|
|
@@ -5922,9 +6650,9 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5922
6650
|
this.#sigListeners[sig] = () => {
|
|
5923
6651
|
const listeners = this.#process.listeners(sig);
|
|
5924
6652
|
let { count: count2 } = this.#emitter;
|
|
5925
|
-
const
|
|
5926
|
-
if (typeof
|
|
5927
|
-
count2 +=
|
|
6653
|
+
const p = process10;
|
|
6654
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
6655
|
+
count2 += p.__signal_exit_emitter__.count;
|
|
5928
6656
|
}
|
|
5929
6657
|
if (listeners.length === count2) {
|
|
5930
6658
|
this.unload();
|
|
@@ -5966,7 +6694,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5966
6694
|
const fn = this.#sigListeners[sig];
|
|
5967
6695
|
if (fn)
|
|
5968
6696
|
this.#process.on(sig, fn);
|
|
5969
|
-
} catch (
|
|
6697
|
+
} catch (_3) {
|
|
5970
6698
|
}
|
|
5971
6699
|
}
|
|
5972
6700
|
this.#process.emit = (ev, ...a2) => {
|
|
@@ -5988,7 +6716,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5988
6716
|
}
|
|
5989
6717
|
try {
|
|
5990
6718
|
this.#process.removeListener(sig, listener);
|
|
5991
|
-
} catch (
|
|
6719
|
+
} catch (_3) {
|
|
5992
6720
|
}
|
|
5993
6721
|
});
|
|
5994
6722
|
this.#process.emit = this.#originalProcessEmit;
|
|
@@ -6232,10 +6960,10 @@ var SOURCE_LISTENERS_PER_PIPE = 2;
|
|
|
6232
6960
|
var DESTINATION_LISTENERS_PER_PIPE = 1;
|
|
6233
6961
|
|
|
6234
6962
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/abort.js
|
|
6235
|
-
var
|
|
6963
|
+
var import_node_util9 = require("util");
|
|
6236
6964
|
var unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ? [] : [unpipeOnSignalAbort(unpipeSignal, unpipeContext)];
|
|
6237
6965
|
var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
6238
|
-
await (0,
|
|
6966
|
+
await (0, import_node_util9.aborted)(unpipeSignal, sourceStream);
|
|
6239
6967
|
await mergedStream.remove(sourceStream);
|
|
6240
6968
|
const error = new Error("Pipe canceled by `unpipeSignal` option.");
|
|
6241
6969
|
throw createNonCommandError({
|
|
@@ -6811,7 +7539,7 @@ var waitForConcurrentStreams = async ({ resolve, promises }, subprocess) => {
|
|
|
6811
7539
|
|
|
6812
7540
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/readable.js
|
|
6813
7541
|
var import_node_stream6 = require("stream");
|
|
6814
|
-
var
|
|
7542
|
+
var import_node_util10 = require("util");
|
|
6815
7543
|
|
|
6816
7544
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/shared.js
|
|
6817
7545
|
var import_promises11 = require("stream/promises");
|
|
@@ -6867,7 +7595,7 @@ var createReadable = ({ subprocess, concurrentStreams, encoding }, { from, binar
|
|
|
6867
7595
|
});
|
|
6868
7596
|
const readable2 = new import_node_stream6.Readable({
|
|
6869
7597
|
read,
|
|
6870
|
-
destroy: (0,
|
|
7598
|
+
destroy: (0, import_node_util10.callbackify)(onReadableDestroy.bind(void 0, { subprocessStdout, subprocess, waitReadableDestroy })),
|
|
6871
7599
|
highWaterMark: readableHighWaterMark,
|
|
6872
7600
|
objectMode: readableObjectMode,
|
|
6873
7601
|
encoding: readableEncoding
|
|
@@ -6940,12 +7668,12 @@ var destroyOtherReadable = (stream, error) => {
|
|
|
6940
7668
|
|
|
6941
7669
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/writable.js
|
|
6942
7670
|
var import_node_stream7 = require("stream");
|
|
6943
|
-
var
|
|
7671
|
+
var import_node_util11 = require("util");
|
|
6944
7672
|
var createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
6945
7673
|
const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams);
|
|
6946
7674
|
const writable2 = new import_node_stream7.Writable({
|
|
6947
7675
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
6948
|
-
destroy: (0,
|
|
7676
|
+
destroy: (0, import_node_util11.callbackify)(onWritableDestroy.bind(void 0, {
|
|
6949
7677
|
subprocessStdin,
|
|
6950
7678
|
subprocess,
|
|
6951
7679
|
waitWritableFinal,
|
|
@@ -6965,7 +7693,7 @@ var getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
|
6965
7693
|
};
|
|
6966
7694
|
var getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
6967
7695
|
write: onWrite.bind(void 0, subprocessStdin),
|
|
6968
|
-
final: (0,
|
|
7696
|
+
final: (0, import_node_util11.callbackify)(onWritableFinal.bind(void 0, subprocessStdin, subprocess, waitWritableFinal))
|
|
6969
7697
|
});
|
|
6970
7698
|
var onWrite = (subprocessStdin, chunk, encoding, done) => {
|
|
6971
7699
|
if (subprocessStdin.write(chunk, encoding)) {
|
|
@@ -7006,7 +7734,7 @@ var destroyOtherWritable = (stream, error) => {
|
|
|
7006
7734
|
|
|
7007
7735
|
// ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/duplex.js
|
|
7008
7736
|
var import_node_stream8 = require("stream");
|
|
7009
|
-
var
|
|
7737
|
+
var import_node_util12 = require("util");
|
|
7010
7738
|
var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, binary: binaryOption = true, preserveNewlines = true } = {}) => {
|
|
7011
7739
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
7012
7740
|
const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams);
|
|
@@ -7022,7 +7750,7 @@ var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, bin
|
|
|
7022
7750
|
const duplex2 = new import_node_stream8.Duplex({
|
|
7023
7751
|
read,
|
|
7024
7752
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
7025
|
-
destroy: (0,
|
|
7753
|
+
destroy: (0, import_node_util12.callbackify)(onDuplexDestroy.bind(void 0, {
|
|
7026
7754
|
subprocessStdout,
|
|
7027
7755
|
subprocessStdin,
|
|
7028
7756
|
subprocess,
|
|
@@ -7378,7 +8106,7 @@ var execaSync = createExeca(() => ({ isSync: true }));
|
|
|
7378
8106
|
var execaCommand = createExeca(mapCommandAsync);
|
|
7379
8107
|
var execaCommandSync = createExeca(mapCommandSync);
|
|
7380
8108
|
var execaNode = createExeca(mapNode);
|
|
7381
|
-
var $ = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
8109
|
+
var $2 = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
7382
8110
|
var {
|
|
7383
8111
|
sendMessage: sendMessage2,
|
|
7384
8112
|
getOneMessage: getOneMessage2,
|
|
@@ -7387,12 +8115,11 @@ var {
|
|
|
7387
8115
|
} = getIpcExport();
|
|
7388
8116
|
|
|
7389
8117
|
// iac/index.ts
|
|
7390
|
-
var
|
|
8118
|
+
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
7391
8119
|
|
|
7392
8120
|
// iac/cloudfront.ts
|
|
7393
8121
|
var import_crypto = __toESM(require("crypto"), 1);
|
|
7394
8122
|
var import_client_cloudfront = require("@aws-sdk/client-cloudfront");
|
|
7395
|
-
var p = __toESM(require("@clack/prompts"), 1);
|
|
7396
8123
|
|
|
7397
8124
|
// ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/error/AbortError.mjs
|
|
7398
8125
|
var AbortError = class extends Error {
|
|
@@ -7528,7 +8255,7 @@ var CloudFrontManager = class {
|
|
|
7528
8255
|
if (!keyGroupId) {
|
|
7529
8256
|
throw new Error("Failed to create Key Group");
|
|
7530
8257
|
}
|
|
7531
|
-
|
|
8258
|
+
f2.success(`Created new Key Group: ${keyGroupConfig.Name}`);
|
|
7532
8259
|
return { publicKeyId, keyGroupId };
|
|
7533
8260
|
}
|
|
7534
8261
|
async createOrUpdateDistribution(options) {
|
|
@@ -7584,14 +8311,14 @@ var CloudFrontManager = class {
|
|
|
7584
8311
|
if (matchingDistributions.length === 1) {
|
|
7585
8312
|
selectedDistribution = matchingDistributions[0];
|
|
7586
8313
|
} else if (matchingDistributions.length > 1) {
|
|
7587
|
-
const selectedDistributionStr = await
|
|
8314
|
+
const selectedDistributionStr = await ve({
|
|
7588
8315
|
message: "Multiple CloudFront distributions found. Please select one to use:",
|
|
7589
8316
|
options: matchingDistributions.map((dist) => ({
|
|
7590
8317
|
value: JSON.stringify(dist),
|
|
7591
8318
|
label: `${dist.Id} (${dist.DomainName})`
|
|
7592
8319
|
}))
|
|
7593
8320
|
});
|
|
7594
|
-
if (
|
|
8321
|
+
if (BD(selectedDistributionStr)) process.exit(0);
|
|
7595
8322
|
selectedDistribution = JSON.parse(selectedDistributionStr);
|
|
7596
8323
|
}
|
|
7597
8324
|
const newOverrides = {
|
|
@@ -7655,7 +8382,7 @@ var CloudFrontManager = class {
|
|
|
7655
8382
|
}
|
|
7656
8383
|
};
|
|
7657
8384
|
if (selectedDistribution) {
|
|
7658
|
-
|
|
8385
|
+
f2.success(
|
|
7659
8386
|
`Existing CloudFront distribution selected. Distribution ID: ${selectedDistribution.Id}.`
|
|
7660
8387
|
);
|
|
7661
8388
|
try {
|
|
@@ -7671,7 +8398,7 @@ var CloudFrontManager = class {
|
|
|
7671
8398
|
IfMatch: ETag,
|
|
7672
8399
|
DistributionConfig: finalConfig
|
|
7673
8400
|
});
|
|
7674
|
-
|
|
8401
|
+
f2.success(
|
|
7675
8402
|
"CloudFront distribution updated with new Lambda function ARN."
|
|
7676
8403
|
);
|
|
7677
8404
|
await cloudfrontClient.createInvalidation({
|
|
@@ -7681,13 +8408,13 @@ var CloudFrontManager = class {
|
|
|
7681
8408
|
Paths: { Quantity: 1, Items: ["/*"] }
|
|
7682
8409
|
}
|
|
7683
8410
|
});
|
|
7684
|
-
|
|
8411
|
+
f2.success("Cache invalidation request completed.");
|
|
7685
8412
|
return {
|
|
7686
8413
|
distributionId: selectedDistribution.Id,
|
|
7687
8414
|
distributionDomain: selectedDistribution.DomainName
|
|
7688
8415
|
};
|
|
7689
8416
|
} catch (err) {
|
|
7690
|
-
|
|
8417
|
+
f2.error(
|
|
7691
8418
|
`Failed to update CloudFront distribution: ${err instanceof Error ? err.message : String(err)}`
|
|
7692
8419
|
);
|
|
7693
8420
|
throw err;
|
|
@@ -7769,11 +8496,11 @@ var CloudFrontManager = class {
|
|
|
7769
8496
|
});
|
|
7770
8497
|
const distributionId = distResp.Distribution?.Id;
|
|
7771
8498
|
const distributionDomain = distResp.Distribution?.DomainName;
|
|
7772
|
-
|
|
8499
|
+
f2.success(
|
|
7773
8500
|
`Created new CloudFront distribution. Distribution ID: ${distributionId}`
|
|
7774
8501
|
);
|
|
7775
8502
|
let retryCount = 0;
|
|
7776
|
-
await
|
|
8503
|
+
await Te([
|
|
7777
8504
|
{
|
|
7778
8505
|
title: "Waiting for CloudFront distribution to complete...",
|
|
7779
8506
|
task: async (message) => {
|
|
@@ -7795,14 +8522,14 @@ var CloudFrontManager = class {
|
|
|
7795
8522
|
await delay(1e3);
|
|
7796
8523
|
}
|
|
7797
8524
|
}
|
|
7798
|
-
|
|
8525
|
+
f2.error("CloudFront distribution deployment timed out.");
|
|
7799
8526
|
process.exit(1);
|
|
7800
8527
|
}
|
|
7801
8528
|
}
|
|
7802
8529
|
]);
|
|
7803
8530
|
return { distributionId, distributionDomain };
|
|
7804
8531
|
} catch (error) {
|
|
7805
|
-
|
|
8532
|
+
f2.error(
|
|
7806
8533
|
`CloudFront distribution creation failed: ${error instanceof Error ? error.message : String(error)}`
|
|
7807
8534
|
);
|
|
7808
8535
|
throw error;
|
|
@@ -7812,7 +8539,6 @@ var CloudFrontManager = class {
|
|
|
7812
8539
|
|
|
7813
8540
|
// iac/iam.ts
|
|
7814
8541
|
var import_client_iam = require("@aws-sdk/client-iam");
|
|
7815
|
-
var p2 = __toESM(require("@clack/prompts"), 1);
|
|
7816
8542
|
var IAMManager = class {
|
|
7817
8543
|
region;
|
|
7818
8544
|
credentials;
|
|
@@ -7843,7 +8569,7 @@ var IAMManager = class {
|
|
|
7843
8569
|
RoleName: roleName
|
|
7844
8570
|
});
|
|
7845
8571
|
if (existingRole?.Arn) {
|
|
7846
|
-
|
|
8572
|
+
f2.info(
|
|
7847
8573
|
`Using existing IAM role: ${roleName} (${existingRole.Arn})`
|
|
7848
8574
|
);
|
|
7849
8575
|
return existingRole.Arn;
|
|
@@ -7856,7 +8582,7 @@ var IAMManager = class {
|
|
|
7856
8582
|
Description: "Role for Lambda@Edge to access S3"
|
|
7857
8583
|
});
|
|
7858
8584
|
const lambdaRoleArn = createRoleResp.Role?.Arn;
|
|
7859
|
-
|
|
8585
|
+
f2.info(`Created IAM role: ${roleName} (${lambdaRoleArn})`);
|
|
7860
8586
|
await iamClient.attachRolePolicy({
|
|
7861
8587
|
RoleName: roleName,
|
|
7862
8588
|
PolicyArn: "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
@@ -7865,11 +8591,11 @@ var IAMManager = class {
|
|
|
7865
8591
|
RoleName: roleName,
|
|
7866
8592
|
PolicyArn: "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
|
|
7867
8593
|
});
|
|
7868
|
-
|
|
8594
|
+
f2.info(`Attached required policies to ${roleName}`);
|
|
7869
8595
|
return lambdaRoleArn;
|
|
7870
8596
|
} catch (createError) {
|
|
7871
8597
|
if (createError instanceof Error) {
|
|
7872
|
-
|
|
8598
|
+
f2.error(`Error setting up IAM role: ${createError.message}`);
|
|
7873
8599
|
}
|
|
7874
8600
|
process.exit(1);
|
|
7875
8601
|
}
|
|
@@ -7881,7 +8607,6 @@ var IAMManager = class {
|
|
|
7881
8607
|
// iac/lambdaEdge.ts
|
|
7882
8608
|
var import_path = __toESM(require("path"), 1);
|
|
7883
8609
|
var import_client_lambda = require("@aws-sdk/client-lambda");
|
|
7884
|
-
var p3 = __toESM(require("@clack/prompts"), 1);
|
|
7885
8610
|
var import_plugin_core = require("@hot-updater/plugin-core");
|
|
7886
8611
|
var import_promises12 = __toESM(require("fs/promises"), 1);
|
|
7887
8612
|
var LambdaEdgeDeployer = class {
|
|
@@ -7891,12 +8616,12 @@ var LambdaEdgeDeployer = class {
|
|
|
7891
8616
|
}
|
|
7892
8617
|
async deploy(lambdaRoleArn, keyPair) {
|
|
7893
8618
|
const cwd = (0, import_plugin_core.getCwd)();
|
|
7894
|
-
const lambdaName = await
|
|
8619
|
+
const lambdaName = await he({
|
|
7895
8620
|
message: "Enter the name of the Lambda@Edge function",
|
|
7896
8621
|
defaultValue: "hot-updater-edge",
|
|
7897
8622
|
placeholder: "hot-updater-edge"
|
|
7898
8623
|
});
|
|
7899
|
-
if (
|
|
8624
|
+
if (BD(lambdaName)) process.exit(1);
|
|
7900
8625
|
const lambdaPath = require.resolve("@hot-updater/aws/lambda");
|
|
7901
8626
|
const lambdaDir = import_path.default.dirname(lambdaPath);
|
|
7902
8627
|
const { tmpDir, removeTmpDir } = await (0, import_plugin_core.copyDirToTmp)(lambdaDir);
|
|
@@ -7918,7 +8643,7 @@ var LambdaEdgeDeployer = class {
|
|
|
7918
8643
|
version: null
|
|
7919
8644
|
};
|
|
7920
8645
|
const zipFilePath = import_path.default.join(cwd, `${lambdaName}.zip`);
|
|
7921
|
-
await
|
|
8646
|
+
await Te([
|
|
7922
8647
|
{
|
|
7923
8648
|
title: "Compressing Lambda code to zip",
|
|
7924
8649
|
task: async () => {
|
|
@@ -7990,7 +8715,7 @@ var LambdaEdgeDeployer = class {
|
|
|
7990
8715
|
Timeout: 10
|
|
7991
8716
|
});
|
|
7992
8717
|
} catch (error2) {
|
|
7993
|
-
|
|
8718
|
+
f2.error(
|
|
7994
8719
|
`Failed to update Lambda configuration: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
7995
8720
|
);
|
|
7996
8721
|
}
|
|
@@ -7998,7 +8723,7 @@ var LambdaEdgeDeployer = class {
|
|
|
7998
8723
|
functionArn.version = updateResp.Version || "1";
|
|
7999
8724
|
} else {
|
|
8000
8725
|
if (error instanceof Error) {
|
|
8001
|
-
|
|
8726
|
+
f2.error(
|
|
8002
8727
|
`Failed to create or update Lambda function: ${error.message}`
|
|
8003
8728
|
);
|
|
8004
8729
|
}
|
|
@@ -8027,7 +8752,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8027
8752
|
`Lambda function is in a Failed state. Reason: ${resp.StateReason}`
|
|
8028
8753
|
);
|
|
8029
8754
|
}
|
|
8030
|
-
await new Promise((
|
|
8755
|
+
await new Promise((r2) => setTimeout(r2, 2e3));
|
|
8031
8756
|
}
|
|
8032
8757
|
}
|
|
8033
8758
|
}
|
|
@@ -8038,7 +8763,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8038
8763
|
if (!functionArn.arn.endsWith(`:${functionArn.version}`)) {
|
|
8039
8764
|
functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
|
|
8040
8765
|
}
|
|
8041
|
-
|
|
8766
|
+
f2.info(`Using Lambda ARN: ${functionArn.arn}`);
|
|
8042
8767
|
return { lambdaName, functionArn: functionArn.arn };
|
|
8043
8768
|
}
|
|
8044
8769
|
};
|
|
@@ -8046,7 +8771,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8046
8771
|
// iac/migrations/migrator.ts
|
|
8047
8772
|
var import_client_s3 = require("@aws-sdk/client-s3");
|
|
8048
8773
|
var import_lib_storage = require("@aws-sdk/lib-storage");
|
|
8049
|
-
var
|
|
8774
|
+
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
8050
8775
|
var S3Migration = class {
|
|
8051
8776
|
name;
|
|
8052
8777
|
s3;
|
|
@@ -8106,7 +8831,7 @@ var S3Migration = class {
|
|
|
8106
8831
|
}
|
|
8107
8832
|
return null;
|
|
8108
8833
|
} catch (error) {
|
|
8109
|
-
console.error(
|
|
8834
|
+
console.error(import_picocolors3.default.red(`Error reading file ${key}:`), error);
|
|
8110
8835
|
return null;
|
|
8111
8836
|
}
|
|
8112
8837
|
}
|
|
@@ -8116,8 +8841,8 @@ var S3Migration = class {
|
|
|
8116
8841
|
if (content) {
|
|
8117
8842
|
try {
|
|
8118
8843
|
return JSON.parse(content);
|
|
8119
|
-
} catch (
|
|
8120
|
-
console.error(
|
|
8844
|
+
} catch (e2) {
|
|
8845
|
+
console.error(import_picocolors3.default.red(`Error parsing JSON from ${key}:`), e2);
|
|
8121
8846
|
}
|
|
8122
8847
|
}
|
|
8123
8848
|
return null;
|
|
@@ -8144,8 +8869,8 @@ var S3Migration = class {
|
|
|
8144
8869
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
8145
8870
|
if (this.dryRun) {
|
|
8146
8871
|
console.log(
|
|
8147
|
-
|
|
8148
|
-
`[DRY RUN] Updated ${
|
|
8872
|
+
import_picocolors3.default.yellow(
|
|
8873
|
+
`[DRY RUN] Updated ${import_picocolors3.default.bold(normalizedKey)}`
|
|
8149
8874
|
)
|
|
8150
8875
|
);
|
|
8151
8876
|
return;
|
|
@@ -8157,7 +8882,7 @@ var S3Migration = class {
|
|
|
8157
8882
|
await this.doUpdateFile(normalizedKey, content, {
|
|
8158
8883
|
cacheControl
|
|
8159
8884
|
});
|
|
8160
|
-
console.log(
|
|
8885
|
+
console.log(import_picocolors3.default.green(`Updated ${import_picocolors3.default.bold(normalizedKey)}`));
|
|
8161
8886
|
}
|
|
8162
8887
|
// Moves a single file from one location to another.
|
|
8163
8888
|
// In dry-run mode, it logs what would be moved.
|
|
@@ -8166,8 +8891,8 @@ var S3Migration = class {
|
|
|
8166
8891
|
async moveFile(from, to) {
|
|
8167
8892
|
if (this.dryRun) {
|
|
8168
8893
|
console.log(
|
|
8169
|
-
|
|
8170
|
-
`[DRY RUN] ${
|
|
8894
|
+
import_picocolors3.default.yellow(
|
|
8895
|
+
`[DRY RUN] ${import_picocolors3.default.bold(from)} -> ${import_picocolors3.default.bold(to)}`
|
|
8171
8896
|
)
|
|
8172
8897
|
);
|
|
8173
8898
|
return;
|
|
@@ -8182,7 +8907,7 @@ var S3Migration = class {
|
|
|
8182
8907
|
await this.s3.send(copyCommand);
|
|
8183
8908
|
} catch (error) {
|
|
8184
8909
|
console.error(
|
|
8185
|
-
|
|
8910
|
+
import_picocolors3.default.red(`Error copying file from ${from} to ${to}:`),
|
|
8186
8911
|
error
|
|
8187
8912
|
);
|
|
8188
8913
|
throw error;
|
|
@@ -8196,15 +8921,15 @@ var S3Migration = class {
|
|
|
8196
8921
|
} catch (error) {
|
|
8197
8922
|
if (error?.message?.includes("NoSuchKey")) {
|
|
8198
8923
|
console.warn(
|
|
8199
|
-
|
|
8924
|
+
import_picocolors3.default.yellow(`Key ${from} not found during deletion, ignoring.`)
|
|
8200
8925
|
);
|
|
8201
8926
|
} else {
|
|
8202
|
-
console.error(
|
|
8927
|
+
console.error(import_picocolors3.default.red(`Error deleting file ${from}:`), error);
|
|
8203
8928
|
throw error;
|
|
8204
8929
|
}
|
|
8205
8930
|
}
|
|
8206
8931
|
console.log(
|
|
8207
|
-
|
|
8932
|
+
import_picocolors3.default.green(`${import_picocolors3.default.bold(from)} -> ${import_picocolors3.default.bold(to)}`)
|
|
8208
8933
|
);
|
|
8209
8934
|
}
|
|
8210
8935
|
// Deletes a backup file
|
|
@@ -8220,7 +8945,7 @@ var S3Migration = class {
|
|
|
8220
8945
|
await this.s3.send(deleteCommand);
|
|
8221
8946
|
} catch (error) {
|
|
8222
8947
|
console.error(
|
|
8223
|
-
|
|
8948
|
+
import_picocolors3.default.red(`Error deleting backup file ${backupKey}:`),
|
|
8224
8949
|
error
|
|
8225
8950
|
);
|
|
8226
8951
|
}
|
|
@@ -8238,27 +8963,27 @@ var S3Migration = class {
|
|
|
8238
8963
|
// Rollback method: restores files from backups stored in backupMapping
|
|
8239
8964
|
async rollback() {
|
|
8240
8965
|
console.log(
|
|
8241
|
-
|
|
8966
|
+
import_picocolors3.default.magenta(`Starting rollback for migration ${this.name}...`)
|
|
8242
8967
|
);
|
|
8243
8968
|
for (const [originalKey, backupKey] of this.backupMapping.entries()) {
|
|
8244
8969
|
const backupContent = await this.readFile(backupKey);
|
|
8245
8970
|
if (backupContent !== null) {
|
|
8246
8971
|
console.log(
|
|
8247
|
-
|
|
8972
|
+
import_picocolors3.default.blue(
|
|
8248
8973
|
`Restoring backup for ${originalKey} from ${backupKey}`
|
|
8249
8974
|
)
|
|
8250
8975
|
);
|
|
8251
8976
|
await this.doUpdateFile(originalKey, backupContent);
|
|
8252
8977
|
} else {
|
|
8253
8978
|
console.error(
|
|
8254
|
-
|
|
8979
|
+
import_picocolors3.default.red(
|
|
8255
8980
|
`Failed to read backup for ${originalKey} at ${backupKey}`
|
|
8256
8981
|
)
|
|
8257
8982
|
);
|
|
8258
8983
|
}
|
|
8259
8984
|
}
|
|
8260
8985
|
console.log(
|
|
8261
|
-
|
|
8986
|
+
import_picocolors3.default.green(`Rollback completed for migration ${this.name}.`)
|
|
8262
8987
|
);
|
|
8263
8988
|
}
|
|
8264
8989
|
};
|
|
@@ -8286,7 +9011,7 @@ var S3Migrator = class {
|
|
|
8286
9011
|
this.migrationRecords = JSON.parse(bodyContents);
|
|
8287
9012
|
} catch (jsonError) {
|
|
8288
9013
|
console.error(
|
|
8289
|
-
|
|
9014
|
+
import_picocolors3.default.red("Failed to parse migration records JSON:"),
|
|
8290
9015
|
jsonError
|
|
8291
9016
|
);
|
|
8292
9017
|
this.migrationRecords = [];
|
|
@@ -8344,7 +9069,7 @@ var S3Migrator = class {
|
|
|
8344
9069
|
continue;
|
|
8345
9070
|
}
|
|
8346
9071
|
console.log(
|
|
8347
|
-
|
|
9072
|
+
import_picocolors3.default.magenta(`Applying migration ${migration.name}...`)
|
|
8348
9073
|
);
|
|
8349
9074
|
migration.s3 = this.s3;
|
|
8350
9075
|
migration.bucketName = this.bucketName;
|
|
@@ -8357,21 +9082,21 @@ var S3Migrator = class {
|
|
|
8357
9082
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8358
9083
|
});
|
|
8359
9084
|
console.log(
|
|
8360
|
-
|
|
8361
|
-
`${
|
|
9085
|
+
import_picocolors3.default.green(
|
|
9086
|
+
`${import_picocolors3.default.bold(migration.name)} applied successfully.`
|
|
8362
9087
|
)
|
|
8363
9088
|
);
|
|
8364
9089
|
await migration.cleanupBackups();
|
|
8365
9090
|
} else {
|
|
8366
9091
|
console.log(
|
|
8367
|
-
|
|
8368
|
-
`[DRY RUN] ${
|
|
9092
|
+
import_picocolors3.default.yellow(
|
|
9093
|
+
`[DRY RUN] ${import_picocolors3.default.bold(migration.name)} applied successfully`
|
|
8369
9094
|
)
|
|
8370
9095
|
);
|
|
8371
9096
|
}
|
|
8372
9097
|
} catch (error) {
|
|
8373
9098
|
console.error(
|
|
8374
|
-
|
|
9099
|
+
import_picocolors3.default.red(
|
|
8375
9100
|
`Migration ${migration.name} failed. Initiating rollback...`
|
|
8376
9101
|
),
|
|
8377
9102
|
error
|
|
@@ -8382,7 +9107,7 @@ var S3Migrator = class {
|
|
|
8382
9107
|
}
|
|
8383
9108
|
await this.saveMigrationRecords(dryRun);
|
|
8384
9109
|
if (!dryRun) {
|
|
8385
|
-
console.log(
|
|
9110
|
+
console.log(import_picocolors3.default.blue("All migrations applied."));
|
|
8386
9111
|
}
|
|
8387
9112
|
}
|
|
8388
9113
|
};
|
|
@@ -8453,7 +9178,6 @@ var regionLocationMap = {
|
|
|
8453
9178
|
|
|
8454
9179
|
// iac/s3.ts
|
|
8455
9180
|
var import_client_s32 = require("@aws-sdk/client-s3");
|
|
8456
|
-
var p4 = __toESM(require("@clack/prompts"), 1);
|
|
8457
9181
|
var S3Manager = class {
|
|
8458
9182
|
credentials;
|
|
8459
9183
|
constructor(credentials) {
|
|
@@ -8485,7 +9209,7 @@ var S3Manager = class {
|
|
|
8485
9209
|
LocationConstraint: region
|
|
8486
9210
|
}
|
|
8487
9211
|
});
|
|
8488
|
-
|
|
9212
|
+
f2.info(`Created S3 bucket: ${bucketName}`);
|
|
8489
9213
|
}
|
|
8490
9214
|
async runMigrations({
|
|
8491
9215
|
bucketName,
|
|
@@ -8500,14 +9224,14 @@ var S3Manager = class {
|
|
|
8500
9224
|
const { pending } = await migrator.list();
|
|
8501
9225
|
await migrator.migrate({ dryRun: true });
|
|
8502
9226
|
if (pending.length > 0) {
|
|
8503
|
-
|
|
8504
|
-
for (const
|
|
8505
|
-
|
|
9227
|
+
f2.step("Pending migrations:");
|
|
9228
|
+
for (const m2 of pending) {
|
|
9229
|
+
f2.step(`- ${m2.name}`);
|
|
8506
9230
|
}
|
|
8507
9231
|
}
|
|
8508
|
-
const
|
|
8509
|
-
if (
|
|
8510
|
-
|
|
9232
|
+
const confirm = await ye({ message: "Do you want to continue?" });
|
|
9233
|
+
if (BD(confirm) || !confirm) {
|
|
9234
|
+
f2.info("Migration cancelled.");
|
|
8511
9235
|
process.exit(1);
|
|
8512
9236
|
}
|
|
8513
9237
|
await migrator.migrate({ dryRun: false });
|
|
@@ -8544,7 +9268,7 @@ var S3Manager = class {
|
|
|
8544
9268
|
Bucket: bucketName,
|
|
8545
9269
|
Policy: JSON.stringify(bucketPolicy)
|
|
8546
9270
|
});
|
|
8547
|
-
|
|
9271
|
+
f2.success(
|
|
8548
9272
|
"S3 bucket policy updated to allow access from CloudFront distribution"
|
|
8549
9273
|
);
|
|
8550
9274
|
}
|
|
@@ -8553,7 +9277,6 @@ var S3Manager = class {
|
|
|
8553
9277
|
// iac/ssm.ts
|
|
8554
9278
|
var import_crypto2 = __toESM(require("crypto"), 1);
|
|
8555
9279
|
var import_client_ssm = require("@aws-sdk/client-ssm");
|
|
8556
|
-
var p5 = __toESM(require("@clack/prompts"), 1);
|
|
8557
9280
|
var SSMKeyPairManager = class {
|
|
8558
9281
|
region;
|
|
8559
9282
|
credentials;
|
|
@@ -8589,7 +9312,7 @@ var SSMKeyPairManager = class {
|
|
|
8589
9312
|
const existing = await this.getParameter(parameterName);
|
|
8590
9313
|
if (existing) {
|
|
8591
9314
|
const keyPair2 = JSON.parse(existing);
|
|
8592
|
-
|
|
9315
|
+
f2.info("Using existing CloudFront key pair from SSM Parameter Store");
|
|
8593
9316
|
return keyPair2;
|
|
8594
9317
|
}
|
|
8595
9318
|
const { publicKey, privateKey } = import_crypto2.default.generateKeyPairSync("rsa", {
|
|
@@ -8600,7 +9323,7 @@ var SSMKeyPairManager = class {
|
|
|
8600
9323
|
const keyPairId = `HOTUPDATER-${import_crypto2.default.randomBytes(4).toString("hex").toUpperCase()}`;
|
|
8601
9324
|
const keyPair = { keyPairId, publicKey, privateKey };
|
|
8602
9325
|
await this.putParameter(parameterName, JSON.stringify(keyPair));
|
|
8603
|
-
|
|
9326
|
+
f2.success(
|
|
8604
9327
|
"Created and stored new CloudFront key pair in SSM Parameter Store"
|
|
8605
9328
|
);
|
|
8606
9329
|
return keyPair;
|
|
@@ -8678,13 +9401,13 @@ var checkIfAwsCliInstalled = async () => {
|
|
|
8678
9401
|
var runInit = async () => {
|
|
8679
9402
|
const isAwsCliInstalled = await checkIfAwsCliInstalled();
|
|
8680
9403
|
if (!isAwsCliInstalled) {
|
|
8681
|
-
|
|
9404
|
+
f2.error(
|
|
8682
9405
|
`AWS CLI is not installed. Please visit ${(0, import_plugin_core2.link)("https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")} for installation instructions`
|
|
8683
9406
|
);
|
|
8684
9407
|
process.exit(1);
|
|
8685
9408
|
}
|
|
8686
9409
|
let credentials = void 0;
|
|
8687
|
-
const mode = await
|
|
9410
|
+
const mode = await ve({
|
|
8688
9411
|
message: "Select the mode to login to AWS",
|
|
8689
9412
|
options: [
|
|
8690
9413
|
{
|
|
@@ -8694,31 +9417,31 @@ var runInit = async () => {
|
|
|
8694
9417
|
{ label: "AWS SSO Login", value: "sso" }
|
|
8695
9418
|
]
|
|
8696
9419
|
});
|
|
8697
|
-
if (
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
`${
|
|
9420
|
+
if (BD(mode)) process.exit(1);
|
|
9421
|
+
f2.message(import_picocolors4.default.blue("The following permissions are required:"));
|
|
9422
|
+
f2.message(
|
|
9423
|
+
`${import_picocolors4.default.blue("AmazonS3FullAccess")}: Create and read S3 buckets`
|
|
8701
9424
|
);
|
|
8702
|
-
|
|
8703
|
-
`${
|
|
9425
|
+
f2.message(
|
|
9426
|
+
`${import_picocolors4.default.blue("AWSLambda_FullAccess")}: Create and update Lambda functions`
|
|
8704
9427
|
);
|
|
8705
|
-
|
|
8706
|
-
`${
|
|
9428
|
+
f2.message(
|
|
9429
|
+
`${import_picocolors4.default.blue("CloudFrontFullAccess")}: Create and update CloudFront distributions`
|
|
8707
9430
|
);
|
|
8708
|
-
|
|
8709
|
-
`${
|
|
9431
|
+
f2.message(
|
|
9432
|
+
`${import_picocolors4.default.blue("IAMFullAccess")}: Get or create IAM roles for Lambda@Edge`
|
|
8710
9433
|
);
|
|
8711
|
-
|
|
8712
|
-
`${
|
|
9434
|
+
f2.message(
|
|
9435
|
+
`${import_picocolors4.default.blue("AmazonSSMFullAccess")}: Access to SSM Parameters for storing CloudFront key pairs`
|
|
8713
9436
|
);
|
|
8714
9437
|
if (mode === "sso") {
|
|
8715
9438
|
try {
|
|
8716
|
-
const profile = await
|
|
9439
|
+
const profile = await he({
|
|
8717
9440
|
message: "Enter the SSO profile name",
|
|
8718
9441
|
defaultValue: "default",
|
|
8719
9442
|
placeholder: "default"
|
|
8720
9443
|
});
|
|
8721
|
-
if (
|
|
9444
|
+
if (BD(profile)) process.exit(1);
|
|
8722
9445
|
await execa("aws", ["sso", "login", "--profile", profile], {
|
|
8723
9446
|
stdio: "inherit",
|
|
8724
9447
|
shell: true
|
|
@@ -8726,22 +9449,22 @@ var runInit = async () => {
|
|
|
8726
9449
|
credentials = await (0, import_credential_providers.fromSSO)({ profile })();
|
|
8727
9450
|
} catch (error) {
|
|
8728
9451
|
if (error instanceof ExecaError) {
|
|
8729
|
-
|
|
9452
|
+
f2.error(error.stdout || error.stderr || error.message);
|
|
8730
9453
|
}
|
|
8731
9454
|
process.exit(1);
|
|
8732
9455
|
}
|
|
8733
9456
|
} else {
|
|
8734
|
-
const creds = await
|
|
8735
|
-
accessKeyId: () =>
|
|
9457
|
+
const creds = await Ce({
|
|
9458
|
+
accessKeyId: () => he({
|
|
8736
9459
|
message: "Enter your AWS Access Key ID",
|
|
8737
9460
|
validate: (value) => value ? void 0 : "Access Key ID is required"
|
|
8738
9461
|
}),
|
|
8739
|
-
secretAccessKey: () =>
|
|
9462
|
+
secretAccessKey: () => ge({
|
|
8740
9463
|
message: "Enter your AWS Secret Access Key",
|
|
8741
9464
|
validate: (value) => value ? void 0 : "Secret Access Key is required"
|
|
8742
9465
|
})
|
|
8743
9466
|
});
|
|
8744
|
-
if (
|
|
9467
|
+
if (BD(creds)) process.exit(1);
|
|
8745
9468
|
credentials = {
|
|
8746
9469
|
accessKeyId: creds.accessKeyId,
|
|
8747
9470
|
secretAccessKey: creds.secretAccessKey
|
|
@@ -8750,7 +9473,7 @@ var runInit = async () => {
|
|
|
8750
9473
|
const s3Manager = new S3Manager(credentials);
|
|
8751
9474
|
let availableBuckets = [];
|
|
8752
9475
|
try {
|
|
8753
|
-
await
|
|
9476
|
+
await Te([
|
|
8754
9477
|
{
|
|
8755
9478
|
title: "Checking S3 Buckets...",
|
|
8756
9479
|
task: async () => {
|
|
@@ -8758,12 +9481,12 @@ var runInit = async () => {
|
|
|
8758
9481
|
}
|
|
8759
9482
|
}
|
|
8760
9483
|
]);
|
|
8761
|
-
} catch (
|
|
8762
|
-
if (
|
|
8763
|
-
throw
|
|
9484
|
+
} catch (e2) {
|
|
9485
|
+
if (e2 instanceof Error) f2.error(e2.message);
|
|
9486
|
+
throw e2;
|
|
8764
9487
|
}
|
|
8765
9488
|
const createKey = `create/${Math.random().toString(36).substring(2, 15)}`;
|
|
8766
|
-
let bucketName = await
|
|
9489
|
+
let bucketName = await ve({
|
|
8767
9490
|
message: "S3 Bucket List",
|
|
8768
9491
|
options: [
|
|
8769
9492
|
...availableBuckets.map((bucket) => ({
|
|
@@ -8773,38 +9496,38 @@ var runInit = async () => {
|
|
|
8773
9496
|
{ value: createKey, label: "Create New S3 Bucket" }
|
|
8774
9497
|
]
|
|
8775
9498
|
});
|
|
8776
|
-
if (
|
|
9499
|
+
if (BD(bucketName)) process.exit(1);
|
|
8777
9500
|
let bucketRegion = availableBuckets.find(
|
|
8778
9501
|
(bucket) => bucket.name === bucketName
|
|
8779
9502
|
)?.region;
|
|
8780
9503
|
if (bucketName === createKey) {
|
|
8781
|
-
const name = await
|
|
9504
|
+
const name = await he({
|
|
8782
9505
|
message: "Enter the name of the new S3 Bucket",
|
|
8783
9506
|
defaultValue: "hot-updater-storage",
|
|
8784
9507
|
placeholder: "hot-updater-storage"
|
|
8785
9508
|
});
|
|
8786
|
-
if (
|
|
9509
|
+
if (BD(name)) {
|
|
8787
9510
|
process.exit(1);
|
|
8788
9511
|
}
|
|
8789
9512
|
bucketName = name;
|
|
8790
|
-
const selectedRegion = await
|
|
9513
|
+
const selectedRegion = await ve({
|
|
8791
9514
|
message: "Enter AWS region for the S3 bucket",
|
|
8792
9515
|
options: Object.entries(regionLocationMap).map(([region, location]) => ({
|
|
8793
9516
|
label: `${region} (${location})`,
|
|
8794
9517
|
value: region
|
|
8795
9518
|
}))
|
|
8796
9519
|
});
|
|
8797
|
-
if (
|
|
9520
|
+
if (BD(selectedRegion)) {
|
|
8798
9521
|
process.exit(1);
|
|
8799
9522
|
}
|
|
8800
9523
|
bucketRegion = selectedRegion;
|
|
8801
9524
|
await s3Manager.createBucket(bucketName, bucketRegion);
|
|
8802
9525
|
}
|
|
8803
9526
|
if (!bucketRegion) {
|
|
8804
|
-
|
|
9527
|
+
f2.error("Failed to get S3 bucket region");
|
|
8805
9528
|
process.exit(1);
|
|
8806
9529
|
}
|
|
8807
|
-
|
|
9530
|
+
f2.info(`Selected S3 Bucket: ${bucketName} (${bucketRegion})`);
|
|
8808
9531
|
await s3Manager.runMigrations({
|
|
8809
9532
|
bucketName,
|
|
8810
9533
|
region: bucketRegion,
|
|
@@ -8857,14 +9580,14 @@ var runInit = async () => {
|
|
|
8857
9580
|
},
|
|
8858
9581
|
HOT_UPDATER_CLOUDFRONT_DISTRIBUTION_ID: distributionId
|
|
8859
9582
|
});
|
|
8860
|
-
|
|
8861
|
-
|
|
9583
|
+
f2.success("Generated '.env' file with AWS settings.");
|
|
9584
|
+
f2.success("Generated 'hot-updater.config.ts' file with AWS settings.");
|
|
8862
9585
|
const sourceUrl = `https://${distributionDomain}/api/check-update`;
|
|
8863
|
-
|
|
8864
|
-
|
|
9586
|
+
Me((0, import_plugin_core2.transformTemplate)(SOURCE_TEMPLATE, { source: sourceUrl }));
|
|
9587
|
+
f2.message(
|
|
8865
9588
|
`Next step: ${(0, import_plugin_core2.link)("https://gronxb.github.io/hot-updater/guide/providers/3_aws-s3-lambda-edge.html#step-4-changeenv-file-optional")}`
|
|
8866
9589
|
);
|
|
8867
|
-
|
|
9590
|
+
f2.success("Done! \u{1F389}");
|
|
8868
9591
|
};
|
|
8869
9592
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8870
9593
|
0 && (module.exports = {
|