@microsoft/applicationinsights-react-js 3.2.1 → 3.2.2-nightly.2111-01

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 - React Plugin, 3.2.1
2
+ * Application Insights JavaScript SDK - React Plugin, 3.2.2-nightly.2111-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  var t=this,e=function(t,a){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function n(i){if(i&&i.__esModule)return i;var t,n=(t=Object.create)?t(null):{};return i&&Object.keys(i).forEach(function(t){var e;"default"!==t&&(e=(e=Object.getOwnPropertyDescriptor)?e(i,t):undefined,function(t,e,n){var r=Object.defineProperty;if(r)try{return r(t,e,n)}catch(i){}n&&typeof n.value!==undefined&&(t[e]=n.value)}(n,t,e.get?e:{enumerable:!0,get:function(){return i[t]}}))}),n["default"]=i,n}var s=n(a),r=e(a),l="function",d="object",i="undefined",o="prototype",u="hasOwnProperty",c=Object,f=c[o],p=c.assign,g=c.create,m=c.defineProperty,v=f[u];function h(){return typeof globalThis!==i&&globalThis?globalThis:typeof self!==i&&self?self:typeof window!==i&&window?window:typeof global!==i&&global?global:null}function y(t){throw new TypeError(t)}function T(t){if(g)return g(t);if(null==t)return{};var e=typeof t;function n(){}return e!==d&&e!==l&&y("Object prototype may only be an Object:"+t),n[o]=t,new n}(h()||{}).Symbol,(h()||{}).Reflect;var C=p||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])f[u].call(e,i)&&(t[i]=e[i]);return t},x=function(t,e){return(x=c.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e[u](n)&&(t[n]=e[n])})(t,e)};function I(t,e){function n(){this.constructor=t}typeof e!==l&&null!==e&&y("Class extends value "+e+" is not a constructor or null"),x(t,e),t[o]=null===e?T(e):(n[o]=e[o],new n)}var w,A="constructor",_="prototype",b="function",S="_dynInstFuncs",E="_isDynProxy",k="_dynClass",P="_dynInstChk",M=P,N="_dfOpts",F="_unknown_",L="__proto__",R="useBaseInst",O="setInstFuncs",j=Object,D=j.getPrototypeOf,U=0;function B(t,e){return t&&j[_].hasOwnProperty.call(t,e)}function V(t){return t&&(t===j[_]||t===Array[_])}function z(t){return V(t)||t===Function[_]}function K(t){if(t){if(D)return D(t);if(t=t[L]||t[_]||(t[A]?t[A][_]:null))return t}return null}function W(t,e){var n=[],r=j.getOwnPropertyNames;if(r)n=r(t);else for(var i in t)"string"==typeof i&&B(t,i)&&n.push(i);if(n&&0<n.length)for(var o=0;o<n.length;o++)e(n[o])}function G(t,e,n){return e!==A&&typeof t[e]===b&&(n||B(t,e))}function H(t){throw new TypeError("DynamicProto: "+t)}function q(t,e){for(var n=t.length-1;0<=n;n--)if(t[n]===e)return 1}function J(t,e){return B(t,_)?t.name||e||F:((t||{})[A]||{}).name||e||F}function X(t,r,e,n){B(t,_)||H("theClass is an invalid class definition.");var i=t[_];!function(t){if(D)for(var e=[],n=K(r);n&&!z(n)&&!q(e,n);){if(n===t)return 1;e.push(n),n=K(n)}}(i)&&H("["+J(t)+"] is not in class hierarchy of ["+J(r)+"]");var o=null;B(i,k)?o=i[k]:(o="_dynCls$"+J(t,"_")+"$"+U,U++,i[k]=o);var a=X[N],s=!!a[R];s&&n&&n[R]!==undefined&&(s=!!n[R]);var l,u,c,f,p,d,t=(u={},W(l=r,function(t){!u[t]&&G(l,t,!1)&&(u[t]=l[t])}),u);e(r,function(t,e,n,o){function r(t,e,n){var r,i=e[n];return i[E]&&o&&!1!==(r=t[S]||{})[M]&&(i=(r[e[k]]||{})[n]||i),function(){return i.apply(t,arguments)}}var i={};W(n,function(t){i[t]=r(e,n,t)});for(var a=K(t),s=[];a&&!z(a)&&!q(s,a);)W(a,function(t){!i[t]&&G(a,t,!D)&&(i[t]=r(e,a,t))}),s.push(a),a=K(a);return i}(i,r,t,s)),a=!!D&&!!a[O],c=i,o=o,f=r,p=t,n=!1!==(a=a&&n?!!n[O]:a),V(c)||(a=f[S]=f[S]||{},d=a[o]=a[o]||{},!1!==a[M]&&(a[M]=!!n),W(f,function(t){var n,r,i;G(f,t,!1)&&f[t]!==p[t]&&(d[t]=f[t],delete f[t],B(c,t)&&(!c[t]||c[t][E])||(c[t]=(n=c,r=t,(i=function(){var t,e;return(function(t,e,n,r){var i=null;if(t&&B(n,k)){var o=t[S]||{};if((i=(o[n[k]]||{})[e])||H("Missing ["+e+"] "+b),!i[P]&&!1!==o[M]){for(var a=!B(t,e),s=K(t),l=[];a&&s&&!z(s)&&!q(l,s);){var u=s[e];if(u){a=u===r;break}l.push(s),s=K(s)}try{a&&(t[e]=i),i[P]=1}catch(c){o[M]=!1}}}return i}(this,r,n,i)||(typeof(e=(e=n[t=r])===i?K(n)[t]:e)!==b&&H("["+t+"] is not a "+b),e)).apply(this,arguments)})[E]=1,i)))}))}X[N]={setInstFuncs:!0,useBaseInst:!0},(Be=w=w||{})[Be.CRITICAL=1]="CRITICAL",Be[Be.WARNING=2]="WARNING";var Z={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},$="attachEvent",Q="addEventListener",Y=m;function tt(t){return f.toString.call(t)}function et(t){return t===undefined||typeof t===i}function nt(t){return null===t||et(t)}function rt(t){return!nt(t)}function it(t){return typeof t===l}function ot(t,e,n,r){void 0===r&&(r=!1);var i=!1;if(!nt(t))try{nt(t[Q])?nt(t[$])||(t[$]("on"+e,n),i=!0):(t[Q](e,n,r),i=!0)}catch(o){}return i}function at(t,e){return!(!t||!e||!~t.indexOf(e))}function st(t){return"[object Date]"===tt(t)}function lt(t){return"[object Array]"===tt(t)}function ut(t){return"[object Error]"===tt(t)}function ct(t){return"string"==typeof t}function ft(t){return"boolean"==typeof t}function pt(t,e,n){var r=t.length;try{for(var i=0;i<r&&!(i in t&&-1===e.call(n||t,t[i],i,t));i++);}catch(o){}}function dt(t,e,n){var r=t.length,n=n||0;try{for(var i=Math.max(0<=n?n:r-Math.abs(n),0);i<r;i++)if(i in t&&t[i]===e)return i}catch(o){}return-1}function gt(t){return"string"!=typeof t?t:t.replace(/^\s+|\s+$/g,"")}var mt=!{toString:null}.propertyIsEnumerable("toString"),vt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function ht(t,e,n,r){if(Y)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),Y(t,e,i),!0}catch(o){}return!1}function yt(){var t=Date;return t.now?t.now():(new t).getTime()}function Tt(t,e,n,r,i){var o=n;return t&&((o=t[e])===n||i&&!i(o)||r&&!r(n)||(t[e]=o=n)),o}function Ct(t){return!!t}var xt="window",It="navigator",wt="location",At="JSON",_t="crypto",bt="msCrypto",St="msie",Et="trident/",kt=null,Pt=null;function Mt(t){var e=h();return e&&e[t]?e[t]:t===xt&&Nt()?window:null}function Nt(){return typeof window===d&&window}function Ft(){return typeof document===d&&document?document:Mt("document")}function Lt(){return typeof navigator===d&&navigator?navigator:Mt(It)}function Rt(){return typeof JSON===d&&JSON||null!==Mt(At)}function Ot(){return Rt()?JSON||Mt(At):null}function jt(){var t=Lt();return!t||t.userAgent===Pt&&null!==kt||(t=((Pt=t.userAgent)||"").toLowerCase(),kt=at(t,St)||at(t,Et)),kt}function Dt(t){var e=Object[o].toString.call(t),n="";return"[object Error]"===e?n="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":Rt()&&(n=Ot().stringify(t)),e+n}function Ut(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function Bt(t,e){var n,r=typeof console!==i?console:Mt("console");r&&(n="log",it(r[n=r[t]?t:n])&&r[n](e))}var Vt=(zt.dataType="MessageData",zt);function zt(t,e,n,r){void 0===n&&(n=!1),this.messageId=t,this.message=(n?"AI: ":"AI (Internal): ")+t,t="",Rt()&&(t=Ot().stringify(r)),t=(e?" message:"+Ut(e):"")+(r?" props:"+Ut(t):""),this.message+=t}var Kt=function Ke(n){this.identifier="DiagnosticLogger",this.queue=[];var i=0,a={};X(Ke,this,function(o){function t(t,e){return nt(t=n[t])?e:t}nt(n)&&(n={}),o.consoleLoggingLevel=function(){return t("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return t("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return t("maxMessageLimit",25)},o.enableDebugExceptions=function(){return t("enableDebugExceptions",!1)},o.throwInternal=function(t,e,n,r,i){if(e=new Vt(e,n,i=void 0!==i&&i,r),o.enableDebugExceptions())throw e;n=t===w.CRITICAL?"errorToConsole":"warnToConsole",et(e.message)||(r=o.consoleLoggingLevel(),i?(i=+e.messageId,!a[i]&&t<=r&&(o[n](e.message),a[i]=!0)):t<=r&&o[n](e.message),o.logInternalMessage(t,e))},o.warnToConsole=function(t){Bt("warn",t)},o.errorToConsole=function(t){Bt("error",t)},o.resetInternalMessageCount=function(){i=0,a={}},o.logInternalMessage=function(t,e){var n,r;i>=o.maxInternalMessageLimit()||(n=!0,r="AITR_"+e.messageId,a[r]?n=!1:a[r]=!0,n&&(t<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++),i===o.maxInternalMessageLimit()&&(e=new Vt(Z.MessageLimitPerPVExceeded,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(e),o.warnToConsole(t))))}})},Wt=(Gt.ParentContextKey="parent",Gt.ChildrenContextKey="childEvts",Gt);function Gt(t,i,e){var n,o=this,a=!1;o.start=yt(),o.name=t,o.isAsync=e,o.isChildEvt=function(){return!1},it(i)&&(a=ht(o,"payload",function(){return!n&&it(i)&&(n=i(),i=null),n})),o.getCtx=function(t){return t?(t===Gt.ParentContextKey||t===Gt.ChildrenContextKey?o:o.ctx||{})[t]:null},o.setCtx=function(t,e){t&&(t===Gt.ParentContextKey?(o[t]||(o.isChildEvt=function(){return!0}),o[t]=e):t===Gt.ChildrenContextKey?o[t]=e:(o.ctx=o.ctx||{})[t]=e)},o.complete=function(){var t=0,e=o.getCtx(Gt.ChildrenContextKey);if(lt(e))for(var n=0;n<e.length;n++){var r=e[n];r&&(t+=r.time)}o.time=yt()-o.start,o.exTime=o.time-t,o.complete=function(){},!a&&it(i)&&(o.payload=i())}}var Ht="CoreUtils.doPerf";function qt(t,e,n,r,i){if(t){var o=t;if(o=it(o.getPerfMgr)?o.getPerfMgr():o){var a,s=void 0,t=o.getCtx(Ht);try{if(s=o.create(e(),r,i))return t&&s.setCtx&&(s.setCtx(Wt.ParentContextKey,t),t.getCtx&&t.setCtx&&((a=t.getCtx(Wt.ChildrenContextKey))||(a=[],t.setCtx(Wt.ChildrenContextKey,a)),a.push(s))),o.setCtx(Ht,s),n(s)}catch(l){s&&s.setCtx&&s.setCtx("exception",l)}finally{s&&o.fire(s),o.setCtx(Ht,t)}}}return n()}var Jt=function(i,e){var o=this,a=null,s=it(i.processTelemetry),l=it(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(t){a=t},o.processTelemetry=function(n,r){r=r||e;var t=i?i.identifier:"TelemetryPluginChain";qt(r?r.core():null,function(){return t+":processTelemetry"},function(){if(i&&s){o._hasRun=!0;try{r.setNext(a),l&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(n,r)}catch(e){var t=a&&a._hasRun;a&&t||r.diagLog().throwInternal(w.CRITICAL,Z.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+Dt(e)),a&&!t&&a.processTelemetry(n,r)}}else a&&(o._hasRun=!0,a.processTelemetry(n,r))},function(){return{item:n}},!n.sync)}};function Xt(t,e){var n=[];if(t&&0<t.length)for(var r=null,i=0;i<t.length;i++){var o=t[i];o&&it(o.processTelemetry)&&(o=new Jt(o,e),n.push(o),r&&r.setNext(o),r=o)}return 0<n.length?n[0]:null}var Zt=function We(t,i,n,e){var r,o,a,s,l=this,u=null;null!==e&&(t&&it(t.getPlugin)?u=function(t,e,n){var r=[],i=!n;if(t)for(;t;){var o=t.getPlugin();!i&&o!==n||(i=!0,r.push(o)),t=t.getNext()}return i||r.push(n),Xt(r,e)}(t,l,e||t.getPlugin()):e?(r=l,a=t,s=!1,(o=e)&&t&&(a=[],pt(t,function(t){!s&&t!==o||(s=!0,a.push(t))})),o&&!s&&(a=a||[]).push(o),u=Xt(a,r)):et(e)&&(u=Xt(t,l))),l.core=function(){return n},l.diagLog=function(){return(n||{}).logger||new Kt(i)},l.getCfg=function(){return i},l.getExtCfg=function(t,e){var n,r;return void 0===e&&(e={}),!i||(r=i.extensionConfig)&&t&&(n=r[t]),n||e},l.getConfig=function(t,e,n){var r;return void 0===n&&(n=!1),(t=l.getExtCfg(t,null))&&!nt(t[e])?r=t[e]:i&&!nt(i[e])&&(r=i[e]),nt(r)?n:r},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(t){u=t},l.processNext=function(t){var e=u;e&&(u=e.getNext(),e.processTelemetry(t,l))},l.createNew=function(t,e){return new We((t=void 0===t?null:t)||u,i,n,e)}},$t="getPlugin",p=(Qt.prototype.initialize=function(t,e,n,r){this._baseTelInit(t,e,n,r)},Qt);function Qt(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(t){return o._getTelCtx(t).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(t){a=t},o.setNextPlugin=function(t){l=t},o.processNext=function(t,e){e?e.processNext(t):l&&it(l.processTelemetry)&&l.processTelemetry(t,null)},o._getTelCtx=function(t){var e=t=void 0===t?null:t;return e||(t=s||new Zt(null,{},o.core),e=l&&l[$t]?t.createNew(null,l[$t]):t.createNew(null,l)),e},o._baseTelInit=function(t,e,n,r){t&&Tt(t,"extensionConfig",[],null,nt),!r&&e&&(r=e.getProcessTelContext().getNext());var i=l;l&&l[$t]&&(i=l[$t]()),o.core=e,s=new Zt(r,t,e,i),a=!0}}var Yt="toGMTString",te="toUTCString",ee="cookie",ne="expires",re="enabled",ie="isCookieUseDisabled",oe="disableCookiesUsage",ae="_ckMgr",se="",le=null,ue=null,ce=null,fe=Ft(),pe={},de={};function ge(t,e){var n=ve[ae]||de[ae];return n||(n=ve[ae]=ve(t,e),de[ae]=n),n}function me(t){return!t||t.isEnabled()}function ve(t,i){var e,n,u=(Tt(n=(e=t||de).cookieCfg=e.cookieCfg||{},"domain",e.cookieDomain,rt,nt),Tt(n,"path",e.cookiePath||"/",null,nt),nt(n[re])&&(t=void 0,et(e[ie])||(t=!e[ie]),et(e[oe])||(t=!e[oe]),n[re]=t),n),c=u.path||"/",f=u.domain,r=!1!==u[re],p={isEnabled:function(){var t=r&&he(i),e=de[ae];return t&&e&&p!==e?me(e):t},setEnabled:function(t){r=!1!==t},set:function(t,e,n,r,i){var o,a,s,l=!1;return me(p)&&(o={},-1!=(s=(a=gt(e||se)).indexOf(";"))&&(a=gt(e.substring(0,s)),o=ye(e.substring(1+s))),Tt(o,"domain",r||f,Ct,et),nt(n)||(s=jt(),!et(o[ne])||0<(e=yt()+1e3*n)&&((r=new Date).setTime(e),Tt(o,ne,Te(r,s?Yt:te)||Te(r,s?Yt:te)||se,Ct)),s||Tt(o,"max-age",se+n,null,et)),(n=typeof location===d&&location?location:Mt(wt))&&"https:"===n.protocol&&(Tt(o,"secure",null,null,et),(ue=null===ue?!(ct(n=(Lt()||{}).userAgent)&&(at(n,"CPU iPhone OS 12")||at(n,"iPad; CPU OS 12")||at(n,"Macintosh; Intel Mac OS X 10_14")&&at(n,"Version/")&&at(n,"Safari")||at(n,"Macintosh; Intel Mac OS X 10_14")&&function(t,e){if(t){var n=t.length;if(t===e)return 1;if(40<=n){for(var r=n-1,i=39;0<=i;i--){if(t[r]!=e[i])return;r--}return 1}}}(n,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||at(n,"Chrome/5")||at(n,"Chrome/6")||at(n,"UnrealEngine")&&!at(n,"Chrome")||at(n,"UCBrowser/12")||at(n,"UCBrowser/11"))):ue)&&Tt(o,"SameSite","None",null,et)),Tt(o,"path",i||c,null,et),(u.setCookie||xe)(t,Ce(a,o)),l=!0),l},get:function(t){var e=se;return me(p)?(u.getCookie||function(t){var e,n=se;return fe&&(e=fe[ee]||se,ce!==e&&(pe=ye(e),ce=e),n=gt(pe[t]||se)),n})(t):e},del:function(t,e){return!!me(p)&&p.purge(t,e)},purge:function(t,e){var n,r=!1;return he(i)&&((n={}).path=e||"/",n[ne]="Thu, 01 Jan 1970 00:00:01 GMT",jt()||(n["max-age"]="0"),(u.delCookie||xe)(t,Ce(se,n)),r=!0),r}};return p[ae]=p}function he(t){if(null===le){le=!1;try{le=(fe||{})[ee]!==undefined}catch(n){t&&t.throwInternal(w.WARNING,Z.CannotAccessCookie,"Cannot access document.cookie - "+(ut(e=n)?e.name:""),{exception:Dt(n)})}}var e;return le}function ye(t){var n={};return t&&t.length&&pt(gt(t).split(";"),function(t){var e;(t=gt(t||se))&&(-1==(e=t.indexOf("="))?n[t]=null:n[gt(t.substring(0,e))]=gt(t.substring(1+e)))}),n}function Te(t,e){return it(t[e])?t[e]():null}function Ce(t,e){var r=t||se;return function(t){if(t)for(var e in t)v.call(t,e)&&(n=e,e=t[e],r+="; "+n+(nt(e)?se:"="+e));var n}(e),r}function xe(t,e){fe&&(fe[ee]=t+"="+e)}var Ie=4294967296,we=4294967295,Ae=!1,_e=123456789,be=987654321;function Se(t){t<0&&(t>>>=0),_e=123456789+t&we,be=987654321-t&we,Ae=!0}function Ee(){try{var t=2147483647&yt();Se((Math.random()*Ie^t)+t)}catch(e){}}function ke(t){return 0<t?Math.floor(Pe()/we*(t+1))>>>0:0}function Pe(t){var e=(e=Mt(_t)||Mt(bt))&&e.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]&we:jt()?(Ae||Ee(),Me()&we):Math.floor(Ie*Math.random()|0);return t||(e>>>=0),e}function Me(t){var e=((be=36969*(65535&be)+(be>>16)&we)<<16)+(65535&(_e=18e3*(65535&_e)+(_e>>16)&we))>>>0&we|0;return t||(e>>>=0),e}var Ne,Fe,Le=null,Re={_canUseCookies:undefined,isTypeof:function(t,e){return typeof t===e},isUndefined:et,isNullOrUndefined:nt,hasOwnProperty:function(t,e){return t&&v.call(t,e)},isFunction:it,isObject:function(t){return typeof t===d},isDate:st,isArray:lt,isError:ut,isString:ct,isNumber:function(t){return"number"==typeof t},isBoolean:ft,toISOString:function(t){if(st(t)){var e=function(t){return 1===(t=""+t).length?"0"+t:t};return t.getUTCFullYear()+"-"+e(1+t.getUTCMonth())+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+(""+(t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},arrForEach:pt,arrIndexOf:dt,arrMap:function(t,e,n){var r=t.length,i=n||t,o=Array(r);try{for(var a=0;a<r;a++)a in t&&(o[a]=e.call(i,t[a],t))}catch(s){}return o},arrReduce:function(t,e,n){var r,i=t.length,o=0;if(3<=arguments.length)r=n;else{for(;o<i&&!(o in t);)o++;r=t[o++]}for(;o<i;)o in t&&(r=e(r,t[o],o,t)),o++;return r},strTrim:gt,objCreate:T,objKeys:function(t){var e=typeof t;e===l||e===d&&null!==t||y("objKeys called on non-object");var n,r=[];for(n in t)t&&v.call(t,n)&&r.push(n);if(mt)for(var i=vt.length,o=0;o<i;o++)t&&v.call(t,vt[o])&&r.push(vt[o]);return r},objDefineAccessors:ht,addEventHandler:function(t,e){var n=!1,r=Nt()?window:Mt(xt);return r&&(n=ot(r,t,e),n=ot(r.body,t,e)||n),(r=Ft())&&ot(r,t,e)||n},dateNow:yt,isIE:jt,disableCookies:function(){var t=ge(t,void 0),e=Re._canUseCookies;null===Le&&(Le=[],Ne=e,ht(Re,"_canUseCookies",function(){return Ne},function(e){Ne=e,pt(Le,function(t){t.setEnabled(e)})})),-1===dt(Le,t)&&Le.push(t),ft(e)&&t.setEnabled(e),ft(Ne)&&t.setEnabled(Ne),t.setEnabled(!1)},newGuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Oe,function(t){var e=0|ke(15);return("x"===t?e:3&e|8).toString(16)})},perfNow:function(){var t=Mt("performance");return t&&t.now?t.now():yt()},newId:function(t){void 0===t&&(t=22);for(var e=Pe()>>>0,n=0,r="";r.length<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&e]||"",e>>>=6,5==++n&&(e=(Pe()<<2&4294967295|3&e)>>>0,n=0);return r},randomValue:ke,random32:Pe,mwcRandomSeed:function(t){t?Se(t):Ee()},mwcRandom32:Me,generateW3CId:function(){for(var t,e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=e[15&(t=Pe())]+e[t>>4&15]+e[t>>8&15]+e[t>>12&15]+e[t>>16&15]+e[t>>20&15]+e[t>>24&15]+e[t>>28&15];var i=e[8+(3&Pe())|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)}},Oe=/[xy]/g;function je(){var t=null!==Fe&&Fe.apply(this,arguments)||this;return t.priority=185,t.identifier="ReactPlugin",t}var De,Ue,Be=(I(je,Fe=p),je.prototype.initialize=function(t,e,n,r){var i=this;Fe.prototype.initialize.call(this,t,e,n,r),this._extensionConfig=t.extensionConfig&&t.extensionConfig[this.identifier]?t.extensionConfig[this.identifier]:{history:null},pt(n,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(i._analyticsPlugin=t)}),this._extensionConfig.history&&(this.addHistoryListener(this._extensionConfig.history),n={uri:this._extensionConfig.history.location.pathname},this.trackPageView(n))},je.prototype.getCookieMgr=function(){return(e=(t=this.core)?t.getCookieMgr():e)||ge(void 0,(t||{}).logger);var t,e},je.prototype.getAppInsights=function(){return this._analyticsPlugin},je.prototype.processTelemetry=function(t,e){this.processNext(t,e)},je.prototype.trackMetric=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackMetric(t,e):this.diagLog().throwInternal(w.CRITICAL,Z.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},je.prototype.trackPageView=function(t){this._analyticsPlugin?this._analyticsPlugin.trackPageView(t):this.diagLog().throwInternal(w.CRITICAL,Z.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},je.prototype.trackEvent=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackEvent(t,e):this.diagLog().throwInternal(w.CRITICAL,Z.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},je.prototype.trackException=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackException(t,e):this.diagLog().throwInternal(w.CRITICAL,Z.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},je.prototype.trackTrace=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackTrace(t,e):this.diagLog().throwInternal(w.CRITICAL,Z.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},je.prototype.addHistoryListener=function(t){var n=this;t.listen(function(e,t){setTimeout(function(){var t={uri:e.pathname};n.trackPageView(t)},500)})},je);function Ve(){var t=null!==Ue&&Ue.apply(this,arguments)||this;return t.state={hasError:!1},t}(m=De={})[m.Verbose=0]="Verbose",m[m.Information=1]="Information",m[m.Warning=2]="Warning",m[m.Error=3]="Error",m[m.Critical=4]="Critical";var p=(I(Ve,Ue=r["default"].Component),Ve.prototype.componentDidCatch=function(t,e){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:De.Error,properties:e})},Ve.prototype.render=function(){if(this.state.hasError){var t=this.props.onError;return r["default"].createElement(t)}return this.props.children},Ve),ze=a.createContext(undefined),m=function(n,r){var i=a.useRef({hookTimestamp:yt(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=i.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&yt()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=yt(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t=i.current;if(0===t.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==t.firstActiveTimestamp&&(t=(yt()-t.firstActiveTimestamp-t.totalIdleTime-t.idleCount*t.idleTimeout)/1e3,n.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},{"Component Name":r}))}},[]),function(){var t,e=i.current;0===e.firstActiveTimestamp?(e.firstActiveTimestamp=yt(),e.lastActiveTimestamp=e.firstActiveTimestamp):e.lastActiveTimestamp=yt(),0<e.idleStartTimestamp&&(t=e.lastActiveTimestamp-e.idleStartTimestamp,e.totalIdleTime+=t,e.idleStartTimestamp=0)}};t.AppInsightsContext=ze,t.AppInsightsErrorBoundary=p,t.ReactPlugin=Be,t.useAppInsightsContext=function(){return a.useContext(ze)},t.useTrackEvent=function(t,e,n,r){void 0===r&&(r=!0);var i=(n=a.useState(n))[0],n=n[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:e},i)},[t,i,e]),n},t.useTrackMetric=m,t.withAITracking=function(n,t,r,e){return r!==undefined&&null!==r&&"string"==typeof r||(r=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),e!==undefined&&null!==e&&"string"==typeof e||(e=""),I(i,o=s.Component),i.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=Re.dateNow(),this._firstActiveTimestamp=0,this._totalIdleTime=0,this._lastActiveTimestamp=0,this._idleStartTimestamp=0,this._idleCount=0,this._intervalId=setInterval(function(){0<t._lastActiveTimestamp&&0===t._idleStartTimestamp&&Re.dateNow()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=Re.dateNow(),t._idleCount++)},100)},i.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,e;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),e={"Component Name":r},n.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},e))},i.prototype.render=function(){return s.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:e},s.createElement(t,C({},this.props)))},i.prototype.getEngagementTimeSeconds=function(){return(Re.dateNow()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},i;function i(){var n=null!==o&&o.apply(this,arguments)||this;return n._mountTimestamp=0,n._firstActiveTimestamp=0,n._idleStartTimestamp=0,n._lastActiveTimestamp=0,n._totalIdleTime=0,n._idleCount=0,n._idleTimeout=5e3,n.trackActivity=function(t){var e;0===n._firstActiveTimestamp?(n._firstActiveTimestamp=Re.dateNow(),n._lastActiveTimestamp=n._firstActiveTimestamp):n._lastActiveTimestamp=Re.dateNow(),0<n._idleStartTimestamp&&(e=n._lastActiveTimestamp-n._idleStartTimestamp,n._totalIdleTime+=e,n._idleStartTimestamp=0)},n}var o},function(t,e,n){var r=Object.defineProperty;if(r)try{return r(t,e,n)}catch(i){}typeof n.value!==undefined&&(t[e]=n.value)}(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);