@bugsnag/browser
Advanced tools
Comparing version 8.0.0-alpha.13 to 8.0.0
@@ -1,2 +0,2 @@ | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Bugsnag=e()}(function(){var r=["navigation","request","process","log","user","state","error","manual"],g=function(e,t,n){for(var r=n,o=0,a=e.length;o<a;o++)r=t(r,e[o],o,e);return r},h=function(e,o){return g(e,function(e,t,n,r){return o(t,n,r)?e.concat(t):e},[])},p=function(e,o){return g(e,function(e,t,n,r){return!0===e||t===o},!1)},i=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=!{toString:null}.propertyIsEnumerable("toString"),d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);if(!s)return n;for(var r=0,o=d.length;r<o;r++)Object.prototype.hasOwnProperty.call(e,d[r])&&n.push(d[r]);return n},t=function(t,n){return void 0===t&&(t=1),void 0===n&&(n=Infinity),function(e){return"number"==typeof e&&parseInt(""+e,10)===e&&t<=e&&e<=n}},o=function(e){return"function"==typeof e||i(e)&&h(e,function(e){return"function"==typeof e}).length===e.length},f=function(e){return"string"==typeof e&&!!e.length},v={},y=function(){return{unhandledExceptions:!0,unhandledRejections:!0}},u=(v.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:f},appVersion:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||f(e)}},appType:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||f(e)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},enabledErrorTypes:{defaultValue:y,message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(t){if("object"!=typeof t||!t)return!1;var e=a(t),n=a(y());return!(h(e,function(e){return p(n,e)}).length<e.length)&&!(0<h(a(t),function(e){return"boolean"!=typeof t[e]}).length)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},endpoints:{defaultValue:function(e){return void 0===e?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(e){return e&&"object"==typeof e&&f(e.notify)&&f(e.sessions)&&0===h(a(e),function(e){return!p(["notify","sessions"],e)}).length}},autoTrackSessions:{defaultValue:function(e){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(e){return null===e||i(e)&&h(e,function(e){return"string"==typeof e}).length===e.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(e){return"string"==typeof e&&e.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(e){return t(0,100)(e)}},enabledBreadcrumbTypes:{defaultValue:function(){return r},message:"should be null or a list of available breadcrumb types ("+r.join(",")+")",validate:function(e){return null===e||i(e)&&g(e,function(e,t){return!1===e?e:p(r,t)},!0)}},context:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||"string"==typeof e}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(e){return null===e||e&&g(a(e),function(e,t){return e&&p(["id","email","name"],t)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(e){return"object"==typeof e&&null!==e}},logger:{defaultValue:function(){return undefined},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(n){return!n||g(["debug","info","warn","error"],function(e,t){return e&&"function"==typeof n[t]},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(e){return i(e)&&e.length===h(e,function(e){return"string"==typeof e||e&&"function"==typeof e.test}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(e){return i(e)&&e.length===h(e,function(e){return e&&"object"==typeof e&&"function"==typeof e.load}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(e){return i(e)&&e.length===h(e,function(e){return e&&"object"==typeof e&&"string"==typeof e.name}).length}}},function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}),m=function(e,o){return g(e,function(e,t,n,r){return e.concat(o(t,n,r))},[])};function _(){return(_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o=v.schema,o={releaseStage:u({},o.releaseStage,{defaultValue:function(){return/^localhost(:\d+)?$/.test(window.location.host)?"development":"production"}}),appType:_({},o.appType,{defaultValue:function(){return"browser"}}),logger:u({},o.logger,{defaultValue:function(){return"undefined"!=typeof console&&"function"==typeof console.debug?b():undefined}})},b=function(){var n={},r=console.log;return m(["debug","info","warn","error"],function(e){var t=console[e];n[e]=("function"==typeof t?t:r).bind(console,"[bugsnag]")}),n},S=function(){function e(e,t,n,r){void 0===r&&(r=new Date),this.type=n,this.message=e,this.metadata=t,this.timestamp=r}return e.prototype.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},e}(),w={},E=(!function(e,t){"use strict";"object"==typeof w?w=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function l(e){return function(){return this[e]}}var e=["isConstructor","isEval","isNative","isToplevel"],t=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=e.concat(t,o,["args"]);function i(e){if(e instanceof Object)for(var t=0;t<a.length;t++)e.hasOwnProperty(a[t])&&e[a[t]]!==undefined&&this["set"+r(a[t])](e[a[t]])}i.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof i)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new i(e)}},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var s=0;s<e.length;s++)i.prototype["get"+r(e[s])]=l(e[s]),i.prototype["set"+r(e[s])]=function(t){return function(e){this[t]=Boolean(e)}}(e[s]);for(var u=0;u<t.length;u++)i.prototype["get"+r(t[u])]=l(t[u]),i.prototype["set"+r(t[u])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(t[u]);for(var c=0;c<o.length;c++)i.prototype["get"+r(o[c])]=l(o[c]),i.prototype["set"+r(o[c])]=function(t){return function(e){this[t]=String(e)}}(o[c]);return i}),{}),O=(!function(e,t){"use strict";"object"==typeof E?E=t(w):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(e.replace(/[\(\)]/g,""));return[e[1],e[2]||undefined,e[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){var t=(e=-1<e.indexOf("(eval ")?e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""):e).replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),t=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(n?n[1]:t.pop()),t=t.join(" ")||undefined,r=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:t,fileName:r,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){var t,n;return-1===(e=-1<e.indexOf(" > eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?new s({functionName:e}):(t=(t=e.match(n=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&t[1]?t[1]:undefined,n=this.extractLocation(e.replace(n,"")),new s({functionName:t,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e}))},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new s({fileName:i[2],lineNumber:i[1],source:n[o]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new s({functionName:i[3]||undefined,fileName:i[2],lineNumber:i[1],source:n[o]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),n=n.shift()||"",o=n.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined,n=(t=n.match(/\(([^\)]*)\)/)?n.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"):t)===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}}),E),j=function(e,t,n,r){var o=r&&r.redactedKeys?r.redactedKeys:[],r=r&&r.redactedPaths?r.redactedPaths:[];return JSON.stringify(B(e,o,r),t,n)},N=20,x=25e3,k=8,L="...";function R(e){return"[Throws: "+(e?e.message:"?")+"]"}function T(e,t){try{return e[t]}catch(n){return R(n)}}function B(e,d,f){var g=[],h=0;return function p(e,t){function n(){return t.length>k&&x<h}if(h++,t.length>N)return L;if(n())return L;if(null===e||"object"!=typeof e)return e;if(function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return 1}(g,e))return"[Circular]";if(g.push(e),"function"==typeof e.toJSON)try{h--;var r=p(e.toJSON(),t);return g.pop(),r}catch(u){return R(u)}if((r=e)instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(r)))return h--,r=p({name:e.name,message:e.message},t),g.pop(),r;if("[object Array]"===Object.prototype.toString.call(e)){for(var o=[],a=0,l=e.length;a<l;a++){if(n()){o.push(L);break}o.push(p(e[a],t.concat("[]")))}return g.pop(),o}var i={};try{for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(function(e,t){for(var n=0,r=e.length;n<r;n++)if(0===t.indexOf(e[n]))return 1}(f,t.join("."))&&function(e,t){for(var n=0,r=e.length;n<r;n++){if("string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase())return 1;if(e[n]&&"function"==typeof e[n].test&&e[n].test(t))return 1}}(d,s))i[s]="[REDACTED]";else{if(n()){i[s]=L;break}i[s]=p(T(e,s),t.concat(s))}}catch(c){}return g.pop(),i}(e,[])}function M(e,t,n,r){var o;"string"==typeof n&&(r===undefined?r=null:null!==r&&"string"!=typeof r&&(r=j(r)),"number"!=typeof(o=t[n])?(e.push({name:n,variant:r}),t[n]=e.length-1):e[o]={name:n,variant:r})}var q={add:M,clear:function(e,t,n){var r=t[n];"number"==typeof r&&(e[r]=null,delete t[n])},merge:function(e,t,n){if(i(t)){for(var r=0;r<t.length;++r){var o=t[r];null!==o&&"object"==typeof o&&M(e,n,o.name,o.variant)}return e}},toEventApi:function(e){return m(h(e,Boolean),function(e){var t=e.name,e=e.variant,t={featureFlag:t};return"string"==typeof e&&(t.variant=e),t})}},I=function(e){return!(!e||!e.stack&&!e.stacktrace&&!e["opera#sourceloc"]||"string"!=typeof(e.stack||e.stacktrace||e["opera#sourceloc"])||e.stack===e.name+": "+e.message)};var D=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},C=function(e,t,n){"string"==typeof t&&(n?"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&e[t]&&delete e[t][n]:delete e[t])},A=function(e,t,n,r){var o,a;if(t){if(null===n)return C(e,t);"object"==typeof n&&(a=n),"string"==typeof n&&((o={})[n]=r,a=o),a&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]||(e[t]={}),e[t]=u({},e[t],a))}},F=function(e,t,n){return"string"!=typeof t?undefined:n?e[t]?e[t][n]:undefined:e[t]},P=C,V={};function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}!function(e,t){"use strict";"object"==typeof V?V=t(w):e.StackGenerator=t(e.StackFrame)}(this,function(s){return{backtrace:function(e){for(var t=[],n=10,r=("object"==typeof e&&"number"==typeof e.maxStackSize&&(n=e.maxStackSize),arguments.callee);r&&t.length<n&&r.arguments;){for(var o=new Array(r.arguments.length),a=0;a<o.length;++a)o[a]=r.arguments[a];/function(?:\s+([\w$]+))+\s*\(/.test(r.toString())?t.push(new s({functionName:RegExp.$1||undefined,args:o})):t.push(new s({args:o}));try{r=r.caller}catch(i){break}}return t}}});var l=function(){function a(e,t,n,r,o){void 0===n&&(n=[]),void 0===r&&(r=U()),this.apiKey=undefined,this.context=undefined,this.groupingHash=undefined,this.originalError=o,this._handledState=r,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=undefined,this._correlation=undefined,this.errors=[J(e,t,a.__type,n)]}var e=a.prototype;return e.addMetadata=function(e,t,n){return A(this._metadata,e,t,n)},e.setTraceCorrelation=function(e,t){"string"==typeof e&&(this._correlation=H({traceId:e},"string"==typeof t?{spanId:t}:{}))},e.getMetadata=function(e,t){return F(this._metadata,e,t)},e.clearMetadata=function(e,t){return P(this._metadata,e,t)},e.addFeatureFlag=function(e,t){q.add(this._features,this._featuresIndex,e,t=void 0===t?null:t)},e.addFeatureFlags=function(e){q.merge(this._features,e,this._featuresIndex)},e.getFeatureFlags=function(){return q.toEventApi(this._features)},e.clearFeatureFlag=function(e){q.clear(this._features,this._featuresIndex,e)},e.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},e.getUser=function(){return this._user},e.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},e.toJSON=function(){return{payloadVersion:"4",exceptions:m(this.errors,function(e){return u({},e,{message:e.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},a}(),K=function(e){e={file:e.fileName,method:$(e.functionName),lineNumber:e.lineNumber,columnNumber:e.columnNumber,code:undefined,inProject:undefined};return-1<e.lineNumber&&!e.file&&!e.method&&(e.file="global code"),e},$=function(e){return/^global code$/i.test(e)?"global code":e},U=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},X=function(e){return"string"==typeof e?e:""};function J(e,t,n,r){return{errorClass:X(e),errorMessage:X(t),type:n,stacktrace:g(r,function(e,t){t=K(t);try{return"{}"===JSON.stringify(t)?e:e.concat(t)}catch(n){return e}},[])}}l.getStacktrace=function(e,t,n){if(I(e))return O.parse(e).slice(t);try{return h(V.backtrace(),function(e){return-1===(e.functionName||"").indexOf("StackGenerator$$")}).slice(1+n)}catch(r){return[]}},l.create=function(e,t,n,r,o,a){void 0===o&&(o=0);var t=G(e,t,r,a),a=t[0],t=t[1];try{var i=l.getStacktrace(a,0<t?1+t+o:0,1+o),s=new l(a.name,a.message,i,n,e)}catch(u){s=new l(a.name,a.message,[],n,e)}return"InvalidError"===a.name&&s.addMetadata(""+r,"non-error parameter",z(e)),a.cause&&(t=function c(e){return e.cause?[e].concat(c(e.cause)):[e]}(a).slice(1),o=m(t,function(e){var t=D(e)&&I(e)?O.parse(e):[],n=G(e,!0,"error cause")[0];return"InvalidError"===n.name&&s.addMetadata("error cause",z(e)),J(n.name,n.message,l.__type,t)}),(i=s.errors).push.apply(i,o)),s};var W,z=function(e){return null===e?"null":e===undefined?"undefined":e},G=function(e,t,n,r){var o,a=0,i=function(e){var t="error cause"===n?"was":"received",e=(r&&r.warn(n+" "+t+' a non-error: "'+e+'"'),new Error(n+" "+t+' a non-error. See "'+n+'" tab for more detail.'));return e.name="InvalidError",e};if(t)switch(typeof e){case"string":case"number":case"boolean":o=new Error(String(e)),a+=1;break;case"function":o=i("function"),a+=2;break;case"object":null!==e&&D(e)?o=e:null!==e&&Q(e)?((o=new Error(e.message||e.errorMessage)).name=e.name||e.errorClass,a+=1):(o=i(null===e?"null":"unsupported object"),a+=2);break;default:o=i("nothing"),a+=2}else D(e)?o=e:(o=i(typeof e),a+=2);if(!I(o))try{throw o}catch(s){I(s)&&(o=s,a=1)}return[o,a]},Q=(l.__type="browserjs",function(e){return!("string"!=typeof e.name&&"string"!=typeof e.errorClass||"string"!=typeof e.message&&"string"!=typeof e.errorMessage)}),Y=l,Z=function(e,t,n){var r=0,o=function(){if(r>=e.length)return n(null,!0);t(e[r],function(e,t){return e?n(e):!1===t?n(null,!1):(r++,void o())})};o()},ee=function(e,o,a,t){Z(e,function(e,n){if("function"!=typeof e)return n(null);try{var t;if(2!==e.length)return(t=e(o))&&"function"==typeof t.then?t.then(function(e){return setTimeout(function(){return n(null,e)})},function(e){setTimeout(function(){return a(e),n(null,!0)})}):n(null,t);e(o,function(e,t){if(e)return a(e),n(null);n(null,t)})}catch(r){a(r),n(null)}},t)},te=function(e,t,n,r){for(var o=!1,a=e.slice();!o&&a.length;)try{o=!1===a.pop()(t)}catch(i){r.error("Error occurred in "+n+" callback, continuing anyway…"),r.error(i)}return o},ne=function(e,t){e="000000000"+e;return e.substr(e.length-t)},re="object"==typeof window?window:self,oe=0;for(W in re)Object.hasOwnProperty.call(re,W)&&oe++;var e=navigator.mimeTypes?navigator.mimeTypes.length:0,ae=ne((e+navigator.userAgent.length).toString(36)+oe.toString(36),4),ie=function(){return ae},se=0,ue=4,ce=36,le=Math.pow(ce,ue);function de(){return ne((Math.random()*le<<0).toString(ce),ue)}function fe(){return"c"+(new Date).getTime().toString(ce)+ne((se=se<le?se:0,(++se-1).toString(ce)),ue)+ie()+(de()+de())}fe.fingerprint=ie;var ge,he,pe=fe,me=function(){function e(){this.id=pe(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var t=e.prototype;return t.getUser=function(){return this._user},t.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},t.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},t._track=function(e){this[e._handledState.unhandled?"_unhandled":"_handled"]+=1},e}(),ve=q.add,ye=q.clear,_e=q.merge,c=function(){},be=function(t,n){return new Error("Invalid configuration\n"+m(a(t),function(e){return" - "+e+" "+t[e]+", got "+Se(n[e])}).join("\n\n"))},Se=function(e){switch(typeof e){case"string":case"number":case"object":return JSON.stringify(e);default:return String(e)}},we=function(){function s(e,t,n,r){var o=this,a=(void 0===t&&(t=v.schema),void 0===n&&(n=[]),this._notifier=r,this._config={},this._schema=t,this._delivery={sendSession:c,sendEvent:c},this._logger={debug:c,info:c,warn:c,error:c},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=undefined,this._user={},this._cbs={e:[],s:[],sp:[],b:[]},this.Client=s,this.Event=Y,this.Breadcrumb=S,this.Session=me,this._config=this._configure(e,n),m(n.concat(this._config.plugins),function(e){e&&o._loadPlugin(e)}),this._depth=1,this),i=this.notify;this.notify=function(){return i.apply(a,arguments)}}var e=s.prototype;return e.addMetadata=function(e,t,n){return A(this._metadata,e,t,n)},e.getMetadata=function(e,t){return F(this._metadata,e,t)},e.clearMetadata=function(e,t){return P(this._metadata,e,t)},e.addFeatureFlag=function(e,t){ve(this._features,this._featuresIndex,e,t=void 0===t?null:t)},e.addFeatureFlags=function(e){_e(this._features,e,this._featuresIndex)},e.clearFeatureFlag=function(e){ye(this._features,this._featuresIndex,e)},e.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},e.getContext=function(){return this._context},e.setContext=function(e){this._context=e},e._configure=function(r,e){var o=g(e,function(e,t){return t&&t.configSchema?u({},e,t.configSchema):e},this._schema),e=g(a(o),function(e,t){var n=o[t].defaultValue(r[t]);return r[t]!==undefined?o[t].validate(r[t])?o[t].allowPartialObject?e.config[t]=u(n,r[t]):e.config[t]=r[t]:(e.errors[t]=o[t].message,e.config[t]=n):e.config[t]=n,e},{errors:{},config:{}}),t=e.errors,e=e.config;if(o.apiKey){if(!e.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(e.apiKey)||(t.apiKey="should be a string of 32 hexadecimal characters")}return this._metadata=u({},e.metadata),_e(this._features,e.featureFlags,this._featuresIndex),this._user=u({},e.user),this._context=e.context,e.logger&&(this._logger=e.logger),e.onError&&(this._cbs.e=this._cbs.e.concat(e.onError)),e.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(e.onBreadcrumb)),e.onSession&&(this._cbs.s=this._cbs.s.concat(e.onSession)),a(t).length&&this._logger.warn(be(t,r)),e},e.getUser=function(){return this._user},e.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},e._loadPlugin=function(e){var t=e.load(this);e.name&&(this._plugins["~"+e.name+"~"]=t)},e.getPlugin=function(e){return this._plugins["~"+e+"~"]},e._setDelivery=function(e){this._delivery=e(this)},e.startSession=function(){var e=new me;return e.app.releaseStage=this._config.releaseStage,e.app.version=this._config.appVersion,e.app.type=this._config.appType,e._user=u({},this._user),te(this._cbs.s,e,"onSession",this._logger)?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,e)},e.addOnError=function(e,t){this._cbs.e[(t=void 0===t?!1:t)?"unshift":"push"](e)},e.removeOnError=function(t){this._cbs.e=h(this._cbs.e,function(e){return e!==t})},e._addOnSessionPayload=function(e){this._cbs.sp.push(e)},e.addOnSession=function(e){this._cbs.s.push(e)},e.removeOnSession=function(t){this._cbs.s=h(this._cbs.s,function(e){return e!==t})},e.addOnBreadcrumb=function(e,t){this._cbs.b[(t=void 0===t?!1:t)?"unshift":"push"](e)},e.removeOnBreadcrumb=function(t){this._cbs.b=h(this._cbs.b,function(e){return e!==t})},e.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},e.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},e.leaveBreadcrumb=function(e,t,n){e="string"==typeof e?e:"",n="string"==typeof n&&p(r,n)?n:"manual",t="object"==typeof t&&null!==t?t:{},e&&(e=new S(e,t,n),te(this._cbs.b,e,"onBreadcrumb",this._logger)?this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback"):(this._breadcrumbs.push(e),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))))},e._isBreadcrumbTypeEnabled=function(e){var t=this._config.enabledBreadcrumbTypes;return null===t||p(t,e)},e.notify=function(e,t,n){void 0===n&&(n=c);e=Y.create(e,!0,undefined,"notify()",this._depth+1,this._logger);this._notify(e,t,n)},e._notify=function(n,e,r){var o=this;if(void 0===r&&(r=c),n.app=u({},n.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),n.context=n.context||this._context,n._metadata=u({},n._metadata,this._metadata),n._user=u({},n._user,this._user),n.breadcrumbs=this._breadcrumbs.slice(),_e(n._features,this._features,n._featuresIndex),null!==this._config.enabledReleaseStages&&!p(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),r(null,n);var a=n.severity,i=function(e){o._logger.error("Error occurred in onError callback, continuing anyway…"),o._logger.error(e)},e=[].concat(this._cbs.e).concat(e);ee(e,n,i,function(e,t){if(e&&i(e),!t)return o._logger.debug("Event not sent due to onError callback"),r(null,n);o._isBreadcrumbTypeEnabled("error")&&s.prototype.leaveBreadcrumb.call(o,n.errors[0].errorClass,{errorClass:n.errors[0].errorClass,errorMessage:n.errors[0].errorMessage,severity:n.severity},"error"),a!==n.severity&&(n._handledState.severityReason={type:"userCallbackSetSeverity"}),n.unhandled!==n._handledState.unhandled&&(n._handledState.severityReason.unhandledOverridden=!0,n._handledState.unhandled=n.unhandled),o._session&&(o._session._track(n),n._session=o._session),o._delivery.sendEvent({apiKey:n.apiKey||o._config.apiKey,notifier:o._notifier,events:[n]},function(e){return r(e,n)})})},s}(),Ee={},Oe=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"],je=(Ee.event=function(e,t){var n=j(e,null,null,{redactedPaths:Oe,redactedKeys:t});return 1e6<n.length&&(e.events[0]._metadata={notifier:"WARNING!\nSerialized payload was "+n.length/1e6+"MB (limit = 1MB)\nmetadata was removed"},n=j(e,null,null,{redactedPaths:Oe,redactedKeys:t})),n},Ee.session=function(e,t){return j(e,null,null)},function(e,t,n,r){var o=JSON.parse(JSON.stringify(new Date));return Ne(e.endpoints[t],r.location.protocol)+"?apiKey="+encodeURIComponent(e.apiKey)+"&payloadVersion="+n+"&sentAt="+encodeURIComponent(o)}),Ne=(ge=function(a,i){return void 0===i&&(i=window),{sendEvent:function(e,t){if(void 0===t&&(t=function(){}),null===a._config.endpoints.notify)return n=new Error("Event not sent due to incomplete endpoint configuration"),t(n);var n=je(a._config,"notify","4",i),r=Ee.event(e,a._config.redactedKeys),o=new i.XDomainRequest;o.onload=function(){t(null)},o.onerror=function(){var e=new Error("Event failed to send");a._logger.error("Event failed to send…",e),1e6<r.length&&a._logger.warn("Event oversized ("+(r.length/1e6).toFixed(2)+" MB)"),t(e)},o.open("POST",n),setTimeout(function(){try{o.send(r)}catch(e){a._logger.error(e),t(e)}},0)},sendSession:function(t,n){if(void 0===n&&(n=function(){}),null===a._config.endpoints.sessions)return e=new Error("Session not sent due to incomplete endpoint configuration"),n(e);var e=je(a._config,"sessions","1",i),r=new i.XDomainRequest;r.onload=function(){n(null)},r.open("POST",e),setTimeout(function(){try{r.send(Ee.session(t,a._config.redactedKeys))}catch(e){a._logger.error(e),n(e)}},0)}}})._matchPageProtocol=function(e,t){return"http:"===t?e.replace(/^https:/,"http:"):e},xe=function(s,u){return void 0===u&&(u=window),{sendEvent:function(e,t){void 0===t&&(t=function(){});try{var n,r=s._config.endpoints.notify;if(null===r)return n=new Error("Event not sent due to incomplete endpoint configuration"),t(n);var o=new u.XMLHttpRequest,a=Ee.event(e,s._config.redactedKeys);o.onreadystatechange=function(){var e;o.readyState===u.XMLHttpRequest.DONE&&(0===(e=o.status)||400<=e?(e=new Error("Request failed with status "+e),s._logger.error("Event failed to send…",e),1e6<a.length&&s._logger.warn("Event oversized ("+(a.length/1e6).toFixed(2)+" MB)"),t(e)):t(null))},o.open("POST",r),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",e.apiKey||s._config.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","4"),o.setRequestHeader("Bugsnag-Sent-At",(new Date).toISOString()),o.send(a)}catch(i){s._logger.error(i)}},sendSession:function(e,t){void 0===t&&(t=function(){});try{var n,r=s._config.endpoints.sessions;if(null===r)return n=new Error("Session not sent due to incomplete endpoint configuration"),t(n);var o=new u.XMLHttpRequest;o.onreadystatechange=function(){var e;o.readyState===u.XMLHttpRequest.DONE&&(0===(e=o.status)||400<=e?(e=new Error("Request failed with status "+e),s._logger.error("Session failed to send…",e),t(e)):t(null))},o.open("POST",r),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",s._config.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","1"),o.setRequestHeader("Bugsnag-Sent-At",(new Date).toISOString()),o.send(Ee.session(e,s._config.redactedKeys))}catch(a){s._logger.error(a)}}}},ke=new Date,Le=function(){ke=new Date},Re={name:"appDuration",load:function(e){return e.addOnError(function(e){var t=new Date;e.app.duration=t-ke},!0),{reset:Le}}},Te=function(e,t){e="000000000"+e;return e.substr(e.length-t)},Be="object"==typeof window?window:self,Me=0;for(he in Be)Object.hasOwnProperty.call(Be,he)&&Me++;var e=navigator.mimeTypes?navigator.mimeTypes.length:0,qe=Te((e+navigator.userAgent.length).toString(36)+Me.toString(36),4),Ie=function(){return qe},De=0,Ce=4,Ae=36,Fe=Math.pow(Ae,Ce);function Pe(){return Te((Math.random()*Fe<<0).toString(Ae),Ce)}function Ve(){return"c"+(new Date).getTime().toString(Ae)+Te((De=De<Fe?De:0,(++De-1).toString(Ae)),Ce)+Ie()+(Pe()+Pe())}Ve.fingerprint=Ie;var He=Ve,Ke="bugsnag-anonymous-id",$e=function(e){try{var t=e.localStorage,n=t.getItem(Ke);return n&&/^c[a-z0-9]{20,32}$/.test(n)?n:(n=He(),t.setItem(Ke,n),n)}catch(r){}},Ue=function(e){var t=e.getUser();t&&t.id||e.setUser(e.device.id)},Xe={load:function(e){e._sessionDelegate=Je}},Je={startSession:function(e,t){return e._session=t,(e._pausedSession=null)===e._config.enabledReleaseStages||p(e._config.enabledReleaseStages,e._config.releaseStage)?e._delivery.sendSession({notifier:e._notifier,device:t.device,app:t.app,sessions:[{id:t.id,startedAt:t.startedAt,user:t._user}]}):e._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),e},resumeSession:function(e){return e._session?e:e._pausedSession?(e._session=e._pausedSession,e._pausedSession=null,e):e.startSession()},pauseSession:function(e){e._pausedSession=e._session,e._session=null}},We={load:function(e){e._config.collectUserIp||e.addOnError(function(e){e._user&&"undefined"==typeof e._user.id&&delete e._user.id,e._user=u({id:"[REDACTED]"},e._user),e.request=u({clientIp:"[REDACTED]"},e.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}}}},ze={load:function(a){!/^(local-)?dev(elopment)?$/.test(a._config.releaseStage)&&a._isBreadcrumbTypeEnabled("log")&&m(Ge,function(r){var o=console[r];console[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.leaveBreadcrumb("Console output",g(t,function(e,t,n){var r="[Unknown value]";try{r=String(t)}catch(o){}if("[object Object]"===r)try{r=JSON.stringify(t)}catch(o){}return e["["+n+"]"]=r,e},{severity:0===r.indexOf("group")?"log":r}),"log"),o.apply(console,t)},console[r]._restore=function(){console[r]=o}})}},Ge=h(["log","debug","info","warn","error"],function(e){return"undefined"!=typeof console&&"function"==typeof console[e]}),Qe=200,Ye=5e5,Ze=function(d,f){return void 0===d&&(d=document),void 0===f&&(f=window),{load:function(e){var o,a,i,s,t,n,u,c,l;function r(a,i,s){return void 0===s&&(s=!1),function(){var e=[].slice.call(arguments);try{var t,n=i(e),r=n.get();if(s&&a.apply(this,e),"function"!=typeof r)return a.apply(this,e);r.__trace__||(t=c(),r.__trace__=function(){u(t),l(function(){u(null)},0);var e=r.apply(this,arguments);return u(null),e},r.__trace__.__trace__=r.__trace__),n.replace(r.__trace__)}catch(o){}if(a.apply)return a.apply(this,e);switch(e.length){case 1:return a(e[0]);case 2:return a(e[0],e[1]);default:return a()}}}e._config.trackInlineScripts&&(o=f.location.href,s="",a=!!d.attachEvent?"complete"===d.readyState:"loading"!==d.readyState,s=(i=function(){return d.documentElement.outerHTML})(),t=d.onreadystatechange,d.onreadystatechange=function(){"interactive"===d.readyState&&(s=i(),a=!0);try{t.apply(this,arguments)}catch(e){}},n=null,u=function(e){n=e},c=function(){var e,t=d.currentScript||n;return t=t||a?t:(e=d.scripts||d.getElementsByTagName("script"))[e.length-1]},e.addOnError(function(e){e.errors[0].stacktrace=h(e.errors[0].stacktrace,function(e){return!/__trace__$/.test(e.method)});var r,t=e.errors[0].stacktrace[0],n=function(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"")};t&&t.file&&n(t.file)!==n(o)||(n=c())&&(n=n.innerHTML,e.addMetadata("script","content",n.length<=Ye?n:n.substr(0,Ye)),t&&t.lineNumber&&(t.code=(n=t.lineNumber,a&&s||(s=i()),e=["\x3c!-- DOC START --\x3e"].concat(s.split("\n")),n-=1,r=Math.max(n-3,0),n=Math.min(3+n,e.length),g(e.slice(r,n),function(e,t,n){return e[r+1+n]=t.length<=Qe?t:t.substr(0,Qe),e},{}))))},!0),l=m(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(e){return et(f,e,function(e){return r(e,function(t){return{get:function(){return t[0]},replace:function(e){t[0]=e}}})})})[0],m(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(e){f[e]&&f[e].prototype&&Object.prototype.hasOwnProperty.call(f[e].prototype,"addEventListener")&&(et(f[e].prototype,"addEventListener",function(e){return r(e,tt)}),et(f[e].prototype,"removeEventListener",function(e){return r(e,tt,!0)}))}))},configSchema:{trackInlineScripts:{validate:function(e){return!0===e||!1===e},defaultValue:function(){return!0},message:"should be true|false"}}}};function et(e,t,n){var r=e[t];if(!r)return r;n=n(r);return e[t]=n,r}function tt(t){var n=!!t[1]&&"function"==typeof t[1].handleEvent;return{get:function(){return n?t[1].handleEvent:t[1]},replace:function(e){n?t[1].handleEvent=e:t[1]=e}}}var nt=function(i){return void 0===i&&(i=window),{load:function(o){"addEventListener"in i&&o._isBreadcrumbTypeEnabled("user")&&i.addEventListener("click",function(e){var t,n;try{t=function(e){var t=e.textContent||e.innerText||"";t||"submit"!==e.type&&"button"!==e.type||(t=e.value);if(140<(t=t.replace(rt,"$1")).length)return t.slice(0,135)+"(...)";return t}(e.target),n=function a(e,t){var n=[e.tagName];e.id&&n.push("#"+e.id);e.className&&e.className.length&&n.push("."+e.className.split(" ").join("."));if(!t.document.querySelectorAll||!Array.prototype.indexOf)return n.join("");try{if(1===t.document.querySelectorAll(n.join("")).length)return n.join("")}catch(o){return n.join("")}{var r;1<e.parentNode.childNodes.length&&(r=Array.prototype.indexOf.call(e.parentNode.childNodes,e)+1,n.push(":nth-child("+r+")"))}if(1===t.document.querySelectorAll(n.join("")).length)return n.join("");if(e.parentNode)return a(e.parentNode,t)+" > "+n.join("");return n.join("")}(e.target,i)}catch(r){n=t="[hidden]",o._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}o.leaveBreadcrumb("UI click",{targetText:t,targetSelector:n},"user")},!0)}}},rt=/^\s*([^\s][\s\S]{0,139}[^\s])?\s*/;var ot=function(n){void 0===n&&(n=window);var e={load:function(t){var e;"addEventListener"in n&&t._isBreadcrumbTypeEnabled("navigation")&&(n.addEventListener("pagehide",(e=function(e){return function(){return t.leaveBreadcrumb(e,{},"navigation")}})("Page hidden"),!0),n.addEventListener("pageshow",e("Page shown"),!0),n.addEventListener("load",e("Page loaded"),!0),n.document.addEventListener("DOMContentLoaded",e("DOMContentLoaded"),!0),n.addEventListener("load",function(){return n.addEventListener("popstate",e("Navigated back"),!0)}),n.addEventListener("hashchange",function(e){e=e.oldURL?{from:at(e.oldURL,n),to:at(e.newURL,n),state:ut(n)}:{to:at(n.location.href,n)};t.leaveBreadcrumb("Hash changed",e,"navigation")},!0),n.history.pushState&&st(t,n.history,"pushState",n,!0),n.history.replaceState&&st(t,n.history,"replaceState",n))}};return e},at=function(e,t){t=t.document.createElement("A");return t.href=e,""+t.pathname+t.search+t.hash},it=function(e,t,n,r){var o=at(e.location.href,e);return{title:n,state:t,prevState:ut(e),to:r||o,from:o}},st=function(r,o,a,i,s){void 0===s&&(s=!1);var u=o[a];o[a]=function(e,t,n){r.leaveBreadcrumb("History "+a,it(i,e,t,n),"navigation"),s&&"function"==typeof r.resetEventCount&&r.resetEventCount(),u.apply(o,[e,t].concat(n!==undefined?n:[]))}},ut=function(e){try{return e.history.state}catch(t){}},ct="request",lt=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=window);var n={load:function(s){var u,r,c,n,l,i,d,f;s._isBreadcrumbTypeEnabled("request")&&(u=[s._config.endpoints.notify,s._config.endpoints.sessions].concat(e),"addEventListener"in t.XMLHttpRequest.prototype&&"WeakMap"in t&&(r=new WeakMap,c=new WeakMap,n=t.XMLHttpRequest.prototype.open,t.XMLHttpRequest.prototype.open=function(e,t){this&&r.set(this,{method:e,url:t}),n.apply(this,arguments)},l=t.XMLHttpRequest.prototype.send,t.XMLHttpRequest.prototype.send=function(e){var o,t,n,a=this,i=r.get(this);i&&((t=c.get(this))&&(this.removeEventListener("load",t.load),this.removeEventListener("error",t.error)),o=new Date,t=function(){var e,t,n;e=i.method,t=i.url,n=dt(o),t!==undefined?"string"==typeof t&&p(u,t.replace(/\?.*$/,""))||s.leaveBreadcrumb("XMLHttpRequest error",{method:String(e),url:String(t),duration:n},ct):s._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.")},this.addEventListener("load",n=function(){var e,t,n,r;e=i.method,t=i.url,n=a.status,r=dt(o),t!==undefined?"string"==typeof t&&p(u,t.replace(/\?.*$/,""))||(e={status:n,method:String(e),url:String(t),duration:r},400<=n?s.leaveBreadcrumb("XMLHttpRequest failed",e,ct):s.leaveBreadcrumb("XMLHttpRequest succeeded",e,ct)):s._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.")}),this.addEventListener("error",t),this&&c.set(this,{load:n,error:t})),l.apply(this,arguments)}),"fetch"in t&&!t.fetch.polyfill&&(i=t.fetch,t.fetch=function(){var o,e=arguments,t=arguments[0],n=arguments[1],a=null;return t&&"object"==typeof t?(a=t.url,n&&"method"in n?o=n.method:t&&"method"in t&&(o=t.method)):(a=t,n&&"method"in n&&(o=n.method)),o===undefined&&(o="GET"),new Promise(function(t,n){var r=new Date;i.apply(void 0,e).then(function(e){d(e,o,a,dt(r)),t(e)})["catch"](function(e){f(o,a,dt(r)),n(e)})})}),d=function(e,t,n,r){t={method:String(t),status:e.status,url:String(n),duration:r};400<=e.status?s.leaveBreadcrumb("fetch() failed",t,ct):s.leaveBreadcrumb("fetch() succeeded",t,ct)},f=function(e,t,n){s.leaveBreadcrumb("fetch() error",{method:String(e),url:String(t),duration:n},ct)})}};return n},dt=function(e){return e&&new Date-e},ft={load:function(t){var n=0;t.addOnError(function(e){if(n>=t._config.maxEvents)return t._logger.warn("Cancelling event send due to maxEvents per session limit of "+t._config.maxEvents+" being reached"),!1;n++}),t.resetEventCount=function(){n=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(e){return t(1,100)(e)}}}},gt={},ht=(gt={load:function(e){e.addOnError(function(e){e=g(e.errors,function(e,t){return e.concat(t.stacktrace)},[]);m(e,function(e){e.file=ht(e.file)})})}})._strip=function(e){return"string"==typeof e?e.replace(/\?.*$/,"").replace(/#.*$/,""):e},pt=function(e,d){return void 0===e&&(e=window),void 0===d&&(d="window onerror"),{load:function(c){var l;c._config.autoDetectErrors&&c._config.enabledErrorTypes.unhandledExceptions&&(l=e.onerror,e.onerror=function(e,t,n,r,o){var a,i,s,u;0===n&&/Script error\.?/.test(e)?c._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z"):(a={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},o?(u=c.Event.create(o,!0,a,d,1),mt(u.errors[0].stacktrace,t,n,r)):"object"!=typeof e||null===e||t&&"string"==typeof t||n||r||o?(u=c.Event.create(e,!0,a,d,1),mt(u.errors[0].stacktrace,t,n,r)):(i=e.type?"Event: "+e.type:"Error",s=e.message||e.detail||"",(u=c.Event.create({name:i,message:s},!0,a,d,1)).originalError=e,u.addMetadata(d,{event:e,extraParameters:t})),c._notify(u)),"function"==typeof l&&l.apply(this,arguments)})}}},mt=function(e,t,n,r){e[0]||e.push({});e=e[0];e.file||"string"!=typeof t||(e.file=t),!e.lineNumber&&vt(n)&&(e.lineNumber=n),e.columnNumber||(vt(r)?e.columnNumber=r:window.event&&vt(window.event.errorCharacter)&&(e.columnNumber=window.event.errorCharacter))},vt=function(e){return"number"==typeof e&&"NaN"!==String.call(e)},yt=function(t){return function(e){e.file!==t.toString()&&e.method&&(e.method=e.method.replace(/^\s+/,""))}},e={},_t=u({},v.schema,o),n={_client:null,createClient:function(e){e=(e="string"==typeof e?{apiKey:e}:e)||{};var t,n,r,o,a,i=[Re,(void 0===o&&(o=navigator),void 0===a&&(a=window),{load:function(t){var n={locale:o.browserLanguage||o.systemLanguage||o.userLanguage||o.language,userAgent:o.userAgent};a&&a.screen&&a.screen.orientation&&a.screen.orientation.type?n.orientation=a.screen.orientation.type:a&&a.document&&(n.orientation=a.document.documentElement.clientWidth>a.document.documentElement.clientHeight?"landscape":"portrait"),t._config.generateAnonymousId&&(n.id=$e(a)),t.addOnSession(function(e){e.device=u({},e.device,n),t._config.collectUserIp||Ue(e)}),t.addOnError(function(e){e.device=u({},e.device,n,{time:new Date}),t._config.collectUserIp||Ue(e)},!0)},configSchema:{generateAnonymousId:{validate:function(e){return!0===e||!1===e},defaultValue:function(){return!0},message:"should be true|false"}}}),(void 0===r&&(r=window),{load:function(e){e.addOnError(function(e){e.context===undefined&&(e.context=r.location.pathname)},!0)}}),(void 0===n&&(n=window),{load:function(e){e.addOnError(function(e){e.request&&e.request.url||(e.request=u({},e.request,{url:n.location.href}))},!0)}}),ft,Xe,We,gt,pt(),(void 0===t&&(t=window),{load:function(o){var n;o._config.autoDetectErrors&&o._config.enabledErrorTypes.unhandledRejections&&(n=function(e){var t=e.reason,n=!1;try{e.detail&&e.detail.reason&&(t=e.detail.reason,n=!0)}catch(r){}e=o.Event.create(t,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,o._logger);n&&m(e.errors[0].stacktrace,yt(t)),o._notify(e,function(e){var t;D(e.originalError)&&!e.originalError.stack&&e.addMetadata("unhandledRejection handler",((t={})[Object.prototype.toString.call(e.originalError)]={name:e.originalError.name,message:e.originalError.message,code:e.originalError.code},t))})},"addEventListener"in t?t.addEventListener("unhandledrejection",n):t.onunhandledrejection=function(e,t){n({detail:{reason:e,promise:t}})},0)}}),ot(),nt(),lt(),ze,Ze()],e=new we(e,_t,i,{name:"Bugsnag JavaScript",version:"8.0.0-alpha.13",url:"https://github.com/bugsnag/bugsnag-js"});return e._setDelivery(window.XDomainRequest?ge:xe),e._logger.debug("Loaded!"),e.leaveBreadcrumb("Bugsnag loaded",{},"state"),e._config.autoTrackSessions?e.startSession():e},start:function(e){return n._client?n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."):n._client=n.createClient(e),n._client},isStarted:function(){return null!=n._client}};return m(["resetEventCount"].concat(a(we.prototype)),function(t){/^_/.test(t)||(n[t]=function(){if(!n._client)return console.log("Bugsnag."+t+"() was called before Bugsnag.start()");n._client._depth+=1;var e=n._client[t].apply(n._client,arguments);return--n._client._depth,e})}),(e=n).Client=we,e.Event=Y,e.Session=me,e.Breadcrumb=S,e["default"]=n,e}); | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Bugsnag=e()}(function(){var r=["navigation","request","process","log","user","state","error","manual"],g=function(e,t,n){for(var r=n,o=0,i=e.length;o<i;o++)r=t(r,e[o],o,e);return r},h=function(e,o){return g(e,function(e,t,n,r){return o(t,n,r)?e.concat(t):e},[])},p=function(e,o){return g(e,function(e,t,n,r){return!0===e||t===o},!1)},a=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=!{toString:null}.propertyIsEnumerable("toString"),d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);if(!s)return n;for(var r=0,o=d.length;r<o;r++)Object.prototype.hasOwnProperty.call(e,d[r])&&n.push(d[r]);return n},t=function(t,n){return void 0===t&&(t=1),void 0===n&&(n=Infinity),function(e){return"number"==typeof e&&parseInt(""+e,10)===e&&t<=e&&e<=n}},o=function(e){return"function"==typeof e||a(e)&&h(e,function(e){return"function"==typeof e}).length===e.length},f=function(e){return"string"==typeof e&&!!e.length},v={},y=function(){return{unhandledExceptions:!0,unhandledRejections:!0}},u=(v.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:f},appVersion:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||f(e)}},appType:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||f(e)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},enabledErrorTypes:{defaultValue:y,message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(t){if("object"!=typeof t||!t)return!1;var e=i(t),n=i(y());return!(h(e,function(e){return p(n,e)}).length<e.length)&&!(0<h(i(t),function(e){return"boolean"!=typeof t[e]}).length)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:o},endpoints:{defaultValue:function(e){return void 0===e?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(e){return e&&"object"==typeof e&&f(e.notify)&&f(e.sessions)&&0===h(i(e),function(e){return!p(["notify","sessions"],e)}).length}},autoTrackSessions:{defaultValue:function(e){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(e){return null===e||a(e)&&h(e,function(e){return"string"==typeof e}).length===e.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(e){return"string"==typeof e&&e.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(e){return t(0,100)(e)}},enabledBreadcrumbTypes:{defaultValue:function(){return r},message:"should be null or a list of available breadcrumb types ("+r.join(",")+")",validate:function(e){return null===e||a(e)&&g(e,function(e,t){return!1===e?e:p(r,t)},!0)}},context:{defaultValue:function(){return undefined},message:"should be a string",validate:function(e){return e===undefined||"string"==typeof e}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(e){return null===e||e&&g(i(e),function(e,t){return e&&p(["id","email","name"],t)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(e){return"object"==typeof e&&null!==e}},logger:{defaultValue:function(){return undefined},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(n){return!n||g(["debug","info","warn","error"],function(e,t){return e&&"function"==typeof n[t]},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(e){return a(e)&&e.length===h(e,function(e){return"string"==typeof e||e&&"function"==typeof e.test}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(e){return a(e)&&e.length===h(e,function(e){return e&&"object"==typeof e&&"function"==typeof e.load}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(e){return a(e)&&e.length===h(e,function(e){return e&&"object"==typeof e&&"string"==typeof e.name}).length}}},function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}),m=function(e,o){return g(e,function(e,t,n,r){return e.concat(o(t,n,r))},[])};function _(){return(_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o=v.schema,o={releaseStage:u({},o.releaseStage,{defaultValue:function(){return/^localhost(:\d+)?$/.test(window.location.host)?"development":"production"}}),appType:_({},o.appType,{defaultValue:function(){return"browser"}}),logger:u({},o.logger,{defaultValue:function(){return"undefined"!=typeof console&&"function"==typeof console.debug?b():undefined}})},b=function(){var n={},r=console.log;return m(["debug","info","warn","error"],function(e){var t=console[e];n[e]=("function"==typeof t?t:r).bind(console,"[bugsnag]")}),n},S=function(){function e(e,t,n,r){void 0===r&&(r=new Date),this.type=n,this.message=e,this.metadata=t,this.timestamp=r}return e.prototype.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},e}(),w={},E=(!function(e,t){"use strict";"object"==typeof w?w=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function l(e){return function(){return this[e]}}var e=["isConstructor","isEval","isNative","isToplevel"],t=["columnNumber","lineNumber"],o=["fileName","functionName","source"],i=e.concat(t,o,["args"]);function a(e){if(e instanceof Object)for(var t=0;t<i.length;t++)e.hasOwnProperty(i[t])&&e[i[t]]!==undefined&&this["set"+r(i[t])](e[i[t]])}a.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof a)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new a(e)}},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var s=0;s<e.length;s++)a.prototype["get"+r(e[s])]=l(e[s]),a.prototype["set"+r(e[s])]=function(t){return function(e){this[t]=Boolean(e)}}(e[s]);for(var u=0;u<t.length;u++)a.prototype["get"+r(t[u])]=l(t[u]),a.prototype["set"+r(t[u])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(t[u]);for(var c=0;c<o.length;c++)a.prototype["get"+r(o[c])]=l(o[c]),a.prototype["set"+r(o[c])]=function(t){return function(e){this[t]=String(e)}}(o[c]);return a}),{}),O=(!function(e,t){"use strict";"object"==typeof E?E=t(w):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(e.replace(/[\(\)]/g,""));return[e[1],e[2]||undefined,e[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){var t=(e=-1<e.indexOf("(eval ")?e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""):e).replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),t=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(n?n[1]:t.pop()),t=t.join(" ")||undefined,r=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:t,fileName:r,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){var t,n;return-1===(e=-1<e.indexOf(" > eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?new s({functionName:e}):(t=(t=e.match(n=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&t[1]?t[1]:undefined,n=this.extractLocation(e.replace(n,"")),new s({functionName:t,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e}))},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new s({fileName:a[2],lineNumber:a[1],source:n[o]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new s({functionName:a[3]||undefined,fileName:a[2],lineNumber:a[1],source:n[o]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),n=n.shift()||"",o=n.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined,n=(t=n.match(/\(([^\)]*)\)/)?n.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"):t)===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}}),E),j=function(e,t,n,r){var o=r&&r.redactedKeys?r.redactedKeys:[],r=r&&r.redactedPaths?r.redactedPaths:[];return JSON.stringify(B(e,o,r),t,n)},N=20,x=25e3,k=8,L="...";function R(e){return"[Throws: "+(e?e.message:"?")+"]"}function T(e,t){try{return e[t]}catch(n){return R(n)}}function B(e,d,f){var g=[],h=0;return function p(e,t){function n(){return t.length>k&&x<h}if(h++,t.length>N)return L;if(n())return L;if(null===e||"object"!=typeof e)return e;if(function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return 1}(g,e))return"[Circular]";if(g.push(e),"function"==typeof e.toJSON)try{h--;var r=p(e.toJSON(),t);return g.pop(),r}catch(u){return R(u)}if((r=e)instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(r)))return h--,r=p({name:e.name,message:e.message},t),g.pop(),r;if("[object Array]"===Object.prototype.toString.call(e)){for(var o=[],i=0,l=e.length;i<l;i++){if(n()){o.push(L);break}o.push(p(e[i],t.concat("[]")))}return g.pop(),o}var a={};try{for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(function(e,t){for(var n=0,r=e.length;n<r;n++)if(0===t.indexOf(e[n]))return 1}(f,t.join("."))&&function(e,t){for(var n=0,r=e.length;n<r;n++){if("string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase())return 1;if(e[n]&&"function"==typeof e[n].test&&e[n].test(t))return 1}}(d,s))a[s]="[REDACTED]";else{if(n()){a[s]=L;break}a[s]=p(T(e,s),t.concat(s))}}catch(c){}return g.pop(),a}(e,[])}function M(e,t,n,r){var o;"string"==typeof n&&(r===undefined?r=null:null!==r&&"string"!=typeof r&&(r=j(r)),"number"!=typeof(o=t[n])?(e.push({name:n,variant:r}),t[n]=e.length-1):e[o]={name:n,variant:r})}var q={add:M,clear:function(e,t,n){var r=t[n];"number"==typeof r&&(e[r]=null,delete t[n])},merge:function(e,t,n){if(a(t)){for(var r=0;r<t.length;++r){var o=t[r];null!==o&&"object"==typeof o&&M(e,n,o.name,o.variant)}return e}},toEventApi:function(e){return m(h(e,Boolean),function(e){var t=e.name,e=e.variant,t={featureFlag:t};return"string"==typeof e&&(t.variant=e),t})}},I=function(e){return!(!e||!e.stack&&!e.stacktrace&&!e["opera#sourceloc"]||"string"!=typeof(e.stack||e.stacktrace||e["opera#sourceloc"])||e.stack===e.name+": "+e.message)};var D=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},C=function(e,t,n){"string"==typeof t&&(n?"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&e[t]&&delete e[t][n]:delete e[t])},A=function(e,t,n,r){var o,i;if(t){if(null===n)return C(e,t);"object"==typeof n&&(i=n),"string"==typeof n&&((o={})[n]=r,i=o),i&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]||(e[t]={}),e[t]=u({},e[t],i))}},F=function(e,t,n){return"string"!=typeof t?undefined:n?e[t]?e[t][n]:undefined:e[t]},P=C,V={};function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}!function(e,t){"use strict";"object"==typeof V?V=t(w):e.StackGenerator=t(e.StackFrame)}(this,function(s){return{backtrace:function(e){for(var t=[],n=10,r=("object"==typeof e&&"number"==typeof e.maxStackSize&&(n=e.maxStackSize),arguments.callee);r&&t.length<n&&r.arguments;){for(var o=new Array(r.arguments.length),i=0;i<o.length;++i)o[i]=r.arguments[i];/function(?:\s+([\w$]+))+\s*\(/.test(r.toString())?t.push(new s({functionName:RegExp.$1||undefined,args:o})):t.push(new s({args:o}));try{r=r.caller}catch(a){break}}return t}}});var l=function(){function i(e,t,n,r,o){void 0===n&&(n=[]),void 0===r&&(r=U()),this.apiKey=undefined,this.context=undefined,this.groupingHash=undefined,this.originalError=o,this._handledState=r,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=undefined,this._correlation=undefined,this.errors=[J(e,t,i.__type,n)]}var e=i.prototype;return e.addMetadata=function(e,t,n){return A(this._metadata,e,t,n)},e.setTraceCorrelation=function(e,t){"string"==typeof e&&(this._correlation=H({traceId:e},"string"==typeof t?{spanId:t}:{}))},e.getMetadata=function(e,t){return F(this._metadata,e,t)},e.clearMetadata=function(e,t){return P(this._metadata,e,t)},e.addFeatureFlag=function(e,t){q.add(this._features,this._featuresIndex,e,t=void 0===t?null:t)},e.addFeatureFlags=function(e){q.merge(this._features,e,this._featuresIndex)},e.getFeatureFlags=function(){return q.toEventApi(this._features)},e.clearFeatureFlag=function(e){q.clear(this._features,this._featuresIndex,e)},e.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},e.getUser=function(){return this._user},e.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},e.toJSON=function(){return{payloadVersion:"4",exceptions:m(this.errors,function(e){return u({},e,{message:e.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},i}(),K=function(e){e={file:e.fileName,method:$(e.functionName),lineNumber:e.lineNumber,columnNumber:e.columnNumber,code:undefined,inProject:undefined};return-1<e.lineNumber&&!e.file&&!e.method&&(e.file="global code"),e},$=function(e){return/^global code$/i.test(e)?"global code":e},U=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},X=function(e){return"string"==typeof e?e:""};function J(e,t,n,r){return{errorClass:X(e),errorMessage:X(t),type:n,stacktrace:g(r,function(e,t){t=K(t);try{return"{}"===JSON.stringify(t)?e:e.concat(t)}catch(n){return e}},[])}}l.getStacktrace=function(e,t,n){if(I(e))return O.parse(e).slice(t);try{return h(V.backtrace(),function(e){return-1===(e.functionName||"").indexOf("StackGenerator$$")}).slice(1+n)}catch(r){return[]}},l.create=function(e,t,n,r,o,i){void 0===o&&(o=0);var t=G(e,t,r,i),i=t[0],t=t[1];try{var a=l.getStacktrace(i,0<t?1+t+o:0,1+o),s=new l(i.name,i.message,a,n,e)}catch(u){s=new l(i.name,i.message,[],n,e)}return"InvalidError"===i.name&&s.addMetadata(""+r,"non-error parameter",z(e)),i.cause&&(t=function c(e){return e.cause?[e].concat(c(e.cause)):[e]}(i).slice(1),o=m(t,function(e){var t=D(e)&&I(e)?O.parse(e):[],n=G(e,!0,"error cause")[0];return"InvalidError"===n.name&&s.addMetadata("error cause",z(e)),J(n.name,n.message,l.__type,t)}),(a=s.errors).push.apply(a,o)),s};var W,z=function(e){return null===e?"null":e===undefined?"undefined":e},G=function(e,t,n,r){var o,i=0,a=function(e){var t="error cause"===n?"was":"received",e=(r&&r.warn(n+" "+t+' a non-error: "'+e+'"'),new Error(n+" "+t+' a non-error. See "'+n+'" tab for more detail.'));return e.name="InvalidError",e};if(t)switch(typeof e){case"string":case"number":case"boolean":o=new Error(String(e)),i+=1;break;case"function":o=a("function"),i+=2;break;case"object":null!==e&&D(e)?o=e:null!==e&&Q(e)?((o=new Error(e.message||e.errorMessage)).name=e.name||e.errorClass,i+=1):(o=a(null===e?"null":"unsupported object"),i+=2);break;default:o=a("nothing"),i+=2}else D(e)?o=e:(o=a(typeof e),i+=2);if(!I(o))try{throw o}catch(s){I(s)&&(o=s,i=1)}return[o,i]},Q=(l.__type="browserjs",function(e){return!("string"!=typeof e.name&&"string"!=typeof e.errorClass||"string"!=typeof e.message&&"string"!=typeof e.errorMessage)}),Y=l,Z=function(e,t,n){var r=0,o=function(){if(r>=e.length)return n(null,!0);t(e[r],function(e,t){return e?n(e):!1===t?n(null,!1):(r++,void o())})};o()},ee=function(e,o,i,t){Z(e,function(e,n){if("function"!=typeof e)return n(null);try{var t;if(2!==e.length)return(t=e(o))&&"function"==typeof t.then?t.then(function(e){return setTimeout(function(){return n(null,e)})},function(e){setTimeout(function(){return i(e),n(null,!0)})}):n(null,t);e(o,function(e,t){if(e)return i(e),n(null);n(null,t)})}catch(r){i(r),n(null)}},t)},te=function(e,t,n,r){for(var o=!1,i=e.slice();!o&&i.length;)try{o=!1===i.pop()(t)}catch(a){r.error("Error occurred in "+n+" callback, continuing anyway…"),r.error(a)}return o},ne=function(e,t){e="000000000"+e;return e.substr(e.length-t)},re="object"==typeof window?window:self,oe=0;for(W in re)Object.hasOwnProperty.call(re,W)&&oe++;var e=navigator.mimeTypes?navigator.mimeTypes.length:0,ie=ne((e+navigator.userAgent.length).toString(36)+oe.toString(36),4),ae=function(){return ie},se=0,ue=4,ce=36,le=Math.pow(ce,ue);function de(){return ne((Math.random()*le<<0).toString(ce),ue)}function fe(){return"c"+(new Date).getTime().toString(ce)+ne((se=se<le?se:0,(++se-1).toString(ce)),ue)+ae()+(de()+de())}fe.fingerprint=ae;var ge,he,pe=fe,me=function(){function e(){this.id=pe(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var t=e.prototype;return t.getUser=function(){return this._user},t.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},t.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},t._track=function(e){this[e._handledState.unhandled?"_unhandled":"_handled"]+=1},e}(),ve=q.add,ye=q.clear,_e=q.merge,c=function(){},be=function(t,n){return new Error("Invalid configuration\n"+m(i(t),function(e){return" - "+e+" "+t[e]+", got "+Se(n[e])}).join("\n\n"))},Se=function(e){switch(typeof e){case"string":case"number":case"object":return JSON.stringify(e);default:return String(e)}},we=function(){function s(e,t,n,r){var o=this,i=(void 0===t&&(t=v.schema),void 0===n&&(n=[]),this._notifier=r,this._config={},this._schema=t,this._delivery={sendSession:c,sendEvent:c},this._logger={debug:c,info:c,warn:c,error:c},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=undefined,this._user={},this._cbs={e:[],s:[],sp:[],b:[]},this.Client=s,this.Event=Y,this.Breadcrumb=S,this.Session=me,this._config=this._configure(e,n),m(n.concat(this._config.plugins),function(e){e&&o._loadPlugin(e)}),this._depth=1,this),a=this.notify;this.notify=function(){return a.apply(i,arguments)}}var e=s.prototype;return e.addMetadata=function(e,t,n){return A(this._metadata,e,t,n)},e.getMetadata=function(e,t){return F(this._metadata,e,t)},e.clearMetadata=function(e,t){return P(this._metadata,e,t)},e.addFeatureFlag=function(e,t){ve(this._features,this._featuresIndex,e,t=void 0===t?null:t)},e.addFeatureFlags=function(e){_e(this._features,e,this._featuresIndex)},e.clearFeatureFlag=function(e){ye(this._features,this._featuresIndex,e)},e.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},e.getContext=function(){return this._context},e.setContext=function(e){this._context=e},e._configure=function(r,e){var o=g(e,function(e,t){return t&&t.configSchema?u({},e,t.configSchema):e},this._schema),e=g(i(o),function(e,t){var n=o[t].defaultValue(r[t]);return r[t]!==undefined?o[t].validate(r[t])?o[t].allowPartialObject?e.config[t]=u(n,r[t]):e.config[t]=r[t]:(e.errors[t]=o[t].message,e.config[t]=n):e.config[t]=n,e},{errors:{},config:{}}),t=e.errors,e=e.config;if(o.apiKey){if(!e.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(e.apiKey)||(t.apiKey="should be a string of 32 hexadecimal characters")}return this._metadata=u({},e.metadata),_e(this._features,e.featureFlags,this._featuresIndex),this._user=u({},e.user),this._context=e.context,e.logger&&(this._logger=e.logger),e.onError&&(this._cbs.e=this._cbs.e.concat(e.onError)),e.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(e.onBreadcrumb)),e.onSession&&(this._cbs.s=this._cbs.s.concat(e.onSession)),i(t).length&&this._logger.warn(be(t,r)),e},e.getUser=function(){return this._user},e.setUser=function(e,t,n){this._user={id:e,email:t,name:n}},e._loadPlugin=function(e){var t=e.load(this);e.name&&(this._plugins["~"+e.name+"~"]=t)},e.getPlugin=function(e){return this._plugins["~"+e+"~"]},e._setDelivery=function(e){this._delivery=e(this)},e.startSession=function(){var e=new me;return e.app.releaseStage=this._config.releaseStage,e.app.version=this._config.appVersion,e.app.type=this._config.appType,e._user=u({},this._user),te(this._cbs.s,e,"onSession",this._logger)?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,e)},e.addOnError=function(e,t){this._cbs.e[(t=void 0===t?!1:t)?"unshift":"push"](e)},e.removeOnError=function(t){this._cbs.e=h(this._cbs.e,function(e){return e!==t})},e._addOnSessionPayload=function(e){this._cbs.sp.push(e)},e.addOnSession=function(e){this._cbs.s.push(e)},e.removeOnSession=function(t){this._cbs.s=h(this._cbs.s,function(e){return e!==t})},e.addOnBreadcrumb=function(e,t){this._cbs.b[(t=void 0===t?!1:t)?"unshift":"push"](e)},e.removeOnBreadcrumb=function(t){this._cbs.b=h(this._cbs.b,function(e){return e!==t})},e.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},e.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},e.leaveBreadcrumb=function(e,t,n){e="string"==typeof e?e:"",n="string"==typeof n&&p(r,n)?n:"manual",t="object"==typeof t&&null!==t?t:{},e&&(e=new S(e,t,n),te(this._cbs.b,e,"onBreadcrumb",this._logger)?this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback"):(this._breadcrumbs.push(e),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))))},e._isBreadcrumbTypeEnabled=function(e){var t=this._config.enabledBreadcrumbTypes;return null===t||p(t,e)},e.notify=function(e,t,n){void 0===n&&(n=c);e=Y.create(e,!0,undefined,"notify()",this._depth+1,this._logger);this._notify(e,t,n)},e._notify=function(n,e,r){var o=this;if(void 0===r&&(r=c),n.app=u({},n.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),n.context=n.context||this._context,n._metadata=u({},n._metadata,this._metadata),n._user=u({},n._user,this._user),n.breadcrumbs=this._breadcrumbs.slice(),_e(n._features,this._features,n._featuresIndex),null!==this._config.enabledReleaseStages&&!p(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),r(null,n);var i=n.severity,a=function(e){o._logger.error("Error occurred in onError callback, continuing anyway…"),o._logger.error(e)},e=[].concat(this._cbs.e).concat(e);ee(e,n,a,function(e,t){if(e&&a(e),!t)return o._logger.debug("Event not sent due to onError callback"),r(null,n);o._isBreadcrumbTypeEnabled("error")&&s.prototype.leaveBreadcrumb.call(o,n.errors[0].errorClass,{errorClass:n.errors[0].errorClass,errorMessage:n.errors[0].errorMessage,severity:n.severity},"error"),i!==n.severity&&(n._handledState.severityReason={type:"userCallbackSetSeverity"}),n.unhandled!==n._handledState.unhandled&&(n._handledState.severityReason.unhandledOverridden=!0,n._handledState.unhandled=n.unhandled),o._session&&(o._session._track(n),n._session=o._session),o._delivery.sendEvent({apiKey:n.apiKey||o._config.apiKey,notifier:o._notifier,events:[n]},function(e){return r(e,n)})})},s}(),Ee={},Oe=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"],je=(Ee.event=function(e,t){var n=j(e,null,null,{redactedPaths:Oe,redactedKeys:t});return 1e6<n.length&&(e.events[0]._metadata={notifier:"WARNING!\nSerialized payload was "+n.length/1e6+"MB (limit = 1MB)\nmetadata was removed"},n=j(e,null,null,{redactedPaths:Oe,redactedKeys:t})),n},Ee.session=function(e,t){return j(e,null,null)},function(e,t,n,r){var o=JSON.parse(JSON.stringify(new Date));return Ne(e.endpoints[t],r.location.protocol)+"?apiKey="+encodeURIComponent(e.apiKey)+"&payloadVersion="+n+"&sentAt="+encodeURIComponent(o)}),Ne=(ge=function(i,a){return void 0===a&&(a=window),{sendEvent:function(e,t){if(void 0===t&&(t=function(){}),null===i._config.endpoints.notify)return n=new Error("Event not sent due to incomplete endpoint configuration"),t(n);var n=je(i._config,"notify","4",a),r=Ee.event(e,i._config.redactedKeys),o=new a.XDomainRequest;o.onload=function(){t(null)},o.onerror=function(){var e=new Error("Event failed to send");i._logger.error("Event failed to send…",e),1e6<r.length&&i._logger.warn("Event oversized ("+(r.length/1e6).toFixed(2)+" MB)"),t(e)},o.open("POST",n),setTimeout(function(){try{o.send(r)}catch(e){i._logger.error(e),t(e)}},0)},sendSession:function(t,n){if(void 0===n&&(n=function(){}),null===i._config.endpoints.sessions)return e=new Error("Session not sent due to incomplete endpoint configuration"),n(e);var e=je(i._config,"sessions","1",a),r=new a.XDomainRequest;r.onload=function(){n(null)},r.open("POST",e),setTimeout(function(){try{r.send(Ee.session(t,i._config.redactedKeys))}catch(e){i._logger.error(e),n(e)}},0)}}})._matchPageProtocol=function(e,t){return"http:"===t?e.replace(/^https:/,"http:"):e},xe=function(s,u){return void 0===u&&(u=window),{sendEvent:function(e,t){void 0===t&&(t=function(){});try{var n,r=s._config.endpoints.notify;if(null===r)return n=new Error("Event not sent due to incomplete endpoint configuration"),t(n);var o=new u.XMLHttpRequest,i=Ee.event(e,s._config.redactedKeys);o.onreadystatechange=function(){var e;o.readyState===u.XMLHttpRequest.DONE&&(0===(e=o.status)||400<=e?(e=new Error("Request failed with status "+e),s._logger.error("Event failed to send…",e),1e6<i.length&&s._logger.warn("Event oversized ("+(i.length/1e6).toFixed(2)+" MB)"),t(e)):t(null))},o.open("POST",r),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",e.apiKey||s._config.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","4"),o.setRequestHeader("Bugsnag-Sent-At",(new Date).toISOString()),o.send(i)}catch(a){s._logger.error(a)}},sendSession:function(e,t){void 0===t&&(t=function(){});try{var n,r=s._config.endpoints.sessions;if(null===r)return n=new Error("Session not sent due to incomplete endpoint configuration"),t(n);var o=new u.XMLHttpRequest;o.onreadystatechange=function(){var e;o.readyState===u.XMLHttpRequest.DONE&&(0===(e=o.status)||400<=e?(e=new Error("Request failed with status "+e),s._logger.error("Session failed to send…",e),t(e)):t(null))},o.open("POST",r),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",s._config.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","1"),o.setRequestHeader("Bugsnag-Sent-At",(new Date).toISOString()),o.send(Ee.session(e,s._config.redactedKeys))}catch(i){s._logger.error(i)}}}},ke=new Date,Le=function(){ke=new Date},Re={name:"appDuration",load:function(e){return e.addOnError(function(e){var t=new Date;e.app.duration=t-ke},!0),{reset:Le}}},Te=function(e,t){e="000000000"+e;return e.substr(e.length-t)},Be="object"==typeof window?window:self,Me=0;for(he in Be)Object.hasOwnProperty.call(Be,he)&&Me++;var e=navigator.mimeTypes?navigator.mimeTypes.length:0,qe=Te((e+navigator.userAgent.length).toString(36)+Me.toString(36),4),Ie=function(){return qe},De=0,Ce=4,Ae=36,Fe=Math.pow(Ae,Ce);function Pe(){return Te((Math.random()*Fe<<0).toString(Ae),Ce)}function Ve(){return"c"+(new Date).getTime().toString(Ae)+Te((De=De<Fe?De:0,(++De-1).toString(Ae)),Ce)+Ie()+(Pe()+Pe())}Ve.fingerprint=Ie;var He=Ve,Ke="bugsnag-anonymous-id",$e=function(e){try{var t=e.localStorage,n=t.getItem(Ke);return n&&/^c[a-z0-9]{20,32}$/.test(n)?n:(n=He(),t.setItem(Ke,n),n)}catch(r){}},Ue=function(e){var t=e.getUser();t&&t.id||e.setUser(e.device.id)},Xe={load:function(e){e._sessionDelegate=Je}},Je={startSession:function(e,t){return e._session=t,(e._pausedSession=null)===e._config.enabledReleaseStages||p(e._config.enabledReleaseStages,e._config.releaseStage)?e._delivery.sendSession({notifier:e._notifier,device:t.device,app:t.app,sessions:[{id:t.id,startedAt:t.startedAt,user:t._user}]}):e._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),e},resumeSession:function(e){return e._session?e:e._pausedSession?(e._session=e._pausedSession,e._pausedSession=null,e):e.startSession()},pauseSession:function(e){e._pausedSession=e._session,e._session=null}},We={load:function(e){e._config.collectUserIp||e.addOnError(function(e){e._user&&"undefined"==typeof e._user.id&&delete e._user.id,e._user=u({id:"[REDACTED]"},e._user),e.request=u({clientIp:"[REDACTED]"},e.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}}}},ze={load:function(i){!/^(local-)?dev(elopment)?$/.test(i._config.releaseStage)&&i._isBreadcrumbTypeEnabled("log")&&m(Ge,function(r){var o=console[r];console[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.leaveBreadcrumb("Console output",g(t,function(e,t,n){var r="[Unknown value]";try{r=String(t)}catch(o){}if("[object Object]"===r)try{r=JSON.stringify(t)}catch(o){}return e["["+n+"]"]=r,e},{severity:0===r.indexOf("group")?"log":r}),"log"),o.apply(console,t)},console[r]._restore=function(){console[r]=o}})}},Ge=h(["log","debug","info","warn","error"],function(e){return"undefined"!=typeof console&&"function"==typeof console[e]}),Qe=200,Ye=5e5,Ze=function(d,f){return void 0===d&&(d=document),void 0===f&&(f=window),{load:function(e){var o,i,a,s,t,n,u,c,l;function r(i,a,s){return void 0===s&&(s=!1),function(){var e=[].slice.call(arguments);try{var t,n=a(e),r=n.get();if(s&&i.apply(this,e),"function"!=typeof r)return i.apply(this,e);r.__trace__||(t=c(),r.__trace__=function(){u(t),l(function(){u(null)},0);var e=r.apply(this,arguments);return u(null),e},r.__trace__.__trace__=r.__trace__),n.replace(r.__trace__)}catch(o){}if(i.apply)return i.apply(this,e);switch(e.length){case 1:return i(e[0]);case 2:return i(e[0],e[1]);default:return i()}}}e._config.trackInlineScripts&&(o=f.location.href,s="",i=!!d.attachEvent?"complete"===d.readyState:"loading"!==d.readyState,s=(a=function(){return d.documentElement.outerHTML})(),t=d.onreadystatechange,d.onreadystatechange=function(){"interactive"===d.readyState&&(s=a(),i=!0);try{t.apply(this,arguments)}catch(e){}},n=null,u=function(e){n=e},c=function(){var e,t=d.currentScript||n;return t=t||i?t:(e=d.scripts||d.getElementsByTagName("script"))[e.length-1]},e.addOnError(function(e){e.errors[0].stacktrace=h(e.errors[0].stacktrace,function(e){return!/__trace__$/.test(e.method)});var r,t=e.errors[0].stacktrace[0],n=function(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"")};t&&t.file&&n(t.file)!==n(o)||(n=c())&&(n=n.innerHTML,e.addMetadata("script","content",n.length<=Ye?n:n.substr(0,Ye)),t&&t.lineNumber&&(t.code=(n=t.lineNumber,i&&s||(s=a()),e=["\x3c!-- DOC START --\x3e"].concat(s.split("\n")),n-=1,r=Math.max(n-3,0),n=Math.min(3+n,e.length),g(e.slice(r,n),function(e,t,n){return e[r+1+n]=t.length<=Qe?t:t.substr(0,Qe),e},{}))))},!0),l=m(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(e){return et(f,e,function(e){return r(e,function(t){return{get:function(){return t[0]},replace:function(e){t[0]=e}}})})})[0],m(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(e){f[e]&&f[e].prototype&&Object.prototype.hasOwnProperty.call(f[e].prototype,"addEventListener")&&(et(f[e].prototype,"addEventListener",function(e){return r(e,tt)}),et(f[e].prototype,"removeEventListener",function(e){return r(e,tt,!0)}))}))},configSchema:{trackInlineScripts:{validate:function(e){return!0===e||!1===e},defaultValue:function(){return!0},message:"should be true|false"}}}};function et(e,t,n){var r=e[t];if(!r)return r;n=n(r);return e[t]=n,r}function tt(t){var n=!!t[1]&&"function"==typeof t[1].handleEvent;return{get:function(){return n?t[1].handleEvent:t[1]},replace:function(e){n?t[1].handleEvent=e:t[1]=e}}}var nt=function(a){return void 0===a&&(a=window),{load:function(o){"addEventListener"in a&&o._isBreadcrumbTypeEnabled("user")&&a.addEventListener("click",function(e){var t,n;try{t=function(e){var t=e.textContent||e.innerText||"";t||"submit"!==e.type&&"button"!==e.type||(t=e.value);if(140<(t=t.replace(rt,"$1")).length)return t.slice(0,135)+"(...)";return t}(e.target),n=function i(e,t){var n=[e.tagName];e.id&&n.push("#"+e.id);e.className&&e.className.length&&n.push("."+e.className.split(" ").join("."));if(!t.document.querySelectorAll||!Array.prototype.indexOf)return n.join("");try{if(1===t.document.querySelectorAll(n.join("")).length)return n.join("")}catch(o){return n.join("")}{var r;1<e.parentNode.childNodes.length&&(r=Array.prototype.indexOf.call(e.parentNode.childNodes,e)+1,n.push(":nth-child("+r+")"))}if(1===t.document.querySelectorAll(n.join("")).length)return n.join("");if(e.parentNode)return i(e.parentNode,t)+" > "+n.join("");return n.join("")}(e.target,a)}catch(r){n=t="[hidden]",o._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}o.leaveBreadcrumb("UI click",{targetText:t,targetSelector:n},"user")},!0)}}},rt=/^\s*([^\s][\s\S]{0,139}[^\s])?\s*/;var ot=function(n){void 0===n&&(n=window);var e={load:function(t){var e;"addEventListener"in n&&t._isBreadcrumbTypeEnabled("navigation")&&(n.addEventListener("pagehide",(e=function(e){return function(){return t.leaveBreadcrumb(e,{},"navigation")}})("Page hidden"),!0),n.addEventListener("pageshow",e("Page shown"),!0),n.addEventListener("load",e("Page loaded"),!0),n.document.addEventListener("DOMContentLoaded",e("DOMContentLoaded"),!0),n.addEventListener("load",function(){return n.addEventListener("popstate",e("Navigated back"),!0)}),n.addEventListener("hashchange",function(e){e=e.oldURL?{from:it(e.oldURL,n),to:it(e.newURL,n),state:ut(n)}:{to:it(n.location.href,n)};t.leaveBreadcrumb("Hash changed",e,"navigation")},!0),n.history.pushState&&st(t,n.history,"pushState",n,!0),n.history.replaceState&&st(t,n.history,"replaceState",n))}};return e},it=function(e,t){t=t.document.createElement("A");return t.href=e,""+t.pathname+t.search+t.hash},at=function(e,t,n,r){var o=it(e.location.href,e);return{title:n,state:t,prevState:ut(e),to:r||o,from:o}},st=function(r,o,i,a,s){void 0===s&&(s=!1);var u=o[i];o[i]=function(e,t,n){r.leaveBreadcrumb("History "+i,at(a,e,t,n),"navigation"),s&&"function"==typeof r.resetEventCount&&r.resetEventCount(),u.apply(o,[e,t].concat(n!==undefined?n:[]))}},ut=function(e){try{return e.history.state}catch(t){}},ct="request",lt=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=window);var n={load:function(s){var u,r,c,n,l,a,d,f;s._isBreadcrumbTypeEnabled("request")&&(u=[s._config.endpoints.notify,s._config.endpoints.sessions].concat(e),"addEventListener"in t.XMLHttpRequest.prototype&&"WeakMap"in t&&(r=new WeakMap,c=new WeakMap,n=t.XMLHttpRequest.prototype.open,t.XMLHttpRequest.prototype.open=function(e,t){this&&r.set(this,{method:e,url:t}),n.apply(this,arguments)},l=t.XMLHttpRequest.prototype.send,t.XMLHttpRequest.prototype.send=function(e){var o,t,n,i=this,a=r.get(this);a&&((t=c.get(this))&&(this.removeEventListener("load",t.load),this.removeEventListener("error",t.error)),o=new Date,t=function(){var e,t,n;e=a.method,t=a.url,n=dt(o),t!==undefined?"string"==typeof t&&p(u,t.replace(/\?.*$/,""))||s.leaveBreadcrumb("XMLHttpRequest error",{method:String(e),url:String(t),duration:n},ct):s._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.")},this.addEventListener("load",n=function(){var e,t,n,r;e=a.method,t=a.url,n=i.status,r=dt(o),t!==undefined?"string"==typeof t&&p(u,t.replace(/\?.*$/,""))||(e={status:n,method:String(e),url:String(t),duration:r},400<=n?s.leaveBreadcrumb("XMLHttpRequest failed",e,ct):s.leaveBreadcrumb("XMLHttpRequest succeeded",e,ct)):s._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.")}),this.addEventListener("error",t),this&&c.set(this,{load:n,error:t})),l.apply(this,arguments)}),"fetch"in t&&!t.fetch.polyfill&&(a=t.fetch,t.fetch=function(){var o,e=arguments,t=arguments[0],n=arguments[1],i=null;return t&&"object"==typeof t?(i=t.url,n&&"method"in n?o=n.method:t&&"method"in t&&(o=t.method)):(i=t,n&&"method"in n&&(o=n.method)),o===undefined&&(o="GET"),new Promise(function(t,n){var r=new Date;a.apply(void 0,e).then(function(e){d(e,o,i,dt(r)),t(e)})["catch"](function(e){f(o,i,dt(r)),n(e)})})}),d=function(e,t,n,r){t={method:String(t),status:e.status,url:String(n),duration:r};400<=e.status?s.leaveBreadcrumb("fetch() failed",t,ct):s.leaveBreadcrumb("fetch() succeeded",t,ct)},f=function(e,t,n){s.leaveBreadcrumb("fetch() error",{method:String(e),url:String(t),duration:n},ct)})}};return n},dt=function(e){return e&&new Date-e},ft={load:function(t){var n=0;t.addOnError(function(e){if(n>=t._config.maxEvents)return t._logger.warn("Cancelling event send due to maxEvents per session limit of "+t._config.maxEvents+" being reached"),!1;n++}),t.resetEventCount=function(){n=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(e){return t(1,100)(e)}}}},gt={},ht=(gt={load:function(e){e.addOnError(function(e){e=g(e.errors,function(e,t){return e.concat(t.stacktrace)},[]);m(e,function(e){e.file=ht(e.file)})})}})._strip=function(e){return"string"==typeof e?e.replace(/\?.*$/,"").replace(/#.*$/,""):e},pt=function(e,d){return void 0===e&&(e=window),void 0===d&&(d="window onerror"),{load:function(c){var l;c._config.autoDetectErrors&&c._config.enabledErrorTypes.unhandledExceptions&&(l=e.onerror,e.onerror=function(e,t,n,r,o){var i,a,s,u;0===n&&/Script error\.?/.test(e)?c._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z"):(i={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},o?(u=c.Event.create(o,!0,i,d,1),mt(u.errors[0].stacktrace,t,n,r)):"object"!=typeof e||null===e||t&&"string"==typeof t||n||r||o?(u=c.Event.create(e,!0,i,d,1),mt(u.errors[0].stacktrace,t,n,r)):(a=e.type?"Event: "+e.type:"Error",s=e.message||e.detail||"",(u=c.Event.create({name:a,message:s},!0,i,d,1)).originalError=e,u.addMetadata(d,{event:e,extraParameters:t})),c._notify(u)),"function"==typeof l&&l.apply(this,arguments)})}}},mt=function(e,t,n,r){e[0]||e.push({});e=e[0];e.file||"string"!=typeof t||(e.file=t),!e.lineNumber&&vt(n)&&(e.lineNumber=n),e.columnNumber||(vt(r)?e.columnNumber=r:window.event&&vt(window.event.errorCharacter)&&(e.columnNumber=window.event.errorCharacter))},vt=function(e){return"number"==typeof e&&"NaN"!==String.call(e)},yt=function(t){return function(e){e.file!==t.toString()&&e.method&&(e.method=e.method.replace(/^\s+/,""))}},e={},_t=u({},v.schema,o),n={_client:null,createClient:function(e){e=(e="string"==typeof e?{apiKey:e}:e)||{};var t,n,r,o,i,a=[Re,(void 0===o&&(o=navigator),void 0===i&&(i=window),{load:function(t){var n={locale:o.browserLanguage||o.systemLanguage||o.userLanguage||o.language,userAgent:o.userAgent};i&&i.screen&&i.screen.orientation&&i.screen.orientation.type?n.orientation=i.screen.orientation.type:i&&i.document&&(n.orientation=i.document.documentElement.clientWidth>i.document.documentElement.clientHeight?"landscape":"portrait"),t._config.generateAnonymousId&&(n.id=$e(i)),t.addOnSession(function(e){e.device=u({},e.device,n),t._config.collectUserIp||Ue(e)}),t.addOnError(function(e){e.device=u({},e.device,n,{time:new Date}),t._config.collectUserIp||Ue(e)},!0)},configSchema:{generateAnonymousId:{validate:function(e){return!0===e||!1===e},defaultValue:function(){return!0},message:"should be true|false"}}}),(void 0===r&&(r=window),{load:function(e){e.addOnError(function(e){e.context===undefined&&(e.context=r.location.pathname)},!0)}}),(void 0===n&&(n=window),{load:function(e){e.addOnError(function(e){e.request&&e.request.url||(e.request=u({},e.request,{url:n.location.href}))},!0)}}),ft,Xe,We,gt,pt(),(void 0===t&&(t=window),{load:function(o){var n;o._config.autoDetectErrors&&o._config.enabledErrorTypes.unhandledRejections&&(n=function(e){var t=e.reason,n=!1;try{e.detail&&e.detail.reason&&(t=e.detail.reason,n=!0)}catch(r){}e=o.Event.create(t,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,o._logger);n&&m(e.errors[0].stacktrace,yt(t)),o._notify(e,function(e){var t;D(e.originalError)&&!e.originalError.stack&&e.addMetadata("unhandledRejection handler",((t={})[Object.prototype.toString.call(e.originalError)]={name:e.originalError.name,message:e.originalError.message,code:e.originalError.code},t))})},"addEventListener"in t?t.addEventListener("unhandledrejection",n):t.onunhandledrejection=function(e,t){n({detail:{reason:e,promise:t}})},0)}}),ot(),nt(),lt(),ze,Ze()],e=new we(e,_t,a,{name:"Bugsnag JavaScript",version:"8.0.0",url:"https://github.com/bugsnag/bugsnag-js"});return e._setDelivery(window.XDomainRequest?ge:xe),e._logger.debug("Loaded!"),e.leaveBreadcrumb("Bugsnag loaded",{},"state"),e._config.autoTrackSessions?e.startSession():e},start:function(e){return n._client?n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."):n._client=n.createClient(e),n._client},isStarted:function(){return null!=n._client}};return m(["resetEventCount"].concat(i(we.prototype)),function(t){/^_/.test(t)||(n[t]=function(){if(!n._client)return console.log("Bugsnag."+t+"() was called before Bugsnag.start()");n._client._depth+=1;var e=n._client[t].apply(n._client,arguments);return--n._client._depth,e})}),(e=n).Client=we,e.Event=Y,e.Session=me,e.Breadcrumb=S,e["default"]=n,e}); | ||
//# sourceMappingURL=bugsnag.min.js.map |
{ | ||
"name": "@bugsnag/browser", | ||
"version": "8.0.0-alpha.13", | ||
"version": "8.0.0", | ||
"main": "dist/bugsnag.js", | ||
@@ -33,24 +33,24 @@ "types": "types/bugsnag.d.ts", | ||
"devDependencies": { | ||
"@bugsnag/delivery-x-domain-request": "^8.0.0-alpha.13", | ||
"@bugsnag/delivery-xml-http-request": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-app-duration": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-browser-context": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-browser-device": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-browser-request": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-browser-session": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-client-ip": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-console-breadcrumbs": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-inline-script-content": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-interaction-breadcrumbs": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-navigation-breadcrumbs": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-network-breadcrumbs": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-simple-throttle": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-strip-query-string": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-window-onerror": "^8.0.0-alpha.13", | ||
"@bugsnag/plugin-window-unhandled-rejection": "^8.0.0-alpha.13" | ||
"@bugsnag/delivery-x-domain-request": "^8.0.0", | ||
"@bugsnag/delivery-xml-http-request": "^8.0.0", | ||
"@bugsnag/plugin-app-duration": "^8.0.0", | ||
"@bugsnag/plugin-browser-context": "^8.0.0", | ||
"@bugsnag/plugin-browser-device": "^8.0.0", | ||
"@bugsnag/plugin-browser-request": "^8.0.0", | ||
"@bugsnag/plugin-browser-session": "^8.0.0", | ||
"@bugsnag/plugin-client-ip": "^8.0.0", | ||
"@bugsnag/plugin-console-breadcrumbs": "^8.0.0", | ||
"@bugsnag/plugin-inline-script-content": "^8.0.0", | ||
"@bugsnag/plugin-interaction-breadcrumbs": "^8.0.0", | ||
"@bugsnag/plugin-navigation-breadcrumbs": "^8.0.0", | ||
"@bugsnag/plugin-network-breadcrumbs": "^8.0.0", | ||
"@bugsnag/plugin-simple-throttle": "^8.0.0", | ||
"@bugsnag/plugin-strip-query-string": "^8.0.0", | ||
"@bugsnag/plugin-window-onerror": "^8.0.0", | ||
"@bugsnag/plugin-window-unhandled-rejection": "^8.0.0" | ||
}, | ||
"dependencies": { | ||
"@bugsnag/core": "^8.0.0-alpha.13" | ||
"@bugsnag/core": "^8.0.0" | ||
}, | ||
"gitHead": "d50f82699bb1bc217ba72b1a7bfee1b96f8473b7" | ||
"gitHead": "73555402fbc4908d4474593d18b0d001fc9c7502" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
549415
Updated@bugsnag/core@^8.0.0