@mcesystems/tool-debug-g4 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,1003 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
+
41
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
42
+ var require_ms = __commonJS({
43
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
44
+ var s = 1e3;
45
+ var m = s * 60;
46
+ var h = m * 60;
47
+ var d = h * 24;
48
+ var w = d * 7;
49
+ var y = d * 365.25;
50
+ module.exports = function(val, options) {
51
+ options = options || {};
52
+ var type = typeof val;
53
+ if (type === "string" && val.length > 0) {
54
+ return parse(val);
55
+ } else if (type === "number" && isFinite(val)) {
56
+ return options.long ? fmtLong(val) : fmtShort(val);
57
+ }
58
+ throw new Error(
59
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
60
+ );
61
+ };
62
+ function parse(str) {
63
+ str = String(str);
64
+ if (str.length > 100) {
65
+ return;
66
+ }
67
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
68
+ str
69
+ );
70
+ if (!match) {
71
+ return;
72
+ }
73
+ var n = parseFloat(match[1]);
74
+ var type = (match[2] || "ms").toLowerCase();
75
+ switch (type) {
76
+ case "years":
77
+ case "year":
78
+ case "yrs":
79
+ case "yr":
80
+ case "y":
81
+ return n * y;
82
+ case "weeks":
83
+ case "week":
84
+ case "w":
85
+ return n * w;
86
+ case "days":
87
+ case "day":
88
+ case "d":
89
+ return n * d;
90
+ case "hours":
91
+ case "hour":
92
+ case "hrs":
93
+ case "hr":
94
+ case "h":
95
+ return n * h;
96
+ case "minutes":
97
+ case "minute":
98
+ case "mins":
99
+ case "min":
100
+ case "m":
101
+ return n * m;
102
+ case "seconds":
103
+ case "second":
104
+ case "secs":
105
+ case "sec":
106
+ case "s":
107
+ return n * s;
108
+ case "milliseconds":
109
+ case "millisecond":
110
+ case "msecs":
111
+ case "msec":
112
+ case "ms":
113
+ return n;
114
+ default:
115
+ return void 0;
116
+ }
117
+ }
118
+ function fmtShort(ms) {
119
+ var msAbs = Math.abs(ms);
120
+ if (msAbs >= d) {
121
+ return Math.round(ms / d) + "d";
122
+ }
123
+ if (msAbs >= h) {
124
+ return Math.round(ms / h) + "h";
125
+ }
126
+ if (msAbs >= m) {
127
+ return Math.round(ms / m) + "m";
128
+ }
129
+ if (msAbs >= s) {
130
+ return Math.round(ms / s) + "s";
131
+ }
132
+ return ms + "ms";
133
+ }
134
+ function fmtLong(ms) {
135
+ var msAbs = Math.abs(ms);
136
+ if (msAbs >= d) {
137
+ return plural(ms, msAbs, d, "day");
138
+ }
139
+ if (msAbs >= h) {
140
+ return plural(ms, msAbs, h, "hour");
141
+ }
142
+ if (msAbs >= m) {
143
+ return plural(ms, msAbs, m, "minute");
144
+ }
145
+ if (msAbs >= s) {
146
+ return plural(ms, msAbs, s, "second");
147
+ }
148
+ return ms + " ms";
149
+ }
150
+ function plural(ms, msAbs, n, name) {
151
+ var isPlural = msAbs >= n * 1.5;
152
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
153
+ }
154
+ }
155
+ });
156
+
157
+ // ../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/common.js
158
+ var require_common = __commonJS({
159
+ "../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/common.js"(exports, module) {
160
+ function setup(env2) {
161
+ createDebug2.debug = createDebug2;
162
+ createDebug2.default = createDebug2;
163
+ createDebug2.coerce = coerce;
164
+ createDebug2.disable = disable;
165
+ createDebug2.enable = enable;
166
+ createDebug2.enabled = enabled;
167
+ createDebug2.humanize = require_ms();
168
+ createDebug2.destroy = destroy;
169
+ Object.keys(env2).forEach((key) => {
170
+ createDebug2[key] = env2[key];
171
+ });
172
+ createDebug2.names = [];
173
+ createDebug2.skips = [];
174
+ createDebug2.formatters = {};
175
+ function selectColor(namespace) {
176
+ let hash = 0;
177
+ for (let i = 0; i < namespace.length; i++) {
178
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
179
+ hash |= 0;
180
+ }
181
+ return createDebug2.colors[Math.abs(hash) % createDebug2.colors.length];
182
+ }
183
+ createDebug2.selectColor = selectColor;
184
+ function createDebug2(namespace) {
185
+ let prevTime;
186
+ let enableOverride = null;
187
+ let namespacesCache;
188
+ let enabledCache;
189
+ function debug(...args) {
190
+ if (!debug.enabled) {
191
+ return;
192
+ }
193
+ const self = debug;
194
+ const curr = Number(/* @__PURE__ */ new Date());
195
+ const ms = curr - (prevTime || curr);
196
+ self.diff = ms;
197
+ self.prev = prevTime;
198
+ self.curr = curr;
199
+ prevTime = curr;
200
+ args[0] = createDebug2.coerce(args[0]);
201
+ if (typeof args[0] !== "string") {
202
+ args.unshift("%O");
203
+ }
204
+ let index = 0;
205
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
206
+ if (match === "%%") {
207
+ return "%";
208
+ }
209
+ index++;
210
+ const formatter = createDebug2.formatters[format];
211
+ if (typeof formatter === "function") {
212
+ const val = args[index];
213
+ match = formatter.call(self, val);
214
+ args.splice(index, 1);
215
+ index--;
216
+ }
217
+ return match;
218
+ });
219
+ createDebug2.formatArgs.call(self, args);
220
+ const logFn = self.log || createDebug2.log;
221
+ logFn.apply(self, args);
222
+ }
223
+ debug.namespace = namespace;
224
+ debug.useColors = createDebug2.useColors();
225
+ debug.color = createDebug2.selectColor(namespace);
226
+ debug.extend = extend;
227
+ debug.destroy = createDebug2.destroy;
228
+ Object.defineProperty(debug, "enabled", {
229
+ enumerable: true,
230
+ configurable: false,
231
+ get: () => {
232
+ if (enableOverride !== null) {
233
+ return enableOverride;
234
+ }
235
+ if (namespacesCache !== createDebug2.namespaces) {
236
+ namespacesCache = createDebug2.namespaces;
237
+ enabledCache = createDebug2.enabled(namespace);
238
+ }
239
+ return enabledCache;
240
+ },
241
+ set: (v) => {
242
+ enableOverride = v;
243
+ }
244
+ });
245
+ if (typeof createDebug2.init === "function") {
246
+ createDebug2.init(debug);
247
+ }
248
+ return debug;
249
+ }
250
+ function extend(namespace, delimiter) {
251
+ const newDebug = createDebug2(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
252
+ newDebug.log = this.log;
253
+ return newDebug;
254
+ }
255
+ function enable(namespaces) {
256
+ createDebug2.save(namespaces);
257
+ createDebug2.namespaces = namespaces;
258
+ createDebug2.names = [];
259
+ createDebug2.skips = [];
260
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
261
+ for (const ns of split) {
262
+ if (ns[0] === "-") {
263
+ createDebug2.skips.push(ns.slice(1));
264
+ } else {
265
+ createDebug2.names.push(ns);
266
+ }
267
+ }
268
+ }
269
+ function matchesTemplate(search, template) {
270
+ let searchIndex = 0;
271
+ let templateIndex = 0;
272
+ let starIndex = -1;
273
+ let matchIndex = 0;
274
+ while (searchIndex < search.length) {
275
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
276
+ if (template[templateIndex] === "*") {
277
+ starIndex = templateIndex;
278
+ matchIndex = searchIndex;
279
+ templateIndex++;
280
+ } else {
281
+ searchIndex++;
282
+ templateIndex++;
283
+ }
284
+ } else if (starIndex !== -1) {
285
+ templateIndex = starIndex + 1;
286
+ matchIndex++;
287
+ searchIndex = matchIndex;
288
+ } else {
289
+ return false;
290
+ }
291
+ }
292
+ while (templateIndex < template.length && template[templateIndex] === "*") {
293
+ templateIndex++;
294
+ }
295
+ return templateIndex === template.length;
296
+ }
297
+ function disable() {
298
+ const namespaces = [
299
+ ...createDebug2.names,
300
+ ...createDebug2.skips.map((namespace) => "-" + namespace)
301
+ ].join(",");
302
+ createDebug2.enable("");
303
+ return namespaces;
304
+ }
305
+ function enabled(name) {
306
+ for (const skip of createDebug2.skips) {
307
+ if (matchesTemplate(name, skip)) {
308
+ return false;
309
+ }
310
+ }
311
+ for (const ns of createDebug2.names) {
312
+ if (matchesTemplate(name, ns)) {
313
+ return true;
314
+ }
315
+ }
316
+ return false;
317
+ }
318
+ function coerce(val) {
319
+ if (val instanceof Error) {
320
+ return val.stack || val.message;
321
+ }
322
+ return val;
323
+ }
324
+ function destroy() {
325
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
326
+ }
327
+ createDebug2.enable(createDebug2.load());
328
+ return createDebug2;
329
+ }
330
+ module.exports = setup;
331
+ }
332
+ });
333
+
334
+ // ../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/browser.js
335
+ var require_browser = __commonJS({
336
+ "../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/browser.js"(exports, module) {
337
+ exports.formatArgs = formatArgs;
338
+ exports.save = save;
339
+ exports.load = load;
340
+ exports.useColors = useColors;
341
+ exports.storage = localstorage();
342
+ exports.destroy = /* @__PURE__ */ (() => {
343
+ let warned = false;
344
+ return () => {
345
+ if (!warned) {
346
+ warned = true;
347
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
348
+ }
349
+ };
350
+ })();
351
+ exports.colors = [
352
+ "#0000CC",
353
+ "#0000FF",
354
+ "#0033CC",
355
+ "#0033FF",
356
+ "#0066CC",
357
+ "#0066FF",
358
+ "#0099CC",
359
+ "#0099FF",
360
+ "#00CC00",
361
+ "#00CC33",
362
+ "#00CC66",
363
+ "#00CC99",
364
+ "#00CCCC",
365
+ "#00CCFF",
366
+ "#3300CC",
367
+ "#3300FF",
368
+ "#3333CC",
369
+ "#3333FF",
370
+ "#3366CC",
371
+ "#3366FF",
372
+ "#3399CC",
373
+ "#3399FF",
374
+ "#33CC00",
375
+ "#33CC33",
376
+ "#33CC66",
377
+ "#33CC99",
378
+ "#33CCCC",
379
+ "#33CCFF",
380
+ "#6600CC",
381
+ "#6600FF",
382
+ "#6633CC",
383
+ "#6633FF",
384
+ "#66CC00",
385
+ "#66CC33",
386
+ "#9900CC",
387
+ "#9900FF",
388
+ "#9933CC",
389
+ "#9933FF",
390
+ "#99CC00",
391
+ "#99CC33",
392
+ "#CC0000",
393
+ "#CC0033",
394
+ "#CC0066",
395
+ "#CC0099",
396
+ "#CC00CC",
397
+ "#CC00FF",
398
+ "#CC3300",
399
+ "#CC3333",
400
+ "#CC3366",
401
+ "#CC3399",
402
+ "#CC33CC",
403
+ "#CC33FF",
404
+ "#CC6600",
405
+ "#CC6633",
406
+ "#CC9900",
407
+ "#CC9933",
408
+ "#CCCC00",
409
+ "#CCCC33",
410
+ "#FF0000",
411
+ "#FF0033",
412
+ "#FF0066",
413
+ "#FF0099",
414
+ "#FF00CC",
415
+ "#FF00FF",
416
+ "#FF3300",
417
+ "#FF3333",
418
+ "#FF3366",
419
+ "#FF3399",
420
+ "#FF33CC",
421
+ "#FF33FF",
422
+ "#FF6600",
423
+ "#FF6633",
424
+ "#FF9900",
425
+ "#FF9933",
426
+ "#FFCC00",
427
+ "#FFCC33"
428
+ ];
429
+ function useColors() {
430
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
431
+ return true;
432
+ }
433
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
434
+ return false;
435
+ }
436
+ let m;
437
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
438
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
439
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
440
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
441
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
442
+ }
443
+ function formatArgs(args) {
444
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
445
+ if (!this.useColors) {
446
+ return;
447
+ }
448
+ const c = "color: " + this.color;
449
+ args.splice(1, 0, c, "color: inherit");
450
+ let index = 0;
451
+ let lastC = 0;
452
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
453
+ if (match === "%%") {
454
+ return;
455
+ }
456
+ index++;
457
+ if (match === "%c") {
458
+ lastC = index;
459
+ }
460
+ });
461
+ args.splice(lastC, 0, c);
462
+ }
463
+ exports.log = console.debug || console.log || (() => {
464
+ });
465
+ function save(namespaces) {
466
+ try {
467
+ if (namespaces) {
468
+ exports.storage.setItem("debug", namespaces);
469
+ } else {
470
+ exports.storage.removeItem("debug");
471
+ }
472
+ } catch (error) {
473
+ }
474
+ }
475
+ function load() {
476
+ let r;
477
+ try {
478
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
479
+ } catch (error) {
480
+ }
481
+ if (!r && typeof process !== "undefined" && "env" in process) {
482
+ r = process.env.DEBUG;
483
+ }
484
+ return r;
485
+ }
486
+ function localstorage() {
487
+ try {
488
+ return localStorage;
489
+ } catch (error) {
490
+ }
491
+ }
492
+ module.exports = require_common()(exports);
493
+ var { formatters } = module.exports;
494
+ formatters.j = function(v) {
495
+ try {
496
+ return JSON.stringify(v);
497
+ } catch (error) {
498
+ return "[UnexpectedJSONParseError]: " + error.message;
499
+ }
500
+ };
501
+ }
502
+ });
503
+
504
+ // ../../node_modules/.pnpm/supports-color@10.2.2/node_modules/supports-color/index.js
505
+ var supports_color_exports = {};
506
+ __export(supports_color_exports, {
507
+ createSupportsColor: () => createSupportsColor,
508
+ default: () => supports_color_default
509
+ });
510
+ import process2 from "node:process";
511
+ import os from "node:os";
512
+ import tty from "node:tty";
513
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
514
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
515
+ const position = argv.indexOf(prefix + flag);
516
+ const terminatorPosition = argv.indexOf("--");
517
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
518
+ }
519
+ function envForceColor() {
520
+ if (!("FORCE_COLOR" in env)) {
521
+ return;
522
+ }
523
+ if (env.FORCE_COLOR === "true") {
524
+ return 1;
525
+ }
526
+ if (env.FORCE_COLOR === "false") {
527
+ return 0;
528
+ }
529
+ if (env.FORCE_COLOR.length === 0) {
530
+ return 1;
531
+ }
532
+ const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
533
+ if (![0, 1, 2, 3].includes(level)) {
534
+ return;
535
+ }
536
+ return level;
537
+ }
538
+ function translateLevel(level) {
539
+ if (level === 0) {
540
+ return false;
541
+ }
542
+ return {
543
+ level,
544
+ hasBasic: true,
545
+ has256: level >= 2,
546
+ has16m: level >= 3
547
+ };
548
+ }
549
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
550
+ const noFlagForceColor = envForceColor();
551
+ if (noFlagForceColor !== void 0) {
552
+ flagForceColor = noFlagForceColor;
553
+ }
554
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
555
+ if (forceColor === 0) {
556
+ return 0;
557
+ }
558
+ if (sniffFlags) {
559
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
560
+ return 3;
561
+ }
562
+ if (hasFlag("color=256")) {
563
+ return 2;
564
+ }
565
+ }
566
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
567
+ return 1;
568
+ }
569
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
570
+ return 0;
571
+ }
572
+ const min = forceColor || 0;
573
+ if (env.TERM === "dumb") {
574
+ return min;
575
+ }
576
+ if (process2.platform === "win32") {
577
+ const osRelease = os.release().split(".");
578
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
579
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
580
+ }
581
+ return 1;
582
+ }
583
+ if ("CI" in env) {
584
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
585
+ return 3;
586
+ }
587
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
588
+ return 1;
589
+ }
590
+ return min;
591
+ }
592
+ if ("TEAMCITY_VERSION" in env) {
593
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
594
+ }
595
+ if (env.COLORTERM === "truecolor") {
596
+ return 3;
597
+ }
598
+ if (env.TERM === "xterm-kitty") {
599
+ return 3;
600
+ }
601
+ if (env.TERM === "xterm-ghostty") {
602
+ return 3;
603
+ }
604
+ if (env.TERM === "wezterm") {
605
+ return 3;
606
+ }
607
+ if ("TERM_PROGRAM" in env) {
608
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
609
+ switch (env.TERM_PROGRAM) {
610
+ case "iTerm.app": {
611
+ return version >= 3 ? 3 : 2;
612
+ }
613
+ case "Apple_Terminal": {
614
+ return 2;
615
+ }
616
+ }
617
+ }
618
+ if (/-256(color)?$/i.test(env.TERM)) {
619
+ return 2;
620
+ }
621
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
622
+ return 1;
623
+ }
624
+ if ("COLORTERM" in env) {
625
+ return 1;
626
+ }
627
+ return min;
628
+ }
629
+ function createSupportsColor(stream, options = {}) {
630
+ const level = _supportsColor(stream, {
631
+ streamIsTTY: stream && stream.isTTY,
632
+ ...options
633
+ });
634
+ return translateLevel(level);
635
+ }
636
+ var env, flagForceColor, supportsColor, supports_color_default;
637
+ var init_supports_color = __esm({
638
+ "../../node_modules/.pnpm/supports-color@10.2.2/node_modules/supports-color/index.js"() {
639
+ ({ env } = process2);
640
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
641
+ flagForceColor = 0;
642
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
643
+ flagForceColor = 1;
644
+ }
645
+ supportsColor = {
646
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
647
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
648
+ };
649
+ supports_color_default = supportsColor;
650
+ }
651
+ });
652
+
653
+ // ../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/node.js
654
+ var require_node = __commonJS({
655
+ "../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/node.js"(exports, module) {
656
+ var tty2 = __require("tty");
657
+ var util = __require("util");
658
+ exports.init = init;
659
+ exports.log = log;
660
+ exports.formatArgs = formatArgs;
661
+ exports.save = save;
662
+ exports.load = load;
663
+ exports.useColors = useColors;
664
+ exports.destroy = util.deprecate(
665
+ () => {
666
+ },
667
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
668
+ );
669
+ exports.colors = [6, 2, 3, 4, 5, 1];
670
+ try {
671
+ const supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports));
672
+ if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
673
+ exports.colors = [
674
+ 20,
675
+ 21,
676
+ 26,
677
+ 27,
678
+ 32,
679
+ 33,
680
+ 38,
681
+ 39,
682
+ 40,
683
+ 41,
684
+ 42,
685
+ 43,
686
+ 44,
687
+ 45,
688
+ 56,
689
+ 57,
690
+ 62,
691
+ 63,
692
+ 68,
693
+ 69,
694
+ 74,
695
+ 75,
696
+ 76,
697
+ 77,
698
+ 78,
699
+ 79,
700
+ 80,
701
+ 81,
702
+ 92,
703
+ 93,
704
+ 98,
705
+ 99,
706
+ 112,
707
+ 113,
708
+ 128,
709
+ 129,
710
+ 134,
711
+ 135,
712
+ 148,
713
+ 149,
714
+ 160,
715
+ 161,
716
+ 162,
717
+ 163,
718
+ 164,
719
+ 165,
720
+ 166,
721
+ 167,
722
+ 168,
723
+ 169,
724
+ 170,
725
+ 171,
726
+ 172,
727
+ 173,
728
+ 178,
729
+ 179,
730
+ 184,
731
+ 185,
732
+ 196,
733
+ 197,
734
+ 198,
735
+ 199,
736
+ 200,
737
+ 201,
738
+ 202,
739
+ 203,
740
+ 204,
741
+ 205,
742
+ 206,
743
+ 207,
744
+ 208,
745
+ 209,
746
+ 214,
747
+ 215,
748
+ 220,
749
+ 221
750
+ ];
751
+ }
752
+ } catch (error) {
753
+ }
754
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
755
+ return /^debug_/i.test(key);
756
+ }).reduce((obj, key) => {
757
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
758
+ return k.toUpperCase();
759
+ });
760
+ let val = process.env[key];
761
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
762
+ val = true;
763
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
764
+ val = false;
765
+ } else if (val === "null") {
766
+ val = null;
767
+ } else {
768
+ val = Number(val);
769
+ }
770
+ obj[prop] = val;
771
+ return obj;
772
+ }, {});
773
+ function useColors() {
774
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
775
+ }
776
+ function formatArgs(args) {
777
+ const { namespace: name, useColors: useColors2 } = this;
778
+ if (useColors2) {
779
+ const c = this.color;
780
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
781
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
782
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
783
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
784
+ } else {
785
+ args[0] = getDate() + name + " " + args[0];
786
+ }
787
+ }
788
+ function getDate() {
789
+ if (exports.inspectOpts.hideDate) {
790
+ return "";
791
+ }
792
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
793
+ }
794
+ function log(...args) {
795
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
796
+ }
797
+ function save(namespaces) {
798
+ if (namespaces) {
799
+ process.env.DEBUG = namespaces;
800
+ } else {
801
+ delete process.env.DEBUG;
802
+ }
803
+ }
804
+ function load() {
805
+ return process.env.DEBUG;
806
+ }
807
+ function init(debug) {
808
+ debug.inspectOpts = {};
809
+ const keys = Object.keys(exports.inspectOpts);
810
+ for (let i = 0; i < keys.length; i++) {
811
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
812
+ }
813
+ }
814
+ module.exports = require_common()(exports);
815
+ var { formatters } = module.exports;
816
+ formatters.o = function(v) {
817
+ this.inspectOpts.colors = this.useColors;
818
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
819
+ };
820
+ formatters.O = function(v) {
821
+ this.inspectOpts.colors = this.useColors;
822
+ return util.inspect(v, this.inspectOpts);
823
+ };
824
+ }
825
+ });
826
+
827
+ // ../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js
828
+ var require_src = __commonJS({
829
+ "../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js"(exports, module) {
830
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
831
+ module.exports = require_browser();
832
+ } else {
833
+ module.exports = require_node();
834
+ }
835
+ }
836
+ });
837
+
838
+ // src/debug.ts
839
+ var import_debug = __toESM(require_src());
840
+ var logInfo = (0, import_debug.default)("info");
841
+ var logTask = (0, import_debug.default)("task");
842
+ var logError = (0, import_debug.default)("error");
843
+ var logDetail = (0, import_debug.default)("detail");
844
+ var logDebug = (0, import_debug.default)("debug");
845
+ var logWarning = (0, import_debug.default)("warning");
846
+ var logColor = (0, import_debug.default)("color");
847
+ logInfo.color = "19";
848
+ logTask.color = "25";
849
+ logError.color = "1";
850
+ logDetail.color = "199";
851
+ logWarning.color = "186";
852
+ logDebug.color = "211";
853
+ logColor.enabled = true;
854
+ function logNamespace(namespace) {
855
+ logInfo.namespace = `${namespace}:info`;
856
+ logTask.namespace = `${namespace}:task`;
857
+ logError.namespace = `${namespace}:error`;
858
+ logDetail.namespace = `${namespace}:detail`;
859
+ logWarning.namespace = `${namespace}:warning`;
860
+ logDebug.namespace = `${namespace}:debug`;
861
+ }
862
+ function setLogLevel(level) {
863
+ switch (level) {
864
+ case "info":
865
+ logInfo.enabled = true;
866
+ logTask.enabled = true;
867
+ logError.enabled = true;
868
+ logWarning.enabled = true;
869
+ logDetail.enabled = false;
870
+ logDebug.enabled = false;
871
+ break;
872
+ case "debug":
873
+ logInfo.enabled = true;
874
+ logTask.enabled = true;
875
+ logError.enabled = true;
876
+ logWarning.enabled = true;
877
+ logDetail.enabled = true;
878
+ logDebug.enabled = true;
879
+ break;
880
+ case "none":
881
+ logInfo.enabled = false;
882
+ logTask.enabled = false;
883
+ logError.enabled = false;
884
+ logWarning.enabled = false;
885
+ logDetail.enabled = false;
886
+ logDebug.enabled = false;
887
+ break;
888
+ }
889
+ }
890
+ function setColors(type, color) {
891
+ switch (type) {
892
+ case "info":
893
+ logInfo.color = color;
894
+ break;
895
+ case "task":
896
+ logTask.color = color;
897
+ break;
898
+ case "error":
899
+ logError.color = color;
900
+ break;
901
+ case "detail":
902
+ logDetail.color = color;
903
+ break;
904
+ case "warning":
905
+ logWarning.color = color;
906
+ break;
907
+ case "debug":
908
+ logDebug.color = color;
909
+ break;
910
+ default:
911
+ throw new Error(`Invalid log type: ${type}`);
912
+ }
913
+ }
914
+ function printColors() {
915
+ for (let i = 0; i < 256; i++) {
916
+ logColor.color = `${i}`;
917
+ logColor(`${i}: ${i}`);
918
+ }
919
+ }
920
+ function logDataDetail(data, prefix = "# ") {
921
+ if (data === null || data === void 0) {
922
+ return `${prefix}<null or undefined>`;
923
+ }
924
+ if (typeof data !== "object") {
925
+ return `${prefix}${String(data)}`;
926
+ }
927
+ const keys = Object.keys(data);
928
+ let result = "";
929
+ for (const key of keys) {
930
+ result += `${prefix}${key}: `;
931
+ if (key in data) {
932
+ let dataKey = key;
933
+ if (key in data) {
934
+ dataKey = key;
935
+ const value = data[dataKey];
936
+ if (value === null || value === void 0) {
937
+ result += `<${value === null ? "null" : "undefined"}>
938
+ `;
939
+ } else if (typeof value === "object") {
940
+ result += `
941
+ ${logDataDetail(value, `${prefix} `)}
942
+ `;
943
+ } else {
944
+ result += `${value}
945
+ `;
946
+ }
947
+ }
948
+ }
949
+ }
950
+ return result.trim();
951
+ }
952
+ function header(title, padding = 0) {
953
+ return `${" ".repeat(padding)}${"=".repeat(80)}
954
+ ${" ".repeat(40 - title.length / 2)}${title}
955
+ ${" ".repeat(padding)}${"=".repeat(80)}`;
956
+ }
957
+ function logHeader(title) {
958
+ logInfo(`${header(title, 2)}`);
959
+ }
960
+ function logDataObject(title, ...args) {
961
+ const stack = new Error().stack?.split("\n")[2] || "";
962
+ const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
963
+ let callerDetails = "";
964
+ if (stackMatch) {
965
+ const functionMatch = stack.match(/at (.+) \(/);
966
+ const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
967
+ callerDetails = `${functionName}`;
968
+ }
969
+ logDetail(`${header(`*${title}* ${callerDetails}`)}
970
+ ${args.reduce((acc, arg) => `${acc}
971
+ ${logDataDetail(arg)}`, "")}
972
+
973
+ ${"=".repeat(80)}`);
974
+ }
975
+ function logErrorObject(error, extraDetails) {
976
+ if (error instanceof Error) {
977
+ logError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}
978
+ Error Message:
979
+ ${error.message}
980
+ Error Stack:
981
+ ${error.stack}
982
+ ${"=".repeat(80)}`);
983
+ } else {
984
+ logError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}
985
+ ${"=".repeat(80)}`);
986
+ }
987
+ }
988
+ export {
989
+ logDataObject,
990
+ logDebug,
991
+ logDetail,
992
+ logError,
993
+ logErrorObject,
994
+ logHeader,
995
+ logInfo,
996
+ logNamespace,
997
+ logTask,
998
+ logWarning,
999
+ printColors,
1000
+ setColors,
1001
+ setLogLevel
1002
+ };
1003
+ //# sourceMappingURL=index.mjs.map