@microsoft/applicationinsights-react-native 2.4.4-nightly.2202-08 → 2.4.4
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/browser/applicationinsights-react-native.js +1 -1
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +2 -2
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +1 -1
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +2 -2
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativePlugin.js +1 -1
- package/dist-esm/index.js +1 -1
- package/package.json +67 -70
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.4.4
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.4.4
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
var e=this,n=function(t,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var l=i(r),s="function",h="object",o="undefined",u="prototype",c="hasOwnProperty",d=Object,r=d[u],x=(d.create,d.defineProperty),m=r[c],n=null;function I(e){return void 0===e&&(e=!0),n&&e||(typeof globalThis!==o&&globalThis&&(n=globalThis),typeof self!==o&&self&&(n=self),typeof window!==o&&window&&(n=window),typeof global!==o&&global&&(n=global)),n}function b(e){throw new TypeError(e)}(I()||{}).Symbol,(I()||{}).Reflect;var w=function(e,n){return(w=d.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[c](t)&&(e[t]=n[t])})(e,n)},T="constructor",v="prototype",_="function",L="_dynInstFuncs",N="_isDynProxy",p="_dynClass",P="_dynInstChk",E=P,A="_dfOpts",D="_unknown_",R="__proto__",M="useBaseInst",O="setInstFuncs",j=Object,K=j.getPrototypeOf,S=0;function y(e,n){return e&&j[v].hasOwnProperty.call(e,n)}function U(e){return e&&(e===j[v]||e===Array[v])}function k(e){return U(e)||e===Function[v]}function C(e){if(e){if(K)return K(e);e=e[R]||e[v]||(e[T]?e[T][v]:null);if(e)return e}return null}function z(e,n){var t=[],r=j.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&y(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function H(e,n,t){return n!==T&&typeof e[n]===_&&(t||y(e,n))}function q(e){throw new TypeError("DynamicProto: "+e)}function F(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function G(e,n){return y(e,v)?e.name||n||D:((e||{})[T]||{}).name||n||D}function W(e,r,n,t){y(e,v)||q("theClass is an invalid class definition.");var c,i,o,l,f,g,a=e[v],s=(function(e){if(K)for(var n=[],t=C(r);t&&!k(t)&&!F(n,t);){if(t===e)return 1;n.push(t),t=C(t)}}(a)||q("["+G(e)+"] is not in class hierarchy of ["+G(r)+"]"),null),e=(y(a,p)?s=a[p]:(s="_dynCls$"+G(e,"_")+"$"+S,S++,a[p]=s),W[A]),u=!!e[M],d=(u&&t&&t[M]!==undefined&&(u=!!t[M]),i={},z(c=r,function(e){!i[e]&&H(c,e,!1)&&(i[e]=c[e])}),i),u=(n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[N]&&o&&!1!==(r=e[L]||{})[E]&&(i=(r[n[p]]||{})[t]||i),function(){return i.apply(e,arguments)}}for(var i={},l=(z(t,function(e){i[e]=r(n,t,e)}),C(e)),a=[];l&&!k(l)&&!F(a,l);)z(l,function(e){!i[e]&&H(l,e,!K)&&(i[e]=r(n,l,e))}),a.push(l),l=C(l);return i}(a,r,d,u)),!!K&&!!e[O]);o=a,n=s,l=r,f=d,e=!1!==(u=u&&t?!!t[O]:u),U(o)||(a=l[L]=l[L]||{},g=a[n]=a[n]||{},!1!==a[E]&&(a[E]=!!e),z(l,function(e){var t,r,i;H(l,e,!1)&&l[e]!==f[e]&&(g[e]=l[e],delete l[e],y(o,e)&&(!o[e]||o[e][N])||(o[e]=(t=o,r=e,(i=function(){var e,n;return(function(e,n,t,c){var r=null;if(e&&y(t,p)){var i=e[L]||{};if((r=(i[t[p]]||{})[n])||q("Missing ["+n+"] "+_),!r[P]&&!1!==i[E]){for(var o=!y(e,n),l=C(e),a=[];o&&l&&!k(l)&&!F(a,l);){var s=l[n];if(s){o=s===c;break}a.push(l),l=C(l)}try{o&&(e[n]=r),r[P]=1}catch(u){i[E]=!1}}}return r}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?C(t)[e]:n)!==_&&q("["+e+"] is not a "+_),n)).apply(this,arguments)})[N]=1,i)))}))}W[A]={setInstFuncs:!0,useBaseInst:!0};var J={CRITICAL:1,1:"CRITICAL",WARNING:2,2:"WARNING"},V=73,e="toString",B=x,x=Array.isArray,$=r[e];function Q(e){return e===undefined||typeof e===o}function f(e){return null===e||Q(e)}function g(e){return!(!e||typeof e!==s)}m[e].call(d);var X=x||function(e){return!(!e||"[object Array]"!==$.call(e))};function Y(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function Z(){var e=Date;return e.now?e.now():(new e).getTime()}var ee="window",ne="JSON";function te(e){var n=I();return n&&n[e]?n[e]:e===ee&&typeof window===h&&window?window:null}function re(){return typeof JSON===h&&JSON||null!==te(ne)}function ie(){return re()?JSON||te(ne):null}function oe(e){var n=Object[u].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":re()&&(t=ie().stringify(e)),n+t}var le=null;function ae(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function se(e,n){var t,r=typeof console!==o?console:te("console");r&&(t="log",g(r[t=r[e]?e:t])&&r[t](n))}ce.dataType="MessageData";var ue=ce;function ce(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;t="",re()&&(t=ie().stringify(r)),e=(n?" message:"+ae(n):"")+(r?" props:"+ae(t):"");this.message+=e}var fe=function Ne(i){this.identifier="DiagnosticLogger",this.queue=[];var a=0,s={};W(Ne,this,function(o){function e(e,n){e=i[e];return f(e)?n:e}function l(e,n){var t,r=(t=(t=le)||!0===i.disableDbgExt?t:le||(r=te("Microsoft"),le=r?r.ApplicationInsights:le))?t.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,n)}f(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){n=new ue(n,t,i=void 0!==i&&i,r);if(o.enableDebugExceptions())throw n;t=e===J.CRITICAL?"errorToConsole":"warnToConsole";Q(n.message)?l("throw"+(e===J.CRITICAL?"Critical":"Warning"),n):(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!s[i]&&e<=r&&(o[t](n.message),s[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){se("warn",e),l("warning",e)},o.errorToConsole=function(e){se("error",e),l("error",e)},o.resetInternalMessageCount=function(){a=0,s={}},o.logInternalMessage=function(e,n){var t,r;a>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,s[t]?r=!1:s[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),a++,l(e===J.CRITICAL?"error":"warn",n)),a===o.maxInternalMessageLimit()&&(r=new ue(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),e===J.CRITICAL?o.errorToConsole(t):o.warnToConsole(t))))}})},ge=(a.ParentContextKey="parent",a.ChildrenContextKey="childEvts",a);function a(e,i,n){var r,o=this,l=!1;o.start=Z(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},g(i)&&(l=function(e){if(B)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&g(i)&&(r=i(),i=null),r}};return B(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===a.ParentContextKey||e===a.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===a.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===a.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(a.ChildrenContextKey);if(X(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=Z()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&g(i)&&(o.payload=i())}}var de="CoreUtils.doPerf";function ve(e,n,t,r,i){if(e)if(e=g(e.getPerfMgr)?e.getPerfMgr():e){var o,l=void 0,a=e.getCtx(de);try{if(l=e.create(n(),r,i))return a&&l.setCtx&&(l.setCtx(ge.ParentContextKey,a),a.getCtx&&a.setCtx&&((o=a.getCtx(ge.ChildrenContextKey))||(o=[],a.setCtx(ge.ChildrenContextKey,o)),o.push(l))),e.setCtx(de,l),t(l)}catch(s){l&&l.setCtx&&l.setCtx("exception",s)}finally{l&&e.fire(l),e.setCtx(de,a)}}return t()}var pe=function(i,n){var o=this,l=null,a=g(i.processTelemetry),s=g(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ve(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&a){o._hasRun=!0;try{r.setNext(l),s&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(J.CRITICAL,V,"Plugin ["+i.identifier+"] failed during processTelemetry - "+oe(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function ye(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&g(o.processTelemetry)&&(o=new pe(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var Ce,he=function Pe(e,i,t,n){var r,o,l,a,s=this,u=null;null!==n&&(e&&g(e.getPlugin)?u=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),ye(r,n)}(e,s,n||e.getPlugin()):n?(r=s,l=e,a=!1,(o=n)&&e&&(l=[],Y(e,function(e){!a&&e!==o||(a=!0,l.push(e))})),o&&!a&&(l=l||[]).push(o),u=ye(l,r)):Q(n)&&(u=ye(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new fe(i)},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){void 0===t&&(t=!1);var r,e=s.getExtCfg(e,null);return e&&!f(e[n])?r=e[n]:i&&!f(i[n])&&(r=i[n]),f(r)?t:r},s.hasNext=function(){return null!=u},s.getNext=function(){return u},s.setNext=function(e){u=e},s.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return new Pe((e=void 0===e?null:e)||u,i,t,n)}},xe="getPlugin",r=(me.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},me);function me(){var a=this,s=!1,u=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return s},a.setInitialized=function(e){s=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,n){n?n.processNext(e):c&&g(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){var n,e=e=void 0===e?null:e;return e||(n=u||new he(null,{},a.core),e=c&&c[xe]?n.createNew(null,c[xe]):n.createNew(null,c)),e},a._baseTelInit=function(e,n,t,r){e&&(l="extensionConfig",o=i=[],!e||(o=e[l])!==i&&f(o)&&(e[l]=o=i)),!r&&n&&(r=n.getProcessTelContext().getNext());var i,o,l=c;c&&c[xe]&&(l=c[xe]()),a.core=n,u=new he(r,e,n,l),s=!0}}Ce={Verbose:0,0:"Verbose",Information:1,1:"Information",Warning:2,2:"Warning",Error:3,3:"Error",Critical:4,4:"Critical"},Te.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),t=(t&&e.extensionConfig&&e.extensionConfig[t]&&!f(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],f(t)?r:t};var Ie,be,we=Te;function Te(){}function _e(e){var f,r,n=Ie.call(this)||this,i=(n.identifier="AppInsightsReactNativePlugin",n.priority=140,{}),g=e||d();function d(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return W(_e,n,function(u,c){u.initialize=function(e,n,t){var r,i;if(!u.isInitialized()){c.initialize(e,n,t);var o=e||{},l=d(),a=function(e,n){g[e]=we.getConfig(o,e,u.identifier,Q(g[e])?n:g[e])};if("object"===h)for(var s in l)i=s,(r=l)&&m.call(r,i)&&a(s,l[s]);g.disableDeviceCollection||u._collectDeviceInfo(),t&&Y(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(f=e)}),g.disableExceptionCollection||u._setExceptionHandler()}},u.processTelemetry=function(e,n){var t=e;i&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof i.id&&(t.ext.device.localId=i.id),"string"==typeof i.model&&(t.ext.device.model=i.model),"string"==typeof i.deviceClass&&(t.ext.device.deviceClass=i.deviceClass)),u.processNext(e,n)},u.setDeviceId=function(e){i.id=e},u.setDeviceModel=function(e){i.model=e},u.setDeviceType=function(e){i.deviceClass=e},u._collectDeviceInfo=function(){try{i.deviceClass=l["default"].getDeviceType(),i.id=l["default"].getUniqueId(),i.model=l["default"].getModel()}catch(n){u.diagLog().warnToConsole("Failed to get DeviceInfo: "+((e=n)&&"[object Error]"===$.call(e)?e.name:"")+" - "+oe(n))}var e},u._setExceptionHandler=function(){var e=typeof global!==o&&global?global:I();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:Ce.Error};f?f.trackException(t):u.diagLog().throwInternal(J.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},u._config=g,u._getDbgPlgTargets=function(){return[i]}}),n}function Le(){this.constructor=be}be=_e,typeof(e=Ie=r)!==s&&null!==e&&b("Class extends value "+e+" is not a constructor or null"),w(be,e),be[u]=(Le[u]=e[u],new Le),t.ReactNativePlugin=_e,Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
|
|
5
|
+
var e=this,n=function(K,e){"use strict";function S(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var t=S(e),U="function",v="object",o="undefined",r="prototype",k="hasOwnProperty",i=Object,e=i[r],z=(i.create,i.defineProperty),H=e[k],n=null;function l(e){return void 0===e&&(e=!0),n&&e||(typeof globalThis!==o&&globalThis&&(n=globalThis),typeof self!==o&&self&&(n=self),typeof window!==o&&window&&(n=window),typeof global!==o&&global&&(n=global)),n}function q(e){throw new TypeError(e)}(l()||{}).Symbol,(l()||{}).Reflect;var F=function(e,n){return(F=i.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[k](t)&&(e[t]=n[t])})(e,n)},a="constructor",p="prototype",y="function",C="_dynInstFuncs",h="_isDynProxy",x="_dynClass",m="_dynInstChk",I=m,G="_dfOpts",W="_unknown_",J="__proto__",b="useBaseInst",V="setInstFuncs",s=Object,w=s.getPrototypeOf,B=0;function T(e,n){return e&&s[p].hasOwnProperty.call(e,n)}function $(e){return e&&(e===s[p]||e===Array[p])}function _(e){return $(e)||e===Function[p]}function L(e){if(e){if(w)return w(e);e=e[J]||e[p]||(e[a]?e[a][p]:null);if(e)return e}return null}function N(e,n){var t=[],r=s.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&T(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function P(e,n,t){return n!==a&&typeof e[n]===y&&(t||T(e,n))}function E(e){throw new TypeError("DynamicProto: "+e)}function Q(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function X(e,n){return T(e,p)?e.name||n||W:((e||{})[a]||{}).name||n||W}function A(e,r,n,t){T(e,p)||E("theClass is an invalid class definition.");var i,o,l,a,s,u,c=e[p],f=(function(e){if(w)for(var n=[],t=L(r);t&&!_(t)&&!Q(n,t);){if(t===e)return 1;n.push(t),t=L(t)}}(c)||E("["+X(e)+"] is not in class hierarchy of ["+X(r)+"]"),null),e=(T(c,x)?f=c[x]:(f="_dynCls$"+X(e,"_")+"$"+B,B++,c[x]=f),A[G]),g=!!e[b],d=(g&&t&&t[b]!==undefined&&(g=!!t[b]),o={},N(i=r,function(e){!o[e]&&P(i,e,!1)&&(o[e]=i[e])}),o),g=(n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[h]&&o&&!1!==(r=e[C]||{})[I]&&(i=(r[n[x]]||{})[t]||i),function(){return i.apply(e,arguments)}}for(var i={},l=(N(t,function(e){i[e]=r(n,t,e)}),L(e)),a=[];l&&!_(l)&&!Q(a,l);)N(l,function(e){!i[e]&&P(l,e,!w)&&(i[e]=r(n,l,e))}),a.push(l),l=L(l);return i}(c,r,d,g)),!!w&&!!e[V]);l=c,n=f,a=r,s=d,e=!1!==(g=g&&t?!!t[V]:g),$(l)||(c=a[C]=a[C]||{},u=c[n]=c[n]||{},!1!==c[I]&&(c[I]=!!e),N(a,function(e){var t,r,i;P(a,e,!1)&&a[e]!==s[e]&&(u[e]=a[e],delete a[e],T(l,e)&&(!l[e]||l[e][h])||(l[e]=(t=l,r=e,(i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&T(t,x)){var o=e[C]||{};if((i=(o[t[x]]||{})[n])||E("Missing ["+n+"] "+y),!i[m]&&!1!==o[I]){for(var l=!T(e,n),a=L(e),s=[];l&&a&&!_(a)&&!Q(s,a);){var u=a[n];if(u){l=u===r;break}s.push(a),a=L(a)}try{l&&(e[n]=i),i[m]=1}catch(c){o[I]=!1}}}return i}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?L(t)[e]:n)!==y&&E("["+e+"] is not a "+y),n)).apply(this,arguments)})[h]=1,i)))}))}A[G]={setInstFuncs:!0,useBaseInst:!0};var D={CRITICAL:1,1:"CRITICAL",WARNING:2,2:"WARNING"},Y=73,u="toString",Z=z,z=Array.isArray,ee=e[u];function R(e){return e===undefined||typeof e===o}function f(e){return null===e||R(e)}function g(e){return!(!e||typeof e!==U)}H[u].call(i);var ne=z||function(e){return!(!e||"[object Array]"!==ee.call(e))};function te(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function re(){var e=Date;return e.now?e.now():(new e).getTime()}var ie="window",oe="JSON";function c(e){var n=l();return n&&n[e]?n[e]:e===ie&&typeof window===v&&window?window:null}function le(){return typeof JSON===v&&JSON||null!==c(oe)}function ae(){return le()?JSON||c(oe):null}function se(e){var n=Object[r].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":le()&&(t=ae().stringify(e)),n+t}var d=null;function ue(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function ce(e,n){var t,r=typeof console!==o?console:c("console");r&&(t="log",g(r[t=r[e]?e:t])&&r[t](n))}ge.dataType="MessageData";var fe=ge;function ge(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;t="",le()&&(t=ae().stringify(r)),e=(n?" message:"+ue(n):"")+(r?" props:"+ue(t):"");this.message+=e}var de=function Ne(i){this.identifier="DiagnosticLogger",this.queue=[];var a=0,s={};A(Ne,this,function(o){function e(e,n){e=i[e];return f(e)?n:e}function l(e,n){var t,r=(t=(t=d)||!0===i.disableDbgExt?t:d||(r=c("Microsoft"),d=r?r.ApplicationInsights:d))?t.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,n)}f(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){n=new fe(n,t,i=void 0!==i&&i,r);if(o.enableDebugExceptions())throw n;t=e===D.CRITICAL?"errorToConsole":"warnToConsole";R(n.message)?l("throw"+(e===D.CRITICAL?"Critical":"Warning"),n):(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!s[i]&&e<=r&&(o[t](n.message),s[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){ce("warn",e),l("warning",e)},o.errorToConsole=function(e){ce("error",e),l("error",e)},o.resetInternalMessageCount=function(){a=0,s={}},o.logInternalMessage=function(e,n){var t,r;a>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,s[t]?r=!1:s[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),a++,l(e===D.CRITICAL?"error":"warn",n)),a===o.maxInternalMessageLimit()&&(r=new fe(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),e===D.CRITICAL?o.errorToConsole(t):o.warnToConsole(t))))}})},ve=(M.ParentContextKey="parent",M.ChildrenContextKey="childEvts",M);function M(e,i,n){var r,o=this,l=!1;o.start=re(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},g(i)&&(l=function(e){if(Z)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&g(i)&&(r=i(),i=null),r}};return Z(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===M.ParentContextKey||e===M.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===M.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===M.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(M.ChildrenContextKey);if(ne(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=re()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&g(i)&&(o.payload=i())}}var pe="CoreUtils.doPerf";function ye(e,n,t,r,i){if(e)if(e=g(e.getPerfMgr)?e.getPerfMgr():e){var o,l=void 0,a=e.getCtx(pe);try{if(l=e.create(n(),r,i))return a&&l.setCtx&&(l.setCtx(ve.ParentContextKey,a),a.getCtx&&a.setCtx&&((o=a.getCtx(ve.ChildrenContextKey))||(o=[],a.setCtx(ve.ChildrenContextKey,o)),o.push(l))),e.setCtx(pe,l),t(l)}catch(s){l&&l.setCtx&&l.setCtx("exception",s)}finally{l&&e.fire(l),e.setCtx(pe,a)}}t()}var Ce=function(i,n){var o=this,l=null,a=g(i.processTelemetry),s=g(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ye(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&a){o._hasRun=!0;try{r.setNext(l),s&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(D.CRITICAL,Y,"Plugin ["+i.identifier+"] failed during processTelemetry - "+se(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function he(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&g(o.processTelemetry)&&(o=new Ce(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var xe,me=function Pe(e,i,t,n){var r,o,l,a,s=this,u=null;null!==n&&(e&&g(e.getPlugin)?u=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),he(r,n)}(e,s,n||e.getPlugin()):n?(r=s,l=e,a=!1,(o=n)&&e&&(l=[],te(e,function(e){!a&&e!==o||(a=!0,l.push(e))})),o&&!a&&(l=l||[]).push(o),u=he(l,r)):R(n)&&(u=he(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new de(i)},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),(t=i&&(r=i.extensionConfig)&&e?r[e]:t)||n},s.getConfig=function(e,n,t){void 0===t&&(t=!1);var r,e=s.getExtCfg(e,null);return e&&!f(e[n])?r=e[n]:i&&!f(i[n])&&(r=i[n]),f(r)?t:r},s.hasNext=function(){return null!=u},s.getNext=function(){return u},s.setNext=function(e){u=e},s.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return new Pe((e=void 0===e?null:e)||u,i,t,n)}},O="getPlugin",e=(Ie.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Ie);function Ie(){var a=this,s=!1,u=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return s},a.setInitialized=function(e){s=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,n){n?n.processNext(e):c&&g(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){var n,e=e=void 0===e?null:e;return e||(n=u||new me(null,{},a.core),e=c&&c[O]?n.createNew(null,c[O]):n.createNew(null,c)),e},a._baseTelInit=function(e,n,t,r){e&&(l="extensionConfig",o=i=[],e&&(o=e[l])!==i&&f(o)&&(e[l]=o=i)),!r&&n&&(r=n.getProcessTelContext().getNext());var i,o,l=c;c&&c[O]&&(l=c[O]()),a.core=n,u=new me(r,e,n,l),s=!0}}xe={Verbose:0,0:"Verbose",Information:1,1:"Information",Warning:2,2:"Warning",Error:3,3:"Error",Critical:4,4:"Critical"},Te.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),t=(t&&e.extensionConfig&&e.extensionConfig[t]&&!f(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],f(t)?r:t};var j,be,we=Te;function Te(){}function _e(){this.constructor=j}function Le(e){var f,r,n=be.call(this)||this,i=(n.identifier="AppInsightsReactNativePlugin",n.priority=140,{}),g=e||d();function d(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return A(Le,n,function(u,c){u.initialize=function(e,n,t){var r,i;if(!u.isInitialized()){c.initialize(e,n,t);var o=e||{},l=d(),a=function(e,n){g[e]=we.getConfig(o,e,u.identifier,R(g[e])?n:g[e])};if("object"===v)for(var s in l)i=s,(r=l)&&H.call(r,i)&&a(s,l[s]);g.disableDeviceCollection||u._collectDeviceInfo(),t&&te(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(f=e)}),g.disableExceptionCollection||u._setExceptionHandler()}},u.processTelemetry=function(e,n){var t=e;i&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof i.id&&(t.ext.device.localId=i.id),"string"==typeof i.model&&(t.ext.device.model=i.model),"string"==typeof i.deviceClass&&(t.ext.device.deviceClass=i.deviceClass)),u.processNext(e,n)},u.setDeviceId=function(e){i.id=e},u.setDeviceModel=function(e){i.model=e},u.setDeviceType=function(e){i.deviceClass=e},u._collectDeviceInfo=function(){try{i.deviceClass=t["default"].getDeviceType(),i.id=t["default"].getUniqueId(),i.model=t["default"].getModel()}catch(n){u.diagLog().warnToConsole("Failed to get DeviceInfo: "+((e=n)&&"[object Error]"===ee.call(e)?e.name:"")+" - "+se(n))}var e},u._setExceptionHandler=function(){var e=typeof global!==o&&global?global:l();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:xe.Error};f?f.trackException(t):u.diagLog().throwInternal(D.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},u._config=g,u._getDbgPlgTargets=function(){return[i]}}),n}j=Le,typeof(u=be=e)!==U&&null!==u&&q("Class extends value "+u+" is not a constructor or null"),F(j,u),j[r]=(_e[r]=u[r],new _e),K.ReactNativePlugin=Le,Object.defineProperty(K,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
|
|
6
6
|
//# sourceMappingURL=applicationinsights-react-native.min.js.map
|