@kubb/core 3.3.4 → 3.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-QQNAR6NN.cjs → chunk-2I2KNTZ6.cjs} +36 -36
  2. package/dist/chunk-2I2KNTZ6.cjs.map +1 -0
  3. package/dist/chunk-3CLNO5VR.js +1086 -0
  4. package/dist/chunk-3CLNO5VR.js.map +1 -0
  5. package/dist/{chunk-T3JE2UXN.cjs → chunk-DJTXTPU5.cjs} +11 -11
  6. package/dist/{chunk-T3JE2UXN.cjs.map → chunk-DJTXTPU5.cjs.map} +1 -1
  7. package/dist/{chunk-N2GBH2C5.cjs → chunk-DM33VT7Z.cjs} +4 -4
  8. package/dist/{chunk-N2GBH2C5.cjs.map → chunk-DM33VT7Z.cjs.map} +1 -1
  9. package/dist/{chunk-HTOO3HNK.js → chunk-OL5US75J.js} +3 -3
  10. package/dist/{chunk-HTOO3HNK.js.map → chunk-OL5US75J.js.map} +1 -1
  11. package/dist/chunk-RUVWHIUM.cjs +1124 -0
  12. package/dist/chunk-RUVWHIUM.cjs.map +1 -0
  13. package/dist/{chunk-HHIGUHMQ.js → chunk-U7VFDKAD.js} +3 -3
  14. package/dist/chunk-U7VFDKAD.js.map +1 -0
  15. package/dist/{chunk-MJJ7HASG.cjs → chunk-YLXE25XM.cjs} +17 -17
  16. package/dist/{chunk-MJJ7HASG.cjs.map → chunk-YLXE25XM.cjs.map} +1 -1
  17. package/dist/index.cjs +35 -35
  18. package/dist/index.js +4 -4
  19. package/dist/logger.cjs +7 -7
  20. package/dist/logger.js +2 -2
  21. package/dist/mocks.cjs +9 -9
  22. package/dist/mocks.js +1 -1
  23. package/dist/{prompt-EJQPAE7T.cjs → prompt-2DO6IHGP.cjs} +454 -354
  24. package/dist/prompt-2DO6IHGP.cjs.map +1 -0
  25. package/dist/{prompt-WQQUN22Z.js → prompt-Y6ROOH2L.js} +393 -294
  26. package/dist/prompt-Y6ROOH2L.js.map +1 -0
  27. package/dist/transformers.cjs +23 -23
  28. package/dist/utils.cjs +17 -17
  29. package/dist/utils.js +1 -1
  30. package/package.json +8 -8
  31. package/src/utils/parser.ts +1 -1
  32. package/dist/chunk-HBQM723K.js +0 -1049
  33. package/dist/chunk-HBQM723K.js.map +0 -1
  34. package/dist/chunk-HHIGUHMQ.js.map +0 -1
  35. package/dist/chunk-QQNAR6NN.cjs.map +0 -1
  36. package/dist/chunk-S4E6TU6G.cjs +0 -1088
  37. package/dist/chunk-S4E6TU6G.cjs.map +0 -1
  38. package/dist/prompt-EJQPAE7T.cjs.map +0 -1
  39. package/dist/prompt-WQQUN22Z.js.map +0 -1
