@nsshunt/stsoauth2plugin 1.0.162 → 1.0.163

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 CHANGED
@@ -8,24 +8,24 @@ import { Gauge } from "@nsshunt/stsobservability";
8
8
  import http from "node:http";
9
9
  import https from "node:https";
10
10
  //#region \0rolldown/runtime.js
11
- var __create$2 = Object.create;
12
- var __defProp$2 = Object.defineProperty;
13
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
14
- var __getOwnPropNames$2 = Object.getOwnPropertyNames;
15
- var __getProtoOf$2 = Object.getPrototypeOf;
16
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
17
- var __commonJSMin$2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
- var __copyProps$2 = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$2(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ var __create$1 = Object.create;
12
+ var __defProp$1 = Object.defineProperty;
13
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
14
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
15
+ var __getProtoOf$1 = Object.getPrototypeOf;
16
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
17
+ var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
+ var __copyProps$1 = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
20
20
  key = keys[i];
21
- if (!__hasOwnProp$2.call(to, key) && key !== except) __defProp$2(to, key, {
21
+ if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
22
22
  get: ((k) => from[k]).bind(null, key),
23
- enumerable: !(desc = __getOwnPropDesc$2(from, key)) || desc.enumerable
23
+ enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
24
24
  });
25
25
  }
26
26
  return to;
27
27
  };
28
- var __toESM$2 = (mod, isNodeMode, target) => (target = mod != null ? __create$2(__getProtoOf$2(mod)) : {}, __copyProps$2(isNodeMode || !mod || !mod.__esModule ? __defProp$2(target, "default", {
28
+ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
29
29
  value: mod,
30
30
  enumerable: true
31
31
  }) : target, mod));
@@ -37,2064 +37,345 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
37
37
  //#region src/stsPluginKeys.ts
38
38
  var STSOAuth2ManagerPluginKey = Symbol();
39
39
  //#endregion
