Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-core-js

Package Overview
Dependencies
Maintainers
4
Versions
561
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-core-js - npm Package Compare versions

Comparing version 2.5.8 to 2.5.9

4

browser/applicationinsights-core-js.min.js
/*!
* Application Insights JavaScript SDK - Core, 2.5.8
* Application Insights JavaScript SDK - Core, 2.5.9
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(l){"use strict";var i="function",o="object",n="undefined",a="prototype",u="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function r(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=i)throw new TypeError("Object prototype may only be an Object:"+e);function r(){}return r[a]=e,new r}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[u](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[a][u].call(n,i)&&(e[i]=n[i]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}s(e,n),e[a]=null===n?r(n):(t[a]=n[a],new t)};var c={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,v=i,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function N(){return!(typeof navigator!==g||!navigator)}function S(){return N()?navigator:x("navigator")}function I(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function P(){return!!(typeof JSON===g&&JSON||null!==x(h))}function F(){return P()?JSON||x(h):null}var _=n,L="attachEvent",M="addEventListener",O="detachEvent",A="removeEventListener";function j(e,n){return typeof e===n}function R(e){return j(e,n)||e===undefined}function D(e){return R(e)||null===e}function k(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function U(e){return j(e,o)}function z(e){return j(e,i)}function K(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!D(e))try{D(e[M])?D(e[L])||(e[L]("on"+n,t),i=!0):(e[M](n,t,r),i=!0)}catch(o){}return i}function B(e,n,t,r){if(void 0===r&&(r=!1),!D(e))try{D(e[A])?D(e[O])||e[O]("on"+n,t):e[A](n,t,r)}catch(i){}}var q=(V.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},V.isArray=function(e){return"[object Array]"===Object[a].toString.call(e)},V.isError=function(e){return"[object Error]"===Object[a].toString.call(e)},V.isString=function(e){return j(e,"string")},V.isNumber=function(e){return j(e,"number")},V.isBoolean=function(e){return j(e,"boolean")},V.disableCookies=function(){V._canUseCookies=!1},V.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(H,function(e){var n,t=0|((n=x("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},V.toISOString=function(e){if(V.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},V.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},V.arrIndexOf=function(e,n,t){for(var r=e.length,i=t||0,o=Math.max(0<=i?i:r-Math.abs(i),0);o<r;o++)if(o in e&&e[o]===n)return o;return-1},V.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},V.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},V.strTrim=function(e){return V.isString(e)?e.replace(/^\s+|\s+$/g,""):e},V.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(z(e)||U(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var r in e)k(e,r)&&t.push(r);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)k(e,i[a])&&t.push(i[a]);return t},V.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},V.addEventHandler=function(e,n){var t=!1,r=C();r&&(t=K(r,e,n),t=K(r.body,e,n)||t);var i=T();return i&&(t=G.Attach(i,e,n)||t),t},V.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},V.perfNow=function(){var e=E();return e&&e.now?e.now():V.dateNow()},V.isTypeof=j,V.isUndefined=R,V.isNullOrUndefined=D,V.hasOwnProperty=k,V.isFunction=z,V.isObject=U,V.objCreate=r,V);function V(){}var W,H=/[xy]/g,G=(J.Attach=K,J.AttachEvent=K,J.Detach=B,J.DetachEvent=B,J);function J(){}(W=l.LoggingSeverity||(l.LoggingSeverity={}))[W.CRITICAL=1]="CRITICAL",W[W.WARNING=2]="WARNING";var Q={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100},$="constructor",Z="prototype",Y="function",X="_dynInstFuncs",ee="_isDynProxy",ne="_dynClass",te="_dynCls$",re="_unknown_",ie="__proto__",oe=Object.getPrototypeOf,ae=0;function ue(e,n){return e&&Object[Z].hasOwnProperty.call(e,n)}function se(e){return typeof e===Y}function ce(e){return e&&(e===Object[Z]||e===Array[Z])}function le(e){return ce(e)||e===Function[Z]}function fe(e){if(e){if(oe)return oe(e);var n=e[ie]||e[Z]||e[$];if(n)return n}return null}function ge(e,n,t){return n!==$&&se(e[n])&&(t||ue(e,n))}function de(e){throw new TypeError("DynamicProto: "+e)}function ve(e,n){return ue(e,Z)?e.name||n||re:((e||{})[$]||{}).name||n||re}function pe(e,t,n){ue(e,Z)||de("theClass is an invalid class definition.");var r=e[Z];!function(e){for(var n=fe(t);n&&!le(n);){if(n===e)return 1;n=fe(n)}}(r)&&de("["+ve(e)+"] is not in class heirarchy of ["+ve(t)+"]");var i=null;ue(r,ne)?i=r[ne]:(i=te+ve(e,"_")+"$"+ae,ae++,r[ne]=i);var o=function(e){var n={};for(var t in e)!n[t]&&ge(e,t,!1)&&(n[t]=e[t]);return n}(t);n(t,function(e,n,t){function r(e,n){return function(){return n.apply(e,arguments)}}var i={};for(var o in t)i[o]=r(n,t[o]);for(var a=fe(e),u=[];a&&!le(a)&&!function(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}(u,a);){for(var o in a)!i[o]&&ge(a,o,!oe)&&(i[o]=r(n,a[o]));u.push(a),a=fe(a)}return i}(r,t,o)),function(e,n,t,r){if(!ce(e)){var i=t[X]=t[X]||{},o=i[n]=i[n]||{};for(var a in t)ge(t,a,!1)&&t[a]!==r[a]&&(o[a]=t[a],delete t[a],ue(e,a)&&(!e[a]||e[a][ee])||(e[a]=function(t,r){var i=function(){if(this&&ue(t,ne)){var e=((this[X]||{})[t[ne]]||{})[r];if(e)return e.apply(this,arguments);de("Missing ["+r+"] "+Y)}var n=t[r];return n===i&&(n=fe(t)[r]),se(n)||de("["+r+"] is not a "+Y),n.apply(this,arguments)};return i[ee]=1,i}(e,a)))}}(r,i,t,o)}function he(e){return e?'"'+e.replace(/\"/g,"")+'"':""}var ye=(xe.dataType="MessageData",xe);function xe(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;var i="";P()&&(i=F().stringify(r));var o=(n?" message:"+he(n):"")+(r?" props:"+he(i):"");this.message+=o}var me=function gn(o){this.identifier="DiagnosticLogger",this.queue=[];var a=0,c={};pe(gn,this,function(u){var r=q.isNullOrUndefined,s=q.isUndefined,i=q.isFunction;function e(e,n){var t=o[e];return r(t)?n:t}r(o)&&(o={}),u.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},u.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},u.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},u.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},u.throwInternal=function(e,n,t,r,i){void 0===i&&(i=!1);var o,a=new ye(n,t,i,r);if(u.enableDebugExceptions())throw a;!s(a)&&a&&(s(a.message)||(i?(o=+a.messageId,!c[o]&&u.consoleLoggingLevel()>=l.LoggingSeverity.WARNING&&(u.warnToConsole(a.message),c[o]=!0)):u.consoleLoggingLevel()>=l.LoggingSeverity.WARNING&&u.warnToConsole(a.message),u.logInternalMessage(e,a)))},u.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),i(t[n])&&t[n](e))},u.resetInternalMessageCount=function(){a=0,c={}},u.logInternalMessage=function(e,n){var t,r,i;a>=u.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,c[r]?t=!1:c[r]=!0,t&&(e<=u.telemetryLoggingLevel()&&(u.queue.push(n),a++),a===u.maxInternalMessageLimit()&&(i=new ye(Q.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),u.queue.push(i),u.warnToConsole("Internal events throttle limit per PageView reached for this app."))))}})},Ce="ctx",we=(Te.ParentContextKey="parent",Te.ChildrenContextKey="childEvts",Te);function Te(e,i,n){var t,o=this,a=!1;o.start=q.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},q.isFunction(i)&&(a=q.objDefineAccessors(o,"payload",function(){return!t&&q.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?e===Te.ParentContextKey||e===Te.ChildrenContextKey?o[e]:(o[Ce]||{})[e]:null},o.setCtx=function(e,n){e&&(e===Te.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===Te.ChildrenContextKey?o[e]=n:(o[Ce]=o[Ce]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(Te.ChildrenContextKey);if(q.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=q.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&q.isFunction(i)&&(o.payload=i())}}var Ne=function dn(n){this.ctx={},pe(dn,this,function(t){t.create=function(e,n,t){return new we(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Ce]=t[Ce]||{})[e]=n)},t.getCtx=function(e){return(t[Ce]||{})[e]}})},Se="CoreUtils.doPerf";function Ie(e,n,t,r,i){if(e){var o=e;if(o&&q.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Se);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(we.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(we.ChildrenContextKey))||(a=[],s.setCtx(we.ChildrenContextKey,a)),a.push(u))),o.setCtx(Se,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Se,s)}}}return t()}var be=q.isFunction,Ee=function(i,n){var o=this,a=null,u=be(i.processTelemetry),s=be(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Ie(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(l.LoggingSeverity.CRITICAL,Q.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},Pe=q.isNullOrUndefined;function Fe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o,a=e[i];a&&q.isFunction(a.processTelemetry)&&(o=new Ee(a,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var _e=function vn(e,o,t,n){var r,i,a,u,s=this,c=null;null!==n&&(e&&q.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),Fe(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(i=n)&&e&&(a=[],q.arrForEach(e,function(e){!u&&e!==i||(u=!0,a.push(e))})),i&&!u&&(a=a||[]).push(i),c=Fe(a,r)):q.isUndefined(n)&&(c=Fe(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new me(o||{})},s.getCfg=function(){return o},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!o||(r=o.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;void 0===t&&(t=!1);var i=s.getExtCfg(e,null);return i&&!Pe(i[n])?r=i[n]:o&&!Pe(o[n])&&(r=o[n]),Pe(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new vn(e||c,o,t,n)}},Le=q.isFunction,Me="getPlugin",Oe=(Ae.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Ae);function Ae(){var o=this,a=!1,u=null,s=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&Le(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=u||new _e(null,{},o.core),t=s&&s[Me]?n.createNew(null,s[Me]):n.createNew(null,s)),t},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Me]&&(i=s[Me]()),o.core=n,u=new _e(r,e,n,i),a=!0}}var je=q.isFunction,Re="processTelemetry",De="priority",ke="setNextPlugin",Ue="isInitialized";function ze(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&je(r[ke])&&je(o[Re])&&r[ke](o),je(o[Ue])&&o[Ue]()||e.push(o),r=o,i=i.getNext())}q.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function Ke(e){return e.sort(function(e,n){var t=0,r=je(n[Re]);return je(e[Re])?t=r?e[De]-n[De]:1:r&&(t=-1),t})}var Be,qe=500,Ve="Channel has invalid priority",We=q.objDefineAccessors,He=(Be=Oe,__extends(Ge,Be),Ge._staticInit=(We(Ge.prototype,"ChannelControls",Ge.prototype.getChannelControls),void We(Ge.prototype,"channelQueue",Ge.prototype.getChannelControls)),Ge);function Ge(){var r=Be.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=qe;var s,c=q.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<qe)throw Error(Ve+e.identifier)}),s.push(e))}return pe(Ge,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&q.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>qe&&o.push(e)}),l(o)),c(s,function(e){return ze(new _e(e,n,t),r)}))}}),r}var Je,Qe=q.arrForEach,$e=q.isNullOrUndefined,Ze="_notificationManager",Ye=function pn(){var n,s,c,t,l=!1;pe(pn,this,function(u){u._extensions=[],s=new He,n=[],u.isInitialized=function(){return l},u.initialize=function(e,n,r,t){if(u.isInitialized())throw Error("Core should not be initialized more than once");if(!e||$e(e.instrumentationKey))throw Error("Please provide instrumentation key");c=t,u[Ze]=t,u.config=e||{},e.extensions=$e(e.extensions)?[]:e.extensions,(e.extensionConfig=$e(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r=r||q.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),u.logger=r;var i=[];i.push.apply(i,n.concat(e.extensions)),i=Ke(i);var o=[],a={};if(Qe(i,function(e){if($e(e)||$e(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&($e(a[n])?a[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+a[n]+", "+t)),(!n||n<s.priority)&&o.push(e)}),i.push(s),o.push(s),i=Ke(i),u._extensions=i,ze(new _e([s],e,u),i),ze(new _e(o,e,u),i),u._extensions=o,0===u.getTransmissionControls().length)throw Error("No channels available");l=!0,u.releaseQueue()},u.getTransmissionControls=function(){return s.getChannelControls()},u.track=function(e){e.iKey||(e.iKey=u.config.instrumentationKey),e.time||(e.time=q.toISOString(new Date)),$e(e.ver)&&(e.ver="4.0"),u.isInitialized()?u.getProcessTelContext().processNext(e):n.push(e)},u.getProcessTelContext=function(){var e=u._extensions,n=e;return e&&0!==e.length||(n=[s]),new _e(n,u.config,u)},u.getNotifyMgr=function(){return c||(c=q.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),u[Ze]=c),c},u.getPerfMgr=function(){return t||u.config&&u.config.enablePerfMgr&&(t=new Ne(u.getNotifyMgr())),t},u.setPerfMgr=function(e){t=e},u.eventCnt=function(){return n.length},u.releaseQueue=function(){0<n.length&&(Qe(n,function(e){u.getProcessTelContext().processNext(e)}),n=[])}})},Xe=function hn(e){this.listeners=[];var o=q.arrForEach,n=!!(e||{}).perfEvtsSendAll;pe(hn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=q.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=q.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},en=(Je=Ye,__extends(nn,Je),nn);function nn(){var e=Je.call(this)||this;return pe(nn,e,function(r,i){function n(e){var n=r.getNotifyMgr();n&&n.eventsDiscarded([e],c.InvalidEvent)}r.initialize=function(e,n,t,r){i.initialize(e,n,t||new me(e),r||new Xe(e))},r.track=function(e){Ie(r.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(q.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},r.addNotificationListener=function(e){var n=r.getNotifyMgr();n&&n.addNotificationListener(e)},r.removeNotificationListener=function(e){var n=r.getNotifyMgr();n&&n.removeNotificationListener(e)},r.pollInternalLogs=function(t){var e=r.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=r.logger?r.logger.queue:[];q.arrForEach(e,function(e){var n={name:t||"InternalMessageId: "+e.messageId,iKey:r.config.instrumentationKey,time:q.toISOString(new Date),baseType:ye.dataType,baseData:{message:e.message}};r.track(n)}),e.length=0},e)}}),e}var tn="_aiHooks",rn=["req","rsp","hkErr","fnErr"],on="__proto__",an="constructor";function un(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function sn(e,s,c,l,f){0<=f&&f<=2&&un(e,function(e,n){var t=e.cbks,r=t[rn[f]];if(r){s.ctx=function(){return l[n]=l[n]||{}};try{r.apply(s.inst,c)}catch(a){var i=s.err;try{var o=t[rn[2]];o&&(s.err=a,o.apply(s.inst,c))}catch(u){}finally{s.err=i}}}})}var cn=Object.getPrototypeOf;function ln(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t){var i=function l(e,n,t){var r=null;return e&&(q.hasOwnProperty(e,n)?r=e:t&&(r=l(function(e){if(e){if(cn)return cn(e);var n=e[on]||e[d]||e[an];if(n)return n}return null}(e),n,!1))),r}(e,n,r);if(i){var o=i[n];if(typeof o===v){var a,u=o[tn];u||(c=u={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=c.h,r={name:c.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return un(e,function(e){n.push(e)}),n}sn(e,r,i,n,0);var a=c.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,sn(e,r,i,n,3),u}return sn(e,r,i,n,1),r.rslt})[tn]=u,i[n]=a);var s={id:u.i,cbks:t,rm:function(){var t=this.id;un(u.h,function(e,n){return e.id===t&&(u.h.splice(n,1),1)})}};return u.i++,u.h.push(s),s}}}var c;return null}function fn(t,e,r,i){void 0===i&&(i=!0);var o=null;return un(e,function(e){var n=ln(t,e,r,i);n&&(o=o||[]).push(n)}),o}l.MinChannelPriorty=100,l.EventsDiscardedReason=c,l.AppInsightsCore=en,l.BaseCore=Ye,l.BaseTelemetryPlugin=Oe,l.CoreUtils=q,l.EventHelper=G,l.Undefined=_,l.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},l.getGlobal=y,l.getGlobalInst=x,l.hasWindow=m,l.getWindow=C,l.hasDocument=w,l.getDocument=T,l.hasNavigator=N,l.getNavigator=S,l.hasHistory=I,l.getHistory=function(){return I()?history:x("history")},l.getLocation=function(){return typeof location===g&&location?location:x("location")},l.getPerformance=E,l.hasJSON=P,l.getJSON=F,l.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},l.getConsole=b,l.strUndefined=f,l.strObject=g,l.strPrototype=d,l.strFunction=v,l.NotificationManager=Xe,l.PerfEvent=we,l.PerfManager=Ne,l.doPerf=Ie,l.DiagnosticLogger=me,l._InternalLogMessage=ye,l.ProcessTelemetryContext=_e,l.initializePlugins=ze,l.sortPlugins=Ke,l._InternalMessageId=Q,l.InstrumentProto=function(e,n,t){return e?ln(e[d],n,t,!1):null},l.InstrumentProtos=function(e,n,t){return e?fn(e[d],n,t,!1):null},l.InstrumentFunc=ln,l.InstrumentFuncs=fn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(l,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(un=Xe=e()||{}).__assign||(un.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),un.__extends||(un.__extends=t),__assign=__assign||Xe.__assign,__extends=__extends||Xe.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,K=123456789,B=987654321;function V(e){K=123456789+e&k,B=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}var X=(ee.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ee.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ee.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ee.isString=function(e){return W(e,"string")},ee.isNumber=function(e){return W(e,"number")},ee.isBoolean=function(e){return W(e,"boolean")},ee.disableCookies=function(){ee._canUseCookies=!1},ee.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(ne,function(e){var n=0|ee.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ee.toISOString=function(e){if(ee.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},ee.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ee.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ee.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ee.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ee.strTrim=function(e){return ee.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ee.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ee.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},ee.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=te.Attach(r,e,n)||t),t},ee.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ee.perfNow=function(){var e=E();return e&&e.now?e.now():ee.dateNow()},ee.newId=function(e){void 0===e&&(e=22);for(var n=ee.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ee.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ee.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ee.randomValue=function(e){return 0<e?Math.floor(ee.random32()/k*(e+1))>>>0:0},ee.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ee.isIE()?(z||q(),ee.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ee.mwcRandomSeed=function(e){e?V(e):q()},ee.mwcRandom32=function(e){var n=((B=36969*(65535&B)+(B>>16)&k)<<16)+(65535&(K=18e3*(65535&K)+(K>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ee.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ee.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ee.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ee.isTypeof=W,ee.isUndefined=H,ee.isNullOrUndefined=G,ee.hasOwnProperty=J,ee.isFunction=$,ee.isObject=Q,ee.objCreate=u,ee);function ee(){}var ne=/[xy]/g,te=(re.Attach=Z,re.AttachEvent=Z,re.Detach=Y,re.DetachEvent=Y,re);function re(){}(un=c.LoggingSeverity||(c.LoggingSeverity={}))[un.CRITICAL=1]="CRITICAL",un[un.WARNING=2]="WARNING";var ie={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100},oe="constructor",ae="prototype",ue="function",se="_dynInstFuncs",ce="_isDynProxy",le="_dynClass",fe="_dynCls$",ge="_unknown_",de="__proto__",ve=Object.getPrototypeOf,pe=0;function he(e,n){return e&&Object[ae].hasOwnProperty.call(e,n)}function ye(e){return typeof e===ue}function xe(e){return e&&(e===Object[ae]||e===Array[ae])}function me(e){return xe(e)||e===Function[ae]}function Ce(e){if(e){if(ve)return ve(e);if(e=e[de]||e[ae]||e[oe])return e}return null}function we(e,n,t){return n!==oe&&ye(e[n])&&(t||he(e,n))}function Te(e){throw new TypeError("DynamicProto: "+e)}function Ie(e,n){return he(e,ae)?e.name||n||ge:((e||{})[oe]||{}).name||n||ge}function Se(e,t,n){he(e,ae)||Te("theClass is an invalid class definition.");var r=e[ae];!function(e){for(var n=Ce(t);n&&!me(n);){if(n===e)return 1;n=Ce(n)}}(r)&&Te("["+Ie(e)+"] is not in class heirarchy of ["+Ie(t)+"]");var i=null;he(r,le)?i=r[le]:(i=fe+Ie(e,"_")+"$"+pe,pe++,r[le]=i),n(t,function(e,n,t){function r(e,n){return function(){return n.apply(e,arguments)}}var i={};for(u in t)i[u]=r(n,t[u]);for(var o=Ce(e),a=[];o&&!me(o)&&!function(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}(a,o);){for(var u in o)!i[u]&&we(o,u,!ve)&&(i[u]=r(n,o[u]));a.push(o),o=Ce(o)}return i}(r,t,e=function(e){var n,t={};for(n in e)!t[n]&&we(e,n,!1)&&(t[n]=e[n]);return t}(t))),function(e,n,t,r){if(!xe(e)){var i,o=t[se]=t[se]||{},a=o[n]=o[n]||{};for(i in t)we(t,i,!1)&&t[i]!==r[i]&&(a[i]=t[i],delete t[i],he(e,i)&&(!e[i]||e[i][ce])||(e[i]=function(n,t){var r=function(){if(this&&he(n,le)){var e=((this[se]||{})[n[le]]||{})[t];if(e)return e.apply(this,arguments);Te("Missing ["+t+"] "+ue)}return(e=n[t])===r&&(e=Ce(n)[t]),ye(e)||Te("["+t+"] is not a "+ue),e.apply(this,arguments)};return r[ce]=1,r}(e,i)))}}(r,i,t,e)}function Ne(e){return e?'"'+e.replace(/\"/g,"")+'"':""}var be=(Ee.dataType="MessageData",Ee);function Ee(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Ne(n):"")+(r?" props:"+Ne(e):""),this.message+=e}var _e=function Cn(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Se(Cn,this,function(o){var t=X.isNullOrUndefined,a=X.isUndefined,r=X.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new be(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new be(ie.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},Pe="ctx",Fe=(Le.ParentContextKey="parent",Le.ChildrenContextKey="childEvts",Le);function Le(e,i,n){var t,o=this,a=!1;o.start=X.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},X.isFunction(i)&&(a=X.objDefineAccessors(o,"payload",function(){return!t&&X.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===Le.ParentContextKey||e===Le.ChildrenContextKey?o:o[Pe]||{})[e]:null},o.setCtx=function(e,n){e&&(e===Le.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===Le.ChildrenContextKey?o[e]=n:(o[Pe]=o[Pe]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(Le.ChildrenContextKey);if(X.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&X.isFunction(i)&&(o.payload=i())}}var Me=function wn(n){this.ctx={},Se(wn,this,function(t){t.create=function(e,n,t){return new Fe(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Pe]=t[Pe]||{})[e]=n)},t.getCtx=function(e){return(t[Pe]||{})[e]}})},Oe="CoreUtils.doPerf";function Ae(e,n,t,r,i){if(e){var o=e;if(o&&X.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Oe);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(Fe.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(Fe.ChildrenContextKey))||(a=[],s.setCtx(Fe.ChildrenContextKey,a)),a.push(u))),o.setCtx(Oe,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Oe,s)}}}return t()}var je=X.isFunction,Re=function(i,n){var o=this,a=null,u=je(i.processTelemetry),s=je(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Ae(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,ie.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},De=X.isNullOrUndefined;function ke(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&X.isFunction(o.processTelemetry)&&(o=new Re(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var Ue=function Tn(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&X.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),ke(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],X.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=ke(a,r)):X.isUndefined(n)&&(c=ke(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new _e(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!De(e[n])?r=e[n]:i&&!De(i[n])&&(r=i[n]),De(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new Tn(e||c,i,t,n)}},ze=X.isFunction,Ke="getPlugin",t=(Be.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Be);function Be(){var o=this,a=!1,u=null,s=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&ze(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new Ue(null,{},o.core),n=s&&s[Ke]?e.createNew(null,s[Ke]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Ke]&&(i=s[Ke]()),o.core=n,u=new Ue(r,e,n,i),a=!0}}var Ve=X.isFunction,qe="processTelemetry",We="priority",He="setNextPlugin",Ge="isInitialized";function Je(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&Ve(r[He])&&Ve(o[qe])&&r[He](o),Ve(o[Ge])&&o[Ge]()||e.push(o),r=o,i=i.getNext())}X.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function Qe(e){return e.sort(function(e,n){var t=0,r=Ve(n[qe]);return Ve(e[qe])?t=r?e[We]-n[We]:1:r&&(t=-1),t})}var $e,Ze=500,Ye="Channel has invalid priority",Xe=X.objDefineAccessors,en=($e=t,__extends(nn,$e),nn._staticInit=(Xe(nn.prototype,"ChannelControls",nn.prototype.getChannelControls),void Xe(nn.prototype,"channelQueue",nn.prototype.getChannelControls)),nn);function nn(){var r=$e.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=Ze;var s,c=X.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<Ze)throw Error(Ye+e.identifier)}),s.push(e))}return Se(nn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&X.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>Ze&&o.push(e)}),l(o)),c(s,function(e){return Je(new Ue(e,n,t),r)}))}}),r}var tn,rn=X.arrForEach,on=X.isNullOrUndefined,an="_notificationManager",un=function In(){var n,u,s,t,c=!1;Se(In,this,function(a){a._extensions=[],u=new en,n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||on(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[an]=t,a.config=e||{},e.extensions=on(e.extensions)?[]:e.extensions,(e.extensionConfig=on(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r=r||X.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r,(t=[]).push.apply(t,n.concat(e.extensions)),t=Qe(t);var i=[],o={};if(rn(t,function(e){if(on(e)||on(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(on(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=Qe(t),a._extensions=t,Je(new Ue([u],e,a),t),Je(new Ue(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=X.toISOString(new Date)),on(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new Ue(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=X.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[an]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new Me(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(rn(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},sn=function Sn(e){this.listeners=[];var o=X.arrForEach,n=!!(e||{}).perfEvtsSendAll;Se(Sn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=X.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=X.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},Xe=(tn=un,__extends(cn,tn),cn);function cn(){var e=tn.call(this)||this;return Se(cn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new _e(e),r||new sn(e))},t.track=function(e){Ae(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(X.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];X.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:X.toISOString(new Date),baseType:be.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var ln="_aiHooks",fn=["req","rsp","hkErr","fnErr"],gn="__proto__",dn="constructor";function vn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function pn(e,u,s,c,l){0<=l&&l<=2&&vn(e,function(e,n){var t=e.cbks,r=t[fn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[fn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function hn(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return vn(e,function(e){n.push(e)}),n}pn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,pn(e,r,i,n,3),u}return pn(e,r,i,n,1),r.rslt}}var yn=Object.getPrototypeOf;function xn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&(e=function o(e,n,t){var r=null;return e&&(X.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(yn)return yn(e);if(e=e[gn]||e[d]||e[dn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v){var i=r[ln];return i||((r=hn(i={i:0,n:n,f:r,h:[]}))[ln]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;vn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function mn(n,e,t,r){void 0===r&&(r=!0);var i=null;return vn(e,function(e){(e=xn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=Xe,c.BaseCore=un,c.BaseTelemetryPlugin=t,c.CoreUtils=X,c.EventHelper=te,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=sn,c.PerfEvent=Fe,c.PerfManager=Me,c.doPerf=Ae,c.DiagnosticLogger=_e,c._InternalLogMessage=be,c.ProcessTelemetryContext=Ue,c.initializePlugins=Je,c.sortPlugins=Qe,c._InternalMessageId=ie,c.InstrumentProto=function(e,n,t){return e?xn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?mn(e[d],n,t,!1):null},c.InstrumentFunc=xn,c.InstrumentFuncs=mn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map

@@ -10,3 +10,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export { CoreUtils, EventHelper, Undefined, normalizeJsName } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

@@ -13,0 +13,0 @@ export { PerfEvent, PerfManager, doPerf } from './JavaScriptSDK/PerfManager';

@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
import { getWindow, getDocument, getCrypto, getPerformance } from './EnvUtils';
import { getWindow, getDocument, getCrypto, getPerformance, getMsCrypto, getNavigator } from './EnvUtils';
// Added to help with minfication

@@ -14,2 +14,20 @@ export var Undefined = strShimUndefined;

var strRemoveEventListener = "removeEventListener";
var UInt32Mask = 0x100000000;
var MaxUInt32 = 0xffffffff;
var _isTrident = null;
// MWC based Random generator (for IE)
var _mwcSeeded = false;
var _mwcW = 123456789;
var _mwcZ = 987654321;
// Takes any integer
function _mwcSeed(seedValue) {
_mwcW = (123456789 + seedValue) & MaxUInt32;
_mwcZ = (987654321 - seedValue) & MaxUInt32;
_mwcSeeded = true;
}
function _autoSeedMwc() {
// Simple initialization using default Math.random() - So we inherit any entropy from the browser
// and bitwise XOR with the current milliseconds
_mwcSeed((Math.random() * UInt32Mask) ^ new Date().getTime());
}
function _isTypeof(value, theType) {

@@ -160,7 +178,3 @@ return typeof value === theType;

function randomHexDigit() {
var c = getCrypto();
if (c) {
return (c.getRandomValues(new Uint8Array(1))[0] % 16);
}
return Math.random() * 16;
return CoreUtils.randomValue(15); // Get a random value from 0..15
}

@@ -397,2 +411,131 @@ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {

};
/**
* Generate random base64 id string.
* The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
* @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
*/
CoreUtils.newId = function (maxLength) {
if (maxLength === void 0) { maxLength = 22; }
var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Start with an initial random number, consuming the value in reverse byte order
var number = CoreUtils.random32() >>> 0; // Make sure it's a +ve number
var chars = 0;
var result = "";
while (result.length < maxLength) {
chars++;
result += base64chars.charAt(number & 0x3F);
number >>>= 6; // Zero fill with right shift
if (chars === 5) {
// 5 base64 characters === 30 bits so we don't have enough bits for another base64 char
// So add on another 30 bits and make sure it's +ve
number = (((CoreUtils.random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
chars = 0; // We need to reset the number every 5 chars (30 bits)
}
}
return result;
};
/**
* Identifies whether the current environment appears to be IE
*/
CoreUtils.isIE = function () {
if (_isTrident === null) {
var navigator_1 = getNavigator() || {};
var userAgent = (navigator_1.userAgent || "").toLowerCase();
_isTrident = (userAgent.indexOf("msie") !== -1 || userAgent.indexOf("trident/") !== -1);
}
return _isTrident;
};
/**
* Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.
* So maxValue(16) will produce a number from 0..16 (range of 17)
* @param maxValue
*/
CoreUtils.randomValue = function (maxValue) {
if (maxValue > 0) {
return Math.floor((CoreUtils.random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
}
return 0;
};
/**
* generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
CoreUtils.random32 = function (signed) {
var value;
var c = getCrypto() || getMsCrypto();
if (c && c.getRandomValues) {
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
}
else if (CoreUtils.isIE()) {
// For IE 6, 7, 8 (especially on XP) Math.random is not very random
if (!_mwcSeeded) {
// Set the seed for the Mwc algorithm
_autoSeedMwc();
}
// Don't use Math.random for IE
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = CoreUtils.mwcRandom32() & MaxUInt32;
}
else {
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = Math.floor((UInt32Mask * Math.random()) | 0);
}
if (!signed) {
// Make sure we end up with a positive number and not -ve one.
value >>>= 0;
}
return value;
};
/**
* Seed the MWC random number generator with the specified seed or a random value
* @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen
*/
CoreUtils.mwcRandomSeed = function (value) {
if (!value) {
_autoSeedMwc();
}
else {
_mwcSeed(value);
}
};
/**
* Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)
* instead of Math.random() defaults to un-signed.
* Used as a replacement random generator for IE to avoid issues with older IE instances.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
CoreUtils.mwcRandom32 = function (signed) {
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
if (!signed) {
// Make sure we end up with a positive number and not -ve one.
value >>>= 0;
}
return value;
};
/**
* generate W3C trace id
*/
CoreUtils.generateW3CId = function () {
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
// rfc4122 version 4 UUID without dashes and with lowercase letters
var oct = "", tmp;
for (var a = 0; a < 4; a++) {
tmp = CoreUtils.random32();
oct +=
hexValues[tmp & 0xF] +
hexValues[tmp >> 4 & 0xF] +
hexValues[tmp >> 8 & 0xF] +
hexValues[tmp >> 12 & 0xF] +
hexValues[tmp >> 16 & 0xF] +
hexValues[tmp >> 20 & 0xF] +
hexValues[tmp >> 24 & 0xF] +
hexValues[tmp >> 28 & 0xF];
}
// "Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively"
var clockSequenceHi = hexValues[8 + (CoreUtils.random32() & 0x03) | 0];
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
};
CoreUtils.isTypeof = _isTypeof;

@@ -399,0 +542,0 @@ CoreUtils.isUndefined = _isUndefined;

@@ -24,2 +24,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

var strCrypto = "crypto";
var strMsCrypto = "msCrypto";
var strReactNative = "ReactNative";

@@ -198,2 +199,10 @@ /**

/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export function getMsCrypto() {
return getGlobalInst(strMsCrypto);
}
/**
* Returns whether the environment is reporting that we are running in a React Native Environment

@@ -200,0 +209,0 @@ */

/*!
* Application Insights JavaScript SDK - Core, 2.5.8
* Application Insights JavaScript SDK - Core, 2.5.9
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(l){"use strict";var i="function",o="object",n="undefined",a="prototype",u="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function r(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=i)throw new TypeError("Object prototype may only be an Object:"+e);function r(){}return r[a]=e,new r}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[u](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[a][u].call(n,i)&&(e[i]=n[i]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}s(e,n),e[a]=null===n?r(n):(t[a]=n[a],new t)};var c={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,v=i,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function N(){return!(typeof navigator!==g||!navigator)}function S(){return N()?navigator:x("navigator")}function I(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function P(){return!!(typeof JSON===g&&JSON||null!==x(h))}function F(){return P()?JSON||x(h):null}var _=n,L="attachEvent",M="addEventListener",O="detachEvent",A="removeEventListener";function j(e,n){return typeof e===n}function R(e){return j(e,n)||e===undefined}function D(e){return R(e)||null===e}function k(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function U(e){return j(e,o)}function z(e){return j(e,i)}function K(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!D(e))try{D(e[M])?D(e[L])||(e[L]("on"+n,t),i=!0):(e[M](n,t,r),i=!0)}catch(o){}return i}function B(e,n,t,r){if(void 0===r&&(r=!1),!D(e))try{D(e[A])?D(e[O])||e[O]("on"+n,t):e[A](n,t,r)}catch(i){}}var q=(V.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},V.isArray=function(e){return"[object Array]"===Object[a].toString.call(e)},V.isError=function(e){return"[object Error]"===Object[a].toString.call(e)},V.isString=function(e){return j(e,"string")},V.isNumber=function(e){return j(e,"number")},V.isBoolean=function(e){return j(e,"boolean")},V.disableCookies=function(){V._canUseCookies=!1},V.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(H,function(e){var n,t=0|((n=x("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},V.toISOString=function(e){if(V.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},V.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},V.arrIndexOf=function(e,n,t){for(var r=e.length,i=t||0,o=Math.max(0<=i?i:r-Math.abs(i),0);o<r;o++)if(o in e&&e[o]===n)return o;return-1},V.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},V.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},V.strTrim=function(e){return V.isString(e)?e.replace(/^\s+|\s+$/g,""):e},V.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(z(e)||U(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var r in e)k(e,r)&&t.push(r);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)k(e,i[a])&&t.push(i[a]);return t},V.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},V.addEventHandler=function(e,n){var t=!1,r=C();r&&(t=K(r,e,n),t=K(r.body,e,n)||t);var i=T();return i&&(t=G.Attach(i,e,n)||t),t},V.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},V.perfNow=function(){var e=E();return e&&e.now?e.now():V.dateNow()},V.isTypeof=j,V.isUndefined=R,V.isNullOrUndefined=D,V.hasOwnProperty=k,V.isFunction=z,V.isObject=U,V.objCreate=r,V);function V(){}var W,H=/[xy]/g,G=(J.Attach=K,J.AttachEvent=K,J.Detach=B,J.DetachEvent=B,J);function J(){}(W=l.LoggingSeverity||(l.LoggingSeverity={}))[W.CRITICAL=1]="CRITICAL",W[W.WARNING=2]="WARNING";var Q={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100},$="constructor",Z="prototype",Y="function",X="_dynInstFuncs",ee="_isDynProxy",ne="_dynClass",te="_dynCls$",re="_unknown_",ie="__proto__",oe=Object.getPrototypeOf,ae=0;function ue(e,n){return e&&Object[Z].hasOwnProperty.call(e,n)}function se(e){return typeof e===Y}function ce(e){return e&&(e===Object[Z]||e===Array[Z])}function le(e){return ce(e)||e===Function[Z]}function fe(e){if(e){if(oe)return oe(e);var n=e[ie]||e[Z]||e[$];if(n)return n}return null}function ge(e,n,t){return n!==$&&se(e[n])&&(t||ue(e,n))}function de(e){throw new TypeError("DynamicProto: "+e)}function ve(e,n){return ue(e,Z)?e.name||n||re:((e||{})[$]||{}).name||n||re}function pe(e,t,n){ue(e,Z)||de("theClass is an invalid class definition.");var r=e[Z];!function(e){for(var n=fe(t);n&&!le(n);){if(n===e)return 1;n=fe(n)}}(r)&&de("["+ve(e)+"] is not in class heirarchy of ["+ve(t)+"]");var i=null;ue(r,ne)?i=r[ne]:(i=te+ve(e,"_")+"$"+ae,ae++,r[ne]=i);var o=function(e){var n={};for(var t in e)!n[t]&&ge(e,t,!1)&&(n[t]=e[t]);return n}(t);n(t,function(e,n,t){function r(e,n){return function(){return n.apply(e,arguments)}}var i={};for(var o in t)i[o]=r(n,t[o]);for(var a=fe(e),u=[];a&&!le(a)&&!function(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}(u,a);){for(var o in a)!i[o]&&ge(a,o,!oe)&&(i[o]=r(n,a[o]));u.push(a),a=fe(a)}return i}(r,t,o)),function(e,n,t,r){if(!ce(e)){var i=t[X]=t[X]||{},o=i[n]=i[n]||{};for(var a in t)ge(t,a,!1)&&t[a]!==r[a]&&(o[a]=t[a],delete t[a],ue(e,a)&&(!e[a]||e[a][ee])||(e[a]=function(t,r){var i=function(){if(this&&ue(t,ne)){var e=((this[X]||{})[t[ne]]||{})[r];if(e)return e.apply(this,arguments);de("Missing ["+r+"] "+Y)}var n=t[r];return n===i&&(n=fe(t)[r]),se(n)||de("["+r+"] is not a "+Y),n.apply(this,arguments)};return i[ee]=1,i}(e,a)))}}(r,i,t,o)}function he(e){return e?'"'+e.replace(/\"/g,"")+'"':""}var ye=(xe.dataType="MessageData",xe);function xe(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;var i="";P()&&(i=F().stringify(r));var o=(n?" message:"+he(n):"")+(r?" props:"+he(i):"");this.message+=o}var me=function gn(o){this.identifier="DiagnosticLogger",this.queue=[];var a=0,c={};pe(gn,this,function(u){var r=q.isNullOrUndefined,s=q.isUndefined,i=q.isFunction;function e(e,n){var t=o[e];return r(t)?n:t}r(o)&&(o={}),u.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},u.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},u.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},u.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},u.throwInternal=function(e,n,t,r,i){void 0===i&&(i=!1);var o,a=new ye(n,t,i,r);if(u.enableDebugExceptions())throw a;!s(a)&&a&&(s(a.message)||(i?(o=+a.messageId,!c[o]&&u.consoleLoggingLevel()>=l.LoggingSeverity.WARNING&&(u.warnToConsole(a.message),c[o]=!0)):u.consoleLoggingLevel()>=l.LoggingSeverity.WARNING&&u.warnToConsole(a.message),u.logInternalMessage(e,a)))},u.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),i(t[n])&&t[n](e))},u.resetInternalMessageCount=function(){a=0,c={}},u.logInternalMessage=function(e,n){var t,r,i;a>=u.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,c[r]?t=!1:c[r]=!0,t&&(e<=u.telemetryLoggingLevel()&&(u.queue.push(n),a++),a===u.maxInternalMessageLimit()&&(i=new ye(Q.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),u.queue.push(i),u.warnToConsole("Internal events throttle limit per PageView reached for this app."))))}})},Ce="ctx",we=(Te.ParentContextKey="parent",Te.ChildrenContextKey="childEvts",Te);function Te(e,i,n){var t,o=this,a=!1;o.start=q.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},q.isFunction(i)&&(a=q.objDefineAccessors(o,"payload",function(){return!t&&q.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?e===Te.ParentContextKey||e===Te.ChildrenContextKey?o[e]:(o[Ce]||{})[e]:null},o.setCtx=function(e,n){e&&(e===Te.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===Te.ChildrenContextKey?o[e]=n:(o[Ce]=o[Ce]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(Te.ChildrenContextKey);if(q.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=q.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&q.isFunction(i)&&(o.payload=i())}}var Ne=function dn(n){this.ctx={},pe(dn,this,function(t){t.create=function(e,n,t){return new we(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Ce]=t[Ce]||{})[e]=n)},t.getCtx=function(e){return(t[Ce]||{})[e]}})},Se="CoreUtils.doPerf";function Ie(e,n,t,r,i){if(e){var o=e;if(o&&q.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Se);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(we.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(we.ChildrenContextKey))||(a=[],s.setCtx(we.ChildrenContextKey,a)),a.push(u))),o.setCtx(Se,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Se,s)}}}return t()}var be=q.isFunction,Ee=function(i,n){var o=this,a=null,u=be(i.processTelemetry),s=be(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Ie(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(l.LoggingSeverity.CRITICAL,Q.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},Pe=q.isNullOrUndefined;function Fe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o,a=e[i];a&&q.isFunction(a.processTelemetry)&&(o=new Ee(a,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var _e=function vn(e,o,t,n){var r,i,a,u,s=this,c=null;null!==n&&(e&&q.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),Fe(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(i=n)&&e&&(a=[],q.arrForEach(e,function(e){!u&&e!==i||(u=!0,a.push(e))})),i&&!u&&(a=a||[]).push(i),c=Fe(a,r)):q.isUndefined(n)&&(c=Fe(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new me(o||{})},s.getCfg=function(){return o},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!o||(r=o.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;void 0===t&&(t=!1);var i=s.getExtCfg(e,null);return i&&!Pe(i[n])?r=i[n]:o&&!Pe(o[n])&&(r=o[n]),Pe(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new vn(e||c,o,t,n)}},Le=q.isFunction,Me="getPlugin",Oe=(Ae.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Ae);function Ae(){var o=this,a=!1,u=null,s=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&Le(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=u||new _e(null,{},o.core),t=s&&s[Me]?n.createNew(null,s[Me]):n.createNew(null,s)),t},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Me]&&(i=s[Me]()),o.core=n,u=new _e(r,e,n,i),a=!0}}var je=q.isFunction,Re="processTelemetry",De="priority",ke="setNextPlugin",Ue="isInitialized";function ze(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&je(r[ke])&&je(o[Re])&&r[ke](o),je(o[Ue])&&o[Ue]()||e.push(o),r=o,i=i.getNext())}q.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function Ke(e){return e.sort(function(e,n){var t=0,r=je(n[Re]);return je(e[Re])?t=r?e[De]-n[De]:1:r&&(t=-1),t})}var Be,qe=500,Ve="Channel has invalid priority",We=q.objDefineAccessors,He=(Be=Oe,__extends(Ge,Be),Ge._staticInit=(We(Ge.prototype,"ChannelControls",Ge.prototype.getChannelControls),void We(Ge.prototype,"channelQueue",Ge.prototype.getChannelControls)),Ge);function Ge(){var r=Be.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=qe;var s,c=q.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<qe)throw Error(Ve+e.identifier)}),s.push(e))}return pe(Ge,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&q.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>qe&&o.push(e)}),l(o)),c(s,function(e){return ze(new _e(e,n,t),r)}))}}),r}var Je,Qe=q.arrForEach,$e=q.isNullOrUndefined,Ze="_notificationManager",Ye=function pn(){var n,s,c,t,l=!1;pe(pn,this,function(u){u._extensions=[],s=new He,n=[],u.isInitialized=function(){return l},u.initialize=function(e,n,r,t){if(u.isInitialized())throw Error("Core should not be initialized more than once");if(!e||$e(e.instrumentationKey))throw Error("Please provide instrumentation key");c=t,u[Ze]=t,u.config=e||{},e.extensions=$e(e.extensions)?[]:e.extensions,(e.extensionConfig=$e(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r=r||q.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),u.logger=r;var i=[];i.push.apply(i,n.concat(e.extensions)),i=Ke(i);var o=[],a={};if(Qe(i,function(e){if($e(e)||$e(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&($e(a[n])?a[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+a[n]+", "+t)),(!n||n<s.priority)&&o.push(e)}),i.push(s),o.push(s),i=Ke(i),u._extensions=i,ze(new _e([s],e,u),i),ze(new _e(o,e,u),i),u._extensions=o,0===u.getTransmissionControls().length)throw Error("No channels available");l=!0,u.releaseQueue()},u.getTransmissionControls=function(){return s.getChannelControls()},u.track=function(e){e.iKey||(e.iKey=u.config.instrumentationKey),e.time||(e.time=q.toISOString(new Date)),$e(e.ver)&&(e.ver="4.0"),u.isInitialized()?u.getProcessTelContext().processNext(e):n.push(e)},u.getProcessTelContext=function(){var e=u._extensions,n=e;return e&&0!==e.length||(n=[s]),new _e(n,u.config,u)},u.getNotifyMgr=function(){return c||(c=q.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),u[Ze]=c),c},u.getPerfMgr=function(){return t||u.config&&u.config.enablePerfMgr&&(t=new Ne(u.getNotifyMgr())),t},u.setPerfMgr=function(e){t=e},u.eventCnt=function(){return n.length},u.releaseQueue=function(){0<n.length&&(Qe(n,function(e){u.getProcessTelContext().processNext(e)}),n=[])}})},Xe=function hn(e){this.listeners=[];var o=q.arrForEach,n=!!(e||{}).perfEvtsSendAll;pe(hn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=q.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=q.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},en=(Je=Ye,__extends(nn,Je),nn);function nn(){var e=Je.call(this)||this;return pe(nn,e,function(r,i){function n(e){var n=r.getNotifyMgr();n&&n.eventsDiscarded([e],c.InvalidEvent)}r.initialize=function(e,n,t,r){i.initialize(e,n,t||new me(e),r||new Xe(e))},r.track=function(e){Ie(r.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(q.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},r.addNotificationListener=function(e){var n=r.getNotifyMgr();n&&n.addNotificationListener(e)},r.removeNotificationListener=function(e){var n=r.getNotifyMgr();n&&n.removeNotificationListener(e)},r.pollInternalLogs=function(t){var e=r.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=r.logger?r.logger.queue:[];q.arrForEach(e,function(e){var n={name:t||"InternalMessageId: "+e.messageId,iKey:r.config.instrumentationKey,time:q.toISOString(new Date),baseType:ye.dataType,baseData:{message:e.message}};r.track(n)}),e.length=0},e)}}),e}var tn="_aiHooks",rn=["req","rsp","hkErr","fnErr"],on="__proto__",an="constructor";function un(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function sn(e,s,c,l,f){0<=f&&f<=2&&un(e,function(e,n){var t=e.cbks,r=t[rn[f]];if(r){s.ctx=function(){return l[n]=l[n]||{}};try{r.apply(s.inst,c)}catch(a){var i=s.err;try{var o=t[rn[2]];o&&(s.err=a,o.apply(s.inst,c))}catch(u){}finally{s.err=i}}}})}var cn=Object.getPrototypeOf;function ln(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t){var i=function l(e,n,t){var r=null;return e&&(q.hasOwnProperty(e,n)?r=e:t&&(r=l(function(e){if(e){if(cn)return cn(e);var n=e[on]||e[d]||e[an];if(n)return n}return null}(e),n,!1))),r}(e,n,r);if(i){var o=i[n];if(typeof o===v){var a,u=o[tn];u||(c=u={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=c.h,r={name:c.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return un(e,function(e){n.push(e)}),n}sn(e,r,i,n,0);var a=c.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,sn(e,r,i,n,3),u}return sn(e,r,i,n,1),r.rslt})[tn]=u,i[n]=a);var s={id:u.i,cbks:t,rm:function(){var t=this.id;un(u.h,function(e,n){return e.id===t&&(u.h.splice(n,1),1)})}};return u.i++,u.h.push(s),s}}}var c;return null}function fn(t,e,r,i){void 0===i&&(i=!0);var o=null;return un(e,function(e){var n=ln(t,e,r,i);n&&(o=o||[]).push(n)}),o}l.MinChannelPriorty=100,l.EventsDiscardedReason=c,l.AppInsightsCore=en,l.BaseCore=Ye,l.BaseTelemetryPlugin=Oe,l.CoreUtils=q,l.EventHelper=G,l.Undefined=_,l.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},l.getGlobal=y,l.getGlobalInst=x,l.hasWindow=m,l.getWindow=C,l.hasDocument=w,l.getDocument=T,l.hasNavigator=N,l.getNavigator=S,l.hasHistory=I,l.getHistory=function(){return I()?history:x("history")},l.getLocation=function(){return typeof location===g&&location?location:x("location")},l.getPerformance=E,l.hasJSON=P,l.getJSON=F,l.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},l.getConsole=b,l.strUndefined=f,l.strObject=g,l.strPrototype=d,l.strFunction=v,l.NotificationManager=Xe,l.PerfEvent=we,l.PerfManager=Ne,l.doPerf=Ie,l.DiagnosticLogger=me,l._InternalLogMessage=ye,l.ProcessTelemetryContext=_e,l.initializePlugins=ze,l.sortPlugins=Ke,l._InternalMessageId=Q,l.InstrumentProto=function(e,n,t){return e?ln(e[d],n,t,!1):null},l.InstrumentProtos=function(e,n,t){return e?fn(e[d],n,t,!1):null},l.InstrumentFunc=ln,l.InstrumentFuncs=fn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(l,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(un=Xe=e()||{}).__assign||(un.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),un.__extends||(un.__extends=t),__assign=__assign||Xe.__assign,__extends=__extends||Xe.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,K=123456789,B=987654321;function V(e){K=123456789+e&k,B=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}var X=(ee.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ee.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ee.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ee.isString=function(e){return W(e,"string")},ee.isNumber=function(e){return W(e,"number")},ee.isBoolean=function(e){return W(e,"boolean")},ee.disableCookies=function(){ee._canUseCookies=!1},ee.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(ne,function(e){var n=0|ee.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ee.toISOString=function(e){if(ee.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},ee.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ee.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ee.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ee.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ee.strTrim=function(e){return ee.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ee.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ee.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},ee.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=te.Attach(r,e,n)||t),t},ee.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ee.perfNow=function(){var e=E();return e&&e.now?e.now():ee.dateNow()},ee.newId=function(e){void 0===e&&(e=22);for(var n=ee.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ee.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ee.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ee.randomValue=function(e){return 0<e?Math.floor(ee.random32()/k*(e+1))>>>0:0},ee.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ee.isIE()?(z||q(),ee.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ee.mwcRandomSeed=function(e){e?V(e):q()},ee.mwcRandom32=function(e){var n=((B=36969*(65535&B)+(B>>16)&k)<<16)+(65535&(K=18e3*(65535&K)+(K>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ee.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ee.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ee.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ee.isTypeof=W,ee.isUndefined=H,ee.isNullOrUndefined=G,ee.hasOwnProperty=J,ee.isFunction=$,ee.isObject=Q,ee.objCreate=u,ee);function ee(){}var ne=/[xy]/g,te=(re.Attach=Z,re.AttachEvent=Z,re.Detach=Y,re.DetachEvent=Y,re);function re(){}(un=c.LoggingSeverity||(c.LoggingSeverity={}))[un.CRITICAL=1]="CRITICAL",un[un.WARNING=2]="WARNING";var ie={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100},oe="constructor",ae="prototype",ue="function",se="_dynInstFuncs",ce="_isDynProxy",le="_dynClass",fe="_dynCls$",ge="_unknown_",de="__proto__",ve=Object.getPrototypeOf,pe=0;function he(e,n){return e&&Object[ae].hasOwnProperty.call(e,n)}function ye(e){return typeof e===ue}function xe(e){return e&&(e===Object[ae]||e===Array[ae])}function me(e){return xe(e)||e===Function[ae]}function Ce(e){if(e){if(ve)return ve(e);if(e=e[de]||e[ae]||e[oe])return e}return null}function we(e,n,t){return n!==oe&&ye(e[n])&&(t||he(e,n))}function Te(e){throw new TypeError("DynamicProto: "+e)}function Ie(e,n){return he(e,ae)?e.name||n||ge:((e||{})[oe]||{}).name||n||ge}function Se(e,t,n){he(e,ae)||Te("theClass is an invalid class definition.");var r=e[ae];!function(e){for(var n=Ce(t);n&&!me(n);){if(n===e)return 1;n=Ce(n)}}(r)&&Te("["+Ie(e)+"] is not in class heirarchy of ["+Ie(t)+"]");var i=null;he(r,le)?i=r[le]:(i=fe+Ie(e,"_")+"$"+pe,pe++,r[le]=i),n(t,function(e,n,t){function r(e,n){return function(){return n.apply(e,arguments)}}var i={};for(u in t)i[u]=r(n,t[u]);for(var o=Ce(e),a=[];o&&!me(o)&&!function(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}(a,o);){for(var u in o)!i[u]&&we(o,u,!ve)&&(i[u]=r(n,o[u]));a.push(o),o=Ce(o)}return i}(r,t,e=function(e){var n,t={};for(n in e)!t[n]&&we(e,n,!1)&&(t[n]=e[n]);return t}(t))),function(e,n,t,r){if(!xe(e)){var i,o=t[se]=t[se]||{},a=o[n]=o[n]||{};for(i in t)we(t,i,!1)&&t[i]!==r[i]&&(a[i]=t[i],delete t[i],he(e,i)&&(!e[i]||e[i][ce])||(e[i]=function(n,t){var r=function(){if(this&&he(n,le)){var e=((this[se]||{})[n[le]]||{})[t];if(e)return e.apply(this,arguments);Te("Missing ["+t+"] "+ue)}return(e=n[t])===r&&(e=Ce(n)[t]),ye(e)||Te("["+t+"] is not a "+ue),e.apply(this,arguments)};return r[ce]=1,r}(e,i)))}}(r,i,t,e)}function Ne(e){return e?'"'+e.replace(/\"/g,"")+'"':""}var be=(Ee.dataType="MessageData",Ee);function Ee(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Ne(n):"")+(r?" props:"+Ne(e):""),this.message+=e}var _e=function Cn(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Se(Cn,this,function(o){var t=X.isNullOrUndefined,a=X.isUndefined,r=X.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new be(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new be(ie.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},Pe="ctx",Fe=(Le.ParentContextKey="parent",Le.ChildrenContextKey="childEvts",Le);function Le(e,i,n){var t,o=this,a=!1;o.start=X.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},X.isFunction(i)&&(a=X.objDefineAccessors(o,"payload",function(){return!t&&X.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===Le.ParentContextKey||e===Le.ChildrenContextKey?o:o[Pe]||{})[e]:null},o.setCtx=function(e,n){e&&(e===Le.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===Le.ChildrenContextKey?o[e]=n:(o[Pe]=o[Pe]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(Le.ChildrenContextKey);if(X.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&X.isFunction(i)&&(o.payload=i())}}var Me=function wn(n){this.ctx={},Se(wn,this,function(t){t.create=function(e,n,t){return new Fe(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Pe]=t[Pe]||{})[e]=n)},t.getCtx=function(e){return(t[Pe]||{})[e]}})},Oe="CoreUtils.doPerf";function Ae(e,n,t,r,i){if(e){var o=e;if(o&&X.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Oe);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(Fe.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(Fe.ChildrenContextKey))||(a=[],s.setCtx(Fe.ChildrenContextKey,a)),a.push(u))),o.setCtx(Oe,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Oe,s)}}}return t()}var je=X.isFunction,Re=function(i,n){var o=this,a=null,u=je(i.processTelemetry),s=je(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Ae(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,ie.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},De=X.isNullOrUndefined;function ke(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&X.isFunction(o.processTelemetry)&&(o=new Re(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var Ue=function Tn(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&X.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),ke(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],X.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=ke(a,r)):X.isUndefined(n)&&(c=ke(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new _e(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!De(e[n])?r=e[n]:i&&!De(i[n])&&(r=i[n]),De(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new Tn(e||c,i,t,n)}},ze=X.isFunction,Ke="getPlugin",t=(Be.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Be);function Be(){var o=this,a=!1,u=null,s=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&ze(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new Ue(null,{},o.core),n=s&&s[Ke]?e.createNew(null,s[Ke]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Ke]&&(i=s[Ke]()),o.core=n,u=new Ue(r,e,n,i),a=!0}}var Ve=X.isFunction,qe="processTelemetry",We="priority",He="setNextPlugin",Ge="isInitialized";function Je(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&Ve(r[He])&&Ve(o[qe])&&r[He](o),Ve(o[Ge])&&o[Ge]()||e.push(o),r=o,i=i.getNext())}X.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function Qe(e){return e.sort(function(e,n){var t=0,r=Ve(n[qe]);return Ve(e[qe])?t=r?e[We]-n[We]:1:r&&(t=-1),t})}var $e,Ze=500,Ye="Channel has invalid priority",Xe=X.objDefineAccessors,en=($e=t,__extends(nn,$e),nn._staticInit=(Xe(nn.prototype,"ChannelControls",nn.prototype.getChannelControls),void Xe(nn.prototype,"channelQueue",nn.prototype.getChannelControls)),nn);function nn(){var r=$e.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=Ze;var s,c=X.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<Ze)throw Error(Ye+e.identifier)}),s.push(e))}return Se(nn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&X.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>Ze&&o.push(e)}),l(o)),c(s,function(e){return Je(new Ue(e,n,t),r)}))}}),r}var tn,rn=X.arrForEach,on=X.isNullOrUndefined,an="_notificationManager",un=function In(){var n,u,s,t,c=!1;Se(In,this,function(a){a._extensions=[],u=new en,n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||on(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[an]=t,a.config=e||{},e.extensions=on(e.extensions)?[]:e.extensions,(e.extensionConfig=on(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r=r||X.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r,(t=[]).push.apply(t,n.concat(e.extensions)),t=Qe(t);var i=[],o={};if(rn(t,function(e){if(on(e)||on(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(on(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=Qe(t),a._extensions=t,Je(new Ue([u],e,a),t),Je(new Ue(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=X.toISOString(new Date)),on(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new Ue(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=X.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[an]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new Me(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(rn(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},sn=function Sn(e){this.listeners=[];var o=X.arrForEach,n=!!(e||{}).perfEvtsSendAll;Se(Sn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=X.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=X.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},Xe=(tn=un,__extends(cn,tn),cn);function cn(){var e=tn.call(this)||this;return Se(cn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new _e(e),r||new sn(e))},t.track=function(e){Ae(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(X.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];X.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:X.toISOString(new Date),baseType:be.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var ln="_aiHooks",fn=["req","rsp","hkErr","fnErr"],gn="__proto__",dn="constructor";function vn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function pn(e,u,s,c,l){0<=l&&l<=2&&vn(e,function(e,n){var t=e.cbks,r=t[fn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[fn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function hn(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return vn(e,function(e){n.push(e)}),n}pn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,pn(e,r,i,n,3),u}return pn(e,r,i,n,1),r.rslt}}var yn=Object.getPrototypeOf;function xn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&(e=function o(e,n,t){var r=null;return e&&(X.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(yn)return yn(e);if(e=e[gn]||e[d]||e[dn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v){var i=r[ln];return i||((r=hn(i={i:0,n:n,f:r,h:[]}))[ln]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;vn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function mn(n,e,t,r){void 0===r&&(r=!0);var i=null;return vn(e,function(e){(e=xn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=Xe,c.BaseCore=un,c.BaseTelemetryPlugin=t,c.CoreUtils=X,c.EventHelper=te,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=sn,c.PerfEvent=Fe,c.PerfManager=Me,c.doPerf=Ae,c.DiagnosticLogger=_e,c._InternalLogMessage=be,c.ProcessTelemetryContext=Ue,c.initializePlugins=Je,c.sortPlugins=Qe,c._InternalMessageId=ie,c.InstrumentProto=function(e,n,t){return e?xn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?mn(e[d],n,t,!1):null},c.InstrumentFunc=xn,c.InstrumentFuncs=mn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map
{
"name": "@microsoft/applicationinsights-core-js",
"author": "Microsoft Corporation",
"version": "2.5.8",
"version": "2.5.9",
"description": "Microsoft Application Insights Core Javascript SDK",

@@ -49,5 +49,5 @@ "keywords": [

"dependencies": {
"@microsoft/applicationinsights-shims" : "1.0.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/dynamicproto-js": "^1.0.0"
}
}

@@ -32,3 +32,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

*/
initialize(config: IConfiguration, extensions: IPlugin[]): void;
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;

@@ -35,0 +35,0 @@ /*

@@ -104,2 +104,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

perfEvtsSendAll?: boolean;
/**
* [Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session.
* Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
*/
idLength?: number;
}

@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
import { getWindow, getDocument, getCrypto, getPerformance } from './EnvUtils';
import { getWindow, getDocument, getCrypto, getPerformance, getMsCrypto, getNavigator } from './EnvUtils';

@@ -15,3 +15,25 @@ // Added to help with minfication

const strRemoveEventListener = "removeEventListener";
const UInt32Mask = 0x100000000;
const MaxUInt32 = 0xffffffff;
let _isTrident: boolean = null;
// MWC based Random generator (for IE)
let _mwcSeeded = false;
let _mwcW = 123456789;
var _mwcZ = 987654321;
// Takes any integer
function _mwcSeed(seedValue: number) {
_mwcW = (123456789 + seedValue) & MaxUInt32;
_mwcZ = (987654321 - seedValue) & MaxUInt32;
_mwcSeeded = true;
}
function _autoSeedMwc() {
// Simple initialization using default Math.random() - So we inherit any entropy from the browser
// and bitwise XOR with the current milliseconds
_mwcSeed((Math.random() * UInt32Mask) ^ new Date().getTime());
}
function _isTypeof(value: any, theType: string): boolean {

@@ -192,7 +214,3 @@ return typeof value === theType;

function randomHexDigit() {
let c = getCrypto();
if (c) {
return (c.getRandomValues(new Uint8Array(1))[0] % 16);
}
return Math.random() * 16;
return CoreUtils.randomValue(15); // Get a random value from 0..15
}

@@ -471,2 +489,147 @@

}
/**
* Generate random base64 id string.
* The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
* @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
*/
public static newId(maxLength = 22): string {
const base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Start with an initial random number, consuming the value in reverse byte order
let number = CoreUtils.random32() >>> 0; // Make sure it's a +ve number
let chars = 0;
let result = "";
while (result.length < maxLength) {
chars ++;
result += base64chars.charAt(number & 0x3F);
number >>>= 6; // Zero fill with right shift
if (chars === 5) {
// 5 base64 characters === 30 bits so we don't have enough bits for another base64 char
// So add on another 30 bits and make sure it's +ve
number = (((CoreUtils.random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
chars = 0; // We need to reset the number every 5 chars (30 bits)
}
}
return result;
}
/**
* Identifies whether the current environment appears to be IE
*/
public static isIE() {
if (_isTrident === null) {
let navigator = getNavigator() || ({} as Navigator);
let userAgent = (navigator.userAgent || "").toLowerCase();
_isTrident = (userAgent.indexOf("msie") !== -1 || userAgent.indexOf("trident/") !== -1);
}
return _isTrident;
}
/**
* Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.
* So maxValue(16) will produce a number from 0..16 (range of 17)
* @param maxValue
*/
public static randomValue(maxValue: number) {
if (maxValue > 0) {
return Math.floor((CoreUtils.random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
}
return 0;
}
/**
* generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
public static random32(signed?: boolean) {
let value;
let c = getCrypto() || getMsCrypto();
if (c && c.getRandomValues) {
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
} else if (CoreUtils.isIE()) {
// For IE 6, 7, 8 (especially on XP) Math.random is not very random
if (!_mwcSeeded) {
// Set the seed for the Mwc algorithm
_autoSeedMwc();
}
// Don't use Math.random for IE
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = CoreUtils.mwcRandom32() & MaxUInt32;
} else {
// Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)
value = Math.floor((UInt32Mask * Math.random()) | 0);
}
if (!signed) {
// Make sure we end up with a positive number and not -ve one.
value >>>= 0;
}
return value;
}
/**
* Seed the MWC random number generator with the specified seed or a random value
* @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen
*/
public static mwcRandomSeed(value?: number)
{
if (!value) {
_autoSeedMwc();
} else {
_mwcSeed(value);
}
}
/**
* Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)
* instead of Math.random() defaults to un-signed.
* Used as a replacement random generator for IE to avoid issues with older IE instances.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
public static mwcRandom32(signed?: boolean) {
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
let value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
if (!signed) {
// Make sure we end up with a positive number and not -ve one.
value >>>= 0;
}
return value;
}
/**
* generate W3C trace id
*/
public static generateW3CId() {
const hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
// rfc4122 version 4 UUID without dashes and with lowercase letters
let oct = "", tmp;
for (let a = 0; a < 4; a++) {
tmp = CoreUtils.random32();
oct +=
hexValues[tmp & 0xF] +
hexValues[tmp >> 4 & 0xF] +
hexValues[tmp >> 8 & 0xF] +
hexValues[tmp >> 12 & 0xF] +
hexValues[tmp >> 16 & 0xF] +
hexValues[tmp >> 20 & 0xF] +
hexValues[tmp >> 24 & 0xF] +
hexValues[tmp >> 28 & 0xF];
}
// "Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively"
const clockSequenceHi = hexValues[8 + (CoreUtils.random32() & 0x03) | 0];
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
}
}

@@ -473,0 +636,0 @@

@@ -30,2 +30,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

const strCrypto = "crypto";
const strMsCrypto = "msCrypto";
const strReactNative = "ReactNative";

@@ -231,2 +232,11 @@

/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export function getMsCrypto(): Crypto | null {
return getGlobalInst(strMsCrypto);
}
/**
* Returns whether the environment is reporting that we are running in a React Native Environment

@@ -233,0 +243,0 @@ */

@@ -18,3 +18,3 @@ import '@microsoft/applicationinsights-shims';

export { CoreUtils, EventHelper, Undefined, normalizeJsName } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

@@ -21,0 +21,0 @@ export { INotificationManager } from "./JavaScriptSDK.Interfaces/INotificationManager";

@@ -17,3 +17,3 @@ import { ITelemetryItem } from "./ITelemetryItem";

isInitialized?: () => boolean;
initialize(config: IConfiguration, extensions: IPlugin[]): void;
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
getTransmissionControls(): IChannelControls[][];

@@ -20,0 +20,0 @@ track(telemetryItem: ITelemetryItem): void;

@@ -89,2 +89,7 @@ import { ITelemetryPlugin } from "./ITelemetryPlugin";

perfEvtsSendAll?: boolean;
/**
* [Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session.
* Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
*/
idLength?: number;
}

@@ -150,2 +150,39 @@ export declare const Undefined = "undefined";

static perfNow(): number;
/**
* Generate random base64 id string.
* The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
* @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
*/
static newId(maxLength?: number): string;
/**
* Identifies whether the current environment appears to be IE
*/
static isIE(): boolean;
/**
* Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.
* So maxValue(16) will produce a number from 0..16 (range of 17)
* @param maxValue
*/
static randomValue(maxValue: number): number;
/**
* generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
static random32(signed?: boolean): number;
/**
* Seed the MWC random number generator with the specified seed or a random value
* @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen
*/
static mwcRandomSeed(value?: number): void;
/**
* Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)
* instead of Math.random() defaults to un-signed.
* Used as a replacement random generator for IE to avoid issues with older IE instances.
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
*/
static mwcRandom32(signed?: boolean): number;
/**
* generate W3C trace id
*/
static generateW3CId(): string;
}

@@ -152,0 +189,0 @@ export declare class EventHelper {

@@ -122,4 +122,10 @@ /**

/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export declare function getMsCrypto(): Crypto | null;
/**
* Returns whether the environment is reporting that we are running in a React Native Environment
*/
export declare function isReactNative(): boolean;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc