Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-common

Package Overview
Dependencies
Maintainers
5
Versions
563
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-common - npm Package Compare versions

Comparing version 1.0.0-beta.12 to 1.0.0-beta.13

4

browser/applicationinsights-common.min.js
/*!
* Application Insights JavaScript SDK - Common, 1.0.0-beta.12
* Application Insights JavaScript SDK - Common, 1.0.0-beta.13
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}(this,function(h){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=h.FieldType||(h.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var m,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=m||(m={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,T=45,f=52,g=56,S=57,I=61,N=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,S,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,I,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,N)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),C=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),F=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),M=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function U(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),O=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:h.FieldType.Required,iKey:h.FieldType.Required,name:h.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?h.FieldType.Hidden:h.FieldType.Required},tags:h.FieldType.Required,data:h.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),q=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(q),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Required,properties:h.FieldType.Default,measurements:h.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:h.FieldType.Required,exceptions:h.FieldType.Required,severityLevel:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(q)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:h.FieldType.Default,outerId:h.FieldType.Default,typeName:h.FieldType.Required,message:h.FieldType.Required,hasFullStack:h.FieldType.Default,stack:h.FieldType.Default,parsedStack:h.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.FieldType.Required,method:h.FieldType.Required,assembly:h.FieldType.Default,fileName:h.FieldType.Default,line:h.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(q);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.FieldType.Required,kind:h.FieldType.Default,value:h.FieldType.Required,count:h.FieldType.Default,min:h.FieldType.Default,max:h.FieldType.Default,stdDev:h.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:h.FieldType.Required,metrics:h.FieldType.Required,properties:h.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Default,url:h.FieldType.Default,duration:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default,id:h.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:h.FieldType.Required,ver:h.FieldType.Required,name:h.FieldType.Default,resultCode:h.FieldType.Default,duration:h.FieldType.Default,success:h.FieldType.Default,data:h.FieldType.Default,target:h.FieldType.Default,type:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default,kind:h.FieldType.Default,value:h.FieldType.Default,count:h.FieldType.Default,min:h.FieldType.Default,max:h.FieldType.Default,stdDev:h.FieldType.Default,dependencyKind:h.FieldType.Default,dependencySource:h.FieldType.Default,commandName:h.FieldType.Default,dependencyTypeName:h.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=F.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(q)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:h.FieldType.Required,message:h.FieldType.Required,severityLevel:h.FieldType.Default,properties:h.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(q)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Default,url:h.FieldType.Default,duration:h.FieldType.Default,perfTotal:h.FieldType.Default,networkConnect:h.FieldType.Default,sentRequest:h.FieldType.Default,receivedResponse:h.FieldType.Default,domProcessing:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(m.WARNING,T,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:h.FieldType.Required,baseData:h.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=h.SeverityLevel||(h.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!u.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],u.isNullOrUndefined(r)?i:r},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},ae=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}(),oe=new function(e){this.UserExtensionName="User",this.WebExtensionName="Web",this.AppExtensionName="App",this.accountIdTag="User.AccountId",this.userTagsKeysMap={},this.userTagsKeysMap[this.accountIdTag]=e.userAccountId,this.ctxKeys={id:"id",authId:"authId",localId:"localId"},this.userExtKeysMap={},this.userExtKeysMap[this.ctxKeys.localId]=e.userId,this.userExtKeysMap[this.ctxKeys.authId]=e.userAuthUserId}(new re);h.Util=x,h.CorrelationIdHelper=C,h.UrlHelper=_,h.DateTimeUtils=M,h.RequestHeaders=A,h.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",h.AIData=k,h.AIBase=z,h.Envelope=O,h.Event=G,h.Exception=j,h.Metric=Y,h.PageView=$,h.PageViewData=J,h.RemoteDependencyData=Z,h.Trace=ee,h.PageViewPerformance=te,h.Data=ne,h.ConfigurationManager=ie,h.ContextTagKeys=re,h.DataSanitizer=E,h.TelemetryItemCreator=ae,h.partAExtensions=oe,Object.defineProperty(h,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}("undefined"!=typeof self?self:this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,u=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,I=61,N=66,w=68,D=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),x=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,I,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,N)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,D).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),E=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,w,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),R=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=R.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=R.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=x.sanitizeString(e,n?n+" "+i:i);else a=x.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),_=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),M=function(e,t){return(M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function b(e,t){function n(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U,L,O=function(){},k=function(e){function t(){return e.call(this)||this}return b(t,e),t}(O),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=x.sanitizeString(e,n)||E.NotSpecified,i.data=t,i.time=E.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return b(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),V=function(){},z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(V),P=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=x.sanitizeString(e,t)||E.NotSpecified,r.properties=x.sanitizeProperties(e,n),r.measurements=x.sanitizeMeasurements(e,i),r}return b(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(z),G=function(){},H=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=x.sanitizeProperties(e,n),a.measurements=x.sanitizeMeasurements(e,i),a.exceptions=[new B(e,t)],r&&(a.severityLevel=r),a}return b(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return b(e,t),e}(V)),B=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=x.sanitizeString(e,t.name)||E.NotSpecified,n.message=x.sanitizeMessage(e,t.message)||E.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=x.sanitizeException(e,i),n.hasFullStack=E.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return b(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(X.regex.test(o)){var s=new X(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=c,p=u,c++,u--}}return t},e}(H),X=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=E.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=E.trim(i[2])||n.method,n.fileName=E.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return b(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(G),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return b(e,t),e}(V);(L=U||(U={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return b(e,t),e}(function(){this.kind=U.Measurement}),Y=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var c=new Q;return c.count=0<i?i:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(r)||null===r?void 0:r,c.name=x.sanitizeString(e,t)||E.NotSpecified,c.value=n,s.metrics=[c],s.properties=x.sanitizeProperties(e,o),s}return b(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(z),$=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=x.sanitizeId(e,o),s.url=x.sanitizeUrl(e,n),s.name=x.sanitizeString(e,t)||E.NotSpecified,isNaN(i)||(s.duration=E.msToTimeSpan(i)),s.properties=x.sanitizeProperties(e,r),s.measurements=x.sanitizeMeasurements(e,a),s}return b(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,c,u){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=E.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=x.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=x.sanitizeProperties(e,c),l.measurements=x.sanitizeMeasurements(e,u),l}return b(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return b(e,t),e}(V)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||E.NotSpecified,r.message=x.sanitizeMessage(e,t),r.properties=x.sanitizeProperties(e,i),n&&(r.severityLevel=n),r}return b(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return b(e,t),e}(V)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var c=g.getDuration(s.navigationStart,s.loadEventEnd),u=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:d,dom:p}):g.shouldCollectDuration(c,u,l,d,p)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:p}):(o.durationMs=c,o.perfTotal=o.duration=E.msToTimeSpan(c),o.networkConnect=E.msToTimeSpan(u),o.sentRequest=E.msToTimeSpan(l),o.receivedResponse=E.msToTimeSpan(d),o.domProcessing=E.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:p})}return o.url=x.sanitizeUrl(e,n),o.name=x.sanitizeString(e,t)||E.NotSpecified,o.properties=x.sanitizeProperties(e,r),o.measurements=x.sanitizeMeasurements(e,a),o}return b(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return b(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(r)?i:r},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},ae=function(){function e(){}return e.domain="domain",e.browser="web.browser",e.browserVer="web.browserVer",e.browserLang="web.browserLang",e.userConsent="web.userConsent",e.isManual="web.isManual",e.screenRes="web.screenRes",e}(),oe=function(){function e(){}return e.localId="device.localId",e.model="device.model",e.deviceType="device.class",e}(),se=function(){function e(){}return e.sessionId="app.sesId",e}(),ce=function(){function e(){}return e.id="user.id",e.authId="authId",e.localId="localId",e}(),ue=function(){function e(){}return e.accountId="user.accountId",e}(),le=function(){function e(){}return e.clientIp="ingest.clientIp",e}(),de=function(){function e(){}return e.deviceOS="os.name",e}(),pe=function(){function e(){}return e.sessionIsFirst="ai.session.isFirst",e.sessionIsNew="ai.session.isNew",e.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",e.userStoreRegion="ai.user.storeRegion",e.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",e.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",e.cloudName="ai.cloud.name",e.cloudRole="ai.cloud.role",e.cloudRoleVer="ai.cloud.roleVer",e.cloudRoleInstance="ai.cloud.roleInstance",e.cloudEnvironment="ai.cloud.environment",e.cloudLocation="ai.cloud.location",e.cloudDeploymentUnit="ai.cloud.deploymentUnit",e.internalNodeName="ai.internal.nodeName",e.internalSdkVersion="ai.internal.sdkVersion",e.internalAgentVersion="ai.internal.agentVersion",e.deviceOEMName="ai.device.oemName",e.deviceNetwork="ai.device.network",e.applicationVersion="ai.application.ver",e.applicationBuild="ai.application.build",e.deviceLocale="ai.device.locale",e.deviceOSVersion="ai.device.osVersion",e.locationIp="ai.location.ip",e.operationId="ai.operation.id",e.operationParentId="ai.operation.parentId",e.operationRootId="ai.operation.rootId",e.operationSyntheticSource="ai.operation.syntheticSource",e}(),fe=new re,ge=function(){function o(){}return o.create=function(e,t,n,i,r,a){if(n=x.sanitizeString(i,n)||E.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},o.convertoFrom=function(e,t){var n,i={};for(var r in e.data)"baseData"!==r&&"baseType"!==r&&(i[r]=e.data[r]);switch(e.data.baseType){case Z.dataType:var a=e.data.baseType;n=o.create(a,Z.dataType,Z.envelopeType,t,i)}return o._extractPartA(e,n),n},o._extractPartA=function(t,n){var i=[];n&&t.tags&&(n.tags||(n.tags=[]),n.ctx||(n.ctx={}),t.tags[fe.applicationVersion]&&(n.tags[pe.applicationVersion]=t.tags[fe.applicationVersion],i.push(fe.applicationVersion)),t.tags[fe.applicationBuild]&&(n.tags[pe.applicationBuild]=t.tags[fe.applicationBuild],i.push(fe.applicationBuild)),t.tags[fe.sessionId]&&(n.ctx[se.sessionId]=t.tags[fe.sessionId],i.push(fe.sessionId)),t.tags[fe.sessionIsFirst]&&(n.tags[fe.sessionIsFirst]=t.tags[fe.sessionIsFirst],i.push(fe.sessionIsFirst)),t.tags[fe.deviceId]&&(n.ctx[oe.localId]=t.tags[fe.deviceId],i.push(fe.deviceId)),t.tags[fe.deviceIp]&&(n.ctx[le.clientIp]=t.tags[fe.deviceIp],i.push(fe.deviceIp)),t.tags[fe.deviceLanguage]&&(n.ctx[ae.browserLang]=t.tags[fe.deviceLanguage],i.push(fe.deviceLanguage)),t.tags[fe.deviceLocale]&&(n.tags[pe.deviceLocale]=t.tags[fe.deviceLocale],i.push(fe.deviceLocale)),t.tags[fe.deviceModel]&&(n.ctx[oe.model]=t.tags[fe.deviceModel],i.push(fe.deviceModel)),t.tags[fe.deviceNetwork]&&(n.ctx[pe.deviceNetwork]=t.tags[fe.deviceNetwork],i.push(fe.deviceNetwork)),t.tags[fe.deviceOEMName]&&(n.ctx[pe.deviceOEMName]=t.tags[fe.deviceOEMName],i.push(fe.deviceOEMName)),t.tags[fe.deviceOSVersion]&&(n.tags[pe.deviceOSVersion]=t.tags[fe.deviceOSVersion],i.push(fe.deviceOSVersion)),t.tags[fe.deviceOS]&&(n.ctx[de.deviceOS]=t.tags[fe.deviceOS],i.push(fe.deviceModel)),t.tags[fe.deviceNetwork]&&(n.ctx[pe.deviceNetwork]=t.tags[fe.deviceNetwork],i.push(fe.deviceNetwork)),t.tags[fe.deviceType]&&(n.ctx[oe.deviceType]=t.tags[fe.deviceType],i.push(fe.deviceType)),t.tags[fe.deviceOSVersion]&&(n.tags[pe.deviceOSVersion]=t.tags[fe.deviceOSVersion],i.push(fe.deviceOSVersion)),t.tags[fe.deviceScreenResolution]&&(n.tags[ae.screenRes]=t.tags[fe.deviceScreenResolution],i.push(fe.deviceScreenResolution)),t.tags.sampleRate&&(n.tags.sampleRate=t.tags.sampleRate,i.push(fe.deviceScreenResolution)),t.tags[fe.locationIp]&&(n.tags[fe.locationIp]=t.tags[fe.locationIp],i.push(fe.locationIp)),t.tags[fe.internalSdkVersion]&&(n.tags[fe.internalSdkVersion]=t.tags[fe.internalSdkVersion],i.push(fe.internalSdkVersion)),t.tags[fe.internalAgentVersion]&&(n.tags[fe.internalAgentVersion]=t.tags[fe.internalAgentVersion],i.push(fe.internalAgentVersion)),t.tags[fe.operationRootId]&&(n.tags[fe.operationRootId]=t.tags[fe.operationRootId],i.push(fe.operationRootId)),t.tags[fe.operationSyntheticSource]&&(n.tags[fe.operationSyntheticSource]=t.tags[fe.operationSyntheticSource],i.push(fe.operationSyntheticSource)),t.tags[fe.operationParentId]&&(n.tags[fe.operationParentId]=t.tags[fe.operationParentId],i.push(fe.operationParentId)),t.tags[fe.operationName]&&(n.tags[fe.operationName]=t.tags[fe.operationName],i.push(fe.operationName)),t.tags[fe.operationId]&&(n.tags[fe.operationId]=t.tags[fe.operationId],i.push(fe.operationId)),Object.keys(t.tags).forEach(function(e){i.indexOf(e)<0&&(n.tags[e]=t.tags[e])}))},o}();m.Util=E,m.CorrelationIdHelper=F,m.UrlHelper=R,m.DateTimeUtils=_,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.ProcessLegacy="ProcessLegacy",m.SampleRate="sampleRate",m.HttpMethod="http.method",m.AIData=k,m.AIBase=O,m.Envelope=q,m.Event=P,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ConfigurationManager=ie,m.ContextTagKeys=re,m.DataSanitizer=x,m.TelemetryItemCreator=ge,m.WebExtensionKeys=ae,m.DeviceExtensionKeys=oe,m.CtxTagKeys=fe,m.UnmappedKeys=pe,m.UserExtensionKeys=ce,m.UserTagKeys=ue,m.AppExtensionKeys=se,m.IngestExtKeys=le,m.OSExtKeys=de,Object.defineProperty(m,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-common.min.js.map

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

export { RequestHeaders } from './RequestResponseHeaders';
export { DisabledPropertyName } from './Constants';
export { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod } from './Constants';
export { Data as AIData } from './Interfaces/Contracts/Generated/Data';

@@ -25,3 +25,3 @@ export { Base as AIBase } from './Interfaces/Contracts/Generated/Base';

export { TelemetryItemCreator } from './TelemetryItemCreator';
export { partAExtensions } from './Interfaces/PartAExtensions';
export { WebExtensionKeys, DeviceExtensionKeys, CtxTagKeys, UnmappedKeys, UserExtensionKeys, UserTagKeys, AppExtensionKeys, IngestExtKeys, OSExtKeys } from './Interfaces/PartAExtensions';
//# sourceMappingURL=applicationinsights-common.js.map
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
export var SampleRate = "sampleRate";
export var ProcessLegacy = "ProcessLegacy";
export var HttpMethod = "http.method";
//# sourceMappingURL=Constants.js.map

@@ -1,23 +0,95 @@

import { ContextTagKeys } from '../Interfaces/Contracts/Generated/ContextTagKeys';
var PartAExtensions = /** @class */ (function () {
function PartAExtensions(mapTags) {
this.UserExtensionName = "User";
this.WebExtensionName = "Web";
this.AppExtensionName = "App";
// Approved tags in 4.0
this.accountIdTag = "User.AccountId";
this.userTagsKeysMap = {};
// user.tags mapping
this.userTagsKeysMap[this.accountIdTag] = mapTags.userAccountId;
this.ctxKeys = { id: "id", authId: "authId", localId: "localId" };
// user.ctx mapping
this.userExtKeysMap = {};
this.userExtKeysMap[this.ctxKeys.localId] = mapTags.userId;
this.userExtKeysMap[this.ctxKeys.authId] = mapTags.userAuthUserId;
import { ContextTagKeys } from "./Contracts/Generated/ContextTagKeys";
var WebExtensionKeys = /** @class */ (function () {
function WebExtensionKeys() {
}
return PartAExtensions;
WebExtensionKeys.domain = "domain";
WebExtensionKeys.browser = "web.browser";
WebExtensionKeys.browserVer = "web.browserVer";
WebExtensionKeys.browserLang = "web.browserLang";
WebExtensionKeys.userConsent = "web.userConsent";
WebExtensionKeys.isManual = "web.isManual";
WebExtensionKeys.screenRes = "web.screenRes";
return WebExtensionKeys;
}());
export { PartAExtensions };
var kys = new ContextTagKeys();
export var partAExtensions = new PartAExtensions(kys); // export global instance
export { WebExtensionKeys };
var DeviceExtensionKeys = /** @class */ (function () {
function DeviceExtensionKeys() {
}
DeviceExtensionKeys.localId = "device.localId";
DeviceExtensionKeys.model = "device.model";
DeviceExtensionKeys.deviceType = "device.class";
return DeviceExtensionKeys;
}());
export { DeviceExtensionKeys };
var AppExtensionKeys = /** @class */ (function () {
function AppExtensionKeys() {
}
AppExtensionKeys.sessionId = "app.sesId";
return AppExtensionKeys;
}());
export { AppExtensionKeys };
var UserExtensionKeys = /** @class */ (function () {
function UserExtensionKeys() {
}
UserExtensionKeys.id = "user.id";
UserExtensionKeys.authId = "authId";
UserExtensionKeys.localId = "localId";
return UserExtensionKeys;
}());
export { UserExtensionKeys };
var UserTagKeys = /** @class */ (function () {
function UserTagKeys() {
}
UserTagKeys.accountId = "user.accountId"; // account id is under user tags CS 4.0
return UserTagKeys;
}());
export { UserTagKeys };
var IngestExtKeys = /** @class */ (function () {
function IngestExtKeys() {
}
IngestExtKeys.clientIp = "ingest.clientIp";
return IngestExtKeys;
}());
export { IngestExtKeys };
var OSExtKeys = /** @class */ (function () {
function OSExtKeys() {
}
OSExtKeys.deviceOS = "os.name";
return OSExtKeys;
}());
export { OSExtKeys };
var UnmappedKeys = /** @class */ (function () {
function UnmappedKeys() {
}
UnmappedKeys.sessionIsFirst = "ai.session.isFirst";
UnmappedKeys.sessionIsNew = "ai.session.isNew";
UnmappedKeys.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate";
UnmappedKeys.userStoreRegion = "ai.user.storeRegion";
UnmappedKeys.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate";
UnmappedKeys.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate";
UnmappedKeys.cloudName = "ai.cloud.name";
UnmappedKeys.cloudRole = "ai.cloud.role";
UnmappedKeys.cloudRoleVer = "ai.cloud.roleVer";
UnmappedKeys.cloudRoleInstance = "ai.cloud.roleInstance";
UnmappedKeys.cloudEnvironment = "ai.cloud.environment";
UnmappedKeys.cloudLocation = "ai.cloud.location";
UnmappedKeys.cloudDeploymentUnit = "ai.cloud.deploymentUnit";
UnmappedKeys.internalNodeName = "ai.internal.nodeName";
UnmappedKeys.internalSdkVersion = "ai.internal.sdkVersion";
UnmappedKeys.internalAgentVersion = "ai.internal.agentVersion";
UnmappedKeys.deviceOEMName = "ai.device.oemName";
UnmappedKeys.deviceNetwork = "ai.device.network";
UnmappedKeys.applicationVersion = "ai.application.ver";
UnmappedKeys.applicationBuild = "ai.application.build";
UnmappedKeys.deviceLocale = "ai.device.locale";
UnmappedKeys.deviceOSVersion = "ai.device.osVersion";
UnmappedKeys.locationIp = "ai.location.ip";
UnmappedKeys.operationId = "ai.operation.id"; // not yet closed in CS 4.0
UnmappedKeys.operationParentId = "ai.operation.parentId"; // not yet closed in CS 4.0
UnmappedKeys.operationRootId = "ai.operation.rootId"; // not yet closed in CS 4.0
UnmappedKeys.operationSyntheticSource = "ai.operation.syntheticSource"; // not yet closed in CS 4.0
return UnmappedKeys;
}());
export { UnmappedKeys };
export var CtxTagKeys = new ContextTagKeys();
//# sourceMappingURL=PartAExtensions.js.map

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

measurements: FieldType.Default,
id: FieldType.Default,
id: FieldType.Default
};

@@ -25,0 +25,0 @@ _this.id = DataSanitizer.sanitizeId(logger, id);

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

if (isGoogleBot) {
// Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.
// Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.
return false;

@@ -144,0 +144,0 @@ }

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

*/
function Trace(logger, message, properties, severityLevel) {
function Trace(logger, message, severityLevel, properties) {
var _this = _super.call(this) || this;

@@ -16,0 +16,0 @@ _this.aiDataContract = {

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

import { CoreUtils } from "@microsoft/applicationinsights-core-js";
import { RemoteDependencyData } from './Telemetry/RemoteDependencyData';
import { UnmappedKeys, DeviceExtensionKeys, CtxTagKeys, AppExtensionKeys, IngestExtKeys, WebExtensionKeys, OSExtKeys } from "./Interfaces/PartAExtensions";
var TelemetryItemCreator = /** @class */ (function () {

@@ -34,3 +36,3 @@ function TelemetryItemCreator() {

baseType: baseType,
baseData: item
baseData: item // Part B
};

@@ -47,2 +49,145 @@ // Part C

};
/*
* Converts legacy type to ITelemetryItem
*/
TelemetryItemCreator.convertoFrom = function (env, logger) {
var customProperties = {};
for (var property in env.data) {
if (property !== "baseData" && property !== "baseType") {
customProperties[property] = env.data[property];
}
}
var telemetryItem;
switch (env.data.baseType) {
case RemoteDependencyData.dataType:
var dependencyTelemetry = (env.data.baseType);
telemetryItem = TelemetryItemCreator.create(dependencyTelemetry, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, logger, customProperties);
}
TelemetryItemCreator._extractPartA(env, telemetryItem);
return telemetryItem;
};
/*
* Maps Part A data to CS 4.0
*/
TelemetryItemCreator._extractPartA = function (env, item) {
var keysFound = [];
if (!item || !env.tags) {
return;
}
if (!item.tags) {
item.tags = [];
}
if (!item.ctx) {
item.ctx = {};
}
if (env.tags[CtxTagKeys.applicationVersion]) {
item.tags[UnmappedKeys.applicationVersion] = env.tags[CtxTagKeys.applicationVersion];
keysFound.push(CtxTagKeys.applicationVersion);
}
if (env.tags[CtxTagKeys.applicationBuild]) {
item.tags[UnmappedKeys.applicationBuild] = env.tags[CtxTagKeys.applicationBuild];
keysFound.push(CtxTagKeys.applicationBuild);
}
if (env.tags[CtxTagKeys.sessionId]) {
item.ctx[AppExtensionKeys.sessionId] = env.tags[CtxTagKeys.sessionId];
keysFound.push(CtxTagKeys.sessionId);
}
if (env.tags[CtxTagKeys.sessionIsFirst]) {
item.tags[CtxTagKeys.sessionIsFirst] = env.tags[CtxTagKeys.sessionIsFirst];
keysFound.push(CtxTagKeys.sessionIsFirst);
}
if (env.tags[CtxTagKeys.deviceId]) {
item.ctx[DeviceExtensionKeys.localId] = env.tags[CtxTagKeys.deviceId];
keysFound.push(CtxTagKeys.deviceId);
}
if (env.tags[CtxTagKeys.deviceIp]) {
item.ctx[IngestExtKeys.clientIp] = env.tags[CtxTagKeys.deviceIp];
keysFound.push(CtxTagKeys.deviceIp);
}
if (env.tags[CtxTagKeys.deviceLanguage]) {
item.ctx[WebExtensionKeys.browserLang] = env.tags[CtxTagKeys.deviceLanguage];
keysFound.push(CtxTagKeys.deviceLanguage);
}
if (env.tags[CtxTagKeys.deviceLocale]) {
item.tags[UnmappedKeys.deviceLocale] = env.tags[CtxTagKeys.deviceLocale];
keysFound.push(CtxTagKeys.deviceLocale);
}
if (env.tags[CtxTagKeys.deviceModel]) {
item.ctx[DeviceExtensionKeys.model] = env.tags[CtxTagKeys.deviceModel];
keysFound.push(CtxTagKeys.deviceModel);
}
if (env.tags[CtxTagKeys.deviceNetwork]) {
item.ctx[UnmappedKeys.deviceNetwork] = env.tags[CtxTagKeys.deviceNetwork];
keysFound.push(CtxTagKeys.deviceNetwork);
}
if (env.tags[CtxTagKeys.deviceOEMName]) {
item.ctx[UnmappedKeys.deviceOEMName] = env.tags[CtxTagKeys.deviceOEMName];
keysFound.push(CtxTagKeys.deviceOEMName);
}
if (env.tags[CtxTagKeys.deviceOSVersion]) {
item.tags[UnmappedKeys.deviceOSVersion] = env.tags[CtxTagKeys.deviceOSVersion];
keysFound.push(CtxTagKeys.deviceOSVersion);
}
if (env.tags[CtxTagKeys.deviceOS]) {
item.ctx[OSExtKeys.deviceOS] = env.tags[CtxTagKeys.deviceOS];
keysFound.push(CtxTagKeys.deviceModel);
}
if (env.tags[CtxTagKeys.deviceNetwork]) {
item.ctx[UnmappedKeys.deviceNetwork] = env.tags[CtxTagKeys.deviceNetwork];
keysFound.push(CtxTagKeys.deviceNetwork);
}
if (env.tags[CtxTagKeys.deviceType]) {
item.ctx[DeviceExtensionKeys.deviceType] = env.tags[CtxTagKeys.deviceType];
keysFound.push(CtxTagKeys.deviceType);
}
if (env.tags[CtxTagKeys.deviceOSVersion]) {
item.tags[UnmappedKeys.deviceOSVersion] = env.tags[CtxTagKeys.deviceOSVersion];
keysFound.push(CtxTagKeys.deviceOSVersion);
}
if (env.tags[CtxTagKeys.deviceScreenResolution]) {
item.tags[WebExtensionKeys.screenRes] = env.tags[CtxTagKeys.deviceScreenResolution];
keysFound.push(CtxTagKeys.deviceScreenResolution);
}
if (env.tags.sampleRate) {
item.tags["sampleRate"] = env.tags.sampleRate;
keysFound.push(CtxTagKeys.deviceScreenResolution);
}
if (env.tags[CtxTagKeys.locationIp]) {
item.tags[CtxTagKeys.locationIp] = env.tags[CtxTagKeys.locationIp];
keysFound.push(CtxTagKeys.locationIp);
}
if (env.tags[CtxTagKeys.internalSdkVersion]) {
item.tags[CtxTagKeys.internalSdkVersion] = env.tags[CtxTagKeys.internalSdkVersion];
keysFound.push(CtxTagKeys.internalSdkVersion);
}
if (env.tags[CtxTagKeys.internalAgentVersion]) {
item.tags[CtxTagKeys.internalAgentVersion] = env.tags[CtxTagKeys.internalAgentVersion];
keysFound.push(CtxTagKeys.internalAgentVersion);
}
if (env.tags[CtxTagKeys.operationRootId]) {
item.tags[CtxTagKeys.operationRootId] = env.tags[CtxTagKeys.operationRootId];
keysFound.push(CtxTagKeys.operationRootId);
}
if (env.tags[CtxTagKeys.operationSyntheticSource]) {
item.tags[CtxTagKeys.operationSyntheticSource] = env.tags[CtxTagKeys.operationSyntheticSource];
keysFound.push(CtxTagKeys.operationSyntheticSource);
}
if (env.tags[CtxTagKeys.operationParentId]) {
item.tags[CtxTagKeys.operationParentId] = env.tags[CtxTagKeys.operationParentId];
keysFound.push(CtxTagKeys.operationParentId);
}
if (env.tags[CtxTagKeys.operationName]) {
item.tags[CtxTagKeys.operationName] = env.tags[CtxTagKeys.operationName];
keysFound.push(CtxTagKeys.operationName);
}
if (env.tags[CtxTagKeys.operationId]) {
item.tags[CtxTagKeys.operationId] = env.tags[CtxTagKeys.operationId];
keysFound.push(CtxTagKeys.operationId);
}
Object.keys(env.tags).forEach(function (key) {
if (keysFound.indexOf(key) < 0) {
item.tags[key] = env.tags[key]; // copy over remaining tags
}
});
};
return TelemetryItemCreator;

@@ -49,0 +194,0 @@ }());

/*!
* Application Insights JavaScript SDK - Common, 1.0.0-beta.12
* Application Insights JavaScript SDK - Common, 1.0.0-beta.13
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}(this,function(h){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=h.FieldType||(h.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var m,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=m||(m={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,T=45,f=52,g=56,S=57,I=61,N=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,S,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,I,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,N)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),C=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),F=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),M=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function U(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),O=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:h.FieldType.Required,iKey:h.FieldType.Required,name:h.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?h.FieldType.Hidden:h.FieldType.Required},tags:h.FieldType.Required,data:h.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),q=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(q),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Required,properties:h.FieldType.Default,measurements:h.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:h.FieldType.Required,exceptions:h.FieldType.Required,severityLevel:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(q)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:h.FieldType.Default,outerId:h.FieldType.Default,typeName:h.FieldType.Required,message:h.FieldType.Required,hasFullStack:h.FieldType.Default,stack:h.FieldType.Default,parsedStack:h.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.FieldType.Required,method:h.FieldType.Required,assembly:h.FieldType.Default,fileName:h.FieldType.Default,line:h.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(q);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.FieldType.Required,kind:h.FieldType.Default,value:h.FieldType.Required,count:h.FieldType.Default,min:h.FieldType.Default,max:h.FieldType.Default,stdDev:h.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:h.FieldType.Required,metrics:h.FieldType.Required,properties:h.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Default,url:h.FieldType.Default,duration:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default,id:h.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:h.FieldType.Required,ver:h.FieldType.Required,name:h.FieldType.Default,resultCode:h.FieldType.Default,duration:h.FieldType.Default,success:h.FieldType.Default,data:h.FieldType.Default,target:h.FieldType.Default,type:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default,kind:h.FieldType.Default,value:h.FieldType.Default,count:h.FieldType.Default,min:h.FieldType.Default,max:h.FieldType.Default,stdDev:h.FieldType.Default,dependencyKind:h.FieldType.Default,dependencySource:h.FieldType.Default,commandName:h.FieldType.Default,dependencyTypeName:h.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=F.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(q)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:h.FieldType.Required,message:h.FieldType.Required,severityLevel:h.FieldType.Default,properties:h.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(q)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:h.FieldType.Required,name:h.FieldType.Default,url:h.FieldType.Default,duration:h.FieldType.Default,perfTotal:h.FieldType.Default,networkConnect:h.FieldType.Default,sentRequest:h.FieldType.Default,receivedResponse:h.FieldType.Default,domProcessing:h.FieldType.Default,properties:h.FieldType.Default,measurements:h.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(m.WARNING,T,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:h.FieldType.Required,baseData:h.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=h.SeverityLevel||(h.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!u.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],u.isNullOrUndefined(r)?i:r},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},ae=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}(),oe=new function(e){this.UserExtensionName="User",this.WebExtensionName="Web",this.AppExtensionName="App",this.accountIdTag="User.AccountId",this.userTagsKeysMap={},this.userTagsKeysMap[this.accountIdTag]=e.userAccountId,this.ctxKeys={id:"id",authId:"authId",localId:"localId"},this.userExtKeysMap={},this.userExtKeysMap[this.ctxKeys.localId]=e.userId,this.userExtKeysMap[this.ctxKeys.authId]=e.userAuthUserId}(new re);h.Util=x,h.CorrelationIdHelper=C,h.UrlHelper=_,h.DateTimeUtils=M,h.RequestHeaders=A,h.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",h.AIData=k,h.AIBase=z,h.Envelope=O,h.Event=G,h.Exception=j,h.Metric=Y,h.PageView=$,h.PageViewData=J,h.RemoteDependencyData=Z,h.Trace=ee,h.PageViewPerformance=te,h.Data=ne,h.ConfigurationManager=ie,h.ContextTagKeys=re,h.DataSanitizer=E,h.TelemetryItemCreator=ae,h.partAExtensions=oe,Object.defineProperty(h,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}("undefined"!=typeof self?self:this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,u=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,I=61,N=66,w=68,D=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),x=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,I,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,N)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,D).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),E=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,w,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),R=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=R.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=R.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=x.sanitizeString(e,n?n+" "+i:i);else a=x.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),_=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),M=function(e,t){return(M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function b(e,t){function n(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U,L,O=function(){},k=function(e){function t(){return e.call(this)||this}return b(t,e),t}(O),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=x.sanitizeString(e,n)||E.NotSpecified,i.data=t,i.time=E.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return b(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),V=function(){},z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(V),P=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=x.sanitizeString(e,t)||E.NotSpecified,r.properties=x.sanitizeProperties(e,n),r.measurements=x.sanitizeMeasurements(e,i),r}return b(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(z),G=function(){},H=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=x.sanitizeProperties(e,n),a.measurements=x.sanitizeMeasurements(e,i),a.exceptions=[new B(e,t)],r&&(a.severityLevel=r),a}return b(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return b(e,t),e}(V)),B=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=x.sanitizeString(e,t.name)||E.NotSpecified,n.message=x.sanitizeMessage(e,t.message)||E.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=x.sanitizeException(e,i),n.hasFullStack=E.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return b(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(X.regex.test(o)){var s=new X(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=c,p=u,c++,u--}}return t},e}(H),X=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=E.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=E.trim(i[2])||n.method,n.fileName=E.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return b(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(G),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return b(e,t),e}(V);(L=U||(U={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return b(e,t),e}(function(){this.kind=U.Measurement}),Y=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var c=new Q;return c.count=0<i?i:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(r)||null===r?void 0:r,c.name=x.sanitizeString(e,t)||E.NotSpecified,c.value=n,s.metrics=[c],s.properties=x.sanitizeProperties(e,o),s}return b(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(z),$=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=x.sanitizeId(e,o),s.url=x.sanitizeUrl(e,n),s.name=x.sanitizeString(e,t)||E.NotSpecified,isNaN(i)||(s.duration=E.msToTimeSpan(i)),s.properties=x.sanitizeProperties(e,r),s.measurements=x.sanitizeMeasurements(e,a),s}return b(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,c,u){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=E.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=x.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=x.sanitizeProperties(e,c),l.measurements=x.sanitizeMeasurements(e,u),l}return b(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return b(e,t),e}(V)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||E.NotSpecified,r.message=x.sanitizeMessage(e,t),r.properties=x.sanitizeProperties(e,i),n&&(r.severityLevel=n),r}return b(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return b(e,t),e}(V)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var c=g.getDuration(s.navigationStart,s.loadEventEnd),u=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:d,dom:p}):g.shouldCollectDuration(c,u,l,d,p)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:p}):(o.durationMs=c,o.perfTotal=o.duration=E.msToTimeSpan(c),o.networkConnect=E.msToTimeSpan(u),o.sentRequest=E.msToTimeSpan(l),o.receivedResponse=E.msToTimeSpan(d),o.domProcessing=E.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:p})}return o.url=x.sanitizeUrl(e,n),o.name=x.sanitizeString(e,t)||E.NotSpecified,o.properties=x.sanitizeProperties(e,r),o.measurements=x.sanitizeMeasurements(e,a),o}return b(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return b(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return b(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(r)?i:r},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},ae=function(){function e(){}return e.domain="domain",e.browser="web.browser",e.browserVer="web.browserVer",e.browserLang="web.browserLang",e.userConsent="web.userConsent",e.isManual="web.isManual",e.screenRes="web.screenRes",e}(),oe=function(){function e(){}return e.localId="device.localId",e.model="device.model",e.deviceType="device.class",e}(),se=function(){function e(){}return e.sessionId="app.sesId",e}(),ce=function(){function e(){}return e.id="user.id",e.authId="authId",e.localId="localId",e}(),ue=function(){function e(){}return e.accountId="user.accountId",e}(),le=function(){function e(){}return e.clientIp="ingest.clientIp",e}(),de=function(){function e(){}return e.deviceOS="os.name",e}(),pe=function(){function e(){}return e.sessionIsFirst="ai.session.isFirst",e.sessionIsNew="ai.session.isNew",e.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",e.userStoreRegion="ai.user.storeRegion",e.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",e.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",e.cloudName="ai.cloud.name",e.cloudRole="ai.cloud.role",e.cloudRoleVer="ai.cloud.roleVer",e.cloudRoleInstance="ai.cloud.roleInstance",e.cloudEnvironment="ai.cloud.environment",e.cloudLocation="ai.cloud.location",e.cloudDeploymentUnit="ai.cloud.deploymentUnit",e.internalNodeName="ai.internal.nodeName",e.internalSdkVersion="ai.internal.sdkVersion",e.internalAgentVersion="ai.internal.agentVersion",e.deviceOEMName="ai.device.oemName",e.deviceNetwork="ai.device.network",e.applicationVersion="ai.application.ver",e.applicationBuild="ai.application.build",e.deviceLocale="ai.device.locale",e.deviceOSVersion="ai.device.osVersion",e.locationIp="ai.location.ip",e.operationId="ai.operation.id",e.operationParentId="ai.operation.parentId",e.operationRootId="ai.operation.rootId",e.operationSyntheticSource="ai.operation.syntheticSource",e}(),fe=new re,ge=function(){function o(){}return o.create=function(e,t,n,i,r,a){if(n=x.sanitizeString(i,n)||E.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},o.convertoFrom=function(e,t){var n,i={};for(var r in e.data)"baseData"!==r&&"baseType"!==r&&(i[r]=e.data[r]);switch(e.data.baseType){case Z.dataType:var a=e.data.baseType;n=o.create(a,Z.dataType,Z.envelopeType,t,i)}return o._extractPartA(e,n),n},o._extractPartA=function(t,n){var i=[];n&&t.tags&&(n.tags||(n.tags=[]),n.ctx||(n.ctx={}),t.tags[fe.applicationVersion]&&(n.tags[pe.applicationVersion]=t.tags[fe.applicationVersion],i.push(fe.applicationVersion)),t.tags[fe.applicationBuild]&&(n.tags[pe.applicationBuild]=t.tags[fe.applicationBuild],i.push(fe.applicationBuild)),t.tags[fe.sessionId]&&(n.ctx[se.sessionId]=t.tags[fe.sessionId],i.push(fe.sessionId)),t.tags[fe.sessionIsFirst]&&(n.tags[fe.sessionIsFirst]=t.tags[fe.sessionIsFirst],i.push(fe.sessionIsFirst)),t.tags[fe.deviceId]&&(n.ctx[oe.localId]=t.tags[fe.deviceId],i.push(fe.deviceId)),t.tags[fe.deviceIp]&&(n.ctx[le.clientIp]=t.tags[fe.deviceIp],i.push(fe.deviceIp)),t.tags[fe.deviceLanguage]&&(n.ctx[ae.browserLang]=t.tags[fe.deviceLanguage],i.push(fe.deviceLanguage)),t.tags[fe.deviceLocale]&&(n.tags[pe.deviceLocale]=t.tags[fe.deviceLocale],i.push(fe.deviceLocale)),t.tags[fe.deviceModel]&&(n.ctx[oe.model]=t.tags[fe.deviceModel],i.push(fe.deviceModel)),t.tags[fe.deviceNetwork]&&(n.ctx[pe.deviceNetwork]=t.tags[fe.deviceNetwork],i.push(fe.deviceNetwork)),t.tags[fe.deviceOEMName]&&(n.ctx[pe.deviceOEMName]=t.tags[fe.deviceOEMName],i.push(fe.deviceOEMName)),t.tags[fe.deviceOSVersion]&&(n.tags[pe.deviceOSVersion]=t.tags[fe.deviceOSVersion],i.push(fe.deviceOSVersion)),t.tags[fe.deviceOS]&&(n.ctx[de.deviceOS]=t.tags[fe.deviceOS],i.push(fe.deviceModel)),t.tags[fe.deviceNetwork]&&(n.ctx[pe.deviceNetwork]=t.tags[fe.deviceNetwork],i.push(fe.deviceNetwork)),t.tags[fe.deviceType]&&(n.ctx[oe.deviceType]=t.tags[fe.deviceType],i.push(fe.deviceType)),t.tags[fe.deviceOSVersion]&&(n.tags[pe.deviceOSVersion]=t.tags[fe.deviceOSVersion],i.push(fe.deviceOSVersion)),t.tags[fe.deviceScreenResolution]&&(n.tags[ae.screenRes]=t.tags[fe.deviceScreenResolution],i.push(fe.deviceScreenResolution)),t.tags.sampleRate&&(n.tags.sampleRate=t.tags.sampleRate,i.push(fe.deviceScreenResolution)),t.tags[fe.locationIp]&&(n.tags[fe.locationIp]=t.tags[fe.locationIp],i.push(fe.locationIp)),t.tags[fe.internalSdkVersion]&&(n.tags[fe.internalSdkVersion]=t.tags[fe.internalSdkVersion],i.push(fe.internalSdkVersion)),t.tags[fe.internalAgentVersion]&&(n.tags[fe.internalAgentVersion]=t.tags[fe.internalAgentVersion],i.push(fe.internalAgentVersion)),t.tags[fe.operationRootId]&&(n.tags[fe.operationRootId]=t.tags[fe.operationRootId],i.push(fe.operationRootId)),t.tags[fe.operationSyntheticSource]&&(n.tags[fe.operationSyntheticSource]=t.tags[fe.operationSyntheticSource],i.push(fe.operationSyntheticSource)),t.tags[fe.operationParentId]&&(n.tags[fe.operationParentId]=t.tags[fe.operationParentId],i.push(fe.operationParentId)),t.tags[fe.operationName]&&(n.tags[fe.operationName]=t.tags[fe.operationName],i.push(fe.operationName)),t.tags[fe.operationId]&&(n.tags[fe.operationId]=t.tags[fe.operationId],i.push(fe.operationId)),Object.keys(t.tags).forEach(function(e){i.indexOf(e)<0&&(n.tags[e]=t.tags[e])}))},o}();m.Util=E,m.CorrelationIdHelper=F,m.UrlHelper=R,m.DateTimeUtils=_,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.ProcessLegacy="ProcessLegacy",m.SampleRate="sampleRate",m.HttpMethod="http.method",m.AIData=k,m.AIBase=O,m.Envelope=q,m.Event=P,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ConfigurationManager=ie,m.ContextTagKeys=re,m.DataSanitizer=x,m.TelemetryItemCreator=ge,m.WebExtensionKeys=ae,m.DeviceExtensionKeys=oe,m.CtxTagKeys=fe,m.UnmappedKeys=pe,m.UserExtensionKeys=ce,m.UserTagKeys=ue,m.AppExtensionKeys=se,m.IngestExtKeys=le,m.OSExtKeys=de,Object.defineProperty(m,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-common.min.js.map
{
"name": "@microsoft/applicationinsights-common",
"version": "1.0.0-beta.12",
"version": "1.0.0-beta.13",
"description": "Microsoft Application Insights Common JavaScript Library",

@@ -5,0 +5,0 @@ "main": "./dist/applicationinsights-common.js",

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

export { RequestHeaders } from './RequestResponseHeaders';
export { DisabledPropertyName } from './Constants';
export { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod } from './Constants';
export { Data as AIData } from './Interfaces/Contracts/Generated/Data';

@@ -38,2 +38,4 @@ export { Base as AIBase } from './Interfaces/Contracts/Generated/Base';

export { IAppInsights } from './Interfaces/IAppInsights';
export { partAExtensions, UserExt } from './Interfaces/PartAExtensions';
export { WebExtensionKeys, DeviceExtensionKeys, CtxTagKeys, UnmappedKeys,
UserExtensionKeys, UserTagKeys, AppExtensionKeys,
IngestExtKeys, OSExtKeys } from './Interfaces/PartAExtensions';
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export const DisabledPropertyName: string = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
export const DisabledPropertyName: string = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
export const SampleRate = "sampleRate";
export const ProcessLegacy = "ProcessLegacy";
export const HttpMethod = "http.method";

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

this.operationCorrelationVector = "ai.operation.correlationVector";
this.sessionId = "ai.session.id";

@@ -240,0 +240,0 @@ this.sessionIsFirst = "ai.session.isFirst";

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

* @memberof IConfig
* @default 30*1000
* @default 30*60*1000
*/

@@ -33,0 +33,0 @@ sessionRenewalMs?: number;

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

export interface IDependencyTelemetry {
id: string;
absoluteUrl: string;
commandName?: string;
name?: string;
duration?: number;
success?: boolean;
resultCode: number;
method: string;
id: string;
responseCode: number;
correlationContext?: string;
type?: string;
data?: string;
target?: string;
properties?: {[key: string]: string};
measurements?: {[key: string]: string};
}

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

severityLevel?: SeverityLevel | number;
/**
* Collection of custom properties
* @type {{ [key: string]: string}}
* @memberof IExceptionTelemetry
*/
properties?: { [key: string]: string};
/**
* Collection of custom measurements
* @type {{ [key: string]: number}}
* @memberof IExceptionTelemetry
*/
measurements?: { [key: string]: number};
}
/**

@@ -31,0 +44,0 @@ * @description window.onerror function parameters

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

export interface IPageViewPerformanceTelemetry {
name: string;
url: string;
/**
* name String - The name of the page. Defaults to the document title.
*/
name?: string;
/**
* url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
*/
url?: string;
/**
* Property bag to contain additional custom properties (Part C)
*/
properties?: { [key: string]: string };
/**
* Property bag to contain additional custom measurements (Part C)
*/
measurements?: { [key: string]: number };
}

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

export interface IPageViewTelemetry {
/*
/**
* name String - The string you used as the name in startTrackPage. Defaults to the document title.

@@ -14,3 +14,3 @@ */

/*
/**
* uri String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.

@@ -20,3 +20,3 @@ */

/*
/**
* refUri String - the URL of the source page where current page is loaded from

@@ -26,3 +26,3 @@ */

/*
/**
* pageType String - page type

@@ -32,3 +32,3 @@ */

/*
/**
* isLoggedIn - boolean is user logged in

@@ -38,6 +38,11 @@ */

/*
/**
* property bag to contain an extension to domain properties - extension to Part B
*/
properties?: { [key: string]: any };
properties?: { [key: string]: string };
/**
* Property bag to contain additional custom measurements (Part C)
*/
measurements?: { [key: string]: number };
}

@@ -47,10 +52,13 @@

export interface IPageViewTelemetryInternal extends IPageViewTelemetry {
/* An identifier assigned to each pageview
/**
* An identifier assigned to each distinct impression for the purposes of correlating with pageview.
* A new id is automatically generated on each pageview. You can manually specify this field if you
* want to use a specific value instead.
*/
id?: string;
/* Version of the part B schema, todo: set this value in trackpageView
/**
* Version of the part B schema, todo: set this value in trackpageView
*/
ver?: string;
}
}

@@ -1,56 +0,73 @@

import { ContextTagKeys } from '../Interfaces/Contracts/Generated/ContextTagKeys';
import { ContextTagKeys } from "./Contracts/Generated/ContextTagKeys";
export interface UserExt {
id?: string;
localId?: string;
authId?: string;
export class WebExtensionKeys {
public static domain = "domain";
public static browser = "web.browser";
public static browserVer = "web.browserVer";
public static browserLang = "web.browserLang";
public static userConsent = "web.userConsent";
public static isManual = "web.isManual";
public static screenRes = "web.screenRes";
}
export class PartAExtensions {
public UserExtensionName:string = "User";
public WebExtensionName = "Web";
public AppExtensionName = "App";
export class DeviceExtensionKeys {
public static localId = "device.localId";
public static model = "device.model";
public static deviceType = "device.class";
}
// Tag map for 2.1
public userTagsKeysMap: { [key: string]: any };
public userExtKeysMap: { [key: string]: any };
export class AppExtensionKeys {
public static sessionId = "app.sesId";
}
// Approved tags in 4.0
public accountIdTag = "User.AccountId";
export class UserExtensionKeys {
public static id = "user.id";
public static authId = "authId";
public static localId = "localId";
}
public ctxKeys: {
// Approved user ctx
id: string;
authId: string;
localId: string;
}
export class UserTagKeys {
public static accountId = "user.accountId"; // account id is under user tags CS 4.0
}
constructor(mapTags: ContextTagKeys) {
this.userTagsKeysMap = {};
// user.tags mapping
this.userTagsKeysMap[this.accountIdTag] = mapTags.userAccountId;
this.ctxKeys = { id: "id", authId: "authId", localId: "localId" };
// user.ctx mapping
this.userExtKeysMap = {};
this.userExtKeysMap[this.ctxKeys.localId] = mapTags.userId;
this.userExtKeysMap[this.ctxKeys.authId] = mapTags.userAuthUserId;
}
export class IngestExtKeys {
public static clientIp = "ingest.clientIp";
}
export interface WebExt {
domain?: string;
browser?: string;
browserVer?: string;
browserLang?: string;
userConsent?: string;
isManual?: string;
screenRes?: string;
export class OSExtKeys {
public static deviceOS = "os.name";
}
export interface AppExt {
sesId?: string;
export class UnmappedKeys {
public static sessionIsFirst = "ai.session.isFirst";
public static sessionIsNew = "ai.session.isNew";
public static userAccountAcquisitionDate = "ai.user.accountAcquisitionDate";
public static userStoreRegion = "ai.user.storeRegion";
public static userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate";
public static userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate";
public static cloudName = "ai.cloud.name";
public static cloudRole = "ai.cloud.role";
public static cloudRoleVer = "ai.cloud.roleVer";
public static cloudRoleInstance = "ai.cloud.roleInstance";
public static cloudEnvironment = "ai.cloud.environment";
public static cloudLocation = "ai.cloud.location";
public static cloudDeploymentUnit = "ai.cloud.deploymentUnit";
public static internalNodeName = "ai.internal.nodeName";
public static internalSdkVersion = "ai.internal.sdkVersion";
public static internalAgentVersion = "ai.internal.agentVersion";
public static deviceOEMName = "ai.device.oemName";
public static deviceNetwork = "ai.device.network";
public static applicationVersion = "ai.application.ver";
public static applicationBuild = "ai.application.build";
public static deviceLocale = "ai.device.locale";
public static deviceOSVersion = "ai.device.osVersion";
public static locationIp = "ai.location.ip";
public static operationId = "ai.operation.id"; // not yet closed in CS 4.0
public static operationParentId = "ai.operation.parentId"; // not yet closed in CS 4.0
public static operationName: "ai.operation.name"; // not yet closed in CS 4.0
public static operationRootId = "ai.operation.rootId"; // not yet closed in CS 4.0
public static operationSyntheticSource = "ai.operation.syntheticSource"; // not yet closed in CS 4.0
}
var kys = new ContextTagKeys();
export var partAExtensions = new PartAExtensions(kys); // export global instance
export var CtxTagKeys = new ContextTagKeys();

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

}
}
}

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

*/
constructor(logger: IDiagnosticLogger, exception: Error, properties?: any, measurements?: any, severityLevel?: SeverityLevel) {
constructor(logger: IDiagnosticLogger, exception: Error, properties?: {[key: string]: string}, measurements?: {[key: string]: number}, severityLevel?: SeverityLevel) {
super();

@@ -179,2 +179,2 @@

}
}
}

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

}
}
}

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

