Skip to content

Instantly share code, notes, and snippets.

@nelix
Forked from rokob/gist:755d26de4dabdae66dab
Created September 21, 2017 20:25
Show Gist options
  • Save nelix/831961eb077924d8b7e9fbeee575b030 to your computer and use it in GitHub Desktop.
Save nelix/831961eb077924d8b7e9fbeee575b030 to your computer and use it in GitHub Desktop.
fullstory code
(function() {
var M = this && this.__extends || function() {
var a = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(a, h) {
a.__proto__ = h
}
|| function(a, h) {
for (var f in h)
h.hasOwnProperty(f) && (a[f] = h[f])
}
;
return function(k, h) {
function f() {
this.constructor = k
}
a(k, h);
k.prototype = null === h ? Object.create(h) : (f.prototype = h.prototype,
new f)
}
}(), N = this && this.__awaiter || function(a, k, h, f) {
return new (h || (h = U))(function(d, b) {
function c(a) {
try {
g(f.next(a))
} catch (c) {
b(c)
}
}
function e(a) {
try {
g(f["throw"](a))
} catch (c) {
b(c)
}
}
function g(a) {
a.done ? d(a.value) : (new h(function(b) {
b(a.value)
}
)).then(c, e)
}
g((f = f.apply(a, k || [])).next())
}
)
}
, O = this && this.__generator || function(a, k) {
function h(a) {
return function(b) {
return f([a, b])
}
}
function f(g) {
if (b)
throw new TypeError("Generator is already executing.");
for (; d; )
try {
if (b = 1,
c && (e = c[g[0] & 2 ? "return" : g[0] ? "throw" : "next"]) && !(e = e.call(c, g[1])).done)
return e;
if (c = 0,
e)
g = [0, e.value];
switch (g[0]) {
case 0:
case 1:
e = g;
break;
case 4:
return d.label++,
{
value: g[1],
done: !1
};
case 5:
d.label++;
c = g[1];
g = [0];
continue;
case 7:
g = d.ops.pop();
d.trys.pop();
continue;
default:
if (!(e = d.trys,
e = 0 < e.length && e[e.length - 1]) && (6 === g[0] || 2 === g[0])) {
d = 0;
continue
}
if (3 === g[0] && (!e || g[1] > e[0] && g[1] < e[3])) {
d.label = g[1];
break
}
if (6 === g[0] && d.label < e[1]) {
d.label = e[1];
e = g;
break
}
if (e && d.label < e[2]) {
d.label = e[2];
d.ops.push(g);
break
}
e[2] && d.ops.pop();
d.trys.pop();
continue
}
g = k.call(a, d)
} catch (f) {
g = [6, f],
c = 0
} finally {
b = e = 0
}
if (g[0] & 5)
throw g[1];
return {
value: g[0] ? g[1] : void 0,
done: !0
}
}
var d = {
label: 0,
sent: function() {
if (e[0] & 1)
throw e[1];
return e[1]
},
trys: [],
ops: []
}, b, c, e, g;
return g = {
next: h(0),
"throw": h(1),
"return": h(2)
},
"function" === typeof Symbol && (g[Symbol.iterator] = function() {
return this
}
),
g
}
, m;
(function(a) {
var k;
a.Namespace = function(a) {
if (!k) {
var f = a._fs_loaded;
k = f ? f : a._fs_namespace ? a._fs_namespace : "FS"
}
return k
}
;
a.isLoaded = function(a) {
return a._fs_loaded
}
;
a.setLoaded = function(a, f) {
a._fs_loaded = f;
f in a || (a[f] = {})
}
}
)(m || (m = {}));
(function(a) {
a._fs_debug = function(a) {
return !!a._fs_ext_debug || !!a._fs_debug
}
;
a._fs_host = function(a) {
return a._fs_ext_host || a._fs_host
}
;
a._fs_org = function(a) {
return a._fs_ext_org || a._fs_org
}
;
a._fs_csp = function(a) {
return a._fs_csp
}
;
a._fs_cookie_domain = function(a) {
return a._fs_cookie_domain
}
;
a._fs_ready = function(a) {
return a._fs_ready
}
;
a._fs_run_in_iframe = function(a) {
return !!a._fs_run_in_iframe
}
;
a._fs_is_outer_script = function(a) {
return !!a._fs_is_outer_script
}
;
a._fs_replay_flags = function(a) {
return a._fs_replay_flags
}
;
a._fs_transport = function(a) {
return a._fs_transport
}
;
a.set_fs_shutdown = function(a, h) {
a._fs_shutdown = h
}
;
a.FS_q_drain = function(k) {
if ((k = k[a.Namespace(k)]) && "q"in k) {
var h = k.q;
delete k.q;
return h
}
return []
}
;
a.FS_q_push = function(k, h) {
var f = k[a.Namespace(k)];
"q"in f || (f.q = []);
f.q.push(h)
}
}
)(m || (m = {}));
(function(a) {
a.CompiledTimestamp = 1506009838;
a.CompiledVersion = "UNSET"
}
)(m || (m = {}));
(function(a) {
function k() {
var c, e;
try {
throw Error("");
} catch (l) {
c = "<generated>\n",
e = l.stack || l.backtrace || l.stacktrace
}
if (!e) {
c = "<generated-ie>\n";
e = [];
try {
for (var h = arguments.callee.caller.caller; h && e.length < f; ) {
var p = b.test(h.toString()) ? RegExp.$1 || d : d;
e.push(p);
h = h.caller
}
} catch (k) {
a.logIfDebug(k)
}
e = e.join("\n")
}
return c + e
}
function h(b, e) {
if (!(0 >= c)) {
c--;
var d = a.getCookies(document).fs_uid;
(d = d ? a.parseIdentityCookie(d) : void 0) && d.OrgId != a._fs_org(window) && (d = void 0);
var f = window.location.origin, h = (new Date).getTime(), q;
try {
q = window.self !== window.top
} catch (t) {
q = !0
}
q = {
projectRoot: f,
"metaData[device][time]": h,
"metaData[misc][inIframe]": q,
"metaData[misc][CompiledTimestamp]": a.CompiledTimestamp,
"metaData[misc][CompiledTime]": (new Date(1E3 * a.CompiledTimestamp)).toISOString(),
"metaData[misc][orgId]": a._fs_org(window),
"metaData[misc][userId:sessionId]": d ? d.UserId + ":" + d.SessionId : "NA",
context: document.location.pathname,
message: b.message,
name: "Recording Error",
payloadVersion: 3,
releaseStage: "production " + (new Date(1E3 * a.CompiledTimestamp)).toISOString(),
severity: e,
notfierVersion: "3.2.0",
language: navigator.language || navigator.userLanguage || "en-GB",
stacktrace: b.stack || (b.backtrace || b.stacktrace) || k(),
apiKey: "38f089fdedbe27e3ca594fb18cdbc78e",
ct: "img",
cb: (new Date).getTime()
};
var d = [], s;
for (s in q)
d.push(encodeURIComponent(s) + "=" + encodeURIComponent(q[s]));
(new Image).src = "https://notify.bugsnag.com/js?" + d.sort().join("&")
}
}
var f = 10
, d = "[anonymous]"
, b = /function\s*([\w\-$]+)?\s*\(/i;
a.generateStacktrace = k;
var c = 15;
a.sendToBugsnag = h;
var e = {};
a.assert = function(a, b, c) {
void 0 === c && (c = 1);
if (a)
return !0;
e[b] = e[b] || 0;
e[b]++;
if (e[b] > c)
return !1;
h(Error("Assertion failed: " + b), "error");
return a
}
}
)(m || (m = {}));
(function(a) {
function k() {
var a = 0
, b = new P(d)
, c = document.createTextNode("");
b.observe(c, {
characterData: !0
});
return function() {
var b = a = ++a % 2;
c.data = b + ""
}
}
function h() {
var a = new MessageChannel;
a.port1.onmessage = d;
return function() {
return a.port2.postMessage(0)
}
}
function f() {
var a = setTimeout;
return function() {
return a(d, 1)
}
}
function d() {
for (var a = 0; a < B; a += 2)
(0,
E[a])(E[a + 1]),
E[a] = void 0,
E[a + 1] = void 0;
B = 0
}
function b(a, b) {
var c = arguments
, d = this
, g = new this.constructor(e);
void 0 === g[Q] && z(g);
var f = d._state;
f ? function() {
var a = c[f - 1];
C(function() {
return D(f, g, a, d._result)
})
}() : r(d, g, a, b);
return g
}
function c(a) {
if (a && "object" === typeof a && a.constructor === this)
return a;
var b = new this(e);
q(b, a);
return b
}
function e() {}
function g(a) {
try {
return a.then
} catch (b) {
return J.error = b,
J
}
}
function n(a, b, c, e, d) {
try {
a.call(b, c, e)
} catch (g) {
return g
}
}
function l(a, b, c) {
C(function(a) {
var e = !1
, d = n(c, b, function(c) {
e || (e = !0,
b !== c ? q(a, c) : s(a, c))
}, function(b) {
e || (e = !0,
u(a, b))
}, "Settle: " + (a._label || " unknown promise"));
!e && d && (e = !0,
u(a, d))
}, a)
}
function y(a, b) {
b._state === K ? s(a, b._result) : b._state === F ? u(a, b._result) : r(b, void 0, function(b) {
return q(a, b)
}, function(b) {
return u(a, b)
})
}
function p(a, e, d) {
e.constructor === a.constructor && d === b && e.constructor.resolve === c ? y(a, e) : d === J ? (u(a, J.error),
J.error = null) : void 0 === d ? s(a, e) : "function" === typeof d ? l(a, e, d) : s(a, e)
}
function q(a, b) {
a === b ? u(a, new TypeError("You cannot resolve a promise with itself")) : "function" === typeof b || "object" === typeof b && null !== b ? p(a, b, g(b)) : s(a, b)
}
function t(a) {
a._onerror && a._onerror(a._result);
w(a)
}
function s(a, b) {
a._state === G && (a._result = b,
a._state = K,
0 !== a._subscribers.length && C(w, a))
}
function u(a, b) {
a._state === G && (a._state = F,
a._result = b,
C(t, a))
}
function r(a, b, c, e) {
var d = a._subscribers
, g = d.length;
a._onerror = null;
d[g] = b;
d[g + K] = c;
d[g + F] = e;
0 === g && a._state && C(w, a)
}
function w(a) {
var b = a._subscribers
, c = a._state;
if (0 !== b.length) {
for (var e, d, g = a._result, f = 0; f < b.length; f += 3)
e = b[f],
d = b[f + c],
e ? D(c, e, d, g) : d(g);
a._subscribers.length = 0
}
}
function x() {
this.error = null
}
function D(a, b, c, e) {
var d = "function" === typeof c, g, f, n, l;
if (d) {
try {
g = c(e)
} catch (h) {
R.error = h,
g = R
}
g === R ? (l = !0,
f = g.error,
g.error = null) : n = !0;
if (b === g) {
u(b, new TypeError("A promises callback cannot return that same promise."));
return
}
} else
g = e,
n = !0;
b._state === G && (d && n ? q(b, g) : l ? u(b, f) : a === K ? s(b, g) : a === F && u(b, g))
}
function H(a, b) {
try {
b(function(b) {
q(a, b)
}, function(b) {
u(a, b)
})
} catch (c) {
u(a, c)
}
}
function z(a) {
a[Q] = S++;
a._state = void 0;
a._result = void 0;
a._subscribers = []
}
function v(a, b) {
this._instanceConstructor = a;
this.promise = new a(e);
this.promise[Q] || z(this.promise);
L(b) ? (this._input = b,
this._remaining = this.length = b.length,
this._result = Array(this.length),
0 === this.length ? s(this.promise, this._result) : (this.length = this.length || 0,
this._enumerate(),
0 === this._remaining && s(this.promise, this._result))) : u(this.promise, Error("Array Methods must be provided an Array"))
}
var m = void 0, L = m = Array.isArray ? Array.isArray : function(a) {
return "[object Array]" === Object.prototype.toString.call(a)
}
, B = 0, C = function(a, b) {
E[B] = a;
E[B + 1] = b;
B += 2;
2 === B && T()
}, P = window.MutationObserver || window.WebKitMutationObserver, m = "undefined" !== typeof Uint8ClampedArray && void 0 != typeof self && "undefined" !== typeof self.importScripts && "undefined" !== typeof MessageChannel, E = Array(1E3), T;
T = P ? k() : m ? h() : f();
var Q = Math.random().toString(36).substring(16)
, G = void 0
, K = 1
, F = 2
, J = new x
, R = new x
, S = 0;
v.prototype._enumerate = function() {
for (var a = this.length, b = this._input, c = 0; this._state === G && c < a; c++)
this._eachEntry(b[c], c)
}
;
v.prototype._eachEntry = function(a, d) {
var f = this._instanceConstructor
, s = f.resolve;
s === c ? (s = g(a),
s === b && a._state !== G ? this._settledAt(a._state, d, a._result) : "function" !== typeof s ? (this._remaining--,
this._result[d] = a) : f === A ? (f = new f(e),
p(f, a, s),
this._willSettleAt(f, d)) : this._willSettleAt(new f(function(b) {
return b(a)
}
), d)) : this._willSettleAt(s(a), d)
}
;
v.prototype._settledAt = function(a, b, c) {
var e = this.promise;
e._state === G && (this._remaining--,
a === F ? u(e, c) : this._result[b] = c);
0 === this._remaining && s(e, this._result)
}
;
v.prototype._willSettleAt = function(a, b) {
var c = this;
r(a, void 0, function(a) {
return c._settledAt(K, b, a)
}, function(a) {
return c._settledAt(F, b, a)
})
}
;
var A = function(a) {
this[Q] = S++;
this._result = this._state = void 0;
this._subscribers = [];
if (e !== a) {
if ("function" !== typeof a)
throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
if (this instanceof A)
H(this, a);
else
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
}
};
A.all = function(a) {
return (new v(this,a)).promise
}
;
A.race = function(a) {
var b = this;
return L(a) ? new b(function(c, e) {
for (var d = a.length, g = 0; g < d; g++)
b.resolve(a[g]).then(c, e)
}
) : new b(function(a, b) {
return b(new TypeError("You must pass an array to race."))
}
)
}
;
A.resolve = c;
A.reject = function(a) {
var b = new this(e);
u(b, a);
return b
}
;
A._setAsap = function(a) {
C = a
}
;
A._asap = C;
A.prototype = {
constructor: A,
then: b,
"catch": function(a) {
return this.then(null, a)
}
};
a.Promise = window.Promise || A
}
)(m || (m = {}));
var U = m.Promise;
(function(a) {
a.windex = window;
var k;
a.initWindex = function(h) {
if (h.document && h.document.head) {
if (k)
try {
a.windex.JSON.stringify(0);
return
} catch (f) {}
var d = h.document.head
, b = h.document.createElement("iframe");
b.id = "FullStory-iframe";
b.className = "fs-hide";
b.setAttribute("style", "display: none;");
d.appendChild(b);
b.src = "about:blank";
k = b;
a.windex = k.contentWindow;
h.document.head.removeChild(k);
try {
a.windex.JSON.stringify(0)
} catch (c) {
a.windex = h
}
}
}
}
)(m || (m = {}));
(function(a) {
function k(b) {
return a.windex.Object.values.call(a.windex.Object, b || {})
}
function h(a) {
var b = [], c;
for (c in a)
a.hasOwnProperty(c) && b.push(a[c]);
return b
}
function f(a) {
g && window.console && console.log(a)
}
function d(b, c) {
var e = 0;
try {
a.windex.JSON.stringify(b, function(a, b) {
if (e++ > c)
throw "break";
return "object" != typeof b ? void 0 : b
})
} catch (d) {
if ("break" != d)
return !0
}
return !1
}
function b(e, d, g, f) {
if (1 > d)
return 0;
var n;
e && e.constructor == Date ? n = isNaN(e) ? "Invalid Date" : e.toUTCString() : (n = "object" === typeof Node ? e instanceof Node : e && "object" === typeof e && 0 < e.nodeType && "string" === typeof e.nodeName,
n = n ? c(e) : void 0 === e ? "undefined" : "object" != typeof e || null == e ? e : e instanceof Error ? e.stack || e.name + ": " + e.message : void 0);
if (void 0 !== n) {
n = a.windex.JSON.stringify(n);
if (void 0 === n)
return 0;
'"' == n[0] && (n = y(n, d, '..."'));
return n.length <= d ? (f.tokens.push(n),
n.length) : 0
}
if (f.catchCycles) {
f.opath.splice(g);
n = f.opath.lastIndexOf(e);
if (-1 < n)
return e = '"' + y("<Cycle to ancestor #" + (g - n - 1) + ">", d - 2) + '"',
f.tokens.push(e),
e.length;
f.opath.push(e)
}
var l = d
, h = function(a) {
return l >= a.length ? (l -= a.length,
f.tokens.push(a),
!0) : !1
};
n = function(a) {
"," == f.tokens[f.tokens.length - 1] ? f.tokens[f.tokens.length - 1] = a : h(a)
}
;
if (2 > l)
return 0;
if (a.isArray(e)) {
h("[");
for (var p = 0; p < e.length && 0 < l; p++) {
var t = b(e[p], l - 1, g + 1, f)
, l = l - t;
if (0 == t && !h("null"))
break;
h(",")
}
n("]")
} else {
h("{");
for (var k = Object.keys(e), p = 0; p < k.length && 0 < l; p++) {
var t = k[p]
, q = e[t];
if (!h('"' + t + '":'))
break;
t = b(q, l - 1, g + 1, f);
if (0 == t) {
f.tokens.pop();
break
}
l -= t;
h(",")
}
n("}")
}
return Infinity == d ? 1 : d - l
}
function c(a) {
if (a.tagName) {
var b = e(a);
return "<" + b + (a.attributes && a.attributes.type ? ' type="' + a.attributes.type.value + '"' : "") + (a.id ? ' id="' + a.id + '"' : "") + (a.className ? ' class="' + a.className + '"' : "") + ">...</" + b + ">"
}
b = "";
a.data && a.data.substring && (b = " " + a.data.substring(0, 50) + (50 < a.data.length ? "..." : ""));
return a.nodeName + b
}
function e(a) {
return "object" == typeof a.tagName ? "form" : a.tagName.toLowerCase()
}
var g = !1;
a.BAD_APP_IDS = " 0 1 -1 n/a nan undefined null nil the_id_that_you_use_in_your_app_for_this_user".split(" ");
a._native_bind = function(a, b) {
for (var c = [], e = 2; e < arguments.length; e++)
c[e - 2] = arguments[e];
return a.bind.apply(a, [b].concat(c))
}
;
a._js_bind = function(a, b) {
for (var c = [], e = 2; e < arguments.length; e++)
c[e - 2] = arguments[e];
return function() {
var e = Array.prototype.slice.call(arguments);
a.call.apply(a, [b].concat(c, e))
}
}
;
a.bind = Function.prototype.bind ? a._native_bind : a._js_bind;
a._native_map = function(a, b, c) {
return a.map(b, c)
}
;
a._js_map = function(a, b, c) {
for (var e = Array(a.length), d = 0; d < a.length; d++)
e[d] = b.call(c, a[d], d, a);
return e
}
;
a.map = Array.prototype.map ? a._native_map : a._js_map;
a._native_trim = function(a) {
return a.trim()
}
;
a._js_trim = function(a) {
return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
}
;
a.trim = String.prototype.trim ? a._native_trim : a._js_trim;
a._native_filter = function(a, b, c) {
return a.filter(b, c)
}
;
a._js_filter = function(a, b, c) {
for (var e = Array(a.length), d = 0; d < a.length; d++)
e[d] = b.call(c, a[d], d, a);
return e
}
;
a.filter = Array.prototype.filter ? a._native_filter : a._js_filter;
var n = function(b) {
return a.windex.Array.isArray(b)
}
, l = function(b) {
return "[object Array]" == a.windex.Object.prototype.toString.call(b)
};
a.isArray = a.windex.Array.isArray ? n : l;
a.prefix = function(a, b) {
return 0 == a.lastIndexOf(b, 0)
}
;
a.forIn = function(b, c) {
for (var e in b)
a.windex.Object.hasOwnProperty.call(b, e) && c(b[e], e, b)
}
;
a.firstKey = function(a) {
for (var b in a)
if (Object.prototype.hasOwnProperty.call(a, b))
return b
}
;
a.firstValue = function(a) {
for (var b in a)
if (Object.prototype.hasOwnProperty.call(a, b))
return a[b]
}
;
a.hasNKeys = function(a, b) {
var c = 0, e;
for (e in a)
if (Object.prototype.hasOwnProperty.call(a, e) && ++c > b)
return !1;
return c == b
}
;
a.hasMoreThanNKeys = function(a, b) {
var c = 0, e;
for (e in a)
if (Object.prototype.hasOwnProperty.call(a, e) && ++c > b)
return !0;
return !1
}
;
a._native_values = k;
a._js_values = h;
a.values = a.windex.Object.values ? k : h;
a.$entry = function(a, b) {
var c = function() {
try {
return a.apply(b || this, arguments)
} catch (c) {}
};
return window.Zone && window.Zone.root && "function" == typeof window.Zone.root.wrap ? window.Zone.root.wrap(c) : c
}
;
a.initDebug = function(b) {
g = a._fs_debug(b)
}
;
a.isDebug = function() {
return g
}
;
a.logIfDebug = f;
a.stringify = function(a, c, e) {
void 0 === c && (c = Infinity);
void 0 === e && (e = !0);
try {
var g = {
tokens: [],
opath: [],
catchCycles: e && d(a, c / 4)
};
b(a, c, 0, g);
return g.tokens.join("")
} catch (f) {
a = "Internal error: unable to determine what JSON error was";
try {
a = "" + f,
a = a.replace(/[^a-zA-Z0-9\.\:\!\, ]/g, "_")
} catch (n) {}
return '"' + a + '"'
}
}
;
var y = function(a, b, c) {
void 0 === c && (c = "...");
return a.length <= b ? a : a.length <= c.length || b <= c.length ? a.substring(0, b) : a.substring(0, b - c.length) + c
};
a.baseUri = function(a) {
return "string" == typeof a.baseURI ? a.baseURI : (a = a.getElementsByTagName("base")[0]) && a.href ? a.href : location.href
}
;
a.doctypeString = function(a) {
a = a.doctype;
if (!a)
return "";
var b;
b = "<!DOCTYPE " + a.name;
a.publicId && (b += ' PUBLIC "' + a.publicId + '"');
a.systemId && (b += ' "' + a.systemId + '"');
return b + ">"
}
;
a.parseJson = function(b) {
return a.windex.JSON.parse(b)
}
;
a.domainFromHost = function(a) {
var b = a.indexOf(":");
0 <= b && (a = a.slice(0, b));
return a
}
;
a.isLocalhost = function(a) {
return "localhost" == a || "127.0.0.1" == a
}
;
a.tryGetScreenDims = function(a) {
var b = 0
, c = 0;
if (null == a.screen)
return [b, c];
b = parseInt(String(a.screen.width));
c = parseInt(String(a.screen.height));
b = isNaN(b) ? 0 : b;
c = isNaN(c) ? 0 : c;
return [b, c]
}
;
n = function() {
function a() {
this._listeners = [];
this._yesCapture = !0;
this._noCapture = !1;
try {
var b = Object.defineProperty({}, "passive", {
get: function() {
this._yesCapture = {
capture: !0,
passive: !0
};
this._noCapture = {
capture: !1,
passive: !0
}
}
});
window.addEventListener("test", function() {}, b)
} catch (c) {}
}
a.prototype.add = function(a, b, c, e) {
c = {
target: a,
type: b,
fn: function(a) {
try {
e(a)
} catch (b) {
f("Error in event listener: " + b)
}
},
options: c ? this._yesCapture : this._noCapture,
index: this._listeners.length
};
this._listeners.push(c);
a.addEventListener(b, c.fn, c.options);
return c
}
;
a.prototype.remove = function(a) {
a.target && (a.target.removeEventListener(a.type, a.fn, a.options),
a.target = null,
a.fn = void 0)
}
;
a.prototype.clear = function() {
for (var a = 0; a < this._listeners.length; a++)
this._listeners[a].target && this.remove(this._listeners[a]);
this._listeners = []
}
;
return a
}();
a.DomListeners = n;
var p = function() {
function a(b, c) {
this.target = b;
this.propertyName = c;
this.attached = this.on = !1;
this.native = b[c]
}
a.prototype.before = function(a) {
this._before = a;
return this
}
;
a.prototype.afterAsync = function(a) {
this._afterAsync = a;
return this
}
;
a.prototype.afterSync = function(a) {
this._afterSync = a;
return this
}
;
a.prototype.disable = function() {
this.on = !1;
this.target[this.propertyName] == this.shim && (this.target[this.propertyName] = this.native,
this.attached = !1)
}
;
a.prototype.enable = function() {
this.on = !0;
this.attached || (this.shim || (this.shim = this.makeShim()),
this.target[this.propertyName] = this.shim,
this.attached = !0)
}
;
a.prototype.makeShim = function() {
var a = this;
return function() {
var b = {
that: this,
args: arguments
};
if (a.on)
try {
a._before && a._before.call(this, b)
} catch (c) {
f("Error in hook before " + a.propertyName)
}
var e = a.native.apply(this, arguments);
if (a.on)
try {
if (a._afterSync && a._afterSync.call(this, b),
a._afterAsync) {
var d = this;
setTimeout(function() {
try {
a._afterAsync.call(d, b)
} catch (c) {
f("Error in async hook after " + a.propertyName)
}
})
}
} catch (g) {
f("Error in hook after " + a.propertyName)
}
return e
}
}
;
return a
}(), q = {}, t;
a.activateHook = function(a, b) {
if ("function" != typeof a[b])
return f("Error: Can't hook non-function: " + b),
t || (t = new p({
a: function() {}
},"a"));
q[b] = q[b] || [];
for (var c, e = 0; e < q[b].length; e++)
q[b][e].obj == a && (c = q[b][e].hook);
c || (c = new p(a,b),
q[b].push({
obj: a,
hook: c
}));
c.enable();
return c
}
;
a.tagName = e;
a.parseIdentityCookie = function(b) {
var c = ""
, e = ""
, d = ""
, g = ""
, n = "";
if (b) {
var l = b.split("`");
3 > l.length ? c = b : (d = l[0],
g = l[1],
c = l[2],
5 <= l.length && (n = decodeURIComponent(l[3]),
0 <= a.BAD_APP_IDS.indexOf(n) && (f('ignoring invalid app key "' + n + '" from cookie.'),
n = "")))
}
b = c.indexOf(":");
-1 != b && (e = c.slice(b + 1),
c = c.slice(0, b));
return {
Host: d,
OrgId: g,
UserId: c,
SessionId: e,
AppKey: n
}
}
;
a.getCookies = function(a) {
var b = {};
a = a.cookie.split(";");
for (var c = 0; c < a.length; c++) {
var e = a[c].replace(/^\s+|\s+$/g, "").split("=");
b[e[0]] || (b[e[0]] = e[1])
}
return b
}
;
a.wait = function(b) {
return new a.Promise(function(a) {
setTimeout(function() {
return a()
}, b)
}
)
}
}
)(m || (m = {}));
(function(a) {
a.EVENT_MUT_INSERT = 2;
a.EVENT_MUT_REMOVE = 3;
a.EVENT_MUT_ATTR = 4;
a.EVENT_MUT_ATTR_CURVE = 5;
a.EVENT_MUT_TEXT = 6;
a.EVENT_MUT_SKIPIDS = 7;
a.EVENT_MOUSEMOVE = 8;
a.EVENT_MOUSEMOVE_CURVE = 9;
a.EVENT_SCROLL = 10;
a.EVENT_SCROLL_CURVE = 11;
a.EVENT_MOUSEDOWN = 12;
a.EVENT_MOUSEUP = 13;
a.EVENT_KEYDOWN = 14;
a.EVENT_KEYUP = 15;
a.EVENT_CLICK = 16;
a.EVENT_FOCUS = 17;
a.EVENT_VALUECHANGE = 18;
a.EVENT_RESIZE = 19;
a.EVENT_DOMLOADED = 20;
a.EVENT_LOAD = 21;
a.EVENT_PLACEHOLDER_SIZE = 22;
a.EVENT_UNLOAD = 23;
a.EVENT_BLUR = 24;
a.EVENT_SET_FRAME_BASE = 25;
a.EVENT_TOUCHSTART = 32;
a.EVENT_TOUCHEND = 33;
a.EVENT_TOUCHCANCEL = 34;
a.EVENT_TOUCHMOVE = 35;
a.EVENT_TOUCHMOVE_CURVE = 36;
a.EVENT_NAVIGATE = 37;
a.EVENT_PLAY = 38;
a.EVENT_PAUSE = 39;
a.EVENT_INNERWIDTH = 40;
a.EVENT_INNERWIDTH_CURVE = 41;
a.EVENT_LOG = 48;
a.EVENT_ERROR = 49;
a.EVENT_DBL_CLICK = 50;
a.EVENT_FORM_SUBMIT = 51;
a.EVENT_WINDOW_FOCUS = 52;
a.EVENT_WINDOW_BLUR = 53;
a.EVENT_HEARTBEAT = 54;
a.EVENT_WATCHED_ELEM = 56;
a.PerfEntryTiming = 0;
a.PerfEntryNavigation = 1;
a.PerfEntryResource = 2;
a.PerfEntryPaint = 3;
a.PerfEntryMark = 4;
a.PerfEntryMeasure = 5;
a.PerfEntryMemory = 6;
a.EVENT_PERF_ENTRY = 57;
a.RecFeaturePerformance = 0;
a.RecFeaturePerformanceEntries = 1;
a.RecFeaturePerformanceMemory = 2;
a.EVENT_REC_FEAT_SUPPORTED = 58;
a.EVENT_SELECT = 59;
a.EVENT_SYS_SETMETA = 8192;
a.EVENT_SYS_SETVAR = 8193;
a.EVENT_SYS_HIGHLIGHT = 8194;
a.EVENT_SYS_RESOURCEHASH = 8195;
a.EVENT_COOKED_LOAD = "load";
a.EVENT_COOKED_UNLOAD = "unload";
a.EVENT_COOKED_NAVIGATE = "navigate";
a.EVENT_COOKED_CLICK = "click";
a.EVENT_COOKED_TAP = "tap";
a.EVENT_COOKED_FOCUS = "focus";
a.EVENT_COOKED_CHANGE = "change";
a.EVENT_COOKED_MOUSE_THRASH = "thrash";
a.EVENT_FORM_ABANDONED = "abandon";
a.EVENT_COOKED_ELEM_SEEN = "seen";
a.isUserActionEvent = function(k) {
switch (k) {
case a.EVENT_MOUSEDOWN:
case a.EVENT_MOUSEMOVE:
case a.EVENT_MOUSEMOVE_CURVE:
case a.EVENT_MOUSEUP:
case a.EVENT_KEYDOWN:
case a.EVENT_KEYUP:
case a.EVENT_TOUCHSTART:
case a.EVENT_TOUCHEND:
case a.EVENT_TOUCHMOVE:
case a.EVENT_TOUCHMOVE_CURVE:
case a.EVENT_TOUCHCANCEL:
case a.EVENT_CLICK:
case a.EVENT_SCROLL:
case a.EVENT_SCROLL_CURVE:
case a.EVENT_NAVIGATE:
return !0
}
return !1
}
;
a.MAX_LOGS_PER_PAGE = 1024
}
)(m || (m = {}));
(function(a) {
a.HighlightTypeFsId = "fsidentity";
a.HighlightTypeNewUid = "newuid";
a.UID_COOKIE = "fs_uid";
var k = function() {
function h(a) {
void 0 === a && (a = document);
this._doc = a;
this._cookies = {}
}
h.prototype.initFromCookies = function(f, d) {
this._cookies = a.getCookies(this._doc);
this._cookie = a.parseIdentityCookie(this._cookies[a.UID_COOKIE]);
if (this._cookie.Host.replace(/^www\./, "") != f.replace(/^www\./, "") || this._cookie.OrgId != d)
this._cookie = {
Host: f,
OrgId: d,
UserId: "",
SessionId: "",
AppKey: ""
}
}
;
h.prototype.initFromParsedCookie = function(a) {
this._cookie = a
}
;
h.prototype.clear = function() {
var a = this.host()
, d = this.orgId();
this._cookie = {
Host: a,
OrgId: d,
UserId: "",
SessionId: "",
AppKey: ""
};
this.write()
}
;
h.prototype.host = function() {
return this._cookie.Host
}
;
h.prototype.orgId = function() {
return this._cookie.OrgId
}
;
h.prototype.userId = function() {
return this._cookie.UserId
}
;
h.prototype.sessionId = function() {
return this._cookie.SessionId
}
;
h.prototype.appKey = function() {
return this._cookie.AppKey
}
;
h.prototype.cookieData = function() {
return this._cookie
}
;
h.prototype.cookies = function() {
return this._cookies
}
;
h.prototype.setCookie = function(a, d) {
var b = a + "=" + d
, b = this._domain ? b + ("; domain=." + encodeURIComponent(this._domain)) : b + "; domain=";
this._doc.cookie = b + "; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/"
}
;
h.prototype.setIds = function(f, d, b, c) {
a.isLocalhost(d) && (d = "");
f = a._fs_cookie_domain(f);
"string" == typeof f && (d = f);
this._domain = d;
this._cookie.UserId = b;
this._cookie.SessionId = c;
this.write()
}
;
h.prototype.clearAppId = function() {
if (!this._cookie.AppKey)
return !1;
this._cookie.AppKey = "";
this.write();
return !0
}
;
h.prototype.setAppId = function(a) {
this._cookie.AppKey = a;
this.write()
}
;
h.prototype.encode = function() {
var a = this._cookie.Host + "`" + this._cookie.OrgId + "`" + this._cookie.UserId + ":" + this._cookie.SessionId;
this._cookie.AppKey && (a += "`" + encodeURIComponent(this._cookie.AppKey) + "`");
return a
}
;
h.prototype.write = function() {
null != this._domain && this.setCookie(a.UID_COOKIE, this.encode())
}
;
return h
}();
a.Identity = k
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(a) {
this._identity = a;
this.AccountSystemVars = {
acctId: "str",
displayName: "str",
website: "str"
};
this.UserSystemVars = {
uid: "str",
displayName: "str",
email: "str"
};
this.VarTypes = {
str: function(a) {
return "string" == typeof a
},
bool: function(a) {
return "boolean" == typeof a
},
"int": function(a) {
return "number" == typeof a && 0 == a - Math.floor(a)
},
real: function(a) {
return "number" == typeof a
},
date: function(a) {
return a ? !isNaN(a.constructor === Date ? a : new Date(a)) : !1
}
}
}
h.prototype.identity = function() {
return this._identity
}
;
h.prototype.transformValidateAppId = function(f, d) {
"number" == typeof f && f === f >> 0 && (a.logIfDebug("Expected appId of type 'string' instead got value: " + f + " of type: " + typeof f),
f = "" + f);
if ("string" != typeof f)
return a.logIfDebug("blocking FS.identify API call; uid value (" + f + ") must be a string"),
[void 0, a.HighlightTypeFsId];
var b = f.trim();
if (0 <= a.BAD_APP_IDS.indexOf(b.toLowerCase()))
return a.logIfDebug("blocking FS.identify API call; uid value (" + f + ") is illegal"),
[void 0, a.HighlightTypeFsId];
var c = void 0;
d._cookie.AppKey && d._cookie.AppKey != b && (a.logIfDebug("user re-identified; existing uid (" + d._cookie.AppKey + ") does not match provided uid (" + b + ")"),
c = a.HighlightTypeNewUid);
return [b, c]
}
;
h.prototype.api = function(f, d) {
var b = !1
, c = [];
switch (f) {
case "account":
c = c.concat(this.setvar_api("acct", this.AccountSystemVars, d));
break;
case "user":
if ("object" != typeof d)
a.logIfDebug("Expected argument of type 'object' instead got type: '" + typeof d + "', value: " + a.stringify(d));
else if ("uid"in d) {
var e = d.uid;
if (!1 === e)
this._identity.clearAppId() && (b = !0),
delete d.uid;
else {
var g = this.transformValidateAppId(e, this._identity)
, e = g[0]
, g = g[1];
if (!e) {
switch (g) {
case a.HighlightTypeFsId:
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: [a.HighlightTypeFsId, d.uid + ""]
});
break;
case void 0:
break;
default:
a.logIfDebug("unexpected failReason returned from setAppId: " + g)
}
return [c, !1]
}
d.uid = e;
this._identity.setAppId(d.uid);
g == a.HighlightTypeNewUid && (b = !0)
}
}
c = c.concat(this.setvar_api("user", this.UserSystemVars, d));
break;
default:
a.logIfDebug('invalid operation "' + f + '"; only "account" and "user" are supported at present')
}
return [c, b]
}
;
h.prototype.setvar_api = function(f, d, b) {
var c = [], e = {}, g;
for (g in b)
if (b.hasOwnProperty(g)) {
var n = b[g];
a.logIfDebug("set-var('" + f + "'): \"" + g + '" = ' + a.stringify(n));
var l = typeof n;
if ("object" !== l || n && n.constructor == Date) {
var h, p;
if (g in d)
h = g,
p = d[g];
else {
p = g.split("_");
if (2 != p.length) {
a.logIfDebug('variables must be of the form "name_type", where "type" is one of [str, bool, int, real, date]');
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: ["varname", f + ":" + g]
});
continue
}
-1 != g.indexOf(" ") ? (h = g.replace(/ /g, ""),
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: ["varname", f + ":" + g]
}),
a.logIfDebug("Warning: variable '" + g + "' has spaces in it, which is disallowed. Converted name to '" + h + "'.")) : h = g;
p = p[1]
}
p in this.VarTypes ? this.VarTypes[p](n) ? ("str" == p && (n = n.trim()),
"date" == p && (n = this.toIsoString(n)),
e[h] = n) : (a.logIfDebug("illegal value " + a.stringify(n) + " for type " + p),
"number" === l ? l = 0 == n - Math.floor(n) ? "integer" : "real" : "object" == l && (null != n && n.constructor == Date) && (l = isNaN(n) ? "invalid date" : "date"),
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: ["vartype", f + ":" + g, l]
})) : (a.logIfDebug('invalid type "' + p + '"'),
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: ["varname", f + ":" + g]
}))
} else
n instanceof Array && (l = "array"),
c.push({
When: 0,
Kind: a.EVENT_SYS_HIGHLIGHT,
Args: ["vartype", f + ":" + g, l + " (unsupported)"]
})
}
c.push({
When: 0,
Kind: a.EVENT_SYS_SETVAR,
Args: [f, a.stringify(e)]
});
return c
}
;
h.prototype.toIsoString = function(a) {
return (a.constructor === Date ? a : new Date(a)).toISOString()
}
;
return h
}();
a.Vars = k
}
)(m || (m = {}));
var I;
(function(a) {
var k = /(?:[^\\](?:\\\\)*)/.source;
a.CSS_URL = RegExp('url\\(\\s*"(.*?' + k + ")\"\\s*\\)|url\\(\\s*'(.*?" + k + ")'\\s*\\)|url\\((.*?" + k + ")\\)", "g");
a.QUOTES = /\"|'/g;
a.HOVER = /\:hover/g;
a.FOCUS = /\:focus/g;
a.MEDIA_QUERY = /(@media.*?{)/g;
a.DOMAIN = /^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/;
a.DOMAIN_PART = /^[a-zA-Z0-9-:]{1,61}$/;
a.IPv4_PART = /^[0-9]{1,3}$/;
a.IPv6_PART = /^[0-9a-f]{0,4}$/;
a.PLAYBACK_URL_PARAMS = /.*\?Base=(.*)&Url=(.*)/;
a.EMAIL = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
a.IMAGE_FILENAME = /\.(jpe?g|png|svg|gif|bmp)$/;
a.ATTR_SELECTOR = /\[.*\]/g;
a.SVG_NS = /svg\:/g
}
)(I || (I = {}));
(function(a) {
var k = function() {
function a(d, b) {
this.parent = d;
this.combinator = b;
this.classes = {};
this.attrs = {};
this.attrMatch = {}
}
a.prototype.cssEscapeIdent = function(a) {
var b = function(a) {
return -1 != "[]:./\\()@#%^&*'\" ".indexOf(a) ? "\\" + a : "\\" + a.charCodeAt(0).toString(16) + " "
};
return "-" == a ? "\\-" : "-" == a[0] ? "-" + a.slice(1).replace(/([^0-9a-zA-Z-_])/g, b) : a.replace(/[^0-9a-zA-Z-_:]/g, b)
}
;
a.prototype.cssEscapeString = function(a) {
return '"' + a.replace(/[\x01-\x1f\"\\]/g, function(a) {
return '"' == a || "\\" == a ? "\\" + a : "\\" + a.charCodeAt(0).toString(16) + " "
}) + '"'
}
;
a.prototype.serialize = function() {
var a = this.combinator ? this.combinator : "";
this.tag && (a += "*" == this.tag ? this.tag : this.cssEscapeIdent(this.tag));
this.id && (a += "#" + this.cssEscapeIdent(this.id));
var b = Object.keys(this.classes);
b.sort();
for (var c = 0; c < b.length; c++)
a += "." + this.cssEscapeIdent(b[c]);
for (var e in this.attrs)
a = "" == this.attrMatch[e] ? a + ("[" + this.cssEscapeIdent(e) + "]") : a + ("[" + this.cssEscapeIdent(e) + this.attrMatch[e] + this.cssEscapeString(this.attrs[e]) + "]");
return a
}
;
return a
}();
a.SelectorRule = k;
var h = function() {
function a(d) {
this.rules = d
}
a.parse = function(d, b, c) {
void 0 === b && (b = null);
d = d.trim();
var e = new k(null,null)
, g = 0
, n = !1
, l = function() {
throw "Invalid selector";
}
, h = function() {
r = d[++g];
if ("\n" == r || null == r)
throw l();
if (r.match(/[0-9a-fA-F]/)) {
var a = "";
do
a += r,
r = d[++g];
while (r && r.match(/[0-9a-fA-F]/));r && r.match(/[\s]/) && g++;
return String.fromCharCode(parseInt(a, 16))
}
g++;
return r
}
, p = function(a) {
for (var b = g, c = "", e; null != (e = d[g]); )
if ("\\" == e)
c += h();
else if (e.match(a ? /[a-zA-Z0-9_:\-]/ : /[a-zA-Z0-9_\-]/) || 128 < e.charCodeAt(0))
c += e,
g++;
else
break;
if (b == g)
throw l();
return c
}
, q = function() {
for (; null != d[g] && d[g].match(/\s/); )
g++
}
, t = function() {
n = !0;
g++;
var a = p().toLowerCase();
try {
var c;
q();
var f = d[g]
, t = "=";
if ("*" == f || "|" == f || "^" == f || "$" == f || "~" == f)
t = f + "=",
g++;
if (b && !b[t])
throw l();
if ("=" != d[g])
throw l();
g++;
q();
c = t
} catch (k) {
if (b && !b["[]"] || "Invalid selector" != k)
throw k;
if ("]" != d[g])
throw l();
g++;
e.attrs[a] = e.attrMatch[a] = "";
return
}
r = d[g];
'"' == r || "'" == r ? (f = r,
g++) : f = "]";
for (t = ""; (r = d[g]) != f; ) {
if (null == r)
throw l();
if ("\\" == r)
t += h();
else {
if ("]" == f && ('"' == r || "'" == r))
throw l();
t += r;
g++
}
}
g++;
"]" != f && "]" == d[g] && g++;
e.attrs[a] = t;
e.attrMatch[a] = c
}
, s = function() {
if (!n)
throw l();
n = !1;
q();
var a = d[g];
">" == a || "+" == a || "~" == a ? (g++,
q()) : a = " ";
e = new k(e,a);
if (b && !b[a])
throw l();
};
if (0 == d.indexOf("//"))
throw l();
for (var u = 0, g = 0; g < d.length; ) {
if (u++ > 2 * d.length)
throw console.log("Likely caught in an infinite loop while parsing " + d),
"Internal error, infinite loop";
var r = d[g];
switch (r) {
case "#":
n = !0;
g++;
e.id = p();
break;
case "*":
if (n)
throw l();
n = !0;
e.tag = "*";
if (b && !b["*"])
throw l();
g++;
break;
case ".":
n = !0;
g++;
e.classes[p()] = !0;
break;
case "[":
t();
break;
case " ":
case ">":
case "+":
case "~":
s();
break;
case ":":
throw l();
default:
if (n)
throw l();
n = !0;
e.tag = p(c).toLowerCase()
}
}
if (!n)
throw l();
return new a(e)
}
;
a.prototype.serialize = function() {
for (var a = null, b = this.rules; b; b = b.parent)
a = a ? b.serialize() + a : b.serialize();
return a
}
;
return a
}();
a.Selector = h
}
)(m || (m = {}));
(function(a) {
function k(a) {
var c = {};
if (!a)
return c;
if (a.classList)
for (var e = 0; e < a.classList.length; ++e)
c[a.classList[e]] = !0;
else if (a.className)
for (a = (a.getAttribute("class") || "").split(" "),
e = 0; e < a.length; ++e)
c[a[e].trim()] = !0;
return c
}
a.WatchKindNYI = "nyi";
a.WatchKindBlocked = "blocked";
a.WatchKindHide = "hide";
a.WatchKindWatch = "watch";
var h = function() {
function b(a, b) {
this._parent = a;
this._rule = b
}
b.prototype.parent = function() {
return this._parent
}
;
b.prototype.matches = function(c, e) {
if (!c || this._rule.tag && a.tagName(c) != this._rule.tag || this._rule.id && c.id != this._rule.id)
return !1;
for (var g in this._rule.classes)
if (!(g in e))
return !1;
for (var d in this._rule.attrs)
if (g = c.getAttribute(d),
null == g || !b.attrPredicates[this._rule.attrMatch[d]](g, this._rule.attrs[d]))
return !1;
return this._parent ? this._parent.matches(c.parentElement, k(c.parentElement)) : !0
}
;
b.attrPredicates = {
"": function(a, b) {
return !0
},
"=": function(a, b) {
return a == b
},
"*=": function(a, b) {
return -1 < a.indexOf(b)
},
"^=": function(a, b) {
return 0 == a.lastIndexOf(b, 0)
},
"$=": function(a, b) {
return a.indexOf(b, a.length - b.length) + b.length == a.length
},
"~=": function(a, b) {
return -1 < a.split(/\s+/).indexOf(b)
},
"|=": function(a, b) {
return -1 < a.split("-").indexOf(b)
}
};
return b
}();
a.WatchRuleElem = h;
var f = function() {
function b(b) {
this.kind = b.Kind;
this.selector = a.Selector.parse(b.Selector, {
">": !0,
"=": !0,
"[]": !0,
"*=": !0,
"^=": !0,
"$=": !0,
"~=": !0,
"|=": !0
});
var e = function(a) {
return new h(a.parent ? e(a.parent) : null,a)
};
this.rules = e(this.selector.rules)
}
b.isComment = function(a) {
return !!a.match(/^\s*\/\//)
}
;
b.prototype.serialize = function() {
return this.selector.serialize()
}
;
return b
}();
a.WatchRule = f;
var d = function() {
function b() {
this._rules = [];
this._predicateRules = [];
this.rawRules = []
}
b.prototype.isWatched = function(a) {
for (var b = 0; b < this._predicateRules.length; ++b)
if (this._predicateRules[b].Selector(a))
return this._predicateRules[b].Kind;
for (var d = k(a), b = 0; b < this._rules.length; ++b)
if (this._rules[b].rules.matches(a, d))
return this._rules[b].kind;
return null
}
;
b.prototype.addRule = function(b) {
try {
return f.isComment(b.Selector) || "" == a.trim(b.Selector) || (this._rules.push(new f(b)),
this.rawRules.push(b)),
!0
} catch (e) {
return a.sendToBugsnag(e, "error"),
!1
}
}
;
b.prototype.addPredicateRule = function(a) {
this._predicateRules.push(a)
}
;
b.prototype.mungeWatchedStyle = function(b, e) {
var d = b.getBoundingClientRect()
, f = Math.floor(d.width)
, d = Math.floor(d.height);
if ("object" == a.tagName(b))
for (var l = b.children, h = 0; h < l.length; h++) {
var p = l[h];
if ("embed" == a.tagName(p)) {
l = p.getBoundingClientRect();
f = Math.max(f, Math.floor(l.width));
d = Math.max(d, Math.floor(l.height));
break
}
}
l = "";
null != e && (l = e.trim());
0 < l.length && ";" != l.charAt(l.length - 1) && (l += ";");
if (0 != f || 0 != d)
l += "width:" + f + "px;height:" + d + "px;";
return l
}
;
return b
}();
a.Watcher = d
}
)(m || (m = {}));
(function(a) {
a.MutationProcessingInterval = 250;
a.CurveSamplingInterval = 142;
a.UploadInterval = 5E3;
a.UserInactivityTimeout = 1E4;
a.HeartbeatInitial = 4E3;
a.HeartbeatMax = 256E3;
a.PageInactivityTimeout = 18E5;
a.BackoffMax = 3E5;
a.ScrollSampleInterval = a.MutationProcessingInterval / 5;
a.InactivityThreshold = 4E3
}
)(m || (m = {}));
(function(a) {
var k = function() {
function a(d, b, c) {
this._ctx = d;
this._q = b;
this._valueIndices = c;
this._evts = []
}
a.prototype.add = function(a) {
0 == this._evts.length && this._q.push(a);
this._evts.push(a)
}
;
a.prototype.finish = function(a, b) {
var c = this._evts.length;
if (1 >= c)
return !1;
for (var e = this._evts[0].When, g = this._evts[c - 1].When, f = 0; f < this._valueIndices.length; ++f) {
var l = this._valueIndices[f]
, h = this._evts[0].Args[l]
, p = (this._evts[1].When - e) / (g - e)
, k = (this._evts[1].Args[l] - h) / p
, t = this._evts[c - 1].Args[l]
, p = (g - this._evts[c - 2].When) / (g - e);
b.push(h, t, k, (t - this._evts[c - 2].Args[l]) / p)
}
this._evts[0].Kind = a;
this._evts[0].Args = b;
return !0
}
;
a.prototype.evts = function() {
return this._evts
}
;
return a
}()
, h = function() {
function f(a) {
this._ctx = a;
this._gotInitialScroll = !1
}
f.prototype.processQueue = function(d) {
if (0 == d.length)
return d;
for (var b = this._ctx.now(), c = [], e = new k(this._ctx,c,[0, 1]), g = {}, f = {}, l, h = 0; h < d.length; ++h) {
var p = d[h];
switch (p.Kind) {
case a.EVENT_MOUSEMOVE:
e.add(p);
break;
case a.EVENT_TOUCHMOVE:
var q = p.Args[0];
q in g || (g[q] = new k(this._ctx,c,[1, 2]));
g[q].add(p);
break;
case a.EVENT_SCROLL:
q = p.Args[0];
q in f || (f[q] = new k(this._ctx,c,[1, 2]));
f[q].add(p);
break;
case a.EVENT_INNERWIDTH:
l || (l = new k(this._ctx,c,[0]));
l.add(p);
break;
default:
c.push(p)
}
}
e.finish(a.EVENT_MOUSEMOVE_CURVE, [b]) && (d = e.evts(),
e = d[d.length - 1].Args,
2 < e.length && e[2] && d[0].Args.push(e[2]));
for (q in f)
d = parseInt(q),
f[d].finish(a.EVENT_SCROLL_CURVE, [b, d]);
for (q in g)
d = parseInt(q),
g[d].finish(a.EVENT_TOUCHMOVE_CURVE, [b, d]);
l && l.finish(a.EVENT_INNERWIDTH_CURVE, [b]);
return c
}
;
return f
}();
a.EventProcessor = h
}
)(m || (m = {}));
(function(a) {
a.Node_ELEMENT_NODE = 1;
a.Node_ATTRIBUTE_NODE = 2;
a.Node_TEXT_NODE = 3;
a.Node_CDATA_SECTION_NODE = 4;
a.Node_ENTITY_REFERENCE_NODE = 5;
a.Node_ENTITY_NODE = 6;
a.Node_PROCESSING_INSTRUCTION_NODE = 7;
a.Node_COMMENT_NODE = 8;
a.Node_DOCUMENT_NODE = 9;
a.Node_DOCUMENT_TYPE_NODE = 10;
a.Node_DOCUMENT_FRAGMENT_NODE = 11;
a.Node_NOTATION_NODE = 12;
a.XHR_UNSENT = 0;
a.XHR_OPENED = 1;
a.XHR_HEADERS_RECEIVED = 2;
a.XHR_LOADING = 3;
a.XHR_DONE = 4
}
)(m || (m = {}));
(function(a) {
function k(f, d) {
var b = Math.min(a.BackoffMax, 5E3 * Math.pow(2, f));
return d ? b + 0.25 * Math.random() * b : b
}
var h = function() {
function f() {}
f.prototype.postPromise = function(d, b, c, e) {
var g = this;
return new a.Promise(function(a, f) {
g.post(d, b, c, e, a, f)
}
)
}
;
return f
}();
a.HttpPoster = h;
h = function(f) {
function d() {
return null !== f && f.apply(this, arguments) || this
}
M(d, f);
d.prototype.post = function(b, c, e, d, f, l) {
c = "//" + c + e;
var h = !1
, p = new XMLHttpRequest;
if ("withCredentials"in p)
p.onreadystatechange = function() {
if (p.readyState == a.XHR_DONE && !h) {
h = !0;
try {
200 == p.status ? f(p.responseText) : l && l(p.status)
} catch (b) {
a.sendToBugsnag(b, "error")
}
}
}
,
p.open("POST", b + c, !0),
p.withCredentials = !0,
d instanceof FormData || p.setRequestHeader("Content-Type", "text/plain"),
p.send(d);
else {
var k = new XDomainRequest;
k.onload = function() {
f(k.responseText)
}
;
k.onerror = function() {
l && l("Not Found" == k.responseText ? 404 : 500)
}
;
k.onprogress = function() {}
;
k.open("POST", c);
k.send(d)
}
}
;
d.prototype.sendBeacon = function(a, c, e, d) {
return "function" == typeof navigator.sendBeacon ? (navigator.sendBeacon(a + "//" + c + e, d),
!0) : !1
}
;
d.prototype.exponentialBackoffMs = function(a, c) {
return k(a, c)
}
;
return d
}(h);
a.XHRPoster = h;
a.exponentialBackoffMs = k;
a.isErrorFatal = function(a) {
return 400 <= a || 202 == a ? !0 : !1
}
;
a.gceHost = function(f) {
return a.isLocalhost(a.domainFromHost(f)) ? f : 0 == f.indexOf("www.") || 0 == f.indexOf("app.") ? "r." + f.slice(4) : "r." + f
}
}
)(m || (m = {}));
(function(a) {
function k(b, c) {
return a.stringify({
__fs: [b, c ? c : ""]
})
}
function h(a, c, e, d, f, l, h) {
a = "/rec/bundle?OrgId=" + a + "&UserId=" + c + "&SessionId=" + e + "&PageId=" + d + "&Seq=" + f.Seq;
l && (a += "&PageStartTime=" + l);
h && (a += "&DeltaT=" + h);
return a
}
var f = function() {
function b(a, b) {
void 0 === b && (b = new d);
this._wnd = a;
this._messagePoster = b
}
b.prototype.enqueueEvents = function(b) {
this._messagePoster.postMessage(this._wnd.parent, a.FS_IFRAME_EVENTS, b)
}
;
b.prototype.startPipeline = function(a) {}
;
b.prototype.stopPipeline = function() {}
;
b.prototype.flush = function() {}
;
b.prototype.singSwanSong = function() {}
;
return b
}();
a.PostMessageEventTransport = f;
var d = function() {
function b() {}
b.prototype.postMessage = function(b, e, d) {
var f;
try {
f = a._fs_transport(b)
} catch (l) {}
f ? f.send(e, a.stringify(d)) : b.postMessage(k(e, d), "*")
}
;
return b
}();
a.PostMessagePoster = d;
a.formatPostMessageData = k;
f = function() {
function b(b, e, d, f, l) {
void 0 === d && (d = a.RealTicker);
void 0 === f && (f = a.RealTimeout);
void 0 === l && (l = new a.XHRPoster);
this._ctx = b;
this._onShutdown = e;
this._tickerFactory = d;
this._timeoutFactory = f;
this._poster = l;
this._backoffTime = this._backoffRetries = this._byteCount = 0;
this._bundleSeq = 1;
this._lastPostTime = 0;
this._largePageSize = 16E6;
this._outgoingEventQueue = [];
this._bundleQueue = [];
this._bundleHost = a.gceHost(b.getHost());
this._protocol = b.getProtocol();
this._identity = b.getIdentity();
this._lastBundleTime = b.wallTime();
this._uploadTicker = new this._tickerFactory(a.UploadInterval);
this._swanSong = new a.SwanSong(b,this,f)
}
b.prototype.protocol = function() {
return this._protocol
}
;
b.prototype.enqueueEvents = function(a) {
this._outgoingEventQueue = this._outgoingEventQueue.concat(a)
}
;
b.prototype.startPipeline = function(a) {
var b = this;
this._pageId = a;
this.enqueueAndSendBundle();
this._uploadTicker.start(function() {
b.enqueueAndSendBundle()
})
}
;
b.prototype.stopPipeline = function() {
this._uploadTicker.stop();
this._outgoingEventQueue = [];
this._bundleQueue = []
}
;
b.prototype.flush = function() {
this.maybeSendNextBundle()
}
;
b.prototype.singSwanSong = function() {
0 < this._outgoingEventQueue.length && this.enqueueNextBundle(!0);
if (0 < this._bundleQueue.length || this._pendingBundle) {
var a = this._bundleQueue.concat();
this._pendingBundle && a.unshift(this._pendingBundle);
this._swanSong.sing(this._pageId, a, this._lastBundleTime)
}
}
;
b.prototype.sendSwanSongBundle = function(a, b, d, f, l, k, p, q, t) {
a = h(a, b, d, f, l, k, p);
this.post(a, l, q, t)
}
;
b.prototype.enqueueAndSendBundle = function() {
this._pendingBundle ? this._pendingBundleFailed && this._sendPendingBundle() : 0 == this._outgoingEventQueue.length ? this.maybeSendNextBundle() : this.enqueueNextBundle()
}
;
b.prototype.enqueueNextBundle = function(b) {
void 0 === b && (b = !1);
var e = {
When: this._outgoingEventQueue[0].When,
Seq: this._bundleSeq++,
Evts: this._outgoingEventQueue
};
this._outgoingEventQueue = [];
this._bundleQueue.push(e);
b && this._poster.sendBeacon(this._protocol, this._bundleHost, this.bundleUrl(e), a.stringify(e)) || this.maybeSendNextBundle()
}
;
b.prototype.maybeSendNextBundle = function() {
this._pageId && (!this._pendingBundle && 0 != this._bundleQueue.length) && (this._pendingBundle = this._bundleQueue.shift(),
this._sendPendingBundle())
}
;
b.prototype._sendPendingBundle = function() {
var b = this
, e = this._ctx.wallTime();
if (!(e < this._backoffTime)) {
var d = this._pendingBundle;
d && (this._pendingBundleFailed = !1,
this._lastPostTime = this._lastBundleTime = e,
this.sendBundle(d, function(e) {
d && a.logIfDebug("Sent bundle " + d.Seq + " with " + d.Evts.length + " events");
b._pendingBundle = null;
b._backoffTime = 0;
b._backoffRetries = 0;
b._ctx.wallTime() - b._lastPostTime > a.UploadInterval && b.maybeSendNextBundle()
}, function(e) {
a.logIfDebug("Failed to send events.");
a.isErrorFatal(e) ? b._onShutdown() : (b._pendingBundleFailed = !0,
b._backoffTime = b._lastPostTime + b._poster.exponentialBackoffMs(b._backoffRetries++, !1))
}))
}
}
;
b.prototype.sendBundle = function(a, b, d) {
this.post(this.bundleUrl(a), a, b, d)
}
;
b.prototype.bundleUrl = function(a) {
return h(this._identity.orgId(), this._identity.userId(), this._identity.sessionId(), this._pageId, a)
}
;
b.prototype.post = function(b, e, d, f) {
var l = "";
null != e && (l = a.stringify(e),
this._byteCount += l.length,
a.logIfDebug("total bytes written: " + this._byteCount));
this._poster.post(this._protocol, this._bundleHost, b, l, d, f);
this._byteCount > this._largePageSize && 16 < this._bundleSeq && (a.logIfDebug("Splitting large page of size: " + this._byteCount.toString()),
a.sendToBugsnag(Error("Large bundle of " + l.length + " bytes was sent to: " + b), "info"),
this._ctx.splitPage(),
this._byteCount = 0)
}
;
return b
}();
a.HttpEventTransport = f
}
)(m || (m = {}));
(function(a) {
var k = function() {
function a() {
this.dict = {
idx: -1,
map: {}
};
this.nodeCount = 1;
this.startIdx = 0
}
a.prototype.encode = function(f) {
function d() {
e ? 1 < l ? g.push([e.idx, l]) : g.push(e.idx) : g.push(b)
}
if (0 == f.length)
return [];
var b = f[0], c, e = Object.prototype.hasOwnProperty.call(this.dict.map, b) ? this.dict.map[b] : null, g = [], n, l = 1;
for (c = 1; c < f.length; c++)
if (n = f[c],
e && Object.prototype.hasOwnProperty.call(e.map, n))
l++,
b = n,
e = e.map[n];
else {
d();
var k = this.startIdx + c - l;
null == e && this.nodeCount < a.MAX_NODES && (e = {
idx: k,
map: {}
},
this.dict.map[b] = e,
this.nodeCount++);
e && this.nodeCount < a.MAX_NODES && (e.map[n] = {
idx: k,
map: {}
},
this.nodeCount++);
l = 1;
b = n;
e = Object.prototype.hasOwnProperty.call(this.dict.map, n) ? this.dict.map[n] : null
}
d();
this.startIdx += f.length;
return g
}
;
a.MAX_NODES = 1E4;
return a
}();
a.LZJGWEncoder = k;
k = function() {
function a() {
this._seq = []
}
a.prototype.sequence = function() {
return this._seq
}
;
a.prototype.decode = function(a) {
for (var d = this._seq.length, b = 0; b < a.length; ++b) {
var c = a[b];
switch (typeof c) {
case "string":
this._seq.push(c);
break;
case "number":
this._seq.push(this._seq[c]);
break;
case "object":
if (null == c) {
this._seq.push("");
break
}
for (var e = 0; e < c[1]; e++)
this._seq.push(this._seq[c[0] + e])
}
}
return d
}
;
return a
}();
a.LZJGWDecoder = k
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(f, d, b) {
void 0 === b && (b = a.RealTimeout);
this._ctx = f;
this._transport = d;
this._timeoutFactory = b;
this._recover();
this._identity = f.getIdentity()
}
h.prototype.sing = function(f, d, b) {
a.logIfDebug("Saving " + d.length + " bundles in swan-song.");
f = {
OrgId: this._identity.orgId(),
UserId: this._identity.userId(),
SessionId: this._identity.sessionId(),
PageId: f,
Bundles: d,
PageStartTime: this._ctx.startTime(),
LastBundleTime: b
};
try {
localStorage.singSwanSong = a.stringify(f)
} catch (c) {}
}
;
h.prototype._recover = function() {
try {
if ("singSwanSong"in localStorage) {
var f = localStorage.singSwanSong;
delete localStorage.singSwanSong;
var d = a.parseJson(f);
d.Bundles && d.UserId && d.SessionId && d.PageId ? (d.OrgId || (d.OrgId = this._identity.orgId()),
0 < d.Bundles.length && (a.logIfDebug("Sending " + d.Bundles.length + " bundles as prior page swan song"),
this.sendSwanSongBundles(d.OrgId, d.UserId, d.SessionId, d.PageId, d.PageStartTime, d.Bundles, d.LastBundleTime))) : a.logIfDebug("Malformed swan song found. Ignoring it.")
}
} catch (b) {
a.logIfDebug("Error recovering swan-song: " + b)
}
}
;
h.prototype.sendSwanSongBundles = function(f, d, b, c, e, g, n, l) {
var h = this;
void 0 === l && (l = 0);
var k = null;
a.isArray(g) && (0 !== g.length && void 0 !== g[0]) && (1 == g.length && (k = this._ctx.wallTime() - (n || 0)),
this._transport.sendSwanSongBundle(f, d, b, c, g[0], e, k, function(l) {
a.logIfDebug("Sent " + g[0].Evts.length + " trailing events from last session as Seq " + g[0].Seq);
a.windex.Array.prototype.shift.call(g);
0 < g.length ? h.sendSwanSongBundles(f, d, b, c, e, g, n) : a.logIfDebug("Done with prior page swan song")
}, function(k) {
a.isErrorFatal(k) ? a.logIfDebug("Fatal error while sending events, giving up") : (a.logIfDebug("Failed to send events from last session, will retry while on this page"),
h._lastSwanSongRetryTimeout = new h._timeoutFactory(h.sendSwanSongBundles,a.exponentialBackoffMs(l, !0),h,f,d,b,c,e,g,n,l + 1))
}))
}
;
return h
}();
a.SwanSong = k
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(a) {
this._interval = a;
this._handle = -1
}
h.prototype.start = function(f) {
-1 == this._handle && (this._handle = setInterval(function() {
try {
f()
} catch (d) {
a.sendToBugsnag(d, "error")
}
}, this._interval))
}
;
h.prototype.stop = function() {
-1 != this._handle && (clearInterval(this._handle),
this._handle = -1)
}
;
return h
}();
a.RealTicker = k;
k = function() {
function h(f, d, b) {
void 0 === d && (d = 0);
for (var c = [], e = 3; e < arguments.length; e++)
c[e - 3] = arguments[e];
this.delay = d;
this.timer = -1;
this.handler = function() {
try {
f.apply(void 0 === b ? window : b, c)
} catch (e) {
a.sendToBugsnag(e, "error")
}
}
;
this.timer = setTimeout(this.handler, d);
this.args = c
}
h.prototype.cancel = function() {
clearTimeout(this.timer);
this.timer = -1
}
;
h.prototype.reset = function(a) {
void 0 === a && (a = this.delay);
this.delay = a;
clearTimeout(this.timer);
this.timer = setTimeout(this.handler, this.delay)
}
;
return h
}();
a.RealTimeout = k
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(f, d, b, c, e) {
void 0 === b && (b = function() {
return []
}
);
void 0 === c && (c = a.RealTicker);
void 0 === e && (e = a.RealTimeout);
var g = this;
this._ctx = f;
this._transport = d;
this._gatherExternalEvents = b;
this._tickerFactory = c;
this._timeoutFactory = e;
this._recordingDisabled = !1;
this._lastWhen = -1;
this._lastUserAction = 0;
this._hibernating = this._quiescent = !1;
this._lastHeartbeat = 0;
this._heartbeatInterval = a.HeartbeatInitial;
this._gotUnload = !1;
this._eventQueue = [];
this._sampleCurvesTicker = new this._tickerFactory(a.CurveSamplingInterval);
this._processMutationsTicker = new this._tickerFactory(a.MutationProcessingInterval);
this._hibernationTimeout = new this._timeoutFactory(function() {
g.hibernate()
}
,a.PageInactivityTimeout,this);
this._processor = new a.EventProcessor(f)
}
h.prototype.startPipeline = function(a, d, b) {
var c = this;
void 0 === d && (d = 0);
void 0 === b && (b = []);
this._recordingDisabled || this._pipelineStarted || (this._pipelineStarted = !0,
this._frameId = d,
this._parentIds = b,
this._lastUserAction = this._ctx.now(),
this.processEvents(),
this._processMutationsTicker.start(function() {
c.processEvents()
}),
this._sampleCurvesTicker.start(function() {
c.processEvents(!0)
}),
this._transport.startPipeline(a))
}
;
h.prototype.enqueue = function(a, d) {
this.enqueueAt(this._ctx.now(), a, d)
}
;
h.prototype.enqueueAt = function(f, d, b) {
this._hibernating && a.isUserActionEvent(d) ? this._ctx.splitPage() : this._recordingDisabled || (f <= this._lastWhen && (f = this._lastWhen + 1),
this._lastWhen = f,
this._eventQueue.push({
When: f,
Kind: d,
Args: b
}),
a.isUserActionEvent(d) && (this._lastUserAction = f,
this._hibernationTimeout.reset()))
}
;
h.prototype.hibernate = function() {
this.shutdown();
this._hibernating = !0
}
;
h.prototype.enqueueFirst = function(a, d) {
0 < this._eventQueue.length ? this._eventQueue.unshift({
When: this._eventQueue[0].When,
Kind: a,
Args: d
}) : this.enqueue(a, d)
}
;
h.prototype.addUnload = function() {
this._gotUnload || (this._gotUnload = !0,
this.enqueue(a.EVENT_UNLOAD, []),
this._lastUserAction = this._ctx.now(),
this.singSwanSong())
}
;
h.prototype.shutdown = function() {
this._flush();
this.addUnload();
this._flush();
this._recordingDisabled = !0;
this.stopPipeline();
this._hibernationTimeout.cancel()
}
;
h.prototype._flush = function() {
this.processEvents();
this._transport.flush()
}
;
h.prototype.prequeue = function(a, d) {
this._recordingDisabled || this._eventQueue.unshift({
When: 0,
Kind: a,
Args: d
})
}
;
h.prototype.appendToQueue = function(a) {
this._eventQueue = this._eventQueue.concat(a)
}
;
h.prototype.singSwanSong = function() {
this._recordingDisabled || (this.processEvents(),
this._transport.singSwanSong())
}
;
h.prototype.rebaseIframe = function(a) {
for (var d = 0, b = this._eventQueue.length; d < b; d++) {
var c = this._eventQueue[d]
, e = c.When + this._ctx.startTime() - a;
0 > e && (e = 0);
c.When = e
}
}
;
h.prototype.processEvents = function(f) {
if (this._pipelineStarted && !this._hibernating && (this._ctx.now() - this._lastUserAction > a.UserInactivityTimeout ? this._quiescent || (this._quiescent = !0,
this._heartbeatInterval = a.HeartbeatInitial,
this._lastHeartbeat = this._ctx.now()) : this._quiescent = !1,
!this._quiescent || this.maybeSendHeartbeat())) {
var d = this._eventQueue;
this._eventQueue = [];
d = this._processor.processQueue(d);
f || (d = d.concat(this._gatherExternalEvents()));
this.ensureFrameIds(d);
0 != d.length && this._transport.enqueueEvents(d)
}
}
;
h.prototype.maybeSendHeartbeat = function() {
var f = this._ctx.now();
return f - this._lastHeartbeat >= this._heartbeatInterval ? (this._lastHeartbeat = f,
this._heartbeatInterval *= 2,
this._heartbeatInterval > a.HeartbeatMax && (this._heartbeatInterval = a.HeartbeatMax),
this.enqueue(a.EVENT_HEARTBEAT, []),
!0) : !1
}
;
h.prototype.ensureFrameIds = function(a) {
if (this._frameId)
for (var d = this._parentIds, b = d && 0 < d.length, c = 0; c < a.length; ++c) {
var e = a[c];
e.FId || (e.FId = this._frameId);
b && !e.PIds && (e.PIds = d)
}
}
;
h.prototype.stopPipeline = function() {
this._pipelineStarted && (this._sampleCurvesTicker.stop(),
this._processMutationsTicker.stop(),
this._eventQueue = [],
this._transport.stopPipeline())
}
;
return h
}();
a.EventQueue = k
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(f, d) {
this._queue = f;
this._wnd = d;
this._overflow = this._enabled = !1;
this._total = 0;
this._listeners = new a.DomListeners;
this._hooks = []
}
h.prototype.enable = function() {
var f = this;
this._listeners.add(this._wnd, "error", !0, function(a) {
return f.addError(a)
});
this._listeners.add(this._wnd, "unhandledrejection", !0, function(a) {
f.addLog("error", ["Uncaught (in promise)", a.reason])
});
if (!this._enabled)
if (this._enabled = !0,
this._wnd.console)
for (var d = function(c) {
if (!b._wnd.console[c] || !b._wnd.console[c].apply)
return "continue";
var e = a.activateHook(b._wnd.console, c).before(function(a) {
return f.addLog(c, a.args)
});
b._hooks.push(e)
}, b = this, c = 0, e = ["log", "info", "warn", "error"]; c < e.length; c++)
d(e[c]);
else
this.addLog("log", ["NOTE: Log messages cannot be captured on IE9"])
}
;
h.prototype.disable = function() {
this._listeners.clear();
if (this._enabled) {
this._enabled = !1;
for (var a; a = this._hooks.pop(); )
a.disable()
}
}
;
h.prototype.addLog = function(f, d) {
if (this.checkOverflow()) {
for (var b = [f], c = 0; c < d.length; ++c)
b.push(a.stringify(d[c], 1E3));
this._queue.enqueue(a.EVENT_LOG, b)
}
}
;
h.prototype.addError = function(f) {
if (this.checkOverflow()) {
var d = f.message
, b = f.filename;
f = f.lineno;
if (d || b || f)
"object" == typeof d && (d = a.stringify(d, 1E3)),
"object" == typeof b && (b = a.stringify(b, 100)),
"object" == typeof f && (f = -1),
this._queue.enqueue(a.EVENT_ERROR, [d, b, f])
}
}
;
h.prototype.checkOverflow = function() {
if (this._overflow)
return !1;
if (this._total == a.MAX_LOGS_PER_PAGE)
return this._queue.enqueue(a.EVENT_LOG, ["warn", h.OVERFLOW_MSG]),
this._overflow = !0,
!1;
this._total++;
return !0
}
;
h.OVERFLOW_MSG = '"[received more than ' + a.MAX_LOGS_PER_PAGE + ' messages; no longer recording console]"';
return h
}();
a.ConsoleWatcher = k
}
)(m || (m = {}));
(function(a) {
function k(c, e) {
var d = Object.getOwnPropertyDescriptor(c.prototype, e);
d && Object.defineProperty(c.prototype, e, {
set: function(c) {
var e = this
, f = a.fsid(e);
f && (b && b.values[f] != c) && setTimeout(function() {
if (b)
b.onChange(e, c)
}, 0);
return d.set.call(this, c)
},
get: function() {
return d.get && d.get.call(this)
}
})
}
function h(a) {
switch (a.type) {
case "checkbox":
case "radio":
return "" + a.checked;
default:
return (a = a.value) || (a = ""),
"" + a
}
}
var f = function() {
function c(a, c) {
this._onchange = a;
this._checkElem = c;
this._fallback = !1;
this._elems = {};
this.values = {};
b = this
}
c.prototype.hookEvents = function() {
var a;
(a = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")) && a.set ? (d || (k(HTMLInputElement, "value"),
k(HTMLInputElement, "checked"),
k(HTMLSelectElement, "value"),
k(HTMLTextAreaElement, "value"),
d = !0),
a = !0) : a = !1;
a || (this._fallback = !0)
}
;
c.prototype.addInput = function(b) {
var c = a.fsid(b);
this._elems[c] = b;
this.values[c] = h(b);
a: switch (b.type) {
case "checkbox":
case "radio":
c = b.checked != b.hasAttribute("checked");
break a;
default:
var c = b.value || ""
, d = b.getAttribute("value") || ""
, c = c != d
}
c && this._onchange(b)
}
;
c.prototype.onChange = function(b, c) {
void 0 === c && (c = h(b));
var d = a.fsid(b);
(b = this._elems[d]) && c != this.values[d] && (this._onchange(b),
this.values[d] = c)
}
;
c.prototype.tick = function() {
for (var a in this._elems)
if (!this._checkElem(this._elems[a]))
delete this._elems[a],
delete this.values[a];
else if (this._fallback) {
var b = this._elems[a]
, c = h(b);
c != this.values[a] && (this._onchange(b),
this.values[a] = c)
}
}
;
c.prototype.shutdown = function() {
b = null
}
;
c.prototype._usingFallback = function() {
return this._fallback
}
;
c.prototype._trackingElem = function(a) {
return !!this._elems[a]
}
;
return c
}();
a.InputWatcher = f;
var d = !1, b;
a.valueOfInputishElem = h
}
)(m || (m = {}));
(function(a) {
function k(a) {
return "_fswatch"in a
}
function h(a) {
return a._fswatch
}
function f(a, b) {
a._fswatch = b
}
function d(b, c) {
if (k(b.node))
for (var e = b, d = b.parent; d; d = d.parent) {
d.watchedChildSet = d.watchedChildSet || {};
if (e.watchedChildSet)
for (var g in e.watchedChildSet)
delete d.watchedChildSet[g];
d.watchedChildSet[e.id] = e;
if (a.hasNKeys(d.watchedChildSet, 2))
e = d;
else if (a.hasMoreThanNKeys(d.watchedChildSet, 2))
break
}
}
function b(a) {
return a ? p[a._fs] : null
}
function c(a) {
return a && a._fs || 0
}
function e(a, b, c) {
g(b);
c = c || a.lastChild;
b.parent = a;
if (b.prev = c)
e = [b, c.next],
c.next = e[0],
b.next = e[1];
null == b.prev ? a.child = b : b.prev.next = b;
null == b.next ? a.lastChild = b : b.next.prev = b;
var e
}
function g(b) {
if (b.parent) {
if (a.hasMoreThanNKeys(b.watchedChildSet, 0) || k(b.node))
for (var c = a.firstKey(b.watchedChildSet) || b.id, e = c ? b.parent : null; e && e.watchedChildSet && e.watchedChildSet[c]; ) {
delete e.watchedChildSet[c];
if (a.hasNKeys(e.watchedChildSet, 1)) {
for (var c = e.id, d = a.firstValue(e.watchedChildSet), e = e.parent; e && e.watchedChildSet && e.watchedChildSet[c]; )
delete e.watchedChildSet[c],
e.watchedChildSet[d.id] = d,
e = e.parent;
break
}
e = e.parent
}
b.parent.child == b && (b.parent.child = b.next);
b.parent.lastChild == b && (b.parent.lastChild = b.prev);
b.prev && (b.prev.next = b.next);
b.next && (b.next.prev = b.prev);
b.parent = b.prev = b.next = null;
p[b.id] = null;
b.node._fs == b.id && (b.node._fs = 0);
b.id = 0;
b.child && n(b.child)
}
}
function n(b) {
for (b = [b]; 0 < b.length && 1E4 > b.length; ) {
var c = b.pop();
c.node._fs == c.id && (c.node._fs = 0);
c.id = 0;
c.next && b.push(c.next);
c.child && b.push(c.child)
}
a.assert(1E4 > b.length, "clearIds is fast")
}
function l(a, b) {
if (a.attributes && 0 < a.attributes.length)
for (var c = 0; c < a.attributes.length; c++) {
var e = a.attributes[c];
b(e.name.toLowerCase(), e.value)
}
}
function y(a, b, c, e) {
if ("class" == b && 0 > c.indexOf("_fs_block_"))
c += " _fs_block_" + h(a);
else if ("type" == b || "value" == b || "checked" == b || "src" == b || "data" == b || "alt" == b)
return null;
return c
}
a.isWatched = k;
a.watchKind = h;
a.setWatched = f;
var p = {};
a.mirrorFor = b;
a.fsid = c;
a.fsidIfNotBlocked = function(a) {
return k(a) ? 0 : c(a)
}
;
a.removeMirror = g;
a.clearIds = n;
var q = function() {
function c(a) {
this._watcher = a;
this._curId = 1
}
c.prototype.curId = function() {
return this._curId
}
;
c.prototype.tokenizeNode = function(a, c, e, d, g) {
var f = this._curId;
try {
var l = b(a)
, h = b(c);
a = [];
this.tokeNode(l, h, e, a, d, g);
return a
} catch (n) {
return this._curId = f,
[]
}
}
;
c.prototype.tokeNode = function(b, c, g, f, h, n) {
if ("SCRIPT" == g.nodeName || g.nodeType == a.Node_COMMENT_NODE)
return null;
var k = {
id: this._curId++,
node: g
};
p[k.id] = k;
g._fs = k.id;
b && e(b, k, c);
if (g.nodeType == a.Node_DOCUMENT_TYPE_NODE)
return f.push("<!DOCTYPE", ":name", g.name, ":publicId", g.publicId || "", ":systemId", g.systemId || ""),
k;
b = g.nodeName;
"http://www.w3.org/2000/svg" == g.namespaceURI && (b = "svg:" + b);
f.push("<" + b);
try {
var y = this.processWatchedElem(g, f);
if (y && (d(k, y),
y != a.WatchKindWatch))
return k;
h && h(g);
l(g, function(a, b) {
f.push(":" + a);
f.push(b);
n && n(g, a, b)
});
if (g.firstChild) {
f.push("[");
var y = null, q;
for (q = g.firstChild; q; q = q.nextSibling) {
var m = this.tokeNode(k, y, q, f, h, n);
m && (y = m)
}
f.push("]")
}
g.nodeType == a.Node_TEXT_NODE && f.push(g.textContent || "")
} catch (t) {}
return k
}
;
c.prototype.processWatchedElem = function(b, c) {
var e = this;
if (b.nodeType == a.Node_ELEMENT_NODE && this._watcher) {
var d = this._watcher.isWatched(b);
if (d) {
f(b, d);
if (d != a.WatchKindWatch) {
var g, h = !1;
l(b, function(a, d) {
var f = y(b, a, d, e._watcher);
"class" == a ? g = !0 : "style" == a && (h = !0);
null != f && (c.push(":" + a),
c.push(f))
});
g || (c.push(":class"),
c.push("_fs_block_" + d));
h || (c.push(":style"),
c.push(this._watcher.mungeWatchedStyle(b, "")))
}
return d
}
}
return null
}
;
return c
}();
a.NodeEncoder = q;
a.rewriteBlockedAttribute = y
}
)(m || (m = {}));
(function(a) {
function k() {
m = !1;
var a = s;
s = [];
a.sort(function(a, b) {
return a.uid_ - b.uid_
});
var b = !1;
a.forEach(function(a) {
var c = a.takeRecords();
h(a);
c.length && (a.callback_(c, a),
b = !0)
});
b && k()
}
function h(a) {
a.nodes_.forEach(function(b) {
(b = l.get(b)) && b.forEach(function(b) {
b.observer === a && b.removeTransientObservers()
})
})
}
function f(a, b) {
for (var c = a; c; c = c.parentNode) {
var e = l.get(c);
if (e)
for (var d = 0; d < e.length; d++) {
var g = e[d]
, f = g.options;
(c === a || f.subtree) && (f = b(f)) && g.enqueue(f)
}
}
}
function d(a) {
this.callback_ = a;
this.nodes_ = [];
this.records_ = [];
this.uid_ = ++u
}
function b(a) {
if (x)
return x;
var b = w
, c = new r(b.type,b.target);
c.addedNodes = b.addedNodes.slice();
c.removedNodes = b.removedNodes.slice();
c.previousSibling = b.previousSibling;
c.nextSibling = b.nextSibling;
c.attributeName = b.attributeName;
c.attributeNamespace = b.attributeNamespace;
c.oldValue = b.oldValue;
x = c;
x.oldValue = a;
return x
}
function c(a, b, c) {
this.observer = a;
this.target = b;
this.options = c;
this.transientObservedNodes = []
}
var e = navigator.userAgent
, e = -1 < e.indexOf("MSIE ") || -1 < e.indexOf("Trident/");
a.MutationObserver = e ? d : window.MutationObserver || window.WebKitMutationObserver || d;
var g = Object.defineProperty
, n = Date.now() % 1E9
, l = new (window.WeakMap || function() {
var a = function() {
this.name = "__st" + (1E9 * Math.random() >>> 0) + (n++ + "__")
};
a.prototype = {
set: function(a, b) {
var c = a[this.name];
c && c[0] === a ? c[1] = b : g(a, this.name, {
value: [a, b],
writable: !0
})
},
get: function(a) {
var b;
return (b = a[this.name]) && b[0] === a ? b[1] : void 0
}
};
return a
}())
, y = window.setImmediate || window.msSetImmediate;
if (!y) {
var p = []
, q = String(Math.random());
window.addEventListener("message", function(a) {
a.data === q && (a = p,
p = [],
a.forEach(function(a) {
a()
}))
});
y = function(a) {
for (var b = 1; b < arguments.length; b++)
;
p.push(a);
window.postMessage(q, "*");
return 0
}
}
var m = !1
, s = []
, u = 0;
d.prototype = {
observe: function(a, b) {
a = window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(a) || a;
if (!b.childList && !b.attributes && !b.characterData || b.attributeOldValue && !b.attributes || b.attributeFilter && b.attributeFilter.length && !b.attributes || b.characterDataOldValue && !b.characterData)
throw new SyntaxError;
var e = l.get(a);
e || l.set(a, e = []);
for (var d, g = 0; g < e.length; g++)
if (e[g].observer === this) {
d = e[g];
d.removeListeners();
d.options = b;
break
}
d || (d = new c(this,a,b),
e.push(d),
this.nodes_.push(a));
d.addListeners()
},
disconnect: function() {
this.nodes_.forEach(function(a) {
a = l.get(a);
for (var b = 0; b < a.length; b++) {
var c = a[b];
if (c.observer === this) {
c.removeListeners();
a.splice(b, 1);
break
}
}
}, this);
this.records_ = []
},
takeRecords: function() {
var a = this.records_;
this.records_ = [];
return a
}
};
var r = function() {
return function(a, b) {
this.type = a;
this.target = b;
this.addedNodes = [];
this.removedNodes = [];
this.oldValue = this.attributeNamespace = this.attributeName = this.nextSibling = this.previousSibling = null
}
}(), w, x;
c.prototype = {
enqueue: function(a) {
var b = this.observer.records_
, c = b.length;
if (0 < b.length) {
var e = b[c - 1];
e = e === a ? e : !x || e !== x && e !== w ? null : x;
if (e) {
b[c - 1] = e;
return
}
} else
s.push(this.observer),
m || (m = !0,
y(k));
b[c] = a
},
addListeners: function() {
this.addListeners_(this.target)
},
addListeners_: function(a) {
var b = this.options;
b.attributes && a.addEventListener("DOMAttrModified", this, !0);
b.characterData && a.addEventListener("DOMCharacterDataModified", this, !0);
b.childList && a.addEventListener("DOMNodeInserted", this, !0);
(b.childList || b.subtree) && a.addEventListener("DOMNodeRemoved", this, !0)
},
removeListeners: function() {
this.removeListeners_(this.target)
},
removeListeners_: function(a) {
var b = this.options;
b.attributes && a.removeEventListener("DOMAttrModified", this, !0);
b.characterData && a.removeEventListener("DOMCharacterDataModified", this, !0);
b.childList && a.removeEventListener("DOMNodeInserted", this, !0);
(b.childList || b.subtree) && a.removeEventListener("DOMNodeRemoved", this, !0)
},
addTransientObserver: function(a) {
if (a !== this.target) {
this.addListeners_(a);
this.transientObservedNodes.push(a);
var b = l.get(a);
b || l.set(a, b = []);
b.push(this)
}
},
removeTransientObservers: function() {
var a = this.transientObservedNodes;
this.transientObservedNodes = [];
a.forEach(function(a) {
this.removeListeners_(a);
a = l.get(a);
for (var b = 0; b < a.length; b++)
if (a[b] === this) {
a.splice(b, 1);
break
}
}, this)
},
handleEvent: function(a) {
switch (a.type) {
case "DOMAttrModified":
var c = a.attrName
, e = a.relatedNode.namespaceURI
, d = a.target
, g = w = new r("attributes",d);
g.attributeName = c;
g.attributeNamespace = e;
var h = a.attrChange === MutationEvent.ADDITION ? null : a.prevValue;
f(d, function(a) {
if (a.attributes && (!a.attributeFilter || !a.attributeFilter.length || -1 !== a.attributeFilter.indexOf(c) || -1 !== a.attributeFilter.indexOf(e)))
return a.attributeOldValue ? b(h) : g
});
break;
case "DOMCharacterDataModified":
d = a.target;
g = w = new r("characterData",d);
h = a.prevValue;
f(d, function(a) {
if (a.characterData)
return a.characterDataOldValue ? b(h) : g
});
break;
case "DOMNodeRemoved":
this.addTransientObserver(a.target);
case "DOMNodeInserted":
var d = a.relatedNode, l = a.target, n;
"DOMNodeInserted" === a.type ? (a = [l],
n = []) : (a = [],
n = [l]);
var k = l.previousSibling
, l = l.nextSibling
, g = w = new r("childList",d);
g.addedNodes = a;
g.removedNodes = n;
g.previousSibling = k;
g.nextSibling = l;
f(d, function(a) {
if (a.childList)
return g
})
}
w = x = void 0
}
}
}
)(m || (m = {}));
(function(a) {
var k = function() {
function h(f, d, b, c) {
void 0 === b && (b = function() {}
);
void 0 === c && (c = function() {}
);
this._ctx = f;
this._watcher = d;
this._nodeVisitor = b;
this._attrVisitor = c;
this._sentDomSnapshot = !1;
this._records = [];
this._watchedDims = {};
this._wnd = f.getWindow();
this._encoder = new a.NodeEncoder(d)
}
h.prototype.hookMutations = function(f) {
var d = this;
void 0 === f && (f = this._wnd.document);
this._root = f;
this._sentDomSnapshot = !1;
this._lz = new a.LZJGWEncoder;
this._observer = new a.MutationObserver(function(a) {
d._records = d._records.concat(a)
}
);
this._observer.observe(f, {
childList: !0,
attributes: !0,
characterData: !0,
subtree: !0,
attributeOldValue: !0,
characterDataOldValue: !0
})
}
;
h.prototype.shutdown = function() {
this._observer && this._observer.disconnect();
var f = a.mirrorFor(this._root);
f && a.clearIds(f);
this._records = []
}
;
h.prototype.processMutations = function() {
if (!this._root)
return [];
var f = this._ctx.now()
, d = [];
this._sentDomSnapshot || (this.genInsert(f, d, null, this._root, null),
this.resizeRelatedWatchedElements(f, d, this._root),
this._sentDomSnapshot = !0);
if (0 == this._records.length)
return d;
var b = {}
, c = {};
this.processRecords(f, d, c, b);
for (var e in c) {
var g = e.split(":");
d.push({
Kind: a.EVENT_MUT_ATTR,
When: f,
Args: [parseInt(g[0]), g[1], c[e]]
})
}
for (e in b)
d.push({
Kind: a.EVENT_MUT_TEXT,
When: f,
Args: [parseInt(e), b[e]]
});
this._records = [];
return d
}
;
h.prototype.processRecords = function(f, d, b, c) {
for (var e = {}, g = {}, h = 0; h < this._records.length; ++h)
try {
var l = this._records[h]
, k = a.fsid(l.target);
if (k)
switch (e[k] = l.target,
l.type) {
case "childList":
if (0 < l.removedNodes.length)
for (var p = 0; p < l.removedNodes.length; ++p) {
var q = a.mirrorFor(l.removedNodes[p]);
q && q.id && q.parent == a.mirrorFor(l.target) && q.next == a.mirrorFor(l.nextSibling) && this.genRemove(f, d, q)
}
k && (g[k] = l.target);
break;
case "characterData":
var m = l.target.textContent;
l.oldValue != m && (a.isWatched(l.target) || (c[k] = m));
break;
case "attributes":
var s = l.attributeName || ""
, u = s.toLowerCase();
if (l.target.hasAttribute(s)) {
var r = l.target.getAttribute(s);
l.oldValue != r && (r = this.rewriteAttr(l.target, u, r || ""),
this._attrVisitor(l.target, u, r || ""),
null !== r && (b[k + ":" + u] = r))
} else
b[k + ":" + u] = null
}
} catch (w) {}
for (var x in g)
b = g[x],
(c = a.mirrorFor(b)) && c.id && this.diff(f, d, b, c.child, b.firstChild);
for (x in e)
b = e[x],
this.resizeRelatedWatchedElements(f, d, b)
}
;
h.prototype.diff = function(f, d, b, c, e) {
for (var g = []; c && e; ) {
var h = a.mirrorFor(e);
a.fsid(e) ? c.id == h.id ? (c = c.next,
e = e.nextSibling) : (g.push({
remove: c
}),
c = c.next) : (g.push({
insert: [b, e, c.node]
}),
e = e.nextSibling)
}
for (; c; c = c.next)
g.push({
remove: c
});
for (; e; e = e.nextSibling)
g.push({
insert: [b, e, null]
});
for (b = 0; b < g.length; b++)
c = g[b],
c.insert ? this.genInsert(f, d, c.insert[0], c.insert[1], c.insert[2]) : c.remove && this.genRemove(f, d, c.remove)
}
;
h.prototype.resizeRelatedWatchedElements = function(f, d, b) {
var c = a.mirrorFor(b);
if (c)
for (var c = [c], e = 0; c.length && 1E3 > ++e; ) {
var g = c.pop();
b = a.watchKind(g.node);
if (null != b)
this.addPlaceholderResize(f, d, g.node, b);
else if (g.watchedChildSet)
for (var h in g.watchedChildSet)
c.push(g.watchedChildSet[h])
}
else {
for (h = b; h && !a.fsid(h); )
h = h.parentNode;
h && (b = a.watchKind(h),
null != b && this.addPlaceholderResize(f, d, h, b))
}
}
;
h.prototype.addPlaceholderResize = function(f, d, b, c) {
try {
var e = b.getBoundingClientRect()
, g = Math.floor(e.width)
, h = Math.floor(e.height)
, l = a.fsid(b)
, k = this._watchedDims[l];
k && k.w == g && k.h == h || (c == a.WatchKindWatch ? (b = 0 != g && 0 != h,
(!!k && 0 != k.w && 0 != k.h) != b && d.push({
When: f,
Kind: a.EVENT_WATCHED_ELEM,
Args: [l, b]
})) : d.push({
When: f,
Kind: a.EVENT_PLACEHOLDER_SIZE,
Args: [l, g, h]
}),
this._watchedDims[l] = {
w: g,
h: h
})
} catch (p) {}
}
;
h.prototype.genInsert = function(f, d, b, c, e) {
var g = this;
if (b && a.isWatched(b))
return null;
var h = a.fsid(b) || -1
, l = a.fsid(e) || -1;
b = this._encoder.tokenizeNode(b, e, c, function(a) {
g._nodeVisitor(f, a)
}, function(a, b, c) {
g._attrVisitor(a, b, c)
});
0 < b.length && d.push({
When: f,
Kind: a.EVENT_MUT_INSERT,
Args: [h, l, this._lz.encode(b)]
})
}
;
h.prototype.genRemove = function(f, d, b) {
var c = b.id;
a.removeMirror(b);
if (0 < d.length && (b = d[d.length - 1],
b.Kind == a.EVENT_MUT_REMOVE)) {
b.Args.push(c);
return
}
d.push({
When: f,
Kind: a.EVENT_MUT_REMOVE,
Args: [c]
})
}
;
h.prototype.rewriteAttr = function(f, d, b) {
return a.isWatched(f) ? a.rewriteBlockedAttribute(f, d, b, this._watcher) : b
}
;
return h
}();
a.MutationWatcher = k
}
)(m || (m = {}));
(function(a) {
function k(a) {
a = String(a);
for (var b, c, e = 0, d = B, g = []; a.charAt(e | 0) || (d = "=",
e % 1); g.push(d.charAt(63 & b >> 8 - 8 * (e % 1)))) {
c = a.charCodeAt(e += 0.75);
if (255 < c)
throw new C("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
b = b << 8 | c
}
return g.join("")
}
var h = function() {
for (var a = [], b = 0; 23 > b; b++)
a.push("url()blo:@impot}; \t\n\r'\"".charCodeAt(b));
return a
}()
, f = h[0]
, d = h[1]
, b = h[2]
, c = h[3]
, e = h[4]
, g = h[5]
, b = h[6]
, n = h[7]
, l = h[8]
, m = h[9]
, p = h[10]
, q = h[11]
, t = h[12]
, n = h[13]
, s = h[15]
, u = h[16]
, r = h[18]
, w = h[19]
, x = h[20]
, D = h[21]
, H = h[22]
, z = [p, q, t, n, d, h[14], 0, d, b, c, 0, b, n, g, l, 0]
, v = {};
v[h[17]] = !0;
v[r] = !0;
v[w] = !0;
v[x] = !0;
v[D] = !0;
v[H] = !0;
for (var I in v)
v.hasOwnProperty(I);
var L = function() {
function a() {
this.reset()
}
a.prototype.getSubBlobs = function() {
for (var a = [], b = 0; b < this.subBlobs.length; b += 2)
a.push({
url: "blob:" + this.subBlobs[b],
isCss: this.subBlobs[b + 1]
});
return a
}
;
a.prototype.reset = function() {
this.hash = [2166136261, 2166136261, 2166136261, 2166136261];
this.state = 99;
this.subBlobs = [];
this.currentUrl = "";
this.urlIsCss = !1
}
;
a.prototype.write = function(a) {
for (var b = 0; b < a.length; b++) {
var c = b % 4;
this.hash[c] ^= a[b];
this.hash[c] += (this.hash[c] << 1) + (this.hash[c] << 4) + (this.hash[c] << 7) + (this.hash[c] << 8) + (this.hash[c] << 24)
}
}
;
a.prototype.writeAscii = function(a) {
for (var b = 0; b < a.length; b++) {
var c = b % 4;
this.hash[c] ^= a.charCodeAt(b);
this.hash[c] += (this.hash[c] << 1) + (this.hash[c] << 4) + (this.hash[c] << 7) + (this.hash[c] << 8) + (this.hash[c] << 24)
}
}
;
a.prototype.writeCss = function(a) {
for (var b = 0; b < a.length; b++) {
var c = a[b];
switch (this.state) {
case 99:
f == c ? this.state = 7 : m == c && (this.state = 0);
break;
case 10:
v[c] || (g == c ? this.state = 11 : (this.urlIsCss = !1,
this.state = 99));
break;
case 6:
this.urlIsCss = !0;
v[c] || (f == c ? this.state = 7 : g == c ? this.state = 11 : (this.urlIsCss = !1,
this.state = 99));
break;
case 15:
if (v[c] || e == c || s == c || u == c)
this.subBlobs.push(this.currentUrl, this.urlIsCss),
this.urlIsCss = !1,
this.currentUrl = "",
this.state = 99;
else {
this.currentUrl += String.fromCharCode(c);
continue
}
break;
default:
c == z[this.state] ? this.state++ : (this.urlIsCss = !1,
this.state = 99)
}
var d = b % 4;
this.hash[d] ^= c;
this.hash[d] += (this.hash[d] << 1) + (this.hash[d] << 4) + (this.hash[d] << 7) + (this.hash[d] << 8) + (this.hash[d] << 24)
}
}
;
a.prototype.sum = function() {
var a = ("00000000" + (this.hash[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (this.hash[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (this.hash[2] >>> 0).toString(16)).slice(-8) + ("00000000" + (this.hash[3] >>> 0).toString(16)).slice(-8);
return P(String.fromCharCode.apply(null, a.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")))
}
;
return a
}();
a._FSNV = L;
a.hashNonBlocking = function(b, c, e, d) {
void 0 === d && (d = new L);
return N(this, void 0, void 0, function() {
var g, f, h, l, n;
return O(this, function(k) {
switch (k.label) {
case 0:
g = e ? d.writeCss : d.write,
f = b.now(),
h = 0,
k.label = 1;
case 1:
return h < c.byteLength ? 50 < b.now() - f ? [4, a.wait(75)] : [3, 3] : [3, 5];
case 2:
k.sent(),
f = b.now(),
k.label = 3;
case 3:
l = Math.min(5096, c.byteLength - h),
n = new Uint8Array(c,h,l),
g.call(d, n),
k.label = 4;
case 4:
return h += 5096,
[3, 1];
case 5:
return [2, {
hash: d.sum(),
hasher: d
}]
}
})
})
}
;
var B = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
, C = function(a) {
function b() {
return null !== a && a.apply(this, arguments) || this
}
M(b, a);
return b
}(Error)
, P = window.btoa || k;
a._jsbtoa = k
}
)(m || (m = {}));
(function(a) {
function k(d) {
var b, c = new a.Promise(function(a) {
return b = a
}
);
if (!a.assert(a.prefix(d, "blob:"), 'Blob url must start with "blob:"'))
return b(null),
c;
var e = new XMLHttpRequest;
if ("string" != typeof e.responseType)
return b(null),
c;
e.open("GET", d);
e.responseType = "blob";
e.onerror = function() {
b(null)
}
;
e.onload = function() {
if (200 != e.status)
a.logIfDebug("Error loading blob resource " + d),
b(null);
else {
var c = e.response;
if (c.size > h)
a.logIfDebug("Size of blob resource " + d + " exceeds limit of " + h),
b(null);
else {
var f = new FileReader;
f.readAsArrayBuffer(c);
f.onload = function() {
b({
data: f.result,
contentType: c.type,
blob: c
})
}
}
}
}
;
e.send();
return c
}
var h = 2097152
, f = function() {
function d(b, c, e, d, f) {
void 0 === e && (e = new a.XHRPoster);
void 0 === d && (d = FormData);
void 0 === f && (f = a.RealTimeout);
this.ctx = b;
this.queue = c;
this.poster = e;
this.FormDataCtr = d;
this.Timeout = f;
this.started = {};
this.byUrl = {};
this.byHash = {};
this.batchReady = !1;
this.existsBatch = [];
this.host = a.gceHost(this.ctx.getHost())
}
d.prototype.init = function() {
this.main().catch(function(b) {
a.sendToBugsnag(b, "error")
})
}
;
d.prototype.main = function() {
return N(this, void 0, void 0, function() {
var b, c, e, d, f, h, k, p, q, m, s, u, r, w, x, D, H, z;
return O(this, function(v) {
switch (v.label) {
case 0:
return [4, this.getBatch()];
case 1:
b = v.sent();
c = a.stringify(a.map(b, function(a) {
return a.hash
}));
e = {};
for (d = 0; d < b.length; d++)
f = b[d],
e[f.hash] = f;
h = this.ctx.getOrgId();
k = "/rec/newResources?OrgId=" + h;
v.label = 2;
case 2:
return v.trys.push([2, 4, , 5]),
[4, this.poster.postPromise(this.ctx.getProtocol(), this.host, k, c)];
case 3:
return p = v.sent(),
[3, 5];
case 4:
return q = v.sent(),
a.logIfDebug("/rec/newResources failed with status " + q),
[3, 0];
case 5:
try {
m = JSON.parse(p)
} catch (I) {
return a.sendToBugsnag("Error parsing /rec/newResources response", "error"),
[3, 0]
}
s = 0;
u = m;
v.label = 6;
case 6:
if (!(s < u.length))
return [3, 11];
r = u[s];
w = e[r];
x = w.url;
D = w.blob;
H = w.childHashes;
if (null == D)
return a.sendToBugsnag("Tried to re-upload a resource", "warning"),
[3, 10];
z = new this.FormDataCtr;
z.append("orgId", h);
z.append("baseUrl", x);
z.append("fsnvHash", r);
z.append("childHashes", a.stringify(H));
z.append("contents", D, "blob");
w.blob = null;
v.label = 7;
case 7:
return v.trys.push([7, 9, , 10]),
[4, this.poster.postPromise(this.ctx.getProtocol(), this.host, "/rec/uploadResource", z)];
case 8:
return v.sent(),
[3, 10];
case 9:
return v.sent(),
a.logIfDebug("Server error uploading resource"),
[3, 10];
case 10:
return s++,
[3, 6];
case 11:
return [3, 0];
case 12:
return [2]
}
})
})
}
;
d.prototype.getBatch = function() {
var b = this, c, e = new a.Promise(function(a) {
return c = a
}
), d = function() {
b.popBatch = null;
b.batchReady = !1;
var a = b.existsBatch;
b.existsBatch = [];
c(a)
};
this.batchReady ? d() : this.popBatch = d;
return e
}
;
d.prototype.uploadBlob = function(b, c) {
void 0 === c && (c = !1);
return N(this, void 0, void 0, function() {
var d = this, g, f, h, k, p;
return O(this, function(m) {
switch (m.label) {
case 0:
if (0 != b.lastIndexOf("blob:", 0) || this.started[b])
return [2];
this.started[b] = !0;
return [4, this.hashResourceTree(b, c)];
case 1:
g = m.sent();
if (!g)
return [2];
f = 0 == this.existsBatch.length;
this.existsBatch.push(g);
h = 0;
for (k = a.values(g.childHashes); h < k.length; h++)
p = k[h],
this.existsBatch.push(this.byHash[p]);
f && new this.Timeout(function() {
d.batchReady = !0;
d.popBatch && d.popBatch()
}
);
return [2]
}
})
})
}
;
d.prototype.hashResourceTree = function(b, c) {
return N(this, void 0, void 0, function() {
var d, g, f, h, m, p, q, t, s, u, r;
return O(this, function(w) {
switch (w.label) {
case 0:
return this.byUrl[b] ? [2, this.byUrl[b]] : [4, k(b)];
case 1:
return (d = w.sent()) ? [4, a.hashNonBlocking(this.ctx, d.data, c)] : [2, null];
case 2:
g = w.sent().hasher,
f = {},
h = g.getSubBlobs(),
m = 0,
p = h,
w.label = 3;
case 3:
if (!(m < p.length))
return [3, 6];
q = p[m];
t = q.url;
s = q.isCss;
return [4, this.hashResourceTree(t, s)];
case 4:
u = w.sent();
if (!u)
return [3, 5];
f[t] = u.hash;
g.writeAscii(u.hash);
w.label = 5;
case 5:
return m++,
[3, 3];
case 6:
return r = {
url: b,
hash: g.sum(),
blob: d.blob,
contentType: d.contentType,
childHashes: f
},
this.byUrl[b] = r,
this.byHash[r.hash] = r,
this.queue.enqueue(a.EVENT_SYS_RESOURCEHASH, ["url", b, r.hash]),
[2, r]
}
})
})
}
;
return d
}();
a.ResourceUploader = f
}
)(m || (m = {}));
(function(a) {
var k = "navigationStart unloadEventStart unloadEventEnd redirectStart redirectEnd fetchStart domainLookupStart domainLookupEnd connectStart connectEnd secureConnectionStart requestStart responseStart responseEnd domLoading domInteractive domContentLoadedEventStart domContentLoadedEventEnd domComplete loadEventStart loadEventEnd".split(" ")
, h = "name startTime duration initiatorType redirectStart redirectEnd fetchStart domainLookupStart domainLookupEnd connectStart connectEnd secureConnectionStart requestStart responseStart responseEnd unloadEventStart unloadEventEnd domInteractive domContentLoadedEventStart domContentLoadedEventEnd domComplete loadEventStart loadEventEnd type redirectCount decodedBodySize encodedBodySize transferSize".split(" ")
, f = "name startTime duration initiatorType redirectStart redirectEnd fetchStart domainLookupStart domainLookupEnd connectStart connectEnd secureConnectionStart requestStart responseStart responseEnd decodedBodySize encodedBodySize transferSize".split(" ")
, d = ["name", "startTime", "duration"]
, b = ["jsHeapSizeLimit", "totalJSHeapSize", "usedJSHeapSize"]
, c = function() {
function c(b) {
this._queue = b;
this._memorySupported = this._getEntriesSupported = this._timingSupported = this._perfSupported = !1;
this._lastUsedJSHeapSize = this._lastPerfCount = 0;
window.performance && (this._perfSupported = !0,
"timing"in window.performance && (this._timingSupported = !0),
"getEntries"in window.performance && (this._getEntriesSupported = !0),
"memory"in window.performance && (this._memorySupported = !0),
this._queue.enqueue(a.EVENT_REC_FEAT_SUPPORTED, [a.RecFeaturePerformance, this._timingSupported, a.RecFeaturePerformanceEntries, this._getEntriesSupported, a.RecFeaturePerformanceMemory, this._memorySupported]),
this.checkMemory())
}
c.prototype.onLoad = function() {
this._timingSupported && this.recordTiming(performance.timing)
}
;
c.prototype.tick = function() {
this.checkForNewEntries();
this.checkMemory()
}
;
c.prototype.checkMemory = function() {
if (this._memorySupported) {
var c = performance.memory
, d = c.usedJSHeapSize - this._lastUsedJSHeapSize;
if (0 == this._lastUsedJSHeapSize || 0.2 < Math.abs(d / this._lastUsedJSHeapSize))
this.addPerfEvent(a.PerfEntryMemory, c, b),
this._lastUsedJSHeapSize = c.usedJSHeapSize
}
}
;
c.prototype.checkForNewEntries = function() {
if (this._perfSupported && this._getEntriesSupported) {
var a = performance.getEntries();
if (a.length > this._lastPerfCount) {
for (; this._lastPerfCount < a.length; this._lastPerfCount++) {
var b = a[this._lastPerfCount];
switch (b.entryType) {
case "navigation":
this.recordNavigation(b);
break;
case "resource":
this.recordResource(b);
break;
case "paint":
this.recordPaint(b);
break;
case "measure":
this.recordMeasure(b);
break;
case "mark":
this.recordMark(b)
}
}
this._lastPerfCount = a.length
}
}
}
;
c.prototype.recordTiming = function(b) {
this.addPerfEvent(a.PerfEntryTiming, b, k)
}
;
c.prototype.recordNavigation = function(b) {
this.addPerfEvent(a.PerfEntryNavigation, b, h)
}
;
c.prototype.recordResource = function(b) {
this.addPerfEvent(a.PerfEntryResource, b, f)
}
;
c.prototype.recordPaint = function(b) {
this.addPerfEvent(a.PerfEntryPaint, b, d)
}
;
c.prototype.recordMark = function(b) {
this.addPerfEvent(a.PerfEntryMark, b, d)
}
;
c.prototype.recordMeasure = function(b) {
this.addPerfEvent(a.PerfEntryMeasure, b, d)
}
;
c.prototype.addPerfEvent = function(b, c, d) {
b = [b];
for (var e = 0; e < d.length; e++) {
var f = c[d[e]];
void 0 !== f && (f = -1);
b.push(f)
}
this._queue.enqueue(a.EVENT_PERF_ENTRY, b)
}
;
return c
}();
a.PerfWatcher = c
}
)(m || (m = {}));
(function(a) {
function k(a, b) {
if (!a.firstChild)
return [a, b];
a = a.firstChild;
for (var c = 0; c < b - 1 && a.nextSibling; c++)
a = a.nextSibling;
return [a, 0]
}
function h(d, b, c) {
var e = a.tagName(d);
if (("img" == e || "embed" == e) && "src" == b || ("use" == e || "image" == e) && "href" == b || "object" == e && "data" == b)
return [[c], !1];
var g;
return "link" == e && "href" == b && (g = d.getAttribute("rel")) && -1 < g.indexOf("stylesheet") ? [[c], !0] : "srcset" != b || "img" != e && "source" != e ? [[], !1] : null != c.match(/^\s*$/) ? [[], !1] : [a.map(c.split(","), function(b) {
return a.trim(b).split(/\s+/)[0]
}), !1]
}
var f = function() {
function d(b, c, d, g, f) {
void 0 === f && (f = new a.ResourceUploader(b,c));
var l = this;
this._ctx = b;
this._queue = c;
this._watcher = d;
this._onFrameCreated = g;
this._resourceUploader = f;
this._clientHeight = this._clientWidth = this._curWindowScrollY = this._curWindowScrollX = -1;
this._curInnerWidth = 0;
this._curSelection = [];
this._scrollTimeouts = {};
this._uploadResources = this._quirks = !1;
this._listeners = new a.DomListeners;
this._initialized = !1;
this._wnd = b.getWindow();
this._doc = this._wnd.document;
this._loc = this._wnd.location;
this._hst = this._wnd.history;
this._quirks = "BackCompat" == this._doc.compatMode;
this._currentUrl = this._loc.href;
this._inputWatcher = new a.InputWatcher(function(a) {
l.addChangeElem(a)
}
,function(b) {
return !!a.fsid(b)
}
);
this._perfWatcher = new a.PerfWatcher(c);
this._mutWatcher = new a.MutationWatcher(b,d,function(a, b) {
l.visitNode(a, b)
}
,function(a, b, c) {
if (l._uploadResources)
for (c = h(a, b, c),
a = c[1],
b = 0,
c = c[0]; b < c.length; b++) {
var d = c[b];
0 == d.lastIndexOf("blob:", 0) && l._resourceUploader.uploadBlob(d, a)
}
}
)
}
d.prototype.watchEvents = function() {
var b = this;
this._mutWatcher.hookMutations();
this._inputWatcher.hookEvents();
this._listeners.add(this._wnd, "mousemove", !0, function(a) {
b.addMouseMove(a)
});
this._listeners.add(this._wnd, "mousedown", !0, function(a) {
b.addMouseDown(a)
});
this._listeners.add(this._wnd, "mouseup", !0, function(a) {
b.addMouseUp(a)
});
this._listeners.add(this._wnd, "keydown", !0, function(a) {
b.addKeyDown(a)
});
this._listeners.add(this._wnd, "keyup", !0, function(a) {
b.addKeyUp(a)
});
this._listeners.add(this._wnd, "click", !0, function(a) {
b.addClick(a)
});
this._listeners.add(this._wnd, "dblclick", !0, function(a) {
b.addDblClick(a)
});
this._listeners.add(this._wnd, "focus", !0, function(a) {
b.addFocus(a)
});
this._listeners.add(this._wnd, "blur", !0, function(a) {
b.addBlur(a)
});
this._listeners.add(this._wnd, "change", !0, function(a) {
b.addChange(a)
});
this._listeners.add(this._wnd, "touchstart", !0, function(c) {
b.addTouchEvent(c, a.EVENT_TOUCHSTART);
b.addWindowScroll()
});
this._listeners.add(this._wnd, "touchend", !0, function(c) {
b.addTouchEvent(c, a.EVENT_TOUCHEND);
b.addWindowScroll()
});
this._listeners.add(this._wnd, "touchmove", !0, function(c) {
b.addTouchEvent(c, a.EVENT_TOUCHMOVE);
b.addWindowScroll()
});
this._listeners.add(this._wnd, "touchcancel", !0, function(c) {
b.addTouchEvent(c, a.EVENT_TOUCHCANCEL)
});
this._listeners.add(this._wnd, "play", !0, function(c) {
b.addPlayPauseEvent(c, a.EVENT_PLAY)
});
this._listeners.add(this._wnd, "pause", !0, function(c) {
b.addPlayPauseEvent(c, a.EVENT_PAUSE)
});
this._listeners.add(this._wnd, "scroll", !1, function(a) {
b.addWindowScroll()
});
this._listeners.add(this._wnd, "resize", !1, function(a) {
b.addResize()
});
this._listeners.add(this._wnd, "submit", !1, function(a) {
b.addFormSubmit(a)
});
this._listeners.add(this._wnd, "focus", !1, function(a) {
b.addWindowFocus(a)
});
this._listeners.add(this._wnd, "blur", !1, function(a) {
b.addWindowBlur(a)
});
this._listeners.add(this._wnd, "popstate", !1, function() {
b.addNavigate()
});
this._listeners.add(this._wnd, "selectstart", !0, function(a) {
b.addSelection()
});
this._listeners.add(this._doc, "selectionchange", !0, function(a) {
b.addSelection()
});
this._hst.pushState && (this._pushHook = a.activateHook(this._hst, "pushState").afterSync(function() {
return b.addNavigate()
}),
this._replaceHook = a.activateHook(this._hst, "replaceState").afterSync(function() {
return b.addNavigate()
}));
this._initialized = !0
}
;
d.prototype.initResourceUploading = function() {
this._resourceUploader.init();
this._uploadResources = !0
}
;
d.prototype.onDomLoad = function() {
this.addDomLoaded();
this.addResize()
}
;
d.prototype.onLoad = function() {
this._perfWatcher.onLoad();
this.addLoad();
this.addResize()
}
;
d.prototype.bundleEvents = function() {
this._inputWatcher.tick();
this._perfWatcher.tick();
this.addWindowInnerWidth();
return this._mutWatcher.processMutations()
}
;
d.prototype.shutdown = function() {
this._initialized && (this._initialized = !1,
this._listeners.clear(),
this._pushHook && this._pushHook.disable(),
this._replaceHook && this._replaceHook.disable(),
this._inputWatcher.shutdown(),
this._mutWatcher.shutdown())
}
;
d.prototype.docElem = function() {
return this._doc.documentElement
}
;
d.prototype.visitNode = function(b, c) {
var d = this;
switch (c.nodeName) {
case "HTML":
this._docElScrollListener && this._listeners.remove(this._docElScrollListener);
this._docElScrollListener = this._listeners.add(c, "scroll", !0, function(a) {
d.addScroll(a)
});
break;
case "BODY":
this.addResize();
this.addWindowScroll();
a.initWindex(this._wnd);
setTimeout(function() {
return d.addSelection()
});
break;
case "INPUT":
case "TEXTAREA":
case "SELECT":
this._inputWatcher.addInput(c);
break;
case "FRAME":
case "IFRAME":
this._onFrameCreated(c);
break;
case "VIDEO":
case "AUDIO":
c.paused || this.addPlayPauseEventById(a.fsid(c), a.EVENT_PLAY)
}
}
;
d.prototype.addMouseMove = function(b) {
b = a.fsid(b.target) ? [b.clientX, b.clientY, a.fsid(b.target)] : [b.clientX, b.clientY];
this._queue.enqueue(a.EVENT_MOUSEMOVE, b)
}
;
d.prototype.addMouseDown = function(b) {
this._queue.enqueue(a.EVENT_MOUSEDOWN, [b.clientX, b.clientY])
}
;
d.prototype.addMouseUp = function(b) {
this._queue.enqueue(a.EVENT_MOUSEUP, [b.clientX, b.clientY])
}
;
d.prototype.addTouchEvent = function(a, c) {
if (void 0 !== a.changedTouches)
for (var d = 0; d < a.changedTouches.length; ++d) {
var g = a.changedTouches[d];
isNaN(parseInt(g.identifier)) && (g.identifier = 0);
this._queue.enqueue(c, [g.identifier, g.clientX, g.clientY])
}
}
;
d.prototype.addPlayPauseEvent = function(b, c) {
var d = a.fsid(b.target);
d && this.addPlayPauseEventById(d, c)
}
;
d.prototype.addPlayPauseEventById = function(a, c) {
this._queue.enqueue(c, [a])
}
;
d.prototype.addWindowFocus = function(b) {
this._queue.enqueue(a.EVENT_WINDOW_FOCUS, [])
}
;
d.prototype.addWindowBlur = function(b) {
this._queue.enqueue(a.EVENT_WINDOW_BLUR, [])
}
;
d.prototype.maybeAddValueChange = function() {
var a = this._doc.activeElement;
if (a)
this._inputWatcher.onChange(a)
}
;
d.prototype.addKeyDown = function(b) {
var c = this._doc.activeElement;
if (!c || a.fsidIfNotBlocked(c))
this.maybeAddValueChange(),
this._queue.enqueue(a.EVENT_KEYDOWN, [b.keyCode])
}
;
d.prototype.addKeyUp = function(b) {
var c = this._doc.activeElement;
if (!c || a.fsidIfNotBlocked(c))
this.maybeAddValueChange(),
this._queue.enqueue(a.EVENT_KEYUP, [b.keyCode])
}
;
d.prototype.addWindowInnerWidth = function() {
var b = this._wnd.innerWidth;
b != this._curInnerWidth && (this._queue.enqueue(a.EVENT_INNERWIDTH, [b]),
this._curInnerWidth = b)
}
;
d.prototype.doWorkInScrollTimeout = function(b, c) {
var d = this;
b in this._scrollTimeouts || (this._scrollTimeouts[b] = c,
setTimeout(function() {
if (b in d._scrollTimeouts) {
var a = d._scrollTimeouts[b];
delete d._scrollTimeouts[b];
a()
}
}, a.ScrollSampleInterval))
}
;
d.prototype._fireScrollTimeouts = function() {
for (var a in this._scrollTimeouts)
this._scrollTimeouts[a](),
delete this._scrollTimeouts[a];
this._scrollTimeouts = []
}
;
d.prototype.addWindowScroll = function() {
var b = this
, c = a.fsid(this._doc.body);
c && this.doWorkInScrollTimeout(c, function() {
var d, g;
"pageXOffset"in b._wnd ? (d = b._wnd.pageXOffset,
g = b._wnd.pageYOffset) : (d = b._doc.body.scrollLeft,
g = b._doc.body.scrollTop);
if (d != b._curWindowScrollX || g != b._curWindowScrollY)
b._queue.enqueue(a.EVENT_SCROLL, [c, d, g]),
b._curWindowScrollX = d,
b._curWindowScrollY = g;
b.addWindowInnerWidth()
})
}
;
d.prototype.addScroll = function(b) {
var c = this
, d = b.target
, g = a.fsid(d);
g && this.doWorkInScrollTimeout(g, function() {
c._queue.enqueue(a.EVENT_SCROLL, [g, d.scrollLeft, d.scrollTop])
})
}
;
d.prototype.addResize = function() {
if (this._doc.body) {
var b, c;
this._quirks ? (b = this._doc.body.clientWidth,
c = this._doc.body.clientHeight) : (b = this.docElem().clientWidth,
c = this.docElem().clientHeight);
if (b != this._clientWidth || c != this._clientHeight)
this._clientWidth = b,
this._clientHeight = c,
b = Math.max(this._wnd.innerWidth || -1, this._clientWidth),
this.isMediaValue("width", b) || (b = this.findMediaValue("width", b, b + 128) || b),
c = Math.max(this._wnd.innerHeight, this._clientHeight),
this.isMediaValue("height", c) || (c = this.findMediaValue("height", c, c + 128) || c),
b == this._clientWidth && c == this._clientHeight ? this._queue.enqueue(a.EVENT_RESIZE, [this._clientWidth, this._clientHeight]) : this._queue.enqueue(a.EVENT_RESIZE, [this._clientWidth, this._clientHeight, b, c])
}
}
;
d.prototype.isMediaValue = function(a, c) {
if (!this._wnd.matchMedia)
return !0;
var d = this._wnd.matchMedia("(min-" + a + ": " + c + "px)");
if (!d)
return !0;
var g = this._wnd.matchMedia("(max-" + a + ": " + c + "px)");
return g ? d.matches && g.matches : !0
}
;
d.prototype.findMediaValue = function(a, c, d) {
if (!this._wnd.matchMedia)
return 0;
for (; c < d; ) {
var g = Math.floor((c + d) / 2);
if (this._wnd.matchMedia("(min-" + a + ": " + g + "px)").matches) {
if (this._wnd.matchMedia("(max-" + a + ": " + g + "px)").matches)
return g;
c = g + 1
} else
d = g - 1
}
return 0
}
;
d.prototype.addDomLoaded = function() {
this._queue.enqueue(a.EVENT_DOMLOADED, [])
}
;
d.prototype.addLoad = function() {
this._queue.enqueue(a.EVENT_LOAD, [])
}
;
d.prototype.addNavigate = function() {
var b = this._loc.href;
this._currentUrl != b && (this._currentUrl = b,
this._queue.enqueue(a.EVENT_NAVIGATE, [this._loc.href, this._doc.title]))
}
;
d.prototype.addClick = function(b) {
var c = b.target
, d = a.fsid(c);
if (d) {
var g = 0
, f = 0
, h = 0
, k = 0;
c && c.getBoundingClientRect && (c = c.getBoundingClientRect(),
g = c.left,
f = c.top,
h = c.width,
k = c.height);
this._queue.enqueue(a.EVENT_CLICK, [d, b.clientX, b.clientY, g, f, h, k])
}
}
;
d.prototype.addDblClick = function(b) {
(b = a.fsid(b.target)) && this._queue.enqueue(a.EVENT_DBL_CLICK, [b])
}
;
d.prototype.addFormSubmit = function(b) {
(b = a.fsid(b.target)) && this._queue.enqueue(a.EVENT_FORM_SUBMIT, [b])
}
;
d.prototype.addFocus = function(b) {
(b = a.fsid(b.target)) && this._queue.enqueue(a.EVENT_FOCUS, [b])
}
;
d.prototype.addBlur = function(b) {
(b = a.fsid(b.target)) && this._queue.enqueue(a.EVENT_BLUR, [b])
}
;
d.prototype.addChange = function(a) {
this._inputWatcher.onChange(a.target)
}
;
d.prototype.addChangeElem = function(b) {
var c = a.fsidIfNotBlocked(b);
c && this._queue.enqueue(a.EVENT_VALUECHANGE, [c, a.valueOfInputishElem(b)])
}
;
d.prototype.addSelection = function() {
for (var b = this.selectionArgs(), c = !1, d = 0; 4 > d; d++)
if (this._curSelection[d] !== b[d]) {
c = !0;
break
}
c && (this._curSelection = b,
this._queue.enqueue(a.EVENT_SELECT, b))
}
;
d.prototype.selectionArgs = function() {
if (!this._wnd.getSelection)
return [];
var b = this._wnd.getSelection();
if (!b || "None" == b.type)
return [];
if ("Caret" == b.type) {
var c = a.fsid(b.anchorNode);
return c ? [c, b.anchorOffset] : []
}
if (!b.anchorNode || !b.focusNode)
return [];
var d = k(b.anchorNode, b.anchorOffset)
, c = d[0]
, d = d[1]
, b = k(b.focusNode, b.focusOffset)
, g = b[0]
, f = b[1]
, g = (b = Boolean(c.compareDocumentPosition(g) & Node.DOCUMENT_POSITION_FOLLOWING)) ? [c, g] : [g, c]
, c = g[0]
, g = g[1]
, f = b ? [d, f] : [f, d]
, d = f[0]
, f = f[1];
for (a.fsid(c) || (d = 0); c && !a.fsid(c) && c != g; )
c = c.nextSibling || c.parentNode;
for (a.fsid(g) || (f = 0); g && !a.fsid(g) && g != c; )
g = g.previousSibling || g.parentNode;
if (c == g && d == f)
return [];
var h = a.fsid(c)
, m = a.fsid(g);
return c && g && h && m ? [h, d, m, f, b] : []
}
;
return d
}();
a.EventWatcher = f;
a.getResourceUrls = h
}
)(m || (m = {}));
(function(a) {
function k(b) {
try {
var c = a.parseJson(b);
if ("__fs"in c)
return c.__fs
} catch (d) {}
return []
}
function h(a) {
var b = a.src;
return !a.hasAttribute("src") || "about:blank" == b || 0 == b.indexOf("javascript:") || 0 == b.indexOf(f)
}
a.FS_REQUEST_FRAME_ID = "RequestFrameId";
a.FS_SET_FRAME_ID_CMD = "SetFrameId";
a.FS_IFRAME_EVENTS = "EvtBundle";
a.FS_SHUTDOWN_FRAME = "ShutdownFrame";
a.FS_RESTART_FRAME = "RestartFrame";
var f = location.protocol + "//" + location.host;
a.defaultInjector = function(b, c, f, h) {
a.logIfDebug("Injecting into Frame [" + b.src + "]");
try {
if (b.id == b.name && d.test(b.id))
a.logIfDebug("Blacklisted iframe: " + b.src);
else if (b.src && ("about:blank" != b.src && 0 > b.src.indexOf("javascript:")) && b.src != b.contentWindow.location.href)
a.logIfDebug("Frame not yet loaded: " + b.src);
else if (b.contentWindow[a.Namespace(b.contentWindow)])
a.logIfDebug("FS already defined in Frame contentWindow: " + b.src + ". Ignoring.");
else {
var k = b.contentWindow
, p = b.contentDocument;
k._fs_org = c;
k._fs_host = f;
k._fs_debug = a.isDebug();
k._fs_run_in_iframe = !0;
var m = p.createElement("script");
m.async = !0;
m.src = h + "//" + f + "/s/fs.js";
"testdrive" == c && (m.src += "?allowMoo=true");
p.head.appendChild(m)
}
} catch (t) {
a.logIfDebug("iFrame no injecty. Probably not same origin.")
}
}
;
var d = /^fb\d{18}$/, b;
(function(a) {
a[a.NoInfoYet = 1] = "NoInfoYet";
a[a.Enabled = 2] = "Enabled";
a[a.Disabled = 3] = "Disabled"
}
)(b = a.GetCurrentSessionEnabledState || (a.GetCurrentSessionEnabledState = {}));
var c = function() {
function c(d, e, f, h) {
var k = this;
this._ctx = d;
this._injector = h;
this._iFrames = [];
this._pendingChildFrameIdInits = [];
this._listeners = new a.DomListeners;
this._getCurrentSessionEnabled = b.NoInfoYet;
this._resourceUploadingEnabled = !1;
this._watcher = new a.Watcher;
this._transport = f(d, function() {
k.shutdown()
});
this._queue = new a.EventQueue(d,this._transport,function() {
return k._eventWatcher.bundleEvents()
}
,e);
this._eventWatcher = new a.EventWatcher(d,this._queue,this._watcher,function(a) {
k.onFrameCreated(a)
}
);
this._consoleWatcher = new a.ConsoleWatcher(this._queue,d.getWindow());
this._protocol = d.getProtocol();
this._host = d.getHost();
this._orgId = d.getOrgId();
this._identity = d.getIdentity();
this._wnd = d.getWindow()
}
c.prototype.start = function(b, c) {
var d = this;
this._onFullyStarted = c;
this._watcher.addPredicateRule({
Selector: function(b) {
var c = a.tagName(b);
if ("object" == c)
c = "data";
else if ("embed" == c)
c = "src";
else
return !1;
return !(I.IMAGE_FILENAME.test(b[c]) && (!b.type || 0 == b.type.lastIndexOf("image", 0)))
},
Kind: a.WatchKindNYI
});
this._watcher.addRule({
Selector: "canvas",
Kind: a.WatchKindNYI
});
this._watcher.addRule({
Selector: "noscript",
Kind: a.WatchKindBlocked
});
this._watcher.addRule({
Selector: ".fs-hide",
Kind: a.WatchKindHide
});
this._consoleWatcher.enable();
"onpagehide"in this._wnd ? this._listeners.add(this._wnd, "pagehide", !1, function(a) {
d._queue.addUnload()
}) : this._listeners.add(this._wnd, "unload", !1, function(a) {
d._queue.addUnload()
});
this._listeners.add(this._wnd, "message", !1, function(a) {
"string" == typeof a.data && d.postMessageReceived(a.source, k(a.data))
})
}
;
c.prototype.getCurrentSessionEnabled = function() {
return this._getCurrentSessionEnabled
}
;
c.prototype.queue = function() {
return this._queue
}
;
c.prototype.eventWatcher = function() {
return this._eventWatcher
}
;
c.prototype.console = function() {
return this._consoleWatcher
}
;
c.prototype.onDomLoad = function() {
this._eventWatcher.onDomLoad()
}
;
c.prototype.onLoad = function() {
this._eventWatcher.onLoad()
}
;
c.prototype.shutdown = function() {
this._queue.shutdown();
this._eventWatcher.shutdown();
this._consoleWatcher.disable();
this._listeners.clear();
this.tellAllFramesTo([a.FS_SHUTDOWN_FRAME])
}
;
c.prototype.tellAllFramesTo = function(b) {
for (var c = 0; c < this._iFrames.length; c++) {
var d = this._iFrames[c].contentWindow;
d && d.postMessage && d.postMessage(a.stringify({
__fs: b
}), "*")
}
}
;
c.prototype.fullyStarted = function() {
this._onFullyStarted()
}
;
c.prototype.enableResourceUploading = function() {
this._resourceUploadingEnabled = !0;
this._eventWatcher.initResourceUploading()
}
;
c.prototype.flushPendingChildFrameInits = function() {
if (0 < this._pendingChildFrameIdInits.length) {
for (var a = 0; a < this._pendingChildFrameIdInits.length; a++)
this._pendingChildFrameIdInits[a]();
this._pendingChildFrameIdInits = []
}
}
;
c.prototype.onFrameCreated = function(b) {
var c = this
, d = a.fsid(b);
if (d) {
this._iFrames.push(b);
var e = h(b)
, f = !e || b.contentWindow[a.Namespace(b.contentWindow)];
e && !f || !b.contentWindow.postMessage ? e ? (a.logIfDebug("Attempting to setup Frame [" + b.src + "]"),
this._injector(b, this._orgId, this._host, this._protocol),
b.addEventListener("load", function(d) {
a.logIfDebug("onload for frame [" + b.src + "]");
c._injector(b, c._orgId, c._host, c._protocol)
})) : a.logIfDebug("Frame Doesn't need injecting. Probably cross domain [" + b.src + "]") : (a.logIfDebug("Eagerly sending FrameId" + d + " to Frame [" + b.src + "]"),
this.sendFrameIdToInnerFrame(b.contentWindow, d))
} else
a.logIfDebug("fsid missing or invalid for iFrame." + b.src)
}
;
c.prototype.postMessageReceived = function(b, c) {
switch (c[0]) {
case a.FS_IFRAME_EVENTS:
var d = c[1];
0 < d.length && this._transport.enqueueEvents(d);
break;
case a.FS_REQUEST_FRAME_ID:
d = this.iFrameWndToFsId(b),
b && d ? (a.logIfDebug("Responding to FID request for frame " + d),
this.sendFrameIdToInnerFrame(b, d)) : a.logIfDebug("No FrameId found. Hoping to send one later.")
}
}
;
c.prototype.sendFrameIdToInnerFrame = function(b, c) {
var d = this
, e = function() {
var e = [];
0 != d._frameId && (e = d._parentIds ? d._parentIds.concat(d._frameId) : [d._frameId]);
e = [a.FS_SET_FRAME_ID_CMD, c, e, d._ctx.startTime(), d._watcher.rawRules, d._identity.cookieData(), d._pageId, d.getCurrentSessionEnabled(), d._resourceUploadingEnabled];
b && b.postMessage && b.postMessage(a.stringify({
__fs: e
}), "*")
};
null == this._frameId ? this._pendingChildFrameIdInits.push(e) : e()
}
;
c.prototype.iFrameWndToFsId = function(b) {
for (var c = 0; c < this._iFrames.length; c++)
if (this._iFrames[c].contentWindow == b)
return a.fsid(this._iFrames[c]);
a.logIfDebug("Unable to locate frame for window");
return NaN
}
;
return c
}();
a.AbstractRecorder = c;
a.parsePostMessageData = k
}
)(m || (m = {}));
(function(a) {
function k(f, d) {
return new a.HttpEventTransport(f,d)
}
var h = function(f) {
function d(b, c, d, g, h) {
void 0 === c && (c = a.RealTicker);
void 0 === d && (d = new a.XHRPoster);
void 0 === g && (g = k);
void 0 === h && (h = a.defaultInjector);
var l = f.call(this, b, c, g, h) || this;
l._poster = d;
l._domLoaded = !1;
l._doc = l._wnd.document;
l._frameId = 0;
l._getCurrentSessionEnabled = a.GetCurrentSessionEnabledState.NoInfoYet;
a.set_fs_shutdown(l._wnd, function(a) {
l._queue.shutdown();
a && (a = l._doc.getElementById(a)) && a.setAttribute("_fs_embed_token", l._embedToken)
});
return l
}
M(d, f);
d.prototype.onDomLoad = function() {
f.prototype.onDomLoad.call(this);
this._domLoaded = !0;
this.injectIntegrationScript()
}
;
d.prototype.start = function(b, c) {
var d = this;
f.prototype.start.call(this, b, c);
var g = this._doc.documentElement
, h = a._fs_replay_flags(this._wnd)
, l = a.tryGetScreenDims(this._wnd)
, k = l[0]
, l = l[1]
, m = "";
b || (m = this._identity.userId());
g = {
OrgId: this._identity.orgId(),
UserId: m,
Url: location.href,
Base: a.baseUri(this._doc),
Width: g.clientWidth,
Height: g.clientHeight,
ScreenWidth: k,
ScreenHeight: l,
Referrer: this._doc.referrer,
Doctype: a.doctypeString(this._doc),
CompiledTimestamp: a.CompiledTimestamp
};
h && (g.ReplayFlags = h);
this._poster.post(this._protocol, this._host, "/rec/page", a.stringify(g), function(b) {
var c;
try {
c = a.parseJson(b)
} catch (f) {
d.disableBecauseRecPageSaidSo();
return
}
d.handleResponse(c);
if (b = a._fs_ready(d._wnd))
try {
b()
} catch (g) {
a.logIfDebug("exception in _fs_ready(): " + g)
}
d._queue.enqueueFirst(a.EVENT_SET_FRAME_BASE, [a.baseUri(d._doc), a.doctypeString(d._doc)]);
d._queue.startPipeline(c.PageIntId);
d.fullyStarted()
}, function(a) {
d.disableBecauseRecPageSaidSo()
})
}
;
d.prototype.setIdsAndCookie = function(b) {
var c = this._identity;
c.setIds(this._wnd, b.CookieDomain, b.UserIntId, b.SessionIntId);
this._pageId = b.PageIntId;
this._embedToken = b.EmbedToken;
a.logIfDebug("/User," + c.userId() + "/Session," + c.sessionId() + "/Page," + b.PageIntId)
}
;
d.prototype.injectIntegrationScript = function() {
if (this._domLoaded && this._integrationScript) {
var b = this._doc.createElement("script");
a._fs_csp(this._wnd) ? b.src = this._protocol + this._host + "/rec/integrations?OrgId=" + this._orgId : b.text = this._integrationScript;
b.async = !0;
this._doc.head.appendChild(b)
}
}
;
d.prototype.handleResponse = function(b) {
this.setIdsAndCookie(b);
this._integrationScript = b.IntegrationScript;
this._getCurrentSessionEnabled = b.GetCurrentSessionEnabled ? a.GetCurrentSessionEnabledState.Enabled : a.GetCurrentSessionEnabledState.Disabled;
b.ResourceUploadingEnabled && this.enableResourceUploading();
this.injectIntegrationScript();
if (b.Blocks)
for (var c = 0; c < b.Blocks.length; ++c)
this._watcher.addRule(b.Blocks[c]);
if (b.Watches)
for (c = 0; c < b.Watches.length; ++c)
this._watcher.addRule(b.Watches[c])
}
;
d.prototype.disableBecauseRecPageSaidSo = function() {
this.shutdown();
a.logIfDebug("Disabling FS.");
var b = a._fs_ready(this._wnd);
if (b)
try {
b(!0)
} catch (c) {
a.logIfDebug("exception in _fs_ready(): " + c)
}
}
;
return d
}(a.AbstractRecorder);
a.TopRecorder = h
}
)(m || (m = {}));
(function(a) {
function k(f, d) {
return new a.PostMessageEventTransport(f.getWindow())
}
a.makeFrameTransport = k;
var h = function(f) {
function d(b, c, d, g, h) {
void 0 === c && (c = a.RealTicker);
void 0 === d && (d = new a.PostMessagePoster);
void 0 === g && (g = k);
void 0 === h && (h = a.defaultInjector);
b = f.call(this, b, c, g, h) || this;
b._messagePoster = d;
return b
}
M(d, f);
d.prototype.start = function(a, c) {
f.prototype.start.call(this, a, c);
this.sendRequestForFrameId()
}
;
d.prototype.postMessageReceived = function(b, c) {
f.prototype.postMessageReceived.call(this, b, c);
switch (c[0]) {
case a.FS_SET_FRAME_ID_CMD:
try {
this.setFrameIdFromOutside(c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8])
} catch (d) {
a.logIfDebug("Failed to parse frameId from message" + c)
}
}
}
;
d.prototype.sendRequestForFrameId = function() {
this._frameId || (0 == this._frameId ? a.logIfDebug("For some reason the outer window attempted to request a frameId") : this._wnd.parent ? (a.logIfDebug("Asking for a frame ID from within frame: " + location.href),
this._messagePoster.postMessage(this._wnd.parent, a.FS_REQUEST_FRAME_ID, [])) : a.logIfDebug("Orphaned window. Location href = " + location.href))
}
;
d.prototype.setFrameIdFromOutside = function(b, c, d, f, h, k, m, p) {
if (b)
if (this._frameId)
a.logIfDebug("frame Id is already set to " + this._frameId + ". Received second request to set it to " + b + " Iframe:" + location.href);
else {
a.logIfDebug("FrameId received within frame " + location.href + ": " + b);
this._identity.initFromParsedCookie(h);
this._getCurrentSessionEnabled = m || a.GetCurrentSessionEnabledState.NoInfoYet;
p && this.enableResourceUploading();
this._frameId = b;
this._parentIds = c;
for (h = 0; h < f.length; ++h)
this._watcher.addRule(f[h]);
this._queue.enqueueFirst(a.EVENT_SET_FRAME_BASE, [a.baseUri(this._wnd.document), a.doctypeString(this._wnd.document)]);
this._queue.rebaseIframe(d);
this._ctx.setStartTime(d);
this._pageId = k;
this._queue.startPipeline(k, b, c);
this.flushPendingChildFrameInits();
this.fullyStarted()
}
else
a.logIfDebug("Outer page gave us a bogus frame Id! Iframe: " + location.href)
}
;
return d
}(a.AbstractRecorder);
a.InnerRecorder = h
}
)(m || (m = {}));
(function(a) {
var k = function() {
function f() {}
f.prototype.createTopRecorder = function(d) {
return new a.TopRecorder(d)
}
;
f.prototype.createInnerRecorder = function(d) {
return new a.InnerRecorder(d)
}
;
return f
}();
a.DefaultRecorderMaker = k;
var h = function() {
function f(a, b) {
void 0 === a && (a = window);
void 0 === b && (b = new k);
this.wnd = a;
this.recMaker = b;
this.protocol = "https:";
this.domDoneLoaded = !1;
this._startTime = this.wallTime();
this.splitPending = this.waitingOnStart = !1;
this.reidentifyCount = 0
}
f.prototype.init = function() {
a.isLoaded(this.wnd) || (a.initWindex(this.wnd),
a.setLoaded(this.wnd, a.Namespace(this.wnd)),
this.initApi(),
this.start())
}
;
f.prototype.wallTime = function() {
return (new Date).getTime()
}
;
f.prototype.now = function() {
return this.wallTime() - this._startTime
}
;
f.prototype.startTime = function() {
return this._startTime
}
;
f.prototype.setStartTime = function(a) {
this._startTime = a
}
;
f.prototype.getHost = function() {
return this.host
}
;
f.prototype.getProtocol = function() {
return this.protocol
}
;
f.prototype.getOrgId = function() {
return this.orgId
}
;
f.prototype.getIdentity = function() {
return this.identity
}
;
f.prototype.getVars = function() {
return this.vars
}
;
f.prototype.getWindow = function() {
return this.wnd
}
;
f.prototype.getCurrentSessionURL = function(d) {
if (!this.recorder)
return null;
var b = this.recorder.getCurrentSessionEnabled();
if (b == a.GetCurrentSessionEnabledState.NoInfoYet)
return null;
var c;
c = this.identity.host();
c = a.isLocalhost(a.domainFromHost(c)) ? c : 0 == c.indexOf("www.") ? "app." + c.slice(4) : "app." + c;
if (b == a.GetCurrentSessionEnabledState.Disabled)
return this.protocol + "//" + c + "/opt/upgrade";
b = this.getCurrentSession();
if (!b)
return null;
d && (b += ":" + this.wallTime());
return this.protocol + "//" + c + "/ui/" + this.identity.orgId() + "/session/" + encodeURIComponent(b)
}
;
f.prototype.getCurrentSession = function() {
if (!this.recorder)
return null;
var d = this.recorder.getCurrentSessionEnabled();
return d != a.GetCurrentSessionEnabledState.NoInfoYet && d != a.GetCurrentSessionEnabledState.Disabled && this.identity.userId() ? this.identity.userId() + ":" + this.identity.sessionId() : null
}
;
f.prototype.enableConsole = function() {
this.recorder && this.recorder.console().enable()
}
;
f.prototype.disableConsole = function() {
this.recorder && this.recorder.console().disable()
}
;
f.prototype.log = function(a) {
for (var b = [], c = 1; c < arguments.length; c++)
b[c - 1] = arguments[c];
this.recorder && ("log" !== a && ("info" !== a && "warn" !== a && "error" !== a && "debug" !== a) && (b.unshift(a),
a = "log"),
this.recorder.console().addLog(a, b))
}
;
f.prototype.shutdown = function() {
this.recorder ? (this.recorder.shutdown(),
this.recorder = null) : a.logIfDebug("Recording already shut down.")
}
;
f.prototype.restart = function() {
this.recorder ? a.logIfDebug("Recording already started.") : this.createRecorder(!0)
}
;
f.prototype.splitPage = function(a) {
this.waitingOnStart ? this.splitPending = !0 : (this.shutdown(),
a && this.identity.clear(),
this.restart())
}
;
f.prototype._api = function(d, b) {
if (this.inFrame)
a.logIfDebug("API calls may only be made from the top-most frame");
else if (this.recorder) {
var c = this.vars.api(d, b)
, e = c[0];
if (c[1]) {
if (8 > this.reidentifyCount) {
this.reidentifyCount++;
a.FS_q_push(this.wnd, [d, b]);
this.splitPage(!0);
return
}
a.logIfDebug("reidentified too many times; giving up")
}
for (c = 0; c < e.length; c++)
this.recorder.queue().enqueue(e[c].Kind, e[c].Args)
} else
a.FS_q_push(this.wnd, [d, b])
}
;
f.prototype._cookies = function() {
return this.identity.cookies()
}
;
f.prototype._setCookie = function(a, b) {
return this.identity.setCookie(a, b)
}
;
f.prototype.initApi = function() {
var d = this.wnd[a.Namespace(this.wnd)];
d.getCurrentSessionURL = a.$entry(this.getCurrentSessionURL, this);
d.getCurrentSession = a.$entry(this.getCurrentSession, this);
d.enableConsole = a.$entry(this.enableConsole, this);
d.disableConsole = a.$entry(this.disableConsole, this);
d.log = a.$entry(this.log, this);
d.shutdown = a.$entry(this.shutdown, this);
d.restart = a.$entry(this.restart, this);
d._api = a.$entry(this._api, this);
d._cookies = a.$entry(this._cookies, this);
d._setCookie = a.$entry(this._setCookie, this)
}
;
f.prototype.start = function() {
var d = this;
a.initDebug(this.wnd);
a.logIfDebug("script version " + a.CompiledVersion + " (compiled at " + a.CompiledTimestamp + ")");
this.host = a._fs_host(this.wnd);
this.orgId = a._fs_org(this.wnd);
this.host ? this.orgId ? (a.logIfDebug("host: " + this.host),
a.logIfDebug("orgid: " + this.orgId),
"localhost:8080" == this.host && (this.protocol = "http:"),
this.identity = new a.Identity,
this.inFrame || (this.vars = new a.Vars(this.identity),
this.identity.initFromCookies(this.host, this.orgId)),
this.canRecord(this.orgId) ? (this.createRecorder().eventWatcher().watchEvents(),
this.hookLoadEvents(),
this.wnd.addEventListener("message", function(b) {
if ("string" == typeof b.data)
switch (a.parsePostMessageData(b.data)[0]) {
case a.FS_SHUTDOWN_FRAME:
d.shutdown();
break;
case a.FS_RESTART_FRAME:
d.restart()
}
})) : this.hailMary()) : a.logIfDebug("Missing global _fs_org. Recording disabled.") : a.logIfDebug("Missing global _fs_host. Recording disabled.")
}
;
f.prototype.createRecorder = function(d) {
var b = this;
this._startTime = this.wallTime();
var c, e;
if (this.inFrame)
this.recorder = this.recMaker.createInnerRecorder(this);
else {
this.recorder = this.recMaker.createTopRecorder(this);
e = this.drainApiQueue(a.FS_q_drain(this.wnd));
c = e[0];
e = e[1];
for (var f = 0; f < c.length; f++)
this.recorder.queue().enqueue(c[f].Kind, c[f].Args)
}
this.waitingOnStart = !0;
this.recorder.start(e, function() {
b.waitingOnStart = !1;
d && b.recorder && b.recorder.tellAllFramesTo([a.FS_RESTART_FRAME]);
b.splitPending && (b.splitPending = !1,
b.splitPage())
});
d && this.recorder.eventWatcher().watchEvents();
return this.recorder
}
;
f.prototype.drainApiQueue = function(a) {
if (!a)
return [[], !1];
for (var b = !1, c = [], e = 0; e < a.length; e++) {
var f = this.vars.api(a[e][0], a[e][1])
, h = f[0];
f[1] && (c = [],
b = !0);
c = c.concat(h)
}
return [c, b]
}
;
f.prototype.determineFrameness = function(d) {
var b = a._fs_transport(this.wnd);
a._fs_is_outer_script(this.wnd) ? this.inFrame = !1 : this.wnd != top ? this.inFrame = !0 : b ? b.init && b.init(d) && (this.inFrame = !0) : this.inFrame = !1
}
;
f.prototype.canRecord = function(d) {
this.determineFrameness(d);
return this.wnd.MutationEvent && this.wnd.postMessage ? !this.inFrame || a._fs_run_in_iframe(this.wnd) || a._fs_transport(this.wnd) ? !0 : (a.logIfDebug("Fullstory recording for this page is NOT allowed within an iFrame."),
!1) : (a.logIfDebug("missing required browser features"),
!1)
}
;
f.prototype.hailMary = function() {
var d = this
, b = document.documentElement
, c = a._fs_replay_flags(this.wnd);
a.logIfDebug("Unable to record playback stream.");
var e = document.createElement("script");
this.wnd.__fs_startResponse = function(a) {
a && d.identity.setIds(d.wnd, a.CookieDomain, a.UserIntId, a.SessionIntId);
document.head.removeChild(e)
}
;
e.src = "//" + this.host + "/rec/page?OrgId=" + this.orgId + "&UserId=" + this.identity.userId() + "&Url=" + encodeURIComponent(location.href) + "&Base=" + encodeURIComponent(a.baseUri(document)) + "&Width=" + b.clientWidth + "&Height=" + b.clientHeight + "&ScreenWidth=" + this.wnd.screen.width + "&ScreenHeight=" + this.wnd.screen.height + "&Referrer=" + encodeURIComponent(document.referrer) + "&Doctype=" + encodeURIComponent(a.doctypeString(document)) + "&CompiledTimestamp=" + a.CompiledTimestamp + "&Fallback=true" + (c ? "&ReplayFlags=" + c : "");
document.head.appendChild(e)
}
;
f.prototype.hookLoadEvents = function() {
var a = this
, b = function() {
a.domDoneLoaded || (a.domDoneLoaded = !0,
a.recorder && a.recorder.onDomLoad())
}
, c = !1
, e = function() {
c || (c = !0,
a.recorder && a.recorder.onLoad())
};
switch (document.readyState) {
case "interactive":
document.attachEvent || b();
break;
case "complete":
b(),
e()
}
this.domDoneLoaded || document.addEventListener("DOMContentLoaded", function(a) {
b()
});
c || this.wnd.addEventListener("load", function(a) {
b();
e()
})
}
;
return f
}();
a.GlobalContext = h
}
)(m || (m = {}));
try {
(new m.GlobalContext).init()
} catch (V) {
m.sendToBugsnag(V, "error"),
m._fs_debug(window) && window.console && console.log && console.log("Failed to initialize FullStory.")
}
}
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment