@cloudnux/cloud-sdk 0.4.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -25
- package/dist/index.js +1863 -499
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,1615 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __esm = (fn, res) => function __init() {
|
|
14
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
|
+
};
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
+
mod
|
|
34
|
+
));
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/tsup/assets/esm_shims.js
|
|
37
|
+
import path from "path";
|
|
38
|
+
import { fileURLToPath } from "url";
|
|
39
|
+
var init_esm_shims = __esm({
|
|
40
|
+
"../../node_modules/tsup/assets/esm_shims.js"() {
|
|
41
|
+
"use strict";
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/color-name/index.js
|
|
46
|
+
var require_color_name = __commonJS({
|
|
47
|
+
"../../node_modules/color-name/index.js"(exports, module) {
|
|
48
|
+
"use strict";
|
|
49
|
+
init_esm_shims();
|
|
50
|
+
module.exports = {
|
|
51
|
+
"aliceblue": [240, 248, 255],
|
|
52
|
+
"antiquewhite": [250, 235, 215],
|
|
53
|
+
"aqua": [0, 255, 255],
|
|
54
|
+
"aquamarine": [127, 255, 212],
|
|
55
|
+
"azure": [240, 255, 255],
|
|
56
|
+
"beige": [245, 245, 220],
|
|
57
|
+
"bisque": [255, 228, 196],
|
|
58
|
+
"black": [0, 0, 0],
|
|
59
|
+
"blanchedalmond": [255, 235, 205],
|
|
60
|
+
"blue": [0, 0, 255],
|
|
61
|
+
"blueviolet": [138, 43, 226],
|
|
62
|
+
"brown": [165, 42, 42],
|
|
63
|
+
"burlywood": [222, 184, 135],
|
|
64
|
+
"cadetblue": [95, 158, 160],
|
|
65
|
+
"chartreuse": [127, 255, 0],
|
|
66
|
+
"chocolate": [210, 105, 30],
|
|
67
|
+
"coral": [255, 127, 80],
|
|
68
|
+
"cornflowerblue": [100, 149, 237],
|
|
69
|
+
"cornsilk": [255, 248, 220],
|
|
70
|
+
"crimson": [220, 20, 60],
|
|
71
|
+
"cyan": [0, 255, 255],
|
|
72
|
+
"darkblue": [0, 0, 139],
|
|
73
|
+
"darkcyan": [0, 139, 139],
|
|
74
|
+
"darkgoldenrod": [184, 134, 11],
|
|
75
|
+
"darkgray": [169, 169, 169],
|
|
76
|
+
"darkgreen": [0, 100, 0],
|
|
77
|
+
"darkgrey": [169, 169, 169],
|
|
78
|
+
"darkkhaki": [189, 183, 107],
|
|
79
|
+
"darkmagenta": [139, 0, 139],
|
|
80
|
+
"darkolivegreen": [85, 107, 47],
|
|
81
|
+
"darkorange": [255, 140, 0],
|
|
82
|
+
"darkorchid": [153, 50, 204],
|
|
83
|
+
"darkred": [139, 0, 0],
|
|
84
|
+
"darksalmon": [233, 150, 122],
|
|
85
|
+
"darkseagreen": [143, 188, 143],
|
|
86
|
+
"darkslateblue": [72, 61, 139],
|
|
87
|
+
"darkslategray": [47, 79, 79],
|
|
88
|
+
"darkslategrey": [47, 79, 79],
|
|
89
|
+
"darkturquoise": [0, 206, 209],
|
|
90
|
+
"darkviolet": [148, 0, 211],
|
|
91
|
+
"deeppink": [255, 20, 147],
|
|
92
|
+
"deepskyblue": [0, 191, 255],
|
|
93
|
+
"dimgray": [105, 105, 105],
|
|
94
|
+
"dimgrey": [105, 105, 105],
|
|
95
|
+
"dodgerblue": [30, 144, 255],
|
|
96
|
+
"firebrick": [178, 34, 34],
|
|
97
|
+
"floralwhite": [255, 250, 240],
|
|
98
|
+
"forestgreen": [34, 139, 34],
|
|
99
|
+
"fuchsia": [255, 0, 255],
|
|
100
|
+
"gainsboro": [220, 220, 220],
|
|
101
|
+
"ghostwhite": [248, 248, 255],
|
|
102
|
+
"gold": [255, 215, 0],
|
|
103
|
+
"goldenrod": [218, 165, 32],
|
|
104
|
+
"gray": [128, 128, 128],
|
|
105
|
+
"green": [0, 128, 0],
|
|
106
|
+
"greenyellow": [173, 255, 47],
|
|
107
|
+
"grey": [128, 128, 128],
|
|
108
|
+
"honeydew": [240, 255, 240],
|
|
109
|
+
"hotpink": [255, 105, 180],
|
|
110
|
+
"indianred": [205, 92, 92],
|
|
111
|
+
"indigo": [75, 0, 130],
|
|
112
|
+
"ivory": [255, 255, 240],
|
|
113
|
+
"khaki": [240, 230, 140],
|
|
114
|
+
"lavender": [230, 230, 250],
|
|
115
|
+
"lavenderblush": [255, 240, 245],
|
|
116
|
+
"lawngreen": [124, 252, 0],
|
|
117
|
+
"lemonchiffon": [255, 250, 205],
|
|
118
|
+
"lightblue": [173, 216, 230],
|
|
119
|
+
"lightcoral": [240, 128, 128],
|
|
120
|
+
"lightcyan": [224, 255, 255],
|
|
121
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
122
|
+
"lightgray": [211, 211, 211],
|
|
123
|
+
"lightgreen": [144, 238, 144],
|
|
124
|
+
"lightgrey": [211, 211, 211],
|
|
125
|
+
"lightpink": [255, 182, 193],
|
|
126
|
+
"lightsalmon": [255, 160, 122],
|
|
127
|
+
"lightseagreen": [32, 178, 170],
|
|
128
|
+
"lightskyblue": [135, 206, 250],
|
|
129
|
+
"lightslategray": [119, 136, 153],
|
|
130
|
+
"lightslategrey": [119, 136, 153],
|
|
131
|
+
"lightsteelblue": [176, 196, 222],
|
|
132
|
+
"lightyellow": [255, 255, 224],
|
|
133
|
+
"lime": [0, 255, 0],
|
|
134
|
+
"limegreen": [50, 205, 50],
|
|
135
|
+
"linen": [250, 240, 230],
|
|
136
|
+
"magenta": [255, 0, 255],
|
|
137
|
+
"maroon": [128, 0, 0],
|
|
138
|
+
"mediumaquamarine": [102, 205, 170],
|
|
139
|
+
"mediumblue": [0, 0, 205],
|
|
140
|
+
"mediumorchid": [186, 85, 211],
|
|
141
|
+
"mediumpurple": [147, 112, 219],
|
|
142
|
+
"mediumseagreen": [60, 179, 113],
|
|
143
|
+
"mediumslateblue": [123, 104, 238],
|
|
144
|
+
"mediumspringgreen": [0, 250, 154],
|
|
145
|
+
"mediumturquoise": [72, 209, 204],
|
|
146
|
+
"mediumvioletred": [199, 21, 133],
|
|
147
|
+
"midnightblue": [25, 25, 112],
|
|
148
|
+
"mintcream": [245, 255, 250],
|
|
149
|
+
"mistyrose": [255, 228, 225],
|
|
150
|
+
"moccasin": [255, 228, 181],
|
|
151
|
+
"navajowhite": [255, 222, 173],
|
|
152
|
+
"navy": [0, 0, 128],
|
|
153
|
+
"oldlace": [253, 245, 230],
|
|
154
|
+
"olive": [128, 128, 0],
|
|
155
|
+
"olivedrab": [107, 142, 35],
|
|
156
|
+
"orange": [255, 165, 0],
|
|
157
|
+
"orangered": [255, 69, 0],
|
|
158
|
+
"orchid": [218, 112, 214],
|
|
159
|
+
"palegoldenrod": [238, 232, 170],
|
|
160
|
+
"palegreen": [152, 251, 152],
|
|
161
|
+
"paleturquoise": [175, 238, 238],
|
|
162
|
+
"palevioletred": [219, 112, 147],
|
|
163
|
+
"papayawhip": [255, 239, 213],
|
|
164
|
+
"peachpuff": [255, 218, 185],
|
|
165
|
+
"peru": [205, 133, 63],
|
|
166
|
+
"pink": [255, 192, 203],
|
|
167
|
+
"plum": [221, 160, 221],
|
|
168
|
+
"powderblue": [176, 224, 230],
|
|
169
|
+
"purple": [128, 0, 128],
|
|
170
|
+
"rebeccapurple": [102, 51, 153],
|
|
171
|
+
"red": [255, 0, 0],
|
|
172
|
+
"rosybrown": [188, 143, 143],
|
|
173
|
+
"royalblue": [65, 105, 225],
|
|
174
|
+
"saddlebrown": [139, 69, 19],
|
|
175
|
+
"salmon": [250, 128, 114],
|
|
176
|
+
"sandybrown": [244, 164, 96],
|
|
177
|
+
"seagreen": [46, 139, 87],
|
|
178
|
+
"seashell": [255, 245, 238],
|
|
179
|
+
"sienna": [160, 82, 45],
|
|
180
|
+
"silver": [192, 192, 192],
|
|
181
|
+
"skyblue": [135, 206, 235],
|
|
182
|
+
"slateblue": [106, 90, 205],
|
|
183
|
+
"slategray": [112, 128, 144],
|
|
184
|
+
"slategrey": [112, 128, 144],
|
|
185
|
+
"snow": [255, 250, 250],
|
|
186
|
+
"springgreen": [0, 255, 127],
|
|
187
|
+
"steelblue": [70, 130, 180],
|
|
188
|
+
"tan": [210, 180, 140],
|
|
189
|
+
"teal": [0, 128, 128],
|
|
190
|
+
"thistle": [216, 191, 216],
|
|
191
|
+
"tomato": [255, 99, 71],
|
|
192
|
+
"turquoise": [64, 224, 208],
|
|
193
|
+
"violet": [238, 130, 238],
|
|
194
|
+
"wheat": [245, 222, 179],
|
|
195
|
+
"white": [255, 255, 255],
|
|
196
|
+
"whitesmoke": [245, 245, 245],
|
|
197
|
+
"yellow": [255, 255, 0],
|
|
198
|
+
"yellowgreen": [154, 205, 50]
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// ../../node_modules/color-convert/conversions.js
|
|
204
|
+
var require_conversions = __commonJS({
|
|
205
|
+
"../../node_modules/color-convert/conversions.js"(exports, module) {
|
|
206
|
+
"use strict";
|
|
207
|
+
init_esm_shims();
|
|
208
|
+
var cssKeywords = require_color_name();
|
|
209
|
+
var reverseKeywords = {};
|
|
210
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
211
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
212
|
+
}
|
|
213
|
+
var convert = {
|
|
214
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
215
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
216
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
217
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
218
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
219
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
220
|
+
lab: { channels: 3, labels: "lab" },
|
|
221
|
+
lch: { channels: 3, labels: "lch" },
|
|
222
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
223
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
224
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
225
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
226
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
227
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
228
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
229
|
+
};
|
|
230
|
+
module.exports = convert;
|
|
231
|
+
for (const model of Object.keys(convert)) {
|
|
232
|
+
if (!("channels" in convert[model])) {
|
|
233
|
+
throw new Error("missing channels property: " + model);
|
|
234
|
+
}
|
|
235
|
+
if (!("labels" in convert[model])) {
|
|
236
|
+
throw new Error("missing channel labels property: " + model);
|
|
237
|
+
}
|
|
238
|
+
if (convert[model].labels.length !== convert[model].channels) {
|
|
239
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
240
|
+
}
|
|
241
|
+
const { channels, labels } = convert[model];
|
|
242
|
+
delete convert[model].channels;
|
|
243
|
+
delete convert[model].labels;
|
|
244
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
245
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
246
|
+
}
|
|
247
|
+
convert.rgb.hsl = function(rgb) {
|
|
248
|
+
const r = rgb[0] / 255;
|
|
249
|
+
const g = rgb[1] / 255;
|
|
250
|
+
const b = rgb[2] / 255;
|
|
251
|
+
const min = Math.min(r, g, b);
|
|
252
|
+
const max = Math.max(r, g, b);
|
|
253
|
+
const delta = max - min;
|
|
254
|
+
let h;
|
|
255
|
+
let s;
|
|
256
|
+
if (max === min) {
|
|
257
|
+
h = 0;
|
|
258
|
+
} else if (r === max) {
|
|
259
|
+
h = (g - b) / delta;
|
|
260
|
+
} else if (g === max) {
|
|
261
|
+
h = 2 + (b - r) / delta;
|
|
262
|
+
} else if (b === max) {
|
|
263
|
+
h = 4 + (r - g) / delta;
|
|
264
|
+
}
|
|
265
|
+
h = Math.min(h * 60, 360);
|
|
266
|
+
if (h < 0) {
|
|
267
|
+
h += 360;
|
|
268
|
+
}
|
|
269
|
+
const l = (min + max) / 2;
|
|
270
|
+
if (max === min) {
|
|
271
|
+
s = 0;
|
|
272
|
+
} else if (l <= 0.5) {
|
|
273
|
+
s = delta / (max + min);
|
|
274
|
+
} else {
|
|
275
|
+
s = delta / (2 - max - min);
|
|
276
|
+
}
|
|
277
|
+
return [h, s * 100, l * 100];
|
|
278
|
+
};
|
|
279
|
+
convert.rgb.hsv = function(rgb) {
|
|
280
|
+
let rdif;
|
|
281
|
+
let gdif;
|
|
282
|
+
let bdif;
|
|
283
|
+
let h;
|
|
284
|
+
let s;
|
|
285
|
+
const r = rgb[0] / 255;
|
|
286
|
+
const g = rgb[1] / 255;
|
|
287
|
+
const b = rgb[2] / 255;
|
|
288
|
+
const v = Math.max(r, g, b);
|
|
289
|
+
const diff = v - Math.min(r, g, b);
|
|
290
|
+
const diffc = function(c) {
|
|
291
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
292
|
+
};
|
|
293
|
+
if (diff === 0) {
|
|
294
|
+
h = 0;
|
|
295
|
+
s = 0;
|
|
296
|
+
} else {
|
|
297
|
+
s = diff / v;
|
|
298
|
+
rdif = diffc(r);
|
|
299
|
+
gdif = diffc(g);
|
|
300
|
+
bdif = diffc(b);
|
|
301
|
+
if (r === v) {
|
|
302
|
+
h = bdif - gdif;
|
|
303
|
+
} else if (g === v) {
|
|
304
|
+
h = 1 / 3 + rdif - bdif;
|
|
305
|
+
} else if (b === v) {
|
|
306
|
+
h = 2 / 3 + gdif - rdif;
|
|
307
|
+
}
|
|
308
|
+
if (h < 0) {
|
|
309
|
+
h += 1;
|
|
310
|
+
} else if (h > 1) {
|
|
311
|
+
h -= 1;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return [
|
|
315
|
+
h * 360,
|
|
316
|
+
s * 100,
|
|
317
|
+
v * 100
|
|
318
|
+
];
|
|
319
|
+
};
|
|
320
|
+
convert.rgb.hwb = function(rgb) {
|
|
321
|
+
const r = rgb[0];
|
|
322
|
+
const g = rgb[1];
|
|
323
|
+
let b = rgb[2];
|
|
324
|
+
const h = convert.rgb.hsl(rgb)[0];
|
|
325
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
326
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
327
|
+
return [h, w * 100, b * 100];
|
|
328
|
+
};
|
|
329
|
+
convert.rgb.cmyk = function(rgb) {
|
|
330
|
+
const r = rgb[0] / 255;
|
|
331
|
+
const g = rgb[1] / 255;
|
|
332
|
+
const b = rgb[2] / 255;
|
|
333
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
334
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
335
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
336
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
337
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
338
|
+
};
|
|
339
|
+
function comparativeDistance(x, y) {
|
|
340
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
341
|
+
}
|
|
342
|
+
convert.rgb.keyword = function(rgb) {
|
|
343
|
+
const reversed = reverseKeywords[rgb];
|
|
344
|
+
if (reversed) {
|
|
345
|
+
return reversed;
|
|
346
|
+
}
|
|
347
|
+
let currentClosestDistance = Infinity;
|
|
348
|
+
let currentClosestKeyword;
|
|
349
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
350
|
+
const value = cssKeywords[keyword];
|
|
351
|
+
const distance = comparativeDistance(rgb, value);
|
|
352
|
+
if (distance < currentClosestDistance) {
|
|
353
|
+
currentClosestDistance = distance;
|
|
354
|
+
currentClosestKeyword = keyword;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return currentClosestKeyword;
|
|
358
|
+
};
|
|
359
|
+
convert.keyword.rgb = function(keyword) {
|
|
360
|
+
return cssKeywords[keyword];
|
|
361
|
+
};
|
|
362
|
+
convert.rgb.xyz = function(rgb) {
|
|
363
|
+
let r = rgb[0] / 255;
|
|
364
|
+
let g = rgb[1] / 255;
|
|
365
|
+
let b = rgb[2] / 255;
|
|
366
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
367
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
368
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
369
|
+
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
370
|
+
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
371
|
+
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
372
|
+
return [x * 100, y * 100, z * 100];
|
|
373
|
+
};
|
|
374
|
+
convert.rgb.lab = function(rgb) {
|
|
375
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
376
|
+
let x = xyz[0];
|
|
377
|
+
let y = xyz[1];
|
|
378
|
+
let z = xyz[2];
|
|
379
|
+
x /= 95.047;
|
|
380
|
+
y /= 100;
|
|
381
|
+
z /= 108.883;
|
|
382
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
383
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
384
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
385
|
+
const l = 116 * y - 16;
|
|
386
|
+
const a = 500 * (x - y);
|
|
387
|
+
const b = 200 * (y - z);
|
|
388
|
+
return [l, a, b];
|
|
389
|
+
};
|
|
390
|
+
convert.hsl.rgb = function(hsl) {
|
|
391
|
+
const h = hsl[0] / 360;
|
|
392
|
+
const s = hsl[1] / 100;
|
|
393
|
+
const l = hsl[2] / 100;
|
|
394
|
+
let t2;
|
|
395
|
+
let t3;
|
|
396
|
+
let val;
|
|
397
|
+
if (s === 0) {
|
|
398
|
+
val = l * 255;
|
|
399
|
+
return [val, val, val];
|
|
400
|
+
}
|
|
401
|
+
if (l < 0.5) {
|
|
402
|
+
t2 = l * (1 + s);
|
|
403
|
+
} else {
|
|
404
|
+
t2 = l + s - l * s;
|
|
405
|
+
}
|
|
406
|
+
const t1 = 2 * l - t2;
|
|
407
|
+
const rgb = [0, 0, 0];
|
|
408
|
+
for (let i = 0; i < 3; i++) {
|
|
409
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
410
|
+
if (t3 < 0) {
|
|
411
|
+
t3++;
|
|
412
|
+
}
|
|
413
|
+
if (t3 > 1) {
|
|
414
|
+
t3--;
|
|
415
|
+
}
|
|
416
|
+
if (6 * t3 < 1) {
|
|
417
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
418
|
+
} else if (2 * t3 < 1) {
|
|
419
|
+
val = t2;
|
|
420
|
+
} else if (3 * t3 < 2) {
|
|
421
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
422
|
+
} else {
|
|
423
|
+
val = t1;
|
|
424
|
+
}
|
|
425
|
+
rgb[i] = val * 255;
|
|
426
|
+
}
|
|
427
|
+
return rgb;
|
|
428
|
+
};
|
|
429
|
+
convert.hsl.hsv = function(hsl) {
|
|
430
|
+
const h = hsl[0];
|
|
431
|
+
let s = hsl[1] / 100;
|
|
432
|
+
let l = hsl[2] / 100;
|
|
433
|
+
let smin = s;
|
|
434
|
+
const lmin = Math.max(l, 0.01);
|
|
435
|
+
l *= 2;
|
|
436
|
+
s *= l <= 1 ? l : 2 - l;
|
|
437
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
438
|
+
const v = (l + s) / 2;
|
|
439
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
440
|
+
return [h, sv * 100, v * 100];
|
|
441
|
+
};
|
|
442
|
+
convert.hsv.rgb = function(hsv) {
|
|
443
|
+
const h = hsv[0] / 60;
|
|
444
|
+
const s = hsv[1] / 100;
|
|
445
|
+
let v = hsv[2] / 100;
|
|
446
|
+
const hi = Math.floor(h) % 6;
|
|
447
|
+
const f = h - Math.floor(h);
|
|
448
|
+
const p = 255 * v * (1 - s);
|
|
449
|
+
const q = 255 * v * (1 - s * f);
|
|
450
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
451
|
+
v *= 255;
|
|
452
|
+
switch (hi) {
|
|
453
|
+
case 0:
|
|
454
|
+
return [v, t, p];
|
|
455
|
+
case 1:
|
|
456
|
+
return [q, v, p];
|
|
457
|
+
case 2:
|
|
458
|
+
return [p, v, t];
|
|
459
|
+
case 3:
|
|
460
|
+
return [p, q, v];
|
|
461
|
+
case 4:
|
|
462
|
+
return [t, p, v];
|
|
463
|
+
case 5:
|
|
464
|
+
return [v, p, q];
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
convert.hsv.hsl = function(hsv) {
|
|
468
|
+
const h = hsv[0];
|
|
469
|
+
const s = hsv[1] / 100;
|
|
470
|
+
const v = hsv[2] / 100;
|
|
471
|
+
const vmin = Math.max(v, 0.01);
|
|
472
|
+
let sl;
|
|
473
|
+
let l;
|
|
474
|
+
l = (2 - s) * v;
|
|
475
|
+
const lmin = (2 - s) * vmin;
|
|
476
|
+
sl = s * vmin;
|
|
477
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
478
|
+
sl = sl || 0;
|
|
479
|
+
l /= 2;
|
|
480
|
+
return [h, sl * 100, l * 100];
|
|
481
|
+
};
|
|
482
|
+
convert.hwb.rgb = function(hwb) {
|
|
483
|
+
const h = hwb[0] / 360;
|
|
484
|
+
let wh = hwb[1] / 100;
|
|
485
|
+
let bl = hwb[2] / 100;
|
|
486
|
+
const ratio = wh + bl;
|
|
487
|
+
let f;
|
|
488
|
+
if (ratio > 1) {
|
|
489
|
+
wh /= ratio;
|
|
490
|
+
bl /= ratio;
|
|
491
|
+
}
|
|
492
|
+
const i = Math.floor(6 * h);
|
|
493
|
+
const v = 1 - bl;
|
|
494
|
+
f = 6 * h - i;
|
|
495
|
+
if ((i & 1) !== 0) {
|
|
496
|
+
f = 1 - f;
|
|
497
|
+
}
|
|
498
|
+
const n = wh + f * (v - wh);
|
|
499
|
+
let r;
|
|
500
|
+
let g;
|
|
501
|
+
let b;
|
|
502
|
+
switch (i) {
|
|
503
|
+
default:
|
|
504
|
+
case 6:
|
|
505
|
+
case 0:
|
|
506
|
+
r = v;
|
|
507
|
+
g = n;
|
|
508
|
+
b = wh;
|
|
509
|
+
break;
|
|
510
|
+
case 1:
|
|
511
|
+
r = n;
|
|
512
|
+
g = v;
|
|
513
|
+
b = wh;
|
|
514
|
+
break;
|
|
515
|
+
case 2:
|
|
516
|
+
r = wh;
|
|
517
|
+
g = v;
|
|
518
|
+
b = n;
|
|
519
|
+
break;
|
|
520
|
+
case 3:
|
|
521
|
+
r = wh;
|
|
522
|
+
g = n;
|
|
523
|
+
b = v;
|
|
524
|
+
break;
|
|
525
|
+
case 4:
|
|
526
|
+
r = n;
|
|
527
|
+
g = wh;
|
|
528
|
+
b = v;
|
|
529
|
+
break;
|
|
530
|
+
case 5:
|
|
531
|
+
r = v;
|
|
532
|
+
g = wh;
|
|
533
|
+
b = n;
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
return [r * 255, g * 255, b * 255];
|
|
537
|
+
};
|
|
538
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
539
|
+
const c = cmyk[0] / 100;
|
|
540
|
+
const m = cmyk[1] / 100;
|
|
541
|
+
const y = cmyk[2] / 100;
|
|
542
|
+
const k = cmyk[3] / 100;
|
|
543
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
544
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
545
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
546
|
+
return [r * 255, g * 255, b * 255];
|
|
547
|
+
};
|
|
548
|
+
convert.xyz.rgb = function(xyz) {
|
|
549
|
+
const x = xyz[0] / 100;
|
|
550
|
+
const y = xyz[1] / 100;
|
|
551
|
+
const z = xyz[2] / 100;
|
|
552
|
+
let r;
|
|
553
|
+
let g;
|
|
554
|
+
let b;
|
|
555
|
+
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
556
|
+
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
557
|
+
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
558
|
+
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
559
|
+
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
560
|
+
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
561
|
+
r = Math.min(Math.max(0, r), 1);
|
|
562
|
+
g = Math.min(Math.max(0, g), 1);
|
|
563
|
+
b = Math.min(Math.max(0, b), 1);
|
|
564
|
+
return [r * 255, g * 255, b * 255];
|
|
565
|
+
};
|
|
566
|
+
convert.xyz.lab = function(xyz) {
|
|
567
|
+
let x = xyz[0];
|
|
568
|
+
let y = xyz[1];
|
|
569
|
+
let z = xyz[2];
|
|
570
|
+
x /= 95.047;
|
|
571
|
+
y /= 100;
|
|
572
|
+
z /= 108.883;
|
|
573
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
574
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
575
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
576
|
+
const l = 116 * y - 16;
|
|
577
|
+
const a = 500 * (x - y);
|
|
578
|
+
const b = 200 * (y - z);
|
|
579
|
+
return [l, a, b];
|
|
580
|
+
};
|
|
581
|
+
convert.lab.xyz = function(lab) {
|
|
582
|
+
const l = lab[0];
|
|
583
|
+
const a = lab[1];
|
|
584
|
+
const b = lab[2];
|
|
585
|
+
let x;
|
|
586
|
+
let y;
|
|
587
|
+
let z;
|
|
588
|
+
y = (l + 16) / 116;
|
|
589
|
+
x = a / 500 + y;
|
|
590
|
+
z = y - b / 200;
|
|
591
|
+
const y2 = y ** 3;
|
|
592
|
+
const x2 = x ** 3;
|
|
593
|
+
const z2 = z ** 3;
|
|
594
|
+
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
595
|
+
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
596
|
+
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
597
|
+
x *= 95.047;
|
|
598
|
+
y *= 100;
|
|
599
|
+
z *= 108.883;
|
|
600
|
+
return [x, y, z];
|
|
601
|
+
};
|
|
602
|
+
convert.lab.lch = function(lab) {
|
|
603
|
+
const l = lab[0];
|
|
604
|
+
const a = lab[1];
|
|
605
|
+
const b = lab[2];
|
|
606
|
+
let h;
|
|
607
|
+
const hr = Math.atan2(b, a);
|
|
608
|
+
h = hr * 360 / 2 / Math.PI;
|
|
609
|
+
if (h < 0) {
|
|
610
|
+
h += 360;
|
|
611
|
+
}
|
|
612
|
+
const c = Math.sqrt(a * a + b * b);
|
|
613
|
+
return [l, c, h];
|
|
614
|
+
};
|
|
615
|
+
convert.lch.lab = function(lch) {
|
|
616
|
+
const l = lch[0];
|
|
617
|
+
const c = lch[1];
|
|
618
|
+
const h = lch[2];
|
|
619
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
620
|
+
const a = c * Math.cos(hr);
|
|
621
|
+
const b = c * Math.sin(hr);
|
|
622
|
+
return [l, a, b];
|
|
623
|
+
};
|
|
624
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
625
|
+
const [r, g, b] = args;
|
|
626
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
627
|
+
value = Math.round(value / 50);
|
|
628
|
+
if (value === 0) {
|
|
629
|
+
return 30;
|
|
630
|
+
}
|
|
631
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
632
|
+
if (value === 2) {
|
|
633
|
+
ansi += 60;
|
|
634
|
+
}
|
|
635
|
+
return ansi;
|
|
636
|
+
};
|
|
637
|
+
convert.hsv.ansi16 = function(args) {
|
|
638
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
639
|
+
};
|
|
640
|
+
convert.rgb.ansi256 = function(args) {
|
|
641
|
+
const r = args[0];
|
|
642
|
+
const g = args[1];
|
|
643
|
+
const b = args[2];
|
|
644
|
+
if (r === g && g === b) {
|
|
645
|
+
if (r < 8) {
|
|
646
|
+
return 16;
|
|
647
|
+
}
|
|
648
|
+
if (r > 248) {
|
|
649
|
+
return 231;
|
|
650
|
+
}
|
|
651
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
652
|
+
}
|
|
653
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
654
|
+
return ansi;
|
|
655
|
+
};
|
|
656
|
+
convert.ansi16.rgb = function(args) {
|
|
657
|
+
let color = args % 10;
|
|
658
|
+
if (color === 0 || color === 7) {
|
|
659
|
+
if (args > 50) {
|
|
660
|
+
color += 3.5;
|
|
661
|
+
}
|
|
662
|
+
color = color / 10.5 * 255;
|
|
663
|
+
return [color, color, color];
|
|
664
|
+
}
|
|
665
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
666
|
+
const r = (color & 1) * mult * 255;
|
|
667
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
668
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
669
|
+
return [r, g, b];
|
|
670
|
+
};
|
|
671
|
+
convert.ansi256.rgb = function(args) {
|
|
672
|
+
if (args >= 232) {
|
|
673
|
+
const c = (args - 232) * 10 + 8;
|
|
674
|
+
return [c, c, c];
|
|
675
|
+
}
|
|
676
|
+
args -= 16;
|
|
677
|
+
let rem;
|
|
678
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
679
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
680
|
+
const b = rem % 6 / 5 * 255;
|
|
681
|
+
return [r, g, b];
|
|
682
|
+
};
|
|
683
|
+
convert.rgb.hex = function(args) {
|
|
684
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
685
|
+
const string = integer.toString(16).toUpperCase();
|
|
686
|
+
return "000000".substring(string.length) + string;
|
|
687
|
+
};
|
|
688
|
+
convert.hex.rgb = function(args) {
|
|
689
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
690
|
+
if (!match) {
|
|
691
|
+
return [0, 0, 0];
|
|
692
|
+
}
|
|
693
|
+
let colorString = match[0];
|
|
694
|
+
if (match[0].length === 3) {
|
|
695
|
+
colorString = colorString.split("").map((char) => {
|
|
696
|
+
return char + char;
|
|
697
|
+
}).join("");
|
|
698
|
+
}
|
|
699
|
+
const integer = parseInt(colorString, 16);
|
|
700
|
+
const r = integer >> 16 & 255;
|
|
701
|
+
const g = integer >> 8 & 255;
|
|
702
|
+
const b = integer & 255;
|
|
703
|
+
return [r, g, b];
|
|
704
|
+
};
|
|
705
|
+
convert.rgb.hcg = function(rgb) {
|
|
706
|
+
const r = rgb[0] / 255;
|
|
707
|
+
const g = rgb[1] / 255;
|
|
708
|
+
const b = rgb[2] / 255;
|
|
709
|
+
const max = Math.max(Math.max(r, g), b);
|
|
710
|
+
const min = Math.min(Math.min(r, g), b);
|
|
711
|
+
const chroma = max - min;
|
|
712
|
+
let grayscale;
|
|
713
|
+
let hue;
|
|
714
|
+
if (chroma < 1) {
|
|
715
|
+
grayscale = min / (1 - chroma);
|
|
716
|
+
} else {
|
|
717
|
+
grayscale = 0;
|
|
718
|
+
}
|
|
719
|
+
if (chroma <= 0) {
|
|
720
|
+
hue = 0;
|
|
721
|
+
} else if (max === r) {
|
|
722
|
+
hue = (g - b) / chroma % 6;
|
|
723
|
+
} else if (max === g) {
|
|
724
|
+
hue = 2 + (b - r) / chroma;
|
|
725
|
+
} else {
|
|
726
|
+
hue = 4 + (r - g) / chroma;
|
|
727
|
+
}
|
|
728
|
+
hue /= 6;
|
|
729
|
+
hue %= 1;
|
|
730
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
731
|
+
};
|
|
732
|
+
convert.hsl.hcg = function(hsl) {
|
|
733
|
+
const s = hsl[1] / 100;
|
|
734
|
+
const l = hsl[2] / 100;
|
|
735
|
+
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
736
|
+
let f = 0;
|
|
737
|
+
if (c < 1) {
|
|
738
|
+
f = (l - 0.5 * c) / (1 - c);
|
|
739
|
+
}
|
|
740
|
+
return [hsl[0], c * 100, f * 100];
|
|
741
|
+
};
|
|
742
|
+
convert.hsv.hcg = function(hsv) {
|
|
743
|
+
const s = hsv[1] / 100;
|
|
744
|
+
const v = hsv[2] / 100;
|
|
745
|
+
const c = s * v;
|
|
746
|
+
let f = 0;
|
|
747
|
+
if (c < 1) {
|
|
748
|
+
f = (v - c) / (1 - c);
|
|
749
|
+
}
|
|
750
|
+
return [hsv[0], c * 100, f * 100];
|
|
751
|
+
};
|
|
752
|
+
convert.hcg.rgb = function(hcg) {
|
|
753
|
+
const h = hcg[0] / 360;
|
|
754
|
+
const c = hcg[1] / 100;
|
|
755
|
+
const g = hcg[2] / 100;
|
|
756
|
+
if (c === 0) {
|
|
757
|
+
return [g * 255, g * 255, g * 255];
|
|
758
|
+
}
|
|
759
|
+
const pure = [0, 0, 0];
|
|
760
|
+
const hi = h % 1 * 6;
|
|
761
|
+
const v = hi % 1;
|
|
762
|
+
const w = 1 - v;
|
|
763
|
+
let mg = 0;
|
|
764
|
+
switch (Math.floor(hi)) {
|
|
765
|
+
case 0:
|
|
766
|
+
pure[0] = 1;
|
|
767
|
+
pure[1] = v;
|
|
768
|
+
pure[2] = 0;
|
|
769
|
+
break;
|
|
770
|
+
case 1:
|
|
771
|
+
pure[0] = w;
|
|
772
|
+
pure[1] = 1;
|
|
773
|
+
pure[2] = 0;
|
|
774
|
+
break;
|
|
775
|
+
case 2:
|
|
776
|
+
pure[0] = 0;
|
|
777
|
+
pure[1] = 1;
|
|
778
|
+
pure[2] = v;
|
|
779
|
+
break;
|
|
780
|
+
case 3:
|
|
781
|
+
pure[0] = 0;
|
|
782
|
+
pure[1] = w;
|
|
783
|
+
pure[2] = 1;
|
|
784
|
+
break;
|
|
785
|
+
case 4:
|
|
786
|
+
pure[0] = v;
|
|
787
|
+
pure[1] = 0;
|
|
788
|
+
pure[2] = 1;
|
|
789
|
+
break;
|
|
790
|
+
default:
|
|
791
|
+
pure[0] = 1;
|
|
792
|
+
pure[1] = 0;
|
|
793
|
+
pure[2] = w;
|
|
794
|
+
}
|
|
795
|
+
mg = (1 - c) * g;
|
|
796
|
+
return [
|
|
797
|
+
(c * pure[0] + mg) * 255,
|
|
798
|
+
(c * pure[1] + mg) * 255,
|
|
799
|
+
(c * pure[2] + mg) * 255
|
|
800
|
+
];
|
|
801
|
+
};
|
|
802
|
+
convert.hcg.hsv = function(hcg) {
|
|
803
|
+
const c = hcg[1] / 100;
|
|
804
|
+
const g = hcg[2] / 100;
|
|
805
|
+
const v = c + g * (1 - c);
|
|
806
|
+
let f = 0;
|
|
807
|
+
if (v > 0) {
|
|
808
|
+
f = c / v;
|
|
809
|
+
}
|
|
810
|
+
return [hcg[0], f * 100, v * 100];
|
|
811
|
+
};
|
|
812
|
+
convert.hcg.hsl = function(hcg) {
|
|
813
|
+
const c = hcg[1] / 100;
|
|
814
|
+
const g = hcg[2] / 100;
|
|
815
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
816
|
+
let s = 0;
|
|
817
|
+
if (l > 0 && l < 0.5) {
|
|
818
|
+
s = c / (2 * l);
|
|
819
|
+
} else if (l >= 0.5 && l < 1) {
|
|
820
|
+
s = c / (2 * (1 - l));
|
|
821
|
+
}
|
|
822
|
+
return [hcg[0], s * 100, l * 100];
|
|
823
|
+
};
|
|
824
|
+
convert.hcg.hwb = function(hcg) {
|
|
825
|
+
const c = hcg[1] / 100;
|
|
826
|
+
const g = hcg[2] / 100;
|
|
827
|
+
const v = c + g * (1 - c);
|
|
828
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
829
|
+
};
|
|
830
|
+
convert.hwb.hcg = function(hwb) {
|
|
831
|
+
const w = hwb[1] / 100;
|
|
832
|
+
const b = hwb[2] / 100;
|
|
833
|
+
const v = 1 - b;
|
|
834
|
+
const c = v - w;
|
|
835
|
+
let g = 0;
|
|
836
|
+
if (c < 1) {
|
|
837
|
+
g = (v - c) / (1 - c);
|
|
838
|
+
}
|
|
839
|
+
return [hwb[0], c * 100, g * 100];
|
|
840
|
+
};
|
|
841
|
+
convert.apple.rgb = function(apple) {
|
|
842
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
843
|
+
};
|
|
844
|
+
convert.rgb.apple = function(rgb) {
|
|
845
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
846
|
+
};
|
|
847
|
+
convert.gray.rgb = function(args) {
|
|
848
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
849
|
+
};
|
|
850
|
+
convert.gray.hsl = function(args) {
|
|
851
|
+
return [0, 0, args[0]];
|
|
852
|
+
};
|
|
853
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
854
|
+
convert.gray.hwb = function(gray) {
|
|
855
|
+
return [0, 100, gray[0]];
|
|
856
|
+
};
|
|
857
|
+
convert.gray.cmyk = function(gray) {
|
|
858
|
+
return [0, 0, 0, gray[0]];
|
|
859
|
+
};
|
|
860
|
+
convert.gray.lab = function(gray) {
|
|
861
|
+
return [gray[0], 0, 0];
|
|
862
|
+
};
|
|
863
|
+
convert.gray.hex = function(gray) {
|
|
864
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
865
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
866
|
+
const string = integer.toString(16).toUpperCase();
|
|
867
|
+
return "000000".substring(string.length) + string;
|
|
868
|
+
};
|
|
869
|
+
convert.rgb.gray = function(rgb) {
|
|
870
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
871
|
+
return [val / 255 * 100];
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
// ../../node_modules/color-convert/route.js
|
|
877
|
+
var require_route = __commonJS({
|
|
878
|
+
"../../node_modules/color-convert/route.js"(exports, module) {
|
|
879
|
+
"use strict";
|
|
880
|
+
init_esm_shims();
|
|
881
|
+
var conversions = require_conversions();
|
|
882
|
+
function buildGraph() {
|
|
883
|
+
const graph = {};
|
|
884
|
+
const models = Object.keys(conversions);
|
|
885
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
886
|
+
graph[models[i]] = {
|
|
887
|
+
// http://jsperf.com/1-vs-infinity
|
|
888
|
+
// micro-opt, but this is simple.
|
|
889
|
+
distance: -1,
|
|
890
|
+
parent: null
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
return graph;
|
|
894
|
+
}
|
|
895
|
+
function deriveBFS(fromModel) {
|
|
896
|
+
const graph = buildGraph();
|
|
897
|
+
const queue = [fromModel];
|
|
898
|
+
graph[fromModel].distance = 0;
|
|
899
|
+
while (queue.length) {
|
|
900
|
+
const current = queue.pop();
|
|
901
|
+
const adjacents = Object.keys(conversions[current]);
|
|
902
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
903
|
+
const adjacent = adjacents[i];
|
|
904
|
+
const node = graph[adjacent];
|
|
905
|
+
if (node.distance === -1) {
|
|
906
|
+
node.distance = graph[current].distance + 1;
|
|
907
|
+
node.parent = current;
|
|
908
|
+
queue.unshift(adjacent);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return graph;
|
|
913
|
+
}
|
|
914
|
+
function link(from, to) {
|
|
915
|
+
return function(args) {
|
|
916
|
+
return to(from(args));
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
function wrapConversion(toModel, graph) {
|
|
920
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
921
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
922
|
+
let cur = graph[toModel].parent;
|
|
923
|
+
while (graph[cur].parent) {
|
|
924
|
+
path2.unshift(graph[cur].parent);
|
|
925
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
926
|
+
cur = graph[cur].parent;
|
|
927
|
+
}
|
|
928
|
+
fn.conversion = path2;
|
|
929
|
+
return fn;
|
|
930
|
+
}
|
|
931
|
+
module.exports = function(fromModel) {
|
|
932
|
+
const graph = deriveBFS(fromModel);
|
|
933
|
+
const conversion = {};
|
|
934
|
+
const models = Object.keys(graph);
|
|
935
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
936
|
+
const toModel = models[i];
|
|
937
|
+
const node = graph[toModel];
|
|
938
|
+
if (node.parent === null) {
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
942
|
+
}
|
|
943
|
+
return conversion;
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
|
|
948
|
+
// ../../node_modules/color-convert/index.js
|
|
949
|
+
var require_color_convert = __commonJS({
|
|
950
|
+
"../../node_modules/color-convert/index.js"(exports, module) {
|
|
951
|
+
"use strict";
|
|
952
|
+
init_esm_shims();
|
|
953
|
+
var conversions = require_conversions();
|
|
954
|
+
var route = require_route();
|
|
955
|
+
var convert = {};
|
|
956
|
+
var models = Object.keys(conversions);
|
|
957
|
+
function wrapRaw(fn) {
|
|
958
|
+
const wrappedFn = function(...args) {
|
|
959
|
+
const arg0 = args[0];
|
|
960
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
961
|
+
return arg0;
|
|
962
|
+
}
|
|
963
|
+
if (arg0.length > 1) {
|
|
964
|
+
args = arg0;
|
|
965
|
+
}
|
|
966
|
+
return fn(args);
|
|
967
|
+
};
|
|
968
|
+
if ("conversion" in fn) {
|
|
969
|
+
wrappedFn.conversion = fn.conversion;
|
|
970
|
+
}
|
|
971
|
+
return wrappedFn;
|
|
972
|
+
}
|
|
973
|
+
function wrapRounded(fn) {
|
|
974
|
+
const wrappedFn = function(...args) {
|
|
975
|
+
const arg0 = args[0];
|
|
976
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
977
|
+
return arg0;
|
|
978
|
+
}
|
|
979
|
+
if (arg0.length > 1) {
|
|
980
|
+
args = arg0;
|
|
981
|
+
}
|
|
982
|
+
const result = fn(args);
|
|
983
|
+
if (typeof result === "object") {
|
|
984
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
985
|
+
result[i] = Math.round(result[i]);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
989
|
+
};
|
|
990
|
+
if ("conversion" in fn) {
|
|
991
|
+
wrappedFn.conversion = fn.conversion;
|
|
992
|
+
}
|
|
993
|
+
return wrappedFn;
|
|
994
|
+
}
|
|
995
|
+
models.forEach((fromModel) => {
|
|
996
|
+
convert[fromModel] = {};
|
|
997
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
998
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
999
|
+
const routes = route(fromModel);
|
|
1000
|
+
const routeModels = Object.keys(routes);
|
|
1001
|
+
routeModels.forEach((toModel) => {
|
|
1002
|
+
const fn = routes[toModel];
|
|
1003
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1004
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1005
|
+
});
|
|
1006
|
+
});
|
|
1007
|
+
module.exports = convert;
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// ../../node_modules/ansi-styles/index.js
|
|
1012
|
+
var require_ansi_styles = __commonJS({
|
|
1013
|
+
"../../node_modules/ansi-styles/index.js"(exports, module) {
|
|
1014
|
+
"use strict";
|
|
1015
|
+
init_esm_shims();
|
|
1016
|
+
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1017
|
+
const code = fn(...args);
|
|
1018
|
+
return `\x1B[${code + offset}m`;
|
|
1019
|
+
};
|
|
1020
|
+
var wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1021
|
+
const code = fn(...args);
|
|
1022
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
1023
|
+
};
|
|
1024
|
+
var wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1025
|
+
const rgb = fn(...args);
|
|
1026
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1027
|
+
};
|
|
1028
|
+
var ansi2ansi = (n) => n;
|
|
1029
|
+
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
1030
|
+
var setLazyProperty = (object, property, get) => {
|
|
1031
|
+
Object.defineProperty(object, property, {
|
|
1032
|
+
get: () => {
|
|
1033
|
+
const value = get();
|
|
1034
|
+
Object.defineProperty(object, property, {
|
|
1035
|
+
value,
|
|
1036
|
+
enumerable: true,
|
|
1037
|
+
configurable: true
|
|
1038
|
+
});
|
|
1039
|
+
return value;
|
|
1040
|
+
},
|
|
1041
|
+
enumerable: true,
|
|
1042
|
+
configurable: true
|
|
1043
|
+
});
|
|
1044
|
+
};
|
|
1045
|
+
var colorConvert;
|
|
1046
|
+
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1047
|
+
if (colorConvert === void 0) {
|
|
1048
|
+
colorConvert = require_color_convert();
|
|
1049
|
+
}
|
|
1050
|
+
const offset = isBackground ? 10 : 0;
|
|
1051
|
+
const styles = {};
|
|
1052
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1053
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1054
|
+
if (sourceSpace === targetSpace) {
|
|
1055
|
+
styles[name] = wrap(identity, offset);
|
|
1056
|
+
} else if (typeof suite === "object") {
|
|
1057
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return styles;
|
|
1061
|
+
};
|
|
1062
|
+
function assembleStyles() {
|
|
1063
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1064
|
+
const styles = {
|
|
1065
|
+
modifier: {
|
|
1066
|
+
reset: [0, 0],
|
|
1067
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1068
|
+
bold: [1, 22],
|
|
1069
|
+
dim: [2, 22],
|
|
1070
|
+
italic: [3, 23],
|
|
1071
|
+
underline: [4, 24],
|
|
1072
|
+
inverse: [7, 27],
|
|
1073
|
+
hidden: [8, 28],
|
|
1074
|
+
strikethrough: [9, 29]
|
|
1075
|
+
},
|
|
1076
|
+
color: {
|
|
1077
|
+
black: [30, 39],
|
|
1078
|
+
red: [31, 39],
|
|
1079
|
+
green: [32, 39],
|
|
1080
|
+
yellow: [33, 39],
|
|
1081
|
+
blue: [34, 39],
|
|
1082
|
+
magenta: [35, 39],
|
|
1083
|
+
cyan: [36, 39],
|
|
1084
|
+
white: [37, 39],
|
|
1085
|
+
// Bright color
|
|
1086
|
+
blackBright: [90, 39],
|
|
1087
|
+
redBright: [91, 39],
|
|
1088
|
+
greenBright: [92, 39],
|
|
1089
|
+
yellowBright: [93, 39],
|
|
1090
|
+
blueBright: [94, 39],
|
|
1091
|
+
magentaBright: [95, 39],
|
|
1092
|
+
cyanBright: [96, 39],
|
|
1093
|
+
whiteBright: [97, 39]
|
|
1094
|
+
},
|
|
1095
|
+
bgColor: {
|
|
1096
|
+
bgBlack: [40, 49],
|
|
1097
|
+
bgRed: [41, 49],
|
|
1098
|
+
bgGreen: [42, 49],
|
|
1099
|
+
bgYellow: [43, 49],
|
|
1100
|
+
bgBlue: [44, 49],
|
|
1101
|
+
bgMagenta: [45, 49],
|
|
1102
|
+
bgCyan: [46, 49],
|
|
1103
|
+
bgWhite: [47, 49],
|
|
1104
|
+
// Bright color
|
|
1105
|
+
bgBlackBright: [100, 49],
|
|
1106
|
+
bgRedBright: [101, 49],
|
|
1107
|
+
bgGreenBright: [102, 49],
|
|
1108
|
+
bgYellowBright: [103, 49],
|
|
1109
|
+
bgBlueBright: [104, 49],
|
|
1110
|
+
bgMagentaBright: [105, 49],
|
|
1111
|
+
bgCyanBright: [106, 49],
|
|
1112
|
+
bgWhiteBright: [107, 49]
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
styles.color.gray = styles.color.blackBright;
|
|
1116
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1117
|
+
styles.color.grey = styles.color.blackBright;
|
|
1118
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1119
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1120
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1121
|
+
styles[styleName] = {
|
|
1122
|
+
open: `\x1B[${style[0]}m`,
|
|
1123
|
+
close: `\x1B[${style[1]}m`
|
|
1124
|
+
};
|
|
1125
|
+
group[styleName] = styles[styleName];
|
|
1126
|
+
codes.set(style[0], style[1]);
|
|
1127
|
+
}
|
|
1128
|
+
Object.defineProperty(styles, groupName, {
|
|
1129
|
+
value: group,
|
|
1130
|
+
enumerable: false
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
Object.defineProperty(styles, "codes", {
|
|
1134
|
+
value: codes,
|
|
1135
|
+
enumerable: false
|
|
1136
|
+
});
|
|
1137
|
+
styles.color.close = "\x1B[39m";
|
|
1138
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1139
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1140
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1141
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1142
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1143
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1144
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1145
|
+
return styles;
|
|
1146
|
+
}
|
|
1147
|
+
Object.defineProperty(module, "exports", {
|
|
1148
|
+
enumerable: true,
|
|
1149
|
+
get: assembleStyles
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
|
|
1154
|
+
// ../../node_modules/has-flag/index.js
|
|
1155
|
+
var require_has_flag = __commonJS({
|
|
1156
|
+
"../../node_modules/has-flag/index.js"(exports, module) {
|
|
1157
|
+
"use strict";
|
|
1158
|
+
init_esm_shims();
|
|
1159
|
+
module.exports = (flag, argv = process.argv) => {
|
|
1160
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1161
|
+
const position = argv.indexOf(prefix + flag);
|
|
1162
|
+
const terminatorPosition = argv.indexOf("--");
|
|
1163
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
// ../../node_modules/supports-color/index.js
|
|
1169
|
+
var require_supports_color = __commonJS({
|
|
1170
|
+
"../../node_modules/supports-color/index.js"(exports, module) {
|
|
1171
|
+
"use strict";
|
|
1172
|
+
init_esm_shims();
|
|
1173
|
+
var os = __require("os");
|
|
1174
|
+
var tty = __require("tty");
|
|
1175
|
+
var hasFlag = require_has_flag();
|
|
1176
|
+
var { env: env2 } = process;
|
|
1177
|
+
var forceColor;
|
|
1178
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1179
|
+
forceColor = 0;
|
|
1180
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1181
|
+
forceColor = 1;
|
|
1182
|
+
}
|
|
1183
|
+
if ("FORCE_COLOR" in env2) {
|
|
1184
|
+
if (env2.FORCE_COLOR === "true") {
|
|
1185
|
+
forceColor = 1;
|
|
1186
|
+
} else if (env2.FORCE_COLOR === "false") {
|
|
1187
|
+
forceColor = 0;
|
|
1188
|
+
} else {
|
|
1189
|
+
forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function translateLevel(level) {
|
|
1193
|
+
if (level === 0) {
|
|
1194
|
+
return false;
|
|
1195
|
+
}
|
|
1196
|
+
return {
|
|
1197
|
+
level,
|
|
1198
|
+
hasBasic: true,
|
|
1199
|
+
has256: level >= 2,
|
|
1200
|
+
has16m: level >= 3
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
1204
|
+
if (forceColor === 0) {
|
|
1205
|
+
return 0;
|
|
1206
|
+
}
|
|
1207
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1208
|
+
return 3;
|
|
1209
|
+
}
|
|
1210
|
+
if (hasFlag("color=256")) {
|
|
1211
|
+
return 2;
|
|
1212
|
+
}
|
|
1213
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1214
|
+
return 0;
|
|
1215
|
+
}
|
|
1216
|
+
const min = forceColor || 0;
|
|
1217
|
+
if (env2.TERM === "dumb") {
|
|
1218
|
+
return min;
|
|
1219
|
+
}
|
|
1220
|
+
if (process.platform === "win32") {
|
|
1221
|
+
const osRelease = os.release().split(".");
|
|
1222
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1223
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1224
|
+
}
|
|
1225
|
+
return 1;
|
|
1226
|
+
}
|
|
1227
|
+
if ("CI" in env2) {
|
|
1228
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
1229
|
+
return 1;
|
|
1230
|
+
}
|
|
1231
|
+
return min;
|
|
1232
|
+
}
|
|
1233
|
+
if ("TEAMCITY_VERSION" in env2) {
|
|
1234
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
1235
|
+
}
|
|
1236
|
+
if (env2.COLORTERM === "truecolor") {
|
|
1237
|
+
return 3;
|
|
1238
|
+
}
|
|
1239
|
+
if ("TERM_PROGRAM" in env2) {
|
|
1240
|
+
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1241
|
+
switch (env2.TERM_PROGRAM) {
|
|
1242
|
+
case "iTerm.app":
|
|
1243
|
+
return version >= 3 ? 3 : 2;
|
|
1244
|
+
case "Apple_Terminal":
|
|
1245
|
+
return 2;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
1249
|
+
return 2;
|
|
1250
|
+
}
|
|
1251
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
1252
|
+
return 1;
|
|
1253
|
+
}
|
|
1254
|
+
if ("COLORTERM" in env2) {
|
|
1255
|
+
return 1;
|
|
1256
|
+
}
|
|
1257
|
+
return min;
|
|
1258
|
+
}
|
|
1259
|
+
function getSupportLevel(stream) {
|
|
1260
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
1261
|
+
return translateLevel(level);
|
|
1262
|
+
}
|
|
1263
|
+
module.exports = {
|
|
1264
|
+
supportsColor: getSupportLevel,
|
|
1265
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
1266
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
|
|
1271
|
+
// ../../node_modules/chalk/source/util.js
|
|
1272
|
+
var require_util = __commonJS({
|
|
1273
|
+
"../../node_modules/chalk/source/util.js"(exports, module) {
|
|
1274
|
+
"use strict";
|
|
1275
|
+
init_esm_shims();
|
|
1276
|
+
var stringReplaceAll = (string, substring, replacer) => {
|
|
1277
|
+
let index = string.indexOf(substring);
|
|
1278
|
+
if (index === -1) {
|
|
1279
|
+
return string;
|
|
1280
|
+
}
|
|
1281
|
+
const substringLength = substring.length;
|
|
1282
|
+
let endIndex = 0;
|
|
1283
|
+
let returnValue = "";
|
|
1284
|
+
do {
|
|
1285
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1286
|
+
endIndex = index + substringLength;
|
|
1287
|
+
index = string.indexOf(substring, endIndex);
|
|
1288
|
+
} while (index !== -1);
|
|
1289
|
+
returnValue += string.substr(endIndex);
|
|
1290
|
+
return returnValue;
|
|
1291
|
+
};
|
|
1292
|
+
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1293
|
+
let endIndex = 0;
|
|
1294
|
+
let returnValue = "";
|
|
1295
|
+
do {
|
|
1296
|
+
const gotCR = string[index - 1] === "\r";
|
|
1297
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1298
|
+
endIndex = index + 1;
|
|
1299
|
+
index = string.indexOf("\n", endIndex);
|
|
1300
|
+
} while (index !== -1);
|
|
1301
|
+
returnValue += string.substr(endIndex);
|
|
1302
|
+
return returnValue;
|
|
1303
|
+
};
|
|
1304
|
+
module.exports = {
|
|
1305
|
+
stringReplaceAll,
|
|
1306
|
+
stringEncaseCRLFWithFirstIndex
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
// ../../node_modules/chalk/source/templates.js
|
|
1312
|
+
var require_templates = __commonJS({
|
|
1313
|
+
"../../node_modules/chalk/source/templates.js"(exports, module) {
|
|
1314
|
+
"use strict";
|
|
1315
|
+
init_esm_shims();
|
|
1316
|
+
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;
|
|
1317
|
+
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1318
|
+
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
1319
|
+
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
1320
|
+
var ESCAPES = /* @__PURE__ */ new Map([
|
|
1321
|
+
["n", "\n"],
|
|
1322
|
+
["r", "\r"],
|
|
1323
|
+
["t", " "],
|
|
1324
|
+
["b", "\b"],
|
|
1325
|
+
["f", "\f"],
|
|
1326
|
+
["v", "\v"],
|
|
1327
|
+
["0", "\0"],
|
|
1328
|
+
["\\", "\\"],
|
|
1329
|
+
["e", "\x1B"],
|
|
1330
|
+
["a", "\x07"]
|
|
1331
|
+
]);
|
|
1332
|
+
function unescape(c) {
|
|
1333
|
+
const u = c[0] === "u";
|
|
1334
|
+
const bracket = c[1] === "{";
|
|
1335
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
1336
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
1337
|
+
}
|
|
1338
|
+
if (u && bracket) {
|
|
1339
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
1340
|
+
}
|
|
1341
|
+
return ESCAPES.get(c) || c;
|
|
1342
|
+
}
|
|
1343
|
+
function parseArguments(name, arguments_) {
|
|
1344
|
+
const results = [];
|
|
1345
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
1346
|
+
let matches;
|
|
1347
|
+
for (const chunk of chunks) {
|
|
1348
|
+
const number = Number(chunk);
|
|
1349
|
+
if (!Number.isNaN(number)) {
|
|
1350
|
+
results.push(number);
|
|
1351
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
1352
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
1353
|
+
} else {
|
|
1354
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
return results;
|
|
1358
|
+
}
|
|
1359
|
+
function parseStyle(style) {
|
|
1360
|
+
STYLE_REGEX.lastIndex = 0;
|
|
1361
|
+
const results = [];
|
|
1362
|
+
let matches;
|
|
1363
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1364
|
+
const name = matches[1];
|
|
1365
|
+
if (matches[2]) {
|
|
1366
|
+
const args = parseArguments(name, matches[2]);
|
|
1367
|
+
results.push([name].concat(args));
|
|
1368
|
+
} else {
|
|
1369
|
+
results.push([name]);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
return results;
|
|
1373
|
+
}
|
|
1374
|
+
function buildStyle(chalk2, styles) {
|
|
1375
|
+
const enabled = {};
|
|
1376
|
+
for (const layer of styles) {
|
|
1377
|
+
for (const style of layer.styles) {
|
|
1378
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
let current = chalk2;
|
|
1382
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1383
|
+
if (!Array.isArray(styles2)) {
|
|
1384
|
+
continue;
|
|
1385
|
+
}
|
|
1386
|
+
if (!(styleName in current)) {
|
|
1387
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1388
|
+
}
|
|
1389
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1390
|
+
}
|
|
1391
|
+
return current;
|
|
1392
|
+
}
|
|
1393
|
+
module.exports = (chalk2, temporary) => {
|
|
1394
|
+
const styles = [];
|
|
1395
|
+
const chunks = [];
|
|
1396
|
+
let chunk = [];
|
|
1397
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
1398
|
+
if (escapeCharacter) {
|
|
1399
|
+
chunk.push(unescape(escapeCharacter));
|
|
1400
|
+
} else if (style) {
|
|
1401
|
+
const string = chunk.join("");
|
|
1402
|
+
chunk = [];
|
|
1403
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
1404
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
1405
|
+
} else if (close) {
|
|
1406
|
+
if (styles.length === 0) {
|
|
1407
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
1408
|
+
}
|
|
1409
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
1410
|
+
chunk = [];
|
|
1411
|
+
styles.pop();
|
|
1412
|
+
} else {
|
|
1413
|
+
chunk.push(character);
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
chunks.push(chunk.join(""));
|
|
1417
|
+
if (styles.length > 0) {
|
|
1418
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1419
|
+
throw new Error(errMessage);
|
|
1420
|
+
}
|
|
1421
|
+
return chunks.join("");
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
|
|
1426
|
+
// ../../node_modules/chalk/source/index.js
|
|
1427
|
+
var require_source = __commonJS({
|
|
1428
|
+
"../../node_modules/chalk/source/index.js"(exports, module) {
|
|
1429
|
+
"use strict";
|
|
1430
|
+
init_esm_shims();
|
|
1431
|
+
var ansiStyles = require_ansi_styles();
|
|
1432
|
+
var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
|
1433
|
+
var {
|
|
1434
|
+
stringReplaceAll,
|
|
1435
|
+
stringEncaseCRLFWithFirstIndex
|
|
1436
|
+
} = require_util();
|
|
1437
|
+
var { isArray: isArray2 } = Array;
|
|
1438
|
+
var levelMapping = [
|
|
1439
|
+
"ansi",
|
|
1440
|
+
"ansi",
|
|
1441
|
+
"ansi256",
|
|
1442
|
+
"ansi16m"
|
|
1443
|
+
];
|
|
1444
|
+
var styles = /* @__PURE__ */ Object.create(null);
|
|
1445
|
+
var applyOptions = (object, options = {}) => {
|
|
1446
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1447
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1448
|
+
}
|
|
1449
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1450
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1451
|
+
};
|
|
1452
|
+
var ChalkClass = class {
|
|
1453
|
+
constructor(options) {
|
|
1454
|
+
return chalkFactory(options);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
var chalkFactory = (options) => {
|
|
1458
|
+
const chalk3 = {};
|
|
1459
|
+
applyOptions(chalk3, options);
|
|
1460
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
1461
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
1462
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
1463
|
+
chalk3.template.constructor = () => {
|
|
1464
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1465
|
+
};
|
|
1466
|
+
chalk3.template.Instance = ChalkClass;
|
|
1467
|
+
return chalk3.template;
|
|
1468
|
+
};
|
|
1469
|
+
function Chalk(options) {
|
|
1470
|
+
return chalkFactory(options);
|
|
1471
|
+
}
|
|
1472
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1473
|
+
styles[styleName] = {
|
|
1474
|
+
get() {
|
|
1475
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1476
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1477
|
+
return builder;
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
styles.visible = {
|
|
1482
|
+
get() {
|
|
1483
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1484
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1485
|
+
return builder;
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1489
|
+
for (const model of usedModels) {
|
|
1490
|
+
styles[model] = {
|
|
1491
|
+
get() {
|
|
1492
|
+
const { level } = this;
|
|
1493
|
+
return function(...arguments_) {
|
|
1494
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1495
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
for (const model of usedModels) {
|
|
1501
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1502
|
+
styles[bgModel] = {
|
|
1503
|
+
get() {
|
|
1504
|
+
const { level } = this;
|
|
1505
|
+
return function(...arguments_) {
|
|
1506
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1507
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
var proto = Object.defineProperties(() => {
|
|
1513
|
+
}, {
|
|
1514
|
+
...styles,
|
|
1515
|
+
level: {
|
|
1516
|
+
enumerable: true,
|
|
1517
|
+
get() {
|
|
1518
|
+
return this._generator.level;
|
|
1519
|
+
},
|
|
1520
|
+
set(level) {
|
|
1521
|
+
this._generator.level = level;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
});
|
|
1525
|
+
var createStyler = (open, close, parent) => {
|
|
1526
|
+
let openAll;
|
|
1527
|
+
let closeAll;
|
|
1528
|
+
if (parent === void 0) {
|
|
1529
|
+
openAll = open;
|
|
1530
|
+
closeAll = close;
|
|
1531
|
+
} else {
|
|
1532
|
+
openAll = parent.openAll + open;
|
|
1533
|
+
closeAll = close + parent.closeAll;
|
|
1534
|
+
}
|
|
1535
|
+
return {
|
|
1536
|
+
open,
|
|
1537
|
+
close,
|
|
1538
|
+
openAll,
|
|
1539
|
+
closeAll,
|
|
1540
|
+
parent
|
|
1541
|
+
};
|
|
1542
|
+
};
|
|
1543
|
+
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
1544
|
+
const builder = (...arguments_) => {
|
|
1545
|
+
if (isArray2(arguments_[0]) && isArray2(arguments_[0].raw)) {
|
|
1546
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1547
|
+
}
|
|
1548
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1549
|
+
};
|
|
1550
|
+
Object.setPrototypeOf(builder, proto);
|
|
1551
|
+
builder._generator = self2;
|
|
1552
|
+
builder._styler = _styler;
|
|
1553
|
+
builder._isEmpty = _isEmpty;
|
|
1554
|
+
return builder;
|
|
1555
|
+
};
|
|
1556
|
+
var applyStyle = (self2, string) => {
|
|
1557
|
+
if (self2.level <= 0 || !string) {
|
|
1558
|
+
return self2._isEmpty ? "" : string;
|
|
1559
|
+
}
|
|
1560
|
+
let styler = self2._styler;
|
|
1561
|
+
if (styler === void 0) {
|
|
1562
|
+
return string;
|
|
1563
|
+
}
|
|
1564
|
+
const { openAll, closeAll } = styler;
|
|
1565
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
1566
|
+
while (styler !== void 0) {
|
|
1567
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1568
|
+
styler = styler.parent;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
const lfIndex = string.indexOf("\n");
|
|
1572
|
+
if (lfIndex !== -1) {
|
|
1573
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1574
|
+
}
|
|
1575
|
+
return openAll + string + closeAll;
|
|
1576
|
+
};
|
|
1577
|
+
var template;
|
|
1578
|
+
var chalkTag = (chalk3, ...strings) => {
|
|
1579
|
+
const [firstString] = strings;
|
|
1580
|
+
if (!isArray2(firstString) || !isArray2(firstString.raw)) {
|
|
1581
|
+
return strings.join(" ");
|
|
1582
|
+
}
|
|
1583
|
+
const arguments_ = strings.slice(1);
|
|
1584
|
+
const parts = [firstString.raw[0]];
|
|
1585
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
1586
|
+
parts.push(
|
|
1587
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1588
|
+
String(firstString.raw[i])
|
|
1589
|
+
);
|
|
1590
|
+
}
|
|
1591
|
+
if (template === void 0) {
|
|
1592
|
+
template = require_templates();
|
|
1593
|
+
}
|
|
1594
|
+
return template(chalk3, parts.join(""));
|
|
1595
|
+
};
|
|
1596
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1597
|
+
var chalk2 = Chalk();
|
|
1598
|
+
chalk2.supportsColor = stdoutColor;
|
|
1599
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1600
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
1601
|
+
module.exports = chalk2;
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
|
|
1605
|
+
// src/index.ts
|
|
1606
|
+
init_esm_shims();
|
|
1607
|
+
|
|
1608
|
+
// src/services/event-broker.ts
|
|
1609
|
+
init_esm_shims();
|
|
1610
|
+
|
|
1
1611
|
// src/provider.ts
|
|
1612
|
+
init_esm_shims();
|
|
2
1613
|
var provider = null;
|
|
3
1614
|
function getCloudProvider() {
|
|
4
1615
|
if (!provider) {
|
|
@@ -24,6 +1635,7 @@ var cloudEventBroker = () => {
|
|
|
24
1635
|
};
|
|
25
1636
|
|
|
26
1637
|
// src/services/storage.ts
|
|
1638
|
+
init_esm_shims();
|
|
27
1639
|
var _cloudStorageService = null;
|
|
28
1640
|
var cloudStorage = () => {
|
|
29
1641
|
if (_cloudStorageService) {
|
|
@@ -34,6 +1646,7 @@ var cloudStorage = () => {
|
|
|
34
1646
|
};
|
|
35
1647
|
|
|
36
1648
|
// src/services/locations.ts
|
|
1649
|
+
init_esm_shims();
|
|
37
1650
|
var _cloudLocationService = null;
|
|
38
1651
|
var cloudLocations = () => {
|
|
39
1652
|
if (_cloudLocationService) {
|
|
@@ -43,7 +1656,38 @@ var cloudLocations = () => {
|
|
|
43
1656
|
return _cloudLocationService;
|
|
44
1657
|
};
|
|
45
1658
|
|
|
1659
|
+
// src/services/functions/index.ts
|
|
1660
|
+
init_esm_shims();
|
|
1661
|
+
|
|
1662
|
+
// src/services/functions/event-broker/handler.ts
|
|
1663
|
+
init_esm_shims();
|
|
1664
|
+
|
|
1665
|
+
// ../utils/src/index.ts
|
|
1666
|
+
init_esm_shims();
|
|
1667
|
+
|
|
1668
|
+
// ../utils/src/config/index.ts
|
|
1669
|
+
init_esm_shims();
|
|
1670
|
+
|
|
1671
|
+
// ../utils/src/config/env.ts
|
|
1672
|
+
init_esm_shims();
|
|
1673
|
+
|
|
1674
|
+
// ../../node_modules/lodash-es/lodash.js
|
|
1675
|
+
init_esm_shims();
|
|
1676
|
+
|
|
1677
|
+
// ../../node_modules/lodash-es/isSymbol.js
|
|
1678
|
+
init_esm_shims();
|
|
1679
|
+
|
|
1680
|
+
// ../../node_modules/lodash-es/_baseGetTag.js
|
|
1681
|
+
init_esm_shims();
|
|
1682
|
+
|
|
1683
|
+
// ../../node_modules/lodash-es/_Symbol.js
|
|
1684
|
+
init_esm_shims();
|
|
1685
|
+
|
|
1686
|
+
// ../../node_modules/lodash-es/_root.js
|
|
1687
|
+
init_esm_shims();
|
|
1688
|
+
|
|
46
1689
|
// ../../node_modules/lodash-es/_freeGlobal.js
|
|
1690
|
+
init_esm_shims();
|
|
47
1691
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
48
1692
|
var freeGlobal_default = freeGlobal;
|
|
49
1693
|
|
|
@@ -57,6 +1701,7 @@ var Symbol2 = root_default.Symbol;
|
|
|
57
1701
|
var Symbol_default = Symbol2;
|
|
58
1702
|
|
|
59
1703
|
// ../../node_modules/lodash-es/_getRawTag.js
|
|
1704
|
+
init_esm_shims();
|
|
60
1705
|
var objectProto = Object.prototype;
|
|
61
1706
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
62
1707
|
var nativeObjectToString = objectProto.toString;
|
|
@@ -81,6 +1726,7 @@ function getRawTag(value) {
|
|
|
81
1726
|
var getRawTag_default = getRawTag;
|
|
82
1727
|
|
|
83
1728
|
// ../../node_modules/lodash-es/_objectToString.js
|
|
1729
|
+
init_esm_shims();
|
|
84
1730
|
var objectProto2 = Object.prototype;
|
|
85
1731
|
var nativeObjectToString2 = objectProto2.toString;
|
|
86
1732
|
function objectToString(value) {
|
|
@@ -101,6 +1747,7 @@ function baseGetTag(value) {
|
|
|
101
1747
|
var baseGetTag_default = baseGetTag;
|
|
102
1748
|
|
|
103
1749
|
// ../../node_modules/lodash-es/isObjectLike.js
|
|
1750
|
+
init_esm_shims();
|
|
104
1751
|
function isObjectLike(value) {
|
|
105
1752
|
return value != null && typeof value == "object";
|
|
106
1753
|
}
|
|
@@ -113,7 +1760,11 @@ function isSymbol(value) {
|
|
|
113
1760
|
}
|
|
114
1761
|
var isSymbol_default = isSymbol;
|
|
115
1762
|
|
|
1763
|
+
// ../../node_modules/lodash-es/_baseToString.js
|
|
1764
|
+
init_esm_shims();
|
|
1765
|
+
|
|
116
1766
|
// ../../node_modules/lodash-es/_arrayMap.js
|
|
1767
|
+
init_esm_shims();
|
|
117
1768
|
function arrayMap(array2, iteratee) {
|
|
118
1769
|
var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
119
1770
|
while (++index < length) {
|
|
@@ -124,6 +1775,7 @@ function arrayMap(array2, iteratee) {
|
|
|
124
1775
|
var arrayMap_default = arrayMap;
|
|
125
1776
|
|
|
126
1777
|
// ../../node_modules/lodash-es/isArray.js
|
|
1778
|
+
init_esm_shims();
|
|
127
1779
|
var isArray = Array.isArray;
|
|
128
1780
|
var isArray_default = isArray;
|
|
129
1781
|
|
|
@@ -146,7 +1798,11 @@ function baseToString(value) {
|
|
|
146
1798
|
}
|
|
147
1799
|
var baseToString_default = baseToString;
|
|
148
1800
|
|
|
1801
|
+
// ../../node_modules/lodash-es/_baseTrim.js
|
|
1802
|
+
init_esm_shims();
|
|
1803
|
+
|
|
149
1804
|
// ../../node_modules/lodash-es/_trimmedEndIndex.js
|
|
1805
|
+
init_esm_shims();
|
|
150
1806
|
var reWhitespace = /\s/;
|
|
151
1807
|
function trimmedEndIndex(string) {
|
|
152
1808
|
var index = string.length;
|
|
@@ -164,13 +1820,21 @@ function baseTrim(string) {
|
|
|
164
1820
|
var baseTrim_default = baseTrim;
|
|
165
1821
|
|
|
166
1822
|
// ../../node_modules/lodash-es/isObject.js
|
|
1823
|
+
init_esm_shims();
|
|
167
1824
|
function isObject(value) {
|
|
168
1825
|
var type = typeof value;
|
|
169
1826
|
return value != null && (type == "object" || type == "function");
|
|
170
1827
|
}
|
|
171
1828
|
var isObject_default = isObject;
|
|
172
1829
|
|
|
1830
|
+
// ../../node_modules/lodash-es/_getNative.js
|
|
1831
|
+
init_esm_shims();
|
|
1832
|
+
|
|
1833
|
+
// ../../node_modules/lodash-es/_baseIsNative.js
|
|
1834
|
+
init_esm_shims();
|
|
1835
|
+
|
|
173
1836
|
// ../../node_modules/lodash-es/isFunction.js
|
|
1837
|
+
init_esm_shims();
|
|
174
1838
|
var asyncTag = "[object AsyncFunction]";
|
|
175
1839
|
var funcTag = "[object Function]";
|
|
176
1840
|
var genTag = "[object GeneratorFunction]";
|
|
@@ -184,7 +1848,11 @@ function isFunction(value) {
|
|
|
184
1848
|
}
|
|
185
1849
|
var isFunction_default = isFunction;
|
|
186
1850
|
|
|
1851
|
+
// ../../node_modules/lodash-es/_isMasked.js
|
|
1852
|
+
init_esm_shims();
|
|
1853
|
+
|
|
187
1854
|
// ../../node_modules/lodash-es/_coreJsData.js
|
|
1855
|
+
init_esm_shims();
|
|
188
1856
|
var coreJsData = root_default["__core-js_shared__"];
|
|
189
1857
|
var coreJsData_default = coreJsData;
|
|
190
1858
|
|
|
@@ -199,6 +1867,7 @@ function isMasked(func) {
|
|
|
199
1867
|
var isMasked_default = isMasked;
|
|
200
1868
|
|
|
201
1869
|
// ../../node_modules/lodash-es/_toSource.js
|
|
1870
|
+
init_esm_shims();
|
|
202
1871
|
var funcProto = Function.prototype;
|
|
203
1872
|
var funcToString = funcProto.toString;
|
|
204
1873
|
function toSource(func) {
|
|
@@ -236,6 +1905,7 @@ function baseIsNative(value) {
|
|
|
236
1905
|
var baseIsNative_default = baseIsNative;
|
|
237
1906
|
|
|
238
1907
|
// ../../node_modules/lodash-es/_getValue.js
|
|
1908
|
+
init_esm_shims();
|
|
239
1909
|
function getValue(object, key) {
|
|
240
1910
|
return object == null ? void 0 : object[key];
|
|
241
1911
|
}
|
|
@@ -248,7 +1918,11 @@ function getNative(object, key) {
|
|
|
248
1918
|
}
|
|
249
1919
|
var getNative_default = getNative;
|
|
250
1920
|
|
|
1921
|
+
// ../../node_modules/lodash-es/_baseIndexOf.js
|
|
1922
|
+
init_esm_shims();
|
|
1923
|
+
|
|
251
1924
|
// ../../node_modules/lodash-es/_baseFindIndex.js
|
|
1925
|
+
init_esm_shims();
|
|
252
1926
|
function baseFindIndex(array2, predicate, fromIndex, fromRight) {
|
|
253
1927
|
var length = array2.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
254
1928
|
while (fromRight ? index-- : ++index < length) {
|
|
@@ -261,12 +1935,14 @@ function baseFindIndex(array2, predicate, fromIndex, fromRight) {
|
|
|
261
1935
|
var baseFindIndex_default = baseFindIndex;
|
|
262
1936
|
|
|
263
1937
|
// ../../node_modules/lodash-es/_baseIsNaN.js
|
|
1938
|
+
init_esm_shims();
|
|
264
1939
|
function baseIsNaN(value) {
|
|
265
1940
|
return value !== value;
|
|
266
1941
|
}
|
|
267
1942
|
var baseIsNaN_default = baseIsNaN;
|
|
268
1943
|
|
|
269
1944
|
// ../../node_modules/lodash-es/_strictIndexOf.js
|
|
1945
|
+
init_esm_shims();
|
|
270
1946
|
function strictIndexOf(array2, value, fromIndex) {
|
|
271
1947
|
var index = fromIndex - 1, length = array2.length;
|
|
272
1948
|
while (++index < length) {
|
|
@@ -285,6 +1961,7 @@ function baseIndexOf(array2, value, fromIndex) {
|
|
|
285
1961
|
var baseIndexOf_default = baseIndexOf;
|
|
286
1962
|
|
|
287
1963
|
// ../../node_modules/lodash-es/_isIndex.js
|
|
1964
|
+
init_esm_shims();
|
|
288
1965
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
289
1966
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
290
1967
|
function isIndex(value, length) {
|
|
@@ -295,19 +1972,25 @@ function isIndex(value, length) {
|
|
|
295
1972
|
var isIndex_default = isIndex;
|
|
296
1973
|
|
|
297
1974
|
// ../../node_modules/lodash-es/eq.js
|
|
1975
|
+
init_esm_shims();
|
|
298
1976
|
function eq(value, other) {
|
|
299
1977
|
return value === other || value !== value && other !== other;
|
|
300
1978
|
}
|
|
301
1979
|
var eq_default = eq;
|
|
302
1980
|
|
|
303
1981
|
// ../../node_modules/lodash-es/isLength.js
|
|
1982
|
+
init_esm_shims();
|
|
304
1983
|
var MAX_SAFE_INTEGER2 = 9007199254740991;
|
|
305
1984
|
function isLength(value) {
|
|
306
1985
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
307
1986
|
}
|
|
308
1987
|
var isLength_default = isLength;
|
|
309
1988
|
|
|
1989
|
+
// ../../node_modules/lodash-es/isArguments.js
|
|
1990
|
+
init_esm_shims();
|
|
1991
|
+
|
|
310
1992
|
// ../../node_modules/lodash-es/_baseIsArguments.js
|
|
1993
|
+
init_esm_shims();
|
|
311
1994
|
var argsTag = "[object Arguments]";
|
|
312
1995
|
function baseIsArguments(value) {
|
|
313
1996
|
return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
|
|
@@ -325,7 +2008,11 @@ var isArguments = baseIsArguments_default(/* @__PURE__ */ function() {
|
|
|
325
2008
|
};
|
|
326
2009
|
var isArguments_default = isArguments;
|
|
327
2010
|
|
|
2011
|
+
// ../../node_modules/lodash-es/_castPath.js
|
|
2012
|
+
init_esm_shims();
|
|
2013
|
+
|
|
328
2014
|
// ../../node_modules/lodash-es/_isKey.js
|
|
2015
|
+
init_esm_shims();
|
|
329
2016
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
330
2017
|
var reIsPlainProp = /^\w*$/;
|
|
331
2018
|
function isKey(value, object) {
|
|
@@ -340,7 +2027,29 @@ function isKey(value, object) {
|
|
|
340
2027
|
}
|
|
341
2028
|
var isKey_default = isKey;
|
|
342
2029
|
|
|
2030
|
+
// ../../node_modules/lodash-es/_stringToPath.js
|
|
2031
|
+
init_esm_shims();
|
|
2032
|
+
|
|
2033
|
+
// ../../node_modules/lodash-es/_memoizeCapped.js
|
|
2034
|
+
init_esm_shims();
|
|
2035
|
+
|
|
2036
|
+
// ../../node_modules/lodash-es/memoize.js
|
|
2037
|
+
init_esm_shims();
|
|
2038
|
+
|
|
2039
|
+
// ../../node_modules/lodash-es/_MapCache.js
|
|
2040
|
+
init_esm_shims();
|
|
2041
|
+
|
|
2042
|
+
// ../../node_modules/lodash-es/_mapCacheClear.js
|
|
2043
|
+
init_esm_shims();
|
|
2044
|
+
|
|
2045
|
+
// ../../node_modules/lodash-es/_Hash.js
|
|
2046
|
+
init_esm_shims();
|
|
2047
|
+
|
|
2048
|
+
// ../../node_modules/lodash-es/_hashClear.js
|
|
2049
|
+
init_esm_shims();
|
|
2050
|
+
|
|
343
2051
|
// ../../node_modules/lodash-es/_nativeCreate.js
|
|
2052
|
+
init_esm_shims();
|
|
344
2053
|
var nativeCreate = getNative_default(Object, "create");
|
|
345
2054
|
var nativeCreate_default = nativeCreate;
|
|
346
2055
|
|
|
@@ -352,6 +2061,7 @@ function hashClear() {
|
|
|
352
2061
|
var hashClear_default = hashClear;
|
|
353
2062
|
|
|
354
2063
|
// ../../node_modules/lodash-es/_hashDelete.js
|
|
2064
|
+
init_esm_shims();
|
|
355
2065
|
function hashDelete(key) {
|
|
356
2066
|
var result = this.has(key) && delete this.__data__[key];
|
|
357
2067
|
this.size -= result ? 1 : 0;
|
|
@@ -360,6 +2070,7 @@ function hashDelete(key) {
|
|
|
360
2070
|
var hashDelete_default = hashDelete;
|
|
361
2071
|
|
|
362
2072
|
// ../../node_modules/lodash-es/_hashGet.js
|
|
2073
|
+
init_esm_shims();
|
|
363
2074
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
364
2075
|
var objectProto5 = Object.prototype;
|
|
365
2076
|
var hasOwnProperty4 = objectProto5.hasOwnProperty;
|
|
@@ -374,6 +2085,7 @@ function hashGet(key) {
|
|
|
374
2085
|
var hashGet_default = hashGet;
|
|
375
2086
|
|
|
376
2087
|
// ../../node_modules/lodash-es/_hashHas.js
|
|
2088
|
+
init_esm_shims();
|
|
377
2089
|
var objectProto6 = Object.prototype;
|
|
378
2090
|
var hasOwnProperty5 = objectProto6.hasOwnProperty;
|
|
379
2091
|
function hashHas(key) {
|
|
@@ -383,6 +2095,7 @@ function hashHas(key) {
|
|
|
383
2095
|
var hashHas_default = hashHas;
|
|
384
2096
|
|
|
385
2097
|
// ../../node_modules/lodash-es/_hashSet.js
|
|
2098
|
+
init_esm_shims();
|
|
386
2099
|
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
387
2100
|
function hashSet(key, value) {
|
|
388
2101
|
var data = this.__data__;
|
|
@@ -408,14 +2121,22 @@ Hash.prototype.has = hashHas_default;
|
|
|
408
2121
|
Hash.prototype.set = hashSet_default;
|
|
409
2122
|
var Hash_default = Hash;
|
|
410
2123
|
|
|
2124
|
+
// ../../node_modules/lodash-es/_ListCache.js
|
|
2125
|
+
init_esm_shims();
|
|
2126
|
+
|
|
411
2127
|
// ../../node_modules/lodash-es/_listCacheClear.js
|
|
2128
|
+
init_esm_shims();
|
|
412
2129
|
function listCacheClear() {
|
|
413
2130
|
this.__data__ = [];
|
|
414
2131
|
this.size = 0;
|
|
415
2132
|
}
|
|
416
2133
|
var listCacheClear_default = listCacheClear;
|
|
417
2134
|
|
|
2135
|
+
// ../../node_modules/lodash-es/_listCacheDelete.js
|
|
2136
|
+
init_esm_shims();
|
|
2137
|
+
|
|
418
2138
|
// ../../node_modules/lodash-es/_assocIndexOf.js
|
|
2139
|
+
init_esm_shims();
|
|
419
2140
|
function assocIndexOf(array2, key) {
|
|
420
2141
|
var length = array2.length;
|
|
421
2142
|
while (length--) {
|
|
@@ -447,6 +2168,7 @@ function listCacheDelete(key) {
|
|
|
447
2168
|
var listCacheDelete_default = listCacheDelete;
|
|
448
2169
|
|
|
449
2170
|
// ../../node_modules/lodash-es/_listCacheGet.js
|
|
2171
|
+
init_esm_shims();
|
|
450
2172
|
function listCacheGet(key) {
|
|
451
2173
|
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
452
2174
|
return index < 0 ? void 0 : data[index][1];
|
|
@@ -454,12 +2176,14 @@ function listCacheGet(key) {
|
|
|
454
2176
|
var listCacheGet_default = listCacheGet;
|
|
455
2177
|
|
|
456
2178
|
// ../../node_modules/lodash-es/_listCacheHas.js
|
|
2179
|
+
init_esm_shims();
|
|
457
2180
|
function listCacheHas(key) {
|
|
458
2181
|
return assocIndexOf_default(this.__data__, key) > -1;
|
|
459
2182
|
}
|
|
460
2183
|
var listCacheHas_default = listCacheHas;
|
|
461
2184
|
|
|
462
2185
|
// ../../node_modules/lodash-es/_listCacheSet.js
|
|
2186
|
+
init_esm_shims();
|
|
463
2187
|
function listCacheSet(key, value) {
|
|
464
2188
|
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
465
2189
|
if (index < 0) {
|
|
@@ -489,6 +2213,7 @@ ListCache.prototype.set = listCacheSet_default;
|
|
|
489
2213
|
var ListCache_default = ListCache;
|
|
490
2214
|
|
|
491
2215
|
// ../../node_modules/lodash-es/_Map.js
|
|
2216
|
+
init_esm_shims();
|
|
492
2217
|
var Map2 = getNative_default(root_default, "Map");
|
|
493
2218
|
var Map_default = Map2;
|
|
494
2219
|
|
|
@@ -503,7 +2228,14 @@ function mapCacheClear() {
|
|
|
503
2228
|
}
|
|
504
2229
|
var mapCacheClear_default = mapCacheClear;
|
|
505
2230
|
|
|
2231
|
+
// ../../node_modules/lodash-es/_mapCacheDelete.js
|
|
2232
|
+
init_esm_shims();
|
|
2233
|
+
|
|
2234
|
+
// ../../node_modules/lodash-es/_getMapData.js
|
|
2235
|
+
init_esm_shims();
|
|
2236
|
+
|
|
506
2237
|
// ../../node_modules/lodash-es/_isKeyable.js
|
|
2238
|
+
init_esm_shims();
|
|
507
2239
|
function isKeyable(value) {
|
|
508
2240
|
var type = typeof value;
|
|
509
2241
|
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
@@ -526,18 +2258,21 @@ function mapCacheDelete(key) {
|
|
|
526
2258
|
var mapCacheDelete_default = mapCacheDelete;
|
|
527
2259
|
|
|
528
2260
|
// ../../node_modules/lodash-es/_mapCacheGet.js
|
|
2261
|
+
init_esm_shims();
|
|
529
2262
|
function mapCacheGet(key) {
|
|
530
2263
|
return getMapData_default(this, key).get(key);
|
|
531
2264
|
}
|
|
532
2265
|
var mapCacheGet_default = mapCacheGet;
|
|
533
2266
|
|
|
534
2267
|
// ../../node_modules/lodash-es/_mapCacheHas.js
|
|
2268
|
+
init_esm_shims();
|
|
535
2269
|
function mapCacheHas(key) {
|
|
536
2270
|
return getMapData_default(this, key).has(key);
|
|
537
2271
|
}
|
|
538
2272
|
var mapCacheHas_default = mapCacheHas;
|
|
539
2273
|
|
|
540
2274
|
// ../../node_modules/lodash-es/_mapCacheSet.js
|
|
2275
|
+
init_esm_shims();
|
|
541
2276
|
function mapCacheSet(key, value) {
|
|
542
2277
|
var data = getMapData_default(this, key), size = data.size;
|
|
543
2278
|
data.set(key, value);
|
|
@@ -613,6 +2348,7 @@ var stringToPath = memoizeCapped_default(function(string) {
|
|
|
613
2348
|
var stringToPath_default = stringToPath;
|
|
614
2349
|
|
|
615
2350
|
// ../../node_modules/lodash-es/toString.js
|
|
2351
|
+
init_esm_shims();
|
|
616
2352
|
function toString(value) {
|
|
617
2353
|
return value == null ? "" : baseToString_default(value);
|
|
618
2354
|
}
|
|
@@ -628,6 +2364,7 @@ function castPath(value, object) {
|
|
|
628
2364
|
var castPath_default = castPath;
|
|
629
2365
|
|
|
630
2366
|
// ../../node_modules/lodash-es/_toKey.js
|
|
2367
|
+
init_esm_shims();
|
|
631
2368
|
var INFINITY2 = 1 / 0;
|
|
632
2369
|
function toKey(value) {
|
|
633
2370
|
if (typeof value == "string" || isSymbol_default(value)) {
|
|
@@ -638,7 +2375,11 @@ function toKey(value) {
|
|
|
638
2375
|
}
|
|
639
2376
|
var toKey_default = toKey;
|
|
640
2377
|
|
|
2378
|
+
// ../../node_modules/lodash-es/_castSlice.js
|
|
2379
|
+
init_esm_shims();
|
|
2380
|
+
|
|
641
2381
|
// ../../node_modules/lodash-es/_baseSlice.js
|
|
2382
|
+
init_esm_shims();
|
|
642
2383
|
function baseSlice(array2, start, end) {
|
|
643
2384
|
var index = -1, length = array2.length;
|
|
644
2385
|
if (start < 0) {
|
|
@@ -667,6 +2408,7 @@ function castSlice(array2, start, end) {
|
|
|
667
2408
|
var castSlice_default = castSlice;
|
|
668
2409
|
|
|
669
2410
|
// ../../node_modules/lodash-es/_hasUnicode.js
|
|
2411
|
+
init_esm_shims();
|
|
670
2412
|
var rsAstralRange = "\\ud800-\\udfff";
|
|
671
2413
|
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
672
2414
|
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
@@ -680,13 +2422,18 @@ function hasUnicode(string) {
|
|
|
680
2422
|
}
|
|
681
2423
|
var hasUnicode_default = hasUnicode;
|
|
682
2424
|
|
|
2425
|
+
// ../../node_modules/lodash-es/_stringToArray.js
|
|
2426
|
+
init_esm_shims();
|
|
2427
|
+
|
|
683
2428
|
// ../../node_modules/lodash-es/_asciiToArray.js
|
|
2429
|
+
init_esm_shims();
|
|
684
2430
|
function asciiToArray(string) {
|
|
685
2431
|
return string.split("");
|
|
686
2432
|
}
|
|
687
2433
|
var asciiToArray_default = asciiToArray;
|
|
688
2434
|
|
|
689
2435
|
// ../../node_modules/lodash-es/_unicodeToArray.js
|
|
2436
|
+
init_esm_shims();
|
|
690
2437
|
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
691
2438
|
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
692
2439
|
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
@@ -719,11 +2466,12 @@ function stringToArray(string) {
|
|
|
719
2466
|
var stringToArray_default = stringToArray;
|
|
720
2467
|
|
|
721
2468
|
// ../../node_modules/lodash-es/_hasPath.js
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
2469
|
+
init_esm_shims();
|
|
2470
|
+
function hasPath(object, path2, hasFunc) {
|
|
2471
|
+
path2 = castPath_default(path2, object);
|
|
2472
|
+
var index = -1, length = path2.length, result = false;
|
|
725
2473
|
while (++index < length) {
|
|
726
|
-
var key = toKey_default(
|
|
2474
|
+
var key = toKey_default(path2[index]);
|
|
727
2475
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
728
2476
|
break;
|
|
729
2477
|
}
|
|
@@ -737,7 +2485,11 @@ function hasPath(object, path, hasFunc) {
|
|
|
737
2485
|
}
|
|
738
2486
|
var hasPath_default = hasPath;
|
|
739
2487
|
|
|
2488
|
+
// ../../node_modules/lodash-es/has.js
|
|
2489
|
+
init_esm_shims();
|
|
2490
|
+
|
|
740
2491
|
// ../../node_modules/lodash-es/_baseHas.js
|
|
2492
|
+
init_esm_shims();
|
|
741
2493
|
var objectProto7 = Object.prototype;
|
|
742
2494
|
var hasOwnProperty6 = objectProto7.hasOwnProperty;
|
|
743
2495
|
function baseHas(object, key) {
|
|
@@ -746,12 +2498,16 @@ function baseHas(object, key) {
|
|
|
746
2498
|
var baseHas_default = baseHas;
|
|
747
2499
|
|
|
748
2500
|
// ../../node_modules/lodash-es/has.js
|
|
749
|
-
function has(object,
|
|
750
|
-
return object != null && hasPath_default(object,
|
|
2501
|
+
function has(object, path2) {
|
|
2502
|
+
return object != null && hasPath_default(object, path2, baseHas_default);
|
|
751
2503
|
}
|
|
752
2504
|
var has_default = has;
|
|
753
2505
|
|
|
2506
|
+
// ../../node_modules/lodash-es/trim.js
|
|
2507
|
+
init_esm_shims();
|
|
2508
|
+
|
|
754
2509
|
// ../../node_modules/lodash-es/_charsEndIndex.js
|
|
2510
|
+
init_esm_shims();
|
|
755
2511
|
function charsEndIndex(strSymbols, chrSymbols) {
|
|
756
2512
|
var index = strSymbols.length;
|
|
757
2513
|
while (index-- && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
@@ -761,6 +2517,7 @@ function charsEndIndex(strSymbols, chrSymbols) {
|
|
|
761
2517
|
var charsEndIndex_default = charsEndIndex;
|
|
762
2518
|
|
|
763
2519
|
// ../../node_modules/lodash-es/_charsStartIndex.js
|
|
2520
|
+
init_esm_shims();
|
|
764
2521
|
function charsStartIndex(strSymbols, chrSymbols) {
|
|
765
2522
|
var index = -1, length = strSymbols.length;
|
|
766
2523
|
while (++index < length && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
@@ -865,499 +2622,19 @@ var utils = {
|
|
|
865
2622
|
};
|
|
866
2623
|
var env = Object.assign(_env, utils);
|
|
867
2624
|
|
|
868
|
-
//
|
|
869
|
-
|
|
870
|
-
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
871
|
-
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
872
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
873
|
-
var styles = {
|
|
874
|
-
modifier: {
|
|
875
|
-
reset: [0, 0],
|
|
876
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
877
|
-
bold: [1, 22],
|
|
878
|
-
dim: [2, 22],
|
|
879
|
-
italic: [3, 23],
|
|
880
|
-
underline: [4, 24],
|
|
881
|
-
overline: [53, 55],
|
|
882
|
-
inverse: [7, 27],
|
|
883
|
-
hidden: [8, 28],
|
|
884
|
-
strikethrough: [9, 29]
|
|
885
|
-
},
|
|
886
|
-
color: {
|
|
887
|
-
black: [30, 39],
|
|
888
|
-
red: [31, 39],
|
|
889
|
-
green: [32, 39],
|
|
890
|
-
yellow: [33, 39],
|
|
891
|
-
blue: [34, 39],
|
|
892
|
-
magenta: [35, 39],
|
|
893
|
-
cyan: [36, 39],
|
|
894
|
-
white: [37, 39],
|
|
895
|
-
// Bright color
|
|
896
|
-
blackBright: [90, 39],
|
|
897
|
-
gray: [90, 39],
|
|
898
|
-
// Alias of `blackBright`
|
|
899
|
-
grey: [90, 39],
|
|
900
|
-
// Alias of `blackBright`
|
|
901
|
-
redBright: [91, 39],
|
|
902
|
-
greenBright: [92, 39],
|
|
903
|
-
yellowBright: [93, 39],
|
|
904
|
-
blueBright: [94, 39],
|
|
905
|
-
magentaBright: [95, 39],
|
|
906
|
-
cyanBright: [96, 39],
|
|
907
|
-
whiteBright: [97, 39]
|
|
908
|
-
},
|
|
909
|
-
bgColor: {
|
|
910
|
-
bgBlack: [40, 49],
|
|
911
|
-
bgRed: [41, 49],
|
|
912
|
-
bgGreen: [42, 49],
|
|
913
|
-
bgYellow: [43, 49],
|
|
914
|
-
bgBlue: [44, 49],
|
|
915
|
-
bgMagenta: [45, 49],
|
|
916
|
-
bgCyan: [46, 49],
|
|
917
|
-
bgWhite: [47, 49],
|
|
918
|
-
// Bright color
|
|
919
|
-
bgBlackBright: [100, 49],
|
|
920
|
-
bgGray: [100, 49],
|
|
921
|
-
// Alias of `bgBlackBright`
|
|
922
|
-
bgGrey: [100, 49],
|
|
923
|
-
// Alias of `bgBlackBright`
|
|
924
|
-
bgRedBright: [101, 49],
|
|
925
|
-
bgGreenBright: [102, 49],
|
|
926
|
-
bgYellowBright: [103, 49],
|
|
927
|
-
bgBlueBright: [104, 49],
|
|
928
|
-
bgMagentaBright: [105, 49],
|
|
929
|
-
bgCyanBright: [106, 49],
|
|
930
|
-
bgWhiteBright: [107, 49]
|
|
931
|
-
}
|
|
932
|
-
};
|
|
933
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
934
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
935
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
936
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
937
|
-
function assembleStyles() {
|
|
938
|
-
const codes = /* @__PURE__ */ new Map();
|
|
939
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
940
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
941
|
-
styles[styleName] = {
|
|
942
|
-
open: `\x1B[${style[0]}m`,
|
|
943
|
-
close: `\x1B[${style[1]}m`
|
|
944
|
-
};
|
|
945
|
-
group[styleName] = styles[styleName];
|
|
946
|
-
codes.set(style[0], style[1]);
|
|
947
|
-
}
|
|
948
|
-
Object.defineProperty(styles, groupName, {
|
|
949
|
-
value: group,
|
|
950
|
-
enumerable: false
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
Object.defineProperty(styles, "codes", {
|
|
954
|
-
value: codes,
|
|
955
|
-
enumerable: false
|
|
956
|
-
});
|
|
957
|
-
styles.color.close = "\x1B[39m";
|
|
958
|
-
styles.bgColor.close = "\x1B[49m";
|
|
959
|
-
styles.color.ansi = wrapAnsi16();
|
|
960
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
961
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
962
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
963
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
964
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
965
|
-
Object.defineProperties(styles, {
|
|
966
|
-
rgbToAnsi256: {
|
|
967
|
-
value(red, green, blue) {
|
|
968
|
-
if (red === green && green === blue) {
|
|
969
|
-
if (red < 8) {
|
|
970
|
-
return 16;
|
|
971
|
-
}
|
|
972
|
-
if (red > 248) {
|
|
973
|
-
return 231;
|
|
974
|
-
}
|
|
975
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
976
|
-
}
|
|
977
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
978
|
-
},
|
|
979
|
-
enumerable: false
|
|
980
|
-
},
|
|
981
|
-
hexToRgb: {
|
|
982
|
-
value(hex) {
|
|
983
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
984
|
-
if (!matches) {
|
|
985
|
-
return [0, 0, 0];
|
|
986
|
-
}
|
|
987
|
-
let [colorString] = matches;
|
|
988
|
-
if (colorString.length === 3) {
|
|
989
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
990
|
-
}
|
|
991
|
-
const integer = Number.parseInt(colorString, 16);
|
|
992
|
-
return [
|
|
993
|
-
/* eslint-disable no-bitwise */
|
|
994
|
-
integer >> 16 & 255,
|
|
995
|
-
integer >> 8 & 255,
|
|
996
|
-
integer & 255
|
|
997
|
-
/* eslint-enable no-bitwise */
|
|
998
|
-
];
|
|
999
|
-
},
|
|
1000
|
-
enumerable: false
|
|
1001
|
-
},
|
|
1002
|
-
hexToAnsi256: {
|
|
1003
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
1004
|
-
enumerable: false
|
|
1005
|
-
},
|
|
1006
|
-
ansi256ToAnsi: {
|
|
1007
|
-
value(code) {
|
|
1008
|
-
if (code < 8) {
|
|
1009
|
-
return 30 + code;
|
|
1010
|
-
}
|
|
1011
|
-
if (code < 16) {
|
|
1012
|
-
return 90 + (code - 8);
|
|
1013
|
-
}
|
|
1014
|
-
let red;
|
|
1015
|
-
let green;
|
|
1016
|
-
let blue;
|
|
1017
|
-
if (code >= 232) {
|
|
1018
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
1019
|
-
green = red;
|
|
1020
|
-
blue = red;
|
|
1021
|
-
} else {
|
|
1022
|
-
code -= 16;
|
|
1023
|
-
const remainder = code % 36;
|
|
1024
|
-
red = Math.floor(code / 36) / 5;
|
|
1025
|
-
green = Math.floor(remainder / 6) / 5;
|
|
1026
|
-
blue = remainder % 6 / 5;
|
|
1027
|
-
}
|
|
1028
|
-
const value = Math.max(red, green, blue) * 2;
|
|
1029
|
-
if (value === 0) {
|
|
1030
|
-
return 30;
|
|
1031
|
-
}
|
|
1032
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
1033
|
-
if (value === 2) {
|
|
1034
|
-
result += 60;
|
|
1035
|
-
}
|
|
1036
|
-
return result;
|
|
1037
|
-
},
|
|
1038
|
-
enumerable: false
|
|
1039
|
-
},
|
|
1040
|
-
rgbToAnsi: {
|
|
1041
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
1042
|
-
enumerable: false
|
|
1043
|
-
},
|
|
1044
|
-
hexToAnsi: {
|
|
1045
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
1046
|
-
enumerable: false
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
return styles;
|
|
1050
|
-
}
|
|
1051
|
-
var ansiStyles = assembleStyles();
|
|
1052
|
-
var ansi_styles_default = ansiStyles;
|
|
1053
|
-
|
|
1054
|
-
// ../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
1055
|
-
import process2 from "process";
|
|
1056
|
-
import os from "os";
|
|
1057
|
-
import tty from "tty";
|
|
1058
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
1059
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1060
|
-
const position = argv.indexOf(prefix + flag);
|
|
1061
|
-
const terminatorPosition = argv.indexOf("--");
|
|
1062
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1063
|
-
}
|
|
1064
|
-
var { env: env2 } = process2;
|
|
1065
|
-
var flagForceColor;
|
|
1066
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1067
|
-
flagForceColor = 0;
|
|
1068
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1069
|
-
flagForceColor = 1;
|
|
1070
|
-
}
|
|
1071
|
-
function envForceColor() {
|
|
1072
|
-
if ("FORCE_COLOR" in env2) {
|
|
1073
|
-
if (env2.FORCE_COLOR === "true") {
|
|
1074
|
-
return 1;
|
|
1075
|
-
}
|
|
1076
|
-
if (env2.FORCE_COLOR === "false") {
|
|
1077
|
-
return 0;
|
|
1078
|
-
}
|
|
1079
|
-
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
function translateLevel(level) {
|
|
1083
|
-
if (level === 0) {
|
|
1084
|
-
return false;
|
|
1085
|
-
}
|
|
1086
|
-
return {
|
|
1087
|
-
level,
|
|
1088
|
-
hasBasic: true,
|
|
1089
|
-
has256: level >= 2,
|
|
1090
|
-
has16m: level >= 3
|
|
1091
|
-
};
|
|
1092
|
-
}
|
|
1093
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
1094
|
-
const noFlagForceColor = envForceColor();
|
|
1095
|
-
if (noFlagForceColor !== void 0) {
|
|
1096
|
-
flagForceColor = noFlagForceColor;
|
|
1097
|
-
}
|
|
1098
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
1099
|
-
if (forceColor === 0) {
|
|
1100
|
-
return 0;
|
|
1101
|
-
}
|
|
1102
|
-
if (sniffFlags) {
|
|
1103
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1104
|
-
return 3;
|
|
1105
|
-
}
|
|
1106
|
-
if (hasFlag("color=256")) {
|
|
1107
|
-
return 2;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
1111
|
-
return 1;
|
|
1112
|
-
}
|
|
1113
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1114
|
-
return 0;
|
|
1115
|
-
}
|
|
1116
|
-
const min = forceColor || 0;
|
|
1117
|
-
if (env2.TERM === "dumb") {
|
|
1118
|
-
return min;
|
|
1119
|
-
}
|
|
1120
|
-
if (process2.platform === "win32") {
|
|
1121
|
-
const osRelease = os.release().split(".");
|
|
1122
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1123
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1124
|
-
}
|
|
1125
|
-
return 1;
|
|
1126
|
-
}
|
|
1127
|
-
if ("CI" in env2) {
|
|
1128
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env2)) {
|
|
1129
|
-
return 3;
|
|
1130
|
-
}
|
|
1131
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
1132
|
-
return 1;
|
|
1133
|
-
}
|
|
1134
|
-
return min;
|
|
1135
|
-
}
|
|
1136
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
1137
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
1138
|
-
}
|
|
1139
|
-
if (env2.COLORTERM === "truecolor") {
|
|
1140
|
-
return 3;
|
|
1141
|
-
}
|
|
1142
|
-
if (env2.TERM === "xterm-kitty") {
|
|
1143
|
-
return 3;
|
|
1144
|
-
}
|
|
1145
|
-
if ("TERM_PROGRAM" in env2) {
|
|
1146
|
-
const version = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1147
|
-
switch (env2.TERM_PROGRAM) {
|
|
1148
|
-
case "iTerm.app": {
|
|
1149
|
-
return version >= 3 ? 3 : 2;
|
|
1150
|
-
}
|
|
1151
|
-
case "Apple_Terminal": {
|
|
1152
|
-
return 2;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
1157
|
-
return 2;
|
|
1158
|
-
}
|
|
1159
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
1160
|
-
return 1;
|
|
1161
|
-
}
|
|
1162
|
-
if ("COLORTERM" in env2) {
|
|
1163
|
-
return 1;
|
|
1164
|
-
}
|
|
1165
|
-
return min;
|
|
1166
|
-
}
|
|
1167
|
-
function createSupportsColor(stream, options = {}) {
|
|
1168
|
-
const level = _supportsColor(stream, {
|
|
1169
|
-
streamIsTTY: stream && stream.isTTY,
|
|
1170
|
-
...options
|
|
1171
|
-
});
|
|
1172
|
-
return translateLevel(level);
|
|
1173
|
-
}
|
|
1174
|
-
var supportsColor = {
|
|
1175
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
1176
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
1177
|
-
};
|
|
1178
|
-
var supports_color_default = supportsColor;
|
|
2625
|
+
// ../utils/src/auth/index.ts
|
|
2626
|
+
init_esm_shims();
|
|
1179
2627
|
|
|
1180
|
-
//
|
|
1181
|
-
|
|
1182
|
-
let index = string.indexOf(substring);
|
|
1183
|
-
if (index === -1) {
|
|
1184
|
-
return string;
|
|
1185
|
-
}
|
|
1186
|
-
const substringLength = substring.length;
|
|
1187
|
-
let endIndex = 0;
|
|
1188
|
-
let returnValue = "";
|
|
1189
|
-
do {
|
|
1190
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
1191
|
-
endIndex = index + substringLength;
|
|
1192
|
-
index = string.indexOf(substring, endIndex);
|
|
1193
|
-
} while (index !== -1);
|
|
1194
|
-
returnValue += string.slice(endIndex);
|
|
1195
|
-
return returnValue;
|
|
1196
|
-
}
|
|
1197
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
1198
|
-
let endIndex = 0;
|
|
1199
|
-
let returnValue = "";
|
|
1200
|
-
do {
|
|
1201
|
-
const gotCR = string[index - 1] === "\r";
|
|
1202
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1203
|
-
endIndex = index + 1;
|
|
1204
|
-
index = string.indexOf("\n", endIndex);
|
|
1205
|
-
} while (index !== -1);
|
|
1206
|
-
returnValue += string.slice(endIndex);
|
|
1207
|
-
return returnValue;
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
// ../../node_modules/chalk/source/index.js
|
|
1211
|
-
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
1212
|
-
var GENERATOR = Symbol("GENERATOR");
|
|
1213
|
-
var STYLER = Symbol("STYLER");
|
|
1214
|
-
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
1215
|
-
var levelMapping = [
|
|
1216
|
-
"ansi",
|
|
1217
|
-
"ansi",
|
|
1218
|
-
"ansi256",
|
|
1219
|
-
"ansi16m"
|
|
1220
|
-
];
|
|
1221
|
-
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
1222
|
-
var applyOptions = (object, options = {}) => {
|
|
1223
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1224
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1225
|
-
}
|
|
1226
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1227
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1228
|
-
};
|
|
1229
|
-
var chalkFactory = (options) => {
|
|
1230
|
-
const chalk2 = (...strings) => strings.join(" ");
|
|
1231
|
-
applyOptions(chalk2, options);
|
|
1232
|
-
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
1233
|
-
return chalk2;
|
|
1234
|
-
};
|
|
1235
|
-
function createChalk(options) {
|
|
1236
|
-
return chalkFactory(options);
|
|
1237
|
-
}
|
|
1238
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
1239
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
1240
|
-
styles2[styleName] = {
|
|
1241
|
-
get() {
|
|
1242
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
1243
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
1244
|
-
return builder;
|
|
1245
|
-
}
|
|
1246
|
-
};
|
|
1247
|
-
}
|
|
1248
|
-
styles2.visible = {
|
|
1249
|
-
get() {
|
|
1250
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
1251
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
1252
|
-
return builder;
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
1256
|
-
if (model === "rgb") {
|
|
1257
|
-
if (level === "ansi16m") {
|
|
1258
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
1259
|
-
}
|
|
1260
|
-
if (level === "ansi256") {
|
|
1261
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
1262
|
-
}
|
|
1263
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
1264
|
-
}
|
|
1265
|
-
if (model === "hex") {
|
|
1266
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
1267
|
-
}
|
|
1268
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
1269
|
-
};
|
|
1270
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
1271
|
-
for (const model of usedModels) {
|
|
1272
|
-
styles2[model] = {
|
|
1273
|
-
get() {
|
|
1274
|
-
const { level } = this;
|
|
1275
|
-
return function(...arguments_) {
|
|
1276
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
1277
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1278
|
-
};
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1282
|
-
styles2[bgModel] = {
|
|
1283
|
-
get() {
|
|
1284
|
-
const { level } = this;
|
|
1285
|
-
return function(...arguments_) {
|
|
1286
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
1287
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1288
|
-
};
|
|
1289
|
-
}
|
|
1290
|
-
};
|
|
1291
|
-
}
|
|
1292
|
-
var proto = Object.defineProperties(() => {
|
|
1293
|
-
}, {
|
|
1294
|
-
...styles2,
|
|
1295
|
-
level: {
|
|
1296
|
-
enumerable: true,
|
|
1297
|
-
get() {
|
|
1298
|
-
return this[GENERATOR].level;
|
|
1299
|
-
},
|
|
1300
|
-
set(level) {
|
|
1301
|
-
this[GENERATOR].level = level;
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
});
|
|
1305
|
-
var createStyler = (open, close, parent) => {
|
|
1306
|
-
let openAll;
|
|
1307
|
-
let closeAll;
|
|
1308
|
-
if (parent === void 0) {
|
|
1309
|
-
openAll = open;
|
|
1310
|
-
closeAll = close;
|
|
1311
|
-
} else {
|
|
1312
|
-
openAll = parent.openAll + open;
|
|
1313
|
-
closeAll = close + parent.closeAll;
|
|
1314
|
-
}
|
|
1315
|
-
return {
|
|
1316
|
-
open,
|
|
1317
|
-
close,
|
|
1318
|
-
openAll,
|
|
1319
|
-
closeAll,
|
|
1320
|
-
parent
|
|
1321
|
-
};
|
|
1322
|
-
};
|
|
1323
|
-
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
1324
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1325
|
-
Object.setPrototypeOf(builder, proto);
|
|
1326
|
-
builder[GENERATOR] = self2;
|
|
1327
|
-
builder[STYLER] = _styler;
|
|
1328
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
1329
|
-
return builder;
|
|
1330
|
-
};
|
|
1331
|
-
var applyStyle = (self2, string) => {
|
|
1332
|
-
if (self2.level <= 0 || !string) {
|
|
1333
|
-
return self2[IS_EMPTY] ? "" : string;
|
|
1334
|
-
}
|
|
1335
|
-
let styler = self2[STYLER];
|
|
1336
|
-
if (styler === void 0) {
|
|
1337
|
-
return string;
|
|
1338
|
-
}
|
|
1339
|
-
const { openAll, closeAll } = styler;
|
|
1340
|
-
if (string.includes("\x1B")) {
|
|
1341
|
-
while (styler !== void 0) {
|
|
1342
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1343
|
-
styler = styler.parent;
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
const lfIndex = string.indexOf("\n");
|
|
1347
|
-
if (lfIndex !== -1) {
|
|
1348
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1349
|
-
}
|
|
1350
|
-
return openAll + string + closeAll;
|
|
1351
|
-
};
|
|
1352
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
1353
|
-
var chalk = createChalk();
|
|
1354
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1355
|
-
var source_default = chalk;
|
|
2628
|
+
// ../utils/src/auth/token.ts
|
|
2629
|
+
init_esm_shims();
|
|
1356
2630
|
|
|
1357
2631
|
// ../utils/src/logging/index.ts
|
|
2632
|
+
init_esm_shims();
|
|
2633
|
+
var import_chalk = __toESM(require_source());
|
|
1358
2634
|
import { EOL } from "os";
|
|
1359
2635
|
|
|
1360
2636
|
// ../utils/src/logging/types.ts
|
|
2637
|
+
init_esm_shims();
|
|
1361
2638
|
var logLevels = {
|
|
1362
2639
|
fatal: -1,
|
|
1363
2640
|
error: 0,
|
|
@@ -1367,6 +2644,7 @@ var logLevels = {
|
|
|
1367
2644
|
};
|
|
1368
2645
|
|
|
1369
2646
|
// ../utils/src/logging/error-to-string.ts
|
|
2647
|
+
init_esm_shims();
|
|
1370
2648
|
var errorToString = (error) => {
|
|
1371
2649
|
if (error === null) return "Null error";
|
|
1372
2650
|
if (error === void 0) return "Undefined error";
|
|
@@ -1397,7 +2675,7 @@ var logger = {
|
|
|
1397
2675
|
if (currentLogLevel >= logLevels.fatal) {
|
|
1398
2676
|
console.error(
|
|
1399
2677
|
`[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
|
|
1400
|
-
`${
|
|
2678
|
+
`${import_chalk.default.bgRed.white(" fatal ")}${EOL}`,
|
|
1401
2679
|
errorToString(message),
|
|
1402
2680
|
meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
|
|
1403
2681
|
);
|
|
@@ -1407,7 +2685,7 @@ var logger = {
|
|
|
1407
2685
|
if (currentLogLevel >= logLevels.error) {
|
|
1408
2686
|
console.error(
|
|
1409
2687
|
`[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
|
|
1410
|
-
`${
|
|
2688
|
+
`${import_chalk.default.bgRed.white(" error ")}${EOL}`,
|
|
1411
2689
|
errorToString(message),
|
|
1412
2690
|
meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
|
|
1413
2691
|
);
|
|
@@ -1417,7 +2695,7 @@ var logger = {
|
|
|
1417
2695
|
if (currentLogLevel >= logLevels.warn) {
|
|
1418
2696
|
console.warn(
|
|
1419
2697
|
`[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
|
|
1420
|
-
`${
|
|
2698
|
+
`${import_chalk.default.bgYellow.black(" warn ")}${EOL}`,
|
|
1421
2699
|
errorToString(message),
|
|
1422
2700
|
meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
|
|
1423
2701
|
);
|
|
@@ -1427,7 +2705,7 @@ var logger = {
|
|
|
1427
2705
|
if (currentLogLevel >= logLevels.info) {
|
|
1428
2706
|
console.info(
|
|
1429
2707
|
`[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
|
|
1430
|
-
`${
|
|
2708
|
+
`${import_chalk.default.bgBlue.white(" info ")}${EOL}`,
|
|
1431
2709
|
message,
|
|
1432
2710
|
meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
|
|
1433
2711
|
);
|
|
@@ -1437,7 +2715,7 @@ var logger = {
|
|
|
1437
2715
|
if (currentLogLevel >= logLevels.debug) {
|
|
1438
2716
|
console.debug(
|
|
1439
2717
|
`[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
|
|
1440
|
-
`${
|
|
2718
|
+
`${import_chalk.default.bgWhite.black(" debug ")}${EOL}`,
|
|
1441
2719
|
message,
|
|
1442
2720
|
meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
|
|
1443
2721
|
);
|
|
@@ -1446,6 +2724,7 @@ var logger = {
|
|
|
1446
2724
|
};
|
|
1447
2725
|
|
|
1448
2726
|
// src/services/functions/cloud-functions.ts
|
|
2727
|
+
init_esm_shims();
|
|
1449
2728
|
var _cloudFunctionsService = null;
|
|
1450
2729
|
var cloudFunctions = () => {
|
|
1451
2730
|
if (_cloudFunctionsService) {
|
|
@@ -1456,6 +2735,7 @@ var cloudFunctions = () => {
|
|
|
1456
2735
|
};
|
|
1457
2736
|
|
|
1458
2737
|
// src/services/functions/event-broker/create-event-context.ts
|
|
2738
|
+
init_esm_shims();
|
|
1459
2739
|
function createEventContext({
|
|
1460
2740
|
body,
|
|
1461
2741
|
attributes,
|
|
@@ -1512,8 +2792,17 @@ async function eventBrokerHandler(handler, ...args) {
|
|
|
1512
2792
|
}
|
|
1513
2793
|
}
|
|
1514
2794
|
|
|
2795
|
+
// src/services/functions/http/handler.ts
|
|
2796
|
+
init_esm_shims();
|
|
2797
|
+
|
|
1515
2798
|
// src/services/functions/http/create-http-context.ts
|
|
2799
|
+
init_esm_shims();
|
|
1516
2800
|
import querystring from "querystring";
|
|
2801
|
+
|
|
2802
|
+
// src/services/functions/http/types.ts
|
|
2803
|
+
init_esm_shims();
|
|
2804
|
+
|
|
2805
|
+
// src/services/functions/http/create-http-context.ts
|
|
1517
2806
|
function createHttpContext(request, auth) {
|
|
1518
2807
|
const response = {
|
|
1519
2808
|
body: void 0,
|
|
@@ -1678,7 +2967,11 @@ async function httpHandler(handler, ...args) {
|
|
|
1678
2967
|
}
|
|
1679
2968
|
}
|
|
1680
2969
|
|
|
2970
|
+
// src/services/functions/schedule/handler.ts
|
|
2971
|
+
init_esm_shims();
|
|
2972
|
+
|
|
1681
2973
|
// src/services/functions/schedule/create-schedule-context.ts
|
|
2974
|
+
init_esm_shims();
|
|
1682
2975
|
function createScheduleContext(request) {
|
|
1683
2976
|
const response = {
|
|
1684
2977
|
status: "error",
|
|
@@ -1720,15 +3013,86 @@ async function scheduleHandler(handler, ...args) {
|
|
|
1720
3013
|
throw error;
|
|
1721
3014
|
}
|
|
1722
3015
|
}
|
|
3016
|
+
|
|
3017
|
+
// src/services/functions/websocket/handler.ts
|
|
3018
|
+
init_esm_shims();
|
|
3019
|
+
|
|
3020
|
+
// src/services/functions/websocket/create-websocket-context.ts
|
|
3021
|
+
init_esm_shims();
|
|
3022
|
+
function createWebSocketContext(request) {
|
|
3023
|
+
const response = {
|
|
3024
|
+
status: "success",
|
|
3025
|
+
body: {}
|
|
3026
|
+
};
|
|
3027
|
+
return {
|
|
3028
|
+
type: "WebSocket",
|
|
3029
|
+
connectionId: request.connectionId,
|
|
3030
|
+
event: request.event,
|
|
3031
|
+
request,
|
|
3032
|
+
response,
|
|
3033
|
+
message() {
|
|
3034
|
+
if (typeof request.body === "string")
|
|
3035
|
+
return JSON.parse(request.body || "{}");
|
|
3036
|
+
return request.body ?? {};
|
|
3037
|
+
},
|
|
3038
|
+
success(body) {
|
|
3039
|
+
response.status = "success";
|
|
3040
|
+
response.body = body;
|
|
3041
|
+
},
|
|
3042
|
+
error(error) {
|
|
3043
|
+
response.status = "error";
|
|
3044
|
+
response.body = error;
|
|
3045
|
+
},
|
|
3046
|
+
notFound(body) {
|
|
3047
|
+
response.status = "error";
|
|
3048
|
+
response.body = body;
|
|
3049
|
+
}
|
|
3050
|
+
};
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
// src/services/functions/websocket/handler.ts
|
|
3054
|
+
async function websocketHandler(handler, ...args) {
|
|
3055
|
+
try {
|
|
3056
|
+
logger.debug("Executing WebSocket handler with args", { args });
|
|
3057
|
+
const [wsRequest] = cloudFunctions().createWebSocketRequest(...args);
|
|
3058
|
+
logger.debug("Created WebSocket request", {
|
|
3059
|
+
request: wsRequest
|
|
3060
|
+
});
|
|
3061
|
+
const context = createWebSocketContext(wsRequest);
|
|
3062
|
+
await handler(context);
|
|
3063
|
+
logger.debug("WebSocket Handler executed successfully, building response", { response: context.response });
|
|
3064
|
+
return cloudFunctions().buildWebSocketResponse(context, ...args);
|
|
3065
|
+
} catch (error) {
|
|
3066
|
+
logger.error("Error in WebSocket handler", { error });
|
|
3067
|
+
throw error;
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
// src/services/websocket.ts
|
|
3072
|
+
init_esm_shims();
|
|
3073
|
+
var _cloudWebSocket = null;
|
|
3074
|
+
var cloudWebSocket = () => {
|
|
3075
|
+
if (_cloudWebSocket) {
|
|
3076
|
+
return _cloudWebSocket;
|
|
3077
|
+
}
|
|
3078
|
+
_cloudWebSocket = getCloudProvider().createWebSocketService();
|
|
3079
|
+
return _cloudWebSocket;
|
|
3080
|
+
};
|
|
3081
|
+
|
|
3082
|
+
// src/index.ts
|
|
3083
|
+
import { ErrorCode as ErrorCode2 } from "@cloudnux/core-cloud-provider";
|
|
1723
3084
|
export {
|
|
3085
|
+
ErrorCode2 as ErrorCode,
|
|
1724
3086
|
cloudEventBroker,
|
|
1725
3087
|
cloudLocations,
|
|
1726
3088
|
cloudStorage,
|
|
3089
|
+
cloudWebSocket,
|
|
1727
3090
|
eventBrokerHandler,
|
|
1728
3091
|
getCloudProvider,
|
|
1729
3092
|
httpHandler,
|
|
1730
3093
|
scheduleHandler,
|
|
1731
|
-
useCloudProvider
|
|
3094
|
+
useCloudProvider,
|
|
3095
|
+
websocketHandler
|
|
1732
3096
|
};
|
|
1733
3097
|
/*! Bundled license information:
|
|
1734
3098
|
|