function initializeAppInsights(){var i,r;try{if(typeof window!="undefined"&&typeof JSON!="undefined")if(i="appInsights",window[i]===undefined)Microsoft.ApplicationInsights.AppInsights.defaultConfig=Microsoft.ApplicationInsights.Initialization.getDefaultConfig();else{var u=window[i]||{},n=new Microsoft.ApplicationInsights.Initialization(u),t=n.loadAppInsights();for(r in t)u[r]=t[r];n.emptyQueue();n.pollInteralLogs(t);n.addHousekeepingBeforeUnload(t)}}catch(f){Microsoft.ApplicationInsights._InternalLogging.warnToConsole("Failed to initialize AppInsights JS SDK: "+f.message)}}var __extends,AI,Microsoft;(function(n){var t;(function(n){(function(n){n[n.CRITICAL=0]="CRITICAL";n[n.WARNING=1]="WARNING"})(n.LoggingSeverity||(n.LoggingSeverity={}));var i=n.LoggingSeverity,t=function(){function n(){}return n.throwInternalNonUserActionable=function(n,t){if(this.enableDebugExceptions())throw t;else this.warnToConsole(t),this.logInternalMessage(n,this.AiNonUserActionablePrefix+t)},n.throwInternalUserActionable=function(n,t){if(this.enableDebugExceptions())throw t;else this.warnToConsole(t),this.logInternalMessage(n,this.AiUserActionablePrefix+t)},n.warnToConsole=function(n){typeof console=="undefined"||!console||(typeof console.warn=="function"?console.warn(n):typeof console.log=="function"&&console.log(n))},n.resetInternalMessageCount=function(){this._messageCount=0},n.setMaxInternalMessageLimit=function(n){if(!n)throw new Error("limit cannot be undefined.");this.MAX_INTERNAL_MESSAGE_LIMIT=n},n.logInternalMessage=function(n,t){if(!this._areInternalMessagesThrottled()&&((this.verboseLogging()||n===0)&&(this.queue.push(t),this._messageCount++),this._messageCount==this.MAX_INTERNAL_MESSAGE_LIMIT)){var i=this.AiNonUserActionablePrefix+"Internal events throttle limit per PageView reached for this app.";this.queue.push(i);this.warnToConsole(i)}},n._areInternalMessagesThrottled=function(){return this._messageCount>=this.MAX_INTERNAL_MESSAGE_LIMIT},n.AiUserActionablePrefix="AI: ",n.AiNonUserActionablePrefix="AI (Internal): ",n.enableDebugExceptions=function(){return!1},n.verboseLogging=function(){return!1},n.queue=[],n.MAX_INTERNAL_MESSAGE_LIMIT=25,n._messageCount=0,n}();n._InternalLogging=t})(t=n.ApplicationInsights||(n.ApplicationInsights={}))})(Microsoft||(Microsoft={})),function(n){var t;(function(n){var t=function(){function t(){}return t._getStorageObject=function(){try{return window.localStorage?window.localStorage:null}catch(t){return n._InternalLogging.warnToConsole("Failed to get client localStorage: "+t.message),null}},t.canUseLocalStorage=function(){return!!t._getStorageObject()},t.getStorage=function(i){var r=t._getStorageObject();if(r!==null)try{return r.getItem(i)}catch(u){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed read of local storage."+t.dump(u))}return null},t.setStorage=function(i,r){var u=t._getStorageObject();if(u!==null)try{return u.setItem(i,r),!0}catch(f){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed write to local storage."+t.dump(f))}return!1},t.removeStorage=function(i){var r=t._getStorageObject();if(r!==null)try{return r.removeItem(i),!0}catch(u){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed removal of local storage item."+t.dump(u))}return!1},t._getSessionStorageObject=function(){try{return window.sessionStorage?window.sessionStorage:null}catch(t){return n._InternalLogging.warnToConsole("Failed to get client session storage: "+t.message),null}},t.canUseSessionStorage=function(){return!!t._getSessionStorageObject()},t.getSessionStorage=function(i){var r=t._getSessionStorageObject();if(r!==null)try{return r.getItem(i)}catch(u){n._InternalLogging.throwInternalNonUserActionable(0,"Browser failed read of session storage."+t.dump(u))}return null},t.setSessionStorage=function(i,r){var u=t._getSessionStorageObject();if(u!==null)try{return u.setItem(i,r),!0}catch(f){n._InternalLogging.throwInternalNonUserActionable(0,"Browser failed write to session storage."+t.dump(f))}return!1},t.removeSessionStorage=function(i){var r=t._getSessionStorageObject();if(r!==null)try{return r.removeItem(i),!0}catch(u){n._InternalLogging.throwInternalNonUserActionable(0,"Browser failed removal of session storage item."+t.dump(u))}return!1},t.setCookie=function(n,i){t.document.cookie=n+"="+i+";path=/"},t.stringToBoolOrDefault=function(n){return n?n.toString().toLowerCase()==="true":!1},t.getCookie=function(n){var e="",f,u,r,i;if(n&&n.length)for(f=n+"=",u=t.document.cookie.split(";"),r=0;r>4&15]+n[t>>8&15]+n[t>>12&15]+n[t>>16&15]+n[t>>20&15]+n[t>>24&15]+n[t>>28&15];return u=n[8+Math.random()*4|0],i.substr(0,8)+"-"+i.substr(9,4)+"-4"+i.substr(13,3)+"-"+u+i.substr(16,3)+"-"+i.substr(19,12)},t.isArray=function(n){return Object.prototype.toString.call(n)==="[object Array]"},t.isError=function(n){return Object.prototype.toString.call(n)==="[object Error]"},t.isDate=function(n){return Object.prototype.toString.call(n)==="[object Date]"},t.toISOStringForIE8=function(n){if(t.isDate(n)){function i(n){var t=String(n);return t.length===1&&(t="0"+t),t}return Date.prototype.toISOString?n.toISOString():n.getUTCFullYear()+"-"+i(n.getUTCMonth()+1)+"-"+i(n.getUTCDate())+"T"+i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+"."+String((n.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},t.msToTimeSpan=function(n){(isNaN(n)||n<0)&&(n=0);var t=""+n%1e3,i=""+Math.floor(n/1e3)%60,r=""+Math.floor(n/6e4)%60,u=""+Math.floor(n/36e5)%24;return t=t.length===1?"00"+t:t.length===2?"0"+t:t,i=i.length<2?"0"+i:i,r=r.length<2?"0"+r:r,u=u.length<2?"0"+u:u,u+":"+r+":"+i+"."+t},t.isCrossOriginError=function(n,t,i,r,u){return(n=="Script error."||n=="Script error")&&t==""&&i==0&&r==0&&u==null},t.dump=function(n){var t=Object.prototype.toString.call(n),i=JSON.stringify(n);return t==="[object Error]"&&(i="{ stack: '"+n.stack+"', message: '"+n.message+"', name: '"+n.name+"'"),t+i},t.addEventHandler=function(n,t){if(!window||typeof n!="string"||typeof t!="function")return!1;var i="on"+n;if(window.addEventListener)window.addEventListener(n,t,!1);else if(window.attachEvent)window.attachEvent(i,t);else return!1;return!0},t.document=typeof document!="undefined"?document:{},t.NotSpecified="not_specified",t}();n.Util=t})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(n){"use strict";var t=function(){function t(){}return t.serialize=function(n){var i=t._serializeObject(n,"root");return JSON.stringify(i)},t._serializeObject=function(i,r){var e="__aiCircularRefCheck",f={},u,s;if(!i)return n._InternalLogging.throwInternalUserActionable(0,"cannot serialize "+r+" because it is null or undefined"),f;if(i[e])return n._InternalLogging.throwInternalUserActionable(1,"Circular reference detected while serializing: '"+r),f;if(!i.aiDataContract){if(r==="measurements")f=t._serializeStringMap(i,"number",r);else if(r==="properties")f=t._serializeStringMap(i,"string",r);else if(r==="tags")f=t._serializeStringMap(i,"string",r);else if(n.Util.isArray(i))f=t._serializeArray(i,r);else{n._InternalLogging.throwInternalUserActionable(1,"Attempting to serialize an object which does not implement ISerializable: "+r);try{JSON.stringify(i);f=i}catch(o){n._InternalLogging.throwInternalUserActionable(0,o&&typeof o.toString=="function"?o.toString():"Error serializing object")}}return f}i[e]=!0;for(u in i.aiDataContract){var h=i.aiDataContract[u],c=typeof h!="boolean",l=i[u]!==undefined,a=typeof i[u]=="object"&&i[u]!==null;if(h&&!l&&!c){n._InternalLogging.throwInternalNonUserActionable(0,"Missing required field specification: The field '"+u+"' on '"+r+"' is required but not present on source");continue}s=a?c?t._serializeArray(i[u],u):t._serializeObject(i[u],u):i[u];s!==undefined&&(f[u]=s)}return delete i[e],f},t._serializeArray=function(i,r){var f=undefined,u,e,o;if(!!i)if(n.Util.isArray(i))for(f=[],u=0;u100||t<0)&&(n._InternalLogging.throwInternalUserActionable(1,"Sampling rate is out of range (0..100): '"+t+"'. Sampling will be disabled, you may be sending too much data which may affect your AI service level."),this.sampleRate=100);this.sampleRate=t}return t.prototype.isSampledIn=function(t){if(this.sampleRate==100)return!0;var i=n.SamplingScoreGenerator.getScore(t);return ithis.config.sessionExpirationMs(),i=n-this.automaticSession.renewalDate>this.config.sessionRenewalMs();t||i?(typeof this._sessionHandler=="function"&&this._sessionHandler(1,this.automaticSession.renewalDate),this.automaticSession.isFirst=undefined,this.renew()):(this.automaticSession.renewalDate=+new Date,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate))},t.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)},t.prototype.initializeAutomaticSession=function(){var t=n.Util.getCookie("ai_session"),i;t&&typeof t.split=="function"?this.initializeAutomaticSessionWithData(t):(i=n.Util.getStorage("ai_session"),i&&this.initializeAutomaticSessionWithData(i));this.automaticSession.id||(this.automaticSession.isFirst=!0,this.renew())},t.prototype.initializeAutomaticSessionWithData=function(t){var i=t.split("|"),r,u;i.length>0&&(this.automaticSession.id=i[0]);try{i.length>1&&(r=+i[1],this.automaticSession.acquisitionDate=+new Date(r),this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0);i.length>2&&(u=+i[2],this.automaticSession.renewalDate=+new Date(u),this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0)}catch(f){n._InternalLogging.throwInternalNonUserActionable(0,"Error parsing ai_session cookie, session will be reset: "+n.Util.dump(f))}this.automaticSession.renewalDate==0&&n._InternalLogging.throwInternalNonUserActionable(1,"AI session renewal date is 0, session will be reset.")},t.prototype.renew=function(){var t=+new Date;this.automaticSession.id=n.Util.newGuid();this.automaticSession.acquisitionDate=t;this.automaticSession.renewalDate=t;this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate);typeof this._sessionHandler=="function"&&this._sessionHandler(0,t);n.Util.canUseLocalStorage()||n._InternalLogging.throwInternalNonUserActionable(1,"Browser does not support local storage. Session durations will be inaccurate.")},t.prototype.setCookie=function(t,i,r){var f=i+this.config.sessionExpirationMs(),e=r+this.config.sessionRenewalMs(),u=new Date,o=[t,i,r];f0&&(this.id=e[0]));this.id||(this.id=n.Util.newGuid(),u=new Date,o=n.Util.toISOStringForIE8(u),this.accountAcquisitionDate=o,u.setTime(u.getTime()+31536e6),h=[this.id,o],n.Util.setCookie(t.userCookieName,h.join(t.cookieSeparator)+";expires="+u.toUTCString()),n.Util.removeStorage("ai_session"));this.accountId=i;f=n.Util.getCookie(t.authUserCookieName);f&&(f=decodeURI(f),r=f.split(t.cookieSeparator),r[0]&&(this.authenticatedId=r[0]),r.length>1&&r[1]&&(this.accountId=r[1]))}return t.prototype.setAuthenticatedUserContext=function(i,r){var f=!this.validateUserInput(i)||r&&!this.validateUserInput(r),u;if(f){n._InternalLogging.throwInternalUserActionable(1,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.");return}this.authenticatedId=i;u=this.authenticatedId;r&&(this.accountId=r,u=[this.authenticatedId,this.accountId].join(t.cookieSeparator));n.Util.setCookie(t.authUserCookieName,encodeURI(u))},t.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null;this.accountId=null;n.Util.deleteCookie(t.authUserCookieName)},t.prototype.validateUserInput=function(n){return typeof n!="string"||!n||n.match(/,|;|=| |\|/)?!1:!0},t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();t.User=i})(t=n.Context||(n.Context={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(n){"use strict";var t=function(){function t(n){if(this._buffer=[],this._lastSend=0,this._config=n,this._sender=null,typeof XMLHttpRequest!="undefined"){var t=new XMLHttpRequest;"withCredentials"in t?this._sender=this._xhrSender:typeof XDomainRequest!="undefined"&&(this._sender=this._xdrSender)}}return t.prototype.send=function(t){var r=this,i;try{if(this._config.disableTelemetry())return;if(!t){n._InternalLogging.throwInternalNonUserActionable(0,"Cannot send empty telemetry");return}if(!this._sender){n._InternalLogging.throwInternalNonUserActionable(0,"Sender was not initialized");return}i=n.Serializer.serialize(t);this._getSizeInBytes(this._buffer)+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend();this._buffer.push(i);this._timeoutHandle||(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null;r.triggerSend()},this._config.maxBatchInterval()))}catch(u){n._InternalLogging.throwInternalNonUserActionable(0,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+n.Util.dump(u))}},t.prototype._getSizeInBytes=function(n){var r=0,t,i;if(n&&n.length)for(t=0;t=300)&&n.status!==0?t._onError(i,n.responseText||n.response||""):t._onSuccess(i))},t._xdrOnLoad=function(n,i){n&&(n.responseText+""=="200"||n.responseText==="")?t._onSuccess(i):t._onError(i,n&&n.responseText||"")},t._onError=function(t,i){n._InternalLogging.throwInternalNonUserActionable(1,"Failed to send telemetry:\n"+i)},t._onSuccess=function(){},t}();n.Sender=t})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(n){"use strict";var t=function(){function n(){}return n}();n.Domain=t})(t=n.Telemetry||(n.Telemetry={}))}(Microsoft||(Microsoft={})),function(n){"use strict";(function(n){n[n.Verbose=0]="Verbose";n[n.Information=1]="Information";n[n.Warning=2]="Warning";n[n.Error=3]="Error";n[n.Critical=4]="Critical"})(n.SeverityLevel||(n.SeverityLevel={}));var t=n.SeverityLevel}(AI||(AI={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.MessageData=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(){function t(){}return t.sanitizeKeyAndAddUniqueness=function(n,i){var e=n.length,r=t.sanitizeKey(n),f,u;if(r.length!==e){for(f=0,u=r;i[u]!==undefined;)f++,u=r.substring(0,t.MAX_NAME_LENGTH-3)+t.padNumber(f);r=u}return r},t.sanitizeKey=function(i){return i&&(i=n.Util.trim(i.toString()),i.search(/[^0-9a-zA-Z-._()\/ ]/g)>=0&&(i=i.replace(/[^0-9a-zA-Z-._()\/ ]/g,"_"),n._InternalLogging.throwInternalUserActionable(1,"name contains illegal characters. Illgeal character have been replaced with '_'. new name: "+i)),i.length>t.MAX_NAME_LENGTH&&(i=i.substring(0,t.MAX_NAME_LENGTH),n._InternalLogging.throwInternalUserActionable(1,"name is too long. It has been truncated to "+t.MAX_NAME_LENGTH+" characters. name: "+i))),i},t.sanitizeString=function(i){return i&&(i=n.Util.trim(i),i.toString().length>t.MAX_STRING_LENGTH&&(i=i.substring(0,t.MAX_STRING_LENGTH),n._InternalLogging.throwInternalUserActionable(1,"string value is too long. It has been truncated to "+t.MAX_STRING_LENGTH+" characters. value: "+i))),i},t.sanitizeUrl=function(i){return i&&i.length>t.MAX_URL_LENGTH&&(i=i.substring(0,t.MAX_URL_LENGTH),n._InternalLogging.throwInternalUserActionable(1,"url is too long, it has been trucated to "+t.MAX_URL_LENGTH+" characters. url: "+i)),i},t.sanitizeMessage=function(i){return i&&i.length>t.MAX_MESSAGE_LENGTH&&(i=i.substring(0,t.MAX_MESSAGE_LENGTH),n._InternalLogging.throwInternalUserActionable(1,"message is too long, it has been trucated to "+t.MAX_MESSAGE_LENGTH+" characters. message: "+i)),i},t.sanitizeException=function(i){return i&&i.length>t.MAX_EXCEPTION_LENGTH&&(i=i.substring(0,t.MAX_EXCEPTION_LENGTH),n._InternalLogging.throwInternalUserActionable(1,"exception is too long, iit has been trucated to "+t.MAX_EXCEPTION_LENGTH+" characters. exception: "+i)),i},t.sanitizeProperties=function(n){var r,i,u;if(n){r={};for(i in n)u=t.sanitizeString(n[i]),i=t.sanitizeKeyAndAddUniqueness(i,r),r[i]=u;n=r}return n},t.sanitizeMeasurements=function(n){var r,i,u;if(n){r={};for(i in n)u=n[i],i=t.sanitizeKeyAndAddUniqueness(i,r),r[i]=u;n=r}return n},t.padNumber=function(n){var t="00"+n;return t.substr(t.length-3)},t.MAX_NAME_LENGTH=150,t.MAX_STRING_LENGTH=1024,t.MAX_URL_LENGTH=2048,t.MAX_MESSAGE_LENGTH=32768,t.MAX_EXCEPTION_LENGTH=32768,t}();t.DataSanitizer=i})(i=t.Common||(t.Common={}))})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(i){function r(r,u){i.call(this);this.aiDataContract={ver:!0,message:!0,severityLevel:!1,measurements:!1,properties:!1};r=r||n.Util.NotSpecified;this.message=t.Common.DataSanitizer.sanitizeMessage(r);this.properties=t.Common.DataSanitizer.sanitizeProperties(u)}return __extends(r,i),r.envelopeType="Microsoft.ApplicationInsights.Message",r.dataType="MessageData",r}(AI.MessageData);t.Trace=i})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.EventData=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(i,r,u){t.call(this);this.aiDataContract={ver:!0,name:!0,properties:!1,measurements:!1};this.name=n.Telemetry.Common.DataSanitizer.sanitizeString(i);this.properties=n.Telemetry.Common.DataSanitizer.sanitizeProperties(r);this.measurements=n.Telemetry.Common.DataSanitizer.sanitizeMeasurements(u)}return __extends(i,t),i.envelopeType="Microsoft.ApplicationInsights.Event",i.dataType="EventData",i}(AI.EventData);t.Event=i})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(){function n(){this.hasFullStack=!0;this.parsedStack=[]}return n}();n.ExceptionDetails=t}(AI||(AI={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.exceptions=[];this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.ExceptionData=t}(AI||(AI={})),function(n){"use strict";var t=function(){function n(){}return n}();n.StackFrame=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(t){"use strict";var u=function(i){function u(t,u,f,e){i.call(this);this.aiDataContract={ver:!0,handledAt:!0,exceptions:!0,severityLevel:!1,properties:!1,measurements:!1};this.properties=n.Telemetry.Common.DataSanitizer.sanitizeProperties(f);this.measurements=n.Telemetry.Common.DataSanitizer.sanitizeMeasurements(e);this.handledAt=u||"unhandled";this.exceptions=[new r(t)]}return __extends(u,i),u.CreateSimpleException=function(n,i,r,u,f,e,o){var c,s,h;try{throw new Error;}catch(l){c=new t.Exception(l)}return s=c.exceptions[0].parsedStack[0],s.assembly=r,s.fileName=u,s.level=0,s.line=e,s.method="unknown",h=c.exceptions[0],h.hasFullStack=!0,h.message=n,h.parsedStack=null,h.stack=f,h.typeName=i,c.handledAt=o||"unhandled",c},u.envelopeType="Microsoft.ApplicationInsights.Exception",u.dataType="ExceptionData",u}(AI.ExceptionData),r,i;t.Exception=u;r=function(r){function u(i){r.call(this);this.aiDataContract={id:!1,outerId:!1,typeName:!0,message:!0,hasFullStack:!1,stack:!1,parsedStack:[]};this.typeName=t.Common.DataSanitizer.sanitizeString(i.name||n.Util.NotSpecified);this.message=t.Common.DataSanitizer.sanitizeMessage(i.message||n.Util.NotSpecified);var u=i.stack;this.parsedStack=this.parseStack(u);this.stack=t.Common.DataSanitizer.sanitizeException(u);this.hasFullStack=n.Util.isArray(this.parsedStack)&&this.parsedStack.length>0}return __extends(u,r),u.prototype.parseStack=function(n){var t=undefined,e,l,o,r,a,s,h,p,w,b;if(typeof n=="string"){for(e=n.split("\n"),t=[],l=0,o=0,r=0;r<=e.length;r++)a=e[r],i.regex.test(a)&&(s=new i(e[r],l++),o+=s.sizeInBytes,t.push(s));if(h=32768,o>h)for(var u=0,f=t.length-1,v=0,c=u,y=f;uh){b=y-c+1;t.splice(c,b);break}c=u;y=f;u++;f--}}return t},u}(AI.ExceptionDetails);i=function(t){function i(r,u){t.call(this);this.sizeInBytes=0;this.aiDataContract={level:!0,method:!0,assembly:!1,fileName:!1,line:!1};this.level=u;this.method="unavailable";this.assembly=n.Util.trim(r);var f=r.match(i.regex);f&&f.length>=5&&(this.method=n.Util.trim(f[2]),this.fileName=n.Util.trim(f[4]),this.line=parseInt(f[5])||0);this.sizeInBytes+=this.method.length;this.sizeInBytes+=this.fileName.length;this.sizeInBytes+=this.assembly.length;this.sizeInBytes+=i.baseSize;this.sizeInBytes+=this.level.toString().length;this.sizeInBytes+=this.line.toString().length}return __extends(i,t),i.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,i.baseSize=58,i}(AI.StackFrame)})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.metrics=[];this.properties={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.MetricData=t}(AI||(AI={})),function(n){"use strict";(function(n){n[n.Measurement=0]="Measurement";n[n.Aggregation=1]="Aggregation"})(n.DataPointType||(n.DataPointType={}));var t=n.DataPointType}(AI||(AI={})),function(n){"use strict";var t=function(){function n(){this.kind=0}return n}();n.DataPoint=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(n){function t(){n.apply(this,arguments);this.aiDataContract={name:!0,kind:!1,value:!0,count:!1,min:!1,max:!1,stdDev:!1}}return __extends(t,n),t}(AI.DataPoint);n.DataPoint=t})(t=n.Common||(n.Common={}))})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(t){var i;(function(i){"use strict";var r=function(r){function u(u,f,e,o,s,h){r.call(this);this.aiDataContract={ver:!0,metrics:!0,properties:!1};var c=new n.ApplicationInsights.Telemetry.Common.DataPoint;c.count=e>0?e:undefined;c.max=isNaN(s)||s===null?undefined:s;c.min=isNaN(o)||o===null?undefined:o;c.name=i.Common.DataSanitizer.sanitizeString(u);c.value=f;this.metrics=[c];this.properties=t.Telemetry.Common.DataSanitizer.sanitizeProperties(h)}return __extends(u,r),u.envelopeType="Microsoft.ApplicationInsights.Metric",u.dataType="MetricData",u}(AI.MetricData);i.Metric=r})(i=t.Telemetry||(t.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(n.EventData);n.PageViewData=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(i){function r(r,u,f,e,o){i.call(this);this.aiDataContract={ver:!0,name:!1,url:!1,duration:!1,properties:!1,measurements:!1};this.url=t.Common.DataSanitizer.sanitizeUrl(u);this.name=t.Common.DataSanitizer.sanitizeString(r||n.Util.NotSpecified);isNaN(f)||(this.duration=n.Util.msToTimeSpan(f));this.properties=n.Telemetry.Common.DataSanitizer.sanitizeProperties(e);this.measurements=n.Telemetry.Common.DataSanitizer.sanitizeMeasurements(o)}return __extends(r,i),r.envelopeType="Microsoft.ApplicationInsights.Pageview",r.dataType="PageviewData",r}(AI.PageViewData);t.PageView=i})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(n.PageViewData);n.PageViewPerfData=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(i){function r(u,f,e,o,s){var h;if(i.call(this),this.aiDataContract={ver:!0,name:!1,url:!1,duration:!1,perfTotal:!1,networkConnect:!1,sentRequest:!1,receivedResponse:!1,domProcessing:!1,properties:!1,measurements:!1},this.isValid=!1,h=r.getPerformanceTiming(),h){var c=r.getDuration(h.navigationStart,h.loadEventEnd),l=r.getDuration(h.navigationStart,h.connectEnd),a=r.getDuration(h.requestStart,h.responseStart),v=r.getDuration(h.responseStart,h.responseEnd),y=r.getDuration(h.responseEnd,h.loadEventEnd);c==0?n._InternalLogging.throwInternalNonUserActionable(1,"error calculating page view performance: total='"+c+"', network='"+l+"', request='"+a+"', response='"+v+"', dom='"+y+"'"):c0&&n.navigationStart>0&&n.responseStart>0&&n.requestStart>0&&n.loadEventEnd>0&&n.responseEnd>0&&n.connectEnd>0&&n.domLoading>0},r.getDuration=function(n,t){var i=0;return isNaN(n)||isNaN(t)||(i=Math.max(t-n,0)),i},r.envelopeType="Microsoft.ApplicationInsights.PageviewPerformance",r.dataType="PageviewPerformanceData",r}(AI.PageViewPerfData);t.PageViewPerformance=i})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.state=0;n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.SessionStateData=t}(AI||(AI={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(n){function t(t){n.call(this);this.aiDataContract={ver:!0,state:!0};this.state=t}return __extends(t,n),t.envelopeType="Microsoft.ApplicationInsights.SessionState",t.dataType="SessionStateData",t}(AI.SessionStateData);n.SessionTelemetry=t})(t=n.Telemetry||(n.Telemetry={}))})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){var t;(function(n){"use strict";var t=function(){function t(i){var r=this;this._config=i;this._sender=new n.Sender(i);typeof window!="undefined"&&(this._sessionManager=new n.Context._SessionManager(i,function(n,i){return t._sessionHandler(r,n,i)}),this.application=new n.Context.Application,this.device=new n.Context.Device,this.internal=new n.Context.Internal,this.location=new n.Context.Location,this.user=new n.Context.User(i.accountId()),this.operation=new n.Context.Operation,this.session=new n.Context.Session,this.sample=new n.Context.Sample(i.sampleRate()))}return t.prototype.addTelemetryInitializer=function(n){this.telemetryInitializers=this.telemetryInitializers||[];this.telemetryInitializers.push(n)},t.prototype.track=function(t){return t?(t.name===n.Telemetry.PageView.envelopeType&&n._InternalLogging.resetInternalMessageCount(),this.session&&typeof this.session.id!="string"&&this._sessionManager.update(),this._track(t)):n._InternalLogging.throwInternalUserActionable(0,"cannot call .track() with a null or undefined argument"),t},t.prototype._track=function(t){var r,f,i,u;this.session&&(typeof this.session.id=="string"?this._applySessionContext(t,this.session):this._applySessionContext(t,this._sessionManager.automaticSession));this._applyApplicationContext(t,this.application);this._applyDeviceContext(t,this.device);this._applyInternalContext(t,this.internal);this._applyLocationContext(t,this.location);this._applySampleContext(t,this.sample);this._applyUserContext(t,this.user);this._applyOperationContext(t,this.operation);t.iKey=this._config.instrumentationKey();r=!1;try{for(this.telemetryInitializers=this.telemetryInitializers||[],f=this.telemetryInitializers.length,i=0;i6e4;(l||c)&&(clearInterval(s),f=t.Telemetry.PageViewPerformance.getDuration(e,+new Date),h=new t.Telemetry.PageViewPerformance(n,i,f,r,u),o.sendPageViewInternal(n,i,h.isValid&&!isNaN(h.duration)?+h.duration:f,r,u),h.isValid&&(a=new t.Telemetry.Common.Data(t.Telemetry.PageViewPerformance.dataType,h),v=new t.Telemetry.Common.Envelope(a,t.Telemetry.PageViewPerformance.envelopeType),o.context.track(v)),o.context._sender.triggerSend())}catch(y){t._InternalLogging.throwInternalNonUserActionable(0,"trackPageView failed on page load calculation: "+t.Util.dump(y))}},100))},r.prototype.startTrackEvent=function(n){try{this._eventTracking.start(n)}catch(i){t._InternalLogging.throwInternalNonUserActionable(0,"startTrackEvent failed, event will not be collected: "+t.Util.dump(i))}},r.prototype.stopTrackEvent=function(n,i,r){try{this._eventTracking.stop(n,undefined,i,r)}catch(u){t._InternalLogging.throwInternalNonUserActionable(0,"stopTrackEvent failed, event will not be collected: "+t.Util.dump(u))}},r.prototype.trackEvent=function(n,i,r){try{var u=new t.Telemetry.Event(n,i,r),f=new t.Telemetry.Common.Data(t.Telemetry.Event.dataType,u),e=new t.Telemetry.Common.Envelope(f,t.Telemetry.Event.envelopeType);this.context.track(e)}catch(o){t._InternalLogging.throwInternalNonUserActionable(0,"trackEvent failed, event will not be collected: "+t.Util.dump(o))}},r.prototype.trackException=function(n,i,r,u){try{if(!t.Util.isError(n))try{throw new Error(n);}catch(f){n=f}var e=new t.Telemetry.Exception(n,i,r,u),o=new t.Telemetry.Common.Data(t.Telemetry.Exception.dataType,e),s=new t.Telemetry.Common.Envelope(o,t.Telemetry.Exception.envelopeType);this.context.track(s)}catch(h){t._InternalLogging.throwInternalNonUserActionable(0,"trackException failed, exception will not be collected: "+t.Util.dump(h))}},r.prototype.trackMetric=function(n,i,r,u,f,e){try{var o=new t.Telemetry.Metric(n,i,r,u,f,e),s=new t.Telemetry.Common.Data(t.Telemetry.Metric.dataType,o),h=new t.Telemetry.Common.Envelope(s,t.Telemetry.Metric.envelopeType);this.context.track(h)}catch(c){t._InternalLogging.throwInternalNonUserActionable(0,"trackMetric failed, metric will not be collected: "+t.Util.dump(c))}},r.prototype.trackTrace=function(n,i){try{var r=new t.Telemetry.Trace(n,i),u=new t.Telemetry.Common.Data(t.Telemetry.Trace.dataType,r),f=new t.Telemetry.Common.Envelope(u,t.Telemetry.Trace.envelopeType);this.context.track(f)}catch(e){t._InternalLogging.throwInternalNonUserActionable(1,"trackTrace failed, trace will not be collected: "+t.Util.dump(e))}},r.prototype.trackPageVisitTime=function(n,t,i){var r={PageName:n,PageUrl:t};this.trackMetric("PageVisitTime",i,1,i,i,r)},r.prototype.flush=function(){try{this.context._sender.triggerSend()}catch(n){t._InternalLogging.throwInternalNonUserActionable(0,"flush failed, telemetry will not be collected: "+t.Util.dump(n))}},r.prototype.setAuthenticatedUserContext=function(n,i){try{this.context.user.setAuthenticatedUserContext(n,i)}catch(r){t._InternalLogging.throwInternalUserActionable(1,"Setting auth user context failed. "+t.Util.dump(r))}},r.prototype.clearAuthenticatedUserContext=function(){try{this.context.user.clearAuthenticatedUserContext()}catch(n){t._InternalLogging.throwInternalUserActionable(1,"Clearing auth user context failed. "+t.Util.dump(n))}},r.prototype.SendCORSException=function(i){var r=n.ApplicationInsights.Telemetry.Exception.CreateSimpleException("Script error.","Error","unknown","unknown","The browser’s same-origin policy prevents us from getting the details of this exception.The exception occurred in a script loaded from an origin different than the web page.For cross- domain error reporting you can use crossorigin attribute together with appropriate CORS HTTP headers.For more information please see http://www.w3.org/TR/cors/.",0,null),u,f;r.properties=i;u=new t.Telemetry.Common.Data(t.Telemetry.Exception.dataType,r);f=new t.Telemetry.Common.Envelope(u,t.Telemetry.Exception.envelopeType);this.context.track(f)},r.prototype._onerror=function(n,i,r,u,f){var e,o,s,h;try{e={url:i?i:document.URL};t.Util.isCrossOriginError(n,i,r,u,f)?this.SendCORSException(e):(t.Util.isError(f)||(o="window.onerror@"+e.url+":"+r+":"+(u||0),f=new Error(n),f.stack=o),this.trackException(f,null,e))}catch(c){s=f?f.name+", "+f.message:"null";h=t.Util.dump(c);t._InternalLogging.throwInternalNonUserActionable(0,"_onerror threw "+h+" while logging error, error will not be collected: "+s)}},r}();t.AppInsights=r;i=function(){function n(n){this._name=n;this._events={}}return n.prototype.start=function(n){typeof this._events[n]!="undefined"&&t._InternalLogging.throwInternalUserActionable(1,"start"+this._name+" was called more than once for this event without calling stop"+this._name+". key is '"+n+"'");this._events[n]=+new Date},n.prototype.stop=function(n,i,r,u){var f=this._events[n],e,o;isNaN(f)?t._InternalLogging.throwInternalUserActionable(1,"stop"+this._name+" was called without a corresponding start"+this._name+" . Event name is '"+n+"'"):(e=+new Date,o=t.Telemetry.PageViewPerformance.getDuration(f,e),this.action(n,i,o,r,u));delete this._events[n];this._events[n]=undefined},n}()})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(n.PageViewData);n.AjaxCallData=t}(AI||(AI={})),function(n){"use strict";(function(n){n[n.SQL=0]="SQL";n[n.Http=1]="Http";n[n.Other=2]="Other"})(n.DependencyKind||(n.DependencyKind={}));var t=n.DependencyKind}(AI||(AI={})),function(n){"use strict";(function(n){n[n.Undefined=0]="Undefined";n[n.Aic=1]="Aic";n[n.Apmc=2]="Apmc"})(n.DependencySourceType||(n.DependencySourceType={}));var t=n.DependencySourceType}(AI||(AI={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.kind=0;this.dependencyKind=2;this.success=!0;this.dependencySource=0;this.properties={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.RemoteDependencyData=t}(AI||(AI={})),function(n){"use strict";var t=function(n){function t(){this.ver=2;this.properties={};this.measurements={};n.call(this)}return __extends(t,n),t}(Microsoft.Telemetry.Domain);n.RequestData=t}(AI||(AI={})),function(n){var t;(function(t){"use strict";var i=function(){function i(t){t.queue=t.queue||[];var r=t.config||{};if(r&&!r.instrumentationKey)if(r=t,r.iKey)n.ApplicationInsights.Version="0.10.0.0",r.instrumentationKey=r.iKey;else if(r.applicationInsightsId)n.ApplicationInsights.Version="0.7.2.0",r.instrumentationKey=r.applicationInsightsId;else throw new Error("Cannot load Application Insights SDK, no instrumentationKey was provided.");r=i.getDefaultConfig(r);this.snippet=t;this.config=r}return i.prototype.loadAppInsights=function(){var t=new n.ApplicationInsights.AppInsights(this.config),u,i,r;return this.config.iKey&&(u=t.trackPageView,t.trackPageView=function(n,i,r){u.apply(t,[null,n,i,r])}),i="logPageView",typeof this.snippet[i]=="function"&&(t[i]=function(n,i,r){t.trackPageView(null,n,i,r)}),r="logEvent",typeof this.snippet[r]=="function"&&(t[r]=function(n,i,r){t.trackEvent(n,i,r)}),t},i.prototype.emptyQueue=function(){var u,t,f,r;try{if(n.ApplicationInsights.Util.isArray(this.snippet.queue)){for(u=this.snippet.queue.length,t=0;t0?n.maxBatchSizeInBytes:1e6,n.maxBatchInterval=isNaN(n.maxBatchInterval)?15e3:n.maxBatchInterval,n.enableDebug=t.Util.stringToBoolOrDefault(n.enableDebug),n.autoCollectErrors=n.autoCollectErrors!==undefined&&n.autoCollectErrors!==null?t.Util.stringToBoolOrDefault(n.autoCollectErrors):!0,n.disableTelemetry=t.Util.stringToBoolOrDefault(n.disableTelemetry),n.verboseLogging=t.Util.stringToBoolOrDefault(n.verboseLogging),n.emitLineDelimitedJson=t.Util.stringToBoolOrDefault(n.emitLineDelimitedJson),n.diagnosticLogInterval=n.diagnosticLogInterval||1e4,n.autoTrackPageVisitTime=t.Util.stringToBoolOrDefault(n.autoTrackPageVisitTime),(isNaN(n.samplingPercentage)||n.samplingPercentage<=0||n.samplingPercentage>=100)&&(n.samplingPercentage=100),n},i}();t.Initialization=i})(t=n.ApplicationInsights||(n.ApplicationInsights={}))}(Microsoft||(Microsoft={}));initializeAppInsights()