{"version":3,"sources":["../node_modules/@microsoft/applicationinsights-shims/dist-esm/applicationinsights-shims.js","../node_modules/@microsoft/applicationinsights-react-js/node_modules/tslib/tslib.es6.js","../node_modules/@microsoft/applicationinsights-react-js/dist-esm/ReactPlugin.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/PerfManager.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Enums.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/RequestResponseHeaders.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataSanitizer.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Util.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Session.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/PartAExtensions.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageView.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/PageViewData.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/EventData.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Domain.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Application.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Device.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Internal.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/User.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Location.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/TelemetryTrace.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/TelemetryContext.js","../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/PropertiesPlugin.js","../node_modules/@microsoft/applicationinsights-properties-js/node_modules/@microsoft/applicationinsights-common/dist-esm/applicationinsights-common.js"],"names":["strShimFunction","strShimObject","strShimUndefined","strShimPrototype","getGlobal","globalThis","self","window","global","objCreateFn","obj","func","Object","type","TypeError","tmpFunc","__extendStaticsFn","d","b","__proto__","Array","p","root","assignFn","extendsFn","globalObj","t","s","i","n","arguments","length","call","__","this","constructor","__assign","assign","__extends","extendStatics","setPrototypeOf","hasOwnProperty","_super","ReactPlugin","_this","apply","priority","identifier","prototype","create","initialize","config","core","extensions","pluginChain","_extensionConfig","extensionConfig","history","CoreUtils","arrForEach","ext","_analyticsPlugin","addHistoryListener","pageViewTelemetry","uri","location","pathname","trackPageView","processTelemetry","event","itemCtx","processNext","trackMetric","metric","customProperties","diagLog","throwInternal","CRITICAL","TelemetryInitializerFailed","pageView","listen","action","setTimeout","strUndefined","strObject","strPrototype","getGlobalInst","name","gbl","hasWindow","Boolean","getWindow","getDocument","document","getNavigator","navigator","getLocation","hasJSON","JSON","getJSON","_objGetPrototypeOf","_dynamicNames","_hasOwnProperty","prop","_isFunction","value","_isObjectOrArrayPrototype","target","_isObjectArrayOrFunctionPrototype","Function","_getObjProto","newProto","_isDynamicCandidate","funcName","skipOwn","_throwTypeError","message","_hasVisited","values","lp","_getObjName","unknownValue","theClass","delegateFunc","classProto","thisTarget","thisProto","_checkPrototype","className","instFuncs","_getInstanceFuncs","_instFuncProxy","theFunc","baseFuncs","baseProto","visited","push","_getBaseFuncs","proto","baseInstFuncs","_createDynamicPrototype","dynProtoProxy","instFunc","protoFunc","instFuncTable","_populatePrototype","PerfEvent","payloadDetails","isAsync","theDetails_1","_self","accessorDefined","start","Date","now","isChildEvt","isFunction","objDefineAccessors","getCtx","key","ParentContextKey","ChildrenContextKey","setCtx","complete","childTime","childEvts","isArray","childEvt","time","exTime","payload","PerfManager","manager","ctx","src","fire","perfEvent","_isTypeof","theType","_isUndefined","undefined","_isNullOrUndefined","_isObject","_attachEvent","eventNameWithoutOn","handlerRef","useCapture","result","e","_detachEvent","LoggingSeverity","isDate","toString","isError","isString","isNumber","isBoolean","disableCookies","_canUseCookies","newGuid","randomHexDigit","c","getRandomValues","Uint8Array","Math","random","replace","GuidRegex","r","toISOString","date","pad","num","String","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","slice","arr","callbackfn","thisArg","len","idx","arrIndexOf","searchElement","fromIndex","from","max","abs","arrMap","results","arrReduce","initialValue","strTrim","str","objKeys","hasDontEnumBug","propertyIsEnumerable","dontEnums","dontEnumsLength","getProp","setProp","defineProp","descriptor","enumerable","configurable","get","set","addEventHandler","eventName","callback","w","doc","EventHelper","Attach","isTypeof","isUndefined","isNullOrUndefined","isObject","objCreate","AttachEvent","Detach","DetachEvent","_InternalMessageId","_sanitizeDiagnosticText","text","_InternalLogMessage","msgId","msg","isUserAct","properties","messageId","strProps","stringify","diagnosticText","dataType","DiagnosticLogger","queue","_messageCount","_messageLogged","_getConfigValue","defValue","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","enableDebugExceptions","severity","messageKey","WARNING","warnToConsole","logInternalMessage","theConsole","console","logFunc","warn","resetInternalMessageCount","logMessage","throttleLimitMessage","throttleMessage","plugin","defItemCtx","_nextProxy","_hasProcessTelemetry","_hasSetNext","setNextPlugin","_hasRun","getPlugin","getNext","setNext","nextPlugin","env","mgrSource","getSource","details","perfMgr","perfEvt","currentActive","children","ex","doPerf","error","hasRun","item","_createProxyChain","plugins","proxies","lastProxy","thePlugin","newProxy","StorageType","FieldType","DistributedTracingModes","ProcessTelemetryContext","startAt","proxy","add","_copyProxyChain","srcPlugins","_copyPluginChain","logger","getCfg","getExtCfg","defaultValue","theConfig","extConfig","getConfig","field","theValue","hasNext","createNew","BaseTelemetryPlugin","_isinitialized","_rootCtx","_nextPlugin","_getTelCtx","isInitialized","setInitialized","next","currentCtx","rootCtx","_baseTelInit","getProcessTelContext","RequestHeaders","requestContextHeader","requestContextTargetKey","requestContextAppIdFormat","requestIdHeader","traceParentHeader","sdkContextHeader","sdkContextHeaderAppIdRequest","requestContextHeaderLowerCase","DataSanitizer","sanitizeKeyAndAddUniqueness","map","origLength","sanitizeKey","uniqueField","substring","MAX_NAME_LENGTH","padNumber","nameTrunc","trim","sanitizeString","maxLength","valueTrunc","MAX_STRING_LENGTH","sanitizeUrl","url","sanitizeInput","MAX_URL_LENGTH","sanitizeMessage","messageTrunc","MAX_MESSAGE_LENGTH","sanitizeException","exception","exceptionTrunc","MAX_EXCEPTION_LENGTH","sanitizeProperties","tempProps","MAX_PROPERTY_LENGTH","sanitizeMeasurements","measurements","tempMeasurements","measure","sanitizeId","id","MAX_ID_LENGTH","input","_msgId","inputTrunc","data","substr","_navigator","_isString","_uaDisallowsSameSiteNone","Util","createDomEvent","Event","createEvent","initEvent","disableStorage","_canUseLocalStorage","_canUseSessionStorage","_getLocalStorageObject","canUseLocalStorage","_getVerifiedStorageObject","LocalStorage","storageType","fail","uid","storage","setItem","getItem","removeItem","isInternalApplicationInsightsEndpoint","endpointUrl","_internalEndpoints","indexOf","toLowerCase","getStorage","getExceptionName","dump","setStorage","removeStorage","_getSessionStorageObject","canUseSessionStorage","SessionStorage","getSessionStorageKeys","keys","getSessionStorage","setSessionStorage","removeSessionStorage","canUseCookies","cookie","disallowsSameSiteNone","userAgent","search","_endsWith","setCookie","domain","domainAttrib","secureAttrib","location_1","protocol","stringToBoolOrDefault","getCookie","cookieName","cookies","split","deleteCookie","newId","charAt","floor","random32","generateW3CId","tmp","hexValues","oct","a","clockSequenceHi","getIEVersion","userAgentStr","myNav","parseInt","tridentVer","msToTimeSpan","totalms","isNaN","ms","round","sec","min","hour","days","isCrossOriginError","lineNumber","columnNumber","object","objectTypeDump","propertyValueDump","stack","IsBeaconApiSupported","sendBeacon","getExtension","extension","extIx","NotSpecified","toISOStringForIE8","UrlHelper","parseUrl","anchorIdx","_htmlAnchorIdx","anchorCache","_htmlAnchorElement","tempAnchor","createElement","host","parseHost","href","getAbsoluteUrl","getPathName","getCompleteUrl","method","absoluteUrl","toUpperCase","inclPort","fullHost","parseFullHost","match","port","CorrelationIdHelper","canIncludeCorrelationHeader","requestUrl","currentHost","disableCorrelationHeaders","correlationHeaderExcludePatterns","test","requestHost","enableCorsCorrelation","matchExists_1","includedDomains","correlationHeaderDomains","regex","RegExp","excludedDomains","correlationHeaderExcludedDomains","getCorrelationContext","responseHeader","correlationId","getCorrelationContextValue","correlationIdPrefix","keyValues","keyValue","AjaxHelper","ParseDependencyPath","commandName","parsedUrl","pathName","DateTimeUtils","Now","perf","timing","navigationStart","getTime","GetDuration","end","Session","_SessionManager","_logger","sessionExpirationMs","acquisitionSpan","sessionRenewalMs","renewalSpan","_storageNamePrefix","namePrefix","cookieNameConst","automaticSession","update","initializeAutomaticSession","acquisitionExpired","acquisitionDate","renewalExpired","renewalDate","renew","cookieUpdatedTimestamp","cookieUpdateInterval","backup","initializeAutomaticSessionWithData","sessionData","params","acq","renewal","guid","acquisitionExpiry","renewalExpiry","cookieExpiry","setTime","cookieDomnain","cookieDomain","UTCString","toUTCString","join","ContextTagKeys","applicationVersion","applicationBuild","applicationTypeId","applicationId","applicationLayer","deviceId","deviceIp","deviceLanguage","deviceLocale","deviceModel","deviceFriendlyName","deviceNetwork","deviceNetworkName","deviceOEMName","deviceOS","deviceOSVersion","deviceRoleInstance","deviceRoleName","deviceScreenResolution","deviceType","deviceMachineName","deviceVMName","deviceBrowser","deviceBrowserVersion","locationIp","locationCountry","locationProvince","locationCity","operationId","operationName","operationParentId","operationRootId","operationSyntheticSource","operationCorrelationVector","sessionId","sessionIsFirst","sessionIsNew","userAccountAcquisitionDate","userAccountId","userId","userStoreRegion","userAuthUserId","userAnonymousUserAcquisitionDate","userAuthenticatedUserAcquisitionDate","cloudName","cloudRole","cloudRoleVer","cloudRoleInstance","cloudEnvironment","cloudLocation","cloudDeploymentUnit","internalNodeName","internalSdkVersion","internalAgentVersion","internalSnippet","internalSdkSrc","Extensions","UserExt","DeviceExt","TraceExt","WebExt","AppExt","OSExt","SessionExt","SDKExt","CtxTagKeys","PageView","durationMs","aiDataContract","ver","Required","Default","duration","envelopeType","PageViewData","EventData","Application","Device","deviceClass","Internal","sdkVersion","sdkExtension","User","isNewUser","userCookieName","cookieSeparator","acqStr","accountAcquisitionDate","newCookie","name_1","accountId","authCookie","authUserCookieName","authCookieString","decodeURI","authenticatedId","setAuthenticatedUserContext","authenticatedUserId","storeInCookie","validateUserInput","encodeURI","clearAuthenticatedUserContext","Location","parentId","traceID","parentID","TelemetryContext","defaultConfig","application","internal","sessionManager","device","user","telemetryTrace","session","appId","applySessionContext","sessionContext","app","sesId","applyOperatingSystemContxt","os","applyApplicationContext","tags","build","applyDeviceContext","localId","ip","model","applyInternalContext","agentVersion","baseType","snippetVer","sdkSrc","applyLocationContext","applyOperationContext","trace","applyWebContext","web","applyUserContext","authId","cleanUp","PropertiesPlugin","getDefaultConfig","instrumentationKey","samplingPercentage","isBrowserLinkTrackingEnabled","_loop_1","this_1","context","_breezeChannel","_processTelemetryInternal"],"mappings":"8FAAA,wNAEO,IAAIA,EAAkB,WAClBC,EAAgB,SAChBC,EAAmB,YACnBC,EAAmB,YAcvB,SAASC,IACZ,cAAWC,aAAeH,GAAoBG,WACnCA,kBAEAC,OAASJ,GAAoBI,KAC7BA,YAEAC,SAAWL,GAAoBK,OAC/BA,cAEAC,IAAWN,GAAoBM,EAC/BA,EAEJ,KAQJ,SAASC,EAAYC,GACxB,IAAIC,EAAOC,OAAe,OAE1B,GAAID,EAEA,OAAOA,EAAKD,GAEhB,GAAW,MAAPA,EACA,MAAO,GAEX,IAAIG,SAAcH,EAClB,GAAIG,IAASZ,GAAiBY,IAASb,EACnC,MAAM,IAAIc,UAAU,0CAA4CJ,GAEpE,SAASK,KAET,OADAA,EAAQZ,GAAoBO,EACrB,IAAIK,EAcf,IAAIC,EAAoB,SAAUC,EAAGC,GAYjC,OAXAF,EAAoBJ,OAAuB,gBAEtC,CAAEO,UAAW,cAAgBC,OAAS,SAAUH,EAAGC,GAAKD,EAAEE,UAAYD,IAEvE,SAAUD,EAAGC,GACT,IAAK,IAAIG,KAAKH,EACNA,EAAuB,eAAEG,KACzBJ,EAAEI,GAAKH,EAAEG,MAIAJ,EAAGC,IAQhC,IAEWI,EAAMC,EAAUC,EAFvBC,EAAYrB,KAAe,GAEdmB,EAlCV,SAAoBG,GACvB,IAAK,IAAIC,EAAGC,EAAI,EAAGC,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UlrB,EAAOC,GAE/DD,EAAMspB,OACPtpB,EAAMspB,KAAO,IAEZtpB,EAAMT,MACPS,EAAMT,IAAM,IAEhB,IAAIA,EAAMS,EAAMT,IAChBA,EAAI4lB,GAAWE,WAAa9lB,EAAI4lB,GAAWE,YAAc,GACzD9lB,EAAI4lB,GAAWI,QAAUhmB,EAAI4lB,GAAWI,SAAW,GACnDhmB,EAAI4lB,GAAWC,SAAW7lB,EAAI4lB,GAAWC,UAAY,GACrD7lB,EAAI4lB,GAAWM,OAASlmB,EAAI4lB,GAAWM,QAAU,GACjDlmB,EAAI4lB,GAAWK,QAAUjmB,EAAI4lB,GAAWK,SAAW,GACnDjmB,EAAI4lB,GAAWG,UAAY/lB,EAAI4lB,GAAWG,WAAa,GACvD,IAAI0F,EAAUntB,KAAKmtB,QACnBA,EAAQjC,oBAAoB/oB,EAAOC,GACnC+qB,EAAQ3B,wBAAwBrpB,EAAOC,GACvC+qB,EAAQxB,mBAAmBxpB,EAAOC,GAClC+qB,EAAQd,sBAAsBlqB,EAAOC,GACrC+qB,EAAQV,iBAAiBtqB,EAAOC,GAChC+qB,EAAQ7B,2BAA2BnpB,EAAOC,GAC1C+qB,EAAQZ,gBAAgBpqB,EAAOC,GAC/B+qB,EAAQf,qBAAqBjqB,EAAOC,GACpC+qB,EAAQpB,qBAAqB5pB,EAAOC,GACpC+qB,EAAQR,QAAQxqB,EAAOC,IAEpBwqB,EAjG0B,CAkGnC,IACa","file":"static/js/defaultVendors~main~cd01edf3.428e2663.chunk.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var strShimFunction = \"function\";\r\nexport var strShimObject = \"object\";\r\nexport var strShimUndefined = \"undefined\";\r\nexport var strShimPrototype = \"prototype\";\r\nexport var strShimHasOwnProperty = \"hasOwnProperty\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport function getGlobal() {\r\n if (typeof globalThis !== strShimUndefined && globalThis) {\r\n return globalThis;\r\n }\r\n if (typeof self !== strShimUndefined && self) {\r\n return self;\r\n }\r\n if (typeof window !== strShimUndefined && window) {\r\n return window;\r\n }\r\n if (typeof global !== strShimUndefined && global) {\r\n return global;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport function objCreateFn(obj) {\r\n var func = Object[\"create\"];\r\n // Use build in Object.create\r\n if (func) {\r\n // Use Object create method if it exists\r\n return func(obj);\r\n }\r\n if (obj == null) {\r\n return {};\r\n }\r\n var type = typeof obj;\r\n if (type !== strShimObject && type !== strShimFunction) {\r\n throw new TypeError('Object prototype may only be an Object:' + obj);\r\n }\r\n function tmpFunc() { }\r\n tmpFunc[strShimPrototype] = obj;\r\n return new tmpFunc();\r\n}\r\nexport function __assignFn(t) {\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 (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) {\r\n t[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar __extendStaticsFn = function (d, b) {\r\n __extendStaticsFn = Object[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n for (var p in b) {\r\n if (b[strShimHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return __extendStaticsFn(d, b);\r\n};\r\nexport function __extendsFn(d, b) {\r\n __extendStaticsFn(d, b);\r\n function __() { this.constructor = d; }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());\r\n}\r\nvar globalObj = getGlobal() || {};\r\n// tslint:disable: only-arrow-functions\r\n(function (root, assignFn, extendsFn) {\r\n // Assign the globally scoped versions of the functions -- used when consuming individual ts files\r\n root.__assign = root.__assign || Object.assign || assignFn;\r\n root.__extends = root.__extends || extendsFn;\r\n})(globalObj, __assignFn, __extendsFn);\r\n// Assign local variables that will be used for embedded scenarios\r\n__assign = globalObj.__assign;\r\n__extends = globalObj.__extends;\r\n//# sourceMappingURL=applicationinsights-shims.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\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) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\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) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\r\n * ReactPlugin.ts\r\n * @copyright Microsoft 2019\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { BaseTelemetryPlugin, CoreUtils, _InternalMessageId, LoggingSeverity } from \"@microsoft/applicationinsights-core-js\";\r\nvar ReactPlugin = /** @class */ (function (_super) {\r\n tslib_1.__extends(ReactPlugin, _super);\r\n function ReactPlugin() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 185;\r\n _this.identifier = 'ReactPlugin';\r\n return _this;\r\n }\r\n ReactPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n this._extensionConfig =\r\n config.extensionConfig && config.extensionConfig[this.identifier]\r\n ? config.extensionConfig[this.identifier]\r\n : { history: null };\r\n CoreUtils.arrForEach(extensions, function (ext) {\r\n var identifier = ext.identifier;\r\n if (identifier === 'ApplicationInsightsAnalytics') {\r\n _this._analyticsPlugin = ext;\r\n }\r\n });\r\n if (this._extensionConfig.history) {\r\n this.addHistoryListener(this._extensionConfig.history);\r\n var pageViewTelemetry = {\r\n uri: this._extensionConfig.history.location.pathname\r\n };\r\n this.trackPageView(pageViewTelemetry);\r\n }\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 ReactPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n this.processNext(event, itemCtx);\r\n };\r\n ReactPlugin.prototype.trackMetric = function (metric, customProperties) {\r\n if (this._analyticsPlugin) {\r\n this._analyticsPlugin.trackMetric(metric, customProperties);\r\n }\r\n else {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"Analytics plugin is not available, React plugin telemetry will not be sent: \");\r\n }\r\n };\r\n ReactPlugin.prototype.trackPageView = function (pageView) {\r\n if (this._analyticsPlugin) {\r\n this._analyticsPlugin.trackPageView(pageView);\r\n }\r\n else {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"Analytics plugin is not available, React plugin telemetry will not be sent: \");\r\n }\r\n };\r\n ReactPlugin.prototype.addHistoryListener = function (history) {\r\n var _this = this;\r\n var locationListener = function (location, action) {\r\n // Timeout to ensure any changes to the DOM made by route changes get included in pageView telemetry\r\n setTimeout(function () {\r\n var pageViewTelemetry = { uri: location.pathname };\r\n _this.trackPageView(pageViewTelemetry);\r\n }, 500);\r\n };\r\n history.listen(locationListener);\r\n };\r\n return ReactPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default ReactPlugin;\r\n//# sourceMappingURL=ReactPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getGlobal as shimsGetGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * This file exists to hold environment utilities that are requied to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only 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\nexport var strUndefined = strShimUndefined;\r\nexport var strObject = strShimObject;\r\nexport var strPrototype = strShimPrototype;\r\nexport var strFunction = strShimFunction;\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strReactNative = \"ReactNative\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport var getGlobal = shimsGetGlobal;\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where .window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation() {\r\n if (typeof location === strObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strUndefined) {\r\n return console;\r\n }\r\n return getGlobalInst(strConsole);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getGlobalInst(strCrypto);\r\n}\r\n/**\r\n * Returns 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//# sourceMappingURL=EnvUtils.js.map","/*!\n * Microsoft Dynamic Proto Utility, 1.0.0\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * 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 * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Object[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n * @ignore\r\n */\r\nfunction _isFunction(value) {\r\n return typeof value === strFunction;\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 === Object[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || target[Constructor];\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\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 prototpe 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 && _isFunction(target[funcName]) && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n for (var name in thisTarget) {\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 pasing 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) {\r\n function _instFuncProxy(target, theFunc) {\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n for (var name in instFuncs) {\r\n // Create an instance callback for pasing 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 for (var name in baseProto) {\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 pasing 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\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 * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n var _this = this;\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 (_this && _hasOwnProperty(proto, DynClassName)) {\r\n var instFunc = ((_this[DynInstFuncTable] || {})[proto[DynClassName]] || {})[funcName];\r\n if (instFunc) {\r\n // Used the instance function property\r\n return instFunc.apply(_this, arguments);\r\n }\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\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 === dynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (!_isFunction(protoFunc)) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc.apply(_this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n for (var name in target) {\r\n // Only add overriden 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[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype heirarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whther the passed prototype instance is in the heirarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass This is the current class instance which contains the prototype for the current class\r\n * @param target The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc The callback function (closure) that will create the dynamic function\r\n */\r\nfunction dynamicProto(theClass, target, delegateFunc) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class heirarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n // 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 overriden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs);\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 // Populate the Prototype for any overidden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs);\r\n}\n\nexport default dynamicProto;\n//# sourceMappingURL=dynamicproto-js.js.map\n","import dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n var accessorDefined = false;\r\n _self.start = Date.now();\r\n _self.name = name;\r\n _self.isAsync = isAsync;\r\n _self.isChildEvt = function () { return false; };\r\n if (CoreUtils.isFunction(payloadDetails)) {\r\n // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback\r\n var theDetails_1;\r\n accessorDefined = CoreUtils.objDefineAccessors(_self, 'payload', function () {\r\n // Delay the execution of the payloadDetails until needed\r\n if (!theDetails_1 && CoreUtils.isFunction(payloadDetails)) {\r\n theDetails_1 = payloadDetails();\r\n // clear it out now so the referenced objects can be garbage collected\r\n payloadDetails = null;\r\n }\r\n return theDetails_1;\r\n });\r\n }\r\n _self.getCtx = function (key) {\r\n if (key) {\r\n // The parent and child links are located directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n // Put the parent and child links directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent.ParentContextKey) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self.isChildEvt = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent.ChildrenContextKey) {\r\n _self[key] = value;\r\n }\r\n else {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n }\r\n };\r\n _self.complete = function () {\r\n var childTime = 0;\r\n var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey);\r\n if (CoreUtils.isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts.length; lp++) {\r\n var childEvt = childEvts[lp];\r\n if (childEvt) {\r\n childTime += childEvt.time;\r\n }\r\n }\r\n }\r\n _self.time = Date.now() - _self.start;\r\n _self.exTime = _self.time - childTime;\r\n _self.complete = function () { };\r\n if (!accessorDefined && CoreUtils.isFunction(payloadDetails)) {\r\n // If we couldn't define the property set during complete -- to minimize the perf impact until after the time\r\n _self.payload = payloadDetails();\r\n }\r\n };\r\n }\r\n PerfEvent.ParentContextKey = \"parent\";\r\n PerfEvent.ChildrenContextKey = \"childEvts\";\r\n return PerfEvent;\r\n}());\r\nexport { PerfEvent };\r\nvar PerfManager = /** @class */ (function () {\r\n function PerfManager(manager) {\r\n /**\r\n * General bucket used for execution context set and retrieved via setCtx() and getCtx.\r\n * Defined as private so it can be visualized via the DebugPlugin\r\n */\r\n this.ctx = {};\r\n dynamicProto(PerfManager, this, function (_self) {\r\n _self.create = function (src, payloadDetails, isAsync) {\r\n // TODO (newylie): 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 }\r\n if (manager) {\r\n manager.perfEvent(perfEvent);\r\n }\r\n };\r\n _self.setCtx = function (key, value) {\r\n if (key) {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n };\r\n _self.getCtx = function (key) {\r\n return (_self[strExecutionContextKey] || {})[key];\r\n };\r\n });\r\n }\r\n PerfManager.prototype.create = function (src, payload, isAsync) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n PerfManager.prototype.fire = function (perfEvent) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Set an execution context value\r\n * @param key - The context key name\r\n * @param value - The value\r\n */\r\n PerfManager.prototype.setCtx = function (key, value) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get the execution context value\r\n * @param key - The context key\r\n */\r\n PerfManager.prototype.getCtx = function (key) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PerfManager;\r\n}());\r\nexport { PerfManager };\r\n//# sourceMappingURL=PerfManager.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { getWindow, getDocument, getCrypto } from './EnvUtils';\r\nimport { PerfEvent } from '../JavaScriptSDK/PerfManager';\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nfunction _isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\n;\r\nfunction _isUndefined(value) {\r\n return _isTypeof(value, strShimUndefined) || value === undefined;\r\n}\r\n;\r\nfunction _isNullOrUndefined(value) {\r\n return (_isUndefined(value) || value === null);\r\n}\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[strShimPrototype].hasOwnProperty.call(obj, prop);\r\n}\r\n;\r\nfunction _isObject(value) {\r\n return _isTypeof(value, strShimObject);\r\n}\r\n;\r\nfunction _isFunction(value) {\r\n return _isTypeof(value, strShimFunction);\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\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\nfunction _attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!_isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9 \r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nfunction _detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!_isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\nvar CoreUtils = /** @class */ (function () {\r\n function CoreUtils() {\r\n }\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n CoreUtils.isDate = function (obj) {\r\n return Object[strShimPrototype].toString.call(obj) === \"[object Date]\";\r\n };\r\n /**\r\n * Check if an object is of type Array\r\n */\r\n CoreUtils.isArray = function (obj) {\r\n return Object[strShimPrototype].toString.call(obj) === \"[object Array]\";\r\n };\r\n /**\r\n * Check if an object is of type Error\r\n */\r\n CoreUtils.isError = function (obj) {\r\n return Object[strShimPrototype].toString.call(obj) === \"[object Error]\";\r\n };\r\n /**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\n CoreUtils.isString = function (value) {\r\n return _isTypeof(value, \"string\");\r\n };\r\n /**\r\n * Checks if the type of value is a number.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\n CoreUtils.isNumber = function (value) {\r\n return _isTypeof(value, \"number\");\r\n };\r\n /**\r\n * Checks if the type of value is a boolean.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isBoolean = function (value) {\r\n return _isTypeof(value, \"boolean\");\r\n };\r\n /**\r\n * Creates a new GUID.\r\n * @return {string} A GUID.\r\n */\r\n CoreUtils.disableCookies = function () {\r\n CoreUtils._canUseCookies = false;\r\n };\r\n CoreUtils.newGuid = function () {\r\n function randomHexDigit() {\r\n var c = getCrypto();\r\n if (c) {\r\n return (c.getRandomValues(new Uint8Array(1))[0] % 16);\r\n }\r\n return Math.random() * 16;\r\n }\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {\r\n var r = (randomHexDigit() | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n };\r\n /**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\n CoreUtils.toISOString = function (date) {\r\n if (CoreUtils.isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n };\r\n /**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrForEach = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n for (var idx = 0; idx < len; idx++) {\r\n if (idx in arr) {\r\n callbackfn.call(thisArg || arr, arr[idx], idx, arr);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\n CoreUtils.arrIndexOf = function (arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n return -1;\r\n };\r\n /**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrMap = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n return results;\r\n };\r\n /**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\n CoreUtils.arrReduce = function (arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n CoreUtils.strTrim = function (str) {\r\n if (!CoreUtils.isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\n CoreUtils.objKeys = function (obj) {\r\n var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');\r\n if (!_isFunction(obj) && (!_isObject(obj) || obj === null)) {\r\n throw new TypeError('objKeys called on non-object');\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (_hasOwnProperty(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (hasDontEnumBug) {\r\n var dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ];\r\n var dontEnumsLength = dontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (_hasOwnProperty(obj, dontEnums[lp])) {\r\n result.push(dontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n /**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @param target The object on which to define the property.\r\n * @param prop The name of the property to be defined or modified.\r\n * @param getProp The getter function to wire against the getter.\r\n * @param setProp The setter function to wire against the setter.\r\n * @returns True if it was able to create the accessors otherwise false\r\n */\r\n CoreUtils.objDefineAccessors = function (target, prop, getProp, setProp) {\r\n var defineProp = Object[\"defineProperty\"];\r\n if (defineProp) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n defineProp(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n CoreUtils.addEventHandler = function (eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = _attachEvent(w, eventName, callback);\r\n result = _attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = EventHelper.Attach(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n };\r\n CoreUtils.isTypeof = _isTypeof;\r\n CoreUtils.isUndefined = _isUndefined;\r\n CoreUtils.isNullOrUndefined = _isNullOrUndefined;\r\n CoreUtils.hasOwnProperty = _hasOwnProperty;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isFunction = _isFunction;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isObject = _isObject;\r\n /**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\n // tslint:disable-next-line: member-ordering\r\n CoreUtils.objCreate = objCreateFn;\r\n return CoreUtils;\r\n}());\r\nexport { CoreUtils };\r\nvar GuidRegex = /[xy]/g;\r\nvar EventHelper = /** @class */ (function () {\r\n function EventHelper() {\r\n }\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.Attach = _attachEvent;\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 * @deprecated Use {@link EventHelper#Attach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.AttachEvent = _attachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.Detach = _detachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @deprecated Use {@link EventHelper#Detach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.DetachEvent = _detachEvent;\r\n return EventHelper;\r\n}());\r\nexport { EventHelper };\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 && CoreUtils.isFunction(perfMgr[\"getPerfMgr\"])) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[\"getPerfMgr\"]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr.getCtx(doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt.setCtx) {\r\n perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive);\r\n if (currentActive.getCtx && currentActive.setCtx) {\r\n var children = currentActive.getCtx(PerfEvent.ChildrenContextKey);\r\n if (!children) {\r\n children = [];\r\n currentActive.setCtx(PerfEvent.ChildrenContextKey, children);\r\n }\r\n children.push(perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr.setCtx(doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt.setCtx) {\r\n perfEvt.setCtx(\"exception\", ex);\r\n }\r\n }\r\n finally {\r\n // fire the perf event\r\n if (perfEvt) {\r\n perfMgr.fire(perfEvt);\r\n }\r\n // Reset the active event to the previous value\r\n perfMgr.setCtx(doPerfActiveKey, currentActive);\r\n }\r\n }\r\n }\r\n return func();\r\n}\r\n//# sourceMappingURL=CoreUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73,\r\n NotificationException: 74,\r\n SnippetScriptLoadFailure: 99\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { hasJSON, getJSON, getConsole } from \"./EnvUtils\";\r\nimport dynamicProto from '@microsoft/dynamicproto-js';\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\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n}\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var _self = this;\r\n _self.messageId = msgId;\r\n _self.message =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : \"\");\r\n _self.message += diagnosticText;\r\n }\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n this.identifier = 'DiagnosticLogger';\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Count of internal messages sent\r\n */\r\n var _messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n var _messageLogged = {};\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n var isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n var isUndefined = CoreUtils.isUndefined;\r\n var isFunction = CoreUtils.isFunction;\r\n if (isNullOrUndefined(config)) {\r\n config = {};\r\n }\r\n _self.consoleLoggingLevel = function () { return _getConfigValue('loggingLevelConsole', 0); };\r\n _self.telemetryLoggingLevel = function () { return _getConfigValue('loggingLevelTelemetry', 1); };\r\n _self.maxInternalMessageLimit = function () { return _getConfigValue('maxMessageLimit', 25); };\r\n _self.enableDebugExceptions = function () { return _getConfigValue('enableDebugExceptions', false); };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n if (_self.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n if (!isUndefined(message) && !!message) {\r\n if (!isUndefined(message.message)) {\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message.messageId;\r\n if (!_messageLogged[messageKey] && _self.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _self.warnToConsole(message.message);\r\n _messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // don't log internal AI traces in the console, unless the verbose logging is enabled\r\n if (_self.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _self.warnToConsole(message.message);\r\n }\r\n }\r\n _self.logInternalMessage(severity, message);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n _self.warnToConsole = function (message) {\r\n var theConsole = getConsole();\r\n if (!!theConsole) {\r\n var logFunc = 'log';\r\n if (theConsole.warn) {\r\n logFunc = 'warn';\r\n }\r\n if (isFunction(theConsole[logFunc])) {\r\n theConsole[logFunc](message);\r\n }\r\n }\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n _self.logInternalMessage = function (severity, message) {\r\n if (_areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _self.telemetryLoggingLevel()) {\r\n _self.queue.push(message);\r\n _messageCount++;\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _self.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _self.queue.push(throttleMessage);\r\n _self.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n };\r\n function _getConfigValue(name, defValue) {\r\n var value = config[name];\r\n if (!isNullOrUndefined(value)) {\r\n return value;\r\n }\r\n return defValue;\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _self.maxInternalMessageLimit();\r\n }\r\n });\r\n }\r\n /**\r\n * When this is true the SDK will throw exceptions to aid in debugging.\r\n */\r\n DiagnosticLogger.prototype.enableDebugExceptions = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * 0: OFF (default)\r\n * 1: CRITICAL\r\n * 2: >= WARNING\r\n */\r\n DiagnosticLogger.prototype.consoleLoggingLevel = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 0;\r\n };\r\n /**\r\n * 0: OFF\r\n * 1: CRITICAL (default)\r\n * 2: >= WARNING\r\n */\r\n DiagnosticLogger.prototype.telemetryLoggingLevel = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 1;\r\n };\r\n /**\r\n * The maximum number of internal messages allowed to be sent per page view\r\n */\r\n DiagnosticLogger.prototype.maxInternalMessageLimit = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 25;\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 {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n DiagnosticLogger.prototype.warnToConsole = function (message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n DiagnosticLogger.prototype.resetInternalMessageCount = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n DiagnosticLogger.prototype.logInternalMessage = function (severity, message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils, doPerf } from \"./CoreUtils\";\r\nimport { LoggingSeverity, _InternalMessageId } from '../JavaScriptSDK.Enums/LoggingEnums';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = _isFunction(plugin.processTelemetry);\r\n var _hasSetNext = _isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n var identifier = plugin ? plugin.identifier : \"TelemetryPluginChain\";\r\n doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + \":processTelemetry\"; }, function () {\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some \r\n // other form of error occurred\r\n itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + error);\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }, function () { return ({ item: env }); }, !(env.sync));\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && CoreUtils.isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n CoreUtils.arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && CoreUtils.isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (CoreUtils.isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n var logger = (core || {}).logger;\r\n if (!logger) {\r\n // Fallback so we always have a logger\r\n logger = new DiagnosticLogger(config || {});\r\n }\r\n return logger;\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !_isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !_isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !_isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Type of storage to differentiate between local storage and session storage\r\n */\r\nexport var StorageType;\r\n(function (StorageType) {\r\n StorageType[StorageType[\"LocalStorage\"] = 0] = \"LocalStorage\";\r\n StorageType[StorageType[\"SessionStorage\"] = 1] = \"SessionStorage\";\r\n})(StorageType || (StorageType = {}));\r\n/**\r\n * Enum is used in aiDataContract to describe how fields are serialized.\r\n * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array\r\n */\r\nexport var FieldType;\r\n(function (FieldType) {\r\n FieldType[FieldType[\"Default\"] = 0] = \"Default\";\r\n FieldType[FieldType[\"Required\"] = 1] = \"Required\";\r\n FieldType[FieldType[\"Array\"] = 2] = \"Array\";\r\n FieldType[FieldType[\"Hidden\"] = 4] = \"Hidden\";\r\n})(FieldType || (FieldType = {}));\r\n;\r\nexport var DistributedTracingModes;\r\n(function (DistributedTracingModes) {\r\n /**\r\n * (Default) Send Application Insights correlation headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI\"] = 0] = \"AI\";\r\n /**\r\n * Send both W3C Trace Context headers and back-compatibility Application Insights headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI_AND_W3C\"] = 1] = \"AI_AND_W3C\";\r\n /**\r\n * Send W3C Trace Context headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"W3C\"] = 2] = \"W3C\";\r\n})(DistributedTracingModes || (DistributedTracingModes = {}));\r\n//# sourceMappingURL=Enums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar getPlugin = \"getPlugin\";\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && _isFunction(_nextPlugin.processTelemetry)) {\r\n // Looks like backward compatibility or out of band processing. And as it looks \r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[getPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n config.extensionConfig = config.extensionConfig || [];\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[getPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar RequestHeaders = /** @class */ (function () {\r\n function RequestHeaders() {\r\n }\r\n /**\r\n * Request-Context header\r\n */\r\n RequestHeaders.requestContextHeader = \"Request-Context\";\r\n /**\r\n * Target instrumentation header that is added to the response and retrieved by the\r\n * calling application when processing incoming responses.\r\n */\r\n RequestHeaders.requestContextTargetKey = \"appId\";\r\n /**\r\n * Request-Context appId format\r\n */\r\n RequestHeaders.requestContextAppIdFormat = \"appId=cid-v1:\";\r\n /**\r\n * Request-Id header\r\n */\r\n RequestHeaders.requestIdHeader = \"Request-Id\";\r\n /**\r\n * W3C distributed tracing protocol header\r\n */\r\n RequestHeaders.traceParentHeader = \"traceparent\";\r\n /**\r\n * Sdk-Context header\r\n * If this header passed with appId in content then appId will be returned back by the backend.\r\n */\r\n RequestHeaders.sdkContextHeader = \"Sdk-Context\";\r\n /**\r\n * String to pass in header for requesting appId back from the backend.\r\n */\r\n RequestHeaders.sdkContextHeaderAppIdRequest = \"appId\";\r\n RequestHeaders.requestContextHeaderLowerCase = \"request-context\";\r\n return RequestHeaders;\r\n}());\r\nexport { RequestHeaders };\r\n//# sourceMappingURL=RequestResponseHeaders.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { LoggingSeverity, _InternalMessageId, CoreUtils, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\nvar DataSanitizer = /** @class */ (function () {\r\n function DataSanitizer() {\r\n }\r\n DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) {\r\n var origLength = key.length;\r\n var field = DataSanitizer.sanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field.length !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n };\r\n DataSanitizer.sanitizeKey = function (logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitepace\r\n name = DataSanitizer.trim(name.toString());\r\n // truncate the string to 150 chars\r\n if (name.length > DataSanitizer.MAX_NAME_LENGTH) {\r\n nameTrunc = name.substring(0, DataSanitizer.MAX_NAME_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, \"name is too long. It has been truncated to \" + DataSanitizer.MAX_NAME_LENGTH + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n };\r\n DataSanitizer.sanitizeString = function (logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work\r\n value = DataSanitizer.trim(value);\r\n if (value.toString().length > maxLength) {\r\n valueTrunc = value.toString().substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.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\n DataSanitizer.sanitizeUrl = function (logger, url) {\r\n return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, _InternalMessageId.UrlTooLong);\r\n };\r\n DataSanitizer.sanitizeMessage = function (logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) {\r\n messageTrunc = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, \"message is too long, it has been truncated to \" + DataSanitizer.MAX_MESSAGE_LENGTH + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n };\r\n DataSanitizer.sanitizeException = function (logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) {\r\n exceptionTrunc = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, \"exception is too long, it has been truncated to \" + DataSanitizer.MAX_EXCEPTION_LENGTH + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n };\r\n DataSanitizer.sanitizeProperties = function (logger, properties) {\r\n if (properties) {\r\n var tempProps = {};\r\n for (var prop in properties) {\r\n var value = properties[prop];\r\n if (CoreUtils.isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON().stringify(value);\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = DataSanitizer.sanitizeString(logger, value, DataSanitizer.MAX_PROPERTY_LENGTH);\r\n prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps);\r\n tempProps[prop] = value;\r\n }\r\n properties = tempProps;\r\n }\r\n return properties;\r\n };\r\n DataSanitizer.sanitizeMeasurements = function (logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements = {};\r\n for (var measure in measurements) {\r\n var value = measurements[measure];\r\n measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements);\r\n tempMeasurements[measure] = value;\r\n }\r\n measurements = tempMeasurements;\r\n }\r\n return measurements;\r\n };\r\n DataSanitizer.sanitizeId = function (logger, id) {\r\n return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, _InternalMessageId.IdTooLong).toString() : id;\r\n };\r\n DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = DataSanitizer.trim(input);\r\n if (input.length > maxLength) {\r\n inputTrunc = input.substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.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\n DataSanitizer.padNumber = function (num) {\r\n var s = \"00\" + num;\r\n return s.substr(s.length - 3);\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n DataSanitizer.trim = function (str) {\r\n if (!CoreUtils.isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * Max length allowed for custom names.\r\n */\r\n DataSanitizer.MAX_NAME_LENGTH = 150;\r\n /**\r\n * Max length allowed for Id field in page views.\r\n */\r\n DataSanitizer.MAX_ID_LENGTH = 128;\r\n /**\r\n * Max length allowed for custom values.\r\n */\r\n DataSanitizer.MAX_PROPERTY_LENGTH = 8192;\r\n /**\r\n * Max length allowed for names\r\n */\r\n DataSanitizer.MAX_STRING_LENGTH = 1024;\r\n /**\r\n * Max length allowed for url.\r\n */\r\n DataSanitizer.MAX_URL_LENGTH = 2048;\r\n /**\r\n * Max length allowed for messages.\r\n */\r\n DataSanitizer.MAX_MESSAGE_LENGTH = 32768;\r\n /**\r\n * Max length allowed for exceptions.\r\n */\r\n DataSanitizer.MAX_EXCEPTION_LENGTH = 32768;\r\n return DataSanitizer;\r\n}());\r\nexport { DataSanitizer };\r\n//# sourceMappingURL=DataSanitizer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { StorageType } from \"./Enums\";\r\nimport { CoreUtils, EventHelper, _InternalMessageId, LoggingSeverity, getGlobal, getGlobalInst, getWindow, getDocument, getNavigator, getPerformance, getLocation, hasJSON, getJSON, strPrototype } from \"@microsoft/applicationinsights-core-js\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { DataSanitizer } from \"./Telemetry/Common/DataSanitizer\";\r\nvar _navigator = getNavigator();\r\nvar _isString = CoreUtils.isString;\r\nvar _uaDisallowsSameSiteNone = null;\r\nfunction _endsWith(value, search) {\r\n var len = value.length;\r\n var start = len - search.length;\r\n return value.substring(start >= 0 ? start : 0, len) === search;\r\n}\r\nvar Util = /** @class */ (function () {\r\n function Util() {\r\n }\r\n Util.createDomEvent = function (eventName) {\r\n var event = null;\r\n if (CoreUtils.isFunction(Event)) {\r\n event = new Event(eventName);\r\n }\r\n else {\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 /*\r\n * Force the SDK not to use local and session storage\r\n */\r\n Util.disableStorage = function () {\r\n Util._canUseLocalStorage = false;\r\n Util._canUseSessionStorage = false;\r\n };\r\n /**\r\n * Gets the localStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getLocalStorageObject = function () {\r\n if (Util.canUseLocalStorage()) {\r\n return Util._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 * @return {Storage} Returns storage object verified that it is usable\r\n */\r\n Util._getVerifiedStorageObject = function (storageType) {\r\n var storage = null;\r\n var fail;\r\n var uid;\r\n try {\r\n if (CoreUtils.isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n uid = new Date;\r\n storage = storageType === StorageType.LocalStorage ? getGlobalInst(\"localStorage\") : getGlobalInst(\"sessionStorage\");\r\n storage.setItem(uid.toString(), uid.toString());\r\n fail = storage.getItem(uid.toString()) !== uid.toString();\r\n storage.removeItem(uid.toString());\r\n if (fail) {\r\n storage = null;\r\n }\r\n }\r\n catch (exception) {\r\n storage = null;\r\n }\r\n return storage;\r\n };\r\n /**\r\n * Checks if endpoint URL is application insights internal injestion service URL.\r\n *\r\n * @param endpointUrl Endpoint URL to check.\r\n * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL.\r\n */\r\n Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) {\r\n return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1;\r\n };\r\n /**\r\n * Check if the browser supports local storage.\r\n *\r\n * @returns {boolean} True if local storage is supported.\r\n */\r\n Util.canUseLocalStorage = function () {\r\n if (Util._canUseLocalStorage === undefined) {\r\n Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return Util._canUseLocalStorage;\r\n };\r\n /**\r\n * Get an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, \"Browser failed read of local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setStorage = function (logger, name, data) {\r\n var storage = Util._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 Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, \"Browser failed write to local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, \"Browser failed removal of local storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Gets the sessionStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getSessionStorageObject = function () {\r\n if (Util.canUseSessionStorage()) {\r\n return Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Check if the browser supports session storage.\r\n *\r\n * @returns {boolean} True if session storage is supported.\r\n */\r\n Util.canUseSessionStorage = function () {\r\n if (Util._canUseSessionStorage === undefined) {\r\n Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return Util._canUseSessionStorage;\r\n };\r\n /**\r\n * Gets the list of session storage keys\r\n *\r\n * @returns {string[]} List of session storage keys\r\n */\r\n Util.getSessionStorageKeys = function () {\r\n var keys = [];\r\n if (Util.canUseSessionStorage()) {\r\n for (var key in getGlobalInst(\"sessionStorage\")) {\r\n keys.push(key);\r\n }\r\n }\r\n return keys;\r\n };\r\n /**\r\n * Get an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, \"Browser failed read of session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setSessionStorage = function (logger, name, data) {\r\n var storage = Util._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 Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, \"Browser failed write to session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, \"Browser failed removal of session storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /*\r\n * Force the SDK not to store and read any data from cookies\r\n */\r\n Util.disableCookies = function () {\r\n CoreUtils.disableCookies();\r\n };\r\n /*\r\n * helper method to tell if document.cookie object is available\r\n */\r\n Util.canUseCookies = function (logger) {\r\n if (CoreUtils._canUseCookies === undefined) {\r\n CoreUtils._canUseCookies = false;\r\n try {\r\n CoreUtils._canUseCookies = Util.document.cookie !== undefined;\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, \"Cannot access document.cookie - \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n ;\r\n }\r\n return CoreUtils._canUseCookies;\r\n };\r\n Util.disallowsSameSiteNone = function (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 (userAgent.indexOf(\"CPU iPhone OS 12\") !== -1 || userAgent.indexOf(\"iPad; CPU OS 12\") !== -1) {\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 (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && userAgent.indexOf(\"Version/\") !== -1 && userAgent.indexOf(\"Safari\") !== -1) {\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 (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && _endsWith(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 (userAgent.indexOf(\"Chrome/5\") !== -1 || userAgent.indexOf(\"Chrome/6\") !== -1) {\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 (userAgent.indexOf(\"UnrealEngine\") !== -1 && userAgent.indexOf(\"Chrome\") === -1) {\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 (userAgent.indexOf(\"UCBrowser/12\") !== -1 || userAgent.indexOf(\"UCBrowser/11\") !== -1) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * helper method to set userId and sessionId cookie\r\n */\r\n Util.setCookie = function (logger, name, value, domain) {\r\n if (Util.canUseCookies(logger)) {\r\n var domainAttrib = \"\";\r\n var secureAttrib = \"\";\r\n if (domain) {\r\n domainAttrib = \";domain=\" + domain;\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n secureAttrib = \";secure\";\r\n if (_uaDisallowsSameSiteNone === null) {\r\n _uaDisallowsSameSiteNone = Util.disallowsSameSiteNone((getNavigator() || {}).userAgent);\r\n }\r\n if (!_uaDisallowsSameSiteNone) {\r\n value = value + \";SameSite=None\"; // SameSite can only be set on secure pages\r\n }\r\n }\r\n Util.document.cookie = name + \"=\" + value + domainAttrib + \";path=/\" + secureAttrib;\r\n }\r\n };\r\n Util.stringToBoolOrDefault = function (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().toLowerCase() === \"true\";\r\n };\r\n /**\r\n * helper method to access userId and sessionId cookie\r\n */\r\n Util.getCookie = function (logger, name) {\r\n if (!Util.canUseCookies(logger)) {\r\n return;\r\n }\r\n var value = \"\";\r\n if (name && name.length) {\r\n var cookieName = name + \"=\";\r\n var cookies = Util.document.cookie.split(\";\");\r\n for (var i = 0; i < cookies.length; i++) {\r\n var cookie = cookies[i];\r\n cookie = Util.trim(cookie);\r\n if (cookie && cookie.indexOf(cookieName) === 0) {\r\n value = cookie.substring(cookieName.length, cookies[i].length);\r\n break;\r\n }\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Deletes a cookie by setting it's expiration time in the past.\r\n * @param name - The name of the cookie to delete.\r\n */\r\n Util.deleteCookie = function (logger, name) {\r\n if (Util.canUseCookies(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n Util.document.cookie = name + \"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\r\n }\r\n };\r\n /**\r\n * generate random id string\r\n */\r\n Util.newId = function () {\r\n var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n var result = \"\";\r\n // tslint:disable-next-line:insecure-random\r\n var random = Math.random() * 1073741824; // 5 symbols in base64, almost maxint\r\n while (random > 0) {\r\n var char = base64chars.charAt(random % 64);\r\n result += char;\r\n random = Math.floor(random / 64);\r\n }\r\n return result;\r\n };\r\n /**\r\n * generate a random 32bit number (-0x80000000..0x7FFFFFFF).\r\n */\r\n Util.random32 = function () {\r\n return (0x100000000 * Math.random()) | 0;\r\n };\r\n /**\r\n * generate W3C trace id\r\n */\r\n Util.generateW3CId = function () {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = \"\", tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = Util.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 + (Math.random() * 4) | 0];\r\n return oct.substr(0, 8) + oct.substr(9, 4) + \"4\" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);\r\n };\r\n /**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\n Util.getIEVersion = function (userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n var myNav = userAgentStr ? userAgentStr.toLowerCase() : (_navigator ? (_navigator.userAgent || \"\").toLowerCase() : \"\");\r\n if (myNav.indexOf(\"msie\") !== -1) {\r\n return parseInt(myNav.split(\"msie\")[1]);\r\n }\r\n else if (myNav.indexOf(\"trident/\")) {\r\n var tridentVer = parseInt(myNav.split(\"trident/\")[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Convert ms to c# time span format\r\n */\r\n Util.msToTimeSpan = function (totalms) {\r\n if (isNaN(totalms) || totalms < 0) {\r\n totalms = 0;\r\n }\r\n totalms = Math.round(totalms);\r\n var ms = \"\" + totalms % 1000;\r\n var sec = \"\" + Math.floor(totalms / 1000) % 60;\r\n var min = \"\" + Math.floor(totalms / (1000 * 60)) % 60;\r\n var hour = \"\" + Math.floor(totalms / (1000 * 60 * 60)) % 24;\r\n var days = Math.floor(totalms / (1000 * 60 * 60 * 24));\r\n ms = ms.length === 1 ? \"00\" + ms : ms.length === 2 ? \"0\" + ms : ms;\r\n sec = sec.length < 2 ? \"0\" + sec : sec;\r\n min = min.length < 2 ? \"0\" + min : min;\r\n hour = hour.length < 2 ? \"0\" + hour : hour;\r\n return (days > 0 ? days + \".\" : \"\") + hour + \":\" + min + \":\" + sec + \".\" + ms;\r\n };\r\n /**\r\n * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error\r\n * happens in a script from other domain (cross origin, CORS).\r\n */\r\n Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) {\r\n return (message === \"Script error.\" || message === \"Script error\") && !error;\r\n };\r\n /**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\n Util.dump = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n };\r\n /**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\n Util.getExceptionName = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n if (objectTypeDump === \"[object Error]\") {\r\n return object.name;\r\n }\r\n return \"\";\r\n };\r\n /**\r\n * Adds an event handler for the specified event to the window\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n Util.addEventHandler = function (eventName, callback) {\r\n return EventHelper.Attach(getWindow(), eventName, callback);\r\n };\r\n /**\r\n * Tells if a browser supports a Beacon API\r\n */\r\n Util.IsBeaconApiSupported = function () {\r\n return ('sendBeacon' in _navigator && _navigator.sendBeacon);\r\n };\r\n Util.getExtension = function (extensions, identifier) {\r\n var extension = null;\r\n var extIx = 0;\r\n while (!extension && extIx < extensions.length) {\r\n if (extensions[extIx] && extensions[extIx].identifier === identifier) {\r\n extension = extensions[extIx];\r\n }\r\n extIx++;\r\n }\r\n return extension;\r\n };\r\n Util.document = getDocument() || {};\r\n Util._canUseLocalStorage = undefined;\r\n Util._canUseSessionStorage = undefined;\r\n // listing only non-geo specific locations\r\n Util._internalEndpoints = [\r\n \"https://dc.services.visualstudio.com/v2/track\",\r\n \"https://breeze.aimon.applicationinsights.io/v2/track\",\r\n \"https://dc-int.services.visualstudio.com/v2/track\"\r\n ];\r\n Util.NotSpecified = \"not_specified\";\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n Util.trim = CoreUtils.strTrim;\r\n /**\r\n * Check if an object is of type Array\r\n */\r\n Util.isArray = CoreUtils.isArray;\r\n /**\r\n * Check if an object is of type Error\r\n */\r\n Util.isError = CoreUtils.isError;\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n Util.isDate = CoreUtils.isDate;\r\n // Keeping this name for backward compatibility (for now)\r\n Util.toISOStringForIE8 = CoreUtils.toISOString;\r\n return Util;\r\n}());\r\nexport { Util };\r\nvar UrlHelper = /** @class */ (function () {\r\n function UrlHelper() {\r\n }\r\n UrlHelper.parseUrl = function (url) {\r\n var anchorIdx = UrlHelper._htmlAnchorIdx;\r\n var anchorCache = UrlHelper._htmlAnchorElement;\r\n var tempAnchor = anchorCache[anchorIdx];\r\n if (!UrlHelper.document.createElement) {\r\n // Always create the temp instance if createElement is not available\r\n tempAnchor = { host: UrlHelper.parseHost(url, true) };\r\n }\r\n else if (!anchorCache[anchorIdx]) {\r\n // Create and cache the unattached anchor instance \r\n tempAnchor = anchorCache[anchorIdx] = UrlHelper.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.length) {\r\n anchorIdx = 0;\r\n }\r\n UrlHelper._htmlAnchorIdx = anchorIdx;\r\n return tempAnchor;\r\n };\r\n UrlHelper.getAbsoluteUrl = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.href;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getPathName = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.pathname;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getCompleteUrl = function (method, absoluteUrl) {\r\n if (method) {\r\n return method.toUpperCase() + \" \" + absoluteUrl;\r\n }\r\n else {\r\n return absoluteUrl;\r\n }\r\n };\r\n // Fallback method to grab host from url if document.createElement method is not available\r\n UrlHelper.parseHost = function (url, inclPort) {\r\n var fullHost = UrlHelper.parseFullHost(url, inclPort);\r\n if (fullHost) {\r\n var match = fullHost.match(/(www[0-9]?\\.)?(.[^/:]+)(\\:[\\d]+)?/i);\r\n if (match != null && match.length > 3 && _isString(match[2]) && match[2].length > 0) {\r\n return match[2] + (match[3] || \"\");\r\n }\r\n }\r\n return fullHost;\r\n };\r\n /**\r\n * Get the full host from the url, optionally including the port\r\n */\r\n UrlHelper.parseFullHost = function (url, inclPort) {\r\n var result = null;\r\n if (url) {\r\n var match = url.match(/(\\w*):\\/\\/(.[^/:]+)(\\:[\\d]+)?/i);\r\n if (match != null && match.length > 2 && _isString(match[2]) && match[2].length > 0) {\r\n result = match[2] || \"\";\r\n if (inclPort && match.length > 2) {\r\n var protocol = (match[1] || \"\").toLowerCase();\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 UrlHelper.document = getDocument() || {};\r\n UrlHelper._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\n UrlHelper._htmlAnchorElement = [null, null, null, null, null];\r\n return UrlHelper;\r\n}());\r\nexport { UrlHelper };\r\nvar CorrelationIdHelper = /** @class */ (function () {\r\n function CorrelationIdHelper() {\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\n CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n if (config && config.correlationHeaderExcludePatterns) {\r\n for (var i = 0; i < config.correlationHeaderExcludePatterns.length; i++) {\r\n if (config.correlationHeaderExcludePatterns[i].test(requestUrl)) {\r\n return false;\r\n }\r\n }\r\n }\r\n var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase();\r\n if (requestHost && (requestHost.indexOf(\":443\") !== -1 || requestHost.indexOf(\":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 = (UrlHelper.parseFullHost(requestUrl, true) || \"\").toLowerCase();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && 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 CoreUtils.arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().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.length === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains.length; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().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.length > 0;\r\n };\r\n /**\r\n * Combines target appId and target role name from response header.\r\n */\r\n CorrelationIdHelper.getCorrelationContext = function (responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestHeaders.requestContextTargetKey);\r\n if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n };\r\n /**\r\n * Gets key from correlation response header\r\n */\r\n CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader.split(\",\");\r\n for (var i = 0; i < keyValues.length; ++i) {\r\n var keyValue = keyValues[i].split(\"=\");\r\n if (keyValue.length === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n };\r\n CorrelationIdHelper.correlationIdPrefix = \"cid-v1:\";\r\n return CorrelationIdHelper;\r\n}());\r\nexport { CorrelationIdHelper };\r\nvar AjaxHelper = /** @class */ (function () {\r\n function AjaxHelper() {\r\n }\r\n AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl.length > 0) {\r\n var parsedUrl = UrlHelper.parseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl.pathname != null) {\r\n var pathName = (parsedUrl.pathname.length === 0) ? \"/\" : parsedUrl.pathname;\r\n if (pathName.charAt(0) !== '/') {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl.pathname;\r\n name = DataSanitizer.sanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = DataSanitizer.sanitizeString(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\n return AjaxHelper;\r\n}());\r\nexport { AjaxHelper };\r\n/**\r\n * A utility class that helps getting time related parameters\r\n */\r\nvar DateTimeUtils = /** @class */ (function () {\r\n function DateTimeUtils() {\r\n }\r\n /**\r\n * Get the number of milliseconds since 1970/01/01 in local timezone\r\n */\r\n DateTimeUtils.Now = function () {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n return perf.now() + perf.timing.navigationStart;\r\n }\r\n return new Date().getTime();\r\n };\r\n /**\r\n * Gets duration between two timestamps\r\n */\r\n DateTimeUtils.GetDuration = function (start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !CoreUtils.isNullOrUndefined(start) && !CoreUtils.isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n };\r\n return DateTimeUtils;\r\n}());\r\nexport { DateTimeUtils };\r\n//# sourceMappingURL=Util.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils, DiagnosticLogger } from '@microsoft/applicationinsights-core-js';\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, logger) {\r\n var _this = this;\r\n if (CoreUtils.isNullOrUndefined(logger)) {\r\n this._logger = new DiagnosticLogger();\r\n }\r\n else {\r\n this._logger = logger;\r\n }\r\n if (!config) {\r\n config = {};\r\n }\r\n if (!(typeof config.sessionExpirationMs === \"function\")) {\r\n config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; };\r\n }\r\n if (!(typeof config.sessionRenewalMs === \"function\")) {\r\n config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; };\r\n }\r\n this.config = config;\r\n this._storageNamePrefix = function () { return _this.config.namePrefix && _this.config.namePrefix() ? _SessionManager.cookieNameConst + _this.config.namePrefix() : _SessionManager.cookieNameConst; };\r\n this.automaticSession = new Session();\r\n }\r\n _SessionManager.prototype.update = function () {\r\n if (!this.automaticSession.id) {\r\n this.initializeAutomaticSession();\r\n }\r\n var now = DateTimeUtils.Now();\r\n var acquisitionExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs();\r\n var renewalExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.renewalDate > this.config.sessionRenewalMs();\r\n // renew if acquisitionSpan or renewalSpan has ellapsed\r\n if (acquisitionExpired || renewalExpired) {\r\n // update automaticSession so session state has correct id\r\n this.renew();\r\n }\r\n else {\r\n // do not update the cookie more often than cookieUpdateInterval\r\n if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) {\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\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 _SessionManager.prototype.backup = function () {\r\n this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\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 */\r\n _SessionManager.prototype.initializeAutomaticSession = function () {\r\n var cookie = Util.getCookie(this._logger, this._storageNamePrefix());\r\n if (cookie && typeof cookie.split === \"function\") {\r\n this.initializeAutomaticSessionWithData(cookie);\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 storage = Util.getStorage(this._logger, this._storageNamePrefix());\r\n if (storage) {\r\n this.initializeAutomaticSessionWithData(storage);\r\n }\r\n }\r\n if (!this.automaticSession.id) {\r\n this.renew();\r\n }\r\n };\r\n /**\r\n * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and\r\n * use this data to initialize automaticSession.\r\n *\r\n * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup\r\n */\r\n _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) {\r\n var params = sessionData.split(\"|\");\r\n if (params.length > 0) {\r\n this.automaticSession.id = params[0];\r\n }\r\n try {\r\n if (params.length > 1) {\r\n var acq = +params[1];\r\n this.automaticSession.acquisitionDate = +new Date(acq);\r\n this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0;\r\n }\r\n if (params.length > 2) {\r\n var renewal = +params[2];\r\n this.automaticSession.renewalDate = +new Date(renewal);\r\n this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0;\r\n }\r\n }\r\n catch (e) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ErrorParsingAISessionCookie, \"Error parsing ai_session cookie, session will be reset: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n if (this.automaticSession.renewalDate === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SessionRenewalDateIsZero, \"AI session renewal date is 0, session will be reset.\");\r\n }\r\n };\r\n _SessionManager.prototype.renew = function () {\r\n var now = DateTimeUtils.Now();\r\n this.automaticSession.id = Util.newId();\r\n this.automaticSession.acquisitionDate = now;\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\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 (!Util.canUseLocalStorage()) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserDoesNotSupportLocalStorage, \"Browser does not support local storage. Session durations will be inaccurate.\");\r\n }\r\n };\r\n _SessionManager.prototype.setCookie = function (guid, acq, renewal) {\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 acquisitionExpiry = acq + this.config.sessionExpirationMs();\r\n var renewalExpiry = renewal + this.config.sessionRenewalMs();\r\n var cookieExpiry = new Date();\r\n var cookie = [guid, acq, renewal];\r\n if (acquisitionExpiry < renewalExpiry) {\r\n cookieExpiry.setTime(acquisitionExpiry);\r\n }\r\n else {\r\n cookieExpiry.setTime(renewalExpiry);\r\n }\r\n var cookieDomnain = this.config.cookieDomain ? this.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 // Another browser instance does not inherit this cookie.\r\n var UTCString = this.config.sessionExpirationMs() === 0 ? '0' : cookieExpiry.toUTCString();\r\n Util.setCookie(this._logger, this._storageNamePrefix(), cookie.join('|') + ';expires=' + UTCString, cookieDomnain);\r\n this.cookieUpdatedTimestamp = DateTimeUtils.Now();\r\n };\r\n _SessionManager.prototype.setStorage = function (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 Util.setStorage(this._logger, this._storageNamePrefix(), [guid, acq, renewal].join('|'));\r\n };\r\n _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms\r\n _SessionManager.renewalSpan = 1800000; // 30 minutes in ms\r\n _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms\r\n _SessionManager.cookieNameConst = 'ai_session';\r\n return _SessionManager;\r\n}());\r\nexport { _SessionManager };\r\n//# sourceMappingURL=Session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nvar ContextTagKeys = /** @class */ (function () {\r\n function ContextTagKeys() {\r\n this.applicationVersion = \"ai.application.ver\";\r\n this.applicationBuild = \"ai.application.build\";\r\n this.applicationTypeId = \"ai.application.typeId\";\r\n this.applicationId = \"ai.application.applicationId\";\r\n this.applicationLayer = \"ai.application.layer\";\r\n this.deviceId = \"ai.device.id\";\r\n this.deviceIp = \"ai.device.ip\";\r\n this.deviceLanguage = \"ai.device.language\";\r\n this.deviceLocale = \"ai.device.locale\";\r\n this.deviceModel = \"ai.device.model\";\r\n this.deviceFriendlyName = \"ai.device.friendlyName\";\r\n this.deviceNetwork = \"ai.device.network\";\r\n this.deviceNetworkName = \"ai.device.networkName\";\r\n this.deviceOEMName = \"ai.device.oemName\";\r\n this.deviceOS = \"ai.device.os\";\r\n this.deviceOSVersion = \"ai.device.osVersion\";\r\n this.deviceRoleInstance = \"ai.device.roleInstance\";\r\n this.deviceRoleName = \"ai.device.roleName\";\r\n this.deviceScreenResolution = \"ai.device.screenResolution\";\r\n this.deviceType = \"ai.device.type\";\r\n this.deviceMachineName = \"ai.device.machineName\";\r\n this.deviceVMName = \"ai.device.vmName\";\r\n this.deviceBrowser = \"ai.device.browser\";\r\n this.deviceBrowserVersion = \"ai.device.browserVersion\";\r\n this.locationIp = \"ai.location.ip\";\r\n this.locationCountry = \"ai.location.country\";\r\n this.locationProvince = \"ai.location.province\";\r\n this.locationCity = \"ai.location.city\";\r\n this.operationId = \"ai.operation.id\";\r\n this.operationName = \"ai.operation.name\";\r\n this.operationParentId = \"ai.operation.parentId\";\r\n this.operationRootId = \"ai.operation.rootId\";\r\n this.operationSyntheticSource = \"ai.operation.syntheticSource\";\r\n this.operationCorrelationVector = \"ai.operation.correlationVector\";\r\n this.sessionId = \"ai.session.id\";\r\n this.sessionIsFirst = \"ai.session.isFirst\";\r\n this.sessionIsNew = \"ai.session.isNew\";\r\n this.userAccountAcquisitionDate = \"ai.user.accountAcquisitionDate\";\r\n this.userAccountId = \"ai.user.accountId\";\r\n this.userAgent = \"ai.user.userAgent\";\r\n this.userId = \"ai.user.id\";\r\n this.userStoreRegion = \"ai.user.storeRegion\";\r\n this.userAuthUserId = \"ai.user.authUserId\";\r\n this.userAnonymousUserAcquisitionDate = \"ai.user.anonUserAcquisitionDate\";\r\n this.userAuthenticatedUserAcquisitionDate = \"ai.user.authUserAcquisitionDate\";\r\n this.cloudName = \"ai.cloud.name\";\r\n this.cloudRole = \"ai.cloud.role\";\r\n this.cloudRoleVer = \"ai.cloud.roleVer\";\r\n this.cloudRoleInstance = \"ai.cloud.roleInstance\";\r\n this.cloudEnvironment = \"ai.cloud.environment\";\r\n this.cloudLocation = \"ai.cloud.location\";\r\n this.cloudDeploymentUnit = \"ai.cloud.deploymentUnit\";\r\n this.internalNodeName = \"ai.internal.nodeName\";\r\n this.internalSdkVersion = \"ai.internal.sdkVersion\";\r\n this.internalAgentVersion = \"ai.internal.agentVersion\";\r\n this.internalSnippet = \"ai.internal.snippet\";\r\n this.internalSdkSrc = \"ai.internal.sdkSrc\";\r\n }\r\n return ContextTagKeys;\r\n}());\r\nexport { ContextTagKeys };\r\n//# sourceMappingURL=ContextTagKeys.js.map","import { ContextTagKeys } from \"./Contracts/Generated/ContextTagKeys\";\r\nvar Extensions = /** @class */ (function () {\r\n function Extensions() {\r\n }\r\n Extensions.UserExt = \"user\";\r\n Extensions.DeviceExt = \"device\";\r\n Extensions.TraceExt = \"trace\";\r\n Extensions.WebExt = \"web\";\r\n Extensions.AppExt = \"app\";\r\n Extensions.OSExt = \"os\";\r\n Extensions.SessionExt = \"ses\";\r\n Extensions.SDKExt = \"sdk\";\r\n return Extensions;\r\n}());\r\nexport { Extensions };\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { PageViewData } from '../Interfaces/Contracts/Generated/PageViewData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar PageView = /** @class */ (function (_super) {\r\n __extends(PageView, _super);\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 var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n url: FieldType.Default,\r\n duration: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default,\r\n id: FieldType.Default\r\n };\r\n _this.id = DataSanitizer.sanitizeId(logger, id);\r\n _this.url = DataSanitizer.sanitizeUrl(logger, url);\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _this.duration = Util.msToTimeSpan(durationMs);\r\n }\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}(PageViewData));\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { EventData } from './EventData';\r\n/**\r\n * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView.\r\n */\r\nvar PageViewData = /** @class */ (function (_super) {\r\n __extends(PageViewData, _super);\r\n function PageViewData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return PageViewData;\r\n}(EventData));\r\nexport { PageViewData };\r\n//# sourceMappingURL=PageViewData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name.\r\n */\r\nvar EventData = /** @class */ (function (_super) {\r\n __extends(EventData, _super);\r\n function EventData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return EventData;\r\n}(Domain));\r\nexport { EventData };\r\n//# sourceMappingURL=EventData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * The abstract common base of all domains.\r\n */\r\nvar Domain = /** @class */ (function () {\r\n function Domain() {\r\n }\r\n return Domain;\r\n}());\r\nexport { Domain };\r\n//# sourceMappingURL=Domain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\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","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\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","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Version = \"2.5.7\";\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) {\r\n this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + \"_\" : \"\") + \"javascript:\" + Version;\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar User = /** @class */ (function () {\r\n function User(config, logger) {\r\n this.isNewUser = false;\r\n this._logger = logger;\r\n // get userId or create new one if none exists\r\n var cookie = Util.getCookie(this._logger, User.userCookieName);\r\n if (cookie) {\r\n this.isNewUser = false;\r\n var params = cookie.split(User.cookieSeparator);\r\n if (params.length > 0) {\r\n this.id = params[0];\r\n }\r\n }\r\n this.config = config;\r\n if (!this.id) {\r\n this.id = Util.newId();\r\n var date = new Date();\r\n var acqStr = CoreUtils.toISOString(date);\r\n this.accountAcquisitionDate = acqStr;\r\n this.isNewUser = true;\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 * 1000 = 31536000000 \r\n date.setTime(date.getTime() + 31536000000);\r\n var newCookie = [this.id, acqStr];\r\n var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined;\r\n Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain);\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 && config.namePrefix() ? config.namePrefix() + 'ai_session' : 'ai_session';\r\n Util.removeStorage(this._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 this.accountId = config.accountId ? config.accountId() : 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 = Util.getCookie(this._logger, User.authUserCookieName);\r\n if (authCookie) {\r\n authCookie = decodeURI(authCookie);\r\n var authCookieString = authCookie.split(User.cookieSeparator);\r\n if (authCookieString[0]) {\r\n this.authenticatedId = authCookieString[0];\r\n }\r\n if (authCookieString.length > 1 && authCookieString[1]) {\r\n this.accountId = authCookieString[1];\r\n }\r\n }\r\n }\r\n /**\r\n * Sets the authenticated user id and the account id in this session.\r\n *\r\n * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.\r\n * @param accountId {string} - An optional string to represent the account associated with the authenticated user.\r\n */\r\n User.prototype.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 = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId));\r\n if (isInvalidInput) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.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 this.authenticatedId = authenticatedUserId;\r\n var authCookie = this.authenticatedId;\r\n if (accountId) {\r\n this.accountId = accountId;\r\n authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator);\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 Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain());\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 User.prototype.clearAuthenticatedUserContext = function () {\r\n this.authenticatedId = null;\r\n this.accountId = null;\r\n Util.deleteCookie(this._logger, User.authUserCookieName);\r\n };\r\n User.prototype.validateUserInput = function (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\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","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\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","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DataSanitizer } from '@microsoft/applicationinsights-common';\r\nimport { getLocation } from '@microsoft/applicationinsights-core-js';\r\nvar TelemetryTrace = /** @class */ (function () {\r\n function TelemetryTrace(id, parentId, name, logger) {\r\n this.traceID = id || Util.generateW3CId();\r\n this.parentID = parentId;\r\n this.name = name;\r\n var location = getLocation();\r\n if (!name && location && location.pathname) {\r\n this.name = location.pathname;\r\n }\r\n this.name = DataSanitizer.sanitizeString(logger, this.name);\r\n }\r\n return TelemetryTrace;\r\n}());\r\nexport { TelemetryTrace };\r\n//# sourceMappingURL=TelemetryTrace.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { CoreUtils, hasWindow, _InternalLogMessage } from '@microsoft/applicationinsights-core-js';\r\nimport { Session, _SessionManager } from './Context/Session';\r\nimport { Extensions, CtxTagKeys, PageView } from '@microsoft/applicationinsights-common';\r\nimport { Application } from './Context/Application';\r\nimport { Device } from './Context/Device';\r\nimport { Internal } from './Context/Internal';\r\nimport { User } from './Context/User';\r\nimport { Location } from './Context/Location';\r\nimport { TelemetryTrace } from './Context/TelemetryTrace';\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(logger, defaultConfig) {\r\n var _self = this;\r\n _self.application = new Application();\r\n _self.internal = new Internal(defaultConfig);\r\n if (hasWindow()) {\r\n _self.sessionManager = new _SessionManager(defaultConfig, logger);\r\n _self.device = new Device();\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, logger);\r\n _self.telemetryTrace = new TelemetryTrace(undefined, undefined, undefined, logger);\r\n _self.session = new Session();\r\n }\r\n _self.appId = function () { return null; };\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (event, itemCtx) {\r\n var session = this.session;\r\n var sessionManager = this.sessionManager;\r\n var sessionContext = session || (sessionManager && sessionManager.automaticSession);\r\n if (sessionContext) {\r\n if (CoreUtils.isString(sessionContext.id)) {\r\n event.ext.app.sesId = sessionContext.id;\r\n }\r\n }\r\n if (session) {\r\n // If customer set session info, apply his context; otherwise apply context automatically generated\r\n if (CoreUtils.isString(session.id)) {\r\n event.ext.app.sesId = session.id;\r\n }\r\n else {\r\n event.ext.app.sesId = sessionManager.automaticSession.id;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n var os = this.os;\r\n if (os && os.name) {\r\n event.ext.os = os;\r\n }\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n var application = this.application;\r\n if (application) {\r\n if (CoreUtils.isString(application.ver)) {\r\n event.tags[CtxTagKeys.applicationVersion] = application.ver;\r\n }\r\n if (CoreUtils.isString(application.build)) {\r\n event.tags[CtxTagKeys.applicationBuild] = application.build;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n var device = this.device;\r\n if (device) {\r\n if (CoreUtils.isString(device.id)) {\r\n event.ext.device.localId = device.id;\r\n }\r\n if (CoreUtils.isString(device.ip)) {\r\n event.ext.device.ip = device.ip;\r\n }\r\n if (CoreUtils.isString(device.model)) {\r\n event.ext.device.model = device.model;\r\n }\r\n if (CoreUtils.isString(device.deviceClass)) {\r\n event.ext.device.deviceClass = device.deviceClass;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n var internal = this.internal;\r\n if (internal) {\r\n if (CoreUtils.isString(internal.agentVersion)) {\r\n event.tags[CtxTagKeys.internalAgentVersion] = internal.agentVersion; // not mapped in CS 4.0\r\n }\r\n if (CoreUtils.isString(internal.sdkVersion)) {\r\n event.tags[CtxTagKeys.internalSdkVersion] = internal.sdkVersion;\r\n }\r\n if (event.baseType === _InternalLogMessage.dataType || event.baseType === PageView.dataType) {\r\n if (CoreUtils.isString(internal.snippetVer)) {\r\n event.tags[CtxTagKeys.internalSnippet] = internal.snippetVer;\r\n }\r\n if (CoreUtils.isString(internal.sdkSrc)) {\r\n event.tags[CtxTagKeys.internalSdkSrc] = internal.sdkSrc;\r\n }\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n var location = this.location;\r\n if (location) {\r\n if (CoreUtils.isString(location.ip)) {\r\n event.tags[CtxTagKeys.locationIp] = location.ip;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n var telemetryTrace = this.telemetryTrace;\r\n if (telemetryTrace) {\r\n var trace = event.ext.trace || { traceID: undefined, parentID: undefined };\r\n if (CoreUtils.isString(telemetryTrace.traceID)) {\r\n trace.traceID = telemetryTrace.traceID;\r\n }\r\n if (CoreUtils.isString(telemetryTrace.name)) {\r\n trace.name = telemetryTrace.name;\r\n }\r\n if (CoreUtils.isString(telemetryTrace.parentID)) {\r\n trace.parentID = telemetryTrace.parentID;\r\n }\r\n event.ext.trace = trace;\r\n }\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n var web = this.web;\r\n if (web) {\r\n event.ext.web = event.ext.web || {};\r\n event.ext.web = web;\r\n }\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n var user = this.user;\r\n if (user) {\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n // stays in tags\r\n if (CoreUtils.isString(user.accountId)) {\r\n event.tags[CtxTagKeys.userAccountId] = user.accountId;\r\n }\r\n // CS 4.0\r\n if (CoreUtils.isString(user.id)) {\r\n event.ext.user.id = user.id;\r\n }\r\n if (CoreUtils.isString(user.authenticatedId)) {\r\n event.ext.user.authId = user.authenticatedId;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n if (event.ext[Extensions.DeviceExt] && CoreUtils.objKeys(event.ext[Extensions.DeviceExt]).length === 0) {\r\n delete event.ext[Extensions.DeviceExt];\r\n }\r\n if (event.ext[Extensions.UserExt] && CoreUtils.objKeys(event.ext[Extensions.UserExt]).length === 0) {\r\n delete event.ext[Extensions.UserExt];\r\n }\r\n if (event.ext[Extensions.WebExt] && CoreUtils.objKeys(event.ext[Extensions.WebExt]).length === 0) {\r\n delete event.ext[Extensions.WebExt];\r\n }\r\n if (event.ext[Extensions.OSExt] && CoreUtils.objKeys(event.ext[Extensions.OSExt]).length === 0) {\r\n delete event.ext[Extensions.OSExt];\r\n }\r\n if (event.ext[Extensions.AppExt] && CoreUtils.objKeys(event.ext[Extensions.AppExt]).length === 0) {\r\n delete event.ext[Extensions.AppExt];\r\n }\r\n if (event.ext[Extensions.TraceExt] && CoreUtils.objKeys(event.ext[Extensions.TraceExt]).length === 0) {\r\n delete event.ext[Extensions.TraceExt];\r\n }\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { BaseTelemetryPlugin, CoreUtils, _InternalLogMessage, LoggingSeverity, _InternalMessageId, getNavigator } from '@microsoft/applicationinsights-core-js';\r\nimport { TelemetryContext } from './TelemetryContext';\r\nimport { PageView, BreezeChannelIdentifier, PropertiesPluginIdentifier, Extensions, Util } from '@microsoft/applicationinsights-common';\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n return _this;\r\n }\r\n PropertiesPlugin.getDefaultConfig = function () {\r\n var defaultConfig = {\r\n instrumentationKey: function () { return undefined; },\r\n accountId: function () { return null; },\r\n sessionRenewalMs: function () { return 30 * 60 * 1000; },\r\n samplingPercentage: function () { return 100; },\r\n sessionExpirationMs: function () { return 24 * 60 * 60 * 1000; },\r\n cookieDomain: function () { return null; },\r\n sdkExtension: function () { return null; },\r\n isBrowserLinkTrackingEnabled: function () { return false; },\r\n appId: function () { return null; },\r\n namePrefix: function () { return undefined; }\r\n };\r\n return defaultConfig;\r\n };\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n var defaultConfig = PropertiesPlugin.getDefaultConfig();\r\n this._extensionConfig = this._extensionConfig || PropertiesPlugin.getDefaultConfig();\r\n var _loop_1 = function (field) {\r\n this_1._extensionConfig[field] = function () { return ctx.getConfig(identifier, field, defaultConfig[field]()); };\r\n };\r\n var this_1 = this;\r\n for (var field in defaultConfig) {\r\n _loop_1(field);\r\n }\r\n this.context = new TelemetryContext(core.logger, this._extensionConfig);\r\n this._breezeChannel = Util.getExtension(extensions, BreezeChannelIdentifier);\r\n this.context.appId = function () { return _this._breezeChannel ? _this._breezeChannel[\"_appId\"] : null; };\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 PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n if (CoreUtils.isNullOrUndefined(event)) {\r\n // TODO(barustum): throw an internal event once we have support for internal logging\r\n }\r\n else {\r\n itemCtx = this._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 if (this.context.session) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof this.context.session.id !== \"string\") {\r\n this.context.sessionManager.update();\r\n }\r\n }\r\n this._processTelemetryInternal(event, itemCtx);\r\n if (this.context && this.context.user && this.context.user.isNewUser) {\r\n this.context.user.isNewUser = false;\r\n var message = new _InternalLogMessage(_InternalMessageId.SendBrowserInfoOnUserInit, ((getNavigator() || {}).userAgent || \"\"));\r\n itemCtx.diagLog().logInternalMessage(LoggingSeverity.CRITICAL, message);\r\n }\r\n this.processNext(event, itemCtx);\r\n }\r\n };\r\n PropertiesPlugin.prototype._processTelemetryInternal = function (event, itemCtx) {\r\n // set part A fields\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n if (!event.ext) {\r\n event.ext = {};\r\n }\r\n var ext = event.ext;\r\n ext[Extensions.DeviceExt] = ext[Extensions.DeviceExt] || {};\r\n ext[Extensions.WebExt] = ext[Extensions.WebExt] || {};\r\n ext[Extensions.UserExt] = ext[Extensions.UserExt] || {};\r\n ext[Extensions.OSExt] = ext[Extensions.OSExt] || {};\r\n ext[Extensions.AppExt] = ext[Extensions.AppExt] || {};\r\n ext[Extensions.TraceExt] = ext[Extensions.TraceExt] || {};\r\n var context = this.context;\r\n context.applySessionContext(event, itemCtx);\r\n context.applyApplicationContext(event, itemCtx);\r\n context.applyDeviceContext(event, itemCtx);\r\n context.applyOperationContext(event, itemCtx);\r\n context.applyUserContext(event, itemCtx);\r\n context.applyOperatingSystemContxt(event, itemCtx);\r\n context.applyWebContext(event, itemCtx);\r\n context.applyLocationContext(event, itemCtx); // legacy tags\r\n context.applyInternalContext(event, itemCtx); // legacy tags\r\n context.cleanUp(event, itemCtx);\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport '@microsoft/applicationinsights-shims';\r\nexport { Util, CorrelationIdHelper, UrlHelper, DateTimeUtils } from './Util';\r\nexport { ConnectionStringParser } from './ConnectionStringParser';\r\nexport { FieldType } from './Enums';\r\nexport { RequestHeaders } from './RequestResponseHeaders';\r\nexport { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT } from './Constants';\r\nexport { Data as AIData } from './Interfaces/Contracts/Generated/Data';\r\nexport { Base as AIBase } from './Interfaces/Contracts/Generated/Base';\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 { PageViewData } from './Interfaces/Contracts/Generated/PageViewData';\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/Generated/SeverityLevel';\r\nexport { ConfigurationManager } from './Interfaces/IConfig';\r\nexport { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';\r\nexport { DataSanitizer } from './Telemetry/Common/DataSanitizer';\r\nexport { TelemetryItemCreator } from './TelemetryItemCreator';\r\nexport { CtxTagKeys, Extensions } from './Interfaces/PartAExtensions';\r\nexport { DistributedTracingModes } from './Enums';\r\nexport var PropertiesPluginIdentifier = \"AppInsightsPropertiesPlugin\";\r\nexport var BreezeChannelIdentifier = \"AppInsightsChannelPlugin\";\r\nexport var AnalyticsPluginIdentifier = \"ApplicationInsightsAnalytics\";\r\n//# sourceMappingURL=applicationinsights-common.js.map"],"sourceRoot":""}