measurements: FieldType.Default,
id: FieldType.Default,
id: FieldType.Default
}

@@ -30,3 +30,3 @@

*/
constructor(logger: IDiagnosticLogger, name?: string, url?: string, durationMs?: number, properties?: any, measurements?: any, id?: string) {
constructor(logger: IDiagnosticLogger, name?: string, url?: string, durationMs?: number, properties?: {[key: string]: string}, measurements?: {[key: string]: number}, id?: string) {
super();

@@ -43,2 +43,2 @@

}
}
}

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

*/
constructor(logger: IDiagnosticLogger, name: string, url: string, unused: number, properties?: any, measurements?: any) {
constructor(logger: IDiagnosticLogger, name: string, url: string, unused: number, properties?: {[key: string]: string}, measurements?: {[key: string]: number}) {
super();

@@ -184,3 +184,3 @@

if (isGoogleBot) {
// Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.
// Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.
return false;

@@ -198,2 +198,2 @@ } else {

}
}
}

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

}
}
}

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

*/
constructor(logger: IDiagnosticLogger, message: string, properties?: any, severityLevel?: SeverityLevel) {
constructor(logger: IDiagnosticLogger, message: string, severityLevel?: SeverityLevel, properties?: any) {
super();

@@ -38,2 +38,2 @@ message = message || Util.NotSpecified;

}
}
}

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

