@nsshunt/stsoauth2plugin 1.0.68 → 1.0.70
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/stsoauth2plugin.mjs +3774 -169
- package/dist/stsoauth2plugin.mjs.map +1 -1
- package/dist/stsoauth2plugin.umd.js +3776 -171
- package/dist/stsoauth2plugin.umd.js.map +1 -1
- package/package.json +4 -5
package/dist/stsoauth2plugin.mjs
CHANGED
|
@@ -40,13 +40,13 @@ import * as wt from "node:worker_threads";
|
|
|
40
40
|
import { OAuth2ParameterType, Sleep } from "@nsshunt/stsutils";
|
|
41
41
|
import { ClientStorageFactory, ClientStorageType } from "@nsshunt/stsvueutils";
|
|
42
42
|
import { defineStore } from "pinia";
|
|
43
|
-
import { STSInstrumentControllerPluginKey } from "@nsshunt/stspublisherserver";
|
|
44
43
|
import https from "node:https";
|
|
45
|
-
import "colors";
|
|
46
44
|
import axios from "axios";
|
|
47
|
-
import
|
|
45
|
+
import debugModule from "debug";
|
|
46
|
+
import "socket.io-client";
|
|
47
|
+
import "colors";
|
|
48
48
|
const STSOAuth2ManagerPluginKey = Symbol();
|
|
49
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
49
|
+
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
50
50
|
function getDefaultExportFromCjs(x) {
|
|
51
51
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
52
52
|
}
|
|
@@ -76,14 +76,14 @@ function getAugmentedNamespace(n) {
|
|
|
76
76
|
});
|
|
77
77
|
return a;
|
|
78
78
|
}
|
|
79
|
-
var ansiStyles$
|
|
80
|
-
var colorName;
|
|
81
|
-
var hasRequiredColorName;
|
|
82
|
-
function requireColorName() {
|
|
83
|
-
if (hasRequiredColorName)
|
|
84
|
-
return colorName;
|
|
85
|
-
hasRequiredColorName = 1;
|
|
86
|
-
colorName = {
|
|
79
|
+
var ansiStyles$3 = { exports: {} };
|
|
80
|
+
var colorName$1;
|
|
81
|
+
var hasRequiredColorName$1;
|
|
82
|
+
function requireColorName$1() {
|
|
83
|
+
if (hasRequiredColorName$1)
|
|
84
|
+
return colorName$1;
|
|
85
|
+
hasRequiredColorName$1 = 1;
|
|
86
|
+
colorName$1 = {
|
|
87
87
|
"aliceblue": [240, 248, 255],
|
|
88
88
|
"antiquewhite": [250, 235, 215],
|
|
89
89
|
"aqua": [0, 255, 255],
|
|
@@ -233,15 +233,15 @@ function requireColorName() {
|
|
|
233
233
|
"yellow": [255, 255, 0],
|
|
234
234
|
"yellowgreen": [154, 205, 50]
|
|
235
235
|
};
|
|
236
|
-
return colorName;
|
|
236
|
+
return colorName$1;
|
|
237
237
|
}
|
|
238
|
-
var conversions;
|
|
239
|
-
var hasRequiredConversions;
|
|
240
|
-
function requireConversions() {
|
|
241
|
-
if (hasRequiredConversions)
|
|
242
|
-
return conversions;
|
|
243
|
-
hasRequiredConversions = 1;
|
|
244
|
-
const cssKeywords = requireColorName();
|
|
238
|
+
var conversions$1;
|
|
239
|
+
var hasRequiredConversions$1;
|
|
240
|
+
function requireConversions$1() {
|
|
241
|
+
if (hasRequiredConversions$1)
|
|
242
|
+
return conversions$1;
|
|
243
|
+
hasRequiredConversions$1 = 1;
|
|
244
|
+
const cssKeywords = requireColorName$1();
|
|
245
245
|
const reverseKeywords = {};
|
|
246
246
|
for (const key of Object.keys(cssKeywords)) {
|
|
247
247
|
reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -263,7 +263,7 @@ function requireConversions() {
|
|
|
263
263
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
264
264
|
gray: { channels: 1, labels: ["gray"] }
|
|
265
265
|
};
|
|
266
|
-
conversions = convert;
|
|
266
|
+
conversions$1 = convert;
|
|
267
267
|
for (const model of Object.keys(convert)) {
|
|
268
268
|
if (!("channels" in convert[model])) {
|
|
269
269
|
throw new Error("missing channels property: " + model);
|
|
@@ -906,15 +906,15 @@ function requireConversions() {
|
|
|
906
906
|
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
907
907
|
return [val / 255 * 100];
|
|
908
908
|
};
|
|
909
|
-
return conversions;
|
|
909
|
+
return conversions$1;
|
|
910
910
|
}
|
|
911
|
-
var route;
|
|
912
|
-
var hasRequiredRoute;
|
|
913
|
-
function requireRoute() {
|
|
914
|
-
if (hasRequiredRoute)
|
|
915
|
-
return route;
|
|
916
|
-
hasRequiredRoute = 1;
|
|
917
|
-
const conversions2 = requireConversions();
|
|
911
|
+
var route$1;
|
|
912
|
+
var hasRequiredRoute$1;
|
|
913
|
+
function requireRoute$1() {
|
|
914
|
+
if (hasRequiredRoute$1)
|
|
915
|
+
return route$1;
|
|
916
|
+
hasRequiredRoute$1 = 1;
|
|
917
|
+
const conversions2 = requireConversions$1();
|
|
918
918
|
function buildGraph() {
|
|
919
919
|
const graph = {};
|
|
920
920
|
const models = Object.keys(conversions2);
|
|
@@ -964,7 +964,7 @@ function requireRoute() {
|
|
|
964
964
|
fn.conversion = path;
|
|
965
965
|
return fn;
|
|
966
966
|
}
|
|
967
|
-
route = function(fromModel) {
|
|
967
|
+
route$1 = function(fromModel) {
|
|
968
968
|
const graph = deriveBFS(fromModel);
|
|
969
969
|
const conversion = {};
|
|
970
970
|
const models = Object.keys(graph);
|
|
@@ -978,16 +978,16 @@ function requireRoute() {
|
|
|
978
978
|
}
|
|
979
979
|
return conversion;
|
|
980
980
|
};
|
|
981
|
-
return route;
|
|
981
|
+
return route$1;
|
|
982
982
|
}
|
|
983
|
-
var colorConvert;
|
|
984
|
-
var hasRequiredColorConvert;
|
|
985
|
-
function requireColorConvert() {
|
|
986
|
-
if (hasRequiredColorConvert)
|
|
987
|
-
return colorConvert;
|
|
988
|
-
hasRequiredColorConvert = 1;
|
|
989
|
-
const conversions2 = requireConversions();
|
|
990
|
-
const route2 = requireRoute();
|
|
983
|
+
var colorConvert$1;
|
|
984
|
+
var hasRequiredColorConvert$1;
|
|
985
|
+
function requireColorConvert$1() {
|
|
986
|
+
if (hasRequiredColorConvert$1)
|
|
987
|
+
return colorConvert$1;
|
|
988
|
+
hasRequiredColorConvert$1 = 1;
|
|
989
|
+
const conversions2 = requireConversions$1();
|
|
990
|
+
const route2 = requireRoute$1();
|
|
991
991
|
const convert = {};
|
|
992
992
|
const models = Object.keys(conversions2);
|
|
993
993
|
function wrapRaw(fn) {
|
|
@@ -1040,10 +1040,10 @@ function requireColorConvert() {
|
|
|
1040
1040
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1041
1041
|
});
|
|
1042
1042
|
});
|
|
1043
|
-
colorConvert = convert;
|
|
1044
|
-
return colorConvert;
|
|
1043
|
+
colorConvert$1 = convert;
|
|
1044
|
+
return colorConvert$1;
|
|
1045
1045
|
}
|
|
1046
|
-
ansiStyles$
|
|
1046
|
+
ansiStyles$3.exports;
|
|
1047
1047
|
(function(module) {
|
|
1048
1048
|
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1049
1049
|
const code = fn(...args);
|
|
@@ -1077,7 +1077,7 @@ ansiStyles$1.exports;
|
|
|
1077
1077
|
let colorConvert2;
|
|
1078
1078
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1079
1079
|
if (colorConvert2 === void 0) {
|
|
1080
|
-
colorConvert2 = requireColorConvert();
|
|
1080
|
+
colorConvert2 = requireColorConvert$1();
|
|
1081
1081
|
}
|
|
1082
1082
|
const offset = isBackground ? 10 : 0;
|
|
1083
1083
|
const styles2 = {};
|
|
@@ -1180,13 +1180,13 @@ ansiStyles$1.exports;
|
|
|
1180
1180
|
enumerable: true,
|
|
1181
1181
|
get: assembleStyles
|
|
1182
1182
|
});
|
|
1183
|
-
})(ansiStyles$
|
|
1184
|
-
var ansiStylesExports = ansiStyles$
|
|
1185
|
-
var browser = {
|
|
1183
|
+
})(ansiStyles$3);
|
|
1184
|
+
var ansiStylesExports$1 = ansiStyles$3.exports;
|
|
1185
|
+
var browser$1 = {
|
|
1186
1186
|
stdout: false,
|
|
1187
1187
|
stderr: false
|
|
1188
1188
|
};
|
|
1189
|
-
const stringReplaceAll$
|
|
1189
|
+
const stringReplaceAll$3 = (string, substring, replacer) => {
|
|
1190
1190
|
let index = string.indexOf(substring);
|
|
1191
1191
|
if (index === -1) {
|
|
1192
1192
|
return string;
|
|
@@ -1202,7 +1202,7 @@ const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
|
1202
1202
|
returnValue += string.substr(endIndex);
|
|
1203
1203
|
return returnValue;
|
|
1204
1204
|
};
|
|
1205
|
-
const stringEncaseCRLFWithFirstIndex$
|
|
1205
|
+
const stringEncaseCRLFWithFirstIndex$3 = (string, prefix, postfix, index) => {
|
|
1206
1206
|
let endIndex = 0;
|
|
1207
1207
|
let returnValue = "";
|
|
1208
1208
|
do {
|
|
@@ -1214,16 +1214,16 @@ const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
|
1214
1214
|
returnValue += string.substr(endIndex);
|
|
1215
1215
|
return returnValue;
|
|
1216
1216
|
};
|
|
1217
|
-
var util = {
|
|
1218
|
-
stringReplaceAll: stringReplaceAll$
|
|
1219
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$
|
|
1217
|
+
var util$1 = {
|
|
1218
|
+
stringReplaceAll: stringReplaceAll$3,
|
|
1219
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$3
|
|
1220
1220
|
};
|
|
1221
|
-
var templates;
|
|
1222
|
-
var hasRequiredTemplates;
|
|
1223
|
-
function requireTemplates() {
|
|
1224
|
-
if (hasRequiredTemplates)
|
|
1225
|
-
return templates;
|
|
1226
|
-
hasRequiredTemplates = 1;
|
|
1221
|
+
var templates$1;
|
|
1222
|
+
var hasRequiredTemplates$1;
|
|
1223
|
+
function requireTemplates$1() {
|
|
1224
|
+
if (hasRequiredTemplates$1)
|
|
1225
|
+
return templates$1;
|
|
1226
|
+
hasRequiredTemplates$1 = 1;
|
|
1227
1227
|
const 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;
|
|
1228
1228
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1229
1229
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -1301,7 +1301,7 @@ function requireTemplates() {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
return current;
|
|
1303
1303
|
}
|
|
1304
|
-
templates = (chalk2, temporary) => {
|
|
1304
|
+
templates$1 = (chalk2, temporary) => {
|
|
1305
1305
|
const styles2 = [];
|
|
1306
1306
|
const chunks = [];
|
|
1307
1307
|
let chunk = [];
|
|
@@ -1331,92 +1331,92 @@ function requireTemplates() {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
return chunks.join("");
|
|
1333
1333
|
};
|
|
1334
|
-
return templates;
|
|
1334
|
+
return templates$1;
|
|
1335
1335
|
}
|
|
1336
|
-
const ansiStyles = ansiStylesExports;
|
|
1337
|
-
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
1336
|
+
const ansiStyles$2 = ansiStylesExports$1;
|
|
1337
|
+
const { stdout: stdoutColor$1, stderr: stderrColor$1 } = browser$1;
|
|
1338
1338
|
const {
|
|
1339
|
-
stringReplaceAll,
|
|
1340
|
-
stringEncaseCRLFWithFirstIndex
|
|
1341
|
-
} = util;
|
|
1342
|
-
const { isArray } = Array;
|
|
1343
|
-
const levelMapping = [
|
|
1339
|
+
stringReplaceAll: stringReplaceAll$2,
|
|
1340
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$2
|
|
1341
|
+
} = util$1;
|
|
1342
|
+
const { isArray: isArray$1 } = Array;
|
|
1343
|
+
const levelMapping$1 = [
|
|
1344
1344
|
"ansi",
|
|
1345
1345
|
"ansi",
|
|
1346
1346
|
"ansi256",
|
|
1347
1347
|
"ansi16m"
|
|
1348
1348
|
];
|
|
1349
|
-
const styles = /* @__PURE__ */ Object.create(null);
|
|
1350
|
-
const applyOptions = (object, options = {}) => {
|
|
1349
|
+
const styles$1 = /* @__PURE__ */ Object.create(null);
|
|
1350
|
+
const applyOptions$1 = (object, options = {}) => {
|
|
1351
1351
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1352
1352
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1353
1353
|
}
|
|
1354
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1354
|
+
const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
|
|
1355
1355
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1356
1356
|
};
|
|
1357
|
-
class ChalkClass {
|
|
1357
|
+
let ChalkClass$1 = class ChalkClass {
|
|
1358
1358
|
constructor(options) {
|
|
1359
|
-
return chalkFactory(options);
|
|
1359
|
+
return chalkFactory$1(options);
|
|
1360
1360
|
}
|
|
1361
|
-
}
|
|
1362
|
-
const chalkFactory = (options) => {
|
|
1361
|
+
};
|
|
1362
|
+
const chalkFactory$1 = (options) => {
|
|
1363
1363
|
const chalk2 = {};
|
|
1364
|
-
applyOptions(chalk2, options);
|
|
1365
|
-
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
1366
|
-
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
1364
|
+
applyOptions$1(chalk2, options);
|
|
1365
|
+
chalk2.template = (...arguments_) => chalkTag$1(chalk2.template, ...arguments_);
|
|
1366
|
+
Object.setPrototypeOf(chalk2, Chalk$1.prototype);
|
|
1367
1367
|
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
1368
1368
|
chalk2.template.constructor = () => {
|
|
1369
1369
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1370
1370
|
};
|
|
1371
|
-
chalk2.template.Instance = ChalkClass;
|
|
1371
|
+
chalk2.template.Instance = ChalkClass$1;
|
|
1372
1372
|
return chalk2.template;
|
|
1373
1373
|
};
|
|
1374
|
-
function Chalk(options) {
|
|
1375
|
-
return chalkFactory(options);
|
|
1374
|
+
function Chalk$1(options) {
|
|
1375
|
+
return chalkFactory$1(options);
|
|
1376
1376
|
}
|
|
1377
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1378
|
-
styles[styleName] = {
|
|
1377
|
+
for (const [styleName, style] of Object.entries(ansiStyles$2)) {
|
|
1378
|
+
styles$1[styleName] = {
|
|
1379
1379
|
get() {
|
|
1380
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1380
|
+
const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this._styler), this._isEmpty);
|
|
1381
1381
|
Object.defineProperty(this, styleName, { value: builder });
|
|
1382
1382
|
return builder;
|
|
1383
1383
|
}
|
|
1384
1384
|
};
|
|
1385
1385
|
}
|
|
1386
|
-
styles.visible = {
|
|
1386
|
+
styles$1.visible = {
|
|
1387
1387
|
get() {
|
|
1388
|
-
const builder = createBuilder(this, this._styler, true);
|
|
1388
|
+
const builder = createBuilder$1(this, this._styler, true);
|
|
1389
1389
|
Object.defineProperty(this, "visible", { value: builder });
|
|
1390
1390
|
return builder;
|
|
1391
1391
|
}
|
|
1392
1392
|
};
|
|
1393
|
-
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1394
|
-
for (const model of usedModels) {
|
|
1395
|
-
styles[model] = {
|
|
1393
|
+
const usedModels$1 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1394
|
+
for (const model of usedModels$1) {
|
|
1395
|
+
styles$1[model] = {
|
|
1396
1396
|
get() {
|
|
1397
1397
|
const { level } = this;
|
|
1398
1398
|
return function(...arguments_) {
|
|
1399
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1400
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1399
|
+
const styler = createStyler$1(ansiStyles$2.color[levelMapping$1[level]][model](...arguments_), ansiStyles$2.color.close, this._styler);
|
|
1400
|
+
return createBuilder$1(this, styler, this._isEmpty);
|
|
1401
1401
|
};
|
|
1402
1402
|
}
|
|
1403
1403
|
};
|
|
1404
1404
|
}
|
|
1405
|
-
for (const model of usedModels) {
|
|
1405
|
+
for (const model of usedModels$1) {
|
|
1406
1406
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1407
|
-
styles[bgModel] = {
|
|
1407
|
+
styles$1[bgModel] = {
|
|
1408
1408
|
get() {
|
|
1409
1409
|
const { level } = this;
|
|
1410
1410
|
return function(...arguments_) {
|
|
1411
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1412
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1411
|
+
const styler = createStyler$1(ansiStyles$2.bgColor[levelMapping$1[level]][model](...arguments_), ansiStyles$2.bgColor.close, this._styler);
|
|
1412
|
+
return createBuilder$1(this, styler, this._isEmpty);
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
1416
|
}
|
|
1417
|
-
const proto = Object.defineProperties(() => {
|
|
1417
|
+
const proto$1 = Object.defineProperties(() => {
|
|
1418
1418
|
}, {
|
|
1419
|
-
...styles,
|
|
1419
|
+
...styles$1,
|
|
1420
1420
|
level: {
|
|
1421
1421
|
enumerable: true,
|
|
1422
1422
|
get() {
|
|
@@ -1427,7 +1427,7 @@ const proto = Object.defineProperties(() => {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
1429
|
});
|
|
1430
|
-
const createStyler = (open, close, parent) => {
|
|
1430
|
+
const createStyler$1 = (open, close, parent) => {
|
|
1431
1431
|
let openAll;
|
|
1432
1432
|
let closeAll;
|
|
1433
1433
|
if (parent === void 0) {
|
|
@@ -1445,20 +1445,20 @@ const createStyler = (open, close, parent) => {
|
|
|
1445
1445
|
parent
|
|
1446
1446
|
};
|
|
1447
1447
|
};
|
|
1448
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
1448
|
+
const createBuilder$1 = (self2, _styler, _isEmpty) => {
|
|
1449
1449
|
const builder = (...arguments_) => {
|
|
1450
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1451
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1450
|
+
if (isArray$1(arguments_[0]) && isArray$1(arguments_[0].raw)) {
|
|
1451
|
+
return applyStyle$1(builder, chalkTag$1(builder, ...arguments_));
|
|
1452
1452
|
}
|
|
1453
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1453
|
+
return applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1454
1454
|
};
|
|
1455
|
-
Object.setPrototypeOf(builder, proto);
|
|
1455
|
+
Object.setPrototypeOf(builder, proto$1);
|
|
1456
1456
|
builder._generator = self2;
|
|
1457
1457
|
builder._styler = _styler;
|
|
1458
1458
|
builder._isEmpty = _isEmpty;
|
|
1459
1459
|
return builder;
|
|
1460
1460
|
};
|
|
1461
|
-
const applyStyle = (self2, string) => {
|
|
1461
|
+
const applyStyle$1 = (self2, string) => {
|
|
1462
1462
|
if (self2.level <= 0 || !string) {
|
|
1463
1463
|
return self2._isEmpty ? "" : string;
|
|
1464
1464
|
}
|
|
@@ -1469,20 +1469,20 @@ const applyStyle = (self2, string) => {
|
|
|
1469
1469
|
const { openAll, closeAll } = styler;
|
|
1470
1470
|
if (string.indexOf("\x1B") !== -1) {
|
|
1471
1471
|
while (styler !== void 0) {
|
|
1472
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1472
|
+
string = stringReplaceAll$2(string, styler.close, styler.open);
|
|
1473
1473
|
styler = styler.parent;
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
1476
|
const lfIndex = string.indexOf("\n");
|
|
1477
1477
|
if (lfIndex !== -1) {
|
|
1478
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1478
|
+
string = stringEncaseCRLFWithFirstIndex$2(string, closeAll, openAll, lfIndex);
|
|
1479
1479
|
}
|
|
1480
1480
|
return openAll + string + closeAll;
|
|
1481
1481
|
};
|
|
1482
|
-
let template;
|
|
1483
|
-
const chalkTag = (chalk2, ...strings) => {
|
|
1482
|
+
let template$1;
|
|
1483
|
+
const chalkTag$1 = (chalk2, ...strings) => {
|
|
1484
1484
|
const [firstString] = strings;
|
|
1485
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1485
|
+
if (!isArray$1(firstString) || !isArray$1(firstString.raw)) {
|
|
1486
1486
|
return strings.join(" ");
|
|
1487
1487
|
}
|
|
1488
1488
|
const arguments_ = strings.slice(1);
|
|
@@ -1493,18 +1493,18 @@ const chalkTag = (chalk2, ...strings) => {
|
|
|
1493
1493
|
String(firstString.raw[i])
|
|
1494
1494
|
);
|
|
1495
1495
|
}
|
|
1496
|
-
if (template === void 0) {
|
|
1497
|
-
template = requireTemplates();
|
|
1496
|
+
if (template$1 === void 0) {
|
|
1497
|
+
template$1 = requireTemplates$1();
|
|
1498
1498
|
}
|
|
1499
|
-
return template(chalk2, parts.join(""));
|
|
1499
|
+
return template$1(chalk2, parts.join(""));
|
|
1500
1500
|
};
|
|
1501
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
1502
|
-
const chalk = Chalk();
|
|
1503
|
-
chalk.supportsColor = stdoutColor;
|
|
1504
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1505
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
1506
|
-
var source = chalk;
|
|
1507
|
-
const chalk$
|
|
1501
|
+
Object.defineProperties(Chalk$1.prototype, styles$1);
|
|
1502
|
+
const chalk$1 = Chalk$1();
|
|
1503
|
+
chalk$1.supportsColor = stdoutColor$1;
|
|
1504
|
+
chalk$1.stderr = Chalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
|
|
1505
|
+
chalk$1.stderr.supportsColor = stderrColor$1;
|
|
1506
|
+
var source = chalk$1;
|
|
1507
|
+
const chalk$2 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
1508
1508
|
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
1509
1509
|
var sha256$1 = { exports: {} };
|
|
1510
1510
|
function commonjsRequire(path) {
|
|
@@ -1527,7 +1527,7 @@ function requireCore() {
|
|
|
1527
1527
|
{
|
|
1528
1528
|
module.exports = factory();
|
|
1529
1529
|
}
|
|
1530
|
-
})(commonjsGlobal, function() {
|
|
1530
|
+
})(commonjsGlobal$1, function() {
|
|
1531
1531
|
var CryptoJS = CryptoJS || function(Math2, undefined$1) {
|
|
1532
1532
|
var crypto2;
|
|
1533
1533
|
if (typeof window !== "undefined" && window.crypto) {
|
|
@@ -1542,8 +1542,8 @@ function requireCore() {
|
|
|
1542
1542
|
if (!crypto2 && typeof window !== "undefined" && window.msCrypto) {
|
|
1543
1543
|
crypto2 = window.msCrypto;
|
|
1544
1544
|
}
|
|
1545
|
-
if (!crypto2 && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
|
|
1546
|
-
crypto2 = commonjsGlobal.crypto;
|
|
1545
|
+
if (!crypto2 && typeof commonjsGlobal$1 !== "undefined" && commonjsGlobal$1.crypto) {
|
|
1546
|
+
crypto2 = commonjsGlobal$1.crypto;
|
|
1547
1547
|
}
|
|
1548
1548
|
if (!crypto2 && typeof commonjsRequire === "function") {
|
|
1549
1549
|
try {
|
|
@@ -2129,7 +2129,7 @@ function requireCore() {
|
|
|
2129
2129
|
{
|
|
2130
2130
|
module.exports = factory(requireCore());
|
|
2131
2131
|
}
|
|
2132
|
-
})(commonjsGlobal, function(CryptoJS) {
|
|
2132
|
+
})(commonjsGlobal$1, function(CryptoJS) {
|
|
2133
2133
|
(function(Math2) {
|
|
2134
2134
|
var C = CryptoJS;
|
|
2135
2135
|
var C_lib = C.lib;
|
|
@@ -2245,7 +2245,7 @@ var encBase64 = { exports: {} };
|
|
|
2245
2245
|
{
|
|
2246
2246
|
module.exports = factory(requireCore());
|
|
2247
2247
|
}
|
|
2248
|
-
})(commonjsGlobal, function(CryptoJS) {
|
|
2248
|
+
})(commonjsGlobal$1, function(CryptoJS) {
|
|
2249
2249
|
(function() {
|
|
2250
2250
|
var C = CryptoJS;
|
|
2251
2251
|
var C_lib = C.lib;
|
|
@@ -2535,6 +2535,3611 @@ const STSOauth2Store = defineStore("__sts__STSOauth2Store", {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
*/
|
|
2537
2537
|
});
|
|
2538
|
+
var lodash_clonedeep = { exports: {} };
|
|
2539
|
+
lodash_clonedeep.exports;
|
|
2540
|
+
(function(module, exports) {
|
|
2541
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
2542
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2543
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2544
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
2545
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
2546
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2547
|
+
var reFlags = /\w*$/;
|
|
2548
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2549
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2550
|
+
var cloneableTags = {};
|
|
2551
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
2552
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
2553
|
+
var freeGlobal = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
|
|
2554
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2555
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
2556
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2557
|
+
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2558
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2559
|
+
function addMapEntry(map, pair) {
|
|
2560
|
+
map.set(pair[0], pair[1]);
|
|
2561
|
+
return map;
|
|
2562
|
+
}
|
|
2563
|
+
function addSetEntry(set, value) {
|
|
2564
|
+
set.add(value);
|
|
2565
|
+
return set;
|
|
2566
|
+
}
|
|
2567
|
+
function arrayEach(array, iteratee) {
|
|
2568
|
+
var index = -1, length = array ? array.length : 0;
|
|
2569
|
+
while (++index < length) {
|
|
2570
|
+
if (iteratee(array[index], index, array) === false) {
|
|
2571
|
+
break;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
return array;
|
|
2575
|
+
}
|
|
2576
|
+
function arrayPush(array, values) {
|
|
2577
|
+
var index = -1, length = values.length, offset = array.length;
|
|
2578
|
+
while (++index < length) {
|
|
2579
|
+
array[offset + index] = values[index];
|
|
2580
|
+
}
|
|
2581
|
+
return array;
|
|
2582
|
+
}
|
|
2583
|
+
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2584
|
+
var index = -1, length = array ? array.length : 0;
|
|
2585
|
+
if (initAccum && length) {
|
|
2586
|
+
accumulator = array[++index];
|
|
2587
|
+
}
|
|
2588
|
+
while (++index < length) {
|
|
2589
|
+
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2590
|
+
}
|
|
2591
|
+
return accumulator;
|
|
2592
|
+
}
|
|
2593
|
+
function baseTimes(n, iteratee) {
|
|
2594
|
+
var index = -1, result = Array(n);
|
|
2595
|
+
while (++index < n) {
|
|
2596
|
+
result[index] = iteratee(index);
|
|
2597
|
+
}
|
|
2598
|
+
return result;
|
|
2599
|
+
}
|
|
2600
|
+
function getValue(object, key) {
|
|
2601
|
+
return object == null ? void 0 : object[key];
|
|
2602
|
+
}
|
|
2603
|
+
function isHostObject(value) {
|
|
2604
|
+
var result = false;
|
|
2605
|
+
if (value != null && typeof value.toString != "function") {
|
|
2606
|
+
try {
|
|
2607
|
+
result = !!(value + "");
|
|
2608
|
+
} catch (e) {
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
return result;
|
|
2612
|
+
}
|
|
2613
|
+
function mapToArray(map) {
|
|
2614
|
+
var index = -1, result = Array(map.size);
|
|
2615
|
+
map.forEach(function(value, key) {
|
|
2616
|
+
result[++index] = [key, value];
|
|
2617
|
+
});
|
|
2618
|
+
return result;
|
|
2619
|
+
}
|
|
2620
|
+
function overArg(func, transform) {
|
|
2621
|
+
return function(arg) {
|
|
2622
|
+
return func(transform(arg));
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
2625
|
+
function setToArray(set) {
|
|
2626
|
+
var index = -1, result = Array(set.size);
|
|
2627
|
+
set.forEach(function(value) {
|
|
2628
|
+
result[++index] = value;
|
|
2629
|
+
});
|
|
2630
|
+
return result;
|
|
2631
|
+
}
|
|
2632
|
+
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
|
|
2633
|
+
var coreJsData = root["__core-js_shared__"];
|
|
2634
|
+
var maskSrcKey = function() {
|
|
2635
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
2636
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
2637
|
+
}();
|
|
2638
|
+
var funcToString = funcProto.toString;
|
|
2639
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2640
|
+
var objectToString = objectProto.toString;
|
|
2641
|
+
var reIsNative = RegExp(
|
|
2642
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2643
|
+
);
|
|
2644
|
+
var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
|
|
2645
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
|
|
2646
|
+
var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
|
|
2647
|
+
var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
|
|
2648
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
2649
|
+
function Hash(entries) {
|
|
2650
|
+
var index = -1, length = entries ? entries.length : 0;
|
|
2651
|
+
this.clear();
|
|
2652
|
+
while (++index < length) {
|
|
2653
|
+
var entry = entries[index];
|
|
2654
|
+
this.set(entry[0], entry[1]);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
function hashClear() {
|
|
2658
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
2659
|
+
}
|
|
2660
|
+
function hashDelete(key) {
|
|
2661
|
+
return this.has(key) && delete this.__data__[key];
|
|
2662
|
+
}
|
|
2663
|
+
function hashGet(key) {
|
|
2664
|
+
var data = this.__data__;
|
|
2665
|
+
if (nativeCreate) {
|
|
2666
|
+
var result = data[key];
|
|
2667
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
2668
|
+
}
|
|
2669
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
2670
|
+
}
|
|
2671
|
+
function hashHas(key) {
|
|
2672
|
+
var data = this.__data__;
|
|
2673
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
2674
|
+
}
|
|
2675
|
+
function hashSet(key, value) {
|
|
2676
|
+
var data = this.__data__;
|
|
2677
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
2678
|
+
return this;
|
|
2679
|
+
}
|
|
2680
|
+
Hash.prototype.clear = hashClear;
|
|
2681
|
+
Hash.prototype["delete"] = hashDelete;
|
|
2682
|
+
Hash.prototype.get = hashGet;
|
|
2683
|
+
Hash.prototype.has = hashHas;
|
|
2684
|
+
Hash.prototype.set = hashSet;
|
|
2685
|
+
function ListCache(entries) {
|
|
2686
|
+
var index = -1, length = entries ? entries.length : 0;
|
|
2687
|
+
this.clear();
|
|
2688
|
+
while (++index < length) {
|
|
2689
|
+
var entry = entries[index];
|
|
2690
|
+
this.set(entry[0], entry[1]);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
function listCacheClear() {
|
|
2694
|
+
this.__data__ = [];
|
|
2695
|
+
}
|
|
2696
|
+
function listCacheDelete(key) {
|
|
2697
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2698
|
+
if (index < 0) {
|
|
2699
|
+
return false;
|
|
2700
|
+
}
|
|
2701
|
+
var lastIndex = data.length - 1;
|
|
2702
|
+
if (index == lastIndex) {
|
|
2703
|
+
data.pop();
|
|
2704
|
+
} else {
|
|
2705
|
+
splice.call(data, index, 1);
|
|
2706
|
+
}
|
|
2707
|
+
return true;
|
|
2708
|
+
}
|
|
2709
|
+
function listCacheGet(key) {
|
|
2710
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2711
|
+
return index < 0 ? void 0 : data[index][1];
|
|
2712
|
+
}
|
|
2713
|
+
function listCacheHas(key) {
|
|
2714
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
2715
|
+
}
|
|
2716
|
+
function listCacheSet(key, value) {
|
|
2717
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2718
|
+
if (index < 0) {
|
|
2719
|
+
data.push([key, value]);
|
|
2720
|
+
} else {
|
|
2721
|
+
data[index][1] = value;
|
|
2722
|
+
}
|
|
2723
|
+
return this;
|
|
2724
|
+
}
|
|
2725
|
+
ListCache.prototype.clear = listCacheClear;
|
|
2726
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
2727
|
+
ListCache.prototype.get = listCacheGet;
|
|
2728
|
+
ListCache.prototype.has = listCacheHas;
|
|
2729
|
+
ListCache.prototype.set = listCacheSet;
|
|
2730
|
+
function MapCache(entries) {
|
|
2731
|
+
var index = -1, length = entries ? entries.length : 0;
|
|
2732
|
+
this.clear();
|
|
2733
|
+
while (++index < length) {
|
|
2734
|
+
var entry = entries[index];
|
|
2735
|
+
this.set(entry[0], entry[1]);
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
function mapCacheClear() {
|
|
2739
|
+
this.__data__ = {
|
|
2740
|
+
"hash": new Hash(),
|
|
2741
|
+
"map": new (Map2 || ListCache)(),
|
|
2742
|
+
"string": new Hash()
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2745
|
+
function mapCacheDelete(key) {
|
|
2746
|
+
return getMapData(this, key)["delete"](key);
|
|
2747
|
+
}
|
|
2748
|
+
function mapCacheGet(key) {
|
|
2749
|
+
return getMapData(this, key).get(key);
|
|
2750
|
+
}
|
|
2751
|
+
function mapCacheHas(key) {
|
|
2752
|
+
return getMapData(this, key).has(key);
|
|
2753
|
+
}
|
|
2754
|
+
function mapCacheSet(key, value) {
|
|
2755
|
+
getMapData(this, key).set(key, value);
|
|
2756
|
+
return this;
|
|
2757
|
+
}
|
|
2758
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
2759
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
2760
|
+
MapCache.prototype.get = mapCacheGet;
|
|
2761
|
+
MapCache.prototype.has = mapCacheHas;
|
|
2762
|
+
MapCache.prototype.set = mapCacheSet;
|
|
2763
|
+
function Stack(entries) {
|
|
2764
|
+
this.__data__ = new ListCache(entries);
|
|
2765
|
+
}
|
|
2766
|
+
function stackClear() {
|
|
2767
|
+
this.__data__ = new ListCache();
|
|
2768
|
+
}
|
|
2769
|
+
function stackDelete(key) {
|
|
2770
|
+
return this.__data__["delete"](key);
|
|
2771
|
+
}
|
|
2772
|
+
function stackGet(key) {
|
|
2773
|
+
return this.__data__.get(key);
|
|
2774
|
+
}
|
|
2775
|
+
function stackHas(key) {
|
|
2776
|
+
return this.__data__.has(key);
|
|
2777
|
+
}
|
|
2778
|
+
function stackSet(key, value) {
|
|
2779
|
+
var cache = this.__data__;
|
|
2780
|
+
if (cache instanceof ListCache) {
|
|
2781
|
+
var pairs = cache.__data__;
|
|
2782
|
+
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2783
|
+
pairs.push([key, value]);
|
|
2784
|
+
return this;
|
|
2785
|
+
}
|
|
2786
|
+
cache = this.__data__ = new MapCache(pairs);
|
|
2787
|
+
}
|
|
2788
|
+
cache.set(key, value);
|
|
2789
|
+
return this;
|
|
2790
|
+
}
|
|
2791
|
+
Stack.prototype.clear = stackClear;
|
|
2792
|
+
Stack.prototype["delete"] = stackDelete;
|
|
2793
|
+
Stack.prototype.get = stackGet;
|
|
2794
|
+
Stack.prototype.has = stackHas;
|
|
2795
|
+
Stack.prototype.set = stackSet;
|
|
2796
|
+
function arrayLikeKeys(value, inherited) {
|
|
2797
|
+
var result = isArray2(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
2798
|
+
var length = result.length, skipIndexes = !!length;
|
|
2799
|
+
for (var key in value) {
|
|
2800
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
|
|
2801
|
+
result.push(key);
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
return result;
|
|
2805
|
+
}
|
|
2806
|
+
function assignValue(object, key, value) {
|
|
2807
|
+
var objValue = object[key];
|
|
2808
|
+
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
2809
|
+
object[key] = value;
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
function assocIndexOf(array, key) {
|
|
2813
|
+
var length = array.length;
|
|
2814
|
+
while (length--) {
|
|
2815
|
+
if (eq(array[length][0], key)) {
|
|
2816
|
+
return length;
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
return -1;
|
|
2820
|
+
}
|
|
2821
|
+
function baseAssign(object, source2) {
|
|
2822
|
+
return object && copyObject(source2, keys(source2), object);
|
|
2823
|
+
}
|
|
2824
|
+
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
|
2825
|
+
var result;
|
|
2826
|
+
if (customizer) {
|
|
2827
|
+
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
2828
|
+
}
|
|
2829
|
+
if (result !== void 0) {
|
|
2830
|
+
return result;
|
|
2831
|
+
}
|
|
2832
|
+
if (!isObject(value)) {
|
|
2833
|
+
return value;
|
|
2834
|
+
}
|
|
2835
|
+
var isArr = isArray2(value);
|
|
2836
|
+
if (isArr) {
|
|
2837
|
+
result = initCloneArray(value);
|
|
2838
|
+
if (!isDeep) {
|
|
2839
|
+
return copyArray(value, result);
|
|
2840
|
+
}
|
|
2841
|
+
} else {
|
|
2842
|
+
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
2843
|
+
if (isBuffer(value)) {
|
|
2844
|
+
return cloneBuffer(value, isDeep);
|
|
2845
|
+
}
|
|
2846
|
+
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
2847
|
+
if (isHostObject(value)) {
|
|
2848
|
+
return object ? value : {};
|
|
2849
|
+
}
|
|
2850
|
+
result = initCloneObject(isFunc ? {} : value);
|
|
2851
|
+
if (!isDeep) {
|
|
2852
|
+
return copySymbols(value, baseAssign(result, value));
|
|
2853
|
+
}
|
|
2854
|
+
} else {
|
|
2855
|
+
if (!cloneableTags[tag]) {
|
|
2856
|
+
return object ? value : {};
|
|
2857
|
+
}
|
|
2858
|
+
result = initCloneByTag(value, tag, baseClone, isDeep);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
stack || (stack = new Stack());
|
|
2862
|
+
var stacked = stack.get(value);
|
|
2863
|
+
if (stacked) {
|
|
2864
|
+
return stacked;
|
|
2865
|
+
}
|
|
2866
|
+
stack.set(value, result);
|
|
2867
|
+
if (!isArr) {
|
|
2868
|
+
var props = isFull ? getAllKeys(value) : keys(value);
|
|
2869
|
+
}
|
|
2870
|
+
arrayEach(props || value, function(subValue, key2) {
|
|
2871
|
+
if (props) {
|
|
2872
|
+
key2 = subValue;
|
|
2873
|
+
subValue = value[key2];
|
|
2874
|
+
}
|
|
2875
|
+
assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
|
|
2876
|
+
});
|
|
2877
|
+
return result;
|
|
2878
|
+
}
|
|
2879
|
+
function baseCreate(proto2) {
|
|
2880
|
+
return isObject(proto2) ? objectCreate(proto2) : {};
|
|
2881
|
+
}
|
|
2882
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
2883
|
+
var result = keysFunc(object);
|
|
2884
|
+
return isArray2(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2885
|
+
}
|
|
2886
|
+
function baseGetTag(value) {
|
|
2887
|
+
return objectToString.call(value);
|
|
2888
|
+
}
|
|
2889
|
+
function baseIsNative(value) {
|
|
2890
|
+
if (!isObject(value) || isMasked(value)) {
|
|
2891
|
+
return false;
|
|
2892
|
+
}
|
|
2893
|
+
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
2894
|
+
return pattern.test(toSource(value));
|
|
2895
|
+
}
|
|
2896
|
+
function baseKeys(object) {
|
|
2897
|
+
if (!isPrototype(object)) {
|
|
2898
|
+
return nativeKeys(object);
|
|
2899
|
+
}
|
|
2900
|
+
var result = [];
|
|
2901
|
+
for (var key in Object(object)) {
|
|
2902
|
+
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
2903
|
+
result.push(key);
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
return result;
|
|
2907
|
+
}
|
|
2908
|
+
function cloneBuffer(buffer, isDeep) {
|
|
2909
|
+
if (isDeep) {
|
|
2910
|
+
return buffer.slice();
|
|
2911
|
+
}
|
|
2912
|
+
var result = new buffer.constructor(buffer.length);
|
|
2913
|
+
buffer.copy(result);
|
|
2914
|
+
return result;
|
|
2915
|
+
}
|
|
2916
|
+
function cloneArrayBuffer(arrayBuffer) {
|
|
2917
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2918
|
+
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
|
|
2919
|
+
return result;
|
|
2920
|
+
}
|
|
2921
|
+
function cloneDataView(dataView, isDeep) {
|
|
2922
|
+
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
2923
|
+
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
2924
|
+
}
|
|
2925
|
+
function cloneMap(map, isDeep, cloneFunc) {
|
|
2926
|
+
var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
|
|
2927
|
+
return arrayReduce(array, addMapEntry, new map.constructor());
|
|
2928
|
+
}
|
|
2929
|
+
function cloneRegExp(regexp) {
|
|
2930
|
+
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
2931
|
+
result.lastIndex = regexp.lastIndex;
|
|
2932
|
+
return result;
|
|
2933
|
+
}
|
|
2934
|
+
function cloneSet(set, isDeep, cloneFunc) {
|
|
2935
|
+
var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
|
|
2936
|
+
return arrayReduce(array, addSetEntry, new set.constructor());
|
|
2937
|
+
}
|
|
2938
|
+
function cloneSymbol(symbol) {
|
|
2939
|
+
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
2940
|
+
}
|
|
2941
|
+
function cloneTypedArray(typedArray, isDeep) {
|
|
2942
|
+
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
2943
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
2944
|
+
}
|
|
2945
|
+
function copyArray(source2, array) {
|
|
2946
|
+
var index = -1, length = source2.length;
|
|
2947
|
+
array || (array = Array(length));
|
|
2948
|
+
while (++index < length) {
|
|
2949
|
+
array[index] = source2[index];
|
|
2950
|
+
}
|
|
2951
|
+
return array;
|
|
2952
|
+
}
|
|
2953
|
+
function copyObject(source2, props, object, customizer) {
|
|
2954
|
+
object || (object = {});
|
|
2955
|
+
var index = -1, length = props.length;
|
|
2956
|
+
while (++index < length) {
|
|
2957
|
+
var key = props[index];
|
|
2958
|
+
var newValue = customizer ? customizer(object[key], source2[key], key, object, source2) : void 0;
|
|
2959
|
+
assignValue(object, key, newValue === void 0 ? source2[key] : newValue);
|
|
2960
|
+
}
|
|
2961
|
+
return object;
|
|
2962
|
+
}
|
|
2963
|
+
function copySymbols(source2, object) {
|
|
2964
|
+
return copyObject(source2, getSymbols(source2), object);
|
|
2965
|
+
}
|
|
2966
|
+
function getAllKeys(object) {
|
|
2967
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
2968
|
+
}
|
|
2969
|
+
function getMapData(map, key) {
|
|
2970
|
+
var data = map.__data__;
|
|
2971
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2972
|
+
}
|
|
2973
|
+
function getNative(object, key) {
|
|
2974
|
+
var value = getValue(object, key);
|
|
2975
|
+
return baseIsNative(value) ? value : void 0;
|
|
2976
|
+
}
|
|
2977
|
+
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
|
|
2978
|
+
var getTag = baseGetTag;
|
|
2979
|
+
if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
2980
|
+
getTag = function(value) {
|
|
2981
|
+
var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
|
|
2982
|
+
if (ctorString) {
|
|
2983
|
+
switch (ctorString) {
|
|
2984
|
+
case dataViewCtorString:
|
|
2985
|
+
return dataViewTag;
|
|
2986
|
+
case mapCtorString:
|
|
2987
|
+
return mapTag;
|
|
2988
|
+
case promiseCtorString:
|
|
2989
|
+
return promiseTag;
|
|
2990
|
+
case setCtorString:
|
|
2991
|
+
return setTag;
|
|
2992
|
+
case weakMapCtorString:
|
|
2993
|
+
return weakMapTag;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
return result;
|
|
2997
|
+
};
|
|
2998
|
+
}
|
|
2999
|
+
function initCloneArray(array) {
|
|
3000
|
+
var length = array.length, result = array.constructor(length);
|
|
3001
|
+
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
3002
|
+
result.index = array.index;
|
|
3003
|
+
result.input = array.input;
|
|
3004
|
+
}
|
|
3005
|
+
return result;
|
|
3006
|
+
}
|
|
3007
|
+
function initCloneObject(object) {
|
|
3008
|
+
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
3009
|
+
}
|
|
3010
|
+
function initCloneByTag(object, tag, cloneFunc, isDeep) {
|
|
3011
|
+
var Ctor = object.constructor;
|
|
3012
|
+
switch (tag) {
|
|
3013
|
+
case arrayBufferTag:
|
|
3014
|
+
return cloneArrayBuffer(object);
|
|
3015
|
+
case boolTag:
|
|
3016
|
+
case dateTag:
|
|
3017
|
+
return new Ctor(+object);
|
|
3018
|
+
case dataViewTag:
|
|
3019
|
+
return cloneDataView(object, isDeep);
|
|
3020
|
+
case float32Tag:
|
|
3021
|
+
case float64Tag:
|
|
3022
|
+
case int8Tag:
|
|
3023
|
+
case int16Tag:
|
|
3024
|
+
case int32Tag:
|
|
3025
|
+
case uint8Tag:
|
|
3026
|
+
case uint8ClampedTag:
|
|
3027
|
+
case uint16Tag:
|
|
3028
|
+
case uint32Tag:
|
|
3029
|
+
return cloneTypedArray(object, isDeep);
|
|
3030
|
+
case mapTag:
|
|
3031
|
+
return cloneMap(object, isDeep, cloneFunc);
|
|
3032
|
+
case numberTag:
|
|
3033
|
+
case stringTag:
|
|
3034
|
+
return new Ctor(object);
|
|
3035
|
+
case regexpTag:
|
|
3036
|
+
return cloneRegExp(object);
|
|
3037
|
+
case setTag:
|
|
3038
|
+
return cloneSet(object, isDeep, cloneFunc);
|
|
3039
|
+
case symbolTag:
|
|
3040
|
+
return cloneSymbol(object);
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
function isIndex(value, length) {
|
|
3044
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3045
|
+
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3046
|
+
}
|
|
3047
|
+
function isKeyable(value) {
|
|
3048
|
+
var type = typeof value;
|
|
3049
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
3050
|
+
}
|
|
3051
|
+
function isMasked(func) {
|
|
3052
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
3053
|
+
}
|
|
3054
|
+
function isPrototype(value) {
|
|
3055
|
+
var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
3056
|
+
return value === proto2;
|
|
3057
|
+
}
|
|
3058
|
+
function toSource(func) {
|
|
3059
|
+
if (func != null) {
|
|
3060
|
+
try {
|
|
3061
|
+
return funcToString.call(func);
|
|
3062
|
+
} catch (e) {
|
|
3063
|
+
}
|
|
3064
|
+
try {
|
|
3065
|
+
return func + "";
|
|
3066
|
+
} catch (e) {
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
return "";
|
|
3070
|
+
}
|
|
3071
|
+
function cloneDeep(value) {
|
|
3072
|
+
return baseClone(value, true, true);
|
|
3073
|
+
}
|
|
3074
|
+
function eq(value, other) {
|
|
3075
|
+
return value === other || value !== value && other !== other;
|
|
3076
|
+
}
|
|
3077
|
+
function isArguments(value) {
|
|
3078
|
+
return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
|
|
3079
|
+
}
|
|
3080
|
+
var isArray2 = Array.isArray;
|
|
3081
|
+
function isArrayLike(value) {
|
|
3082
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
3083
|
+
}
|
|
3084
|
+
function isArrayLikeObject(value) {
|
|
3085
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
3086
|
+
}
|
|
3087
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
3088
|
+
function isFunction(value) {
|
|
3089
|
+
var tag = isObject(value) ? objectToString.call(value) : "";
|
|
3090
|
+
return tag == funcTag || tag == genTag;
|
|
3091
|
+
}
|
|
3092
|
+
function isLength(value) {
|
|
3093
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3094
|
+
}
|
|
3095
|
+
function isObject(value) {
|
|
3096
|
+
var type = typeof value;
|
|
3097
|
+
return !!value && (type == "object" || type == "function");
|
|
3098
|
+
}
|
|
3099
|
+
function isObjectLike(value) {
|
|
3100
|
+
return !!value && typeof value == "object";
|
|
3101
|
+
}
|
|
3102
|
+
function keys(object) {
|
|
3103
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
3104
|
+
}
|
|
3105
|
+
function stubArray() {
|
|
3106
|
+
return [];
|
|
3107
|
+
}
|
|
3108
|
+
function stubFalse() {
|
|
3109
|
+
return false;
|
|
3110
|
+
}
|
|
3111
|
+
module.exports = cloneDeep;
|
|
3112
|
+
})(lodash_clonedeep, lodash_clonedeep.exports);
|
|
3113
|
+
lodash_clonedeep.exports;
|
|
3114
|
+
var tinyEmitter = { exports: {} };
|
|
3115
|
+
function E() {
|
|
3116
|
+
}
|
|
3117
|
+
E.prototype = {
|
|
3118
|
+
on: function(name, callback, ctx) {
|
|
3119
|
+
var e = this.e || (this.e = {});
|
|
3120
|
+
(e[name] || (e[name] = [])).push({
|
|
3121
|
+
fn: callback,
|
|
3122
|
+
ctx
|
|
3123
|
+
});
|
|
3124
|
+
return this;
|
|
3125
|
+
},
|
|
3126
|
+
once: function(name, callback, ctx) {
|
|
3127
|
+
var self2 = this;
|
|
3128
|
+
function listener() {
|
|
3129
|
+
self2.off(name, listener);
|
|
3130
|
+
callback.apply(ctx, arguments);
|
|
3131
|
+
}
|
|
3132
|
+
listener._ = callback;
|
|
3133
|
+
return this.on(name, listener, ctx);
|
|
3134
|
+
},
|
|
3135
|
+
emit: function(name) {
|
|
3136
|
+
var data = [].slice.call(arguments, 1);
|
|
3137
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
3138
|
+
var i = 0;
|
|
3139
|
+
var len = evtArr.length;
|
|
3140
|
+
for (i; i < len; i++) {
|
|
3141
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
3142
|
+
}
|
|
3143
|
+
return this;
|
|
3144
|
+
},
|
|
3145
|
+
off: function(name, callback) {
|
|
3146
|
+
var e = this.e || (this.e = {});
|
|
3147
|
+
var evts = e[name];
|
|
3148
|
+
var liveEvents = [];
|
|
3149
|
+
if (evts && callback) {
|
|
3150
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
|
3151
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
|
3152
|
+
liveEvents.push(evts[i]);
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
liveEvents.length ? e[name] = liveEvents : delete e[name];
|
|
3156
|
+
return this;
|
|
3157
|
+
}
|
|
3158
|
+
};
|
|
3159
|
+
tinyEmitter.exports = E;
|
|
3160
|
+
tinyEmitter.exports.TinyEmitter = E;
|
|
3161
|
+
var __defProp2 = Object.defineProperty;
|
|
3162
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3163
|
+
var __publicField2 = (obj, key, value) => {
|
|
3164
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3165
|
+
return value;
|
|
3166
|
+
};
|
|
3167
|
+
var Gauge = /* @__PURE__ */ ((Gauge2) => {
|
|
3168
|
+
Gauge2["ACTIVE_REQUEST_GAUGE"] = "a";
|
|
3169
|
+
Gauge2["AUTHENTICATION_COUNT_GAUGE"] = "b";
|
|
3170
|
+
Gauge2["AUTHENTICATION_ERROR_COUNT_GAUGE"] = "aa";
|
|
3171
|
+
Gauge2["AUTHENTICATION_RETRY_COUNT_GAUGE"] = "ab";
|
|
3172
|
+
Gauge2["CONNECTION_POOL_IDLE_GAUGE"] = "c";
|
|
3173
|
+
Gauge2["CONNECTION_POOL_TOTAL_GAUGE"] = "d";
|
|
3174
|
+
Gauge2["CONNECTION_POOL_WAITING_GAUGE"] = "e";
|
|
3175
|
+
Gauge2["CPU_LOAD_GAUGE"] = "f";
|
|
3176
|
+
Gauge2["CPU_SYSTEM_LOAD_GAUGE"] = "g";
|
|
3177
|
+
Gauge2["DURATION_GAUGE"] = "h";
|
|
3178
|
+
Gauge2["DURATION_HISTOGRAM_GAUGE"] = "i";
|
|
3179
|
+
Gauge2["ERROR_COUNT_GAUGE"] = "j";
|
|
3180
|
+
Gauge2["LATENCY_GAUGE"] = "k";
|
|
3181
|
+
Gauge2["LATENCY_HISTOGRAM_GAUGE"] = "l";
|
|
3182
|
+
Gauge2["LOGGER"] = "m";
|
|
3183
|
+
Gauge2["LOGGER_COPY"] = "n";
|
|
3184
|
+
Gauge2["NETWORK_RX_GAUGE"] = "o";
|
|
3185
|
+
Gauge2["NETWORK_TX_GAUGE"] = "p";
|
|
3186
|
+
Gauge2["REQUEST_COUNT_GAUGE"] = "q";
|
|
3187
|
+
Gauge2["RETRY_COUNT_GAUGE"] = "r";
|
|
3188
|
+
Gauge2["TIMER_GAUGE"] = "s";
|
|
3189
|
+
Gauge2["VELOCITY_GAUGE"] = "t";
|
|
3190
|
+
Gauge2["CONNECTION_COUNT_GAUGE"] = "u";
|
|
3191
|
+
Gauge2["OBJECT_GAUGE"] = "v";
|
|
3192
|
+
Gauge2["PAYLOAD_SIZE"] = "w";
|
|
3193
|
+
Gauge2["CORE_COUNT_GAUGE"] = "x";
|
|
3194
|
+
Gauge2["CHILD_COUNT"] = "y";
|
|
3195
|
+
Gauge2["UNKNOWN"] = "z";
|
|
3196
|
+
return Gauge2;
|
|
3197
|
+
})(Gauge || {});
|
|
3198
|
+
var GaugeTypes = /* @__PURE__ */ ((GaugeTypes2) => {
|
|
3199
|
+
GaugeTypes2["GAUGE_TYPE"] = "_";
|
|
3200
|
+
GaugeTypes2["INSTRUMENT_GAUGE"] = "a";
|
|
3201
|
+
GaugeTypes2["INSTRUMENT_VELOCITY"] = "b";
|
|
3202
|
+
GaugeTypes2["INSTRUMENT_HISTOGRAM"] = "c";
|
|
3203
|
+
GaugeTypes2["INSTRUMENT_LOG"] = "d";
|
|
3204
|
+
GaugeTypes2["INSTRUMENT_TIMER"] = "e";
|
|
3205
|
+
GaugeTypes2["INSTRUMENT_OBJECT"] = "f";
|
|
3206
|
+
return GaugeTypes2;
|
|
3207
|
+
})(GaugeTypes || {});
|
|
3208
|
+
GaugeTypes.GAUGE_TYPE;
|
|
3209
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3210
|
+
var timsort$1 = {};
|
|
3211
|
+
(function(exports) {
|
|
3212
|
+
(function(global2, factory) {
|
|
3213
|
+
{
|
|
3214
|
+
factory(exports);
|
|
3215
|
+
}
|
|
3216
|
+
})(commonjsGlobal, function(exports2) {
|
|
3217
|
+
exports2.__esModule = true;
|
|
3218
|
+
exports2.sort = sort;
|
|
3219
|
+
function _classCallCheck(instance, Constructor) {
|
|
3220
|
+
if (!(instance instanceof Constructor)) {
|
|
3221
|
+
throw new TypeError("Cannot call a class as a function");
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
var DEFAULT_MIN_MERGE = 32;
|
|
3225
|
+
var DEFAULT_MIN_GALLOPING = 7;
|
|
3226
|
+
var DEFAULT_TMP_STORAGE_LENGTH = 256;
|
|
3227
|
+
var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
|
|
3228
|
+
function log10(x) {
|
|
3229
|
+
if (x < 1e5) {
|
|
3230
|
+
if (x < 100) {
|
|
3231
|
+
return x < 10 ? 0 : 1;
|
|
3232
|
+
}
|
|
3233
|
+
if (x < 1e4) {
|
|
3234
|
+
return x < 1e3 ? 2 : 3;
|
|
3235
|
+
}
|
|
3236
|
+
return 4;
|
|
3237
|
+
}
|
|
3238
|
+
if (x < 1e7) {
|
|
3239
|
+
return x < 1e6 ? 5 : 6;
|
|
3240
|
+
}
|
|
3241
|
+
if (x < 1e9) {
|
|
3242
|
+
return x < 1e8 ? 7 : 8;
|
|
3243
|
+
}
|
|
3244
|
+
return 9;
|
|
3245
|
+
}
|
|
3246
|
+
function alphabeticalCompare(a, b) {
|
|
3247
|
+
if (a === b) {
|
|
3248
|
+
return 0;
|
|
3249
|
+
}
|
|
3250
|
+
if (~~a === a && ~~b === b) {
|
|
3251
|
+
if (a === 0 || b === 0) {
|
|
3252
|
+
return a < b ? -1 : 1;
|
|
3253
|
+
}
|
|
3254
|
+
if (a < 0 || b < 0) {
|
|
3255
|
+
if (b >= 0) {
|
|
3256
|
+
return -1;
|
|
3257
|
+
}
|
|
3258
|
+
if (a >= 0) {
|
|
3259
|
+
return 1;
|
|
3260
|
+
}
|
|
3261
|
+
a = -a;
|
|
3262
|
+
b = -b;
|
|
3263
|
+
}
|
|
3264
|
+
var al = log10(a);
|
|
3265
|
+
var bl = log10(b);
|
|
3266
|
+
var t = 0;
|
|
3267
|
+
if (al < bl) {
|
|
3268
|
+
a *= POWERS_OF_TEN[bl - al - 1];
|
|
3269
|
+
b /= 10;
|
|
3270
|
+
t = -1;
|
|
3271
|
+
} else if (al > bl) {
|
|
3272
|
+
b *= POWERS_OF_TEN[al - bl - 1];
|
|
3273
|
+
a /= 10;
|
|
3274
|
+
t = 1;
|
|
3275
|
+
}
|
|
3276
|
+
if (a === b) {
|
|
3277
|
+
return t;
|
|
3278
|
+
}
|
|
3279
|
+
return a < b ? -1 : 1;
|
|
3280
|
+
}
|
|
3281
|
+
var aStr = String(a);
|
|
3282
|
+
var bStr = String(b);
|
|
3283
|
+
if (aStr === bStr) {
|
|
3284
|
+
return 0;
|
|
3285
|
+
}
|
|
3286
|
+
return aStr < bStr ? -1 : 1;
|
|
3287
|
+
}
|
|
3288
|
+
function minRunLength(n) {
|
|
3289
|
+
var r = 0;
|
|
3290
|
+
while (n >= DEFAULT_MIN_MERGE) {
|
|
3291
|
+
r |= n & 1;
|
|
3292
|
+
n >>= 1;
|
|
3293
|
+
}
|
|
3294
|
+
return n + r;
|
|
3295
|
+
}
|
|
3296
|
+
function makeAscendingRun(array, lo, hi, compare) {
|
|
3297
|
+
var runHi = lo + 1;
|
|
3298
|
+
if (runHi === hi) {
|
|
3299
|
+
return 1;
|
|
3300
|
+
}
|
|
3301
|
+
if (compare(array[runHi++], array[lo]) < 0) {
|
|
3302
|
+
while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
|
|
3303
|
+
runHi++;
|
|
3304
|
+
}
|
|
3305
|
+
reverseRun(array, lo, runHi);
|
|
3306
|
+
} else {
|
|
3307
|
+
while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
|
|
3308
|
+
runHi++;
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
return runHi - lo;
|
|
3312
|
+
}
|
|
3313
|
+
function reverseRun(array, lo, hi) {
|
|
3314
|
+
hi--;
|
|
3315
|
+
while (lo < hi) {
|
|
3316
|
+
var t = array[lo];
|
|
3317
|
+
array[lo++] = array[hi];
|
|
3318
|
+
array[hi--] = t;
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
function binaryInsertionSort(array, lo, hi, start, compare) {
|
|
3322
|
+
if (start === lo) {
|
|
3323
|
+
start++;
|
|
3324
|
+
}
|
|
3325
|
+
for (; start < hi; start++) {
|
|
3326
|
+
var pivot = array[start];
|
|
3327
|
+
var left = lo;
|
|
3328
|
+
var right = start;
|
|
3329
|
+
while (left < right) {
|
|
3330
|
+
var mid = left + right >>> 1;
|
|
3331
|
+
if (compare(pivot, array[mid]) < 0) {
|
|
3332
|
+
right = mid;
|
|
3333
|
+
} else {
|
|
3334
|
+
left = mid + 1;
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
var n = start - left;
|
|
3338
|
+
switch (n) {
|
|
3339
|
+
case 3:
|
|
3340
|
+
array[left + 3] = array[left + 2];
|
|
3341
|
+
case 2:
|
|
3342
|
+
array[left + 2] = array[left + 1];
|
|
3343
|
+
case 1:
|
|
3344
|
+
array[left + 1] = array[left];
|
|
3345
|
+
break;
|
|
3346
|
+
default:
|
|
3347
|
+
while (n > 0) {
|
|
3348
|
+
array[left + n] = array[left + n - 1];
|
|
3349
|
+
n--;
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
array[left] = pivot;
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
function gallopLeft(value, array, start, length, hint, compare) {
|
|
3356
|
+
var lastOffset = 0;
|
|
3357
|
+
var maxOffset = 0;
|
|
3358
|
+
var offset = 1;
|
|
3359
|
+
if (compare(value, array[start + hint]) > 0) {
|
|
3360
|
+
maxOffset = length - hint;
|
|
3361
|
+
while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
|
|
3362
|
+
lastOffset = offset;
|
|
3363
|
+
offset = (offset << 1) + 1;
|
|
3364
|
+
if (offset <= 0) {
|
|
3365
|
+
offset = maxOffset;
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
if (offset > maxOffset) {
|
|
3369
|
+
offset = maxOffset;
|
|
3370
|
+
}
|
|
3371
|
+
lastOffset += hint;
|
|
3372
|
+
offset += hint;
|
|
3373
|
+
} else {
|
|
3374
|
+
maxOffset = hint + 1;
|
|
3375
|
+
while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
|
|
3376
|
+
lastOffset = offset;
|
|
3377
|
+
offset = (offset << 1) + 1;
|
|
3378
|
+
if (offset <= 0) {
|
|
3379
|
+
offset = maxOffset;
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
if (offset > maxOffset) {
|
|
3383
|
+
offset = maxOffset;
|
|
3384
|
+
}
|
|
3385
|
+
var tmp = lastOffset;
|
|
3386
|
+
lastOffset = hint - offset;
|
|
3387
|
+
offset = hint - tmp;
|
|
3388
|
+
}
|
|
3389
|
+
lastOffset++;
|
|
3390
|
+
while (lastOffset < offset) {
|
|
3391
|
+
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
3392
|
+
if (compare(value, array[start + m]) > 0) {
|
|
3393
|
+
lastOffset = m + 1;
|
|
3394
|
+
} else {
|
|
3395
|
+
offset = m;
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
return offset;
|
|
3399
|
+
}
|
|
3400
|
+
function gallopRight(value, array, start, length, hint, compare) {
|
|
3401
|
+
var lastOffset = 0;
|
|
3402
|
+
var maxOffset = 0;
|
|
3403
|
+
var offset = 1;
|
|
3404
|
+
if (compare(value, array[start + hint]) < 0) {
|
|
3405
|
+
maxOffset = hint + 1;
|
|
3406
|
+
while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
|
|
3407
|
+
lastOffset = offset;
|
|
3408
|
+
offset = (offset << 1) + 1;
|
|
3409
|
+
if (offset <= 0) {
|
|
3410
|
+
offset = maxOffset;
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
if (offset > maxOffset) {
|
|
3414
|
+
offset = maxOffset;
|
|
3415
|
+
}
|
|
3416
|
+
var tmp = lastOffset;
|
|
3417
|
+
lastOffset = hint - offset;
|
|
3418
|
+
offset = hint - tmp;
|
|
3419
|
+
} else {
|
|
3420
|
+
maxOffset = length - hint;
|
|
3421
|
+
while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
|
|
3422
|
+
lastOffset = offset;
|
|
3423
|
+
offset = (offset << 1) + 1;
|
|
3424
|
+
if (offset <= 0) {
|
|
3425
|
+
offset = maxOffset;
|
|
3426
|
+
}
|
|
3427
|
+
}
|
|
3428
|
+
if (offset > maxOffset) {
|
|
3429
|
+
offset = maxOffset;
|
|
3430
|
+
}
|
|
3431
|
+
lastOffset += hint;
|
|
3432
|
+
offset += hint;
|
|
3433
|
+
}
|
|
3434
|
+
lastOffset++;
|
|
3435
|
+
while (lastOffset < offset) {
|
|
3436
|
+
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
3437
|
+
if (compare(value, array[start + m]) < 0) {
|
|
3438
|
+
offset = m;
|
|
3439
|
+
} else {
|
|
3440
|
+
lastOffset = m + 1;
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
return offset;
|
|
3444
|
+
}
|
|
3445
|
+
var TimSort = function() {
|
|
3446
|
+
function TimSort2(array, compare) {
|
|
3447
|
+
_classCallCheck(this, TimSort2);
|
|
3448
|
+
this.array = null;
|
|
3449
|
+
this.compare = null;
|
|
3450
|
+
this.minGallop = DEFAULT_MIN_GALLOPING;
|
|
3451
|
+
this.length = 0;
|
|
3452
|
+
this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
|
|
3453
|
+
this.stackLength = 0;
|
|
3454
|
+
this.runStart = null;
|
|
3455
|
+
this.runLength = null;
|
|
3456
|
+
this.stackSize = 0;
|
|
3457
|
+
this.array = array;
|
|
3458
|
+
this.compare = compare;
|
|
3459
|
+
this.length = array.length;
|
|
3460
|
+
if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
|
|
3461
|
+
this.tmpStorageLength = this.length >>> 1;
|
|
3462
|
+
}
|
|
3463
|
+
this.tmp = new Array(this.tmpStorageLength);
|
|
3464
|
+
this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
|
|
3465
|
+
this.runStart = new Array(this.stackLength);
|
|
3466
|
+
this.runLength = new Array(this.stackLength);
|
|
3467
|
+
}
|
|
3468
|
+
TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
|
|
3469
|
+
this.runStart[this.stackSize] = runStart;
|
|
3470
|
+
this.runLength[this.stackSize] = runLength;
|
|
3471
|
+
this.stackSize += 1;
|
|
3472
|
+
};
|
|
3473
|
+
TimSort2.prototype.mergeRuns = function mergeRuns() {
|
|
3474
|
+
while (this.stackSize > 1) {
|
|
3475
|
+
var n = this.stackSize - 2;
|
|
3476
|
+
if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
|
|
3477
|
+
if (this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
3478
|
+
n--;
|
|
3479
|
+
}
|
|
3480
|
+
} else if (this.runLength[n] > this.runLength[n + 1]) {
|
|
3481
|
+
break;
|
|
3482
|
+
}
|
|
3483
|
+
this.mergeAt(n);
|
|
3484
|
+
}
|
|
3485
|
+
};
|
|
3486
|
+
TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
|
|
3487
|
+
while (this.stackSize > 1) {
|
|
3488
|
+
var n = this.stackSize - 2;
|
|
3489
|
+
if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
3490
|
+
n--;
|
|
3491
|
+
}
|
|
3492
|
+
this.mergeAt(n);
|
|
3493
|
+
}
|
|
3494
|
+
};
|
|
3495
|
+
TimSort2.prototype.mergeAt = function mergeAt(i) {
|
|
3496
|
+
var compare = this.compare;
|
|
3497
|
+
var array = this.array;
|
|
3498
|
+
var start1 = this.runStart[i];
|
|
3499
|
+
var length1 = this.runLength[i];
|
|
3500
|
+
var start2 = this.runStart[i + 1];
|
|
3501
|
+
var length2 = this.runLength[i + 1];
|
|
3502
|
+
this.runLength[i] = length1 + length2;
|
|
3503
|
+
if (i === this.stackSize - 3) {
|
|
3504
|
+
this.runStart[i + 1] = this.runStart[i + 2];
|
|
3505
|
+
this.runLength[i + 1] = this.runLength[i + 2];
|
|
3506
|
+
}
|
|
3507
|
+
this.stackSize--;
|
|
3508
|
+
var k = gallopRight(array[start2], array, start1, length1, 0, compare);
|
|
3509
|
+
start1 += k;
|
|
3510
|
+
length1 -= k;
|
|
3511
|
+
if (length1 === 0) {
|
|
3512
|
+
return;
|
|
3513
|
+
}
|
|
3514
|
+
length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
|
|
3515
|
+
if (length2 === 0) {
|
|
3516
|
+
return;
|
|
3517
|
+
}
|
|
3518
|
+
if (length1 <= length2) {
|
|
3519
|
+
this.mergeLow(start1, length1, start2, length2);
|
|
3520
|
+
} else {
|
|
3521
|
+
this.mergeHigh(start1, length1, start2, length2);
|
|
3522
|
+
}
|
|
3523
|
+
};
|
|
3524
|
+
TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
|
|
3525
|
+
var compare = this.compare;
|
|
3526
|
+
var array = this.array;
|
|
3527
|
+
var tmp = this.tmp;
|
|
3528
|
+
var i = 0;
|
|
3529
|
+
for (i = 0; i < length1; i++) {
|
|
3530
|
+
tmp[i] = array[start1 + i];
|
|
3531
|
+
}
|
|
3532
|
+
var cursor1 = 0;
|
|
3533
|
+
var cursor2 = start2;
|
|
3534
|
+
var dest = start1;
|
|
3535
|
+
array[dest++] = array[cursor2++];
|
|
3536
|
+
if (--length2 === 0) {
|
|
3537
|
+
for (i = 0; i < length1; i++) {
|
|
3538
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
3539
|
+
}
|
|
3540
|
+
return;
|
|
3541
|
+
}
|
|
3542
|
+
if (length1 === 1) {
|
|
3543
|
+
for (i = 0; i < length2; i++) {
|
|
3544
|
+
array[dest + i] = array[cursor2 + i];
|
|
3545
|
+
}
|
|
3546
|
+
array[dest + length2] = tmp[cursor1];
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
var minGallop = this.minGallop;
|
|
3550
|
+
while (true) {
|
|
3551
|
+
var count1 = 0;
|
|
3552
|
+
var count2 = 0;
|
|
3553
|
+
var exit = false;
|
|
3554
|
+
do {
|
|
3555
|
+
if (compare(array[cursor2], tmp[cursor1]) < 0) {
|
|
3556
|
+
array[dest++] = array[cursor2++];
|
|
3557
|
+
count2++;
|
|
3558
|
+
count1 = 0;
|
|
3559
|
+
if (--length2 === 0) {
|
|
3560
|
+
exit = true;
|
|
3561
|
+
break;
|
|
3562
|
+
}
|
|
3563
|
+
} else {
|
|
3564
|
+
array[dest++] = tmp[cursor1++];
|
|
3565
|
+
count1++;
|
|
3566
|
+
count2 = 0;
|
|
3567
|
+
if (--length1 === 1) {
|
|
3568
|
+
exit = true;
|
|
3569
|
+
break;
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
} while ((count1 | count2) < minGallop);
|
|
3573
|
+
if (exit) {
|
|
3574
|
+
break;
|
|
3575
|
+
}
|
|
3576
|
+
do {
|
|
3577
|
+
count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
|
|
3578
|
+
if (count1 !== 0) {
|
|
3579
|
+
for (i = 0; i < count1; i++) {
|
|
3580
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
3581
|
+
}
|
|
3582
|
+
dest += count1;
|
|
3583
|
+
cursor1 += count1;
|
|
3584
|
+
length1 -= count1;
|
|
3585
|
+
if (length1 <= 1) {
|
|
3586
|
+
exit = true;
|
|
3587
|
+
break;
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
array[dest++] = array[cursor2++];
|
|
3591
|
+
if (--length2 === 0) {
|
|
3592
|
+
exit = true;
|
|
3593
|
+
break;
|
|
3594
|
+
}
|
|
3595
|
+
count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
|
|
3596
|
+
if (count2 !== 0) {
|
|
3597
|
+
for (i = 0; i < count2; i++) {
|
|
3598
|
+
array[dest + i] = array[cursor2 + i];
|
|
3599
|
+
}
|
|
3600
|
+
dest += count2;
|
|
3601
|
+
cursor2 += count2;
|
|
3602
|
+
length2 -= count2;
|
|
3603
|
+
if (length2 === 0) {
|
|
3604
|
+
exit = true;
|
|
3605
|
+
break;
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
array[dest++] = tmp[cursor1++];
|
|
3609
|
+
if (--length1 === 1) {
|
|
3610
|
+
exit = true;
|
|
3611
|
+
break;
|
|
3612
|
+
}
|
|
3613
|
+
minGallop--;
|
|
3614
|
+
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
3615
|
+
if (exit) {
|
|
3616
|
+
break;
|
|
3617
|
+
}
|
|
3618
|
+
if (minGallop < 0) {
|
|
3619
|
+
minGallop = 0;
|
|
3620
|
+
}
|
|
3621
|
+
minGallop += 2;
|
|
3622
|
+
}
|
|
3623
|
+
this.minGallop = minGallop;
|
|
3624
|
+
if (minGallop < 1) {
|
|
3625
|
+
this.minGallop = 1;
|
|
3626
|
+
}
|
|
3627
|
+
if (length1 === 1) {
|
|
3628
|
+
for (i = 0; i < length2; i++) {
|
|
3629
|
+
array[dest + i] = array[cursor2 + i];
|
|
3630
|
+
}
|
|
3631
|
+
array[dest + length2] = tmp[cursor1];
|
|
3632
|
+
} else if (length1 === 0) {
|
|
3633
|
+
throw new Error("mergeLow preconditions were not respected");
|
|
3634
|
+
} else {
|
|
3635
|
+
for (i = 0; i < length1; i++) {
|
|
3636
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
};
|
|
3640
|
+
TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
|
|
3641
|
+
var compare = this.compare;
|
|
3642
|
+
var array = this.array;
|
|
3643
|
+
var tmp = this.tmp;
|
|
3644
|
+
var i = 0;
|
|
3645
|
+
for (i = 0; i < length2; i++) {
|
|
3646
|
+
tmp[i] = array[start2 + i];
|
|
3647
|
+
}
|
|
3648
|
+
var cursor1 = start1 + length1 - 1;
|
|
3649
|
+
var cursor2 = length2 - 1;
|
|
3650
|
+
var dest = start2 + length2 - 1;
|
|
3651
|
+
var customCursor = 0;
|
|
3652
|
+
var customDest = 0;
|
|
3653
|
+
array[dest--] = array[cursor1--];
|
|
3654
|
+
if (--length1 === 0) {
|
|
3655
|
+
customCursor = dest - (length2 - 1);
|
|
3656
|
+
for (i = 0; i < length2; i++) {
|
|
3657
|
+
array[customCursor + i] = tmp[i];
|
|
3658
|
+
}
|
|
3659
|
+
return;
|
|
3660
|
+
}
|
|
3661
|
+
if (length2 === 1) {
|
|
3662
|
+
dest -= length1;
|
|
3663
|
+
cursor1 -= length1;
|
|
3664
|
+
customDest = dest + 1;
|
|
3665
|
+
customCursor = cursor1 + 1;
|
|
3666
|
+
for (i = length1 - 1; i >= 0; i--) {
|
|
3667
|
+
array[customDest + i] = array[customCursor + i];
|
|
3668
|
+
}
|
|
3669
|
+
array[dest] = tmp[cursor2];
|
|
3670
|
+
return;
|
|
3671
|
+
}
|
|
3672
|
+
var minGallop = this.minGallop;
|
|
3673
|
+
while (true) {
|
|
3674
|
+
var count1 = 0;
|
|
3675
|
+
var count2 = 0;
|
|
3676
|
+
var exit = false;
|
|
3677
|
+
do {
|
|
3678
|
+
if (compare(tmp[cursor2], array[cursor1]) < 0) {
|
|
3679
|
+
array[dest--] = array[cursor1--];
|
|
3680
|
+
count1++;
|
|
3681
|
+
count2 = 0;
|
|
3682
|
+
if (--length1 === 0) {
|
|
3683
|
+
exit = true;
|
|
3684
|
+
break;
|
|
3685
|
+
}
|
|
3686
|
+
} else {
|
|
3687
|
+
array[dest--] = tmp[cursor2--];
|
|
3688
|
+
count2++;
|
|
3689
|
+
count1 = 0;
|
|
3690
|
+
if (--length2 === 1) {
|
|
3691
|
+
exit = true;
|
|
3692
|
+
break;
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
} while ((count1 | count2) < minGallop);
|
|
3696
|
+
if (exit) {
|
|
3697
|
+
break;
|
|
3698
|
+
}
|
|
3699
|
+
do {
|
|
3700
|
+
count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
|
|
3701
|
+
if (count1 !== 0) {
|
|
3702
|
+
dest -= count1;
|
|
3703
|
+
cursor1 -= count1;
|
|
3704
|
+
length1 -= count1;
|
|
3705
|
+
customDest = dest + 1;
|
|
3706
|
+
customCursor = cursor1 + 1;
|
|
3707
|
+
for (i = count1 - 1; i >= 0; i--) {
|
|
3708
|
+
array[customDest + i] = array[customCursor + i];
|
|
3709
|
+
}
|
|
3710
|
+
if (length1 === 0) {
|
|
3711
|
+
exit = true;
|
|
3712
|
+
break;
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
array[dest--] = tmp[cursor2--];
|
|
3716
|
+
if (--length2 === 1) {
|
|
3717
|
+
exit = true;
|
|
3718
|
+
break;
|
|
3719
|
+
}
|
|
3720
|
+
count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
|
|
3721
|
+
if (count2 !== 0) {
|
|
3722
|
+
dest -= count2;
|
|
3723
|
+
cursor2 -= count2;
|
|
3724
|
+
length2 -= count2;
|
|
3725
|
+
customDest = dest + 1;
|
|
3726
|
+
customCursor = cursor2 + 1;
|
|
3727
|
+
for (i = 0; i < count2; i++) {
|
|
3728
|
+
array[customDest + i] = tmp[customCursor + i];
|
|
3729
|
+
}
|
|
3730
|
+
if (length2 <= 1) {
|
|
3731
|
+
exit = true;
|
|
3732
|
+
break;
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
array[dest--] = array[cursor1--];
|
|
3736
|
+
if (--length1 === 0) {
|
|
3737
|
+
exit = true;
|
|
3738
|
+
break;
|
|
3739
|
+
}
|
|
3740
|
+
minGallop--;
|
|
3741
|
+
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
3742
|
+
if (exit) {
|
|
3743
|
+
break;
|
|
3744
|
+
}
|
|
3745
|
+
if (minGallop < 0) {
|
|
3746
|
+
minGallop = 0;
|
|
3747
|
+
}
|
|
3748
|
+
minGallop += 2;
|
|
3749
|
+
}
|
|
3750
|
+
this.minGallop = minGallop;
|
|
3751
|
+
if (minGallop < 1) {
|
|
3752
|
+
this.minGallop = 1;
|
|
3753
|
+
}
|
|
3754
|
+
if (length2 === 1) {
|
|
3755
|
+
dest -= length1;
|
|
3756
|
+
cursor1 -= length1;
|
|
3757
|
+
customDest = dest + 1;
|
|
3758
|
+
customCursor = cursor1 + 1;
|
|
3759
|
+
for (i = length1 - 1; i >= 0; i--) {
|
|
3760
|
+
array[customDest + i] = array[customCursor + i];
|
|
3761
|
+
}
|
|
3762
|
+
array[dest] = tmp[cursor2];
|
|
3763
|
+
} else if (length2 === 0) {
|
|
3764
|
+
throw new Error("mergeHigh preconditions were not respected");
|
|
3765
|
+
} else {
|
|
3766
|
+
customCursor = dest - (length2 - 1);
|
|
3767
|
+
for (i = 0; i < length2; i++) {
|
|
3768
|
+
array[customCursor + i] = tmp[i];
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3771
|
+
};
|
|
3772
|
+
return TimSort2;
|
|
3773
|
+
}();
|
|
3774
|
+
function sort(array, compare, lo, hi) {
|
|
3775
|
+
if (!Array.isArray(array)) {
|
|
3776
|
+
throw new TypeError("Can only sort arrays");
|
|
3777
|
+
}
|
|
3778
|
+
if (!compare) {
|
|
3779
|
+
compare = alphabeticalCompare;
|
|
3780
|
+
} else if (typeof compare !== "function") {
|
|
3781
|
+
hi = lo;
|
|
3782
|
+
lo = compare;
|
|
3783
|
+
compare = alphabeticalCompare;
|
|
3784
|
+
}
|
|
3785
|
+
if (!lo) {
|
|
3786
|
+
lo = 0;
|
|
3787
|
+
}
|
|
3788
|
+
if (!hi) {
|
|
3789
|
+
hi = array.length;
|
|
3790
|
+
}
|
|
3791
|
+
var remaining = hi - lo;
|
|
3792
|
+
if (remaining < 2) {
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
var runLength = 0;
|
|
3796
|
+
if (remaining < DEFAULT_MIN_MERGE) {
|
|
3797
|
+
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
3798
|
+
binaryInsertionSort(array, lo, hi, lo + runLength, compare);
|
|
3799
|
+
return;
|
|
3800
|
+
}
|
|
3801
|
+
var ts = new TimSort(array, compare);
|
|
3802
|
+
var minRun = minRunLength(remaining);
|
|
3803
|
+
do {
|
|
3804
|
+
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
3805
|
+
if (runLength < minRun) {
|
|
3806
|
+
var force = remaining;
|
|
3807
|
+
if (force > minRun) {
|
|
3808
|
+
force = minRun;
|
|
3809
|
+
}
|
|
3810
|
+
binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
|
|
3811
|
+
runLength = force;
|
|
3812
|
+
}
|
|
3813
|
+
ts.pushRun(lo, runLength);
|
|
3814
|
+
ts.mergeRuns();
|
|
3815
|
+
remaining -= runLength;
|
|
3816
|
+
lo += runLength;
|
|
3817
|
+
} while (remaining !== 0);
|
|
3818
|
+
ts.forceMergeRuns();
|
|
3819
|
+
}
|
|
3820
|
+
});
|
|
3821
|
+
})(timsort$1);
|
|
3822
|
+
var ansiStyles$1 = { exports: {} };
|
|
3823
|
+
var colorName;
|
|
3824
|
+
var hasRequiredColorName;
|
|
3825
|
+
function requireColorName() {
|
|
3826
|
+
if (hasRequiredColorName)
|
|
3827
|
+
return colorName;
|
|
3828
|
+
hasRequiredColorName = 1;
|
|
3829
|
+
colorName = {
|
|
3830
|
+
"aliceblue": [240, 248, 255],
|
|
3831
|
+
"antiquewhite": [250, 235, 215],
|
|
3832
|
+
"aqua": [0, 255, 255],
|
|
3833
|
+
"aquamarine": [127, 255, 212],
|
|
3834
|
+
"azure": [240, 255, 255],
|
|
3835
|
+
"beige": [245, 245, 220],
|
|
3836
|
+
"bisque": [255, 228, 196],
|
|
3837
|
+
"black": [0, 0, 0],
|
|
3838
|
+
"blanchedalmond": [255, 235, 205],
|
|
3839
|
+
"blue": [0, 0, 255],
|
|
3840
|
+
"blueviolet": [138, 43, 226],
|
|
3841
|
+
"brown": [165, 42, 42],
|
|
3842
|
+
"burlywood": [222, 184, 135],
|
|
3843
|
+
"cadetblue": [95, 158, 160],
|
|
3844
|
+
"chartreuse": [127, 255, 0],
|
|
3845
|
+
"chocolate": [210, 105, 30],
|
|
3846
|
+
"coral": [255, 127, 80],
|
|
3847
|
+
"cornflowerblue": [100, 149, 237],
|
|
3848
|
+
"cornsilk": [255, 248, 220],
|
|
3849
|
+
"crimson": [220, 20, 60],
|
|
3850
|
+
"cyan": [0, 255, 255],
|
|
3851
|
+
"darkblue": [0, 0, 139],
|
|
3852
|
+
"darkcyan": [0, 139, 139],
|
|
3853
|
+
"darkgoldenrod": [184, 134, 11],
|
|
3854
|
+
"darkgray": [169, 169, 169],
|
|
3855
|
+
"darkgreen": [0, 100, 0],
|
|
3856
|
+
"darkgrey": [169, 169, 169],
|
|
3857
|
+
"darkkhaki": [189, 183, 107],
|
|
3858
|
+
"darkmagenta": [139, 0, 139],
|
|
3859
|
+
"darkolivegreen": [85, 107, 47],
|
|
3860
|
+
"darkorange": [255, 140, 0],
|
|
3861
|
+
"darkorchid": [153, 50, 204],
|
|
3862
|
+
"darkred": [139, 0, 0],
|
|
3863
|
+
"darksalmon": [233, 150, 122],
|
|
3864
|
+
"darkseagreen": [143, 188, 143],
|
|
3865
|
+
"darkslateblue": [72, 61, 139],
|
|
3866
|
+
"darkslategray": [47, 79, 79],
|
|
3867
|
+
"darkslategrey": [47, 79, 79],
|
|
3868
|
+
"darkturquoise": [0, 206, 209],
|
|
3869
|
+
"darkviolet": [148, 0, 211],
|
|
3870
|
+
"deeppink": [255, 20, 147],
|
|
3871
|
+
"deepskyblue": [0, 191, 255],
|
|
3872
|
+
"dimgray": [105, 105, 105],
|
|
3873
|
+
"dimgrey": [105, 105, 105],
|
|
3874
|
+
"dodgerblue": [30, 144, 255],
|
|
3875
|
+
"firebrick": [178, 34, 34],
|
|
3876
|
+
"floralwhite": [255, 250, 240],
|
|
3877
|
+
"forestgreen": [34, 139, 34],
|
|
3878
|
+
"fuchsia": [255, 0, 255],
|
|
3879
|
+
"gainsboro": [220, 220, 220],
|
|
3880
|
+
"ghostwhite": [248, 248, 255],
|
|
3881
|
+
"gold": [255, 215, 0],
|
|
3882
|
+
"goldenrod": [218, 165, 32],
|
|
3883
|
+
"gray": [128, 128, 128],
|
|
3884
|
+
"green": [0, 128, 0],
|
|
3885
|
+
"greenyellow": [173, 255, 47],
|
|
3886
|
+
"grey": [128, 128, 128],
|
|
3887
|
+
"honeydew": [240, 255, 240],
|
|
3888
|
+
"hotpink": [255, 105, 180],
|
|
3889
|
+
"indianred": [205, 92, 92],
|
|
3890
|
+
"indigo": [75, 0, 130],
|
|
3891
|
+
"ivory": [255, 255, 240],
|
|
3892
|
+
"khaki": [240, 230, 140],
|
|
3893
|
+
"lavender": [230, 230, 250],
|
|
3894
|
+
"lavenderblush": [255, 240, 245],
|
|
3895
|
+
"lawngreen": [124, 252, 0],
|
|
3896
|
+
"lemonchiffon": [255, 250, 205],
|
|
3897
|
+
"lightblue": [173, 216, 230],
|
|
3898
|
+
"lightcoral": [240, 128, 128],
|
|
3899
|
+
"lightcyan": [224, 255, 255],
|
|
3900
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
3901
|
+
"lightgray": [211, 211, 211],
|
|
3902
|
+
"lightgreen": [144, 238, 144],
|
|
3903
|
+
"lightgrey": [211, 211, 211],
|
|
3904
|
+
"lightpink": [255, 182, 193],
|
|
3905
|
+
"lightsalmon": [255, 160, 122],
|
|
3906
|
+
"lightseagreen": [32, 178, 170],
|
|
3907
|
+
"lightskyblue": [135, 206, 250],
|
|
3908
|
+
"lightslategray": [119, 136, 153],
|
|
3909
|
+
"lightslategrey": [119, 136, 153],
|
|
3910
|
+
"lightsteelblue": [176, 196, 222],
|
|
3911
|
+
"lightyellow": [255, 255, 224],
|
|
3912
|
+
"lime": [0, 255, 0],
|
|
3913
|
+
"limegreen": [50, 205, 50],
|
|
3914
|
+
"linen": [250, 240, 230],
|
|
3915
|
+
"magenta": [255, 0, 255],
|
|
3916
|
+
"maroon": [128, 0, 0],
|
|
3917
|
+
"mediumaquamarine": [102, 205, 170],
|
|
3918
|
+
"mediumblue": [0, 0, 205],
|
|
3919
|
+
"mediumorchid": [186, 85, 211],
|
|
3920
|
+
"mediumpurple": [147, 112, 219],
|
|
3921
|
+
"mediumseagreen": [60, 179, 113],
|
|
3922
|
+
"mediumslateblue": [123, 104, 238],
|
|
3923
|
+
"mediumspringgreen": [0, 250, 154],
|
|
3924
|
+
"mediumturquoise": [72, 209, 204],
|
|
3925
|
+
"mediumvioletred": [199, 21, 133],
|
|
3926
|
+
"midnightblue": [25, 25, 112],
|
|
3927
|
+
"mintcream": [245, 255, 250],
|
|
3928
|
+
"mistyrose": [255, 228, 225],
|
|
3929
|
+
"moccasin": [255, 228, 181],
|
|
3930
|
+
"navajowhite": [255, 222, 173],
|
|
3931
|
+
"navy": [0, 0, 128],
|
|
3932
|
+
"oldlace": [253, 245, 230],
|
|
3933
|
+
"olive": [128, 128, 0],
|
|
3934
|
+
"olivedrab": [107, 142, 35],
|
|
3935
|
+
"orange": [255, 165, 0],
|
|
3936
|
+
"orangered": [255, 69, 0],
|
|
3937
|
+
"orchid": [218, 112, 214],
|
|
3938
|
+
"palegoldenrod": [238, 232, 170],
|
|
3939
|
+
"palegreen": [152, 251, 152],
|
|
3940
|
+
"paleturquoise": [175, 238, 238],
|
|
3941
|
+
"palevioletred": [219, 112, 147],
|
|
3942
|
+
"papayawhip": [255, 239, 213],
|
|
3943
|
+
"peachpuff": [255, 218, 185],
|
|
3944
|
+
"peru": [205, 133, 63],
|
|
3945
|
+
"pink": [255, 192, 203],
|
|
3946
|
+
"plum": [221, 160, 221],
|
|
3947
|
+
"powderblue": [176, 224, 230],
|
|
3948
|
+
"purple": [128, 0, 128],
|
|
3949
|
+
"rebeccapurple": [102, 51, 153],
|
|
3950
|
+
"red": [255, 0, 0],
|
|
3951
|
+
"rosybrown": [188, 143, 143],
|
|
3952
|
+
"royalblue": [65, 105, 225],
|
|
3953
|
+
"saddlebrown": [139, 69, 19],
|
|
3954
|
+
"salmon": [250, 128, 114],
|
|
3955
|
+
"sandybrown": [244, 164, 96],
|
|
3956
|
+
"seagreen": [46, 139, 87],
|
|
3957
|
+
"seashell": [255, 245, 238],
|
|
3958
|
+
"sienna": [160, 82, 45],
|
|
3959
|
+
"silver": [192, 192, 192],
|
|
3960
|
+
"skyblue": [135, 206, 235],
|
|
3961
|
+
"slateblue": [106, 90, 205],
|
|
3962
|
+
"slategray": [112, 128, 144],
|
|
3963
|
+
"slategrey": [112, 128, 144],
|
|
3964
|
+
"snow": [255, 250, 250],
|
|
3965
|
+
"springgreen": [0, 255, 127],
|
|
3966
|
+
"steelblue": [70, 130, 180],
|
|
3967
|
+
"tan": [210, 180, 140],
|
|
3968
|
+
"teal": [0, 128, 128],
|
|
3969
|
+
"thistle": [216, 191, 216],
|
|
3970
|
+
"tomato": [255, 99, 71],
|
|
3971
|
+
"turquoise": [64, 224, 208],
|
|
3972
|
+
"violet": [238, 130, 238],
|
|
3973
|
+
"wheat": [245, 222, 179],
|
|
3974
|
+
"white": [255, 255, 255],
|
|
3975
|
+
"whitesmoke": [245, 245, 245],
|
|
3976
|
+
"yellow": [255, 255, 0],
|
|
3977
|
+
"yellowgreen": [154, 205, 50]
|
|
3978
|
+
};
|
|
3979
|
+
return colorName;
|
|
3980
|
+
}
|
|
3981
|
+
var conversions;
|
|
3982
|
+
var hasRequiredConversions;
|
|
3983
|
+
function requireConversions() {
|
|
3984
|
+
if (hasRequiredConversions)
|
|
3985
|
+
return conversions;
|
|
3986
|
+
hasRequiredConversions = 1;
|
|
3987
|
+
const cssKeywords = requireColorName();
|
|
3988
|
+
const reverseKeywords = {};
|
|
3989
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
3990
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
3991
|
+
}
|
|
3992
|
+
const convert = {
|
|
3993
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
3994
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
3995
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
3996
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
3997
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
3998
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
3999
|
+
lab: { channels: 3, labels: "lab" },
|
|
4000
|
+
lch: { channels: 3, labels: "lch" },
|
|
4001
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
4002
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
4003
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
4004
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
4005
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
4006
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
4007
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
4008
|
+
};
|
|
4009
|
+
conversions = convert;
|
|
4010
|
+
for (const model of Object.keys(convert)) {
|
|
4011
|
+
if (!("channels" in convert[model])) {
|
|
4012
|
+
throw new Error("missing channels property: " + model);
|
|
4013
|
+
}
|
|
4014
|
+
if (!("labels" in convert[model])) {
|
|
4015
|
+
throw new Error("missing channel labels property: " + model);
|
|
4016
|
+
}
|
|
4017
|
+
if (convert[model].labels.length !== convert[model].channels) {
|
|
4018
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
4019
|
+
}
|
|
4020
|
+
const { channels, labels } = convert[model];
|
|
4021
|
+
delete convert[model].channels;
|
|
4022
|
+
delete convert[model].labels;
|
|
4023
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
4024
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
4025
|
+
}
|
|
4026
|
+
convert.rgb.hsl = function(rgb) {
|
|
4027
|
+
const r = rgb[0] / 255;
|
|
4028
|
+
const g = rgb[1] / 255;
|
|
4029
|
+
const b = rgb[2] / 255;
|
|
4030
|
+
const min = Math.min(r, g, b);
|
|
4031
|
+
const max = Math.max(r, g, b);
|
|
4032
|
+
const delta = max - min;
|
|
4033
|
+
let h;
|
|
4034
|
+
let s;
|
|
4035
|
+
if (max === min) {
|
|
4036
|
+
h = 0;
|
|
4037
|
+
} else if (r === max) {
|
|
4038
|
+
h = (g - b) / delta;
|
|
4039
|
+
} else if (g === max) {
|
|
4040
|
+
h = 2 + (b - r) / delta;
|
|
4041
|
+
} else if (b === max) {
|
|
4042
|
+
h = 4 + (r - g) / delta;
|
|
4043
|
+
}
|
|
4044
|
+
h = Math.min(h * 60, 360);
|
|
4045
|
+
if (h < 0) {
|
|
4046
|
+
h += 360;
|
|
4047
|
+
}
|
|
4048
|
+
const l = (min + max) / 2;
|
|
4049
|
+
if (max === min) {
|
|
4050
|
+
s = 0;
|
|
4051
|
+
} else if (l <= 0.5) {
|
|
4052
|
+
s = delta / (max + min);
|
|
4053
|
+
} else {
|
|
4054
|
+
s = delta / (2 - max - min);
|
|
4055
|
+
}
|
|
4056
|
+
return [h, s * 100, l * 100];
|
|
4057
|
+
};
|
|
4058
|
+
convert.rgb.hsv = function(rgb) {
|
|
4059
|
+
let rdif;
|
|
4060
|
+
let gdif;
|
|
4061
|
+
let bdif;
|
|
4062
|
+
let h;
|
|
4063
|
+
let s;
|
|
4064
|
+
const r = rgb[0] / 255;
|
|
4065
|
+
const g = rgb[1] / 255;
|
|
4066
|
+
const b = rgb[2] / 255;
|
|
4067
|
+
const v = Math.max(r, g, b);
|
|
4068
|
+
const diff = v - Math.min(r, g, b);
|
|
4069
|
+
const diffc = function(c) {
|
|
4070
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
4071
|
+
};
|
|
4072
|
+
if (diff === 0) {
|
|
4073
|
+
h = 0;
|
|
4074
|
+
s = 0;
|
|
4075
|
+
} else {
|
|
4076
|
+
s = diff / v;
|
|
4077
|
+
rdif = diffc(r);
|
|
4078
|
+
gdif = diffc(g);
|
|
4079
|
+
bdif = diffc(b);
|
|
4080
|
+
if (r === v) {
|
|
4081
|
+
h = bdif - gdif;
|
|
4082
|
+
} else if (g === v) {
|
|
4083
|
+
h = 1 / 3 + rdif - bdif;
|
|
4084
|
+
} else if (b === v) {
|
|
4085
|
+
h = 2 / 3 + gdif - rdif;
|
|
4086
|
+
}
|
|
4087
|
+
if (h < 0) {
|
|
4088
|
+
h += 1;
|
|
4089
|
+
} else if (h > 1) {
|
|
4090
|
+
h -= 1;
|
|
4091
|
+
}
|
|
4092
|
+
}
|
|
4093
|
+
return [
|
|
4094
|
+
h * 360,
|
|
4095
|
+
s * 100,
|
|
4096
|
+
v * 100
|
|
4097
|
+
];
|
|
4098
|
+
};
|
|
4099
|
+
convert.rgb.hwb = function(rgb) {
|
|
4100
|
+
const r = rgb[0];
|
|
4101
|
+
const g = rgb[1];
|
|
4102
|
+
let b = rgb[2];
|
|
4103
|
+
const h = convert.rgb.hsl(rgb)[0];
|
|
4104
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
4105
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
4106
|
+
return [h, w * 100, b * 100];
|
|
4107
|
+
};
|
|
4108
|
+
convert.rgb.cmyk = function(rgb) {
|
|
4109
|
+
const r = rgb[0] / 255;
|
|
4110
|
+
const g = rgb[1] / 255;
|
|
4111
|
+
const b = rgb[2] / 255;
|
|
4112
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
4113
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
4114
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
4115
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
4116
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
4117
|
+
};
|
|
4118
|
+
function comparativeDistance(x, y) {
|
|
4119
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
4120
|
+
}
|
|
4121
|
+
convert.rgb.keyword = function(rgb) {
|
|
4122
|
+
const reversed = reverseKeywords[rgb];
|
|
4123
|
+
if (reversed) {
|
|
4124
|
+
return reversed;
|
|
4125
|
+
}
|
|
4126
|
+
let currentClosestDistance = Infinity;
|
|
4127
|
+
let currentClosestKeyword;
|
|
4128
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
4129
|
+
const value = cssKeywords[keyword];
|
|
4130
|
+
const distance = comparativeDistance(rgb, value);
|
|
4131
|
+
if (distance < currentClosestDistance) {
|
|
4132
|
+
currentClosestDistance = distance;
|
|
4133
|
+
currentClosestKeyword = keyword;
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
return currentClosestKeyword;
|
|
4137
|
+
};
|
|
4138
|
+
convert.keyword.rgb = function(keyword) {
|
|
4139
|
+
return cssKeywords[keyword];
|
|
4140
|
+
};
|
|
4141
|
+
convert.rgb.xyz = function(rgb) {
|
|
4142
|
+
let r = rgb[0] / 255;
|
|
4143
|
+
let g = rgb[1] / 255;
|
|
4144
|
+
let b = rgb[2] / 255;
|
|
4145
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
4146
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
4147
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
4148
|
+
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
4149
|
+
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
4150
|
+
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
4151
|
+
return [x * 100, y * 100, z * 100];
|
|
4152
|
+
};
|
|
4153
|
+
convert.rgb.lab = function(rgb) {
|
|
4154
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
4155
|
+
let x = xyz[0];
|
|
4156
|
+
let y = xyz[1];
|
|
4157
|
+
let z = xyz[2];
|
|
4158
|
+
x /= 95.047;
|
|
4159
|
+
y /= 100;
|
|
4160
|
+
z /= 108.883;
|
|
4161
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4162
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4163
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4164
|
+
const l = 116 * y - 16;
|
|
4165
|
+
const a = 500 * (x - y);
|
|
4166
|
+
const b = 200 * (y - z);
|
|
4167
|
+
return [l, a, b];
|
|
4168
|
+
};
|
|
4169
|
+
convert.hsl.rgb = function(hsl) {
|
|
4170
|
+
const h = hsl[0] / 360;
|
|
4171
|
+
const s = hsl[1] / 100;
|
|
4172
|
+
const l = hsl[2] / 100;
|
|
4173
|
+
let t2;
|
|
4174
|
+
let t3;
|
|
4175
|
+
let val;
|
|
4176
|
+
if (s === 0) {
|
|
4177
|
+
val = l * 255;
|
|
4178
|
+
return [val, val, val];
|
|
4179
|
+
}
|
|
4180
|
+
if (l < 0.5) {
|
|
4181
|
+
t2 = l * (1 + s);
|
|
4182
|
+
} else {
|
|
4183
|
+
t2 = l + s - l * s;
|
|
4184
|
+
}
|
|
4185
|
+
const t1 = 2 * l - t2;
|
|
4186
|
+
const rgb = [0, 0, 0];
|
|
4187
|
+
for (let i = 0; i < 3; i++) {
|
|
4188
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
4189
|
+
if (t3 < 0) {
|
|
4190
|
+
t3++;
|
|
4191
|
+
}
|
|
4192
|
+
if (t3 > 1) {
|
|
4193
|
+
t3--;
|
|
4194
|
+
}
|
|
4195
|
+
if (6 * t3 < 1) {
|
|
4196
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
4197
|
+
} else if (2 * t3 < 1) {
|
|
4198
|
+
val = t2;
|
|
4199
|
+
} else if (3 * t3 < 2) {
|
|
4200
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
4201
|
+
} else {
|
|
4202
|
+
val = t1;
|
|
4203
|
+
}
|
|
4204
|
+
rgb[i] = val * 255;
|
|
4205
|
+
}
|
|
4206
|
+
return rgb;
|
|
4207
|
+
};
|
|
4208
|
+
convert.hsl.hsv = function(hsl) {
|
|
4209
|
+
const h = hsl[0];
|
|
4210
|
+
let s = hsl[1] / 100;
|
|
4211
|
+
let l = hsl[2] / 100;
|
|
4212
|
+
let smin = s;
|
|
4213
|
+
const lmin = Math.max(l, 0.01);
|
|
4214
|
+
l *= 2;
|
|
4215
|
+
s *= l <= 1 ? l : 2 - l;
|
|
4216
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
4217
|
+
const v = (l + s) / 2;
|
|
4218
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
4219
|
+
return [h, sv * 100, v * 100];
|
|
4220
|
+
};
|
|
4221
|
+
convert.hsv.rgb = function(hsv) {
|
|
4222
|
+
const h = hsv[0] / 60;
|
|
4223
|
+
const s = hsv[1] / 100;
|
|
4224
|
+
let v = hsv[2] / 100;
|
|
4225
|
+
const hi = Math.floor(h) % 6;
|
|
4226
|
+
const f = h - Math.floor(h);
|
|
4227
|
+
const p = 255 * v * (1 - s);
|
|
4228
|
+
const q = 255 * v * (1 - s * f);
|
|
4229
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
4230
|
+
v *= 255;
|
|
4231
|
+
switch (hi) {
|
|
4232
|
+
case 0:
|
|
4233
|
+
return [v, t, p];
|
|
4234
|
+
case 1:
|
|
4235
|
+
return [q, v, p];
|
|
4236
|
+
case 2:
|
|
4237
|
+
return [p, v, t];
|
|
4238
|
+
case 3:
|
|
4239
|
+
return [p, q, v];
|
|
4240
|
+
case 4:
|
|
4241
|
+
return [t, p, v];
|
|
4242
|
+
case 5:
|
|
4243
|
+
return [v, p, q];
|
|
4244
|
+
}
|
|
4245
|
+
};
|
|
4246
|
+
convert.hsv.hsl = function(hsv) {
|
|
4247
|
+
const h = hsv[0];
|
|
4248
|
+
const s = hsv[1] / 100;
|
|
4249
|
+
const v = hsv[2] / 100;
|
|
4250
|
+
const vmin = Math.max(v, 0.01);
|
|
4251
|
+
let sl;
|
|
4252
|
+
let l;
|
|
4253
|
+
l = (2 - s) * v;
|
|
4254
|
+
const lmin = (2 - s) * vmin;
|
|
4255
|
+
sl = s * vmin;
|
|
4256
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
4257
|
+
sl = sl || 0;
|
|
4258
|
+
l /= 2;
|
|
4259
|
+
return [h, sl * 100, l * 100];
|
|
4260
|
+
};
|
|
4261
|
+
convert.hwb.rgb = function(hwb) {
|
|
4262
|
+
const h = hwb[0] / 360;
|
|
4263
|
+
let wh = hwb[1] / 100;
|
|
4264
|
+
let bl = hwb[2] / 100;
|
|
4265
|
+
const ratio = wh + bl;
|
|
4266
|
+
let f;
|
|
4267
|
+
if (ratio > 1) {
|
|
4268
|
+
wh /= ratio;
|
|
4269
|
+
bl /= ratio;
|
|
4270
|
+
}
|
|
4271
|
+
const i = Math.floor(6 * h);
|
|
4272
|
+
const v = 1 - bl;
|
|
4273
|
+
f = 6 * h - i;
|
|
4274
|
+
if ((i & 1) !== 0) {
|
|
4275
|
+
f = 1 - f;
|
|
4276
|
+
}
|
|
4277
|
+
const n = wh + f * (v - wh);
|
|
4278
|
+
let r;
|
|
4279
|
+
let g;
|
|
4280
|
+
let b;
|
|
4281
|
+
switch (i) {
|
|
4282
|
+
default:
|
|
4283
|
+
case 6:
|
|
4284
|
+
case 0:
|
|
4285
|
+
r = v;
|
|
4286
|
+
g = n;
|
|
4287
|
+
b = wh;
|
|
4288
|
+
break;
|
|
4289
|
+
case 1:
|
|
4290
|
+
r = n;
|
|
4291
|
+
g = v;
|
|
4292
|
+
b = wh;
|
|
4293
|
+
break;
|
|
4294
|
+
case 2:
|
|
4295
|
+
r = wh;
|
|
4296
|
+
g = v;
|
|
4297
|
+
b = n;
|
|
4298
|
+
break;
|
|
4299
|
+
case 3:
|
|
4300
|
+
r = wh;
|
|
4301
|
+
g = n;
|
|
4302
|
+
b = v;
|
|
4303
|
+
break;
|
|
4304
|
+
case 4:
|
|
4305
|
+
r = n;
|
|
4306
|
+
g = wh;
|
|
4307
|
+
b = v;
|
|
4308
|
+
break;
|
|
4309
|
+
case 5:
|
|
4310
|
+
r = v;
|
|
4311
|
+
g = wh;
|
|
4312
|
+
b = n;
|
|
4313
|
+
break;
|
|
4314
|
+
}
|
|
4315
|
+
return [r * 255, g * 255, b * 255];
|
|
4316
|
+
};
|
|
4317
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
4318
|
+
const c = cmyk[0] / 100;
|
|
4319
|
+
const m = cmyk[1] / 100;
|
|
4320
|
+
const y = cmyk[2] / 100;
|
|
4321
|
+
const k = cmyk[3] / 100;
|
|
4322
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
4323
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
4324
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
4325
|
+
return [r * 255, g * 255, b * 255];
|
|
4326
|
+
};
|
|
4327
|
+
convert.xyz.rgb = function(xyz) {
|
|
4328
|
+
const x = xyz[0] / 100;
|
|
4329
|
+
const y = xyz[1] / 100;
|
|
4330
|
+
const z = xyz[2] / 100;
|
|
4331
|
+
let r;
|
|
4332
|
+
let g;
|
|
4333
|
+
let b;
|
|
4334
|
+
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
4335
|
+
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
4336
|
+
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
4337
|
+
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
4338
|
+
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
4339
|
+
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
4340
|
+
r = Math.min(Math.max(0, r), 1);
|
|
4341
|
+
g = Math.min(Math.max(0, g), 1);
|
|
4342
|
+
b = Math.min(Math.max(0, b), 1);
|
|
4343
|
+
return [r * 255, g * 255, b * 255];
|
|
4344
|
+
};
|
|
4345
|
+
convert.xyz.lab = function(xyz) {
|
|
4346
|
+
let x = xyz[0];
|
|
4347
|
+
let y = xyz[1];
|
|
4348
|
+
let z = xyz[2];
|
|
4349
|
+
x /= 95.047;
|
|
4350
|
+
y /= 100;
|
|
4351
|
+
z /= 108.883;
|
|
4352
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4353
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4354
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4355
|
+
const l = 116 * y - 16;
|
|
4356
|
+
const a = 500 * (x - y);
|
|
4357
|
+
const b = 200 * (y - z);
|
|
4358
|
+
return [l, a, b];
|
|
4359
|
+
};
|
|
4360
|
+
convert.lab.xyz = function(lab) {
|
|
4361
|
+
const l = lab[0];
|
|
4362
|
+
const a = lab[1];
|
|
4363
|
+
const b = lab[2];
|
|
4364
|
+
let x;
|
|
4365
|
+
let y;
|
|
4366
|
+
let z;
|
|
4367
|
+
y = (l + 16) / 116;
|
|
4368
|
+
x = a / 500 + y;
|
|
4369
|
+
z = y - b / 200;
|
|
4370
|
+
const y2 = y ** 3;
|
|
4371
|
+
const x2 = x ** 3;
|
|
4372
|
+
const z2 = z ** 3;
|
|
4373
|
+
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
4374
|
+
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
4375
|
+
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
4376
|
+
x *= 95.047;
|
|
4377
|
+
y *= 100;
|
|
4378
|
+
z *= 108.883;
|
|
4379
|
+
return [x, y, z];
|
|
4380
|
+
};
|
|
4381
|
+
convert.lab.lch = function(lab) {
|
|
4382
|
+
const l = lab[0];
|
|
4383
|
+
const a = lab[1];
|
|
4384
|
+
const b = lab[2];
|
|
4385
|
+
let h;
|
|
4386
|
+
const hr = Math.atan2(b, a);
|
|
4387
|
+
h = hr * 360 / 2 / Math.PI;
|
|
4388
|
+
if (h < 0) {
|
|
4389
|
+
h += 360;
|
|
4390
|
+
}
|
|
4391
|
+
const c = Math.sqrt(a * a + b * b);
|
|
4392
|
+
return [l, c, h];
|
|
4393
|
+
};
|
|
4394
|
+
convert.lch.lab = function(lch) {
|
|
4395
|
+
const l = lch[0];
|
|
4396
|
+
const c = lch[1];
|
|
4397
|
+
const h = lch[2];
|
|
4398
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
4399
|
+
const a = c * Math.cos(hr);
|
|
4400
|
+
const b = c * Math.sin(hr);
|
|
4401
|
+
return [l, a, b];
|
|
4402
|
+
};
|
|
4403
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
4404
|
+
const [r, g, b] = args;
|
|
4405
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
4406
|
+
value = Math.round(value / 50);
|
|
4407
|
+
if (value === 0) {
|
|
4408
|
+
return 30;
|
|
4409
|
+
}
|
|
4410
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
4411
|
+
if (value === 2) {
|
|
4412
|
+
ansi += 60;
|
|
4413
|
+
}
|
|
4414
|
+
return ansi;
|
|
4415
|
+
};
|
|
4416
|
+
convert.hsv.ansi16 = function(args) {
|
|
4417
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
4418
|
+
};
|
|
4419
|
+
convert.rgb.ansi256 = function(args) {
|
|
4420
|
+
const r = args[0];
|
|
4421
|
+
const g = args[1];
|
|
4422
|
+
const b = args[2];
|
|
4423
|
+
if (r === g && g === b) {
|
|
4424
|
+
if (r < 8) {
|
|
4425
|
+
return 16;
|
|
4426
|
+
}
|
|
4427
|
+
if (r > 248) {
|
|
4428
|
+
return 231;
|
|
4429
|
+
}
|
|
4430
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
4431
|
+
}
|
|
4432
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
4433
|
+
return ansi;
|
|
4434
|
+
};
|
|
4435
|
+
convert.ansi16.rgb = function(args) {
|
|
4436
|
+
let color = args % 10;
|
|
4437
|
+
if (color === 0 || color === 7) {
|
|
4438
|
+
if (args > 50) {
|
|
4439
|
+
color += 3.5;
|
|
4440
|
+
}
|
|
4441
|
+
color = color / 10.5 * 255;
|
|
4442
|
+
return [color, color, color];
|
|
4443
|
+
}
|
|
4444
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
4445
|
+
const r = (color & 1) * mult * 255;
|
|
4446
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
4447
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
4448
|
+
return [r, g, b];
|
|
4449
|
+
};
|
|
4450
|
+
convert.ansi256.rgb = function(args) {
|
|
4451
|
+
if (args >= 232) {
|
|
4452
|
+
const c = (args - 232) * 10 + 8;
|
|
4453
|
+
return [c, c, c];
|
|
4454
|
+
}
|
|
4455
|
+
args -= 16;
|
|
4456
|
+
let rem;
|
|
4457
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
4458
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
4459
|
+
const b = rem % 6 / 5 * 255;
|
|
4460
|
+
return [r, g, b];
|
|
4461
|
+
};
|
|
4462
|
+
convert.rgb.hex = function(args) {
|
|
4463
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
4464
|
+
const string = integer.toString(16).toUpperCase();
|
|
4465
|
+
return "000000".substring(string.length) + string;
|
|
4466
|
+
};
|
|
4467
|
+
convert.hex.rgb = function(args) {
|
|
4468
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
4469
|
+
if (!match) {
|
|
4470
|
+
return [0, 0, 0];
|
|
4471
|
+
}
|
|
4472
|
+
let colorString = match[0];
|
|
4473
|
+
if (match[0].length === 3) {
|
|
4474
|
+
colorString = colorString.split("").map((char) => {
|
|
4475
|
+
return char + char;
|
|
4476
|
+
}).join("");
|
|
4477
|
+
}
|
|
4478
|
+
const integer = parseInt(colorString, 16);
|
|
4479
|
+
const r = integer >> 16 & 255;
|
|
4480
|
+
const g = integer >> 8 & 255;
|
|
4481
|
+
const b = integer & 255;
|
|
4482
|
+
return [r, g, b];
|
|
4483
|
+
};
|
|
4484
|
+
convert.rgb.hcg = function(rgb) {
|
|
4485
|
+
const r = rgb[0] / 255;
|
|
4486
|
+
const g = rgb[1] / 255;
|
|
4487
|
+
const b = rgb[2] / 255;
|
|
4488
|
+
const max = Math.max(Math.max(r, g), b);
|
|
4489
|
+
const min = Math.min(Math.min(r, g), b);
|
|
4490
|
+
const chroma = max - min;
|
|
4491
|
+
let grayscale;
|
|
4492
|
+
let hue;
|
|
4493
|
+
if (chroma < 1) {
|
|
4494
|
+
grayscale = min / (1 - chroma);
|
|
4495
|
+
} else {
|
|
4496
|
+
grayscale = 0;
|
|
4497
|
+
}
|
|
4498
|
+
if (chroma <= 0) {
|
|
4499
|
+
hue = 0;
|
|
4500
|
+
} else if (max === r) {
|
|
4501
|
+
hue = (g - b) / chroma % 6;
|
|
4502
|
+
} else if (max === g) {
|
|
4503
|
+
hue = 2 + (b - r) / chroma;
|
|
4504
|
+
} else {
|
|
4505
|
+
hue = 4 + (r - g) / chroma;
|
|
4506
|
+
}
|
|
4507
|
+
hue /= 6;
|
|
4508
|
+
hue %= 1;
|
|
4509
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
4510
|
+
};
|
|
4511
|
+
convert.hsl.hcg = function(hsl) {
|
|
4512
|
+
const s = hsl[1] / 100;
|
|
4513
|
+
const l = hsl[2] / 100;
|
|
4514
|
+
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
4515
|
+
let f = 0;
|
|
4516
|
+
if (c < 1) {
|
|
4517
|
+
f = (l - 0.5 * c) / (1 - c);
|
|
4518
|
+
}
|
|
4519
|
+
return [hsl[0], c * 100, f * 100];
|
|
4520
|
+
};
|
|
4521
|
+
convert.hsv.hcg = function(hsv) {
|
|
4522
|
+
const s = hsv[1] / 100;
|
|
4523
|
+
const v = hsv[2] / 100;
|
|
4524
|
+
const c = s * v;
|
|
4525
|
+
let f = 0;
|
|
4526
|
+
if (c < 1) {
|
|
4527
|
+
f = (v - c) / (1 - c);
|
|
4528
|
+
}
|
|
4529
|
+
return [hsv[0], c * 100, f * 100];
|
|
4530
|
+
};
|
|
4531
|
+
convert.hcg.rgb = function(hcg) {
|
|
4532
|
+
const h = hcg[0] / 360;
|
|
4533
|
+
const c = hcg[1] / 100;
|
|
4534
|
+
const g = hcg[2] / 100;
|
|
4535
|
+
if (c === 0) {
|
|
4536
|
+
return [g * 255, g * 255, g * 255];
|
|
4537
|
+
}
|
|
4538
|
+
const pure = [0, 0, 0];
|
|
4539
|
+
const hi = h % 1 * 6;
|
|
4540
|
+
const v = hi % 1;
|
|
4541
|
+
const w = 1 - v;
|
|
4542
|
+
let mg = 0;
|
|
4543
|
+
switch (Math.floor(hi)) {
|
|
4544
|
+
case 0:
|
|
4545
|
+
pure[0] = 1;
|
|
4546
|
+
pure[1] = v;
|
|
4547
|
+
pure[2] = 0;
|
|
4548
|
+
break;
|
|
4549
|
+
case 1:
|
|
4550
|
+
pure[0] = w;
|
|
4551
|
+
pure[1] = 1;
|
|
4552
|
+
pure[2] = 0;
|
|
4553
|
+
break;
|
|
4554
|
+
case 2:
|
|
4555
|
+
pure[0] = 0;
|
|
4556
|
+
pure[1] = 1;
|
|
4557
|
+
pure[2] = v;
|
|
4558
|
+
break;
|
|
4559
|
+
case 3:
|
|
4560
|
+
pure[0] = 0;
|
|
4561
|
+
pure[1] = w;
|
|
4562
|
+
pure[2] = 1;
|
|
4563
|
+
break;
|
|
4564
|
+
case 4:
|
|
4565
|
+
pure[0] = v;
|
|
4566
|
+
pure[1] = 0;
|
|
4567
|
+
pure[2] = 1;
|
|
4568
|
+
break;
|
|
4569
|
+
default:
|
|
4570
|
+
pure[0] = 1;
|
|
4571
|
+
pure[1] = 0;
|
|
4572
|
+
pure[2] = w;
|
|
4573
|
+
}
|
|
4574
|
+
mg = (1 - c) * g;
|
|
4575
|
+
return [
|
|
4576
|
+
(c * pure[0] + mg) * 255,
|
|
4577
|
+
(c * pure[1] + mg) * 255,
|
|
4578
|
+
(c * pure[2] + mg) * 255
|
|
4579
|
+
];
|
|
4580
|
+
};
|
|
4581
|
+
convert.hcg.hsv = function(hcg) {
|
|
4582
|
+
const c = hcg[1] / 100;
|
|
4583
|
+
const g = hcg[2] / 100;
|
|
4584
|
+
const v = c + g * (1 - c);
|
|
4585
|
+
let f = 0;
|
|
4586
|
+
if (v > 0) {
|
|
4587
|
+
f = c / v;
|
|
4588
|
+
}
|
|
4589
|
+
return [hcg[0], f * 100, v * 100];
|
|
4590
|
+
};
|
|
4591
|
+
convert.hcg.hsl = function(hcg) {
|
|
4592
|
+
const c = hcg[1] / 100;
|
|
4593
|
+
const g = hcg[2] / 100;
|
|
4594
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
4595
|
+
let s = 0;
|
|
4596
|
+
if (l > 0 && l < 0.5) {
|
|
4597
|
+
s = c / (2 * l);
|
|
4598
|
+
} else if (l >= 0.5 && l < 1) {
|
|
4599
|
+
s = c / (2 * (1 - l));
|
|
4600
|
+
}
|
|
4601
|
+
return [hcg[0], s * 100, l * 100];
|
|
4602
|
+
};
|
|
4603
|
+
convert.hcg.hwb = function(hcg) {
|
|
4604
|
+
const c = hcg[1] / 100;
|
|
4605
|
+
const g = hcg[2] / 100;
|
|
4606
|
+
const v = c + g * (1 - c);
|
|
4607
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
4608
|
+
};
|
|
4609
|
+
convert.hwb.hcg = function(hwb) {
|
|
4610
|
+
const w = hwb[1] / 100;
|
|
4611
|
+
const b = hwb[2] / 100;
|
|
4612
|
+
const v = 1 - b;
|
|
4613
|
+
const c = v - w;
|
|
4614
|
+
let g = 0;
|
|
4615
|
+
if (c < 1) {
|
|
4616
|
+
g = (v - c) / (1 - c);
|
|
4617
|
+
}
|
|
4618
|
+
return [hwb[0], c * 100, g * 100];
|
|
4619
|
+
};
|
|
4620
|
+
convert.apple.rgb = function(apple) {
|
|
4621
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
4622
|
+
};
|
|
4623
|
+
convert.rgb.apple = function(rgb) {
|
|
4624
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
4625
|
+
};
|
|
4626
|
+
convert.gray.rgb = function(args) {
|
|
4627
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
4628
|
+
};
|
|
4629
|
+
convert.gray.hsl = function(args) {
|
|
4630
|
+
return [0, 0, args[0]];
|
|
4631
|
+
};
|
|
4632
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
4633
|
+
convert.gray.hwb = function(gray) {
|
|
4634
|
+
return [0, 100, gray[0]];
|
|
4635
|
+
};
|
|
4636
|
+
convert.gray.cmyk = function(gray) {
|
|
4637
|
+
return [0, 0, 0, gray[0]];
|
|
4638
|
+
};
|
|
4639
|
+
convert.gray.lab = function(gray) {
|
|
4640
|
+
return [gray[0], 0, 0];
|
|
4641
|
+
};
|
|
4642
|
+
convert.gray.hex = function(gray) {
|
|
4643
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
4644
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
4645
|
+
const string = integer.toString(16).toUpperCase();
|
|
4646
|
+
return "000000".substring(string.length) + string;
|
|
4647
|
+
};
|
|
4648
|
+
convert.rgb.gray = function(rgb) {
|
|
4649
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
4650
|
+
return [val / 255 * 100];
|
|
4651
|
+
};
|
|
4652
|
+
return conversions;
|
|
4653
|
+
}
|
|
4654
|
+
var route;
|
|
4655
|
+
var hasRequiredRoute;
|
|
4656
|
+
function requireRoute() {
|
|
4657
|
+
if (hasRequiredRoute)
|
|
4658
|
+
return route;
|
|
4659
|
+
hasRequiredRoute = 1;
|
|
4660
|
+
const conversions2 = requireConversions();
|
|
4661
|
+
function buildGraph() {
|
|
4662
|
+
const graph = {};
|
|
4663
|
+
const models = Object.keys(conversions2);
|
|
4664
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
4665
|
+
graph[models[i]] = {
|
|
4666
|
+
// http://jsperf.com/1-vs-infinity
|
|
4667
|
+
// micro-opt, but this is simple.
|
|
4668
|
+
distance: -1,
|
|
4669
|
+
parent: null
|
|
4670
|
+
};
|
|
4671
|
+
}
|
|
4672
|
+
return graph;
|
|
4673
|
+
}
|
|
4674
|
+
function deriveBFS(fromModel) {
|
|
4675
|
+
const graph = buildGraph();
|
|
4676
|
+
const queue = [fromModel];
|
|
4677
|
+
graph[fromModel].distance = 0;
|
|
4678
|
+
while (queue.length) {
|
|
4679
|
+
const current = queue.pop();
|
|
4680
|
+
const adjacents = Object.keys(conversions2[current]);
|
|
4681
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
4682
|
+
const adjacent = adjacents[i];
|
|
4683
|
+
const node = graph[adjacent];
|
|
4684
|
+
if (node.distance === -1) {
|
|
4685
|
+
node.distance = graph[current].distance + 1;
|
|
4686
|
+
node.parent = current;
|
|
4687
|
+
queue.unshift(adjacent);
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
}
|
|
4691
|
+
return graph;
|
|
4692
|
+
}
|
|
4693
|
+
function link(from, to) {
|
|
4694
|
+
return function(args) {
|
|
4695
|
+
return to(from(args));
|
|
4696
|
+
};
|
|
4697
|
+
}
|
|
4698
|
+
function wrapConversion(toModel, graph) {
|
|
4699
|
+
const path = [graph[toModel].parent, toModel];
|
|
4700
|
+
let fn = conversions2[graph[toModel].parent][toModel];
|
|
4701
|
+
let cur = graph[toModel].parent;
|
|
4702
|
+
while (graph[cur].parent) {
|
|
4703
|
+
path.unshift(graph[cur].parent);
|
|
4704
|
+
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
4705
|
+
cur = graph[cur].parent;
|
|
4706
|
+
}
|
|
4707
|
+
fn.conversion = path;
|
|
4708
|
+
return fn;
|
|
4709
|
+
}
|
|
4710
|
+
route = function(fromModel) {
|
|
4711
|
+
const graph = deriveBFS(fromModel);
|
|
4712
|
+
const conversion = {};
|
|
4713
|
+
const models = Object.keys(graph);
|
|
4714
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
4715
|
+
const toModel = models[i];
|
|
4716
|
+
const node = graph[toModel];
|
|
4717
|
+
if (node.parent === null) {
|
|
4718
|
+
continue;
|
|
4719
|
+
}
|
|
4720
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
4721
|
+
}
|
|
4722
|
+
return conversion;
|
|
4723
|
+
};
|
|
4724
|
+
return route;
|
|
4725
|
+
}
|
|
4726
|
+
var colorConvert;
|
|
4727
|
+
var hasRequiredColorConvert;
|
|
4728
|
+
function requireColorConvert() {
|
|
4729
|
+
if (hasRequiredColorConvert)
|
|
4730
|
+
return colorConvert;
|
|
4731
|
+
hasRequiredColorConvert = 1;
|
|
4732
|
+
const conversions2 = requireConversions();
|
|
4733
|
+
const route2 = requireRoute();
|
|
4734
|
+
const convert = {};
|
|
4735
|
+
const models = Object.keys(conversions2);
|
|
4736
|
+
function wrapRaw(fn) {
|
|
4737
|
+
const wrappedFn = function(...args) {
|
|
4738
|
+
const arg0 = args[0];
|
|
4739
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
4740
|
+
return arg0;
|
|
4741
|
+
}
|
|
4742
|
+
if (arg0.length > 1) {
|
|
4743
|
+
args = arg0;
|
|
4744
|
+
}
|
|
4745
|
+
return fn(args);
|
|
4746
|
+
};
|
|
4747
|
+
if ("conversion" in fn) {
|
|
4748
|
+
wrappedFn.conversion = fn.conversion;
|
|
4749
|
+
}
|
|
4750
|
+
return wrappedFn;
|
|
4751
|
+
}
|
|
4752
|
+
function wrapRounded(fn) {
|
|
4753
|
+
const wrappedFn = function(...args) {
|
|
4754
|
+
const arg0 = args[0];
|
|
4755
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
4756
|
+
return arg0;
|
|
4757
|
+
}
|
|
4758
|
+
if (arg0.length > 1) {
|
|
4759
|
+
args = arg0;
|
|
4760
|
+
}
|
|
4761
|
+
const result = fn(args);
|
|
4762
|
+
if (typeof result === "object") {
|
|
4763
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
4764
|
+
result[i] = Math.round(result[i]);
|
|
4765
|
+
}
|
|
4766
|
+
}
|
|
4767
|
+
return result;
|
|
4768
|
+
};
|
|
4769
|
+
if ("conversion" in fn) {
|
|
4770
|
+
wrappedFn.conversion = fn.conversion;
|
|
4771
|
+
}
|
|
4772
|
+
return wrappedFn;
|
|
4773
|
+
}
|
|
4774
|
+
models.forEach((fromModel) => {
|
|
4775
|
+
convert[fromModel] = {};
|
|
4776
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
|
|
4777
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
|
|
4778
|
+
const routes = route2(fromModel);
|
|
4779
|
+
const routeModels = Object.keys(routes);
|
|
4780
|
+
routeModels.forEach((toModel) => {
|
|
4781
|
+
const fn = routes[toModel];
|
|
4782
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
4783
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
4784
|
+
});
|
|
4785
|
+
});
|
|
4786
|
+
colorConvert = convert;
|
|
4787
|
+
return colorConvert;
|
|
4788
|
+
}
|
|
4789
|
+
ansiStyles$1.exports;
|
|
4790
|
+
(function(module) {
|
|
4791
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
4792
|
+
const code = fn(...args);
|
|
4793
|
+
return `\x1B[${code + offset}m`;
|
|
4794
|
+
};
|
|
4795
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
4796
|
+
const code = fn(...args);
|
|
4797
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
4798
|
+
};
|
|
4799
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
4800
|
+
const rgb = fn(...args);
|
|
4801
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
4802
|
+
};
|
|
4803
|
+
const ansi2ansi = (n) => n;
|
|
4804
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
4805
|
+
const setLazyProperty = (object, property, get) => {
|
|
4806
|
+
Object.defineProperty(object, property, {
|
|
4807
|
+
get: () => {
|
|
4808
|
+
const value = get();
|
|
4809
|
+
Object.defineProperty(object, property, {
|
|
4810
|
+
value,
|
|
4811
|
+
enumerable: true,
|
|
4812
|
+
configurable: true
|
|
4813
|
+
});
|
|
4814
|
+
return value;
|
|
4815
|
+
},
|
|
4816
|
+
enumerable: true,
|
|
4817
|
+
configurable: true
|
|
4818
|
+
});
|
|
4819
|
+
};
|
|
4820
|
+
let colorConvert2;
|
|
4821
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
4822
|
+
if (colorConvert2 === void 0) {
|
|
4823
|
+
colorConvert2 = requireColorConvert();
|
|
4824
|
+
}
|
|
4825
|
+
const offset = isBackground ? 10 : 0;
|
|
4826
|
+
const styles2 = {};
|
|
4827
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
4828
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
4829
|
+
if (sourceSpace === targetSpace) {
|
|
4830
|
+
styles2[name] = wrap(identity, offset);
|
|
4831
|
+
} else if (typeof suite === "object") {
|
|
4832
|
+
styles2[name] = wrap(suite[targetSpace], offset);
|
|
4833
|
+
}
|
|
4834
|
+
}
|
|
4835
|
+
return styles2;
|
|
4836
|
+
};
|
|
4837
|
+
function assembleStyles() {
|
|
4838
|
+
const codes = /* @__PURE__ */ new Map();
|
|
4839
|
+
const styles2 = {
|
|
4840
|
+
modifier: {
|
|
4841
|
+
reset: [0, 0],
|
|
4842
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
4843
|
+
bold: [1, 22],
|
|
4844
|
+
dim: [2, 22],
|
|
4845
|
+
italic: [3, 23],
|
|
4846
|
+
underline: [4, 24],
|
|
4847
|
+
inverse: [7, 27],
|
|
4848
|
+
hidden: [8, 28],
|
|
4849
|
+
strikethrough: [9, 29]
|
|
4850
|
+
},
|
|
4851
|
+
color: {
|
|
4852
|
+
black: [30, 39],
|
|
4853
|
+
red: [31, 39],
|
|
4854
|
+
green: [32, 39],
|
|
4855
|
+
yellow: [33, 39],
|
|
4856
|
+
blue: [34, 39],
|
|
4857
|
+
magenta: [35, 39],
|
|
4858
|
+
cyan: [36, 39],
|
|
4859
|
+
white: [37, 39],
|
|
4860
|
+
// Bright color
|
|
4861
|
+
blackBright: [90, 39],
|
|
4862
|
+
redBright: [91, 39],
|
|
4863
|
+
greenBright: [92, 39],
|
|
4864
|
+
yellowBright: [93, 39],
|
|
4865
|
+
blueBright: [94, 39],
|
|
4866
|
+
magentaBright: [95, 39],
|
|
4867
|
+
cyanBright: [96, 39],
|
|
4868
|
+
whiteBright: [97, 39]
|
|
4869
|
+
},
|
|
4870
|
+
bgColor: {
|
|
4871
|
+
bgBlack: [40, 49],
|
|
4872
|
+
bgRed: [41, 49],
|
|
4873
|
+
bgGreen: [42, 49],
|
|
4874
|
+
bgYellow: [43, 49],
|
|
4875
|
+
bgBlue: [44, 49],
|
|
4876
|
+
bgMagenta: [45, 49],
|
|
4877
|
+
bgCyan: [46, 49],
|
|
4878
|
+
bgWhite: [47, 49],
|
|
4879
|
+
// Bright color
|
|
4880
|
+
bgBlackBright: [100, 49],
|
|
4881
|
+
bgRedBright: [101, 49],
|
|
4882
|
+
bgGreenBright: [102, 49],
|
|
4883
|
+
bgYellowBright: [103, 49],
|
|
4884
|
+
bgBlueBright: [104, 49],
|
|
4885
|
+
bgMagentaBright: [105, 49],
|
|
4886
|
+
bgCyanBright: [106, 49],
|
|
4887
|
+
bgWhiteBright: [107, 49]
|
|
4888
|
+
}
|
|
4889
|
+
};
|
|
4890
|
+
styles2.color.gray = styles2.color.blackBright;
|
|
4891
|
+
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
4892
|
+
styles2.color.grey = styles2.color.blackBright;
|
|
4893
|
+
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
4894
|
+
for (const [groupName, group] of Object.entries(styles2)) {
|
|
4895
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
4896
|
+
styles2[styleName] = {
|
|
4897
|
+
open: `\x1B[${style[0]}m`,
|
|
4898
|
+
close: `\x1B[${style[1]}m`
|
|
4899
|
+
};
|
|
4900
|
+
group[styleName] = styles2[styleName];
|
|
4901
|
+
codes.set(style[0], style[1]);
|
|
4902
|
+
}
|
|
4903
|
+
Object.defineProperty(styles2, groupName, {
|
|
4904
|
+
value: group,
|
|
4905
|
+
enumerable: false
|
|
4906
|
+
});
|
|
4907
|
+
}
|
|
4908
|
+
Object.defineProperty(styles2, "codes", {
|
|
4909
|
+
value: codes,
|
|
4910
|
+
enumerable: false
|
|
4911
|
+
});
|
|
4912
|
+
styles2.color.close = "\x1B[39m";
|
|
4913
|
+
styles2.bgColor.close = "\x1B[49m";
|
|
4914
|
+
setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
4915
|
+
setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
4916
|
+
setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
4917
|
+
setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
4918
|
+
setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
4919
|
+
setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
4920
|
+
return styles2;
|
|
4921
|
+
}
|
|
4922
|
+
Object.defineProperty(module, "exports", {
|
|
4923
|
+
enumerable: true,
|
|
4924
|
+
get: assembleStyles
|
|
4925
|
+
});
|
|
4926
|
+
})(ansiStyles$1);
|
|
4927
|
+
var ansiStylesExports = ansiStyles$1.exports;
|
|
4928
|
+
var browser = {
|
|
4929
|
+
stdout: false,
|
|
4930
|
+
stderr: false
|
|
4931
|
+
};
|
|
4932
|
+
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
4933
|
+
let index = string.indexOf(substring);
|
|
4934
|
+
if (index === -1) {
|
|
4935
|
+
return string;
|
|
4936
|
+
}
|
|
4937
|
+
const substringLength = substring.length;
|
|
4938
|
+
let endIndex = 0;
|
|
4939
|
+
let returnValue = "";
|
|
4940
|
+
do {
|
|
4941
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
4942
|
+
endIndex = index + substringLength;
|
|
4943
|
+
index = string.indexOf(substring, endIndex);
|
|
4944
|
+
} while (index !== -1);
|
|
4945
|
+
returnValue += string.substr(endIndex);
|
|
4946
|
+
return returnValue;
|
|
4947
|
+
};
|
|
4948
|
+
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
4949
|
+
let endIndex = 0;
|
|
4950
|
+
let returnValue = "";
|
|
4951
|
+
do {
|
|
4952
|
+
const gotCR = string[index - 1] === "\r";
|
|
4953
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
4954
|
+
endIndex = index + 1;
|
|
4955
|
+
index = string.indexOf("\n", endIndex);
|
|
4956
|
+
} while (index !== -1);
|
|
4957
|
+
returnValue += string.substr(endIndex);
|
|
4958
|
+
return returnValue;
|
|
4959
|
+
};
|
|
4960
|
+
var util = {
|
|
4961
|
+
stringReplaceAll: stringReplaceAll$1,
|
|
4962
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
4963
|
+
};
|
|
4964
|
+
var templates;
|
|
4965
|
+
var hasRequiredTemplates;
|
|
4966
|
+
function requireTemplates() {
|
|
4967
|
+
if (hasRequiredTemplates)
|
|
4968
|
+
return templates;
|
|
4969
|
+
hasRequiredTemplates = 1;
|
|
4970
|
+
const 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;
|
|
4971
|
+
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
4972
|
+
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
4973
|
+
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
4974
|
+
const ESCAPES = /* @__PURE__ */ new Map([
|
|
4975
|
+
["n", "\n"],
|
|
4976
|
+
["r", "\r"],
|
|
4977
|
+
["t", " "],
|
|
4978
|
+
["b", "\b"],
|
|
4979
|
+
["f", "\f"],
|
|
4980
|
+
["v", "\v"],
|
|
4981
|
+
["0", "\0"],
|
|
4982
|
+
["\\", "\\"],
|
|
4983
|
+
["e", "\x1B"],
|
|
4984
|
+
["a", "\x07"]
|
|
4985
|
+
]);
|
|
4986
|
+
function unescape2(c) {
|
|
4987
|
+
const u = c[0] === "u";
|
|
4988
|
+
const bracket = c[1] === "{";
|
|
4989
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
4990
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
4991
|
+
}
|
|
4992
|
+
if (u && bracket) {
|
|
4993
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
4994
|
+
}
|
|
4995
|
+
return ESCAPES.get(c) || c;
|
|
4996
|
+
}
|
|
4997
|
+
function parseArguments(name, arguments_) {
|
|
4998
|
+
const results = [];
|
|
4999
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
5000
|
+
let matches;
|
|
5001
|
+
for (const chunk of chunks) {
|
|
5002
|
+
const number = Number(chunk);
|
|
5003
|
+
if (!Number.isNaN(number)) {
|
|
5004
|
+
results.push(number);
|
|
5005
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
5006
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape2(escape2) : character));
|
|
5007
|
+
} else {
|
|
5008
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
5009
|
+
}
|
|
5010
|
+
}
|
|
5011
|
+
return results;
|
|
5012
|
+
}
|
|
5013
|
+
function parseStyle(style) {
|
|
5014
|
+
STYLE_REGEX.lastIndex = 0;
|
|
5015
|
+
const results = [];
|
|
5016
|
+
let matches;
|
|
5017
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
5018
|
+
const name = matches[1];
|
|
5019
|
+
if (matches[2]) {
|
|
5020
|
+
const args = parseArguments(name, matches[2]);
|
|
5021
|
+
results.push([name].concat(args));
|
|
5022
|
+
} else {
|
|
5023
|
+
results.push([name]);
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5026
|
+
return results;
|
|
5027
|
+
}
|
|
5028
|
+
function buildStyle(chalk2, styles2) {
|
|
5029
|
+
const enabled = {};
|
|
5030
|
+
for (const layer of styles2) {
|
|
5031
|
+
for (const style of layer.styles) {
|
|
5032
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
let current = chalk2;
|
|
5036
|
+
for (const [styleName, styles3] of Object.entries(enabled)) {
|
|
5037
|
+
if (!Array.isArray(styles3)) {
|
|
5038
|
+
continue;
|
|
5039
|
+
}
|
|
5040
|
+
if (!(styleName in current)) {
|
|
5041
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
5042
|
+
}
|
|
5043
|
+
current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
|
|
5044
|
+
}
|
|
5045
|
+
return current;
|
|
5046
|
+
}
|
|
5047
|
+
templates = (chalk2, temporary) => {
|
|
5048
|
+
const styles2 = [];
|
|
5049
|
+
const chunks = [];
|
|
5050
|
+
let chunk = [];
|
|
5051
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
5052
|
+
if (escapeCharacter) {
|
|
5053
|
+
chunk.push(unescape2(escapeCharacter));
|
|
5054
|
+
} else if (style) {
|
|
5055
|
+
const string = chunk.join("");
|
|
5056
|
+
chunk = [];
|
|
5057
|
+
chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
|
|
5058
|
+
styles2.push({ inverse, styles: parseStyle(style) });
|
|
5059
|
+
} else if (close) {
|
|
5060
|
+
if (styles2.length === 0) {
|
|
5061
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
5062
|
+
}
|
|
5063
|
+
chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
|
|
5064
|
+
chunk = [];
|
|
5065
|
+
styles2.pop();
|
|
5066
|
+
} else {
|
|
5067
|
+
chunk.push(character);
|
|
5068
|
+
}
|
|
5069
|
+
});
|
|
5070
|
+
chunks.push(chunk.join(""));
|
|
5071
|
+
if (styles2.length > 0) {
|
|
5072
|
+
const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
|
|
5073
|
+
throw new Error(errMessage);
|
|
5074
|
+
}
|
|
5075
|
+
return chunks.join("");
|
|
5076
|
+
};
|
|
5077
|
+
return templates;
|
|
5078
|
+
}
|
|
5079
|
+
const ansiStyles = ansiStylesExports;
|
|
5080
|
+
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
5081
|
+
const {
|
|
5082
|
+
stringReplaceAll,
|
|
5083
|
+
stringEncaseCRLFWithFirstIndex
|
|
5084
|
+
} = util;
|
|
5085
|
+
const { isArray } = Array;
|
|
5086
|
+
const levelMapping = [
|
|
5087
|
+
"ansi",
|
|
5088
|
+
"ansi",
|
|
5089
|
+
"ansi256",
|
|
5090
|
+
"ansi16m"
|
|
5091
|
+
];
|
|
5092
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
5093
|
+
const applyOptions = (object, options = {}) => {
|
|
5094
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
5095
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
5096
|
+
}
|
|
5097
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
5098
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
5099
|
+
};
|
|
5100
|
+
class ChalkClass2 {
|
|
5101
|
+
constructor(options) {
|
|
5102
|
+
return chalkFactory(options);
|
|
5103
|
+
}
|
|
5104
|
+
}
|
|
5105
|
+
const chalkFactory = (options) => {
|
|
5106
|
+
const chalk2 = {};
|
|
5107
|
+
applyOptions(chalk2, options);
|
|
5108
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
5109
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
5110
|
+
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
5111
|
+
chalk2.template.constructor = () => {
|
|
5112
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
5113
|
+
};
|
|
5114
|
+
chalk2.template.Instance = ChalkClass2;
|
|
5115
|
+
return chalk2.template;
|
|
5116
|
+
};
|
|
5117
|
+
function Chalk(options) {
|
|
5118
|
+
return chalkFactory(options);
|
|
5119
|
+
}
|
|
5120
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
5121
|
+
styles[styleName] = {
|
|
5122
|
+
get() {
|
|
5123
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
5124
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
5125
|
+
return builder;
|
|
5126
|
+
}
|
|
5127
|
+
};
|
|
5128
|
+
}
|
|
5129
|
+
styles.visible = {
|
|
5130
|
+
get() {
|
|
5131
|
+
const builder = createBuilder(this, this._styler, true);
|
|
5132
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
5133
|
+
return builder;
|
|
5134
|
+
}
|
|
5135
|
+
};
|
|
5136
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
5137
|
+
for (const model of usedModels) {
|
|
5138
|
+
styles[model] = {
|
|
5139
|
+
get() {
|
|
5140
|
+
const { level } = this;
|
|
5141
|
+
return function(...arguments_) {
|
|
5142
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
5143
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
5144
|
+
};
|
|
5145
|
+
}
|
|
5146
|
+
};
|
|
5147
|
+
}
|
|
5148
|
+
for (const model of usedModels) {
|
|
5149
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
5150
|
+
styles[bgModel] = {
|
|
5151
|
+
get() {
|
|
5152
|
+
const { level } = this;
|
|
5153
|
+
return function(...arguments_) {
|
|
5154
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
5155
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
5156
|
+
};
|
|
5157
|
+
}
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
const proto = Object.defineProperties(() => {
|
|
5161
|
+
}, {
|
|
5162
|
+
...styles,
|
|
5163
|
+
level: {
|
|
5164
|
+
enumerable: true,
|
|
5165
|
+
get() {
|
|
5166
|
+
return this._generator.level;
|
|
5167
|
+
},
|
|
5168
|
+
set(level) {
|
|
5169
|
+
this._generator.level = level;
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
});
|
|
5173
|
+
const createStyler = (open, close, parent) => {
|
|
5174
|
+
let openAll;
|
|
5175
|
+
let closeAll;
|
|
5176
|
+
if (parent === void 0) {
|
|
5177
|
+
openAll = open;
|
|
5178
|
+
closeAll = close;
|
|
5179
|
+
} else {
|
|
5180
|
+
openAll = parent.openAll + open;
|
|
5181
|
+
closeAll = close + parent.closeAll;
|
|
5182
|
+
}
|
|
5183
|
+
return {
|
|
5184
|
+
open,
|
|
5185
|
+
close,
|
|
5186
|
+
openAll,
|
|
5187
|
+
closeAll,
|
|
5188
|
+
parent
|
|
5189
|
+
};
|
|
5190
|
+
};
|
|
5191
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
5192
|
+
const builder = (...arguments_) => {
|
|
5193
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
5194
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
5195
|
+
}
|
|
5196
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
5197
|
+
};
|
|
5198
|
+
Object.setPrototypeOf(builder, proto);
|
|
5199
|
+
builder._generator = self2;
|
|
5200
|
+
builder._styler = _styler;
|
|
5201
|
+
builder._isEmpty = _isEmpty;
|
|
5202
|
+
return builder;
|
|
5203
|
+
};
|
|
5204
|
+
const applyStyle = (self2, string) => {
|
|
5205
|
+
if (self2.level <= 0 || !string) {
|
|
5206
|
+
return self2._isEmpty ? "" : string;
|
|
5207
|
+
}
|
|
5208
|
+
let styler = self2._styler;
|
|
5209
|
+
if (styler === void 0) {
|
|
5210
|
+
return string;
|
|
5211
|
+
}
|
|
5212
|
+
const { openAll, closeAll } = styler;
|
|
5213
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
5214
|
+
while (styler !== void 0) {
|
|
5215
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
5216
|
+
styler = styler.parent;
|
|
5217
|
+
}
|
|
5218
|
+
}
|
|
5219
|
+
const lfIndex = string.indexOf("\n");
|
|
5220
|
+
if (lfIndex !== -1) {
|
|
5221
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
5222
|
+
}
|
|
5223
|
+
return openAll + string + closeAll;
|
|
5224
|
+
};
|
|
5225
|
+
let template;
|
|
5226
|
+
const chalkTag = (chalk2, ...strings) => {
|
|
5227
|
+
const [firstString] = strings;
|
|
5228
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
5229
|
+
return strings.join(" ");
|
|
5230
|
+
}
|
|
5231
|
+
const arguments_ = strings.slice(1);
|
|
5232
|
+
const parts = [firstString.raw[0]];
|
|
5233
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
5234
|
+
parts.push(
|
|
5235
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
5236
|
+
String(firstString.raw[i])
|
|
5237
|
+
);
|
|
5238
|
+
}
|
|
5239
|
+
if (template === void 0) {
|
|
5240
|
+
template = requireTemplates();
|
|
5241
|
+
}
|
|
5242
|
+
return template(chalk2, parts.join(""));
|
|
5243
|
+
};
|
|
5244
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
5245
|
+
const chalk = Chalk();
|
|
5246
|
+
chalk.supportsColor = stdoutColor;
|
|
5247
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
5248
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
5249
|
+
const STSInstrumentControllerPluginKey = Symbol();
|
|
5250
|
+
new TextEncoder();
|
|
5251
|
+
new TextDecoder();
|
|
5252
|
+
var ExtData = (
|
|
5253
|
+
/** @class */
|
|
5254
|
+
/* @__PURE__ */ function() {
|
|
5255
|
+
function ExtData2(type, data) {
|
|
5256
|
+
this.type = type;
|
|
5257
|
+
this.data = data;
|
|
5258
|
+
}
|
|
5259
|
+
return ExtData2;
|
|
5260
|
+
}()
|
|
5261
|
+
);
|
|
5262
|
+
var __extends = /* @__PURE__ */ function() {
|
|
5263
|
+
var extendStatics = function(d, b) {
|
|
5264
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
5265
|
+
d2.__proto__ = b2;
|
|
5266
|
+
} || function(d2, b2) {
|
|
5267
|
+
for (var p in b2)
|
|
5268
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
5269
|
+
d2[p] = b2[p];
|
|
5270
|
+
};
|
|
5271
|
+
return extendStatics(d, b);
|
|
5272
|
+
};
|
|
5273
|
+
return function(d, b) {
|
|
5274
|
+
if (typeof b !== "function" && b !== null)
|
|
5275
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
5276
|
+
extendStatics(d, b);
|
|
5277
|
+
function __() {
|
|
5278
|
+
this.constructor = d;
|
|
5279
|
+
}
|
|
5280
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5281
|
+
};
|
|
5282
|
+
}();
|
|
5283
|
+
var DecodeError = (
|
|
5284
|
+
/** @class */
|
|
5285
|
+
function(_super) {
|
|
5286
|
+
__extends(DecodeError2, _super);
|
|
5287
|
+
function DecodeError2(message) {
|
|
5288
|
+
var _this = _super.call(this, message) || this;
|
|
5289
|
+
var proto2 = Object.create(DecodeError2.prototype);
|
|
5290
|
+
Object.setPrototypeOf(_this, proto2);
|
|
5291
|
+
Object.defineProperty(_this, "name", {
|
|
5292
|
+
configurable: true,
|
|
5293
|
+
enumerable: false,
|
|
5294
|
+
value: DecodeError2.name
|
|
5295
|
+
});
|
|
5296
|
+
return _this;
|
|
5297
|
+
}
|
|
5298
|
+
return DecodeError2;
|
|
5299
|
+
}(Error)
|
|
5300
|
+
);
|
|
5301
|
+
function setInt64(view, offset, value) {
|
|
5302
|
+
var high = Math.floor(value / 4294967296);
|
|
5303
|
+
var low = value;
|
|
5304
|
+
view.setUint32(offset, high);
|
|
5305
|
+
view.setUint32(offset + 4, low);
|
|
5306
|
+
}
|
|
5307
|
+
function getInt64(view, offset) {
|
|
5308
|
+
var high = view.getInt32(offset);
|
|
5309
|
+
var low = view.getUint32(offset + 4);
|
|
5310
|
+
return high * 4294967296 + low;
|
|
5311
|
+
}
|
|
5312
|
+
var EXT_TIMESTAMP = -1;
|
|
5313
|
+
var TIMESTAMP32_MAX_SEC = 4294967296 - 1;
|
|
5314
|
+
var TIMESTAMP64_MAX_SEC = 17179869184 - 1;
|
|
5315
|
+
function encodeTimeSpecToTimestamp(_a2) {
|
|
5316
|
+
var sec = _a2.sec, nsec = _a2.nsec;
|
|
5317
|
+
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
5318
|
+
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
5319
|
+
var rv = new Uint8Array(4);
|
|
5320
|
+
var view = new DataView(rv.buffer);
|
|
5321
|
+
view.setUint32(0, sec);
|
|
5322
|
+
return rv;
|
|
5323
|
+
} else {
|
|
5324
|
+
var secHigh = sec / 4294967296;
|
|
5325
|
+
var secLow = sec & 4294967295;
|
|
5326
|
+
var rv = new Uint8Array(8);
|
|
5327
|
+
var view = new DataView(rv.buffer);
|
|
5328
|
+
view.setUint32(0, nsec << 2 | secHigh & 3);
|
|
5329
|
+
view.setUint32(4, secLow);
|
|
5330
|
+
return rv;
|
|
5331
|
+
}
|
|
5332
|
+
} else {
|
|
5333
|
+
var rv = new Uint8Array(12);
|
|
5334
|
+
var view = new DataView(rv.buffer);
|
|
5335
|
+
view.setUint32(0, nsec);
|
|
5336
|
+
setInt64(view, 4, sec);
|
|
5337
|
+
return rv;
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
function encodeDateToTimeSpec(date) {
|
|
5341
|
+
var msec = date.getTime();
|
|
5342
|
+
var sec = Math.floor(msec / 1e3);
|
|
5343
|
+
var nsec = (msec - sec * 1e3) * 1e6;
|
|
5344
|
+
var nsecInSec = Math.floor(nsec / 1e9);
|
|
5345
|
+
return {
|
|
5346
|
+
sec: sec + nsecInSec,
|
|
5347
|
+
nsec: nsec - nsecInSec * 1e9
|
|
5348
|
+
};
|
|
5349
|
+
}
|
|
5350
|
+
function encodeTimestampExtension(object) {
|
|
5351
|
+
if (object instanceof Date) {
|
|
5352
|
+
var timeSpec = encodeDateToTimeSpec(object);
|
|
5353
|
+
return encodeTimeSpecToTimestamp(timeSpec);
|
|
5354
|
+
} else {
|
|
5355
|
+
return null;
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
function decodeTimestampToTimeSpec(data) {
|
|
5359
|
+
var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
5360
|
+
switch (data.byteLength) {
|
|
5361
|
+
case 4: {
|
|
5362
|
+
var sec = view.getUint32(0);
|
|
5363
|
+
var nsec = 0;
|
|
5364
|
+
return { sec, nsec };
|
|
5365
|
+
}
|
|
5366
|
+
case 8: {
|
|
5367
|
+
var nsec30AndSecHigh2 = view.getUint32(0);
|
|
5368
|
+
var secLow32 = view.getUint32(4);
|
|
5369
|
+
var sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32;
|
|
5370
|
+
var nsec = nsec30AndSecHigh2 >>> 2;
|
|
5371
|
+
return { sec, nsec };
|
|
5372
|
+
}
|
|
5373
|
+
case 12: {
|
|
5374
|
+
var sec = getInt64(view, 4);
|
|
5375
|
+
var nsec = view.getUint32(0);
|
|
5376
|
+
return { sec, nsec };
|
|
5377
|
+
}
|
|
5378
|
+
default:
|
|
5379
|
+
throw new DecodeError("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(data.length));
|
|
5380
|
+
}
|
|
5381
|
+
}
|
|
5382
|
+
function decodeTimestampExtension(data) {
|
|
5383
|
+
var timeSpec = decodeTimestampToTimeSpec(data);
|
|
5384
|
+
return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
|
|
5385
|
+
}
|
|
5386
|
+
var timestampExtension = {
|
|
5387
|
+
type: EXT_TIMESTAMP,
|
|
5388
|
+
encode: encodeTimestampExtension,
|
|
5389
|
+
decode: decodeTimestampExtension
|
|
5390
|
+
};
|
|
5391
|
+
/** @class */
|
|
5392
|
+
(function() {
|
|
5393
|
+
function ExtensionCodec2() {
|
|
5394
|
+
this.builtInEncoders = [];
|
|
5395
|
+
this.builtInDecoders = [];
|
|
5396
|
+
this.encoders = [];
|
|
5397
|
+
this.decoders = [];
|
|
5398
|
+
this.register(timestampExtension);
|
|
5399
|
+
}
|
|
5400
|
+
ExtensionCodec2.prototype.register = function(_a2) {
|
|
5401
|
+
var type = _a2.type, encode2 = _a2.encode, decode = _a2.decode;
|
|
5402
|
+
if (type >= 0) {
|
|
5403
|
+
this.encoders[type] = encode2;
|
|
5404
|
+
this.decoders[type] = decode;
|
|
5405
|
+
} else {
|
|
5406
|
+
var index = 1 + type;
|
|
5407
|
+
this.builtInEncoders[index] = encode2;
|
|
5408
|
+
this.builtInDecoders[index] = decode;
|
|
5409
|
+
}
|
|
5410
|
+
};
|
|
5411
|
+
ExtensionCodec2.prototype.tryToEncode = function(object, context) {
|
|
5412
|
+
for (var i = 0; i < this.builtInEncoders.length; i++) {
|
|
5413
|
+
var encodeExt = this.builtInEncoders[i];
|
|
5414
|
+
if (encodeExt != null) {
|
|
5415
|
+
var data = encodeExt(object, context);
|
|
5416
|
+
if (data != null) {
|
|
5417
|
+
var type = -1 - i;
|
|
5418
|
+
return new ExtData(type, data);
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
for (var i = 0; i < this.encoders.length; i++) {
|
|
5423
|
+
var encodeExt = this.encoders[i];
|
|
5424
|
+
if (encodeExt != null) {
|
|
5425
|
+
var data = encodeExt(object, context);
|
|
5426
|
+
if (data != null) {
|
|
5427
|
+
var type = i;
|
|
5428
|
+
return new ExtData(type, data);
|
|
5429
|
+
}
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5432
|
+
if (object instanceof ExtData) {
|
|
5433
|
+
return object;
|
|
5434
|
+
}
|
|
5435
|
+
return null;
|
|
5436
|
+
};
|
|
5437
|
+
ExtensionCodec2.prototype.decode = function(data, type, context) {
|
|
5438
|
+
var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
|
|
5439
|
+
if (decodeExt) {
|
|
5440
|
+
return decodeExt(data, type, context);
|
|
5441
|
+
} else {
|
|
5442
|
+
return new ExtData(type, data);
|
|
5443
|
+
}
|
|
5444
|
+
};
|
|
5445
|
+
ExtensionCodec2.defaultCodec = new ExtensionCodec2();
|
|
5446
|
+
return ExtensionCodec2;
|
|
5447
|
+
})();
|
|
5448
|
+
var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
|
|
5449
|
+
SubscriptionTopic2["AllServicesCombined"] = "AllServicesCombined";
|
|
5450
|
+
SubscriptionTopic2["Services"] = "Services";
|
|
5451
|
+
SubscriptionTopic2["ServiceInstances"] = "ServiceInstances";
|
|
5452
|
+
SubscriptionTopic2["ServiceInstance"] = "ServiceInstance";
|
|
5453
|
+
SubscriptionTopic2["AllAgentsCombined"] = "AllAgentsCombined";
|
|
5454
|
+
SubscriptionTopic2["Agents"] = "Agents";
|
|
5455
|
+
SubscriptionTopic2["AgentWorkers"] = "AgentWorkers";
|
|
5456
|
+
SubscriptionTopic2["AgentWorker"] = "AgentWorker";
|
|
5457
|
+
SubscriptionTopic2["AllLambdasCombined"] = "AllLambdasCombined";
|
|
5458
|
+
SubscriptionTopic2["LambdaTechnologies"] = "LambdaTechnologies";
|
|
5459
|
+
SubscriptionTopic2["LambdaSubTechnologies"] = "LambdaSubTechnologies";
|
|
5460
|
+
SubscriptionTopic2["LambdaSubTechnologiesInstance"] = "LambdaSubTechnologiesInstance";
|
|
5461
|
+
SubscriptionTopic2["LogProcessing"] = "LogProcessing";
|
|
5462
|
+
return SubscriptionTopic2;
|
|
5463
|
+
})(SubscriptionTopic || {});
|
|
5464
|
+
const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
|
|
5465
|
+
static GetModelNode(data) {
|
|
5466
|
+
const fixedSize = 2;
|
|
5467
|
+
const padLength = 9;
|
|
5468
|
+
try {
|
|
5469
|
+
return {
|
|
5470
|
+
val: data,
|
|
5471
|
+
vf: parseFloat(data.toString()).toFixed(fixedSize).padStart(padLength, " "),
|
|
5472
|
+
value: parseFloat(data.toString()).toFixed(fixedSize)
|
|
5473
|
+
};
|
|
5474
|
+
} catch (error) {
|
|
5475
|
+
return {
|
|
5476
|
+
val: 0,
|
|
5477
|
+
vf: "",
|
|
5478
|
+
value: ""
|
|
5479
|
+
};
|
|
5480
|
+
}
|
|
5481
|
+
}
|
|
5482
|
+
static GetModelNodeRawStringArray(data) {
|
|
5483
|
+
try {
|
|
5484
|
+
return {
|
|
5485
|
+
val: data
|
|
5486
|
+
};
|
|
5487
|
+
} catch (error) {
|
|
5488
|
+
return {
|
|
5489
|
+
val: []
|
|
5490
|
+
};
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
static GetModelNodeObject(data) {
|
|
5494
|
+
try {
|
|
5495
|
+
return {
|
|
5496
|
+
val: JSON.parse(data)
|
|
5497
|
+
};
|
|
5498
|
+
} catch (error) {
|
|
5499
|
+
return {
|
|
5500
|
+
val: null
|
|
5501
|
+
};
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
static GetModelNodeWithQuantile(data, quantileData) {
|
|
5505
|
+
let quantile2 = "";
|
|
5506
|
+
const quantileDataElementArray = [];
|
|
5507
|
+
for (const [key, val] of Object.entries(quantileData)) {
|
|
5508
|
+
quantile2 += parseFloat(val.toFixed(2)).toString().padStart(8, " ");
|
|
5509
|
+
quantileDataElementArray.push([
|
|
5510
|
+
key,
|
|
5511
|
+
val
|
|
5512
|
+
]);
|
|
5513
|
+
}
|
|
5514
|
+
const fixedSize = 2;
|
|
5515
|
+
const padLength = 9;
|
|
5516
|
+
try {
|
|
5517
|
+
return {
|
|
5518
|
+
val: data,
|
|
5519
|
+
vf: parseFloat(data.toString()).toFixed(fixedSize).padStart(padLength, " "),
|
|
5520
|
+
value: parseFloat(data.toString()).toFixed(fixedSize),
|
|
5521
|
+
percentile: quantileDataElementArray,
|
|
5522
|
+
percentileFormatted: quantile2
|
|
5523
|
+
};
|
|
5524
|
+
} catch (error) {
|
|
5525
|
+
return {
|
|
5526
|
+
val: 0,
|
|
5527
|
+
vf: "",
|
|
5528
|
+
value: "",
|
|
5529
|
+
percentile: [],
|
|
5530
|
+
percentileFormatted: ""
|
|
5531
|
+
};
|
|
5532
|
+
}
|
|
5533
|
+
}
|
|
5534
|
+
static GetModelNodeHistFromInfluxData(data) {
|
|
5535
|
+
try {
|
|
5536
|
+
const histVal = [];
|
|
5537
|
+
if (data) {
|
|
5538
|
+
for (const [key, val] of Object.entries(data)) {
|
|
5539
|
+
const dataElement = [
|
|
5540
|
+
val,
|
|
5541
|
+
key,
|
|
5542
|
+
parseInt(key)
|
|
5543
|
+
];
|
|
5544
|
+
histVal.push(dataElement);
|
|
5545
|
+
}
|
|
5546
|
+
}
|
|
5547
|
+
try {
|
|
5548
|
+
return {
|
|
5549
|
+
hist: histVal
|
|
5550
|
+
};
|
|
5551
|
+
} catch (error) {
|
|
5552
|
+
return {
|
|
5553
|
+
hist: []
|
|
5554
|
+
};
|
|
5555
|
+
}
|
|
5556
|
+
} catch (error) {
|
|
5557
|
+
return {
|
|
5558
|
+
hist: []
|
|
5559
|
+
};
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5562
|
+
static GetModelForService(id, data, subscribeToKafka, logger) {
|
|
5563
|
+
try {
|
|
5564
|
+
const parseLog = [];
|
|
5565
|
+
const model = {
|
|
5566
|
+
id,
|
|
5567
|
+
instruments: {}
|
|
5568
|
+
};
|
|
5569
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5570
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5571
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5572
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5573
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5574
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5575
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5576
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5577
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
|
|
5578
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
|
|
5579
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
|
|
5580
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
|
|
5581
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5582
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5583
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5584
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5585
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
|
|
5586
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
|
|
5587
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5588
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5589
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5590
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5591
|
+
_ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
|
|
5592
|
+
if (!subscribeToKafka) {
|
|
5593
|
+
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5594
|
+
}
|
|
5595
|
+
if (parseLog.length > 0) {
|
|
5596
|
+
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5597
|
+
}
|
|
5598
|
+
return model;
|
|
5599
|
+
} catch (error) {
|
|
5600
|
+
return null;
|
|
5601
|
+
}
|
|
5602
|
+
}
|
|
5603
|
+
static GetModelForLambda(id, data, subscribeToKafka, logger) {
|
|
5604
|
+
try {
|
|
5605
|
+
const parseLog = [];
|
|
5606
|
+
const model = {
|
|
5607
|
+
id,
|
|
5608
|
+
instruments: {}
|
|
5609
|
+
};
|
|
5610
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5611
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5612
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5613
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5614
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5615
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5616
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5617
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5618
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
|
|
5619
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
|
|
5620
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
|
|
5621
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
|
|
5622
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5623
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5624
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5625
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5626
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
|
|
5627
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
|
|
5628
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5629
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5630
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5631
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5632
|
+
_ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
|
|
5633
|
+
if (!subscribeToKafka) {
|
|
5634
|
+
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5635
|
+
}
|
|
5636
|
+
if (parseLog.length > 0) {
|
|
5637
|
+
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5638
|
+
}
|
|
5639
|
+
return model;
|
|
5640
|
+
} catch (error) {
|
|
5641
|
+
return null;
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
static GetModelForAgent(id, data, subscribeToKafka, logger) {
|
|
5645
|
+
try {
|
|
5646
|
+
if (Object.keys(data).length === 0) {
|
|
5647
|
+
return null;
|
|
5648
|
+
}
|
|
5649
|
+
const parseLog = [];
|
|
5650
|
+
const model = {
|
|
5651
|
+
id,
|
|
5652
|
+
instruments: {}
|
|
5653
|
+
};
|
|
5654
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5655
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5656
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5657
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5658
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5659
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5660
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5661
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5662
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5663
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5664
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5665
|
+
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5666
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5667
|
+
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5668
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5669
|
+
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5670
|
+
if (!subscribeToKafka) {
|
|
5671
|
+
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5672
|
+
}
|
|
5673
|
+
if (parseLog.length > 0) {
|
|
5674
|
+
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5675
|
+
}
|
|
5676
|
+
return model;
|
|
5677
|
+
} catch (error) {
|
|
5678
|
+
return null;
|
|
5679
|
+
}
|
|
5680
|
+
}
|
|
5681
|
+
};
|
|
5682
|
+
__publicField2(_ObservabilityModelUtils, "ParseModelNode", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5683
|
+
if (fieldName in data) {
|
|
5684
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNode(data[fieldName]);
|
|
5685
|
+
} else {
|
|
5686
|
+
parseLog.push(`ObservabilityModelUtils:ParseModelNode(): Field not present: [${fieldName}], default to [0]`);
|
|
5687
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNode(0);
|
|
5688
|
+
}
|
|
5689
|
+
});
|
|
5690
|
+
__publicField2(_ObservabilityModelUtils, "ParseModelNodeWithQuantile", (model, data, parseLog, gaugeName, fieldName, quantileFieldName) => {
|
|
5691
|
+
if (fieldName in data && quantileFieldName in data) {
|
|
5692
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(data[fieldName], data[quantileFieldName]);
|
|
5693
|
+
} else if (fieldName in data) {
|
|
5694
|
+
const dataVal = data[fieldName];
|
|
5695
|
+
parseLog.push(`ObservabilityModelUtils:ParseModelNodeWithQuantile(): QuantileFieldName not present: [${quantileFieldName}], default to [${dataVal},{}]`);
|
|
5696
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(dataVal, {});
|
|
5697
|
+
} else {
|
|
5698
|
+
parseLog.push(`ObservabilityModelUtils:ParseModelNodeWithQuantile(): Field not present: [${fieldName}], QuantileFieldName not present: [${quantileFieldName}], default to [0,{}]`);
|
|
5699
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(0, {});
|
|
5700
|
+
}
|
|
5701
|
+
});
|
|
5702
|
+
__publicField2(_ObservabilityModelUtils, "ParseModelNodeHisto", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5703
|
+
if (fieldName in data) {
|
|
5704
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeHistFromInfluxData(data[fieldName]);
|
|
5705
|
+
} else {
|
|
5706
|
+
parseLog.push(`ObservabilityModelUtils:ParseModelNodeHisto(): Field not present: [${fieldName}], default to [{}]`);
|
|
5707
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeHistFromInfluxData({});
|
|
5708
|
+
}
|
|
5709
|
+
});
|
|
5710
|
+
__publicField2(_ObservabilityModelUtils, "ParseModelNodeObject", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5711
|
+
if (fieldName in data) {
|
|
5712
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject(data[fieldName]);
|
|
5713
|
+
} else {
|
|
5714
|
+
parseLog.push(`ObservabilityModelUtils:ParseModelNodeObject(): Field not present: [${fieldName}], default to [{}]`);
|
|
5715
|
+
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject({});
|
|
5716
|
+
}
|
|
5717
|
+
});
|
|
5718
|
+
debugModule(`proc:${process.pid}`);
|
|
5719
|
+
const byteToHex = [];
|
|
5720
|
+
for (let i = 0; i < 256; ++i) {
|
|
5721
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
5722
|
+
}
|
|
5723
|
+
typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
5724
|
+
({
|
|
5725
|
+
coreFieldList: [
|
|
5726
|
+
{
|
|
5727
|
+
fieldName: "requestCount",
|
|
5728
|
+
gauge: Gauge.REQUEST_COUNT_GAUGE,
|
|
5729
|
+
instrumentProperty: "val",
|
|
5730
|
+
dataType: "number",
|
|
5731
|
+
influxdbDataType: "intField"
|
|
5732
|
+
/* intField */
|
|
5733
|
+
},
|
|
5734
|
+
{
|
|
5735
|
+
fieldName: "errorCount",
|
|
5736
|
+
gauge: Gauge.ERROR_COUNT_GAUGE,
|
|
5737
|
+
instrumentProperty: "val",
|
|
5738
|
+
dataType: "number",
|
|
5739
|
+
influxdbDataType: "intField"
|
|
5740
|
+
/* intField */
|
|
5741
|
+
},
|
|
5742
|
+
{
|
|
5743
|
+
fieldName: "retryCount",
|
|
5744
|
+
gauge: Gauge.RETRY_COUNT_GAUGE,
|
|
5745
|
+
instrumentProperty: "val",
|
|
5746
|
+
dataType: "number",
|
|
5747
|
+
influxdbDataType: "intField"
|
|
5748
|
+
/* intField */
|
|
5749
|
+
},
|
|
5750
|
+
{
|
|
5751
|
+
fieldName: "authenticationCount",
|
|
5752
|
+
gauge: Gauge.AUTHENTICATION_COUNT_GAUGE,
|
|
5753
|
+
instrumentProperty: "val",
|
|
5754
|
+
dataType: "number",
|
|
5755
|
+
influxdbDataType: "intField"
|
|
5756
|
+
/* intField */
|
|
5757
|
+
},
|
|
5758
|
+
{
|
|
5759
|
+
fieldName: "authenticationErrorCount",
|
|
5760
|
+
gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE,
|
|
5761
|
+
instrumentProperty: "val",
|
|
5762
|
+
dataType: "number",
|
|
5763
|
+
influxdbDataType: "intField"
|
|
5764
|
+
/* intField */
|
|
5765
|
+
},
|
|
5766
|
+
{
|
|
5767
|
+
fieldName: "authenticationRetryCount",
|
|
5768
|
+
gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE,
|
|
5769
|
+
instrumentProperty: "val",
|
|
5770
|
+
dataType: "number",
|
|
5771
|
+
influxdbDataType: "intField"
|
|
5772
|
+
/* intField */
|
|
5773
|
+
},
|
|
5774
|
+
{
|
|
5775
|
+
fieldName: "velocity",
|
|
5776
|
+
gauge: Gauge.VELOCITY_GAUGE,
|
|
5777
|
+
instrumentProperty: "va",
|
|
5778
|
+
dataType: "number",
|
|
5779
|
+
influxdbDataType: "floatField"
|
|
5780
|
+
/* floatField */
|
|
5781
|
+
},
|
|
5782
|
+
{
|
|
5783
|
+
fieldName: "activeRequestCount",
|
|
5784
|
+
gauge: Gauge.ACTIVE_REQUEST_GAUGE,
|
|
5785
|
+
instrumentProperty: "val",
|
|
5786
|
+
dataType: "number",
|
|
5787
|
+
timeSeriesIndex: true,
|
|
5788
|
+
quantile: true,
|
|
5789
|
+
influxdbDataType: "intField"
|
|
5790
|
+
/* intField */
|
|
5791
|
+
},
|
|
5792
|
+
{
|
|
5793
|
+
fieldName: "coreCount",
|
|
5794
|
+
gauge: Gauge.CORE_COUNT_GAUGE,
|
|
5795
|
+
instrumentProperty: "val",
|
|
5796
|
+
dataType: "number",
|
|
5797
|
+
influxdbDataType: "intField"
|
|
5798
|
+
/* intField */
|
|
5799
|
+
},
|
|
5800
|
+
{
|
|
5801
|
+
fieldName: "rx",
|
|
5802
|
+
gauge: Gauge.NETWORK_RX_GAUGE,
|
|
5803
|
+
instrumentProperty: "va",
|
|
5804
|
+
dataType: "number",
|
|
5805
|
+
influxdbDataType: "floatField"
|
|
5806
|
+
/* floatField */
|
|
5807
|
+
},
|
|
5808
|
+
{
|
|
5809
|
+
fieldName: "tx",
|
|
5810
|
+
gauge: Gauge.NETWORK_TX_GAUGE,
|
|
5811
|
+
instrumentProperty: "va",
|
|
5812
|
+
dataType: "number",
|
|
5813
|
+
influxdbDataType: "floatField"
|
|
5814
|
+
/* floatField */
|
|
5815
|
+
},
|
|
5816
|
+
{
|
|
5817
|
+
fieldName: "timer",
|
|
5818
|
+
gauge: Gauge.TIMER_GAUGE,
|
|
5819
|
+
instrumentProperty: "val",
|
|
5820
|
+
dataType: "number",
|
|
5821
|
+
influxdbDataType: "floatField"
|
|
5822
|
+
/* floatField */
|
|
5823
|
+
},
|
|
5824
|
+
{
|
|
5825
|
+
fieldName: "duration",
|
|
5826
|
+
gauge: Gauge.DURATION_GAUGE,
|
|
5827
|
+
instrumentProperty: "val",
|
|
5828
|
+
dataType: "number",
|
|
5829
|
+
timeSeriesIndex: true,
|
|
5830
|
+
quantile: true,
|
|
5831
|
+
influxdbDataType: "floatField",
|
|
5832
|
+
histo: [
|
|
5833
|
+
{ label: "B10", bucketLimit: 10 },
|
|
5834
|
+
{ label: "B20", bucketLimit: 20 },
|
|
5835
|
+
{ label: "B50", bucketLimit: 50 },
|
|
5836
|
+
{ label: "B100", bucketLimit: 100 },
|
|
5837
|
+
{ label: "B1000", bucketLimit: 1e3 },
|
|
5838
|
+
{ label: "B50000", bucketLimit: 5e4 },
|
|
5839
|
+
{ label: "BInfinity", bucketLimit: -1 }
|
|
5840
|
+
]
|
|
5841
|
+
},
|
|
5842
|
+
{
|
|
5843
|
+
fieldName: "latency",
|
|
5844
|
+
gauge: Gauge.LATENCY_GAUGE,
|
|
5845
|
+
instrumentProperty: "val",
|
|
5846
|
+
dataType: "number",
|
|
5847
|
+
timeSeriesIndex: true,
|
|
5848
|
+
quantile: true,
|
|
5849
|
+
influxdbDataType: "floatField",
|
|
5850
|
+
histo: [
|
|
5851
|
+
{ label: "B10", bucketLimit: 10 },
|
|
5852
|
+
{ label: "B20", bucketLimit: 20 },
|
|
5853
|
+
{ label: "B50", bucketLimit: 50 },
|
|
5854
|
+
{ label: "B100", bucketLimit: 100 },
|
|
5855
|
+
{ label: "B1000", bucketLimit: 1e3 },
|
|
5856
|
+
{ label: "B50000", bucketLimit: 5e4 },
|
|
5857
|
+
{ label: "BInfinity", bucketLimit: -1 }
|
|
5858
|
+
]
|
|
5859
|
+
}
|
|
5860
|
+
],
|
|
5861
|
+
services: {
|
|
5862
|
+
["service"]: {
|
|
5863
|
+
influxDBContextTags: [
|
|
5864
|
+
"serviceId",
|
|
5865
|
+
"serviceName",
|
|
5866
|
+
"serviceVersion",
|
|
5867
|
+
"serviceInstanceId",
|
|
5868
|
+
"serviceInstanceProcessId",
|
|
5869
|
+
"hostName",
|
|
5870
|
+
"pid",
|
|
5871
|
+
"ppid"
|
|
5872
|
+
],
|
|
5873
|
+
redisIndexPrefixDefinitions: {
|
|
5874
|
+
timeSeriesIndex: "idx:serviceIndexTimeSeries",
|
|
5875
|
+
timeSeriesPrefix: "/serviceTimeSeries:",
|
|
5876
|
+
instantIndex: "idx:serviceIndexInstant",
|
|
5877
|
+
instantPrefix: "/serviceInstant:"
|
|
5878
|
+
},
|
|
5879
|
+
fieldList: [
|
|
5880
|
+
{
|
|
5881
|
+
fieldName: "cpu",
|
|
5882
|
+
gauge: Gauge.CPU_LOAD_GAUGE,
|
|
5883
|
+
instrumentProperty: "val",
|
|
5884
|
+
dataType: "number",
|
|
5885
|
+
timeSeriesIndex: true,
|
|
5886
|
+
quantile: true,
|
|
5887
|
+
influxdbDataType: "floatField"
|
|
5888
|
+
/* floatField */
|
|
5889
|
+
},
|
|
5890
|
+
{
|
|
5891
|
+
fieldName: "connectionCount",
|
|
5892
|
+
gauge: Gauge.CONNECTION_COUNT_GAUGE,
|
|
5893
|
+
instrumentProperty: "val",
|
|
5894
|
+
dataType: "number",
|
|
5895
|
+
timeSeriesIndex: true,
|
|
5896
|
+
quantile: true,
|
|
5897
|
+
influxdbDataType: "intField"
|
|
5898
|
+
/* intField */
|
|
5899
|
+
},
|
|
5900
|
+
{
|
|
5901
|
+
fieldName: "connectionPoolCount",
|
|
5902
|
+
gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
|
|
5903
|
+
instrumentProperty: "val",
|
|
5904
|
+
dataType: "number",
|
|
5905
|
+
influxdbDataType: "intField"
|
|
5906
|
+
/* intField */
|
|
5907
|
+
},
|
|
5908
|
+
{
|
|
5909
|
+
fieldName: "connectionIdleCount",
|
|
5910
|
+
gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
|
|
5911
|
+
instrumentProperty: "val",
|
|
5912
|
+
dataType: "number",
|
|
5913
|
+
influxdbDataType: "intField"
|
|
5914
|
+
/* intField */
|
|
5915
|
+
},
|
|
5916
|
+
{
|
|
5917
|
+
fieldName: "connectionWaitingCount",
|
|
5918
|
+
gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
|
|
5919
|
+
instrumentProperty: "val",
|
|
5920
|
+
dataType: "number",
|
|
5921
|
+
influxdbDataType: "intField"
|
|
5922
|
+
/* intField */
|
|
5923
|
+
},
|
|
5924
|
+
{
|
|
5925
|
+
fieldName: "systemcpu",
|
|
5926
|
+
gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
|
|
5927
|
+
instrumentProperty: "val",
|
|
5928
|
+
dataType: "number",
|
|
5929
|
+
timeSeriesIndex: true,
|
|
5930
|
+
quantile: true,
|
|
5931
|
+
influxdbDataType: "floatField"
|
|
5932
|
+
/* floatField */
|
|
5933
|
+
},
|
|
5934
|
+
{
|
|
5935
|
+
fieldName: "memory",
|
|
5936
|
+
gauge: Gauge.OBJECT_GAUGE,
|
|
5937
|
+
instrumentProperty: "val",
|
|
5938
|
+
dataType: "JSON",
|
|
5939
|
+
influxdbDataType: "stringField"
|
|
5940
|
+
/* stringField */
|
|
5941
|
+
}
|
|
5942
|
+
],
|
|
5943
|
+
GetPathFromContext(context) {
|
|
5944
|
+
const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
|
|
5945
|
+
return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
|
|
5946
|
+
},
|
|
5947
|
+
redisQueryFilters: {
|
|
5948
|
+
level1ContextField: "serviceType",
|
|
5949
|
+
level2ContextField: "appid",
|
|
5950
|
+
level3ContextField: "appinstanceid"
|
|
5951
|
+
},
|
|
5952
|
+
subscriptionTopics: [
|
|
5953
|
+
{
|
|
5954
|
+
subscriptionTopic: SubscriptionTopic.AllServicesCombined,
|
|
5955
|
+
route: "/metrics"
|
|
5956
|
+
},
|
|
5957
|
+
{
|
|
5958
|
+
subscriptionTopic: SubscriptionTopic.Services,
|
|
5959
|
+
route: "/metrics/services"
|
|
5960
|
+
},
|
|
5961
|
+
{
|
|
5962
|
+
subscriptionTopic: SubscriptionTopic.ServiceInstances,
|
|
5963
|
+
route: "/metrics/services/:key"
|
|
5964
|
+
},
|
|
5965
|
+
{
|
|
5966
|
+
subscriptionTopic: SubscriptionTopic.ServiceInstance,
|
|
5967
|
+
route: "/metrics/services/:key/:subkey"
|
|
5968
|
+
}
|
|
5969
|
+
]
|
|
5970
|
+
},
|
|
5971
|
+
["agent"]: {
|
|
5972
|
+
influxDBContextTags: [
|
|
5973
|
+
"id",
|
|
5974
|
+
"hostName",
|
|
5975
|
+
"agentName",
|
|
5976
|
+
"threadId",
|
|
5977
|
+
"asyncRunnerId"
|
|
5978
|
+
],
|
|
5979
|
+
redisIndexPrefixDefinitions: {
|
|
5980
|
+
timeSeriesIndex: "idx:agentIndexTimeSeries",
|
|
5981
|
+
timeSeriesPrefix: "/agentTimeSeries:",
|
|
5982
|
+
instantIndex: "idx:agentIndexInstant",
|
|
5983
|
+
instantPrefix: "/agentInstant:"
|
|
5984
|
+
},
|
|
5985
|
+
fieldList: [
|
|
5986
|
+
{
|
|
5987
|
+
fieldName: "childCount",
|
|
5988
|
+
gauge: Gauge.CHILD_COUNT,
|
|
5989
|
+
instrumentProperty: "val",
|
|
5990
|
+
dataType: "number",
|
|
5991
|
+
influxdbDataType: "intField"
|
|
5992
|
+
/* intField */
|
|
5993
|
+
}
|
|
5994
|
+
],
|
|
5995
|
+
//@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
|
|
5996
|
+
GetPathFromContext(context) {
|
|
5997
|
+
const { agentName, threadId, asyncRunnerId } = context;
|
|
5998
|
+
return `/${agentName}/${threadId}/${asyncRunnerId}`;
|
|
5999
|
+
},
|
|
6000
|
+
redisQueryFilters: {
|
|
6001
|
+
level1ContextField: "serviceType",
|
|
6002
|
+
level2ContextField: "appid",
|
|
6003
|
+
//@@ this should be named something else
|
|
6004
|
+
level3ContextField: "appinstanceid"
|
|
6005
|
+
//@@ this should be named something else
|
|
6006
|
+
},
|
|
6007
|
+
subscriptionTopics: [
|
|
6008
|
+
{
|
|
6009
|
+
subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
|
|
6010
|
+
route: "/metrics"
|
|
6011
|
+
},
|
|
6012
|
+
{
|
|
6013
|
+
subscriptionTopic: SubscriptionTopic.Agents,
|
|
6014
|
+
route: "/metrics/agents"
|
|
6015
|
+
},
|
|
6016
|
+
{
|
|
6017
|
+
subscriptionTopic: SubscriptionTopic.AgentWorkers,
|
|
6018
|
+
route: "/metrics/agents/:key"
|
|
6019
|
+
},
|
|
6020
|
+
{
|
|
6021
|
+
subscriptionTopic: SubscriptionTopic.AgentWorker,
|
|
6022
|
+
route: "/metrics/agents/:key/:subkey"
|
|
6023
|
+
}
|
|
6024
|
+
]
|
|
6025
|
+
},
|
|
6026
|
+
["lambda"]: {
|
|
6027
|
+
influxDBContextTags: [
|
|
6028
|
+
"technology",
|
|
6029
|
+
"subTechnology",
|
|
6030
|
+
"lambdaFunctionName",
|
|
6031
|
+
"lambdaInstance",
|
|
6032
|
+
"hostName",
|
|
6033
|
+
"processId",
|
|
6034
|
+
"parentProcessId",
|
|
6035
|
+
"useCase",
|
|
6036
|
+
"pattern"
|
|
6037
|
+
],
|
|
6038
|
+
redisIndexPrefixDefinitions: {
|
|
6039
|
+
timeSeriesIndex: "idx:lambdaIndexTimeSeries",
|
|
6040
|
+
timeSeriesPrefix: "/lambdaTimeSeries:",
|
|
6041
|
+
instantIndex: "idx:lambdaIndexInstant",
|
|
6042
|
+
instantPrefix: "/lambdaInstant:"
|
|
6043
|
+
},
|
|
6044
|
+
fieldList: [
|
|
6045
|
+
{
|
|
6046
|
+
fieldName: "cpu",
|
|
6047
|
+
gauge: Gauge.CPU_LOAD_GAUGE,
|
|
6048
|
+
instrumentProperty: "val",
|
|
6049
|
+
dataType: "number",
|
|
6050
|
+
timeSeriesIndex: true,
|
|
6051
|
+
quantile: true,
|
|
6052
|
+
influxdbDataType: "floatField"
|
|
6053
|
+
/* floatField */
|
|
6054
|
+
},
|
|
6055
|
+
{
|
|
6056
|
+
fieldName: "connectionCount",
|
|
6057
|
+
gauge: Gauge.CONNECTION_COUNT_GAUGE,
|
|
6058
|
+
instrumentProperty: "val",
|
|
6059
|
+
dataType: "number",
|
|
6060
|
+
timeSeriesIndex: true,
|
|
6061
|
+
quantile: true,
|
|
6062
|
+
influxdbDataType: "intField"
|
|
6063
|
+
/* intField */
|
|
6064
|
+
},
|
|
6065
|
+
{
|
|
6066
|
+
fieldName: "connectionPoolCount",
|
|
6067
|
+
gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
|
|
6068
|
+
instrumentProperty: "val",
|
|
6069
|
+
dataType: "number",
|
|
6070
|
+
influxdbDataType: "intField"
|
|
6071
|
+
/* intField */
|
|
6072
|
+
},
|
|
6073
|
+
{
|
|
6074
|
+
fieldName: "connectionIdleCount",
|
|
6075
|
+
gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
|
|
6076
|
+
instrumentProperty: "val",
|
|
6077
|
+
dataType: "number",
|
|
6078
|
+
influxdbDataType: "intField"
|
|
6079
|
+
/* intField */
|
|
6080
|
+
},
|
|
6081
|
+
{
|
|
6082
|
+
fieldName: "connectionWaitingCount",
|
|
6083
|
+
gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
|
|
6084
|
+
instrumentProperty: "val",
|
|
6085
|
+
dataType: "number",
|
|
6086
|
+
influxdbDataType: "intField"
|
|
6087
|
+
/* intField */
|
|
6088
|
+
},
|
|
6089
|
+
{
|
|
6090
|
+
fieldName: "systemcpu",
|
|
6091
|
+
gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
|
|
6092
|
+
instrumentProperty: "val",
|
|
6093
|
+
dataType: "number",
|
|
6094
|
+
timeSeriesIndex: true,
|
|
6095
|
+
quantile: true,
|
|
6096
|
+
influxdbDataType: "floatField"
|
|
6097
|
+
/* floatField */
|
|
6098
|
+
},
|
|
6099
|
+
{
|
|
6100
|
+
fieldName: "memory",
|
|
6101
|
+
gauge: Gauge.OBJECT_GAUGE,
|
|
6102
|
+
instrumentProperty: "val",
|
|
6103
|
+
dataType: "JSON",
|
|
6104
|
+
influxdbDataType: "stringField"
|
|
6105
|
+
/* stringField */
|
|
6106
|
+
}
|
|
6107
|
+
],
|
|
6108
|
+
//@@ need type declare in appframework
|
|
6109
|
+
GetPathFromContext(context) {
|
|
6110
|
+
const { technology, subTechnology, lambdaInstance } = context;
|
|
6111
|
+
return `/${technology}/${subTechnology}/${lambdaInstance}`;
|
|
6112
|
+
},
|
|
6113
|
+
redisQueryFilters: {
|
|
6114
|
+
level1ContextField: "serviceType",
|
|
6115
|
+
level2ContextField: "technology",
|
|
6116
|
+
level3ContextField: "subTechnology"
|
|
6117
|
+
},
|
|
6118
|
+
subscriptionTopics: [
|
|
6119
|
+
{
|
|
6120
|
+
subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
|
|
6121
|
+
// uicontrollerlanding
|
|
6122
|
+
route: "/metrics"
|
|
6123
|
+
},
|
|
6124
|
+
{
|
|
6125
|
+
subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
|
|
6126
|
+
// uicontrollerlambda
|
|
6127
|
+
route: "/metrics/lambdas"
|
|
6128
|
+
},
|
|
6129
|
+
{
|
|
6130
|
+
subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
|
|
6131
|
+
// uicontrollerlambdasubtechnologies
|
|
6132
|
+
route: "/metrics/lambdas/:key"
|
|
6133
|
+
},
|
|
6134
|
+
{
|
|
6135
|
+
subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
|
|
6136
|
+
// uicontrollerlambdasubtechnologiesinstance
|
|
6137
|
+
route: "/metrics/lambdas/:key/:subkey"
|
|
6138
|
+
}
|
|
6139
|
+
]
|
|
6140
|
+
}
|
|
6141
|
+
}
|
|
6142
|
+
});
|
|
2538
6143
|
class STSOAuth2Manager {
|
|
2539
6144
|
// ms
|
|
2540
6145
|
constructor(app, options) {
|
|
@@ -2565,7 +6170,7 @@ class STSOAuth2Manager {
|
|
|
2565
6170
|
__privateAdd(this, _semaphoreRetrySleep, 50);
|
|
2566
6171
|
__privateAdd(this, _ProcessMessageResponse, (data) => {
|
|
2567
6172
|
const messageResponse = data;
|
|
2568
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6173
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
|
|
2569
6174
|
if (messageResponse.messageId === -1) {
|
|
2570
6175
|
switch (messageResponse.command) {
|
|
2571
6176
|
case IOauth2ListenerCommand.AUTHENTICATE_EVENT:
|
|
@@ -2602,10 +6207,10 @@ class STSOAuth2Manager {
|
|
|
2602
6207
|
__privateGet(this, _messageHandlers)[message.messageId] = (response) => {
|
|
2603
6208
|
clearTimeout(timeout);
|
|
2604
6209
|
delete __privateGet(this, _messageHandlers)[message.messageId];
|
|
2605
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6210
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
|
|
2606
6211
|
resolve(response);
|
|
2607
6212
|
};
|
|
2608
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6213
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
|
|
2609
6214
|
__privateGet(this, _oauth2ManagerPort).postMessage(message);
|
|
2610
6215
|
});
|
|
2611
6216
|
});
|
|
@@ -2649,10 +6254,10 @@ class STSOAuth2Manager {
|
|
|
2649
6254
|
}
|
|
2650
6255
|
});
|
|
2651
6256
|
__privateAdd(this, _SetupRoute, (app, router) => {
|
|
2652
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6257
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.gray(`STSOAuth2Manager:#SetupRoute`));
|
|
2653
6258
|
router.beforeEach(async (to, from, next) => {
|
|
2654
6259
|
const oAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey];
|
|
2655
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6260
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
|
|
2656
6261
|
if (__privateGet(this, _GetStore).call(this).LoggedIn === false) {
|
|
2657
6262
|
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, `Not logged in`);
|
|
2658
6263
|
if (to.path.localeCompare(`${__privateGet(this, _options).uriBase}authorize`) === 0) {
|
|
@@ -2683,9 +6288,9 @@ class STSOAuth2Manager {
|
|
|
2683
6288
|
}
|
|
2684
6289
|
const str = to.query;
|
|
2685
6290
|
if (str[OAuth2ParameterType.CODE] || str[OAuth2ParameterType.ERROR]) {
|
|
2686
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6291
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
|
|
2687
6292
|
const retVal = await oAuth2Manager.HandleRedirect(str);
|
|
2688
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6293
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
|
|
2689
6294
|
if (retVal) {
|
|
2690
6295
|
next({
|
|
2691
6296
|
path: `${__privateGet(this, _options).uriBase}`,
|
|
@@ -2741,7 +6346,7 @@ class STSOAuth2Manager {
|
|
|
2741
6346
|
throw new Error(`STSOAuth2Manager:ExecuteRefreshToken:maxSemaphoreRetries: [${__privateGet(this, _maxSemaphoreRetries)}] exceeded.`);
|
|
2742
6347
|
}
|
|
2743
6348
|
await Sleep(__privateGet(this, _semaphoreRetrySleep));
|
|
2744
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6349
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
|
|
2745
6350
|
return await this.ExecuteRefreshToken(retryCount + 1);
|
|
2746
6351
|
} else {
|
|
2747
6352
|
__privateSet(this, _operationSemaphore, true);
|
|
@@ -2762,7 +6367,7 @@ class STSOAuth2Manager {
|
|
|
2762
6367
|
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, `STSOAuth2Manager:RestoreSession:response: [${JSON.stringify(response.payload)}]`);
|
|
2763
6368
|
return response.payload;
|
|
2764
6369
|
} catch (error) {
|
|
2765
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
6370
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$2.red(`RestoreSession Error: ${error}`));
|
|
2766
6371
|
return false;
|
|
2767
6372
|
}
|
|
2768
6373
|
});
|
|
@@ -2777,18 +6382,18 @@ class STSOAuth2Manager {
|
|
|
2777
6382
|
return response.payload.authorizeOptionsClientCopy;
|
|
2778
6383
|
}
|
|
2779
6384
|
} catch (error) {
|
|
2780
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
6385
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$2.red(`Authorize Error: ${error}`));
|
|
2781
6386
|
}
|
|
2782
6387
|
return {};
|
|
2783
6388
|
});
|
|
2784
6389
|
__publicField(this, "HandleRedirect", async (queryVars) => {
|
|
2785
6390
|
try {
|
|
2786
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6391
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.magenta(`STSOAuth2Manager:HandleRedirect`));
|
|
2787
6392
|
let response = null;
|
|
2788
6393
|
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
2789
6394
|
const authorizeOptions = __privateGet(this, _transactionStore).get(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
2790
6395
|
__privateGet(this, _transactionStore).remove(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
2791
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6396
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
|
|
2792
6397
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: {
|
|
2793
6398
|
queryVars,
|
|
2794
6399
|
authorizeOptions
|
|
@@ -2796,10 +6401,10 @@ class STSOAuth2Manager {
|
|
|
2796
6401
|
} else {
|
|
2797
6402
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: queryVars });
|
|
2798
6403
|
}
|
|
2799
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
6404
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$2.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
|
|
2800
6405
|
return response.payload;
|
|
2801
6406
|
} catch (error) {
|
|
2802
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
6407
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$2.red(`HandleRedirect Error: ${error}`));
|
|
2803
6408
|
return false;
|
|
2804
6409
|
}
|
|
2805
6410
|
});
|
|
@@ -2808,7 +6413,7 @@ class STSOAuth2Manager {
|
|
|
2808
6413
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
2809
6414
|
return response.payload;
|
|
2810
6415
|
} catch (error) {
|
|
2811
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
6416
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$2.red(`Logout Error: ${error}`));
|
|
2812
6417
|
return false;
|
|
2813
6418
|
}
|
|
2814
6419
|
});
|
|
@@ -2818,7 +6423,7 @@ class STSOAuth2Manager {
|
|
|
2818
6423
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
2819
6424
|
return response.payload;
|
|
2820
6425
|
} catch (error) {
|
|
2821
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
6426
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$2.red(`InvokeExternalAPI Error: ${error}`));
|
|
2822
6427
|
return null;
|
|
2823
6428
|
}
|
|
2824
6429
|
});
|
|
@@ -2833,7 +6438,7 @@ class STSOAuth2Manager {
|
|
|
2833
6438
|
if (!isNode) {
|
|
2834
6439
|
if (app.config.globalProperties.$sts[STSInstrumentControllerPluginKey]) {
|
|
2835
6440
|
const STSInstrumentController = app.config.globalProperties.$sts[STSInstrumentControllerPluginKey];
|
|
2836
|
-
__privateSet(this, _aic, STSInstrumentController
|
|
6441
|
+
__privateSet(this, _aic, STSInstrumentController);
|
|
2837
6442
|
}
|
|
2838
6443
|
__privateSet(this, _router, app.config.globalProperties.$router);
|
|
2839
6444
|
}
|
|
@@ -2849,10 +6454,10 @@ class STSOAuth2Manager {
|
|
|
2849
6454
|
}
|
|
2850
6455
|
if (!isNode) {
|
|
2851
6456
|
__privateGet(this, _worker).onmessage = (data) => {
|
|
2852
|
-
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$
|
|
6457
|
+
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$2.green(`this.#worker.onmessage = [${data}]`));
|
|
2853
6458
|
};
|
|
2854
6459
|
__privateGet(this, _worker).onerror = (error) => {
|
|
2855
|
-
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$
|
|
6460
|
+
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$2.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
|
|
2856
6461
|
};
|
|
2857
6462
|
}
|
|
2858
6463
|
let workerMessage;
|
|
@@ -3161,7 +6766,7 @@ class STSOAuth2Worker {
|
|
|
3161
6766
|
// Ensure cookies are passed to the service
|
|
3162
6767
|
timeout: __privateGet(this, _options2).timeout
|
|
3163
6768
|
};
|
|
3164
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6769
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
|
|
3165
6770
|
if (isNode) {
|
|
3166
6771
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
3167
6772
|
}
|
|
@@ -3238,29 +6843,29 @@ class STSOAuth2Worker {
|
|
|
3238
6843
|
__privateAdd(this, _HandleRedirect, async (payload) => {
|
|
3239
6844
|
const queryVars = payload.queryVars;
|
|
3240
6845
|
const authorizeOptions = payload.authorizeOptions;
|
|
3241
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3242
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6846
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#HandleRedirect: HandleRedirect`));
|
|
6847
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
|
|
3243
6848
|
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
3244
6849
|
const response = queryVars;
|
|
3245
6850
|
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, `authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
|
|
3246
6851
|
const redirectState = response.state;
|
|
3247
6852
|
const authorizeOptionsState = authorizeOptions.state;
|
|
3248
6853
|
if (authorizeOptionsState.localeCompare(redirectState) === 0) {
|
|
3249
|
-
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, chalk$
|
|
6854
|
+
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, chalk$2.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
|
|
3250
6855
|
return await __privateGet(this, _GetToken).call(this, authorizeOptions, response);
|
|
3251
6856
|
} else {
|
|
3252
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3253
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3254
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6857
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
|
|
6858
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
|
|
6859
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`redirectState: [${redirectState}]`));
|
|
3255
6860
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3256
6861
|
return false;
|
|
3257
6862
|
}
|
|
3258
6863
|
} else if (queryVars[OAuth2ParameterType.ERROR]) {
|
|
3259
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6864
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`State un-matched (1)`));
|
|
3260
6865
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3261
6866
|
return false;
|
|
3262
6867
|
} else {
|
|
3263
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6868
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`State un-matched (2)`));
|
|
3264
6869
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3265
6870
|
return false;
|
|
3266
6871
|
}
|
|
@@ -3286,7 +6891,7 @@ class STSOAuth2Worker {
|
|
|
3286
6891
|
*/
|
|
3287
6892
|
// Get access_token, refresh_token and id_token using OAuth2 Authorization Code Flow
|
|
3288
6893
|
__privateAdd(this, _GetTokenFromBroker, async (authorizationCodeFlowParameters) => {
|
|
3289
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6894
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker`));
|
|
3290
6895
|
__privateGet(this, _clientSessionStore).remove(__privateGet(this, _STORAGE_SESSION_KEY2));
|
|
3291
6896
|
const url = `${__privateGet(this, _options2).brokerendpoint}:${__privateGet(this, _options2).brokerport}${__privateGet(this, _options2).brokerapiroot}/token`;
|
|
3292
6897
|
try {
|
|
@@ -3298,15 +6903,15 @@ class STSOAuth2Worker {
|
|
|
3298
6903
|
// Ensure cookies are passed to the service
|
|
3299
6904
|
timeout: __privateGet(this, _options2).timeout
|
|
3300
6905
|
};
|
|
3301
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6906
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
|
|
3302
6907
|
if (isNode) {
|
|
3303
6908
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
3304
6909
|
}
|
|
3305
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6910
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: axios API call`));
|
|
3306
6911
|
const retVal = await axios(rConfig);
|
|
3307
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6912
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
|
|
3308
6913
|
if (retVal.status === StatusCodes.OK) {
|
|
3309
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6914
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: storing tokens`));
|
|
3310
6915
|
const tokenResponse = retVal.data;
|
|
3311
6916
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, tokenResponse.id_token);
|
|
3312
6917
|
const newSessionData = {
|
|
@@ -3318,18 +6923,18 @@ class STSOAuth2Worker {
|
|
|
3318
6923
|
__privateGet(this, _clientSessionStore).set(__privateGet(this, _STORAGE_SESSION_KEY2), newSessionData);
|
|
3319
6924
|
return true;
|
|
3320
6925
|
} else if (retVal.status === StatusCodes.UNAUTHORIZED) {
|
|
3321
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6926
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
|
|
3322
6927
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3323
6928
|
return false;
|
|
3324
6929
|
} else {
|
|
3325
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6930
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
|
|
3326
6931
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3327
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3328
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6932
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red("Could not obtain access_token from token end-point:-"));
|
|
6933
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(JSON.stringify(retVal.data)));
|
|
3329
6934
|
return false;
|
|
3330
6935
|
}
|
|
3331
6936
|
} catch (error) {
|
|
3332
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6937
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
|
|
3333
6938
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3334
6939
|
return false;
|
|
3335
6940
|
}
|
|
@@ -3375,10 +6980,10 @@ class STSOAuth2Worker {
|
|
|
3375
6980
|
}
|
|
3376
6981
|
*/
|
|
3377
6982
|
__privateAdd(this, _RefreshToken, async () => {
|
|
3378
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6983
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.cyan(`STSOAuth2Worker:#RefreshToken:start`));
|
|
3379
6984
|
const sessionData = __privateGet(this, _clientSessionStore).get(__privateGet(this, _STORAGE_SESSION_KEY2));
|
|
3380
6985
|
if (sessionData) {
|
|
3381
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6986
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
|
|
3382
6987
|
const currentSessionData = sessionData.tokenResponse;
|
|
3383
6988
|
const refreshFlowParameters = {
|
|
3384
6989
|
client_id: __privateGet(this, _options2).client_id,
|
|
@@ -3388,7 +6993,7 @@ class STSOAuth2Worker {
|
|
|
3388
6993
|
};
|
|
3389
6994
|
return await __privateGet(this, _GetTokenFromBroker).call(this, refreshFlowParameters);
|
|
3390
6995
|
} else {
|
|
3391
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6996
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
|
|
3392
6997
|
return false;
|
|
3393
6998
|
}
|
|
3394
6999
|
});
|
|
@@ -3423,7 +7028,7 @@ class STSOAuth2Worker {
|
|
|
3423
7028
|
// Ensure cookies are passed to the service
|
|
3424
7029
|
timeout: __privateGet(this, _options2).timeout
|
|
3425
7030
|
};
|
|
3426
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
7031
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$2.magenta(`#Logout: request config: [${rConfig}]`));
|
|
3427
7032
|
if (isNode) {
|
|
3428
7033
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
3429
7034
|
}
|
|
@@ -3431,14 +7036,14 @@ class STSOAuth2Worker {
|
|
|
3431
7036
|
if (retVal.data.status === StatusCodes.OK) {
|
|
3432
7037
|
return true;
|
|
3433
7038
|
} else {
|
|
3434
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3435
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
7039
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red("Error during logout (1: server side)"));
|
|
7040
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(JSON.stringify(retVal.data)));
|
|
3436
7041
|
return false;
|
|
3437
7042
|
}
|
|
3438
7043
|
} catch (error) {
|
|
3439
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3440
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3441
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
7044
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red("Error during logout (2: server side)"));
|
|
7045
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(error));
|
|
7046
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$2.red(JSON.stringify(error)));
|
|
3442
7047
|
return false;
|
|
3443
7048
|
}
|
|
3444
7049
|
} else {
|