40
- //#region node_modules/color-name/index.js
41
- var require_color_name$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
42
- module.exports = {
43
- "aliceblue": [
44
- 240,
45
- 248,
46
- 255
47
- ],
48
- "antiquewhite": [
49
- 250,
50
- 235,
51
- 215
52
- ],
53
- "aqua": [
54
- 0,
55
- 255,
56
- 255
57
- ],
58
- "aquamarine": [
59
- 127,
60
- 255,
61
- 212
62
- ],
63
- "azure": [
64
- 240,
65
- 255,
66
- 255
67
- ],
68
- "beige": [
69
- 245,
70
- 245,
71
- 220
72
- ],
73
- "bisque": [
74
- 255,
75
- 228,
76
- 196
77
- ],
78
- "black": [
79
- 0,
80
- 0,
81
- 0
82
- ],
83
- "blanchedalmond": [
84
- 255,
85
- 235,
86
- 205
87
- ],
88
- "blue": [
89
- 0,
90
- 0,
91
- 255
92
- ],
93
- "blueviolet": [
94
- 138,
95
- 43,
96
- 226
97
- ],
98
- "brown": [
99
- 165,
100
- 42,
101
- 42
102
- ],
103
- "burlywood": [
104
- 222,
105
- 184,
106
- 135
107
- ],
108
- "cadetblue": [
109
- 95,
110
- 158,
111
- 160
112
- ],
113
- "chartreuse": [
114
- 127,
115
- 255,
116
- 0
117
- ],
118
- "chocolate": [
119
- 210,
120
- 105,
121
- 30
122
- ],
123
- "coral": [
124
- 255,
125
- 127,
126
- 80
127
- ],
128
- "cornflowerblue": [
129
- 100,
130
- 149,
131
- 237
132
- ],
133
- "cornsilk": [
134
- 255,
135
- 248,
136
- 220
137
- ],
138
- "crimson": [
139
- 220,
140
- 20,
141
- 60
142
- ],
143
- "cyan": [
144
- 0,
145
- 255,
146
- 255
147
- ],
148
- "darkblue": [
149
- 0,
150
- 0,
151
- 139
152
- ],
153
- "darkcyan": [
154
- 0,
155
- 139,
156
- 139
157
- ],
158
- "darkgoldenrod": [
159
- 184,
160
- 134,
161
- 11
162
- ],
163
- "darkgray": [
164
- 169,
165
- 169,
166
- 169
167
- ],
168
- "darkgreen": [
169
- 0,
170
- 100,
171
- 0
172
- ],
173
- "darkgrey": [
174
- 169,
175
- 169,
176
- 169
177
- ],
178
- "darkkhaki": [
179
- 189,
180
- 183,
181
- 107
182
- ],
183
- "darkmagenta": [
184
- 139,
185
- 0,
186
- 139
187
- ],
188
- "darkolivegreen": [
189
- 85,
190
- 107,
191
- 47
192
- ],
193
- "darkorange": [
194
- 255,
195
- 140,
196
- 0
197
- ],
198
- "darkorchid": [
199
- 153,
200
- 50,
201
- 204
202
- ],
203
- "darkred": [
204
- 139,
205
- 0,
206
- 0
207
- ],
208
- "darksalmon": [
209
- 233,
210
- 150,
211
- 122
212
- ],
213
- "darkseagreen": [
214
- 143,
215
- 188,
216
- 143
217
- ],
218
- "darkslateblue": [
219
- 72,
220
- 61,
221
- 139
222
- ],
223
- "darkslategray": [
224
- 47,
225
- 79,
226
- 79
227
- ],
228
- "darkslategrey": [
229
- 47,
230
- 79,
231
- 79
232
- ],
233
- "darkturquoise": [
234
- 0,
235
- 206,
236
- 209
237
- ],
238
- "darkviolet": [
239
- 148,
240
- 0,
241
- 211
242
- ],
243
- "deeppink": [
244
- 255,
245
- 20,
246
- 147
247
- ],
248
- "deepskyblue": [
249
- 0,
250
- 191,
251
- 255
252
- ],
253
- "dimgray": [
254
- 105,
255
- 105,
256
- 105
257
- ],
258
- "dimgrey": [
259
- 105,
260
- 105,
261
- 105
262
- ],
263
- "dodgerblue": [
264
- 30,
265
- 144,
266
- 255
267
- ],
268
- "firebrick": [
269
- 178,
270
- 34,
271
- 34
272
- ],
273
- "floralwhite": [
274
- 255,
275
- 250,
276
- 240
277
- ],
278
- "forestgreen": [
279
- 34,
280
- 139,
281
- 34
282
- ],
283
- "fuchsia": [
284
- 255,
285
- 0,
286
- 255
287
- ],
288
- "gainsboro": [
289
- 220,
290
- 220,
291
- 220
292
- ],
293
- "ghostwhite": [
294
- 248,
295
- 248,
296
- 255
297
- ],
298
- "gold": [
299
- 255,
300
- 215,
301
- 0
302
- ],
303
- "goldenrod": [
304
- 218,
305
- 165,
306
- 32
307
- ],
308
- "gray": [
309
- 128,
310
- 128,
311
- 128
312
- ],
313
- "green": [
314
- 0,
315
- 128,
316
- 0
317
- ],
318
- "greenyellow": [
319
- 173,
320
- 255,
321
- 47
322
- ],
323
- "grey": [
324
- 128,
325
- 128,
326
- 128
327
- ],
328
- "honeydew": [
329
- 240,
330
- 255,
331
- 240
332
- ],
333
- "hotpink": [
334
- 255,
335
- 105,
336
- 180
337
- ],
338
- "indianred": [
339
- 205,
340
- 92,
341
- 92
342
- ],
343
- "indigo": [
344
- 75,
345
- 0,
346
- 130
347
- ],
348
- "ivory": [
349
- 255,
350
- 255,
351
- 240
352
- ],
353
- "khaki": [
354
- 240,
355
- 230,
356
- 140
357
- ],
358
- "lavender": [
359
- 230,
360
- 230,
361
- 250
362
- ],
363
- "lavenderblush": [
364
- 255,
365
- 240,
366
- 245
367
- ],
368
- "lawngreen": [
369
- 124,
370
- 252,
371
- 0
372
- ],
373
- "lemonchiffon": [
374
- 255,
375
- 250,
376
- 205
377
- ],
378
- "lightblue": [
379
- 173,
380
- 216,
381
- 230
382
- ],
383
- "lightcoral": [
384
- 240,
385
- 128,
386
- 128
387
- ],
388
- "lightcyan": [
389
- 224,
390
- 255,
391
- 255
392
- ],
393
- "lightgoldenrodyellow": [
394
- 250,
395
- 250,
396
- 210
397
- ],
398
- "lightgray": [
399
- 211,
400
- 211,
401
- 211
402
- ],
403
- "lightgreen": [
404
- 144,
405
- 238,
406
- 144
407
- ],
408
- "lightgrey": [
409
- 211,
410
- 211,
411
- 211
412
- ],
413
- "lightpink": [
414
- 255,
415
- 182,
416
- 193
417
- ],
418
- "lightsalmon": [
419
- 255,
420
- 160,
421
- 122
422
- ],
423
- "lightseagreen": [
424
- 32,
425
- 178,
426
- 170
427
- ],
428
- "lightskyblue": [
429
- 135,
430
- 206,
431
- 250
432
- ],
433
- "lightslategray": [
434
- 119,
435
- 136,
436
- 153
437
- ],
438
- "lightslategrey": [
439
- 119,
440
- 136,
441
- 153
442
- ],
443
- "lightsteelblue": [
444
- 176,
445
- 196,
446
- 222
447
- ],
448
- "lightyellow": [
449
- 255,
450
- 255,
451
- 224
452
- ],
453
- "lime": [
454
- 0,
455
- 255,
456
- 0
457
- ],
458
- "limegreen": [
459
- 50,
460
- 205,
461
- 50
462
- ],
463
- "linen": [
464
- 250,
465
- 240,
466
- 230
467
- ],
468
- "magenta": [
469
- 255,
470
- 0,
471
- 255
472
- ],
473
- "maroon": [
474
- 128,
475
- 0,
476
- 0
477
- ],
478
- "mediumaquamarine": [
479
- 102,
480
- 205,
481
- 170
482
- ],
483
- "mediumblue": [
484
- 0,
485
- 0,
486
- 205
487
- ],
488
- "mediumorchid": [
489
- 186,
490
- 85,
491
- 211
492
- ],
493
- "mediumpurple": [
494
- 147,
495
- 112,
496
- 219
497
- ],
498
- "mediumseagreen": [
499
- 60,
500
- 179,
501
- 113
502
- ],
503
- "mediumslateblue": [
504
- 123,
505
- 104,
506
- 238
507
- ],
508
- "mediumspringgreen": [
509
- 0,
510
- 250,
511
- 154
512
- ],
513
- "mediumturquoise": [
514
- 72,
515
- 209,
516
- 204
517
- ],
518
- "mediumvioletred": [
519
- 199,
520
- 21,
521
- 133
522
- ],
523
- "midnightblue": [
524
- 25,
525
- 25,
526
- 112
527
- ],
528
- "mintcream": [
529
- 245,
530
- 255,
531
- 250
532
- ],
533
- "mistyrose": [
534
- 255,
535
- 228,
536
- 225
537
- ],
538
- "moccasin": [
539
- 255,
540
- 228,
541
- 181
542
- ],
543
- "navajowhite": [
544
- 255,
545
- 222,
546
- 173
547
- ],
548
- "navy": [
549
- 0,
550
- 0,
551
- 128
552
- ],
553
- "oldlace": [
554
- 253,
555
- 245,
556
- 230
557
- ],
558
- "olive": [
559
- 128,
560
- 128,
561
- 0
562
- ],
563
- "olivedrab": [
564
- 107,
565
- 142,
566
- 35
567
- ],
568
- "orange": [
569
- 255,
570
- 165,
571
- 0
572
- ],
573
- "orangered": [
574
- 255,
575
- 69,
576
- 0
577
- ],
578
- "orchid": [
579
- 218,
580
- 112,
581
- 214
582
- ],
583
- "palegoldenrod": [
584
- 238,
585
- 232,
586
- 170
587
- ],
588
- "palegreen": [
589
- 152,
590
- 251,
591
- 152
592
- ],
593
- "paleturquoise": [
594
- 175,
595
- 238,
596
- 238
597
- ],
598
- "palevioletred": [
599
- 219,
600
- 112,
601
- 147
602
- ],
603
- "papayawhip": [
604
- 255,
605
- 239,
606
- 213
607
- ],
608
- "peachpuff": [
609
- 255,
610
- 218,
611
- 185
612
- ],
613
- "peru": [
614
- 205,
615
- 133,
616
- 63
617
- ],
618
- "pink": [
619
- 255,
620
- 192,
621
- 203
622
- ],
623
- "plum": [
624
- 221,
625
- 160,
626
- 221
627
- ],
628
- "powderblue": [
629
- 176,
630
- 224,
631
- 230
632
- ],
633
- "purple": [
634
- 128,
635
- 0,
636
- 128
637
- ],
638
- "rebeccapurple": [
639
- 102,
640
- 51,
641
- 153
642
- ],
643
- "red": [
644
- 255,
645
- 0,
646
- 0
647
- ],
648
- "rosybrown": [
649
- 188,
650
- 143,
651
- 143
652
- ],
653
- "royalblue": [
654
- 65,
655
- 105,
656
- 225
657
- ],
658
- "saddlebrown": [
659
- 139,
660
- 69,
661
- 19
662
- ],
663
- "salmon": [
664
- 250,
665
- 128,
666
- 114
667
- ],
668
- "sandybrown": [
669
- 244,
670
- 164,
671
- 96
672
- ],
673
- "seagreen": [
674
- 46,
675
- 139,
676
- 87
677
- ],
678
- "seashell": [
679
- 255,
680
- 245,
681
- 238
682
- ],
683
- "sienna": [
684
- 160,
685
- 82,
686
- 45
687
- ],
688
- "silver": [
689
- 192,
690
- 192,
691
- 192
692
- ],
693
- "skyblue": [
694
- 135,
695
- 206,
696
- 235
697
- ],
698
- "slateblue": [
699
- 106,
700
- 90,
701
- 205
702
- ],
703
- "slategray": [
704
- 112,
705
- 128,
706
- 144
707
- ],
708
- "slategrey": [
709
- 112,
710
- 128,
711
- 144
712
- ],
713
- "snow": [
714
- 255,
715
- 250,
716
- 250
717
- ],
718
- "springgreen": [
719
- 0,
720
- 255,
721
- 127
722
- ],
723
- "steelblue": [
724
- 70,
725
- 130,
726
- 180
727
- ],
728
- "tan": [
729
- 210,
730
- 180,
731
- 140
732
- ],
733
- "teal": [
734
- 0,
735
- 128,
736
- 128
737
- ],
738
- "thistle": [
739
- 216,
740
- 191,
741
- 216
742
- ],
743
- "tomato": [
744
- 255,
745
- 99,
746
- 71
747
- ],
748
- "turquoise": [
749
- 64,
750
- 224,
751
- 208
752
- ],
753
- "violet": [
754
- 238,
755
- 130,
756
- 238
757
- ],
758
- "wheat": [
759
- 245,
760
- 222,
761
- 179
762
- ],
763
- "white": [
764
- 255,
765
- 255,
766
- 255
767
- ],
768
- "whitesmoke": [
769
- 245,
770
- 245,
771
- 245
772
- ],
773
- "yellow": [
774
- 255,
775
- 255,
776
- 0
777
- ],
778
- "yellowgreen": [
779
- 154,
780
- 205,
781
- 50
782
- ]
783
- };
784
- }));
785
- //#endregion
786
- //#region node_modules/color-convert/conversions.js
787
- var require_conversions$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
788
- var cssKeywords = require_color_name$1();
789
- var reverseKeywords = {};
790
- for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
791
- var convert = {
792
- rgb: {
793
- channels: 3,
794
- labels: "rgb"
795
- },
796
- hsl: {
797
- channels: 3,
798
- labels: "hsl"
799
- },
800
- hsv: {
801
- channels: 3,
802
- labels: "hsv"
803
- },
804
- hwb: {
805
- channels: 3,
806
- labels: "hwb"
807
- },
808
- cmyk: {
809
- channels: 4,
810
- labels: "cmyk"
811
- },
812
- xyz: {
813
- channels: 3,
814
- labels: "xyz"
815
- },
816
- lab: {
817
- channels: 3,
818
- labels: "lab"
819
- },
820
- lch: {
821
- channels: 3,
822
- labels: "lch"
823
- },
824
- hex: {
825
- channels: 1,
826
- labels: ["hex"]
827
- },
828
- keyword: {
829
- channels: 1,
830
- labels: ["keyword"]
831
- },
832
- ansi16: {
833
- channels: 1,
834
- labels: ["ansi16"]
835
- },
836
- ansi256: {
837
- channels: 1,
838
- labels: ["ansi256"]
839
- },
840
- hcg: {
841
- channels: 3,
842
- labels: [
843
- "h",
844
- "c",
845
- "g"
846
- ]
847
- },
848
- apple: {
849
- channels: 3,
850
- labels: [
851
- "r16",
852
- "g16",
853
- "b16"
854
- ]
855
- },
856
- gray: {
857
- channels: 1,
858
- labels: ["gray"]
859
- }
860
- };
861
- module.exports = convert;
862
- for (const model of Object.keys(convert)) {
863
- if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
864
- if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
865
- if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
866
- const { channels, labels } = convert[model];
867
- delete convert[model].channels;
868
- delete convert[model].labels;
869
- Object.defineProperty(convert[model], "channels", { value: channels });
870
- Object.defineProperty(convert[model], "labels", { value: labels });
871
- }
872
- convert.rgb.hsl = function(rgb) {
873
- const r = rgb[0] / 255;
874
- const g = rgb[1] / 255;
875
- const b = rgb[2] / 255;
876
- const min = Math.min(r, g, b);
877
- const max = Math.max(r, g, b);
878
- const delta = max - min;
879
- let h;
880
- let s;
881
- if (max === min) h = 0;
882
- else if (r === max) h = (g - b) / delta;
883
- else if (g === max) h = 2 + (b - r) / delta;
884
- else if (b === max) h = 4 + (r - g) / delta;
885
- h = Math.min(h * 60, 360);
886
- if (h < 0) h += 360;
887
- const l = (min + max) / 2;
888
- if (max === min) s = 0;
889
- else if (l <= .5) s = delta / (max + min);
890
- else s = delta / (2 - max - min);
891
- return [
892
- h,
893
- s * 100,
894
- l * 100
895
- ];
896
- };
897
- convert.rgb.hsv = function(rgb) {
898
- let rdif;
899
- let gdif;
900
- let bdif;
901
- let h;
902
- let s;
903
- const r = rgb[0] / 255;
904
- const g = rgb[1] / 255;
905
- const b = rgb[2] / 255;
906
- const v = Math.max(r, g, b);
907
- const diff = v - Math.min(r, g, b);
908
- const diffc = function(c) {
909
- return (v - c) / 6 / diff + 1 / 2;
910
- };
911
- if (diff === 0) {
912
- h = 0;
913
- s = 0;
914
- } else {
915
- s = diff / v;
916
- rdif = diffc(r);
917
- gdif = diffc(g);
918
- bdif = diffc(b);
919
- if (r === v) h = bdif - gdif;
920
- else if (g === v) h = 1 / 3 + rdif - bdif;
921
- else if (b === v) h = 2 / 3 + gdif - rdif;
922
- if (h < 0) h += 1;
923
- else if (h > 1) h -= 1;
924
- }
925
- return [
926
- h * 360,
927
- s * 100,
928
- v * 100
929
- ];
930
- };
931
- convert.rgb.hwb = function(rgb) {
932
- const r = rgb[0];
933
- const g = rgb[1];
934
- let b = rgb[2];
935
- const h = convert.rgb.hsl(rgb)[0];
936
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
937
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
938
- return [
939
- h,
940
- w * 100,
941
- b * 100
942
- ];
943
- };
944
- convert.rgb.cmyk = function(rgb) {
945
- const r = rgb[0] / 255;
946
- const g = rgb[1] / 255;
947
- const b = rgb[2] / 255;
948
- const k = Math.min(1 - r, 1 - g, 1 - b);
949
- const c = (1 - r - k) / (1 - k) || 0;
950
- const m = (1 - g - k) / (1 - k) || 0;
951
- const y = (1 - b - k) / (1 - k) || 0;
952
- return [
953
- c * 100,
954
- m * 100,
955
- y * 100,
956
- k * 100
957
- ];
958
- };
959
- function comparativeDistance(x, y) {
960
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
961
- }
962
- convert.rgb.keyword = function(rgb) {
963
- const reversed = reverseKeywords[rgb];
964
- if (reversed) return reversed;
965
- let currentClosestDistance = Infinity;
966
- let currentClosestKeyword;
967
- for (const keyword of Object.keys(cssKeywords)) {
968
- const value = cssKeywords[keyword];
969
- const distance = comparativeDistance(rgb, value);
970
- if (distance < currentClosestDistance) {
971
- currentClosestDistance = distance;
972
- currentClosestKeyword = keyword;
973
- }
974
- }
975
- return currentClosestKeyword;
976
- };
977
- convert.keyword.rgb = function(keyword) {
978
- return cssKeywords[keyword];
979
- };
980
- convert.rgb.xyz = function(rgb) {
981
- let r = rgb[0] / 255;
982
- let g = rgb[1] / 255;
983
- let b = rgb[2] / 255;
984
- r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
985
- g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
986
- b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
987
- const x = r * .4124 + g * .3576 + b * .1805;
988
- const y = r * .2126 + g * .7152 + b * .0722;
989
- const z = r * .0193 + g * .1192 + b * .9505;
990
- return [
991
- x * 100,
992
- y * 100,
993
- z * 100
994
- ];
995
- };
996
- convert.rgb.lab = function(rgb) {
997
- const xyz = convert.rgb.xyz(rgb);
998
- let x = xyz[0];
999
- let y = xyz[1];
1000
- let z = xyz[2];
1001
- x /= 95.047;
1002
- y /= 100;
1003
- z /= 108.883;
1004
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1005
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1006
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1007
- return [
1008
- 116 * y - 16,
1009
- 500 * (x - y),
1010
- 200 * (y - z)
1011
- ];
1012
- };
1013
- convert.hsl.rgb = function(hsl) {
1014
- const h = hsl[0] / 360;
1015
- const s = hsl[1] / 100;
1016
- const l = hsl[2] / 100;
1017
- let t2;
1018
- let t3;
1019
- let val;
1020
- if (s === 0) {
1021
- val = l * 255;
1022
- return [
1023
- val,
1024
- val,
1025
- val
1026
- ];
1027
- }
1028
- if (l < .5) t2 = l * (1 + s);
1029
- else t2 = l + s - l * s;
1030
- const t1 = 2 * l - t2;
1031
- const rgb = [
1032
- 0,
1033
- 0,
1034
- 0
1035
- ];
1036
- for (let i = 0; i < 3; i++) {
1037
- t3 = h + 1 / 3 * -(i - 1);
1038
- if (t3 < 0) t3++;
1039
- if (t3 > 1) t3--;
1040
- if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
1041
- else if (2 * t3 < 1) val = t2;
1042
- else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
1043
- else val = t1;
1044
- rgb[i] = val * 255;
1045
- }
1046
- return rgb;
1047
- };
1048
- convert.hsl.hsv = function(hsl) {
1049
- const h = hsl[0];
1050
- let s = hsl[1] / 100;
1051
- let l = hsl[2] / 100;
1052
- let smin = s;
1053
- const lmin = Math.max(l, .01);
1054
- l *= 2;
1055
- s *= l <= 1 ? l : 2 - l;
1056
- smin *= lmin <= 1 ? lmin : 2 - lmin;
1057
- const v = (l + s) / 2;
1058
- return [
1059
- h,
1060
- (l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
1061
- v * 100
1062
- ];
1063
- };
1064
- convert.hsv.rgb = function(hsv) {
1065
- const h = hsv[0] / 60;
1066
- const s = hsv[1] / 100;
1067
- let v = hsv[2] / 100;
1068
- const hi = Math.floor(h) % 6;
1069
- const f = h - Math.floor(h);
1070
- const p = 255 * v * (1 - s);
1071
- const q = 255 * v * (1 - s * f);
1072
- const t = 255 * v * (1 - s * (1 - f));
1073
- v *= 255;
1074
- switch (hi) {
1075
- case 0: return [
1076
- v,
1077
- t,
1078
- p
1079
- ];
1080
- case 1: return [
1081
- q,
1082
- v,
1083
- p
1084
- ];
1085
- case 2: return [
1086
- p,
1087
- v,
1088
- t
1089
- ];
1090
- case 3: return [
1091
- p,
1092
- q,
1093
- v
1094
- ];
1095
- case 4: return [
1096
- t,
1097
- p,
1098
- v
1099
- ];
1100
- case 5: return [
1101
- v,
1102
- p,
1103
- q
1104
- ];
1105
- }
1106
- };
1107
- convert.hsv.hsl = function(hsv) {
1108
- const h = hsv[0];
1109
- const s = hsv[1] / 100;
1110
- const v = hsv[2] / 100;
1111
- const vmin = Math.max(v, .01);
1112
- let sl;
1113
- let l;
1114
- l = (2 - s) * v;
1115
- const lmin = (2 - s) * vmin;
1116
- sl = s * vmin;
1117
- sl /= lmin <= 1 ? lmin : 2 - lmin;
1118
- sl = sl || 0;
1119
- l /= 2;
1120
- return [
1121
- h,
1122
- sl * 100,
1123
- l * 100
1124
- ];
1125
- };
1126
- convert.hwb.rgb = function(hwb) {
1127
- const h = hwb[0] / 360;
1128
- let wh = hwb[1] / 100;
1129
- let bl = hwb[2] / 100;
1130
- const ratio = wh + bl;
1131
- let f;
1132
- if (ratio > 1) {
1133
- wh /= ratio;
1134
- bl /= ratio;
1135
- }
1136
- const i = Math.floor(6 * h);
1137
- const v = 1 - bl;
1138
- f = 6 * h - i;
1139
- if ((i & 1) !== 0) f = 1 - f;
1140
- const n = wh + f * (v - wh);
1141
- let r;
1142
- let g;
1143
- let b;
1144
- switch (i) {
1145
- default:
1146
- case 6:
1147
- case 0:
1148
- r = v;
1149
- g = n;
1150
- b = wh;
1151
- break;
1152
- case 1:
1153
- r = n;
1154
- g = v;
1155
- b = wh;
1156
- break;
1157
- case 2:
1158
- r = wh;
1159
- g = v;
1160
- b = n;
1161
- break;
1162
- case 3:
1163
- r = wh;
1164
- g = n;
1165
- b = v;
1166
- break;
1167
- case 4:
1168
- r = n;
1169
- g = wh;
1170
- b = v;
1171
- break;
1172
- case 5:
1173
- r = v;
1174
- g = wh;
1175
- b = n;
1176
- break;
1177
- }
1178
- return [
1179
- r * 255,
1180
- g * 255,
1181
- b * 255
1182
- ];
1183
- };
1184
- convert.cmyk.rgb = function(cmyk) {
1185
- const c = cmyk[0] / 100;
1186
- const m = cmyk[1] / 100;
1187
- const y = cmyk[2] / 100;
1188
- const k = cmyk[3] / 100;
1189
- const r = 1 - Math.min(1, c * (1 - k) + k);
1190
- const g = 1 - Math.min(1, m * (1 - k) + k);
1191
- const b = 1 - Math.min(1, y * (1 - k) + k);
1192
- return [
1193
- r * 255,
1194
- g * 255,
1195
- b * 255
1196
- ];
1197
- };
1198
- convert.xyz.rgb = function(xyz) {
1199
- const x = xyz[0] / 100;
1200
- const y = xyz[1] / 100;
1201
- const z = xyz[2] / 100;
1202
- let r;
1203
- let g;
1204
- let b;
1205
- r = x * 3.2406 + y * -1.5372 + z * -.4986;
1206
- g = x * -.9689 + y * 1.8758 + z * .0415;
1207
- b = x * .0557 + y * -.204 + z * 1.057;
1208
- r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
1209
- g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
1210
- b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
1211
- r = Math.min(Math.max(0, r), 1);
1212
- g = Math.min(Math.max(0, g), 1);
1213
- b = Math.min(Math.max(0, b), 1);
1214
- return [
1215
- r * 255,
1216
- g * 255,
1217
- b * 255
1218
- ];
1219
- };
1220
- convert.xyz.lab = function(xyz) {
1221
- let x = xyz[0];
1222
- let y = xyz[1];
1223
- let z = xyz[2];
1224
- x /= 95.047;
1225
- y /= 100;
1226
- z /= 108.883;
1227
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1228
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1229
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1230
- return [
1231
- 116 * y - 16,
1232
- 500 * (x - y),
1233
- 200 * (y - z)
1234
- ];
1235
- };
1236
- convert.lab.xyz = function(lab) {
1237
- const l = lab[0];
1238
- const a = lab[1];
1239
- const b = lab[2];
1240
- let x;
1241
- let y;
1242
- let z;
1243
- y = (l + 16) / 116;
1244
- x = a / 500 + y;
1245
- z = y - b / 200;
1246
- const y2 = y ** 3;
1247
- const x2 = x ** 3;
1248
- const z2 = z ** 3;
1249
- y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
1250
- x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
1251
- z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
1252
- x *= 95.047;
1253
- y *= 100;
1254
- z *= 108.883;
1255
- return [
1256
- x,
1257
- y,
1258
- z
1259
- ];
1260
- };
1261
- convert.lab.lch = function(lab) {
1262
- const l = lab[0];
1263
- const a = lab[1];
1264
- const b = lab[2];
1265
- let h;
1266
- h = Math.atan2(b, a) * 360 / 2 / Math.PI;
1267
- if (h < 0) h += 360;
1268
- return [
1269
- l,
1270
- Math.sqrt(a * a + b * b),
1271
- h
1272
- ];
1273
- };
1274
- convert.lch.lab = function(lch) {
1275
- const l = lch[0];
1276
- const c = lch[1];
1277
- const hr = lch[2] / 360 * 2 * Math.PI;
1278
- return [
1279
- l,
1280
- c * Math.cos(hr),
1281
- c * Math.sin(hr)
1282
- ];
1283
- };
1284
- convert.rgb.ansi16 = function(args, saturation = null) {
1285
- const [r, g, b] = args;
1286
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
1287
- value = Math.round(value / 50);
1288
- if (value === 0) return 30;
1289
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1290
- if (value === 2) ansi += 60;
1291
- return ansi;
1292
- };
1293
- convert.hsv.ansi16 = function(args) {
1294
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1295
- };
1296
- convert.rgb.ansi256 = function(args) {
1297
- const r = args[0];
1298
- const g = args[1];
1299
- const b = args[2];
1300
- if (r === g && g === b) {
1301
- if (r < 8) return 16;
1302
- if (r > 248) return 231;
1303
- return Math.round((r - 8) / 247 * 24) + 232;
1304
- }
1305
- return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1306
- };
1307
- convert.ansi16.rgb = function(args) {
1308
- let color = args % 10;
1309
- if (color === 0 || color === 7) {
1310
- if (args > 50) color += 3.5;
1311
- color = color / 10.5 * 255;
1312
- return [
1313
- color,
1314
- color,
1315
- color
1316
- ];
1317
- }
1318
- const mult = (~~(args > 50) + 1) * .5;
1319
- return [
1320
- (color & 1) * mult * 255,
1321
- (color >> 1 & 1) * mult * 255,
1322
- (color >> 2 & 1) * mult * 255
1323
- ];
1324
- };
1325
- convert.ansi256.rgb = function(args) {
1326
- if (args >= 232) {
1327
- const c = (args - 232) * 10 + 8;
1328
- return [
1329
- c,
1330
- c,
1331
- c
1332
- ];
1333
- }
1334
- args -= 16;
1335
- let rem;
1336
- return [
1337
- Math.floor(args / 36) / 5 * 255,
1338
- Math.floor((rem = args % 36) / 6) / 5 * 255,
1339
- rem % 6 / 5 * 255
1340
- ];
1341
- };
1342
- convert.rgb.hex = function(args) {
1343
- const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
1344
- return "000000".substring(string.length) + string;
1345
- };
1346
- convert.hex.rgb = function(args) {
1347
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1348
- if (!match) return [
1349
- 0,
1350
- 0,
1351
- 0
1352
- ];
1353
- let colorString = match[0];
1354
- if (match[0].length === 3) colorString = colorString.split("").map((char) => {
1355
- return char + char;
1356
- }).join("");
1357
- const integer = parseInt(colorString, 16);
1358
- return [
1359
- integer >> 16 & 255,
1360
- integer >> 8 & 255,
1361
- integer & 255
1362
- ];
1363
- };
1364
- convert.rgb.hcg = function(rgb) {
1365
- const r = rgb[0] / 255;
1366
- const g = rgb[1] / 255;
1367
- const b = rgb[2] / 255;
1368
- const max = Math.max(Math.max(r, g), b);
1369
- const min = Math.min(Math.min(r, g), b);
1370
- const chroma = max - min;
1371
- let grayscale;
1372
- let hue;
1373
- if (chroma < 1) grayscale = min / (1 - chroma);
1374
- else grayscale = 0;
1375
- if (chroma <= 0) hue = 0;
1376
- else if (max === r) hue = (g - b) / chroma % 6;
1377
- else if (max === g) hue = 2 + (b - r) / chroma;
1378
- else hue = 4 + (r - g) / chroma;
1379
- hue /= 6;
1380
- hue %= 1;
1381
- return [
1382
- hue * 360,
1383
- chroma * 100,
1384
- grayscale * 100
1385
- ];
1386
- };
1387
- convert.hsl.hcg = function(hsl) {
1388
- const s = hsl[1] / 100;
1389
- const l = hsl[2] / 100;
1390
- const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
1391
- let f = 0;
1392
- if (c < 1) f = (l - .5 * c) / (1 - c);
1393
- return [
1394
- hsl[0],
1395
- c * 100,
1396
- f * 100
1397
- ];
1398
- };
1399
- convert.hsv.hcg = function(hsv) {
1400
- const s = hsv[1] / 100;
1401
- const v = hsv[2] / 100;
1402
- const c = s * v;
1403
- let f = 0;
1404
- if (c < 1) f = (v - c) / (1 - c);
1405
- return [
1406
- hsv[0],
1407
- c * 100,
1408
- f * 100
1409
- ];
1410
- };
1411
- convert.hcg.rgb = function(hcg) {
1412
- const h = hcg[0] / 360;
1413
- const c = hcg[1] / 100;
1414
- const g = hcg[2] / 100;
1415
- if (c === 0) return [
1416
- g * 255,
1417
- g * 255,
1418
- g * 255
1419
- ];
1420
- const pure = [
1421
- 0,
1422
- 0,
1423
- 0
1424
- ];
1425
- const hi = h % 1 * 6;
1426
- const v = hi % 1;
1427
- const w = 1 - v;
1428
- let mg = 0;
1429
- switch (Math.floor(hi)) {
1430
- case 0:
1431
- pure[0] = 1;
1432
- pure[1] = v;
1433
- pure[2] = 0;
1434
- break;
1435
- case 1:
1436
- pure[0] = w;
1437
- pure[1] = 1;
1438
- pure[2] = 0;
1439
- break;
1440
- case 2:
1441
- pure[0] = 0;
1442
- pure[1] = 1;
1443
- pure[2] = v;
1444
- break;
1445
- case 3:
1446
- pure[0] = 0;
1447
- pure[1] = w;
1448
- pure[2] = 1;
1449
- break;
1450
- case 4:
1451
- pure[0] = v;
1452
- pure[1] = 0;
1453
- pure[2] = 1;
1454
- break;
1455
- default:
1456
- pure[0] = 1;
1457
- pure[1] = 0;
1458
- pure[2] = w;
1459
- }
1460
- mg = (1 - c) * g;
1461
- return [
1462
- (c * pure[0] + mg) * 255,
1463
- (c * pure[1] + mg) * 255,
1464
- (c * pure[2] + mg) * 255
1465
- ];
1466
- };
1467
- convert.hcg.hsv = function(hcg) {
1468
- const c = hcg[1] / 100;
1469
- const v = c + hcg[2] / 100 * (1 - c);
1470
- let f = 0;
1471
- if (v > 0) f = c / v;
1472
- return [
1473
- hcg[0],
1474
- f * 100,
1475
- v * 100
1476
- ];
1477
- };
1478
- convert.hcg.hsl = function(hcg) {
1479
- const c = hcg[1] / 100;
1480
- const l = hcg[2] / 100 * (1 - c) + .5 * c;
1481
- let s = 0;
1482
- if (l > 0 && l < .5) s = c / (2 * l);
1483
- else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
1484
- return [
1485
- hcg[0],
1486
- s * 100,
1487
- l * 100
1488
- ];
1489
- };
1490
- convert.hcg.hwb = function(hcg) {
1491
- const c = hcg[1] / 100;
1492
- const v = c + hcg[2] / 100 * (1 - c);
1493
- return [
1494
- hcg[0],
1495
- (v - c) * 100,
1496
- (1 - v) * 100
1497
- ];
1498
- };
1499
- convert.hwb.hcg = function(hwb) {
1500
- const w = hwb[1] / 100;
1501
- const v = 1 - hwb[2] / 100;
1502
- const c = v - w;
1503
- let g = 0;
1504
- if (c < 1) g = (v - c) / (1 - c);
1505
- return [
1506
- hwb[0],
1507
- c * 100,
1508
- g * 100
1509
- ];
1510
- };
1511
- convert.apple.rgb = function(apple) {
1512
- return [
1513
- apple[0] / 65535 * 255,
1514
- apple[1] / 65535 * 255,
1515
- apple[2] / 65535 * 255
1516
- ];
1517
- };
1518
- convert.rgb.apple = function(rgb) {
1519
- return [
1520
- rgb[0] / 255 * 65535,
1521
- rgb[1] / 255 * 65535,
1522
- rgb[2] / 255 * 65535
1523
- ];
1524
- };
1525
- convert.gray.rgb = function(args) {
1526
- return [
1527
- args[0] / 100 * 255,
1528
- args[0] / 100 * 255,
1529
- args[0] / 100 * 255
1530
- ];
1531
- };
1532
- convert.gray.hsl = function(args) {
1533
- return [
1534
- 0,
1535
- 0,
1536
- args[0]
1537
- ];
1538
- };
1539
- convert.gray.hsv = convert.gray.hsl;
1540
- convert.gray.hwb = function(gray) {
1541
- return [
1542
- 0,
1543
- 100,
1544
- gray[0]
1545
- ];
1546
- };
1547
- convert.gray.cmyk = function(gray) {
1548
- return [
1549
- 0,
1550
- 0,
1551
- 0,
1552
- gray[0]
1553
- ];
1554
- };
1555
- convert.gray.lab = function(gray) {
1556
- return [
1557
- gray[0],
1558
- 0,
1559
- 0
1560
- ];
1561
- };
1562
- convert.gray.hex = function(gray) {
1563
- const val = Math.round(gray[0] / 100 * 255) & 255;
1564
- const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
1565
- return "000000".substring(string.length) + string;
1566
- };
1567
- convert.rgb.gray = function(rgb) {
1568
- return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
1569
- };
1570
- }));
1571
- //#endregion
1572
- //#region node_modules/color-convert/route.js
1573
- var require_route$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1574
- var conversions = require_conversions$1();
1575
- function buildGraph() {
1576
- const graph = {};
1577
- const models = Object.keys(conversions);
1578
- for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
1579
- distance: -1,
1580
- parent: null
1581
- };
1582
- return graph;
1583
- }
1584
- function deriveBFS(fromModel) {
1585
- const graph = buildGraph();
1586
- const queue = [fromModel];
1587
- graph[fromModel].distance = 0;
1588
- while (queue.length) {
1589
- const current = queue.pop();
1590
- const adjacents = Object.keys(conversions[current]);
1591
- for (let len = adjacents.length, i = 0; i < len; i++) {
1592
- const adjacent = adjacents[i];
1593
- const node = graph[adjacent];
1594
- if (node.distance === -1) {
1595
- node.distance = graph[current].distance + 1;
1596
- node.parent = current;
1597
- queue.unshift(adjacent);
1598
- }
1599
- }
1600
- }
1601
- return graph;
1602
- }
1603
- function link(from, to) {
1604
- return function(args) {
1605
- return to(from(args));
1606
- };
1607
- }
1608
- function wrapConversion(toModel, graph) {
1609
- const path = [graph[toModel].parent, toModel];
1610
- let fn = conversions[graph[toModel].parent][toModel];
1611
- let cur = graph[toModel].parent;
1612
- while (graph[cur].parent) {
1613
- path.unshift(graph[cur].parent);
1614
- fn = link(conversions[graph[cur].parent][cur], fn);
1615
- cur = graph[cur].parent;
1616
- }
1617
- fn.conversion = path;
1618
- return fn;
40
+ //#region node_modules/chalk/source/vendor/ansi-styles/index.js
41
+ var ANSI_BACKGROUND_OFFSET$1 = 10;
42
+ var wrapAnsi16$1 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
43
+ var wrapAnsi256$1 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
44
+ var wrapAnsi16m$1 = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
45
+ var styles$3 = {
46
+ modifier: {
47
+ reset: [0, 0],
48
+ bold: [1, 22],
49
+ dim: [2, 22],
50
+ italic: [3, 23],
51
+ underline: [4, 24],
52
+ overline: [53, 55],
53
+ inverse: [7, 27],
54
+ hidden: [8, 28],
55
+ strikethrough: [9, 29]
56
+ },
57
+ color: {
58
+ black: [30, 39],
59
+ red: [31, 39],
60
+ green: [32, 39],
61
+ yellow: [33, 39],
62
+ blue: [34, 39],
63
+ magenta: [35, 39],
64
+ cyan: [36, 39],
65
+ white: [37, 39],
66
+ blackBright: [90, 39],
67
+ gray: [90, 39],
68
+ grey: [90, 39],
69
+ redBright: [91, 39],
70
+ greenBright: [92, 39],
71
+ yellowBright: [93, 39],
72
+ blueBright: [94, 39],
73
+ magentaBright: [95, 39],
74
+ cyanBright: [96, 39],
75
+ whiteBright: [97, 39]
76
+ },
77
+ bgColor: {
78
+ bgBlack: [40, 49],
79
+ bgRed: [41, 49],
80
+ bgGreen: [42, 49],
81
+ bgYellow: [43, 49],
82
+ bgBlue: [44, 49],
83
+ bgMagenta: [45, 49],
84
+ bgCyan: [46, 49],
85
+ bgWhite: [47, 49],
86
+ bgBlackBright: [100, 49],
87
+ bgGray: [100, 49],
88
+ bgGrey: [100, 49],
89
+ bgRedBright: [101, 49],
90
+ bgGreenBright: [102, 49],
91
+ bgYellowBright: [103, 49],
92
+ bgBlueBright: [104, 49],
93
+ bgMagentaBright: [105, 49],
94
+ bgCyanBright: [106, 49],
95
+ bgWhiteBright: [107, 49]
1619
96
  }
1620
- module.exports = function(fromModel) {
1621
- const graph = deriveBFS(fromModel);
1622
- const conversion = {};
1623
- const models = Object.keys(graph);
1624
- for (let len = models.length, i = 0; i < len; i++) {
1625
- const toModel = models[i];
1626
- if (graph[toModel].parent === null) continue;
1627
- conversion[toModel] = wrapConversion(toModel, graph);
97
+ };
98
+ Object.keys(styles$3.modifier);
99
+ var foregroundColorNames$1 = Object.keys(styles$3.color);
100
+ var backgroundColorNames$1 = Object.keys(styles$3.bgColor);
101
+ [...foregroundColorNames$1, ...backgroundColorNames$1];
102
+ function assembleStyles$1() {
103
+ const codes = /* @__PURE__ */ new Map();
104
+ for (const [groupName, group] of Object.entries(styles$3)) {
105
+ for (const [styleName, style] of Object.entries(group)) {
106
+ styles$3[styleName] = {
107
+ open: `\u001B[${style[0]}m`,
108
+ close: `\u001B[${style[1]}m`
109
+ };
110
+ group[styleName] = styles$3[styleName];
111
+ codes.set(style[0], style[1]);
1628
112
  }
1629
- return conversion;
1630
- };
1631
- }));
1632
- //#endregion
1633
- //#region node_modules/color-convert/index.js
1634
- var require_color_convert$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1635
- var conversions = require_conversions$1();
1636
- var route = require_route$1();
1637
- var convert = {};
1638
- var models = Object.keys(conversions);
1639
- function wrapRaw(fn) {
1640
- const wrappedFn = function(...args) {
1641
- const arg0 = args[0];
1642
- if (arg0 === void 0 || arg0 === null) return arg0;
1643
- if (arg0.length > 1) args = arg0;
1644
- return fn(args);
1645
- };
1646
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
1647
- return wrappedFn;
1648
- }
1649
- function wrapRounded(fn) {
1650
- const wrappedFn = function(...args) {
1651
- const arg0 = args[0];
1652
- if (arg0 === void 0 || arg0 === null) return arg0;
1653
- if (arg0.length > 1) args = arg0;
1654
- const result = fn(args);
1655
- if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
1656
- return result;
1657
- };
1658
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
1659
- return wrappedFn;
1660
- }
1661
- models.forEach((fromModel) => {
1662
- convert[fromModel] = {};
1663
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
1664
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
1665
- const routes = route(fromModel);
1666
- Object.keys(routes).forEach((toModel) => {
1667
- const fn = routes[toModel];
1668
- convert[fromModel][toModel] = wrapRounded(fn);
1669
- convert[fromModel][toModel].raw = wrapRaw(fn);
113
+ Object.defineProperty(styles$3, groupName, {
114
+ value: group,
115
+ enumerable: false
1670
116
  });
117
+ }
118
+ Object.defineProperty(styles$3, "codes", {
119
+ value: codes,
120
+ enumerable: false
1671
121
  });
1672
- module.exports = convert;
1673
- }));
1674
- //#endregion
1675
- //#region node_modules/ansi-styles/index.js
1676
- var require_ansi_styles$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1677
- var wrapAnsi16 = (fn, offset) => (...args) => {
1678
- return `\u001B[${fn(...args) + offset}m`;
1679
- };
1680
- var wrapAnsi256 = (fn, offset) => (...args) => {
1681
- const code = fn(...args);
1682
- return `\u001B[${38 + offset};5;${code}m`;
1683
- };
1684
- var wrapAnsi16m = (fn, offset) => (...args) => {
1685
- const rgb = fn(...args);
1686
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1687
- };
1688
- var ansi2ansi = (n) => n;
1689
- var rgb2rgb = (r, g, b) => [
1690
- r,
1691
- g,
1692
- b
1693
- ];
1694
- var setLazyProperty = (object, property, get) => {
1695
- Object.defineProperty(object, property, {
1696
- get: () => {
1697
- const value = get();
1698
- Object.defineProperty(object, property, {
1699
- value,
1700
- enumerable: true,
1701
- configurable: true
1702
- });
1703
- return value;
122
+ styles$3.color.close = "\x1B[39m";
123
+ styles$3.bgColor.close = "\x1B[49m";
124
+ styles$3.color.ansi = wrapAnsi16$1();
125
+ styles$3.color.ansi256 = wrapAnsi256$1();
126
+ styles$3.color.ansi16m = wrapAnsi16m$1();
127
+ styles$3.bgColor.ansi = wrapAnsi16$1(ANSI_BACKGROUND_OFFSET$1);
128
+ styles$3.bgColor.ansi256 = wrapAnsi256$1(ANSI_BACKGROUND_OFFSET$1);
129
+ styles$3.bgColor.ansi16m = wrapAnsi16m$1(ANSI_BACKGROUND_OFFSET$1);
130
+ Object.defineProperties(styles$3, {
131
+ rgbToAnsi256: {
132
+ value(red, green, blue) {
133
+ if (red === green && green === blue) {
134
+ if (red < 8) return 16;
135
+ if (red > 248) return 231;
136
+ return Math.round((red - 8) / 247 * 24) + 232;
137
+ }
138
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1704
139
  },
1705
- enumerable: true,
1706
- configurable: true
1707
- });
1708
- };
1709
- /** @type {typeof import('color-convert')} */
1710
- var colorConvert;
1711
- var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1712
- if (colorConvert === void 0) colorConvert = require_color_convert$1();
1713
- const offset = isBackground ? 10 : 0;
1714
- const styles = {};
1715
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1716
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1717
- if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
1718
- else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
1719
- }
1720
- return styles;
1721
- };
1722
- function assembleStyles() {
1723
- const codes = /* @__PURE__ */ new Map();
1724
- const styles = {
1725
- modifier: {
1726
- reset: [0, 0],
1727
- bold: [1, 22],
1728
- dim: [2, 22],
1729
- italic: [3, 23],
1730
- underline: [4, 24],
1731
- inverse: [7, 27],
1732
- hidden: [8, 28],
1733
- strikethrough: [9, 29]
140
+ enumerable: false
141
+ },
142
+ hexToRgb: {
143
+ value(hex) {
144
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
145
+ if (!matches) return [
146
+ 0,
147
+ 0,
148
+ 0
149
+ ];
150
+ let [colorString] = matches;
151
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
152
+ const integer = Number.parseInt(colorString, 16);
153
+ return [
154
+ integer >> 16 & 255,
155
+ integer >> 8 & 255,
156
+ integer & 255
157
+ ];
1734
158
  },
1735
- color: {
1736
- black: [30, 39],
1737
- red: [31, 39],
1738
- green: [32, 39],
1739
- yellow: [33, 39],
1740
- blue: [34, 39],
1741
- magenta: [35, 39],
1742
- cyan: [36, 39],
1743
- white: [37, 39],
1744
- blackBright: [90, 39],
1745
- redBright: [91, 39],
1746
- greenBright: [92, 39],
1747
- yellowBright: [93, 39],
1748
- blueBright: [94, 39],
1749
- magentaBright: [95, 39],
1750
- cyanBright: [96, 39],
1751
- whiteBright: [97, 39]
159
+ enumerable: false
160
+ },
161
+ hexToAnsi256: {
162
+ value: (hex) => styles$3.rgbToAnsi256(...styles$3.hexToRgb(hex)),
163
+ enumerable: false
164
+ },
165
+ ansi256ToAnsi: {
166
+ value(code) {
167
+ if (code < 8) return 30 + code;
168
+ if (code < 16) return 90 + (code - 8);
169
+ let red;
170
+ let green;
171
+ let blue;
172
+ if (code >= 232) {
173
+ red = ((code - 232) * 10 + 8) / 255;
174
+ green = red;
175
+ blue = red;
176
+ } else {
177
+ code -= 16;
178
+ const remainder = code % 36;
179
+ red = Math.floor(code / 36) / 5;
180
+ green = Math.floor(remainder / 6) / 5;
181
+ blue = remainder % 6 / 5;
182
+ }
183
+ const value = Math.max(red, green, blue) * 2;
184
+ if (value === 0) return 30;
185
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
186
+ if (value === 2) result += 60;
187
+ return result;
1752
188
  },
1753
- bgColor: {
1754
- bgBlack: [40, 49],
1755
- bgRed: [41, 49],
1756
- bgGreen: [42, 49],
1757
- bgYellow: [43, 49],
1758
- bgBlue: [44, 49],
1759
- bgMagenta: [45, 49],
1760
- bgCyan: [46, 49],
1761
- bgWhite: [47, 49],
1762
- bgBlackBright: [100, 49],
1763
- bgRedBright: [101, 49],
1764
- bgGreenBright: [102, 49],
1765
- bgYellowBright: [103, 49],
1766
- bgBlueBright: [104, 49],
1767
- bgMagentaBright: [105, 49],
1768
- bgCyanBright: [106, 49],
1769
- bgWhiteBright: [107, 49]
1770
- }
1771
- };
1772
- styles.color.gray = styles.color.blackBright;
1773
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1774
- styles.color.grey = styles.color.blackBright;
1775
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1776
- for (const [groupName, group] of Object.entries(styles)) {
1777
- for (const [styleName, style] of Object.entries(group)) {
1778
- styles[styleName] = {
1779
- open: `\u001B[${style[0]}m`,
1780
- close: `\u001B[${style[1]}m`
1781
- };
1782
- group[styleName] = styles[styleName];
1783
- codes.set(style[0], style[1]);
1784
- }
1785
- Object.defineProperty(styles, groupName, {
1786
- value: group,
1787
- enumerable: false
1788
- });
1789
- }
1790
- Object.defineProperty(styles, "codes", {
1791
- value: codes,
1792
189
  enumerable: false
1793
- });
1794
- styles.color.close = "\x1B[39m";
1795
- styles.bgColor.close = "\x1B[49m";
1796
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1797
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1798
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1799
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1800
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1801
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1802
- return styles;
1803
- }
1804
- Object.defineProperty(module, "exports", {
1805
- enumerable: true,
1806
- get: assembleStyles
190
+ },
191
+ rgbToAnsi: {
192
+ value: (red, green, blue) => styles$3.ansi256ToAnsi(styles$3.rgbToAnsi256(red, green, blue)),
193
+ enumerable: false
194
+ },
195
+ hexToAnsi: {
196
+ value: (hex) => styles$3.ansi256ToAnsi(styles$3.hexToAnsi256(hex)),
197
+ enumerable: false
198
+ }
1807
199
  });
1808
- }));
1809
- //#endregion
1810
- //#region node_modules/supports-color/browser.js
1811
- var require_browser$2 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1812
- module.exports = {
1813
- stdout: false,
1814
- stderr: false
1815
- };
1816
- }));
200
+ return styles$3;
201
+ }
202
+ var ansiStyles$1 = assembleStyles$1();
1817
203
  //#endregion