import { ITelemetryItem, CoreUtils, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
import { IEnvelope } from './Interfaces/Telemetry/IEnvelope';
import { RemoteDependencyData } from './Telemetry/RemoteDependencyData';
import { IDependencyTelemetry } from './applicationinsights-common';
import { UnmappedKeys, DeviceExtensionKeys, CtxTagKeys, AppExtensionKeys, IngestExtKeys, WebExtensionKeys, OSExtKeys } from "./Interfaces/PartAExtensions";
export class TelemetryItemCreator {

@@ -22,2 +25,3 @@

*/
public static create<T>(item: T,

@@ -29,2 +33,3 @@ baseType: string,

systemProperties?: { [key: string]: any }): ITelemetryItem {
envelopeName = DataSanitizer.sanitizeString(logger, envelopeName) || Util.NotSpecified;

@@ -37,3 +42,3 @@

}
let telemetryItem: ITelemetryItem = {

@@ -43,3 +48,3 @@ name: envelopeName,

instrumentationKey: "", // this will be set in TelemetryContext
ctx: systemProperties ? systemProperties : {},
ctx: systemProperties ? systemProperties : {}, // part A
tags: [],

@@ -49,3 +54,3 @@ data: {

baseType: baseType,
baseData: item
baseData: item // Part B
};

@@ -64,2 +69,191 @@

}
/*
* Converts legacy type to ITelemetryItem
*/
public static convertoFrom(env: IEnvelope, logger: IDiagnosticLogger) : ITelemetryItem {
let customProperties = {};
for (var property in env.data) { // part B
if (property !== "baseData" && property !== "baseType") {
customProperties[property] = env.data[property];
}
}
let telemetryItem;
switch(env.data.baseType) {
case RemoteDependencyData.dataType:
let dependencyTelemetry = <IDependencyTelemetry>(env.data.baseType);
telemetryItem = TelemetryItemCreator.create<IDependencyTelemetry>(
dependencyTelemetry,
RemoteDependencyData.dataType,
RemoteDependencyData.envelopeType,
logger,
customProperties);
}
TelemetryItemCreator._extractPartA(env, telemetryItem);
return telemetryItem;
}
/*
* Maps Part A data to CS 4.0
*/
private static _extractPartA(env: IEnvelope, item: ITelemetryItem) {
let keysFound = [];
if (!item || !env.tags) {
return;
}
if (!item.tags) {
item.tags = [];
}
if (!item.ctx) {
item.ctx = {};
}
if (env.tags[CtxTagKeys.applicationVersion]) {
item.tags[UnmappedKeys.applicationVersion] = env.tags[CtxTagKeys.applicationVersion];
keysFound.push(CtxTagKeys.applicationVersion);
}
if (env.tags[CtxTagKeys.applicationBuild]) {
item.tags[UnmappedKeys.applicationBuild] = env.tags[CtxTagKeys.applicationBuild];
keysFound.push(CtxTagKeys.applicationBuild);
}
if (env.tags[CtxTagKeys.sessionId]) {
item.ctx[AppExtensionKeys.sessionId] = env.tags[CtxTagKeys.sessionId];
keysFound.push(CtxTagKeys.sessionId);
}
if (env.tags[CtxTagKeys.sessionIsFirst]) {
item.tags[CtxTagKeys.sessionIsFirst] = env.tags[CtxTagKeys.sessionIsFirst];
keysFound.push(CtxTagKeys.sessionIsFirst);
}
if (env.tags[CtxTagKeys.deviceId]) {
item.ctx[DeviceExtensionKeys.localId] = env.tags[CtxTagKeys.deviceId];
keysFound.push(CtxTagKeys.deviceId);
}
if (env.tags[CtxTagKeys.deviceIp]) {
item.ctx[IngestExtKeys.clientIp] = env.tags[CtxTagKeys.deviceIp];
keysFound.push(CtxTagKeys.deviceIp);
}
if (env.tags[CtxTagKeys.deviceLanguage]) {
item.ctx[WebExtensionKeys.browserLang] = env.tags[CtxTagKeys.deviceLanguage];
keysFound.push(CtxTagKeys.deviceLanguage);
}
if (env.tags[CtxTagKeys.deviceLocale]) {
item.tags[UnmappedKeys.deviceLocale] = env.tags[CtxTagKeys.deviceLocale];
keysFound.push(CtxTagKeys.deviceLocale);
}
if (env.tags[CtxTagKeys.deviceModel]) {
item.ctx[DeviceExtensionKeys.model] = env.tags[CtxTagKeys.deviceModel];
keysFound.push(CtxTagKeys.deviceModel);
}
if (env.tags[CtxTagKeys.deviceNetwork]) {
item.ctx[UnmappedKeys.deviceNetwork] = env.tags[CtxTagKeys.deviceNetwork];
keysFound.push(CtxTagKeys.deviceNetwork);
}
if (env.tags[CtxTagKeys.deviceOEMName]) {
item.ctx[UnmappedKeys.deviceOEMName] = env.tags[CtxTagKeys.deviceOEMName];
keysFound.push(CtxTagKeys.deviceOEMName);
}
if (env.tags[CtxTagKeys.deviceOSVersion]) {
item.tags[UnmappedKeys.deviceOSVersion] = env.tags[CtxTagKeys.deviceOSVersion];
keysFound.push(CtxTagKeys.deviceOSVersion);
}
if (env.tags[CtxTagKeys.deviceOS]) {
item.ctx[OSExtKeys.deviceOS] = env.tags[CtxTagKeys.deviceOS];
keysFound.push(CtxTagKeys.deviceModel);
}
if (env.tags[CtxTagKeys.deviceNetwork]) {
item.ctx[UnmappedKeys.deviceNetwork] = env.tags[CtxTagKeys.deviceNetwork];
keysFound.push(CtxTagKeys.deviceNetwork);
}
if (env.tags[CtxTagKeys.deviceType]) {
item.ctx[DeviceExtensionKeys.deviceType] = env.tags[CtxTagKeys.deviceType];
keysFound.push(CtxTagKeys.deviceType);
}
if (env.tags[CtxTagKeys.deviceOSVersion]) {
item.tags[UnmappedKeys.deviceOSVersion] = env.tags[CtxTagKeys.deviceOSVersion];
keysFound.push(CtxTagKeys.deviceOSVersion);
}
if (env.tags[CtxTagKeys.deviceScreenResolution]) {
item.tags[WebExtensionKeys.screenRes] = env.tags[CtxTagKeys.deviceScreenResolution];
keysFound.push(CtxTagKeys.deviceScreenResolution);
}
if (env.tags.sampleRate) {
item.tags["sampleRate"] = env.tags.sampleRate;
keysFound.push(CtxTagKeys.deviceScreenResolution);
}
if (env.tags[CtxTagKeys.locationIp]) {
item.tags[CtxTagKeys.locationIp] = env.tags[CtxTagKeys.locationIp];
keysFound.push(CtxTagKeys.locationIp);
}
if (env.tags[CtxTagKeys.internalSdkVersion]) {
item.tags[CtxTagKeys.internalSdkVersion] = env.tags[CtxTagKeys.internalSdkVersion];
keysFound.push(CtxTagKeys.internalSdkVersion);
}
if (env.tags[CtxTagKeys.internalAgentVersion]) {
item.tags[CtxTagKeys.internalAgentVersion] = env.tags[CtxTagKeys.internalAgentVersion];
keysFound.push(CtxTagKeys.internalAgentVersion);
}
if (env.tags[CtxTagKeys.operationRootId]) {
item.tags[CtxTagKeys.operationRootId] = env.tags[CtxTagKeys.operationRootId];
keysFound.push(CtxTagKeys.operationRootId);
}
if (env.tags[CtxTagKeys.operationSyntheticSource]) {
item.tags[CtxTagKeys.operationSyntheticSource] = env.tags[CtxTagKeys.operationSyntheticSource];
keysFound.push(CtxTagKeys.operationSyntheticSource);
}
if (env.tags[CtxTagKeys.operationParentId]) {
item.tags[CtxTagKeys.operationParentId] = env.tags[CtxTagKeys.operationParentId];
keysFound.push(CtxTagKeys.operationParentId);
}
if (env.tags[CtxTagKeys.operationName]) {
item.tags[CtxTagKeys.operationName] = env.tags[CtxTagKeys.operationName];
keysFound.push(CtxTagKeys.operationName);
}
if (env.tags[CtxTagKeys.operationId]) {
item.tags[CtxTagKeys.operationId] = env.tags[CtxTagKeys.operationId];
keysFound.push(CtxTagKeys.operationId);
}
Object.keys(env.tags).forEach(key => {
if (keysFound.indexOf(key) < 0) {
item.tags[key] = env.tags[key]; // copy over remaining tags
}
})
}
}
export { Util, CorrelationIdHelper, UrlHelper, DateTimeUtils } from './Util';
export { FieldType } from './Enums';
export { RequestHeaders } from './RequestResponseHeaders';
export { DisabledPropertyName } from './Constants';
export { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod } from './Constants';
export { Data as AIData } from './Interfaces/Contracts/Generated/Data';

@@ -34,2 +34,2 @@ export { Base as AIBase } from './Interfaces/Contracts/Generated/Base';

export { IAppInsights } from './Interfaces/IAppInsights';
export { partAExtensions, UserExt } from './Interfaces/PartAExtensions';
export { WebExtensionKeys, DeviceExtensionKeys, CtxTagKeys, UnmappedKeys, UserExtensionKeys, UserTagKeys, AppExtensionKeys, IngestExtKeys, OSExtKeys } from './Interfaces/PartAExtensions';
export declare const DisabledPropertyName: string;
export declare const SampleRate = "sampleRate";
export declare const ProcessLegacy = "ProcessLegacy";
export declare const HttpMethod = "http.method";

@@ -24,3 +24,3 @@ import { IConfiguration } from '@microsoft/applicationinsights-core-js';

* @memberof IConfig
* @default 30*1000
* @default 30*60*1000
*/

@@ -27,0 +27,0 @@ sessionRenewalMs?: number;

@@ -5,10 +5,18 @@ /**

export interface IDependencyTelemetry {
id: string;
absoluteUrl: string;
commandName?: string;
name?: string;
duration?: number;
success?: boolean;
resultCode: number;
method: string;
id: string;
responseCode: number;
correlationContext?: string;
type?: string;
data?: string;
target?: string;
properties?: {
[key: string]: string;
};
measurements?: {
[key: string]: string;
};
}

@@ -21,2 +21,18 @@ import { SeverityLevel } from './Contracts/Generated/SeverityLevel';

severityLevel?: SeverityLevel | number;
/**
* Collection of custom properties
* @type {{ [key: string]: string}}
* @memberof IExceptionTelemetry
*/
properties?: {
[key: string]: string;
};
/**
* Collection of custom measurements
* @type {{ [key: string]: number}}
* @memberof IExceptionTelemetry
*/
measurements?: {
[key: string]: number;
};
}

