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,WAAWlX,IAEhDvb,EAAK7N,OAAOC,EAAU,EAKPsM,QAFDA,CAACtM,EAAWmpB,IAAOiX,EAAeE,YAAYnX,EAAInpB,GAGpE","sources":["webpack://newpay/./.cache/api-runner-browser.js","webpack://newpay/./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","webpack://newpay/./node_modules/react-server-dom-webpack/cjs/react-server-dom-webpack.production.min.js","webpack://newpay/./node_modules/invariant/browser.js","webpack://newpay/./node_modules/@nevware21/ts-utils/dist/es5/mod/ts-utils.js","webpack://newpay/./node_modules/@microsoft/dynamicproto-js/dist-es5/DynamicProto.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-shims/dist-es5/Constants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-shims/dist-es5/TsLibShims.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InternalConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/HelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EnvUtils.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/RandomHelper.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DataCacheHelper.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaults.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicSupport.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicProperty.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AggregationError.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicState.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicConfig.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DbgExtensionUtils.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DiagnosticLogger.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK.Enums/EnumHelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Enums.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/StorageHelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/applicationinsights-common.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Constants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/DataSanitizer.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/TelemetryItemCreator.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Event.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Trace.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/DataPoint.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Metric.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/HelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/PageView.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/PageViewPerformance.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Exception.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/CoreUtils.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/W3cTraceParent.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/RequestResponseHeaders.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/UrlHelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Util.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/RemoteDependencyData.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/CookieMgr.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/DomHelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaultHelpers.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EventHelpers.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/PerfManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryHelpers.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHookContainer.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InstrumentHooks.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageViewManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/AnalyticsPlugin.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Timing.js","webpack://newpay/./node_modules/@nevware21/ts-async/dist/es5/mod/ts-async.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/CfgSyncHelperFuncs.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/CfgSyncPlugin.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Offline.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/Constants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/SenderPostManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AsyncUtils.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ResponseHelpers.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Interfaces/Contracts/ContextTagKeys.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Interfaces/PartAExtensions.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/Envelope.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/Data.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/InternalConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/EnvelopeCreator.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/SendBuffer.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/Sender.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/Serializer.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/Sample.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/ConnectionStringParser.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-common/dist-es5/ThrottleMgr.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/NotificationManager.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryInitializerPlugin.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AppInsightsCore.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/InternalConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/ajaxRecord.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/ajax.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Application.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Device.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Internal.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Location.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/__DynamicConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Session.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/TelemetryTrace.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/User.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/TelemetryContext.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-properties-js/dist-es5/PropertiesPlugin.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-web/dist-es5/AISku.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-web/dist-es5/InternalConstants.js","webpack://newpay/./node_modules/@microsoft/applicationinsights-web/dist-es5/__DynamicConstants.js","webpack://newpay/./src/utils/appinsights-service.js","webpack://newpay/./.cache/register-service-worker.js","webpack://newpay/./.cache/create-content-digest-browser-shim.js","webpack://newpay/./.cache/public-page-renderer-prod.js","webpack://newpay/./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","webpack://newpay/./.cache/slice/context.js","webpack://newpay/./node_modules/gatsby/dist/internal-plugins/partytown/gatsby-browser.js","webpack://newpay/./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js","webpack://newpay/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://newpay/./.cache/public-page-renderer.js","webpack://newpay/./src/styles/common/theme.js","webpack://newpay/./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","webpack://newpay/./node_modules/gatsby-react-router-scroll/scroll-handler.js","webpack://newpay/./node_modules/gatsby/dist/internal-plugins/partytown/utils/get-forwards.js","webpack://newpay/./node_modules/hoist-non-react-statics/node_modules/react-is/index.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://newpay/./node_modules/gatsby-react-router-scroll/use-scroll-restoration.js","webpack://newpay/./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://newpay/./src/components/common/HeaderButton/HeaderButton.style.js","webpack://newpay/./src/components/common/HeaderButton/HeaderButton.jsx","webpack://newpay/./node_modules/gatsby-react-router-scroll/session-storage.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://newpay/./node_modules/gatsby-plugin-manifest/get-manifest-pathname.js","webpack://newpay/./node_modules/@babel/runtime/helpers/extends.js","webpack://newpay/./node_modules/@builder.io/partytown/integration/index.cjs","webpack://newpay/./node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://newpay/./.cache/slice/server-slice-renderer.js","webpack://newpay/./.cache/slice/server-slice.js","webpack://newpay/./.cache/slice/inline-slice.js","webpack://newpay/./.cache/slice.js","webpack://newpay/./.cache/gatsby-browser-entry.js","webpack://newpay/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://newpay/./src/components/common/Logo/Default.jsx","webpack://newpay/./src/components/common/Logo/Outlined.jsx","webpack://newpay/./src/components/common/Logo/Logo.jsx","webpack://newpay/./node_modules/gatsby-script/dist/index.modern.mjs","webpack://newpay/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://newpay/./node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","webpack://newpay/./node_modules/stylis/src/Utility.js","webpack://newpay/./node_modules/stylis/src/Tokenizer.js","webpack://newpay/./node_modules/stylis/src/Enum.js","webpack://newpay/./node_modules/stylis/src/Serializer.js","webpack://newpay/./node_modules/stylis/src/Parser.js","webpack://newpay/./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","webpack://newpay/./node_modules/stylis/src/Middleware.js","webpack://newpay/./.cache/head/components/fire-callback-in-effect.js","webpack://newpay/./.cache/head/constants.js","webpack://newpay/./.cache/head/utils.js","webpack://newpay/./.cache/head/head-export-handler-for-browser.js","webpack://newpay/./.cache/page-renderer.js","webpack://newpay/./src/components/common/Icons/Close.jsx","webpack://newpay/./node_modules/@babel/runtime/helpers/inheritsLoose.js","webpack://newpay/./node_modules/gatsby-page-utils/dist/apply-trailing-slash-option.js","webpack://newpay/./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs","webpack://newpay/./.cache/redirect-utils.js","webpack://newpay/./.cache/route-announcer-props.js","webpack://newpay/./.cache/navigation.js","webpack://newpay/./node_modules/shallow-compare/es/index.js","webpack://newpay/./.cache/ensure-resources.js","webpack://newpay/./.cache/production-app.js","webpack://newpay/./.cache/prefetch.js","webpack://newpay/./.cache/loader.js","webpack://newpay/./.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js","webpack://newpay/./node_modules/gatsby-react-router-scroll/index.js","webpack://newpay/./node_modules/gatsby-link/dist/index.modern.mjs","webpack://newpay/./src/components/common/Footer/Footer.style.js","webpack://newpay/./src/components/common/Footer/Footer.jsx","webpack://newpay/./src/components/common/Icons/BurgerMenu.jsx","webpack://newpay/./src/components/common/StyledLink/StyledLink.jsx","webpack://newpay/./src/components/common/Header/Header.style.js","webpack://newpay/./src/components/common/Header/Header.jsx","webpack://newpay/./static/fonts/wallop/Wallop-Bold.woff2","webpack://newpay/./static/fonts/wallop/Wallop-Heavy.woff2","webpack://newpay/./static/fonts/wallop/Wallop-Light.woff2","webpack://newpay/./static/fonts/wallop/Wallop-Medium.woff2","webpack://newpay/./static/fonts/wallop/Wallop-Regular.woff2","webpack://newpay/./static/fonts/wallop/Wallop-SemiBold.woff2","webpack://newpay/./static/fonts/wallop/Wallop-Thin.woff2","webpack://newpay/./src/components/common/Layout/Layout.style.js","webpack://newpay/./node_modules/@newdaycards/ownbrands-library-cookieconsent/build/cookieconsent.js","webpack://newpay/./src/components/common/Layout/Layout.jsx","webpack://newpay/./.cache/static-query.js","webpack://newpay/./.cache/context-utils.js","webpack://newpay/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://newpay/./node_modules/@emotion/react/dist/emotion-react.browser.esm.js","webpack://newpay/./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","webpack://newpay/./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","webpack://newpay/./node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","webpack://newpay/./node_modules/@emotion/hash/dist/emotion-hash.esm.js","webpack://newpay/./node_modules/react-swipeable/es/index.js","webpack://newpay/./src/hooks/useCarouselBehavior/useCarouselBehavior.js","webpack://newpay/./src/hooks/useCurrentPageActiveLink/useCurrentPageActiveLink.js","webpack://newpay/./src/hooks/useCurrentSectionActiveLink/useCurrentSectionActiveLink.js","webpack://newpay/./node_modules/js-cookie/dist/js.cookie.mjs","webpack://newpay/./src/hooks/useGoogleTagManager/useGoogleTagManager.js","webpack://newpay/./src/hooks/usePageViewLog/usePageViewLog.js","webpack://newpay/./src/hooks/useScrollBehavior/useScrollBehavior.js","webpack://newpay/./src/hooks/useTrapFocus/useTrapFocus.js","webpack://newpay/./node_modules/gatsby-plugin-manifest/gatsby-browser.js","webpack://newpay/./gatsby-browser.js","webpack://newpay/./node_modules/react-server-dom-webpack/index.js","webpack://newpay/./src/components/common/SelectLink/SelectLink.jsx","webpack://newpay/./.cache/strip-prefix.js","webpack://newpay/./.cache/normalize-page-path.js","webpack://newpay/./.cache/find-path.js","webpack://newpay/./node_modules/gatsby/dist/internal-plugins/partytown/utils/inject-partytown-snippet.js","webpack://newpay/./.cache/emitter.js","webpack://newpay/./node_modules/mitt/dist/mitt.es.js","webpack://newpay/./.cache/api-runner-browser-plugins.js","webpack://newpay/./.cache/react-dom-utils.js"],"sourcesContent":["const plugins = require(`./api-runner-browser-plugins`)\nconst { getResourceURLsForPathname, loadPage, loadPageSync } =\n require(`./loader`).publicLoader\n\nexports.apiRunner = (api, args = {}, defaultReturn, argTransform) => {\n // Hooks for gatsby-cypress's API handler\n if (process.env.CYPRESS_SUPPORT) {\n if (window.___apiHandler) {\n window.___apiHandler(api)\n } else if (window.___resolvedAPIs) {\n window.___resolvedAPIs.push(api)\n } else {\n window.___resolvedAPIs = [api]\n }\n }\n\n let results = plugins.map(plugin => {\n if (!plugin.plugin[api]) {\n return undefined\n }\n\n args.getResourceURLsForPathname = getResourceURLsForPathname\n args.loadPage = loadPage\n args.loadPageSync = loadPageSync\n\n const result = plugin.plugin[api](args, plugin.options)\n if (result && argTransform) {\n args = argTransform({ args, result, plugin })\n }\n return result\n })\n\n // Filter out undefined results.\n results = results.filter(result => typeof result !== `undefined`)\n\n if (results.length > 0) {\n return results\n } else if (defaultReturn) {\n return [defaultReturn]\n } else {\n return []\n }\n}\n\nexports.apiRunnerAsync = (api, args, defaultReturn) =>\n plugins.reduce(\n (previous, next) =>\n next.plugin[api]\n ? previous.then(() => next.plugin[api](args, next.options))\n : previous,\n Promise.resolve()\n )\n","var isBrowser = true;\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/**\n * @license React\n * react-server-dom-webpack.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var k=require(\"react\"),l={stream:!0},n=new Map,p=Symbol.for(\"react.element\"),q=Symbol.for(\"react.lazy\"),r=Symbol.for(\"react.default_value\"),t=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function u(a){t[a]||(t[a]=k.createServerContext(a,r));return t[a]}function v(a,b,c){this._status=a;this._value=b;this._response=c}v.prototype.then=function(a){0===this._status?(null===this._value&&(this._value=[]),this._value.push(a)):a()};\nfunction w(a){switch(a._status){case 3:return a._value;case 1:var b=JSON.parse(a._value,a._response._fromJSON);a._status=3;return a._value=b;case 2:b=a._value;for(var c=b.chunks,d=0;d count ? strSlice(value, -count) : value);\n}\n\nvar UNIQUE_REGISTRY_ID = \"_urid\";\nvar _polySymbols;\n/*#__NO_SIDE_EFFECTS__*/\nfunction _globalSymbolRegistry() {\n if (!_polySymbols) {\n var gblCfg = _getGlobalConfig();\n _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} };\n }\n return _polySymbols;\n}\nvar _wellKnownSymbolCache;\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyNewSymbol(description) {\n var theSymbol = {\n description: asString(description),\n toString: function () { return SYMBOL + \"(\" + description + \")\"; }\n };\n theSymbol[POLYFILL_TAG] = true;\n return theSymbol;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polySymbolFor(key) {\n var registry = _globalSymbolRegistry();\n if (!objHasOwn(registry.k, key)) {\n var newSymbol_1 = polyNewSymbol(key);\n var regId_1 = objKeys(registry.s).length;\n newSymbol_1[UNIQUE_REGISTRY_ID] = function () { return regId_1 + \"_\" + newSymbol_1[TO_STRING](); };\n registry.k[key] = newSymbol_1;\n registry.s[newSymbol_1[UNIQUE_REGISTRY_ID]()] = asString(key);\n }\n return registry.k[key];\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polySymbolKeyFor(sym) {\n if (!sym || !sym[TO_STRING] || strSubstring(sym[TO_STRING](), 0, 6) != SYMBOL) {\n throwTypeError(sym + \" is not a symbol\");\n }\n var regId = sym[POLYFILL_TAG] && sym[UNIQUE_REGISTRY_ID] && sym[UNIQUE_REGISTRY_ID]();\n return regId ? _globalSymbolRegistry().s[regId] : undefined;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyGetKnownSymbol(name) {\n !_wellKnownSymbolCache && (_wellKnownSymbolCache = {});\n var result;\n var knownName = _wellKnownSymbolMap[name];\n if (knownName) {\n result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + \".\" + knownName);\n }\n return result;\n}\n\nvar _globalLazyTestHooks;\nfunction _initTestHooks() {\n _globalLazyTestHooks = _getGlobalConfig();\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getLazy(cb) {\n var lazyValue = {};\n !_globalLazyTestHooks && _initTestHooks();\n lazyValue.b = _globalLazyTestHooks.lzy;\n objDefineProp(lazyValue, \"v\", {\n configurable: true,\n get: function () {\n var result = cb();\n if (!_globalLazyTestHooks.lzy) {\n objDefineProp(lazyValue, \"v\", {\n value: result\n });\n }\n lazyValue.b = _globalLazyTestHooks.lzy;\n return result;\n }\n });\n return lazyValue;\n}\nfunction setBypassLazyCache(newValue) {\n !_globalLazyTestHooks && _initTestHooks();\n _globalLazyTestHooks.lzy = newValue;\n}\nfunction getWritableLazy(cb) {\n var lazyValue = {};\n !_globalLazyTestHooks && _initTestHooks();\n lazyValue.b = _globalLazyTestHooks.lzy;\n var _setValue = function (newValue) {\n objDefineProp(lazyValue, \"v\", {\n value: newValue,\n writable: true\n });\n if (lazyValue.b) {\n delete lazyValue.b;\n }\n };\n objDefineProp(lazyValue, \"v\", {\n configurable: true,\n get: function () {\n var result = cb();\n if (!_globalLazyTestHooks.lzy) {\n _setValue(result);\n }\n if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {\n lazyValue.b = _globalLazyTestHooks.lzy;\n }\n return result;\n },\n set: _setValue\n });\n return lazyValue;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction createCachedValue(value) {\n return objDefineProp({\n toJSON: function () { return value; }\n }, \"v\", { value: value });\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction createDeferredCachedValue(cb) {\n var theValue = {\n toJSON: function () { return theValue.v; }\n };\n return objDefineProp(theValue, \"v\", {\n get: function () {\n var result = cb();\n cb = NULL_VALUE;\n objDefineProp(theValue, \"v\", { value: result });\n return result;\n },\n configurable: true\n });\n}\n\nvar WINDOW = \"window\";\nvar _cachedGlobal;\nfunction _getGlobalInstFn(getFn, theArgs) {\n var cachedValue;\n return function () {\n !_globalLazyTestHooks && _initTestHooks();\n if (!cachedValue || _globalLazyTestHooks.lzy) {\n cachedValue = createCachedValue(safe(getFn, theArgs).v);\n }\n return cachedValue.v;\n };\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction lazySafeGetInst(name) {\n return getLazy(function () { return safe((getInst), [name]).v || UNDEF_VALUE; });\n}\nfunction getGlobal(useCached) {\n !_globalLazyTestHooks && _initTestHooks();\n if (!_cachedGlobal || useCached === false || _globalLazyTestHooks.lzy) {\n _cachedGlobal = createCachedValue(safe(_getGlobalValue).v || NULL_VALUE);\n }\n return _cachedGlobal.v;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getInst(name, useCached) {\n var gbl;\n if (!_cachedGlobal || useCached === false) {\n gbl = getGlobal(useCached);\n }\n else {\n gbl = _cachedGlobal.v;\n }\n if (gbl && gbl[name]) {\n return gbl[name];\n }\n if (name === WINDOW) {\n try {\n return window;\n }\n catch (e) {\n }\n }\n return NULL_VALUE;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasDocument() {\n return !!( /*#__PURE__*/getDocument());\n}\nvar getDocument = ( /*#__PURE__*/_getGlobalInstFn(getInst, [\"document\"]));\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasWindow() {\n return !!( /*#__PURE__*/getWindow());\n}\nvar getWindow = ( /*#__PURE__*/_getGlobalInstFn(getInst, [WINDOW]));\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasNavigator() {\n return !!( /*#__PURE__*/getNavigator());\n}\nvar getNavigator = ( /*#__PURE__*/_getGlobalInstFn(getInst, [\"navigator\"]));\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasHistory() {\n return !!( /*#__PURE__*/getHistory());\n}\nvar getHistory = ( /*#__PURE__*/_getGlobalInstFn(getInst, [\"history\"]));\nvar isNode = ( /*#__PURE__*/_getGlobalInstFn(function () {\n return !!( /*#__PURE__*/safe(function () { return (process && (process.versions || {}).node); }).v);\n}));\nvar isWebWorker = ( /*#__PURE__*/_getGlobalInstFn(function () {\n return !!( /*#__PURE__*/safe(function () { return self && self instanceof WorkerGlobalScope; }).v);\n}));\n\nvar _symbol;\nvar _symbolFor;\nvar _symbolKeyFor;\n/*#__NO_SIDE_EFFECTS__*/\nfunction _initSymbol() {\n _symbol = ( /*#__PURE__*/createCachedValue(safe((getInst), [SYMBOL]).v));\n return _symbol;\n}\nfunction _getSymbolKey(key) {\n var gblSym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\n return (gblSym.v ? gblSym.v[key] : UNDEF_VALUE);\n}\nvar isSymbol = ( /*#__PURE__*/_createIs(\"symbol\"));\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasSymbol() {\n return !!( /*#__PURE__*/getSymbol());\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getSymbol() {\n !_globalLazyTestHooks && _initTestHooks();\n return ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol()).v;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getKnownSymbol(name, noPoly) {\n var knownName = _wellKnownSymbolMap[name];\n !_globalLazyTestHooks && _initTestHooks();\n var sym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\n return sym.v ? sym.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction newSymbol(description, noPoly) {\n !_globalLazyTestHooks && _initTestHooks();\n var sym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\n return sym.v ? sym.v(description) : (!noPoly ? polyNewSymbol(description) : NULL_VALUE);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction symbolFor(key) {\n !_globalLazyTestHooks && _initTestHooks();\n _symbolFor = ((!_globalLazyTestHooks.lzy ? _symbolFor : 0) || ( /*#__PURE__*/createCachedValue(safe((_getSymbolKey), [\"for\"]).v)));\n return (_symbolFor.v || polySymbolFor)(key);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction symbolKeyFor(sym) {\n !_globalLazyTestHooks && _initTestHooks();\n _symbolKeyFor = ((!_globalLazyTestHooks.lzy ? _symbolKeyFor : 0) || ( /*#__PURE__*/createCachedValue(safe((_getSymbolKey), [\"keyFor\"]).v)));\n return (_symbolKeyFor.v || polySymbolKeyFor)(sym);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction isIterator(value) {\n return !!value && isFunction(value.next);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction isIterable(value) {\n return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]);\n}\n\nvar _iterSymbol$1;\nfunction iterForOf(iter, callbackfn, thisArg) {\n if (iter) {\n if (!isIterator(iter)) {\n !_iterSymbol$1 && (_iterSymbol$1 = createCachedValue(getKnownSymbol(3 )));\n iter = iter[_iterSymbol$1.v] ? iter[_iterSymbol$1.v]() : NULL_VALUE;\n }\n if (isIterator(iter)) {\n var err = UNDEF_VALUE;\n var iterResult = UNDEF_VALUE;\n try {\n var count = 0;\n while (!(iterResult = iter.next()).done) {\n if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {\n break;\n }\n count++;\n }\n }\n catch (failed) {\n err = { e: failed };\n if (iter.throw) {\n iterResult = NULL_VALUE;\n iter.throw(err);\n }\n }\n finally {\n try {\n if (iterResult && !iterResult.done) {\n iter.return && iter.return(iterResult);\n }\n }\n finally {\n if (err) {\n // eslint-disable-next-line no-unsafe-finally\n throw err.e;\n }\n }\n }\n }\n }\n}\n\nfunction fnApply(fn, thisArg, argArray) {\n return fn.apply(thisArg, argArray);\n}\nfunction fnCall(fn, thisArg) {\n return fn.apply(thisArg, ArrSlice[CALL](arguments, 2));\n}\nfunction fnBind(fn, thisArg) {\n return fn.bind.apply(fn, ArrSlice[CALL](arguments, 1));\n}\n\nfunction arrAppend(target, elms) {\n if (!isUndefined(elms) && target) {\n if (isArray(elms)) {\n fnApply(target.push, target, elms);\n }\n else if (isIterator(elms) || isIterable(elms)) {\n iterForOf(elms, function (elm) {\n target.push(elm);\n });\n }\n else {\n target.push(elms);\n }\n }\n return target;\n}\n\nvar arrEvery = /*#__PURE__*/ _unwrapFunction(\"every\", ArrProto);\nvar arrFilter = /*#__PURE__*/ _unwrapFunction(\"filter\", ArrProto);\n\nfunction arrForEach(theArray, callbackfn, thisArg) {\n if (theArray) {\n var len = theArray[LENGTH] >>> 0;\n for (var idx = 0; idx < len; idx++) {\n if (idx in theArray) {\n if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {\n break;\n }\n }\n }\n }\n}\n\nvar arrIndexOf = ( /*#__PURE__*/_unwrapFunction(\"indexOf\", ArrProto));\nvar arrLastIndexOf = ( /*#__PURE__*/_unwrapFunction(\"lastIndexOf\", ArrProto));\n\nvar arrMap = ( /*#__PURE__*/_unwrapFunction(\"map\", ArrProto));\n\nfunction arrSlice(theArray, start, end) {\n return ((theArray ? theArray[\"slice\"] : NULL_VALUE) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyIsArray(value) {\n if (isNullOrUndefined(value)) {\n return false;\n }\n return objToString(value) === \"[object Array]\";\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyArrIncludes(theArray, searchElement, fromIndex) {\n return arrIndexOf(theArray, searchElement, fromIndex) !== -1;\n}\nfunction polyArrFind(theArray, callbackFn, thisArg) {\n var result;\n var idx = polyArrFindIndex(theArray, callbackFn, thisArg);\n return idx !== -1 ? theArray[idx] : result;\n}\nfunction polyArrFindIndex(theArray, callbackFn, thisArg) {\n var result = -1;\n arrForEach(theArray, function (value, index) {\n if (callbackFn[CALL](thisArg | theArray, value, index, theArray)) {\n result = index;\n return -1;\n }\n });\n return result;\n}\nfunction polyArrFindLast(theArray, callbackFn, thisArg) {\n var result;\n var idx = polyArrFindLastIndex(theArray, callbackFn, thisArg);\n return idx !== -1 ? theArray[idx] : result;\n}\nfunction polyArrFindLastIndex(theArray, callbackFn, thisArg) {\n var result = -1;\n var len = theArray[LENGTH] >>> 0;\n for (var idx = len - 1; idx >= 0; idx--) {\n if (idx in theArray && callbackFn[CALL](thisArg | theArray, theArray[idx], idx, theArray)) {\n result = idx;\n break;\n }\n }\n return result;\n}\nfunction polyArrFrom(theValue, mapFn, thisArg) {\n if (isArray(theValue)) {\n var result_1 = arrSlice(theValue);\n return mapFn ? arrMap(result_1, mapFn, thisArg) : result_1;\n }\n var result = [];\n iterForOf(theValue, function (value, cnt) {\n return result.push(mapFn ? mapFn[CALL](thisArg, value, cnt) : value);\n });\n return result;\n}\n\nvar arrFind = /*#__PURE__*/ _unwrapFunctionWithPoly(\"find\", ArrProto, polyArrFind);\nvar arrFindIndex = /*#__PURE__*/ _unwrapFunctionWithPoly(\"findIndex\", ArrProto, polyArrFindIndex);\nvar arrFindLast = /*#__PURE__*/ _unwrapFunctionWithPoly(\"findLast\", ArrProto, polyArrFindLast);\nvar arrFindLastIndex = /*#__PURE__*/ _unwrapFunctionWithPoly(\"findLastIndex\", ArrProto, polyArrFindLastIndex);\n\nvar arrFrom = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ArrCls, \"from\")), polyArrFrom));\n\nvar arrIncludes = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"includes\", ArrProto, polyArrIncludes));\nvar arrContains = arrIncludes;\n\nvar arrReduce = ( /*#__PURE__*/_unwrapFunction(\"reduce\", ArrProto));\n\nvar arrSome = ( /*#__PURE__*/_unwrapFunction(\"some\", ArrProto));\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction createFnDeferredProxy(hostFn, funcName) {\n return function () {\n var theArgs = ArrSlice[CALL](arguments);\n var theHost = hostFn();\n return fnApply(theHost[funcName], theHost, theArgs);\n };\n}\nfunction createProxyFuncs(target, host, funcDefs) {\n if (target && host && isArray(funcDefs)) {\n var isDeferred_1 = isFunction(host);\n arrForEach(funcDefs, function (funcDef) {\n var targetName = (funcDef.as || funcDef.n);\n if (funcDef.rp === false && target[targetName]) {\n return;\n }\n target[targetName] = isDeferred_1 ?\n createFnDeferredProxy(host, funcDef.n) :\n fnBind(host[funcDef.n], host);\n });\n }\n return target;\n}\n\nvar _iterSymbol;\n/*#__NO_SIDE_EFFECTS__*/\nfunction readArgs(theArgs, start, end) {\n if (!objHasOwn(theArgs, LENGTH)) {\n !_iterSymbol && (_iterSymbol = createCachedValue(hasSymbol() && getKnownSymbol(3 )));\n var iterFn = void 0;\n if (_iterSymbol.v) {\n iterFn = theArgs[_iterSymbol.v];\n }\n if (iterFn) {\n var values_1 = [];\n var from_1 = (start === UNDEF_VALUE || start < 0) ? 0 : start;\n var to_1 = end < 0 || start < 0 ? UNDEF_VALUE : end;\n iterForOf(iterFn[CALL](theArgs), function (value, cnt) {\n if (to_1 !== UNDEF_VALUE && cnt >= to_1) {\n return -1;\n }\n if (cnt >= from_1) {\n values_1.push(value);\n }\n });\n if ((start === UNDEF_VALUE || start >= 0) && (end === UNDEF_VALUE || end >= 0)) {\n return values_1;\n }\n theArgs = values_1;\n }\n }\n return arrSlice(theArgs, start, end);\n}\n\nvar objCreate = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, \"create\")), polyObjCreate));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyObjCreate(obj) {\n if (!obj) {\n return {};\n }\n var type = typeof obj;\n if (type !== OBJECT && type !== FUNCTION) {\n throwTypeError(\"Prototype must be an Object or function: \" + dumpObj(obj));\n }\n function tempFunc() { }\n tempFunc[PROTOTYPE] = obj;\n return new tempFunc();\n}\n\nvar _isProtoArray;\nfunction objSetPrototypeOf(obj, proto) {\n var fn = ObjClass[\"setPrototypeOf\"] ||\n function (d, b) {\n var _a;\n !_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));\n _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; });\n };\n return fn(obj, proto);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createCustomError(name, d, b) {\n safe(objDefine, [d, NAME, { v: name, c: true, e: false }]);\n d = objSetPrototypeOf(d, b);\n function __() {\n this[CONSTRUCTOR] = d;\n safe(objDefine, [this, NAME, { v: name, c: true, e: false }]);\n }\n d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : (__[PROTOTYPE] = b[PROTOTYPE], new __());\n return d;\n}\nfunction _setName(baseClass, name) {\n name && (baseClass[NAME] = name);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction createCustomError(name, constructCb, errorBase) {\n var theBaseClass = errorBase || Error;\n var orgName = theBaseClass[PROTOTYPE][NAME];\n var captureFn = Error.captureStackTrace;\n return _createCustomError(name, function () {\n var _this = this;\n var theArgs = arguments;\n try {\n safe(_setName, [theBaseClass, name]);\n var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;\n if (_self !== _this) {\n var orgProto = objGetPrototypeOf(_this);\n if (orgProto !== objGetPrototypeOf(_self)) {\n objSetPrototypeOf(_self, orgProto);\n }\n }\n captureFn && captureFn(_self, _this[CONSTRUCTOR]);\n constructCb && constructCb(_self, theArgs);\n return _self;\n }\n finally {\n safe(_setName, [theBaseClass, orgName]);\n }\n }, theBaseClass);\n}\nvar _unsupportedError;\nfunction throwUnsupported(message) {\n if (!_unsupportedError) {\n _unsupportedError = createCustomError(\"UnsupportedError\");\n }\n throw new _unsupportedError(message);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction utcNow() {\n return (Date.now || polyUtcNow)();\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyUtcNow() {\n return new Date().getTime();\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createTrimFn(exp) {\n return function _doTrim(value) {\n if (isNullOrUndefined(value)) {\n throwTypeError(\"strTrim called [\" + dumpObj(value) + \"]\");\n }\n if (value && value.replace) {\n value = value.replace(exp, EMPTY);\n }\n return value;\n };\n}\nvar polyStrTrim = ( /*#__PURE__*/_createTrimFn(/^\\s+|(?=\\s)\\s+$/g));\nvar polyStrTrimStart = ( /*#__PURE__*/_createTrimFn(/^\\s+/g));\nvar polyStrTrimEnd = ( /*#__PURE__*/_createTrimFn(/(?=\\s)\\s+$/g));\n\nvar strTrim = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"trim\", StrProto, polyStrTrim));\nvar strTrimStart = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"trimStart\", StrProto, polyStrTrimStart));\nvar strTrimLeft = ( /*#__PURE__*/_pureAssign(strTrimStart));\nvar strTrimEnd = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"trimEnd\", StrProto, polyStrTrimEnd));\nvar strTrimRight = ( /*#__PURE__*/_pureAssign(strTrimEnd));\n\nvar strUpper = ( /*#__PURE__*/_unwrapFunction(\"toUpperCase\", StrProto));\nvar strLower = ( /*#__PURE__*/_unwrapFunction(\"toLowerCase\", StrProto));\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _convertCase(value, newPrefix, upperWord) {\n return strTrim(asString(value)).replace(/((_|\\W)+(\\w){0,1}|([a-z])([A-Z]))/g, function (_match, _g1, _g2, wordStart, upperPrefix, upperLetter) {\n var convertMatch = wordStart || upperLetter || EMPTY;\n if (upperWord) {\n convertMatch = strUpper(convertMatch);\n }\n return (upperPrefix || EMPTY) + newPrefix + convertMatch;\n });\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction strLetterCase(value) {\n return asString(value).replace(/(_|\\b)\\w/g, strUpper);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction strCamelCase(value, upperFirst) {\n var result = _convertCase(value, \"\", true);\n return result.replace(/^\\w/, upperFirst ? strUpper : strLower);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction strKebabCase(value, scream) {\n var result = _convertCase(value, \"-\");\n return (scream ? strUpper : strLower)(result);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction strSnakeCase(value, scream) {\n var result = _convertCase(value, \"_\");\n return (scream ? strUpper : strLower)(result);\n}\n\nvar mathFloor = ( /*#__PURE__*/_pureRef(MathCls, \"floor\"));\nvar mathCeil = ( /*#__PURE__*/_pureRef(MathCls, \"ceil\"));\n\nvar mathTrunc = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(MathCls, \"trunc\")), polyMathTrunc));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyMathTrunc(value) {\n var theValue = +value;\n return (theValue > 0 ? mathFloor : mathCeil)(theValue);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction mathToInt(value, throwInfinity) {\n var result = +value;\n if (result == Infinity && throwInfinity) {\n throwRangeError(\"invalid value [\" + dumpObj(value) + \"]\");\n }\n return result !== result || result === 0 ? 0 : mathTrunc(result);\n}\n\nvar strRepeat = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"repeat\", StrProto, polyStrRepeat));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrRepeat(value, count) {\n if (isNullOrUndefined(value)) {\n throwTypeError(\"can't convert [\" + dumpObj(value) + \"]\");\n }\n count = mathToInt(count, true);\n if (count < 0) {\n throwRangeError(\"invalid count must be >= 0 && < Infinity\");\n }\n var pad = isString(value) ? value : asString(value);\n var result = EMPTY;\n for (; count > 0; (count >>>= 1) && (pad += pad)) {\n if (count & 1) {\n result += pad;\n }\n }\n return result;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _padValue(value, targetLength, padString) {\n var result = EMPTY;\n targetLength = mathToInt(targetLength, true);\n targetLength >>= 0;\n var len = value[LENGTH];\n if (len < targetLength) {\n result = isNullOrUndefined(padString) ? \" \" : asString(padString);\n targetLength = targetLength - len;\n if (targetLength > result[LENGTH]) {\n result = strRepeat(result, mathCeil(targetLength / result[LENGTH]));\n }\n if (result[LENGTH] > targetLength) {\n result = strSubstring(result, 0, targetLength);\n }\n }\n return result;\n}\nvar strPadStart = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"padStart\", StrProto, polyStrPadStart));\nvar strPadEnd = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"padEnd\", StrProto, polyStrPadEnd));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrPadStart(value, targetLength, padString) {\n return _padValue(value, targetLength, padString) + value;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrPadEnd(value, targetLength, padString) {\n return value + _padValue(value, targetLength, padString);\n}\n\nvar DBL_QUOTE = \"\\\"\";\nvar INVALID_JS_NAME = /([^\\w\\d_$])/g;\nvar _htmlEntityCache;\n/*#__NO_SIDE_EFFECTS__*/\nfunction normalizeJsName(jsName, camelCase) {\n var result = asString(jsName).replace(INVALID_JS_NAME, \"_\");\n return !isUndefined(camelCase) ? strCamelCase(result, !camelCase) : result;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction encodeAsJson(value, format) {\n var result;\n if (isString(value)) {\n result = DBL_QUOTE + value.replace(/[^\\w .,\\-!@#$%\\^&*\\(\\)_+={}\\[\\]:;|<>?]/g, function (match) {\n if (match === DBL_QUOTE || match === \"\\\\\") {\n return \"\\\\\" + match;\n }\n var hex = match.charCodeAt(0)[TO_STRING](16);\n return \"\\\\u\" + strPadStart(strUpper(hex), 4, \"0\");\n }) + DBL_QUOTE;\n }\n else {\n try {\n result = JSON.stringify(value, NULL_VALUE, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);\n }\n catch (e) {\n result = DBL_QUOTE + dumpObj(e) + DBL_QUOTE;\n }\n }\n return result;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction encodeAsHtml(value) {\n !_htmlEntityCache && (_htmlEntityCache = {\n \"&\": \"amp\",\n \"<\": \"lt\",\n \">\": \"gt\",\n \"\\\"\": \"quot\",\n \"'\": \"#39\"\n });\n return asString(value).replace(/[&<>\"']/g, function (match) { return \"&\" + _htmlEntityCache[match] + \";\"; });\n}\n\nvar _fnToString;\nvar _objCtrFnString;\nvar _gblWindow;\n/*#__NO_SIDE_EFFECTS__*/\nfunction isPlainObject(value) {\n if (!value || typeof value !== OBJECT) {\n return false;\n }\n if (!_gblWindow) {\n _gblWindow = hasWindow() ? getWindow() : true;\n }\n var result = false;\n if (value !== _gblWindow) {\n if (!_objCtrFnString) {\n _fnToString = Function[PROTOTYPE][TO_STRING];\n _objCtrFnString = _fnToString[CALL](ObjClass);\n }\n try {\n var proto = objGetPrototypeOf(value);\n result = !proto;\n if (!result) {\n if (objHasOwnProperty(proto, CONSTRUCTOR)) {\n proto = proto[CONSTRUCTOR];\n }\n result = !!(proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString);\n }\n }\n catch (ex) {\n }\n }\n return result;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _defaultDeepCopyHandler(details) {\n details.value && plainObjDeepCopyHandler(details);\n return true;\n}\nvar defaultDeepCopyHandlers = [\n arrayDeepCopyHandler,\n plainObjDeepCopyHandler,\n functionDeepCopyHandler,\n dateDeepCopyHandler\n];\n/*#__NO_SIDE_EFFECTS__*/\nfunction _getSetVisited(visitMap, source, newPath, cb) {\n var theEntry;\n arrForEach(visitMap, function (entry) {\n if (entry.k === source) {\n theEntry = entry;\n return -1;\n }\n });\n if (!theEntry) {\n theEntry = { k: source, v: source };\n visitMap.push(theEntry);\n cb(theEntry);\n }\n return theEntry.v;\n}\nfunction _deepCopy(visitMap, value, ctx, key) {\n var userHandler = ctx.handler;\n var newPath = ctx.path ? (key ? ctx.path.concat(key) : ctx.path) : [];\n var newCtx = {\n handler: ctx.handler,\n src: ctx.src,\n path: newPath\n };\n var theType = typeof value;\n var isPlain = false;\n var isPrim = value === NULL_VALUE;\n if (!isPrim) {\n if (value && theType === OBJECT) {\n isPlain = isPlainObject(value);\n }\n else {\n isPrim = isPrimitiveType(theType);\n }\n }\n var details = {\n type: theType,\n isPrim: isPrim,\n isPlain: isPlain,\n value: value,\n result: value,\n path: newPath,\n origin: ctx.src,\n copy: function (source, newKey) {\n return _deepCopy(visitMap, source, newKey ? newCtx : ctx, newKey);\n },\n copyTo: function (target, source) {\n return _copyProps(visitMap, target, source, newCtx);\n }\n };\n if (!details.isPrim) {\n return _getSetVisited(visitMap, value, newPath, function (newEntry) {\n objDefine(details, \"result\", {\n g: function () {\n return newEntry.v;\n },\n s: function (newValue) {\n newEntry.v = newValue;\n }\n });\n var idx = 0;\n var handler = userHandler;\n while (!(handler || (idx < defaultDeepCopyHandlers.length ? defaultDeepCopyHandlers[idx++] : _defaultDeepCopyHandler))[CALL](ctx, details)) {\n handler = NULL_VALUE;\n }\n });\n }\n if (userHandler && userHandler[CALL](ctx, details)) {\n return details.result;\n }\n return value;\n}\nfunction _copyProps(visitMap, target, source, ctx) {\n if (!isNullOrUndefined(source)) {\n for (var key in source) {\n target[key] = _deepCopy(visitMap, source[key], ctx, key);\n }\n }\n return target;\n}\nfunction objCopyProps(target, source, handler) {\n var ctx = {\n handler: handler,\n src: source,\n path: []\n };\n return _copyProps([], target, source, ctx);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction objDeepCopy(source, handler) {\n var ctx = {\n handler: handler,\n src: source\n };\n return _deepCopy([], source, ctx);\n}\nfunction arrayDeepCopyHandler(details) {\n var value = details.value;\n if (isArray(value)) {\n var target = details.result = [];\n target.length = value.length;\n details.copyTo(target, value);\n return true;\n }\n return false;\n}\nfunction dateDeepCopyHandler(details) {\n var value = details.value;\n if (isDate(value)) {\n details.result = new Date(value.getTime());\n return true;\n }\n return false;\n}\nfunction functionDeepCopyHandler(details) {\n if (details.type === FUNCTION) {\n return true;\n }\n return false;\n}\nfunction plainObjDeepCopyHandler(details) {\n var value = details.value;\n if (value && details.isPlain) {\n var target = details.result = {};\n details.copyTo(target, value);\n return true;\n }\n return false;\n}\n\nfunction _doExtend(target, theArgs) {\n arrForEach(theArgs, function (theArg) {\n objCopyProps(target, theArg);\n });\n return target;\n}\nfunction deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) {\n return _doExtend(objDeepCopy(target) || {}, ArrSlice[CALL](arguments));\n}\nfunction objExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) {\n return _doExtend(target || {}, ArrSlice[CALL](arguments));\n}\n\nvar getLength = ( /*#__PURE__*/_unwrapProp(LENGTH));\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction getIntValue(value, defValue) {\n if (!isNullOrUndefined(value)) {\n if (isNumber(value)) {\n return value;\n }\n var theValue = parseInt(value, 10);\n return isNaN(theValue) ? defValue : theValue;\n }\n return defValue;\n}\n\nvar _perf;\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasPerformance() {\n return !!getPerformance();\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getPerformance() {\n !_globalLazyTestHooks && _initTestHooks();\n if (!_perf || _globalLazyTestHooks.lzy) {\n _perf = createCachedValue(safe((getInst), [\"performance\"]).v);\n }\n return _perf.v;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction perfNow() {\n var perf = getPerformance();\n if (perf && perf.now) {\n return perf.now();\n }\n return utcNow();\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction elapsedTime(startTime) {\n return perfNow() - startTime;\n}\n\nvar MATCH_ANY = \"(.*)\";\nvar MATCH_SINGLE = \"(.)\";\nfunction _createRegExp(value, escapeRgx, replaceFn, ignoreCase, fullMatch) {\n // eslint-disable-next-line security/detect-non-literal-regexp\n return new RegExp((fullMatch ? \"^\" : EMPTY) + replaceFn(value.replace(escapeRgx, \"\\\\$1\")) + (fullMatch ? \"$\" : EMPTY), ignoreCase ? \"i\" : \"\");\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction createWildcardRegex(value, ignoreCase, fullMatch) {\n return _createRegExp(asString(value), /([-+|^$#.\\?{}()\\[\\]\\\\/\\\"\\'])/g, function (value) {\n return value.replace(/\\*/g, MATCH_ANY);\n }, !!ignoreCase, fullMatch);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction createFilenameRegex(value, ignoreCase, fullMatch) {\n return _createRegExp(asString(value), /([-+|^$#.{}()\\\\\\/\\[\\]\\\"\\'])/g, function (value) {\n return value.replace(/(\\\\\\\\|\\\\\\/|\\*|\\?)/g, function (_all, g1) {\n if (g1 == \"\\\\/\" || g1 == \"\\\\\\\\\") {\n return \"[\\\\\\\\\\\\/]{1}\";\n }\n return g1 == \"*\" ? MATCH_ANY : MATCH_SINGLE;\n });\n }, !!ignoreCase, fullMatch);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction makeGlobRegex(value, ignoreCase, fullMatch) {\n return _createRegExp(asString(value), /([-+|^$#.{}()\\\\\\/\\[\\]\\\"\\'])/g, function (value) {\n return value.replace(/(\\*\\*\\\\[\\\\\\/]|\\\\\\\\|\\\\\\/|\\*\\*|\\*|\\?)/g, function (_all, g1) {\n if (g1 == \"**\\\\/\" || g1 == \"**\\\\\\\\\") {\n return \"(.*[\\\\\\\\\\\\/])*\";\n }\n if (g1 === \"\\\\/\" || g1 == \"\\\\\\\\\") {\n return \"[\\\\\\\\\\\\/]{1}\";\n }\n if (g1 === \"**\") {\n return MATCH_ANY;\n }\n return g1 === \"*\" ? \"([^\\\\\\\\\\\\/]*)\" : \"([^\\\\\\\\\\\\/]{1})\";\n });\n }, !!ignoreCase, fullMatch);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction safeGetLazy(cb, defValue) {\n return getLazy(function () {\n var result = safe(cb);\n return result.e ? defValue : result.v;\n });\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction safeGetWritableLazy(cb, defValue) {\n return getWritableLazy(function () {\n var result = safe(cb);\n return result.e ? defValue : result.v;\n });\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _checkLength(value, props) {\n var result;\n arrForEach(props, function (prop) {\n if (prop in value) {\n var propValue = value[prop];\n result = (isFunction(propValue) ? propValue() : propValue) > 0;\n return -1;\n }\n });\n return result;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _hasValue(value, depth) {\n var result = value === false || value === 0;\n if (!result && !isNullOrUndefined(value)) {\n if (isArray(value)) {\n result = value[LENGTH] > 0;\n }\n else if (isDate(value)) {\n result = !isNaN(value.getTime());\n }\n else if (isBoolean(value)) {\n return true;\n }\n else if (isObject(value)) {\n try {\n var chkValue = _checkLength(value, [LENGTH, \"byteLength\", \"size\", \"count\"]);\n if (isBoolean(chkValue)) {\n return chkValue;\n }\n if (isFunction(value.valueOf) && depth < 5) {\n return _hasValue(value.valueOf(), ++depth);\n }\n }\n catch (e) {\n }\n return !!objKeys(value)[LENGTH];\n }\n else {\n result = isTruthy(value);\n }\n }\n return result;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasValue(value) {\n return _hasValue(value, 0);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction createIterable(ctx) {\n return makeIterable({}, ctx);\n}\nfunction makeIterable(target, ctx) {\n var itSymbol = getKnownSymbol(3 );\n function _createIterator() {\n return createIterator(ctx);\n }\n target[itSymbol] = _createIterator;\n return target;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction createIterator(ctx) {\n var isDone = false;\n function _value() {\n return ctx.v;\n }\n function _next() {\n if (!isDone) {\n isDone = (ctx.n ? ctx.n(arguments) : true);\n }\n var result = {\n done: isDone\n };\n if (!isDone) {\n objDefine(result, \"value\", { g: _value });\n }\n return result;\n }\n function _return(value) {\n isDone = true;\n return {\n done: true,\n value: ctx.r && ctx.r(value)\n };\n }\n function _throw(e) {\n isDone = true;\n return {\n done: true,\n value: ctx.t && ctx.t(e)\n };\n }\n var theIterator = {\n next: _next\n };\n if (ctx.r) {\n theIterator.return = _return;\n }\n if (ctx.t) {\n theIterator.throw = _throw;\n }\n return theIterator;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction createArrayIterator(values) {\n var idx = -1;\n var theValues = values ? values.slice() : [];\n var len = theValues[LENGTH];\n function _value() {\n if (idx >= 0 && idx < len) {\n return theValues[idx];\n }\n }\n function _getNext() {\n idx++;\n return idx >= len;\n }\n var ctx = {\n n: _getNext\n };\n objDefine(ctx, \"v\", { g: _value });\n return createIterator(ctx);\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction createRangeIterator(start, end, step) {\n var nextValue = start;\n var theValue = UNDEF_VALUE;\n if (isNullOrUndefined(end)) {\n end = start;\n }\n var theStep = step;\n if (!theStep) {\n theStep = (start <= end) ? 1 : -1;\n }\n function _value() {\n return theValue;\n }\n function _getNext() {\n var isDone = (theStep > 0) ? (nextValue > end) : (nextValue < end);\n if (!isDone) {\n theValue = nextValue;\n nextValue += theStep;\n }\n return isDone;\n }\n return createIterator(objDefine({\n n: _getNext\n }, \"v\", { g: _value }));\n}\n\nvar mathRound = ( /*#__PURE__*/_pureRef(MathCls, \"round\"));\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrSymSplit(value, splitter, limit) {\n var splitFn = splitter ? splitter[getKnownSymbol(9 )] : UNDEF_VALUE;\n return splitFn ? splitFn(value, limit) : [value];\n}\n\nvar strSplit = ( /*#__PURE__*/_unwrapFunction(\"split\", StrProto));\nvar strSymSplit = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"split\", StrProto, !hasSymbol() ? polyStrSymSplit : NULL_VALUE));\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction getValueByKey(target, path, defValue) {\n if (!path || !target) {\n return defValue;\n }\n var parts = strSplit(path, \".\");\n var cnt = parts.length;\n for (var lp = 0; lp < cnt && !isNullOrUndefined(target); lp++) {\n target = target[parts[lp]];\n }\n return (!isNullOrUndefined(target) ? target : defValue);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction getValueByIter(target, iter, defValue) {\n if (!iter || !target) {\n return defValue;\n }\n iterForOf(iter, function (value) {\n if (isNullOrUndefined(target)) {\n return -1;\n }\n target = target[value];\n });\n return (!isNullOrUndefined(target) ? target : defValue);\n}\nfunction setValueByKey(target, path, value) {\n if (target && path) {\n var parts = strSplit(path, \".\");\n var lastKey = parts.pop();\n arrForEach(parts, function (key) {\n if (isNullOrUndefined(target[key])) {\n target[key] = {};\n }\n target = target[key];\n });\n target[lastKey] = value;\n }\n}\nfunction setValueByIter(target, iter, value) {\n if (target && iter) {\n var lastKey_1;\n iterForOf(iter, function (key) {\n if (lastKey_1) {\n if (isNullOrUndefined(target[lastKey_1])) {\n target[lastKey_1] = {};\n }\n target = target[lastKey_1];\n }\n lastKey_1 = key;\n });\n target[lastKey_1] = value;\n }\n}\n\nvar strEndsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"endsWith\", StrProto, polyStrEndsWith));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrEndsWith(value, searchString, length) {\n if (!isString(value)) {\n throwTypeError(\"'\" + dumpObj(value) + \"' is not a string\");\n }\n var searchValue = isString(searchString) ? searchString : asString(searchString);\n var end = (!isUndefined(length) && length < value[LENGTH]) ? length : value[LENGTH];\n return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;\n}\n\nvar strIndexOf = ( /*#__PURE__*/_unwrapFunction(\"indexOf\", StrProto));\nvar strLastIndexOf = ( /*#__PURE__*/_unwrapFunction(\"lastIndexOf\", StrProto));\n\nvar strIncludes = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"includes\", StrProto, polyStrIncludes));\nvar strContains = ( /*#__PURE__*/_pureAssign(strIncludes));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrIncludes(value, searchString, position) {\n if (isRegExp(searchString)) {\n throwTypeError(\"'searchString' must not be a regular expression\" + dumpObj(searchString));\n }\n return strIndexOf(value, asString(searchString), position) !== -1;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction strIsNullOrWhiteSpace(value) {\n if (isString(value)) {\n return value.replace(/[\\s\\t\\r\\n\\f]+/g, EMPTY) === EMPTY;\n }\n return isNullOrUndefined(value);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction strIsNullOrEmpty(value) {\n if (isString(value)) {\n return value === EMPTY;\n }\n return isNullOrUndefined(value);\n}\n\nvar strStartsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly(\"startsWith\", StrProto, polyStrStartsWith));\n/*#__NO_SIDE_EFFECTS__*/\nfunction polyStrStartsWith(value, searchString, position) {\n if (!isString(value)) {\n throwTypeError(\"'\" + dumpObj(value) + \"' is not a string\");\n }\n var searchValue = isString(searchString) ? searchString : asString(searchString);\n var pos = position > 0 ? position : 0;\n return strSubstring(value, pos, pos + searchValue[LENGTH]) === searchValue;\n}\n\nvar REF = \"ref\";\nvar UNREF = \"unref\";\nvar HAS_REF = \"hasRef\";\nvar ENABLED = \"enabled\";\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createTimerHandler(startTimer, refreshFn, cancelFn) {\n var ref = true;\n var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;\n var theTimerHandler;\n function _unref() {\n ref = false;\n timerId && timerId[UNREF] && timerId[UNREF]();\n return theTimerHandler;\n }\n function _cancel() {\n timerId && cancelFn(timerId);\n timerId = NULL_VALUE;\n }\n function _refresh() {\n timerId = refreshFn(timerId);\n if (!ref) {\n _unref();\n }\n return theTimerHandler;\n }\n function _setEnabled(value) {\n !value && timerId && _cancel();\n value && !timerId && _refresh();\n }\n theTimerHandler = {\n cancel: _cancel,\n refresh: _refresh\n };\n theTimerHandler[HAS_REF] = function () {\n if (timerId && timerId[HAS_REF]) {\n return timerId[HAS_REF]();\n }\n return ref;\n };\n theTimerHandler[REF] = function () {\n ref = true;\n timerId && timerId[REF] && timerId[REF]();\n return theTimerHandler;\n };\n theTimerHandler[UNREF] = _unref;\n theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {\n get: function () { return !!timerId; },\n set: _setEnabled\n });\n return {\n h: theTimerHandler,\n dn: function () {\n timerId = NULL_VALUE;\n }\n };\n}\n\nfunction _createTimeoutWith(startTimer, overrideFn, theArgs) {\n var isArr = isArray(overrideFn);\n var len = isArr ? overrideFn.length : 0;\n var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;\n var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;\n var timerFn = theArgs[0];\n theArgs[0] = function () {\n handler.dn();\n fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));\n };\n var handler = _createTimerHandler(startTimer, function (timerId) {\n if (timerId) {\n if (timerId.refresh) {\n timerId.refresh();\n return timerId;\n }\n fnApply(clearFn, UNDEF_VALUE, [timerId]);\n }\n return fnApply(setFn, UNDEF_VALUE, theArgs);\n }, function (timerId) {\n fnApply(clearFn, UNDEF_VALUE, [timerId]);\n });\n return handler.h;\n}\nfunction scheduleTimeout(callback, timeout) {\n return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));\n}\nfunction scheduleTimeoutWith(overrideFn, callback, timeout) {\n return _createTimeoutWith(true, overrideFn, ArrSlice[CALL](arguments, 1));\n}\nfunction createTimeout(callback, timeout) {\n return _createTimeoutWith(false, UNDEF_VALUE, ArrSlice[CALL](arguments));\n}\nfunction createTimeoutWith(overrideFn, callback, timeout) {\n return _createTimeoutWith(false, overrideFn, ArrSlice[CALL](arguments, 1));\n}\n\nvar _defaultIdleTimeout = 100;\nvar _maxExecutionTime = 50;\n/*#__NO_SIDE_EFFECTS__*/\nfunction hasIdleCallback() {\n return !!( /*#__PURE__*/getIdleCallback());\n}\nvar getIdleCallback = ( /*#__PURE__*/_getGlobalInstFn(getInst, [\"requestIdleCallback\"]));\nvar getCancelIdleCallback = ( /*#__PURE__*/_getGlobalInstFn(getInst, [\"cancelIdleCallback\"]));\nfunction setDefaultIdleTimeout(timeout) {\n _defaultIdleTimeout = timeout;\n}\nfunction setDefaultMaxExecutionTime(maxTime) {\n _maxExecutionTime = maxTime;\n}\nfunction scheduleIdleCallback(callback, options) {\n function _createDeadline(timedOut) {\n var startTime = perfNow();\n return {\n didTimeout: timedOut,\n timeRemaining: function () {\n return _maxExecutionTime - elapsedTime(startTime);\n }\n };\n }\n if (hasIdleCallback()) {\n var handler_1 = _createTimerHandler(true, function (idleId) {\n idleId && getCancelIdleCallback()(idleId);\n return getIdleCallback()(function (deadline) {\n handler_1.dn();\n callback(deadline || _createDeadline(false));\n }, options);\n }, function (idleId) {\n getCancelIdleCallback()(idleId);\n });\n return handler_1.h;\n }\n var timeout = (options || {}).timeout;\n if (isUndefined(timeout)) {\n timeout = _defaultIdleTimeout;\n }\n return scheduleTimeout(function () {\n callback(_createDeadline(true));\n }, timeout);\n}\n\nfunction scheduleInterval(callback, timeout) {\n var theArguments = ArrSlice[CALL](arguments);\n var handler = _createTimerHandler(true, function (intervalId) {\n intervalId && clearInterval(intervalId);\n return fnApply(setInterval, UNDEF_VALUE, theArguments);\n }, function (intervalId) {\n fnApply(clearInterval, UNDEF_VALUE, [intervalId]);\n });\n return handler.h;\n}\n\nexport { arrAppend, arrContains, arrEvery, arrFilter, arrFind, arrFindIndex, arrFindLast, arrFindLastIndex, arrForEach, arrFrom, arrIncludes, arrIndexOf, arrLastIndexOf, arrMap, arrReduce, arrSlice, arrSome, arrayDeepCopyHandler, asString, createArrayIterator, createCachedValue, createCustomError, createDeferredCachedValue, createEnum, createEnumKeyMap, createEnumValueMap, createFilenameRegex, createFnDeferredProxy, createIterable, createIterator, createProxyFuncs, createRangeIterator, createSimpleMap, createTimeout, createTimeoutWith, createTypeMap, createWildcardRegex, dateDeepCopyHandler, deepExtend, dumpObj, elapsedTime, encodeAsHtml, encodeAsJson, fnApply, fnBind, fnCall, functionDeepCopyHandler, getCancelIdleCallback, getDocument, getGlobal, getHistory, getIdleCallback, getInst, getIntValue, getKnownSymbol, getLazy, getLength, getNavigator, getPerformance, getSymbol, getValueByIter, getValueByKey, getWindow, getWritableLazy, hasDocument, hasHistory, hasIdleCallback, hasNavigator, hasPerformance, hasSymbol, hasValue, hasWindow, isArray, isArrayBuffer, isBlob, isBoolean, isDate, isDefined, isError, isFile, isFormData, isFunction, isIterable, isIterator, isNode, isNotTruthy, isNullOrUndefined, isNumber, isObject, isPlainObject, isPrimitive, isPrimitiveType, isPromise, isPromiseLike, isRegExp, isStrictNullOrUndefined, isStrictUndefined, isString, isSymbol, isThenable, isTruthy, isTypeof, isUndefined, isWebWorker, iterForOf, lazySafeGetInst, makeGlobRegex, makeIterable, mathCeil, mathFloor, mathMax, mathMin, mathRound, mathToInt, mathTrunc, newSymbol, normalizeJsName, objAssign, objCopyProps, objCreate, objDeepCopy, objDeepFreeze, objDefine, objDefineAccessors, objDefineGet, objDefineProp, objDefineProperties, objDefineProps, objEntries, objExtend, objForEachKey, objFreeze, objGetOwnPropertyDescriptor, objGetPrototypeOf, objHasOwn, objHasOwnProperty, objKeys, objSeal, objSetPrototypeOf, objToString, perfNow, plainObjDeepCopyHandler, polyArrFind, polyArrFindIndex, polyArrFindLast, polyArrFindLastIndex, polyArrFrom, polyArrIncludes, polyGetKnownSymbol, polyIsArray, polyNewSymbol, polyObjEntries, polyObjHasOwn, polyObjKeys, polyStrIncludes, polyStrSubstr, polyStrSymSplit, polyStrTrim, polyStrTrimEnd, polyStrTrimStart, polySymbolFor, polySymbolKeyFor, polyUtcNow, readArgs, safe, safeGet, safeGetLazy, safeGetWritableLazy, scheduleIdleCallback, scheduleInterval, scheduleTimeout, scheduleTimeoutWith, setBypassLazyCache, setDefaultIdleTimeout, setDefaultMaxExecutionTime, setValueByIter, setValueByKey, strCamelCase, strContains, strEndsWith, strIncludes, strIndexOf, strIsNullOrEmpty, strIsNullOrWhiteSpace, strKebabCase, strLastIndexOf, strLeft, strLetterCase, strLower, strPadEnd, strPadStart, strRepeat, strRight, strSlice, strSnakeCase, strSplit, strStartsWith, strSubstr, strSubstring, strSymSplit, strTrim, strTrimEnd, strTrimLeft, strTrimRight, strTrimStart, strUpper, symbolFor, symbolKeyFor, throwError, throwRangeError, throwTypeError, throwUnsupported, utcNow };\n//# sourceMappingURL=ts-utils.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar _a;\r\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\n;\r\nvar UNDEFINED = \"undefined\";\r\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 * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\r\n */\r\nvar DynProtoBaseProto = \"_dyn\" + str__Proto;\r\n/**\r\n * Runtime Global holder for dynamicProto settings\r\n */\r\nvar DynProtoGlobalSettings = \"__dynProto$Gbl\";\r\n/**\r\n * Track the current prototype for IE8 as you can't look back to get the prototype\r\n */\r\nvar DynProtoCurrent = \"_dynInstProto\";\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 * Pre-lookup to check for the existence of this function\r\n */\r\nvar _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\r\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\r\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\r\nvar _gbl = getGlobal();\r\nvar _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\r\n o: (_a = {},\r\n _a[strSetInstFuncs] = true,\r\n _a[strUseBaseInst] = true,\r\n _a),\r\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\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 var newProto;\r\n if (target) {\r\n // This method doesn't exist in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\r\n newProto = target[DynProtoBaseProto] || curProto;\r\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\r\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\r\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\r\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\r\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\r\n target[DynProtoCurrent] = curProto;\r\n }\r\n }\r\n return newProto;\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 if (_objGetOwnProps) {\r\n props = _objGetOwnProps(target);\r\n }\r\n else {\r\n for (var name_1 in target) {\r\n if (typeof name_1 === \"string\" && objHasOwnProperty(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 || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\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 throwTypeError(\"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 = objCreate(null);\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 // eslint-disable-next-line prefer-rest-params\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 = objCreate(null);\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 && objHasOwnProperty(proto, DynClassName)) {\r\n var instFuncTable = target[DynInstFuncTable] || objCreate(null);\r\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[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 = !objHasOwnProperty(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 // eslint-disable-next-line prefer-rest-params\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] || objCreate(null);\r\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\r\n var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // 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 if (!_isObjectOrArrayPrototype(instFuncs_1)) {\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 (!objHasOwnProperty(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}\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 return false;\r\n }\r\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\r\n return true;\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 (objHasOwnProperty(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\nexport default function dynamicProto(theClass, target, delegateFunc, options) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!objHasOwnProperty(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) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (objHasOwnProperty(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, \"_\") + \"$\" + _gblInst.n;\r\n _gblInst.n++;\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\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\r\n//# sourceMappingURL=DynamicProto.js.map","// 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 strDefault = \"default\";\r\nexport var ObjClass = Object;\r\nexport var ObjProto = ObjClass[strShimPrototype];\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { getGlobal, objAssign, objCreate, objDefineProp, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport { ObjClass, ObjProto, strDefault, strShimFunction, strShimPrototype } from \"./Constants\";\r\n// Most of these functions have been directly shamelessly \"lifted\" from the https://github.com/@microsoft/tslib and\r\n// modified to be ES5 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 __hasReflect = !!ReflectObj;\r\nvar strDecorate = \"decorate\";\r\nvar strMetadata = \"metadata\";\r\nvar strGetOwnPropertySymbols = \"getOwnPropertySymbols\";\r\nvar strIterator = \"iterator\";\r\nvar strHasOwnProperty = \"hasOwnProperty\";\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[strHasOwnProperty].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) {\r\n d.__proto__ = b;\r\n }) ||\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[strHasOwnProperty](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 __() {\r\n this.constructor = d;\r\n }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreate(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(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 && objDefineProp(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(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 (!!objDefineProp) {\r\n objDefineProp(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 (objDefineProp) {\r\n objDefineProp(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 (!!objDefineProp) {\r\n objDefineProp(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, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 11\r\nexport var _DYN_LENGTH = \"length\"; // Count: 55\r\nexport var _DYN_WARN_TO_CONSOLE = \"warnToConsole\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 5\r\nexport var _DYN_WATCH = \"watch\"; // Count: 7\r\nexport var _DYN_APPLY = \"apply\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 35\r\nexport var _DYN_SPLICE = \"splice\"; // Count: 8\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 20\r\nexport var _DYN_CANCEL = \"cancel\"; // Count: 6\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 5\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 8\r\nexport var _DYN_REMOVE_NOTIFICATION_0 = \"removeNotificationListener\"; // Count: 4\r\nexport var _DYN_ADD_NOTIFICATION_LIS1 = \"addNotificationListener\"; // Count: 4\r\nexport var _DYN_IS_INITIALIZED = \"isInitialized\"; // Count: 10\r\nexport var _DYN_VALUE = \"value\"; // Count: 5\r\nexport var _DYN_GET_NOTIFY_MGR = \"getNotifyMgr\"; // Count: 5\r\nexport var _DYN_GET_PLUGIN = \"getPlugin\"; // Count: 5\r\nexport var _DYN_NAME = \"name\"; // Count: 9\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 15\r\nexport var _DYN_GET_PROCESS_TEL_CONT2 = \"getProcessTelContext\"; // Count: 2\r\nexport var _DYN_ENABLED = \"enabled\"; // Count: 6\r\nexport var _DYN_STOP_POLLING_INTERNA3 = \"stopPollingInternalLogs\"; // Count: 2\r\nexport var _DYN_UNLOAD = \"unload\"; // Count: 7\r\nexport var _DYN_ON_COMPLETE = \"onComplete\"; // Count: 4\r\nexport var _DYN_VERSION = \"version\"; // Count: 4\r\nexport var _DYN_LOGGING_LEVEL_CONSOL4 = \"loggingLevelConsole\"; // Count: 2\r\nexport var _DYN_CREATE_NEW = \"createNew\"; // Count: 7\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 9\r\nexport var _DYN_MESSAGE_ID = \"messageId\"; // Count: 4\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 7\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 9\r\nexport var _DYN__DO_TEARDOWN = \"_doTeardown\"; // Count: 5\r\nexport var _DYN_UPDATE = \"update\"; // Count: 5\r\nexport var _DYN_GET_NEXT = \"getNext\"; // Count: 10\r\nexport var _DYN_SET_NEXT_PLUGIN = \"setNextPlugin\"; // Count: 5\r\nexport var _DYN_USER_AGENT = \"userAgent\"; // Count: 5\r\nexport var _DYN_SPLIT = \"split\"; // Count: 7\r\nexport var _DYN_REPLACE = \"replace\"; // Count: 9\r\nexport var _DYN_TYPE = \"type\"; // Count: 13\r\nexport var _DYN_EVT_NAME = \"evtName\"; // Count: 4\r\nexport var _DYN_STATUS = \"status\"; // Count: 5\r\nexport var _DYN_GET_ALL_RESPONSE_HEA5 = \"getAllResponseHeaders\"; // Count: 2\r\nexport var _DYN_IS_CHILD_EVT = \"isChildEvt\"; // Count: 3\r\nexport var _DYN_DATA = \"data\"; // Count: 6\r\nexport var _DYN_GET_CTX = \"getCtx\"; // Count: 6\r\nexport var _DYN_SET_CTX = \"setCtx\"; // Count: 10\r\nexport var _DYN_ITEMS_RECEIVED = \"itemsReceived\"; // Count: 3\r\nexport var _DYN_URL_STRING = \"urlString\"; // Count: 5\r\nexport var _DYN_HEADERS = \"headers\"; // Count: 5\r\nexport var _DYN_TIMEOUT = \"timeout\"; // Count: 6\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 5\r\nexport var _DYN_GET_ATTRIBUTE = \"getAttribute\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\nexport var UNDEFINED_VALUE = undefined;\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_CHANNELS = \"channels\";\r\nexport var STR_CORE = \"core\";\r\nexport var STR_CREATE_PERF_MGR = \"createPerfMgr\";\r\nexport var STR_DISABLED = \"disabled\";\r\nexport var STR_EXTENSION_CONFIG = \"extensionConfig\";\r\nexport var STR_EXTENSIONS = \"extensions\";\r\nexport var STR_PROCESS_TELEMETRY = \"processTelemetry\";\r\nexport var STR_PRIORITY = \"priority\";\r\nexport var STR_EVENTS_SENT = \"eventsSent\";\r\nexport var STR_EVENTS_DISCARDED = \"eventsDiscarded\";\r\nexport var STR_EVENTS_SEND_REQUEST = \"eventsSendRequest\";\r\nexport var STR_PERF_EVENT = \"perfEvent\";\r\nexport var STR_OFFLINE_STORE = \"offlineEventsStored\";\r\nexport var STR_OFFLINE_SENT = \"offlineBatchSent\";\r\nexport var STR_OFFLINE_DROP = \"offlineBatchDrop\";\r\nexport var STR_GET_PERF_MGR = \"getPerfMgr\";\r\nexport var STR_DOMAIN = \"domain\";\r\nexport var STR_PATH = \"path\";\r\nexport var STR_NOT_DYNAMIC_ERROR = \"Not dynamic - \";\r\n//# sourceMappingURL=InternalConstants.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { ObjAssign, ObjClass } from \"@microsoft/applicationinsights-shims\";\r\nimport { arrForEach, asString as asString21, isArray, isBoolean, isError, isFunction, isNullOrUndefined, isNumber, isObject, isPlainObject, isString, isUndefined, objDeepFreeze, objDefine, objForEachKey, objHasOwn, strIndexOf, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_GET_ALL_RESPONSE_HEA5, _DYN_LENGTH, _DYN_NAME, _DYN_REPLACE, _DYN_SPLIT, _DYN_STATUS, _DYN_TO_LOWER_CASE } from \"../__DynamicConstants\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\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 minification\r\nvar strGetPrototypeOf = \"getPrototypeOf\";\r\nvar rCamelCase = /-([a-z])/g;\r\nvar rNormalizeInvalid = /([^\\w\\d_$])/g;\r\nvar rLeadingNumeric = /^(\\d+[\\w\\d_$])/;\r\nexport var _getObjProto = Object[strGetPrototypeOf];\r\nexport function isNotUndefined(value) {\r\n return !isUndefined(value);\r\n}\r\nexport function isNotNullOrUndefined(value) {\r\n return !isNullOrUndefined(value);\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 if (value && isString(value)) {\r\n // CamelCase everything after the \"-\" and remove the dash\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rCamelCase, function (_all, letter) {\r\n return letter.toUpperCase();\r\n });\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rNormalizeInvalid, \"_\");\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rLeadingNumeric, function (_all, match) {\r\n return \"_\" + match;\r\n });\r\n }\r\n return value;\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 strIndexOf(value, search) !== -1;\r\n }\r\n return false;\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 return date && date.toISOString() || \"\";\r\n}\r\nexport var deepFreeze = objDeepFreeze;\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[_DYN_NAME /* @min:%2ename */];\r\n }\r\n return STR_EMPTY;\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\nfunction _createProxyFunction(source, funcName) {\r\n var srcFunc = null;\r\n var src = null;\r\n if (isFunction(source)) {\r\n srcFunc = source;\r\n }\r\n else {\r\n src = source;\r\n }\r\n return function () {\r\n // Capture the original arguments passed to the method\r\n var originalArguments = arguments;\r\n if (srcFunc) {\r\n src = srcFunc();\r\n }\r\n if (src) {\r\n return src[funcName][_DYN_APPLY /* @min:%2eapply */](src, originalArguments);\r\n }\r\n };\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 */\r\nexport function proxyAssign(target, source, chkSet) {\r\n if (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] = _createProxyFunction(source, field);\r\n }\r\n }\r\n else if (!chkSet || chkSet(field, false, source, target)) {\r\n if (objHasOwn(target, field)) {\r\n // Remove any previous instance property\r\n delete target[field];\r\n }\r\n objDefine(target, field, {\r\n g: function () {\r\n return source[field];\r\n },\r\n s: function (theValue) {\r\n source[field] = theValue;\r\n }\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 * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.\r\n *\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param name - The function name that will be added on the target\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param theFunc - The function name on the source that will be proxied on the target\r\n * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {\r\n if (target && name && source) {\r\n if (overwriteTarget !== false || isUndefined(target[name])) {\r\n target[name] = _createProxyFunction(source, theFunc);\r\n }\r\n }\r\n}\r\n/**\r\n * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.\r\n *\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 functionsToProxy - An array of function names that will be proxied on the target\r\n * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {\r\n if (target && source && isObject(target) && isArray(functionsToProxy)) {\r\n arrForEach(functionsToProxy, function (theFuncName) {\r\n if (isString(theFuncName)) {\r\n proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);\r\n }\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 = this;\r\n if (defaults) {\r\n objForEachKey(defaults, function (field, value) {\r\n _this[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 && ObjAssign) {\r\n theObject = ObjClass(ObjAssign({}, theObject));\r\n }\r\n return theObject;\r\n}\r\nexport function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {\r\n // Variables\r\n var theArgs = arguments;\r\n var extended = theArgs[0] || {};\r\n var argLen = theArgs[_DYN_LENGTH /* @min:%2elength */];\r\n var deep = false;\r\n var idx = 1;\r\n // Check for \"Deep\" flag\r\n if (argLen > 0 && isBoolean(extended)) {\r\n deep = extended;\r\n extended = theArgs[idx] || {};\r\n idx++;\r\n }\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if (!isObject(extended)) {\r\n extended = {};\r\n }\r\n // Loop through each remaining object and conduct a merge\r\n for (; idx < argLen; idx++) {\r\n var arg = theArgs[idx];\r\n var isArgArray = isArray(arg);\r\n var isArgObj = isObject(arg);\r\n for (var prop in arg) {\r\n var propOk = (isArgArray && (prop in arg)) || (isArgObj && objHasOwn(arg, prop));\r\n if (!propOk) {\r\n continue;\r\n }\r\n var newValue = arg[prop];\r\n var isNewArray = void 0;\r\n // If deep merge and property is an object, merge properties\r\n if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {\r\n // Grab the current value of the extended object\r\n var clone = extended[prop];\r\n if (isNewArray) {\r\n if (!isArray(clone)) {\r\n // We can't \"merge\" an array with a non-array so overwrite the original\r\n clone = [];\r\n }\r\n }\r\n else if (!isPlainObject(clone)) {\r\n // We can't \"merge\" an object with a non-object\r\n clone = {};\r\n }\r\n // Never move the original objects always clone them\r\n newValue = objExtend(deep, clone, newValue);\r\n }\r\n // Assign the new (or previous) value (unless undefined)\r\n if (newValue !== undefined) {\r\n extended[prop] = newValue;\r\n }\r\n }\r\n }\r\n return extended;\r\n}\r\nexport var asString = asString21;\r\nexport function isFeatureEnabled(feature, cfg) {\r\n var rlt = false;\r\n var ft = cfg && cfg.featureOptIn && cfg.featureOptIn[feature];\r\n if (feature && ft) {\r\n var mode = ft.mode;\r\n // NOTE: None will be considered as true\r\n rlt = (mode == 3 /* FeatureOptInMode.enable */) || (mode == 1 /* FeatureOptInMode.none */);\r\n }\r\n return rlt;\r\n}\r\nexport function getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nexport function formatErrorMessageXdr(xdr, message) {\r\n if (xdr) {\r\n return \"XDomainRequest,Response:\" + getResponseText(xdr) || \"\";\r\n }\r\n return message;\r\n}\r\nexport function formatErrorMessageXhr(xhr, message) {\r\n if (xhr) {\r\n return \"XMLHttpRequest,Status:\" + xhr[_DYN_STATUS /* @min:%2estatus */] + \",Response:\" + getResponseText(xhr) || xhr.response || \"\";\r\n }\r\n return message;\r\n}\r\nexport function prependTransports(theTransports, newTransports) {\r\n if (newTransports) {\r\n if (isNumber(newTransports)) {\r\n theTransports = [newTransports].concat(theTransports);\r\n }\r\n else if (isArray(newTransports)) {\r\n theTransports = newTransports.concat(theTransports);\r\n }\r\n }\r\n return theTransports;\r\n}\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\nvar strTimeout = \"timeout\";\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 * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {\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 // Only set the timeout for asynchronous requests as\r\n // \"Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.\"\"\r\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout\r\n if (!isSync && timeout) {\r\n _wrapSetXhrProp(xhr, strTimeout, timeout);\r\n }\r\n return xhr;\r\n}\r\n/**\r\n* Converts the XHR getAllResponseHeaders to a map containing the header key and value.\r\n* @internal\r\n*/\r\n// tslint:disable-next-line: align\r\nexport function convertAllHeadersToMap(headersString) {\r\n var headers = {};\r\n if (isString(headersString)) {\r\n var headersArray = strTrim(headersString)[_DYN_SPLIT /* @min:%2esplit */](/[\\r\\n]+/);\r\n arrForEach(headersArray, function (headerEntry) {\r\n if (headerEntry) {\r\n var idx = headerEntry.indexOf(\": \");\r\n if (idx !== -1) {\r\n // The new spec has the headers returning all as lowercase -- but not all browsers do this yet\r\n var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var value = strTrim(headerEntry.substring(idx + 1));\r\n headers[header] = value;\r\n }\r\n else {\r\n headers[strTrim(headerEntry)] = 1;\r\n }\r\n }\r\n });\r\n }\r\n return headers;\r\n}\r\n/**\r\n* append the XHR headers.\r\n* @internal\r\n*/\r\nexport function _appendHeader(theHeaders, xhr, name) {\r\n if (!theHeaders[name] && xhr && xhr.getResponseHeader) {\r\n var value = xhr.getResponseHeader(name);\r\n if (value) {\r\n theHeaders[name] = strTrim(value);\r\n }\r\n }\r\n return theHeaders;\r\n}\r\nvar STR_KILL_DURATION_HEADER = \"kill-duration\";\r\nvar STR_KILL_DURATION_SECONDS_HEADER = \"kill-duration-seconds\";\r\nvar STR_TIME_DELTA_HEADER = \"time-delta-millis\";\r\n/**\r\n* get the XHR getAllResponseHeaders.\r\n* @internal\r\n*/\r\nexport function _getAllResponseHeaders(xhr, isOneDs) {\r\n var theHeaders = {};\r\n if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 /* @min:%2egetAllResponseHeaders */]) {\r\n // Firefox 2-63 doesn't have getAllResponseHeaders function but it does have getResponseHeader\r\n // Only call these if getAllResponseHeaders doesn't exist, otherwise we can get invalid response errors\r\n // as collector is not currently returning the correct header to allow JS to access these headers\r\n if (!!isOneDs) {\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);\r\n }\r\n }\r\n else {\r\n theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 /* @min:%2egetAllResponseHeaders */]());\r\n }\r\n return theHeaders;\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { getGlobal, strShimObject, strShimPrototype, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { getDocument, getInst, getNavigator, getPerformance, hasNavigator, isFunction, isString, isUndefined, mathMax, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_NAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_USER_AGENT } from \"../__DynamicConstants\";\r\nimport { strContains } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\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 strDocumentMode = \"documentMode\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\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 strXMLHttpRequest = \"XMLHttpRequest\";\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 - A flag to enable or disable the mock\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\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 = getInst(\"__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 getInst(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 getInst(strConsole);\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) || getInst(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 || getInst(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 getInst(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 getInst(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[_DYN_USER_AGENT /* @min:%2euserAgent */] !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav[_DYN_USER_AGENT /* @min:%2euserAgent */];\r\n var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\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 || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\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 mathMax(parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strMsie)[1]), (doc[strDocumentMode] || 0));\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\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 || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n return (strIndexOf(ua, \"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported(useCached) {\r\n if (_beaconsSupported === null || useCached === false) {\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 isSupported = !!getInst(\"fetch\");\r\n var request = getInst(\"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 !== strShimUndefined);\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), \"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 = getInst(strXMLHttpRequest);\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\nfunction _getNamedValue(values, name) {\r\n if (values) {\r\n for (var i = 0; i < values[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var value = values[i];\r\n if (value[_DYN_NAME /* @min:%2ename */]) {\r\n if (value[_DYN_NAME /* @min:%2ename */] === name) {\r\n return value;\r\n }\r\n }\r\n }\r\n }\r\n return {};\r\n}\r\n/**\r\n * Helper function to fetch the named meta-tag from the page.\r\n * @param name - The name of the meta-tag to find.\r\n */\r\nexport function findMetaTag(name) {\r\n var doc = getDocument();\r\n if (doc && name) {\r\n // Look for a meta-tag\r\n return _getNamedValue(doc.querySelectorAll(\"meta\"), name).content;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper function to fetch the named server timing value from the page response (first navigation event).\r\n * @param name - The name of the server timing value to find.\r\n */\r\nexport function findNamedServerTiming(name) {\r\n var value;\r\n var perf = getPerformance();\r\n if (perf) {\r\n // Try looking for a server-timing header\r\n var navPerf = perf.getEntriesByType(\"navigation\") || [];\r\n value = _getNamedValue((navPerf[_DYN_LENGTH /* @min:%2elength */] > 0 ? navPerf[0] : {}).serverTiming, name).description;\r\n }\r\n return value;\r\n}\r\n// TODO: should reuse this method for analytics plugin\r\nexport function dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n return true;\r\n }\r\n return false;\r\n}\r\nexport function createCustomDomEvent(eventName, details) {\r\n var event = null;\r\n var detail = { detail: details || null };\r\n if (isFunction(CustomEvent)) { // Use CustomEvent constructor when available\r\n event = new CustomEvent(eventName, detail);\r\n }\r\n else { // CustomEvent has no constructor in IE\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"CustomEvent\");\r\n event.initCustomEvent(eventName, true, true, detail);\r\n }\r\n }\r\n return event;\r\n}\r\nexport function sendCustomEvent(evtName, cfg, customDetails) {\r\n var global = getGlobal();\r\n if (global && global.CustomEvent) {\r\n try {\r\n var details = { cfg: cfg || null, customDetails: customDetails || null };\r\n return dispatchEvent(global, createCustomDomEvent(evtName, details));\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { mathFloor, utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { getCrypto, getMsCrypto, isIE } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar UInt32Mask = 0x100000000;\r\nvar MaxUInt32 = 0xffffffff;\r\nvar SEED1 = 123456789;\r\nvar SEED2 = 987654321;\r\n// MWC based Random generator (for IE)\r\nvar _mwcSeeded = false;\r\nvar _mwcW = SEED1;\r\nvar _mwcZ = SEED2;\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 = (SEED1 + seedValue) & MaxUInt32;\r\n _mwcZ = (SEED2 - 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 = utcNow() & 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 - The max value for the range\r\n */\r\nexport function randomValue(maxValue) {\r\n if (maxValue > 0) {\r\n return mathFloor((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 = 0;\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 if (value === 0 && 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 if (value === 0) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mathFloor((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/**\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 = STR_EMPTY;\r\n while (result[_DYN_LENGTH /* @min:%2elength */] < 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//# sourceMappingURL=RandomHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { normalizeJsName } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { newId } from \"./RandomHelper\";\r\nvar version = '3.3.6';\r\nvar instanceName = \".\" + newId(6);\r\nvar _dataUid = 0;\r\n// Accepts only:\r\n// - Node\r\n// - Node.ELEMENT_NODE\r\n// - Node.DOCUMENT_NODE\r\n// - Object\r\n// - Any\r\nfunction _canAcceptData(target) {\r\n return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);\r\n}\r\nfunction _getCache(data, target) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n theCache = {};\r\n try {\r\n if (_canAcceptData(target)) {\r\n objDefine(target, data.id, {\r\n e: false,\r\n v: theCache\r\n });\r\n }\r\n }\r\n catch (e) {\r\n // Not all environments allow extending all objects, so just ignore the cache in those cases\r\n }\r\n }\r\n return theCache;\r\n}\r\nexport function createUniqueNamespace(name, includeVersion) {\r\n if (includeVersion === void 0) { includeVersion = false; }\r\n return normalizeJsName(name + (_dataUid++) + (includeVersion ? \".\" + version : STR_EMPTY) + instanceName);\r\n}\r\nexport function createElmNodeData(name) {\r\n var data = {\r\n id: createUniqueNamespace(\"_aiData-\" + (name || STR_EMPTY) + \".\" + version),\r\n accept: function (target) {\r\n return _canAcceptData(target);\r\n },\r\n get: function (target, name, defValue, addDefault) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n if (addDefault) {\r\n // Side effect is adds the cache\r\n theCache = _getCache(data, target);\r\n theCache[normalizeJsName(name)] = defValue;\r\n }\r\n return defValue;\r\n }\r\n return theCache[normalizeJsName(name)];\r\n },\r\n kill: function (target, name) {\r\n if (target && target[name]) {\r\n try {\r\n delete target[name];\r\n }\r\n catch (e) {\r\n // Just cleaning up, so if this fails -- ignore\r\n }\r\n }\r\n }\r\n };\r\n return data;\r\n}\r\n//# sourceMappingURL=DataCacheHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { asString, isArray, isDefined, isNullOrUndefined, isObject, isPlainObject, isUndefined, objForEachKey, objHasOwn } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nfunction _isConfigDefaults(value) {\r\n return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, \"v\") || objHasOwn(value, \"mrg\") || objHasOwn(value, \"ref\") || value.set));\r\n}\r\nfunction _getDefault(dynamicHandler, theConfig, cfgDefaults) {\r\n var defValue;\r\n var isDefaultValid = cfgDefaults.dfVal || isDefined;\r\n // There is a fallback config key so try and grab that first\r\n if (theConfig && cfgDefaults.fb) {\r\n var fallbacks = cfgDefaults.fb;\r\n if (!isArray(fallbacks)) {\r\n fallbacks = [fallbacks];\r\n }\r\n for (var lp = 0; lp < fallbacks[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var fallback = fallbacks[lp];\r\n var fbValue = theConfig[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n else if (dynamicHandler) {\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n fbValue = dynamicHandler.cfg[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n dynamicHandler.set(dynamicHandler.cfg, asString(fallback), fbValue);\r\n }\r\n if (isDefaultValid(defValue)) {\r\n // We have a valid default so break out of the look\r\n break;\r\n }\r\n }\r\n }\r\n // If the value is still not defined and we have a default value then use that\r\n if (!isDefaultValid(defValue) && isDefaultValid(cfgDefaults.v)) {\r\n defValue = cfgDefaults.v;\r\n }\r\n return defValue;\r\n}\r\n/**\r\n * Recursively resolve the default value\r\n * @param dynamicHandler\r\n * @param theConfig\r\n * @param cfgDefaults\r\n * @returns\r\n */\r\nfunction _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) {\r\n var theValue = cfgDefaults;\r\n if (cfgDefaults && _isConfigDefaults(cfgDefaults)) {\r\n theValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n if (theValue) {\r\n if (_isConfigDefaults(theValue)) {\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, theValue);\r\n }\r\n var newValue_1;\r\n if (isArray(theValue)) {\r\n newValue_1 = [];\r\n newValue_1[_DYN_LENGTH /* @min:%2elength */] = theValue[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(theValue)) {\r\n newValue_1 = {};\r\n }\r\n if (newValue_1) {\r\n objForEachKey(theValue, function (key, value) {\r\n if (value && _isConfigDefaults(value)) {\r\n value = _resolveDefaultValue(dynamicHandler, theConfig, value);\r\n }\r\n newValue_1[key] = value;\r\n });\r\n theValue = newValue_1;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Applies the default value on the config property and makes sure that it's dynamic\r\n * @param theConfig\r\n * @param name\r\n * @param defaultValue\r\n */\r\nexport function _applyDefaultValue(dynamicHandler, theConfig, name, defaultValue) {\r\n // Resolve the initial config value from the provided value or use the defined default\r\n var isValid;\r\n var setFn;\r\n var defValue;\r\n var cfgDefaults = defaultValue;\r\n var mergeDf;\r\n var reference;\r\n var readOnly;\r\n var blkDynamicValue;\r\n if (_isConfigDefaults(cfgDefaults)) {\r\n // looks like a IConfigDefault\r\n isValid = cfgDefaults.isVal;\r\n setFn = cfgDefaults.set;\r\n readOnly = cfgDefaults.rdOnly;\r\n blkDynamicValue = cfgDefaults.blkVal;\r\n mergeDf = cfgDefaults.mrg;\r\n reference = cfgDefaults.ref;\r\n if (!reference && isUndefined(reference)) {\r\n reference = !!mergeDf;\r\n }\r\n defValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n else {\r\n defValue = defaultValue;\r\n }\r\n if (blkDynamicValue) {\r\n // Mark the property so that any value assigned will be blocked from conversion, we need to do this\r\n // before assigning or fetching the value to ensure it's not converted\r\n dynamicHandler.blkVal(theConfig, name);\r\n }\r\n // Set the value to the default value;\r\n var theValue;\r\n var usingDefault = true;\r\n var cfgValue = theConfig[name];\r\n // try and get and user provided values\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n // Use the defined theConfig[name] value\r\n theValue = cfgValue;\r\n usingDefault = false;\r\n // The values are different and we have a special default value check, which is used to\r\n // override config values like empty strings to continue using the default\r\n if (isValid && theValue !== defValue && !isValid(theValue)) {\r\n theValue = defValue;\r\n usingDefault = true;\r\n }\r\n if (setFn) {\r\n theValue = setFn(theValue, defValue, theConfig);\r\n usingDefault = theValue === defValue;\r\n }\r\n }\r\n if (!usingDefault) {\r\n if (isPlainObject(theValue) || isArray(defValue)) {\r\n // we are using the user supplied value and it's an object\r\n if (mergeDf && defValue && (isPlainObject(defValue) || isArray(defValue))) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defValue, function (dfName, dfValue) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(dynamicHandler, theValue, dfName, dfValue);\r\n });\r\n }\r\n }\r\n }\r\n else if (defValue) {\r\n // Just resolve the default\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, defValue);\r\n }\r\n else {\r\n theValue = defValue;\r\n }\r\n // if (theValue && usingDefault && (isPlainObject(theValue) || isArray(theValue))) {\r\n // theValue = _cfgDeepCopy(theValue);\r\n // }\r\n // Needed to ensure that the (potentially) new field is dynamic even if null/undefined\r\n dynamicHandler.set(theConfig, name, theValue);\r\n if (reference) {\r\n dynamicHandler.ref(theConfig, name);\r\n }\r\n if (readOnly) {\r\n dynamicHandler.rdOnly(theConfig, name);\r\n }\r\n}\r\n//# sourceMappingURL=ConfigDefaults.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { isArray, isPlainObject, objForEachKey, symbolFor, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\n// Using Symbol.for so that if the same symbol was already created it would be returned\r\n// To handle multiple instances using potentially different versions we are not using\r\n// createUniqueNamespace()\r\nexport var CFG_HANDLER_LINK = symbolFor(\"[[ai_dynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects / arrays with if they should not be converted\r\n */\r\nvar BLOCK_DYNAMIC = symbolFor(\"[[ai_blkDynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects to indicate that when included into the configuration that\r\n * they should be converted into a trackable dynamic object.\r\n */\r\nvar FORCE_DYNAMIC = symbolFor(\"[[ai_frcDynCfg_1]]\");\r\nexport function _cfgDeepCopy(source) {\r\n if (source) {\r\n var target_1;\r\n if (isArray(source)) {\r\n target_1 = [];\r\n target_1[_DYN_LENGTH /* @min:%2elength */] = source[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(source)) {\r\n target_1 = {};\r\n }\r\n if (target_1) {\r\n // Copying index values by property name as the extensionConfig can be an array or object\r\n objForEachKey(source, function (key, value) {\r\n // Perform a deep copy of the object\r\n target_1[key] = _cfgDeepCopy(value);\r\n });\r\n return target_1;\r\n }\r\n }\r\n return source;\r\n}\r\n/**\r\n * @internal\r\n * Get the dynamic config handler if the value is already dynamic\r\n * @returns\r\n */\r\nexport function getDynamicConfigHandler(value) {\r\n if (value) {\r\n var handler = value[CFG_HANDLER_LINK] || value;\r\n if (handler.cfg && (handler.cfg === value || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Mark the provided value so that if it's included into the configuration it will NOT have\r\n * its properties converted into a dynamic (reactive) object. If the object is not a plain object\r\n * or an array (ie. a class) this function has not affect as only Objects and Arrays are converted\r\n * into dynamic objects in the dynamic configuration.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * You should only need to use this function, if you are creating dynamic \"classes\" from objects\r\n * which confirm to the require interface. A common case for this is during unit testing where it's\r\n * easier to create mock extensions.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed\r\n *\r\n * @example\r\n * ```ts\r\n * // This is a valid \"extension\", but it is technically an object\r\n * // So when included in the config.extensions it WILL be cloned and then\r\n * // converted into a dynamic object, where all of its properties will become\r\n * // get/set object properties and will be tracked. While this WILL still\r\n * // function, when attempt to use a mocking framework on top of this the\r\n * // functions are now technically get accessors which return a function\r\n * // and this can cause some mocking frameworks to fail.\r\n * let mockChannel = {\r\n * pause: () => { },\r\n* resume: () => { },\r\n* teardown: () => { },\r\n* flush: (async: any, callBack: any) => { },\r\n* processTelemetry: (env: any) => { },\r\n* setNextPlugin: (next: any) => { },\r\n* initialize: (config: any, core: any, extensions: any) => { },\r\n* identifier: \"testChannel\",\r\n* priority: 1003\r\n* };\r\n * ```\r\n * @param value - The object that you want to block from being converted into a\r\n * trackable dynamic object\r\n * @returns The original value\r\n */\r\nexport function blockDynamicConversion(value) {\r\n if (value && (isPlainObject(value) || isArray(value))) {\r\n try {\r\n value[BLOCK_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * This is the reverse case of {@link blockDynamicConversion} in that this will tag an\r\n * object to indicate that it should always be converted into a dynamic trackable object\r\n * even when not an object or array. So all properties of this object will become\r\n * get / set accessor functions.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed.\r\n * @param value - The object that should be tagged and converted if included into a dynamic\r\n * configuration.\r\n * @returns The original value\r\n */\r\nexport function forceDynamicConversion(value) {\r\n if (value) {\r\n try {\r\n value[FORCE_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper function to check whether an object can or should be converted into a dynamic\r\n * object.\r\n * @param value - The object to check whether it should be converted\r\n * @returns `true` if the value should be converted otherwise `false`.\r\n */\r\nexport function _canMakeDynamic(getFunc, state, value) {\r\n var result = false;\r\n // Object must exist and be truthy\r\n if (value && !getFunc[state.blkVal]) {\r\n // Tagged as always convert\r\n result = value[FORCE_DYNAMIC];\r\n // Check that it's not explicitly tagged as blocked\r\n if (!result && !value[BLOCK_DYNAMIC]) {\r\n // Only convert plain objects or arrays by default\r\n result = isPlainObject(value) || isArray(value);\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Throws an invalid access exception\r\n * @param message - The message to include in the exception\r\n */\r\nexport function throwInvalidAccess(message) {\r\n throwTypeError(\"InvalidAccess:\" + message);\r\n}\r\n//# sourceMappingURL=DynamicSupport.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, dumpObj, isArray, objDefine, objDefineProp, objForEachKey, objGetOwnPropertyDescriptor } from \"@nevware21/ts-utils\";\r\nimport { UNDEFINED_VALUE } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_APPLY, _DYN_LOGGER, _DYN_PUSH, _DYN_SPLICE, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nimport { CFG_HANDLER_LINK, _canMakeDynamic, blockDynamicConversion, throwInvalidAccess } from \"./DynamicSupport\";\r\nvar arrayMethodsToPatch = [\r\n \"push\",\r\n \"pop\",\r\n \"shift\",\r\n \"unshift\",\r\n \"splice\"\r\n];\r\nexport var _throwDynamicError = function (logger, name, desc, e) {\r\n logger && logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](3 /* eLoggingSeverity.DEBUG */, 108 /* _eInternalMessageId.DynamicConfigException */, \"\".concat(desc, \" [\").concat(name, \"] failed - \") + dumpObj(e));\r\n};\r\nfunction _patchArray(state, target, name) {\r\n if (isArray(target)) {\r\n // Monkey Patch the methods that might change the array\r\n arrForEach(arrayMethodsToPatch, function (method) {\r\n var orgMethod = target[method];\r\n target[method] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var result = orgMethod[_DYN_APPLY /* @min:%2eapply */](this, args);\r\n // items may be added, removed or moved so need to make some new dynamic properties\r\n _makeDynamicObject(state, target, name, \"Patching\");\r\n return result;\r\n };\r\n });\r\n }\r\n}\r\nfunction _getOwnPropGetter(target, name) {\r\n var propDesc = objGetOwnPropertyDescriptor(target, name);\r\n return propDesc && propDesc.get;\r\n}\r\nfunction _createDynamicProperty(state, theConfig, name, value) {\r\n // Does not appear to be dynamic so lets make it so\r\n var detail = {\r\n n: name,\r\n h: [],\r\n trk: function (handler) {\r\n if (handler && handler.fn) {\r\n if (arrIndexOf(detail.h, handler) === -1) {\r\n // Add this handler to the collection that should be notified when the value changes\r\n detail.h[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n state.trk(handler, detail);\r\n }\r\n },\r\n clr: function (handler) {\r\n var idx = arrIndexOf(detail.h, handler);\r\n if (idx !== -1) {\r\n detail.h[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n }\r\n }\r\n };\r\n // Flag to optimize lookup response time by avoiding additional function calls\r\n var checkDynamic = true;\r\n var isObjectOrArray = false;\r\n function _getProperty() {\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n // Make sure that if it's an object that we make it dynamic\r\n if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) {\r\n // It doesn't look like it's already dynamic so lets make sure it's converted the object into a dynamic Config as well\r\n value = _makeDynamicObject(state, value, name, \"Converting\");\r\n }\r\n // If it needed to be converted it now has been\r\n checkDynamic = false;\r\n }\r\n // If there is an active handler then add it to the tracking set of handlers\r\n var activeHandler = state.act;\r\n if (activeHandler) {\r\n detail.trk(activeHandler);\r\n }\r\n return value;\r\n }\r\n // Tag this getter as our dynamic property and provide shortcut for notifying a change\r\n _getProperty[state.prop] = {\r\n chng: function () {\r\n state.add(detail);\r\n }\r\n };\r\n function _setProperty(newValue) {\r\n if (value !== newValue) {\r\n if (!!_getProperty[state.ro] && !state.upd) {\r\n // field is marked as readonly so return false\r\n throwInvalidAccess(\"[\" + name + \"] is read-only:\" + dumpObj(theConfig));\r\n }\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n checkDynamic = false;\r\n }\r\n // The value must be a plain object or an array to enforce the reference (in-place updates)\r\n var isReferenced = isObjectOrArray && _getProperty[state.rf];\r\n if (isObjectOrArray) {\r\n // We are about to replace a plain object or an array\r\n if (isReferenced) {\r\n // Reassign the properties from the current value to the same properties from the newValue\r\n // This will set properties not in the newValue to undefined\r\n objForEachKey(value, function (key) {\r\n value[key] = newValue ? newValue[key] : UNDEFINED_VALUE;\r\n });\r\n // Now assign / re-assign value with all of the keys from newValue\r\n try {\r\n objForEachKey(newValue, function (key, theValue) {\r\n _setDynamicProperty(state, value, key, theValue);\r\n });\r\n // Now drop newValue so when we assign value later it keeps the existing reference\r\n newValue = value;\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Assigning\", e);\r\n // Mark as not an object or array so we don't try and do this again\r\n isObjectOrArray = false;\r\n }\r\n }\r\n else if (value && value[CFG_HANDLER_LINK]) {\r\n // As we are replacing the value, if it's already dynamic then we need to notify the listeners\r\n // for every property it has already\r\n objForEachKey(value, function (key) {\r\n // Check if the value is dynamic\r\n var getter = _getOwnPropGetter(value, key);\r\n if (getter) {\r\n // And if it is tell it's listeners that the value has changed\r\n var valueState = getter[state.prop];\r\n valueState && valueState.chng();\r\n }\r\n });\r\n }\r\n }\r\n if (newValue !== value) {\r\n var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue);\r\n if (!isReferenced && newIsObjectOrArray) {\r\n // As the newValue is an object/array lets preemptively make it dynamic\r\n newValue = _makeDynamicObject(state, newValue, name, \"Converting\");\r\n }\r\n // Now assign the internal \"value\" to the newValue\r\n value = newValue;\r\n isObjectOrArray = newIsObjectOrArray;\r\n }\r\n // Cause any listeners to be scheduled for notification\r\n state.add(detail);\r\n }\r\n }\r\n objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty });\r\n}\r\nexport function _setDynamicProperty(state, target, name, value) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n if (!isDynamic) {\r\n _createDynamicProperty(state, target, name, value);\r\n }\r\n else {\r\n // Looks like it's already dynamic just assign the new value\r\n target[name] = value;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _setDynamicPropertyState(state, target, name, flags) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n var inPlace = flags && flags[0 /* _eSetDynamicPropertyFlags.inPlace */];\r\n var rdOnly = flags && flags[1 /* _eSetDynamicPropertyFlags.readOnly */];\r\n var blkProp = flags && flags[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */];\r\n if (!isDynamic) {\r\n if (blkProp) {\r\n try {\r\n // Attempt to mark the target as blocked from conversion\r\n blockDynamicConversion(target);\r\n }\r\n catch (e) {\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Blocking\", e);\r\n }\r\n }\r\n try {\r\n // Make sure it's dynamic so that we can tag the property as per the state\r\n _setDynamicProperty(state, target, name, target[name]);\r\n getter = _getOwnPropGetter(target, name);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"State\", e);\r\n }\r\n }\r\n // Assign the optional flags if true\r\n if (inPlace) {\r\n getter[state.rf] = inPlace;\r\n }\r\n if (rdOnly) {\r\n getter[state.ro] = rdOnly;\r\n }\r\n if (blkProp) {\r\n getter[state.blkVal] = true;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _makeDynamicObject(state, target, name, desc) {\r\n try {\r\n // Assign target with new value properties (converting into dynamic properties in the process)\r\n objForEachKey(target, function (key, value) {\r\n // Assign and/or make the property dynamic\r\n _setDynamicProperty(state, target, key, value);\r\n });\r\n if (!target[CFG_HANDLER_LINK]) {\r\n // Link the config back to the dynamic config details\r\n objDefineProp(target, CFG_HANDLER_LINK, {\r\n get: function () {\r\n return state.hdlr;\r\n }\r\n });\r\n _patchArray(state, target, name);\r\n }\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, desc, e);\r\n }\r\n return target;\r\n}\r\n//# sourceMappingURL=DynamicProperty.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, createCustomError, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nvar aggregationErrorType;\r\n/**\r\n * Throws an Aggregation Error which includes all of the errors that led to this error occurring\r\n * @param message - The message describing the aggregation error (the sourceError details are added to this)\r\n * @param sourceErrors - An array of the errors that caused this situation\r\n */\r\nexport function throwAggregationError(message, sourceErrors) {\r\n if (!aggregationErrorType) {\r\n aggregationErrorType = createCustomError(\"AggregationError\", function (self, args) {\r\n if (args[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n // Save the provided errors\r\n self.errors = args[1];\r\n }\r\n });\r\n }\r\n var theMessage = message || \"One or more errors occurred.\";\r\n arrForEach(sourceErrors, function (srcError, idx) {\r\n theMessage += \"\\n\".concat(idx, \" > \").concat(dumpObj(srcError));\r\n });\r\n throw new aggregationErrorType(theMessage, sourceErrors || []);\r\n}\r\n//# sourceMappingURL=AggregationError.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, dumpObj, newSymbol, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { throwAggregationError } from \"../JavaScriptSDK/AggregationError\";\r\nimport { _DYN_CANCEL, _DYN_LENGTH, _DYN_LOGGER, _DYN_PUSH, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nvar symPrefix = \"[[ai_\";\r\nvar symPostfix = \"]]\";\r\nexport function _createState(cfgHandler) {\r\n var dynamicPropertySymbol = newSymbol(symPrefix + \"get\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReadOnly = newSymbol(symPrefix + \"ro\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReferenced = newSymbol(symPrefix + \"rf\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyBlockValue = newSymbol(symPrefix + \"blkVal\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyDetail = newSymbol(symPrefix + \"dtl\" + cfgHandler.uid + symPostfix);\r\n var _waitingHandlers = null;\r\n var _watcherTimer = null;\r\n var theState;\r\n function _useHandler(activeHandler, callback) {\r\n var prevWatcher = theState.act;\r\n try {\r\n theState.act = activeHandler;\r\n if (activeHandler && activeHandler[dynamicPropertyDetail]) {\r\n // Clear out the previously tracked details for this handler, so that access are re-evaluated\r\n arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {\r\n detail.clr(activeHandler);\r\n });\r\n activeHandler[dynamicPropertyDetail] = [];\r\n }\r\n callback({\r\n cfg: cfgHandler.cfg,\r\n set: cfgHandler.set.bind(cfgHandler),\r\n setDf: cfgHandler.setDf.bind(cfgHandler),\r\n ref: cfgHandler.ref.bind(cfgHandler),\r\n rdOnly: cfgHandler.rdOnly.bind(cfgHandler)\r\n });\r\n }\r\n catch (e) {\r\n var logger = cfgHandler[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // Don't let one individual failure break everyone\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](1 /* eLoggingSeverity.CRITICAL */, 107 /* _eInternalMessageId.ConfigWatcherException */, dumpObj(e));\r\n }\r\n // Re-throw the exception so that any true \"error\" is reported back to the called\r\n throw e;\r\n }\r\n finally {\r\n theState.act = prevWatcher || null;\r\n }\r\n }\r\n function _notifyWatchers() {\r\n if (_waitingHandlers) {\r\n var notifyHandlers = _waitingHandlers;\r\n _waitingHandlers = null;\r\n // Stop any timer as we are running them now anyway\r\n _watcherTimer && _watcherTimer[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _watcherTimer = null;\r\n var watcherFailures_1 = [];\r\n // Now run the handlers\r\n arrForEach(notifyHandlers, function (handler) {\r\n if (handler) {\r\n if (handler[dynamicPropertyDetail]) {\r\n arrForEach(handler[dynamicPropertyDetail], function (detail) {\r\n // Clear out this handler from previously tracked details, so that access are re-evaluated\r\n detail.clr(handler);\r\n });\r\n handler[dynamicPropertyDetail] = null;\r\n }\r\n // The handler may have self removed as part of another handler so re-check\r\n if (handler.fn) {\r\n try {\r\n _useHandler(handler, handler.fn);\r\n }\r\n catch (e) {\r\n // Don't let a single failing watcher cause other watches to fail\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n }\r\n });\r\n // During notification we may have had additional updates -- so notify those updates as well\r\n if (_waitingHandlers) {\r\n try {\r\n _notifyWatchers();\r\n }\r\n catch (e) {\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n if (watcherFailures_1[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n throwAggregationError(\"Watcher error(s): \", watcherFailures_1);\r\n }\r\n }\r\n }\r\n function _addWatcher(detail) {\r\n if (detail && detail.h[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n if (!_waitingHandlers) {\r\n _waitingHandlers = [];\r\n }\r\n if (!_watcherTimer) {\r\n _watcherTimer = scheduleTimeout(function () {\r\n _watcherTimer = null;\r\n _notifyWatchers();\r\n }, 0);\r\n }\r\n // Add all of the handlers for this detail (if not already present) - using normal for-loop for performance\r\n for (var idx = 0; idx < detail.h[_DYN_LENGTH /* @min:%2elength */]; idx++) {\r\n var handler = detail.h[idx];\r\n // Add this handler to the collection of handlers to re-execute\r\n if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {\r\n _waitingHandlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n }\r\n }\r\n function _trackHandler(handler, detail) {\r\n if (handler) {\r\n var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];\r\n if (arrIndexOf(details, detail) === -1) {\r\n // If this detail is not already listed as tracked then add it so that we re-evaluate it's usage\r\n details[_DYN_PUSH /* @min:%2epush */](detail);\r\n }\r\n }\r\n }\r\n theState = {\r\n prop: dynamicPropertySymbol,\r\n ro: dynamicPropertyReadOnly,\r\n rf: dynamicPropertyReferenced,\r\n blkVal: dynamicPropertyBlockValue,\r\n hdlr: cfgHandler,\r\n add: _addWatcher,\r\n notify: _notifyWatchers,\r\n use: _useHandler,\r\n trk: _trackHandler\r\n };\r\n return theState;\r\n}\r\n//# sourceMappingURL=DynamicState.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { dumpObj, isUndefined, objDefine, objForEachKey } from \"@nevware21/ts-utils\";\r\nimport { createUniqueNamespace } from \"../JavaScriptSDK/DataCacheHelper\";\r\nimport { STR_NOT_DYNAMIC_ERROR } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_THROW_INTERNAL, _DYN_WARN_TO_CONSOLE, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { _applyDefaultValue } from \"./ConfigDefaults\";\r\nimport { _makeDynamicObject, _setDynamicProperty, _setDynamicPropertyState, _throwDynamicError } from \"./DynamicProperty\";\r\nimport { _createState } from \"./DynamicState\";\r\nimport { CFG_HANDLER_LINK, _cfgDeepCopy, getDynamicConfigHandler, throwInvalidAccess } from \"./DynamicSupport\";\r\n/**\r\n * Identifies a function which will be re-called whenever any of it's accessed configuration values\r\n * change.\r\n * @param configHandler - The callback that will be called for the initial request and then whenever any\r\n * accessed configuration changes are identified.\r\n */\r\nfunction _createAndUseHandler(state, configHandler) {\r\n var handler = {\r\n fn: configHandler,\r\n rm: function () {\r\n // Clear all references to the handler so it can be garbage collected\r\n // This will also cause this handler to never get called and eventually removed\r\n handler.fn = null;\r\n state = null;\r\n configHandler = null;\r\n }\r\n };\r\n objDefine(handler, \"toJSON\", { v: function () { return \"WatcherHandler\" + (handler.fn ? \"\" : \"[X]\"); } });\r\n state.use(handler, configHandler);\r\n return handler;\r\n}\r\n/**\r\n * Creates the dynamic config handler and associates with the target config as the root object\r\n * @param target - The config that you want to be root of the dynamic config\r\n * @param inPlace - Should the passed config be converted in-place or a new proxy returned\r\n * @returns The existing dynamic handler or a new instance with the provided config values\r\n */\r\nfunction _createDynamicHandler(logger, target, inPlace) {\r\n var dynamicHandler = getDynamicConfigHandler(target);\r\n if (dynamicHandler) {\r\n // The passed config is already dynamic so return it's tracker\r\n return dynamicHandler;\r\n }\r\n var uid = createUniqueNamespace(\"dyncfg\", true);\r\n var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target);\r\n var theState;\r\n function _notifyWatchers() {\r\n theState.notify();\r\n }\r\n function _setValue(target, name, value) {\r\n try {\r\n target = _setDynamicProperty(theState, target, name, value);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError(logger, name, \"Setting value\", e);\r\n }\r\n return target[name];\r\n }\r\n function _watch(configHandler) {\r\n return _createAndUseHandler(theState, configHandler);\r\n }\r\n function _block(configHandler, allowUpdate) {\r\n theState.use(null, function (details) {\r\n var prevUpd = theState.upd;\r\n try {\r\n if (!isUndefined(allowUpdate)) {\r\n theState.upd = allowUpdate;\r\n }\r\n configHandler(details);\r\n }\r\n finally {\r\n theState.upd = prevUpd;\r\n }\r\n });\r\n }\r\n function _ref(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as referenced with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 /* _eSetDynamicPropertyFlags.inPlace */] = true, _a))[name];\r\n }\r\n function _rdOnly(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 /* _eSetDynamicPropertyFlags.readOnly */] = true, _a))[name];\r\n }\r\n function _blkPropValue(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */] = true, _a))[name];\r\n }\r\n function _applyDefaults(theConfig, defaultValues) {\r\n if (defaultValues) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defaultValues, function (name, value) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(cfgHandler, theConfig, name, value);\r\n });\r\n }\r\n return theConfig;\r\n }\r\n var cfgHandler = {\r\n uid: null,\r\n cfg: newTarget,\r\n logger: logger,\r\n notify: _notifyWatchers,\r\n set: _setValue,\r\n setDf: _applyDefaults,\r\n watch: _watch,\r\n ref: _ref,\r\n rdOnly: _rdOnly,\r\n blkVal: _blkPropValue,\r\n _block: _block\r\n };\r\n objDefine(cfgHandler, \"uid\", {\r\n c: false,\r\n e: false,\r\n w: false,\r\n v: uid\r\n });\r\n theState = _createState(cfgHandler);\r\n // Setup tracking for all defined default keys\r\n _makeDynamicObject(theState, newTarget, \"config\", \"Creating\");\r\n return cfgHandler;\r\n}\r\n/**\r\n * Log an invalid access message to the console\r\n */\r\nfunction _logInvalidAccess(logger, message) {\r\n if (logger) {\r\n logger[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](2 /* eLoggingSeverity.WARNING */, 108 /* _eInternalMessageId.DynamicConfigException */, message);\r\n }\r\n else {\r\n // We don't have a logger so just throw an exception\r\n throwInvalidAccess(message);\r\n }\r\n}\r\n/**\r\n * Create or return a dynamic version of the passed config, if it is not already dynamic\r\n * @param config - The config to be converted into a dynamic config\r\n * @param defaultConfig - The default values to apply on the config if the properties don't already exist\r\n * @param inPlace - Should the config be converted in-place into a dynamic config or a new instance returned, defaults to true\r\n * @returns The dynamic config handler for the config (whether new or existing)\r\n */\r\nexport function createDynamicConfig(config, defaultConfig, logger, inPlace) {\r\n var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);\r\n if (defaultConfig) {\r\n dynamicHandler.setDf(dynamicHandler.cfg, defaultConfig);\r\n }\r\n return dynamicHandler;\r\n}\r\n/**\r\n * Watch and track changes for accesses to the current config, the provided config MUST already be\r\n * a dynamic config or a child accessed via the dynamic config\r\n * @param logger - The logger instance to use if there is no existing handler\r\n * @returns A watcher handler instance that can be used to remove itself when being unloaded\r\n * @throws TypeError if the provided config is not a dynamic config instance\r\n */\r\nexport function onConfigChange(config, configHandler, logger) {\r\n var handler = config[CFG_HANDLER_LINK] || config;\r\n if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n }\r\n _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));\r\n return createDynamicConfig(config, null, logger)[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n}\r\n//# sourceMappingURL=DynamicConfig.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getInst } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];\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][_DYN_APPLY /* @min:%2eapply */](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 = getInst(\"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[_DYN_LENGTH /* @min:%2elength */]; 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, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dumpObj, isFunction, isUndefined } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { _DYN_DIAG_LOG, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_PUSH, _DYN_REPLACE, _DYN_THROW_INTERNAL, _DYN_UNLOAD, _DYN_WARN_TO_CONSOLE } from \"../__DynamicConstants\";\r\nimport { getDebugExt } from \"./DbgExtensionUtils\";\r\nimport { getConsole, getJSON, hasJSON } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar STR_WARN_TO_CONSOLE = \"warnToConsole\";\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 defaultValues = {\r\n loggingLevelConsole: 0,\r\n loggingLevelTelemetry: 1,\r\n maxMessageLimit: 25,\r\n enableDebug: false\r\n};\r\nvar _logFuncs = (_a = {},\r\n _a[0 /* eLoggingSeverity.DISABLED */] = null,\r\n _a[1 /* eLoggingSeverity.CRITICAL */] = \"errorToConsole\",\r\n _a[2 /* eLoggingSeverity.WARNING */] = STR_WARN_TO_CONSOLE,\r\n _a[3 /* eLoggingSeverity.DEBUG */] = \"debugToConsole\",\r\n _a);\r\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text[_DYN_REPLACE /* @min:%2ereplace */](/\\\"/g, STR_EMPTY) + \"\\\"\";\r\n }\r\n return STR_EMPTY;\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[_DYN_MESSAGE_ID /* @min:%2emessageId */] = msgId;\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = STR_EMPTY;\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] += 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 || {})[_DYN_LOGGER /* @min:%2elogger */] || 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 var _loggingLevelConsole;\r\n var _loggingLevelTelemetry;\r\n var _maxInternalMessageLimit;\r\n var _enableDebug;\r\n var _unloadHandler;\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n _unloadHandler = _setDefaultsFromConfig(config || {});\r\n _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };\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 - The severity of the log message\r\n * @param message - The log message.\r\n */\r\n _self[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */] = 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 (_enableDebug) {\r\n throw dumpObj(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 = _logFuncs[severity] || STR_WARN_TO_CONSOLE;\r\n if (!isUndefined(message[_DYN_MESSAGE /* @min:%2emessage */])) {\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[_DYN_MESSAGE_ID /* @min:%2emessageId */];\r\n if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\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 (_loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\r\n }\r\n }\r\n _logInternalMessage(severity, message);\r\n }\r\n else {\r\n _debugExtMsg(\"throw\" + (severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"Critical\" : \"Warning\"), message);\r\n }\r\n }\r\n };\r\n _self.debugToConsole = function (message) {\r\n _logToConsole(\"debug\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */] = function (message) {\r\n _logToConsole(\"warn\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self.errorToConsole = function (message) {\r\n _logToConsole(\"error\", message);\r\n _debugExtMsg(\"error\", message);\r\n };\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n _self.logInternalMessage = _logInternalMessage;\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync) {\r\n _unloadHandler && _unloadHandler.rm();\r\n _unloadHandler = null;\r\n };\r\n function _logInternalMessage(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[_DYN_MESSAGE_ID /* @min:%2emessageId */];\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 <= _loggingLevelTelemetry) {\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](message);\r\n _messageCount++;\r\n _debugExtMsg((severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"error\" : \"warn\"), message);\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _maxInternalMessageLimit) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(23 /* _eInternalMessageId.MessageLimitPerPVExceeded */, throttleLimitMessage, false);\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](throttleMessage);\r\n if (severity === 1 /* eLoggingSeverity.CRITICAL */) {\r\n _self.errorToConsole(throttleLimitMessage);\r\n }\r\n else {\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](throttleLimitMessage);\r\n }\r\n }\r\n }\r\n }\r\n function _setDefaultsFromConfig(config) {\r\n // make sure the config is dynamic\r\n return onConfigChange(createDynamicConfig(config, defaultValues, _self).cfg, function (details) {\r\n var config = details.cfg;\r\n _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */];\r\n _loggingLevelTelemetry = config.loggingLevelTelemetry;\r\n _maxInternalMessageLimit = config.maxMessageLimit;\r\n _enableDebug = config.enableDebug;\r\n });\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _maxInternalMessageLimit;\r\n }\r\n function _debugExtMsg(name, data) {\r\n var dbgExt = getDebugExt(config || {});\r\n if (dbgExt && dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */]) {\r\n dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */](name, data);\r\n }\r\n }\r\n });\r\n }\r\n// Removed Stub for DiagnosticLogger.prototype.consoleLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.throwInternal.\r\n// Removed Stub for DiagnosticLogger.prototype.debugToConsole.\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// Removed Stub for DiagnosticLogger.prototype.unload.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n DiagnosticLogger.__ieDyn=1;\n\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\nfunction _getLogger(logger) {\r\n return (logger || new DiagnosticLogger());\r\n}\r\n/**\r\n * This is a helper method which will call throwInternal on the passed logger, will throw exceptions in\r\n * debug mode or attempt to log the error as a console warning. This helper is provided mostly to better\r\n * support minification as logger.throwInternal() will not compress the publish \"throwInternal\" used throughout\r\n * the code.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - The severity of the log message\r\n * @param message - The log message.\r\n */\r\nexport function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n _getLogger(logger)[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](severity, msgId, msg, properties, isUserAct);\r\n}\r\n/**\r\n * This is a helper method which will call warnToConsole on the passed logger with the provided message.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param message - The log message.\r\n */\r\nexport function _warnToConsole(logger, message) {\r\n _getLogger(logger)[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n}\r\n/**\r\n * Logs a message to the internal queue.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - The severity of the log message\r\n * @param message - The message to log.\r\n */\r\nexport function _logInternalMessage(logger, severity, message) {\r\n _getLogger(logger).logInternalMessage(severity, message);\r\n}\r\n//# sourceMappingURL=DiagnosticLogger.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { createEnum, createTypeMap } from \"@nevware21/ts-utils\";\r\n/**\r\n * Create an enum style object which has both the key \\=\\> value and value \\=\\> key mappings\r\n * @param values - The values to populate on the new object\r\n * @returns\r\n */\r\nexport var createEnumStyle = createEnum;\r\n/**\r\n * Create a 2 index map that maps an enum's key and value to the defined map value, X[\"key\"] \\=\\> mapValue and X[0] \\=\\> mapValue.\r\n * Generic values\r\n * - E = the const enum type (typeof eRequestHeaders);\r\n * - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The\r\n * resulting \"Value\" of each entry identifies the valid values withing the assignments.\r\n * @param values - The values to populate on the new object\r\n * @returns\r\n */\r\nexport var createValueMap = createTypeMap;\r\n//# sourceMappingURL=EnumHelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { createEnumStyle } from \"@microsoft/applicationinsights-core-js\";\r\nexport var StorageType = createEnumStyle({\r\n LocalStorage: 0 /* eStorageType.LocalStorage */,\r\n SessionStorage: 1 /* eStorageType.SessionStorage */\r\n});\r\nexport var DistributedTracingModes = createEnumStyle({\r\n AI: 0 /* eDistributedTracingModes.AI */,\r\n AI_AND_W3C: 1 /* eDistributedTracingModes.AI_AND_W3C */,\r\n W3C: 2 /* eDistributedTracingModes.W3C */\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 = createEnumStyle({\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* EventPersistenceValue.Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* EventPersistenceValue.Critical */\r\n});\r\n//# sourceMappingURL=Enums.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_SPLIT = \"split\"; // Count: 6\r\nexport var _DYN_LENGTH = \"length\"; // Count: 46\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 6\r\nexport var _DYN_INGESTIONENDPOINT = \"ingestionendpoint\"; // Count: 6\r\nexport var _DYN_TO_STRING = \"toString\"; // Count: 8\r\nexport var _DYN_REMOVE_ITEM = \"removeItem\"; // Count: 3\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 5\r\nexport var _DYN_COUNT = \"count\"; // Count: 6\r\nexport var _DYN_PRE_TRIGGER_DATE = \"preTriggerDate\"; // Count: 4\r\nexport var _DYN_GET_UTCDATE = \"getUTCDate\"; // Count: 3\r\nexport var _DYN_STRINGIFY = \"stringify\"; // Count: 4\r\nexport var _DYN_PATHNAME = \"pathname\"; // Count: 4\r\nexport var _DYN_MATCH = \"match\"; // Count: 5\r\nexport var _DYN_CORRELATION_HEADER_E0 = \"correlationHeaderExcludePatterns\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count: 10\r\nexport var _DYN_EXTENSION_CONFIG = \"extensionConfig\"; // Count: 4\r\nexport var _DYN_PROPERTIES = \"properties\"; // Count: 10\r\nexport var _DYN_MEASUREMENTS = \"measurements\"; // Count: 9\r\nexport var _DYN_SIZE_IN_BYTES = \"sizeInBytes\"; // Count: 4\r\nexport var _DYN_TYPE_NAME = \"typeName\"; // Count: 5\r\nexport var _DYN_EXCEPTIONS = \"exceptions\"; // Count: 5\r\nexport var _DYN_SEVERITY_LEVEL = \"severityLevel\"; // Count: 5\r\nexport var _DYN_PROBLEM_GROUP = \"problemGroup\"; // Count: 3\r\nexport var _DYN_PARSED_STACK = \"parsedStack\"; // Count: 6\r\nexport var _DYN_HAS_FULL_STACK = \"hasFullStack\"; // Count: 5\r\nexport var _DYN_ASSEMBLY = \"assembly\"; // Count: 4\r\nexport var _DYN_FILE_NAME = \"fileName\"; // Count: 9\r\nexport var _DYN_LINE = \"line\"; // Count: 6\r\nexport var _DYN_AI_DATA_CONTRACT = \"aiDataContract\"; // Count: 4\r\nexport var _DYN_DURATION = \"duration\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { _throwInternal, dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { StorageType } from \"./Enums\";\r\nimport { _DYN_REMOVE_ITEM, _DYN_TO_STRING } from \"./__DynamicConstants\";\r\nvar _canUseLocalStorage = undefined;\r\nvar _canUseSessionStorage = undefined;\r\nvar _storagePrefix = \"\";\r\n/**\r\n * Gets the localStorage object if available\r\n * @returns {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getLocalStorageObject() {\r\n if (utlCanUseLocalStorage()) {\r\n return _getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType - Type of storage\r\n * @returns {Storage} Returns storage object verified that it is usable\r\n */\r\nfunction _getVerifiedStorageObject(storageType) {\r\n try {\r\n if (isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n var uid = (new Date)[_DYN_TO_STRING /* @min:%2etoString */]();\r\n var storage = getGlobalInst(storageType === StorageType.LocalStorage ? \"localStorage\" : \"sessionStorage\");\r\n var name_1 = _storagePrefix + uid;\r\n storage.setItem(name_1, uid);\r\n var fail = storage.getItem(name_1) !== uid;\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name_1);\r\n if (!fail) {\r\n return storage;\r\n }\r\n }\r\n catch (exception) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\n/**\r\n * Gets the sessionStorage object if available\r\n * @returns {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getSessionStorageObject() {\r\n if (utlCanUseSessionStorage()) {\r\n return _getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Disables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlDisableStorage() {\r\n _canUseLocalStorage = false;\r\n _canUseSessionStorage = false;\r\n}\r\nexport function utlSetStoragePrefix(storagePrefix) {\r\n _storagePrefix = storagePrefix || \"\";\r\n}\r\n/**\r\n * Re-enables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlEnableStorage() {\r\n _canUseLocalStorage = utlCanUseLocalStorage(true);\r\n _canUseSessionStorage = utlCanUseSessionStorage(true);\r\n}\r\n/**\r\n * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override\r\n * any previous disable calls.\r\n * @param reset - Should the usage be reset and determined only based on whether LocalStorage is available\r\n */\r\nexport function utlCanUseLocalStorage(reset) {\r\n if (reset || _canUseLocalStorage === undefined) {\r\n _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return _canUseLocalStorage;\r\n}\r\nexport function utlGetLocalStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 1 /* _eInternalMessageId.BrowserCannotReadLocalStorage */, \"Browser failed read of local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetLocalStorage(logger, name, data) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 3 /* _eInternalMessageId.BrowserCannotWriteLocalStorage */, \"Browser failed write to local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 5 /* _eInternalMessageId.BrowserFailedRemovalFromLocalStorage */, \"Browser failed removal of local storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlCanUseSessionStorage(reset) {\r\n if (reset || _canUseSessionStorage === undefined) {\r\n _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return _canUseSessionStorage;\r\n}\r\nexport function utlGetSessionStorageKeys() {\r\n var keys = [];\r\n if (utlCanUseSessionStorage()) {\r\n objForEachKey(getGlobalInst(\"sessionStorage\"), function (key) {\r\n keys.push(key);\r\n });\r\n }\r\n return keys;\r\n}\r\nexport function utlGetSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 2 /* _eInternalMessageId.BrowserCannotReadSessionStorage */, \"Browser failed read of session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetSessionStorage(logger, name, data) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 4 /* _eInternalMessageId.BrowserCannotWriteSessionStorage */, \"Browser failed write to session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 6 /* _eInternalMessageId.BrowserFailedRemovalFromSessionStorage */, \"Browser failed removal of session storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=StorageHelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n// Licensed under the\r\nexport { correlationIdSetPrefix, correlationIdGetPrefix, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext, correlationIdGetCorrelationContextValue, dateTimeUtilsNow, dateTimeUtilsDuration, isInternalApplicationInsightsEndpoint, createDistributedTraceContextFromTrace } from \"./Util\";\r\nexport { ThrottleMgr } from \"./ThrottleMgr\";\r\nexport { parseConnectionString, ConnectionStringParser } from \"./ConnectionStringParser\";\r\nexport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nexport { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, strNotSpecified } from \"./Constants\";\r\nexport { Envelope } from \"./Telemetry/Common/Envelope\";\r\nexport { Event } from \"./Telemetry/Event\";\r\nexport { Exception } from \"./Telemetry/Exception\";\r\nexport { Metric } from \"./Telemetry/Metric\";\r\nexport { PageView } from \"./Telemetry/PageView\";\r\nexport { RemoteDependencyData } from \"./Telemetry/RemoteDependencyData\";\r\nexport { Trace } from \"./Telemetry/Trace\";\r\nexport { PageViewPerformance } from \"./Telemetry/PageViewPerformance\";\r\nexport { Data } from \"./Telemetry/Common/Data\";\r\nexport { SeverityLevel } from \"./Interfaces/Contracts/SeverityLevel\";\r\nexport { ConfigurationManager } from \"./Interfaces/IConfig\";\r\nexport { ContextTagKeys } from \"./Interfaces/Contracts/ContextTagKeys\";\r\nexport { dataSanitizeKeyAndAddUniqueness, dataSanitizeKey, dataSanitizeString, dataSanitizeUrl, dataSanitizeMessage, dataSanitizeException, dataSanitizeProperties, dataSanitizeMeasurements, dataSanitizeId, dataSanitizeInput, dsPadNumber } from \"./Telemetry/Common/DataSanitizer\";\r\nexport { TelemetryItemCreator, createTelemetryItem } from \"./TelemetryItemCreator\";\r\nexport { CtxTagKeys, Extensions } from \"./Interfaces/PartAExtensions\";\r\nexport { DistributedTracingModes, EventPersistence } from \"./Enums\";\r\nexport { stringToBoolOrDefault, msToTimeSpan, getExtensionByName, isCrossOriginError } from \"./HelperFuncs\";\r\nexport { isBeaconsSupported as isBeaconApiSupported, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent, findAllScripts } from \"@microsoft/applicationinsights-core-js\";\r\nexport { createDomEvent } from \"./DomHelperFuncs\";\r\nexport { utlDisableStorage, utlEnableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage, utlCanUseSessionStorage, utlGetSessionStorageKeys, utlGetSessionStorage, utlSetSessionStorage, utlRemoveSessionStorage, utlSetStoragePrefix } from \"./StorageHelperFuncs\";\r\nexport { urlParseUrl, urlGetAbsoluteUrl, urlGetPathName, urlGetCompleteUrl, urlParseHost, urlParseFullHost } from \"./UrlHelperFuncs\";\r\nexport { createOfflineListener } from \"./Offline\";\r\nexport var PropertiesPluginIdentifier = \"AppInsightsPropertiesPlugin\";\r\nexport var BreezeChannelIdentifier = \"AppInsightsChannelPlugin\";\r\nexport var AnalyticsPluginIdentifier = \"ApplicationInsightsAnalytics\";\r\n//# sourceMappingURL=applicationinsights-common.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n/**\r\n * This is an internal property used to cause internal (reporting) requests to be ignored from reporting\r\n * additional telemetry, to handle polyfil implementations ALL urls used with a disabled request will\r\n * also be ignored for future requests even when this property is not provided.\r\n * Tagging as Ignore as this is an internal value and is not expected to be used outside of the SDK\r\n * @ignore\r\n */\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nexport var SampleRate = \"sampleRate\";\r\nexport var ProcessLegacy = \"ProcessLegacy\";\r\nexport var HttpMethod = \"http.method\";\r\nexport var DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\r\nexport var DEFAULT_BREEZE_PATH = \"/v2/track\";\r\nexport var strNotSpecified = \"not_specified\";\r\nexport var strIkey = \"iKey\";\r\n//# sourceMappingURL=Constants.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { _throwInternal, getJSON, hasJSON, isObject, objForEachKey, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"../../__DynamicConstants\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key[_DYN_LENGTH /* @min:%2elength */];\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field[_DYN_LENGTH /* @min:%2elength */] !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = strSubstring(field, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(asString(name));\r\n // truncate the string to 150 chars\r\n if (name[_DYN_LENGTH /* @min:%2elength */] > 150 /* DataSanitizerValues.MAX_NAME_LENGTH */) {\r\n nameTrunc = strSubstring(name, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 57 /* _eInternalMessageId.NameTooLong */, \"name is too long. It has been truncated to \" + 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(asString(value));\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n valueTrunc = strSubstring(value, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 61 /* _eInternalMessageId.StringValueTooLong */, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url) {\r\n return dataSanitizeInput(logger, url, 2048 /* DataSanitizerValues.MAX_URL_LENGTH */, 66 /* _eInternalMessageId.UrlTooLong */);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = strSubstring(message, 0, 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 56 /* _eInternalMessageId.MessageTruncated */, \"message is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = strSubstring(value, 0, 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 52 /* _eInternalMessageId.ExceptionTruncated */, \"exception is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* DataSanitizerValues.MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* DataSanitizerValues.MAX_ID_LENGTH */, 69 /* _eInternalMessageId.IdTooLong */)[_DYN_TO_STRING /* @min:%2etoString */]() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(asString(input));\r\n if (input[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n inputTrunc = strSubstring(input, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return strSubstr(s, s[_DYN_LENGTH /* @min:%2elength */] - 3);\r\n}\r\n//# sourceMappingURL=DataSanitizer.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { isNullOrUndefined, objForEachKey, throwError, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIkey, strNotSpecified } from \"./Constants\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\n/**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item - domain specific properties; part B\r\n * @param baseType - telemetry item type. ie PageViewData\r\n * @param envelopeName - Name of the envelope, e.g., `Microsoft.ApplicationInsights.\\.PageView`.\r\n * @param customProperties - user defined custom properties; part C\r\n * @param systemProperties - system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\nexport function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) {\r\n envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified;\r\n if (isNullOrUndefined(item) ||\r\n isNullOrUndefined(baseType) ||\r\n isNullOrUndefined(envelopeName)) {\r\n throwError(\"Input doesn't contain all required fields\");\r\n }\r\n var iKey = \"\";\r\n if (item[strIkey]) {\r\n iKey = item[strIkey];\r\n delete item[strIkey];\r\n }\r\n var telemetryItem = {\r\n name: envelopeName,\r\n time: toISOString(new Date()),\r\n iKey: iKey,\r\n ext: systemProperties ? systemProperties : {},\r\n tags: [],\r\n data: {},\r\n baseType: baseType,\r\n baseData: item // Part B\r\n };\r\n // Part C\r\n if (!isNullOrUndefined(customProperties)) {\r\n objForEachKey(customProperties, function (prop, value) {\r\n telemetryItem.data[prop] = value;\r\n });\r\n }\r\n return telemetryItem;\r\n}\r\nvar TelemetryItemCreator = /** @class */ (function () {\r\n function TelemetryItemCreator() {\r\n }\r\n /**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item - domain specific properties; part B\r\n * @param baseType - telemetry item type. ie PageViewData\r\n * @param envelopeName - Name of the envelope (e.g., Microsoft.ApplicationInsights.[instrumentationKey].PageView).\r\n * @param customProperties - user defined custom properties; part C\r\n * @param systemProperties - system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\n TelemetryItemCreator.create = createTelemetryItem;\r\n return TelemetryItemCreator;\r\n}());\r\nexport { TelemetryItemCreator };\r\n//# sourceMappingURL=TelemetryItemCreator.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nvar Event = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 1 /* FieldType.Required */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}());\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_MEASUREMENTS, _DYN_MESSAGE, _DYN_PROPERTIES, _DYN_SEVERITY_LEVEL } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from \"./Common/DataSanitizer\";\r\nvar Trace = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the TraceTelemetry object\r\n */\r\n function Trace(logger, message, severityLevel, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n message: 1 /* FieldType.Required */,\r\n severityLevel: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n message = message || strNotSpecified;\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] = dataSanitizeMessage(logger, message);\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = severityLevel;\r\n }\r\n }\r\n Trace.envelopeType = \"Microsoft.ApplicationInsights.{0}.Message\";\r\n Trace.dataType = \"MessageData\";\r\n return Trace;\r\n}());\r\nexport { Trace };\r\n//# sourceMappingURL=Trace.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar DataPoint = /** @class */ (function () {\r\n function DataPoint() {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n name: 1 /* FieldType.Required */,\r\n kind: 0 /* FieldType.Default */,\r\n value: 1 /* FieldType.Required */,\r\n count: 0 /* FieldType.Default */,\r\n min: 0 /* FieldType.Default */,\r\n max: 0 /* FieldType.Default */,\r\n stdDev: 0 /* FieldType.Default */\r\n };\r\n /**\r\n * Metric type. Single measurement or the aggregated value.\r\n */\r\n this.kind = 0 /* DataPointType.Measurement */;\r\n }\r\n return DataPoint;\r\n}());\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_COUNT, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { DataPoint } from \"./Common/DataPoint\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nvar Metric = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n metrics: 1 /* FieldType.Required */,\r\n properties: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n var dataPoint = new DataPoint();\r\n dataPoint[_DYN_COUNT /* @min:%2ecount */] = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n dataPoint.value = value;\r\n dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;\r\n _self.metrics = [dataPoint];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}());\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { mathFloor, mathRound } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\nvar strEmpty = \"\";\r\nexport function stringToBoolOrDefault(str, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n if (str === undefined || str === null) {\r\n return defaultValue;\r\n }\r\n return str.toString()[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === \"true\";\r\n}\r\n/**\r\n * Convert ms to c# time span format\r\n */\r\nexport function msToTimeSpan(totalms) {\r\n if (isNaN(totalms) || totalms < 0) {\r\n totalms = 0;\r\n }\r\n totalms = mathRound(totalms);\r\n var ms = strEmpty + totalms % 1000;\r\n var sec = strEmpty + mathFloor(totalms / 1000) % 60;\r\n var min = strEmpty + mathFloor(totalms / (1000 * 60)) % 60;\r\n var hour = strEmpty + mathFloor(totalms / (1000 * 60 * 60)) % 24;\r\n var days = mathFloor(totalms / (1000 * 60 * 60 * 24));\r\n ms = ms[_DYN_LENGTH /* @min:%2elength */] === 1 ? \"00\" + ms : ms[_DYN_LENGTH /* @min:%2elength */] === 2 ? \"0\" + ms : ms;\r\n sec = sec[_DYN_LENGTH /* @min:%2elength */] < 2 ? \"0\" + sec : sec;\r\n min = min[_DYN_LENGTH /* @min:%2elength */] < 2 ? \"0\" + min : min;\r\n hour = hour[_DYN_LENGTH /* @min:%2elength */] < 2 ? \"0\" + hour : hour;\r\n return (days > 0 ? days + \".\" : strEmpty) + hour + \":\" + min + \":\" + sec + \".\" + ms;\r\n}\r\nexport function getExtensionByName(extensions, identifier) {\r\n var extension = null;\r\n arrForEach(extensions, function (value) {\r\n if (value.identifier === identifier) {\r\n extension = value;\r\n return -1;\r\n }\r\n });\r\n return extension;\r\n}\r\nexport function isCrossOriginError(message, url, lineNumber, columnNumber, error) {\r\n return !error && isString(message) && (message === \"Script error.\" || message === \"Script error\");\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar PageView = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n url: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */,\r\n id: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.id = dataSanitizeId(logger, id);\r\n _self.url = dataSanitizeUrl(logger, url);\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _self[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(durationMs);\r\n }\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}());\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar PageViewPerformance = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n url: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n perfTotal: 0 /* FieldType.Default */,\r\n networkConnect: 0 /* FieldType.Default */,\r\n sentRequest: 0 /* FieldType.Default */,\r\n receivedResponse: 0 /* FieldType.Default */,\r\n domProcessing: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.url = dataSanitizeUrl(logger, url);\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (cs4BaseData) {\r\n _self.domProcessing = cs4BaseData.domProcessing;\r\n _self[_DYN_DURATION /* @min:%2eduration */] = cs4BaseData[_DYN_DURATION /* @min:%2eduration */];\r\n _self.networkConnect = cs4BaseData.networkConnect;\r\n _self.perfTotal = cs4BaseData.perfTotal;\r\n _self.receivedResponse = cs4BaseData.receivedResponse;\r\n _self.sentRequest = cs4BaseData.sentRequest;\r\n }\r\n }\r\n PageViewPerformance.envelopeType = \"Microsoft.ApplicationInsights.{0}.PageviewPerformance\";\r\n PageViewPerformance.dataType = \"PageviewPerformanceData\";\r\n return PageViewPerformance;\r\n}());\r\nexport { PageViewPerformance };\r\n//# sourceMappingURL=PageViewPerformance.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { __assignFn as __assign } from \"@microsoft/applicationinsights-shims\";\r\nimport { arrForEach, arrMap, isArray, isError, isFunction, isNullOrUndefined, isObject, isString, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, getWindow, objFreeze, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_AI_DATA_CONTRACT, _DYN_ASSEMBLY, _DYN_EXCEPTIONS, _DYN_FILE_NAME, _DYN_HAS_FULL_STACK, _DYN_LENGTH, _DYN_LINE, _DYN_MATCH, _DYN_MEASUREMENTS, _DYN_MESSAGE, _DYN_NAME, _DYN_PARSED_STACK, _DYN_PROBLEM_GROUP, _DYN_PROPERTIES, _DYN_SEVERITY_LEVEL, _DYN_SIZE_IN_BYTES, _DYN_SPLIT, _DYN_STRINGIFY, _DYN_TO_STRING, _DYN_TYPE_NAME } from \"../__DynamicConstants\";\r\nimport { dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\n// These Regex covers the following patterns\r\n// 1. Chrome/Firefox/IE/Edge:\r\n// at functionName (filename:lineNumber:columnNumber)\r\n// at functionName (filename:lineNumber)\r\n// at filename:lineNumber:columnNumber\r\n// at filename:lineNumber\r\n// at functionName@filename:lineNumber:columnNumber\r\n// 2. Safari / Opera:\r\n// functionName@filename:lineNumber:columnNumber\r\n// functionName@filename:lineNumber\r\n// filename:lineNumber:columnNumber\r\n// filename:lineNumber\r\n// Line ## of scriptname script filename:lineNumber:columnNumber\r\n// Line ## of scriptname script filename\r\n// 3. IE/Edge (Additional formats)\r\n// at functionName@filename:lineNumber\r\nvar STACKFRAME_BASE_SIZE = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n/**\r\n * Check if the string conforms to what looks like a stack frame line and not just a general message\r\n * comment or other non-stack related info.\r\n *\r\n * This should be used to filter out any leading \"message\" lines from a stack trace, before attempting to parse\r\n * the individual stack frames. Once you have estabilsted the start of the stack frames you can then use the\r\n * FULL_STACK_FRAME_1, FULL_STACK_FRAME_2, FULL_STACK_FRAME_3, and EXTRACT_FILENAME to parse the individual\r\n * stack frames to extract the method, filename, line number, and column number.\r\n * These may still provide invalid matches, so the sequence of execution is important to avoid providing\r\n * an invalid parsed stack.\r\n */\r\nvar IS_FRAME = /^\\s{0,50}(from\\s|at\\s|Line\\s{1,5}\\d{1,10}\\s{1,5}of|\\w{1,50}@\\w{1,80}|[^\\(\\s\\n]+:[0-9\\?]+(?::[0-9\\?]+)?)/;\r\n/**\r\n * Parse a well formed stack frame with both the line and column numbers\r\n * ----------------------------------\r\n * **Primary focus of the matching**\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n */\r\nvar FULL_STACK_FRAME_1 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\]]+):([0-9\\?]+):([0-9\\?]+)\\)?$/;\r\n/**\r\n * Parse a well formed stack frame with only a line number.\r\n * ----------------------------------\r\n * > Note: this WILL also match with line and column number, but the line number is included with the filename\r\n * > you should attempt to match with FULL_STACK_FRAME_1 first.\r\n *\r\n * **Primary focus of the matching (run FULL_STACK_FRAME_1 first)**\r\n * - at functionName (filename:lineNumber)\r\n * - at filename:lineNumber\r\n * - at functionName@filename:lineNumber\r\n * - functionName (filename:lineNumber)\r\n * - filename:lineNumber\r\n * - functionName@filename:lineNumber\r\n *\r\n * **Secondary matches**\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n */\r\nvar FULL_STACK_FRAME_2 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\]]+):([0-9\\?]+)\\)?$/;\r\n/**\r\n * Attempt to Parse a frame that doesn't include a line or column number.\r\n * ----------------------------------\r\n * > Note: this WILL also match lines with a line or line and column number, you should attempt to match with\r\n * both FULL_STACK_FRAME_1 and FULL_STACK_FRAME_2 first to avoid false positives.\r\n *\r\n * **Unexpected Invalid Matches** (Matches that should be avoided -- by using the FULL_STACK_FRAME_1 and FULL_STACK_FRAME_2 first)\r\n * - at https://localhost:44365/static/node_bundles/@microsoft/blah/js/bundle.js:144112:27\r\n * - at https://localhost:44365/static/node_bundles/@microsoft/blah/js/bundle.js:144112:27\r\n *\r\n * **Primary focus of the matching (run FULL_STACK_FRAME_1 first)**\r\n * - at functionName@filename\r\n * - at functionName (filename)\r\n * - at functionName filename\r\n * - at filename <- Will actuall match this as the \"method\" and not the filename (care should be taken to avoid this)\r\n * - functionName@filename\r\n * - functionName (filename)\r\n * - functionName filename\r\n * - functionName\r\n *\r\n * **Secondary matches** (The line and column numbers will be included with the matched filename)\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at functionName (filename:lineNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at filename:lineNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - functionName (filename:lineNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - filename:lineNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber\r\n */\r\nvar FULL_STACK_FRAME_3 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\)\\]]+)\\)?$/;\r\n/**\r\n * Attempt to extract the filename (with or without line and column numbers) from a string.\r\n * ----------------------------------\r\n * > Note: this will only match the filename (with any line or column numbers) and will\r\n * > return what looks like the filename, however, it will also match random strings that\r\n * > look like a filename, so care should be taken to ensure that the filename is actually\r\n * > a filename before using it.\r\n * >\r\n * > It is recommended to use this in conjunction with the FULL_STACK_FRAME_1, FULL_STACK_FRAME_2, and FULL_STACK_FRAME_3\r\n * > to ensure first to reduce false matches, if all of these fail then you can use this to extract the filename from a random\r\n * > strings to identify any potential filename from a known stack frame line.\r\n *\r\n * **Known Invalid matching**\r\n *\r\n * This regex will basically match any \"final\" string of a line or one that is trailed by a comma, so this should not\r\n * be used as the \"only\" matching regex, but rather as a final fallback to extract the filename from a string.\r\n * If you are certain that the string line is a stack frame and not part of the exception message (lines before the stack)\r\n * or trailing comments, then you can use this to extract the filename and then further parse with PARSE_FILENAME_LINE_COL\r\n * and PARSE_FILENAME_LINE_ONLY to extract any potential the line and column numbers.\r\n *\r\n * **Primary focus of the matching**\r\n * - at (anonymous) @ VM60:1\r\n * - Line 21 of linked script file://localhost/C:/Temp/stacktrace.js\r\n * - Line 11 of inline#1 script in http://localhost:3000/static/js/main.206f4846.js:2:296748\r\n * - Line 68 of inline#2 script in file://localhost/teststack.html\r\n * - at Global code (http://example.com/stacktrace.js:11:1)\r\n */\r\nvar EXTRACT_FILENAME = /(?:^|\\(|\\s{0,10}[\\w\\)]+\\@)?([^\\(\\n\\s\\]\\)]+)(?:\\:([0-9]+)(?:\\:([0-9]+))?)?\\)?(?:,|$)/;\r\n/**\r\n * Attempt to extract the filename, line number, and column number from a string.\r\n */\r\nvar PARSE_FILENAME_LINE_COL = /([^\\(\\s\\n]+):([0-9]+):([0-9]+)$/;\r\n/**\r\n * Attempt to extract the filename and line number from a string.\r\n */\r\nvar PARSE_FILENAME_LINE_ONLY = /([^\\(\\s\\n]+):([0-9]+)$/;\r\nvar NoMethod = \"\";\r\nvar strError = \"error\";\r\nvar strStack = \"stack\";\r\nvar strStackDetails = \"stackDetails\";\r\nvar strErrorSrc = \"errorSrc\";\r\nvar strMessage = \"message\";\r\nvar strDescription = \"description\";\r\nvar _parseSequence = [\r\n { re: FULL_STACK_FRAME_1, len: 5, m: 1, fn: 2, ln: 3, col: 4 },\r\n { chk: _ignoreNative, pre: _scrubAnonymous, re: FULL_STACK_FRAME_2, len: 4, m: 1, fn: 2, ln: 3 },\r\n { re: FULL_STACK_FRAME_3, len: 3, m: 1, fn: 2, hdl: _handleFilename },\r\n { re: EXTRACT_FILENAME, len: 2, fn: 1, hdl: _handleFilename }\r\n];\r\nfunction _scrubAnonymous(frame) {\r\n return frame.replace(/(\\(anonymous\\))/, \"\");\r\n}\r\nfunction _ignoreNative(frame) {\r\n return strIndexOf(frame, \"[native\") < 0;\r\n}\r\nfunction _stringify(value, convertToString) {\r\n var result = value;\r\n if (result && !isString(result)) {\r\n if (JSON && JSON[_DYN_STRINGIFY /* @min:%2estringify */]) {\r\n result = JSON[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n if (convertToString && (!result || result === \"{}\")) {\r\n if (isFunction(value[_DYN_TO_STRING /* @min:%2etoString */])) {\r\n result = value[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n else {\r\n result = \"\" + value;\r\n }\r\n }\r\n }\r\n else {\r\n result = \"\" + value + \" - (Missing JSON.stringify)\";\r\n }\r\n }\r\n return result || \"\";\r\n}\r\nfunction _formatMessage(theEvent, errorType) {\r\n var evtMessage = theEvent;\r\n if (theEvent) {\r\n if (evtMessage && !isString(evtMessage)) {\r\n evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage;\r\n }\r\n // Make sure the message is a string\r\n if (evtMessage && !isString(evtMessage)) {\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n evtMessage = _stringify(evtMessage, true);\r\n }\r\n if (theEvent[\"filename\"]) {\r\n // Looks like an event object with filename\r\n evtMessage = evtMessage + \" @\" + (theEvent[\"filename\"] || \"\") + \":\" + (theEvent[\"lineno\"] || \"?\") + \":\" + (theEvent[\"colno\"] || \"?\");\r\n }\r\n }\r\n // Automatically add the error type to the message if it does already appear to be present\r\n if (errorType && errorType !== \"String\" && errorType !== \"Object\" && errorType !== \"Error\" && strIndexOf(evtMessage || \"\", errorType) === -1) {\r\n evtMessage = errorType + \": \" + evtMessage;\r\n }\r\n return evtMessage || \"\";\r\n}\r\nfunction _isExceptionDetailsInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return \"hasFullStack\" in value && \"typeName\" in value;\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 false;\r\n}\r\nfunction _isExceptionInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return (\"ver\" in value && \"exceptions\" in value && \"properties\" in value);\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 false;\r\n}\r\nfunction _isStackDetails(details) {\r\n return details && details.src && isString(details.src) && details.obj && isArray(details.obj);\r\n}\r\nfunction _convertStackObj(errorStack) {\r\n var src = errorStack || \"\";\r\n if (!isString(src)) {\r\n if (isString(src[strStack])) {\r\n src = src[strStack];\r\n }\r\n else {\r\n src = \"\" + src;\r\n }\r\n }\r\n var items = src[_DYN_SPLIT /* @min:%2esplit */](\"\\n\");\r\n return {\r\n src: src,\r\n obj: items\r\n };\r\n}\r\nfunction _getOperaStack(errorMessage) {\r\n var stack = [];\r\n var lines = errorMessage[_DYN_SPLIT /* @min:%2esplit */](\"\\n\");\r\n for (var lp = 0; lp < lines[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var entry = lines[lp];\r\n if (lines[lp + 1]) {\r\n entry += \"@\" + lines[lp + 1];\r\n lp++;\r\n }\r\n stack.push(entry);\r\n }\r\n return {\r\n src: errorMessage,\r\n obj: stack\r\n };\r\n}\r\nfunction _getStackFromErrorObj(errorObj) {\r\n var details = null;\r\n if (errorObj) {\r\n try {\r\n /* Using bracket notation is support older browsers (IE 7/8 -- dont remember the version) that throw when using dot\r\n notation for undefined objects and we don't want to loose the error from being reported */\r\n if (errorObj[strStack]) {\r\n // Chrome/Firefox\r\n details = _convertStackObj(errorObj[strStack]);\r\n }\r\n else if (errorObj[strError] && errorObj[strError][strStack]) {\r\n // Edge error event provides the stack and error object\r\n details = _convertStackObj(errorObj[strError][strStack]);\r\n }\r\n else if (errorObj[\"exception\"] && errorObj.exception[strStack]) {\r\n details = _convertStackObj(errorObj.exception[strStack]);\r\n }\r\n else if (_isStackDetails(errorObj)) {\r\n details = errorObj;\r\n }\r\n else if (_isStackDetails(errorObj[strStackDetails])) {\r\n details = errorObj[strStackDetails];\r\n }\r\n else if (getWindow() && getWindow()[\"opera\"] && errorObj[strMessage]) {\r\n // Opera\r\n details = _getOperaStack(errorObj[_DYN_MESSAGE /* @min:%2emessage */]);\r\n }\r\n else if (errorObj[\"reason\"] && errorObj.reason[strStack]) {\r\n // UnhandledPromiseRejection\r\n details = _convertStackObj(errorObj.reason[strStack]);\r\n }\r\n else if (isString(errorObj)) {\r\n details = _convertStackObj(errorObj);\r\n }\r\n else {\r\n var evtMessage = errorObj[strMessage] || errorObj[strDescription] || \"\";\r\n if (isString(errorObj[strErrorSrc])) {\r\n if (evtMessage) {\r\n evtMessage += \"\\n\";\r\n }\r\n evtMessage += \" from \" + errorObj[strErrorSrc];\r\n }\r\n if (evtMessage) {\r\n details = _convertStackObj(evtMessage);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // something unexpected happened so to avoid failing to report any error lets swallow the exception\r\n // and fallback to the callee/caller method\r\n details = _convertStackObj(e);\r\n }\r\n }\r\n return details || {\r\n src: \"\",\r\n obj: null\r\n };\r\n}\r\nfunction _formatStackTrace(stackDetails) {\r\n var stack = \"\";\r\n if (stackDetails) {\r\n if (stackDetails.obj) {\r\n stack = stackDetails.obj.join(\"\\n\");\r\n }\r\n else {\r\n stack = stackDetails.src || \"\";\r\n }\r\n }\r\n return stack;\r\n}\r\nfunction _parseStack(stack) {\r\n var parsedStack;\r\n var frames = stack.obj;\r\n if (frames && frames[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n parsedStack = [];\r\n var level_1 = 0;\r\n var foundStackStart_1 = false;\r\n var totalSizeInBytes_1 = 0;\r\n arrForEach(frames, function (frame) {\r\n if (foundStackStart_1 || _isStackFrame(frame)) {\r\n var theFrame = asString(frame);\r\n // Once we have found the first stack frame we treat the rest of the lines as part of the stack\r\n foundStackStart_1 = true;\r\n var parsedFrame = _extractStackFrame(theFrame, level_1);\r\n if (parsedFrame) {\r\n totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n parsedStack.push(parsedFrame);\r\n level_1++;\r\n }\r\n }\r\n });\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes_1 > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack[_DYN_LENGTH /* @min:%2elength */] - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left][_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n var rSize = parsedStack[right][_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n}\r\nfunction _getErrorType(errorType) {\r\n // Gets the Error Type by passing the constructor (used to get the true type of native error object).\r\n var typeName = \"\";\r\n if (errorType) {\r\n typeName = errorType.typeName || errorType[_DYN_NAME /* @min:%2ename */] || \"\";\r\n if (!typeName) {\r\n try {\r\n var funcNameRegex = /function (.{1,200})\\(/;\r\n var results = (funcNameRegex).exec((errorType).constructor[_DYN_TO_STRING /* @min:%2etoString */]());\r\n typeName = (results && results[_DYN_LENGTH /* @min:%2elength */] > 1) ? results[1] : \"\";\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n }\r\n return typeName;\r\n}\r\n/**\r\n * Formats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.\r\n * @param errorObj - The supplied errorObj\r\n */\r\nexport function _formatErrorCode(errorObj) {\r\n if (errorObj) {\r\n try {\r\n if (!isString(errorObj)) {\r\n var errorType = _getErrorType(errorObj);\r\n var result = _stringify(errorObj, false);\r\n if (!result || result === \"{}\") {\r\n if (errorObj[strError]) {\r\n // Looks like an MS Error Event\r\n errorObj = errorObj[strError];\r\n errorType = _getErrorType(errorObj);\r\n }\r\n result = _stringify(errorObj, true);\r\n }\r\n if (strIndexOf(result, errorType) !== 0 && errorType !== \"String\") {\r\n return errorType + \":\" + result;\r\n }\r\n return result;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n // Fallback to just letting the object format itself into a string\r\n return \"\" + (errorObj || \"\");\r\n}\r\nvar Exception = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n exceptions: 1 /* FieldType.Required */,\r\n severityLevel: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!_isExceptionInternal(exception)) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n if (id) {\r\n properties.id = id;\r\n }\r\n _self[_DYN_EXCEPTIONS /* @min:%2eexceptions */] = [_createExceptionDetails(logger, exception, properties)];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = severityLevel;\r\n }\r\n if (id) {\r\n _self.id = id;\r\n }\r\n }\r\n else {\r\n _self[_DYN_EXCEPTIONS /* @min:%2eexceptions */] = exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */] || [];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = exception[_DYN_PROPERTIES /* @min:%2eproperties */];\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = exception[_DYN_MEASUREMENTS /* @min:%2emeasurements */];\r\n if (exception[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */]) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = exception[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */];\r\n }\r\n if (exception.id) {\r\n _self.id = exception.id;\r\n exception[_DYN_PROPERTIES /* @min:%2eproperties */].id = exception.id;\r\n }\r\n if (exception[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */]) {\r\n _self[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */] = exception[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */];\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n if (!isNullOrUndefined(exception.isManual)) {\r\n _self.isManual = exception.isManual;\r\n }\r\n }\r\n }\r\n Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {\r\n var errorType = _getErrorType(error || evt || message);\r\n return {\r\n message: _formatMessage(message, errorType),\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: _formatErrorCode(error || evt || message),\r\n evt: _formatErrorCode(evt || message),\r\n typeName: errorType,\r\n stackDetails: _getStackFromErrorObj(stack || error || evt),\r\n errorSrc: errorSrc\r\n };\r\n };\r\n Exception.CreateFromInterface = function (logger, exception, properties, measurements) {\r\n var exceptions = exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */]\r\n && arrMap(exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */], function (ex) { return _createExDetailsFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, __assign(__assign({}, exception), { exceptions: exceptions }), properties, measurements);\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n var _a;\r\n return {\r\n exceptions: [\r\n (_a = {},\r\n _a[_DYN_HAS_FULL_STACK /* @min:hasFullStack */] = true,\r\n _a.message = message,\r\n _a.stack = details,\r\n _a.typeName = typeName,\r\n _a)\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n Exception.formatError = _formatErrorCode;\r\n return Exception;\r\n}());\r\nexport { Exception };\r\nvar exDetailsAiDataContract = objFreeze({\r\n id: 0 /* FieldType.Default */,\r\n outerId: 0 /* FieldType.Default */,\r\n typeName: 1 /* FieldType.Required */,\r\n message: 1 /* FieldType.Required */,\r\n hasFullStack: 0 /* FieldType.Default */,\r\n stack: 0 /* FieldType.Default */,\r\n parsedStack: 2 /* FieldType.Array */\r\n});\r\nfunction _toInterface() {\r\n var _self = this;\r\n var parsedStack = isArray(_self[_DYN_PARSED_STACK /* @min:%2eparsedStack */])\r\n && arrMap(_self[_DYN_PARSED_STACK /* @min:%2eparsedStack */], function (frame) { return _parsedFrameToInterface(frame); });\r\n var exceptionDetailsInterface = {\r\n id: _self.id,\r\n outerId: _self.outerId,\r\n typeName: _self[_DYN_TYPE_NAME /* @min:%2etypeName */],\r\n message: _self[_DYN_MESSAGE /* @min:%2emessage */],\r\n hasFullStack: _self[_DYN_HAS_FULL_STACK /* @min:%2ehasFullStack */],\r\n stack: _self[strStack],\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n}\r\nexport function _createExceptionDetails(logger, exception, properties) {\r\n var _a;\r\n var id;\r\n var outerId;\r\n var typeName;\r\n var message;\r\n var hasFullStack;\r\n var theStack;\r\n var parsedStack;\r\n if (!_isExceptionDetailsInternal(exception)) {\r\n var error = exception;\r\n var evt = error && error.evt;\r\n if (!isError(error)) {\r\n error = error[strError] || evt || error;\r\n }\r\n typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;\r\n message = dataSanitizeMessage(logger, _formatMessage(exception || error, typeName)) || strNotSpecified;\r\n var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);\r\n parsedStack = _parseStack(stack);\r\n // after parsedStack is inited, iterate over each frame object, sanitize its assembly field\r\n if (isArray(parsedStack)) {\r\n arrMap(parsedStack, function (frame) {\r\n frame[_DYN_ASSEMBLY /* @min:%2eassembly */] = dataSanitizeString(logger, frame[_DYN_ASSEMBLY /* @min:%2eassembly */]);\r\n frame[_DYN_FILE_NAME /* @min:%2efileName */] = dataSanitizeString(logger, frame[_DYN_FILE_NAME /* @min:%2efileName */]);\r\n });\r\n }\r\n theStack = dataSanitizeException(logger, _formatStackTrace(stack));\r\n hasFullStack = isArray(parsedStack) && parsedStack[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n if (properties) {\r\n properties[_DYN_TYPE_NAME /* @min:%2etypeName */] = properties[_DYN_TYPE_NAME /* @min:%2etypeName */] || typeName;\r\n }\r\n }\r\n else {\r\n typeName = exception[_DYN_TYPE_NAME /* @min:%2etypeName */];\r\n message = exception[_DYN_MESSAGE /* @min:%2emessage */];\r\n theStack = exception[strStack];\r\n parsedStack = exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */] || [];\r\n hasFullStack = exception[_DYN_HAS_FULL_STACK /* @min:%2ehasFullStack */];\r\n }\r\n return _a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = exDetailsAiDataContract,\r\n _a.id = id,\r\n _a.outerId = outerId,\r\n _a.typeName = typeName,\r\n _a.message = message,\r\n _a[_DYN_HAS_FULL_STACK /* @min:hasFullStack */] = hasFullStack,\r\n _a.stack = theStack,\r\n _a.parsedStack = parsedStack,\r\n _a.toInterface = _toInterface,\r\n _a;\r\n}\r\nexport function _createExDetailsFromInterface(logger, exception) {\r\n var parsedStack = (isArray(exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */])\r\n && arrMap(exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */], function (frame) { return _stackFrameFromInterface(frame); }))\r\n || exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */];\r\n var exceptionDetails = _createExceptionDetails(logger, __assign(__assign({}, exception), { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n}\r\nfunction _parseFilename(theFrame, fileName) {\r\n var lineCol = fileName[_DYN_MATCH /* @min:%2ematch */](PARSE_FILENAME_LINE_COL);\r\n if (lineCol && lineCol[_DYN_LENGTH /* @min:%2elength */] >= 4) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = lineCol[1];\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(lineCol[2]);\r\n }\r\n else {\r\n var lineNo = fileName[_DYN_MATCH /* @min:%2ematch */](PARSE_FILENAME_LINE_ONLY);\r\n if (lineNo && lineNo[_DYN_LENGTH /* @min:%2elength */] >= 3) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = lineNo[1];\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(lineNo[2]);\r\n }\r\n else {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = fileName;\r\n }\r\n }\r\n}\r\nfunction _handleFilename(theFrame, sequence, matches) {\r\n var filename = theFrame[_DYN_FILE_NAME /* @min:%2efileName */];\r\n if (sequence.fn && matches && matches[_DYN_LENGTH /* @min:%2elength */] > sequence.fn) {\r\n if (sequence.ln && matches[_DYN_LENGTH /* @min:%2elength */] > sequence.ln) {\r\n filename = strTrim(matches[sequence.fn] || \"\");\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(strTrim(matches[sequence.ln] || \"\")) || 0;\r\n }\r\n else {\r\n filename = strTrim(matches[sequence.fn] || \"\");\r\n }\r\n }\r\n if (filename) {\r\n _parseFilename(theFrame, filename);\r\n }\r\n}\r\nfunction _isStackFrame(frame) {\r\n var result = false;\r\n if (frame && isString(frame)) {\r\n var trimmedFrame = strTrim(frame);\r\n if (trimmedFrame) {\r\n result = IS_FRAME.test(trimmedFrame);\r\n }\r\n }\r\n return result;\r\n}\r\nvar stackFrameAiDataContract = objFreeze({\r\n level: 1 /* FieldType.Required */,\r\n method: 1 /* FieldType.Required */,\r\n assembly: 0 /* FieldType.Default */,\r\n fileName: 0 /* FieldType.Default */,\r\n line: 0 /* FieldType.Default */\r\n});\r\nexport function _extractStackFrame(frame, level) {\r\n var _a;\r\n var theFrame;\r\n if (frame && isString(frame) && strTrim(frame)) {\r\n theFrame = (_a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = stackFrameAiDataContract,\r\n _a.level = level,\r\n _a.assembly = strTrim(frame),\r\n _a.method = NoMethod,\r\n _a.fileName = \"\",\r\n _a.line = 0,\r\n _a.sizeInBytes = 0,\r\n _a);\r\n var idx = 0;\r\n while (idx < _parseSequence[_DYN_LENGTH /* @min:%2elength */]) {\r\n var sequence = _parseSequence[idx];\r\n if (sequence.chk && !sequence.chk(frame)) {\r\n break;\r\n }\r\n if (sequence.pre) {\r\n frame = sequence.pre(frame);\r\n }\r\n // Attempt to \"parse\" the stack frame\r\n var matches = frame[_DYN_MATCH /* @min:%2ematch */](sequence.re);\r\n if (matches && matches[_DYN_LENGTH /* @min:%2elength */] >= sequence.len) {\r\n if (sequence.m) {\r\n theFrame.method = strTrim(matches[sequence.m] || NoMethod);\r\n }\r\n if (sequence.hdl) {\r\n // Run any custom handler\r\n sequence.hdl(theFrame, sequence, matches);\r\n }\r\n else if (sequence.fn) {\r\n if (sequence.ln) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = strTrim(matches[sequence.fn] || \"\");\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(strTrim(matches[sequence.ln] || \"\")) || 0;\r\n }\r\n else {\r\n _parseFilename(theFrame, matches[sequence.fn] || \"\");\r\n }\r\n }\r\n // We found a match so stop looking\r\n break;\r\n }\r\n idx++;\r\n }\r\n }\r\n return _populateFrameSizeInBytes(theFrame);\r\n}\r\nfunction _stackFrameFromInterface(frame) {\r\n var _a;\r\n var parsedFrame = (_a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = stackFrameAiDataContract,\r\n _a.level = frame.level,\r\n _a.method = frame.method,\r\n _a.assembly = frame[_DYN_ASSEMBLY /* @min:%2eassembly */],\r\n _a.fileName = frame[_DYN_FILE_NAME /* @min:%2efileName */],\r\n _a.line = frame[_DYN_LINE /* @min:%2eline */],\r\n _a.sizeInBytes = 0,\r\n _a);\r\n return _populateFrameSizeInBytes(parsedFrame);\r\n}\r\nfunction _populateFrameSizeInBytes(frame) {\r\n var sizeInBytes = STACKFRAME_BASE_SIZE;\r\n if (frame) {\r\n sizeInBytes += frame.method[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.assembly[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.fileName[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.level.toString()[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.line.toString()[_DYN_LENGTH /* @min:%2elength */];\r\n frame[_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */] = sizeInBytes;\r\n }\r\n return frame;\r\n}\r\nexport function _parsedFrameToInterface(frame) {\r\n return {\r\n level: frame.level,\r\n method: frame.method,\r\n assembly: frame[_DYN_ASSEMBLY /* @min:%2eassembly */],\r\n fileName: frame[_DYN_FILE_NAME /* @min:%2efileName */],\r\n line: frame[_DYN_LINE /* @min:%2eline */]\r\n };\r\n}\r\n//# sourceMappingURL=Exception.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { random32 } from \"./RandomHelper\";\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\nexport function newGuid() {\r\n var uuid = generateW3CId();\r\n return strSubstring(uuid, 0, 8) + \"-\" + strSubstring(uuid, 8, 12) + \"-\" + strSubstring(uuid, 12, 16) + \"-\" + strSubstring(uuid, 16, 20) + \"-\" + strSubstring(uuid, 20);\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[_DYN_LENGTH /* @min:%2elength */];\r\n var start = len - search[_DYN_LENGTH /* @min:%2elength */];\r\n return strSubstring(value, 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 = STR_EMPTY, 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 strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + \"4\" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12);\r\n}\r\n//# sourceMappingURL=CoreUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { arrForEach, isArray, isString, strLeft, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_ATTRIBUTE, _DYN_LENGTH, _DYN_PUSH, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS, _DYN_VERSION } from \"../__DynamicConstants\";\r\nimport { generateW3CId } from \"./CoreUtils\";\r\nimport { findMetaTag, findNamedServerTiming } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n// using {0,16} for leading and trailing whitespace just to constrain the possible runtime of a random string\r\nvar TRACE_PARENT_REGEX = /^([\\da-f]{2})-([\\da-f]{32})-([\\da-f]{16})-([\\da-f]{2})(-[^\\s]{1,64})?$/i;\r\nvar DEFAULT_VERSION = \"00\";\r\nvar INVALID_VERSION = \"ff\";\r\nvar INVALID_TRACE_ID = \"00000000000000000000000000000000\";\r\nvar INVALID_SPAN_ID = \"0000000000000000\";\r\nvar SAMPLED_FLAG = 0x01;\r\nfunction _isValid(value, len, invalidValue) {\r\n if (value && value[_DYN_LENGTH /* @min:%2elength */] === len && value !== invalidValue) {\r\n return !!value.match(/^[\\da-f]*$/i);\r\n }\r\n return false;\r\n}\r\nfunction _formatValue(value, len, defValue) {\r\n if (_isValid(value, len)) {\r\n return value;\r\n }\r\n return defValue;\r\n}\r\nfunction _formatFlags(value) {\r\n if (isNaN(value) || value < 0 || value > 255) {\r\n value = 0x01;\r\n }\r\n var result = value.toString(16);\r\n while (result[_DYN_LENGTH /* @min:%2elength */] < 2) {\r\n result = \"0\" + result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Create a new ITraceParent instance using the provided values.\r\n * @param traceId - The traceId to use, when invalid a new random W3C id will be generated.\r\n * @param spanId - The parent/span id to use, a new random value will be generated if it is invalid.\r\n * @param flags - The traceFlags to use, defaults to zero (0) if not supplied or invalid\r\n * @param version - The version to used, defaults to version \"01\" if not supplied or invalid.\r\n * @returns\r\n */\r\nexport function createTraceParent(traceId, spanId, flags, version) {\r\n return {\r\n version: _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION,\r\n traceId: isValidTraceId(traceId) ? traceId : generateW3CId(),\r\n spanId: isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16),\r\n traceFlags: flags >= 0 && flags <= 0xFF ? flags : 1\r\n };\r\n}\r\n/**\r\n * Attempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)\r\n *\r\n * @param value - The value to be parsed\r\n * @param selectIdx - If the found value is comma separated which is the preferred entry to select, defaults to the first\r\n * @returns\r\n */\r\nexport function parseTraceParent(value, selectIdx) {\r\n if (!value) {\r\n // Don't pass a null/undefined or empty string\r\n return null;\r\n }\r\n if (isArray(value)) {\r\n // The value may have been encoded on the page into an array so handle this automatically\r\n value = value[0] || \"\";\r\n }\r\n if (!value || !isString(value) || value[_DYN_LENGTH /* @min:%2elength */] > 8192) {\r\n // limit potential processing based on total length\r\n return null;\r\n }\r\n if (value.indexOf(\",\") !== -1) {\r\n var values = value[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n value = values[selectIdx > 0 && values[_DYN_LENGTH /* @min:%2elength */] > selectIdx ? selectIdx : 0];\r\n }\r\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\r\n var match = TRACE_PARENT_REGEX.exec(strTrim(value));\r\n if (!match || // No match\r\n match[1] === INVALID_VERSION || // version ff is forbidden\r\n match[2] === INVALID_TRACE_ID || // All zeros is considered to be invalid\r\n match[3] === INVALID_SPAN_ID) { // All zeros is considered to be invalid\r\n return null;\r\n }\r\n return {\r\n version: (match[1] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n traceId: (match[2] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n spanId: (match[3] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n traceFlags: parseInt(match[4], 16)\r\n };\r\n}\r\n/**\r\n * Is the provided W3c Trace Id a valid string representation, it must be a 32-character string\r\n * of lowercase hexadecimal characters for example, 4bf92f3577b34da6a3ce929d0e0e4736.\r\n * If all characters as zero (00000000000000000000000000000000) it will be considered an invalid value.\r\n * @param value - The W3c trace Id to be validated\r\n * @returns true if valid otherwise false\r\n */\r\nexport function isValidTraceId(value) {\r\n return _isValid(value, 32, INVALID_TRACE_ID);\r\n}\r\n/**\r\n * Is the provided W3c span id (aka. parent id) a valid string representation, it must be a 16-character\r\n * string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7.\r\n * If all characters are zero (0000000000000000) this is considered an invalid value.\r\n * @param value - The W3c span id to be validated\r\n * @returns true if valid otherwise false\r\n */\r\nexport function isValidSpanId(value) {\r\n return _isValid(value, 16, INVALID_SPAN_ID);\r\n}\r\n/**\r\n * Validates that the provided ITraceParent instance conforms to the currently supported specifications\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function isValidTraceParent(value) {\r\n if (!value ||\r\n !_isValid(value[_DYN_VERSION /* @min:%2eversion */], 2, INVALID_VERSION) ||\r\n !_isValid(value.traceId, 32, INVALID_TRACE_ID) ||\r\n !_isValid(value.spanId, 16, INVALID_SPAN_ID) ||\r\n !_isValid(_formatFlags(value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]), 2)) {\r\n // Each known field must contain a valid value\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * Is the parsed traceParent indicating that the trace is currently sampled.\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function isSampledFlag(value) {\r\n if (isValidTraceParent(value)) {\r\n return (value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] & SAMPLED_FLAG) === SAMPLED_FLAG;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Format the ITraceParent value as a string using the supported and know version formats.\r\n * So even if the passed traceParent is a later version the string value returned from this\r\n * function will convert it to only the known version formats.\r\n * This currently only supports version \"00\" and invalid \"ff\"\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function formatTraceParent(value) {\r\n if (value) {\r\n // Special Note: This only supports formatting as version 00, future versions should encode any known supported version\r\n // So parsing a future version will populate the correct version value but reformatting will reduce it to version 00.\r\n var flags = _formatFlags(value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]);\r\n if (!_isValid(flags, 2)) {\r\n flags = \"01\";\r\n }\r\n var version = value[_DYN_VERSION /* @min:%2eversion */] || DEFAULT_VERSION;\r\n if (version !== \"00\" && version !== \"ff\") {\r\n // Reduce version to \"00\"\r\n version = DEFAULT_VERSION;\r\n }\r\n // Format as version 00\r\n return \"\".concat(version.toLowerCase(), \"-\").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), \"-\").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), \"-\").concat(flags.toLowerCase());\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.\r\n * @param selectIdx - If the found value is comma separated which is the preferred entry to select, defaults to the first\r\n * @returns\r\n */\r\nexport function findW3cTraceParent(selectIdx) {\r\n var name = \"traceparent\";\r\n var traceParent = parseTraceParent(findMetaTag(name), selectIdx);\r\n if (!traceParent) {\r\n traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);\r\n }\r\n return traceParent;\r\n}\r\n/**\r\n * Find all script tags in the provided document and return the information about them.\r\n * @param doc - The document to search for script tags\r\n * @returns\r\n */\r\nexport function findAllScripts(doc) {\r\n var scripts = doc.getElementsByTagName(\"script\");\r\n var result = [];\r\n arrForEach(scripts, function (script) {\r\n var src = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"src\");\r\n if (src) {\r\n var crossOrigin = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"crossorigin\");\r\n var async = script.hasAttribute(\"async\") === true;\r\n var defer = script.hasAttribute(\"defer\") === true;\r\n var referrerPolicy = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"referrerpolicy\");\r\n var info = { url: src };\r\n if (crossOrigin) {\r\n info.crossOrigin = crossOrigin;\r\n }\r\n if (async) {\r\n info.async = async;\r\n }\r\n if (defer) {\r\n info.defer = defer;\r\n }\r\n if (referrerPolicy) {\r\n info.referrerPolicy = referrerPolicy;\r\n }\r\n result[_DYN_PUSH /* @min:%2epush */](info);\r\n }\r\n });\r\n return result;\r\n}\r\n//# sourceMappingURL=W3cTraceParent.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { createValueMap } from \"@microsoft/applicationinsights-core-js\";\r\nexport var RequestHeaders = createValueMap({\r\n requestContextHeader: [0 /* eRequestHeaders.requestContextHeader */, \"Request-Context\"],\r\n requestContextTargetKey: [1 /* eRequestHeaders.requestContextTargetKey */, \"appId\"],\r\n requestContextAppIdFormat: [2 /* eRequestHeaders.requestContextAppIdFormat */, \"appId=cid-v1:\"],\r\n requestIdHeader: [3 /* eRequestHeaders.requestIdHeader */, \"Request-Id\"],\r\n traceParentHeader: [4 /* eRequestHeaders.traceParentHeader */, \"traceparent\"],\r\n traceStateHeader: [5 /* eRequestHeaders.traceStateHeader */, \"tracestate\"],\r\n sdkContextHeader: [6 /* eRequestHeaders.sdkContextHeader */, \"Sdk-Context\"],\r\n sdkContextHeaderAppIdRequest: [7 /* eRequestHeaders.sdkContextHeaderAppIdRequest */, \"appId\"],\r\n requestContextHeaderLowerCase: [8 /* eRequestHeaders.requestContextHeaderLowerCase */, \"request-context\"]\r\n});\r\n//# sourceMappingURL=RequestResponseHeaders.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getDocument, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_LENGTH, _DYN_MATCH, _DYN_PATHNAME, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\nvar _document = getDocument() || {};\r\nvar _htmlAnchorIdx = 0;\r\n// Use an array of temporary values as it's possible for multiple calls to parseUrl() will be called with different URLs\r\n// Using a cache size of 5 for now as it current depth usage is at least 2, so adding a minor buffer to handle future updates\r\nvar _htmlAnchorElement = [null, null, null, null, null];\r\nexport function urlParseUrl(url) {\r\n var anchorIdx = _htmlAnchorIdx;\r\n var anchorCache = _htmlAnchorElement;\r\n var tempAnchor = anchorCache[anchorIdx];\r\n if (!_document.createElement) {\r\n // Always create the temp instance if createElement is not available\r\n tempAnchor = { host: urlParseHost(url, true) };\r\n }\r\n else if (!anchorCache[anchorIdx]) {\r\n // Create and cache the unattached anchor instance\r\n tempAnchor = anchorCache[anchorIdx] = _document.createElement(\"a\");\r\n }\r\n tempAnchor.href = url;\r\n // Move the cache index forward\r\n anchorIdx++;\r\n if (anchorIdx >= anchorCache[_DYN_LENGTH /* @min:%2elength */]) {\r\n anchorIdx = 0;\r\n }\r\n _htmlAnchorIdx = anchorIdx;\r\n return tempAnchor;\r\n}\r\nexport function urlGetAbsoluteUrl(url) {\r\n var result;\r\n var a = urlParseUrl(url);\r\n if (a) {\r\n result = a.href;\r\n }\r\n return result;\r\n}\r\nexport function urlGetPathName(url) {\r\n var result;\r\n var a = urlParseUrl(url);\r\n if (a) {\r\n result = a[_DYN_PATHNAME /* @min:%2epathname */];\r\n }\r\n return result;\r\n}\r\nexport function urlGetCompleteUrl(method, absoluteUrl) {\r\n if (method) {\r\n return method.toUpperCase() + \" \" + absoluteUrl;\r\n }\r\n return absoluteUrl;\r\n}\r\n// Fallback method to grab host from url if document.createElement method is not available\r\nexport function urlParseHost(url, inclPort) {\r\n var fullHost = urlParseFullHost(url, inclPort) || \"\";\r\n if (fullHost) {\r\n var match = fullHost[_DYN_MATCH /* @min:%2ematch */](/(www\\d{0,5}\\.)?([^\\/:]{1,256})(:\\d{1,20})?/i);\r\n if (match != null && match[_DYN_LENGTH /* @min:%2elength */] > 3 && isString(match[2]) && match[2][_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n return match[2] + (match[3] || \"\");\r\n }\r\n }\r\n return fullHost;\r\n}\r\nexport function urlParseFullHost(url, inclPort) {\r\n var result = null;\r\n if (url) {\r\n var match = url[_DYN_MATCH /* @min:%2ematch */](/(\\w{1,150}):\\/\\/([^\\/:]{1,256})(:\\d{1,20})?/i);\r\n if (match != null && match[_DYN_LENGTH /* @min:%2elength */] > 2 && isString(match[2]) && match[2][_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n result = match[2] || \"\";\r\n if (inclPort && match[_DYN_LENGTH /* @min:%2elength */] > 2) {\r\n var protocol = (match[1] || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var port = match[3] || \"\";\r\n // IE includes the standard port so pass it off if it's the same as the protocol\r\n if (protocol === \"http\" && port === \":80\") {\r\n port = \"\";\r\n }\r\n else if (protocol === \"https\" && port === \":443\") {\r\n port = \"\";\r\n }\r\n result += port;\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=UrlHelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId, isValidTraceId } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from \"./Constants\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { urlParseFullHost, urlParseUrl } from \"./UrlHelperFuncs\";\r\nimport { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\n// listing only non-geo specific locations\r\nvar _internalEndpoints = [\r\n DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,\r\n \"https://breeze.aimon.applicationinsights.io\" + DEFAULT_BREEZE_PATH,\r\n \"https://dc-int.services.visualstudio.com\" + DEFAULT_BREEZE_PATH\r\n];\r\nvar _correlationIdPrefix = \"cid-v1:\";\r\nexport function isInternalApplicationInsightsEndpoint(endpointUrl) {\r\n return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) !== -1;\r\n}\r\nexport function correlationIdSetPrefix(prefix) {\r\n _correlationIdPrefix = prefix;\r\n}\r\nexport function correlationIdGetPrefix() {\r\n return _correlationIdPrefix;\r\n}\r\n/**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\nexport function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n if (config && config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */]) {\r\n for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */][i].test(requestUrl)) {\r\n return false;\r\n }\r\n }\r\n }\r\n var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n if (requestHost && (strIndexOf(requestHost, \":443\") !== -1 || strIndexOf(requestHost, \":80\") !== -1)) {\r\n // [Bug #1260] IE can include the port even for http and https URLs so if present\r\n // try and parse it to remove if it matches the default protocol port\r\n requestHost = (urlParseFullHost(requestUrl, true) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\n/**\r\n * Combines target appId and target role name from response header.\r\n */\r\nexport function correlationIdGetCorrelationContext(responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 /* eRequestHeaders.requestContextTargetKey */]);\r\n if (correlationId && correlationId !== _correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets key from correlation response header\r\n */\r\nexport function correlationIdGetCorrelationContextValue(responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n for (var i = 0; i < keyValues[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n var keyValue = keyValues[i][_DYN_SPLIT /* @min:%2esplit */](\"=\");\r\n if (keyValue[_DYN_LENGTH /* @min:%2elength */] === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n}\r\nexport function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var parsedUrl = urlParseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl[_DYN_PATHNAME /* @min:%2epathname */] != null) {\r\n var pathName = (parsedUrl.pathname[_DYN_LENGTH /* @min:%2elength */] === 0) ? \"/\" : parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n if (pathName.charAt(0) !== \"/\") {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n name = dataSanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = dataSanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n}\r\nexport function dateTimeUtilsNow() {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n var now = perf.now() + perf.timing.navigationStart;\r\n // Known issue with IE where this calculation can be negative, so if it is then ignore and fallback\r\n if (now > 0) {\r\n return now;\r\n }\r\n }\r\n return dateNow();\r\n}\r\nexport function dateTimeUtilsDuration(start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext from an optional telemetryTrace\r\n * @param telemetryTrace - The telemetryTrace instance that is being wrapped\r\n * @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.\r\n * @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object\r\n */\r\nexport function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {\r\n var trace = telemetryTrace || {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace.traceID;\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace.traceID = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace.parentID;\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace.parentID = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace.traceFlags;\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace.traceFlags = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=Util.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { AjaxHelperParseDependencyPath } from \"../Util\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar RemoteDependencyData = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the RemoteDependencyData object\r\n */\r\n function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {\r\n if (requestAPI === void 0) { requestAPI = \"Ajax\"; }\r\n this.aiDataContract = {\r\n id: 1 /* FieldType.Required */,\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n resultCode: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n success: 0 /* FieldType.Default */,\r\n data: 0 /* FieldType.Default */,\r\n target: 0 /* FieldType.Default */,\r\n type: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */,\r\n kind: 0 /* FieldType.Default */,\r\n value: 0 /* FieldType.Default */,\r\n count: 0 /* FieldType.Default */,\r\n min: 0 /* FieldType.Default */,\r\n max: 0 /* FieldType.Default */,\r\n stdDev: 0 /* FieldType.Default */,\r\n dependencyKind: 0 /* FieldType.Default */,\r\n dependencySource: 0 /* FieldType.Default */,\r\n commandName: 0 /* FieldType.Default */,\r\n dependencyTypeName: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.id = id;\r\n _self[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(value);\r\n _self.success = success;\r\n _self.resultCode = resultCode + \"\";\r\n _self.type = dataSanitizeString(logger, requestAPI);\r\n var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName);\r\n _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data; // get a value from hosturl if commandName not available\r\n _self.target = dataSanitizeString(logger, dependencyFields.target);\r\n if (correlationContext) {\r\n _self.target = \"\".concat(_self.target, \" | \").concat(correlationContext);\r\n }\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, dependencyFields[_DYN_NAME /* @min:%2ename */]);\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n RemoteDependencyData.envelopeType = \"Microsoft.ApplicationInsights.{0}.RemoteDependency\";\r\n RemoteDependencyData.dataType = \"RemoteDependencyData\";\r\n return RemoteDependencyData;\r\n}());\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nvar _a, _b;\r\nimport { arrForEach, arrIndexOf, dumpObj, getDocument, getLazy, getNavigator, isArray, isFunction, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, strEndsWith, strIndexOf, strLeft, strSubstring, strTrim, utcNow } from \"@nevware21/ts-utils\";\r\nimport { cfgDfMerge } from \"../Config/ConfigDefaultHelpers\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { _DYN_ENABLED, _DYN_LENGTH, _DYN_LOGGER, _DYN_SPLIT, _DYN_USER_AGENT } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getLocation, isIE } from \"./EnvUtils\";\r\nimport { getExceptionName, isNotNullOrUndefined, setValue, strContains } from \"./HelperFuncs\";\r\nimport { STR_DOMAIN, STR_EMPTY, STR_PATH, UNDEFINED_VALUE } from \"./InternalConstants\";\r\nvar strToGMTString = \"toGMTString\";\r\nvar strToUTCString = \"toUTCString\";\r\nvar strCookie = \"cookie\";\r\nvar strExpires = \"expires\";\r\nvar strIsCookieUseDisabled = \"isCookieUseDisabled\";\r\nvar strDisableCookiesUsage = \"disableCookiesUsage\";\r\nvar strConfigCookieMgr = \"_ckMgr\";\r\nvar _supportsCookies = null;\r\nvar _allowUaSameSite = null;\r\nvar _parsedCookieValue = null;\r\nvar _doc;\r\nvar _cookieCache = {};\r\nvar _globalCookieConfig = {};\r\n// // `isCookieUseDisabled` is deprecated, so explicitly casting as a key of IConfiguration to avoid typing error\r\n// // when both isCookieUseDisabled and disableCookiesUsage are used disableCookiesUsage will take precedent, which is\r\n// // why its listed first\r\n/**\r\n * Set the supported dynamic config values as undefined (or an empty object) so that\r\n * any listeners will be informed of any changes.\r\n * Explicitly NOT including the deprecated `isCookieUseDisabled` as we don't want to support\r\n * the v1 deprecated field as dynamic for updates\r\n */\r\nvar rootDefaultConfig = (_a = {\r\n cookieCfg: cfgDfMerge((_b = {},\r\n _b[STR_DOMAIN] = { fb: \"cookieDomain\", dfVal: isNotNullOrUndefined },\r\n _b.path = { fb: \"cookiePath\", dfVal: isNotNullOrUndefined },\r\n _b.enabled = UNDEFINED_VALUE,\r\n _b.ignoreCookies = UNDEFINED_VALUE,\r\n _b.blockedCookies = UNDEFINED_VALUE,\r\n _b)),\r\n cookieDomain: UNDEFINED_VALUE,\r\n cookiePath: UNDEFINED_VALUE\r\n },\r\n _a[strDisableCookiesUsage] = UNDEFINED_VALUE,\r\n _a);\r\nfunction _getDoc() {\r\n !_doc && (_doc = getLazy(function () { return getDocument(); }));\r\n}\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\nfunction _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 _isIgnoredCookie(cookieMgrCfg, name) {\r\n if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {\r\n return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1;\r\n }\r\n return false;\r\n}\r\nfunction _isBlockedCookie(cookieMgrCfg, name) {\r\n if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {\r\n if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) {\r\n return true;\r\n }\r\n }\r\n return _isIgnoredCookie(cookieMgrCfg, name);\r\n}\r\nfunction _isCfgEnabled(rootConfig, cookieMgrConfig) {\r\n var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED /* @min:%2eenabled */];\r\n if (isNullOrUndefined(isCfgEnabled)) {\r\n // Set the enabled from the provided setting or the legacy root values\r\n var cookieEnabled = void 0;\r\n // This field is deprecated and dynamic updates will not be fully supported\r\n if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {\r\n cookieEnabled = !rootConfig[strIsCookieUseDisabled];\r\n }\r\n // If this value is defined it takes precedent over the above\r\n if (!isUndefined(rootConfig[strDisableCookiesUsage])) {\r\n cookieEnabled = !rootConfig[strDisableCookiesUsage];\r\n }\r\n // Not setting the cookieMgrConfig.enabled as that will update (set) the global dynamic config\r\n // So future \"updates\" then may not be as expected\r\n isCfgEnabled = cookieEnabled;\r\n }\r\n return isCfgEnabled;\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 - The AppInsightsCore instance to get the cookie manager from\r\n * @param config - The config to use if the core is not available\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 && 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 || {})[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return cookieMgr;\r\n}\r\nexport function createCookieMgr(rootConfig, logger) {\r\n var cookieMgrConfig;\r\n var _path;\r\n var _domain;\r\n var unloadHandler;\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n var _enabled;\r\n var _getCookieFn;\r\n var _setCookieFn;\r\n var _delCookieFn;\r\n // Make sure the root config is dynamic as it may be the global config\r\n rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;\r\n // Will get recalled if the referenced configuration is changed\r\n unloadHandler = onConfigChange(rootConfig, function (details) {\r\n // Make sure the root config has all of the the defaults to the root config to ensure they are dynamic\r\n details.setDf(details.cfg, rootDefaultConfig);\r\n // Create and apply the defaults to the cookieCfg element\r\n cookieMgrConfig = details.ref(details.cfg, \"cookieCfg\"); // details.setDf(details.cfg.cookieCfg, defaultConfig);\r\n _path = cookieMgrConfig[STR_PATH /* @min:%2epath */] || \"/\";\r\n _domain = cookieMgrConfig[STR_DOMAIN /* @min:%2edomain */];\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;\r\n _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;\r\n _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;\r\n _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;\r\n }, logger);\r\n var cookieMgr = {\r\n isEnabled: function () {\r\n var enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false && _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 cookieMgrConfig[_DYN_ENABLED /* @min:%2eenabled */] = value;\r\n },\r\n set: function (name, value, maxAgeSec, domain, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {\r\n var values = {};\r\n var theValue = strTrim(value || STR_EMPTY);\r\n var idx = strIndexOf(theValue, \";\");\r\n if (idx !== -1) {\r\n theValue = strTrim(strLeft(value, idx));\r\n values = _extractParts(strSubstring(value, 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, STR_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 = utcNow();\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) || STR_EMPTY, isTruthy);\r\n }\r\n }\r\n if (!_isIE) {\r\n // Only replace if not already present\r\n setValue(values, \"max-age\", STR_EMPTY + 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() || {})[_DYN_USER_AGENT /* @min:%2euserAgent */]);\r\n }\r\n if (_allowUaSameSite) {\r\n setValue(values, \"SameSite\", \"None\", null, isUndefined);\r\n }\r\n }\r\n setValue(values, STR_PATH, path || _path, null, isUndefined);\r\n //let 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 = STR_EMPTY;\r\n if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {\r\n value = _getCookieFn(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[STR_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 // let delCookie = cookieMgrConfig.delCookie || _setCookieValue;\r\n _delCookieFn(name, _formatCookieValue(STR_EMPTY, values));\r\n result = true;\r\n }\r\n return result;\r\n },\r\n unload: function (isAsync) {\r\n unloadHandler && unloadHandler.rm();\r\n unloadHandler = null;\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 !_doc && _getDoc();\r\n try {\r\n var doc = _doc.v || {};\r\n _supportsCookies = doc[strCookie] !== undefined;\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 68 /* _eInternalMessageId.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[_DYN_LENGTH /* @min:%2elength */]) {\r\n var parts = strTrim(theValue)[_DYN_SPLIT /* @min:%2esplit */](\";\");\r\n arrForEach(parts, function (thePart) {\r\n thePart = strTrim(thePart || STR_EMPTY);\r\n if (thePart) {\r\n var idx = strIndexOf(thePart, \"=\");\r\n if (idx === -1) {\r\n values[thePart] = null;\r\n }\r\n else {\r\n values[strTrim(strLeft(thePart, idx))] = strTrim(strSubstring(thePart, 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 || STR_EMPTY;\r\n objForEachKey(values, function (name, theValue) {\r\n cookieValue += \"; \" + name + (!isNullOrUndefined(theValue) ? \"=\" + theValue : STR_EMPTY);\r\n });\r\n return cookieValue;\r\n}\r\nfunction _getCookieValue(name) {\r\n var cookieValue = STR_EMPTY;\r\n !_doc && _getDoc();\r\n if (_doc.v) {\r\n var theCookie = _doc.v[strCookie] || STR_EMPTY;\r\n if (_parsedCookieValue !== theCookie) {\r\n _cookieCache = _extractParts(theCookie);\r\n _parsedCookieValue = theCookie;\r\n }\r\n cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);\r\n }\r\n return cookieValue;\r\n}\r\nfunction _setCookieValue(name, cookieValue) {\r\n !_doc && _getDoc();\r\n if (_doc.v) {\r\n _doc.v[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 - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getDocument, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nexport function createDomEvent(eventName) {\r\n var event = null;\r\n if (isFunction(Event)) { // Use Event constructor when available\r\n event = new Event(eventName);\r\n }\r\n else { // Event has no constructor in IE\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"Event\");\r\n event.initEvent(eventName, true, true);\r\n }\r\n }\r\n return event;\r\n}\r\n//# sourceMappingURL=DomHelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { asString, isBoolean, isFunction, isNullOrUndefined, isString } from \"@nevware21/ts-utils\";\r\nimport { STR_EMPTY } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_TO_LOWER_CASE } from \"../__DynamicConstants\";\r\n/**\r\n * @internal\r\n * @ignore\r\n * @param str\r\n * @param defaultValue\r\n * @returns\r\n */\r\nfunction _stringToBoolOrDefault(theValue, defaultValue, theConfig) {\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n return defaultValue;\r\n }\r\n if (isBoolean(theValue)) {\r\n return theValue;\r\n }\r\n return asString(theValue)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === \"true\";\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the field defined as an object\r\n * that should be merged\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfMerge(defaultValue) {\r\n return {\r\n mrg: true,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the provided field set function\r\n * @param setter - The IConfigCheckFn function to validate the user provided value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfSet(setter, defaultValue) {\r\n return {\r\n set: setter,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the provided field validator\r\n * @param validator - The IConfigCheckFn function to validate the user provided value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @param fallBackName - The fallback configuration name if the current value is not available\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfValidate(validator, defaultValue, fallBackName) {\r\n return {\r\n fb: fallBackName,\r\n isVal: validator,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate and convert the user\r\n * provided value to a boolean from a string or boolean value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @param fallBackName - The fallback configuration name if the current value is not available\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfBoolean(defaultValue, fallBackName) {\r\n return {\r\n fb: fallBackName,\r\n set: _stringToBoolOrDefault,\r\n v: !!defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate that the user\r\n * provided value is a function.\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfFunc(defaultValue) {\r\n return {\r\n isVal: isFunction,\r\n v: defaultValue || null\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate that the user\r\n * provided value is a function.\r\n * @param defaultValue - The default string value to apply it not provided or it's not valid, defaults to an empty string\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfString(defaultValue) {\r\n return {\r\n isVal: isString,\r\n v: asString(defaultValue || STR_EMPTY)\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance identifying that value associated with this property\r\n * should not have it's properties converted into a dynamic config properties.\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfBlockPropValue(defaultValue) {\r\n return {\r\n blkVal: true,\r\n v: defaultValue\r\n };\r\n}\r\n//# sourceMappingURL=ConfigDefaultHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, getDocument, getWindow, isArray, objForEachKey, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _DYN_EVT_NAME, _DYN_LENGTH, _DYN_PUSH, _DYN_REPLACE, _DYN_SPLICE, _DYN_SPLIT, _DYN_TYPE } from \"../__DynamicConstants\";\r\nimport { createElmNodeData, createUniqueNamespace } from \"./DataCacheHelper\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\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 strEvents = \"events\";\r\nvar strVisibilityChangeEvt = \"visibilitychange\";\r\nvar strPageHide = \"pagehide\";\r\nvar strPageShow = \"pageshow\";\r\nvar strUnload = \"unload\";\r\nvar strBeforeUnload = \"beforeunload\";\r\nvar strPageHideNamespace = createUniqueNamespace(\"aiEvtPageHide\");\r\nvar strPageShowNamespace = createUniqueNamespace(\"aiEvtPageShow\");\r\nvar rRemoveEmptyNs = /\\.[\\.]+/g;\r\nvar rRemoveTrailingEmptyNs = /[\\.]+$/;\r\nvar _guid = 1;\r\nvar elmNodeData = createElmNodeData(\"events\");\r\nvar eventNamespace = /^([^.]*)(?:\\.(.+)|)/;\r\nfunction _normalizeNamespace(name) {\r\n if (name && name[_DYN_REPLACE /* @min:%2ereplace */]) {\r\n return name[_DYN_REPLACE /* @min:%2ereplace */](/^[\\s\\.]+|(?=[\\s\\.])[\\.\\s]+$/g, STR_EMPTY);\r\n }\r\n return name;\r\n}\r\nfunction _getEvtNamespace(eventName, evtNamespace) {\r\n if (evtNamespace) {\r\n var theNamespace_1 = STR_EMPTY;\r\n if (isArray(evtNamespace)) {\r\n theNamespace_1 = STR_EMPTY;\r\n arrForEach(evtNamespace, function (name) {\r\n name = _normalizeNamespace(name);\r\n if (name) {\r\n if (name[0] !== \".\") {\r\n name = \".\" + name;\r\n }\r\n theNamespace_1 += name;\r\n }\r\n });\r\n }\r\n else {\r\n theNamespace_1 = _normalizeNamespace(evtNamespace);\r\n }\r\n if (theNamespace_1) {\r\n if (theNamespace_1[0] !== \".\") {\r\n theNamespace_1 = \".\" + theNamespace_1;\r\n }\r\n // We may only have the namespace and not an eventName\r\n eventName = (eventName || STR_EMPTY) + theNamespace_1;\r\n }\r\n }\r\n var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);\r\n return {\r\n type: parsedEvent[1],\r\n ns: ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, \".\").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT /* @min:%2esplit */](\".\").sort()).join(\".\")\r\n };\r\n}\r\n/**\r\n * Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by\r\n * applications to remove their own events\r\n * @param target - The EventTarget that has registered events\r\n * @param eventName - [Optional] The name of the event to return the registered handlers and full name (with namespaces)\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\r\n */\r\nexport function __getRegisteredEvents(target, eventName, evtNamespace) {\r\n var theEvents = [];\r\n var eventCache = elmNodeData.get(target, strEvents, {}, false);\r\n var evtName = _getEvtNamespace(eventName, evtNamespace);\r\n objForEachKey(eventCache, function (evtType, registeredEvents) {\r\n arrForEach(registeredEvents, function (value) {\r\n if (!evtName[_DYN_TYPE /* @min:%2etype */] || evtName[_DYN_TYPE /* @min:%2etype */] === value[_DYN_EVT_NAME /* @min:%2eevtName */][_DYN_TYPE /* @min:%2etype */]) {\r\n if (!evtName.ns || evtName.ns === evtName.ns) {\r\n theEvents[_DYN_PUSH /* @min:%2epush */]({\r\n name: value.evtName[_DYN_TYPE /* @min:%2etype */] + (value[_DYN_EVT_NAME /* @min:%2eevtName */].ns ? \".\" + value[_DYN_EVT_NAME /* @min:%2eevtName */].ns : STR_EMPTY),\r\n handler: value.handler\r\n });\r\n }\r\n }\r\n });\r\n });\r\n return theEvents;\r\n}\r\n// Exported for internal unit testing only\r\nfunction _getRegisteredEvents(target, evtName, addDefault) {\r\n if (addDefault === void 0) { addDefault = true; }\r\n var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);\r\n var registeredEvents = aiEvts[evtName];\r\n if (!registeredEvents) {\r\n registeredEvents = aiEvts[evtName] = [];\r\n }\r\n return registeredEvents;\r\n}\r\nfunction _doDetach(obj, evtName, handlerRef, useCapture) {\r\n if (obj && evtName && evtName[_DYN_TYPE /* @min:%2etype */]) {\r\n if (obj[strRemoveEventListener]) {\r\n obj[strRemoveEventListener](evtName[_DYN_TYPE /* @min:%2etype */], handlerRef, useCapture);\r\n }\r\n else if (obj[strDetachEvent]) {\r\n obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE /* @min:%2etype */], handlerRef);\r\n }\r\n }\r\n}\r\nfunction _doAttach(obj, evtName, handlerRef, useCapture) {\r\n var result = false;\r\n if (obj && evtName && evtName[_DYN_TYPE /* @min:%2etype */] && handlerRef) {\r\n if (obj[strAddEventHelper]) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](evtName[_DYN_TYPE /* @min:%2etype */], handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (obj[strAttachEvent]) {\r\n // IE before version 9\r\n obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE /* @min:%2etype */], handlerRef);\r\n result = true;\r\n }\r\n }\r\n return result;\r\n}\r\nfunction _doUnregister(target, events, evtName, unRegFn) {\r\n var idx = events[_DYN_LENGTH /* @min:%2elength */];\r\n while (idx--) {\r\n var theEvent = events[idx];\r\n if (theEvent) {\r\n if (!evtName.ns || evtName.ns === theEvent[_DYN_EVT_NAME /* @min:%2eevtName */].ns) {\r\n if (!unRegFn || unRegFn(theEvent)) {\r\n _doDetach(target, theEvent[_DYN_EVT_NAME /* @min:%2eevtName */], theEvent.handler, theEvent.capture);\r\n // Remove the registered event\r\n events[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction _unregisterEvents(target, evtName, unRegFn) {\r\n if (evtName[_DYN_TYPE /* @min:%2etype */]) {\r\n _doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE /* @min:%2etype */]), evtName, unRegFn);\r\n }\r\n else {\r\n var eventCache = elmNodeData.get(target, strEvents, {});\r\n objForEachKey(eventCache, function (evtType, events) {\r\n _doUnregister(target, events, evtName, unRegFn);\r\n });\r\n // Cleanup\r\n if (objKeys(eventCache)[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n elmNodeData.kill(target, strEvents);\r\n }\r\n }\r\n}\r\nexport function mergeEvtNamespace(theNamespace, namespaces) {\r\n var newNamespaces;\r\n if (namespaces) {\r\n if (isArray(namespaces)) {\r\n newNamespaces = [theNamespace].concat(namespaces);\r\n }\r\n else {\r\n newNamespaces = [theNamespace, namespaces];\r\n }\r\n // resort the namespaces so they are always in order\r\n newNamespaces = (_getEvtNamespace(\"xx\", newNamespaces).ns)[_DYN_SPLIT /* @min:%2esplit */](\".\");\r\n }\r\n else {\r\n newNamespaces = theNamespace;\r\n }\r\n return newNamespaces;\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 eventName - String that specifies any of the standard DHTML Events without \"on\" prefix, if may also include an optional (dot \".\" prefixed)\r\n * namespaces \"click\" \"click.mynamespace\" in addition to specific namespaces.\r\n * @param handlerRef - Pointer that specifies the function to call when event fires\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\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 eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (target) {\r\n try {\r\n var evtName = _getEvtNamespace(eventName, evtNamespace);\r\n result = _doAttach(target, evtName, handlerRef, useCapture);\r\n if (result && elmNodeData.accept(target)) {\r\n var registeredEvent = {\r\n guid: _guid++,\r\n evtName: evtName,\r\n handler: handlerRef,\r\n capture: useCapture\r\n };\r\n _getRegisteredEvents(target, evtName.type)[_DYN_PUSH /* @min:%2epush */](registeredEvent);\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 eventName - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\r\n * @param useCapture - [Optional] Defaults to false\r\n */\r\nexport function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (target) {\r\n try {\r\n var evtName_1 = _getEvtNamespace(eventName, evtNamespace);\r\n var found_1 = false;\r\n _unregisterEvents(target, evtName_1, function (regEvent) {\r\n if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) {\r\n found_1 = true;\r\n return true;\r\n }\r\n return false;\r\n });\r\n if (!found_1) {\r\n // fallback to try and remove as requested\r\n _doDetach(target, evtName_1, handlerRef, useCapture);\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 * 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 and optional (dot \".\" prefixed) namespaces \"click\" \"click.mynamespace\".\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 return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);\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 - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\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 eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture);\r\n}\r\n/**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName - The name of the event\r\n * @param callback - The callback function that needs to be executed for the given event\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns - true if the handler was successfully added\r\n */\r\nexport function addEventHandler(eventName, callback, evtNamespace) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = eventOn(w, eventName, callback, evtNamespace);\r\n result = eventOn(w[\"body\"], eventName, callback, evtNamespace) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = eventOn(doc, eventName, callback, evtNamespace) || result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Trys to remove event handler(s) for the specified event/namespace to the window, body and document\r\n * @param eventName - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param callback - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n */\r\nexport function removeEventHandler(eventName, callback, evtNamespace) {\r\n var w = getWindow();\r\n if (w) {\r\n eventOff(w, eventName, callback, evtNamespace);\r\n eventOff(w[\"body\"], eventName, callback, evtNamespace);\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n eventOff(doc, eventName, callback, evtNamespace);\r\n }\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 * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nfunction _addEventListeners(events, listener, excludeEvents, evtNamespace) {\r\n var added = false;\r\n if (listener && events && events[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(events, function (name) {\r\n if (name) {\r\n if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {\r\n added = addEventHandler(name, listener, evtNamespace) || added;\r\n }\r\n }\r\n });\r\n }\r\n return added;\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 * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addEventListeners(events, listener, excludeEvents, evtNamespace) {\r\n var added = false;\r\n if (listener && events && isArray(events)) {\r\n added = _addEventListeners(events, listener, excludeEvents, evtNamespace);\r\n if (!added && excludeEvents && excludeEvents[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Failed to add any listeners and we excluded some, so just attempt to add the excluded events\r\n added = _addEventListeners(events, listener, null, evtNamespace);\r\n }\r\n }\r\n return added;\r\n}\r\n/**\r\n * Remove the listener from 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 evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n */\r\nexport function removeEventListeners(events, listener, evtNamespace) {\r\n if (events && isArray(events)) {\r\n arrForEach(events, function (name) {\r\n if (name) {\r\n removeEventHandler(name, listener, evtNamespace);\r\n }\r\n });\r\n }\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 * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) {\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([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace);\r\n}\r\n/**\r\n * Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener,\r\n * addEventListeners, addPageUnloadEventListener or addPageHideEventListener.\r\n * @param listener - The specific event callback to to be removed\r\n * @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function removePageUnloadEventListener(listener, evtNamespace) {\r\n removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace);\r\n}\r\n/**\r\n * Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call\r\n * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\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 * @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed\r\n * based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events\r\n * so that only the matching \"removePageHideEventListener\" can remove these events.\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, evtNamespace) {\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 // add the unique page show namespace to any provided namespace so we can only remove the ones added by \"pagehide\"\r\n var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);\r\n var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces);\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || 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, null, evtNamespace);\r\n }\r\n return pageUnloadAdded;\r\n}\r\n/**\r\n * Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener\r\n * as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\r\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\r\n */\r\nexport function removePageHideEventListener(listener, evtNamespace) {\r\n // add the unique page show namespace to any provided namespace so we only remove the ones added by \"pagehide\"\r\n var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);\r\n removeEventListeners([strPageHide], listener, newNamespaces);\r\n removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);\r\n}\r\n/**\r\n * Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call\r\n * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\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 * @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely\r\n * identified and removed based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events\r\n * so that only the matching \"removePageShowEventListener\" can remove these events.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageShowEventListener(listener, excludeEvents, evtNamespace) {\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 // add the unique page show namespace to any provided namespace so we can only remove the ones added by \"pageshow\"\r\n var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);\r\n var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces);\r\n pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded;\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, null, evtNamespace);\r\n }\r\n return pageShowAdded;\r\n}\r\n/**\r\n * Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener\r\n * as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\r\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\r\n */\r\nexport function removePageShowEventListener(listener, evtNamespace) {\r\n // add the unique page show namespace to any provided namespace so we only remove the ones added by \"pageshow\"\r\n var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);\r\n removeEventListeners([strPageShow], listener, newNamespaces);\r\n removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);\r\n}\r\n//# sourceMappingURL=EventHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isArray, isFunction, objDefine, utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_CTX, _DYN_IS_CHILD_EVT, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_CTX } from \"../__DynamicConstants\";\r\nimport { STR_GET_PERF_MGR, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar strParentContextKey = \"ParentContextKey\";\r\nvar strChildrenContextKey = \"ChildrenContextKey\";\r\nvar _defaultPerfManager = null;\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n _self.start = utcNow();\r\n _self[_DYN_NAME /* @min:%2ename */] = name;\r\n _self.isAsync = isAsync;\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = 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 objDefine(_self, \"payload\", {\r\n g: 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 }\r\n _self[_DYN_GET_CTX /* @min:%2egetCtx */] = 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[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = 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[strParentContextKey]) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent[strChildrenContextKey]) {\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[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts[_DYN_LENGTH /* @min:%2elength */]; 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 = utcNow() - _self.start;\r\n _self.exTime = _self.time - childTime;\r\n _self.complete = function () { };\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[STR_PERF_EVENT /* @min:%2eperfEvent */])) {\r\n manager[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent);\r\n }\r\n }\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = 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[_DYN_GET_CTX /* @min:%2egetCtx */] = 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 // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PerfManager.__ieDyn=1;\n\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 (perfMgr[STR_GET_PERF_MGR]) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[STR_GET_PERF_MGR]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr[_DYN_GET_CTX /* @min:%2egetCtx */](doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strParentContextKey], currentActive);\r\n if (currentActive[_DYN_GET_CTX /* @min:%2egetCtx */] && currentActive[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n var children = currentActive[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (!children) {\r\n children = [];\r\n currentActive[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strChildrenContextKey], children);\r\n }\r\n children[_DYN_PUSH /* @min:%2epush */](perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr[_DYN_SET_CTX /* @min:%2esetCtx */](doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](\"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[_DYN_SET_CTX /* @min:%2esetCtx */](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, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, isFunction } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_TRACE_FLAGS, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { createElmNodeData } from \"./DataCacheHelper\";\r\nimport { STR_CORE, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { isValidSpanId, isValidTraceId } from \"./W3cTraceParent\";\r\nvar pluginStateData = createElmNodeData(\"plugin\");\r\nexport function _getPluginState(plugin) {\r\n return pluginStateData.get(plugin, \"state\", {}, true);\r\n}\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[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n var pluginState;\r\n while (proxy) {\r\n var thePlugin = proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (thePlugin) {\r\n if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] && thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](thePlugin);\r\n }\r\n pluginState = _getPluginState(thePlugin);\r\n var isInitialized = !!pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */];\r\n if (thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]) {\r\n isInitialized = thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]();\r\n }\r\n if (!isInitialized) {\r\n initPlugins[_DYN_PUSH /* @min:%2epush */](thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n }\r\n // Now initialize the plugins\r\n arrForEach(initPlugins, function (thePlugin) {\r\n var core = processContext[STR_CORE /* @min:%2ecore */]();\r\n thePlugin[_DYN_INITIALIZE /* @min:%2einitialize */](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n pluginState = _getPluginState(thePlugin);\r\n // Only add the core to the state if the plugin didn't set it (doesn't extend from BaseTelemetryPlugin)\r\n if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {\r\n pluginState[STR_CORE] = core;\r\n }\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = true;\r\n delete pluginState[_DYN_TEARDOWN /* @min:%2eteardown */];\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 if (extB) {\r\n var bHasProcess = extB[STR_PROCESS_TELEMETRY];\r\n if (extA[STR_PROCESS_TELEMETRY]) {\r\n result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n }\r\n else {\r\n result = extA ? 1 : -1;\r\n }\r\n return result;\r\n });\r\n // sort complete\r\n}\r\n/**\r\n * Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any\r\n * _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.\r\n * @param components - The components you want to unload\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\r\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\r\n */\r\nexport function unloadComponents(components, unloadCtx, unloadState, asyncCallback) {\r\n var idx = 0;\r\n function _doUnload() {\r\n while (idx < components[_DYN_LENGTH /* @min:%2elength */]) {\r\n var component = components[idx++];\r\n if (component) {\r\n var func = component._doUnload || component[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */];\r\n if (isFunction(func)) {\r\n if (func.call(component, unloadCtx, unloadState, _doUnload) === true) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return _doUnload();\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext which optionally also \"sets\" the value on a parent\r\n * @param parentCtx - An optional parent distributed trace instance\r\n * @returns A new IDistributedTraceContext instance that uses an internal temporary object\r\n */\r\nexport function createDistributedTraceContext(parentCtx) {\r\n var trace = {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace.traceId;\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace.traceId = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace.spanId;\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace.spanId = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, dumpObj, isArray, isFunction, isNullOrUndefined, isUndefined, objForEachKey, objFreeze, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _applyDefaultValue } from \"../Config/ConfigDefaults\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_IDENTIFIER, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UNLOAD, _DYN_UPDATE } from \"../__DynamicConstants\";\r\nimport { _throwInternal, safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { proxyFunctions } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_DISABLED, STR_EMPTY, STR_EXTENSION_CONFIG, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { _getPluginState } from \"./TelemetryHelpers\";\r\nvar strTelemetryPluginChain = \"TelemetryPluginChain\";\r\nvar strHasRunFlags = \"_hasRun\";\r\nvar strGetTelCtx = \"_getTelCtx\";\r\nvar _chainId = 0;\r\nfunction _getNextProxyStart(proxy, core, startAt) {\r\n while (proxy) {\r\n if (proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]() === startAt) {\r\n return proxy;\r\n }\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n // This wasn't found in the existing chain so create an isolated one with just this plugin\r\n return createTelemetryProxyChain([startAt], core.config || {}, core);\r\n}\r\n/**\r\n * @ignore\r\n * @param telemetryChain\r\n * @param dynamicHandler\r\n * @param core\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n * @returns\r\n */\r\nfunction _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {\r\n // We have a special case where we want to start execution from this specific plugin\r\n // or we simply reuse the existing telemetry plugin chain (normal execution case)\r\n var _nextProxy = null; // By Default set as no next plugin\r\n var _onComplete = [];\r\n if (!dynamicHandler) {\r\n dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n if (startAt !== null) {\r\n // There is no next element (null) vs not defined (undefined) so use the full chain\r\n _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;\r\n }\r\n var context = {\r\n _next: _moveNext,\r\n ctx: {\r\n core: function () {\r\n return core;\r\n },\r\n diagLog: function () {\r\n return safeGetLogger(core, dynamicHandler.cfg);\r\n },\r\n getCfg: function () {\r\n return dynamicHandler.cfg;\r\n },\r\n getExtCfg: _resolveExtCfg,\r\n getConfig: _getConfig,\r\n hasNext: function () {\r\n return !!_nextProxy;\r\n },\r\n getNext: function () {\r\n return _nextProxy;\r\n },\r\n setNext: function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n },\r\n iterate: _iterateChain,\r\n onComplete: _addOnComplete\r\n }\r\n };\r\n function _addOnComplete(onComplete, that) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (onComplete) {\r\n _onComplete[_DYN_PUSH /* @min:%2epush */]({\r\n func: onComplete,\r\n self: !isUndefined(that) ? that : context.ctx,\r\n args: args\r\n });\r\n }\r\n }\r\n function _moveNext() {\r\n var nextProxy = _nextProxy;\r\n // Automatically move to the next plugin\r\n _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT /* @min:%2egetNext */]() : null;\r\n if (!nextProxy) {\r\n var onComplete = _onComplete;\r\n if (onComplete && onComplete[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(onComplete, function (completeDetails) {\r\n try {\r\n completeDetails.func.call(completeDetails.self, completeDetails.args);\r\n }\r\n catch (e) {\r\n _throwInternal(core[_DYN_LOGGER /* @min:%2elogger */], 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected Exception during onComplete - \" + dumpObj(e));\r\n }\r\n });\r\n _onComplete = [];\r\n }\r\n }\r\n return nextProxy;\r\n }\r\n function _getExtCfg(identifier, createIfMissing) {\r\n var idCfg = null;\r\n var cfg = dynamicHandler.cfg;\r\n if (cfg && identifier) {\r\n var extCfg = cfg[STR_EXTENSION_CONFIG /* @min:%2eextensionConfig */];\r\n if (!extCfg && createIfMissing) {\r\n extCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n cfg[STR_EXTENSION_CONFIG] = extCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG);\r\n if (extCfg) {\r\n idCfg = extCfg[identifier];\r\n if (!idCfg && createIfMissing) {\r\n idCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n extCfg[identifier] = idCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n idCfg = dynamicHandler.ref(extCfg, identifier);\r\n }\r\n }\r\n return idCfg;\r\n }\r\n function _resolveExtCfg(identifier, defaultValues) {\r\n var newConfig = _getExtCfg(identifier, true);\r\n if (defaultValues) {\r\n // Enumerate over the defaultValues and if not already populated attempt to\r\n // find a value from the root config or use the default value\r\n objForEachKey(defaultValues, function (field, defaultValue) {\r\n // for each unspecified field, set the default value\r\n if (isNullOrUndefined(newConfig[field])) {\r\n var cfgValue = dynamicHandler.cfg[field];\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n newConfig[field] = cfgValue;\r\n }\r\n }\r\n _applyDefaultValue(dynamicHandler, newConfig, field, defaultValue);\r\n });\r\n }\r\n return dynamicHandler.setDf(newConfig, defaultValues);\r\n }\r\n function _getConfig(identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _getExtCfg(identifier, false);\r\n var rootConfig = dynamicHandler.cfg;\r\n if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) {\r\n theValue = extConfig[field];\r\n }\r\n else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) {\r\n theValue = rootConfig[field];\r\n }\r\n return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue;\r\n }\r\n function _iterateChain(cb) {\r\n // Keep processing until we reach the end of the chain\r\n var nextPlugin;\r\n while (!!(nextPlugin = context._next())) {\r\n var plugin = nextPlugin[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (plugin) {\r\n // callback with the current on\r\n cb(plugin);\r\n }\r\n }\r\n }\r\n return context;\r\n}\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 * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {\r\n var config = createDynamicConfig(cfg);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(env) {\r\n var nextPlugin = internalContext._next();\r\n if (nextPlugin) {\r\n // Run the next plugin which will call \"processNext()\"\r\n nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, context);\r\n }\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), config.cfg, core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the 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 * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(unloadState) {\r\n var nextPlugin = internalContext._next();\r\n nextPlugin && nextPlugin[_DYN_UNLOAD /* @min:%2eunload */](context, unloadState);\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration\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 * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(updateState) {\r\n return context.iterate(function (plugin) {\r\n if (isFunction(plugin[_DYN_UPDATE /* @min:%2eupdate */])) {\r\n plugin[_DYN_UPDATE /* @min:%2eupdate */](context, updateState);\r\n }\r\n });\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates an execution chain from the array of plugins\r\n * @param plugins - The array of plugins that will be executed in this order\r\n * @param defItemCtx - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n */\r\nexport function createTelemetryProxyChain(plugins, config, core, startAt) {\r\n var firstProxy = null;\r\n var add = startAt ? false : true;\r\n if (isArray(plugins) && plugins[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy_1 = null;\r\n arrForEach(plugins, function (thePlugin) {\r\n if (!add && startAt === thePlugin) {\r\n add = true;\r\n }\r\n if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\r\n // Only add plugins that are processors\r\n var newProxy = createTelemetryPluginProxy(thePlugin, config, core);\r\n if (!firstProxy) {\r\n firstProxy = newProxy;\r\n }\r\n if (lastProxy_1) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy_1._setNext(newProxy);\r\n }\r\n lastProxy_1 = newProxy;\r\n }\r\n });\r\n }\r\n if (startAt && !firstProxy) {\r\n // Special case where the \"startAt\" was not in the original list of plugins\r\n return createTelemetryProxyChain([startAt], config, core);\r\n }\r\n return firstProxy;\r\n}\r\n/**\r\n * Create the processing telemetry proxy instance, the proxy is used to abstract the current plugin to allow monitoring and\r\n * execution plugins while passing around the dynamic execution state (IProcessTelemetryContext), the proxy instance no longer\r\n * contains any execution state and can be reused between requests (this was not the case for 2.7.2 and earlier with the\r\n * TelemetryPluginChain class).\r\n * @param plugin - The plugin instance to proxy\r\n * @param config - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n * @returns\r\n */\r\nexport function createTelemetryPluginProxy(plugin, config, core) {\r\n var nextProxy = null;\r\n var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]);\r\n var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */]);\r\n var chainId;\r\n if (plugin) {\r\n chainId = plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"-\" + plugin[STR_PRIORITY /* @min:%2epriority */] + \"-\" + _chainId++;\r\n }\r\n else {\r\n chainId = \"Unknown-0-\" + _chainId++;\r\n }\r\n var proxyChain = {\r\n getPlugin: function () {\r\n return plugin;\r\n },\r\n getNext: function () {\r\n return nextProxy;\r\n },\r\n processTelemetry: _processTelemetry,\r\n unload: _unloadPlugin,\r\n update: _updatePlugin,\r\n _id: chainId,\r\n _setNext: function (nextPlugin) {\r\n nextProxy = nextPlugin;\r\n }\r\n };\r\n function _getTelCtx() {\r\n var itemCtx;\r\n // Looks like a plugin didn't pass the (optional) context, so create a new one\r\n if (plugin && isFunction(plugin[strGetTelCtx])) {\r\n // This plugin extends from the BaseTelemetryPlugin so lets use it\r\n itemCtx = plugin[strGetTelCtx]();\r\n }\r\n if (!itemCtx) {\r\n // Create a temporary one\r\n itemCtx = createProcessTelemetryContext(proxyChain, config, core);\r\n }\r\n return itemCtx;\r\n }\r\n function _processChain(itemCtx, processPluginFn, name, details, isAsync) {\r\n var hasRun = false;\r\n var identifier = plugin ? plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] : strTelemetryPluginChain;\r\n var hasRunContext = itemCtx[strHasRunFlags];\r\n if (!hasRunContext) {\r\n // Assign and populate\r\n hasRunContext = itemCtx[strHasRunFlags] = {};\r\n }\r\n // Ensure that we keep the context in sync\r\n itemCtx.setNext(nextProxy);\r\n if (plugin) {\r\n doPerf(itemCtx[STR_CORE /* @min:%2ecore */](), function () { return identifier + \":\" + name; }, function () {\r\n // Mark this component as having run\r\n hasRunContext[chainId] = true;\r\n try {\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n var nextId = nextProxy ? nextProxy._id : STR_EMPTY;\r\n if (nextId) {\r\n hasRunContext[nextId] = false;\r\n }\r\n hasRun = processPluginFn(itemCtx);\r\n }\r\n catch (error) {\r\n var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;\r\n if (hasNextRun) {\r\n // The next plugin after us has already run so set this one as complete\r\n hasRun = true;\r\n }\r\n if (!nextProxy || !hasNextRun) {\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 _throwInternal(itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 73 /* _eInternalMessageId.PluginException */, \"Plugin [\" + identifier + \"] failed during \" + name + \" - \" + dumpObj(error) + \", run flags: \" + dumpObj(hasRunContext));\r\n }\r\n }\r\n }, details, isAsync);\r\n }\r\n return hasRun;\r\n }\r\n function _processTelemetry(env, itemCtx) {\r\n itemCtx = itemCtx || _getTelCtx();\r\n function _callProcessTelemetry(itemCtx) {\r\n if (!plugin || !hasProcessTelemetry) {\r\n return false;\r\n }\r\n var pluginState = _getPluginState(plugin);\r\n if (pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] || pluginState[STR_DISABLED]) {\r\n return false;\r\n }\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 if (hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](nextProxy);\r\n }\r\n plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, itemCtx);\r\n // Process Telemetry is expected to call itemCtx.processNext() or nextPlugin.processTelemetry()\r\n return true;\r\n }\r\n if (!_processChain(itemCtx, _callProcessTelemetry, \"processTelemetry\", function () { return ({ item: env }); }, !(env.sync))) {\r\n // The underlying plugin is either not defined, not enabled or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n }\r\n function _unloadPlugin(unloadCtx, unloadState) {\r\n function _callTeardown() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only teardown the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n // Handle plugins that don't extend from the BaseTelemetryPlugin\r\n pluginState[STR_CORE /* @min:%2ecore */] = null;\r\n pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] = true;\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = false;\r\n if (plugin[_DYN_TEARDOWN /* @min:%2eteardown */] && plugin[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(unloadCtx, _callTeardown, \"unload\", function () { }, unloadState.isAsync)) {\r\n // Only called if we hasRun was not true\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n }\r\n function _updatePlugin(updateCtx, updateState) {\r\n function _callUpdate() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only update the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n if (plugin[_DYN_UPDATE /* @min:%2eupdate */] && plugin[_DYN_UPDATE /* @min:%2eupdate */](updateCtx, updateState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(updateCtx, _callUpdate, \"update\", function () { }, false)) {\r\n // Only called if we hasRun was not true\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);\r\n }\r\n }\r\n return objFreeze(proxyChain);\r\n}\r\n/**\r\n * This class will be removed!\r\n * @deprecated use createProcessTelemetryContext() instead\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(pluginChain, config, core, startAt) {\r\n var _self = this;\r\n var context = createProcessTelemetryContext(pluginChain, config, core, startAt);\r\n // Proxy all functions of the context to this object\r\n proxyFunctions(_self, context, objKeys(context));\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrAppend, arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nvar _maxHooks;\r\nvar _hookAddMonitor;\r\n/**\r\n * Test hook for setting the maximum number of unload hooks and calling a monitor function when the hooks are added or removed\r\n * This allows for automatic test failure when the maximum number of unload hooks is exceeded\r\n * @param maxHooks - The maximum number of unload hooks\r\n * @param addMonitor - The monitor function to call when hooks are added or removed\r\n */\r\nexport function _testHookMaxUnloadHooksCb(maxHooks, addMonitor) {\r\n _maxHooks = maxHooks;\r\n _hookAddMonitor = addMonitor;\r\n}\r\n/**\r\n * Create a IUnloadHookContainer which can be used to remember unload hook functions to be executed during the component unloading\r\n * process.\r\n * @returns A new IUnloadHookContainer instance\r\n */\r\nexport function createUnloadHookContainer() {\r\n var _hooks = [];\r\n function _doUnload(logger) {\r\n var oldHooks = _hooks;\r\n _hooks = [];\r\n // Remove all registered unload hooks\r\n arrForEach(oldHooks, function (fn) {\r\n // allow either rm or remove callback function\r\n try {\r\n (fn.rm || fn.remove).call(fn);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unloading:\" + dumpObj(e));\r\n }\r\n });\r\n if (_maxHooks && oldHooks[_DYN_LENGTH /* @min:%2elength */] > _maxHooks) {\r\n _hookAddMonitor ? _hookAddMonitor(\"doUnload\", oldHooks) : _throwInternal(null, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.MaxUnloadHookExceeded */, \"Max unload hooks exceeded. An excessive number of unload hooks has been detected.\");\r\n }\r\n }\r\n function _addHook(hooks) {\r\n if (hooks) {\r\n arrAppend(_hooks, hooks);\r\n if (_maxHooks && _hooks[_DYN_LENGTH /* @min:%2elength */] > _maxHooks) {\r\n _hookAddMonitor ? _hookAddMonitor(\"Add\", _hooks) : _throwInternal(null, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.MaxUnloadHookExceeded */, \"Max unload hooks exceeded. An excessive number of unload hooks has been detected.\");\r\n }\r\n }\r\n }\r\n return {\r\n run: _doUnload,\r\n add: _addHook\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHookContainer.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isFunction, objDefine } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PROCESS_TEL_CONT2, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_PROCESS_NEXT, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UPDATE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { isNotNullOrUndefined, proxyFunctionAs } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_EXTENSION_CONFIG, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from \"./ProcessTelemetryContext\";\r\nimport { createUnloadHandlerContainer } from \"./UnloadHandlerContainer\";\r\nimport { createUnloadHookContainer } from \"./UnloadHookContainer\";\r\nvar strGetPlugin = \"getPlugin\";\r\nvar defaultValues = (_a = {},\r\n _a[STR_EXTENSION_CONFIG] = { isVal: isNotNullOrUndefined, v: {} },\r\n _a);\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; // Setting _self here as it's used outside of the dynamicProto as well\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _isinitialized;\r\n var _rootCtx; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin; // Used for backward compatibility where plugins don't call the main pipeline\r\n var _unloadHandlerContainer;\r\n var _hookContainer;\r\n _initDefaults();\r\n dynamicProto(BaseTelemetryPlugin, _self, function (_self) {\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {\r\n _setDefaults(config, core, pluginChain);\r\n _isinitialized = true;\r\n };\r\n _self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (unloadCtx && core !== unloadCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing as either the plugin is not initialized or was not initialized by the current core\r\n return;\r\n }\r\n var result;\r\n var unloadDone = false;\r\n var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUnloadState = unloadState || {\r\n reason: 0 /* TelemetryUnloadReason.ManualTeardown */,\r\n isAsync: false\r\n };\r\n function _unloadCallback() {\r\n if (!unloadDone) {\r\n unloadDone = true;\r\n _unloadHandlerContainer.run(theUnloadCtx, unloadState);\r\n _hookContainer.run(theUnloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]());\r\n if (result === true) {\r\n theUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n }\r\n _initDefaults();\r\n }\r\n }\r\n if (!_self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] || _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {\r\n _unloadCallback();\r\n }\r\n else {\r\n // Tell the caller that we will be calling processNext()\r\n result = true;\r\n }\r\n return result;\r\n };\r\n _self[_DYN_UPDATE /* @min:%2eupdate */] = function (updateCtx, updateState) {\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (updateCtx && core !== updateCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing\r\n return;\r\n }\r\n var result;\r\n var updateDone = false;\r\n var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUpdateState = updateState || {\r\n reason: 0 /* TelemetryUpdateReason.Unknown */\r\n };\r\n function _updateCallback() {\r\n if (!updateDone) {\r\n updateDone = true;\r\n _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n }\r\n }\r\n if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {\r\n _updateCallback();\r\n }\r\n else {\r\n result = true;\r\n }\r\n return result;\r\n };\r\n proxyFunctionAs(_self, \"_addUnloadCb\", function () { return _unloadHandlerContainer; }, \"add\");\r\n proxyFunctionAs(_self, \"_addHook\", function () { return _hookContainer; }, \"add\");\r\n objDefine(_self, \"_unloadHooks\", { g: function () { return _hookContainer; } });\r\n });\r\n // These are added after the dynamicProto so that are not moved to the prototype\r\n _self[_DYN_DIAG_LOG /* @min:%2ediagLog */] = function (itemCtx) {\r\n return _getTelCtx(itemCtx)[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n };\r\n _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = 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[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\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[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, null);\r\n }\r\n };\r\n _self._getTelCtx = _getTelCtx;\r\n function _getTelCtx(currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE /* @min:%2ecore */]);\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[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin[strGetPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n }\r\n function _setDefaults(config, core, pluginChain) {\r\n // Make sure the extensionConfig exists and the config is dynamic\r\n createDynamicConfig(config, defaultValues, safeGetLogger(core));\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 /* @min:%2egetProcessTelContext */]()[_DYN_GET_NEXT /* @min:%2egetNext */]();\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[STR_CORE /* @min:%2ecore */] = core;\r\n _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n }\r\n function _initDefaults() {\r\n _isinitialized = false;\r\n _self[STR_CORE /* @min:%2ecore */] = null;\r\n _rootCtx = null;\r\n _nextPlugin = null;\r\n _hookContainer = createUnloadHookContainer();\r\n _unloadHandlerContainer = createUnloadHandlerContainer();\r\n }\r\n }\r\n// Removed Stub for BaseTelemetryPlugin.prototype.initialize.\r\n// Removed Stub for BaseTelemetryPlugin.prototype.teardown.\r\n// Removed Stub for BaseTelemetryPlugin.prototype.update.\r\n// Removed Stub for BaseTelemetryPlugin.prototype._addUnloadCb.\r\n// Removed Stub for BaseTelemetryPlugin.prototype._addHook.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n BaseTelemetryPlugin.__ieDyn=1;\n\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { strShimFunction, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { getInst, objHasOwnProperty } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH, _DYN_PUSH, _DYN_SPLICE } from \"../__DynamicConstants\";\r\nimport { _getObjProto } from \"./HelperFuncs\";\r\nvar aiInstrumentHooks = \"_aiHooks\";\r\nvar cbNames = [\r\n \"req\", \"rsp\", \"hkErr\", \"fnErr\"\r\n];\r\n/** @ignore */\r\nfunction _arrLoop(arr, fn) {\r\n if (arr) {\r\n for (var lp = 0; lp < arr[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n if (fn(arr[lp], lp)) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @ignore */\r\nfunction _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) {\r\n if (type >= 0 /* CallbackType.Request */ && type <= 2 /* CallbackType.HookError */) {\r\n _arrLoop(hooks, function (hook, idx) {\r\n var cbks = hook.cbks;\r\n var cb = cbks[cbNames[type]];\r\n if (cb) {\r\n // Set the specific hook context implementation using a lazy creation pattern\r\n callDetails.ctx = function () {\r\n var ctx = hookCtx[idx] = (hookCtx[idx] || {});\r\n return ctx;\r\n };\r\n try {\r\n cb[_DYN_APPLY /* @min:%2eapply */](callDetails.inst, cbArgs);\r\n }\r\n catch (err) {\r\n var orgEx = callDetails.err;\r\n try {\r\n // Report Hook error via the callback\r\n var hookErrorCb = cbks[cbNames[2 /* CallbackType.HookError */]];\r\n if (hookErrorCb) {\r\n callDetails.err = err;\r\n hookErrorCb[_DYN_APPLY /* @min:%2eapply */](callDetails.inst, cbArgs);\r\n }\r\n }\r\n catch (e) {\r\n // Not much we can do here -- swallowing the exception to avoid crashing the hosting app\r\n }\r\n finally {\r\n // restore the original exception (if any)\r\n callDetails.err = orgEx;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/** @ignore */\r\nfunction _createFunctionHook(aiHook) {\r\n // Define a temporary method that queues-up a the real method call\r\n return function () {\r\n var funcThis = this;\r\n // Capture the original arguments passed to the method\r\n var orgArgs = arguments;\r\n var hooks = aiHook.h;\r\n var funcArgs = {\r\n name: aiHook.n,\r\n inst: funcThis,\r\n ctx: null,\r\n set: _replaceArg\r\n };\r\n var hookCtx = [];\r\n var cbArgs = _createArgs([funcArgs], orgArgs);\r\n funcArgs.evt = getInst(\"event\");\r\n function _createArgs(target, theArgs) {\r\n _arrLoop(theArgs, function (arg) {\r\n target[_DYN_PUSH /* @min:%2epush */](arg);\r\n });\r\n return target;\r\n }\r\n function _replaceArg(idx, value) {\r\n orgArgs = _createArgs([], orgArgs);\r\n orgArgs[idx] = value;\r\n cbArgs = _createArgs([funcArgs], orgArgs);\r\n }\r\n // Call the pre-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* CallbackType.Request */);\r\n // Call the original function was called\r\n var theFunc = aiHook.f;\r\n if (theFunc) {\r\n try {\r\n funcArgs.rslt = theFunc[_DYN_APPLY /* @min:%2eapply */](funcThis, orgArgs);\r\n }\r\n catch (err) {\r\n // Report the request callback\r\n funcArgs.err = err;\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* CallbackType.FunctionError */);\r\n // rethrow the original exception so anyone listening for it can catch the exception\r\n throw err;\r\n }\r\n }\r\n // Call the post-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* CallbackType.Response */);\r\n return funcArgs.rslt;\r\n };\r\n}\r\n/** @ignore */\r\nfunction _getOwner(target, name, checkPrototype, checkParentProto) {\r\n var owner = null;\r\n if (target) {\r\n if (objHasOwnProperty(target, name)) {\r\n owner = target;\r\n }\r\n else if (checkPrototype) {\r\n owner = _getOwner(_getObjProto(target), name, checkParentProto, false);\r\n }\r\n }\r\n return owner;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProto(target, funcName, callbacks) {\r\n if (target) {\r\n return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProtos(target, funcNames, callbacks) {\r\n if (target) {\r\n return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false);\r\n }\r\n return null;\r\n}\r\nfunction _createInstrumentHook(owner, funcName, fn, callbacks) {\r\n var aiHook = fn && fn[aiInstrumentHooks];\r\n if (!aiHook) {\r\n // Only hook the function once\r\n aiHook = {\r\n i: 0,\r\n n: funcName,\r\n f: fn,\r\n h: []\r\n };\r\n // Override (hook) the original function\r\n var newFunc = _createFunctionHook(aiHook);\r\n newFunc[aiInstrumentHooks] = aiHook; // Tag and store the function hooks\r\n owner[funcName] = newFunc;\r\n }\r\n var theHook = {\r\n // tslint:disable:object-literal-shorthand\r\n id: aiHook.i,\r\n cbks: callbacks,\r\n rm: function () {\r\n // DO NOT Use () => { shorthand for the function as the this gets replaced\r\n // with the outer this and not the this for theHook instance.\r\n var id = this.id;\r\n _arrLoop(aiHook.h, function (hook, idx) {\r\n if (hook.id === id) {\r\n aiHook.h[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n return 1;\r\n }\r\n });\r\n }\r\n // tslint:enable:object-literal-shorthand\r\n };\r\n aiHook.i++;\r\n aiHook.h[_DYN_PUSH /* @min:%2epush */](theHook);\r\n return theHook;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n if (target && funcName && callbacks) {\r\n var owner = _getOwner(target, funcName, checkPrototype, checkParentProto);\r\n if (owner) {\r\n var fn = owner[funcName];\r\n if (typeof fn === strShimFunction) {\r\n return _createInstrumentHook(owner, funcName, fn, callbacks);\r\n }\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentFuncs(target, funcNames, callbacks, checkPrototype, checkParentProto) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n var hooks = null;\r\n _arrLoop(funcNames, function (funcName) {\r\n var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto);\r\n if (hook) {\r\n if (!hooks) {\r\n hooks = [];\r\n }\r\n hooks[_DYN_PUSH /* @min:%2epush */](hook);\r\n }\r\n });\r\n return hooks;\r\n}\r\n/**\r\n * Add an instrumentation hook to the provided named \"event\" for the target class / object, this doesn't check whether the\r\n * named \"event\" is in fact a function and just assigns the instrumentation hook to the target[evtName]\r\n * @param target - The target object\r\n * @param evtName - The name of the event\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParentProto) {\r\n if (target && evtName && callbacks) {\r\n var owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target;\r\n if (owner) {\r\n return _createInstrumentHook(owner, evtName, owner[evtName], callbacks);\r\n }\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=InstrumentHooks.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DIAG_LOG, _DYN_PUSH } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nexport function createUnloadHandlerContainer() {\r\n var handlers = [];\r\n function _addHandler(handler) {\r\n if (handler) {\r\n handlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n function _runHandlers(unloadCtx, unloadState) {\r\n arrForEach(handlers, function (handler) {\r\n try {\r\n handler(unloadCtx, unloadState);\r\n }\r\n catch (e) {\r\n _throwInternal(unloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected error calling unload handler - \" + dumpObj(e));\r\n }\r\n });\r\n handlers = [];\r\n }\r\n return {\r\n add: _addHandler,\r\n run: _runHandlers\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHandlerContainer.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TO_STRING = \"toString\"; // Count: 4\r\nexport var _DYN_IS_STORAGE_USE_DISAB0 = \"isStorageUseDisabled\"; // Count: 3\r\nexport var _DYN__ADD_HOOK = \"_addHook\"; // Count: 6\r\nexport var _DYN_CORE = \"core\"; // Count: 7\r\nexport var _DYN_DATA_TYPE = \"dataType\"; // Count: 8\r\nexport var _DYN_ENVELOPE_TYPE = \"envelopeType\"; // Count: 7\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 13\r\nexport var _DYN_TRACK = \"track\"; // Count: 7\r\nexport var _DYN_TRACK_PAGE_VIEW = \"trackPageView\"; // Count: 4\r\nexport var _DYN_TRACK_PREVIOUS_PAGE_1 = \"trackPreviousPageVisit\"; // Count: 3\r\nexport var _DYN_SEND_PAGE_VIEW_INTER2 = \"sendPageViewInternal\"; // Count: 7\r\nexport var _DYN_START_TIME = \"startTime\"; // Count: 6\r\nexport var _DYN_PROPERTIES = \"properties\"; // Count: 5\r\nexport var _DYN_DURATION = \"duration\"; // Count: 12\r\nexport var _DYN_SEND_PAGE_VIEW_PERFO3 = \"sendPageViewPerformanceInternal\"; // Count: 3\r\nexport var _DYN_POPULATE_PAGE_VIEW_P4 = \"populatePageViewPerformanceEvent\"; // Count: 3\r\nexport var _DYN_HREF = \"href\"; // Count: 6\r\nexport var _DYN_SEND_EXCEPTION_INTER5 = \"sendExceptionInternal\"; // Count: 2\r\nexport var _DYN_ERROR = \"error\"; // Count: 5\r\nexport var _DYN_LINE_NUMBER = \"lineNumber\"; // Count: 4\r\nexport var _DYN_COLUMN_NUMBER = \"columnNumber\"; // Count: 5\r\nexport var _DYN__CREATE_AUTO_EXCEPTI6 = \"CreateAutoException\"; // Count: 3\r\nexport var _DYN_ADD_TELEMETRY_INITIA7 = \"addTelemetryInitializer\"; // Count: 4\r\nexport var _DYN_OVERRIDE_PAGE_VIEW_D8 = \"overridePageViewDuration\"; // Count: 2\r\nexport var _DYN_AUTO_EXCEPTION_INSTR9 = \"autoExceptionInstrumented\"; // Count: 3\r\nexport var _DYN_AUTO_TRACK_PAGE_VISI10 = \"autoTrackPageVisitTime\"; // Count: 2\r\nexport var _DYN_IS_BROWSER_LINK_TRAC11 = \"isBrowserLinkTrackingEnabled\"; // Count: 2\r\nexport var _DYN_LENGTH = \"length\"; // Count: 5\r\nexport var _DYN_ENABLE_AUTO_ROUTE_TR12 = \"enableAutoRouteTracking\"; // Count: 2\r\nexport var _DYN_ENABLE_UNHANDLED_PRO13 = \"enableUnhandledPromiseRejectionTracking\"; // Count: 2\r\nexport var _DYN_AUTO_UNHANDLED_PROMI14 = \"autoUnhandledPromiseInstrumented\"; // Count: 3\r\nexport var _DYN_GET_ENTRIES_BY_TYPE = \"getEntriesByType\"; // Count: 5\r\nexport var _DYN_IS_PERFORMANCE_TIMIN15 = \"isPerformanceTimingSupported\"; // Count: 2\r\nexport var _DYN_GET_PERFORMANCE_TIMI16 = \"getPerformanceTiming\"; // Count: 2\r\nexport var _DYN_NAVIGATION_START = \"navigationStart\"; // Count: 4\r\nexport var _DYN_SHOULD_COLLECT_DURAT17 = \"shouldCollectDuration\"; // Count: 3\r\nexport var _DYN_IS_PERFORMANCE_TIMIN18 = \"isPerformanceTimingDataReady\"; // Count: 2\r\nexport var _DYN_RESPONSE_START = \"responseStart\"; // Count: 5\r\nexport var _DYN_REQUEST_START = \"requestStart\"; // Count: 3\r\nexport var _DYN_LOAD_EVENT_END = \"loadEventEnd\"; // Count: 4\r\nexport var _DYN_RESPONSE_END = \"responseEnd\"; // Count: 5\r\nexport var _DYN_CONNECT_END = \"connectEnd\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateTimeUtilsDuration } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, arrForEach, dumpObj, getDocument, getExceptionName, getLocation, isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getPerformance, isUndefined, isWebWorker, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_HREF, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME, _DYN_TRACK_PAGE_VIEW } from \"../../__DynamicConstants\";\r\n/**\r\n * Class encapsulates sending page views and page view performance telemetry.\r\n */\r\nvar PageViewManager = /** @class */ (function () {\r\n function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n dynamicProto(PageViewManager, this, function (_self) {\r\n var queueTimer = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var firstPageViewSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels(isAsync) {\r\n if (core) {\r\n core.flush(isAsync, function () {\r\n // Event flushed, callback added to prevent promise creation\r\n });\r\n }\r\n }\r\n function _startTimer() {\r\n if (!queueTimer) {\r\n queueTimer = scheduleTimeout((function () {\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _startTimer();\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels(true);\r\n }\r\n }), 100);\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n _startTimer();\r\n }\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (!firstPageViewSent) {\r\n var perf = getPerformance();\r\n // Access the performance timing object\r\n var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\"));\r\n // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE\r\n if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {\r\n // Get the value of loadEventStart\r\n var loadEventStart = navigationEntries[0].loadEventStart;\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);\r\n }\r\n else {\r\n // calculate the start time manually\r\n var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);\r\n }\r\n firstPageViewSent = true;\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n if (!isWebWorker()) {\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n }\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];\r\n if (start > 0) {\r\n customDuration = dateTimeUtilsDuration(start, +new Date);\r\n if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {\r\n customDuration = undefined;\r\n }\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {\r\n duration = customProperties[_DYN_DURATION /* @min:%2eduration */];\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n }\r\n // case 2\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, \"trackPageView failed on page load calculation: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n _self.teardown = function (unloadCtx, unloadState) {\r\n if (queueTimer) {\r\n queueTimer.cancel();\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush_1 = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (item()) {\r\n doFlush_1 = true;\r\n }\r\n });\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for PageViewManager.prototype.trackPageView.\r\n// Removed Stub for PageViewManager.prototype.teardown.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PageViewManager.__ieDyn=1;\n\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateTimeUtilsDuration, msToTimeSpan } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, getNavigator, getPerformance, safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { mathFloor, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CONNECT_END, _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_LOAD_EVENT_END, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_REQUEST_START, _DYN_RESPONSE_END, _DYN_RESPONSE_START, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME } from \"../../__DynamicConstants\";\r\nvar MAX_DURATION_ALLOWED = 3600000; // 1h\r\nvar botAgentNames = [\"googlebot\", \"adsbot-google\", \"apis-google\", \"mediapartners-google\"];\r\nfunction _isPerformanceTimingSupported() {\r\n var perf = getPerformance();\r\n return perf && !!perf.timing;\r\n}\r\nfunction _isPerformanceNavigationTimingSupported() {\r\n var perf = getPerformance();\r\n return perf && perf.getEntriesByType && perf.getEntriesByType(\"navigation\")[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\nfunction _isPerformanceTimingDataReady() {\r\n var perf = getPerformance();\r\n var timing = perf ? perf.timing : 0;\r\n return timing\r\n && timing.domainLookupStart > 0\r\n && timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */] > 0\r\n && timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */] > 0\r\n && timing[_DYN_REQUEST_START /* @min:%2erequestStart */] > 0\r\n && timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */] > 0\r\n && timing[_DYN_RESPONSE_END /* @min:%2eresponseEnd */] > 0\r\n && timing[_DYN_CONNECT_END /* @min:%2econnectEnd */] > 0\r\n && timing.domLoading > 0;\r\n}\r\nfunction _getPerformanceTiming() {\r\n if (_isPerformanceTimingSupported()) {\r\n return getPerformance().timing;\r\n }\r\n return null;\r\n}\r\nfunction _getPerformanceNavigationTiming() {\r\n if (_isPerformanceNavigationTimingSupported()) {\r\n return getPerformance()[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\")[0];\r\n }\r\n return null;\r\n}\r\n/**\r\n* This method tells if given durations should be excluded from collection.\r\n*/\r\nfunction _shouldCollectDuration() {\r\n var durations = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n durations[_i] = arguments[_i];\r\n }\r\n var _navigator = getNavigator() || {};\r\n // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en\r\n var userAgent = _navigator.userAgent;\r\n var isGoogleBot = false;\r\n if (userAgent) {\r\n for (var i = 0; i < botAgentNames[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n isGoogleBot = isGoogleBot || strIndexOf(userAgent.toLowerCase(), botAgentNames[i]) !== -1;\r\n }\r\n }\r\n if (isGoogleBot) {\r\n // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.\r\n return false;\r\n }\r\n else {\r\n // for other page views, don't report if it's outside of a reasonable range\r\n for (var i = 0; i < durations[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * Class encapsulates sending page view performance telemetry.\r\n */\r\nvar PageViewPerformanceManager = /** @class */ (function () {\r\n function PageViewPerformanceManager(core) {\r\n var _logger = safeGetLogger(core);\r\n dynamicProto(PageViewPerformanceManager, this, function (_self) {\r\n _self[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */] = function (pageViewPerformance) {\r\n pageViewPerformance.isValid = false;\r\n /*\r\n * http://www.w3.org/TR/navigation-timing/#processing-model\r\n * |-navigationStart\r\n * | |-connectEnd\r\n * | ||-requestStart\r\n * | || |-responseStart\r\n * | || | |-responseEnd\r\n * | || | |\r\n * | || | | |-loadEventEnd\r\n * |---network---||---request---|---response---|---dom---|\r\n * |--------------------------total----------------------|\r\n *\r\n * total = The difference between the load event of the current document is completed and the first recorded timestamp of the performance entry : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#duration\r\n * network = Redirect time + App Cache + DNS lookup time + TCP connection time\r\n * request = Request time : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#request_time\r\n * response = Response time\r\n * dom = Document load time : https://html.spec.whatwg.org/multipage/dom.html#document-load-timing-info\r\n * = Document processing time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#document_processing\r\n * + Loading time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#loading\r\n */\r\n var navigationTiming = _getPerformanceNavigationTiming();\r\n var timing = _getPerformanceTiming();\r\n var total = 0;\r\n var network = 0;\r\n var request = 0;\r\n var response = 0;\r\n var dom = 0;\r\n if (navigationTiming || timing) {\r\n if (navigationTiming) {\r\n total = navigationTiming[_DYN_DURATION /* @min:%2eduration */];\r\n /**\r\n * support both cases:\r\n * - startTime is always zero: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming\r\n * - for older browsers where the startTime is not zero\r\n */\r\n network = navigationTiming[_DYN_START_TIME /* @min:%2estartTime */] === 0 ? navigationTiming[_DYN_CONNECT_END /* @min:%2econnectEnd */] : dateTimeUtilsDuration(navigationTiming[_DYN_START_TIME /* @min:%2estartTime */], navigationTiming[_DYN_CONNECT_END /* @min:%2econnectEnd */]);\r\n request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming[_DYN_RESPONSE_START /* @min:%2eresponseStart */]);\r\n response = dateTimeUtilsDuration(navigationTiming[_DYN_RESPONSE_START /* @min:%2eresponseStart */], navigationTiming[_DYN_RESPONSE_END /* @min:%2eresponseEnd */]);\r\n dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n }\r\n else {\r\n total = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */], timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n network = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */], timing[_DYN_CONNECT_END /* @min:%2econnectEnd */]);\r\n request = dateTimeUtilsDuration(timing.requestStart, timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */]);\r\n response = dateTimeUtilsDuration(timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */], timing[_DYN_RESPONSE_END /* @min:%2eresponseEnd */]);\r\n dom = dateTimeUtilsDuration(timing.responseEnd, timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n }\r\n if (total === 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 10 /* _eInternalMessageId.ErrorPVCalc */, \"error calculating page view performance.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (!_self[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](total, network, request, response, dom)) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 45 /* _eInternalMessageId.InvalidDurationValue */, \"Invalid page load duration value. Browser perf data won't be sent.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (total < mathFloor(network) + mathFloor(request) + mathFloor(response) + mathFloor(dom)) {\r\n // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT\r\n // in this case, don't report client performance from this page\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 8 /* _eInternalMessageId.ClientPerformanceMathError */, \"client performance math error.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else {\r\n pageViewPerformance.durationMs = total;\r\n // // convert to timespans\r\n pageViewPerformance.perfTotal = pageViewPerformance[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(total);\r\n pageViewPerformance.networkConnect = msToTimeSpan(network);\r\n pageViewPerformance.sentRequest = msToTimeSpan(request);\r\n pageViewPerformance.receivedResponse = msToTimeSpan(response);\r\n pageViewPerformance.domProcessing = msToTimeSpan(dom);\r\n pageViewPerformance.isValid = true;\r\n }\r\n }\r\n };\r\n _self[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */] = _getPerformanceTiming;\r\n _self[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */] = _isPerformanceTimingSupported;\r\n _self[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */] = _isPerformanceTimingDataReady;\r\n _self[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */] = _shouldCollectDuration;\r\n });\r\n }\r\n// Removed Stub for PageViewPerformanceManager.prototype.populatePageViewPerformanceEvent.\r\n// Removed Stub for PageViewPerformanceManager.prototype.getPerformanceTiming.\r\n// Removed Stub for PageViewPerformanceManager.prototype.isPerformanceTimingSupported.\r\n// Removed Stub for PageViewPerformanceManager.prototype.isPerformanceTimingDataReady.\r\n// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PageViewPerformanceManager.__ieDyn=1;\n\n return PageViewPerformanceManager;\r\n}());\r\nexport { PageViewPerformanceManager };\r\n//# sourceMappingURL=PageViewPerformanceManager.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n* ApplicationInsights.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __assignFn as __assign, __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AnalyticsPluginIdentifier, Event as EventTelemetry, Exception, Metric, PageView, PageViewPerformance, PropertiesPluginIdentifier, RemoteDependencyData, Trace, createDistributedTraceContextFromTrace, createDomEvent, createTelemetryItem, dataSanitizeString, isCrossOriginError, strNotSpecified, utlDisableStorage, utlEnableStorage, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, InstrumentEvent, arrForEach, cfgDfBoolean, cfgDfMerge, cfgDfSet, cfgDfString, cfgDfValidate, createProcessTelemetryContext, createUniqueNamespace, dumpObj, eventOff, eventOn, findAllScripts, generateW3CId, getDocument, getExceptionName, getHistory, getLocation, getWindow, hasHistory, hasWindow, isFunction, isNullOrUndefined, isString, isUndefined, mergeEvtNamespace, onConfigChange, safeGetCookieMgr, strUndefined, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isArray, isError, objDeepFreeze, objDefine, scheduleTimeout, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ADD_TELEMETRY_INITIA7, _DYN_AUTO_EXCEPTION_INSTR9, _DYN_AUTO_TRACK_PAGE_VISI10, _DYN_AUTO_UNHANDLED_PROMI14, _DYN_COLUMN_NUMBER, _DYN_CORE, _DYN_DATA_TYPE, _DYN_DIAG_LOG, _DYN_DURATION, _DYN_ENABLE_AUTO_ROUTE_TR12, _DYN_ENABLE_UNHANDLED_PRO13, _DYN_ENVELOPE_TYPE, _DYN_ERROR, _DYN_HREF, _DYN_IS_BROWSER_LINK_TRAC11, _DYN_IS_STORAGE_USE_DISAB0, _DYN_LENGTH, _DYN_LINE_NUMBER, _DYN_OVERRIDE_PAGE_VIEW_D8, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_EXCEPTION_INTER5, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_START_TIME, _DYN_TO_STRING, _DYN_TRACK, _DYN_TRACK_PAGE_VIEW, _DYN_TRACK_PREVIOUS_PAGE_1, _DYN__ADD_HOOK, _DYN__CREATE_AUTO_EXCEPTI6 } from \"../__DynamicConstants\";\r\nimport { PageViewManager } from \"./Telemetry/PageViewManager\";\r\nimport { PageViewPerformanceManager } from \"./Telemetry/PageViewPerformanceManager\";\r\nimport { PageVisitTimeManager } from \"./Telemetry/PageVisitTimeManager\";\r\nimport { Timing } from \"./Timing\";\r\nvar strEvent = \"event\";\r\nfunction _dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n }\r\n}\r\nfunction _getReason(error) {\r\n if (error && error.reason) {\r\n var reason = error.reason;\r\n if (!isString(reason) && isFunction(reason[_DYN_TO_STRING /* @min:%2etoString */])) {\r\n return reason[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n return dumpObj(reason);\r\n }\r\n // Pass the original object down which will eventually get evaluated for any message or description\r\n return error || \"\";\r\n}\r\nvar MinMilliSeconds = 60000;\r\nvar defaultValues = objDeepFreeze((_a = {\r\n sessionRenewalMs: cfgDfSet(_chkConfigMilliseconds, 30 * 60 * 1000),\r\n sessionExpirationMs: cfgDfSet(_chkConfigMilliseconds, 24 * 60 * 60 * 1000),\r\n disableExceptionTracking: cfgDfBoolean()\r\n },\r\n _a[_DYN_AUTO_TRACK_PAGE_VISI10 /* @min:autoTrackPageVisitTime */] = cfgDfBoolean(),\r\n _a[_DYN_OVERRIDE_PAGE_VIEW_D8 /* @min:overridePageViewDuration */] = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_UNHANDLED_PRO13 /* @min:enableUnhandledPromiseRejectionTracking */] = cfgDfBoolean(),\r\n _a[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:autoUnhandledPromiseInstrumented */] = false,\r\n _a.samplingPercentage = cfgDfValidate(_chkSampling, 100),\r\n _a[_DYN_IS_STORAGE_USE_DISAB0 /* @min:isStorageUseDisabled */] = cfgDfBoolean(),\r\n _a[_DYN_IS_BROWSER_LINK_TRAC11 /* @min:isBrowserLinkTrackingEnabled */] = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_AUTO_ROUTE_TR12 /* @min:enableAutoRouteTracking */] = cfgDfBoolean(),\r\n _a.namePrefix = cfgDfString(),\r\n _a.enableDebug = cfgDfBoolean(),\r\n _a.disableFlushOnBeforeUnload = cfgDfBoolean(),\r\n _a.disableFlushOnUnload = cfgDfBoolean(false, \"disableFlushOnBeforeUnload\"),\r\n _a.expCfg = cfgDfMerge({ inclScripts: false, expLog: undefined, maxLogs: 50 }),\r\n _a));\r\nfunction _chkConfigMilliseconds(value, defValue) {\r\n value = value || defValue;\r\n if (value < MinMilliSeconds) {\r\n value = MinMilliSeconds;\r\n }\r\n return +value;\r\n}\r\nfunction _chkSampling(value) {\r\n return !isNaN(value) && value > 0 && value <= 100;\r\n}\r\nfunction _updateStorageUsage(extConfig) {\r\n // Not resetting the storage usage as someone may have manually called utlDisableStorage, so this will only\r\n // reset based if the configuration option is provided\r\n if (!isUndefined(extConfig[_DYN_IS_STORAGE_USE_DISAB0 /* @min:%2eisStorageUseDisabled */])) {\r\n if (extConfig[_DYN_IS_STORAGE_USE_DISAB0 /* @min:%2eisStorageUseDisabled */]) {\r\n utlDisableStorage();\r\n }\r\n else {\r\n utlEnableStorage();\r\n }\r\n }\r\n}\r\nvar AnalyticsPlugin = /** @class */ (function (_super) {\r\n __extends(AnalyticsPlugin, _super);\r\n function AnalyticsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AnalyticsPluginIdentifier; // do not change name or priority\r\n _this.priority = 180; // take from reserved priority range 100- 200\r\n _this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place\r\n var _eventTracking;\r\n var _pageTracking;\r\n var _pageViewManager;\r\n var _pageViewPerformanceManager;\r\n var _pageVisitTimeManager;\r\n var _preInitTelemetryInitializers;\r\n var _isBrowserLinkTrackingEnabled;\r\n var _browserLinkInitializerAdded;\r\n var _enableAutoRouteTracking;\r\n var _historyListenerAdded;\r\n var _disableExceptionTracking;\r\n var _autoExceptionInstrumented;\r\n var _enableUnhandledPromiseRejectionTracking;\r\n var _autoUnhandledPromiseInstrumented;\r\n var _extConfig;\r\n var _autoTrackPageVisitTime;\r\n var _expCfg;\r\n // Counts number of trackAjax invocations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n var _trackAjaxAttempts = 0;\r\n // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.\r\n var _prevUri; // Assigned in the constructor\r\n var _currUri;\r\n var _evtNamespace;\r\n // For testing error hooks only\r\n var _errorHookCnt;\r\n dynamicProto(AnalyticsPlugin, _this, function (_self, _base) {\r\n var _addHook = _base[_DYN__ADD_HOOK /* @min:%2e_addHook */];\r\n _initDefaults();\r\n _self.getCookieMgr = function () {\r\n return safeGetCookieMgr(_self[_DYN_CORE /* @min:%2ecore */]);\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n _self.trackEvent = function (event, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(event, EventTelemetry[_DYN_DATA_TYPE /* @min:%2edataType */], EventTelemetry[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(2 /* eLoggingSeverity.WARNING */, 39 /* _eInternalMessageId.TrackTraceFailed */, \"trackTrace failed, trace will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.\r\n * @param name - A string that identifies this event uniquely within the document.\r\n */\r\n _self.startTrackEvent = function (name) {\r\n try {\r\n _eventTracking.start(name);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 29 /* _eInternalMessageId.StartTrackEventFailed */, \"startTrackEvent failed, event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name - The string you used to identify this event in `startTrackEvent`.\r\n * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n _self.stopTrackEvent = function (name, properties, measurements) {\r\n try {\r\n _eventTracking.stop(name, undefined, properties, measurements);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 30 /* _eInternalMessageId.StopTrackEventFailed */, \"stopTrackEvent failed, event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param trace - the trace message\r\n * @param customProperties - Additional custom properties to include in the event\r\n */\r\n _self.trackTrace = function (trace, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(trace, Trace[_DYN_DATA_TYPE /* @min:%2edataType */], Trace[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(2 /* eLoggingSeverity.WARNING */, 39 /* _eInternalMessageId.TrackTraceFailed */, \"trackTrace failed, trace will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a numeric value that is not associated with a specific event. Typically\r\n * used to send regular reports of performance indicators. To send single measurement, just\r\n * use the name and average fields of {@link IMetricTelemetry}. If you take measurements\r\n * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements\r\n * and sending the resulting average at intervals\r\n * @param metric - input object argument. Only name and average are mandatory.\r\n * @param } customProperties additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n */\r\n _self.trackMetric = function (metric, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(metric, Metric[_DYN_DATA_TYPE /* @min:%2edataType */], Metric[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 36 /* _eInternalMessageId.TrackMetricFailed */, \"trackMetric failed, metric will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Logs that a page or other item was viewed.\r\n * @param IPageViewTelemetry - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param customProperties - Additional data used to filter events and metrics. Defaults to empty.\r\n * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration\r\n */\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {\r\n try {\r\n var inPv = pageView || {};\r\n _pageViewManager[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */](inPv, __assign(__assign(__assign({}, inPv.properties), inPv.measurements), customProperties));\r\n if (_autoTrackPageVisitTime) {\r\n _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */](inPv.name, inPv.uri);\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 37 /* _eInternalMessageId.TrackPVFailed */, \"trackPageView failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Create a page view telemetry item and send it to the SDK pipeline through the core.track API\r\n * @param pageView - Page view item to be sent\r\n * @param properties - Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n _self[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */] = function (pageView, properties, systemProperties) {\r\n var doc = getDocument();\r\n if (doc) {\r\n pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri;\r\n }\r\n if (isNullOrUndefined(pageView[_DYN_START_TIME /* @min:%2estartTime */])) {\r\n // calculate the start time manually\r\n var duration = ((properties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration);\r\n }\r\n var telemetryItem = createTelemetryItem(pageView, PageView[_DYN_DATA_TYPE /* @min:%2edataType */], PageView[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n // reset ajaxes counter\r\n _trackAjaxAttempts = 0;\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance\r\n * @param properties\r\n */\r\n _self[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */] = function (pageViewPerformance, properties, systemProperties) {\r\n var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance[_DYN_DATA_TYPE /* @min:%2edataType */], PageViewPerformance[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance\r\n * @param customProperties\r\n */\r\n _self.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n var inPvp = pageViewPerformance || {};\r\n try {\r\n _pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](inPvp);\r\n _self[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](inPvp, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 37 /* _eInternalMessageId.TrackPVFailed */, \"trackPageViewPerformance failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n _self.startTrackPage = function (name) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n _pageTracking.start(name);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 31 /* _eInternalMessageId.StartTrackFailed */, \"startTrackPage failed, page view may not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url - String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties - map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n _self.stopTrackPage = function (name, url, properties, measurement) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n if (typeof url !== \"string\") {\r\n var loc = getLocation();\r\n url = loc && loc[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n _pageTracking.stop(name, url, properties, measurement);\r\n if (_autoTrackPageVisitTime) {\r\n _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */](name, url);\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 32 /* _eInternalMessageId.StopTrackFailed */, \"stopTrackPage failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param exception\r\n * @param properties\r\n * @param systemProperties\r\n */\r\n _self[_DYN_SEND_EXCEPTION_INTER5 /* @min:%2esendExceptionInternal */] = function (exception, customProperties, systemProperties) {\r\n // Adding additional edge cases to handle\r\n // - Not passing anything (null / undefined)\r\n var theError = (exception && (exception.exception || exception[_DYN_ERROR /* @min:%2eerror */])) ||\r\n // - Handle someone calling trackException based of v1 API where the exception was the Error\r\n isError(exception) && exception ||\r\n // - Handles no error being defined and instead of creating a new Error() instance attempt to map so any stacktrace\r\n // is preserved and does not list ApplicationInsights code as the source\r\n { name: (exception && typeof exception), message: exception || strNotSpecified };\r\n // If no exception object was passed assign to an empty object to avoid internal exceptions\r\n exception = exception || {};\r\n var exceptionPartB = new Exception(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), theError, exception[_DYN_PROPERTIES /* @min:%2eproperties */] || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface();\r\n var doc = getDocument();\r\n if (doc && (_expCfg === null || _expCfg === void 0 ? void 0 : _expCfg.inclScripts)) {\r\n var scriptsInfo = findAllScripts(doc);\r\n exceptionPartB[_DYN_PROPERTIES /* @min:%2eproperties */][\"exceptionScripts\"] = JSON.stringify(scriptsInfo);\r\n }\r\n if (_expCfg === null || _expCfg === void 0 ? void 0 : _expCfg.expLog) {\r\n var logs = _expCfg.expLog();\r\n if (logs && logs.logs && isArray(logs.logs)) {\r\n exceptionPartB[_DYN_PROPERTIES /* @min:%2eproperties */][\"exceptionLog\"] = logs.logs.slice(0, _expCfg.maxLogs).join(\"\\n\");\r\n }\r\n }\r\n var telemetryItem = createTelemetryItem(exceptionPartB, Exception[_DYN_DATA_TYPE /* @min:%2edataType */], Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param exception - Object which contains exception to be sent\r\n * @param } customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n *\r\n * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.\r\n */\r\n _self.trackException = function (exception, customProperties) {\r\n if (exception && !exception.exception && exception[_DYN_ERROR /* @min:%2eerror */]) {\r\n exception.exception = exception[_DYN_ERROR /* @min:%2eerror */];\r\n }\r\n try {\r\n _self[_DYN_SEND_EXCEPTION_INTER5 /* @min:%2esendExceptionInternal */](exception, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 35 /* _eInternalMessageId.TrackExceptionFailed */, \"trackException failed, exception will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param exception\r\n */\r\n _self._onerror = function (exception) {\r\n var error = exception && exception[_DYN_ERROR /* @min:%2eerror */];\r\n var evt = exception && exception.evt;\r\n try {\r\n if (!evt) {\r\n var _window = getWindow();\r\n if (_window) {\r\n evt = _window[strEvent];\r\n }\r\n }\r\n var url = (exception && exception.url) || (getDocument() || {}).URL;\r\n // If no error source is provided assume the default window.onerror handler\r\n var errorSrc = exception.errorSrc || \"window.onerror@\" + url + \":\" + (exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0) + \":\" + (exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0);\r\n var properties = {\r\n errorSrc: errorSrc,\r\n url: url,\r\n lineNumber: exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0,\r\n columnNumber: exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0,\r\n message: exception.message\r\n };\r\n if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception[_DYN_ERROR /* @min:%2eerror */])) {\r\n _sendCORSException(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](\"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.\", url, exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0, exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0, error, evt, null, errorSrc), properties);\r\n }\r\n else {\r\n if (!exception.errorSrc) {\r\n exception.errorSrc = errorSrc;\r\n }\r\n _self.trackException({ exception: exception, severityLevel: 3 /* eSeverityLevel.Error */ }, properties);\r\n }\r\n }\r\n catch (e) {\r\n var errorString = error ? (error.name + \", \" + error.message) : \"null\";\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 11 /* _eInternalMessageId.ExceptionWhileLoggingError */, \"_onError threw exception while logging error, error will not be collected: \"\r\n + getExceptionName(e), { exception: dumpObj(e), errorString: errorString });\r\n }\r\n };\r\n _self[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */] = function (telemetryInitializer) {\r\n if (_self[_DYN_CORE /* @min:%2ecore */]) {\r\n // Just add to the core\r\n return _self[_DYN_CORE /* @min:%2ecore */][_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](telemetryInitializer);\r\n }\r\n // Handle \"pre-initialization\" telemetry initializers (for backward compatibility)\r\n if (!_preInitTelemetryInitializers) {\r\n _preInitTelemetryInitializers = [];\r\n }\r\n _preInitTelemetryInitializers.push(telemetryInitializer);\r\n };\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (_self.isInitialized()) {\r\n return;\r\n }\r\n if (isNullOrUndefined(core)) {\r\n throwError(\"Error initializing\");\r\n }\r\n _base.initialize(config, core, extensions, pluginChain);\r\n try {\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());\r\n if (_preInitTelemetryInitializers) {\r\n arrForEach(_preInitTelemetryInitializers, function (initializer) {\r\n core[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](initializer);\r\n });\r\n _preInitTelemetryInitializers = null;\r\n }\r\n _populateDefaults(config);\r\n _pageViewPerformanceManager = new PageViewPerformanceManager(_self[_DYN_CORE /* @min:%2ecore */]);\r\n _pageViewManager = new PageViewManager(_self, _extConfig.overridePageViewDuration, _self[_DYN_CORE /* @min:%2ecore */], _pageViewPerformanceManager);\r\n _pageVisitTimeManager = new PageVisitTimeManager(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), function (pageName, pageUrl, pageVisitTime) { return trackPageVisitTime(pageName, pageUrl, pageVisitTime); });\r\n _eventTracking = new Timing(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), \"trackEvent\");\r\n _eventTracking.action =\r\n function (name, url, duration, properties, measurements) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n if (!measurements) {\r\n measurements = {};\r\n }\r\n properties.duration = duration[_DYN_TO_STRING /* @min:%2etoString */]();\r\n _self.trackEvent({ name: name, properties: properties, measurements: measurements });\r\n };\r\n // initialize page view timing\r\n _pageTracking = new Timing(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), \"trackPageView\");\r\n _pageTracking.action = function (name, url, duration, properties, measurements) {\r\n // duration must be a custom property in order for the collector to extract it\r\n if (isNullOrUndefined(properties)) {\r\n properties = {};\r\n }\r\n properties.duration = duration[_DYN_TO_STRING /* @min:%2etoString */]();\r\n var pageViewItem = {\r\n name: name,\r\n uri: url,\r\n properties: properties,\r\n measurements: measurements\r\n };\r\n _self[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageViewItem, properties);\r\n };\r\n if (hasWindow()) {\r\n _updateExceptionTracking();\r\n _updateLocationChange();\r\n }\r\n }\r\n catch (e) {\r\n // resetting the initialized state because of failure\r\n _self.setInitialized(false);\r\n throw e;\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState);\r\n // Just register to remove all events associated with this namespace\r\n eventOff(window, null, null, _evtNamespace);\r\n _initDefaults();\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_errorHookCnt, _autoExceptionInstrumented];\r\n };\r\n function _populateDefaults(config) {\r\n // it is used for 1DS as well, so config type should be IConfiguration only\r\n var identifier = _self.identifier;\r\n var core = _self[_DYN_CORE /* @min:%2ecore */];\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n _extConfig = ctx.getExtCfg(identifier, defaultValues);\r\n // make sure auto exception is instrumented only once and it won't be overriden by the following config changes\r\n _autoExceptionInstrumented = _autoExceptionInstrumented || config[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */] || _extConfig[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */];\r\n _expCfg = _extConfig.expCfg;\r\n _autoTrackPageVisitTime = _extConfig[_DYN_AUTO_TRACK_PAGE_VISI10 /* @min:%2eautoTrackPageVisitTime */];\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n _updateStorageUsage(_extConfig);\r\n // _updateBrowserLinkTracking\r\n _isBrowserLinkTrackingEnabled = _extConfig[_DYN_IS_BROWSER_LINK_TRAC11 /* @min:%2eisBrowserLinkTrackingEnabled */];\r\n _addDefaultTelemetryInitializers();\r\n }));\r\n }\r\n /**\r\n * Log a page visit time\r\n * @param pageName - Name of page\r\n * @param pageVisitDuration - Duration of visit to the page in milliseconds\r\n */\r\n function trackPageVisitTime(pageName, pageUrl, pageVisitTime) {\r\n var properties = { PageName: pageName, PageUrl: pageUrl };\r\n _self.trackMetric({\r\n name: \"PageVisitTime\",\r\n average: pageVisitTime,\r\n max: pageVisitTime,\r\n min: pageVisitTime,\r\n sampleCount: 1\r\n }, properties);\r\n }\r\n function _addDefaultTelemetryInitializers() {\r\n if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) {\r\n var browserLinkPaths_1 = [\"/browserLinkSignalR/\", \"/__browserLink/\"];\r\n var dropBrowserLinkRequests = function (envelope) {\r\n if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyData[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n var remoteData = envelope.baseData;\r\n if (remoteData) {\r\n for (var i = 0; i < browserLinkPaths_1[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (remoteData.target && strIndexOf(remoteData.target, browserLinkPaths_1[i]) >= 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](_self[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](dropBrowserLinkRequests));\r\n _browserLinkInitializerAdded = true;\r\n }\r\n }\r\n function _sendCORSException(exception, properties) {\r\n var telemetryItem = createTelemetryItem(exception, Exception[_DYN_DATA_TYPE /* @min:%2edataType */], Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n function _updateExceptionTracking() {\r\n var _window = getWindow();\r\n var locn = getLocation(true);\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _disableExceptionTracking = _extConfig.disableExceptionTracking;\r\n if (!_disableExceptionTracking && !_autoExceptionInstrumented && !_extConfig[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */]) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n _addHook(InstrumentEvent(_window, \"onerror\", {\r\n ns: _evtNamespace,\r\n rsp: function (callDetails, message, url, lineNumber, columnNumber, error) {\r\n if (!_disableExceptionTracking && callDetails.rslt !== true) {\r\n _self._onerror(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](message, url, lineNumber, columnNumber, error, callDetails.evt));\r\n }\r\n }\r\n }, false));\r\n _errorHookCnt++;\r\n _autoExceptionInstrumented = true;\r\n }\r\n }));\r\n _addUnhandledPromiseRejectionTracking(_window, locn);\r\n }\r\n function _updateLocationChange() {\r\n var win = getWindow();\r\n var locn = getLocation(true);\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _enableAutoRouteTracking = _extConfig[_DYN_ENABLE_AUTO_ROUTE_TR12 /* @min:%2eenableAutoRouteTracking */] === true;\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n if (win && _enableAutoRouteTracking && !_historyListenerAdded && hasHistory()) {\r\n var _history = getHistory();\r\n if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strUndefined) {\r\n _addHistoryListener(win, _history, locn);\r\n }\r\n }\r\n }));\r\n }\r\n function _getDistributedTraceCtx() {\r\n var distributedTraceCtx = null;\r\n if (_self[_DYN_CORE /* @min:%2ecore */] && _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx) {\r\n distributedTraceCtx = _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx(false);\r\n }\r\n if (!distributedTraceCtx) {\r\n // Fallback when using an older Core and PropertiesPlugin\r\n var properties = _self[_DYN_CORE /* @min:%2ecore */].getPlugin(PropertiesPluginIdentifier);\r\n if (properties) {\r\n var context = properties.plugin.context;\r\n if (context) {\r\n distributedTraceCtx = createDistributedTraceContextFromTrace(context.telemetryTrace);\r\n }\r\n }\r\n }\r\n return distributedTraceCtx;\r\n }\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n function _addHistoryListener(win, history, locn) {\r\n if (_historyListenerAdded) {\r\n return;\r\n }\r\n // Name Prefix is only referenced during the initial initialization and cannot be changed afterwards\r\n var namePrefix = _extConfig.namePrefix || \"\";\r\n function _popstateHandler() {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n function _locationChangeHandler() {\r\n // We always track the changes (if the handler is installed) to handle the feature being disabled between location changes\r\n if (_currUri) {\r\n _prevUri = _currUri;\r\n _currUri = locn && locn[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n else {\r\n _currUri = locn && locn[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (_enableAutoRouteTracking) {\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n if (distributedTraceCtx) {\r\n distributedTraceCtx.setTraceId(generateW3CId());\r\n var traceLocationName = \"_unknown_\";\r\n if (locn && locn.pathname) {\r\n traceLocationName = locn.pathname + (locn.hash || \"\");\r\n }\r\n // This populates the ai.operation.name which has a maximum size of 1024 so we need to sanitize it\r\n distributedTraceCtx.setName(dataSanitizeString(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), traceLocationName));\r\n }\r\n scheduleTimeout((function (uri) {\r\n // todo: override start time so that it is not affected by autoRoutePVDelay\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */]({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0\r\n }).bind(_self, _prevUri), _self.autoRoutePVDelay);\r\n }\r\n }\r\n _addHook(InstrumentEvent(history, \"pushState\", {\r\n ns: _evtNamespace,\r\n rsp: function () {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"pushState\"));\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n }, true));\r\n _addHook(InstrumentEvent(history, \"replaceState\", {\r\n ns: _evtNamespace,\r\n rsp: function () {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"replaceState\"));\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n }, true));\r\n eventOn(win, namePrefix + \"popstate\", _popstateHandler, _evtNamespace);\r\n eventOn(win, namePrefix + \"locationchange\", _locationChangeHandler, _evtNamespace);\r\n _historyListenerAdded = true;\r\n }\r\n function _addUnhandledPromiseRejectionTracking(_window, _location) {\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _enableUnhandledPromiseRejectionTracking = _extConfig[_DYN_ENABLE_UNHANDLED_PRO13 /* @min:%2eenableUnhandledPromiseRejectionTracking */] === true;\r\n _autoExceptionInstrumented = _autoExceptionInstrumented || _extConfig[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:%2eautoUnhandledPromiseInstrumented */];\r\n if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n _addHook(InstrumentEvent(_window, \"onunhandledrejection\", {\r\n ns: _evtNamespace,\r\n rsp: function (callDetails, error) {\r\n if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { // handled could be typeof function\r\n _self._onerror(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](_getReason(error), _location ? _location[_DYN_HREF /* @min:%2ehref */] : \"\", 0, 0, error, callDetails.evt));\r\n }\r\n }\r\n }, false));\r\n _errorHookCnt++;\r\n _extConfig[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:%2eautoUnhandledPromiseInstrumented */] = _autoUnhandledPromiseInstrumented = true;\r\n }\r\n }));\r\n }\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 - The severity of the log message\r\n * @param msgId - The log message.\r\n */\r\n function _throwInternal(severity, msgId, msg, properties, isUserAct) {\r\n _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]().throwInternal(severity, msgId, msg, properties, isUserAct);\r\n }\r\n function _initDefaults() {\r\n _eventTracking = null;\r\n _pageTracking = null;\r\n _pageViewManager = null;\r\n _pageViewPerformanceManager = null;\r\n _pageVisitTimeManager = null;\r\n _preInitTelemetryInitializers = null;\r\n _isBrowserLinkTrackingEnabled = false;\r\n _browserLinkInitializerAdded = false;\r\n _enableAutoRouteTracking = false;\r\n _historyListenerAdded = false;\r\n _disableExceptionTracking = false;\r\n _autoExceptionInstrumented = false;\r\n _enableUnhandledPromiseRejectionTracking = false;\r\n _autoUnhandledPromiseInstrumented = false;\r\n _autoTrackPageVisitTime = false;\r\n // Counts number of trackAjax invocations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n _trackAjaxAttempts = 0;\r\n // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.\r\n var location = getLocation(true);\r\n _prevUri = location && location[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n _currUri = null;\r\n _evtNamespace = null;\r\n _extConfig = null;\r\n _errorHookCnt = 0;\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return _extConfig; }\r\n });\r\n }\r\n // For backward compatibility\r\n objDefine(_self, \"_pageViewManager\", { g: function () { return _pageViewManager; } });\r\n objDefine(_self, \"_pageViewPerformanceManager\", { g: function () { return _pageViewPerformanceManager; } });\r\n objDefine(_self, \"_pageVisitTimeManager\", { g: function () { return _pageVisitTimeManager; } });\r\n objDefine(_self, \"_evtNamespace\", { g: function () { return \".\" + _evtNamespace; } });\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AnalyticsPlugin.prototype.getCookieMgr.\r\n// Removed Stub for AnalyticsPlugin.prototype.processTelemetry.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackEvent.\r\n// Removed Stub for AnalyticsPlugin.prototype.startTrackEvent.\r\n// Removed Stub for AnalyticsPlugin.prototype.stopTrackEvent.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackTrace.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackMetric.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackPageView.\r\n// Removed Stub for AnalyticsPlugin.prototype.sendPageViewInternal.\r\n// Removed Stub for AnalyticsPlugin.prototype.sendPageViewPerformanceInternal.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackPageViewPerformance.\r\n// Removed Stub for AnalyticsPlugin.prototype.startTrackPage.\r\n// Removed Stub for AnalyticsPlugin.prototype.stopTrackPage.\r\n// Removed Stub for AnalyticsPlugin.prototype.sendExceptionInternal.\r\n// Removed Stub for AnalyticsPlugin.prototype.trackException.\r\n// Removed Stub for AnalyticsPlugin.prototype._onerror.\r\n// Removed Stub for AnalyticsPlugin.prototype.addTelemetryInitializer.\r\n// Removed Stub for AnalyticsPlugin.prototype.initialize.\r\n AnalyticsPlugin.Version = '3.3.6'; // Not currently used anywhere\r\n return AnalyticsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { AnalyticsPlugin };\r\n//# sourceMappingURL=AnalyticsPlugin.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlCanUseSessionStorage, utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _warnToConsole, dateNow, dumpObj, getJSON, hasJSON, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { _DYN_TRACK_PREVIOUS_PAGE_1 } from \"../../__DynamicConstants\";\r\n/**\r\n * Used to track page visit durations\r\n */\r\nvar PageVisitTimeManager = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of PageVisitTimeManager\r\n * @param pageVisitTimeTrackingHandler - Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)\r\n * @returns {}\r\n */\r\n function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) {\r\n var prevPageVisitDataKeyName = \"prevPageVisitData\";\r\n dynamicProto(PageVisitTimeManager, this, function (_self) {\r\n _self[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */] = function (currentPageName, currentPageUrl) {\r\n try {\r\n // Restart timer for new page view\r\n var prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl);\r\n // If there was a page already being timed, track the visit time for it now.\r\n if (prevPageVisitTimeData) {\r\n pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime);\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Auto track page visit time failed, metric will not be collected: \" + dumpObj(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page (if exists) and starts timing for duration of visit to pageName\r\n * @param pageName - Name of page to begin timing visit duration\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.\r\n */\r\n function restartPageVisitTimer(pageName, pageUrl) {\r\n var prevPageVisitData = null;\r\n try {\r\n prevPageVisitData = stopPageVisitTimer();\r\n if (utlCanUseSessionStorage()) {\r\n if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) {\r\n throwError(\"Cannot call startPageVisit consecutively without first calling stopPageVisit\");\r\n }\r\n var currPageVisitDataStr = getJSON().stringify(new PageVisitData(pageName, pageUrl));\r\n utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr);\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Call to restart failed: \" + dumpObj(e));\r\n prevPageVisitData = null;\r\n }\r\n return prevPageVisitData;\r\n }\r\n /**\r\n * Stops timing of current page, if exists.\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.\r\n */\r\n function stopPageVisitTimer() {\r\n var prevPageVisitData = null;\r\n try {\r\n if (utlCanUseSessionStorage()) {\r\n // Define end time of page's visit\r\n var pageVisitEndTime = dateNow();\r\n // Try to retrieve page name and start time from session storage\r\n var pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName);\r\n if (pageVisitDataJsonStr && hasJSON()) {\r\n // if previous page data exists, set end time of visit\r\n prevPageVisitData = getJSON().parse(pageVisitDataJsonStr);\r\n prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime;\r\n // Remove data from storage since we already used it\r\n utlRemoveSessionStorage(logger, prevPageVisitDataKeyName);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Stop page visit timer failed: \" + dumpObj(e));\r\n prevPageVisitData = null;\r\n }\r\n return prevPageVisitData;\r\n }\r\n // For backward compatibility\r\n objDefine(_self, \"_logger\", { g: function () { return logger; } });\r\n objDefine(_self, \"pageVisitTimeTrackingHandler\", { g: function () { return pageVisitTimeTrackingHandler; } });\r\n });\r\n }\r\n// Removed Stub for PageVisitTimeManager.prototype.trackPreviousPageVisit.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PageVisitTimeManager.__ieDyn=1;\n\n return PageVisitTimeManager;\r\n}());\r\nexport { PageVisitTimeManager };\r\nvar PageVisitData = /** @class */ (function () {\r\n function PageVisitData(pageName, pageUrl) {\r\n this.pageVisitStartTime = dateNow();\r\n this.pageName = pageName;\r\n this.pageUrl = pageUrl;\r\n }\r\n return PageVisitData;\r\n}());\r\nexport { PageVisitData };\r\n//# sourceMappingURL=PageVisitTimeManager.js.map","/*\n * Application Insights JavaScript SDK - Web Analytics, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { dateTimeUtilsDuration } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * Used to record timed events and page views.\r\n */\r\nvar Timing = /** @class */ (function () {\r\n function Timing(logger, name) {\r\n var _self = this;\r\n var _events = {};\r\n _self.start = function (name) {\r\n if (typeof _events[name] !== \"undefined\") {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 62 /* _eInternalMessageId.StartCalledMoreThanOnce */, \"start was called more than once for this event without calling stop.\", { name: name, key: name }, true);\r\n }\r\n _events[name] = +new Date;\r\n };\r\n _self.stop = function (name, url, properties, measurements) {\r\n var start = _events[name];\r\n if (isNaN(start)) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 63 /* _eInternalMessageId.StopCalledWithoutStart */, \"stop was called without a corresponding start.\", { name: name, key: name }, true);\r\n }\r\n else {\r\n var end = +new Date;\r\n var duration = dateTimeUtilsDuration(start, end);\r\n _self.action(name, url, duration, properties, measurements);\r\n }\r\n delete _events[name];\r\n _events[name] = undefined;\r\n };\r\n }\r\n return Timing;\r\n}());\r\nexport { Timing };\r\n//# sourceMappingURL=Timing.js.map","/*!\n * NevWare21 Solutions LLC - ts-async, 0.5.4\n * https://github.com/nevware21/ts-async\n * Copyright (c) NevWare21 Solutions LLC and contributors. All rights reserved.\n * Licensed under the MIT license.\n */\nimport { isPromiseLike, objDefineProperties, getDocument, createCachedValue, safe, getInst, dumpObj, arrSlice, objDefineProp, hasSymbol, getKnownSymbol, isFunction, throwTypeError, iterForOf, scheduleTimeout, isNode, getWindow, getGlobal, objDefine, objToString, isUndefined, isArray, arrForEach, isIterable, createCustomError, isNumber, scheduleIdleCallback, utcNow, getLength, isIterator, fnCall, arrIndexOf } from '@nevware21/ts-utils';\n\nvar STR_PROMISE = \"Promise\";\nvar DONE = \"done\";\nvar VALUE = \"value\";\nvar RETURN = \"return\";\nvar REJECTED = \"rejected\";\n\nfunction doAwaitResponse(value, cb) {\n return doAwait(value, function (value) {\n return cb ? cb({\n status: \"fulfilled\",\n rejected: false,\n value: value\n }) : value;\n }, function (reason) {\n return cb ? cb({\n status: REJECTED,\n rejected: true,\n reason: reason\n }) : reason;\n });\n}\nfunction doAwait(value, resolveFn, rejectFn, finallyFn) {\n var result = value;\n try {\n if (isPromiseLike(value)) {\n if (resolveFn || rejectFn) {\n result = value.then(resolveFn, rejectFn);\n }\n }\n else {\n try {\n if (resolveFn) {\n result = resolveFn(value);\n }\n }\n catch (err) {\n if (rejectFn) {\n result = rejectFn(err);\n }\n else {\n throw err;\n }\n }\n }\n }\n finally {\n if (finallyFn) {\n doFinally(result, finallyFn);\n }\n }\n return result;\n}\nfunction doFinally(value, finallyFn) {\n var result = value;\n if (finallyFn) {\n if (isPromiseLike(value)) {\n if (value.finally) {\n result = value.finally(finallyFn);\n }\n else {\n result = value.then(function (value) {\n finallyFn();\n return value;\n }, function (reason) {\n finallyFn();\n throw reason;\n });\n }\n }\n else {\n finallyFn();\n }\n }\n return result;\n}\n\n/*#__NO_SIDE_EFFECTS__*/\nfunction _pureAssign(func1, func2) {\n return func1 || func2;\n}\n\nvar _debugState;\nvar _debugResult;\nvar _debugHandled;\nvar _promiseDebugEnabled = false;\nfunction _addDebugState$1(thePromise, stateFn, resultFn, handledFn) {\n _debugState = _debugState || { toString: function () { return \"[[PromiseState]]\"; } };\n _debugResult = _debugResult || { toString: function () { return \"[[PromiseResult]]\"; } };\n _debugHandled = _debugHandled || { toString: function () { return \"[[PromiseIsHandled]]\"; } };\n var props = {};\n props[_debugState] = { get: stateFn };\n props[_debugResult] = { get: resultFn };\n props[_debugHandled] = { get: handledFn };\n objDefineProperties(thePromise, props);\n}\nfunction setPromiseDebugState(enabled, logger) {\n _promiseDebugEnabled = enabled;\n}\n\nvar STRING_STATES = [\n \"pending\", \"resolving\", \"resolved\", REJECTED\n];\n\nvar DISPATCH_EVENT = \"dispatchEvent\";\nvar _hasInitEvent;\nfunction _hasInitEventFn(doc) {\n var evt;\n if (doc && doc.createEvent) {\n evt = doc.createEvent(\"Event\");\n }\n return (!!evt && evt.initEvent);\n}\nfunction emitEvent(target, evtName, populateEvent, useNewEvent) {\n var doc = getDocument();\n !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [doc]).v));\n var theEvt = _hasInitEvent.v ? doc.createEvent(\"Event\") : (useNewEvent ? new Event(evtName) : {});\n populateEvent && populateEvent(theEvt);\n if (_hasInitEvent.v) {\n theEvt.initEvent(evtName, false, true);\n }\n if (theEvt && target[DISPATCH_EVENT]) {\n target[DISPATCH_EVENT](theEvt);\n }\n else {\n var handler = target[\"on\" + evtName];\n if (handler) {\n handler(theEvt);\n }\n else {\n var theConsole = getInst(\"console\");\n theConsole && (theConsole[\"error\"] || theConsole[\"log\"])(evtName, dumpObj(theEvt));\n }\n }\n}\n\nvar NODE_UNHANDLED_REJECTION = \"unhandledRejection\";\nvar UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();\nvar _currentPromiseId = [];\nvar _uniquePromiseId = 0;\nvar _unhandledRejectionTimeout = 10;\nvar _aggregationError;\nvar _hasPromiseRejectionEvent;\nfunction dumpFnObj(value) {\n if (isFunction(value)) {\n return value.toString();\n }\n return dumpObj(value);\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createAggregationError(values) {\n !_aggregationError && (_aggregationError = createCachedValue(safe(getInst, [\"AggregationError\"]).v || createCustomError(\"AggregationError\", function (self, args) {\n self.errors = args[0];\n })));\n return new _aggregationError.v(values);\n}\nfunction _createPromise(newPromise, processor, executor) {\n var additionalArgs = arrSlice(arguments, 3);\n var _state = 0 ;\n var _hasResolved = false;\n var _settledValue;\n var _queue = [];\n var _id = _uniquePromiseId++;\n var _parentId = _currentPromiseId.length > 0 ? _currentPromiseId[_currentPromiseId.length - 1] : undefined;\n var _handled = false;\n var _unHandledRejectionHandler = null;\n var _thePromise;\n function _then(onResolved, onRejected) {\n try {\n _currentPromiseId.push(_id);\n _handled = true;\n _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();\n _unHandledRejectionHandler = null;\n var thenPromise = newPromise(function (resolve, reject) {\n _queue.push(function () {\n try {\n var handler = _state === 2 ? onResolved : onRejected;\n var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler);\n if (isPromiseLike(value)) {\n value.then(resolve, reject);\n }\n else if (handler) {\n resolve(value);\n }\n else if (_state === 3 ) {\n reject(value);\n }\n else {\n resolve(value);\n }\n }\n catch (e) {\n reject(e);\n }\n });\n if (_hasResolved) {\n _processQueue();\n }\n }, additionalArgs);\n return thenPromise;\n }\n finally {\n _currentPromiseId.pop();\n }\n }\n function _catch(onRejected) {\n return _then(undefined, onRejected);\n }\n function _finally(onFinally) {\n var thenFinally = onFinally;\n var catchFinally = onFinally;\n if (isFunction(onFinally)) {\n thenFinally = function (value) {\n onFinally && onFinally();\n return value;\n };\n catchFinally = function (reason) {\n onFinally && onFinally();\n throw reason;\n };\n }\n return _then(thenFinally, catchFinally);\n }\n function _strState() {\n return STRING_STATES[_state];\n }\n function _processQueue() {\n if (_queue.length > 0) {\n var pending = _queue.slice();\n _queue = [];\n _handled = true;\n _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();\n _unHandledRejectionHandler = null;\n processor(pending);\n }\n }\n function _createSettleIfFn(newState, allowState) {\n return function (theValue) {\n if (_state === allowState) {\n if (newState === 2 && isPromiseLike(theValue)) {\n _state = 1 ;\n theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 ));\n return;\n }\n _state = newState;\n _hasResolved = true;\n _settledValue = theValue;\n _processQueue();\n if (!_handled && newState === 3 && !_unHandledRejectionHandler) {\n _unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout);\n }\n }\n };\n }\n function _notifyUnhandledRejection() {\n if (!_handled) {\n _handled = true;\n if (isNode()) {\n process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);\n }\n else {\n var gbl = getWindow() || getGlobal();\n !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = createCachedValue(safe((getInst), [STR_PROMISE + \"RejectionEvent\"]).v));\n emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) {\n objDefine(theEvt, \"promise\", { g: function () { return _thePromise; } });\n theEvt.reason = _settledValue;\n return theEvt;\n }, !!_hasPromiseRejectionEvent.v);\n }\n }\n }\n _thePromise = {\n then: _then,\n \"catch\": _catch,\n finally: _finally\n };\n objDefineProp(_thePromise, \"state\", {\n get: _strState\n });\n if (_promiseDebugEnabled) {\n _addDebugState$1(_thePromise, _strState, function () { return objToString(_settledValue); }, function () { return _handled; });\n }\n if (hasSymbol()) {\n _thePromise[getKnownSymbol(11 )] = \"IPromise\";\n }\n function _toString() {\n return \"IPromise\" + (_promiseDebugEnabled ? \"[\" + _id + (!isUndefined(_parentId) ? (\":\" + _parentId) : \"\") + \"]\" : \"\") + \" \" + _strState() + (_hasResolved ? (\" - \" + dumpFnObj(_settledValue)) : \"\") + (\"\");\n }\n _thePromise.toString = _toString;\n (function _initialize() {\n if (!isFunction(executor)) {\n throwTypeError(STR_PROMISE + \": executor is not a function - \" + dumpFnObj(executor));\n }\n var _rejectFn = _createSettleIfFn(3 , 0 );\n try {\n executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn);\n }\n catch (e) {\n _rejectFn(e);\n }\n })();\n return _thePromise;\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createAllPromise(newPromise) {\n return function (input) {\n var additionalArgs = arrSlice(arguments, 1);\n return newPromise(function (resolve, reject) {\n try {\n var values_1 = [];\n var pending_1 = 1;\n iterForOf(input, function (item, idx) {\n if (item) {\n pending_1++;\n doAwait(item, function (value) {\n values_1[idx] = value;\n if (--pending_1 === 0) {\n resolve(values_1);\n }\n }, reject);\n }\n });\n pending_1--;\n if (pending_1 === 0) {\n resolve(values_1);\n }\n }\n catch (e) {\n reject(e);\n }\n }, additionalArgs);\n };\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createResolvedPromise(newPromise) {\n return function (value) {\n var additionalArgs = arrSlice(arguments, 1);\n if (isPromiseLike(value)) {\n return value;\n }\n return newPromise(function (resolve) {\n resolve(value);\n }, additionalArgs);\n };\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createRejectedPromise(newPromise) {\n return function (reason) {\n var additionalArgs = arrSlice(arguments, 1);\n return newPromise(function (_resolve, reject) {\n reject(reason);\n }, additionalArgs);\n };\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createAllSettledPromise(newPromise) {\n return createCachedValue(function (input) {\n var additionalArgs = arrSlice(arguments, 1);\n return newPromise(function (resolve, reject) {\n var values = [];\n var pending = 1;\n function processItem(item, idx) {\n pending++;\n doAwaitResponse(item, function (value) {\n if (value.rejected) {\n values[idx] = {\n status: REJECTED,\n reason: value.reason\n };\n }\n else {\n values[idx] = {\n status: \"fulfilled\",\n value: value.value\n };\n }\n if (--pending === 0) {\n resolve(values);\n }\n });\n }\n try {\n if (isArray(input)) {\n arrForEach(input, processItem);\n }\n else if (isIterable(input)) {\n iterForOf(input, processItem);\n }\n else {\n throwTypeError(\"Input is not an iterable\");\n }\n pending--;\n if (pending === 0) {\n resolve(values);\n }\n }\n catch (e) {\n reject(e);\n }\n }, additionalArgs);\n });\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createRacePromise(newPromise) {\n return createCachedValue(function (input) {\n var additionalArgs = arrSlice(arguments, 1);\n return newPromise(function (resolve, reject) {\n var isDone = false;\n function processItem(item) {\n doAwaitResponse(item, function (value) {\n if (!isDone) {\n isDone = true;\n if (value.rejected) {\n reject(value.reason);\n }\n else {\n resolve(value.value);\n }\n }\n });\n }\n try {\n if (isArray(input)) {\n arrForEach(input, processItem);\n }\n else if (isIterable(input)) {\n iterForOf(input, processItem);\n }\n else {\n throwTypeError(\"Input is not an iterable\");\n }\n }\n catch (e) {\n reject(e);\n }\n }, additionalArgs);\n });\n}\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createAnyPromise(newPromise) {\n return createCachedValue(function (input) {\n var additionalArgs = arrSlice(arguments, 1);\n return newPromise(function (resolve, reject) {\n var theErros = [];\n var pending = 1;\n var isDone = false;\n function processItem(item, idx) {\n pending++;\n doAwaitResponse(item, function (value) {\n if (!value.rejected) {\n isDone = true;\n resolve(value.value);\n return;\n }\n else {\n theErros[idx] = value.reason;\n }\n if (--pending === 0 && !isDone) {\n reject(_createAggregationError(theErros));\n }\n });\n }\n try {\n if (isArray(input)) {\n arrForEach(input, processItem);\n }\n else if (isIterable(input)) {\n iterForOf(input, processItem);\n }\n else {\n throwTypeError(\"Input is not an iterable\");\n }\n pending--;\n if (pending === 0 && !isDone) {\n reject(_createAggregationError(theErros));\n }\n }\n catch (e) {\n reject(e);\n }\n }, additionalArgs);\n });\n}\n\nfunction syncItemProcessor(pending) {\n arrForEach(pending, function (fn) {\n try {\n fn();\n }\n catch (e) {\n }\n });\n}\nfunction timeoutItemProcessor(timeout) {\n var callbackTimeout = isNumber(timeout) ? timeout : 0;\n return function (pending) {\n scheduleTimeout(function () {\n syncItemProcessor(pending);\n }, callbackTimeout);\n };\n}\nfunction idleItemProcessor(timeout) {\n var options;\n if (timeout >= 0) {\n options = {\n timeout: +timeout\n };\n }\n return function (pending) {\n scheduleIdleCallback(function (deadline) {\n syncItemProcessor(pending);\n }, options);\n };\n}\n\nvar _allAsyncSettledCreator;\nvar _raceAsyncCreator;\nvar _anyAsyncCreator;\nfunction createAsyncPromise(executor, timeout) {\n return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);\n}\nvar createAsyncAllPromise = /*#__PURE__*/ _createAllPromise(createAsyncPromise);\nvar createAsyncResolvedPromise = /*#__PURE__*/ _createResolvedPromise(createAsyncPromise);\nvar createAsyncRejectedPromise = /*#__PURE__*/ _createRejectedPromise(createAsyncPromise);\nfunction createAsyncAllSettledPromise(input, timeout) {\n !_allAsyncSettledCreator && (_allAsyncSettledCreator = _createAllSettledPromise(createAsyncPromise));\n return _allAsyncSettledCreator.v(input, timeout);\n}\nfunction createAsyncRacePromise(values, timeout) {\n !_raceAsyncCreator && (_raceAsyncCreator = _createRacePromise(createAsyncPromise));\n return _raceAsyncCreator.v(values, timeout);\n}\nfunction createAsyncAnyPromise(values, timeout) {\n !_anyAsyncCreator && (_anyAsyncCreator = _createAnyPromise(createAsyncPromise));\n return _anyAsyncCreator.v(values, timeout);\n}\n\nvar _promiseCls;\nvar _allCreator;\nvar _allNativeSettledCreator;\nvar _raceNativeCreator;\nvar _anyNativeCreator;\n/*#__NO_SIDE_EFFECTS__*/\nfunction _createNativePromiseHelper(name, func) {\n !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));\n if (_promiseCls.v && _promiseCls.v[name]) {\n return createCachedValue(function (input, timeout) {\n return createNativePromise(function (resolve, reject) {\n _promiseCls.v[name](input).then(resolve, reject);\n });\n });\n }\n return func();\n}\nfunction createNativePromise(executor, timeout) {\n !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));\n var PrmCls = _promiseCls.v;\n if (!PrmCls) {\n return createAsyncPromise(executor);\n }\n if (!isFunction(executor)) {\n throwTypeError(STR_PROMISE + \": executor is not a function - \" + dumpObj(executor));\n }\n var _state = 0 ;\n function _strState() {\n return STRING_STATES[_state];\n }\n var thePromise = new PrmCls(function (resolve, reject) {\n function _resolve(value) {\n _state = 2 ;\n resolve(value);\n }\n function _reject(reason) {\n _state = 3 ;\n reject(reason);\n }\n executor(_resolve, _reject);\n });\n objDefineProp(thePromise, \"state\", {\n get: _strState\n });\n return thePromise;\n}\nfunction createNativeAllPromise(input, timeout) {\n !_allCreator && (_allCreator = _createNativePromiseHelper(\"all\", function () { return createCachedValue(_createAllPromise(createNativePromise)); }));\n return _allCreator.v(input, timeout);\n}\nvar createNativeResolvedPromise = /*#__PURE__*/ _createResolvedPromise(createNativePromise);\nvar createNativeRejectedPromise = /*#__PURE__*/ _createRejectedPromise(createNativePromise);\nfunction createNativeAllSettledPromise(input, timeout) {\n !_allNativeSettledCreator && (_allNativeSettledCreator = _createNativePromiseHelper(\"allSettled\", function () { return _createAllSettledPromise(createNativePromise); }));\n return _allNativeSettledCreator.v(input, timeout);\n}\nfunction createNativeRacePromise(values, timeout) {\n !_raceNativeCreator && (_raceNativeCreator = _createNativePromiseHelper(\"race\", function () { return _createRacePromise(createNativePromise); }));\n return _raceNativeCreator.v(values, timeout);\n}\nfunction createNativeAnyPromise(values, timeout) {\n !_anyNativeCreator && (_anyNativeCreator = _createNativePromiseHelper(\"any\", function () { return _createAnyPromise(createNativePromise); }));\n return _anyNativeCreator.v(values, timeout);\n}\n\nvar _allSyncSettledCreator;\nvar _raceSyncCreator;\nvar _anySyncCreator;\nfunction createSyncPromise(executor) {\n return _createPromise(createSyncPromise, syncItemProcessor, executor);\n}\nvar createSyncAllPromise = /*#__PURE__*/ _createAllPromise(createSyncPromise);\nvar createSyncResolvedPromise = /*#__PURE__*/ _createResolvedPromise(createSyncPromise);\nvar createSyncRejectedPromise = /*#__PURE__*/ _createRejectedPromise(createSyncPromise);\nfunction createSyncAllSettledPromise(input, timeout) {\n !_allSyncSettledCreator && (_allSyncSettledCreator = _createAllSettledPromise(createSyncPromise));\n return _allSyncSettledCreator.v(input, timeout);\n}\nfunction createSyncRacePromise(values, timeout) {\n !_raceSyncCreator && (_raceSyncCreator = _createRacePromise(createSyncPromise));\n return _raceSyncCreator.v(values, timeout);\n}\nfunction createSyncAnyPromise(values, timeout) {\n !_anySyncCreator && (_anySyncCreator = _createAnyPromise(createSyncPromise));\n return _anySyncCreator.v(values, timeout);\n}\n\nvar _defaultIdleTimeout;\nvar _allIdleSettledCreator;\nvar _raceIdleCreator;\nvar _anyIdleCreator;\nfunction setDefaultIdlePromiseTimeout(idleDeadline) {\n _defaultIdleTimeout = idleDeadline;\n}\nvar setDefaultIdleTimeout = ( /*#__PURE__*/_pureAssign(setDefaultIdlePromiseTimeout));\nfunction createIdlePromise(executor, timeout) {\n var theTimeout = isUndefined(timeout) ? _defaultIdleTimeout : timeout;\n return _createPromise(createIdlePromise, idleItemProcessor(theTimeout), executor, theTimeout);\n}\nvar createIdleAllPromise = /*#__PURE__*/ _createAllPromise(createIdlePromise);\nvar createIdleResolvedPromise = /*#__PURE__*/ _createResolvedPromise(createIdlePromise);\nvar createIdleRejectedPromise = /*#__PURE__*/ _createRejectedPromise(createIdlePromise);\nfunction createIdleAllSettledPromise(input, timeout) {\n !_allIdleSettledCreator && (_allIdleSettledCreator = _createAllSettledPromise(createIdlePromise));\n return _allIdleSettledCreator.v(input, timeout);\n}\nfunction createIdleRacePromise(values, timeout) {\n !_raceIdleCreator && (_raceIdleCreator = _createRacePromise(createIdlePromise));\n return _raceIdleCreator.v(values, timeout);\n}\nfunction createIdleAnyPromise(values, timeout) {\n !_anyIdleCreator && (_anyIdleCreator = _createAnyPromise(createIdlePromise));\n return _anyIdleCreator.v(values, timeout);\n}\n\nvar _promiseCreator;\nvar _allSettledCreator;\nvar _raceCreator;\nvar _anyCreator;\nfunction setCreatePromiseImpl(creator) {\n _promiseCreator = creator ? createCachedValue(creator) : null;\n}\nfunction createPromise(executor, timeout) {\n !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));\n return _promiseCreator.v.call(this, executor, timeout);\n}\nvar createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);\nvar createResolvedPromise = /*#__PURE__*/ _createResolvedPromise(createPromise);\nvar createRejectedPromise = /*#__PURE__*/ _createRejectedPromise(createPromise);\nfunction createAllSettledPromise(input, timeout) {\n !_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));\n return _allSettledCreator.v(input, timeout);\n}\nfunction createRacePromise(values, timeout) {\n !_raceCreator && (_raceCreator = _createRacePromise(createPromise));\n return _raceCreator.v(values, timeout);\n}\nfunction createAnyPromise(values, timeout) {\n !_anyCreator && (_anyCreator = _createAnyPromise(createPromise));\n return _anyCreator.v(values, timeout);\n}\n\nfunction createTimeoutPromise(timeout, resolveReject, message) {\n return createPromise(function (resolve, reject) {\n scheduleTimeout(function () {\n (resolveReject ? resolve : reject)(!isUndefined(message) ? message : \"Timeout of \" + timeout + \"ms exceeded\");\n }, timeout);\n });\n}\n\nfunction _doneChk(isDone, state, value, thisArg) {\n var result = isDone;\n state.res = value;\n if (!result) {\n if (state.isDone && isFunction(state.isDone)) {\n return doAwait(state.isDone.call(thisArg, state), function (done) {\n state.iter++;\n return !!done;\n });\n }\n else {\n result = !!state.isDone;\n }\n }\n state.iter++;\n return result;\n}\nfunction doWhileAsync(callbackFn, isDoneFn, thisArg) {\n var promise;\n var resolve;\n var reject = function (reason) {\n isDone = true;\n throw reason;\n };\n var isDone = false;\n var state = {\n st: utcNow(),\n iter: 0,\n isDone: isDoneFn || false\n };\n if (callbackFn) {\n var _createPromise_1 = function () {\n return createPromise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n };\n var _handleAsyncDone_1 = function (done) {\n isDone = !!done;\n if (!isDone) {\n _processNext_1();\n }\n else {\n resolve(state.res);\n }\n };\n var _processNext_1 = function () {\n while (!isDone) {\n try {\n var cbResult = callbackFn.call(thisArg, state);\n if (isPromiseLike(cbResult)) {\n promise = promise || _createPromise_1();\n doAwait(cbResult, function (res) {\n try {\n doAwait(_doneChk(isDone, state, res, thisArg), _handleAsyncDone_1, reject);\n }\n catch (e) {\n reject(e);\n }\n }, reject);\n return promise;\n }\n else {\n var dnRes = _doneChk(isDone, state, cbResult, thisArg);\n if (isPromiseLike(dnRes)) {\n promise = promise || _createPromise_1();\n doAwait(dnRes, _handleAsyncDone_1, reject);\n return promise;\n }\n else {\n isDone = !!dnRes;\n }\n }\n }\n catch (e) {\n reject(e);\n return promise;\n }\n }\n if (isDone && resolve) {\n resolve(state.res);\n }\n return promise || state.res;\n };\n return _processNext_1();\n }\n}\n\nfunction arrForEachAsync(theArray, callbackFn, thisArg) {\n if (theArray) {\n var len_1 = getLength(theArray);\n if (len_1) {\n var isDone = function (state) {\n if (state.iter >= len_1 || state.res === -1) {\n return true;\n }\n };\n return doWhileAsync(function (state) {\n var idx = state.iter;\n if (idx in theArray) {\n return callbackFn.call(thisArg || theArray, theArray[idx], idx, theArray);\n }\n }, isDone);\n }\n }\n}\n\nvar _iterSymbol;\nvar _iterAsyncSymbol;\nfunction iterForOfAsync(iter, callbackFn, thisArg) {\n var err;\n var iterResult;\n var theIter = iter;\n function onFailed(failed) {\n err = { e: failed };\n if (theIter.throw) {\n iterResult = null;\n theIter.throw(err);\n }\n throw failed;\n }\n function onFinally() {\n try {\n if (iterResult && !iterResult[DONE]) {\n theIter[RETURN] && theIter[RETURN](iterResult);\n }\n }\n finally {\n if (err) {\n throw err.e;\n }\n }\n }\n if (iter) {\n if (!isIterator(iter)) {\n !_iterAsyncSymbol && (_iterAsyncSymbol = createCachedValue(getKnownSymbol(0 )));\n theIter = iter[_iterAsyncSymbol.v] ? iter[_iterAsyncSymbol.v]() : null;\n if (!theIter) {\n !_iterSymbol && (_iterSymbol = createCachedValue(getKnownSymbol(3 )));\n theIter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null;\n }\n }\n if (theIter && isIterator(theIter)) {\n var result = void 0;\n try {\n result = doWhileAsync(function (state) {\n return doAwait(theIter.next(), function (res) {\n iterResult = res;\n if (!res[DONE]) {\n return fnCall(callbackFn, thisArg || theIter, iterResult[VALUE], state.iter, theIter);\n }\n }, function (reason) {\n state.isDone = true;\n onFailed(reason);\n });\n }, function (state) {\n if (!iterResult || iterResult[DONE] || state.res === -1) {\n onFinally();\n return true;\n }\n }, thisArg || theIter);\n if (isPromiseLike(result)) {\n result = doFinally(result.catch(onFailed), onFinally);\n }\n return result;\n }\n catch (failed) {\n onFailed(failed);\n }\n finally {\n if (result && !isPromiseLike(result)) {\n onFinally();\n }\n }\n }\n }\n}\n\nvar REJECT = \"reject\";\nvar REJECTED_ERROR = \"Rejected\";\nvar _schedulerId = 0;\nvar _debugName;\nvar _debugIntState;\nvar _customErrors = {};\nfunction _rejectDone() {\n}\nfunction _createError(type, evt, message) {\n !_customErrors[type] && (_customErrors[type] = createCustomError(type));\n var now = utcNow();\n return new (_customErrors[type])(\"Task [\".concat(evt.id, \"] \").concat(message || \"\", \"- \").concat((evt.st ? \"Running\" : \"Waiting\"), \": \").concat(_calcTime(now, evt.st || evt.cr)));\n}\nfunction _calcTime(now, start) {\n return ((now - start) || \"0\") + \" ms\";\n}\nfunction _abortStaleTasks(taskQueue, staleTimeoutPeriod) {\n var now = utcNow();\n var expired = now - staleTimeoutPeriod;\n arrForEach(taskQueue, function (evt) {\n if (evt && !evt.rj && (evt.st && evt.st < expired) || (!evt.st && evt.cr && evt.cr < expired)) {\n evt && evt[REJECT](evt.rj || _createError(\"Aborted\", evt, \"Stale \"));\n }\n });\n}\nfunction _removeTask(queue, taskDetail) {\n var idx = arrIndexOf(queue, taskDetail);\n if (idx !== -1) {\n queue.splice(idx, 1);\n }\n}\nfunction _addDebugState(theScheduler, nameFn, stateFn) {\n _debugName = _debugName || { toString: function () { return \"[[SchedulerName]]\"; } };\n _debugIntState = _debugIntState || { toString: function () { return \"[[SchedulerState]]\"; } };\n objDefineProp(theScheduler, _debugName, { get: nameFn });\n objDefineProp(theScheduler, _debugIntState, { get: stateFn });\n}\nfunction createTaskScheduler(newPromise, name) {\n var _theTask;\n var _running = [];\n var _waiting = [];\n var _staleTimeoutPeriod = 600000;\n var _staleTimeoutCheckPeriod = _staleTimeoutPeriod / 10;\n var _taskCount = 0;\n var _schedulerName = (name ? (name + \".\") : \"\") + _schedulerId++;\n var _blockedTimer;\n newPromise = newPromise || createPromise;\n var _startBlockedTimer = function () {\n var hasTasks = (getLength(_running) + getLength(_waiting)) > 0;\n if (_staleTimeoutPeriod > 0) {\n if (!_blockedTimer) {\n _blockedTimer = scheduleTimeout(function () {\n _abortStaleTasks(_running, _staleTimeoutPeriod);\n _abortStaleTasks(_waiting, _staleTimeoutPeriod);\n _blockedTimer && (_blockedTimer.enabled = ((getLength(_running) + getLength(_waiting)) > 0));\n }, _staleTimeoutCheckPeriod);\n _blockedTimer.unref();\n }\n _blockedTimer && (_blockedTimer.enabled = hasTasks);\n }\n };\n var _queueTask = function (startAction, taskName, timeout) {\n var _a;\n var taskId = _schedulerName + \".\" + _taskCount++;\n if (taskName) {\n taskId += \"-(\" + taskName + \")\";\n }\n var newTask = (_a = {\n id: taskId,\n cr: utcNow(),\n to: timeout\n },\n _a[REJECT] = function (reason) {\n newTask.rj = reason || _createError(REJECTED_ERROR, newTask);\n newTask[REJECT] = _rejectDone;\n },\n _a);\n if (!_theTask) {\n newTask.p = newPromise(_runTask(newTask, startAction));\n }\n else {\n newTask.p = _waitForPreviousTask(newTask, _theTask, startAction);\n }\n _theTask = newTask;\n return newTask.p;\n };\n var _runTask = function (taskDetail, startAction) {\n taskDetail.st = utcNow();\n _running.push(taskDetail);\n _startBlockedTimer();\n return function (onTaskResolve, onTaskReject) {\n var _promiseReject = function (reason) {\n taskDetail.rj = taskDetail.rj || reason || _createError(REJECTED_ERROR, taskDetail);\n taskDetail[REJECT] = _rejectDone;\n _doCleanup(taskDetail);\n onTaskResolve = null;\n onTaskReject && onTaskReject(reason);\n onTaskReject = null;\n };\n var taskId = taskDetail.id;\n if (taskDetail.rj) {\n _promiseReject(taskDetail.rj);\n }\n else {\n taskDetail[REJECT] = _promiseReject;\n try {\n var startResult = startAction(taskId);\n if (taskDetail.to && isPromiseLike(startResult)) {\n taskDetail.t = scheduleTimeout(function () {\n _promiseReject(_createError(\"Timeout\", taskDetail));\n }, taskDetail.to);\n }\n doAwait(startResult, function (theResult) {\n _doCleanup(taskDetail);\n try {\n onTaskResolve && onTaskResolve(theResult);\n }\n catch (e) {\n onTaskReject && onTaskReject(e);\n }\n onTaskReject = null;\n onTaskResolve = null;\n }, _promiseReject);\n }\n catch (e) {\n _promiseReject(e);\n }\n }\n };\n };\n var _waitForPreviousTask = function (taskDetail, prevTask, startAction) {\n _waiting.push(taskDetail);\n _startBlockedTimer();\n return newPromise(function (onWaitResolve, onWaitReject) {\n doAwaitResponse(prevTask.p, function () {\n _removeTask(_waiting, taskDetail);\n _runTask(taskDetail, startAction)(onWaitResolve, onWaitReject);\n });\n });\n };\n var _doCleanup = function (taskDetail) {\n _removeTask(_running, taskDetail);\n taskDetail.t && taskDetail.t.cancel();\n taskDetail.t = null;\n if (_theTask && _theTask === taskDetail) {\n _theTask = null;\n if (getLength(_running) + getLength(_waiting) === 0) {\n _blockedTimer && _blockedTimer.cancel();\n _blockedTimer = null;\n }\n }\n };\n var theScheduler = {\n idle: true,\n queue: _queueTask,\n setStaleTimeout: function (staleTimeout, staleCheckPeriod) {\n _blockedTimer && _blockedTimer.cancel();\n _blockedTimer = null;\n _staleTimeoutPeriod = staleTimeout;\n _staleTimeoutCheckPeriod = staleCheckPeriod || staleTimeout / 10;\n _startBlockedTimer();\n }\n };\n objDefine(theScheduler, \"idle\", {\n g: function () {\n return getLength(_running) + getLength(_waiting) === 0;\n }\n });\n _addDebugState(theScheduler, function () { return _schedulerName; }, function () {\n return {\n l: _theTask,\n r: _running,\n w: _waiting\n };\n });\n return theScheduler;\n}\n\nvar toStringTagSymbol = getKnownSymbol(11 );\nvar PolyPromise = /*#__PURE__*/ (function () {\n function PolyPromiseImpl(executor) {\n this._$ = createAsyncPromise(executor);\n if (toStringTagSymbol) {\n this[toStringTagSymbol] = \"Promise\";\n }\n objDefineProp(this, \"state\", {\n get: function () {\n return this._$.state;\n }\n });\n }\n PolyPromiseImpl.all = createAsyncAllPromise;\n PolyPromiseImpl.race = createAsyncRacePromise;\n PolyPromiseImpl.any = createAsyncAnyPromise;\n PolyPromiseImpl.reject = createAsyncRejectedPromise;\n PolyPromiseImpl.resolve = createAsyncResolvedPromise;\n PolyPromiseImpl.allSettled = createAsyncAllSettledPromise;\n var theProto = PolyPromiseImpl.prototype;\n theProto.then = function (onResolved, onRejected) {\n return this._$.then(onResolved, onRejected);\n };\n theProto.catch = function (onRejected) {\n return this._$.catch(onRejected);\n };\n theProto.finally = function (onfinally) {\n return this._$.finally(onfinally);\n };\n return PolyPromiseImpl;\n}());\n\nexport { PolyPromise, arrForEachAsync, createAllPromise, createAllSettledPromise, createAnyPromise, createAsyncAllPromise, createAsyncAllSettledPromise, createAsyncAnyPromise, createAsyncPromise, createAsyncRacePromise, createAsyncRejectedPromise, createAsyncResolvedPromise, createIdleAllPromise, createIdleAllSettledPromise, createIdleAnyPromise, createIdlePromise, createIdleRacePromise, createIdleRejectedPromise, createIdleResolvedPromise, createNativeAllPromise, createNativeAllSettledPromise, createNativeAnyPromise, createNativePromise, createNativeRacePromise, createNativeRejectedPromise, createNativeResolvedPromise, createPromise, createRacePromise, createRejectedPromise, createResolvedPromise, createSyncAllPromise, createSyncAllSettledPromise, createSyncAnyPromise, createSyncPromise, createSyncRacePromise, createSyncRejectedPromise, createSyncResolvedPromise, createTaskScheduler, createTimeoutPromise, doAwait, doAwaitResponse, doFinally, doWhileAsync, iterForOfAsync, setCreatePromiseImpl, setDefaultIdlePromiseTimeout, setDefaultIdleTimeout, setPromiseDebugState };\n//# sourceMappingURL=ts-async.js.map\n","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_FEATURE_OPT_IN = \"featureOptIn\"; // Count: 4\r\nexport var _DYN_SCHEDULE_FETCH_TIMEO0 = \"scheduleFetchTimeout\"; // Count: 2\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { isNullOrUndefined, isObject, objExtend, objForEachKey, setValueByKey } from \"@nevware21/ts-utils\";\r\nimport { _DYN_FEATURE_OPT_IN } from \"./__DynamicConstants\";\r\n/**\r\n * Delete a config key in the given cfg, if the config key exists in nonOverrideConfigs and its value is set to true\r\n * @param cfg - cfg to modify\r\n * @param nonOverrideConfigs - nonOverrideConfigs\r\n * @param curLevel - cur config level, starting at 0\r\n * @param maxLevel - max config level\r\n * @returns new copy of modified configs\r\n */\r\nexport function replaceByNonOverrideCfg(cfg, nonOverrideConfigs, curLevel, maxLevel) {\r\n try {\r\n var exceedMaxLevel = curLevel > maxLevel;\r\n if (exceedMaxLevel) {\r\n cfg = null;\r\n }\r\n var curCfg_1 = curLevel == 0 ? objExtend({}, cfg) : cfg; // only copy cfg at the begining level\r\n if (curCfg_1 && nonOverrideConfigs && !exceedMaxLevel) {\r\n objForEachKey(curCfg_1, function (key) {\r\n var nonOverrideVal = nonOverrideConfigs[key];\r\n if (!!nonOverrideVal) {\r\n if (isObject(curCfg_1[key]) && isObject(nonOverrideVal)) {\r\n curCfg_1[key] = replaceByNonOverrideCfg(curCfg_1[key], nonOverrideVal, ++curLevel, maxLevel);\r\n }\r\n else {\r\n delete curCfg_1[key];\r\n }\r\n }\r\n });\r\n }\r\n return curCfg_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n // if errors happen, do nothing\r\n return cfg;\r\n}\r\n// CDN Mode, value = B (CDN value = B)\r\n// |--------------------------------------------------------------------------|-----------|\r\n// | | none | disabled | enabled | forceOn | forceOff |\r\n// | ------------------ | ----------- | ----------- | ----------- | --------- | --------- |\r\n// | User Mode, value = A | none | none | disabled | enabled | enabled | disabled |\r\n// (user Value = A) | disabled | disabled | disabled | disabled | enabled | disabled |\r\n// | enabled | enabled | disabled | enabled | enabled | disabled |\r\n// | none(blockCdn) | none | none | none | none | none |\r\n// | disabled(blockCdn) | disabled | disabled | disabled | disabled | disabled |\r\n// | enabled(blockCdn) | enabled | enabled | enabled | enabled | enabled |\r\n// This matrix identifies how feature based overrides are selected (if present)\r\n// cdn Mode (cdn Value = B)\r\n// |---------------------------------------------------------------------------|\r\n// | | none | disabled | enabled | forceOn | forceOff |\r\n// | ------------------ | ---------| ---------| ---------| ---------|----------|\r\n// | User Mode | none | A | A | A || B | B || A | B || A |\r\n// (user Value = A) | disabled | A | A | A | B || A | B || A |\r\n// | enabled | A | A | A || B | B || A | B || A |\r\n// | none(blockCdn) | A | A | A | A | A |\r\n// | disabled(blockCdn) | A | A | A | A | A |\r\n// | enabled(blockCdn) | A | A | A | A | A |\r\n// Note:\r\n// Where the \"value\" is an object (map) of encoded key/values which will be used to override the real configuration\r\n// A = either the user supplied enable/disable value (via the `config.featureOptIn[name]`) or if not defined by the user the SDK defaults of the same.\r\n// B = The enable/disable value obtained from the CDN for the named feature\r\n// These are evaluated based on the above matrix to either\r\n// - A (Always the user/sdk value)\r\n// - B (Always the value from the CDN)\r\n// - A || B (If A is null or undefined use the value from the CDN (B) otherwise A)\r\n// - B || A (If B is null or undefined use the user/SDK value otherwise use the value from the CDN)\r\n//\r\n// The result of the value may also be null / undefined, which means there are no overrides to apply when the feature is enabled\r\nvar F = \"featureOptIn.\";\r\nvar M = \".mode\";\r\nvar ON = \".onCfg\";\r\nvar OFF = \".offCfg\";\r\nexport function resolveCdnFeatureCfg(field, cdnCfg, userOptInDetails) {\r\n var _a;\r\n // cdn conifg value\r\n if (!cdnCfg || !cdnCfg.enabled) {\r\n return null;\r\n }\r\n var cdnFt = (cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */] || {})[field] || { mode: 1 /* CdnFeatureMode.none */ };\r\n var cdnM = cdnFt.mode;\r\n var cdnOnV = cdnFt.onCfg;\r\n var cdnOffV = cdnFt.offCfg;\r\n var userFt = (userOptInDetails || {})[field] || { mode: 2 /* FeatureOptInMode.disable */ }; // default user mode is disable\r\n var userM = userFt.mode;\r\n var userOnV = userFt.onCfg;\r\n var userOffV = userFt.offCfg;\r\n var blockCdn = !!userFt.blockCdnCfg;\r\n var mFld = F + field + M;\r\n var onFld = F + field + ON;\r\n var offFld = F + field + OFF;\r\n var mode = userM;\r\n var onV = userOnV;\r\n var offV = userOffV;\r\n if (!blockCdn) {\r\n if (cdnM === 4 /* CdnFeatureMode.forceOn */ || cdnM === 5 /* CdnFeatureMode.forceOff */) {\r\n mode = (cdnM == 4 /* CdnFeatureMode.forceOn */ ? 3 /* FeatureOptInMode.enable */ : 2 /* FeatureOptInMode.disable */);\r\n onV = cdnOnV || userOnV;\r\n offV = cdnOffV || userOffV;\r\n }\r\n else if (cdnM === 2 /* CdnFeatureMode.disable */ || userM === 2 /* FeatureOptInMode.disable */) {\r\n mode = 2 /* FeatureOptInMode.disable */;\r\n onV = userOnV || cdnOnV;\r\n offV = userOffV || cdnOffV;\r\n }\r\n else if (cdnM === 3 /* CdnFeatureMode.enable */) {\r\n mode = 3 /* FeatureOptInMode.enable */;\r\n onV = userOnV || cdnOnV;\r\n offV = userOffV || cdnOffV;\r\n }\r\n else if (cdnM === 1 /* CdnFeatureMode.none */ && userM === 1 /* FeatureOptInMode.none */) {\r\n mode = 1 /* FeatureOptInMode.none */;\r\n }\r\n }\r\n return _a = {},\r\n _a[mFld] = mode,\r\n _a[onFld] = onV,\r\n _a[offFld] = offV,\r\n _a;\r\n}\r\n// helper function to get cdn config with opt-in features\r\nexport function applyCdnfeatureCfg(cdnCfg, core) {\r\n try {\r\n if (!cdnCfg || !cdnCfg.enabled) {\r\n return null;\r\n }\r\n if (!cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */]) {\r\n return cdnCfg.config;\r\n }\r\n var optInMap = cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */];\r\n var cdnConfig_1 = cdnCfg.config || {};\r\n objForEachKey(optInMap, function (key) {\r\n var featureVal = resolveCdnFeatureCfg(key, cdnCfg, core.config[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */]);\r\n if (!isNullOrUndefined(featureVal)) {\r\n objForEachKey(featureVal, function (config, val) {\r\n setValueByKey(cdnConfig_1, config, val);\r\n });\r\n _overrideCdnCfgByFeature(key, featureVal, cdnConfig_1);\r\n }\r\n });\r\n return cdnConfig_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\nfunction _overrideCdnCfgByFeature(field, ftVal, config) {\r\n var mode = ftVal[F + field + M];\r\n var val = ftVal[F + field + ON];\r\n var dVal = ftVal[F + field + OFF];\r\n var target = null;\r\n if (mode === 3 /* FeatureOptInMode.enable */) {\r\n target = val;\r\n }\r\n if (mode === 2 /* FeatureOptInMode.disable */) {\r\n target = dVal;\r\n }\r\n if (target) {\r\n objForEachKey(target, function (key, cfg) {\r\n setValueByKey(config, key, cfg);\r\n });\r\n }\r\n}\r\n//# sourceMappingURL=CfgSyncHelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n* CfgSyncPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { DisabledPropertyName } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, createProcessTelemetryContext, createUniqueNamespace, eventOff, eventOn, getGlobal, getJSON, isFetchSupported, isXhrSupported, mergeEvtNamespace, onConfigChange, sendCustomEvent } from \"@microsoft/applicationinsights-core-js\";\r\nimport { doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { isFunction, isNullOrUndefined, isPlainObject, objDeepFreeze, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { applyCdnfeatureCfg, replaceByNonOverrideCfg } from \"./CfgSyncHelperFuncs\";\r\nimport { _DYN_SCHEDULE_FETCH_TIMEO0 } from \"./__DynamicConstants\";\r\nvar EVENT_NAME = \"ai_cfgsync\";\r\nvar STR_GET_METHOD = \"GET\";\r\nvar FETCH_TIMEOUT = 1800000; // 30 minutes\r\nvar udfVal = undefined;\r\nvar defaultNonOverrideCfg = { instrumentationKey: true, connectionString: true, endpointUrl: true };\r\nvar _defaultConfig = objDeepFreeze((_a = {\r\n syncMode: 1 /* ICfgSyncMode.Broadcast */,\r\n blkCdnCfg: udfVal,\r\n customEvtName: udfVal,\r\n cfgUrl: udfVal,\r\n overrideSyncFn: udfVal,\r\n overrideFetchFn: udfVal,\r\n onCfgChangeReceive: udfVal\r\n },\r\n _a[_DYN_SCHEDULE_FETCH_TIMEO0 /* @min:scheduleFetchTimeout */] = FETCH_TIMEOUT,\r\n _a.nonOverrideConfigs = defaultNonOverrideCfg,\r\n _a.enableAjax = false,\r\n _a));\r\nvar CfgSyncPlugin = /** @class */ (function (_super) {\r\n __extends(CfgSyncPlugin, _super);\r\n function CfgSyncPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 198;\r\n _this.identifier = \"AppInsightsCfgSyncPlugin\";\r\n var _extensionConfig;\r\n var _mainConfig; // throttle config should be wrapped in IConfiguration\r\n var _evtName;\r\n var _evtNamespace;\r\n var _cfgUrl;\r\n var _timeoutHandle;\r\n var _receiveChanges;\r\n var _broadcastChanges;\r\n var _blkCdnCfg;\r\n var _fetchTimeout;\r\n var _retryCnt;\r\n var _onCfgChangeReceive;\r\n var _nonOverrideConfigs;\r\n var _fetchFn;\r\n var _overrideFetchFn;\r\n var _overrideSyncFn;\r\n var _paused = false;\r\n var _enableAjax;\r\n dynamicProto(CfgSyncPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());\r\n _populateDefaults(config);\r\n };\r\n _self.getCfg = function () {\r\n return _mainConfig;\r\n };\r\n _self.pause = function () {\r\n _paused = true;\r\n _clearScheduledTimer();\r\n };\r\n _self.resume = function () {\r\n _paused = false;\r\n _setupTimer();\r\n };\r\n // used for V2 to manaully trigger config udpate\r\n _self.setCfg = function (config) {\r\n return _setCfg(config);\r\n };\r\n _self.sync = function (customDetails) {\r\n return _sendCfgsyncEvents(customDetails);\r\n };\r\n _self.updateEventListenerName = function (eventName) {\r\n return _updateEventListenerName(eventName);\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _eventOff();\r\n _clearScheduledTimer();\r\n _initDefaults();\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_broadcastChanges, _receiveChanges, _evtName, _blkCdnCfg, _nonOverrideConfigs];\r\n };\r\n function _initDefaults() {\r\n _mainConfig = null;\r\n _evtName = null;\r\n _evtNamespace = null;\r\n _cfgUrl = null;\r\n _receiveChanges = null;\r\n _broadcastChanges = null;\r\n _nonOverrideConfigs = null;\r\n _timeoutHandle = null;\r\n _fetchTimeout = null;\r\n _retryCnt = null;\r\n _blkCdnCfg = null;\r\n _enableAjax = false;\r\n _overrideFetchFn = null;\r\n _overrideSyncFn = null;\r\n _onCfgChangeReceive = null;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n _self._addHook(onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig);\r\n var preBlkCdn = _blkCdnCfg;\r\n _blkCdnCfg = !!_extensionConfig.blkCdnCfg;\r\n _enableAjax = !!_extensionConfig.enableAjax;\r\n // avoid initial call\r\n if (!isNullOrUndefined(preBlkCdn) && preBlkCdn !== _blkCdnCfg) {\r\n if (!_blkCdnCfg && _cfgUrl) {\r\n _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }\r\n else {\r\n _clearScheduledTimer();\r\n }\r\n }\r\n if (isNullOrUndefined(_receiveChanges)) {\r\n _receiveChanges = _extensionConfig.syncMode === 2 /* ICfgSyncMode.Receive */;\r\n }\r\n if (isNullOrUndefined(_broadcastChanges)) {\r\n _broadcastChanges = _extensionConfig.syncMode === 1 /* ICfgSyncMode.Broadcast */;\r\n }\r\n var newEvtName = _extensionConfig.customEvtName || EVENT_NAME;\r\n if (_evtName !== newEvtName) {\r\n if (_receiveChanges) {\r\n _updateEventListenerName(newEvtName);\r\n }\r\n else {\r\n _eventOff();\r\n _evtName = newEvtName;\r\n }\r\n }\r\n if (isNullOrUndefined(_cfgUrl)) {\r\n _cfgUrl = _extensionConfig.cfgUrl;\r\n }\r\n // if cfgUrl is set, we will ignore core config change\r\n if (!_cfgUrl) {\r\n _mainConfig = config;\r\n if (_broadcastChanges) {\r\n _sendCfgsyncEvents();\r\n }\r\n }\r\n }));\r\n _overrideSyncFn = _extensionConfig.overrideSyncFn;\r\n _overrideFetchFn = _extensionConfig.overrideFetchFn;\r\n _onCfgChangeReceive = _extensionConfig.onCfgChangeReceive;\r\n _nonOverrideConfigs = _extensionConfig.nonOverrideConfigs; // override values should not be changed\r\n _fetchTimeout = _extensionConfig[_DYN_SCHEDULE_FETCH_TIMEO0 /* @min:%2escheduleFetchTimeout */];\r\n _fetchFn = _getFetchFnInterface();\r\n _retryCnt = 0;\r\n // NOT support cfgURL change to avoid mutiple fetch calls\r\n if (_cfgUrl && !_blkCdnCfg) {\r\n _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }\r\n }\r\n function _setCfg(config, isAutoSync) {\r\n if (config) {\r\n _mainConfig = config;\r\n if (!!isAutoSync && !_paused) {\r\n return _sendCfgsyncEvents();\r\n }\r\n if (_receiveChanges && !_paused) {\r\n _self.core.updateCfg(config);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function _eventOff() {\r\n try {\r\n var global_1 = getGlobal();\r\n if (global_1) {\r\n eventOff(global_1, null, null, _evtNamespace);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _sendCfgsyncEvents(customDetails) {\r\n try {\r\n if (!!_overrideSyncFn && isFunction(_overrideSyncFn)) {\r\n return _overrideSyncFn(_mainConfig, customDetails);\r\n }\r\n return sendCustomEvent(_evtName, _mainConfig, customDetails);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _updateEventListenerName(name) {\r\n try {\r\n _eventOff();\r\n if (name) {\r\n _evtName = name;\r\n _addEventListener();\r\n }\r\n return true;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _getFetchFnInterface() {\r\n var _fetchFn = _overrideFetchFn;\r\n if (isNullOrUndefined(_fetchFn)) {\r\n if (isFetchSupported()) {\r\n _fetchFn = _fetchSender;\r\n }\r\n else if (isXhrSupported()) {\r\n _fetchFn = _xhrSender;\r\n }\r\n }\r\n return _fetchFn;\r\n }\r\n function _fetchSender(url, oncomplete, isAutoSync) {\r\n var global = getGlobal();\r\n var fetchFn = (global && global.fetch) || null;\r\n if (url && fetchFn && isFunction(fetchFn)) {\r\n try {\r\n var init = {\r\n method: STR_GET_METHOD\r\n };\r\n if (!_enableAjax) {\r\n init[DisabledPropertyName] = true;\r\n }\r\n var request = new Request(url, init);\r\n if (!_enableAjax) {\r\n try {\r\n // Also try and tag the request (just in case the value in init is not copied over)\r\n request[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\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 }\r\n }\r\n doAwaitResponse(fetch(request), function (result) {\r\n var response = result.value;\r\n if (!result.rejected) {\r\n if (response.ok) {\r\n doAwaitResponse(response.text(), function (res) {\r\n _doOnComplete(oncomplete, response.status, res.value, isAutoSync);\r\n });\r\n }\r\n else {\r\n _doOnComplete(oncomplete, response.status, null, isAutoSync);\r\n }\r\n }\r\n else {\r\n _doOnComplete(oncomplete, 400);\r\n }\r\n });\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n }\r\n function _xhrSender(url, oncomplete, isAutoSync) {\r\n try {\r\n var xhr_1 = new XMLHttpRequest();\r\n if (!_enableAjax) {\r\n xhr_1[DisabledPropertyName] = true;\r\n }\r\n xhr_1.open(STR_GET_METHOD, url);\r\n xhr_1.onreadystatechange = function () {\r\n if (xhr_1.readyState === XMLHttpRequest.DONE) {\r\n _doOnComplete(oncomplete, xhr_1.status, xhr_1.responseText, isAutoSync);\r\n }\r\n };\r\n xhr_1.onerror = function () {\r\n _doOnComplete(oncomplete, 400);\r\n };\r\n xhr_1.ontimeout = function () {\r\n _doOnComplete(oncomplete, 400);\r\n };\r\n xhr_1.send();\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _onFetchComplete(status, response, isAutoSync) {\r\n try {\r\n if (status >= 200 && status < 400 && response) {\r\n _retryCnt = 0; // any successful response will reset retry count to 0\r\n var JSON_1 = getJSON();\r\n if (JSON_1) {\r\n var cdnCfg = JSON_1.parse(response); //comments are not allowed\r\n var cfg = applyCdnfeatureCfg(cdnCfg, _self.core);\r\n var newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg);\r\n newCfg && _setCfg(newCfg, isAutoSync);\r\n //cfg && _setCfg(cfg, isAutoSync);\r\n }\r\n }\r\n else {\r\n _retryCnt++;\r\n }\r\n if (_retryCnt < 3) {\r\n _setupTimer();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _doOnComplete(oncomplete, status, response, isAutoSync) {\r\n try {\r\n oncomplete(status, response, isAutoSync);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _addEventListener() {\r\n if (_receiveChanges) {\r\n var global_2 = getGlobal();\r\n if (global_2) {\r\n try {\r\n eventOn(global_2, _evtName, function (event) {\r\n // TODO: add more validation here\r\n // may include a \"name\" or some other features to check\r\n var cfgEvent = event && event.detail;\r\n if (_onCfgChangeReceive && cfgEvent) {\r\n _onCfgChangeReceive(cfgEvent);\r\n }\r\n else {\r\n var cfg = cfgEvent && cfgEvent.cfg;\r\n var newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg);\r\n newCfg && _setCfg(newCfg);\r\n }\r\n }, _evtNamespace, true);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n }\r\n }\r\n // 4 levels\r\n function _replaceTartgetByKeys(cfg, level) {\r\n var _cfg = null;\r\n try {\r\n if (cfg) {\r\n _cfg = replaceByNonOverrideCfg(cfg, _nonOverrideConfigs, 0, 5);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return _cfg;\r\n }\r\n /**\r\n * Sets up the timer which triggers fetching cdn every 30mins after inital call\r\n */\r\n function _setupTimer() {\r\n if (!_timeoutHandle && _fetchTimeout) {\r\n _timeoutHandle = scheduleTimeout(function () {\r\n _timeoutHandle = null;\r\n _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }, _fetchTimeout);\r\n _timeoutHandle.unref();\r\n }\r\n }\r\n function _clearScheduledTimer() {\r\n _timeoutHandle && _timeoutHandle.cancel();\r\n _timeoutHandle = null;\r\n _retryCnt = 0;\r\n }\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for CfgSyncPlugin.prototype.initialize.\r\n// Removed Stub for CfgSyncPlugin.prototype.getCfg.\r\n// Removed Stub for CfgSyncPlugin.prototype.setCfg.\r\n// Removed Stub for CfgSyncPlugin.prototype.sync.\r\n// Removed Stub for CfgSyncPlugin.prototype.updateEventListenerName.\r\n// Removed Stub for CfgSyncPlugin.prototype.pause.\r\n// Removed Stub for CfgSyncPlugin.prototype.resume.\r\n //// Removed Stub for CfgSyncPlugin.prototype.processTelemetry.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n CfgSyncPlugin.__ieDyn=1;\n\n return CfgSyncPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { CfgSyncPlugin };\r\n//# sourceMappingURL=CfgSyncPlugin.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { arrForEach, createUniqueNamespace, eventOff, eventOn, getDocument, getNavigator, getWindow, isNullOrUndefined, isUndefined, mergeEvtNamespace } from \"@microsoft/applicationinsights-core-js\";\r\nfunction _disableEvents(target, evtNamespace) {\r\n eventOff(target, null, null, evtNamespace);\r\n}\r\n/**\r\n * Create a new OfflineListener instance to monitor browser online / offline events\r\n * @param parentEvtNamespace - The parent event namespace to append to any specific events for this instance\r\n */\r\nexport function createOfflineListener(parentEvtNamespace) {\r\n var _document = getDocument();\r\n var _navigator = getNavigator(); // Gets the window.navigator or workerNavigator depending on the global\r\n var _isListening = false;\r\n var listenerList = [];\r\n // Set the initial state\r\n // rState is changed by the browser, both via events and when we check the navigator.onLine property\r\n var rState = 1 /* eOfflineValue.Online */;\r\n if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) { // navigator.onLine is undefined in react-native\r\n rState = 2 /* eOfflineValue.Offline */;\r\n }\r\n // ustate is changed by the user calling setOnlineState\r\n var uState = 0 /* eOfflineValue.Unknown */;\r\n // current state would be updated each time rState or uState is changed\r\n // it is a resolved value of rState and uState\r\n var _currentState = calCurrentState();\r\n var _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"OfflineListener\"), parentEvtNamespace);\r\n try {\r\n if (_enableEvents(getWindow())) {\r\n _isListening = true;\r\n }\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (target.ononline) {\r\n if (_enableEvents(target)) {\r\n _isListening = true;\r\n }\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // this makes react-native less angry\r\n _isListening = false;\r\n }\r\n function _enableEvents(target) {\r\n var enabled = false;\r\n if (target) {\r\n enabled = eventOn(target, \"online\", _setOnline, _evtNamespace);\r\n if (enabled) {\r\n eventOn(target, \"offline\", _setOffline, _evtNamespace);\r\n }\r\n }\r\n return enabled;\r\n }\r\n function _isOnline() {\r\n return _currentState;\r\n }\r\n function calCurrentState() {\r\n if (uState === 2 /* eOfflineValue.Offline */ || rState === 2 /* eOfflineValue.Offline */) {\r\n return false;\r\n }\r\n return true; // if both unknown, then we assume the network is good\r\n }\r\n function listnerNoticeCheck() {\r\n // we were offline and are now online or we were online and now offline\r\n var newState = calCurrentState();\r\n if (_currentState !== newState) {\r\n _currentState = newState; // use the resolved state to update\r\n // send all the callbacks with the current state\r\n arrForEach(listenerList, function (callback) {\r\n var offlineState = {\r\n isOnline: _currentState,\r\n rState: rState,\r\n uState: uState\r\n };\r\n try {\r\n callback(offlineState);\r\n }\r\n catch (e) {\r\n // Do nothing, just making sure we run all of the callbacks\r\n }\r\n });\r\n }\r\n }\r\n function setOnlineState(newState) {\r\n uState = newState;\r\n listnerNoticeCheck();\r\n }\r\n function _setOnline() {\r\n rState = 1 /* eOfflineValue.Online */;\r\n listnerNoticeCheck();\r\n }\r\n function _setOffline() {\r\n rState = 2 /* eOfflineValue.Offline */;\r\n listnerNoticeCheck();\r\n }\r\n function _unload() {\r\n var win = getWindow();\r\n if (win && _isListening) {\r\n _disableEvents(win, _evtNamespace);\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (!isUndefined(target.ononline)) {\r\n _disableEvents(target, _evtNamespace);\r\n }\r\n }\r\n _isListening = false;\r\n }\r\n }\r\n function addListener(callback) {\r\n listenerList.push(callback);\r\n // Define rm as an instance of IUnloadHook\r\n return {\r\n rm: function () {\r\n var index = listenerList.indexOf(callback);\r\n if (index > -1) {\r\n return listenerList.splice(index, 1);\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n };\r\n }\r\n return {\r\n isOnline: _isOnline,\r\n isListening: function () { return _isListening; },\r\n unload: _unload,\r\n addListener: addListener,\r\n setOnlineState: setOnlineState\r\n };\r\n}\r\n//# sourceMappingURL=Offline.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { createEnumStyle } from \"./EnumHelperFuncs\";\r\nexport var ActiveStatus = createEnumStyle({\r\n NONE: 0 /* eActiveStatus.NONE */,\r\n PENDING: 3 /* eActiveStatus.PENDING */,\r\n INACTIVE: 1 /* eActiveStatus.INACTIVE */,\r\n ACTIVE: 2 /* eActiveStatus.ACTIVE */\r\n});\r\n//# sourceMappingURL=InitActiveStatusEnum.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nexport var ChannelControllerPriority = 500;\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\n// export const SampleRate = \"sampleRate\";\r\n// export const ProcessLegacy = \"ProcessLegacy\";\r\n// export const HttpMethod = \"http.method\";\r\n// export const DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\r\n// export const DEFAULT_BREEZE_PATH = \"/v2/track\";\r\n// export const strNotSpecified = \"not_specified\";\r\n// export const strIkey = \"iKey\";\r\n//# sourceMappingURL=Constants.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, dumpObj, getNavigator, getWindow, isFunction, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DATA, _DYN_HEADERS, _DYN_INITIALIZE, _DYN_LENGTH, _DYN_MESSAGE, _DYN_REPLACE, _DYN_STATUS, _DYN_TIMEOUT, _DYN_TO_LOWER_CASE, _DYN_URL_STRING, _DYN_VALUE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { DisabledPropertyName } from \"./Constants\";\r\nimport { _throwInternal, _warnToConsole } from \"./DiagnosticLogger\";\r\nimport { getLocation, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest } from \"./EnvUtils\";\r\nimport { _getAllResponseHeaders, formatErrorMessageXdr, formatErrorMessageXhr, getResponseText, openXhr } from \"./HelperFuncs\";\r\nvar STR_EMPTY = \"\";\r\nvar STR_NO_RESPONSE_BODY = \"NoResponseBody\";\r\nvar _noResponseQs = \"&\" + STR_NO_RESPONSE_BODY + \"=true\";\r\nvar STR_POST_METHOD = \"POST\";\r\n/**\r\n * This Internal component\r\n * Manager SendPost functions\r\n * SendPostManger\r\n * @internal for internal use only\r\n */\r\nvar SenderPostManager = /** @class */ (function () {\r\n function SenderPostManager() {\r\n var _syncFetchPayload = 0; // Keep track of the outstanding sync fetch payload total (as sync fetch has limits)\r\n var _enableSendPromise;\r\n var _isInitialized;\r\n var _diagLog;\r\n var _isOneDs;\r\n var _onCompleteFuncs;\r\n var _disableCredentials;\r\n var _fetchCredentials;\r\n var _fallbackInst;\r\n var _disableXhr;\r\n var _disableBeacon;\r\n var _disableBeaconSync;\r\n var _disableFetchKeepAlive;\r\n var _addNoResponse;\r\n var _timeoutWrapper;\r\n dynamicProto(SenderPostManager, this, function (_self, _base) {\r\n var _sendCredentials = true; // for 1ds\r\n _initDefaults();\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, diagLog) {\r\n _diagLog = diagLog;\r\n if (_isInitialized) {\r\n _throwInternal(_diagLog, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender is already initialized\");\r\n }\r\n _self.SetConfig(config);\r\n _isInitialized = true;\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_isInitialized, _isOneDs, _disableCredentials, _enableSendPromise];\r\n };\r\n // This componet might get its config from sender, offline sender, 1ds post\r\n // so set this function to mock dynamic changes\r\n _self.SetConfig = function (config) {\r\n try {\r\n _onCompleteFuncs = config.senderOnCompleteCallBack || {};\r\n _disableCredentials = !!config.disableCredentials;\r\n _fetchCredentials = config.fetchCredentials;\r\n _isOneDs = !!config.isOneDs;\r\n _enableSendPromise = !!config.enableSendPromise;\r\n _disableXhr = !!config.disableXhr;\r\n _disableBeacon = !!config.disableBeacon;\r\n _disableBeaconSync = !!config.disableBeaconSync;\r\n _timeoutWrapper = config.timeWrapper;\r\n _addNoResponse = !!config.addNoResponse;\r\n _disableFetchKeepAlive = !!config.disableFetchKeepAlive;\r\n _fallbackInst = { sendPOST: _xhrSender };\r\n if (!_isOneDs) {\r\n _sendCredentials = false; // for appInsights, set it to false always\r\n }\r\n if (_disableCredentials) {\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol && location_1.protocol[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === \"file:\") {\r\n // Special case where a local html file fails with a CORS error on Chromium browsers\r\n _sendCredentials = false;\r\n }\r\n }\r\n return true;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n _self.getSyncFetchPayload = function () {\r\n return _syncFetchPayload;\r\n };\r\n _self.getSenderInst = function (transports, sync) {\r\n if (transports && transports[_DYN_LENGTH /* @min:%2elength */]) {\r\n return _getSenderInterface(transports, sync);\r\n }\r\n return null;\r\n };\r\n _self.getFallbackInst = function () {\r\n return _fallbackInst;\r\n };\r\n _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] = function (unloadCtx, unloadState) {\r\n _initDefaults();\r\n };\r\n /**\r\n * success handler\r\n */\r\n function _onSuccess(res, onComplete) {\r\n _doOnComplete(onComplete, 200, {}, res);\r\n }\r\n /**\r\n * error handler\r\n */\r\n function _onError(message, onComplete) {\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 26 /* _eInternalMessageId.OnError */, \"Failed to send telemetry.\", { message: message });\r\n _doOnComplete(onComplete, 400, {});\r\n }\r\n function _onNoPayloadUrl(onComplete) {\r\n _onError(\"No endpoint url is provided for the batch\", onComplete);\r\n }\r\n function _getSenderInterface(transports, syncSupport) {\r\n var transportType = 0 /* TransportType.NotSet */;\r\n var sendPostFunc = null;\r\n var lp = 0;\r\n while (sendPostFunc == null && lp < transports[_DYN_LENGTH /* @min:%2elength */]) {\r\n transportType = transports[lp];\r\n if (!_disableXhr && transportType === 1 /* TransportType.Xhr */) {\r\n if (useXDomainRequest()) {\r\n // IE 8 and 9\r\n sendPostFunc = _xdrSender;\r\n }\r\n else if (isXhrSupported()) {\r\n sendPostFunc = _xhrSender;\r\n }\r\n }\r\n else if (transportType === 2 /* TransportType.Fetch */ && isFetchSupported(syncSupport) && (!syncSupport || !_disableFetchKeepAlive)) {\r\n sendPostFunc = _doFetchSender;\r\n }\r\n else if (transportType === 3 /* TransportType.Beacon */ && isBeaconsSupported() && (syncSupport ? !_disableBeaconSync : !_disableBeacon)) {\r\n sendPostFunc = _beaconSender;\r\n }\r\n lp++;\r\n }\r\n if (sendPostFunc) {\r\n return {\r\n _transport: transportType,\r\n _isSync: syncSupport,\r\n sendPOST: sendPostFunc\r\n };\r\n }\r\n return null;\r\n }\r\n function _doOnComplete(oncomplete, status, headers, response) {\r\n try {\r\n oncomplete && oncomplete(status, headers, response);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _doBeaconSend(payload, oncomplete) {\r\n var nav = getNavigator();\r\n var url = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!url) {\r\n _onNoPayloadUrl(oncomplete);\r\n // return true here, because we don't want to retry it with fallback sender\r\n return true;\r\n }\r\n url = payload[_DYN_URL_STRING /* @min:%2eurlString */] + (_addNoResponse ? _noResponseQs : STR_EMPTY);\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n var plainTextBatch = _isOneDs ? data : new Blob([data], { type: \"text/plain;charset=UTF-8\" });\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n var queued = nav.sendBeacon(url, plainTextBatch);\r\n return queued;\r\n }\r\n /**\r\n * Send Beacon API request\r\n * @param payload - The data payload to be sent.\r\n * @param sync - not used\r\n * Note: Beacon API does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n function _beaconSender(payload, oncomplete, sync) {\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n try {\r\n if (data) {\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n if (!_doBeaconSend(payload, oncomplete)) {\r\n var onRetry = _onCompleteFuncs && _onCompleteFuncs.beaconOnRetry;\r\n if (onRetry && isFunction(onRetry)) {\r\n onRetry(payload, oncomplete, _doBeaconSend);\r\n }\r\n else {\r\n _fallbackInst && _fallbackInst.sendPOST(payload, oncomplete, true);\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n else {\r\n // if can send\r\n _onSuccess(STR_EMPTY, oncomplete);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _isOneDs && _warnToConsole(_diagLog, \"Failed to send telemetry using sendBeacon API. Ex:\" + dumpObj(e));\r\n _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, STR_EMPTY);\r\n }\r\n return;\r\n }\r\n /**\r\n * Send XMLHttpRequest\r\n * @param payload - The data payload to be sent.\r\n * @param sync - Indicates if the request should be sent synchronously\r\n */\r\n function _xhrSender(payload, oncomplete, sync) {\r\n //let internalPayload = payload as IInternalPayloadData;\r\n var thePromise;\r\n var resolveFunc;\r\n var rejectFunc;\r\n var headers = payload[_DYN_HEADERS /* @min:%2eheaders */] || {};\r\n if (!sync && _enableSendPromise) {\r\n thePromise = createPromise(function (resolve, reject) {\r\n resolveFunc = resolve;\r\n rejectFunc = reject;\r\n });\r\n }\r\n if (_isOneDs && sync && payload.disableXhrSync) {\r\n sync = false;\r\n }\r\n //const xhr = new XMLHttpRequest();\r\n var endPointUrl = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!endPointUrl) {\r\n _onNoPayloadUrl(oncomplete);\r\n resolveFunc && resolveFunc(false);\r\n return;\r\n }\r\n var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT /* @min:%2etimeout */]);\r\n if (!_isOneDs) {\r\n // application/json should NOT add to 1ds post by default\r\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\r\n }\r\n arrForEach(objKeys(headers), function (headerName) {\r\n xhr.setRequestHeader(headerName, headers[headerName]);\r\n });\r\n xhr.onreadystatechange = function () {\r\n if (!_isOneDs) {\r\n _doOnReadyFunc(xhr);\r\n if (xhr.readyState === 4) {\r\n resolveFunc && resolveFunc(true);\r\n }\r\n }\r\n };\r\n xhr.onload = function () {\r\n if (_isOneDs) {\r\n _doOnReadyFunc(xhr);\r\n }\r\n };\r\n function _doOnReadyFunc(xhr) {\r\n var onReadyFunc = _onCompleteFuncs && _onCompleteFuncs.xhrOnComplete;\r\n var onReadyFuncExist = onReadyFunc && isFunction(onReadyFunc);\r\n if (onReadyFuncExist) {\r\n onReadyFunc(xhr, oncomplete, payload);\r\n }\r\n else {\r\n var response = getResponseText(xhr);\r\n _doOnComplete(oncomplete, xhr[_DYN_STATUS /* @min:%2estatus */], _getAllResponseHeaders(xhr, _isOneDs), response);\r\n }\r\n }\r\n xhr.onerror = function (event) {\r\n _doOnComplete(oncomplete, _isOneDs ? xhr[_DYN_STATUS /* @min:%2estatus */] : 400, _getAllResponseHeaders(xhr, _isOneDs), _isOneDs ? STR_EMPTY : formatErrorMessageXhr(xhr));\r\n rejectFunc && rejectFunc(event);\r\n };\r\n xhr.ontimeout = function () {\r\n _doOnComplete(oncomplete, _isOneDs ? xhr[_DYN_STATUS /* @min:%2estatus */] : 500, _getAllResponseHeaders(xhr, _isOneDs), _isOneDs ? STR_EMPTY : formatErrorMessageXhr(xhr));\r\n resolveFunc && resolveFunc(false);\r\n };\r\n xhr.send(payload[_DYN_DATA /* @min:%2edata */]);\r\n return thePromise;\r\n }\r\n /**\r\n * Send fetch API request\r\n * @param payload - The data payload to be sent.\r\n * @param sync - For fetch this identifies whether we are \"unloading\" (false) or a normal request\r\n */\r\n function _doFetchSender(payload, oncomplete, sync) {\r\n var _a;\r\n var endPointUrl = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n var batch = payload[_DYN_DATA /* @min:%2edata */];\r\n var plainTextBatch = _isOneDs ? batch : new Blob([batch], { type: \"application/json\" });\r\n var thePromise;\r\n var resolveFunc;\r\n var rejectFunc;\r\n var requestHeaders = new Headers();\r\n var batchLength = batch[_DYN_LENGTH /* @min:%2elength */];\r\n var ignoreResponse = false;\r\n var responseHandled = false;\r\n var headers = payload[_DYN_HEADERS /* @min:%2eheaders */] || {};\r\n //TODO: handle time out for 1ds\r\n var init = (_a = {\r\n method: STR_POST_METHOD,\r\n body: plainTextBatch\r\n },\r\n _a[DisabledPropertyName] = true // Mark so we don't attempt to track this request\r\n ,\r\n _a);\r\n // Only add headers if there are headers to add, due to issue with some polyfills\r\n if (payload.headers && objKeys(payload.headers)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(objKeys(headers), function (headerName) {\r\n requestHeaders.append(headerName, headers[headerName]);\r\n });\r\n init[_DYN_HEADERS /* @min:%2eheaders */] = requestHeaders;\r\n }\r\n if (_fetchCredentials) { // if user passed in this value via post channel (1ds), then use it\r\n init.credentials = _fetchCredentials;\r\n }\r\n else if (_sendCredentials && _isOneDs) {\r\n // for 1ds, Don't send credentials when URL is file://\r\n init.credentials = \"include\";\r\n }\r\n if (sync) {\r\n init.keepalive = true;\r\n _syncFetchPayload += batchLength;\r\n if (_isOneDs) {\r\n if (payload[\"_sendReason\"] === 2 /* SendRequestReason.Unload */) {\r\n // As a sync request (during unload), it is unlikely that we will get a chance to process the response so\r\n // just like beacon send assume that the events have been accepted and processed\r\n ignoreResponse = true;\r\n if (_addNoResponse) {\r\n endPointUrl += _noResponseQs;\r\n }\r\n }\r\n }\r\n else {\r\n // for appinsights, set to true for all sync request\r\n ignoreResponse = true;\r\n }\r\n }\r\n var request = new Request(endPointUrl, init);\r\n try {\r\n // Also try and tag the request (just in case the value in init is not copied over)\r\n request[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\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 }\r\n if (!sync && _enableSendPromise) {\r\n thePromise = createPromise(function (resolve, reject) {\r\n resolveFunc = resolve;\r\n rejectFunc = reject;\r\n });\r\n }\r\n if (!endPointUrl) {\r\n _onNoPayloadUrl(oncomplete);\r\n resolveFunc && resolveFunc(false);\r\n return;\r\n }\r\n function _handleError(res) {\r\n // In case there is an error in the request. Set the status to 0 for 1ds and 400 for appInsights\r\n // so that the events can be retried later.\r\n _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY : res);\r\n }\r\n function _onFetchComplete(response, payload, value) {\r\n var status = response[_DYN_STATUS /* @min:%2estatus */];\r\n var onCompleteFunc = _onCompleteFuncs.fetchOnComplete;\r\n if (onCompleteFunc && isFunction(onCompleteFunc)) {\r\n onCompleteFunc(response, oncomplete, value || STR_EMPTY, payload);\r\n }\r\n else {\r\n _doOnComplete(oncomplete, status, {}, value || STR_EMPTY);\r\n }\r\n }\r\n try {\r\n doAwaitResponse(fetch(_isOneDs ? endPointUrl : request, _isOneDs ? init : null), function (result) {\r\n if (sync) {\r\n _syncFetchPayload -= batchLength;\r\n batchLength = 0;\r\n }\r\n if (!responseHandled) {\r\n responseHandled = true;\r\n if (!result.rejected) {\r\n var response_1 = result[_DYN_VALUE /* @min:%2evalue */];\r\n try {\r\n /**\r\n * The Promise returned from fetch() won’t reject on HTTP error status even if the response is an HTTP 404 or 500.\r\n * Instead, it will resolve normally (with ok status set to false), and it will only reject on network failure\r\n * or if anything prevented the request from completing.\r\n */\r\n if (!_isOneDs && !response_1.ok) {\r\n // this is for appInsights only\r\n _handleError(response_1.statusText);\r\n resolveFunc && resolveFunc(false);\r\n }\r\n else {\r\n if (_isOneDs && !response_1.body) {\r\n _onFetchComplete(response_1, null, STR_EMPTY);\r\n resolveFunc && resolveFunc(true);\r\n }\r\n else {\r\n doAwaitResponse(response_1.text(), function (resp) {\r\n _onFetchComplete(response_1, payload, resp[_DYN_VALUE /* @min:%2evalue */]);\r\n resolveFunc && resolveFunc(true);\r\n });\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _handleError(dumpObj(e));\r\n rejectFunc && rejectFunc(e);\r\n }\r\n }\r\n else {\r\n _handleError(result.reason && result.reason[_DYN_MESSAGE /* @min:%2emessage */]);\r\n rejectFunc && rejectFunc(result.reason);\r\n }\r\n }\r\n });\r\n }\r\n catch (e) {\r\n if (!responseHandled) {\r\n _handleError(dumpObj(e));\r\n rejectFunc && rejectFunc(e);\r\n }\r\n }\r\n if (ignoreResponse && !responseHandled) {\r\n // Assume success during unload processing as we most likely won't get the response\r\n responseHandled = true;\r\n _doOnComplete(oncomplete, 200, {});\r\n resolveFunc && resolveFunc(true);\r\n }\r\n if (_isOneDs && !responseHandled && payload[_DYN_TIMEOUT /* @min:%2etimeout */] > 0) {\r\n // Simulate timeout\r\n _timeoutWrapper && _timeoutWrapper.set(function () {\r\n if (!responseHandled) {\r\n // Assume a 500 response (which will cause a retry)\r\n responseHandled = true;\r\n _doOnComplete(oncomplete, 500, {});\r\n resolveFunc && resolveFunc(true);\r\n }\r\n }, payload[_DYN_TIMEOUT /* @min:%2etimeout */]);\r\n }\r\n return thePromise;\r\n }\r\n /**\r\n * Send XDomainRequest\r\n * @param payload - The data payload to be sent.\r\n * @param sync - Indicates if the request should be sent synchronously\r\n *\r\n * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added\r\n * to maintain consistency with the xhrSender's contract\r\n * Note: XDomainRequest does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n function _xdrSender(payload, oncomplete, sync) {\r\n // It doesn't support custom headers, so no action is taken with current requestHeaders\r\n var _window = getWindow();\r\n var xdr = new XDomainRequest();\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n xdr.onload = function () {\r\n var response = getResponseText(xdr);\r\n var onloadFunc = _onCompleteFuncs && _onCompleteFuncs.xdrOnComplete;\r\n if (onloadFunc && isFunction(onloadFunc)) {\r\n onloadFunc(xdr, oncomplete, payload);\r\n }\r\n else {\r\n _doOnComplete(oncomplete, 200, {}, response);\r\n }\r\n };\r\n xdr.onerror = function () {\r\n _doOnComplete(oncomplete, 400, {}, _isOneDs ? STR_EMPTY : formatErrorMessageXdr(xdr));\r\n };\r\n xdr.ontimeout = function () {\r\n _doOnComplete(oncomplete, 500, {});\r\n };\r\n xdr.onprogress = function () { };\r\n // XDomainRequest requires the same protocol as the hosting page.\r\n // If the protocol doesn't match, we can't send the telemetry :(.\r\n var hostingProtocol = _window && _window.location && _window.location.protocol || \"\";\r\n var endpoint = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!endpoint) {\r\n _onNoPayloadUrl(oncomplete);\r\n return;\r\n }\r\n if (!_isOneDs && endpoint.lastIndexOf(hostingProtocol, 0) !== 0) {\r\n var msg = \"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.\";\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + msg);\r\n _onError(msg, oncomplete);\r\n return;\r\n }\r\n var endpointUrl = _isOneDs ? endpoint : endpoint[_DYN_REPLACE /* @min:%2ereplace */](/^(https?:)/, \"\");\r\n xdr.open(STR_POST_METHOD, endpointUrl);\r\n if (payload[_DYN_TIMEOUT /* @min:%2etimeout */]) {\r\n xdr[_DYN_TIMEOUT /* @min:%2etimeout */] = payload[_DYN_TIMEOUT /* @min:%2etimeout */];\r\n }\r\n xdr.send(data);\r\n if (_isOneDs && sync) {\r\n _timeoutWrapper && _timeoutWrapper.set(function () {\r\n xdr.send(data);\r\n }, 0);\r\n }\r\n else {\r\n xdr.send(data);\r\n }\r\n }\r\n function _initDefaults() {\r\n _syncFetchPayload = 0;\r\n _isInitialized = false;\r\n _enableSendPromise = false;\r\n _diagLog = null;\r\n _isOneDs = null;\r\n _onCompleteFuncs = null;\r\n _disableCredentials = null;\r\n _fetchCredentials = null;\r\n _fallbackInst = null;\r\n _disableXhr = false;\r\n _disableBeacon = false;\r\n _disableBeaconSync = false;\r\n _disableFetchKeepAlive = false;\r\n _addNoResponse = false;\r\n _timeoutWrapper = null;\r\n }\r\n });\r\n }\r\n// Removed Stub for SenderPostManager.prototype.initialize.\r\n// Removed Stub for SenderPostManager.prototype.getSyncFetchPayload.\r\n// Removed Stub for SenderPostManager.prototype.SetConfig.\r\n// Removed Stub for SenderPostManager.prototype.getSenderInst.\r\n// Removed Stub for SenderPostManager.prototype.getFallbackInst.\r\n// Removed Stub for SenderPostManager.prototype._doTeardown.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n SenderPostManager.__ieDyn=1;\n\n return SenderPostManager;\r\n}());\r\nexport { SenderPostManager };\r\n//# sourceMappingURL=SenderPostManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrSlice, getLength } from \"@nevware21/ts-utils\";\r\nimport { _DYN_UNLOAD } from \"../__DynamicConstants\";\r\n/**\r\n * Run the unload function of the target object if it exists\r\n * @param target - The target object that contains the unload function\r\n * @param isAsync - The caller identifies whether it is expecting the operation to complete synchronously or asynchronously. Even\r\n * if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is\r\n * also true.\r\n * @returns The result of the target function\r\n */\r\nexport function runTargetUnload(target, isAsync) {\r\n if (target && target[_DYN_UNLOAD /* @min:%2eunload */]) {\r\n return target[_DYN_UNLOAD /* @min:%2eunload */](isAsync);\r\n }\r\n}\r\n/**\r\n * Call the unload function on all targets handling any returned [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * / Promise before calling the next targets unload\r\n * @param targets - An array of the targets to unload\r\n * @param isAsync - The caller identifies whether it is expecting the operations to complete synchronously or asynchronously. Even\r\n * if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is\r\n * also true.\r\n * @param done - Optional callback function to call once all of the unload functions have been called.\r\n */\r\nexport function doUnloadAll(targets, isAsync, done) {\r\n var result;\r\n if (!done) {\r\n result = createPromise(function (resolved) {\r\n done = resolved;\r\n });\r\n }\r\n if (targets && getLength(targets) > 0) {\r\n doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {\r\n doUnloadAll(arrSlice(targets, 1), isAsync, done);\r\n });\r\n }\r\n else {\r\n done();\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=AsyncUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ITEMS_RECEIVED, _DYN_LENGTH, _DYN_NAME } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getJSON } from \"./EnvUtils\";\r\n/**\r\n * Parses the response from the backend.\r\n * @param response - XMLHttpRequest or XDomainRequest response\r\n */\r\nexport function parseResponse(response, diagLog) {\r\n try {\r\n if (response && response !== \"\") {\r\n var result = getJSON().parse(response);\r\n if (result && result[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] && result[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] >= result.itemsAccepted &&\r\n result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH /* @min:%2elength */]) {\r\n return result;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(diagLog, 1 /* eLoggingSeverity.CRITICAL */, 43 /* _eInternalMessageId.InvalidBackendResponse */, \"Cannot parse the response. \" + (e[_DYN_NAME /* @min:%2ename */] || dumpObj(e)), {\r\n response: response\r\n });\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=ResponseHelpers.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport { createClassFromInterface } from \"@microsoft/applicationinsights-core-js\";\r\nfunction _aiNameFunc(baseName) {\r\n var aiName = \"ai.\" + baseName + \".\";\r\n return function (name) {\r\n return aiName + name;\r\n };\r\n}\r\nvar _aiApplication = _aiNameFunc(\"application\");\r\nvar _aiDevice = _aiNameFunc(\"device\");\r\nvar _aiLocation = _aiNameFunc(\"location\");\r\nvar _aiOperation = _aiNameFunc(\"operation\");\r\nvar _aiSession = _aiNameFunc(\"session\");\r\nvar _aiUser = _aiNameFunc(\"user\");\r\nvar _aiCloud = _aiNameFunc(\"cloud\");\r\nvar _aiInternal = _aiNameFunc(\"internal\");\r\nvar ContextTagKeys = /** @class */ (function (_super) {\r\n __extends(ContextTagKeys, _super);\r\n function ContextTagKeys() {\r\n return _super.call(this) || this;\r\n }\r\n return ContextTagKeys;\r\n}(createClassFromInterface({\r\n applicationVersion: _aiApplication(\"ver\"),\r\n applicationBuild: _aiApplication(\"build\"),\r\n applicationTypeId: _aiApplication(\"typeId\"),\r\n applicationId: _aiApplication(\"applicationId\"),\r\n applicationLayer: _aiApplication(\"layer\"),\r\n deviceId: _aiDevice(\"id\"),\r\n deviceIp: _aiDevice(\"ip\"),\r\n deviceLanguage: _aiDevice(\"language\"),\r\n deviceLocale: _aiDevice(\"locale\"),\r\n deviceModel: _aiDevice(\"model\"),\r\n deviceFriendlyName: _aiDevice(\"friendlyName\"),\r\n deviceNetwork: _aiDevice(\"network\"),\r\n deviceNetworkName: _aiDevice(\"networkName\"),\r\n deviceOEMName: _aiDevice(\"oemName\"),\r\n deviceOS: _aiDevice(\"os\"),\r\n deviceOSVersion: _aiDevice(\"osVersion\"),\r\n deviceRoleInstance: _aiDevice(\"roleInstance\"),\r\n deviceRoleName: _aiDevice(\"roleName\"),\r\n deviceScreenResolution: _aiDevice(\"screenResolution\"),\r\n deviceType: _aiDevice(\"type\"),\r\n deviceMachineName: _aiDevice(\"machineName\"),\r\n deviceVMName: _aiDevice(\"vmName\"),\r\n deviceBrowser: _aiDevice(\"browser\"),\r\n deviceBrowserVersion: _aiDevice(\"browserVersion\"),\r\n locationIp: _aiLocation(\"ip\"),\r\n locationCountry: _aiLocation(\"country\"),\r\n locationProvince: _aiLocation(\"province\"),\r\n locationCity: _aiLocation(\"city\"),\r\n operationId: _aiOperation(\"id\"),\r\n operationName: _aiOperation(\"name\"),\r\n operationParentId: _aiOperation(\"parentId\"),\r\n operationRootId: _aiOperation(\"rootId\"),\r\n operationSyntheticSource: _aiOperation(\"syntheticSource\"),\r\n operationCorrelationVector: _aiOperation(\"correlationVector\"),\r\n sessionId: _aiSession(\"id\"),\r\n sessionIsFirst: _aiSession(\"isFirst\"),\r\n sessionIsNew: _aiSession(\"isNew\"),\r\n userAccountAcquisitionDate: _aiUser(\"accountAcquisitionDate\"),\r\n userAccountId: _aiUser(\"accountId\"),\r\n userAgent: _aiUser(\"userAgent\"),\r\n userId: _aiUser(\"id\"),\r\n userStoreRegion: _aiUser(\"storeRegion\"),\r\n userAuthUserId: _aiUser(\"authUserId\"),\r\n userAnonymousUserAcquisitionDate: _aiUser(\"anonUserAcquisitionDate\"),\r\n userAuthenticatedUserAcquisitionDate: _aiUser(\"authUserAcquisitionDate\"),\r\n cloudName: _aiCloud(\"name\"),\r\n cloudRole: _aiCloud(\"role\"),\r\n cloudRoleVer: _aiCloud(\"roleVer\"),\r\n cloudRoleInstance: _aiCloud(\"roleInstance\"),\r\n cloudEnvironment: _aiCloud(\"environment\"),\r\n cloudLocation: _aiCloud(\"location\"),\r\n cloudDeploymentUnit: _aiCloud(\"deploymentUnit\"),\r\n internalNodeName: _aiInternal(\"nodeName\"),\r\n internalSdkVersion: _aiInternal(\"sdkVersion\"),\r\n internalAgentVersion: _aiInternal(\"agentVersion\"),\r\n internalSnippet: _aiInternal(\"snippet\"),\r\n internalSdkSrc: _aiInternal(\"sdkSrc\")\r\n})));\r\nexport { ContextTagKeys };\r\n//# sourceMappingURL=ContextTagKeys.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { ContextTagKeys } from \"./Contracts/ContextTagKeys\";\r\nexport var Extensions = {\r\n UserExt: \"user\",\r\n DeviceExt: \"device\",\r\n TraceExt: \"trace\",\r\n WebExt: \"web\",\r\n AppExt: \"app\",\r\n OSExt: \"os\",\r\n SessionExt: \"ses\",\r\n SDKExt: \"sdk\"\r\n};\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../../Constants\";\r\nimport { _DYN_AI_DATA_CONTRACT, _DYN_NAME } from \"../../__DynamicConstants\";\r\nimport { dataSanitizeString } from \"./DataSanitizer\";\r\nvar Envelope = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = this;\r\n var _self = this;\r\n _self.ver = 1;\r\n _self.sampleRate = 100.0;\r\n _self.tags = {};\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self.data = data;\r\n _self.time = toISOString(new Date());\r\n _self[_DYN_AI_DATA_CONTRACT /* @min:%2eaiDataContract */] = {\r\n time: 1 /* FieldType.Required */,\r\n iKey: 1 /* FieldType.Required */,\r\n name: 1 /* FieldType.Required */,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? 4 /* FieldType.Hidden */ : 1 /* FieldType.Required */;\r\n },\r\n tags: 1 /* FieldType.Required */,\r\n data: 1 /* FieldType.Required */\r\n };\r\n }\r\n return Envelope;\r\n}());\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar Data = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n baseType: 1 /* FieldType.Required */,\r\n baseData: 1 /* FieldType.Required */\r\n };\r\n this.baseType = baseType;\r\n this.baseData = data;\r\n }\r\n return Data;\r\n}());\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\n// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)\r\n// as when using \"short\" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.\r\nexport var STR_DURATION = \"duration\";\r\n//# sourceMappingURL=InternalConstants.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TAGS = \"tags\"; // Count: 17\r\nexport var _DYN_DEVICE_TYPE = \"deviceType\"; // Count: 3\r\nexport var _DYN_DATA = \"data\"; // Count: 13\r\nexport var _DYN_NAME = \"name\"; // Count: 8\r\nexport var _DYN_TRACE_ID = \"traceID\"; // Count: 5\r\nexport var _DYN_LENGTH = \"length\"; // Count: 38\r\nexport var _DYN_STRINGIFY = \"stringify\"; // Count: 5\r\nexport var _DYN_MEASUREMENTS = \"measurements\"; // Count: 7\r\nexport var _DYN_DATA_TYPE = \"dataType\"; // Count: 10\r\nexport var _DYN_ENVELOPE_TYPE = \"envelopeType\"; // Count: 7\r\nexport var _DYN_TO_STRING = \"toString\"; // Count: 7\r\nexport var _DYN_ENQUEUE = \"enqueue\"; // Count: 7\r\nexport var _DYN_COUNT = \"count\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 9\r\nexport var _DYN_EMIT_LINE_DELIMITED_0 = \"emitLineDelimitedJson\"; // Count: 3\r\nexport var _DYN_CLEAR = \"clear\"; // Count: 6\r\nexport var _DYN_MARK_AS_SENT = \"markAsSent\"; // Count: 4\r\nexport var _DYN_CLEAR_SENT = \"clearSent\"; // Count: 5\r\nexport var _DYN_BUFFER_OVERRIDE = \"bufferOverride\"; // Count: 3\r\nexport var _DYN__BUFFER__KEY = \"BUFFER_KEY\"; // Count: 5\r\nexport var _DYN__SENT__BUFFER__KEY = \"SENT_BUFFER_KEY\"; // Count: 8\r\nexport var _DYN_CONCAT = \"concat\"; // Count: 6\r\nexport var _DYN__MAX__BUFFER__SIZE = \"MAX_BUFFER_SIZE\"; // Count: 5\r\nexport var _DYN_TRIGGER_SEND = \"triggerSend\"; // Count: 5\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 16\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 3\r\nexport var _DYN__SENDER = \"_sender\"; // Count: 5\r\nexport var _DYN_ENDPOINT_URL = \"endpointUrl\"; // Count: 5\r\nexport var _DYN_INSTRUMENTATION_KEY = \"instrumentationKey\"; // Count: 5\r\nexport var _DYN_CUSTOM_HEADERS = \"customHeaders\"; // Count: 3\r\nexport var _DYN_MAX_BATCH_SIZE_IN_BY1 = \"maxBatchSizeInBytes\"; // Count: 2\r\nexport var _DYN_ONUNLOAD_DISABLE_BEA2 = \"onunloadDisableBeacon\"; // Count: 3\r\nexport var _DYN_IS_BEACON_API_DISABL3 = \"isBeaconApiDisabled\"; // Count: 3\r\nexport var _DYN_ALWAYS_USE_XHR_OVERR4 = \"alwaysUseXhrOverride\"; // Count: 2\r\nexport var _DYN_ENABLE_SESSION_STORA5 = \"enableSessionStorageBuffer\"; // Count: 2\r\nexport var _DYN__BUFFER = \"_buffer\"; // Count: 9\r\nexport var _DYN_ONUNLOAD_DISABLE_FET6 = \"onunloadDisableFetch\"; // Count: 2\r\nexport var _DYN_DISABLE_SEND_BEACON_7 = \"disableSendBeaconSplit\"; // Count: 2\r\nexport var _DYN_GET_SENDER_INST = \"getSenderInst\"; // Count: 4\r\nexport var _DYN__ON_ERROR = \"_onError\"; // Count: 7\r\nexport var _DYN__ON_PARTIAL_SUCCESS = \"_onPartialSuccess\"; // Count: 3\r\nexport var _DYN__ON_SUCCESS = \"_onSuccess\"; // Count: 6\r\nexport var _DYN_ITEMS_RECEIVED = \"itemsReceived\"; // Count: 3\r\nexport var _DYN_ITEMS_ACCEPTED = \"itemsAccepted\"; // Count: 3\r\nexport var _DYN_BASE_TYPE = \"baseType\"; // Count: 4\r\nexport var _DYN_SAMPLE_RATE = \"sampleRate\"; // Count: 4\r\nexport var _DYN_GET_HASH_CODE_SCORE = \"getHashCodeScore\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { __assignFn as __assign } from \"@microsoft/applicationinsights-shims\";\r\nimport { CtxTagKeys, Data, Envelope, Event, Exception, HttpMethod, Metric, PageView, PageViewPerformance, RemoteDependencyData, SampleRate, Trace, dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, _warnToConsole, getJSON, hasJSON, isNullOrUndefined, isNumber, isString, isTruthy, objForEachKey, optimizeObject, setValue, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { STR_DURATION } from \"./InternalConstants\";\r\nimport { _DYN_DATA, _DYN_DATA_TYPE, _DYN_DEVICE_TYPE, _DYN_ENVELOPE_TYPE, _DYN_LENGTH, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_STRINGIFY, _DYN_TAGS, _DYN_TO_STRING, _DYN_TRACE_ID } from \"./__DynamicConstants\";\r\n// these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload\r\nvar strBaseType = \"baseType\";\r\nvar strBaseData = \"baseData\";\r\nvar strProperties = \"properties\";\r\nvar strTrue = \"true\";\r\nfunction _setValueIf(target, field, value) {\r\n return setValue(target, field, value, isTruthy);\r\n}\r\n/*\r\n * Maps Part A data from CS 4.0\r\n */\r\nfunction _extractPartAExtensions(logger, item, env) {\r\n // todo: switch to keys from common in this method\r\n var envTags = env[_DYN_TAGS /* @min:%2etags */] = env[_DYN_TAGS /* @min:%2etags */] || {};\r\n var itmExt = item.ext = item.ext || {};\r\n var itmTags = item[_DYN_TAGS /* @min:%2etags */] = item[_DYN_TAGS /* @min:%2etags */] || [];\r\n var extUser = itmExt.user;\r\n if (extUser) {\r\n _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId);\r\n _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId);\r\n }\r\n var extApp = itmExt.app;\r\n if (extApp) {\r\n _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId);\r\n }\r\n var extDevice = itmExt.device;\r\n if (extDevice) {\r\n _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId);\r\n _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE /* @min:%2edeviceType */], extDevice.deviceClass);\r\n _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip);\r\n _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model);\r\n _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE /* @min:%2edeviceType */], extDevice[_DYN_DEVICE_TYPE /* @min:%2edeviceType */]);\r\n }\r\n var web = item.ext.web;\r\n if (web) {\r\n _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang);\r\n _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer);\r\n _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser);\r\n var envData = env[_DYN_DATA /* @min:%2edata */] = env[_DYN_DATA /* @min:%2edata */] || {};\r\n var envBaseData = envData[strBaseData] = envData[strBaseData] || {};\r\n var envProps = envBaseData[strProperties] = envBaseData[strProperties] || {};\r\n _setValueIf(envProps, \"domain\", web.domain);\r\n _setValueIf(envProps, \"isManual\", web.isManual ? strTrue : null);\r\n _setValueIf(envProps, \"screenRes\", web.screenRes);\r\n _setValueIf(envProps, \"userConsent\", web.userConsent ? strTrue : null);\r\n }\r\n var extOs = itmExt.os;\r\n if (extOs) {\r\n _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME /* @min:%2ename */]);\r\n _setValueIf(envTags, CtxTagKeys.deviceOSVersion, extOs.osVer);\r\n }\r\n // No support for mapping Trace.traceState to 2.0 as it is currently empty\r\n var extTrace = itmExt.trace;\r\n if (extTrace) {\r\n _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID);\r\n _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace[_DYN_NAME /* @min:%2ename */]));\r\n _setValueIf(envTags, CtxTagKeys.operationId, extTrace[_DYN_TRACE_ID /* @min:%2etraceID */]);\r\n }\r\n // Sample 4.0 schema\r\n // {\r\n // \"time\" : \"2018-09-05T22:51:22.4936Z\",\r\n // \"name\" : \"MetricWithNamespace\",\r\n // \"iKey\" : \"ABC-5a4cbd20-e601-4ef5-a3c6-5d6577e4398e\",\r\n // \"ext\": { \"cloud\": {\r\n // \"role\": \"WATSON3\",\r\n // \"roleInstance\": \"CO4AEAP00000260\"\r\n // },\r\n // \"device\": {}, \"correlation\": {} },\r\n // \"tags\": [\r\n // { \"amazon.region\" : \"east2\" },\r\n // { \"os.expid\" : \"wp:02df239\" }\r\n // ]\r\n // }\r\n var tgs = {};\r\n // deals with tags.push({object})\r\n for (var i = itmTags[_DYN_LENGTH /* @min:%2elength */] - 1; i >= 0; i--) {\r\n var tg = itmTags[i];\r\n objForEachKey(tg, function (key, value) {\r\n tgs[key] = value;\r\n });\r\n itmTags.splice(i, 1);\r\n }\r\n // deals with tags[key]=value (and handles hasOwnProperty)\r\n objForEachKey(itmTags, function (tg, value) {\r\n tgs[tg] = value;\r\n });\r\n var theTags = __assign(__assign({}, envTags), tgs);\r\n if (!theTags[CtxTagKeys.internalSdkVersion]) {\r\n // Append a version in case it is not already set\r\n theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, \"javascript:\".concat(EnvelopeCreator.Version), 64);\r\n }\r\n env[_DYN_TAGS /* @min:%2etags */] = optimizeObject(theTags);\r\n}\r\nfunction _extractPropsAndMeasurements(data, properties, measurements) {\r\n if (!isNullOrUndefined(data)) {\r\n objForEachKey(data, function (key, value) {\r\n if (isNumber(value)) {\r\n measurements[key] = value;\r\n }\r\n else if (isString(value)) {\r\n properties[key] = value;\r\n }\r\n else if (hasJSON()) {\r\n properties[key] = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n });\r\n }\r\n}\r\nfunction _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue) {\r\n if (!isNullOrUndefined(properties)) {\r\n objForEachKey(properties, function (key, value) {\r\n properties[key] = value || customUndefinedValue;\r\n });\r\n }\r\n}\r\n// TODO: Do we want this to take logger as arg or use this._logger as nonstatic?\r\nfunction _createEnvelope(logger, envelopeType, telemetryItem, data) {\r\n var envelope = new Envelope(logger, data, envelopeType);\r\n _setValueIf(envelope, \"sampleRate\", telemetryItem[SampleRate]);\r\n if ((telemetryItem[strBaseData] || {}).startTime) {\r\n // Starting from Version 3.0.3, the time property will be assigned by the startTime value,\r\n // which records the loadEvent time for the pageView event.\r\n envelope.time = toISOString(telemetryItem[strBaseData].startTime);\r\n }\r\n envelope.iKey = telemetryItem.iKey;\r\n var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, \"\");\r\n envelope[_DYN_NAME /* @min:%2ename */] = envelope[_DYN_NAME /* @min:%2ename */].replace(\"{0}\", iKeyNoDashes);\r\n // extract all extensions from ctx\r\n _extractPartAExtensions(logger, telemetryItem, envelope);\r\n // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags\r\n telemetryItem[_DYN_TAGS /* @min:%2etags */] = telemetryItem[_DYN_TAGS /* @min:%2etags */] || [];\r\n return optimizeObject(envelope);\r\n}\r\nfunction EnvelopeCreatorInit(logger, telemetryItem) {\r\n if (isNullOrUndefined(telemetryItem[strBaseData])) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 46 /* _eInternalMessageId.TelemetryEnvelopeInvalid */, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n}\r\nexport var EnvelopeCreator = {\r\n Version: '3.3.6'\r\n};\r\nexport function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n var customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n if (isNullOrUndefined(bd)) {\r\n _warnToConsole(logger, \"Invalid input for dependency data\");\r\n return null;\r\n }\r\n var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : \"GET\";\r\n var remoteDepData = new RemoteDependencyData(logger, bd.id, bd.target, bd[_DYN_NAME /* @min:%2ename */], bd[STR_DURATION /* @min:%2eduration */], bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements);\r\n var data = new Data(RemoteDependencyData[_DYN_DATA_TYPE /* @min:%2edataType */], remoteDepData);\r\n return _createEnvelope(logger, RemoteDependencyData[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function EventEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var customProperties = {};\r\n var customMeasurements = {};\r\n if (telemetryItem[strBaseType] !== Event[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n customProperties[\"baseTypeSource\"] = telemetryItem[strBaseType]; // save the passed in base type as a property\r\n }\r\n if (telemetryItem[strBaseType] === Event[_DYN_DATA_TYPE /* @min:%2edataType */]) { // take collection\r\n customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n }\r\n else { // if its not a known type, convert to custom event\r\n if (telemetryItem[strBaseData]) {\r\n _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements);\r\n }\r\n }\r\n // Extract root level properties from part C telemetryItem.data\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var eventName = telemetryItem[strBaseData][_DYN_NAME /* @min:%2ename */];\r\n var eventData = new Event(logger, eventName, customProperties, customMeasurements);\r\n var data = new Data(Event[_DYN_DATA_TYPE /* @min:%2edataType */], eventData);\r\n return _createEnvelope(logger, Event[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function ExceptionEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n // Extract root level properties from part C telemetryItem.data\r\n var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n var customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n var exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements);\r\n var data = new Data(Exception[_DYN_DATA_TYPE /* @min:%2edataType */], exData);\r\n return _createEnvelope(logger, Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function MetricEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var baseData = telemetryItem[strBaseData];\r\n var props = baseData[strProperties] || {};\r\n var measurements = baseData[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], props, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue);\r\n }\r\n var baseMetricData = new Metric(logger, baseData[_DYN_NAME /* @min:%2ename */], baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements);\r\n var data = new Data(Metric[_DYN_DATA_TYPE /* @min:%2edataType */], baseMetricData);\r\n return _createEnvelope(logger, Metric[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function PageViewEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n // Since duration is not part of the domain properties in Common Schema, extract it from part C\r\n var duration;\r\n var baseData = telemetryItem[strBaseData];\r\n if (!isNullOrUndefined(baseData) &&\r\n !isNullOrUndefined(baseData[strProperties]) &&\r\n !isNullOrUndefined(baseData[strProperties][STR_DURATION])) { // from part B properties\r\n duration = baseData[strProperties][STR_DURATION];\r\n delete baseData[strProperties][STR_DURATION];\r\n }\r\n else if (!isNullOrUndefined(telemetryItem[_DYN_DATA /* @min:%2edata */]) &&\r\n !isNullOrUndefined(telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION])) { // from custom properties\r\n duration = telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION];\r\n delete telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION];\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n // special case: pageview.id is grabbed from current operation id. Analytics plugin is decoupled from properties plugin, so this is done here instead. This can be made a default telemetry intializer instead if needed to be decoupled from channel\r\n var currentContextId;\r\n if (((telemetryItem.ext || {}).trace || {})[_DYN_TRACE_ID /* @min:%2etraceID */]) {\r\n currentContextId = telemetryItem.ext.trace[_DYN_TRACE_ID /* @min:%2etraceID */];\r\n }\r\n var id = bd.id || currentContextId;\r\n var name = bd[_DYN_NAME /* @min:%2ename */];\r\n var url = bd.uri;\r\n var properties = bd[strProperties] || {};\r\n var measurements = bd[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.refUri)) {\r\n properties[\"refUri\"] = bd.refUri;\r\n }\r\n // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.pageType)) {\r\n properties[\"pageType\"] = bd.pageType;\r\n }\r\n // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.isLoggedIn)) {\r\n properties[\"isLoggedIn\"] = bd.isLoggedIn[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd[strProperties])) {\r\n var pageTags = bd[strProperties];\r\n objForEachKey(pageTags, function (key, value) {\r\n properties[key] = value;\r\n });\r\n }\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], properties, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue);\r\n }\r\n var pageViewData = new PageView(logger, name, url, duration, properties, measurements, id);\r\n var data = new Data(PageView[_DYN_DATA_TYPE /* @min:%2edataType */], pageViewData);\r\n return _createEnvelope(logger, PageView[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function PageViewPerformanceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var bd = telemetryItem[strBaseData];\r\n var name = bd[_DYN_NAME /* @min:%2ename */];\r\n var url = bd.uri || bd.url;\r\n var properties = bd[strProperties] || {};\r\n var measurements = bd[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], properties, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue);\r\n }\r\n var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd);\r\n var data = new Data(PageViewPerformance[_DYN_DATA_TYPE /* @min:%2edataType */], baseData);\r\n return _createEnvelope(logger, PageViewPerformance[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function TraceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var message = telemetryItem[strBaseData].message;\r\n var severityLevel = telemetryItem[strBaseData].severityLevel;\r\n var props = telemetryItem[strBaseData][strProperties] || {};\r\n var measurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], props, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue);\r\n }\r\n var baseData = new Trace(logger, message, severityLevel, props, measurements);\r\n var data = new Data(Trace[_DYN_DATA_TYPE /* @min:%2edataType */], baseData);\r\n return _createEnvelope(logger, Trace[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\n//# sourceMappingURL=EnvelopeCreator.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, arrForEach, arrIndexOf, dumpObj, getExceptionName, getJSON, isArray, isFunction, isNullOrUndefined, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_BUFFER_OVERRIDE, _DYN_CLEAR, _DYN_CLEAR_SENT, _DYN_CONCAT, _DYN_COUNT, _DYN_EMIT_LINE_DELIMITED_0, _DYN_ENQUEUE, _DYN_LENGTH, _DYN_MARK_AS_SENT, _DYN_PUSH, _DYN_STRINGIFY, _DYN__BUFFER__KEY, _DYN__MAX__BUFFER__SIZE, _DYN__SENT__BUFFER__KEY } from \"./__DynamicConstants\";\r\nvar BaseSendBuffer = /** @class */ (function () {\r\n function BaseSendBuffer(logger, config) {\r\n var _buffer = [];\r\n var _bufferFullMessageSent = false;\r\n var _maxRetryCnt = config.maxRetryCnt;\r\n this._get = function () {\r\n return _buffer;\r\n };\r\n this._set = function (buffer) {\r\n _buffer = buffer;\r\n return _buffer;\r\n };\r\n dynamicProto(BaseSendBuffer, this, function (_self) {\r\n _self[_DYN_ENQUEUE /* @min:%2eenqueue */] = function (payload) {\r\n if (_self[_DYN_COUNT /* @min:%2ecount */]() >= config.eventsLimitInMem) {\r\n // sent internal log only once per page view\r\n if (!_bufferFullMessageSent) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 105 /* _eInternalMessageId.InMemoryStorageBufferFull */, \"Maximum in-memory buffer size reached: \" + _self[_DYN_COUNT /* @min:%2ecount */](), true);\r\n _bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n payload.cnt = payload.cnt || 0;\r\n // max retry is defined, and max retry is reached, do not add the payload to buffer\r\n if (!isNullOrUndefined(_maxRetryCnt)) {\r\n if (payload.cnt > _maxRetryCnt) {\r\n // TODO: add log here on dropping payloads\r\n return;\r\n }\r\n }\r\n _buffer[_DYN_PUSH /* @min:%2epush */](payload);\r\n return;\r\n };\r\n _self[_DYN_COUNT /* @min:%2ecount */] = function () {\r\n return _buffer[_DYN_LENGTH /* @min:%2elength */];\r\n };\r\n _self.size = function () {\r\n var size = _buffer[_DYN_LENGTH /* @min:%2elength */];\r\n for (var lp = 0; lp < _buffer[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n size += (_buffer[lp].item)[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n if (!config[_DYN_EMIT_LINE_DELIMITED_0 /* @min:%2eemitLineDelimitedJson */]) {\r\n size += 2;\r\n }\r\n return size;\r\n };\r\n _self[_DYN_CLEAR /* @min:%2eclear */] = function () {\r\n _buffer = [];\r\n _bufferFullMessageSent = false;\r\n };\r\n _self.getItems = function () {\r\n return _buffer.slice(0);\r\n };\r\n _self.batchPayloads = function (payloads) {\r\n if (payloads && payloads[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var payloadStr_1 = [];\r\n arrForEach(payloads, function (payload) {\r\n payloadStr_1[_DYN_PUSH /* @min:%2epush */](payload.item);\r\n });\r\n var batch = config[_DYN_EMIT_LINE_DELIMITED_0 /* @min:%2eemitLineDelimitedJson */] ?\r\n payloadStr_1.join(\"\\n\") :\r\n \"[\" + payloadStr_1.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n _self.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n var items = _buffer.slice(0);\r\n newLogger = newLogger || logger;\r\n newConfig = newConfig || {};\r\n var newBuffer = !!canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig);\r\n arrForEach(items, function (payload) {\r\n newBuffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n });\r\n return newBuffer;\r\n };\r\n });\r\n }\r\n// Removed Stub for BaseSendBuffer.prototype.enqueue.\r\n// Removed Stub for BaseSendBuffer.prototype.count.\r\n// Removed Stub for BaseSendBuffer.prototype.size.\r\n// Removed Stub for BaseSendBuffer.prototype.clear.\r\n// Removed Stub for BaseSendBuffer.prototype.getItems.\r\n// Removed Stub for BaseSendBuffer.prototype.batchPayloads.\r\n// Removed Stub for BaseSendBuffer.prototype.createNew.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n BaseSendBuffer.__ieDyn=1;\n\n return BaseSendBuffer;\r\n}());\r\n/*\r\n * An array based send buffer.\r\n */\r\nvar ArraySendBuffer = /** @class */ (function (_super) {\r\n __extends(ArraySendBuffer, _super);\r\n function ArraySendBuffer(logger, config) {\r\n var _this = _super.call(this, logger, config) || this;\r\n dynamicProto(ArraySendBuffer, _this, function (_self, _base) {\r\n _self[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */] = function (payload) {\r\n _base[_DYN_CLEAR /* @min:%2eclear */]();\r\n };\r\n _self[_DYN_CLEAR_SENT /* @min:%2eclearSent */] = function (payload) {\r\n // not supported\r\n };\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for ArraySendBuffer.prototype.markAsSent.\r\n// Removed Stub for ArraySendBuffer.prototype.clearSent.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n ArraySendBuffer.__ieDyn=1;\n\n return ArraySendBuffer;\r\n}(BaseSendBuffer));\r\nexport { ArraySendBuffer };\r\nvar PREVIOUS_KEYS = [\"AI_buffer\", \"AI_sentBuffer\"];\r\n/*\r\n * Session storage buffer holds a copy of all unsent items in the browser session storage.\r\n */\r\nvar SessionStorageSendBuffer = /** @class */ (function (_super) {\r\n __extends(SessionStorageSendBuffer, _super);\r\n function SessionStorageSendBuffer(logger, config) {\r\n var _this = _super.call(this, logger, config) || this;\r\n var _bufferFullMessageSent = false;\r\n //Note: should not use config.namePrefix directly, because it will always refers to the latest namePrefix\r\n var _namePrefix = config === null || config === void 0 ? void 0 : config.namePrefix;\r\n // TODO: add remove buffer override as well\r\n var _b = config[_DYN_BUFFER_OVERRIDE /* @min:%2ebufferOverride */] || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }, getItem = _b.getItem, setItem = _b.setItem;\r\n var _maxRetryCnt = config.maxRetryCnt;\r\n dynamicProto(SessionStorageSendBuffer, _this, function (_self, _base) {\r\n var bufferItems = _getBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */]);\r\n var itemsInSentBuffer = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n var previousItems = _getPreviousEvents();\r\n var notDeliveredItems = itemsInSentBuffer[_DYN_CONCAT /* @min:%2econcat */](previousItems);\r\n var buffer = _self._set(bufferItems[_DYN_CONCAT /* @min:%2econcat */](notDeliveredItems));\r\n // If the buffer has too many items, drop items from the end.\r\n if (buffer[_DYN_LENGTH /* @min:%2elength */] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n buffer[_DYN_LENGTH /* @min:%2elength */] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */];\r\n }\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], []);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], buffer);\r\n _self[_DYN_ENQUEUE /* @min:%2eenqueue */] = function (payload) {\r\n if (_self[_DYN_COUNT /* @min:%2ecount */]() >= SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n // sent internal log only once per page view\r\n if (!_bufferFullMessageSent) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 67 /* _eInternalMessageId.SessionStorageBufferFull */, \"Maximum buffer size reached: \" + _self[_DYN_COUNT /* @min:%2ecount */](), true);\r\n _bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n payload.cnt = payload.cnt || 0;\r\n // max retry is defined, and max retry is reached, do not add the payload to buffer\r\n if (!isNullOrUndefined(_maxRetryCnt)) {\r\n if (payload.cnt > _maxRetryCnt) {\r\n // TODO: add log here on dropping payloads\r\n return;\r\n }\r\n }\r\n _base[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._get());\r\n };\r\n _self[_DYN_CLEAR /* @min:%2eclear */] = function () {\r\n _base[_DYN_CLEAR /* @min:%2eclear */]();\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._get());\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], []);\r\n _bufferFullMessageSent = false;\r\n };\r\n _self[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */] = function (payload) {\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._set(_removePayloadsFromBuffer(payload, _self._get())));\r\n var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n if (sentElements instanceof Array && payload instanceof Array) {\r\n sentElements = sentElements[_DYN_CONCAT /* @min:%2econcat */](payload);\r\n if (sentElements[_DYN_LENGTH /* @min:%2elength */] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements\r\n // until we receive a response from the backend and the buffer has free space again (see clearSent method)\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 67 /* _eInternalMessageId.SessionStorageBufferFull */, \"Sent buffer reached its maximum size: \" + sentElements[_DYN_LENGTH /* @min:%2elength */], true);\r\n sentElements[_DYN_LENGTH /* @min:%2elength */] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */];\r\n }\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], sentElements);\r\n }\r\n };\r\n _self[_DYN_CLEAR_SENT /* @min:%2eclearSent */] = function (payload) {\r\n var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n sentElements = _removePayloadsFromBuffer(payload, sentElements);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], sentElements);\r\n };\r\n _self.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n canUseSessionStorage = !!canUseSessionStorage;\r\n var unsentItems = _self._get().slice(0);\r\n var sentItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]).slice(0);\r\n newLogger = newLogger || logger;\r\n newConfig = newConfig || {};\r\n // to make sure that we do not send duplicated payloads when it is switched back to previous one\r\n _self[_DYN_CLEAR /* @min:%2eclear */]();\r\n var newBuffer = canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig);\r\n arrForEach(unsentItems, function (payload) {\r\n newBuffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n });\r\n if (canUseSessionStorage) {\r\n // arr buffer will clear all payloads if markAsSent() is called\r\n newBuffer[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */](sentItems);\r\n }\r\n return newBuffer;\r\n };\r\n function _removePayloadsFromBuffer(payloads, buffer) {\r\n var remaining = [];\r\n var payloadStr = [];\r\n arrForEach(payloads, function (payload) {\r\n payloadStr[_DYN_PUSH /* @min:%2epush */](payload.item);\r\n });\r\n arrForEach(buffer, function (value) {\r\n if (!isFunction(value) && arrIndexOf(payloadStr, value.item) === -1) {\r\n remaining[_DYN_PUSH /* @min:%2epush */](value);\r\n }\r\n });\r\n return remaining;\r\n }\r\n function _getBuffer(key) {\r\n var prefixedKey = key;\r\n prefixedKey = _namePrefix ? _namePrefix + \"_\" + prefixedKey : prefixedKey;\r\n return _getBufferBase(prefixedKey);\r\n }\r\n function _getBufferBase(key) {\r\n try {\r\n var bufferJson = getItem(logger, key);\r\n if (bufferJson) {\r\n var buffer_1 = getJSON().parse(bufferJson);\r\n if (isString(buffer_1)) {\r\n // When using some version prototype.js the stringify / parse cycle does not decode array's correctly\r\n buffer_1 = getJSON().parse(buffer_1);\r\n }\r\n if (buffer_1 && isArray(buffer_1)) {\r\n return buffer_1;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 42 /* _eInternalMessageId.FailedToRestoreStorageBuffer */, \" storage key: \" + key + \", \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return [];\r\n }\r\n function _setBuffer(key, buffer) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = _namePrefix ? _namePrefix + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = JSON[_DYN_STRINGIFY /* @min:%2estringify */](buffer);\r\n setItem(logger, prefixedKey, bufferJson);\r\n }\r\n catch (e) {\r\n // if there was an error, clear the buffer\r\n // telemetry is stored in the _buffer array so we won't loose any items\r\n setItem(logger, prefixedKey, JSON[_DYN_STRINGIFY /* @min:%2estringify */]([]));\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 41 /* _eInternalMessageId.FailedToSetStorageBuffer */, \" storage key: \" + prefixedKey + \", \" + getExceptionName(e) + \". Buffer cleared\", { exception: dumpObj(e) });\r\n }\r\n }\r\n // this removes buffer with prefix+key\r\n function _getPreviousEvents() {\r\n var items = [];\r\n try {\r\n arrForEach(PREVIOUS_KEYS, function (key) {\r\n var events = _getItemsFromPreviousKey(key);\r\n items = items[_DYN_CONCAT /* @min:%2econcat */](events);\r\n // to make sure that we also transfer items from old prefixed + key buffer\r\n if (_namePrefix) {\r\n var prefixedKey = _namePrefix + \"_\" + key;\r\n var prefixEvents = _getItemsFromPreviousKey(prefixedKey);\r\n items = items[_DYN_CONCAT /* @min:%2econcat */](prefixEvents);\r\n }\r\n });\r\n return items;\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 41 /* _eInternalMessageId.FailedToSetStorageBuffer */, \"Transfer events from previous buffers: \" + getExceptionName(e) + \". previous Buffer items can not be removed\", { exception: dumpObj(e) });\r\n }\r\n return [];\r\n }\r\n // transform string[] to IInternalStorageItem[]\r\n function _getItemsFromPreviousKey(key) {\r\n try {\r\n var items = _getBufferBase(key);\r\n var transFormedItems_1 = [];\r\n arrForEach(items, function (item) {\r\n var internalItem = {\r\n item: item,\r\n cnt: 0 // previous events will be default to 0 count\r\n };\r\n transFormedItems_1[_DYN_PUSH /* @min:%2epush */](internalItem);\r\n });\r\n // remove the session storage if we can add events back\r\n utlRemoveSessionStorage(logger, key);\r\n return transFormedItems_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return [];\r\n }\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for SessionStorageSendBuffer.prototype.enqueue.\r\n// Removed Stub for SessionStorageSendBuffer.prototype.clear.\r\n// Removed Stub for SessionStorageSendBuffer.prototype.markAsSent.\r\n// Removed Stub for SessionStorageSendBuffer.prototype.clearSent.\r\n// Removed Stub for SessionStorageSendBuffer.prototype.createNew.\r\n var _a;\r\n _a = SessionStorageSendBuffer;\r\n SessionStorageSendBuffer.VERSION = \"_1\";\r\n SessionStorageSendBuffer.BUFFER_KEY = \"AI_buffer\" + _a.VERSION;\r\n SessionStorageSendBuffer.SENT_BUFFER_KEY = \"AI_sentBuffer\" + _a.VERSION;\r\n // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped.\r\n SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000;\r\n return SessionStorageSendBuffer;\r\n}(BaseSendBuffer));\r\nexport { SessionStorageSendBuffer };\r\n//# sourceMappingURL=SendBuffer.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nvar _a, _b;\r\nimport { __assignFn as __assign, __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, Event, Exception, Metric, PageView, PageViewPerformance, ProcessLegacy, RemoteDependencyData, RequestHeaders, SampleRate, Trace, createOfflineListener, isInternalApplicationInsightsEndpoint, utlCanUseSessionStorage, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { ActiveStatus, BaseTelemetryPlugin, SenderPostManager, _throwInternal, _warnToConsole, arrForEach, cfgDfBoolean, cfgDfValidate, createProcessTelemetryContext, createUniqueNamespace, dateNow, dumpObj, formatErrorMessageXdr, formatErrorMessageXhr, getExceptionName, getIEVersion, isArray, isBeaconsSupported, isFetchSupported, isNullOrUndefined, mergeEvtNamespace, objExtend, onConfigChange, parseResponse, prependTransports, runTargetUnload } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isNumber, isPromiseLike, isString, isTruthy, mathFloor, mathMax, mathMin, objDeepFreeze, objDefine, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { DependencyEnvelopeCreator, EventEnvelopeCreator, ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator, PageViewPerformanceEnvelopeCreator, TraceEnvelopeCreator } from \"./EnvelopeCreator\";\r\nimport { ArraySendBuffer, SessionStorageSendBuffer } from \"./SendBuffer\";\r\nimport { Serializer } from \"./Serializer\";\r\nimport { Sample } from \"./TelemetryProcessors/Sample\";\r\nimport { _DYN_ALWAYS_USE_XHR_OVERR4, _DYN_BASE_TYPE, _DYN_BUFFER_OVERRIDE, _DYN_CLEAR, _DYN_CLEAR_SENT, _DYN_COUNT, _DYN_CUSTOM_HEADERS, _DYN_DIAG_LOG, _DYN_DISABLE_SEND_BEACON_7, _DYN_EMIT_LINE_DELIMITED_0, _DYN_ENABLE_SESSION_STORA5, _DYN_ENDPOINT_URL, _DYN_ENQUEUE, _DYN_GET_SENDER_INST, _DYN_INITIALIZE, _DYN_INSTRUMENTATION_KEY, _DYN_IS_BEACON_API_DISABL3, _DYN_ITEMS_ACCEPTED, _DYN_ITEMS_RECEIVED, _DYN_LENGTH, _DYN_MARK_AS_SENT, _DYN_MAX_BATCH_SIZE_IN_BY1, _DYN_ONUNLOAD_DISABLE_BEA2, _DYN_ONUNLOAD_DISABLE_FET6, _DYN_PUSH, _DYN_SAMPLE_RATE, _DYN_TAGS, _DYN_TRIGGER_SEND, _DYN__BUFFER, _DYN__ON_ERROR, _DYN__ON_PARTIAL_SUCCESS, _DYN__ON_SUCCESS, _DYN__SENDER } from \"./__DynamicConstants\";\r\nvar UNDEFINED_VALUE = undefined;\r\nvar EMPTY_STR = \"\";\r\nvar FetchSyncRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit)\r\nfunction _getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nfunction isOverrideFn(httpXHROverride) {\r\n return httpXHROverride && httpXHROverride.sendPOST;\r\n}\r\nvar defaultAppInsightsChannelConfig = objDeepFreeze((_a = {\r\n // Use the default value (handles empty string in the configuration)\r\n endpointUrl: cfgDfValidate(isTruthy, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH)\r\n },\r\n _a[_DYN_EMIT_LINE_DELIMITED_0 /* @min:emitLineDelimitedJson */] = cfgDfBoolean(),\r\n _a.maxBatchInterval = 15000,\r\n _a[_DYN_MAX_BATCH_SIZE_IN_BY1 /* @min:maxBatchSizeInBytes */] = 102400,\r\n _a.disableTelemetry = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_SESSION_STORA5 /* @min:enableSessionStorageBuffer */] = cfgDfBoolean(true),\r\n _a.isRetryDisabled = cfgDfBoolean(),\r\n _a[_DYN_IS_BEACON_API_DISABL3 /* @min:isBeaconApiDisabled */] = cfgDfBoolean(true),\r\n _a[_DYN_DISABLE_SEND_BEACON_7 /* @min:disableSendBeaconSplit */] = cfgDfBoolean(true),\r\n _a.disableXhr = cfgDfBoolean(),\r\n _a[_DYN_ONUNLOAD_DISABLE_FET6 /* @min:onunloadDisableFetch */] = cfgDfBoolean(),\r\n _a[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:onunloadDisableBeacon */] = cfgDfBoolean(),\r\n _a[_DYN_INSTRUMENTATION_KEY /* @min:instrumentationKey */] = UNDEFINED_VALUE,\r\n _a.namePrefix = UNDEFINED_VALUE,\r\n _a.samplingPercentage = cfgDfValidate(_chkSampling, 100),\r\n _a[_DYN_CUSTOM_HEADERS /* @min:customHeaders */] = UNDEFINED_VALUE,\r\n _a.convertUndefined = UNDEFINED_VALUE,\r\n _a.eventsLimitInMem = 10000,\r\n _a[_DYN_BUFFER_OVERRIDE /* @min:bufferOverride */] = false,\r\n _a.httpXHROverride = { isVal: isOverrideFn, v: UNDEFINED_VALUE },\r\n _a[_DYN_ALWAYS_USE_XHR_OVERR4 /* @min:alwaysUseXhrOverride */] = cfgDfBoolean(),\r\n _a.transports = UNDEFINED_VALUE,\r\n _a.retryCodes = UNDEFINED_VALUE,\r\n _a.maxRetryCnt = { isVal: isNumber, v: 10 },\r\n _a));\r\nfunction _chkSampling(value) {\r\n return !isNaN(value) && value > 0 && value <= 100;\r\n}\r\nvar EnvelopeTypeCreator = (_b = {},\r\n _b[Event.dataType] = EventEnvelopeCreator,\r\n _b[Trace.dataType] = TraceEnvelopeCreator,\r\n _b[PageView.dataType] = PageViewEnvelopeCreator,\r\n _b[PageViewPerformance.dataType] = PageViewPerformanceEnvelopeCreator,\r\n _b[Exception.dataType] = ExceptionEnvelopeCreator,\r\n _b[Metric.dataType] = MetricEnvelopeCreator,\r\n _b[RemoteDependencyData.dataType] = DependencyEnvelopeCreator,\r\n _b);\r\nvar Sender = /** @class */ (function (_super) {\r\n __extends(Sender, _super);\r\n function Sender() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 1001;\r\n _this.identifier = BreezeChannelIdentifier;\r\n // Don't set the defaults here, set them in the _initDefaults() as this is also called during unload\r\n var _consecutiveErrors; // How many times in a row a retryable error condition has occurred.\r\n var _retryAt; // The time to retry at in milliseconds from 1970/01/01 (this makes the timer calculation easy).\r\n var _lastSend; // The time of the last send operation.\r\n var _paused; // Flag indicating that the sending should be paused\r\n var _timeoutHandle; // Handle to the timer for delayed sending of batches of data.\r\n var _serializer;\r\n var _stamp_specific_redirects;\r\n var _headers;\r\n var _syncFetchPayload = 0; // Keep track of the outstanding sync fetch payload total (as sync fetch has limits)\r\n var _syncUnloadSender; // The identified sender to use for the synchronous unload stage\r\n var _offlineListener;\r\n var _evtNamespace;\r\n var _endpointUrl;\r\n var _orgEndpointUrl;\r\n var _maxBatchSizeInBytes;\r\n var _beaconSupported;\r\n var _beaconOnUnloadSupported;\r\n var _beaconNormalSupported;\r\n var _customHeaders;\r\n var _disableTelemetry;\r\n var _instrumentationKey;\r\n var _convertUndefined;\r\n var _isRetryDisabled;\r\n var _maxBatchInterval;\r\n var _sessionStorageUsed;\r\n var _bufferOverrideUsed;\r\n var _namePrefix;\r\n var _enableSendPromise;\r\n var _alwaysUseCustomSend;\r\n var _disableXhr;\r\n var _fetchKeepAlive;\r\n var _xhrSend;\r\n var _fallbackSend;\r\n var _disableBeaconSplit;\r\n var _sendPostMgr;\r\n var _retryCodes;\r\n dynamicProto(Sender, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.pause = function () {\r\n _clearScheduledTimer();\r\n _paused = true;\r\n };\r\n _self.resume = function () {\r\n if (_paused) {\r\n _paused = false;\r\n _retryAt = null;\r\n // flush if we have exceeded the max-size already\r\n _checkMaxSize();\r\n _setupTimer();\r\n }\r\n };\r\n _self.flush = function (isAsync, callBack, sendReason) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n if (!_paused) {\r\n // Clear the normal schedule timer as we are going to try and flush ASAP\r\n _clearScheduledTimer();\r\n try {\r\n return _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](isAsync, null, sendReason || 1 /* SendRequestReason.ManualFlush */);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 22 /* _eInternalMessageId.FlushFailed */, \"flush failed, telemetry will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n };\r\n _self.onunloadFlush = function () {\r\n if (!_paused) {\r\n if (_beaconSupported || _alwaysUseCustomSend) {\r\n try {\r\n return _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, _doUnloadSend, 2 /* SendRequestReason.Unload */);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 20 /* _eInternalMessageId.FailedToSendQueuedTelemetry */, \"failed to flush with beacon sender on page unload, telemetry will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n else {\r\n _self.flush(false);\r\n }\r\n }\r\n };\r\n _self.addHeader = function (name, value) {\r\n _headers[name] = value;\r\n };\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {\r\n if (_self.isInitialized()) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender is already initialized\");\r\n }\r\n _base[_DYN_INITIALIZE /* @min:%2einitialize */](config, core, extensions, pluginChain);\r\n var identifier = _self.identifier;\r\n _serializer = new Serializer(core.logger);\r\n _consecutiveErrors = 0;\r\n _retryAt = null;\r\n _lastSend = 0;\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = null;\r\n _stamp_specific_redirects = 0;\r\n var diagLog = _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"Sender\"), core.evtNamespace && core.evtNamespace());\r\n _offlineListener = createOfflineListener(_evtNamespace);\r\n // This function will be re-called whenever any referenced configuration is changed\r\n _self._addHook(onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n // getExtCfg only finds undefined values from core\r\n var senderConfig = ctx.getExtCfg(identifier, defaultAppInsightsChannelConfig);\r\n var curExtUrl = senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n // if it is not inital change (_endpointUrl has value)\r\n // if current sender endpoint url is not changed directly\r\n // means ExtCfg is not changed directly\r\n // then we need to monitor endpoint url changes from core\r\n if (_endpointUrl && curExtUrl === _endpointUrl) {\r\n var coreUrl = config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n // if core endpoint url is changed\r\n if (coreUrl && coreUrl !== curExtUrl) {\r\n // and endpoint promise changes is handled by this as well\r\n senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */] = coreUrl;\r\n }\r\n }\r\n if (isPromiseLike(senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */])) {\r\n // if it is promise, means the endpoint url is from core.endpointurl\r\n senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n }\r\n objDefine(_self, \"_senderConfig\", {\r\n g: function () {\r\n return senderConfig;\r\n }\r\n });\r\n // Only update the endpoint if the original config !== the current config\r\n // This is so any redirect endpointUrl is not overwritten\r\n if (_orgEndpointUrl !== senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */]) {\r\n if (_orgEndpointUrl) {\r\n // TODO: add doc to remind users to flush before changing endpoint, otherwise all unsent payload will be sent to new endpoint\r\n }\r\n _endpointUrl = _orgEndpointUrl = senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n }\r\n // or is not string\r\n if (core.activeStatus() === ActiveStatus.PENDING) {\r\n // waiting for core promises to be resolved\r\n // NOTE: if active status is set to pending, stop sending, clear timer here\r\n _self.pause();\r\n }\r\n else if (core.activeStatus() === ActiveStatus.ACTIVE) {\r\n // core status changed from pending to other status\r\n _self.resume();\r\n }\r\n if (_customHeaders && _customHeaders !== senderConfig[_DYN_CUSTOM_HEADERS /* @min:%2ecustomHeaders */]) {\r\n // Removing any previously defined custom headers as they have changed\r\n arrForEach(_customHeaders, function (customHeader) {\r\n delete _headers[customHeader.header];\r\n });\r\n }\r\n _maxBatchSizeInBytes = senderConfig[_DYN_MAX_BATCH_SIZE_IN_BY1 /* @min:%2emaxBatchSizeInBytes */];\r\n _beaconSupported = (senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:%2eonunloadDisableBeacon */] === false || senderConfig[_DYN_IS_BEACON_API_DISABL3 /* @min:%2eisBeaconApiDisabled */] === false) && isBeaconsSupported();\r\n _beaconOnUnloadSupported = senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:%2eonunloadDisableBeacon */] === false && isBeaconsSupported();\r\n _beaconNormalSupported = senderConfig[_DYN_IS_BEACON_API_DISABL3 /* @min:%2eisBeaconApiDisabled */] === false && isBeaconsSupported();\r\n _alwaysUseCustomSend = senderConfig[_DYN_ALWAYS_USE_XHR_OVERR4 /* @min:%2ealwaysUseXhrOverride */];\r\n _disableXhr = !!senderConfig.disableXhr;\r\n _retryCodes = senderConfig.retryCodes;\r\n var bufferOverride = senderConfig[_DYN_BUFFER_OVERRIDE /* @min:%2ebufferOverride */];\r\n var canUseSessionStorage = !!senderConfig[_DYN_ENABLE_SESSION_STORA5 /* @min:%2eenableSessionStorageBuffer */] &&\r\n (!!bufferOverride || utlCanUseSessionStorage());\r\n var namePrefix = senderConfig.namePrefix;\r\n //Note: emitLineDelimitedJson and eventsLimitInMem is directly accessed via config in senderBuffer\r\n //Therefore, if canUseSessionStorage is not changed, we do not need to re initialize a new one\r\n var shouldUpdate = (canUseSessionStorage !== _sessionStorageUsed)\r\n || (canUseSessionStorage && (_namePrefix !== namePrefix)) // prefixName is only used in session storage\r\n || (canUseSessionStorage && (_bufferOverrideUsed !== bufferOverride));\r\n if (_self[_DYN__BUFFER /* @min:%2e_buffer */]) {\r\n // case1 (Pre and Now enableSessionStorageBuffer settings are same)\r\n // if namePrefix changes, transfer current buffer to new buffer\r\n // else no action needed\r\n //case2 (Pre and Now enableSessionStorageBuffer settings are changed)\r\n // transfer current buffer to new buffer\r\n if (shouldUpdate) {\r\n try {\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = _self[_DYN__BUFFER /* @min:%2e_buffer */].createNew(diagLog, senderConfig, canUseSessionStorage);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 12 /* _eInternalMessageId.FailedAddingTelemetryToBuffer */, \"failed to transfer telemetry to different buffer storage, telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n _checkMaxSize();\r\n }\r\n else {\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = canUseSessionStorage\r\n ? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig);\r\n }\r\n _namePrefix = namePrefix;\r\n _sessionStorageUsed = canUseSessionStorage;\r\n _bufferOverrideUsed = bufferOverride;\r\n _fetchKeepAlive = !senderConfig[_DYN_ONUNLOAD_DISABLE_FET6 /* @min:%2eonunloadDisableFetch */] && isFetchSupported(true);\r\n _disableBeaconSplit = !!senderConfig[_DYN_DISABLE_SEND_BEACON_7 /* @min:%2edisableSendBeaconSplit */];\r\n _self._sample = new Sample(senderConfig.samplingPercentage, diagLog);\r\n _instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n if (!isPromiseLike(_instrumentationKey) && !_validateInstrumentationKey(_instrumentationKey, config)) {\r\n _throwInternal(diagLog, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, \"Invalid Instrumentation key \" + _instrumentationKey);\r\n }\r\n _customHeaders = senderConfig[_DYN_CUSTOM_HEADERS /* @min:%2ecustomHeaders */];\r\n if (isString(_endpointUrl) && !isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(_customHeaders, function (customHeader) {\r\n _this.addHeader(customHeader.header, customHeader.value);\r\n });\r\n }\r\n else {\r\n _customHeaders = null;\r\n }\r\n _enableSendPromise = senderConfig.enableSendPromise;\r\n var sendPostConfig = _getSendPostMgrConfig();\r\n // only init it once\r\n if (!_sendPostMgr) {\r\n _sendPostMgr = new SenderPostManager();\r\n _sendPostMgr[_DYN_INITIALIZE /* @min:%2einitialize */](sendPostConfig, diagLog);\r\n }\r\n else {\r\n _sendPostMgr.SetConfig(sendPostConfig);\r\n }\r\n var customInterface = senderConfig.httpXHROverride;\r\n var httpInterface = null;\r\n var syncInterface = null;\r\n // User requested transport(s) values > Beacon > Fetch > XHR\r\n // Beacon would be filtered out if user has set disableBeaconApi to true at _getSenderInterface\r\n var theTransports = prependTransports([3 /* TransportType.Beacon */, 1 /* TransportType.Xhr */, 2 /* TransportType.Fetch */], senderConfig.transports);\r\n httpInterface = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */](theTransports, false);\r\n var xhrInterface = _sendPostMgr && _sendPostMgr.getFallbackInst();\r\n _xhrSend = function (payload, isAsync) {\r\n return _doSend(xhrInterface, payload, isAsync);\r\n };\r\n _fallbackSend = function (payload, isAsync) {\r\n return _doSend(xhrInterface, payload, isAsync, false);\r\n };\r\n httpInterface = _alwaysUseCustomSend ? customInterface : (httpInterface || customInterface || xhrInterface);\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = function (payload, isAsync) {\r\n return _doSend(httpInterface, payload, isAsync);\r\n };\r\n if (_fetchKeepAlive) {\r\n // Try and use the fetch with keepalive\r\n _syncUnloadSender = _fetchKeepAliveSender;\r\n }\r\n var syncTransports = prependTransports([3 /* TransportType.Beacon */, 1 /* TransportType.Xhr */], senderConfig.unloadTransports);\r\n if (!_fetchKeepAlive) {\r\n // remove fetch from theTransports\r\n syncTransports = syncTransports.filter(function (transport) { return transport !== 2 /* TransportType.Fetch */; });\r\n }\r\n syncInterface = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */](syncTransports, true);\r\n syncInterface = _alwaysUseCustomSend ? customInterface : (syncInterface || customInterface);\r\n if ((_alwaysUseCustomSend || senderConfig.unloadTransports || !_syncUnloadSender) && syncInterface) {\r\n _syncUnloadSender = function (payload, isAsync) {\r\n return _doSend(syncInterface, payload, isAsync);\r\n };\r\n }\r\n if (!_syncUnloadSender) {\r\n _syncUnloadSender = _xhrSend;\r\n }\r\n _disableTelemetry = senderConfig.disableTelemetry;\r\n _convertUndefined = senderConfig.convertUndefined || UNDEFINED_VALUE;\r\n _isRetryDisabled = senderConfig.isRetryDisabled;\r\n _maxBatchInterval = senderConfig.maxBatchInterval;\r\n }));\r\n };\r\n _self.processTelemetry = function (telemetryItem, itemCtx) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n var diagLogger = itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n try {\r\n var isValidate = _validate(telemetryItem, diagLogger);\r\n if (!isValidate) {\r\n return;\r\n }\r\n var aiEnvelope = _getEnvelope(telemetryItem, diagLogger);\r\n if (!aiEnvelope) {\r\n return;\r\n }\r\n // check if the incoming payload is too large, truncate if necessary\r\n var payload = _serializer.serialize(aiEnvelope);\r\n // flush if we would exceed the max-size limit by adding this item\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n _checkMaxSize(payload);\r\n var payloadItem = {\r\n item: payload,\r\n cnt: 0 // inital cnt will always be 0\r\n };\r\n // enqueue the payload\r\n buffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payloadItem);\r\n // ensure an invocation timeout is set\r\n _setupTimer();\r\n }\r\n catch (e) {\r\n _throwInternal(diagLogger, 2 /* eLoggingSeverity.WARNING */, 12 /* _eInternalMessageId.FailedAddingTelemetryToBuffer */, \"Failed adding telemetry to the sender's buffer, some telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n // hand off the telemetry item to the next plugin\r\n _self.processNext(telemetryItem, itemCtx);\r\n };\r\n _self.isCompletelyIdle = function () {\r\n return !_paused && _syncFetchPayload === 0 && _self._buffer[_DYN_COUNT /* @min:%2ecount */]() === 0;\r\n };\r\n _self.getOfflineListener = function () {\r\n return _offlineListener;\r\n };\r\n /**\r\n * xhr state changes\r\n */\r\n _self._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) {\r\n // since version 3.2.0, this function is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _xhrReadyStateChange(xhr, payload, countOfItemsInPayload);\r\n };\r\n /**\r\n * Immediately send buffered data\r\n * @param async - Indicates if the events should be sent asynchronously\r\n * @param forcedSender - Indicates the forcedSender, undefined if not passed\r\n */\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */] = function (async, forcedSender, sendReason) {\r\n if (async === void 0) { async = true; }\r\n var result;\r\n if (!_paused) {\r\n try {\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n // Send data only if disableTelemetry is false\r\n if (!_disableTelemetry) {\r\n if (buffer[_DYN_COUNT /* @min:%2ecount */]() > 0) {\r\n var payload = buffer.getItems();\r\n _notifySendRequest(sendReason || 0 /* SendRequestReason.Undefined */, async);\r\n // invoke send\r\n if (forcedSender) {\r\n result = forcedSender.call(_self, payload, async);\r\n }\r\n else {\r\n result = _self[_DYN__SENDER /* @min:%2e_sender */](payload, async);\r\n }\r\n }\r\n // update lastSend time to enable throttling\r\n _lastSend = +new Date;\r\n }\r\n else {\r\n buffer[_DYN_CLEAR /* @min:%2eclear */]();\r\n }\r\n _clearScheduledTimer();\r\n }\r\n catch (e) {\r\n /* Ignore this error for IE under v10 */\r\n var ieVer = getIEVersion();\r\n if (!ieVer || ieVer > 9) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 40 /* _eInternalMessageId.TransmissionFailed */, \"Telemetry transmission failed, some telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n _self.getOfflineSupport = function () {\r\n return {\r\n getUrl: function () {\r\n return _endpointUrl;\r\n },\r\n createPayload: _createPayload,\r\n serialize: _serialize,\r\n batch: _batch,\r\n shouldProcess: function (evt) {\r\n return !!_validate(evt);\r\n }\r\n };\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _self.onunloadFlush();\r\n runTargetUnload(_offlineListener, false);\r\n _initDefaults();\r\n };\r\n /**\r\n * error handler\r\n */\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */] = function (payload, message, event) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onError(payload, message, event);\r\n };\r\n /**\r\n * partial success handler\r\n */\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */] = function (payload, results) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onPartialSuccess(payload, results);\r\n };\r\n /**\r\n * success handler\r\n */\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */] = function (payload, countOfItemsInPayload) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onSuccess(payload, countOfItemsInPayload);\r\n //_self._buffer && _self._buffer.clearSent(payload);\r\n };\r\n /**\r\n * xdr state changes\r\n */\r\n _self._xdrOnLoad = function (xdr, payload) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _xdrOnLoad(xdr, payload);\r\n };\r\n function _xdrOnLoad(xdr, payload) {\r\n var responseText = _getResponseText(xdr);\r\n if (xdr && (responseText + \"\" === \"200\" || responseText === \"\")) {\r\n _consecutiveErrors = 0;\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, 0);\r\n }\r\n else {\r\n var results = parseResponse(responseText);\r\n if (results && results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] && results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] > results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */]\r\n && !_isRetryDisabled) {\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */](payload, results);\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, formatErrorMessageXdr(xdr));\r\n }\r\n }\r\n }\r\n function _getSendPostMgrConfig() {\r\n try {\r\n var onCompleteFuncs = {\r\n xdrOnComplete: function (xdr, oncomplete, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _xdrOnLoad(xdr, data);\r\n },\r\n fetchOnComplete: function (response, onComplete, resValue, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _checkResponsStatus(response.status, data, response.url, data[_DYN_LENGTH /* @min:%2elength */], response.statusText, resValue || \"\");\r\n },\r\n xhrOnComplete: function (request, oncomplete, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _xhrReadyStateChange(request, data, data[_DYN_LENGTH /* @min:%2elength */]);\r\n },\r\n beaconOnRetry: function (data, onComplete, canSend) {\r\n return _onBeaconRetry(data, onComplete, canSend);\r\n }\r\n };\r\n var config = {\r\n enableSendPromise: _enableSendPromise,\r\n isOneDs: false,\r\n disableCredentials: false,\r\n disableXhr: _disableXhr,\r\n disableBeacon: !_beaconNormalSupported,\r\n disableBeaconSync: !_beaconOnUnloadSupported,\r\n senderOnCompleteCallBack: onCompleteFuncs\r\n };\r\n return config;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n /**\r\n * xhr state changes\r\n */\r\n function _xhrReadyStateChange(xhr, payload, countOfItemsInPayload) {\r\n if (xhr.readyState === 4) {\r\n _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response);\r\n }\r\n }\r\n /**\r\n * error handler\r\n */\r\n function _onError(payload, message, event) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 26 /* _eInternalMessageId.OnError */, \"Failed to send telemetry.\", { message: message });\r\n _self._buffer && _self._buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n }\r\n /**\r\n * partial success handler\r\n */\r\n function _onPartialSuccess(payload, results) {\r\n var failed = [];\r\n var retry = [];\r\n // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item.\r\n var errors = results.errors.reverse();\r\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\r\n var error = errors_1[_i];\r\n var extracted = payload.splice(error.index, 1)[0];\r\n if (_isRetriable(error.statusCode)) {\r\n retry[_DYN_PUSH /* @min:%2epush */](extracted);\r\n }\r\n else {\r\n // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache).\r\n failed[_DYN_PUSH /* @min:%2epush */](extracted);\r\n }\r\n }\r\n if (payload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */]);\r\n }\r\n if (failed[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](failed, formatErrorMessageXhr(null, [\"partial success\", results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */], \"of\", results.itemsReceived].join(\" \")));\r\n }\r\n if (retry[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _resendPayload(retry);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \"Partial success. \" +\r\n \"Delivered: \" + payload[_DYN_LENGTH /* @min:%2elength */] + \", Failed: \" + failed[_DYN_LENGTH /* @min:%2elength */] +\r\n \". Will retry to send \" + retry[_DYN_LENGTH /* @min:%2elength */] + \" our of \" + results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] + \" items\");\r\n }\r\n }\r\n /**\r\n * success handler\r\n */\r\n function _onSuccess(payload, countOfItemsInPayload) {\r\n _self._buffer && _self._buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n }\r\n function _getPayloadArr(payload) {\r\n try {\r\n if (payload) {\r\n var internalPayload = payload;\r\n var arr = internalPayload.oriPayload;\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n return arr;\r\n }\r\n return null;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _validate(telemetryItem, diagLogger) {\r\n if (_disableTelemetry) {\r\n // Do not send/save data\r\n return false;\r\n }\r\n // validate input\r\n if (!telemetryItem) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 7 /* _eInternalMessageId.CannotSendEmptyTelemetry */, \"Cannot send empty telemetry\");\r\n return false;\r\n }\r\n // validate event\r\n if (telemetryItem.baseData && !telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */]) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 70 /* _eInternalMessageId.InvalidEvent */, \"Cannot send telemetry without baseData and baseType\");\r\n return false;\r\n }\r\n if (!telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */]) {\r\n // Default\r\n telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */] = \"EventData\";\r\n }\r\n // ensure a sender was constructed\r\n if (!_self[_DYN__SENDER /* @min:%2e_sender */]) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender was not initialized\");\r\n return false;\r\n }\r\n // check if this item should be sampled in, else add sampleRate tag\r\n if (!_isSampledIn(telemetryItem)) {\r\n // Item is sampled out, do not send it\r\n diagLogger && _throwInternal(diagLogger, 2 /* eLoggingSeverity.WARNING */, 33 /* _eInternalMessageId.TelemetrySampledAndNotSent */, \"Telemetry item was sampled out and not sent\", { SampleRate: _self._sample[_DYN_SAMPLE_RATE /* @min:%2esampleRate */] });\r\n return false;\r\n }\r\n else {\r\n telemetryItem[SampleRate] = _self._sample[_DYN_SAMPLE_RATE /* @min:%2esampleRate */];\r\n }\r\n return true;\r\n }\r\n function _getEnvelope(telemetryItem, diagLogger) {\r\n // construct an envelope that Application Insights endpoint can understand\r\n // if ikey of telemetry is provided and not empty, envelope will use this iKey instead of senderConfig iKey\r\n var defaultEnvelopeIkey = telemetryItem.iKey || _instrumentationKey;\r\n var aiEnvelope = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, _convertUndefined);\r\n if (!aiEnvelope) {\r\n _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 47 /* _eInternalMessageId.CreateEnvelopeError */, \"Unable to create an AppInsights envelope\");\r\n return;\r\n }\r\n var doNotSendItem = false;\r\n // this is for running in legacy mode, where customer may already have a custom initializer present\r\n if (telemetryItem[_DYN_TAGS /* @min:%2etags */] && telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy]) {\r\n arrForEach(telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy], function (callBack) {\r\n try {\r\n if (callBack && callBack(aiEnvelope) === false) {\r\n doNotSendItem = true;\r\n _warnToConsole(diagLogger, \"Telemetry processor check returns false\");\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"One of telemetry initializers failed, telemetry item will not be sent: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n });\r\n delete telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy];\r\n }\r\n if (doNotSendItem) {\r\n return; // do not send, no need to execute next plugin\r\n }\r\n return aiEnvelope;\r\n }\r\n function _serialize(item) {\r\n var rlt = EMPTY_STR;\r\n var diagLogger = _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n try {\r\n var valid = _validate(item, diagLogger);\r\n var envelope = null;\r\n if (valid) {\r\n envelope = _getEnvelope(item, diagLogger);\r\n }\r\n if (envelope) {\r\n rlt = _serializer.serialize(envelope);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return rlt;\r\n }\r\n function _batch(arr) {\r\n var rlt = EMPTY_STR;\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n rlt = \"[\" + arr.join(\",\") + \"]\";\r\n }\r\n return rlt;\r\n }\r\n function _createPayload(data) {\r\n var headers = _getHeaders();\r\n return {\r\n urlString: _endpointUrl,\r\n data: data,\r\n headers: headers\r\n };\r\n }\r\n function _isSampledIn(envelope) {\r\n return _self._sample.isSampledIn(envelope);\r\n }\r\n function _getOnComplete(payload, status, headers, response) {\r\n // ***********************************************************************************************\r\n //TODO: handle other status codes\r\n if (status === 200 && payload) {\r\n _self._onSuccess(payload, payload[_DYN_LENGTH /* @min:%2elength */]);\r\n }\r\n else {\r\n response && _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, response);\r\n }\r\n }\r\n function _doSend(sendInterface, payload, isAsync, markAsSent) {\r\n if (markAsSent === void 0) { markAsSent = true; }\r\n var onComplete = function (status, headers, response) {\r\n return _getOnComplete(payload, status, headers, response);\r\n };\r\n var payloadData = _getPayload(payload);\r\n var sendPostFunc = sendInterface && sendInterface.sendPOST;\r\n if (sendPostFunc && payloadData) {\r\n // ***********************************************************************************************\r\n // mark payload as sent at the beginning of calling each send function\r\n if (markAsSent) {\r\n _self._buffer[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */](payload);\r\n }\r\n return sendPostFunc(payloadData, onComplete, !isAsync);\r\n }\r\n return null;\r\n }\r\n function _getPayload(payload) {\r\n if (isArray(payload) && payload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var batch = _self[_DYN__BUFFER /* @min:%2e_buffer */].batchPayloads(payload);\r\n var headers = _getHeaders();\r\n var payloadData = {\r\n data: batch,\r\n urlString: _endpointUrl,\r\n headers: headers,\r\n disableXhrSync: _disableXhr,\r\n disableFetchKeepAlive: !_fetchKeepAlive,\r\n oriPayload: payload\r\n };\r\n return payloadData;\r\n }\r\n return null;\r\n }\r\n function _getHeaders() {\r\n try {\r\n var headers = _headers || {};\r\n if (isInternalApplicationInsightsEndpoint(_endpointUrl)) {\r\n headers[RequestHeaders[6 /* eRequestHeaders.sdkContextHeader */]] = RequestHeaders[7 /* eRequestHeaders.sdkContextHeaderAppIdRequest */];\r\n }\r\n return headers;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _checkMaxSize(incomingPayload) {\r\n var incomingSize = incomingPayload ? incomingPayload[_DYN_LENGTH /* @min:%2elength */] : 0;\r\n if ((_self[_DYN__BUFFER /* @min:%2e_buffer */].size() + incomingSize) > _maxBatchSizeInBytes) {\r\n if (!_offlineListener || _offlineListener.isOnline()) { // only trigger send when currently online\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, null, 10 /* SendRequestReason.MaxBatchSize */);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n function _checkResponsStatus(status, payload, responseUrl, countOfItemsInPayload, errorMessage, res) {\r\n var response = null;\r\n if (!_self._appId) {\r\n response = parseResponse(res);\r\n if (response && response.appId) {\r\n _self._appId = response.appId;\r\n }\r\n }\r\n if ((status < 200 || status >= 300) && status !== 0) {\r\n // Update End Point url if permanent redirect or moved permanently\r\n // Updates the end point url before retry\r\n if (status === 301 || status === 307 || status === 308) {\r\n if (!_checkAndUpdateEndPointUrl(responseUrl)) {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n return;\r\n }\r\n }\r\n if (_offlineListener && !_offlineListener.isOnline()) { // offline\r\n // Note: Don't check for status == 0, since adblock gives this code\r\n if (!_isRetryDisabled) {\r\n var offlineBackOffMultiplier = 10; // arbritrary number\r\n _resendPayload(payload, offlineBackOffMultiplier);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". Offline - Response Code: \".concat(status, \". Offline status: \").concat(!_offlineListener.isOnline(), \". Will retry to send \").concat(payload.length, \" items.\"));\r\n }\r\n return;\r\n }\r\n if (!_isRetryDisabled && _isRetriable(status)) {\r\n _resendPayload(payload);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" +\r\n \"Response code \" + status + \". Will retry to send \" + payload[_DYN_LENGTH /* @min:%2elength */] + \" items.\");\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n }\r\n }\r\n else {\r\n // check if the xhr's responseURL or fetch's response.url is same as endpoint url\r\n // TODO after 10 redirects force send telemetry with 'redirect=false' as query parameter.\r\n _checkAndUpdateEndPointUrl(responseUrl);\r\n if (status === 206) {\r\n if (!response) {\r\n response = parseResponse(res);\r\n }\r\n if (response && !_isRetryDisabled) {\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */](payload, response);\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n }\r\n }\r\n else {\r\n _consecutiveErrors = 0;\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, countOfItemsInPayload);\r\n }\r\n }\r\n }\r\n function _checkAndUpdateEndPointUrl(responseUrl) {\r\n // Maximum stamp specific redirects allowed(uncomment this when breeze is ready with not allowing redirects feature)\r\n if (_stamp_specific_redirects >= 10) {\r\n // _self._senderConfig.endpointUrl = () => Sender._getDefaultAppInsightsChannelConfig().endpointUrl()+\"/?redirect=false\";\r\n // _stamp_specific_redirects = 0;\r\n return false;\r\n }\r\n if (!isNullOrUndefined(responseUrl) && responseUrl !== \"\") {\r\n if (responseUrl !== _endpointUrl) {\r\n _endpointUrl = responseUrl;\r\n ++_stamp_specific_redirects;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function _doUnloadSend(payload, isAsync) {\r\n if (_syncUnloadSender) {\r\n // We are unloading so always call the sender with sync set to false\r\n _syncUnloadSender(payload, false);\r\n }\r\n else {\r\n // Fallback to the previous beacon Sender (which causes a CORB warning on chrome now)\r\n var beaconInst = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */]([3 /* TransportType.Beacon */], true);\r\n return _doSend(beaconInst, payload, isAsync);\r\n }\r\n }\r\n function _onBeaconRetry(payload, onComplete, canSend) {\r\n var internalPayload = payload;\r\n var data = internalPayload && internalPayload.oriPayload;\r\n if (!_disableBeaconSplit) {\r\n // Failed to send entire payload so try and split data and try to send as much events as possible\r\n var droppedPayload = [];\r\n for (var lp = 0; lp < data[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var thePayload = data[lp];\r\n var arr = [thePayload];\r\n var item = _getPayload(arr);\r\n if (!canSend(item, onComplete)) {\r\n // Can't send anymore, so split the batch and drop the rest\r\n droppedPayload[_DYN_PUSH /* @min:%2epush */](thePayload);\r\n }\r\n else {\r\n _self._onSuccess(arr, arr[_DYN_LENGTH /* @min:%2elength */]);\r\n }\r\n }\r\n if (droppedPayload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _fallbackSend && _fallbackSend(droppedPayload, true);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n else {\r\n _fallbackSend && _fallbackSend(data, true);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n function _isStringArr(arr) {\r\n try {\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n return (isString(arr[0]));\r\n }\r\n }\r\n catch (e) {\r\n //TODO: log, sender use IInternalStorageItem instead of string since 3.1.3\r\n }\r\n return null;\r\n }\r\n function _fetchKeepAliveSender(payload, isAsync) {\r\n var transport = null;\r\n if (isArray(payload)) {\r\n var payloadSize = payload[_DYN_LENGTH /* @min:%2elength */];\r\n for (var lp = 0; lp < payload[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n payloadSize += payload[lp].item[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n var syncFetchPayload = _sendPostMgr.getSyncFetchPayload();\r\n if ((syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) {\r\n transport = 2 /* TransportType.Fetch */;\r\n }\r\n else if (isBeaconsSupported()) {\r\n // Fallback to beacon sender as we at least get told which events can't be scheduled\r\n transport = 3 /* TransportType.Beacon */;\r\n }\r\n else {\r\n // Payload is going to be too big so just try and send via XHR\r\n transport = 1 /* TransportType.Xhr */;\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with xhrSender.\");\r\n }\r\n var inst = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */]([transport], true);\r\n return _doSend(inst, payload, isAsync);\r\n }\r\n return null;\r\n }\r\n /**\r\n * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff).\r\n * @param payload\r\n */\r\n function _resendPayload(payload, linearFactor) {\r\n if (linearFactor === void 0) { linearFactor = 1; }\r\n if (!payload || payload[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return;\r\n }\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n _consecutiveErrors++;\r\n for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) {\r\n var item = payload_1[_i];\r\n item.cnt = item.cnt || 0; // to make sure we have cnt for each payload\r\n item.cnt++; // when resend, increase cnt\r\n buffer[_DYN_ENQUEUE /* @min:%2eenqueue */](item);\r\n }\r\n // setup timer\r\n _setRetryTime(linearFactor);\r\n _setupTimer();\r\n }\r\n /**\r\n * Calculates the time to wait before retrying in case of an error based on\r\n * http://en.wikipedia.org/wiki/Exponential_backoff\r\n */\r\n function _setRetryTime(linearFactor) {\r\n var SlotDelayInSeconds = 10;\r\n var delayInSeconds;\r\n if (_consecutiveErrors <= 1) {\r\n delayInSeconds = SlotDelayInSeconds;\r\n }\r\n else {\r\n var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2;\r\n // tslint:disable-next-line:insecure-random\r\n var backOffDelay = mathFloor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1;\r\n backOffDelay = linearFactor * backOffDelay;\r\n delayInSeconds = mathMax(mathMin(backOffDelay, 3600), SlotDelayInSeconds);\r\n }\r\n // TODO: Log the backoff time like the C# version does.\r\n var retryAfterTimeSpan = dateNow() + (delayInSeconds * 1000);\r\n // TODO: Log the retry at time like the C# version does.\r\n _retryAt = retryAfterTimeSpan;\r\n }\r\n /**\r\n * Sets up the timer which triggers actually sending the data.\r\n */\r\n function _setupTimer() {\r\n if (!_timeoutHandle && !_paused) {\r\n var retryInterval = _retryAt ? mathMax(0, _retryAt - dateNow()) : 0;\r\n var timerValue = mathMax(_maxBatchInterval, retryInterval);\r\n _timeoutHandle = scheduleTimeout(function () {\r\n _timeoutHandle = null;\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, null, 1 /* SendRequestReason.NormalSchedule */);\r\n }, timerValue);\r\n }\r\n }\r\n function _clearScheduledTimer() {\r\n _timeoutHandle && _timeoutHandle.cancel();\r\n _timeoutHandle = null;\r\n _retryAt = null;\r\n }\r\n /**\r\n * Checks if the SDK should resend the payload after receiving this status code from the backend.\r\n * @param statusCode\r\n */\r\n function _isRetriable(statusCode) {\r\n // retryCodes = [] means should not retry\r\n if (!isNullOrUndefined(_retryCodes)) {\r\n return _retryCodes[_DYN_LENGTH /* @min:%2elength */] && _retryCodes.indexOf(statusCode) > -1;\r\n }\r\n return statusCode === 401 // Unauthorized\r\n // Removing as private links can return a 403 which causes excessive retries and session storage usage\r\n // || statusCode === 403 // Forbidden\r\n || statusCode === 408 // Timeout\r\n || statusCode === 429 // Too many requests.\r\n || statusCode === 500 // Internal server error.\r\n || statusCode === 502 // Bad Gateway.\r\n || statusCode === 503 // Service unavailable.\r\n || statusCode === 504; // Gateway timeout.\r\n }\r\n // Using function lookups for backward compatibility as the getNotifyMgr() did not exist until after v2.5.6\r\n function _getNotifyMgr() {\r\n var func = \"getNotifyMgr\";\r\n if (_self.core[func]) {\r\n return _self.core[func]();\r\n }\r\n // using _self.core['_notificationManager'] for backward compatibility\r\n return _self.core[\"_notificationManager\"];\r\n }\r\n function _notifySendRequest(sendRequest, isAsync) {\r\n var manager = _getNotifyMgr();\r\n if (manager && manager.eventsSendRequest) {\r\n try {\r\n manager.eventsSendRequest(sendRequest, isAsync);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 74 /* _eInternalMessageId.NotificationException */, \"send request notification failed: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n }\r\n /**\r\n * Validate UUID Format\r\n * Specs taken from https://tools.ietf.org/html/rfc4122 and breeze repo\r\n */\r\n function _validateInstrumentationKey(instrumentationKey, config) {\r\n var disableValidation = config.disableInstrumentationKeyValidation;\r\n var disableIKeyValidationFlag = isNullOrUndefined(disableValidation) ? false : disableValidation;\r\n if (disableIKeyValidationFlag) {\r\n return true;\r\n }\r\n var UUID_Regex = \"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\";\r\n var regexp = new RegExp(UUID_Regex);\r\n return regexp.test(instrumentationKey);\r\n }\r\n function _initDefaults() {\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = null;\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = null;\r\n _self._appId = null;\r\n _self._sample = null;\r\n _headers = {};\r\n _offlineListener = null;\r\n _consecutiveErrors = 0;\r\n _retryAt = null;\r\n _lastSend = null;\r\n _paused = false;\r\n _timeoutHandle = null;\r\n _serializer = null;\r\n _stamp_specific_redirects = 0;\r\n _syncFetchPayload = 0;\r\n _syncUnloadSender = null;\r\n _evtNamespace = null;\r\n _endpointUrl = null;\r\n _orgEndpointUrl = null;\r\n _maxBatchSizeInBytes = 0;\r\n _beaconSupported = false;\r\n _customHeaders = null;\r\n _disableTelemetry = false;\r\n _instrumentationKey = null;\r\n _convertUndefined = UNDEFINED_VALUE;\r\n _isRetryDisabled = false;\r\n _sessionStorageUsed = null;\r\n _namePrefix = UNDEFINED_VALUE;\r\n _disableXhr = false;\r\n _fetchKeepAlive = false;\r\n _disableBeaconSplit = false;\r\n _xhrSend = null;\r\n _fallbackSend = null;\r\n _sendPostMgr = null;\r\n objDefine(_self, \"_senderConfig\", {\r\n g: function () {\r\n return objExtend({}, defaultAppInsightsChannelConfig);\r\n }\r\n });\r\n }\r\n });\r\n return _this;\r\n }\r\n Sender.constructEnvelope = function (orig, iKey, logger, convertUndefined) {\r\n var envelope;\r\n if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) {\r\n envelope = __assign(__assign({}, orig), { iKey: iKey });\r\n }\r\n else {\r\n envelope = orig;\r\n }\r\n var creator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator;\r\n return creator(logger, envelope, convertUndefined);\r\n };\r\n// Removed Stub for Sender.prototype.pause.\r\n// Removed Stub for Sender.prototype.resume.\r\n// Removed Stub for Sender.prototype.flush.\r\n// Removed Stub for Sender.prototype.onunloadFlush.\r\n// Removed Stub for Sender.prototype.initialize.\r\n// Removed Stub for Sender.prototype.processTelemetry.\r\n// Removed Stub for Sender.prototype._xhrReadyStateChange.\r\n// Removed Stub for Sender.prototype.triggerSend.\r\n// Removed Stub for Sender.prototype._onError.\r\n// Removed Stub for Sender.prototype._onPartialSuccess.\r\n// Removed Stub for Sender.prototype._onSuccess.\r\n// Removed Stub for Sender.prototype._xdrOnLoad.\r\n// Removed Stub for Sender.prototype.addHeader.\r\n// Removed Stub for Sender.prototype.isCompletelyIdle.\r\n// Removed Stub for Sender.prototype.getOfflineSupport.\r\n// Removed Stub for Sender.prototype.getOfflineListener.\r\n return Sender;\r\n}(BaseTelemetryPlugin));\r\nexport { Sender };\r\n//# sourceMappingURL=Sender.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { _throwInternal, getJSON, isArray, isFunction, isObject, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_LENGTH, _DYN_PUSH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"./__DynamicConstants\";\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer(logger) {\r\n dynamicProto(Serializer, this, function (_self) {\r\n /**\r\n * Serializes the current object to a JSON string.\r\n */\r\n _self.serialize = function (input) {\r\n var output = _serializeObject(input, \"root\");\r\n try {\r\n return getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](output);\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, (e && isFunction(e[_DYN_TO_STRING /* @min:%2etoString */])) ? e[_DYN_TO_STRING /* @min:%2etoString */]() : \"Error serializing object\", null, true);\r\n }\r\n };\r\n function _serializeObject(source, name) {\r\n var circularReferenceCheck = \"__aiCircularRefCheck\";\r\n var output = {};\r\n if (!source) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, \"cannot serialize object because it is null or undefined\", { name: name }, true);\r\n return output;\r\n }\r\n if (source[circularReferenceCheck]) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 50 /* _eInternalMessageId.CircularReferenceDetected */, \"Circular reference detected while serializing object\", { name: name }, true);\r\n return output;\r\n }\r\n if (!source.aiDataContract) {\r\n // special case for measurements/properties/tags\r\n if (name === \"measurements\") {\r\n output = _serializeStringMap(source, \"number\", name);\r\n }\r\n else if (name === \"properties\") {\r\n output = _serializeStringMap(source, \"string\", name);\r\n }\r\n else if (name === \"tags\") {\r\n output = _serializeStringMap(source, \"string\", name);\r\n }\r\n else if (isArray(source)) {\r\n output = _serializeArray(source, name);\r\n }\r\n else {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"Attempting to serialize an object which does not implement ISerializable\", { name: name }, true);\r\n try {\r\n // verify that the object can be stringified\r\n getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](source);\r\n output = source;\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, (e && isFunction(e[_DYN_TO_STRING /* @min:%2etoString */])) ? e[_DYN_TO_STRING /* @min:%2etoString */]() : \"Error serializing object\", null, true);\r\n }\r\n }\r\n return output;\r\n }\r\n source[circularReferenceCheck] = true;\r\n objForEachKey(source.aiDataContract, function (field, contract) {\r\n var isRequired = (isFunction(contract)) ? (contract() & 1 /* FieldType.Required */) : (contract & 1 /* FieldType.Required */);\r\n var isHidden = (isFunction(contract)) ? (contract() & 4 /* FieldType.Hidden */) : (contract & 4 /* FieldType.Hidden */);\r\n var isArray = contract & 2 /* FieldType.Array */;\r\n var isPresent = source[field] !== undefined;\r\n var isObj = isObject(source[field]) && source[field] !== null;\r\n if (isRequired && !isPresent && !isArray) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 24 /* _eInternalMessageId.MissingRequiredFieldSpecification */, \"Missing required field specification. The field is required but not present on source\", { field: field, name: name });\r\n // If not in debug mode, continue and hope the error is permissible\r\n }\r\n else if (!isHidden) { // Don't serialize hidden fields\r\n var value = void 0;\r\n if (isObj) {\r\n if (isArray) {\r\n // special case; recurse on each object in the source array\r\n value = _serializeArray(source[field], field);\r\n }\r\n else {\r\n // recurse on the source object in this field\r\n value = _serializeObject(source[field], field);\r\n }\r\n }\r\n else {\r\n // assign the source field to the output even if undefined or required\r\n value = source[field];\r\n }\r\n // only emit this field if the value is defined\r\n if (value !== undefined) {\r\n output[field] = value;\r\n }\r\n }\r\n });\r\n delete source[circularReferenceCheck];\r\n return output;\r\n }\r\n function _serializeArray(sources, name) {\r\n var output;\r\n if (!!sources) {\r\n if (!isArray(sources)) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 54 /* _eInternalMessageId.ItemNotInArray */, \"This field was specified as an array in the contract but the item is not an array.\\r\\n\", { name: name }, true);\r\n }\r\n else {\r\n output = [];\r\n for (var i = 0; i < sources[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var source = sources[i];\r\n var item = _serializeObject(source, name + \"[\" + i + \"]\");\r\n output[_DYN_PUSH /* @min:%2epush */](item);\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n function _serializeStringMap(map, expectedType, name) {\r\n var output;\r\n if (map) {\r\n output = {};\r\n objForEachKey(map, function (field, value) {\r\n if (expectedType === \"string\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else if (!value[_DYN_TO_STRING /* @min:%2etoString */]) {\r\n output[field] = \"invalid field: toString() is not defined.\";\r\n }\r\n else {\r\n output[field] = value[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n }\r\n else if (expectedType === \"number\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else {\r\n var num = parseFloat(value);\r\n output[field] = num;\r\n }\r\n }\r\n else {\r\n output[field] = \"invalid field: \" + name + \" is of unknown type.\";\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, output[field], null, true);\r\n }\r\n });\r\n }\r\n return output;\r\n }\r\n });\r\n }\r\n// Removed Stub for Serializer.prototype.serialize.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n Serializer.__ieDyn=1;\n\n return Serializer;\r\n}());\r\nexport { Serializer };\r\n//# sourceMappingURL=Serializer.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { _DYN_CONCAT, _DYN_LENGTH } from \"../../__DynamicConstants\";\r\n// (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution\r\nvar MIN_INPUT_LENGTH = 8;\r\nvar HashCodeScoreGenerator = /** @class */ (function () {\r\n function HashCodeScoreGenerator() {\r\n }\r\n HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) {\r\n var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE;\r\n return score * 100;\r\n };\r\n HashCodeScoreGenerator.prototype.getHashCode = function (input) {\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n while (input[_DYN_LENGTH /* @min:%2elength */] < MIN_INPUT_LENGTH) {\r\n input = input[_DYN_CONCAT /* @min:%2econcat */](input);\r\n }\r\n // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function\r\n var hash = 5381;\r\n for (var i = 0; i < input[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n hash = ((hash << 5) + hash) + input.charCodeAt(i);\r\n // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type)\r\n // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is.\r\n hash = hash & hash;\r\n }\r\n return Math.abs(hash);\r\n };\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647;\r\n return HashCodeScoreGenerator;\r\n}());\r\nexport { HashCodeScoreGenerator };\r\n//# sourceMappingURL=HashCodeScoreGenerator.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { ContextTagKeys } from \"@microsoft/applicationinsights-common\";\r\nimport { _DYN_GET_HASH_CODE_SCORE, _DYN_TAGS, _DYN_TRACE_ID } from \"../../__DynamicConstants\";\r\nimport { HashCodeScoreGenerator } from \"./HashCodeScoreGenerator\";\r\nvar SamplingScoreGenerator = /** @class */ (function () {\r\n function SamplingScoreGenerator() {\r\n var _self = this;\r\n var hashCodeGenerator = new HashCodeScoreGenerator();\r\n var keys = new ContextTagKeys();\r\n _self.getSamplingScore = function (item) {\r\n var score = 0;\r\n if (item[_DYN_TAGS /* @min:%2etags */] && item[_DYN_TAGS /* @min:%2etags */][keys.userId]) { // search in tags first, then ext\r\n score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS /* @min:%2etags */][keys.userId]);\r\n }\r\n else if (item.ext && item.ext.user && item.ext.user.id) {\r\n score = hashCodeGenerator[_DYN_GET_HASH_CODE_SCORE /* @min:%2egetHashCodeScore */](item.ext.user.id);\r\n }\r\n else if (item[_DYN_TAGS /* @min:%2etags */] && item[_DYN_TAGS /* @min:%2etags */][keys.operationId]) { // search in tags first, then ext\r\n score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS /* @min:%2etags */][keys.operationId]);\r\n }\r\n else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace[_DYN_TRACE_ID /* @min:%2etraceID */]) {\r\n score = hashCodeGenerator.getHashCodeScore(item.ext.telemetryTrace[_DYN_TRACE_ID /* @min:%2etraceID */]);\r\n }\r\n else {\r\n // tslint:disable-next-line:insecure-random\r\n score = (Math.random() * 100);\r\n }\r\n return score;\r\n };\r\n }\r\n return SamplingScoreGenerator;\r\n}());\r\nexport { SamplingScoreGenerator };\r\n//# sourceMappingURL=SamplingScoreGenerator.js.map","/*\n * Application Insights JavaScript SDK - Channel, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Metric } from \"@microsoft/applicationinsights-common\";\r\nimport { safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_DATA_TYPE, _DYN_SAMPLE_RATE } from \"../__DynamicConstants\";\r\nimport { SamplingScoreGenerator } from \"./SamplingScoreGenerators/SamplingScoreGenerator\";\r\nvar Sample = /** @class */ (function () {\r\n function Sample(sampleRate, logger) {\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n this.INT_MAX_VALUE = 2147483647;\r\n var _logger = logger || safeGetLogger(null);\r\n if (sampleRate > 100 || sampleRate < 0) {\r\n _logger.throwInternal(2 /* eLoggingSeverity.WARNING */, 58 /* _eInternalMessageId.SampleRateOutOfRange */, \"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.\", { samplingRate: sampleRate }, true);\r\n sampleRate = 100;\r\n }\r\n this[_DYN_SAMPLE_RATE /* @min:%2esampleRate */] = sampleRate;\r\n this.samplingScoreGenerator = new SamplingScoreGenerator();\r\n }\r\n /**\r\n * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped).\r\n */\r\n Sample.prototype.isSampledIn = function (envelope) {\r\n var samplingPercentage = this[_DYN_SAMPLE_RATE /* @min:%2esampleRate */]; // 0 - 100\r\n var isSampledIn = false;\r\n if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) {\r\n return true;\r\n }\r\n else if (envelope.baseType === Metric[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n // exclude MetricData telemetry from sampling\r\n return true;\r\n }\r\n isSampledIn = this.samplingScoreGenerator.getSamplingScore(envelope) < samplingPercentage;\r\n return isSampledIn;\r\n };\r\n return Sample;\r\n}());\r\nexport { Sample };\r\n//# sourceMappingURL=Sample.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrReduce, objKeys, strEndsWith } from \"@microsoft/applicationinsights-core-js\";\r\nimport { DEFAULT_BREEZE_ENDPOINT } from \"./Constants\";\r\nimport { _DYN_INGESTIONENDPOINT, _DYN_LENGTH, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\nvar _FIELDS_SEPARATOR = \";\";\r\nvar _FIELD_KEY_VALUE_SEPARATOR = \"=\";\r\nexport function parseConnectionString(connectionString) {\r\n if (!connectionString) {\r\n return {};\r\n }\r\n var kvPairs = connectionString[_DYN_SPLIT /* @min:%2esplit */](_FIELDS_SEPARATOR);\r\n var result = arrReduce(kvPairs, function (fields, kv) {\r\n var kvParts = kv[_DYN_SPLIT /* @min:%2esplit */](_FIELD_KEY_VALUE_SEPARATOR);\r\n if (kvParts[_DYN_LENGTH /* @min:%2elength */] === 2) { // only save fields with valid formats\r\n var key = kvParts[0][_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var value = kvParts[1];\r\n fields[key] = value;\r\n }\r\n return fields;\r\n }, {});\r\n if (objKeys(result)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // this is a valid connection string, so parse the results\r\n if (result.endpointsuffix) {\r\n // apply the default endpoints\r\n var locationPrefix = result.location ? result.location + \".\" : \"\";\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] || (\"https://\" + locationPrefix + \"dc.\" + result.endpointsuffix);\r\n }\r\n // apply user override endpoint or the default endpoints\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] || DEFAULT_BREEZE_ENDPOINT;\r\n if (strEndsWith(result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */], \"/\")) {\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */].slice(0, -1);\r\n }\r\n }\r\n return result;\r\n}\r\nexport var ConnectionStringParser = {\r\n parse: parseConnectionString\r\n};\r\n//# sourceMappingURL=ConnectionStringParser.js.map","/*\n * Application Insights JavaScript SDK - Common, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { _throwInternal, arrIndexOf, isNotNullOrUndefined, isNullOrUndefined, onConfigChange, randomValue, safeGetLogger, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { arrForEach, mathFloor, mathMin, objForEachKey } from \"@nevware21/ts-utils\";\r\nimport { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from \"./StorageHelperFuncs\";\r\nimport { _DYN_COUNT, _DYN_GET_UTCDATE, _DYN_LENGTH, _DYN_MESSAGE, _DYN_PRE_TRIGGER_DATE, _DYN_STRINGIFY } from \"./__DynamicConstants\";\r\nvar THROTTLE_STORAGE_PREFIX = \"appInsightsThrottle\";\r\nvar ThrottleMgr = /** @class */ (function () {\r\n function ThrottleMgr(core, namePrefix) {\r\n var _self = this;\r\n var _canUseLocalStorage;\r\n var _logger;\r\n var _config;\r\n var _localStorageObj;\r\n var _isTriggered; //_isTriggered is to make sure that we only trigger throttle once a day\r\n var _namePrefix;\r\n var _queue;\r\n var _isReady = false;\r\n var _isSpecificDaysGiven = false;\r\n _initConfig();\r\n // Special internal method to allow the unit tests and DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_queue];\r\n };\r\n _self.getConfig = function () {\r\n return _config;\r\n };\r\n /**\r\n * Check if it is the correct day to send message.\r\n * If _isTriggered is true, even if canThrottle returns true, message will not be sent,\r\n * because we only allow triggering sendMessage() once a day.\r\n * @returns if the current date is the valid date to send message\r\n */\r\n _self.canThrottle = function (msgId) {\r\n var localObj = _getLocalStorageObjByKey(msgId);\r\n var cfg = _getCfgByKey(msgId);\r\n return _canThrottle(cfg, _canUseLocalStorage, localObj);\r\n };\r\n /**\r\n * Check if throttle is triggered on current day(UTC)\r\n * if canThrottle returns false, isTriggered will return false\r\n * @returns if throttle is triggered on current day(UTC)\r\n */\r\n _self.isTriggered = function (msgId) {\r\n return _isTrigger(msgId);\r\n };\r\n /**\r\n * Before isReady set to true, all message will be stored in queue.\r\n * Message will only be sent out after isReady set to true.\r\n * Initial and default value: false\r\n * @returns isReady state\r\n */\r\n _self.isReady = function () {\r\n return _isReady;\r\n };\r\n /**\r\n * Flush all message with given message key in queue with isReady state set to true.\r\n * @returns if message queue is flushed\r\n */\r\n _self.flush = function (msgId) {\r\n try {\r\n var queue = _getQueueByKey(msgId);\r\n if (queue && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var items = queue.slice(0);\r\n _queue[msgId] = [];\r\n arrForEach(items, function (item) {\r\n _flushMessage(item.msgID, item[_DYN_MESSAGE /* @min:%2emessage */], item.severity, false);\r\n });\r\n return true;\r\n }\r\n }\r\n catch (err) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n /**\r\n * Flush all message in queue with isReady state set to true.\r\n * @returns if message queue is flushed\r\n */\r\n _self.flushAll = function () {\r\n try {\r\n if (_queue) {\r\n var result_1 = true;\r\n objForEachKey(_queue, function (key) {\r\n var isFlushed = _self.flush(parseInt(key));\r\n result_1 = result_1 && isFlushed;\r\n });\r\n return result_1;\r\n }\r\n }\r\n catch (err) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n /**\r\n * Set isReady State\r\n * if isReady set to true, message queue will be flushed automatically.\r\n * @param isReady - isReady State\r\n * @pa\r\n * @returns if message queue is flushed\r\n */\r\n _self.onReadyState = function (isReady, flushAll) {\r\n if (flushAll === void 0) { flushAll = true; }\r\n _isReady = isNullOrUndefined(isReady) ? true : isReady;\r\n if (_isReady && flushAll) {\r\n return _self.flushAll();\r\n }\r\n return null;\r\n };\r\n _self.sendMessage = function (msgID, message, severity) {\r\n return _flushMessage(msgID, message, severity, true);\r\n };\r\n function _flushMessage(msgID, message, severity, saveUnsentMsg) {\r\n if (_isReady) {\r\n var isSampledIn = _canSampledIn(msgID);\r\n if (!isSampledIn) {\r\n return;\r\n }\r\n var cfg = _getCfgByKey(msgID);\r\n var localStorageObj = _getLocalStorageObjByKey(msgID);\r\n var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj);\r\n var throttled = false;\r\n var number = 0;\r\n var isTriggered = _isTrigger(msgID);\r\n try {\r\n if (canThrottle && !isTriggered) {\r\n number = mathMin(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT /* @min:%2ecount */] + 1);\r\n localStorageObj[_DYN_COUNT /* @min:%2ecount */] = 0;\r\n throttled = true;\r\n _isTriggered[msgID] = true;\r\n localStorageObj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */] = new Date();\r\n }\r\n else {\r\n _isTriggered[msgID] = canThrottle;\r\n localStorageObj[_DYN_COUNT /* @min:%2ecount */] += 1;\r\n }\r\n var localStorageName = _getLocalStorageName(msgID);\r\n _resetLocalStorage(_logger, localStorageName, localStorageObj);\r\n for (var i = 0; i < number; i++) {\r\n _sendMessage(msgID, _logger, message, severity);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return {\r\n isThrottled: throttled,\r\n throttleNum: number\r\n };\r\n }\r\n else {\r\n if (!!saveUnsentMsg) {\r\n var queue = _getQueueByKey(msgID);\r\n queue.push({\r\n msgID: msgID,\r\n message: message,\r\n severity: severity\r\n });\r\n }\r\n }\r\n return null;\r\n }\r\n function _initConfig() {\r\n _logger = safeGetLogger(core);\r\n _isTriggered = {};\r\n _localStorageObj = {};\r\n _queue = {};\r\n _config = {};\r\n _setCfgByKey(109 /* _eInternalMessageId.DefaultThrottleMsgKey */);\r\n _namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : \"\";\r\n core.addUnloadHook(onConfigChange(core.config, function (details) {\r\n var coreConfig = details.cfg;\r\n _canUseLocalStorage = utlCanUseLocalStorage();\r\n var configMgr = coreConfig.throttleMgrCfg || {};\r\n objForEachKey(configMgr, function (key, cfg) {\r\n _setCfgByKey(parseInt(key), cfg);\r\n });\r\n }));\r\n }\r\n function _getCfgByKey(msgID) {\r\n return _config[msgID] || _config[109 /* _eInternalMessageId.DefaultThrottleMsgKey */];\r\n }\r\n function _setCfgByKey(msgID, config) {\r\n var _a, _b;\r\n try {\r\n var cfg = config || {};\r\n var curCfg = {};\r\n curCfg.disabled = !!cfg.disabled;\r\n var configInterval = cfg.interval || {};\r\n _isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH /* @min:%2elength */]) > 0;\r\n curCfg.interval = _getIntervalConfig(configInterval);\r\n var limit = {\r\n samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,\r\n // dafault: every time sent only 1 event\r\n maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1\r\n };\r\n curCfg.limit = limit;\r\n _config[msgID] = curCfg;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _getIntervalConfig(interval) {\r\n interval = interval || {};\r\n var monthInterval = interval === null || interval === void 0 ? void 0 : interval.monthInterval;\r\n var dayInterval = interval === null || interval === void 0 ? void 0 : interval.dayInterval;\r\n // default: send data every 3 month each year\r\n if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) {\r\n interval.monthInterval = 3;\r\n if (!_isSpecificDaysGiven) {\r\n // default: send data on 28th\r\n interval.daysOfMonth = [28];\r\n _isSpecificDaysGiven = true;\r\n }\r\n }\r\n interval = {\r\n // dafault: sent every three months\r\n monthInterval: interval === null || interval === void 0 ? void 0 : interval.monthInterval,\r\n dayInterval: interval === null || interval === void 0 ? void 0 : interval.dayInterval,\r\n daysOfMonth: interval === null || interval === void 0 ? void 0 : interval.daysOfMonth\r\n };\r\n return interval;\r\n }\r\n function _canThrottle(config, canUseLocalStorage, localStorageObj) {\r\n if (config && !config.disabled && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {\r\n var curDate = _getThrottleDate();\r\n var date = localStorageObj.date;\r\n var interval = config.interval;\r\n var monthCheck = 1;\r\n if (interval === null || interval === void 0 ? void 0 : interval.monthInterval) {\r\n var monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();\r\n monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);\r\n }\r\n var dayCheck = 1;\r\n if (_isSpecificDaysGiven) {\r\n dayCheck = arrIndexOf(interval.daysOfMonth, curDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]());\r\n }\r\n else if (interval === null || interval === void 0 ? void 0 : interval.dayInterval) {\r\n var daySpan = mathFloor((curDate.getTime() - date.getTime()) / 86400000);\r\n dayCheck = _checkInterval(interval.dayInterval, 0, daySpan);\r\n }\r\n return monthCheck >= 0 && dayCheck >= 0;\r\n }\r\n return false;\r\n }\r\n function _getLocalStorageName(msgKey, prefix) {\r\n var fix = isNotNullOrUndefined(prefix) ? prefix : \"\";\r\n if (msgKey) {\r\n return THROTTLE_STORAGE_PREFIX + fix + \"-\" + msgKey;\r\n }\r\n return null;\r\n }\r\n // returns if throttle is triggered on current Date\r\n function _isTriggeredOnCurDate(preTriggerDate) {\r\n try {\r\n if (preTriggerDate) {\r\n var curDate = new Date();\r\n return preTriggerDate.getUTCFullYear() === curDate.getUTCFullYear() &&\r\n preTriggerDate.getUTCMonth() === curDate.getUTCMonth() &&\r\n preTriggerDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]() === curDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n // transfer local storage string value to object that identifies start date, current count and preTriggerDate\r\n function _getLocalStorageObj(value, logger, storageName) {\r\n try {\r\n var storageObj = {\r\n date: _getThrottleDate(),\r\n count: 0\r\n };\r\n if (value) {\r\n var obj = JSON.parse(value);\r\n var curObj = {\r\n date: _getThrottleDate(obj.date) || storageObj.date,\r\n count: obj[_DYN_COUNT /* @min:%2ecount */] || storageObj[_DYN_COUNT /* @min:%2ecount */],\r\n preTriggerDate: obj.preTriggerDate ? _getThrottleDate(obj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */]) : undefined\r\n };\r\n return curObj;\r\n }\r\n else {\r\n _resetLocalStorage(logger, storageName, storageObj);\r\n return storageObj;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n // if datestr is not defined, current date will be returned\r\n function _getThrottleDate(dateStr) {\r\n // if new Date() can't be created through the provided dateStr, null will be returned.\r\n try {\r\n if (dateStr) {\r\n var date = new Date(dateStr);\r\n //make sure it is a valid Date Object\r\n if (!isNaN(date.getDate())) {\r\n return date;\r\n }\r\n }\r\n else {\r\n return new Date();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _resetLocalStorage(logger, storageName, obj) {\r\n try {\r\n return utlSetLocalStorage(logger, storageName, strTrim(JSON[_DYN_STRINGIFY /* @min:%2estringify */](obj)));\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _checkInterval(interval, start, current) {\r\n if (interval <= 0) {\r\n return 1;\r\n }\r\n // count from start year\r\n return (current >= start) && (current - start) % interval == 0 ? mathFloor((current - start) / interval) + 1 : -1;\r\n }\r\n function _sendMessage(msgID, logger, message, severity) {\r\n _throwInternal(logger, severity || 1 /* eLoggingSeverity.CRITICAL */, msgID, message);\r\n }\r\n // NOTE: config.limit.samplingRate is set to 4 decimal places,\r\n // so config.limit.samplingRate = 1 means 0.0001%\r\n function _canSampledIn(msgID) {\r\n try {\r\n var cfg = _getCfgByKey(msgID);\r\n return randomValue(1000000) <= cfg.limit.samplingRate;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _getLocalStorageObjByKey(key) {\r\n try {\r\n var curObj = _localStorageObj[key];\r\n if (!curObj) {\r\n var localStorageName = _getLocalStorageName(key, _namePrefix);\r\n curObj = _getLocalStorageObj(utlGetLocalStorage(_logger, localStorageName), _logger, localStorageName);\r\n _localStorageObj[key] = curObj;\r\n }\r\n return _localStorageObj[key];\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _isTrigger(key) {\r\n var isTrigger = _isTriggered[key];\r\n if (isNullOrUndefined(isTrigger)) {\r\n isTrigger = false;\r\n var localStorageObj = _getLocalStorageObjByKey(key);\r\n if (localStorageObj) {\r\n isTrigger = _isTriggeredOnCurDate(localStorageObj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */]);\r\n }\r\n _isTriggered[key] = isTrigger;\r\n }\r\n return _isTriggered[key];\r\n }\r\n function _getQueueByKey(key) {\r\n _queue = _queue || {};\r\n if (isNullOrUndefined(_queue[key])) {\r\n _queue[key] = [];\r\n }\r\n return _queue[key];\r\n }\r\n }\r\n return ThrottleMgr;\r\n}());\r\nexport { ThrottleMgr };\r\n//# sourceMappingURL=ThrottleMgr.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createAllPromise, createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, arrIndexOf, objDefine, safe, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CANCEL, _DYN_DATA, _DYN_IS_CHILD_EVT, _DYN_LENGTH, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_0, _DYN_SPLICE, _DYN_UNLOAD, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_OFFLINE_DROP, STR_OFFLINE_SENT, STR_OFFLINE_STORE, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar defaultValues = {\r\n perfEvtsSendAll: false\r\n};\r\nfunction _runScheduledListeners(asyncNotifications) {\r\n asyncNotifications.h = null;\r\n var callbacks = asyncNotifications.cb;\r\n asyncNotifications.cb = [];\r\n arrForEach(callbacks, function (cb) {\r\n // Run the listener in a try-catch to ensure that a single listener failing doesn't prevent the others from running\r\n safe(cb.fn, [cb.arg]);\r\n });\r\n}\r\n// This function is used to combine the logic of running the listeners and handling the async notifications so that they don't\r\n// create multiple timers if there are multiple async listeners.\r\nfunction _runListeners(listeners, name, asyncNotifications, callback) {\r\n arrForEach(listeners, function (listener) {\r\n if (listener && listener[name]) {\r\n if (asyncNotifications) {\r\n // Schedule the callback to be called after the current call stack has cleared.\r\n asyncNotifications.cb[_DYN_PUSH /* @min:%2epush */]({\r\n fn: callback,\r\n arg: listener\r\n });\r\n asyncNotifications.h = asyncNotifications.h || scheduleTimeout(_runScheduledListeners, 0, asyncNotifications);\r\n }\r\n else {\r\n // Run the listener in a try-catch to ensure that a single listener failing doesn't prevent the others from running\r\n safe(callback, [listener]);\r\n }\r\n }\r\n });\r\n}\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;\r\n var unloadHandler;\r\n var _listeners = [];\r\n var _asyncNotifications = {\r\n h: null,\r\n cb: []\r\n };\r\n var cfgHandler = createDynamicConfig(config, defaultValues);\r\n unloadHandler = cfgHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;\r\n });\r\n dynamicProto(NotificationManager, this, function (_self) {\r\n objDefine(_self, \"listeners\", {\r\n g: function () { return _listeners; }\r\n });\r\n _self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {\r\n _listeners[_DYN_PUSH /* @min:%2epush */](listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - AWTNotificationListener to remove.\r\n */\r\n _self[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */] = function (listener) {\r\n var index = arrIndexOf(_listeners, listener);\r\n while (index > -1) {\r\n _listeners[_DYN_SPLICE /* @min:%2esplice */](index, 1);\r\n index = arrIndexOf(_listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param events - The array of events that have been sent.\r\n */\r\n _self[STR_EVENTS_SENT /* @min:%2eeventsSent */] = function (events) {\r\n _runListeners(_listeners, STR_EVENTS_SENT, _asyncNotifications, function (listener) {\r\n listener[STR_EVENTS_SENT /* @min:%2eeventsSent */](events);\r\n });\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param events - The array of events that have been discarded by the SDK.\r\n * @param 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[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */] = function (events, reason) {\r\n _runListeners(_listeners, STR_EVENTS_DISCARDED, _asyncNotifications, function (listener) {\r\n listener[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */](events, reason);\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 sendReason - The reason why the event batch is being sent.\r\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n _self[STR_EVENTS_SEND_REQUEST /* @min:%2eeventsSendRequest */] = function (sendReason, isAsync) {\r\n _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync ? _asyncNotifications : null, function (listener) {\r\n listener[STR_EVENTS_SEND_REQUEST /* @min:%2eeventsSendRequest */](sendReason, isAsync);\r\n });\r\n };\r\n _self[STR_PERF_EVENT /* @min:%2eperfEvent */] = function (perfEvent) {\r\n if (perfEvent) {\r\n // Send all events or only parent events\r\n if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */]()) {\r\n _runListeners(_listeners, STR_PERF_EVENT, null, function (listener) {\r\n if (perfEvent.isAsync) {\r\n scheduleTimeout(function () { return listener[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent); }, 0);\r\n }\r\n else {\r\n listener[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n _self[STR_OFFLINE_STORE /* @min:%2eofflineEventsStored */] = function (events) {\r\n if (events && events[_DYN_LENGTH /* @min:%2elength */]) {\r\n _runListeners(_listeners, STR_OFFLINE_STORE, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_STORE /* @min:%2eofflineEventsStored */](events);\r\n });\r\n }\r\n };\r\n _self[STR_OFFLINE_SENT /* @min:%2eofflineBatchSent */] = function (batch) {\r\n if (batch && batch[_DYN_DATA /* @min:%2edata */]) {\r\n _runListeners(_listeners, STR_OFFLINE_SENT, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_SENT /* @min:%2eofflineBatchSent */](batch);\r\n });\r\n }\r\n };\r\n _self[STR_OFFLINE_DROP /* @min:%2eofflineBatchDrop */] = function (cnt, reason) {\r\n if (cnt > 0) {\r\n var rn_1 = reason || 0; // default is unknown\r\n _runListeners(_listeners, STR_OFFLINE_DROP, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_DROP /* @min:%2eofflineBatchDrop */](cnt, rn_1);\r\n });\r\n }\r\n };\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync) {\r\n var _finishUnload = function () {\r\n unloadHandler && unloadHandler.rm();\r\n unloadHandler = null;\r\n _listeners = [];\r\n // Clear any async listener\r\n _asyncNotifications.h && _asyncNotifications.h[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _asyncNotifications.h = null;\r\n _asyncNotifications.cb = [];\r\n };\r\n var waiting;\r\n _runListeners(_listeners, \"unload\", null, function (listener) {\r\n var asyncUnload = listener[_DYN_UNLOAD /* @min:%2eunload */](isAsync);\r\n if (asyncUnload) {\r\n if (!waiting) {\r\n waiting = [];\r\n }\r\n waiting[_DYN_PUSH /* @min:%2epush */](asyncUnload);\r\n }\r\n });\r\n if (waiting) {\r\n return createPromise(function (resolve) {\r\n return doAwaitResponse(createAllPromise(waiting), function () {\r\n _finishUnload();\r\n resolve();\r\n });\r\n });\r\n }\r\n else {\r\n _finishUnload();\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// Removed Stub for NotificationManager.prototype.perfEvent.\r\n// Removed Stub for NotificationManager.prototype.unload.\r\n// Removed Stub for NotificationManager.prototype.offlineEventsStored.\r\n// Removed Stub for NotificationManager.prototype.offlineBatchSent.\r\n// Removed Stub for NotificationManager.prototype.offlineBatchDrop.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n NotificationManager.__ieDyn=1;\n\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n// \r\n// \r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrAppend, arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_DIAG_LOG, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_SPLICE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { BaseTelemetryPlugin } from \"./BaseTelemetryPlugin\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getExceptionName } from \"./HelperFuncs\";\r\nimport { STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nfunction _addInitializer(_initializers, id, telemetryInitializer) {\r\n var theInitializer = {\r\n id: id,\r\n fn: telemetryInitializer\r\n };\r\n arrAppend(_initializers, theInitializer);\r\n var handler = {\r\n remove: function () {\r\n arrForEach(_initializers, function (initializer, idx) {\r\n if (initializer.id === theInitializer.id) {\r\n _initializers[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n return -1;\r\n }\r\n });\r\n }\r\n };\r\n return handler;\r\n}\r\nfunction _runInitializers(_initializers, item, logger) {\r\n var doNotSendItem = false;\r\n var telemetryInitializersCount = _initializers[_DYN_LENGTH /* @min:%2elength */];\r\n for (var i = 0; i < telemetryInitializersCount; ++i) {\r\n var telemetryInitializer = _initializers[i];\r\n if (telemetryInitializer) {\r\n try {\r\n if (telemetryInitializer.fn[_DYN_APPLY /* @min:%2eapply */](null, [item]) === false) {\r\n doNotSendItem = true;\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"Telemetry initializer failed: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n }\r\n }\r\n return !doNotSendItem;\r\n}\r\nvar TelemetryInitializerPlugin = /** @class */ (function (_super) {\r\n __extends(TelemetryInitializerPlugin, _super);\r\n function TelemetryInitializerPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"TelemetryInitializerPlugin\";\r\n _this.priority = 199;\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _id;\r\n var _initializers;\r\n _initDefaults();\r\n dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) {\r\n _self.addTelemetryInitializer = function (telemetryInitializer) {\r\n return _addInitializer(_initializers, _id++, telemetryInitializer);\r\n };\r\n _self[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */] = function (item, itemCtx) {\r\n if (_runInitializers(_initializers, item, itemCtx ? itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]() : _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]())) {\r\n _self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item, itemCtx);\r\n }\r\n };\r\n _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] = function () {\r\n _initDefaults();\r\n };\r\n });\r\n function _initDefaults() {\r\n _id = 0;\r\n _initializers = [];\r\n }\r\n return _this;\r\n }\r\n// Removed Stub for TelemetryInitializerPlugin.prototype.addTelemetryInitializer.\r\n// Removed Stub for TelemetryInitializerPlugin.prototype.processTelemetry.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n TelemetryInitializerPlugin.__ieDyn=1;\n\n return TelemetryInitializerPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { TelemetryInitializerPlugin };\r\n//# sourceMappingURL=TelemetryInitializerPlugin.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a;\r\nimport { __spreadArrayFn as __spreadArray } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createPromise, createSyncAllSettledPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrAppend, arrForEach, arrIndexOf, createTimeout, deepExtend, hasDocument, isFunction, isNullOrUndefined, isPlainObject, isPromiseLike, objDeepFreeze, objDefine, objForEachKey, objFreeze, objHasOwn, scheduleTimeout, throwError } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { ActiveStatus } from \"../JavaScriptSDK.Enums/InitActiveStatusEnum\";\r\nimport { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CANCEL, _DYN_CREATE_NEW, _DYN_ENABLED, _DYN_GET_NOTIFY_MGR, _DYN_GET_PLUGIN, _DYN_GET_PROCESS_TEL_CONT2, _DYN_IDENTIFIER, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_NAME, _DYN_ON_COMPLETE, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_0, _DYN_SPLICE, _DYN_STOP_POLLING_INTERNA3, _DYN_TEARDOWN, _DYN_UNLOAD, _DYN_VALUE, _DYN_VERSION, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { doUnloadAll, runTargetUnload } from \"./AsyncUtils\";\r\nimport { ChannelControllerPriority } from \"./Constants\";\r\nimport { createCookieMgr } from \"./CookieMgr\";\r\nimport { createUniqueNamespace } from \"./DataCacheHelper\";\r\nimport { getDebugListener } from \"./DbgExtensionUtils\";\r\nimport { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from \"./DiagnosticLogger\";\r\nimport { getSetValue, isNotNullOrUndefined, proxyFunctionAs, proxyFunctions, toISOString } from \"./HelperFuncs\";\r\nimport { STR_CHANNELS, STR_CORE, STR_CREATE_PERF_MGR, STR_DISABLED, STR_EMPTY, STR_EVENTS_DISCARDED, STR_EXTENSIONS, STR_EXTENSION_CONFIG, STR_GET_PERF_MGR, STR_PRIORITY, UNDEFINED_VALUE } from \"./InternalConstants\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { PerfManager, doPerf, getGblPerfMgr } from \"./PerfManager\";\r\nimport { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext, createTelemetryProxyChain } from \"./ProcessTelemetryContext\";\r\nimport { _getPluginState, createDistributedTraceContext, initializePlugins, sortPlugins } from \"./TelemetryHelpers\";\r\nimport { TelemetryInitializerPlugin } from \"./TelemetryInitializerPlugin\";\r\nimport { createUnloadHandlerContainer } from \"./UnloadHandlerContainer\";\r\nimport { createUnloadHookContainer } from \"./UnloadHookContainer\";\r\nvar strValidationError = \"Plugins must provide initialize method\";\r\nvar strNotificationManager = \"_notificationManager\";\r\nvar strSdkUnloadingError = \"SDK is still unloading...\";\r\nvar strSdkNotInitialized = \"SDK is not initialized\";\r\nvar maxInitQueueSize = 100;\r\nvar maxInitTimeout = 50000;\r\n// const strPluginUnloadFailed = \"Failed to unload plugin\";\r\n/**\r\n * The default settings for the config.\r\n * WE MUST include all defaults here to ensure that the config is created with all of the properties\r\n * defined as dynamic.\r\n */\r\nvar defaultConfig = objDeepFreeze((_a = {\r\n cookieCfg: {}\r\n },\r\n _a[STR_EXTENSIONS] = { rdOnly: true, ref: true, v: [] },\r\n _a[STR_CHANNELS] = { rdOnly: true, ref: true, v: [] },\r\n _a[STR_EXTENSION_CONFIG] = { ref: true, v: {} },\r\n _a[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE,\r\n _a.loggingLevelConsole = 0 /* eLoggingSeverity.DISABLED */,\r\n _a.diagnosticLogInterval = UNDEFINED_VALUE,\r\n _a));\r\n/**\r\n * Helper to create the default performance manager\r\n * @param core - The AppInsightsCore instance\r\n * @param notificationMgr - The notification manager\r\n */\r\nfunction _createPerfManager(core, notificationMgr) {\r\n return new PerfManager(notificationMgr);\r\n}\r\nfunction _validateExtensions(logger, channelPriority, allExtensions) {\r\n // Concat all available extensions\r\n var coreExtensions = [];\r\n var channels = [];\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 // Check for ext.initialize\r\n if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE /* @min:%2einitialize */])) {\r\n throwError(strValidationError);\r\n }\r\n var extPriority = ext[STR_PRIORITY /* @min:%2epriority */];\r\n var identifier = ext[_DYN_IDENTIFIER /* @min:%2eidentifier */];\r\n if (ext && extPriority) {\r\n if (!isNullOrUndefined(extPriorities[extPriority])) {\r\n _warnToConsole(logger, \"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 channels\r\n if (!extPriority || extPriority < channelPriority) {\r\n // Add to core extension that will be managed by AppInsightsCore\r\n coreExtensions[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n else {\r\n channels[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n });\r\n return {\r\n core: coreExtensions,\r\n channels: channels\r\n };\r\n}\r\nfunction _isPluginPresent(thePlugin, plugins) {\r\n var exists = false;\r\n arrForEach(plugins, function (plugin) {\r\n if (plugin === thePlugin) {\r\n exists = true;\r\n return -1;\r\n }\r\n });\r\n return exists;\r\n}\r\nfunction _deepMergeConfig(details, target, newValues, merge) {\r\n // Lets assign the new values to the existing config\r\n if (newValues) {\r\n objForEachKey(newValues, function (key, value) {\r\n if (merge) {\r\n if (isPlainObject(value) && isPlainObject(target[key])) {\r\n // The target is an object and it has a value\r\n _deepMergeConfig(details, target[key], value, merge);\r\n }\r\n }\r\n if (merge && isPlainObject(value) && isPlainObject(target[key])) {\r\n // The target is an object and it has a value\r\n _deepMergeConfig(details, target[key], value, merge);\r\n }\r\n else {\r\n // Just Assign (replace) and/or make the property dynamic\r\n details.set(target, key, value);\r\n }\r\n });\r\n }\r\n}\r\nfunction _findWatcher(listeners, newWatcher) {\r\n var theListener = null;\r\n var idx = -1;\r\n arrForEach(listeners, function (listener, lp) {\r\n if (listener.w === newWatcher) {\r\n theListener = listener;\r\n idx = lp;\r\n return -1;\r\n }\r\n });\r\n return { i: idx, l: theListener };\r\n}\r\nfunction _addDelayedCfgListener(listeners, newWatcher) {\r\n var theListener = _findWatcher(listeners, newWatcher).l;\r\n if (!theListener) {\r\n theListener = {\r\n w: newWatcher,\r\n rm: function () {\r\n var fnd = _findWatcher(listeners, newWatcher);\r\n if (fnd.i !== -1) {\r\n listeners[_DYN_SPLICE /* @min:%2esplice */](fnd.i, 1);\r\n }\r\n }\r\n };\r\n listeners[_DYN_PUSH /* @min:%2epush */](theListener);\r\n }\r\n return theListener;\r\n}\r\nfunction _registerDelayedCfgListener(config, listeners, logger) {\r\n arrForEach(listeners, function (listener) {\r\n var unloadHdl = onConfigChange(config, listener.w, logger);\r\n delete listener.w; // Clear the listener reference so it will get garbage collected.\r\n // replace the remove function\r\n listener.rm = function () {\r\n unloadHdl.rm();\r\n };\r\n });\r\n}\r\n// Moved this outside of the closure to reduce the retained memory footprint\r\nfunction _initDebugListener(configHandler, unloadContainer, notificationManager, debugListener) {\r\n // Will get recalled if any referenced config values are changed\r\n unloadContainer.add(configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var disableDbgExt = details.cfg.disableDbgExt;\r\n if (disableDbgExt === true && debugListener) {\r\n // Remove any previously loaded debug listener\r\n notificationManager[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */](debugListener);\r\n debugListener = null;\r\n }\r\n if (notificationManager && !debugListener && disableDbgExt !== true) {\r\n debugListener = getDebugListener(details.cfg);\r\n notificationManager[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](debugListener);\r\n }\r\n }));\r\n return debugListener;\r\n}\r\n// Moved this outside of the closure to reduce the retained memory footprint\r\nfunction _createUnloadHook(unloadHook) {\r\n return objDefine({\r\n rm: function () {\r\n unloadHook.rm();\r\n }\r\n }, \"toJSON\", { v: function () { return \"aicore::onCfgChange<\" + JSON.stringify(unloadHook) + \">\"; } });\r\n}\r\n/**\r\n * @group Classes\r\n * @group Entrypoint\r\n */\r\nvar AppInsightsCore = /** @class */ (function () {\r\n function AppInsightsCore() {\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _configHandler;\r\n var _isInitialized;\r\n var _logger;\r\n var _eventQueue;\r\n var _notificationManager;\r\n var _perfManager;\r\n var _cfgPerfManager;\r\n var _cookieManager;\r\n var _pluginChain;\r\n var _configExtensions;\r\n var _channelConfig;\r\n var _channels;\r\n var _isUnloading;\r\n var _telemetryInitializerPlugin;\r\n var _internalLogsEventName;\r\n var _evtNamespace;\r\n var _unloadHandlers;\r\n var _hookContainer;\r\n var _debugListener;\r\n var _traceCtx;\r\n var _instrumentationKey;\r\n var _cfgListeners;\r\n var _extensions;\r\n var _pluginVersionStringArr;\r\n var _pluginVersionString;\r\n var _activeStatus; // to indicate if ikey or endpoint url promised is resolved or not\r\n var _endpoint;\r\n var _initInMemoMaxSize; // max event count limit during wait for init promises to be resolved\r\n var _isStatusSet; // track if active status is set in case of init timeout and init promises setting the status twice\r\n var _initTimer;\r\n /**\r\n * Internal log poller\r\n */\r\n var _internalLogPoller;\r\n var _internalLogPollerListening;\r\n var _forceStopInternalLogPoller;\r\n dynamicProto(AppInsightsCore, this, function (_self) {\r\n // Set the default values (also called during teardown)\r\n _initDefaults();\r\n // Special internal method to allow the unit tests and DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_extensions, _eventQueue];\r\n };\r\n _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () { return _isInitialized; };\r\n // since version 3.3.0\r\n _self.activeStatus = function () { return _activeStatus; };\r\n // since version 3.3.0\r\n // internal\r\n _self._setPendingStatus = function () {\r\n _activeStatus = 3 /* eActiveStatus.PENDING */;\r\n };\r\n // Creating the self.initialize = ()\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, extensions, logger, notificationManager) {\r\n if (_isUnloading) {\r\n throwError(strSdkUnloadingError);\r\n }\r\n // Make sure core is only initialized once\r\n if (_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {\r\n throwError(\"Core cannot be initialized more than once\");\r\n }\r\n _configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER /* @min:%2elogger */], false);\r\n // Re-assigning the local config property so we don't have any references to the passed value and it can be garbage collected\r\n config = _configHandler.cfg;\r\n // This will be \"re-run\" if the referenced config properties are changed\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var rootCfg = details.cfg;\r\n var isPending = _activeStatus === 3 /* eActiveStatus.PENDING */;\r\n if (isPending) {\r\n // means waiting for previous promises to be resolved, won't apply new changes\r\n return;\r\n }\r\n _initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;\r\n // app Insights core only handle ikey and endpointurl, aisku will handle cs\r\n var ikey = rootCfg.instrumentationKey;\r\n var endpointUrl = rootCfg.endpointUrl; // do not need to validate endpoint url, if it is null, default one will be set by sender\r\n if (isNullOrUndefined(ikey)) {\r\n _instrumentationKey = null;\r\n // if new ikey is null, set status to be inactive, all new events will be saved in memory or dropped\r\n _activeStatus = ActiveStatus.INACTIVE;\r\n var msg = \"Please provide instrumentation key\";\r\n if (!_isInitialized) {\r\n // only throw error during initialization\r\n throwError(msg);\r\n }\r\n else {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, msg);\r\n _releaseQueues();\r\n }\r\n return;\r\n }\r\n var promises = [];\r\n if (isPromiseLike(ikey)) {\r\n promises[_DYN_PUSH /* @min:%2epush */](ikey);\r\n _instrumentationKey = null; // reset current local ikey variable (otherwise it will always be the previous ikeys if timeout is called before promise cb)\r\n }\r\n else {\r\n // string\r\n _instrumentationKey = ikey;\r\n }\r\n if (isPromiseLike(endpointUrl)) {\r\n promises[_DYN_PUSH /* @min:%2epush */](endpointUrl);\r\n _endpoint = null; // reset current local endpoint variable (otherwise it will always be the previous urls if timeout is called before promise cb)\r\n }\r\n else {\r\n // string or null\r\n _endpoint = endpointUrl;\r\n }\r\n // at least have one promise\r\n if (promises[_DYN_LENGTH /* @min:%2elength */]) {\r\n // reset to false for new dynamic changes\r\n _isStatusSet = false;\r\n _activeStatus = 3 /* eActiveStatus.PENDING */;\r\n var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout; // rootCfg.initTimeOut could be 0\r\n var allPromises = createSyncAllSettledPromise(promises);\r\n _initTimer = scheduleTimeout(function () {\r\n // set _isStatusSet to true\r\n // set active status\r\n // release queues\r\n _initTimer = null;\r\n if (!_isStatusSet) {\r\n _setStatus();\r\n }\r\n }, initTimeout);\r\n doAwaitResponse(allPromises, function (response) {\r\n try {\r\n if (_isStatusSet) {\r\n // promises take too long to resolve, ignore them\r\n // active status should be set by timeout already\r\n return;\r\n }\r\n if (!response.rejected) {\r\n var values = response[_DYN_VALUE /* @min:%2evalue */];\r\n if (values && values[_DYN_LENGTH /* @min:%2elength */]) {\r\n // ikey\r\n var ikeyRes = values[0];\r\n _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE /* @min:%2evalue */];\r\n // endpoint\r\n if (values[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n var endpointRes = values[1];\r\n _endpoint = endpointRes && endpointRes[_DYN_VALUE /* @min:%2evalue */];\r\n }\r\n }\r\n if (_instrumentationKey) {\r\n // if ikey is null, no need to trigger extra dynamic changes for extensions\r\n config.instrumentationKey = _instrumentationKey; // set config.instrumentationKey for extensions to consume\r\n config.endpointUrl = _endpoint; // set config.endpointUrl for extensions to consume\r\n }\r\n }\r\n // set _isStatusSet to true\r\n // set active status\r\n // release queues\r\n _setStatus();\r\n }\r\n catch (e) {\r\n if (!_isStatusSet) {\r\n _setStatus();\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // means no promises\r\n _setStatus();\r\n }\r\n //_instrumentationKey = details.cfg.instrumentationKey;\r\n // Mark the extensionConfig and all first level keys as referenced\r\n // This is so that calls to getExtCfg() will always return the same object\r\n // Even when a user may \"re-assign\" the plugin properties (or it's unloaded/reloaded)\r\n var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);\r\n objForEachKey(extCfg, function (key) {\r\n details.ref(extCfg, key);\r\n });\r\n }));\r\n _notificationManager = notificationManager;\r\n // Initialize the debug listener outside of the closure to reduce the retained memory footprint\r\n _debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */](), _debugListener);\r\n _initPerfManager();\r\n _self[_DYN_LOGGER /* @min:%2elogger */] = logger;\r\n var cfgExtensions = config[STR_EXTENSIONS /* @min:%2eextensions */];\r\n // Extension validation\r\n _configExtensions = [];\r\n _configExtensions[_DYN_PUSH /* @min:%2epush */].apply(_configExtensions, __spreadArray(__spreadArray([], extensions, false), cfgExtensions, false));\r\n _channelConfig = config[STR_CHANNELS /* @min:%2echannels */];\r\n _initPluginChain(null);\r\n if (!_channels || _channels[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n throwError(\"No \" + STR_CHANNELS + \" available\");\r\n }\r\n if (_channelConfig && _channelConfig[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n var teeController = _self[_DYN_GET_PLUGIN /* @min:%2egetPlugin */](\"TeeChannelController\");\r\n if (!teeController || !teeController.plugin) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"TeeChannel required\");\r\n }\r\n }\r\n _registerDelayedCfgListener(config, _cfgListeners, _logger);\r\n _cfgListeners = null;\r\n _isInitialized = true;\r\n if (_activeStatus === ActiveStatus.ACTIVE) {\r\n _releaseQueues();\r\n }\r\n };\r\n _self.getChannels = function () {\r\n var controls = [];\r\n if (_channels) {\r\n arrForEach(_channels, function (channel) {\r\n controls[_DYN_PUSH /* @min:%2epush */](channel);\r\n });\r\n }\r\n return objFreeze(controls);\r\n };\r\n _self.track = function (telemetryItem) {\r\n doPerf(_self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */](), 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 if (!telemetryItem[_DYN_NAME /* @min:%2ename */] && isNullOrUndefined(telemetryItem[_DYN_NAME /* @min:%2ename */])) {\r\n _notifyInvalidEvent(telemetryItem);\r\n throwError(\"telemetry name required\");\r\n }\r\n // setup default iKey if not passed in\r\n telemetryItem.iKey = telemetryItem.iKey || _instrumentationKey;\r\n // add default timestamp if not passed in\r\n telemetryItem.time = telemetryItem.time || toISOString(new Date());\r\n // Common Schema 4.0\r\n telemetryItem.ver = telemetryItem.ver || \"4.0\";\r\n if (!_isUnloading && _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]() && _activeStatus === ActiveStatus.ACTIVE) {\r\n // Process the telemetry plugin chain\r\n _createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](telemetryItem);\r\n }\r\n else if (_activeStatus !== ActiveStatus.INACTIVE) {\r\n // Queue events until all extensions are initialized\r\n if (_eventQueue[_DYN_LENGTH /* @min:%2elength */] <= _initInMemoMaxSize) {\r\n // set limit, if full, stop adding new events\r\n _eventQueue[_DYN_PUSH /* @min:%2epush */](telemetryItem);\r\n }\r\n }\r\n }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));\r\n };\r\n _self[_DYN_GET_PROCESS_TEL_CONT2 /* @min:%2egetProcessTelContext */] = _createTelCtx;\r\n _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */] = function () {\r\n if (!_notificationManager) {\r\n _notificationManager = new NotificationManager(_configHandler.cfg);\r\n // For backward compatibility only\r\n _self[strNotificationManager] = _notificationManager;\r\n }\r\n return _notificationManager;\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 listener - An INotificationListener object.\r\n */\r\n _self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {\r\n _self.getNotifyMgr()[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - INotificationListener to remove.\r\n */\r\n _self[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */] = function (listener) {\r\n if (_notificationManager) {\r\n _notificationManager[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */](listener);\r\n }\r\n };\r\n _self.getCookieMgr = function () {\r\n if (!_cookieManager) {\r\n _cookieManager = createCookieMgr(_configHandler.cfg, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return _cookieManager;\r\n };\r\n _self.setCookieMgr = function (cookieMgr) {\r\n if (_cookieManager !== cookieMgr) {\r\n runTargetUnload(_cookieManager, false);\r\n _cookieManager = cookieMgr;\r\n }\r\n };\r\n _self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */] = function () {\r\n return _perfManager || _cfgPerfManager || getGblPerfMgr();\r\n };\r\n _self.setPerfMgr = function (perfMgr) {\r\n _perfManager = perfMgr;\r\n };\r\n _self.eventCnt = function () {\r\n return _eventQueue[_DYN_LENGTH /* @min:%2elength */];\r\n };\r\n _self.releaseQueue = function () {\r\n if (_isInitialized && _eventQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var eventQueue = _eventQueue;\r\n _eventQueue = [];\r\n if (_activeStatus === 2 /* eActiveStatus.ACTIVE */) {\r\n arrForEach(eventQueue, function (event) {\r\n event.iKey = event.iKey || _instrumentationKey;\r\n _createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](event);\r\n });\r\n }\r\n else {\r\n // new one for msg ikey\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 20 /* _eInternalMessageId.FailedToSendQueuedTelemetry */, \"core init status is not active\");\r\n }\r\n }\r\n };\r\n _self.pollInternalLogs = function (eventName) {\r\n _internalLogsEventName = eventName || null;\r\n _forceStopInternalLogPoller = false;\r\n _internalLogPoller && _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n return _startLogPoller(true);\r\n };\r\n function _setStatus() {\r\n _isStatusSet = true;\r\n if (isNullOrUndefined(_instrumentationKey)) {\r\n _activeStatus = ActiveStatus.INACTIVE;\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 112 /* _eInternalMessageId.InitPromiseException */, \"ikey can't be resolved from promises\");\r\n }\r\n else {\r\n _activeStatus = ActiveStatus.ACTIVE;\r\n }\r\n _releaseQueues();\r\n }\r\n function _releaseQueues() {\r\n if (_isInitialized) {\r\n _self.releaseQueue();\r\n _self.pollInternalLogs();\r\n }\r\n }\r\n function _startLogPoller(alwaysStart) {\r\n if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */]) && !_forceStopInternalLogPoller) {\r\n var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH /* @min:%2elength */] > 0);\r\n if (shouldStart) {\r\n if (!_internalLogPollerListening) {\r\n _internalLogPollerListening = true;\r\n // listen for any configuration changes so that changes to the\r\n // interval will cause the timer to be re-initialized\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var interval = details.cfg.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n var isRunning = false;\r\n if (_internalLogPoller) {\r\n // It was already created so remember it's running and cancel\r\n isRunning = _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */];\r\n _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n }\r\n // Create / reconfigure\r\n _internalLogPoller = createTimeout(_flushInternalLogs, interval);\r\n _internalLogPoller.unref();\r\n // Restart if previously running\r\n _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */] = isRunning;\r\n }));\r\n }\r\n _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */] = true;\r\n }\r\n }\r\n return _internalLogPoller;\r\n }\r\n _self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */] = function () {\r\n _forceStopInternalLogPoller = true;\r\n _internalLogPoller && _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _flushInternalLogs();\r\n };\r\n // Add addTelemetryInitializer\r\n proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, [\"addTelemetryInitializer\"]);\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync, unloadComplete, cbTimeout) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n if (!_isInitialized) {\r\n // The SDK is not initialized\r\n throwError(strSdkNotInitialized);\r\n }\r\n // Check if the SDK still unloading so throw\r\n if (_isUnloading) {\r\n // The SDK is already unloading\r\n throwError(strSdkUnloadingError);\r\n }\r\n var unloadState = {\r\n reason: 50 /* TelemetryUnloadReason.SdkUnload */,\r\n isAsync: isAsync,\r\n flushComplete: false\r\n };\r\n var result;\r\n if (isAsync && !unloadComplete) {\r\n result = createPromise(function (resolve) {\r\n // Set the callback to the promise resolve callback\r\n unloadComplete = resolve;\r\n });\r\n }\r\n var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self);\r\n processUnloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {\r\n _hookContainer.run(_self[_DYN_LOGGER /* @min:%2elogger */]);\r\n // Run any \"unload\" functions for the _cookieManager, _notificationManager and _logger\r\n doUnloadAll([_cookieManager, _notificationManager, _logger], isAsync, function () {\r\n _initDefaults();\r\n unloadComplete && unloadComplete(unloadState);\r\n });\r\n }, _self);\r\n function _doUnload(flushComplete) {\r\n unloadState.flushComplete = flushComplete;\r\n _isUnloading = true;\r\n // Run all of the unload handlers first (before unloading the plugins)\r\n _unloadHandlers.run(processUnloadCtx, unloadState);\r\n // Stop polling the internal logs\r\n _self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */]();\r\n // Start unloading the components, from this point onwards the SDK should be considered to be in an unstable state\r\n processUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n _flushInternalLogs();\r\n if (!_flushChannels(isAsync, _doUnload, 6 /* SendRequestReason.SdkUnload */, cbTimeout)) {\r\n _doUnload(false);\r\n }\r\n return result;\r\n };\r\n _self[_DYN_GET_PLUGIN /* @min:%2egetPlugin */] = _getPlugin;\r\n _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {\r\n if (!plugin) {\r\n addCb && addCb(false);\r\n _logOrThrowError(strValidationError);\r\n return;\r\n }\r\n var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */]);\r\n if (existingPlugin && !replaceExisting) {\r\n addCb && addCb(false);\r\n _logOrThrowError(\"Plugin [\" + plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"] is already loaded!\");\r\n return;\r\n }\r\n var updateState = {\r\n reason: 16 /* TelemetryUpdateReason.PluginAdded */\r\n };\r\n function _addPlugin(removed) {\r\n _configExtensions[_DYN_PUSH /* @min:%2epush */](plugin);\r\n updateState.added = [plugin];\r\n // Re-Initialize the plugin chain\r\n _initPluginChain(updateState);\r\n addCb && addCb(true);\r\n }\r\n if (existingPlugin) {\r\n var removedPlugins_1 = [existingPlugin.plugin];\r\n var unloadState = {\r\n reason: 2 /* TelemetryUnloadReason.PluginReplace */,\r\n isAsync: !!isAsync\r\n };\r\n _removePlugins(removedPlugins_1, unloadState, function (removed) {\r\n if (!removed) {\r\n // Previous plugin was successfully removed or was not installed\r\n addCb && addCb(false);\r\n }\r\n else {\r\n updateState.removed = removedPlugins_1;\r\n updateState.reason |= 32 /* TelemetryUpdateReason.PluginRemoved */;\r\n _addPlugin(true);\r\n }\r\n });\r\n }\r\n else {\r\n _addPlugin(false);\r\n }\r\n };\r\n _self.updateCfg = function (newConfig, mergeExisting) {\r\n if (mergeExisting === void 0) { mergeExisting = true; }\r\n var updateState;\r\n if (_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {\r\n updateState = {\r\n reason: 1 /* TelemetryUpdateReason.ConfigurationChanged */,\r\n cfg: _configHandler.cfg,\r\n oldCfg: deepExtend({}, _configHandler.cfg),\r\n newConfig: deepExtend({}, newConfig),\r\n merge: mergeExisting\r\n };\r\n newConfig = updateState.newConfig;\r\n var cfg = _configHandler.cfg;\r\n // replace the immutable (if initialized) values\r\n // We don't currently allow updating the extensions and channels via the update config\r\n // So overwriting any user provided values to reuse the existing values\r\n newConfig[STR_EXTENSIONS /* @min:%2eextensions */] = cfg[STR_EXTENSIONS /* @min:%2eextensions */];\r\n newConfig[STR_CHANNELS /* @min:%2echannels */] = cfg[STR_CHANNELS /* @min:%2echannels */];\r\n }\r\n // Explicitly blocking any previous config watchers so that they don't get called because\r\n // of this bulk update (Probably not necessary)\r\n _configHandler._block(function (details) {\r\n // Lets assign the new values to the existing config either overwriting or re-assigning\r\n var theConfig = details.cfg;\r\n _deepMergeConfig(details, theConfig, newConfig, mergeExisting);\r\n if (!mergeExisting) {\r\n // Remove (unassign) the values \"missing\" from the newConfig and also not in the default config\r\n objForEachKey(theConfig, function (key) {\r\n if (!objHasOwn(newConfig, key)) {\r\n // Set the value to undefined\r\n details.set(theConfig, key, UNDEFINED_VALUE);\r\n }\r\n });\r\n }\r\n // Apply defaults to the new config\r\n details.setDf(theConfig, defaultConfig);\r\n }, true);\r\n // Now execute all of the listeners (synchronously) so they update their values immediately\r\n _configHandler.notify();\r\n if (updateState) {\r\n _doUpdate(updateState);\r\n }\r\n };\r\n _self.evtNamespace = function () {\r\n return _evtNamespace;\r\n };\r\n _self.flush = _flushChannels;\r\n _self.getTraceCtx = function (createNew) {\r\n if (!_traceCtx) {\r\n _traceCtx = createDistributedTraceContext();\r\n }\r\n return _traceCtx;\r\n };\r\n _self.setTraceCtx = function (traceCtx) {\r\n _traceCtx = traceCtx || null;\r\n };\r\n _self.addUnloadHook = _addUnloadHook;\r\n // Create the addUnloadCb\r\n proxyFunctionAs(_self, \"addUnloadCb\", function () { return _unloadHandlers; }, \"add\");\r\n _self.onCfgChange = function (handler) {\r\n var unloadHook;\r\n if (!_isInitialized) {\r\n unloadHook = _addDelayedCfgListener(_cfgListeners, handler);\r\n }\r\n else {\r\n unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return _createUnloadHook(unloadHook);\r\n };\r\n _self.getWParam = function () {\r\n return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;\r\n };\r\n function _setPluginVersions() {\r\n var thePlugins = {};\r\n _pluginVersionStringArr = [];\r\n var _addPluginVersions = function (plugins) {\r\n if (plugins) {\r\n arrForEach(plugins, function (plugin) {\r\n if (plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] && plugin[_DYN_VERSION /* @min:%2eversion */] && !thePlugins[plugin.identifier]) {\r\n var ver = plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"=\" + plugin[_DYN_VERSION /* @min:%2eversion */];\r\n _pluginVersionStringArr[_DYN_PUSH /* @min:%2epush */](ver);\r\n thePlugins[plugin.identifier] = plugin;\r\n }\r\n });\r\n }\r\n };\r\n _addPluginVersions(_channels);\r\n if (_channelConfig) {\r\n arrForEach(_channelConfig, function (channels) {\r\n _addPluginVersions(channels);\r\n });\r\n }\r\n _addPluginVersions(_configExtensions);\r\n }\r\n function _initDefaults() {\r\n _isInitialized = false;\r\n // Use a default logger so initialization errors are not dropped on the floor with full logging\r\n _configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n // Set the logging level to critical so that any critical initialization failures are displayed on the console\r\n _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */] = 1 /* eLoggingSeverity.CRITICAL */;\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return _configHandler.cfg; },\r\n s: function (newValue) {\r\n _self.updateCfg(newValue, false);\r\n }\r\n });\r\n objDefine(_self, \"pluginVersionStringArr\", {\r\n g: function () {\r\n if (!_pluginVersionStringArr) {\r\n _setPluginVersions();\r\n }\r\n return _pluginVersionStringArr;\r\n }\r\n });\r\n objDefine(_self, \"pluginVersionString\", {\r\n g: function () {\r\n if (!_pluginVersionString) {\r\n if (!_pluginVersionStringArr) {\r\n _setPluginVersions();\r\n }\r\n _pluginVersionString = _pluginVersionStringArr.join(\";\");\r\n }\r\n return _pluginVersionString || STR_EMPTY;\r\n }\r\n });\r\n objDefine(_self, \"logger\", {\r\n g: function () {\r\n if (!_logger) {\r\n _logger = new DiagnosticLogger(_configHandler.cfg);\r\n _configHandler[_DYN_LOGGER /* @min:%2elogger */] = _logger;\r\n }\r\n return _logger;\r\n },\r\n s: function (newLogger) {\r\n _configHandler[_DYN_LOGGER /* @min:%2elogger */] = newLogger;\r\n if (_logger !== newLogger) {\r\n runTargetUnload(_logger, false);\r\n _logger = newLogger;\r\n }\r\n }\r\n });\r\n _self[_DYN_LOGGER /* @min:%2elogger */] = new DiagnosticLogger(_configHandler.cfg);\r\n _extensions = [];\r\n var cfgExtensions = _self.config[STR_EXTENSIONS /* @min:%2eextensions */] || [];\r\n cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH /* @min:%2elength */]);\r\n arrAppend(cfgExtensions, _extensions);\r\n _telemetryInitializerPlugin = new TelemetryInitializerPlugin();\r\n _eventQueue = [];\r\n runTargetUnload(_notificationManager, false);\r\n _notificationManager = null;\r\n _perfManager = null;\r\n _cfgPerfManager = null;\r\n runTargetUnload(_cookieManager, false);\r\n _cookieManager = null;\r\n _pluginChain = null;\r\n _configExtensions = [];\r\n _channelConfig = null;\r\n _channels = null;\r\n _isUnloading = false;\r\n _internalLogsEventName = null;\r\n _evtNamespace = createUniqueNamespace(\"AIBaseCore\", true);\r\n _unloadHandlers = createUnloadHandlerContainer();\r\n _traceCtx = null;\r\n _instrumentationKey = null;\r\n _hookContainer = createUnloadHookContainer();\r\n _cfgListeners = [];\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n _forceStopInternalLogPoller = false;\r\n _internalLogPoller = null;\r\n _internalLogPollerListening = false;\r\n _activeStatus = 0 /* eActiveStatus.NONE */; // default is None\r\n _endpoint = null;\r\n _initInMemoMaxSize = null;\r\n _isStatusSet = false;\r\n _initTimer = null;\r\n }\r\n function _createTelCtx() {\r\n var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);\r\n theCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startLogPoller);\r\n return theCtx;\r\n }\r\n // Initialize or Re-initialize the plugins\r\n function _initPluginChain(updateState) {\r\n // Extension validation\r\n var theExtensions = _validateExtensions(_self[_DYN_LOGGER /* @min:%2elogger */], ChannelControllerPriority, _configExtensions);\r\n _pluginChain = null;\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n // Get the primary channel queue and include as part of the normal extensions\r\n _channels = (_channelConfig || [])[0] || [];\r\n // Add any channels provided in the extensions and sort them\r\n _channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS /* @min:%2echannels */]));\r\n // Create an array of all extensions, including the _channels\r\n var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE /* @min:%2ecore */]), _channels);\r\n // Required to allow plugins to call core.getPlugin() during their own initialization\r\n _extensions = objFreeze(allExtensions);\r\n // This has a side effect of adding the extensions passed during initialization\r\n // into the config.extensions, so you can see all of the extensions loaded.\r\n // This will also get updated by the addPlugin() and remove plugin code.\r\n var cfgExtensions = _self.config[STR_EXTENSIONS /* @min:%2eextensions */] || [];\r\n cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH /* @min:%2elength */]);\r\n arrAppend(cfgExtensions, _extensions);\r\n var rootCtx = _createTelCtx();\r\n // Initializing the channels first\r\n if (_channels && _channels[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n initializePlugins(rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](_channels), allExtensions);\r\n }\r\n // Now initialize the normal extensions (explicitly not including the _channels as this can cause duplicate initialization)\r\n initializePlugins(rootCtx, allExtensions);\r\n if (updateState) {\r\n _doUpdate(updateState);\r\n }\r\n }\r\n function _getPlugin(pluginIdentifier) {\r\n var theExt = null;\r\n var thePlugin = null;\r\n var channelHosts = [];\r\n arrForEach(_extensions, function (ext) {\r\n if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier && ext !== _telemetryInitializerPlugin) {\r\n thePlugin = ext;\r\n return -1;\r\n }\r\n if (ext.getChannel) {\r\n channelHosts[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n });\r\n if (!thePlugin && channelHosts[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(channelHosts, function (host) {\r\n thePlugin = host.getChannel(pluginIdentifier);\r\n if (!thePlugin) {\r\n return -1;\r\n }\r\n });\r\n }\r\n if (thePlugin) {\r\n theExt = {\r\n plugin: thePlugin,\r\n setEnabled: function (enabled) {\r\n _getPluginState(thePlugin)[STR_DISABLED] = !enabled;\r\n },\r\n isEnabled: function () {\r\n var pluginState = _getPluginState(thePlugin);\r\n return !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] && !pluginState[STR_DISABLED];\r\n },\r\n remove: function (isAsync, removeCb) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n var pluginsToRemove = [thePlugin];\r\n var unloadState = {\r\n reason: 1 /* TelemetryUnloadReason.PluginUnload */,\r\n isAsync: isAsync\r\n };\r\n _removePlugins(pluginsToRemove, unloadState, function (removed) {\r\n if (removed) {\r\n // Re-Initialize the plugin chain\r\n _initPluginChain({\r\n reason: 32 /* TelemetryUpdateReason.PluginRemoved */,\r\n removed: pluginsToRemove\r\n });\r\n }\r\n removeCb && removeCb(removed);\r\n });\r\n }\r\n };\r\n }\r\n return theExt;\r\n }\r\n function _getPluginChain() {\r\n if (!_pluginChain) {\r\n // copy the collection of extensions\r\n var extensions = (_extensions || []).slice();\r\n // During add / remove this may get called again, so don't read if already present\r\n if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {\r\n extensions[_DYN_PUSH /* @min:%2epush */](_telemetryInitializerPlugin);\r\n }\r\n _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _configHandler.cfg, _self);\r\n }\r\n return _pluginChain;\r\n }\r\n function _removePlugins(thePlugins, unloadState, removeComplete) {\r\n if (thePlugins && thePlugins[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var unloadChain = createTelemetryProxyChain(thePlugins, _configHandler.cfg, _self);\r\n var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self);\r\n unloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {\r\n var removed = false;\r\n // Remove the listed config extensions\r\n var newConfigExtensions = [];\r\n arrForEach(_configExtensions, function (plugin, idx) {\r\n if (!_isPluginPresent(plugin, thePlugins)) {\r\n newConfigExtensions[_DYN_PUSH /* @min:%2epush */](plugin);\r\n }\r\n else {\r\n removed = true;\r\n }\r\n });\r\n _configExtensions = newConfigExtensions;\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n // Re-Create the channel config\r\n var newChannelConfig = [];\r\n if (_channelConfig) {\r\n arrForEach(_channelConfig, function (queue, idx) {\r\n var newQueue = [];\r\n arrForEach(queue, function (channel) {\r\n if (!_isPluginPresent(channel, thePlugins)) {\r\n newQueue[_DYN_PUSH /* @min:%2epush */](channel);\r\n }\r\n else {\r\n removed = true;\r\n }\r\n });\r\n newChannelConfig[_DYN_PUSH /* @min:%2epush */](newQueue);\r\n });\r\n _channelConfig = newChannelConfig;\r\n }\r\n removeComplete && removeComplete(removed);\r\n _startLogPoller();\r\n });\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n else {\r\n removeComplete(false);\r\n }\r\n }\r\n function _flushInternalLogs() {\r\n if (_logger && _logger.queue) {\r\n var queue = _logger.queue.slice(0);\r\n _logger.queue[_DYN_LENGTH /* @min:%2elength */] = 0;\r\n arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: _internalLogsEventName ? _internalLogsEventName : \"InternalMessageId: \" + logMessage[_DYN_MESSAGE_ID /* @min:%2emessageId */],\r\n iKey: _instrumentationKey,\r\n time: toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage[_DYN_MESSAGE /* @min:%2emessage */] }\r\n };\r\n _self.track(item);\r\n });\r\n }\r\n }\r\n function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {\r\n // Setting waiting to one so that we don't call the callBack until we finish iterating\r\n var waiting = 1;\r\n var doneIterating = false;\r\n var cbTimer = null;\r\n cbTimeout = cbTimeout || 5000;\r\n function doCallback() {\r\n waiting--;\r\n if (doneIterating && waiting === 0) {\r\n cbTimer && cbTimer[_DYN_CANCEL /* @min:%2ecancel */]();\r\n cbTimer = null;\r\n callBack && callBack(doneIterating);\r\n callBack = null;\r\n }\r\n }\r\n if (_channels && _channels[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var flushCtx = _createTelCtx()[_DYN_CREATE_NEW /* @min:%2ecreateNew */](_channels);\r\n flushCtx.iterate(function (plugin) {\r\n if (plugin.flush) {\r\n waiting++;\r\n var handled_1 = false;\r\n // Not all channels will call this callback for every scenario\r\n if (!plugin.flush(isAsync, function () {\r\n handled_1 = true;\r\n doCallback();\r\n }, sendReason)) {\r\n if (!handled_1) {\r\n // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback\r\n // will never be called, so use a timeout to allow the channel(s) some time to \"finish\" before triggering any\r\n // followup function (such as unloading)\r\n if (isAsync && cbTimer == null) {\r\n cbTimer = scheduleTimeout(function () {\r\n cbTimer = null;\r\n doCallback();\r\n }, cbTimeout);\r\n }\r\n else {\r\n doCallback();\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n doneIterating = true;\r\n doCallback();\r\n return true;\r\n }\r\n function _initPerfManager() {\r\n // Save the previous config based performance manager creator to avoid creating new perf manager instances if unchanged\r\n var prevCfgPerfMgr;\r\n // Will get recalled if any referenced config values are changed\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var enablePerfMgr = details.cfg.enablePerfMgr;\r\n if (enablePerfMgr) {\r\n var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR /* @min:%2ecreatePerfMgr */];\r\n // for preCfgPerfMgr = createPerfMgr = null\r\n // initial createPerfMgr function should be _createPerfManager\r\n if ((prevCfgPerfMgr !== createPerfMgr) || !prevCfgPerfMgr) {\r\n if (!createPerfMgr) {\r\n createPerfMgr = _createPerfManager;\r\n }\r\n // Set the performance manager creation function if not defined\r\n getSetValue(details.cfg, STR_CREATE_PERF_MGR, createPerfMgr);\r\n prevCfgPerfMgr = createPerfMgr;\r\n // Remove any existing config based performance manager\r\n _cfgPerfManager = null;\r\n }\r\n // Only create the performance manager if it's not already created or manually set\r\n if (!_perfManager && !_cfgPerfManager && isFunction(createPerfMgr)) {\r\n // Create a new config based performance manager\r\n _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]());\r\n }\r\n }\r\n else {\r\n // Remove any existing config based performance manager\r\n _cfgPerfManager = null;\r\n // Clear the previous cached value so it can be GC'd\r\n prevCfgPerfMgr = null;\r\n }\r\n }));\r\n }\r\n function _doUpdate(updateState) {\r\n var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);\r\n updateCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startLogPoller);\r\n if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);\r\n }\r\n }\r\n function _logOrThrowError(message) {\r\n var logger = _self[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // there should always be a logger\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, message);\r\n _startLogPoller();\r\n }\r\n else {\r\n throwError(message);\r\n }\r\n }\r\n function _notifyInvalidEvent(telemetryItem) {\r\n var manager = _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]();\r\n if (manager) {\r\n manager[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */]([telemetryItem], 2 /* eEventsDiscardedReason.InvalidEvent */);\r\n }\r\n }\r\n function _addUnloadHook(hooks) {\r\n _hookContainer.add(hooks);\r\n }\r\n });\r\n }\r\n// Removed Stub for AppInsightsCore.prototype.initialize.\r\n// Removed Stub for AppInsightsCore.prototype.getChannels.\r\n// Removed Stub for AppInsightsCore.prototype.track.\r\n// Removed Stub for AppInsightsCore.prototype.getProcessTelContext.\r\n// Removed Stub for AppInsightsCore.prototype.getNotifyMgr.\r\n// Removed Stub for AppInsightsCore.prototype.addNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.removeNotificationListener.\r\n// Removed Stub for AppInsightsCore.prototype.getCookieMgr.\r\n// Removed Stub for AppInsightsCore.prototype.setCookieMgr.\r\n// Removed Stub for AppInsightsCore.prototype.getPerfMgr.\r\n// Removed Stub for AppInsightsCore.prototype.setPerfMgr.\r\n// Removed Stub for AppInsightsCore.prototype.eventCnt.\r\n// Removed Stub for AppInsightsCore.prototype.pollInternalLogs.\r\n// Removed Stub for AppInsightsCore.prototype.stopPollingInternalLogs.\r\n// Removed Stub for AppInsightsCore.prototype.addTelemetryInitializer.\r\n// Removed Stub for AppInsightsCore.prototype.unload.\r\n// Removed Stub for AppInsightsCore.prototype.getPlugin.\r\n// Removed Stub for AppInsightsCore.prototype.addPlugin.\r\n// Removed Stub for AppInsightsCore.prototype.updateCfg.\r\n// Removed Stub for AppInsightsCore.prototype.evtNamespace.\r\n// Removed Stub for AppInsightsCore.prototype.addUnloadCb.\r\n// Removed Stub for AppInsightsCore.prototype.flush.\r\n// Removed Stub for AppInsightsCore.prototype.getTraceCtx.\r\n// Removed Stub for AppInsightsCore.prototype.setTraceCtx.\r\n// Removed Stub for AppInsightsCore.prototype.addUnloadHook.\r\n// Removed Stub for AppInsightsCore.prototype.onCfgChange.\r\n// Removed Stub for AppInsightsCore.prototype.activeStatus.\r\n// Removed Stub for AppInsightsCore.prototype._setPendingStatus.\r\n// Removed Stub for AppInsightsCore.prototype.releaseQueue.\r\n// Removed Stub for AppInsightsCore.prototype._updateHook.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n AppInsightsCore.__ieDyn=1;\n\n return AppInsightsCore;\r\n}());\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","/*\n * Application Insights JavaScript SDK - Dependencies Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\n// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)\r\n// as when using \"short\" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.\r\nexport var STR_DURATION = \"duration\";\r\nexport var STR_PROPERTIES = \"properties\";\r\n//# sourceMappingURL=InternalConstants.js.map","/*\n * Application Insights JavaScript SDK - Dependencies Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_REQUEST_URL = \"requestUrl\"; // Count: 11\r\nexport var _DYN_LENGTH = \"length\"; // Count: 8\r\nexport var _DYN_TRACE_ID = \"traceID\"; // Count: 8\r\nexport var _DYN_SPAN_ID = \"spanID\"; // Count: 8\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 11\r\nexport var _DYN_CONTEXT = \"context\"; // Count: 5\r\nexport var _DYN_ABORTED = \"aborted\"; // Count: 6\r\nexport var _DYN__ADD_HOOK = \"_addHook\"; // Count: 4\r\nexport var _DYN_CORE = \"core\"; // Count: 7\r\nexport var _DYN_INCLUDE_CORRELATION_0 = \"includeCorrelationHeaders\"; // Count: 4\r\nexport var _DYN_GET_ABSOLUTE_URL = \"getAbsoluteUrl\"; // Count: 3\r\nexport var _DYN_HEADERS = \"headers\"; // Count: 7\r\nexport var _DYN_REQUEST_HEADERS = \"requestHeaders\"; // Count: 13\r\nexport var _DYN_SET_REQUEST_HEADER = \"setRequestHeader\"; // Count: 3\r\nexport var _DYN_TRACK_DEPENDENCY_DAT1 = \"trackDependencyDataInternal\"; // Count: 2\r\nexport var _DYN_START_TIME = \"startTime\"; // Count: 5\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 6\r\nexport var _DYN_ENABLE_REQUEST_HEADE2 = \"enableRequestHeaderTracking\"; // Count: 3\r\nexport var _DYN_ENABLE_AJAX_ERROR_ST3 = \"enableAjaxErrorStatusText\"; // Count: 2\r\nexport var _DYN_ENABLE_AJAX_PERF_TRA4 = \"enableAjaxPerfTracking\"; // Count: 2\r\nexport var _DYN_MAX_AJAX_CALLS_PER_V5 = \"maxAjaxCallsPerView\"; // Count: 2\r\nexport var _DYN_EXCLUDE_REQUEST_FROM6 = \"excludeRequestFromAutoTrackingPatterns\"; // Count: 2\r\nexport var _DYN_DISABLE_AJAX_TRACKIN7 = \"disableAjaxTracking\"; // Count: 3\r\nexport var _DYN_AJAX_PERF_LOOKUP_DEL8 = \"ajaxPerfLookupDelay\"; // Count: 2\r\nexport var _DYN_DISABLE_FETCH_TRACKI9 = \"disableFetchTracking\"; // Count: 2\r\nexport var _DYN_ENABLE_RESPONSE_HEAD10 = \"enableResponseHeaderTracking\"; // Count: 2\r\nexport var _DYN_STATUS = \"status\"; // Count: 11\r\nexport var _DYN_STATUS_TEXT = \"statusText\"; // Count: 7\r\nexport var _DYN_HEADER_MAP = \"headerMap\"; // Count: 5\r\nexport var _DYN_REQUEST_SENT_TIME = \"requestSentTime\"; // Count: 9\r\nexport var _DYN_GET_TRACE_ID = \"getTraceId\"; // Count: 3\r\nexport var _DYN_GET_TRACE_FLAGS = \"getTraceFlags\"; // Count: 3\r\nexport var _DYN_METHOD = \"method\"; // Count: 8\r\nexport var _DYN_ERROR_STATUS_TEXT = \"errorStatusText\"; // Count: 3\r\nexport var _DYN_STATE_CHANGE_ATTACHE11 = \"stateChangeAttached\"; // Count: 2\r\nexport var _DYN_RESPONSE_TEXT = \"responseText\"; // Count: 6\r\nexport var _DYN_RESPONSE_FINISHED_TI12 = \"responseFinishedTime\"; // Count: 7\r\nexport var _DYN__CREATE_TRACK_ITEM = \"CreateTrackItem\"; // Count: 3\r\nexport var _DYN_GET_ALL_RESPONSE_HEA13 = \"getAllResponseHeaders\"; // Count: 2\r\nexport var _DYN_GET_PART_APROPS = \"getPartAProps\"; // Count: 3\r\nexport var _DYN_PERF_MARK = \"perfMark\"; // Count: 4\r\nexport var _DYN_PERF_TIMING = \"perfTiming\"; // Count: 3\r\nexport var _DYN_AJAX_DIAGNOSTICS_MES14 = \"ajaxDiagnosticsMessage\"; // Count: 3\r\nexport var _DYN_CORRELATION_CONTEXT = \"correlationContext\"; // Count: 3\r\nexport var _DYN_AJAX_TOTAL_DURATION = \"ajaxTotalDuration\"; // Count: 3\r\nexport var _DYN_EVENT_TRACE_CTX = \"eventTraceCtx\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Dependencies Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Extensions, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl } from \"@microsoft/applicationinsights-common\";\r\nimport { arrForEach, isNullOrUndefined, isNumber, isString, normalizeJsName, objForEachKey, objKeys } from \"@microsoft/applicationinsights-core-js\";\r\nimport { mathRound } from \"@nevware21/ts-utils\";\r\nimport { STR_DURATION, STR_PROPERTIES } from \"./InternalConstants\";\r\nimport { _DYN_ABORTED, _DYN_AJAX_TOTAL_DURATION, _DYN_CORRELATION_CONTEXT, _DYN_ERROR_STATUS_TEXT, _DYN_EVENT_TRACE_CTX, _DYN_GET_ABSOLUTE_URL, _DYN_GET_PART_APROPS, _DYN_GET_TRACE_FLAGS, _DYN_GET_TRACE_ID, _DYN_HEADER_MAP, _DYN_LENGTH, _DYN_METHOD, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE_FINISHED_TI12, _DYN_SPAN_ID, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE11, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN__CREATE_TRACK_ITEM } from \"./__DynamicConstants\";\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = dateTimeUtilsDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */];\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n var propsSet = 0;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[STR_DURATION /* @min:%2eduration */];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, STR_DURATION, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n objForEachKey(value, function (key, val) {\r\n if (key !== strName && isString(val) || isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */]) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self.openDone = false;\r\n self.setRequestHeaderDone = false;\r\n self.sendDone = false;\r\n self.abortDone = false;\r\n // True, if onreadyStateChangeCallback function attached to xhr, otherwise false\r\n self[_DYN_STATE_CHANGE_ATTACHE11 /* @min:%2estateChangeAttached */] = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceId, spanId, logger, traceCtx) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self[_DYN_PERF_MARK /* @min:%2eperfMark */] = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] = null;\r\n self[_DYN_ABORTED /* @min:%2eaborted */] = 0;\r\n self.pageUrl = null;\r\n self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = null;\r\n self.requestSize = 0;\r\n self[_DYN_METHOD /* @min:%2emethod */] = null;\r\n self[_DYN_STATUS /* @min:%2estatus */] = null;\r\n self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = null;\r\n self.responseStartedTime = null;\r\n self[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self[_DYN_TRACE_ID /* @min:%2etraceID */] = traceId;\r\n self[_DYN_SPAN_ID /* @min:%2espanID */] = spanId;\r\n self[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = traceCtx === null || traceCtx === void 0 ? void 0 : traceCtx.getTraceFlags();\r\n if (traceCtx) {\r\n self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */] = {\r\n traceId: traceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */](),\r\n spanId: traceCtx.getSpanId(),\r\n traceFlags: traceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]()\r\n };\r\n }\r\n else {\r\n self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */] = null;\r\n }\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL /* @min:%2erequestUrl */]) : null;\r\n };\r\n self.getPathName = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD /* @min:%2emethod */], self[_DYN_REQUEST_URL /* @min:%2erequestUrl */])) : null;\r\n };\r\n self[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */] = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n var _a;\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = mathRound(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + self[_DYN_SPAN_ID /* @min:%2espanID */],\r\n target: self[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](),\r\n name: self.getPathName(),\r\n type: ajaxType,\r\n startTime: null,\r\n duration: self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */],\r\n success: (+(self[_DYN_STATUS /* @min:%2estatus */])) >= 200 && (+(self[_DYN_STATUS /* @min:%2estatus */])) < 400,\r\n responseCode: (+(self[_DYN_STATUS /* @min:%2estatus */]))\r\n },\r\n _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD /* @min:%2emethod */] },\r\n _a);\r\n var props = dependency[STR_PROPERTIES];\r\n if (self[_DYN_ABORTED /* @min:%2eaborted */]) {\r\n props[_DYN_ABORTED /* @min:%2eaborted */] = true;\r\n }\r\n if (self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]) {\r\n // Set the correct dependency start time\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */] = new Date();\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */].setTime(self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]);\r\n }\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (objKeys(self.requestHeaders)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n props[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */];\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response[_DYN_CORRELATION_CONTEXT /* @min:%2ecorrelationContext */];\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response[_DYN_HEADER_MAP /* @min:%2eheaderMap */]) {\r\n if (objKeys(response.headerMap)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n props.responseHeaders = response[_DYN_HEADER_MAP /* @min:%2eheaderMap */];\r\n }\r\n }\r\n if (self[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */]) {\r\n if (self[_DYN_STATUS /* @min:%2estatus */] >= 400) {\r\n var responseType = response.type;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n props.responseText = response.responseText ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + response[strResponseText] : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n if (responseType === \"json\") {\r\n props.responseText = response.response ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + JSON.stringify(response.response) : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n }\r\n else if (self[_DYN_STATUS /* @min:%2estatus */] === 0) {\r\n props.responseText = response[_DYN_STATUS_TEXT /* @min:%2estatusText */] || \"\";\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n };\r\n self[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */] = function () {\r\n var partA = null;\r\n var traceCtx = self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */];\r\n if (traceCtx && (traceCtx.traceId || traceCtx.spanId)) {\r\n partA = {};\r\n var traceExt = partA[Extensions.TraceExt] = {\r\n traceID: traceCtx.traceId,\r\n parentID: traceCtx.spanId\r\n };\r\n if (!isNullOrUndefined(traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */])) {\r\n traceExt[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n }\r\n }\r\n return partA;\r\n };\r\n });\r\n }\r\n// Removed Stub for ajaxRecord.prototype.getAbsoluteUrl.\r\n// Removed Stub for ajaxRecord.prototype.getPathName.\r\n// Removed Stub for ajaxRecord.prototype.CreateTrackItem.\r\n// Removed Stub for ajaxRecord.prototype.getPartAProps.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n ajaxRecord.__ieDyn=1;\n\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n//# sourceMappingURL=ajaxRecord.js.map","/*\n * Application Insights JavaScript SDK - Dependencies Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar _a;\r\nimport { __assignFn as __assign, __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { DisabledPropertyName, PropertiesPluginIdentifier, RemoteDependencyData, RequestHeaders, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext, createDistributedTraceContextFromTrace, createTelemetryItem, createTraceParent, dateTimeUtilsNow, formatTraceParent, isInternalApplicationInsightsEndpoint } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, InstrumentFunc, InstrumentProto, _throwInternal, arrForEach, createProcessTelemetryContext, createUniqueNamespace, dumpObj, eventOn, generateW3CId, getExceptionName, getGlobal, getIEVersion, getLocation, getPerformance, isFunction, isNullOrUndefined, isString, isXhrSupported, mergeEvtNamespace, onConfigChange, strPrototype, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isWebWorker, objFreeze, scheduleTimeout, strIndexOf, strSplit, strSubstr } from \"@nevware21/ts-utils\";\r\nimport { STR_PROPERTIES } from \"./InternalConstants\";\r\nimport { _DYN_ABORTED, _DYN_AJAX_DIAGNOSTICS_MES14, _DYN_AJAX_PERF_LOOKUP_DEL8, _DYN_CONTEXT, _DYN_CORE, _DYN_CORRELATION_CONTEXT, _DYN_DISABLE_AJAX_TRACKIN7, _DYN_DISABLE_FETCH_TRACKI9, _DYN_ENABLE_AJAX_ERROR_ST3, _DYN_ENABLE_AJAX_PERF_TRA4, _DYN_ENABLE_REQUEST_HEADE2, _DYN_ENABLE_RESPONSE_HEAD10, _DYN_ERROR_STATUS_TEXT, _DYN_EXCLUDE_REQUEST_FROM6, _DYN_GET_ABSOLUTE_URL, _DYN_GET_ALL_RESPONSE_HEA13, _DYN_GET_PART_APROPS, _DYN_GET_TRACE_FLAGS, _DYN_GET_TRACE_ID, _DYN_HEADERS, _DYN_HEADER_MAP, _DYN_INCLUDE_CORRELATION_0, _DYN_LENGTH, _DYN_MAX_AJAX_CALLS_PER_V5, _DYN_METHOD, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE_FINISHED_TI12, _DYN_RESPONSE_TEXT, _DYN_SET_REQUEST_HEADER, _DYN_SPAN_ID, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE11, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN_TRACK_DEPENDENCY_DAT1, _DYN__ADD_HOOK, _DYN__CREATE_TRACK_ITEM } from \"./__DynamicConstants\";\r\nimport { ajaxRecord } from \"./ajaxRecord\";\r\n// const AJAX_MONITOR_PREFIX = \"ai.ajxmn.\";\r\nvar strDiagLog = \"diagLog\";\r\nvar AJAX_DATA_CONTAINER = \"_ajaxData\";\r\nvar STR_FETCH = \"fetch\";\r\nvar ERROR_HEADER = \"Failed to monitor XMLHttpRequest\";\r\nvar ERROR_PREFIX = \", monitoring data for this ajax call \";\r\nvar ERROR_POSTFIX = ERROR_PREFIX + \"may be incorrect.\";\r\nvar ERROR_NOT_SENT = ERROR_PREFIX + \"won't be sent.\";\r\nvar CORRELATION_HEADER_ERROR = \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\";\r\nvar CUSTOM_REQUEST_CONTEXT_ERROR = \"Failed to add custom defined request context as configured call back may missing a null check.\";\r\nvar FAILED_TO_CALCULATE_DURATION_ERROR = \"Failed to calculate the duration of the \";\r\n// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)\r\nvar _markCount = 0;\r\n/** @Ignore */\r\nfunction _supportsFetch() {\r\n var _global = getGlobal();\r\n if (!_global ||\r\n isNullOrUndefined(_global.Request) ||\r\n isNullOrUndefined(_global.Request[strPrototype]) ||\r\n isNullOrUndefined(_global[STR_FETCH])) {\r\n return null;\r\n }\r\n return _global[STR_FETCH];\r\n}\r\n/**\r\n * Determines whether ajax monitoring can be enabled on this document\r\n * @returns True if Ajax monitoring is supported on this page, otherwise false\r\n * @ignore\r\n */\r\nfunction _supportsAjaxMonitoring(ajaxMonitorInstance, ajaxDataId) {\r\n var _a;\r\n var result = false;\r\n if (isXhrSupported()) {\r\n var proto = XMLHttpRequest[strPrototype];\r\n result = !isNullOrUndefined(proto) &&\r\n !isNullOrUndefined(proto.open) && // eslint-disable-line security/detect-non-literal-fs-filename -- false positive\r\n !isNullOrUndefined(proto.send) &&\r\n !isNullOrUndefined(proto.abort);\r\n }\r\n var ieVer = getIEVersion();\r\n if (ieVer && ieVer < 9) {\r\n result = false;\r\n }\r\n if (result) {\r\n // Disable if the XmlHttpRequest can't be extended or hooked\r\n try {\r\n var xhr = new XMLHttpRequest();\r\n var xhrData = {\r\n xh: [],\r\n i: (_a = {},\r\n _a[ajaxDataId] = {},\r\n _a)\r\n };\r\n xhr[AJAX_DATA_CONTAINER] = xhrData;\r\n // Check that we can update the prototype\r\n var theOpen = XMLHttpRequest[strPrototype].open;\r\n XMLHttpRequest[strPrototype].open = theOpen;\r\n }\r\n catch (e) {\r\n // We can't decorate the xhr object so disable monitoring\r\n result = false;\r\n _throwInternalCritical(ajaxMonitorInstance, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to enable XMLHttpRequest monitoring, extension is not supported\", {\r\n exception: dumpObj(e)\r\n });\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Internal helper to fetch the SDK instance tracking data for this XHR request\r\n * @param xhr\r\n * @param ajaxDataId\r\n * @returns\r\n */\r\nvar _getAjaxData = function (xhr, ajaxDataId) {\r\n if (xhr && ajaxDataId && xhr[AJAX_DATA_CONTAINER]) {\r\n return (xhr[AJAX_DATA_CONTAINER].i || {})[ajaxDataId];\r\n }\r\n return null;\r\n};\r\n/**\r\n * @ignore\r\n * Internal helper to track the singleton shared tracking headers, so we can attempt to not create headers\r\n * that might cause an issue if multiple values are populated.\r\n * @param xhr - The instrumented XHR instance\r\n */\r\nvar _addSharedXhrHeaders = function (xhr, name, value) {\r\n if (xhr) {\r\n var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh;\r\n if (headers) {\r\n headers.push({\r\n n: name,\r\n v: value\r\n });\r\n }\r\n }\r\n};\r\nvar _isHeaderSet = function (xhr, name) {\r\n var isPresent = false;\r\n if (xhr) {\r\n var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh;\r\n if (headers) {\r\n arrForEach(headers, function (header) {\r\n if (header.n === name) {\r\n isPresent = true;\r\n return -1;\r\n }\r\n });\r\n }\r\n }\r\n return isPresent;\r\n};\r\n/** @Ignore */\r\nfunction _getFailedAjaxDiagnosticsMessage(xhr, ajaxDataId) {\r\n var result = \"\";\r\n try {\r\n var ajaxData = _getAjaxData(xhr, ajaxDataId);\r\n if (ajaxData && ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */]) {\r\n result += \"(url: '\" + ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] + \"')\";\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n _throwInternal(ajaxMonitorInstance[strDiagLog](), 1 /* eLoggingSeverity.CRITICAL */, msgId, message, properties, isUserAct);\r\n}\r\n/** @ignore */\r\nfunction _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n _throwInternal(ajaxMonitorInstance[strDiagLog](), 2 /* eLoggingSeverity.WARNING */, msgId, message, properties, isUserAct);\r\n}\r\n/** @Ignore */\r\nfunction _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) {\r\n // tslint:disable-next-line\r\n return function (callDetails) {\r\n var _a;\r\n _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(callDetails.inst, ajaxMonitorInstance._ajaxDataId),\r\n _a.exception = dumpObj(callDetails.err),\r\n _a));\r\n };\r\n}\r\nfunction _indexOf(value, match) {\r\n if (value && match) {\r\n return strIndexOf(value, match);\r\n }\r\n return -1;\r\n}\r\nfunction _addHandler(container, id, theFunc) {\r\n var theHandler = {\r\n id: id,\r\n fn: theFunc\r\n };\r\n container.push(theHandler);\r\n return {\r\n remove: function () {\r\n arrForEach(container, function (initializer, idx) {\r\n if (initializer.id === theHandler.id) {\r\n container.splice(idx, 1);\r\n return -1;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nfunction _processDependencyContainer(core, container, details, message) {\r\n var result = true;\r\n arrForEach(container, function (theFunc, idx) {\r\n try {\r\n if (theFunc.fn.call(null, details) === false) {\r\n result = false;\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(core && core.logger, 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"Dependency \" + message + \" [#\" + idx + \"] failed: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n });\r\n return result;\r\n}\r\nfunction _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) {\r\n var initializersCount = listeners[_DYN_LENGTH /* @min:%2elength */];\r\n if (initializersCount > 0) {\r\n var details = {\r\n core: core,\r\n xhr: xhr,\r\n input: input,\r\n init: init,\r\n traceId: ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */],\r\n spanId: ajaxData[_DYN_SPAN_ID /* @min:%2espanID */],\r\n traceFlags: ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */],\r\n context: ajaxData[_DYN_CONTEXT /* @min:%2econtext */] || {},\r\n aborted: !!ajaxData[_DYN_ABORTED /* @min:%2eaborted */]\r\n };\r\n _processDependencyContainer(core, listeners, details, \"listener\");\r\n ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] = details.traceId;\r\n ajaxData[_DYN_SPAN_ID /* @min:%2espanID */] = details.spanId;\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = details[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n ajaxData[_DYN_CONTEXT /* @min:%2econtext */] = details[_DYN_CONTEXT /* @min:%2econtext */];\r\n }\r\n}\r\nvar BLOB_CORE = \"*.blob.core.\";\r\nexport var DfltAjaxCorrelationHeaderExDomains = objFreeze([\r\n BLOB_CORE + \"windows.net\",\r\n BLOB_CORE + \"chinacloudapi.cn\",\r\n BLOB_CORE + \"cloudapi.de\",\r\n BLOB_CORE + \"usgovcloudapi.net\"\r\n]);\r\nvar _internalExcludeEndpoints = [\r\n /https:\\/\\/[^\\/]*(\\.pipe\\.aria|aria\\.pipe|events\\.data|collector\\.azure)\\.[^\\/]+\\/(OneCollector\\/1|Collector\\/3)\\.0/i\r\n];\r\nvar _defaultConfig = objFreeze((_a = {},\r\n _a[_DYN_MAX_AJAX_CALLS_PER_V5 /* @min:maxAjaxCallsPerView */] = 500,\r\n _a[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:disableAjaxTracking */] = false,\r\n _a[_DYN_DISABLE_FETCH_TRACKI9 /* @min:disableFetchTracking */] = false,\r\n _a[_DYN_EXCLUDE_REQUEST_FROM6 /* @min:excludeRequestFromAutoTrackingPatterns */] = undefined,\r\n _a.disableCorrelationHeaders = false,\r\n _a.distributedTracingMode = 1 /* eDistributedTracingModes.AI_AND_W3C */,\r\n _a.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains,\r\n _a.correlationHeaderDomains = undefined,\r\n _a.correlationHeaderExcludePatterns = undefined,\r\n _a.appId = undefined,\r\n _a.enableCorsCorrelation = false,\r\n _a[_DYN_ENABLE_REQUEST_HEADE2 /* @min:enableRequestHeaderTracking */] = false,\r\n _a[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:enableResponseHeaderTracking */] = false,\r\n _a[_DYN_ENABLE_AJAX_ERROR_ST3 /* @min:enableAjaxErrorStatusText */] = false,\r\n _a[_DYN_ENABLE_AJAX_PERF_TRA4 /* @min:enableAjaxPerfTracking */] = false,\r\n _a.maxAjaxPerfLookupAttempts = 3,\r\n _a[_DYN_AJAX_PERF_LOOKUP_DEL8 /* @min:ajaxPerfLookupDelay */] = 25,\r\n _a.ignoreHeaders = [\r\n \"Authorization\",\r\n \"X-API-Key\",\r\n \"WWW-Authenticate\"\r\n ],\r\n _a.addRequestContext = undefined,\r\n _a.addIntEndpoints = true,\r\n _a));\r\nvar AjaxMonitor = /** @class */ (function (_super) {\r\n __extends(AjaxMonitor, _super);\r\n function AjaxMonitor() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AjaxMonitor.identifier;\r\n _this.priority = 120;\r\n var _fetchInitialized; // fetch monitoring initialized\r\n var _xhrInitialized; // XHR monitoring initialized\r\n var _currentWindowHost;\r\n var _extensionConfig;\r\n var _enableRequestHeaderTracking;\r\n var _enableAjaxErrorStatusText;\r\n var _trackAjaxAttempts;\r\n var _context;\r\n var _isUsingW3CHeaders;\r\n var _isUsingAIHeaders;\r\n var _markPrefix;\r\n var _enableAjaxPerfTracking;\r\n var _maxAjaxCallsPerView;\r\n var _enableResponseHeaderTracking;\r\n var _disabledUrls;\r\n var _disableAjaxTracking;\r\n var _disableFetchTracking;\r\n var _excludeRequestFromAutoTrackingPatterns;\r\n var _addRequestContext;\r\n var _evtNamespace;\r\n var _ajaxDataId;\r\n var _dependencyHandlerId;\r\n var _dependencyListeners;\r\n var _dependencyInitializers;\r\n var _ignoreHeaders;\r\n var _maxAjaxPerfLookupAttempts;\r\n var _ajaxPerfLookupDelay;\r\n var _distributedTracingMode;\r\n var _appId;\r\n var _polyfillInitialized;\r\n dynamicProto(AjaxMonitor, _this, function (_self, _base) {\r\n var _addHook = _base[_DYN__ADD_HOOK /* @min:%2e_addHook */];\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_self.isInitialized()) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"ajax\"), core && core.evtNamespace && core.evtNamespace());\r\n _populateDefaults(config);\r\n _instrumentXhr();\r\n _instrumentFetch();\r\n _populateContext();\r\n }\r\n };\r\n _self._doTeardown = function () {\r\n _initDefaults();\r\n };\r\n _self.trackDependencyData = function (dependency, properties) {\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], null, dependency, properties);\r\n };\r\n _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */] = function (ajaxData, input, init, xhr) {\r\n // Test Hook to allow the overriding of the location host\r\n var currentWindowHost = _self[\"_currentWindowHost\"] || _currentWindowHost;\r\n _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, xhr, input, init);\r\n if (input || input === \"\") { // Fetch\r\n if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {\r\n if (!init) {\r\n init = {};\r\n }\r\n // init headers override original request headers\r\n // so, if they exist use only them, otherwise use request's because they should have been applied in the first place\r\n // not using original request headers will result in them being lost\r\n var headers = new Headers(init[_DYN_HEADERS /* @min:%2eheaders */] || (input instanceof Request ? (input[_DYN_HEADERS /* @min:%2eheaders */] || {}) : {}));\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + ajaxData[_DYN_SPAN_ID /* @min:%2espanID */];\r\n headers.set(RequestHeaders[3 /* eRequestHeaders.requestIdHeader */], id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[3 /* eRequestHeaders.requestIdHeader */]] = id;\r\n }\r\n }\r\n var appId = _appId || (_context && _context.appId());\r\n if (appId) {\r\n headers.set(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */], RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]] = RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceFlags = ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n if (isNullOrUndefined(traceFlags)) {\r\n traceFlags = 0x01;\r\n }\r\n var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */], ajaxData[_DYN_SPAN_ID /* @min:%2espanID */], traceFlags));\r\n headers.set(RequestHeaders[4 /* eRequestHeaders.traceParentHeader */], traceParent);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[4 /* eRequestHeaders.traceParentHeader */]] = traceParent;\r\n }\r\n }\r\n init[_DYN_HEADERS /* @min:%2eheaders */] = headers;\r\n }\r\n return init;\r\n }\r\n else if (xhr) { // XHR\r\n if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {\r\n if (_isUsingAIHeaders) {\r\n if (!_isHeaderSet(xhr, RequestHeaders[3 /* eRequestHeaders.requestIdHeader */])) {\r\n var id = \"|\" + ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + ajaxData[_DYN_SPAN_ID /* @min:%2espanID */];\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[3 /* eRequestHeaders.requestIdHeader */], id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[3 /* eRequestHeaders.requestIdHeader */]] = id;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[3 /* eRequestHeaders.requestIdHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n var appId = _appId || (_context && _context.appId());\r\n if (appId) {\r\n if (!_isHeaderSet(xhr, RequestHeaders[0 /* eRequestHeaders.requestContextHeader */])) {\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[0 /* eRequestHeaders.requestContextHeader */], RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]] = RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[0 /* eRequestHeaders.requestContextHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceFlags = ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n if (isNullOrUndefined(traceFlags)) {\r\n traceFlags = 0x01;\r\n }\r\n if (!_isHeaderSet(xhr, RequestHeaders[4 /* eRequestHeaders.traceParentHeader */])) {\r\n var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */], ajaxData[_DYN_SPAN_ID /* @min:%2espanID */], traceFlags));\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[4 /* eRequestHeaders.traceParentHeader */], traceParent);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[4 /* eRequestHeaders.traceParentHeader */]] = traceParent;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[4 /* eRequestHeaders.traceParentHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n }\r\n return xhr;\r\n }\r\n return undefined;\r\n };\r\n _self[_DYN_TRACK_DEPENDENCY_DAT1 /* @min:%2etrackDependencyDataInternal */] = function (dependency, properties, systemProperties) {\r\n if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {\r\n // Hack since expected format in w3c mode is |abc.def.\r\n // Non-w3c format is |abc.def\r\n // @todo Remove if better solution is available, e.g. handle in portal\r\n if ((_distributedTracingMode === 2 /* eDistributedTracingModes.W3C */\r\n || _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */)\r\n && typeof dependency.id === \"string\" && dependency.id[dependency.id[_DYN_LENGTH /* @min:%2elength */] - 1] !== \".\") {\r\n dependency.id += \".\";\r\n }\r\n if (isNullOrUndefined(dependency[_DYN_START_TIME /* @min:%2estartTime */])) {\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */] = new Date();\r\n }\r\n var item = createTelemetryItem(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */].track(item);\r\n }\r\n else if (_trackAjaxAttempts === _maxAjaxCallsPerView) {\r\n _throwInternalCritical(_self, 55 /* _eInternalMessageId.MaxAjaxPerPVExceeded */, \"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.\", true);\r\n }\r\n ++_trackAjaxAttempts;\r\n };\r\n _self.addDependencyListener = function (dependencyListener) {\r\n return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener);\r\n };\r\n _self.addDependencyInitializer = function (dependencyInitializer) {\r\n return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer);\r\n };\r\n function _initDefaults() {\r\n var location = getLocation();\r\n _fetchInitialized = false; // fetch monitoring initialized\r\n _xhrInitialized = false; // XHR monitoring initialized\r\n _polyfillInitialized = false; // polyfill monitoring initialized\r\n _currentWindowHost = location && location.host && location.host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n _extensionConfig = null;\r\n _enableRequestHeaderTracking = false;\r\n _enableAjaxErrorStatusText = false;\r\n _trackAjaxAttempts = 0;\r\n _context = null;\r\n _isUsingW3CHeaders = false;\r\n _isUsingAIHeaders = false;\r\n _markPrefix = null;\r\n _enableAjaxPerfTracking = false;\r\n _maxAjaxCallsPerView = 0;\r\n _enableResponseHeaderTracking = false;\r\n _disabledUrls = {};\r\n _disableAjaxTracking = false;\r\n _disableFetchTracking = false;\r\n _excludeRequestFromAutoTrackingPatterns = null;\r\n _addRequestContext = null;\r\n _evtNamespace = null;\r\n _dependencyHandlerId = 0;\r\n _dependencyListeners = [];\r\n _dependencyInitializers = [];\r\n _ajaxDataId = createUniqueNamespace(\"ajaxData\");\r\n _self._ajaxDataId = _ajaxDataId;\r\n _ignoreHeaders = null;\r\n _maxAjaxPerfLookupAttempts = 1;\r\n _ajaxPerfLookupDelay = 1;\r\n _distributedTracingMode = 1 /* eDistributedTracingModes.AI_AND_W3C */;\r\n _appId = null;\r\n }\r\n function _populateDefaults(config) {\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE /* @min:%2ecore */]);\r\n _extensionConfig = ctx.getExtCfg(AjaxMonitor.identifier, _defaultConfig);\r\n _distributedTracingMode = _extensionConfig.distributedTracingMode;\r\n _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE2 /* @min:%2eenableRequestHeaderTracking */];\r\n _enableAjaxErrorStatusText = _extensionConfig[_DYN_ENABLE_AJAX_ERROR_ST3 /* @min:%2eenableAjaxErrorStatusText */];\r\n _enableAjaxPerfTracking = _extensionConfig[_DYN_ENABLE_AJAX_PERF_TRA4 /* @min:%2eenableAjaxPerfTracking */];\r\n _maxAjaxCallsPerView = _extensionConfig[_DYN_MAX_AJAX_CALLS_PER_V5 /* @min:%2emaxAjaxCallsPerView */];\r\n _excludeRequestFromAutoTrackingPatterns = [].concat(_extensionConfig[_DYN_EXCLUDE_REQUEST_FROM6 /* @min:%2eexcludeRequestFromAutoTrackingPatterns */] || [], _extensionConfig.addIntEndpoints !== false ? _internalExcludeEndpoints : []);\r\n _addRequestContext = _extensionConfig.addRequestContext;\r\n _isUsingAIHeaders = _distributedTracingMode === 0 /* eDistributedTracingModes.AI */ || _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */;\r\n _isUsingW3CHeaders = _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */ || _distributedTracingMode === 2 /* eDistributedTracingModes.W3C */;\r\n if (_enableAjaxPerfTracking) {\r\n _markPrefix = _ajaxDataId;\r\n }\r\n _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:%2edisableAjaxTracking */];\r\n _maxAjaxPerfLookupAttempts = _extensionConfig.maxAjaxPerfLookupAttempts;\r\n _ajaxPerfLookupDelay = _extensionConfig[_DYN_AJAX_PERF_LOOKUP_DEL8 /* @min:%2eajaxPerfLookupDelay */];\r\n _ignoreHeaders = _extensionConfig.ignoreHeaders;\r\n _appId = _extensionConfig.appId;\r\n }));\r\n }\r\n function _populateContext() {\r\n var propExt = _self[_DYN_CORE /* @min:%2ecore */].getPlugin(PropertiesPluginIdentifier);\r\n if (propExt) {\r\n _context = propExt.plugin[_DYN_CONTEXT /* @min:%2econtext */]; // we could move IPropertiesPlugin to common as well\r\n }\r\n }\r\n // discard the header if it's defined as ignoreHeaders in ICorrelationConfig\r\n function _canIncludeHeaders(header) {\r\n var rlt = true;\r\n if (header || _ignoreHeaders) {\r\n arrForEach(_ignoreHeaders, (function (key) {\r\n if (key[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === header[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) {\r\n rlt = false;\r\n return -1;\r\n }\r\n }));\r\n }\r\n return rlt;\r\n }\r\n // Fetch Stuff\r\n function _instrumentFetch() {\r\n var fetch = _supportsFetch();\r\n if (!fetch) {\r\n return;\r\n }\r\n var global = getGlobal();\r\n var isPolyfill = fetch.polyfill;\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extensionConfig, function () {\r\n _disableFetchTracking = !!_extensionConfig[_DYN_DISABLE_FETCH_TRACKI9 /* @min:%2edisableFetchTracking */];\r\n _enableResponseHeaderTracking = _extensionConfig[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:%2eenableResponseHeaderTracking */];\r\n if (!_disableFetchTracking && !_fetchInitialized) {\r\n _addHook(InstrumentFunc(global, STR_FETCH, {\r\n ns: _evtNamespace,\r\n // Add request hook\r\n req: function (callDetails, input, init) {\r\n var fetchData;\r\n if (!_disableFetchTracking && _fetchInitialized &&\r\n !_isDisabledRequest(null, input, init) &&\r\n // If we have a polyfil and XHR instrumented then let XHR report otherwise we get duplicates\r\n !(isPolyfill && _xhrInitialized)) {\r\n var ctx = callDetails.ctx();\r\n fetchData = _createFetchRecord(input, init);\r\n var newInit = _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */](fetchData, input, init);\r\n if (newInit !== init) {\r\n callDetails.set(1, newInit);\r\n }\r\n ctx.data = fetchData;\r\n }\r\n },\r\n rsp: function (callDetails, input) {\r\n if (!_disableFetchTracking) {\r\n var fetchData_1 = callDetails.ctx().data;\r\n if (fetchData_1) {\r\n // Replace the result with the new promise from this code\r\n callDetails.rslt = callDetails.rslt.then(function (response) {\r\n _reportFetchMetrics(callDetails, (response || {})[_DYN_STATUS /* @min:%2estatus */], input, response, fetchData_1, function () {\r\n var _a;\r\n var ajaxResponse = (_a = {\r\n statusText: (response || {})[_DYN_STATUS_TEXT /* @min:%2estatusText */],\r\n headerMap: null\r\n },\r\n _a[_DYN_CORRELATION_CONTEXT /* @min:correlationContext */] = _getFetchCorrelationContext(response),\r\n _a);\r\n if (_enableResponseHeaderTracking && response) {\r\n var responseHeaderMap_1 = {};\r\n response.headers.forEach(function (value, name) {\r\n if (_canIncludeHeaders(name)) {\r\n responseHeaderMap_1[name] = value;\r\n }\r\n });\r\n ajaxResponse[_DYN_HEADER_MAP /* @min:%2eheaderMap */] = responseHeaderMap_1;\r\n }\r\n return ajaxResponse;\r\n });\r\n return response;\r\n })\r\n .catch(function (reason) {\r\n _reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message || dumpObj(reason) });\r\n throw reason;\r\n });\r\n }\r\n }\r\n },\r\n // Create an error callback to report any hook errors\r\n hkErr: _createErrorCallbackFunc(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to monitor Window.fetch\" + ERROR_POSTFIX)\r\n }, true, isWebWorker()));\r\n _fetchInitialized = true;\r\n }\r\n else if (isPolyfill && !_polyfillInitialized) {\r\n // If fetch is a polyfill we need to capture the request to ensure that we correctly track\r\n // disabled request URLS (i.e. internal urls) to ensure we don't end up in a constant loop\r\n // of reporting ourselves, for example React Native uses a polyfill for fetch\r\n // Note: Polyfill implementations that don't support the \"polyfill\" tag are not supported\r\n // the workaround is to add a polyfill property to your fetch implementation before initializing\r\n // App Insights\r\n _addHook(InstrumentFunc(global, STR_FETCH, {\r\n ns: _evtNamespace,\r\n req: function (callDetails, input, init) {\r\n // Just call so that we record any disabled URL\r\n _isDisabledRequest(null, input, init);\r\n }\r\n }));\r\n _polyfillInitialized = true;\r\n }\r\n }));\r\n if (isPolyfill) {\r\n // retag the instrumented fetch with the same polyfill settings this is mostly for testing\r\n // But also supports multiple App Insights usages\r\n global[STR_FETCH].polyfill = isPolyfill;\r\n }\r\n }\r\n function _hookProto(target, funcName, callbacks) {\r\n _addHook(InstrumentProto(target, funcName, callbacks));\r\n }\r\n function _instrumentXhr() {\r\n if (!_supportsAjaxMonitoring(_self, _ajaxDataId)) {\r\n return;\r\n }\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extensionConfig, function () {\r\n _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:%2edisableAjaxTracking */];\r\n _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE2 /* @min:%2eenableRequestHeaderTracking */];\r\n if (!_disableAjaxTracking && !_xhrInitialized) {\r\n // Instrument open\r\n _hookProto(XMLHttpRequest, \"open\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, method, url, async) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, ajaxData, true)) {\r\n if (!ajaxData || !ajaxData.xhrMonitoringState.openDone) {\r\n // Only create a single ajaxData (even when multiple AI instances are running)\r\n ajaxData = _openHandler(xhr, method, url, async);\r\n }\r\n // always attach to the on ready state change (required for handling multiple instances)\r\n _attachToOnReadyStateChange(xhr, ajaxData);\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, ERROR_HEADER + \".open\" + ERROR_POSTFIX)\r\n });\r\n // Instrument send\r\n _hookProto(XMLHttpRequest, \"send\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, context) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState.sendDone) {\r\n _createMarkId(\"xhr\", ajaxData);\r\n ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();\r\n _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */](ajaxData, undefined, undefined, xhr);\r\n ajaxData.xhrMonitoringState.sendDone = true;\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 17 /* _eInternalMessageId.FailedMonitorAjaxSend */, ERROR_HEADER + ERROR_POSTFIX)\r\n });\r\n // Instrument abort\r\n _hookProto(XMLHttpRequest, \"abort\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState.abortDone) {\r\n ajaxData[_DYN_ABORTED /* @min:%2eaborted */] = 1;\r\n ajaxData.xhrMonitoringState.abortDone = true;\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 13 /* _eInternalMessageId.FailedMonitorAjaxAbort */, ERROR_HEADER + \".abort\" + ERROR_POSTFIX)\r\n });\r\n // Instrument setRequestHeader\r\n _hookProto(XMLHttpRequest, \"setRequestHeader\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, header, value) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (ajaxData && _isMonitoredXhrInstance(xhr, ajaxData)) {\r\n _addSharedXhrHeaders(xhr, header, value);\r\n if (_enableRequestHeaderTracking && _canIncludeHeaders(header)) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][header] = value;\r\n }\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, ERROR_HEADER + \".setRequestHeader\" + ERROR_POSTFIX)\r\n });\r\n _xhrInitialized = true;\r\n }\r\n }));\r\n }\r\n function _isDisabledRequest(xhr, request, init) {\r\n var isDisabled = false;\r\n var theUrl = ((!isString(request) ? (request || {}).url || \"\" : request) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n // check excludeRequestFromAutoTrackingPatterns before stripping off any query string\r\n arrForEach(_excludeRequestFromAutoTrackingPatterns, function (regex) {\r\n var theRegex = regex;\r\n if (isString(regex)) {\r\n theRegex = new RegExp(regex);\r\n }\r\n if (!isDisabled) {\r\n isDisabled = theRegex.test(theUrl);\r\n }\r\n });\r\n // if request url matches with exclude regex pattern, return true and no need to check for headers\r\n if (isDisabled) {\r\n return isDisabled;\r\n }\r\n var idx = _indexOf(theUrl, \"?\");\r\n var idx2 = _indexOf(theUrl, \"#\");\r\n if (idx === -1 || (idx2 !== -1 && idx2 < idx)) {\r\n idx = idx2;\r\n }\r\n if (idx !== -1) {\r\n // Strip off any Query string\r\n theUrl = theUrl.substring(0, idx);\r\n }\r\n // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector\r\n if (!isNullOrUndefined(xhr)) {\r\n // Look on the XMLHttpRequest of the URL string value\r\n isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true;\r\n }\r\n else if (!isNullOrUndefined(request)) { // fetch\r\n // Look for DisabledPropertyName in either Request or RequestInit\r\n isDisabled = (typeof request === \"object\" ? request[DisabledPropertyName] === true : false) ||\r\n (init ? init[DisabledPropertyName] === true : false);\r\n }\r\n // Also add extra check just in case the XHR or fetch objects where not decorated with the DisableProperty due to sealing or freezing\r\n if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) {\r\n isDisabled = true;\r\n }\r\n if (isDisabled) {\r\n // Add the disabled url if not present\r\n if (!_disabledUrls[theUrl]) {\r\n _disabledUrls[theUrl] = 1;\r\n }\r\n }\r\n else {\r\n // Check to see if the url is listed as disabled\r\n if (_disabledUrls[theUrl]) {\r\n isDisabled = true;\r\n }\r\n }\r\n return isDisabled;\r\n }\r\n /// Verifies that particular instance of XMLHttpRequest needs to be monitored\r\n /// Optional parameter. True if ajaxData must be excluded from verification\r\n /// True if instance needs to be monitored, otherwise false\r\n function _isMonitoredXhrInstance(xhr, ajaxData, excludeAjaxDataValidation) {\r\n var ajaxValidation = true;\r\n var initialized = _xhrInitialized;\r\n if (!isNullOrUndefined(xhr)) {\r\n ajaxValidation = excludeAjaxDataValidation === true || !isNullOrUndefined(ajaxData);\r\n }\r\n // checking to see that all interested functions on xhr were instrumented\r\n return initialized\r\n // checking on ajaxData to see that it was not removed in user code\r\n && ajaxValidation;\r\n }\r\n function _getDistributedTraceCtx() {\r\n var distributedTraceCtx = null;\r\n if (_self[_DYN_CORE /* @min:%2ecore */] && _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx) {\r\n distributedTraceCtx = _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx(false);\r\n }\r\n // Fall back\r\n if (!distributedTraceCtx && _context && _context.telemetryTrace) {\r\n distributedTraceCtx = createDistributedTraceContextFromTrace(_context.telemetryTrace);\r\n }\r\n return distributedTraceCtx;\r\n }\r\n function _openHandler(xhr, method, url, async) {\r\n var _a;\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();\r\n var spanID = strSubstr(generateW3CId(), 0, 16);\r\n var xhrRequestData = xhr[AJAX_DATA_CONTAINER] = (xhr[AJAX_DATA_CONTAINER] || { xh: [], i: {} });\r\n var ajaxDataCntr = xhrRequestData.i = (xhrRequestData.i || {});\r\n var ajaxData = ajaxDataCntr[_ajaxDataId] = (ajaxDataCntr[_ajaxDataId] || new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()));\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();\r\n ajaxData[_DYN_METHOD /* @min:%2emethod */] = method;\r\n ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = url;\r\n ajaxData.xhrMonitoringState.openDone = true;\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = {};\r\n ajaxData.async = async;\r\n ajaxData[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */] = _enableAjaxErrorStatusText;\r\n return ajaxData;\r\n }\r\n function _attachToOnReadyStateChange(xhr, ajaxData) {\r\n ajaxData.xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE11 /* @min:%2estateChangeAttached */] = eventOn(xhr, \"readystatechange\", function () {\r\n var _a;\r\n try {\r\n if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr, ajaxData)) {\r\n _onAjaxComplete(xhr);\r\n }\r\n }\r\n catch (e) {\r\n var exceptionText = dumpObj(e);\r\n // ignore messages with c00c023f, as this a known IE9 XHR abort issue\r\n if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), \"c00c023f\") === -1) {\r\n _throwInternalCritical(_self, 16 /* _eInternalMessageId.FailedMonitorAjaxRSC */, ERROR_HEADER + \" 'readystatechange' event handler\" + ERROR_POSTFIX, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId),\r\n _a.exception = exceptionText,\r\n _a));\r\n }\r\n }\r\n }, _evtNamespace);\r\n }\r\n function _getResponseText(xhr) {\r\n try {\r\n var responseType = xhr.responseType;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n // As per the specification responseText is only valid if the type is an empty string or \"text\"\r\n return xhr[_DYN_RESPONSE_TEXT /* @min:%2eresponseText */];\r\n }\r\n }\r\n catch (e) {\r\n // This shouldn't happen because of the above check -- but just in case, so just ignore\r\n }\r\n return null;\r\n }\r\n function _onAjaxComplete(xhr) {\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_STATUS /* @min:%2estatus */] = xhr[_DYN_STATUS /* @min:%2estatus */];\r\n function _reportXhrError(e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"ajaxDiagnosticsMessage\"] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId);\r\n if (e) {\r\n errorProps[\"exception\"] = dumpObj(e);\r\n }\r\n _throwInternalWarning(_self, 14 /* _eInternalMessageId.FailedMonitorAjaxDur */, FAILED_TO_CALCULATE_DURATION_ERROR + \"ajax call\" + ERROR_NOT_SENT, errorProps);\r\n }\r\n _findPerfResourceEntry(\"xmlhttprequest\", ajaxData, function () {\r\n try {\r\n var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */](\"Ajax\", _enableRequestHeaderTracking, function () {\r\n var _a;\r\n var ajaxResponse = (_a = {\r\n statusText: xhr[_DYN_STATUS_TEXT /* @min:%2estatusText */],\r\n headerMap: null\r\n },\r\n _a[_DYN_CORRELATION_CONTEXT /* @min:correlationContext */] = _getAjaxCorrelationContext(xhr),\r\n _a.type = xhr.responseType,\r\n _a[_DYN_RESPONSE_TEXT /* @min:responseText */] = _getResponseText(xhr),\r\n _a.response = xhr.response,\r\n _a);\r\n if (_enableResponseHeaderTracking) {\r\n var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA13 /* @min:%2egetAllResponseHeaders */]();\r\n if (headers) {\r\n // xhr.getAllResponseHeaders() method returns all the response headers, separated by CRLF, as a string or null\r\n // the regex converts the header string into an array of individual headers\r\n var arr = strTrim(headers).split(/[\\r\\n]+/);\r\n var responseHeaderMap_2 = {};\r\n arrForEach(arr, function (line) {\r\n var parts = line.split(\": \");\r\n var header = parts.shift();\r\n var value = parts.join(\": \");\r\n if (_canIncludeHeaders(header)) {\r\n responseHeaderMap_2[header] = value;\r\n }\r\n });\r\n ajaxResponse[_DYN_HEADER_MAP /* @min:%2eheaderMap */] = responseHeaderMap_2;\r\n }\r\n }\r\n return ajaxResponse;\r\n });\r\n var properties = void 0;\r\n try {\r\n if (!!_addRequestContext) {\r\n properties = _addRequestContext({ status: xhr[_DYN_STATUS /* @min:%2estatus */], xhr: xhr });\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 104 /* _eInternalMessageId.FailedAddingCustomDefinedRequestContext */, CUSTOM_REQUEST_CONTEXT_ERROR);\r\n }\r\n if (dependency) {\r\n if (properties !== undefined) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);\r\n }\r\n var sysProperties = ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]();\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, dependency, null, sysProperties);\r\n }\r\n else {\r\n _reportXhrError(null, {\r\n requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],\r\n responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */]\r\n });\r\n }\r\n }\r\n finally {\r\n // cleanup telemetry data\r\n try {\r\n var xhrRequestData = (xhr[AJAX_DATA_CONTAINER] || { i: {} });\r\n var ajaxDataCntr = (xhrRequestData.i || {});\r\n if (ajaxDataCntr[_ajaxDataId]) {\r\n ajaxDataCntr[_ajaxDataId] = null;\r\n }\r\n }\r\n catch (e) {\r\n // May throw in environments that prevent extension or freeze xhr\r\n }\r\n }\r\n }, function (e) {\r\n _reportXhrError(e, null);\r\n });\r\n }\r\n function _getAjaxCorrelationContext(xhr) {\r\n var _a;\r\n try {\r\n var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA13 /* @min:%2egetAllResponseHeaders */]();\r\n if (responseHeadersString !== null) {\r\n var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), RequestHeaders[8 /* eRequestHeaders.requestContextHeaderLowerCase */]);\r\n if (index !== -1) {\r\n var responseHeader = xhr.getResponseHeader(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);\r\n return correlationIdGetCorrelationContext(responseHeader);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, CORRELATION_HEADER_ERROR, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId),\r\n _a.exception = dumpObj(e),\r\n _a));\r\n }\r\n }\r\n function _createMarkId(type, ajaxData) {\r\n if (ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] && _markPrefix && _enableAjaxPerfTracking) {\r\n var performance_1 = getPerformance();\r\n if (performance_1 && isFunction(performance_1.mark)) {\r\n _markCount++;\r\n var markId = _markPrefix + type + \"#\" + _markCount;\r\n performance_1.mark(markId);\r\n var entries = performance_1.getEntriesByName(markId);\r\n if (entries && entries[_DYN_LENGTH /* @min:%2elength */] === 1) {\r\n ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */] = entries[0];\r\n }\r\n }\r\n }\r\n }\r\n function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) {\r\n var perfMark = ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */];\r\n var performance = getPerformance();\r\n var maxAttempts = _maxAjaxPerfLookupAttempts;\r\n var retryDelay = _ajaxPerfLookupDelay;\r\n var requestUrl = ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */];\r\n var attempt = 0;\r\n (function locateResourceTiming() {\r\n try {\r\n if (performance && perfMark) {\r\n attempt++;\r\n var perfTiming = null;\r\n var entries = performance.getEntries();\r\n for (var lp = entries[_DYN_LENGTH /* @min:%2elength */] - 1; lp >= 0; lp--) {\r\n var entry = entries[lp];\r\n if (entry) {\r\n if (entry.entryType === \"resource\") {\r\n if (entry.initiatorType === initiatorType &&\r\n (_indexOf(entry.name, requestUrl) !== -1 || _indexOf(requestUrl, entry.name) !== -1)) {\r\n perfTiming = entry;\r\n }\r\n }\r\n else if (entry.entryType === \"mark\" && entry.name === perfMark.name) {\r\n // We hit the start event\r\n ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */] = perfTiming;\r\n break;\r\n }\r\n if (entry[_DYN_START_TIME /* @min:%2estartTime */] < perfMark[_DYN_START_TIME /* @min:%2estartTime */] - 1000) {\r\n // Fallback to try and reduce the time spent looking for the perf entry\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!perfMark || // - we don't have a perfMark or\r\n ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */] || // - we have not found the perf entry or\r\n attempt >= maxAttempts || // - we have tried too many attempts or\r\n ajaxData.async === false) { // - this is a sync request\r\n if (perfMark && isFunction(performance.clearMarks)) {\r\n // Remove the mark so we don't fill up the performance resources too much\r\n performance.clearMarks(perfMark.name);\r\n }\r\n ajaxData.perfAttempts = attempt;\r\n // just continue and report the track event\r\n trackCallback();\r\n }\r\n else {\r\n // We need to wait for the browser to populate the window.performance entry\r\n // This needs to be at least 1ms as waiting <= 1 (on firefox) is not enough time for fetch or xhr,\r\n // this is a scheduling issue for the browser implementation\r\n scheduleTimeout(locateResourceTiming, retryDelay);\r\n }\r\n }\r\n catch (e) {\r\n reportError(e);\r\n }\r\n })();\r\n }\r\n function _createFetchRecord(input, init) {\r\n var _a;\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();\r\n var spanID = strSubstr(generateW3CId(), 0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx());\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();\r\n ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */] = _enableAjaxErrorStatusText;\r\n var requestUrl;\r\n if (input instanceof Request) {\r\n requestUrl = (input || {}).url || \"\";\r\n }\r\n else {\r\n requestUrl = input;\r\n }\r\n if (requestUrl === \"\") {\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.href) {\r\n requestUrl = strSplit(location_1.href, \"#\")[0];\r\n }\r\n }\r\n ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = requestUrl;\r\n var method = \"GET\";\r\n if (init && init[_DYN_METHOD /* @min:%2emethod */]) {\r\n method = init[_DYN_METHOD /* @min:%2emethod */];\r\n }\r\n else if (input && input instanceof Request) {\r\n method = input[_DYN_METHOD /* @min:%2emethod */];\r\n }\r\n ajaxData[_DYN_METHOD /* @min:%2emethod */] = method;\r\n var requestHeaders = {};\r\n if (_enableRequestHeaderTracking) {\r\n var headers = new Headers((init ? init[_DYN_HEADERS /* @min:%2eheaders */] : 0) || (input instanceof Request ? (input[_DYN_HEADERS /* @min:%2eheaders */] || {}) : {}));\r\n headers.forEach(function (value, key) {\r\n if (_canIncludeHeaders(key)) {\r\n requestHeaders[key] = value;\r\n }\r\n });\r\n }\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = requestHeaders;\r\n _createMarkId(STR_FETCH, ajaxData);\r\n return ajaxData;\r\n }\r\n function _getFailedFetchDiagnosticsMessage(input) {\r\n var result = \"\";\r\n try {\r\n if (!isNullOrUndefined(input)) {\r\n if (typeof (input) === \"string\") {\r\n result += \"(url: '\".concat(input, \"')\");\r\n }\r\n else {\r\n result += \"(url: '\".concat(input.url, \"')\");\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalCritical(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to grab failed fetch diagnostics message\", { exception: dumpObj(e) });\r\n }\r\n return result;\r\n }\r\n function _reportFetchMetrics(callDetails, status, input, response, ajaxData, getResponse, properties) {\r\n if (!ajaxData) {\r\n return;\r\n }\r\n function _reportFetchError(msgId, e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"fetchDiagnosticsMessage\"] = _getFailedFetchDiagnosticsMessage(input);\r\n if (e) {\r\n errorProps[\"exception\"] = dumpObj(e);\r\n }\r\n _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + \"fetch call\" + ERROR_NOT_SENT, errorProps);\r\n }\r\n ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_STATUS /* @min:%2estatus */] = status;\r\n _findPerfResourceEntry(STR_FETCH, ajaxData, function () {\r\n var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */](\"Fetch\", _enableRequestHeaderTracking, getResponse);\r\n var properties;\r\n try {\r\n if (!!_addRequestContext) {\r\n properties = _addRequestContext({ status: status, request: input, response: response });\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 104 /* _eInternalMessageId.FailedAddingCustomDefinedRequestContext */, CUSTOM_REQUEST_CONTEXT_ERROR);\r\n }\r\n if (dependency) {\r\n if (properties !== undefined) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);\r\n }\r\n var sysProperties = ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]();\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, dependency, null, sysProperties);\r\n }\r\n else {\r\n _reportFetchError(14 /* _eInternalMessageId.FailedMonitorAjaxDur */, null, {\r\n requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],\r\n responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */]\r\n });\r\n }\r\n }, function (e) {\r\n _reportFetchError(18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, e, null);\r\n });\r\n }\r\n function _getFetchCorrelationContext(response) {\r\n if (response && response[_DYN_HEADERS /* @min:%2eheaders */]) {\r\n try {\r\n var responseHeader = response[_DYN_HEADERS /* @min:%2eheaders */].get(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);\r\n return correlationIdGetCorrelationContext(responseHeader);\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, CORRELATION_HEADER_ERROR, {\r\n fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response),\r\n exception: dumpObj(e)\r\n });\r\n }\r\n }\r\n }\r\n function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) {\r\n var result = true;\r\n var initializersCount = initializers[_DYN_LENGTH /* @min:%2elength */];\r\n if (initializersCount > 0) {\r\n var details = {\r\n item: dependency,\r\n properties: properties,\r\n sysProperties: systemProperties,\r\n context: ajaxData ? ajaxData[_DYN_CONTEXT /* @min:%2econtext */] : null,\r\n aborted: ajaxData ? !!ajaxData[_DYN_ABORTED /* @min:%2eaborted */] : false\r\n };\r\n result = _processDependencyContainer(core, initializers, details, \"initializer\");\r\n }\r\n if (result) {\r\n _self[_DYN_TRACK_DEPENDENCY_DAT1 /* @min:%2etrackDependencyDataInternal */](dependency, properties, systemProperties);\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for AjaxMonitor.prototype.initialize.\r\n AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) {\r\n this.processNext(item, itemCtx);\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyData.\r\n// Removed Stub for AjaxMonitor.prototype.includeCorrelationHeaders.\r\n// Removed Stub for AjaxMonitor.prototype.addDependencyListener.\r\n /**\r\n * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.\r\n * It is called after the dependency call has completed and any available performance details are available. A dependency\r\n * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency\r\n * request so that it doesn't count against the `maxAjaxCallsPerView`.\r\n * @param dependencyInitializer - The Dependency Telemetry Initializer function\r\n * @returns - A IDependencyInitializerHandler to enable the initializer to be removed\r\n */\r\n AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) {\r\n return null;\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyDataInternal.\r\n AjaxMonitor.identifier = \"AjaxDependencyPlugin\";\r\n return AjaxMonitor;\r\n}(BaseTelemetryPlugin));\r\nexport { AjaxMonitor };\r\n//# sourceMappingURL=ajax.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar Application = /** @class */ (function () {\r\n function Application() {\r\n }\r\n return Application;\r\n}());\r\nexport { Application };\r\n//# sourceMappingURL=Application.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar Device = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the Device class\r\n */\r\n function Device() {\r\n // don't attempt to fingerprint browsers\r\n this.id = \"browser\";\r\n // Device type is a dimension in our data platform\r\n // Setting it to 'Browser' allows to separate client and server dependencies/exceptions\r\n this.deviceClass = \"Browser\";\r\n }\r\n return Device;\r\n}());\r\nexport { Device };\r\n//# sourceMappingURL=Device.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { onConfigChange } from \"@microsoft/applicationinsights-core-js\";\r\nvar Version = '3.3.6';\r\nvar Internal = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the internal telemetry data class.\r\n */\r\n function Internal(config, unloadHookContainer) {\r\n var _this = this;\r\n var unloadHook = onConfigChange((config), function () {\r\n var prefix = config.sdkExtension;\r\n _this.sdkVersion = (prefix ? prefix + \"_\" : \"\") + \"javascript:\" + Version;\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nvar Location = /** @class */ (function () {\r\n function Location() {\r\n }\r\n return Location;\r\n}());\r\nexport { Location };\r\n//# sourceMappingURL=Location.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_SESSION = \"session\"; // Count: 4\r\nexport var _DYN_SESSION_MANAGER = \"sessionManager\"; // Count: 3\r\nexport var _DYN_IS_USER_COOKIE_SET = \"isUserCookieSet\"; // Count: 4\r\nexport var _DYN_IS_NEW_USER = \"isNewUser\"; // Count: 4\r\nexport var _DYN_GET_TRACE_CTX = \"getTraceCtx\"; // Count: 3\r\nexport var _DYN_TELEMETRY_TRACE = \"telemetryTrace\"; // Count: 3\r\nexport var _DYN_APPLY_SESSION_CONTEX0 = \"applySessionContext\"; // Count: 2\r\nexport var _DYN_APPLY_APPLICATION_CO1 = \"applyApplicationContext\"; // Count: 2\r\nexport var _DYN_APPLY_OPERATION_CONT2 = \"applyOperationContext\"; // Count: 2\r\nexport var _DYN_APPLY_OPERATING_SYST3 = \"applyOperatingSystemContxt\"; // Count: 2\r\nexport var _DYN_APPLY_LOCATION_CONTE4 = \"applyLocationContext\"; // Count: 2\r\nexport var _DYN_APPLY_INTERNAL_CONTE5 = \"applyInternalContext\"; // Count: 2\r\nexport var _DYN_GET_SESSION_ID = \"getSessionId\"; // Count: 4\r\nexport var _DYN_SESSION_COOKIE_POSTF6 = \"sessionCookiePostfix\"; // Count: 2\r\nexport var _DYN_AUTOMATIC_SESSION = \"automaticSession\"; // Count: 6\r\nexport var _DYN_ACCOUNT_ID = \"accountId\"; // Count: 6\r\nexport var _DYN_AUTHENTICATED_ID = \"authenticatedId\"; // Count: 6\r\nexport var _DYN_ACQUISITION_DATE = \"acquisitionDate\"; // Count: 5\r\nexport var _DYN_RENEWAL_DATE = \"renewalDate\"; // Count: 4\r\nexport var _DYN_COOKIE_SEPARATOR = \"cookieSeparator\"; // Count: 5\r\nexport var _DYN_AUTH_USER_COOKIE_NAM7 = \"authUserCookieName\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, dateNow, dumpObj, getExceptionName, isFunction, newId, onConfigChange, safeGetCookieMgr, safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_ACQUISITION_DATE, _DYN_AUTOMATIC_SESSION, _DYN_RENEWAL_DATE, _DYN_SESSION_COOKIE_POSTF6 } from \"../__DynamicConstants\";\r\nvar SESSION_COOKIE_NAME = \"ai_session\";\r\nvar ACQUISITION_SPAN = 86400000; // 24 hours in ms\r\nvar RENEWAL_SPAN = 1800000; // 30 minutes in ms\r\nvar COOKIE_UPDATE_INTERVAL = 60000; // 1 minute in ms\r\nvar Session = /** @class */ (function () {\r\n function Session() {\r\n }\r\n return Session;\r\n}());\r\nexport { Session };\r\nvar _SessionManager = /** @class */ (function () {\r\n function _SessionManager(config, core, unloadHookContainer) {\r\n var self = this;\r\n var _storageNamePrefix;\r\n var _cookieUpdatedTimestamp;\r\n var _logger = safeGetLogger(core);\r\n var _cookieManager = safeGetCookieMgr(core);\r\n var _sessionExpirationMs;\r\n var _sessionRenewalMs;\r\n dynamicProto(_SessionManager, self, function (_self) {\r\n if (!config) {\r\n config = {};\r\n }\r\n var unloadHook = onConfigChange(config, function (details) {\r\n _sessionExpirationMs = config.sessionExpirationMs || ACQUISITION_SPAN;\r\n _sessionRenewalMs = config.sessionRenewalMs || RENEWAL_SPAN;\r\n // sessionCookiePostfix takes the preference if it is configured, otherwise takes namePrefix if configured.\r\n var sessionCookiePostfix = config[_DYN_SESSION_COOKIE_POSTF6 /* @min:%2esessionCookiePostfix */] || config.namePrefix || \"\";\r\n _storageNamePrefix = SESSION_COOKIE_NAME + sessionCookiePostfix;\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */] = new Session();\r\n _self.update = function () {\r\n // Always using Date getTime() as there is a bug in older IE instances that causes the performance timings to have the hi-bit set eg 0x800000000 causing\r\n // the number to be incorrect.\r\n var nowMs = dateNow();\r\n var isExpired = false;\r\n var session = _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n if (!session.id) {\r\n isExpired = !_initializeAutomaticSession(session, nowMs);\r\n }\r\n if (!isExpired && _sessionExpirationMs > 0) {\r\n var timeSinceAcqMs = nowMs - session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */];\r\n var timeSinceRenewalMs = nowMs - session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */];\r\n isExpired = timeSinceAcqMs < 0 || timeSinceRenewalMs < 0; // expired if the acquisition or last renewal are in the future\r\n isExpired = isExpired || timeSinceAcqMs > _sessionExpirationMs; // expired if the time since acquisition is more than session Expiration\r\n isExpired = isExpired || timeSinceRenewalMs > _sessionRenewalMs; // expired if the time since last renewal is more than renewal period\r\n }\r\n // renew if acquisitionSpan or renewalSpan has elapsed\r\n if (isExpired) {\r\n // update automaticSession so session state has correct id\r\n _renew(nowMs);\r\n }\r\n else {\r\n // do not update the cookie more often than cookieUpdateInterval\r\n if (!_cookieUpdatedTimestamp || nowMs - _cookieUpdatedTimestamp > COOKIE_UPDATE_INTERVAL) {\r\n _setCookie(session, nowMs);\r\n }\r\n }\r\n };\r\n /**\r\n * Record the current state of the automatic session and store it in our cookie string format\r\n * into the browser's local storage. This is used to restore the session data when the cookie\r\n * expires.\r\n */\r\n _self.backup = function () {\r\n var session = _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n _setStorage(session.id, session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */], session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */]);\r\n };\r\n /**\r\n * Use config.namePrefix + ai_session cookie data or local storage data (when the cookie is unavailable) to\r\n * initialize the automatic session.\r\n * @returns true if values set otherwise false\r\n */\r\n function _initializeAutomaticSession(session, now) {\r\n var isValid = false;\r\n var cookieValue = _cookieManager.get(_storageNamePrefix);\r\n if (cookieValue && isFunction(cookieValue.split)) {\r\n isValid = _initializeAutomaticSessionWithData(session, cookieValue);\r\n }\r\n else {\r\n // There's no cookie, but we might have session data in local storage\r\n // This can happen if the session expired or the user actively deleted the cookie\r\n // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively.\r\n // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed.\r\n var storageValue = utlGetLocalStorage(_logger, _storageNamePrefix);\r\n if (storageValue) {\r\n isValid = _initializeAutomaticSessionWithData(session, storageValue);\r\n }\r\n }\r\n return isValid || !!session.id;\r\n }\r\n /**\r\n * Extract id, acquisitionDate, and renewalDate from an ai_session payload string and\r\n * use this data to initialize automaticSession.\r\n *\r\n * @param sessionData - The string stored in an ai_session cookie or local storage backup\r\n * @returns true if values set otherwise false\r\n */\r\n function _initializeAutomaticSessionWithData(session, sessionData) {\r\n var isValid = false;\r\n var sessionReset = \", session will be reset\";\r\n var tokens = sessionData.split(\"|\");\r\n if (tokens.length >= 2) {\r\n try {\r\n var acqMs = +tokens[1] || 0;\r\n var renewalMs = +tokens[2] || 0;\r\n if (isNaN(acqMs) || acqMs <= 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 27 /* _eInternalMessageId.SessionRenewalDateIsZero */, \"AI session acquisition date is 0\" + sessionReset);\r\n }\r\n else if (isNaN(renewalMs) || renewalMs <= 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 27 /* _eInternalMessageId.SessionRenewalDateIsZero */, \"AI session renewal date is 0\" + sessionReset);\r\n }\r\n else if (tokens[0]) {\r\n // Everything looks valid so set the values\r\n session.id = tokens[0];\r\n session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */] = acqMs;\r\n session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */] = renewalMs;\r\n isValid = true;\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 9 /* _eInternalMessageId.ErrorParsingAISessionCookie */, \"Error parsing ai_session value [\" + (sessionData || \"\") + \"]\" + sessionReset + \" - \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return isValid;\r\n }\r\n function _renew(nowMs) {\r\n var getNewId = config.getNewId || newId;\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */].id = getNewId(config.idLength || 22);\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */][_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */] = nowMs;\r\n _setCookie(_self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */], nowMs);\r\n // If this browser does not support local storage, fire an internal log to keep track of it at this point\r\n if (!utlCanUseLocalStorage()) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 0 /* _eInternalMessageId.BrowserDoesNotSupportLocalStorage */, \"Browser does not support local storage. Session durations will be inaccurate.\");\r\n }\r\n }\r\n function _setCookie(session, nowMs) {\r\n var acq = session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */];\r\n session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */] = nowMs;\r\n var renewalPeriodMs = _sessionRenewalMs;\r\n // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner\r\n // Expiring the cookie will cause the session to expire even if the user isn't on the page\r\n var acqTimeLeftMs = (acq + _sessionExpirationMs) - nowMs;\r\n var cookie = [session.id, acq, nowMs];\r\n var maxAgeSec = 0;\r\n if (acqTimeLeftMs < renewalPeriodMs) {\r\n maxAgeSec = acqTimeLeftMs / 1000;\r\n }\r\n else {\r\n maxAgeSec = renewalPeriodMs / 1000;\r\n }\r\n var cookieDomain = config.cookieDomain || null;\r\n // if sessionExpirationMs is set to 0, it means the expiry is set to 0 for this session cookie\r\n // A cookie with 0 expiry in the session cookie will never expire for that browser session. If the browser is closed the cookie expires.\r\n // Depending on the browser, another instance does not inherit this cookie, however, another tab will\r\n _cookieManager.set(_storageNamePrefix, cookie.join(\"|\"), _sessionExpirationMs > 0 ? maxAgeSec : null, cookieDomain);\r\n _cookieUpdatedTimestamp = nowMs;\r\n }\r\n function _setStorage(guid, acq, renewal) {\r\n // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires\r\n // Browsers that don't support local storage won't be able to end sessions cleanly from the client\r\n // The server will notice this and end the sessions itself, with loss of accurate session duration\r\n utlSetLocalStorage(_logger, _storageNamePrefix, [guid, acq, renewal].join(\"|\"));\r\n }\r\n });\r\n }\r\n// Removed Stub for _SessionManager.prototype.update.\r\n// Removed Stub for _SessionManager.prototype.backup.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n _SessionManager.__ieDyn=1;\n\n return _SessionManager;\r\n}());\r\nexport { _SessionManager };\r\n//# sourceMappingURL=Session.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { generateW3CId, getLocation } from \"@microsoft/applicationinsights-core-js\";\r\nvar TelemetryTrace = /** @class */ (function () {\r\n function TelemetryTrace(id, parentId, name, logger) {\r\n var _self = this;\r\n _self.traceID = id || generateW3CId();\r\n _self.parentID = parentId;\r\n var location = getLocation();\r\n if (!name && location && location.pathname) {\r\n name = location.pathname;\r\n }\r\n _self.name = dataSanitizeString(logger, name);\r\n }\r\n return TelemetryTrace;\r\n}());\r\nexport { TelemetryTrace };\r\n//# sourceMappingURL=TelemetryTrace.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlRemoveStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, newId, onConfigChange, safeGetCookieMgr, safeGetLogger, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_AUTHENTICATED_ID, _DYN_AUTH_USER_COOKIE_NAM7, _DYN_COOKIE_SEPARATOR, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET } from \"../__DynamicConstants\";\r\nfunction _validateUserInput(id) {\r\n // Validate:\r\n // 1. Id is a non-empty string.\r\n // 2. It does not contain special characters for cookies.\r\n if (typeof id !== \"string\" ||\r\n !id ||\r\n id.match(/,|;|=| |\\|/)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar User = /** @class */ (function () {\r\n function User(config, core, unloadHookContainer) {\r\n /**\r\n * A flag indicating whether this represents a new user\r\n */\r\n this.isNewUser = false;\r\n /**\r\n * A flag indicating whether the user cookie has been set\r\n */\r\n this.isUserCookieSet = false;\r\n var _logger = safeGetLogger(core);\r\n var _cookieManager = safeGetCookieMgr(core);\r\n var _storageNamePrefix;\r\n dynamicProto(User, this, function (_self) {\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return config; }\r\n });\r\n var unloadHook = onConfigChange(config, function () {\r\n var userCookiePostfix = config.userCookiePostfix || \"\";\r\n _storageNamePrefix = User.userCookieName + userCookiePostfix;\r\n // get userId or create new one if none exists\r\n var cookie = _cookieManager.get(_storageNamePrefix);\r\n if (cookie) {\r\n _self[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n var params = cookie.split(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n if (params.length > 0) {\r\n _self.id = params[0];\r\n // we already have a cookie\r\n _self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */] = !!_self.id;\r\n }\r\n }\r\n if (!_self.id) {\r\n _self.id = _generateNewId();\r\n var newCookie = _generateNewCookie(_self.id);\r\n _setUserCookie(newCookie.join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]));\r\n // If we have an config.namePrefix() + ai_session in local storage this means the user actively removed our cookies.\r\n // We should respect their wishes and clear ourselves from local storage\r\n var name_1 = (config.namePrefix || \"\") + \"ai_session\";\r\n utlRemoveStorage(_logger, name_1);\r\n }\r\n // We still take the account id from the ctor param for backward compatibility.\r\n // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it.\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = config[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] || undefined;\r\n // Get the auth user id and account id from the cookie if exists\r\n // Cookie is in the pattern: |\r\n var authCookie = _cookieManager.get(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */]);\r\n if (authCookie) {\r\n authCookie = decodeURI(authCookie);\r\n var authCookieString = authCookie.split(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n if (authCookieString[0]) {\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = authCookieString[0];\r\n }\r\n if (authCookieString.length > 1 && authCookieString[1]) {\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = authCookieString[1];\r\n }\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n function _generateNewId() {\r\n var theConfig = (config || {});\r\n var getNewId = theConfig.getNewId || newId;\r\n var id = getNewId(theConfig.idLength ? config.idLength : 22);\r\n return id;\r\n }\r\n function _generateNewCookie(userId) {\r\n var acqStr = toISOString(new Date());\r\n _self.accountAcquisitionDate = acqStr;\r\n _self[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = true;\r\n var newCookie = [userId, acqStr];\r\n return newCookie;\r\n }\r\n function _setUserCookie(cookie) {\r\n // without expiration, cookies expire at the end of the session\r\n // set it to 365 days from now\r\n // 365 * 24 * 60 * 60 = 31536000\r\n var oneYear = 31536000;\r\n _self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */] = _cookieManager.set(_storageNamePrefix, cookie, oneYear);\r\n }\r\n _self.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // Validate inputs to ensure no cookie control characters.\r\n var isInvalidInput = !_validateUserInput(authenticatedUserId) || (accountId && !_validateUserInput(accountId));\r\n if (isInvalidInput) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 60 /* _eInternalMessageId.SetAuthContextFailedAccountName */, \"Setting auth user context failed. \" +\r\n \"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.\", true);\r\n return;\r\n }\r\n // Create cookie string.\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = authenticatedUserId;\r\n var authCookie = _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */];\r\n if (accountId) {\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = accountId;\r\n authCookie = [_self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], _self.accountId].join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n }\r\n if (storeInCookie) {\r\n // Set the cookie. No expiration date because this is a session cookie (expires when browser closed).\r\n // Encoding the cookie to handle unexpected unicode characters.\r\n _cookieManager.set(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */], encodeURI(authCookie));\r\n }\r\n };\r\n /**\r\n * Clears the authenticated user id and the account id from the user context.\r\n * @returns {}\r\n */\r\n _self.clearAuthenticatedUserContext = function () {\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = null;\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = null;\r\n _cookieManager.del(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */]);\r\n };\r\n _self.update = function (userId) {\r\n // Optimizations to avoid setting and processing the cookie when not needed\r\n if (_self.id !== userId || !_self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n var user_id = userId ? userId : _generateNewId();\r\n var user_cookie = _generateNewCookie(user_id);\r\n _setUserCookie(user_cookie.join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]));\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for User.prototype.setAuthenticatedUserContext.\r\n// Removed Stub for User.prototype.clearAuthenticatedUserContext.\r\n// Removed Stub for User.prototype.update.\r\n User.cookieSeparator = \"|\";\r\n User.userCookieName = \"ai_user\";\r\n User.authUserCookieName = \"ai_authUser\";\r\n return User;\r\n}());\r\nexport { User };\r\n//# sourceMappingURL=User.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n* TelemetryContext.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { CtxTagKeys, Extensions, PageView, dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { _InternalLogMessage, getSetValue, hasWindow, isNullOrUndefined, isString, objKeys, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Application } from \"./Context/Application\";\r\nimport { Device } from \"./Context/Device\";\r\nimport { Internal } from \"./Context/Internal\";\r\nimport { Location } from \"./Context/Location\";\r\nimport { Session, _SessionManager } from \"./Context/Session\";\r\nimport { TelemetryTrace } from \"./Context/TelemetryTrace\";\r\nimport { User } from \"./Context/User\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_AUTHENTICATED_ID, _DYN_AUTOMATIC_SESSION, _DYN_GET_SESSION_ID, _DYN_SESSION, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar strExt = \"ext\";\r\nvar strTags = \"tags\";\r\nfunction _removeEmpty(target, name) {\r\n if (target && target[name] && objKeys(target[name]).length === 0) {\r\n delete target[name];\r\n }\r\n}\r\nfunction _nullResult() {\r\n return null;\r\n}\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(core, defaultConfig, previousTraceCtx, unloadHookContainer) {\r\n var _this = this;\r\n var logger = core.logger;\r\n dynamicProto(TelemetryContext, this, function (_self) {\r\n _self.appId = _nullResult;\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = _nullResult;\r\n _self.application = new Application();\r\n _self.internal = new Internal(defaultConfig, unloadHookContainer);\r\n if (hasWindow()) {\r\n _self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] = new _SessionManager(defaultConfig, core, unloadHookContainer);\r\n _self.device = new Device();\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, core, unloadHookContainer);\r\n var traceId = void 0;\r\n var parentId = void 0;\r\n var name_1;\r\n if (previousTraceCtx) {\r\n traceId = previousTraceCtx.getTraceId();\r\n parentId = previousTraceCtx.getSpanId();\r\n name_1 = previousTraceCtx.getName();\r\n }\r\n _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */] = new TelemetryTrace(traceId, parentId, name_1, logger);\r\n _self[_DYN_SESSION /* @min:%2esession */] = new Session();\r\n }\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () {\r\n var session = _self[_DYN_SESSION /* @min:%2esession */];\r\n var sesId = null;\r\n // If customer set session info, apply their context; otherwise apply context automatically generated\r\n if (session && isString(session.id)) {\r\n sesId = session.id;\r\n }\r\n else {\r\n // Gets the automatic session if it exists or an empty object\r\n var autoSession = (_self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] || {})[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;\r\n }\r\n return sesId;\r\n };\r\n _self[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */] = function (evt, itemCtx) {\r\n setValue(getSetValue(evt.ext, Extensions.AppExt), \"sesId\", _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */](), isString);\r\n };\r\n _self[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */] = function (evt, itemCtx) {\r\n setValue(evt.ext, Extensions.OSExt, _self.os);\r\n };\r\n _self[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */] = function (evt, itemCtx) {\r\n var application = _self.application;\r\n if (application) {\r\n // evt.ext.app\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString);\r\n setValue(tags, CtxTagKeys.applicationBuild, application.build, isString);\r\n }\r\n };\r\n _self.applyDeviceContext = function (evt, itemCtx) {\r\n var device = _self.device;\r\n if (device) {\r\n // evt.ext.device\r\n var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt);\r\n setValue(extDevice, \"localId\", device.id, isString);\r\n setValue(extDevice, \"ip\", device.ip, isString);\r\n setValue(extDevice, \"model\", device.model, isString);\r\n setValue(extDevice, \"deviceClass\", device.deviceClass, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */] = function (evt, itemCtx) {\r\n var internal = _self.internal;\r\n if (internal) {\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); // not mapped in CS 4.0\r\n setValue(tags, CtxTagKeys.internalSdkVersion, dataSanitizeString(logger, internal.sdkVersion, 64), isString);\r\n if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) {\r\n setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString);\r\n setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString);\r\n }\r\n }\r\n };\r\n _self[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */] = function (evt, itemCtx) {\r\n var location = _this.location;\r\n if (location) {\r\n setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */] = function (evt, itemCtx) {\r\n var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];\r\n if (telemetryTrace) {\r\n var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });\r\n setValue(extTrace, \"traceID\", telemetryTrace.traceID, isString, isNullOrUndefined);\r\n setValue(extTrace, \"name\", telemetryTrace.name, isString, isNullOrUndefined);\r\n setValue(extTrace, \"parentID\", telemetryTrace.parentID, isString, isNullOrUndefined);\r\n }\r\n };\r\n _self.applyWebContext = function (evt, itemCtx) {\r\n var web = _this.web;\r\n if (web) {\r\n setValue(getSetValue(evt, strExt), Extensions.WebExt, web);\r\n }\r\n };\r\n _self.applyUserContext = function (evt, itemCtx) {\r\n var user = _self.user;\r\n if (user) {\r\n var tags = getSetValue(evt, strTags, []);\r\n // stays in tags\r\n setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID /* @min:%2eaccountId */], isString);\r\n // CS 4.0\r\n var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);\r\n setValue(extUser, \"id\", user.id, isString);\r\n setValue(extUser, \"authId\", user[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], isString);\r\n }\r\n };\r\n _self.cleanUp = function (evt, itemCtx) {\r\n var ext = evt.ext;\r\n if (ext) {\r\n _removeEmpty(ext, Extensions.DeviceExt);\r\n _removeEmpty(ext, Extensions.UserExt);\r\n _removeEmpty(ext, Extensions.WebExt);\r\n _removeEmpty(ext, Extensions.OSExt);\r\n _removeEmpty(ext, Extensions.AppExt);\r\n _removeEmpty(ext, Extensions.TraceExt);\r\n }\r\n };\r\n });\r\n }\r\n// Removed Stub for TelemetryContext.prototype.applySessionContext.\r\n// Removed Stub for TelemetryContext.prototype.applyOperatingSystemContxt.\r\n// Removed Stub for TelemetryContext.prototype.applyApplicationContext.\r\n// Removed Stub for TelemetryContext.prototype.applyDeviceContext.\r\n// Removed Stub for TelemetryContext.prototype.applyInternalContext.\r\n// Removed Stub for TelemetryContext.prototype.applyLocationContext.\r\n// Removed Stub for TelemetryContext.prototype.applyOperationContext.\r\n// Removed Stub for TelemetryContext.prototype.applyWebContext.\r\n// Removed Stub for TelemetryContext.prototype.applyUserContext.\r\n// Removed Stub for TelemetryContext.prototype.cleanUp.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n TelemetryContext.__ieDyn=1;\n\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map","/*\n * Application Insights JavaScript SDK - Properties Plugin, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n* PropertiesPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, onConfigChange } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDeepFreeze, objDefine } from \"@nevware21/ts-utils\";\r\nimport { TelemetryContext } from \"./TelemetryContext\";\r\nimport { _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_GET_SESSION_ID, _DYN_GET_TRACE_CTX, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET, _DYN_SESSION, _DYN_SESSION_COOKIE_POSTF6, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar undefString;\r\nvar nullValue = null;\r\nvar _defaultConfig = objDeepFreeze((_a = {\r\n accountId: nullValue,\r\n sessionRenewalMs: 30 * 60 * 1000,\r\n samplingPercentage: 100,\r\n sessionExpirationMs: 24 * 60 * 60 * 1000,\r\n cookieDomain: nullValue,\r\n sdkExtension: nullValue,\r\n isBrowserLinkTrackingEnabled: false,\r\n appId: nullValue\r\n },\r\n _a[_DYN_GET_SESSION_ID /* @min:getSessionId */] = nullValue,\r\n _a.namePrefix = undefString,\r\n _a[_DYN_SESSION_COOKIE_POSTF6 /* @min:sessionCookiePostfix */] = undefString,\r\n _a.userCookiePostfix = undefString,\r\n _a.idLength = 22,\r\n _a.getNewId = nullValue,\r\n _a));\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n var _extensionConfig;\r\n var _distributedTraceCtx;\r\n var _previousTraceCtx;\r\n var _context;\r\n var _disableUserInitMessage;\r\n dynamicProto(PropertiesPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n objDefine(_self, \"context\", {\r\n g: function () {\r\n return _context;\r\n }\r\n });\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event - The event that needs to be processed\r\n */\r\n _self.processTelemetry = function (event, itemCtx) {\r\n if (!isNullOrUndefined(event)) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n var theContext = (_context || {});\r\n if (theContext[_DYN_SESSION /* @min:%2esession */]) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof _context[_DYN_SESSION /* @min:%2esession */].id !== \"string\" && theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */]) {\r\n theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */].update();\r\n }\r\n }\r\n var userCtx = theContext.user;\r\n if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n userCtx.update(theContext.user.id);\r\n }\r\n _processTelemetryInternal(event, itemCtx);\r\n if (userCtx && userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */]) {\r\n userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n if (!_disableUserInitMessage) {\r\n var message = new _InternalLogMessage(72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */, ((getNavigator() || {}).userAgent || \"\"));\r\n _logInternalMessage(itemCtx.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, message);\r\n }\r\n }\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n var core = (unloadCtx || {}).core();\r\n if (core && core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */]) {\r\n var traceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n if (traceCtx === _distributedTraceCtx) {\r\n core.setTraceCtx(_previousTraceCtx);\r\n }\r\n }\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _extensionConfig = null;\r\n _distributedTraceCtx = null;\r\n _previousTraceCtx = null;\r\n _context = null;\r\n _disableUserInitMessage = true;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n // This function will be re-called whenever any referenced configuration is changed\r\n _self._addHook(onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n _disableUserInitMessage = config.disableUserInitMessage === false ? false : true;\r\n _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig);\r\n // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class\r\n _self[\"_extConfig\"] = _extensionConfig;\r\n }));\r\n // This is outside of the onConfigChange as we don't want to update (replace) these values whenever a referenced config item changes\r\n _previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n _context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx, _self._unloadHooks);\r\n _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);\r\n core.setTraceCtx(_distributedTraceCtx);\r\n _self.context.appId = function () {\r\n var breezeChannel = core.getPlugin(BreezeChannelIdentifier);\r\n return breezeChannel ? breezeChannel.plugin[\"_appId\"] : null;\r\n };\r\n }\r\n function _processTelemetryInternal(evt, itemCtx) {\r\n // Set Part A fields\r\n getSetValue(evt, \"tags\", []);\r\n getSetValue(evt, \"ext\", {});\r\n var ctx = _self.context;\r\n ctx[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */](evt, itemCtx);\r\n ctx.applyDeviceContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */](evt, itemCtx);\r\n ctx.applyUserContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */](evt, itemCtx);\r\n ctx.applyWebContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */](evt, itemCtx); // legacy tags\r\n ctx[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */](evt, itemCtx); // legacy tags\r\n ctx.cleanUp(evt, itemCtx);\r\n }\r\n });\r\n return _this;\r\n }\r\n// Removed Stub for PropertiesPlugin.prototype.initialize.\r\n// Removed Stub for PropertiesPlugin.prototype.processTelemetry.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PropertiesPlugin.__ieDyn=1;\n\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map","/*\n * Application Insights JavaScript SDK - Web, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a, _b, _c, _d;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AnalyticsPlugin } from \"@microsoft/applicationinsights-analytics-js\";\r\nimport { CfgSyncPlugin } from \"@microsoft/applicationinsights-cfgsync-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { AnalyticsPluginIdentifier, DEFAULT_BREEZE_PATH, PropertiesPluginIdentifier, ThrottleMgr, parseConnectionString } from \"@microsoft/applicationinsights-common\";\r\nimport { AppInsightsCore, _throwInternal, addPageHideEventListener, addPageUnloadEventListener, cfgDfMerge, cfgDfValidate, createDynamicConfig, createProcessTelemetryContext, createUniqueNamespace, doPerf, hasDocument, hasWindow, isArray, isFeatureEnabled, isFunction, isNullOrUndefined, isReactNative, isString, mergeEvtNamespace, onConfigChange, proxyAssign, proxyFunctions, removePageHideEventListener, removePageUnloadEventListener } from \"@microsoft/applicationinsights-core-js\";\r\nimport { AjaxPlugin as DependenciesPlugin } from \"@microsoft/applicationinsights-dependencies-js\";\r\nimport { PropertiesPlugin } from \"@microsoft/applicationinsights-properties-js\";\r\nimport { createPromise, createSyncPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, arrIndexOf, isPromiseLike, objDefine, objForEachKey, strIndexOf, throwUnsupported } from \"@nevware21/ts-utils\";\r\nimport { CONFIG_ENDPOINT_URL, STR_ADD_TELEMETRY_INITIALIZER, STR_CLEAR_AUTHENTICATED_USER_CONTEXT, STR_EVT_NAMESPACE, STR_FLUSH, STR_GET_COOKIE_MGR, STR_GET_PLUGIN, STR_POLL_INTERNAL_LOGS, STR_SET_AUTHENTICATED_USER_CONTEXT, STR_SNIPPET, STR_START_TRACK_EVENT, STR_START_TRACK_PAGE, STR_STOP_TRACK_EVENT, STR_STOP_TRACK_PAGE, STR_TRACK_DEPENDENCY_DATA, STR_TRACK_EVENT, STR_TRACK_EXCEPTION, STR_TRACK_METRIC, STR_TRACK_PAGE_VIEW, STR_TRACK_TRACE } from \"./InternalConstants\";\r\nimport { _DYN_ADD_HOUSEKEEPING_BEF1, _DYN_CONNECTION_STRING, _DYN_CONTEXT, _DYN_ENDPOINT_URL, _DYN_INSTRUMENTATION_KEY, _DYN_ONUNLOAD_FLUSH, _DYN_QUEUE, _DYN_SEND_MESSAGE, _DYN_UPDATE_SNIPPET_DEFIN2, _DYN_USER_OVERRIDE_ENDPOI0, _DYN_VERSION } from \"./__DynamicConstants\";\r\nvar _internalSdkSrc;\r\n// This is an exclude list of properties that should not be updated during initialization\r\n// They include a combination of private and internal property names\r\nvar _ignoreUpdateSnippetProperties = [\r\n STR_SNIPPET, \"dependencies\", \"properties\", \"_snippetVersion\", \"appInsightsNew\", \"getSKUDefaults\"\r\n];\r\nvar IKEY_USAGE = \"iKeyUsage\";\r\nvar CDN_USAGE = \"CdnUsage\";\r\nvar SDK_LOADER_VER = \"SdkLoaderVer\";\r\nvar UNDEFINED_VALUE = undefined;\r\nvar default_limit = {\r\n samplingRate: 100,\r\n maxSendNumber: 1\r\n};\r\nvar default_interval = {\r\n monthInterval: 3,\r\n daysOfMonth: [28]\r\n};\r\nvar default_throttle_config = {\r\n disabled: true,\r\n limit: cfgDfMerge(default_limit),\r\n interval: cfgDfMerge(default_interval)\r\n};\r\n// We need to include all properties that we only reference that we want to be dynamically updatable here\r\n// So they are converted even when not specified in the passed configuration\r\nvar defaultConfigValues = (_a = {},\r\n _a[_DYN_CONNECTION_STRING /* @min:connectionString */] = UNDEFINED_VALUE,\r\n _a.endpointUrl = UNDEFINED_VALUE,\r\n _a[_DYN_INSTRUMENTATION_KEY /* @min:instrumentationKey */] = UNDEFINED_VALUE,\r\n _a[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:userOverrideEndpointUrl */] = UNDEFINED_VALUE,\r\n _a.diagnosticLogInterval = cfgDfValidate(_chkDiagLevel, 10000),\r\n _a.featureOptIn = (_b = {},\r\n _b[IKEY_USAGE] = { mode: 3 /* FeatureOptInMode.enable */ },\r\n _b[CDN_USAGE] = { mode: 2 /* FeatureOptInMode.disable */ },\r\n _b[SDK_LOADER_VER] = { mode: 2 /* FeatureOptInMode.disable */ },\r\n _b),\r\n _a.throttleMgrCfg = cfgDfMerge((_c = {},\r\n _c[109 /* _eInternalMessageId.DefaultThrottleMsgKey */] = cfgDfMerge(default_throttle_config),\r\n _c[106 /* _eInternalMessageId.InstrumentationKeyDeprecation */] = cfgDfMerge(default_throttle_config),\r\n _c[111 /* _eInternalMessageId.SdkLdrUpdate */] = cfgDfMerge(default_throttle_config),\r\n _c[110 /* _eInternalMessageId.CdnDeprecation */] = cfgDfMerge(default_throttle_config),\r\n _c)),\r\n _a.extensionConfig = cfgDfMerge((_d = {},\r\n _d[\"AppInsightsCfgSyncPlugin\"] = cfgDfMerge({\r\n cfgUrl: CONFIG_ENDPOINT_URL,\r\n syncMode: 2 /* ICfgSyncMode.Receive */\r\n }),\r\n _d)),\r\n _a);\r\nfunction _chkDiagLevel(value) {\r\n // Make sure we have a value > 0\r\n return value && value > 0;\r\n}\r\n/**\r\n * Application Insights API\r\n * @group Entrypoint\r\n * @group Classes\r\n * @class Initialization\r\n * @implements {IApplicationInsights}\r\n */\r\nvar AppInsightsSku = /** @class */ (function () {\r\n function AppInsightsSku(snippet) {\r\n var _this = this;\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var dependencies;\r\n var properties;\r\n var _sender;\r\n var _snippetVersion;\r\n var _evtNamespace;\r\n var _houseKeepingNamespace;\r\n var _core;\r\n var _config;\r\n var _analyticsPlugin;\r\n var _cfgSyncPlugin;\r\n var _throttleMgr;\r\n var _iKeySentMessage;\r\n var _cdnSentMessage;\r\n var _sdkVerSentMessage;\r\n dynamicProto(AppInsightsSku, this, function (_self) {\r\n _initDefaults();\r\n objDefine(_self, \"config\", {\r\n g: function () {\r\n return _config;\r\n }\r\n });\r\n arrForEach([\"pluginVersionStringArr\", \"pluginVersionString\"], function (key) {\r\n objDefine(_self, key, {\r\n g: function () {\r\n if (_core) {\r\n return _core[key];\r\n }\r\n return null;\r\n }\r\n });\r\n });\r\n // initialize the queue and config in case they are undefined\r\n _snippetVersion = \"\" + (snippet.sv || snippet[_DYN_VERSION /* @min:%2eversion */] || \"\");\r\n snippet[_DYN_QUEUE /* @min:%2equeue */] = snippet[_DYN_QUEUE /* @min:%2equeue */] || [];\r\n snippet[_DYN_VERSION /* @min:%2eversion */] = snippet[_DYN_VERSION /* @min:%2eversion */] || 2.0; // Default to new version\r\n var cfgHandler = createDynamicConfig(snippet.config || {}, defaultConfigValues);\r\n _config = cfgHandler.cfg;\r\n _analyticsPlugin = new AnalyticsPlugin();\r\n objDefine(_self, \"appInsights\", {\r\n g: function () {\r\n return _analyticsPlugin;\r\n }\r\n });\r\n properties = new PropertiesPlugin();\r\n dependencies = new DependenciesPlugin();\r\n _sender = new Sender();\r\n _core = new AppInsightsCore();\r\n objDefine(_self, \"core\", {\r\n g: function () {\r\n return _core;\r\n }\r\n });\r\n // Will get recalled if any referenced values are changed\r\n _addUnloadHook(onConfigChange(cfgHandler, function () {\r\n var configCs = _config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */];\r\n function _parseCs() {\r\n return createSyncPromise(function (resolve, reject) {\r\n doAwaitResponse(configCs, function (res) {\r\n var curCs = res && res.value;\r\n var parsedCs = null;\r\n if (!res.rejected && curCs) {\r\n // replace cs with resolved values in case of circular promises\r\n _config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */] = curCs;\r\n parsedCs = parseConnectionString(curCs);\r\n }\r\n // if can't resolve cs promise, null will be returned\r\n resolve(parsedCs);\r\n });\r\n });\r\n }\r\n if (isPromiseLike(configCs)) {\r\n var ikeyPromise = createSyncPromise(function (resolve, reject) {\r\n _parseCs().then(function (cs) {\r\n var ikey = _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n ikey = cs && cs.instrumentationkey || ikey;\r\n resolve(ikey);\r\n }).catch(function (e) {\r\n // parseCs will always resolve(unless timeout)\r\n // return null in case any error happens\r\n resolve(null);\r\n });\r\n });\r\n var url = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */];\r\n if (isNullOrUndefined(url)) {\r\n url = createSyncPromise(function (resolve, reject) {\r\n _parseCs().then(function (cs) {\r\n var url = _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n var ingest = cs && cs.ingestionendpoint;\r\n url = ingest ? ingest + DEFAULT_BREEZE_PATH : url;\r\n resolve(url);\r\n }).catch(function (e) {\r\n // parseCs will always resolve(unless timeout)\r\n // return null in case any error happens\r\n resolve(null);\r\n });\r\n });\r\n }\r\n _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = ikeyPromise;\r\n _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */] = url;\r\n }\r\n if (isString(configCs) && configCs) {\r\n // confirm if promiselike function present\r\n // handle cs promise here\r\n // add cases to oneNote\r\n var cs = parseConnectionString(configCs);\r\n var ingest = cs.ingestionendpoint;\r\n _config.endpointUrl = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] ? _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] : ingest + DEFAULT_BREEZE_PATH; // add /v2/track\r\n _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = cs.instrumentationkey || _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n }\r\n // userOverrideEndpointUrl have the highest priority\r\n _config.endpointUrl = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] ? _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] : _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n }));\r\n _self[STR_SNIPPET /* @min:%2esnippet */] = snippet;\r\n _self[STR_FLUSH /* @min:%2eflush */] = function (async, callBack) {\r\n if (async === void 0) { async = true; }\r\n var result;\r\n doPerf(_core, function () { return \"AISKU.flush\"; }, function () {\r\n if (async && !callBack) {\r\n result = createPromise(function (resolve) {\r\n callBack = resolve;\r\n });\r\n }\r\n var waiting = 1;\r\n var flushDone = function () {\r\n waiting--;\r\n if (waiting === 0) {\r\n callBack();\r\n }\r\n };\r\n arrForEach(_core.getChannels(), function (channel) {\r\n if (channel) {\r\n waiting++;\r\n channel[STR_FLUSH /* @min:%2eflush */](async, flushDone);\r\n }\r\n });\r\n // decrement the initial \"waiting\"\r\n flushDone();\r\n }, null, async);\r\n return result;\r\n };\r\n _self[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */] = function (async) {\r\n if (async === void 0) { async = true; }\r\n arrForEach(_core.getChannels(), function (channel) {\r\n if (channel[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */]) {\r\n channel[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */]();\r\n }\r\n else {\r\n channel[STR_FLUSH /* @min:%2eflush */](async);\r\n }\r\n });\r\n };\r\n _self.loadAppInsights = function (legacyMode, logger, notificationManager) {\r\n if (legacyMode === void 0) { legacyMode = false; }\r\n if (legacyMode) {\r\n throwUnsupported(\"Legacy Mode is no longer supported\");\r\n }\r\n function _updateSnippetProperties(snippet) {\r\n if (snippet) {\r\n var snippetVer = \"\";\r\n if (!isNullOrUndefined(_snippetVersion)) {\r\n snippetVer += _snippetVersion;\r\n }\r\n if (_self[_DYN_CONTEXT /* @min:%2econtext */] && _self[_DYN_CONTEXT /* @min:%2econtext */].internal) {\r\n _self[_DYN_CONTEXT /* @min:%2econtext */].internal.snippetVer = snippetVer || \"-\";\r\n }\r\n // apply updated properties to the global instance (snippet)\r\n objForEachKey(_self, function (field, value) {\r\n if (isString(field) &&\r\n !isFunction(value) &&\r\n field && field[0] !== \"_\" && // Don't copy \"internal\" values\r\n arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) {\r\n if (snippet[field] !== value) {\r\n snippet[field] = value;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n doPerf(_self.core, function () { return \"AISKU.loadAppInsights\"; }, function () {\r\n // initialize core\r\n _core.initialize(_config, [_sender, properties, dependencies, _analyticsPlugin, _cfgSyncPlugin], logger, notificationManager);\r\n objDefine(_self, \"context\", {\r\n g: function () { return properties[_DYN_CONTEXT /* @min:%2econtext */]; }\r\n });\r\n if (!_throttleMgr) {\r\n _throttleMgr = new ThrottleMgr(_core);\r\n }\r\n var sdkSrc = _findSdkSourceFile();\r\n if (sdkSrc && _self[_DYN_CONTEXT /* @min:%2econtext */]) {\r\n _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc = sdkSrc;\r\n }\r\n _updateSnippetProperties(_self[STR_SNIPPET /* @min:%2esnippet */]);\r\n // Empty queue of all api calls logged prior to sdk download\r\n _self.emptyQueue();\r\n _self[STR_POLL_INTERNAL_LOGS /* @min:%2epollInternalLogs */]();\r\n _self[_DYN_ADD_HOUSEKEEPING_BEF1 /* @min:%2eaddHousekeepingBeforeUnload */](_self);\r\n _addUnloadHook(onConfigChange(cfgHandler, function () {\r\n var defaultEnable = false;\r\n if (_config.throttleMgrCfg[109 /* _eInternalMessageId.DefaultThrottleMsgKey */]) {\r\n defaultEnable = !_config.throttleMgrCfg[109 /* _eInternalMessageId.DefaultThrottleMsgKey */].disabled;\r\n }\r\n if (!_throttleMgr.isReady() && _config.extensionConfig && _config.extensionConfig[_cfgSyncPlugin.identifier] && defaultEnable) {\r\n // set ready state to true will automatically trigger flush()\r\n _throttleMgr.onReadyState(true);\r\n }\r\n if (!_iKeySentMessage && !_config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */] && isFeatureEnabled(IKEY_USAGE, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](106 /* _eInternalMessageId.InstrumentationKeyDeprecation */, \"See Instrumentation key support at aka.ms/IkeyMigrate\");\r\n _iKeySentMessage = true;\r\n }\r\n if (!_cdnSentMessage && _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc && _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc.indexOf(\"az416426\") != -1 && isFeatureEnabled(CDN_USAGE, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](110 /* _eInternalMessageId.CdnDeprecation */, \"See Cdn support notice at aka.ms/JsActiveCdn\");\r\n _cdnSentMessage = true;\r\n }\r\n if (!_sdkVerSentMessage && parseInt(_snippetVersion) < 6 && isFeatureEnabled(SDK_LOADER_VER, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](111 /* _eInternalMessageId.SdkLdrUpdate */, \"An updated Sdk Loader is available, see aka.ms/SnippetVer\");\r\n _sdkVerSentMessage = true;\r\n }\r\n }));\r\n });\r\n return _self;\r\n };\r\n _self[_DYN_UPDATE_SNIPPET_DEFIN2 /* @min:%2eupdateSnippetDefinitions */] = function (snippet) {\r\n // apply full appInsights to the global instance\r\n // Note: This must be called before loadAppInsights is called\r\n proxyAssign(snippet, _self, function (name) {\r\n // Not excluding names prefixed with \"_\" as we need to proxy some functions like _onError\r\n return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;\r\n });\r\n };\r\n _self.emptyQueue = function () {\r\n // call functions that were queued before the main script was loaded\r\n try {\r\n if (isArray(_self.snippet[_DYN_QUEUE /* @min:%2equeue */])) {\r\n // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden.\r\n var length_1 = _self.snippet[_DYN_QUEUE /* @min:%2equeue */].length;\r\n for (var i = 0; i < length_1; i++) {\r\n var call = _self.snippet[_DYN_QUEUE /* @min:%2equeue */][i];\r\n call();\r\n }\r\n _self.snippet[_DYN_QUEUE /* @min:%2equeue */] = undefined;\r\n delete _self.snippet[_DYN_QUEUE /* @min:%2equeue */];\r\n }\r\n }\r\n catch (exception) {\r\n var properties_1 = {};\r\n if (exception && isFunction(exception.toString)) {\r\n properties_1.exception = exception.toString();\r\n }\r\n // need from core\r\n // Microsoft.ApplicationInsights._InternalLogging.throwInternal(\r\n // eLoggingSeverity.WARNING,\r\n // _eInternalMessageId.FailedToSendQueuedTelemetry,\r\n // \"Failed to send queued telemetry\",\r\n // properties);\r\n }\r\n };\r\n _self[_DYN_ADD_HOUSEKEEPING_BEF1 /* @min:%2eaddHousekeepingBeforeUnload */] = function (appInsightsInstance) {\r\n // Add callback to push events when the user navigates away\r\n if (hasWindow() || hasDocument()) {\r\n var performHousekeeping_1 = function () {\r\n // Adds the ability to flush all data before the page unloads.\r\n // Note: This approach tries to push a sync request with all the pending events onbeforeunload.\r\n // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate.\r\n // Telemetry here will help us analyze how effective this approach is.\r\n // Another approach would be to make this call sync with a acceptable timeout to reduce the\r\n // impact on user experience.\r\n // appInsightsInstance.context._sender.triggerSend();\r\n appInsightsInstance[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */](false);\r\n // Back up the current session to local storage\r\n // This lets us close expired sessions after the cookies themselves expire\r\n if (isFunction(_self.core[STR_GET_PLUGIN /* @min:%2egetPlugin */])) {\r\n var loadedPlugin = _this.core[STR_GET_PLUGIN /* @min:%2egetPlugin */](PropertiesPluginIdentifier);\r\n if (loadedPlugin) {\r\n var propertiesPlugin = loadedPlugin.plugin;\r\n if (propertiesPlugin && propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */] && propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */]._sessionManager) {\r\n propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */]._sessionManager.backup();\r\n }\r\n }\r\n }\r\n };\r\n var added_1 = false;\r\n if (!_houseKeepingNamespace) {\r\n _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core[STR_EVT_NAMESPACE /* @min:%2eevtNamespace */] && _core[STR_EVT_NAMESPACE /* @min:%2eevtNamespace */]());\r\n }\r\n // Will be recalled if any referenced config properties change\r\n _addUnloadHook(onConfigChange(_config, function (details) {\r\n var coreConfig = details.cfg;\r\n var analyticsPlugin = appInsightsInstance.appInsights;\r\n var ctx = createProcessTelemetryContext(null, coreConfig, analyticsPlugin.core);\r\n var extConfig = ctx.getExtCfg(analyticsPlugin.identifier || AnalyticsPluginIdentifier);\r\n // As we could get recalled, remove any previously registered event handlers first\r\n _removePageEventHandlers();\r\n var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents;\r\n if (!extConfig.disableFlushOnBeforeUnload) {\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 if (addPageUnloadEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) {\r\n added_1 = true;\r\n }\r\n // We also need to hook the pagehide and visibilitychange events as not all versions of Safari support load/unload events.\r\n if (addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) {\r\n added_1 = true;\r\n }\r\n // A reactNative app may not have a window and therefore the beforeunload/pagehide events -- so don't\r\n // log the failure in this case\r\n if (!added_1 && !isReactNative()) {\r\n _throwInternal(_core.logger, 1 /* eLoggingSeverity.CRITICAL */, 19 /* _eInternalMessageId.FailedToAddHandlerForOnBeforeUnload */, \"Could not add handler for beforeunload and pagehide\");\r\n }\r\n }\r\n if (!added_1 && !extConfig.disableFlushOnUnload) {\r\n // If we didn't add the normal set then attempt to add the pagehide and visibilitychange only\r\n addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace);\r\n }\r\n }));\r\n }\r\n };\r\n _self.getSender = function () {\r\n return _sender;\r\n };\r\n _self.unload = function (isAsync, unloadComplete, cbTimeout) {\r\n var unloadDone = false;\r\n var result;\r\n if (isAsync && !unloadComplete) {\r\n result = createPromise(function (resolve) {\r\n // Set the callback to the promise resolve callback\r\n unloadComplete = resolve;\r\n });\r\n }\r\n function _unloadCallback(unloadState) {\r\n if (!unloadDone) {\r\n unloadDone = true;\r\n _initDefaults();\r\n unloadComplete && unloadComplete(unloadState);\r\n }\r\n }\r\n _self[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */](isAsync);\r\n _removePageEventHandlers();\r\n _core.unload && _core.unload(isAsync, _unloadCallback, cbTimeout);\r\n return result;\r\n };\r\n proxyFunctions(_self, _analyticsPlugin, [\r\n STR_GET_COOKIE_MGR,\r\n STR_TRACK_EVENT,\r\n STR_TRACK_PAGE_VIEW,\r\n \"trackPageViewPerformance\",\r\n STR_TRACK_EXCEPTION,\r\n \"_onerror\",\r\n STR_TRACK_TRACE,\r\n STR_TRACK_METRIC,\r\n STR_START_TRACK_PAGE,\r\n STR_STOP_TRACK_PAGE,\r\n STR_START_TRACK_EVENT,\r\n STR_STOP_TRACK_EVENT\r\n ]);\r\n proxyFunctions(_self, _getCurrentDependencies, [\r\n STR_TRACK_DEPENDENCY_DATA,\r\n \"addDependencyListener\",\r\n \"addDependencyInitializer\"\r\n ]);\r\n proxyFunctions(_self, _core, [\r\n STR_ADD_TELEMETRY_INITIALIZER,\r\n STR_POLL_INTERNAL_LOGS,\r\n \"stopPollingInternalLogs\",\r\n STR_GET_PLUGIN,\r\n \"addPlugin\",\r\n STR_EVT_NAMESPACE,\r\n \"addUnloadCb\",\r\n \"getTraceCtx\",\r\n \"updateCfg\",\r\n \"onCfgChange\"\r\n ]);\r\n proxyFunctions(_self, function () {\r\n var context = properties[_DYN_CONTEXT /* @min:%2econtext */];\r\n return context ? context.user : null;\r\n }, [\r\n STR_SET_AUTHENTICATED_USER_CONTEXT,\r\n STR_CLEAR_AUTHENTICATED_USER_CONTEXT\r\n ]);\r\n // Using a function to support the dynamic adding / removal of plugins, so this will always return the current value\r\n function _getCurrentDependencies() {\r\n return dependencies;\r\n }\r\n function _initDefaults() {\r\n _evtNamespace = createUniqueNamespace(\"AISKU\");\r\n _houseKeepingNamespace = null;\r\n dependencies = null;\r\n properties = null;\r\n _sender = null;\r\n _snippetVersion = null;\r\n _throttleMgr = null;\r\n _iKeySentMessage = false;\r\n _cdnSentMessage = false;\r\n _sdkVerSentMessage = false;\r\n _cfgSyncPlugin = new CfgSyncPlugin();\r\n }\r\n function _removePageEventHandlers() {\r\n // Remove any registered event handlers\r\n if (_houseKeepingNamespace) {\r\n removePageUnloadEventListener(null, _houseKeepingNamespace);\r\n removePageHideEventListener(null, _houseKeepingNamespace);\r\n }\r\n }\r\n function _addUnloadHook(hooks) {\r\n _core.addUnloadHook(hooks);\r\n }\r\n });\r\n }\r\n // Analytics Plugin\r\n// Removed Stub for AppInsightsSku.prototype.getCookieMgr.\r\n// Removed Stub for AppInsightsSku.prototype.trackEvent.\r\n// Removed Stub for AppInsightsSku.prototype.trackPageView.\r\n// Removed Stub for AppInsightsSku.prototype.trackPageViewPerformance.\r\n// Removed Stub for AppInsightsSku.prototype.trackException.\r\n// Removed Stub for AppInsightsSku.prototype._onerror.\r\n// Removed Stub for AppInsightsSku.prototype.trackTrace.\r\n// Removed Stub for AppInsightsSku.prototype.trackMetric.\r\n// Removed Stub for AppInsightsSku.prototype.startTrackPage.\r\n// Removed Stub for AppInsightsSku.prototype.stopTrackPage.\r\n// Removed Stub for AppInsightsSku.prototype.startTrackEvent.\r\n// Removed Stub for AppInsightsSku.prototype.stopTrackEvent.\r\n// Removed Stub for AppInsightsSku.prototype.addTelemetryInitializer.\r\n // Properties Plugin\r\n// Removed Stub for AppInsightsSku.prototype.setAuthenticatedUserContext.\r\n// Removed Stub for AppInsightsSku.prototype.clearAuthenticatedUserContext.\r\n // Dependencies Plugin\r\n// Removed Stub for AppInsightsSku.prototype.trackDependencyData.\r\n // Misc\r\n// Removed Stub for AppInsightsSku.prototype.flush.\r\n// Removed Stub for AppInsightsSku.prototype.onunloadFlush.\r\n// Removed Stub for AppInsightsSku.prototype.loadAppInsights.\r\n// Removed Stub for AppInsightsSku.prototype.updateSnippetDefinitions.\r\n// Removed Stub for AppInsightsSku.prototype.emptyQueue.\r\n// Removed Stub for AppInsightsSku.prototype.pollInternalLogs.\r\n// Removed Stub for AppInsightsSku.prototype.stopPollingInternalLogs.\r\n// Removed Stub for AppInsightsSku.prototype.addHousekeepingBeforeUnload.\r\n// Removed Stub for AppInsightsSku.prototype.getSender.\r\n// Removed Stub for AppInsightsSku.prototype.unload.\r\n// Removed Stub for AppInsightsSku.prototype.getPlugin.\r\n// Removed Stub for AppInsightsSku.prototype.addPlugin.\r\n// Removed Stub for AppInsightsSku.prototype.updateCfg.\r\n// Removed Stub for AppInsightsSku.prototype.evtNamespace.\r\n// Removed Stub for AppInsightsSku.prototype.addUnloadCb.\r\n// Removed Stub for AppInsightsSku.prototype.addDependencyListener.\r\n /**\r\n * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.\r\n * It is called after the dependency call has completed and any available performance details are available. A dependency\r\n * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency\r\n * request so that it doesn't count against the `maxAjaxCallsPerView`.\r\n * @param dependencyInitializer - The Dependency Telemetry Initializer function\r\n * @returns - A IDependencyInitializerHandler to enable the initializer to be removed\r\n */\r\n AppInsightsSku.prototype.addDependencyInitializer = function (dependencyInitializer) {\r\n return null;\r\n };\r\n// Removed Stub for AppInsightsSku.prototype.getTraceCtx.\r\n// Removed Stub for AppInsightsSku.prototype.onCfgChange.\r\n return AppInsightsSku;\r\n}());\r\nexport { AppInsightsSku };\r\n// tslint:disable-next-line\r\nexport function _findSdkSourceFile() {\r\n if (_internalSdkSrc) {\r\n // Use the cached value\r\n return _internalSdkSrc;\r\n }\r\n var sdkSrc = null;\r\n var isModule = false;\r\n var cdns = [\r\n \"://js.monitor.azure.com/\",\r\n \"://az416426.vo.msecnd.net/\"\r\n ];\r\n try {\r\n // Try and determine whether the sdk is being loaded from the CDN\r\n // currentScript is only valid during initial processing\r\n var scrpt = (document || {}).currentScript;\r\n if (scrpt) {\r\n sdkSrc = scrpt.src;\r\n // } else {\r\n // // We need to update to at least typescript 2.9 for this to work :-(\r\n // // Leaving as a stub for now so after we upgrade this breadcrumb is available\r\n // let meta = import.meta;\r\n // sdkSrc = (meta || {}).url;\r\n // isModule = true;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n if (sdkSrc) {\r\n try {\r\n var url_1 = sdkSrc.toLowerCase();\r\n if (url_1) {\r\n var src_1 = \"\";\r\n arrForEach(cdns, function (value, idx) {\r\n if (strIndexOf(url_1, value) !== -1) {\r\n src_1 = \"cdn\" + (idx + 1);\r\n if (strIndexOf(url_1, \"/scripts/\") === -1) {\r\n if (strIndexOf(url_1, \"/next/\") !== -1) {\r\n src_1 += \"-next\";\r\n }\r\n else if (strIndexOf(url_1, \"/beta/\") !== -1) {\r\n src_1 += \"-beta\";\r\n }\r\n }\r\n _internalSdkSrc = src_1 + (isModule ? \".mod\" : \"\");\r\n return -1;\r\n }\r\n });\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n // Cache the found value so we don't have to look it up again\r\n _internalSdkSrc = sdkSrc;\r\n }\r\n return _internalSdkSrc;\r\n}\r\n//# sourceMappingURL=AISku.js.map","/*\n * Application Insights JavaScript SDK - Web, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\n// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)\r\n// as when using \"short\" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.\r\nvar _AUTHENTICATED_USER_CONTEXT = \"AuthenticatedUserContext\";\r\nvar _TRACK = \"track\";\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_SNIPPET = \"snippet\";\r\nexport var STR_GET_COOKIE_MGR = \"getCookieMgr\";\r\nexport var STR_START_TRACK_PAGE = \"startTrackPage\";\r\nexport var STR_STOP_TRACK_PAGE = \"stopTrackPage\";\r\nexport var STR_FLUSH = \"flush\";\r\nexport var STR_START_TRACK_EVENT = \"startTrackEvent\";\r\nexport var STR_STOP_TRACK_EVENT = \"stopTrackEvent\";\r\nexport var STR_ADD_TELEMETRY_INITIALIZER = \"addTelemetryInitializer\";\r\nexport var STR_ADD_TELEMETRY_INITIALIZERS = STR_ADD_TELEMETRY_INITIALIZER + \"s\";\r\nexport var STR_POLL_INTERNAL_LOGS = \"pollInternalLogs\";\r\nexport var STR_GET_PLUGIN = \"getPlugin\";\r\nexport var STR_EVT_NAMESPACE = \"evtNamespace\";\r\nexport var STR_TRACK_EVENT = _TRACK + \"Event\";\r\nexport var STR_TRACK_TRACE = _TRACK + \"Trace\";\r\nexport var STR_TRACK_METRIC = _TRACK + \"Metric\";\r\nexport var STR_TRACK_PAGE_VIEW = _TRACK + \"PageView\";\r\nexport var STR_TRACK_EXCEPTION = _TRACK + \"Exception\";\r\nexport var STR_TRACK_DEPENDENCY_DATA = _TRACK + \"DependencyData\";\r\nexport var STR_SET_AUTHENTICATED_USER_CONTEXT = \"set\" + _AUTHENTICATED_USER_CONTEXT;\r\nexport var STR_CLEAR_AUTHENTICATED_USER_CONTEXT = \"clear\" + _AUTHENTICATED_USER_CONTEXT;\r\nexport var CONFIG_ENDPOINT_URL = \"https://js.monitor.azure.com/scripts/b/ai.config.1.cfg.json\";\r\n//# sourceMappingURL=InternalConstants.js.map","/*\n * Application Insights JavaScript SDK - Web, 3.3.6\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_VERSION = \"version\"; // Count: 6\r\nexport var _DYN_QUEUE = \"queue\"; // Count: 6\r\nexport var _DYN_CONNECTION_STRING = \"connectionString\"; // Count: 4\r\nexport var _DYN_INSTRUMENTATION_KEY = \"instrumentationKey\"; // Count: 5\r\nexport var _DYN_USER_OVERRIDE_ENDPOI0 = \"userOverrideEndpointUrl\"; // Count: 6\r\nexport var _DYN_ENDPOINT_URL = \"endpointUrl\"; // Count: 5\r\nexport var _DYN_ONUNLOAD_FLUSH = \"onunloadFlush\"; // Count: 6\r\nexport var _DYN_CONTEXT = \"context\"; // Count: 5\r\nexport var _DYN_ADD_HOUSEKEEPING_BEF1 = \"addHousekeepingBeforeUnload\"; // Count: 2\r\nexport var _DYN_SEND_MESSAGE = \"sendMessage\"; // Count: 3\r\nexport var _DYN_UPDATE_SNIPPET_DEFIN2 = \"updateSnippetDefinitions\"; // Count: 2\r\n//# sourceMappingURL=__DynamicConstants.js.map","import { ApplicationInsights } from '@microsoft/applicationinsights-web';\n\nconst getMaxBatchInterval = () => {\n return process.env.MAX_BATCH_INTERVAL ? process.env.MAX_BATCH_INTERVAL : 15000;\n};\n\nconst appInsightsService = new ApplicationInsights({\n config: {\n instrumentationKey: process.env.INSTRUMENTATION_KEY,\n disableAjaxTracking: true,\n maxBatchInterval: getMaxBatchInterval(),\n },\n});\n\nexport const trackEvent = async (name, extraInfo = {}) => {\n const formattedName = `newpay.co.uk: ${name}`;\n appInsightsService.trackEvent({\n name: formattedName,\n properties: { origin: window.location.pathname, ...extraInfo },\n });\n};\n\nexport const trackPageView = async (pageName) => {\n const formattedName = `newpay.co.uk: ${pageName} view`;\n appInsightsService.trackPageView({\n name: formattedName,\n });\n};\n\nexport default appInsightsService;","import { apiRunner } from \"./api-runner-browser\"\n\nif (\n window.location.protocol !== `https:` &&\n window.location.hostname !== `localhost`\n) {\n console.error(\n `Service workers can only be used over HTTPS, or on localhost for development`\n )\n} else if (`serviceWorker` in navigator) {\n navigator.serviceWorker\n .register(`${__BASE_PATH__}/sw.js`)\n .then(function (reg) {\n reg.addEventListener(`updatefound`, () => {\n apiRunner(`onServiceWorkerUpdateFound`, { serviceWorker: reg })\n // The updatefound event implies that reg.installing is set; see\n // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event\n const installingWorker = reg.installing\n console.log(`installingWorker`, installingWorker)\n installingWorker.addEventListener(`statechange`, () => {\n switch (installingWorker.state) {\n case `installed`:\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and the fresh content will\n // have been added to the cache.\n\n // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt\n window.___swUpdated = true\n // We call the onServiceWorkerUpdateReady API so users can show update prompts.\n apiRunner(`onServiceWorkerUpdateReady`, { serviceWorker: reg })\n\n // If resources failed for the current page, reload.\n if (window.___failedResources) {\n console.log(`resources failed, SW updated - reloading`)\n window.location.reload()\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a \"Content is cached for offline use.\" message.\n console.log(`Content is now available offline!`)\n\n // Post to service worker that install is complete.\n // Delay to allow time for the event listener to be added --\n // otherwise fetch is called too soon and resources aren't cached.\n apiRunner(`onServiceWorkerInstalled`, { serviceWorker: reg })\n }\n break\n\n case `redundant`:\n console.error(`The installing service worker became redundant.`)\n apiRunner(`onServiceWorkerRedundant`, { serviceWorker: reg })\n break\n\n case `activated`:\n apiRunner(`onServiceWorkerActive`, { serviceWorker: reg })\n break\n }\n })\n })\n })\n .catch(function (e) {\n console.error(`Error during service worker registration:`, e)\n })\n}\n","exports.createContentDigest = () => ``\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\n\nimport loader from \"./loader\"\nimport InternalPageRenderer from \"./page-renderer\"\n\nconst ProdPageRenderer = ({ location }) => {\n const pageResources = loader.loadPageSync(location.pathname)\n if (!pageResources) {\n return null\n }\n return React.createElement(InternalPageRenderer, {\n location,\n pageResources,\n ...pageResources.json,\n })\n}\n\nProdPageRenderer.propTypes = {\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired,\n }).isRequired,\n}\n\nexport default ProdPageRenderer\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import React from \"react\"\n\nconst SlicesResultsContext = React.createContext({})\nconst SlicesContext = React.createContext({})\nconst SlicesMapContext = React.createContext({})\nconst SlicesPropsContext = React.createContext({})\n\nexport {\n SlicesResultsContext,\n SlicesContext,\n SlicesMapContext,\n SlicesPropsContext,\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.onInitialClientRender = void 0;\nvar _gatsbyScript = require(\"gatsby-script\");\nvar _injectPartytownSnippet = require(\"./utils/inject-partytown-snippet\");\n// Makes sure off-main-thread scripts are loaded in `gatsby develop`\nconst onInitialClientRender = () => {\n if (process.env.NODE_ENV !== `development`) {\n return;\n }\n (0, _injectPartytownSnippet.injectPartytownSnippet)(_gatsbyScript.collectedScriptsByPage.get(window.location.pathname));\n\n // Clear scripts after we've used them to avoid leaky behavior\n _gatsbyScript.collectedScriptsByPage.delete(window.location.pathname);\n};\n\n// Client-side navigation (CSR, e.g. Gatsby Link navigations) are broken upstream in Partytown.\n// We need an official API from Partytown for handling re-configuration and on-demand script loading.\n// Until then, `off-main-thread` scripts load only on server-side navigation (SSR).\n// See https://github.com/BuilderIO/partytown/issues/74 for more details.\nexports.onInitialClientRender = onInitialClientRender;\n//# sourceMappingURL=gatsby-browser.js.map","import * as ReactJSXRuntime from 'react/jsx-runtime';\nimport { h as hasOwn, E as Emotion, c as createEmotionProps } from '../../dist/emotion-element-f0de968e.browser.esm.js';\nimport 'react';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\nimport '@emotion/utils';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\n\nvar Fragment = ReactJSXRuntime.Fragment;\nvar jsx = function jsx(type, props, key) {\n if (!hasOwn.call(props, 'css')) {\n return ReactJSXRuntime.jsx(type, props, key);\n }\n\n return ReactJSXRuntime.jsx(Emotion, createEmotionProps(type, props), key);\n};\nvar jsxs = function jsxs(type, props, key) {\n if (!hasOwn.call(props, 'css')) {\n return ReactJSXRuntime.jsxs(type, props, key);\n }\n\n return ReactJSXRuntime.jsxs(Emotion, createEmotionProps(type, props), key);\n};\n\nexport { Fragment, jsx, jsxs };\n","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","const preferDefault = m => (m && m.default) || m\n\nif (process.env.BUILD_STAGE === `develop`) {\n module.exports = preferDefault(require(`./public-page-renderer-dev`))\n} else if (process.env.BUILD_STAGE === `build-javascript`) {\n module.exports = preferDefault(require(`./public-page-renderer-prod`))\n} else {\n module.exports = () => null\n}\n","const theme = {\n teal900: '#038766',\n teal800: '#049e77',\n teal700: '#04b488',\n teal600: '#05cb99',\n teal500: '#05e1aa',\n teal400: '#37e7bb',\n teal300: '#69edcc',\n teal200: '#9bf3dd',\n teal100: '#cdf9ee',\n teal50: '#e6fcf7',\n\n grey900: '#283237',\n grey800: '#3d474b',\n grey700: '#535b5f',\n grey600: '#697073',\n grey500: '#7e8487',\n grey400: '#94999b',\n grey300: '#a9adaf',\n grey200: '#bfc2c3',\n grey100: '#d4d6d7',\n grey50: '#eaebf7',\n grey40: '#eaebeb',\n\n // secondary colors\n\n blue900: '#1b7290',\n blue800: '#1f85a8',\n blue700: '#2498c0',\n blue600: '#29abd8',\n blue500: '#2dbef0',\n blue400: '#57cbf3',\n blue300: '#81d8f6',\n blue200: '#abe5f9',\n blue100: '#d5f2fc',\n blue50: '#eaf9fe',\n blue40: '#eafbf7',\n\n red900: '#902727',\n red800: '#a82e2e',\n red700: '#c03434',\n red600: '#d83b3b',\n red500: '#f04141',\n red400: '#f36767',\n red300: '#f68d8d',\n red200: '#f9b3b3',\n red100: '#fcd9d9',\n red50: '#feecec',\n\n lilac900: '#485499',\n lilac800: '#5462b3',\n lilac700: '#6070cc',\n lilac600: '#6c7ee6',\n lilac500: '#788cff',\n lilac400: '#93a3ff',\n lilac300: '#aebaff',\n lilac200: '#c9d1ff',\n lilac100: '#e4e8ff',\n lilac50: '#f2f4ff',\n\n pink900: '#f2f4ff',\n pink800: '#ac5858',\n pink700: '#c46464',\n pink600: '#dd7171',\n pink500: '#f57d7d',\n pink400: '#f79797',\n pink300: '#f9b1b1',\n pink200: '#fbcbcb',\n pink100: '#fde5e5',\n pink50: '#fef2f2',\n\n yellow900: '#997800',\n yellow800: '#b38c00',\n yellow700: '#cca000',\n yellow600: '#e6b400',\n yellow500: '#ffc800',\n yellow400: '#ffd333',\n yellow300: '#ffde66',\n yellow200: '#ffe999',\n yellow100: '#fff4cc',\n yellow50: '#fffae6',\n\n white: '#ffffff',\n black: '#000000',\n\n webkitFocusBlue: '#1366cf',\n\n largeFontSize: '2.2rem',\n mediumFontSize: '1.4rem',\n smallFontSize: '1.1rem',\n extraSmallFontSize: '0.9rem',\n\n smallMobile: '374px',\n mobile: '576px',\n tablet: '767px',\n laptop: '992px',\n desktop: '1200px',\n fullHD: '1440px',\n};\n\nexport default theme;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nexports.__esModule = true;\nexports.ScrollHandler = exports.ScrollContext = void 0;\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime/helpers/assertThisInitialized\"));\nvar _inheritsLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inheritsLoose\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _sessionStorage = require(\"./session-storage\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nvar ScrollContext = /*#__PURE__*/React.createContext(new _sessionStorage.SessionStorage());\nexports.ScrollContext = ScrollContext;\nScrollContext.displayName = \"GatsbyScrollContext\";\nvar ScrollHandler = /*#__PURE__*/function (_React$Component) {\n (0, _inheritsLoose2.default)(ScrollHandler, _React$Component);\n function ScrollHandler() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this._stateStorage = new _sessionStorage.SessionStorage();\n _this._isTicking = false;\n _this._latestKnownScrollY = 0;\n _this.scrollListener = function () {\n _this._latestKnownScrollY = window.scrollY;\n if (!_this._isTicking) {\n _this._isTicking = true;\n requestAnimationFrame(_this._saveScroll.bind((0, _assertThisInitialized2.default)(_this)));\n }\n };\n _this.windowScroll = function (position, prevProps) {\n if (_this.shouldUpdateScroll(prevProps, _this.props)) {\n window.scrollTo(0, position);\n }\n };\n _this.scrollToHash = function (hash, prevProps) {\n var node = document.getElementById(hash.substring(1));\n if (node && _this.shouldUpdateScroll(prevProps, _this.props)) {\n node.scrollIntoView();\n }\n };\n _this.shouldUpdateScroll = function (prevRouterProps, routerProps) {\n var shouldUpdateScroll = _this.props.shouldUpdateScroll;\n if (!shouldUpdateScroll) {\n return true;\n }\n\n // Hack to allow accessing this._stateStorage.\n return shouldUpdateScroll.call((0, _assertThisInitialized2.default)(_this), prevRouterProps, routerProps);\n };\n return _this;\n }\n var _proto = ScrollHandler.prototype;\n _proto._saveScroll = function _saveScroll() {\n var key = this.props.location.key || null;\n if (key) {\n this._stateStorage.save(this.props.location, key, this._latestKnownScrollY);\n }\n this._isTicking = false;\n };\n _proto.componentDidMount = function componentDidMount() {\n window.addEventListener(\"scroll\", this.scrollListener);\n var scrollPosition;\n var _this$props$location = this.props.location,\n key = _this$props$location.key,\n hash = _this$props$location.hash;\n if (key) {\n scrollPosition = this._stateStorage.read(this.props.location, key);\n }\n\n /** If a hash is present in the browser url as the component mounts (i.e. the user is navigating\n * from an external website) then scroll to the hash instead of any previously stored scroll\n * position. */\n if (hash) {\n this.scrollToHash(decodeURI(hash), undefined);\n } else if (scrollPosition) {\n this.windowScroll(scrollPosition, undefined);\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n window.removeEventListener(\"scroll\", this.scrollListener);\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this$props$location2 = this.props.location,\n hash = _this$props$location2.hash,\n key = _this$props$location2.key;\n var scrollPosition;\n if (key) {\n scrollPosition = this._stateStorage.read(this.props.location, key);\n }\n\n /** There are two pieces of state: the browser url and\n * history state which keeps track of scroll position\n * Native behaviour prescribes that we ought to restore scroll position\n * when a user navigates back in their browser (this is the `POP` action)\n * Currently, reach router has a bug that prevents this at https://github.com/reach/router/issues/228\n * So we _always_ stick to the url as a source of truth — if the url\n * contains a hash, we scroll to it\n */\n\n if (hash) {\n this.scrollToHash(decodeURI(hash), prevProps);\n } else {\n this.windowScroll(scrollPosition, prevProps);\n }\n };\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(ScrollContext.Provider, {\n value: this._stateStorage\n }, this.props.children);\n };\n return ScrollHandler;\n}(React.Component);\nexports.ScrollHandler = ScrollHandler;\nScrollHandler.propTypes = {\n shouldUpdateScroll: _propTypes.default.func,\n children: _propTypes.default.element.isRequired,\n location: _propTypes.default.object.isRequired\n};","\"use strict\";\n\nexports.__esModule = true;\nexports.getForwards = getForwards;\nfunction getForwards(collectedScripts) {\n return collectedScripts === null || collectedScripts === void 0 ? void 0 : collectedScripts.flatMap(script => (script === null || script === void 0 ? void 0 : script.forward) || []);\n}\n//# sourceMappingURL=get-forwards.js.map","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","\"use strict\";\n\nexports.__esModule = true;\nexports.useScrollRestoration = useScrollRestoration;\nvar _scrollHandler = require(\"./scroll-handler\");\nvar _react = require(\"react\");\nvar _reachRouter = require(\"@gatsbyjs/reach-router\");\nfunction useScrollRestoration(identifier) {\n var location = (0, _reachRouter.useLocation)();\n var state = (0, _react.useContext)(_scrollHandler.ScrollContext);\n var ref = (0, _react.useRef)(null);\n (0, _react.useLayoutEffect)(function () {\n if (ref.current) {\n var position = state.read(location, identifier);\n ref.current.scrollTo(0, position || 0);\n }\n }, [location.key]);\n return {\n ref: ref,\n onScroll: function onScroll() {\n if (ref.current) {\n state.save(location, identifier, ref.current.scrollTop);\n }\n }\n };\n}","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import { css } from '@emotion/react';\nimport theme from '@styles/common/theme';\n\nexport const defaultStyle = css`\n min-width: 6rem;\n background-color: transparent;\n border: solid 1px ${theme.grey900};\n color: ${theme.grey900};\n border-radius: 0.375rem;\n height: 1.875rem;\n display: flex;\n align-items: center;\n justify-content: center;\n outline: none;\n font-weight: bold;\n font-size: 0.938rem;\n font-family: inherit;\n transition: background-color 0.6s, color 0.6s;\n &:focus-visible {\n border: solid 2px ${theme.webkitFocusBlue};\n background-color: ${theme.yellow400};\n }\n`;\n\nexport const hoverStyle = css`\n &:hover {\n text-decoration: none;\n background-color: ${theme.grey900};\n color: white;\n cursor: pointer;\n }\n`;\n\nexport const disabledLoginStyle = css`\n border-color: ${theme.grey600};\n color: ${theme.grey600};\n cursor: not-allowed;\n`;\n","import SelectLink from '@components/common/SelectLink/SelectLink';\nimport { jsx } from '@emotion/react';\n\nimport PropTypes from 'prop-types';\n\nimport * as style from './HeaderButton.style';\n\nHeaderButton.propTypes = {\n children: PropTypes.string,\n disabled: PropTypes.bool,\n passedStyle: PropTypes.object,\n link: PropTypes.string,\n};\n\nexport default function HeaderButton({ passedStyle, children, disabled, link, handleClick }) {\n const buttonStyles = [\n style.defaultStyle,\n disabled ? style.disabledLoginStyle : style.hoverStyle,\n passedStyle,\n ];\n\n const ariaLabel = typeof children === 'string' ? children : '';\n\n return (\n \n {children}\n \n );\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.SessionStorage = void 0;\nvar STATE_KEY_PREFIX = \"@@scroll|\";\nvar GATSBY_ROUTER_SCROLL_STATE = \"___GATSBY_REACT_ROUTER_SCROLL\";\nvar SessionStorage = /*#__PURE__*/function () {\n function SessionStorage() {}\n var _proto = SessionStorage.prototype;\n _proto.read = function read(location, key) {\n var stateKey = this.getStateKey(location, key);\n try {\n var value = window.sessionStorage.getItem(stateKey);\n return value ? JSON.parse(value) : 0;\n } catch (e) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[gatsby-react-router-scroll] Unable to access sessionStorage; sessionStorage is not available.\");\n }\n if (window && window[GATSBY_ROUTER_SCROLL_STATE] && window[GATSBY_ROUTER_SCROLL_STATE][stateKey]) {\n return window[GATSBY_ROUTER_SCROLL_STATE][stateKey];\n }\n return 0;\n }\n };\n _proto.save = function save(location, key, value) {\n var stateKey = this.getStateKey(location, key);\n var storedValue = JSON.stringify(value);\n try {\n window.sessionStorage.setItem(stateKey, storedValue);\n } catch (e) {\n if (window && window[GATSBY_ROUTER_SCROLL_STATE]) {\n window[GATSBY_ROUTER_SCROLL_STATE][stateKey] = JSON.parse(storedValue);\n } else {\n window[GATSBY_ROUTER_SCROLL_STATE] = {};\n window[GATSBY_ROUTER_SCROLL_STATE][stateKey] = JSON.parse(storedValue);\n }\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[gatsby-react-router-scroll] Unable to save state in sessionStorage; sessionStorage is not available.\");\n }\n }\n };\n _proto.getStateKey = function getStateKey(location, key) {\n var stateKeyBase = \"\" + STATE_KEY_PREFIX + location.pathname;\n return key === null || typeof key === \"undefined\" ? stateKeyBase : stateKeyBase + \"|\" + key;\n };\n return SessionStorage;\n}();\nexports.SessionStorage = SessionStorage;","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\nvar _gatsby = require(\"gatsby\");\n/**\n * Get a manifest filename depending on localized pathname\n *\n * @param {string} pathname\n * @param {Array<{start_url: string, lang: string}>} localizedManifests\n * @param {boolean} shouldPrependPathPrefix\n * @return string\n */\nvar _default = (pathname, localizedManifests, shouldPrependPathPrefix = false) => {\n const defaultFilename = `manifest.webmanifest`;\n if (!Array.isArray(localizedManifests)) {\n return defaultFilename;\n }\n const localizedManifest = localizedManifests.find(app => {\n let startUrl = app.start_url;\n if (shouldPrependPathPrefix) {\n startUrl = (0, _gatsby.withPrefix)(startUrl);\n }\n return pathname.startsWith(startUrl);\n });\n if (!localizedManifest) {\n return defaultFilename;\n }\n return `manifest_${localizedManifest.lang}.webmanifest`;\n};\nexports.default = _default;","function _extends() {\n return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _extends.apply(null, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst PartytownSnippet = \"/* Partytown 0.7.6 - MIT builder.io */\\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\\\"/\\\"==(a=(o.lib||\\\"/~partytown/\\\")+(o.debug?\\\"debug/\\\":\\\"\\\"))[0]&&(s=e.querySelectorAll('script[type=\\\"text/partytown\\\"]'),i!=t?i.dispatchEvent(new CustomEvent(\\\"pt1\\\",{detail:t})):(d=setTimeout(f,1e4),e.addEventListener(\\\"pt0\\\",w),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\\\"partytown-sw.js\\\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\\\"statechange\\\",(function(t){\\\"activated\\\"==t.target.state&&h()}))}),console.error):f())))}function h(t){c=e.createElement(t?\\\"script\\\":\\\"iframe\\\"),t||(c.setAttribute(\\\"style\\\",\\\"display:block;width:0;height:0;border:0;visibility:hidden\\\"),c.setAttribute(\\\"aria-hidden\\\",!0)),c.src=a+\\\"partytown-\\\"+(t?\\\"atomics.js?v=0.7.6\\\":\\\"sandbox-sw.html?\\\"+Date.now()),e.body.appendChild(c)}function f(n,r){for(w(),i==t&&(o.forward||[]).map((function(e){delete t[e.split(\\\".\\\")[0]]})),n=0;n {\n const { forward = [], ...filteredConfig } = config || {};\n const configStr = JSON.stringify(filteredConfig, (k, v) => {\n if (typeof v === 'function') {\n v = String(v);\n if (v.startsWith(k + '(')) {\n v = 'function ' + v;\n }\n }\n return v;\n });\n return [\n `!(function(w,p,f,c){`,\n Object.keys(filteredConfig).length > 0\n ? `c=w[p]=Object.assign(w[p]||{},${configStr});`\n : `c=w[p]=w[p]||{};`,\n `c[f]=(c[f]||[])`,\n forward.length > 0 ? `.concat(${JSON.stringify(forward)})` : ``,\n `})(window,'partytown','forward');`,\n snippetCode,\n ].join('');\n};\n\n/**\n * The `type` attribute for Partytown scripts, which does two things:\n *\n * 1. Prevents the `