1818
- //#region node_modules/chalk/source/util.js
1819
- var require_util$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1820
- var stringReplaceAll = (string, substring, replacer) => {
1821
- let index = string.indexOf(substring);
1822
- if (index === -1) return string;
1823
- const substringLength = substring.length;
1824
- let endIndex = 0;
1825
- let returnValue = "";
1826
- do {
1827
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1828
- endIndex = index + substringLength;
1829
- index = string.indexOf(substring, endIndex);
1830
- } while (index !== -1);
1831
- returnValue += string.substr(endIndex);
1832
- return returnValue;
1833
- };
1834
- var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1835
- let endIndex = 0;
1836
- let returnValue = "";
1837
- do {
1838
- const gotCR = string[index - 1] === "\r";
1839
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1840
- endIndex = index + 1;
1841
- index = string.indexOf("\n", endIndex);
1842
- } while (index !== -1);
1843
- returnValue += string.substr(endIndex);
1844
- return returnValue;
1845
- };
1846
- module.exports = {
1847
- stringReplaceAll,
1848
- stringEncaseCRLFWithFirstIndex
1849
- };
1850
- }));
204
+ //#region node_modules/chalk/source/vendor/supports-color/browser.js
205
+ var level$1 = (() => {
206
+ if (!("navigator" in globalThis)) return 0;
207
+ if (globalThis.navigator.userAgentData) {
208
+ const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
209
+ if (brand && brand.version > 93) return 3;
210
+ }
211
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
212
+ return 0;
213
+ })();
214
+ var colorSupport$1 = level$1 !== 0 && {
215
+ level: level$1,
216
+ hasBasic: true,
217
+ has256: level$1 >= 2,
218
+ has16m: level$1 >= 3
219
+ };
220
+ var supportsColor$1 = {
221
+ stdout: colorSupport$1,
222
+ stderr: colorSupport$1
223
+ };
1851
224
  //#endregion
1852
- //#region node_modules/chalk/source/templates.js
1853
- var require_templates$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1854
- 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;
1855
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1856
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1857
- var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1858
- var ESCAPES = new Map([
1859
- ["n", "\n"],
1860
- ["r", "\r"],
1861
- ["t", " "],
1862
- ["b", "\b"],
1863
- ["f", "\f"],
1864
- ["v", "\v"],
1865
- ["0", "\0"],
1866
- ["\\", "\\"],
1867
- ["e", "\x1B"],
1868
- ["a", "\x07"]
1869
- ]);
1870
- function unescape(c) {
1871
- const u = c[0] === "u";
1872
- const bracket = c[1] === "{";
1873
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
1874
- if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1875
- return ESCAPES.get(c) || c;
1876
- }
1877
- function parseArguments(name, arguments_) {
1878
- const results = [];
1879
- const chunks = arguments_.trim().split(/\s*,\s*/g);
1880
- let matches;
1881
- for (const chunk of chunks) {
1882
- const number = Number(chunk);
1883
- if (!Number.isNaN(number)) results.push(number);
1884
- else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1885
- else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1886
- }
1887
- return results;
1888
- }
1889
- function parseStyle(style) {
1890
- STYLE_REGEX.lastIndex = 0;
1891
- const results = [];
1892
- let matches;
1893
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
1894
- const name = matches[1];
1895
- if (matches[2]) {
1896
- const args = parseArguments(name, matches[2]);
1897
- results.push([name].concat(args));
1898
- } else results.push([name]);
1899
- }
1900
- return results;
1901
- }
1902
- function buildStyle(chalk, styles) {
1903
- const enabled = {};
1904
- for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
1905
- let current = chalk;
1906
- for (const [styleName, styles] of Object.entries(enabled)) {
1907
- if (!Array.isArray(styles)) continue;
1908
- if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
1909
- current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
1910
- }
1911
- return current;
1912
- }
1913
- module.exports = (chalk, temporary) => {
1914
- const styles = [];
1915
- const chunks = [];
1916
- let chunk = [];
1917
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1918
- if (escapeCharacter) chunk.push(unescape(escapeCharacter));
1919
- else if (style) {
1920
- const string = chunk.join("");
1921
- chunk = [];
1922
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
1923
- styles.push({
1924
- inverse,
1925
- styles: parseStyle(style)
1926
- });
1927
- } else if (close) {
1928
- if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
1929
- chunks.push(buildStyle(chalk, styles)(chunk.join("")));
1930
- chunk = [];
1931
- styles.pop();
1932
- } else chunk.push(character);
1933
- });
1934
- chunks.push(chunk.join(""));
1935
- if (styles.length > 0) {
1936
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1937
- throw new Error(errMessage);
1938
- }
1939
- return chunks.join("");
1940
- };
1941
- }));
225
+ //#region node_modules/chalk/source/utilities.js
226
+ function stringReplaceAll$1(string, substring, replacer) {
227
+ let index = string.indexOf(substring);
228
+ if (index === -1) return string;
229
+ const substringLength = substring.length;
230
+ let endIndex = 0;
231
+ let returnValue = "";
232
+ do {
233
+ returnValue += string.slice(endIndex, index) + substring + replacer;
234
+ endIndex = index + substringLength;
235
+ index = string.indexOf(substring, endIndex);
236
+ } while (index !== -1);
237
+ returnValue += string.slice(endIndex);
238
+ return returnValue;
239
+ }
240
+ function stringEncaseCRLFWithFirstIndex$1(string, prefix, postfix, index) {
241
+ let endIndex = 0;
242
+ let returnValue = "";
243
+ do {
244
+ const gotCR = string[index - 1] === "\r";
245
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
246
+ endIndex = index + 1;
247
+ index = string.indexOf("\n", endIndex);
248
+ } while (index !== -1);
249
+ returnValue += string.slice(endIndex);
250
+ return returnValue;
251
+ }
1942
252
  //#endregion
