@microsoft/applicationinsights-debugplugin-js 2.7.5-nightly.2204-03 → 2.7.6
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/browser/{ai.dbg.2.7.5-nightly.2204-03.cjs.js → ai.dbg.2.7.6.cjs.js} +491 -1046
- package/browser/ai.dbg.2.7.6.cjs.js.map +1 -0
- package/browser/ai.dbg.2.7.6.cjs.min.js +6 -0
- package/browser/ai.dbg.2.7.6.cjs.min.js.map +1 -0
- package/browser/{ai.dbg.2.7.5-nightly.2204-03.gbl.js → ai.dbg.2.7.6.gbl.js} +491 -1046
- package/browser/ai.dbg.2.7.6.gbl.js.map +1 -0
- package/browser/ai.dbg.2.7.6.gbl.min.js +6 -0
- package/browser/ai.dbg.2.7.6.gbl.min.js.map +1 -0
- package/browser/ai.dbg.2.7.6.integrity.json +66 -0
- package/browser/{ai.dbg.2.7.5-nightly.2204-03.js → ai.dbg.2.7.6.js} +491 -1046
- package/browser/ai.dbg.2.7.6.js.map +1 -0
- package/browser/ai.dbg.2.7.6.min.js +6 -0
- package/browser/ai.dbg.2.7.6.min.js.map +1 -0
- package/browser/ai.dbg.2.cjs.js +490 -1045
- package/browser/ai.dbg.2.cjs.js.map +1 -1
- package/browser/ai.dbg.2.cjs.min.js +2 -2
- package/browser/ai.dbg.2.cjs.min.js.map +1 -1
- package/browser/ai.dbg.2.gbl.js +490 -1045
- package/browser/ai.dbg.2.gbl.js.map +1 -1
- package/browser/ai.dbg.2.gbl.min.js +2 -2
- package/browser/ai.dbg.2.gbl.min.js.map +1 -1
- package/browser/ai.dbg.2.js +490 -1045
- package/browser/ai.dbg.2.js.map +1 -1
- package/browser/ai.dbg.2.min.js +2 -2
- package/browser/ai.dbg.2.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.api.json +17 -10
- package/dist/applicationinsights-debugplugin-js.d.ts +1 -1
- package/dist/applicationinsights-debugplugin-js.js +490 -1045
- package/dist/applicationinsights-debugplugin-js.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.min.js +2 -2
- package/dist/applicationinsights-debugplugin-js.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.rollup.d.ts +1 -1
- package/dist-esm/DebugPlugin.js +8 -8
- package/dist-esm/DebugPlugin.js.map +1 -1
- package/dist-esm/applicationinsights-debugplugin-js.js +1 -1
- package/dist-esm/components/Dashboard.js +5 -5
- package/dist-esm/components/Dashboard.js.map +1 -1
- package/dist-esm/components/LogEntry.js +3 -3
- package/dist-esm/components/LogEntry.js.map +1 -1
- package/dist-esm/components/debugBins.js +1 -1
- package/dist-esm/components/filterList.js +3 -2
- package/dist-esm/components/filterList.js.map +1 -1
- package/dist-esm/components/helpers.js +4 -4
- package/dist-esm/components/helpers.js.map +1 -1
- package/dist-esm/components/styleNodeSrc.js +1 -1
- package/dist-esm/interfaces/IDebugPluginConfig.js +1 -1
- package/package.json +54 -57
- package/src/DebugPlugin.ts +7 -7
- package/src/components/Dashboard.ts +4 -4
- package/src/components/LogEntry.ts +2 -2
- package/src/components/debugBins.ts +6 -7
- package/src/components/filterList.ts +3 -1
- package/src/components/helpers.ts +48 -58
- package/src/components/styleNodeSrc.ts +33 -33
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.cjs.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.cjs.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2204-03.cjs.min.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.gbl.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.gbl.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2204-03.gbl.min.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.integrity.json +0 -66
- package/browser/ai.dbg.2.7.5-nightly.2204-03.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2204-03.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2204-03.min.js.map +0 -1
package/browser/ai.dbg.2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Debug Plugin, 2.7.
|
|
2
|
+
* Application Insights JavaScript SDK - Debug Plugin, 2.7.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -62,9 +62,7 @@
|
|
|
62
62
|
(getGlobal() || {})["Reflect"];
|
|
63
63
|
var extendStaticsFn = function (d, b) {
|
|
64
64
|
extendStaticsFn = ObjClass["setPrototypeOf"] ||
|
|
65
|
-
({ __proto__: [] } instanceof Array && function (d, b) {
|
|
66
|
-
d.__proto__ = b;
|
|
67
|
-
}) ||
|
|
65
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
68
66
|
function (d, b) {
|
|
69
67
|
for (var p in b) {
|
|
70
68
|
if (b[strShimHasOwnProperty](p)) {
|
|
@@ -79,14 +77,12 @@
|
|
|
79
77
|
throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
80
78
|
}
|
|
81
79
|
extendStaticsFn(d, b);
|
|
82
|
-
function __() {
|
|
83
|
-
this.constructor = d;
|
|
84
|
-
}
|
|
80
|
+
function __() { this.constructor = d; }
|
|
85
81
|
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
/*!
|
|
89
|
-
* Microsoft Dynamic Proto Utility, 1.1.
|
|
85
|
+
* Microsoft Dynamic Proto Utility, 1.1.6
|
|
90
86
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
91
87
|
*/
|
|
92
88
|
var Constructor = 'constructor';
|
|
@@ -101,10 +97,13 @@
|
|
|
101
97
|
var DynProtoDefaultOptions = '_dfOpts';
|
|
102
98
|
var UnknownValue = '_unknown_';
|
|
103
99
|
var str__Proto$1 = "__proto__";
|
|
100
|
+
var DynProtoBaseProto = "_dyn" + str__Proto$1;
|
|
101
|
+
var DynProtoCurrent = "_dynInstProto";
|
|
104
102
|
var strUseBaseInst = 'useBaseInst';
|
|
105
103
|
var strSetInstFuncs = 'setInstFuncs';
|
|
106
104
|
var Obj = Object;
|
|
107
105
|
var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
|
|
106
|
+
var _objGetOwnProps = Obj["getOwnPropertyNames"];
|
|
108
107
|
var _dynamicNames = 0;
|
|
109
108
|
function _hasOwnProperty(obj, prop) {
|
|
110
109
|
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
@@ -116,22 +115,25 @@
|
|
|
116
115
|
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
117
116
|
}
|
|
118
117
|
function _getObjProto$1(target) {
|
|
118
|
+
var newProto;
|
|
119
119
|
if (target) {
|
|
120
120
|
if (_objGetPrototypeOf$1) {
|
|
121
121
|
return _objGetPrototypeOf$1(target);
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
var curProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
124
|
+
newProto = target[DynProtoBaseProto] || curProto;
|
|
125
|
+
if (!_hasOwnProperty(target, DynProtoBaseProto)) {
|
|
126
|
+
delete target[DynProtoCurrent];
|
|
127
|
+
newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];
|
|
128
|
+
target[DynProtoCurrent] = curProto;
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
|
-
return
|
|
131
|
+
return newProto;
|
|
129
132
|
}
|
|
130
133
|
function _forEachProp(target, func) {
|
|
131
134
|
var props = [];
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
props = getOwnProps(target);
|
|
135
|
+
if (_objGetOwnProps) {
|
|
136
|
+
props = _objGetOwnProps(target);
|
|
135
137
|
}
|
|
136
138
|
else {
|
|
137
139
|
for (var name_1 in target) {
|
|
@@ -280,8 +282,9 @@
|
|
|
280
282
|
visited.push(thisProto);
|
|
281
283
|
thisProto = _getObjProto$1(thisProto);
|
|
282
284
|
}
|
|
285
|
+
return false;
|
|
283
286
|
}
|
|
284
|
-
return
|
|
287
|
+
return true;
|
|
285
288
|
}
|
|
286
289
|
function _getObjName(target, unknownValue) {
|
|
287
290
|
if (_hasOwnProperty(target, Prototype)) {
|
|
@@ -326,15 +329,99 @@
|
|
|
326
329
|
};
|
|
327
330
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
328
331
|
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
|
|
332
|
+
var LoggingSeverity;
|
|
333
|
+
(function (LoggingSeverity) {
|
|
334
|
+
LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL";
|
|
335
|
+
LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING";
|
|
336
|
+
})(LoggingSeverity || (LoggingSeverity = {}));
|
|
337
|
+
var _InternalMessageId = {
|
|
338
|
+
BrowserDoesNotSupportLocalStorage: 0,
|
|
339
|
+
BrowserCannotReadLocalStorage: 1,
|
|
340
|
+
BrowserCannotReadSessionStorage: 2,
|
|
341
|
+
BrowserCannotWriteLocalStorage: 3,
|
|
342
|
+
BrowserCannotWriteSessionStorage: 4,
|
|
343
|
+
BrowserFailedRemovalFromLocalStorage: 5,
|
|
344
|
+
BrowserFailedRemovalFromSessionStorage: 6,
|
|
345
|
+
CannotSendEmptyTelemetry: 7,
|
|
346
|
+
ClientPerformanceMathError: 8,
|
|
347
|
+
ErrorParsingAISessionCookie: 9,
|
|
348
|
+
ErrorPVCalc: 10,
|
|
349
|
+
ExceptionWhileLoggingError: 11,
|
|
350
|
+
FailedAddingTelemetryToBuffer: 12,
|
|
351
|
+
FailedMonitorAjaxAbort: 13,
|
|
352
|
+
FailedMonitorAjaxDur: 14,
|
|
353
|
+
FailedMonitorAjaxOpen: 15,
|
|
354
|
+
FailedMonitorAjaxRSC: 16,
|
|
355
|
+
FailedMonitorAjaxSend: 17,
|
|
356
|
+
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
357
|
+
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
358
|
+
FailedToSendQueuedTelemetry: 20,
|
|
359
|
+
FailedToReportDataLoss: 21,
|
|
360
|
+
FlushFailed: 22,
|
|
361
|
+
MessageLimitPerPVExceeded: 23,
|
|
362
|
+
MissingRequiredFieldSpecification: 24,
|
|
363
|
+
NavigationTimingNotSupported: 25,
|
|
364
|
+
OnError: 26,
|
|
365
|
+
SessionRenewalDateIsZero: 27,
|
|
366
|
+
SenderNotInitialized: 28,
|
|
367
|
+
StartTrackEventFailed: 29,
|
|
368
|
+
StopTrackEventFailed: 30,
|
|
369
|
+
StartTrackFailed: 31,
|
|
370
|
+
StopTrackFailed: 32,
|
|
371
|
+
TelemetrySampledAndNotSent: 33,
|
|
372
|
+
TrackEventFailed: 34,
|
|
373
|
+
TrackExceptionFailed: 35,
|
|
374
|
+
TrackMetricFailed: 36,
|
|
375
|
+
TrackPVFailed: 37,
|
|
376
|
+
TrackPVFailedCalc: 38,
|
|
377
|
+
TrackTraceFailed: 39,
|
|
378
|
+
TransmissionFailed: 40,
|
|
379
|
+
FailedToSetStorageBuffer: 41,
|
|
380
|
+
FailedToRestoreStorageBuffer: 42,
|
|
381
|
+
InvalidBackendResponse: 43,
|
|
382
|
+
FailedToFixDepricatedValues: 44,
|
|
383
|
+
InvalidDurationValue: 45,
|
|
384
|
+
TelemetryEnvelopeInvalid: 46,
|
|
385
|
+
CreateEnvelopeError: 47,
|
|
386
|
+
CannotSerializeObject: 48,
|
|
387
|
+
CannotSerializeObjectNonSerializable: 49,
|
|
388
|
+
CircularReferenceDetected: 50,
|
|
389
|
+
ClearAuthContextFailed: 51,
|
|
390
|
+
ExceptionTruncated: 52,
|
|
391
|
+
IllegalCharsInName: 53,
|
|
392
|
+
ItemNotInArray: 54,
|
|
393
|
+
MaxAjaxPerPVExceeded: 55,
|
|
394
|
+
MessageTruncated: 56,
|
|
395
|
+
NameTooLong: 57,
|
|
396
|
+
SampleRateOutOfRange: 58,
|
|
397
|
+
SetAuthContextFailed: 59,
|
|
398
|
+
SetAuthContextFailedAccountName: 60,
|
|
399
|
+
StringValueTooLong: 61,
|
|
400
|
+
StartCalledMoreThanOnce: 62,
|
|
401
|
+
StopCalledWithoutStart: 63,
|
|
402
|
+
TelemetryInitializerFailed: 64,
|
|
403
|
+
TrackArgumentsNotSpecified: 65,
|
|
404
|
+
UrlTooLong: 66,
|
|
405
|
+
SessionStorageBufferFull: 67,
|
|
406
|
+
CannotAccessCookie: 68,
|
|
407
|
+
IdTooLong: 69,
|
|
408
|
+
InvalidEvent: 70,
|
|
409
|
+
FailedMonitorAjaxSetRequestHeader: 71,
|
|
410
|
+
SendBrowserInfoOnUserInit: 72,
|
|
411
|
+
PluginException: 73,
|
|
412
|
+
NotificationException: 74,
|
|
413
|
+
SnippetScriptLoadFailure: 99,
|
|
414
|
+
InvalidInstrumentationKey: 100,
|
|
415
|
+
CannotParseAiBlobValue: 101,
|
|
416
|
+
InvalidContentBlob: 102,
|
|
417
|
+
TrackPageActionEventFailed: 103,
|
|
418
|
+
FailedAddingCustomDefinedRequestContext: 104,
|
|
419
|
+
InMemoryStorageBufferFull: 105
|
|
420
|
+
};
|
|
337
421
|
|
|
422
|
+
var strOnPrefix = "on";
|
|
423
|
+
var strAttachEvent = "attachEvent";
|
|
424
|
+
var strAddEventHelper = "addEventListener";
|
|
338
425
|
var strToISOString = "toISOString";
|
|
339
426
|
var cStrEndsWith = "endsWith";
|
|
340
427
|
var strIndexOf = "indexOf";
|
|
@@ -344,8 +431,7 @@
|
|
|
344
431
|
var strToString = "toString";
|
|
345
432
|
var str__Proto = "__proto__";
|
|
346
433
|
var strConstructor$1 = "constructor";
|
|
347
|
-
var _objDefineProperty
|
|
348
|
-
var _objFreeze = ObjClass.freeze;
|
|
434
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
349
435
|
var _objKeys = ObjClass.keys;
|
|
350
436
|
var StringProto = String[strShimPrototype];
|
|
351
437
|
var _strTrim = StringProto[cStrTrim];
|
|
@@ -355,10 +441,7 @@
|
|
|
355
441
|
var _isArray = Array.isArray;
|
|
356
442
|
var _objToString = ObjProto[strToString];
|
|
357
443
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
358
|
-
|
|
359
|
-
var rCamelCase = /-([a-z])/g;
|
|
360
|
-
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
361
|
-
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
444
|
+
_fnToString.call(ObjClass);
|
|
362
445
|
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
363
446
|
function _getObjProto(target) {
|
|
364
447
|
if (target) {
|
|
@@ -372,9 +455,6 @@
|
|
|
372
455
|
}
|
|
373
456
|
return null;
|
|
374
457
|
}
|
|
375
|
-
function objToString(obj) {
|
|
376
|
-
return _objToString.call(obj);
|
|
377
|
-
}
|
|
378
458
|
function isTypeof(value, theType) {
|
|
379
459
|
return typeof value === theType;
|
|
380
460
|
}
|
|
@@ -396,18 +476,24 @@
|
|
|
396
476
|
function isFunction(value) {
|
|
397
477
|
return !!(value && typeof value === strShimFunction);
|
|
398
478
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
479
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
480
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
481
|
+
var result = false;
|
|
482
|
+
if (!isNullOrUndefined(obj)) {
|
|
483
|
+
try {
|
|
484
|
+
if (!isNullOrUndefined(obj[strAddEventHelper])) {
|
|
485
|
+
obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);
|
|
486
|
+
result = true;
|
|
487
|
+
}
|
|
488
|
+
else if (!isNullOrUndefined(obj[strAttachEvent])) {
|
|
489
|
+
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
490
|
+
result = true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
catch (e) {
|
|
494
|
+
}
|
|
409
495
|
}
|
|
410
|
-
return
|
|
496
|
+
return result;
|
|
411
497
|
}
|
|
412
498
|
function objForEachKey(target, callbackfn) {
|
|
413
499
|
if (target) {
|
|
@@ -469,22 +555,6 @@
|
|
|
469
555
|
function isSymbol(value) {
|
|
470
556
|
return typeof value === "symbol";
|
|
471
557
|
}
|
|
472
|
-
function isPlainObject(value) {
|
|
473
|
-
var result = false;
|
|
474
|
-
if (value && typeof value === "object") {
|
|
475
|
-
var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
|
|
476
|
-
if (!proto) {
|
|
477
|
-
result = true;
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
if (proto[strConstructor$1] && ObjHasOwnProperty.call(proto, strConstructor$1)) {
|
|
481
|
-
proto = proto[strConstructor$1];
|
|
482
|
-
}
|
|
483
|
-
result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
return result;
|
|
487
|
-
}
|
|
488
558
|
function toISOString(date) {
|
|
489
559
|
if (date) {
|
|
490
560
|
return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date);
|
|
@@ -630,7 +700,7 @@
|
|
|
630
700
|
return result;
|
|
631
701
|
}
|
|
632
702
|
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
633
|
-
if (_objDefineProperty
|
|
703
|
+
if (_objDefineProperty) {
|
|
634
704
|
try {
|
|
635
705
|
var descriptor = {
|
|
636
706
|
enumerable: true,
|
|
@@ -642,7 +712,7 @@
|
|
|
642
712
|
if (setProp) {
|
|
643
713
|
descriptor.set = setProp;
|
|
644
714
|
}
|
|
645
|
-
_objDefineProperty
|
|
715
|
+
_objDefineProperty(target, prop, descriptor);
|
|
646
716
|
return true;
|
|
647
717
|
}
|
|
648
718
|
catch (e) {
|
|
@@ -650,10 +720,6 @@
|
|
|
650
720
|
}
|
|
651
721
|
return false;
|
|
652
722
|
}
|
|
653
|
-
function _doNothing(value) {
|
|
654
|
-
return value;
|
|
655
|
-
}
|
|
656
|
-
var objFreeze = _objFreeze || _doNothing;
|
|
657
723
|
function dateNow() {
|
|
658
724
|
var dt = Date;
|
|
659
725
|
return dt.now ? dt.now() : new dt().getTime();
|
|
@@ -662,7 +728,7 @@
|
|
|
662
728
|
if (isError(object)) {
|
|
663
729
|
return object.name;
|
|
664
730
|
}
|
|
665
|
-
return
|
|
731
|
+
return "";
|
|
666
732
|
}
|
|
667
733
|
function setValue(target, field, value, valChk, srcChk) {
|
|
668
734
|
var theValue = value;
|
|
@@ -678,91 +744,6 @@
|
|
|
678
744
|
function isTruthy(value) {
|
|
679
745
|
return !!value;
|
|
680
746
|
}
|
|
681
|
-
function throwError(message) {
|
|
682
|
-
throw new Error(message);
|
|
683
|
-
}
|
|
684
|
-
function _createProxyFunction(source, funcName) {
|
|
685
|
-
var srcFunc = null;
|
|
686
|
-
var src = null;
|
|
687
|
-
if (isFunction(source)) {
|
|
688
|
-
srcFunc = source;
|
|
689
|
-
}
|
|
690
|
-
else {
|
|
691
|
-
src = source;
|
|
692
|
-
}
|
|
693
|
-
return function () {
|
|
694
|
-
var originalArguments = arguments;
|
|
695
|
-
if (srcFunc) {
|
|
696
|
-
src = srcFunc();
|
|
697
|
-
}
|
|
698
|
-
if (src) {
|
|
699
|
-
return src[funcName].apply(src, originalArguments);
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
704
|
-
if (overwriteTarget === void 0) { overwriteTarget = true; }
|
|
705
|
-
if (target && name && source) {
|
|
706
|
-
if (overwriteTarget || isUndefined(target[name])) {
|
|
707
|
-
target[name] = _createProxyFunction(source, theFunc);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
function createEnumStyle(values) {
|
|
712
|
-
var enumClass = {};
|
|
713
|
-
objForEachKey(values, function (field, value) {
|
|
714
|
-
enumClass[field] = value;
|
|
715
|
-
if (!isUndefined(enumClass[value])) {
|
|
716
|
-
throwError("[" + value + "] exists for " + field);
|
|
717
|
-
}
|
|
718
|
-
enumClass[value] = field;
|
|
719
|
-
});
|
|
720
|
-
return objFreeze(enumClass);
|
|
721
|
-
}
|
|
722
|
-
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
723
|
-
var theArgs = arguments;
|
|
724
|
-
var extended = theArgs[0] || {};
|
|
725
|
-
var argLen = theArgs.length;
|
|
726
|
-
var deep = false;
|
|
727
|
-
var idx = 1;
|
|
728
|
-
if (argLen > 0 && isBoolean(extended)) {
|
|
729
|
-
deep = extended;
|
|
730
|
-
extended = theArgs[idx] || {};
|
|
731
|
-
idx++;
|
|
732
|
-
}
|
|
733
|
-
if (!isObject(extended)) {
|
|
734
|
-
extended = {};
|
|
735
|
-
}
|
|
736
|
-
for (; idx < argLen; idx++) {
|
|
737
|
-
var arg = theArgs[idx];
|
|
738
|
-
var isArgArray = isArray(arg);
|
|
739
|
-
var isArgObj = isObject(arg);
|
|
740
|
-
for (var prop in arg) {
|
|
741
|
-
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
|
|
742
|
-
if (!propOk) {
|
|
743
|
-
continue;
|
|
744
|
-
}
|
|
745
|
-
var newValue = arg[prop];
|
|
746
|
-
var isNewArray = void 0;
|
|
747
|
-
if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
|
|
748
|
-
var clone = extended[prop];
|
|
749
|
-
if (isNewArray) {
|
|
750
|
-
if (!isArray(clone)) {
|
|
751
|
-
clone = [];
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
else if (!isPlainObject(clone)) {
|
|
755
|
-
clone = {};
|
|
756
|
-
}
|
|
757
|
-
newValue = objExtend(deep, clone, newValue);
|
|
758
|
-
}
|
|
759
|
-
if (newValue !== undefined) {
|
|
760
|
-
extended[prop] = newValue;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
return extended;
|
|
765
|
-
}
|
|
766
747
|
|
|
767
748
|
var strWindow = "window";
|
|
768
749
|
var strDocument = "document";
|
|
@@ -857,7 +838,7 @@
|
|
|
857
838
|
var nav = getNavigator();
|
|
858
839
|
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
859
840
|
_navUserAgentCheck = nav.userAgent;
|
|
860
|
-
var userAgent = (_navUserAgentCheck ||
|
|
841
|
+
var userAgent = (_navUserAgentCheck || "").toLowerCase();
|
|
861
842
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
862
843
|
}
|
|
863
844
|
return _isTrident;
|
|
@@ -866,9 +847,9 @@
|
|
|
866
847
|
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
867
848
|
if (!userAgentStr) {
|
|
868
849
|
var navigator_1 = getNavigator() || {};
|
|
869
|
-
userAgentStr = navigator_1 ? (navigator_1.userAgent ||
|
|
850
|
+
userAgentStr = navigator_1 ? (navigator_1.userAgent || "").toLowerCase() : "";
|
|
870
851
|
}
|
|
871
|
-
var ua = (userAgentStr ||
|
|
852
|
+
var ua = (userAgentStr || "").toLowerCase();
|
|
872
853
|
if (strContains(ua, strMsie)) {
|
|
873
854
|
var doc = getDocument() || {};
|
|
874
855
|
return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
@@ -883,7 +864,7 @@
|
|
|
883
864
|
}
|
|
884
865
|
function dumpObj(object) {
|
|
885
866
|
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
886
|
-
var propertyValueDump =
|
|
867
|
+
var propertyValueDump = "";
|
|
887
868
|
if (objectTypeDump === "[object Error]") {
|
|
888
869
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
889
870
|
}
|
|
@@ -922,9 +903,9 @@
|
|
|
922
903
|
var strWarnToConsole = "warnToConsole";
|
|
923
904
|
function _sanitizeDiagnosticText(text) {
|
|
924
905
|
if (text) {
|
|
925
|
-
return "\"" + text.replace(/\"/g,
|
|
906
|
+
return "\"" + text.replace(/\"/g, "") + "\"";
|
|
926
907
|
}
|
|
927
|
-
return
|
|
908
|
+
return "";
|
|
928
909
|
}
|
|
929
910
|
function _logToConsole(func, message) {
|
|
930
911
|
var theConsole = getConsole();
|
|
@@ -946,12 +927,12 @@
|
|
|
946
927
|
_self.message =
|
|
947
928
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
948
929
|
msgId;
|
|
949
|
-
var strProps =
|
|
930
|
+
var strProps = "";
|
|
950
931
|
if (hasJSON()) {
|
|
951
932
|
strProps = getJSON().stringify(properties);
|
|
952
933
|
}
|
|
953
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
954
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
934
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : "") +
|
|
935
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : "");
|
|
955
936
|
_self.message += diagnosticText;
|
|
956
937
|
}
|
|
957
938
|
_InternalLogMessage.dataType = "MessageData";
|
|
@@ -978,10 +959,10 @@
|
|
|
978
959
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
979
960
|
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
980
961
|
if (_self.enableDebugExceptions()) {
|
|
981
|
-
throw message;
|
|
962
|
+
throw dumpObj(message);
|
|
982
963
|
}
|
|
983
964
|
else {
|
|
984
|
-
var logFunc = severity ===
|
|
965
|
+
var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
|
985
966
|
if (!isUndefined(message.message)) {
|
|
986
967
|
var logLevel = _self.consoleLoggingLevel();
|
|
987
968
|
if (isUserAct) {
|
|
@@ -999,7 +980,7 @@
|
|
|
999
980
|
_self.logInternalMessage(severity, message);
|
|
1000
981
|
}
|
|
1001
982
|
else {
|
|
1002
|
-
_debugExtMsg("throw" + (severity ===
|
|
983
|
+
_debugExtMsg("throw" + (severity === LoggingSeverity.CRITICAL ? "Critical" : "Warning"), message);
|
|
1003
984
|
}
|
|
1004
985
|
}
|
|
1005
986
|
};
|
|
@@ -1031,13 +1012,13 @@
|
|
|
1031
1012
|
if (severity <= _self.telemetryLoggingLevel()) {
|
|
1032
1013
|
_self.queue.push(message);
|
|
1033
1014
|
_messageCount++;
|
|
1034
|
-
_debugExtMsg((severity ===
|
|
1015
|
+
_debugExtMsg((severity === LoggingSeverity.CRITICAL ? "error" : "warn"), message);
|
|
1035
1016
|
}
|
|
1036
1017
|
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
1037
1018
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1038
|
-
var throttleMessage = new _InternalLogMessage(
|
|
1019
|
+
var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
|
|
1039
1020
|
_self.queue.push(throttleMessage);
|
|
1040
|
-
if (severity ===
|
|
1021
|
+
if (severity === LoggingSeverity.CRITICAL) {
|
|
1041
1022
|
_self.errorToConsole(throttleLimitMessage);
|
|
1042
1023
|
}
|
|
1043
1024
|
else {
|
|
@@ -1066,10 +1047,6 @@
|
|
|
1066
1047
|
}
|
|
1067
1048
|
return DiagnosticLogger;
|
|
1068
1049
|
}());
|
|
1069
|
-
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1070
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
1071
|
-
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1072
|
-
}
|
|
1073
1050
|
|
|
1074
1051
|
var strExecutionContextKey = "ctx";
|
|
1075
1052
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1183,509 +1160,252 @@
|
|
|
1183
1160
|
return func();
|
|
1184
1161
|
}
|
|
1185
1162
|
|
|
1186
|
-
var
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
function randomValue(maxValue) {
|
|
1208
|
-
if (maxValue > 0) {
|
|
1209
|
-
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
1210
|
-
}
|
|
1211
|
-
return 0;
|
|
1212
|
-
}
|
|
1213
|
-
function random32(signed) {
|
|
1214
|
-
var value = 0;
|
|
1215
|
-
var c = getCrypto() || getMsCrypto();
|
|
1216
|
-
if (c && c.getRandomValues) {
|
|
1217
|
-
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
1218
|
-
}
|
|
1219
|
-
if (value === 0 && isIE()) {
|
|
1220
|
-
if (!_mwcSeeded) {
|
|
1221
|
-
_autoSeedMwc();
|
|
1222
|
-
}
|
|
1223
|
-
value = mwcRandom32() & MaxUInt32;
|
|
1224
|
-
}
|
|
1225
|
-
if (value === 0) {
|
|
1226
|
-
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
1227
|
-
}
|
|
1228
|
-
if (!signed) {
|
|
1229
|
-
value >>>= 0;
|
|
1230
|
-
}
|
|
1231
|
-
return value;
|
|
1232
|
-
}
|
|
1233
|
-
function mwcRandomSeed(value) {
|
|
1234
|
-
if (!value) {
|
|
1235
|
-
_autoSeedMwc();
|
|
1236
|
-
}
|
|
1237
|
-
else {
|
|
1238
|
-
_mwcSeed(value);
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
function mwcRandom32(signed) {
|
|
1242
|
-
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1243
|
-
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
1244
|
-
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
1245
|
-
if (!signed) {
|
|
1246
|
-
value >>>= 0;
|
|
1247
|
-
}
|
|
1248
|
-
return value;
|
|
1249
|
-
}
|
|
1250
|
-
function newId(maxLength) {
|
|
1251
|
-
if (maxLength === void 0) { maxLength = 22; }
|
|
1252
|
-
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1253
|
-
var number = random32() >>> 0;
|
|
1254
|
-
var chars = 0;
|
|
1255
|
-
var result = strEmpty$1;
|
|
1256
|
-
while (result.length < maxLength) {
|
|
1257
|
-
chars++;
|
|
1258
|
-
result += base64chars.charAt(number & 0x3F);
|
|
1259
|
-
number >>>= 6;
|
|
1260
|
-
if (chars === 5) {
|
|
1261
|
-
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1262
|
-
chars = 0;
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
return result;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
1269
|
-
var version = "2.7.5-nightly.2204-03";
|
|
1270
|
-
var instanceName = "." + newId(6);
|
|
1271
|
-
var _dataUid = 0;
|
|
1272
|
-
function _createAccessor(target, prop, value) {
|
|
1273
|
-
if (_objDefineProperty) {
|
|
1274
|
-
try {
|
|
1275
|
-
_objDefineProperty(target, prop, {
|
|
1276
|
-
value: value,
|
|
1277
|
-
enumerable: false,
|
|
1278
|
-
configurable: true
|
|
1279
|
-
});
|
|
1280
|
-
return true;
|
|
1281
|
-
}
|
|
1282
|
-
catch (e) {
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
return false;
|
|
1286
|
-
}
|
|
1287
|
-
function _canAcceptData(target) {
|
|
1288
|
-
return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
|
|
1289
|
-
}
|
|
1290
|
-
function _getCache(data, target) {
|
|
1291
|
-
var theCache = target[data.id];
|
|
1292
|
-
if (!theCache) {
|
|
1293
|
-
theCache = {};
|
|
1294
|
-
try {
|
|
1295
|
-
if (_canAcceptData(target)) {
|
|
1296
|
-
if (!_createAccessor(target, data.id, theCache)) {
|
|
1297
|
-
target[data.id] = theCache;
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
catch (e) {
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
return theCache;
|
|
1305
|
-
}
|
|
1306
|
-
function createUniqueNamespace(name, includeVersion) {
|
|
1307
|
-
if (includeVersion === void 0) { includeVersion = false; }
|
|
1308
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
|
|
1309
|
-
}
|
|
1310
|
-
function createElmNodeData(name) {
|
|
1311
|
-
var data = {
|
|
1312
|
-
id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
|
|
1313
|
-
accept: function (target) {
|
|
1314
|
-
return _canAcceptData(target);
|
|
1315
|
-
},
|
|
1316
|
-
get: function (target, name, defValue, addDefault) {
|
|
1317
|
-
var theCache = target[data.id];
|
|
1318
|
-
if (!theCache) {
|
|
1319
|
-
if (addDefault) {
|
|
1320
|
-
theCache = _getCache(data, target);
|
|
1321
|
-
theCache[normalizeJsName(name)] = defValue;
|
|
1322
|
-
}
|
|
1323
|
-
return defValue;
|
|
1324
|
-
}
|
|
1325
|
-
return theCache[normalizeJsName(name)];
|
|
1326
|
-
},
|
|
1327
|
-
kill: function (target, name) {
|
|
1328
|
-
if (target && target[name]) {
|
|
1329
|
-
try {
|
|
1330
|
-
delete target[name];
|
|
1331
|
-
}
|
|
1332
|
-
catch (e) {
|
|
1333
|
-
}
|
|
1163
|
+
var TelemetryPluginChain = /** @class */ (function () {
|
|
1164
|
+
function TelemetryPluginChain(plugin, defItemCtx) {
|
|
1165
|
+
var _self = this;
|
|
1166
|
+
var _nextProxy = null;
|
|
1167
|
+
var _hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
1168
|
+
var _hasSetNext = isFunction(plugin.setNextPlugin);
|
|
1169
|
+
_self._hasRun = false;
|
|
1170
|
+
_self.getPlugin = function () {
|
|
1171
|
+
return plugin;
|
|
1172
|
+
};
|
|
1173
|
+
_self.getNext = function () {
|
|
1174
|
+
return _nextProxy;
|
|
1175
|
+
};
|
|
1176
|
+
_self.setNext = function (nextPlugin) {
|
|
1177
|
+
_nextProxy = nextPlugin;
|
|
1178
|
+
};
|
|
1179
|
+
_self.processTelemetry = function (env, itemCtx) {
|
|
1180
|
+
if (!itemCtx) {
|
|
1181
|
+
itemCtx = defItemCtx;
|
|
1334
1182
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
var pluginStateData = createElmNodeData("plugin");
|
|
1341
|
-
function _getPluginState(plugin) {
|
|
1342
|
-
return pluginStateData.get(plugin, "state", {}, true);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
1346
|
-
var strHasRunFlags = "_hasRun";
|
|
1347
|
-
var strGetTelCtx = "_getTelCtx";
|
|
1348
|
-
var _chainId = 0;
|
|
1349
|
-
function _getNextProxyStart(proxy, config, core, startAt) {
|
|
1350
|
-
while (proxy) {
|
|
1351
|
-
if (proxy.getPlugin() === startAt) {
|
|
1352
|
-
return proxy;
|
|
1353
|
-
}
|
|
1354
|
-
proxy = proxy.getNext();
|
|
1355
|
-
}
|
|
1356
|
-
return createTelemetryProxyChain([startAt], config, core);
|
|
1357
|
-
}
|
|
1358
|
-
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
1359
|
-
var _nextProxy = null;
|
|
1360
|
-
var _onComplete = [];
|
|
1361
|
-
if (startAt !== null) {
|
|
1362
|
-
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, config, core, startAt) : telemetryChain;
|
|
1363
|
-
}
|
|
1364
|
-
var context = {
|
|
1365
|
-
_next: _moveNext,
|
|
1366
|
-
ctx: {
|
|
1367
|
-
core: function () {
|
|
1368
|
-
return core;
|
|
1369
|
-
},
|
|
1370
|
-
diagLog: function () {
|
|
1371
|
-
return safeGetLogger(core, config);
|
|
1372
|
-
},
|
|
1373
|
-
getCfg: function () {
|
|
1374
|
-
return config;
|
|
1375
|
-
},
|
|
1376
|
-
getExtCfg: _getExtCfg,
|
|
1377
|
-
getConfig: _getConfig,
|
|
1378
|
-
hasNext: function () {
|
|
1379
|
-
return !!_nextProxy;
|
|
1380
|
-
},
|
|
1381
|
-
getNext: function () {
|
|
1382
|
-
return _nextProxy;
|
|
1383
|
-
},
|
|
1384
|
-
setNext: function (nextPlugin) {
|
|
1385
|
-
_nextProxy = nextPlugin;
|
|
1386
|
-
},
|
|
1387
|
-
iterate: _iterateChain,
|
|
1388
|
-
onComplete: _addOnComplete
|
|
1389
|
-
}
|
|
1390
|
-
};
|
|
1391
|
-
function _addOnComplete(onComplete, that) {
|
|
1392
|
-
var args = [];
|
|
1393
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1394
|
-
args[_i - 2] = arguments[_i];
|
|
1395
|
-
}
|
|
1396
|
-
if (onComplete) {
|
|
1397
|
-
_onComplete.push({
|
|
1398
|
-
func: onComplete,
|
|
1399
|
-
self: !isUndefined(that) ? that : context.ctx,
|
|
1400
|
-
args: args
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
function _moveNext() {
|
|
1405
|
-
var nextProxy = _nextProxy;
|
|
1406
|
-
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1407
|
-
if (!nextProxy) {
|
|
1408
|
-
var onComplete = _onComplete;
|
|
1409
|
-
if (onComplete && onComplete.length > 0) {
|
|
1410
|
-
arrForEach(onComplete, function (completeDetails) {
|
|
1183
|
+
var identifier = plugin ? plugin.identifier : "TelemetryPluginChain";
|
|
1184
|
+
doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + ":processTelemetry"; }, function () {
|
|
1185
|
+
if (plugin && _hasProcessTelemetry) {
|
|
1186
|
+
_self._hasRun = true;
|
|
1411
1187
|
try {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1188
|
+
itemCtx.setNext(_nextProxy);
|
|
1189
|
+
if (_hasSetNext) {
|
|
1190
|
+
plugin.setNextPlugin(_nextProxy);
|
|
1191
|
+
}
|
|
1192
|
+
_nextProxy && (_nextProxy._hasRun = false);
|
|
1193
|
+
plugin.processTelemetry(env, itemCtx);
|
|
1416
1194
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
return nextProxy;
|
|
1422
|
-
}
|
|
1423
|
-
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
1424
|
-
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1425
|
-
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
1426
|
-
var theConfig;
|
|
1427
|
-
if (config) {
|
|
1428
|
-
var extConfig = config.extensionConfig;
|
|
1429
|
-
if (extConfig && identifier) {
|
|
1430
|
-
theConfig = extConfig[identifier];
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
if (!theConfig) {
|
|
1434
|
-
theConfig = defaultValue;
|
|
1435
|
-
}
|
|
1436
|
-
else if (isObject(defaultValue)) {
|
|
1437
|
-
if (mergeDefault !== 0 ) {
|
|
1438
|
-
var newConfig_1 = objExtend(true, defaultValue, theConfig);
|
|
1439
|
-
if (config && mergeDefault === 2 ) {
|
|
1440
|
-
objForEachKey(defaultValue, function (field) {
|
|
1441
|
-
if (isNullOrUndefined(newConfig_1[field])) {
|
|
1442
|
-
var cfgValue = config[field];
|
|
1443
|
-
if (!isNullOrUndefined(cfgValue)) {
|
|
1444
|
-
newConfig_1[field] = cfgValue;
|
|
1445
|
-
}
|
|
1195
|
+
catch (error) {
|
|
1196
|
+
var hasRun = _nextProxy && _nextProxy._hasRun;
|
|
1197
|
+
if (!_nextProxy || !hasRun) {
|
|
1198
|
+
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
|
|
1446
1199
|
}
|
|
1447
|
-
|
|
1200
|
+
if (_nextProxy && !hasRun) {
|
|
1201
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1448
1204
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
var theValue;
|
|
1456
|
-
var extConfig = _getExtCfg(identifier, null);
|
|
1457
|
-
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1458
|
-
theValue = extConfig[field];
|
|
1459
|
-
}
|
|
1460
|
-
else if (config && !isNullOrUndefined(config[field])) {
|
|
1461
|
-
theValue = config[field];
|
|
1462
|
-
}
|
|
1463
|
-
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1205
|
+
else if (_nextProxy) {
|
|
1206
|
+
_self._hasRun = true;
|
|
1207
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1208
|
+
}
|
|
1209
|
+
}, function () { return ({ item: env }); }, !(env.sync));
|
|
1210
|
+
};
|
|
1464
1211
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1212
|
+
return TelemetryPluginChain;
|
|
1213
|
+
}());
|
|
1214
|
+
|
|
1215
|
+
function _createProxyChain(plugins, itemCtx) {
|
|
1216
|
+
var proxies = [];
|
|
1217
|
+
if (plugins && plugins.length > 0) {
|
|
1218
|
+
var lastProxy = null;
|
|
1219
|
+
for (var idx = 0; idx < plugins.length; idx++) {
|
|
1220
|
+
var thePlugin = plugins[idx];
|
|
1221
|
+
if (thePlugin && isFunction(thePlugin.processTelemetry)) {
|
|
1222
|
+
var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);
|
|
1223
|
+
proxies.push(newProxy);
|
|
1224
|
+
if (lastProxy) {
|
|
1225
|
+
lastProxy.setNext(newProxy);
|
|
1226
|
+
}
|
|
1227
|
+
lastProxy = newProxy;
|
|
1471
1228
|
}
|
|
1472
1229
|
}
|
|
1473
1230
|
}
|
|
1474
|
-
return
|
|
1231
|
+
return proxies.length > 0 ? proxies[0] : null;
|
|
1475
1232
|
}
|
|
1476
|
-
function
|
|
1477
|
-
var
|
|
1478
|
-
var
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1233
|
+
function _copyProxyChain(proxy, itemCtx, startAt) {
|
|
1234
|
+
var plugins = [];
|
|
1235
|
+
var add = startAt ? false : true;
|
|
1236
|
+
if (proxy) {
|
|
1237
|
+
while (proxy) {
|
|
1238
|
+
var thePlugin = proxy.getPlugin();
|
|
1239
|
+
if (add || thePlugin === startAt) {
|
|
1240
|
+
add = true;
|
|
1241
|
+
plugins.push(thePlugin);
|
|
1242
|
+
}
|
|
1243
|
+
proxy = proxy.getNext();
|
|
1488
1244
|
}
|
|
1489
|
-
return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt);
|
|
1490
|
-
}
|
|
1491
|
-
context.processNext = _processNext;
|
|
1492
|
-
context.createNew = _createNew;
|
|
1493
|
-
return context;
|
|
1494
|
-
}
|
|
1495
|
-
function createProcessTelemetryUnloadContext(telemetryChain, config, core, startAt) {
|
|
1496
|
-
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1497
|
-
var context = internalContext.ctx;
|
|
1498
|
-
function _processNext(unloadState) {
|
|
1499
|
-
var nextPlugin = internalContext._next();
|
|
1500
|
-
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
1501
|
-
return !nextPlugin;
|
|
1502
1245
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
if (isArray(plugins)) {
|
|
1506
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1507
|
-
}
|
|
1508
|
-
return createProcessTelemetryUnloadContext(plugins || context.getNext(), config, core, startAt);
|
|
1246
|
+
if (!add) {
|
|
1247
|
+
plugins.push(startAt);
|
|
1509
1248
|
}
|
|
1510
|
-
|
|
1511
|
-
context.createNew = _createNew;
|
|
1512
|
-
return context;
|
|
1249
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1513
1250
|
}
|
|
1514
|
-
function
|
|
1515
|
-
var
|
|
1516
|
-
var
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1251
|
+
function _copyPluginChain(srcPlugins, itemCtx, startAt) {
|
|
1252
|
+
var plugins = srcPlugins;
|
|
1253
|
+
var add = false;
|
|
1254
|
+
if (startAt && srcPlugins) {
|
|
1255
|
+
plugins = [];
|
|
1256
|
+
arrForEach(srcPlugins, function (thePlugin) {
|
|
1257
|
+
if (add || thePlugin === startAt) {
|
|
1258
|
+
add = true;
|
|
1259
|
+
plugins.push(thePlugin);
|
|
1521
1260
|
}
|
|
1522
1261
|
});
|
|
1523
1262
|
}
|
|
1524
|
-
|
|
1525
|
-
if (plugins
|
|
1526
|
-
|
|
1527
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1263
|
+
if (startAt && !add) {
|
|
1264
|
+
if (!plugins) {
|
|
1265
|
+
plugins = [];
|
|
1528
1266
|
}
|
|
1529
|
-
|
|
1267
|
+
plugins.push(startAt);
|
|
1530
1268
|
}
|
|
1531
|
-
|
|
1532
|
-
context.createNew = _createNew;
|
|
1533
|
-
return context;
|
|
1269
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1534
1270
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
add = true;
|
|
1271
|
+
var ProcessTelemetryContext = /** @class */ (function () {
|
|
1272
|
+
function ProcessTelemetryContext(plugins, config, core, startAt) {
|
|
1273
|
+
var _self = this;
|
|
1274
|
+
var _nextProxy = null;
|
|
1275
|
+
if (startAt !== null) {
|
|
1276
|
+
if (plugins && isFunction(plugins.getPlugin)) {
|
|
1277
|
+
_nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());
|
|
1543
1278
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
firstProxy = newProxy;
|
|
1279
|
+
else {
|
|
1280
|
+
if (startAt) {
|
|
1281
|
+
_nextProxy = _copyPluginChain(plugins, _self, startAt);
|
|
1548
1282
|
}
|
|
1549
|
-
if (
|
|
1550
|
-
|
|
1283
|
+
else if (isUndefined(startAt)) {
|
|
1284
|
+
_nextProxy = _createProxyChain(plugins, _self);
|
|
1551
1285
|
}
|
|
1552
|
-
lastProxy_1 = newProxy;
|
|
1553
1286
|
}
|
|
1554
|
-
});
|
|
1555
|
-
}
|
|
1556
|
-
if (startAt && !firstProxy) {
|
|
1557
|
-
return createTelemetryProxyChain([startAt], config, core);
|
|
1558
|
-
}
|
|
1559
|
-
return firstProxy;
|
|
1560
|
-
}
|
|
1561
|
-
function createTelemetryPluginProxy(plugin, config, core) {
|
|
1562
|
-
var nextProxy = null;
|
|
1563
|
-
var hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
1564
|
-
var hasSetNext = isFunction(plugin.setNextPlugin);
|
|
1565
|
-
var chainId;
|
|
1566
|
-
if (plugin) {
|
|
1567
|
-
chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++;
|
|
1568
|
-
}
|
|
1569
|
-
else {
|
|
1570
|
-
chainId = "Unknown-0-" + _chainId++;
|
|
1571
|
-
}
|
|
1572
|
-
var proxyChain = {
|
|
1573
|
-
getPlugin: function () {
|
|
1574
|
-
return plugin;
|
|
1575
|
-
},
|
|
1576
|
-
getNext: function () {
|
|
1577
|
-
return nextProxy;
|
|
1578
|
-
},
|
|
1579
|
-
processTelemetry: _processTelemetry,
|
|
1580
|
-
unload: _unloadPlugin,
|
|
1581
|
-
update: _updatePlugin,
|
|
1582
|
-
_id: chainId,
|
|
1583
|
-
_setNext: function (nextPlugin) {
|
|
1584
|
-
nextProxy = nextPlugin;
|
|
1585
1287
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1603
|
-
}
|
|
1604
|
-
itemCtx.setNext(nextProxy);
|
|
1605
|
-
if (plugin) {
|
|
1606
|
-
doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () {
|
|
1607
|
-
hasRunContext[chainId] = true;
|
|
1608
|
-
try {
|
|
1609
|
-
var nextId = nextProxy ? nextProxy._id : strEmpty$1;
|
|
1610
|
-
if (nextId) {
|
|
1611
|
-
hasRunContext[nextId] = false;
|
|
1612
|
-
}
|
|
1613
|
-
hasRun = processPluginFn(itemCtx);
|
|
1614
|
-
}
|
|
1615
|
-
catch (error) {
|
|
1616
|
-
var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;
|
|
1617
|
-
if (hasNextRun) {
|
|
1618
|
-
hasRun = true;
|
|
1619
|
-
}
|
|
1620
|
-
if (!nextProxy || !hasNextRun) {
|
|
1621
|
-
_throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1622
|
-
}
|
|
1288
|
+
_self.core = function () {
|
|
1289
|
+
return core;
|
|
1290
|
+
};
|
|
1291
|
+
_self.diagLog = function () {
|
|
1292
|
+
return safeGetLogger(core, config);
|
|
1293
|
+
};
|
|
1294
|
+
_self.getCfg = function () {
|
|
1295
|
+
return config;
|
|
1296
|
+
};
|
|
1297
|
+
_self.getExtCfg = function (identifier, defaultValue) {
|
|
1298
|
+
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1299
|
+
var theConfig;
|
|
1300
|
+
if (config) {
|
|
1301
|
+
var extConfig = config.extensionConfig;
|
|
1302
|
+
if (extConfig && identifier) {
|
|
1303
|
+
theConfig = extConfig[identifier];
|
|
1623
1304
|
}
|
|
1624
|
-
}, details, isAsync);
|
|
1625
|
-
}
|
|
1626
|
-
return hasRun;
|
|
1627
|
-
}
|
|
1628
|
-
function _processTelemetry(env, itemCtx) {
|
|
1629
|
-
itemCtx = itemCtx || _getTelCtx();
|
|
1630
|
-
function _callProcessTelemetry(itemCtx) {
|
|
1631
|
-
if (!plugin || !hasProcessTelemetry) {
|
|
1632
|
-
return false;
|
|
1633
1305
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1306
|
+
return (theConfig ? theConfig : defaultValue);
|
|
1307
|
+
};
|
|
1308
|
+
_self.getConfig = function (identifier, field, defaultValue) {
|
|
1309
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
1310
|
+
var theValue;
|
|
1311
|
+
var extConfig = _self.getExtCfg(identifier, null);
|
|
1312
|
+
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1313
|
+
theValue = extConfig[field];
|
|
1637
1314
|
}
|
|
1638
|
-
if (
|
|
1639
|
-
|
|
1315
|
+
else if (config && !isNullOrUndefined(config[field])) {
|
|
1316
|
+
theValue = config[field];
|
|
1640
1317
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
function
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
pluginState[strIsInitialized] = false;
|
|
1658
|
-
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1659
|
-
hasRun = true;
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1318
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1319
|
+
};
|
|
1320
|
+
_self.hasNext = function () {
|
|
1321
|
+
return _nextProxy != null;
|
|
1322
|
+
};
|
|
1323
|
+
_self.getNext = function () {
|
|
1324
|
+
return _nextProxy;
|
|
1325
|
+
};
|
|
1326
|
+
_self.setNext = function (nextPlugin) {
|
|
1327
|
+
_nextProxy = nextPlugin;
|
|
1328
|
+
};
|
|
1329
|
+
_self.processNext = function (env) {
|
|
1330
|
+
var nextPlugin = _nextProxy;
|
|
1331
|
+
if (nextPlugin) {
|
|
1332
|
+
_nextProxy = nextPlugin.getNext();
|
|
1333
|
+
nextPlugin.processTelemetry(env, _self);
|
|
1662
1334
|
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
}
|
|
1335
|
+
};
|
|
1336
|
+
_self.createNew = function (plugins, startAt) {
|
|
1337
|
+
if (plugins === void 0) { plugins = null; }
|
|
1338
|
+
return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1339
|
+
};
|
|
1668
1340
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1341
|
+
return ProcessTelemetryContext;
|
|
1342
|
+
}());
|
|
1343
|
+
|
|
1344
|
+
var strExtensionConfig = "extensionConfig";
|
|
1345
|
+
|
|
1346
|
+
var strGetPlugin = "getPlugin";
|
|
1347
|
+
var BaseTelemetryPlugin = /** @class */ (function () {
|
|
1348
|
+
function BaseTelemetryPlugin() {
|
|
1349
|
+
var _self = this;
|
|
1350
|
+
var _isinitialized = false;
|
|
1351
|
+
var _rootCtx = null;
|
|
1352
|
+
var _nextPlugin = null;
|
|
1353
|
+
_self.core = null;
|
|
1354
|
+
_self.diagLog = function (itemCtx) {
|
|
1355
|
+
return _self._getTelCtx(itemCtx).diagLog();
|
|
1356
|
+
};
|
|
1357
|
+
_self.isInitialized = function () {
|
|
1358
|
+
return _isinitialized;
|
|
1359
|
+
};
|
|
1360
|
+
_self.setInitialized = function (isInitialized) {
|
|
1361
|
+
_isinitialized = isInitialized;
|
|
1362
|
+
};
|
|
1363
|
+
_self.setNextPlugin = function (next) {
|
|
1364
|
+
_nextPlugin = next;
|
|
1365
|
+
};
|
|
1366
|
+
_self.processNext = function (env, itemCtx) {
|
|
1367
|
+
if (itemCtx) {
|
|
1368
|
+
itemCtx.processNext(env);
|
|
1369
|
+
}
|
|
1370
|
+
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
1371
|
+
_nextPlugin.processTelemetry(env, null);
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
_self._getTelCtx = function (currentCtx) {
|
|
1375
|
+
if (currentCtx === void 0) { currentCtx = null; }
|
|
1376
|
+
var itemCtx = currentCtx;
|
|
1377
|
+
if (!itemCtx) {
|
|
1378
|
+
var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);
|
|
1379
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1380
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
1679
1384
|
}
|
|
1680
1385
|
}
|
|
1681
|
-
return
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1386
|
+
return itemCtx;
|
|
1387
|
+
};
|
|
1388
|
+
_self._baseTelInit = function (config, core, extensions, pluginChain) {
|
|
1389
|
+
if (config) {
|
|
1390
|
+
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
1391
|
+
}
|
|
1392
|
+
if (!pluginChain && core) {
|
|
1393
|
+
pluginChain = core.getProcessTelContext().getNext();
|
|
1394
|
+
}
|
|
1395
|
+
var nextPlugin = _nextPlugin;
|
|
1396
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1397
|
+
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
1398
|
+
}
|
|
1399
|
+
_self.core = core;
|
|
1400
|
+
_rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
1401
|
+
_isinitialized = true;
|
|
1402
|
+
};
|
|
1686
1403
|
}
|
|
1687
|
-
|
|
1688
|
-
|
|
1404
|
+
BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
|
|
1405
|
+
this._baseTelInit(config, core, extensions, pluginChain);
|
|
1406
|
+
};
|
|
1407
|
+
return BaseTelemetryPlugin;
|
|
1408
|
+
}());
|
|
1689
1409
|
|
|
1690
1410
|
var strToGMTString = "toGMTString";
|
|
1691
1411
|
var strToUTCString = "toUTCString";
|
|
@@ -1695,6 +1415,7 @@
|
|
|
1695
1415
|
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1696
1416
|
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1697
1417
|
var strConfigCookieMgr = "_ckMgr";
|
|
1418
|
+
var strEmpty = "";
|
|
1698
1419
|
var _supportsCookies = null;
|
|
1699
1420
|
var _allowUaSameSite = null;
|
|
1700
1421
|
var _parsedCookieValue = null;
|
|
@@ -1752,7 +1473,7 @@
|
|
|
1752
1473
|
var result = false;
|
|
1753
1474
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1754
1475
|
var values = {};
|
|
1755
|
-
var theValue = strTrim(value || strEmpty
|
|
1476
|
+
var theValue = strTrim(value || strEmpty);
|
|
1756
1477
|
var idx = theValue.indexOf(";");
|
|
1757
1478
|
if (idx !== -1) {
|
|
1758
1479
|
theValue = strTrim(value.substring(0, idx));
|
|
@@ -1767,11 +1488,11 @@
|
|
|
1767
1488
|
if (expireMs > 0) {
|
|
1768
1489
|
var expiry = new Date();
|
|
1769
1490
|
expiry.setTime(expireMs);
|
|
1770
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty
|
|
1491
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);
|
|
1771
1492
|
}
|
|
1772
1493
|
}
|
|
1773
1494
|
if (!_isIE) {
|
|
1774
|
-
setValue(values, "max-age", strEmpty
|
|
1495
|
+
setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined);
|
|
1775
1496
|
}
|
|
1776
1497
|
}
|
|
1777
1498
|
var location_1 = getLocation();
|
|
@@ -1792,7 +1513,7 @@
|
|
|
1792
1513
|
return result;
|
|
1793
1514
|
},
|
|
1794
1515
|
get: function (name) {
|
|
1795
|
-
var value = strEmpty
|
|
1516
|
+
var value = strEmpty;
|
|
1796
1517
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1797
1518
|
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1798
1519
|
}
|
|
@@ -1817,7 +1538,7 @@
|
|
|
1817
1538
|
values["max-age"] = "0";
|
|
1818
1539
|
}
|
|
1819
1540
|
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1820
|
-
delCookie(name, _formatCookieValue(strEmpty
|
|
1541
|
+
delCookie(name, _formatCookieValue(strEmpty, values));
|
|
1821
1542
|
result = true;
|
|
1822
1543
|
}
|
|
1823
1544
|
return result;
|
|
@@ -1834,7 +1555,7 @@
|
|
|
1834
1555
|
_supportsCookies = doc[strCookie] !== undefined;
|
|
1835
1556
|
}
|
|
1836
1557
|
catch (e) {
|
|
1837
|
-
|
|
1558
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1838
1559
|
}
|
|
1839
1560
|
}
|
|
1840
1561
|
return _supportsCookies;
|
|
@@ -1844,7 +1565,7 @@
|
|
|
1844
1565
|
if (theValue && theValue.length) {
|
|
1845
1566
|
var parts = strTrim(theValue).split(";");
|
|
1846
1567
|
arrForEach(parts, function (thePart) {
|
|
1847
|
-
thePart = strTrim(thePart || strEmpty
|
|
1568
|
+
thePart = strTrim(thePart || strEmpty);
|
|
1848
1569
|
if (thePart) {
|
|
1849
1570
|
var idx = thePart.indexOf("=");
|
|
1850
1571
|
if (idx === -1) {
|
|
@@ -1865,21 +1586,21 @@
|
|
|
1865
1586
|
return null;
|
|
1866
1587
|
}
|
|
1867
1588
|
function _formatCookieValue(value, values) {
|
|
1868
|
-
var cookieValue = value || strEmpty
|
|
1589
|
+
var cookieValue = value || strEmpty;
|
|
1869
1590
|
objForEachKey(values, function (name, theValue) {
|
|
1870
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty
|
|
1591
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty);
|
|
1871
1592
|
});
|
|
1872
1593
|
return cookieValue;
|
|
1873
1594
|
}
|
|
1874
1595
|
function _getCookieValue(name) {
|
|
1875
|
-
var cookieValue = strEmpty
|
|
1596
|
+
var cookieValue = strEmpty;
|
|
1876
1597
|
if (_doc) {
|
|
1877
|
-
var theCookie = _doc[strCookie] || strEmpty
|
|
1598
|
+
var theCookie = _doc[strCookie] || strEmpty;
|
|
1878
1599
|
if (_parsedCookieValue !== theCookie) {
|
|
1879
1600
|
_cookieCache = _extractParts(theCookie);
|
|
1880
1601
|
_parsedCookieValue = theCookie;
|
|
1881
1602
|
}
|
|
1882
|
-
cookieValue = strTrim(_cookieCache[name] || strEmpty
|
|
1603
|
+
cookieValue = strTrim(_cookieCache[name] || strEmpty);
|
|
1883
1604
|
}
|
|
1884
1605
|
return cookieValue;
|
|
1885
1606
|
}
|
|
@@ -1913,290 +1634,86 @@
|
|
|
1913
1634
|
return false;
|
|
1914
1635
|
}
|
|
1915
1636
|
|
|
1916
|
-
var
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
}
|
|
1925
|
-
function _runHandlers(unloadCtx, unloadState) {
|
|
1926
|
-
arrForEach(handlers, function (handler) {
|
|
1927
|
-
try {
|
|
1928
|
-
handler(unloadCtx, unloadState);
|
|
1929
|
-
}
|
|
1930
|
-
catch (e) {
|
|
1931
|
-
_throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1932
|
-
}
|
|
1933
|
-
});
|
|
1934
|
-
handlers = [];
|
|
1637
|
+
var UInt32Mask = 0x100000000;
|
|
1638
|
+
var MaxUInt32 = 0xffffffff;
|
|
1639
|
+
var _mwcSeeded = false;
|
|
1640
|
+
var _mwcW = 123456789;
|
|
1641
|
+
var _mwcZ = 987654321;
|
|
1642
|
+
function _mwcSeed(seedValue) {
|
|
1643
|
+
if (seedValue < 0) {
|
|
1644
|
+
seedValue >>>= 0;
|
|
1935
1645
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
};
|
|
1646
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
1647
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
1648
|
+
_mwcSeeded = true;
|
|
1940
1649
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
var _self = this;
|
|
1946
|
-
var _isinitialized;
|
|
1947
|
-
var _rootCtx;
|
|
1948
|
-
var _nextPlugin;
|
|
1949
|
-
var _unloadHandlerContainer;
|
|
1950
|
-
var _hooks;
|
|
1951
|
-
_initDefaults();
|
|
1952
|
-
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
1953
|
-
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
1954
|
-
_setDefaults(config, core, pluginChain);
|
|
1955
|
-
_isinitialized = true;
|
|
1956
|
-
};
|
|
1957
|
-
_self.teardown = function (unloadCtx, unloadState) {
|
|
1958
|
-
if (!_self.core || (unloadCtx && _self.core !== unloadCtx.core())) {
|
|
1959
|
-
return;
|
|
1960
|
-
}
|
|
1961
|
-
var result;
|
|
1962
|
-
var unloadDone = false;
|
|
1963
|
-
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1964
|
-
var theUnloadState = unloadState || {
|
|
1965
|
-
reason: 0 ,
|
|
1966
|
-
isAsync: false
|
|
1967
|
-
};
|
|
1968
|
-
function _unloadCallback() {
|
|
1969
|
-
if (!unloadDone) {
|
|
1970
|
-
unloadDone = true;
|
|
1971
|
-
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
|
1972
|
-
arrForEach(_hooks, function (fn) {
|
|
1973
|
-
fn.rm();
|
|
1974
|
-
});
|
|
1975
|
-
_hooks = [];
|
|
1976
|
-
if (result === true) {
|
|
1977
|
-
theUnloadCtx.processNext(theUnloadState);
|
|
1978
|
-
}
|
|
1979
|
-
_initDefaults();
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1983
|
-
_unloadCallback();
|
|
1984
|
-
}
|
|
1985
|
-
else {
|
|
1986
|
-
result = true;
|
|
1987
|
-
}
|
|
1988
|
-
return result;
|
|
1989
|
-
};
|
|
1990
|
-
_self.update = function (updateCtx, updateState) {
|
|
1991
|
-
if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
|
|
1992
|
-
return;
|
|
1993
|
-
}
|
|
1994
|
-
var result;
|
|
1995
|
-
var updateDone = false;
|
|
1996
|
-
var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1997
|
-
var theUpdateState = updateState || {
|
|
1998
|
-
reason: 0
|
|
1999
|
-
};
|
|
2000
|
-
function _updateCallback() {
|
|
2001
|
-
if (!updateDone) {
|
|
2002
|
-
updateDone = true;
|
|
2003
|
-
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
2007
|
-
_updateCallback();
|
|
2008
|
-
}
|
|
2009
|
-
else {
|
|
2010
|
-
result = true;
|
|
2011
|
-
}
|
|
2012
|
-
return result;
|
|
2013
|
-
};
|
|
2014
|
-
_self._addHook = function (hooks) {
|
|
2015
|
-
if (hooks) {
|
|
2016
|
-
if (isArray(hooks)) {
|
|
2017
|
-
_hooks = _hooks.concat(hooks);
|
|
2018
|
-
}
|
|
2019
|
-
else {
|
|
2020
|
-
_hooks.push(hooks);
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
};
|
|
2024
|
-
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
|
2025
|
-
});
|
|
2026
|
-
_self.diagLog = function (itemCtx) {
|
|
2027
|
-
return _getTelCtx(itemCtx).diagLog();
|
|
2028
|
-
};
|
|
2029
|
-
_self[strIsInitialized] = function () {
|
|
2030
|
-
return _isinitialized;
|
|
2031
|
-
};
|
|
2032
|
-
_self.setInitialized = function (isInitialized) {
|
|
2033
|
-
_isinitialized = isInitialized;
|
|
2034
|
-
};
|
|
2035
|
-
_self[strSetNextPlugin] = function (next) {
|
|
2036
|
-
_nextPlugin = next;
|
|
2037
|
-
};
|
|
2038
|
-
_self.processNext = function (env, itemCtx) {
|
|
2039
|
-
if (itemCtx) {
|
|
2040
|
-
itemCtx.processNext(env);
|
|
2041
|
-
}
|
|
2042
|
-
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
2043
|
-
_nextPlugin.processTelemetry(env, null);
|
|
2044
|
-
}
|
|
2045
|
-
};
|
|
2046
|
-
_self._getTelCtx = _getTelCtx;
|
|
2047
|
-
function _getTelCtx(currentCtx) {
|
|
2048
|
-
if (currentCtx === void 0) { currentCtx = null; }
|
|
2049
|
-
var itemCtx = currentCtx;
|
|
2050
|
-
if (!itemCtx) {
|
|
2051
|
-
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core);
|
|
2052
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2053
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
2054
|
-
}
|
|
2055
|
-
else {
|
|
2056
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
return itemCtx;
|
|
2060
|
-
}
|
|
2061
|
-
function _setDefaults(config, core, pluginChain) {
|
|
2062
|
-
if (config) {
|
|
2063
|
-
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
2064
|
-
}
|
|
2065
|
-
if (!pluginChain && core) {
|
|
2066
|
-
pluginChain = core.getProcessTelContext().getNext();
|
|
2067
|
-
}
|
|
2068
|
-
var nextPlugin = _nextPlugin;
|
|
2069
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2070
|
-
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
2071
|
-
}
|
|
2072
|
-
_self.core = core;
|
|
2073
|
-
_rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
2074
|
-
}
|
|
2075
|
-
function _initDefaults() {
|
|
2076
|
-
_isinitialized = false;
|
|
2077
|
-
_self.core = null;
|
|
2078
|
-
_rootCtx = null;
|
|
2079
|
-
_nextPlugin = null;
|
|
2080
|
-
_hooks = [];
|
|
2081
|
-
_unloadHandlerContainer = createUnloadHandlerContainer();
|
|
2082
|
-
}
|
|
1650
|
+
function _autoSeedMwc() {
|
|
1651
|
+
try {
|
|
1652
|
+
var now = dateNow() & 0x7fffffff;
|
|
1653
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
2083
1654
|
}
|
|
2084
|
-
|
|
2085
|
-
}());
|
|
2086
|
-
|
|
2087
|
-
var strOnPrefix = "on";
|
|
2088
|
-
var strAttachEvent = "attachEvent";
|
|
2089
|
-
var strAddEventHelper = "addEventListener";
|
|
2090
|
-
var strEvents = "events";
|
|
2091
|
-
createUniqueNamespace("aiEvtPageHide");
|
|
2092
|
-
createUniqueNamespace("aiEvtPageShow");
|
|
2093
|
-
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2094
|
-
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2095
|
-
var _guid = 1;
|
|
2096
|
-
var elmNodeData = createElmNodeData("events");
|
|
2097
|
-
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2098
|
-
function _normalizeNamespace(name) {
|
|
2099
|
-
if (name && name.replace) {
|
|
2100
|
-
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
2101
|
-
}
|
|
2102
|
-
return name;
|
|
2103
|
-
}
|
|
2104
|
-
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2105
|
-
if (evtNamespace) {
|
|
2106
|
-
var theNamespace_1 = "";
|
|
2107
|
-
if (isArray(evtNamespace)) {
|
|
2108
|
-
theNamespace_1 = "";
|
|
2109
|
-
arrForEach(evtNamespace, function (name) {
|
|
2110
|
-
name = _normalizeNamespace(name);
|
|
2111
|
-
if (name) {
|
|
2112
|
-
if (name[0] !== ".") {
|
|
2113
|
-
name = "." + name;
|
|
2114
|
-
}
|
|
2115
|
-
theNamespace_1 += name;
|
|
2116
|
-
}
|
|
2117
|
-
});
|
|
2118
|
-
}
|
|
2119
|
-
else {
|
|
2120
|
-
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2121
|
-
}
|
|
2122
|
-
if (theNamespace_1) {
|
|
2123
|
-
if (theNamespace_1[0] !== ".") {
|
|
2124
|
-
theNamespace_1 = "." + theNamespace_1;
|
|
2125
|
-
}
|
|
2126
|
-
eventName = (eventName || "") + theNamespace_1;
|
|
2127
|
-
}
|
|
1655
|
+
catch (e) {
|
|
2128
1656
|
}
|
|
2129
|
-
var parsedEvent = (eventNamespace.exec(eventName || "") || []);
|
|
2130
|
-
return {
|
|
2131
|
-
type: parsedEvent[1],
|
|
2132
|
-
ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
|
|
2133
|
-
};
|
|
2134
1657
|
}
|
|
2135
|
-
function
|
|
2136
|
-
if (
|
|
2137
|
-
|
|
2138
|
-
var registeredEvents = aiEvts[evtName];
|
|
2139
|
-
if (!registeredEvents) {
|
|
2140
|
-
registeredEvents = aiEvts[evtName] = [];
|
|
1658
|
+
function randomValue(maxValue) {
|
|
1659
|
+
if (maxValue > 0) {
|
|
1660
|
+
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
2141
1661
|
}
|
|
2142
|
-
return
|
|
1662
|
+
return 0;
|
|
2143
1663
|
}
|
|
2144
|
-
function
|
|
2145
|
-
var
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
result = true;
|
|
1664
|
+
function random32(signed) {
|
|
1665
|
+
var value;
|
|
1666
|
+
var c = getCrypto() || getMsCrypto();
|
|
1667
|
+
if (c && c.getRandomValues) {
|
|
1668
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
1669
|
+
}
|
|
1670
|
+
else if (isIE()) {
|
|
1671
|
+
if (!_mwcSeeded) {
|
|
1672
|
+
_autoSeedMwc();
|
|
2154
1673
|
}
|
|
1674
|
+
value = mwcRandom32() & MaxUInt32;
|
|
2155
1675
|
}
|
|
2156
|
-
|
|
1676
|
+
else {
|
|
1677
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
1678
|
+
}
|
|
1679
|
+
if (!signed) {
|
|
1680
|
+
value >>>= 0;
|
|
1681
|
+
}
|
|
1682
|
+
return value;
|
|
2157
1683
|
}
|
|
2158
|
-
function
|
|
2159
|
-
if (
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2165
|
-
if (result && elmNodeData.accept(target)) {
|
|
2166
|
-
var registeredEvent = {
|
|
2167
|
-
guid: _guid++,
|
|
2168
|
-
evtName: evtName,
|
|
2169
|
-
handler: handlerRef,
|
|
2170
|
-
capture: useCapture
|
|
2171
|
-
};
|
|
2172
|
-
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
2173
|
-
}
|
|
2174
|
-
}
|
|
2175
|
-
catch (e) {
|
|
2176
|
-
}
|
|
1684
|
+
function mwcRandomSeed(value) {
|
|
1685
|
+
if (!value) {
|
|
1686
|
+
_autoSeedMwc();
|
|
1687
|
+
}
|
|
1688
|
+
else {
|
|
1689
|
+
_mwcSeed(value);
|
|
2177
1690
|
}
|
|
2178
|
-
return result;
|
|
2179
1691
|
}
|
|
2180
|
-
function
|
|
2181
|
-
|
|
2182
|
-
|
|
1692
|
+
function mwcRandom32(signed) {
|
|
1693
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1694
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
1695
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
1696
|
+
if (!signed) {
|
|
1697
|
+
value >>>= 0;
|
|
1698
|
+
}
|
|
1699
|
+
return value;
|
|
2183
1700
|
}
|
|
2184
|
-
|
|
1701
|
+
|
|
1702
|
+
var _cookieMgrs = null;
|
|
1703
|
+
var _canUseCookies;
|
|
1704
|
+
function addEventHandler(eventName, callback) {
|
|
2185
1705
|
var result = false;
|
|
2186
1706
|
var w = getWindow();
|
|
2187
1707
|
if (w) {
|
|
2188
|
-
result =
|
|
2189
|
-
result =
|
|
1708
|
+
result = attachEvent(w, eventName, callback);
|
|
1709
|
+
result = attachEvent(w["body"], eventName, callback) || result;
|
|
2190
1710
|
}
|
|
2191
1711
|
var doc = getDocument();
|
|
2192
1712
|
if (doc) {
|
|
2193
|
-
result =
|
|
1713
|
+
result = attachEvent(doc, eventName, callback) || result;
|
|
2194
1714
|
}
|
|
2195
1715
|
return result;
|
|
2196
1716
|
}
|
|
2197
|
-
|
|
2198
|
-
var _cookieMgrs = null;
|
|
2199
|
-
var _canUseCookies;
|
|
2200
1717
|
function newGuid() {
|
|
2201
1718
|
function randomHexDigit() {
|
|
2202
1719
|
return randomValue(15);
|
|
@@ -2213,9 +1730,26 @@
|
|
|
2213
1730
|
}
|
|
2214
1731
|
return dateNow();
|
|
2215
1732
|
}
|
|
1733
|
+
function newId(maxLength) {
|
|
1734
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
1735
|
+
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1736
|
+
var number = random32() >>> 0;
|
|
1737
|
+
var chars = 0;
|
|
1738
|
+
var result = "";
|
|
1739
|
+
while (result.length < maxLength) {
|
|
1740
|
+
chars++;
|
|
1741
|
+
result += base64chars.charAt(number & 0x3F);
|
|
1742
|
+
number >>>= 6;
|
|
1743
|
+
if (chars === 5) {
|
|
1744
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1745
|
+
chars = 0;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
return result;
|
|
1749
|
+
}
|
|
2216
1750
|
function generateW3CId() {
|
|
2217
1751
|
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
2218
|
-
var oct =
|
|
1752
|
+
var oct = "", tmp;
|
|
2219
1753
|
for (var a = 0; a < 4; a++) {
|
|
2220
1754
|
tmp = random32();
|
|
2221
1755
|
oct +=
|
|
@@ -2310,95 +1844,6 @@
|
|
|
2310
1844
|
return _legacyCookieMgr(null, logger).del(name);
|
|
2311
1845
|
}
|
|
2312
1846
|
|
|
2313
|
-
createEnumStyle({
|
|
2314
|
-
CRITICAL: 1 ,
|
|
2315
|
-
WARNING: 2
|
|
2316
|
-
});
|
|
2317
|
-
var _InternalMessageId = createEnumStyle({
|
|
2318
|
-
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
2319
|
-
BrowserCannotReadLocalStorage: 1 ,
|
|
2320
|
-
BrowserCannotReadSessionStorage: 2 ,
|
|
2321
|
-
BrowserCannotWriteLocalStorage: 3 ,
|
|
2322
|
-
BrowserCannotWriteSessionStorage: 4 ,
|
|
2323
|
-
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
2324
|
-
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
2325
|
-
CannotSendEmptyTelemetry: 7 ,
|
|
2326
|
-
ClientPerformanceMathError: 8 ,
|
|
2327
|
-
ErrorParsingAISessionCookie: 9 ,
|
|
2328
|
-
ErrorPVCalc: 10 ,
|
|
2329
|
-
ExceptionWhileLoggingError: 11 ,
|
|
2330
|
-
FailedAddingTelemetryToBuffer: 12 ,
|
|
2331
|
-
FailedMonitorAjaxAbort: 13 ,
|
|
2332
|
-
FailedMonitorAjaxDur: 14 ,
|
|
2333
|
-
FailedMonitorAjaxOpen: 15 ,
|
|
2334
|
-
FailedMonitorAjaxRSC: 16 ,
|
|
2335
|
-
FailedMonitorAjaxSend: 17 ,
|
|
2336
|
-
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
2337
|
-
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
2338
|
-
FailedToSendQueuedTelemetry: 20 ,
|
|
2339
|
-
FailedToReportDataLoss: 21 ,
|
|
2340
|
-
FlushFailed: 22 ,
|
|
2341
|
-
MessageLimitPerPVExceeded: 23 ,
|
|
2342
|
-
MissingRequiredFieldSpecification: 24 ,
|
|
2343
|
-
NavigationTimingNotSupported: 25 ,
|
|
2344
|
-
OnError: 26 ,
|
|
2345
|
-
SessionRenewalDateIsZero: 27 ,
|
|
2346
|
-
SenderNotInitialized: 28 ,
|
|
2347
|
-
StartTrackEventFailed: 29 ,
|
|
2348
|
-
StopTrackEventFailed: 30 ,
|
|
2349
|
-
StartTrackFailed: 31 ,
|
|
2350
|
-
StopTrackFailed: 32 ,
|
|
2351
|
-
TelemetrySampledAndNotSent: 33 ,
|
|
2352
|
-
TrackEventFailed: 34 ,
|
|
2353
|
-
TrackExceptionFailed: 35 ,
|
|
2354
|
-
TrackMetricFailed: 36 ,
|
|
2355
|
-
TrackPVFailed: 37 ,
|
|
2356
|
-
TrackPVFailedCalc: 38 ,
|
|
2357
|
-
TrackTraceFailed: 39 ,
|
|
2358
|
-
TransmissionFailed: 40 ,
|
|
2359
|
-
FailedToSetStorageBuffer: 41 ,
|
|
2360
|
-
FailedToRestoreStorageBuffer: 42 ,
|
|
2361
|
-
InvalidBackendResponse: 43 ,
|
|
2362
|
-
FailedToFixDepricatedValues: 44 ,
|
|
2363
|
-
InvalidDurationValue: 45 ,
|
|
2364
|
-
TelemetryEnvelopeInvalid: 46 ,
|
|
2365
|
-
CreateEnvelopeError: 47 ,
|
|
2366
|
-
CannotSerializeObject: 48 ,
|
|
2367
|
-
CannotSerializeObjectNonSerializable: 49 ,
|
|
2368
|
-
CircularReferenceDetected: 50 ,
|
|
2369
|
-
ClearAuthContextFailed: 51 ,
|
|
2370
|
-
ExceptionTruncated: 52 ,
|
|
2371
|
-
IllegalCharsInName: 53 ,
|
|
2372
|
-
ItemNotInArray: 54 ,
|
|
2373
|
-
MaxAjaxPerPVExceeded: 55 ,
|
|
2374
|
-
MessageTruncated: 56 ,
|
|
2375
|
-
NameTooLong: 57 ,
|
|
2376
|
-
SampleRateOutOfRange: 58 ,
|
|
2377
|
-
SetAuthContextFailed: 59 ,
|
|
2378
|
-
SetAuthContextFailedAccountName: 60 ,
|
|
2379
|
-
StringValueTooLong: 61 ,
|
|
2380
|
-
StartCalledMoreThanOnce: 62 ,
|
|
2381
|
-
StopCalledWithoutStart: 63 ,
|
|
2382
|
-
TelemetryInitializerFailed: 64 ,
|
|
2383
|
-
TrackArgumentsNotSpecified: 65 ,
|
|
2384
|
-
UrlTooLong: 66 ,
|
|
2385
|
-
SessionStorageBufferFull: 67 ,
|
|
2386
|
-
CannotAccessCookie: 68 ,
|
|
2387
|
-
IdTooLong: 69 ,
|
|
2388
|
-
InvalidEvent: 70 ,
|
|
2389
|
-
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
2390
|
-
SendBrowserInfoOnUserInit: 72 ,
|
|
2391
|
-
PluginException: 73 ,
|
|
2392
|
-
NotificationException: 74 ,
|
|
2393
|
-
SnippetScriptLoadFailure: 99 ,
|
|
2394
|
-
InvalidInstrumentationKey: 100 ,
|
|
2395
|
-
CannotParseAiBlobValue: 101 ,
|
|
2396
|
-
InvalidContentBlob: 102 ,
|
|
2397
|
-
TrackPageActionEventFailed: 103 ,
|
|
2398
|
-
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
2399
|
-
InMemoryStorageBufferFull: 105
|
|
2400
|
-
});
|
|
2401
|
-
|
|
2402
1847
|
var aiInstrumentHooks = "_aiHooks";
|
|
2403
1848
|
var cbNames = [
|
|
2404
1849
|
"req", "rsp", "hkErr", "fnErr"
|
|
@@ -2457,7 +1902,6 @@
|
|
|
2457
1902
|
};
|
|
2458
1903
|
var hookCtx = [];
|
|
2459
1904
|
var cbArgs = _createArgs([funcArgs], orgArgs);
|
|
2460
|
-
funcArgs.evt = getGlobalInst("event");
|
|
2461
1905
|
function _createArgs(target, theArgs) {
|
|
2462
1906
|
_arrLoop(theArgs, function (arg) {
|
|
2463
1907
|
target.push(arg);
|
|
@@ -2551,7 +1995,6 @@
|
|
|
2551
1995
|
return event;
|
|
2552
1996
|
}
|
|
2553
1997
|
|
|
2554
|
-
var strEmpty = "";
|
|
2555
1998
|
function stringToBoolOrDefault(str, defaultValue) {
|
|
2556
1999
|
if (defaultValue === void 0) { defaultValue = false; }
|
|
2557
2000
|
if (str === undefined || str === null) {
|
|
@@ -2564,16 +2007,16 @@
|
|
|
2564
2007
|
totalms = 0;
|
|
2565
2008
|
}
|
|
2566
2009
|
totalms = Math.round(totalms);
|
|
2567
|
-
var ms =
|
|
2568
|
-
var sec =
|
|
2569
|
-
var min =
|
|
2570
|
-
var hour =
|
|
2010
|
+
var ms = "" + totalms % 1000;
|
|
2011
|
+
var sec = "" + Math.floor(totalms / 1000) % 60;
|
|
2012
|
+
var min = "" + Math.floor(totalms / (1000 * 60)) % 60;
|
|
2013
|
+
var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24;
|
|
2571
2014
|
var days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
2572
2015
|
ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms;
|
|
2573
2016
|
sec = sec.length < 2 ? "0" + sec : sec;
|
|
2574
2017
|
min = min.length < 2 ? "0" + min : min;
|
|
2575
2018
|
hour = hour.length < 2 ? "0" + hour : hour;
|
|
2576
|
-
return (days > 0 ? days + "." :
|
|
2019
|
+
return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms;
|
|
2577
2020
|
}
|
|
2578
2021
|
function getExtensionByName(extensions, identifier) {
|
|
2579
2022
|
var extension = null;
|
|
@@ -2591,15 +2034,17 @@
|
|
|
2591
2034
|
|
|
2592
2035
|
var strNotSpecified = "not_specified";
|
|
2593
2036
|
|
|
2594
|
-
var StorageType
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2037
|
+
var StorageType;
|
|
2038
|
+
(function (StorageType) {
|
|
2039
|
+
StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage";
|
|
2040
|
+
StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage";
|
|
2041
|
+
})(StorageType || (StorageType = {}));
|
|
2042
|
+
var DistributedTracingModes;
|
|
2043
|
+
(function (DistributedTracingModes) {
|
|
2044
|
+
DistributedTracingModes[DistributedTracingModes["AI"] = 0] = "AI";
|
|
2045
|
+
DistributedTracingModes[DistributedTracingModes["AI_AND_W3C"] = 1] = "AI_AND_W3C";
|
|
2046
|
+
DistributedTracingModes[DistributedTracingModes["W3C"] = 2] = "W3C";
|
|
2047
|
+
})(DistributedTracingModes || (DistributedTracingModes = {}));
|
|
2603
2048
|
|
|
2604
2049
|
var _canUseLocalStorage = undefined;
|
|
2605
2050
|
var _canUseSessionStorage = undefined;
|
|
@@ -2637,8 +2082,8 @@
|
|
|
2637
2082
|
_canUseLocalStorage = false;
|
|
2638
2083
|
_canUseSessionStorage = false;
|
|
2639
2084
|
}
|
|
2640
|
-
function utlCanUseLocalStorage(
|
|
2641
|
-
if (
|
|
2085
|
+
function utlCanUseLocalStorage() {
|
|
2086
|
+
if (_canUseLocalStorage === undefined) {
|
|
2642
2087
|
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
2643
2088
|
}
|
|
2644
2089
|
return _canUseLocalStorage;
|
|
@@ -2651,7 +2096,7 @@
|
|
|
2651
2096
|
}
|
|
2652
2097
|
catch (e) {
|
|
2653
2098
|
_canUseLocalStorage = false;
|
|
2654
|
-
|
|
2099
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2655
2100
|
}
|
|
2656
2101
|
}
|
|
2657
2102
|
return null;
|
|
@@ -2665,7 +2110,7 @@
|
|
|
2665
2110
|
}
|
|
2666
2111
|
catch (e) {
|
|
2667
2112
|
_canUseLocalStorage = false;
|
|
2668
|
-
|
|
2113
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2669
2114
|
}
|
|
2670
2115
|
}
|
|
2671
2116
|
return false;
|
|
@@ -2679,13 +2124,13 @@
|
|
|
2679
2124
|
}
|
|
2680
2125
|
catch (e) {
|
|
2681
2126
|
_canUseLocalStorage = false;
|
|
2682
|
-
|
|
2127
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2683
2128
|
}
|
|
2684
2129
|
}
|
|
2685
2130
|
return false;
|
|
2686
2131
|
}
|
|
2687
|
-
function utlCanUseSessionStorage(
|
|
2688
|
-
if (
|
|
2132
|
+
function utlCanUseSessionStorage() {
|
|
2133
|
+
if (_canUseSessionStorage === undefined) {
|
|
2689
2134
|
_canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
|
|
2690
2135
|
}
|
|
2691
2136
|
return _canUseSessionStorage;
|
|
@@ -2707,7 +2152,7 @@
|
|
|
2707
2152
|
}
|
|
2708
2153
|
catch (e) {
|
|
2709
2154
|
_canUseSessionStorage = false;
|
|
2710
|
-
|
|
2155
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2711
2156
|
}
|
|
2712
2157
|
}
|
|
2713
2158
|
return null;
|
|
@@ -2721,7 +2166,7 @@
|
|
|
2721
2166
|
}
|
|
2722
2167
|
catch (e) {
|
|
2723
2168
|
_canUseSessionStorage = false;
|
|
2724
|
-
|
|
2169
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2725
2170
|
}
|
|
2726
2171
|
}
|
|
2727
2172
|
return false;
|
|
@@ -2735,7 +2180,7 @@
|
|
|
2735
2180
|
}
|
|
2736
2181
|
catch (e) {
|
|
2737
2182
|
_canUseSessionStorage = false;
|
|
2738
|
-
|
|
2183
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2739
2184
|
}
|
|
2740
2185
|
}
|
|
2741
2186
|
return false;
|
|
@@ -2747,7 +2192,7 @@
|
|
|
2747
2192
|
"https://dc-int.services.visualstudio.com/v2/track"
|
|
2748
2193
|
];
|
|
2749
2194
|
function isInternalApplicationInsightsEndpoint(endpointUrl) {
|
|
2750
|
-
return _internalEndpoints
|
|
2195
|
+
return arrIndexOf(_internalEndpoints, endpointUrl.toLowerCase()) !== -1;
|
|
2751
2196
|
}
|
|
2752
2197
|
var Util = {
|
|
2753
2198
|
NotSpecified: strNotSpecified,
|
|
@@ -2866,7 +2311,7 @@
|
|
|
2866
2311
|
ch.childNodes[0].className = "checkbox off";
|
|
2867
2312
|
}
|
|
2868
2313
|
}
|
|
2869
|
-
_self.filterList.splice(_self.filterList
|
|
2314
|
+
_self.filterList.splice(arrIndexOf(_self.filterList, t), 1);
|
|
2870
2315
|
checkbox.className = "checkbox on";
|
|
2871
2316
|
}
|
|
2872
2317
|
else {
|
|
@@ -3116,7 +2561,7 @@
|
|
|
3116
2561
|
if (propKeys) {
|
|
3117
2562
|
arrForEach(propKeys, function (key) {
|
|
3118
2563
|
var theKey = _toString(key);
|
|
3119
|
-
if (theKey && keys
|
|
2564
|
+
if (theKey && arrIndexOf(keys, theKey) === -1) {
|
|
3120
2565
|
keys.push(key);
|
|
3121
2566
|
}
|
|
3122
2567
|
});
|
|
@@ -3132,7 +2577,7 @@
|
|
|
3132
2577
|
return;
|
|
3133
2578
|
}
|
|
3134
2579
|
var theKey = _toString(key);
|
|
3135
|
-
if (theKey && excludedKeys
|
|
2580
|
+
if (theKey && arrIndexOf(excludedKeys, theKey) === -1) {
|
|
3136
2581
|
theKeys.push(theKey);
|
|
3137
2582
|
}
|
|
3138
2583
|
});
|
|
@@ -3174,7 +2619,7 @@
|
|
|
3174
2619
|
}
|
|
3175
2620
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
3176
2621
|
var key_1 = keys_1[_i];
|
|
3177
|
-
if (excludeKeys
|
|
2622
|
+
if (arrIndexOf(excludeKeys, key_1) !== -1) {
|
|
3178
2623
|
continue;
|
|
3179
2624
|
}
|
|
3180
2625
|
var targetValue = target[key_1];
|
|
@@ -3364,7 +2809,7 @@
|
|
|
3364
2809
|
}
|
|
3365
2810
|
}
|
|
3366
2811
|
else if (isString(value) || isNumber(value) || isBoolean(value)) {
|
|
3367
|
-
return _testValue(rg,
|
|
2812
|
+
return _testValue(rg, value.toString());
|
|
3368
2813
|
}
|
|
3369
2814
|
}
|
|
3370
2815
|
return false;
|
|
@@ -3507,11 +2952,11 @@
|
|
|
3507
2952
|
return;
|
|
3508
2953
|
}
|
|
3509
2954
|
var type = entry.getKind();
|
|
3510
|
-
var allowOther = excludedTypes_1
|
|
3511
|
-
if (trackers
|
|
2955
|
+
var allowOther = arrIndexOf(excludedTypes_1, "other") === -1;
|
|
2956
|
+
if (arrIndexOf(trackers, type) === -1 && !allowOther) {
|
|
3512
2957
|
return;
|
|
3513
2958
|
}
|
|
3514
|
-
else if (excludedTypes_1
|
|
2959
|
+
else if (arrIndexOf(excludedTypes_1, type) !== -1) {
|
|
3515
2960
|
return;
|
|
3516
2961
|
}
|
|
3517
2962
|
var newEl = entry.render(textFilter, config.excludeKeys, config.includeFunctions);
|
|
@@ -3785,16 +3230,16 @@
|
|
|
3785
3230
|
dashboard.newLogEntry(perfEvent, dateNow() - startTime, evtName, 0, "perfEvent");
|
|
3786
3231
|
}
|
|
3787
3232
|
});
|
|
3788
|
-
if (trackers
|
|
3233
|
+
if (arrIndexOf(trackers, "eventsSent") !== -1) {
|
|
3789
3234
|
foundTrackers_1.push("eventsSent");
|
|
3790
3235
|
}
|
|
3791
|
-
if (trackers
|
|
3236
|
+
if (arrIndexOf(trackers, "eventsSendRequest") !== -1) {
|
|
3792
3237
|
foundTrackers_1.push("eventsSendRequest");
|
|
3793
3238
|
}
|
|
3794
|
-
if (trackers
|
|
3239
|
+
if (arrIndexOf(trackers, "eventsDiscarded") !== -1) {
|
|
3795
3240
|
foundTrackers_1.push("eventsDiscarded");
|
|
3796
3241
|
}
|
|
3797
|
-
if (trackers
|
|
3242
|
+
if (arrIndexOf(trackers, "perfEvent") !== -1) {
|
|
3798
3243
|
foundTrackers_1.push("perfEvent");
|
|
3799
3244
|
}
|
|
3800
3245
|
}
|
|
@@ -3830,7 +3275,7 @@
|
|
|
3830
3275
|
rsp: _handleInstPostHook()
|
|
3831
3276
|
}, true);
|
|
3832
3277
|
if (val) {
|
|
3833
|
-
if (foundTrackers_1
|
|
3278
|
+
if (arrIndexOf(foundTrackers_1, tracker) === -1) {
|
|
3834
3279
|
foundTrackers_1.push(tracker);
|
|
3835
3280
|
}
|
|
3836
3281
|
}
|
|
@@ -3867,7 +3312,7 @@
|
|
|
3867
3312
|
}
|
|
3868
3313
|
};
|
|
3869
3314
|
function _addTarget(targetObjects, ext) {
|
|
3870
|
-
if (ext && targetObjects
|
|
3315
|
+
if (ext && arrIndexOf(targetObjects, ext) === -1) {
|
|
3871
3316
|
targetObjects.push(ext);
|
|
3872
3317
|
return true;
|
|
3873
3318
|
}
|