@microsoft/applicationinsights-common 3.0.6 → 3.0.7-nightly3.2312-05
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/es5/applicationinsights-common.cjs.js +358 -14
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +360 -16
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +360 -16
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +358 -14
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/Offline.js +138 -0
- package/dist-es5/Offline.js.map +1 -0
- package/dist-es5/RequestResponseHeaders.js +1 -1
- package/dist-es5/StorageHelperFuncs.js +3 -3
- package/dist-es5/StorageHelperFuncs.js.map +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +4 -4
- package/dist-es5/Telemetry/Exception.js.map +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +1 -1
- package/dist-es5/ThrottleMgr.js +3 -3
- package/dist-es5/ThrottleMgr.js.map +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +1 -1
- package/dist-es5/__DynamicConstants.js +2 -1
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-common.js +2 -1
- package/dist-es5/applicationinsights-common.js.map +1 -1
- package/package.json +66 -63
- package/types/applicationinsights-common.d.ts +47 -1
- package/types/applicationinsights-common.namespaced.d.ts +47 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.7-nightly3.2312-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -686,7 +686,7 @@ var _DYN_SET_DF = "setDf";
|
|
|
686
686
|
var _DYN_WATCH = "watch";
|
|
687
687
|
var _DYN_LOGGER = "logger";
|
|
688
688
|
var _DYN_APPLY = "apply";
|
|
689
|
-
var _DYN_PUSH = "push";
|
|
689
|
+
var _DYN_PUSH$1 = "push";
|
|
690
690
|
var _DYN_SPLICE = "splice";
|
|
691
691
|
var _DYN_HDLR = "hdlr";
|
|
692
692
|
var _DYN_CANCEL = "cancel";
|
|
@@ -699,8 +699,11 @@ var _DYN_MESSAGE$1 = "message";
|
|
|
699
699
|
var _DYN_DIAG_LOG = "diagLog";
|
|
700
700
|
var _DYN_USER_AGENT = "userAgent";
|
|
701
701
|
var _DYN_SPLIT$1 = "split";
|
|
702
|
+
var _DYN_NODE_TYPE = "nodeType";
|
|
702
703
|
var _DYN_REPLACE = "replace";
|
|
703
704
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
705
|
+
var _DYN_TYPE = "type";
|
|
706
|
+
var _DYN_HANDLER = "handler";
|
|
704
707
|
var _DYN_TRACE_ID = "traceId";
|
|
705
708
|
var _DYN_SPAN_ID = "spanId";
|
|
706
709
|
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
@@ -1217,13 +1220,62 @@ function newId(maxLength) {
|
|
|
1217
1220
|
return result;
|
|
1218
1221
|
}
|
|
1219
1222
|
|
|
1220
|
-
var version = '3.0.
|
|
1223
|
+
var version = '3.0.7-nightly3.2312-05';
|
|
1221
1224
|
var instanceName = "." + newId(6);
|
|
1222
1225
|
var _dataUid = 0;
|
|
1226
|
+
function _canAcceptData(target) {
|
|
1227
|
+
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1228
|
+
}
|
|
1229
|
+
function _getCache(data, target) {
|
|
1230
|
+
var theCache = target[data.id];
|
|
1231
|
+
if (!theCache) {
|
|
1232
|
+
theCache = {};
|
|
1233
|
+
try {
|
|
1234
|
+
if (_canAcceptData(target)) {
|
|
1235
|
+
objDefine(target, data.id, {
|
|
1236
|
+
e: false,
|
|
1237
|
+
v: theCache
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
catch (e) {
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
return theCache;
|
|
1245
|
+
}
|
|
1223
1246
|
function createUniqueNamespace(name, includeVersion) {
|
|
1224
1247
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
1225
1248
|
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
|
1226
1249
|
}
|
|
1250
|
+
function createElmNodeData(name) {
|
|
1251
|
+
var data = {
|
|
1252
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
|
1253
|
+
accept: function (target) {
|
|
1254
|
+
return _canAcceptData(target);
|
|
1255
|
+
},
|
|
1256
|
+
get: function (target, name, defValue, addDefault) {
|
|
1257
|
+
var theCache = target[data.id];
|
|
1258
|
+
if (!theCache) {
|
|
1259
|
+
if (addDefault) {
|
|
1260
|
+
theCache = _getCache(data, target);
|
|
1261
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1262
|
+
}
|
|
1263
|
+
return defValue;
|
|
1264
|
+
}
|
|
1265
|
+
return theCache[normalizeJsName(name)];
|
|
1266
|
+
},
|
|
1267
|
+
kill: function (target, name) {
|
|
1268
|
+
if (target && target[name]) {
|
|
1269
|
+
try {
|
|
1270
|
+
delete target[name];
|
|
1271
|
+
}
|
|
1272
|
+
catch (e) {
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
return data;
|
|
1278
|
+
}
|
|
1227
1279
|
|
|
1228
1280
|
function _isConfigDefaults(value) {
|
|
1229
1281
|
return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, "v") || objHasOwn(value, "mrg") || objHasOwn(value, "ref") || value.set));
|
|
@@ -1446,7 +1498,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1446
1498
|
trk: function (handler) {
|
|
1447
1499
|
if (handler && handler.fn) {
|
|
1448
1500
|
if (arrIndexOf(detail.h, handler) === -1) {
|
|
1449
|
-
detail.h[_DYN_PUSH ](handler);
|
|
1501
|
+
detail.h[_DYN_PUSH$1 ](handler);
|
|
1450
1502
|
}
|
|
1451
1503
|
state.trk(handler, detail);
|
|
1452
1504
|
}
|
|
@@ -1658,7 +1710,7 @@ function _createState(cfgHandler) {
|
|
|
1658
1710
|
_useHandler(handler, handler.fn);
|
|
1659
1711
|
}
|
|
1660
1712
|
catch (e) {
|
|
1661
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1713
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1662
1714
|
}
|
|
1663
1715
|
}
|
|
1664
1716
|
}
|
|
@@ -1668,7 +1720,7 @@ function _createState(cfgHandler) {
|
|
|
1668
1720
|
_notifyWatchers();
|
|
1669
1721
|
}
|
|
1670
1722
|
catch (e) {
|
|
1671
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1723
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1672
1724
|
}
|
|
1673
1725
|
}
|
|
1674
1726
|
if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
|
|
@@ -1690,7 +1742,7 @@ function _createState(cfgHandler) {
|
|
|
1690
1742
|
for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
|
|
1691
1743
|
var handler = detail.h[idx];
|
|
1692
1744
|
if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
|
|
1693
|
-
_waitingHandlers[_DYN_PUSH ](handler);
|
|
1745
|
+
_waitingHandlers[_DYN_PUSH$1 ](handler);
|
|
1694
1746
|
}
|
|
1695
1747
|
}
|
|
1696
1748
|
}
|
|
@@ -1699,7 +1751,7 @@ function _createState(cfgHandler) {
|
|
|
1699
1751
|
if (handler) {
|
|
1700
1752
|
var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
|
|
1701
1753
|
if (arrIndexOf(details, detail) === -1) {
|
|
1702
|
-
details[_DYN_PUSH ](detail);
|
|
1754
|
+
details[_DYN_PUSH$1 ](detail);
|
|
1703
1755
|
}
|
|
1704
1756
|
}
|
|
1705
1757
|
}
|
|
@@ -1987,14 +2039,14 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
1987
2039
|
}
|
|
1988
2040
|
if (logMessage) {
|
|
1989
2041
|
if (severity <= _loggingLevelTelemetry) {
|
|
1990
|
-
_self.queue[_DYN_PUSH ](message);
|
|
2042
|
+
_self.queue[_DYN_PUSH$1 ](message);
|
|
1991
2043
|
_messageCount++;
|
|
1992
2044
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
1993
2045
|
}
|
|
1994
2046
|
if (_messageCount === _maxInternalMessageLimit) {
|
|
1995
2047
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1996
2048
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
1997
|
-
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
2049
|
+
_self.queue[_DYN_PUSH$1 ](throttleMessage);
|
|
1998
2050
|
if (severity === 1 ) {
|
|
1999
2051
|
_self.errorToConsole(throttleLimitMessage);
|
|
2000
2052
|
}
|
|
@@ -2166,6 +2218,180 @@ function findW3cTraceParent(selectIdx) {
|
|
|
2166
2218
|
return traceParent;
|
|
2167
2219
|
}
|
|
2168
2220
|
|
|
2221
|
+
var strOnPrefix = "on";
|
|
2222
|
+
var strAttachEvent = "attachEvent";
|
|
2223
|
+
var strAddEventHelper = "addEventListener";
|
|
2224
|
+
var strDetachEvent = "detachEvent";
|
|
2225
|
+
var strRemoveEventListener = "removeEventListener";
|
|
2226
|
+
var strEvents = "events";
|
|
2227
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
2228
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
2229
|
+
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2230
|
+
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2231
|
+
var _guid = 1;
|
|
2232
|
+
var elmNodeData = createElmNodeData("events");
|
|
2233
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2234
|
+
function _normalizeNamespace(name) {
|
|
2235
|
+
if (name && name[_DYN_REPLACE ]) {
|
|
2236
|
+
return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY);
|
|
2237
|
+
}
|
|
2238
|
+
return name;
|
|
2239
|
+
}
|
|
2240
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2241
|
+
var _a;
|
|
2242
|
+
if (evtNamespace) {
|
|
2243
|
+
var theNamespace_1 = STR_EMPTY;
|
|
2244
|
+
if (isArray(evtNamespace)) {
|
|
2245
|
+
theNamespace_1 = STR_EMPTY;
|
|
2246
|
+
arrForEach(evtNamespace, function (name) {
|
|
2247
|
+
name = _normalizeNamespace(name);
|
|
2248
|
+
if (name) {
|
|
2249
|
+
if (name[0] !== ".") {
|
|
2250
|
+
name = "." + name;
|
|
2251
|
+
}
|
|
2252
|
+
theNamespace_1 += name;
|
|
2253
|
+
}
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
else {
|
|
2257
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2258
|
+
}
|
|
2259
|
+
if (theNamespace_1) {
|
|
2260
|
+
if (theNamespace_1[0] !== ".") {
|
|
2261
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
2262
|
+
}
|
|
2263
|
+
eventName = (eventName || STR_EMPTY) + theNamespace_1;
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);
|
|
2267
|
+
return _a = {},
|
|
2268
|
+
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
2269
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
2270
|
+
_a;
|
|
2271
|
+
}
|
|
2272
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
2273
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
2274
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
2275
|
+
var registeredEvents = aiEvts[evtName];
|
|
2276
|
+
if (!registeredEvents) {
|
|
2277
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
2278
|
+
}
|
|
2279
|
+
return registeredEvents;
|
|
2280
|
+
}
|
|
2281
|
+
function _doDetach(obj, evtName, handlerRef, useCapture) {
|
|
2282
|
+
if (obj && evtName && evtName[_DYN_TYPE ]) {
|
|
2283
|
+
if (obj[strRemoveEventListener]) {
|
|
2284
|
+
obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2285
|
+
}
|
|
2286
|
+
else if (obj[strDetachEvent]) {
|
|
2287
|
+
obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
2292
|
+
var result = false;
|
|
2293
|
+
if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) {
|
|
2294
|
+
if (obj[strAddEventHelper]) {
|
|
2295
|
+
obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2296
|
+
result = true;
|
|
2297
|
+
}
|
|
2298
|
+
else if (obj[strAttachEvent]) {
|
|
2299
|
+
obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2300
|
+
result = true;
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
return result;
|
|
2304
|
+
}
|
|
2305
|
+
function _doUnregister(target, events, evtName, unRegFn) {
|
|
2306
|
+
var idx = events[_DYN_LENGTH$1 ];
|
|
2307
|
+
while (idx--) {
|
|
2308
|
+
var theEvent = events[idx];
|
|
2309
|
+
if (theEvent) {
|
|
2310
|
+
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
2311
|
+
if (!unRegFn || unRegFn(theEvent)) {
|
|
2312
|
+
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
2313
|
+
events[_DYN_SPLICE ](idx, 1);
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
function _unregisterEvents(target, evtName, unRegFn) {
|
|
2320
|
+
if (evtName[_DYN_TYPE ]) {
|
|
2321
|
+
_doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn);
|
|
2322
|
+
}
|
|
2323
|
+
else {
|
|
2324
|
+
var eventCache = elmNodeData.get(target, strEvents, {});
|
|
2325
|
+
objForEachKey(eventCache, function (evtType, events) {
|
|
2326
|
+
_doUnregister(target, events, evtName, unRegFn);
|
|
2327
|
+
});
|
|
2328
|
+
if (objKeys(eventCache)[_DYN_LENGTH$1 ] === 0) {
|
|
2329
|
+
elmNodeData.kill(target, strEvents);
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
2334
|
+
var newNamespaces;
|
|
2335
|
+
if (namespaces) {
|
|
2336
|
+
if (isArray(namespaces)) {
|
|
2337
|
+
newNamespaces = [theNamespace].concat(namespaces);
|
|
2338
|
+
}
|
|
2339
|
+
else {
|
|
2340
|
+
newNamespaces = [theNamespace, namespaces];
|
|
2341
|
+
}
|
|
2342
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ](".");
|
|
2343
|
+
}
|
|
2344
|
+
else {
|
|
2345
|
+
newNamespaces = theNamespace;
|
|
2346
|
+
}
|
|
2347
|
+
return newNamespaces;
|
|
2348
|
+
}
|
|
2349
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2350
|
+
var _a;
|
|
2351
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2352
|
+
var result = false;
|
|
2353
|
+
if (target) {
|
|
2354
|
+
try {
|
|
2355
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2356
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2357
|
+
if (result && elmNodeData.accept(target)) {
|
|
2358
|
+
var registeredEvent = (_a = {
|
|
2359
|
+
guid: _guid++,
|
|
2360
|
+
evtName: evtName
|
|
2361
|
+
},
|
|
2362
|
+
_a[_DYN_HANDLER ] = handlerRef,
|
|
2363
|
+
_a.capture = useCapture,
|
|
2364
|
+
_a);
|
|
2365
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
catch (e) {
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return result;
|
|
2372
|
+
}
|
|
2373
|
+
function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2374
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2375
|
+
if (target) {
|
|
2376
|
+
try {
|
|
2377
|
+
var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
|
|
2378
|
+
var found_1 = false;
|
|
2379
|
+
_unregisterEvents(target, evtName_1, function (regEvent) {
|
|
2380
|
+
if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) {
|
|
2381
|
+
found_1 = true;
|
|
2382
|
+
return true;
|
|
2383
|
+
}
|
|
2384
|
+
return false;
|
|
2385
|
+
});
|
|
2386
|
+
if (!found_1) {
|
|
2387
|
+
_doDetach(target, evtName_1, handlerRef, useCapture);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
catch (e) {
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2169
2395
|
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2170
2396
|
var SampleRate = "sampleRate";
|
|
2171
2397
|
var ProcessLegacy = "ProcessLegacy";
|
|
@@ -2192,6 +2418,7 @@ var _DYN_LENGTH = "length";
|
|
|
2192
2418
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
2193
2419
|
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
2194
2420
|
var _DYN_TO_STRING = "toString";
|
|
2421
|
+
var _DYN_PUSH = "push";
|
|
2195
2422
|
var _DYN_REMOVE_ITEM = "removeItem";
|
|
2196
2423
|
var _DYN_NAME = "name";
|
|
2197
2424
|
var _DYN_MESSAGE = "message";
|
|
@@ -2683,7 +2910,7 @@ function utlGetSessionStorageKeys() {
|
|
|
2683
2910
|
var keys = [];
|
|
2684
2911
|
if (utlCanUseSessionStorage()) {
|
|
2685
2912
|
objForEachKey(getInst("sessionStorage"), function (key) {
|
|
2686
|
-
keys
|
|
2913
|
+
keys[_DYN_PUSH ](key);
|
|
2687
2914
|
});
|
|
2688
2915
|
}
|
|
2689
2916
|
return keys;
|
|
@@ -2843,7 +3070,7 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2843
3070
|
else {
|
|
2844
3071
|
if (!!saveUnsentMsg) {
|
|
2845
3072
|
var queue = _getQueueByKey(msgID);
|
|
2846
|
-
queue
|
|
3073
|
+
queue[_DYN_PUSH ]({
|
|
2847
3074
|
msgID: msgID,
|
|
2848
3075
|
message: message,
|
|
2849
3076
|
severity: severity
|
|
@@ -3222,7 +3449,7 @@ function _getOperaStack(errorMessage) {
|
|
|
3222
3449
|
entry += "@" + lines[lp + 1];
|
|
3223
3450
|
lp++;
|
|
3224
3451
|
}
|
|
3225
|
-
stack
|
|
3452
|
+
stack[_DYN_PUSH ](entry);
|
|
3226
3453
|
}
|
|
3227
3454
|
return {
|
|
3228
3455
|
src: errorMessage,
|
|
@@ -3305,7 +3532,7 @@ function _parseStack(stack) {
|
|
|
3305
3532
|
if (_StackFrame.regex.test(theFrame)) {
|
|
3306
3533
|
var parsedFrame = new _StackFrame(theFrame, level_1++);
|
|
3307
3534
|
totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ];
|
|
3308
|
-
parsedStack
|
|
3535
|
+
parsedStack[_DYN_PUSH ](parsedFrame);
|
|
3309
3536
|
}
|
|
3310
3537
|
});
|
|
3311
3538
|
var exceptionParsedStackThreshold = 32 * 1024;
|
|
@@ -3993,6 +4220,122 @@ function createDomEvent(eventName) {
|
|
|
3993
4220
|
return event;
|
|
3994
4221
|
}
|
|
3995
4222
|
|
|
4223
|
+
function _disableEvents(target, evtNamespace) {
|
|
4224
|
+
eventOff(target, null, null, evtNamespace);
|
|
4225
|
+
}
|
|
4226
|
+
function createOfflineListener(parentEvtNamespace) {
|
|
4227
|
+
var _document = getDocument();
|
|
4228
|
+
var _navigator = getNavigator();
|
|
4229
|
+
var _isListening = false;
|
|
4230
|
+
var listenerList = [];
|
|
4231
|
+
var rState = 1 ;
|
|
4232
|
+
if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) {
|
|
4233
|
+
rState = 2 ;
|
|
4234
|
+
}
|
|
4235
|
+
var uState = 0 ;
|
|
4236
|
+
var _currentState = calCurrentState();
|
|
4237
|
+
var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace);
|
|
4238
|
+
try {
|
|
4239
|
+
if (_enableEvents(getWindow())) {
|
|
4240
|
+
_isListening = true;
|
|
4241
|
+
}
|
|
4242
|
+
if (_document) {
|
|
4243
|
+
var target = _document.body || _document;
|
|
4244
|
+
if (target.ononline) {
|
|
4245
|
+
if (_enableEvents(target)) {
|
|
4246
|
+
_isListening = true;
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
catch (e) {
|
|
4252
|
+
_isListening = false;
|
|
4253
|
+
}
|
|
4254
|
+
function _enableEvents(target) {
|
|
4255
|
+
var enabled = false;
|
|
4256
|
+
if (target) {
|
|
4257
|
+
enabled = eventOn(target, "online", _setOnline, _evtNamespace);
|
|
4258
|
+
if (enabled) {
|
|
4259
|
+
eventOn(target, "offline", _setOffline, _evtNamespace);
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
return enabled;
|
|
4263
|
+
}
|
|
4264
|
+
function _isOnline() {
|
|
4265
|
+
return _currentState;
|
|
4266
|
+
}
|
|
4267
|
+
function calCurrentState() {
|
|
4268
|
+
if (uState === 2 || rState === 2 ) {
|
|
4269
|
+
return false;
|
|
4270
|
+
}
|
|
4271
|
+
return true;
|
|
4272
|
+
}
|
|
4273
|
+
function listnerNoticeCheck() {
|
|
4274
|
+
var newState = calCurrentState();
|
|
4275
|
+
if (_currentState !== newState) {
|
|
4276
|
+
_currentState = newState;
|
|
4277
|
+
arrForEach(listenerList, function (callback) {
|
|
4278
|
+
var offlineState = {
|
|
4279
|
+
isOnline: _currentState,
|
|
4280
|
+
rState: rState,
|
|
4281
|
+
uState: uState
|
|
4282
|
+
};
|
|
4283
|
+
try {
|
|
4284
|
+
callback(offlineState);
|
|
4285
|
+
}
|
|
4286
|
+
catch (e) {
|
|
4287
|
+
}
|
|
4288
|
+
});
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
function setOnlineState(newState) {
|
|
4292
|
+
uState = newState;
|
|
4293
|
+
listnerNoticeCheck();
|
|
4294
|
+
}
|
|
4295
|
+
function _setOnline() {
|
|
4296
|
+
rState = 1 ;
|
|
4297
|
+
listnerNoticeCheck();
|
|
4298
|
+
}
|
|
4299
|
+
function _setOffline() {
|
|
4300
|
+
rState = 2 ;
|
|
4301
|
+
listnerNoticeCheck();
|
|
4302
|
+
}
|
|
4303
|
+
function _unload() {
|
|
4304
|
+
var win = getWindow();
|
|
4305
|
+
if (win && _isListening) {
|
|
4306
|
+
_disableEvents(win, _evtNamespace);
|
|
4307
|
+
if (_document) {
|
|
4308
|
+
var target = _document.body || _document;
|
|
4309
|
+
if (!isUndefined(target.ononline)) {
|
|
4310
|
+
_disableEvents(target, _evtNamespace);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
_isListening = false;
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
function addListener(callback) {
|
|
4317
|
+
listenerList[_DYN_PUSH ](callback);
|
|
4318
|
+
return {
|
|
4319
|
+
rm: function () {
|
|
4320
|
+
var index = listenerList.indexOf(callback);
|
|
4321
|
+
if (index > -1) {
|
|
4322
|
+
return listenerList.splice(index, 1);
|
|
4323
|
+
}
|
|
4324
|
+
else {
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
};
|
|
4329
|
+
}
|
|
4330
|
+
return {
|
|
4331
|
+
isOnline: _isOnline,
|
|
4332
|
+
isListening: function () { return _isListening; },
|
|
4333
|
+
unload: _unload,
|
|
4334
|
+
addListener: addListener,
|
|
4335
|
+
setOnlineState: setOnlineState
|
|
4336
|
+
};
|
|
4337
|
+
}
|
|
4338
|
+
|
|
3996
4339
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
3997
4340
|
var BreezeChannelIdentifier = "AppInsightsChannelPlugin";
|
|
3998
4341
|
var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
|
|
@@ -4032,6 +4375,7 @@ exports.correlationIdGetPrefix = correlationIdGetPrefix;
|
|
|
4032
4375
|
exports.correlationIdSetPrefix = correlationIdSetPrefix;
|
|
4033
4376
|
exports.createDistributedTraceContextFromTrace = createDistributedTraceContextFromTrace;
|
|
4034
4377
|
exports.createDomEvent = createDomEvent;
|
|
4378
|
+
exports.createOfflineListener = createOfflineListener;
|
|
4035
4379
|
exports.createTelemetryItem = createTelemetryItem;
|
|
4036
4380
|
exports.createTraceParent = createTraceParent;
|
|
4037
4381
|
exports.dataSanitizeException = dataSanitizeException;
|