1943
253
  //#region node_modules/chalk/source/index.js
1944
- var require_source = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
1945
- var ansiStyles = require_ansi_styles$1();
1946
- var { stdout: stdoutColor, stderr: stderrColor } = require_browser$2();
1947
- var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util$1();
1948
- var { isArray } = Array;
1949
- var levelMapping = [
1950
- "ansi",
1951
- "ansi",
1952
- "ansi256",
1953
- "ansi16m"
1954
- ];
1955
- var styles = Object.create(null);
1956
- var applyOptions = (object, options = {}) => {
1957
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
1958
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
1959
- object.level = options.level === void 0 ? colorLevel : options.level;
1960
- };
1961
- var ChalkClass = class {
1962
- constructor(options) {
1963
- return chalkFactory(options);
1964
- }
1965
- };
1966
- var chalkFactory = (options) => {
1967
- const chalk = {};
1968
- applyOptions(chalk, options);
1969
- chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
1970
- Object.setPrototypeOf(chalk, Chalk.prototype);
1971
- Object.setPrototypeOf(chalk.template, chalk);
1972
- chalk.template.constructor = () => {
1973
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
254
+ var { stdout: stdoutColor$1, stderr: stderrColor$1 } = supportsColor$1;
255
+ var GENERATOR$1 = Symbol("GENERATOR");
256
+ var STYLER$1 = Symbol("STYLER");
257
+ var IS_EMPTY$1 = Symbol("IS_EMPTY");
258
+ var levelMapping$1 = [
259
+ "ansi",
260
+ "ansi",
261
+ "ansi256",
262
+ "ansi16m"
263
+ ];
264
+ var styles$2 = Object.create(null);
265
+ var applyOptions$1 = (object, options = {}) => {
266
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
267
+ const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
268
+ object.level = options.level === void 0 ? colorLevel : options.level;
269
+ };
270
+ var chalkFactory$1 = (options) => {
271
+ const chalk = (...strings) => strings.join(" ");
272
+ applyOptions$1(chalk, options);
273
+ Object.setPrototypeOf(chalk, createChalk$1.prototype);
274
+ return chalk;
275
+ };
276
+ function createChalk$1(options) {
277
+ return chalkFactory$1(options);
278
+ }
279
+ Object.setPrototypeOf(createChalk$1.prototype, Function.prototype);
280
+ for (const [styleName, style] of Object.entries(ansiStyles$1)) styles$2[styleName] = { get() {
281
+ const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this[STYLER$1]), this[IS_EMPTY$1]);
282
+ Object.defineProperty(this, styleName, { value: builder });
283
+ return builder;
284
+ } };
285
+ styles$2.visible = { get() {
286
+ const builder = createBuilder$1(this, this[STYLER$1], true);
287
+ Object.defineProperty(this, "visible", { value: builder });
288
+ return builder;
289
+ } };
290
+ var getModelAnsi$1 = (model, level, type, ...arguments_) => {
291
+ if (model === "rgb") {
292
+ if (level === "ansi16m") return ansiStyles$1[type].ansi16m(...arguments_);
293
+ if (level === "ansi256") return ansiStyles$1[type].ansi256(ansiStyles$1.rgbToAnsi256(...arguments_));
294
+ return ansiStyles$1[type].ansi(ansiStyles$1.rgbToAnsi(...arguments_));
295
+ }
296
+ if (model === "hex") return getModelAnsi$1("rgb", level, type, ...ansiStyles$1.hexToRgb(...arguments_));
297
+ return ansiStyles$1[type][model](...arguments_);
298
+ };
299
+ for (const model of [
300
+ "rgb",
301
+ "hex",
302
+ "ansi256"
303
+ ]) {
304
+ styles$2[model] = { get() {
305
+ const { level } = this;
306
+ return function(...arguments_) {
307
+ const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "color", ...arguments_), ansiStyles$1.color.close, this[STYLER$1]);
308
+ return createBuilder$1(this, styler, this[IS_EMPTY$1]);
1974
309
  };
1975
- chalk.template.Instance = ChalkClass;
1976
- return chalk.template;
1977
- };
1978
- function Chalk(options) {
1979
- return chalkFactory(options);
1980
- }
1981
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
1982
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1983
- Object.defineProperty(this, styleName, { value: builder });
1984
- return builder;
1985
- } };
1986
- styles.visible = { get() {
1987
- const builder = createBuilder(this, this._styler, true);
1988
- Object.defineProperty(this, "visible", { value: builder });
1989
- return builder;
1990
310
  } };
1991
- var usedModels = [
1992
- "rgb",
1993
- "hex",
1994
- "keyword",
1995
- "hsl",
1996
- "hsv",
1997
- "hwb",
1998
- "ansi",
1999
- "ansi256"
2000
- ];
2001
- for (const model of usedModels) styles[model] = { get() {
311
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
312
+ styles$2[bgModel] = { get() {
2002
313
  const { level } = this;
2003
314
  return function(...arguments_) {
2004
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
2005
- return createBuilder(this, styler, this._isEmpty);
315
+ const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "bgColor", ...arguments_), ansiStyles$1.bgColor.close, this[STYLER$1]);
316
+ return createBuilder$1(this, styler, this[IS_EMPTY$1]);
2006
317
  };
2007
318
  } };
2008
- for (const model of usedModels) {
2009
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
2010
- styles[bgModel] = { get() {
2011
- const { level } = this;
2012
- return function(...arguments_) {
2013
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
2014
- return createBuilder(this, styler, this._isEmpty);
2015
- };
2016
- } };
2017
- }
2018
- var proto = Object.defineProperties(() => {}, {
2019
- ...styles,
2020
- level: {
2021
- enumerable: true,
2022
- get() {
2023
- return this._generator.level;
2024
- },
2025
- set(level) {
2026
- this._generator.level = level;
2027
- }
2028
- }
2029
- });
2030
- var createStyler = (open, close, parent) => {
2031
- let openAll;
2032
- let closeAll;
2033
- if (parent === void 0) {
2034
- openAll = open;
2035
- closeAll = close;
2036
- } else {
2037
- openAll = parent.openAll + open;
2038
- closeAll = close + parent.closeAll;
2039
- }
2040
- return {
2041
- open,
2042
- close,
2043
- openAll,
2044
- closeAll,
2045
- parent
2046
- };
2047
- };
2048
- var createBuilder = (self, _styler, _isEmpty) => {
2049
- const builder = (...arguments_) => {
2050
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
2051
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
2052
- };
2053
- Object.setPrototypeOf(builder, proto);
2054
- builder._generator = self;
2055
- builder._styler = _styler;
2056
- builder._isEmpty = _isEmpty;
2057
- return builder;
2058
- };
2059
- var applyStyle = (self, string) => {
2060
- if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
2061
- let styler = self._styler;
2062
- if (styler === void 0) return string;
2063
- const { openAll, closeAll } = styler;
2064
- if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
2065
- string = stringReplaceAll(string, styler.close, styler.open);
2066
- styler = styler.parent;
319
+ }
320
+ var proto$1 = Object.defineProperties(() => {}, {
321
+ ...styles$2,
322
+ level: {
323
+ enumerable: true,
324
+ get() {
325
+ return this[GENERATOR$1].level;
326
+ },
327
+ set(level) {
328
+ this[GENERATOR$1].level = level;
2067
329
  }
2068
- const lfIndex = string.indexOf("\n");
2069
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
2070
- return openAll + string + closeAll;
2071
- };
2072
- var template;
2073
- var chalkTag = (chalk, ...strings) => {
2074
- const [firstString] = strings;
2075
- if (!isArray(firstString) || !isArray(firstString.raw)) return strings.join(" ");
2076
- const arguments_ = strings.slice(1);
2077
- const parts = [firstString.raw[0]];
2078
- for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
2079
- if (template === void 0) template = require_templates$1();
2080
- return template(chalk, parts.join(""));
330
+ }
331
+ });
332
+ var createStyler$1 = (open, close, parent) => {
333
+ let openAll;
334
+ let closeAll;
335
+ if (parent === void 0) {
336
+ openAll = open;
337
+ closeAll = close;
338
+ } else {
339
+ openAll = parent.openAll + open;
340
+ closeAll = close + parent.closeAll;
341
+ }
342
+ return {
343
+ open,
344
+ close,
345
+ openAll,
346
+ closeAll,
347
+ parent
2081
348
  };
2082
- Object.defineProperties(Chalk.prototype, styles);
2083
- var chalk = Chalk();
2084
- chalk.supportsColor = stdoutColor;
2085
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
2086
- chalk.stderr.supportsColor = stderrColor;
2087
- module.exports = chalk;
2088
- }));
2089
- //#endregion
2090
- //#region node_modules/detect-node/browser.js
2091
- var require_browser$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
2092
- module.exports = false;
2093
- }));
349
+ };
350
+ var createBuilder$1 = (self, _styler, _isEmpty) => {
351
+ const builder = (...arguments_) => applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
352
+ Object.setPrototypeOf(builder, proto$1);
353
+ builder[GENERATOR$1] = self;
354
+ builder[STYLER$1] = _styler;
355
+ builder[IS_EMPTY$1] = _isEmpty;
356
+ return builder;
357
+ };
358
+ var applyStyle$1 = (self, string) => {
359
+ if (self.level <= 0 || !string) return self[IS_EMPTY$1] ? "" : string;
360
+ let styler = self[STYLER$1];
361
+ if (styler === void 0) return string;
362
+ const { openAll, closeAll } = styler;
363
+ if (string.includes("\x1B")) while (styler !== void 0) {
364
+ string = stringReplaceAll$1(string, styler.close, styler.open);
365
+ styler = styler.parent;
366
+ }
367
+ const lfIndex = string.indexOf("\n");
368
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex$1(string, closeAll, openAll, lfIndex);
369
+ return openAll + string + closeAll;
370
+ };
371
+ Object.defineProperties(createChalk$1.prototype, styles$2);
372
+ var chalk$1 = createChalk$1();
373
+ createChalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
2094
374
  //#endregion
2095
375
  //#region src/stsoauth2types.ts
2096
- var import_source = /* @__PURE__ */ __toESM$2(require_source(), 1);
2097
- var import_browser = /* @__PURE__ */ __toESM$2(require_browser$1(), 1);
376
+ var import_browser = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
377
+ module.exports = false;
378
+ })))(), 1);
2098
379
  var AuthorizeOptionsResponseType = /* @__PURE__ */ function(AuthorizeOptionsResponseType) {
2099
380
  AuthorizeOptionsResponseType["CODE"] = "code";
2100
381
  AuthorizeOptionsResponseType["ID_TOKEN"] = "id_token";
@@ -2209,7 +490,7 @@ var STSOauth2Store = defineStore("__sts__STSOauth2Store", {
2209
490
  });
2210
491
  //#endregion
2211
492
  //#region node_modules/tiny-emitter/index.js
2212
- var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
493
+ var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2213
494
  function E() {}
2214
495
  E.prototype = {
2215
496
  on: function(name, callback, ctx) {
@@ -2253,7 +534,7 @@ var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
2253
534
  }));
2254
535
  //#endregion
2255
536
  //#region node_modules/lodash.clonedeep/index.js