@@ -23,0 +39,0 @@ /**

export interface IPageViewPerformanceTelemetry {
name: string;
url: string;
/**
* name String - The name of the page. Defaults to the document title.
*/
name?: string;
/**
* url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
*/
url?: string;
/**
* Property bag to contain additional custom properties (Part C)
*/
properties?: {
[key: string]: string;
};
/**
* Property bag to contain additional custom measurements (Part C)
*/
measurements?: {
[key: string]: number;
};
}

@@ -5,14 +5,46 @@ /**

export interface IPageViewTelemetry {
/**
* name String - The string you used as the name in startTrackPage. Defaults to the document title.
*/
name?: string;
/**
* uri String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
*/
uri?: string;
/**
* refUri String - the URL of the source page where current page is loaded from
*/
refUri?: string;
/**
* pageType String - page type
*/
pageType?: string;
/**
* isLoggedIn - boolean is user logged in
*/
isLoggedIn?: boolean;
/**
* property bag to contain an extension to domain properties - extension to Part B
*/
properties?: {
[key: string]: any;
[key: string]: string;
};
/**
* Property bag to contain additional custom measurements (Part C)
*/
measurements?: {
[key: string]: number;
};
}
export interface IPageViewTelemetryInternal extends IPageViewTelemetry {
/**
* An identifier assigned to each distinct impression for the purposes of correlating with pageview.
* A new id is automatically generated on each pageview. You can manually specify this field if you
* want to use a specific value instead.
*/
id?: string;
/**
* Version of the part B schema, todo: set this value in trackpageView
*/
ver?: string;
}