@@ -1,1088 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkN2GBH2C5_cjs = require('./chunk-N2GBH2C5.cjs');
4
- var util = require('util');
5
- var path = require('path');
6
- var tty = require('tty');
7
- var process$1 = require('process');
8
-
9
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
-
11
- function _interopNamespace(e) {
12
- if (e && e.__esModule) return e;
13
- var n = Object.create(null);
14
- if (e) {
15
- Object.keys(e).forEach(function (k) {
16
- if (k !== 'default') {
17
- var d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: function () { return e[k]; }
21
- });
22
- }
23
- });
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var tty__namespace = /*#__PURE__*/_interopNamespace(tty);
30
- var process$1__default = /*#__PURE__*/_interopDefault(process$1);
31
-
32
- // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs
33
- chunkN2GBH2C5_cjs.init_cjs_shims();
34
- var LogLevels = {
35
- silent: Number.NEGATIVE_INFINITY,
36
- fatal: 0,
37
- error: 0,
38
- warn: 1,
39
- log: 2,
40
- info: 3,
41
- success: 3,
42
- fail: 3,
43
- ready: 3,
44
- start: 3,
45
- box: 3,
46
- debug: 4,
47
- trace: 5,
48
- verbose: Number.POSITIVE_INFINITY
49
- };
50
- var LogTypes = {
51
- // Silent
52
- silent: {
53
- level: -1
54
- },
55
- // Level 0
56
- fatal: {
57
- level: LogLevels.fatal
58
- },
59
- error: {
60
- level: LogLevels.error
61
- },
62
- // Level 1
63
- warn: {
64
- level: LogLevels.warn
65
- },
66
- // Level 2
67
- log: {
68
- level: LogLevels.log
69
- },
70
- // Level 3
71
- info: {
72
- level: LogLevels.info
73
- },
74
- success: {
75
- level: LogLevels.success
76
- },
77
- fail: {
78
- level: LogLevels.fail
79
- },
80
- ready: {
81
- level: LogLevels.info
82
- },
83
- start: {
84
- level: LogLevels.info
85
- },
86
- box: {
87
- level: LogLevels.info
88
- },
89
- // Level 4
90
- debug: {
91
- level: LogLevels.debug
92
- },
93
- // Level 5
94
- trace: {
95
- level: LogLevels.trace
96
- },
97
- // Verbose
98
- verbose: {
99
- level: LogLevels.verbose
100
- }
101
- };
102
- function isObject(value) {
103
- return value !== null && typeof value === "object";
104
- }
105
- function _defu(baseObject, defaults, namespace = ".", merger) {
106
- if (!isObject(defaults)) {
107
- return _defu(baseObject, {}, namespace);
108
- }
109
- const object = Object.assign({}, defaults);
110
- for (const key in baseObject) {
111
- if (key === "__proto__" || key === "constructor") {
112
- continue;
113
- }
114
- const value = baseObject[key];
115
- if (value === null || value === void 0) {
116
- continue;
117
- }
118
- if (Array.isArray(value) && Array.isArray(object[key])) {
119
- object[key] = [...value, ...object[key]];
120
- } else if (isObject(value) && isObject(object[key])) {
121
- object[key] = _defu(
122
- value,
123
- object[key],
124
- (namespace ? `${namespace}.` : "") + key.toString());
125
- } else {
126
- object[key] = value;
127
- }
128
- }
129
- return object;
130
- }
131
- function createDefu(merger) {
132
- return (...arguments_) => (
133
- // eslint-disable-next-line unicorn/no-array-reduce
134
- arguments_.reduce((p, c) => _defu(p, c, ""), {})
135
- );
136
- }
137
- var defu = createDefu();
138
- function isPlainObject(obj) {
139
- return Object.prototype.toString.call(obj) === "[object Object]";
140
- }
141
- function isLogObj(arg) {
142
- if (!isPlainObject(arg)) {
143
- return false;
144
- }
145
- if (!arg.message && !arg.args) {
146
- return false;
147
- }
148
- if (arg.stack) {
149
- return false;
150
- }
151
- return true;
152
- }
153
- var paused = false;
154
- var queue = [];
155
- var Consola = class _Consola {
156
- constructor(options = {}) {
157
- const types = options.types || LogTypes;
158
- this.options = defu(
159
- {
160
- ...options,
161
- defaults: { ...options.defaults },
162
- level: _normalizeLogLevel(options.level, types),
163
- reporters: [...options.reporters || []]
164
- },
165
- {
166
- types: LogTypes,
167
- throttle: 1e3,
168
- throttleMin: 5,
169
- formatOptions: {
170
- date: true,
171
- colors: false,
172
- compact: true
173
- }
174
- }
175
- );
176
- for (const type in types) {
177
- const defaults = {
178
- type,
179
- ...this.options.defaults,
180
- ...types[type]
181
- };
182
- this[type] = this._wrapLogFn(defaults);
183
- this[type].raw = this._wrapLogFn(
184
- defaults,
185
- true
186
- );
187
- }
188
- if (this.options.mockFn) {
189
- this.mockTypes();
190
- }
191
- this._lastLog = {};
192
- }
193
- get level() {
194
- return this.options.level;
195
- }
196
- set level(level) {
197
- this.options.level = _normalizeLogLevel(
198
- level,
199
- this.options.types,
200
- this.options.level
201
- );
202
- }
203
- prompt(message, opts) {
204
- if (!this.options.prompt) {
205
- throw new Error("prompt is not supported!");
206
- }
207
- return this.options.prompt(message, opts);
208
- }
209
- create(options) {
210
- const instance = new _Consola({
211
- ...this.options,
212
- ...options
213
- });
214
- if (this._mockFn) {
215
- instance.mockTypes(this._mockFn);
216
- }
217
- return instance;
218
- }
219
- withDefaults(defaults) {
220
- return this.create({
221
- ...this.options,
222
- defaults: {
223
- ...this.options.defaults,
224
- ...defaults
225
- }
226
- });
227
- }
228
- withTag(tag) {
229
- return this.withDefaults({
230
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
231
- });
232
- }
233
- addReporter(reporter) {
234
- this.options.reporters.push(reporter);
235
- return this;
236
- }
237
- removeReporter(reporter) {
238
- if (reporter) {
239
- const i = this.options.reporters.indexOf(reporter);
240
- if (i >= 0) {
241
- return this.options.reporters.splice(i, 1);
242
- }
243
- } else {
244
- this.options.reporters.splice(0);
245
- }
246
- return this;
247
- }
248
- setReporters(reporters) {
249
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
250
- return this;
251
- }
252
- wrapAll() {
253
- this.wrapConsole();
254
- this.wrapStd();
255
- }
256
- restoreAll() {
257
- this.restoreConsole();
258
- this.restoreStd();
259
- }
260
- wrapConsole() {
261
- for (const type in this.options.types) {
262
- if (!console["__" + type]) {
263
- console["__" + type] = console[type];
264
- }
265
- console[type] = this[type].raw;
266
- }
267
- }
268
- restoreConsole() {
269
- for (const type in this.options.types) {
270
- if (console["__" + type]) {
271
- console[type] = console["__" + type];
272
- delete console["__" + type];
273
- }
274
- }
275
- }
276
- wrapStd() {
277
- this._wrapStream(this.options.stdout, "log");
278
- this._wrapStream(this.options.stderr, "log");
279
- }
280
- _wrapStream(stream, type) {
281
- if (!stream) {
282
- return;
283
- }
284
- if (!stream.__write) {
285
- stream.__write = stream.write;
286
- }
287
- stream.write = (data) => {
288
- this[type].raw(String(data).trim());
289
- };
290
- }
291
- restoreStd() {
292
- this._restoreStream(this.options.stdout);
293
- this._restoreStream(this.options.stderr);
294
- }
295
- _restoreStream(stream) {
296
- if (!stream) {
297
- return;
298
- }
299
- if (stream.__write) {
300
- stream.write = stream.__write;
301
- delete stream.__write;
302
- }
303
- }
304
- pauseLogs() {
305
- paused = true;
306
- }
307
- resumeLogs() {
308
- paused = false;
309
- const _queue = queue.splice(0);
310
- for (const item of _queue) {
311
- item[0]._logFn(item[1], item[2]);
312
- }
313
- }
314
- mockTypes(mockFn) {
315
- const _mockFn = mockFn || this.options.mockFn;
316
- this._mockFn = _mockFn;
317
- if (typeof _mockFn !== "function") {
318
- return;
319
- }
320
- for (const type in this.options.types) {
321
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
322
- this[type].raw = this[type];
323
- }
324
- }
325
- _wrapLogFn(defaults, isRaw) {
326
- return (...args) => {
327
- if (paused) {
328
- queue.push([this, defaults, args, isRaw]);
329
- return;
330
- }
331
- return this._logFn(defaults, args, isRaw);
332
- };
333
- }
334
- _logFn(defaults, args, isRaw) {
335
- if ((defaults.level || 0) > this.level) {
336
- return false;
337
- }
338
- const logObj = {
339
- date: /* @__PURE__ */ new Date(),
340
- args: [],
341
- ...defaults,
342
- level: _normalizeLogLevel(defaults.level, this.options.types)
343
- };
344
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
345
- Object.assign(logObj, args[0]);
346
- } else {
347
- logObj.args = [...args];
348
- }
349
- if (logObj.message) {
350
- logObj.args.unshift(logObj.message);
351
- delete logObj.message;
352
- }
353
- if (logObj.additional) {
354
- if (!Array.isArray(logObj.additional)) {
355
- logObj.additional = logObj.additional.split("\n");
356
- }
357
- logObj.args.push("\n" + logObj.additional.join("\n"));
358
- delete logObj.additional;
359
- }
360
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
361
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
362
- const resolveLog = (newLog = false) => {
363
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
364
- if (this._lastLog.object && repeated > 0) {
365
- const args2 = [...this._lastLog.object.args];
366
- if (repeated > 1) {
367
- args2.push(`(repeated ${repeated} times)`);
368
- }
369
- this._log({ ...this._lastLog.object, args: args2 });
370
- this._lastLog.count = 1;
371
- }
372
- if (newLog) {
373
- this._lastLog.object = logObj;
374
- this._log(logObj);
375
- }
376
- };
377
- clearTimeout(this._lastLog.timeout);
378
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
379
- this._lastLog.time = logObj.date;
380
- if (diffTime < this.options.throttle) {
381
- try {
382
- const serializedLog = JSON.stringify([
383
- logObj.type,
384
- logObj.tag,
385
- logObj.args
386
- ]);
387
- const isSameLog = this._lastLog.serialized === serializedLog;
388
- this._lastLog.serialized = serializedLog;
389
- if (isSameLog) {
390
- this._lastLog.count = (this._lastLog.count || 0) + 1;
391
- if (this._lastLog.count > this.options.throttleMin) {
392
- this._lastLog.timeout = setTimeout(
393
- resolveLog,
394
- this.options.throttle
395
- );
396
- return;
397
- }
398
- }
399
- } catch {
400
- }
401
- }
402
- resolveLog(true);
403
- }
404
- _log(logObj) {
405
- for (const reporter of this.options.reporters) {
406
- reporter.log(logObj, {
407
- options: this.options
408
- });
409
- }
410
- }
411
- };
412
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
413
- if (input === void 0) {
414
- return defaultLevel;
415
- }
416
- if (typeof input === "number") {
417
- return input;
418
- }
419
- if (types[input] && types[input].level !== void 0) {
420
- return types[input].level;
421
- }
422
- return defaultLevel;
423
- }
424
- Consola.prototype.add = Consola.prototype.addReporter;
425
- Consola.prototype.remove = Consola.prototype.removeReporter;
426
- Consola.prototype.clear = Consola.prototype.removeReporter;
427
- Consola.prototype.withScope = Consola.prototype.withTag;
428
- Consola.prototype.mock = Consola.prototype.mockTypes;
429
- Consola.prototype.pause = Consola.prototype.pauseLogs;
430
- Consola.prototype.resume = Consola.prototype.resumeLogs;
431
- function createConsola(options = {}) {
432
- return new Consola(options);
433
- }
434
-
435
- // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
436
- chunkN2GBH2C5_cjs.init_cjs_shims();
437
- function parseStack(stack) {
438
- const cwd = process.cwd() + path.sep;
439
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
440
- return lines;
441
- }
442
- function writeStream(data, stream) {
443
- const write = stream.__write || stream.write;
444
- return write.call(stream, data);
445
- }
446
- var bracket = (x) => x ? `[${x}]` : "";
447
- var BasicReporter = class {
448
- formatStack(stack, opts) {
449
- return " " + parseStack(stack).join("\n ");
450
- }
451
- formatArgs(args, opts) {
452
- const _args = args.map((arg) => {
453
- if (arg && typeof arg.stack === "string") {
454
- return arg.message + "\n" + this.formatStack(arg.stack, opts);
455
- }
456
- return arg;
457
- });
458
- return util.formatWithOptions(opts, ..._args);
459
- }
460
- formatDate(date, opts) {
461
- return opts.date ? date.toLocaleTimeString() : "";
462
- }
463
- filterAndJoin(arr) {
464
- return arr.filter(Boolean).join(" ");
465
- }
466
- formatLogObj(logObj, opts) {
467
- const message = this.formatArgs(logObj.args, opts);
468
- if (logObj.type === "box") {
469
- return "\n" + [
470
- bracket(logObj.tag),
471
- logObj.title && logObj.title,
472
- ...message.split("\n")
473
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
474
- }
475
- return this.filterAndJoin([
476
- bracket(logObj.type),
477
- bracket(logObj.tag),
478
- message
479
- ]);
480
- }
481
- log(logObj, ctx) {
482
- const line = this.formatLogObj(logObj, {
483
- columns: ctx.options.stdout.columns || 0,
484
- ...ctx.options.formatOptions
485
- });
486
- return writeStream(
487
- line + "\n",
488
- logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
489
- );
490
- }
491
- };
492
-
493
- // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
494
- chunkN2GBH2C5_cjs.init_cjs_shims();
495
- var {
496
- env = {},
497
- argv = [],
498
- platform = ""
499
- } = typeof process === "undefined" ? {} : process;
500
- var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
501
- var isForced = "FORCE_COLOR" in env || argv.includes("--color");
502
- var isWindows = platform === "win32";
503
- var isDumbTerminal = env.TERM === "dumb";
504
- var isCompatibleTerminal = tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && !isDumbTerminal;
505
- var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
506
- var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
507
- 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)) {
508
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
509
- }
510
- function clearBleed(index, string, open, close, replace) {
511
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
512
- }
513
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
514
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(
515
- ("" + string).indexOf(close, at),
516
- string,
517
- open,
518
- close,
519
- replace
520
- ) : "";
521
- }
522
- function init(open, close, replace) {
523
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
524
- }
525
- var colorDefs = {
526
- reset: init(0, 0),
527
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
528
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
529
- italic: init(3, 23),
530
- underline: init(4, 24),
531
- inverse: init(7, 27),
532
- hidden: init(8, 28),
533
- strikethrough: init(9, 29),
534
- black: init(30, 39),
535
- red: init(31, 39),
536
- green: init(32, 39),
537
- yellow: init(33, 39),
538
- blue: init(34, 39),
539
- magenta: init(35, 39),
540
- cyan: init(36, 39),
541
- white: init(37, 39),
542
- gray: init(90, 39),
543
- bgBlack: init(40, 49),
544
- bgRed: init(41, 49),
545
- bgGreen: init(42, 49),
546
- bgYellow: init(43, 49),
547
- bgBlue: init(44, 49),
548
- bgMagenta: init(45, 49),
549
- bgCyan: init(46, 49),
550
- bgWhite: init(47, 49),
551
- blackBright: init(90, 39),
552
- redBright: init(91, 39),
553
- greenBright: init(92, 39),
554
- yellowBright: init(93, 39),
555
- blueBright: init(94, 39),
556
- magentaBright: init(95, 39),
557
- cyanBright: init(96, 39),
558
- whiteBright: init(97, 39),
559
- bgBlackBright: init(100, 49),
560
- bgRedBright: init(101, 49),
561
- bgGreenBright: init(102, 49),
562
- bgYellowBright: init(103, 49),
563
- bgBlueBright: init(104, 49),
564
- bgMagentaBright: init(105, 49),
565
- bgCyanBright: init(106, 49),
566
- bgWhiteBright: init(107, 49)
567
- };
568
- function createColors(useColor = isColorSupported) {
569
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
570
- }
571
- var colors = createColors();
572
- function getColor(color, fallback = "reset") {
573
- return colors[color] || colors[fallback];
574
- }
575
- var ansiRegex = [
576
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
577
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
578
- ].join("|");
579
- function stripAnsi(text) {
580
- return text.replace(new RegExp(ansiRegex, "g"), "");
581
- }
582
- var boxStylePresets = {
583
- solid: {
584
- tl: "\u250C",
585
- tr: "\u2510",
586
- bl: "\u2514",
587
- br: "\u2518",
588
- h: "\u2500",
589
- v: "\u2502"
590
- },
591
- double: {
592
- tl: "\u2554",
593
- tr: "\u2557",
594
- bl: "\u255A",
595
- br: "\u255D",
596
- h: "\u2550",
597
- v: "\u2551"
598
- },
599
- doubleSingle: {
600
- tl: "\u2553",
601
- tr: "\u2556",
602
- bl: "\u2559",
603
- br: "\u255C",
604
- h: "\u2500",
605
- v: "\u2551"
606
- },
607
- doubleSingleRounded: {
608
- tl: "\u256D",
609
- tr: "\u256E",
610
- bl: "\u2570",
611
- br: "\u256F",
612
- h: "\u2500",
613
- v: "\u2551"
614
- },
615
- singleThick: {
616
- tl: "\u250F",
617
- tr: "\u2513",
618
- bl: "\u2517",
619
- br: "\u251B",
620
- h: "\u2501",
621
- v: "\u2503"
622
- },
623
- singleDouble: {
624
- tl: "\u2552",
625
- tr: "\u2555",
626
- bl: "\u2558",
627
- br: "\u255B",
628
- h: "\u2550",
629
- v: "\u2502"
630
- },
631
- singleDoubleRounded: {
632
- tl: "\u256D",
633
- tr: "\u256E",
634
- bl: "\u2570",
635
- br: "\u256F",
636
- h: "\u2550",
637
- v: "\u2502"
638
- },
639
- rounded: {
640
- tl: "\u256D",
641
- tr: "\u256E",
642
- bl: "\u2570",
643
- br: "\u256F",
644
- h: "\u2500",
645
- v: "\u2502"
646
- }
647
- };
648
- var defaultStyle = {
649
- borderColor: "white",
650
- borderStyle: "rounded",
651
- valign: "center",
652
- padding: 2,
653
- marginLeft: 1,
654
- marginTop: 1,
655
- marginBottom: 1
656
- };
657
- function box(text, _opts = {}) {
658
- const opts = {
659
- ..._opts,
660
- style: {
661
- ...defaultStyle,
662
- ..._opts.style
663
- }
664
- };
665
- const textLines = text.split("\n");
666
- const boxLines = [];
667
- const _color = getColor(opts.style.borderColor);
668
- const borderStyle = {
669
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
670
- };
671
- if (_color) {
672
- for (const key in borderStyle) {
673
- borderStyle[key] = _color(
674
- borderStyle[key]
675
- );
676
- }
677
- }
678
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
679
- const height = textLines.length + paddingOffset;
680
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
681
- const widthOffset = width + paddingOffset;
682
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
683
- if (opts.style.marginTop > 0) {
684
- boxLines.push("".repeat(opts.style.marginTop));
685
- }
686
- if (opts.title) {
687
- const left = borderStyle.h.repeat(
688
- Math.floor((width - stripAnsi(opts.title).length) / 2)
689
- );
690
- const right = borderStyle.h.repeat(
691
- width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
692
- );
693
- boxLines.push(
694
- `${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`
695
- );
696
- } else {
697
- boxLines.push(
698
- `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
699
- );
700
- }
701
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
702
- for (let i = 0; i < height; i++) {
703
- if (i < valignOffset || i >= valignOffset + textLines.length) {
704
- boxLines.push(
705
- `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
706
- );
707
- } else {
708
- const line = textLines[i - valignOffset];
709
- const left = " ".repeat(paddingOffset);
710
- const right = " ".repeat(width - stripAnsi(line).length);
711
- boxLines.push(
712
- `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
713
- );
714
- }
715
- }
716
- boxLines.push(
717
- `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
718
- );
719
- if (opts.style.marginBottom > 0) {
720
- boxLines.push("".repeat(opts.style.marginBottom));
721
- }
722
- return boxLines.join("\n");
723
- }
724
-
725
- // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
726
- chunkN2GBH2C5_cjs.init_cjs_shims();
727
- var providers = [
728
- ["APPVEYOR"],
729
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
730
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
731
- ["APPCIRCLE", "AC_APPCIRCLE"],
732
- ["BAMBOO", "bamboo_planKey"],
733
- ["BITBUCKET", "BITBUCKET_COMMIT"],
734
- ["BITRISE", "BITRISE_IO"],
735
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
736
- ["BUILDKITE"],
737
- ["CIRCLE", "CIRCLECI"],
738
- ["CIRRUS", "CIRRUS_CI"],
739
- ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }],
740
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
741
- ["CODEFRESH", "CF_BUILD_ID"],
742
- ["DRONE"],
743
- ["DRONE", "DRONE_BUILD_EVENT"],
744
- ["DSARI"],
745
- ["GITHUB_ACTIONS"],
746
- ["GITLAB", "GITLAB_CI"],
747
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
748
- ["GOCD", "GO_PIPELINE_LABEL"],
749
- ["LAYERCI"],
750
- ["HUDSON", "HUDSON_URL"],
751
- ["JENKINS", "JENKINS_URL"],
752
- ["MAGNUM"],
753
- ["NETLIFY"],
754
- ["NETLIFY", "NETLIFY_LOCAL", { ci: false }],
755
- ["NEVERCODE"],
756
- ["RENDER"],
757
- ["SAIL", "SAILCI"],
758
- ["SEMAPHORE"],
759
- ["SCREWDRIVER"],
760
- ["SHIPPABLE"],
761
- ["SOLANO", "TDDIUM"],
762
- ["STRIDER"],
763
- ["TEAMCITY", "TEAMCITY_VERSION"],
764
- ["TRAVIS"],
765
- ["VERCEL", "NOW_BUILDER"],
766
- ["APPCENTER", "APPCENTER_BUILD_ID"],
767
- ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }],
768
- ["STACKBLITZ"],
769
- ["STORMKIT"],
770
- ["CLEAVR"]
771
- ];
772
- function detectProvider(env2) {
773
- for (const provider of providers) {
774
- const envName = provider[1] || provider[0];
775
- if (env2[envName]) {
776
- return {
777
- name: provider[0].toLowerCase(),
778
- ...provider[2]
779
- };
780
- }
781
- }
782
- if (env2.SHELL && env2.SHELL === "/bin/jsh") {
783
- return {
784
- name: "stackblitz",
785
- ci: false
786
- };
787
- }
788
- return {
789
- name: "",
790
- ci: false
791
- };
792
- }
793
- var processShim = typeof process !== "undefined" ? process : {};
794
- var envShim = processShim.env || {};
795
- var providerInfo = detectProvider(envShim);
796
- var nodeENV = typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
797
- processShim.platform;
798
- providerInfo.name;
799
- var isCI2 = toBoolean(envShim.CI) || providerInfo.ci !== false;
800
- var hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
801
- var isDebug = toBoolean(envShim.DEBUG);
802
- var isTest = nodeENV === "test" || toBoolean(envShim.TEST);
803
- toBoolean(envShim.MINIMAL) || isCI2 || isTest || !hasTTY;
804
- function toBoolean(val) {
805
- return val ? val !== "false" : false;
806
- }
807
- function ansiRegex2({ onlyFirst = false } = {}) {
808
- const pattern = [
809
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
810
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
811
- ].join("|");
812
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
813
- }
814
- var regex = ansiRegex2();
815
- function stripAnsi2(string) {
816
- if (typeof string !== "string") {
817
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
818
- }
819
- return string.replace(regex, "");
820
- }
821
- function getDefaultExportFromCjs(x) {
822
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
823
- }
824
- var eastasianwidth = { exports: {} };
825
- (function(module) {
826
- var eaw = {};
827
- {
828
- module.exports = eaw;
829
- }
830
- eaw.eastAsianWidth = function(character) {
831
- var x = character.charCodeAt(0);
832
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
833
- var codePoint = x;
834
- if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
835
- x &= 1023;
836
- y &= 1023;
837
- codePoint = x << 10 | y;
838
- codePoint += 65536;
839
- }
840
- if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
841
- return "F";
842
- }
843
- if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
844
- return "H";
845
- }
846
- 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) {
847
- return "W";
848
- }
849
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
850
- return "Na";
851
- }
852
- if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 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 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 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 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 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) {
853
- return "A";
854
- }
855
- return "N";
856
- };
857
- eaw.characterLength = function(character) {
858
- var code = this.eastAsianWidth(character);
859
- if (code == "F" || code == "W" || code == "A") {
860
- return 2;
861
- } else {
862
- return 1;
863
- }
864
- };
865
- function stringToArray(string) {
866
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
867
- }
868
- eaw.length = function(string) {
869
- var characters = stringToArray(string);
870
- var len = 0;
871
- for (var i = 0; i < characters.length; i++) {
872
- len = len + this.characterLength(characters[i]);
873
- }
874
- return len;
875
- };
876
- eaw.slice = function(text, start, end) {
877
- textLen = eaw.length(text);
878
- start = start ? start : 0;
879
- end = end ? end : 1;
880
- if (start < 0) {
881
- start = textLen + start;
882
- }
883
- if (end < 0) {
884
- end = textLen + end;
885
- }
886
- var result = "";
887
- var eawLen = 0;
888
- var chars = stringToArray(text);
889
- for (var i = 0; i < chars.length; i++) {
890
- var char = chars[i];
891
- var charLen = eaw.length(char);
892
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
893
- if (eawLen + charLen <= end) {
894
- result += char;
895
- } else {
896
- break;
897
- }
898
- }
899
- eawLen += charLen;
900
- }
901
- return result;
902
- };
903
- })(eastasianwidth);
904
- var eastasianwidthExports = eastasianwidth.exports;
905
- var eastAsianWidth = /* @__PURE__ */ getDefaultExportFromCjs(eastasianwidthExports);
906
- var emojiRegex = () => {
907
- 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;
908
- };
909
- function stringWidth$1(string, options) {
910
- if (typeof string !== "string" || string.length === 0) {
911
- return 0;
912
- }
913
- options = {
914
- ambiguousIsNarrow: true,
915
- countAnsiEscapeCodes: false,
916
- ...options
917
- };
918
- if (!options.countAnsiEscapeCodes) {
919
- string = stripAnsi2(string);
920
- }
921
- if (string.length === 0) {
922
- return 0;
923
- }
924
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
925
- let width = 0;
926
- for (const { segment: character } of new Intl.Segmenter().segment(string)) {
927
- const codePoint = character.codePointAt(0);
928
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
929
- continue;
930
- }
931
- if (codePoint >= 768 && codePoint <= 879) {
932
- continue;
933
- }
934
- if (emojiRegex().test(character)) {
935
- width += 2;
936
- continue;
937
- }
938
- const code = eastAsianWidth.eastAsianWidth(character);
939
- switch (code) {
940
- case "F":
941
- case "W": {
942
- width += 2;
943
- break;
944
- }
945
- case "A": {
946
- width += ambiguousCharacterWidth;
947
- break;
948
- }
949
- default: {
950
- width += 1;
951
- }
952
- }
953
- }
954
- return width;
955
- }
956
- function isUnicodeSupported() {
957
- if (process$1__default.default.platform !== "win32") {
958
- return process$1__default.default.env.TERM !== "linux";
959
- }
960
- return Boolean(process$1__default.default.env.CI) || Boolean(process$1__default.default.env.WT_SESSION) || Boolean(process$1__default.default.env.TERMINUS_SUBLIME) || process$1__default.default.env.ConEmuTask === "{cmd::Cmder}" || process$1__default.default.env.TERM_PROGRAM === "Terminus-Sublime" || process$1__default.default.env.TERM_PROGRAM === "vscode" || process$1__default.default.env.TERM === "xterm-256color" || process$1__default.default.env.TERM === "alacritty" || process$1__default.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
961
- }
962
- var TYPE_COLOR_MAP = {
963
- info: "cyan",
964
- fail: "red",
965
- success: "green",
966
- ready: "green",
967
- start: "magenta"
968
- };
969
- var LEVEL_COLOR_MAP = {
970
- 0: "red",
971
- 1: "yellow"
972
- };
973
- var unicode = isUnicodeSupported();
974
- var s = (c, fallback) => unicode ? c : fallback;
975
- var TYPE_ICONS = {
976
- error: s("\u2716", "\xD7"),
977
- fatal: s("\u2716", "\xD7"),
978
- ready: s("\u2714", "\u221A"),
979
- warn: s("\u26A0", "\u203C"),
980
- info: s("\u2139", "i"),
981
- success: s("\u2714", "\u221A"),
982
- debug: s("\u2699", "D"),
983
- trace: s("\u2192", "\u2192"),
984
- fail: s("\u2716", "\xD7"),
985
- start: s("\u25D0", "o"),
986
- log: ""
987
- };
988
- function stringWidth(str) {
989
- if (!Intl.Segmenter) {
990
- return stripAnsi(str).length;
991
- }
992
- return stringWidth$1(str);
993
- }
994
- var FancyReporter = class extends BasicReporter {
995
- formatStack(stack) {
996
- return "\n" + parseStack(stack).map(
997
- (line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)
998
- ).join("\n");
999
- }
1000
- formatType(logObj, isBadge, opts) {
1001
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1002
- if (isBadge) {
1003
- return getBgColor(typeColor)(
1004
- colors.black(` ${logObj.type.toUpperCase()} `)
1005
- );
1006
- }
1007
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1008
- return _type ? getColor2(typeColor)(_type) : "";
1009
- }
1010
- formatLogObj(logObj, opts) {
1011
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
1012
- "\n"
1013
- );
1014
- if (logObj.type === "box") {
1015
- return box(
1016
- characterFormat(
1017
- message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
1018
- ),
1019
- {
1020
- title: logObj.title ? characterFormat(logObj.title) : void 0,
1021
- style: logObj.style
1022
- }
1023
- );
1024
- }
1025
- const date = this.formatDate(logObj.date, opts);
1026
- const coloredDate = date && colors.gray(date);
1027
- const isBadge = logObj.badge ?? logObj.level < 2;
1028
- const type = this.formatType(logObj, isBadge, opts);
1029
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1030
- let line;
1031
- const left = this.filterAndJoin([type, characterFormat(message)]);
1032
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1033
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1034
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1035
- line += characterFormat(
1036
- additional.length > 0 ? "\n" + additional.join("\n") : ""
1037
- );
1038
- if (logObj.type === "trace") {
1039
- const _err = new Error("Trace: " + logObj.message);
1040
- line += this.formatStack(_err.stack || "");
1041
- }
1042
- return isBadge ? "\n" + line + "\n" : line;
1043
- }
1044
- };
1045
- function characterFormat(str) {
1046
- return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
1047
- }
1048
- function getColor2(color = "white") {
1049
- return colors[color] || colors.white;
1050
- }
1051
- function getBgColor(color = "bgWhite") {
1052
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1053
- }
1054
- function createConsola2(options = {}) {
1055
- let level = _getDefaultLogLevel();
1056
- if (process.env.CONSOLA_LEVEL) {
1057
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1058
- }
1059
- const consola2 = createConsola({
1060
- level,
1061
- defaults: { level },
1062
- stdout: process.stdout,
1063
- stderr: process.stderr,
1064
- prompt: (...args) => import('./prompt-EJQPAE7T.cjs').then((m) => m.prompt(...args)),
1065
- reporters: options.reporters || [
1066
- options.fancy ?? !(isCI2 || isTest) ? new FancyReporter() : new BasicReporter()
1067
- ],
1068
- ...options
1069
- });
1070
- return consola2;
1071
- }
1072
- function _getDefaultLogLevel() {
1073
- if (isDebug) {
1074
- return LogLevels.debug;
1075
- }
1076
- if (isTest) {
1077
- return LogLevels.warn;
1078
- }
1079
- return LogLevels.info;
1080
- }
1081
- createConsola2();
1082
-
1083
- exports.colors = colors;
1084
- exports.createConsola = createConsola2;
1085
- exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
1086
- exports.isUnicodeSupported = isUnicodeSupported;
1087
- //# sourceMappingURL=chunk-S4E6TU6G.cjs.map
1088
- //# sourceMappingURL=chunk-S4E6TU6G.cjs.map