2256
- var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
537
+ var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2257
538
  /**
2258
539
  * lodash (Custom Build) <https://lodash.com/>
2259
540
  * Build: `lodash modularize exports="npm" -o ./`
@@ -3661,7 +1942,6 @@ var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$2(((exports, module
3661
1942
  }));
3662
1943
  require_tiny_emitter();
3663
1944
  require_lodash_clonedeep();
3664
- var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3665
1945
  var SubscriptionTopic = /* @__PURE__ */ function(SubscriptionTopic) {
3666
1946
  SubscriptionTopic["AllServicesCombined"] = "AllServicesCombined";
3667
1947
  SubscriptionTopic["Services"] = "Services";
@@ -3678,2038 +1958,333 @@ var SubscriptionTopic = /* @__PURE__ */ function(SubscriptionTopic) {
3678
1958
  SubscriptionTopic["LogProcessing"] = "LogProcessing";
3679
1959
  return SubscriptionTopic;
3680
1960
  }({});
3681
- var require_color_name = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3682
- module.exports = {
3683
- "aliceblue": [
3684
- 240,
3685
- 248,
3686
- 255
3687
- ],
3688
- "antiquewhite": [
3689
- 250,
3690
- 235,
3691
- 215
3692
- ],
3693
- "aqua": [
3694
- 0,
3695
- 255,
3696
- 255
3697
- ],
3698
- "aquamarine": [
3699
- 127,
3700
- 255,
3701
- 212
3702
- ],
3703
- "azure": [
3704
- 240,
3705
- 255,
3706
- 255
3707
- ],
3708
- "beige": [
3709
- 245,
3710
- 245,
3711
- 220
3712
- ],
3713
- "bisque": [
3714
- 255,
3715
- 228,
3716
- 196
3717
- ],
3718
- "black": [
3719
- 0,
3720
- 0,
3721
- 0
3722
- ],
3723
- "blanchedalmond": [
3724
- 255,
3725
- 235,
3726
- 205
3727
- ],
3728
- "blue": [
3729
- 0,
3730
- 0,
3731
- 255
3732
- ],
3733
- "blueviolet": [
3734
- 138,
3735
- 43,
3736
- 226
3737
- ],
3738
- "brown": [
3739
- 165,
3740
- 42,
3741
- 42
3742
- ],
3743
- "burlywood": [
3744
- 222,
3745
- 184,
3746
- 135
3747
- ],
3748
- "cadetblue": [
3749
- 95,
3750
- 158,
3751
- 160
3752
- ],
3753
- "chartreuse": [
3754
- 127,
3755
- 255,
3756
- 0
3757
- ],
3758
- "chocolate": [
3759
- 210,
3760
- 105,
3761
- 30
3762
- ],
3763
- "coral": [
3764
- 255,
3765
- 127,
3766
- 80
3767
- ],
3768
- "cornflowerblue": [
3769
- 100,
3770
- 149,
3771
- 237
3772
- ],
3773
- "cornsilk": [
3774
- 255,
3775
- 248,
3776
- 220
3777
- ],
3778
- "crimson": [
3779
- 220,
3780
- 20,
3781
- 60
3782
- ],
3783
- "cyan": [
3784
- 0,
3785
- 255,
3786
- 255
3787
- ],
3788
- "darkblue": [
3789
- 0,
3790
- 0,
3791
- 139
3792
- ],
3793
- "darkcyan": [
3794
- 0,
3795
- 139,
3796
- 139
3797
- ],
3798
- "darkgoldenrod": [
3799
- 184,
3800
- 134,
3801
- 11
3802
- ],
3803
- "darkgray": [
3804
- 169,
3805
- 169,
3806
- 169
3807
- ],
3808
- "darkgreen": [
3809
- 0,
3810
- 100,
3811
- 0
3812
- ],
3813
- "darkgrey": [
3814
- 169,
3815
- 169,
3816
- 169
3817
- ],
3818
- "darkkhaki": [
3819
- 189,
3820
- 183,
3821
- 107
3822
- ],
3823
- "darkmagenta": [
3824
- 139,
3825
- 0,
3826
- 139
3827
- ],
3828
- "darkolivegreen": [
3829
- 85,
3830
- 107,
3831
- 47
3832
- ],
3833
- "darkorange": [
3834
- 255,
3835
- 140,
3836
- 0
3837
- ],
3838
- "darkorchid": [
3839
- 153,
3840
- 50,
3841
- 204
3842
- ],
3843
- "darkred": [
3844
- 139,
3845
- 0,
3846
- 0
3847
- ],
3848
- "darksalmon": [
3849
- 233,
3850
- 150,
3851
- 122
3852
- ],
3853
- "darkseagreen": [
3854
- 143,
3855
- 188,
3856
- 143
3857
- ],
3858
- "darkslateblue": [
3859
- 72,
3860
- 61,
3861
- 139
3862
- ],
3863
- "darkslategray": [
3864
- 47,
3865
- 79,
3866
- 79
3867
- ],
3868
- "darkslategrey": [
3869
- 47,
3870
- 79,
3871
- 79
3872
- ],
3873
- "darkturquoise": [
3874
- 0,
3875
- 206,
3876
- 209
3877
- ],
3878
- "darkviolet": [
3879
- 148,
3880
- 0,
3881
- 211
3882
- ],
3883
- "deeppink": [
3884
- 255,
3885
- 20,
3886
- 147
3887
- ],
3888
- "deepskyblue": [
3889
- 0,
3890
- 191,
3891
- 255
3892
- ],
3893
- "dimgray": [
3894
- 105,
3895
- 105,
3896
- 105
3897
- ],
3898
- "dimgrey": [
3899
- 105,
3900
- 105,
3901
- 105
3902
- ],
3903
- "dodgerblue": [
3904
- 30,
3905
- 144,
3906
- 255
3907
- ],
3908
- "firebrick": [
3909
- 178,
3910
- 34,
3911
- 34
3912
- ],
3913
- "floralwhite": [
3914
- 255,
3915
- 250,
3916
- 240
3917
- ],
3918
- "forestgreen": [
3919
- 34,
3920
- 139,
3921
- 34
3922
- ],
3923
- "fuchsia": [
3924
- 255,
3925
- 0,
3926
- 255
3927
- ],
3928
- "gainsboro": [
3929
- 220,
3930
- 220,
3931
- 220
3932
- ],
3933
- "ghostwhite": [
3934
- 248,
3935
- 248,
3936
- 255
3937
- ],
3938
- "gold": [
3939
- 255,
3940
- 215,
3941
- 0
3942
- ],
3943
- "goldenrod": [
3944
- 218,
3945
- 165,
3946
- 32
3947
- ],
3948
- "gray": [
3949
- 128,
3950
- 128,
3951
- 128
3952
- ],
3953
- "green": [
3954
- 0,
3955
- 128,
3956
- 0
3957
- ],
3958
- "greenyellow": [
3959
- 173,
3960
- 255,
3961
- 47
3962
- ],
3963
- "grey": [
3964
- 128,
3965
- 128,
3966
- 128
3967
- ],
3968
- "honeydew": [
3969
- 240,
3970
- 255,
3971
- 240
3972
- ],
3973
- "hotpink": [
3974
- 255,
3975
- 105,
3976
- 180
3977
- ],
3978
- "indianred": [
3979
- 205,
3980
- 92,
3981
- 92
3982
- ],
3983
- "indigo": [
3984
- 75,
3985
- 0,
3986
- 130
3987
- ],
3988
- "ivory": [
3989
- 255,
3990
- 255,
3991
- 240
3992
- ],
3993
- "khaki": [
3994
- 240,
3995
- 230,
3996
- 140
3997
- ],
3998
- "lavender": [
3999
- 230,
4000
- 230,
4001
- 250
4002
- ],
4003
- "lavenderblush": [
4004
- 255,
4005
- 240,
4006
- 245
4007
- ],
4008
- "lawngreen": [
4009
- 124,
4010
- 252,
4011
- 0
4012
- ],
4013
- "lemonchiffon": [
4014
- 255,
4015
- 250,
4016
- 205
4017
- ],
4018
- "lightblue": [
4019
- 173,
4020
- 216,
4021
- 230
4022
- ],
4023
- "lightcoral": [
4024
- 240,
4025
- 128,
4026
- 128
4027
- ],
4028
- "lightcyan": [
4029
- 224,
4030
- 255,
4031
- 255
4032
- ],
4033
- "lightgoldenrodyellow": [
4034
- 250,
4035
- 250,
4036
- 210
4037
- ],
4038
- "lightgray": [
4039
- 211,
4040
- 211,
4041
- 211
4042
- ],
4043
- "lightgreen": [
4044
- 144,
4045
- 238,
4046
- 144
4047
- ],
4048
- "lightgrey": [
4049
- 211,
4050
- 211,
4051
- 211
4052
- ],
4053
- "lightpink": [
4054
- 255,
4055
- 182,
4056
- 193
4057
- ],
4058
- "lightsalmon": [
4059
- 255,
4060
- 160,
4061
- 122
4062
- ],
4063
- "lightseagreen": [
4064
- 32,
4065
- 178,
4066
- 170
4067
- ],
4068
- "lightskyblue": [
4069
- 135,
4070
- 206,
4071
- 250
4072
- ],
4073
- "lightslategray": [
4074
- 119,
4075
- 136,
4076
- 153
4077
- ],
4078
- "lightslategrey": [
4079
- 119,
4080
- 136,
4081
- 153
4082
- ],
4083
- "lightsteelblue": [
4084
- 176,
4085
- 196,
4086
- 222
4087
- ],
4088
- "lightyellow": [
4089
- 255,
4090
- 255,
4091
- 224
4092
- ],
4093
- "lime": [
4094
- 0,
4095
- 255,
4096
- 0
4097
- ],
4098
- "limegreen": [
4099
- 50,
4100
- 205,
4101
- 50
4102
- ],
4103
- "linen": [
4104
- 250,
4105
- 240,
4106
- 230
4107
- ],
4108
- "magenta": [
4109
- 255,
4110
- 0,
4111
- 255
4112
- ],
4113
- "maroon": [
4114
- 128,
4115
- 0,
4116
- 0
4117
- ],
4118
- "mediumaquamarine": [
4119
- 102,
4120
- 205,
4121
- 170
4122
- ],
4123
- "mediumblue": [
4124
- 0,
4125
- 0,
4126
- 205
4127
- ],
4128
- "mediumorchid": [
4129
- 186,
4130
- 85,
4131
- 211
4132
- ],
4133
- "mediumpurple": [
4134
- 147,
4135
- 112,
4136
- 219
4137
- ],
4138
- "mediumseagreen": [
4139
- 60,
4140
- 179,
4141
- 113
4142
- ],
4143
- "mediumslateblue": [
4144
- 123,
4145
- 104,
4146
- 238
4147
- ],
4148
- "mediumspringgreen": [
4149
- 0,
4150
- 250,
4151
- 154
4152
- ],
4153
- "mediumturquoise": [
4154
- 72,
4155
- 209,
4156
- 204
4157
- ],
4158
- "mediumvioletred": [
4159
- 199,
4160
- 21,
4161
- 133
4162
- ],
4163
- "midnightblue": [
4164
- 25,
4165
- 25,
4166
- 112
4167
- ],
4168
- "mintcream": [
4169
- 245,
4170
- 255,
4171
- 250
4172
- ],
4173
- "mistyrose": [
4174
- 255,
4175
- 228,
4176
- 225
4177
- ],
4178
- "moccasin": [
4179
- 255,
4180
- 228,
4181
- 181
4182
- ],
4183
- "navajowhite": [
4184
- 255,
4185
- 222,
4186
- 173
4187
- ],
4188
- "navy": [
4189
- 0,
4190
- 0,
4191
- 128
4192
- ],
4193
- "oldlace": [
4194
- 253,
4195
- 245,
4196
- 230
4197
- ],
4198
- "olive": [
4199
- 128,
4200
- 128,
4201
- 0
4202
- ],
4203
- "olivedrab": [
4204
- 107,
4205
- 142,
4206
- 35
4207
- ],
4208
- "orange": [
4209
- 255,
4210
- 165,
4211
- 0
4212
- ],
4213
- "orangered": [
4214
- 255,
4215
- 69,
4216
- 0
4217
- ],
4218
- "orchid": [
4219
- 218,
4220
- 112,
4221
- 214
4222
- ],
4223
- "palegoldenrod": [
4224
- 238,
4225
- 232,
4226
- 170
4227
- ],
4228
- "palegreen": [
4229
- 152,
4230
- 251,
4231
- 152
4232
- ],
4233
- "paleturquoise": [
4234
- 175,
4235
- 238,
4236
- 238
4237
- ],
4238
- "palevioletred": [
4239
- 219,
4240
- 112,
4241
- 147
4242
- ],
4243
- "papayawhip": [
4244
- 255,
4245
- 239,
4246
- 213
4247
- ],
4248
- "peachpuff": [
4249
- 255,
4250
- 218,
4251
- 185
4252
- ],
4253
- "peru": [
4254
- 205,
4255
- 133,
4256
- 63
4257
- ],
4258
- "pink": [
4259
- 255,
4260
- 192,
4261
- 203
4262
- ],
4263
- "plum": [
4264
- 221,
4265
- 160,
4266
- 221
4267
- ],
4268
- "powderblue": [
4269
- 176,
4270
- 224,
4271
- 230
4272
- ],
4273
- "purple": [
4274
- 128,
4275
- 0,
4276
- 128
4277
- ],
4278
- "rebeccapurple": [
4279
- 102,
4280
- 51,
4281
- 153
4282
- ],
4283
- "red": [
4284
- 255,
4285
- 0,
4286
- 0
4287
- ],
4288
- "rosybrown": [
4289
- 188,
4290
- 143,
4291
- 143
4292
- ],
4293
- "royalblue": [
4294
- 65,
4295
- 105,
4296
- 225
4297
- ],
4298
- "saddlebrown": [
4299
- 139,
4300
- 69,
4301
- 19
4302
- ],
4303
- "salmon": [
4304
- 250,
4305
- 128,
4306
- 114
4307
- ],
4308
- "sandybrown": [
4309
- 244,
4310
- 164,
4311
- 96
4312
- ],
4313
- "seagreen": [
4314
- 46,
4315
- 139,
4316
- 87
4317
- ],
4318
- "seashell": [
4319
- 255,
4320
- 245,
4321
- 238
4322
- ],
4323
- "sienna": [
4324
- 160,
4325
- 82,
4326
- 45
4327
- ],
4328
- "silver": [
4329
- 192,
4330
- 192,
4331
- 192
4332
- ],
4333
- "skyblue": [
4334
- 135,
4335
- 206,
4336
- 235
4337
- ],
4338
- "slateblue": [
4339
- 106,
4340
- 90,
4341
- 205
4342
- ],
4343
- "slategray": [
4344
- 112,
4345
- 128,
4346
- 144
4347
- ],
4348
- "slategrey": [
4349
- 112,
4350
- 128,
4351
- 144
4352
- ],
4353
- "snow": [
4354
- 255,
4355
- 250,
4356
- 250
4357
- ],
4358
- "springgreen": [
4359
- 0,
4360
- 255,
4361
- 127
4362
- ],
4363
- "steelblue": [
4364
- 70,
4365
- 130,
4366
- 180
4367
- ],
4368
- "tan": [
4369
- 210,
4370
- 180,
4371
- 140
4372
- ],
4373
- "teal": [
4374
- 0,
4375
- 128,
4376
- 128
4377
- ],
4378
- "thistle": [
4379
- 216,
4380
- 191,
4381
- 216
4382
- ],
4383
- "tomato": [
4384
- 255,
4385
- 99,
4386
- 71
4387
- ],
4388
- "turquoise": [
4389
- 64,
4390
- 224,
4391
- 208
4392
- ],
4393
- "violet": [
4394
- 238,
4395
- 130,
4396
- 238
4397
- ],
4398
- "wheat": [
4399
- 245,
4400
- 222,
4401
- 179
4402
- ],
4403
- "white": [
4404
- 255,
4405
- 255,
4406
- 255
4407
- ],
4408
- "whitesmoke": [
4409
- 245,
4410
- 245,
4411
- 245
4412
- ],
4413
- "yellow": [
4414
- 255,
4415
- 255,
4416
- 0
4417
- ],
4418
- "yellowgreen": [
4419
- 154,
4420
- 205,
4421
- 50
4422
- ]
4423
- };
4424
- }));
4425
- var require_conversions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4426
- var cssKeywords = require_color_name();
4427
- var reverseKeywords = {};
4428
- for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
4429
- var convert = {
4430
- rgb: {
4431
- channels: 3,
4432
- labels: "rgb"
4433
- },
4434
- hsl: {
4435
- channels: 3,
4436
- labels: "hsl"
4437
- },
4438
- hsv: {
4439
- channels: 3,
4440
- labels: "hsv"
4441
- },
4442
- hwb: {
4443
- channels: 3,
4444
- labels: "hwb"
4445
- },
4446
- cmyk: {
4447
- channels: 4,
4448
- labels: "cmyk"
4449
- },
4450
- xyz: {
4451
- channels: 3,
4452
- labels: "xyz"
4453
- },
4454
- lab: {
4455
- channels: 3,
4456
- labels: "lab"
4457
- },
4458
- lch: {
4459
- channels: 3,
4460
- labels: "lch"
4461
- },
4462
- hex: {
4463
- channels: 1,
4464
- labels: ["hex"]
4465
- },
4466
- keyword: {
4467
- channels: 1,
4468
- labels: ["keyword"]
4469
- },
4470
- ansi16: {
4471
- channels: 1,
4472
- labels: ["ansi16"]
4473
- },
4474
- ansi256: {
4475
- channels: 1,
4476
- labels: ["ansi256"]
4477
- },
4478
- hcg: {
4479
- channels: 3,
4480
- labels: [
4481
- "h",
4482
- "c",
4483
- "g"
4484
- ]
4485
- },
4486
- apple: {
4487
- channels: 3,
4488
- labels: [
4489
- "r16",
4490
- "g16",
4491
- "b16"
4492
- ]
4493
- },
4494
- gray: {
4495
- channels: 1,
4496
- labels: ["gray"]
4497
- }
4498
- };
4499
- module.exports = convert;
4500
- for (const model of Object.keys(convert)) {
4501
- if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
4502
- if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
4503
- if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
4504
- const { channels, labels } = convert[model];
4505
- delete convert[model].channels;
4506
- delete convert[model].labels;
4507
- Object.defineProperty(convert[model], "channels", { value: channels });
4508
- Object.defineProperty(convert[model], "labels", { value: labels });
4509
- }
4510
- convert.rgb.hsl = function(rgb) {
4511
- const r = rgb[0] / 255;
4512
- const g = rgb[1] / 255;
4513
- const b = rgb[2] / 255;
4514
- const min = Math.min(r, g, b);
4515
- const max = Math.max(r, g, b);
4516
- const delta = max - min;
4517
- let h;
4518
- let s;
4519
- if (max === min) h = 0;
4520
- else if (r === max) h = (g - b) / delta;
4521
- else if (g === max) h = 2 + (b - r) / delta;
4522
- else if (b === max) h = 4 + (r - g) / delta;
4523
- h = Math.min(h * 60, 360);
4524
- if (h < 0) h += 360;
4525
- const l = (min + max) / 2;
4526
- if (max === min) s = 0;
4527
- else if (l <= .5) s = delta / (max + min);
4528
- else s = delta / (2 - max - min);
4529
- return [
4530
- h,
4531
- s * 100,
4532
- l * 100
4533
- ];
4534
- };
4535
- convert.rgb.hsv = function(rgb) {
4536
- let rdif;
4537
- let gdif;
4538
- let bdif;
4539
- let h;
4540
- let s;
4541
- const r = rgb[0] / 255;
4542
- const g = rgb[1] / 255;
4543
- const b = rgb[2] / 255;
4544
- const v = Math.max(r, g, b);
4545
- const diff = v - Math.min(r, g, b);
4546
- const diffc = function(c) {
4547
- return (v - c) / 6 / diff + 1 / 2;
4548
- };
4549
- if (diff === 0) {
4550
- h = 0;
4551
- s = 0;
4552
- } else {
4553
- s = diff / v;
4554
- rdif = diffc(r);
4555
- gdif = diffc(g);
4556
- bdif = diffc(b);
4557
- if (r === v) h = bdif - gdif;
4558
- else if (g === v) h = 1 / 3 + rdif - bdif;
4559
- else if (b === v) h = 2 / 3 + gdif - rdif;
4560
- if (h < 0) h += 1;
4561
- else if (h > 1) h -= 1;
4562
- }
4563
- return [
4564
- h * 360,
4565
- s * 100,
4566
- v * 100
4567
- ];
4568
- };
4569
- convert.rgb.hwb = function(rgb) {
4570
- const r = rgb[0];
4571
- const g = rgb[1];
4572
- let b = rgb[2];
4573
- const h = convert.rgb.hsl(rgb)[0];
4574
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
4575
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
4576
- return [
4577
- h,
4578
- w * 100,
4579
- b * 100
4580
- ];
4581
- };
4582
- convert.rgb.cmyk = function(rgb) {
4583
- const r = rgb[0] / 255;
4584
- const g = rgb[1] / 255;
4585
- const b = rgb[2] / 255;
4586
- const k = Math.min(1 - r, 1 - g, 1 - b);
4587
- const c = (1 - r - k) / (1 - k) || 0;
4588
- const m = (1 - g - k) / (1 - k) || 0;
4589
- const y = (1 - b - k) / (1 - k) || 0;
4590
- return [
4591
- c * 100,
4592
- m * 100,
4593
- y * 100,
4594
- k * 100
4595
- ];
4596
- };
4597
- function comparativeDistance(x, y) {
4598
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
4599
- }
4600
- convert.rgb.keyword = function(rgb) {
4601
- const reversed = reverseKeywords[rgb];
4602
- if (reversed) return reversed;
4603
- let currentClosestDistance = Infinity;
4604
- let currentClosestKeyword;
4605
- for (const keyword of Object.keys(cssKeywords)) {
4606
- const value = cssKeywords[keyword];
4607
- const distance = comparativeDistance(rgb, value);
4608
- if (distance < currentClosestDistance) {
4609
- currentClosestDistance = distance;
4610
- currentClosestKeyword = keyword;
4611
- }
4612
- }
4613
- return currentClosestKeyword;
4614
- };
4615
- convert.keyword.rgb = function(keyword) {
4616
- return cssKeywords[keyword];
4617
- };
4618
- convert.rgb.xyz = function(rgb) {
4619
- let r = rgb[0] / 255;
4620
- let g = rgb[1] / 255;
4621
- let b = rgb[2] / 255;
4622
- r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
4623
- g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
4624
- b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
4625
- const x = r * .4124 + g * .3576 + b * .1805;
4626
- const y = r * .2126 + g * .7152 + b * .0722;
4627
- const z = r * .0193 + g * .1192 + b * .9505;
4628
- return [
4629
- x * 100,
4630
- y * 100,
4631
- z * 100
4632
- ];
4633
- };
4634
- convert.rgb.lab = function(rgb) {
4635
- const xyz = convert.rgb.xyz(rgb);
4636
- let x = xyz[0];
4637
- let y = xyz[1];
4638
- let z = xyz[2];
4639
- x /= 95.047;
4640
- y /= 100;
4641
- z /= 108.883;
4642
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
4643
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
4644
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
4645
- return [
4646
- 116 * y - 16,
4647
- 500 * (x - y),
4648
- 200 * (y - z)
4649
- ];
4650
- };
4651
- convert.hsl.rgb = function(hsl) {
4652
- const h = hsl[0] / 360;
4653
- const s = hsl[1] / 100;
4654
- const l = hsl[2] / 100;
4655
- let t2;
4656
- let t3;
4657
- let val;
4658
- if (s === 0) {
4659
- val = l * 255;
4660
- return [
4661
- val,
4662
- val,
4663
- val
4664
- ];
4665
- }
4666
- if (l < .5) t2 = l * (1 + s);
4667
- else t2 = l + s - l * s;
4668
- const t1 = 2 * l - t2;
4669
- const rgb = [
4670
- 0,
4671
- 0,
4672
- 0
4673
- ];
4674
- for (let i = 0; i < 3; i++) {
4675
- t3 = h + 1 / 3 * -(i - 1);
4676
- if (t3 < 0) t3++;
4677
- if (t3 > 1) t3--;
4678
- if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
4679
- else if (2 * t3 < 1) val = t2;
4680
- else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
4681
- else val = t1;
4682
- rgb[i] = val * 255;
4683
- }
4684
- return rgb;
4685
- };
4686
- convert.hsl.hsv = function(hsl) {
4687
- const h = hsl[0];
4688
- let s = hsl[1] / 100;
4689
- let l = hsl[2] / 100;
4690
- let smin = s;
4691
- const lmin = Math.max(l, .01);
4692
- l *= 2;
4693
- s *= l <= 1 ? l : 2 - l;
4694
- smin *= lmin <= 1 ? lmin : 2 - lmin;
4695
- const v = (l + s) / 2;
4696
- return [
4697
- h,
4698
- (l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
4699
- v * 100
4700
- ];
4701
- };
4702
- convert.hsv.rgb = function(hsv) {
4703
- const h = hsv[0] / 60;
4704
- const s = hsv[1] / 100;
4705
- let v = hsv[2] / 100;
4706
- const hi = Math.floor(h) % 6;
4707
- const f = h - Math.floor(h);
4708
- const p = 255 * v * (1 - s);
4709
- const q = 255 * v * (1 - s * f);
4710
- const t = 255 * v * (1 - s * (1 - f));
4711
- v *= 255;
4712
- switch (hi) {
4713
- case 0: return [
4714
- v,
4715
- t,
4716
- p
4717
- ];
4718
- case 1: return [
4719
- q,
4720
- v,
4721
- p
4722
- ];
4723
- case 2: return [
4724
- p,
4725
- v,
4726
- t
4727
- ];
4728
- case 3: return [
4729
- p,
4730
- q,
4731
- v
4732
- ];
4733
- case 4: return [
4734
- t,
4735
- p,
4736
- v
4737
- ];
4738
- case 5: return [
4739
- v,
4740
- p,
4741
- q
4742
- ];
4743
- }
4744
- };
4745
- convert.hsv.hsl = function(hsv) {
4746
- const h = hsv[0];
4747
- const s = hsv[1] / 100;
4748
- const v = hsv[2] / 100;
4749
- const vmin = Math.max(v, .01);
4750
- let sl;
4751
- let l;
4752
- l = (2 - s) * v;
4753
- const lmin = (2 - s) * vmin;
4754
- sl = s * vmin;
4755
- sl /= lmin <= 1 ? lmin : 2 - lmin;
4756
- sl = sl || 0;
4757
- l /= 2;
4758
- return [
4759
- h,
4760
- sl * 100,
4761
- l * 100
4762
- ];
4763
- };
4764
- convert.hwb.rgb = function(hwb) {
4765
- const h = hwb[0] / 360;
4766
- let wh = hwb[1] / 100;
4767
- let bl = hwb[2] / 100;
4768
- const ratio = wh + bl;
4769
- let f;
4770
- if (ratio > 1) {
4771
- wh /= ratio;
4772
- bl /= ratio;
4773
- }
4774
- const i = Math.floor(6 * h);
4775
- const v = 1 - bl;
4776
- f = 6 * h - i;
4777
- if ((i & 1) !== 0) f = 1 - f;
4778
- const n = wh + f * (v - wh);
4779
- let r;
4780
- let g;
4781
- let b;
4782
- switch (i) {
4783
- default:
4784
- case 6:
4785
- case 0:
4786
- r = v;
4787
- g = n;
4788
- b = wh;
4789
- break;
4790
- case 1:
4791
- r = n;
4792
- g = v;
4793
- b = wh;
4794
- break;
4795
- case 2:
4796
- r = wh;
4797
- g = v;
4798
- b = n;
4799
- break;
4800
- case 3:
4801
- r = wh;
4802
- g = n;
4803
- b = v;
4804
- break;
4805
- case 4:
4806
- r = n;
4807
- g = wh;
4808
- b = v;
4809
- break;
4810
- case 5:
4811
- r = v;
4812
- g = wh;
4813
- b = n;
4814
- break;
4815
- }
4816
- return [
4817
- r * 255,
4818
- g * 255,
4819
- b * 255
4820
- ];
4821
- };
4822
- convert.cmyk.rgb = function(cmyk) {
4823
- const c = cmyk[0] / 100;
4824
- const m = cmyk[1] / 100;
4825
- const y = cmyk[2] / 100;
4826
- const k = cmyk[3] / 100;
4827
- const r = 1 - Math.min(1, c * (1 - k) + k);
4828
- const g = 1 - Math.min(1, m * (1 - k) + k);
4829
- const b = 1 - Math.min(1, y * (1 - k) + k);
4830
- return [
4831
- r * 255,
4832
- g * 255,
4833
- b * 255
4834
- ];
4835
- };
4836
- convert.xyz.rgb = function(xyz) {
4837
- const x = xyz[0] / 100;
4838
- const y = xyz[1] / 100;
4839
- const z = xyz[2] / 100;
4840
- let r;
4841
- let g;
4842
- let b;
4843
- r = x * 3.2406 + y * -1.5372 + z * -.4986;
4844
- g = x * -.9689 + y * 1.8758 + z * .0415;
4845
- b = x * .0557 + y * -.204 + z * 1.057;
4846
- r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
4847
- g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
4848
- b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
4849
- r = Math.min(Math.max(0, r), 1);
4850
- g = Math.min(Math.max(0, g), 1);
4851
- b = Math.min(Math.max(0, b), 1);
4852
- return [
4853
- r * 255,
4854
- g * 255,
4855
- b * 255
4856
- ];
4857
- };
4858
- convert.xyz.lab = function(xyz) {
4859
- let x = xyz[0];
4860
- let y = xyz[1];
4861
- let z = xyz[2];
4862
- x /= 95.047;
4863
- y /= 100;
4864
- z /= 108.883;
4865
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
4866
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
4867
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
4868
- return [
4869
- 116 * y - 16,
4870
- 500 * (x - y),
4871
- 200 * (y - z)
4872
- ];
4873
- };
4874
- convert.lab.xyz = function(lab) {
4875
- const l = lab[0];
4876
- const a = lab[1];
4877
- const b = lab[2];
4878
- let x;
4879
- let y;
4880
- let z;
4881
- y = (l + 16) / 116;
4882
- x = a / 500 + y;
4883
- z = y - b / 200;
4884
- const y2 = y ** 3;
4885
- const x2 = x ** 3;
4886
- const z2 = z ** 3;
4887
- y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
4888
- x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
4889
- z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
4890
- x *= 95.047;
4891
- y *= 100;
4892
- z *= 108.883;
4893
- return [
4894
- x,
4895
- y,
4896
- z
4897
- ];
4898
- };
4899
- convert.lab.lch = function(lab) {
4900
- const l = lab[0];
4901
- const a = lab[1];
4902
- const b = lab[2];
4903
- let h;
4904
- h = Math.atan2(b, a) * 360 / 2 / Math.PI;
4905
- if (h < 0) h += 360;
4906
- return [
4907
- l,
4908
- Math.sqrt(a * a + b * b),
4909
- h
4910
- ];
4911
- };
4912
- convert.lch.lab = function(lch) {
4913
- const l = lch[0];
4914
- const c = lch[1];
4915
- const hr = lch[2] / 360 * 2 * Math.PI;
4916
- return [
4917
- l,
4918
- c * Math.cos(hr),
4919
- c * Math.sin(hr)
4920
- ];
4921
- };
4922
- convert.rgb.ansi16 = function(args, saturation = null) {
4923
- const [r, g, b] = args;
4924
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
4925
- value = Math.round(value / 50);
4926
- if (value === 0) return 30;
4927
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
4928
- if (value === 2) ansi += 60;
4929
- return ansi;
4930
- };
4931
- convert.hsv.ansi16 = function(args) {
4932
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
4933
- };
4934
- convert.rgb.ansi256 = function(args) {
4935
- const r = args[0];
4936
- const g = args[1];
4937
- const b = args[2];
4938
- if (r === g && g === b) {
4939
- if (r < 8) return 16;
4940
- if (r > 248) return 231;
4941
- return Math.round((r - 8) / 247 * 24) + 232;
4942
- }
4943
- return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
4944
- };
4945
- convert.ansi16.rgb = function(args) {
4946
- let color = args % 10;
4947
- if (color === 0 || color === 7) {
4948
- if (args > 50) color += 3.5;
4949
- color = color / 10.5 * 255;
4950
- return [
4951
- color,
4952
- color,
4953
- color
4954
- ];
4955
- }
4956
- const mult = (~~(args > 50) + 1) * .5;
4957
- return [
4958
- (color & 1) * mult * 255,
4959
- (color >> 1 & 1) * mult * 255,
4960
- (color >> 2 & 1) * mult * 255
4961
- ];
4962
- };
4963
- convert.ansi256.rgb = function(args) {
4964
- if (args >= 232) {
4965
- const c = (args - 232) * 10 + 8;
4966
- return [
4967
- c,
4968
- c,
4969
- c
4970
- ];
4971
- }
4972
- args -= 16;
4973
- let rem;
4974
- return [
4975
- Math.floor(args / 36) / 5 * 255,
4976
- Math.floor((rem = args % 36) / 6) / 5 * 255,
4977
- rem % 6 / 5 * 255
4978
- ];
4979
- };
4980
- convert.rgb.hex = function(args) {
4981
- const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
4982
- return "000000".substring(string.length) + string;
4983
- };
4984
- convert.hex.rgb = function(args) {
4985
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
4986
- if (!match) return [
4987
- 0,
4988
- 0,
4989
- 0
4990
- ];
4991
- let colorString = match[0];
4992
- if (match[0].length === 3) colorString = colorString.split("").map((char) => {
4993
- return char + char;
4994
- }).join("");
4995
- const integer = parseInt(colorString, 16);
4996
- return [
4997
- integer >> 16 & 255,
4998
- integer >> 8 & 255,
4999
- integer & 255
5000
- ];
5001
- };
5002
- convert.rgb.hcg = function(rgb) {
5003
- const r = rgb[0] / 255;
5004
- const g = rgb[1] / 255;
5005
- const b = rgb[2] / 255;
5006
- const max = Math.max(Math.max(r, g), b);
5007
- const min = Math.min(Math.min(r, g), b);
5008
- const chroma = max - min;
5009
- let grayscale;
5010
- let hue;
5011
- if (chroma < 1) grayscale = min / (1 - chroma);
5012
- else grayscale = 0;
5013
- if (chroma <= 0) hue = 0;
5014
- else if (max === r) hue = (g - b) / chroma % 6;
5015
- else if (max === g) hue = 2 + (b - r) / chroma;
5016
- else hue = 4 + (r - g) / chroma;
5017
- hue /= 6;
5018
- hue %= 1;
5019
- return [
5020
- hue * 360,
5021
- chroma * 100,
5022
- grayscale * 100
5023
- ];
5024
- };
5025
- convert.hsl.hcg = function(hsl) {
5026
- const s = hsl[1] / 100;
5027
- const l = hsl[2] / 100;
5028
- const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
5029
- let f = 0;
5030
- if (c < 1) f = (l - .5 * c) / (1 - c);
5031
- return [
5032
- hsl[0],
5033
- c * 100,
5034
- f * 100
5035
- ];
5036
- };
5037
- convert.hsv.hcg = function(hsv) {
5038
- const s = hsv[1] / 100;
5039
- const v = hsv[2] / 100;
5040
- const c = s * v;
5041
- let f = 0;
5042
- if (c < 1) f = (v - c) / (1 - c);
5043
- return [
5044
- hsv[0],
5045
- c * 100,
5046
- f * 100
5047
- ];
5048
- };
5049
- convert.hcg.rgb = function(hcg) {
5050
- const h = hcg[0] / 360;
5051
- const c = hcg[1] / 100;
5052
- const g = hcg[2] / 100;
5053
- if (c === 0) return [
5054
- g * 255,
5055
- g * 255,
5056
- g * 255
5057
- ];
5058
- const pure = [
5059
- 0,
5060
- 0,
5061
- 0
5062
- ];
5063
- const hi = h % 1 * 6;
5064
- const v = hi % 1;
5065
- const w = 1 - v;
5066
- let mg = 0;
5067
- switch (Math.floor(hi)) {
5068
- case 0:
5069
- pure[0] = 1;
5070
- pure[1] = v;
5071
- pure[2] = 0;
5072
- break;
5073
- case 1:
5074
- pure[0] = w;
5075
- pure[1] = 1;
5076
- pure[2] = 0;
5077
- break;
5078
- case 2:
5079
- pure[0] = 0;
5080
- pure[1] = 1;
5081
- pure[2] = v;
5082
- break;
5083
- case 3:
5084
- pure[0] = 0;
5085
- pure[1] = w;
5086
- pure[2] = 1;
5087
- break;
5088
- case 4:
5089
- pure[0] = v;
5090
- pure[1] = 0;
5091
- pure[2] = 1;
5092
- break;
5093
- default:
5094
- pure[0] = 1;
5095
- pure[1] = 0;
5096
- pure[2] = w;
5097
- }
5098
- mg = (1 - c) * g;
5099
- return [
5100
- (c * pure[0] + mg) * 255,
5101
- (c * pure[1] + mg) * 255,
5102
- (c * pure[2] + mg) * 255
5103
- ];
5104
- };
5105
- convert.hcg.hsv = function(hcg) {
5106
- const c = hcg[1] / 100;
5107
- const v = c + hcg[2] / 100 * (1 - c);
5108
- let f = 0;
5109
- if (v > 0) f = c / v;
5110
- return [
5111
- hcg[0],
5112
- f * 100,
5113
- v * 100
5114
- ];
5115
- };
5116
- convert.hcg.hsl = function(hcg) {
5117
- const c = hcg[1] / 100;
5118
- const l = hcg[2] / 100 * (1 - c) + .5 * c;
5119
- let s = 0;
5120
- if (l > 0 && l < .5) s = c / (2 * l);
5121
- else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
5122
- return [
5123
- hcg[0],
5124
- s * 100,
5125
- l * 100
5126
- ];
5127
- };
5128
- convert.hcg.hwb = function(hcg) {
5129
- const c = hcg[1] / 100;
5130
- const v = c + hcg[2] / 100 * (1 - c);
5131
- return [
5132
- hcg[0],
5133
- (v - c) * 100,
5134
- (1 - v) * 100
5135
- ];
5136
- };
5137
- convert.hwb.hcg = function(hwb) {
5138
- const w = hwb[1] / 100;
5139
- const v = 1 - hwb[2] / 100;
5140
- const c = v - w;
5141
- let g = 0;
5142
- if (c < 1) g = (v - c) / (1 - c);
5143
- return [
5144
- hwb[0],
5145
- c * 100,
5146
- g * 100
5147
- ];
5148
- };
5149
- convert.apple.rgb = function(apple) {
5150
- return [
5151
- apple[0] / 65535 * 255,
5152
- apple[1] / 65535 * 255,
5153
- apple[2] / 65535 * 255
5154
- ];
5155
- };
5156
- convert.rgb.apple = function(rgb) {
5157
- return [
5158
- rgb[0] / 255 * 65535,
5159
- rgb[1] / 255 * 65535,
5160
- rgb[2] / 255 * 65535
5161
- ];
5162
- };
5163
- convert.gray.rgb = function(args) {
5164
- return [
5165
- args[0] / 100 * 255,
5166
- args[0] / 100 * 255,
5167
- args[0] / 100 * 255
5168
- ];
5169
- };
5170
- convert.gray.hsl = function(args) {
5171
- return [
5172
- 0,
5173
- 0,
5174
- args[0]
5175
- ];
5176
- };
5177
- convert.gray.hsv = convert.gray.hsl;
5178
- convert.gray.hwb = function(gray) {
5179
- return [
5180
- 0,
5181
- 100,
5182
- gray[0]
5183
- ];
5184
- };
5185
- convert.gray.cmyk = function(gray) {
5186
- return [
5187
- 0,
5188
- 0,
5189
- 0,
5190
- gray[0]
5191
- ];
5192
- };
5193
- convert.gray.lab = function(gray) {
5194
- return [
5195
- gray[0],
5196
- 0,
5197
- 0
5198
- ];
5199
- };
5200
- convert.gray.hex = function(gray) {
5201
- const val = Math.round(gray[0] / 100 * 255) & 255;
5202
- const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
5203
- return "000000".substring(string.length) + string;
5204
- };
5205
- convert.rgb.gray = function(rgb) {
5206
- return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
5207
- };
5208
- }));
5209
- var require_route = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5210
- var conversions = require_conversions();
5211
- function buildGraph() {
5212
- const graph = {};
5213
- const models = Object.keys(conversions);
5214
- for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
5215
- distance: -1,
5216
- parent: null
5217
- };
5218
- return graph;
5219
- }
5220
- function deriveBFS(fromModel) {
5221
- const graph = buildGraph();
5222
- const queue = [fromModel];
5223
- graph[fromModel].distance = 0;
5224
- while (queue.length) {
5225
- const current = queue.pop();
5226
- const adjacents = Object.keys(conversions[current]);
5227
- for (let len = adjacents.length, i = 0; i < len; i++) {
5228
- const adjacent = adjacents[i];
5229
- const node = graph[adjacent];
5230
- if (node.distance === -1) {
5231
- node.distance = graph[current].distance + 1;
5232
- node.parent = current;
5233
- queue.unshift(adjacent);
5234
- }
5235
- }
5236
- }
5237
- return graph;
5238
- }
5239
- function link(from, to) {
5240
- return function(args) {
5241
- return to(from(args));
5242
- };
5243
- }
5244
- function wrapConversion(toModel, graph) {
5245
- const path = [graph[toModel].parent, toModel];
5246
- let fn = conversions[graph[toModel].parent][toModel];
5247
- let cur = graph[toModel].parent;
5248
- while (graph[cur].parent) {
5249
- path.unshift(graph[cur].parent);
5250
- fn = link(conversions[graph[cur].parent][cur], fn);
5251
- cur = graph[cur].parent;
5252
- }
5253
- fn.conversion = path;
5254
- return fn;
1961
+ var ANSI_BACKGROUND_OFFSET = 10;
1962
+ var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
1963
+ var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
1964
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
1965
+ var styles$1 = {
1966
+ modifier: {
1967
+ reset: [0, 0],
1968
+ bold: [1, 22],
1969
+ dim: [2, 22],
1970
+ italic: [3, 23],
1971
+ underline: [4, 24],
1972
+ overline: [53, 55],
1973
+ inverse: [7, 27],
1974
+ hidden: [8, 28],
1975
+ strikethrough: [9, 29]
1976
+ },
1977
+ color: {
1978
+ black: [30, 39],
1979
+ red: [31, 39],
1980
+ green: [32, 39],
1981
+ yellow: [33, 39],
1982
+ blue: [34, 39],
1983
+ magenta: [35, 39],
1984
+ cyan: [36, 39],
1985
+ white: [37, 39],
1986
+ blackBright: [90, 39],
1987
+ gray: [90, 39],
1988
+ grey: [90, 39],
1989
+ redBright: [91, 39],
1990
+ greenBright: [92, 39],
1991
+ yellowBright: [93, 39],
1992
+ blueBright: [94, 39],
1993
+ magentaBright: [95, 39],
1994
+ cyanBright: [96, 39],
1995
+ whiteBright: [97, 39]
1996
+ },
1997
+ bgColor: {
1998
+ bgBlack: [40, 49],
1999
+ bgRed: [41, 49],
2000
+ bgGreen: [42, 49],
2001
+ bgYellow: [43, 49],
2002
+ bgBlue: [44, 49],
2003
+ bgMagenta: [45, 49],
2004
+ bgCyan: [46, 49],
2005
+ bgWhite: [47, 49],
2006
+ bgBlackBright: [100, 49],
2007
+ bgGray: [100, 49],
2008
+ bgGrey: [100, 49],
2009
+ bgRedBright: [101, 49],
2010
+ bgGreenBright: [102, 49],
2011
+ bgYellowBright: [103, 49],
2012
+ bgBlueBright: [104, 49],
2013
+ bgMagentaBright: [105, 49],
2014
+ bgCyanBright: [106, 49],
2015
+ bgWhiteBright: [107, 49]
5255
2016
  }
5256
- module.exports = function(fromModel) {
5257
- const graph = deriveBFS(fromModel);
5258
- const conversion = {};
5259
- const models = Object.keys(graph);
5260
- for (let len = models.length, i = 0; i < len; i++) {
5261
- const toModel = models[i];
5262
- if (graph[toModel].parent === null) continue;
5263
- conversion[toModel] = wrapConversion(toModel, graph);
2017
+ };
2018
+ Object.keys(styles$1.modifier);
2019
+ var foregroundColorNames = Object.keys(styles$1.color);
2020
+ var backgroundColorNames = Object.keys(styles$1.bgColor);
2021
+ [...foregroundColorNames, ...backgroundColorNames];
2022
+ function assembleStyles() {
2023
+ const codes = /* @__PURE__ */ new Map();
2024
+ for (const [groupName, group] of Object.entries(styles$1)) {
2025
+ for (const [styleName, style] of Object.entries(group)) {
2026
+ styles$1[styleName] = {
2027
+ open: `\u001B[${style[0]}m`,
2028
+ close: `\u001B[${style[1]}m`
2029
+ };
2030
+ group[styleName] = styles$1[styleName];
2031
+ codes.set(style[0], style[1]);
5264
2032
  }
5265
- return conversion;
5266
- };
5267
- }));
5268
- var require_color_convert = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5269
- var conversions = require_conversions();
5270
- var route = require_route();
5271
- var convert = {};
5272
- var models = Object.keys(conversions);
5273
- function wrapRaw(fn) {
5274
- const wrappedFn = function(...args) {
5275
- const arg0 = args[0];
5276
- if (arg0 === void 0 || arg0 === null) return arg0;
5277
- if (arg0.length > 1) args = arg0;
5278
- return fn(args);
5279
- };
5280
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
5281
- return wrappedFn;
5282
- }
5283
- function wrapRounded(fn) {
5284
- const wrappedFn = function(...args) {
5285
- const arg0 = args[0];
5286
- if (arg0 === void 0 || arg0 === null) return arg0;
5287
- if (arg0.length > 1) args = arg0;
5288
- const result = fn(args);
5289
- if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
5290
- return result;
5291
- };
5292
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
5293
- return wrappedFn;
5294
- }
5295
- models.forEach((fromModel) => {
5296
- convert[fromModel] = {};
5297
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
5298
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
5299
- const routes = route(fromModel);
5300
- Object.keys(routes).forEach((toModel) => {
5301
- const fn = routes[toModel];
5302
- convert[fromModel][toModel] = wrapRounded(fn);
5303
- convert[fromModel][toModel].raw = wrapRaw(fn);
2033
+ Object.defineProperty(styles$1, groupName, {
2034
+ value: group,
2035
+ enumerable: false
5304
2036
  });
2037
+ }
2038
+ Object.defineProperty(styles$1, "codes", {
2039
+ value: codes,
2040
+ enumerable: false
5305
2041
  });
5306
- module.exports = convert;
5307
- }));
5308
- var require_ansi_styles = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5309
- var wrapAnsi16 = (fn, offset) => (...args) => {
5310
- return `\u001B[${fn(...args) + offset}m`;
5311
- };
5312
- var wrapAnsi256 = (fn, offset) => (...args) => {
5313
- const code = fn(...args);
5314
- return `\u001B[${38 + offset};5;${code}m`;
5315
- };
5316
- var wrapAnsi16m = (fn, offset) => (...args) => {
5317
- const rgb = fn(...args);
5318
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
5319
- };
5320
- var ansi2ansi = (n) => n;
5321
- var rgb2rgb = (r, g, b) => [
5322
- r,
5323
- g,
5324
- b
5325
- ];
5326
- var setLazyProperty = (object, property, get) => {
5327
- Object.defineProperty(object, property, {
5328
- get: () => {
5329
- const value = get();
5330
- Object.defineProperty(object, property, {
5331
- value,
5332
- enumerable: true,
5333
- configurable: true
5334
- });
5335
- return value;
2042
+ styles$1.color.close = "\x1B[39m";
2043
+ styles$1.bgColor.close = "\x1B[49m";
2044
+ styles$1.color.ansi = wrapAnsi16();
2045
+ styles$1.color.ansi256 = wrapAnsi256();
2046
+ styles$1.color.ansi16m = wrapAnsi16m();
2047
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
2048
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
2049
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
2050
+ Object.defineProperties(styles$1, {
2051
+ rgbToAnsi256: {
2052
+ value(red, green, blue) {
2053
+ if (red === green && green === blue) {
2054
+ if (red < 8) return 16;
2055
+ if (red > 248) return 231;
2056
+ return Math.round((red - 8) / 247 * 24) + 232;
2057
+ }
2058
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
5336
2059
  },
5337
- enumerable: true,
5338
- configurable: true
5339
- });
5340
- };
5341
- /** @type {typeof import('color-convert')} */
5342
- var colorConvert;
5343
- var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
5344
- if (colorConvert === void 0) colorConvert = require_color_convert();
5345
- const offset = isBackground ? 10 : 0;
5346
- const styles = {};
5347
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
5348
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
5349
- if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
5350
- else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
5351
- }
5352
- return styles;
5353
- };
5354
- function assembleStyles() {
5355
- const codes = /* @__PURE__ */ new Map();
5356
- const styles = {
5357
- modifier: {
5358
- reset: [0, 0],
5359
- bold: [1, 22],
5360
- dim: [2, 22],
5361
- italic: [3, 23],
5362
- underline: [4, 24],
5363
- inverse: [7, 27],
5364
- hidden: [8, 28],
5365
- strikethrough: [9, 29]
2060
+ enumerable: false
2061
+ },
2062
+ hexToRgb: {
2063
+ value(hex) {
2064
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
2065
+ if (!matches) return [
2066
+ 0,
2067
+ 0,
2068
+ 0
2069
+ ];
2070
+ let [colorString] = matches;
2071
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
2072
+ const integer = Number.parseInt(colorString, 16);
2073
+ return [
2074
+ integer >> 16 & 255,
2075
+ integer >> 8 & 255,
2076
+ integer & 255
2077
+ ];
5366
2078
  },
5367
- color: {
5368
- black: [30, 39],
5369
- red: [31, 39],
5370
- green: [32, 39],
5371
- yellow: [33, 39],
5372
- blue: [34, 39],
5373
- magenta: [35, 39],
5374
- cyan: [36, 39],
5375
- white: [37, 39],
5376
- blackBright: [90, 39],
5377
- redBright: [91, 39],
5378
- greenBright: [92, 39],
5379
- yellowBright: [93, 39],
5380
- blueBright: [94, 39],
5381
- magentaBright: [95, 39],
5382
- cyanBright: [96, 39],
5383
- whiteBright: [97, 39]
2079
+ enumerable: false
2080
+ },
2081
+ hexToAnsi256: {
2082
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
2083
+ enumerable: false
2084
+ },
2085
+ ansi256ToAnsi: {
2086
+ value(code) {
2087
+ if (code < 8) return 30 + code;
2088
+ if (code < 16) return 90 + (code - 8);
2089
+ let red;
2090
+ let green;
2091
+ let blue;
2092
+ if (code >= 232) {
2093
+ red = ((code - 232) * 10 + 8) / 255;
2094
+ green = red;
2095
+ blue = red;
2096
+ } else {
2097
+ code -= 16;
2098
+ const remainder = code % 36;
2099
+ red = Math.floor(code / 36) / 5;
2100
+ green = Math.floor(remainder / 6) / 5;
2101
+ blue = remainder % 6 / 5;
2102
+ }
2103
+ const value = Math.max(red, green, blue) * 2;
2104
+ if (value === 0) return 30;
2105
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
2106
+ if (value === 2) result += 60;
2107
+ return result;
5384
2108
  },
5385
- bgColor: {
5386
- bgBlack: [40, 49],
5387
- bgRed: [41, 49],
5388
- bgGreen: [42, 49],
5389
- bgYellow: [43, 49],
5390
- bgBlue: [44, 49],
5391
- bgMagenta: [45, 49],
5392
- bgCyan: [46, 49],
5393
- bgWhite: [47, 49],
5394
- bgBlackBright: [100, 49],
5395
- bgRedBright: [101, 49],
5396
- bgGreenBright: [102, 49],
5397
- bgYellowBright: [103, 49],
5398
- bgBlueBright: [104, 49],
5399
- bgMagentaBright: [105, 49],
5400
- bgCyanBright: [106, 49],
5401
- bgWhiteBright: [107, 49]
5402
- }
5403
- };
5404
- styles.color.gray = styles.color.blackBright;
5405
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
5406
- styles.color.grey = styles.color.blackBright;
5407
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
5408
- for (const [groupName, group] of Object.entries(styles)) {
5409
- for (const [styleName, style] of Object.entries(group)) {
5410
- styles[styleName] = {
5411
- open: `\u001B[${style[0]}m`,
5412
- close: `\u001B[${style[1]}m`
5413
- };
5414
- group[styleName] = styles[styleName];
5415
- codes.set(style[0], style[1]);
5416
- }
5417
- Object.defineProperty(styles, groupName, {
5418
- value: group,
5419
- enumerable: false
5420
- });
5421
- }
5422
- Object.defineProperty(styles, "codes", {
5423
- value: codes,
5424
2109
  enumerable: false
5425
- });
5426
- styles.color.close = "\x1B[39m";
5427
- styles.bgColor.close = "\x1B[49m";
5428
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
5429
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
5430
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
5431
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
5432
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
5433
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
5434
- return styles;
5435
- }
5436
- Object.defineProperty(module, "exports", {
5437
- enumerable: true,
5438
- get: assembleStyles
5439
- });
5440
- }));
5441
- var require_browser = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5442
- module.exports = {
5443
- stdout: false,
5444
- stderr: false
5445
- };
5446
- }));
5447
- var require_util = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5448
- var stringReplaceAll = (string, substring, replacer) => {
5449
- let index = string.indexOf(substring);
5450
- if (index === -1) return string;
5451
- const substringLength = substring.length;
5452
- let endIndex = 0;
5453
- let returnValue = "";
5454
- do {
5455
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
5456
- endIndex = index + substringLength;
5457
- index = string.indexOf(substring, endIndex);
5458
- } while (index !== -1);
5459
- returnValue += string.substr(endIndex);
5460
- return returnValue;
5461
- };
5462
- var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
5463
- let endIndex = 0;
5464
- let returnValue = "";
5465
- do {
5466
- const gotCR = string[index - 1] === "\r";
5467
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
5468
- endIndex = index + 1;
5469
- index = string.indexOf("\n", endIndex);
5470
- } while (index !== -1);
5471
- returnValue += string.substr(endIndex);
5472
- return returnValue;
5473
- };
5474
- module.exports = {
5475
- stringReplaceAll,
5476
- stringEncaseCRLFWithFirstIndex
5477
- };
5478
- }));
5479
- var require_templates = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5480
- 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;
5481
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
5482
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
5483
- var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
5484
- var ESCAPES = new Map([
5485
- ["n", "\n"],
5486
- ["r", "\r"],
5487
- ["t", " "],
5488
- ["b", "\b"],
5489
- ["f", "\f"],
5490
- ["v", "\v"],
5491
- ["0", "\0"],
5492
- ["\\", "\\"],
5493
- ["e", "\x1B"],
5494
- ["a", "\x07"]
5495
- ]);
5496
- function unescape(c) {
5497
- const u = c[0] === "u";
5498
- const bracket = c[1] === "{";
5499
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
5500
- if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
5501
- return ESCAPES.get(c) || c;
5502
- }
5503
- function parseArguments(name, arguments_) {
5504
- const results = [];
5505
- const chunks = arguments_.trim().split(/\s*,\s*/g);
5506
- let matches;
5507
- for (const chunk of chunks) {
5508
- const number = Number(chunk);
5509
- if (!Number.isNaN(number)) results.push(number);
5510
- else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
5511
- else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
5512
- }
5513
- return results;
5514
- }
5515
- function parseStyle(style) {
5516
- STYLE_REGEX.lastIndex = 0;
5517
- const results = [];
5518
- let matches;
5519
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
5520
- const name = matches[1];
5521
- if (matches[2]) {
5522
- const args = parseArguments(name, matches[2]);
5523
- results.push([name].concat(args));
5524
- } else results.push([name]);
5525
- }
5526
- return results;
5527
- }
5528
- function buildStyle(chalk, styles) {
5529
- const enabled = {};
5530
- for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
5531
- let current = chalk;
5532
- for (const [styleName, styles] of Object.entries(enabled)) {
5533
- if (!Array.isArray(styles)) continue;
5534
- if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
5535
- current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
5536
- }
5537
- return current;
5538
- }
5539
- module.exports = (chalk, temporary) => {
5540
- const styles = [];
5541
- const chunks = [];
5542
- let chunk = [];
5543
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
5544
- if (escapeCharacter) chunk.push(unescape(escapeCharacter));
5545
- else if (style) {
5546
- const string = chunk.join("");
5547
- chunk = [];
5548
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
5549
- styles.push({
5550
- inverse,
5551
- styles: parseStyle(style)
5552
- });
5553
- } else if (close) {
5554
- if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
5555
- chunks.push(buildStyle(chalk, styles)(chunk.join("")));
5556
- chunk = [];
5557
- styles.pop();
5558
- } else chunk.push(character);
5559
- });
5560
- chunks.push(chunk.join(""));
5561
- if (styles.length > 0) {
5562
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
5563
- throw new Error(errMessage);
5564
- }
5565
- return chunks.join("");
5566
- };
5567
- }));
5568
- (/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
5569
- var ansiStyles = require_ansi_styles();
5570
- var { stdout: stdoutColor, stderr: stderrColor } = require_browser();
5571
- var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
5572
- var { isArray } = Array;
5573
- var levelMapping = [
5574
- "ansi",
5575
- "ansi",
5576
- "ansi256",
5577
- "ansi16m"
5578
- ];
5579
- var styles = Object.create(null);
5580
- var applyOptions = (object, options = {}) => {
5581
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
5582
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
5583
- object.level = options.level === void 0 ? colorLevel : options.level;
5584
- };
5585
- var ChalkClass = class {
5586
- constructor(options) {
5587
- return chalkFactory(options);
2110
+ },
2111
+ rgbToAnsi: {
2112
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
2113
+ enumerable: false
2114
+ },
2115
+ hexToAnsi: {
2116
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
2117
+ enumerable: false
5588
2118
  }
5589
- };
5590
- var chalkFactory = (options) => {
5591
- const chalk = {};
5592
- applyOptions(chalk, options);
5593
- chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
5594
- Object.setPrototypeOf(chalk, Chalk.prototype);
5595
- Object.setPrototypeOf(chalk.template, chalk);
5596
- chalk.template.constructor = () => {
5597
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
2119
+ });
2120
+ return styles$1;
2121
+ }
2122
+ var ansiStyles = assembleStyles();
2123
+ var level = (() => {
2124
+ if (!("navigator" in globalThis)) return 0;
2125
+ if (globalThis.navigator.userAgentData) {
2126
+ const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
2127
+ if (brand && brand.version > 93) return 3;
2128
+ }
2129
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
2130
+ return 0;
2131
+ })();
2132
+ var colorSupport = level !== 0 && {
2133
+ level,
2134
+ hasBasic: true,
2135
+ has256: level >= 2,
2136
+ has16m: level >= 3
2137
+ };
2138
+ var supportsColor = {
2139
+ stdout: colorSupport,
2140
+ stderr: colorSupport
2141
+ };
2142
+ function stringReplaceAll(string, substring, replacer) {
2143
+ let index = string.indexOf(substring);
2144
+ if (index === -1) return string;
2145
+ const substringLength = substring.length;
2146
+ let endIndex = 0;
2147
+ let returnValue = "";
2148
+ do {
2149
+ returnValue += string.slice(endIndex, index) + substring + replacer;
2150
+ endIndex = index + substringLength;
2151
+ index = string.indexOf(substring, endIndex);
2152
+ } while (index !== -1);
2153
+ returnValue += string.slice(endIndex);
2154
+ return returnValue;
2155
+ }
2156
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
2157
+ let endIndex = 0;
2158
+ let returnValue = "";
2159
+ do {
2160
+ const gotCR = string[index - 1] === "\r";
2161
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
2162
+ endIndex = index + 1;
2163
+ index = string.indexOf("\n", endIndex);
2164
+ } while (index !== -1);
2165
+ returnValue += string.slice(endIndex);
2166
+ return returnValue;
2167
+ }
2168
+ var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
2169
+ var GENERATOR = Symbol("GENERATOR");
2170
+ var STYLER = Symbol("STYLER");
2171
+ var IS_EMPTY = Symbol("IS_EMPTY");
2172
+ var levelMapping = [
2173
+ "ansi",
2174
+ "ansi",
2175
+ "ansi256",
2176
+ "ansi16m"
2177
+ ];
2178
+ var styles = Object.create(null);
2179
+ var applyOptions = (object, options = {}) => {
2180
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
2181
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
2182
+ object.level = options.level === void 0 ? colorLevel : options.level;
2183
+ };
2184
+ var chalkFactory = (options) => {
2185
+ const chalk = (...strings) => strings.join(" ");
2186
+ applyOptions(chalk, options);
2187
+ Object.setPrototypeOf(chalk, createChalk.prototype);
2188
+ return chalk;
2189
+ };
2190
+ function createChalk(options) {
2191
+ return chalkFactory(options);
2192
+ }
2193
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
2194
+ for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
2195
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
2196
+ Object.defineProperty(this, styleName, { value: builder });
2197
+ return builder;
2198
+ } };
2199
+ styles.visible = { get() {
2200
+ const builder = createBuilder(this, this[STYLER], true);
2201
+ Object.defineProperty(this, "visible", { value: builder });
2202
+ return builder;
2203
+ } };
2204
+ var getModelAnsi = (model, level, type, ...arguments_) => {
2205
+ if (model === "rgb") {
2206
+ if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
2207
+ if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
2208
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
2209
+ }
2210
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
2211
+ return ansiStyles[type][model](...arguments_);
2212
+ };
2213
+ for (const model of [
2214
+ "rgb",
2215
+ "hex",
2216
+ "ansi256"
2217
+ ]) {
2218
+ styles[model] = { get() {
2219
+ const { level } = this;
2220
+ return function(...arguments_) {
2221
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
2222
+ return createBuilder(this, styler, this[IS_EMPTY]);
5598
2223
  };
5599
- chalk.template.Instance = ChalkClass;
5600
- return chalk.template;
5601
- };
5602
- function Chalk(options) {
5603
- return chalkFactory(options);
5604
- }
5605
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
5606
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
5607
- Object.defineProperty(this, styleName, { value: builder });
5608
- return builder;
5609
- } };
5610
- styles.visible = { get() {
5611
- const builder = createBuilder(this, this._styler, true);
5612
- Object.defineProperty(this, "visible", { value: builder });
5613
- return builder;
5614
2224
  } };
