{"version":3,"sources":["webpack:///C:/a/2/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js","webpack:///C:/a/2/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","webpack:///C:/a/2/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","webpack:///C:/a/2/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/ApplicationInsights.js"],"names":["PageViewManager","appInsights","overridePageViewDuration","core","pageViewPerformanceManager","this","_self","_logger","arrForEach","CoreUtils","isNullOrUndefined","intervalHandle","itemQueue","pageViewPerformanceSent","_flushChannels","getTransmissionControls","queues","q","flush","logger","trackPageView","pageView","customProperties","name","doc","title","uri","location_1","href","isPerformanceTimingSupported","sendPageViewInternal","throwInternal","WARNING","NavigationTimingNotSupported","customDuration","duration","cb","pageViewSent","start","getPerformanceTiming","navigationStart","GetDuration","Date","shouldCollectDuration","undefined","isNaN","processed","isPerformanceTimingDataReady","pageViewPerformance","populatePageViewPerformanceEvent","isValid","durationMs","sendPageViewPerformanceInternal","e","CRITICAL","TrackPVFailedCalc","Util","getExceptionName","exception","dump","push","setInterval","allItems","slice","doFlush","item","length","clearInterval","PageVisitTimeManager","pageVisitTimeTrackingHandler","prevPageVisitDataKeyName","prototype","trackPreviousPageVisit","currentPageName","currentPageUrl","prevPageVisitTimeData","restartPageVisitTimer","pageName","pageUrl","pageVisitTime","warnToConsole","prevPageVisitData","stopPageVisitTimer","startPageVisitTimer","canUseSessionStorage","getSessionStorage","Error","currPageVisitData","PageVisitData","currPageVisitDataStr","stringify","setSessionStorage","pageVisitEndTime","now","pageVisitDataJsonStr","parse","pageVisitStartTime","removeSessionStorage","PageViewPerformanceManager","MAX_DURATION_ALLOWED","navigationTiming","getPerformanceNavigationTiming","timing","total","network","startTime","connectEnd","request","requestStart","responseStart","response","responseEnd","dom","loadEventEnd","ErrorPVCalc","Math","floor","ClientPerformanceMathError","perfTotal","msToTimeSpan","networkConnect","sentRequest","receivedResponse","domProcessing","InvalidDurationValue","isPerformanceNavigationTimingSupported","getEntriesByType","perf","domainLookupStart","domLoading","durations","_i","arguments","_navigator","botAgentNames","userAgent","isGoogleBot","i","toLowerCase","indexOf","_dispatchEvent","target","evnt","dispatchEvent","_super","ApplicationInsights","_this","call","identifier","priority","autoRoutePVDelay","_trackAjaxAttempts","location","_prevUri","getDefaultConfig","config","sessionRenewalMs","sessionExpirationMs","disableExceptionTracking","stringToBoolOrDefault","autoTrackPageVisitTime","enableUnhandledPromiseRejectionTracking","samplingPercentage","isCookieUseDisabled","isStorageUseDisabled","isBrowserLinkTrackingEnabled","enableAutoRouteTracking","namePrefix","processTelemetry","env","itemCtx","doNotSendItem","telemetryInitializersCount","_telemetryInitializers","_getTelCtx","telemetryInitializer","apply","diagLog","TelemetryInitializerFailed","processNext","trackEvent","event","telemetryItem","TelemetryItemCreator","create","dataType","envelopeType","track","TrackTraceFailed","startTrackEvent","_eventTracking","StartTrackEventFailed","stopTrackEvent","properties","measurements","stop","StopTrackEventFailed","trackTrace","trace","Trace","trackMetric","metric","Metric","TrackMetricFailed","inPv","_pageViewManager","_pageVisitTimeManager","TrackPVFailed","systemProperties","refUri","referrer","PageView","PageViewPerformance","trackPageViewPerformance","_pageViewPerformanceManager","startTrackPage","_pageTracking","StartTrackFailed","stopTrackPage","url","measurement","loc","StopTrackFailed","sendExceptionInternal","exceptionPartB","Exception","NotSpecified","severityLevel","id","toInterface","trackException","TrackExceptionFailed","_onerror","properties_1","URL","lineNumber","columnNumber","message","isCrossOriginError","error","_sendCORSException","isError","stack","SeverityLevel","errorString","ExceptionWhileLoggingError","addTelemetryInitializer","initialize","extensions","pluginChain","isInitialized","setInitialized","ctx","_globalconfig","instrumentationKey","endpointUrl","getExtCfg","defaults","field","getConfig","disableCookies","disableStorage","configGetters","accountId","sampleRate","cookieDomain","sdkExtension","appId","trackPageVisitTime","_addDefaultTelemetryInitializers","action","toString","pageViewItem","f","_window","_history","_location","instance","autoExceptionInstrumented","originalOnError_1","onerror","handled","autoUnhandledPromiseInstrumented","originalOnUnhandledRejection_1","reason","isFunction","pushState","replaceState","Event","_self_1","extension","_properties","ret","createDomEvent","addEventListener","context","telemetryTrace","traceID","generateW3CId","pathname","_currUri","setTimeout","bind","PageName","PageUrl","average","max","min","sampleCount","browserLinkPaths_1","_addTelemetryInitializer","envelope","baseType","RemoteDependencyData","remoteData","baseData","Version","BaseTelemetryPlugin","Timing","_name","_events","StartCalledMoreThanOnce","key","StopCalledWithoutStart","end"],"mappings":"oRAYI,EACA,SAASA,EAAgBC,EAAaC,EAA0BC,EAAMC,GAClE,YAAaJ,EAAiBK,MAAM,SAAUC,GAC1C,IAKIC,EALAC,EAAaC,EAAA,EAAUD,WACvBE,EAAoBD,EAAA,EAAUC,kBAC9BC,EAAiB,KACjBC,EAAY,GACZC,GAA0B,EAK9B,SAASC,IACDX,GACAK,EAAWL,EAAKY,2BAA2B,SAAUC,GACjDR,EAAWQ,GAAQ,SAAUC,GAAK,OAAOA,EAAEC,OAAM,SANzDf,IACAI,EAAUJ,EAAKgB,QAoCnBb,EAAMc,cAAgB,SAAUC,EAAUC,GACtC,IAAIC,EAAOF,EAASE,KACpB,GAAIb,EAAkBa,IAAyB,iBAATA,EAAmB,CACrD,IAAIC,EAAM,cACVD,EAAOF,EAASE,KAAOC,GAAOA,EAAIC,OAAS,GAE/C,IAAIC,EAAML,EAASK,IACnB,GAAIhB,EAAkBgB,IAAuB,iBAARA,EAAkB,CACnD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,EACdG,WAAOnM,GAEP0I,EAAgBC,EAAA,EAAqBC,OAAO9H,EAAWuK,EAAA,EAAUxC,SAAUwC,EAAA,EAAUvC,aAAcrL,KAAK4K,UAAW,CAAE0C,IAAKA,IAC9HtN,KAAKF,KAAKwL,MAAML,IAEpBrC,EAAoB2K,QAAU,QACvB3K,EA3gB6B,CA4gBtC4K,EAAA,GAKE,EAAwB,WACxB,SAASC,EAAO3S,EAAQI,GACpBlB,KAAK0T,MAAQxS,EACblB,KAAK2T,QAAU,GACf3T,KAAKE,QAAUY,EAqBnB,OAnBA2S,EAAOvP,UAAUjC,MAAQ,SAAUf,QACG,IAAvBlB,KAAK2T,QAAQzS,IACpBlB,KAAKE,QAAQwB,cAAc,IAAgBC,QAAS,IAAmBiS,wBAAyB,uEAAwE,CAAE1S,KAAMlB,KAAK0T,MAAOG,IAAK3S,IAAQ,GAE7MlB,KAAK2T,QAAQzS,IAAS,IAAImB,MAE9BoR,EAAOvP,UAAU4H,KAAO,SAAU5K,EAAMoM,EAAK1B,EAAYC,GACrD,IAAI5J,EAAQjC,KAAK2T,QAAQzS,GACzB,GAAIsB,MAAMP,GACNjC,KAAKE,QAAQwB,cAAc,IAAgBC,QAAS,IAAmBmS,uBAAwB,iDAAkD,CAAE5S,KAAMlB,KAAK0T,MAAOG,IAAK3S,IAAQ,OAEjL,CACD,IAAI6S,GAAO,IAAI1R,KACXP,EAAW,IAAcM,YAAYH,EAAO8R,GAChD/T,KAAKyQ,OAAOvP,EAAMoM,EAAKxL,EAAU8J,EAAYC,UAE1C7L,KAAK2T,QAAQzS,GACpBlB,KAAK2T,QAAQzS,QAAQqB,GAElBkR,EAzBgB","file":"npm.microsoft+applicationinsights-analytics-js@2.5.4.1ffe6ba69ad007ccc7e0.js","sourcesContent":["/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { DateTimeUtils, Util } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, getDocument, getLocation } from '@microsoft/applicationinsights-core-js';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\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 arrForEach = CoreUtils.arrForEach;\r\n var isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n var intervalHandle = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels() {\r\n if (core) {\r\n arrForEach(core.getTransmissionControls(), function (queues) {\r\n arrForEach(queues, function (q) { return q.flush(true); });\r\n });\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n if (!intervalHandle) {\r\n intervalHandle = setInterval((function () {\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.length === 0) {\r\n clearInterval(intervalHandle);\r\n intervalHandle = null;\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels();\r\n }\r\n }), 100);\r\n }\r\n }\r\n _self.trackPageView = 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.href || \"\";\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.isPerformanceTimingSupported()) {\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.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 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.getPerformanceTiming().navigationStart;\r\n customDuration = DateTimeUtils.GetDuration(start, +new Date);\r\n if (!pageViewPerformanceManager.shouldCollectDuration(customDuration)) {\r\n customDuration = undefined;\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.duration)) {\r\n duration = customProperties.duration;\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[\"duration\"] = customDuration;\r\n }\r\n // case 2\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\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.isPerformanceTimingDataReady()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager.populatePageViewPerformanceEvent(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[\"duration\"] = customDuration;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[\"duration\"] = pageViewPerformance.durationMs;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (DateTimeUtils.GetDuration(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[\"duration\"] = maxDurationLimit;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailedCalc, \"trackPageView failed on page load calculation: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n });\r\n }\r\n// Removed Stub for PageViewManager.prototype.trackPageView.\r\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\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 this.prevPageVisitDataKeyName = \"prevPageVisitData\";\r\n this.pageVisitTimeTrackingHandler = pageVisitTimeTrackingHandler;\r\n this._logger = logger;\r\n }\r\n /**\r\n * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time\r\n * @param currentPageName Name of page to begin timing for visit duration\r\n * @param currentPageUrl Url of page to begin timing for visit duration\r\n */\r\n PageVisitTimeManager.prototype.trackPreviousPageVisit = function (currentPageName, currentPageUrl) {\r\n try {\r\n // Restart timer for new page view\r\n var prevPageVisitTimeData = this.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 this.pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Auto track page visit time failed, metric will not be collected: \" + Util.dump(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 PageVisitTimeManager.prototype.restartPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n var prevPageVisitData = this.stopPageVisitTimer();\r\n this.startPageVisitTimer(pageName, pageUrl);\r\n return prevPageVisitData;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Call to restart failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n /**\r\n * Starts timing visit duration of pageName\r\n * @param pageName\r\n * @returns {}\r\n */\r\n PageVisitTimeManager.prototype.startPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n if (Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName) != null) {\r\n throw new Error(\"Cannot call startPageVisit consecutively without first calling stopPageVisit\");\r\n }\r\n var currPageVisitData = new PageVisitData(pageName, pageUrl);\r\n var currPageVisitDataStr = getJSON().stringify(currPageVisitData);\r\n Util.setSessionStorage(this._logger, this.prevPageVisitDataKeyName, currPageVisitDataStr);\r\n }\r\n }\r\n catch (e) {\r\n // TODO: Remove this catch in next phase, since if start is called twice in a row the exception needs to be propagated out\r\n this._logger.warnToConsole(\"Call to start failed: \" + Util.dump(e));\r\n }\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 PageVisitTimeManager.prototype.stopPageVisitTimer = function () {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n // Define end time of page's visit\r\n var pageVisitEndTime = Date.now();\r\n // Try to retrieve page name and start time from session storage\r\n var pageVisitDataJsonStr = Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n if (pageVisitDataJsonStr && hasJSON()) {\r\n // if previous page data exists, set end time of visit\r\n var prevPageVisitData = getJSON().parse(pageVisitDataJsonStr);\r\n prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime;\r\n // Remove data from storage since we already used it\r\n Util.removeSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n // Return page visit data\r\n return prevPageVisitData;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Stop page visit timer failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n return PageVisitTimeManager;\r\n}());\r\nexport { PageVisitTimeManager };\r\nvar PageVisitData = /** @class */ (function () {\r\n function PageVisitData(pageName, pageUrl) {\r\n this.pageVisitStartTime = Date.now();\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, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, getNavigator, getPerformance } from '@microsoft/applicationinsights-core-js';\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 this.MAX_DURATION_ALLOWED = 3600000; // 1h\r\n if (core) {\r\n this._logger = core.logger;\r\n }\r\n }\r\n PageViewPerformanceManager.prototype.populatePageViewPerformanceEvent = 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 var navigationTiming = this.getPerformanceNavigationTiming();\r\n var timing = this.getPerformanceTiming();\r\n if (navigationTiming || timing) {\r\n if (navigationTiming) {\r\n var total = navigationTiming.duration;\r\n var network = DateTimeUtils.GetDuration(navigationTiming.startTime, navigationTiming.connectEnd);\r\n var request = DateTimeUtils.GetDuration(navigationTiming.requestStart, navigationTiming.responseStart);\r\n var response = DateTimeUtils.GetDuration(navigationTiming.responseStart, navigationTiming.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(navigationTiming.responseEnd, navigationTiming.loadEventEnd);\r\n }\r\n else {\r\n var total = DateTimeUtils.GetDuration(timing.navigationStart, timing.loadEventEnd);\r\n var network = DateTimeUtils.GetDuration(timing.navigationStart, timing.connectEnd);\r\n var request = DateTimeUtils.GetDuration(timing.requestStart, timing.responseStart);\r\n var response = DateTimeUtils.GetDuration(timing.responseStart, timing.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(timing.responseEnd, timing.loadEventEnd);\r\n }\r\n if (total === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ErrorPVCalc, \"error calculating page view performance.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (!this.shouldCollectDuration(total, network, request, response, dom)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.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 < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(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 this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.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.duration = Util.msToTimeSpan(total);\r\n pageViewPerformance.networkConnect = Util.msToTimeSpan(network);\r\n pageViewPerformance.sentRequest = Util.msToTimeSpan(request);\r\n pageViewPerformance.receivedResponse = Util.msToTimeSpan(response);\r\n pageViewPerformance.domProcessing = Util.msToTimeSpan(dom);\r\n pageViewPerformance.isValid = true;\r\n }\r\n }\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceTiming = function () {\r\n if (this.isPerformanceTimingSupported()) {\r\n return getPerformance().timing;\r\n }\r\n return null;\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceNavigationTiming = function () {\r\n if (this.isPerformanceNavigationTimingSupported()) {\r\n return getPerformance().getEntriesByType(\"navigation\")[0];\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns true is window PerformanceNavigationTiming API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceNavigationTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.getEntriesByType && perf.getEntriesByType(\"navigation\").length > 0;\r\n };\r\n /**\r\n * Returns true is window performance timing API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.timing;\r\n };\r\n /**\r\n * As page loads different parts of performance timing numbers get set. When all of them are set we can report it.\r\n * Returns true if ready, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingDataReady = function () {\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.navigationStart > 0\r\n && timing.responseStart > 0\r\n && timing.requestStart > 0\r\n && timing.loadEventEnd > 0\r\n && timing.responseEnd > 0\r\n && timing.connectEnd > 0\r\n && timing.domLoading > 0;\r\n };\r\n /**\r\n * This method tells if given durations should be excluded from collection.\r\n */\r\n PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\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 botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google'];\r\n var userAgent = _navigator.userAgent;\r\n var isGoogleBot = false;\r\n if (userAgent) {\r\n for (var i = 0; i < botAgentNames.length; i++) {\r\n isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(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.length; i++) {\r\n if (durations[i] >= this.MAX_DURATION_ALLOWED) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return PageViewPerformanceManager;\r\n}());\r\nexport { PageViewPerformanceManager };\r\n//# sourceMappingURL=PageViewPerformanceManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * ApplicationInsights.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Util, PageViewPerformance, PageView, RemoteDependencyData, Event as EventTelemetry, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, DateTimeUtils, PropertiesPluginIdentifier, AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, CoreUtils, LoggingSeverity, _InternalMessageId, getWindow, getDocument, getHistory, getLocation } from \"@microsoft/applicationinsights-core-js\";\r\nimport { PageViewManager } from \"./Telemetry/PageViewManager\";\r\nimport { PageVisitTimeManager } from \"./Telemetry/PageVisitTimeManager\";\r\nimport { PageViewPerformanceManager } from './Telemetry/PageViewPerformanceManager';\r\n\"use strict\";\r\nvar durationProperty = \"duration\";\r\nfunction _dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n }\r\n}\r\nvar ApplicationInsights = /** @class */ (function (_super) {\r\n tslib_1.__extends(ApplicationInsights, _super);\r\n function ApplicationInsights() {\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 // Counts number of trackAjax invokations.\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 _this._trackAjaxAttempts = 0;\r\n var location = getLocation();\r\n _this._prevUri = location && location.href || \"\";\r\n return _this;\r\n }\r\n ApplicationInsights.getDefaultConfig = function (config) {\r\n if (!config) {\r\n config = {};\r\n }\r\n // set default values\r\n config.sessionRenewalMs = 30 * 60 * 1000;\r\n config.sessionExpirationMs = 24 * 60 * 60 * 1000;\r\n config.disableExceptionTracking = Util.stringToBoolOrDefault(config.disableExceptionTracking);\r\n config.autoTrackPageVisitTime = Util.stringToBoolOrDefault(config.autoTrackPageVisitTime);\r\n config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration);\r\n config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking);\r\n if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) {\r\n config.samplingPercentage = 100;\r\n }\r\n config.isCookieUseDisabled = Util.stringToBoolOrDefault(config.isCookieUseDisabled);\r\n config.isStorageUseDisabled = Util.stringToBoolOrDefault(config.isStorageUseDisabled);\r\n config.isBrowserLinkTrackingEnabled = Util.stringToBoolOrDefault(config.isBrowserLinkTrackingEnabled);\r\n config.enableAutoRouteTracking = Util.stringToBoolOrDefault(config.enableAutoRouteTracking);\r\n config.namePrefix = config.namePrefix || \"\";\r\n return config;\r\n };\r\n ApplicationInsights.prototype.processTelemetry = function (env, itemCtx) {\r\n var doNotSendItem = false;\r\n var telemetryInitializersCount = this._telemetryInitializers.length;\r\n itemCtx = this._getTelCtx(itemCtx);\r\n for (var i = 0; i < telemetryInitializersCount; ++i) {\r\n var telemetryInitializer = this._telemetryInitializers[i];\r\n if (telemetryInitializer) {\r\n try {\r\n if (telemetryInitializer.apply(null, [env]) === 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 itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"One of telemetry initializers failed, telemetry item will not be sent: \" + Util.getExceptionName(e), { exception: Util.dump(e) }, true);\r\n }\r\n }\r\n }\r\n if (!doNotSendItem) {\r\n this.processNext(env, itemCtx);\r\n }\r\n };\r\n ApplicationInsights.prototype.trackEvent = function (event, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(event, EventTelemetry.dataType, EventTelemetry.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.startTrackEvent = function (name) {\r\n try {\r\n this._eventTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, \"startTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n try {\r\n this._eventTracking.stop(name, undefined, properties); // Todo: Fix to pass measurements once type is updated\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, \"stopTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param {ITraceTelemetry} trace\r\n * @param ICustomProperties.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackTrace = function (trace, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(trace, Trace.dataType, Trace.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 {IMetricTelemetry} metric input object argument. Only name and average are mandatory.\r\n * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackMetric = function (metric, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(metric, Metric.dataType, Metric.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, \"trackMetric failed, metric will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) {\r\n try {\r\n var inPv = pageView || {};\r\n this._pageViewManager.trackPageView(inPv, tslib_1.__assign({}, inPv.properties, inPv.measurements, customProperties));\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(inPv.name, inPv.uri);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageView failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.sendPageViewInternal = 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 var telemetryItem = TelemetryItemCreator.create(pageView, PageView.dataType, PageView.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n // reset ajaxes counter\r\n this._trackAjaxAttempts = 0;\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance\r\n * @param properties\r\n */\r\n ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) {\r\n var telemetryItem = TelemetryItemCreator.create(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance\r\n * @param customProperties\r\n */\r\n ApplicationInsights.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n try {\r\n this._pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance);\r\n this.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageViewPerformance failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.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 this._pageTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, \"startTrackPage failed, page view may not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.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.href || \"\";\r\n }\r\n this._pageTracking.stop(name, url, properties, measurement);\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(name, url);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, \"stopTrackPage failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(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 ApplicationInsights.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) {\r\n var exceptionPartB = new Exception(this.diagLog(), exception.exception || new Error(Util.NotSpecified), exception.properties, exception.measurements, exception.severityLevel, exception.id).toInterface();\r\n var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this.diagLog(), customProperties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param {IExceptionTelemetry} exception Object which contains exception to be sent\r\n * @param {{[key: string]: any}} 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 * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackException = function (exception, customProperties) {\r\n try {\r\n this.sendExceptionInternal(exception, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, \"trackException failed, exception will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param {IAutoExceptionTelemetry} exception\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype._onerror = function (exception) {\r\n try {\r\n var properties_1 = {\r\n url: (exception && exception.url) || (getDocument() || {}).URL,\r\n lineNumber: exception.lineNumber,\r\n columnNumber: exception.columnNumber,\r\n message: exception.message\r\n };\r\n if (Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) {\r\n this._sendCORSException(properties_1.url);\r\n }\r\n else {\r\n if (!Util.isError(exception.error)) {\r\n var stack = \"window.onerror@\" + properties_1.url + \":\" + exception.lineNumber + \":\" + (exception.columnNumber || 0);\r\n exception.error = new Error(exception.message);\r\n exception.error.stack = stack;\r\n }\r\n this.trackException({ exception: exception.error, severityLevel: SeverityLevel.Error }, properties_1);\r\n }\r\n }\r\n catch (e) {\r\n var errorString = exception.error ?\r\n (exception.error.name + \", \" + exception.error.message)\r\n : \"null\";\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, \"_onError threw exception while logging error, error will not be collected: \"\r\n + Util.getExceptionName(e), { exception: Util.dump(e), errorString: errorString });\r\n }\r\n };\r\n ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n if (this.isInitialized()) {\r\n return;\r\n }\r\n if (CoreUtils.isNullOrUndefined(core)) {\r\n throw Error(\"Error initializing\");\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n this.setInitialized(false); // resetting the initialized state, just in case the following fails\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n this._globalconfig = {\r\n instrumentationKey: config.instrumentationKey,\r\n endpointUrl: config.endpointUrl || \"https://dc.services.visualstudio.com/v2/track\"\r\n };\r\n this.config = ctx.getExtCfg(identifier);\r\n // load default values if specified\r\n var defaults = ApplicationInsights.getDefaultConfig();\r\n if (defaults !== undefined) {\r\n for (var field in defaults) {\r\n // for each unspecified field, set the default value\r\n this.config[field] = ctx.getConfig(identifier, field, defaults[field]);\r\n }\r\n if (this._globalconfig) {\r\n for (var field in defaults) {\r\n if (this._globalconfig[field] === undefined) {\r\n this._globalconfig[field] = defaults[field];\r\n }\r\n }\r\n }\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isCookieUseDisabled) {\r\n Util.disableCookies();\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isStorageUseDisabled) {\r\n Util.disableStorage();\r\n }\r\n var configGetters = {\r\n instrumentationKey: function () { return config.instrumentationKey; },\r\n accountId: function () { return _this.config.accountId || config.accountId; },\r\n sessionRenewalMs: function () { return _this.config.sessionRenewalMs || config.sessionRenewalMs; },\r\n sessionExpirationMs: function () { return _this.config.sessionExpirationMs || config.sessionExpirationMs; },\r\n sampleRate: function () { return _this.config.samplingPercentage || config.samplingPercentage; },\r\n cookieDomain: function () { return _this.config.cookieDomain || config.cookieDomain; },\r\n sdkExtension: function () { return _this.config.sdkExtension || config.sdkExtension; },\r\n isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled || config.isBrowserLinkTrackingEnabled; },\r\n appId: function () { return _this.config.appId || config.appId; }\r\n };\r\n this._pageViewPerformanceManager = new PageViewPerformanceManager(this.core);\r\n this._pageViewManager = new PageViewManager(this, this.config.overridePageViewDuration, this.core, this._pageViewPerformanceManager);\r\n this._pageVisitTimeManager = new PageVisitTimeManager(this.diagLog(), function (pageName, pageUrl, pageVisitTime) { return _this.trackPageVisitTime(pageName, pageUrl, pageVisitTime); });\r\n this._telemetryInitializers = this._telemetryInitializers || [];\r\n this._addDefaultTelemetryInitializers(configGetters);\r\n this._eventTracking = new Timing(this.diagLog(), \"trackEvent\");\r\n this._eventTracking.action =\r\n function (name, url, duration, properties) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n _this.trackEvent({ name: name, properties: properties });\r\n };\r\n // initialize page view timing\r\n this._pageTracking = new Timing(this.diagLog(), \"trackPageView\");\r\n this._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 (CoreUtils.isNullOrUndefined(properties)) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n var pageViewItem = {\r\n name: name,\r\n uri: url,\r\n properties: properties,\r\n measurements: measurements\r\n };\r\n _this.sendPageViewInternal(pageViewItem, properties);\r\n };\r\n var _window = getWindow();\r\n var _history = getHistory();\r\n var _location = getLocation();\r\n var instance = this;\r\n if (this.config.disableExceptionTracking === false &&\r\n !this.config.autoExceptionInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onerror_1 = \"onerror\";\r\n var originalOnError_1 = _window[onerror_1];\r\n _window.onerror = function (message, url, lineNumber, columnNumber, error) {\r\n var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: message,\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: error\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoExceptionInstrumented = true;\r\n }\r\n if (this.config.disableExceptionTracking === false &&\r\n this.config.enableUnhandledPromiseRejectionTracking === true &&\r\n !this.config.autoUnhandledPromiseInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onunhandledrejection = \"onunhandledrejection\";\r\n var originalOnUnhandledRejection_1 = _window[onunhandledrejection];\r\n _window[onunhandledrejection] = function (error) {\r\n var handled = originalOnUnhandledRejection_1 && originalOnUnhandledRejection_1.call(_window, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: error.reason.toString(),\r\n error: error.reason instanceof Error ? error.reason : new Error(error.reason.toString()),\r\n url: _location ? _location.href : \"\",\r\n lineNumber: 0,\r\n columnNumber: 0\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoUnhandledPromiseInstrumented = true;\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 if (this.config.enableAutoRouteTracking === true\r\n && _history && CoreUtils.isFunction(_history.pushState) && CoreUtils.isFunction(_history.replaceState)\r\n && _window\r\n && typeof Event !== \"undefined\") {\r\n var _self_1 = this;\r\n // Find the properties plugin\r\n CoreUtils.arrForEach(extensions, function (extension) {\r\n if (extension.identifier === PropertiesPluginIdentifier) {\r\n _this._properties = extension;\r\n }\r\n });\r\n _history.pushState = (function (f) { return function pushState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"pushState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.pushState);\r\n _history.replaceState = (function (f) { return function replaceState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"replaceState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.replaceState);\r\n if (_window.addEventListener) {\r\n _window.addEventListener(_self_1.config.namePrefix + \"popstate\", function () {\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n });\r\n _window.addEventListener(_self_1.config.namePrefix + \"locationchange\", function () {\r\n if (_self_1._properties && _self_1._properties.context && _self_1._properties.context.telemetryTrace) {\r\n _self_1._properties.context.telemetryTrace.traceID = Util.generateW3CId();\r\n _self_1._properties.context.telemetryTrace.name = _location && _location.pathname || \"_unknown_\";\r\n }\r\n if (_this._currUri) {\r\n _this._prevUri = _this._currUri;\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n else {\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n setTimeout((function (uri) {\r\n // todo: override start time so that it is not affected by autoRoutePVDelay\r\n _self_1.trackPageView({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0\r\n }).bind(_this, _this._prevUri), _self_1.autoRoutePVDelay);\r\n });\r\n }\r\n }\r\n this.setInitialized(true);\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 milleseconds\r\n */\r\n ApplicationInsights.prototype.trackPageVisitTime = function (pageName, pageUrl, pageVisitTime) {\r\n var properties = { PageName: pageName, PageUrl: pageUrl };\r\n this.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 ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) {\r\n if (!configGetters.isBrowserLinkTrackingEnabled()) {\r\n var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/'];\r\n var dropBrowserLinkRequests = function (envelope) {\r\n if (envelope.baseType === RemoteDependencyData.dataType) {\r\n var remoteData = envelope.baseData;\r\n if (remoteData) {\r\n for (var i = 0; i < browserLinkPaths_1.length; i++) {\r\n if (remoteData.target && remoteData.target.indexOf(browserLinkPaths_1[i]) >= 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n this._addTelemetryInitializer(dropBrowserLinkRequests);\r\n }\r\n };\r\n ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype._sendCORSException = function (url) {\r\n var exception = {\r\n message: \"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.\",\r\n url: url,\r\n lineNumber: 0,\r\n columnNumber: 0,\r\n error: undefined\r\n };\r\n var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this.diagLog(), { url: url });\r\n this.core.track(telemetryItem);\r\n };\r\n ApplicationInsights.Version = \"2.5.4\"; // Not currently used anywhere\r\n return ApplicationInsights;\r\n}(BaseTelemetryPlugin));\r\nexport { ApplicationInsights };\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 this._name = name;\r\n this._events = {};\r\n this._logger = logger;\r\n }\r\n Timing.prototype.start = function (name) {\r\n if (typeof this._events[name] !== \"undefined\") {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StartCalledMoreThanOnce, \"start was called more than once for this event without calling stop.\", { name: this._name, key: name }, true);\r\n }\r\n this._events[name] = +new Date;\r\n };\r\n Timing.prototype.stop = function (name, url, properties, measurements) {\r\n var start = this._events[name];\r\n if (isNaN(start)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StopCalledWithoutStart, \"stop was called without a corresponding start.\", { name: this._name, key: name }, true);\r\n }\r\n else {\r\n var end = +new Date;\r\n var duration = DateTimeUtils.GetDuration(start, end);\r\n this.action(name, url, duration, properties, measurements);\r\n }\r\n delete this._events[name];\r\n this._events[name] = undefined;\r\n };\r\n return Timing;\r\n}());\r\n//# sourceMappingURL=ApplicationInsights.js.map"],"sourceRoot":""}