@@ -1,37 +0,63 @@

import { ContextTagKeys } from '../Interfaces/Contracts/Generated/ContextTagKeys';
export interface UserExt {
id?: string;
localId?: string;
authId?: string;
import { ContextTagKeys } from "./Contracts/Generated/ContextTagKeys";
export declare class WebExtensionKeys {
static domain: string;
static browser: string;
static browserVer: string;
static browserLang: string;
static userConsent: string;
static isManual: string;
static screenRes: string;
}
export declare class PartAExtensions {
UserExtensionName: string;
WebExtensionName: string;
AppExtensionName: string;
userTagsKeysMap: {
[key: string]: any;
};
userExtKeysMap: {
[key: string]: any;
};
accountIdTag: string;
ctxKeys: {
id: string;
authId: string;
localId: string;
};
constructor(mapTags: ContextTagKeys);
export declare class DeviceExtensionKeys {
static localId: string;
static model: string;
static deviceType: string;
}
export interface WebExt {
domain?: string;
browser?: string;
browserVer?: string;
browserLang?: string;
userConsent?: string;
isManual?: string;
screenRes?: string;
export declare class AppExtensionKeys {
static sessionId: string;
}
export interface AppExt {
sesId?: string;
export declare class UserExtensionKeys {
static id: string;
static authId: string;
static localId: string;
}
export declare var partAExtensions: PartAExtensions;
export declare class UserTagKeys {
static accountId: string;
}
export declare class IngestExtKeys {
static clientIp: string;
}
export declare class OSExtKeys {
static deviceOS: string;
}
export declare class UnmappedKeys {
static sessionIsFirst: string;
static sessionIsNew: string;
static userAccountAcquisitionDate: string;
static userStoreRegion: string;
static userAnonymousUserAcquisitionDate: string;
static userAuthenticatedUserAcquisitionDate: string;
static cloudName: string;
static cloudRole: string;
static cloudRoleVer: string;
static cloudRoleInstance: string;
static cloudEnvironment: string;
static cloudLocation: string;
static cloudDeploymentUnit: string;
static internalNodeName: string;
static internalSdkVersion: string;
static internalAgentVersion: string;
static deviceOEMName: string;
static deviceNetwork: string;
static applicationVersion: string;
static applicationBuild: string;
static deviceLocale: string;
static deviceOSVersion: string;
static locationIp: string;
static operationId: string;
static operationParentId: string;
static operationName: "ai.operation.name";
static operationRootId: string;
static operationSyntheticSource: string;
}
export declare var CtxTagKeys: ContextTagKeys;

@@ -20,3 +20,7 @@ import { StackFrame } from '../Interfaces/Contracts/Generated/StackFrame';

*/
constructor(logger: IDiagnosticLogger, exception: Error, properties?: any, measurements?: any, severityLevel?: SeverityLevel);
constructor(logger: IDiagnosticLogger, exception: Error, properties?: {
[key: string]: string;
}, measurements?: {
[key: string]: number;
}, severityLevel?: SeverityLevel);
/**

@@ -23,0 +27,0 @@ * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.

@@ -20,3 +20,7 @@ import { PageViewData } from '../Interfaces/Contracts/Generated/PageViewData';

*/
constructor(logger: IDiagnosticLogger, name?: string, url?: string, durationMs?: number, properties?: any, measurements?: any, id?: string);
constructor(logger: IDiagnosticLogger, name?: string, url?: string, durationMs?: number, properties?: {
[key: string]: string;
}, measurements?: {
[key: string]: number;
}, id?: string);
}

@@ -38,3 +38,7 @@ import { PageViewPerfData } from '../Interfaces/Contracts/Generated/PageViewPerfData';

*/
constructor(logger: IDiagnosticLogger, name: string, url: string, unused: number, properties?: any, measurements?: any);
constructor(logger: IDiagnosticLogger, name: string, url: string, unused: number, properties?: {
[key: string]: string;
}, measurements?: {
[key: string]: number;
});
static getPerformanceTiming(): PerformanceTiming;

@@ -41,0 +45,0 @@ /**

@@ -18,3 +18,3 @@ import { MessageData } from '../Interfaces/Contracts/Generated/MessageData';

*/
constructor(logger: IDiagnosticLogger, message: string, properties?: any, severityLevel?: SeverityLevel);
constructor(logger: IDiagnosticLogger, message: string, severityLevel?: SeverityLevel, properties?: any);
}
import { ITelemetryItem, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
import { IEnvelope } from './Interfaces/Telemetry/IEnvelope';
export declare class TelemetryItemCreator {

@@ -17,2 +18,4 @@ /**

}): ITelemetryItem;
static convertoFrom(env: IEnvelope, logger: IDiagnosticLogger): ITelemetryItem;
private static _extractPartA(env, item);
}

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 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 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