5615
- var usedModels = [
5616
- "rgb",
5617
- "hex",
5618
- "keyword",
5619
- "hsl",
5620
- "hsv",
5621
- "hwb",
5622
- "ansi",
5623
- "ansi256"
5624
- ];
5625
- for (const model of usedModels) styles[model] = { get() {
2225
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
2226
+ styles[bgModel] = { get() {
5626
2227
  const { level } = this;
5627
2228
  return function(...arguments_) {
5628
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
5629
- return createBuilder(this, styler, this._isEmpty);
2229
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
2230
+ return createBuilder(this, styler, this[IS_EMPTY]);
5630
2231
  };
5631
2232
  } };
5632
- for (const model of usedModels) {
5633
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
5634
- styles[bgModel] = { get() {
5635
- const { level } = this;
5636
- return function(...arguments_) {
5637
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
5638
- return createBuilder(this, styler, this._isEmpty);
5639
- };
5640
- } };
5641
- }
5642
- var proto = Object.defineProperties(() => {}, {
5643
- ...styles,
5644
- level: {
5645
- enumerable: true,
5646
- get() {
5647
- return this._generator.level;
5648
- },
5649
- set(level) {
5650
- this._generator.level = level;
5651
- }
5652
- }
5653
- });
5654
- var createStyler = (open, close, parent) => {
5655
- let openAll;
5656
- let closeAll;
5657
- if (parent === void 0) {
5658
- openAll = open;
5659
- closeAll = close;
5660
- } else {
5661
- openAll = parent.openAll + open;
5662
- closeAll = close + parent.closeAll;
5663
- }
5664
- return {
5665
- open,
5666
- close,
5667
- openAll,
5668
- closeAll,
5669
- parent
5670
- };
5671
- };
5672
- var createBuilder = (self, _styler, _isEmpty) => {
5673
- const builder = (...arguments_) => {
5674
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
5675
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
5676
- };
5677
- Object.setPrototypeOf(builder, proto);
5678
- builder._generator = self;
5679
- builder._styler = _styler;
5680
- builder._isEmpty = _isEmpty;
5681
- return builder;
5682
- };
5683
- var applyStyle = (self, string) => {
5684
- if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
5685
- let styler = self._styler;
5686
- if (styler === void 0) return string;
5687
- const { openAll, closeAll } = styler;
5688
- if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
5689
- string = stringReplaceAll(string, styler.close, styler.open);
5690
- styler = styler.parent;
2233
+ }
2234
+ var proto = Object.defineProperties(() => {}, {
2235
+ ...styles,
2236
+ level: {
2237
+ enumerable: true,
2238
+ get() {
2239
+ return this[GENERATOR].level;
2240
+ },
2241
+ set(level) {
2242
+ this[GENERATOR].level = level;
5691
2243
  }
5692
- const lfIndex = string.indexOf("\n");
5693
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
5694
- return openAll + string + closeAll;
5695
- };
5696
- var template;
5697
- var chalkTag = (chalk, ...strings) => {
5698
- const [firstString] = strings;
5699
- if (!isArray(firstString) || !isArray(firstString.raw)) return strings.join(" ");
5700
- const arguments_ = strings.slice(1);
5701
- const parts = [firstString.raw[0]];
5702
- for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
5703
- if (template === void 0) template = require_templates();
5704
- return template(chalk, parts.join(""));
2244
+ }
2245
+ });
2246
+ var createStyler = (open, close, parent) => {
2247
+ let openAll;
2248
+ let closeAll;
2249
+ if (parent === void 0) {
2250
+ openAll = open;
2251
+ closeAll = close;
2252
+ } else {
2253
+ openAll = parent.openAll + open;
2254
+ closeAll = close + parent.closeAll;
2255
+ }
2256
+ return {
2257
+ open,
2258
+ close,
2259
+ openAll,
2260
+ closeAll,
2261
+ parent
5705
2262
  };
5706
- Object.defineProperties(Chalk.prototype, styles);
5707
- var chalk = Chalk();
5708
- chalk.supportsColor = stdoutColor;
5709
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
5710
- chalk.stderr.supportsColor = stderrColor;
5711
- module.exports = chalk;
5712
- })))();
2263
+ };
2264
+ var createBuilder = (self, _styler, _isEmpty) => {
2265
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
2266
+ Object.setPrototypeOf(builder, proto);
2267
+ builder[GENERATOR] = self;
2268
+ builder[STYLER] = _styler;
2269
+ builder[IS_EMPTY] = _isEmpty;
2270
+ return builder;
2271
+ };
2272
+ var applyStyle = (self, string) => {
2273
+ if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
2274
+ let styler = self[STYLER];
2275
+ if (styler === void 0) return string;
2276
+ const { openAll, closeAll } = styler;
2277
+ if (string.includes("\x1B")) while (styler !== void 0) {
2278
+ string = stringReplaceAll(string, styler.close, styler.open);
2279
+ styler = styler.parent;
2280
+ }
2281
+ const lfIndex = string.indexOf("\n");
2282
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
2283
+ return openAll + string + closeAll;
2284
+ };
2285
+ Object.defineProperties(createChalk.prototype, styles);
2286
+ createChalk();
2287
+ createChalk({ level: stderrColor ? stderrColor.level : 0 });
5713
2288
  var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
