@stacksjs/logging 0.63.0 → 0.64.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/README.md +12 -6
- package/dist/index.js +2 -1840
- package/dist/index.js.map +6 -10
- package/package.json +3 -8
- package/src/index.ts +75 -83
package/dist/index.js
CHANGED
|
@@ -1,1843 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
var __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
set: (newValue) => all[name] = () => newValue
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
2
|
+
var Y=Object.create;var{getPrototypeOf:f,defineProperty:J,getOwnPropertyNames:y}=Object;var z=Object.prototype.hasOwnProperty;var A=(b,x,m)=>{m=b!=null?Y(f(b)):{};const u=x||!b||!b.__esModule?J(m,"default",{value:b,enumerable:!0}):m;for(let v of y(b))if(!z.call(u,v))J(u,v,{get:()=>b[v],enumerable:!0});return u};var H=(b,x)=>()=>(x||b((x={exports:{}}).exports,x),x.exports);var P=H((i,h)=>{var N=process.argv||[],G=process.env,Q=!(("NO_COLOR"in G)||N.includes("--no-color"))&&(("FORCE_COLOR"in G)||N.includes("--color")||process.platform==="win32"||import.meta.require!=null&&import.meta.require("tty").isatty(1)&&G.TERM!=="dumb"||("CI"in G)),V=(b,x,m=b)=>(u)=>{let v=""+u,R=v.indexOf(x,b.length);return~R?b+X(v,x,m,R)+x:b+v+x},X=(b,x,m,u)=>{let v="",R=0;do v+=b.substring(R,u)+m,R=u+x.length,u=b.indexOf(x,R);while(~u);return v+b.substring(R)},t=(b=Q)=>{let x=b?V:()=>String;return{isColorSupported:b,reset:x("\x1B[0m","\x1B[0m"),bold:x("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:x("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:x("\x1B[3m","\x1B[23m"),underline:x("\x1B[4m","\x1B[24m"),inverse:x("\x1B[7m","\x1B[27m"),hidden:x("\x1B[8m","\x1B[28m"),strikethrough:x("\x1B[9m","\x1B[29m"),black:x("\x1B[30m","\x1B[39m"),red:x("\x1B[31m","\x1B[39m"),green:x("\x1B[32m","\x1B[39m"),yellow:x("\x1B[33m","\x1B[39m"),blue:x("\x1B[34m","\x1B[39m"),magenta:x("\x1B[35m","\x1B[39m"),cyan:x("\x1B[36m","\x1B[39m"),white:x("\x1B[37m","\x1B[39m"),gray:x("\x1B[90m","\x1B[39m"),bgBlack:x("\x1B[40m","\x1B[49m"),bgRed:x("\x1B[41m","\x1B[49m"),bgGreen:x("\x1B[42m","\x1B[49m"),bgYellow:x("\x1B[43m","\x1B[49m"),bgBlue:x("\x1B[44m","\x1B[49m"),bgMagenta:x("\x1B[45m","\x1B[49m"),bgCyan:x("\x1B[46m","\x1B[49m"),bgWhite:x("\x1B[47m","\x1B[49m")}};h.exports=t();h.exports.createColors=t});import{access as Z,appendFile as $,mkdir as D}from"fs/promises";import{dirname as K}from"path";import E from"process";import{config as _}from"@stacksjs/config";import{handleError as q}from"@stacksjs/error-handling";import{ExitCode as U}from"@stacksjs/types";import{isString as w}from"@stacksjs/validation";import O from"process";function I(){if(O.platform!=="win32")return O.env.TERM!=="linux";return Boolean(O.env.WT_SESSION)||Boolean(O.env.TERMINUS_SUBLIME)||O.env.ConEmuTask==="{cmd::Cmder}"||O.env.TERM_PROGRAM==="Terminus-Sublime"||O.env.TERM_PROGRAM==="vscode"||O.env.TERM==="xterm-256color"||O.env.TERM==="alacritty"||O.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var M=A(P(),1);async function n(b){const x=`[${new Date().toISOString()}] ${b}\n`;try{const m=_.logging.logsPath??"storage/logs/stacks.log";try{await Z(m)}catch{console.log("Creating log file directory...",m),await D(K(m),{recursive:!0})}await $(m,x)}catch(m){console.error("Failed to write to log file:",m)}}function mb(...b){b.forEach((x)=>C.debug(x))}function ub(...b){b.forEach((x)=>C.debug(x)),E.exit(U.FatalError)}function vb(...b){console.log(...b)}var L=I(),T=(b,x)=>L?b:x,d=T("\u25CF","\u2022"),k=T("\u25C6","*"),j=T("\u25B2","!"),S=T("\u25A0","x"),B=T("\u2502","|"),l=T("\u25C7","o"),C={message:(b="",{symbol:x=M.default.gray(B),styled:m=!0}={})=>{if(!m)return E.stdout.write(`${b}\n`);const u=[`${M.default.gray(B)}`];if(b){const[v,...R]=b.split("\n");u.push(`${x} ${v}`,...R.map((W)=>`${M.default.gray(B)} ${W}`))}E.stdout.write(`${u.join("\n")}\n`)},info:async(b,x)=>{C.message(b,{symbol:M.default.blue(d),...x}),await n(`INFO: ${b}`)},success:async(b,x)=>{C.message(b,{symbol:M.default.green(k),...x}),await n(`SUCCESS: ${b}`)},step:async(b,x)=>{C.message(b,{symbol:M.default.green(l),...x}),await n(`STEP: ${b}`)},warn:async(b,x)=>{C.message(b,{symbol:M.default.yellow(j),...x}),await n(`WARN: ${b}`)},warning:(b,x)=>{C.warn(b,x)},error:(b,x)=>{if(b instanceof Error)q(b,x);else if(b instanceof Error)q(x);else q(b,x);const m=w(b)?b:b instanceof Error?b.message:String(b);C.message(m,{symbol:M.default.red(S)}),n(`ERROR: ${m}`)},debug:(...b)=>{if(E.env.APP_ENV==="production"||E.env.APP_ENV==="prod")return n(`DEBUG: ${b.join(" ")}`);n(`DEBUG: ${b.join(" ")}`)},dump:(...b)=>b.forEach((x)=>console.log(x)),dd:(...b)=>{b.forEach((x)=>console.log(x)),E.exit(U.FatalError)},echo:(...b)=>console.log(...b)};export{n as writeToLogFile,C as log,vb as echo,mb as dump,ub as dd};
|
|
13
3
|
|
|
14
|
-
|
|
15
|
-
function isObject(value) {
|
|
16
|
-
return value !== null && typeof value === "object";
|
|
17
|
-
}
|
|
18
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
19
|
-
if (!isObject(defaults)) {
|
|
20
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
21
|
-
}
|
|
22
|
-
const object = Object.assign({}, defaults);
|
|
23
|
-
for (const key in baseObject) {
|
|
24
|
-
if (key === "__proto__" || key === "constructor") {
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
const value = baseObject[key];
|
|
28
|
-
if (value === null || value === undefined) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
35
|
-
object[key] = [...value, ...object[key]];
|
|
36
|
-
} else if (isObject(value) && isObject(object[key])) {
|
|
37
|
-
object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
38
|
-
} else {
|
|
39
|
-
object[key] = value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return object;
|
|
43
|
-
}
|
|
44
|
-
function createDefu(merger) {
|
|
45
|
-
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
46
|
-
}
|
|
47
|
-
function isPlainObject(obj) {
|
|
48
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
49
|
-
}
|
|
50
|
-
function isLogObj(arg) {
|
|
51
|
-
if (!isPlainObject(arg)) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
if (!arg.message && !arg.args) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
if (arg.stack) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
63
|
-
if (input === undefined) {
|
|
64
|
-
return defaultLevel;
|
|
65
|
-
}
|
|
66
|
-
if (typeof input === "number") {
|
|
67
|
-
return input;
|
|
68
|
-
}
|
|
69
|
-
if (types[input] && types[input].level !== undefined) {
|
|
70
|
-
return types[input].level;
|
|
71
|
-
}
|
|
72
|
-
return defaultLevel;
|
|
73
|
-
}
|
|
74
|
-
function createConsola(options = {}) {
|
|
75
|
-
return new Consola(options);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
class Consola {
|
|
79
|
-
constructor(options = {}) {
|
|
80
|
-
const types = options.types || LogTypes;
|
|
81
|
-
this.options = defu({
|
|
82
|
-
...options,
|
|
83
|
-
defaults: { ...options.defaults },
|
|
84
|
-
level: _normalizeLogLevel(options.level, types),
|
|
85
|
-
reporters: [...options.reporters || []]
|
|
86
|
-
}, {
|
|
87
|
-
types: LogTypes,
|
|
88
|
-
throttle: 1000,
|
|
89
|
-
throttleMin: 5,
|
|
90
|
-
formatOptions: {
|
|
91
|
-
date: true,
|
|
92
|
-
colors: false,
|
|
93
|
-
compact: true
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
for (const type in types) {
|
|
97
|
-
const defaults = {
|
|
98
|
-
type,
|
|
99
|
-
...this.options.defaults,
|
|
100
|
-
...types[type]
|
|
101
|
-
};
|
|
102
|
-
this[type] = this._wrapLogFn(defaults);
|
|
103
|
-
this[type].raw = this._wrapLogFn(defaults, true);
|
|
104
|
-
}
|
|
105
|
-
if (this.options.mockFn) {
|
|
106
|
-
this.mockTypes();
|
|
107
|
-
}
|
|
108
|
-
this._lastLog = {};
|
|
109
|
-
}
|
|
110
|
-
get level() {
|
|
111
|
-
return this.options.level;
|
|
112
|
-
}
|
|
113
|
-
set level(level) {
|
|
114
|
-
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
115
|
-
}
|
|
116
|
-
prompt(message, opts) {
|
|
117
|
-
if (!this.options.prompt) {
|
|
118
|
-
throw new Error("prompt is not supported!");
|
|
119
|
-
}
|
|
120
|
-
return this.options.prompt(message, opts);
|
|
121
|
-
}
|
|
122
|
-
create(options) {
|
|
123
|
-
const instance = new Consola({
|
|
124
|
-
...this.options,
|
|
125
|
-
...options
|
|
126
|
-
});
|
|
127
|
-
if (this._mockFn) {
|
|
128
|
-
instance.mockTypes(this._mockFn);
|
|
129
|
-
}
|
|
130
|
-
return instance;
|
|
131
|
-
}
|
|
132
|
-
withDefaults(defaults) {
|
|
133
|
-
return this.create({
|
|
134
|
-
...this.options,
|
|
135
|
-
defaults: {
|
|
136
|
-
...this.options.defaults,
|
|
137
|
-
...defaults
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
withTag(tag) {
|
|
142
|
-
return this.withDefaults({
|
|
143
|
-
tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
addReporter(reporter) {
|
|
147
|
-
this.options.reporters.push(reporter);
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
removeReporter(reporter) {
|
|
151
|
-
if (reporter) {
|
|
152
|
-
const i = this.options.reporters.indexOf(reporter);
|
|
153
|
-
if (i >= 0) {
|
|
154
|
-
return this.options.reporters.splice(i, 1);
|
|
155
|
-
}
|
|
156
|
-
} else {
|
|
157
|
-
this.options.reporters.splice(0);
|
|
158
|
-
}
|
|
159
|
-
return this;
|
|
160
|
-
}
|
|
161
|
-
setReporters(reporters) {
|
|
162
|
-
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
wrapAll() {
|
|
166
|
-
this.wrapConsole();
|
|
167
|
-
this.wrapStd();
|
|
168
|
-
}
|
|
169
|
-
restoreAll() {
|
|
170
|
-
this.restoreConsole();
|
|
171
|
-
this.restoreStd();
|
|
172
|
-
}
|
|
173
|
-
wrapConsole() {
|
|
174
|
-
for (const type in this.options.types) {
|
|
175
|
-
if (!console["__" + type]) {
|
|
176
|
-
console["__" + type] = console[type];
|
|
177
|
-
}
|
|
178
|
-
console[type] = this[type].raw;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
restoreConsole() {
|
|
182
|
-
for (const type in this.options.types) {
|
|
183
|
-
if (console["__" + type]) {
|
|
184
|
-
console[type] = console["__" + type];
|
|
185
|
-
delete console["__" + type];
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
wrapStd() {
|
|
190
|
-
this._wrapStream(this.options.stdout, "log");
|
|
191
|
-
this._wrapStream(this.options.stderr, "log");
|
|
192
|
-
}
|
|
193
|
-
_wrapStream(stream, type) {
|
|
194
|
-
if (!stream) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (!stream.__write) {
|
|
198
|
-
stream.__write = stream.write;
|
|
199
|
-
}
|
|
200
|
-
stream.write = (data) => {
|
|
201
|
-
this[type].raw(String(data).trim());
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
restoreStd() {
|
|
205
|
-
this._restoreStream(this.options.stdout);
|
|
206
|
-
this._restoreStream(this.options.stderr);
|
|
207
|
-
}
|
|
208
|
-
_restoreStream(stream) {
|
|
209
|
-
if (!stream) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (stream.__write) {
|
|
213
|
-
stream.write = stream.__write;
|
|
214
|
-
delete stream.__write;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
pauseLogs() {
|
|
218
|
-
paused = true;
|
|
219
|
-
}
|
|
220
|
-
resumeLogs() {
|
|
221
|
-
paused = false;
|
|
222
|
-
const _queue = queue.splice(0);
|
|
223
|
-
for (const item of _queue) {
|
|
224
|
-
item[0]._logFn(item[1], item[2]);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
mockTypes(mockFn) {
|
|
228
|
-
const _mockFn = mockFn || this.options.mockFn;
|
|
229
|
-
this._mockFn = _mockFn;
|
|
230
|
-
if (typeof _mockFn !== "function") {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
for (const type in this.options.types) {
|
|
234
|
-
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
235
|
-
this[type].raw = this[type];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
_wrapLogFn(defaults, isRaw) {
|
|
239
|
-
return (...args) => {
|
|
240
|
-
if (paused) {
|
|
241
|
-
queue.push([this, defaults, args, isRaw]);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
return this._logFn(defaults, args, isRaw);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
_logFn(defaults, args, isRaw) {
|
|
248
|
-
if ((defaults.level || 0) > this.level) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
const logObj = {
|
|
252
|
-
date: /* @__PURE__ */ new Date,
|
|
253
|
-
args: [],
|
|
254
|
-
...defaults,
|
|
255
|
-
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
256
|
-
};
|
|
257
|
-
if (!isRaw && args.length === 1 && isLogObj(args[0])) {
|
|
258
|
-
Object.assign(logObj, args[0]);
|
|
259
|
-
} else {
|
|
260
|
-
logObj.args = [...args];
|
|
261
|
-
}
|
|
262
|
-
if (logObj.message) {
|
|
263
|
-
logObj.args.unshift(logObj.message);
|
|
264
|
-
delete logObj.message;
|
|
265
|
-
}
|
|
266
|
-
if (logObj.additional) {
|
|
267
|
-
if (!Array.isArray(logObj.additional)) {
|
|
268
|
-
logObj.additional = logObj.additional.split("\n");
|
|
269
|
-
}
|
|
270
|
-
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
271
|
-
delete logObj.additional;
|
|
272
|
-
}
|
|
273
|
-
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
274
|
-
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
275
|
-
const resolveLog = (newLog = false) => {
|
|
276
|
-
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
277
|
-
if (this._lastLog.object && repeated > 0) {
|
|
278
|
-
const args2 = [...this._lastLog.object.args];
|
|
279
|
-
if (repeated > 1) {
|
|
280
|
-
args2.push(`(repeated ${repeated} times)`);
|
|
281
|
-
}
|
|
282
|
-
this._log({ ...this._lastLog.object, args: args2 });
|
|
283
|
-
this._lastLog.count = 1;
|
|
284
|
-
}
|
|
285
|
-
if (newLog) {
|
|
286
|
-
this._lastLog.object = logObj;
|
|
287
|
-
this._log(logObj);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
clearTimeout(this._lastLog.timeout);
|
|
291
|
-
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
292
|
-
this._lastLog.time = logObj.date;
|
|
293
|
-
if (diffTime < this.options.throttle) {
|
|
294
|
-
try {
|
|
295
|
-
const serializedLog = JSON.stringify([
|
|
296
|
-
logObj.type,
|
|
297
|
-
logObj.tag,
|
|
298
|
-
logObj.args
|
|
299
|
-
]);
|
|
300
|
-
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
301
|
-
this._lastLog.serialized = serializedLog;
|
|
302
|
-
if (isSameLog) {
|
|
303
|
-
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
304
|
-
if (this._lastLog.count > this.options.throttleMin) {
|
|
305
|
-
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
} catch {
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
resolveLog(true);
|
|
313
|
-
}
|
|
314
|
-
_log(logObj) {
|
|
315
|
-
for (const reporter of this.options.reporters) {
|
|
316
|
-
reporter.log(logObj, {
|
|
317
|
-
options: this.options
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
var LogLevels, LogTypes, defu, paused = false, queue;
|
|
323
|
-
var init_core = __esm(() => {
|
|
324
|
-
LogLevels = {
|
|
325
|
-
silent: Number.NEGATIVE_INFINITY,
|
|
326
|
-
fatal: 0,
|
|
327
|
-
error: 0,
|
|
328
|
-
warn: 1,
|
|
329
|
-
log: 2,
|
|
330
|
-
info: 3,
|
|
331
|
-
success: 3,
|
|
332
|
-
fail: 3,
|
|
333
|
-
ready: 3,
|
|
334
|
-
start: 3,
|
|
335
|
-
box: 3,
|
|
336
|
-
debug: 4,
|
|
337
|
-
trace: 5,
|
|
338
|
-
verbose: Number.POSITIVE_INFINITY
|
|
339
|
-
};
|
|
340
|
-
LogTypes = {
|
|
341
|
-
silent: {
|
|
342
|
-
level: -1
|
|
343
|
-
},
|
|
344
|
-
fatal: {
|
|
345
|
-
level: LogLevels.fatal
|
|
346
|
-
},
|
|
347
|
-
error: {
|
|
348
|
-
level: LogLevels.error
|
|
349
|
-
},
|
|
350
|
-
warn: {
|
|
351
|
-
level: LogLevels.warn
|
|
352
|
-
},
|
|
353
|
-
log: {
|
|
354
|
-
level: LogLevels.log
|
|
355
|
-
},
|
|
356
|
-
info: {
|
|
357
|
-
level: LogLevels.info
|
|
358
|
-
},
|
|
359
|
-
success: {
|
|
360
|
-
level: LogLevels.success
|
|
361
|
-
},
|
|
362
|
-
fail: {
|
|
363
|
-
level: LogLevels.fail
|
|
364
|
-
},
|
|
365
|
-
ready: {
|
|
366
|
-
level: LogLevels.info
|
|
367
|
-
},
|
|
368
|
-
start: {
|
|
369
|
-
level: LogLevels.info
|
|
370
|
-
},
|
|
371
|
-
box: {
|
|
372
|
-
level: LogLevels.info
|
|
373
|
-
},
|
|
374
|
-
debug: {
|
|
375
|
-
level: LogLevels.debug
|
|
376
|
-
},
|
|
377
|
-
trace: {
|
|
378
|
-
level: LogLevels.trace
|
|
379
|
-
},
|
|
380
|
-
verbose: {
|
|
381
|
-
level: LogLevels.verbose
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
defu = createDefu();
|
|
385
|
-
queue = [];
|
|
386
|
-
Consola.prototype.add = Consola.prototype.addReporter;
|
|
387
|
-
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
388
|
-
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
389
|
-
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
390
|
-
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
391
|
-
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
392
|
-
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
// ../../../../node_modules/consola/dist/shared/consola.06ad8a64.mjs
|
|
396
|
-
import {formatWithOptions} from "util";
|
|
397
|
-
import {sep} from "path";
|
|
398
|
-
function parseStack(stack) {
|
|
399
|
-
const cwd = process.cwd() + sep;
|
|
400
|
-
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
401
|
-
return lines;
|
|
402
|
-
}
|
|
403
|
-
function writeStream(data, stream) {
|
|
404
|
-
const write = stream.__write || stream.write;
|
|
405
|
-
return write.call(stream, data);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
class BasicReporter {
|
|
409
|
-
formatStack(stack, opts) {
|
|
410
|
-
return " " + parseStack(stack).join("\n ");
|
|
411
|
-
}
|
|
412
|
-
formatArgs(args, opts) {
|
|
413
|
-
const _args = args.map((arg) => {
|
|
414
|
-
if (arg && typeof arg.stack === "string") {
|
|
415
|
-
return arg.message + "\n" + this.formatStack(arg.stack, opts);
|
|
416
|
-
}
|
|
417
|
-
return arg;
|
|
418
|
-
});
|
|
419
|
-
return formatWithOptions(opts, ..._args);
|
|
420
|
-
}
|
|
421
|
-
formatDate(date, opts) {
|
|
422
|
-
return opts.date ? date.toLocaleTimeString() : "";
|
|
423
|
-
}
|
|
424
|
-
filterAndJoin(arr) {
|
|
425
|
-
return arr.filter(Boolean).join(" ");
|
|
426
|
-
}
|
|
427
|
-
formatLogObj(logObj, opts) {
|
|
428
|
-
const message = this.formatArgs(logObj.args, opts);
|
|
429
|
-
if (logObj.type === "box") {
|
|
430
|
-
return "\n" + [
|
|
431
|
-
bracket(logObj.tag),
|
|
432
|
-
logObj.title && logObj.title,
|
|
433
|
-
...message.split("\n")
|
|
434
|
-
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
|
|
435
|
-
}
|
|
436
|
-
return this.filterAndJoin([
|
|
437
|
-
bracket(logObj.type),
|
|
438
|
-
bracket(logObj.tag),
|
|
439
|
-
message
|
|
440
|
-
]);
|
|
441
|
-
}
|
|
442
|
-
log(logObj, ctx) {
|
|
443
|
-
const line = this.formatLogObj(logObj, {
|
|
444
|
-
columns: ctx.options.stdout.columns || 0,
|
|
445
|
-
...ctx.options.formatOptions
|
|
446
|
-
});
|
|
447
|
-
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
var bracket = (x) => x ? `[${x}]` : "";
|
|
451
|
-
var init_consola_06ad8a64 = () => {
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
// ../../../../node_modules/consola/dist/utils.mjs
|
|
455
|
-
import * as tty from "tty";
|
|
456
|
-
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
457
|
-
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
458
|
-
}
|
|
459
|
-
function clearBleed(index, string, open, close, replace) {
|
|
460
|
-
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
461
|
-
}
|
|
462
|
-
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
463
|
-
return (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
464
|
-
}
|
|
465
|
-
function init(open, close, replace) {
|
|
466
|
-
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
467
|
-
}
|
|
468
|
-
function createColors(useColor = isColorSupported) {
|
|
469
|
-
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
470
|
-
}
|
|
471
|
-
function getColor(color, fallback = "reset") {
|
|
472
|
-
return colors[color] || colors[fallback];
|
|
473
|
-
}
|
|
474
|
-
function stripAnsi(text) {
|
|
475
|
-
return text.replace(new RegExp(ansiRegex, "g"), "");
|
|
476
|
-
}
|
|
477
|
-
function box(text, _opts = {}) {
|
|
478
|
-
const opts = {
|
|
479
|
-
..._opts,
|
|
480
|
-
style: {
|
|
481
|
-
...defaultStyle,
|
|
482
|
-
..._opts.style
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
const textLines = text.split("\n");
|
|
486
|
-
const boxLines = [];
|
|
487
|
-
const _color = getColor(opts.style.borderColor);
|
|
488
|
-
const borderStyle = {
|
|
489
|
-
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
490
|
-
};
|
|
491
|
-
if (_color) {
|
|
492
|
-
for (const key in borderStyle) {
|
|
493
|
-
borderStyle[key] = _color(borderStyle[key]);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
497
|
-
const height = textLines.length + paddingOffset;
|
|
498
|
-
const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
|
|
499
|
-
const widthOffset = width + paddingOffset;
|
|
500
|
-
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
501
|
-
if (opts.style.marginTop > 0) {
|
|
502
|
-
boxLines.push("".repeat(opts.style.marginTop));
|
|
503
|
-
}
|
|
504
|
-
if (opts.title) {
|
|
505
|
-
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
|
|
506
|
-
const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
|
|
507
|
-
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
|
|
508
|
-
} else {
|
|
509
|
-
boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
510
|
-
}
|
|
511
|
-
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
512
|
-
for (let i = 0;i < height; i++) {
|
|
513
|
-
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
514
|
-
boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
|
|
515
|
-
} else {
|
|
516
|
-
const line = textLines[i - valignOffset];
|
|
517
|
-
const left = " ".repeat(paddingOffset);
|
|
518
|
-
const right = " ".repeat(width - stripAnsi(line).length);
|
|
519
|
-
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
523
|
-
if (opts.style.marginBottom > 0) {
|
|
524
|
-
boxLines.push("".repeat(opts.style.marginBottom));
|
|
525
|
-
}
|
|
526
|
-
return boxLines.join("\n");
|
|
527
|
-
}
|
|
528
|
-
var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex, boxStylePresets, defaultStyle;
|
|
529
|
-
var init_utils = __esm(() => {
|
|
530
|
-
({
|
|
531
|
-
env = {},
|
|
532
|
-
argv = [],
|
|
533
|
-
platform = ""
|
|
534
|
-
} = typeof process === "undefined" ? {} : process);
|
|
535
|
-
isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
536
|
-
isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
537
|
-
isWindows = platform === "win32";
|
|
538
|
-
isDumbTerminal = env.TERM === "dumb";
|
|
539
|
-
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
540
|
-
isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
|
|
541
|
-
isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
542
|
-
colorDefs = {
|
|
543
|
-
reset: init(0, 0),
|
|
544
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
545
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
546
|
-
italic: init(3, 23),
|
|
547
|
-
underline: init(4, 24),
|
|
548
|
-
inverse: init(7, 27),
|
|
549
|
-
hidden: init(8, 28),
|
|
550
|
-
strikethrough: init(9, 29),
|
|
551
|
-
black: init(30, 39),
|
|
552
|
-
red: init(31, 39),
|
|
553
|
-
green: init(32, 39),
|
|
554
|
-
yellow: init(33, 39),
|
|
555
|
-
blue: init(34, 39),
|
|
556
|
-
magenta: init(35, 39),
|
|
557
|
-
cyan: init(36, 39),
|
|
558
|
-
white: init(37, 39),
|
|
559
|
-
gray: init(90, 39),
|
|
560
|
-
bgBlack: init(40, 49),
|
|
561
|
-
bgRed: init(41, 49),
|
|
562
|
-
bgGreen: init(42, 49),
|
|
563
|
-
bgYellow: init(43, 49),
|
|
564
|
-
bgBlue: init(44, 49),
|
|
565
|
-
bgMagenta: init(45, 49),
|
|
566
|
-
bgCyan: init(46, 49),
|
|
567
|
-
bgWhite: init(47, 49),
|
|
568
|
-
blackBright: init(90, 39),
|
|
569
|
-
redBright: init(91, 39),
|
|
570
|
-
greenBright: init(92, 39),
|
|
571
|
-
yellowBright: init(93, 39),
|
|
572
|
-
blueBright: init(94, 39),
|
|
573
|
-
magentaBright: init(95, 39),
|
|
574
|
-
cyanBright: init(96, 39),
|
|
575
|
-
whiteBright: init(97, 39),
|
|
576
|
-
bgBlackBright: init(100, 49),
|
|
577
|
-
bgRedBright: init(101, 49),
|
|
578
|
-
bgGreenBright: init(102, 49),
|
|
579
|
-
bgYellowBright: init(103, 49),
|
|
580
|
-
bgBlueBright: init(104, 49),
|
|
581
|
-
bgMagentaBright: init(105, 49),
|
|
582
|
-
bgCyanBright: init(106, 49),
|
|
583
|
-
bgWhiteBright: init(107, 49)
|
|
584
|
-
};
|
|
585
|
-
colors = createColors();
|
|
586
|
-
ansiRegex = [
|
|
587
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
588
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
|
|
589
|
-
].join("|");
|
|
590
|
-
boxStylePresets = {
|
|
591
|
-
solid: {
|
|
592
|
-
tl: "\u250C",
|
|
593
|
-
tr: "\u2510",
|
|
594
|
-
bl: "\u2514",
|
|
595
|
-
br: "\u2518",
|
|
596
|
-
h: "\u2500",
|
|
597
|
-
v: "\u2502"
|
|
598
|
-
},
|
|
599
|
-
double: {
|
|
600
|
-
tl: "\u2554",
|
|
601
|
-
tr: "\u2557",
|
|
602
|
-
bl: "\u255A",
|
|
603
|
-
br: "\u255D",
|
|
604
|
-
h: "\u2550",
|
|
605
|
-
v: "\u2551"
|
|
606
|
-
},
|
|
607
|
-
doubleSingle: {
|
|
608
|
-
tl: "\u2553",
|
|
609
|
-
tr: "\u2556",
|
|
610
|
-
bl: "\u2559",
|
|
611
|
-
br: "\u255C",
|
|
612
|
-
h: "\u2500",
|
|
613
|
-
v: "\u2551"
|
|
614
|
-
},
|
|
615
|
-
doubleSingleRounded: {
|
|
616
|
-
tl: "\u256D",
|
|
617
|
-
tr: "\u256E",
|
|
618
|
-
bl: "\u2570",
|
|
619
|
-
br: "\u256F",
|
|
620
|
-
h: "\u2500",
|
|
621
|
-
v: "\u2551"
|
|
622
|
-
},
|
|
623
|
-
singleThick: {
|
|
624
|
-
tl: "\u250F",
|
|
625
|
-
tr: "\u2513",
|
|
626
|
-
bl: "\u2517",
|
|
627
|
-
br: "\u251B",
|
|
628
|
-
h: "\u2501",
|
|
629
|
-
v: "\u2503"
|
|
630
|
-
},
|
|
631
|
-
singleDouble: {
|
|
632
|
-
tl: "\u2552",
|
|
633
|
-
tr: "\u2555",
|
|
634
|
-
bl: "\u2558",
|
|
635
|
-
br: "\u255B",
|
|
636
|
-
h: "\u2550",
|
|
637
|
-
v: "\u2502"
|
|
638
|
-
},
|
|
639
|
-
singleDoubleRounded: {
|
|
640
|
-
tl: "\u256D",
|
|
641
|
-
tr: "\u256E",
|
|
642
|
-
bl: "\u2570",
|
|
643
|
-
br: "\u256F",
|
|
644
|
-
h: "\u2550",
|
|
645
|
-
v: "\u2502"
|
|
646
|
-
},
|
|
647
|
-
rounded: {
|
|
648
|
-
tl: "\u256D",
|
|
649
|
-
tr: "\u256E",
|
|
650
|
-
bl: "\u2570",
|
|
651
|
-
br: "\u256F",
|
|
652
|
-
h: "\u2500",
|
|
653
|
-
v: "\u2502"
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
defaultStyle = {
|
|
657
|
-
borderColor: "white",
|
|
658
|
-
borderStyle: "rounded",
|
|
659
|
-
valign: "center",
|
|
660
|
-
padding: 2,
|
|
661
|
-
marginLeft: 1,
|
|
662
|
-
marginTop: 1,
|
|
663
|
-
marginBottom: 1
|
|
664
|
-
};
|
|
665
|
-
});
|
|
666
|
-
|
|
667
|
-
// ../../../../node_modules/consola/dist/chunks/prompt.mjs
|
|
668
|
-
var exports_prompt = {};
|
|
669
|
-
__export(exports_prompt, {
|
|
670
|
-
prompt: () => prompt
|
|
671
|
-
});
|
|
672
|
-
import {stdin, stdout} from "process";
|
|
673
|
-
import f from "readline";
|
|
674
|
-
import {WriteStream} from "tty";
|
|
675
|
-
import require$$0 from "tty";
|
|
676
|
-
function z({ onlyFirst: t = false } = {}) {
|
|
677
|
-
const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
678
|
-
return new RegExp(u, t ? undefined : "g");
|
|
679
|
-
}
|
|
680
|
-
function $(t) {
|
|
681
|
-
if (typeof t != "string")
|
|
682
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
683
|
-
return t.replace(z(), "");
|
|
684
|
-
}
|
|
685
|
-
function c(t, u = {}) {
|
|
686
|
-
if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0))
|
|
687
|
-
return 0;
|
|
688
|
-
t = t.replace(Y(), " ");
|
|
689
|
-
const F = u.ambiguousIsNarrow ? 1 : 2;
|
|
690
|
-
let e = 0;
|
|
691
|
-
for (const s of t) {
|
|
692
|
-
const C = s.codePointAt(0);
|
|
693
|
-
if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
|
|
694
|
-
continue;
|
|
695
|
-
switch (K.eastAsianWidth(s)) {
|
|
696
|
-
case "F":
|
|
697
|
-
case "W":
|
|
698
|
-
e += 2;
|
|
699
|
-
break;
|
|
700
|
-
case "A":
|
|
701
|
-
e += F;
|
|
702
|
-
break;
|
|
703
|
-
default:
|
|
704
|
-
e += 1;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
return e;
|
|
708
|
-
}
|
|
709
|
-
function U() {
|
|
710
|
-
const t = new Map;
|
|
711
|
-
for (const [u, F] of Object.entries(r)) {
|
|
712
|
-
for (const [e, s] of Object.entries(F))
|
|
713
|
-
r[e] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e] = r[e], t.set(s[0], s[1]);
|
|
714
|
-
Object.defineProperty(r, u, { value: F, enumerable: false });
|
|
715
|
-
}
|
|
716
|
-
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 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
|
|
717
|
-
const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
718
|
-
if (!F)
|
|
719
|
-
return [0, 0, 0];
|
|
720
|
-
let [e] = F;
|
|
721
|
-
e.length === 3 && (e = [...e].map((C) => C + C).join(""));
|
|
722
|
-
const s = Number.parseInt(e, 16);
|
|
723
|
-
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
724
|
-
}, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
|
|
725
|
-
if (u < 8)
|
|
726
|
-
return 30 + u;
|
|
727
|
-
if (u < 16)
|
|
728
|
-
return 90 + (u - 8);
|
|
729
|
-
let F, e, s;
|
|
730
|
-
if (u >= 232)
|
|
731
|
-
F = ((u - 232) * 10 + 8) / 255, e = F, s = F;
|
|
732
|
-
else {
|
|
733
|
-
u -= 16;
|
|
734
|
-
const i = u % 36;
|
|
735
|
-
F = Math.floor(u / 36) / 5, e = Math.floor(i / 6) / 5, s = i % 6 / 5;
|
|
736
|
-
}
|
|
737
|
-
const C = Math.max(F, e, s) * 2;
|
|
738
|
-
if (C === 0)
|
|
739
|
-
return 30;
|
|
740
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(e) << 1 | Math.round(F));
|
|
741
|
-
return C === 2 && (D += 60), D;
|
|
742
|
-
}, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
|
|
743
|
-
}
|
|
744
|
-
function P(t, u, F) {
|
|
745
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
746
|
-
`).split(`
|
|
747
|
-
`).map((e) => uD(e, u, F)).join(`
|
|
748
|
-
`);
|
|
749
|
-
}
|
|
750
|
-
function FD(t, u) {
|
|
751
|
-
if (t === u)
|
|
752
|
-
return;
|
|
753
|
-
const F = t.split(`
|
|
754
|
-
`), e = u.split(`
|
|
755
|
-
`), s = [];
|
|
756
|
-
for (let C = 0;C < Math.max(F.length, e.length); C++)
|
|
757
|
-
F[C] !== e[C] && s.push(C);
|
|
758
|
-
return s;
|
|
759
|
-
}
|
|
760
|
-
function g(t, u) {
|
|
761
|
-
t.isTTY && t.setRawMode(u);
|
|
762
|
-
}
|
|
763
|
-
async function prompt(message, opts = {}) {
|
|
764
|
-
if (!opts.type || opts.type === "text") {
|
|
765
|
-
return await text({
|
|
766
|
-
message,
|
|
767
|
-
defaultValue: opts.default,
|
|
768
|
-
placeholder: opts.placeholder,
|
|
769
|
-
initialValue: opts.initial
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
if (opts.type === "confirm") {
|
|
773
|
-
return await confirm({
|
|
774
|
-
message,
|
|
775
|
-
initialValue: opts.initial
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
if (opts.type === "select") {
|
|
779
|
-
return await select({
|
|
780
|
-
message,
|
|
781
|
-
options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o)
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
if (opts.type === "multiselect") {
|
|
785
|
-
return await multiselect({
|
|
786
|
-
message,
|
|
787
|
-
options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o),
|
|
788
|
-
required: opts.required
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
throw new Error(`Unknown prompt type: ${opts.type}`);
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
class h {
|
|
795
|
-
constructor({ render: u, input: F = stdin, output: e = stdout, ...s }, C = true) {
|
|
796
|
-
this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = new Map, this._prevFrame = "", this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
|
|
797
|
-
}
|
|
798
|
-
prompt() {
|
|
799
|
-
const u = new WriteStream(0);
|
|
800
|
-
return u._write = (F, e, s) => {
|
|
801
|
-
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
|
|
802
|
-
}, this.input.pipe(u), this.rl = f.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
|
|
803
|
-
this.once("submit", () => {
|
|
804
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(this.value);
|
|
805
|
-
}), this.once("cancel", () => {
|
|
806
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(R);
|
|
807
|
-
});
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
on(u, F) {
|
|
811
|
-
const e = this.subscribers.get(u) ?? [];
|
|
812
|
-
e.push({ cb: F }), this.subscribers.set(u, e);
|
|
813
|
-
}
|
|
814
|
-
once(u, F) {
|
|
815
|
-
const e = this.subscribers.get(u) ?? [];
|
|
816
|
-
e.push({ cb: F, once: true }), this.subscribers.set(u, e);
|
|
817
|
-
}
|
|
818
|
-
emit(u, ...F) {
|
|
819
|
-
const e = this.subscribers.get(u) ?? [], s = [];
|
|
820
|
-
for (const C of e)
|
|
821
|
-
C.cb(...F), C.once && s.push(() => e.splice(e.indexOf(C), 1));
|
|
822
|
-
for (const C of s)
|
|
823
|
-
C();
|
|
824
|
-
}
|
|
825
|
-
unsubscribe() {
|
|
826
|
-
this.subscribers.clear();
|
|
827
|
-
}
|
|
828
|
-
onKeypress(u, F) {
|
|
829
|
-
if (this.state === "error" && (this.state = "active"), F?.name && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), F?.name && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
|
|
830
|
-
if (this.opts.validate) {
|
|
831
|
-
const e = this.opts.validate(this.value);
|
|
832
|
-
e && (this.error = e, this.state = "error", this.rl.write(this.value));
|
|
833
|
-
}
|
|
834
|
-
this.state !== "error" && (this.state = "submit");
|
|
835
|
-
}
|
|
836
|
-
u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
837
|
-
}
|
|
838
|
-
close() {
|
|
839
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
840
|
-
`), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
841
|
-
}
|
|
842
|
-
restoreCursor() {
|
|
843
|
-
const u = P(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
844
|
-
`).length - 1;
|
|
845
|
-
this.output.write(src.cursor.move(-999, u * -1));
|
|
846
|
-
}
|
|
847
|
-
render() {
|
|
848
|
-
const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
849
|
-
if (u !== this._prevFrame) {
|
|
850
|
-
if (this.state === "initial")
|
|
851
|
-
this.output.write(src.cursor.hide);
|
|
852
|
-
else {
|
|
853
|
-
const F = FD(this._prevFrame, u);
|
|
854
|
-
if (this.restoreCursor(), F && F?.length === 1) {
|
|
855
|
-
const e = F[0];
|
|
856
|
-
this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.lines(1));
|
|
857
|
-
const s = u.split(`
|
|
858
|
-
`);
|
|
859
|
-
this.output.write(s[e]), this._prevFrame = u, this.output.write(src.cursor.move(0, s.length - e - 1));
|
|
860
|
-
return;
|
|
861
|
-
} else if (F && F?.length > 1) {
|
|
862
|
-
const e = F[0];
|
|
863
|
-
this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.down());
|
|
864
|
-
const C = u.split(`
|
|
865
|
-
`).slice(e);
|
|
866
|
-
this.output.write(C.join(`
|
|
867
|
-
`)), this._prevFrame = u;
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
this.output.write(src.erase.down());
|
|
871
|
-
}
|
|
872
|
-
this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
var ESC = "\x1B", CSI, beep = "\x07", cursor, scroll, erase, src, picocolors, tty2, isColorSupported2, formatter = (open, close, replace = open) => (input) => {
|
|
877
|
-
let string = "" + input;
|
|
878
|
-
let index = string.indexOf(close, open.length);
|
|
879
|
-
return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
|
|
880
|
-
}, replaceClose2 = (string, close, replace, index) => {
|
|
881
|
-
let start = string.substring(0, index) + replace;
|
|
882
|
-
let end = string.substring(index + close.length);
|
|
883
|
-
let nextIndex = end.indexOf(close);
|
|
884
|
-
return ~nextIndex ? start + replaceClose2(end, close, replace, nextIndex) : start + end;
|
|
885
|
-
}, createColors2 = (enabled = isColorSupported2) => ({
|
|
886
|
-
isColorSupported: enabled,
|
|
887
|
-
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
888
|
-
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
889
|
-
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
890
|
-
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
891
|
-
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
892
|
-
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
893
|
-
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
894
|
-
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
895
|
-
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
896
|
-
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
897
|
-
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
898
|
-
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
899
|
-
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
900
|
-
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
901
|
-
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
902
|
-
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
903
|
-
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
904
|
-
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
905
|
-
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
906
|
-
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
907
|
-
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
908
|
-
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
909
|
-
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
910
|
-
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
911
|
-
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
912
|
-
}), picocolorsExports, l, m, G, K, Y = function() {
|
|
913
|
-
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;
|
|
914
|
-
}, v = 10, L = (t = 0) => (u) => `\x1B[${u + t}m`, M = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`, T = (t = 0) => (u, F, e) => `\x1B[${38 + t};2;${u};${F};${e}m`, r, Z, H, q, p, J = 39, b = "\x07", W = "[", Q = "]", I = "m", w, N = (t) => `${p.values().next().value}${W}${t}${I}`, j = (t) => `${p.values().next().value}${w}${t}${b}`, X = (t) => t.split(" ").map((u) => c(u)), _ = (t, u, F) => {
|
|
915
|
-
const e = [...u];
|
|
916
|
-
let s = false, C = false, D = c($(t[t.length - 1]));
|
|
917
|
-
for (const [i, o] of e.entries()) {
|
|
918
|
-
const E = c(o);
|
|
919
|
-
if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), p.has(o) && (s = true, C = e.slice(i + 1).join("").startsWith(w)), s) {
|
|
920
|
-
C ? o === b && (s = false, C = false) : o === I && (s = false);
|
|
921
|
-
continue;
|
|
922
|
-
}
|
|
923
|
-
D += E, D === F && i < e.length - 1 && (t.push(""), D = 0);
|
|
924
|
-
}
|
|
925
|
-
!D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
926
|
-
}, DD = (t) => {
|
|
927
|
-
const u = t.split(" ");
|
|
928
|
-
let F = u.length;
|
|
929
|
-
for (;F > 0 && !(c(u[F - 1]) > 0); )
|
|
930
|
-
F--;
|
|
931
|
-
return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
|
|
932
|
-
}, uD = (t, u, F = {}) => {
|
|
933
|
-
if (F.trim !== false && t.trim() === "")
|
|
934
|
-
return "";
|
|
935
|
-
let e = "", s, C;
|
|
936
|
-
const D = X(t);
|
|
937
|
-
let i = [""];
|
|
938
|
-
for (const [E, a] of t.split(" ").entries()) {
|
|
939
|
-
F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
|
|
940
|
-
let n = c(i[i.length - 1]);
|
|
941
|
-
if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), n = 0), (n > 0 || F.trim === false) && (i[i.length - 1] += " ", n++)), F.hard && D[E] > u) {
|
|
942
|
-
const B = u - n, A = 1 + Math.floor((D[E] - B - 1) / u);
|
|
943
|
-
Math.floor((D[E] - 1) / u) < A && i.push(""), _(i, a, u);
|
|
944
|
-
continue;
|
|
945
|
-
}
|
|
946
|
-
if (n + D[E] > u && n > 0 && D[E] > 0) {
|
|
947
|
-
if (F.wordWrap === false && n < u) {
|
|
948
|
-
_(i, a, u);
|
|
949
|
-
continue;
|
|
950
|
-
}
|
|
951
|
-
i.push("");
|
|
952
|
-
}
|
|
953
|
-
if (n + D[E] > u && F.wordWrap === false) {
|
|
954
|
-
_(i, a, u);
|
|
955
|
-
continue;
|
|
956
|
-
}
|
|
957
|
-
i[i.length - 1] += a;
|
|
958
|
-
}
|
|
959
|
-
F.trim !== false && (i = i.map((E) => DD(E)));
|
|
960
|
-
const o = [...i.join(`
|
|
961
|
-
`)];
|
|
962
|
-
for (const [E, a] of o.entries()) {
|
|
963
|
-
if (e += a, p.has(a)) {
|
|
964
|
-
const { groups: B } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(o.slice(E).join("")) || { groups: {} };
|
|
965
|
-
if (B.code !== undefined) {
|
|
966
|
-
const A = Number.parseFloat(B.code);
|
|
967
|
-
s = A === J ? undefined : A;
|
|
968
|
-
} else
|
|
969
|
-
B.uri !== undefined && (C = B.uri.length === 0 ? undefined : B.uri);
|
|
970
|
-
}
|
|
971
|
-
const n = q.codes.get(Number(s));
|
|
972
|
-
o[E + 1] === `
|
|
973
|
-
` ? (C && (e += j("")), s && n && (e += N(n))) : a === `
|
|
974
|
-
` && (s && n && (e += N(s)), C && (e += j(C)));
|
|
975
|
-
}
|
|
976
|
-
return e;
|
|
977
|
-
}, R, V, tD, sD, iD, ED, oD, unicode, s = (c2, fallback) => unicode ? c2 : fallback, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR = "", S_BAR_END = "", S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, symbol = (state) => {
|
|
978
|
-
switch (state) {
|
|
979
|
-
case "initial":
|
|
980
|
-
case "active": {
|
|
981
|
-
return colors.cyan(S_STEP_ACTIVE);
|
|
982
|
-
}
|
|
983
|
-
case "cancel": {
|
|
984
|
-
return colors.red(S_STEP_CANCEL);
|
|
985
|
-
}
|
|
986
|
-
case "error": {
|
|
987
|
-
return colors.yellow(S_STEP_ERROR);
|
|
988
|
-
}
|
|
989
|
-
case "submit": {
|
|
990
|
-
return colors.green(S_STEP_SUBMIT);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
}, text = (opts) => {
|
|
994
|
-
return new oD({
|
|
995
|
-
validate: opts.validate,
|
|
996
|
-
placeholder: opts.placeholder,
|
|
997
|
-
defaultValue: opts.defaultValue,
|
|
998
|
-
initialValue: opts.initialValue,
|
|
999
|
-
render() {
|
|
1000
|
-
const title = `${colors.gray(S_BAR)}
|
|
1001
|
-
${symbol(this.state)} ${opts.message}
|
|
1002
|
-
`;
|
|
1003
|
-
const placeholder = opts.placeholder ? colors.inverse(opts.placeholder[0]) + colors.dim(opts.placeholder.slice(1)) : colors.inverse(colors.hidden("_"));
|
|
1004
|
-
const value = this.value ? this.valueWithCursor : placeholder;
|
|
1005
|
-
switch (this.state) {
|
|
1006
|
-
case "error": {
|
|
1007
|
-
return `${title.trim()}
|
|
1008
|
-
${colors.yellow(S_BAR)} ${value}
|
|
1009
|
-
${colors.yellow(S_BAR_END)} ${colors.yellow(this.error)}
|
|
1010
|
-
`;
|
|
1011
|
-
}
|
|
1012
|
-
case "submit": {
|
|
1013
|
-
return `${title}${colors.gray(S_BAR)} ${colors.dim(this.value || opts.placeholder)}`;
|
|
1014
|
-
}
|
|
1015
|
-
case "cancel": {
|
|
1016
|
-
return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(this.value ?? ""))}${this.value?.trim() ? "\n" + colors.gray(S_BAR) : ""}`;
|
|
1017
|
-
}
|
|
1018
|
-
default: {
|
|
1019
|
-
return `${title}${colors.cyan(S_BAR)} ${value}
|
|
1020
|
-
${colors.cyan(S_BAR_END)}
|
|
1021
|
-
`;
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
}).prompt();
|
|
1026
|
-
}, confirm = (opts) => {
|
|
1027
|
-
const active = opts.active ?? "Yes";
|
|
1028
|
-
const inactive = opts.inactive ?? "No";
|
|
1029
|
-
return new sD({
|
|
1030
|
-
active,
|
|
1031
|
-
inactive,
|
|
1032
|
-
initialValue: opts.initialValue ?? true,
|
|
1033
|
-
render() {
|
|
1034
|
-
const title = `${colors.gray(S_BAR)}
|
|
1035
|
-
${symbol(this.state)} ${opts.message}
|
|
1036
|
-
`;
|
|
1037
|
-
const value = this.value ? active : inactive;
|
|
1038
|
-
switch (this.state) {
|
|
1039
|
-
case "submit": {
|
|
1040
|
-
return `${title}${colors.gray(S_BAR)} ${colors.dim(value)}`;
|
|
1041
|
-
}
|
|
1042
|
-
case "cancel": {
|
|
1043
|
-
return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(value))}
|
|
1044
|
-
${colors.gray(S_BAR)}`;
|
|
1045
|
-
}
|
|
1046
|
-
default: {
|
|
1047
|
-
return `${title}${colors.cyan(S_BAR)} ${this.value ? `${colors.green(S_RADIO_ACTIVE)} ${active}` : `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(active)}`} ${colors.dim("/")} ${this.value ? `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(inactive)}` : `${colors.green(S_RADIO_ACTIVE)} ${inactive}`}
|
|
1048
|
-
${colors.cyan(S_BAR_END)}
|
|
1049
|
-
`;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}).prompt();
|
|
1054
|
-
}, select = (opts) => {
|
|
1055
|
-
const opt = (option, state) => {
|
|
1056
|
-
const label = option.label ?? String(option.value);
|
|
1057
|
-
switch (state) {
|
|
1058
|
-
case "active": {
|
|
1059
|
-
return `${colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
|
|
1060
|
-
}
|
|
1061
|
-
case "selected": {
|
|
1062
|
-
return `${colors.dim(label)}`;
|
|
1063
|
-
}
|
|
1064
|
-
case "cancelled": {
|
|
1065
|
-
return `${colors.strikethrough(colors.dim(label))}`;
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
return `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(label)}`;
|
|
1069
|
-
};
|
|
1070
|
-
return new ED({
|
|
1071
|
-
options: opts.options,
|
|
1072
|
-
initialValue: opts.initialValue,
|
|
1073
|
-
render() {
|
|
1074
|
-
const title = `${colors.gray(S_BAR)}
|
|
1075
|
-
${symbol(this.state)} ${opts.message}
|
|
1076
|
-
`;
|
|
1077
|
-
switch (this.state) {
|
|
1078
|
-
case "submit": {
|
|
1079
|
-
return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "selected")}`;
|
|
1080
|
-
}
|
|
1081
|
-
case "cancel": {
|
|
1082
|
-
return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "cancelled")}
|
|
1083
|
-
${colors.gray(S_BAR)}`;
|
|
1084
|
-
}
|
|
1085
|
-
default: {
|
|
1086
|
-
return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => opt(option, i === this.cursor ? "active" : "inactive")).join(`
|
|
1087
|
-
${colors.cyan(S_BAR)} `)}
|
|
1088
|
-
${colors.cyan(S_BAR_END)}
|
|
1089
|
-
`;
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}).prompt();
|
|
1094
|
-
}, multiselect = (opts) => {
|
|
1095
|
-
const opt = (option, state) => {
|
|
1096
|
-
const label = option.label ?? String(option.value);
|
|
1097
|
-
switch (state) {
|
|
1098
|
-
case "active": {
|
|
1099
|
-
return `${colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
|
|
1100
|
-
}
|
|
1101
|
-
case "selected": {
|
|
1102
|
-
return `${colors.green(S_CHECKBOX_SELECTED)} ${colors.dim(label)}`;
|
|
1103
|
-
}
|
|
1104
|
-
case "cancelled": {
|
|
1105
|
-
return `${colors.strikethrough(colors.dim(label))}`;
|
|
1106
|
-
}
|
|
1107
|
-
case "active-selected": {
|
|
1108
|
-
return `${colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
|
|
1109
|
-
}
|
|
1110
|
-
case "submitted": {
|
|
1111
|
-
return `${colors.dim(label)}`;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
return `${colors.dim(S_CHECKBOX_INACTIVE)} ${colors.dim(label)}`;
|
|
1115
|
-
};
|
|
1116
|
-
return new iD({
|
|
1117
|
-
options: opts.options,
|
|
1118
|
-
initialValues: opts.initialValues,
|
|
1119
|
-
required: opts.required ?? true,
|
|
1120
|
-
cursorAt: opts.cursorAt,
|
|
1121
|
-
validate(selected) {
|
|
1122
|
-
if (this.required && selected.length === 0) {
|
|
1123
|
-
return `Please select at least one option.
|
|
1124
|
-
${colors.reset(colors.dim(`Press ${colors.gray(colors.bgWhite(colors.inverse(" space ")))} to select, ${colors.gray(colors.bgWhite(colors.inverse(" enter ")))} to submit`))}`;
|
|
1125
|
-
}
|
|
1126
|
-
},
|
|
1127
|
-
render() {
|
|
1128
|
-
const title = `${colors.gray(S_BAR)}
|
|
1129
|
-
${symbol(this.state)} ${opts.message}
|
|
1130
|
-
`;
|
|
1131
|
-
switch (this.state) {
|
|
1132
|
-
case "submit": {
|
|
1133
|
-
return `${title}${colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(colors.dim(", ")) || colors.dim("none")}`;
|
|
1134
|
-
}
|
|
1135
|
-
case "cancel": {
|
|
1136
|
-
const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(colors.dim(", "));
|
|
1137
|
-
return `${title}${colors.gray(S_BAR)} ${label.trim() ? `${label}
|
|
1138
|
-
${colors.gray(S_BAR)}` : ""}`;
|
|
1139
|
-
}
|
|
1140
|
-
case "error": {
|
|
1141
|
-
const footer = this.error.split("\n").map((ln, i) => i === 0 ? `${colors.yellow(S_BAR_END)} ${colors.yellow(ln)}` : ` ${ln}`).join("\n");
|
|
1142
|
-
return title + colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
|
|
1143
|
-
const selected = this.value.includes(option.value);
|
|
1144
|
-
const active = i === this.cursor;
|
|
1145
|
-
if (active && selected) {
|
|
1146
|
-
return opt(option, "active-selected");
|
|
1147
|
-
}
|
|
1148
|
-
if (selected) {
|
|
1149
|
-
return opt(option, "selected");
|
|
1150
|
-
}
|
|
1151
|
-
return opt(option, active ? "active" : "inactive");
|
|
1152
|
-
}).join(`
|
|
1153
|
-
${colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
|
|
1154
|
-
}
|
|
1155
|
-
default: {
|
|
1156
|
-
return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => {
|
|
1157
|
-
const selected = this.value.includes(option.value);
|
|
1158
|
-
const active = i === this.cursor;
|
|
1159
|
-
if (active && selected) {
|
|
1160
|
-
return opt(option, "active-selected");
|
|
1161
|
-
}
|
|
1162
|
-
if (selected) {
|
|
1163
|
-
return opt(option, "selected");
|
|
1164
|
-
}
|
|
1165
|
-
return opt(option, active ? "active" : "inactive");
|
|
1166
|
-
}).join(`
|
|
1167
|
-
${colors.cyan(S_BAR)} `)}
|
|
1168
|
-
${colors.cyan(S_BAR_END)}
|
|
1169
|
-
`;
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
}).prompt();
|
|
1174
|
-
};
|
|
1175
|
-
var init_prompt = __esm(() => {
|
|
1176
|
-
init_consola_36c0034f();
|
|
1177
|
-
init_utils();
|
|
1178
|
-
init_core();
|
|
1179
|
-
init_consola_06ad8a64();
|
|
1180
|
-
CSI = `${ESC}[`;
|
|
1181
|
-
cursor = {
|
|
1182
|
-
to(x, y) {
|
|
1183
|
-
if (!y)
|
|
1184
|
-
return `${CSI}${x + 1}G`;
|
|
1185
|
-
return `${CSI}${y + 1};${x + 1}H`;
|
|
1186
|
-
},
|
|
1187
|
-
move(x, y) {
|
|
1188
|
-
let ret = "";
|
|
1189
|
-
if (x < 0)
|
|
1190
|
-
ret += `${CSI}${-x}D`;
|
|
1191
|
-
else if (x > 0)
|
|
1192
|
-
ret += `${CSI}${x}C`;
|
|
1193
|
-
if (y < 0)
|
|
1194
|
-
ret += `${CSI}${-y}A`;
|
|
1195
|
-
else if (y > 0)
|
|
1196
|
-
ret += `${CSI}${y}B`;
|
|
1197
|
-
return ret;
|
|
1198
|
-
},
|
|
1199
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
1200
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
1201
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
1202
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
1203
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
1204
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
1205
|
-
left: `${CSI}G`,
|
|
1206
|
-
hide: `${CSI}?25l`,
|
|
1207
|
-
show: `${CSI}?25h`,
|
|
1208
|
-
save: `${ESC}7`,
|
|
1209
|
-
restore: `${ESC}8`
|
|
1210
|
-
};
|
|
1211
|
-
scroll = {
|
|
1212
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
1213
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
1214
|
-
};
|
|
1215
|
-
erase = {
|
|
1216
|
-
screen: `${CSI}2J`,
|
|
1217
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
1218
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
1219
|
-
line: `${CSI}2K`,
|
|
1220
|
-
lineEnd: `${CSI}K`,
|
|
1221
|
-
lineStart: `${CSI}1K`,
|
|
1222
|
-
lines(count) {
|
|
1223
|
-
let clear = "";
|
|
1224
|
-
for (let i = 0;i < count; i++)
|
|
1225
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
1226
|
-
if (count)
|
|
1227
|
-
clear += cursor.left;
|
|
1228
|
-
return clear;
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
src = { cursor, scroll, erase, beep };
|
|
1232
|
-
picocolors = { exports: {} };
|
|
1233
|
-
tty2 = require$$0;
|
|
1234
|
-
isColorSupported2 = !(("NO_COLOR" in process.env) || process.argv.includes("--no-color")) && (("FORCE_COLOR" in process.env) || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || ("CI" in process.env));
|
|
1235
|
-
picocolors.exports = createColors2();
|
|
1236
|
-
picocolors.exports.createColors = createColors2;
|
|
1237
|
-
picocolorsExports = picocolors.exports;
|
|
1238
|
-
l = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
|
|
1239
|
-
m = {};
|
|
1240
|
-
G = { get exports() {
|
|
1241
|
-
return m;
|
|
1242
|
-
}, set exports(t) {
|
|
1243
|
-
m = t;
|
|
1244
|
-
} };
|
|
1245
|
-
(function(t) {
|
|
1246
|
-
var u = {};
|
|
1247
|
-
t.exports = u, u.eastAsianWidth = function(e) {
|
|
1248
|
-
var s = e.charCodeAt(0), C = e.length == 2 ? e.charCodeAt(1) : 0, D = s;
|
|
1249
|
-
return 55296 <= s && s <= 56319 && 56320 <= C && C <= 57343 && (s &= 1023, C &= 1023, D = s << 10 | C, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
|
|
1250
|
-
}, u.characterLength = function(e) {
|
|
1251
|
-
var s = this.eastAsianWidth(e);
|
|
1252
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
1253
|
-
};
|
|
1254
|
-
function F(e) {
|
|
1255
|
-
return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
1256
|
-
}
|
|
1257
|
-
u.length = function(e) {
|
|
1258
|
-
for (var s = F(e), C = 0, D = 0;D < s.length; D++)
|
|
1259
|
-
C = C + this.characterLength(s[D]);
|
|
1260
|
-
return C;
|
|
1261
|
-
}, u.slice = function(e, s, C) {
|
|
1262
|
-
textLen = u.length(e), s = s || 0, C = C || 1, s < 0 && (s = textLen + s), C < 0 && (C = textLen + C);
|
|
1263
|
-
for (var D = "", i = 0, o = F(e), E = 0;E < o.length; E++) {
|
|
1264
|
-
var a = o[E], n = u.length(a);
|
|
1265
|
-
if (i >= s - (n == 2 ? 1 : 0))
|
|
1266
|
-
if (i + n <= C)
|
|
1267
|
-
D += a;
|
|
1268
|
-
else
|
|
1269
|
-
break;
|
|
1270
|
-
i += n;
|
|
1271
|
-
}
|
|
1272
|
-
return D;
|
|
1273
|
-
};
|
|
1274
|
-
})(G);
|
|
1275
|
-
K = m;
|
|
1276
|
-
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] } };
|
|
1277
|
-
Object.keys(r.modifier);
|
|
1278
|
-
Z = Object.keys(r.color);
|
|
1279
|
-
H = Object.keys(r.bgColor);
|
|
1280
|
-
[...Z];
|
|
1281
|
-
q = U();
|
|
1282
|
-
p = new Set(["\x1B", "\x9B"]);
|
|
1283
|
-
w = `${Q}8;;`;
|
|
1284
|
-
R = Symbol("clack:cancel");
|
|
1285
|
-
V = new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
1286
|
-
tD = new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
1287
|
-
sD = class sD extends h {
|
|
1288
|
-
get cursor() {
|
|
1289
|
-
return this.value ? 0 : 1;
|
|
1290
|
-
}
|
|
1291
|
-
get _value() {
|
|
1292
|
-
return this.cursor === 0;
|
|
1293
|
-
}
|
|
1294
|
-
constructor(u) {
|
|
1295
|
-
super(u, false), this.value = !!u.initialValue, this.on("value", () => {
|
|
1296
|
-
this.value = this._value;
|
|
1297
|
-
}), this.on("confirm", (F) => {
|
|
1298
|
-
this.output.write(src.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
|
|
1299
|
-
}), this.on("cursor", () => {
|
|
1300
|
-
this.value = !this.value;
|
|
1301
|
-
});
|
|
1302
|
-
}
|
|
1303
|
-
};
|
|
1304
|
-
iD = class iD extends h {
|
|
1305
|
-
constructor(u) {
|
|
1306
|
-
super(u, false), this.cursor = 0, this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
|
|
1307
|
-
F === "a" && this.toggleAll();
|
|
1308
|
-
}), this.on("cursor", (F) => {
|
|
1309
|
-
switch (F) {
|
|
1310
|
-
case "left":
|
|
1311
|
-
case "up":
|
|
1312
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1313
|
-
break;
|
|
1314
|
-
case "down":
|
|
1315
|
-
case "right":
|
|
1316
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1317
|
-
break;
|
|
1318
|
-
case "space":
|
|
1319
|
-
this.toggleValue();
|
|
1320
|
-
break;
|
|
1321
|
-
}
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1324
|
-
get _value() {
|
|
1325
|
-
return this.options[this.cursor].value;
|
|
1326
|
-
}
|
|
1327
|
-
toggleAll() {
|
|
1328
|
-
const u = this.value.length === this.options.length;
|
|
1329
|
-
this.value = u ? [] : this.options.map((F) => F.value);
|
|
1330
|
-
}
|
|
1331
|
-
toggleValue() {
|
|
1332
|
-
const u = this.value.includes(this._value);
|
|
1333
|
-
this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
|
|
1334
|
-
}
|
|
1335
|
-
};
|
|
1336
|
-
ED = class ED extends h {
|
|
1337
|
-
constructor(u) {
|
|
1338
|
-
super(u, false), this.cursor = 0, this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
|
|
1339
|
-
switch (F) {
|
|
1340
|
-
case "left":
|
|
1341
|
-
case "up":
|
|
1342
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1343
|
-
break;
|
|
1344
|
-
case "down":
|
|
1345
|
-
case "right":
|
|
1346
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1347
|
-
break;
|
|
1348
|
-
}
|
|
1349
|
-
this.changeValue();
|
|
1350
|
-
});
|
|
1351
|
-
}
|
|
1352
|
-
get _value() {
|
|
1353
|
-
return this.options[this.cursor];
|
|
1354
|
-
}
|
|
1355
|
-
changeValue() {
|
|
1356
|
-
this.value = this._value.value;
|
|
1357
|
-
}
|
|
1358
|
-
};
|
|
1359
|
-
oD = class oD extends h {
|
|
1360
|
-
constructor(u) {
|
|
1361
|
-
super(u), this.valueWithCursor = "", this.on("finalize", () => {
|
|
1362
|
-
this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
|
|
1363
|
-
}), this.on("value", () => {
|
|
1364
|
-
if (this.cursor >= this.value.length)
|
|
1365
|
-
this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
|
|
1366
|
-
else {
|
|
1367
|
-
const F = this.value.slice(0, this.cursor), e = this.value.slice(this.cursor);
|
|
1368
|
-
this.valueWithCursor = `${F}${l.inverse(e[0])}${e.slice(1)}`;
|
|
1369
|
-
}
|
|
1370
|
-
});
|
|
1371
|
-
}
|
|
1372
|
-
get cursor() {
|
|
1373
|
-
return this._cursor;
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
unicode = isUnicodeSupported();
|
|
1377
|
-
S_STEP_ACTIVE = s("\u276F", ">");
|
|
1378
|
-
S_STEP_CANCEL = s("\u25A0", "x");
|
|
1379
|
-
S_STEP_ERROR = s("\u25B2", "x");
|
|
1380
|
-
S_STEP_SUBMIT = s("\u2714", "\u221A");
|
|
1381
|
-
S_RADIO_ACTIVE = s("\u25CF", ">");
|
|
1382
|
-
S_RADIO_INACTIVE = s("\u25CB", " ");
|
|
1383
|
-
S_CHECKBOX_ACTIVE = s("\u25FB", "[\u2022]");
|
|
1384
|
-
S_CHECKBOX_SELECTED = s("\u25FC", "[+]");
|
|
1385
|
-
S_CHECKBOX_INACTIVE = s("\u25FB", "[ ]");
|
|
1386
|
-
});
|
|
1387
|
-
|
|
1388
|
-
// ../../../../node_modules/consola/dist/shared/consola.36c0034f.mjs
|
|
1389
|
-
import process$1 from "process";
|
|
1390
|
-
function detectProvider(env2) {
|
|
1391
|
-
for (const provider of providers) {
|
|
1392
|
-
const envName = provider[1] || provider[0];
|
|
1393
|
-
if (env2[envName]) {
|
|
1394
|
-
return {
|
|
1395
|
-
name: provider[0].toLowerCase(),
|
|
1396
|
-
...provider[2]
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
if (env2.SHELL && env2.SHELL === "/bin/jsh") {
|
|
1401
|
-
return {
|
|
1402
|
-
name: "stackblitz",
|
|
1403
|
-
ci: false
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
return {
|
|
1407
|
-
name: "",
|
|
1408
|
-
ci: false
|
|
1409
|
-
};
|
|
1410
|
-
}
|
|
1411
|
-
function toBoolean(val) {
|
|
1412
|
-
return val ? val !== "false" : false;
|
|
1413
|
-
}
|
|
1414
|
-
function ansiRegex2({ onlyFirst = false } = {}) {
|
|
1415
|
-
const pattern = [
|
|
1416
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
1417
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
1418
|
-
].join("|");
|
|
1419
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
1420
|
-
}
|
|
1421
|
-
function stripAnsi2(string) {
|
|
1422
|
-
if (typeof string !== "string") {
|
|
1423
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
1424
|
-
}
|
|
1425
|
-
return string.replace(regex, "");
|
|
1426
|
-
}
|
|
1427
|
-
function getDefaultExportFromCjs(x) {
|
|
1428
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1429
|
-
}
|
|
1430
|
-
function stringWidth$1(string, options) {
|
|
1431
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
1432
|
-
return 0;
|
|
1433
|
-
}
|
|
1434
|
-
options = {
|
|
1435
|
-
ambiguousIsNarrow: true,
|
|
1436
|
-
countAnsiEscapeCodes: false,
|
|
1437
|
-
...options
|
|
1438
|
-
};
|
|
1439
|
-
if (!options.countAnsiEscapeCodes) {
|
|
1440
|
-
string = stripAnsi2(string);
|
|
1441
|
-
}
|
|
1442
|
-
if (string.length === 0) {
|
|
1443
|
-
return 0;
|
|
1444
|
-
}
|
|
1445
|
-
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
1446
|
-
let width = 0;
|
|
1447
|
-
for (const { segment: character } of new Intl.Segmenter().segment(string)) {
|
|
1448
|
-
const codePoint = character.codePointAt(0);
|
|
1449
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
1450
|
-
continue;
|
|
1451
|
-
}
|
|
1452
|
-
if (codePoint >= 768 && codePoint <= 879) {
|
|
1453
|
-
continue;
|
|
1454
|
-
}
|
|
1455
|
-
if (emojiRegex().test(character)) {
|
|
1456
|
-
width += 2;
|
|
1457
|
-
continue;
|
|
1458
|
-
}
|
|
1459
|
-
const code = eastAsianWidth.eastAsianWidth(character);
|
|
1460
|
-
switch (code) {
|
|
1461
|
-
case "F":
|
|
1462
|
-
case "W": {
|
|
1463
|
-
width += 2;
|
|
1464
|
-
break;
|
|
1465
|
-
}
|
|
1466
|
-
case "A": {
|
|
1467
|
-
width += ambiguousCharacterWidth;
|
|
1468
|
-
break;
|
|
1469
|
-
}
|
|
1470
|
-
default: {
|
|
1471
|
-
width += 1;
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
return width;
|
|
1476
|
-
}
|
|
1477
|
-
function isUnicodeSupported() {
|
|
1478
|
-
if (process$1.platform !== "win32") {
|
|
1479
|
-
return process$1.env.TERM !== "linux";
|
|
1480
|
-
}
|
|
1481
|
-
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1482
|
-
}
|
|
1483
|
-
function stringWidth(str) {
|
|
1484
|
-
if (!Intl.Segmenter) {
|
|
1485
|
-
return stripAnsi(str).length;
|
|
1486
|
-
}
|
|
1487
|
-
return stringWidth$1(str);
|
|
1488
|
-
}
|
|
1489
|
-
function characterFormat(str) {
|
|
1490
|
-
return str.replace(/`([^`]+)`/gm, (_2, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_2, m2) => ` ${colors.underline(m2)} `);
|
|
1491
|
-
}
|
|
1492
|
-
function getColor2(color = "white") {
|
|
1493
|
-
return colors[color] || colors.white;
|
|
1494
|
-
}
|
|
1495
|
-
function getBgColor(color = "bgWhite") {
|
|
1496
|
-
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
1497
|
-
}
|
|
1498
|
-
function createConsola2(options = {}) {
|
|
1499
|
-
let level = _getDefaultLogLevel();
|
|
1500
|
-
if (process.env.CONSOLA_LEVEL) {
|
|
1501
|
-
level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
1502
|
-
}
|
|
1503
|
-
const consola2 = createConsola({
|
|
1504
|
-
level,
|
|
1505
|
-
defaults: { level },
|
|
1506
|
-
stdout: process.stdout,
|
|
1507
|
-
stderr: process.stderr,
|
|
1508
|
-
prompt: (...args) => Promise.resolve().then(() => (init_prompt(), exports_prompt)).then((m2) => m2.prompt(...args)),
|
|
1509
|
-
reporters: options.reporters || [
|
|
1510
|
-
options.fancy ?? !(isCI2 || isTest) ? new FancyReporter : new BasicReporter
|
|
1511
|
-
],
|
|
1512
|
-
...options
|
|
1513
|
-
});
|
|
1514
|
-
return consola2;
|
|
1515
|
-
}
|
|
1516
|
-
function _getDefaultLogLevel() {
|
|
1517
|
-
if (isDebug) {
|
|
1518
|
-
return LogLevels.debug;
|
|
1519
|
-
}
|
|
1520
|
-
if (isTest) {
|
|
1521
|
-
return LogLevels.warn;
|
|
1522
|
-
}
|
|
1523
|
-
return LogLevels.info;
|
|
1524
|
-
}
|
|
1525
|
-
var providers, processShim, envShim, providerInfo, nodeENV, isCI2, hasTTY, isDebug, isTest, regex, eastasianwidth, eastasianwidthExports, eastAsianWidth, emojiRegex = () => {
|
|
1526
|
-
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\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]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
1527
|
-
}, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode2, s2 = (c2, fallback) => unicode2 ? c2 : fallback, TYPE_ICONS, FancyReporter, consola;
|
|
1528
|
-
var init_consola_36c0034f = __esm(() => {
|
|
1529
|
-
init_core();
|
|
1530
|
-
init_consola_06ad8a64();
|
|
1531
|
-
init_utils();
|
|
1532
|
-
providers = [
|
|
1533
|
-
["APPVEYOR"],
|
|
1534
|
-
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
1535
|
-
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
1536
|
-
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
1537
|
-
["BAMBOO", "bamboo_planKey"],
|
|
1538
|
-
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
1539
|
-
["BITRISE", "BITRISE_IO"],
|
|
1540
|
-
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
1541
|
-
["BUILDKITE"],
|
|
1542
|
-
["CIRCLE", "CIRCLECI"],
|
|
1543
|
-
["CIRRUS", "CIRRUS_CI"],
|
|
1544
|
-
["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }],
|
|
1545
|
-
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
1546
|
-
["CODEFRESH", "CF_BUILD_ID"],
|
|
1547
|
-
["DRONE"],
|
|
1548
|
-
["DRONE", "DRONE_BUILD_EVENT"],
|
|
1549
|
-
["DSARI"],
|
|
1550
|
-
["GITHUB_ACTIONS"],
|
|
1551
|
-
["GITLAB", "GITLAB_CI"],
|
|
1552
|
-
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
1553
|
-
["GOCD", "GO_PIPELINE_LABEL"],
|
|
1554
|
-
["LAYERCI"],
|
|
1555
|
-
["HUDSON", "HUDSON_URL"],
|
|
1556
|
-
["JENKINS", "JENKINS_URL"],
|
|
1557
|
-
["MAGNUM"],
|
|
1558
|
-
["NETLIFY"],
|
|
1559
|
-
["NETLIFY", "NETLIFY_LOCAL", { ci: false }],
|
|
1560
|
-
["NEVERCODE"],
|
|
1561
|
-
["RENDER"],
|
|
1562
|
-
["SAIL", "SAILCI"],
|
|
1563
|
-
["SEMAPHORE"],
|
|
1564
|
-
["SCREWDRIVER"],
|
|
1565
|
-
["SHIPPABLE"],
|
|
1566
|
-
["SOLANO", "TDDIUM"],
|
|
1567
|
-
["STRIDER"],
|
|
1568
|
-
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
1569
|
-
["TRAVIS"],
|
|
1570
|
-
["VERCEL", "NOW_BUILDER"],
|
|
1571
|
-
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
1572
|
-
["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }],
|
|
1573
|
-
["STACKBLITZ"],
|
|
1574
|
-
["STORMKIT"],
|
|
1575
|
-
["CLEAVR"]
|
|
1576
|
-
];
|
|
1577
|
-
processShim = typeof process !== "undefined" ? process : {};
|
|
1578
|
-
envShim = processShim.env || {};
|
|
1579
|
-
providerInfo = detectProvider(envShim);
|
|
1580
|
-
nodeENV = typeof process !== "undefined" && process.env && "development" || "";
|
|
1581
|
-
processShim.platform;
|
|
1582
|
-
providerInfo.name;
|
|
1583
|
-
isCI2 = toBoolean(envShim.CI) || providerInfo.ci !== false;
|
|
1584
|
-
hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
|
|
1585
|
-
isDebug = toBoolean(envShim.DEBUG);
|
|
1586
|
-
isTest = nodeENV === "test" || toBoolean(envShim.TEST);
|
|
1587
|
-
toBoolean(envShim.MINIMAL);
|
|
1588
|
-
regex = ansiRegex2();
|
|
1589
|
-
eastasianwidth = { exports: {} };
|
|
1590
|
-
(function(module) {
|
|
1591
|
-
var eaw = {};
|
|
1592
|
-
{
|
|
1593
|
-
module.exports = eaw;
|
|
1594
|
-
}
|
|
1595
|
-
eaw.eastAsianWidth = function(character) {
|
|
1596
|
-
var x = character.charCodeAt(0);
|
|
1597
|
-
var y = character.length == 2 ? character.charCodeAt(1) : 0;
|
|
1598
|
-
var codePoint = x;
|
|
1599
|
-
if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
|
|
1600
|
-
x &= 1023;
|
|
1601
|
-
y &= 1023;
|
|
1602
|
-
codePoint = x << 10 | y;
|
|
1603
|
-
codePoint += 65536;
|
|
1604
|
-
}
|
|
1605
|
-
if (codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
|
|
1606
|
-
return "F";
|
|
1607
|
-
}
|
|
1608
|
-
if (codePoint == 8361 || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
|
|
1609
|
-
return "H";
|
|
1610
|
-
}
|
|
1611
|
-
if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
|
|
1612
|
-
return "W";
|
|
1613
|
-
}
|
|
1614
|
-
if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
|
|
1615
|
-
return "Na";
|
|
1616
|
-
}
|
|
1617
|
-
if (codePoint == 161 || codePoint == 164 || 167 <= codePoint && codePoint <= 168 || codePoint == 170 || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || codePoint == 198 || codePoint == 208 || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || codePoint == 230 || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || codePoint == 240 || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || codePoint == 252 || codePoint == 254 || codePoint == 257 || codePoint == 273 || codePoint == 275 || codePoint == 283 || 294 <= codePoint && codePoint <= 295 || codePoint == 299 || 305 <= codePoint && codePoint <= 307 || codePoint == 312 || 319 <= codePoint && codePoint <= 322 || codePoint == 324 || 328 <= codePoint && codePoint <= 331 || codePoint == 333 || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || codePoint == 363 || codePoint == 462 || codePoint == 464 || codePoint == 466 || codePoint == 468 || codePoint == 470 || codePoint == 472 || codePoint == 474 || codePoint == 476 || codePoint == 593 || codePoint == 609 || codePoint == 708 || codePoint == 711 || 713 <= codePoint && codePoint <= 715 || codePoint == 717 || codePoint == 720 || 728 <= codePoint && codePoint <= 731 || codePoint == 733 || codePoint == 735 || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || codePoint == 1025 || 1040 <= codePoint && codePoint <= 1103 || codePoint == 1105 || codePoint == 8208 || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || codePoint == 8240 || 8242 <= codePoint && codePoint <= 8243 || codePoint == 8245 || codePoint == 8251 || codePoint == 8254 || codePoint == 8308 || codePoint == 8319 || 8321 <= codePoint && codePoint <= 8324 || codePoint == 8364 || codePoint == 8451 || codePoint == 8453 || codePoint == 8457 || codePoint == 8467 || codePoint == 8470 || 8481 <= codePoint && codePoint <= 8482 || codePoint == 8486 || codePoint == 8491 || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || codePoint == 8585 || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || codePoint == 8658 || codePoint == 8660 || codePoint == 8679 || codePoint == 8704 || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || codePoint == 8715 || codePoint == 8719 || codePoint == 8721 || codePoint == 8725 || codePoint == 8730 || 8733 <= codePoint && codePoint <= 8736 || codePoint == 8739 || codePoint == 8741 || 8743 <= codePoint && codePoint <= 8748 || codePoint == 8750 || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || codePoint == 8776 || codePoint == 8780 || codePoint == 8786 || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || codePoint == 8853 || codePoint == 8857 || codePoint == 8869 || codePoint == 8895 || codePoint == 8978 || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || codePoint == 9675 || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || codePoint == 9711 || 9733 <= codePoint && codePoint <= 9734 || codePoint == 9737 || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || codePoint == 9756 || codePoint == 9758 || codePoint == 9792 || codePoint == 9794 || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || codePoint == 9839 || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || codePoint == 9955 || 9960 <= codePoint && codePoint <= 9983 || codePoint == 10045 || codePoint == 10071 || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || codePoint == 65533 || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
|
|
1618
|
-
return "A";
|
|
1619
|
-
}
|
|
1620
|
-
return "N";
|
|
1621
|
-
};
|
|
1622
|
-
eaw.characterLength = function(character) {
|
|
1623
|
-
var code = this.eastAsianWidth(character);
|
|
1624
|
-
if (code == "F" || code == "W" || code == "A") {
|
|
1625
|
-
return 2;
|
|
1626
|
-
} else {
|
|
1627
|
-
return 1;
|
|
1628
|
-
}
|
|
1629
|
-
};
|
|
1630
|
-
function stringToArray(string) {
|
|
1631
|
-
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
1632
|
-
}
|
|
1633
|
-
eaw.length = function(string) {
|
|
1634
|
-
var characters = stringToArray(string);
|
|
1635
|
-
var len = 0;
|
|
1636
|
-
for (var i = 0;i < characters.length; i++) {
|
|
1637
|
-
len = len + this.characterLength(characters[i]);
|
|
1638
|
-
}
|
|
1639
|
-
return len;
|
|
1640
|
-
};
|
|
1641
|
-
eaw.slice = function(text2, start, end) {
|
|
1642
|
-
textLen = eaw.length(text2);
|
|
1643
|
-
start = start ? start : 0;
|
|
1644
|
-
end = end ? end : 1;
|
|
1645
|
-
if (start < 0) {
|
|
1646
|
-
start = textLen + start;
|
|
1647
|
-
}
|
|
1648
|
-
if (end < 0) {
|
|
1649
|
-
end = textLen + end;
|
|
1650
|
-
}
|
|
1651
|
-
var result = "";
|
|
1652
|
-
var eawLen = 0;
|
|
1653
|
-
var chars = stringToArray(text2);
|
|
1654
|
-
for (var i = 0;i < chars.length; i++) {
|
|
1655
|
-
var char = chars[i];
|
|
1656
|
-
var charLen = eaw.length(char);
|
|
1657
|
-
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
|
|
1658
|
-
if (eawLen + charLen <= end) {
|
|
1659
|
-
result += char;
|
|
1660
|
-
} else {
|
|
1661
|
-
break;
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
eawLen += charLen;
|
|
1665
|
-
}
|
|
1666
|
-
return result;
|
|
1667
|
-
};
|
|
1668
|
-
})(eastasianwidth);
|
|
1669
|
-
eastasianwidthExports = eastasianwidth.exports;
|
|
1670
|
-
eastAsianWidth = /* @__PURE__ */ getDefaultExportFromCjs(eastasianwidthExports);
|
|
1671
|
-
TYPE_COLOR_MAP = {
|
|
1672
|
-
info: "cyan",
|
|
1673
|
-
fail: "red",
|
|
1674
|
-
success: "green",
|
|
1675
|
-
ready: "green",
|
|
1676
|
-
start: "magenta"
|
|
1677
|
-
};
|
|
1678
|
-
LEVEL_COLOR_MAP = {
|
|
1679
|
-
0: "red",
|
|
1680
|
-
1: "yellow"
|
|
1681
|
-
};
|
|
1682
|
-
unicode2 = isUnicodeSupported();
|
|
1683
|
-
TYPE_ICONS = {
|
|
1684
|
-
error: s2("\u2716", "\xD7"),
|
|
1685
|
-
fatal: s2("\u2716", "\xD7"),
|
|
1686
|
-
ready: s2("\u2714", "\u221A"),
|
|
1687
|
-
warn: s2("\u26A0", "\u203C"),
|
|
1688
|
-
info: s2("\u2139", "i"),
|
|
1689
|
-
success: s2("\u2714", "\u221A"),
|
|
1690
|
-
debug: s2("\u2699", "D"),
|
|
1691
|
-
trace: s2("\u2192", "\u2192"),
|
|
1692
|
-
fail: s2("\u2716", "\xD7"),
|
|
1693
|
-
start: s2("\u25D0", "o"),
|
|
1694
|
-
log: ""
|
|
1695
|
-
};
|
|
1696
|
-
FancyReporter = class FancyReporter extends BasicReporter {
|
|
1697
|
-
formatStack(stack) {
|
|
1698
|
-
return "\n" + parseStack(stack).map((line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_2, m2) => `(${colors.cyan(m2)})`)).join("\n");
|
|
1699
|
-
}
|
|
1700
|
-
formatType(logObj, isBadge, opts) {
|
|
1701
|
-
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
1702
|
-
if (isBadge) {
|
|
1703
|
-
return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
|
|
1704
|
-
}
|
|
1705
|
-
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
1706
|
-
return _type ? getColor2(typeColor)(_type) : "";
|
|
1707
|
-
}
|
|
1708
|
-
formatLogObj(logObj, opts) {
|
|
1709
|
-
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
1710
|
-
if (logObj.type === "box") {
|
|
1711
|
-
return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
1712
|
-
title: logObj.title ? characterFormat(logObj.title) : undefined,
|
|
1713
|
-
style: logObj.style
|
|
1714
|
-
});
|
|
1715
|
-
}
|
|
1716
|
-
const date = this.formatDate(logObj.date, opts);
|
|
1717
|
-
const coloredDate = date && colors.gray(date);
|
|
1718
|
-
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
1719
|
-
const type = this.formatType(logObj, isBadge, opts);
|
|
1720
|
-
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
1721
|
-
let line;
|
|
1722
|
-
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
1723
|
-
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
1724
|
-
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
1725
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
1726
|
-
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
1727
|
-
if (logObj.type === "trace") {
|
|
1728
|
-
const _err = new Error("Trace: " + logObj.message);
|
|
1729
|
-
line += this.formatStack(_err.stack || "");
|
|
1730
|
-
}
|
|
1731
|
-
return isBadge ? "\n" + line + "\n" : line;
|
|
1732
|
-
}
|
|
1733
|
-
};
|
|
1734
|
-
consola = createConsola2();
|
|
1735
|
-
});
|
|
1736
|
-
|
|
1737
|
-
// src/index.ts
|
|
1738
|
-
import {access, appendFile, mkdir} from "fs/promises";
|
|
1739
|
-
import {dirname} from "path";
|
|
1740
|
-
import process2 from "process";
|
|
1741
|
-
import {buddyOptions, prompt as getPrompt} from "@stacksjs/cli";
|
|
1742
|
-
import {handleError} from "@stacksjs/error-handling";
|
|
1743
|
-
import {logsPath} from "@stacksjs/path";
|
|
1744
|
-
import {ExitCode} from "@stacksjs/types";
|
|
1745
|
-
import {isString} from "@stacksjs/validation";
|
|
1746
|
-
|
|
1747
|
-
// ../../../../node_modules/consola/dist/index.mjs
|
|
1748
|
-
init_consola_36c0034f();
|
|
1749
|
-
init_core();
|
|
1750
|
-
init_consola_06ad8a64();
|
|
1751
|
-
init_utils();
|
|
1752
|
-
|
|
1753
|
-
// src/index.ts
|
|
1754
|
-
async function logLevel() {
|
|
1755
|
-
const verboseRegex = /--verbose(?!(\s*=\s*false|\s+false))(\s+|=true)?($|\s)/;
|
|
1756
|
-
const opts = buddyOptions();
|
|
1757
|
-
if (verboseRegex.test(opts))
|
|
1758
|
-
return 4;
|
|
1759
|
-
return 3;
|
|
1760
|
-
}
|
|
1761
|
-
async function writeToLogFile(message) {
|
|
1762
|
-
const formattedMessage = `[${new Date().toISOString()}] ${message}\n`;
|
|
1763
|
-
try {
|
|
1764
|
-
const logFilePath = logsPath("console.log");
|
|
1765
|
-
try {
|
|
1766
|
-
await access(logFilePath);
|
|
1767
|
-
} catch {
|
|
1768
|
-
await mkdir(dirname(logFilePath), { recursive: true });
|
|
1769
|
-
}
|
|
1770
|
-
await appendFile(logFilePath, formattedMessage);
|
|
1771
|
-
} catch (error) {
|
|
1772
|
-
console.error("Failed to write to log file:", error);
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
function dump(...args) {
|
|
1776
|
-
args.forEach((arg) => log.debug(arg));
|
|
1777
|
-
}
|
|
1778
|
-
function dd(...args) {
|
|
1779
|
-
args.forEach((arg) => log.debug(arg));
|
|
1780
|
-
process2.exit(ExitCode.FatalError);
|
|
1781
|
-
}
|
|
1782
|
-
function echo(...args) {
|
|
1783
|
-
console.log(...args);
|
|
1784
|
-
}
|
|
1785
|
-
var logger = createConsola2({
|
|
1786
|
-
level: await logLevel()
|
|
1787
|
-
});
|
|
1788
|
-
var log = {
|
|
1789
|
-
async info(...arg) {
|
|
1790
|
-
logger.info(...arg);
|
|
1791
|
-
await writeToLogFile(`INFO: ${arg}`);
|
|
1792
|
-
},
|
|
1793
|
-
async success(msg) {
|
|
1794
|
-
logger.success(msg);
|
|
1795
|
-
await writeToLogFile(`SUCCESS: ${msg}`);
|
|
1796
|
-
},
|
|
1797
|
-
async error(err, options) {
|
|
1798
|
-
if (err instanceof Error)
|
|
1799
|
-
handleError(err, options);
|
|
1800
|
-
else if (options instanceof Error)
|
|
1801
|
-
handleError(options);
|
|
1802
|
-
else
|
|
1803
|
-
handleError(err, options);
|
|
1804
|
-
await writeToLogFile(`ERROR: ${err}`);
|
|
1805
|
-
},
|
|
1806
|
-
async warn(arg) {
|
|
1807
|
-
logger.warn(arg);
|
|
1808
|
-
await writeToLogFile(`WARN: ${arg}`);
|
|
1809
|
-
},
|
|
1810
|
-
async debug(...arg) {
|
|
1811
|
-
if (process2.env.APP_ENV === "production" || process2.env.APP_ENV === "prod")
|
|
1812
|
-
return await writeToLogFile(`DEBUG: ${arg}`);
|
|
1813
|
-
logger.debug(arg);
|
|
1814
|
-
if (isString(arg))
|
|
1815
|
-
await writeToLogFile(`DEBUG: ${arg}`);
|
|
1816
|
-
else
|
|
1817
|
-
await writeToLogFile(`DEBUG: ${JSON.stringify(arg)}`);
|
|
1818
|
-
},
|
|
1819
|
-
async start(...arg) {
|
|
1820
|
-
logger.start(arg);
|
|
1821
|
-
await writeToLogFile(`START: ${arg}`);
|
|
1822
|
-
},
|
|
1823
|
-
box: logger.box,
|
|
1824
|
-
get prompt() {
|
|
1825
|
-
return getPrompt();
|
|
1826
|
-
},
|
|
1827
|
-
dump,
|
|
1828
|
-
dd,
|
|
1829
|
-
echo
|
|
1830
|
-
};
|
|
1831
|
-
export {
|
|
1832
|
-
writeToLogFile,
|
|
1833
|
-
logger,
|
|
1834
|
-
logLevel,
|
|
1835
|
-
log,
|
|
1836
|
-
echo,
|
|
1837
|
-
dump,
|
|
1838
|
-
dd,
|
|
1839
|
-
consola
|
|
1840
|
-
};
|
|
1841
|
-
|
|
1842
|
-
//# debugId=CC9F625EB090170E64756E2164756E21
|
|
4
|
+
//# debugId=49AB6E1D7CC57BAA64756E2164756E21
|
|
1843
5
|
//# sourceMappingURL=index.js.map
|