Skip to content

Instantly share code, notes, and snippets.

@kristoferbaxter
Created November 19, 2019 23:31
Show Gist options
  • Save kristoferbaxter/88105027b3878eaabc4b752639ebd730 to your computer and use it in GitHub Desktop.
Save kristoferbaxter/88105027b3878eaabc4b752639ebd730 to your computer and use it in GitHub Desktop.
Post Closure Parse
'use strict';
let xa = {en:"English", ja:"\u65e5\u672c\u8a9e Japanese BETA", ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439 Russian BETA", "ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439 Russian BETA", "en-AU":"English (Australia)", "en-CA":"English (Canada)", "en-IE":"English (Ireland)", "en-IN":"English (India)", "en-NZ":"English (New Zealand)", "en-PH":"English (Philippines)", "en-ZA":"English (South Africa)", "en-GB":"English (UK)", "en-US":"English (US)"};
"en-AU en-CA en-IE en-IN en-NZ en-PH en-ZA en-GB en-US ja ru-RU".split(" ").reduce((g, q) => {
g[q] = xa[q];
return g;
}, {});
var ya = "object" == typeof self && self && self.Object === Object && self, F = "object" == typeof global && global && global.Object === Object && global || ya || Function("return this")(), L = F.Symbol, za = Object.prototype, hasOwnProperty = za.hasOwnProperty, Aa = za.toString, U = L ? L.toStringTag : void 0, Ba = Object.prototype.toString, Xa = L ? L.toStringTag : void 0;
function Ya(g) {
var q = typeof g;
return null != g && ("object" == q || "function" == q);
}
var V = F["__core-js_shared__"], W, Za = /[^.]+$/.exec(V && V.keys && V.keys.IE_PROTO || "");
W = Za ? "Symbol(src)_1." + Za : "";
var $a = Function.prototype.toString;
function ab(g) {
if (null != g) {
try {
return $a.call(g);
} catch (q) {
}
return g + "";
}
return "";
}
var bb = /^\[object .+?Constructor\]$/, cb = RegExp("^" + Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
function db(g, q) {
g = null == g ? void 0 : g[q];
if (!Ya(g) || W && W in g) {
var n = !1;
} else {
if (Ya(g)) {
if (null == g) {
n = void 0 === g ? "[object Undefined]" : "[object Null]";
} else {
if (Xa && Xa in Object(g)) {
q = hasOwnProperty.call(g, U);
var G = g[U];
try {
g[U] = void 0, n = !0;
} catch (Ca) {
}
var H = Aa.call(g);
n && (q ? g[U] = G : delete g[U]);
n = H;
} else {
n = Ba.call(g);
}
}
n = "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n;
} else {
n = !1;
}
n = (n ? cb : bb).test(ab(g));
}
return n ? g : void 0;
}
db(Object, "create");
var Map = db(F, "Map"), X = void 0;
X = {exports:{}};
(function(g) {
g.exports = function() {
function g(a) {
return function(b, c) {
if (c.file === a.toString()) {
return b;
}
c.method && (c.method = c.method.replace(/^\s+/, ""));
return b.concat(c);
};
}
function n(a) {
if (null === a || void 0 === a) {
return "undefined (or null)";
}
if (Da(a)) {
var b;
return b = {}, b[Object.prototype.toString.call(a)] = {name:a.name, message:a.message, code:a.code, stack:a.stack}, b;
}
return a;
}
function G(a) {
return "number" === typeof a && "NaN" !== String.call(a);
}
function H(a, b, c, d) {
var e = a[0];
if (!e) {
return a;
}
e.fileName || "string" !== typeof b || e.setFileName(b);
!e.lineNumber && G(c) && e.setLineNumber(c);
e.columnNumber || (G(d) ? e.setColumnNumber(d) : window.event && G(window.event.errorCharacter) && e.setColumnNumber(window.event.errorCharacter));
return a;
}
function Ca() {
if ("fetch" in u && !u.fetch.polyfill) {
var a = u.fetch;
u.fetch = function() {
for (var b = arguments.length, c = Array(b), d = 0; d < b; d++) {
c[d] = arguments[d];
}
var e = c[0];
b = c[1];
var f = "GET";
b && b.method && (f = b.method);
return new Promise(function(b, d) {
a.apply(void 0, c).then(function(a) {
var c = {status:a.status, request:f + " " + e};
400 <= a.status ? r.leaveBreadcrumb("fetch() failed", c, "request") : r.leaveBreadcrumb("fetch() succeeded", c, "request");
b(a);
})["catch"](function(a) {
r.leaveBreadcrumb("fetch() error", {request:f + " " + e}, "request");
d(a);
});
});
};
}
}
function eb() {
if ("addEventListener" in u.XMLHttpRequest.prototype) {
var a = u.XMLHttpRequest.prototype.open;
u.XMLHttpRequest.prototype.open = function(b, c) {
this["BS~~U"] = c;
this["BS~~M"] = b;
this["BS~~S"] && (this.removeEventListener("load", Ea), this.removeEventListener("error", Fa));
this.addEventListener("load", Ea);
this.addEventListener("error", Fa);
this["BS~~S"] = !0;
a.apply(this, arguments);
};
}
}
function fb() {
return [r.config.endpoints.notify, r.config.endpoints.sessions];
}
function Ga(a) {
try {
return a.history.state;
} catch (b) {
}
}
function Ha(a, b, c, d) {
var e = b[c];
b[c] = function(f, m, k) {
a.leaveBreadcrumb("History " + c, gb(d, f, m, k), "navigation");
"function" === typeof a.refresh && a.refresh();
a.config.autoCaptureSessions && a.startSession();
e.apply(b, [f, m].concat(void 0 !== k ? k : []));
};
}
function gb(a, b, c, d) {
var e = M(a.location.href, a);
return {title:c, state:b, prevState:Ga(a), to:d || e, from:e};
}
function M(a, b) {
b = b.document.createElement("A");
b.href = a;
return "" + b.pathname + b.search + b.hash;
}
function hb(a, b) {
void 0 === b && (b = window);
return {sendReport:function(c, d) {
void 0 === d && (d = function() {
});
try {
var e = a.config.endpoints.notify, f = new b.XMLHttpRequest;
f.onreadystatechange = function() {
f.readyState === b.XMLHttpRequest.DONE && d(null);
};
f.open("POST", e);
f.setRequestHeader("Content-Type", "application/json");
f.setRequestHeader("Bugsnag-Api-Key", c.apiKey || a.config.apiKey);
f.setRequestHeader("Bugsnag-Payload-Version", "4");
f.setRequestHeader("Bugsnag-Sent-At", z());
f.send(A.report(c, a.config.filters));
} catch (m) {
a._logger.error(m);
}
}, sendSession:function(c, d) {
void 0 === d && (d = function() {
});
try {
var e = a.config.endpoints.sessions, f = new b.XMLHttpRequest;
f.onreadystatechange = function() {
f.readyState === b.XMLHttpRequest.DONE && d(null);
};
f.open("POST", e);
f.setRequestHeader("Content-Type", "application/json");
f.setRequestHeader("Bugsnag-Api-Key", a.config.apiKey);
f.setRequestHeader("Bugsnag-Payload-Version", "1");
f.setRequestHeader("Bugsnag-Sent-At", z());
f.send(A.session(c, a.config.filters));
} catch (m) {
a._logger.error(m);
}
}};
}
function Ia(a, b, c, d) {
return ib(a.endpoints[b], d.location.protocol) + "?apiKey=" + encodeURIComponent(a.apiKey) + "&payloadVersion=" + c + "&sentAt=" + encodeURIComponent(z());
}
function Y(a, b, c, d) {
return JSON.stringify(jb(a, d && d.filterKeys ? d.filterKeys : [], d && d.filterPaths ? d.filterPaths : []), b, c);
}
function kb(a) {
return "Bugsnag configuration error\n" + B(a, function(a) {
var b = '"' + a.key + '" ' + a.message + " \n got ";
a = a.value;
a = "object" === typeof a ? JSON.stringify(a) : String(a);
return b + a;
}).join("\n\n");
}
function lb(a, b, c) {
function d(a) {
a = "notify() expected error/opts parameters, got " + a;
c.warn("Usage error. " + a);
return Error("Bugsnag usage error. " + a);
}
var e = 0;
switch(typeof a) {
case "string":
if ("string" === typeof b) {
var f = d("string/string");
var m = {metaData:{notifier:{notifyArgs:[a, b]}}};
} else {
f = Error(String(a)), e = 3;
}
break;
case "number":
case "boolean":
f = Error(String(a));
break;
case "function":
f = d("function");
break;
case "object":
null !== a && (Da(a) || a.__isBugsnagReport) ? f = a : null === a || "string" !== typeof a.name && "string" !== typeof a.errorClass || "string" !== typeof a.message && "string" !== typeof a.errorMessage ? f = d(null === a ? "null" : "unsupported object") : (f = Error(a.message || a.errorMessage), f.name = a.name || a.errorClass, e = 3);
break;
default:
f = d("nothing");
}
return {err:f, errorFramesToSkip:e, _opts:m};
}
function N(a, b) {
a = "000000000" + a;
return a.substr(a.length - b);
}
function Z(a) {
return !!a && (!!a.stack || !!a.stacktrace || !!a["opera#sourceloc"]) && "string" === typeof(a.stack || a.stacktrace || a["opera#sourceloc"]) && a.stack !== a.name + ": " + a.message;
}
function aa(a, b) {
return a.isIgnored() || !1 === b;
}
function mb(a, b) {
return function(c, d) {
if ("function" !== typeof c) {
return d(null, !1);
}
try {
if (2 !== c.length) {
var e = c(a);
return e && "function" === typeof e.then ? e.then(function(b) {
return setTimeout(function() {
return d(null, aa(a, b));
}, 0);
}, function(a) {
setTimeout(function() {
b(a);
return d(null, !1);
});
}) : d(null, aa(a, e));
}
c(a, function(c, e) {
if (c) {
return b(c), d(null, !1);
}
d(null, aa(a, e));
});
} catch (f) {
b(f), d(null, !1);
}
};
}
function Da(a) {
switch(Object.prototype.toString.call(a)) {
case "[object Error]":
return !0;
case "[object Exception]":
return !0;
case "[object DOMException]":
return !0;
default:
return a instanceof Error;
}
}
function Ja(a) {
return a.app && "string" === typeof a.app.releaseStage ? a.app.releaseStage : a.config.releaseStage;
}
function nb(a, b, c) {
function d() {
if (f >= e) {
return c(null, !1);
}
b(a[f], function(a, b) {
if (a) {
return c(a, !1);
}
if (!0 === b) {
return c(null, !0);
}
f++;
d();
});
}
var e = a.length, f = 0;
d();
}
function ob() {
var a = {}, b = console.log;
B(["debug", "info", "warn", "error"], function(c) {
var d = console[c];
a[c] = "function" === typeof d ? d.bind(console, "[bugsnag]") : b.bind(console, "[bugsnag]");
});
return a;
}
function ba(a) {
var b = [];
for (c in a) {
Object.prototype.hasOwnProperty.call(a, c) && b.push(c);
}
if (!pb) {
return b;
}
var c = 0;
for (var d = ca.length; c < d; c++) {
Object.prototype.hasOwnProperty.call(a, ca[c]) && b.push(ca[c]);
}
return b;
}
function z() {
var a = new Date;
return a.getUTCFullYear() + "-" + I(a.getUTCMonth() + 1) + "-" + I(a.getUTCDate()) + "T" + I(a.getUTCHours()) + ":" + I(a.getUTCMinutes()) + ":" + I(a.getUTCSeconds()) + "." + (a.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + "Z";
}
function J(a) {
return "[object Array]" === Object.prototype.toString.call(a);
}
function O(a, b) {
return p(a, function(a, d) {
return !0 === a || d === b;
}, !1);
}
function x(a, b) {
return p(a, function(a, d, e, f) {
return b(d, e, f) ? a.concat(d) : a;
}, []);
}
function B(a, b) {
return p(a, function(a, d, e, f) {
return a.concat(b(d, e, f));
}, []);
}
function I(a) {
return 10 > a ? "0" + a : a;
}
function p(a, b, c) {
for (var d = 0, e = a.length; d < e; d++) {
c = b(c, a[d], d, a);
}
return c;
}
function da() {
da = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return da.apply(this, arguments);
}
function ea() {
ea = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return ea.apply(this, arguments);
}
function Ka() {
var a = (new Date).getTime().toString(36);
K = K < fa ? K : 0;
K++;
var b = N((K - 1).toString(36), 4), c = La, d = N((Math.random() * fa << 0).toString(36), 4) + N((Math.random() * fa << 0).toString(36), 4);
return "c" + a + b + c + d;
}
function t() {
t = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return t.apply(this, arguments);
}
function jb(a, b, c) {
function d(a, k) {
f++;
if (k.length > qb || k.length > ha && f > ia) {
return ja;
}
if (null === a || "object" !== typeof a) {
return a;
}
a: {
var h = 0;
for (var m = e.length; h < m; h++) {
if (e[h] === a) {
h = !0;
break a;
}
}
h = !1;
}
if (h) {
return "[Circular]";
}
e.push(a);
if ("function" === typeof a.toJSON) {
try {
f--;
var l = d(a.toJSON(), k);
e.pop();
return l;
} catch (C) {
return "[Throws: " + (C ? C.message : "?") + "]";
}
}
if (a instanceof Error || /^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(a))) {
return f--, a = d({name:a.name, message:a.message}, k), e.pop(), a;
}
if ("[object Array]" === Object.prototype.toString.call(a)) {
for (var g = [], D = 0, ka = a.length; D < ka; D++) {
if (k.length > ha && f > ia) {
g.push(ja);
break;
}
g.push(d(a[D], k.concat("[]")));
}
e.pop();
return g;
}
l = {};
try {
for (g in a) {
if (Object.prototype.hasOwnProperty.call(a, g)) {
a: {
h = c;
ka = k.join(".");
m = 0;
for (var rb = h.length; m < rb; m++) {
if (0 === ka.indexOf(h[m])) {
D = !0;
break a;
}
}
D = !1;
}
var n;
if (n = D) {
a: {
h = b;
m = g;
for (var y = 0, q = h.length; y < q; y++) {
if ("string" === typeof h[y] && h[y] === m || h[y] && "function" === typeof h[y].test && h[y].test(m)) {
n = !0;
break a;
}
}
n = !1;
}
}
if (n) {
l[g] = "[Filtered]";
} else {
if (k.length > ha && f > ia) {
l[g] = ja;
break;
}
h = g;
try {
var p = a[g];
} catch (C) {
p = "[Throws: " + (C ? C.message : "?") + "]";
}
l[h] = d(p, k.concat(g));
}
}
}
} catch (C) {
}
e.pop();
return l;
}
var e = [], f = 0;
return d(a, []);
}
function P() {
P = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return P.apply(this, arguments);
}
function la() {
la = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return la.apply(this, arguments);
}
function ma() {
ma = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return ma.apply(this, arguments);
}
function Q() {
Q = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return Q.apply(this, arguments);
}
function na(a, b, c) {
var d = a[b];
if (!d) {
return d;
}
c = c(d);
a[b] = c;
return d;
}
function Na(a) {
var b = !!a[1] && "function" === typeof a[1].handleEvent;
return {get:function() {
return b ? a[1].handleEvent : a[1];
}, replace:function(c) {
b ? a[1].handleEvent = c : a[1] = c;
}};
}
function Oa(a, b) {
var c = [a.tagName];
a.id && c.push("#" + a.id);
a.className && a.className.length && c.push("." + a.className.split(" ").join("."));
if (!b.document.querySelectorAll || !Array.prototype.indexOf) {
return c.join("");
}
try {
if (1 === b.document.querySelectorAll(c.join("")).length) {
return c.join("");
}
} catch (e) {
return c.join("");
}
if (1 < a.parentNode.childNodes.length) {
var d = Array.prototype.indexOf.call(a.parentNode.childNodes, a) + 1;
c.push(":nth-child(" + d + ")");
}
return 1 === b.document.querySelectorAll(c.join("")).length ? c.join("") : a.parentNode ? Oa(a.parentNode, b) + " > " + c.join("") : c.join("");
}
function Ea() {
if (!Pa(oa(), this["BS~~U"])) {
var a = {status:this.status, request:this["BS~~M"] + " " + this["BS~~U"]};
400 <= this.status ? r.leaveBreadcrumb("XMLHttpRequest failed", a, "request") : r.leaveBreadcrumb("XMLHttpRequest succeeded", a, "request");
}
}
function Fa() {
Pa(oa, this["BS~~U"]) || r.leaveBreadcrumb("XMLHttpRequest error", {request:this["BS~~M"] + " " + this["BS~~U"]}, "request");
}
function pa() {
pa = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return pa.apply(this, arguments);
}
function qa() {
qa = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b], d;
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
}
}
return a;
};
return qa.apply(this, arguments);
}
var pb = !{toString:null}.propertyIsEnumerable("toString"), ca = "toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" ");
var Qa = function(a, b) {
void 0 === a && (a = 1);
void 0 === b && (b = Infinity);
return function(c) {
return "number" === typeof c && parseInt("" + c, 10) === c && c >= a && c <= b;
};
};
var E = function(a) {
return "string" === typeof a && !!a.length;
};
var v = {};
v.schema = {apiKey:{defaultValue:function() {
return null;
}, message:"is required", validate:E}, appVersion:{defaultValue:function() {
return null;
}, message:"should be a string", validate:function(a) {
return null === a || E(a);
}}, appType:{defaultValue:function() {
return null;
}, message:"should be a string", validate:function(a) {
return null === a || E(a);
}}, autoNotify:{defaultValue:function() {
return !0;
}, message:"should be true|false", validate:function(a) {
return !0 === a || !1 === a;
}}, beforeSend:{defaultValue:function() {
return [];
}, message:"should be a function or array of functions", validate:function(a) {
return "function" === typeof a || J(a) && x(a, function(a) {
return "function" === typeof a;
}).length === a.length;
}}, endpoints:{defaultValue:function() {
return {notify:"https://notify.bugsnag.com", sessions:"https://sessions.bugsnag.com"};
}, message:"should be an object containing endpoint URLs { notify, sessions }. sessions is optional if autoCaptureSessions=false", validate:function(a, b) {
return a && "object" === typeof a && E(a.notify) && (!1 === b.autoCaptureSessions || E(a.sessions)) && 0 === x(ba(a), function(a) {
return !O(["notify", "sessions"], a);
}).length;
}}, autoCaptureSessions:{defaultValue:function(a, b) {
return void 0 === b.endpoints || !!b.endpoints && !!b.endpoints.sessions;
}, message:"should be true|false", validate:function(a) {
return !0 === a || !1 === a;
}}, notifyReleaseStages:{defaultValue:function() {
return null;
}, message:"should be an array of strings", validate:function(a) {
return null === a || J(a) && x(a, function(a) {
return "string" === typeof a;
}).length === a.length;
}}, releaseStage:{defaultValue:function() {
return "production";
}, message:"should be a string", validate:function(a) {
return "string" === typeof a && a.length;
}}, maxBreadcrumbs:{defaultValue:function() {
return 20;
}, message:"should be a number \u226440", validate:function(a) {
return Qa(0, 40)(a);
}}, autoBreadcrumbs:{defaultValue:function() {
return !0;
}, message:"should be true|false", validate:function(a) {
return "boolean" === typeof a;
}}, user:{defaultValue:function() {
return null;
}, message:"(object) user should be an object", validate:function(a) {
return "object" === typeof a;
}}, metaData:{defaultValue:function() {
return null;
}, message:"should be an object", validate:function(a) {
return "object" === typeof a;
}}, logger:{defaultValue:function() {
}, message:"should be null or an object with methods { debug, info, warn, error }", validate:function(a) {
return !a || a && p(["debug", "info", "warn", "error"], function(b, c) {
return b && "function" === typeof a[c];
}, !0);
}}, filters:{defaultValue:function() {
return ["password"];
}, message:"should be an array of strings|regexes", validate:function(a) {
return J(a) && a.length === x(a, function(a) {
return "string" === typeof a || a && "function" === typeof a.test;
}).length;
}}};
v.mergeDefaults = function(a, b) {
if (!a || !b) {
throw Error("opts and schema objects are required");
}
return p(ba(b), function(c, d) {
c[d] = void 0 !== a[d] ? a[d] : b[d].defaultValue(a[d], a);
return c;
}, {});
};
v.validate = function(a, b) {
if (!a || !b) {
throw Error("opts and schema objects are required");
}
var c = p(ba(b), function(c, e) {
return b[e].validate(a[e], a) ? c : c.concat({key:e, message:b[e].message, value:a[e]});
}, []);
return {valid:!c.length, errors:c};
};
var sb = {releaseStage:{defaultValue:function() {
return /^localhost(:\d+)?$/.test(window.location.host) ? "development" : "production";
}, message:"should be set", validate:E}, logger:da({}, v.schema.logger, {defaultValue:function() {
return "undefined" !== typeof console && "function" === typeof console.debug ? ob() : void 0;
}})}, ra = function() {
function a(a, c, d, e) {
void 0 === a && (a = "[anonymous]");
void 0 === c && (c = {});
void 0 === d && (d = "manual");
void 0 === e && (e = z());
this.type = d;
this.name = a;
this.metaData = c;
this.timestamp = e;
}
a.prototype.toJSON = function() {
return {type:this.type, name:this.name, timestamp:this.timestamp, metaData:this.metaData};
};
return a;
}(), R = {};
(function(a, b) {
"object" === typeof R ? R = b() : a.StackFrame = b();
})(this, function() {
function a(a) {
return !isNaN(parseFloat(a)) && isFinite(a);
}
function b(a) {
return a.charAt(0).toUpperCase() + a.substring(1);
}
function c(a) {
return function() {
return this[a];
};
}
function d(a) {
if (a instanceof Object) {
for (var c = 0; c < k.length; c++) {
if (a.hasOwnProperty(k[c]) && void 0 !== a[k[c]]) {
this["set" + b(k[c])](a[k[c]]);
}
}
}
}
var e = ["isConstructor", "isEval", "isNative", "isToplevel"], f = ["columnNumber", "lineNumber"], m = ["fileName", "functionName", "source"], k = e.concat(f, m, ["args"]);
d.prototype = {getArgs:function() {
return this.args;
}, setArgs:function(a) {
if ("[object Array]" !== Object.prototype.toString.call(a)) {
throw new TypeError("Args must be an Array");
}
this.args = a;
}, getEvalOrigin:function() {
return this.evalOrigin;
}, setEvalOrigin:function(a) {
if (a instanceof d) {
this.evalOrigin = a;
} else {
if (a instanceof Object) {
this.evalOrigin = new d(a);
} else {
throw new TypeError("Eval Origin must be an Object or StackFrame");
}
}
}, toString:function() {
var b = this.getFunctionName() || "{anonymous}", c = "(" + (this.getArgs() || []).join(",") + ")", d = this.getFileName() ? "@" + this.getFileName() : "", e = a(this.getLineNumber()) ? ":" + this.getLineNumber() : "", f = a(this.getColumnNumber()) ? ":" + this.getColumnNumber() : "";
return b + c + d + e + f;
}};
for (var h = 0; h < e.length; h++) {
d.prototype["get" + b(e[h])] = c(e[h]), d.prototype["set" + b(e[h])] = function(a) {
return function(b) {
this[a] = !!b;
};
}(e[h]);
}
for (e = 0; e < f.length; e++) {
d.prototype["get" + b(f[e])] = c(f[e]), d.prototype["set" + b(f[e])] = function(b) {
return function(c) {
if (!a(c)) {
throw new TypeError(b + " must be a Number");
}
this[b] = Number(c);
};
}(f[e]);
}
for (f = 0; f < m.length; f++) {
d.prototype["get" + b(m[f])] = c(m[f]), d.prototype["set" + b(m[f])] = function(a) {
return function(b) {
this[a] = String(b);
};
}(m[f]);
}
return d;
});
var sa = {};
(function(a, b) {
"object" === typeof sa ? sa = b(R) : a.ErrorStackParser = b(a.StackFrame);
})(this, function(a) {
var b = /(^|@)\S+:\d+/, c = /^\s*at .*(\S+:\d+|\(native\))/m, d = /^(eval@)?(\[native code\])?$/;
return {parse:function(a) {
if ("undefined" !== typeof a.stacktrace || "undefined" !== typeof a["opera#sourceloc"]) {
return this.parseOpera(a);
}
if (a.stack && a.stack.match(c)) {
return this.parseV8OrIE(a);
}
if (a.stack) {
return this.parseFFOrSafari(a);
}
throw Error("Cannot parse given Error object");
}, extractLocation:function(a) {
if (-1 === a.indexOf(":")) {
return [a];
}
a = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a.replace(/[\(\)]/g, ""));
return [a[1], a[2] || void 0, a[3] || void 0];
}, parseV8OrIE:function(b) {
return b.stack.split("\n").filter(function(a) {
return !!a.match(c);
}, this).map(function(b) {
-1 < b.indexOf("(eval ") && (b = b.replace(/eval code/g, "eval").replace(/(\(eval at [^\()]*)|(\),.*$)/g, ""));
var c = b.replace(/^\s+/, "").replace(/\(eval code/g, "(").split(/\s+/).slice(1), d = this.extractLocation(c.pop());
c = c.join(" ") || void 0;
var e = -1 < ["eval", "<anonymous>"].indexOf(d[0]) ? void 0 : d[0];
return new a({functionName:c, fileName:e, lineNumber:d[1], columnNumber:d[2], source:b});
}, this);
}, parseFFOrSafari:function(b) {
return b.stack.split("\n").filter(function(a) {
return !a.match(d);
}, this).map(function(b) {
-1 < b.indexOf(" > eval") && (b = b.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1"));
if (-1 === b.indexOf("@") && -1 === b.indexOf(":")) {
return new a({functionName:b});
}
var c = /((.*".+"[^@]*)?[^@]*)(?:@)/, d = b.match(c);
d = d && d[1] ? d[1] : void 0;
c = this.extractLocation(b.replace(c, ""));
return new a({functionName:d, fileName:c[0], lineNumber:c[1], columnNumber:c[2], source:b});
}, this);
}, parseOpera:function(a) {
return !a.stacktrace || -1 < a.message.indexOf("\n") && a.message.split("\n").length > a.stacktrace.split("\n").length ? this.parseOpera9(a) : a.stack ? this.parseOpera11(a) : this.parseOpera10(a);
}, parseOpera9:function(b) {
var c = /Line (\d+).*script (?:in )?(\S+)/i;
b = b.message.split("\n");
for (var d = [], e = 2, h = b.length; e < h; e += 2) {
var g = c.exec(b[e]);
g && d.push(new a({fileName:g[2], lineNumber:g[1], source:b[e]}));
}
return d;
}, parseOpera10:function(b) {
var c = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
b = b.stacktrace.split("\n");
for (var d = [], e = 0, h = b.length; e < h; e += 2) {
var g = c.exec(b[e]);
g && d.push(new a({functionName:g[3] || void 0, fileName:g[2], lineNumber:g[1], source:b[e]}));
}
return d;
}, parseOpera11:function(c) {
return c.stack.split("\n").filter(function(a) {
return !!a.match(b) && !a.match(/^Error created at/);
}, this).map(function(b) {
var c = b.split("@"), d = this.extractLocation(c.pop()), e = c.shift() || "";
c = e.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^\)]*\)/g, "") || void 0;
var f;
e.match(/\(([^\)]*)\)/) && (f = e.replace(/^[^\(]+\(([^\)]*)\)$/, "$1"));
f = void 0 === f || "[arguments not available]" === f ? void 0 : f.split(",");
return new a({functionName:c, args:f, fileName:d[0], lineNumber:d[1], columnNumber:d[2], source:b});
}, this);
}};
});
var ta = sa, ua = {};
(function(a, b) {
"object" === typeof ua ? ua = b(R) : a.StackGenerator = b(a.StackFrame);
})(this, function(a) {
return {backtrace:function(b) {
var c = [], d = 10;
"object" === typeof b && "number" === typeof b.maxStackSize && (d = b.maxStackSize);
for (b = ""; b && c.length < d && b.arguments;) {
for (var e = Array(b.arguments.length), f = 0; f < e.length; ++f) {
e[f] = b.arguments[f];
}
/function(?:\s+([\w$]+))+\s*\(/.test(b.toString()) ? c.push(new a({functionName:RegExp.$1 || void 0, args:e})) : c.push(new a({args:e}));
try {
b = b.caller;
} catch (m) {
break;
}
}
return c;
}};
});
var w = function() {
function a(a, b, e, f, m) {
void 0 === e && (e = []);
void 0 === f && (f = {unhandled:!1, severity:"warning", severityReason:{type:"handledException"}});
this.__isBugsnagReport = !0;
this._ignored = !1;
this._handledState = f;
this.apiKey = this.app = void 0;
this.breadcrumbs = [];
this.device = this.context = void 0;
this.errorClass = "string" === typeof a && a ? a : "[no error class]";
this.errorMessage = "string" === typeof b && b ? b : "[no error message]";
this.groupingHash = void 0;
this.metaData = {};
this.request = void 0;
this.severity = this._handledState.severity;
this.stacktrace = p(e, function(a, b) {
var c = b.fileName;
var d = b.functionName;
d = /^global code$/i.test(d) ? "global code" : d;
b = {file:c, method:d, lineNumber:b.lineNumber, columnNumber:b.columnNumber, code:void 0, inProject:void 0};
-1 < b.lineNumber && !b.file && !b.method && (b.file = "global code");
try {
return "{}" === JSON.stringify(b) ? a : a.concat(b);
} catch (Ma) {
return a;
}
}, []);
this.session = this.user = void 0;
this.originalError = m;
}
var b = a.prototype;
b.ignore = function() {
this._ignored = !0;
};
b.isIgnored = function() {
return this._ignored;
};
b.updateMetaData = function(a) {
var b;
if (!a) {
return this;
}
var c;
if (null === (1 >= arguments.length ? void 0 : arguments[1])) {
return this.removeMetaData(a);
}
if (null === (2 >= arguments.length ? void 0 : arguments[2])) {
return this.removeMetaData(a, 1 >= arguments.length ? void 0 : arguments[1], 2 >= arguments.length ? void 0 : arguments[2]);
}
"object" === typeof(1 >= arguments.length ? void 0 : arguments[1]) && (c = 1 >= arguments.length ? void 0 : arguments[1]);
"string" === typeof(1 >= arguments.length ? void 0 : arguments[1]) && (c = (b = {}, b[1 >= arguments.length ? void 0 : arguments[1]] = 2 >= arguments.length ? void 0 : arguments[2], b));
if (!c) {
return this;
}
this.metaData[a] || (this.metaData[a] = {});
this.metaData[a] = ea({}, this.metaData[a], c);
return this;
};
b.removeMetaData = function(a, b) {
if ("string" !== typeof a) {
return this;
}
if (!b) {
return delete this.metaData[a], this;
}
this.metaData[a] && delete this.metaData[a][b];
return this;
};
b.toJSON = function() {
return {payloadVersion:"4", exceptions:[{errorClass:this.errorClass, message:this.errorMessage, stacktrace:this.stacktrace, type:"browserjs"}], severity:this.severity, unhandled:this._handledState.unhandled, severityReason:this._handledState.severityReason, app:this.app, device:this.device, breadcrumbs:this.breadcrumbs, context:this.context, user:this.user, metaData:this.metaData, groupingHash:this.groupingHash, request:this.request, session:this.session};
};
return a;
}();
w.getStacktrace = function(a, b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
if (Z(a)) {
return ta.parse(a).slice(b);
}
try {
throw a;
} catch (d) {
return Z(d) ? ta.parse(a).slice(1 + c) : x(ua.backtrace(), function(a) {
return -1 === (a.functionName || "").indexOf("StackGenerator$$");
}).slice(1 + c);
}
};
w.ensureReport = function(a, b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
if (a.__isBugsnagReport) {
return a;
}
try {
var d = w.getStacktrace(a, b, 1 + c);
return new w(a.name, a.message, d, void 0, a);
} catch (e) {
return new w(a.name, a.message, [], void 0, a);
}
};
var Ra = "object" === typeof window ? window : self, Sa = 0, Ta;
for (Ta in Ra) {
Object.hasOwnProperty.call(Ra, Ta) && Sa++;
}
var La = N(((navigator.mimeTypes ? navigator.mimeTypes.length : 0) + navigator.userAgent.length).toString(36) + Sa.toString(36), 4), K = 0, fa = Math.pow(36, 4);
Ka.fingerprint = function() {
return La;
};
var Ua = function() {
function a() {
this.id = Ka();
this.startedAt = z();
this._unhandled = this._handled = 0;
}
var b = a.prototype;
b.toJSON = function() {
return {id:this.id, startedAt:this.startedAt, events:{handled:this._handled, unhandled:this._unhandled}};
};
b.trackError = function(a) {
this[a._handledState.unhandled ? "_unhandled" : "_handled"] += 1;
};
return a;
}(), Va = function() {
function a(b) {
if (!(b && b.name && b.version && b.url)) {
throw Error("`notifier` argument is required");
}
this.notifier = b;
this._configured = !1;
this._opts = {};
this.config = {};
this._delivery = {sendSession:function() {
}, sendReport:function() {
}};
this._logger = {debug:function() {
}, info:function() {
}, warn:function() {
}, error:function() {
}};
this._plugins = {};
this._session = null;
this.breadcrumbs = [];
this.app = {};
this.request = this.metaData = this.device = this.context = void 0;
this.user = {};
this.BugsnagClient = a;
this.BugsnagReport = w;
this.BugsnagBreadcrumb = ra;
this.BugsnagSession = Ua;
var c = this, e = this.notify;
this.notify = function() {
return e.apply(c, arguments);
};
}
var b = a.prototype;
b.setOptions = function(a) {
this._opts = t({}, this._opts, a);
};
b.configure = function(a) {
void 0 === a && (a = v.schema);
var b = v.mergeDefaults(this._opts, a);
a = v.validate(b, a);
if (!0 === !a.valid) {
throw Error(kb(a.errors));
}
"function" === typeof b.beforeSend && (b.beforeSend = [b.beforeSend]);
b.appVersion && (this.app.version = b.appVersion);
b.appType && (this.app.type = b.appType);
b.metaData && (this.metaData = b.metaData);
b.user && (this.user = b.user);
b.logger && this.logger(b.logger);
this.config = t({}, this.config, b);
this._configured = !0;
return this;
};
b.use = function(a) {
if (!this._configured) {
throw Error("client not configured");
}
a.configSchema && this.configure(a.configSchema);
for (var b = arguments.length, c = Array(1 < b ? b - 1 : 0), f = 1; f < b; f++) {
c[f - 1] = arguments[f];
}
b = a.init.apply(a, [this].concat(c));
a.name && (this._plugins["~" + a.name + "~"] = b);
return this;
};
b.getPlugin = function(a) {
return this._plugins["~" + a + "~"];
};
b.delivery = function(a) {
this._delivery = a(this);
return this;
};
b.logger = function(a) {
this._logger = a;
return this;
};
b.sessionDelegate = function(a) {
this._sessionDelegate = a;
return this;
};
b.startSession = function() {
return this._sessionDelegate ? this._sessionDelegate.startSession(this) : (this._logger.warn("No session implementation is installed"), this);
};
b.leaveBreadcrumb = function(a, b, e, f) {
if (!this._configured) {
throw Error("client not configured");
}
a = a || void 0;
b = "object" === typeof b && null !== b ? b : void 0;
if ("string" === typeof a || b) {
return a = new ra(a, b, "string" === typeof e ? e : void 0, "string" === typeof f ? f : void 0), this.breadcrumbs.push(a), this.breadcrumbs.length > this.config.maxBreadcrumbs && (this.breadcrumbs = this.breadcrumbs.slice(this.breadcrumbs.length - this.config.maxBreadcrumbs)), this;
}
};
b.notify = function(a, b, e) {
function c(a) {
d._logger.error("Error occurred in beforeSend callback, continuing anyway\u2026");
d._logger.error(a);
}
var d = this;
void 0 === b && (b = {});
void 0 === e && (e = function() {
});
if (!this._configured) {
throw Error("client not configured");
}
var g = Ja(this), h = lb(a, b, this._logger);
a = h.err;
var n = h.errorFramesToSkip;
(h = h._opts) && (b = h);
if ("object" !== typeof b || null === b) {
b = {};
}
var l = w.ensureReport(a, n, 2);
l.app = t({}, {releaseStage:g}, l.app, this.app);
l.context = l.context || b.context || this.context || void 0;
l.device = t({}, l.device, this.device, b.device);
l.request = t({}, l.request, this.request, b.request);
l.user = t({}, l.user, this.user, b.user);
l.metaData = t({}, l.metaData, this.metaData, b.metaData);
l.breadcrumbs = this.breadcrumbs.slice(0);
this._session && (this._session.trackError(l), l.session = this._session);
void 0 !== b.severity && (l.severity = b.severity, l._handledState.severityReason = {type:"userSpecifiedSeverity"});
if (J(this.config.notifyReleaseStages) && !O(this.config.notifyReleaseStages, g)) {
return this._logger.warn("Report not sent due to releaseStage/notifyReleaseStages configuration"), e(null, l);
}
var p = l.severity;
b = [].concat(b.beforeSend).concat(this.config.beforeSend);
nb(b, mb(l, c), function(a, b) {
a && c(a);
if (b) {
return d._logger.debug("Report not sent due to beforeSend callback"), e(null, l);
}
d.config.autoBreadcrumbs && d.leaveBreadcrumb(l.errorClass, {errorClass:l.errorClass, errorMessage:l.errorMessage, severity:l.severity}, "error");
p !== l.severity && (l._handledState.severityReason = {type:"userCallbackSetSeverity"});
d._delivery.sendReport({apiKey:l.apiKey || d.config.apiKey, notifier:d.notifier, events:[l]}, function(a) {
return e(a, l);
});
});
};
return a;
}(), qb = 20, ia = 25000, ha = 8, ja = "...", A = {}, Wa = "events.[].app events.[].metaData events.[].user events.[].breadcrumbs events.[].request events.[].device".split(" "), tb = ["device", "app", "user"];
A.report = function(a, b) {
var c = Y(a, null, null, {filterPaths:Wa, filterKeys:b});
if (10e5 < c.length && (delete a.events[0].metaData, a.events[0].metaData = {notifier:"WARNING!\nSerialized payload was " + c.length / 10e5 + "MB (limit = 1MB)\nmetaData was removed"}, c = Y(a, null, null, {filterPaths:Wa, filterKeys:b}), 10e5 < c.length)) {
throw Error("payload exceeded 1MB limit");
}
return c;
};
A.session = function(a, b) {
a = Y(a, null, null, {filterPaths:tb, filterKeys:b});
if (10e5 < a.length) {
throw Error("payload exceeded 1MB limit");
}
return a;
};
var va = {}, ub = this;
va = function(a, b) {
void 0 === b && (b = window);
return {sendReport:function(c, d) {
void 0 === d && (d = function() {
});
var e = Ia(a.config, "notify", "4", b), f = new b.XDomainRequest;
f.onload = function() {
d(null);
};
f.open("POST", e);
setTimeout(function() {
try {
f.send(A.report(c, a.config.filters));
} catch (m) {
a._logger.error(m), d(m);
}
}, 0);
}, sendSession:function(c, d) {
void 0 === d && (d = function() {
});
var e = Ia(a.config, "sessions", "1", b), f = new b.XDomainRequest;
f.onload = function() {
d(null);
};
f.open("POST", e);
setTimeout(function() {
try {
f.send(A.session(c, a.config.filters));
} catch (m) {
ub._logger.error(m), d(m);
}
}, 0);
}};
};
var ib = va._matchPageProtocol = function(a, b) {
return "http:" === b ? a.replace(/^https:/, "http:") : a;
}, vb = {init:function(a, b) {
void 0 === b && (b = window);
a.config.beforeSend.unshift(function(a) {
a.context || (a.context = b.location.pathname);
});
}}, wb = {init:function(a, b) {
void 0 === b && (b = navigator);
a.device = P({}, {locale:b.browserLanguage || b.systemLanguage || b.userLanguage || b.language, userAgent:b.userAgent}, a.device);
a.config.beforeSend.unshift(function(a) {
a.device = P({}, a.device, {time:z()});
});
}}, xb = {init:function(a, b) {
void 0 === b && (b = window);
a.config.beforeSend.unshift(function(a) {
a.request && a.request.url || (a.request = la({}, a.request, {url:b.location.href}));
});
}}, zb = {init:function(a) {
return a.sessionDelegate(yb);
}}, yb = {startSession:function(a) {
a._session = new a.BugsnagSession;
var b = Ja(a);
if (J(a.config.notifyReleaseStages) && !O(a.config.notifyReleaseStages, b)) {
return a._logger.warn("Session not sent due to releaseStage/notifyReleaseStages configuration"), a;
}
if (!a.config.endpoints.sessions) {
return a._logger.warn("Session not sent due to missing endpoints.sessions configuration"), a;
}
a._delivery.sendSession({notifier:a.notifier, device:a.device, app:ma({}, {releaseStage:b}, a.app), sessions:[{id:a._session.id, startedAt:a._session.startedAt, user:a.user}]});
return a;
}}, Ab = {init:function(a) {
a.config.collectUserIp || a.config.beforeSend.push(function(a) {
a.user && "undefined" === typeof a.user.id && delete a.user.id;
a.user = Q({id:"[NOT COLLECTED]"}, a.user);
a.request = Q({clientIp:"[NOT COLLECTED]"}, a.request);
});
}, configSchema:{collectUserIp:{defaultValue:function() {
return !0;
}, message:"should be true|false", validate:function(a) {
return !0 === a || !1 === a;
}}}}, Cb = {init:function(a) {
var b = /^dev(elopment)?$/.test(a.config.releaseStage);
b = (!1 === a.config.autoBreadcrumbs || b) && !0 !== a.config.consoleBreadcrumbsEnabled;
!1 === a.config.consoleBreadcrumbsEnabled || b || B(Bb, function(b) {
var c = console[b];
console[b] = function() {
for (var d = arguments.length, f = Array(d), g = 0; g < d; g++) {
f[g] = arguments[g];
}
a.leaveBreadcrumb("Console output", p(f, function(a, b, c) {
var d = "[Unknown value]";
try {
d = String(b);
} catch (Ma) {
}
if ("[object Object]" === d) {
try {
d = JSON.stringify(b);
} catch (Ma) {
}
}
a["[" + c + "]"] = d;
return a;
}, {severity:0 === b.indexOf("group") ? "log" : b}), "log");
c.apply(console, f);
};
console[b]._restore = function() {
console[b] = c;
};
});
}, configSchema:{consoleBreadcrumbsEnabled:{defaultValue:function() {
}, validate:function(a) {
return !0 === a || !1 === a || void 0 === a;
}, message:"should be true|false"}}}, Bb = x(["log", "debug", "info", "warn", "error"], function(a) {
return "undefined" !== typeof console && "function" === typeof console[a];
}), Db = {init:function(a, b, c) {
function d(a, b) {
return function() {
var c = Array.prototype.slice.call(arguments), d = b(c), e = d.get();
if ("function" !== typeof e) {
return a.apply(this, c);
}
try {
if (!e.__trace__) {
var f = n();
e.__trace__ = function() {
h = f;
q(function() {
h = null;
}, 0);
var a = e.apply(this, arguments);
h = null;
return a;
};
e.__trace__.__trace__ = e.__trace__;
}
d.replace(e.__trace__);
} catch (Lb) {
}
if (a.apply) {
return a.apply(this, c);
}
switch(c.length) {
case 1:
return a(c[0]);
case 2:
return a(c[0], c[1]);
default:
return a();
}
};
}
void 0 === b && (b = document);
void 0 === c && (c = window);
if (a.config.trackInlineScripts) {
var e = c.location.href, f = "", g = !1;
f = b.documentElement.outerHTML;
var k = b.onreadystatechange;
b.onreadystatechange = function() {
"interactive" === b.readyState && (f = b.documentElement.outerHTML, g = !0);
"function" === typeof k && k.apply(this, arguments);
};
var h = null, n = function() {
var a = b.currentScript || h;
a || g || (a = b.scripts || b.getElementsByTagName("script"), a = a[a.length - 1]);
return a;
}, l = function(a) {
g && f || (f = b.documentElement.outerHTML);
var c = ["\x3c!-- DOC START --\x3e"].concat(f.split("\n")), d = a - 1;
return p(c.slice(Math.max(d - 3, 0), Math.min(d + 3, c.length - 1)), function(b, c, d) {
b[d + a - 3] = 200 >= c.length ? c : c.substr(0, 200);
return b;
}, {});
};
a.config.beforeSend.unshift(function(a) {
a.stacktrace = x(a.stacktrace, function(a) {
return !/__trace__$/.test(a.method);
});
var b = a.stacktrace[0];
if (!b || !b.file || b.file.replace(/#.*$/, "") === e.replace(/#.*$/, "")) {
var c = n();
c && (c = c.innerHTML, a.updateMetaData("script", "content", 500000 >= c.length ? c : c.substr(0, 500000)));
void 0 !== b.lineNumber && (b.code = l(b.lineNumber));
}
});
var q = B(["setTimeout", "setInterval", "setImmediate", "requestAnimationFrame"], function(a) {
return na(c, a, function(a) {
return d(a, function(a) {
return {get:function() {
return a[0];
}, replace:function(b) {
a[0] = b;
}};
});
});
})[0];
B("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".split(" "), function(a) {
c[a] && c[a].prototype && "function" === typeof c[a].prototype.addEventListener && (na(c[a].prototype, "addEventListener", function(a) {
return d(a, Na);
}), na(c[a].prototype, "removeEventListener", function(a) {
return d(a, Na);
}));
});
}
}, configSchema:{trackInlineScripts:{validate:function(a) {
return !0 === a || !1 === a;
}, defaultValue:function() {
return !0;
}, message:"should be true|false"}}}, Eb = {init:function(a, b) {
void 0 === b && (b = window);
if ("addEventListener" in b) {
var c = !1 === a.config.autoBreadcrumbs && !0 !== a.config.interactionBreadcrumbsEnabled;
!1 === a.config.interactionBreadcrumbsEnabled || c || b.addEventListener("click", function(c) {
try {
var d = c.target, f = d.textContent || d.innerText || "";
f || "submit" !== d.type && "button" !== d.type || (f = d.value);
var g = (f = f.replace(/^\s+|\s+$/g, "")) && 140 >= f.length ? f : f.slice(0, 135) + "(...)";
var k = Oa(c.target, b);
} catch (h) {
k = g = "[hidden]", a._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z");
}
a.leaveBreadcrumb("UI click", {targetText:g, targetSelector:k}, "user");
}, !0);
}
}, configSchema:{interactionBreadcrumbsEnabled:{defaultValue:function() {
}, validate:function(a) {
return !0 === a || !1 === a || void 0 === a;
}, message:"should be true|false"}}}, Fb = {init:function(a, b) {
void 0 === b && (b = window);
if ("addEventListener" in b) {
var c = !1 === a.config.autoBreadcrumbs && !0 !== a.config.navigationBreadcrumbsEnabled;
if (!1 !== a.config.navigationBreadcrumbsEnabled && !c) {
var d = function(b) {
return function() {
return a.leaveBreadcrumb(b, {}, "navigation");
};
};
b.addEventListener("pagehide", d("Page hidden"), !0);
b.addEventListener("pageshow", d("Page shown"), !0);
b.addEventListener("load", d("Page loaded"), !0);
b.document.addEventListener("DOMContentLoaded", d("DOMContentLoaded"), !0);
b.addEventListener("load", function() {
return b.addEventListener("popstate", d("Navigated back"), !0);
});
b.addEventListener("hashchange", function(c) {
c = c.oldURL ? {from:M(c.oldURL, b), to:M(c.newURL, b), state:Ga(b)} : {to:M(b.location.href, b)};
a.leaveBreadcrumb("Hash changed", c, "navigation");
}, !0);
b.history.replaceState && Ha(a, b.history, "replaceState", b);
b.history.pushState && Ha(a, b.history, "pushState", b);
a.leaveBreadcrumb("Bugsnag loaded", {}, "navigation");
}
}
}, configSchema:{navigationBreadcrumbsEnabled:{defaultValue:function() {
}, validate:function(a) {
return !0 === a || !1 === a || void 0 === a;
}, message:"should be true|false"}}}, S = {}, Pa = O, r, u, oa;
S.name = "networkBreadcrumbs";
S.init = function(a, b, c) {
void 0 === b && (b = fb);
void 0 === c && (c = window);
var d = !1 === a.config.autoBreadcrumbs && !0 !== a.config.networkBreadcrumbsEnabled;
!1 === a.config.networkBreadcrumbsEnabled || d || (r = a, u = c, oa = b, eb(), Ca());
};
S.configSchema = {networkBreadcrumbsEnabled:{defaultValue:function() {
}, validate:function(a) {
return !0 === a || !1 === a || void 0 === a;
}, message:"should be true|false"}};
var Gb = {init:function(a) {
var b = 0;
a.config.beforeSend.push(function(c) {
if (b >= a.config.maxEvents) {
return c.ignore();
}
b++;
});
a.refresh = function() {
b = 0;
};
}, configSchema:{maxEvents:{defaultValue:function() {
return 10;
}, message:"should be a positive integer \u2264100", validate:function(a) {
return Qa(1, 100)(a);
}}}}, wa = {};
wa = {init:function(a) {
a.config.beforeSend.push(function(a) {
a.stacktrace = B(a.stacktrace, function(a) {
return pa({}, a, {file:Hb(a.file)});
});
});
}};
var Hb = wa._strip = function(a) {
return "string" === typeof a ? a.replace(/\?.*$/, "").replace(/#.*$/, "") : a;
}, Ib = {init:function(a, b) {
void 0 === b && (b = window);
var c = b.onerror;
b.onerror = function(b, e, f, g, k) {
if (0 === f && /Script error\.?/.test(b)) {
a._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");
} else {
var d = {severity:"error", unhandled:!0, severityReason:{type:"unhandledException"}};
k ? k.name && k.message ? d = new a.BugsnagReport(k.name, k.message, H(a.BugsnagReport.getStacktrace(k), e, f, g), d, k) : (d = new a.BugsnagReport("window.onerror", String(k), H(a.BugsnagReport.getStacktrace(k, 1), e, f, g), d, k), d.updateMetaData("window onerror", {error:k})) : "object" !== typeof b || null === b || e && "string" === typeof e || f || g || k ? (d = new a.BugsnagReport("window.onerror", String(b), H(a.BugsnagReport.getStacktrace(k, 1), e, f, g), d, b), d.updateMetaData("window onerror",
{event:b})) : (d = new a.BugsnagReport(b.type ? "Event: " + b.type : "window.onerror", b.message || b.detail || "", a.BugsnagReport.getStacktrace(Error(), 1).slice(1), d, b), d.updateMetaData("window onerror", {event:b, extraParameters:e}));
a.notify(d);
}
"function" === typeof c && c.apply(this, arguments);
};
}}, Jb = {init:function(a, b) {
function c(b) {
var c = b.reason, d = !1;
try {
b.detail && b.detail.reason && (c = b.detail.reason, d = !0);
} catch (m) {
}
b = {severity:"error", unhandled:!0, severityReason:{type:"unhandledPromiseRejection"}};
c && Z(c) ? (b = new a.BugsnagReport(c.name, c.message, ta.parse(c), b, c), d && (b.stacktrace = p(b.stacktrace, g(c), []))) : (b = new a.BugsnagReport(c && c.name ? c.name : "UnhandledRejection", c && c.message ? c.message : 'Rejection reason was not an Error. See "Promise" tab for more detail.', [], b, c), b.updateMetaData("promise", "rejection reason", n(c)));
a.notify(b);
}
void 0 === b && (b = window);
"addEventListener" in b ? b.addEventListener("unhandledrejection", c) : b.onunhandledrejection = function(a, b) {
c({detail:{reason:a, promise:b}});
};
}}, T = {}, Kb = qa({}, v.schema, sb);
T = function(a) {
"string" === typeof a && (a = {apiKey:a});
var b = "";
a.endpoints && a.endpoints.notify && !a.endpoints.sessions && (b += "notify endpoint is set but sessions endpoint is not. No sessions will be sent.");
var c = new Va({name:"Bugsnag JavaScript", version:"6.3.0", url:"https://github.com/bugsnag/bugsnag-js"});
c.setOptions(a);
c.delivery(window.XDomainRequest ? va : hb);
c.configure(Kb);
b && c._logger.warn(b);
c.use(wb);
c.use(vb);
c.use(xb);
c.use(Gb);
c.use(zb);
c.use(Ab);
c.use(wa);
!1 !== c.config.autoNotify && (c.use(Ib), c.use(Jb));
c.use(Fb);
c.use(Eb);
c.use(S);
c.use(Cb);
c.use(Db);
c._logger.debug("Loaded!");
return c.config.autoCaptureSessions ? c.startSession() : c;
};
T.Bugsnag = {Client:Va, Report:w, Session:Ua, Breadcrumb:ra};
return T["default"] = T;
}();
})(X, X.exports);
window.extensionUtil = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment