@microsoft/applicationinsights-react-js 3.3.6 → 3.4.0
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.
- package/README.md +9 -0
- package/browser/applicationinsights-react-js.js +3 -3
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +13 -5
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +3 -3
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +1 -1
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +2 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 3.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 3.4.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
var t=this,n=function(t,a){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function s(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){var n;"default"!==t&&Object.defineProperty(r,t,(n=Object.getOwnPropertyDescriptor(e,t)).get?n:{enumerable:!0,get:function(){return e[t]}})}),r["default"]=e,r}var p=s(a),z=l(a),V="function",d="object",i="undefined",r="prototype",K="hasOwnProperty",e=Object,B=e[r],W=e.assign,J=e.create,q=e.defineProperty,F=B[K],n=null;function $(t){return void 0===t&&(t=!0),n&&t||(typeof globalThis!==i&&globalThis&&(n=globalThis),typeof self!==i&&self&&(n=self),typeof window!==i&&window&&(n=window),typeof global!==i&&global&&(n=global)),n}function G(t){throw new TypeError(t)}($()||{}).Symbol,($()||{}).Reflect;var H=W||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])B[K].call(n,i)&&(t[i]=n[i]);return t},X=function(t,n){return(X=e.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[K](e)&&(t[e]=n[e])})(t,n)};function Q(t,n){function e(){this.constructor=t}typeof n!==V&&null!==n&&G("Class extends value "+n+" is not a constructor or null"),X(t,n),t[r]=null===n?function(t){if(J)return J(t);if(null==t)return{};var n=typeof t;function e(){}return n!==d&&n!==V&&G("Object prototype may only be an Object:"+t),e[r]=t,new e}(n):(e[r]=n[r],new e)}var Y="constructor",v="prototype",Z="function",tt="_dynInstFuncs",nt="_isDynProxy",m="_dynClass",et="_dynInstChk",rt=et,it="_dfOpts",ot="_unknown_",ut="__proto__",at="_dyn"+ut,ct="_dynInstProto",ft="useBaseInst",lt="setInstFuncs",st=Object,pt=st.getPrototypeOf,dt=st.getOwnPropertyNames,vt=0;function g(t,n){return t&&st[v].hasOwnProperty.call(t,n)}function mt(t){return t&&(t===st[v]||t===Array[v])}function gt(t){return mt(t)||t===Function[v]}function h(t){if(t){if(pt)return pt(t);var n=t[ut]||t[v]||(t[Y]?t[Y][v]:null),e=t[at]||n;g(t,at)||(delete t[ct],e=t[at]=t[ct]||t[at],t[ct]=n)}return e}function ht(t,n){var e=[];if(dt)e=dt(t);else for(var r in t)"string"==typeof r&&g(t,r)&&e.push(r);if(e&&0<e.length)for(var i=0;i<e.length;i++)n(e[i])}function yt(t,n,e){return n!==Y&&typeof t[n]===Z&&(e||g(t,n))}function _t(t){throw new TypeError("DynamicProto: "+t)}function Tt(t,n){for(var e=t.length-1;0<=e;e--)if(t[e]===n)return 1}function Ct(t,n){return g(t,v)?t.name||n||ot:((t||{})[Y]||{}).name||n||ot}function xt(t,r,n,e){g(t,v)||_t("theClass is an invalid class definition.");var i,o,u,a,c,f,l=t[v],s=(function(t){if(!pt)return 1;for(var n=[],e=h(r);e&&!gt(e)&&!Tt(n,e);){if(e===t)return 1;n.push(e),e=h(e)}}(l)||_t("["+Ct(t)+"] is not in class hierarchy of ["+Ct(r)+"]"),null),t=(g(l,m)?s=l[m]:(s="_dynCls$"+Ct(t,"_")+"$"+vt,vt++,l[m]=s),xt[it]),p=!!t[ft],d=(p&&e&&e[ft]!==undefined&&(p=!!e[ft]),o={},ht(i=r,function(t){!o[t]&&yt(i,t,!1)&&(o[t]=i[t])}),o),p=(n(r,function(t,n,e,o){function r(t,n,e){var r,i=n[e];return i[nt]&&o&&!1!==(r=t[tt]||{})[rt]&&(i=(r[n[m]]||{})[e]||i),function(){return i.apply(t,arguments)}}for(var i={},u=(ht(e,function(t){i[t]=r(n,e,t)}),h(t)),a=[];u&&!gt(u)&&!Tt(a,u);)ht(u,function(t){!i[t]&&yt(u,t,!pt)&&(i[t]=r(n,u,t))}),a.push(u),u=h(u);return i}(l,r,d,p)),!!pt&&!!t[lt]);u=l,n=s,a=r,c=d,t=!1!==(p=p&&e?!!e[lt]:p),mt(u)||(l=a[tt]=a[tt]||{},f=l[n]=l[n]||{},!1!==l[rt]&&(l[rt]=!!t),ht(a,function(t){var e,r,i;yt(a,t,!1)&&a[t]!==c[t]&&(f[t]=a[t],delete a[t],g(u,t)&&(!u[t]||u[t][nt])||(u[t]=(e=u,r=t,(i=function(){var t,n;return(function(t,n,e,r){var i=null;if(t&&g(e,m)){var o=t[tt]||{};if((i=(o[e[m]]||{})[n])||_t("Missing ["+n+"] "+Z),!i[et]&&!1!==o[rt]){for(var u=!g(t,n),a=h(t),c=[];u&&a&&!gt(a)&&!Tt(c,a);){var f=a[n];if(f){u=f===r;break}c.push(a),a=h(a)}try{u&&(t[n]=i),i[et]=1}catch(l){o[rt]=!1}}}return i}(this,r,e,i)||(typeof(n=(n=e[t=r])===i?h(e)[t]:n)!==Z&&_t("["+t+"] is not a "+Z),n)).apply(this,arguments)})[nt]=1,i)))}))}xt[it]={setInstFuncs:!0,useBaseInst:!0};var wt="name",At="identifier",y="push",bt="isInitialized",kt="config",It="logger",_="length",Et="time",T="processNext",Pt="getPlugin",C="teardown",Mt="messageId",St="message",Ot="isAsync",Nt="_doTeardown",Dt="update",x="getNext",w="diagLog",Ut="setNextPlugin",jt="createNew",Lt="cookieCfg",Rt="indexOf",zt="substring",Vt="userAgent",Kt="split",Bt="setEnabled",o="replace",Wt="nodeType",Jt="apply",qt="enableDebugExceptions",Ft="toLowerCase",A="call",$t="isChildEvt",Gt="getCtx",f="setCtx",Ht="complete",b="",k="core",Xt="disabled",Qt="extensionConfig",I="processTelemetry",Yt="priority",Zt="errorToConsole",tn="warnToConsole",nn="getPerfMgr",en="endsWith",rn="trim",W="toString",on="constructor",un=q,an=e.freeze,cn=String[r],fn=cn[rn],ln=cn[en],cn=Array.isArray,sn=B[W],pn=F[W],dn=pn[A](e),vn=/-([a-z])/g,mn=/([^\w\d_$])/g,gn=/^(\d+[\w\d_$])/,hn=Object.getPrototypeOf;function E(t){return t===undefined||typeof t===i}function P(t){return null===t||E(t)}function yn(t){return!P(t)}function _n(t){return!(!t||typeof t!==d)}function M(t){return!(!t||typeof t!==V)}function Tn(t){var n=t;return t&&xn(t)?(n=(n=t[o](vn,function(t,n){return n.toUpperCase()}))[o](mn,"_"))[o](gn,function(t,n){return"_"+n}):n}function Cn(t,n){if(t)for(var e in t)F[A](t,e)&&n[A](t,e,t[e])}function S(t,n){return!(!t||!n)&&-1!==t[Rt](n)}var O=cn||function(t){return!(!t||"[object Array]"!==sn[A](t))};function xn(t){return"string"==typeof t}function wn(t){return t&&"object"==typeof t&&(!(t=(hn||function(t){if(t){if(hn)return hn(t);t=t.__proto__||t[r]||t[on];if(t)return t}return null})(t))||typeof(t=t[on]&&F[A](t,on)?t[on]:t)===V&&pn[A](t)===dn)}function N(t,n,e){var r=t[_];try{for(var i=0;i<r&&!(i in t&&-1===n[A](e||t,t[i],i,t));i++);}catch(o){}}function D(t){return t&&(fn&&t[rn]?t[rn]():t[o]?t[o](/^\s+|\s+$/g,b):t)}function An(t,n,e,r){if(un)try{var i={enumerable:!0,configurable:!0};return e&&(i.get=e),r&&(i.set=r),un(t,n,i),!0}catch(o){}return!1}var bn=an||function(t){return t};function U(){var t=Date;return t.now?t.now():(new t).getTime()}function j(t,n,e,r,i){var o=e;!t||(o=t[n])===e||i&&!i(o)||r&&!r(e)||(t[n]=o=e)}function kn(t,n){return P(t)?n:t}function In(t){return!!t}function En(t,n,e,r,i){var o,u,a;t&&n&&e&&(!1===i&&!E(t[n])||(t[n]=(o=r,a=u=null,M(i=e)?u=i:a=i,function(){var t=arguments;if(a=u?u():a)return a[o][Jt](a,t)})))}var Pn="window",Mn="navigator",Sn="location",On="console",Nn="JSON",Dn="msie",Un="trident/",jn=null,Ln=null;function L(t){var n=$();return n&&n[t]?n[t]:t===Pn&&typeof window===d&&window?window:null}function Rn(){return typeof navigator===d&&navigator?navigator:L(Mn)}function zn(){return typeof JSON===d&&JSON||null!==L(Nn)}function Vn(){return zn()?JSON||L(Nn):null}function Kn(){var t=Rn();return!t||t[Vt]===Ln&&null!==jn||(t=((Ln=t[Vt])||b)[Ft](),jn=S(t,Dn)||S(t,Un)),jn}function Bn(t){var n=Object[r].toString[A](t),e=b;return"[object Error]"===n?e="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t[wt]+"'":zn()&&(e=Vn().stringify(t)),n+e}var Wn=null;function Jn(t){return t?'"'+t[o](/\"/g,b)+'"':b}function qn(t,n){var e,r=typeof console!==i?console:L(On);r&&(e="log",M(r[e=r[t]?t:e])&&r[e](n))}$n.dataType="MessageData";var Fn=$n;function $n(t,n,e,r){void 0===e&&(e=!1),this[Mt]=t,this[St]=(e?"AI: ":"AI (Internal): ")+t;e=b,zn()&&(e=Vn().stringify(r)),t=(n?" message:"+Jn(n):b)+(r?" props:"+Jn(e):b);this[St]+=t}Hn.__ieDyn=1;var Gn=Hn;function Hn(i){this.identifier="DiagnosticLogger",this.queue=[];var c,f,l,s,p=0,d={};xt(Hn,this,function(o){var t;function u(t,n){var e,r;l<=p||(r=!0,e="AITR_"+n[Mt],d[e]?r=!1:d[e]=!0,r&&(t<=f&&(o.queue[y](n),p++,a(1===t?"error":"warn",n)),p===l&&(r=new Fn(23,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue[y](r),1===t?o[Zt](e):o[tn](e))))}function a(t,n){var e,r=(e=(e=Wn)||!0===(i||{}).disableDbgExt?e:Wn||(r=L("Microsoft"),Wn=r?r.ApplicationInsights:Wn))?e.ChromeDbgExt:null;r&&r[w]&&r[w](t,n)}c=kn((t=i||{}).loggingLevelConsole,0),f=kn(t.loggingLevelTelemetry,1),l=kn(t.maxMessageLimit,25),s=kn(t[qt],!1),o.consoleLoggingLevel=function(){return c},o.telemetryLoggingLevel=function(){return f},o.maxInternalMessageLimit=function(){return l},o[qt]=function(){return s},o.throwInternal=function(t,n,e,r,i){n=new Fn(n,e,i=void 0!==i&&i,r);if(s)throw Bn(n);e=1===t?Zt:tn;E(n[St])?a("throw"+(1===t?"Critical":"Warning"),n):(i?(r=+n[Mt],!d[r]&&t<=c&&(o[e](n[St]),d[r]=!0)):t<=c&&o[e](n[St]),u(t,n))},o[tn]=function(t){qn("warn",t),a("warning",t)},o[Zt]=function(t){qn("error",t),a("error",t)},o.resetInternalMessageCount=function(){p=0,d={}},o.logInternalMessage=u})}function Xn(t,n,e,r,i,o){void 0===o&&(o=!1),(t||new Gn).throwInternal(n,e,r,i,o)}var Qn="ParentContextKey",Yn="ChildrenContextKey",Zn=(c.ParentContextKey="parent",c.ChildrenContextKey="childEvts",c);function c(t,i,n){var e,o=this,u=!1;o.start=U(),o[wt]=t,o[Ot]=n,o[$t]=function(){return!1},M(i)&&(u=An(o,"payload",function(){return!e&&M(i)&&(e=i(),i=null),e})),o[Gt]=function(t){return t?(t===c[Qn]||t===c[Yn]?o:o.ctx||{})[t]:null},o[f]=function(t,n){t&&(t===c[Qn]?(o[t]||(o[$t]=function(){return!0}),o[t]=n):t===c[Yn]?o[t]=n:(o.ctx=o.ctx||{})[t]=n)},o[Ht]=function(){var t=0,n=o[Gt](c[Yn]);if(O(n))for(var e=0;e<n[_];e++){var r=n[e];r&&(t+=r[Et])}o[Et]=U()-o.start,o.exTime=o[Et]-t,o[Ht]=function(){},!u&&M(i)&&(o.payload=i())}}var te="CoreUtils.doPerf";function ne(t,n,e,r,i){if(t)if(t=t[nn]?t[nn]():t){var o,u=void 0,a=t[Gt](te);try{if(u=t.create(n(),r,i))return a&&u[f]&&(u[f](Zn[Qn],a),a[Gt]&&a[f]&&((o=a[Gt](Zn[Yn]))||(o=[],a[f](Zn[Yn],o)),o[y](u))),t[f](te,u),e(u)}catch(c){u&&u[f]&&u[f]("exception",c)}finally{u&&t.fire(u),t[f](te,a)}}e()}var ee=4294967296,u=4294967295,re=!1,ie=123456789,oe=987654321;function ue(t){var n,e=0,r=L("crypto")||L("msCrypto");if(0===(e=r&&r.getRandomValues?r.getRandomValues(new Uint32Array(1))[0]&u:e)&&Kn()){if(!re)try{var i=2147483647&U();(n=(Math.random()*ee^i)+i)<0&&(n>>>=0),ie=123456789+n&u,oe=987654321-n&u,re=!0}catch(o){}r=((oe=36969*(65535&oe)+(oe>>16)&u)<<16)+(65535&(ie=18e3*(65535&ie)+(ie>>16)&u))>>>0&u|0,e=(r>>>=0)&u}return 0===e&&(e=Math.floor(ee*Math.random()|0)),t||(e>>>=0),e}var ae=q,W="."+function(t){void 0===t&&(t=22);for(var n=ue()>>>0,e=0,r=b;r[_]<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n]||"",n>>>=6,5==++e&&(n=(ue()<<2&4294967295|3&n)>>>0,e=0);return r}(6);function ce(t){return 1===t[Wt]||9===t[Wt]||!+t[Wt]}var fe="toGMTString",le="toUTCString",se="cookie",pe="expires",de="enabled",ve="isCookieUseDisabled",me="disableCookiesUsage",ge="_ckMgr",he=null,ye=null,_e=null,Te=typeof document===d&&document?document:L("document"),Ce={},xe={};function we(t){return!t||t.isEnabled()}function Ae(t,i){j(e=(t=t||xe)[Lt]=t[Lt]||{},"domain",t.cookieDomain,yn,P),j(e,"path",t.cookiePath||"/",null,P),P(e[de])&&(n=void 0,E(t[ve])||(n=!t[ve]),E(t[me])||(n=!t[me]),e[de]=n);var n,e,f=e,l=f.path||"/",s=f.domain,r=!1!==f[de],p=((t={isEnabled:function(){var t=r&&be(i),n=xe[ge];return t&&n&&p!==n?we(n):t}})[Bt]=function(t){r=!1!==t},t.set=function(t,n,e,r,i){var o,u,a,c=!1;return we(p)&&(o={},-1!==(a=(u=D(n||b))[Rt](";"))&&(u=D(n[zt](0,a)),o=ke(n[zt](a+1))),j(o,"domain",r||s,In,E),P(e)||(a=Kn(),E(o[pe])&&0<(n=U()+1e3*e)&&((r=new Date).setTime(n),j(o,pe,Ie(r,a?fe:le)||Ie(r,a?fe:le)||b,In)),a||j(o,"max-age",b+e,null,E)),(n=typeof location===d&&location?location:L(Sn))&&"https:"===n.protocol&&(j(o,"secure",null,null,E),(ye=null===ye?!(xn(r=(Rn()||{})[Vt])&&(S(r,"CPU iPhone OS 12")||S(r,"iPad; CPU OS 12")||S(r,"Macintosh; Intel Mac OS X 10_14")&&S(r,"Version/")&&S(r,"Safari")||S(r,"Macintosh; Intel Mac OS X 10_14")&&function(t,n){var e=!1;if(!t||(e=t===n))return e;if(ln)return t[en](n);var r=t,i=n,e=!1,t=i[_],n=r?r[_]:0;if(t&&n&&t<=n&&!(e=r===i)){for(var o=n-1,u=t-1;0<=u;u--){if(r[o]!=i[u])return;o--}e=!0}return e}(r,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||S(r,"Chrome/5")||S(r,"Chrome/6")||S(r,"UnrealEngine")&&!S(r,"Chrome")||S(r,"UCBrowser/12")||S(r,"UCBrowser/11"))):ye)&&j(o,"SameSite","None",null,E)),j(o,"path",i||l,null,E),(f.setCookie||Pe)(t,Ee(u,o)),c=!0),c},t.get=function(t){var n=b;return we(p)?(f.getCookie||function(t){var n,e=b;return Te&&(n=Te[se]||b,_e!==n&&(Ce=ke(n),_e=n),e=D(Ce[t]||b)),e})(t):n},t.del=function(t,n){return!!we(p)&&p.purge(t,n)},t.purge=function(t,n){var e,r=!1;return be(i)&&((e={}).path=n||"/",e[pe]="Thu, 01 Jan 1970 00:00:01 GMT",n=e,Kn()||(n["max-age"]="0"),(f.delCookie||Pe)(t,Ee(b,n)),r=!0),r},t);return p[ge]=p}function be(t){if(null===he){he=!1;try{he=(Te||{})[se]!==undefined}catch(n){Xn(t,2,68,"Cannot access document.cookie - "+((t=n)&&"[object Error]"===sn[A](t)?t[wt]:b),{exception:Bn(n)})}}return he}function ke(t){var e={};return t&&t[_]&&N(D(t)[Kt](";"),function(t){var n;(t=D(t||b))&&(-1===(n=t[Rt]("="))?e[t]=null:e[D(t[zt](0,n))]=D(t[zt](n+1)))}),e}function Ie(t,n){return M(t[n])?t[n]():null}function Ee(t,n){var e=t||b;return Cn(n,function(t,n){e+="; "+t+(P(n)?b:"="+n)}),e}function Pe(t,n){Te&&(Te[se]=t+"="+n)}var Me,Se=Me={id:Tn("_aiData-plugin.2.8.50"+((Ye=void 0!==Ye&&Ye)?".2.8.5":b)+W),accept:ce,get:function(t,n,e,r){var i=t[Me.id];return i?i[Tn(n)]:(r&&((i=function(t,n){var e=n[t.id];if(!e){e={};try{ce(n)&&!function(t,n,e){if(ae)try{return ae(t,n,{value:e,enumerable:!1,configurable:!0}),1}catch(r){}}(n,t.id,e)&&(n[t.id]=e)}catch(r){}}return e}(Me,t))[Tn(n)]=e),e)},kill:function(t,n){if(t&&t[n])try{delete t[n]}catch(e){}}};function Oe(t){return Se.get(t,"state",{},!0)}var Ne="TelemetryPluginChain",De="_hasRun",Ue="_getTelCtx",je=0;function Le(t,u,e,n){var r=null,i=[],o=(null!==n&&(r=n?function(t,n,e){for(;t;){if(t[Pt]()===e)return t;t=t[x]()}return ze([e],n[kt]||{},n)}(t,e,n):t),{_next:function(){var t,n=r;return r=n?n[x]():null,n||(t=i)&&0<t[_]&&(N(t,function(t){try{t.func[A](t.self,t.args)}catch(n){Xn(e[It],2,73,"Unexpected Exception during onComplete - "+Bn(n))}}),i=[]),n},ctx:{core:function(){return e},diagLog:function(){return(e||{})[It]||new Gn(u)},getCfg:function(){return u},getExtCfg:a,getConfig:function(t,n,e){void 0===e&&(e=!1);var r,t=a(t,null);return t&&!P(t[n])?r=t[n]:u&&!P(u[n])&&(r=u[n]),P(r)?e:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(t){r=t},iterate:function(t){for(;n=o._next();){var n=n[Pt]();n&&t(n)}},onComplete:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];t&&i[y]({func:t,self:E(n)?o.ctx:n,args:e})}}});function a(t,n,e){var r,i,o;return void 0===n&&(n={}),void 0===e&&(e=0),(r=u&&(i=u[Qt])&&t?i[t]:r)?_n(n)&&0!==e&&(o=function p(){var t=arguments,n=t[0]||{},e=t[_],r=!1,i=1;for(0<e&&"boolean"==typeof n&&(r=n,n=t[i]||{},i++),_n(n)||(n={});i<e;i++){var o,u,a,c,f=t[i],l=O(f),s=_n(f);for(o in f)(l&&o in f||s&&F[A](f,o))&&(u=f[o],a=void 0,r&&u&&((a=O(u))||wn(u))&&(c=n[o],a?O(c)||(c=[]):wn(c)||(c={}),u=p(r,c,u)),u!==undefined&&(n[o]=u))}return n}(!0,n,r),u&&2===e&&Cn(n,function(t){var n;P(o[t])&&!P(n=u[t])&&(o[t]=n)}),r=o):r=n,r}return o}function Re(t,e,r,n){var i=Le(t,e,r,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n[I](t,o),!n},o[jt]=function(t,n){return Re((t=O(t=void 0===t?null:t)?ze(t,e,r,n):t)||o[x](),e,r,n)},o}function ze(t,n,e,r){var i,o=null,u=!r;return O(t)&&0<t[_]&&(i=null,N(t,function(t){(u=!u&&r===t||u)&&t&&M(t[I])&&(t=Ve(t,n,e),o=o||t,i&&i._setNext(t),i=t)})),r&&!o?ze([r],n,e):o}function Ve(c,r,i){var f=null,o=M(c[I]),u=M(c[Ut]),l=c?c[At]+"-"+c[Yt]+"-"+je++:"Unknown-0-"+je++,a={getPlugin:function(){return c},getNext:function(){return f},processTelemetry:function(e,t){var n;s(t=t||(n=(n=c&&M(c[Ue])?c[Ue]():n)||Re(a,r,i)),function(t){if(!c||!o)return!1;var n=Oe(c);return!n[C]&&!n[Xt]&&(u&&c[Ut](f),c[I](e,t),!0)},"processTelemetry",function(){return{item:e}},!e.sync)||t[T](e)},unload:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Oe(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||(t[k]=null,t[C]=!0,t[bt]=!1,c[C]&&!0===c[C](r,i)&&(e=!0))),e},"unload",function(){},i[Ot])||r[T](i)},update:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Oe(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||c[Dt]&&!0===c[Dt](r,i)&&(e=!0)),e},"update",function(){},!1)||r[T](i)},_id:l,_setNext:function(t){f=t}};function s(e,r,i,t,n){var o=!1,u=c?c[At]:Ne,a=(a=e[De])||(e[De]={});return e.setNext(f),c&&ne(e[k](),function(){return u+":"+i},function(){a[l]=!0;try{var t=f?f._id:b;t&&(a[t]=!1),o=r(e)}catch(n){t=!f||a[f._id];t&&(o=!0),f&&t||Xn(e[w](),1,73,"Plugin ["+u+"] failed during "+i+" - "+Bn(n)+", run flags: "+Bn(a))}},t,n),o}return bn(a)}function Ke(){var n=[];return{add:function(t){t&&n[y](t)},run:function(e,r){N(n,function(t){try{t(e,r)}catch(n){Xn(e[w](),2,73,"Unexpected error calling unload handler - "+Bn(n))}}),n=[]}}}var Be,R="getPlugin";function We(){var i,o,l,s,p,u=this;function n(t){var n,t=t=void 0===t?null:t;return t||(n=o||Re(null,{},u[k]),t=l&&l[R]?n[jt](null,l[R]):n[jt](null,l)),t}function c(t,n,e){t&&j(t,Qt,[],null,P),!e&&n&&(e=n.getProcessTelContext()[x]());var r=l;l&&l[R]&&(r=l[R]()),u[k]=n,o=Re(e,t,n,r)}function d(){i=!1,u[k]=null,l=o=null,p=[],s=Ke()}d(),xt(We,u,function(f){f.initialize=function(t,n,e,r){c(t,n,r),i=!0},f[C]=function(t,n){var e,r,i,o,u=f[k];if(u&&(!t||u===t[k]()))return r=!1,i=t||function c(t,e,n){var r=e[kt]||{},i=Le(t,r,e,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n.unload(o,t),!n},o[jt]=function(t,n){return c((t=O(t=void 0===t?null:t)?ze(t,r,e,n):t)||o[x](),e,n)},o}(null,u,l&&l[R]?l[R]():l),o=n||((t={reason:0})[Ot]=!1,t),f[Nt]&&!0===f[Nt](i,o,a)?e=!0:a(),e;function a(){var t;r||(r=!0,s.run(i,n),t=p,p=[],N(t,function(t){t.rm()}),!0===e&&i[T](o),d())}},f[Dt]=function(t,n){var e,r,i,o=f[k];if(o&&(!t||o===t[k]()))return r=!1,i=t||function a(t,e,n){var r=e[kt]||{},i=Le(t,r,e,n).ctx;return i[T]=function(n){return i.iterate(function(t){M(t[Dt])&&t[Dt](i,n)})},i[jt]=function(t,n){return a((t=O(t=void 0===t?null:t)?ze(t,r,e,n):t)||i[x](),e,n)},i}(null,o,l&&l[R]?l[R]():l),f._doUpdate&&!0===f._doUpdate(i,n||{reason:0},u)?e=!0:u(),e;function u(){r||(r=!0,c(i.getCfg(),i.core(),i[x]()))}},f._addHook=function(t){t&&(O(t)?p=p.concat(t):p[y](t))},En(f,"_addUnloadCb",function(){return s},"add")}),u[w]=function(t){return n(t)[w]()},u[bt]=function(){return i},u.setInitialized=function(t){i=t},u[Ut]=function(t){l=t},u[T]=function(t,n){n?n[T](t):l&&M(l[I])&&l[I](t,null)},u._getTelCtx=n}function Je(){var a,c,f,l,s=Be.call(this)||this;return s.priority=185,s.identifier="ReactPlugin",xt(Je,s,function(i,t){var n,e,r;function o(){l=f=c=a=null}function u(){return a||Xn(i.diagLog(),1,64,"Analytics plugin is not available, React plugin telemetry will not be sent: "),a}o(),i.initialize=function(t,n,e,r){Be.prototype.initialize.call(s,t,n,e,r),c=t.extensionConfig&&t.extensionConfig[i.identifier]?t.extensionConfig[i.identifier]:{history:null},N(e,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(a=t)}),c.history&&(n=c.history,f=n.listen(function(t){var n="location"in t?t.location:t;l=setTimeout(function(){l=null;var t={uri:n.pathname};i.trackPageView(t)},500)}),r={uri:c.history.location.pathname},i.trackPageView(r))},i.getCookieMgr=function(){return(n=(e=i.core)?e.getCookieMgr():n)||(e=(e||{})[It],(r=Ae[ge]||xe[ge])||(r=Ae[ge]=Ae(t,e),xe[ge]=r),n=r),n;var t,n,e,r},i.getAppInsights=u,i.processTelemetry=function(t,n){i.processNext(t,n)},i._doTeardown=function(t,n,e){M(f)&&f(),l&&clearTimeout(l),o()},e=u,r=["trackMetric","trackPageView","trackEvent","trackException","trackTrace"],(n=i)&&e&&_n(n)&&O(r)&&N(r,function(t){xn(t)&&En(n,t,e,t,void 0)}),An(i,"_extensionConfig",function(){return c})}),s}We.__ieDyn=1,Q(Je,Be=We),Je.__ieDyn=1;var qe,cn=Je,Fe=(Q($e,qe=p.Component),$e.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=U(),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&&U()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=U(),t._idleCount++)},100)},$e.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,n;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),n={"Component Name":this._componentName},this._reactPlugin.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},n))},$e.prototype.getEngagementTimeSeconds=function(){return(U()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},$e);function $e(t,n,e){var r=qe.call(this,t)||this;return r._mountTimestamp=0,r._firstActiveTimestamp=0,r._idleStartTimestamp=0,r._lastActiveTimestamp=0,r._totalIdleTime=0,r._idleCount=0,r._idleTimeout=5e3,r.trackActivity=function(t){var n;0===r._firstActiveTimestamp?(r._firstActiveTimestamp=U(),r._lastActiveTimestamp=r._firstActiveTimestamp):r._lastActiveTimestamp=U(),0<r._idleStartTimestamp&&(n=r._lastActiveTimestamp-r._idleStartTimestamp,r._totalIdleTime+=n,r._idleStartTimestamp=0)},r._reactPlugin=n,r._componentName=e,r}Ge={},Cn({Verbose:0,Information:1,Warning:2,Error:3,Critical:4},function(t,n){Ge[t]=n,Ge[n]=t}),q=Ge,an&&Cn(q,function(t,n){(O(n)||_n(n))&&an(n)});var Ge,He,Xe=bn(q);function Qe(){var t=null!==He&&He.apply(this,arguments)||this;return t.state={hasError:!1},t}Q(Qe,He=z["default"].Component),Qe.prototype.componentDidCatch=function(t,n){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:Xe.Error,properties:n})},Qe.prototype.render=function(){var t;return this.state.hasError?(t=this.props.onError,z["default"].createElement(t)):this.props.children};var Ye=Qe,Ze=a.createContext(undefined);t.AITrackedComponentBase=Fe,t.AppInsightsContext=Ze,t.AppInsightsErrorBoundary=Ye,t.ReactPlugin=cn,t.useAppInsightsContext=function(){return a.useContext(Ze)},t.useTrackEvent=function(t,n,e,r){void 0===r&&(r=!0);var e=a.useState(e),i=e[0],e=e[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:n},i)},[t,i,n]),e},t.useTrackMetric=function(r,i,o){var u=a.useRef({hookTimestamp:U(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=u.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&U()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=U(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t,n=u.current;if(0===n.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==n.firstActiveTimestamp&&(n=n,n={average:(U()-n.firstActiveTimestamp-n.totalIdleTime-n.idleCount*n.idleTimeout)/1e3,name:"React Component Engaged Time (seconds)",sampleCount:1},t=H({"Component Name":i},o),r.trackMetric(n,t))}},[]),function(){var t,n=u.current;0===n.firstActiveTimestamp?(n.firstActiveTimestamp=U(),n.lastActiveTimestamp=n.firstActiveTimestamp):n.lastActiveTimestamp=U(),0<n.idleStartTimestamp&&(t=n.lastActiveTimestamp-n.idleStartTimestamp,n.totalIdleTime+=t,n.idleStartTimestamp=0)}},t.withAITracking=function(n,t,e,r){return e!==undefined&&null!==e&&"string"==typeof e||(e=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),r!==undefined&&null!==r&&"string"==typeof r||(r=""),Q(i,o=Fe),i.prototype.render=function(){return p.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:r},p.createElement(t,H({},this.props)))},i;function i(t){return o.call(this,t,n,e)||this}var o},Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);
|
|
5
|
+
var t=this,n=function(t,a){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function s(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){var n;"default"!==t&&Object.defineProperty(r,t,(n=Object.getOwnPropertyDescriptor(e,t)).get?n:{enumerable:!0,get:function(){return e[t]}})}),r["default"]=e,r}var p=s(a),z=l(a),V="function",d="object",i="undefined",r="prototype",K="hasOwnProperty",e=Object,B=e[r],W=e.assign,J=e.create,q=e.defineProperty,F=B[K],n=null;function $(t){return void 0===t&&(t=!0),n&&t||(typeof globalThis!==i&&globalThis&&(n=globalThis),typeof self!==i&&self&&(n=self),typeof window!==i&&window&&(n=window),typeof global!==i&&global&&(n=global)),n}function G(t){throw new TypeError(t)}($()||{}).Symbol,($()||{}).Reflect;var H=W||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])B[K].call(n,i)&&(t[i]=n[i]);return t},X=function(t,n){return(X=e.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[K](e)&&(t[e]=n[e])})(t,n)};function Q(t,n){function e(){this.constructor=t}typeof n!==V&&null!==n&&G("Class extends value "+n+" is not a constructor or null"),X(t,n),t[r]=null===n?function(t){if(J)return J(t);if(null==t)return{};var n=typeof t;function e(){}return n!==d&&n!==V&&G("Object prototype may only be an Object:"+t),e[r]=t,new e}(n):(e[r]=n[r],new e)}var Y="constructor",v="prototype",Z="function",tt="_dynInstFuncs",nt="_isDynProxy",m="_dynClass",et="_dynInstChk",rt=et,it="_dfOpts",ot="_unknown_",ut="__proto__",at="_dyn"+ut,ct="_dynInstProto",ft="useBaseInst",lt="setInstFuncs",st=Object,pt=st.getPrototypeOf,dt=st.getOwnPropertyNames,vt=0;function g(t,n){return t&&st[v].hasOwnProperty.call(t,n)}function mt(t){return t&&(t===st[v]||t===Array[v])}function gt(t){return mt(t)||t===Function[v]}function h(t){if(t){if(pt)return pt(t);var n=t[ut]||t[v]||(t[Y]?t[Y][v]:null),e=t[at]||n;g(t,at)||(delete t[ct],e=t[at]=t[ct]||t[at],t[ct]=n)}return e}function ht(t,n){var e=[];if(dt)e=dt(t);else for(var r in t)"string"==typeof r&&g(t,r)&&e.push(r);if(e&&0<e.length)for(var i=0;i<e.length;i++)n(e[i])}function yt(t,n,e){return n!==Y&&typeof t[n]===Z&&(e||g(t,n))}function _t(t){throw new TypeError("DynamicProto: "+t)}function Tt(t,n){for(var e=t.length-1;0<=e;e--)if(t[e]===n)return 1}function Ct(t,n){return g(t,v)?t.name||n||ot:((t||{})[Y]||{}).name||n||ot}function xt(t,r,n,e){g(t,v)||_t("theClass is an invalid class definition.");var i,o,u,a,c,f,l=t[v],s=(function(t){if(!pt)return 1;for(var n=[],e=h(r);e&&!gt(e)&&!Tt(n,e);){if(e===t)return 1;n.push(e),e=h(e)}}(l)||_t("["+Ct(t)+"] is not in class hierarchy of ["+Ct(r)+"]"),null),t=(g(l,m)?s=l[m]:(s="_dynCls$"+Ct(t,"_")+"$"+vt,vt++,l[m]=s),xt[it]),p=!!t[ft],d=(p&&e&&e[ft]!==undefined&&(p=!!e[ft]),o={},ht(i=r,function(t){!o[t]&&yt(i,t,!1)&&(o[t]=i[t])}),o),p=(n(r,function(t,n,e,o){function r(t,n,e){var r,i=n[e];return i[nt]&&o&&!1!==(r=t[tt]||{})[rt]&&(i=(r[n[m]]||{})[e]||i),function(){return i.apply(t,arguments)}}for(var i={},u=(ht(e,function(t){i[t]=r(n,e,t)}),h(t)),a=[];u&&!gt(u)&&!Tt(a,u);)ht(u,function(t){!i[t]&&yt(u,t,!pt)&&(i[t]=r(n,u,t))}),a.push(u),u=h(u);return i}(l,r,d,p)),!!pt&&!!t[lt]);u=l,n=s,a=r,c=d,t=!1!==(p=p&&e?!!e[lt]:p),mt(u)||(l=a[tt]=a[tt]||{},f=l[n]=l[n]||{},!1!==l[rt]&&(l[rt]=!!t),ht(a,function(t){var e,r,i;yt(a,t,!1)&&a[t]!==c[t]&&(f[t]=a[t],delete a[t],g(u,t)&&(!u[t]||u[t][nt])||(u[t]=(e=u,r=t,(i=function(){var t,n;return(function(t,n,e,r){var i=null;if(t&&g(e,m)){var o=t[tt]||{};if((i=(o[e[m]]||{})[n])||_t("Missing ["+n+"] "+Z),!i[et]&&!1!==o[rt]){for(var u=!g(t,n),a=h(t),c=[];u&&a&&!gt(a)&&!Tt(c,a);){var f=a[n];if(f){u=f===r;break}c.push(a),a=h(a)}try{u&&(t[n]=i),i[et]=1}catch(l){o[rt]=!1}}}return i}(this,r,e,i)||(typeof(n=(n=e[t=r])===i?h(e)[t]:n)!==Z&&_t("["+t+"] is not a "+Z),n)).apply(this,arguments)})[nt]=1,i)))}))}xt[it]={setInstFuncs:!0,useBaseInst:!0};var wt="name",At="identifier",y="push",bt="isInitialized",kt="config",It="logger",_="length",Et="time",T="processNext",Pt="getPlugin",C="teardown",Mt="messageId",St="message",Ot="isAsync",Nt="_doTeardown",Dt="update",x="getNext",w="diagLog",Ut="setNextPlugin",jt="createNew",Lt="cookieCfg",Rt="indexOf",zt="substring",Vt="userAgent",Kt="split",Bt="setEnabled",Wt="nodeType",Jt="apply",o="replace",qt="enableDebugExceptions",Ft="toLowerCase",A="call",$t="isChildEvt",Gt="getCtx",f="setCtx",Ht="complete",b="",k="core",Xt="disabled",Qt="extensionConfig",I="processTelemetry",Yt="priority",Zt="errorToConsole",tn="warnToConsole",nn="getPerfMgr",en="endsWith",rn="trim",W="toString",on="constructor",un=q,an=e.freeze,cn=String[r],fn=cn[rn],ln=cn[en],cn=Array.isArray,sn=B[W],pn=F[W],dn=pn[A](e),vn=/-([a-z])/g,mn=/([^\w\d_$])/g,gn=/^(\d+[\w\d_$])/,hn=Object.getPrototypeOf;function E(t){return t===undefined||typeof t===i}function P(t){return null===t||E(t)}function yn(t){return!P(t)}function _n(t){return!(!t||typeof t!==d)}function M(t){return!(!t||typeof t!==V)}function Tn(t){var n=t;return t&&xn(t)?(n=(n=t[o](vn,function(t,n){return n.toUpperCase()}))[o](mn,"_"))[o](gn,function(t,n){return"_"+n}):n}function Cn(t,n){if(t)for(var e in t)F[A](t,e)&&n[A](t,e,t[e])}function S(t,n){return!(!t||!n)&&-1!==t[Rt](n)}var O=cn||function(t){return!(!t||"[object Array]"!==sn[A](t))};function xn(t){return"string"==typeof t}function wn(t){return t&&"object"==typeof t&&(!(t=(hn||function(t){if(t){if(hn)return hn(t);t=t.__proto__||t[r]||t[on];if(t)return t}return null})(t))||typeof(t=t[on]&&F[A](t,on)?t[on]:t)===V&&pn[A](t)===dn)}function N(t,n,e){var r=t[_];try{for(var i=0;i<r&&!(i in t&&-1===n[A](e||t,t[i],i,t));i++);}catch(o){}}function D(t){return t&&(fn&&t[rn]?t[rn]():t[o]?t[o](/^\s+|\s+$/g,b):t)}function An(t,n,e,r){if(un)try{var i={enumerable:!0,configurable:!0};return e&&(i.get=e),r&&(i.set=r),un(t,n,i),!0}catch(o){}return!1}var bn=an||function(t){return t};function U(){var t=Date;return t.now?t.now():(new t).getTime()}function j(t,n,e,r,i){var o=e;!t||(o=t[n])===e||i&&!i(o)||r&&!r(e)||(t[n]=o=e)}function kn(t,n){return P(t)?n:t}function In(t){return!!t}function En(t,n,e,r,i){var o,u,a;t&&n&&e&&(!1===i&&!E(t[n])||(t[n]=(o=r,a=u=null,M(i=e)?u=i:a=i,function(){var t=arguments;if(a=u?u():a)return a[o][Jt](a,t)})))}var Pn="window",Mn="navigator",Sn="location",On="console",Nn="JSON",Dn="msie",Un="trident/",jn=null,Ln=null;function L(t){var n=$();return n&&n[t]?n[t]:t===Pn&&typeof window===d&&window?window:null}function Rn(){return typeof navigator===d&&navigator?navigator:L(Mn)}function zn(){return typeof JSON===d&&JSON||null!==L(Nn)}function Vn(){return zn()?JSON||L(Nn):null}function Kn(){var t=Rn();return!t||t[Vt]===Ln&&null!==jn||(t=((Ln=t[Vt])||b)[Ft](),jn=S(t,Dn)||S(t,Un)),jn}function Bn(t){var n=Object[r].toString[A](t),e=b;return"[object Error]"===n?e="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t[wt]+"'":zn()&&(e=Vn().stringify(t)),n+e}var Wn=null;function Jn(t){return t?'"'+t[o](/\"/g,b)+'"':b}function qn(t,n){var e,r=typeof console!==i?console:L(On);r&&(e="log",M(r[e=r[t]?t:e])&&r[e](n))}$n.dataType="MessageData";var Fn=$n;function $n(t,n,e,r){void 0===e&&(e=!1),this[Mt]=t,this[St]=(e?"AI: ":"AI (Internal): ")+t;e=b,zn()&&(e=Vn().stringify(r)),t=(n?" message:"+Jn(n):b)+(r?" props:"+Jn(e):b);this[St]+=t}Hn.__ieDyn=1;var Gn=Hn;function Hn(i){this.identifier="DiagnosticLogger",this.queue=[];var c,f,l,s,p=0,d={};xt(Hn,this,function(o){var t;function u(t,n){var e,r;l<=p||(r=!0,e="AITR_"+n[Mt],d[e]?r=!1:d[e]=!0,r&&(t<=f&&(o.queue[y](n),p++,a(1===t?"error":"warn",n)),p===l&&(r=new Fn(23,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue[y](r),1===t?o[Zt](e):o[tn](e))))}function a(t,n){var e,r=(e=(e=Wn)||!0===(i||{}).disableDbgExt?e:Wn||(r=L("Microsoft"),Wn=r?r.ApplicationInsights:Wn))?e.ChromeDbgExt:null;r&&r[w]&&r[w](t,n)}c=kn((t=i||{}).loggingLevelConsole,0),f=kn(t.loggingLevelTelemetry,1),l=kn(t.maxMessageLimit,25),s=kn(t[qt],!1),o.consoleLoggingLevel=function(){return c},o.telemetryLoggingLevel=function(){return f},o.maxInternalMessageLimit=function(){return l},o[qt]=function(){return s},o.throwInternal=function(t,n,e,r,i){n=new Fn(n,e,i=void 0!==i&&i,r);if(s)throw Bn(n);e=1===t?Zt:tn;E(n[St])?a("throw"+(1===t?"Critical":"Warning"),n):(i?(r=+n[Mt],!d[r]&&t<=c&&(o[e](n[St]),d[r]=!0)):t<=c&&o[e](n[St]),u(t,n))},o[tn]=function(t){qn("warn",t),a("warning",t)},o[Zt]=function(t){qn("error",t),a("error",t)},o.resetInternalMessageCount=function(){p=0,d={}},o.logInternalMessage=u})}function Xn(t,n,e,r,i,o){void 0===o&&(o=!1),(t||new Gn).throwInternal(n,e,r,i,o)}var Qn="ParentContextKey",Yn="ChildrenContextKey",Zn=(c.ParentContextKey="parent",c.ChildrenContextKey="childEvts",c);function c(t,i,n){var e,o=this,u=!1;o.start=U(),o[wt]=t,o[Ot]=n,o[$t]=function(){return!1},M(i)&&(u=An(o,"payload",function(){return!e&&M(i)&&(e=i(),i=null),e})),o[Gt]=function(t){return t?(t===c[Qn]||t===c[Yn]?o:o.ctx||{})[t]:null},o[f]=function(t,n){t&&(t===c[Qn]?(o[t]||(o[$t]=function(){return!0}),o[t]=n):t===c[Yn]?o[t]=n:(o.ctx=o.ctx||{})[t]=n)},o[Ht]=function(){var t=0,n=o[Gt](c[Yn]);if(O(n))for(var e=0;e<n[_];e++){var r=n[e];r&&(t+=r[Et])}o[Et]=U()-o.start,o.exTime=o[Et]-t,o[Ht]=function(){},!u&&M(i)&&(o.payload=i())}}var te="CoreUtils.doPerf";function ne(t,n,e,r,i){if(t)if(t=t[nn]?t[nn]():t){var o,u=void 0,a=t[Gt](te);try{if(u=t.create(n(),r,i))return a&&u[f]&&(u[f](Zn[Qn],a),a[Gt]&&a[f]&&((o=a[Gt](Zn[Yn]))||(o=[],a[f](Zn[Yn],o)),o[y](u))),t[f](te,u),e(u)}catch(c){u&&u[f]&&u[f]("exception",c)}finally{u&&t.fire(u),t[f](te,a)}}e()}var ee=4294967296,u=4294967295,re=!1,ie=123456789,oe=987654321;function ue(t){var n,e=0,r=L("crypto")||L("msCrypto");if(0===(e=r&&r.getRandomValues?r.getRandomValues(new Uint32Array(1))[0]&u:e)&&Kn()){if(!re)try{var i=2147483647&U();(n=(Math.random()*ee^i)+i)<0&&(n>>>=0),ie=123456789+n&u,oe=987654321-n&u,re=!0}catch(o){}r=((oe=36969*(65535&oe)+(oe>>16)&u)<<16)+(65535&(ie=18e3*(65535&ie)+(ie>>16)&u))>>>0&u|0,e=(r>>>=0)&u}return 0===e&&(e=Math.floor(ee*Math.random()|0)),t||(e>>>=0),e}var ae=q,W="."+function(t){void 0===t&&(t=22);for(var n=ue()>>>0,e=0,r=b;r[_]<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n]||"",n>>>=6,5==++e&&(n=(ue()<<2&4294967295|3&n)>>>0,e=0);return r}(6);function ce(t){return 1===t[Wt]||9===t[Wt]||!+t[Wt]}var fe="toGMTString",le="toUTCString",se="cookie",pe="expires",de="enabled",ve="isCookieUseDisabled",me="disableCookiesUsage",ge="_ckMgr",he=null,ye=null,_e=null,Te=typeof document===d&&document?document:L("document"),Ce={},xe={};function we(t){return!t||t.isEnabled()}function Ae(t,i){j(e=(t=t||xe)[Lt]=t[Lt]||{},"domain",t.cookieDomain,yn,P),j(e,"path",t.cookiePath||"/",null,P),P(e[de])&&(n=void 0,E(t[ve])||(n=!t[ve]),E(t[me])||(n=!t[me]),e[de]=n);var n,e,f=e,l=f.path||"/",s=f.domain,r=!1!==f[de],p=((t={isEnabled:function(){var t=r&&be(i),n=xe[ge];return t&&n&&p!==n?we(n):t}})[Bt]=function(t){r=!1!==t},t.set=function(t,n,e,r,i){var o,u,a,c=!1;return we(p)&&(o={},-1!==(a=(u=D(n||b))[Rt](";"))&&(u=D(n[zt](0,a)),o=ke(n[zt](a+1))),j(o,"domain",r||s,In,E),P(e)||(a=Kn(),E(o[pe])&&0<(n=U()+1e3*e)&&((r=new Date).setTime(n),j(o,pe,Ie(r,a?fe:le)||Ie(r,a?fe:le)||b,In)),a||j(o,"max-age",b+e,null,E)),(n=typeof location===d&&location?location:L(Sn))&&"https:"===n.protocol&&(j(o,"secure",null,null,E),(ye=null===ye?!(xn(r=(Rn()||{})[Vt])&&(S(r,"CPU iPhone OS 12")||S(r,"iPad; CPU OS 12")||S(r,"Macintosh; Intel Mac OS X 10_14")&&S(r,"Version/")&&S(r,"Safari")||S(r,"Macintosh; Intel Mac OS X 10_14")&&function(t,n){var e=!1;if(!t||(e=t===n))return e;if(ln)return t[en](n);var r=t,i=n,e=!1,t=i[_],n=r?r[_]:0;if(t&&n&&t<=n&&!(e=r===i)){for(var o=n-1,u=t-1;0<=u;u--){if(r[o]!=i[u])return;o--}e=!0}return e}(r,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||S(r,"Chrome/5")||S(r,"Chrome/6")||S(r,"UnrealEngine")&&!S(r,"Chrome")||S(r,"UCBrowser/12")||S(r,"UCBrowser/11"))):ye)&&j(o,"SameSite","None",null,E)),j(o,"path",i||l,null,E),(f.setCookie||Pe)(t,Ee(u,o)),c=!0),c},t.get=function(t){var n=b;return we(p)?(f.getCookie||function(t){var n,e=b;return Te&&(n=Te[se]||b,_e!==n&&(Ce=ke(n),_e=n),e=D(Ce[t]||b)),e})(t):n},t.del=function(t,n){return!!we(p)&&p.purge(t,n)},t.purge=function(t,n){var e,r=!1;return be(i)&&((e={}).path=n||"/",e[pe]="Thu, 01 Jan 1970 00:00:01 GMT",n=e,Kn()||(n["max-age"]="0"),(f.delCookie||Pe)(t,Ee(b,n)),r=!0),r},t);return p[ge]=p}function be(t){if(null===he){he=!1;try{he=(Te||{})[se]!==undefined}catch(n){Xn(t,2,68,"Cannot access document.cookie - "+((t=n)&&"[object Error]"===sn[A](t)?t[wt]:b),{exception:Bn(n)})}}return he}function ke(t){var e={};return t&&t[_]&&N(D(t)[Kt](";"),function(t){var n;(t=D(t||b))&&(-1===(n=t[Rt]("="))?e[t]=null:e[D(t[zt](0,n))]=D(t[zt](n+1)))}),e}function Ie(t,n){return M(t[n])?t[n]():null}function Ee(t,n){var e=t||b;return Cn(n,function(t,n){e+="; "+t+(P(n)?b:"="+n)}),e}function Pe(t,n){Te&&(Te[se]=t+"="+n)}var Me,Se=Me={id:Tn("_aiData-plugin.2.8.60"+((Ye=void 0!==Ye&&Ye)?".2.8.6":b)+W),accept:ce,get:function(t,n,e,r){var i=t[Me.id];return i?i[Tn(n)]:(r&&((i=function(t,n){var e=n[t.id];if(!e){e={};try{ce(n)&&!function(t,n,e){if(ae)try{return ae(t,n,{value:e,enumerable:!1,configurable:!0}),1}catch(r){}}(n,t.id,e)&&(n[t.id]=e)}catch(r){}}return e}(Me,t))[Tn(n)]=e),e)},kill:function(t,n){if(t&&t[n])try{delete t[n]}catch(e){}}};function Oe(t){return Se.get(t,"state",{},!0)}var Ne="TelemetryPluginChain",De="_hasRun",Ue="_getTelCtx",je=0;function Le(t,u,e,n){var r=null,i=[],o=(null!==n&&(r=n?function(t,n,e){for(;t;){if(t[Pt]()===e)return t;t=t[x]()}return ze([e],n[kt]||{},n)}(t,e,n):t),{_next:function(){var t,n=r;return r=n?n[x]():null,n||(t=i)&&0<t[_]&&(N(t,function(t){try{t.func[A](t.self,t.args)}catch(n){Xn(e[It],2,73,"Unexpected Exception during onComplete - "+Bn(n))}}),i=[]),n},ctx:{core:function(){return e},diagLog:function(){return(e||{})[It]||new Gn(u)},getCfg:function(){return u},getExtCfg:a,getConfig:function(t,n,e){void 0===e&&(e=!1);var r,t=a(t,null);return t&&!P(t[n])?r=t[n]:u&&!P(u[n])&&(r=u[n]),P(r)?e:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(t){r=t},iterate:function(t){for(;n=o._next();){var n=n[Pt]();n&&t(n)}},onComplete:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];t&&i[y]({func:t,self:E(n)?o.ctx:n,args:e})}}});function a(t,n,e){var r,i,o;return void 0===n&&(n={}),void 0===e&&(e=0),(r=u&&(i=u[Qt])&&t?i[t]:r)?_n(n)&&0!==e&&(o=function p(){var t=arguments,n=t[0]||{},e=t[_],r=!1,i=1;for(0<e&&"boolean"==typeof n&&(r=n,n=t[i]||{},i++),_n(n)||(n={});i<e;i++){var o,u,a,c,f=t[i],l=O(f),s=_n(f);for(o in f)(l&&o in f||s&&F[A](f,o))&&(u=f[o],a=void 0,r&&u&&((a=O(u))||wn(u))&&(c=n[o],a?O(c)||(c=[]):wn(c)||(c={}),u=p(r,c,u)),u!==undefined&&(n[o]=u))}return n}(!0,n,r),u&&2===e&&Cn(n,function(t){var n;P(o[t])&&!P(n=u[t])&&(o[t]=n)}),r=o):r=n,r}return o}function Re(t,e,r,n){var i=Le(t,e,r,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n[I](t,o),!n},o[jt]=function(t,n){return Re((t=O(t=void 0===t?null:t)?ze(t,e,r,n):t)||o[x](),e,r,n)},o}function ze(t,n,e,r){var i,o=null,u=!r;return O(t)&&0<t[_]&&(i=null,N(t,function(t){(u=!u&&r===t||u)&&t&&M(t[I])&&(t=Ve(t,n,e),o=o||t,i&&i._setNext(t),i=t)})),r&&!o?ze([r],n,e):o}function Ve(c,r,i){var f=null,o=M(c[I]),u=M(c[Ut]),l=c?c[At]+"-"+c[Yt]+"-"+je++:"Unknown-0-"+je++,a={getPlugin:function(){return c},getNext:function(){return f},processTelemetry:function(e,t){var n;s(t=t||(n=(n=c&&M(c[Ue])?c[Ue]():n)||Re(a,r,i)),function(t){if(!c||!o)return!1;var n=Oe(c);return!n[C]&&!n[Xt]&&(u&&c[Ut](f),c[I](e,t),!0)},"processTelemetry",function(){return{item:e}},!e.sync)||t[T](e)},unload:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Oe(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||(t[k]=null,t[C]=!0,t[bt]=!1,c[C]&&!0===c[C](r,i)&&(e=!0))),e},"unload",function(){},i[Ot])||r[T](i)},update:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Oe(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||c[Dt]&&!0===c[Dt](r,i)&&(e=!0)),e},"update",function(){},!1)||r[T](i)},_id:l,_setNext:function(t){f=t}};function s(e,r,i,t,n){var o=!1,u=c?c[At]:Ne,a=(a=e[De])||(e[De]={});return e.setNext(f),c&&ne(e[k](),function(){return u+":"+i},function(){a[l]=!0;try{var t=f?f._id:b;t&&(a[t]=!1),o=r(e)}catch(n){t=!f||a[f._id];t&&(o=!0),f&&t||Xn(e[w](),1,73,"Plugin ["+u+"] failed during "+i+" - "+Bn(n)+", run flags: "+Bn(a))}},t,n),o}return bn(a)}function Ke(){var n=[];return{add:function(t){t&&n[y](t)},run:function(e,r){N(n,function(t){try{t(e,r)}catch(n){Xn(e[w](),2,73,"Unexpected error calling unload handler - "+Bn(n))}}),n=[]}}}var Be,R="getPlugin";function We(){var i,o,l,s,p,u=this;function n(t){var n,t=t=void 0===t?null:t;return t||(n=o||Re(null,{},u[k]),t=l&&l[R]?n[jt](null,l[R]):n[jt](null,l)),t}function c(t,n,e){t&&j(t,Qt,[],null,P),!e&&n&&(e=n.getProcessTelContext()[x]());var r=l;l&&l[R]&&(r=l[R]()),u[k]=n,o=Re(e,t,n,r)}function d(){i=!1,u[k]=null,l=o=null,p=[],s=Ke()}d(),xt(We,u,function(f){f.initialize=function(t,n,e,r){c(t,n,r),i=!0},f[C]=function(t,n){var e,r,i,o,u=f[k];if(u&&(!t||u===t[k]()))return r=!1,i=t||function c(t,e,n){var r=e[kt]||{},i=Le(t,r,e,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n.unload(o,t),!n},o[jt]=function(t,n){return c((t=O(t=void 0===t?null:t)?ze(t,r,e,n):t)||o[x](),e,n)},o}(null,u,l&&l[R]?l[R]():l),o=n||((t={reason:0})[Ot]=!1,t),f[Nt]&&!0===f[Nt](i,o,a)?e=!0:a(),e;function a(){var t;r||(r=!0,s.run(i,n),t=p,p=[],N(t,function(t){t.rm()}),!0===e&&i[T](o),d())}},f[Dt]=function(t,n){var e,r,i,o=f[k];if(o&&(!t||o===t[k]()))return r=!1,i=t||function a(t,e,n){var r=e[kt]||{},i=Le(t,r,e,n).ctx;return i[T]=function(n){return i.iterate(function(t){M(t[Dt])&&t[Dt](i,n)})},i[jt]=function(t,n){return a((t=O(t=void 0===t?null:t)?ze(t,r,e,n):t)||i[x](),e,n)},i}(null,o,l&&l[R]?l[R]():l),f._doUpdate&&!0===f._doUpdate(i,n||{reason:0},u)?e=!0:u(),e;function u(){r||(r=!0,c(i.getCfg(),i.core(),i[x]()))}},f._addHook=function(t){t&&(O(t)?p=p.concat(t):p[y](t))},En(f,"_addUnloadCb",function(){return s},"add")}),u[w]=function(t){return n(t)[w]()},u[bt]=function(){return i},u.setInitialized=function(t){i=t},u[Ut]=function(t){l=t},u[T]=function(t,n){n?n[T](t):l&&M(l[I])&&l[I](t,null)},u._getTelCtx=n}function Je(){var a,c,f,l,s=Be.call(this)||this;return s.priority=185,s.identifier="ReactPlugin",xt(Je,s,function(i,t){var n,e,r;function o(){l=f=c=a=null}function u(){return a||Xn(i.diagLog(),1,64,"Analytics plugin is not available, React plugin telemetry will not be sent: "),a}o(),i.initialize=function(t,n,e,r){Be.prototype.initialize.call(s,t,n,e,r),c=t.extensionConfig&&t.extensionConfig[i.identifier]?t.extensionConfig[i.identifier]:{history:null},N(e,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(a=t)}),c.history&&(n=c.history,f=n.listen(function(t){var n="location"in t?t.location:t;l=setTimeout(function(){l=null;var t={uri:n.pathname};i.trackPageView(t)},500)}),r={uri:c.history.location.pathname},i.trackPageView(r))},i.getCookieMgr=function(){return(n=(e=i.core)?e.getCookieMgr():n)||(e=(e||{})[It],(r=Ae[ge]||xe[ge])||(r=Ae[ge]=Ae(t,e),xe[ge]=r),n=r),n;var t,n,e,r},i.getAppInsights=u,i.processTelemetry=function(t,n){i.processNext(t,n)},i._doTeardown=function(t,n,e){M(f)&&f(),l&&clearTimeout(l),o()},e=u,r=["trackMetric","trackPageView","trackEvent","trackException","trackTrace"],(n=i)&&e&&_n(n)&&O(r)&&N(r,function(t){xn(t)&&En(n,t,e,t,void 0)}),An(i,"_extensionConfig",function(){return c})}),s}We.__ieDyn=1,Q(Je,Be=We),Je.__ieDyn=1;var qe,cn=Je,Fe=(Q($e,qe=p.Component),$e.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=U(),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&&U()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=U(),t._idleCount++)},100)},$e.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,n;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),n={"Component Name":this._componentName},this._reactPlugin.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},n))},$e.prototype.getEngagementTimeSeconds=function(){return(U()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},$e);function $e(t,n,e){var r=qe.call(this,t)||this;return r._mountTimestamp=0,r._firstActiveTimestamp=0,r._idleStartTimestamp=0,r._lastActiveTimestamp=0,r._totalIdleTime=0,r._idleCount=0,r._idleTimeout=5e3,r.trackActivity=function(t){var n;0===r._firstActiveTimestamp?(r._firstActiveTimestamp=U(),r._lastActiveTimestamp=r._firstActiveTimestamp):r._lastActiveTimestamp=U(),0<r._idleStartTimestamp&&(n=r._lastActiveTimestamp-r._idleStartTimestamp,r._totalIdleTime+=n,r._idleStartTimestamp=0)},r._reactPlugin=n,r._componentName=e,r}Ge={},Cn({Verbose:0,Information:1,Warning:2,Error:3,Critical:4},function(t,n){Ge[t]=n,Ge[n]=t}),q=Ge,an&&Cn(q,function(t,n){(O(n)||_n(n))&&an(n)});var Ge,He,Xe=bn(q);function Qe(){var t=null!==He&&He.apply(this,arguments)||this;return t.state={hasError:!1},t}Q(Qe,He=z["default"].Component),Qe.prototype.componentDidCatch=function(t,n){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:Xe.Error,properties:n})},Qe.prototype.render=function(){var t;return this.state.hasError?(t=this.props.onError,z["default"].createElement(t)):this.props.children};var Ye=Qe,Ze=a.createContext(undefined);t.AITrackedComponentBase=Fe,t.AppInsightsContext=Ze,t.AppInsightsErrorBoundary=Ye,t.ReactPlugin=cn,t.useAppInsightsContext=function(){return a.useContext(Ze)},t.useTrackEvent=function(t,n,e,r){void 0===r&&(r=!0);var e=a.useState(e),i=e[0],e=e[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:n},i)},[t,i,n]),e},t.useTrackMetric=function(r,i,o){var u=a.useRef({hookTimestamp:U(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=u.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&U()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=U(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t,n=u.current;if(0===n.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==n.firstActiveTimestamp&&(n=n,n={average:(U()-n.firstActiveTimestamp-n.totalIdleTime-n.idleCount*n.idleTimeout)/1e3,name:"React Component Engaged Time (seconds)",sampleCount:1},t=H({"Component Name":i},o),r.trackMetric(n,t))}},[]),function(){var t,n=u.current;0===n.firstActiveTimestamp?(n.firstActiveTimestamp=U(),n.lastActiveTimestamp=n.firstActiveTimestamp):n.lastActiveTimestamp=U(),0<n.idleStartTimestamp&&(t=n.lastActiveTimestamp-n.idleStartTimestamp,n.totalIdleTime+=t,n.idleStartTimestamp=0)}},t.withAITracking=function(n,t,e,r){return e!==undefined&&null!==e&&"string"==typeof e||(e=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),r!==undefined&&null!==r&&"string"==typeof r||(r=""),Q(i,o=Fe),i.prototype.render=function(){return p.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:r},p.createElement(t,H({},this.props)))},i;function i(t){return o.call(this,t,n,e)||this}var o},Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);
|
|
6
6
|
//# sourceMappingURL=applicationinsights-react-js.min.js.map
|