5714
2289
  var Gauge$1 = /* @__PURE__ */ function(Gauge) {
5715
2290
  Gauge["ACTIVE_REQUEST_GAUGE"] = "a";
@@ -6559,10 +3134,10 @@ var STSOAuth2Manager = class {
6559
3134
  else throw new Error(`STSOAuth2Manager:constructor: Cannot init STSOAuth2Manager - this.#options.workerFactory not specified`);
6560
3135
  if (!import_browser.default) {
6561
3136
  this.#worker.onmessage = (data) => {
6562
- this.#LogInfoMessage(import_source.default.green(`this.#worker.onmessage = [${data}]`));
3137
+ this.#LogInfoMessage(chalk$1.green(`this.#worker.onmessage = [${data}]`));
6563
3138
  };
6564
3139
  this.#worker.onerror = (error) => {
6565
- this.#LogInfoMessage(import_source.default.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
3140
+ this.#LogInfoMessage(chalk$1.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
6566
3141
  };
6567
3142
  }
6568
3143
  let workerMessage;
@@ -6602,7 +3177,7 @@ var STSOAuth2Manager = class {
6602
3177
  }
6603
3178
  #ProcessMessageResponse = (data) => {
6604
3179
  const messageResponse = data;
6605
- this.#LogDebugMessage(import_source.default.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
3180
+ this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
6606
3181
  if (messageResponse.messageId === -1) switch (messageResponse.command) {
6607
3182
  case IOauth2ListenerCommand.AUTHENTICATE_EVENT:
6608
3183
  this.#HandleAuthenticateEvent(messageResponse.payload);
@@ -6634,10 +3209,10 @@ var STSOAuth2Manager = class {
6634
3209
  this.#messageHandlers[message.messageId] = (response) => {
6635
3210
  clearTimeout(timeout);
6636
3211
  delete this.#messageHandlers[message.messageId];
6637
- this.#LogDebugMessage(import_source.default.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
3212
+ this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
6638
3213
  resolve(response);
6639
3214
  };
6640
- this.#LogDebugMessage(import_source.default.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
3215
+ this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
6641
3216
  this.#oauth2ManagerPort.postMessage(message);
6642
3217
  });
