@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.js
CHANGED
|
@@ -5,11 +5,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __require = /* @__PURE__ */ ((
|
|
9
|
-
get: (a2,
|
|
10
|
-
}) :
|
|
8
|
+
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
9
|
+
get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
|
|
10
|
+
}) : x2)(function(x2) {
|
|
11
11
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' +
|
|
12
|
+
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
13
13
|
});
|
|
14
14
|
var __commonJS = (cb, mod) => function __require2() {
|
|
15
15
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -31,6 +31,135 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
mod
|
|
32
32
|
));
|
|
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"(exports, module) {
|
|
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
|
+
module.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"(exports, module) {
|
|
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
|
+
module.exports = createColors();
|
|
159
|
+
module.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"(exports, module) {
|
|
@@ -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,83 +661,682 @@ 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"(exports, module) {
|
|
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
|
-
module.exports = createColors();
|
|
604
|
-
module.exports.createColors = createColors;
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
|
|
608
664
|
// iac/index.ts
|
|
609
665
|
import fs2 from "fs";
|
|
610
666
|
import { fromSSO } from "@aws-sdk/credential-providers";
|
|
611
|
-
|
|
667
|
+
|
|
668
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
669
|
+
import { stripVTControlCharacters as S2 } from "node:util";
|
|
670
|
+
|
|
671
|
+
// ../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
672
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
673
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
674
|
+
import { stdin as $, stdout as j } from "node:process";
|
|
675
|
+
import * as f from "node:readline";
|
|
676
|
+
import M from "node:readline";
|
|
677
|
+
import { WriteStream as U } from "node:tty";
|
|
678
|
+
function J({ onlyFirst: t = false } = {}) {
|
|
679
|
+
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("|");
|
|
680
|
+
return new RegExp(F2, t ? void 0 : "g");
|
|
681
|
+
}
|
|
682
|
+
var Q = J();
|
|
683
|
+
function T(t) {
|
|
684
|
+
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
685
|
+
return t.replace(Q, "");
|
|
686
|
+
}
|
|
687
|
+
function O(t) {
|
|
688
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
689
|
+
}
|
|
690
|
+
var P = { exports: {} };
|
|
691
|
+
(function(t) {
|
|
692
|
+
var u3 = {};
|
|
693
|
+
t.exports = u3, u3.eastAsianWidth = function(e2) {
|
|
694
|
+
var s = e2.charCodeAt(0), i2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s;
|
|
695
|
+
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";
|
|
696
|
+
}, u3.characterLength = function(e2) {
|
|
697
|
+
var s = this.eastAsianWidth(e2);
|
|
698
|
+
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
699
|
+
};
|
|
700
|
+
function F2(e2) {
|
|
701
|
+
return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
702
|
+
}
|
|
703
|
+
u3.length = function(e2) {
|
|
704
|
+
for (var s = F2(e2), i2 = 0, D2 = 0; D2 < s.length; D2++) i2 = i2 + this.characterLength(s[D2]);
|
|
705
|
+
return i2;
|
|
706
|
+
}, u3.slice = function(e2, s, i2) {
|
|
707
|
+
textLen = u3.length(e2), s = s || 0, i2 = i2 || 1, s < 0 && (s = textLen + s), i2 < 0 && (i2 = textLen + i2);
|
|
708
|
+
for (var D2 = "", C2 = 0, o3 = F2(e2), E = 0; E < o3.length; E++) {
|
|
709
|
+
var a2 = o3[E], n2 = u3.length(a2);
|
|
710
|
+
if (C2 >= s - (n2 == 2 ? 1 : 0)) if (C2 + n2 <= i2) D2 += a2;
|
|
711
|
+
else break;
|
|
712
|
+
C2 += n2;
|
|
713
|
+
}
|
|
714
|
+
return D2;
|
|
715
|
+
};
|
|
716
|
+
})(P);
|
|
717
|
+
var X = P.exports;
|
|
718
|
+
var DD = O(X);
|
|
719
|
+
var uD = function() {
|
|
720
|
+
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;
|
|
721
|
+
};
|
|
722
|
+
var FD = O(uD);
|
|
723
|
+
function A(t, u3 = {}) {
|
|
724
|
+
if (typeof t != "string" || t.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t = T(t), t.length === 0)) return 0;
|
|
725
|
+
t = t.replace(FD(), " ");
|
|
726
|
+
const F2 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
727
|
+
let e2 = 0;
|
|
728
|
+
for (const s of t) {
|
|
729
|
+
const i2 = s.codePointAt(0);
|
|
730
|
+
if (i2 <= 31 || i2 >= 127 && i2 <= 159 || i2 >= 768 && i2 <= 879) continue;
|
|
731
|
+
switch (DD.eastAsianWidth(s)) {
|
|
732
|
+
case "F":
|
|
733
|
+
case "W":
|
|
734
|
+
e2 += 2;
|
|
735
|
+
break;
|
|
736
|
+
case "A":
|
|
737
|
+
e2 += F2;
|
|
738
|
+
break;
|
|
739
|
+
default:
|
|
740
|
+
e2 += 1;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
return e2;
|
|
744
|
+
}
|
|
745
|
+
var m = 10;
|
|
746
|
+
var L = (t = 0) => (u3) => `\x1B[${u3 + t}m`;
|
|
747
|
+
var N = (t = 0) => (u3) => `\x1B[${38 + t};5;${u3}m`;
|
|
748
|
+
var I = (t = 0) => (u3, F2, e2) => `\x1B[${38 + t};2;${u3};${F2};${e2}m`;
|
|
749
|
+
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] } };
|
|
750
|
+
Object.keys(r.modifier);
|
|
751
|
+
var tD = Object.keys(r.color);
|
|
752
|
+
var eD = Object.keys(r.bgColor);
|
|
753
|
+
[...tD, ...eD];
|
|
754
|
+
function sD() {
|
|
755
|
+
const t = /* @__PURE__ */ new Map();
|
|
756
|
+
for (const [u3, F2] of Object.entries(r)) {
|
|
757
|
+
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]);
|
|
758
|
+
Object.defineProperty(r, u3, { value: F2, enumerable: false });
|
|
759
|
+
}
|
|
760
|
+
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) => {
|
|
761
|
+
const F2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
762
|
+
if (!F2) return [0, 0, 0];
|
|
763
|
+
let [e2] = F2;
|
|
764
|
+
e2.length === 3 && (e2 = [...e2].map((i2) => i2 + i2).join(""));
|
|
765
|
+
const s = Number.parseInt(e2, 16);
|
|
766
|
+
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
767
|
+
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
768
|
+
if (u3 < 8) return 30 + u3;
|
|
769
|
+
if (u3 < 16) return 90 + (u3 - 8);
|
|
770
|
+
let F2, e2, s;
|
|
771
|
+
if (u3 >= 232) F2 = ((u3 - 232) * 10 + 8) / 255, e2 = F2, s = F2;
|
|
772
|
+
else {
|
|
773
|
+
u3 -= 16;
|
|
774
|
+
const C2 = u3 % 36;
|
|
775
|
+
F2 = Math.floor(u3 / 36) / 5, e2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
|
|
776
|
+
}
|
|
777
|
+
const i2 = Math.max(F2, e2, s) * 2;
|
|
778
|
+
if (i2 === 0) return 30;
|
|
779
|
+
let D2 = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F2));
|
|
780
|
+
return i2 === 2 && (D2 += 60), D2;
|
|
781
|
+
}, 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;
|
|
782
|
+
}
|
|
783
|
+
var iD = sD();
|
|
784
|
+
var v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
785
|
+
var CD = 39;
|
|
786
|
+
var w = "\x07";
|
|
787
|
+
var W = "[";
|
|
788
|
+
var rD = "]";
|
|
789
|
+
var R = "m";
|
|
790
|
+
var y = `${rD}8;;`;
|
|
791
|
+
var V = (t) => `${v.values().next().value}${W}${t}${R}`;
|
|
792
|
+
var z = (t) => `${v.values().next().value}${y}${t}${w}`;
|
|
793
|
+
var ED = (t) => t.split(" ").map((u3) => A(u3));
|
|
794
|
+
var _ = (t, u3, F2) => {
|
|
795
|
+
const e2 = [...u3];
|
|
796
|
+
let s = false, i2 = false, D2 = A(T(t[t.length - 1]));
|
|
797
|
+
for (const [C2, o3] of e2.entries()) {
|
|
798
|
+
const E = A(o3);
|
|
799
|
+
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) {
|
|
800
|
+
i2 ? o3 === w && (s = false, i2 = false) : o3 === R && (s = false);
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
D2 += E, D2 === F2 && C2 < e2.length - 1 && (t.push(""), D2 = 0);
|
|
804
|
+
}
|
|
805
|
+
!D2 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
806
|
+
};
|
|
807
|
+
var nD = (t) => {
|
|
808
|
+
const u3 = t.split(" ");
|
|
809
|
+
let F2 = u3.length;
|
|
810
|
+
for (; F2 > 0 && !(A(u3[F2 - 1]) > 0); ) F2--;
|
|
811
|
+
return F2 === u3.length ? t : u3.slice(0, F2).join(" ") + u3.slice(F2).join("");
|
|
812
|
+
};
|
|
813
|
+
var oD = (t, u3, F2 = {}) => {
|
|
814
|
+
if (F2.trim !== false && t.trim() === "") return "";
|
|
815
|
+
let e2 = "", s, i2;
|
|
816
|
+
const D2 = ED(t);
|
|
817
|
+
let C2 = [""];
|
|
818
|
+
for (const [E, a2] of t.split(" ").entries()) {
|
|
819
|
+
F2.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
|
|
820
|
+
let n2 = A(C2[C2.length - 1]);
|
|
821
|
+
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) {
|
|
822
|
+
const B2 = u3 - n2, p = 1 + Math.floor((D2[E] - B2 - 1) / u3);
|
|
823
|
+
Math.floor((D2[E] - 1) / u3) < p && C2.push(""), _(C2, a2, u3);
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
if (n2 + D2[E] > u3 && n2 > 0 && D2[E] > 0) {
|
|
827
|
+
if (F2.wordWrap === false && n2 < u3) {
|
|
828
|
+
_(C2, a2, u3);
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
831
|
+
C2.push("");
|
|
832
|
+
}
|
|
833
|
+
if (n2 + D2[E] > u3 && F2.wordWrap === false) {
|
|
834
|
+
_(C2, a2, u3);
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
C2[C2.length - 1] += a2;
|
|
838
|
+
}
|
|
839
|
+
F2.trim !== false && (C2 = C2.map((E) => nD(E)));
|
|
840
|
+
const o3 = [...C2.join(`
|
|
841
|
+
`)];
|
|
842
|
+
for (const [E, a2] of o3.entries()) {
|
|
843
|
+
if (e2 += a2, v.has(a2)) {
|
|
844
|
+
const { groups: B2 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y}(?<uri>.*)${w})`).exec(o3.slice(E).join("")) || { groups: {} };
|
|
845
|
+
if (B2.code !== void 0) {
|
|
846
|
+
const p = Number.parseFloat(B2.code);
|
|
847
|
+
s = p === CD ? void 0 : p;
|
|
848
|
+
} else B2.uri !== void 0 && (i2 = B2.uri.length === 0 ? void 0 : B2.uri);
|
|
849
|
+
}
|
|
850
|
+
const n2 = iD.codes.get(Number(s));
|
|
851
|
+
o3[E + 1] === `
|
|
852
|
+
` ? (i2 && (e2 += z("")), s && n2 && (e2 += V(n2))) : a2 === `
|
|
853
|
+
` && (s && n2 && (e2 += V(s)), i2 && (e2 += z(i2)));
|
|
854
|
+
}
|
|
855
|
+
return e2;
|
|
856
|
+
};
|
|
857
|
+
function G(t, u3, F2) {
|
|
858
|
+
return String(t).normalize().replace(/\r\n/g, `
|
|
859
|
+
`).split(`
|
|
860
|
+
`).map((e2) => oD(e2, u3, F2)).join(`
|
|
861
|
+
`);
|
|
862
|
+
}
|
|
863
|
+
var aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
864
|
+
var c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
865
|
+
function k(t, u3) {
|
|
866
|
+
if (typeof t == "string") return c.aliases.get(t) === u3;
|
|
867
|
+
for (const F2 of t) if (F2 !== void 0 && k(F2, u3)) return true;
|
|
868
|
+
return false;
|
|
869
|
+
}
|
|
870
|
+
function lD(t, u3) {
|
|
871
|
+
if (t === u3) return;
|
|
872
|
+
const F2 = t.split(`
|
|
873
|
+
`), e2 = u3.split(`
|
|
874
|
+
`), s = [];
|
|
875
|
+
for (let i2 = 0; i2 < Math.max(F2.length, e2.length); i2++) F2[i2] !== e2[i2] && s.push(i2);
|
|
876
|
+
return s;
|
|
877
|
+
}
|
|
878
|
+
var xD = globalThis.process.platform.startsWith("win");
|
|
879
|
+
var S = Symbol("clack:cancel");
|
|
880
|
+
function BD(t) {
|
|
881
|
+
return t === S;
|
|
882
|
+
}
|
|
883
|
+
function d(t, u3) {
|
|
884
|
+
const F2 = t;
|
|
885
|
+
F2.isTTY && F2.setRawMode(u3);
|
|
886
|
+
}
|
|
887
|
+
function cD({ input: t = $, output: u3 = j, overwrite: F2 = true, hideCursor: e2 = true } = {}) {
|
|
888
|
+
const s = f.createInterface({ input: t, output: u3, prompt: "", tabSize: 1 });
|
|
889
|
+
f.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(true);
|
|
890
|
+
const i2 = (D2, { name: C2, sequence: o3 }) => {
|
|
891
|
+
const E = String(D2);
|
|
892
|
+
if (k([E, C2, o3], "cancel")) {
|
|
893
|
+
e2 && u3.write(import_sisteransi.cursor.show), process.exit(0);
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
if (!F2) return;
|
|
897
|
+
const a2 = C2 === "return" ? 0 : -1, n2 = C2 === "return" ? -1 : 0;
|
|
898
|
+
f.moveCursor(u3, a2, n2, () => {
|
|
899
|
+
f.clearLine(u3, 1, () => {
|
|
900
|
+
t.once("keypress", i2);
|
|
901
|
+
});
|
|
902
|
+
});
|
|
903
|
+
};
|
|
904
|
+
return e2 && u3.write(import_sisteransi.cursor.hide), t.once("keypress", i2), () => {
|
|
905
|
+
t.off("keypress", i2), e2 && u3.write(import_sisteransi.cursor.show), t.isTTY && !xD && t.setRawMode(false), s.terminal = false, s.close();
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
var AD = Object.defineProperty;
|
|
909
|
+
var pD = (t, u3, F2) => u3 in t ? AD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
910
|
+
var h = (t, u3, F2) => (pD(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
911
|
+
var x = class {
|
|
912
|
+
constructor(u3, F2 = true) {
|
|
913
|
+
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");
|
|
914
|
+
const { input: e2 = $, output: s = j, render: i2, signal: D2, ...C2 } = u3;
|
|
915
|
+
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;
|
|
916
|
+
}
|
|
917
|
+
unsubscribe() {
|
|
918
|
+
this._subscribers.clear();
|
|
919
|
+
}
|
|
920
|
+
setSubscriber(u3, F2) {
|
|
921
|
+
const e2 = this._subscribers.get(u3) ?? [];
|
|
922
|
+
e2.push(F2), this._subscribers.set(u3, e2);
|
|
923
|
+
}
|
|
924
|
+
on(u3, F2) {
|
|
925
|
+
this.setSubscriber(u3, { cb: F2 });
|
|
926
|
+
}
|
|
927
|
+
once(u3, F2) {
|
|
928
|
+
this.setSubscriber(u3, { cb: F2, once: true });
|
|
929
|
+
}
|
|
930
|
+
emit(u3, ...F2) {
|
|
931
|
+
const e2 = this._subscribers.get(u3) ?? [], s = [];
|
|
932
|
+
for (const i2 of e2) i2.cb(...F2), i2.once && s.push(() => e2.splice(e2.indexOf(i2), 1));
|
|
933
|
+
for (const i2 of s) i2();
|
|
934
|
+
}
|
|
935
|
+
prompt() {
|
|
936
|
+
return new Promise((u3, F2) => {
|
|
937
|
+
if (this._abortSignal) {
|
|
938
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u3(S);
|
|
939
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
940
|
+
this.state = "cancel", this.close();
|
|
941
|
+
}, { once: true });
|
|
942
|
+
}
|
|
943
|
+
const e2 = new U(0);
|
|
944
|
+
e2._write = (s, i2, D2) => {
|
|
945
|
+
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
|
|
946
|
+
}, this.input.pipe(e2), this.rl = M.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), M.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", () => {
|
|
947
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u3(this.value);
|
|
948
|
+
}), this.once("cancel", () => {
|
|
949
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u3(S);
|
|
950
|
+
});
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
onKeypress(u3, F2) {
|
|
954
|
+
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") {
|
|
955
|
+
if (this.opts.validate) {
|
|
956
|
+
const e2 = this.opts.validate(this.value);
|
|
957
|
+
e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.value));
|
|
958
|
+
}
|
|
959
|
+
this.state !== "error" && (this.state = "submit");
|
|
960
|
+
}
|
|
961
|
+
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();
|
|
962
|
+
}
|
|
963
|
+
close() {
|
|
964
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
965
|
+
`), d(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
966
|
+
}
|
|
967
|
+
restoreCursor() {
|
|
968
|
+
const u3 = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
969
|
+
`).length - 1;
|
|
970
|
+
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
971
|
+
}
|
|
972
|
+
render() {
|
|
973
|
+
const u3 = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
974
|
+
if (u3 !== this._prevFrame) {
|
|
975
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
976
|
+
else {
|
|
977
|
+
const F2 = lD(this._prevFrame, u3);
|
|
978
|
+
if (this.restoreCursor(), F2 && F2?.length === 1) {
|
|
979
|
+
const e2 = F2[0];
|
|
980
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
981
|
+
const s = u3.split(`
|
|
982
|
+
`);
|
|
983
|
+
this.output.write(s[e2]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s.length - e2 - 1));
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (F2 && F2?.length > 1) {
|
|
987
|
+
const e2 = F2[0];
|
|
988
|
+
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
|
|
989
|
+
const s = u3.split(`
|
|
990
|
+
`).slice(e2);
|
|
991
|
+
this.output.write(s.join(`
|
|
992
|
+
`)), this._prevFrame = u3;
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
this.output.write(import_sisteransi.erase.down());
|
|
996
|
+
}
|
|
997
|
+
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
var fD = class extends x {
|
|
1002
|
+
get cursor() {
|
|
1003
|
+
return this.value ? 0 : 1;
|
|
1004
|
+
}
|
|
1005
|
+
get _value() {
|
|
1006
|
+
return this.cursor === 0;
|
|
1007
|
+
}
|
|
1008
|
+
constructor(u3) {
|
|
1009
|
+
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
1010
|
+
this.value = this._value;
|
|
1011
|
+
}), this.on("confirm", (F2) => {
|
|
1012
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F2, this.state = "submit", this.close();
|
|
1013
|
+
}), this.on("cursor", () => {
|
|
1014
|
+
this.value = !this.value;
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
var yD = Object.defineProperty;
|
|
1019
|
+
var _D = (t, u3, F2) => u3 in t ? yD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
1020
|
+
var Z = (t, u3, F2) => (_D(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
1021
|
+
var kD = class extends x {
|
|
1022
|
+
constructor({ mask: u3, ...F2 }) {
|
|
1023
|
+
super(F2), Z(this, "valueWithCursor", ""), Z(this, "_mask", "\u2022"), this._mask = u3 ?? "\u2022", this.on("finalize", () => {
|
|
1024
|
+
this.valueWithCursor = this.masked;
|
|
1025
|
+
}), this.on("value", () => {
|
|
1026
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
1027
|
+
else {
|
|
1028
|
+
const e2 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
1029
|
+
this.valueWithCursor = `${e2}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
get cursor() {
|
|
1034
|
+
return this._cursor;
|
|
1035
|
+
}
|
|
1036
|
+
get masked() {
|
|
1037
|
+
return this.value.replaceAll(/./g, this._mask);
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
var SD = Object.defineProperty;
|
|
1041
|
+
var $D = (t, u3, F2) => u3 in t ? SD(t, u3, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u3] = F2;
|
|
1042
|
+
var q = (t, u3, F2) => ($D(t, typeof u3 != "symbol" ? u3 + "" : u3, F2), F2);
|
|
1043
|
+
var jD = class extends x {
|
|
1044
|
+
constructor(u3) {
|
|
1045
|
+
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) => {
|
|
1046
|
+
switch (F2) {
|
|
1047
|
+
case "left":
|
|
1048
|
+
case "up":
|
|
1049
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1050
|
+
break;
|
|
1051
|
+
case "down":
|
|
1052
|
+
case "right":
|
|
1053
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1054
|
+
break;
|
|
1055
|
+
}
|
|
1056
|
+
this.changeValue();
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
get _value() {
|
|
1060
|
+
return this.options[this.cursor];
|
|
1061
|
+
}
|
|
1062
|
+
changeValue() {
|
|
1063
|
+
this.value = this._value.value;
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
var PD = class extends x {
|
|
1067
|
+
get valueWithCursor() {
|
|
1068
|
+
if (this.state === "submit") return this.value;
|
|
1069
|
+
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
1070
|
+
const u3 = this.value.slice(0, this.cursor), [F2, ...e2] = this.value.slice(this.cursor);
|
|
1071
|
+
return `${u3}${import_picocolors.default.inverse(F2)}${e2.join("")}`;
|
|
1072
|
+
}
|
|
1073
|
+
get cursor() {
|
|
1074
|
+
return this._cursor;
|
|
1075
|
+
}
|
|
1076
|
+
constructor(u3) {
|
|
1077
|
+
super(u3), this.on("finalize", () => {
|
|
1078
|
+
this.value || (this.value = u3.defaultValue);
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
// ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1084
|
+
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
1085
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1086
|
+
import g2 from "node:process";
|
|
1087
|
+
function ce() {
|
|
1088
|
+
return g2.platform !== "win32" ? g2.env.TERM !== "linux" : !!g2.env.CI || !!g2.env.WT_SESSION || !!g2.env.TERMINUS_SUBLIME || g2.env.ConEmuTask === "{cmd::Cmder}" || g2.env.TERM_PROGRAM === "Terminus-Sublime" || g2.env.TERM_PROGRAM === "vscode" || g2.env.TERM === "xterm-256color" || g2.env.TERM === "alacritty" || g2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1089
|
+
}
|
|
1090
|
+
var V2 = ce();
|
|
1091
|
+
var u = (t, n2) => V2 ? t : n2;
|
|
1092
|
+
var le = u("\u25C6", "*");
|
|
1093
|
+
var L2 = u("\u25A0", "x");
|
|
1094
|
+
var W2 = u("\u25B2", "x");
|
|
1095
|
+
var C = u("\u25C7", "o");
|
|
1096
|
+
var ue = u("\u250C", "T");
|
|
1097
|
+
var o = u("\u2502", "|");
|
|
1098
|
+
var d2 = u("\u2514", "\u2014");
|
|
1099
|
+
var k2 = u("\u25CF", ">");
|
|
1100
|
+
var P2 = u("\u25CB", " ");
|
|
1101
|
+
var A2 = u("\u25FB", "[\u2022]");
|
|
1102
|
+
var T2 = u("\u25FC", "[+]");
|
|
1103
|
+
var F = u("\u25FB", "[ ]");
|
|
1104
|
+
var $e = u("\u25AA", "\u2022");
|
|
1105
|
+
var _2 = u("\u2500", "-");
|
|
1106
|
+
var me = u("\u256E", "+");
|
|
1107
|
+
var de = u("\u251C", "+");
|
|
1108
|
+
var pe = u("\u256F", "+");
|
|
1109
|
+
var q2 = u("\u25CF", "\u2022");
|
|
1110
|
+
var D = u("\u25C6", "*");
|
|
1111
|
+
var U2 = u("\u25B2", "!");
|
|
1112
|
+
var K = u("\u25A0", "x");
|
|
1113
|
+
var w2 = (t) => {
|
|
1114
|
+
switch (t) {
|
|
1115
|
+
case "initial":
|
|
1116
|
+
case "active":
|
|
1117
|
+
return import_picocolors2.default.cyan(le);
|
|
1118
|
+
case "cancel":
|
|
1119
|
+
return import_picocolors2.default.red(L2);
|
|
1120
|
+
case "error":
|
|
1121
|
+
return import_picocolors2.default.yellow(W2);
|
|
1122
|
+
case "submit":
|
|
1123
|
+
return import_picocolors2.default.green(C);
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
var B = (t) => {
|
|
1127
|
+
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));
|
|
1128
|
+
let l2 = 0;
|
|
1129
|
+
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));
|
|
1130
|
+
const $3 = c4 < s.length && l2 > 0, p = c4 < s.length && l2 + c4 < s.length;
|
|
1131
|
+
return s.slice(l2, l2 + c4).map((M2, v2, x2) => {
|
|
1132
|
+
const j2 = v2 === 0 && $3, E = v2 === x2.length - 1 && p;
|
|
1133
|
+
return j2 || E ? import_picocolors2.default.dim("...") : r2(M2, v2 + l2 === n2);
|
|
1134
|
+
});
|
|
1135
|
+
};
|
|
1136
|
+
var he = (t) => new PD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
1137
|
+
const n2 = `${import_picocolors2.default.gray(o)}
|
|
1138
|
+
${w2(this.state)} ${t.message}
|
|
1139
|
+
`, 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;
|
|
1140
|
+
switch (this.state) {
|
|
1141
|
+
case "error":
|
|
1142
|
+
return `${n2.trim()}
|
|
1143
|
+
${import_picocolors2.default.yellow(o)} ${r2}
|
|
1144
|
+
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1145
|
+
`;
|
|
1146
|
+
case "submit":
|
|
1147
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
|
|
1148
|
+
case "cancel":
|
|
1149
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
1150
|
+
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1151
|
+
default:
|
|
1152
|
+
return `${n2}${import_picocolors2.default.cyan(o)} ${r2}
|
|
1153
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1154
|
+
`;
|
|
1155
|
+
}
|
|
1156
|
+
} }).prompt();
|
|
1157
|
+
var ge = (t) => new kD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
1158
|
+
const n2 = `${import_picocolors2.default.gray(o)}
|
|
1159
|
+
${w2(this.state)} ${t.message}
|
|
1160
|
+
`, s = this.valueWithCursor, r2 = this.masked;
|
|
1161
|
+
switch (this.state) {
|
|
1162
|
+
case "error":
|
|
1163
|
+
return `${n2.trim()}
|
|
1164
|
+
${import_picocolors2.default.yellow(o)} ${r2}
|
|
1165
|
+
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1166
|
+
`;
|
|
1167
|
+
case "submit":
|
|
1168
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(r2)}`;
|
|
1169
|
+
case "cancel":
|
|
1170
|
+
return `${n2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2 ?? ""))}${r2 ? `
|
|
1171
|
+
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1172
|
+
default:
|
|
1173
|
+
return `${n2}${import_picocolors2.default.cyan(o)} ${s}
|
|
1174
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1175
|
+
`;
|
|
1176
|
+
}
|
|
1177
|
+
} }).prompt();
|
|
1178
|
+
var ye = (t) => {
|
|
1179
|
+
const n2 = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
1180
|
+
return new fD({ active: n2, inactive: s, initialValue: t.initialValue ?? true, render() {
|
|
1181
|
+
const r2 = `${import_picocolors2.default.gray(o)}
|
|
1182
|
+
${w2(this.state)} ${t.message}
|
|
1183
|
+
`, i2 = this.value ? n2 : s;
|
|
1184
|
+
switch (this.state) {
|
|
1185
|
+
case "submit":
|
|
1186
|
+
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i2)}`;
|
|
1187
|
+
case "cancel":
|
|
1188
|
+
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i2))}
|
|
1189
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1190
|
+
default:
|
|
1191
|
+
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}`}
|
|
1192
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1193
|
+
`;
|
|
1194
|
+
}
|
|
1195
|
+
} }).prompt();
|
|
1196
|
+
};
|
|
1197
|
+
var ve = (t) => {
|
|
1198
|
+
const n2 = (s, r2) => {
|
|
1199
|
+
const i2 = s.label ?? String(s.value);
|
|
1200
|
+
switch (r2) {
|
|
1201
|
+
case "selected":
|
|
1202
|
+
return `${import_picocolors2.default.dim(i2)}`;
|
|
1203
|
+
case "active":
|
|
1204
|
+
return `${import_picocolors2.default.green(k2)} ${i2} ${s.hint ? import_picocolors2.default.dim(`(${s.hint})`) : ""}`;
|
|
1205
|
+
case "cancelled":
|
|
1206
|
+
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i2))}`;
|
|
1207
|
+
default:
|
|
1208
|
+
return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(i2)}`;
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
return new jD({ options: t.options, initialValue: t.initialValue, render() {
|
|
1212
|
+
const s = `${import_picocolors2.default.gray(o)}
|
|
1213
|
+
${w2(this.state)} ${t.message}
|
|
1214
|
+
`;
|
|
1215
|
+
switch (this.state) {
|
|
1216
|
+
case "submit":
|
|
1217
|
+
return `${s}${import_picocolors2.default.gray(o)} ${n2(this.options[this.cursor], "selected")}`;
|
|
1218
|
+
case "cancel":
|
|
1219
|
+
return `${s}${import_picocolors2.default.gray(o)} ${n2(this.options[this.cursor], "cancelled")}
|
|
1220
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1221
|
+
default:
|
|
1222
|
+
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(`
|
|
1223
|
+
${import_picocolors2.default.cyan(o)} `)}
|
|
1224
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1225
|
+
`;
|
|
1226
|
+
}
|
|
1227
|
+
} }).prompt();
|
|
1228
|
+
};
|
|
1229
|
+
var Me = (t = "", n2 = "") => {
|
|
1230
|
+
const s = `
|
|
1231
|
+
${t}
|
|
1232
|
+
`.split(`
|
|
1233
|
+
`), r2 = S2(n2).length, i2 = Math.max(s.reduce((c4, l2) => {
|
|
1234
|
+
const $3 = S2(l2);
|
|
1235
|
+
return $3.length > c4 ? $3.length : c4;
|
|
1236
|
+
}, 0), r2) + 2, a2 = s.map((c4) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(c4)}${" ".repeat(i2 - S2(c4).length)}${import_picocolors2.default.gray(o)}`).join(`
|
|
1237
|
+
`);
|
|
1238
|
+
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1239
|
+
${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(_2.repeat(Math.max(i2 - r2 - 1, 1)) + me)}
|
|
1240
|
+
${a2}
|
|
1241
|
+
${import_picocolors2.default.gray(de + _2.repeat(i2 + 2) + pe)}
|
|
1242
|
+
`);
|
|
1243
|
+
};
|
|
1244
|
+
var f2 = { message: (t = "", { symbol: n2 = import_picocolors2.default.gray(o) } = {}) => {
|
|
1245
|
+
const s = [`${import_picocolors2.default.gray(o)}`];
|
|
1246
|
+
if (t) {
|
|
1247
|
+
const [r2, ...i2] = t.split(`
|
|
1248
|
+
`);
|
|
1249
|
+
s.push(`${n2} ${r2}`, ...i2.map((a2) => `${import_picocolors2.default.gray(o)} ${a2}`));
|
|
1250
|
+
}
|
|
1251
|
+
process.stdout.write(`${s.join(`
|
|
1252
|
+
`)}
|
|
1253
|
+
`);
|
|
1254
|
+
}, info: (t) => {
|
|
1255
|
+
f2.message(t, { symbol: import_picocolors2.default.blue(q2) });
|
|
1256
|
+
}, success: (t) => {
|
|
1257
|
+
f2.message(t, { symbol: import_picocolors2.default.green(D) });
|
|
1258
|
+
}, step: (t) => {
|
|
1259
|
+
f2.message(t, { symbol: import_picocolors2.default.green(C) });
|
|
1260
|
+
}, warn: (t) => {
|
|
1261
|
+
f2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
|
|
1262
|
+
}, warning: (t) => {
|
|
1263
|
+
f2.warn(t);
|
|
1264
|
+
}, error: (t) => {
|
|
1265
|
+
f2.message(t, { symbol: import_picocolors2.default.red(K) });
|
|
1266
|
+
} };
|
|
1267
|
+
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
1268
|
+
var Y = ({ indicator: t = "dots" } = {}) => {
|
|
1269
|
+
const n2 = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], s = V2 ? 80 : 120, r2 = process.env.CI === "true";
|
|
1270
|
+
let i2, a2, c4 = false, l2 = "", $3, p = performance.now();
|
|
1271
|
+
const M2 = (m2) => {
|
|
1272
|
+
const h3 = m2 > 1 ? "Something went wrong" : "Canceled";
|
|
1273
|
+
c4 && N2(h3, m2);
|
|
1274
|
+
}, v2 = () => M2(2), x2 = () => M2(1), j2 = () => {
|
|
1275
|
+
process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", x2), process.on("SIGTERM", x2), process.on("exit", M2);
|
|
1276
|
+
}, E = () => {
|
|
1277
|
+
process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", x2), process.removeListener("SIGTERM", x2), process.removeListener("exit", M2);
|
|
1278
|
+
}, O2 = () => {
|
|
1279
|
+
if ($3 === void 0) return;
|
|
1280
|
+
r2 && process.stdout.write(`
|
|
1281
|
+
`);
|
|
1282
|
+
const m2 = $3.split(`
|
|
1283
|
+
`);
|
|
1284
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
|
|
1285
|
+
}, R2 = (m2) => m2.replace(/\.+$/, ""), G2 = (m2) => {
|
|
1286
|
+
const h3 = (performance.now() - m2) / 1e3, y2 = Math.floor(h3 / 60), I2 = Math.floor(h3 % 60);
|
|
1287
|
+
return y2 > 0 ? `[${y2}m ${I2}s]` : `[${I2}s]`;
|
|
1288
|
+
}, H = (m2 = "") => {
|
|
1289
|
+
c4 = true, i2 = cD(), l2 = R2(m2), p = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1290
|
+
`);
|
|
1291
|
+
let h3 = 0, y2 = 0;
|
|
1292
|
+
j2(), a2 = setInterval(() => {
|
|
1293
|
+
if (r2 && l2 === $3) return;
|
|
1294
|
+
O2(), $3 = l2;
|
|
1295
|
+
const I2 = import_picocolors2.default.magenta(n2[h3]);
|
|
1296
|
+
if (r2) process.stdout.write(`${I2} ${l2}...`);
|
|
1297
|
+
else if (t === "timer") process.stdout.write(`${I2} ${l2} ${G2(p)}`);
|
|
1298
|
+
else {
|
|
1299
|
+
const z2 = ".".repeat(Math.floor(y2)).slice(0, 3);
|
|
1300
|
+
process.stdout.write(`${I2} ${l2}${z2}`);
|
|
1301
|
+
}
|
|
1302
|
+
h3 = h3 + 1 < n2.length ? h3 + 1 : 0, y2 = y2 < n2.length ? y2 + 0.125 : 0;
|
|
1303
|
+
}, s);
|
|
1304
|
+
}, N2 = (m2 = "", h3 = 0) => {
|
|
1305
|
+
c4 = false, clearInterval(a2), O2();
|
|
1306
|
+
const y2 = h3 === 0 ? import_picocolors2.default.green(C) : h3 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
|
|
1307
|
+
l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${y2} ${l2} ${G2(p)}
|
|
1308
|
+
`) : process.stdout.write(`${y2} ${l2}
|
|
1309
|
+
`), E(), i2();
|
|
1310
|
+
};
|
|
1311
|
+
return { start: H, stop: N2, message: (m2 = "") => {
|
|
1312
|
+
l2 = R2(m2 ?? l2);
|
|
1313
|
+
} };
|
|
1314
|
+
};
|
|
1315
|
+
var Ce = async (t, n2) => {
|
|
1316
|
+
const s = {}, r2 = Object.keys(t);
|
|
1317
|
+
for (const i2 of r2) {
|
|
1318
|
+
const a2 = t[i2], c4 = await a2({ results: s })?.catch((l2) => {
|
|
1319
|
+
throw l2;
|
|
1320
|
+
});
|
|
1321
|
+
if (typeof n2?.onCancel == "function" && BD(c4)) {
|
|
1322
|
+
s[i2] = "canceled", n2.onCancel({ results: s });
|
|
1323
|
+
continue;
|
|
1324
|
+
}
|
|
1325
|
+
s[i2] = c4;
|
|
1326
|
+
}
|
|
1327
|
+
return s;
|
|
1328
|
+
};
|
|
1329
|
+
var Te = async (t) => {
|
|
1330
|
+
for (const n2 of t) {
|
|
1331
|
+
if (n2.enabled === false) continue;
|
|
1332
|
+
const s = Y();
|
|
1333
|
+
s.start(n2.title);
|
|
1334
|
+
const r2 = await n2.task(s.message);
|
|
1335
|
+
s.stop(r2 || n2.title);
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
// iac/index.ts
|
|
612
1340
|
import { link, makeEnv, transformTemplate } from "@hot-updater/plugin-core";
|
|
613
1341
|
|
|
614
1342
|
// ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
@@ -2950,20 +3678,20 @@ var a = Object.getPrototypeOf(
|
|
|
2950
3678
|
}
|
|
2951
3679
|
).prototype
|
|
2952
3680
|
);
|
|
2953
|
-
var
|
|
3681
|
+
var c2 = class {
|
|
2954
3682
|
#t;
|
|
2955
3683
|
#n;
|
|
2956
3684
|
#r = false;
|
|
2957
3685
|
#e = void 0;
|
|
2958
|
-
constructor(
|
|
2959
|
-
this.#t =
|
|
3686
|
+
constructor(e2, t) {
|
|
3687
|
+
this.#t = e2, this.#n = t;
|
|
2960
3688
|
}
|
|
2961
3689
|
next() {
|
|
2962
|
-
const
|
|
2963
|
-
return this.#e = this.#e ? this.#e.then(
|
|
3690
|
+
const e2 = () => this.#s();
|
|
3691
|
+
return this.#e = this.#e ? this.#e.then(e2, e2) : e2(), this.#e;
|
|
2964
3692
|
}
|
|
2965
|
-
return(
|
|
2966
|
-
const t = () => this.#i(
|
|
3693
|
+
return(e2) {
|
|
3694
|
+
const t = () => this.#i(e2);
|
|
2967
3695
|
return this.#e ? this.#e.then(t, t) : t();
|
|
2968
3696
|
}
|
|
2969
3697
|
async #s() {
|
|
@@ -2972,30 +3700,30 @@ var c = class {
|
|
|
2972
3700
|
done: true,
|
|
2973
3701
|
value: void 0
|
|
2974
3702
|
};
|
|
2975
|
-
let
|
|
3703
|
+
let e2;
|
|
2976
3704
|
try {
|
|
2977
|
-
|
|
3705
|
+
e2 = await this.#t.read();
|
|
2978
3706
|
} catch (t) {
|
|
2979
3707
|
throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t;
|
|
2980
3708
|
}
|
|
2981
|
-
return
|
|
3709
|
+
return e2.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e2;
|
|
2982
3710
|
}
|
|
2983
|
-
async #i(
|
|
3711
|
+
async #i(e2) {
|
|
2984
3712
|
if (this.#r)
|
|
2985
3713
|
return {
|
|
2986
3714
|
done: true,
|
|
2987
|
-
value:
|
|
3715
|
+
value: e2
|
|
2988
3716
|
};
|
|
2989
3717
|
if (this.#r = true, !this.#n) {
|
|
2990
|
-
const t = this.#t.cancel(
|
|
3718
|
+
const t = this.#t.cancel(e2);
|
|
2991
3719
|
return this.#t.releaseLock(), await t, {
|
|
2992
3720
|
done: true,
|
|
2993
|
-
value:
|
|
3721
|
+
value: e2
|
|
2994
3722
|
};
|
|
2995
3723
|
}
|
|
2996
3724
|
return this.#t.releaseLock(), {
|
|
2997
3725
|
done: true,
|
|
2998
|
-
value:
|
|
3726
|
+
value: e2
|
|
2999
3727
|
};
|
|
3000
3728
|
}
|
|
3001
3729
|
};
|
|
@@ -3004,11 +3732,11 @@ function i() {
|
|
|
3004
3732
|
return this[n].next();
|
|
3005
3733
|
}
|
|
3006
3734
|
Object.defineProperty(i, "name", { value: "next" });
|
|
3007
|
-
function
|
|
3008
|
-
return this[n].return(
|
|
3735
|
+
function o2(r2) {
|
|
3736
|
+
return this[n].return(r2);
|
|
3009
3737
|
}
|
|
3010
|
-
Object.defineProperty(
|
|
3011
|
-
var
|
|
3738
|
+
Object.defineProperty(o2, "name", { value: "return" });
|
|
3739
|
+
var u2 = Object.create(a, {
|
|
3012
3740
|
next: {
|
|
3013
3741
|
enumerable: true,
|
|
3014
3742
|
configurable: true,
|
|
@@ -3019,14 +3747,14 @@ var u = Object.create(a, {
|
|
|
3019
3747
|
enumerable: true,
|
|
3020
3748
|
configurable: true,
|
|
3021
3749
|
writable: true,
|
|
3022
|
-
value:
|
|
3750
|
+
value: o2
|
|
3023
3751
|
}
|
|
3024
3752
|
});
|
|
3025
|
-
function
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
), s = Object.create(
|
|
3753
|
+
function h2({ preventCancel: r2 = false } = {}) {
|
|
3754
|
+
const e2 = this.getReader(), t = new c2(
|
|
3755
|
+
e2,
|
|
3756
|
+
r2
|
|
3757
|
+
), s = Object.create(u2);
|
|
3030
3758
|
return s[n] = t, s;
|
|
3031
3759
|
}
|
|
3032
3760
|
|
|
@@ -3039,7 +3767,7 @@ var getAsyncIterable = (stream) => {
|
|
|
3039
3767
|
return stream;
|
|
3040
3768
|
}
|
|
3041
3769
|
if (toString.call(stream) === "[object ReadableStream]") {
|
|
3042
|
-
return
|
|
3770
|
+
return h2.call(stream);
|
|
3043
3771
|
}
|
|
3044
3772
|
throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
3045
3773
|
};
|
|
@@ -4136,7 +4864,7 @@ var getStdioArray = (stdio, options) => {
|
|
|
4136
4864
|
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
4137
4865
|
}
|
|
4138
4866
|
const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);
|
|
4139
|
-
return Array.from({ length }, (
|
|
4867
|
+
return Array.from({ length }, (_3, fdNumber) => stdio[fdNumber]);
|
|
4140
4868
|
};
|
|
4141
4869
|
var hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0);
|
|
4142
4870
|
var addDefaultValue2 = (stdioOption, fdNumber) => {
|
|
@@ -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;
|
|
@@ -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,14 +8115,13 @@ 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
|
import crypto from "crypto";
|
|
7394
8122
|
import {
|
|
7395
8123
|
CloudFront
|
|
7396
8124
|
} from "@aws-sdk/client-cloudfront";
|
|
7397
|
-
import * as p from "@clack/prompts";
|
|
7398
8125
|
|
|
7399
8126
|
// ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/error/AbortError.mjs
|
|
7400
8127
|
var AbortError = class extends Error {
|
|
@@ -7530,7 +8257,7 @@ var CloudFrontManager = class {
|
|
|
7530
8257
|
if (!keyGroupId) {
|
|
7531
8258
|
throw new Error("Failed to create Key Group");
|
|
7532
8259
|
}
|
|
7533
|
-
|
|
8260
|
+
f2.success(`Created new Key Group: ${keyGroupConfig.Name}`);
|
|
7534
8261
|
return { publicKeyId, keyGroupId };
|
|
7535
8262
|
}
|
|
7536
8263
|
async createOrUpdateDistribution(options) {
|
|
@@ -7586,14 +8313,14 @@ var CloudFrontManager = class {
|
|
|
7586
8313
|
if (matchingDistributions.length === 1) {
|
|
7587
8314
|
selectedDistribution = matchingDistributions[0];
|
|
7588
8315
|
} else if (matchingDistributions.length > 1) {
|
|
7589
|
-
const selectedDistributionStr = await
|
|
8316
|
+
const selectedDistributionStr = await ve({
|
|
7590
8317
|
message: "Multiple CloudFront distributions found. Please select one to use:",
|
|
7591
8318
|
options: matchingDistributions.map((dist) => ({
|
|
7592
8319
|
value: JSON.stringify(dist),
|
|
7593
8320
|
label: `${dist.Id} (${dist.DomainName})`
|
|
7594
8321
|
}))
|
|
7595
8322
|
});
|
|
7596
|
-
if (
|
|
8323
|
+
if (BD(selectedDistributionStr)) process.exit(0);
|
|
7597
8324
|
selectedDistribution = JSON.parse(selectedDistributionStr);
|
|
7598
8325
|
}
|
|
7599
8326
|
const newOverrides = {
|
|
@@ -7657,7 +8384,7 @@ var CloudFrontManager = class {
|
|
|
7657
8384
|
}
|
|
7658
8385
|
};
|
|
7659
8386
|
if (selectedDistribution) {
|
|
7660
|
-
|
|
8387
|
+
f2.success(
|
|
7661
8388
|
`Existing CloudFront distribution selected. Distribution ID: ${selectedDistribution.Id}.`
|
|
7662
8389
|
);
|
|
7663
8390
|
try {
|
|
@@ -7673,7 +8400,7 @@ var CloudFrontManager = class {
|
|
|
7673
8400
|
IfMatch: ETag,
|
|
7674
8401
|
DistributionConfig: finalConfig
|
|
7675
8402
|
});
|
|
7676
|
-
|
|
8403
|
+
f2.success(
|
|
7677
8404
|
"CloudFront distribution updated with new Lambda function ARN."
|
|
7678
8405
|
);
|
|
7679
8406
|
await cloudfrontClient.createInvalidation({
|
|
@@ -7683,13 +8410,13 @@ var CloudFrontManager = class {
|
|
|
7683
8410
|
Paths: { Quantity: 1, Items: ["/*"] }
|
|
7684
8411
|
}
|
|
7685
8412
|
});
|
|
7686
|
-
|
|
8413
|
+
f2.success("Cache invalidation request completed.");
|
|
7687
8414
|
return {
|
|
7688
8415
|
distributionId: selectedDistribution.Id,
|
|
7689
8416
|
distributionDomain: selectedDistribution.DomainName
|
|
7690
8417
|
};
|
|
7691
8418
|
} catch (err) {
|
|
7692
|
-
|
|
8419
|
+
f2.error(
|
|
7693
8420
|
`Failed to update CloudFront distribution: ${err instanceof Error ? err.message : String(err)}`
|
|
7694
8421
|
);
|
|
7695
8422
|
throw err;
|
|
@@ -7771,11 +8498,11 @@ var CloudFrontManager = class {
|
|
|
7771
8498
|
});
|
|
7772
8499
|
const distributionId = distResp.Distribution?.Id;
|
|
7773
8500
|
const distributionDomain = distResp.Distribution?.DomainName;
|
|
7774
|
-
|
|
8501
|
+
f2.success(
|
|
7775
8502
|
`Created new CloudFront distribution. Distribution ID: ${distributionId}`
|
|
7776
8503
|
);
|
|
7777
8504
|
let retryCount = 0;
|
|
7778
|
-
await
|
|
8505
|
+
await Te([
|
|
7779
8506
|
{
|
|
7780
8507
|
title: "Waiting for CloudFront distribution to complete...",
|
|
7781
8508
|
task: async (message) => {
|
|
@@ -7797,14 +8524,14 @@ var CloudFrontManager = class {
|
|
|
7797
8524
|
await delay(1e3);
|
|
7798
8525
|
}
|
|
7799
8526
|
}
|
|
7800
|
-
|
|
8527
|
+
f2.error("CloudFront distribution deployment timed out.");
|
|
7801
8528
|
process.exit(1);
|
|
7802
8529
|
}
|
|
7803
8530
|
}
|
|
7804
8531
|
]);
|
|
7805
8532
|
return { distributionId, distributionDomain };
|
|
7806
8533
|
} catch (error) {
|
|
7807
|
-
|
|
8534
|
+
f2.error(
|
|
7808
8535
|
`CloudFront distribution creation failed: ${error instanceof Error ? error.message : String(error)}`
|
|
7809
8536
|
);
|
|
7810
8537
|
throw error;
|
|
@@ -7814,7 +8541,6 @@ var CloudFrontManager = class {
|
|
|
7814
8541
|
|
|
7815
8542
|
// iac/iam.ts
|
|
7816
8543
|
import { IAM } from "@aws-sdk/client-iam";
|
|
7817
|
-
import * as p2 from "@clack/prompts";
|
|
7818
8544
|
var IAMManager = class {
|
|
7819
8545
|
region;
|
|
7820
8546
|
credentials;
|
|
@@ -7845,7 +8571,7 @@ var IAMManager = class {
|
|
|
7845
8571
|
RoleName: roleName
|
|
7846
8572
|
});
|
|
7847
8573
|
if (existingRole?.Arn) {
|
|
7848
|
-
|
|
8574
|
+
f2.info(
|
|
7849
8575
|
`Using existing IAM role: ${roleName} (${existingRole.Arn})`
|
|
7850
8576
|
);
|
|
7851
8577
|
return existingRole.Arn;
|
|
@@ -7858,7 +8584,7 @@ var IAMManager = class {
|
|
|
7858
8584
|
Description: "Role for Lambda@Edge to access S3"
|
|
7859
8585
|
});
|
|
7860
8586
|
const lambdaRoleArn = createRoleResp.Role?.Arn;
|
|
7861
|
-
|
|
8587
|
+
f2.info(`Created IAM role: ${roleName} (${lambdaRoleArn})`);
|
|
7862
8588
|
await iamClient.attachRolePolicy({
|
|
7863
8589
|
RoleName: roleName,
|
|
7864
8590
|
PolicyArn: "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
@@ -7867,11 +8593,11 @@ var IAMManager = class {
|
|
|
7867
8593
|
RoleName: roleName,
|
|
7868
8594
|
PolicyArn: "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
|
|
7869
8595
|
});
|
|
7870
|
-
|
|
8596
|
+
f2.info(`Attached required policies to ${roleName}`);
|
|
7871
8597
|
return lambdaRoleArn;
|
|
7872
8598
|
} catch (createError) {
|
|
7873
8599
|
if (createError instanceof Error) {
|
|
7874
|
-
|
|
8600
|
+
f2.error(`Error setting up IAM role: ${createError.message}`);
|
|
7875
8601
|
}
|
|
7876
8602
|
process.exit(1);
|
|
7877
8603
|
}
|
|
@@ -7883,7 +8609,6 @@ var IAMManager = class {
|
|
|
7883
8609
|
// iac/lambdaEdge.ts
|
|
7884
8610
|
import path6 from "path";
|
|
7885
8611
|
import { Lambda } from "@aws-sdk/client-lambda";
|
|
7886
|
-
import * as p3 from "@clack/prompts";
|
|
7887
8612
|
import {
|
|
7888
8613
|
copyDirToTmp,
|
|
7889
8614
|
createZip,
|
|
@@ -7898,12 +8623,12 @@ var LambdaEdgeDeployer = class {
|
|
|
7898
8623
|
}
|
|
7899
8624
|
async deploy(lambdaRoleArn, keyPair) {
|
|
7900
8625
|
const cwd = getCwd();
|
|
7901
|
-
const lambdaName = await
|
|
8626
|
+
const lambdaName = await he({
|
|
7902
8627
|
message: "Enter the name of the Lambda@Edge function",
|
|
7903
8628
|
defaultValue: "hot-updater-edge",
|
|
7904
8629
|
placeholder: "hot-updater-edge"
|
|
7905
8630
|
});
|
|
7906
|
-
if (
|
|
8631
|
+
if (BD(lambdaName)) process.exit(1);
|
|
7907
8632
|
const lambdaPath = __require.resolve("@hot-updater/aws/lambda");
|
|
7908
8633
|
const lambdaDir = path6.dirname(lambdaPath);
|
|
7909
8634
|
const { tmpDir, removeTmpDir } = await copyDirToTmp(lambdaDir);
|
|
@@ -7925,7 +8650,7 @@ var LambdaEdgeDeployer = class {
|
|
|
7925
8650
|
version: null
|
|
7926
8651
|
};
|
|
7927
8652
|
const zipFilePath = path6.join(cwd, `${lambdaName}.zip`);
|
|
7928
|
-
await
|
|
8653
|
+
await Te([
|
|
7929
8654
|
{
|
|
7930
8655
|
title: "Compressing Lambda code to zip",
|
|
7931
8656
|
task: async () => {
|
|
@@ -7997,7 +8722,7 @@ var LambdaEdgeDeployer = class {
|
|
|
7997
8722
|
Timeout: 10
|
|
7998
8723
|
});
|
|
7999
8724
|
} catch (error2) {
|
|
8000
|
-
|
|
8725
|
+
f2.error(
|
|
8001
8726
|
`Failed to update Lambda configuration: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
8002
8727
|
);
|
|
8003
8728
|
}
|
|
@@ -8005,7 +8730,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8005
8730
|
functionArn.version = updateResp.Version || "1";
|
|
8006
8731
|
} else {
|
|
8007
8732
|
if (error instanceof Error) {
|
|
8008
|
-
|
|
8733
|
+
f2.error(
|
|
8009
8734
|
`Failed to create or update Lambda function: ${error.message}`
|
|
8010
8735
|
);
|
|
8011
8736
|
}
|
|
@@ -8034,7 +8759,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8034
8759
|
`Lambda function is in a Failed state. Reason: ${resp.StateReason}`
|
|
8035
8760
|
);
|
|
8036
8761
|
}
|
|
8037
|
-
await new Promise((
|
|
8762
|
+
await new Promise((r2) => setTimeout(r2, 2e3));
|
|
8038
8763
|
}
|
|
8039
8764
|
}
|
|
8040
8765
|
}
|
|
@@ -8045,13 +8770,13 @@ var LambdaEdgeDeployer = class {
|
|
|
8045
8770
|
if (!functionArn.arn.endsWith(`:${functionArn.version}`)) {
|
|
8046
8771
|
functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
|
|
8047
8772
|
}
|
|
8048
|
-
|
|
8773
|
+
f2.info(`Using Lambda ARN: ${functionArn.arn}`);
|
|
8049
8774
|
return { lambdaName, functionArn: functionArn.arn };
|
|
8050
8775
|
}
|
|
8051
8776
|
};
|
|
8052
8777
|
|
|
8053
8778
|
// iac/migrations/migrator.ts
|
|
8054
|
-
var
|
|
8779
|
+
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
8055
8780
|
import {
|
|
8056
8781
|
CopyObjectCommand,
|
|
8057
8782
|
DeleteObjectCommand,
|
|
@@ -8118,7 +8843,7 @@ var S3Migration = class {
|
|
|
8118
8843
|
}
|
|
8119
8844
|
return null;
|
|
8120
8845
|
} catch (error) {
|
|
8121
|
-
console.error(
|
|
8846
|
+
console.error(import_picocolors3.default.red(`Error reading file ${key}:`), error);
|
|
8122
8847
|
return null;
|
|
8123
8848
|
}
|
|
8124
8849
|
}
|
|
@@ -8128,8 +8853,8 @@ var S3Migration = class {
|
|
|
8128
8853
|
if (content) {
|
|
8129
8854
|
try {
|
|
8130
8855
|
return JSON.parse(content);
|
|
8131
|
-
} catch (
|
|
8132
|
-
console.error(
|
|
8856
|
+
} catch (e2) {
|
|
8857
|
+
console.error(import_picocolors3.default.red(`Error parsing JSON from ${key}:`), e2);
|
|
8133
8858
|
}
|
|
8134
8859
|
}
|
|
8135
8860
|
return null;
|
|
@@ -8156,8 +8881,8 @@ var S3Migration = class {
|
|
|
8156
8881
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
8157
8882
|
if (this.dryRun) {
|
|
8158
8883
|
console.log(
|
|
8159
|
-
|
|
8160
|
-
`[DRY RUN] Updated ${
|
|
8884
|
+
import_picocolors3.default.yellow(
|
|
8885
|
+
`[DRY RUN] Updated ${import_picocolors3.default.bold(normalizedKey)}`
|
|
8161
8886
|
)
|
|
8162
8887
|
);
|
|
8163
8888
|
return;
|
|
@@ -8169,7 +8894,7 @@ var S3Migration = class {
|
|
|
8169
8894
|
await this.doUpdateFile(normalizedKey, content, {
|
|
8170
8895
|
cacheControl
|
|
8171
8896
|
});
|
|
8172
|
-
console.log(
|
|
8897
|
+
console.log(import_picocolors3.default.green(`Updated ${import_picocolors3.default.bold(normalizedKey)}`));
|
|
8173
8898
|
}
|
|
8174
8899
|
// Moves a single file from one location to another.
|
|
8175
8900
|
// In dry-run mode, it logs what would be moved.
|
|
@@ -8178,8 +8903,8 @@ var S3Migration = class {
|
|
|
8178
8903
|
async moveFile(from, to) {
|
|
8179
8904
|
if (this.dryRun) {
|
|
8180
8905
|
console.log(
|
|
8181
|
-
|
|
8182
|
-
`[DRY RUN] ${
|
|
8906
|
+
import_picocolors3.default.yellow(
|
|
8907
|
+
`[DRY RUN] ${import_picocolors3.default.bold(from)} -> ${import_picocolors3.default.bold(to)}`
|
|
8183
8908
|
)
|
|
8184
8909
|
);
|
|
8185
8910
|
return;
|
|
@@ -8194,7 +8919,7 @@ var S3Migration = class {
|
|
|
8194
8919
|
await this.s3.send(copyCommand);
|
|
8195
8920
|
} catch (error) {
|
|
8196
8921
|
console.error(
|
|
8197
|
-
|
|
8922
|
+
import_picocolors3.default.red(`Error copying file from ${from} to ${to}:`),
|
|
8198
8923
|
error
|
|
8199
8924
|
);
|
|
8200
8925
|
throw error;
|
|
@@ -8208,15 +8933,15 @@ var S3Migration = class {
|
|
|
8208
8933
|
} catch (error) {
|
|
8209
8934
|
if (error?.message?.includes("NoSuchKey")) {
|
|
8210
8935
|
console.warn(
|
|
8211
|
-
|
|
8936
|
+
import_picocolors3.default.yellow(`Key ${from} not found during deletion, ignoring.`)
|
|
8212
8937
|
);
|
|
8213
8938
|
} else {
|
|
8214
|
-
console.error(
|
|
8939
|
+
console.error(import_picocolors3.default.red(`Error deleting file ${from}:`), error);
|
|
8215
8940
|
throw error;
|
|
8216
8941
|
}
|
|
8217
8942
|
}
|
|
8218
8943
|
console.log(
|
|
8219
|
-
|
|
8944
|
+
import_picocolors3.default.green(`${import_picocolors3.default.bold(from)} -> ${import_picocolors3.default.bold(to)}`)
|
|
8220
8945
|
);
|
|
8221
8946
|
}
|
|
8222
8947
|
// Deletes a backup file
|
|
@@ -8232,7 +8957,7 @@ var S3Migration = class {
|
|
|
8232
8957
|
await this.s3.send(deleteCommand);
|
|
8233
8958
|
} catch (error) {
|
|
8234
8959
|
console.error(
|
|
8235
|
-
|
|
8960
|
+
import_picocolors3.default.red(`Error deleting backup file ${backupKey}:`),
|
|
8236
8961
|
error
|
|
8237
8962
|
);
|
|
8238
8963
|
}
|
|
@@ -8250,27 +8975,27 @@ var S3Migration = class {
|
|
|
8250
8975
|
// Rollback method: restores files from backups stored in backupMapping
|
|
8251
8976
|
async rollback() {
|
|
8252
8977
|
console.log(
|
|
8253
|
-
|
|
8978
|
+
import_picocolors3.default.magenta(`Starting rollback for migration ${this.name}...`)
|
|
8254
8979
|
);
|
|
8255
8980
|
for (const [originalKey, backupKey] of this.backupMapping.entries()) {
|
|
8256
8981
|
const backupContent = await this.readFile(backupKey);
|
|
8257
8982
|
if (backupContent !== null) {
|
|
8258
8983
|
console.log(
|
|
8259
|
-
|
|
8984
|
+
import_picocolors3.default.blue(
|
|
8260
8985
|
`Restoring backup for ${originalKey} from ${backupKey}`
|
|
8261
8986
|
)
|
|
8262
8987
|
);
|
|
8263
8988
|
await this.doUpdateFile(originalKey, backupContent);
|
|
8264
8989
|
} else {
|
|
8265
8990
|
console.error(
|
|
8266
|
-
|
|
8991
|
+
import_picocolors3.default.red(
|
|
8267
8992
|
`Failed to read backup for ${originalKey} at ${backupKey}`
|
|
8268
8993
|
)
|
|
8269
8994
|
);
|
|
8270
8995
|
}
|
|
8271
8996
|
}
|
|
8272
8997
|
console.log(
|
|
8273
|
-
|
|
8998
|
+
import_picocolors3.default.green(`Rollback completed for migration ${this.name}.`)
|
|
8274
8999
|
);
|
|
8275
9000
|
}
|
|
8276
9001
|
};
|
|
@@ -8298,7 +9023,7 @@ var S3Migrator = class {
|
|
|
8298
9023
|
this.migrationRecords = JSON.parse(bodyContents);
|
|
8299
9024
|
} catch (jsonError) {
|
|
8300
9025
|
console.error(
|
|
8301
|
-
|
|
9026
|
+
import_picocolors3.default.red("Failed to parse migration records JSON:"),
|
|
8302
9027
|
jsonError
|
|
8303
9028
|
);
|
|
8304
9029
|
this.migrationRecords = [];
|
|
@@ -8356,7 +9081,7 @@ var S3Migrator = class {
|
|
|
8356
9081
|
continue;
|
|
8357
9082
|
}
|
|
8358
9083
|
console.log(
|
|
8359
|
-
|
|
9084
|
+
import_picocolors3.default.magenta(`Applying migration ${migration.name}...`)
|
|
8360
9085
|
);
|
|
8361
9086
|
migration.s3 = this.s3;
|
|
8362
9087
|
migration.bucketName = this.bucketName;
|
|
@@ -8369,21 +9094,21 @@ var S3Migrator = class {
|
|
|
8369
9094
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8370
9095
|
});
|
|
8371
9096
|
console.log(
|
|
8372
|
-
|
|
8373
|
-
`${
|
|
9097
|
+
import_picocolors3.default.green(
|
|
9098
|
+
`${import_picocolors3.default.bold(migration.name)} applied successfully.`
|
|
8374
9099
|
)
|
|
8375
9100
|
);
|
|
8376
9101
|
await migration.cleanupBackups();
|
|
8377
9102
|
} else {
|
|
8378
9103
|
console.log(
|
|
8379
|
-
|
|
8380
|
-
`[DRY RUN] ${
|
|
9104
|
+
import_picocolors3.default.yellow(
|
|
9105
|
+
`[DRY RUN] ${import_picocolors3.default.bold(migration.name)} applied successfully`
|
|
8381
9106
|
)
|
|
8382
9107
|
);
|
|
8383
9108
|
}
|
|
8384
9109
|
} catch (error) {
|
|
8385
9110
|
console.error(
|
|
8386
|
-
|
|
9111
|
+
import_picocolors3.default.red(
|
|
8387
9112
|
`Migration ${migration.name} failed. Initiating rollback...`
|
|
8388
9113
|
),
|
|
8389
9114
|
error
|
|
@@ -8394,7 +9119,7 @@ var S3Migrator = class {
|
|
|
8394
9119
|
}
|
|
8395
9120
|
await this.saveMigrationRecords(dryRun);
|
|
8396
9121
|
if (!dryRun) {
|
|
8397
|
-
console.log(
|
|
9122
|
+
console.log(import_picocolors3.default.blue("All migrations applied."));
|
|
8398
9123
|
}
|
|
8399
9124
|
}
|
|
8400
9125
|
};
|
|
@@ -8465,7 +9190,6 @@ var regionLocationMap = {
|
|
|
8465
9190
|
|
|
8466
9191
|
// iac/s3.ts
|
|
8467
9192
|
import { S3 } from "@aws-sdk/client-s3";
|
|
8468
|
-
import * as p4 from "@clack/prompts";
|
|
8469
9193
|
var S3Manager = class {
|
|
8470
9194
|
credentials;
|
|
8471
9195
|
constructor(credentials) {
|
|
@@ -8497,7 +9221,7 @@ var S3Manager = class {
|
|
|
8497
9221
|
LocationConstraint: region
|
|
8498
9222
|
}
|
|
8499
9223
|
});
|
|
8500
|
-
|
|
9224
|
+
f2.info(`Created S3 bucket: ${bucketName}`);
|
|
8501
9225
|
}
|
|
8502
9226
|
async runMigrations({
|
|
8503
9227
|
bucketName,
|
|
@@ -8512,14 +9236,14 @@ var S3Manager = class {
|
|
|
8512
9236
|
const { pending } = await migrator.list();
|
|
8513
9237
|
await migrator.migrate({ dryRun: true });
|
|
8514
9238
|
if (pending.length > 0) {
|
|
8515
|
-
|
|
8516
|
-
for (const
|
|
8517
|
-
|
|
9239
|
+
f2.step("Pending migrations:");
|
|
9240
|
+
for (const m2 of pending) {
|
|
9241
|
+
f2.step(`- ${m2.name}`);
|
|
8518
9242
|
}
|
|
8519
9243
|
}
|
|
8520
|
-
const
|
|
8521
|
-
if (
|
|
8522
|
-
|
|
9244
|
+
const confirm = await ye({ message: "Do you want to continue?" });
|
|
9245
|
+
if (BD(confirm) || !confirm) {
|
|
9246
|
+
f2.info("Migration cancelled.");
|
|
8523
9247
|
process.exit(1);
|
|
8524
9248
|
}
|
|
8525
9249
|
await migrator.migrate({ dryRun: false });
|
|
@@ -8556,7 +9280,7 @@ var S3Manager = class {
|
|
|
8556
9280
|
Bucket: bucketName,
|
|
8557
9281
|
Policy: JSON.stringify(bucketPolicy)
|
|
8558
9282
|
});
|
|
8559
|
-
|
|
9283
|
+
f2.success(
|
|
8560
9284
|
"S3 bucket policy updated to allow access from CloudFront distribution"
|
|
8561
9285
|
);
|
|
8562
9286
|
}
|
|
@@ -8565,7 +9289,6 @@ var S3Manager = class {
|
|
|
8565
9289
|
// iac/ssm.ts
|
|
8566
9290
|
import crypto2 from "crypto";
|
|
8567
9291
|
import { ParameterNotFound, SSM } from "@aws-sdk/client-ssm";
|
|
8568
|
-
import * as p5 from "@clack/prompts";
|
|
8569
9292
|
var SSMKeyPairManager = class {
|
|
8570
9293
|
region;
|
|
8571
9294
|
credentials;
|
|
@@ -8601,7 +9324,7 @@ var SSMKeyPairManager = class {
|
|
|
8601
9324
|
const existing = await this.getParameter(parameterName);
|
|
8602
9325
|
if (existing) {
|
|
8603
9326
|
const keyPair2 = JSON.parse(existing);
|
|
8604
|
-
|
|
9327
|
+
f2.info("Using existing CloudFront key pair from SSM Parameter Store");
|
|
8605
9328
|
return keyPair2;
|
|
8606
9329
|
}
|
|
8607
9330
|
const { publicKey, privateKey } = crypto2.generateKeyPairSync("rsa", {
|
|
@@ -8612,7 +9335,7 @@ var SSMKeyPairManager = class {
|
|
|
8612
9335
|
const keyPairId = `HOTUPDATER-${crypto2.randomBytes(4).toString("hex").toUpperCase()}`;
|
|
8613
9336
|
const keyPair = { keyPairId, publicKey, privateKey };
|
|
8614
9337
|
await this.putParameter(parameterName, JSON.stringify(keyPair));
|
|
8615
|
-
|
|
9338
|
+
f2.success(
|
|
8616
9339
|
"Created and stored new CloudFront key pair in SSM Parameter Store"
|
|
8617
9340
|
);
|
|
8618
9341
|
return keyPair;
|
|
@@ -8690,13 +9413,13 @@ var checkIfAwsCliInstalled = async () => {
|
|
|
8690
9413
|
var runInit = async () => {
|
|
8691
9414
|
const isAwsCliInstalled = await checkIfAwsCliInstalled();
|
|
8692
9415
|
if (!isAwsCliInstalled) {
|
|
8693
|
-
|
|
9416
|
+
f2.error(
|
|
8694
9417
|
`AWS CLI is not installed. Please visit ${link("https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")} for installation instructions`
|
|
8695
9418
|
);
|
|
8696
9419
|
process.exit(1);
|
|
8697
9420
|
}
|
|
8698
9421
|
let credentials = void 0;
|
|
8699
|
-
const mode = await
|
|
9422
|
+
const mode = await ve({
|
|
8700
9423
|
message: "Select the mode to login to AWS",
|
|
8701
9424
|
options: [
|
|
8702
9425
|
{
|
|
@@ -8706,31 +9429,31 @@ var runInit = async () => {
|
|
|
8706
9429
|
{ label: "AWS SSO Login", value: "sso" }
|
|
8707
9430
|
]
|
|
8708
9431
|
});
|
|
8709
|
-
if (
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
`${
|
|
9432
|
+
if (BD(mode)) process.exit(1);
|
|
9433
|
+
f2.message(import_picocolors4.default.blue("The following permissions are required:"));
|
|
9434
|
+
f2.message(
|
|
9435
|
+
`${import_picocolors4.default.blue("AmazonS3FullAccess")}: Create and read S3 buckets`
|
|
8713
9436
|
);
|
|
8714
|
-
|
|
8715
|
-
`${
|
|
9437
|
+
f2.message(
|
|
9438
|
+
`${import_picocolors4.default.blue("AWSLambda_FullAccess")}: Create and update Lambda functions`
|
|
8716
9439
|
);
|
|
8717
|
-
|
|
8718
|
-
`${
|
|
9440
|
+
f2.message(
|
|
9441
|
+
`${import_picocolors4.default.blue("CloudFrontFullAccess")}: Create and update CloudFront distributions`
|
|
8719
9442
|
);
|
|
8720
|
-
|
|
8721
|
-
`${
|
|
9443
|
+
f2.message(
|
|
9444
|
+
`${import_picocolors4.default.blue("IAMFullAccess")}: Get or create IAM roles for Lambda@Edge`
|
|
8722
9445
|
);
|
|
8723
|
-
|
|
8724
|
-
`${
|
|
9446
|
+
f2.message(
|
|
9447
|
+
`${import_picocolors4.default.blue("AmazonSSMFullAccess")}: Access to SSM Parameters for storing CloudFront key pairs`
|
|
8725
9448
|
);
|
|
8726
9449
|
if (mode === "sso") {
|
|
8727
9450
|
try {
|
|
8728
|
-
const profile = await
|
|
9451
|
+
const profile = await he({
|
|
8729
9452
|
message: "Enter the SSO profile name",
|
|
8730
9453
|
defaultValue: "default",
|
|
8731
9454
|
placeholder: "default"
|
|
8732
9455
|
});
|
|
8733
|
-
if (
|
|
9456
|
+
if (BD(profile)) process.exit(1);
|
|
8734
9457
|
await execa("aws", ["sso", "login", "--profile", profile], {
|
|
8735
9458
|
stdio: "inherit",
|
|
8736
9459
|
shell: true
|
|
@@ -8738,22 +9461,22 @@ var runInit = async () => {
|
|
|
8738
9461
|
credentials = await fromSSO({ profile })();
|
|
8739
9462
|
} catch (error) {
|
|
8740
9463
|
if (error instanceof ExecaError) {
|
|
8741
|
-
|
|
9464
|
+
f2.error(error.stdout || error.stderr || error.message);
|
|
8742
9465
|
}
|
|
8743
9466
|
process.exit(1);
|
|
8744
9467
|
}
|
|
8745
9468
|
} else {
|
|
8746
|
-
const creds = await
|
|
8747
|
-
accessKeyId: () =>
|
|
9469
|
+
const creds = await Ce({
|
|
9470
|
+
accessKeyId: () => he({
|
|
8748
9471
|
message: "Enter your AWS Access Key ID",
|
|
8749
9472
|
validate: (value) => value ? void 0 : "Access Key ID is required"
|
|
8750
9473
|
}),
|
|
8751
|
-
secretAccessKey: () =>
|
|
9474
|
+
secretAccessKey: () => ge({
|
|
8752
9475
|
message: "Enter your AWS Secret Access Key",
|
|
8753
9476
|
validate: (value) => value ? void 0 : "Secret Access Key is required"
|
|
8754
9477
|
})
|
|
8755
9478
|
});
|
|
8756
|
-
if (
|
|
9479
|
+
if (BD(creds)) process.exit(1);
|
|
8757
9480
|
credentials = {
|
|
8758
9481
|
accessKeyId: creds.accessKeyId,
|
|
8759
9482
|
secretAccessKey: creds.secretAccessKey
|
|
@@ -8762,7 +9485,7 @@ var runInit = async () => {
|
|
|
8762
9485
|
const s3Manager = new S3Manager(credentials);
|
|
8763
9486
|
let availableBuckets = [];
|
|
8764
9487
|
try {
|
|
8765
|
-
await
|
|
9488
|
+
await Te([
|
|
8766
9489
|
{
|
|
8767
9490
|
title: "Checking S3 Buckets...",
|
|
8768
9491
|
task: async () => {
|
|
@@ -8770,12 +9493,12 @@ var runInit = async () => {
|
|
|
8770
9493
|
}
|
|
8771
9494
|
}
|
|
8772
9495
|
]);
|
|
8773
|
-
} catch (
|
|
8774
|
-
if (
|
|
8775
|
-
throw
|
|
9496
|
+
} catch (e2) {
|
|
9497
|
+
if (e2 instanceof Error) f2.error(e2.message);
|
|
9498
|
+
throw e2;
|
|
8776
9499
|
}
|
|
8777
9500
|
const createKey = `create/${Math.random().toString(36).substring(2, 15)}`;
|
|
8778
|
-
let bucketName = await
|
|
9501
|
+
let bucketName = await ve({
|
|
8779
9502
|
message: "S3 Bucket List",
|
|
8780
9503
|
options: [
|
|
8781
9504
|
...availableBuckets.map((bucket) => ({
|
|
@@ -8785,38 +9508,38 @@ var runInit = async () => {
|
|
|
8785
9508
|
{ value: createKey, label: "Create New S3 Bucket" }
|
|
8786
9509
|
]
|
|
8787
9510
|
});
|
|
8788
|
-
if (
|
|
9511
|
+
if (BD(bucketName)) process.exit(1);
|
|
8789
9512
|
let bucketRegion = availableBuckets.find(
|
|
8790
9513
|
(bucket) => bucket.name === bucketName
|
|
8791
9514
|
)?.region;
|
|
8792
9515
|
if (bucketName === createKey) {
|
|
8793
|
-
const name = await
|
|
9516
|
+
const name = await he({
|
|
8794
9517
|
message: "Enter the name of the new S3 Bucket",
|
|
8795
9518
|
defaultValue: "hot-updater-storage",
|
|
8796
9519
|
placeholder: "hot-updater-storage"
|
|
8797
9520
|
});
|
|
8798
|
-
if (
|
|
9521
|
+
if (BD(name)) {
|
|
8799
9522
|
process.exit(1);
|
|
8800
9523
|
}
|
|
8801
9524
|
bucketName = name;
|
|
8802
|
-
const selectedRegion = await
|
|
9525
|
+
const selectedRegion = await ve({
|
|
8803
9526
|
message: "Enter AWS region for the S3 bucket",
|
|
8804
9527
|
options: Object.entries(regionLocationMap).map(([region, location]) => ({
|
|
8805
9528
|
label: `${region} (${location})`,
|
|
8806
9529
|
value: region
|
|
8807
9530
|
}))
|
|
8808
9531
|
});
|
|
8809
|
-
if (
|
|
9532
|
+
if (BD(selectedRegion)) {
|
|
8810
9533
|
process.exit(1);
|
|
8811
9534
|
}
|
|
8812
9535
|
bucketRegion = selectedRegion;
|
|
8813
9536
|
await s3Manager.createBucket(bucketName, bucketRegion);
|
|
8814
9537
|
}
|
|
8815
9538
|
if (!bucketRegion) {
|
|
8816
|
-
|
|
9539
|
+
f2.error("Failed to get S3 bucket region");
|
|
8817
9540
|
process.exit(1);
|
|
8818
9541
|
}
|
|
8819
|
-
|
|
9542
|
+
f2.info(`Selected S3 Bucket: ${bucketName} (${bucketRegion})`);
|
|
8820
9543
|
await s3Manager.runMigrations({
|
|
8821
9544
|
bucketName,
|
|
8822
9545
|
region: bucketRegion,
|
|
@@ -8869,14 +9592,14 @@ var runInit = async () => {
|
|
|
8869
9592
|
},
|
|
8870
9593
|
HOT_UPDATER_CLOUDFRONT_DISTRIBUTION_ID: distributionId
|
|
8871
9594
|
});
|
|
8872
|
-
|
|
8873
|
-
|
|
9595
|
+
f2.success("Generated '.env' file with AWS settings.");
|
|
9596
|
+
f2.success("Generated 'hot-updater.config.ts' file with AWS settings.");
|
|
8874
9597
|
const sourceUrl = `https://${distributionDomain}/api/check-update`;
|
|
8875
|
-
|
|
8876
|
-
|
|
9598
|
+
Me(transformTemplate(SOURCE_TEMPLATE, { source: sourceUrl }));
|
|
9599
|
+
f2.message(
|
|
8877
9600
|
`Next step: ${link("https://gronxb.github.io/hot-updater/guide/providers/3_aws-s3-lambda-edge.html#step-4-changeenv-file-optional")}`
|
|
8878
9601
|
);
|
|
8879
|
-
|
|
9602
|
+
f2.success("Done! \u{1F389}");
|
|
8880
9603
|
};
|
|
8881
9604
|
export {
|
|
8882
9605
|
runInit
|