@microsoft/applicationinsights-dependencies-js 2.8.0-beta.2203-03 → 2.8.0-beta.2203-04

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-03
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  var e=this,t=function(a){"use strict";var i="function",u="object",o="undefined",N="prototype",d="hasOwnProperty",n=Object,w=n[N],e=n.assign,S=n.create,M=n.defineProperty,p=w[d],t=null;function Z(e){return void 0===e&&(e=!0),t&&e||(typeof globalThis!==o&&globalThis&&(t=globalThis),typeof self!==o&&self&&(t=self),typeof window!==o&&window&&(t=window),typeof global!==o&&global&&(t=global)),t}function q(e){throw new TypeError(e)}(Z()||{}).Symbol,(Z()||{}).Reflect;var Q=e||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])w[d].call(t,o)&&(e[o]=t[o]);return e},A=function(e,t){return(A=n.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t[d](n)&&(e[n]=t[n])})(e,t)};function F(e,t){function n(){this.constructor=e}typeof t!==i&&null!==t&&q("Class extends value "+t+" is not a constructor or null"),A(e,t),e[N]=null===t?function(e){if(S)return S(e);if(null==e)return{};var t=typeof e;function n(){}return t!==u&&t!==i&&q("Object prototype may only be an Object:"+e),n[N]=e,new n}(t):(n[N]=t[N],new n)}var R="constructor",g="prototype",D="function",E="_dynInstFuncs",L="_isDynProxy",h="_dynClass",k="_dynInstChk",j=k,H="_dfOpts",P="_unknown_",ee="__proto__",te="useBaseInst",ne="setInstFuncs",re=Object,oe=re.getPrototypeOf,ae=0;function v(e,t){return e&&re[g].hasOwnProperty.call(e,t)}function ie(e){return e&&(e===re[g]||e===Array[g])}function ue(e){return ie(e)||e===Function[g]}function m(e){if(e){if(oe)return oe(e);e=e[ee]||e[g]||(e[R]?e[R][g]:null);if(e)return e}return null}function se(e,t){var n=[],r=re.getOwnPropertyNames;if(r)n=r(e);else for(var o in e)"string"==typeof o&&v(e,o)&&n.push(o);if(n&&0<n.length)for(var a=0;a<n.length;a++)t(n[a])}function ce(e,t,n){return t!==R&&typeof e[t]===D&&(n||v(e,t))}function le(e){throw new TypeError("DynamicProto: "+e)}function de(e,t){for(var n=e.length-1;0<=n;n--)if(e[n]===t)return 1}function fe(e,t){return v(e,g)?e.name||t||P:((e||{})[R]||{}).name||t||P}function x(e,r,t,n){v(e,g)||le("theClass is an invalid class definition.");var o,a,i,u,s,c,l=e[g],d=(function(e){if(oe)for(var t=[],n=m(r);n&&!ue(n)&&!de(t,n);){if(n===e)return 1;t.push(n),n=m(n)}}(l)||le("["+fe(e)+"] is not in class hierarchy of ["+fe(r)+"]"),null),e=(v(l,h)?d=l[h]:(d="_dynCls$"+fe(e,"_")+"$"+ae,ae++,l[h]=d),x[H]),f=!!e[te],p=(f&&n&&n[te]!==undefined&&(f=!!n[te]),a={},se(o=r,function(e){!a[e]&&ce(o,e,!1)&&(a[e]=o[e])}),a),f=(t(r,function(e,t,n,a){function r(e,t,n){var r,o=t[n];return o[L]&&a&&!1!==(r=e[E]||{})[j]&&(o=(r[t[h]]||{})[n]||o),function(){return o.apply(e,arguments)}}for(var o={},i=(se(n,function(e){o[e]=r(t,n,e)}),m(e)),u=[];i&&!ue(i)&&!de(u,i);)se(i,function(e){!o[e]&&ce(i,e,!oe)&&(o[e]=r(t,i,e))}),u.push(i),i=m(i);return o}(l,r,p,f)),!!oe&&!!e[ne]);i=l,t=d,u=r,s=p,e=!1!==(f=f&&n?!!n[ne]:f),ie(i)||(l=u[E]=u[E]||{},c=l[t]=l[t]||{},!1!==l[j]&&(l[j]=!!e),se(u,function(e){var n,r,o;ce(u,e,!1)&&u[e]!==s[e]&&(c[e]=u[e],delete u[e],v(i,e)&&(!i[e]||i[e][L])||(i[e]=(n=i,r=e,(o=function(){var e,t;return(function(e,t,n,r){var o=null;if(e&&v(n,h)){var a=e[E]||{};if((o=(a[n[h]]||{})[t])||le("Missing ["+t+"] "+D),!o[k]&&!1!==a[j]){for(var i=!v(e,t),u=m(e),s=[];i&&u&&!ue(u)&&!de(s,u);){var c=u[t];if(c){i=c===r;break}s.push(u),u=m(u)}try{i&&(e[t]=o),o[k]=1}catch(l){a[j]=!1}}}return o}(this,r,n,o)||(typeof(t=(t=n[e=r])===o?m(n)[e]:t)!==D&&le("["+e+"] is not a "+D),t)).apply(this,arguments)})[L]=1,o)))}))}x[H]={setInstFuncs:!0,useBaseInst:!0};var f="",pe="isInitialized",ge="teardown",he="core",ve="disabled",me="_doTeardown",xe="toISOString",ye="trim",e="toString",Ce="constructor",Te=M,be=n.freeze,Ie=n.keys,we=String[N][ye],Se=Date[N][xe],Me=Array.isArray,qe=w[e],Ae=p[e],Fe=Ae.call(n),Re=/-([a-z])/g,De=/([^\w\d_$])/g,Ee=/^(\d+[\w\d_$])/,Le=Object.getPrototypeOf;function ke(e){if(e){if(Le)return Le(e);e=e.__proto__||e[N]||e[Ce];if(e)return e}return null}function je(e){return e===undefined||typeof e===o}function _(e){return null===e||je(e)}function He(e){return!(!e||typeof e!==u)}function O(e){return!(!e||typeof e!==i)}function Pe(e){var t=e;return e&&B(e)?(t=(t=e.replace(Re,function(e,t){return t.toUpperCase()})).replace(De,"_")).replace(Ee,function(e,t){return"_"+t}):t}function U(e,t){if(e)for(var n in e)p.call(e,n)&&t.call(e,n,e[n])}function Ne(e,t){return!(!e||!t||!~e.indexOf(t))}var V=Me||function(e){return!(!e||"[object Array]"!==qe.call(e))};function B(e){return"string"==typeof e}function _e(e){return e&&"object"==typeof e&&(!(e=(Le||ke)(e))||typeof(e=e[Ce]&&p.call(e,Ce)?e[Ce]:e)===i&&Ae.call(e)===Fe)}function z(e,t,n){var r=e.length;try{for(var o=0;o<r&&!(o in e&&-1===t.call(n||e,e[o],o,e));o++);}catch(a){}}function Oe(e){return e&&(we&&e[ye]?e[ye]():e.replace?e.replace(/^\s+|\s+$/g,""):e)}var Ue=!{toString:null}.propertyIsEnumerable("toString"),Ve=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function Be(e){var t=typeof e;if(t===i||t===u&&null!==e||q("objKeys called on non-object"),!Ue&&Ie)return Ie(e);var n,r=[];for(n in e)e&&p.call(e,n)&&r.push(n);if(Ue)for(var o=Ve.length,a=0;a<o;a++)e&&p.call(e,Ve[a])&&r.push(Ve[a]);return r}var ze=be||function(e){return e};function Ke(){var e=Date;return e.now?e.now():(new e).getTime()}function Xe(e){var n={};return U(e,function(e,t){if(n[e]=t,!je(n[t]))throw Error("["+t+"] exists for "+e);n[t]=e}),ze(n)}var We="window",Ge="documentMode",$e="performance",Je="JSON",Ye="crypto",Ze="msCrypto",Qe="msie",et="trident/",tt="XMLHttpRequest",nt=null,rt=null;function c(e){var t=Z();return t&&t[e]?t[e]:e===We&&typeof window===u&&window?window:null}function ot(){return typeof document===u&&document?document:c("document")}function at(){return typeof navigator===u&&navigator?navigator:c("navigator")}function it(){return c($e)}function ut(){return typeof JSON===u&&JSON||null!==c(Je)}function st(){return ut()?JSON||c(Je):null}function K(e){var t=Object[N].toString.call(e),n=f;return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":ut()&&(n=st().stringify(e)),t+n}var ct=null;function lt(e){return e?'"'+e.replace(/\"/g,f)+'"':f}function dt(e,t){var n,r=typeof console!==o?console:c("console");r&&(n="log",O(r[n=r[e]?e:n])&&r[n](t))}pt.dataType="MessageData";var ft=pt;function pt(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?"AI: ":"AI (Internal): ")+e;n=f,ut()&&(n=st().stringify(r)),e=(t?" message:"+lt(t):f)+(r?" props:"+lt(n):f);this.message+=e}var gt=function Hn(o){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};x(Hn,this,function(a){function e(e,t){e=o[e];return _(e)?t:e}function i(e,t){var n,r=(n=(n=ct)||!0===o.disableDbgExt?n:ct||(r=c("Microsoft"),ct=r?r.ApplicationInsights:ct))?n.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,t)}_(o)&&(o={}),a.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},a.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},a.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},a.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},a.throwInternal=function(e,t,n,r,o){t=new ft(t,n,o=void 0!==o&&o,r);if(a.enableDebugExceptions())throw t;n=1===e?"errorToConsole":"warnToConsole";je(t.message)?i("throw"+(1===e?"Critical":"Warning"),t):(r=a.consoleLoggingLevel(),o?(o=+t.messageId,!s[o]&&e<=r&&(a[n](t.message),s[o]=!0)):e<=r&&a[n](t.message),a.logInternalMessage(e,t))},a.warnToConsole=function(e){dt("warn",e),i("warning",e)},a.errorToConsole=function(e){dt("error",e),i("error",e)},a.resetInternalMessageCount=function(){u=0,s={}},a.logInternalMessage=function(e,t){var n,r;u>=a.maxInternalMessageLimit()||(r=!0,n="AITR_"+t.messageId,s[n]?r=!1:s[n]=!0,r&&(e<=a.telemetryLoggingLevel()&&(a.queue.push(t),u++,i(1===e?"error":"warn",t)),u===a.maxInternalMessageLimit()&&(r=new ft(23,n="Internal events throttle limit per PageView reached for this app.",!1),a.queue.push(r),1===e?a.errorToConsole(n):a.warnToConsole(n))))}})},ht=(s.ParentContextKey="parent",s.ChildrenContextKey="childEvts",s);function s(e,o,t){var r,a=this,i=!1;a.start=Ke(),a.name=e,a.isAsync=t,a.isChildEvt=function(){return!1},O(o)&&(i=function(e){if(Te)try{var t={enumerable:!0,configurable:!0,get:function(){return!r&&O(o)&&(r=o(),o=null),r}};return Te(e,"payload",t),!0}catch(n){}return!1}(a)),a.getCtx=function(e){return e?(e===s.ParentContextKey||e===s.ChildrenContextKey?a:a.ctx||{})[e]:null},a.setCtx=function(e,t){e&&(e===s.ParentContextKey?(a[e]||(a.isChildEvt=function(){return!0}),a[e]=t):e===s.ChildrenContextKey?a[e]=t:(a.ctx=a.ctx||{})[e]=t)},a.complete=function(){var e=0,t=a.getCtx(s.ChildrenContextKey);if(V(t))for(var n=0;n<t.length;n++){var r=t[n];r&&(e+=r.time)}a.time=Ke()-a.start,a.exTime=a.time-e,a.complete=function(){},!i&&O(o)&&(a.payload=o())}}var vt="CoreUtils.doPerf";function mt(e,t,n,r,o){if(e)if(e=O(e.getPerfMgr)?e.getPerfMgr():e){var a,i=void 0,u=e.getCtx(vt);try{if(i=e.create(t(),r,o))return u&&i.setCtx&&(i.setCtx(ht.ParentContextKey,u),u.getCtx&&u.setCtx&&((a=u.getCtx(ht.ChildrenContextKey))||(a=[],u.setCtx(ht.ChildrenContextKey,a)),a.push(i))),e.setCtx(vt,i),n(i)}catch(s){i&&i.setCtx&&i.setCtx("exception",s)}finally{i&&e.fire(i),e.setCtx(vt,u)}}n()}var xt=4294967296,l=4294967295,yt=!1,Ct=123456789,Tt=987654321;function bt(e){var t,n=0,r=c(Ye)||c(Ze);if(0===(n=r&&r.getRandomValues?r.getRandomValues(new Uint32Array(1))[0]&l:n)&&(!(r=at())||r.userAgent===rt&&null!==nt||(r=((rt=r.userAgent)||f).toLowerCase(),nt=Ne(r,Qe)||Ne(r,et)),nt)){if(!yt)try{var o=2147483647&Ke();(t=(Math.random()*xt^o)+o)<0&&(t>>>=0),Ct=123456789+t&l,Tt=987654321-t&l,yt=!0}catch(a){}r=((Tt=36969*(65535&Tt)+(Tt>>16)&l)<<16)+(65535&(Ct=18e3*(65535&Ct)+(Ct>>16)&l))>>>0&l|0,n=(r>>>=0)&l}return 0===n&&(n=Math.floor(xt*Math.random()|0)),e||(n>>>=0),n}var It=M,wt="2.7.3",St="."+function(e){void 0===e&&(e=22);for(var t=bt()>>>0,n=0,r=f;r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&t]||"",t>>>=6,5==++n&&(t=(bt()<<2&4294967295|3&t)>>>0,n=0);return r}(6),Mt=0;function qt(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType}function At(e,t){return Pe(e+Mt+++((t=void 0!==t&&t)?"."+wt:"")+St)}function Ft(e){var a={id:At("_aiData-"+(e||"")+"."+wt),accept:qt,get:function(e,t,n,r){var o=e[a.id];return o?o[Pe(t)]:(r&&((o=function(e,t){var n=t[e.id];if(!n){n={};try{qt(t)&&!function(e,t,n){if(It)try{return It(e,t,{value:n,enumerable:!1,configurable:!0}),1}catch(r){}}(t,e.id,n)&&(t[e.id]=n)}catch(r){}}return n}(a,e))[Pe(t)]=n),n)},kill:function(e,t){if(e&&e[t])try{delete e[t]}catch(n){}}};return a}var Rt=Ft("plugin");function Dt(e){return Rt.get(e,"state",{},!0)}var Et="TelemetryPluginChain",Lt="_hasRun",kt="_getTelCtx",jt=0;function Ht(e,i,n,t){var r=null,o=[],a=(null!==t&&(r=t?function(e,t,n,r){for(;e;){if(e.getPlugin()===r)return e;e=e.getNext()}return Nt([r],t,n)}(e,i,n,t):e),{_next:function(){var e,t=r;return r=t?t.getNext():null,t||(e=o)&&0<e.length&&(z(e,function(e){try{e.func.call(e.self,e.args)}catch(t){n.logger.throwInternal(2,73,"Unexpected Exception during onComplete - "+K(t))}}),o=[]),t},ctx:{core:function(){return n},diagLog:function(){return(n||{}).logger||new gt(i)},getCfg:function(){return i},getExtCfg:u,getConfig:function(e,t,n){void 0===n&&(n=!1);var r,e=u(e,null);return e&&!_(e[t])?r=e[t]:i&&!_(i[t])&&(r=i[t]),_(r)?n:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(e){r=e},iterate:function(e){for(;t=a._next();){var t=t.getPlugin();t&&e(t)}},onComplete:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e&&o.push({func:e,self:je(t)?a.ctx:t,args:n})}}});function u(e,t,n){var r,o,a;return void 0===t&&(t={}),void 0===n&&(n=0),(r=i&&(o=i.extensionConfig)&&e?o[e]:r)?He(t)&&0!==n&&(a=function f(){var e=arguments,t=e[0]||{},n=e.length,r=!1,o=1;for(0<n&&"boolean"==typeof t&&(r=t,t=e[o]||{},o++),He(t)||(t={});o<n;o++){var a,i,u,s,c=e[o],l=V(c),d=He(c);for(a in c)(l&&a in c||d&&p.call(c,a))&&(i=c[a],u=void 0,r&&i&&((u=V(i))||_e(i))&&(s=t[a],u?V(s)||(s=[]):_e(s)||(s={}),i=f(r,s,i)),i!==undefined&&(t[a]=i))}return t}(!0,t,r),i&&2===n&&U(t,function(e){var t;_(a[e])&&!_(t=i[e])&&(a[e]=t)})):r=t,r}return a}function Pt(e,n,r,t){var o=Ht(e,n,r,t),a=o.ctx;return a.processNext=function(e){var t=o._next();return t&&t.processTelemetry(e,a),!t},a.createNew=function(e,t){return Pt((e=V(e=void 0===e?null:e)?Nt(e,n,r,t):e)||a.getNext(),n,r,t)},a}function Nt(e,t,n,r){var o,a=null,i=!r;return V(e)&&0<e.length&&(o=null,z(e,function(e){(i=!i&&r===e||i)&&e&&O(e.processTelemetry)&&(e=_t(e,t,n),a=a||e,o&&o._setNext(e),o=e)})),r&&!a?Nt([r],t,n):a}function _t(s,r,o){var c=null,a=O(s.processTelemetry),i=O(s.setNextPlugin),l=s?s.identifier+"-"+s.priority+"-"+jt++:"Unknown-0-"+jt++,u={getPlugin:function(){return s},getNext:function(){return c},processTelemetry:function(n,e){var t;d(e=e||(t=(t=s&&O(s[kt])?s[kt]():t)||Pt(u,r,o)),function(e){if(!s||!a)return!1;var t=Dt(s);return!t[ge]&&!t[ve]&&(i&&s.setNextPlugin(c),s.processTelemetry(n,e),!0)},"processTelemetry",function(){return{item:n}},!n.sync)||e.processNext(n)},unload:function(r,o){d(r,function(){var e,t,n=!1;return s&&(e=Dt(s),t=s[he]||e.core,!s||t&&t!==r[he]()||e[ge]||(e[he]=null,e[ge]=!0,e[pe]=!1,s[ge]&&!0===s[ge](r,o)&&(n=!0))),n},"unload",function(){},o.isAsync)||r.processNext(o)},_id:l,_setNext:function(e){c=e}};function d(n,r,o,e,t){var a=!1,i=s?s.identifier:Et,u=(u=n[Lt])||(n[Lt]={});return n.setNext(c),s&&mt(n[he](),function(){return i+":"+o},function(){u[l]=!0;try{var e=c?c._id:f;e&&(u[e]=!1),a=r(n)}catch(t){e=!c||u[c._id];e&&(a=!0),c&&e||n.diagLog().throwInternal(1,73,"Plugin ["+s.identifier+"] failed during "+o+" - "+K(t)+", run flags: "+K(u))}},e,t),a}return ze(u)}function Ot(){var t=[];return{add:function(e){e&&t.push(e)},run:function(n,r){z(t,function(e){try{e(n,r)}catch(t){n.diagLog().throwInternal(2,73,"Unexpected error calling unload handler - "+K(t))}}),t=[]}}}var y="getPlugin",e=function Pn(){var u,c,l,d,f,p=this;function t(e){var t,e=e=void 0===e?null:e;return e||(t=c||Pt(null,{},p.core),e=l&&l[y]?t.createNew(null,l[y]):t.createNew(null,l)),e}function g(){u=!1,p.core=null,l=c=null,f=[],d=Ot()}g(),x(Pn,p,function(s){var e,t,n,r,o;s.initialize=function(e,t,n,r){e&&(i="extensionConfig",a=o=[],e&&(a=e[i])!==o&&_(a)&&(e[i]=a=o)),!r&&t&&(r=t.getProcessTelContext().getNext());var o,a,i=l;l&&l[y]&&(i=l[y]()),p.core=t,c=Pt(r,e,t,i),u=!0},s.teardown=function(e,t){var n,r,o,a;if(s.core&&(!e||s.core===e.core()))return r=!1,o=e||function u(e,n,r,t){var o=Ht(e,n,r,t),a=o.ctx;return a.processNext=function(e){var t=o._next();return t&&t.unload(a,e),!t},a.createNew=function(e,t){return u((e=V(e=void 0===e?null:e)?Nt(e,n,r,t):e)||a.getNext(),n,r,t)},a}(null,{},s.core,l&&l[y]?l[y]():l),a=t||{reason:0,isAsync:!1},s[me]&&!0===s[me](o,a,i)?n=!0:i(),n;function i(){r||(r=!0,d.run(o,t),z(f,function(e){e.rm()}),f=[],!0===n&&o.processNext(a),g())}},s._addHook=function(e){e&&(V(e)?f=f.concat(e):f.push(e))},e="_addUnloadCb",t=function(){return d},void 0===n&&(n=!0),s&&t&&(n||je(s[e]))&&(s[e]=(o=r=null,O(n=t)?r=n:o=n,function(){var e=arguments;if(o=r?r():o)return o.add.apply(o,e)}))}),p.diagLog=function(e){return t(e).diagLog()},p[pe]=function(){return u},p.setInitialized=function(e){u=e},p.setNextPlugin=function(e){l=e},p.processNext=function(e,t){t?t.processNext(e):l&&O(l.processTelemetry)&&l.processTelemetry(e,null)},p._getTelCtx=t},Ut="attachEvent",Vt="addEventListener",Bt=(At("aiEvtPageHide"),At("aiEvtPageShow"),1),zt=Ft("events"),Kt=/^([^.]*)(?:\.(.+)|)/;function Xt(e){return e&&e.replace?e.replace(/^\s*\.*|\.*\s*$/g,""):e}function X(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n=f,r=0;r<4;r++)n+=t[15&(e=bt())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var o=t[8+(3&bt())|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+o+n.substr(16,3)+n.substr(19,12)}var Wt=Xe({CRITICAL:1,WARNING:2}),W=Xe({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Gt="_aiHooks",$t=["req","rsp","hkErr","fnErr"];function Jt(e,t){if(e)for(var n=0;n<e.length&&!t(e[n],n);n++);}function Yt(e,i,u,s,c){0<=c&&c<=2&&Jt(e,function(e,t){var e=e.cbks,n=e[$t[c]];if(n){i.ctx=function(){return s[t]=s[t]||{}};try{n.apply(i.inst,u)}catch(o){n=i.err;try{var r=e.hkErr;r&&(i.err=o,r.apply(i.inst,u))}catch(a){}finally{i.err=n}}}})}function Zt(s){return function(){var n=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,t){(n=a([],n))[e]=t,o=a([r],n)}},t=[],o=a([r],n);function a(t,e){return Jt(e,function(e){t.push(e)}),t}r.evt=c("event"),Yt(e,r,o,t,0);var i=s.f;try{r.rslt=i.apply(this,n)}catch(u){throw r.err=u,Yt(e,r,o,t,3),u}return Yt(e,r,o,t,1),r.rslt}}function Qt(e,t,n,r){if(void 0===r&&(r=!0),e&&t&&n){e=function a(e,t,n){var r=null;return e&&(p.call(e,t)?r=e:n&&(r=a(ke(e),t,!1))),r}(e,t,r);if(e){var o,r=e[t];if(typeof r===i)return(o=r[Gt])||((r=Zt(o={i:0,n:t,f:r,h:[]}))[Gt]=o,e[t]=r),t={id:o.i,cbks:n,rm:function(){var n=this.id;Jt(o.h,function(e,t){return e.id===n&&(o.h.splice(t,1),1)})}},o.i++,o.h.push(t),t}}return null}function en(e,t,n){var r,o,a=t.length,i=(e=e,(t=t)&&150<(t=Oe(t.toString())).length&&(o=t.substring(0,150),e&&e.throwInternal(2,W.NameTooLong,"name is too long. It has been truncated to 150 characters.",{name:t},!0)),o||t);if(i.length!==a){for(var u=0,s=i;n[s]!==undefined;)u++,s=i.substring(0,147)+(r=void 0,(r="00"+u).substr(r.length-3));i=s}return i}function C(e,t,n){var r;return void 0===n&&(n=1024),t&&(n=n||1024,(t=Oe(t)).toString().length>n&&(r=t.toString().substring(0,n),e&&e.throwInternal(2,W.StringValueTooLong,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t}function tn(e,t){var n,r=W.UrlTooLong;return t&&2048<(t=Oe(t)).length&&(n=t.substring(0,2048),e&&e.throwInternal(2,r,"input is too long, it has been truncated to 2048 characters.",{data:t},!0)),n||t}function nn(r,e){var o;return e&&(o={},U(e,function(e,t){if(He(t)&&ut())try{t=st().stringify(t)}catch(n){r&&r.throwInternal(2,W.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:n},!0)}t=C(r,t,8192),e=en(r,e,o),o[e]=t}),e=o),e}var rn="";function on(e){var t=rn+Math.floor((e=Math.round(e=isNaN(e)||e<0?0:e))/1e3)%60,n=rn+Math.floor(e/6e4)%60,r=rn+Math.floor(e/36e5)%24,o=Math.floor(e/864e5),e=1===(e=rn+e%1e3).length?"00"+e:2===e.length?"0"+e:e,t=t.length<2?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r;return(0<o?o+".":rn)+r+":"+n+":"+t+"."+e}var an="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",un="iKey",sn=ot()||{},cn=0,ln=[null,null,null,null,null];function dn(n){var e=cn,t=ln,r=t[e];return sn.createElement?t[e]||(r=t[e]=sn.createElement("a")):r={host:function(){var e=fn(n,!0)||"";if(e){var t=e.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(null!=t&&3<t.length&&B(t[2])&&0<t[2].length)return t[2]+(t[3]||"")}return e}()},r.href=n,++e>=t.length&&(e=0),cn=e,r}function fn(e,t){var n=null;return e&&null!=(e=e.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i))&&2<e.length&&B(e[2])&&0<e[2].length&&(n=e[2]||"",t&&2<e.length&&(t=(e[1]||"").toLowerCase(),e=e[3]||"",n+=e="http"==t&&":80"===e||"https"==t&&":443"===e?"":e)),n}var pn=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],G={correlationIdPrefix:"cid-v1:",canIncludeCorrelationHeader:function(e,t,n){if(!t||e&&e.disableCorrelationHeaders)return!1;if(e&&e.correlationHeaderExcludePatterns)for(var r=0;r<e.correlationHeaderExcludePatterns.length;r++)if(e.correlationHeaderExcludePatterns[r].test(t))return!1;var o=dn(t).host.toLowerCase();if(o&&(~o.indexOf(":443")||~o.indexOf(":80"))&&(o=(fn(t,!0)||"").toLowerCase()),(!e||!e.enableCorsCorrelation)&&o&&o!==n)return!1;var a,n=e&&e.correlationHeaderDomains;if(n&&(z(n,function(e){e=RegExp(e.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));a=a||e.test(o)}),!a))return!1;var i=e&&e.correlationHeaderExcludedDomains;if(!i||0===i.length)return!0;for(r=0;r<i.length;r++)if(RegExp(i[r].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")).test(o))return!1;return o&&0<o.length},getCorrelationContext:function(e){if(e){e=G.getCorrelationContextValue(e,"appId");if(e&&e!==G.correlationIdPrefix)return e}},getCorrelationContextValue:function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var o=n[r].split("=");if(2===o.length&&o[0]===t)return o[1]}}};function gn(){var e=it();if(e&&e.now&&e.timing){e=e.now()+e.timing.navigationStart;if(0<e)return e}return Ke()}function hn(e,t){return 0===e||0===t||_(e)||_(t)?null:t-e}F(xn,vn=function(){this.ver=2,this.success=!0,this.properties={},this.measurements={}}),xn.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",xn.dataType="RemoteDependencyData";var vn,mn=xn;function xn(e,t,n,r,o,a,i,u,s,c,l,d){void 0===s&&(s="Ajax");var f,p,g,h,v=vn.call(this)||this,n=(v.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0},v.id=t,v.duration=on(o),v.success=a,v.resultCode=i+"",v.type=C(e,s),t=e,o=u,s=i=a=r,i=(u=n)&&0<u.length?(p=(n=dn(u)).host,i||(null!=n.pathname?("/"!=((f=0===n.pathname.length?"/":n.pathname)[0]||"")&&(f="/"+f),s=n.pathname,C(t,o?o+" "+f:f)):C(t,u))):p=a,{target:p,name:i,data:s});return v.data=tn(e,r)||n.data,v.target=C(e,n.target),c&&(v.target="".concat(v.target," | ").concat(c)),v.name=C(e,n.name),v.properties=nn(e,l),v.measurements=(g=e,(o=d)&&(h={},U(o,function(e,t){e=en(g,e,h),h[e]=t}),o=h),o),v}Cn.create=function(e,t,n,r,o,a){if(n=C(r,n)||"not_specified",_(e)||_(t)||_(n))throw Error("Input doesn't contain all required fields");var r="",i=(e[un]&&(r=e[un],delete e[un]),{name:n,time:function(e){if(e){if(Se)return e[xe]();var t;return e&&e.getUTCFullYear?(t=function(e){e=""+e;return 1===e.length?"0"+e:e},e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"):void 0}}(new Date),iKey:r,ext:a||{},tags:[],data:{},baseType:t,baseData:e});return _(o)||U(o,function(e,t){i.data[e]=t}),i};var yn=Cn;function Cn(){}var T="properties";function Tn(e,t,n){t=e[t],n=e[n];return t&&n?hn(t,n):0}function b(e,t,n,r,o){n=Tn(n,r,o);return n?I(e,t,on(n)):0}function I(e,t,n){var r="ajaxPerf",o=0;return e&&t&&n&&((e[r]=e[r]||{})[t]=n,o=1),o}var bn=function(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1},In=function Nn(e,t,n){var r=this,o=n,y="responseText";r.perfMark=null,r.completed=!1,r.requestHeadersSize=null,r.requestHeaders=null,r.responseReceivingDuration=null,r.callbackDuration=null,r.ajaxTotalDuration=null,r.aborted=0,r.pageUrl=null,r.requestUrl=null,r.requestSize=0,r.method=null,r.status=null,r.requestSentTime=null,r.responseStartedTime=null,r.responseFinishedTime=null,r.callbackFinishedTime=null,r.endTime=null,r.xhrMonitoringState=new bn,r.clientFailure=0,r.traceID=e,r.spanID=t,x(Nn,r,function(x){x.getAbsoluteUrl=function(){return x.requestUrl?(e=dn(x.requestUrl))?e.href:void 0:null;var e},x.getPathName=function(){return x.requestUrl?tn(o,(e=x.method,t=x.requestUrl,e?e.toUpperCase()+" "+t:t)):null;var e,t},x.CreateTrackItem=function(e,t,n){if(x.ajaxTotalDuration=Math.round(1e3*hn(x.requestSentTime,x.responseFinishedTime))/1e3,x.ajaxTotalDuration<0)return null;(e={id:"|"+x.traceID+"."+x.spanID,target:x.getAbsoluteUrl(),name:x.getPathName(),type:e,startTime:null,duration:x.ajaxTotalDuration,success:200<=+x.status&&+x.status<400,responseCode:+x.status,method:x.method})[T]={HttpMethod:x.method};var r,o,a,i,u,s,c,l,d,f,p,g,h,v,m;return x.requestSentTime&&(e.startTime=new Date,e.startTime.setTime(x.requestSentTime)),i=(r=x).perfTiming,u=(o=e)[T]||{},s=0,h="duration",v="startTime",c="connectEnd",l="requestStart",m="responseEnd",d="transferSize",f="encodedBodySize",p="decodedBodySize",g="serverTiming",i?(s=(s=(s=(s=(s=(s=(s|=b(u,"End",i,"redirectStart","End"))|b(u,"domainLookup",i,"domainLookupStart","domainLookupEnd"))|b(u,"connect",i,"connectStart",c))|b(u,"request",i,l,"requestEnd"))|b(u,"response",i,"responseStart",m))|b(u,"networkConnect",i,v,c))|b(u,"sentRequest",i,l,m),s=(s|=I(u,h,c=i[h]||Tn(i,v,m)||0))|I(u,"perfTotal",c),(l=i[g])&&(a={},z(l,function(e,t){var t=Pe(e.name||""+t),n=a[t]||{};U(e,function(e,t){!("name"!==e&&B(t)||"number"==typeof t)||!(t=n[e]?n[e]+";"+t:t)&&B(t)||(n[e]=t)}),a[t]=n}),s|=I(u,g,a)),s=(s=(s|=I(u,d,i[d]))|I(u,f,i[f]))|I(u,p,i[p])):r.perfMark&&(s|=I(u,"missing",r.perfAttempts)),s&&(o[T]=u),t&&0<Be(x.requestHeaders).length&&(e[T]=e[T]||{},e[T].requestHeaders=x.requestHeaders),n&&(h=n())&&((v=h.correlationContext)&&(e.correlationContext=v),h.headerMap&&0<Be(h.headerMap).length&&(e[T]=e[T]||{},e[T].responseHeaders=h.headerMap),x.errorStatusText&&400<=x.status&&(m=h.type,e[T]=e[T]||{},""!==m&&"text"!==m||(e[T][y]=h[y]?h.statusText+" - "+h[y]:h.statusText),"json"===m&&(e[T][y]=h.response?h.statusText+" - "+JSON.stringify(h.response):h.statusText))),e}})},wn=(r.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},r.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},r.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},r.DEFAULT_TRACE_FLAG="01",r.DEFAULT_VERSION="00",r);function r(e,t){var n=this;n.traceFlag=r.DEFAULT_TRACE_FLAG,n.version=r.DEFAULT_VERSION,e&&r.isValidTraceId(e)?n.traceId=e:n.traceId=X(),t&&r.isValidSpanId(t)?n.spanId=t:n.spanId=X().substr(0,16)}var Sn="ai.ajxmn.",Mn="diagLog",$="ajaxData",qn="throwInternal",An="fetch",Fn=0;function Rn(e){var t=!1,n=(function(){var e=!1;try{e=!!c(tt)}catch(t){}return e}()&&(t=!(_(n=XMLHttpRequest[N])||_(n.open)||_(n.send)||_(n.abort))),function(e){var t=((e=(e=void 0===e?null:e)?e:(t=at()||{})?(t.userAgent||f).toLowerCase():f)||f).toLowerCase();if(Ne(t,Qe))return e=ot()||{},Math.max(parseInt(t.split(Qe)[1]),e[Ge]||0);if(Ne(t,et)){e=parseInt(t.split(et)[1]);if(e)return e+4}return null}());if(t=!(n&&n<9)&&t)try{(new XMLHttpRequest)[$]={};var r=XMLHttpRequest[N].open;XMLHttpRequest[N].open=r}catch(o){t=!1,En(e,W.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:K(o)})}return t}function Dn(e){var t="";try{_(e)||_(e[$])||_(e[$].requestUrl)||(t+="(url: '"+e[$].requestUrl+"')")}catch(n){}return t}function En(e,t,n,r,o){e[Mn]()[qn](Wt.CRITICAL,t,n,r,o)}function J(e,t,n,r,o){e[Mn]()[qn](Wt.WARNING,t,n,r,o)}function Ln(t,n,r){return function(e){En(t,n,r,{ajaxDiagnosticsMessage:Dn(e.inst),exception:K(e.err)})}}function kn(e,t){return e&&t?e.indexOf(t):-1}F(Y,jn=e),Y.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,excludeRequestFromAutoTrackingPatterns:undefined,disableCorrelationHeaders:!1,distributedTracingMode:1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,correlationHeaderExcludePatterns:undefined,appId:undefined,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1,enableAjaxPerfTracking:!1,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25,ignoreHeaders:["Authorization","X-API-Key","WWW-Authenticate"],addRequestContext:undefined}},Y.getEmptyConfig=function(){var t=this.getDefaultConfig();return U(t,function(e){t[e]=undefined}),t},Y.prototype.processTelemetry=function(e,t){this.processNext(e,t)},Y.identifier="AjaxDependencyPlugin";var jn,Me=Y;function Y(){var C,T,b,I,w,S,M,q,e=jn.call(this)||this,A=(e.identifier=Y.identifier,e.priority=120,"trackDependencyDataInternal"),t=typeof location===u&&location?location:c("location"),F=!1,R=!1,D=t&&t.host&&t.host.toLowerCase(),E=Y.getEmptyConfig(),L=!1,r=0,k=!1,j=0,H=!1,P={};return x(Y,e,function(l,u){var s=u._addHook;function d(t){var n=!0;return(t||E.ignoreHeaders)&&z(E.ignoreHeaders,function(e){if(e.toLowerCase()==t.toLowerCase())return n=!1,-1}),n}function f(e,t,n){s(e?Qt(e[N],t,n,!1):null)}function p(e,t,n){var r=!1,o=((B(t)?t:(t||{}).url||"")||"").toLowerCase();if(z(w,function(e){var t=e;B(e)&&(t=RegExp(e)),r=r||t.test(o)}),r)return r;var a=kn(o,"?"),i=kn(o,"#");return-1!==(a=-1===a||-1!==i&&i<a?i:a)&&(o=o.substring(0,a)),_(e)?_(t)||(r="object"==typeof t&&!0===t[an]||!!n&&!0===n[an]):r=!0===e[an]||!0===o[an],(r=!(r||!o||(i=o,!~pn.indexOf(i.toLowerCase())))||r)?P[o]||(P[o]=1):P[o]&&(r=!0),r}function g(e,t){var n=!0,r=R;return _(e)||(n=!0===t||!_(e[$])),r&&n}function h(n){n[$].xhrMonitoringState.stateChangeAttached=function(e,t,n,r){void 0===r&&(r=!1);var o,a,i,u,s,c,l,d,f=!1;if(e)try{s="readystatechange",(c=n)&&(l="",V(c)?(l="",z(c,function(e){(e=Xt(e))&&("."!==e[0]&&(e="."+e),l+=e)})):l=Xt(c),l&&(s=(s||"")+(l="."!==l[0]?"."+l:l)));var p,g={type:(d=Kt.exec(s)||[])[1],ns:(d[2]||"").split(".").sort().join(".")},h=g,v=t,m=r,x=!1;(u=e)&&h&&h.type&&v&&(u[Vt]?(u[Vt](h.type,v,m),x=!0):u[Ut]&&(u[Ut]("on"+h.type,v),x=!0)),(f=x)&&zt.accept(e)&&(p={guid:Bt++,evtName:g,handler:t,capture:r},o=g.type,((i=zt.get(e,"events",{},a=void 0===a||a))[o]||(i[o]=[])).push(p))}catch(y){}return f}(n,function(){try{n&&4===n.readyState&&g(n)&&((a=(o=n)[$]).responseFinishedTime=gn(),a.status=o.status,c("xmlhttprequest",a,function(){try{var e=a.CreateTrackItem("Ajax",L,function(){var e,n,t={statusText:o.statusText,headerMap:null,correlationContext:i(o),type:o.responseType,responseText:function(e){try{var t=e.responseType;if(""===t||"text"===t)return e.responseText}catch(n){}return null}(o),response:o.response};return H&&(e=o.getAllResponseHeaders())&&(e=Oe(e).split(/[\r\n]+/),n={},z(e,function(e){var e=e.split(": "),t=e.shift(),e=e.join(": ");d(t)&&(n[t]=e)}),t.headerMap=n),t}),t=void 0;try{S&&(t=S({status:o.status,xhr:o}))}catch(n){J(l,W.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}e?(t!==undefined&&(e.properties=Q(Q({},e.properties),t)),l[A](e)):r(null,{requestSentTime:a.requestSentTime,responseFinishedTime:a.responseFinishedTime})}finally{try{o[$]=null}catch(n){}}},function(e){r(e,null)}))}catch(t){var e=K(t);e&&-1!==kn(e.toLowerCase(),"c00c023f")||En(l,W.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:Dn(n),exception:e})}function r(e,t){t=t||{};t.ajaxDiagnosticsMessage=Dn(o),e&&(t.exception=K(e)),J(l,W.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",t)}var o,a},M)}function i(e){try{var t,n=e.getAllResponseHeaders();if(null!==n&&-1!==kn(n.toLowerCase(),"request-context"))return t=e.getResponseHeader("Request-Context"),G.getCorrelationContext(t)}catch(r){J(l,W.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:Dn(e),exception:K(r)})}}function v(e,t){var n;t.requestUrl&&I&&k&&(n=it())&&O(n.mark)&&(e=I+e+"#"+ ++Fn,n.mark(e),(e=n.getEntriesByName(e))&&1===e.length&&(t.perfMark=e[0]))}function c(a,i,u,s){var c=i.perfMark,l=it(),d=E.maxAjaxPerfLookupAttempts,f=E.ajaxPerfLookupDelay,p=i.requestUrl,g=0;!function h(){try{if(l&&c){g++;for(var e=null,t=l.getEntries(),n=t.length-1;0<=n;n--){var r=t[n];if(r){if("resource"===r.entryType)r.initiatorType!==a||-1===kn(r.name,p)&&-1===kn(p,r.name)||(e=r);else if("mark"===r.entryType&&r.name===c.name){i.perfTiming=e;break}if(r.startTime<c.startTime-1e3)break}}}!c||i.perfTiming||d<=g||!1===i["async"]?(c&&O(l.clearMarks)&&l.clearMarks(c.name),i.perfAttempts=g,u()):setTimeout(h,f)}catch(o){s(o)}}()}function m(e){var t="";try{_(e)||(t+="(url: '".concat("string"==typeof e?e:e.url,"')"))}catch(n){En(l,W.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:K(n)})}return t}function x(e,r,o,a,i,u){function s(e,t,n){n=n||{};n.fetchDiagnosticsMessage=m(o),t&&(n.exception=K(t)),J(l,e,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",n)}i&&(i.responseFinishedTime=gn(),i.status=r,c("fetch",i,function(){var e,t=i.CreateTrackItem("Fetch",L,u);try{S&&(e=S({status:r,request:o,response:a}))}catch(n){J(l,W.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}t?(e!==undefined&&(t.properties=Q(Q({},t.properties),e)),l[A](t)):s(W.FailedMonitorAjaxDur,null,{requestSentTime:i.requestSentTime,responseFinishedTime:i.responseFinishedTime})},function(e){s(W.FailedMonitorAjaxGetCorrelationHeader,e,null)}))}function y(e){if(e&&e.headers)try{var t=e.headers.get("Request-Context");return G.getCorrelationContext(t)}catch(n){J(l,W.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:m(e),exception:K(n)})}}l.initialize=function(e,t,n,r){if(!l.isInitialized()){u.initialize(e,t,n,r);var o=l._getTelCtx(),r=(U(Y.getDefaultConfig(),function(e,t){E[e]=o.getConfig(Y.identifier,e,t)}),r=At("ajax"),t=(t=t&&t.evtNamespace&&t.evtNamespace())?V(t)?[r].concat(t):[r,t]:r,M=t,E.distributedTracingMode);if(L=E.enableRequestHeaderTracking,q=E.enableAjaxErrorStatusText,k=E.enableAjaxPerfTracking,j=E.maxAjaxCallsPerView,H=E.enableResponseHeaderTracking,w=E.excludeRequestFromAutoTrackingPatterns,S=E.addRequestContext,b=0===r||1===r,T=1===r||2===r,k&&(t=e.instrumentationKey||"unkwn",I=5<t.length?Sn+t.substring(t.length-5)+".":Sn+t+"."),!1===E.disableAjaxTracking&&Rn(l)&&!R&&(f(XMLHttpRequest,"open",{req:function(e,t,n,r){var o,a,e=e.inst,i=e[$];!p(e,n)&&g(e,!0)&&(i&&i.xhrMonitoringState.openDone||(i=e,t=t,n=n,r=r,a=C&&C.telemetryTrace&&C.telemetryTrace.traceID||X(),o=X().substr(0,16),(a=new In(a,o,l[Mn]())).method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,a.requestHeaders={},a["async"]=r,a.errorStatusText=q,i[$]=a),h(e))},hkErr:Ln(l,W.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),f(XMLHttpRequest,"send",{req:function(e,t){var e=e.inst,n=e[$];g(e)&&!n.xhrMonitoringState.sendDone&&(v("xhr",n),n.requestSentTime=gn(),l.includeCorrelationHeaders(n,undefined,undefined,e),n.xhrMonitoringState.sendDone=!0)},hkErr:Ln(l,W.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),f(XMLHttpRequest,"abort",{req:function(e){var e=e.inst,t=e[$];g(e)&&!t.xhrMonitoringState.abortDone&&(t.aborted=1,t.xhrMonitoringState.abortDone=!0)},hkErr:Ln(l,W.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),L&&f(XMLHttpRequest,"setRequestHeader",{req:function(e,t,n){e=e.inst;g(e)&&d(t)&&(e[$].requestHeaders[t]=n)},hkErr:Ln(l,W.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),R=!0),(e=!(r=Z())||_(r.Request)||_(r.Request[N])||_(r[An])?null:r[An])&&(t=Z(),c=e.polyfill,!1===E.disableFetchTracking?(s(Qt(t,An,{req:function(e,t,n){var r,o,a,i,u,s;!F||p(null,t,n)||c&&R||(r=e.ctx(),o=t,a=n,i=C&&C.telemetryTrace&&C.telemetryTrace.traceID||X(),u=X().substr(0,16),(i=new In(i,u,l[Mn]())).requestSentTime=gn(),i.errorStatusText=q,o instanceof Request?i.requestUrl=o?o.url:"":i.requestUrl=o,u="GET",a&&a.method?u=a.method:o&&o instanceof Request&&(u=o.method),i.method=u,s={},L&&new Headers((a?a.headers:0)||o instanceof Request&&o.headers||{}).forEach(function(e,t){d(t)&&(s[t]=e)}),i.requestHeaders=s,v("fetch",i),u=i,(a=l.includeCorrelationHeaders(u,t,n))!==n&&e.set(1,a),r.data=u)},rsp:function(e,n){var r=e.ctx().data;r&&(e.rslt=e.rslt.then(function(t){return x(0,(t||{}).status,n,t,r,function(){var n,e={statusText:t.statusText,headerMap:null,correlationContext:y(t)};return H&&(n={},t.headers.forEach(function(e,t){d(t)&&(n[t]=e)}),e.headerMap=n),e}),t})["catch"](function(e){throw x(0,0,n,null,r,null,e.message),e}))},hkErr:Ln(l,W.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),F=!0):c&&s(Qt(t,An,{req:function(e,t,n){p(null,t,n)}})),c&&(t[An].polyfill=c)),0<n.length&&n){for(var a=void 0,i=0;!a&&i<n.length;)n[i]&&"AppInsightsPropertiesPlugin"===n[i].identifier&&(a=n[i]),i++;a&&(C=a.context)}}var c},l._doTeardown=function(){R=F=!1},l.trackDependencyData=function(e,t){l[A](e,t)},l.includeCorrelationHeaders=function(e,t,n,r){var o,a,i,u=l._currentWindowHost||D;return t?(G.canIncludeCorrelationHeader(E,e.getAbsoluteUrl(),u)&&((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),b&&(o="|"+e.traceID+"."+e.spanID,n.headers.set("Request-Id",o),L&&(e.requestHeaders["Request-Id"]=o)),(a=E.appId||C&&C.appId())&&(n.headers.set("Request-Context","appId=cid-v1:"+a),L&&(e.requestHeaders["Request-Context"]="appId=cid-v1:"+a)),T&&(i=new wn(e.traceID,e.spanID),n.headers.set("traceparent",i.toString()),L&&(e.requestHeaders.traceparent=i.toString()))),n):r?(G.canIncludeCorrelationHeader(E,e.getAbsoluteUrl(),u)&&(b&&(o="|"+e.traceID+"."+e.spanID,r.setRequestHeader("Request-Id",o),L&&(e.requestHeaders["Request-Id"]=o)),(a=E.appId||C&&C.appId())&&(r.setRequestHeader("Request-Context","appId=cid-v1:"+a),L&&(e.requestHeaders["Request-Context"]="appId=cid-v1:"+a)),T&&(i=new wn(e.traceID,e.spanID),r.setRequestHeader("traceparent",i.toString()),L&&(e.requestHeaders.traceparent=i.toString()))),r):undefined},l[A]=function(e,t,n){-1===j||r<j?(2!==E.distributedTracingMode&&1!==E.distributedTracingMode||"string"!=typeof e.id||"."===e.id[e.id.length-1]||(e.id+="."),_(e.startTime)&&(e.startTime=new Date),e=yn.create(e,mn.dataType,mn.envelopeType,l[Mn](),t,n),l.core.track(e)):r===j&&En(l,W.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0),++r}}),e}a.AjaxPlugin=Me,a.ajaxRecord=In;be=a,M="__esModule",e={value:!0},Me=Object.defineProperty;if(Me)try{return void Me(be,M,e)}catch(_n){}typeof e.value!==undefined&&(be[M]=e.value)};"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}));