@microsoft/applicationinsights-analytics-js 2.8.0-nightly.2204-04 → 2.8.0-nightly.2204-07
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/applicationinsights-analytics-js.integrity.json +9 -9
- package/browser/applicationinsights-analytics-js.js +351 -440
- package/browser/applicationinsights-analytics-js.js.map +1 -1
- package/browser/applicationinsights-analytics-js.min.js +2 -2
- package/browser/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.d.ts +1 -1
- package/dist/applicationinsights-analytics-js.js +351 -440
- package/dist/applicationinsights-analytics-js.js.map +1 -1
- package/dist/applicationinsights-analytics-js.min.js +2 -2
- package/dist/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.rollup.d.ts +1 -1
- package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js +23 -23
- package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +4 -4
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +6 -5
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +6 -6
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Timing.js +4 -4
- package/dist-esm/JavaScriptSDK/Timing.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/applicationinsights-analytics-js.js +1 -1
- package/package.json +5 -5
- package/src/JavaScriptSDK/AnalyticsPlugin.ts +34 -34
- package/src/JavaScriptSDK/Telemetry/PageViewManager.ts +8 -8
- package/src/JavaScriptSDK/Telemetry/PageViewPerformanceManager.ts +13 -11
- package/src/JavaScriptSDK/Telemetry/PageVisitTimeManager.ts +5 -5
- package/src/JavaScriptSDK/Timing.ts +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Web Analytics, 2.8.0-nightly.2204-
|
|
2
|
+
* Application Insights JavaScript SDK - Web Analytics, 2.8.0-nightly.2204-07
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -98,247 +98,6 @@
|
|
|
98
98
|
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/*!
|
|
102
|
-
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
103
|
-
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
104
|
-
*/
|
|
105
|
-
var Constructor = 'constructor';
|
|
106
|
-
var Prototype = 'prototype';
|
|
107
|
-
var strFunction = 'function';
|
|
108
|
-
var DynInstFuncTable = '_dynInstFuncs';
|
|
109
|
-
var DynProxyTag = '_isDynProxy';
|
|
110
|
-
var DynClassName = '_dynClass';
|
|
111
|
-
var DynClassNamePrefix = '_dynCls$';
|
|
112
|
-
var DynInstChkTag = '_dynInstChk';
|
|
113
|
-
var DynAllowInstChkTag = DynInstChkTag;
|
|
114
|
-
var DynProtoDefaultOptions = '_dfOpts';
|
|
115
|
-
var UnknownValue = '_unknown_';
|
|
116
|
-
var str__Proto$1 = "__proto__";
|
|
117
|
-
var strUseBaseInst = 'useBaseInst';
|
|
118
|
-
var strSetInstFuncs = 'setInstFuncs';
|
|
119
|
-
var Obj = Object;
|
|
120
|
-
var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
|
|
121
|
-
var _dynamicNames = 0;
|
|
122
|
-
function _hasOwnProperty(obj, prop) {
|
|
123
|
-
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
124
|
-
}
|
|
125
|
-
function _isObjectOrArrayPrototype(target) {
|
|
126
|
-
return target && (target === Obj[Prototype] || target === Array[Prototype]);
|
|
127
|
-
}
|
|
128
|
-
function _isObjectArrayOrFunctionPrototype(target) {
|
|
129
|
-
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
130
|
-
}
|
|
131
|
-
function _getObjProto$1(target) {
|
|
132
|
-
if (target) {
|
|
133
|
-
if (_objGetPrototypeOf$1) {
|
|
134
|
-
return _objGetPrototypeOf$1(target);
|
|
135
|
-
}
|
|
136
|
-
var newProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
137
|
-
if (newProto) {
|
|
138
|
-
return newProto;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
function _forEachProp(target, func) {
|
|
144
|
-
var props = [];
|
|
145
|
-
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
146
|
-
if (getOwnProps) {
|
|
147
|
-
props = getOwnProps(target);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
for (var name_1 in target) {
|
|
151
|
-
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
152
|
-
props.push(name_1);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (props && props.length > 0) {
|
|
157
|
-
for (var lp = 0; lp < props.length; lp++) {
|
|
158
|
-
func(props[lp]);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
163
|
-
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
164
|
-
}
|
|
165
|
-
function _throwTypeError(message) {
|
|
166
|
-
throw new TypeError("DynamicProto: " + message);
|
|
167
|
-
}
|
|
168
|
-
function _getInstanceFuncs(thisTarget) {
|
|
169
|
-
var instFuncs = {};
|
|
170
|
-
_forEachProp(thisTarget, function (name) {
|
|
171
|
-
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
172
|
-
instFuncs[name] = thisTarget[name];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
return instFuncs;
|
|
176
|
-
}
|
|
177
|
-
function _hasVisited(values, value) {
|
|
178
|
-
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
179
|
-
if (values[lp] === value) {
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
186
|
-
function _instFuncProxy(target, funcHost, funcName) {
|
|
187
|
-
var theFunc = funcHost[funcName];
|
|
188
|
-
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
189
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
190
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
191
|
-
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return function () {
|
|
195
|
-
return theFunc.apply(target, arguments);
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
var baseFuncs = {};
|
|
199
|
-
_forEachProp(instFuncs, function (name) {
|
|
200
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
201
|
-
});
|
|
202
|
-
var baseProto = _getObjProto$1(classProto);
|
|
203
|
-
var visited = [];
|
|
204
|
-
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
205
|
-
_forEachProp(baseProto, function (name) {
|
|
206
|
-
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) {
|
|
207
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
visited.push(baseProto);
|
|
211
|
-
baseProto = _getObjProto$1(baseProto);
|
|
212
|
-
}
|
|
213
|
-
return baseFuncs;
|
|
214
|
-
}
|
|
215
|
-
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
216
|
-
var instFunc = null;
|
|
217
|
-
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
218
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
219
|
-
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
220
|
-
if (!instFunc) {
|
|
221
|
-
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
222
|
-
}
|
|
223
|
-
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
224
|
-
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
225
|
-
var objProto = _getObjProto$1(target);
|
|
226
|
-
var visited = [];
|
|
227
|
-
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
228
|
-
var protoFunc = objProto[funcName];
|
|
229
|
-
if (protoFunc) {
|
|
230
|
-
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
visited.push(objProto);
|
|
234
|
-
objProto = _getObjProto$1(objProto);
|
|
235
|
-
}
|
|
236
|
-
try {
|
|
237
|
-
if (canAddInst) {
|
|
238
|
-
target[funcName] = instFunc;
|
|
239
|
-
}
|
|
240
|
-
instFunc[DynInstChkTag] = 1;
|
|
241
|
-
}
|
|
242
|
-
catch (e) {
|
|
243
|
-
instFuncTable[DynAllowInstChkTag] = false;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return instFunc;
|
|
248
|
-
}
|
|
249
|
-
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
250
|
-
var protoFunc = proto[funcName];
|
|
251
|
-
if (protoFunc === currentDynProtoProxy) {
|
|
252
|
-
protoFunc = _getObjProto$1(proto)[funcName];
|
|
253
|
-
}
|
|
254
|
-
if (typeof protoFunc !== strFunction) {
|
|
255
|
-
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
256
|
-
}
|
|
257
|
-
return protoFunc;
|
|
258
|
-
}
|
|
259
|
-
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
260
|
-
function _createDynamicPrototype(proto, funcName) {
|
|
261
|
-
var dynProtoProxy = function () {
|
|
262
|
-
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
263
|
-
return instFunc.apply(this, arguments);
|
|
264
|
-
};
|
|
265
|
-
dynProtoProxy[DynProxyTag] = 1;
|
|
266
|
-
return dynProtoProxy;
|
|
267
|
-
}
|
|
268
|
-
if (!_isObjectOrArrayPrototype(proto)) {
|
|
269
|
-
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
270
|
-
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
271
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
272
|
-
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
273
|
-
}
|
|
274
|
-
_forEachProp(target, function (name) {
|
|
275
|
-
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
276
|
-
instFuncs_1[name] = target[name];
|
|
277
|
-
delete target[name];
|
|
278
|
-
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
279
|
-
proto[name] = _createDynamicPrototype(proto, name);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function _checkPrototype(classProto, thisTarget) {
|
|
286
|
-
if (_objGetPrototypeOf$1) {
|
|
287
|
-
var visited = [];
|
|
288
|
-
var thisProto = _getObjProto$1(thisTarget);
|
|
289
|
-
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
290
|
-
if (thisProto === classProto) {
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
293
|
-
visited.push(thisProto);
|
|
294
|
-
thisProto = _getObjProto$1(thisProto);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return false;
|
|
298
|
-
}
|
|
299
|
-
function _getObjName(target, unknownValue) {
|
|
300
|
-
if (_hasOwnProperty(target, Prototype)) {
|
|
301
|
-
return target.name || unknownValue || UnknownValue;
|
|
302
|
-
}
|
|
303
|
-
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
304
|
-
}
|
|
305
|
-
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
306
|
-
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
307
|
-
_throwTypeError("theClass is an invalid class definition.");
|
|
308
|
-
}
|
|
309
|
-
var classProto = theClass[Prototype];
|
|
310
|
-
if (!_checkPrototype(classProto, target)) {
|
|
311
|
-
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
312
|
-
}
|
|
313
|
-
var className = null;
|
|
314
|
-
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
315
|
-
className = classProto[DynClassName];
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
319
|
-
_dynamicNames++;
|
|
320
|
-
classProto[DynClassName] = className;
|
|
321
|
-
}
|
|
322
|
-
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
323
|
-
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
324
|
-
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
325
|
-
useBaseInst = !!options[strUseBaseInst];
|
|
326
|
-
}
|
|
327
|
-
var instFuncs = _getInstanceFuncs(target);
|
|
328
|
-
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
329
|
-
delegateFunc(target, baseFuncs);
|
|
330
|
-
var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs];
|
|
331
|
-
if (setInstanceFunc && options) {
|
|
332
|
-
setInstanceFunc = !!options[strSetInstFuncs];
|
|
333
|
-
}
|
|
334
|
-
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
335
|
-
}
|
|
336
|
-
var perfDefaults = {
|
|
337
|
-
setInstFuncs: true,
|
|
338
|
-
useBaseInst: true
|
|
339
|
-
};
|
|
340
|
-
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
341
|
-
|
|
342
101
|
var strEmpty$1 = "";
|
|
343
102
|
var strSetNextPlugin = "setNextPlugin";
|
|
344
103
|
var strIsInitialized = "isInitialized";
|
|
@@ -353,7 +112,7 @@
|
|
|
353
112
|
var strMap = "map";
|
|
354
113
|
var cStrTrim = "trim";
|
|
355
114
|
var strToString = "toString";
|
|
356
|
-
var str__Proto = "__proto__";
|
|
115
|
+
var str__Proto$1 = "__proto__";
|
|
357
116
|
var strConstructor = "constructor";
|
|
358
117
|
var _objDefineProperty$1 = ObjDefineProperty;
|
|
359
118
|
var _objFreeze = ObjClass.freeze;
|
|
@@ -370,13 +129,13 @@
|
|
|
370
129
|
var rCamelCase = /-([a-z])/g;
|
|
371
130
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
372
131
|
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
373
|
-
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
374
|
-
function _getObjProto(target) {
|
|
132
|
+
var _objGetPrototypeOf$1 = Object["getPrototypeOf"];
|
|
133
|
+
function _getObjProto$1(target) {
|
|
375
134
|
if (target) {
|
|
376
|
-
if (_objGetPrototypeOf) {
|
|
377
|
-
return _objGetPrototypeOf(target);
|
|
135
|
+
if (_objGetPrototypeOf$1) {
|
|
136
|
+
return _objGetPrototypeOf$1(target);
|
|
378
137
|
}
|
|
379
|
-
var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
|
|
138
|
+
var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor];
|
|
380
139
|
if (newProto) {
|
|
381
140
|
return newProto;
|
|
382
141
|
}
|
|
@@ -468,7 +227,7 @@
|
|
|
468
227
|
function isPlainObject(value) {
|
|
469
228
|
var result = false;
|
|
470
229
|
if (value && typeof value === "object") {
|
|
471
|
-
var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
|
|
230
|
+
var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value);
|
|
472
231
|
if (!proto) {
|
|
473
232
|
result = true;
|
|
474
233
|
}
|
|
@@ -604,6 +363,16 @@
|
|
|
604
363
|
function _doNothing(value) {
|
|
605
364
|
return value;
|
|
606
365
|
}
|
|
366
|
+
function deepFreeze(obj) {
|
|
367
|
+
if (_objFreeze) {
|
|
368
|
+
objForEachKey(obj, function (name, value) {
|
|
369
|
+
if (isArray(value) || isObject(value)) {
|
|
370
|
+
_objFreeze(value);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return objFreeze(obj);
|
|
375
|
+
}
|
|
607
376
|
var objFreeze = _objFreeze || _doNothing;
|
|
608
377
|
function dateNow() {
|
|
609
378
|
var dt = Date;
|
|
@@ -652,24 +421,12 @@
|
|
|
652
421
|
};
|
|
653
422
|
}
|
|
654
423
|
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
655
|
-
if (overwriteTarget === void 0) { overwriteTarget = true; }
|
|
656
424
|
if (target && name && source) {
|
|
657
|
-
if (overwriteTarget || isUndefined(target[name])) {
|
|
425
|
+
if (overwriteTarget !== false || isUndefined(target[name])) {
|
|
658
426
|
target[name] = _createProxyFunction(source, theFunc);
|
|
659
427
|
}
|
|
660
428
|
}
|
|
661
429
|
}
|
|
662
|
-
function createEnumStyle(values) {
|
|
663
|
-
var enumClass = {};
|
|
664
|
-
objForEachKey(values, function (field, value) {
|
|
665
|
-
enumClass[field] = value;
|
|
666
|
-
if (!isUndefined(enumClass[value])) {
|
|
667
|
-
throwError("[" + value + "] exists for " + field);
|
|
668
|
-
}
|
|
669
|
-
enumClass[value] = field;
|
|
670
|
-
});
|
|
671
|
-
return objFreeze(enumClass);
|
|
672
|
-
}
|
|
673
430
|
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
674
431
|
var theArgs = arguments;
|
|
675
432
|
var extended = theArgs[0] || {};
|
|
@@ -715,6 +472,256 @@
|
|
|
715
472
|
return extended;
|
|
716
473
|
}
|
|
717
474
|
|
|
475
|
+
function createEnumStyle(values) {
|
|
476
|
+
var enumClass = {};
|
|
477
|
+
objForEachKey(values, function (field, value) {
|
|
478
|
+
enumClass[field] = value;
|
|
479
|
+
enumClass[value] = field;
|
|
480
|
+
});
|
|
481
|
+
return deepFreeze(enumClass);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/*!
|
|
485
|
+
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
486
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
487
|
+
*/
|
|
488
|
+
var Constructor = 'constructor';
|
|
489
|
+
var Prototype = 'prototype';
|
|
490
|
+
var strFunction = 'function';
|
|
491
|
+
var DynInstFuncTable = '_dynInstFuncs';
|
|
492
|
+
var DynProxyTag = '_isDynProxy';
|
|
493
|
+
var DynClassName = '_dynClass';
|
|
494
|
+
var DynClassNamePrefix = '_dynCls$';
|
|
495
|
+
var DynInstChkTag = '_dynInstChk';
|
|
496
|
+
var DynAllowInstChkTag = DynInstChkTag;
|
|
497
|
+
var DynProtoDefaultOptions = '_dfOpts';
|
|
498
|
+
var UnknownValue = '_unknown_';
|
|
499
|
+
var str__Proto = "__proto__";
|
|
500
|
+
var strUseBaseInst = 'useBaseInst';
|
|
501
|
+
var strSetInstFuncs = 'setInstFuncs';
|
|
502
|
+
var Obj = Object;
|
|
503
|
+
var _objGetPrototypeOf = Obj["getPrototypeOf"];
|
|
504
|
+
var _dynamicNames = 0;
|
|
505
|
+
function _hasOwnProperty(obj, prop) {
|
|
506
|
+
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
507
|
+
}
|
|
508
|
+
function _isObjectOrArrayPrototype(target) {
|
|
509
|
+
return target && (target === Obj[Prototype] || target === Array[Prototype]);
|
|
510
|
+
}
|
|
511
|
+
function _isObjectArrayOrFunctionPrototype(target) {
|
|
512
|
+
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
513
|
+
}
|
|
514
|
+
function _getObjProto(target) {
|
|
515
|
+
if (target) {
|
|
516
|
+
if (_objGetPrototypeOf) {
|
|
517
|
+
return _objGetPrototypeOf(target);
|
|
518
|
+
}
|
|
519
|
+
var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
520
|
+
if (newProto) {
|
|
521
|
+
return newProto;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
function _forEachProp(target, func) {
|
|
527
|
+
var props = [];
|
|
528
|
+
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
529
|
+
if (getOwnProps) {
|
|
530
|
+
props = getOwnProps(target);
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
for (var name_1 in target) {
|
|
534
|
+
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
535
|
+
props.push(name_1);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
if (props && props.length > 0) {
|
|
540
|
+
for (var lp = 0; lp < props.length; lp++) {
|
|
541
|
+
func(props[lp]);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
546
|
+
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
547
|
+
}
|
|
548
|
+
function _throwTypeError(message) {
|
|
549
|
+
throw new TypeError("DynamicProto: " + message);
|
|
550
|
+
}
|
|
551
|
+
function _getInstanceFuncs(thisTarget) {
|
|
552
|
+
var instFuncs = {};
|
|
553
|
+
_forEachProp(thisTarget, function (name) {
|
|
554
|
+
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
555
|
+
instFuncs[name] = thisTarget[name];
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
return instFuncs;
|
|
559
|
+
}
|
|
560
|
+
function _hasVisited(values, value) {
|
|
561
|
+
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
562
|
+
if (values[lp] === value) {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
569
|
+
function _instFuncProxy(target, funcHost, funcName) {
|
|
570
|
+
var theFunc = funcHost[funcName];
|
|
571
|
+
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
572
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
573
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
574
|
+
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return function () {
|
|
578
|
+
return theFunc.apply(target, arguments);
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
var baseFuncs = {};
|
|
582
|
+
_forEachProp(instFuncs, function (name) {
|
|
583
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
584
|
+
});
|
|
585
|
+
var baseProto = _getObjProto(classProto);
|
|
586
|
+
var visited = [];
|
|
587
|
+
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
588
|
+
_forEachProp(baseProto, function (name) {
|
|
589
|
+
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
|
|
590
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
visited.push(baseProto);
|
|
594
|
+
baseProto = _getObjProto(baseProto);
|
|
595
|
+
}
|
|
596
|
+
return baseFuncs;
|
|
597
|
+
}
|
|
598
|
+
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
599
|
+
var instFunc = null;
|
|
600
|
+
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
601
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
602
|
+
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
603
|
+
if (!instFunc) {
|
|
604
|
+
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
605
|
+
}
|
|
606
|
+
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
607
|
+
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
608
|
+
var objProto = _getObjProto(target);
|
|
609
|
+
var visited = [];
|
|
610
|
+
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
611
|
+
var protoFunc = objProto[funcName];
|
|
612
|
+
if (protoFunc) {
|
|
613
|
+
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
visited.push(objProto);
|
|
617
|
+
objProto = _getObjProto(objProto);
|
|
618
|
+
}
|
|
619
|
+
try {
|
|
620
|
+
if (canAddInst) {
|
|
621
|
+
target[funcName] = instFunc;
|
|
622
|
+
}
|
|
623
|
+
instFunc[DynInstChkTag] = 1;
|
|
624
|
+
}
|
|
625
|
+
catch (e) {
|
|
626
|
+
instFuncTable[DynAllowInstChkTag] = false;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return instFunc;
|
|
631
|
+
}
|
|
632
|
+
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
633
|
+
var protoFunc = proto[funcName];
|
|
634
|
+
if (protoFunc === currentDynProtoProxy) {
|
|
635
|
+
protoFunc = _getObjProto(proto)[funcName];
|
|
636
|
+
}
|
|
637
|
+
if (typeof protoFunc !== strFunction) {
|
|
638
|
+
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
639
|
+
}
|
|
640
|
+
return protoFunc;
|
|
641
|
+
}
|
|
642
|
+
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
643
|
+
function _createDynamicPrototype(proto, funcName) {
|
|
644
|
+
var dynProtoProxy = function () {
|
|
645
|
+
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
646
|
+
return instFunc.apply(this, arguments);
|
|
647
|
+
};
|
|
648
|
+
dynProtoProxy[DynProxyTag] = 1;
|
|
649
|
+
return dynProtoProxy;
|
|
650
|
+
}
|
|
651
|
+
if (!_isObjectOrArrayPrototype(proto)) {
|
|
652
|
+
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
653
|
+
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
654
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
655
|
+
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
656
|
+
}
|
|
657
|
+
_forEachProp(target, function (name) {
|
|
658
|
+
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
659
|
+
instFuncs_1[name] = target[name];
|
|
660
|
+
delete target[name];
|
|
661
|
+
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
662
|
+
proto[name] = _createDynamicPrototype(proto, name);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function _checkPrototype(classProto, thisTarget) {
|
|
669
|
+
if (_objGetPrototypeOf) {
|
|
670
|
+
var visited = [];
|
|
671
|
+
var thisProto = _getObjProto(thisTarget);
|
|
672
|
+
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
673
|
+
if (thisProto === classProto) {
|
|
674
|
+
return true;
|
|
675
|
+
}
|
|
676
|
+
visited.push(thisProto);
|
|
677
|
+
thisProto = _getObjProto(thisProto);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
function _getObjName(target, unknownValue) {
|
|
683
|
+
if (_hasOwnProperty(target, Prototype)) {
|
|
684
|
+
return target.name || unknownValue || UnknownValue;
|
|
685
|
+
}
|
|
686
|
+
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
687
|
+
}
|
|
688
|
+
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
689
|
+
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
690
|
+
_throwTypeError("theClass is an invalid class definition.");
|
|
691
|
+
}
|
|
692
|
+
var classProto = theClass[Prototype];
|
|
693
|
+
if (!_checkPrototype(classProto, target)) {
|
|
694
|
+
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
695
|
+
}
|
|
696
|
+
var className = null;
|
|
697
|
+
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
698
|
+
className = classProto[DynClassName];
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
702
|
+
_dynamicNames++;
|
|
703
|
+
classProto[DynClassName] = className;
|
|
704
|
+
}
|
|
705
|
+
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
706
|
+
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
707
|
+
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
708
|
+
useBaseInst = !!options[strUseBaseInst];
|
|
709
|
+
}
|
|
710
|
+
var instFuncs = _getInstanceFuncs(target);
|
|
711
|
+
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
712
|
+
delegateFunc(target, baseFuncs);
|
|
713
|
+
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
714
|
+
if (setInstanceFunc && options) {
|
|
715
|
+
setInstanceFunc = !!options[strSetInstFuncs];
|
|
716
|
+
}
|
|
717
|
+
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
718
|
+
}
|
|
719
|
+
var perfDefaults = {
|
|
720
|
+
setInstFuncs: true,
|
|
721
|
+
useBaseInst: true
|
|
722
|
+
};
|
|
723
|
+
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
724
|
+
|
|
718
725
|
var strWindow = "window";
|
|
719
726
|
var strDocument = "document";
|
|
720
727
|
var strNavigator = "navigator";
|
|
@@ -1000,10 +1007,16 @@
|
|
|
1000
1007
|
}
|
|
1001
1008
|
return DiagnosticLogger;
|
|
1002
1009
|
}());
|
|
1010
|
+
function _getLogger(logger) {
|
|
1011
|
+
return (logger || new DiagnosticLogger());
|
|
1012
|
+
}
|
|
1003
1013
|
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1004
1014
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
1005
1015
|
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1006
1016
|
}
|
|
1017
|
+
function _warnToConsole(logger, message) {
|
|
1018
|
+
_getLogger(logger).warnToConsole(message);
|
|
1019
|
+
}
|
|
1007
1020
|
|
|
1008
1021
|
var strExecutionContextKey = "ctx";
|
|
1009
1022
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1186,7 +1199,7 @@
|
|
|
1186
1199
|
}
|
|
1187
1200
|
|
|
1188
1201
|
var _objDefineProperty = ObjDefineProperty;
|
|
1189
|
-
var version = "2.8.0-nightly.2204-
|
|
1202
|
+
var version = "2.8.0-nightly.2204-07";
|
|
1190
1203
|
var instanceName = "." + newId(6);
|
|
1191
1204
|
var _dataUid = 0;
|
|
1192
1205
|
function _createAccessor(target, prop, value) {
|
|
@@ -2213,95 +2226,6 @@
|
|
|
2213
2226
|
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
|
|
2214
2227
|
}
|
|
2215
2228
|
|
|
2216
|
-
var LoggingSeverity = createEnumStyle({
|
|
2217
|
-
CRITICAL: 1 ,
|
|
2218
|
-
WARNING: 2
|
|
2219
|
-
});
|
|
2220
|
-
var _InternalMessageId = createEnumStyle({
|
|
2221
|
-
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
2222
|
-
BrowserCannotReadLocalStorage: 1 ,
|
|
2223
|
-
BrowserCannotReadSessionStorage: 2 ,
|
|
2224
|
-
BrowserCannotWriteLocalStorage: 3 ,
|
|
2225
|
-
BrowserCannotWriteSessionStorage: 4 ,
|
|
2226
|
-
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
2227
|
-
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
2228
|
-
CannotSendEmptyTelemetry: 7 ,
|
|
2229
|
-
ClientPerformanceMathError: 8 ,
|
|
2230
|
-
ErrorParsingAISessionCookie: 9 ,
|
|
2231
|
-
ErrorPVCalc: 10 ,
|
|
2232
|
-
ExceptionWhileLoggingError: 11 ,
|
|
2233
|
-
FailedAddingTelemetryToBuffer: 12 ,
|
|
2234
|
-
FailedMonitorAjaxAbort: 13 ,
|
|
2235
|
-
FailedMonitorAjaxDur: 14 ,
|
|
2236
|
-
FailedMonitorAjaxOpen: 15 ,
|
|
2237
|
-
FailedMonitorAjaxRSC: 16 ,
|
|
2238
|
-
FailedMonitorAjaxSend: 17 ,
|
|
2239
|
-
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
2240
|
-
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
2241
|
-
FailedToSendQueuedTelemetry: 20 ,
|
|
2242
|
-
FailedToReportDataLoss: 21 ,
|
|
2243
|
-
FlushFailed: 22 ,
|
|
2244
|
-
MessageLimitPerPVExceeded: 23 ,
|
|
2245
|
-
MissingRequiredFieldSpecification: 24 ,
|
|
2246
|
-
NavigationTimingNotSupported: 25 ,
|
|
2247
|
-
OnError: 26 ,
|
|
2248
|
-
SessionRenewalDateIsZero: 27 ,
|
|
2249
|
-
SenderNotInitialized: 28 ,
|
|
2250
|
-
StartTrackEventFailed: 29 ,
|
|
2251
|
-
StopTrackEventFailed: 30 ,
|
|
2252
|
-
StartTrackFailed: 31 ,
|
|
2253
|
-
StopTrackFailed: 32 ,
|
|
2254
|
-
TelemetrySampledAndNotSent: 33 ,
|
|
2255
|
-
TrackEventFailed: 34 ,
|
|
2256
|
-
TrackExceptionFailed: 35 ,
|
|
2257
|
-
TrackMetricFailed: 36 ,
|
|
2258
|
-
TrackPVFailed: 37 ,
|
|
2259
|
-
TrackPVFailedCalc: 38 ,
|
|
2260
|
-
TrackTraceFailed: 39 ,
|
|
2261
|
-
TransmissionFailed: 40 ,
|
|
2262
|
-
FailedToSetStorageBuffer: 41 ,
|
|
2263
|
-
FailedToRestoreStorageBuffer: 42 ,
|
|
2264
|
-
InvalidBackendResponse: 43 ,
|
|
2265
|
-
FailedToFixDepricatedValues: 44 ,
|
|
2266
|
-
InvalidDurationValue: 45 ,
|
|
2267
|
-
TelemetryEnvelopeInvalid: 46 ,
|
|
2268
|
-
CreateEnvelopeError: 47 ,
|
|
2269
|
-
CannotSerializeObject: 48 ,
|
|
2270
|
-
CannotSerializeObjectNonSerializable: 49 ,
|
|
2271
|
-
CircularReferenceDetected: 50 ,
|
|
2272
|
-
ClearAuthContextFailed: 51 ,
|
|
2273
|
-
ExceptionTruncated: 52 ,
|
|
2274
|
-
IllegalCharsInName: 53 ,
|
|
2275
|
-
ItemNotInArray: 54 ,
|
|
2276
|
-
MaxAjaxPerPVExceeded: 55 ,
|
|
2277
|
-
MessageTruncated: 56 ,
|
|
2278
|
-
NameTooLong: 57 ,
|
|
2279
|
-
SampleRateOutOfRange: 58 ,
|
|
2280
|
-
SetAuthContextFailed: 59 ,
|
|
2281
|
-
SetAuthContextFailedAccountName: 60 ,
|
|
2282
|
-
StringValueTooLong: 61 ,
|
|
2283
|
-
StartCalledMoreThanOnce: 62 ,
|
|
2284
|
-
StopCalledWithoutStart: 63 ,
|
|
2285
|
-
TelemetryInitializerFailed: 64 ,
|
|
2286
|
-
TrackArgumentsNotSpecified: 65 ,
|
|
2287
|
-
UrlTooLong: 66 ,
|
|
2288
|
-
SessionStorageBufferFull: 67 ,
|
|
2289
|
-
CannotAccessCookie: 68 ,
|
|
2290
|
-
IdTooLong: 69 ,
|
|
2291
|
-
InvalidEvent: 70 ,
|
|
2292
|
-
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
2293
|
-
SendBrowserInfoOnUserInit: 72 ,
|
|
2294
|
-
PluginException: 73 ,
|
|
2295
|
-
NotificationException: 74 ,
|
|
2296
|
-
SnippetScriptLoadFailure: 99 ,
|
|
2297
|
-
InvalidInstrumentationKey: 100 ,
|
|
2298
|
-
CannotParseAiBlobValue: 101 ,
|
|
2299
|
-
InvalidContentBlob: 102 ,
|
|
2300
|
-
TrackPageActionEventFailed: 103 ,
|
|
2301
|
-
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
2302
|
-
InMemoryStorageBufferFull: 105
|
|
2303
|
-
});
|
|
2304
|
-
|
|
2305
2229
|
var aiInstrumentHooks = "_aiHooks";
|
|
2306
2230
|
var cbNames = [
|
|
2307
2231
|
"req", "rsp", "hkErr", "fnErr"
|
|
@@ -2393,7 +2317,7 @@
|
|
|
2393
2317
|
owner = target;
|
|
2394
2318
|
}
|
|
2395
2319
|
else if (checkPrototype) {
|
|
2396
|
-
owner = _getOwner(_getObjProto(target), name, false);
|
|
2320
|
+
owner = _getOwner(_getObjProto$1(target), name, false);
|
|
2397
2321
|
}
|
|
2398
2322
|
}
|
|
2399
2323
|
return owner;
|
|
@@ -2459,7 +2383,7 @@
|
|
|
2459
2383
|
name = strTrim(name.toString());
|
|
2460
2384
|
if (name.length > 150 ) {
|
|
2461
2385
|
nameTrunc = name.substring(0, 150 );
|
|
2462
|
-
_throwInternal(logger, 2 ,
|
|
2386
|
+
_throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
|
|
2463
2387
|
}
|
|
2464
2388
|
}
|
|
2465
2389
|
return nameTrunc || name;
|
|
@@ -2472,20 +2396,20 @@
|
|
|
2472
2396
|
value = strTrim(value);
|
|
2473
2397
|
if (value.toString().length > maxLength) {
|
|
2474
2398
|
valueTrunc = value.toString().substring(0, maxLength);
|
|
2475
|
-
_throwInternal(logger, 2 ,
|
|
2399
|
+
_throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
2476
2400
|
}
|
|
2477
2401
|
}
|
|
2478
2402
|
return valueTrunc || value;
|
|
2479
2403
|
}
|
|
2480
2404
|
function dataSanitizeUrl(logger, url) {
|
|
2481
|
-
return dataSanitizeInput(logger, url, 2048 ,
|
|
2405
|
+
return dataSanitizeInput(logger, url, 2048 , 66 );
|
|
2482
2406
|
}
|
|
2483
2407
|
function dataSanitizeMessage(logger, message) {
|
|
2484
2408
|
var messageTrunc;
|
|
2485
2409
|
if (message) {
|
|
2486
2410
|
if (message.length > 32768 ) {
|
|
2487
2411
|
messageTrunc = message.substring(0, 32768 );
|
|
2488
|
-
_throwInternal(logger, 2 ,
|
|
2412
|
+
_throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
|
|
2489
2413
|
}
|
|
2490
2414
|
}
|
|
2491
2415
|
return messageTrunc || message;
|
|
@@ -2496,7 +2420,7 @@
|
|
|
2496
2420
|
var value = "" + exception;
|
|
2497
2421
|
if (value.length > 32768 ) {
|
|
2498
2422
|
exceptionTrunc = value.substring(0, 32768 );
|
|
2499
|
-
_throwInternal(logger, 2 ,
|
|
2423
|
+
_throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
|
|
2500
2424
|
}
|
|
2501
2425
|
}
|
|
2502
2426
|
return exceptionTrunc || exception;
|
|
@@ -2510,7 +2434,7 @@
|
|
|
2510
2434
|
value = getJSON().stringify(value);
|
|
2511
2435
|
}
|
|
2512
2436
|
catch (e) {
|
|
2513
|
-
_throwInternal(logger, 2 ,
|
|
2437
|
+
_throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true);
|
|
2514
2438
|
}
|
|
2515
2439
|
}
|
|
2516
2440
|
value = dataSanitizeString(logger, value, 8192 );
|
|
@@ -2533,7 +2457,7 @@
|
|
|
2533
2457
|
return measurements;
|
|
2534
2458
|
}
|
|
2535
2459
|
function dataSanitizeId(logger, id) {
|
|
2536
|
-
return id ? dataSanitizeInput(logger, id, 128 ,
|
|
2460
|
+
return id ? dataSanitizeInput(logger, id, 128 , 69 ).toString() : id;
|
|
2537
2461
|
}
|
|
2538
2462
|
function dataSanitizeInput(logger, input, maxLength, _msgId) {
|
|
2539
2463
|
var inputTrunc;
|
|
@@ -2614,11 +2538,11 @@
|
|
|
2614
2538
|
if (isNullOrUndefined(getGlobal())) {
|
|
2615
2539
|
return null;
|
|
2616
2540
|
}
|
|
2617
|
-
var uid = new Date;
|
|
2541
|
+
var uid = (new Date).toString();
|
|
2618
2542
|
var storage = getGlobalInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
|
|
2619
|
-
storage.setItem(uid
|
|
2620
|
-
var fail = storage.getItem(uid
|
|
2621
|
-
storage.removeItem(uid
|
|
2543
|
+
storage.setItem(uid, uid);
|
|
2544
|
+
var fail = storage.getItem(uid) !== uid;
|
|
2545
|
+
storage.removeItem(uid);
|
|
2622
2546
|
if (!fail) {
|
|
2623
2547
|
return storage;
|
|
2624
2548
|
}
|
|
@@ -2661,7 +2585,7 @@
|
|
|
2661
2585
|
}
|
|
2662
2586
|
catch (e) {
|
|
2663
2587
|
_canUseSessionStorage = false;
|
|
2664
|
-
_throwInternal(logger, 2 ,
|
|
2588
|
+
_throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2665
2589
|
}
|
|
2666
2590
|
}
|
|
2667
2591
|
return null;
|
|
@@ -2675,7 +2599,7 @@
|
|
|
2675
2599
|
}
|
|
2676
2600
|
catch (e) {
|
|
2677
2601
|
_canUseSessionStorage = false;
|
|
2678
|
-
_throwInternal(logger, 2 ,
|
|
2602
|
+
_throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2679
2603
|
}
|
|
2680
2604
|
}
|
|
2681
2605
|
return false;
|
|
@@ -2689,7 +2613,7 @@
|
|
|
2689
2613
|
}
|
|
2690
2614
|
catch (e) {
|
|
2691
2615
|
_canUseSessionStorage = false;
|
|
2692
|
-
_throwInternal(logger, 2 ,
|
|
2616
|
+
_throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2693
2617
|
}
|
|
2694
2618
|
}
|
|
2695
2619
|
return false;
|
|
@@ -3433,49 +3357,35 @@
|
|
|
3433
3357
|
return PageViewPerformance;
|
|
3434
3358
|
}());
|
|
3435
3359
|
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
}
|
|
3448
|
-
|
|
3449
|
-
envelopeName
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
}
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
iKey = item[strIkey];
|
|
3458
|
-
delete item[strIkey];
|
|
3459
|
-
}
|
|
3460
|
-
var telemetryItem = {
|
|
3461
|
-
name: envelopeName,
|
|
3462
|
-
time: toISOString(new Date()),
|
|
3463
|
-
iKey: iKey,
|
|
3464
|
-
ext: systemProperties ? systemProperties : {},
|
|
3465
|
-
tags: [],
|
|
3466
|
-
data: {},
|
|
3467
|
-
baseType: baseType,
|
|
3468
|
-
baseData: item
|
|
3469
|
-
};
|
|
3470
|
-
if (!isNullOrUndefined(customProperties)) {
|
|
3471
|
-
objForEachKey(customProperties, function (prop, value) {
|
|
3472
|
-
telemetryItem.data[prop] = value;
|
|
3473
|
-
});
|
|
3474
|
-
}
|
|
3475
|
-
return telemetryItem;
|
|
3360
|
+
function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) {
|
|
3361
|
+
envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified;
|
|
3362
|
+
if (isNullOrUndefined(item) ||
|
|
3363
|
+
isNullOrUndefined(baseType) ||
|
|
3364
|
+
isNullOrUndefined(envelopeName)) {
|
|
3365
|
+
throwError("Input doesn't contain all required fields");
|
|
3366
|
+
}
|
|
3367
|
+
var iKey = "";
|
|
3368
|
+
if (item[strIkey]) {
|
|
3369
|
+
iKey = item[strIkey];
|
|
3370
|
+
delete item[strIkey];
|
|
3371
|
+
}
|
|
3372
|
+
var telemetryItem = {
|
|
3373
|
+
name: envelopeName,
|
|
3374
|
+
time: toISOString(new Date()),
|
|
3375
|
+
iKey: iKey,
|
|
3376
|
+
ext: systemProperties ? systemProperties : {},
|
|
3377
|
+
tags: [],
|
|
3378
|
+
data: {},
|
|
3379
|
+
baseType: baseType,
|
|
3380
|
+
baseData: item
|
|
3476
3381
|
};
|
|
3477
|
-
|
|
3478
|
-
|
|
3382
|
+
if (!isNullOrUndefined(customProperties)) {
|
|
3383
|
+
objForEachKey(customProperties, function (prop, value) {
|
|
3384
|
+
telemetryItem.data[prop] = value;
|
|
3385
|
+
});
|
|
3386
|
+
}
|
|
3387
|
+
return telemetryItem;
|
|
3388
|
+
}
|
|
3479
3389
|
|
|
3480
3390
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
3481
3391
|
var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
|
|
@@ -3534,7 +3444,7 @@
|
|
|
3534
3444
|
if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {
|
|
3535
3445
|
appInsights.sendPageViewInternal(pageView, customProperties);
|
|
3536
3446
|
_flushChannels(true);
|
|
3537
|
-
_logger
|
|
3447
|
+
_throwInternal(_logger, 2 , 25 , "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
|
|
3538
3448
|
return;
|
|
3539
3449
|
}
|
|
3540
3450
|
var pageViewSent = false;
|
|
@@ -3600,7 +3510,7 @@
|
|
|
3600
3510
|
}
|
|
3601
3511
|
}
|
|
3602
3512
|
catch (e) {
|
|
3603
|
-
_logger
|
|
3513
|
+
_throwInternal(_logger, 1 , 38 , "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3604
3514
|
}
|
|
3605
3515
|
return processed;
|
|
3606
3516
|
});
|
|
@@ -3635,7 +3545,7 @@
|
|
|
3635
3545
|
}
|
|
3636
3546
|
}
|
|
3637
3547
|
catch (e) {
|
|
3638
|
-
this._logger
|
|
3548
|
+
_warnToConsole(this._logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e));
|
|
3639
3549
|
}
|
|
3640
3550
|
};
|
|
3641
3551
|
PageVisitTimeManager.prototype.restartPageVisitTimer = function (pageName, pageUrl) {
|
|
@@ -3645,7 +3555,7 @@
|
|
|
3645
3555
|
return prevPageVisitData;
|
|
3646
3556
|
}
|
|
3647
3557
|
catch (e) {
|
|
3648
|
-
this._logger
|
|
3558
|
+
_warnToConsole(this._logger, "Call to restart failed: " + dumpObj(e));
|
|
3649
3559
|
return null;
|
|
3650
3560
|
}
|
|
3651
3561
|
};
|
|
@@ -3661,7 +3571,7 @@
|
|
|
3661
3571
|
}
|
|
3662
3572
|
}
|
|
3663
3573
|
catch (e) {
|
|
3664
|
-
this._logger
|
|
3574
|
+
_warnToConsole(this._logger, "Call to start failed: " + dumpObj(e));
|
|
3665
3575
|
}
|
|
3666
3576
|
};
|
|
3667
3577
|
PageVisitTimeManager.prototype.stopPageVisitTimer = function () {
|
|
@@ -3682,7 +3592,7 @@
|
|
|
3682
3592
|
return null;
|
|
3683
3593
|
}
|
|
3684
3594
|
catch (e) {
|
|
3685
|
-
this._logger
|
|
3595
|
+
_warnToConsole(this._logger, "Stop page visit timer failed: " + dumpObj(e));
|
|
3686
3596
|
return null;
|
|
3687
3597
|
}
|
|
3688
3598
|
};
|
|
@@ -3728,14 +3638,15 @@
|
|
|
3728
3638
|
response = dateTimeUtilsDuration(timing.responseStart, timing.responseEnd);
|
|
3729
3639
|
dom = dateTimeUtilsDuration(timing.responseEnd, timing.loadEventEnd);
|
|
3730
3640
|
}
|
|
3641
|
+
var logger = this._logger;
|
|
3731
3642
|
if (total === 0) {
|
|
3732
|
-
|
|
3643
|
+
_throwInternal(logger, 2 , 10 , "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom });
|
|
3733
3644
|
}
|
|
3734
3645
|
else if (!this.shouldCollectDuration(total, network, request, response, dom)) {
|
|
3735
|
-
|
|
3646
|
+
_throwInternal(logger, 2 , 45 , "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom });
|
|
3736
3647
|
}
|
|
3737
3648
|
else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) {
|
|
3738
|
-
|
|
3649
|
+
_throwInternal(logger, 2 , 8 , "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom });
|
|
3739
3650
|
}
|
|
3740
3651
|
else {
|
|
3741
3652
|
pageViewPerformance.durationMs = total;
|
|
@@ -3816,14 +3727,14 @@
|
|
|
3816
3727
|
var _events = {};
|
|
3817
3728
|
_self.start = function (name) {
|
|
3818
3729
|
if (typeof _events[name] !== "undefined") {
|
|
3819
|
-
_throwInternal(logger,
|
|
3730
|
+
_throwInternal(logger, 2 , 62 , "start was called more than once for this event without calling stop.", { name: name, key: name }, true);
|
|
3820
3731
|
}
|
|
3821
3732
|
_events[name] = +new Date;
|
|
3822
3733
|
};
|
|
3823
3734
|
_self.stop = function (name, url, properties, measurements) {
|
|
3824
3735
|
var start = _events[name];
|
|
3825
3736
|
if (isNaN(start)) {
|
|
3826
|
-
_throwInternal(logger,
|
|
3737
|
+
_throwInternal(logger, 2 , 63 , "stop was called without a corresponding start.", { name: name, key: name }, true);
|
|
3827
3738
|
}
|
|
3828
3739
|
else {
|
|
3829
3740
|
var end = +new Date;
|
|
@@ -3929,11 +3840,11 @@
|
|
|
3929
3840
|
};
|
|
3930
3841
|
_self.trackEvent = function (event, customProperties) {
|
|
3931
3842
|
try {
|
|
3932
|
-
var telemetryItem =
|
|
3843
|
+
var telemetryItem = createTelemetryItem(event, Event$1.dataType, Event$1.envelopeType, _self.diagLog(), customProperties);
|
|
3933
3844
|
_self.core.track(telemetryItem);
|
|
3934
3845
|
}
|
|
3935
3846
|
catch (e) {
|
|
3936
|
-
_throwInternal(
|
|
3847
|
+
_throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3937
3848
|
}
|
|
3938
3849
|
};
|
|
3939
3850
|
_self.startTrackEvent = function (name) {
|
|
@@ -3941,7 +3852,7 @@
|
|
|
3941
3852
|
_eventTracking.start(name);
|
|
3942
3853
|
}
|
|
3943
3854
|
catch (e) {
|
|
3944
|
-
_throwInternal(
|
|
3855
|
+
_throwInternal(1 , 29 , "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3945
3856
|
}
|
|
3946
3857
|
};
|
|
3947
3858
|
_self.stopTrackEvent = function (name, properties, measurements) {
|
|
@@ -3949,25 +3860,25 @@
|
|
|
3949
3860
|
_eventTracking.stop(name, undefined, properties);
|
|
3950
3861
|
}
|
|
3951
3862
|
catch (e) {
|
|
3952
|
-
_throwInternal(
|
|
3863
|
+
_throwInternal(1 , 30 , "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3953
3864
|
}
|
|
3954
3865
|
};
|
|
3955
3866
|
_self.trackTrace = function (trace, customProperties) {
|
|
3956
3867
|
try {
|
|
3957
|
-
var telemetryItem =
|
|
3868
|
+
var telemetryItem = createTelemetryItem(trace, Trace.dataType, Trace.envelopeType, _self.diagLog(), customProperties);
|
|
3958
3869
|
_self.core.track(telemetryItem);
|
|
3959
3870
|
}
|
|
3960
3871
|
catch (e) {
|
|
3961
|
-
_throwInternal(
|
|
3872
|
+
_throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3962
3873
|
}
|
|
3963
3874
|
};
|
|
3964
3875
|
_self.trackMetric = function (metric, customProperties) {
|
|
3965
3876
|
try {
|
|
3966
|
-
var telemetryItem =
|
|
3877
|
+
var telemetryItem = createTelemetryItem(metric, Metric.dataType, Metric.envelopeType, _self.diagLog(), customProperties);
|
|
3967
3878
|
_self.core.track(telemetryItem);
|
|
3968
3879
|
}
|
|
3969
3880
|
catch (e) {
|
|
3970
|
-
_throwInternal(
|
|
3881
|
+
_throwInternal(1 , 36 , "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3971
3882
|
}
|
|
3972
3883
|
};
|
|
3973
3884
|
_self.trackPageView = function (pageView, customProperties) {
|
|
@@ -3979,7 +3890,7 @@
|
|
|
3979
3890
|
}
|
|
3980
3891
|
}
|
|
3981
3892
|
catch (e) {
|
|
3982
|
-
_throwInternal(
|
|
3893
|
+
_throwInternal(1 , 37 , "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3983
3894
|
}
|
|
3984
3895
|
};
|
|
3985
3896
|
_self.sendPageViewInternal = function (pageView, properties, systemProperties) {
|
|
@@ -3987,11 +3898,11 @@
|
|
|
3987
3898
|
if (doc) {
|
|
3988
3899
|
pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri;
|
|
3989
3900
|
}
|
|
3990
|
-
var telemetryItem =
|
|
3901
|
+
var telemetryItem = createTelemetryItem(pageView, PageView.dataType, PageView.envelopeType, _self.diagLog(), properties, systemProperties);
|
|
3991
3902
|
_self.core.track(telemetryItem);
|
|
3992
3903
|
};
|
|
3993
3904
|
_self.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) {
|
|
3994
|
-
var telemetryItem =
|
|
3905
|
+
var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, _self.diagLog(), properties, systemProperties);
|
|
3995
3906
|
_self.core.track(telemetryItem);
|
|
3996
3907
|
};
|
|
3997
3908
|
_self.trackPageViewPerformance = function (pageViewPerformance, customProperties) {
|
|
@@ -4001,7 +3912,7 @@
|
|
|
4001
3912
|
_self.sendPageViewPerformanceInternal(inPvp, customProperties);
|
|
4002
3913
|
}
|
|
4003
3914
|
catch (e) {
|
|
4004
|
-
_throwInternal(
|
|
3915
|
+
_throwInternal(1 , 37 , "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4005
3916
|
}
|
|
4006
3917
|
};
|
|
4007
3918
|
_self.startTrackPage = function (name) {
|
|
@@ -4013,7 +3924,7 @@
|
|
|
4013
3924
|
_pageTracking.start(name);
|
|
4014
3925
|
}
|
|
4015
3926
|
catch (e) {
|
|
4016
|
-
_throwInternal(
|
|
3927
|
+
_throwInternal(1 , 31 , "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4017
3928
|
}
|
|
4018
3929
|
};
|
|
4019
3930
|
_self.stopTrackPage = function (name, url, properties, measurement) {
|
|
@@ -4032,13 +3943,13 @@
|
|
|
4032
3943
|
}
|
|
4033
3944
|
}
|
|
4034
3945
|
catch (e) {
|
|
4035
|
-
_throwInternal(
|
|
3946
|
+
_throwInternal(1 , 32 , "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4036
3947
|
}
|
|
4037
3948
|
};
|
|
4038
3949
|
_self.sendExceptionInternal = function (exception, customProperties, systemProperties) {
|
|
4039
3950
|
var theError = exception.exception || exception.error || new Error(strNotSpecified);
|
|
4040
3951
|
var exceptionPartB = new Exception(_self.diagLog(), theError, exception.properties || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface();
|
|
4041
|
-
var telemetryItem =
|
|
3952
|
+
var telemetryItem = createTelemetryItem(exceptionPartB, Exception.dataType, Exception.envelopeType, _self.diagLog(), customProperties, systemProperties);
|
|
4042
3953
|
_self.core.track(telemetryItem);
|
|
4043
3954
|
};
|
|
4044
3955
|
_self.trackException = function (exception, customProperties) {
|
|
@@ -4049,7 +3960,7 @@
|
|
|
4049
3960
|
_self.sendExceptionInternal(exception, customProperties);
|
|
4050
3961
|
}
|
|
4051
3962
|
catch (e) {
|
|
4052
|
-
_throwInternal(
|
|
3963
|
+
_throwInternal(1 , 35 , "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4053
3964
|
}
|
|
4054
3965
|
};
|
|
4055
3966
|
_self._onerror = function (exception) {
|
|
@@ -4078,12 +3989,12 @@
|
|
|
4078
3989
|
if (!exception.errorSrc) {
|
|
4079
3990
|
exception.errorSrc = errorSrc;
|
|
4080
3991
|
}
|
|
4081
|
-
_self.trackException({ exception: exception, severityLevel:
|
|
3992
|
+
_self.trackException({ exception: exception, severityLevel: 3 }, properties);
|
|
4082
3993
|
}
|
|
4083
3994
|
}
|
|
4084
3995
|
catch (e) {
|
|
4085
3996
|
var errorString = error ? (error.name + ", " + error.message) : "null";
|
|
4086
|
-
_throwInternal(
|
|
3997
|
+
_throwInternal(1 , 11 , "_onError threw exception while logging error, error will not be collected: "
|
|
4087
3998
|
+ getExceptionName(e), { exception: dumpObj(e), errorString: errorString });
|
|
4088
3999
|
}
|
|
4089
4000
|
};
|
|
@@ -4206,7 +4117,7 @@
|
|
|
4206
4117
|
}
|
|
4207
4118
|
}
|
|
4208
4119
|
function _sendCORSException(exception, properties) {
|
|
4209
|
-
var telemetryItem =
|
|
4120
|
+
var telemetryItem = createTelemetryItem(exception, Exception.dataType, Exception.envelopeType, _self.diagLog(), properties);
|
|
4210
4121
|
_self.core.track(telemetryItem);
|
|
4211
4122
|
}
|
|
4212
4123
|
function _updateExceptionTracking(extConfig) {
|
|
@@ -4338,7 +4249,7 @@
|
|
|
4338
4249
|
});
|
|
4339
4250
|
return _this;
|
|
4340
4251
|
}
|
|
4341
|
-
AnalyticsPlugin.Version = "2.8.0-nightly.2204-
|
|
4252
|
+
AnalyticsPlugin.Version = "2.8.0-nightly.2204-07";
|
|
4342
4253
|
AnalyticsPlugin.getDefaultConfig = _getDefaultConfig;
|
|
4343
4254
|
return AnalyticsPlugin;
|
|
4344
4255
|
}(BaseTelemetryPlugin));
|