@microsoft/1ds-core-js 3.1.9 → 3.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{ms.core-3.1.9.gbl.js → ms.core-3.1.10.gbl.js} +107 -36
- package/bundle/ms.core-3.1.10.gbl.js.map +1 -0
- package/bundle/ms.core-3.1.10.gbl.min.js +7 -0
- package/bundle/ms.core-3.1.10.gbl.min.js.map +1 -0
- package/bundle/ms.core-3.1.10.integrity.json +46 -0
- package/bundle/{ms.core-3.1.9.js → ms.core-3.1.10.js} +107 -36
- package/bundle/ms.core-3.1.10.js.map +1 -0
- package/bundle/ms.core-3.1.10.min.js +7 -0
- package/bundle/ms.core-3.1.10.min.js.map +1 -0
- package/bundle/ms.core.gbl.js +106 -35
- package/bundle/ms.core.gbl.js.map +1 -1
- package/bundle/ms.core.gbl.min.js +2 -2
- package/bundle/ms.core.gbl.min.js.map +1 -1
- package/bundle/ms.core.integrity.json +17 -17
- package/bundle/ms.core.js +106 -35
- package/bundle/ms.core.js.map +1 -1
- package/bundle/ms.core.min.js +2 -2
- package/bundle/ms.core.min.js.map +1 -1
- package/dist/ms.core.js +2 -2
- package/dist/ms.core.js.map +1 -1
- package/dist/ms.core.min.js +2 -2
- package/dist/ms.core.min.js.map +1 -1
- package/dist-esm/src/AppInsightsCore.js +1 -1
- package/dist-esm/src/BaseCore.js +1 -1
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/ESPromise.js +1 -1
- package/dist-esm/src/ESPromiseScheduler.js +1 -1
- package/dist-esm/src/Enums.js +1 -1
- package/dist-esm/src/Index.js +1 -1
- package/dist-esm/src/Utils.d.ts +1 -1
- package/dist-esm/src/Utils.js +2 -2
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.js +1 -1
- package/package.json +3 -3
- package/bundle/ms.core-3.1.9.gbl.js.map +0 -1
- package/bundle/ms.core-3.1.9.gbl.min.js +0 -7
- package/bundle/ms.core-3.1.9.gbl.min.js.map +0 -1
- package/bundle/ms.core-3.1.9.integrity.json +0 -46
- package/bundle/ms.core-3.1.9.js.map +0 -1
- package/bundle/ms.core-3.1.9.min.js +0 -7
- package/bundle/ms.core-3.1.9.min.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ms.core.min.js","sources":["../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/Constants.js","../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/Helpers.js","../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/TsLibShims.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js","../../../common/temp/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/HelperFuncs.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/PerfManager.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/Constants.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/RandomHelper.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","../dist-esm/src/Enums.js","../dist-esm/src/Utils.js","../dist-esm/src/AppInsightsCore.js","../dist-esm/src/BaseCore.js","../dist-esm/src/ESPromise.js","../dist-esm/src/ESPromiseScheduler.js","../dist-esm/src/ValueSanitizer.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var strShimFunction = \"function\";\r\nexport var strShimObject = \"object\";\r\nexport var strShimUndefined = \"undefined\";\r\nexport var strShimPrototype = \"prototype\";\r\nexport var strShimHasOwnProperty = \"hasOwnProperty\";\r\nexport var strDefault = \"default\";\r\nexport var ObjClass = Object;\r\nexport var ObjProto = ObjClass[strShimPrototype];\r\nexport var ObjAssign = ObjClass[\"assign\"];\r\nexport var ObjCreate = ObjClass[\"create\"];\r\nexport var ObjDefineProperty = ObjClass[\"defineProperty\"];\r\nexport var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ObjCreate, strShimFunction, strShimObject, strShimPrototype, strShimUndefined } from \"./Constants\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - <null> (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport function getGlobal() {\r\n if (typeof globalThis !== strShimUndefined && globalThis) {\r\n return globalThis;\r\n }\r\n if (typeof self !== strShimUndefined && self) {\r\n return self;\r\n }\r\n if (typeof window !== strShimUndefined && window) {\r\n return window;\r\n }\r\n if (typeof global !== strShimUndefined && global) {\r\n return global;\r\n }\r\n return null;\r\n}\r\nexport function throwTypeError(message) {\r\n throw new TypeError(message);\r\n}\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport function objCreateFn(obj) {\r\n var func = ObjCreate;\r\n // Use build in Object.create\r\n if (func) {\r\n // Use Object create method if it exists\r\n return func(obj);\r\n }\r\n if (obj == null) {\r\n return {};\r\n }\r\n var type = typeof obj;\r\n if (type !== strShimObject && type !== strShimFunction) {\r\n throwTypeError('Object prototype may only be an Object:' + obj);\r\n }\r\n function tmpFunc() { }\r\n tmpFunc[strShimPrototype] = obj;\r\n return new tmpFunc();\r\n}\r\n//# sourceMappingURL=Helpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, strDefault, strShimFunction, strShimHasOwnProperty, strShimPrototype } from \"./Constants\";\r\nimport { getGlobal, objCreateFn, throwTypeError } from \"./Helpers\";\r\n// Most of these functions have been directly shamelessly \"lifted\" from the https://github.com/@microsoft/tslib and\r\n// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights\r\n// can successfully use TypeScript \"importHelpers\" which imports tslib during compilation but it will use these at runtime\r\n// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require\r\n// them.\r\nexport var SymbolObj = (getGlobal() || {})[\"Symbol\"];\r\nexport var ReflectObj = (getGlobal() || {})[\"Reflect\"];\r\nexport var __hasSymbol = !!SymbolObj;\r\nexport var __hasReflect = !!ReflectObj;\r\nvar strDecorate = \"decorate\";\r\nvar strMetadata = \"metadata\";\r\nvar strGetOwnPropertySymbols = \"getOwnPropertySymbols\";\r\nvar strIterator = \"iterator\";\r\nexport var __objAssignFnImpl = function (t) {\r\n // tslint:disable-next-line: ban-comma-operator\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) {\r\n if (ObjProto[strShimHasOwnProperty].call(s, p)) {\r\n t[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n};\r\nexport var __assignFn = ObjAssign || __objAssignFnImpl;\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar extendStaticsFn = function (d, b) {\r\n extendStaticsFn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n for (var p in b) {\r\n if (b[strShimHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return extendStaticsFn(d, b);\r\n};\r\nexport function __extendsFn(d, b) {\r\n if (typeof b !== strShimFunction && b !== null) {\r\n throwTypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n }\r\n extendStaticsFn(d, b);\r\n function __() { this.constructor = d; }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());\r\n}\r\nexport function __restFn(s, e) {\r\n var t = {};\r\n for (var k in s) {\r\n if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) {\r\n t[k] = s[k];\r\n }\r\n }\r\n if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) {\r\n for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && ObjProto[\"propertyIsEnumerable\"].call(s, p[i])) {\r\n t[p[i]] = s[p[i]];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\nexport function __decorateFn(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass[\"getOwnPropertyDescriptor\"](target, key) : desc, d;\r\n if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) {\r\n r = ReflectObj[strDecorate](decorators, target, key, desc);\r\n }\r\n else {\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n // tslint:disable-next-line:no-conditional-assignment\r\n if (d = decorators[i]) {\r\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n }\r\n }\r\n }\r\n // tslint:disable-next-line:ban-comma-operator\r\n return c > 3 && r && ObjDefineProperty(target, key, r), r;\r\n}\r\nexport function __paramFn(paramIndex, decorator) {\r\n return function (target, key) {\r\n decorator(target, key, paramIndex);\r\n };\r\n}\r\nexport function __metadataFn(metadataKey, metadataValue) {\r\n if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) {\r\n return ReflectObj[strMetadata](metadataKey, metadataValue);\r\n }\r\n}\r\nexport function __exportStarFn(m, o) {\r\n for (var p in m) {\r\n if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) {\r\n __createBindingFn(o, m, p);\r\n }\r\n }\r\n}\r\nexport function __createBindingFn(o, m, k, k2) {\r\n if (k2 === undefined) {\r\n k2 = k;\r\n }\r\n if (ObjCreate) {\r\n ObjDefineProperty(o, k2, {\r\n enumerable: true,\r\n get: function () {\r\n return m[k];\r\n }\r\n });\r\n }\r\n else {\r\n o[k2] = m[k];\r\n }\r\n}\r\nexport function __valuesFn(o) {\r\n var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0;\r\n if (m) {\r\n return m.call(o);\r\n }\r\n if (o && typeof o.length === \"number\") {\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) {\r\n o = void 0;\r\n }\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n throwTypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\nexport function __readFn(o, n) {\r\n var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]];\r\n if (!m) {\r\n return o;\r\n }\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\r\n ar.push(r.value);\r\n }\r\n }\r\n catch (error) {\r\n e = {\r\n error: error\r\n };\r\n }\r\n finally {\r\n try {\r\n // tslint:disable-next-line:no-conditional-assignment\r\n if (r && !r.done && (m = i[\"return\"])) {\r\n m.call(i);\r\n }\r\n }\r\n finally {\r\n if (e) {\r\n // tslint:disable-next-line:no-unsafe-finally\r\n throw e.error;\r\n }\r\n }\r\n }\r\n return ar;\r\n}\r\n/** @deprecated */\r\nexport function __spreadArraysFn() {\r\n var theArgs = arguments;\r\n // Calculate new total size\r\n for (var s = 0, i = 0, il = theArgs.length; i < il; i++) {\r\n s += theArgs[i].length;\r\n }\r\n // Create new full array\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\r\n for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) {\r\n r[k] = a[j];\r\n }\r\n }\r\n return r;\r\n}\r\nexport function __spreadArrayFn(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\r\n to[j] = from[i];\r\n }\r\n return to;\r\n}\r\nexport function __makeTemplateObjectFn(cooked, raw) {\r\n if (ObjDefineProperty) {\r\n ObjDefineProperty(cooked, \"raw\", { value: raw });\r\n }\r\n else {\r\n cooked.raw = raw;\r\n }\r\n return cooked;\r\n}\r\n;\r\nexport function __importStarFn(mod) {\r\n if (mod && mod.__esModule) {\r\n return mod;\r\n }\r\n var result = {};\r\n if (mod != null) {\r\n for (var k in mod) {\r\n if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) {\r\n __createBindingFn(result, mod, k);\r\n }\r\n }\r\n }\r\n // Set default module\r\n if (ObjCreate) {\r\n ObjDefineProperty(result, strDefault, { enumerable: true, value: mod });\r\n }\r\n else {\r\n result[strDefault] = mod;\r\n }\r\n return result;\r\n}\r\n;\r\nexport function __importDefaultFn(mod) {\r\n return (mod && mod.__esModule) ? mod : { strDefault: mod };\r\n}\r\n//# sourceMappingURL=TsLibShims.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n/**\r\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\r\n */\r\nexport var EventsDiscardedReason = {\r\n /**\r\n * Unknown.\r\n */\r\n Unknown: 0,\r\n /**\r\n * Status set to non-retryable.\r\n */\r\n NonRetryableStatus: 1,\r\n /**\r\n * The event is invalid.\r\n */\r\n InvalidEvent: 2,\r\n /**\r\n * The size of the event is too large.\r\n */\r\n SizeLimitExceeded: 3,\r\n /**\r\n * The server is not accepting events from this instrumentation key.\r\n */\r\n KillSwitch: 4,\r\n /**\r\n * The event queue is full.\r\n */\r\n QueueFull: 5\r\n};\r\n//# sourceMappingURL=EventsDiscardedReason.js.map","/*!\n * Microsoft Dynamic Proto Utility, 1.1.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\r\n * @ignore\r\n */\r\nvar DynInstChkTag = '_dynInstChk';\r\n/**\r\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same\r\n * tag name as the function level but a different const name for readability only.\r\n */\r\nvar DynAllowInstChkTag = DynInstChkTag;\r\n/**\r\n * The global (imported) instances where the global performance options are stored\r\n */\r\nvar DynProtoDefaultOptions = '_dfOpts';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strUseBaseInst = 'useBaseInst';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strSetInstFuncs = 'setInstFuncs';\r\nvar Obj = Object;\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\r\n * are not enumerable.\r\n * @param target\r\n */\r\nfunction _forEachProp(target, func) {\r\n var props = [];\r\n var getOwnProps = Obj[\"getOwnPropertyNames\"];\r\n if (getOwnProps) {\r\n props = getOwnProps(target);\r\n }\r\n else {\r\n for (var name_1 in target) {\r\n if (typeof name_1 === \"string\" && _hasOwnProperty(target, name_1)) {\r\n props.push(name_1);\r\n }\r\n }\r\n }\r\n if (props && props.length > 0) {\r\n for (var lp = 0; lp < props.length; lp++) {\r\n func(props[lp]);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototype or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n _forEachProp(thisTarget, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for passing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n });\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {\r\n function _instFuncProxy(target, funcHost, funcName) {\r\n var theFunc = funcHost[funcName];\r\n if (theFunc[DynProxyTag] && useBaseInst) {\r\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\r\n }\r\n }\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n _forEachProp(instFuncs, function (name) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\r\n });\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n _forEachProp(baseProto, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\r\n }\r\n });\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\nfunction _getInstFunc(target, funcName, proto, currentDynProtoProxy) {\r\n var instFunc = null;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (target && _hasOwnProperty(proto, DynClassName)) {\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];\r\n if (!instFunc) {\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n // We have the instance function, lets check it we can speed up further calls\r\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\r\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\r\n // If the instance already has an instance function we can't replace it\r\n var canAddInst = !_hasOwnProperty(target, funcName);\r\n // Get current prototype\r\n var objProto = _getObjProto(target);\r\n var visited = [];\r\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\r\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\r\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\r\n var protoFunc = objProto[funcName];\r\n if (protoFunc) {\r\n canAddInst = (protoFunc === currentDynProtoProxy);\r\n break;\r\n }\r\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\r\n visited.push(objProto);\r\n objProto = _getObjProto(objProto);\r\n }\r\n try {\r\n if (canAddInst) {\r\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\r\n // so it's safe to directly assign for any subsequent calls (for better performance)\r\n target[funcName] = instFunc;\r\n }\r\n // Block further attempts to set the instance function for any\r\n instFunc[DynInstChkTag] = 1;\r\n }\r\n catch (e) {\r\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\r\n // And set a flag so we don't try again for any function\r\n instFuncTable[DynAllowInstChkTag] = false;\r\n }\r\n }\r\n }\r\n return instFunc;\r\n}\r\nfunction _getProtoFunc(funcName, proto, currentDynProtoProxy) {\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === currentDynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (typeof protoFunc !== strFunction) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto - The class prototype\r\n * @param className - The instance classname\r\n * @param target - The target instance\r\n * @param baseInstFuncs - The base instance functions\r\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n // Use the instance or prototype function\r\n var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\r\n return instFunc.apply(this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\r\n }\r\n _forEachProp(target, function (name) {\r\n // Only add overridden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs_1[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\r\n var visited = [];\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(thisProto);\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass - This is the current class instance which contains the prototype for the current class\r\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\r\n * @param options - Additional options to configure how the dynamic prototype operates\r\n */\r\nfunction dynamicProto(theClass, target, delegateFunc, options) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n var perfOptions = dynamicProto[DynProtoDefaultOptions];\r\n var useBaseInst = !!perfOptions[strUseBaseInst];\r\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\r\n useBaseInst = !!options[strUseBaseInst];\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overridden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Don't allow setting instance functions for older IE instances\r\n var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];\r\n if (setInstanceFunc && options) {\r\n setInstanceFunc = !!options[strSetInstFuncs];\r\n }\r\n // Populate the Prototype for any overridden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\r\n}\r\n/**\r\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\r\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\r\n * their internal usage of dynamic proto.\r\n */\r\nvar perfDefaults = {\r\n setInstFuncs: true,\r\n useBaseInst: true\r\n};\r\n// And expose for testing\r\ndynamicProto[DynProtoDefaultOptions] = perfDefaults;\n\nexport default dynamicProto;\n//# sourceMappingURL=dynamicproto-js.js.map\n","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73,\r\n NotificationException: 74,\r\n SnippetScriptLoadFailure: 99,\r\n InvalidInstrumentationKey: 100,\r\n CannotParseAiBlobValue: 101,\r\n InvalidContentBlob: 102,\r\n TrackPageActionEventFailed: 103,\r\n FailedAddingCustomDefinedRequestContext: 104,\r\n InMemoryStorageBufferFull: 105\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strShimUndefined, strShimObject, strShimFunction, throwTypeError, ObjClass, ObjProto, ObjAssign, ObjHasOwnProperty, ObjDefineProperty } from \"@microsoft/applicationinsights-shims\";\r\n// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly\r\n// Added to help with minfication\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nvar _objDefineProperty = ObjDefineProperty;\r\nvar _objFreeze = ObjClass[\"freeze\"];\r\nvar _objSeal = ObjClass[\"seal\"];\r\nexport function objToString(obj) {\r\n return ObjProto.toString.call(obj);\r\n}\r\nexport function isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\nexport function isUndefined(value) {\r\n return value === undefined || typeof value === strShimUndefined;\r\n}\r\nexport function isNotUndefined(value) {\r\n return !isUndefined(value);\r\n}\r\nexport function isNullOrUndefined(value) {\r\n return (value === null || isUndefined(value));\r\n}\r\nexport function isNotNullOrUndefined(value) {\r\n return !isNullOrUndefined(value);\r\n}\r\nexport function hasOwnProperty(obj, prop) {\r\n return obj && ObjHasOwnProperty.call(obj, prop);\r\n}\r\nexport function isObject(value) {\r\n // Changing to inline for performance\r\n return typeof value === strShimObject;\r\n}\r\nexport function isFunction(value) {\r\n // Changing to inline for performance\r\n return typeof value === strShimFunction;\r\n}\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @param useCapture [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nexport function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!isNullOrUndefined(obj)) {\r\n try {\r\n if (!isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9\r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nexport function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!isNullOrUndefined(obj)) {\r\n try {\r\n if (!isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\n/**\r\n * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a\r\n * performance optimization to avoid the creation of a new array for large objects\r\n * @param target The target object to find and process the keys\r\n * @param callbackfn The function to call with the details\r\n */\r\nexport function objForEachKey(target, callbackfn) {\r\n if (target) {\r\n for (var prop in target) {\r\n if (ObjHasOwnProperty.call(target, prop)) {\r\n callbackfn.call(target, prop, target[prop]);\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param search - The characters to be searched for at the end of the value.\r\n * @returns true if the given search value is found at the end of the string, otherwise false.\r\n */\r\nexport function strEndsWith(value, search) {\r\n if (value && search) {\r\n var searchLen = search.length;\r\n var valLen = value.length;\r\n if (value === search) {\r\n return true;\r\n }\r\n else if (valLen >= searchLen) {\r\n var pos = valLen - 1;\r\n for (var lp = searchLen - 1; lp >= 0; lp--) {\r\n if (value[pos] != search[lp]) {\r\n return false;\r\n }\r\n pos--;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * The strStartsWith() method determines whether a string starts with the characters of the specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param checkValue - The characters to be searched for at the start of the value.\r\n * @returns true if the given search value is found at the start of the string, otherwise false.\r\n */\r\nexport function strStartsWith(value, checkValue) {\r\n // Using helper for performance and because string startsWith() is not available on IE\r\n var result = false;\r\n if (value && checkValue) {\r\n var chkLen = checkValue.length;\r\n if (value === checkValue) {\r\n return true;\r\n }\r\n else if (value.length >= chkLen) {\r\n for (var lp = 0; lp < chkLen; lp++) {\r\n if (value[lp] !== checkValue[lp]) {\r\n return false;\r\n }\r\n }\r\n result = true;\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * A simple wrapper (for minification support) to check if the value contains the search string.\r\n * @param value - The string value to check for the existence of the search value\r\n * @param search - The value search within the value\r\n */\r\nexport function strContains(value, search) {\r\n if (value && search) {\r\n return value.indexOf(search) !== -1;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Check if an object is of type Date\r\n */\r\nexport function isDate(obj) {\r\n return objToString(obj) === \"[object Date]\";\r\n}\r\n/**\r\n * Check if an object is of type Array\r\n */\r\nexport function isArray(obj) {\r\n return objToString(obj) === \"[object Array]\";\r\n}\r\n/**\r\n * Check if an object is of type Error\r\n */\r\nexport function isError(obj) {\r\n return objToString(obj) === \"[object Error]\";\r\n}\r\n/**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\nexport function isString(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"string\";\r\n}\r\n/**\r\n * Checks if the type of value is a number.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\nexport function isNumber(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"number\";\r\n}\r\n/**\r\n * Checks if the type of value is a boolean.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\nexport function isBoolean(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"boolean\";\r\n}\r\n/**\r\n * Checks if the type of value is a Symbol.\r\n * This only returns a boolean as returning value is Symbol will cause issues for older TypeScript consumers\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Symbol, false otherwise.\r\n */\r\nexport function isSymbol(value) {\r\n return typeof value === \"symbol\";\r\n}\r\n/**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\nexport function toISOString(date) {\r\n if (isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n}\r\n/**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\nexport function arrForEach(arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n try {\r\n for (var idx = 0; idx < len; idx++) {\r\n if (idx in arr) {\r\n if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n}\r\n/**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\nexport function arrIndexOf(arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n try {\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\nexport function arrMap(arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n try {\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return results;\r\n}\r\n/**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\nexport function arrReduce(arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n}\r\n/**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\nexport function strTrim(str) {\r\n if (typeof str !== \"string\") {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n}\r\nvar _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable(\"toString\");\r\nvar _objKeysDontEnums = [\r\n \"toString\",\r\n \"toLocaleString\",\r\n \"valueOf\",\r\n \"hasOwnProperty\",\r\n \"isPrototypeOf\",\r\n \"propertyIsEnumerable\",\r\n \"constructor\"\r\n];\r\n/**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\nexport function objKeys(obj) {\r\n var objType = typeof obj;\r\n if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {\r\n throwTypeError(\"objKeys called on non-object\");\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (obj && ObjHasOwnProperty.call(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (_objKeysHasDontEnumBug) {\r\n var dontEnumsLength = _objKeysDontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) {\r\n result.push(_objKeysDontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @param target The object on which to define the property.\r\n * @param prop The name of the property to be defined or modified.\r\n * @param getProp The getter function to wire against the getter.\r\n * @param setProp The setter function to wire against the setter.\r\n * @returns True if it was able to create the accessors otherwise false\r\n */\r\nexport function objDefineAccessors(target, prop, getProp, setProp) {\r\n if (_objDefineProperty) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n _objDefineProperty(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n}\r\nexport function objFreeze(value) {\r\n if (_objFreeze) {\r\n value = _objFreeze(value);\r\n }\r\n return value;\r\n}\r\nexport function objSeal(value) {\r\n if (_objSeal) {\r\n value = _objSeal(value);\r\n }\r\n return value;\r\n}\r\n/**\r\n * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)\r\n * https://caniuse.com/#search=Date.now\r\n */\r\nexport function dateNow() {\r\n var dt = Date;\r\n if (dt.now) {\r\n return dt.now();\r\n }\r\n return new dt().getTime();\r\n}\r\n/**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\nexport function getExceptionName(object) {\r\n if (isError(object)) {\r\n return object.name;\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk\r\n * function will only be called if the new value is no equal to the original value.\r\n * @param target - The target object\r\n * @param field - The key of the target\r\n * @param value - The value to set\r\n * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set\r\n * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)\r\n * @returns The existing or new value, depending what was set\r\n */\r\nexport function setValue(target, field, value, valChk, srcChk) {\r\n var theValue = value;\r\n if (target) {\r\n theValue = target[field];\r\n if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {\r\n theValue = value;\r\n target[field] = theValue;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it\r\n * @param target - The target object to return or set the default value\r\n * @param field - The key for the field to set on the target\r\n * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added\r\n */\r\nexport function getSetValue(target, field, defValue) {\r\n var theValue;\r\n if (target) {\r\n theValue = target[field];\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n // Supports having the default as null\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n target[field] = theValue;\r\n }\r\n }\r\n else {\r\n // Expanded for performance so we only check defValue if required\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n }\r\n return theValue;\r\n}\r\nexport function isNotTruthy(value) {\r\n return !value;\r\n}\r\nexport function isTruthy(value) {\r\n return !!value;\r\n}\r\nexport function throwError(message) {\r\n throw new Error(message);\r\n}\r\n/**\r\n * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from\r\n * the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential\r\n * implementation issues by assigning prototype functions as instance ones\r\n *\r\n * This method is the primary method used to \"update\" the snippet proxy with the ultimate implementations.\r\n *\r\n * Special ES3 Notes:\r\n * Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the\r\n * properties of \"referenced\" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the\r\n * same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param chkSet - An optional callback to determine whether a specific property/function should be proxied\r\n * @memberof Initialization\r\n */\r\nexport function proxyAssign(target, source, chkSet) {\r\n if (target && source && target !== source && isObject(target) && isObject(source)) {\r\n var _loop_1 = function (field) {\r\n if (isString(field)) {\r\n var value = source[field];\r\n if (isFunction(value)) {\r\n if (!chkSet || chkSet(field, true, source, target)) {\r\n // Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function\r\n target[field] = (function (funcName) {\r\n return function () {\r\n // Capture the original arguments passed to the method\r\n var originalArguments = arguments;\r\n return source[funcName].apply(source, originalArguments);\r\n };\r\n })(field);\r\n }\r\n }\r\n else if (!chkSet || chkSet(field, false, source, target)) {\r\n if (hasOwnProperty(target, field)) {\r\n // Remove any previous instance property\r\n delete target[field];\r\n }\r\n if (!objDefineAccessors(target, field, function () {\r\n return source[field];\r\n }, function (theValue) {\r\n source[field] = theValue;\r\n })) {\r\n // Unable to create an accessor, so just assign the values as a fallback\r\n // -- this will (mostly) work for objects\r\n // -- but will fail for accessing primitives (if the source changes it) and all types of \"setters\" as the source won't be modified\r\n target[field] = value;\r\n }\r\n }\r\n }\r\n };\r\n // effectively apply/proxy full source to the target instance\r\n for (var field in source) {\r\n _loop_1(field);\r\n }\r\n }\r\n return target;\r\n}\r\n/**\r\n * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults.\r\n * Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance\r\n * @param defaults Simple helper\r\n */\r\nexport function createClassFromInterface(defaults) {\r\n return /** @class */ (function () {\r\n function class_1() {\r\n var _this_1 = this;\r\n if (defaults) {\r\n objForEachKey(defaults, function (field, value) {\r\n _this_1[field] = value;\r\n });\r\n }\r\n }\r\n return class_1;\r\n }());\r\n}\r\n/**\r\n * A helper function to assist with JIT performance for objects that have properties added / removed dynamically\r\n * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this\r\n * function after you have finished \"updating\" the object, calling this within loops reduces or defeats the benefits.\r\n * This helps when iterating using for..in, objKeys() and objForEach()\r\n * @param theObject - The object to be optimized if possible\r\n */\r\nexport function optimizeObject(theObject) {\r\n // V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties\r\n // primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent\r\n if (theObject) {\r\n theObject = ObjClass(ObjAssign ? ObjAssign({}, theObject) : theObject);\r\n }\r\n return theObject;\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { getGlobal, strShimUndefined, strShimObject, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { isString, isUndefined, strContains } from \"./HelperFuncs\";\r\n/**\r\n * This file exists to hold environment utilities that are required to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only use defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strMsCrypto = \"msCrypto\";\r\nvar strReactNative = \"ReactNative\";\r\nvar strMsie = \"msie\";\r\nvar strTrident = \"trident/\";\r\nvar _isTrident = null;\r\nvar _navUserAgentCheck = null;\r\nvar _enableMocks = false;\r\nvar _useXDomainRequest = null;\r\nvar _beaconsSupported = null;\r\nfunction _hasProperty(theClass, property) {\r\n var supported = false;\r\n if (theClass) {\r\n try {\r\n supported = property in theClass;\r\n if (!supported) {\r\n var proto = theClass[strShimPrototype];\r\n if (proto) {\r\n supported = property in proto;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n if (!supported) {\r\n try {\r\n var tmp = new theClass();\r\n supported = !isUndefined(tmp[property]);\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n }\r\n }\r\n return supported;\r\n}\r\n/**\r\n * Enable the lookup of test mock objects if requested\r\n * @param enabled\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\r\n}\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where <global>.window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strShimObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strShimObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strShimObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strShimObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation(checkForMock) {\r\n if (checkForMock && _enableMocks) {\r\n var mockLocation = getGlobalInst(\"__mockLocation\");\r\n if (mockLocation) {\r\n return mockLocation;\r\n }\r\n }\r\n if (typeof location === strShimObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strShimUndefined) {\r\n return console;\r\n }\r\n return getGlobalInst(strConsole);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getGlobalInst(strCrypto);\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getMsCrypto() {\r\n return getGlobalInst(strMsCrypto);\r\n}\r\n/**\r\n * Returns whether the environment is reporting that we are running in a React Native Environment\r\n */\r\nexport function isReactNative() {\r\n // If running in React Native, navigator.product will be populated\r\n var nav = getNavigator();\r\n if (nav && nav.product) {\r\n return nav.product === strReactNative;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Identifies whether the current environment appears to be IE\r\n */\r\nexport function isIE() {\r\n var nav = getNavigator();\r\n if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav.userAgent;\r\n var userAgent = (_navUserAgentCheck || \"\").toLowerCase();\r\n _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));\r\n }\r\n return _isTrident;\r\n}\r\n/**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\nexport function getIEVersion(userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n if (!userAgentStr) {\r\n var navigator_1 = getNavigator() || {};\r\n userAgentStr = navigator_1 ? (navigator_1.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n if (strContains(ua, strMsie)) {\r\n return parseInt(ua.split(strMsie)[1]);\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua.split(strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\nexport function dumpObj(object) {\r\n var objectTypeDump = Object[strShimPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n}\r\nexport function isSafari(userAgentStr) {\r\n if (!userAgentStr || !isString(userAgentStr)) {\r\n var navigator_2 = getNavigator() || {};\r\n userAgentStr = navigator_2 ? (navigator_2.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n return (ua.indexOf(\"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported() {\r\n if (_beaconsSupported === null) {\r\n _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);\r\n }\r\n return _beaconsSupported;\r\n}\r\n/**\r\n * Checks if the Fetch API is supported in the current environment.\r\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isFetchSupported(withKeepAlive) {\r\n var isSupported = false;\r\n try {\r\n var fetchApi = getGlobalInst(\"fetch\");\r\n isSupported = !!fetchApi;\r\n var request = getGlobalInst(\"Request\");\r\n if (isSupported && withKeepAlive && request) {\r\n isSupported = _hasProperty(request, \"keepalive\");\r\n }\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nexport function useXDomainRequest() {\r\n if (_useXDomainRequest === null) {\r\n _useXDomainRequest = (typeof XDomainRequest !== undefined);\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(\"XMLHttpRequest\"), \"withCredentials\");\r\n }\r\n }\r\n return _useXDomainRequest;\r\n}\r\n/**\r\n * Checks if XMLHttpRequest is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isXhrSupported() {\r\n var isSupported = false;\r\n try {\r\n var xmlHttpRequest = getGlobalInst(\"XMLHttpRequest\");\r\n isSupported = !!xmlHttpRequest;\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { hasJSON, getJSON, getConsole } from \"./EnvUtils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isFunction, isNullOrUndefined, isUndefined } from \"./HelperFuncs\";\r\n/**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\nvar AiNonUserActionablePrefix = \"AI (Internal): \";\r\n/**\r\n * Prefix of the traces in portal.\r\n */\r\nvar AiUserActionablePrefix = \"AI: \";\r\n/**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\nvar AIInternalMessagePrefix = \"AITR_\";\r\nvar strErrorToConsole = \"errorToConsole\";\r\nvar strWarnToConsole = \"warnToConsole\";\r\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n}\r\nfunction _logToConsole(func, message) {\r\n var theConsole = getConsole();\r\n if (!!theConsole) {\r\n var logFunc = \"log\";\r\n if (theConsole[func]) {\r\n logFunc = func;\r\n }\r\n if (isFunction(theConsole[logFunc])) {\r\n theConsole[logFunc](message);\r\n }\r\n }\r\n}\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var _self = this;\r\n _self.messageId = msgId;\r\n _self.message =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : \"\");\r\n _self.message += diagnosticText;\r\n }\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nexport function safeGetLogger(core, config) {\r\n return (core || {}).logger || new DiagnosticLogger(config);\r\n}\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n this.identifier = \"DiagnosticLogger\";\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Count of internal messages sent\r\n */\r\n var _messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n var _messageLogged = {};\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n if (isNullOrUndefined(config)) {\r\n config = {};\r\n }\r\n _self.consoleLoggingLevel = function () { return _getConfigValue(\"loggingLevelConsole\", 0); };\r\n _self.telemetryLoggingLevel = function () { return _getConfigValue(\"loggingLevelTelemetry\", 1); };\r\n _self.maxInternalMessageLimit = function () { return _getConfigValue(\"maxMessageLimit\", 25); };\r\n _self.enableDebugExceptions = function () { return _getConfigValue(\"enableDebugExceptions\", false); };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n if (_self.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n // Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist\r\n var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;\r\n if (!isUndefined(message.message)) {\r\n var logLevel = _self.consoleLoggingLevel();\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message.messageId;\r\n if (!_messageLogged[messageKey] && logLevel >= severity) {\r\n _self[logFunc](message.message);\r\n _messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // Only log traces if the console Logging Level is >= the throwInternal severity level\r\n if (logLevel >= severity) {\r\n _self[logFunc](message.message);\r\n }\r\n }\r\n _self.logInternalMessage(severity, message);\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n _self.warnToConsole = function (message) {\r\n _logToConsole(\"warn\", message);\r\n };\r\n /**\r\n * This will write an error to the console if possible\r\n * @param message {string} - The error message\r\n */\r\n _self.errorToConsole = function (message) {\r\n _logToConsole(\"error\", message);\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n _self.logInternalMessage = function (severity, message) {\r\n if (_areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _self.telemetryLoggingLevel()) {\r\n _self.queue.push(message);\r\n _messageCount++;\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _self.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _self.queue.push(throttleMessage);\r\n _self.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n };\r\n function _getConfigValue(name, defValue) {\r\n var value = config[name];\r\n if (!isNullOrUndefined(value)) {\r\n return value;\r\n }\r\n return defValue;\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _self.maxInternalMessageLimit();\r\n }\r\n });\r\n }\r\n// Removed Stub for DiagnosticLogger.prototype.enableDebugExceptions.\r\n// Removed Stub for DiagnosticLogger.prototype.consoleLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.telemetryLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.maxInternalMessageLimit.\r\n// Removed Stub for DiagnosticLogger.prototype.throwInternal.\r\n// Removed Stub for DiagnosticLogger.prototype.warnToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.errorToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.resetInternalMessageCount.\r\n// Removed Stub for DiagnosticLogger.prototype.logInternalMessage.\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateNow, isArray, isFunction, objDefineAccessors } from \"./HelperFuncs\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar _defaultPerfManager = null;\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n var accessorDefined = false;\r\n _self.start = dateNow();\r\n _self.name = name;\r\n _self.isAsync = isAsync;\r\n _self.isChildEvt = function () { return false; };\r\n if (isFunction(payloadDetails)) {\r\n // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback\r\n var theDetails_1;\r\n accessorDefined = objDefineAccessors(_self, \"payload\", function () {\r\n // Delay the execution of the payloadDetails until needed\r\n if (!theDetails_1 && isFunction(payloadDetails)) {\r\n theDetails_1 = payloadDetails();\r\n // clear it out now so the referenced objects can be garbage collected\r\n payloadDetails = null;\r\n }\r\n return theDetails_1;\r\n });\r\n }\r\n _self.getCtx = function (key) {\r\n if (key) {\r\n // The parent and child links are located directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n // Put the parent and child links directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self.isChildEvt = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent.ChildrenContextKey) {\r\n _self[key] = value;\r\n }\r\n else {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n }\r\n };\r\n _self.complete = function () {\r\n var childTime = 0;\r\n var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey);\r\n if (isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts.length; lp++) {\r\n var childEvt = childEvts[lp];\r\n if (childEvt) {\r\n childTime += childEvt.time;\r\n }\r\n }\r\n }\r\n _self.time = dateNow() - _self.start;\r\n _self.exTime = _self.time - childTime;\r\n _self.complete = function () { };\r\n if (!accessorDefined && isFunction(payloadDetails)) {\r\n // If we couldn't define the property set during complete -- to minimize the perf impact until after the time\r\n _self.payload = payloadDetails();\r\n }\r\n };\r\n }\r\n PerfEvent.ParentContextKey = \"parent\";\r\n PerfEvent.ChildrenContextKey = \"childEvts\";\r\n return PerfEvent;\r\n}());\r\nexport { PerfEvent };\r\nvar PerfManager = /** @class */ (function () {\r\n function PerfManager(manager) {\r\n /**\r\n * General bucket used for execution context set and retrieved via setCtx() and getCtx.\r\n * Defined as private so it can be visualized via the DebugPlugin\r\n */\r\n this.ctx = {};\r\n dynamicProto(PerfManager, this, function (_self) {\r\n _self.create = function (src, payloadDetails, isAsync) {\r\n // TODO (@MSNev): at some point we will want to add additional configuration to \"select\" which events to instrument\r\n // for now this is just a simple do everything.\r\n return new PerfEvent(src, payloadDetails, isAsync);\r\n };\r\n _self.fire = function (perfEvent) {\r\n if (perfEvent) {\r\n perfEvent.complete();\r\n if (manager && isFunction(manager.perfEvent)) {\r\n manager.perfEvent(perfEvent);\r\n }\r\n }\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n };\r\n _self.getCtx = function (key) {\r\n return (_self[strExecutionContextKey] || {})[key];\r\n };\r\n });\r\n }\r\n// Removed Stub for PerfManager.prototype.create.\r\n// Removed Stub for PerfManager.prototype.fire.\r\n// Removed Stub for PerfManager.prototype.setCtx.\r\n// Removed Stub for PerfManager.prototype.getCtx.\r\n return PerfManager;\r\n}());\r\nexport { PerfManager };\r\nvar doPerfActiveKey = \"CoreUtils.doPerf\";\r\n/**\r\n * Helper function to wrap a function with a perf event\r\n * @param mgrSource - The Performance Manager or a Performance provider source (may be null)\r\n * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled)\r\n * @param func - The function to call and measure\r\n * @param details - A function to return the payload details\r\n * @param isAsync - Is the event / function being call asynchronously or synchronously\r\n */\r\nexport function doPerf(mgrSource, getSource, func, details, isAsync) {\r\n if (mgrSource) {\r\n var perfMgr = mgrSource;\r\n if (isFunction(perfMgr[\"getPerfMgr\"])) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[\"getPerfMgr\"]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr.getCtx(doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt.setCtx) {\r\n perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive);\r\n if (currentActive.getCtx && currentActive.setCtx) {\r\n var children = currentActive.getCtx(PerfEvent.ChildrenContextKey);\r\n if (!children) {\r\n children = [];\r\n currentActive.setCtx(PerfEvent.ChildrenContextKey, children);\r\n }\r\n children.push(perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr.setCtx(doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt.setCtx) {\r\n perfEvt.setCtx(\"exception\", ex);\r\n }\r\n }\r\n finally {\r\n // fire the perf event\r\n if (perfEvt) {\r\n perfMgr.fire(perfEvt);\r\n }\r\n // Reset the active event to the previous value\r\n perfMgr.setCtx(doPerfActiveKey, currentActive);\r\n }\r\n }\r\n }\r\n return func();\r\n}\r\n/**\r\n * Set the global performance manager to use when there is no core instance or it has not been initialized yet.\r\n * @param perfManager - The IPerfManager instance to use when no performance manager is supplied.\r\n */\r\nexport function setGblPerfMgr(perfManager) {\r\n _defaultPerfManager = perfManager;\r\n}\r\n/**\r\n * Get the current global performance manager that will be used with no performance manager is supplied.\r\n * @returns - The current default manager\r\n */\r\nexport function getGblPerfMgr() {\r\n return _defaultPerfManager;\r\n}\r\n//# sourceMappingURL=PerfManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { LoggingSeverity, _InternalMessageId } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { isFunction } from \"./HelperFuncs\";\r\nimport { dumpObj } from \"./EnvUtils\";\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = isFunction(plugin.processTelemetry);\r\n var _hasSetNext = isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n var identifier = plugin ? plugin.identifier : \"TelemetryPluginChain\";\r\n doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + \":processTelemetry\"; }, function () {\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some\r\n // other form of error occurred\r\n itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + dumpObj(error));\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }, function () { return ({ item: env }); }, !(env.sync));\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nimport { arrForEach, isFunction, isNullOrUndefined, isUndefined } from \"./HelperFuncs\";\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n return safeGetLogger(core, config);\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nexport var strIKey = \"iKey\";\r\nexport var strExtensionConfig = \"extensionConfig\";\r\n//# sourceMappingURL=Constants.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { isFunction, isNullOrUndefined, setValue } from \"./HelperFuncs\";\r\nimport { strExtensionConfig } from \"./Constants\";\r\nvar strGetPlugin = \"getPlugin\";\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {\r\n // Looks like backward compatibility or out of band processing. And as it looks\r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n setValue(config, strExtensionConfig, [], null, isNullOrUndefined);\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[strGetPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, isFunction } from \"./HelperFuncs\";\r\nvar processTelemetry = \"processTelemetry\";\r\nvar priority = \"priority\";\r\nvar setNextPlugin = \"setNextPlugin\";\r\nvar isInitialized = \"isInitialized\";\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config The current config for the instance\r\n * @param core THe current core instance\r\n * @param extensions The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext.getNext();\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (thePlugin) {\r\n if (lastPlugin &&\r\n isFunction(lastPlugin[setNextPlugin]) &&\r\n isFunction(thePlugin[processTelemetry])) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[setNextPlugin](thePlugin);\r\n }\r\n if (!isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {\r\n initPlugins.push(thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n // Now initiatilize the plugins\r\n arrForEach(initPlugins, function (thePlugin) {\r\n thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n var bHasProcess = isFunction(extB[processTelemetry]);\r\n if (isFunction(extA[processTelemetry])) {\r\n result = bHasProcess ? extA[priority] - extB[priority] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n return result;\r\n });\r\n // sort complete\r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BaseTelemetryPlugin } from \"./BaseTelemetryPlugin\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { initializePlugins } from \"./TelemetryHelpers\";\r\nimport { arrForEach, objDefineAccessors, throwError } from \"./HelperFuncs\";\r\nvar ChannelControllerPriority = 500;\r\nvar ChannelValidationMessage = \"Channel has invalid priority\";\r\nvar ChannelController = /** @class */ (function (_super) {\r\n __extends(ChannelController, _super);\r\n function ChannelController() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"ChannelControllerPlugin\";\r\n _this.priority = ChannelControllerPriority; // in reserved range 100 to 200\r\n var _channelQueue;\r\n dynamicProto(ChannelController, _this, function (_self, _base) {\r\n _self.setNextPlugin = function (next) {\r\n // The Channel controller is last in pipeline\r\n };\r\n _self.processTelemetry = function (item, itemCtx) {\r\n if (_channelQueue) {\r\n arrForEach(_channelQueue, function (queues) {\r\n // pass on to first item in queue\r\n if (queues.length > 0) {\r\n // Copying the item context as we could have mutiple chains that are executing asynchronously\r\n // and calling _getDefTelCtx as it's possible that the caller doesn't pass any context\r\n var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);\r\n chainCtx.processNext(item);\r\n }\r\n });\r\n }\r\n };\r\n _self.getChannelControls = function () {\r\n return _channelQueue;\r\n };\r\n _self.initialize = function (config, core, extensions) {\r\n if (_self.isInitialized()) {\r\n // already initialized\r\n return;\r\n }\r\n _base.initialize(config, core, extensions);\r\n _createChannelQueues((config || {}).channels, extensions);\r\n // Initialize the Queues\r\n arrForEach(_channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });\r\n };\r\n });\r\n function _checkQueuePriority(queue) {\r\n arrForEach(queue, function (queueItem) {\r\n if (queueItem.priority < ChannelControllerPriority) {\r\n throwError(ChannelValidationMessage + queueItem.identifier);\r\n }\r\n });\r\n }\r\n function _addChannelQueue(queue) {\r\n if (queue && queue.length > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a.priority - b.priority;\r\n });\r\n _checkQueuePriority(queue);\r\n _channelQueue.push(queue);\r\n }\r\n }\r\n function _createChannelQueues(channels, extensions) {\r\n _channelQueue = [];\r\n if (channels) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(channels, function (queue) { return _addChannelQueue(queue); });\r\n }\r\n if (extensions) {\r\n // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority\r\n var extensionQueue_1 = [];\r\n arrForEach(extensions, function (plugin) {\r\n if (plugin.priority > ChannelControllerPriority) {\r\n extensionQueue_1.push(plugin);\r\n }\r\n });\r\n _addChannelQueue(extensionQueue_1);\r\n }\r\n }\r\n return _this;\r\n }\r\n// Removed Stub for ChannelController.prototype.processTelemetry.\r\n// Removed Stub for ChannelController.prototype.getChannelControls.\r\n// Removed Stub for ChannelController.prototype.initialize.\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n // tslint:disable-next-line\r\n ChannelController._staticInit = (function () {\r\n var proto = ChannelController.prototype;\r\n // Dynamically create get/set property accessors\r\n objDefineAccessors(proto, \"ChannelControls\", proto.getChannelControls);\r\n objDefineAccessors(proto, \"channelQueue\", proto.getChannelControls);\r\n })();\r\n return ChannelController;\r\n}(BaseTelemetryPlugin));\r\nexport { ChannelController };\r\n//# sourceMappingURL=ChannelController.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { dumpObj, getDocument, getLocation, getNavigator, isIE } from \"./EnvUtils\";\r\nimport { arrForEach, dateNow, getExceptionName, isFunction, isNotNullOrUndefined, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, setValue, strContains, strEndsWith, strTrim } from \"./HelperFuncs\";\r\nvar strToGMTString = \"toGMTString\";\r\nvar strToUTCString = \"toUTCString\";\r\nvar strCookie = \"cookie\";\r\nvar strExpires = \"expires\";\r\nvar strEnabled = \"enabled\";\r\nvar strIsCookieUseDisabled = \"isCookieUseDisabled\";\r\nvar strDisableCookiesUsage = \"disableCookiesUsage\";\r\nvar strConfigCookieMgr = \"_ckMgr\";\r\nvar strEmpty = \"\";\r\nvar _supportsCookies = null;\r\nvar _allowUaSameSite = null;\r\nvar _parsedCookieValue = null;\r\nvar _doc = getDocument();\r\nvar _cookieCache = {};\r\nvar _globalCookieConfig = {};\r\n/**\r\n * @ignore\r\n * DO NOT USE or export from the module, this is exposed as public to support backward compatibility of previous static utility methods only.\r\n * If you want to manager cookies either use the ICookieMgr available from the core instance via getCookieMgr() or create\r\n * your own instance of the CookieMgr and use that.\r\n * Using this directly for enabling / disabling cookie handling will not only affect your usage but EVERY user of cookies.\r\n * Example, if you are using a shared component that is also using Application Insights you will affect their cookie handling.\r\n * @param logger - The DiagnosticLogger to use for reporting errors.\r\n */\r\nexport function _gblCookieMgr(config, logger) {\r\n // Stash the global instance against the BaseCookieMgr class\r\n var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];\r\n if (!inst) {\r\n // Note: not using the getSetValue() helper as that would require always creating a temporary cookieMgr\r\n // that ultimately is never used\r\n inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);\r\n _globalCookieConfig[strConfigCookieMgr] = inst;\r\n }\r\n return inst;\r\n}\r\nfunction _isMgrEnabled(cookieMgr) {\r\n if (cookieMgr) {\r\n return cookieMgr.isEnabled();\r\n }\r\n return true;\r\n}\r\nfunction _createCookieMgrConfig(rootConfig) {\r\n var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};\r\n // Sets the values from the root config if not already present on the cookieMgrCfg\r\n setValue(cookieMgrCfg, \"domain\", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);\r\n setValue(cookieMgrCfg, \"path\", rootConfig.cookiePath || \"/\", null, isNullOrUndefined);\r\n if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {\r\n // Set the enabled from the provided setting or the legacy root values\r\n var cookieEnabled = void 0;\r\n if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {\r\n cookieEnabled = !rootConfig[strIsCookieUseDisabled];\r\n }\r\n if (!isUndefined(rootConfig[strDisableCookiesUsage])) {\r\n cookieEnabled = !rootConfig[strDisableCookiesUsage];\r\n }\r\n cookieMgrCfg[strEnabled] = cookieEnabled;\r\n }\r\n return cookieMgrCfg;\r\n}\r\n/**\r\n * Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation\r\n * associated with the configuration or a legacy default.\r\n * @param core\r\n * @param config\r\n * @returns\r\n */\r\nexport function safeGetCookieMgr(core, config) {\r\n var cookieMgr;\r\n if (core) {\r\n // Always returns an instance\r\n cookieMgr = core.getCookieMgr();\r\n }\r\n else if (config) {\r\n var cookieCfg = config.cookieCfg;\r\n if (cookieCfg[strConfigCookieMgr]) {\r\n cookieMgr = cookieCfg[strConfigCookieMgr];\r\n }\r\n else {\r\n cookieMgr = createCookieMgr(config);\r\n }\r\n }\r\n if (!cookieMgr) {\r\n // Get or initialize the default global (legacy) cookie manager if we couldn't find one\r\n cookieMgr = _gblCookieMgr(config, (core || {}).logger);\r\n }\r\n return cookieMgr;\r\n}\r\nexport function createCookieMgr(rootConfig, logger) {\r\n var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);\r\n var _path = cookieMgrConfig.path || \"/\";\r\n var _domain = cookieMgrConfig.domain;\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n var _enabled = cookieMgrConfig[strEnabled] !== false;\r\n var cookieMgr = {\r\n isEnabled: function () {\r\n var enabled = _enabled && areCookiesSupported(logger);\r\n // Using an indirect lookup for any global cookie manager to support tree shaking for SDK's\r\n // that don't use the \"applicationinsights-core\" version of the default cookie function\r\n var gblManager = _globalCookieConfig[strConfigCookieMgr];\r\n if (enabled && gblManager && cookieMgr !== gblManager) {\r\n // Make sure the GlobalCookie Manager instance (if not this instance) is also enabled.\r\n // As the global (deprecated) functions may have been called (for backward compatibility)\r\n enabled = _isMgrEnabled(gblManager);\r\n }\r\n return enabled;\r\n },\r\n setEnabled: function (value) {\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n _enabled = value !== false;\r\n },\r\n set: function (name, value, maxAgeSec, domain, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n var values = {};\r\n var theValue = strTrim(value || strEmpty);\r\n var idx = theValue.indexOf(\";\");\r\n if (idx !== -1) {\r\n theValue = strTrim(value.substring(0, idx));\r\n values = _extractParts(value.substring(idx + 1));\r\n }\r\n // Only update domain if not already present (isUndefined) and the value is truthy (not null, undefined or empty string)\r\n setValue(values, \"domain\", domain || _domain, isTruthy, isUndefined);\r\n if (!isNullOrUndefined(maxAgeSec)) {\r\n var _isIE = isIE();\r\n if (isUndefined(values[strExpires])) {\r\n var nowMs = dateNow();\r\n // Only add expires if not already present\r\n var expireMs = nowMs + (maxAgeSec * 1000);\r\n // Sanity check, if zero or -ve then ignore\r\n if (expireMs > 0) {\r\n var expiry = new Date();\r\n expiry.setTime(expireMs);\r\n setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);\r\n }\r\n }\r\n if (!_isIE) {\r\n // Only replace if not already present\r\n setValue(values, \"max-age\", strEmpty + maxAgeSec, null, isUndefined);\r\n }\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n setValue(values, \"secure\", null, null, isUndefined);\r\n // Only set same site if not also secure\r\n if (_allowUaSameSite === null) {\r\n _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);\r\n }\r\n if (_allowUaSameSite) {\r\n setValue(values, \"SameSite\", \"None\", null, isUndefined);\r\n }\r\n }\r\n setValue(values, \"path\", path || _path, null, isUndefined);\r\n var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;\r\n setCookieFn(name, _formatCookieValue(theValue, values));\r\n result = true;\r\n }\r\n return result;\r\n },\r\n get: function (name) {\r\n var value = strEmpty;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n value = (cookieMgrConfig.getCookie || _getCookieValue)(name);\r\n }\r\n return value;\r\n },\r\n del: function (name, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n // Only remove the cookie if the manager and cookie support has not been disabled\r\n result = cookieMgr.purge(name, path);\r\n }\r\n return result;\r\n },\r\n purge: function (name, path) {\r\n var _a;\r\n var result = false;\r\n if (areCookiesSupported(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n var values = (_a = {},\r\n _a[\"path\"] = path ? path : \"/\",\r\n _a[strExpires] = \"Thu, 01 Jan 1970 00:00:01 GMT\",\r\n _a);\r\n if (!isIE()) {\r\n // Set max age to expire now\r\n values[\"max-age\"] = \"0\";\r\n }\r\n var delCookie = cookieMgrConfig.delCookie || _setCookieValue;\r\n delCookie(name, _formatCookieValue(strEmpty, values));\r\n result = true;\r\n }\r\n return result;\r\n }\r\n };\r\n // Associated this cookie manager with the config\r\n cookieMgr[strConfigCookieMgr] = cookieMgr;\r\n return cookieMgr;\r\n}\r\n/*\r\n* Helper method to tell if document.cookie object is supported by the runtime\r\n*/\r\nexport function areCookiesSupported(logger) {\r\n if (_supportsCookies === null) {\r\n _supportsCookies = false;\r\n try {\r\n var doc = _doc || {};\r\n _supportsCookies = doc[strCookie] !== undefined;\r\n }\r\n catch (e) {\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, \"Cannot access document.cookie - \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return _supportsCookies;\r\n}\r\nfunction _extractParts(theValue) {\r\n var values = {};\r\n if (theValue && theValue.length) {\r\n var parts = strTrim(theValue).split(\";\");\r\n arrForEach(parts, function (thePart) {\r\n thePart = strTrim(thePart || strEmpty);\r\n if (thePart) {\r\n var idx = thePart.indexOf(\"=\");\r\n if (idx === -1) {\r\n values[thePart] = null;\r\n }\r\n else {\r\n values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));\r\n }\r\n }\r\n });\r\n }\r\n return values;\r\n}\r\nfunction _formatDate(theDate, func) {\r\n if (isFunction(theDate[func])) {\r\n return theDate[func]();\r\n }\r\n return null;\r\n}\r\nfunction _formatCookieValue(value, values) {\r\n var cookieValue = value || strEmpty;\r\n objForEachKey(values, function (name, theValue) {\r\n cookieValue += \"; \" + name + (!isNullOrUndefined(theValue) ? \"=\" + theValue : strEmpty);\r\n });\r\n return cookieValue;\r\n}\r\nfunction _getCookieValue(name) {\r\n var cookieValue = strEmpty;\r\n if (_doc) {\r\n var theCookie = _doc[strCookie] || strEmpty;\r\n if (_parsedCookieValue !== theCookie) {\r\n _cookieCache = _extractParts(theCookie);\r\n _parsedCookieValue = theCookie;\r\n }\r\n cookieValue = strTrim(_cookieCache[name] || strEmpty);\r\n }\r\n return cookieValue;\r\n}\r\nfunction _setCookieValue(name, cookieValue) {\r\n if (_doc) {\r\n _doc[strCookie] = name + \"=\" + cookieValue;\r\n }\r\n}\r\nexport function uaDisallowsSameSiteNone(userAgent) {\r\n if (!isString(userAgent)) {\r\n return false;\r\n }\r\n // Cover all iOS based browsers here. This includes:\r\n // - Safari on iOS 12 for iPhone, iPod Touch, iPad\r\n // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad\r\n // - Chrome on iOS 12 for iPhone, iPod Touch, iPad\r\n // All of which are broken by SameSite=None, because they use the iOS networking stack\r\n if (strContains(userAgent, \"CPU iPhone OS 12\") || strContains(userAgent, \"iPad; CPU OS 12\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:\r\n // - Safari on Mac OS X\r\n // This does not include:\r\n // - Internal browser on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strContains(userAgent, \"Version/\") && strContains(userAgent, \"Safari\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:\r\n // - Internal browser on Mac OS X\r\n // This does not include:\r\n // - Safari on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strEndsWith(userAgent, \"AppleWebKit/605.1.15 (KHTML, like Gecko)\")) {\r\n return true;\r\n }\r\n // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.\r\n // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.\r\n // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.\r\n if (strContains(userAgent, \"Chrome/5\") || strContains(userAgent, \"Chrome/6\")) {\r\n return true;\r\n }\r\n // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal\r\n // that don't specify their Chrome version as lacking support for SameSite=None.\r\n if (strContains(userAgent, \"UnrealEngine\") && !strContains(userAgent, \"Chrome\")) {\r\n return true;\r\n }\r\n // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None\r\n // NB: this rule isn't complete - you need regex to make a complete rule.\r\n // See: https://www.chromium.org/updates/same-site/incompatible-clients\r\n if (strContains(userAgent, \"UCBrowser/12\") || strContains(userAgent, \"UCBrowser/11\")) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=CookieMgr.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { __spreadArrayFn as __spreadArray } from \"@microsoft/applicationinsights-shims\";\r\nimport { objCreateFn } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { ChannelController } from \"./ChannelController\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { initializePlugins, sortPlugins } from \"./TelemetryHelpers\";\r\nimport { LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { getGblPerfMgr, PerfManager } from \"./PerfManager\";\r\nimport { createCookieMgr } from \"./CookieMgr\";\r\nimport { arrForEach, isNullOrUndefined, toISOString, getSetValue, setValue, throwError, isNotTruthy, isFunction } from \"./HelperFuncs\";\r\nimport { strExtensionConfig, strIKey } from \"./Constants\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nvar validationError = \"Extensions must provide callback to initialize\";\r\nvar strNotificationManager = \"_notificationManager\";\r\n/**\r\n * Helper to create the default performance manager\r\n * @param core\r\n * @param notificationMgr\r\n */\r\nfunction _createPerfManager(core, notificationMgr) {\r\n return new PerfManager(notificationMgr);\r\n}\r\nvar BaseCore = /** @class */ (function () {\r\n function BaseCore() {\r\n var _isInitialized = false;\r\n var _eventQueue;\r\n var _channelController;\r\n var _notificationManager;\r\n var _perfManager;\r\n var _cookieManager;\r\n dynamicProto(BaseCore, this, function (_self) {\r\n _self._extensions = new Array();\r\n _channelController = new ChannelController();\r\n // Use a default logger so initialization errors are not dropped on the floor with full logging\r\n _self.logger = new DiagnosticLogger({ loggingLevelConsole: LoggingSeverity.CRITICAL });\r\n _eventQueue = [];\r\n _self.isInitialized = function () { return _isInitialized; };\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n // Make sure core is only initialized once\r\n if (_self.isInitialized()) {\r\n throwError(\"Core should not be initialized more than once\");\r\n }\r\n if (!config || isNullOrUndefined(config.instrumentationKey)) {\r\n throwError(\"Please provide instrumentation key\");\r\n }\r\n _notificationManager = notificationManager;\r\n // For backward compatibility only\r\n _self[strNotificationManager] = notificationManager;\r\n _self.config = config || {};\r\n if (_self.config.enablePerfMgr) {\r\n // Set the performance manager creation function if not defined\r\n setValue(_self.config, \"createPerfMgr\", _createPerfManager);\r\n }\r\n config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions;\r\n // add notification to the extensions in the config so other plugins can access it\r\n var extConfig = getSetValue(config, strExtensionConfig);\r\n extConfig.NotificationManager = notificationManager;\r\n if (logger) {\r\n _self.logger = logger;\r\n }\r\n // Concat all available extensions\r\n var allExtensions = [];\r\n allExtensions.push.apply(allExtensions, __spreadArray(__spreadArray([], extensions, false), config.extensions, false));\r\n allExtensions = sortPlugins(allExtensions);\r\n var coreExtensions = [];\r\n var channelExtensions = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the\r\n var extPriorities = {};\r\n // Extension validation\r\n arrForEach(allExtensions, function (ext) {\r\n if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) {\r\n throwError(validationError);\r\n }\r\n var extPriority = ext.priority;\r\n var identifier = ext.identifier;\r\n if (ext && extPriority) {\r\n if (!isNullOrUndefined(extPriorities[extPriority])) {\r\n logger.warnToConsole(\"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channelController\r\n if (!extPriority || extPriority < _channelController.priority) {\r\n // Add to core extension that will be managed by BaseCore\r\n coreExtensions.push(ext);\r\n }\r\n else {\r\n // Add all other extensions to be managed by the channel controller\r\n channelExtensions.push(ext);\r\n }\r\n });\r\n // Validation complete\r\n // Add the channelController to the complete extension collection and\r\n // to the end of the core extensions\r\n allExtensions.push(_channelController);\r\n coreExtensions.push(_channelController);\r\n // Sort the complete set of extensions by priority\r\n allExtensions = sortPlugins(allExtensions);\r\n _self._extensions = allExtensions;\r\n // initialize channel controller first, this will initialize all channel plugins\r\n initializePlugins(new ProcessTelemetryContext([_channelController], config, _self), allExtensions);\r\n initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _self), allExtensions);\r\n // Now reset the extensions to just those being managed by Basecore\r\n _self._extensions = coreExtensions;\r\n if (_self.getTransmissionControls().length === 0) {\r\n throwError(\"No channels available\");\r\n }\r\n _isInitialized = true;\r\n _self.releaseQueue();\r\n };\r\n _self.getTransmissionControls = function () {\r\n return _channelController.getChannelControls();\r\n };\r\n _self.track = function (telemetryItem) {\r\n // setup default iKey if not passed in\r\n setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy);\r\n // add default timestamp if not passed in\r\n setValue(telemetryItem, \"time\", toISOString(new Date()), null, isNotTruthy);\r\n // Common Schema 4.0\r\n setValue(telemetryItem, \"ver\", \"4.0\", null, isNullOrUndefined);\r\n if (_self.isInitialized()) {\r\n // Process the telemetry plugin chain\r\n _self.getProcessTelContext().processNext(telemetryItem);\r\n }\r\n else {\r\n // Queue events until all extensions are initialized\r\n _eventQueue.push(telemetryItem);\r\n }\r\n };\r\n _self.getProcessTelContext = function () {\r\n var extensions = _self._extensions;\r\n var thePlugins = extensions;\r\n // invoke any common telemetry processors before sending through pipeline\r\n if (!extensions || extensions.length === 0) {\r\n // Pass to Channel controller so data is sent to correct channel queues\r\n thePlugins = [_channelController];\r\n }\r\n return new ProcessTelemetryContext(thePlugins, _self.config, _self);\r\n };\r\n _self.getNotifyMgr = function () {\r\n if (!_notificationManager) {\r\n // Create Dummy notification manager\r\n _notificationManager = objCreateFn({\r\n addNotificationListener: function (listener) { },\r\n removeNotificationListener: function (listener) { },\r\n eventsSent: function (events) { },\r\n eventsDiscarded: function (events, reason) { },\r\n eventsSendRequest: function (sendReason, isAsync) { }\r\n });\r\n // For backward compatibility only\r\n _self[strNotificationManager] = _notificationManager;\r\n }\r\n return _notificationManager;\r\n };\r\n _self.getCookieMgr = function () {\r\n if (!_cookieManager) {\r\n _cookieManager = createCookieMgr(_self.config, _self.logger);\r\n }\r\n return _cookieManager;\r\n };\r\n _self.setCookieMgr = function (cookieMgr) {\r\n _cookieManager = cookieMgr;\r\n };\r\n _self.getPerfMgr = function () {\r\n if (!_perfManager) {\r\n if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) {\r\n _perfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr());\r\n }\r\n }\r\n return _perfManager || getGblPerfMgr();\r\n };\r\n _self.setPerfMgr = function (perfMgr) {\r\n _perfManager = perfMgr;\r\n };\r\n _self.eventCnt = function () {\r\n return _eventQueue.length;\r\n };\r\n _self.releaseQueue = function () {\r\n if (_eventQueue.length > 0) {\r\n arrForEach(_eventQueue, function (event) {\r\n _self.getProcessTelContext().processNext(event);\r\n });\r\n _eventQueue = [];\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for BaseCore.prototype.initialize.\r\n// Removed Stub for BaseCore.prototype.getTransmissionControls.\r\n// Removed Stub for BaseCore.prototype.track.\r\n// Removed Stub for BaseCore.prototype.getProcessTelContext.\r\n// Removed Stub for BaseCore.prototype.getNotifyMgr.\r\n// Removed Stub for BaseCore.prototype.getCookieMgr.\r\n// Removed Stub for BaseCore.prototype.setCookieMgr.\r\n// Removed Stub for BaseCore.prototype.getPerfMgr.\r\n// Removed Stub for BaseCore.prototype.setPerfMgr.\r\n// Removed Stub for BaseCore.prototype.eventCnt.\r\n// Removed Stub for BaseCore.prototype.releaseQueue.\r\n return BaseCore;\r\n}());\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport { BaseCore } from \"./BaseCore\";\r\nimport { EventsDiscardedReason } from \"../JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { _InternalLogMessage, DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrForEach, isNullOrUndefined, toISOString, throwError } from \"./HelperFuncs\";\r\n\"use strict\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Internal log poller\r\n */\r\n var _internalLogPoller = 0;\r\n dynamicProto(AppInsightsCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));\r\n };\r\n _self.track = function (telemetryItem) {\r\n doPerf(_self.getPerfMgr(), function () { return \"AppInsightsCore:track\"; }, function () {\r\n if (telemetryItem === null) {\r\n _notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throwError(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n _validateTelemetryItem(telemetryItem);\r\n _base.track(telemetryItem);\r\n }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param {INotificationListener} listener - An INotificationListener object.\r\n */\r\n _self.addNotificationListener = function (listener) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.addNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - INotificationListener to remove.\r\n */\r\n _self.removeNotificationListener = function (listener) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.removeNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Periodically check logger.queue for log messages to be flushed\r\n */\r\n _self.pollInternalLogs = function (eventName) {\r\n var interval = _self.config.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n if (_internalLogPoller) {\r\n _self.stopPollingInternalLogs();\r\n }\r\n _internalLogPoller = setInterval(function () {\r\n var queue = _self.logger ? _self.logger.queue : [];\r\n arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: eventName ? eventName : \"InternalMessageId: \" + logMessage.messageId,\r\n iKey: _self.config.instrumentationKey,\r\n time: toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage.message }\r\n };\r\n _self.track(item);\r\n });\r\n queue.length = 0;\r\n }, interval);\r\n return _internalLogPoller;\r\n };\r\n /**\r\n * Stop polling log messages from logger.queue\r\n */\r\n _self.stopPollingInternalLogs = function () {\r\n if (!_internalLogPoller)\r\n return;\r\n clearInterval(_internalLogPoller);\r\n _internalLogPoller = 0;\r\n };\r\n function _validateTelemetryItem(telemetryItem) {\r\n if (isNullOrUndefined(telemetryItem.name)) {\r\n _notifyInvalidEvent(telemetryItem);\r\n throw Error(\"telemetry name required\");\r\n }\r\n }\r\n function _notifyInvalidEvent(telemetryItem) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AppInsightsCore.prototype.initialize.\r\n// Removed Stub for AppInsightsCore.prototype.track.\r\n// Removed Stub for AppInsightsCore.prototype.addNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.removeNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.pollInternalLogs.\r\n// Removed Stub for AppInsightsCore.prototype.stopPollingInternalLogs.\r\n return AppInsightsCore;\r\n}(BaseCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrForEach, arrIndexOf } from \"./HelperFuncs\";\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager(config) {\r\n this.listeners = [];\r\n var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll;\r\n dynamicProto(NotificationManager, this, function (_self) {\r\n _self.addNotificationListener = function (listener) {\r\n _self.listeners.push(listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - AWTNotificationListener to remove.\r\n */\r\n _self.removeNotificationListener = function (listener) {\r\n var index = arrIndexOf(_self.listeners, listener);\r\n while (index > -1) {\r\n _self.listeners.splice(index, 1);\r\n index = arrIndexOf(_self.listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param {ITelemetryItem[]} events - The array of events that have been sent.\r\n */\r\n _self.eventsSent = function (events) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsSent) {\r\n setTimeout(function () { return listener.eventsSent(events); }, 0);\r\n }\r\n });\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.\r\n * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n _self.eventsDiscarded = function (events, reason) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsDiscarded) {\r\n setTimeout(function () { return listener.eventsDiscarded(events, reason); }, 0);\r\n }\r\n });\r\n };\r\n /**\r\n * [Optional] A function called when the events have been requested to be sent to the sever.\r\n * @param {number} sendReason - The reason why the event batch is being sent.\r\n * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n _self.eventsSendRequest = function (sendReason, isAsync) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsSendRequest) {\r\n if (isAsync) {\r\n setTimeout(function () { return listener.eventsSendRequest(sendReason, isAsync); }, 0);\r\n }\r\n else {\r\n try {\r\n listener.eventsSendRequest(sendReason, isAsync);\r\n }\r\n catch (e) {\r\n // Catch errors to ensure we don't block sending the requests\r\n }\r\n }\r\n }\r\n });\r\n };\r\n _self.perfEvent = function (perfEvent) {\r\n if (perfEvent) {\r\n // Send all events or only parent events\r\n if (perfEvtsSendAll || !perfEvent.isChildEvt()) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.perfEvent) {\r\n if (perfEvent.isAsync) {\r\n setTimeout(function () { return listener.perfEvent(perfEvent); }, 0);\r\n }\r\n else {\r\n try {\r\n listener.perfEvent(perfEvent);\r\n }\r\n catch (e) {\r\n // Catch errors to ensure we don't block sending the requests\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for NotificationManager.prototype.addNotificationListener.\r\n// Removed Stub for NotificationManager.prototype.removeNotificationListener.\r\n// Removed Stub for NotificationManager.prototype.eventsSent.\r\n// Removed Stub for NotificationManager.prototype.eventsDiscarded.\r\n// Removed Stub for NotificationManager.prototype.eventsSendRequest.\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getCrypto, getMsCrypto, isIE } from \"./EnvUtils\";\r\nimport { dateNow } from \"./HelperFuncs\";\r\nvar UInt32Mask = 0x100000000;\r\nvar MaxUInt32 = 0xffffffff;\r\n// MWC based Random generator (for IE)\r\nvar _mwcSeeded = false;\r\nvar _mwcW = 123456789;\r\nvar _mwcZ = 987654321;\r\n// Takes any integer\r\nfunction _mwcSeed(seedValue) {\r\n if (seedValue < 0) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n seedValue >>>= 0;\r\n }\r\n _mwcW = (123456789 + seedValue) & MaxUInt32;\r\n _mwcZ = (987654321 - seedValue) & MaxUInt32;\r\n _mwcSeeded = true;\r\n}\r\nfunction _autoSeedMwc() {\r\n // Simple initialization using default Math.random() - So we inherit any entropy from the browser\r\n // and bitwise XOR with the current milliseconds\r\n try {\r\n var now = dateNow() & 0x7fffffff;\r\n _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);\r\n }\r\n catch (e) {\r\n // Don't crash if something goes wrong\r\n }\r\n}\r\n/**\r\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.\r\n * So maxValue(16) will produce a number from 0..16 (range of 17)\r\n * @param maxValue\r\n */\r\nexport function randomValue(maxValue) {\r\n if (maxValue > 0) {\r\n return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;\r\n }\r\n return 0;\r\n}\r\n/**\r\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function random32(signed) {\r\n var value;\r\n var c = getCrypto() || getMsCrypto();\r\n if (c && c.getRandomValues) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;\r\n }\r\n else if (isIE()) {\r\n // For IE 6, 7, 8 (especially on XP) Math.random is not very random\r\n if (!_mwcSeeded) {\r\n // Set the seed for the Mwc algorithm\r\n _autoSeedMwc();\r\n }\r\n // Don't use Math.random for IE\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mwcRandom32() & MaxUInt32;\r\n }\r\n else {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = Math.floor((UInt32Mask * Math.random()) | 0);\r\n }\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Seed the MWC random number generator with the specified seed or a random value\r\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\r\n */\r\nexport function mwcRandomSeed(value) {\r\n if (!value) {\r\n _autoSeedMwc();\r\n }\r\n else {\r\n _mwcSeed(value);\r\n }\r\n}\r\n/**\r\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)\r\n * instead of Math.random() defaults to un-signed.\r\n * Used as a replacement random generator for IE to avoid issues with older IE instances.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function mwcRandom32(signed) {\r\n _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;\r\n _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;\r\n var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n//# sourceMappingURL=RandomHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { objCreateFn, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { _gblCookieMgr } from \"./CookieMgr\";\r\nimport { getWindow, getDocument, getPerformance, isIE } from \"./EnvUtils\";\r\nimport { arrForEach, arrIndexOf, arrMap, arrReduce, attachEvent, dateNow, detachEvent, hasOwnProperty, isArray, isBoolean, isDate, isError, isFunction, isNullOrUndefined, isNumber, isObject, isString, isTypeof, isUndefined, objDefineAccessors, objKeys, strTrim, toISOString } from \"./HelperFuncs\";\r\nimport { randomValue, random32, mwcRandomSeed, mwcRandom32 } from \"./RandomHelper\";\r\nvar strVisibilityChangeEvt = \"visibilitychange\";\r\nvar strPageHide = \"pagehide\";\r\nvar strPageShow = \"pageshow\";\r\nvar _cookieMgrs = null;\r\nvar _canUseCookies; // legacy supported config\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\n/**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\nexport function addEventHandler(eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = attachEvent(w, eventName, callback);\r\n result = attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = attachEvent(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Bind the listener to the array of events\r\n * @param events An string array of event names to bind the listener to\r\n * @param listener The event callback to call when the event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addEventListeners(events, listener, excludeEvents) {\r\n var added = false;\r\n if (listener && events && isArray(events)) {\r\n var excluded_1 = [];\r\n arrForEach(events, function (name) {\r\n if (isString(name)) {\r\n if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {\r\n added = addEventHandler(name, listener) || added;\r\n }\r\n else {\r\n excluded_1.push(name);\r\n }\r\n }\r\n });\r\n if (!added && excluded_1.length > 0) {\r\n // Failed to add any listeners and we excluded some, so just attempt to add the excluded events\r\n added = addEventListeners(excluded_1, listener);\r\n }\r\n }\r\n return added;\r\n}\r\n/**\r\n * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,\r\n * this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden\r\n * it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is\r\n * just navigating to a different Tab and may come back (without unloading the page). As such you may also\r\n * need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.\r\n * @param listener - The event callback to call when a page unload event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageUnloadEventListener(listener, excludeEvents) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigation's.\r\n return addEventListeners([\"beforeunload\", \"unload\", \"pagehide\"], listener, excludeEvents);\r\n}\r\n/**\r\n * Listen to the pagehide and visibility changing to 'hidden' events\r\n * @param listener - The event callback to call when a page hide event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageHideEventListener(listener, excludeEvents) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"hidden\") {\r\n listener(evt);\r\n }\r\n }\r\n var pageUnloadAdded = false;\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strPageHide) === -1) {\r\n pageUnloadAdded = addEventHandler(strPageHide, listener);\r\n }\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageUnloadAdded = addEventHandler(strVisibilityChangeEvt, _handlePageVisibility) || pageUnloadAdded;\r\n }\r\n if (!pageUnloadAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageUnloadAdded = addPageHideEventListener(listener);\r\n }\r\n return pageUnloadAdded;\r\n}\r\n/**\r\n * Listen to the pageshow and visibility changing to 'visible' events\r\n * @param listener - The event callback to call when a page is show event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageShowEventListener(listener, excludeEvents) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"visible\") {\r\n listener(evt);\r\n }\r\n }\r\n var pageShowAdded = false;\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strPageShow) === -1) {\r\n pageShowAdded = addEventHandler(strPageShow, listener);\r\n }\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageShowAdded = addEventHandler(strVisibilityChangeEvt, _handlePageVisibility) || pageShowAdded;\r\n }\r\n if (!pageShowAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageShowAdded = addPageShowEventListener(listener);\r\n }\r\n return pageShowAdded;\r\n}\r\nexport function newGuid() {\r\n function randomHexDigit() {\r\n return randomValue(15); // Get a random value from 0..15\r\n }\r\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(GuidRegex, function (c) {\r\n var r = (randomHexDigit() | 0), v = (c === \"x\" ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n}\r\n/**\r\n * Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less)\r\n * https://caniuse.com/#search=performance.now\r\n */\r\nexport function perfNow() {\r\n var perf = getPerformance();\r\n if (perf && perf.now) {\r\n return perf.now();\r\n }\r\n return dateNow();\r\n}\r\n/**\r\n * Generate random base64 id string.\r\n * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\r\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\r\n */\r\nexport function newId(maxLength) {\r\n if (maxLength === void 0) { maxLength = 22; }\r\n var base64chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n // Start with an initial random number, consuming the value in reverse byte order\r\n var number = random32() >>> 0; // Make sure it's a +ve number\r\n var chars = 0;\r\n var result = \"\";\r\n while (result.length < maxLength) {\r\n chars++;\r\n result += base64chars.charAt(number & 0x3F);\r\n number >>>= 6; // Zero fill with right shift\r\n if (chars === 5) {\r\n // 5 base64 characters === 30 bits so we don't have enough bits for another base64 char\r\n // So add on another 30 bits and make sure it's +ve\r\n number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;\r\n chars = 0; // We need to reset the number every 5 chars (30 bits)\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param search - The characters to be searched for at the end of the value.\r\n * @returns true if the given search value is found at the end of the string, otherwise false.\r\n */\r\nexport function strEndsWith(value, search) {\r\n if (value && search) {\r\n var len = value.length;\r\n var start = len - search.length;\r\n return value.substring(start >= 0 ? start : 0, len) === search;\r\n }\r\n return false;\r\n}\r\n/**\r\n * generate W3C trace id\r\n */\r\nexport function generateW3CId() {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = \"\", tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = random32();\r\n oct +=\r\n hexValues[tmp & 0xF] +\r\n hexValues[tmp >> 4 & 0xF] +\r\n hexValues[tmp >> 8 & 0xF] +\r\n hexValues[tmp >> 12 & 0xF] +\r\n hexValues[tmp >> 16 & 0xF] +\r\n hexValues[tmp >> 20 & 0xF] +\r\n hexValues[tmp >> 24 & 0xF] +\r\n hexValues[tmp >> 28 & 0xF];\r\n }\r\n // \"Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively\"\r\n var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];\r\n return oct.substr(0, 8) + oct.substr(9, 4) + \"4\" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);\r\n}\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\nvar GuidRegex = /[xy]/g;\r\nexport var EventHelper = {\r\n Attach: attachEvent,\r\n AttachEvent: attachEvent,\r\n Detach: detachEvent,\r\n DetachEvent: detachEvent\r\n};\r\n/**\r\n * Helper to support backward compatibility for users that use the legacy cookie handling functions and the use the internal\r\n * CoreUtils._canUseCookies global flag to enable/disable cookies usage.\r\n * Note: This has the following deliberate side-effects\r\n * - Creates the global (legacy) cookie manager if it does not already exist\r\n * - Attempts to add \"listeners\" to the CoreUtils._canUseCookies property to support the legacy usage\r\n * @param config\r\n * @param logger\r\n * @returns\r\n */\r\nexport function _legacyCookieMgr(config, logger) {\r\n var cookieMgr = _gblCookieMgr(config, logger);\r\n var legacyCanUseCookies = CoreUtils._canUseCookies;\r\n if (_cookieMgrs === null) {\r\n _cookieMgrs = [];\r\n _canUseCookies = legacyCanUseCookies;\r\n // Dynamically create get/set property accessors for backward compatibility for enabling / disabling cookies\r\n // this WILL NOT work for ES3 browsers (< IE8)\r\n objDefineAccessors(CoreUtils, \"_canUseCookies\", function () {\r\n return _canUseCookies;\r\n }, function (value) {\r\n _canUseCookies = value;\r\n arrForEach(_cookieMgrs, function (mgr) {\r\n mgr.setEnabled(value);\r\n });\r\n });\r\n }\r\n if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {\r\n _cookieMgrs.push(cookieMgr);\r\n }\r\n if (isBoolean(legacyCanUseCookies)) {\r\n cookieMgr.setEnabled(legacyCanUseCookies);\r\n }\r\n if (isBoolean(_canUseCookies)) {\r\n cookieMgr.setEnabled(_canUseCookies);\r\n }\r\n return cookieMgr;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n */\r\nexport function disableCookies() {\r\n _legacyCookieMgr().setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().isEnabled()\r\n * Helper method to tell if document.cookie object is available and whether it can be used.\r\n */\r\nexport function canUseCookies(logger) {\r\n return _legacyCookieMgr(null, logger).isEnabled();\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().get()\r\n * helper method to access userId and sessionId cookie\r\n */\r\nexport function getCookie(logger, name) {\r\n return _legacyCookieMgr(null, logger).get(name);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().set()\r\n * helper method to set userId and sessionId cookie\r\n */\r\nexport function setCookie(logger, name, value, domain) {\r\n _legacyCookieMgr(null, logger).set(name, value, null, domain);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().del()\r\n * Deletes a cookie by setting it's expiration time in the past.\r\n * @param name - The name of the cookie to delete.\r\n */\r\nexport function deleteCookie(logger, name) {\r\n return _legacyCookieMgr(null, logger).del(name);\r\n}\r\n//# sourceMappingURL=CoreUtils.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * Enums.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File containing the enums as constants.\r\n */\r\nimport { __assignFn as __assign } from \"@microsoft/applicationinsights-shims\";\r\nimport { _InternalMessageId } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * The ValueKind contains a set of values that specify value kind of the property.\r\n * Either PII (Personal Identifiable Information) or customer content.\r\n */\r\nexport var ValueKind = {\r\n /**\r\n * No kind.\r\n */\r\n NotSet: 0,\r\n /**\r\n * An LDAP distinguished name. For example, CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM.\r\n */\r\n Pii_DistinguishedName: 1,\r\n /**\r\n * Generic information.\r\n */\r\n Pii_GenericData: 2,\r\n /**\r\n * An IPV4 Internet address. For example, 192.0.2.1.\r\n */\r\n Pii_IPV4Address: 3,\r\n /**\r\n * An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.\r\n */\r\n Pii_IPv6Address: 4,\r\n /**\r\n * The Subject of an e-mail message.\r\n */\r\n Pii_MailSubject: 5,\r\n /**\r\n * A telephone number.\r\n */\r\n Pii_PhoneNumber: 6,\r\n /**\r\n * A query string.\r\n */\r\n Pii_QueryString: 7,\r\n /**\r\n * An SIP (Session Internet Protocol) address.\r\n */\r\n Pii_SipAddress: 8,\r\n /**\r\n * An e-mail address.\r\n */\r\n Pii_SmtpAddress: 9,\r\n /**\r\n * An user ID.\r\n */\r\n Pii_Identity: 10,\r\n /**\r\n * A URI (Uniform Resource Identifier).\r\n */\r\n Pii_Uri: 11,\r\n /**\r\n * The fully-qualified domain name.\r\n */\r\n Pii_Fqdn: 12,\r\n /**\r\n * Scrubs the last octet in a IPV4 Internet address.\r\n * For example: 10.121.227.147 becomes 10.121.227.*\r\n */\r\n Pii_IPV4AddressLegacy: 13,\r\n /**\r\n * Generic content.\r\n */\r\n CustomerContent_GenericContent: 32\r\n};\r\n/**\r\n * The EventLatency contains a set of values that specify the latency with which an event is sent.\r\n */\r\nexport var EventLatency = {\r\n /**\r\n * Normal latency.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Cost deferred latency. At the moment this latency is treated as Normal latency.\r\n */\r\n CostDeferred: 2 /* CostDeferred */,\r\n /**\r\n * Real time latency.\r\n */\r\n RealTime: 3 /* RealTime */,\r\n /**\r\n * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.\r\n * Added in v3.1.1\r\n */\r\n Immediate: 4 /* Immediate */\r\n};\r\n/**\r\n * Enum for property types.\r\n */\r\nexport var EventPropertyType = {\r\n Unspecified: 0,\r\n String: 1,\r\n Int32: 2,\r\n UInt32: 3,\r\n Int64: 4,\r\n UInt64: 5,\r\n Double: 6,\r\n Bool: 7,\r\n Guid: 8,\r\n DateTime: 9\r\n};\r\n/**\r\n * The EventPersistence contains a set of values that specify the event's persistence.\r\n */\r\nexport var EventPersistence = {\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* Critical */\r\n};\r\n/**\r\n * The TraceLevel contains a set of values that specify the trace level for the trace messages.\r\n */\r\nexport var TraceLevel = {\r\n /**\r\n * None.\r\n */\r\n NONE: 0,\r\n /**\r\n * Error trace.\r\n */\r\n ERROR: 1,\r\n /**\r\n * Warning trace.\r\n */\r\n WARNING: 2,\r\n /**\r\n * Information trace.\r\n */\r\n INFORMATION: 3\r\n};\r\nexport var _ExtendedInternalMessageId = __assign(__assign({}, _InternalMessageId), { AuthHandShakeError: 501, AuthRedirectFail: 502, BrowserCannotReadLocalStorage: 503, BrowserCannotWriteLocalStorage: 504, BrowserDoesNotSupportLocalStorage: 505, CannotParseBiBlobValue: 506, CannotParseDataAttribute: 507, CVPluginNotAvailable: 508, DroppedEvent: 509, ErrorParsingAISessionCookie: 510, ErrorProvidedChannels: 511, FailedToGetCookies: 512, FailedToInitializeCorrelationVector: 513, FailedToInitializeSDK: 514, InvalidContentBlob: 515, InvalidCorrelationValue: 516, SessionRenewalDateIsZero: 517, SendPostOnCompleteFailure: 518, PostResponseHandler: 519, SDKNotInitialized: 520 });\r\n//# sourceMappingURL=Enums.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nvar _a;\r\n/**\r\n * Utils.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n * File containing utility functions.\r\n */\r\nimport { objCreateFn, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { EventPropertyType, ValueKind, EventLatency } from \"./Enums\";\r\nimport { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from \"@microsoft/applicationinsights-core-js\";\r\nexport var Version = '3.1.9';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* NotSet */] = EventPropertyType.Unspecified,\r\n _a[2 /* Number */] = EventPropertyType.Double,\r\n _a[1 /* String */] = EventPropertyType.String,\r\n _a[3 /* Boolean */] = EventPropertyType.Bool,\r\n _a[4096 /* Array */ | 2 /* Number */] = EventPropertyType.Double,\r\n _a[4096 /* Array */ | 1 /* String */] = EventPropertyType.String,\r\n _a[4096 /* Array */ | 3 /* Boolean */] = EventPropertyType.Bool,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = Boolean(getDocument());\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = Boolean(getWindow());\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// <summary> takes a value and checks for undefined, null and empty string </summary>\r\n /// <param type=\"any\"> value to be tested </param>\r\n /// <returns> true if value is null undefined or emptyString </returns>\r\n return !(value === \"\" || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = apiKey.indexOf(\"-\");\r\n if (indexTenantId > -1) {\r\n return apiKey.substring(0, indexTenantId);\r\n }\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= EventLatency.Normal && value <= EventLatency.Immediate) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !property.hasOwnProperty(\"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property.value)\r\n || property.value === \"\" || (!isString(property.value)\r\n && !isNumber(property.value) && !isBoolean(property.value)\r\n && !isArray(property.value))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property.value) &&\r\n !isArrayValid(property.value)) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if (isArray(property.value) || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n property.value = property.value.toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === EventPropertyType.Double) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport function disableCookies() {\r\n safeGetCookieMgr(null).setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().set()\r\n * Sets the value of a cookie.\r\n * @param name - Cookie name.\r\n * @param value - Cookie value.\r\n * @param days - Expiration days.\r\n */\r\nexport function setCookie(name, value, days) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).set(name, value, days * 86400, null, \"/\");\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().del()\r\n * Deletes a cookie, by setting its expiration to -1.\r\n * @param name - Cookie name to delete.\r\n */\r\nexport function deleteCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).del(name);\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().get()\r\n * Gets the cookie value for the specified cookie.\r\n * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'\r\n * @param cookieName - Cookie name.\r\n */\r\nexport function getCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n return getCookieValue(safeGetCookieMgr(null), name);\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || \"\";\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* Numeric */) {\r\n theGuid = theGuid.replace(/-/g, \"\");\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments.length;\r\n var objProto = Object[strPrototype];\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (objProto.toString.call(theArgs[0]) === \"[object Boolean]\") {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === ValueKind.NotSet || ((value > ValueKind.NotSet && value <= ValueKind.Pii_IPV4AddressLegacy) || value === ValueKind.CustomerContent_GenericContent)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua.indexOf(\"safari\") >= 0 || ua.indexOf(\"firefox\") >= 0) && ua.indexOf(\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value.length > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt.timings = evt.timings || {};\r\n evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};\r\n evt.timings.processTelemetryStart[identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* Array */;\r\n if (value.length > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (hasOwnProperty(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* EventProperty */ | getFieldValueType(value.value);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\nexport var Utils = {\r\n Version: Version,\r\n FullVersionString: FullVersionString,\r\n strUndefined: strUndefined,\r\n strObject: strObject,\r\n Undefined: strUndefined,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n objKeys: objKeys,\r\n toISOString: toISOString,\r\n isReactNative: isReactNative,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n isFunction: isFunction,\r\n isArray: isArray,\r\n isObject: isObject,\r\n strTrim: strTrim,\r\n isDocumentObjectAvailable: isDocumentObjectAvailable,\r\n isWindowObjectAvailable: isWindowObjectAvailable,\r\n isValueAssigned: isValueAssigned,\r\n getTenantId: getTenantId,\r\n isBeaconsSupported: isBeaconsSupported,\r\n isUint8ArrayAvailable: isUint8ArrayAvailable,\r\n isLatency: isLatency,\r\n sanitizeProperty: sanitizeProperty,\r\n getISOString: toISOString,\r\n useXDomainRequest: useXDomainRequest,\r\n getCommonSchemaMetaData: getCommonSchemaMetaData,\r\n cookieAvailable: areCookiesSupported,\r\n disallowsSameSiteNone: uaDisallowsSameSiteNone,\r\n setCookie: setCookie,\r\n deleteCookie: deleteCookie,\r\n getCookie: getCookie,\r\n createGuid: createGuid,\r\n extend: extend,\r\n getTime: getTime,\r\n isValueKind: isValueKind,\r\n isArrayValid: isArrayValid,\r\n objDefineAccessors: objDefineAccessors,\r\n addPageUnloadEventListener: addPageUnloadEventListener,\r\n setProcessTelemetryTimings: setProcessTelemetryTimings,\r\n addEventHandler: addEventHandler,\r\n getFieldValueType: getFieldValueType,\r\n strEndsWith: strEndsWith,\r\n objForEachKey: objForEachKey\r\n};\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n return xhr;\r\n}\r\n//# sourceMappingURL=Utils.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * AppInsightsCore.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n */\r\nimport { AppInsightsCore as InternalCore, LoggingSeverity, doPerf, arrForEach, dumpObj, DiagnosticLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { EventLatency, _ExtendedInternalMessageId } from \"./Enums\";\r\nimport { isLatency, FullVersionString, getTime } from \"./Utils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar PropVersion = \"version\";\r\nvar properties = \"properties\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n var _this = _super.call(this) || this;\r\n _this.pluginVersionStringArr = [];\r\n _this.pluginVersionString = \"\";\r\n dynamicProto(AppInsightsCore, _this, function (_self, _base) {\r\n if (!_self.logger || !_self.logger.queue) {\r\n // The AI Base can inject a No-Op logger so if not defined or the No-Op, change to use a default logger so initialization errors\r\n // are not dropped on the floor if one is not already defined\r\n _self.logger = new DiagnosticLogger({ loggingLevelConsole: LoggingSeverity.CRITICAL });\r\n }\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n doPerf(_self, function () { return \"AppInsightsCore.initialize\"; }, function () {\r\n // Add default collector url\r\n if (config) {\r\n if (!config.endpointUrl) {\r\n config.endpointUrl = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\n }\r\n var propertyStorageOverride = config.propertyStorageOverride;\r\n // Validate property storage override\r\n if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {\r\n throw new Error(\"Invalid property storage override passed.\");\r\n }\r\n if (config.channels) {\r\n arrForEach(config.channels, function (channels) {\r\n if (channels) {\r\n arrForEach(channels, function (channel) {\r\n if (channel.identifier && channel.version) {\r\n var ver = channel.identifier + \"=\" + channel.version;\r\n _self.pluginVersionStringArr.push(ver);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n _self.getWParam = function () {\r\n return typeof document !== \"undefined\" ? 0 : -1;\r\n };\r\n if (extensions) {\r\n arrForEach(extensions, function (ext) {\r\n if (ext && ext.identifier && ext.version) {\r\n var ver = ext.identifier + \"=\" + ext.version;\r\n _self.pluginVersionStringArr.push(ver);\r\n }\r\n });\r\n }\r\n _self.pluginVersionString = _self.pluginVersionStringArr.join(\";\");\r\n try {\r\n _base.initialize(config, extensions, logger, notificationManager);\r\n _self.pollInternalLogs(\"InternalLog\");\r\n }\r\n catch (e) {\r\n var logger_1 = _self.logger;\r\n var message = dumpObj(e);\r\n if (message.indexOf(\"channels\") !== -1) {\r\n // Add some additional context to the underlying reported error\r\n message += \"\\n - Channels must be provided through config.channels only!\";\r\n }\r\n logger_1.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.FailedToInitializeSDK, \"SDK Initialization Failed - no telemetry will be sent: \" + message);\r\n }\r\n }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });\r\n };\r\n _self.track = function (item) {\r\n doPerf(_self, function () { return \"AppInsightsCore.track\"; }, function () {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n telemetryItem.timings = telemetryItem.timings || {};\r\n telemetryItem.timings.trackStart = getTime();\r\n if (!isLatency(telemetryItem.latency)) {\r\n telemetryItem.latency = EventLatency.Normal;\r\n }\r\n var itemExt = telemetryItem.ext = telemetryItem.ext || {};\r\n itemExt.sdk = itemExt.sdk || {};\r\n itemExt.sdk.ver = FullVersionString;\r\n var baseData = telemetryItem.baseData = telemetryItem.baseData || {};\r\n if (!baseData[properties]) {\r\n baseData[properties] = {};\r\n }\r\n var itemProperties = baseData[properties];\r\n if (!itemProperties[PropVersion]) {\r\n itemProperties[PropVersion] = \"\";\r\n }\r\n if (_self.pluginVersionString !== \"\") {\r\n itemProperties[PropVersion] = _self.pluginVersionString;\r\n }\r\n }\r\n _base.track(telemetryItem);\r\n }, function () { return ({ item: item }); }, !(item.sync));\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AppInsightsCore.prototype.initialize.\r\n// Removed Stub for AppInsightsCore.prototype.track.\r\n return AppInsightsCore;\r\n}(InternalCore));\r\nexport default AppInsightsCore;\r\n//# sourceMappingURL=AppInsightsCore.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * BaseCore.ts\r\n * Base Core is a subset of 1DS Web SDK Core. The purpose of Base Core is to generate a smaller bundle size while providing essential features of Core. Features that are not included in Base Core are:\r\n * 1. Internal logging\r\n * 2. Sending notifications on telemetry sent/discarded\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n */\r\nimport { BaseCore as InternalCore, LoggingSeverity, dumpObj } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _ExtendedInternalMessageId } from \"./Enums\";\r\nimport { FullVersionString, isDocumentObjectAvailable } from \"./Utils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar BaseCore = /** @class */ (function (_super) {\r\n __extends(BaseCore, _super);\r\n function BaseCore() {\r\n var _this = _super.call(this) || this;\r\n dynamicProto(BaseCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n if (config && !config.endpointUrl) {\r\n config.endpointUrl = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\n }\r\n _self.getWParam = function () {\r\n return isDocumentObjectAvailable ? 0 : -1;\r\n };\r\n try {\r\n _base.initialize(config, extensions, logger, notificationManager);\r\n }\r\n catch (e) {\r\n _self.logger.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.FailedToInitializeSDK, \"Initialization Failed: \" + dumpObj(e) + \"\\n - Note: Channels must be provided through config.channels only\");\r\n }\r\n };\r\n _self.track = function (item) {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n var ext = telemetryItem.ext = telemetryItem.ext || {};\r\n ext.sdk = ext.sdk || {};\r\n ext.sdk.ver = FullVersionString;\r\n }\r\n _base.track(telemetryItem);\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for BaseCore.prototype.initialize.\r\n// Removed Stub for BaseCore.prototype.track.\r\n return BaseCore;\r\n}(InternalCore));\r\nexport default BaseCore;\r\n//# sourceMappingURL=BaseCore.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * ESPromise.ts\r\n * @author Nev Wylie (newylie))\r\n * @copyright Microsoft 2019\r\n * Simplified wrapper to provide ES6 style Promise callback handling for older browsers\r\n */\r\nimport { isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * Using a local variable to assist with minfication\r\n */\r\nvar _isFunction = isFunction;\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * This function will be used as onFulfilled handler for any Promise found in the iterable passed to Promise.all.\r\n * The goal here is to capture in a closure the index of the current item from the iterable. If we did not create\r\n * this closure, the captured index variable would be the same one that the for loop updates and thus would always\r\n * be pointing to the last index in the iterable by the time that the onFulfilled handler is called.\r\n * However, note that for the resolvedCallback callback we want the opposite. For this one we do want to capture\r\n * the same variable that the for loop updates so that we have the full count of pending promises by the time\r\n * the onFulfilled handlers start getting called.\r\n * @param values The resolving promise values\r\n * @param index The index of this callback function\r\n * @param resolvedCallback THe callback function used to check if the \"all\" promise is complete\r\n */\r\nfunction _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) {\r\n return function (value) {\r\n values[index] = value;\r\n resolvedCallback();\r\n };\r\n}\r\n/**\r\n * Simplified wrapper to provide ES6 style Promise callback handling for older browsers\r\n */\r\nvar ESPromise = /** @class */ (function () {\r\n /**\r\n * The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.\r\n * @param resolverFunc A function that is passed with the arguments resolve and reject. The executor function is executed\r\n * immediately by the Promise implementation, passing resolve and reject functions (the executor is called before the Promise\r\n * constructor even returns the created object). The resolve and reject functions, when called, resolve or reject the promise,\r\n * respectively. The executor normally initiates some asynchronous work, and then, once that completes, either calls the resolve\r\n * function to resolve the promise or else rejects it if an error occurred. If an error is thrown in the executor function, the\r\n * promise is rejected. The return value of the executor is ignored.\r\n */\r\n function ESPromise(resolverFunc) {\r\n var _state = 0 /* Pending */;\r\n var _settledValue = null;\r\n var _queue = [];\r\n dynamicProto(ESPromise, this, function (_this) {\r\n _this.then = function (onResolved, onRejected) {\r\n return new ESPromise(function (resolve, reject) {\r\n // Queue the new promise returned to be resolved or rejected\r\n // when this promise settles.\r\n _enqueue(onResolved, onRejected, resolve, reject);\r\n });\r\n };\r\n _this[\"catch\"] = function (onRejected) {\r\n return _this.then(null, onRejected);\r\n };\r\n });\r\n function _enqueue(onResolved, onRejected, resolve, reject) {\r\n _queue.push(function () {\r\n var value;\r\n try {\r\n // First call the onFulfilled or onRejected handler, on the settled value\r\n // of this promise. If the corresponding handler does not exist, simply\r\n // pass through the settled value.\r\n if (_state === 1 /* Resolved */) {\r\n value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue;\r\n }\r\n else {\r\n value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue;\r\n }\r\n if (value instanceof ESPromise) {\r\n // The called handlers returned a new promise, so the chained promise\r\n // will follow the state of this promise.\r\n value.then(resolve, reject);\r\n }\r\n else if (_state === 2 /* Rejected */ && !_isFunction(onRejected)) {\r\n // If there wasn't an onRejected handler and this promise is rejected, then\r\n // the chained promise also rejects with the same reason.\r\n reject(value);\r\n }\r\n else {\r\n // If this promise is fulfilled, then the chained promise is also fulfilled\r\n // with either the settled value of this promise (if no onFulfilled handler\r\n // was available) or the return value of the handler. If this promise is\r\n // rejected and there was an onRejected handler, then the chained promise is\r\n // fulfilled with the return value of the handler.\r\n resolve(value);\r\n }\r\n }\r\n catch (error) {\r\n // The chained promise will reject if there is any exception thrown while\r\n // calling the onFulfilled or onRejected handlers.\r\n reject(error);\r\n return;\r\n }\r\n });\r\n // If this promise is already settled, then immediately process the callback we\r\n // just added to the queue.\r\n if (_state !== 0 /* Pending */) {\r\n _processQueue();\r\n }\r\n }\r\n function _processQueue() {\r\n if (_queue.length > 0) {\r\n // The onFulfilled and onRejected handlers must be called asynchronously. Thus,\r\n // we make a copy of the queue and work on it once the current call stack unwinds.\r\n var pending_1 = _queue.slice();\r\n _queue = [];\r\n setTimeout(function () {\r\n for (var i = 0, len = pending_1.length; i < len; ++i) {\r\n try {\r\n pending_1[i]();\r\n }\r\n catch (e) {\r\n // Don't let 1 failing handler break all others\r\n // TODO (newylie): Add some form of error reporting (i.e. Call any registered JS error handler so the error is reported)\r\n }\r\n }\r\n }, 0);\r\n }\r\n }\r\n function _resolve(value) {\r\n if (_state === 0 /* Pending */) {\r\n _settledValue = value;\r\n _state = 1 /* Resolved */;\r\n _processQueue();\r\n }\r\n }\r\n function _reject(reason) {\r\n if (_state === 0 /* Pending */) {\r\n _settledValue = reason;\r\n _state = 2 /* Rejected */;\r\n _processQueue();\r\n }\r\n }\r\n (function _initialize() {\r\n if (!_isFunction(resolverFunc)) {\r\n throw new TypeError(\"ESPromise: resolvedFunc argument is not a Function\");\r\n }\r\n try {\r\n resolverFunc(_resolve, _reject);\r\n }\r\n catch (error) {\r\n // This promise will immediately reject if any exception is thrown\r\n // from within the executor function.\r\n _reject(error);\r\n }\r\n })();\r\n }\r\n /**\r\n * The Promise.resolve() method returns a Promise object that is resolved with a given value. If the value is a promise, that promise is returned;\r\n * if the value is a thenable (i.e. has a \"then\" method), the returned promise will \"follow\" that thenable, adopting its eventual state; otherwise\r\n * the returned promise will be fulfilled with the value. This function flattens nested layers of promise-like objects (e.g. a promise that resolves\r\n * to a promise that resolves to something) into a single layer.\r\n * @param value Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve.\r\n */\r\n ESPromise.resolve = function (value) {\r\n if (value instanceof ESPromise) {\r\n // Value is a Promise so just return it\r\n return value;\r\n }\r\n else if (value && _isFunction(value.then)) {\r\n // Value looks like a promise or thenable (has a then function)\r\n return new ESPromise(function (resolve, reject) {\r\n try {\r\n value.then(resolve, reject);\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n }\r\n return new ESPromise(function (resolve) {\r\n resolve(value);\r\n });\r\n };\r\n /**\r\n * The Promise.reject() method returns a Promise object that is rejected with a given reason.\r\n * @param reason The reason why this Promise rejected.\r\n */\r\n ESPromise.reject = function (reason) {\r\n return new ESPromise(function (resolve, reject) {\r\n reject(reason);\r\n });\r\n };\r\n /**\r\n * The Promise.all() method returns a single Promise that resolves when all of the promises passed as an iterable\r\n * have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that\r\n * rejects. There is no implied ordering in the execution of the array of Promises given. On some computers, they\r\n * may be executed in parallel, or in some sense concurrently, while on others they may be executed serially. For\r\n * this reason, there must be no dependency in any Promise on the order of execution of the Promises.\r\n * This method can be useful for aggregating the results of multiple promises.\r\n * FulfillmentSection - The returned promise is fulfilled with an array containing all the values of the iterable\r\n * passed as argument (also non-promise values).\r\n * If an empty iterable is passed, then this method returns (synchronously) an already resolved promise.\r\n * If all of the passed-in promises fulfill, or are not promises, the promise returned by Promise.all is fulfilled\r\n * asynchronously.\r\n * RejectionSection - If any of the passed-in promises reject, Promise.all asynchronously rejects with the value of\r\n * the promise that rejected, whether or not the other promises have resolved.\r\n * @param iterable\r\n */\r\n ESPromise.all = function (iterable) {\r\n if (!iterable || !iterable.length) {\r\n return;\r\n }\r\n return new ESPromise(function (resolve, reject) {\r\n try {\r\n var values_1 = [];\r\n var pending_2 = 0;\r\n for (var lp = 0; lp < iterable.length; lp++) {\r\n var item = iterable[lp];\r\n // Quick and direct check for a Promise (will also catch a thenable)\r\n if (item && _isFunction(item.then)) {\r\n pending_2++;\r\n item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () {\r\n if (--pending_2 === 0) {\r\n resolve(values_1);\r\n }\r\n }), reject);\r\n }\r\n else {\r\n values_1[lp] = item;\r\n }\r\n }\r\n if (pending_2 === 0) {\r\n // All promises were either resolved or where not a promise\r\n setTimeout(function () {\r\n resolve(values_1);\r\n }, 0);\r\n }\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n };\r\n /**\r\n * The race function returns a Promise that is settled the same way (and takes the same value) as the first promise\r\n * that settles amongst the promises of the iterable passed as an argument.\r\n * If the iterable passed is empty, the promise returned will be forever pending.\r\n * If the iterable contains one or more non-promise value and/or an already settled promise, then Promise.race will\r\n * resolve to the first of these values found in the iterable.\r\n * @param iterable\r\n */\r\n ESPromise.race = function (iterable) {\r\n return new ESPromise(function (resolve, reject) {\r\n if (!iterable || !iterable.length) {\r\n return;\r\n }\r\n try {\r\n var _loop_1 = function (lp) {\r\n var item = iterable[lp];\r\n // Quick and direct check for a Promise (will also catch a thenable)\r\n if (item && _isFunction(item.then)) {\r\n item.then(resolve, reject);\r\n }\r\n else {\r\n setTimeout(function () {\r\n resolve(item);\r\n }, 0);\r\n }\r\n };\r\n for (var lp = 0; lp < iterable.length; lp++) {\r\n _loop_1(lp);\r\n }\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n };\r\n// Removed Stub for ESPromise.prototype.then.\r\n// Removed Stub for ESPromise.prototype[\"catch\"].\r\n return ESPromise;\r\n}());\r\nexport default ESPromise;\r\n//# sourceMappingURL=ESPromise.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * ESPromiseScheduler.ts\r\n * @author Nev Wylie (newylie)\r\n * @copyright Microsoft 2019\r\n */\r\nimport ESPromise from \"./ESPromise\";\r\nimport { getGlobal } from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/** This is a default timeout that will cause outstanding running promises to be removed/rejected to avoid filling up memory with blocked events */\r\nvar LazyRejectPeriod = 600000; // 10 Minutes\r\n// These are global variables that are shared across ALL instances of the scheduler\r\n/**\r\n * @ignore\r\n */\r\nvar _schedulerId = 0;\r\n/**\r\n * @ignore\r\n */\r\nvar _running = [];\r\n/**\r\n * @ignore\r\n */\r\nvar _waiting = [];\r\n/**\r\n * @ignore\r\n */\r\nvar _timedOut = [];\r\n/**\r\n * @ignore\r\n */\r\nfunction _getTime() {\r\n return new Date().getTime();\r\n}\r\n/**\r\n * Provides a simple mechanism queueing mechanism for scheduling events based on the ESPromise callbacks, this is used to ensure\r\n * order of async operations that are required to be executed in a specific order.\r\n */\r\nvar ESPromiseScheduler = /** @class */ (function () {\r\n function ESPromiseScheduler(name, diagLog) {\r\n var _promiseId = 0;\r\n var _scheduledName = (name || \"<unnamed>\") + \".\" + _schedulerId;\r\n _schedulerId++;\r\n dynamicProto(ESPromiseScheduler, this, function (_this) {\r\n var _lastEvent = null;\r\n var _eventCount = 0;\r\n _this.scheduleEvent = function (startEventAction, eventName, timeout) {\r\n var uniqueId = _scheduledName + \".\" + _eventCount;\r\n _eventCount++;\r\n if (eventName) {\r\n uniqueId += \"-(\" + eventName + \")\";\r\n }\r\n var uniqueEventId = uniqueId + \"{\" + _promiseId + \"}\";\r\n _promiseId++;\r\n // Create the next scheduled event details\r\n var newScheduledEvent = {\r\n evt: null,\r\n tm: _getTime(),\r\n id: uniqueEventId,\r\n isRunning: false,\r\n isAborted: false\r\n };\r\n if (!_lastEvent) {\r\n // We don't have any currently running event, so just start the next event\r\n newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent);\r\n }\r\n else {\r\n // Start a new promise which will wait until all current active events are complete before starting\r\n // the new event, it does not resolve this scheduled event until after the new event is resolve to\r\n // ensure that all scheduled events are completed in the correct order\r\n newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent);\r\n }\r\n // Set this new event as the last one, so that any future events will wait for this one\r\n _lastEvent = newScheduledEvent;\r\n _lastEvent.evt._schId = uniqueEventId;\r\n return newScheduledEvent.evt;\r\n function _abortAndRemoveOldEvents(eventQueue) {\r\n var now = _getTime();\r\n var expired = now - LazyRejectPeriod;\r\n var len = eventQueue.length;\r\n var lp = 0;\r\n while (lp < len) {\r\n var evt = eventQueue[lp];\r\n if (evt && evt.tm < expired) {\r\n var message = null;\r\n if (evt.abort) {\r\n message = \"Aborting [\" + evt.id + \"] due to Excessive runtime (\" + (now - evt.tm) + \" ms)\";\r\n evt.abort(message);\r\n }\r\n else {\r\n message = \"Removing [\" + evt.id + \"] due to Excessive runtime (\" + (now - evt.tm) + \" ms)\";\r\n }\r\n _warnLog(message);\r\n eventQueue.splice(lp, 1);\r\n len--;\r\n }\r\n else {\r\n lp++;\r\n }\r\n }\r\n }\r\n function _cleanup(eventId, completed) {\r\n var toQueue = false;\r\n var removed = _removeQueuedEvent(_running, eventId);\r\n if (!removed) {\r\n removed = _removeQueuedEvent(_timedOut, eventId);\r\n toQueue = true;\r\n }\r\n if (removed) {\r\n if (removed.to) {\r\n // If there was a timeout stop it\r\n clearTimeout(removed.to);\r\n removed.to = null;\r\n }\r\n // TODO (newylie): Convert this into reportable metrics\r\n var tm = _getTime() - removed.tm;\r\n if (completed) {\r\n if (!toQueue) {\r\n _debugLog(\"Promise [\" + eventId + \"] Complete -- \" + tm + \" ms\");\r\n }\r\n else {\r\n _warnLog(\"Timed out event [\" + eventId + \"] finally complete -- \" + tm + \" ms\");\r\n }\r\n }\r\n else {\r\n _timedOut.push(removed);\r\n _warnLog(\"Event [\" + eventId + \"] Timed out and removed -- \" + tm + \" ms\");\r\n }\r\n }\r\n else {\r\n _debugLog(\"Failed to remove [\" + eventId + \"] from running queue\");\r\n }\r\n // Also if the last scheduled event was this event then clear it as we are now finished\r\n if (_lastEvent && _lastEvent.id === eventId) {\r\n _lastEvent = null;\r\n }\r\n _abortAndRemoveOldEvents(_running);\r\n _abortAndRemoveOldEvents(_waiting);\r\n _abortAndRemoveOldEvents(_timedOut);\r\n }\r\n // Return a callback function that will be called when the waiting promise is resolved or rejected to ensure\r\n // that any outer promise is also resolved or rejected\r\n function _removeScheduledEvent(eventId, callback) {\r\n return function (value) {\r\n _cleanup(eventId, true);\r\n callback && callback(value);\r\n return value;\r\n };\r\n }\r\n function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) {\r\n startResult.then(function (value) {\r\n if (value instanceof ESPromise) {\r\n // If the result is a promise then this appears to be a chained result, so wait for this promise to complete\r\n _debugLog(\"Event [\" + eventId + \"] returned a promise -- waiting\");\r\n _waitForFinalResult(eventId, value, schEventResolve, schEventReject);\r\n return value;\r\n }\r\n else {\r\n return _removeScheduledEvent(eventId, schEventResolve)(value);\r\n }\r\n }, _removeScheduledEvent(eventId, schEventReject));\r\n }\r\n // Add the passed event to the active event list with resolve and reject callbacks that will remove\r\n // it from the active event list\r\n function _createScheduledEvent(eventDetails, startEvent) {\r\n var eventId = eventDetails.id;\r\n return new ESPromise(function (schEventResolve, schEventReject) {\r\n _debugLog(\"Event [\" + eventId + \"] Starting -- waited for \" + (eventDetails.wTm || \"--\") + \" ms\");\r\n eventDetails.isRunning = true;\r\n eventDetails.abort = function (message) {\r\n eventDetails.abort = null;\r\n eventDetails.isAborted = true;\r\n _cleanup(eventId, false);\r\n schEventReject(new Error(message));\r\n };\r\n var startResult = startEvent(eventId);\r\n if (startResult instanceof ESPromise) {\r\n if (timeout) {\r\n // Note: Only starting a timer if a timeout was specified\r\n eventDetails.to = setTimeout(function () {\r\n _cleanup(eventId, false);\r\n // Cause the listeners to reject (Note: We can't actually reject the waiting event)\r\n schEventReject(new Error(\"Timed out after [\" + timeout + \"] ms\"));\r\n }, timeout);\r\n }\r\n _waitForFinalResult(eventId, startResult, function (theResult) {\r\n _debugLog(\"Event [\" + eventId + \"] Resolving after \" + (_getTime() - eventDetails.tm) + \" ms\");\r\n schEventResolve(theResult);\r\n }, schEventReject);\r\n }\r\n else {\r\n // The startEvent didn't return a promise so just return a resolved promise\r\n _debugLog(\"Promise [\" + eventId + \"] Auto completed as the start action did not return a promise\");\r\n schEventResolve();\r\n }\r\n });\r\n }\r\n function _startWaitingEvent(eventDetails) {\r\n var now = _getTime();\r\n eventDetails.wTm = now - eventDetails.tm;\r\n eventDetails.tm = now;\r\n if (eventDetails.isAborted) {\r\n return ESPromise.reject(new Error(\"[\" + uniqueId + \"] was aborted\"));\r\n }\r\n _running.push(eventDetails);\r\n return _createScheduledEvent(eventDetails, startEventAction);\r\n }\r\n // Start a new promise which will wait until all current active events are complete before starting\r\n // the new event, it does not resolve this scheduled event until after the new event is resolve to\r\n // ensure that all scheduled events are completed in the correct order\r\n function _waitForPreviousEvent(eventDetails, waitForEvent) {\r\n var waitEvent = new ESPromise(function (waitResolve, waitReject) {\r\n var runTime = _getTime() - waitForEvent.tm;\r\n var prevId = waitForEvent.id;\r\n _debugLog(\"[\" + uniqueId + \"] is waiting for [\" + prevId + \":\" + runTime + \" ms] to complete before starting -- [\" + _waiting.length + \"] waiting and [\" + _running.length + \"] running\");\r\n eventDetails.abort = function (message) {\r\n eventDetails.abort = null;\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n eventDetails.isAborted = true;\r\n waitReject(new Error(message));\r\n };\r\n // Wait for the previous event to complete\r\n waitForEvent.evt.then(function (value) {\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n // Wait for the last event to complete before starting the new one, this ensures the execution\r\n // order so that we don't try and remove events that havn't been committed yet\r\n _startWaitingEvent(eventDetails).then(waitResolve, waitReject);\r\n }, function (reason) {\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n // Wait for the last event to complete before starting the new one, this ensures the execution\r\n // order so that we don't try and remove events that havn't been committed yet\r\n _startWaitingEvent(eventDetails).then(waitResolve, waitReject);\r\n });\r\n });\r\n _waiting.push(eventDetails);\r\n return waitEvent;\r\n }\r\n };\r\n function _removeQueuedEvent(queue, eventId) {\r\n for (var lp = 0; lp < queue.length; lp++) {\r\n if (queue[lp].id === eventId) {\r\n return queue.splice(lp, 1)[0];\r\n }\r\n }\r\n return null;\r\n }\r\n });\r\n function _debugLog(message) {\r\n // Only log if running within test harness\r\n var global = getGlobal();\r\n if (global && global[\"QUnit\"]) {\r\n // tslint:disable-next-line:no-console\r\n console && console.log(\"ESPromiseScheduler[\" + _scheduledName + \"] \" + message);\r\n }\r\n }\r\n function _warnLog(message) {\r\n diagLog && diagLog.warnToConsole(\"ESPromiseScheduler[\" + _scheduledName + \"] \" + message);\r\n }\r\n }\r\n ESPromiseScheduler.incomplete = function () {\r\n return _running;\r\n };\r\n ESPromiseScheduler.waitingToStart = function () {\r\n return _waiting;\r\n };\r\n// Removed Stub for ESPromiseScheduler.prototype.scheduleEvent.\r\n return ESPromiseScheduler;\r\n}());\r\nexport default ESPromiseScheduler;\r\n//# sourceMappingURL=ESPromiseScheduler.js.map","/*\n * 1DS JS SDK Core, 3.1.9\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { isNullOrUndefined, objForEachKey, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isValueKind, isValueAssigned, getFieldValueType } from \"./Utils\";\r\nvar ValueSanitizer = /** @class */ (function () {\r\n function ValueSanitizer(fieldSanitizerProvider) {\r\n var _self = this;\r\n // To aid with performance this is a lookup map to check if the field value sanitizer supports this field\r\n var _sanitizerMap = {};\r\n var _sanitizers = [];\r\n var _fieldSanitizers = [];\r\n if (fieldSanitizerProvider) {\r\n _fieldSanitizers.push(fieldSanitizerProvider);\r\n }\r\n function _getFieldSanitizer(path, name) {\r\n var result;\r\n var fieldLookup = _sanitizerMap[path];\r\n if (fieldLookup) {\r\n result = fieldLookup[name];\r\n }\r\n if (!result && result !== null) {\r\n // Null is a valid result indicating that the value sanitizer does not support this field\r\n if (isString(path) && isString(name)) {\r\n if (_fieldSanitizers.length > 0) {\r\n for (var lp = 0; lp < _fieldSanitizers.length; lp++) {\r\n if (_fieldSanitizers[lp].handleField(path, name)) {\r\n result = {\r\n canHandle: true,\r\n fieldHandler: _fieldSanitizers[lp]\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n else if (_sanitizers.length === 0) {\r\n // Special use-case where there is no sanitizer to pass on to, so just resolving the field\r\n // and returning the resulting value (same as sanitizeProperty())\r\n result = {\r\n canHandle: true\r\n };\r\n }\r\n }\r\n // We still don't have a handler so lets lookup the providers\r\n if (!result && result !== null) {\r\n // Setting the result to null -- which means we and any contained sanitizers can't handle this field\r\n result = null;\r\n for (var lp = 0; lp < _sanitizers.length; lp++) {\r\n if (_sanitizers[lp].handleField(path, name)) {\r\n result = {\r\n canHandle: true,\r\n handler: _sanitizers[lp],\r\n fieldHandler: null\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n if (!fieldLookup) {\r\n fieldLookup = _sanitizerMap[path] = {};\r\n }\r\n fieldLookup[name] = result;\r\n }\r\n return result;\r\n }\r\n _self.addSanitizer = function (newSanitizer) {\r\n if (newSanitizer) {\r\n _sanitizers.push(newSanitizer);\r\n // Invalidate any previously mapped fields\r\n _sanitizerMap = {};\r\n }\r\n };\r\n _self.addFieldSanitizer = function (fieldSanitizer) {\r\n if (fieldSanitizer) {\r\n _fieldSanitizers.push(fieldSanitizer);\r\n // Invalidate any previously mapped fields\r\n _sanitizerMap = {};\r\n }\r\n };\r\n _self.handleField = function (path, name) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n return mapValue ? mapValue.canHandle : false;\r\n };\r\n _self.value = function (path, name, value, stringifyObjects) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n if (mapValue && mapValue.canHandle) {\r\n if (!mapValue || !mapValue.canHandle) {\r\n return null;\r\n }\r\n if (mapValue.handler) {\r\n // This value sanitizer can't handle this field so pass it only the next one\r\n return mapValue.handler.value(path, name, value, stringifyObjects);\r\n }\r\n // Check that property is valid\r\n if (!isString(name) || isNullOrUndefined(value) || value === \"\") {\r\n return null;\r\n }\r\n var property = null;\r\n var fieldType = getFieldValueType(value);\r\n if ((fieldType & 8192 /* EventProperty */) === 8192 /* EventProperty */) {\r\n var subType = fieldType & ~8192 /* EventProperty */;\r\n property = value;\r\n if (!isValueAssigned(property.value) ||\r\n (subType !== 1 /* String */ &&\r\n subType !== 2 /* Number */ &&\r\n subType !== 3 /* Boolean */ &&\r\n (subType & 4096 /* Array */) !== 4096 /* Array */)) {\r\n // Not a supported IEventProperty type to be able to sanitize\r\n return null;\r\n }\r\n }\r\n else if (fieldType === 1 /* String */ ||\r\n fieldType === 2 /* Number */ ||\r\n fieldType === 3 /* Boolean */ ||\r\n (fieldType & 4096 /* Array */) === 4096 /* Array */) {\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n property = _convertToProperty(path, name, value);\r\n }\r\n else if (fieldType === 4 /* Object */) {\r\n property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value);\r\n }\r\n if (property) {\r\n return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);\r\n }\r\n }\r\n return null;\r\n };\r\n _self.property = function (path, name, property, stringifyObjects) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n if (!mapValue || !mapValue.canHandle) {\r\n return null;\r\n }\r\n // Check that property is valid\r\n if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) {\r\n return null;\r\n }\r\n var fieldType = getFieldValueType(property.value);\r\n if (fieldType === 0 /* NotSet */) {\r\n // Not a supported field that we can sanitize or serialize\r\n return null;\r\n }\r\n return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);\r\n };\r\n function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) {\r\n if (mapValue.handler) {\r\n // This value sanitizer can't handle this field so pass it only the next one\r\n return mapValue.handler.property(path, name, property, stringifyObjects);\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if ((fieldType & 4096 /* Array */) === 4096 /* Array */ || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n // Convert the value to a string and assign back to the original value\r\n property.value = property.value.toString();\r\n }\r\n return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property);\r\n }\r\n function _convertToProperty(path, name, value) {\r\n if (isValueAssigned(value)) {\r\n return { value: value };\r\n }\r\n return null;\r\n }\r\n function _callFieldSanitizer(fieldProvider, path, name, theType, property) {\r\n if (property && fieldProvider) {\r\n var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType);\r\n if (sanitizer) {\r\n // This is where we the field will call the handler to \"scrub\" the value. This the primary hook for the ClientHashing Plugin to\r\n // be able to apply the hashFunc() / Sha256 conversion of the properties value\r\n if (theType === 4 /* Object */) {\r\n // Special case of an embedded object (ext.metadata, data.properties)\r\n var newValue_1 = {};\r\n var propValue = property.value;\r\n objForEachKey(propValue, function (propKey, theValue) {\r\n var newPath = path + \".\" + name;\r\n if (isValueAssigned(theValue)) {\r\n var newProp = _convertToProperty(newPath, propKey, theValue);\r\n newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp);\r\n if (newProp) {\r\n newValue_1[propKey] = newProp.value;\r\n }\r\n }\r\n });\r\n property.value = newValue_1;\r\n }\r\n else {\r\n var details = {\r\n path: path,\r\n name: name,\r\n type: theType,\r\n prop: property,\r\n sanitizer: _self\r\n };\r\n property = sanitizer.call(_self, details);\r\n }\r\n }\r\n }\r\n return property;\r\n }\r\n }\r\n ValueSanitizer.getFieldType = getFieldValueType;\r\n return ValueSanitizer;\r\n}());\r\nexport { ValueSanitizer };\r\n//# sourceMappingURL=ValueSanitizer.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.1\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\"use strict\";\r\nexport var MinChannelPriorty = 100;\r\n//# sourceMappingURL=IChannelControls.js.map"],"names":["strShimFunction","strShimObject","strShimUndefined","strShimPrototype","strShimHasOwnProperty","ObjClass","Object","ObjProto","ObjAssign","ObjCreate","ObjDefineProperty","ObjHasOwnProperty","getGlobal","globalThis","self","window","global","throwTypeError","message","TypeError","objCreateFn","obj","type","tmpFunc","__assignFn","t","s","i","n","arguments","length","p","call","extendStaticsFn","d","b","__proto__","Array","__extendsFn","__","this","constructor","__spreadArrayFn","to","from","il","j","EventsDiscardedReason","Unknown","NonRetryableStatus","InvalidEvent","SizeLimitExceeded","KillSwitch","QueueFull","Constructor","Prototype","strFunction","DynInstFuncTable","DynProxyTag","DynClassName","DynInstChkTag","DynAllowInstChkTag","DynProtoDefaultOptions","UnknownValue","str__Proto","strUseBaseInst","strSetInstFuncs","Obj","_objGetPrototypeOf","_dynamicNames","_hasOwnProperty","prop","hasOwnProperty","_isObjectOrArrayPrototype","target","_isObjectArrayOrFunctionPrototype","Function","_getObjProto","newProto","_forEachProp","func","props","getOwnProps","name_1","push","lp","_isDynamicCandidate","funcName","skipOwn","_throwTypeError","_hasVisited","values","value","_getObjName","unknownValue","name","dynamicProto","theClass","delegateFunc","options","classProto","visited","thisProto","_checkPrototype","className","perfOptions","useBaseInst","undefined","thisTarget","instFuncs","proto","baseInstFuncs","instFuncs_1","_instFuncProxy","funcHost","instFuncTable","theFunc","apply","baseFuncs","baseProto","_getBaseFuncs","setInstanceFunc","dynProtoProxy","protoFunc","currentDynProtoProxy","instFunc","canAddInst","objProto","e","_getInstFunc","setInstFuncs","LoggingSeverity","_InternalMessageId","BrowserDoesNotSupportLocalStorage","BrowserCannotReadLocalStorage","BrowserCannotReadSessionStorage","BrowserCannotWriteLocalStorage","BrowserCannotWriteSessionStorage","BrowserFailedRemovalFromLocalStorage","BrowserFailedRemovalFromSessionStorage","CannotSendEmptyTelemetry","ClientPerformanceMathError","ErrorParsingAISessionCookie","ErrorPVCalc","ExceptionWhileLoggingError","FailedAddingTelemetryToBuffer","FailedMonitorAjaxAbort","FailedMonitorAjaxDur","FailedMonitorAjaxOpen","FailedMonitorAjaxRSC","FailedMonitorAjaxSend","FailedMonitorAjaxGetCorrelationHeader","FailedToAddHandlerForOnBeforeUnload","FailedToSendQueuedTelemetry","FailedToReportDataLoss","FlushFailed","MessageLimitPerPVExceeded","MissingRequiredFieldSpecification","NavigationTimingNotSupported","OnError","SessionRenewalDateIsZero","SenderNotInitialized","StartTrackEventFailed","StopTrackEventFailed","StartTrackFailed","StopTrackFailed","TelemetrySampledAndNotSent","TrackEventFailed","TrackExceptionFailed","TrackMetricFailed","TrackPVFailed","TrackPVFailedCalc","TrackTraceFailed","TransmissionFailed","FailedToSetStorageBuffer","FailedToRestoreStorageBuffer","InvalidBackendResponse","FailedToFixDepricatedValues","InvalidDurationValue","TelemetryEnvelopeInvalid","CreateEnvelopeError","CannotSerializeObject","CannotSerializeObjectNonSerializable","CircularReferenceDetected","ClearAuthContextFailed","ExceptionTruncated","IllegalCharsInName","ItemNotInArray","MaxAjaxPerPVExceeded","MessageTruncated","NameTooLong","SampleRateOutOfRange","SetAuthContextFailed","SetAuthContextFailedAccountName","StringValueTooLong","StartCalledMoreThanOnce","StopCalledWithoutStart","TelemetryInitializerFailed","TrackArgumentsNotSpecified","UrlTooLong","SessionStorageBufferFull","CannotAccessCookie","IdTooLong","FailedMonitorAjaxSetRequestHeader","SendBrowserInfoOnUserInit","PluginException","NotificationException","SnippetScriptLoadFailure","InvalidInstrumentationKey","CannotParseAiBlobValue","InvalidContentBlob","TrackPageActionEventFailed","FailedAddingCustomDefinedRequestContext","InMemoryStorageBufferFull","strAttachEvent","strAddEventHelper","strDetachEvent","strRemoveEventListener","_objDefineProperty","objToString","toString","isTypeof","theType","isUndefined","isNullOrUndefined","isNotNullOrUndefined","isObject","isFunction","attachEvent","eventNameWithoutOn","handlerRef","useCapture","result","detachEvent","objForEachKey","callbackfn","strEndsWith","search","searchLen","valLen","pos","strContains","indexOf","isDate","isArray","isError","isString","isNumber","isBoolean","toISOString","date","pad","num","r","String","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","slice","arrForEach","arr","thisArg","len","idx","arrIndexOf","searchElement","fromIndex","Math","max","abs","arrMap","_this","results","arrReduce","initialValue","strTrim","str","replace","_objKeysHasDontEnumBug","propertyIsEnumerable","_objKeysDontEnums","objKeys","objType","dontEnumsLength","objDefineAccessors","getProp","setProp","descriptor","enumerable","configurable","get","set","dateNow","dt","Date","now","getTime","getExceptionName","object","setValue","field","valChk","srcChk","theValue","getSetValue","defValue","isNotTruthy","isTruthy","throwError","Error","strWindow","strNavigator","strLocation","strPerformance","strJSON","strCrypto","strMsCrypto","strMsie","strTrident","_isTrident","_navUserAgentCheck","_enableMocks","_useXDomainRequest","_beaconsSupported","_hasProperty","property","supported","getGlobalInst","gbl","hasWindow","getWindow","hasDocument","document","getDocument","hasNavigator","navigator","getNavigator","hasHistory","history","getLocation","checkForMock","mockLocation","location","getConsole","console","getPerformance","hasJSON","JSON","getJSON","getCrypto","getMsCrypto","isReactNative","nav","product","isIE","userAgent","toLowerCase","dumpObj","objectTypeDump","propertyValueDump","stack","stringify","isBeaconsSupported","sendBeacon","useXDomainRequest","XDomainRequest","isXhrSupported","isSupported","_sanitizeDiagnosticText","text","_logToConsole","logFunc","theConsole","_InternalLogMessage","dataType","msgId","msg","isUserAct","properties","messageId","strProps","diagnosticText","safeGetLogger","core","config","logger","DiagnosticLogger","identifier","queue","_messageCount","_messageLogged","_self","_getConfigValue","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","enableDebugExceptions","throwInternal","severity","CRITICAL","logLevel","messageKey","logInternalMessage","warnToConsole","errorToConsole","resetInternalMessageCount","logMessage","throttleMessage","throttleLimitMessage","PerfEvent","ParentContextKey","ChildrenContextKey","payloadDetails","isAsync","theDetails_1","accessorDefined","start","isChildEvt","getCtx","key","setCtx","complete","childTime","childEvts","childEvt","time","exTime","payload","PerfManager","manager","ctx","create","src","fire","perfEvent","doPerfActiveKey","doPerf","mgrSource","getSource","details","perfMgr","children","perfEvt","currentActive","ex","TelemetryPluginChain","plugin","defItemCtx","_nextProxy","_hasProcessTelemetry","processTelemetry","_hasSetNext","setNextPlugin","_hasRun","getPlugin","getNext","setNext","nextPlugin","env","itemCtx","error","hasRun","diagLog","item","_createProxyChain","plugins","proxies","lastProxy","thePlugin","newProxy","ProcessTelemetryContext","startAt","add","proxy","_copyProxyChain","getCfg","getExtCfg","defaultValue","theConfig","extConfig","extensionConfig","getConfig","hasNext","processNext","createNew","strExtensionConfig","strGetPlugin","BaseTelemetryPlugin","prototype","initialize","extensions","pluginChain","_baseTelInit","_isinitialized","_rootCtx","_nextPlugin","_getTelCtx","isInitialized","setInitialized","next","currentCtx","rootCtx","getProcessTelContext","priority","initializePlugins","processContext","initPlugins","lastPlugin","sortPlugins","sort","extA","extB","bHasProcess","_super","ChannelController","__extends","_staticInit","getChannelControls","_channelQueue","_addChannelQueue","a","queueItem","_base","queues","channels","extensionQueue_1","strToGMTString","strToUTCString","strCookie","strExpires","strEnabled","strIsCookieUseDisabled","strDisableCookiesUsage","strConfigCookieMgr","strEmpty","_supportsCookies","_allowUaSameSite","_parsedCookieValue","_doc","_cookieCache","_globalCookieConfig","_isMgrEnabled","cookieMgr","isEnabled","safeGetCookieMgr","getCookieMgr","cookieCfg","createCookieMgr","inst","rootConfig","cookieMgrCfg","cookieMgrConfig","cookieDomain","cookiePath","cookieEnabled","_path","path","_domain","domain","_enabled","enabled","areCookiesSupported","gblManager","setEnabled","maxAgeSec","_isIE","substring","_extractParts","expireMs","expiry","setTime","_formatDate","location_1","protocol","uaDisallowsSameSiteNone","setCookie","_setCookieValue","_formatCookieValue","getCookie","theCookie","cookieValue","del","purge","_a","delCookie","WARNING","exception","split","thePart","theDate","strNotificationManager","_createPerfManager","notificationMgr","BaseCore","_eventQueue","_channelController","_notificationManager","_perfManager","_cookieManager","_isInitialized","_extensions","loggingLevelConsole","notificationManager","instrumentationKey","enablePerfMgr","NotificationManager","allExtensions","__spreadArray","coreExtensions","extPriorities","ext","extPriority","getTransmissionControls","releaseQueue","track","telemetryItem","thePlugins","getNotifyMgr","addNotificationListener","listener","removeNotificationListener","eventsSent","events","eventsDiscarded","reason","eventsSendRequest","sendReason","setCookieMgr","getPerfMgr","createPerfMgr","setPerfMgr","eventCnt","event","listeners","perfEvtsSendAll","index","splice","setTimeout","AppInsightsCore","_internalLogPoller","_notifyInvalidEvent","_validateTelemetryItem","pollInternalLogs","eventName","interval","diagnosticLogInterval","stopPollingInternalLogs","setInterval","iKey","baseType","baseData","clearInterval","UInt32Mask","MaxUInt32","_mwcSeeded","_mwcW","_mwcZ","_mwcSeed","seedValue","_autoSeedMwc","random","randomValue","maxValue","floor","random32","signed","c","getRandomValues","Uint32Array","mwcRandom32","strVisibilityChangeEvt","strPageHide","strPageShow","addEventHandler","callback","w","doc","addEventListeners","excludeEvents","excluded_1","added","addPageUnloadEventListener","newGuid","GuidRegex","perfNow","perf","newId","maxLength","number","chars","base64chars","generateW3CId","tmp","hexValues","oct","clockSequenceHi","substr","EventHelper","Attach","AttachEvent","Detach","DetachEvent","ValueKind","NotSet","Pii_DistinguishedName","Pii_GenericData","Pii_IPV4Address","Pii_IPv6Address","Pii_MailSubject","Pii_PhoneNumber","Pii_QueryString","Pii_SipAddress","Pii_SmtpAddress","Pii_Identity","Pii_Uri","Pii_Fqdn","Pii_IPV4AddressLegacy","CustomerContent_GenericContent","EventLatency","Normal","CostDeferred","RealTime","Immediate","EventPropertyType","Unspecified","Int32","UInt32","Int64","UInt64","Double","Bool","Guid","DateTime","_ExtendedInternalMessageId","__assign","AuthHandShakeError","AuthRedirectFail","CannotParseBiBlobValue","CannotParseDataAttribute","CVPluginNotAvailable","DroppedEvent","ErrorProvidedChannels","FailedToGetCookies","FailedToInitializeCorrelationVector","FailedToInitializeSDK","InvalidCorrelationValue","SendPostOnCompleteFailure","PostResponseHandler","SDKNotInitialized","Version","FullVersionString","strWithCredentials","_fieldTypeEventPropMap","uInt8ArraySupported","isDocumentObjectAvailable","isWindowObjectAvailable","isValueAssigned","getTenantId","apiKey","indexTenantId","isUint8ArrayAvailable","Uint8Array","ua","isLatency","sanitizeProperty","stringifyObjects","propType","isArrayValid","kind","isValueKind","getCommonSchemaMetaData","encodedTypeValue","getFieldValueType","disableCookies","days","deleteCookie","getCookieValue","decode","decodeURIComponent","createGuid","style","theGuid","extend","obj2","obj3","obj4","obj5","extended","deep","strPrototype","theArgs","arrayValue","arrayIndex","setProcessTelemetryTimings","evt","timings","processTelemetryStart","Utils","strUndefined","strObject","Undefined","getISOString","cookieAvailable","disallowsSameSiteNone","CoreUtils","_canUseCookies","objCreate","mwcRandomSeed","PropVersion","pluginVersionStringArr","pluginVersionString","endpointUrl","propertyStorageOverride","getProperty","setProperty","channel","version","ver","getWParam","join","logger_1","itemProperties","trackStart","latency","itemExt","sdk","InternalCore","_isFunction","ESPromise","resolverFunc","_state","_settledValue","_queue","_enqueue","onResolved","onRejected","resolve","reject","then","_processQueue","pending_1","_resolve","_reject","all","iterable","values_1","pending_2","_createPromiseAllOnResolvedFunction","race","_loop_1","_schedulerId","_running","_waiting","_timedOut","_getTime","ESPromiseScheduler","_promiseId","_scheduledName","_debugLog","log","_warnLog","_lastEvent","_eventCount","_removeQueuedEvent","eventId","id","scheduleEvent","startEventAction","timeout","uniqueId","eventDetails","waitForEvent","waitEvent","uniqueEventId","newScheduledEvent","tm","isRunning","isAborted","waitResolve","waitReject","runTime","prevId","abort","_startWaitingEvent","_schId","_abortAndRemoveOldEvents","eventQueue","expired","_cleanup","completed","toQueue","removed","clearTimeout","_removeScheduledEvent","_createScheduledEvent","startEvent","schEventResolve","schEventReject","wTm","startResult","_waitForFinalResult","theResult","incomplete","waitingToStart","ValueSanitizer","getFieldType","fieldSanitizerProvider","_sanitizerMap","_sanitizers","_fieldSanitizers","_getFieldSanitizer","fieldLookup","handleField","canHandle","fieldHandler","handler","_handleProperty","mapValue","fieldType","_callFieldSanitizer","fieldProvider","sanitizer","newValue_1","getSanitizer","propertyType","propKey","newProp","_convertToProperty","newPath","addSanitizer","newSanitizer","addFieldSanitizer","fieldSanitizer","subType","Critical","NONE","ERROR","INFORMATION","addPageHideEventListener","pageUnloadAdded","visibilityState","addPageShowEventListener","pageShowAdded","userAgentStr","navigator_1","parseInt","tridentVer","withKeepAlive","request","match","test","method","urlString","withCredentials","disabled","isSync","_wrapSetXhrProp","xhr","XMLHttpRequest","open","theObject","source","chkSet","checkValue","chkLen"],"mappings":";;;;;0CAEWA,EAAkB,WAClBC,EAAgB,SAChBC,EAAmB,YACnBC,EAAmB,YACnBC,EAAwB,iBAExBC,EAAWC,OACXC,EAAWF,EAASF,GACpBK,EAAYH,EAAiB,OAC7BI,EAAYJ,EAAiB,OAC7BK,EAAoBL,EAAyB,eAC7CM,EAAoBJ,EAASH,GCEjC,SAASQ,IACZ,cAAWC,aAAeX,GAAoBW,WACnCA,kBAEAC,OAASZ,GAAoBY,KAC7BA,YAEAC,SAAWb,GAAoBa,OAC/BA,cAEAC,SAAWd,GAAoBc,OAC/BA,OAEJ,KAEJ,SAASC,EAAeC,GAC3B,MAAM,IAAIC,UAAUD,GAQjB,SAASE,EAAYC,GAGxB,GAFWZ,EAIP,OAJOA,EAIKY,GAEhB,GAAW,MAAPA,EACA,MAAO,GAEX,IAAIC,SAAcD,EAIlB,SAASE,KAET,OALID,IAASrB,GAAiBqB,IAAStB,GACnCiB,EAAe,0CAA4CI,GAG/DE,EAAQpB,GAAoBkB,EAC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AAI73B,GAAU43B,GAAU53B,IAAW43B,GAAUpuB,GAASxJ,IAAWwJ,GAASouB,GAmCtE,IAlCA,IAkCSrpB,KAASqpB,GAlCJ,SAAUrpB,GACpB,IACQrN,EAI+BL,EALnC+J,GAAS2D,KAEL9E,GADAvI,EAAQ02B,EAAOrpB,IAEVspB,IAAUA,EAAOtpB,GAAO,EAAMqpB,EAAQ53B,KAEvCA,EAAOuO,IAAoB1N,EAMxB0N,EALQ,WAGH,OAAOqpB,EAAO/2B,GAAU8B,MAAMi1B,EADNz6B,cAM9B06B,IAAUA,EAAOtpB,GAAO,EAAOqpB,EAAQ53B,KACzCF,GAAeE,EAAQuO,WAEhBvO,EAAOuO,GAEbhB,GAAmBvN,EAAQuO,EAAO,WACnC,OAAOqpB,EAAOrpB,IACf,SAAUG,GACTkpB,EAAOrpB,GAASG,MAKhB1O,EAAOuO,GAASrN,KAO5B0vB,CAAQriB,GAGhB,OAAOvO,oIC1gBJ,SAA2B2e,GAC9B/O,GAAe+O,qIK3DE,sDN2Jd,SAAuBzd,EAAO42B,GAEjC,IAAIhuB,GAAS,EACb,GAAI5I,GAAS42B,EAAY,CACrB,IAAIC,EAASD,EAAW16B,OACxB,GAAI8D,IAAU42B,EACV,OAAO,EAEN,GAAI52B,EAAM9D,QAAU26B,EAAQ,CAC7B,IAAK,IAAIp3B,EAAK,EAAGA,EAAKo3B,EAAQp3B,IAC1B,GAAIO,EAAMP,KAAQm3B,EAAWn3B,GACzB,OAAO,EAGfmJ,GAAS,GAGjB,OAAOA"}
|
|
1
|
+
{"version":3,"file":"ms.core.min.js","sources":["../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/Constants.js","../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/Helpers.js","../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-esm/TsLibShims.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js","../../../common/temp/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/HelperFuncs.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DbgExtensionUtils.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/PerfManager.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/Constants.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/RandomHelper.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","../dist-esm/src/Enums.js","../dist-esm/src/Utils.js","../dist-esm/src/AppInsightsCore.js","../dist-esm/src/BaseCore.js","../dist-esm/src/ESPromise.js","../dist-esm/src/ESPromiseScheduler.js","../dist-esm/src/ValueSanitizer.js","../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var strShimFunction = \"function\";\r\nexport var strShimObject = \"object\";\r\nexport var strShimUndefined = \"undefined\";\r\nexport var strShimPrototype = \"prototype\";\r\nexport var strShimHasOwnProperty = \"hasOwnProperty\";\r\nexport var strDefault = \"default\";\r\nexport var ObjClass = Object;\r\nexport var ObjProto = ObjClass[strShimPrototype];\r\nexport var ObjAssign = ObjClass[\"assign\"];\r\nexport var ObjCreate = ObjClass[\"create\"];\r\nexport var ObjDefineProperty = ObjClass[\"defineProperty\"];\r\nexport var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ObjCreate, strShimFunction, strShimObject, strShimPrototype, strShimUndefined } from \"./Constants\";\r\nvar _cachedGlobal = null;\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - <null> (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport function getGlobal(useCached) {\r\n if (useCached === void 0) { useCached = true; }\r\n if (!_cachedGlobal || !useCached) {\r\n if (typeof globalThis !== strShimUndefined && globalThis) {\r\n _cachedGlobal = globalThis;\r\n }\r\n if (typeof self !== strShimUndefined && self) {\r\n _cachedGlobal = self;\r\n }\r\n if (typeof window !== strShimUndefined && window) {\r\n _cachedGlobal = window;\r\n }\r\n if (typeof global !== strShimUndefined && global) {\r\n _cachedGlobal = global;\r\n }\r\n }\r\n return _cachedGlobal;\r\n}\r\nexport function throwTypeError(message) {\r\n throw new TypeError(message);\r\n}\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport function objCreateFn(obj) {\r\n var func = ObjCreate;\r\n // Use build in Object.create\r\n if (func) {\r\n // Use Object create method if it exists\r\n return func(obj);\r\n }\r\n if (obj == null) {\r\n return {};\r\n }\r\n var type = typeof obj;\r\n if (type !== strShimObject && type !== strShimFunction) {\r\n throwTypeError(\"Object prototype may only be an Object:\" + obj);\r\n }\r\n function tmpFunc() { }\r\n tmpFunc[strShimPrototype] = obj;\r\n return new tmpFunc();\r\n}\r\n//# sourceMappingURL=Helpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, strDefault, strShimFunction, strShimHasOwnProperty, strShimPrototype } from \"./Constants\";\r\nimport { getGlobal, objCreateFn, throwTypeError } from \"./Helpers\";\r\n// Most of these functions have been directly shamelessly \"lifted\" from the https://github.com/@microsoft/tslib and\r\n// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights\r\n// can successfully use TypeScript \"importHelpers\" which imports tslib during compilation but it will use these at runtime\r\n// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require\r\n// them.\r\nexport var SymbolObj = (getGlobal() || {})[\"Symbol\"];\r\nexport var ReflectObj = (getGlobal() || {})[\"Reflect\"];\r\nexport var __hasSymbol = !!SymbolObj;\r\nexport var __hasReflect = !!ReflectObj;\r\nvar strDecorate = \"decorate\";\r\nvar strMetadata = \"metadata\";\r\nvar strGetOwnPropertySymbols = \"getOwnPropertySymbols\";\r\nvar strIterator = \"iterator\";\r\nexport var __objAssignFnImpl = function (t) {\r\n // tslint:disable-next-line: ban-comma-operator\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) {\r\n if (ObjProto[strShimHasOwnProperty].call(s, p)) {\r\n t[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n};\r\nexport var __assignFn = ObjAssign || __objAssignFnImpl;\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar extendStaticsFn = function (d, b) {\r\n extendStaticsFn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n for (var p in b) {\r\n if (b[strShimHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return extendStaticsFn(d, b);\r\n};\r\nexport function __extendsFn(d, b) {\r\n if (typeof b !== strShimFunction && b !== null) {\r\n throwTypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n }\r\n extendStaticsFn(d, b);\r\n function __() { this.constructor = d; }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());\r\n}\r\nexport function __restFn(s, e) {\r\n var t = {};\r\n for (var k in s) {\r\n if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) {\r\n t[k] = s[k];\r\n }\r\n }\r\n if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) {\r\n for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && ObjProto[\"propertyIsEnumerable\"].call(s, p[i])) {\r\n t[p[i]] = s[p[i]];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\nexport function __decorateFn(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass[\"getOwnPropertyDescriptor\"](target, key) : desc, d;\r\n if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) {\r\n r = ReflectObj[strDecorate](decorators, target, key, desc);\r\n }\r\n else {\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n // eslint-disable-next-line no-cond-assign\r\n if (d = decorators[i]) {\r\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n }\r\n }\r\n }\r\n // tslint:disable-next-line:ban-comma-operator\r\n return c > 3 && r && ObjDefineProperty(target, key, r), r;\r\n}\r\nexport function __paramFn(paramIndex, decorator) {\r\n return function (target, key) {\r\n decorator(target, key, paramIndex);\r\n };\r\n}\r\nexport function __metadataFn(metadataKey, metadataValue) {\r\n if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) {\r\n return ReflectObj[strMetadata](metadataKey, metadataValue);\r\n }\r\n}\r\nexport function __exportStarFn(m, o) {\r\n for (var p in m) {\r\n if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) {\r\n __createBindingFn(o, m, p);\r\n }\r\n }\r\n}\r\nexport function __createBindingFn(o, m, k, k2) {\r\n if (k2 === undefined) {\r\n k2 = k;\r\n }\r\n if (ObjCreate) {\r\n ObjDefineProperty(o, k2, {\r\n enumerable: true,\r\n get: function () {\r\n return m[k];\r\n }\r\n });\r\n }\r\n else {\r\n o[k2] = m[k];\r\n }\r\n}\r\nexport function __valuesFn(o) {\r\n var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0;\r\n if (m) {\r\n return m.call(o);\r\n }\r\n if (o && typeof o.length === \"number\") {\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) {\r\n o = void 0;\r\n }\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n throwTypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\nexport function __readFn(o, n) {\r\n var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]];\r\n if (!m) {\r\n return o;\r\n }\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\r\n ar.push(r.value);\r\n }\r\n }\r\n catch (error) {\r\n e = {\r\n error: error\r\n };\r\n }\r\n finally {\r\n try {\r\n // tslint:disable-next-line:no-conditional-assignment\r\n if (r && !r.done && (m = i[\"return\"])) {\r\n m.call(i);\r\n }\r\n }\r\n finally {\r\n if (e) {\r\n // eslint-disable-next-line no-unsafe-finally\r\n throw e.error;\r\n }\r\n }\r\n }\r\n return ar;\r\n}\r\n/** @deprecated */\r\nexport function __spreadArraysFn() {\r\n var theArgs = arguments;\r\n // Calculate new total size\r\n for (var s = 0, i = 0, il = theArgs.length; i < il; i++) {\r\n s += theArgs[i].length;\r\n }\r\n // Create new full array\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\r\n for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) {\r\n r[k] = a[j];\r\n }\r\n }\r\n return r;\r\n}\r\nexport function __spreadArrayFn(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\r\n to[j] = from[i];\r\n }\r\n return to;\r\n}\r\nexport function __makeTemplateObjectFn(cooked, raw) {\r\n if (ObjDefineProperty) {\r\n ObjDefineProperty(cooked, \"raw\", { value: raw });\r\n }\r\n else {\r\n cooked.raw = raw;\r\n }\r\n return cooked;\r\n}\r\nexport function __importStarFn(mod) {\r\n if (mod && mod.__esModule) {\r\n return mod;\r\n }\r\n var result = {};\r\n if (mod != null) {\r\n for (var k in mod) {\r\n if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) {\r\n __createBindingFn(result, mod, k);\r\n }\r\n }\r\n }\r\n // Set default module\r\n if (ObjCreate) {\r\n ObjDefineProperty(result, strDefault, { enumerable: true, value: mod });\r\n }\r\n else {\r\n result[strDefault] = mod;\r\n }\r\n return result;\r\n}\r\nexport function __importDefaultFn(mod) {\r\n return (mod && mod.__esModule) ? mod : { strDefault: mod };\r\n}\r\n//# sourceMappingURL=TsLibShims.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n/**\r\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\r\n */\r\nexport var EventsDiscardedReason = {\r\n /**\r\n * Unknown.\r\n */\r\n Unknown: 0,\r\n /**\r\n * Status set to non-retryable.\r\n */\r\n NonRetryableStatus: 1,\r\n /**\r\n * The event is invalid.\r\n */\r\n InvalidEvent: 2,\r\n /**\r\n * The size of the event is too large.\r\n */\r\n SizeLimitExceeded: 3,\r\n /**\r\n * The server is not accepting events from this instrumentation key.\r\n */\r\n KillSwitch: 4,\r\n /**\r\n * The event queue is full.\r\n */\r\n QueueFull: 5\r\n};\r\n//# sourceMappingURL=EventsDiscardedReason.js.map","/*!\n * Microsoft Dynamic Proto Utility, 1.1.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\r\n * @ignore\r\n */\r\nvar DynInstChkTag = '_dynInstChk';\r\n/**\r\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same\r\n * tag name as the function level but a different const name for readability only.\r\n */\r\nvar DynAllowInstChkTag = DynInstChkTag;\r\n/**\r\n * The global (imported) instances where the global performance options are stored\r\n */\r\nvar DynProtoDefaultOptions = '_dfOpts';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strUseBaseInst = 'useBaseInst';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strSetInstFuncs = 'setInstFuncs';\r\nvar Obj = Object;\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\r\n * are not enumerable.\r\n * @param target\r\n */\r\nfunction _forEachProp(target, func) {\r\n var props = [];\r\n var getOwnProps = Obj[\"getOwnPropertyNames\"];\r\n if (getOwnProps) {\r\n props = getOwnProps(target);\r\n }\r\n else {\r\n for (var name_1 in target) {\r\n if (typeof name_1 === \"string\" && _hasOwnProperty(target, name_1)) {\r\n props.push(name_1);\r\n }\r\n }\r\n }\r\n if (props && props.length > 0) {\r\n for (var lp = 0; lp < props.length; lp++) {\r\n func(props[lp]);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototype or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n _forEachProp(thisTarget, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for passing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n });\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {\r\n function _instFuncProxy(target, funcHost, funcName) {\r\n var theFunc = funcHost[funcName];\r\n if (theFunc[DynProxyTag] && useBaseInst) {\r\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\r\n }\r\n }\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n _forEachProp(instFuncs, function (name) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\r\n });\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n _forEachProp(baseProto, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\r\n }\r\n });\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\nfunction _getInstFunc(target, funcName, proto, currentDynProtoProxy) {\r\n var instFunc = null;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (target && _hasOwnProperty(proto, DynClassName)) {\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];\r\n if (!instFunc) {\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n // We have the instance function, lets check it we can speed up further calls\r\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\r\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\r\n // If the instance already has an instance function we can't replace it\r\n var canAddInst = !_hasOwnProperty(target, funcName);\r\n // Get current prototype\r\n var objProto = _getObjProto(target);\r\n var visited = [];\r\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\r\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\r\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\r\n var protoFunc = objProto[funcName];\r\n if (protoFunc) {\r\n canAddInst = (protoFunc === currentDynProtoProxy);\r\n break;\r\n }\r\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\r\n visited.push(objProto);\r\n objProto = _getObjProto(objProto);\r\n }\r\n try {\r\n if (canAddInst) {\r\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\r\n // so it's safe to directly assign for any subsequent calls (for better performance)\r\n target[funcName] = instFunc;\r\n }\r\n // Block further attempts to set the instance function for any\r\n instFunc[DynInstChkTag] = 1;\r\n }\r\n catch (e) {\r\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\r\n // And set a flag so we don't try again for any function\r\n instFuncTable[DynAllowInstChkTag] = false;\r\n }\r\n }\r\n }\r\n return instFunc;\r\n}\r\nfunction _getProtoFunc(funcName, proto, currentDynProtoProxy) {\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === currentDynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (typeof protoFunc !== strFunction) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto - The class prototype\r\n * @param className - The instance classname\r\n * @param target - The target instance\r\n * @param baseInstFuncs - The base instance functions\r\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n // Use the instance or prototype function\r\n var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\r\n return instFunc.apply(this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\r\n }\r\n _forEachProp(target, function (name) {\r\n // Only add overridden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs_1[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\r\n var visited = [];\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(thisProto);\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass - This is the current class instance which contains the prototype for the current class\r\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\r\n * @param options - Additional options to configure how the dynamic prototype operates\r\n */\r\nfunction dynamicProto(theClass, target, delegateFunc, options) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n var perfOptions = dynamicProto[DynProtoDefaultOptions];\r\n var useBaseInst = !!perfOptions[strUseBaseInst];\r\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\r\n useBaseInst = !!options[strUseBaseInst];\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overridden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Don't allow setting instance functions for older IE instances\r\n var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];\r\n if (setInstanceFunc && options) {\r\n setInstanceFunc = !!options[strSetInstFuncs];\r\n }\r\n // Populate the Prototype for any overridden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\r\n}\r\n/**\r\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\r\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\r\n * their internal usage of dynamic proto.\r\n */\r\nvar perfDefaults = {\r\n setInstFuncs: true,\r\n useBaseInst: true\r\n};\r\n// And expose for testing\r\ndynamicProto[DynProtoDefaultOptions] = perfDefaults;\n\nexport default dynamicProto;\n//# sourceMappingURL=dynamicproto-js.js.map\n","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73,\r\n NotificationException: 74,\r\n SnippetScriptLoadFailure: 99,\r\n InvalidInstrumentationKey: 100,\r\n CannotParseAiBlobValue: 101,\r\n InvalidContentBlob: 102,\r\n TrackPageActionEventFailed: 103,\r\n FailedAddingCustomDefinedRequestContext: 104,\r\n InMemoryStorageBufferFull: 105\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strShimUndefined, strShimObject, strShimFunction, throwTypeError, ObjClass, ObjProto, ObjAssign, ObjHasOwnProperty, ObjDefineProperty } from \"@microsoft/applicationinsights-shims\";\r\n// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly\r\n// Added to help with minfication\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nvar strToISOString = \"toISOString\";\r\nvar _objDefineProperty = ObjDefineProperty;\r\nvar _objFreeze = ObjClass[\"freeze\"];\r\nvar _objSeal = ObjClass[\"seal\"];\r\nexport function objToString(obj) {\r\n return ObjProto.toString.call(obj);\r\n}\r\nexport function isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\nexport function isUndefined(value) {\r\n return value === undefined || typeof value === strShimUndefined;\r\n}\r\nexport function isNotUndefined(value) {\r\n return !isUndefined(value);\r\n}\r\nexport function isNullOrUndefined(value) {\r\n return (value === null || isUndefined(value));\r\n}\r\nexport function isNotNullOrUndefined(value) {\r\n return !isNullOrUndefined(value);\r\n}\r\nexport function hasOwnProperty(obj, prop) {\r\n return obj && ObjHasOwnProperty.call(obj, prop);\r\n}\r\nexport function isObject(value) {\r\n // Changing to inline for performance\r\n return typeof value === strShimObject;\r\n}\r\nexport function isFunction(value) {\r\n // Changing to inline for performance\r\n return typeof value === strShimFunction;\r\n}\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @param useCapture [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nexport function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!isNullOrUndefined(obj)) {\r\n try {\r\n if (!isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9\r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nexport function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!isNullOrUndefined(obj)) {\r\n try {\r\n if (!isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\n/**\r\n * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a\r\n * performance optimization to avoid the creation of a new array for large objects\r\n * @param target The target object to find and process the keys\r\n * @param callbackfn The function to call with the details\r\n */\r\nexport function objForEachKey(target, callbackfn) {\r\n if (target) {\r\n for (var prop in target) {\r\n if (ObjHasOwnProperty.call(target, prop)) {\r\n callbackfn.call(target, prop, target[prop]);\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param search - The characters to be searched for at the end of the value.\r\n * @returns true if the given search value is found at the end of the string, otherwise false.\r\n */\r\nexport function strEndsWith(value, search) {\r\n if (value && search) {\r\n var searchLen = search.length;\r\n var valLen = value.length;\r\n if (value === search) {\r\n return true;\r\n }\r\n else if (valLen >= searchLen) {\r\n var pos = valLen - 1;\r\n for (var lp = searchLen - 1; lp >= 0; lp--) {\r\n if (value[pos] != search[lp]) {\r\n return false;\r\n }\r\n pos--;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * The strStartsWith() method determines whether a string starts with the characters of the specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param checkValue - The characters to be searched for at the start of the value.\r\n * @returns true if the given search value is found at the start of the string, otherwise false.\r\n */\r\nexport function strStartsWith(value, checkValue) {\r\n // Using helper for performance and because string startsWith() is not available on IE\r\n var result = false;\r\n if (value && checkValue) {\r\n var chkLen = checkValue.length;\r\n if (value === checkValue) {\r\n return true;\r\n }\r\n else if (value.length >= chkLen) {\r\n for (var lp = 0; lp < chkLen; lp++) {\r\n if (value[lp] !== checkValue[lp]) {\r\n return false;\r\n }\r\n }\r\n result = true;\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * A simple wrapper (for minification support) to check if the value contains the search string.\r\n * @param value - The string value to check for the existence of the search value\r\n * @param search - The value search within the value\r\n */\r\nexport function strContains(value, search) {\r\n if (value && search) {\r\n return value.indexOf(search) !== -1;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Check if an object is of type Date\r\n */\r\nexport function isDate(obj) {\r\n return objToString(obj) === \"[object Date]\";\r\n}\r\n/**\r\n * Check if an object is of type Array\r\n */\r\nexport function isArray(obj) {\r\n return objToString(obj) === \"[object Array]\";\r\n}\r\n/**\r\n * Check if an object is of type Error\r\n */\r\nexport function isError(obj) {\r\n return objToString(obj) === \"[object Error]\";\r\n}\r\n/**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\nexport function isString(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"string\";\r\n}\r\n/**\r\n * Checks if the type of value is a number.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\nexport function isNumber(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"number\";\r\n}\r\n/**\r\n * Checks if the type of value is a boolean.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\nexport function isBoolean(value) {\r\n // Changing to inline for performance\r\n return typeof value === \"boolean\";\r\n}\r\n/**\r\n * Checks if the type of value is a Symbol.\r\n * This only returns a boolean as returning value is Symbol will cause issues for older TypeScript consumers\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Symbol, false otherwise.\r\n */\r\nexport function isSymbol(value) {\r\n return typeof value === \"symbol\";\r\n}\r\n/**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\nexport function toISOString(date) {\r\n if (date) {\r\n if (date[strToISOString]) {\r\n // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification\r\n return date[strToISOString]();\r\n }\r\n if (isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n }\r\n}\r\n/**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\nexport function arrForEach(arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n try {\r\n for (var idx = 0; idx < len; idx++) {\r\n if (idx in arr) {\r\n if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n}\r\n/**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\nexport function arrIndexOf(arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n try {\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\nexport function arrMap(arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n try {\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return results;\r\n}\r\n/**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\nexport function arrReduce(arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n}\r\n/**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\nexport function strTrim(str) {\r\n if (typeof str !== \"string\") {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n}\r\nvar _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable(\"toString\");\r\nvar _objKeysDontEnums = [\r\n \"toString\",\r\n \"toLocaleString\",\r\n \"valueOf\",\r\n \"hasOwnProperty\",\r\n \"isPrototypeOf\",\r\n \"propertyIsEnumerable\",\r\n \"constructor\"\r\n];\r\n/**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\nexport function objKeys(obj) {\r\n var objType = typeof obj;\r\n if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {\r\n throwTypeError(\"objKeys called on non-object\");\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (obj && ObjHasOwnProperty.call(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (_objKeysHasDontEnumBug) {\r\n var dontEnumsLength = _objKeysDontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) {\r\n result.push(_objKeysDontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @param target The object on which to define the property.\r\n * @param prop The name of the property to be defined or modified.\r\n * @param getProp The getter function to wire against the getter.\r\n * @param setProp The setter function to wire against the setter.\r\n * @returns True if it was able to create the accessors otherwise false\r\n */\r\nexport function objDefineAccessors(target, prop, getProp, setProp) {\r\n if (_objDefineProperty) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n _objDefineProperty(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n}\r\nexport function objFreeze(value) {\r\n if (_objFreeze) {\r\n value = _objFreeze(value);\r\n }\r\n return value;\r\n}\r\nexport function objSeal(value) {\r\n if (_objSeal) {\r\n value = _objSeal(value);\r\n }\r\n return value;\r\n}\r\n/**\r\n * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)\r\n * https://caniuse.com/#search=Date.now\r\n */\r\nexport function dateNow() {\r\n var dt = Date;\r\n if (dt.now) {\r\n return dt.now();\r\n }\r\n return new dt().getTime();\r\n}\r\n/**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\nexport function getExceptionName(object) {\r\n if (isError(object)) {\r\n return object.name;\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk\r\n * function will only be called if the new value is no equal to the original value.\r\n * @param target - The target object\r\n * @param field - The key of the target\r\n * @param value - The value to set\r\n * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set\r\n * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)\r\n * @returns The existing or new value, depending what was set\r\n */\r\nexport function setValue(target, field, value, valChk, srcChk) {\r\n var theValue = value;\r\n if (target) {\r\n theValue = target[field];\r\n if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {\r\n theValue = value;\r\n target[field] = theValue;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it\r\n * @param target - The target object to return or set the default value\r\n * @param field - The key for the field to set on the target\r\n * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added\r\n */\r\nexport function getSetValue(target, field, defValue) {\r\n var theValue;\r\n if (target) {\r\n theValue = target[field];\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n // Supports having the default as null\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n target[field] = theValue;\r\n }\r\n }\r\n else {\r\n // Expanded for performance so we only check defValue if required\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n }\r\n return theValue;\r\n}\r\nexport function isNotTruthy(value) {\r\n return !value;\r\n}\r\nexport function isTruthy(value) {\r\n return !!value;\r\n}\r\nexport function throwError(message) {\r\n throw new Error(message);\r\n}\r\n/**\r\n * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from\r\n * the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential\r\n * implementation issues by assigning prototype functions as instance ones\r\n *\r\n * This method is the primary method used to \"update\" the snippet proxy with the ultimate implementations.\r\n *\r\n * Special ES3 Notes:\r\n * Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the\r\n * properties of \"referenced\" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the\r\n * same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param chkSet - An optional callback to determine whether a specific property/function should be proxied\r\n * @memberof Initialization\r\n */\r\nexport function proxyAssign(target, source, chkSet) {\r\n if (target && source && target !== source && isObject(target) && isObject(source)) {\r\n var _loop_1 = function (field) {\r\n if (isString(field)) {\r\n var value = source[field];\r\n if (isFunction(value)) {\r\n if (!chkSet || chkSet(field, true, source, target)) {\r\n // Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function\r\n target[field] = (function (funcName) {\r\n return function () {\r\n // Capture the original arguments passed to the method\r\n var originalArguments = arguments;\r\n return source[funcName].apply(source, originalArguments);\r\n };\r\n })(field);\r\n }\r\n }\r\n else if (!chkSet || chkSet(field, false, source, target)) {\r\n if (hasOwnProperty(target, field)) {\r\n // Remove any previous instance property\r\n delete target[field];\r\n }\r\n if (!objDefineAccessors(target, field, function () {\r\n return source[field];\r\n }, function (theValue) {\r\n source[field] = theValue;\r\n })) {\r\n // Unable to create an accessor, so just assign the values as a fallback\r\n // -- this will (mostly) work for objects\r\n // -- but will fail for accessing primitives (if the source changes it) and all types of \"setters\" as the source won't be modified\r\n target[field] = value;\r\n }\r\n }\r\n }\r\n };\r\n // effectively apply/proxy full source to the target instance\r\n for (var field in source) {\r\n _loop_1(field);\r\n }\r\n }\r\n return target;\r\n}\r\n/**\r\n * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults.\r\n * Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance\r\n * @param defaults Simple helper\r\n */\r\nexport function createClassFromInterface(defaults) {\r\n return /** @class */ (function () {\r\n function class_1() {\r\n var _this_1 = this;\r\n if (defaults) {\r\n objForEachKey(defaults, function (field, value) {\r\n _this_1[field] = value;\r\n });\r\n }\r\n }\r\n return class_1;\r\n }());\r\n}\r\n/**\r\n * A helper function to assist with JIT performance for objects that have properties added / removed dynamically\r\n * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this\r\n * function after you have finished \"updating\" the object, calling this within loops reduces or defeats the benefits.\r\n * This helps when iterating using for..in, objKeys() and objForEach()\r\n * @param theObject - The object to be optimized if possible\r\n */\r\nexport function optimizeObject(theObject) {\r\n // V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties\r\n // primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent\r\n if (theObject) {\r\n theObject = ObjClass(ObjAssign ? ObjAssign({}, theObject) : theObject);\r\n }\r\n return theObject;\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { getGlobal, strShimUndefined, strShimObject, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { isString, isUndefined, strContains } from \"./HelperFuncs\";\r\n/**\r\n * This file exists to hold environment utilities that are required to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only use defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strDocumentMode = \"documentMode\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strMsCrypto = \"msCrypto\";\r\nvar strReactNative = \"ReactNative\";\r\nvar strMsie = \"msie\";\r\nvar strTrident = \"trident/\";\r\nvar _isTrident = null;\r\nvar _navUserAgentCheck = null;\r\nvar _enableMocks = false;\r\nvar _useXDomainRequest = null;\r\nvar _beaconsSupported = null;\r\nfunction _hasProperty(theClass, property) {\r\n var supported = false;\r\n if (theClass) {\r\n try {\r\n supported = property in theClass;\r\n if (!supported) {\r\n var proto = theClass[strShimPrototype];\r\n if (proto) {\r\n supported = property in proto;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n if (!supported) {\r\n try {\r\n var tmp = new theClass();\r\n supported = !isUndefined(tmp[property]);\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n }\r\n }\r\n return supported;\r\n}\r\n/**\r\n * Enable the lookup of test mock objects if requested\r\n * @param enabled\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\r\n}\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where <global>.window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strShimObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strShimObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strShimObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strShimObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation(checkForMock) {\r\n if (checkForMock && _enableMocks) {\r\n var mockLocation = getGlobalInst(\"__mockLocation\");\r\n if (mockLocation) {\r\n return mockLocation;\r\n }\r\n }\r\n if (typeof location === strShimObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strShimUndefined) {\r\n return console;\r\n }\r\n return getGlobalInst(strConsole);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getGlobalInst(strCrypto);\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getMsCrypto() {\r\n return getGlobalInst(strMsCrypto);\r\n}\r\n/**\r\n * Returns whether the environment is reporting that we are running in a React Native Environment\r\n */\r\nexport function isReactNative() {\r\n // If running in React Native, navigator.product will be populated\r\n var nav = getNavigator();\r\n if (nav && nav.product) {\r\n return nav.product === strReactNative;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Identifies whether the current environment appears to be IE\r\n */\r\nexport function isIE() {\r\n var nav = getNavigator();\r\n if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav.userAgent;\r\n var userAgent = (_navUserAgentCheck || \"\").toLowerCase();\r\n _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));\r\n }\r\n return _isTrident;\r\n}\r\n/**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\nexport function getIEVersion(userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n if (!userAgentStr) {\r\n var navigator_1 = getNavigator() || {};\r\n userAgentStr = navigator_1 ? (navigator_1.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n // Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.\r\n if (strContains(ua, strMsie)) {\r\n var doc = getDocument() || {};\r\n return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua.split(strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\nexport function dumpObj(object) {\r\n var objectTypeDump = Object[strShimPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n}\r\nexport function isSafari(userAgentStr) {\r\n if (!userAgentStr || !isString(userAgentStr)) {\r\n var navigator_2 = getNavigator() || {};\r\n userAgentStr = navigator_2 ? (navigator_2.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n return (ua.indexOf(\"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported() {\r\n if (_beaconsSupported === null) {\r\n _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);\r\n }\r\n return _beaconsSupported;\r\n}\r\n/**\r\n * Checks if the Fetch API is supported in the current environment.\r\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isFetchSupported(withKeepAlive) {\r\n var isSupported = false;\r\n try {\r\n var fetchApi = getGlobalInst(\"fetch\");\r\n isSupported = !!fetchApi;\r\n var request = getGlobalInst(\"Request\");\r\n if (isSupported && withKeepAlive && request) {\r\n isSupported = _hasProperty(request, \"keepalive\");\r\n }\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nexport function useXDomainRequest() {\r\n if (_useXDomainRequest === null) {\r\n _useXDomainRequest = (typeof XDomainRequest !== \"undefined\");\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(\"XMLHttpRequest\"), \"withCredentials\");\r\n }\r\n }\r\n return _useXDomainRequest;\r\n}\r\n/**\r\n * Checks if XMLHttpRequest is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isXhrSupported() {\r\n var isSupported = false;\r\n try {\r\n var xmlHttpRequest = getGlobalInst(\"XMLHttpRequest\");\r\n isSupported = !!xmlHttpRequest;\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getGlobalInst } from \"./EnvUtils\";\r\nvar listenerFuncs = [\"eventsSent\", \"eventsDiscarded\", \"eventsSendRequest\", \"perfEvent\"];\r\nvar _aiNamespace = null;\r\nvar _debugListener;\r\nfunction _listenerProxyFunc(name, config) {\r\n return function () {\r\n var args = arguments;\r\n var dbgExt = getDebugExt(config);\r\n if (dbgExt) {\r\n var listener = dbgExt.listener;\r\n if (listener && listener[name]) {\r\n listener[name].apply(listener, args);\r\n }\r\n }\r\n };\r\n}\r\nfunction _getExtensionNamespace() {\r\n // Cache the lookup of the global namespace object\r\n var target = getGlobalInst(\"Microsoft\");\r\n if (target) {\r\n _aiNamespace = target[\"ApplicationInsights\"];\r\n }\r\n return _aiNamespace;\r\n}\r\nexport function getDebugExt(config) {\r\n var ns = _aiNamespace;\r\n if (!ns && config.disableDbgExt !== true) {\r\n ns = _aiNamespace || _getExtensionNamespace();\r\n }\r\n return ns ? ns[\"ChromeDbgExt\"] : null;\r\n}\r\nexport function getDebugListener(config) {\r\n if (!_debugListener) {\r\n _debugListener = {};\r\n for (var lp = 0; lp < listenerFuncs.length; lp++) {\r\n _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);\r\n }\r\n }\r\n return _debugListener;\r\n}\r\n//# sourceMappingURL=DbgExtensionUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { hasJSON, getJSON, getConsole } from \"./EnvUtils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isFunction, isNullOrUndefined, isUndefined } from \"./HelperFuncs\";\r\nimport { getDebugExt } from \"./DbgExtensionUtils\";\r\n/**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\nvar AiNonUserActionablePrefix = \"AI (Internal): \";\r\n/**\r\n * Prefix of the traces in portal.\r\n */\r\nvar AiUserActionablePrefix = \"AI: \";\r\n/**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\nvar AIInternalMessagePrefix = \"AITR_\";\r\nvar strErrorToConsole = \"errorToConsole\";\r\nvar strWarnToConsole = \"warnToConsole\";\r\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n}\r\nfunction _logToConsole(func, message) {\r\n var theConsole = getConsole();\r\n if (!!theConsole) {\r\n var logFunc = \"log\";\r\n if (theConsole[func]) {\r\n logFunc = func;\r\n }\r\n if (isFunction(theConsole[logFunc])) {\r\n theConsole[logFunc](message);\r\n }\r\n }\r\n}\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var _self = this;\r\n _self.messageId = msgId;\r\n _self.message =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : \"\");\r\n _self.message += diagnosticText;\r\n }\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nexport function safeGetLogger(core, config) {\r\n return (core || {}).logger || new DiagnosticLogger(config);\r\n}\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n this.identifier = \"DiagnosticLogger\";\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Count of internal messages sent\r\n */\r\n var _messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n var _messageLogged = {};\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n if (isNullOrUndefined(config)) {\r\n config = {};\r\n }\r\n _self.consoleLoggingLevel = function () { return _getConfigValue(\"loggingLevelConsole\", 0); };\r\n _self.telemetryLoggingLevel = function () { return _getConfigValue(\"loggingLevelTelemetry\", 1); };\r\n _self.maxInternalMessageLimit = function () { return _getConfigValue(\"maxMessageLimit\", 25); };\r\n _self.enableDebugExceptions = function () { return _getConfigValue(\"enableDebugExceptions\", false); };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n if (_self.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n // Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist\r\n var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;\r\n if (!isUndefined(message.message)) {\r\n var logLevel = _self.consoleLoggingLevel();\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message.messageId;\r\n if (!_messageLogged[messageKey] && logLevel >= severity) {\r\n _self[logFunc](message.message);\r\n _messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // Only log traces if the console Logging Level is >= the throwInternal severity level\r\n if (logLevel >= severity) {\r\n _self[logFunc](message.message);\r\n }\r\n }\r\n _self.logInternalMessage(severity, message);\r\n }\r\n else {\r\n _debugExtMsg(\"throw\" + (severity === LoggingSeverity.CRITICAL ? \"Critical\" : \"Warning\"), message);\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n _self.warnToConsole = function (message) {\r\n _logToConsole(\"warn\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n /**\r\n * This will write an error to the console if possible\r\n * @param message {string} - The error message\r\n */\r\n _self.errorToConsole = function (message) {\r\n _logToConsole(\"error\", message);\r\n _debugExtMsg(\"error\", message);\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n _self.logInternalMessage = function (severity, message) {\r\n if (_areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _self.telemetryLoggingLevel()) {\r\n _self.queue.push(message);\r\n _messageCount++;\r\n _debugExtMsg((severity === LoggingSeverity.CRITICAL ? \"error\" : \"warn\"), message);\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _self.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _self.queue.push(throttleMessage);\r\n if (severity === LoggingSeverity.CRITICAL) {\r\n _self.errorToConsole(throttleLimitMessage);\r\n }\r\n else {\r\n _self.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n }\r\n };\r\n function _getConfigValue(name, defValue) {\r\n var value = config[name];\r\n if (!isNullOrUndefined(value)) {\r\n return value;\r\n }\r\n return defValue;\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _self.maxInternalMessageLimit();\r\n }\r\n function _debugExtMsg(name, data) {\r\n var dbgExt = getDebugExt(config);\r\n if (dbgExt && dbgExt.diagLog) {\r\n dbgExt.diagLog(name, data);\r\n }\r\n }\r\n });\r\n }\r\n// Removed Stub for DiagnosticLogger.prototype.enableDebugExceptions.\r\n// Removed Stub for DiagnosticLogger.prototype.consoleLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.telemetryLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.maxInternalMessageLimit.\r\n// Removed Stub for DiagnosticLogger.prototype.throwInternal.\r\n// Removed Stub for DiagnosticLogger.prototype.warnToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.errorToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.resetInternalMessageCount.\r\n// Removed Stub for DiagnosticLogger.prototype.logInternalMessage.\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateNow, isArray, isFunction, objDefineAccessors } from \"./HelperFuncs\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar _defaultPerfManager = null;\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n var accessorDefined = false;\r\n _self.start = dateNow();\r\n _self.name = name;\r\n _self.isAsync = isAsync;\r\n _self.isChildEvt = function () { return false; };\r\n if (isFunction(payloadDetails)) {\r\n // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback\r\n var theDetails_1;\r\n accessorDefined = objDefineAccessors(_self, \"payload\", function () {\r\n // Delay the execution of the payloadDetails until needed\r\n if (!theDetails_1 && isFunction(payloadDetails)) {\r\n theDetails_1 = payloadDetails();\r\n // clear it out now so the referenced objects can be garbage collected\r\n payloadDetails = null;\r\n }\r\n return theDetails_1;\r\n });\r\n }\r\n _self.getCtx = function (key) {\r\n if (key) {\r\n // The parent and child links are located directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n // Put the parent and child links directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self.isChildEvt = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent.ChildrenContextKey) {\r\n _self[key] = value;\r\n }\r\n else {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n }\r\n };\r\n _self.complete = function () {\r\n var childTime = 0;\r\n var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey);\r\n if (isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts.length; lp++) {\r\n var childEvt = childEvts[lp];\r\n if (childEvt) {\r\n childTime += childEvt.time;\r\n }\r\n }\r\n }\r\n _self.time = dateNow() - _self.start;\r\n _self.exTime = _self.time - childTime;\r\n _self.complete = function () { };\r\n if (!accessorDefined && isFunction(payloadDetails)) {\r\n // If we couldn't define the property set during complete -- to minimize the perf impact until after the time\r\n _self.payload = payloadDetails();\r\n }\r\n };\r\n }\r\n PerfEvent.ParentContextKey = \"parent\";\r\n PerfEvent.ChildrenContextKey = \"childEvts\";\r\n return PerfEvent;\r\n}());\r\nexport { PerfEvent };\r\nvar PerfManager = /** @class */ (function () {\r\n function PerfManager(manager) {\r\n /**\r\n * General bucket used for execution context set and retrieved via setCtx() and getCtx.\r\n * Defined as private so it can be visualized via the DebugPlugin\r\n */\r\n this.ctx = {};\r\n dynamicProto(PerfManager, this, function (_self) {\r\n _self.create = function (src, payloadDetails, isAsync) {\r\n // TODO (@MSNev): at some point we will want to add additional configuration to \"select\" which events to instrument\r\n // for now this is just a simple do everything.\r\n return new PerfEvent(src, payloadDetails, isAsync);\r\n };\r\n _self.fire = function (perfEvent) {\r\n if (perfEvent) {\r\n perfEvent.complete();\r\n if (manager && isFunction(manager.perfEvent)) {\r\n manager.perfEvent(perfEvent);\r\n }\r\n }\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n };\r\n _self.getCtx = function (key) {\r\n return (_self[strExecutionContextKey] || {})[key];\r\n };\r\n });\r\n }\r\n// Removed Stub for PerfManager.prototype.create.\r\n// Removed Stub for PerfManager.prototype.fire.\r\n// Removed Stub for PerfManager.prototype.setCtx.\r\n// Removed Stub for PerfManager.prototype.getCtx.\r\n return PerfManager;\r\n}());\r\nexport { PerfManager };\r\nvar doPerfActiveKey = \"CoreUtils.doPerf\";\r\n/**\r\n * Helper function to wrap a function with a perf event\r\n * @param mgrSource - The Performance Manager or a Performance provider source (may be null)\r\n * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled)\r\n * @param func - The function to call and measure\r\n * @param details - A function to return the payload details\r\n * @param isAsync - Is the event / function being call asynchronously or synchronously\r\n */\r\nexport function doPerf(mgrSource, getSource, func, details, isAsync) {\r\n if (mgrSource) {\r\n var perfMgr = mgrSource;\r\n if (isFunction(perfMgr[\"getPerfMgr\"])) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[\"getPerfMgr\"]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr.getCtx(doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt.setCtx) {\r\n perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive);\r\n if (currentActive.getCtx && currentActive.setCtx) {\r\n var children = currentActive.getCtx(PerfEvent.ChildrenContextKey);\r\n if (!children) {\r\n children = [];\r\n currentActive.setCtx(PerfEvent.ChildrenContextKey, children);\r\n }\r\n children.push(perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr.setCtx(doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt.setCtx) {\r\n perfEvt.setCtx(\"exception\", ex);\r\n }\r\n }\r\n finally {\r\n // fire the perf event\r\n if (perfEvt) {\r\n perfMgr.fire(perfEvt);\r\n }\r\n // Reset the active event to the previous value\r\n perfMgr.setCtx(doPerfActiveKey, currentActive);\r\n }\r\n }\r\n }\r\n return func();\r\n}\r\n/**\r\n * Set the global performance manager to use when there is no core instance or it has not been initialized yet.\r\n * @param perfManager - The IPerfManager instance to use when no performance manager is supplied.\r\n */\r\nexport function setGblPerfMgr(perfManager) {\r\n _defaultPerfManager = perfManager;\r\n}\r\n/**\r\n * Get the current global performance manager that will be used with no performance manager is supplied.\r\n * @returns - The current default manager\r\n */\r\nexport function getGblPerfMgr() {\r\n return _defaultPerfManager;\r\n}\r\n//# sourceMappingURL=PerfManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { LoggingSeverity, _InternalMessageId } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { isFunction } from \"./HelperFuncs\";\r\nimport { dumpObj } from \"./EnvUtils\";\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = isFunction(plugin.processTelemetry);\r\n var _hasSetNext = isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n var identifier = plugin ? plugin.identifier : \"TelemetryPluginChain\";\r\n doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + \":processTelemetry\"; }, function () {\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some\r\n // other form of error occurred\r\n itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + dumpObj(error));\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }, function () { return ({ item: env }); }, !(env.sync));\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nimport { arrForEach, isFunction, isNullOrUndefined, isUndefined } from \"./HelperFuncs\";\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n return safeGetLogger(core, config);\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nexport var strIKey = \"iKey\";\r\nexport var strExtensionConfig = \"extensionConfig\";\r\n//# sourceMappingURL=Constants.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { isFunction, isNullOrUndefined, setValue } from \"./HelperFuncs\";\r\nimport { strExtensionConfig } from \"./Constants\";\r\nvar strGetPlugin = \"getPlugin\";\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {\r\n // Looks like backward compatibility or out of band processing. And as it looks\r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n setValue(config, strExtensionConfig, [], null, isNullOrUndefined);\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[strGetPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, isFunction } from \"./HelperFuncs\";\r\nvar processTelemetry = \"processTelemetry\";\r\nvar priority = \"priority\";\r\nvar setNextPlugin = \"setNextPlugin\";\r\nvar isInitialized = \"isInitialized\";\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config The current config for the instance\r\n * @param core THe current core instance\r\n * @param extensions The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext.getNext();\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (thePlugin) {\r\n if (lastPlugin &&\r\n isFunction(lastPlugin[setNextPlugin]) &&\r\n isFunction(thePlugin[processTelemetry])) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[setNextPlugin](thePlugin);\r\n }\r\n if (!isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {\r\n initPlugins.push(thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n // Now initiatilize the plugins\r\n arrForEach(initPlugins, function (thePlugin) {\r\n thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n var bHasProcess = isFunction(extB[processTelemetry]);\r\n if (isFunction(extA[processTelemetry])) {\r\n result = bHasProcess ? extA[priority] - extB[priority] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n return result;\r\n });\r\n // sort complete\r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BaseTelemetryPlugin } from \"./BaseTelemetryPlugin\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { initializePlugins } from \"./TelemetryHelpers\";\r\nimport { arrForEach, objDefineAccessors, throwError } from \"./HelperFuncs\";\r\nvar ChannelControllerPriority = 500;\r\nvar ChannelValidationMessage = \"Channel has invalid priority\";\r\nvar ChannelController = /** @class */ (function (_super) {\r\n __extends(ChannelController, _super);\r\n function ChannelController() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"ChannelControllerPlugin\";\r\n _this.priority = ChannelControllerPriority; // in reserved range 100 to 200\r\n var _channelQueue;\r\n dynamicProto(ChannelController, _this, function (_self, _base) {\r\n _self.setNextPlugin = function (next) {\r\n // The Channel controller is last in pipeline\r\n };\r\n _self.processTelemetry = function (item, itemCtx) {\r\n if (_channelQueue) {\r\n arrForEach(_channelQueue, function (queues) {\r\n // pass on to first item in queue\r\n if (queues.length > 0) {\r\n // Copying the item context as we could have mutiple chains that are executing asynchronously\r\n // and calling _getDefTelCtx as it's possible that the caller doesn't pass any context\r\n var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);\r\n chainCtx.processNext(item);\r\n }\r\n });\r\n }\r\n };\r\n _self.getChannelControls = function () {\r\n return _channelQueue;\r\n };\r\n _self.initialize = function (config, core, extensions) {\r\n if (_self.isInitialized()) {\r\n // already initialized\r\n return;\r\n }\r\n _base.initialize(config, core, extensions);\r\n _createChannelQueues((config || {}).channels, extensions);\r\n // Initialize the Queues\r\n arrForEach(_channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });\r\n };\r\n });\r\n function _checkQueuePriority(queue) {\r\n arrForEach(queue, function (queueItem) {\r\n if (queueItem.priority < ChannelControllerPriority) {\r\n throwError(ChannelValidationMessage + queueItem.identifier);\r\n }\r\n });\r\n }\r\n function _addChannelQueue(queue) {\r\n if (queue && queue.length > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a.priority - b.priority;\r\n });\r\n _checkQueuePriority(queue);\r\n _channelQueue.push(queue);\r\n }\r\n }\r\n function _createChannelQueues(channels, extensions) {\r\n _channelQueue = [];\r\n if (channels) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(channels, function (queue) { return _addChannelQueue(queue); });\r\n }\r\n if (extensions) {\r\n // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority\r\n var extensionQueue_1 = [];\r\n arrForEach(extensions, function (plugin) {\r\n if (plugin.priority > ChannelControllerPriority) {\r\n extensionQueue_1.push(plugin);\r\n }\r\n });\r\n _addChannelQueue(extensionQueue_1);\r\n }\r\n }\r\n return _this;\r\n }\r\n// Removed Stub for ChannelController.prototype.processTelemetry.\r\n// Removed Stub for ChannelController.prototype.getChannelControls.\r\n// Removed Stub for ChannelController.prototype.initialize.\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n // tslint:disable-next-line\r\n ChannelController._staticInit = (function () {\r\n var proto = ChannelController.prototype;\r\n // Dynamically create get/set property accessors\r\n objDefineAccessors(proto, \"ChannelControls\", proto.getChannelControls);\r\n objDefineAccessors(proto, \"channelQueue\", proto.getChannelControls);\r\n })();\r\n return ChannelController;\r\n}(BaseTelemetryPlugin));\r\nexport { ChannelController };\r\n//# sourceMappingURL=ChannelController.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { dumpObj, getDocument, getLocation, getNavigator, isIE } from \"./EnvUtils\";\r\nimport { arrForEach, dateNow, getExceptionName, isFunction, isNotNullOrUndefined, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, setValue, strContains, strEndsWith, strTrim } from \"./HelperFuncs\";\r\nvar strToGMTString = \"toGMTString\";\r\nvar strToUTCString = \"toUTCString\";\r\nvar strCookie = \"cookie\";\r\nvar strExpires = \"expires\";\r\nvar strEnabled = \"enabled\";\r\nvar strIsCookieUseDisabled = \"isCookieUseDisabled\";\r\nvar strDisableCookiesUsage = \"disableCookiesUsage\";\r\nvar strConfigCookieMgr = \"_ckMgr\";\r\nvar strEmpty = \"\";\r\nvar _supportsCookies = null;\r\nvar _allowUaSameSite = null;\r\nvar _parsedCookieValue = null;\r\nvar _doc = getDocument();\r\nvar _cookieCache = {};\r\nvar _globalCookieConfig = {};\r\n/**\r\n * @ignore\r\n * DO NOT USE or export from the module, this is exposed as public to support backward compatibility of previous static utility methods only.\r\n * If you want to manager cookies either use the ICookieMgr available from the core instance via getCookieMgr() or create\r\n * your own instance of the CookieMgr and use that.\r\n * Using this directly for enabling / disabling cookie handling will not only affect your usage but EVERY user of cookies.\r\n * Example, if you are using a shared component that is also using Application Insights you will affect their cookie handling.\r\n * @param logger - The DiagnosticLogger to use for reporting errors.\r\n */\r\nexport function _gblCookieMgr(config, logger) {\r\n // Stash the global instance against the BaseCookieMgr class\r\n var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];\r\n if (!inst) {\r\n // Note: not using the getSetValue() helper as that would require always creating a temporary cookieMgr\r\n // that ultimately is never used\r\n inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);\r\n _globalCookieConfig[strConfigCookieMgr] = inst;\r\n }\r\n return inst;\r\n}\r\nfunction _isMgrEnabled(cookieMgr) {\r\n if (cookieMgr) {\r\n return cookieMgr.isEnabled();\r\n }\r\n return true;\r\n}\r\nfunction _createCookieMgrConfig(rootConfig) {\r\n var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};\r\n // Sets the values from the root config if not already present on the cookieMgrCfg\r\n setValue(cookieMgrCfg, \"domain\", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);\r\n setValue(cookieMgrCfg, \"path\", rootConfig.cookiePath || \"/\", null, isNullOrUndefined);\r\n if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {\r\n // Set the enabled from the provided setting or the legacy root values\r\n var cookieEnabled = void 0;\r\n if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {\r\n cookieEnabled = !rootConfig[strIsCookieUseDisabled];\r\n }\r\n if (!isUndefined(rootConfig[strDisableCookiesUsage])) {\r\n cookieEnabled = !rootConfig[strDisableCookiesUsage];\r\n }\r\n cookieMgrCfg[strEnabled] = cookieEnabled;\r\n }\r\n return cookieMgrCfg;\r\n}\r\n/**\r\n * Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation\r\n * associated with the configuration or a legacy default.\r\n * @param core\r\n * @param config\r\n * @returns\r\n */\r\nexport function safeGetCookieMgr(core, config) {\r\n var cookieMgr;\r\n if (core) {\r\n // Always returns an instance\r\n cookieMgr = core.getCookieMgr();\r\n }\r\n else if (config) {\r\n var cookieCfg = config.cookieCfg;\r\n if (cookieCfg[strConfigCookieMgr]) {\r\n cookieMgr = cookieCfg[strConfigCookieMgr];\r\n }\r\n else {\r\n cookieMgr = createCookieMgr(config);\r\n }\r\n }\r\n if (!cookieMgr) {\r\n // Get or initialize the default global (legacy) cookie manager if we couldn't find one\r\n cookieMgr = _gblCookieMgr(config, (core || {}).logger);\r\n }\r\n return cookieMgr;\r\n}\r\nexport function createCookieMgr(rootConfig, logger) {\r\n var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);\r\n var _path = cookieMgrConfig.path || \"/\";\r\n var _domain = cookieMgrConfig.domain;\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n var _enabled = cookieMgrConfig[strEnabled] !== false;\r\n var cookieMgr = {\r\n isEnabled: function () {\r\n var enabled = _enabled && areCookiesSupported(logger);\r\n // Using an indirect lookup for any global cookie manager to support tree shaking for SDK's\r\n // that don't use the \"applicationinsights-core\" version of the default cookie function\r\n var gblManager = _globalCookieConfig[strConfigCookieMgr];\r\n if (enabled && gblManager && cookieMgr !== gblManager) {\r\n // Make sure the GlobalCookie Manager instance (if not this instance) is also enabled.\r\n // As the global (deprecated) functions may have been called (for backward compatibility)\r\n enabled = _isMgrEnabled(gblManager);\r\n }\r\n return enabled;\r\n },\r\n setEnabled: function (value) {\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n _enabled = value !== false;\r\n },\r\n set: function (name, value, maxAgeSec, domain, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n var values = {};\r\n var theValue = strTrim(value || strEmpty);\r\n var idx = theValue.indexOf(\";\");\r\n if (idx !== -1) {\r\n theValue = strTrim(value.substring(0, idx));\r\n values = _extractParts(value.substring(idx + 1));\r\n }\r\n // Only update domain if not already present (isUndefined) and the value is truthy (not null, undefined or empty string)\r\n setValue(values, \"domain\", domain || _domain, isTruthy, isUndefined);\r\n if (!isNullOrUndefined(maxAgeSec)) {\r\n var _isIE = isIE();\r\n if (isUndefined(values[strExpires])) {\r\n var nowMs = dateNow();\r\n // Only add expires if not already present\r\n var expireMs = nowMs + (maxAgeSec * 1000);\r\n // Sanity check, if zero or -ve then ignore\r\n if (expireMs > 0) {\r\n var expiry = new Date();\r\n expiry.setTime(expireMs);\r\n setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);\r\n }\r\n }\r\n if (!_isIE) {\r\n // Only replace if not already present\r\n setValue(values, \"max-age\", strEmpty + maxAgeSec, null, isUndefined);\r\n }\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n setValue(values, \"secure\", null, null, isUndefined);\r\n // Only set same site if not also secure\r\n if (_allowUaSameSite === null) {\r\n _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);\r\n }\r\n if (_allowUaSameSite) {\r\n setValue(values, \"SameSite\", \"None\", null, isUndefined);\r\n }\r\n }\r\n setValue(values, \"path\", path || _path, null, isUndefined);\r\n var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;\r\n setCookieFn(name, _formatCookieValue(theValue, values));\r\n result = true;\r\n }\r\n return result;\r\n },\r\n get: function (name) {\r\n var value = strEmpty;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n value = (cookieMgrConfig.getCookie || _getCookieValue)(name);\r\n }\r\n return value;\r\n },\r\n del: function (name, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n // Only remove the cookie if the manager and cookie support has not been disabled\r\n result = cookieMgr.purge(name, path);\r\n }\r\n return result;\r\n },\r\n purge: function (name, path) {\r\n var _a;\r\n var result = false;\r\n if (areCookiesSupported(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n var values = (_a = {},\r\n _a[\"path\"] = path ? path : \"/\",\r\n _a[strExpires] = \"Thu, 01 Jan 1970 00:00:01 GMT\",\r\n _a);\r\n if (!isIE()) {\r\n // Set max age to expire now\r\n values[\"max-age\"] = \"0\";\r\n }\r\n var delCookie = cookieMgrConfig.delCookie || _setCookieValue;\r\n delCookie(name, _formatCookieValue(strEmpty, values));\r\n result = true;\r\n }\r\n return result;\r\n }\r\n };\r\n // Associated this cookie manager with the config\r\n cookieMgr[strConfigCookieMgr] = cookieMgr;\r\n return cookieMgr;\r\n}\r\n/*\r\n* Helper method to tell if document.cookie object is supported by the runtime\r\n*/\r\nexport function areCookiesSupported(logger) {\r\n if (_supportsCookies === null) {\r\n _supportsCookies = false;\r\n try {\r\n var doc = _doc || {};\r\n _supportsCookies = doc[strCookie] !== undefined;\r\n }\r\n catch (e) {\r\n logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, \"Cannot access document.cookie - \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return _supportsCookies;\r\n}\r\nfunction _extractParts(theValue) {\r\n var values = {};\r\n if (theValue && theValue.length) {\r\n var parts = strTrim(theValue).split(\";\");\r\n arrForEach(parts, function (thePart) {\r\n thePart = strTrim(thePart || strEmpty);\r\n if (thePart) {\r\n var idx = thePart.indexOf(\"=\");\r\n if (idx === -1) {\r\n values[thePart] = null;\r\n }\r\n else {\r\n values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));\r\n }\r\n }\r\n });\r\n }\r\n return values;\r\n}\r\nfunction _formatDate(theDate, func) {\r\n if (isFunction(theDate[func])) {\r\n return theDate[func]();\r\n }\r\n return null;\r\n}\r\nfunction _formatCookieValue(value, values) {\r\n var cookieValue = value || strEmpty;\r\n objForEachKey(values, function (name, theValue) {\r\n cookieValue += \"; \" + name + (!isNullOrUndefined(theValue) ? \"=\" + theValue : strEmpty);\r\n });\r\n return cookieValue;\r\n}\r\nfunction _getCookieValue(name) {\r\n var cookieValue = strEmpty;\r\n if (_doc) {\r\n var theCookie = _doc[strCookie] || strEmpty;\r\n if (_parsedCookieValue !== theCookie) {\r\n _cookieCache = _extractParts(theCookie);\r\n _parsedCookieValue = theCookie;\r\n }\r\n cookieValue = strTrim(_cookieCache[name] || strEmpty);\r\n }\r\n return cookieValue;\r\n}\r\nfunction _setCookieValue(name, cookieValue) {\r\n if (_doc) {\r\n _doc[strCookie] = name + \"=\" + cookieValue;\r\n }\r\n}\r\nexport function uaDisallowsSameSiteNone(userAgent) {\r\n if (!isString(userAgent)) {\r\n return false;\r\n }\r\n // Cover all iOS based browsers here. This includes:\r\n // - Safari on iOS 12 for iPhone, iPod Touch, iPad\r\n // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad\r\n // - Chrome on iOS 12 for iPhone, iPod Touch, iPad\r\n // All of which are broken by SameSite=None, because they use the iOS networking stack\r\n if (strContains(userAgent, \"CPU iPhone OS 12\") || strContains(userAgent, \"iPad; CPU OS 12\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:\r\n // - Safari on Mac OS X\r\n // This does not include:\r\n // - Internal browser on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strContains(userAgent, \"Version/\") && strContains(userAgent, \"Safari\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:\r\n // - Internal browser on Mac OS X\r\n // This does not include:\r\n // - Safari on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strEndsWith(userAgent, \"AppleWebKit/605.1.15 (KHTML, like Gecko)\")) {\r\n return true;\r\n }\r\n // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.\r\n // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.\r\n // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.\r\n if (strContains(userAgent, \"Chrome/5\") || strContains(userAgent, \"Chrome/6\")) {\r\n return true;\r\n }\r\n // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal\r\n // that don't specify their Chrome version as lacking support for SameSite=None.\r\n if (strContains(userAgent, \"UnrealEngine\") && !strContains(userAgent, \"Chrome\")) {\r\n return true;\r\n }\r\n // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None\r\n // NB: this rule isn't complete - you need regex to make a complete rule.\r\n // See: https://www.chromium.org/updates/same-site/incompatible-clients\r\n if (strContains(userAgent, \"UCBrowser/12\") || strContains(userAgent, \"UCBrowser/11\")) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=CookieMgr.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { __spreadArrayFn as __spreadArray } from \"@microsoft/applicationinsights-shims\";\r\nimport { objCreateFn } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { ChannelController } from \"./ChannelController\";\r\nimport { ProcessTelemetryContext } from \"./ProcessTelemetryContext\";\r\nimport { initializePlugins, sortPlugins } from \"./TelemetryHelpers\";\r\nimport { LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { getGblPerfMgr, PerfManager } from \"./PerfManager\";\r\nimport { createCookieMgr } from \"./CookieMgr\";\r\nimport { arrForEach, isNullOrUndefined, toISOString, getSetValue, setValue, throwError, isNotTruthy, isFunction } from \"./HelperFuncs\";\r\nimport { strExtensionConfig, strIKey } from \"./Constants\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport { getDebugListener } from \"./DbgExtensionUtils\";\r\nvar validationError = \"Extensions must provide callback to initialize\";\r\nvar strNotificationManager = \"_notificationManager\";\r\n/**\r\n * Helper to create the default performance manager\r\n * @param core\r\n * @param notificationMgr\r\n */\r\nfunction _createPerfManager(core, notificationMgr) {\r\n return new PerfManager(notificationMgr);\r\n}\r\nvar BaseCore = /** @class */ (function () {\r\n function BaseCore() {\r\n var _isInitialized = false;\r\n var _eventQueue;\r\n var _channelController;\r\n var _notificationManager;\r\n var _perfManager;\r\n var _cookieManager;\r\n dynamicProto(BaseCore, this, function (_self) {\r\n _self._extensions = new Array();\r\n _channelController = new ChannelController();\r\n // Use a default logger so initialization errors are not dropped on the floor with full logging\r\n _self.logger = new DiagnosticLogger({ loggingLevelConsole: LoggingSeverity.CRITICAL });\r\n _eventQueue = [];\r\n _self.isInitialized = function () { return _isInitialized; };\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n // Make sure core is only initialized once\r\n if (_self.isInitialized()) {\r\n throwError(\"Core should not be initialized more than once\");\r\n }\r\n if (!config || isNullOrUndefined(config.instrumentationKey)) {\r\n throwError(\"Please provide instrumentation key\");\r\n }\r\n _notificationManager = notificationManager;\r\n // For backward compatibility only\r\n _self[strNotificationManager] = notificationManager;\r\n _self.config = config || {};\r\n if (notificationManager && _self.config.disableDbgExt !== true) {\r\n notificationManager.addNotificationListener(getDebugListener(config));\r\n }\r\n if (_self.config.enablePerfMgr) {\r\n // Set the performance manager creation function if not defined\r\n setValue(_self.config, \"createPerfMgr\", _createPerfManager);\r\n }\r\n config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions;\r\n // add notification to the extensions in the config so other plugins can access it\r\n var extConfig = getSetValue(config, strExtensionConfig);\r\n extConfig.NotificationManager = notificationManager;\r\n if (logger) {\r\n _self.logger = logger;\r\n }\r\n // Concat all available extensions\r\n var allExtensions = [];\r\n allExtensions.push.apply(allExtensions, __spreadArray(__spreadArray([], extensions, false), config.extensions, false));\r\n allExtensions = sortPlugins(allExtensions);\r\n var coreExtensions = [];\r\n var channelExtensions = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the\r\n var extPriorities = {};\r\n // Extension validation\r\n arrForEach(allExtensions, function (ext) {\r\n if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) {\r\n throwError(validationError);\r\n }\r\n var extPriority = ext.priority;\r\n var identifier = ext.identifier;\r\n if (ext && extPriority) {\r\n if (!isNullOrUndefined(extPriorities[extPriority])) {\r\n logger.warnToConsole(\"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channelController\r\n if (!extPriority || extPriority < _channelController.priority) {\r\n // Add to core extension that will be managed by BaseCore\r\n coreExtensions.push(ext);\r\n }\r\n else {\r\n // Add all other extensions to be managed by the channel controller\r\n channelExtensions.push(ext);\r\n }\r\n });\r\n // Validation complete\r\n // Add the channelController to the complete extension collection and\r\n // to the end of the core extensions\r\n allExtensions.push(_channelController);\r\n coreExtensions.push(_channelController);\r\n // Sort the complete set of extensions by priority\r\n allExtensions = sortPlugins(allExtensions);\r\n _self._extensions = allExtensions;\r\n // initialize channel controller first, this will initialize all channel plugins\r\n initializePlugins(new ProcessTelemetryContext([_channelController], config, _self), allExtensions);\r\n initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _self), allExtensions);\r\n // Now reset the extensions to just those being managed by Basecore\r\n _self._extensions = coreExtensions;\r\n if (_self.getTransmissionControls().length === 0) {\r\n throwError(\"No channels available\");\r\n }\r\n _isInitialized = true;\r\n _self.releaseQueue();\r\n };\r\n _self.getTransmissionControls = function () {\r\n return _channelController.getChannelControls();\r\n };\r\n _self.track = function (telemetryItem) {\r\n // setup default iKey if not passed in\r\n setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy);\r\n // add default timestamp if not passed in\r\n setValue(telemetryItem, \"time\", toISOString(new Date()), null, isNotTruthy);\r\n // Common Schema 4.0\r\n setValue(telemetryItem, \"ver\", \"4.0\", null, isNullOrUndefined);\r\n if (_self.isInitialized()) {\r\n // Process the telemetry plugin chain\r\n _self.getProcessTelContext().processNext(telemetryItem);\r\n }\r\n else {\r\n // Queue events until all extensions are initialized\r\n _eventQueue.push(telemetryItem);\r\n }\r\n };\r\n _self.getProcessTelContext = function () {\r\n var extensions = _self._extensions;\r\n var thePlugins = extensions;\r\n // invoke any common telemetry processors before sending through pipeline\r\n if (!extensions || extensions.length === 0) {\r\n // Pass to Channel controller so data is sent to correct channel queues\r\n thePlugins = [_channelController];\r\n }\r\n return new ProcessTelemetryContext(thePlugins, _self.config, _self);\r\n };\r\n _self.getNotifyMgr = function () {\r\n if (!_notificationManager) {\r\n // Create Dummy notification manager\r\n _notificationManager = objCreateFn({\r\n addNotificationListener: function (listener) { },\r\n removeNotificationListener: function (listener) { },\r\n eventsSent: function (events) { },\r\n eventsDiscarded: function (events, reason) { },\r\n eventsSendRequest: function (sendReason, isAsync) { }\r\n });\r\n // For backward compatibility only\r\n _self[strNotificationManager] = _notificationManager;\r\n }\r\n return _notificationManager;\r\n };\r\n _self.getCookieMgr = function () {\r\n if (!_cookieManager) {\r\n _cookieManager = createCookieMgr(_self.config, _self.logger);\r\n }\r\n return _cookieManager;\r\n };\r\n _self.setCookieMgr = function (cookieMgr) {\r\n _cookieManager = cookieMgr;\r\n };\r\n _self.getPerfMgr = function () {\r\n if (!_perfManager) {\r\n if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) {\r\n _perfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr());\r\n }\r\n }\r\n return _perfManager || getGblPerfMgr();\r\n };\r\n _self.setPerfMgr = function (perfMgr) {\r\n _perfManager = perfMgr;\r\n };\r\n _self.eventCnt = function () {\r\n return _eventQueue.length;\r\n };\r\n _self.releaseQueue = function () {\r\n if (_eventQueue.length > 0) {\r\n arrForEach(_eventQueue, function (event) {\r\n _self.getProcessTelContext().processNext(event);\r\n });\r\n _eventQueue = [];\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for BaseCore.prototype.initialize.\r\n// Removed Stub for BaseCore.prototype.getTransmissionControls.\r\n// Removed Stub for BaseCore.prototype.track.\r\n// Removed Stub for BaseCore.prototype.getProcessTelContext.\r\n// Removed Stub for BaseCore.prototype.getNotifyMgr.\r\n// Removed Stub for BaseCore.prototype.getCookieMgr.\r\n// Removed Stub for BaseCore.prototype.setCookieMgr.\r\n// Removed Stub for BaseCore.prototype.getPerfMgr.\r\n// Removed Stub for BaseCore.prototype.setPerfMgr.\r\n// Removed Stub for BaseCore.prototype.eventCnt.\r\n// Removed Stub for BaseCore.prototype.releaseQueue.\r\n return BaseCore;\r\n}());\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport { BaseCore } from \"./BaseCore\";\r\nimport { EventsDiscardedReason } from \"../JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { _InternalLogMessage, DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrForEach, isNullOrUndefined, toISOString, throwError } from \"./HelperFuncs\";\r\n\"use strict\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Internal log poller\r\n */\r\n var _internalLogPoller = 0;\r\n dynamicProto(AppInsightsCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));\r\n };\r\n _self.track = function (telemetryItem) {\r\n doPerf(_self.getPerfMgr(), function () { return \"AppInsightsCore:track\"; }, function () {\r\n if (telemetryItem === null) {\r\n _notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throwError(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n _validateTelemetryItem(telemetryItem);\r\n _base.track(telemetryItem);\r\n }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param {INotificationListener} listener - An INotificationListener object.\r\n */\r\n _self.addNotificationListener = function (listener) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.addNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - INotificationListener to remove.\r\n */\r\n _self.removeNotificationListener = function (listener) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.removeNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Periodically check logger.queue for log messages to be flushed\r\n */\r\n _self.pollInternalLogs = function (eventName) {\r\n var interval = _self.config.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n if (_internalLogPoller) {\r\n _self.stopPollingInternalLogs();\r\n }\r\n _internalLogPoller = setInterval(function () {\r\n var queue = _self.logger ? _self.logger.queue : [];\r\n arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: eventName ? eventName : \"InternalMessageId: \" + logMessage.messageId,\r\n iKey: _self.config.instrumentationKey,\r\n time: toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage.message }\r\n };\r\n _self.track(item);\r\n });\r\n queue.length = 0;\r\n }, interval);\r\n return _internalLogPoller;\r\n };\r\n /**\r\n * Stop polling log messages from logger.queue\r\n */\r\n _self.stopPollingInternalLogs = function () {\r\n if (!_internalLogPoller)\r\n return;\r\n clearInterval(_internalLogPoller);\r\n _internalLogPoller = 0;\r\n };\r\n function _validateTelemetryItem(telemetryItem) {\r\n if (isNullOrUndefined(telemetryItem.name)) {\r\n _notifyInvalidEvent(telemetryItem);\r\n throw Error(\"telemetry name required\");\r\n }\r\n }\r\n function _notifyInvalidEvent(telemetryItem) {\r\n var manager = _self.getNotifyMgr();\r\n if (manager) {\r\n manager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AppInsightsCore.prototype.initialize.\r\n// Removed Stub for AppInsightsCore.prototype.track.\r\n// Removed Stub for AppInsightsCore.prototype.addNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.removeNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.pollInternalLogs.\r\n// Removed Stub for AppInsightsCore.prototype.stopPollingInternalLogs.\r\n return AppInsightsCore;\r\n}(BaseCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrForEach, arrIndexOf } from \"./HelperFuncs\";\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager(config) {\r\n this.listeners = [];\r\n var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll;\r\n dynamicProto(NotificationManager, this, function (_self) {\r\n _self.addNotificationListener = function (listener) {\r\n _self.listeners.push(listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - AWTNotificationListener to remove.\r\n */\r\n _self.removeNotificationListener = function (listener) {\r\n var index = arrIndexOf(_self.listeners, listener);\r\n while (index > -1) {\r\n _self.listeners.splice(index, 1);\r\n index = arrIndexOf(_self.listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param {ITelemetryItem[]} events - The array of events that have been sent.\r\n */\r\n _self.eventsSent = function (events) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsSent) {\r\n setTimeout(function () { return listener.eventsSent(events); }, 0);\r\n }\r\n });\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.\r\n * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n _self.eventsDiscarded = function (events, reason) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsDiscarded) {\r\n setTimeout(function () { return listener.eventsDiscarded(events, reason); }, 0);\r\n }\r\n });\r\n };\r\n /**\r\n * [Optional] A function called when the events have been requested to be sent to the sever.\r\n * @param {number} sendReason - The reason why the event batch is being sent.\r\n * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n _self.eventsSendRequest = function (sendReason, isAsync) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.eventsSendRequest) {\r\n if (isAsync) {\r\n setTimeout(function () { return listener.eventsSendRequest(sendReason, isAsync); }, 0);\r\n }\r\n else {\r\n try {\r\n listener.eventsSendRequest(sendReason, isAsync);\r\n }\r\n catch (e) {\r\n // Catch errors to ensure we don't block sending the requests\r\n }\r\n }\r\n }\r\n });\r\n };\r\n _self.perfEvent = function (perfEvent) {\r\n if (perfEvent) {\r\n // Send all events or only parent events\r\n if (perfEvtsSendAll || !perfEvent.isChildEvt()) {\r\n arrForEach(_self.listeners, function (listener) {\r\n if (listener && listener.perfEvent) {\r\n if (perfEvent.isAsync) {\r\n setTimeout(function () { return listener.perfEvent(perfEvent); }, 0);\r\n }\r\n else {\r\n try {\r\n listener.perfEvent(perfEvent);\r\n }\r\n catch (e) {\r\n // Catch errors to ensure we don't block sending the requests\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for NotificationManager.prototype.addNotificationListener.\r\n// Removed Stub for NotificationManager.prototype.removeNotificationListener.\r\n// Removed Stub for NotificationManager.prototype.eventsSent.\r\n// Removed Stub for NotificationManager.prototype.eventsDiscarded.\r\n// Removed Stub for NotificationManager.prototype.eventsSendRequest.\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getCrypto, getMsCrypto, isIE } from \"./EnvUtils\";\r\nimport { dateNow } from \"./HelperFuncs\";\r\nvar UInt32Mask = 0x100000000;\r\nvar MaxUInt32 = 0xffffffff;\r\n// MWC based Random generator (for IE)\r\nvar _mwcSeeded = false;\r\nvar _mwcW = 123456789;\r\nvar _mwcZ = 987654321;\r\n// Takes any integer\r\nfunction _mwcSeed(seedValue) {\r\n if (seedValue < 0) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n seedValue >>>= 0;\r\n }\r\n _mwcW = (123456789 + seedValue) & MaxUInt32;\r\n _mwcZ = (987654321 - seedValue) & MaxUInt32;\r\n _mwcSeeded = true;\r\n}\r\nfunction _autoSeedMwc() {\r\n // Simple initialization using default Math.random() - So we inherit any entropy from the browser\r\n // and bitwise XOR with the current milliseconds\r\n try {\r\n var now = dateNow() & 0x7fffffff;\r\n _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);\r\n }\r\n catch (e) {\r\n // Don't crash if something goes wrong\r\n }\r\n}\r\n/**\r\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.\r\n * So maxValue(16) will produce a number from 0..16 (range of 17)\r\n * @param maxValue\r\n */\r\nexport function randomValue(maxValue) {\r\n if (maxValue > 0) {\r\n return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;\r\n }\r\n return 0;\r\n}\r\n/**\r\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function random32(signed) {\r\n var value;\r\n var c = getCrypto() || getMsCrypto();\r\n if (c && c.getRandomValues) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;\r\n }\r\n else if (isIE()) {\r\n // For IE 6, 7, 8 (especially on XP) Math.random is not very random\r\n if (!_mwcSeeded) {\r\n // Set the seed for the Mwc algorithm\r\n _autoSeedMwc();\r\n }\r\n // Don't use Math.random for IE\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mwcRandom32() & MaxUInt32;\r\n }\r\n else {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = Math.floor((UInt32Mask * Math.random()) | 0);\r\n }\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Seed the MWC random number generator with the specified seed or a random value\r\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\r\n */\r\nexport function mwcRandomSeed(value) {\r\n if (!value) {\r\n _autoSeedMwc();\r\n }\r\n else {\r\n _mwcSeed(value);\r\n }\r\n}\r\n/**\r\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)\r\n * instead of Math.random() defaults to un-signed.\r\n * Used as a replacement random generator for IE to avoid issues with older IE instances.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function mwcRandom32(signed) {\r\n _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;\r\n _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;\r\n var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n//# sourceMappingURL=RandomHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { objCreateFn, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { _gblCookieMgr } from \"./CookieMgr\";\r\nimport { getWindow, getDocument, getPerformance, isIE } from \"./EnvUtils\";\r\nimport { arrForEach, arrIndexOf, arrMap, arrReduce, attachEvent, dateNow, detachEvent, hasOwnProperty, isArray, isBoolean, isDate, isError, isFunction, isNullOrUndefined, isNumber, isObject, isString, isTypeof, isUndefined, objDefineAccessors, objKeys, strTrim, toISOString } from \"./HelperFuncs\";\r\nimport { randomValue, random32, mwcRandomSeed, mwcRandom32 } from \"./RandomHelper\";\r\nvar strVisibilityChangeEvt = \"visibilitychange\";\r\nvar strPageHide = \"pagehide\";\r\nvar strPageShow = \"pageshow\";\r\nvar _cookieMgrs = null;\r\nvar _canUseCookies; // legacy supported config\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\n/**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\nexport function addEventHandler(eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = attachEvent(w, eventName, callback);\r\n result = attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = attachEvent(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Bind the listener to the array of events\r\n * @param events An string array of event names to bind the listener to\r\n * @param listener The event callback to call when the event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addEventListeners(events, listener, excludeEvents) {\r\n var added = false;\r\n if (listener && events && isArray(events)) {\r\n var excluded_1 = [];\r\n arrForEach(events, function (name) {\r\n if (isString(name)) {\r\n if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {\r\n added = addEventHandler(name, listener) || added;\r\n }\r\n else {\r\n excluded_1.push(name);\r\n }\r\n }\r\n });\r\n if (!added && excluded_1.length > 0) {\r\n // Failed to add any listeners and we excluded some, so just attempt to add the excluded events\r\n added = addEventListeners(excluded_1, listener);\r\n }\r\n }\r\n return added;\r\n}\r\n/**\r\n * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,\r\n * this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden\r\n * it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is\r\n * just navigating to a different Tab and may come back (without unloading the page). As such you may also\r\n * need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.\r\n * @param listener - The event callback to call when a page unload event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageUnloadEventListener(listener, excludeEvents) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigation's.\r\n return addEventListeners([\"beforeunload\", \"unload\", \"pagehide\"], listener, excludeEvents);\r\n}\r\n/**\r\n * Listen to the pagehide and visibility changing to 'hidden' events\r\n * @param listener - The event callback to call when a page hide event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageHideEventListener(listener, excludeEvents) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"hidden\") {\r\n listener(evt);\r\n }\r\n }\r\n var pageUnloadAdded = false;\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strPageHide) === -1) {\r\n pageUnloadAdded = addEventHandler(strPageHide, listener);\r\n }\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageUnloadAdded = addEventHandler(strVisibilityChangeEvt, _handlePageVisibility) || pageUnloadAdded;\r\n }\r\n if (!pageUnloadAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageUnloadAdded = addPageHideEventListener(listener);\r\n }\r\n return pageUnloadAdded;\r\n}\r\n/**\r\n * Listen to the pageshow and visibility changing to 'visible' events\r\n * @param listener - The event callback to call when a page is show event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageShowEventListener(listener, excludeEvents) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"visible\") {\r\n listener(evt);\r\n }\r\n }\r\n var pageShowAdded = false;\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strPageShow) === -1) {\r\n pageShowAdded = addEventHandler(strPageShow, listener);\r\n }\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageShowAdded = addEventHandler(strVisibilityChangeEvt, _handlePageVisibility) || pageShowAdded;\r\n }\r\n if (!pageShowAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageShowAdded = addPageShowEventListener(listener);\r\n }\r\n return pageShowAdded;\r\n}\r\nexport function newGuid() {\r\n function randomHexDigit() {\r\n return randomValue(15); // Get a random value from 0..15\r\n }\r\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(GuidRegex, function (c) {\r\n var r = (randomHexDigit() | 0), v = (c === \"x\" ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n}\r\n/**\r\n * Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less)\r\n * https://caniuse.com/#search=performance.now\r\n */\r\nexport function perfNow() {\r\n var perf = getPerformance();\r\n if (perf && perf.now) {\r\n return perf.now();\r\n }\r\n return dateNow();\r\n}\r\n/**\r\n * Generate random base64 id string.\r\n * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\r\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\r\n */\r\nexport function newId(maxLength) {\r\n if (maxLength === void 0) { maxLength = 22; }\r\n var base64chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n // Start with an initial random number, consuming the value in reverse byte order\r\n var number = random32() >>> 0; // Make sure it's a +ve number\r\n var chars = 0;\r\n var result = \"\";\r\n while (result.length < maxLength) {\r\n chars++;\r\n result += base64chars.charAt(number & 0x3F);\r\n number >>>= 6; // Zero fill with right shift\r\n if (chars === 5) {\r\n // 5 base64 characters === 30 bits so we don't have enough bits for another base64 char\r\n // So add on another 30 bits and make sure it's +ve\r\n number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;\r\n chars = 0; // We need to reset the number every 5 chars (30 bits)\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param search - The characters to be searched for at the end of the value.\r\n * @returns true if the given search value is found at the end of the string, otherwise false.\r\n */\r\nexport function strEndsWith(value, search) {\r\n if (value && search) {\r\n var len = value.length;\r\n var start = len - search.length;\r\n return value.substring(start >= 0 ? start : 0, len) === search;\r\n }\r\n return false;\r\n}\r\n/**\r\n * generate W3C trace id\r\n */\r\nexport function generateW3CId() {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = \"\", tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = random32();\r\n oct +=\r\n hexValues[tmp & 0xF] +\r\n hexValues[tmp >> 4 & 0xF] +\r\n hexValues[tmp >> 8 & 0xF] +\r\n hexValues[tmp >> 12 & 0xF] +\r\n hexValues[tmp >> 16 & 0xF] +\r\n hexValues[tmp >> 20 & 0xF] +\r\n hexValues[tmp >> 24 & 0xF] +\r\n hexValues[tmp >> 28 & 0xF];\r\n }\r\n // \"Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively\"\r\n var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];\r\n return oct.substr(0, 8) + oct.substr(9, 4) + \"4\" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);\r\n}\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\nvar GuidRegex = /[xy]/g;\r\nexport var EventHelper = {\r\n Attach: attachEvent,\r\n AttachEvent: attachEvent,\r\n Detach: detachEvent,\r\n DetachEvent: detachEvent\r\n};\r\n/**\r\n * Helper to support backward compatibility for users that use the legacy cookie handling functions and the use the internal\r\n * CoreUtils._canUseCookies global flag to enable/disable cookies usage.\r\n * Note: This has the following deliberate side-effects\r\n * - Creates the global (legacy) cookie manager if it does not already exist\r\n * - Attempts to add \"listeners\" to the CoreUtils._canUseCookies property to support the legacy usage\r\n * @param config\r\n * @param logger\r\n * @returns\r\n */\r\nexport function _legacyCookieMgr(config, logger) {\r\n var cookieMgr = _gblCookieMgr(config, logger);\r\n var legacyCanUseCookies = CoreUtils._canUseCookies;\r\n if (_cookieMgrs === null) {\r\n _cookieMgrs = [];\r\n _canUseCookies = legacyCanUseCookies;\r\n // Dynamically create get/set property accessors for backward compatibility for enabling / disabling cookies\r\n // this WILL NOT work for ES3 browsers (< IE8)\r\n objDefineAccessors(CoreUtils, \"_canUseCookies\", function () {\r\n return _canUseCookies;\r\n }, function (value) {\r\n _canUseCookies = value;\r\n arrForEach(_cookieMgrs, function (mgr) {\r\n mgr.setEnabled(value);\r\n });\r\n });\r\n }\r\n if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {\r\n _cookieMgrs.push(cookieMgr);\r\n }\r\n if (isBoolean(legacyCanUseCookies)) {\r\n cookieMgr.setEnabled(legacyCanUseCookies);\r\n }\r\n if (isBoolean(_canUseCookies)) {\r\n cookieMgr.setEnabled(_canUseCookies);\r\n }\r\n return cookieMgr;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n */\r\nexport function disableCookies() {\r\n _legacyCookieMgr().setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().isEnabled()\r\n * Helper method to tell if document.cookie object is available and whether it can be used.\r\n */\r\nexport function canUseCookies(logger) {\r\n return _legacyCookieMgr(null, logger).isEnabled();\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().get()\r\n * helper method to access userId and sessionId cookie\r\n */\r\nexport function getCookie(logger, name) {\r\n return _legacyCookieMgr(null, logger).get(name);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().set()\r\n * helper method to set userId and sessionId cookie\r\n */\r\nexport function setCookie(logger, name, value, domain) {\r\n _legacyCookieMgr(null, logger).set(name, value, null, domain);\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().del()\r\n * Deletes a cookie by setting it's expiration time in the past.\r\n * @param name - The name of the cookie to delete.\r\n */\r\nexport function deleteCookie(logger, name) {\r\n return _legacyCookieMgr(null, logger).del(name);\r\n}\r\n//# sourceMappingURL=CoreUtils.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * Enums.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File containing the enums as constants.\r\n */\r\nimport { __assignFn as __assign } from \"@microsoft/applicationinsights-shims\";\r\nimport { _InternalMessageId } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * The ValueKind contains a set of values that specify value kind of the property.\r\n * Either PII (Personal Identifiable Information) or customer content.\r\n */\r\nexport var ValueKind = {\r\n /**\r\n * No kind.\r\n */\r\n NotSet: 0,\r\n /**\r\n * An LDAP distinguished name. For example, CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM.\r\n */\r\n Pii_DistinguishedName: 1,\r\n /**\r\n * Generic information.\r\n */\r\n Pii_GenericData: 2,\r\n /**\r\n * An IPV4 Internet address. For example, 192.0.2.1.\r\n */\r\n Pii_IPV4Address: 3,\r\n /**\r\n * An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.\r\n */\r\n Pii_IPv6Address: 4,\r\n /**\r\n * The Subject of an e-mail message.\r\n */\r\n Pii_MailSubject: 5,\r\n /**\r\n * A telephone number.\r\n */\r\n Pii_PhoneNumber: 6,\r\n /**\r\n * A query string.\r\n */\r\n Pii_QueryString: 7,\r\n /**\r\n * An SIP (Session Internet Protocol) address.\r\n */\r\n Pii_SipAddress: 8,\r\n /**\r\n * An e-mail address.\r\n */\r\n Pii_SmtpAddress: 9,\r\n /**\r\n * An user ID.\r\n */\r\n Pii_Identity: 10,\r\n /**\r\n * A URI (Uniform Resource Identifier).\r\n */\r\n Pii_Uri: 11,\r\n /**\r\n * The fully-qualified domain name.\r\n */\r\n Pii_Fqdn: 12,\r\n /**\r\n * Scrubs the last octet in a IPV4 Internet address.\r\n * For example: 10.121.227.147 becomes 10.121.227.*\r\n */\r\n Pii_IPV4AddressLegacy: 13,\r\n /**\r\n * Generic content.\r\n */\r\n CustomerContent_GenericContent: 32\r\n};\r\n/**\r\n * The EventLatency contains a set of values that specify the latency with which an event is sent.\r\n */\r\nexport var EventLatency = {\r\n /**\r\n * Normal latency.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Cost deferred latency. At the moment this latency is treated as Normal latency.\r\n */\r\n CostDeferred: 2 /* CostDeferred */,\r\n /**\r\n * Real time latency.\r\n */\r\n RealTime: 3 /* RealTime */,\r\n /**\r\n * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.\r\n * Added in v3.1.1\r\n */\r\n Immediate: 4 /* Immediate */\r\n};\r\n/**\r\n * Enum for property types.\r\n */\r\nexport var EventPropertyType = {\r\n Unspecified: 0,\r\n String: 1,\r\n Int32: 2,\r\n UInt32: 3,\r\n Int64: 4,\r\n UInt64: 5,\r\n Double: 6,\r\n Bool: 7,\r\n Guid: 8,\r\n DateTime: 9\r\n};\r\n/**\r\n * The EventPersistence contains a set of values that specify the event's persistence.\r\n */\r\nexport var EventPersistence = {\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* Critical */\r\n};\r\n/**\r\n * The TraceLevel contains a set of values that specify the trace level for the trace messages.\r\n */\r\nexport var TraceLevel = {\r\n /**\r\n * None.\r\n */\r\n NONE: 0,\r\n /**\r\n * Error trace.\r\n */\r\n ERROR: 1,\r\n /**\r\n * Warning trace.\r\n */\r\n WARNING: 2,\r\n /**\r\n * Information trace.\r\n */\r\n INFORMATION: 3\r\n};\r\nexport var _ExtendedInternalMessageId = __assign(__assign({}, _InternalMessageId), { AuthHandShakeError: 501, AuthRedirectFail: 502, BrowserCannotReadLocalStorage: 503, BrowserCannotWriteLocalStorage: 504, BrowserDoesNotSupportLocalStorage: 505, CannotParseBiBlobValue: 506, CannotParseDataAttribute: 507, CVPluginNotAvailable: 508, DroppedEvent: 509, ErrorParsingAISessionCookie: 510, ErrorProvidedChannels: 511, FailedToGetCookies: 512, FailedToInitializeCorrelationVector: 513, FailedToInitializeSDK: 514, InvalidContentBlob: 515, InvalidCorrelationValue: 516, SessionRenewalDateIsZero: 517, SendPostOnCompleteFailure: 518, PostResponseHandler: 519, SDKNotInitialized: 520 });\r\n//# sourceMappingURL=Enums.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nvar _a;\r\n/**\r\n * Utils.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n * File containing utility functions.\r\n */\r\nimport { objCreateFn, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { EventPropertyType, ValueKind, EventLatency } from \"./Enums\";\r\nimport { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from \"@microsoft/applicationinsights-core-js\";\r\nexport var Version = '3.1.10';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* NotSet */] = EventPropertyType.Unspecified,\r\n _a[2 /* Number */] = EventPropertyType.Double,\r\n _a[1 /* String */] = EventPropertyType.String,\r\n _a[3 /* Boolean */] = EventPropertyType.Bool,\r\n _a[4096 /* Array */ | 2 /* Number */] = EventPropertyType.Double,\r\n _a[4096 /* Array */ | 1 /* String */] = EventPropertyType.String,\r\n _a[4096 /* Array */ | 3 /* Boolean */] = EventPropertyType.Bool,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = Boolean(getDocument());\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = Boolean(getWindow());\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// <summary> takes a value and checks for undefined, null and empty string </summary>\r\n /// <param type=\"any\"> value to be tested </param>\r\n /// <returns> true if value is null undefined or emptyString </returns>\r\n return !(value === \"\" || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = apiKey.indexOf(\"-\");\r\n if (indexTenantId > -1) {\r\n return apiKey.substring(0, indexTenantId);\r\n }\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= EventLatency.Normal && value <= EventLatency.Immediate) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !property.hasOwnProperty(\"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property.value)\r\n || property.value === \"\" || (!isString(property.value)\r\n && !isNumber(property.value) && !isBoolean(property.value)\r\n && !isArray(property.value))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property.value) &&\r\n !isArrayValid(property.value)) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if (isArray(property.value) || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n property.value = property.value.toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === EventPropertyType.Double) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport function disableCookies() {\r\n safeGetCookieMgr(null).setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().set()\r\n * Sets the value of a cookie.\r\n * @param name - Cookie name.\r\n * @param value - Cookie value.\r\n * @param days - Expiration days.\r\n */\r\nexport function setCookie(name, value, days) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).set(name, value, days * 86400, null, \"/\");\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().del()\r\n * Deletes a cookie, by setting its expiration to -1.\r\n * @param name - Cookie name to delete.\r\n */\r\nexport function deleteCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).del(name);\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().get()\r\n * Gets the cookie value for the specified cookie.\r\n * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'\r\n * @param cookieName - Cookie name.\r\n */\r\nexport function getCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n return getCookieValue(safeGetCookieMgr(null), name);\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || \"\";\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* Numeric */) {\r\n theGuid = theGuid.replace(/-/g, \"\");\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments.length;\r\n var objProto = Object[strPrototype];\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (objProto.toString.call(theArgs[0]) === \"[object Boolean]\") {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === ValueKind.NotSet || ((value > ValueKind.NotSet && value <= ValueKind.Pii_IPV4AddressLegacy) || value === ValueKind.CustomerContent_GenericContent)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua.indexOf(\"safari\") >= 0 || ua.indexOf(\"firefox\") >= 0) && ua.indexOf(\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value.length > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt.timings = evt.timings || {};\r\n evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};\r\n evt.timings.processTelemetryStart[identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* Array */;\r\n if (value.length > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (hasOwnProperty(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* EventProperty */ | getFieldValueType(value.value);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\nexport var Utils = {\r\n Version: Version,\r\n FullVersionString: FullVersionString,\r\n strUndefined: strUndefined,\r\n strObject: strObject,\r\n Undefined: strUndefined,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n objKeys: objKeys,\r\n toISOString: toISOString,\r\n isReactNative: isReactNative,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n isFunction: isFunction,\r\n isArray: isArray,\r\n isObject: isObject,\r\n strTrim: strTrim,\r\n isDocumentObjectAvailable: isDocumentObjectAvailable,\r\n isWindowObjectAvailable: isWindowObjectAvailable,\r\n isValueAssigned: isValueAssigned,\r\n getTenantId: getTenantId,\r\n isBeaconsSupported: isBeaconsSupported,\r\n isUint8ArrayAvailable: isUint8ArrayAvailable,\r\n isLatency: isLatency,\r\n sanitizeProperty: sanitizeProperty,\r\n getISOString: toISOString,\r\n useXDomainRequest: useXDomainRequest,\r\n getCommonSchemaMetaData: getCommonSchemaMetaData,\r\n cookieAvailable: areCookiesSupported,\r\n disallowsSameSiteNone: uaDisallowsSameSiteNone,\r\n setCookie: setCookie,\r\n deleteCookie: deleteCookie,\r\n getCookie: getCookie,\r\n createGuid: createGuid,\r\n extend: extend,\r\n getTime: getTime,\r\n isValueKind: isValueKind,\r\n isArrayValid: isArrayValid,\r\n objDefineAccessors: objDefineAccessors,\r\n addPageUnloadEventListener: addPageUnloadEventListener,\r\n setProcessTelemetryTimings: setProcessTelemetryTimings,\r\n addEventHandler: addEventHandler,\r\n getFieldValueType: getFieldValueType,\r\n strEndsWith: strEndsWith,\r\n objForEachKey: objForEachKey\r\n};\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n return xhr;\r\n}\r\n//# sourceMappingURL=Utils.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * AppInsightsCore.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n */\r\nimport { AppInsightsCore as InternalCore, LoggingSeverity, doPerf, arrForEach, dumpObj, DiagnosticLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { EventLatency, _ExtendedInternalMessageId } from \"./Enums\";\r\nimport { isLatency, FullVersionString, getTime } from \"./Utils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar PropVersion = \"version\";\r\nvar properties = \"properties\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n var _this = _super.call(this) || this;\r\n _this.pluginVersionStringArr = [];\r\n _this.pluginVersionString = \"\";\r\n dynamicProto(AppInsightsCore, _this, function (_self, _base) {\r\n if (!_self.logger || !_self.logger.queue) {\r\n // The AI Base can inject a No-Op logger so if not defined or the No-Op, change to use a default logger so initialization errors\r\n // are not dropped on the floor if one is not already defined\r\n _self.logger = new DiagnosticLogger({ loggingLevelConsole: LoggingSeverity.CRITICAL });\r\n }\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n doPerf(_self, function () { return \"AppInsightsCore.initialize\"; }, function () {\r\n // Add default collector url\r\n if (config) {\r\n if (!config.endpointUrl) {\r\n config.endpointUrl = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\n }\r\n var propertyStorageOverride = config.propertyStorageOverride;\r\n // Validate property storage override\r\n if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {\r\n throw new Error(\"Invalid property storage override passed.\");\r\n }\r\n if (config.channels) {\r\n arrForEach(config.channels, function (channels) {\r\n if (channels) {\r\n arrForEach(channels, function (channel) {\r\n if (channel.identifier && channel.version) {\r\n var ver = channel.identifier + \"=\" + channel.version;\r\n _self.pluginVersionStringArr.push(ver);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n _self.getWParam = function () {\r\n return typeof document !== \"undefined\" ? 0 : -1;\r\n };\r\n if (extensions) {\r\n arrForEach(extensions, function (ext) {\r\n if (ext && ext.identifier && ext.version) {\r\n var ver = ext.identifier + \"=\" + ext.version;\r\n _self.pluginVersionStringArr.push(ver);\r\n }\r\n });\r\n }\r\n _self.pluginVersionString = _self.pluginVersionStringArr.join(\";\");\r\n try {\r\n _base.initialize(config, extensions, logger, notificationManager);\r\n _self.pollInternalLogs(\"InternalLog\");\r\n }\r\n catch (e) {\r\n var logger_1 = _self.logger;\r\n var message = dumpObj(e);\r\n if (message.indexOf(\"channels\") !== -1) {\r\n // Add some additional context to the underlying reported error\r\n message += \"\\n - Channels must be provided through config.channels only!\";\r\n }\r\n logger_1.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.FailedToInitializeSDK, \"SDK Initialization Failed - no telemetry will be sent: \" + message);\r\n }\r\n }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });\r\n };\r\n _self.track = function (item) {\r\n doPerf(_self, function () { return \"AppInsightsCore.track\"; }, function () {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n telemetryItem.timings = telemetryItem.timings || {};\r\n telemetryItem.timings.trackStart = getTime();\r\n if (!isLatency(telemetryItem.latency)) {\r\n telemetryItem.latency = EventLatency.Normal;\r\n }\r\n var itemExt = telemetryItem.ext = telemetryItem.ext || {};\r\n itemExt.sdk = itemExt.sdk || {};\r\n itemExt.sdk.ver = FullVersionString;\r\n var baseData = telemetryItem.baseData = telemetryItem.baseData || {};\r\n if (!baseData[properties]) {\r\n baseData[properties] = {};\r\n }\r\n var itemProperties = baseData[properties];\r\n if (!itemProperties[PropVersion]) {\r\n itemProperties[PropVersion] = \"\";\r\n }\r\n if (_self.pluginVersionString !== \"\") {\r\n itemProperties[PropVersion] = _self.pluginVersionString;\r\n }\r\n }\r\n _base.track(telemetryItem);\r\n }, function () { return ({ item: item }); }, !(item.sync));\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AppInsightsCore.prototype.initialize.\r\n// Removed Stub for AppInsightsCore.prototype.track.\r\n return AppInsightsCore;\r\n}(InternalCore));\r\nexport default AppInsightsCore;\r\n//# sourceMappingURL=AppInsightsCore.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * BaseCore.ts\r\n * Base Core is a subset of 1DS Web SDK Core. The purpose of Base Core is to generate a smaller bundle size while providing essential features of Core. Features that are not included in Base Core are:\r\n * 1. Internal logging\r\n * 2. Sending notifications on telemetry sent/discarded\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n */\r\nimport { BaseCore as InternalCore, LoggingSeverity, dumpObj } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _ExtendedInternalMessageId } from \"./Enums\";\r\nimport { FullVersionString, isDocumentObjectAvailable } from \"./Utils\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar BaseCore = /** @class */ (function (_super) {\r\n __extends(BaseCore, _super);\r\n function BaseCore() {\r\n var _this = _super.call(this) || this;\r\n dynamicProto(BaseCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n if (config && !config.endpointUrl) {\r\n config.endpointUrl = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\n }\r\n _self.getWParam = function () {\r\n return isDocumentObjectAvailable ? 0 : -1;\r\n };\r\n try {\r\n _base.initialize(config, extensions, logger, notificationManager);\r\n }\r\n catch (e) {\r\n _self.logger.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.FailedToInitializeSDK, \"Initialization Failed: \" + dumpObj(e) + \"\\n - Note: Channels must be provided through config.channels only\");\r\n }\r\n };\r\n _self.track = function (item) {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n var ext = telemetryItem.ext = telemetryItem.ext || {};\r\n ext.sdk = ext.sdk || {};\r\n ext.sdk.ver = FullVersionString;\r\n }\r\n _base.track(telemetryItem);\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for BaseCore.prototype.initialize.\r\n// Removed Stub for BaseCore.prototype.track.\r\n return BaseCore;\r\n}(InternalCore));\r\nexport default BaseCore;\r\n//# sourceMappingURL=BaseCore.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * ESPromise.ts\r\n * @author Nev Wylie (newylie))\r\n * @copyright Microsoft 2019\r\n * Simplified wrapper to provide ES6 style Promise callback handling for older browsers\r\n */\r\nimport { isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * Using a local variable to assist with minfication\r\n */\r\nvar _isFunction = isFunction;\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * This function will be used as onFulfilled handler for any Promise found in the iterable passed to Promise.all.\r\n * The goal here is to capture in a closure the index of the current item from the iterable. If we did not create\r\n * this closure, the captured index variable would be the same one that the for loop updates and thus would always\r\n * be pointing to the last index in the iterable by the time that the onFulfilled handler is called.\r\n * However, note that for the resolvedCallback callback we want the opposite. For this one we do want to capture\r\n * the same variable that the for loop updates so that we have the full count of pending promises by the time\r\n * the onFulfilled handlers start getting called.\r\n * @param values The resolving promise values\r\n * @param index The index of this callback function\r\n * @param resolvedCallback THe callback function used to check if the \"all\" promise is complete\r\n */\r\nfunction _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) {\r\n return function (value) {\r\n values[index] = value;\r\n resolvedCallback();\r\n };\r\n}\r\n/**\r\n * Simplified wrapper to provide ES6 style Promise callback handling for older browsers\r\n */\r\nvar ESPromise = /** @class */ (function () {\r\n /**\r\n * The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.\r\n * @param resolverFunc A function that is passed with the arguments resolve and reject. The executor function is executed\r\n * immediately by the Promise implementation, passing resolve and reject functions (the executor is called before the Promise\r\n * constructor even returns the created object). The resolve and reject functions, when called, resolve or reject the promise,\r\n * respectively. The executor normally initiates some asynchronous work, and then, once that completes, either calls the resolve\r\n * function to resolve the promise or else rejects it if an error occurred. If an error is thrown in the executor function, the\r\n * promise is rejected. The return value of the executor is ignored.\r\n */\r\n function ESPromise(resolverFunc) {\r\n var _state = 0 /* Pending */;\r\n var _settledValue = null;\r\n var _queue = [];\r\n dynamicProto(ESPromise, this, function (_this) {\r\n _this.then = function (onResolved, onRejected) {\r\n return new ESPromise(function (resolve, reject) {\r\n // Queue the new promise returned to be resolved or rejected\r\n // when this promise settles.\r\n _enqueue(onResolved, onRejected, resolve, reject);\r\n });\r\n };\r\n _this[\"catch\"] = function (onRejected) {\r\n return _this.then(null, onRejected);\r\n };\r\n });\r\n function _enqueue(onResolved, onRejected, resolve, reject) {\r\n _queue.push(function () {\r\n var value;\r\n try {\r\n // First call the onFulfilled or onRejected handler, on the settled value\r\n // of this promise. If the corresponding handler does not exist, simply\r\n // pass through the settled value.\r\n if (_state === 1 /* Resolved */) {\r\n value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue;\r\n }\r\n else {\r\n value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue;\r\n }\r\n if (value instanceof ESPromise) {\r\n // The called handlers returned a new promise, so the chained promise\r\n // will follow the state of this promise.\r\n value.then(resolve, reject);\r\n }\r\n else if (_state === 2 /* Rejected */ && !_isFunction(onRejected)) {\r\n // If there wasn't an onRejected handler and this promise is rejected, then\r\n // the chained promise also rejects with the same reason.\r\n reject(value);\r\n }\r\n else {\r\n // If this promise is fulfilled, then the chained promise is also fulfilled\r\n // with either the settled value of this promise (if no onFulfilled handler\r\n // was available) or the return value of the handler. If this promise is\r\n // rejected and there was an onRejected handler, then the chained promise is\r\n // fulfilled with the return value of the handler.\r\n resolve(value);\r\n }\r\n }\r\n catch (error) {\r\n // The chained promise will reject if there is any exception thrown while\r\n // calling the onFulfilled or onRejected handlers.\r\n reject(error);\r\n return;\r\n }\r\n });\r\n // If this promise is already settled, then immediately process the callback we\r\n // just added to the queue.\r\n if (_state !== 0 /* Pending */) {\r\n _processQueue();\r\n }\r\n }\r\n function _processQueue() {\r\n if (_queue.length > 0) {\r\n // The onFulfilled and onRejected handlers must be called asynchronously. Thus,\r\n // we make a copy of the queue and work on it once the current call stack unwinds.\r\n var pending_1 = _queue.slice();\r\n _queue = [];\r\n setTimeout(function () {\r\n for (var i = 0, len = pending_1.length; i < len; ++i) {\r\n try {\r\n pending_1[i]();\r\n }\r\n catch (e) {\r\n // Don't let 1 failing handler break all others\r\n // TODO (newylie): Add some form of error reporting (i.e. Call any registered JS error handler so the error is reported)\r\n }\r\n }\r\n }, 0);\r\n }\r\n }\r\n function _resolve(value) {\r\n if (_state === 0 /* Pending */) {\r\n _settledValue = value;\r\n _state = 1 /* Resolved */;\r\n _processQueue();\r\n }\r\n }\r\n function _reject(reason) {\r\n if (_state === 0 /* Pending */) {\r\n _settledValue = reason;\r\n _state = 2 /* Rejected */;\r\n _processQueue();\r\n }\r\n }\r\n (function _initialize() {\r\n if (!_isFunction(resolverFunc)) {\r\n throw new TypeError(\"ESPromise: resolvedFunc argument is not a Function\");\r\n }\r\n try {\r\n resolverFunc(_resolve, _reject);\r\n }\r\n catch (error) {\r\n // This promise will immediately reject if any exception is thrown\r\n // from within the executor function.\r\n _reject(error);\r\n }\r\n })();\r\n }\r\n /**\r\n * The Promise.resolve() method returns a Promise object that is resolved with a given value. If the value is a promise, that promise is returned;\r\n * if the value is a thenable (i.e. has a \"then\" method), the returned promise will \"follow\" that thenable, adopting its eventual state; otherwise\r\n * the returned promise will be fulfilled with the value. This function flattens nested layers of promise-like objects (e.g. a promise that resolves\r\n * to a promise that resolves to something) into a single layer.\r\n * @param value Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve.\r\n */\r\n ESPromise.resolve = function (value) {\r\n if (value instanceof ESPromise) {\r\n // Value is a Promise so just return it\r\n return value;\r\n }\r\n else if (value && _isFunction(value.then)) {\r\n // Value looks like a promise or thenable (has a then function)\r\n return new ESPromise(function (resolve, reject) {\r\n try {\r\n value.then(resolve, reject);\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n }\r\n return new ESPromise(function (resolve) {\r\n resolve(value);\r\n });\r\n };\r\n /**\r\n * The Promise.reject() method returns a Promise object that is rejected with a given reason.\r\n * @param reason The reason why this Promise rejected.\r\n */\r\n ESPromise.reject = function (reason) {\r\n return new ESPromise(function (resolve, reject) {\r\n reject(reason);\r\n });\r\n };\r\n /**\r\n * The Promise.all() method returns a single Promise that resolves when all of the promises passed as an iterable\r\n * have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that\r\n * rejects. There is no implied ordering in the execution of the array of Promises given. On some computers, they\r\n * may be executed in parallel, or in some sense concurrently, while on others they may be executed serially. For\r\n * this reason, there must be no dependency in any Promise on the order of execution of the Promises.\r\n * This method can be useful for aggregating the results of multiple promises.\r\n * FulfillmentSection - The returned promise is fulfilled with an array containing all the values of the iterable\r\n * passed as argument (also non-promise values).\r\n * If an empty iterable is passed, then this method returns (synchronously) an already resolved promise.\r\n * If all of the passed-in promises fulfill, or are not promises, the promise returned by Promise.all is fulfilled\r\n * asynchronously.\r\n * RejectionSection - If any of the passed-in promises reject, Promise.all asynchronously rejects with the value of\r\n * the promise that rejected, whether or not the other promises have resolved.\r\n * @param iterable\r\n */\r\n ESPromise.all = function (iterable) {\r\n if (!iterable || !iterable.length) {\r\n return;\r\n }\r\n return new ESPromise(function (resolve, reject) {\r\n try {\r\n var values_1 = [];\r\n var pending_2 = 0;\r\n for (var lp = 0; lp < iterable.length; lp++) {\r\n var item = iterable[lp];\r\n // Quick and direct check for a Promise (will also catch a thenable)\r\n if (item && _isFunction(item.then)) {\r\n pending_2++;\r\n item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () {\r\n if (--pending_2 === 0) {\r\n resolve(values_1);\r\n }\r\n }), reject);\r\n }\r\n else {\r\n values_1[lp] = item;\r\n }\r\n }\r\n if (pending_2 === 0) {\r\n // All promises were either resolved or where not a promise\r\n setTimeout(function () {\r\n resolve(values_1);\r\n }, 0);\r\n }\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n };\r\n /**\r\n * The race function returns a Promise that is settled the same way (and takes the same value) as the first promise\r\n * that settles amongst the promises of the iterable passed as an argument.\r\n * If the iterable passed is empty, the promise returned will be forever pending.\r\n * If the iterable contains one or more non-promise value and/or an already settled promise, then Promise.race will\r\n * resolve to the first of these values found in the iterable.\r\n * @param iterable\r\n */\r\n ESPromise.race = function (iterable) {\r\n return new ESPromise(function (resolve, reject) {\r\n if (!iterable || !iterable.length) {\r\n return;\r\n }\r\n try {\r\n var _loop_1 = function (lp) {\r\n var item = iterable[lp];\r\n // Quick and direct check for a Promise (will also catch a thenable)\r\n if (item && _isFunction(item.then)) {\r\n item.then(resolve, reject);\r\n }\r\n else {\r\n setTimeout(function () {\r\n resolve(item);\r\n }, 0);\r\n }\r\n };\r\n for (var lp = 0; lp < iterable.length; lp++) {\r\n _loop_1(lp);\r\n }\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n };\r\n// Removed Stub for ESPromise.prototype.then.\r\n// Removed Stub for ESPromise.prototype[\"catch\"].\r\n return ESPromise;\r\n}());\r\nexport default ESPromise;\r\n//# sourceMappingURL=ESPromise.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n * ESPromiseScheduler.ts\r\n * @author Nev Wylie (newylie)\r\n * @copyright Microsoft 2019\r\n */\r\nimport ESPromise from \"./ESPromise\";\r\nimport { getGlobal } from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/** This is a default timeout that will cause outstanding running promises to be removed/rejected to avoid filling up memory with blocked events */\r\nvar LazyRejectPeriod = 600000; // 10 Minutes\r\n// These are global variables that are shared across ALL instances of the scheduler\r\n/**\r\n * @ignore\r\n */\r\nvar _schedulerId = 0;\r\n/**\r\n * @ignore\r\n */\r\nvar _running = [];\r\n/**\r\n * @ignore\r\n */\r\nvar _waiting = [];\r\n/**\r\n * @ignore\r\n */\r\nvar _timedOut = [];\r\n/**\r\n * @ignore\r\n */\r\nfunction _getTime() {\r\n return new Date().getTime();\r\n}\r\n/**\r\n * Provides a simple mechanism queueing mechanism for scheduling events based on the ESPromise callbacks, this is used to ensure\r\n * order of async operations that are required to be executed in a specific order.\r\n */\r\nvar ESPromiseScheduler = /** @class */ (function () {\r\n function ESPromiseScheduler(name, diagLog) {\r\n var _promiseId = 0;\r\n var _scheduledName = (name || \"<unnamed>\") + \".\" + _schedulerId;\r\n _schedulerId++;\r\n dynamicProto(ESPromiseScheduler, this, function (_this) {\r\n var _lastEvent = null;\r\n var _eventCount = 0;\r\n _this.scheduleEvent = function (startEventAction, eventName, timeout) {\r\n var uniqueId = _scheduledName + \".\" + _eventCount;\r\n _eventCount++;\r\n if (eventName) {\r\n uniqueId += \"-(\" + eventName + \")\";\r\n }\r\n var uniqueEventId = uniqueId + \"{\" + _promiseId + \"}\";\r\n _promiseId++;\r\n // Create the next scheduled event details\r\n var newScheduledEvent = {\r\n evt: null,\r\n tm: _getTime(),\r\n id: uniqueEventId,\r\n isRunning: false,\r\n isAborted: false\r\n };\r\n if (!_lastEvent) {\r\n // We don't have any currently running event, so just start the next event\r\n newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent);\r\n }\r\n else {\r\n // Start a new promise which will wait until all current active events are complete before starting\r\n // the new event, it does not resolve this scheduled event until after the new event is resolve to\r\n // ensure that all scheduled events are completed in the correct order\r\n newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent);\r\n }\r\n // Set this new event as the last one, so that any future events will wait for this one\r\n _lastEvent = newScheduledEvent;\r\n _lastEvent.evt._schId = uniqueEventId;\r\n return newScheduledEvent.evt;\r\n function _abortAndRemoveOldEvents(eventQueue) {\r\n var now = _getTime();\r\n var expired = now - LazyRejectPeriod;\r\n var len = eventQueue.length;\r\n var lp = 0;\r\n while (lp < len) {\r\n var evt = eventQueue[lp];\r\n if (evt && evt.tm < expired) {\r\n var message = null;\r\n if (evt.abort) {\r\n message = \"Aborting [\" + evt.id + \"] due to Excessive runtime (\" + (now - evt.tm) + \" ms)\";\r\n evt.abort(message);\r\n }\r\n else {\r\n message = \"Removing [\" + evt.id + \"] due to Excessive runtime (\" + (now - evt.tm) + \" ms)\";\r\n }\r\n _warnLog(message);\r\n eventQueue.splice(lp, 1);\r\n len--;\r\n }\r\n else {\r\n lp++;\r\n }\r\n }\r\n }\r\n function _cleanup(eventId, completed) {\r\n var toQueue = false;\r\n var removed = _removeQueuedEvent(_running, eventId);\r\n if (!removed) {\r\n removed = _removeQueuedEvent(_timedOut, eventId);\r\n toQueue = true;\r\n }\r\n if (removed) {\r\n if (removed.to) {\r\n // If there was a timeout stop it\r\n clearTimeout(removed.to);\r\n removed.to = null;\r\n }\r\n // TODO (newylie): Convert this into reportable metrics\r\n var tm = _getTime() - removed.tm;\r\n if (completed) {\r\n if (!toQueue) {\r\n _debugLog(\"Promise [\" + eventId + \"] Complete -- \" + tm + \" ms\");\r\n }\r\n else {\r\n _warnLog(\"Timed out event [\" + eventId + \"] finally complete -- \" + tm + \" ms\");\r\n }\r\n }\r\n else {\r\n _timedOut.push(removed);\r\n _warnLog(\"Event [\" + eventId + \"] Timed out and removed -- \" + tm + \" ms\");\r\n }\r\n }\r\n else {\r\n _debugLog(\"Failed to remove [\" + eventId + \"] from running queue\");\r\n }\r\n // Also if the last scheduled event was this event then clear it as we are now finished\r\n if (_lastEvent && _lastEvent.id === eventId) {\r\n _lastEvent = null;\r\n }\r\n _abortAndRemoveOldEvents(_running);\r\n _abortAndRemoveOldEvents(_waiting);\r\n _abortAndRemoveOldEvents(_timedOut);\r\n }\r\n // Return a callback function that will be called when the waiting promise is resolved or rejected to ensure\r\n // that any outer promise is also resolved or rejected\r\n function _removeScheduledEvent(eventId, callback) {\r\n return function (value) {\r\n _cleanup(eventId, true);\r\n callback && callback(value);\r\n return value;\r\n };\r\n }\r\n function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) {\r\n startResult.then(function (value) {\r\n if (value instanceof ESPromise) {\r\n // If the result is a promise then this appears to be a chained result, so wait for this promise to complete\r\n _debugLog(\"Event [\" + eventId + \"] returned a promise -- waiting\");\r\n _waitForFinalResult(eventId, value, schEventResolve, schEventReject);\r\n return value;\r\n }\r\n else {\r\n return _removeScheduledEvent(eventId, schEventResolve)(value);\r\n }\r\n }, _removeScheduledEvent(eventId, schEventReject));\r\n }\r\n // Add the passed event to the active event list with resolve and reject callbacks that will remove\r\n // it from the active event list\r\n function _createScheduledEvent(eventDetails, startEvent) {\r\n var eventId = eventDetails.id;\r\n return new ESPromise(function (schEventResolve, schEventReject) {\r\n _debugLog(\"Event [\" + eventId + \"] Starting -- waited for \" + (eventDetails.wTm || \"--\") + \" ms\");\r\n eventDetails.isRunning = true;\r\n eventDetails.abort = function (message) {\r\n eventDetails.abort = null;\r\n eventDetails.isAborted = true;\r\n _cleanup(eventId, false);\r\n schEventReject(new Error(message));\r\n };\r\n var startResult = startEvent(eventId);\r\n if (startResult instanceof ESPromise) {\r\n if (timeout) {\r\n // Note: Only starting a timer if a timeout was specified\r\n eventDetails.to = setTimeout(function () {\r\n _cleanup(eventId, false);\r\n // Cause the listeners to reject (Note: We can't actually reject the waiting event)\r\n schEventReject(new Error(\"Timed out after [\" + timeout + \"] ms\"));\r\n }, timeout);\r\n }\r\n _waitForFinalResult(eventId, startResult, function (theResult) {\r\n _debugLog(\"Event [\" + eventId + \"] Resolving after \" + (_getTime() - eventDetails.tm) + \" ms\");\r\n schEventResolve(theResult);\r\n }, schEventReject);\r\n }\r\n else {\r\n // The startEvent didn't return a promise so just return a resolved promise\r\n _debugLog(\"Promise [\" + eventId + \"] Auto completed as the start action did not return a promise\");\r\n schEventResolve();\r\n }\r\n });\r\n }\r\n function _startWaitingEvent(eventDetails) {\r\n var now = _getTime();\r\n eventDetails.wTm = now - eventDetails.tm;\r\n eventDetails.tm = now;\r\n if (eventDetails.isAborted) {\r\n return ESPromise.reject(new Error(\"[\" + uniqueId + \"] was aborted\"));\r\n }\r\n _running.push(eventDetails);\r\n return _createScheduledEvent(eventDetails, startEventAction);\r\n }\r\n // Start a new promise which will wait until all current active events are complete before starting\r\n // the new event, it does not resolve this scheduled event until after the new event is resolve to\r\n // ensure that all scheduled events are completed in the correct order\r\n function _waitForPreviousEvent(eventDetails, waitForEvent) {\r\n var waitEvent = new ESPromise(function (waitResolve, waitReject) {\r\n var runTime = _getTime() - waitForEvent.tm;\r\n var prevId = waitForEvent.id;\r\n _debugLog(\"[\" + uniqueId + \"] is waiting for [\" + prevId + \":\" + runTime + \" ms] to complete before starting -- [\" + _waiting.length + \"] waiting and [\" + _running.length + \"] running\");\r\n eventDetails.abort = function (message) {\r\n eventDetails.abort = null;\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n eventDetails.isAborted = true;\r\n waitReject(new Error(message));\r\n };\r\n // Wait for the previous event to complete\r\n waitForEvent.evt.then(function (value) {\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n // Wait for the last event to complete before starting the new one, this ensures the execution\r\n // order so that we don't try and remove events that havn't been committed yet\r\n _startWaitingEvent(eventDetails).then(waitResolve, waitReject);\r\n }, function (reason) {\r\n _removeQueuedEvent(_waiting, uniqueId);\r\n // Wait for the last event to complete before starting the new one, this ensures the execution\r\n // order so that we don't try and remove events that havn't been committed yet\r\n _startWaitingEvent(eventDetails).then(waitResolve, waitReject);\r\n });\r\n });\r\n _waiting.push(eventDetails);\r\n return waitEvent;\r\n }\r\n };\r\n function _removeQueuedEvent(queue, eventId) {\r\n for (var lp = 0; lp < queue.length; lp++) {\r\n if (queue[lp].id === eventId) {\r\n return queue.splice(lp, 1)[0];\r\n }\r\n }\r\n return null;\r\n }\r\n });\r\n function _debugLog(message) {\r\n // Only log if running within test harness\r\n var global = getGlobal();\r\n if (global && global[\"QUnit\"]) {\r\n // tslint:disable-next-line:no-console\r\n console && console.log(\"ESPromiseScheduler[\" + _scheduledName + \"] \" + message);\r\n }\r\n }\r\n function _warnLog(message) {\r\n diagLog && diagLog.warnToConsole(\"ESPromiseScheduler[\" + _scheduledName + \"] \" + message);\r\n }\r\n }\r\n ESPromiseScheduler.incomplete = function () {\r\n return _running;\r\n };\r\n ESPromiseScheduler.waitingToStart = function () {\r\n return _waiting;\r\n };\r\n// Removed Stub for ESPromiseScheduler.prototype.scheduleEvent.\r\n return ESPromiseScheduler;\r\n}());\r\nexport default ESPromiseScheduler;\r\n//# sourceMappingURL=ESPromiseScheduler.js.map","/*\n * 1DS JS SDK Core, 3.1.10\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nimport { isNullOrUndefined, objForEachKey, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isValueKind, isValueAssigned, getFieldValueType } from \"./Utils\";\r\nvar ValueSanitizer = /** @class */ (function () {\r\n function ValueSanitizer(fieldSanitizerProvider) {\r\n var _self = this;\r\n // To aid with performance this is a lookup map to check if the field value sanitizer supports this field\r\n var _sanitizerMap = {};\r\n var _sanitizers = [];\r\n var _fieldSanitizers = [];\r\n if (fieldSanitizerProvider) {\r\n _fieldSanitizers.push(fieldSanitizerProvider);\r\n }\r\n function _getFieldSanitizer(path, name) {\r\n var result;\r\n var fieldLookup = _sanitizerMap[path];\r\n if (fieldLookup) {\r\n result = fieldLookup[name];\r\n }\r\n if (!result && result !== null) {\r\n // Null is a valid result indicating that the value sanitizer does not support this field\r\n if (isString(path) && isString(name)) {\r\n if (_fieldSanitizers.length > 0) {\r\n for (var lp = 0; lp < _fieldSanitizers.length; lp++) {\r\n if (_fieldSanitizers[lp].handleField(path, name)) {\r\n result = {\r\n canHandle: true,\r\n fieldHandler: _fieldSanitizers[lp]\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n else if (_sanitizers.length === 0) {\r\n // Special use-case where there is no sanitizer to pass on to, so just resolving the field\r\n // and returning the resulting value (same as sanitizeProperty())\r\n result = {\r\n canHandle: true\r\n };\r\n }\r\n }\r\n // We still don't have a handler so lets lookup the providers\r\n if (!result && result !== null) {\r\n // Setting the result to null -- which means we and any contained sanitizers can't handle this field\r\n result = null;\r\n for (var lp = 0; lp < _sanitizers.length; lp++) {\r\n if (_sanitizers[lp].handleField(path, name)) {\r\n result = {\r\n canHandle: true,\r\n handler: _sanitizers[lp],\r\n fieldHandler: null\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n if (!fieldLookup) {\r\n fieldLookup = _sanitizerMap[path] = {};\r\n }\r\n fieldLookup[name] = result;\r\n }\r\n return result;\r\n }\r\n _self.addSanitizer = function (newSanitizer) {\r\n if (newSanitizer) {\r\n _sanitizers.push(newSanitizer);\r\n // Invalidate any previously mapped fields\r\n _sanitizerMap = {};\r\n }\r\n };\r\n _self.addFieldSanitizer = function (fieldSanitizer) {\r\n if (fieldSanitizer) {\r\n _fieldSanitizers.push(fieldSanitizer);\r\n // Invalidate any previously mapped fields\r\n _sanitizerMap = {};\r\n }\r\n };\r\n _self.handleField = function (path, name) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n return mapValue ? mapValue.canHandle : false;\r\n };\r\n _self.value = function (path, name, value, stringifyObjects) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n if (mapValue && mapValue.canHandle) {\r\n if (!mapValue || !mapValue.canHandle) {\r\n return null;\r\n }\r\n if (mapValue.handler) {\r\n // This value sanitizer can't handle this field so pass it only the next one\r\n return mapValue.handler.value(path, name, value, stringifyObjects);\r\n }\r\n // Check that property is valid\r\n if (!isString(name) || isNullOrUndefined(value) || value === \"\") {\r\n return null;\r\n }\r\n var property = null;\r\n var fieldType = getFieldValueType(value);\r\n if ((fieldType & 8192 /* EventProperty */) === 8192 /* EventProperty */) {\r\n var subType = fieldType & ~8192 /* EventProperty */;\r\n property = value;\r\n if (!isValueAssigned(property.value) ||\r\n (subType !== 1 /* String */ &&\r\n subType !== 2 /* Number */ &&\r\n subType !== 3 /* Boolean */ &&\r\n (subType & 4096 /* Array */) !== 4096 /* Array */)) {\r\n // Not a supported IEventProperty type to be able to sanitize\r\n return null;\r\n }\r\n }\r\n else if (fieldType === 1 /* String */ ||\r\n fieldType === 2 /* Number */ ||\r\n fieldType === 3 /* Boolean */ ||\r\n (fieldType & 4096 /* Array */) === 4096 /* Array */) {\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n property = _convertToProperty(path, name, value);\r\n }\r\n else if (fieldType === 4 /* Object */) {\r\n property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value);\r\n }\r\n if (property) {\r\n return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);\r\n }\r\n }\r\n return null;\r\n };\r\n _self.property = function (path, name, property, stringifyObjects) {\r\n var mapValue = _getFieldSanitizer(path, name);\r\n if (!mapValue || !mapValue.canHandle) {\r\n return null;\r\n }\r\n // Check that property is valid\r\n if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) {\r\n return null;\r\n }\r\n var fieldType = getFieldValueType(property.value);\r\n if (fieldType === 0 /* NotSet */) {\r\n // Not a supported field that we can sanitize or serialize\r\n return null;\r\n }\r\n return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);\r\n };\r\n function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) {\r\n if (mapValue.handler) {\r\n // This value sanitizer can't handle this field so pass it only the next one\r\n return mapValue.handler.property(path, name, property, stringifyObjects);\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if ((fieldType & 4096 /* Array */) === 4096 /* Array */ || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n // Convert the value to a string and assign back to the original value\r\n property.value = property.value.toString();\r\n }\r\n return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property);\r\n }\r\n function _convertToProperty(path, name, value) {\r\n if (isValueAssigned(value)) {\r\n return { value: value };\r\n }\r\n return null;\r\n }\r\n function _callFieldSanitizer(fieldProvider, path, name, theType, property) {\r\n if (property && fieldProvider) {\r\n var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType);\r\n if (sanitizer) {\r\n // This is where we the field will call the handler to \"scrub\" the value. This the primary hook for the ClientHashing Plugin to\r\n // be able to apply the hashFunc() / Sha256 conversion of the properties value\r\n if (theType === 4 /* Object */) {\r\n // Special case of an embedded object (ext.metadata, data.properties)\r\n var newValue_1 = {};\r\n var propValue = property.value;\r\n objForEachKey(propValue, function (propKey, theValue) {\r\n var newPath = path + \".\" + name;\r\n if (isValueAssigned(theValue)) {\r\n var newProp = _convertToProperty(newPath, propKey, theValue);\r\n newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp);\r\n if (newProp) {\r\n newValue_1[propKey] = newProp.value;\r\n }\r\n }\r\n });\r\n property.value = newValue_1;\r\n }\r\n else {\r\n var details = {\r\n path: path,\r\n name: name,\r\n type: theType,\r\n prop: property,\r\n sanitizer: _self\r\n };\r\n property = sanitizer.call(_self, details);\r\n }\r\n }\r\n }\r\n return property;\r\n }\r\n }\r\n ValueSanitizer.getFieldType = getFieldValueType;\r\n return ValueSanitizer;\r\n}());\r\nexport { ValueSanitizer };\r\n//# sourceMappingURL=ValueSanitizer.js.map","/*\n * Application Insights JavaScript SDK - Core, 2.7.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\"use strict\";\r\nexport var MinChannelPriorty = 100;\r\n//# sourceMappingURL=IChannelControls.js.map"],"names":["strShimFunction","strShimObject","strShimUndefined","strShimPrototype","strShimHasOwnProperty","ObjClass","Object","ObjProto","ObjAssign","ObjCreate","ObjDefineProperty","ObjHasOwnProperty","_cachedGlobal","getGlobal","useCached","globalThis","self","window","global","throwTypeError","message","TypeError","objCreateFn","obj","type","tmpFunc","__assignFn","t","s","i","n","arguments","length","p","call","extendStaticsFn","d","b","__proto__","Array","__extendsFn","__","this","constructor","__spreadArrayFn","to","from","il","j","EventsDiscardedReason","Unknown","NonRetryableStatus","InvalidEvent","SizeLimitExceeded","KillSwitch","QueueFull","Constructor","Prototype","strFunction","DynInstFuncTable","DynProxyTag","DynClassName","DynInstChkTag","DynAllowInstChkTag","DynProtoDefaultOptions","UnknownValue","str__Proto","strUseBaseInst","strSetInstFuncs","Obj","_objGetPrototypeOf","_dynamicNames","_hasOwnProperty","prop","hasOwnProperty","_isObjectOrArrayPrototype","target","_isObjectArrayOrFunctionPrototype","Function","_getObjProto","newProto","_forEachProp","func","props","getOwnProps","name_1","push","lp","_isDynamicCandidate","funcName","skipOwn","_throwTypeError","_hasVisited","values","value","_getObjName","unknownValue","name","dynamicProto","theClass","delegateFunc","options","thisTarget","instFuncs","proto","baseInstFuncs","instFuncs_1","classProto","className","visited","thisProto","_checkPrototype","perfOptions","useBaseInst","undefined","setInstanceFunc","_instFuncProxy","funcHost","instFuncTable","theFunc","apply","baseFuncs","baseProto","_getBaseFuncs","dynProtoProxy","protoFunc","currentDynProtoProxy","instFunc","canAddInst","objProto","e","_getInstFunc","setInstFuncs","LoggingSeverity","_InternalMessageId","BrowserDoesNotSupportLocalStorage","BrowserCannotReadLocalStorage","BrowserCannotReadSessionStorage","BrowserCannotWriteLocalStorage","BrowserCannotWriteSessionStorage","BrowserFailedRemovalFromLocalStorage","BrowserFailedRemovalFromSessionStorage","CannotSendEmptyTelemetry","ClientPerformanceMathError","ErrorParsingAISessionCookie","ErrorPVCalc","ExceptionWhileLoggingError","FailedAddingTelemetryToBuffer","FailedMonitorAjaxAbort","FailedMonitorAjaxDur","FailedMonitorAjaxOpen","FailedMonitorAjaxRSC","FailedMonitorAjaxSend","FailedMonitorAjaxGetCorrelationHeader","FailedToAddHandlerForOnBeforeUnload","FailedToSendQueuedTelemetry","FailedToReportDataLoss","FlushFailed","MessageLimitPerPVExceeded","MissingRequiredFieldSpecification","NavigationTimingNotSupported","OnError","SessionRenewalDateIsZero","SenderNotInitialized","StartTrackEventFailed","StopTrackEventFailed","StartTrackFailed","StopTrackFailed","TelemetrySampledAndNotSent","TrackEventFailed","TrackExceptionFailed","TrackMetricFailed","TrackPVFailed","TrackPVFailedCalc","TrackTraceFailed","TransmissionFailed","FailedToSetStorageBuffer","FailedToRestoreStorageBuffer","InvalidBackendResponse","FailedToFixDepricatedValues","InvalidDurationValue","TelemetryEnvelopeInvalid","CreateEnvelopeError","CannotSerializeObject","CannotSerializeObjectNonSerializable","CircularReferenceDetected","ClearAuthContextFailed","ExceptionTruncated","IllegalCharsInName","ItemNotInArray","MaxAjaxPerPVExceeded","MessageTruncated","NameTooLong","SampleRateOutOfRange","SetAuthContextFailed","SetAuthContextFailedAccountName","StringValueTooLong","StartCalledMoreThanOnce","StopCalledWithoutStart","TelemetryInitializerFailed","TrackArgumentsNotSpecified","UrlTooLong","SessionStorageBufferFull","CannotAccessCookie","IdTooLong","FailedMonitorAjaxSetRequestHeader","SendBrowserInfoOnUserInit","PluginException","NotificationException","SnippetScriptLoadFailure","InvalidInstrumentationKey","CannotParseAiBlobValue","InvalidContentBlob","TrackPageActionEventFailed","FailedAddingCustomDefinedRequestContext","InMemoryStorageBufferFull","strAttachEvent","strAddEventHelper","strDetachEvent","strRemoveEventListener","strToISOString","_objDefineProperty","objToString","toString","isTypeof","theType","isUndefined","isNullOrUndefined","isNotNullOrUndefined","isObject","isFunction","attachEvent","eventNameWithoutOn","handlerRef","useCapture","result","detachEvent","objForEachKey","callbackfn","strEndsWith","search","searchLen","valLen","pos","strContains","indexOf","isDate","isArray","isError","isString","isNumber","isBoolean","toISOString","date","pad","num","r","String","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","slice","arrForEach","arr","thisArg","len","idx","arrIndexOf","searchElement","fromIndex","Math","max","abs","arrMap","_this","results","arrReduce","initialValue","strTrim","str","replace","_objKeysHasDontEnumBug","propertyIsEnumerable","_objKeysDontEnums","objKeys","objType","dontEnumsLength","objDefineAccessors","getProp","setProp","descriptor","enumerable","configurable","get","set","dateNow","dt","Date","now","getTime","getExceptionName","object","setValue","field","valChk","srcChk","theValue","getSetValue","defValue","isNotTruthy","isTruthy","throwError","Error","strWindow","strNavigator","strLocation","strPerformance","strJSON","strCrypto","strMsCrypto","strMsie","strTrident","_isTrident","_navUserAgentCheck","_enableMocks","_useXDomainRequest","_beaconsSupported","_hasProperty","property","supported","getGlobalInst","gbl","hasWindow","getWindow","hasDocument","document","getDocument","hasNavigator","navigator","getNavigator","hasHistory","history","getLocation","checkForMock","mockLocation","location","getConsole","console","getPerformance","hasJSON","JSON","getJSON","getCrypto","getMsCrypto","isReactNative","nav","product","isIE","userAgent","toLowerCase","dumpObj","objectTypeDump","propertyValueDump","stack","stringify","isBeaconsSupported","sendBeacon","useXDomainRequest","XDomainRequest","isXhrSupported","isSupported","_debugListener","listenerFuncs","_aiNamespace","getDebugExt","config","ns","disableDbgExt","_sanitizeDiagnosticText","text","_logToConsole","logFunc","theConsole","_InternalLogMessage","dataType","msgId","msg","isUserAct","properties","messageId","strProps","diagnosticText","safeGetLogger","core","logger","DiagnosticLogger","identifier","queue","_messageCount","_messageLogged","_self","_getConfigValue","_debugExtMsg","data","dbgExt","diagLog","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","enableDebugExceptions","throwInternal","severity","CRITICAL","logLevel","messageKey","logInternalMessage","warnToConsole","errorToConsole","resetInternalMessageCount","throttleLimitMessage","throttleMessage","logMessage","PerfEvent","ParentContextKey","ChildrenContextKey","payloadDetails","isAsync","theDetails_1","accessorDefined","start","isChildEvt","getCtx","key","setCtx","complete","childTime","childEvts","childEvt","time","exTime","payload","PerfManager","manager","ctx","create","src","fire","perfEvent","doPerfActiveKey","doPerf","mgrSource","getSource","details","perfMgr","children","perfEvt","currentActive","ex","TelemetryPluginChain","plugin","defItemCtx","_nextProxy","_hasProcessTelemetry","processTelemetry","_hasSetNext","setNextPlugin","_hasRun","getPlugin","getNext","setNext","nextPlugin","env","itemCtx","error","hasRun","item","_createProxyChain","plugins","proxies","lastProxy","thePlugin","newProxy","ProcessTelemetryContext","startAt","add","proxy","_copyProxyChain","getCfg","getExtCfg","defaultValue","theConfig","extConfig","extensionConfig","getConfig","hasNext","processNext","createNew","strExtensionConfig","strGetPlugin","BaseTelemetryPlugin","prototype","initialize","extensions","pluginChain","_baseTelInit","_isinitialized","_rootCtx","_nextPlugin","_getTelCtx","isInitialized","setInitialized","next","currentCtx","rootCtx","getProcessTelContext","priority","initializePlugins","processContext","initPlugins","lastPlugin","sortPlugins","sort","extA","extB","bHasProcess","__extends","ChannelController","_super","_staticInit","getChannelControls","_channelQueue","_addChannelQueue","a","queueItem","_base","queues","channels","extensionQueue_1","strToGMTString","strToUTCString","strCookie","strExpires","strEnabled","strIsCookieUseDisabled","strDisableCookiesUsage","strConfigCookieMgr","strEmpty","_supportsCookies","_allowUaSameSite","_parsedCookieValue","_doc","_cookieCache","_globalCookieConfig","_isMgrEnabled","cookieMgr","isEnabled","safeGetCookieMgr","inst","getCookieMgr","cookieCfg","createCookieMgr","rootConfig","cookieMgrCfg","cookieDomain","cookiePath","cookieEnabled","cookieMgrConfig","_path","path","_domain","domain","_enabled","enabled","areCookiesSupported","gblManager","setEnabled","maxAgeSec","_isIE","substring","_extractParts","expireMs","expiry","setTime","_formatDate","location_1","protocol","uaDisallowsSameSiteNone","setCookie","_setCookieValue","_formatCookieValue","getCookie","theCookie","cookieValue","del","purge","_a","delCookie","WARNING","exception","split","thePart","theDate","strNotificationManager","_createPerfManager","notificationMgr","BaseCore","_eventQueue","_channelController","_notificationManager","_perfManager","_cookieManager","_isInitialized","_extensions","loggingLevelConsole","notificationManager","instrumentationKey","addNotificationListener","listener","_listenerProxyFunc","getDebugListener","enablePerfMgr","NotificationManager","allExtensions","coreExtensions","__spreadArray","extPriorities","ext","extPriority","getTransmissionControls","releaseQueue","track","telemetryItem","thePlugins","getNotifyMgr","removeNotificationListener","eventsSent","events","eventsDiscarded","reason","eventsSendRequest","sendReason","setCookieMgr","getPerfMgr","createPerfMgr","setPerfMgr","eventCnt","event","listeners","perfEvtsSendAll","index","splice","setTimeout","AppInsightsCore","_internalLogPoller","_notifyInvalidEvent","pollInternalLogs","eventName","interval","diagnosticLogInterval","stopPollingInternalLogs","setInterval","iKey","baseType","baseData","clearInterval","UInt32Mask","MaxUInt32","_mwcSeeded","_mwcW","_mwcZ","_mwcSeed","seedValue","_autoSeedMwc","random","randomValue","maxValue","floor","random32","signed","c","getRandomValues","Uint32Array","mwcRandom32","strVisibilityChangeEvt","strPageHide","strPageShow","addEventHandler","callback","w","doc","addEventListeners","excludeEvents","excluded_1","added","addPageUnloadEventListener","newGuid","GuidRegex","perfNow","perf","newId","maxLength","number","chars","base64chars","generateW3CId","tmp","hexValues","oct","clockSequenceHi","substr","EventHelper","Attach","AttachEvent","Detach","DetachEvent","ValueKind","NotSet","Pii_DistinguishedName","Pii_GenericData","Pii_IPV4Address","Pii_IPv6Address","Pii_MailSubject","Pii_PhoneNumber","Pii_QueryString","Pii_SipAddress","Pii_SmtpAddress","Pii_Identity","Pii_Uri","Pii_Fqdn","Pii_IPV4AddressLegacy","CustomerContent_GenericContent","EventLatency","Normal","CostDeferred","RealTime","Immediate","EventPropertyType","Unspecified","Int32","UInt32","Int64","UInt64","Double","Bool","Guid","DateTime","_ExtendedInternalMessageId","__assign","AuthHandShakeError","AuthRedirectFail","CannotParseBiBlobValue","CannotParseDataAttribute","CVPluginNotAvailable","DroppedEvent","ErrorProvidedChannels","FailedToGetCookies","FailedToInitializeCorrelationVector","FailedToInitializeSDK","InvalidCorrelationValue","SendPostOnCompleteFailure","PostResponseHandler","SDKNotInitialized","Version","FullVersionString","strWithCredentials","_fieldTypeEventPropMap","uInt8ArraySupported","isDocumentObjectAvailable","isWindowObjectAvailable","isValueAssigned","getTenantId","apiKey","indexTenantId","isUint8ArrayAvailable","Uint8Array","ua","isSafariOrFirefox","isLatency","sanitizeProperty","stringifyObjects","propType","isArrayValid","kind","isValueKind","getCommonSchemaMetaData","encodedTypeValue","getFieldValueType","disableCookies","days","deleteCookie","getCookieValue","decode","decodeURIComponent","createGuid","style","theGuid","extend","obj2","obj3","obj4","obj5","extended","deep","strPrototype","theArgs","arrayValue","arrayIndex","setProcessTelemetryTimings","evt","timings","processTelemetryStart","Utils","strUndefined","strObject","Undefined","getISOString","cookieAvailable","disallowsSameSiteNone","CoreUtils","_canUseCookies","objCreate","mwcRandomSeed","PropVersion","pluginVersionStringArr","pluginVersionString","endpointUrl","propertyStorageOverride","getProperty","setProperty","channel","version","ver","getWParam","join","logger_1","itemProperties","trackStart","latency","itemExt","sdk","InternalCore","_isFunction","ESPromise","resolverFunc","_state","_settledValue","_queue","_enqueue","onResolved","onRejected","resolve","reject","then","_processQueue","pending_1","_reject","all","iterable","values_1","pending_2","_createPromiseAllOnResolvedFunction","race","_loop_1","_schedulerId","_running","_waiting","_timedOut","_getTime","ESPromiseScheduler","_promiseId","_scheduledName","_debugLog","log","_warnLog","_lastEvent","_eventCount","_removeQueuedEvent","eventId","id","scheduleEvent","startEventAction","timeout","eventDetails","waitForEvent","waitEvent","uniqueId","uniqueEventId","newScheduledEvent","tm","isRunning","isAborted","waitResolve","waitReject","runTime","prevId","abort","_startWaitingEvent","_schId","_abortAndRemoveOldEvents","eventQueue","expired","_cleanup","completed","toQueue","removed","clearTimeout","_removeScheduledEvent","_createScheduledEvent","startEvent","schEventResolve","schEventReject","wTm","startResult","_waitForFinalResult","theResult","incomplete","waitingToStart","ValueSanitizer","getFieldType","fieldSanitizerProvider","_sanitizerMap","_sanitizers","_fieldSanitizers","_getFieldSanitizer","fieldLookup","handleField","canHandle","fieldHandler","handler","_handleProperty","mapValue","fieldType","_callFieldSanitizer","fieldProvider","sanitizer","newValue_1","getSanitizer","propertyType","propKey","newProp","_convertToProperty","newPath","addSanitizer","newSanitizer","addFieldSanitizer","fieldSanitizer","subType","Critical","NONE","ERROR","INFORMATION","addPageHideEventListener","pageUnloadAdded","visibilityState","addPageShowEventListener","pageShowAdded","userAgentStr","navigator_1","parseInt","tridentVer","withKeepAlive","request","match","test","method","urlString","withCredentials","disabled","isSync","_wrapSetXhrProp","xhr","XMLHttpRequest","open","theObject","source","chkSet","checkValue","chkLen"],"mappings":";;;;;0CAEWA,EAAkB,WAClBC,EAAgB,SAChBC,EAAmB,YACnBC,EAAmB,YACnBC,EAAwB,iBAExBC,EAAWC,OACXC,EAAWF,EAASF,GACpBK,EAAYH,EAAiB,OAC7BI,EAAYJ,EAAiB,OAC7BK,EAAoBL,EAAyB,eAC7CM,EAAoBJ,EAASH,GCVpCQ,EAAgB,KAab,SAASC,EAAUC,GAgBtB,YAfkB,IAAdA,IAAwBA,GAAY,GACnCF,GAAkBE,WACRC,aAAeb,GAAoBa,aAC1CH,EAAgBG,mBAETC,OAASd,GAAoBc,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