@microsoft/1ds-core-js 4.3.12-nightly3.2602-18 → 4.4.0-beta
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/bundle/es5/{ms.core-4.3.12-nightly3.2602-18.gbl.js → ms.core-4.4.0-beta.gbl.js} +2386 -453
- package/bundle/es5/ms.core-4.4.0-beta.gbl.js.map +1 -0
- package/bundle/es5/ms.core-4.4.0-beta.gbl.min.js +7 -0
- package/bundle/es5/ms.core-4.4.0-beta.gbl.min.js.map +1 -0
- package/bundle/es5/ms.core-4.4.0-beta.integrity.json +46 -0
- package/bundle/es5/{ms.core-4.3.12-nightly3.2602-18.js → ms.core-4.4.0-beta.js} +2386 -453
- package/bundle/es5/ms.core-4.4.0-beta.js.map +1 -0
- package/bundle/es5/ms.core-4.4.0-beta.min.js +7 -0
- package/bundle/es5/ms.core-4.4.0-beta.min.js.map +1 -0
- package/bundle/es5/ms.core.gbl.js +2385 -452
- package/bundle/es5/ms.core.gbl.js.map +1 -1
- package/bundle/es5/ms.core.gbl.min.js +2 -2
- package/bundle/es5/ms.core.gbl.min.js.map +1 -1
- package/bundle/es5/ms.core.integrity.json +17 -17
- package/bundle/es5/ms.core.js +2385 -452
- package/bundle/es5/ms.core.js.map +1 -1
- package/bundle/es5/ms.core.min.js +2 -2
- package/bundle/es5/ms.core.min.js.map +1 -1
- package/dist/es5/ms.core.js +2383 -450
- package/dist/es5/ms.core.js.map +1 -1
- package/dist/es5/ms.core.min.js +2 -2
- package/dist/es5/ms.core.min.js.map +1 -1
- package/dist-es5/AppInsightsCore.js +6 -5
- package/dist-es5/AppInsightsCore.js.map +1 -1
- package/dist-es5/BaseCore.js +1 -1
- package/dist-es5/DataModels.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/Index.js +4 -3
- package/dist-es5/Index.js.map +1 -1
- package/dist-es5/InternalConstants.js +3 -1
- package/dist-es5/InternalConstants.js.map +1 -1
- package/dist-es5/Utils.js +5 -5
- package/dist-es5/Utils.js.map +1 -1
- package/dist-es5/ValueSanitizer.js +5 -5
- package/dist-es5/ValueSanitizer.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +3 -1
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/extSpanUtils.js +308 -0
- package/dist-es5/extSpanUtils.js.map +1 -0
- package/package.json +72 -72
- package/types/1ds-core-js.d.ts +13 -10
- package/types/1ds-core-js.namespaced.d.ts +2143 -118
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.gbl.js.map +0 -1
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.gbl.min.js +0 -7
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.gbl.min.js.map +0 -1
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.integrity.json +0 -46
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.js.map +0 -1
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.min.js +0 -7
- package/bundle/es5/ms.core-4.3.12-nightly3.2602-18.min.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* 1DS JS SDK Core, 4.
|
|
2
|
+
* 1DS JS SDK Core, 4.4.0-beta
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
7
|
var undef = "undefined";
|
|
8
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
9
|
-
var mods={}, modDetail=mods[modName]={}, ver="4.
|
|
8
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_ms_core_4_4_0_beta", msMod="__ms$mod__";
|
|
9
|
+
var mods={}, modDetail=mods[modName]={}, ver="4.4.0-beta";
|
|
10
10
|
// Versioned namespace "oneDS4"
|
|
11
11
|
var exportNs=global, nsKey="oneDS4", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
12
12
|
// Global namespace "oneDS"
|
|
@@ -57,6 +57,7 @@ var NAME = "name";
|
|
|
57
57
|
var CALL = "call";
|
|
58
58
|
var TO_STRING = "toString";
|
|
59
59
|
var GET_OWN_PROPERTY_DESCRIPTOR = "getOwnPropertyDescriptor";
|
|
60
|
+
var GET_OWN_PROPERTY_SYMBOLS = "getOwnPropertySymbols";
|
|
60
61
|
var ObjClass = ( /*#__PURE__*/_pureAssign(Object));
|
|
61
62
|
var ObjProto = ( /*#__PURE__*/_pureRef(ObjClass, PROTOTYPE));
|
|
62
63
|
var StrCls = ( /*#__PURE__*/_pureAssign(String));
|
|
@@ -158,6 +159,9 @@ function isTruthy(value) {
|
|
|
158
159
|
function _returnNothing() {
|
|
159
160
|
return;
|
|
160
161
|
}
|
|
162
|
+
function _returnEmptyArray() {
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
161
165
|
function _returnFalse() {
|
|
162
166
|
return false;
|
|
163
167
|
}
|
|
@@ -248,7 +252,26 @@ function _unwrapProp(propName) {
|
|
|
248
252
|
return thisArg[propName];
|
|
249
253
|
};
|
|
250
254
|
}
|
|
255
|
+
function _objPropertyIsEnum(obj, propKey) {
|
|
256
|
+
var desc;
|
|
257
|
+
var fn = ObjClass.getOwnPropertyDescriptor;
|
|
258
|
+
if (!isStrictNullOrUndefined(obj) && fn) {
|
|
259
|
+
desc = safe(fn, [obj, propKey]).v || NULL_VALUE;
|
|
260
|
+
}
|
|
261
|
+
if (!desc) {
|
|
262
|
+
desc = safe(function () {
|
|
263
|
+
for (var key in obj) {
|
|
264
|
+
if (key === propKey) {
|
|
265
|
+
return { enumerable: true };
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}).v;
|
|
269
|
+
}
|
|
270
|
+
return (desc && desc.enumerable) || false;
|
|
271
|
+
}
|
|
272
|
+
var objPropertyIsEnumerable = ( /*#__PURE__*/_unwrapFunctionWithPoly("propertyIsEnumerable", NULL_VALUE, _objPropertyIsEnum));
|
|
251
273
|
var _objGetOwnPropertyDescriptor$1 = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
274
|
+
var _objGetOwnPropertySymbols = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, GET_OWN_PROPERTY_SYMBOLS)), _returnEmptyArray));
|
|
252
275
|
var propMap = {
|
|
253
276
|
e: "enumerable",
|
|
254
277
|
c: "configurable",
|
|
@@ -294,6 +317,18 @@ function objDefineAccessors(target, prop, getProp, setProp, configurable, enumer
|
|
|
294
317
|
function objDefine(target, key, propDesc) {
|
|
295
318
|
return objDefineProp(target, key, _createProp(propDesc));
|
|
296
319
|
}
|
|
320
|
+
function objDefineProps(target, propDescMap) {
|
|
321
|
+
var props = {};
|
|
322
|
+
objForEachKey(propDescMap, function (key, value) {
|
|
323
|
+
props[key] = _createProp(value);
|
|
324
|
+
});
|
|
325
|
+
arrForEach(_objGetOwnPropertySymbols(propDescMap), function (sym) {
|
|
326
|
+
if (objPropertyIsEnumerable(propDescMap, sym)) {
|
|
327
|
+
props[sym] = _createProp(propDescMap[sym]);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
return objDefineProperties(target, props);
|
|
331
|
+
}
|
|
297
332
|
/*#__NO_SIDE_EFFECTS__*/
|
|
298
333
|
function _createKeyValueMap(values, keyType, valueType, completeFn, writable) {
|
|
299
334
|
var theMap = {};
|
|
@@ -310,6 +345,15 @@ function _assignMapValue(theMap, key, value, writable) {
|
|
|
310
345
|
writable: false
|
|
311
346
|
});
|
|
312
347
|
}
|
|
348
|
+
function polyObjIs(value1, value2) {
|
|
349
|
+
if (value1 !== value1) {
|
|
350
|
+
return value2 !== value2;
|
|
351
|
+
}
|
|
352
|
+
if (value1 === 0 && value2 === 0) {
|
|
353
|
+
return 1 / value1 === 1 / value2;
|
|
354
|
+
}
|
|
355
|
+
return value1 === value2;
|
|
356
|
+
}
|
|
313
357
|
var objIsFrozen = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, "isFrozen")), _returnFalse));
|
|
314
358
|
var _objFreeze = ( /*#__PURE__*/_pureRef(ObjClass, "freeze"));
|
|
315
359
|
function _doNothing(value) {
|
|
@@ -343,6 +387,7 @@ function objDeepFreeze(value) {
|
|
|
343
387
|
var objFreeze = ( /*#__PURE__*/_pureAssign(_objFreeze, _doNothing));
|
|
344
388
|
var objSeal = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, "seal")), _doNothing));
|
|
345
389
|
var objGetPrototypeOf = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, "getPrototypeOf")), _getProto));
|
|
390
|
+
var objIs = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, "is")), polyObjIs));
|
|
346
391
|
/*#__NO_SIDE_EFFECTS__*/
|
|
347
392
|
function createEnum(values) {
|
|
348
393
|
return _createKeyValueMap(values, 1 , 0 , objFreeze);
|
|
@@ -563,6 +608,21 @@ function createCachedValue(value) {
|
|
|
563
608
|
toJSON: function () { return value; }
|
|
564
609
|
}, "v", { value: value });
|
|
565
610
|
}
|
|
611
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
612
|
+
function getDeferred(cb, argArray) {
|
|
613
|
+
var theValue = {
|
|
614
|
+
toJSON: function () { return theValue.v; }
|
|
615
|
+
};
|
|
616
|
+
return objDefineProp(theValue, "v", {
|
|
617
|
+
get: function () {
|
|
618
|
+
var result = fnApply(cb, null, argArray);
|
|
619
|
+
cb = NULL_VALUE;
|
|
620
|
+
objDefineProp(theValue, "v", { value: result });
|
|
621
|
+
return result;
|
|
622
|
+
},
|
|
623
|
+
configurable: true
|
|
624
|
+
});
|
|
625
|
+
}
|
|
566
626
|
var WINDOW = "window";
|
|
567
627
|
var _cachedGlobal;
|
|
568
628
|
function _getGlobalInstFn(getFn, theArgs) {
|
|
@@ -801,6 +861,7 @@ function _createTrimFn(exp) {
|
|
|
801
861
|
}
|
|
802
862
|
var polyStrTrim = ( /*#__PURE__*/_createTrimFn(/^\s+|(?=\s)\s+$/g));
|
|
803
863
|
var strTrim = ( /*#__PURE__*/_unwrapFunctionWithPoly("trim", StrProto, polyStrTrim));
|
|
864
|
+
var strLower = ( /*#__PURE__*/_unwrapFunction("toLowerCase", StrProto));
|
|
804
865
|
var mathFloor = ( /*#__PURE__*/_pureRef(MathCls, "floor"));
|
|
805
866
|
var _fnToString;
|
|
806
867
|
var _objCtrFnString;
|
|
@@ -983,6 +1044,7 @@ function _doExtend(target, theArgs) {
|
|
|
983
1044
|
function deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
984
1045
|
return _doExtend(objDeepCopy(target) || {}, ArrSlice[CALL](arguments));
|
|
985
1046
|
}
|
|
1047
|
+
var strSplit = ( /*#__PURE__*/_unwrapFunction("split", StrProto));
|
|
986
1048
|
var getLength = ( /*#__PURE__*/_unwrapProp(LENGTH));
|
|
987
1049
|
var _perf;
|
|
988
1050
|
/*#__NO_SIDE_EFFECTS__*/
|
|
@@ -1001,6 +1063,56 @@ function perfNow() {
|
|
|
1001
1063
|
}
|
|
1002
1064
|
return utcNow();
|
|
1003
1065
|
}
|
|
1066
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1067
|
+
function safeGetDeferred(cb, defValue, argArray) {
|
|
1068
|
+
return getDeferred(function () {
|
|
1069
|
+
var result = safe(cb, argArray);
|
|
1070
|
+
return result.e ? defValue : result.v;
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1074
|
+
function createIterator(ctx) {
|
|
1075
|
+
var isDone = false;
|
|
1076
|
+
function _value() {
|
|
1077
|
+
return ctx.v;
|
|
1078
|
+
}
|
|
1079
|
+
function _next() {
|
|
1080
|
+
if (!isDone) {
|
|
1081
|
+
isDone = (ctx.n ? ctx.n(arguments) : true);
|
|
1082
|
+
}
|
|
1083
|
+
var result = {
|
|
1084
|
+
done: isDone
|
|
1085
|
+
};
|
|
1086
|
+
if (!isDone) {
|
|
1087
|
+
objDefine(result, "value", { g: _value });
|
|
1088
|
+
}
|
|
1089
|
+
return result;
|
|
1090
|
+
}
|
|
1091
|
+
function _return(value) {
|
|
1092
|
+
isDone = true;
|
|
1093
|
+
return {
|
|
1094
|
+
done: true,
|
|
1095
|
+
value: ctx.r && ctx.r(value)
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function _throw(e) {
|
|
1099
|
+
isDone = true;
|
|
1100
|
+
return {
|
|
1101
|
+
done: true,
|
|
1102
|
+
value: ctx.t && ctx.t(e)
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
var theIterator = {
|
|
1106
|
+
next: _next
|
|
1107
|
+
};
|
|
1108
|
+
if (ctx.r) {
|
|
1109
|
+
theIterator.return = _return;
|
|
1110
|
+
}
|
|
1111
|
+
if (ctx.t) {
|
|
1112
|
+
theIterator.throw = _throw;
|
|
1113
|
+
}
|
|
1114
|
+
return theIterator;
|
|
1115
|
+
}
|
|
1004
1116
|
var objGetOwnPropertyDescriptor = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
1005
1117
|
var strEndsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
|
|
1006
1118
|
/*#__NO_SIDE_EFFECTS__*/
|
|
@@ -1197,7 +1309,7 @@ function _isObjectOrArrayPrototype(target) {
|
|
|
1197
1309
|
function _isObjectArrayOrFunctionPrototype(target) {
|
|
1198
1310
|
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
1199
1311
|
}
|
|
1200
|
-
function _getObjProto(target) {
|
|
1312
|
+
function _getObjProto$1(target) {
|
|
1201
1313
|
var newProto;
|
|
1202
1314
|
if (target) {
|
|
1203
1315
|
if (_objGetPrototypeOf) {
|
|
@@ -1271,7 +1383,7 @@ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
|
1271
1383
|
_forEachProp(instFuncs, function (name) {
|
|
1272
1384
|
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
1273
1385
|
});
|
|
1274
|
-
var baseProto = _getObjProto(classProto);
|
|
1386
|
+
var baseProto = _getObjProto$1(classProto);
|
|
1275
1387
|
var visited = [];
|
|
1276
1388
|
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
1277
1389
|
_forEachProp(baseProto, function (name) {
|
|
@@ -1280,7 +1392,7 @@ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
|
1280
1392
|
}
|
|
1281
1393
|
});
|
|
1282
1394
|
visited.push(baseProto);
|
|
1283
|
-
baseProto = _getObjProto(baseProto);
|
|
1395
|
+
baseProto = _getObjProto$1(baseProto);
|
|
1284
1396
|
}
|
|
1285
1397
|
return baseFuncs;
|
|
1286
1398
|
}
|
|
@@ -1294,7 +1406,7 @@ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
|
1294
1406
|
}
|
|
1295
1407
|
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
1296
1408
|
var canAddInst = !objHasOwnProperty(target, funcName);
|
|
1297
|
-
var objProto = _getObjProto(target);
|
|
1409
|
+
var objProto = _getObjProto$1(target);
|
|
1298
1410
|
var visited = [];
|
|
1299
1411
|
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
1300
1412
|
var protoFunc = objProto[funcName];
|
|
@@ -1303,7 +1415,7 @@ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
|
1303
1415
|
break;
|
|
1304
1416
|
}
|
|
1305
1417
|
visited.push(objProto);
|
|
1306
|
-
objProto = _getObjProto(objProto);
|
|
1418
|
+
objProto = _getObjProto$1(objProto);
|
|
1307
1419
|
}
|
|
1308
1420
|
try {
|
|
1309
1421
|
if (canAddInst) {
|
|
@@ -1321,7 +1433,7 @@ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
|
1321
1433
|
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
1322
1434
|
var protoFunc = proto[funcName];
|
|
1323
1435
|
if (protoFunc === currentDynProtoProxy) {
|
|
1324
|
-
protoFunc = _getObjProto(proto)[funcName];
|
|
1436
|
+
protoFunc = _getObjProto$1(proto)[funcName];
|
|
1325
1437
|
}
|
|
1326
1438
|
if (typeof protoFunc !== strFunction) {
|
|
1327
1439
|
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
@@ -1361,13 +1473,13 @@ function _populatePrototype(proto, className, target, baseInstFuncs, setInstance
|
|
|
1361
1473
|
function _checkPrototype(classProto, thisTarget) {
|
|
1362
1474
|
if (_objGetPrototypeOf) {
|
|
1363
1475
|
var visited = [];
|
|
1364
|
-
var thisProto = _getObjProto(thisTarget);
|
|
1476
|
+
var thisProto = _getObjProto$1(thisTarget);
|
|
1365
1477
|
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
1366
1478
|
if (thisProto === classProto) {
|
|
1367
1479
|
return true;
|
|
1368
1480
|
}
|
|
1369
1481
|
visited.push(thisProto);
|
|
1370
|
-
thisProto = _getObjProto(thisProto);
|
|
1482
|
+
thisProto = _getObjProto$1(thisProto);
|
|
1371
1483
|
}
|
|
1372
1484
|
return false;
|
|
1373
1485
|
}
|
|
@@ -1447,10 +1559,16 @@ var _DYN_INITIALIZE$1 = "initialize";
|
|
|
1447
1559
|
var _DYN_IDENTIFIER = "identifier";
|
|
1448
1560
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1449
1561
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1562
|
+
var _DYN_STRINGIFY = "stringify";
|
|
1563
|
+
var _DYN_TRACE_ID = "traceId";
|
|
1564
|
+
var _DYN_SPAN_ID = "spanId";
|
|
1565
|
+
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
1450
1566
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1567
|
+
var _DYN_TRACE_HDR_MODE = "traceHdrMode";
|
|
1451
1568
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1452
1569
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1453
1570
|
var _DYN_NAME = "name";
|
|
1571
|
+
var _DYN_TIME = "time";
|
|
1454
1572
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1455
1573
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1456
1574
|
var _DYN_VALUE$1 = "value";
|
|
@@ -1458,35 +1576,53 @@ var _DYN_ENABLED = "enabled";
|
|
|
1458
1576
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1459
1577
|
var _DYN_UNLOAD = "unload";
|
|
1460
1578
|
var _DYN_ON_COMPLETE = "onComplete";
|
|
1579
|
+
var _DYN_REASON = "reason";
|
|
1580
|
+
var _DYN_FLUSH = "flush";
|
|
1581
|
+
var _DYN_GET_TRACE_CTX = "getTraceCtx";
|
|
1582
|
+
var _DYN_SET_TRACE_CTX = "setTraceCtx";
|
|
1583
|
+
var _DYN_GET_ACTIVE_SPAN = "getActiveSpan";
|
|
1584
|
+
var _DYN_SET_ACTIVE_SPAN = "setActiveSpan";
|
|
1585
|
+
var _DYN_SPAN_CONTEXT = "spanContext";
|
|
1586
|
+
var _DYN_PARENT_SPAN_CONTEXT = "parentSpanContext";
|
|
1461
1587
|
var _DYN_VERSION = "version";
|
|
1462
1588
|
var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
|
|
1589
|
+
var _DYN_JOIN = "join";
|
|
1463
1590
|
var _DYN_CREATE_NEW = "createNew";
|
|
1464
1591
|
var _DYN_TEARDOWN = "teardown";
|
|
1465
1592
|
var _DYN_MESSAGE_ID = "messageId";
|
|
1466
1593
|
var _DYN_MESSAGE = "message";
|
|
1594
|
+
var _DYN_ATTRIBUTE_COUNT_LIMI5 = "attributeCountLimit";
|
|
1595
|
+
var _DYN_SUPPRESS_TRACING = "suppressTracing";
|
|
1596
|
+
var _DYN_NOT_IMPLEMENTED = "notImplemented";
|
|
1467
1597
|
var _DYN_DIAG_LOG = "diagLog";
|
|
1468
1598
|
var _DYN__DO_TEARDOWN = "_doTeardown";
|
|
1469
1599
|
var _DYN_UPDATE = "update";
|
|
1470
1600
|
var _DYN_GET_NEXT = "getNext";
|
|
1471
1601
|
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
1472
|
-
var _DYN_USER_AGENT = "userAgent";
|
|
1473
1602
|
var _DYN_SPLIT = "split";
|
|
1474
|
-
var _DYN_REPLACE = "replace";
|
|
1475
|
-
var _DYN_SUBSTRING = "substring";
|
|
1476
|
-
var _DYN_INDEX_OF$1 = "indexOf";
|
|
1477
|
-
var _DYN_TYPE = "type";
|
|
1478
|
-
var _DYN_EVT_NAME = "evtName";
|
|
1479
|
-
var _DYN_STATUS = "status";
|
|
1480
|
-
var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
|
|
1481
1603
|
var _DYN_IS_CHILD_EVT = "isChildEvt";
|
|
1482
1604
|
var _DYN_DATA = "data";
|
|
1483
1605
|
var _DYN_GET_CTX = "getCtx";
|
|
1484
1606
|
var _DYN_SET_CTX = "setCtx";
|
|
1607
|
+
var _DYN_CONFIG = "config";
|
|
1485
1608
|
var _DYN_ITEMS_RECEIVED = "itemsReceived";
|
|
1486
1609
|
var _DYN_HEADERS = "headers";
|
|
1487
1610
|
var _DYN_URL_STRING = "urlString";
|
|
1488
1611
|
var _DYN_TIMEOUT = "timeout";
|
|
1489
|
-
var
|
|
1612
|
+
var _DYN_STATUS = "status";
|
|
1613
|
+
var _DYN_REPLACE = "replace";
|
|
1614
|
+
var _DYN_TYPE = "type";
|
|
1615
|
+
var _DYN_SET_TRACE_FLAGS = "setTraceFlags";
|
|
1616
|
+
var _DYN_PATHNAME = "pathname";
|
|
1617
|
+
var _DYN_TRACE_STATE = "traceState";
|
|
1618
|
+
var _DYN_ERROR_HANDLERS = "errorHandlers";
|
|
1619
|
+
var _DYN_TO_STRING = "toString";
|
|
1620
|
+
var _DYN_EVT_NAME = "evtName";
|
|
1621
|
+
var _DYN_CONCAT = "concat";
|
|
1622
|
+
var _DYN_SUBSTRING = "substring";
|
|
1623
|
+
var _DYN_GET_ALL_RESPONSE_HEA6 = "getAllResponseHeaders";
|
|
1624
|
+
var _DYN_ENTRIES = "entries";
|
|
1625
|
+
var _DYN_TRACE_CFG = "traceCfg";
|
|
1490
1626
|
|
|
1491
1627
|
var aggregationErrorType;
|
|
1492
1628
|
function throwAggregationError(message, sourceErrors) {
|
|
@@ -1909,7 +2045,7 @@ function createPromise(executor, timeout) {
|
|
|
1909
2045
|
var createAllPromise = ( /*#__PURE__*/_createAllPromise(createPromise));
|
|
1910
2046
|
|
|
1911
2047
|
var UNDEFINED_VALUE = undefined;
|
|
1912
|
-
var STR_EMPTY$
|
|
2048
|
+
var STR_EMPTY$1 = "";
|
|
1913
2049
|
var STR_CHANNELS = "channels";
|
|
1914
2050
|
var STR_CORE = "core";
|
|
1915
2051
|
var STR_CREATE_PERF_MGR = "createPerfMgr";
|
|
@@ -1932,12 +2068,24 @@ var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
|
|
|
1932
2068
|
var STR_REDACTED = "REDACTED";
|
|
1933
2069
|
var DEFAULT_SENSITIVE_PARAMS = ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"];
|
|
1934
2070
|
|
|
2071
|
+
function cfgDfMerge(defaultValue) {
|
|
2072
|
+
return {
|
|
2073
|
+
mrg: true,
|
|
2074
|
+
v: defaultValue
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
var strGetPrototypeOf = "getPrototypeOf";
|
|
1935
2079
|
var rCamelCase = /-([a-z])/g;
|
|
1936
2080
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
1937
2081
|
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
2082
|
+
var _ProtoNameTag;
|
|
2083
|
+
var _getObjProto = Object[strGetPrototypeOf];
|
|
2084
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1938
2085
|
function isNotNullOrUndefined(value) {
|
|
1939
2086
|
return !isNullOrUndefined(value);
|
|
1940
2087
|
}
|
|
2088
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1941
2089
|
function normalizeJsName(name) {
|
|
1942
2090
|
var value = name;
|
|
1943
2091
|
if (value && isString(value)) {
|
|
@@ -1951,20 +2099,23 @@ function normalizeJsName(name) {
|
|
|
1951
2099
|
}
|
|
1952
2100
|
return value;
|
|
1953
2101
|
}
|
|
2102
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1954
2103
|
function strContains(value, search) {
|
|
1955
2104
|
if (value && search) {
|
|
1956
2105
|
return strIndexOf(value, search) !== -1;
|
|
1957
2106
|
}
|
|
1958
2107
|
return false;
|
|
1959
2108
|
}
|
|
2109
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1960
2110
|
function toISOString(date) {
|
|
1961
|
-
return date && date.toISOString() ||
|
|
2111
|
+
return date && date.toISOString() || STR_EMPTY$1;
|
|
1962
2112
|
}
|
|
2113
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1963
2114
|
function getExceptionName(object) {
|
|
1964
2115
|
if (isError(object)) {
|
|
1965
2116
|
return object[_DYN_NAME ];
|
|
1966
2117
|
}
|
|
1967
|
-
return STR_EMPTY$
|
|
2118
|
+
return STR_EMPTY$1;
|
|
1968
2119
|
}
|
|
1969
2120
|
function setValue(target, field, value, valChk, srcChk) {
|
|
1970
2121
|
var theValue = value;
|
|
@@ -2058,12 +2209,43 @@ function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {
|
|
|
2058
2209
|
}
|
|
2059
2210
|
return target;
|
|
2060
2211
|
}
|
|
2212
|
+
function setObjStringTag(target, nameOrFunc) {
|
|
2213
|
+
safe(objDefine, [target, getKnownSymbol(11 ), isFunction(nameOrFunc) ? { g: nameOrFunc, e: false } : { v: nameOrFunc, w: false, e: false }]);
|
|
2214
|
+
return target;
|
|
2215
|
+
}
|
|
2216
|
+
function setProtoTypeName(target, name) {
|
|
2217
|
+
if (target) {
|
|
2218
|
+
var proto_1 = _getObjProto(target);
|
|
2219
|
+
var done_1 = false;
|
|
2220
|
+
if (proto_1) {
|
|
2221
|
+
safe(function () {
|
|
2222
|
+
var newProto = setObjStringTag(objCreate(proto_1), name);
|
|
2223
|
+
if (!_ProtoNameTag) {
|
|
2224
|
+
_ProtoNameTag = createCachedValue(newSymbol("ai$ProtoName"));
|
|
2225
|
+
}
|
|
2226
|
+
objDefine(newProto, _ProtoNameTag.v, {
|
|
2227
|
+
v: true,
|
|
2228
|
+
w: false,
|
|
2229
|
+
e: false
|
|
2230
|
+
});
|
|
2231
|
+
objSetPrototypeOf(target, newProto);
|
|
2232
|
+
done_1 = true;
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
if (!done_1) {
|
|
2236
|
+
safe(setObjStringTag, [target, name]);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
return target;
|
|
2240
|
+
}
|
|
2241
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2061
2242
|
function optimizeObject(theObject) {
|
|
2062
2243
|
if (theObject && objAssign) {
|
|
2063
2244
|
theObject = ObjClass$1(objAssign({}, theObject));
|
|
2064
2245
|
}
|
|
2065
2246
|
return theObject;
|
|
2066
2247
|
}
|
|
2248
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2067
2249
|
function isFeatureEnabled(feature, cfg, sdkDefaultState) {
|
|
2068
2250
|
var ft = cfg && cfg.featureOptIn && cfg.featureOptIn[feature];
|
|
2069
2251
|
if (feature && ft) {
|
|
@@ -2077,6 +2259,7 @@ function isFeatureEnabled(feature, cfg, sdkDefaultState) {
|
|
|
2077
2259
|
}
|
|
2078
2260
|
return sdkDefaultState;
|
|
2079
2261
|
}
|
|
2262
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2080
2263
|
function getResponseText(xhr) {
|
|
2081
2264
|
try {
|
|
2082
2265
|
return xhr.responseText;
|
|
@@ -2085,25 +2268,28 @@ function getResponseText(xhr) {
|
|
|
2085
2268
|
}
|
|
2086
2269
|
return null;
|
|
2087
2270
|
}
|
|
2271
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2088
2272
|
function formatErrorMessageXdr(xdr, message) {
|
|
2089
2273
|
if (xdr) {
|
|
2090
|
-
return "XDomainRequest,Response:" + getResponseText(xdr) ||
|
|
2274
|
+
return "XDomainRequest,Response:" + getResponseText(xdr) || STR_EMPTY$1;
|
|
2091
2275
|
}
|
|
2092
2276
|
return message;
|
|
2093
2277
|
}
|
|
2278
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2094
2279
|
function formatErrorMessageXhr(xhr, message) {
|
|
2095
2280
|
if (xhr) {
|
|
2096
|
-
return "XMLHttpRequest,Status:" + xhr[_DYN_STATUS ] + ",Response:" + getResponseText(xhr) || xhr.response ||
|
|
2281
|
+
return "XMLHttpRequest,Status:" + xhr[_DYN_STATUS ] + ",Response:" + getResponseText(xhr) || xhr.response || STR_EMPTY$1;
|
|
2097
2282
|
}
|
|
2098
2283
|
return message;
|
|
2099
2284
|
}
|
|
2285
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2100
2286
|
function prependTransports(theTransports, newTransports) {
|
|
2101
2287
|
if (newTransports) {
|
|
2102
2288
|
if (isNumber(newTransports)) {
|
|
2103
|
-
theTransports = [newTransports]
|
|
2289
|
+
theTransports = [newTransports][_DYN_CONCAT ](theTransports);
|
|
2104
2290
|
}
|
|
2105
2291
|
else if (isArray(newTransports)) {
|
|
2106
|
-
theTransports = newTransports
|
|
2292
|
+
theTransports = newTransports[_DYN_CONCAT ](theTransports);
|
|
2107
2293
|
}
|
|
2108
2294
|
}
|
|
2109
2295
|
return theTransports;
|
|
@@ -2137,13 +2323,14 @@ function openXhr$1(method, urlString, withCredentials, disabled, isSync, timeout
|
|
|
2137
2323
|
}
|
|
2138
2324
|
return xhr;
|
|
2139
2325
|
}
|
|
2326
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2140
2327
|
function convertAllHeadersToMap(headersString) {
|
|
2141
2328
|
var headers = {};
|
|
2142
2329
|
if (isString(headersString)) {
|
|
2143
2330
|
var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
|
|
2144
2331
|
arrForEach(headersArray, function (headerEntry) {
|
|
2145
2332
|
if (headerEntry) {
|
|
2146
|
-
var idx = headerEntry
|
|
2333
|
+
var idx = strIndexOf(headerEntry, ": ");
|
|
2147
2334
|
if (idx !== -1) {
|
|
2148
2335
|
var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
|
|
2149
2336
|
var value = strTrim(headerEntry[_DYN_SUBSTRING ](idx + 1));
|
|
@@ -2171,7 +2358,7 @@ var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
|
|
|
2171
2358
|
var STR_TIME_DELTA_HEADER = "time-delta-millis";
|
|
2172
2359
|
function _getAllResponseHeaders(xhr, isOneDs) {
|
|
2173
2360
|
var theHeaders = {};
|
|
2174
|
-
if (!xhr[
|
|
2361
|
+
if (!xhr[_DYN_GET_ALL_RESPONSE_HEA6 ]) {
|
|
2175
2362
|
if (!!isOneDs) {
|
|
2176
2363
|
theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
|
|
2177
2364
|
theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
|
|
@@ -2179,7 +2366,7 @@ function _getAllResponseHeaders(xhr, isOneDs) {
|
|
|
2179
2366
|
}
|
|
2180
2367
|
}
|
|
2181
2368
|
else {
|
|
2182
|
-
theHeaders = convertAllHeadersToMap(xhr[
|
|
2369
|
+
theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA6 ]());
|
|
2183
2370
|
}
|
|
2184
2371
|
return theHeaders;
|
|
2185
2372
|
}
|
|
@@ -2194,11 +2381,12 @@ var strReactNative = "ReactNative";
|
|
|
2194
2381
|
var strMsie = "msie";
|
|
2195
2382
|
var strTrident = "trident/";
|
|
2196
2383
|
var strXMLHttpRequest = "XMLHttpRequest";
|
|
2197
|
-
var _isTrident
|
|
2198
|
-
var _navUserAgentCheck
|
|
2384
|
+
var _isTrident;
|
|
2385
|
+
var _navUserAgentCheck;
|
|
2199
2386
|
var _enableMocks = false;
|
|
2200
|
-
var _useXDomainRequest
|
|
2201
|
-
var _beaconsSupported
|
|
2387
|
+
var _useXDomainRequest;
|
|
2388
|
+
var _beaconsSupported;
|
|
2389
|
+
var _userAgent;
|
|
2202
2390
|
function _hasProperty(theClass, property) {
|
|
2203
2391
|
var supported = false;
|
|
2204
2392
|
if (theClass) {
|
|
@@ -2224,9 +2412,20 @@ function _hasProperty(theClass, property) {
|
|
|
2224
2412
|
}
|
|
2225
2413
|
return supported;
|
|
2226
2414
|
}
|
|
2415
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2416
|
+
function getUserAgentString() {
|
|
2417
|
+
if (!_userAgent) {
|
|
2418
|
+
_userAgent = getLazy(function () {
|
|
2419
|
+
var nav = getNavigator() || {};
|
|
2420
|
+
return nav.userAgent || STR_EMPTY$1;
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
return _userAgent.v;
|
|
2424
|
+
}
|
|
2227
2425
|
function setEnableEnvMocks(enabled) {
|
|
2228
2426
|
_enableMocks = enabled;
|
|
2229
2427
|
}
|
|
2428
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2230
2429
|
function getLocation(checkForMock) {
|
|
2231
2430
|
if (checkForMock && _enableMocks) {
|
|
2232
2431
|
var mockLocation = getInst("__mockLocation");
|
|
@@ -2239,27 +2438,33 @@ function getLocation(checkForMock) {
|
|
|
2239
2438
|
}
|
|
2240
2439
|
return getInst(strLocation);
|
|
2241
2440
|
}
|
|
2441
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2242
2442
|
function getConsole() {
|
|
2243
2443
|
if (typeof console !== strShimUndefined) {
|
|
2244
2444
|
return console;
|
|
2245
2445
|
}
|
|
2246
2446
|
return getInst(strConsole);
|
|
2247
2447
|
}
|
|
2448
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2248
2449
|
function hasJSON() {
|
|
2249
2450
|
return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
|
|
2250
2451
|
}
|
|
2452
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2251
2453
|
function getJSON() {
|
|
2252
2454
|
if (hasJSON()) {
|
|
2253
2455
|
return JSON || getInst(strJSON);
|
|
2254
2456
|
}
|
|
2255
2457
|
return null;
|
|
2256
2458
|
}
|
|
2459
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2257
2460
|
function getCrypto() {
|
|
2258
2461
|
return getInst(strCrypto);
|
|
2259
2462
|
}
|
|
2463
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2260
2464
|
function getMsCrypto() {
|
|
2261
2465
|
return getInst(strMsCrypto);
|
|
2262
2466
|
}
|
|
2467
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2263
2468
|
function isReactNative() {
|
|
2264
2469
|
var nav = getNavigator();
|
|
2265
2470
|
if (nav && nav.product) {
|
|
@@ -2267,22 +2472,23 @@ function isReactNative() {
|
|
|
2267
2472
|
}
|
|
2268
2473
|
return false;
|
|
2269
2474
|
}
|
|
2475
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2270
2476
|
function isIE() {
|
|
2271
|
-
var
|
|
2272
|
-
if (
|
|
2273
|
-
_navUserAgentCheck =
|
|
2274
|
-
var
|
|
2275
|
-
_isTrident = (strContains(
|
|
2477
|
+
var userAgent = getUserAgentString();
|
|
2478
|
+
if (!_isTrident || userAgent !== _navUserAgentCheck) {
|
|
2479
|
+
_navUserAgentCheck = userAgent;
|
|
2480
|
+
var lwrUserAgent = _navUserAgentCheck[_DYN_TO_LOWER_CASE ]();
|
|
2481
|
+
_isTrident = createCachedValue(strContains(lwrUserAgent, strMsie) || strContains(lwrUserAgent, strTrident));
|
|
2276
2482
|
}
|
|
2277
|
-
return _isTrident;
|
|
2483
|
+
return _isTrident.v;
|
|
2278
2484
|
}
|
|
2485
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2279
2486
|
function getIEVersion(userAgentStr) {
|
|
2280
2487
|
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
2281
2488
|
if (!userAgentStr) {
|
|
2282
|
-
|
|
2283
|
-
userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ]() : STR_EMPTY$2;
|
|
2489
|
+
userAgentStr = getUserAgentString();
|
|
2284
2490
|
}
|
|
2285
|
-
var ua = (userAgentStr || STR_EMPTY$
|
|
2491
|
+
var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ]();
|
|
2286
2492
|
if (strContains(ua, strMsie)) {
|
|
2287
2493
|
var doc = getDocument() || {};
|
|
2288
2494
|
return mathMax(parseInt(ua[_DYN_SPLIT ](strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
@@ -2296,11 +2502,12 @@ function getIEVersion(userAgentStr) {
|
|
|
2296
2502
|
return null;
|
|
2297
2503
|
}
|
|
2298
2504
|
function isBeaconsSupported(useCached) {
|
|
2299
|
-
if (_beaconsSupported
|
|
2300
|
-
_beaconsSupported = hasNavigator() &&
|
|
2505
|
+
if (!_beaconsSupported || useCached === false) {
|
|
2506
|
+
_beaconsSupported = createCachedValue(hasNavigator() && !!(getNavigator().sendBeacon));
|
|
2301
2507
|
}
|
|
2302
|
-
return _beaconsSupported;
|
|
2508
|
+
return _beaconsSupported.v;
|
|
2303
2509
|
}
|
|
2510
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2304
2511
|
function isFetchSupported(withKeepAlive) {
|
|
2305
2512
|
var isSupported = false;
|
|
2306
2513
|
try {
|
|
@@ -2314,15 +2521,20 @@ function isFetchSupported(withKeepAlive) {
|
|
|
2314
2521
|
}
|
|
2315
2522
|
return isSupported;
|
|
2316
2523
|
}
|
|
2524
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2317
2525
|
function useXDomainRequest() {
|
|
2318
|
-
if (_useXDomainRequest
|
|
2319
|
-
_useXDomainRequest = (
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2526
|
+
if (!_useXDomainRequest) {
|
|
2527
|
+
_useXDomainRequest = getDeferred(function () {
|
|
2528
|
+
var useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
|
|
2529
|
+
if (useXDomainRequest && isXhrSupported()) {
|
|
2530
|
+
useXDomainRequest = useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
|
|
2531
|
+
}
|
|
2532
|
+
return !!useXDomainRequest;
|
|
2533
|
+
});
|
|
2323
2534
|
}
|
|
2324
|
-
return _useXDomainRequest;
|
|
2535
|
+
return _useXDomainRequest.v;
|
|
2325
2536
|
}
|
|
2537
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2326
2538
|
function isXhrSupported() {
|
|
2327
2539
|
var isSupported = false;
|
|
2328
2540
|
try {
|
|
@@ -2333,38 +2545,69 @@ function isXhrSupported() {
|
|
|
2333
2545
|
}
|
|
2334
2546
|
return isSupported;
|
|
2335
2547
|
}
|
|
2548
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2336
2549
|
function _getNamedValue(values, name) {
|
|
2550
|
+
var items = [];
|
|
2337
2551
|
if (values) {
|
|
2338
|
-
|
|
2339
|
-
var value = values[i];
|
|
2552
|
+
arrForEach(values, function (value) {
|
|
2340
2553
|
if (value[_DYN_NAME ]) {
|
|
2341
2554
|
if (value[_DYN_NAME ] === name) {
|
|
2342
|
-
|
|
2555
|
+
items[_DYN_PUSH ](value);
|
|
2343
2556
|
}
|
|
2344
2557
|
}
|
|
2345
|
-
}
|
|
2558
|
+
});
|
|
2346
2559
|
}
|
|
2347
|
-
return
|
|
2560
|
+
return items;
|
|
2348
2561
|
}
|
|
2562
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2349
2563
|
function findMetaTag(name) {
|
|
2564
|
+
var tags = findMetaTags(name);
|
|
2565
|
+
if (tags[_DYN_LENGTH$1 ] > 0) {
|
|
2566
|
+
return tags[0];
|
|
2567
|
+
}
|
|
2568
|
+
return null;
|
|
2569
|
+
}
|
|
2570
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2571
|
+
function findMetaTags(name) {
|
|
2572
|
+
var tags = [];
|
|
2350
2573
|
var doc = getDocument();
|
|
2351
2574
|
if (doc && name) {
|
|
2352
|
-
|
|
2575
|
+
arrForEach(_getNamedValue(doc.querySelectorAll("meta"), name), function (item) {
|
|
2576
|
+
tags[_DYN_PUSH ](item.content);
|
|
2577
|
+
});
|
|
2353
2578
|
}
|
|
2354
|
-
return
|
|
2579
|
+
return tags;
|
|
2355
2580
|
}
|
|
2581
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2356
2582
|
function findNamedServerTiming(name) {
|
|
2357
2583
|
var value;
|
|
2358
|
-
var
|
|
2359
|
-
if (
|
|
2360
|
-
|
|
2361
|
-
value = _getNamedValue((navPerf[_DYN_LENGTH$1 ] > 0 ? navPerf[0] : {}).serverTiming, name).description;
|
|
2584
|
+
var serverTimings = findNamedServerTimings(name);
|
|
2585
|
+
if (serverTimings[_DYN_LENGTH$1 ] > 0) {
|
|
2586
|
+
value = serverTimings[0];
|
|
2362
2587
|
}
|
|
2363
2588
|
return value;
|
|
2364
2589
|
}
|
|
2590
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2591
|
+
function findNamedServerTimings(name) {
|
|
2592
|
+
var values = [];
|
|
2593
|
+
var perf = getPerformance();
|
|
2594
|
+
if (perf && perf.getEntriesByType) {
|
|
2595
|
+
arrForEach(perf.getEntriesByType("navigation") || [], function (navPerf) {
|
|
2596
|
+
arrForEach(_getNamedValue(navPerf.serverTiming, name), function (value) {
|
|
2597
|
+
var desc = value.description;
|
|
2598
|
+
if (!isNullOrUndefined(desc)) {
|
|
2599
|
+
values[_DYN_PUSH ](desc);
|
|
2600
|
+
}
|
|
2601
|
+
});
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
return values;
|
|
2605
|
+
}
|
|
2606
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2365
2607
|
function redactUserInfo(url) {
|
|
2366
2608
|
return url.replace(/^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)([^:@]{1,200}):([^@]{1,200})@(.*)$/, "$1REDACTED:REDACTED@$4");
|
|
2367
2609
|
}
|
|
2610
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2368
2611
|
function redactQueryParameters(url, config) {
|
|
2369
2612
|
var sensitiveParams;
|
|
2370
2613
|
var questionMarkIndex = strIndexOf(url, "?");
|
|
@@ -2372,14 +2615,14 @@ function redactQueryParameters(url, config) {
|
|
|
2372
2615
|
return url;
|
|
2373
2616
|
}
|
|
2374
2617
|
if (config && config.redactQueryParams) {
|
|
2375
|
-
sensitiveParams = DEFAULT_SENSITIVE_PARAMS
|
|
2618
|
+
sensitiveParams = DEFAULT_SENSITIVE_PARAMS[_DYN_CONCAT ](config.redactQueryParams);
|
|
2376
2619
|
}
|
|
2377
2620
|
else {
|
|
2378
2621
|
sensitiveParams = DEFAULT_SENSITIVE_PARAMS;
|
|
2379
2622
|
}
|
|
2380
2623
|
var baseUrl = strSubstring(url, 0, questionMarkIndex + 1);
|
|
2381
2624
|
var queryString = strSubstring(url, questionMarkIndex + 1);
|
|
2382
|
-
var fragment = STR_EMPTY$
|
|
2625
|
+
var fragment = STR_EMPTY$1;
|
|
2383
2626
|
var hashIndex = strIndexOf(queryString, "#");
|
|
2384
2627
|
if (hashIndex !== -1) {
|
|
2385
2628
|
fragment = strSubstring(queryString, hashIndex);
|
|
@@ -2412,7 +2655,7 @@ function redactQueryParameters(url, config) {
|
|
|
2412
2655
|
else {
|
|
2413
2656
|
var paramName = pair[_DYN_SUBSTRING ](0, equalsIndex);
|
|
2414
2657
|
var paramValue = pair[_DYN_SUBSTRING ](equalsIndex + 1);
|
|
2415
|
-
if (paramValue === STR_EMPTY$
|
|
2658
|
+
if (paramValue === STR_EMPTY$1) {
|
|
2416
2659
|
resultParts[_DYN_PUSH ](pair);
|
|
2417
2660
|
}
|
|
2418
2661
|
else {
|
|
@@ -2437,10 +2680,11 @@ function redactQueryParameters(url, config) {
|
|
|
2437
2680
|
if (!anyParamRedacted) {
|
|
2438
2681
|
return url;
|
|
2439
2682
|
}
|
|
2440
|
-
return baseUrl + resultParts
|
|
2683
|
+
return baseUrl + resultParts[_DYN_JOIN ]("&") + fragment;
|
|
2441
2684
|
}
|
|
2685
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2442
2686
|
function fieldRedaction(input, config) {
|
|
2443
|
-
if (!input || !isString(input) || input
|
|
2687
|
+
if (!input || !isString(input) || strIndexOf(input, " ") !== -1) {
|
|
2444
2688
|
return input;
|
|
2445
2689
|
}
|
|
2446
2690
|
var isRedactionDisabled = config && config.redactUrls === false;
|
|
@@ -2485,7 +2729,7 @@ function _mwcSeed(seedValue) {
|
|
|
2485
2729
|
function _autoSeedMwc() {
|
|
2486
2730
|
try {
|
|
2487
2731
|
var now = utcNow() & 0x7fffffff;
|
|
2488
|
-
_mwcSeed(((
|
|
2732
|
+
_mwcSeed(((mathRandom() * UInt32Mask) ^ now) + now);
|
|
2489
2733
|
}
|
|
2490
2734
|
catch (e) {
|
|
2491
2735
|
}
|
|
@@ -2509,7 +2753,7 @@ function random32(signed) {
|
|
|
2509
2753
|
value = mwcRandom32() & MaxUInt32;
|
|
2510
2754
|
}
|
|
2511
2755
|
if (value === 0) {
|
|
2512
|
-
value = mathFloor((UInt32Mask *
|
|
2756
|
+
value = mathFloor((UInt32Mask * mathRandom()) | 0);
|
|
2513
2757
|
}
|
|
2514
2758
|
if (!signed) {
|
|
2515
2759
|
value >>>= 0;
|
|
@@ -2530,7 +2774,7 @@ function newId(maxLength) {
|
|
|
2530
2774
|
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
2531
2775
|
var number = random32() >>> 0;
|
|
2532
2776
|
var chars = 0;
|
|
2533
|
-
var result = STR_EMPTY$
|
|
2777
|
+
var result = STR_EMPTY$1;
|
|
2534
2778
|
while (result[_DYN_LENGTH$1 ] < maxLength) {
|
|
2535
2779
|
chars++;
|
|
2536
2780
|
result += base64chars.charAt(number & 0x3F);
|
|
@@ -2543,7 +2787,7 @@ function newId(maxLength) {
|
|
|
2543
2787
|
return result;
|
|
2544
2788
|
}
|
|
2545
2789
|
|
|
2546
|
-
var version = '3.
|
|
2790
|
+
var version = '3.4.0-beta';
|
|
2547
2791
|
var instanceName = "." + newId(6);
|
|
2548
2792
|
var _dataUid = 0;
|
|
2549
2793
|
function _canAcceptData(target) {
|
|
@@ -2568,11 +2812,11 @@ function _getCache(data, target) {
|
|
|
2568
2812
|
}
|
|
2569
2813
|
function createUniqueNamespace(name, includeVersion) {
|
|
2570
2814
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
2571
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY$
|
|
2815
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY$1) + instanceName);
|
|
2572
2816
|
}
|
|
2573
2817
|
function createElmNodeData(name) {
|
|
2574
2818
|
var data = {
|
|
2575
|
-
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY$
|
|
2819
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY$1) + "." + version),
|
|
2576
2820
|
accept: function (target) {
|
|
2577
2821
|
return _canAcceptData(target);
|
|
2578
2822
|
},
|
|
@@ -3110,7 +3354,7 @@ function _createAndUseHandler(state, configHandler) {
|
|
|
3110
3354
|
configHandler = null;
|
|
3111
3355
|
}
|
|
3112
3356
|
};
|
|
3113
|
-
objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ?
|
|
3357
|
+
objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? STR_EMPTY$1 : "[X]"); } });
|
|
3114
3358
|
state.use(handler, configHandler);
|
|
3115
3359
|
return handler;
|
|
3116
3360
|
}
|
|
@@ -3219,38 +3463,8 @@ function onConfigChange(config, configHandler, logger) {
|
|
|
3219
3463
|
return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
|
|
3220
3464
|
}
|
|
3221
3465
|
|
|
3222
|
-
function runTargetUnload(target, isAsync) {
|
|
3223
|
-
if (target && target[_DYN_UNLOAD ]) {
|
|
3224
|
-
return target[_DYN_UNLOAD ](isAsync);
|
|
3225
|
-
}
|
|
3226
|
-
}
|
|
3227
|
-
function doUnloadAll(targets, isAsync, done) {
|
|
3228
|
-
var result;
|
|
3229
|
-
if (!done) {
|
|
3230
|
-
result = createPromise(function (resolved) {
|
|
3231
|
-
done = resolved;
|
|
3232
|
-
});
|
|
3233
|
-
}
|
|
3234
|
-
if (targets && getLength(targets) > 0) {
|
|
3235
|
-
doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {
|
|
3236
|
-
doUnloadAll(arrSlice(targets, 1), isAsync, done);
|
|
3237
|
-
});
|
|
3238
|
-
}
|
|
3239
|
-
else {
|
|
3240
|
-
done();
|
|
3241
|
-
}
|
|
3242
|
-
return result;
|
|
3243
|
-
}
|
|
3244
|
-
|
|
3245
|
-
var ChannelControllerPriority = 500;
|
|
3246
3466
|
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
3247
|
-
|
|
3248
|
-
function cfgDfMerge(defaultValue) {
|
|
3249
|
-
return {
|
|
3250
|
-
mrg: true,
|
|
3251
|
-
v: defaultValue
|
|
3252
|
-
};
|
|
3253
|
-
}
|
|
3467
|
+
var ChannelControllerPriority = 500;
|
|
3254
3468
|
|
|
3255
3469
|
var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
|
|
3256
3470
|
var _aiNamespace = null;
|
|
@@ -3310,9 +3524,9 @@ var _logFuncs = (_a$4 = {},
|
|
|
3310
3524
|
_a$4);
|
|
3311
3525
|
function _sanitizeDiagnosticText(text) {
|
|
3312
3526
|
if (text) {
|
|
3313
|
-
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$
|
|
3527
|
+
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
|
|
3314
3528
|
}
|
|
3315
|
-
return STR_EMPTY$
|
|
3529
|
+
return STR_EMPTY$1;
|
|
3316
3530
|
}
|
|
3317
3531
|
function _logToConsole(func, message) {
|
|
3318
3532
|
var theConsole = getConsole();
|
|
@@ -3334,17 +3548,18 @@ var _InternalLogMessage = /** @class */ (function () {
|
|
|
3334
3548
|
_self[_DYN_MESSAGE ] =
|
|
3335
3549
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
3336
3550
|
msgId;
|
|
3337
|
-
var strProps = STR_EMPTY$
|
|
3551
|
+
var strProps = STR_EMPTY$1;
|
|
3338
3552
|
if (hasJSON()) {
|
|
3339
|
-
strProps = getJSON()
|
|
3553
|
+
strProps = getJSON()[_DYN_STRINGIFY ](properties);
|
|
3340
3554
|
}
|
|
3341
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$
|
|
3342
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$
|
|
3555
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
|
|
3556
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
|
|
3343
3557
|
_self[_DYN_MESSAGE ] += diagnosticText;
|
|
3344
3558
|
}
|
|
3345
3559
|
_InternalLogMessage.dataType = "MessageData";
|
|
3346
3560
|
return _InternalLogMessage;
|
|
3347
3561
|
}());
|
|
3562
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3348
3563
|
function safeGetLogger(core, config) {
|
|
3349
3564
|
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
3350
3565
|
}
|
|
@@ -3411,6 +3626,9 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
3411
3626
|
_unloadHandler && _unloadHandler.rm();
|
|
3412
3627
|
_unloadHandler = null;
|
|
3413
3628
|
};
|
|
3629
|
+
objDefine(_self, "dbgMode", {
|
|
3630
|
+
g: function () { return _enableDebug; }
|
|
3631
|
+
});
|
|
3414
3632
|
function _logInternalMessage(severity, message) {
|
|
3415
3633
|
if (_areInternalMessagesThrottled()) {
|
|
3416
3634
|
return;
|
|
@@ -3479,100 +3697,515 @@ function _logInternalMessage(logger, severity, message) {
|
|
|
3479
3697
|
_getLogger(logger).logInternalMessage(severity, message);
|
|
3480
3698
|
}
|
|
3481
3699
|
|
|
3482
|
-
|
|
3483
|
-
var strToGMTString = "toGMTString";
|
|
3484
|
-
var strToUTCString = "toUTCString";
|
|
3485
|
-
var strCookie = "cookie";
|
|
3486
|
-
var strExpires = "expires";
|
|
3487
|
-
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
3488
|
-
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
3489
|
-
var strConfigCookieMgr = "_ckMgr";
|
|
3490
|
-
var _supportsCookies = null;
|
|
3491
|
-
var _allowUaSameSite = null;
|
|
3492
|
-
var _parsedCookieValue = null;
|
|
3493
|
-
var _doc;
|
|
3494
|
-
var _cookieCache = {};
|
|
3495
|
-
var _globalCookieConfig = {};
|
|
3496
|
-
var rootDefaultConfig = (_a$3 = {
|
|
3497
|
-
cookieCfg: cfgDfMerge((_b = {},
|
|
3498
|
-
_b[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
3499
|
-
_b.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
3500
|
-
_b.enabled = UNDEFINED_VALUE,
|
|
3501
|
-
_b.ignoreCookies = UNDEFINED_VALUE,
|
|
3502
|
-
_b.blockedCookies = UNDEFINED_VALUE,
|
|
3503
|
-
_b.disableCookieDefer = false,
|
|
3504
|
-
_b)),
|
|
3505
|
-
cookieDomain: UNDEFINED_VALUE,
|
|
3506
|
-
cookiePath: UNDEFINED_VALUE
|
|
3507
|
-
},
|
|
3508
|
-
_a$3[strDisableCookiesUsage] = UNDEFINED_VALUE,
|
|
3509
|
-
_a$3);
|
|
3510
|
-
function _getDoc() {
|
|
3511
|
-
!_doc && (_doc = getLazy(function () { return getDocument(); }));
|
|
3512
|
-
}
|
|
3513
|
-
function _gblCookieMgr(config, logger) {
|
|
3514
|
-
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
3515
|
-
if (!inst) {
|
|
3516
|
-
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
3517
|
-
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
3518
|
-
}
|
|
3519
|
-
return inst;
|
|
3700
|
+
function _noopVoid() {
|
|
3520
3701
|
}
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3702
|
+
|
|
3703
|
+
var MAX_TRACE_STATE_MEMBERS = 32;
|
|
3704
|
+
var MAX_TRACE_STATE_LEN = 512;
|
|
3705
|
+
var LCALPHA = "[a-z]";
|
|
3706
|
+
var LCALPHA_DIGIT = "[a-z\\d]";
|
|
3707
|
+
var LCALPHA_DIGIT_UNDERSCORE_DASH_STAR_SLASH = "[a-z\\d_\\-*\\/]";
|
|
3708
|
+
var SIMPLE_KEY = "(" + LCALPHA + LCALPHA_DIGIT_UNDERSCORE_DASH_STAR_SLASH + "{0,255})";
|
|
3709
|
+
var TENANT_ID = "(" + LCALPHA_DIGIT + LCALPHA_DIGIT_UNDERSCORE_DASH_STAR_SLASH + "{0,240})";
|
|
3710
|
+
var SYSTEM_ID = "(" + LCALPHA + LCALPHA_DIGIT_UNDERSCORE_DASH_STAR_SLASH + "{0,13})";
|
|
3711
|
+
var MULTI_TENANT_KEY = "(" + TENANT_ID + "@" + SYSTEM_ID + ")";
|
|
3712
|
+
var NBLK_CHAR = "\x21-\x2B\\--\x3C\x3E-\x7E";
|
|
3713
|
+
var TRACESTATE_VALUE = "[\x20" + NBLK_CHAR + "]{0,255}[" + NBLK_CHAR + "]";
|
|
3714
|
+
var TRACESTATE_KVP_REGEX = ( /*#__PURE__*/new RegExp("^\\s*((?:" + SIMPLE_KEY + "|" + MULTI_TENANT_KEY + ")=(" + TRACESTATE_VALUE + "))\\s*$"));
|
|
3715
|
+
function _parseListMember(value) {
|
|
3716
|
+
if (value) {
|
|
3717
|
+
TRACESTATE_KVP_REGEX.lastIndex = 0;
|
|
3718
|
+
var match = TRACESTATE_KVP_REGEX.exec(value);
|
|
3719
|
+
if (match && match[_DYN_LENGTH$1 ] >= 7 && match[1] && match[6]) {
|
|
3720
|
+
var type = match[3] ? 1 : 0 ;
|
|
3721
|
+
var multiTenant = null;
|
|
3722
|
+
if (type === 1 ) {
|
|
3723
|
+
multiTenant = {
|
|
3724
|
+
tenantId: match[4],
|
|
3725
|
+
systemId: match[5]
|
|
3726
|
+
};
|
|
3727
|
+
}
|
|
3728
|
+
var parts = {
|
|
3729
|
+
type: type,
|
|
3730
|
+
key: match[2],
|
|
3731
|
+
multiTenant: multiTenant,
|
|
3732
|
+
value: match[6]
|
|
3733
|
+
};
|
|
3734
|
+
return parts;
|
|
3735
|
+
}
|
|
3524
3736
|
}
|
|
3525
|
-
return
|
|
3737
|
+
return null;
|
|
3526
3738
|
}
|
|
3527
|
-
function
|
|
3528
|
-
|
|
3529
|
-
|
|
3739
|
+
function _parseTraceStateList(value) {
|
|
3740
|
+
var items = [];
|
|
3741
|
+
if (value) {
|
|
3742
|
+
var addedKeys_1 = [];
|
|
3743
|
+
arrForEach(strSplit(value, ","), function (member) {
|
|
3744
|
+
var parts = _parseListMember(member);
|
|
3745
|
+
if (parts) {
|
|
3746
|
+
if (arrIndexOf(addedKeys_1, parts.key) === -1) {
|
|
3747
|
+
items[_DYN_PUSH ](parts);
|
|
3748
|
+
addedKeys_1[_DYN_PUSH ](parts.key);
|
|
3749
|
+
if (items[_DYN_LENGTH$1 ] >= MAX_TRACE_STATE_MEMBERS) {
|
|
3750
|
+
return -1;
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
});
|
|
3530
3755
|
}
|
|
3531
|
-
return
|
|
3756
|
+
return items;
|
|
3532
3757
|
}
|
|
3533
|
-
function
|
|
3534
|
-
|
|
3535
|
-
if (
|
|
3536
|
-
return
|
|
3758
|
+
function _indexOf(items, key) {
|
|
3759
|
+
for (var lp = 0; lp < items[_DYN_LENGTH$1 ]; lp++) {
|
|
3760
|
+
if (items[lp].key === key) {
|
|
3761
|
+
return lp;
|
|
3537
3762
|
}
|
|
3538
3763
|
}
|
|
3539
|
-
return
|
|
3764
|
+
return -1;
|
|
3540
3765
|
}
|
|
3541
|
-
function
|
|
3542
|
-
var
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
if (
|
|
3546
|
-
|
|
3766
|
+
function _keys(items, parent) {
|
|
3767
|
+
var keys = [];
|
|
3768
|
+
var delKeys = [];
|
|
3769
|
+
arrForEach(items, function (member) {
|
|
3770
|
+
if (member[_DYN_VALUE$1 ] != null) {
|
|
3771
|
+
keys[_DYN_PUSH ](member.key);
|
|
3547
3772
|
}
|
|
3548
|
-
|
|
3549
|
-
|
|
3773
|
+
else {
|
|
3774
|
+
delKeys[_DYN_PUSH ](member.key);
|
|
3550
3775
|
}
|
|
3551
|
-
|
|
3776
|
+
});
|
|
3777
|
+
if (parent) {
|
|
3778
|
+
arrForEach(parent.keys, function (key) {
|
|
3779
|
+
if (arrIndexOf(keys, key) === -1 && arrIndexOf(delKeys, key) === -1) {
|
|
3780
|
+
keys[_DYN_PUSH ](key);
|
|
3781
|
+
}
|
|
3782
|
+
});
|
|
3552
3783
|
}
|
|
3553
|
-
return
|
|
3784
|
+
return keys;
|
|
3554
3785
|
}
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3786
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3787
|
+
function _isEmpty(items, parent) {
|
|
3788
|
+
var delKeys;
|
|
3789
|
+
var isEmpty = true;
|
|
3790
|
+
if (items && items[_DYN_LENGTH$1 ] > 0) {
|
|
3791
|
+
arrForEach(items, function (member) {
|
|
3792
|
+
if (member[_DYN_VALUE$1 ] != null) {
|
|
3793
|
+
isEmpty = false;
|
|
3794
|
+
}
|
|
3795
|
+
else {
|
|
3796
|
+
if (!delKeys) {
|
|
3797
|
+
delKeys = [];
|
|
3798
|
+
}
|
|
3799
|
+
delKeys[_DYN_PUSH ](member.key);
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3559
3802
|
}
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
if (
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3803
|
+
if (isEmpty && parent) {
|
|
3804
|
+
isEmpty = parent.isEmpty;
|
|
3805
|
+
if (!isEmpty && delKeys && delKeys[_DYN_LENGTH$1 ] > 0) {
|
|
3806
|
+
isEmpty = true;
|
|
3807
|
+
arrForEach(parent.keys, function (key) {
|
|
3808
|
+
if (arrIndexOf(delKeys, key) === -1) {
|
|
3809
|
+
isEmpty = false;
|
|
3810
|
+
return -1;
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3567
3813
|
}
|
|
3568
3814
|
}
|
|
3569
|
-
|
|
3570
|
-
cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]);
|
|
3571
|
-
}
|
|
3572
|
-
return cookieMgr;
|
|
3815
|
+
return isEmpty;
|
|
3573
3816
|
}
|
|
3574
|
-
|
|
3575
|
-
|
|
3817
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3818
|
+
function isW3cTraceState(value) {
|
|
3819
|
+
return !!(value && isArray(value.keys) && isFunction(value.get) && isFunction(value.set) && isFunction(value.del) && isFunction(value.hdrs));
|
|
3820
|
+
}
|
|
3821
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3822
|
+
function createW3cTraceState(value, parent) {
|
|
3823
|
+
var cachedItems = safeGetDeferred(_parseTraceStateList, [], [value || STR_EMPTY$1]);
|
|
3824
|
+
function _get(key) {
|
|
3825
|
+
var value;
|
|
3826
|
+
var theItems = cachedItems.v;
|
|
3827
|
+
var idx = _indexOf(theItems, key);
|
|
3828
|
+
if (idx !== -1) {
|
|
3829
|
+
var itmValue = theItems[idx][_DYN_VALUE$1 ];
|
|
3830
|
+
if (itmValue != null) {
|
|
3831
|
+
value = itmValue;
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
else if (parent) {
|
|
3835
|
+
value = parent.get(key);
|
|
3836
|
+
}
|
|
3837
|
+
return value;
|
|
3838
|
+
}
|
|
3839
|
+
function _setMember(member) {
|
|
3840
|
+
if (member) {
|
|
3841
|
+
var theItems = cachedItems.v;
|
|
3842
|
+
var idx = _indexOf(theItems, member.key);
|
|
3843
|
+
if (idx !== -1) {
|
|
3844
|
+
theItems[_DYN_SPLICE ](idx, 1);
|
|
3845
|
+
}
|
|
3846
|
+
theItems.unshift(member);
|
|
3847
|
+
cachedItems = createCachedValue(theItems);
|
|
3848
|
+
return 0;
|
|
3849
|
+
}
|
|
3850
|
+
return -1;
|
|
3851
|
+
}
|
|
3852
|
+
function _set(key, value) {
|
|
3853
|
+
var member;
|
|
3854
|
+
if (key && isString(key) && !isNullOrUndefined(value) && isString(value)) {
|
|
3855
|
+
member = _parseListMember(key + "=" + value);
|
|
3856
|
+
}
|
|
3857
|
+
return _setMember(member);
|
|
3858
|
+
}
|
|
3859
|
+
function _del(key) {
|
|
3860
|
+
_setMember({
|
|
3861
|
+
type: 2 ,
|
|
3862
|
+
key: key
|
|
3863
|
+
});
|
|
3864
|
+
}
|
|
3865
|
+
function _headers(maxHeaders, maxKeys, maxLen) {
|
|
3866
|
+
var results = [];
|
|
3867
|
+
var result = STR_EMPTY$1;
|
|
3868
|
+
var numKeys = 0;
|
|
3869
|
+
var len = 0;
|
|
3870
|
+
maxKeys = maxKeys || MAX_TRACE_STATE_MEMBERS;
|
|
3871
|
+
maxLen = maxLen || MAX_TRACE_STATE_LEN;
|
|
3872
|
+
var theItems = cachedItems.v;
|
|
3873
|
+
arrForEach(_keys(theItems, parent), function (key) {
|
|
3874
|
+
var value = _get(key);
|
|
3875
|
+
if (!isNullOrUndefined(value) && isString(value)) {
|
|
3876
|
+
numKeys++;
|
|
3877
|
+
var val = key + "=" + value;
|
|
3878
|
+
var valLen = val[_DYN_LENGTH$1 ];
|
|
3879
|
+
if (len + 1 + valLen >= maxLen) {
|
|
3880
|
+
results[_DYN_PUSH ](result);
|
|
3881
|
+
if (maxHeaders && results[_DYN_LENGTH$1 ] <= maxHeaders) {
|
|
3882
|
+
return -1;
|
|
3883
|
+
}
|
|
3884
|
+
result = STR_EMPTY$1;
|
|
3885
|
+
len = 0;
|
|
3886
|
+
}
|
|
3887
|
+
if (result[_DYN_LENGTH$1 ] > 0) {
|
|
3888
|
+
result += ",";
|
|
3889
|
+
len++;
|
|
3890
|
+
}
|
|
3891
|
+
result += val;
|
|
3892
|
+
len += valLen;
|
|
3893
|
+
if (numKeys >= maxKeys) {
|
|
3894
|
+
return -1;
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
});
|
|
3898
|
+
if (result) {
|
|
3899
|
+
results[_DYN_PUSH ](result);
|
|
3900
|
+
}
|
|
3901
|
+
return results;
|
|
3902
|
+
}
|
|
3903
|
+
var traceStateList = {
|
|
3904
|
+
keys: [],
|
|
3905
|
+
isEmpty: false,
|
|
3906
|
+
get: _get,
|
|
3907
|
+
set: _set,
|
|
3908
|
+
del: _del,
|
|
3909
|
+
hdrs: _headers,
|
|
3910
|
+
child: function () { return createW3cTraceState(null, traceStateList); }
|
|
3911
|
+
};
|
|
3912
|
+
function _toString() {
|
|
3913
|
+
var headers = traceStateList.hdrs(1);
|
|
3914
|
+
return headers[_DYN_LENGTH$1 ] > 0 ? headers[0] : STR_EMPTY$1;
|
|
3915
|
+
}
|
|
3916
|
+
objDefineProps(traceStateList, {
|
|
3917
|
+
"keys": {
|
|
3918
|
+
g: function () { return _keys(cachedItems.v, parent); }
|
|
3919
|
+
},
|
|
3920
|
+
"isEmpty": {
|
|
3921
|
+
g: function () { return _isEmpty(cachedItems.v, parent); }
|
|
3922
|
+
},
|
|
3923
|
+
"toString": {
|
|
3924
|
+
v: _toString,
|
|
3925
|
+
e: false
|
|
3926
|
+
},
|
|
3927
|
+
"_p": {
|
|
3928
|
+
v: parent,
|
|
3929
|
+
e: false
|
|
3930
|
+
}
|
|
3931
|
+
});
|
|
3932
|
+
setObjStringTag(traceStateList, _toString);
|
|
3933
|
+
return traceStateList;
|
|
3934
|
+
}
|
|
3935
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3936
|
+
function findW3cTraceState() {
|
|
3937
|
+
var name = "tracestate";
|
|
3938
|
+
var traceState = null;
|
|
3939
|
+
var metaTags = findMetaTags(name);
|
|
3940
|
+
if (metaTags[_DYN_LENGTH$1 ] > 0) {
|
|
3941
|
+
traceState = createW3cTraceState(metaTags[_DYN_JOIN ](","));
|
|
3942
|
+
}
|
|
3943
|
+
if (!traceState) {
|
|
3944
|
+
var serverTimings = findNamedServerTimings(name);
|
|
3945
|
+
if (serverTimings[_DYN_LENGTH$1 ] > 0) {
|
|
3946
|
+
traceState = createW3cTraceState(serverTimings[_DYN_JOIN ](","));
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
return traceState;
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3952
|
+
function newGuid() {
|
|
3953
|
+
var uuid = generateW3CId();
|
|
3954
|
+
return strSubstring(uuid, 0, 8) + "-" + strSubstring(uuid, 8, 12) + "-" + strSubstring(uuid, 12, 16) + "-" + strSubstring(uuid, 16, 20) + "-" + strSubstring(uuid, 20);
|
|
3955
|
+
}
|
|
3956
|
+
function generateW3CId() {
|
|
3957
|
+
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
3958
|
+
var oct = STR_EMPTY$1, tmp;
|
|
3959
|
+
for (var a = 0; a < 4; a++) {
|
|
3960
|
+
tmp = random32();
|
|
3961
|
+
oct +=
|
|
3962
|
+
hexValues[tmp & 0xF] +
|
|
3963
|
+
hexValues[tmp >> 4 & 0xF] +
|
|
3964
|
+
hexValues[tmp >> 8 & 0xF] +
|
|
3965
|
+
hexValues[tmp >> 12 & 0xF] +
|
|
3966
|
+
hexValues[tmp >> 16 & 0xF] +
|
|
3967
|
+
hexValues[tmp >> 20 & 0xF] +
|
|
3968
|
+
hexValues[tmp >> 24 & 0xF] +
|
|
3969
|
+
hexValues[tmp >> 28 & 0xF];
|
|
3970
|
+
}
|
|
3971
|
+
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
3972
|
+
return strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + "4" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12);
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]{1,64})?$/i;
|
|
3976
|
+
var DEFAULT_VERSION = "00";
|
|
3977
|
+
var INVALID_VERSION = "ff";
|
|
3978
|
+
var INVALID_TRACE_ID = "00000000000000000000000000000000";
|
|
3979
|
+
var INVALID_SPAN_ID = "0000000000000000";
|
|
3980
|
+
var SAMPLED_FLAG = 0x01;
|
|
3981
|
+
function _isValid(value, len, invalidValue) {
|
|
3982
|
+
if (value && value[_DYN_LENGTH$1 ] === len && value !== invalidValue) {
|
|
3983
|
+
return !!value.match(/^[\da-f]*$/i);
|
|
3984
|
+
}
|
|
3985
|
+
return false;
|
|
3986
|
+
}
|
|
3987
|
+
function _formatValue(value, len, defValue) {
|
|
3988
|
+
if (_isValid(value, len)) {
|
|
3989
|
+
return value;
|
|
3990
|
+
}
|
|
3991
|
+
return defValue;
|
|
3992
|
+
}
|
|
3993
|
+
function _formatFlags(value) {
|
|
3994
|
+
if (isNaN(value) || value < 0 || value > 255) {
|
|
3995
|
+
value = 0x01;
|
|
3996
|
+
}
|
|
3997
|
+
var result = value[_DYN_TO_STRING ](16);
|
|
3998
|
+
while (result[_DYN_LENGTH$1 ] < 2) {
|
|
3999
|
+
result = "0" + result;
|
|
4000
|
+
}
|
|
4001
|
+
return result;
|
|
4002
|
+
}
|
|
4003
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4004
|
+
function createTraceParent(traceId, spanId, flags, version) {
|
|
4005
|
+
return {
|
|
4006
|
+
version: _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION,
|
|
4007
|
+
traceId: isValidTraceId(traceId) ? traceId : generateW3CId(),
|
|
4008
|
+
spanId: isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16),
|
|
4009
|
+
traceFlags: (!isNullOrUndefined(flags) && flags >= 0 && flags <= 0xFF ? flags : 1 )
|
|
4010
|
+
};
|
|
4011
|
+
}
|
|
4012
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4013
|
+
function parseTraceParent(value, selectIdx) {
|
|
4014
|
+
if (!value) {
|
|
4015
|
+
return null;
|
|
4016
|
+
}
|
|
4017
|
+
if (isArray(value)) {
|
|
4018
|
+
value = value[0] || STR_EMPTY$1;
|
|
4019
|
+
}
|
|
4020
|
+
if (!value || !isString(value) || value[_DYN_LENGTH$1 ] > 8192) {
|
|
4021
|
+
return null;
|
|
4022
|
+
}
|
|
4023
|
+
if (strIndexOf(value, ",") !== -1) {
|
|
4024
|
+
var values = value[_DYN_SPLIT ](",");
|
|
4025
|
+
value = values[selectIdx > 0 && values[_DYN_LENGTH$1 ] > selectIdx ? selectIdx : 0];
|
|
4026
|
+
}
|
|
4027
|
+
TRACE_PARENT_REGEX.lastIndex = 0;
|
|
4028
|
+
var match = TRACE_PARENT_REGEX.exec(strTrim(value));
|
|
4029
|
+
if (!match ||
|
|
4030
|
+
match[1] === INVALID_VERSION ||
|
|
4031
|
+
match[2] === INVALID_TRACE_ID ||
|
|
4032
|
+
match[3] === INVALID_SPAN_ID) {
|
|
4033
|
+
return null;
|
|
4034
|
+
}
|
|
4035
|
+
return {
|
|
4036
|
+
version: (match[1] || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ](),
|
|
4037
|
+
traceId: (match[2] || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ](),
|
|
4038
|
+
spanId: (match[3] || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ](),
|
|
4039
|
+
traceFlags: parseInt(match[4], 16)
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4043
|
+
function isValidTraceId(value) {
|
|
4044
|
+
return _isValid(value, 32, INVALID_TRACE_ID);
|
|
4045
|
+
}
|
|
4046
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4047
|
+
function isValidSpanId(value) {
|
|
4048
|
+
return _isValid(value, 16, INVALID_SPAN_ID);
|
|
4049
|
+
}
|
|
4050
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4051
|
+
function isValidTraceParent(value) {
|
|
4052
|
+
if (!value ||
|
|
4053
|
+
!_isValid(value[_DYN_VERSION ], 2, INVALID_VERSION) ||
|
|
4054
|
+
!_isValid(value[_DYN_TRACE_ID ], 32, INVALID_TRACE_ID) ||
|
|
4055
|
+
!_isValid(value[_DYN_SPAN_ID ], 16, INVALID_SPAN_ID) ||
|
|
4056
|
+
!_isValid(_formatFlags(value[_DYN_TRACE_FLAGS ]), 2)) {
|
|
4057
|
+
return false;
|
|
4058
|
+
}
|
|
4059
|
+
return true;
|
|
4060
|
+
}
|
|
4061
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4062
|
+
function isSampledFlag(value) {
|
|
4063
|
+
if (isValidTraceParent(value)) {
|
|
4064
|
+
return (value[_DYN_TRACE_FLAGS ] & SAMPLED_FLAG) === SAMPLED_FLAG;
|
|
4065
|
+
}
|
|
4066
|
+
return false;
|
|
4067
|
+
}
|
|
4068
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4069
|
+
function formatTraceParent(value) {
|
|
4070
|
+
if (value) {
|
|
4071
|
+
var flags = _formatFlags(value[_DYN_TRACE_FLAGS ]);
|
|
4072
|
+
if (!_isValid(flags, 2)) {
|
|
4073
|
+
flags = "01";
|
|
4074
|
+
}
|
|
4075
|
+
var version = value[_DYN_VERSION ] || DEFAULT_VERSION;
|
|
4076
|
+
if (version !== "00" && version !== "ff") {
|
|
4077
|
+
version = DEFAULT_VERSION;
|
|
4078
|
+
}
|
|
4079
|
+
return "".concat(version.toLowerCase(), "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), "-").concat(flags.toLowerCase());
|
|
4080
|
+
}
|
|
4081
|
+
return STR_EMPTY$1;
|
|
4082
|
+
}
|
|
4083
|
+
function findW3cTraceParent(selectIdx) {
|
|
4084
|
+
var name = "traceparent";
|
|
4085
|
+
var traceParent = parseTraceParent(findMetaTag(name), selectIdx);
|
|
4086
|
+
if (!traceParent) {
|
|
4087
|
+
traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);
|
|
4088
|
+
}
|
|
4089
|
+
return traceParent;
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
function runTargetUnload(target, isAsync) {
|
|
4093
|
+
if (target && target[_DYN_UNLOAD ]) {
|
|
4094
|
+
return target[_DYN_UNLOAD ](isAsync);
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4097
|
+
function doUnloadAll(targets, isAsync, done) {
|
|
4098
|
+
var result;
|
|
4099
|
+
if (!done) {
|
|
4100
|
+
result = createPromise(function (resolved) {
|
|
4101
|
+
done = resolved;
|
|
4102
|
+
});
|
|
4103
|
+
}
|
|
4104
|
+
if (targets && getLength(targets) > 0) {
|
|
4105
|
+
doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {
|
|
4106
|
+
doUnloadAll(arrSlice(targets, 1), isAsync, done);
|
|
4107
|
+
});
|
|
4108
|
+
}
|
|
4109
|
+
else {
|
|
4110
|
+
done();
|
|
4111
|
+
}
|
|
4112
|
+
return result;
|
|
4113
|
+
}
|
|
4114
|
+
|
|
4115
|
+
var _a$3, _b$1;
|
|
4116
|
+
var strToGMTString = "toGMTString";
|
|
4117
|
+
var strToUTCString = "toUTCString";
|
|
4118
|
+
var strCookie = "cookie";
|
|
4119
|
+
var strExpires = "expires";
|
|
4120
|
+
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
4121
|
+
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
4122
|
+
var strConfigCookieMgr = "_ckMgr";
|
|
4123
|
+
var _supportsCookies = null;
|
|
4124
|
+
var _allowUaSameSite = null;
|
|
4125
|
+
var _parsedCookieValue = null;
|
|
4126
|
+
var _doc;
|
|
4127
|
+
var _cookieCache = {};
|
|
4128
|
+
var _globalCookieConfig = {};
|
|
4129
|
+
var rootDefaultConfig = (_a$3 = {
|
|
4130
|
+
cookieCfg: cfgDfMerge((_b$1 = {},
|
|
4131
|
+
_b$1[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
4132
|
+
_b$1.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
4133
|
+
_b$1.enabled = UNDEFINED_VALUE,
|
|
4134
|
+
_b$1.ignoreCookies = UNDEFINED_VALUE,
|
|
4135
|
+
_b$1.blockedCookies = UNDEFINED_VALUE,
|
|
4136
|
+
_b$1.disableCookieDefer = false,
|
|
4137
|
+
_b$1)),
|
|
4138
|
+
cookieDomain: UNDEFINED_VALUE,
|
|
4139
|
+
cookiePath: UNDEFINED_VALUE
|
|
4140
|
+
},
|
|
4141
|
+
_a$3[strDisableCookiesUsage] = UNDEFINED_VALUE,
|
|
4142
|
+
_a$3);
|
|
4143
|
+
function _getDoc() {
|
|
4144
|
+
!_doc && (_doc = getLazy(function () { return getDocument(); }));
|
|
4145
|
+
}
|
|
4146
|
+
function _gblCookieMgr(config, logger) {
|
|
4147
|
+
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
4148
|
+
if (!inst) {
|
|
4149
|
+
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
4150
|
+
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
4151
|
+
}
|
|
4152
|
+
return inst;
|
|
4153
|
+
}
|
|
4154
|
+
function _isMgrEnabled(cookieMgr) {
|
|
4155
|
+
if (cookieMgr) {
|
|
4156
|
+
return cookieMgr.isEnabled();
|
|
4157
|
+
}
|
|
4158
|
+
return true;
|
|
4159
|
+
}
|
|
4160
|
+
function _isIgnoredCookie(cookieMgrCfg, name) {
|
|
4161
|
+
if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {
|
|
4162
|
+
return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1;
|
|
4163
|
+
}
|
|
4164
|
+
return false;
|
|
4165
|
+
}
|
|
4166
|
+
function _isBlockedCookie(cookieMgrCfg, name) {
|
|
4167
|
+
if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
|
|
4168
|
+
if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) {
|
|
4169
|
+
return true;
|
|
4170
|
+
}
|
|
4171
|
+
}
|
|
4172
|
+
return _isIgnoredCookie(cookieMgrCfg, name);
|
|
4173
|
+
}
|
|
4174
|
+
function _isCfgEnabled(rootConfig, cookieMgrConfig) {
|
|
4175
|
+
var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED ];
|
|
4176
|
+
if (isNullOrUndefined(isCfgEnabled)) {
|
|
4177
|
+
var cookieEnabled = void 0;
|
|
4178
|
+
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
4179
|
+
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
4180
|
+
}
|
|
4181
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
4182
|
+
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
4183
|
+
}
|
|
4184
|
+
isCfgEnabled = cookieEnabled;
|
|
4185
|
+
}
|
|
4186
|
+
return isCfgEnabled;
|
|
4187
|
+
}
|
|
4188
|
+
function safeGetCookieMgr(core, config) {
|
|
4189
|
+
var cookieMgr;
|
|
4190
|
+
if (core) {
|
|
4191
|
+
cookieMgr = core.getCookieMgr();
|
|
4192
|
+
}
|
|
4193
|
+
else if (config) {
|
|
4194
|
+
var cookieCfg = config.cookieCfg;
|
|
4195
|
+
if (cookieCfg && cookieCfg[strConfigCookieMgr]) {
|
|
4196
|
+
cookieMgr = cookieCfg[strConfigCookieMgr];
|
|
4197
|
+
}
|
|
4198
|
+
else {
|
|
4199
|
+
cookieMgr = createCookieMgr(config);
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
if (!cookieMgr) {
|
|
4203
|
+
cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]);
|
|
4204
|
+
}
|
|
4205
|
+
return cookieMgr;
|
|
4206
|
+
}
|
|
4207
|
+
function createCookieMgr(rootConfig, logger) {
|
|
4208
|
+
var cookieMgrConfig;
|
|
3576
4209
|
var _path;
|
|
3577
4210
|
var _domain;
|
|
3578
4211
|
var unloadHandler;
|
|
@@ -3590,11 +4223,11 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
3590
4223
|
if (!isIE()) {
|
|
3591
4224
|
values["max-age"] = "0";
|
|
3592
4225
|
}
|
|
3593
|
-
return _formatCookieValue(STR_EMPTY$
|
|
4226
|
+
return _formatCookieValue(STR_EMPTY$1, values);
|
|
3594
4227
|
}
|
|
3595
4228
|
function _formatSetCookieValue(value, maxAgeSec, domain, path) {
|
|
3596
4229
|
var values = {};
|
|
3597
|
-
var theValue = strTrim(value || STR_EMPTY$
|
|
4230
|
+
var theValue = strTrim(value || STR_EMPTY$1);
|
|
3598
4231
|
var idx = strIndexOf(theValue, ";");
|
|
3599
4232
|
if (idx !== -1) {
|
|
3600
4233
|
theValue = strTrim(strLeft(value, idx));
|
|
@@ -3609,18 +4242,18 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
3609
4242
|
if (expireMs > 0) {
|
|
3610
4243
|
var expiry = new Date();
|
|
3611
4244
|
expiry.setTime(expireMs);
|
|
3612
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$
|
|
4245
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$1, isTruthy);
|
|
3613
4246
|
}
|
|
3614
4247
|
}
|
|
3615
4248
|
if (!_isIE) {
|
|
3616
|
-
setValue(values, "max-age", STR_EMPTY$
|
|
4249
|
+
setValue(values, "max-age", STR_EMPTY$1 + maxAgeSec, null, isUndefined);
|
|
3617
4250
|
}
|
|
3618
4251
|
}
|
|
3619
4252
|
var location = getLocation();
|
|
3620
4253
|
if (location && location.protocol === "https:") {
|
|
3621
4254
|
setValue(values, "secure", null, null, isUndefined);
|
|
3622
4255
|
if (_allowUaSameSite === null) {
|
|
3623
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((
|
|
4256
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone(getUserAgentString());
|
|
3624
4257
|
}
|
|
3625
4258
|
if (_allowUaSameSite) {
|
|
3626
4259
|
setValue(values, "SameSite", "None", null, isUndefined);
|
|
@@ -3711,7 +4344,7 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
3711
4344
|
return result;
|
|
3712
4345
|
},
|
|
3713
4346
|
get: function (name) {
|
|
3714
|
-
var value = STR_EMPTY$
|
|
4347
|
+
var value = STR_EMPTY$1;
|
|
3715
4348
|
var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
|
|
3716
4349
|
if (!isIgnored) {
|
|
3717
4350
|
if (_isMgrEnabled(cookieMgr)) {
|
|
@@ -3785,7 +4418,7 @@ function _extractParts(theValue) {
|
|
|
3785
4418
|
if (theValue && theValue[_DYN_LENGTH$1 ]) {
|
|
3786
4419
|
var parts = strTrim(theValue)[_DYN_SPLIT ](";");
|
|
3787
4420
|
arrForEach(parts, function (thePart) {
|
|
3788
|
-
thePart = strTrim(thePart || STR_EMPTY$
|
|
4421
|
+
thePart = strTrim(thePart || STR_EMPTY$1);
|
|
3789
4422
|
if (thePart) {
|
|
3790
4423
|
var idx = strIndexOf(thePart, "=");
|
|
3791
4424
|
if (idx === -1) {
|
|
@@ -3806,22 +4439,22 @@ function _formatDate(theDate, func) {
|
|
|
3806
4439
|
return null;
|
|
3807
4440
|
}
|
|
3808
4441
|
function _formatCookieValue(value, values) {
|
|
3809
|
-
var cookieValue = value || STR_EMPTY$
|
|
4442
|
+
var cookieValue = value || STR_EMPTY$1;
|
|
3810
4443
|
objForEachKey(values, function (name, theValue) {
|
|
3811
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY$
|
|
4444
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY$1);
|
|
3812
4445
|
});
|
|
3813
4446
|
return cookieValue;
|
|
3814
4447
|
}
|
|
3815
4448
|
function _getCookieValue(name) {
|
|
3816
|
-
var cookieValue = STR_EMPTY$
|
|
4449
|
+
var cookieValue = STR_EMPTY$1;
|
|
3817
4450
|
!_doc && _getDoc();
|
|
3818
4451
|
if (_doc.v) {
|
|
3819
|
-
var theCookie = _doc.v[strCookie] || STR_EMPTY$
|
|
4452
|
+
var theCookie = _doc.v[strCookie] || STR_EMPTY$1;
|
|
3820
4453
|
if (_parsedCookieValue !== theCookie) {
|
|
3821
4454
|
_cookieCache = _extractParts(theCookie);
|
|
3822
4455
|
_parsedCookieValue = theCookie;
|
|
3823
4456
|
}
|
|
3824
|
-
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY$
|
|
4457
|
+
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY$1);
|
|
3825
4458
|
}
|
|
3826
4459
|
return cookieValue;
|
|
3827
4460
|
}
|
|
@@ -4055,13 +4688,13 @@ var PerfEvent = /** @class */ (function () {
|
|
|
4055
4688
|
for (var lp = 0; lp < childEvts[_DYN_LENGTH$1 ]; lp++) {
|
|
4056
4689
|
var childEvt = childEvts[lp];
|
|
4057
4690
|
if (childEvt) {
|
|
4058
|
-
childTime += childEvt
|
|
4691
|
+
childTime += childEvt[_DYN_TIME ];
|
|
4059
4692
|
}
|
|
4060
4693
|
}
|
|
4061
4694
|
}
|
|
4062
|
-
_self
|
|
4063
|
-
_self.exTime = _self
|
|
4064
|
-
_self.complete =
|
|
4695
|
+
_self[_DYN_TIME ] = utcNow() - _self.start;
|
|
4696
|
+
_self.exTime = _self[_DYN_TIME ] - childTime;
|
|
4697
|
+
_self.complete = _noopVoid;
|
|
4065
4698
|
};
|
|
4066
4699
|
}
|
|
4067
4700
|
PerfEvent.ParentContextKey = "parent";
|
|
@@ -4144,136 +4777,116 @@ function getGblPerfMgr() {
|
|
|
4144
4777
|
return _defaultPerfManager;
|
|
4145
4778
|
}
|
|
4146
4779
|
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
function generateW3CId() {
|
|
4152
|
-
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
4153
|
-
var oct = STR_EMPTY$2, tmp;
|
|
4154
|
-
for (var a = 0; a < 4; a++) {
|
|
4155
|
-
tmp = random32();
|
|
4156
|
-
oct +=
|
|
4157
|
-
hexValues[tmp & 0xF] +
|
|
4158
|
-
hexValues[tmp >> 4 & 0xF] +
|
|
4159
|
-
hexValues[tmp >> 8 & 0xF] +
|
|
4160
|
-
hexValues[tmp >> 12 & 0xF] +
|
|
4161
|
-
hexValues[tmp >> 16 & 0xF] +
|
|
4162
|
-
hexValues[tmp >> 20 & 0xF] +
|
|
4163
|
-
hexValues[tmp >> 24 & 0xF] +
|
|
4164
|
-
hexValues[tmp >> 28 & 0xF];
|
|
4165
|
-
}
|
|
4166
|
-
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
4167
|
-
return strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + "4" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12);
|
|
4168
|
-
}
|
|
4169
|
-
|
|
4170
|
-
var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]{1,64})?$/i;
|
|
4171
|
-
var DEFAULT_VERSION = "00";
|
|
4172
|
-
var INVALID_VERSION = "ff";
|
|
4173
|
-
var INVALID_TRACE_ID = "00000000000000000000000000000000";
|
|
4174
|
-
var INVALID_SPAN_ID = "0000000000000000";
|
|
4175
|
-
var SAMPLED_FLAG = 0x01;
|
|
4176
|
-
function _isValid(value, len, invalidValue) {
|
|
4177
|
-
if (value && value[_DYN_LENGTH$1 ] === len && value !== invalidValue) {
|
|
4178
|
-
return !!value.match(/^[\da-f]*$/i);
|
|
4179
|
-
}
|
|
4180
|
-
return false;
|
|
4181
|
-
}
|
|
4182
|
-
function _formatValue(value, len, defValue) {
|
|
4183
|
-
if (_isValid(value, len)) {
|
|
4184
|
-
return value;
|
|
4780
|
+
var _otelTraceState;
|
|
4781
|
+
function _initOTelTraceStateSymbol() {
|
|
4782
|
+
if (!_otelTraceState) {
|
|
4783
|
+
_otelTraceState = createCachedValue(symbolFor("otTraceState"));
|
|
4185
4784
|
}
|
|
4186
|
-
return
|
|
4785
|
+
return _otelTraceState;
|
|
4187
4786
|
}
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
return null;
|
|
4215
|
-
}
|
|
4216
|
-
if (value[_DYN_INDEX_OF$1 ](",") !== -1) {
|
|
4217
|
-
var values = value[_DYN_SPLIT ](",");
|
|
4218
|
-
value = values[selectIdx > 0 && values[_DYN_LENGTH$1 ] > selectIdx ? selectIdx : 0];
|
|
4219
|
-
}
|
|
4220
|
-
var match = TRACE_PARENT_REGEX.exec(strTrim(value));
|
|
4221
|
-
if (!match ||
|
|
4222
|
-
match[1] === INVALID_VERSION ||
|
|
4223
|
-
match[2] === INVALID_TRACE_ID ||
|
|
4224
|
-
match[3] === INVALID_SPAN_ID) {
|
|
4225
|
-
return null;
|
|
4226
|
-
}
|
|
4227
|
-
return {
|
|
4228
|
-
version: (match[1] || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ](),
|
|
4229
|
-
traceId: (match[2] || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ](),
|
|
4230
|
-
spanId: (match[3] || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ](),
|
|
4231
|
-
traceFlags: parseInt(match[4], 16)
|
|
4787
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4788
|
+
function _createOTelTraceState(traceState) {
|
|
4789
|
+
if (!_otelTraceState) {
|
|
4790
|
+
_otelTraceState = _initOTelTraceStateSymbol();
|
|
4791
|
+
}
|
|
4792
|
+
var otTraceState = {
|
|
4793
|
+
set: function (key, value) {
|
|
4794
|
+
var newState = createW3cTraceState(STR_EMPTY$1, traceState);
|
|
4795
|
+
newState.set(key, value);
|
|
4796
|
+
return _createOTelTraceState(newState);
|
|
4797
|
+
},
|
|
4798
|
+
unset: function (key) {
|
|
4799
|
+
var newState = createW3cTraceState(STR_EMPTY$1, traceState);
|
|
4800
|
+
newState.del(key);
|
|
4801
|
+
return _createOTelTraceState(newState);
|
|
4802
|
+
},
|
|
4803
|
+
get: function (key) {
|
|
4804
|
+
return traceState.get(key);
|
|
4805
|
+
},
|
|
4806
|
+
serialize: function () {
|
|
4807
|
+
var headers = traceState.hdrs(1);
|
|
4808
|
+
if (headers[_DYN_LENGTH$1 ] > 0) {
|
|
4809
|
+
return headers[0];
|
|
4810
|
+
}
|
|
4811
|
+
return STR_EMPTY$1;
|
|
4812
|
+
}
|
|
4232
4813
|
};
|
|
4814
|
+
objDefine(otTraceState, _otelTraceState.v, { g: function () { return traceState; } });
|
|
4815
|
+
return otTraceState;
|
|
4233
4816
|
}
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
return _isValid(value, 16, INVALID_SPAN_ID);
|
|
4239
|
-
}
|
|
4240
|
-
function isValidTraceParent(value) {
|
|
4241
|
-
if (!value ||
|
|
4242
|
-
!_isValid(value[_DYN_VERSION ], 2, INVALID_VERSION) ||
|
|
4243
|
-
!_isValid(value.traceId, 32, INVALID_TRACE_ID) ||
|
|
4244
|
-
!_isValid(value.spanId, 16, INVALID_SPAN_ID) ||
|
|
4245
|
-
!_isValid(_formatFlags(value[_DYN_TRACE_FLAGS ]), 2)) {
|
|
4246
|
-
return false;
|
|
4817
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4818
|
+
function isOTelTraceState(value) {
|
|
4819
|
+
if (!_otelTraceState) {
|
|
4820
|
+
_otelTraceState = _initOTelTraceStateSymbol();
|
|
4247
4821
|
}
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
function isSampledFlag(value) {
|
|
4251
|
-
if (isValidTraceParent(value)) {
|
|
4252
|
-
return (value[_DYN_TRACE_FLAGS ] & SAMPLED_FLAG) === SAMPLED_FLAG;
|
|
4822
|
+
if (value && value[_otelTraceState.v]) {
|
|
4823
|
+
return true;
|
|
4253
4824
|
}
|
|
4254
|
-
return
|
|
4825
|
+
return value && isFunction(value.serialize) && isFunction(value.unset) && isFunction(value.get) && isFunction(value.set);
|
|
4255
4826
|
}
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4827
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4828
|
+
function createOTelTraceState(value) {
|
|
4829
|
+
var traceState = null;
|
|
4830
|
+
if (isOTelTraceState(value)) {
|
|
4831
|
+
var parentTraceState = void 0;
|
|
4832
|
+
if (_otelTraceState) {
|
|
4833
|
+
parentTraceState = value[_otelTraceState.v];
|
|
4261
4834
|
}
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4835
|
+
if (parentTraceState) {
|
|
4836
|
+
traceState = createW3cTraceState(STR_EMPTY$1, parentTraceState);
|
|
4837
|
+
}
|
|
4838
|
+
else {
|
|
4839
|
+
traceState = createW3cTraceState(value.serialize());
|
|
4265
4840
|
}
|
|
4266
|
-
return "".concat(version.toLowerCase(), "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), "-").concat(flags.toLowerCase());
|
|
4267
4841
|
}
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
function findW3cTraceParent(selectIdx) {
|
|
4271
|
-
var name = "traceparent";
|
|
4272
|
-
var traceParent = parseTraceParent(findMetaTag(name), selectIdx);
|
|
4273
|
-
if (!traceParent) {
|
|
4274
|
-
traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);
|
|
4842
|
+
else if (isW3cTraceState(value)) {
|
|
4843
|
+
traceState = value;
|
|
4275
4844
|
}
|
|
4276
|
-
|
|
4845
|
+
else {
|
|
4846
|
+
traceState = createW3cTraceState(isString(value) ? value : STR_EMPTY$1);
|
|
4847
|
+
}
|
|
4848
|
+
return _createOTelTraceState(traceState);
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
function createOTelSpanContext(traceContext) {
|
|
4852
|
+
var traceId = isValidTraceId(traceContext[_DYN_TRACE_ID ]) ? traceContext[_DYN_TRACE_ID ] : INVALID_TRACE_ID;
|
|
4853
|
+
var spanId = isValidSpanId(traceContext[_DYN_SPAN_ID ]) ? traceContext[_DYN_SPAN_ID ] : INVALID_SPAN_ID;
|
|
4854
|
+
var isRemote = traceContext.isRemote;
|
|
4855
|
+
var traceFlags = (!isNullOrUndefined(traceContext[_DYN_TRACE_FLAGS ]) ? traceContext[_DYN_TRACE_FLAGS ] : 1 );
|
|
4856
|
+
var otTraceState = null;
|
|
4857
|
+
var traceContextObj = {
|
|
4858
|
+
traceId: traceId,
|
|
4859
|
+
spanId: spanId,
|
|
4860
|
+
traceFlags: traceFlags
|
|
4861
|
+
};
|
|
4862
|
+
return objDefineProps(traceContextObj, {
|
|
4863
|
+
traceId: {
|
|
4864
|
+
g: function () { return traceId; },
|
|
4865
|
+
s: function (value) { return traceId = isValidTraceId(value) ? value : INVALID_TRACE_ID; }
|
|
4866
|
+
},
|
|
4867
|
+
spanId: {
|
|
4868
|
+
g: function () { return spanId; },
|
|
4869
|
+
s: function (value) { return spanId = isValidSpanId(value) ? value : INVALID_SPAN_ID; }
|
|
4870
|
+
},
|
|
4871
|
+
isRemote: {
|
|
4872
|
+
g: function () { return isRemote; }
|
|
4873
|
+
},
|
|
4874
|
+
traceFlags: {
|
|
4875
|
+
g: function () { return traceFlags; },
|
|
4876
|
+
s: function (value) { return traceFlags = value; }
|
|
4877
|
+
},
|
|
4878
|
+
traceState: {
|
|
4879
|
+
g: function () {
|
|
4880
|
+
if (!otTraceState) {
|
|
4881
|
+
otTraceState = createOTelTraceState(traceContext[_DYN_TRACE_STATE ]);
|
|
4882
|
+
}
|
|
4883
|
+
return otTraceState;
|
|
4884
|
+
},
|
|
4885
|
+
s: function (value) {
|
|
4886
|
+
otTraceState = value;
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
});
|
|
4277
4890
|
}
|
|
4278
4891
|
|
|
4279
4892
|
var pluginStateData = createElmNodeData("plugin");
|
|
@@ -4332,42 +4945,181 @@ function sortPlugins(plugins) {
|
|
|
4332
4945
|
return result;
|
|
4333
4946
|
});
|
|
4334
4947
|
}
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
return
|
|
4338
|
-
getName
|
|
4339
|
-
|
|
4948
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4949
|
+
function isDistributedTraceContext(obj) {
|
|
4950
|
+
return obj &&
|
|
4951
|
+
isFunction(obj.getName) &&
|
|
4952
|
+
isFunction(obj.getTraceId) &&
|
|
4953
|
+
isFunction(obj.getSpanId) &&
|
|
4954
|
+
isFunction(obj.getTraceFlags) &&
|
|
4955
|
+
isFunction(obj.setName) &&
|
|
4956
|
+
isFunction(obj.setTraceId) &&
|
|
4957
|
+
isFunction(obj.setSpanId) &&
|
|
4958
|
+
isFunction(obj[_DYN_SET_TRACE_FLAGS ]);
|
|
4959
|
+
}
|
|
4960
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4961
|
+
function createDistributedTraceContext(parent) {
|
|
4962
|
+
var _a;
|
|
4963
|
+
var parentCtx = null;
|
|
4964
|
+
var initCtx = null;
|
|
4965
|
+
var traceId = (parent && isValidTraceId(parent[_DYN_TRACE_ID ])) ? parent[_DYN_TRACE_ID ] : generateW3CId();
|
|
4966
|
+
var spanId = (parent && isValidSpanId(parent[_DYN_SPAN_ID ])) ? parent[_DYN_SPAN_ID ] : STR_EMPTY$1;
|
|
4967
|
+
var traceFlags = parent ? parent[_DYN_TRACE_FLAGS ] : UNDEFINED_VALUE;
|
|
4968
|
+
var isRemote = parent ? parent.isRemote : false;
|
|
4969
|
+
var pageName = STR_EMPTY$1;
|
|
4970
|
+
var traceState = null;
|
|
4971
|
+
if (parent) {
|
|
4972
|
+
if (isDistributedTraceContext(parent)) {
|
|
4973
|
+
parentCtx = parent;
|
|
4974
|
+
pageName = parentCtx.getName();
|
|
4975
|
+
}
|
|
4976
|
+
else {
|
|
4977
|
+
initCtx = parent;
|
|
4978
|
+
}
|
|
4979
|
+
}
|
|
4980
|
+
if (!pageName) {
|
|
4981
|
+
pageName = "_unknown_";
|
|
4982
|
+
var location_1 = getLocation();
|
|
4983
|
+
if (location_1 && location_1[_DYN_PATHNAME ]) {
|
|
4984
|
+
pageName = location_1[_DYN_PATHNAME ] + (location_1.hash || "");
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
function _getName() {
|
|
4988
|
+
return pageName;
|
|
4989
|
+
}
|
|
4990
|
+
function _setPageNameFn(updateParent) {
|
|
4991
|
+
return function (newValue) {
|
|
4992
|
+
if (updateParent) {
|
|
4993
|
+
parentCtx && parentCtx.setName(newValue);
|
|
4994
|
+
}
|
|
4995
|
+
pageName = newValue;
|
|
4996
|
+
};
|
|
4997
|
+
}
|
|
4998
|
+
function _getTraceId() {
|
|
4999
|
+
return traceId;
|
|
5000
|
+
}
|
|
5001
|
+
function _setTraceIdFn(updateParent) {
|
|
5002
|
+
return function (newValue) {
|
|
5003
|
+
if (updateParent) {
|
|
5004
|
+
parentCtx && parentCtx.setTraceId(newValue);
|
|
5005
|
+
}
|
|
5006
|
+
if (isValidTraceId(newValue)) {
|
|
5007
|
+
traceId = newValue;
|
|
5008
|
+
}
|
|
5009
|
+
};
|
|
5010
|
+
}
|
|
5011
|
+
function _getSpanId() {
|
|
5012
|
+
return spanId;
|
|
5013
|
+
}
|
|
5014
|
+
function _setSpanIdFn(updateParent) {
|
|
5015
|
+
return function (newValue) {
|
|
5016
|
+
if (updateParent) {
|
|
5017
|
+
parentCtx && parentCtx.setSpanId(newValue);
|
|
5018
|
+
}
|
|
5019
|
+
if (isValidSpanId(newValue)) {
|
|
5020
|
+
spanId = newValue;
|
|
5021
|
+
}
|
|
5022
|
+
};
|
|
5023
|
+
}
|
|
5024
|
+
function _getTraceFlags() {
|
|
5025
|
+
return traceFlags;
|
|
5026
|
+
}
|
|
5027
|
+
function _setTraceFlagsFn(updateParent) {
|
|
5028
|
+
return function (newTraceFlags) {
|
|
5029
|
+
if (updateParent) {
|
|
5030
|
+
parentCtx && parentCtx[_DYN_SET_TRACE_FLAGS ](newTraceFlags);
|
|
5031
|
+
}
|
|
5032
|
+
traceFlags = newTraceFlags;
|
|
5033
|
+
};
|
|
5034
|
+
}
|
|
5035
|
+
function _getTraceState() {
|
|
5036
|
+
if (!traceState) {
|
|
5037
|
+
if (!parentCtx) {
|
|
5038
|
+
if (initCtx) {
|
|
5039
|
+
if (isOTelTraceState(initCtx[_DYN_TRACE_STATE ])) {
|
|
5040
|
+
traceState = createW3cTraceState(initCtx[_DYN_TRACE_STATE ].serialize() || STR_EMPTY$1, parentCtx ? parentCtx[_DYN_TRACE_STATE ] : undefined);
|
|
5041
|
+
}
|
|
5042
|
+
else {
|
|
5043
|
+
traceState = createW3cTraceState(STR_EMPTY$1, initCtx[_DYN_TRACE_STATE ] || (parentCtx ? parentCtx[_DYN_TRACE_STATE ] : undefined));
|
|
5044
|
+
}
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
if (!traceState) {
|
|
5048
|
+
traceState = createW3cTraceState(STR_EMPTY$1, parentCtx ? parentCtx[_DYN_TRACE_STATE ] : undefined);
|
|
5049
|
+
}
|
|
5050
|
+
}
|
|
5051
|
+
return traceState;
|
|
5052
|
+
}
|
|
5053
|
+
var otelSpanCtx = null;
|
|
5054
|
+
var traceCtx = setProtoTypeName((_a = {
|
|
5055
|
+
getName: _getName,
|
|
5056
|
+
setName: _setPageNameFn(true),
|
|
5057
|
+
getTraceId: _getTraceId,
|
|
5058
|
+
setTraceId: _setTraceIdFn(true),
|
|
5059
|
+
getSpanId: _getSpanId,
|
|
5060
|
+
setSpanId: _setSpanIdFn(true),
|
|
5061
|
+
getTraceFlags: _getTraceFlags
|
|
4340
5062
|
},
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
5063
|
+
_a[_DYN_SET_TRACE_FLAGS ] = _setTraceFlagsFn(true),
|
|
5064
|
+
_a.traceId = traceId,
|
|
5065
|
+
_a.spanId = spanId,
|
|
5066
|
+
_a.traceFlags = traceFlags,
|
|
5067
|
+
_a.traceState = traceState,
|
|
5068
|
+
_a.isRemote = isRemote,
|
|
5069
|
+
_a.pageName = pageName,
|
|
5070
|
+
_a.getOTelSpanContext = function () {
|
|
5071
|
+
if (!otelSpanCtx) {
|
|
5072
|
+
otelSpanCtx = createOTelSpanContext(traceCtx);
|
|
5073
|
+
}
|
|
5074
|
+
return otelSpanCtx;
|
|
4344
5075
|
},
|
|
4345
|
-
|
|
4346
|
-
|
|
5076
|
+
_a), "DistributedTraceContext");
|
|
5077
|
+
return objDefineProps(traceCtx, {
|
|
5078
|
+
pageName: {
|
|
5079
|
+
g: _getName,
|
|
5080
|
+
s: _setPageNameFn(false)
|
|
4347
5081
|
},
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
trace.traceId = newValue;
|
|
4352
|
-
}
|
|
5082
|
+
traceId: {
|
|
5083
|
+
g: _getTraceId,
|
|
5084
|
+
s: _setTraceIdFn(false)
|
|
4353
5085
|
},
|
|
4354
|
-
|
|
4355
|
-
|
|
5086
|
+
spanId: {
|
|
5087
|
+
g: _getSpanId,
|
|
5088
|
+
s: _setSpanIdFn(false)
|
|
4356
5089
|
},
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
5090
|
+
traceFlags: {
|
|
5091
|
+
g: _getTraceFlags,
|
|
5092
|
+
s: _setTraceFlagsFn(false)
|
|
5093
|
+
},
|
|
5094
|
+
isRemote: {
|
|
5095
|
+
v: isRemote,
|
|
5096
|
+
w: false
|
|
5097
|
+
},
|
|
5098
|
+
traceState: {
|
|
5099
|
+
g: _getTraceState
|
|
4362
5100
|
},
|
|
4363
|
-
|
|
4364
|
-
return
|
|
5101
|
+
parentCtx: {
|
|
5102
|
+
g: function () { return parentCtx; }
|
|
4365
5103
|
},
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
5104
|
+
_parent: {
|
|
5105
|
+
g: function () {
|
|
5106
|
+
var result;
|
|
5107
|
+
if (parentCtx) {
|
|
5108
|
+
result = {
|
|
5109
|
+
t: "traceCtx",
|
|
5110
|
+
v: parentCtx
|
|
5111
|
+
};
|
|
5112
|
+
}
|
|
5113
|
+
else if (initCtx) {
|
|
5114
|
+
result = {
|
|
5115
|
+
t: "initCtx",
|
|
5116
|
+
v: initCtx
|
|
5117
|
+
};
|
|
5118
|
+
}
|
|
5119
|
+
return result;
|
|
5120
|
+
}
|
|
4369
5121
|
}
|
|
4370
|
-
};
|
|
5122
|
+
});
|
|
4371
5123
|
}
|
|
4372
5124
|
|
|
4373
5125
|
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
@@ -4381,7 +5133,7 @@ function _getNextProxyStart(proxy, core, startAt) {
|
|
|
4381
5133
|
}
|
|
4382
5134
|
proxy = proxy[_DYN_GET_NEXT ]();
|
|
4383
5135
|
}
|
|
4384
|
-
return createTelemetryProxyChain([startAt], core
|
|
5136
|
+
return createTelemetryProxyChain([startAt], core[_DYN_CONFIG ] || {}, core);
|
|
4385
5137
|
}
|
|
4386
5138
|
function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
4387
5139
|
var _nextProxy = null;
|
|
@@ -4453,27 +5205,26 @@ function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
|
4453
5205
|
}
|
|
4454
5206
|
function _getExtCfg(identifier, createIfMissing) {
|
|
4455
5207
|
var idCfg = null;
|
|
4456
|
-
var
|
|
5208
|
+
var extCfg = _getCfg(dynamicHandler.cfg, "extensionConfig", createIfMissing);
|
|
5209
|
+
if (extCfg) {
|
|
5210
|
+
idCfg = _getCfg(extCfg, identifier, createIfMissing);
|
|
5211
|
+
}
|
|
5212
|
+
return idCfg;
|
|
5213
|
+
}
|
|
5214
|
+
function _getCfg(cfg, identifier, createIfMissing) {
|
|
5215
|
+
var idCfg = null;
|
|
4457
5216
|
if (cfg && identifier) {
|
|
4458
|
-
|
|
4459
|
-
if (!
|
|
4460
|
-
|
|
4461
|
-
}
|
|
4462
|
-
cfg[STR_EXTENSION_CONFIG] = extCfg;
|
|
4463
|
-
extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG);
|
|
4464
|
-
if (extCfg) {
|
|
4465
|
-
idCfg = extCfg[identifier];
|
|
4466
|
-
if (!idCfg && createIfMissing) {
|
|
4467
|
-
idCfg = {};
|
|
4468
|
-
}
|
|
4469
|
-
extCfg[identifier] = idCfg;
|
|
4470
|
-
idCfg = dynamicHandler.ref(extCfg, identifier);
|
|
5217
|
+
idCfg = cfg[identifier];
|
|
5218
|
+
if (!idCfg && createIfMissing) {
|
|
5219
|
+
idCfg = {};
|
|
4471
5220
|
}
|
|
5221
|
+
cfg[identifier] = idCfg;
|
|
5222
|
+
idCfg = dynamicHandler.ref(cfg, identifier);
|
|
4472
5223
|
}
|
|
4473
5224
|
return idCfg;
|
|
4474
5225
|
}
|
|
4475
|
-
function _resolveExtCfg(identifier, defaultValues) {
|
|
4476
|
-
var newConfig = _getExtCfg(identifier, true);
|
|
5226
|
+
function _resolveExtCfg(identifier, defaultValues, rootOnly) {
|
|
5227
|
+
var newConfig = rootOnly ? _getCfg(dynamicHandler.cfg, identifier, true) : _getExtCfg(identifier, true);
|
|
4477
5228
|
if (defaultValues) {
|
|
4478
5229
|
objForEachKey(defaultValues, function (field, defaultValue) {
|
|
4479
5230
|
if (isNullOrUndefined(newConfig[field])) {
|
|
@@ -4534,7 +5285,7 @@ function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {
|
|
|
4534
5285
|
return context;
|
|
4535
5286
|
}
|
|
4536
5287
|
function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
4537
|
-
var config = createDynamicConfig(core
|
|
5288
|
+
var config = createDynamicConfig(core[_DYN_CONFIG ]);
|
|
4538
5289
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
4539
5290
|
var context = internalContext.ctx;
|
|
4540
5291
|
function _processNext(unloadState) {
|
|
@@ -4554,7 +5305,7 @@ function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
|
4554
5305
|
return context;
|
|
4555
5306
|
}
|
|
4556
5307
|
function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
4557
|
-
var config = createDynamicConfig(core
|
|
5308
|
+
var config = createDynamicConfig(core[_DYN_CONFIG ]);
|
|
4558
5309
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
4559
5310
|
var context = internalContext.ctx;
|
|
4560
5311
|
function _processNext(updateState) {
|
|
@@ -4602,6 +5353,7 @@ function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
|
4602
5353
|
return firstProxy;
|
|
4603
5354
|
}
|
|
4604
5355
|
function createTelemetryPluginProxy(plugin, config, core) {
|
|
5356
|
+
var _a;
|
|
4605
5357
|
var nextProxy = null;
|
|
4606
5358
|
var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
|
|
4607
5359
|
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
@@ -4612,21 +5364,22 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
4612
5364
|
else {
|
|
4613
5365
|
chainId = "Unknown-0-" + _chainId++;
|
|
4614
5366
|
}
|
|
4615
|
-
var proxyChain = {
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
5367
|
+
var proxyChain = (_a = {
|
|
5368
|
+
getPlugin: function () {
|
|
5369
|
+
return plugin;
|
|
5370
|
+
},
|
|
5371
|
+
getNext: function () {
|
|
5372
|
+
return nextProxy;
|
|
5373
|
+
}
|
|
4621
5374
|
},
|
|
4622
|
-
|
|
4623
|
-
unload
|
|
4624
|
-
update
|
|
4625
|
-
_id
|
|
4626
|
-
_setNext
|
|
5375
|
+
_a[STR_PROCESS_TELEMETRY ] = _processTelemetry,
|
|
5376
|
+
_a.unload = _unloadPlugin,
|
|
5377
|
+
_a.update = _updatePlugin,
|
|
5378
|
+
_a._id = chainId,
|
|
5379
|
+
_a._setNext = function (nextPlugin) {
|
|
4627
5380
|
nextProxy = nextPlugin;
|
|
4628
|
-
}
|
|
4629
|
-
|
|
5381
|
+
},
|
|
5382
|
+
_a);
|
|
4630
5383
|
function _getTelCtx() {
|
|
4631
5384
|
var itemCtx;
|
|
4632
5385
|
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
@@ -4649,7 +5402,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
4649
5402
|
doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () {
|
|
4650
5403
|
hasRunContext[chainId] = true;
|
|
4651
5404
|
try {
|
|
4652
|
-
var nextId = nextProxy ? nextProxy._id : STR_EMPTY$
|
|
5405
|
+
var nextId = nextProxy ? nextProxy._id : STR_EMPTY$1;
|
|
4653
5406
|
if (nextId) {
|
|
4654
5407
|
hasRunContext[nextId] = false;
|
|
4655
5408
|
}
|
|
@@ -4705,7 +5458,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
4705
5458
|
}
|
|
4706
5459
|
return hasRun;
|
|
4707
5460
|
}
|
|
4708
|
-
if (!_processChain(unloadCtx, _callTeardown, "unload",
|
|
5461
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", _noopVoid, unloadState.isAsync)) {
|
|
4709
5462
|
unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
4710
5463
|
}
|
|
4711
5464
|
}
|
|
@@ -4723,21 +5476,14 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
4723
5476
|
}
|
|
4724
5477
|
return hasRun;
|
|
4725
5478
|
}
|
|
4726
|
-
if (!_processChain(updateCtx, _callUpdate, "update",
|
|
5479
|
+
if (!_processChain(updateCtx, _callUpdate, "update", _noopVoid, false)) {
|
|
4727
5480
|
updateCtx[_DYN_PROCESS_NEXT ](updateState);
|
|
4728
5481
|
}
|
|
4729
5482
|
}
|
|
4730
5483
|
return objFreeze(proxyChain);
|
|
4731
5484
|
}
|
|
4732
|
-
var ProcessTelemetryContext = /** @class */ (function () {
|
|
4733
|
-
function ProcessTelemetryContext(pluginChain, config, core, startAt) {
|
|
4734
|
-
var _self = this;
|
|
4735
|
-
var context = createProcessTelemetryContext(pluginChain, config, core, startAt);
|
|
4736
|
-
proxyFunctions(_self, context, objKeys(context));
|
|
4737
|
-
}
|
|
4738
|
-
return ProcessTelemetryContext;
|
|
4739
|
-
}());
|
|
4740
5485
|
|
|
5486
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
4741
5487
|
function createUnloadHandlerContainer() {
|
|
4742
5488
|
var handlers = [];
|
|
4743
5489
|
function _addHandler(handler) {
|
|
@@ -5007,13 +5753,14 @@ var TelemetryInitializerPlugin = /** @class */ (function (_super) {
|
|
|
5007
5753
|
return TelemetryInitializerPlugin;
|
|
5008
5754
|
}(BaseTelemetryPlugin));
|
|
5009
5755
|
|
|
5010
|
-
var _a$1;
|
|
5756
|
+
var _a$1, _b, _c;
|
|
5011
5757
|
var strValidationError = "Plugins must provide initialize method";
|
|
5012
5758
|
var strNotificationManager = "_notificationManager";
|
|
5013
5759
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
5014
5760
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
5015
5761
|
var maxInitQueueSize = 100;
|
|
5016
5762
|
var maxInitTimeout = 50000;
|
|
5763
|
+
var maxAttributeCount = 128;
|
|
5017
5764
|
var defaultConfig$1 = objDeepFreeze((_a$1 = {
|
|
5018
5765
|
cookieCfg: {}
|
|
5019
5766
|
},
|
|
@@ -5023,10 +5770,55 @@ var defaultConfig$1 = objDeepFreeze((_a$1 = {
|
|
|
5023
5770
|
_a$1[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE,
|
|
5024
5771
|
_a$1.loggingLevelConsole = 0 ,
|
|
5025
5772
|
_a$1.diagnosticLogInterval = UNDEFINED_VALUE,
|
|
5773
|
+
_a$1.traceHdrMode = 3 ,
|
|
5774
|
+
_a$1.traceCfg = cfgDfMerge((_b = {
|
|
5775
|
+
generalLimits: cfgDfMerge((_c = {
|
|
5776
|
+
attributeValueLengthLimit: undefined
|
|
5777
|
+
},
|
|
5778
|
+
_c[_DYN_ATTRIBUTE_COUNT_LIMI5 ] = maxAttributeCount,
|
|
5779
|
+
_c)),
|
|
5780
|
+
serviceName: null
|
|
5781
|
+
},
|
|
5782
|
+
_b[_DYN_SUPPRESS_TRACING ] = false,
|
|
5783
|
+
_b)),
|
|
5026
5784
|
_a$1));
|
|
5785
|
+
function _getDefaultConfig(core) {
|
|
5786
|
+
var _a;
|
|
5787
|
+
var handlers = {
|
|
5788
|
+
errorHandlers: cfgDfMerge((_a = {
|
|
5789
|
+
attribError: function (message, key, value) {
|
|
5790
|
+
core.logger[_DYN_THROW_INTERNAL ](2 , 115 , message, {
|
|
5791
|
+
attribName: key,
|
|
5792
|
+
value: value
|
|
5793
|
+
});
|
|
5794
|
+
},
|
|
5795
|
+
spanError: function (message, spanName) {
|
|
5796
|
+
core.logger[_DYN_THROW_INTERNAL ](2 , 116 , message, {
|
|
5797
|
+
spanName: spanName
|
|
5798
|
+
});
|
|
5799
|
+
},
|
|
5800
|
+
debug: function (message) {
|
|
5801
|
+
core[_DYN_LOGGER ].debugToConsole(message);
|
|
5802
|
+
},
|
|
5803
|
+
warn: function (message) {
|
|
5804
|
+
core.logger[_DYN_WARN_TO_CONSOLE ](message);
|
|
5805
|
+
},
|
|
5806
|
+
error: function (message) {
|
|
5807
|
+
core.logger[_DYN_THROW_INTERNAL ](1 , 117 , message);
|
|
5808
|
+
}
|
|
5809
|
+
},
|
|
5810
|
+
_a[_DYN_NOT_IMPLEMENTED ] = function (message) {
|
|
5811
|
+
core.logger[_DYN_THROW_INTERNAL ](1 , 118 , message);
|
|
5812
|
+
},
|
|
5813
|
+
_a))
|
|
5814
|
+
};
|
|
5815
|
+
return objDeepFreeze(objAssign({}, defaultConfig$1, handlers));
|
|
5816
|
+
}
|
|
5817
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5027
5818
|
function _createPerfManager(core, notificationMgr) {
|
|
5028
5819
|
return new PerfManager(notificationMgr);
|
|
5029
5820
|
}
|
|
5821
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5030
5822
|
function _validateExtensions(logger, channelPriority, allExtensions) {
|
|
5031
5823
|
var coreExtensions = [];
|
|
5032
5824
|
var channels = [];
|
|
@@ -5057,6 +5849,7 @@ function _validateExtensions(logger, channelPriority, allExtensions) {
|
|
|
5057
5849
|
channels: channels
|
|
5058
5850
|
};
|
|
5059
5851
|
}
|
|
5852
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5060
5853
|
function _isPluginPresent(thePlugin, plugins) {
|
|
5061
5854
|
var exists = false;
|
|
5062
5855
|
arrForEach(plugins, function (plugin) {
|
|
@@ -5084,6 +5877,7 @@ function _deepMergeConfig(details, target, newValues, merge) {
|
|
|
5084
5877
|
});
|
|
5085
5878
|
}
|
|
5086
5879
|
}
|
|
5880
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5087
5881
|
function _findWatcher(listeners, newWatcher) {
|
|
5088
5882
|
var theListener = null;
|
|
5089
5883
|
var idx = -1;
|
|
@@ -5135,12 +5929,29 @@ function _initDebugListener(configHandler, unloadContainer, notificationManager,
|
|
|
5135
5929
|
}));
|
|
5136
5930
|
return debugListener;
|
|
5137
5931
|
}
|
|
5138
|
-
|
|
5932
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5933
|
+
function _createUnloadHook$1(unloadHook) {
|
|
5139
5934
|
return objDefine({
|
|
5140
5935
|
rm: function () {
|
|
5141
5936
|
unloadHook.rm();
|
|
5142
5937
|
}
|
|
5143
|
-
}, "toJSON", { v: function () { return "aicore::onCfgChange<" + JSON
|
|
5938
|
+
}, "toJSON", { v: function () { return "aicore::onCfgChange<" + JSON[_DYN_STRINGIFY ](unloadHook) + ">"; } });
|
|
5939
|
+
}
|
|
5940
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
5941
|
+
function _getParentTraceCtx(mode) {
|
|
5942
|
+
var spanContext = null;
|
|
5943
|
+
var parentTrace = (mode & 1 ) ? findW3cTraceParent() : null;
|
|
5944
|
+
var parentTraceState = (mode & 2 ) ? findW3cTraceState() : null;
|
|
5945
|
+
if (parentTrace || parentTraceState) {
|
|
5946
|
+
spanContext = createDistributedTraceContext({
|
|
5947
|
+
traceId: parentTrace ? parentTrace[_DYN_TRACE_ID ] : null,
|
|
5948
|
+
spanId: parentTrace ? parentTrace[_DYN_SPAN_ID ] : null,
|
|
5949
|
+
traceFlags: parentTrace ? parentTrace[_DYN_TRACE_FLAGS ] : UNDEFINED_VALUE,
|
|
5950
|
+
isRemote: true,
|
|
5951
|
+
traceState: parentTraceState
|
|
5952
|
+
});
|
|
5953
|
+
}
|
|
5954
|
+
return spanContext;
|
|
5144
5955
|
}
|
|
5145
5956
|
var AppInsightsCore$1 = /** @class */ (function () {
|
|
5146
5957
|
function AppInsightsCore() {
|
|
@@ -5158,12 +5969,16 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5158
5969
|
var _channels;
|
|
5159
5970
|
var _isUnloading;
|
|
5160
5971
|
var _telemetryInitializerPlugin;
|
|
5972
|
+
var _serverOTelCtx;
|
|
5973
|
+
var _serverTraceHdrMode;
|
|
5161
5974
|
var _internalLogsEventName;
|
|
5162
5975
|
var _evtNamespace;
|
|
5163
5976
|
var _unloadHandlers;
|
|
5164
5977
|
var _hookContainer;
|
|
5165
5978
|
var _debugListener;
|
|
5166
5979
|
var _traceCtx;
|
|
5980
|
+
var _traceProvider;
|
|
5981
|
+
var _activeSpan;
|
|
5167
5982
|
var _instrumentationKey;
|
|
5168
5983
|
var _cfgListeners;
|
|
5169
5984
|
var _extensions;
|
|
@@ -5194,7 +6009,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5194
6009
|
if (_self[_DYN_IS_INITIALIZED ]()) {
|
|
5195
6010
|
throwError("Core cannot be initialized more than once");
|
|
5196
6011
|
}
|
|
5197
|
-
_configHandler = createDynamicConfig(config,
|
|
6012
|
+
_configHandler = createDynamicConfig(config, _getDefaultConfig(_self), logger || _self[_DYN_LOGGER ], false);
|
|
5198
6013
|
config = _configHandler.cfg;
|
|
5199
6014
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5200
6015
|
var rootCfg = details.cfg;
|
|
@@ -5204,6 +6019,10 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5204
6019
|
objForEachKey(extCfg, function (key) {
|
|
5205
6020
|
details.ref(extCfg, key);
|
|
5206
6021
|
});
|
|
6022
|
+
if (rootCfg[_DYN_TRACE_HDR_MODE ] !== _serverTraceHdrMode) {
|
|
6023
|
+
_serverOTelCtx = _getParentTraceCtx(rootCfg[_DYN_TRACE_HDR_MODE ]);
|
|
6024
|
+
_serverTraceHdrMode = rootCfg[_DYN_TRACE_HDR_MODE ];
|
|
6025
|
+
}
|
|
5207
6026
|
}));
|
|
5208
6027
|
_notificationManager = notificationManager;
|
|
5209
6028
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -5250,7 +6069,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5250
6069
|
throwError("telemetry name required");
|
|
5251
6070
|
}
|
|
5252
6071
|
telemetryItem.iKey = telemetryItem.iKey || _instrumentationKey;
|
|
5253
|
-
telemetryItem
|
|
6072
|
+
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
5254
6073
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
5255
6074
|
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
5256
6075
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
@@ -5524,7 +6343,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5524
6343
|
}
|
|
5525
6344
|
else {
|
|
5526
6345
|
updateState.removed = removedPlugins_1;
|
|
5527
|
-
updateState
|
|
6346
|
+
updateState[_DYN_REASON ] |= 32 ;
|
|
5528
6347
|
_addPlugin();
|
|
5529
6348
|
}
|
|
5530
6349
|
});
|
|
@@ -5569,16 +6388,100 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5569
6388
|
_self.evtNamespace = function () {
|
|
5570
6389
|
return _evtNamespace;
|
|
5571
6390
|
};
|
|
5572
|
-
_self
|
|
5573
|
-
_self
|
|
5574
|
-
if (!_traceCtx) {
|
|
5575
|
-
_traceCtx = createDistributedTraceContext();
|
|
6391
|
+
_self[_DYN_FLUSH ] = _flushChannels;
|
|
6392
|
+
_self[_DYN_GET_TRACE_CTX ] = function (createNew) {
|
|
6393
|
+
if ((!_traceCtx && createNew !== false) || createNew === true) {
|
|
6394
|
+
_traceCtx = createDistributedTraceContext(_serverOTelCtx);
|
|
5576
6395
|
}
|
|
5577
6396
|
return _traceCtx;
|
|
5578
6397
|
};
|
|
5579
|
-
_self
|
|
6398
|
+
_self[_DYN_SET_TRACE_CTX ] = function (traceCtx) {
|
|
5580
6399
|
_traceCtx = traceCtx || null;
|
|
5581
6400
|
};
|
|
6401
|
+
_self.startSpan = function (name, options, parent) {
|
|
6402
|
+
if (!_traceProvider || !_traceProvider.v || !_traceProvider.v.isAvailable()) {
|
|
6403
|
+
return null;
|
|
6404
|
+
}
|
|
6405
|
+
return _traceProvider.v.createSpan(name, options, parent || _self[_DYN_GET_TRACE_CTX ]());
|
|
6406
|
+
};
|
|
6407
|
+
_self[_DYN_GET_ACTIVE_SPAN ] = function (createNew) {
|
|
6408
|
+
if (createNew !== false && _traceProvider && !_activeSpan && _traceProvider.v) {
|
|
6409
|
+
_activeSpan = _traceProvider.v.createSpan(_traceProvider.v.getProviderId(), {
|
|
6410
|
+
recording: false,
|
|
6411
|
+
root: true
|
|
6412
|
+
});
|
|
6413
|
+
}
|
|
6414
|
+
return _activeSpan;
|
|
6415
|
+
};
|
|
6416
|
+
_self[_DYN_SET_ACTIVE_SPAN ] = function (span) {
|
|
6417
|
+
var theSpanContext = null;
|
|
6418
|
+
var currentCtx = _self[_DYN_GET_TRACE_CTX ]();
|
|
6419
|
+
var currentSpan = _activeSpan;
|
|
6420
|
+
var scope;
|
|
6421
|
+
if (span) {
|
|
6422
|
+
var otelSpanContext = null;
|
|
6423
|
+
if (span[_DYN_SPAN_CONTEXT ]) {
|
|
6424
|
+
otelSpanContext = span[_DYN_SPAN_CONTEXT ]();
|
|
6425
|
+
}
|
|
6426
|
+
else if (span.context) {
|
|
6427
|
+
otelSpanContext = span.context();
|
|
6428
|
+
}
|
|
6429
|
+
if (otelSpanContext) {
|
|
6430
|
+
if (isDistributedTraceContext(otelSpanContext)) {
|
|
6431
|
+
theSpanContext = otelSpanContext;
|
|
6432
|
+
}
|
|
6433
|
+
else {
|
|
6434
|
+
theSpanContext = createDistributedTraceContext(currentCtx);
|
|
6435
|
+
var parentContext = span[_DYN_PARENT_SPAN_CONTEXT ];
|
|
6436
|
+
if (!parentContext) {
|
|
6437
|
+
if (span.parentSpanId) {
|
|
6438
|
+
parentContext = {
|
|
6439
|
+
traceId: otelSpanContext[_DYN_TRACE_ID ],
|
|
6440
|
+
spanId: span.parentSpanId
|
|
6441
|
+
};
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
if (parentContext && parentContext[_DYN_TRACE_ID ] !== theSpanContext[_DYN_TRACE_ID ] &&
|
|
6445
|
+
parentContext[_DYN_SPAN_ID ] !== theSpanContext[_DYN_SPAN_ID ] &&
|
|
6446
|
+
parentContext[_DYN_TRACE_FLAGS ] !== theSpanContext[_DYN_TRACE_FLAGS ]) {
|
|
6447
|
+
theSpanContext[_DYN_TRACE_ID ] = parentContext[_DYN_TRACE_ID ];
|
|
6448
|
+
theSpanContext[_DYN_SPAN_ID ] = parentContext[_DYN_SPAN_ID ];
|
|
6449
|
+
theSpanContext[_DYN_TRACE_FLAGS ] = parentContext[_DYN_TRACE_FLAGS ];
|
|
6450
|
+
theSpanContext = createDistributedTraceContext(theSpanContext);
|
|
6451
|
+
}
|
|
6452
|
+
theSpanContext[_DYN_TRACE_ID ] = otelSpanContext[_DYN_TRACE_ID ];
|
|
6453
|
+
theSpanContext[_DYN_SPAN_ID ] = otelSpanContext[_DYN_SPAN_ID ];
|
|
6454
|
+
theSpanContext[_DYN_TRACE_FLAGS ] = otelSpanContext[_DYN_TRACE_FLAGS ];
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6457
|
+
}
|
|
6458
|
+
scope = {
|
|
6459
|
+
host: _self,
|
|
6460
|
+
span: span,
|
|
6461
|
+
prvSpan: currentSpan,
|
|
6462
|
+
restore: function () {
|
|
6463
|
+
if (currentSpan) {
|
|
6464
|
+
_self[_DYN_SET_ACTIVE_SPAN ](currentSpan);
|
|
6465
|
+
}
|
|
6466
|
+
else {
|
|
6467
|
+
_activeSpan = null;
|
|
6468
|
+
_self[_DYN_SET_TRACE_CTX ](currentCtx);
|
|
6469
|
+
}
|
|
6470
|
+
scope.restore = _noopVoid;
|
|
6471
|
+
}
|
|
6472
|
+
};
|
|
6473
|
+
_activeSpan = span;
|
|
6474
|
+
if (theSpanContext) {
|
|
6475
|
+
_self[_DYN_SET_TRACE_CTX ](theSpanContext);
|
|
6476
|
+
}
|
|
6477
|
+
return scope;
|
|
6478
|
+
};
|
|
6479
|
+
_self.setTraceProvider = function (traceProvider) {
|
|
6480
|
+
_traceProvider = traceProvider;
|
|
6481
|
+
};
|
|
6482
|
+
_self.getTraceProvider = function () {
|
|
6483
|
+
return _traceProvider ? _traceProvider.v : null;
|
|
6484
|
+
};
|
|
5582
6485
|
_self.addUnloadHook = _addUnloadHook;
|
|
5583
6486
|
proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add");
|
|
5584
6487
|
_self.onCfgChange = function (handler) {
|
|
@@ -5589,7 +6492,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5589
6492
|
else {
|
|
5590
6493
|
unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER ]);
|
|
5591
6494
|
}
|
|
5592
|
-
return _createUnloadHook(unloadHook);
|
|
6495
|
+
return _createUnloadHook$1(unloadHook);
|
|
5593
6496
|
};
|
|
5594
6497
|
_self.getWParam = function () {
|
|
5595
6498
|
return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;
|
|
@@ -5640,9 +6543,9 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5640
6543
|
if (!_pluginVersionStringArr) {
|
|
5641
6544
|
_setPluginVersions();
|
|
5642
6545
|
}
|
|
5643
|
-
_pluginVersionString = _pluginVersionStringArr
|
|
6546
|
+
_pluginVersionString = _pluginVersionStringArr[_DYN_JOIN ](";");
|
|
5644
6547
|
}
|
|
5645
|
-
return _pluginVersionString || STR_EMPTY$
|
|
6548
|
+
return _pluginVersionString || STR_EMPTY$1;
|
|
5646
6549
|
}
|
|
5647
6550
|
});
|
|
5648
6551
|
objDefine(_self, "logger", {
|
|
@@ -5663,10 +6566,12 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5663
6566
|
});
|
|
5664
6567
|
_self[_DYN_LOGGER ] = new DiagnosticLogger(_configHandler.cfg);
|
|
5665
6568
|
_extensions = [];
|
|
5666
|
-
var cfgExtensions = _self
|
|
6569
|
+
var cfgExtensions = _self[_DYN_CONFIG ][STR_EXTENSIONS ] || [];
|
|
5667
6570
|
cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$1 ]);
|
|
5668
6571
|
arrAppend(cfgExtensions, _extensions);
|
|
5669
6572
|
_telemetryInitializerPlugin = new TelemetryInitializerPlugin();
|
|
6573
|
+
_serverOTelCtx = null;
|
|
6574
|
+
_serverTraceHdrMode = 0 ;
|
|
5670
6575
|
_eventQueue = [];
|
|
5671
6576
|
runTargetUnload(_notificationManager, false);
|
|
5672
6577
|
_notificationManager = null;
|
|
@@ -5683,6 +6588,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5683
6588
|
_evtNamespace = createUniqueNamespace("AIBaseCore", true);
|
|
5684
6589
|
_unloadHandlers = createUnloadHandlerContainer();
|
|
5685
6590
|
_traceCtx = null;
|
|
6591
|
+
_traceProvider = null;
|
|
5686
6592
|
_instrumentationKey = null;
|
|
5687
6593
|
_hookContainer = createUnloadHookContainer();
|
|
5688
6594
|
_cfgListeners = [];
|
|
@@ -5711,7 +6617,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5711
6617
|
_channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS ]));
|
|
5712
6618
|
var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE ]), _channels);
|
|
5713
6619
|
_extensions = objFreeze(allExtensions);
|
|
5714
|
-
var cfgExtensions = _self
|
|
6620
|
+
var cfgExtensions = _self[_DYN_CONFIG ][STR_EXTENSIONS ] || [];
|
|
5715
6621
|
cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$1 ]);
|
|
5716
6622
|
arrAppend(cfgExtensions, _extensions);
|
|
5717
6623
|
var rootCtx = _createTelCtx();
|
|
@@ -5861,10 +6767,10 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5861
6767
|
if (_channels && _channels[_DYN_LENGTH$1 ] > 0) {
|
|
5862
6768
|
var flushCtx = _createTelCtx()[_DYN_CREATE_NEW ](_channels);
|
|
5863
6769
|
flushCtx.iterate(function (plugin) {
|
|
5864
|
-
if (plugin
|
|
6770
|
+
if (plugin[_DYN_FLUSH ]) {
|
|
5865
6771
|
waiting++;
|
|
5866
6772
|
var handled_1 = false;
|
|
5867
|
-
if (!plugin
|
|
6773
|
+
if (!plugin[_DYN_FLUSH ](isAsync, function () {
|
|
5868
6774
|
handled_1 = true;
|
|
5869
6775
|
doCallback();
|
|
5870
6776
|
}, sendReason)) {
|
|
@@ -5945,7 +6851,7 @@ var AppInsightsCore$1 = /** @class */ (function () {
|
|
|
5945
6851
|
|
|
5946
6852
|
function parseResponse(response, diagLog) {
|
|
5947
6853
|
try {
|
|
5948
|
-
if (response && response !==
|
|
6854
|
+
if (response && response !== STR_EMPTY$1) {
|
|
5949
6855
|
var result = getJSON().parse(response);
|
|
5950
6856
|
if (result && result[_DYN_ITEMS_RECEIVED ] && result[_DYN_ITEMS_RECEIVED ] >= result.itemsAccepted &&
|
|
5951
6857
|
result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$1 ]) {
|
|
@@ -5961,7 +6867,6 @@ function parseResponse(response, diagLog) {
|
|
|
5961
6867
|
return null;
|
|
5962
6868
|
}
|
|
5963
6869
|
|
|
5964
|
-
var STR_EMPTY$1 = "";
|
|
5965
6870
|
var STR_NO_RESPONSE_BODY = "NoResponseBody";
|
|
5966
6871
|
var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
|
|
5967
6872
|
var STR_POST_METHOD = "POST";
|
|
@@ -6367,8 +7272,8 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
6367
7272
|
}
|
|
6368
7273
|
}
|
|
6369
7274
|
else {
|
|
6370
|
-
_handleError(result
|
|
6371
|
-
rejectFunc && rejectFunc(result
|
|
7275
|
+
_handleError(result[_DYN_REASON ] && result[_DYN_REASON ][_DYN_MESSAGE ], 499);
|
|
7276
|
+
rejectFunc && rejectFunc(result[_DYN_REASON ]);
|
|
6372
7277
|
}
|
|
6373
7278
|
}
|
|
6374
7279
|
});
|
|
@@ -6415,8 +7320,8 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
6415
7320
|
xdr.ontimeout = function () {
|
|
6416
7321
|
_doOnComplete(oncomplete, 500, {});
|
|
6417
7322
|
};
|
|
6418
|
-
xdr.onprogress =
|
|
6419
|
-
var hostingProtocol = _window && _window.location && _window.location.protocol ||
|
|
7323
|
+
xdr.onprogress = _noopVoid;
|
|
7324
|
+
var hostingProtocol = _window && _window.location && _window.location.protocol || STR_EMPTY$1;
|
|
6420
7325
|
var endpoint = payload[_DYN_URL_STRING ];
|
|
6421
7326
|
if (!endpoint) {
|
|
6422
7327
|
_onNoPayloadUrl(oncomplete);
|
|
@@ -6428,7 +7333,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
6428
7333
|
_onError(msg, oncomplete);
|
|
6429
7334
|
return;
|
|
6430
7335
|
}
|
|
6431
|
-
var endpointUrl = _isOneDs ? endpoint : endpoint[_DYN_REPLACE ](/^(https?:)/,
|
|
7336
|
+
var endpointUrl = _isOneDs ? endpoint : endpoint[_DYN_REPLACE ](/^(https?:)/, STR_EMPTY$1);
|
|
6432
7337
|
xdr.open(STR_POST_METHOD, endpointUrl);
|
|
6433
7338
|
if (payload[_DYN_TIMEOUT ]) {
|
|
6434
7339
|
xdr[_DYN_TIMEOUT ] = payload[_DYN_TIMEOUT ];
|
|
@@ -6477,24 +7382,41 @@ var strPageHide = "pagehide";
|
|
|
6477
7382
|
var strPageShow = "pageshow";
|
|
6478
7383
|
var strUnload = "unload";
|
|
6479
7384
|
var strBeforeUnload = "beforeunload";
|
|
6480
|
-
var
|
|
6481
|
-
var
|
|
7385
|
+
var _strPageHideNamespace;
|
|
7386
|
+
var _strPageShowNamespace;
|
|
7387
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
7388
|
+
function _getPageHideNamespace() {
|
|
7389
|
+
!_strPageHideNamespace && (_strPageHideNamespace = createCachedValue(createUniqueNamespace("aiEvtPageHide")));
|
|
7390
|
+
return _strPageHideNamespace.v;
|
|
7391
|
+
}
|
|
7392
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
7393
|
+
function _getPageShowNamespace() {
|
|
7394
|
+
!_strPageShowNamespace && (_strPageShowNamespace = createCachedValue(createUniqueNamespace("aiEvtPageShow")));
|
|
7395
|
+
return _strPageShowNamespace.v;
|
|
7396
|
+
}
|
|
6482
7397
|
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
6483
7398
|
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
6484
7399
|
var _guid = 1;
|
|
6485
|
-
var
|
|
7400
|
+
var _elmNodeData;
|
|
7401
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
7402
|
+
function _getElmNodeData() {
|
|
7403
|
+
!_elmNodeData && (_elmNodeData = createCachedValue(createElmNodeData("events")));
|
|
7404
|
+
return _elmNodeData.v;
|
|
7405
|
+
}
|
|
6486
7406
|
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
7407
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
6487
7408
|
function _normalizeNamespace(name) {
|
|
6488
7409
|
if (name && name[_DYN_REPLACE ]) {
|
|
6489
|
-
return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY$
|
|
7410
|
+
return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY$1);
|
|
6490
7411
|
}
|
|
6491
7412
|
return name;
|
|
6492
7413
|
}
|
|
7414
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
6493
7415
|
function _getEvtNamespace(eventName, evtNamespace) {
|
|
6494
7416
|
if (evtNamespace) {
|
|
6495
|
-
var theNamespace_1 = STR_EMPTY$
|
|
7417
|
+
var theNamespace_1 = STR_EMPTY$1;
|
|
6496
7418
|
if (isArray(evtNamespace)) {
|
|
6497
|
-
theNamespace_1 = STR_EMPTY$
|
|
7419
|
+
theNamespace_1 = STR_EMPTY$1;
|
|
6498
7420
|
arrForEach(evtNamespace, function (name) {
|
|
6499
7421
|
name = _normalizeNamespace(name);
|
|
6500
7422
|
if (name) {
|
|
@@ -6512,25 +7434,26 @@ function _getEvtNamespace(eventName, evtNamespace) {
|
|
|
6512
7434
|
if (theNamespace_1[0] !== ".") {
|
|
6513
7435
|
theNamespace_1 = "." + theNamespace_1;
|
|
6514
7436
|
}
|
|
6515
|
-
eventName = (eventName || STR_EMPTY$
|
|
7437
|
+
eventName = (eventName || STR_EMPTY$1) + theNamespace_1;
|
|
6516
7438
|
}
|
|
6517
7439
|
}
|
|
6518
|
-
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY$
|
|
7440
|
+
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY$1) || []);
|
|
6519
7441
|
return {
|
|
6520
7442
|
type: parsedEvent[1],
|
|
6521
|
-
ns: ((parsedEvent[2] || STR_EMPTY$
|
|
7443
|
+
ns: ((parsedEvent[2] || STR_EMPTY$1).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$1).split(".").sort())[_DYN_JOIN ](".")
|
|
6522
7444
|
};
|
|
6523
7445
|
}
|
|
7446
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
6524
7447
|
function __getRegisteredEvents(target, eventName, evtNamespace) {
|
|
6525
7448
|
var theEvents = [];
|
|
6526
|
-
var eventCache =
|
|
7449
|
+
var eventCache = _getElmNodeData().get(target, strEvents, {}, false);
|
|
6527
7450
|
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
6528
7451
|
objForEachKey(eventCache, function (evtType, registeredEvents) {
|
|
6529
7452
|
arrForEach(registeredEvents, function (value) {
|
|
6530
7453
|
if (!evtName[_DYN_TYPE ] || evtName[_DYN_TYPE ] === value[_DYN_EVT_NAME ][_DYN_TYPE ]) {
|
|
6531
7454
|
if (!evtName.ns || evtName.ns === evtName.ns) {
|
|
6532
7455
|
theEvents[_DYN_PUSH ]({
|
|
6533
|
-
name: value.evtName[_DYN_TYPE ] + (value[_DYN_EVT_NAME ].ns ? "." + value[_DYN_EVT_NAME ].ns : STR_EMPTY$
|
|
7456
|
+
name: value.evtName[_DYN_TYPE ] + (value[_DYN_EVT_NAME ].ns ? "." + value[_DYN_EVT_NAME ].ns : STR_EMPTY$1),
|
|
6534
7457
|
handler: value.handler
|
|
6535
7458
|
});
|
|
6536
7459
|
}
|
|
@@ -6539,9 +7462,10 @@ function __getRegisteredEvents(target, eventName, evtNamespace) {
|
|
|
6539
7462
|
});
|
|
6540
7463
|
return theEvents;
|
|
6541
7464
|
}
|
|
7465
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
6542
7466
|
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
6543
7467
|
if (addDefault === void 0) { addDefault = true; }
|
|
6544
|
-
var aiEvts =
|
|
7468
|
+
var aiEvts = _getElmNodeData().get(target, strEvents, {}, addDefault);
|
|
6545
7469
|
var registeredEvents = aiEvts[evtName];
|
|
6546
7470
|
if (!registeredEvents) {
|
|
6547
7471
|
registeredEvents = aiEvts[evtName] = [];
|
|
@@ -6591,20 +7515,21 @@ function _unregisterEvents(target, evtName, unRegFn) {
|
|
|
6591
7515
|
_doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn);
|
|
6592
7516
|
}
|
|
6593
7517
|
else {
|
|
6594
|
-
var eventCache =
|
|
7518
|
+
var eventCache = _getElmNodeData().get(target, strEvents, {});
|
|
6595
7519
|
objForEachKey(eventCache, function (evtType, events) {
|
|
6596
7520
|
_doUnregister(target, events, evtName, unRegFn);
|
|
6597
7521
|
});
|
|
6598
7522
|
if (objKeys(eventCache)[_DYN_LENGTH$1 ] === 0) {
|
|
6599
|
-
|
|
7523
|
+
_getElmNodeData().kill(target, strEvents);
|
|
6600
7524
|
}
|
|
6601
7525
|
}
|
|
6602
7526
|
}
|
|
7527
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
6603
7528
|
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
6604
7529
|
var newNamespaces;
|
|
6605
7530
|
if (namespaces) {
|
|
6606
7531
|
if (isArray(namespaces)) {
|
|
6607
|
-
newNamespaces = [theNamespace]
|
|
7532
|
+
newNamespaces = [theNamespace][_DYN_CONCAT ](namespaces);
|
|
6608
7533
|
}
|
|
6609
7534
|
else {
|
|
6610
7535
|
newNamespaces = [theNamespace, namespaces];
|
|
@@ -6623,7 +7548,7 @@ function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
|
6623
7548
|
try {
|
|
6624
7549
|
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
6625
7550
|
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
6626
|
-
if (result &&
|
|
7551
|
+
if (result && _getElmNodeData().accept(target)) {
|
|
6627
7552
|
var registeredEvent = {
|
|
6628
7553
|
guid: _guid++,
|
|
6629
7554
|
evtName: evtName,
|
|
@@ -6736,7 +7661,7 @@ function addPageHideEventListener(listener, excludeEvents, evtNamespace) {
|
|
|
6736
7661
|
listener(evt);
|
|
6737
7662
|
}
|
|
6738
7663
|
}
|
|
6739
|
-
var newNamespaces = mergeEvtNamespace(
|
|
7664
|
+
var newNamespaces = mergeEvtNamespace(_getPageHideNamespace(), evtNamespace);
|
|
6740
7665
|
var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces);
|
|
6741
7666
|
if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {
|
|
6742
7667
|
pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded;
|
|
@@ -6747,7 +7672,7 @@ function addPageHideEventListener(listener, excludeEvents, evtNamespace) {
|
|
|
6747
7672
|
return pageUnloadAdded;
|
|
6748
7673
|
}
|
|
6749
7674
|
function removePageHideEventListener(listener, evtNamespace) {
|
|
6750
|
-
var newNamespaces = mergeEvtNamespace(
|
|
7675
|
+
var newNamespaces = mergeEvtNamespace(_getPageHideNamespace(), evtNamespace);
|
|
6751
7676
|
removeEventListeners([strPageHide], listener, newNamespaces);
|
|
6752
7677
|
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
6753
7678
|
}
|
|
@@ -6758,7 +7683,7 @@ function addPageShowEventListener(listener, excludeEvents, evtNamespace) {
|
|
|
6758
7683
|
listener(evt);
|
|
6759
7684
|
}
|
|
6760
7685
|
}
|
|
6761
|
-
var newNamespaces = mergeEvtNamespace(
|
|
7686
|
+
var newNamespaces = mergeEvtNamespace(_getPageShowNamespace(), evtNamespace);
|
|
6762
7687
|
var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces);
|
|
6763
7688
|
pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded;
|
|
6764
7689
|
if (!pageShowAdded && excludeEvents) {
|
|
@@ -6767,7 +7692,7 @@ function addPageShowEventListener(listener, excludeEvents, evtNamespace) {
|
|
|
6767
7692
|
return pageShowAdded;
|
|
6768
7693
|
}
|
|
6769
7694
|
function removePageShowEventListener(listener, evtNamespace) {
|
|
6770
|
-
var newNamespaces = mergeEvtNamespace(
|
|
7695
|
+
var newNamespaces = mergeEvtNamespace(_getPageShowNamespace(), evtNamespace);
|
|
6771
7696
|
removeEventListeners([strPageShow], listener, newNamespaces);
|
|
6772
7697
|
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
6773
7698
|
}
|
|
@@ -6779,15 +7704,772 @@ var LoggingSeverity = ( /* @__PURE__ */createEnumStyle({
|
|
|
6779
7704
|
DEBUG: 3
|
|
6780
7705
|
}));
|
|
6781
7706
|
|
|
7707
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
7708
|
+
function handleAttribError(handlers, message, key, value) {
|
|
7709
|
+
if (handlers.attribError) {
|
|
7710
|
+
handlers.attribError(message, key, value);
|
|
7711
|
+
}
|
|
7712
|
+
}
|
|
7713
|
+
|
|
7714
|
+
var _inheritedKey = "~[[inherited]]";
|
|
7715
|
+
var _deletedKey = "~[[deleted]]";
|
|
7716
|
+
var _containerId = 0;
|
|
7717
|
+
function _noOpFunc() {
|
|
7718
|
+
}
|
|
7719
|
+
function _addValue(container, target, theKey, value, maxAttribs, cfg) {
|
|
7720
|
+
var errorHandlers = cfg[_DYN_ERROR_HANDLERS ] || {};
|
|
7721
|
+
if (theKey && getLength(theKey) > 0) {
|
|
7722
|
+
var key = theKey[_DYN_SPLIT ](".");
|
|
7723
|
+
var parts = [];
|
|
7724
|
+
var keyIndex = 0;
|
|
7725
|
+
var keyLen = getLength(key);
|
|
7726
|
+
while (keyIndex < keyLen) {
|
|
7727
|
+
var part = key[keyIndex];
|
|
7728
|
+
parts[_DYN_PUSH ](part);
|
|
7729
|
+
if (keyIndex === keyLen - 1) {
|
|
7730
|
+
if (target[part] && target[part].n) {
|
|
7731
|
+
handleAttribError(errorHandlers, "Attribute key [" + parts[_DYN_JOIN ](".") + "] already exists as a branch node", theKey, value);
|
|
7732
|
+
return { r: 2 };
|
|
7733
|
+
}
|
|
7734
|
+
if (!target[part] || target[part].d) {
|
|
7735
|
+
if (container.size >= maxAttribs) {
|
|
7736
|
+
if (!container.has(theKey)) {
|
|
7737
|
+
return { r: 1 };
|
|
7738
|
+
}
|
|
7739
|
+
}
|
|
7740
|
+
target[part] = {
|
|
7741
|
+
v: value
|
|
7742
|
+
};
|
|
7743
|
+
return { r: 0 , a: true };
|
|
7744
|
+
}
|
|
7745
|
+
else {
|
|
7746
|
+
var previousValue = target[part].v;
|
|
7747
|
+
target[part].v = value;
|
|
7748
|
+
target[part].d = false;
|
|
7749
|
+
return { r: 0 , a: false, p: previousValue };
|
|
7750
|
+
}
|
|
7751
|
+
}
|
|
7752
|
+
if (!target[part]) {
|
|
7753
|
+
target[part] = {
|
|
7754
|
+
n: {}
|
|
7755
|
+
};
|
|
7756
|
+
}
|
|
7757
|
+
if (!target[part].n) {
|
|
7758
|
+
handleAttribError(errorHandlers, "Attribute key [" + parts[_DYN_JOIN ](".") + "] already exists as a leaf node", theKey, value);
|
|
7759
|
+
return { r: 3 };
|
|
7760
|
+
}
|
|
7761
|
+
target = target[part].n;
|
|
7762
|
+
keyIndex++;
|
|
7763
|
+
}
|
|
7764
|
+
}
|
|
7765
|
+
return { r: 4 };
|
|
7766
|
+
}
|
|
7767
|
+
function _deleteValue(target, key) {
|
|
7768
|
+
if (key && getLength(key) > 0) {
|
|
7769
|
+
var keyIndex = 0;
|
|
7770
|
+
var keyLen = getLength(key);
|
|
7771
|
+
while (keyIndex < keyLen - 1) {
|
|
7772
|
+
var part = key[keyIndex++];
|
|
7773
|
+
if (!target[part]) {
|
|
7774
|
+
target[part] = {
|
|
7775
|
+
n: {}
|
|
7776
|
+
};
|
|
7777
|
+
}
|
|
7778
|
+
if (!target[part].n) {
|
|
7779
|
+
return { d: false };
|
|
7780
|
+
}
|
|
7781
|
+
target = target[part].n;
|
|
7782
|
+
}
|
|
7783
|
+
var lastPart = key[keyLen - 1];
|
|
7784
|
+
if (target[lastPart] && !target[lastPart].d && !target[lastPart].n) {
|
|
7785
|
+
var prev = target[lastPart].v;
|
|
7786
|
+
target[lastPart].d = true;
|
|
7787
|
+
target[lastPart].v = UNDEFINED_VALUE;
|
|
7788
|
+
return { d: true, p: prev };
|
|
7789
|
+
}
|
|
7790
|
+
else if (!target[lastPart] || !target[lastPart].d) {
|
|
7791
|
+
target[lastPart] = {
|
|
7792
|
+
d: true
|
|
7793
|
+
};
|
|
7794
|
+
return { d: true };
|
|
7795
|
+
}
|
|
7796
|
+
}
|
|
7797
|
+
return { d: false };
|
|
7798
|
+
}
|
|
7799
|
+
function _findDetail(container, key, filter, cb, nodes, inheritContainer, inheritAttribObj, otelCfg) {
|
|
7800
|
+
var theDetail;
|
|
7801
|
+
if (key && getLength(key) > 0) {
|
|
7802
|
+
var theNode = void 0;
|
|
7803
|
+
var target = nodes;
|
|
7804
|
+
var keys = strSplit(key, ".");
|
|
7805
|
+
var keysLen = getLength(keys);
|
|
7806
|
+
var idx = 0;
|
|
7807
|
+
if (filter == 0 || filter === 2 || isUndefined(filter)) {
|
|
7808
|
+
while (target && idx < keysLen) {
|
|
7809
|
+
var part = keys[idx++];
|
|
7810
|
+
var node = target[part];
|
|
7811
|
+
if (node && idx >= keysLen) {
|
|
7812
|
+
theNode = node;
|
|
7813
|
+
break;
|
|
7814
|
+
}
|
|
7815
|
+
if (!node || !node.n) {
|
|
7816
|
+
break;
|
|
7817
|
+
}
|
|
7818
|
+
target = node.n;
|
|
7819
|
+
}
|
|
7820
|
+
if (theNode) {
|
|
7821
|
+
theDetail = {
|
|
7822
|
+
c: container,
|
|
7823
|
+
k: key,
|
|
7824
|
+
n: theNode,
|
|
7825
|
+
v: theNode.d ? UNDEFINED_VALUE : theNode.v,
|
|
7826
|
+
s: 0 ,
|
|
7827
|
+
e: !theNode.d
|
|
7828
|
+
};
|
|
7829
|
+
}
|
|
7830
|
+
}
|
|
7831
|
+
if (!theDetail && (filter === 1 || isUndefined(filter))) {
|
|
7832
|
+
var inheritedValue = _getInheritedValue(key, inheritContainer, inheritAttribObj);
|
|
7833
|
+
if (inheritedValue) {
|
|
7834
|
+
theDetail = {
|
|
7835
|
+
c: container,
|
|
7836
|
+
k: key,
|
|
7837
|
+
n: null,
|
|
7838
|
+
v: inheritedValue.v,
|
|
7839
|
+
s: 1 ,
|
|
7840
|
+
e: true
|
|
7841
|
+
};
|
|
7842
|
+
}
|
|
7843
|
+
}
|
|
7844
|
+
}
|
|
7845
|
+
return cb(theDetail);
|
|
7846
|
+
}
|
|
7847
|
+
function _size(target, inheritAttrib, inheritContainer) {
|
|
7848
|
+
var count = 0;
|
|
7849
|
+
var seenKeys = [];
|
|
7850
|
+
var iter = _iterator(target, function (prefix, key, _node) {
|
|
7851
|
+
return prefix + key;
|
|
7852
|
+
}, undefined, inheritContainer || inheritAttrib);
|
|
7853
|
+
iterForOf(iter, function (key) {
|
|
7854
|
+
if (arrIndexOf(seenKeys, key) === -1) {
|
|
7855
|
+
seenKeys[_DYN_PUSH ](key);
|
|
7856
|
+
count++;
|
|
7857
|
+
}
|
|
7858
|
+
});
|
|
7859
|
+
return count;
|
|
7860
|
+
}
|
|
7861
|
+
function _getStackEntry(theNode, prefix) {
|
|
7862
|
+
var entry;
|
|
7863
|
+
if (theNode) {
|
|
7864
|
+
var allKeys = objKeys(theNode);
|
|
7865
|
+
if (getLength(allKeys) > 0) {
|
|
7866
|
+
entry = {
|
|
7867
|
+
p: prefix,
|
|
7868
|
+
n: theNode,
|
|
7869
|
+
k: allKeys,
|
|
7870
|
+
i: -1
|
|
7871
|
+
};
|
|
7872
|
+
}
|
|
7873
|
+
}
|
|
7874
|
+
return entry;
|
|
7875
|
+
}
|
|
7876
|
+
function _iterator(target, cb, otelCfg, parentAttribs, inclDeleted) {
|
|
7877
|
+
var stack = [];
|
|
7878
|
+
var visitedKeys = parentAttribs ? [] : UNDEFINED_VALUE;
|
|
7879
|
+
var inheritState;
|
|
7880
|
+
var inheritContainerIter;
|
|
7881
|
+
var current = _getStackEntry(target, STR_EMPTY$1);
|
|
7882
|
+
var inheritContainer;
|
|
7883
|
+
var inheritAttribs;
|
|
7884
|
+
var ctx = {
|
|
7885
|
+
v: undefined,
|
|
7886
|
+
n: _moveNext
|
|
7887
|
+
};
|
|
7888
|
+
if (parentAttribs) {
|
|
7889
|
+
if (isAttributeContainer(parentAttribs)) {
|
|
7890
|
+
inheritContainer = parentAttribs;
|
|
7891
|
+
}
|
|
7892
|
+
else if (isObject(parentAttribs)) {
|
|
7893
|
+
inheritAttribs = parentAttribs;
|
|
7894
|
+
}
|
|
7895
|
+
}
|
|
7896
|
+
function _moveNext() {
|
|
7897
|
+
var thePrefix = STR_EMPTY$1;
|
|
7898
|
+
var theKey;
|
|
7899
|
+
var theNode;
|
|
7900
|
+
var theSource = 0 ;
|
|
7901
|
+
while (current) {
|
|
7902
|
+
current.i++;
|
|
7903
|
+
if (current.i < getLength(current.k)) {
|
|
7904
|
+
var key = current.k[current.i];
|
|
7905
|
+
var node = current.n[key];
|
|
7906
|
+
if (node) {
|
|
7907
|
+
if (node.n) {
|
|
7908
|
+
stack[_DYN_PUSH ](current);
|
|
7909
|
+
current = _getStackEntry(node.n, current.p + key + ".");
|
|
7910
|
+
if (!current) {
|
|
7911
|
+
current = stack.pop();
|
|
7912
|
+
}
|
|
7913
|
+
}
|
|
7914
|
+
else {
|
|
7915
|
+
var fullKey = current.p + key;
|
|
7916
|
+
if (visitedKeys && arrIndexOf(visitedKeys, fullKey) === -1) {
|
|
7917
|
+
visitedKeys[_DYN_PUSH ](fullKey);
|
|
7918
|
+
}
|
|
7919
|
+
if (!node.d || inclDeleted) {
|
|
7920
|
+
thePrefix = current.p;
|
|
7921
|
+
theKey = key;
|
|
7922
|
+
theNode = node;
|
|
7923
|
+
theSource = node.d ? 2 : 0 ;
|
|
7924
|
+
break;
|
|
7925
|
+
}
|
|
7926
|
+
}
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
else {
|
|
7930
|
+
current = stack.pop();
|
|
7931
|
+
}
|
|
7932
|
+
}
|
|
7933
|
+
if (!theNode && inheritAttribs) {
|
|
7934
|
+
if (!inheritState) {
|
|
7935
|
+
inheritState = {
|
|
7936
|
+
p: STR_EMPTY$1,
|
|
7937
|
+
n: UNDEFINED_VALUE,
|
|
7938
|
+
k: objKeys(inheritAttribs),
|
|
7939
|
+
i: -1
|
|
7940
|
+
};
|
|
7941
|
+
}
|
|
7942
|
+
while (inheritState.i < getLength(inheritState.k) - 1) {
|
|
7943
|
+
inheritState.i++;
|
|
7944
|
+
var key = inheritState.k[inheritState.i];
|
|
7945
|
+
if (arrIndexOf(visitedKeys, key) === -1) {
|
|
7946
|
+
visitedKeys[_DYN_PUSH ](key);
|
|
7947
|
+
theKey = key;
|
|
7948
|
+
theNode = { v: inheritAttribs[key] };
|
|
7949
|
+
theSource = 1 ;
|
|
7950
|
+
break;
|
|
7951
|
+
}
|
|
7952
|
+
}
|
|
7953
|
+
}
|
|
7954
|
+
if (!theNode && inheritContainer) {
|
|
7955
|
+
if (!inheritContainerIter) {
|
|
7956
|
+
inheritContainerIter = inheritContainer[_DYN_ENTRIES ]();
|
|
7957
|
+
}
|
|
7958
|
+
iterForOf(inheritContainerIter, function (entry) {
|
|
7959
|
+
var key = entry[0];
|
|
7960
|
+
if (arrIndexOf(visitedKeys, key) === -1) {
|
|
7961
|
+
visitedKeys[_DYN_PUSH ](key);
|
|
7962
|
+
theKey = key;
|
|
7963
|
+
theNode = { v: entry[1] };
|
|
7964
|
+
theSource = 1 ;
|
|
7965
|
+
return -1;
|
|
7966
|
+
}
|
|
7967
|
+
});
|
|
7968
|
+
}
|
|
7969
|
+
if (theNode) {
|
|
7970
|
+
ctx.v = cb(thePrefix, theKey, theNode, theSource);
|
|
7971
|
+
}
|
|
7972
|
+
return !theNode;
|
|
7973
|
+
}
|
|
7974
|
+
return createIterator(ctx);
|
|
7975
|
+
}
|
|
7976
|
+
function _generateAttributes(container, target, otelCfg, inheritAttrib, showTree) {
|
|
7977
|
+
var attribs = objCreate(null);
|
|
7978
|
+
var deletedKeys;
|
|
7979
|
+
if (showTree) {
|
|
7980
|
+
objDefine(attribs, "#id", {
|
|
7981
|
+
v: container.id,
|
|
7982
|
+
w: false
|
|
7983
|
+
});
|
|
7984
|
+
}
|
|
7985
|
+
var iter = _iterator(target, function (prefix, key, node, source) {
|
|
7986
|
+
var name = prefix + key;
|
|
7987
|
+
return { n: name, v: node.v, d: node.d, s: source };
|
|
7988
|
+
}, otelCfg, showTree ? null : inheritAttrib, showTree ? 2 : UNDEFINED_VALUE);
|
|
7989
|
+
iterForOf(iter, function (entry) {
|
|
7990
|
+
var theNode = attribs;
|
|
7991
|
+
var theName = entry.n;
|
|
7992
|
+
if (entry.d) {
|
|
7993
|
+
if (!deletedKeys) {
|
|
7994
|
+
deletedKeys = objCreate(null);
|
|
7995
|
+
objDefine(attribs, _deletedKey, {
|
|
7996
|
+
v: deletedKeys,
|
|
7997
|
+
w: false
|
|
7998
|
+
});
|
|
7999
|
+
}
|
|
8000
|
+
theNode = deletedKeys;
|
|
8001
|
+
}
|
|
8002
|
+
if (theNode && !(theName in theNode)) {
|
|
8003
|
+
theNode[theName] = entry.v;
|
|
8004
|
+
}
|
|
8005
|
+
});
|
|
8006
|
+
if (inheritAttrib && showTree) {
|
|
8007
|
+
var inheritedKeys_1;
|
|
8008
|
+
if (isAttributeContainer(inheritAttrib)) {
|
|
8009
|
+
inheritedKeys_1 = inheritAttrib._attributes;
|
|
8010
|
+
}
|
|
8011
|
+
else {
|
|
8012
|
+
inheritedKeys_1 = objCreate(null);
|
|
8013
|
+
objForEachKey(inheritAttrib, function (key, value) {
|
|
8014
|
+
inheritedKeys_1[key] = value;
|
|
8015
|
+
});
|
|
8016
|
+
}
|
|
8017
|
+
objDefine(attribs, _inheritedKey, {
|
|
8018
|
+
v: inheritedKeys_1,
|
|
8019
|
+
w: false
|
|
8020
|
+
});
|
|
8021
|
+
}
|
|
8022
|
+
return attribs;
|
|
8023
|
+
}
|
|
8024
|
+
function _notifyListeners(listeners, changeInfo) {
|
|
8025
|
+
if (listeners) {
|
|
8026
|
+
arrForEach(listeners, function (listener) {
|
|
8027
|
+
safe(listener.cb, [changeInfo]);
|
|
8028
|
+
});
|
|
8029
|
+
}
|
|
8030
|
+
}
|
|
8031
|
+
function _getInheritedValue(key, inheritContainer, inheritAttribObj) {
|
|
8032
|
+
if (inheritContainer && inheritContainer.has(key)) {
|
|
8033
|
+
return { v: inheritContainer.get(key) };
|
|
8034
|
+
}
|
|
8035
|
+
if (inheritAttribObj && key in inheritAttribObj) {
|
|
8036
|
+
return { v: inheritAttribObj[key] };
|
|
8037
|
+
}
|
|
8038
|
+
}
|
|
8039
|
+
function _createUnloadHook(listeners, callback) {
|
|
8040
|
+
var cbInst = {
|
|
8041
|
+
cb: callback
|
|
8042
|
+
};
|
|
8043
|
+
listeners[_DYN_PUSH ](cbInst);
|
|
8044
|
+
var unloadHook = {
|
|
8045
|
+
rm: function () {
|
|
8046
|
+
if (listeners && cbInst) {
|
|
8047
|
+
var index = arrIndexOf(listeners, cbInst);
|
|
8048
|
+
if (index >= 0) {
|
|
8049
|
+
listeners[_DYN_SPLICE ](index, 1);
|
|
8050
|
+
}
|
|
8051
|
+
cbInst.cb = null;
|
|
8052
|
+
cbInst = null;
|
|
8053
|
+
unloadHook.rm = _noOpFunc;
|
|
8054
|
+
}
|
|
8055
|
+
}
|
|
8056
|
+
};
|
|
8057
|
+
return unloadHook;
|
|
8058
|
+
}
|
|
8059
|
+
function createAttributeContainer(otelCfg, name, inheritAttrib, attribLimits) {
|
|
8060
|
+
var traceCfg = otelCfg[_DYN_TRACE_CFG ] || {};
|
|
8061
|
+
var nodes = null;
|
|
8062
|
+
var theSize = null;
|
|
8063
|
+
var theDropped = null;
|
|
8064
|
+
var limits = traceCfg.generalLimits || {};
|
|
8065
|
+
var maxAttribs = limits[_DYN_ATTRIBUTE_COUNT_LIMI5 ] || 128;
|
|
8066
|
+
var theAttributes;
|
|
8067
|
+
var localAttributes;
|
|
8068
|
+
var droppedAttribs = 0;
|
|
8069
|
+
var inheritContainer = null;
|
|
8070
|
+
var inheritAttribObj = null;
|
|
8071
|
+
var listeners = null;
|
|
8072
|
+
var parentListenerHook = null;
|
|
8073
|
+
var containerName = name || STR_EMPTY$1;
|
|
8074
|
+
if (attribLimits) {
|
|
8075
|
+
maxAttribs = attribLimits[_DYN_ATTRIBUTE_COUNT_LIMI5 ] || maxAttribs;
|
|
8076
|
+
}
|
|
8077
|
+
if (isAttributeContainer(inheritAttrib)) {
|
|
8078
|
+
inheritContainer = inheritAttrib;
|
|
8079
|
+
}
|
|
8080
|
+
else if (isObject(inheritAttrib)) {
|
|
8081
|
+
inheritAttribObj = inheritAttrib;
|
|
8082
|
+
}
|
|
8083
|
+
inheritAttrib = null;
|
|
8084
|
+
var inheritSrc = inheritAttribObj || inheritContainer;
|
|
8085
|
+
var container = {
|
|
8086
|
+
id: (containerName || STR_EMPTY$1) + "." + (_containerId++),
|
|
8087
|
+
size: 0,
|
|
8088
|
+
droppedAttributes: 0,
|
|
8089
|
+
attributes: UNDEFINED_VALUE,
|
|
8090
|
+
clear: function () {
|
|
8091
|
+
if (parentListenerHook) {
|
|
8092
|
+
parentListenerHook.rm();
|
|
8093
|
+
parentListenerHook = null;
|
|
8094
|
+
}
|
|
8095
|
+
if (nodes || inheritContainer || inheritAttribObj) {
|
|
8096
|
+
_notifyListeners(listeners, { frm: container.id, op: 0 });
|
|
8097
|
+
}
|
|
8098
|
+
nodes = null;
|
|
8099
|
+
theSize = null;
|
|
8100
|
+
theDropped = null;
|
|
8101
|
+
theAttributes = null;
|
|
8102
|
+
localAttributes = null;
|
|
8103
|
+
droppedAttribs = 0;
|
|
8104
|
+
inheritSrc = null;
|
|
8105
|
+
inheritContainer = null;
|
|
8106
|
+
inheritAttribObj = null;
|
|
8107
|
+
},
|
|
8108
|
+
get: function (key, source) {
|
|
8109
|
+
return _findDetail(container, key, source, function (detail) {
|
|
8110
|
+
return detail ? detail.v : UNDEFINED_VALUE;
|
|
8111
|
+
}, nodes, inheritContainer, inheritAttribObj);
|
|
8112
|
+
},
|
|
8113
|
+
has: function (key, source) {
|
|
8114
|
+
return _findDetail(container, key, source, function (detail) {
|
|
8115
|
+
return detail ? (detail.e || source === 2 ) : false;
|
|
8116
|
+
}, nodes, inheritContainer, inheritAttribObj);
|
|
8117
|
+
},
|
|
8118
|
+
set: function (key, value) {
|
|
8119
|
+
if (!nodes) {
|
|
8120
|
+
nodes = objCreate(null);
|
|
8121
|
+
}
|
|
8122
|
+
var addResult = _addValue(container, nodes, key, value, maxAttribs, otelCfg);
|
|
8123
|
+
if (addResult.r === 0 ) {
|
|
8124
|
+
theSize = null;
|
|
8125
|
+
theAttributes = null;
|
|
8126
|
+
localAttributes = null;
|
|
8127
|
+
var op = addResult.a ? 2 : 1 ;
|
|
8128
|
+
var prevValue = addResult.p;
|
|
8129
|
+
if (op === 2 ) {
|
|
8130
|
+
var inheritedValue = _getInheritedValue(key, inheritContainer, inheritAttribObj);
|
|
8131
|
+
if (inheritedValue) {
|
|
8132
|
+
op = 1 ;
|
|
8133
|
+
prevValue = inheritedValue.v;
|
|
8134
|
+
}
|
|
8135
|
+
}
|
|
8136
|
+
if (!objIs(value, prevValue)) {
|
|
8137
|
+
_notifyListeners(listeners, {
|
|
8138
|
+
frm: container.id,
|
|
8139
|
+
op: op,
|
|
8140
|
+
k: key,
|
|
8141
|
+
prev: prevValue,
|
|
8142
|
+
val: value
|
|
8143
|
+
});
|
|
8144
|
+
}
|
|
8145
|
+
}
|
|
8146
|
+
else if (addResult.r === 1 ) {
|
|
8147
|
+
theDropped = null;
|
|
8148
|
+
droppedAttribs++;
|
|
8149
|
+
_notifyListeners(listeners, {
|
|
8150
|
+
frm: container.id,
|
|
8151
|
+
op: 4 ,
|
|
8152
|
+
k: key,
|
|
8153
|
+
val: value
|
|
8154
|
+
});
|
|
8155
|
+
}
|
|
8156
|
+
return addResult.r === 0 ;
|
|
8157
|
+
},
|
|
8158
|
+
del: function (key) {
|
|
8159
|
+
return _findDetail(container, key, UNDEFINED_VALUE, function (detail) {
|
|
8160
|
+
if (detail) {
|
|
8161
|
+
if (!nodes) {
|
|
8162
|
+
nodes = objCreate(null);
|
|
8163
|
+
}
|
|
8164
|
+
var deleteResult = _deleteValue(nodes, key[_DYN_SPLIT ]("."));
|
|
8165
|
+
if (deleteResult.d) {
|
|
8166
|
+
theSize = null;
|
|
8167
|
+
theAttributes = null;
|
|
8168
|
+
localAttributes = null;
|
|
8169
|
+
}
|
|
8170
|
+
_notifyListeners(listeners, {
|
|
8171
|
+
frm: container.id,
|
|
8172
|
+
op: 3 ,
|
|
8173
|
+
k: key,
|
|
8174
|
+
prev: detail.v
|
|
8175
|
+
});
|
|
8176
|
+
return deleteResult.d;
|
|
8177
|
+
}
|
|
8178
|
+
return false;
|
|
8179
|
+
}, nodes, inheritContainer, inheritAttribObj);
|
|
8180
|
+
},
|
|
8181
|
+
keys: function () {
|
|
8182
|
+
return _iterator(nodes, function (prefix, key, node, source) {
|
|
8183
|
+
return prefix + key;
|
|
8184
|
+
}, otelCfg, inheritSrc);
|
|
8185
|
+
},
|
|
8186
|
+
entries: function () {
|
|
8187
|
+
return _iterator(nodes, function (prefix, key, node, source) {
|
|
8188
|
+
return [prefix + key, node.v, source];
|
|
8189
|
+
}, otelCfg, inheritSrc);
|
|
8190
|
+
},
|
|
8191
|
+
values: function () {
|
|
8192
|
+
return _iterator(nodes, function (_prefix, _key, node, _source) {
|
|
8193
|
+
return node.v;
|
|
8194
|
+
}, otelCfg, inheritSrc);
|
|
8195
|
+
},
|
|
8196
|
+
forEach: function (cb) {
|
|
8197
|
+
var iter = _iterator(nodes, function (prefix, key, node, source) {
|
|
8198
|
+
cb(prefix + key, node.v, source);
|
|
8199
|
+
return true;
|
|
8200
|
+
}, otelCfg, inheritSrc);
|
|
8201
|
+
iterForOf(iter, _noOpFunc);
|
|
8202
|
+
},
|
|
8203
|
+
child: function (name, snapshot) {
|
|
8204
|
+
var childName = (name ? name : "child") + (snapshot ? "<-@[" : "<=[") + container.id + "]";
|
|
8205
|
+
return snapshot ? _createSnapshotContainer(otelCfg, childName, container, attribLimits) : createAttributeContainer(otelCfg, childName, container, attribLimits);
|
|
8206
|
+
},
|
|
8207
|
+
listen: function (callback) {
|
|
8208
|
+
if (!listeners) {
|
|
8209
|
+
listeners = [];
|
|
8210
|
+
}
|
|
8211
|
+
return _createUnloadHook(listeners, callback);
|
|
8212
|
+
}
|
|
8213
|
+
};
|
|
8214
|
+
function _listener(changeInfo) {
|
|
8215
|
+
var shouldNotify = true;
|
|
8216
|
+
if (changeInfo.op === 2 || changeInfo.op === 1 || changeInfo.op === 3 ) {
|
|
8217
|
+
theSize = null;
|
|
8218
|
+
theAttributes = null;
|
|
8219
|
+
localAttributes = null;
|
|
8220
|
+
_findDetail(container, changeInfo.k, 2 , function (detail) {
|
|
8221
|
+
shouldNotify = !detail || !detail.n;
|
|
8222
|
+
}, nodes);
|
|
8223
|
+
}
|
|
8224
|
+
else if (changeInfo.op === 0 ) {
|
|
8225
|
+
theSize = null;
|
|
8226
|
+
theAttributes = null;
|
|
8227
|
+
localAttributes = null;
|
|
8228
|
+
shouldNotify = true;
|
|
8229
|
+
}
|
|
8230
|
+
else if (changeInfo.op === 4 ) {
|
|
8231
|
+
shouldNotify = true;
|
|
8232
|
+
theDropped = null;
|
|
8233
|
+
}
|
|
8234
|
+
if (shouldNotify) {
|
|
8235
|
+
_notifyListeners(listeners, changeInfo);
|
|
8236
|
+
}
|
|
8237
|
+
}
|
|
8238
|
+
if (inheritContainer && isFunction(inheritContainer.listen)) {
|
|
8239
|
+
parentListenerHook = inheritContainer.listen(_listener);
|
|
8240
|
+
}
|
|
8241
|
+
return objDefineProps(container, {
|
|
8242
|
+
size: {
|
|
8243
|
+
g: function () {
|
|
8244
|
+
if (!theSize) {
|
|
8245
|
+
theSize = createCachedValue(_size(nodes, inheritAttribObj, inheritContainer));
|
|
8246
|
+
}
|
|
8247
|
+
return theSize.v;
|
|
8248
|
+
}
|
|
8249
|
+
},
|
|
8250
|
+
droppedAttributes: {
|
|
8251
|
+
g: function () {
|
|
8252
|
+
if (!theDropped) {
|
|
8253
|
+
theDropped = createCachedValue((inheritContainer ? inheritContainer.droppedAttributes : 0) + droppedAttribs);
|
|
8254
|
+
}
|
|
8255
|
+
return theDropped.v;
|
|
8256
|
+
}
|
|
8257
|
+
},
|
|
8258
|
+
attributes: {
|
|
8259
|
+
g: function () {
|
|
8260
|
+
if (!theAttributes) {
|
|
8261
|
+
theAttributes = createCachedValue(_generateAttributes(container, nodes, otelCfg, inheritSrc));
|
|
8262
|
+
}
|
|
8263
|
+
return theAttributes.v;
|
|
8264
|
+
}
|
|
8265
|
+
},
|
|
8266
|
+
_attributes: {
|
|
8267
|
+
g: function () {
|
|
8268
|
+
if (!localAttributes) {
|
|
8269
|
+
localAttributes = createCachedValue(_generateAttributes(container, nodes, otelCfg, inheritSrc, true));
|
|
8270
|
+
}
|
|
8271
|
+
return localAttributes.v;
|
|
8272
|
+
}
|
|
8273
|
+
}
|
|
8274
|
+
});
|
|
8275
|
+
}
|
|
8276
|
+
function _createSnapshotContainer(otelCfg, name, sourceContainer, attribLimits) {
|
|
8277
|
+
var newContainer = createAttributeContainer(otelCfg, name, sourceContainer, attribLimits);
|
|
8278
|
+
sourceContainer.listen(function (changeInfo) {
|
|
8279
|
+
if (changeInfo.op === 0 ) {
|
|
8280
|
+
iterForOf(sourceContainer[_DYN_ENTRIES ](), function (entry) {
|
|
8281
|
+
var key = entry[0];
|
|
8282
|
+
if (!newContainer.has(key, 2 ) && sourceContainer.has(key)) {
|
|
8283
|
+
newContainer.set(key, entry[1]);
|
|
8284
|
+
}
|
|
8285
|
+
});
|
|
8286
|
+
}
|
|
8287
|
+
else if (changeInfo.op === 2 ) {
|
|
8288
|
+
var key = changeInfo.k;
|
|
8289
|
+
if (!newContainer.has(key, 0 )) {
|
|
8290
|
+
newContainer.del(key);
|
|
8291
|
+
}
|
|
8292
|
+
}
|
|
8293
|
+
else if (changeInfo.op === 1 || changeInfo.op === 3 ) {
|
|
8294
|
+
var key = changeInfo.k;
|
|
8295
|
+
if (!newContainer.has(key, 2 )) {
|
|
8296
|
+
newContainer.set(key, changeInfo.prev);
|
|
8297
|
+
}
|
|
8298
|
+
}
|
|
8299
|
+
});
|
|
8300
|
+
return newContainer;
|
|
8301
|
+
}
|
|
8302
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
8303
|
+
function isAttributeContainer(value) {
|
|
8304
|
+
return value &&
|
|
8305
|
+
isFunction(value.clear) &&
|
|
8306
|
+
isFunction(value.get) &&
|
|
8307
|
+
isFunction(value.has) &&
|
|
8308
|
+
isFunction(value.set) &&
|
|
8309
|
+
isFunction(value.del) &&
|
|
8310
|
+
isFunction(value.keys) &&
|
|
8311
|
+
isFunction(value[_DYN_ENTRIES ]) &&
|
|
8312
|
+
isFunction(value.forEach) &&
|
|
8313
|
+
isFunction(value.values) &&
|
|
8314
|
+
isFunction(value.child) &&
|
|
8315
|
+
isFunction(value.listen) &&
|
|
8316
|
+
(isObject(value) || isFunction(value)) &&
|
|
8317
|
+
("id" in value) &&
|
|
8318
|
+
("size" in value) &&
|
|
8319
|
+
("droppedAttributes" in value) &&
|
|
8320
|
+
("attributes" in value);
|
|
8321
|
+
}
|
|
8322
|
+
|
|
8323
|
+
var NANOS_IN_MILLIS = 1000000;
|
|
8324
|
+
var MILLIS_IN_SECOND = 1000;
|
|
8325
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
8326
|
+
function hrTimeToMilliseconds(time) {
|
|
8327
|
+
var millisFromSeconds = time[0] * MILLIS_IN_SECOND;
|
|
8328
|
+
var millisFromNanos = Math.round(time[1] / NANOS_IN_MILLIS);
|
|
8329
|
+
return millisFromSeconds + millisFromNanos;
|
|
8330
|
+
}
|
|
8331
|
+
|
|
8332
|
+
var CLIENT_DOT$1 = "client.";
|
|
8333
|
+
var HTTP_DOT$2 = "http.";
|
|
8334
|
+
var NET_DOT = "net.";
|
|
8335
|
+
var PEER_DOT = "peer.";
|
|
8336
|
+
var EXCEPTION_DOT = "exception.";
|
|
8337
|
+
var ENDUSER_DOT = "enduser.";
|
|
8338
|
+
var URL_DOT = "url.";
|
|
8339
|
+
var DB_DOT = "db.";
|
|
8340
|
+
var NETWORK_DOT = "network.";
|
|
8341
|
+
var ATTR_ENDUSER_ID = ENDUSER_DOT + "id";
|
|
8342
|
+
var ATTR_ENDUSER_PSEUDO_ID = ENDUSER_DOT + "pseudo_id";
|
|
8343
|
+
var SEMATTRS_NET_PEER_IP = NET_DOT + PEER_DOT + "ip";
|
|
8344
|
+
var SEMATTRS_NET_PEER_NAME = NET_DOT + PEER_DOT + "name";
|
|
8345
|
+
var SEMATTRS_NET_HOST_IP = NET_DOT + "host.ip";
|
|
8346
|
+
var SEMATTRS_PEER_SERVICE = PEER_DOT + "service";
|
|
8347
|
+
var SEMATTRS_HTTP_USER_AGENT$1 = HTTP_DOT$2 + "user_agent";
|
|
8348
|
+
var SEMATTRS_HTTP_METHOD$1 = HTTP_DOT$2 + "method";
|
|
8349
|
+
var SEMATTRS_HTTP_URL$1 = HTTP_DOT$2 + "url";
|
|
8350
|
+
var SEMATTRS_HTTP_STATUS_CODE$1 = HTTP_DOT$2 + "status_code";
|
|
8351
|
+
var SEMATTRS_HTTP_ROUTE = HTTP_DOT$2 + "route";
|
|
8352
|
+
var SEMATTRS_HTTP_HOST$1 = HTTP_DOT$2 + "host";
|
|
8353
|
+
var SEMATTRS_DB_SYSTEM = DB_DOT + "system";
|
|
8354
|
+
var SEMATTRS_DB_STATEMENT = DB_DOT + "statement";
|
|
8355
|
+
var SEMATTRS_DB_OPERATION = DB_DOT + "operation";
|
|
8356
|
+
var SEMATTRS_DB_NAME = DB_DOT + "name";
|
|
8357
|
+
var SEMATTRS_RPC_SYSTEM = "rpc.system";
|
|
8358
|
+
var SEMATTRS_RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code";
|
|
8359
|
+
var SEMATTRS_EXCEPTION_TYPE = EXCEPTION_DOT + "type";
|
|
8360
|
+
var SEMATTRS_EXCEPTION_MESSAGE = EXCEPTION_DOT + "message";
|
|
8361
|
+
var SEMATTRS_EXCEPTION_STACKTRACE = EXCEPTION_DOT + "stacktrace";
|
|
8362
|
+
var SEMATTRS_HTTP_SCHEME$1 = HTTP_DOT$2 + "scheme";
|
|
8363
|
+
var SEMATTRS_HTTP_TARGET = HTTP_DOT$2 + "target";
|
|
8364
|
+
var SEMATTRS_HTTP_FLAVOR = HTTP_DOT$2 + "flavor";
|
|
8365
|
+
var SEMATTRS_NET_TRANSPORT = NET_DOT + "transport";
|
|
8366
|
+
var SEMATTRS_NET_HOST_NAME = NET_DOT + "host.name";
|
|
8367
|
+
var SEMATTRS_NET_HOST_PORT = NET_DOT + "host.port";
|
|
8368
|
+
var SEMATTRS_NET_PEER_PORT = NET_DOT + PEER_DOT + "port";
|
|
8369
|
+
var SEMATTRS_HTTP_CLIENT_IP$1 = HTTP_DOT$2 + "client_ip";
|
|
8370
|
+
var SEMATTRS_ENDUSER_ID = ENDUSER_DOT + "id";
|
|
8371
|
+
var ATTR_CLIENT_ADDRESS$1 = CLIENT_DOT$1 + "address";
|
|
8372
|
+
var ATTR_CLIENT_PORT = CLIENT_DOT$1 + "port";
|
|
8373
|
+
var ATTR_SERVER_ADDRESS$1 = "server.address";
|
|
8374
|
+
var ATTR_SERVER_PORT = "server.port";
|
|
8375
|
+
var ATTR_URL_FULL$1 = URL_DOT + "full";
|
|
8376
|
+
var ATTR_URL_PATH = URL_DOT + "path";
|
|
8377
|
+
var ATTR_URL_QUERY = URL_DOT + "query";
|
|
8378
|
+
var ATTR_URL_SCHEME$1 = URL_DOT + "scheme";
|
|
8379
|
+
var ATTR_ERROR_TYPE = "error.type";
|
|
8380
|
+
var ATTR_NETWORK_LOCAL_ADDRESS = NETWORK_DOT + "local.address";
|
|
8381
|
+
var ATTR_NETWORK_LOCAL_PORT = NETWORK_DOT + "local.port";
|
|
8382
|
+
var ATTR_NETWORK_PROTOCOL_NAME = NETWORK_DOT + "protocol.name";
|
|
8383
|
+
var ATTR_NETWORK_PEER_ADDRESS = NETWORK_DOT + PEER_DOT + "address";
|
|
8384
|
+
var ATTR_NETWORK_PEER_PORT = NETWORK_DOT + PEER_DOT + "port";
|
|
8385
|
+
var ATTR_NETWORK_PROTOCOL_VERSION = NETWORK_DOT + "protocol.version";
|
|
8386
|
+
var ATTR_NETWORK_TRANSPORT = NETWORK_DOT + "transport";
|
|
8387
|
+
var ATTR_USER_AGENT_ORIGINAL$1 = "user_agent.original";
|
|
8388
|
+
var ATTR_HTTP_REQUEST_METHOD$1 = HTTP_DOT$2 + "request.method";
|
|
8389
|
+
var ATTR_HTTP_RESPONSE_STATUS_CODE$1 = HTTP_DOT$2 + "response.status_code";
|
|
8390
|
+
var ATTR_EXCEPTION_TYPE = EXCEPTION_DOT + "type";
|
|
8391
|
+
var ATTR_EXCEPTION_MESSAGE = EXCEPTION_DOT + "message";
|
|
8392
|
+
var ATTR_EXCEPTION_STACKTRACE = EXCEPTION_DOT + "stacktrace";
|
|
8393
|
+
var EXP_ATTR_ENDUSER_ID = ENDUSER_DOT + "id";
|
|
8394
|
+
var EXP_ATTR_ENDUSER_PSEUDO_ID = ENDUSER_DOT + "pseudo_id";
|
|
8395
|
+
var EXP_ATTR_SYNTHETIC_TYPE = "synthetic.type";
|
|
8396
|
+
|
|
8397
|
+
var SYNTHETIC_TYPE = "user_agent.synthetic.type";
|
|
8398
|
+
var CLIENT_DOT = "client.";
|
|
8399
|
+
var HTTP_DOT$1 = "http.";
|
|
8400
|
+
var ATTR_CLIENT_ADDRESS = CLIENT_DOT + "address";
|
|
8401
|
+
var SEMATTRS_HTTP_CLIENT_IP = HTTP_DOT$1 + "client_ip";
|
|
8402
|
+
var ATTR_USER_AGENT_ORIGINAL = "user_agent.original";
|
|
8403
|
+
var SEMATTRS_HTTP_USER_AGENT = HTTP_DOT$1 + "user_agent";
|
|
8404
|
+
var ATTR_URL_FULL = "url.full";
|
|
8405
|
+
var SEMATTRS_HTTP_URL = HTTP_DOT$1 + "url";
|
|
8406
|
+
var ATTR_HTTP_REQUEST_METHOD = HTTP_DOT$1 + "request.method";
|
|
8407
|
+
var SEMATTRS_HTTP_METHOD = HTTP_DOT$1 + "method";
|
|
8408
|
+
var ATTR_HTTP_RESPONSE_STATUS_CODE = HTTP_DOT$1 + "response.status_code";
|
|
8409
|
+
var SEMATTRS_HTTP_STATUS_CODE = HTTP_DOT$1 + "status_code";
|
|
8410
|
+
var ATTR_URL_SCHEME = "url.scheme";
|
|
8411
|
+
var SEMATTRS_HTTP_SCHEME = HTTP_DOT$1 + "scheme";
|
|
8412
|
+
var ATTR_SERVER_ADDRESS = "server.address";
|
|
8413
|
+
var SEMATTRS_HTTP_HOST = HTTP_DOT$1 + "host";
|
|
8414
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8415
|
+
function getSyntheticType(container) {
|
|
8416
|
+
return container.get(SYNTHETIC_TYPE);
|
|
8417
|
+
}
|
|
8418
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8419
|
+
function getHttpClientIp(container) {
|
|
8420
|
+
if (container) {
|
|
8421
|
+
return container.get(ATTR_CLIENT_ADDRESS) || container.get(SEMATTRS_HTTP_CLIENT_IP);
|
|
8422
|
+
}
|
|
8423
|
+
}
|
|
8424
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8425
|
+
function getUserAgent(container) {
|
|
8426
|
+
if (container) {
|
|
8427
|
+
return container.get(ATTR_USER_AGENT_ORIGINAL) || container.get(SEMATTRS_HTTP_USER_AGENT);
|
|
8428
|
+
}
|
|
8429
|
+
}
|
|
8430
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8431
|
+
function getHttpUrl(container) {
|
|
8432
|
+
if (container) {
|
|
8433
|
+
return container.get(ATTR_URL_FULL) || container.get(SEMATTRS_HTTP_URL);
|
|
8434
|
+
}
|
|
8435
|
+
}
|
|
8436
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8437
|
+
function getHttpMethod(container) {
|
|
8438
|
+
if (container) {
|
|
8439
|
+
return container.get(ATTR_HTTP_REQUEST_METHOD) || container.get(SEMATTRS_HTTP_METHOD);
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8443
|
+
function getHttpStatusCode(container) {
|
|
8444
|
+
if (container) {
|
|
8445
|
+
return container.get(ATTR_HTTP_RESPONSE_STATUS_CODE) || container.get(SEMATTRS_HTTP_STATUS_CODE);
|
|
8446
|
+
}
|
|
8447
|
+
}
|
|
8448
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8449
|
+
function getHttpScheme(container) {
|
|
8450
|
+
if (container) {
|
|
8451
|
+
return container.get(ATTR_URL_SCHEME) || container.get(SEMATTRS_HTTP_SCHEME);
|
|
8452
|
+
}
|
|
8453
|
+
}
|
|
8454
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
8455
|
+
function getHttpHost(container) {
|
|
8456
|
+
if (container) {
|
|
8457
|
+
return container.get(ATTR_SERVER_ADDRESS) || container.get(SEMATTRS_HTTP_HOST);
|
|
8458
|
+
}
|
|
8459
|
+
}
|
|
8460
|
+
|
|
6782
8461
|
var STR_EMPTY = "";
|
|
6783
8462
|
var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
|
6784
8463
|
var STR_VERSION = "version";
|
|
6785
8464
|
var STR_PROPERTIES = "properties";
|
|
8465
|
+
var STR_NOT_SPECIFIED = "not_specified";
|
|
6786
8466
|
|
|
6787
8467
|
var _DYN_INITIALIZE = "initialize";
|
|
6788
8468
|
var _DYN_INDEX_OF = "indexOf";
|
|
6789
8469
|
var _DYN_TIMINGS = "timings";
|
|
8470
|
+
var _DYN_BASE_DATA = "baseData";
|
|
6790
8471
|
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
8472
|
+
var _DYN_KIND = "kind";
|
|
6791
8473
|
var _DYN_VALUE = "value";
|
|
6792
8474
|
var _DYN_LENGTH = "length";
|
|
6793
8475
|
var _DYN_PROCESS_TELEMETRY_ST0 = "processTelemetryStart";
|
|
@@ -6797,7 +8479,7 @@ var _DYN_RM_FIELD_SANITIZER = "rmFieldSanitizer";
|
|
|
6797
8479
|
var _DYN_CAN_HANDLE = "canHandle";
|
|
6798
8480
|
|
|
6799
8481
|
var _a;
|
|
6800
|
-
var Version = '4.
|
|
8482
|
+
var Version = '4.4.0-beta';
|
|
6801
8483
|
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
6802
8484
|
var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
|
|
6803
8485
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
@@ -6860,8 +8542,8 @@ function sanitizeProperty(name, property, stringifyObjects) {
|
|
|
6860
8542
|
!isArrayValid(property[_DYN_VALUE ])) {
|
|
6861
8543
|
return null;
|
|
6862
8544
|
}
|
|
6863
|
-
if (!isNullOrUndefined(property
|
|
6864
|
-
if (isArray(property
|
|
8545
|
+
if (!isNullOrUndefined(property[_DYN_KIND ])) {
|
|
8546
|
+
if (isArray(property.value) || !isValueKind(property[_DYN_KIND ])) {
|
|
6865
8547
|
return null;
|
|
6866
8548
|
}
|
|
6867
8549
|
property[_DYN_VALUE ] = property[_DYN_VALUE ].toString();
|
|
@@ -7051,10 +8733,11 @@ function isGreaterThanZero(value) {
|
|
|
7051
8733
|
return value > 0;
|
|
7052
8734
|
}
|
|
7053
8735
|
|
|
7054
|
-
var defaultConfig = objDeepFreeze({
|
|
8736
|
+
var defaultConfig = ( /*#__PURE__*/objDeepFreeze({
|
|
7055
8737
|
endpointUrl: STR_DEFAULT_ENDPOINT_URL,
|
|
7056
8738
|
propertyStorageOverride: { isVal: _chkPropOverride }
|
|
7057
|
-
});
|
|
8739
|
+
}));
|
|
8740
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
7058
8741
|
function _chkPropOverride(propertyStorageOverride) {
|
|
7059
8742
|
if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
|
|
7060
8743
|
throwError("Invalid property storage override passed.");
|
|
@@ -7093,7 +8776,7 @@ var AppInsightsCore = /** @class */ (function (_super) {
|
|
|
7093
8776
|
var itemExt = telemetryItem.ext = telemetryItem.ext || {};
|
|
7094
8777
|
itemExt.sdk = itemExt.sdk || {};
|
|
7095
8778
|
itemExt.sdk.ver = FullVersionString;
|
|
7096
|
-
var baseData = telemetryItem
|
|
8779
|
+
var baseData = telemetryItem[_DYN_BASE_DATA ] = telemetryItem[_DYN_BASE_DATA ] || {};
|
|
7097
8780
|
baseData[STR_PROPERTIES ] = baseData[STR_PROPERTIES ] || {};
|
|
7098
8781
|
var itemProperties = baseData[STR_PROPERTIES ];
|
|
7099
8782
|
itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;
|
|
@@ -7330,8 +9013,8 @@ var ValueSanitizer = /** @class */ (function () {
|
|
|
7330
9013
|
if (mapValue.handler) {
|
|
7331
9014
|
return mapValue.handler.property(path, name, property, stringifyObjects);
|
|
7332
9015
|
}
|
|
7333
|
-
if (!isNullOrUndefined(property
|
|
7334
|
-
if ((fieldType & 4096 ) === 4096 || !isValueKind(property
|
|
9016
|
+
if (!isNullOrUndefined(property[_DYN_KIND ])) {
|
|
9017
|
+
if ((fieldType & 4096 ) === 4096 || !isValueKind(property[_DYN_KIND ])) {
|
|
7335
9018
|
return null;
|
|
7336
9019
|
}
|
|
7337
9020
|
property[_DYN_VALUE ] = property[_DYN_VALUE ].toString();
|
|
@@ -7346,7 +9029,7 @@ var ValueSanitizer = /** @class */ (function () {
|
|
|
7346
9029
|
}
|
|
7347
9030
|
function _callFieldSanitizer(fieldProvider, path, name, theType, property) {
|
|
7348
9031
|
if (property && fieldProvider) {
|
|
7349
|
-
var sanitizer = fieldProvider.getSanitizer(path, name, theType, property
|
|
9032
|
+
var sanitizer = fieldProvider.getSanitizer(path, name, theType, property[_DYN_KIND ], property.propertyType);
|
|
7350
9033
|
if (sanitizer) {
|
|
7351
9034
|
if (theType === 4 ) {
|
|
7352
9035
|
var newValue_1 = {};
|
|
@@ -7382,6 +9065,257 @@ var ValueSanitizer = /** @class */ (function () {
|
|
|
7382
9065
|
return ValueSanitizer;
|
|
7383
9066
|
}());
|
|
7384
9067
|
|
|
9068
|
+
var AzNamespace = "az.namespace";
|
|
9069
|
+
var AzResourceNamespace = "azure.resource_provider.namespace";
|
|
9070
|
+
var PORT_REGEX = ( /*#__PURE__*/getLazy(function () { return new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/); }));
|
|
9071
|
+
var HTTP_DOT = "http.";
|
|
9072
|
+
var _MS_PROCESSED_BY_METRICS_EXTRACTORS = "_MS.ProcessedByMetricExtractors";
|
|
9073
|
+
var _ignoreSemanticValues = ( /* #__PURE__*/getLazy(_initIgnoreSemanticValues));
|
|
9074
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
9075
|
+
function _initIgnoreSemanticValues() {
|
|
9076
|
+
return [
|
|
9077
|
+
_MS_PROCESSED_BY_METRICS_EXTRACTORS,
|
|
9078
|
+
SEMATTRS_NET_PEER_IP,
|
|
9079
|
+
SEMATTRS_NET_PEER_NAME,
|
|
9080
|
+
SEMATTRS_NET_HOST_IP,
|
|
9081
|
+
SEMATTRS_PEER_SERVICE,
|
|
9082
|
+
SEMATTRS_HTTP_USER_AGENT$1,
|
|
9083
|
+
SEMATTRS_HTTP_METHOD$1,
|
|
9084
|
+
SEMATTRS_HTTP_URL$1,
|
|
9085
|
+
SEMATTRS_HTTP_STATUS_CODE$1,
|
|
9086
|
+
SEMATTRS_HTTP_ROUTE,
|
|
9087
|
+
SEMATTRS_HTTP_HOST$1,
|
|
9088
|
+
SEMATTRS_DB_SYSTEM,
|
|
9089
|
+
SEMATTRS_DB_STATEMENT,
|
|
9090
|
+
SEMATTRS_DB_OPERATION,
|
|
9091
|
+
SEMATTRS_DB_NAME,
|
|
9092
|
+
SEMATTRS_RPC_SYSTEM,
|
|
9093
|
+
SEMATTRS_RPC_GRPC_STATUS_CODE,
|
|
9094
|
+
SEMATTRS_EXCEPTION_TYPE,
|
|
9095
|
+
SEMATTRS_EXCEPTION_MESSAGE,
|
|
9096
|
+
SEMATTRS_EXCEPTION_STACKTRACE,
|
|
9097
|
+
SEMATTRS_HTTP_SCHEME$1,
|
|
9098
|
+
SEMATTRS_HTTP_TARGET,
|
|
9099
|
+
SEMATTRS_HTTP_FLAVOR,
|
|
9100
|
+
SEMATTRS_NET_TRANSPORT,
|
|
9101
|
+
SEMATTRS_NET_HOST_NAME,
|
|
9102
|
+
SEMATTRS_NET_HOST_PORT,
|
|
9103
|
+
SEMATTRS_NET_PEER_PORT,
|
|
9104
|
+
SEMATTRS_HTTP_CLIENT_IP$1,
|
|
9105
|
+
SEMATTRS_ENDUSER_ID,
|
|
9106
|
+
HTTP_DOT + "status_text",
|
|
9107
|
+
ATTR_CLIENT_ADDRESS$1,
|
|
9108
|
+
ATTR_CLIENT_PORT,
|
|
9109
|
+
ATTR_SERVER_ADDRESS$1,
|
|
9110
|
+
ATTR_SERVER_PORT,
|
|
9111
|
+
ATTR_URL_FULL$1,
|
|
9112
|
+
ATTR_URL_PATH,
|
|
9113
|
+
ATTR_URL_QUERY,
|
|
9114
|
+
ATTR_URL_SCHEME$1,
|
|
9115
|
+
ATTR_ERROR_TYPE,
|
|
9116
|
+
ATTR_NETWORK_LOCAL_ADDRESS,
|
|
9117
|
+
ATTR_NETWORK_LOCAL_PORT,
|
|
9118
|
+
ATTR_NETWORK_PROTOCOL_NAME,
|
|
9119
|
+
ATTR_NETWORK_PEER_ADDRESS,
|
|
9120
|
+
ATTR_NETWORK_PEER_PORT,
|
|
9121
|
+
ATTR_NETWORK_PROTOCOL_VERSION,
|
|
9122
|
+
ATTR_NETWORK_TRANSPORT,
|
|
9123
|
+
ATTR_USER_AGENT_ORIGINAL$1,
|
|
9124
|
+
ATTR_HTTP_REQUEST_METHOD$1,
|
|
9125
|
+
ATTR_HTTP_RESPONSE_STATUS_CODE$1,
|
|
9126
|
+
ATTR_EXCEPTION_TYPE,
|
|
9127
|
+
ATTR_EXCEPTION_MESSAGE,
|
|
9128
|
+
ATTR_EXCEPTION_STACKTRACE,
|
|
9129
|
+
EXP_ATTR_ENDUSER_ID,
|
|
9130
|
+
EXP_ATTR_ENDUSER_PSEUDO_ID,
|
|
9131
|
+
EXP_ATTR_SYNTHETIC_TYPE,
|
|
9132
|
+
AzNamespace,
|
|
9133
|
+
AzResourceNamespace,
|
|
9134
|
+
"az.client_request_id",
|
|
9135
|
+
"azure.client.id",
|
|
9136
|
+
"az.service_request_id",
|
|
9137
|
+
"azure.service.request.id"
|
|
9138
|
+
];
|
|
9139
|
+
}
|
|
9140
|
+
function _applyExtValue(ext, extName, name, value, overwriteExt) {
|
|
9141
|
+
if (isString(value) || isNumber(value) || isBoolean(value)) {
|
|
9142
|
+
var target = ext[extName] = ext[extName] || {};
|
|
9143
|
+
_applyValue(target, name, value, overwriteExt);
|
|
9144
|
+
}
|
|
9145
|
+
}
|
|
9146
|
+
function _applyValue(target, name, value, overwriteTarget) {
|
|
9147
|
+
if (target) {
|
|
9148
|
+
if (isString(value) || isNumber(value) || isBoolean(value)) {
|
|
9149
|
+
var targetValue = target[name];
|
|
9150
|
+
if (!overwriteTarget && (targetValue || isString(targetValue) || isNumber(targetValue) || isBoolean(targetValue))) {
|
|
9151
|
+
value = targetValue;
|
|
9152
|
+
}
|
|
9153
|
+
target[name] = value;
|
|
9154
|
+
}
|
|
9155
|
+
}
|
|
9156
|
+
return target;
|
|
9157
|
+
}
|
|
9158
|
+
function _populateExtensionsFromSpan(telemetryItem, span, container) {
|
|
9159
|
+
var ext = telemetryItem.ext = telemetryItem.ext || {};
|
|
9160
|
+
var endUserId = container.get(ATTR_ENDUSER_ID);
|
|
9161
|
+
if (endUserId) {
|
|
9162
|
+
_applyExtValue(ext, "user", "authId", asString(endUserId), false);
|
|
9163
|
+
}
|
|
9164
|
+
var endUserPseudoId = container.get(ATTR_ENDUSER_PSEUDO_ID);
|
|
9165
|
+
if (endUserPseudoId) {
|
|
9166
|
+
_applyExtValue(ext, "user", "id", asString(endUserPseudoId), false);
|
|
9167
|
+
}
|
|
9168
|
+
}
|
|
9169
|
+
function _isIgnorePartCKey(key) {
|
|
9170
|
+
var result = false;
|
|
9171
|
+
if (arrIncludes(_ignoreSemanticValues.v, key)) {
|
|
9172
|
+
result = true;
|
|
9173
|
+
}
|
|
9174
|
+
else if (strStartsWith(key, "microsoft.")) {
|
|
9175
|
+
result = true;
|
|
9176
|
+
}
|
|
9177
|
+
return result;
|
|
9178
|
+
}
|
|
9179
|
+
function _populatePartC(item, container) {
|
|
9180
|
+
if (container) {
|
|
9181
|
+
var partC_1 = item.data = (item.data || {});
|
|
9182
|
+
_applyValue(partC_1, "httpHost", getHttpHost(container), false);
|
|
9183
|
+
_applyValue(partC_1, "httpScheme", getHttpScheme(container), false);
|
|
9184
|
+
_applyValue(partC_1, "httpClientIp", getHttpClientIp(container), false);
|
|
9185
|
+
_applyValue(partC_1, "httpUserAgent", getUserAgent(container), false);
|
|
9186
|
+
_applyValue(partC_1, "httpRoute", container.get(SEMATTRS_HTTP_ROUTE), false);
|
|
9187
|
+
_applyValue(partC_1, "netPeerName", container.get(SEMATTRS_NET_PEER_NAME), false);
|
|
9188
|
+
_applyValue(partC_1, "netPeerPort", container.get(SEMATTRS_NET_PEER_PORT), false);
|
|
9189
|
+
_applyValue(partC_1, "netPeerIp", container.get(SEMATTRS_NET_PEER_IP), false);
|
|
9190
|
+
_applyValue(partC_1, "peerService", container.get("service.name") || container.get(SEMATTRS_PEER_SERVICE), false);
|
|
9191
|
+
var syntheticSource = getSyntheticType(container);
|
|
9192
|
+
if (!!syntheticSource) {
|
|
9193
|
+
_applyValue(partC_1, "userAgentSyntheticType", syntheticSource, false);
|
|
9194
|
+
}
|
|
9195
|
+
var nav = getNavigator();
|
|
9196
|
+
if (nav && nav.userAgent) {
|
|
9197
|
+
_applyValue(partC_1, "userAgentOriginal", nav.userAgent, false);
|
|
9198
|
+
}
|
|
9199
|
+
_applyValue(partC_1, "azureClientRequestId", container.get("azure.client.id") || container.get("az.client_request_id"), false);
|
|
9200
|
+
_applyValue(partC_1, "azureServiceRequestId", container.get("azure.service.request.id") || container.get("az.service_request_id"), false);
|
|
9201
|
+
var sampleRate = container.get("microsoft.sample_rate");
|
|
9202
|
+
if (!isNullOrUndefined(sampleRate)) {
|
|
9203
|
+
_applyValue(partC_1, "sampleRate", sampleRate, false);
|
|
9204
|
+
}
|
|
9205
|
+
container.forEach(function (key, value) {
|
|
9206
|
+
if (!_isIgnorePartCKey(key)) {
|
|
9207
|
+
partC_1[key] = value;
|
|
9208
|
+
}
|
|
9209
|
+
});
|
|
9210
|
+
}
|
|
9211
|
+
}
|
|
9212
|
+
function _populateHttpProperties(otelSpanTelemetry, container, httpMethod, config) {
|
|
9213
|
+
if (httpMethod) {
|
|
9214
|
+
_applyValue(otelSpanTelemetry, "httpMethod", httpMethod, false);
|
|
9215
|
+
var httpUrl = getHttpUrl(container);
|
|
9216
|
+
if (httpUrl) {
|
|
9217
|
+
try {
|
|
9218
|
+
var res = PORT_REGEX.v.exec(asString(httpUrl));
|
|
9219
|
+
if (res !== null) {
|
|
9220
|
+
var protocol = res[1];
|
|
9221
|
+
var port = res[3];
|
|
9222
|
+
if ((protocol === "https" && port === ":443") ||
|
|
9223
|
+
(protocol === "http" && port === ":80")) {
|
|
9224
|
+
httpUrl = res[1] + res[2] + res[4];
|
|
9225
|
+
}
|
|
9226
|
+
}
|
|
9227
|
+
}
|
|
9228
|
+
catch (_a) {
|
|
9229
|
+
}
|
|
9230
|
+
_applyValue(otelSpanTelemetry, "httpUrl", fieldRedaction(asString(httpUrl), config), false);
|
|
9231
|
+
}
|
|
9232
|
+
var httpStatusCode = getHttpStatusCode(container);
|
|
9233
|
+
if (httpStatusCode) {
|
|
9234
|
+
_applyValue(otelSpanTelemetry, "httpStatusCode", httpStatusCode, false);
|
|
9235
|
+
}
|
|
9236
|
+
}
|
|
9237
|
+
}
|
|
9238
|
+
function _populateDbProperties(otelSpanTelemetry, container, dbSystem) {
|
|
9239
|
+
if (dbSystem) {
|
|
9240
|
+
_applyValue(otelSpanTelemetry, "dbSystem", dbSystem, false);
|
|
9241
|
+
_applyValue(otelSpanTelemetry, "dbStatement", container.get(SEMATTRS_DB_STATEMENT) || container.get(SEMATTRS_DB_OPERATION), false);
|
|
9242
|
+
_applyValue(otelSpanTelemetry, "dbName", container.get(SEMATTRS_DB_NAME) || dbSystem || "<undefined>", false);
|
|
9243
|
+
}
|
|
9244
|
+
}
|
|
9245
|
+
function _populateRpcDependencyProperties(otelSpanTelemetry, container, rpcSystem) {
|
|
9246
|
+
if (rpcSystem) {
|
|
9247
|
+
_applyValue(otelSpanTelemetry, "rpcSystem", strLower(rpcSystem), false);
|
|
9248
|
+
_applyValue(otelSpanTelemetry, "rpcGrpcStatusCode", container.get(SEMATTRS_RPC_GRPC_STATUS_CODE), false);
|
|
9249
|
+
}
|
|
9250
|
+
}
|
|
9251
|
+
function _createOTelSpanTelemetryItem(core, span) {
|
|
9252
|
+
var container = span.attribContainer || createAttributeContainer(span.attributes);
|
|
9253
|
+
var spanCtx = span.spanContext();
|
|
9254
|
+
var statusCode = span.status ? span.status.code : 0 ;
|
|
9255
|
+
var spanTelemetry = {
|
|
9256
|
+
name: span.name,
|
|
9257
|
+
kind: span[_DYN_KIND ],
|
|
9258
|
+
startTime: toISOString(new Date(hrTimeToMilliseconds(span.startTime))),
|
|
9259
|
+
success: statusCode !== 0 ? statusCode !== 2 : (Number(getHttpStatusCode(container)) || 0) < 400,
|
|
9260
|
+
duration: hrTimeToMilliseconds(span.duration)
|
|
9261
|
+
};
|
|
9262
|
+
var parentCtx = span.parentSpanContext || (spanCtx ? spanCtx.parentCtx : null);
|
|
9263
|
+
_applyValue(spanTelemetry, "parentId", span.parentSpanId || (parentCtx ? parentCtx.spanId : null), false);
|
|
9264
|
+
if (spanCtx) {
|
|
9265
|
+
var traceState = spanCtx.traceState;
|
|
9266
|
+
if (traceState && !traceState.isEmpty) {
|
|
9267
|
+
_applyValue(spanTelemetry, "traceState", traceState.hdrs(1)[0], false);
|
|
9268
|
+
}
|
|
9269
|
+
}
|
|
9270
|
+
_populateHttpProperties(spanTelemetry, container, getHttpMethod(container), core.config);
|
|
9271
|
+
_populateDbProperties(spanTelemetry, container, container.get(SEMATTRS_DB_SYSTEM));
|
|
9272
|
+
_populateRpcDependencyProperties(spanTelemetry, container, container.get(SEMATTRS_RPC_SYSTEM));
|
|
9273
|
+
_applyValue(spanTelemetry, "azureResourceProvider", container.get(AzResourceNamespace) || container.get(AzNamespace), false);
|
|
9274
|
+
return _createTelemetryItem(spanTelemetry, span, "OTelSpan", "Ms.Web.Span");
|
|
9275
|
+
}
|
|
9276
|
+
function _createTelemetryItem(item, span, baseType, eventName) {
|
|
9277
|
+
eventName = eventName || STR_NOT_SPECIFIED;
|
|
9278
|
+
if (isNullOrUndefined(item) ||
|
|
9279
|
+
isNullOrUndefined(baseType) ||
|
|
9280
|
+
isNullOrUndefined(eventName)) {
|
|
9281
|
+
throwError("Input doesn't contain all required fields");
|
|
9282
|
+
}
|
|
9283
|
+
var iKey = "";
|
|
9284
|
+
if (item.iKey) {
|
|
9285
|
+
iKey = item.iKey;
|
|
9286
|
+
delete item.iKey;
|
|
9287
|
+
}
|
|
9288
|
+
var telemetryItem = {
|
|
9289
|
+
name: eventName,
|
|
9290
|
+
time: toISOString(span.endTime ? new Date(hrTimeToMilliseconds(span.endTime)) : new Date()),
|
|
9291
|
+
iKey: iKey,
|
|
9292
|
+
ext: {},
|
|
9293
|
+
baseType: baseType,
|
|
9294
|
+
baseData: item,
|
|
9295
|
+
data: {}
|
|
9296
|
+
};
|
|
9297
|
+
return telemetryItem;
|
|
9298
|
+
}
|
|
9299
|
+
function createExtendedTelemetryItemFromSpan(core, span) {
|
|
9300
|
+
var telemetryItem = _createOTelSpanTelemetryItem(core, span);
|
|
9301
|
+
var container = span.attribContainer || createAttributeContainer(span.attributes);
|
|
9302
|
+
if (telemetryItem) {
|
|
9303
|
+
var partB = telemetryItem[_DYN_BASE_DATA ] = telemetryItem[_DYN_BASE_DATA ] || {};
|
|
9304
|
+
partB.startTime = new Date(hrTimeToMilliseconds(span.startTime));
|
|
9305
|
+
var spanContext = span.spanContext();
|
|
9306
|
+
if (spanContext) {
|
|
9307
|
+
var ext = telemetryItem.ext = telemetryItem.ext || {};
|
|
9308
|
+
var dt = ext["dt"] = ext["dt"] || {};
|
|
9309
|
+
_applyValue(dt, "spanId", spanContext.spanId, false);
|
|
9310
|
+
_applyValue(dt, "traceId", spanContext.traceId, false);
|
|
9311
|
+
_applyValue(dt, "traceFlags", spanContext.traceFlags, false);
|
|
9312
|
+
}
|
|
9313
|
+
_populateExtensionsFromSpan(telemetryItem, span, container);
|
|
9314
|
+
_populatePartC(telemetryItem, container);
|
|
9315
|
+
}
|
|
9316
|
+
return telemetryItem;
|
|
9317
|
+
}
|
|
9318
|
+
|
|
7385
9319
|
exports.ActiveStatus = ActiveStatus;
|
|
7386
9320
|
exports.AppInsightsCore = AppInsightsCore;
|
|
7387
9321
|
exports.BaseTelemetryPlugin = BaseTelemetryPlugin;
|
|
@@ -7397,7 +9331,6 @@ exports.MinChannelPriorty = MinChannelPriorty;
|
|
|
7397
9331
|
exports.NotificationManager = NotificationManager;
|
|
7398
9332
|
exports.PerfEvent = PerfEvent;
|
|
7399
9333
|
exports.PerfManager = PerfManager;
|
|
7400
|
-
exports.ProcessTelemetryContext = ProcessTelemetryContext;
|
|
7401
9334
|
exports.SenderPostManager = SenderPostManager;
|
|
7402
9335
|
exports.TraceLevel = TraceLevel;
|
|
7403
9336
|
exports.Undefined = strShimUndefined;
|
|
@@ -7424,11 +9357,11 @@ exports.arrMap = arrMap;
|
|
|
7424
9357
|
exports.arrReduce = arrReduce;
|
|
7425
9358
|
exports.attachEvent = attachEvent;
|
|
7426
9359
|
exports.blockDynamicConversion = blockDynamicConversion;
|
|
7427
|
-
exports.convertAllHeadersToMap = convertAllHeadersToMap;
|
|
7428
9360
|
exports.cookieAvailable = areCookiesSupported;
|
|
7429
9361
|
exports.createCookieMgr = createCookieMgr;
|
|
7430
9362
|
exports.createDynamicConfig = createDynamicConfig;
|
|
7431
9363
|
exports.createEnumStyle = createEnumStyle;
|
|
9364
|
+
exports.createExtendedTelemetryItemFromSpan = createExtendedTelemetryItemFromSpan;
|
|
7432
9365
|
exports.createGuid = createGuid;
|
|
7433
9366
|
exports.createProcessTelemetryContext = createProcessTelemetryContext;
|
|
7434
9367
|
exports.createTraceParent = createTraceParent;
|
|
@@ -7555,4 +9488,4 @@ exports.toISOString = toISOString;
|
|
|
7555
9488
|
exports.useXDomainRequest = useXDomainRequest;
|
|
7556
9489
|
|
|
7557
9490
|
}));
|
|
7558
|
-
//# sourceMappingURL=ms.core-4.
|
|
9491
|
+
//# sourceMappingURL=ms.core-4.4.0-beta.gbl.js.map
|