@storm-software/untyped 0.24.53 → 0.24.55

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.
@@ -1,1832 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
-
4
-
5
-
6
- var _chunkN77CW7VOcjs = require('./chunk-N77CW7VO.cjs');
7
-
8
- // ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
9
- var require_color_name = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
10
- "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module) {
11
- "use strict";
12
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
13
- module.exports = {
14
- "aliceblue": [240, 248, 255],
15
- "antiquewhite": [250, 235, 215],
16
- "aqua": [0, 255, 255],
17
- "aquamarine": [127, 255, 212],
18
- "azure": [240, 255, 255],
19
- "beige": [245, 245, 220],
20
- "bisque": [255, 228, 196],
21
- "black": [0, 0, 0],
22
- "blanchedalmond": [255, 235, 205],
23
- "blue": [0, 0, 255],
24
- "blueviolet": [138, 43, 226],
25
- "brown": [165, 42, 42],
26
- "burlywood": [222, 184, 135],
27
- "cadetblue": [95, 158, 160],
28
- "chartreuse": [127, 255, 0],
29
- "chocolate": [210, 105, 30],
30
- "coral": [255, 127, 80],
31
- "cornflowerblue": [100, 149, 237],
32
- "cornsilk": [255, 248, 220],
33
- "crimson": [220, 20, 60],
34
- "cyan": [0, 255, 255],
35
- "darkblue": [0, 0, 139],
36
- "darkcyan": [0, 139, 139],
37
- "darkgoldenrod": [184, 134, 11],
38
- "darkgray": [169, 169, 169],
39
- "darkgreen": [0, 100, 0],
40
- "darkgrey": [169, 169, 169],
41
- "darkkhaki": [189, 183, 107],
42
- "darkmagenta": [139, 0, 139],
43
- "darkolivegreen": [85, 107, 47],
44
- "darkorange": [255, 140, 0],
45
- "darkorchid": [153, 50, 204],
46
- "darkred": [139, 0, 0],
47
- "darksalmon": [233, 150, 122],
48
- "darkseagreen": [143, 188, 143],
49
- "darkslateblue": [72, 61, 139],
50
- "darkslategray": [47, 79, 79],
51
- "darkslategrey": [47, 79, 79],
52
- "darkturquoise": [0, 206, 209],
53
- "darkviolet": [148, 0, 211],
54
- "deeppink": [255, 20, 147],
55
- "deepskyblue": [0, 191, 255],
56
- "dimgray": [105, 105, 105],
57
- "dimgrey": [105, 105, 105],
58
- "dodgerblue": [30, 144, 255],
59
- "firebrick": [178, 34, 34],
60
- "floralwhite": [255, 250, 240],
61
- "forestgreen": [34, 139, 34],
62
- "fuchsia": [255, 0, 255],
63
- "gainsboro": [220, 220, 220],
64
- "ghostwhite": [248, 248, 255],
65
- "gold": [255, 215, 0],
66
- "goldenrod": [218, 165, 32],
67
- "gray": [128, 128, 128],
68
- "green": [0, 128, 0],
69
- "greenyellow": [173, 255, 47],
70
- "grey": [128, 128, 128],
71
- "honeydew": [240, 255, 240],
72
- "hotpink": [255, 105, 180],
73
- "indianred": [205, 92, 92],
74
- "indigo": [75, 0, 130],
75
- "ivory": [255, 255, 240],
76
- "khaki": [240, 230, 140],
77
- "lavender": [230, 230, 250],
78
- "lavenderblush": [255, 240, 245],
79
- "lawngreen": [124, 252, 0],
80
- "lemonchiffon": [255, 250, 205],
81
- "lightblue": [173, 216, 230],
82
- "lightcoral": [240, 128, 128],
83
- "lightcyan": [224, 255, 255],
84
- "lightgoldenrodyellow": [250, 250, 210],
85
- "lightgray": [211, 211, 211],
86
- "lightgreen": [144, 238, 144],
87
- "lightgrey": [211, 211, 211],
88
- "lightpink": [255, 182, 193],
89
- "lightsalmon": [255, 160, 122],
90
- "lightseagreen": [32, 178, 170],
91
- "lightskyblue": [135, 206, 250],
92
- "lightslategray": [119, 136, 153],
93
- "lightslategrey": [119, 136, 153],
94
- "lightsteelblue": [176, 196, 222],
95
- "lightyellow": [255, 255, 224],
96
- "lime": [0, 255, 0],
97
- "limegreen": [50, 205, 50],
98
- "linen": [250, 240, 230],
99
- "magenta": [255, 0, 255],
100
- "maroon": [128, 0, 0],
101
- "mediumaquamarine": [102, 205, 170],
102
- "mediumblue": [0, 0, 205],
103
- "mediumorchid": [186, 85, 211],
104
- "mediumpurple": [147, 112, 219],
105
- "mediumseagreen": [60, 179, 113],
106
- "mediumslateblue": [123, 104, 238],
107
- "mediumspringgreen": [0, 250, 154],
108
- "mediumturquoise": [72, 209, 204],
109
- "mediumvioletred": [199, 21, 133],
110
- "midnightblue": [25, 25, 112],
111
- "mintcream": [245, 255, 250],
112
- "mistyrose": [255, 228, 225],
113
- "moccasin": [255, 228, 181],
114
- "navajowhite": [255, 222, 173],
115
- "navy": [0, 0, 128],
116
- "oldlace": [253, 245, 230],
117
- "olive": [128, 128, 0],
118
- "olivedrab": [107, 142, 35],
119
- "orange": [255, 165, 0],
120
- "orangered": [255, 69, 0],
121
- "orchid": [218, 112, 214],
122
- "palegoldenrod": [238, 232, 170],
123
- "palegreen": [152, 251, 152],
124
- "paleturquoise": [175, 238, 238],
125
- "palevioletred": [219, 112, 147],
126
- "papayawhip": [255, 239, 213],
127
- "peachpuff": [255, 218, 185],
128
- "peru": [205, 133, 63],
129
- "pink": [255, 192, 203],
130
- "plum": [221, 160, 221],
131
- "powderblue": [176, 224, 230],
132
- "purple": [128, 0, 128],
133
- "rebeccapurple": [102, 51, 153],
134
- "red": [255, 0, 0],
135
- "rosybrown": [188, 143, 143],
136
- "royalblue": [65, 105, 225],
137
- "saddlebrown": [139, 69, 19],
138
- "salmon": [250, 128, 114],
139
- "sandybrown": [244, 164, 96],
140
- "seagreen": [46, 139, 87],
141
- "seashell": [255, 245, 238],
142
- "sienna": [160, 82, 45],
143
- "silver": [192, 192, 192],
144
- "skyblue": [135, 206, 235],
145
- "slateblue": [106, 90, 205],
146
- "slategray": [112, 128, 144],
147
- "slategrey": [112, 128, 144],
148
- "snow": [255, 250, 250],
149
- "springgreen": [0, 255, 127],
150
- "steelblue": [70, 130, 180],
151
- "tan": [210, 180, 140],
152
- "teal": [0, 128, 128],
153
- "thistle": [216, 191, 216],
154
- "tomato": [255, 99, 71],
155
- "turquoise": [64, 224, 208],
156
- "violet": [238, 130, 238],
157
- "wheat": [245, 222, 179],
158
- "white": [255, 255, 255],
159
- "whitesmoke": [245, 245, 245],
160
- "yellow": [255, 255, 0],
161
- "yellowgreen": [154, 205, 50]
162
- };
163
- }
164
- });
165
-
166
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
167
- var require_conversions = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
168
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module) {
169
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
170
- var cssKeywords = require_color_name();
171
- var reverseKeywords = {};
172
- for (const key of Object.keys(cssKeywords)) {
173
- reverseKeywords[cssKeywords[key]] = key;
174
- }
175
- var convert = {
176
- rgb: { channels: 3, labels: "rgb" },
177
- hsl: { channels: 3, labels: "hsl" },
178
- hsv: { channels: 3, labels: "hsv" },
179
- hwb: { channels: 3, labels: "hwb" },
180
- cmyk: { channels: 4, labels: "cmyk" },
181
- xyz: { channels: 3, labels: "xyz" },
182
- lab: { channels: 3, labels: "lab" },
183
- lch: { channels: 3, labels: "lch" },
184
- hex: { channels: 1, labels: ["hex"] },
185
- keyword: { channels: 1, labels: ["keyword"] },
186
- ansi16: { channels: 1, labels: ["ansi16"] },
187
- ansi256: { channels: 1, labels: ["ansi256"] },
188
- hcg: { channels: 3, labels: ["h", "c", "g"] },
189
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
190
- gray: { channels: 1, labels: ["gray"] }
191
- };
192
- module.exports = convert;
193
- for (const model of Object.keys(convert)) {
194
- if (!("channels" in convert[model])) {
195
- throw new Error("missing channels property: " + model);
196
- }
197
- if (!("labels" in convert[model])) {
198
- throw new Error("missing channel labels property: " + model);
199
- }
200
- if (convert[model].labels.length !== convert[model].channels) {
201
- throw new Error("channel and label counts mismatch: " + model);
202
- }
203
- const { channels, labels } = convert[model];
204
- delete convert[model].channels;
205
- delete convert[model].labels;
206
- Object.defineProperty(convert[model], "channels", { value: channels });
207
- Object.defineProperty(convert[model], "labels", { value: labels });
208
- }
209
- convert.rgb.hsl = function(rgb) {
210
- const r = rgb[0] / 255;
211
- const g = rgb[1] / 255;
212
- const b = rgb[2] / 255;
213
- const min = Math.min(r, g, b);
214
- const max = Math.max(r, g, b);
215
- const delta = max - min;
216
- let h;
217
- let s;
218
- if (max === min) {
219
- h = 0;
220
- } else if (r === max) {
221
- h = (g - b) / delta;
222
- } else if (g === max) {
223
- h = 2 + (b - r) / delta;
224
- } else if (b === max) {
225
- h = 4 + (r - g) / delta;
226
- }
227
- h = Math.min(h * 60, 360);
228
- if (h < 0) {
229
- h += 360;
230
- }
231
- const l = (min + max) / 2;
232
- if (max === min) {
233
- s = 0;
234
- } else if (l <= 0.5) {
235
- s = delta / (max + min);
236
- } else {
237
- s = delta / (2 - max - min);
238
- }
239
- return [h, s * 100, l * 100];
240
- };
241
- convert.rgb.hsv = function(rgb) {
242
- let rdif;
243
- let gdif;
244
- let bdif;
245
- let h;
246
- let s;
247
- const r = rgb[0] / 255;
248
- const g = rgb[1] / 255;
249
- const b = rgb[2] / 255;
250
- const v = Math.max(r, g, b);
251
- const diff = v - Math.min(r, g, b);
252
- const diffc = function(c) {
253
- return (v - c) / 6 / diff + 1 / 2;
254
- };
255
- if (diff === 0) {
256
- h = 0;
257
- s = 0;
258
- } else {
259
- s = diff / v;
260
- rdif = diffc(r);
261
- gdif = diffc(g);
262
- bdif = diffc(b);
263
- if (r === v) {
264
- h = bdif - gdif;
265
- } else if (g === v) {
266
- h = 1 / 3 + rdif - bdif;
267
- } else if (b === v) {
268
- h = 2 / 3 + gdif - rdif;
269
- }
270
- if (h < 0) {
271
- h += 1;
272
- } else if (h > 1) {
273
- h -= 1;
274
- }
275
- }
276
- return [
277
- h * 360,
278
- s * 100,
279
- v * 100
280
- ];
281
- };
282
- convert.rgb.hwb = function(rgb) {
283
- const r = rgb[0];
284
- const g = rgb[1];
285
- let b = rgb[2];
286
- const h = convert.rgb.hsl(rgb)[0];
287
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
288
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
289
- return [h, w * 100, b * 100];
290
- };
291
- convert.rgb.cmyk = function(rgb) {
292
- const r = rgb[0] / 255;
293
- const g = rgb[1] / 255;
294
- const b = rgb[2] / 255;
295
- const k = Math.min(1 - r, 1 - g, 1 - b);
296
- const c = (1 - r - k) / (1 - k) || 0;
297
- const m = (1 - g - k) / (1 - k) || 0;
298
- const y = (1 - b - k) / (1 - k) || 0;
299
- return [c * 100, m * 100, y * 100, k * 100];
300
- };
301
- function comparativeDistance(x, y) {
302
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
303
- }
304
- convert.rgb.keyword = function(rgb) {
305
- const reversed = reverseKeywords[rgb];
306
- if (reversed) {
307
- return reversed;
308
- }
309
- let currentClosestDistance = Infinity;
310
- let currentClosestKeyword;
311
- for (const keyword of Object.keys(cssKeywords)) {
312
- const value = cssKeywords[keyword];
313
- const distance = comparativeDistance(rgb, value);
314
- if (distance < currentClosestDistance) {
315
- currentClosestDistance = distance;
316
- currentClosestKeyword = keyword;
317
- }
318
- }
319
- return currentClosestKeyword;
320
- };
321
- convert.keyword.rgb = function(keyword) {
322
- return cssKeywords[keyword];
323
- };
324
- convert.rgb.xyz = function(rgb) {
325
- let r = rgb[0] / 255;
326
- let g = rgb[1] / 255;
327
- let b = rgb[2] / 255;
328
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
329
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
330
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
331
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
332
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
333
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
334
- return [x * 100, y * 100, z * 100];
335
- };
336
- convert.rgb.lab = function(rgb) {
337
- const xyz = convert.rgb.xyz(rgb);
338
- let x = xyz[0];
339
- let y = xyz[1];
340
- let z = xyz[2];
341
- x /= 95.047;
342
- y /= 100;
343
- z /= 108.883;
344
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
345
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
346
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
347
- const l = 116 * y - 16;
348
- const a = 500 * (x - y);
349
- const b = 200 * (y - z);
350
- return [l, a, b];
351
- };
352
- convert.hsl.rgb = function(hsl) {
353
- const h = hsl[0] / 360;
354
- const s = hsl[1] / 100;
355
- const l = hsl[2] / 100;
356
- let t2;
357
- let t3;
358
- let val;
359
- if (s === 0) {
360
- val = l * 255;
361
- return [val, val, val];
362
- }
363
- if (l < 0.5) {
364
- t2 = l * (1 + s);
365
- } else {
366
- t2 = l + s - l * s;
367
- }
368
- const t1 = 2 * l - t2;
369
- const rgb = [0, 0, 0];
370
- for (let i = 0; i < 3; i++) {
371
- t3 = h + 1 / 3 * -(i - 1);
372
- if (t3 < 0) {
373
- t3++;
374
- }
375
- if (t3 > 1) {
376
- t3--;
377
- }
378
- if (6 * t3 < 1) {
379
- val = t1 + (t2 - t1) * 6 * t3;
380
- } else if (2 * t3 < 1) {
381
- val = t2;
382
- } else if (3 * t3 < 2) {
383
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
384
- } else {
385
- val = t1;
386
- }
387
- rgb[i] = val * 255;
388
- }
389
- return rgb;
390
- };
391
- convert.hsl.hsv = function(hsl) {
392
- const h = hsl[0];
393
- let s = hsl[1] / 100;
394
- let l = hsl[2] / 100;
395
- let smin = s;
396
- const lmin = Math.max(l, 0.01);
397
- l *= 2;
398
- s *= l <= 1 ? l : 2 - l;
399
- smin *= lmin <= 1 ? lmin : 2 - lmin;
400
- const v = (l + s) / 2;
401
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
402
- return [h, sv * 100, v * 100];
403
- };
404
- convert.hsv.rgb = function(hsv) {
405
- const h = hsv[0] / 60;
406
- const s = hsv[1] / 100;
407
- let v = hsv[2] / 100;
408
- const hi = Math.floor(h) % 6;
409
- const f = h - Math.floor(h);
410
- const p = 255 * v * (1 - s);
411
- const q = 255 * v * (1 - s * f);
412
- const t = 255 * v * (1 - s * (1 - f));
413
- v *= 255;
414
- switch (hi) {
415
- case 0:
416
- return [v, t, p];
417
- case 1:
418
- return [q, v, p];
419
- case 2:
420
- return [p, v, t];
421
- case 3:
422
- return [p, q, v];
423
- case 4:
424
- return [t, p, v];
425
- case 5:
426
- return [v, p, q];
427
- }
428
- };
429
- convert.hsv.hsl = function(hsv) {
430
- const h = hsv[0];
431
- const s = hsv[1] / 100;
432
- const v = hsv[2] / 100;
433
- const vmin = Math.max(v, 0.01);
434
- let sl;
435
- let l;
436
- l = (2 - s) * v;
437
- const lmin = (2 - s) * vmin;
438
- sl = s * vmin;
439
- sl /= lmin <= 1 ? lmin : 2 - lmin;
440
- sl = sl || 0;
441
- l /= 2;
442
- return [h, sl * 100, l * 100];
443
- };
444
- convert.hwb.rgb = function(hwb) {
445
- const h = hwb[0] / 360;
446
- let wh = hwb[1] / 100;
447
- let bl = hwb[2] / 100;
448
- const ratio = wh + bl;
449
- let f;
450
- if (ratio > 1) {
451
- wh /= ratio;
452
- bl /= ratio;
453
- }
454
- const i = Math.floor(6 * h);
455
- const v = 1 - bl;
456
- f = 6 * h - i;
457
- if ((i & 1) !== 0) {
458
- f = 1 - f;
459
- }
460
- const n = wh + f * (v - wh);
461
- let r;
462
- let g;
463
- let b;
464
- switch (i) {
465
- default:
466
- case 6:
467
- case 0:
468
- r = v;
469
- g = n;
470
- b = wh;
471
- break;
472
- case 1:
473
- r = n;
474
- g = v;
475
- b = wh;
476
- break;
477
- case 2:
478
- r = wh;
479
- g = v;
480
- b = n;
481
- break;
482
- case 3:
483
- r = wh;
484
- g = n;
485
- b = v;
486
- break;
487
- case 4:
488
- r = n;
489
- g = wh;
490
- b = v;
491
- break;
492
- case 5:
493
- r = v;
494
- g = wh;
495
- b = n;
496
- break;
497
- }
498
- return [r * 255, g * 255, b * 255];
499
- };
500
- convert.cmyk.rgb = function(cmyk) {
501
- const c = cmyk[0] / 100;
502
- const m = cmyk[1] / 100;
503
- const y = cmyk[2] / 100;
504
- const k = cmyk[3] / 100;
505
- const r = 1 - Math.min(1, c * (1 - k) + k);
506
- const g = 1 - Math.min(1, m * (1 - k) + k);
507
- const b = 1 - Math.min(1, y * (1 - k) + k);
508
- return [r * 255, g * 255, b * 255];
509
- };
510
- convert.xyz.rgb = function(xyz) {
511
- const x = xyz[0] / 100;
512
- const y = xyz[1] / 100;
513
- const z = xyz[2] / 100;
514
- let r;
515
- let g;
516
- let b;
517
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
518
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
519
- b = x * 0.0557 + y * -0.204 + z * 1.057;
520
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
521
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
522
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
523
- r = Math.min(Math.max(0, r), 1);
524
- g = Math.min(Math.max(0, g), 1);
525
- b = Math.min(Math.max(0, b), 1);
526
- return [r * 255, g * 255, b * 255];
527
- };
528
- convert.xyz.lab = function(xyz) {
529
- let x = xyz[0];
530
- let y = xyz[1];
531
- let z = xyz[2];
532
- x /= 95.047;
533
- y /= 100;
534
- z /= 108.883;
535
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
536
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
537
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
538
- const l = 116 * y - 16;
539
- const a = 500 * (x - y);
540
- const b = 200 * (y - z);
541
- return [l, a, b];
542
- };
543
- convert.lab.xyz = function(lab) {
544
- const l = lab[0];
545
- const a = lab[1];
546
- const b = lab[2];
547
- let x;
548
- let y;
549
- let z;
550
- y = (l + 16) / 116;
551
- x = a / 500 + y;
552
- z = y - b / 200;
553
- const y2 = y ** 3;
554
- const x2 = x ** 3;
555
- const z2 = z ** 3;
556
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
557
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
558
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
559
- x *= 95.047;
560
- y *= 100;
561
- z *= 108.883;
562
- return [x, y, z];
563
- };
564
- convert.lab.lch = function(lab) {
565
- const l = lab[0];
566
- const a = lab[1];
567
- const b = lab[2];
568
- let h;
569
- const hr = Math.atan2(b, a);
570
- h = hr * 360 / 2 / Math.PI;
571
- if (h < 0) {
572
- h += 360;
573
- }
574
- const c = Math.sqrt(a * a + b * b);
575
- return [l, c, h];
576
- };
577
- convert.lch.lab = function(lch) {
578
- const l = lch[0];
579
- const c = lch[1];
580
- const h = lch[2];
581
- const hr = h / 360 * 2 * Math.PI;
582
- const a = c * Math.cos(hr);
583
- const b = c * Math.sin(hr);
584
- return [l, a, b];
585
- };
586
- convert.rgb.ansi16 = function(args, saturation = null) {
587
- const [r, g, b] = args;
588
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
589
- value = Math.round(value / 50);
590
- if (value === 0) {
591
- return 30;
592
- }
593
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
594
- if (value === 2) {
595
- ansi += 60;
596
- }
597
- return ansi;
598
- };
599
- convert.hsv.ansi16 = function(args) {
600
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
601
- };
602
- convert.rgb.ansi256 = function(args) {
603
- const r = args[0];
604
- const g = args[1];
605
- const b = args[2];
606
- if (r === g && g === b) {
607
- if (r < 8) {
608
- return 16;
609
- }
610
- if (r > 248) {
611
- return 231;
612
- }
613
- return Math.round((r - 8) / 247 * 24) + 232;
614
- }
615
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
616
- return ansi;
617
- };
618
- convert.ansi16.rgb = function(args) {
619
- let color = args % 10;
620
- if (color === 0 || color === 7) {
621
- if (args > 50) {
622
- color += 3.5;
623
- }
624
- color = color / 10.5 * 255;
625
- return [color, color, color];
626
- }
627
- const mult = (~~(args > 50) + 1) * 0.5;
628
- const r = (color & 1) * mult * 255;
629
- const g = (color >> 1 & 1) * mult * 255;
630
- const b = (color >> 2 & 1) * mult * 255;
631
- return [r, g, b];
632
- };
633
- convert.ansi256.rgb = function(args) {
634
- if (args >= 232) {
635
- const c = (args - 232) * 10 + 8;
636
- return [c, c, c];
637
- }
638
- args -= 16;
639
- let rem;
640
- const r = Math.floor(args / 36) / 5 * 255;
641
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
642
- const b = rem % 6 / 5 * 255;
643
- return [r, g, b];
644
- };
645
- convert.rgb.hex = function(args) {
646
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
647
- const string = integer.toString(16).toUpperCase();
648
- return "000000".substring(string.length) + string;
649
- };
650
- convert.hex.rgb = function(args) {
651
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
652
- if (!match) {
653
- return [0, 0, 0];
654
- }
655
- let colorString = match[0];
656
- if (match[0].length === 3) {
657
- colorString = colorString.split("").map((char) => {
658
- return char + char;
659
- }).join("");
660
- }
661
- const integer = parseInt(colorString, 16);
662
- const r = integer >> 16 & 255;
663
- const g = integer >> 8 & 255;
664
- const b = integer & 255;
665
- return [r, g, b];
666
- };
667
- convert.rgb.hcg = function(rgb) {
668
- const r = rgb[0] / 255;
669
- const g = rgb[1] / 255;
670
- const b = rgb[2] / 255;
671
- const max = Math.max(Math.max(r, g), b);
672
- const min = Math.min(Math.min(r, g), b);
673
- const chroma = max - min;
674
- let grayscale;
675
- let hue;
676
- if (chroma < 1) {
677
- grayscale = min / (1 - chroma);
678
- } else {
679
- grayscale = 0;
680
- }
681
- if (chroma <= 0) {
682
- hue = 0;
683
- } else if (max === r) {
684
- hue = (g - b) / chroma % 6;
685
- } else if (max === g) {
686
- hue = 2 + (b - r) / chroma;
687
- } else {
688
- hue = 4 + (r - g) / chroma;
689
- }
690
- hue /= 6;
691
- hue %= 1;
692
- return [hue * 360, chroma * 100, grayscale * 100];
693
- };
694
- convert.hsl.hcg = function(hsl) {
695
- const s = hsl[1] / 100;
696
- const l = hsl[2] / 100;
697
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
698
- let f = 0;
699
- if (c < 1) {
700
- f = (l - 0.5 * c) / (1 - c);
701
- }
702
- return [hsl[0], c * 100, f * 100];
703
- };
704
- convert.hsv.hcg = function(hsv) {
705
- const s = hsv[1] / 100;
706
- const v = hsv[2] / 100;
707
- const c = s * v;
708
- let f = 0;
709
- if (c < 1) {
710
- f = (v - c) / (1 - c);
711
- }
712
- return [hsv[0], c * 100, f * 100];
713
- };
714
- convert.hcg.rgb = function(hcg) {
715
- const h = hcg[0] / 360;
716
- const c = hcg[1] / 100;
717
- const g = hcg[2] / 100;
718
- if (c === 0) {
719
- return [g * 255, g * 255, g * 255];
720
- }
721
- const pure = [0, 0, 0];
722
- const hi = h % 1 * 6;
723
- const v = hi % 1;
724
- const w = 1 - v;
725
- let mg = 0;
726
- switch (Math.floor(hi)) {
727
- case 0:
728
- pure[0] = 1;
729
- pure[1] = v;
730
- pure[2] = 0;
731
- break;
732
- case 1:
733
- pure[0] = w;
734
- pure[1] = 1;
735
- pure[2] = 0;
736
- break;
737
- case 2:
738
- pure[0] = 0;
739
- pure[1] = 1;
740
- pure[2] = v;
741
- break;
742
- case 3:
743
- pure[0] = 0;
744
- pure[1] = w;
745
- pure[2] = 1;
746
- break;
747
- case 4:
748
- pure[0] = v;
749
- pure[1] = 0;
750
- pure[2] = 1;
751
- break;
752
- default:
753
- pure[0] = 1;
754
- pure[1] = 0;
755
- pure[2] = w;
756
- }
757
- mg = (1 - c) * g;
758
- return [
759
- (c * pure[0] + mg) * 255,
760
- (c * pure[1] + mg) * 255,
761
- (c * pure[2] + mg) * 255
762
- ];
763
- };
764
- convert.hcg.hsv = function(hcg) {
765
- const c = hcg[1] / 100;
766
- const g = hcg[2] / 100;
767
- const v = c + g * (1 - c);
768
- let f = 0;
769
- if (v > 0) {
770
- f = c / v;
771
- }
772
- return [hcg[0], f * 100, v * 100];
773
- };
774
- convert.hcg.hsl = function(hcg) {
775
- const c = hcg[1] / 100;
776
- const g = hcg[2] / 100;
777
- const l = g * (1 - c) + 0.5 * c;
778
- let s = 0;
779
- if (l > 0 && l < 0.5) {
780
- s = c / (2 * l);
781
- } else if (l >= 0.5 && l < 1) {
782
- s = c / (2 * (1 - l));
783
- }
784
- return [hcg[0], s * 100, l * 100];
785
- };
786
- convert.hcg.hwb = function(hcg) {
787
- const c = hcg[1] / 100;
788
- const g = hcg[2] / 100;
789
- const v = c + g * (1 - c);
790
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
791
- };
792
- convert.hwb.hcg = function(hwb) {
793
- const w = hwb[1] / 100;
794
- const b = hwb[2] / 100;
795
- const v = 1 - b;
796
- const c = v - w;
797
- let g = 0;
798
- if (c < 1) {
799
- g = (v - c) / (1 - c);
800
- }
801
- return [hwb[0], c * 100, g * 100];
802
- };
803
- convert.apple.rgb = function(apple) {
804
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
805
- };
806
- convert.rgb.apple = function(rgb) {
807
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
808
- };
809
- convert.gray.rgb = function(args) {
810
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
811
- };
812
- convert.gray.hsl = function(args) {
813
- return [0, 0, args[0]];
814
- };
815
- convert.gray.hsv = convert.gray.hsl;
816
- convert.gray.hwb = function(gray) {
817
- return [0, 100, gray[0]];
818
- };
819
- convert.gray.cmyk = function(gray) {
820
- return [0, 0, 0, gray[0]];
821
- };
822
- convert.gray.lab = function(gray) {
823
- return [gray[0], 0, 0];
824
- };
825
- convert.gray.hex = function(gray) {
826
- const val = Math.round(gray[0] / 100 * 255) & 255;
827
- const integer = (val << 16) + (val << 8) + val;
828
- const string = integer.toString(16).toUpperCase();
829
- return "000000".substring(string.length) + string;
830
- };
831
- convert.rgb.gray = function(rgb) {
832
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
833
- return [val / 255 * 100];
834
- };
835
- }
836
- });
837
-
838
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
839
- var require_route = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
840
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module) {
841
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
842
- var conversions = require_conversions();
843
- function buildGraph() {
844
- const graph = {};
845
- const models = Object.keys(conversions);
846
- for (let len = models.length, i = 0; i < len; i++) {
847
- graph[models[i]] = {
848
- // http://jsperf.com/1-vs-infinity
849
- // micro-opt, but this is simple.
850
- distance: -1,
851
- parent: null
852
- };
853
- }
854
- return graph;
855
- }
856
- function deriveBFS(fromModel) {
857
- const graph = buildGraph();
858
- const queue = [fromModel];
859
- graph[fromModel].distance = 0;
860
- while (queue.length) {
861
- const current = queue.pop();
862
- const adjacents = Object.keys(conversions[current]);
863
- for (let len = adjacents.length, i = 0; i < len; i++) {
864
- const adjacent = adjacents[i];
865
- const node = graph[adjacent];
866
- if (node.distance === -1) {
867
- node.distance = graph[current].distance + 1;
868
- node.parent = current;
869
- queue.unshift(adjacent);
870
- }
871
- }
872
- }
873
- return graph;
874
- }
875
- function link(from, to) {
876
- return function(args) {
877
- return to(from(args));
878
- };
879
- }
880
- function wrapConversion(toModel, graph) {
881
- const path = [graph[toModel].parent, toModel];
882
- let fn = conversions[graph[toModel].parent][toModel];
883
- let cur = graph[toModel].parent;
884
- while (graph[cur].parent) {
885
- path.unshift(graph[cur].parent);
886
- fn = link(conversions[graph[cur].parent][cur], fn);
887
- cur = graph[cur].parent;
888
- }
889
- fn.conversion = path;
890
- return fn;
891
- }
892
- module.exports = function(fromModel) {
893
- const graph = deriveBFS(fromModel);
894
- const conversion = {};
895
- const models = Object.keys(graph);
896
- for (let len = models.length, i = 0; i < len; i++) {
897
- const toModel = models[i];
898
- const node = graph[toModel];
899
- if (node.parent === null) {
900
- continue;
901
- }
902
- conversion[toModel] = wrapConversion(toModel, graph);
903
- }
904
- return conversion;
905
- };
906
- }
907
- });
908
-
909
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
910
- var require_color_convert = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
911
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module) {
912
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
913
- var conversions = require_conversions();
914
- var route = require_route();
915
- var convert = {};
916
- var models = Object.keys(conversions);
917
- function wrapRaw(fn) {
918
- const wrappedFn = function(...args) {
919
- const arg0 = args[0];
920
- if (arg0 === void 0 || arg0 === null) {
921
- return arg0;
922
- }
923
- if (arg0.length > 1) {
924
- args = arg0;
925
- }
926
- return fn(args);
927
- };
928
- if ("conversion" in fn) {
929
- wrappedFn.conversion = fn.conversion;
930
- }
931
- return wrappedFn;
932
- }
933
- function wrapRounded(fn) {
934
- const wrappedFn = function(...args) {
935
- const arg0 = args[0];
936
- if (arg0 === void 0 || arg0 === null) {
937
- return arg0;
938
- }
939
- if (arg0.length > 1) {
940
- args = arg0;
941
- }
942
- const result = fn(args);
943
- if (typeof result === "object") {
944
- for (let len = result.length, i = 0; i < len; i++) {
945
- result[i] = Math.round(result[i]);
946
- }
947
- }
948
- return result;
949
- };
950
- if ("conversion" in fn) {
951
- wrappedFn.conversion = fn.conversion;
952
- }
953
- return wrappedFn;
954
- }
955
- models.forEach((fromModel) => {
956
- convert[fromModel] = {};
957
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
958
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
959
- const routes = route(fromModel);
960
- const routeModels = Object.keys(routes);
961
- routeModels.forEach((toModel) => {
962
- const fn = routes[toModel];
963
- convert[fromModel][toModel] = wrapRounded(fn);
964
- convert[fromModel][toModel].raw = wrapRaw(fn);
965
- });
966
- });
967
- module.exports = convert;
968
- }
969
- });
970
-
971
- // ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
972
- var require_ansi_styles = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
973
- "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) {
974
- "use strict";
975
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
976
- var wrapAnsi16 = (fn, offset) => (...args) => {
977
- const code = fn(...args);
978
- return `\x1B[${code + offset}m`;
979
- };
980
- var wrapAnsi256 = (fn, offset) => (...args) => {
981
- const code = fn(...args);
982
- return `\x1B[${38 + offset};5;${code}m`;
983
- };
984
- var wrapAnsi16m = (fn, offset) => (...args) => {
985
- const rgb = fn(...args);
986
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
987
- };
988
- var ansi2ansi = (n) => n;
989
- var rgb2rgb = (r, g, b) => [r, g, b];
990
- var setLazyProperty = (object, property, get) => {
991
- Object.defineProperty(object, property, {
992
- get: () => {
993
- const value = get();
994
- Object.defineProperty(object, property, {
995
- value,
996
- enumerable: true,
997
- configurable: true
998
- });
999
- return value;
1000
- },
1001
- enumerable: true,
1002
- configurable: true
1003
- });
1004
- };
1005
- var colorConvert;
1006
- var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1007
- if (colorConvert === void 0) {
1008
- colorConvert = require_color_convert();
1009
- }
1010
- const offset = isBackground ? 10 : 0;
1011
- const styles = {};
1012
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1013
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1014
- if (sourceSpace === targetSpace) {
1015
- styles[name] = wrap(identity, offset);
1016
- } else if (typeof suite === "object") {
1017
- styles[name] = wrap(suite[targetSpace], offset);
1018
- }
1019
- }
1020
- return styles;
1021
- };
1022
- function assembleStyles() {
1023
- const codes = /* @__PURE__ */ new Map();
1024
- const styles = {
1025
- modifier: {
1026
- reset: [0, 0],
1027
- // 21 isn't widely supported and 22 does the same thing
1028
- bold: [1, 22],
1029
- dim: [2, 22],
1030
- italic: [3, 23],
1031
- underline: [4, 24],
1032
- inverse: [7, 27],
1033
- hidden: [8, 28],
1034
- strikethrough: [9, 29]
1035
- },
1036
- color: {
1037
- black: [30, 39],
1038
- red: [31, 39],
1039
- green: [32, 39],
1040
- yellow: [33, 39],
1041
- blue: [34, 39],
1042
- magenta: [35, 39],
1043
- cyan: [36, 39],
1044
- white: [37, 39],
1045
- // Bright color
1046
- blackBright: [90, 39],
1047
- redBright: [91, 39],
1048
- greenBright: [92, 39],
1049
- yellowBright: [93, 39],
1050
- blueBright: [94, 39],
1051
- magentaBright: [95, 39],
1052
- cyanBright: [96, 39],
1053
- whiteBright: [97, 39]
1054
- },
1055
- bgColor: {
1056
- bgBlack: [40, 49],
1057
- bgRed: [41, 49],
1058
- bgGreen: [42, 49],
1059
- bgYellow: [43, 49],
1060
- bgBlue: [44, 49],
1061
- bgMagenta: [45, 49],
1062
- bgCyan: [46, 49],
1063
- bgWhite: [47, 49],
1064
- // Bright color
1065
- bgBlackBright: [100, 49],
1066
- bgRedBright: [101, 49],
1067
- bgGreenBright: [102, 49],
1068
- bgYellowBright: [103, 49],
1069
- bgBlueBright: [104, 49],
1070
- bgMagentaBright: [105, 49],
1071
- bgCyanBright: [106, 49],
1072
- bgWhiteBright: [107, 49]
1073
- }
1074
- };
1075
- styles.color.gray = styles.color.blackBright;
1076
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1077
- styles.color.grey = styles.color.blackBright;
1078
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1079
- for (const [groupName, group] of Object.entries(styles)) {
1080
- for (const [styleName, style] of Object.entries(group)) {
1081
- styles[styleName] = {
1082
- open: `\x1B[${style[0]}m`,
1083
- close: `\x1B[${style[1]}m`
1084
- };
1085
- group[styleName] = styles[styleName];
1086
- codes.set(style[0], style[1]);
1087
- }
1088
- Object.defineProperty(styles, groupName, {
1089
- value: group,
1090
- enumerable: false
1091
- });
1092
- }
1093
- Object.defineProperty(styles, "codes", {
1094
- value: codes,
1095
- enumerable: false
1096
- });
1097
- styles.color.close = "\x1B[39m";
1098
- styles.bgColor.close = "\x1B[49m";
1099
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1100
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1101
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1102
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1103
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1104
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1105
- return styles;
1106
- }
1107
- Object.defineProperty(module, "exports", {
1108
- enumerable: true,
1109
- get: assembleStyles
1110
- });
1111
- }
1112
- });
1113
-
1114
- // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
1115
- var require_has_flag = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
1116
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
1117
- "use strict";
1118
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1119
- module.exports = (flag, argv = process.argv) => {
1120
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1121
- const position = argv.indexOf(prefix + flag);
1122
- const terminatorPosition = argv.indexOf("--");
1123
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1124
- };
1125
- }
1126
- });
1127
-
1128
- // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
1129
- var require_supports_color = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
1130
- "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
1131
- "use strict";
1132
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1133
- var os = _chunkN77CW7VOcjs.__require.call(void 0, "os");
1134
- var tty = _chunkN77CW7VOcjs.__require.call(void 0, "tty");
1135
- var hasFlag = require_has_flag();
1136
- var { env } = process;
1137
- var forceColor;
1138
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1139
- forceColor = 0;
1140
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1141
- forceColor = 1;
1142
- }
1143
- if ("FORCE_COLOR" in env) {
1144
- if (env.FORCE_COLOR === "true") {
1145
- forceColor = 1;
1146
- } else if (env.FORCE_COLOR === "false") {
1147
- forceColor = 0;
1148
- } else {
1149
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
1150
- }
1151
- }
1152
- function translateLevel(level) {
1153
- if (level === 0) {
1154
- return false;
1155
- }
1156
- return {
1157
- level,
1158
- hasBasic: true,
1159
- has256: level >= 2,
1160
- has16m: level >= 3
1161
- };
1162
- }
1163
- function supportsColor(haveStream, streamIsTTY) {
1164
- if (forceColor === 0) {
1165
- return 0;
1166
- }
1167
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1168
- return 3;
1169
- }
1170
- if (hasFlag("color=256")) {
1171
- return 2;
1172
- }
1173
- if (haveStream && !streamIsTTY && forceColor === void 0) {
1174
- return 0;
1175
- }
1176
- const min = forceColor || 0;
1177
- if (env.TERM === "dumb") {
1178
- return min;
1179
- }
1180
- if (process.platform === "win32") {
1181
- const osRelease = os.release().split(".");
1182
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1183
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
1184
- }
1185
- return 1;
1186
- }
1187
- if ("CI" in env) {
1188
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1189
- return 1;
1190
- }
1191
- return min;
1192
- }
1193
- if ("TEAMCITY_VERSION" in env) {
1194
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1195
- }
1196
- if (env.COLORTERM === "truecolor") {
1197
- return 3;
1198
- }
1199
- if ("TERM_PROGRAM" in env) {
1200
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1201
- switch (env.TERM_PROGRAM) {
1202
- case "iTerm.app":
1203
- return version >= 3 ? 3 : 2;
1204
- case "Apple_Terminal":
1205
- return 2;
1206
- }
1207
- }
1208
- if (/-256(color)?$/i.test(env.TERM)) {
1209
- return 2;
1210
- }
1211
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1212
- return 1;
1213
- }
1214
- if ("COLORTERM" in env) {
1215
- return 1;
1216
- }
1217
- return min;
1218
- }
1219
- function getSupportLevel(stream) {
1220
- const level = supportsColor(stream, stream && stream.isTTY);
1221
- return translateLevel(level);
1222
- }
1223
- module.exports = {
1224
- supportsColor: getSupportLevel,
1225
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
1226
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
1227
- };
1228
- }
1229
- });
1230
-
1231
- // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
1232
- var require_util = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
1233
- "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module) {
1234
- "use strict";
1235
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1236
- var stringReplaceAll = (string, substring, replacer) => {
1237
- let index = string.indexOf(substring);
1238
- if (index === -1) {
1239
- return string;
1240
- }
1241
- const substringLength = substring.length;
1242
- let endIndex = 0;
1243
- let returnValue = "";
1244
- do {
1245
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1246
- endIndex = index + substringLength;
1247
- index = string.indexOf(substring, endIndex);
1248
- } while (index !== -1);
1249
- returnValue += string.substr(endIndex);
1250
- return returnValue;
1251
- };
1252
- var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1253
- let endIndex = 0;
1254
- let returnValue = "";
1255
- do {
1256
- const gotCR = string[index - 1] === "\r";
1257
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1258
- endIndex = index + 1;
1259
- index = string.indexOf("\n", endIndex);
1260
- } while (index !== -1);
1261
- returnValue += string.substr(endIndex);
1262
- return returnValue;
1263
- };
1264
- module.exports = {
1265
- stringReplaceAll,
1266
- stringEncaseCRLFWithFirstIndex
1267
- };
1268
- }
1269
- });
1270
-
1271
- // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
1272
- var require_templates = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
1273
- "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module) {
1274
- "use strict";
1275
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1276
- var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
1277
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1278
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1279
- var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1280
- var ESCAPES = /* @__PURE__ */ new Map([
1281
- ["n", "\n"],
1282
- ["r", "\r"],
1283
- ["t", " "],
1284
- ["b", "\b"],
1285
- ["f", "\f"],
1286
- ["v", "\v"],
1287
- ["0", "\0"],
1288
- ["\\", "\\"],
1289
- ["e", "\x1B"],
1290
- ["a", "\x07"]
1291
- ]);
1292
- function unescape(c) {
1293
- const u = c[0] === "u";
1294
- const bracket = c[1] === "{";
1295
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
1296
- return String.fromCharCode(parseInt(c.slice(1), 16));
1297
- }
1298
- if (u && bracket) {
1299
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1300
- }
1301
- return ESCAPES.get(c) || c;
1302
- }
1303
- function parseArguments(name, arguments_) {
1304
- const results = [];
1305
- const chunks = arguments_.trim().split(/\s*,\s*/g);
1306
- let matches;
1307
- for (const chunk of chunks) {
1308
- const number = Number(chunk);
1309
- if (!Number.isNaN(number)) {
1310
- results.push(number);
1311
- } else if (matches = chunk.match(STRING_REGEX)) {
1312
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1313
- } else {
1314
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1315
- }
1316
- }
1317
- return results;
1318
- }
1319
- function parseStyle(style) {
1320
- STYLE_REGEX.lastIndex = 0;
1321
- const results = [];
1322
- let matches;
1323
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
1324
- const name = matches[1];
1325
- if (matches[2]) {
1326
- const args = parseArguments(name, matches[2]);
1327
- results.push([name].concat(args));
1328
- } else {
1329
- results.push([name]);
1330
- }
1331
- }
1332
- return results;
1333
- }
1334
- function buildStyle(chalk2, styles) {
1335
- const enabled = {};
1336
- for (const layer of styles) {
1337
- for (const style of layer.styles) {
1338
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
1339
- }
1340
- }
1341
- let current = chalk2;
1342
- for (const [styleName, styles2] of Object.entries(enabled)) {
1343
- if (!Array.isArray(styles2)) {
1344
- continue;
1345
- }
1346
- if (!(styleName in current)) {
1347
- throw new Error(`Unknown Chalk style: ${styleName}`);
1348
- }
1349
- current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
1350
- }
1351
- return current;
1352
- }
1353
- module.exports = (chalk2, temporary) => {
1354
- const styles = [];
1355
- const chunks = [];
1356
- let chunk = [];
1357
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1358
- if (escapeCharacter) {
1359
- chunk.push(unescape(escapeCharacter));
1360
- } else if (style) {
1361
- const string = chunk.join("");
1362
- chunk = [];
1363
- chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
1364
- styles.push({ inverse, styles: parseStyle(style) });
1365
- } else if (close) {
1366
- if (styles.length === 0) {
1367
- throw new Error("Found extraneous } in Chalk template literal");
1368
- }
1369
- chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
1370
- chunk = [];
1371
- styles.pop();
1372
- } else {
1373
- chunk.push(character);
1374
- }
1375
- });
1376
- chunks.push(chunk.join(""));
1377
- if (styles.length > 0) {
1378
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1379
- throw new Error(errMessage);
1380
- }
1381
- return chunks.join("");
1382
- };
1383
- }
1384
- });
1385
-
1386
- // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
1387
- var require_source = _chunkN77CW7VOcjs.__commonJS.call(void 0, {
1388
- "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module) {
1389
- "use strict";
1390
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1391
- var ansiStyles = require_ansi_styles();
1392
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
1393
- var {
1394
- stringReplaceAll,
1395
- stringEncaseCRLFWithFirstIndex
1396
- } = require_util();
1397
- var { isArray } = Array;
1398
- var levelMapping = [
1399
- "ansi",
1400
- "ansi",
1401
- "ansi256",
1402
- "ansi16m"
1403
- ];
1404
- var styles = /* @__PURE__ */ Object.create(null);
1405
- var applyOptions = (object, options = {}) => {
1406
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1407
- throw new Error("The `level` option should be an integer from 0 to 3");
1408
- }
1409
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
1410
- object.level = options.level === void 0 ? colorLevel : options.level;
1411
- };
1412
- var ChalkClass = class {
1413
- constructor(options) {
1414
- return chalkFactory(options);
1415
- }
1416
- };
1417
- var chalkFactory = (options) => {
1418
- const chalk3 = {};
1419
- applyOptions(chalk3, options);
1420
- chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
1421
- Object.setPrototypeOf(chalk3, Chalk.prototype);
1422
- Object.setPrototypeOf(chalk3.template, chalk3);
1423
- chalk3.template.constructor = () => {
1424
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
1425
- };
1426
- chalk3.template.Instance = ChalkClass;
1427
- return chalk3.template;
1428
- };
1429
- function Chalk(options) {
1430
- return chalkFactory(options);
1431
- }
1432
- for (const [styleName, style] of Object.entries(ansiStyles)) {
1433
- styles[styleName] = {
1434
- get() {
1435
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1436
- Object.defineProperty(this, styleName, { value: builder });
1437
- return builder;
1438
- }
1439
- };
1440
- }
1441
- styles.visible = {
1442
- get() {
1443
- const builder = createBuilder(this, this._styler, true);
1444
- Object.defineProperty(this, "visible", { value: builder });
1445
- return builder;
1446
- }
1447
- };
1448
- var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
1449
- for (const model of usedModels) {
1450
- styles[model] = {
1451
- get() {
1452
- const { level } = this;
1453
- return function(...arguments_) {
1454
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
1455
- return createBuilder(this, styler, this._isEmpty);
1456
- };
1457
- }
1458
- };
1459
- }
1460
- for (const model of usedModels) {
1461
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1462
- styles[bgModel] = {
1463
- get() {
1464
- const { level } = this;
1465
- return function(...arguments_) {
1466
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
1467
- return createBuilder(this, styler, this._isEmpty);
1468
- };
1469
- }
1470
- };
1471
- }
1472
- var proto = Object.defineProperties(() => {
1473
- }, {
1474
- ...styles,
1475
- level: {
1476
- enumerable: true,
1477
- get() {
1478
- return this._generator.level;
1479
- },
1480
- set(level) {
1481
- this._generator.level = level;
1482
- }
1483
- }
1484
- });
1485
- var createStyler = (open, close, parent) => {
1486
- let openAll;
1487
- let closeAll;
1488
- if (parent === void 0) {
1489
- openAll = open;
1490
- closeAll = close;
1491
- } else {
1492
- openAll = parent.openAll + open;
1493
- closeAll = close + parent.closeAll;
1494
- }
1495
- return {
1496
- open,
1497
- close,
1498
- openAll,
1499
- closeAll,
1500
- parent
1501
- };
1502
- };
1503
- var createBuilder = (self, _styler, _isEmpty) => {
1504
- const builder = (...arguments_) => {
1505
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1506
- return applyStyle(builder, chalkTag(builder, ...arguments_));
1507
- }
1508
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1509
- };
1510
- Object.setPrototypeOf(builder, proto);
1511
- builder._generator = self;
1512
- builder._styler = _styler;
1513
- builder._isEmpty = _isEmpty;
1514
- return builder;
1515
- };
1516
- var applyStyle = (self, string) => {
1517
- if (self.level <= 0 || !string) {
1518
- return self._isEmpty ? "" : string;
1519
- }
1520
- let styler = self._styler;
1521
- if (styler === void 0) {
1522
- return string;
1523
- }
1524
- const { openAll, closeAll } = styler;
1525
- if (string.indexOf("\x1B") !== -1) {
1526
- while (styler !== void 0) {
1527
- string = stringReplaceAll(string, styler.close, styler.open);
1528
- styler = styler.parent;
1529
- }
1530
- }
1531
- const lfIndex = string.indexOf("\n");
1532
- if (lfIndex !== -1) {
1533
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1534
- }
1535
- return openAll + string + closeAll;
1536
- };
1537
- var template;
1538
- var chalkTag = (chalk3, ...strings) => {
1539
- const [firstString] = strings;
1540
- if (!isArray(firstString) || !isArray(firstString.raw)) {
1541
- return strings.join(" ");
1542
- }
1543
- const arguments_ = strings.slice(1);
1544
- const parts = [firstString.raw[0]];
1545
- for (let i = 1; i < firstString.length; i++) {
1546
- parts.push(
1547
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
1548
- String(firstString.raw[i])
1549
- );
1550
- }
1551
- if (template === void 0) {
1552
- template = require_templates();
1553
- }
1554
- return template(chalk3, parts.join(""));
1555
- };
1556
- Object.defineProperties(Chalk.prototype, styles);
1557
- var chalk2 = Chalk();
1558
- chalk2.supportsColor = stdoutColor;
1559
- chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1560
- chalk2.stderr.supportsColor = stderrColor;
1561
- module.exports = chalk2;
1562
- }
1563
- });
1564
-
1565
- // ../config-tools/src/logger/console.ts
1566
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1567
-
1568
- // ../config-tools/src/types.ts
1569
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1570
- var LogLevel = {
1571
- SILENT: 0,
1572
- FATAL: 10,
1573
- ERROR: 20,
1574
- WARN: 30,
1575
- SUCCESS: 35,
1576
- INFO: 40,
1577
- DEBUG: 60,
1578
- TRACE: 70,
1579
- ALL: 100
1580
- };
1581
- var LogLevelLabel = {
1582
- SILENT: "silent",
1583
- FATAL: "fatal",
1584
- ERROR: "error",
1585
- WARN: "warn",
1586
- SUCCESS: "success",
1587
- INFO: "info",
1588
- DEBUG: "debug",
1589
- TRACE: "trace",
1590
- ALL: "all"
1591
- };
1592
-
1593
- // ../config-tools/src/utilities/colors.ts
1594
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1595
- var DEFAULT_COLOR_CONFIG = {
1596
- light: {
1597
- background: "#fafafa",
1598
- foreground: "#1d1e22",
1599
- brand: "#1fb2a6",
1600
- alternate: "#db2777",
1601
- help: "#5C4EE5",
1602
- success: "#087f5b",
1603
- info: "#0550ae",
1604
- warning: "#e3b341",
1605
- danger: "#D8314A",
1606
- fatal: "#51070f",
1607
- link: "#3fa6ff",
1608
- positive: "#22c55e",
1609
- negative: "#dc2626",
1610
- gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
1611
- },
1612
- dark: {
1613
- background: "#1d1e22",
1614
- foreground: "#cbd5e1",
1615
- brand: "#2dd4bf",
1616
- alternate: "#db2777",
1617
- help: "#818cf8",
1618
- success: "#10b981",
1619
- info: "#58a6ff",
1620
- warning: "#f3d371",
1621
- danger: "#D8314A",
1622
- fatal: "#a40e26",
1623
- link: "#3fa6ff",
1624
- positive: "#22c55e",
1625
- negative: "#dc2626",
1626
- gradient: ["#1fb2a6", "#db2777", "#818cf8"]
1627
- }
1628
- };
1629
-
1630
- // ../config-tools/src/logger/chalk.ts
1631
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1632
- var import_chalk = _chunkN77CW7VOcjs.__toESM.call(void 0, require_source(), 1);
1633
- var chalkDefault = {
1634
- hex: (_) => (message) => message,
1635
- bgHex: (_) => ({
1636
- whiteBright: (message) => message,
1637
- white: (message) => message
1638
- }),
1639
- white: (message) => message,
1640
- whiteBright: (message) => message,
1641
- gray: (message) => message,
1642
- bold: {
1643
- hex: (_) => (message) => message,
1644
- bgHex: (_) => ({
1645
- whiteBright: (message) => message,
1646
- white: (message) => message
1647
- }),
1648
- whiteBright: (message) => message,
1649
- white: (message) => message
1650
- },
1651
- dim: {
1652
- hex: (_) => (message) => message,
1653
- gray: (message) => message
1654
- }
1655
- };
1656
- var getChalk = () => {
1657
- let _chalk = import_chalk.default;
1658
- if (!_optionalChain([_chalk, 'optionalAccess', _2 => _2.hex]) || !_optionalChain([_chalk, 'optionalAccess', _3 => _3.bold, 'optionalAccess', _4 => _4.hex]) || !_optionalChain([_chalk, 'optionalAccess', _5 => _5.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _6 => _6.whiteBright]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.white])) {
1659
- _chalk = chalkDefault;
1660
- }
1661
- return _chalk;
1662
- };
1663
-
1664
- // ../config-tools/src/logger/console-icons.ts
1665
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1666
-
1667
- // ../config-tools/src/logger/is-unicode-supported.ts
1668
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1669
- function isUnicodeSupported() {
1670
- if (process.platform !== "win32") {
1671
- return process.env.TERM !== "linux";
1672
- }
1673
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
1674
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
1675
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
1676
- process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1677
- }
1678
-
1679
- // ../config-tools/src/logger/console-icons.ts
1680
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
1681
- var CONSOLE_ICONS = {
1682
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
1683
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
1684
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
1685
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
1686
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
1687
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
1688
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
1689
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
1690
- };
1691
-
1692
- // ../config-tools/src/logger/format-timestamp.ts
1693
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1694
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
1695
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
1696
- };
1697
-
1698
- // ../config-tools/src/logger/get-log-level.ts
1699
- _chunkN77CW7VOcjs.init_cjs_shims.call(void 0, );
1700
- var getLogLevel = (label) => {
1701
- switch (label) {
1702
- case "all":
1703
- return LogLevel.ALL;
1704
- case "trace":
1705
- return LogLevel.TRACE;
1706
- case "debug":
1707
- return LogLevel.DEBUG;
1708
- case "info":
1709
- return LogLevel.INFO;
1710
- case "warn":
1711
- return LogLevel.WARN;
1712
- case "error":
1713
- return LogLevel.ERROR;
1714
- case "fatal":
1715
- return LogLevel.FATAL;
1716
- case "silent":
1717
- return LogLevel.SILENT;
1718
- default:
1719
- return LogLevel.INFO;
1720
- }
1721
- };
1722
-
1723
- // ../config-tools/src/logger/console.ts
1724
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
1725
- const colors = !_optionalChain([config, 'access', _8 => _8.colors, 'optionalAccess', _9 => _9.dark]) && !_optionalChain([config, 'access', _10 => _10.colors, 'optionalAccess', _11 => _11["base"]]) && !_optionalChain([config, 'access', _12 => _12.colors, 'optionalAccess', _13 => _13["base"], 'optionalAccess', _14 => _14.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _17 => _17.colors, 'optionalAccess', _18 => _18["base"], 'optionalAccess', _19 => _19.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"]]) ? _optionalChain([config, 'access', _22 => _22.colors, 'optionalAccess', _23 => _23["base"]]) : DEFAULT_COLOR_CONFIG;
1726
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
1727
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
1728
- return (_) => {
1729
- };
1730
- }
1731
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
1732
- return (message) => {
1733
- console.error(
1734
- `
1735
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( DEFAULT_COLOR_CONFIG.dark.fatal)))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1736
- `
1737
- );
1738
- };
1739
- }
1740
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
1741
- return (message) => {
1742
- console.error(
1743
- `
1744
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( DEFAULT_COLOR_CONFIG.dark.danger)))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1745
- `
1746
- );
1747
- };
1748
- }
1749
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
1750
- return (message) => {
1751
- console.warn(
1752
- `
1753
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( DEFAULT_COLOR_CONFIG.dark.warning)))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1754
- `
1755
- );
1756
- };
1757
- }
1758
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
1759
- return (message) => {
1760
- console.info(
1761
- `
1762
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( DEFAULT_COLOR_CONFIG.dark.success)))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1763
- `
1764
- );
1765
- };
1766
- }
1767
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
1768
- return (message) => {
1769
- console.info(
1770
- `
1771
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1772
- `
1773
- );
1774
- };
1775
- }
1776
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
1777
- return (message) => {
1778
- console.debug(
1779
- `
1780
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1781
- `
1782
- );
1783
- };
1784
- }
1785
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
1786
- return (message) => {
1787
- console.debug(
1788
- `
1789
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( DEFAULT_COLOR_CONFIG.dark.info)))(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1790
- `
1791
- );
1792
- };
1793
- }
1794
- return (message) => {
1795
- console.log(
1796
- `
1797
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( DEFAULT_COLOR_CONFIG.dark.brand)))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1798
- `
1799
- );
1800
- };
1801
- };
1802
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
1803
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
1804
- var MAX_DEPTH = 4;
1805
- var formatLogMessage = (message, options = {}, depth = 0) => {
1806
- if (depth > MAX_DEPTH) {
1807
- return "<max depth>";
1808
- }
1809
- const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
1810
- const skip = _nullishCoalesce(options.skip, () => ( []));
1811
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
1812
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
1813
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
1814
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
1815
- message[key],
1816
- { prefix: `${prefix}-`, skip },
1817
- depth + 1
1818
- ) : message[key]}`
1819
- ).join("\n")}` : message;
1820
- };
1821
- var _isFunction = (value) => {
1822
- try {
1823
- return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _24 => _24.constructor]) && _optionalChain([value, 'optionalAccess', _25 => _25.call]) && _optionalChain([value, 'optionalAccess', _26 => _26.apply]));
1824
- } catch (e) {
1825
- return false;
1826
- }
1827
- };
1828
-
1829
-
1830
-
1831
-
1832
- exports.writeError = writeError; exports.writeTrace = writeTrace;