6643
3218
  };
@@ -6666,10 +3241,10 @@ var STSOAuth2Manager = class {
6666
3241
  }
6667
3242
  };
6668
3243
  #SetupRoute = (app, router) => {
6669
- this.#LogDebugMessage(import_source.default.gray(`STSOAuth2Manager:#SetupRoute`));
3244
+ this.#LogDebugMessage(chalk$1.gray(`STSOAuth2Manager:#SetupRoute`));
6670
3245
  router.beforeEach(async (to, from, next) => {
6671
3246
  const oAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey];
6672
- this.#LogDebugMessage(import_source.default.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
3247
+ this.#LogDebugMessage(chalk$1.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
6673
3248
  if (this.#GetStore().LoggedIn === false) {
6674
3249
  this.#LogInfoMessage(`Not logged in`);
6675
3250
  if (to.path.localeCompare(`${this.#options.uriBase}authorize`) === 0) {
@@ -6700,9 +3275,9 @@ var STSOAuth2Manager = class {
6700
3275
  }
6701
3276
  const str = to.query;
6702
3277
  if (str[OAuth2ParameterType.CODE] || str[OAuth2ParameterType.ERROR]) {
6703
- this.#LogDebugMessage(import_source.default.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
3278
+ this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
6704
3279
  const retVal = await oAuth2Manager.HandleRedirect(str);
6705
- this.#LogDebugMessage(import_source.default.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
3280
+ this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
6706
3281
  if (retVal) {
6707
3282
  next({
6708
3283
  path: `${this.#options.uriBase}`,
@@ -6753,7 +3328,7 @@ var STSOAuth2Manager = class {
6753
3328
  if (this.#operationSemaphore === true) {
6754
3329
  if (retryCount > this.#maxSemaphoreRetries) throw new Error(`STSOAuth2Manager:ExecuteRefreshToken:maxSemaphoreRetries: [${this.#maxSemaphoreRetries}] exceeded.`);
6755
3330
  await Sleep(this.#semaphoreRetrySleep);
6756
- this.#LogDebugMessage(import_source.default.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
3331
+ this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
6757
3332
  return await this.ExecuteRefreshToken(retryCount + 1);
6758
3333
  } else {
6759
3334
  this.#operationSemaphore = true;
@@ -6772,7 +3347,7 @@ var STSOAuth2Manager = class {
6772
3347
  this.#LogDebugMessage(`STSOAuth2Manager:RestoreSession:response: [${JSON.stringify(response.payload)}]`);
6773
3348
  return response.payload;
6774
3349
  } catch (error) {
6775
- this.#LogErrorMessage(import_source.default.red(`RestoreSession Error: ${error}`));
3350
+ this.#LogErrorMessage(chalk$1.red(`RestoreSession Error: ${error}`));
6776
3351
  return false;
6777
3352
  }
6778
3353
  };
@@ -6784,18 +3359,18 @@ var STSOAuth2Manager = class {
6784
3359
  if (!import_browser.default) window.location.replace(url);
6785
3360
  else return response.payload.authorizeOptionsClientCopy;
6786
3361
  } catch (error) {
6787
- this.#LogErrorMessage(import_source.default.red(`Authorize Error: ${error}`));
3362
+ this.#LogErrorMessage(chalk$1.red(`Authorize Error: ${error}`));
6788
3363
  }
6789
3364
  return {};
6790
3365
  };
6791
3366
  HandleRedirect = async (queryVars) => {
6792
3367
  try {
6793
- this.#LogDebugMessage(import_source.default.magenta(`STSOAuth2Manager:HandleRedirect`));
3368
+ this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect`));
6794
3369
  let response = null;
6795
3370
  if (queryVars[OAuth2ParameterType.CODE]) {
6796
3371
  const authorizeOptions = this.#transactionStore.get(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
6797
3372
  this.#transactionStore.remove(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
6798
- this.#LogDebugMessage(import_source.default.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
3373
+ this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
6799
3374
  response = await this.#PostMessage({
6800
3375
  command: IOauth2ListenerCommand.HANDLE_REDIRECT,
6801
3376
  payload: {
@@ -6807,10 +3382,10 @@ var STSOAuth2Manager = class {
6807
3382
  command: IOauth2ListenerCommand.HANDLE_REDIRECT,
6808
3383
  payload: queryVars
6809
3384
  });
6810
- this.#LogDebugMessage(import_source.default.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
3385
+ this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
6811
3386
  return response.payload;
6812
3387
  } catch (error) {
6813
- this.#LogErrorMessage(import_source.default.red(`HandleRedirect Error: ${error}`));
3388
+ this.#LogErrorMessage(chalk$1.red(`HandleRedirect Error: ${error}`));
6814
3389
  return false;
6815
3390
  }
6816
3391
  };
@@ -6818,7 +3393,7 @@ var STSOAuth2Manager = class {
6818
3393
  try {
6819
3394
  return (await this.#PostMessage({ command: IOauth2ListenerCommand.LOGOUT })).payload;
6820
3395
  } catch (error) {
6821
- this.#LogErrorMessage(import_source.default.red(`Logout Error: ${error}`));
3396
+ this.#LogErrorMessage(chalk$1.red(`Logout Error: ${error}`));
6822
3397
  return false;
6823
3398
  }
6824
3399
  };
@@ -6826,7 +3401,7 @@ var STSOAuth2Manager = class {
6826
3401
  try {
6827
3402
  return (await this.#PostMessage({ command: IOauth2ListenerCommand.LOGOUT })).payload;
6828
3403
  } catch (error) {
6829
- this.#LogErrorMessage(import_source.default.red(`InvokeExternalAPI Error: ${error}`));
3404
+ this.#LogErrorMessage(chalk$1.red(`InvokeExternalAPI Error: ${error}`));
6830
3405
  return null;
6831
3406
  }
6832
3407
  };
@@ -6840,7 +3415,7 @@ var STSOAuth2Manager = class {
6840
3415
  };
6841
3416
  //#endregion
6842
3417
  //#region node_modules/crypto-js/core.js
6843
- var require_core = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
3418
+ var require_core = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
6844
3419
  (function(root, factory) {
6845
3420
  if (typeof exports === "object") module.exports = exports = factory();
6846
3421
  else if (typeof define === "function" && define.amd) define([], factory);
@@ -7110,7 +3685,7 @@ var require_core = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
7110
3685
  }));
7111
3686
  //#endregion
7112
3687
  //#region node_modules/crypto-js/sha256.js
7113
- var require_sha256 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
3688
+ var require_sha256 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
7114
3689
  (function(root, factory) {
7115
3690
  if (typeof exports === "object") module.exports = exports = factory(require_core());
7116
3691
  else if (typeof define === "function" && define.amd) define(["./core"], factory);
@@ -7249,7 +3824,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
7249
3824
  }));
7250
3825
  //#endregion
7251
3826
  //#region node_modules/crypto-js/enc-base64.js
7252
- var require_enc_base64 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
3827
+ var require_enc_base64 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
7253
3828
  (function(root, factory) {
7254
3829
  if (typeof exports === "object") module.exports = exports = factory(require_core());
7255
3830
  else if (typeof define === "function" && define.amd) define(["./core"], factory);
@@ -7310,8 +3885,8 @@ var require_enc_base64 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
7310
3885
  }));
7311
3886
  //#endregion
7312
3887
  //#region src/Utils/CryptoUtils.ts
7313
- var import_sha256 = /* @__PURE__ */ __toESM$2(require_sha256(), 1);
7314
- var import_enc_base64 = /* @__PURE__ */ __toESM$2(require_enc_base64(), 1);
3888
+ var import_sha256 = /* @__PURE__ */ __toESM$1(require_sha256(), 1);
3889
+ var import_enc_base64 = /* @__PURE__ */ __toESM$1(require_enc_base64(), 1);
7315
3890
  var CryptoUtils = class {
7316
3891
  #crypto;
7317
3892
  constructor() {
@@ -7867,7 +4442,7 @@ var STSOAuth2Worker = class {
7867
4442
  [OAuth2ParameterType.REDIRECT_URI]: this.#options.redirect_uri,
7868
4443
  [OAuth2ParameterType.AUDIENCE]: this.#options.audience
7869
4444
  }).withDefaultHeaders().withCredentials().withTimeout(this.#options.timeout);
7870
- this.#LogDebugMessage(import_source.default.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
4445
+ this.#LogDebugMessage(chalk$1.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
7871
4446
  if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
7872
4447
  const retVal = await axios(rConfig.config);
7873
4448
  if (retVal.data.status === StatusCodes.OK) {
@@ -7935,46 +4510,46 @@ var STSOAuth2Worker = class {
7935
4510
  #HandleRedirect = async (payload) => {
7936
4511
  const queryVars = payload.queryVars;
7937
4512
  const authorizeOptions = payload.authorizeOptions;
7938
- this.#LogDebugMessage(import_source.default.magenta(`#HandleRedirect: HandleRedirect`));
7939
- this.#LogDebugMessage(import_source.default.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
4513
+ this.#LogDebugMessage(chalk$1.magenta(`#HandleRedirect: HandleRedirect`));
4514
+ this.#LogDebugMessage(chalk$1.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
7940
4515
  if (queryVars[OAuth2ParameterType.CODE]) {
7941
4516
  const response = queryVars;
7942
4517
  this.#LogInfoMessage(`authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
7943
4518
  const redirectState = response.state;
7944
4519
  const authorizeOptionsState = authorizeOptions.state;
7945
4520
  if (authorizeOptionsState.localeCompare(redirectState) === 0) {
7946
- this.#LogInfoMessage(import_source.default.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
4521
+ this.#LogInfoMessage(chalk$1.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
7947
4522
  return await this.#GetToken(authorizeOptions, response);
7948
4523
  } else {
7949
- this.#LogErrorMessage(import_source.default.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
7950
- this.#LogErrorMessage(import_source.default.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
7951
- this.#LogErrorMessage(import_source.default.red(`redirectState: [${redirectState}]`));
4524
+ this.#LogErrorMessage(chalk$1.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
4525
+ this.#LogErrorMessage(chalk$1.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
4526
+ this.#LogErrorMessage(chalk$1.red(`redirectState: [${redirectState}]`));
7952
4527
  this.#HandleErrorEvent({ message: "State un-matched" });
7953
4528
  return false;
7954
4529
  }
7955
4530
  } else if (queryVars[OAuth2ParameterType.ERROR]) {
7956
- this.#LogErrorMessage(import_source.default.red(`State un-matched (1)`));
4531
+ this.#LogErrorMessage(chalk$1.red(`State un-matched (1)`));
7957
4532
  this.#HandleErrorEvent({ message: "State un-matched" });
7958
4533
  return false;
7959
4534
  } else {
7960
- this.#LogErrorMessage(import_source.default.red(`State un-matched (2)`));
4535
+ this.#LogErrorMessage(chalk$1.red(`State un-matched (2)`));
7961
4536
  this.#HandleErrorEvent({ message: "State un-matched" });
7962
4537
  return false;
7963
4538
  }
7964
4539
  };
7965
4540
  #GetTokenFromBroker = async (authorizationCodeFlowParameters) => {
7966
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker`));
4541
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker`));
7967
4542
  this.#clientSessionStore.remove(this.#STORAGE_SESSION_KEY);
7968
4543
  const url = `${this.#options.brokerendpoint}:${this.#options.brokerport}${this.#options.brokerapiroot}/token`;
7969
4544
  try {
7970
4545
  const rConfig = new STSAxiosConfig(url, "post").withDefaultHeaders().withData(authorizationCodeFlowParameters).withCredentials().withTimeout(this.#options.timeout);
7971
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
4546
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
7972
4547
  if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
7973
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: axios API call`));
4548
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: axios API call`));
7974
4549
  const retVal = await axios(rConfig.config);
7975
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
4550
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
7976
4551
  if (retVal.status === StatusCodes.OK) {
7977
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: storing tokens`));
4552
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: storing tokens`));
7978
4553
  const tokenResponse = retVal.data;
7979
4554
  this.#HandleAuthenticateEvent(tokenResponse.id_token);
7980
4555
  const newSessionData = { tokenResponse };
@@ -7982,18 +4557,18 @@ var STSOAuth2Worker = class {
7982
4557
  this.#clientSessionStore.set(this.#STORAGE_SESSION_KEY, newSessionData);
7983
4558
  return true;
7984
4559
  } else if (retVal.status === StatusCodes.UNAUTHORIZED) {
7985
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
4560
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
7986
4561
  this.#HandleAuthenticateEvent(null);
7987
4562
  return false;
7988
4563
  } else {
7989
- this.#LogDebugMessage(import_source.default.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
4564
+ this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
7990
4565
  this.#HandleAuthenticateEvent(null);
7991
- this.#LogErrorMessage(import_source.default.red("Could not obtain access_token from token end-point:-"));
7992
- this.#LogErrorMessage(import_source.default.red(JSON.stringify(retVal.data)));
4566
+ this.#LogErrorMessage(chalk$1.red("Could not obtain access_token from token end-point:-"));
4567
+ this.#LogErrorMessage(chalk$1.red(JSON.stringify(retVal.data)));
7993
4568
  return false;
7994
4569
  }
7995
4570
  } catch (error) {
7996
- this.#LogErrorMessage(import_source.default.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
4571
+ this.#LogErrorMessage(chalk$1.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
7997
4572
  this.#HandleAuthenticateEvent(null);
7998
4573
  return false;
7999
4574
  }
@@ -8013,10 +4588,10 @@ var STSOAuth2Worker = class {
8013
4588
  return await this.#GetTokenFromBroker(authorizationCodeFlowParameters);
8014
4589
  };
8015
4590
  #RefreshToken = async () => {
8016
- this.#LogDebugMessage(import_source.default.cyan(`STSOAuth2Worker:#RefreshToken:start`));
4591
+ this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:start`));
8017
4592
  const sessionData = this.#clientSessionStore.get(this.#STORAGE_SESSION_KEY);
8018
4593
  if (sessionData) {
8019
- this.#LogDebugMessage(import_source.default.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
4594
+ this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
8020
4595
  const currentSessionData = sessionData.tokenResponse;
8021
4596
  const refreshFlowParameters = {
8022
4597
  client_id: this.#options.client_id,
@@ -8026,7 +4601,7 @@ var STSOAuth2Worker = class {
8026
4601
  };
8027
4602
  return await this.#GetTokenFromBroker(refreshFlowParameters);
8028
4603
  } else {
8029
- this.#LogErrorMessage(import_source.default.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
4604
+ this.#LogErrorMessage(chalk$1.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
8030
4605
  return false;
8031
4606
  }
8032
4607
  };
@@ -8047,18 +4622,18 @@ var STSOAuth2Worker = class {
8047
4622
  try {
8048
4623
  const rConfig = new STSAxiosConfig(url, "post").withData({ sessionId }).withDefaultHeaders().withCredentials().withTimeout(this.#options.timeout);
8049
4624
  if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
8050
- this.#LogDebugMessage(import_source.default.magenta(`#Logout: request config: [${rConfig}]`));
4625
+ this.#LogDebugMessage(chalk$1.magenta(`#Logout: request config: [${rConfig}]`));
8051
4626
  const retVal = await axios(rConfig.config);
8052
4627
  if (retVal.data.status === StatusCodes.OK) return true;
8053
4628
  else {
8054
- this.#LogErrorMessage(import_source.default.red("Error during logout (1: server side)"));
8055
- this.#LogErrorMessage(import_source.default.red(JSON.stringify(retVal.data)));
4629
+ this.#LogErrorMessage(chalk$1.red("Error during logout (1: server side)"));
4630
+ this.#LogErrorMessage(chalk$1.red(JSON.stringify(retVal.data)));
8056
4631
  return false;
8057
4632
  }
8058
4633
  } catch (error) {
8059
- this.#LogErrorMessage(import_source.default.red("Error during logout (2: server side)"));
8060
- this.#LogErrorMessage(import_source.default.red(error));
8061
- this.#LogErrorMessage(import_source.default.red(JSON.stringify(error)));
4634
+ this.#LogErrorMessage(chalk$1.red("Error during logout (2: server side)"));
4635
+ this.#LogErrorMessage(chalk$1.red(error));
4636
+ this.#LogErrorMessage(chalk$1.red(JSON.stringify(error)));
8062
4637
  return false;
8063
4638
  }
8064
4639
  } else {