Skip to content

Instantly share code, notes, and snippets.

@englehardt
Created April 11, 2018 02:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save englehardt/4a7d140eec7371385fa98ad7bd61fe77 to your computer and use it in GitHub Desktop.
Save englehardt/4a7d140eec7371385fa98ad7bd61fe77 to your computer and use it in GitHub Desktop.
No boundaries: Social Integration Services -- OpenTag/Lytics (https://d3c3cq33003psk.cloudfront.net/opentag-54778-547608.js?_=1498652146672)
/*
* Opentag, a tag deployment platform
* Copyright 2011-2016, Qubit Group
* http://opentag.qubitproducts.com
*/
(function() {
var I = function() {
return this
}();
I.qubit = I.qubit || {};
I.qubit.SYSTEM_DEFAULTS = {
pingServerUrl: "opentag-stats.qubit.com/ping",
tellLoadTimesProbability: 1
}
})();
(function() {
var I = {
"id": "54778"
};
try {
var B = function() {
return this
}();
if (!B.qubit) B.qubit = {};
var G = B.qubit;
if (!G.cs) G.cs = {};
G.CLIENT_CONFIG = I;
var L = I.id || "efault";
L = "d" + L;
if (!G.cs[L]) G.cs[L] = {};
G.cs[L].ClientConfig = I;
if (G.SYSTEM_DEFAULTS) G.cs[L].SystemDefaults = G.SYSTEM_DEFAULTS
} catch (V) {}
})();
(function() {
(function() {
function I() {
return ha.uv
}
function B() {
var a = I();
if (!a || !a.emit) return false;
if (!da) {
da = true;
for (var q = 0; q < X.length; q++) {
var n = X[q];
if (n.on) a.on.apply(a, n.on);
else if (n.emit) a.emit.apply(a, n.emit)
}
a.on(/.*/, function(v) {
var h = v.meta.type;
var d = Y[h];
if (!d) Y[h] = {
current: v,
history: [v]
};
else {
d.current = v;
d.history.push(v)
}
}).replay();
Z = true
}
return true
}(function() {
if (!Function.prototype.bind) Function.prototype.bind = function(a) {
if (typeof this !== "function") throw new TypeError("Function.prototype.bind - what is trying " +
"to be bound is not callable");
var q = Array.prototype.slice.call(arguments, 1);
var n = this;
var v = function() {};
var h = function() {
return n.apply(this instanceof v ? this : a, q.concat(Array.prototype.slice.call(arguments)))
};
v.prototype = this.prototype;
h.prototype = new v;
return h
}
})();
var G = {
__anonymous__: true
};
var L = null;
try {
L = (false || eval)("this")
} catch (a) {}
if (!L) try {
var V = function() {
return this
};
L = V()
} catch (a) {}
G = L;
var A = G.qubit || {};
if (!G.qubit) G.qubit = A;
var ea = "3.1.1-r1";
if (A.VERSION && A.VERSION !== ea) try {
console.warn("There is already 'qubit.VERSION' set to: " +
A.VERSION)
} catch (a) {}
A.VERSION = ea;
try {
if (typeof module === "object") module.exports = G
} catch (a) {}
var O = function() {};
var fa;
(function() {
function a() {}
function q(h, d, m, e, k) {
var r = h.split(".");
var g = a.NAMESPACE_BASE || G;
var x = null;
var w = null;
var y;
if (k) g = L;
var C = g;
g = m || g;
for (y = 0; y < r.length - 1; y += 1) {
x = g;
w = r[y];
g[w] = g[w] || {};
g = g[w]
}
x = g;
w = r[r.length - 1];
if (L.TAGSDK_NS_OVERRIDE) e = false;
if (L.TAGSDK_NS_FORCED_OVERRIDE_OPTION !== undefined) e = !L.TAGSDK_NS_FORCED_OVERRIDE_OPTION;
if (d !== undefined) {
if (x[w] === undefined ||
!e) x[w] = d
} else x[w] = x[w] || {};
if (d) {
d.CLASSPATH = r.join(".");
r.splice(r.length - 1, 1);
d.PACKAGE_NAME = r.join(".")
}
return {
root: C,
object: x,
instance: x[w]
}
}
a.global = function() {
return L
};
a.STANDARD_CS_NS = "qubit.cs";
a.clientSpaceClasspath = function() {
if (window.qubit.CLIENT_CONFIG) return "qubit.cs.d" + window.qubit.CLIENT_CONFIG.id;
return a.STANDARD_CS_NS
};
a.globalNamespace = function(h, d, m, e) {
return q(h, d, m, e, true)
};
a.namespace = function(h, d, m, e) {
return q(h, d, m, e, false)
};
a.clientNamespace = function(h, d, m, e) {
return a.namespace(a.clientSpaceClasspath() +
"." + h, d, m, e)
};
a.clazz = function(h, d, m, e, k) {
a.namespace(h, d, e, true);
if (typeof m === "function") {
d.SUPER = m;
d.superclass = m;
d.prototype = new m(k);
d.prototype.SUPER = m;
d.prototype.CLASS = d
}
var r = h.split(".");
if (d.prototype) {
d.prototype.CLASSPATH = r.join(".");
d.prototype.CLASS_NAME = r[r.length - 1];
r.splice(r.length - 1, 1);
d.prototype.PACKAGE_NAME = r.join(".")
} else {
d.CLASSPATH = r.join(".");
d.STATIC_NAME = r[r.length - 1];
r.splice(r.length - 1, 1);
d.PACKAGE_NAME = r.join(".")
}
return d
};
a.clazz("qubit.Define", a);
a.clientClazz =
function(h, d, m, e, k) {
return a.clazz(a.clientSpaceClasspath() + "." + h, d, m, e, k)
};
a.STANDARD_VS_NS = "qubit.vs";
a.vendorsSpaceClasspath = function(h) {
var d = A.VENDOR_SPACE_CP;
var m = d === undefined || d === null ? a.STANDARD_VS_NS : d;
if (h)
if (m) return m + "." + h;
else return h;
return m
};
var n = a.vendorsSpaceClasspath();
var v;
if (n) v = a.namespace(n, {}, null, true).instance;
else v = a.global();
a.getVendorSpace = function() {
return v
};
a.vendorNamespace = function(h, d, m, e) {
h = a.vendorsSpaceClasspath(h);
return a.namespace(h, d, m, e)
};
a.vendorClazz =
function(h, d, m, e, k) {
h = a.vendorsSpaceClasspath(h);
return a.clazz(h, d, m, e, k)
}
})();
(function() {
function a(h) {}
var q = "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "*!-#$\x26+()@" + "'%./:\x3c\x3e?[" + '"]^_`{|}~' + "\\" + ";\x3d";
var n = {};
for (var v = 0; v < q.length; v++) n[q.charAt(v)] = v;
A.Define.clazz("qubit.Cookie", a);
a.cookieAlphabet = q;
a.cookieAlphabetMap = n;
a.decode = function(h) {
return unescape(h)
};
a.encode = function(h) {
return escape(h)
};
a.set = function(h, d, m, e, k) {
var r;
if (m) {
var g = new Date;
g.setTime(g.getTime() + m * 24 * 60 * 60 * 1E3);
r = "; expires\x3d" + g.toGMTString()
} else r = "";
if (!k) {
h = a.encode(h);
d = a.encode(d)
}
var x = h + "\x3d" + d + r + "; path\x3d/;";
if (e) x += " domain\x3d" + e;
document.cookie = x
};
a.get = function(h, d) {
var m = h + "\x3d";
var e = document.cookie.split(";");
for (var k = 0; k < e.length; k++) {
for (var r = e[k]; r.charAt(0) === " ";) r = r.substring(1, r.length);
if (r.indexOf(m) === 0) {
var g = r.substring(m.length, r.length);
if (!d) g = a.decode(g);
return g
}
}
return null
};
a.getAllForName = function(h, d) {
if (!h) return [];
var m =
h + "\x3d";
var e = document.cookie.split(";");
var k = [];
for (var r = 0; r < e.length; r++) {
for (var g = e[r]; g.charAt(0) === " ";) g = g.substring(1, g.length);
if (g.indexOf(m) === 0) {
var x = g.substring(m.length, g.length);
if (d) x = a.decode(x);
k.push(x)
}
}
return k
};
a.getAll = function(h) {
var d = document.cookie.split(";");
var m = [];
for (var e = 0; e < d.length; e++) {
for (var k = d[e]; k.charAt(0) === " ";) k = k.substring(1, k.length);
var r = k.substring(0, k.indexOf("\x3d"));
var g = k.substring(r.length + 1, k.length);
if (h) g = a.decode(g);
m.push([r, g])
}
return m
};
a.rm = function(h, d) {
a.set(h, "", -1, d)
}
})();
(function() {
function a(b) {
return k.addToArrayIfNotExist(k.ANON_VARS, b)
}
function q(b) {
return b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1")
}
function n(b, f) {
var l = g.length;
for (var z = 0; z < l; z++)
if (b === g[z][0]) return g[z][1];
g[g.length] = [b, f];
return false
}
function v(b, f, l, z, D) {
var E = false;
var F = false;
var H = false;
var K = false;
var M = false;
var Q = false;
var R = false;
if (f) {
M = !!f.all;
E = M || f.nodes;
K = M || f.win;
F = M;
R = !!f.emptyForMaxDeep;
H = f.noFunctions && !M;
if (f.noOwn !== undefined) F = !!f.noOwn;
if (f.noFunctions !== undefined) H = !!f.noFunctions;
if (f.win !== undefined) K = !!f.win;
if (f.nodes !== undefined) E = !!f.nodes;
Q = !!f.copyReference
}
if (l !== undefined && !l) {
if (R) return;
return b
} else if (l !== undefined) l--;
if (!b || !(b instanceof Object)) return b;
if (!E) {
try {
if (b instanceof Node) return b
} catch (aa) {
if (b instanceof ActiveXObject && b.nodeType !== undefined) return b
}
if (b === document) return b
}
if (!K)
if (b === r) return b;
var N = b instanceof Array ? [] : {};
if (b instanceof Date) N = new Date(b);
if (!H && b instanceof Function) {
var U =
String(b).replace(/\s+/g, "");
if (U.indexOf("{[nativecode]}") + 14 === U.length) N = function() {
return b.apply(D || this, arguments)
};
else N = function() {
return b.apply(this, arguments)
}
}
if (z === undefined) {
g = [];
z = 0
}
var W = n(b, N);
if (W) return W;
var S;
if (N instanceof Array)
for (S = 0; S < b.length; S++)
if (b[S] === b[S]) N[N.length] = v(b[S], f, l, z + 1, b);
else N[N.length] = b[S];
else {
S = 0;
for (var T in b) {
if (F || b.hasOwnProperty(T))
if (b[T] === b[T]) N[T] = v(b[T], f, l, z + 1, b);
else N[T] = b[T];
S++
}
}
if (f.proto) N.prototype = v(b.prototype, f, l, z + 1, b);
if (Q) N.___copy_ref = b;
return N
}
function h(b, f) {
for (var l = 0; l < f && l < x.length; l++)
if (b === x[l]) return true;
return false
}
function d(b, f, l, z, D, E, F, H) {
l = l || {};
if (l.hasOwn === undefined) l.hasOwn = true;
if (l.objectsOnly && !(b instanceof Object)) return;
if (H !== undefined && !H) return;
else if (H !== undefined) H--;
if (!l || !l.nodes) try {
if (b instanceof Node) return
} catch (U) {
if (b instanceof ActiveXObject && b.nodeType !== undefined) return
}
if (b === r) return;
if (z === undefined) {
x = [];
z = 0
}
if (h(b, z)) return;
x[z] = b;
D = D || b;
if (D && E && D[E] !== D[E]) return;
var K = f(b, D, E, F);
if (K) return;
var M = 0;
var Q = "";
for (var R in b) {
if (!l.hasOwn || b.hasOwnProperty(R)) try {
var N = b[R];
if (l.track) Q = F ? F + "." + R : R;
d(N, f, l, z + 1, D, R, Q, H)
} catch (U) {}
M++
}
}
var m = A.Define;
var e = A.Cookie;
var k = function() {};
var r = m.global();
m.clazz("qubit.opentag.Utils", k);
k.global = m.global;
k.namespace = m.namespace;
k.clazz = m.clazz;
k.getObjectUsingPath = function(b, f) {
f = f || r;
var l = b.split(".");
for (var z = 0; z < l.length; z++)
if (f && l[z]) f = f[l[z]];
return f
};
k.getParentObject = function(b) {
var f = b.lastIndexOf(".");
var l = b.substring(0, f);
return k.getObjectUsingPath(l)
};
k.variableExists = function(b) {
return b !== undefined && b !== null
};
k.ANON_VARS = [];
k.getAnonymousAcessor = function(b) {
var f = k.indexInArray(b, k.ANON_VARS);
if (f === -1) f = a(b);
return "qubit.opentag.Utils.ANON_VARS[" + f + "]"
};
k.replaceAll = function(b, f, l) {
return b.replace(new RegExp(q(f), "g"), l)
};
k.secureText = function(b) {
if (typeof b !== "string") b += "";
b = b.replace(/</g, "\x26lt;");
b = b.replace(/>/g, "\x26gt;");
return b
};
k.getUrl = function() {
return document.location.href
};
k.getQueryParam = function(b) {
var f;
var l;
var z;
var D;
var E;
var F;
var H;
D = k.getUrl();
if (D.indexOf("?") > 0) {
F = D.substring(D.indexOf("?") + 1).split("\x26");
for (f = 0, l = F.length; f < l; f += 1) {
E = F[f];
if (E.indexOf("\x3d") > 0) {
H = E.split("\x3d");
if (H.length === 2 && H[0] === b) return H[1]
}
}
}
return null
};
k.getElementValue = function(b) {
var f = document.getElementById(b);
if (f) return f.textContent || f.innerText;
return null
};
var g = [];
k.objectCopy = function(b, f) {
f = f || {};
var l = v(b, f, f.maxDeep);
g = [];
return l
};
var x = [];
k.traverse = function(b,
f, l) {
var z;
d(b, f, l, z, z, z, z, l.maxDeep)
};
k.prepareQuotedString = function(b) {
if (typeof b === "string") return '"' + b.replace(/\"/g, '\\"') + '"';
else return b
};
k.expressionToFunction = function(b, f) {
f = f || "";
var l = "function (" + f + ") {" + b + "}";
return k.gevalAndReturn(l).result
};
k.defineWrappedClass = function(b, f, l, z, D) {
var E = function() {
if (D) return D.apply(this, arguments);
else return f.apply(this, arguments)
};
m.clazz(b, E, f, z);
for (var F in l)
if (l.hasOwnProperty(F) && F !== "CONSTRUCTOR") E.prototype[F] = l[F];
return E
};
k.copyAandAddFromB =
function(b, f, l) {
l = l || 8;
var z = this.objectCopy(b, {
maxDeep: l
});
for (var D in f)
if (f.hasOwnProperty(D)) z[D] = f[D];
return z
};
k.keys = function(b) {
if (b instanceof Object) {
if (Object.keys) return Object.keys(b);
var f = [];
for (var l in b)
if (b.hasOwnProperty(l)) f[f.length] = l;
return f
} else throw "keys() called on non-object!";
};
k.getSrcElement = function(b) {
var f;
b = b || window.event;
if (b.srcElement) f = b.srcElement;
else if (b.target) f = b.target;
return f
};
k.addToArrayIfNotExist = function(b, f, l) {
var z = 0;
for (var D = false; z < b.length; z +=
1) {
var E = l && l(b[z], f);
if (E || b[z] === f) {
D = true;
break
}
}
if (!D) {
b[b.length] = f;
z = -1
}
return z
};
k.indexInArray = function(b, f) {
var l = 0;
for (var z = false; l < b.length; l++)
if (b[l] === f) {
z = true;
break
}
return z ? l : -1
};
k.removeFromArray = function(b, f) {
var l = 0;
for (var z = 0; l < b.length;)
if (b[l] === f) {
b.splice(l, 1);
z++
} else l++;
return z
};
k.addClass = function(b, f) {
var l;
try {
b.classList.add(f)
} catch (z) {
if (b.className === null) {
b.className = f;
return
}
l = b.className.split(" ");
k.addToArrayIfNotExist(l, f);
b.className = l.join(" ")
}
};
k.removeClass =
function(b, f) {
var l;
try {
b.classList.remove(f)
} catch (z) {
if (b.className === null) {
b.className = "";
return
}
l = b.className.split(" ");
k.removeFromArray(l, f);
b.className = l.join(" ")
}
};
var w = "try{this.qubitopentagutilsgevalandreturn__var_test__\x3d(";
var y = ");}catch(ex){" + "this.qubitopentagutilsgevalandreturn__var_test__error \x3d ex;}";
k.gevalAndReturn = function(b) {
var f = L;
f.qubitopentagutilsgevalandreturn__var_test__ = undefined;
f.qubitopentagutilsgevalandreturn__var_test__error = undefined;
b = w + b + y;
k.geval(b);
var l = f.qubitopentagutilsgevalandreturn__var_test__;
var z = f.qubitopentagutilsgevalandreturn__var_test__error;
try {
f.qubitopentagutilsgevalandreturn__var_test__ = fa;
f.qubitopentagutilsgevalandreturn__var_test__error = fa;
delete f.qubitopentagutilsgevalandreturn__var_test__;
delete f.qubitopentagutilsgevalandreturn__var_test__error
} catch (D) {}
return {
result: l,
error: z
}
};
k.trim = function(b) {
try {
return String(b).trim()
} catch (f) {
return String(b).replace(/^\s+|\s+$/g, "")
}
};
k.setIfUnset = function(b, f) {
if (b && f)
for (var l in f)
if (f.hasOwnProperty(l) &&
!b.hasOwnProperty(l)) b[l] = f[l]
};
k.overrideFromLeftToRight = function(b, f) {
if (b && f)
for (var l in f)
if (f.hasOwnProperty(l)) b[l] = f[l];
return b
};
k.geval = function(b) {
if (window && window.execScript) return window.execScript(b === "" ? " " : b);
else return function() {
return r["eval"].call(r, b)
}()
};
var C = [];
k.bodyAvailable = function(b) {
var f = !!document.body;
if (f) {
if (C) {
for (var l = 0; l < C.length; l++) try {
C[l]()
} catch (z) {}
C = false
}
b()
} else C.push(b)
};
k.rmCookiesMatching = function(b) {
var f = e.getAll();
for (var l = 0; l < f.length; l++) {
var z =
f[l][0];
if (z.match(b) === 0) e.rm(z)
}
};
var p = [];
var t = false;
var u = false;
k.bodyReady = function(b) {
if (u) {
if (b) b();
return true
}
t = t || !!(document.body && document.readyState === "complete");
if (t) {
u = true;
for (var f = 0; f < p.length; f++) try {
p[f]()
} catch (l) {}
if (b) b()
} else if (b) p.push(b);
return t
};
var c = r.onload;
r.onload = function(b) {
try {
k.bodyReady()
} catch (l) {
try {
window.qubit.opentag.Utils.bodyReady()
} catch (z) {}
}
var f = false;
try {
f = c
} catch (l) {}
if (f) f(b)
};
(function() {
var b;
var f = false;
var l = 1;
var z;
var D;
var E;
var F;
D = function(K) {
var M;
if (K === true) l -= 1;
if (!l || K !== true && !f) {
if (!document.body) return setTimeout(D, 1);
f = true;
if (K !== true) {
l -= 1;
if (l > 0) return
}
for (; z.length > 0;) {
M = z.shift();
M()
}
}
};
F = function() {
if (f) return;
try {
document.documentElement.doScroll("left")
} catch (K) {
setTimeout(F, 1);
return
}
D()
};
E = function() {
if (z) return;
z = [];
if (document.readyState === "complete") return setTimeout(D, 1);
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", b, false);
window.addEventListener("load", D, false)
} else if (document.attachEvent) {
document.attachEvent("onreadystatechange",
b);
window.attachEvent("onload", D);
var K = false;
try {
K = window.frameElement === null || window.frameElement === undefined
} catch (M) {}
if (document.documentElement.doScroll && K) F()
}
};
var H = function(K) {
E();
if (f) setTimeout(K, 1);
else z.push(K)
};
if (document.addEventListener) b = function() {
document.removeEventListener("DOMContentLoaded", b, false);
D()
};
else if (document.attachEvent) b = function() {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", b);
D()
}
};
H(function() {
t = true;
k.bodyReady()
})
})()
})();
(function() {
function a(w, y, C) {
this.collectLogs = !!a.isCollecting();
this.collectLocally = C;
this.collection = [];
this.getPrefix = function() {
var p = "";
if (y) {
if (typeof y === "function") p = y(this.ref);
else if (y.CLASS_NAME) p = y.CLASS_NAME;
else if (y.constructor && y.constructor.name) p = y.constructor.name;
if (p) p += " -\x3e "
}
return (w || "") + p
}
}
function q(w, y, C, p, t, u, c, b) {
var f;
var l = h >= b;
if (a.getCollectLevel() >= 0 || l) {
if (t) f = [p, c, C];
else f = [y + w.getPrefix() + p, u, C];
f[3] = b;
w.collect(f, b);
if (l) w.printMessage.apply(w, f)
}
}
var n =
A.Define;
var v = null;
n.clazz("qubit.opentag.Log", a);
a.LEVEL_FINEST = 4;
a.LEVEL_FINE = 3;
a.LEVEL_INFO = 2;
a.LEVEL_WARN = 1;
a.LEVEL_ERROR = 0;
a.LEVEL_NONE = -1;
a.MAX_LOG_LEN = 1E4;
a.prototype.MAX_LOG_LEN = -1;
var h = a.LEVEL_NONE;
var d = a.LEVEL_NONE;
var m = true;
a.setLevelFromCookie = function() {
var w = A.Cookie.get("qubit.opentag.Log.LEVEL");
if (w) {
w = +w;
if (!isNaN(w))
if (w > 0) {
var y = a.LEVEL_FINE;
a.setCollectLevel(w > y ? w : y);
a.setLevel(+w)
}
}
};
a.setCollecting = function(w) {
m = !!w
};
a.isCollecting = function() {
return m || a.COLLECT
};
a.setLevel =
function(w) {
h = +w
};
a.setCollectAndLevel = function(w) {
a.setLevel(w);
a.setCollectLevel(w)
};
a.getLevel = function() {
return h
};
a.setCollectLevel = function(w) {
d = +w
};
a.getCollectLevel = function() {
return d
};
var e = [];
a.logsCollection = e;
a.rePrintAll = function(w, y, C, p) {
var t = h;
if (w !== undefined) h = w;
try {
if (a.isCollecting()) {
try {
if (!C) v.clear()
} catch (f) {}
var u = p || a.logsCollection;
var c = 0;
for (var b = 0; b < u.length; b++)(function(f) {
var l = u[f];
var z = l[3];
if (z !== undefined && h >= z) {
c++;
if (!y) a.print.apply(a, l);
else A.opentag.Timed.setTimeout(function() {
if (w !==
undefined) h = w;
try {
a.print.apply(a, l)
} finally {
h = t
}
}, c * y)
}
})(b)
}
} catch (f) {} finally {
h = t
}
};
var k = n.global();
var r = !!(k.webkitMediaStream || k.webkitURL || k.mozContact);
a.isStyleSupported = function() {
return r
};
var g = {};
a.setConsole = function(w) {
v = w || g;
return v
};
a.delayPrint = -1;
var x = (new Date).valueOf();
a.prototype.printMessage = function(w, y, C, p) {
if (a.delayPrint > 0) {
var t = a.delayPrint;
var u = x - (new Date).valueOf();
if (u > 0) t += u;
try {
A.opentag.Timed.setTimeout(function() {
this.print(w, y, C, p)
}.bind(this), t)
} catch (c) {
setTimeout(function() {
this.print(w,
y, C, p)
}.bind(this), t)
}
x = (new Date).valueOf() + t
} else this.print(w, y, C, p)
};
a.prototype.print = function(w, y, C, p) {
a.print(w, y, C, p)
};
a.print = function(w, y, C, p) {
if (p !== undefined && h < p) return;
try {
if (v && v.log)
if (y && a.isStyleSupported())
if (C && v[C]) v[C]("%c" + w, y);
else v.log("%c" + w, y);
else if (C && v[C]) v[C](w);
else v.log(w)
} catch (t) {}
};
a.prototype.collect = function(w, y) {
if (y === undefined) y = a.getCollectLevel();
var C = false;
var p = this.collectLogs && a.isCollecting() && a.getCollectLevel() >= +y;
if (p) {
e.push(w);
C = true
}
if (this.collectLocally &&
p) {
this.collection.push(w);
C = true
}
if (a.MAX_LOG_LEN > 0)
if (e.length > a.MAX_LOG_LEN) e.splice(0, e.length - a.MAX_LOG_LEN);
if (a.MAX_LOG_LEN > 0 || this.MAX_LOG_LEN > 0) {
var t = a.MAX_LOG_LEN;
if (this.MAX_LOG_LEN > 0) t = this.MAX_LOG_LEN;
if (this.collection.length > t) this.collection.splice(0, this.collection.length - t)
}
return C ? w : null
};
a.clearAllLogs = function() {
try {
v.clear()
} catch (w) {} finally {
e.splice(0, e.length)
}
};
a.getCollectedByLevel = function(w, y) {
y = y || e;
var C = [];
for (var p = 0; p < y.length; p++) {
var t = y[p];
var u = t[0];
var c = u[4];
if (c === w) C.push(t)
}
return C
};
a.prototype.rePrint = function(w, y, C) {
a.rePrintAll(w, y, !C, this.collection)
};
a.prototype.FINEST = function(w, y) {
q(this, "FINEST: ", false, w, y, "color:#CCCCCC;", false, a.LEVEL_FINEST)
};
a.prototype.FINE = function(w, y) {
q(this, "FINE: ", false, w, y, "color:#999999;", false, a.LEVEL_FINE)
};
a.prototype.INFO = function(w, y, C) {
q(this, "INFO: ", "info", w, y, C, C, a.LEVEL_INFO)
};
a.prototype.WARN = function(w, y) {
q(this, "WARN: ", "warn", w, y, "color:#26A110;", false, a.LEVEL_WARN)
};
a.prototype.ERROR = function(w,
y) {
q(this, "ERROR: ", "error", w, y, "color:red;", false, a.LEVEL_ERROR)
};
a.setConsole(n.global().console);
a.setLevelFromCookie()
})();
(function() {
function a(n) {
if (n) {
this._rate = n.rate || 10;
this._smallestRate = -1;
if (n.start) this.startPooling();
this.config = n
}
this.inervals = [];
this._lck_obj = {};
this._binded_pool = this._pool.bind(this)
}
A.Define.clazz("qubit.opentag.Timer", a);
a.prototype.timers = [];
a.prototype.startPooling = function(n) {
if (n && this.config.dynamic)
if (this._smallestRate < 0 || this._smallestRate > n) this._smallestRate =
Math.min(Math.floor(n / 2), 1500);
if (!this.started) {
this.started = true;
setTimeout(this._binded_pool, 0)
}
};
a.prototype._pool = function() {
this.maxFrequent(function() {
var v = "";
if (this.config && this.config.name) v = "[" + this.config.name + "]"
}, 5E3, this._lck_obj);
this.callTimers();
if (this.timers.length !== 0) {
var n = this._smallestRate > this._rate ? this._smallestRate : this._rate;
setTimeout(this._binded_pool, n)
} else {
this.started = false;
this._smallestRate = -1
}
};
a.prototype.callTimers = function() {
this.lastCalled = (new Date).valueOf();
for (var n = 0; n < this.timers.length; n++) {
var v = this.timers[n];
var h = (new Date).valueOf();
if (h >= v.time) {
try {
v.execute()
} catch (d) {}
this.timers.splice(n, 1);
--n
}
}
};
a.prototype.cancellAll = function() {
this.timers = []
};
a.prototype.setRate = function(n) {
this._rate = n
};
a.prototype.maxFrequent = function(n, v, h) {
if (!h) {
n.__maxFrequent__timer_opentag_qubit_ = n.__maxFrequent__timer_opentag_qubit_ || {};
h = n.__maxFrequent__timer_opentag_qubit_
}
var d = h.____last__timed__max__frequent____;
if (!d || (new Date).valueOf() - d > v) {
d = (new Date).valueOf();
h.____last__timed__max__frequent____ = d;
n()
}
};
a.prototype.runIfNotScheduled = function(n, v, h) {
h = h || n;
if (h.__lastRun__ && (new Date).valueOf() < v + h.__lastRun__) return this.schedule(n, v, h);
else {
h.__lastRun__ = (new Date).valueOf();
n();
return true
}
};
a.prototype.schedule = function(n, v, h) {
if (h.___scheduled___) return false;
else {
h.___scheduled___ = (new Date).valueOf();
this.setTimeout(function() {
h.___scheduled___ = false;
h.__lastRun__ = (new Date).valueOf();
n()
}, v);
return true
}
};
var q = 1;
a.prototype.setTimeout = function(n,
v) {
var h = {
id: q++,
time: (new Date).valueOf() + +v,
execute: n
};
this.timers.push(h);
this.startPooling(v);
return h
};
a.prototype.setInterval = function(n, v) {
var h = setInterval(n, v);
this.inervals.push(h);
return h
}
})();
(function() {
A.Define.namespace("qubit.opentag.Timed", new A.opentag.Timer({
rate: 37,
dynamic: true
}));
var a = A.opentag.Timed;
a.tillTrue = function(q, n, v) {
var h = function() {
if (!q()) a.setTimeout(h, v || 33);
else n()
};
h()
}
})();
var J = {};
J.html = J.html || {};
J.html.fileLoader = {};
J.html.fileLoader.load = function(a,
q, n, v, h, d) {
var m;
var e;
var k;
var r;
var g;
g = false;
r = function(x) {
return function() {
if (!g) {
g = true;
if (x && !k) k = {
url: document.location.href
};
n(a, k, x)
}
}
};
try {
if (q) e = q(a)
} catch (x) {
e = false;
n(a, "Exception loading pre", true)
} finally {
if (e !== false) {
m = J.html.fileLoader.createScriptEl(a, h, false, d);
if (n) {
m.onload = r(false);
m.onerror = r(true);
m.onreadystatechange = function() {
if (this.readyState === "complete" || this.readyState === "loaded") setTimeout(function() {
r(false)()
}, 1)
}
}
if (!v) v = window.document.getElementsByTagName("head")[0];
v.appendChild(m)
}
}
};
J.html.fileLoader.createScriptEl = function(a, q, n, v) {
var h;
var d = document.createElement("script");
d.type = "text/javascript";
d.src = J.html.fileLoader.tidyUrl(a) + (n ? "?" + (new Date).getTime() : "");
if (q !== false) {
d.async = "true";
d.defer = "true"
} else {
d.async = "false";
if (d.async !== false) d.async = false;
d.defer = "false";
if (d.defer !== false) d.defer = false
}
for (h in v)
if (v.hasOwnProperty(h)) d.setAttribute(h, v[h]);
return d
};
J.html.fileLoader.tidyUrl = function(a) {
if (a.substring(0, 5) === "http:") return a;
if (a.substring(0,
6) === "https:") return a;
return "//" + a
};
(function() {
function a(h) {
this.log = new A.opentag.Log("", function() {
return this.CLASS_NAME + "[" + this.config.name + "]"
}.bind(this), "collectLogs");
this.config = {
order: 0,
include: true,
name: "Filter-" + n++,
script: undefined,
session: undefined
};
this.session = null;
if (h) {
for (var d in h)
if (h.hasOwnProperty(d)) this.config[d] = h[d];
if (h.session) this.setSession(h.session);
this.register(this)
}
}
var q = A.opentag.Utils;
var n = 0;
var v = [];
A.Define.clazz("qubit.opentag.filter.BaseFilter", a);
a.state = {
DISABLED: -3,
SESSION: -2,
PASS: -1,
FAIL: 0
};
a.prototype.reset = function() {
this.enable()
};
a.prototype.disable = function() {
this.config.disabled = true
};
a.prototype.enable = function() {
this.config.disabled = false
};
a.prototype.match = function() {
return true
};
a.prototype.setSession = function(h) {
this.session = h
};
a.prototype.getSession = function() {
return this.session
};
a.prototype.getState = function() {
var h = a.state.PASS;
if (this.config.disabled) return a.state.DISABLED;
if (this.config.script) h = this.config.script.call(this,
h);
if (isNaN(+h)) h = a.state.FAIL;
this.lastState = +h;
return h
};
a.getFilters = function() {
return v
};
a.prototype.register = function() {
a.register(this)
};
a.register = function(h) {
q.addToArrayIfNotExist(v, h)
}
})();
(function() {
var a = A.Define;
var q = {
CONTAINS: "CONTAINS",
MATCHES_EXACTLY: "MATCHES_EXACTLY",
STARTS_WITH: "STARTS_WITH",
ENDS_WITH: "ENDS_WITH",
REGULAR_EXPRESSION: "REGULAR_EXPRESSION",
ALL_URLS: "ALL_URLS"
};
a.namespace("qubit.opentag.filter.pattern.PatternType", q)
})();
(function() {
function a(d) {
this._lockObject = {};
var m = {
patternType: h.CONTAINS,
pattern: ""
};
if (d)
for (var e in d)
if (d.hasOwnProperty(e)) m[e] = d[e];
a.SUPER.call(this, m)
}
var q = A.opentag.Utils;
var n = A.opentag.filter.BaseFilter;
var v = A.opentag.Timed;
var h = A.opentag.filter.pattern.PatternType;
A.Define.clazz("qubit.opentag.filter.URLFilter", a, n);
a.prototype.PATTERNS = h;
a.prototype.getURL = function(d) {
return d || q.getUrl()
};
a.prototype.match = function(d) {
d = this.getURL(d);
var m = true;
var e = this.config.pattern;
switch (this.config.patternType) {
case h.CONTAINS:
m =
d.toLowerCase().indexOf(e.toLowerCase()) >= 0;
break;
case h.MATCHES_EXACTLY:
m = d.toLowerCase() === this.config.pattern.toLowerCase();
break;
case h.STARTS_WITH:
m = d.toLowerCase().indexOf(e.toLowerCase()) === 0;
break;
case h.ENDS_WITH:
m = d.lastIndexOf(e.toLowerCase()) + e.length === d.length;
break;
case h.REGULAR_EXPRESSION:
m = (new RegExp(e)).test(d);
break;
case h.ALL_URLS:
m = true;
break
}
return m
}
})();
(function() {
function a(d) {
var m = {};
if (d) {
for (var e in d)
if (d.hasOwnProperty(e)) {
if (e === "customStarter" && d[e]) this.customStarter =
d[e];
else if (e === "customScript" && d[e]) this.customScript = d[e];
m[e] = d[e]
}
this.uid = "f" + h++
}
this.tagsToRun = [];
a.SUPER.call(this, m)
}
var q = A.opentag.filter.BaseFilter;
var n = A.opentag.filter.URLFilter;
var v = A.opentag.Utils;
var h = 0;
A.Define.clazz("qubit.opentag.filter.Filter", a, n);
a.prototype.customStarter = function(d, m, e) {
m(false)
};
a.prototype.isSession = function() {
if (this.config.sessionDisabled) return false;
if (this.customStarter === null && this.customScript === null) return false;
return true
};
a.prototype.customScript =
function(d) {
return true
};
a.prototype.match = function(d) {
var m = true;
try {
if (this.customScript) {
if (this._matchState === undefined) this._matchState = !!this.customScript(this.getSession());
m = this._matchState
}
} catch (e) {
m = false
}
return m && a.SUPER.prototype.match.call(this, d)
};
a.prototype.runTag = function(d) {
v.addToArrayIfNotExist(this.tagsToRun, d);
if (!this.starterExecuted) {
if (!this._starterWasRun) {
this._starterWasRun = true;
var m = function(e) {
this.reRun = e;
this.starterExecuted = (new Date).valueOf();
this._processQueuedTagsToRun()
}.bind(this);
if (this.customStarter) this.customStarter(this.getSession(), m, d);
else a.prototype.customStarter.call(this, this.getSession(), m, d)
}
} else this._triggerTag(d)
};
a.prototype._processQueuedTagsToRun = function() {
for (var d = 0; d < this.tagsToRun.length; d++) {
var m = this.tagsToRun[d];
this._triggerTag(m)
}
};
a.prototype._triggerTag = function(d) {
if (this.reRun === true) d.run();
else d.runOnce()
};
a.prototype.getState = function(d) {
if (d) this.setSession(d);
var m = a.SUPER.prototype.getState.call(this);
if (m === q.state.DISABLED) return q.state.DISABLED;
if (m === q.state.PASS)
if (this.isSession()) m = q.state.SESSION;
if (this.config.script) m = this.config.script.call(this, m, this.getSession());
this.lastState = m;
return m
};
a.prototype.reset = function() {
this._matchState = undefined;
a.SUPER.prototype.reset.call(this);
this._starterWasRun = undefined;
this.starterExecuted = undefined;
this.tagsToRun = [];
this.reRun = undefined
}
})();
J.html.GlobalEval = {};
J.html.GlobalEval.globalEval = function(a) {
if (window.execScript) window.execScript(a === "" ? " " : a);
else {
var q = function() {
window["eval"].call(window,
a)
};
q()
}
};
J.html.HtmlInjector = {};
J.html.HtmlInjector.inject = function(a, q, n, v, h) {
var d;
var m;
var e;
var k;
var r;
var g;
var x;
if (n.toLowerCase().indexOf("\x3cscript") >= 0) {
e = document.createElement("div");
e.innerHTML = "a" + n;
k = e.getElementsByTagName("script");
r = [];
for (d = 0, m = k.length; d < m; d += 1) r.push(k[d]);
x = [];
for (d = 0, m = r.length; d < m; d += 1) {
g = r[d];
var w = {
attributes: J.html.HtmlInjector.getAttributes(g)
};
if (g.src) w.src = g.src;
else w.script = g.innerHTML;
x.push(w);
g.parentNode.removeChild(g)
}
if (e.innerHTML)
if (e.innerHTML.length >
0) e.innerHTML = e.innerHTML.substring(1);
J.html.HtmlInjector.doInject(a, q, e);
J.html.HtmlInjector.loadScripts(x, 0, v, a)
} else {
e = document.createElement("div");
e.innerHTML = n;
J.html.HtmlInjector.doInject(a, q, e);
if (v) v()
}
};
J.html.HtmlInjector.doInject = function(a, q, n) {
if (n.childNodes.length > 0) {
for (var v = document.createDocumentFragment(); n.childNodes.length > 0;) v.appendChild(n.removeChild(n.childNodes[0]));
if (q) J.html.HtmlInjector.injectAtStart(a, v);
else J.html.HtmlInjector.injectAtEnd(a, v)
}
};
J.html.HtmlInjector.injectAtStart =
function(a, q) {
if (a.childNodes.length === 0) a.appendChild(q);
else a.insertBefore(q, a.childNodes[0])
};
J.html.HtmlInjector.injectAtEnd = function(a, q, n) {
if (!n) n = 1;
if (a === document.body && document.readyState !== "complete" && n < 50) setTimeout(function() {
J.html.HtmlInjector.injectAtEnd(a, q, n + 1)
}, 100);
else a.appendChild(q)
};
J.html.HtmlInjector.loadScripts = function(a, q, n, v) {
var h;
var d;
var m = false;
for (h = a.length; q < h; q += 1) {
d = a[q];
if (d.src) {
m = true;
break
} else J.html.GlobalEval.globalEval(d.script)
}
if (m) J.html.fileLoader.load(d.src,
null,
function() {
J.html.HtmlInjector.loadScripts(a, q + 1, n, v)
}, v, false, d.attributes);
if (n && q === h) n()
};
J.html.HtmlInjector.getAttributes = function(a) {
var q;
var n;
var v;
var h;
var d;
var m = {};
if (a) {
v = a.attributes;
n = v.length;
for (q = 0; q < n; q++) {
h = v[q].value;
d = v[q].name.toLowerCase();
if (h !== "" && (d === "id" || d === "class" || d === "charset" || d.substr(0, 5) === "data-")) m[d] = h
}
return m
}
};
(function() {
function a() {
x = x || {
write: document.write,
writeln: document.writeln
}
}
function q() {
document.write = x.write;
document.writeln = x.writeln;
x = null
}
var n = A.opentag.filter.BaseFilter;
var v = A.opentag.Utils;
var h = J.html.HtmlInjector;
var d = J.html.fileLoader;
var m = A.opentag.filter.Filter;
var e = function() {};
A.Define.clazz("qubit.opentag.TagsUtils", e);
var k = false;
e.bodyLoaded = function() {
if (k) return true;
k = !!(document.body && document.readyState !== "loading");
return k
};
e.bodyAvailable = function(b) {
return !!document.body
};
var r = {};
var g = {
SUCCESS: "success",
FAIL: "failure",
INIT: "not started"
};
e.loadScript = function(b) {
var f = b.url;
var l = function(E, F, H) {
r[f].error =
F;
if (H) {
r[f].state = g.FAIL;
b.onerror()
} else {
r[f].state = g.SUCCESS;
b.onsuccess()
}
};
if (r[f]) {
if (b.noMultipleLoad) return l(f, r[f].error, r[f].state === g.FAIL);
r[f].count += 1
} else r[f] = {
count: 1,
state: null
};
var z = !b.async;
var D = e.bodyLoaded();
if (z && D);
z = z && !D;
if (z) e.writeScriptURL(f, function(E, F) {
l(f, F, !E)
});
else d.load(f, false, l, b.node, b.async)
};
var x = null;
e.redirectDocumentWritesToArray = function(b, f) {
var l = b;
a();
document.write = function(z) {
l.push(z)
};
document.writeln = function(z) {
l.push(z)
}
};
e.flushDocWritesArray =
function(b, f, l, z, D) {
var E = f;
if (E && b) {
var F = b.splice(0, b.length);
try {
e.injectHTML(E, l, F.join("\n"), D || O);
return true
} catch (K) {}
} else {
var H = "Flushing location not found!";
return false
}
if (D) D();
return true
};
e.unlockDocumentWrites = function() {
if (x) q()
};
var w = e.prototype.PACKAGE_NAME + ".TagsUtils._writeScriptURL_callbacks";
var y = {};
A.Define.namespace(w, y, L, true);
var C = 0;
var p = (new Date).valueOf();
e.writeScriptURL = function(b, f) {
var l = "_" + p + "_" + C++;
var z = w + "." + l;
var D = false;
y[l] = function(Q) {
if (D) return;
D =
true;
if (Q) f(false, "error while loading script " + b);
else f(true);
y[l] = undefined;
delete e.writeScriptURL.callbacks[l]
};
var E = 'if(this.readyState \x3d\x3d\x3d "loaded" || ' + 'this.readyState \x3d\x3d\x3d "complete"){ try {' + z + "(true)" + "} catch (ex) {}}";
var F = "try{" + z + "(false)}catch(ex){}";
var H = "try{" + z + "(true)}catch(ex){}";
var K = "scr";
var M;
b = d.tidyUrl(b);
M = "\x3c" + K + "ipt onload\x3d'" + F + "' onerror\x3d'" + H + "' onreadystatechange\x3d'" + E + "' type\x3d'text/javascript' " + " src\x3d'" + b + "'\x3e" + "\x3c/" + K + "ipt\x3e";
if (x) {
q();
document.write(M);
a()
} else document.write(M);
v.bodyReady(function() {
if (!D) {
D = true;
f(true)
}
})
};
e.writeScriptURL.callbacks = {};
var t = n.state.SESSION;
var u = n.state.PASS;
var c = n.state.FAIL;
e.filtersState = function(b, f, l, z) {
b = b.sort(function(aa, ia) {
try {
var ba = ia.config.order;
var ca = aa.config.order;
if (isNaN(-ca)) ca = 0;
if (isNaN(-ba)) ba = 0;
return ba - ca
} catch (ja) {
return 0
}
});
var D = u;
if (!b || b.length === 0) return D;
var E = null;
var F = false;
var H = false;
var K = 0;
var M;
var Q;
var R = [];
var N;
var U;
for (var W = 0; W <
b.length; W++) {
N = b[W];
N.setSession(f);
if (N.match()) {
M = N.getState();
if (M > 0) {
if (K === 0 || K > M) K = M
} else if (M === n.state.DISABLED) F = true;
else if (M === t) {
H = true;
E = N;
Q = N;
R.push(N)
} else E = N
} else U = N
}
var S = false;
if (E === null) {
S = true;
if (!F) D = c;
else D = u
} else if (E.config.include) D = M;
else D = M === u ? c : u;
if (K > 0 && (D === u || S)) D = K;
if (D === t || D === u && H) {
if (!Q.config.include) return c;
D = t;
if (Q instanceof m && Q.isSession())
if (z)
for (var T = 0; T < R.length; T++) try {
R[T].runTag(l)
} catch (aa) {}
}
if (l.config.dedupe && D === u)
if (U && U instanceof m &&
U.isSession()) {
l.sendDedupePing = true;
D = c
}
return D
};
e.injectHTML = function(b, f, l, z) {
return h.inject(b, !f ? 1 : 0, l, z || O)
};
e.getHTMLLocationForTag = function(b) {
var f;
var l = b.prepareLocationObject(b.config.locationObject);
switch (l) {
case "HEAD":
f = document.getElementsByTagName("head")[0];
break;
case "BODY":
f = document.body;
break;
default:
if (l) f = document.getElementById(l);
else f = document.body
}
return f
}
})();
(function() {
function a(e) {
this.config = {};
this.handlers = [];
this.parameters = null;
this.callHandlersOnRead = false;
if (e) {
this.uniqueId = "BV" + h++;
a.ALL_VARIABLES[this.uniqueId] = this;
for (var k in e)
if (e.hasOwnProperty(k)) {
this.config[k] = e[k];
if (k === "value") this.value = e.value
}
var r = a.register(this);
if (r && r !== this);
return r
}
}
function q() {
if (m) return false;
for (var e = 0; e < d.length; e++) try {
var k = d[e];
k.getValue()
} catch (r) {}
v.setTimeout(q, a.CHECK_POLL_RATE);
return true
}
var n = A.opentag.Utils;
var v = A.opentag.Timed;
var h = 0;
A.Define.clazz("qubit.opentag.pagevariable.BaseVariable", a);
a.ALL_VARIABLES = {};
var d = [];
a.OBSERVED_VARIABLES =
d;
a.pageVariables = [];
a.register = function(e) {
if (e instanceof a) {
for (var k = 0; k < a.pageVariables.length; k++) {
var r = a.pageVariables[k];
if (e === r) return r
}
a.pageVariables.push(e);
return e
}
return null
};
a.prototype.getValue = function() {
this._updateCurrentValue(this.value);
return this.currentValue
};
a.prototype._updateCurrentValue = function(e) {
if (!this.valuesAreEqual(e, this.currentValue)) {
this.oldValue = this.currentValue;
this.currentValue = e;
if (!m || this.callHandlersOnRead) this._handleValueChanged();
return true
}
return false
};
a.prototype.getDefaultValue = function() {
return this.defaultValue
};
a.prototype.setDefaultValue = function(e) {
this.defaultValue = e
};
a.prototype.exists = function(e) {
var k = n.variableExists(this.getValue());
if (e) k = k || n.variableExists(this.getDefaultValue());
return k
};
a.prototype.getRelativeValue = function(e, k) {
var r = this.getValue();
if (!n.variableExists(r)) r = k;
var g;
if (e && !n.variableExists(r)) {
g = this.getDefaultValue();
if (n.variableExists(g)) r = g
}
return r
};
a.prototype.replaceToken = function(e, k, r, g) {
var x = this.exists();
var w = x ? this.getValue() : r;
e = "\\$\\{" + e + "\\}";
if (g || w instanceof Array) {
var y;
if (x) y = this.getValueAccessorString();
else y = n.getAnonymousAcessor(w);
return k.replace(new RegExp(e, "g"), y)
} else return k.replace(new RegExp(e, "g"), w)
};
a.prototype.getAccessorString = function() {
return "qubit.opentag.pagevariable.BaseVariable.ALL_VARIABLES." + this.uniqueId
};
a.prototype.getValueAccessorString = function() {
return this.getAccessorString() + ".getValue()"
};
a.prototype.onValueChanged = function(e, k) {
if (n.addToArrayIfNotExist(this.handlers,
e) === -1);
if (k !== false) this.startObservingForChanges()
};
a.prototype.deatchOnValueChanged = function(e) {
if (n.removeFromArray(this.handlers, e) > 0);
};
a.prototype._handleValueChanged = function() {
var e = {
oldValue: this.oldValue,
newValue: this.currentValue,
variable: this
};
for (var k = 0; k < this.handlers.length; k++) try {
this.handlers[k](e)
} catch (r) {}
};
var m = true;
a.CHECK_POLL_RATE = 333;
a.prototype.startObservingForChanges = function() {
this.addToObservedVariables();
if (m) {
m = false;
q()
}
};
a.prototype.stopObservingForChanges = function() {
this.removeFromObservedVariables();
if (d.length === 0) m = true
};
a.prototype.addToObservedVariables = function() {
n.addToArrayIfNotExist(d, this)
};
a.prototype.removeFromObservedVariables = function() {
n.removeFromArray(d, this)
};
a.prototype.getObservedVariables = function() {
return d
};
a.prototype.valuesAreEqual = function(e, k) {
return e === k
}
})();
(function() {
function a(v) {
this._lockExprObject = {};
a.SUPER.apply(this, arguments)
}
var q = A.opentag.Utils;
var n = A.opentag.Timed;
A.Define.clazz("qubit.opentag.pagevariable.Expression", a, A.opentag.pagevariable.BaseVariable);
a.prototype.getValue = function() {
var v;
var h;
var d = this.value;
try {
if (d && d.indexOf("[#]") === -1) {
var m = q.gevalAndReturn(d);
v = m.result;
this.failMessage = null;
h = m.error
} else v = a.parseUVArray(d)
} catch (r) {
h = r
}
if (h) {
var e = "could not read value of expression: \n" + d + "\nexact cause: " + h;
if (this.failMessage !== e) this.failMessage = e;
v = null
}
var k = this._updateCurrentValue(v);
return v
};
a.parseUVArray = function(v) {
var h = v.split("[#]");
var d = q.gevalAndReturn(h[0]).result;
var m = [];
var e = h[1];
if (e.indexOf(".") === 0) e = e.replace(".",
"");
for (var k = 0; k < d.length; k++) {
var r = q.getObjectUsingPath(e, d[k]);
m.push(r)
}
return m
};
a.prototype.replaceToken = function(v, h, d, m) {
if (this.getValue() instanceof Array) m = true;
return a.SUPER.prototype.replaceToken.call(this, v, h, d, m)
}
})();
(function() {
function a(n) {
a.SUPER.apply(this, arguments)
}
var q = A.opentag.Utils;
A.Define.clazz("qubit.opentag.pagevariable.DOMText", a, A.opentag.pagevariable.BaseVariable);
a.prototype.getValue = function() {
var n = q.getElementValue(this.value);
this._updateCurrentValue(n);
return n
}
})();
(function() {
function a(q) {
a.SUPER.apply(this, arguments);
this._lockObject = {}
}
A.Define.clazz("qubit.opentag.pagevariable.Cookie", a, A.opentag.pagevariable.BaseVariable);
a.prototype.getValue = function() {
var q = A.Cookie.get(this.value);
this._updateCurrentValue(q);
return q
}
})();
(function() {
function a(n) {
a.SUPER.apply(this, arguments)
}
var q = A.opentag.Utils;
A.Define.clazz("qubit.opentag.pagevariable.URLQuery", a, A.opentag.pagevariable.BaseVariable);
a.prototype.getValue = function() {
var n = q.getQueryParam(this.value);
this._updateCurrentValue(n);
return n
}
})();
(function() {
function a() {}
function q(t, u) {
var c = [];
try {
var b = t.parameters;
if (b)
for (var f = 0; f < b.length; f++)
if (t.getVariableForParameter(b[f]) === u) c.push(b[f])
} catch (l) {}
return c
}
var n = A.opentag.Utils;
var v = A.opentag.TagsUtils;
var h = A.opentag.Timed;
var d = A.opentag.pagevariable.BaseVariable;
var m = A.opentag.pagevariable.Expression;
var e = A.opentag.pagevariable.UniversalVariable;
var k = A.opentag.pagevariable.DOMText;
var r = A.opentag.pagevariable.Cookie;
var g = A.opentag.pagevariable.URLQuery;
A.Define.clazz("qubit.opentag.TagHelper", a);
a.injectHTMLForLoader = function(t, u, c, b) {
var f = b !== undefined ? b : t.getHtml();
if (f) {
var l = t.config.locationPlaceHolder === "END";
var z = v.getHTMLLocationForTag(t);
t.injectHTMLNotFinished = true;
try {
if (z) v.injectHTML(z, l, f, function() {
t.injectHTMLNotFinished = false;
if (u) try {
u()
} catch (D) {}
}.bind(t));
else if (c && document.readyState === "loading") {
document.write(f);
t.injectHTMLNotFinished = false
} else t.injectHTMLFailed = (new Date).valueOf()
} catch (D) {
t.injectHTMLNotFinished =
false;
t.injectHTMLFailed = (new Date).valueOf()
}
}
};
a.getAllVariablesWithParameters = function(t) {
var u = t.getPageVariables();
var c = [];
for (var b = 0; b < u.length; b++) {
var f = u[b];
var l = q(t, f);
for (var z = 0; z < l.length; z++) c.push({
parameter: l[z],
variable: f
})
}
return c
};
var x = {};
a.allParameterVariablesReadyForTag = function(t, u) {
var c = u;
var b = true;
var f = t.getPageVariables();
for (var l = 0; l < f.length; l++) {
var z = f[l];
try {
var D = q(t, z);
var E = z.exists();
if (!E && c) {
if (D.length > 0) E = !!D[0].defaultValue;
E = E || z.exists(true)
}
if (!E) {
b =
false;
break
}
} catch (F) {
b = false;
break
}
}
return b
};
var w = "2";
var y = "3";
var C = "4";
var p = "5";
a.validateAndGetVariableForParameter = function(t) {
if (t.hasOwnProperty("variable") && t.variable) t.variable = a.initPageVariable(t.variable);
return t.variable
};
a.initPageVariable = function(t) {
if (!t || t instanceof d) return t;
if (typeof t === "string") {
var u = n.getObjectUsingPath(t);
if (u && u instanceof d) return u
}
switch (t.type) {
case w:
return new m(t);
case y:
return new g(t);
case C:
return new r(t);
case p:
return new k(t);
case "EPRESSION":
return new m(t);
case "URL_PARAMETER":
return new g(t);
case "COOKIE_VALUE":
return new r(t);
case "DOM_VALUE":
return new k(t);
default:
return new d(t)
}
}
})();
(function() {
function a(v) {
this.calls = {}
}
var q = A.Define;
var n = A.opentag.Utils;
a.prototype.on = function(v, h) {
if (!this.calls[v]) this.calls[v] = [];
return n.addToArrayIfNotExist(this.calls[v], h)
};
a.prototype.call = function(v, h) {
var d = this.calls[v];
if (d)
for (var m = 0; m < d.length; m++) try {
d[m](h)
} catch (e) {}
};
a.prototype.remove = function(v, h) {
if (this.calls[v]) return n.removeFromArray(this.calls[v],
h);
return null
};
a.prototype.removeAll = function(v) {
var h = 0;
for (var d in this.calls)
if (this.calls.hasOwnProperty(d)) h += n.removeFromArray(this.calls[d], v);
return h
};
a.prototype.clear = function() {
this.calls = {}
};
q.clazz("qubit.Events", a)
})();
(function() {
function a(g) {
this.log = new e("", function() {
return this.CLASS_NAME + "[" + this.config.name + "]"
}.bind(this), "collectLogs");
this.urlsLoaded = 0;
this.urlsFailed = 0;
this.runCounter = 0;
this.events = new A.Events({});
this._depLoadedHandler = function() {
if (this.dependenciesLoaded() &&
this.awaitingDependencies) this._triggerLoadingAndExecution()
}.bind(this);
this.config = {
name: "Tag-" + m++,
async: true,
usesDocumentWrite: false,
timeout: this.LOADING_TIMEOUT,
dependencies: [],
url: null,
urlLocation: null,
locationPlaceHolder: "END",
locationObject: null,
dontWaitForInjectionLocation: false,
noMultipleLoad: false,
loadDependenciesOnLoad: false
};
this.delayDocWrite = false;
this.dependencies = [];
this._lockObject = {
count: 0
};
this._lockObjectDepsLoaded = {};
this.genericDependencies = [];
if (g) {
if (!g.name) {
var x = "Tag-" +
m++;
this.config.name = x
}
this.addState("INITIAL");
for (var w in g) this.config[w] = g[w];
if (g.genericDependencies) this.genericDependencies = this.genericDependencies.concat(g.genericDependencies);
if (g.dependencies) this.dependencies = g.dependencies.concat(this.dependencies);
if (g.PACKAGE) this._package = g.PACKAGE;
this.onInit()
}
}
function q() {
if (this.cancelled) {
this._handleCancel();
return
}
this.waitForDependenciesFinished = (new Date).valueOf();
var g = this._fullBodyNeededAndUnLoaded();
var x = this._bodyNeededButNotAvailable();
if (g || x) this.waitForDependenciesFinished = false;
else {
if (!this.timeoutCountdownStart) this.timeoutCountdownStart = (new Date).valueOf();
if (this.allDependenciesLoaded()) this._markLoadedSuccesfuly();
else if (this._loadingOutOfTimeFrames()) {
this.loadingTimedOut = (new Date).valueOf();
if (this.allDependenciesLoaded(true)) this._markLoadedSuccesfuly();
else {
this.addState("TIMED_OUT");
this._markLoadingDependenciesFailed();
this._triggerOnLoadTimeout()
}
} else this.waitForDependenciesFinished = false
}
if (!this.waitForDependenciesFinished) this._setTimeout(q.bind(this),
65);
else this.addState("LOADED_DEPENDENCIES")
}
var n = A.opentag.Utils;
var v = A.opentag.TagsUtils;
var h = A.opentag.Timed;
var d = A.opentag.TagHelper;
var m = 0;
var e = A.opentag.Log;
var k = "after";
var r = "before";
A.Define.clazz("qubit.opentag.GenericLoader", a);
a.prototype.onInit = O;
a.prototype.LOADING_TIMEOUT = 5 * 1E3;
a.prototype.getHtml = function() {
if (this.config.html) return this.config.html;
if (this.htmlContent) return n.trim(this.htmlContent);
return null
};
a.prototype._executeScript = function() {
var g = false;
try {
this.script();
g = true
} catch (x) {
this.addState("EXECUTED_WITH_ERRORS");
this.executedWithErrors = (new Date).valueOf();
this._onError(x)
} finally {
this._onExecute(g)
}
};
a.prototype.getTimeout = function() {
return this._getTimeout()
};
a.prototype._getTimeout = function(g) {
var x = +this.config.timeout;
var w = this.dependencies;
if (x !== -1 && w.length > 0) {
var y = 0;
g = g || [];
var C = n.indexInArray(g, this) !== -1;
if (!C) {
g[g.length] = this;
for (var p = 0; p < w.length; p++) {
var t = w[p]._getTimeout(g);
if (t > y) y = t
}
if (y > 0) x += y
} else return 0
}
return x
};
a.prototype._onExecute =
function(g) {
this.onExecute(g)
};
a.prototype.onExecute = O;
a.prototype._flushDocWrites = function(g) {
var x = true;
this._docWriteNotFlushed = false;
try {
var w = v.getHTMLLocationForTag(this);
if (w && this._securedWrites && this._securedWrites.length > 0) {
var y = this.config.locationPlaceHolder === "END";
x = v.flushDocWritesArray(this._securedWrites, w, y, this.log, g);
if (x) this._docWriteFlushed = (new Date).valueOf();
else this._docWriteNotFlushed = (new Date).valueOf()
}
} catch (C) {
this._onError(C)
}
if (g) g();
if (this._securedWrites && this._securedWrites.length >
0) {
x = false;
this._docWriteNotFlushed = (new Date).valueOf()
}
return x
};
a.prototype.log = O;
a.prototype.finished = function() {
return !!this.runIsFinished
};
a.prototype.script = function() {};
a.prototype.before = function() {
this.beforeRun = (new Date).valueOf();
try {
this.events.call(r, this)
} catch (g) {
this._onError(g)
}
};
a.prototype.onBefore = function(g) {
this.events.on(r, g)
};
a.prototype.after = function(g) {
this.afterRun = (new Date).valueOf();
try {
this.events.call(k, {
success: g,
tag: this
})
} catch (x) {
this._onError(x)
}
};
a.prototype.onAfter =
function(g) {
this.events.on(k, g)
};
a.prototype.runOnce = function() {
if (!this._runOnceTriggered && !this.scriptExecuted) {
this._runOnceTriggered = (new Date).valueOf();
this.run()
}
};
a.CANCEL_ALL = false;
a.prototype.run = function() {
if (!isNaN(this.config.runningLimit))
if (this.config.runningLimit <= this.runCounter) return false;
if (this.cancelled || a.CANCEL_ALL) {
this._handleCancel();
return false
}
if (this.isRunning) return false;
if (this.lastRun) this.reset();
this.lastRun = this.isRunning = (new Date).valueOf();
this.runCounter++;
this._ignoreDeps = !!this.ignoreDependencies;
if (!this._ignoreDeps && !this.dependenciesLoaded()) {
this._attachDepsEventsToContinue();
return false
}
return this._triggerLoadingAndExecution()
};
a.prototype._triggerLoadingAndExecution = function() {
this.awaitingDependencies = -(new Date).valueOf();
this.load();
if (this._ignoreDeps) this.execute();
else this.waitForDependenciesAndExecute();
return true
};
a.prototype._attachDepsEventsToContinue = function() {
this.awaitingDependencies = (new Date).valueOf();
var g = this.dependencies;
for (var x = 0; x < g.length; x++) try {
g[x].events.on("success", this._depLoadedHandler)
} catch (w) {}
};
a.prototype.dependenciesLoaded = function() {
var g = this.dependencies;
for (var x = 0; x < g.length; x++)
if (g[x] !== this) {
var w = +g[x].scriptExecuted > 0;
if (!w) return false
}
return true
};
a.prototype._setTimeout = function(g, x) {
this._wasTimed = (new Date).valueOf();
return h.setTimeout(g, x)
};
a.prototype._handleCancel = function() {
this.addState("CANCELLED");
try {
this.onCancel()
} catch (g) {
this._onError(g)
}
};
a.prototype.waitForDependenciesAndExecute =
function() {
if (this.cancelled) {
this._handleCancel();
return
}
if (this.loadedDependencies) this.execute();
else if (this.loadingDependenciesFailed) {
this._markFailure();
this._markFinished()
} else this._setTimeout(this.waitForDependenciesAndExecute.bind(this), 30)
};
a.prototype.execute = function() {
this._triggerExecution()
};
a.prototype._triggerExecution = function() {
if (this.cancelled) {
this._handleCancel();
return
}
if (this.scriptExecuted) return;
var g = true;
if (this.shouldWaitForDocWriteProtection()) g = false;
else {
if (!this._beforeEntered) {
this._beforeEntered =
(new Date).valueOf();
var x = false;
try {
x = this.before()
} catch (y) {
this._onError(y)
}
if (x) {
this._markFailure();
this._markFinished();
return
}
}
g = this.loadExecutionURLsAndHTML(this._triggerExecution.bind(this))
}
if (this.scriptExecuted) return;
if (this.unexpectedFail) g = true;
if (!g) this._setTimeout(this._triggerExecution.bind(this), 30);
else {
this._flushDocWrites();
if (this.scriptLoadingFailed || this.injectHTMLFailed || this.unexpectedFail) this._markFailure();
else {
this.scriptExecuted = (new Date).valueOf();
this.addState("EXECUTED");
this._executeScript()
}
if (this.cancelled) {
this._handleCancel();
return false
} else {
var w = this.scriptExecuted > 0;
try {
if (!this.afterRun) {
this.afterRun = (new Date).valueOf();
this.after(w)
}
} catch (y) {
this.executedWithErrors = (new Date).valueOf()
}
if (!this.executedWithErrors)
if (w) this.events.call("success")
}
this._flushDocWrites();
this._markFinished()
}
};
a.prototype._markFailure = function() {
this.scriptExecuted = -(new Date).valueOf();
this.addState("FAILED_TO_EXECUTE")
};
a.prototype._markFinished = function() {
this.runIsFinished =
(new Date).valueOf();
this.isRunning = false;
if (a.LOCK_DOC_WRITE === this) {
this._flushDocWrites();
v.unlockDocumentWrites();
a.LOCK_DOC_WRITE = false
}
this.onFinished(true)
};
a.prototype.onFinished = O;
a.prototype.onCancel = O;
a.prototype.onFinished = O;
a.prototype.shouldWaitForDocWriteProtection = function() {
if (this.willSecureDocumentWrite())
if (!a.LOCK_DOC_WRITE) {
a.LOCK_DOC_WRITE = this;
this._secureWriteAndCollectForExecution()
} else if (a.LOCK_DOC_WRITE !== this) {
if (!this._lockedDocWriteInformed) this._lockedDocWriteInformed =
(new Date).valueOf();
return true
}
return false
};
a.prototype.runWithoutDependencies = function() {
this.ignoreDependencies = true;
this.run()
};
a.prototype.loadExecutionURLsAndHTML = function(g) {
if (this.cancelled) {
this._handleCancel();
return true
}
if (!this._loadExecutionURLsAndHTMLInformed) this._loadExecutionURLsAndHTMLInformed = true;
this._triggerURLsLoading(g);
if (!this.loadURLsNotFinished) {
this._flushDocWrites();
this._triggerHTMLInjection();
this._flushDocWrites();
if (!this.injectHTMLNotFinished) {
this._flushDocWrites();
if (!this._docWriteNotFlushed) {
if (this._docWriteFlushed);
return true
}
}
}
return false
};
a.prototype._triggerURLsLoading = function(g) {
if (!this._urlLoadTriggered && this.config.url) {
this._urlLoadTriggered = true;
this.loadURLs(false, g)
}
};
a.prototype._triggerHTMLInjection = function() {
if (!this._injectHTMLTriggered && this.getHtml()) {
this._injectHTMLTriggered = true;
this.injectHTML()
}
};
a.prototype.STATE = {
INITIAL: 0,
STARTED: 1,
LOADING_DEPENDENCIES: 2,
LOADED_DEPENDENCIES: 4,
LOADING_URL: 8,
LOADED_URL: 16,
EXECUTED: 32,
EXECUTED_WITH_ERRORS: 64,
FAILED_TO_LOAD_DEPENDENCIES: 128,
FAILED_TO_LOAD_URL: 256,
FAILED_TO_EXECUTE: 512,
TIMED_OUT: 1024,
UNEXPECTED_FAIL: 2048,
CANCELLED: 2048 * 2
};
a.prototype.addState = function(g) {
if (this.STATE.hasOwnProperty(g)) {
this.state = this.state | this.STATE[g];
try {
this.onStateChange(g)
} catch (x) {
this._onError(x)
}
}
};
a.prototype.onStateChange = O;
a.prototype.cancel = function() {
this.cancelled = (new Date).valueOf()
};
a.prototype.unCancel = function() {
this.cancelled = undefined
};
a.prototype.state = a.prototype.STATE.INITIAL;
a.prototype._markLoadedSuccesfuly =
function() {
this.loadedDependencies = (new Date).valueOf();
this.onAllDependenciesLoaded()
};
a.prototype._secureWriteAndCollectForExecution = function() {
if (!this._securedWrites) {
this._securedWrites = [];
v.redirectDocumentWritesToArray(this._securedWrites, this.log)
}
};
a.prototype._markLoadingDependenciesFailed = function() {
this.addState("FAILED_TO_LOAD_DEPENDENCIES");
this.loadingDependenciesFailed = (new Date).valueOf()
};
a.prototype.allDependenciesLoaded = function(g, x) {
return this.getDependenciesToBeLoaded(g, x).length ===
0
};
a.prototype.getDependenciesToBeLoaded = function(g, x) {
var w = x || [];
if (!this.injectionLocationReady()) w.push("injection location");
var y;
var C = this.dependencies;
for (y = 0; y < C.length; y++)
if (C[y] !== this) {
var p = +C[y].scriptExecuted > 0;
if (!p) {
var t = C[y].config ? C[y].config.name : "anonymous";
w.push("dependant Tag with name -\x3e " + t)
}
}
for (y = 0; y < this.genericDependencies.length; y++) {
var u = this.genericDependencies[y](this);
if (!u) w.push("this.genericDependencies[" + y + "] (index: " + y + ")")
}
if (w !== "");
return w
};
a.prototype.docWriteAsksToWaitForBody =
function() {
return !!(this.delayDocWrite && this.config.usesDocumentWrite)
};
a.prototype._bodyNeededButNotAvailable = function() {
if (this._dontWaitForInjections()) return false;
return this._isBodyLocationNeeded() && !v.bodyAvailable()
};
a.prototype._isBodyLocationNeeded = function() {
if (!this.isLoadingAsynchronously()) return false;
if (this._isBodyLocationSet()) return true;
else {
var g = this.config.locationObject === "HEAD";
return g && this.config.locationPlaceHolder === "END"
}
};
a.prototype._isBodyLocationSet = function() {
var g =
this.config.locationObject;
return !g || g === "BODY"
};
a.prototype._fullBodyNeededAndUnLoaded = function() {
if (this._dontWaitForInjections()) return false;
var g = false;
if (this._isBodyLocationNeeded()) g = this.config.locationPlaceHolder === "END";
g = g || (this.fullbodyNeeded || this.docWriteAsksToWaitForBody());
return g && !n.bodyReady()
};
a.prototype._dontWaitForInjections = function() {
return this.config.dontWaitForInjectionLocation || this.dontWaitForInjectionLocation || a.dontWaitForInjectionLocation
};
a.prototype.injectionLocationReady =
function() {
if (this._dontWaitForInjections()) return true;
if (this._fullBodyNeededAndUnLoaded()) return false;
if (!this.isLoadingAsynchronously()) return true;
return !!v.getHTMLLocationForTag(this)
};
a.prototype._loadingOutOfTimeFrames = function() {
if (this.getTimeout() < 0) return false;
return (new Date).valueOf() - this.timeoutCountdownStart > this.getTimeout()
};
a.prototype.loadDependencies = function() {
this._loadDependencies()
};
a.prototype.addClientDependenciesList = function(g, x) {
return this.addDependenciesList(g, A.Define.clientSpaceClasspath())
};
a.prototype.addDependenciesList = function(g, x) {
if (!g || g.length === 0) return;
if (!this.failedDependenciesToParse) this.failedDependenciesToParse = [];
var w = this.dependencies;
for (var y = 0; y < g.length; y++) {
var C = g[y];
var p = false;
if (C instanceof a) w.push(C);
else if (typeof C === "string") {
var t = C;
if (x) C = x + "." + C;
var u = n.getObjectUsingPath(C);
if (u)
if (u instanceof a) w.push(u);
else p = true;
else this.failedDependenciesToParse.push(t)
} else p = true;
if (p) {
this.badDepsObjects = this.badDepsObjects || [];
n.addToArrayIfNotExist(this.badDepsObjects,
C)
}
}
};
a.prototype._loadDependencies = function(g) {
g = g || [];
var x = this.dependencies;
var w = n.indexInArray(g, this) !== -1;
if (!w) {
g[g.length] = this;
for (var y = 0; y < x.length; y++) x[y].load(g)
}
};
a.prototype.onError = O;
a.prototype._onError = function(g) {
try {
this.onError(g)
} catch (x) {}
};
a.prototype._triggerOnLoadTimeout = function() {
this.onLoadTimeout()
};
a.prototype.onLoadTimeout = O;
a.prototype.onScriptsLoadSuccess = O;
a.prototype.onScriptLoadError = O;
a.prototype.onAllDependenciesLoaded = O;
a.prototype.onBeforeLoad = null;
a.prototype.load =
function() {
if (this.loadStarted) return;
else {
this.loadStarted = (new Date).valueOf();
try {
if (this.onBeforeLoad) this.onBeforeLoad()
} catch (g) {
this._onError(g)
}
}
this.addState("LOADING_DEPENDENCIES");
try {
if (!this._ignoreDeps && this.config.loadDependenciesOnLoad) this.loadDependencies()
} catch (g) {
throw g;
}
q.call(this)
};
a.prototype._singleUrlLoadHandler = function(g, x, w) {
++this.urlsLoaded;
if (!g) ++this.urlsFailed;
if (this.urlsLoaded === x.length) {
this.loadURLsNotFinished = false;
if (g && this.urlsFailed === 0) {
this.addState("LOADED_URL");
this.urlsLoaded = (new Date).valueOf();
try {
if (w) w(true)
} catch (C) {
this._onError(C)
} finally {
this.onScriptsLoadSuccess()
}
} else {
var y = "error loading urls. Failed " + this.urlsFailed;
this._onError(y);
this.addState("FAILED_TO_LOAD_URL");
this.urlsLoaded = -(new Date).valueOf();
try {
this.scriptLoadingFailed = true;
if (w) w(false)
} catch (C) {
this._onError(C)
} finally {
this.onScriptLoadError(y)
}
}
}
};
a.prototype.loadURLs = function(g, x) {
var w = g || this.config.url;
this.addState("LOADING_URL");
try {
if (w && !(w instanceof Array)) w = [w];
for (var y = 0; y < w.length; y++) {
this.loadURLsNotFinished = true;
var C = w[y];
C = this.prepareURL(C);
this.loadURL(C, function(p) {
this._singleUrlLoadHandler(p, w, x)
}.bind(this))
}
} catch (p) {
this.loadURLsNotFinished = false;
this.addState("UNEXPECTED_FAIL");
this.unexpectedFail = (new Date).valueOf();
this._onError(p)
}
};
a.prototype.prepareLocationObject = function(g) {
return g
};
a.prototype.prepareURL = function(g) {
return g
};
a.prototype.prepareHTML = function(g) {
return g
};
a.prototype.loadURL = function(g, x, w) {
var y = g;
this.addState("LOADING_URL");
v.loadScript({
onsuccess: function() {
try {
if (x) x(true)
} catch (C) {}
}.bind(this),
onerror: function() {
try {
if (x) x(false)
} catch (C) {}
}.bind(this),
url: y,
node: w || this.config.urlLocation,
async: this.isLoadingAsynchronously(),
noMultipleLoad: this.config.noMultipleLoad
})
};
a.prototype.reset = function() {
var g;
this._injectHTMLTriggered = g;
this._loadExecutionURLsAndHTMLInformed = g;
this._lockedDocWriteInformed = g;
this._runOnceTriggered = g;
this._urlLoadTriggered = g;
this.afterRun = g;
this.beforeRun = g;
this.filtersRunTriggered = g;
this.injectHTMLFailed =
g;
this.loadStarted = g;
this.loadURLsNotFinished = g;
this.loadedDependencies = g;
this.loadingDependenciesFailed = g;
this.loadingTimedOut = g;
this.runIsFinished = g;
this.scriptExecuted = g;
this.scriptLoadingFailed = g;
this.delayDocWrite = g;
this._securedWrites = g;
this.state = 0;
this.unexpectedFail = g;
this.urlsFailed = 0;
this.urlsLoaded = 0;
this.waitForDependenciesFinished = g;
this.isRunning = g;
this._lastRun = g;
this.cancelled = g;
this._beforeEntered = g;
this.awaitingDependencies = g;
this.timeoutCountdownStart = g;
this.addState("INITIAL")
};
a.prototype.isLoadingAsynchronously = function() {
if (this._wasTimed) return true;
return !!(this.config.async || this.forceAsynchronous)
};
a.prototype.willSecureDocumentWrite = function() {
return this.config.usesDocumentWrite && this.isLoadingAsynchronously()
};
a.prototype.injectHTML = function(g) {
var x = !this.docWriteAsksToWaitForBody();
var w = this.prepareHTML(this.getHtml());
if (w) d.injectHTMLForLoader(this, g, x, w)
};
a.prototype.clone = function() {
var g = new a(this.config);
return g
}
})();
(function() {
function a(c) {
var b = {
filterTimeout: c && c.filterTimeout || this.FILTER_WAIT_TIMEOUT,
PACKAGE: c && c.PACKAGE,
dedupe: false,
needsConsent: false,
inactive: false,
variables: null,
runner: null,
disabled: false,
locked: false,
reRunOnVariableChange: false
};
n.setIfUnset(c, b);
a.SUPER.apply(this, arguments);
this.namedVariables = {};
this.parameters = [];
this.filters = [];
this.session = null;
this.pingSent = false;
this.oldPingSent = false;
this.dedupePingSent = false;
this.oldDedupePingSent = false;
this.reRunCounter = 0;
if (c) {
this.addState("INITIAL");
try {
a.register(this)
} catch (f) {}
this.setupConfig(c);
this.uniqueRefString = null;
if (c.init) try {
c.init.call(this, c)
} catch (f) {}
this.onTagInit();
this.handleVariableChange = this._handleVariableChange.bind(this)
}
}
function q(c, b) {
var f = c.namedVariables;
var l = e.initPageVariable(f[b]);
f[b] = l;
return l
}
var n = A.opentag.Utils;
var v = A.opentag.TagsUtils;
var h = A.opentag.Timed;
var d = A.opentag.filter.BaseFilter;
var m = A.opentag.GenericLoader;
var e = A.opentag.TagHelper;
var k = A.opentag.pagevariable.BaseVariable;
var r = A.Cookie;
var g = A.Define;
g.clazz("qubit.opentag.BaseTag",
a, m);
a.prototype.setupConfig = function(c) {
if (!c) return;
if (c.filters) this.addFilters(c.filters);
if (c.parameters) this.addParameters(c.parameters);
if (c.variables)
for (var b in c.variables)
if (c.variables.hasOwnProperty(b)) {
var f = this.getParameterByTokenName(b);
if (f) {
var l = c.variables[b];
f.variable = l;
if (l.defaultValue !== undefined) f.defaultValue = l.defaultValue;
if (l.uv !== undefined) f.uv = l.uv
}
}
if (c.locked) this.lock()
};
a.prototype.valueForToken = function(c, b) {
var f = this.getParameterByTokenName(c);
if (f) {
if (b ===
undefined)
if (this.loadingTimedOut) b = true;
return this.getParameterValue(f, b)
}
var l = this.namedVariables;
if (l && l[c]) {
var z = q(this, c);
if (z) return z.getRelativeValue(b)
}
return undefined
};
a.prototype.addParameters = function(c) {
this.parameters = this.parameters.concat(c)
};
a.prototype.LOADING_TIMEOUT = 5 * 1E3;
a.prototype.FILTER_WAIT_TIMEOUT = -1;
a.prototype._isVariable = function(c) {
return c !== null && c !== undefined
};
a.prototype.run = function() {
if (this.destroyed) throw "Tag is destroyed.";
this.resolveAllDynamicData();
var c =
this.parameters;
if (c)
for (var b = 0; b < c.length; b++) {
var f = this.getVariableForParameter(c[b]);
if (!this._isVariable(f)) {
this._markLoadingDependenciesFailed();
this._markFinished();
return
}
}
if (this.config.runner) {
var l = false;
try {
this.addState("AWAITING_CALLBACK");
l = this._runner = (new Date).valueOf();
this.config.runner.call(this)
} catch (z) {}
return l
} else {
this._runner = false;
return this.start()
}
};
a.prototype.lock = function() {
this.locked = true;
this._unlock = null
};
a.prototype.unlock = function() {
this.locked = false;
if (this._unlock) {
this._unlock();
this._unlock = false
}
};
a.prototype.start = function() {
if (!this.locked) return a.SUPER.prototype.run.call(this);
else {
this._unlock = function() {
return a.SUPER.prototype.run.call(this)
}.bind(this);
return false
}
};
a.prototype.startOnce = function() {
if (!this.locked) return a.SUPER.prototype.runOnce.call(this);
else {
this._unlock = function() {
return a.SUPER.prototype.runOnce.call(this)
}.bind(this);
return false
}
};
a.prototype.getFilters = function() {
return this.filters
};
a.prototype.runOnceIfFiltersPass = function() {
if (!this._runOnceIfFiltersPassTriggered &&
!this.scriptExecuted) {
this._runOnceIfFiltersPassTriggered = (new Date).valueOf();
this.runIfFiltersPass()
}
};
a.prototype.runIfFiltersPass = function() {
if (this.destroyed) throw "Tag is destroyed.";
this.resolveAllDynamicData();
var c = this.filtersState(true);
this.addState("FILTER_ACTIVE");
if (!this.filtersRunTriggered) this.filtersRunTriggered = (new Date).valueOf();
if (c === d.state.SESSION) {
this.addState("AWAITING_CALLBACK");
this.awaitingCallback = (new Date).valueOf()
} else if (c === d.state.PASS) {
this.filtersPassed = (new Date).valueOf();
try {
this.onFiltersPassed()
} catch (f) {}
this.run()
} else if (c === d.state.FAIL) {
this._markFiltersFailed();
this._markFinished()
} else if (c > 0) {
var b = this.config.filterTimeout;
if (b < 0 || (new Date).valueOf() - this.filtersRunTriggered > b) {
if (!this._awaitingForFilterInformed) {
this._awaitingForFilterInformed = (new Date).valueOf();
try {
this.onFiltersDelayed()
} catch (f) {}
}
this._setTimeout(this.runIfFiltersPass.bind(this), c)
} else {
this._markFiltersFailed();
this._markFinished();
this.filtersRunTimedOut = (new Date).valueOf()
}
}
try {
this.onFiltersCheck(c)
} catch (f) {}
return c
};
a.prototype._markFiltersFailed = function() {
this.addState("FILTERS_FAILED");
this.filtersPassed = -(new Date).valueOf()
};
a.prototype.STATE = {
INITIAL: 0,
FILTER_ACTIVE: 1,
AWAITING_CALLBACK: 2,
FILTERS_FAILED: 4,
STARTED: 8,
LOADING_DEPENDENCIES: 16,
LOADED_DEPENDENCIES: 32,
LOADING_URL: 64,
LOADED_URL: 128,
EXECUTED: 256,
EXECUTED_WITH_ERRORS: 512,
FAILED_TO_LOAD_DEPENDENCIES: 1024,
FAILED_TO_LOAD_URL: 2048,
FAILED_TO_EXECUTE: 4096,
TIMED_OUT: 4096 * 2,
UNEXPECTED_FAIL: 4096 * 2 * 2,
CANCELLED: 4096 * 2 * 2 * 2
};
a.prototype.addState = function(c) {
a.SUPER.prototype.addState.call(this,
c);
try {
a.onStateChange(this)
} catch (z) {}
this.stateStack = [];
var b = this.STATE;
var f = this.state;
var l = this.stateStack;
if (f & b.INITIAL) l.push("Initial state.");
if (f & b.FILTER_ACTIVE) l.push("Tag running with filters pass triggered.");
if (f & b.FILTERS_FAILED) l.push("Filters failed to pass.");
if (f & b.AWAITING_CALLBACK) l.push("Awaiting callback to run this tag. Not pooling.");
if (f & b.STARTED) l.push("Tag is initialized and loading has been started.");
if (f & b.LOADING_DEPENDENCIES) l.push("Dependencies are being loaded.");
if (f & b.LOADED_DEPENDENCIES) l.push("Dependencies loading process has been finished.");
if (f & b.LOADING_URL) l.push("External URL is being loaded.");
if (f & b.LOADED_URL) l.push("External URL has been loaded.");
if (f & b.EXECUTED) l.push("Main script has been executed.");
if (f & b.EXECUTED_WITH_ERRORS) l.push("Main script has been executed but errors occured.");
if (f & b.FAILED_TO_LOAD_DEPENDENCIES) l.push("Dependencies has failed to load.");
if (f & b.FAILED_TO_LOAD_URL) l.push("URL location failed to load.");
if (f & b.FAILED_TO_EXECUTE) l.push("Script failed to execute.");
if (f & b.TIMED_OUT) l.push("Script timed out awaiting for dependencies.");
if (f & b.UNEXPECTED_FAIL) l.push("Script occured UNEXPECTED exception and is failed.");
if (f & b.CANCELLED) l.push("Tag has been cancelled.")
};
a.prototype.onTagInit = O;
a.onStateChange = O;
a.prototype.onFiltersDelayed = O;
a.prototype.onFiltersPassed = O;
a.prototype.onFiltersCheck = O;
a.prototype.state = a.prototype.STATE.INITIAL;
a.prototype.arePageVariablesLoaded = function(c) {
return e.allParameterVariablesReadyForTag(this, c)
};
a.prototype.getDependenciesToBeLoaded =
function(c, b) {
var f = b || [];
if (!this.arePageVariablesLoaded(c)) f.push("page variables");
return a.SUPER.prototype.getDependenciesToBeLoaded.call(this, c, f)
};
a.prototype.resolveAllDynamicData = function() {
this.resolvePageVariables();
this.resolveDependencies();
this.resolveFilters()
};
a.prototype.resolveDependencies = function() {
var c = this.failedDependenciesToParse;
if (c) {
this.failedDependenciesToParse = null;
this.addDependenciesList(c, g.clientSpaceClasspath())
}
return this.dependencies
};
a.prototype.addClientVariablesMap =
function(c) {
this.unresolvedClientVariablesMap = this._addVariablesMap(c, g.clientSpaceClasspath());
return this.unresolvedClientVariablesMap
};
a.prototype.resolvePageVariables = function() {
var c = this.unresolvedClientVariablesMap;
if (c) {
this.unresolvedClientVariablesMap = null;
this.addClientVariablesMap(c)
}
c = this.unresolvedVariablesMap;
if (c) {
this.unresolvedVariablesMap = null;
this.addVariablesMap(c)
}
return this.getPageVariables()
};
a.prototype.addVariablesMap = function(c) {
this.unresolvedVariablesMap = this._addVariablesMap(c);
return this.unresolvedVariablesMap
};
a.prototype._addVariablesMap = function(c, b) {
if (!c) return;
var f = {};
var l = this.namedVariables;
for (var z in c)
if (c.hasOwnProperty(z)) {
var D = c[z];
if (D instanceof k) l[z] = D;
else if (typeof D === "string") {
var E = D;
if (b) D = b + "." + D;
var F = n.getObjectUsingPath(D);
if (F)
if (F instanceof k) l[z] = F;
else l[z] = D;
else f[z] = E
} else;
}
return f
};
a.prototype.prepareURL = function(c) {
return this.replaceTokensWithValues(c)
};
a.prototype.prepareLocationObject = function(c) {
return this.replaceTokensWithValues(c)
};
a.prototype.prepareHTML = function(c) {
if (c) c = this.replaceTokensWithValues(c);
return c
};
a.prototype._executeScript = function() {
if (this.config && this.config.script)
if (typeof this.config.script === "function") this.script = this.config.script;
else {
var c = this.replaceTokensWithValues(String(this.config.script));
this.script = n.expressionToFunction(c).bind(this)
}
a.SUPER.prototype._executeScript.call(this)
};
a.prototype.replaceTokensWithValues = function(c) {
if (!c || c.indexOf("${") === -1) return c;
var b = this.parameters;
if (b)
for (var f =
0; f < b.length; f++) {
var l = b[f];
var z = this.getVariableForParameter(l);
if (z) {
var D = b[f].token;
var E = this.valueForToken(D);
c = z.replaceToken(D, c, E)
}
}
return c
};
a.prototype.getParameter = function(c) {
var b = this.parameters;
var f = null;
if (b)
for (var l = 0; l < b.length; l++)
if (b[l].name === c) f = b[l];
return f
};
a.prototype.setParameterValueByTokenName = function(c, b) {
var f = this.getParameterByTokenName(c);
if (f !== null) {
f.variable = {
value: b
};
return true
}
return false
};
a.prototype.getParameterValue = function(c, b) {
var f = typeof c ===
"string" ? this.getParameter(c) : c;
if (f) {
var l = this.getVariableForParameter(f);
if (l) try {
var z;
if (b && f.defaultValue !== "") z = n.gevalAndReturn(f.defaultValue).result;
z = l.getRelativeValue(b, z);
return z
} catch (D) {
return undefined
}
}
return undefined
};
a.prototype.filtersState = function(c) {
var b = c;
return v.filtersState(this.filters, this.session, this, b)
};
a.prototype.addFilter = function(c) {
n.addToArrayIfNotExist(this.filters, c)
};
a.prototype.addFilters = function(c) {
for (var b = 0; b < c.length; b++) this.addFilter(c[b])
};
a.prototype.addClientFiltersList =
function(c) {
this.unresolvedClientFilterClasspaths = this.addFiltersList(c, g.clientSpaceClasspath());
return this.unresolvedClientFilterClasspaths
};
a.prototype.resolveFilters = function() {
var c = this.unresolvedClientFilterClasspaths;
if (c) {
this.unresolvedClientFilterClasspaths = null;
this.addClientFiltersList(c)
}
return this.filters
};
a.prototype.addFiltersList = function(c, b) {
var f = [];
for (var l = 0; l < c.length; l++) try {
var z = c[l];
var D = z;
var E = null;
if (typeof z === "string") {
E = z;
if (b) z = b + "." + z;
z = n.getObjectUsingPath(z)
}
if (typeof z ===
"function") {
var F = z;
z = new F
}
if (!z);
if (!z instanceof d) z = null;
if (z) this.addFilter(z);
else if (E) n.addToArrayIfNotExist(f, E)
} catch (H) {
this.failedFilters = this.failedFilters || [];
this.failedFilters.push(c[l])
}
return f
};
a.prototype.reset = function() {
a.SUPER.prototype.reset.call(this);
var c;
this.filtersPassed = c;
this.dedupePingSent = false;
this.oldDedupePingSent = false;
this.pingSent = false;
this.oldPingSent = false;
this._runOnceIfFiltersPassTriggered = c;
this.filtersRunTriggered = c;
this._runner = c;
this.reRunCounter = 0;
this.detachVariablesChangedListeners()
};
a.prototype.resetFilters = function() {
for (var c = 0; c < this.filters.length; c++) this.filters[c].reset()
};
a.prototype.getParameterByTokenName = function(c) {
var b = null;
if (this.parameters) {
var f = this.parameters;
for (var l = 0; l < f.length; l++)
if (f[l].token === c) b = f[l]
}
return b
};
a.prototype.removeFilter = function(c) {
n.removeFromArray(this.filters, c)
};
var x = 0;
var w = [];
var y = {};
var C = {};
a.register = function(c) {
var b = n.addToArrayIfNotExist(w, c);
if (b === -1) c._tagIndex = w.length - 1;
else c._tagIndex =
b;
if (c.config.id) {
var f = "Q" + c.config.id;
C[f] = c;
c.uniqueId = f
} else C[c.CLASSPATH] = c
};
a.getById = function(c) {
return C[String(c)]
};
a.prototype.getById = a.getById;
a.prototype.unregister = function(c) {
a.unregister(c || this)
};
a.prototype.destroy = function() {
this.destroyed = true;
this.cancel();
a.unregister(this)
};
a.unregister = function(c) {
var b = n.removeFromArray(w, c);
c._tagIndex = -1
};
a.getTags = function() {
return w
};
a.getAccessorsMap = function() {
return y
};
a.prototype.getTags = function() {
return w
};
a.prototype.getPageVariables =
function() {
var c = this.parameters;
var b = [];
if (c)
for (var f = 0; f < c.length; f++) {
var l = this.getVariableForParameter(c[f]);
if (this._isVariable(l)) n.addToArrayIfNotExist(b, l)
}
if (this.namedVariables)
for (var z in this.namedVariables) n.addToArrayIfNotExist(b, q(this, z));
return b
};
a.prototype.getAccessorString = function() {
if (!this._accessorsMapKey) {
this._accessorsMapKey = "_" + x++;
y[this._accessorsMapKey] = this
}
return "qubit.opentag.BaseTag.getAccessorsMap()." + this._accessorsMapKey
};
a.prototype.getVariableForParameter =
function(c) {
var b;
var f = this.namedVariables;
if (f && f[c.token]) b = q(this, c.token);
if (!b) b = e.validateAndGetVariableForParameter(c);
return b
};
a.prototype.printVariablesState = function() {
var c = [];
var b = e.getAllVariablesWithParameters(this);
for (var f = 0; f < b.length; f++) {
var l = b[f].parameter;
var z = b[f].variable;
var D;
if (l && l.token) D = this.valueForToken(l.token);
else D = z.getRelativeValue(true);
var E = {
name: z.config.name,
exists: z.exists(),
token: l ? l.token : null,
value: D,
variable: z
};
c.push(E)
}
return c
};
a.prototype._triggerOnLoadTimeout =
function() {
this.onLoadTimeout()
};
a.prototype.getId = function() {
return this._getUniqueId()
};
a.prototype._getUniqueId = function() {
if (this.config.id) return this.config.id;
if (String(this.CLASSPATH).indexOf(g.STANDARD_CS_NS) === 0) return this.CLASSPATH.substring(g.STANDARD_CS_NS.length + 1);
else return this.CLASSPATH + "#" + this.config.name
};
var p = "qubit.tag.forceRunning_";
var t = "qubit.tag.disableRunning_";
var u = "qubit.tag.forceAllToRun";
a.prototype.cookieSaysToRunEvenIfDisabled = function() {
var c = this._getUniqueId();
var b = !!r.get(u);
if (!b) b = !!r.get(p + c);
return b
};
a.prototype.setCookieForcingTagToRun = function() {
var c = this._getUniqueId();
r.set(p + c, "true")
};
a.setCookieForcingTagsToRun = function() {
r.set(u, "true")
};
a.prototype.setCookieToDisable = function() {
var c = this._getUniqueId();
r.set(t + c, "true")
};
a.prototype.rmCookieToDisable = function() {
var c = this._getUniqueId();
r.rm(t + c)
};
a.prototype.disabledByCookie = function() {
var c = this._getUniqueId();
return !!r.get(t + c)
};
a.rmCookieForcingTagsToRun = function() {
r.rm(u)
};
a.prototype.rmCookieForcingTagToRun =
function() {
var c = this._getUniqueId();
r.rm(p + c)
};
a.rmAllDisablingCookies = function() {
n.rmCookiesMatching(t)
};
a.rmAllCookiesForcingTagToRun = function() {
n.rmCookiesMatching(p);
a.rmCookieForcingTagsToRun()
};
a.prototype.onVariableChanged = function(c) {
this.attachVariablesChangedListeners(true);
this.events.on("variableChanged", c)
};
a.prototype._handleVariableChange = function(c) {
this.events.call("variableChanged", c);
if (!this.isRunning && this.config.reRunOnVariableChange) {
if (!isNaN(this.config.reRunLimit))
if (this.config.reRunLimit <=
this.reRunCounter) return;
var b = this.reRunCounter + 1;
this.reset();
this.reRunCounter = b;
this.resetFilters();
this.runIfFiltersPass()
}
};
a.prototype.attachVariablesChangedListeners = function(c) {
var b = this.getPageVariables();
var f = !!(this.config.reRunOnVariableChange || this.config.observeVariables || c);
if (f)
for (var l = 0; l < b.length; l++) {
var z = b[l];
z.onValueChanged(this.handleVariableChange, f)
}
};
a.prototype.detachVariablesChangedListeners = function() {
var c = this.getPageVariables();
for (var b = 0; b < c.length; b++) {
var f =
c[b];
f.deatchOnValueChanged(this.handleVariableChange)
}
};
a.prototype._markFinished = function() {
a.SUPER.prototype._markFinished.call(this);
this.attachVariablesChangedListeners()
}
})();
(function() {
var a = A.opentag.Utils;
var q = A.opentag.filter.BaseFilter;
var n = function() {};
A.Define.clazz("qubit.opentag.Tags", n);
n.getById = function(h) {
return A.opentag.BaseTag.getById(String(h))
};
n.getAllTagsByState = function() {
return A.opentag.Container.getAllTagsByState(n.getTags())
};
n.findTagByName = function(h) {
var d = this.getTags();
var m = [];
for (var e = 0; e < d.length; e++)
if (d[e].config.name === h) m.push(d[e]);
return m
};
n.findTagByMatch = function(h) {
var d = this.getTags();
var m = [];
for (var e = 0; e < d.length; e++)
if (d[e].config.name.match(h)) m.push(d[e]);
return m
};
n.findTagContainers = function(h) {
var d = n.getContainers();
var m = [];
for (var e = 0; e < d.length; e++) {
var k = d[e].tags;
for (var r in k)
if (k[r] === h) {
m.push(d[e]);
break
}
}
return m
};
n.getTags = function() {
return A.opentag.BaseTag.getTags()
};
n.resetAllTags = function(h) {
var d = n.getTags();
for (var m = 0; m <
d.length; m++) {
d[m].reset();
if (!h) d[m].resetFilters()
}
};
n.getContainersPageVariables = function() {
var h = n.getContainers();
var d = [];
for (var m = 0; m < h.length; m++) d = d.concat(h.getPageVariables());
return d
};
n.getAllPageVariables = function() {
var h = n.getTags();
var d = [];
for (var m = 0; m < h.length; m++) d = d.concat(h[m].getPageVariables());
return d
};
n.cancelAll = function() {
var h = n.getTags();
for (var d = 0; d < h.length; d++) h[d].cancel()
};
n.resetAll = function(h) {
var d = n.getTags();
for (var m = 0; m < d.length; m++) {
d[m].reset();
if (!h) d[m].resetFilters()
}
};
n.getPageVariableByName = function(h) {
var d = n.getAllPageVariables();
var m = [];
for (var e = 0; e < d.length; e++)
if (d[e].config.name === h) m.push(d[e]);
return m
};
n.getLoadTime = function(h) {
var d = h.beforeRun;
var m = h.runIsFinished;
if (isNaN(m)) return {
tag: h,
loadTime: null
};
else return {
tag: h,
loadTime: m - d
}
};
n.getLoadTimes = function(h) {
var d = [];
if (h instanceof A.opentag.BaseTag) {
d.push([n.getLoadTime(h[k])]);
return d
}
h = h || n.getTags();
var m = h instanceof Array;
if (m)
for (var e = 0; e < h.length; e++) {
if (h[e] instanceof A.opentag.BaseTag) d.push(n.getLoadTime(h[e]))
} else
for (var k in h)
if (h[k] instanceof A.opentag.BaseTag) d.push(n.getLoadTime(h[k]));
return d
};
n.forceAllContainersAndTagsToRunIfDisabled = function() {
A.opentag.Container.setCookieForDisabledContainersToRun();
A.opentag.BaseTag.setCookieForcingTagsToRun()
};
n.rmAllContainersAndTagsForcingFlags = function() {
A.opentag.Container.rmCookieForDisabledContainersToRun();
A.opentag.BaseTag.rmAllCookiesForcingTagToRun()
};
n.getContainers = function() {
return A.opentag.Container.getContainers()
};
n.findAllTagsByClassPath = function(h) {
var d = (new Date).valueOf();
var m = [];
var e = [];
try {
e.push(A.opentag.CustomTag);
e.push(A.opentag.LibraryTag)
} catch (x) {}
var k = n.getTags();
for (var r = 0; r < k.length; r++) {
var g = k[r];
if (a.indexInArray(e, g) < 0 && g.PACKAGE_NAME.indexOf(h) === 0) m.push(g)
}
return m
};
n.findAllTags = function(h, d) {
var m = A.opentag.BaseTag;
var e;
var k = [];
var r = (new Date).valueOf();
try {
k.push(A.opentag.CustomTag);
k.push(A.opentag.LibraryTag)
} catch (g) {}
e = n.findAllInstances(h, m, k, d);
return e
};
var v = function(h, d, m, e) {
var k = [];
if (typeof h === "string") h = a.getObjectUsingPath(h);
if (h) {
var r = {
objectsOnly: true
};
if (e) r.maxDeep = true;
var g = function(x, w, y, C) {
if (d(x)) {
for (var p = 0; p < m.length; p++)
if (m[p] === x) return true;
a.addToArrayIfNotExist(k, x);
return true
}
return false
}.bind(this);
a.traverse(h, g, r)
}
return k
};
n.findAllInstances = function(h, d, m, e) {
var k = function(r) {
return r instanceof d
};
return v(h, k, m, e)
};
n.findAllInheriting = function(h, d, m, e) {
var k = function(r) {
return r.prototype instanceof d
};
return v(h, k, m, e)
};
n.findAllFilters = function(h, d) {
var m = [];
try {
m.push(A.opentag.filter.Filter);
m.push(A.opentag.filter.URLFilter)
} catch (e) {}
return n.findAllInheriting(h, q, m, d)
}
})();
J.cookie = {};
J.cookie.PageView = {};
J.cookie.PageView.update = function() {
var a;
var q;
q = function v() {
return Math.floor(1 + Math.random() * 65536).toString(36).substring(1)
};
if (!window.__pageViewId__) {
a = (new Date).getTime().toString(36);
window.__pageViewId__ = a + q() + q() + q()
}
return window.__pageViewId__
};
J.html.PostData = function(a, q, n, v) {
var h;
var d;
var m;
var e;
var k;
var r;
var g;
var x;
var w;
var y;
y = 2;
w = 5E3;
g = false;
x = function() {
if (y >
0) setTimeout(function() {
if (!g) {
y -= 1;
h()
}
}, w)
};
d = navigator.userAgent.toLowerCase();
m = d.indexOf("msie") !== -1;
e = d.indexOf("msie 9") !== -1;
k = d.indexOf("msie 7") !== -1 || d.indexOf("msie 6") !== -1;
r = ("https:" === document.location.protocol ? "https:" : "http:") + a;
n = n || "POST";
h = function() {
var C;
try {
C = null;
try {
C = new XMLHttpRequest
} catch (p) {}
if (C && !m) C.open(n, r, true);
else if (typeof XDomainRequest !== "undefined") {
C = new XDomainRequest;
C.open(n, r)
} else C = null;
try {
C.withCredentials = false
} catch (p) {}
if (C.setRequestHeader)
if (v) C.setRequestHeader("Content-Type",
v);
else C.setRequestHeader("Content-Type", "text/plain;charset\x3dUTF-8");
C.onload = function() {
g = true
};
C.onreadystatechange = function() {};
C.ontimeout = function() {};
C.onerror = function() {};
C.onprogress = function() {};
C.send(q)
} catch (p) {
try {
try {
J.html.fileLoader.load(r)
} catch (t) {
if (window.console && window.console.log) window.console.log(p)
}
} catch (t) {}
}
};
if (k) {
J.html.fileLoader.load(r);
return
} else h()
};
(function() {
function a() {}
function q(v, h) {
var d = {};
d.clientId = "" + h.clientId;
d.containerId = "" + v.getContainerId();
d.classpath = "" + v.PACKAGE_NAME;
d.opentagStats = true;
if (v.sentPing) d.containerLoad = false;
else {
v.sentPing = (new Date).valueOf();
d.containerLoad = true
}
d.isS3 = false;
d.pageViewId = J.cookie.PageView.update();
d.tags = [];
return d
}
var n = "text/plain;charset\x3dUTF-8";
A.Define.clazz("qubit.opentag.Ping", a);
a.prototype.oldSend = function(v, h) {
var d = v.config;
var m = "c\x3d" + d.clientId + "\x26" + "p\x3d" + v.getContainerId() + "\x26" + "l\x3d" + d.tellLoadTimesProbability + "\x26" + "pv\x3d" + J.cookie.PageView.update() + "\x26" + "d\x3d";
var e =
[];
for (var k = 0; k < h.length; k++) {
var r = h[k].tag;
var g = h[k].loadTime;
if (g === null || isNaN(g)) continue;
var x = a.getPingID(r);
if (!r.oldPingSent && x && g !== null)
if (x !== undefined) {
e.push('"' + x + '":' + g);
r.oldPingSent = true
} else;
else if (r.oldPingSent);
else if (g === null);
}
if (d.pingServerUrl && e.length > 0) {
m += encodeURIComponent("{" + e.join(",") + "}");
var w = "//" + d.pingServerUrl + "/tag2?" + m;
J.html.PostData(w, null, "GET")
} else {
if (!e.length);
if (!d.pingServerUrl);
}
};
a.prototype.sendErrors = function(v, h) {};
a.prototype.oldSendDedupe =
function(v, h) {
var d = v.config;
var m = "c\x3d" + d.clientId + "\x26" + "p\x3d" + v.getContainerId() + "\x26" + "l\x3d" + d.tellLoadTimesProbability + "\x26" + "pv\x3d" + J.cookie.PageView.update() + "\x26" + "dd\x3d";
var e = [];
for (var k = 0; k < h.length; k++) {
var r = h[k];
var g = a.getPingID(r);
if (g === undefined);
else if (!r.oldDedupePingSent) {
e.push(g);
r.oldDedupePingSent = true
}
}
if (e.length > 0 && d.pingServerUrl) {
m += encodeURIComponent("[" + e.join(",") + "]");
J.html.PostData("//" + d.pingServerUrl + "/tag2?" + m, null, "GET")
} else {
if (!e.length);
if (!d.pingServerUrl);
}
};
a.getPingID = function(v) {
if (v.config.id) return v.config.id;
var h = v.PACKAGE_NAME.lastIndexOf(".");
if (h !== -1) return v.PACKAGE_NAME.substring(h + 1);
else return v.PACKAGE_NAME
};
a.prototype.send = function(v, h) {
var d = v.config.pingServerUrl;
if (d && d.indexOf("opentag-stats") !== -1) this.newSend(v, h);
else this.oldSend(v, h)
};
a.prototype.newSend = function(v, h) {
var d = v.config;
var m = q(v, d);
var e = m.tags;
var k = d.pingServerUrl;
for (var r = 0; r < h.length; r++) {
var g = h[r].tag;
var x = h[r].loadTime;
if (x === null || isNaN(x)) continue;
var w = {};
var y = a.getPingID(g);
if (!g.pingSent && y && x !== null)
if (y !== undefined) {
w.tagId = y;
w.loadTime = x;
w.fired = true;
e.push(w);
g.pingSent = true
} else;
else if (g.pingSent);
else if (x === null);
}
if (k && (e.length > 0 || m.containerLoad)) {
var C = P.stringify(m);
var p = "//" + k;
J.html.PostData(p, C, "POST", n)
} else {
if (!e.length);
if (!k);
}
};
a.prototype.sendDedupe = function(v, h) {
var d = v.config.pingServerUrl;
if (d && d.indexOf("opentag-stats") !== -1) this.newSendDedupe(v, h);
else this.oldSendDedupe(v, h)
};
a.prototype.newSendDedupe = function(v,
h) {
var d = v.config;
var m = q(v, d);
var e = d.pingServerUrl;
var k = m.tags;
for (var r = 0; r < h.length; r++) {
var g = h[r];
var x = a.getPingID(g);
var w = {};
if (x === undefined);
else if (!g.dedupePingSent) {
w.tagId = "" + x;
w.fired = false;
w.loadTime = 0;
k.push(w);
g.dedupePingSent = true
}
}
if (e && (k.length > 0 || m.containerLoad)) {
var y = P.stringify(m);
var C = "//" + e;
J.html.PostData(C, y, "POST", n)
} else {
if (!k.length);
if (!e);
}
}
})();
J.cookie.SimpleSessionCounter = {};
J.cookie.SimpleSessionCounter._cookieName = "_qst_s";
J.cookie.SimpleSessionCounter._sessionCookie =
"_qsst_s";
J.cookie.SimpleSessionCounter.update = function(a) {
var q;
var n;
var v;
var h = 30;
q = A.Cookie.get(J.cookie.SimpleSessionCounter._cookieName);
n = A.Cookie.get(J.cookie.SimpleSessionCounter._sessionCookie);
if (!q) q = 1;
else {
q = parseInt(q, 10);
if (!n || parseInt(n, 10) < (new Date).getTime() - h * 60 * 1E3) q += 1
}
A.Cookie.set(J.cookie.SimpleSessionCounter._cookieName, q, 365, a);
A.Cookie.set(J.cookie.SimpleSessionCounter._sessionCookie, (new Date).getTime().toString(), null, a);
return q
};
var P = {};
(function() {
function a(g) {
return g <
10 ? "0" + g : g
}
function q(g) {
d.lastIndex = 0;
return d.test(g) ? '"' + g.replace(d, function(x) {
var w = k[x];
return typeof w === "string" ? w : "\\u" + ("0000" + x.charCodeAt(0).toString(16)).slice(-4)
}) + '"' : '"' + g + '"'
}
function n(g) {
return isFinite(g.valueOf()) ? g.getUTCFullYear() + "-" + a(g.getUTCMonth() + 1) + "-" + a(g.getUTCDate()) + "T" + a(g.getUTCHours()) + ":" + a(g.getUTCMinutes()) + ":" + a(g.getUTCSeconds()) + "Z" : null
}
function v(g, x) {
var w;
var y;
var C;
var p;
var t = m;
var u;
var c = x[g];
if (c instanceof Date) c = n(c);
else if (c instanceof String ||
c instanceof Number || c instanceof Boolean) c = c.valueOf();
if (typeof r === "function") c = r.call(x, g, c);
switch (typeof c) {
case "string":
return q(c);
case "number":
return isFinite(c) ? String(c) : "null";
case "boolean":
case "null":
return String(c);
case "object":
if (!c) return "null";
m += e;
u = [];
if (Object.prototype.toString.apply(c) === "[object Array]") {
p = c.length;
for (w = 0; w < p; w += 1) try {
u[w] = v(w, c) || "null"
} catch (b) {
u[w] = '{"stack_exceeded": null}'
}
C = u.length === 0 ? "[]" : m ? "[\n" + m + u.join(",\n" + m) + "\n" + t + "]" : "[" + u.join(",") +
"]";
m = t;
return C
}
if (r && typeof r === "object") {
p = r.length;
for (w = 0; w < p; w += 1)
if (typeof r[w] === "string") {
y = r[w];
try {
C = v(y, c)
} catch (b) {
C = '{"stack_exceeded": null}'
}
if (C) u.push(q(y) + (m ? ": " : ":") + C)
}
} else
for (y in c)
if (Object.prototype.hasOwnProperty.call(c, y)) {
try {
C = v(y, c)
} catch (b) {
C = '{"stack_exceeded": null}'
}
if (C) u.push(q(y) + (m ? ": " : ":") + C)
}
C = u.length === 0 ? "{}" : m ? "{\n" + m + u.join(",\n" + m) + "\n" + t + "}" : "{" + u.join(",") + "}";
m = t;
return C
}
}
var h = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var d = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var m;
var e;
var k = {
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\"
};
var r;
if (typeof P.stringify !== "function") P.stringify = function(g, x, w) {
var y;
m = "";
e = "";
if (typeof w === "number")
for (y = 0; y < w; y += 1) e += " ";
else if (typeof w === "string") e = w;
r = x;
if (x && typeof x !== "function" && (typeof x !== "object" || typeof x.length !== "number")) throw new Error("JSON.stringify");
return v("", {
"": g
})
};
if (typeof P.parse !== "function") P.parse = function(g, x) {
function w(C, p) {
var t;
var u;
var c = C[p];
if (c && typeof c === "object")
for (t in c)
if (Object.prototype.hasOwnProperty.call(c, t)) {
u = w(c, t);
if (u !== undefined) c[t] = u;
else delete c[t]
}
return x.call(C, p, c)
}
var y;
g = String(g);
h.lastIndex = 0;
if (h.test(g)) g = g.replace(h, function(C) {
return "\\u" + ("0000" + C.charCodeAt(0).toString(16)).slice(-4)
});
if (/^[\],:{}\s]*$/.test(g.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
y = eval("(" + g + ")");
return typeof x === "function" ? w({
"": y
}, "") : y
}
throw new SyntaxError("JSON.parse");
}
})();
(function() {
function a(k) {
if (k)
if (k.alphabet) {
this.alphabet = k.alphabet;
this.dict = {};
for (var r = 0; r < this.alphabet.length; r++) this.dict[this.alphabet[r]] = r
} else {
this.alphabet = n;
this.dict = d
}
}
function q(k, r) {
for (var g in r)
if (k === r[g]) return g;
return null
}
var n = [];
var v = Math.pow(2, 8);
for (var h = 0; h < v; h++) n.push(String.fromCharCode(h));
var d = {};
for (var m = 0; m < n.length; m++) d[n[m]] =
m;
var e = A.Define;
e.clazz("qubit.compression.LZW", a);
a.prototype.encode = function(k) {
var r = this.alphabet.length;
var g = {};
var x = [];
var w = 0;
var y = k.charAt(w++);
var C;
for (var p = this.dict; !!(C = k.charAt(w++));) {
var t = y + C;
if (p.hasOwnProperty(t) || g.hasOwnProperty(t)) y = t;
else {
var u = p.hasOwnProperty(y) ? p[y] : g[y];
if (u === undefined) throw "Dictionary base is to small for those contents: " + y;
x.push(u);
g[t] = r++;
y = C
}
}
if (y !== "") x.push(g.hasOwnProperty(y) ? g[y] : p[y]);
return x
};
a.prototype.decode = function(k) {
var r = this.dict;
var g = this.alphabet.length;
var x;
var w = {};
var y = q(k[0], r);
var C = y;
var p = [y];
for (var t = 1; t < k.length; t++) {
var u = k[t];
x = q(u, r);
if (x === null) {
if (w.hasOwnProperty(u)) x = w[u];
if (x === null) x = C + y
}
p.push(x);
y = x.charAt(0);
w[g++] = C + y;
C = x
}
return p.join("")
}
})();
(function() {
function a(p) {
var t = 0;
var u = p < 0;
if (u) p = -p;
var c = "";
var b = true;
do {
t = p % w;
if (b) {
c = r[x[t]];
b = false
} else c = x[t] + c;
p = (p - t) / w
} while (p > 0);
if (u) return "-" + c;
return c
}
function q(p) {
var t = 0;
var u = 0;
var c = true;
for (var b = 0; b < p.length; b++) {
var f = p.charAt(p.length -
1 - b);
if (c) {
c = false;
f = v.charAt(e[f])
}
t += d[f] * Math.pow(w, u++)
}
return t
}
function n(p) {}
var v = "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "'%./:\x3c\x3e?[";
var h = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "*!-+()@{|}" + '"]^_`~$\x26#';
var d = {};
for (var m = 0; m < v.length; m++) d[v.charAt(m)] = m;
var e = {};
for (var k = 0; k < v.length; k++) e[h.charAt(k)] = k;
var r = {};
for (var g = 0; g < v.length; g++) r[v.charAt(g)] = h.charAt(g);
var x = v.split("");
var w = x.length;
var y = new A.compression.LZW({});
var C = A.Define;
C.clazz("qubit.compression.Compressor",
n);
n.prototype.compress = function(p, t) {
var u = (t || y).encode(p);
var c = [];
for (var b = 0; b < u.length; b++) c.push(String.fromCharCode(u[b]));
return c.join("")
};
n.prototype.compressAnsi = function(p, t) {
var u = (t || y).encode(p);
var c = [];
for (var b = 0; b < u.length; b++) {
var f = a(u[b]);
c.push(f)
}
return c.join("")
};
n.prototype.decompressAnsi = function(p, t) {
var u = [];
var c = "";
for (var b = 0; b < p.length; b++) {
var f = p.charAt(b);
if (e.hasOwnProperty(f)) {
var l = c + f;
c = "";
l = q(l);
u.push(l)
} else c += f
}
return (t || y).decode(u)
};
n.prototype.decompress =
function(p, t) {
var u = [];
for (var c = 0; c < p.length; c++) u.push(p.charCodeAt(c));
return (t || y).decode(u)
}
})();
(function() {
function a(u) {
var c = [];
for (var b = 0; b < u.length; b++) {
var f = d(u[b][0]);
c.push([new RegExp(f, "g"), "*" + u[b][1]])
}
return c
}
function q(u, c) {
for (var b = 0; b < c.length; b++)
if (c[b][1] === u) return c[b][0];
return null
}
function n(u) {
this._regexDefs = x;
this._defs = g;
if (u)
if (u.definitions) {
this._regexDefs = a(u.definitions);
this._defs = u.definitions
}
}
function v(u, c) {
var b = [];
for (var f = 0; f < u.length; f++) {
var l =
true;
if (c) l = u.charCodeAt(f) <= c;
var z = r.cookieAlphabetMap.hasOwnProperty(u.charAt(f));
if (l && !z) b.push("*" + u.charCodeAt(f) + ".");
else b.push(u.charAt(f))
}
return b.join("")
}
function h(u, c) {
c = c.replace(/@/g, "@@");
var b = [];
var f = 0;
for (var l = 0; f < u.length; f++) {
var z = u[f][0];
var D = new RegExp(d(z), "g");
var E = c.replace(D, "@" + l + "-");
if (E !== c) {
b.push(u[f][0]);
l++;
c = E
}
}
return [c, b]
}
function d(u) {
return u.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1")
}
function m(u) {
var c = {};
var b = "";
for (var f = 0; f < u.length; f++) {
var l =
u.charAt(f);
if (!y[l]) {
if (isNaN(c[b])) c[b] = u.split(b).length - 1;
b = ""
} else b += l
}
var z = [];
for (var D in c)
if (c.hasOwnProperty(D)) {
var E = c[D];
if (E >= t && D.length >= p) z.push([D, E])
}
z = z.sort(function(F, H) {
if (F[0].length === H[0].length) return 0;
if (H[0].length > F[0].length) return 1;
else return -1
});
return z
}
function e(u, c) {
if (!c || c.length === 0 || !u) return u;
var b = "";
var f = false;
var l = false;
var z = "";
for (var D = 0; D < u.length; D++) {
var E = u.charAt(D);
if (E === "@" || f || l)
if (f || l) {
f = false;
if (E === "@") b += "@";
else if (!isNaN(+("-" +
E))) {
l = true;
z = z + E
} else if (l) {
if (c && E === "-" && c[+z]) b += c[+z];
else b += "@" + z + E;
z = "";
l = false
} else b += "@" + E
} else f = true;
else b += E
}
if (z) b += "@" + z;
if (f) b += "@";
return b
}
var k = A.Define;
var r = A.Cookie;
var g = [
['","referrer":[{"url":"http://', "1-"],
['","referrer":[{"url":"https://', "2-"],
[',"referrer":[{"url":"http://', "3-"],
[',"referrer":[{"url":"https://', "4-"],
[',"sessionStartTime":', "5-"],
["www.google.co.uk", "6-"],
["www.google.", "7-"],
['"sessionStartTime":', "8-"],
['"landing":"', "9-"],
["http%3A%2F%2Fwww", "10-"],
['"landing":', "L"],
['"time":', "A"],
['"pageViews":', "P"],
['"sessionCount":', "B"],
['"referrer":', "R"],
['"url":"http://www.', "J"],
['"url":"https://www.', "M"],
['"url":"', "I"],
['"url":', "U"],
["http://www.", "W"],
["https://www.", "V"],
["%2Fen%2Ftsuk%2F", "K"],
['"sessionLandingPage":', "F"],
["http%3A%2F%2F", "D"],
["http://", "H"],
["https://", "X"],
['""', "O"],
['",', "Y"],
['":{}}', "z"],
["\x3c", "S"],
["\x3e", "G"],
["[", "Z"],
["]", "E"],
["{", "a"],
["}", "b"],
["(", "c"],
[")", "d"],
["!", "e"],
["#", "f"],
["$", "g"],
["!", "q"],
["'",
"i"
],
[":", "j"],
["?", "k"],
["^", "x"],
["`", "m"],
["|", "n"],
["~", "o"],
["%", "v"],
[",", "C"]
];
var x = a(g);
k.clazz("qubit.opentag.compression.Encoder", n);
n.prototype.encode = function c(b, f) {
var l = b.replace(/\*/g, "**");
var z = m(l);
for (var D = 0; D < this._regexDefs.length; D++) {
var E = this._regexDefs[D];
l = l.replace(E[0], E[1])
}
l = l.replace(/;/g, "*-");
l = l.replace(/&/g, "*.");
l = l.replace(/\\/g, "*/");
l = l.replace(/=/g, "*+");
l = l.replace(/\n/g, "*N");
l = l.replace(/ /g, "*_");
l = l.replace(/\t/g, "*T");
l = l.replace(/"/g, "*Q");
var F =
m(l);
F.concat(z);
var H = h(F, l);
var K = H[1];
var M = K.length > 0;
if (M) l = H[0];
if (!f) l = v(l);
else l = v(l, f);
if (M) return "Y" + K.join("*") + "@" + l;
else return "N" + l
};
var w = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+_.";
var y = {};
for (var C = 0; C < w.length; C++) y[w.charAt(C)] = true;
var p = 4;
var t = 2;
n.prototype.decode = function(c) {
var b = null;
if (c.charAt(0) === "N") c = c.substring(1);
else if (c.charAt(0) === "Y") {
var f = c.indexOf("@");
if (f >= 0) {
b = c.substring(1, f);
b = b.split("*");
c = c.substring(f + 1);
c = e(c, b)
}
}
var l = "";
var z = false;
var D = false;
var E = "";
for (var F = 0; F < c.length; F++) {
var H = c.charAt(F);
if (H === "*" || z || D)
if (z || D) {
z = false;
if (!isNaN(+("-" + H))) {
E = E + H;
D = true
} else if (D) {
if (H === ".") l += String.fromCharCode(+E);
else if (H === "-" && q(E + "-", this._defs)) l += q(E + "-", this._defs);
else l += "*" + E + H;
E = "";
D = false
} else if (H === "*") l += "*";
else if (H === "-") l += ";";
else if (H === "/") l += "\\";
else if (H === ".") l += "\x26";
else if (H === "+") l += "\x3d";
else if (H === "N") l += "\n";
else if (H === "_") l += " ";
else if (H === "T") l += "\t";
else if (H === "Q") l += '"';
else if (q(H, this._defs) !== null) {
var K = q(H, this._defs);
l += K
} else l += "*" + H
} else z = true;
else l += H
}
if (E) l += "*" + E;
if (z) l += "*";
return l
}
})();
(function() {
function a(h) {
this.testBinary = false;
this.binSupported = v;
if (h) {
this.compressor = new A.compression.Compressor;
this.encoder = new A.opentag.compression.Encoder({})
}
}
var q = A.Define;
var n = A.Cookie;
var v = false;
q.clazz("qubit.opentag.compression.CookieCompressor", a);
a.prototype.compress = function(h, d) {
if (typeof h !== "string" || h === "") return h;
var m = this.encoder.encode(h);
var e;
if (this.binSupported || this.testBinary) {
var k = this.compressor.compress(m);
e = '"B' + this.encoder.encode(k, 128) + '"';
n.set("__qtag_test_bin__", e, undefined, undefined, true);
var r = n.get("__qtag_test_bin__", true);
n.rm("__qtag_test_bin__");
if (r && r !== e) e = null
}
var g;
var x = this.encoder.encode(this.compressor.compressAnsi(m));
if (!d && m.length <= x.length) g = "E" + m;
else g = "C" + x;
if (e && e.length < g.length) return e;
else return g
};
a.prototype.decompress = function(h) {
if (typeof h !== "string" || h === "") return h;
if (h.charAt(0) ===
'"') h = h.substring(1, h.length - 1);
var d = h.charAt(0);
h = h.substring(1);
switch (d) {
case "E":
return this.encoder.decode(h);
case "C":
var m = this.compressor.decompressAnsi(this.encoder.decode(h));
return this.encoder.decode(m);
case "B":
var e = this.compressor.decompress(this.encoder.decode(h));
return this.encoder.decode(e);
default:
throw "This code is not supported! Code: " + d;
}
}
})();
(function() {
var a = A.Cookie;
var q = A.opentag.Utils;
var n = function() {};
A.Define.clazz("qubit.opentag.Session", n);
var v = new A.opentag.compression.CookieCompressor({});
n.readCompressedCookie = function(h) {
var d = a.get(h, true);
return v.decompress(d)
};
n.setupSession = function(h) {
var d = h.config;
var m;
var e;
var k;
var r;
var g;
var x;
m = {};
m.sessionCount = J.cookie.SimpleSessionCounter.update(d.cookieDomain);
g = "qtag_" + h.getContainerId();
var w = "x_qtag_" + h.getContainerId();
k = a.get(g);
var y = !!k;
if (k === null) {
k = a.get(w, true);
k = v.decompress(k)
}
if (k) try {
k = P.parse(k)
} catch (p) {
k = {
sc: 0,
sessionCount: 0,
pageViews: 0,
sessionStartTime: 0,
referrer: [],
sessionLandingPage: "",
__v: {}
}
} else k = {
sc: 0,
sessionCount: 0,
pageViews: 0,
sessionStartTime: 0,
referrer: [],
sessionLandingPage: "",
__v: {}
};
x = (new Date).getTime();
if (m.sessionCount !== parseInt(k.sc, 10)) {
k.sessionStartTime = x;
k.sc = m.sessionCount;
k.sessionCount += 1;
k.referrer.push({
url: n.getReferrer(),
landing: q.getUrl().substring(0, 300),
time: x
});
k.sessionLandingPage = q.getUrl().substring(0, 300)
} else if (n.isReferrerDifferent())
if (!n.referrerIsSameAsPrevious(k.referrer, x, 30 * 60 * 1E3)) {
k.referrer.push({
url: n.getReferrer(),
landing: q.getUrl().substring(0, 300),
time: x
});
k.sessionLandingPage = q.getUrl().substring(0, 300);
k.sessionStartTime = x;
k.sessionCount += 1
}
m.sessionCount = k.sessionCount;
m.sessionStartTime = k.sessionStartTime;
m.pageStartTime = x;
k.pageViews += 1;
m.pageViews = k.pageViews;
m.sessionLandingPage = k.sessionLandingPage;
m.referrer = k.referrer;
if (m.referrer.length > 5) m.referrer.splice(2, m.referrer.length - 5);
r = P.stringify(k);
for (e = 0; v.compress(r).length > d.maxCookieLength && e < 5;) {
if (k.referrer.length >= 3) k.referrer.splice(2, 1);
else if (k.referrer.length === 2) k.referrer =
[k.referrer[0]];
else if (k.referrer.length === 1) k.referrer = [];
r = P.stringify(k);
e += 1
}
m.referrer = k.referrer;
if (y) a.rm(g);
var C = v.compress(r);
a.rm(w);
if (d.maxCookieLength > 0) a.set(w, C, 365, d.cookieDomain, true);
m.setVariable = function(p, t, u) {
var c = !!u ? u : 0;
k.__v[p] = [t, c];
var b = v.compress(P.stringify(k));
if (d.maxCookieLength > 0) a.set(w, b, 365, d.cookieDomain, true);
else a.rm(w)
};
m.getCookie = function(p, t) {
var u = a.get(p, true);
if (u && (t || p.indexOf("x_") === 0)) try {
u = v.decompress(u)
} catch (c) {} else if (u !== null) u = a.decode(u);
return u
};
m.getVariable = function(p) {
var t;
var u;
var c;
t = k.__v[p];
if (t) {
u = t[1];
if (u === 0 || u > (new Date).getTime()) return t[0]
}
return null
};
m.on = function(p, t, u) {
if (t.attachEvent) t.attachEvent("on" + p, u);
else if (t.addEventListener) t.addEventListener(p, u, false)
};
m.getTagCookie = function() {
return n.readCompressedCookie(w)
};
n.lastSession = m;
return m
};
n.referrerIsSameAsPrevious = function(h, d, m) {
var e;
var k;
var r;
if (h.length > 0) {
e = n.getReferrer();
k = q.getUrl().substring(0, 300);
r = h[h.length - 1];
return r.url === e && r.landing ===
k && r.time + m > d
}
return false
};
n.isReferrerDifferent = function() {
var h;
var d;
var m;
m = n.getReferrer();
h = m.indexOf("://");
if (h === -1) return true;
h += 3;
try {
if (m.substring(h).indexOf(n.getDomain()) !== 0) return true;
return false
} catch (e) {
return true
}
};
n.getReferrer = function() {
if (document.referrer) return document.referrer.substring(0, 300);
return "direct"
};
n.getDomain = function() {
return document.location.host
}
})();
(function() {
function a(h) {
n.setIfUnset(h, a.defaultConfig);
if (this.singleton) {
var d = this.PACKAGE_NAME +
"." + this.CLASS_NAME;
var m = A.opentag.Utils.getObjectUsingPath(d, G);
if (m.__instance) return m.__instance;
m.__instance = this
}
a.SUPER.call(this, h)
}
function q(h, d) {
var m = h.toString();
m = m.replace(/\s*function\s*\([\w\s,_\d\$]*\)\s*\{/, "");
m = m.substring(0, m.lastIndexOf("}"));
m = m.replace(/(["']\s*\+\s*)\s*_*\w+\s*\.\s*valueForToken\s*\(\s*'([^']*)'\s*\)/g, '$1"${$2}"');
m = m.replace(/\s*_*\w+\s*\.\s*valueForToken\s*\(\s*'([^']*)'\s*\)(\s*\+\s*["'])/g, '"${$1}"$2');
m = m.replace(/(["']\s*\+\s*)\s*_*\w+\s*\.\s*valueForToken\s*\(\s*"([^"]*)"\s*\)/g,
'$1"${$2}"');
m = m.replace(/\s*_*\w+\s*\.\s*valueForToken\s*\(\s*"([^"]*)"\s*\)(\s*\+\s*["'])/g, '"${$1}"$2');
m = m.replace(/(\s*)_*\w+\s*\.\s*valueForToken\s*\(\s*'([^']*)'(\s*)\)/g, "$1${$2}$3");
m = m.replace(/(\s*)_*\w+\s*\.\s*valueForToken\s*\(\s*"([^"]*)"(\s*)\)/g, "$1${$2}$3");
m = d.replaceTokensWithValues(m);
n.geval(m)
}
var n = A.opentag.Utils;
var v = A.Define;
A.Define.clazz("qubit.opentag.LibraryTag", a, A.opentag.BaseTag);
a.defaultConfig = {
vendor: null,
imageUrl: null,
description: "",
async: false,
isPrivate: false,
upgradeable: true,
html: "",
parameters: [],
prePostWindowScope: false
};
a.prototype.pre = function() {};
a.prototype.post = function() {};
a.prototype.before = function() {
a.SUPER.prototype.before.call(this);
try {
var h = this.config;
if (h && h.pre)
if (typeof h.pre === "function") this.pre = h.pre;
else {
var d = this.replaceTokensWithValues(String(h.pre));
this.pre = n.expressionToFunction(d).bind(this)
}
if (this.config.prePostWindowScope && this.pre !== a.prototype.pre && this.pre.toString) q(this.pre, this);
else this.pre()
} catch (m) {
return true
}
return false
};
a.prototype.after = function(h) {
a.SUPER.prototype.after.call(this, h);
try {
var d = this.config;
if (d && d.post)
if (typeof d.post === "function") this.post = d.post;
else {
var m = this.replaceTokensWithValues(String(d.post));
this.post = n.expressionToFunction(m).bind(this)
}
if (this.config.prePostWindowScope && this.post !== a.prototype.post && this.post.toString) q(this.post, this);
else this.post(h)
} catch (e) {}
};
a.define = function(h, d) {
h = h.replace(/^[\.]+/g, "").replace(/[\.]+$/g, "").replace(/\.+/g, ".");
h = A.Define.vendorsSpaceClasspath(h);
var m = {};
if (d.getDefaultConfig) m = d.getDefaultConfig();
var e = d.CONSTRUCTOR;
var k = {};
for (var r in d)
if (r !== "config") k[r] = d[r];
var g = function(y) {
y = y || {};
y = n.overrideFromLeftToRight(m, y);
var C = A.opentag.LibraryTag.call(this, y);
if (e) e.call(this, y);
if (C) return C
};
var x = A.opentag.Utils.defineWrappedClass(h, a, k, L, g);
var w = v.STANDARD_VS_NS + ".";
if (h.indexOf(w) !== 0) n.namespace(w + h, x);
return x
};
a.getLibraryByClasspath = function(h) {
return n.getObjectUsingPath(h, A.Define.getVendorSpace())
}
})();
(function() {
function a() {}
var q = A.opentag.LibraryTag;
var n = A.Define;
a.library = function() {
return q.define.apply(q, arguments)
};
a.libraryRef = function() {
return q.getLibraryByClasspath.apply(q.getLibraryByClasspath, arguments)
};
n.namespace("qubit.Quick", a)
})();
(function() {
function a(p) {
this.runQueue = [];
this.tags = {};
this.config = {
cookieDomain: "",
maxCookieLength: 1E3,
gzip: true,
delayDocWrite: false,
clientId: "",
name: "",
tellLoadTimesProbability: null,
pingServerUrl: null,
trackSession: null,
disabled: false,
containerId: "",
scanTags: false,
noPings: false
};
this.ignoreTagsState = false;
if (p) {
this.setConfig(p);
if (!p.name) this.config.name = "Cont-" + g++;
a.register(this);
if (a.NO_PINGS) this.config.noPings = true;
this.ping = new A.opentag.Ping(this.config);
this._sendPingsTrigger = this.sendPings.bind(this);
if (p.init) try {
p.init.call(this, p)
} catch (u) {}
var t = this;
this._tagLoadedHandler = function(u) {
if (t._containerAlreadySentPings) {
t.sendPingsNotTooOften();
if (u.success);
}
}
}
return this
}
function q(p, t, u) {
if (p[u]) {
w[u] = w[u] || 1;
u += "(" + w[u] + ")";
w[u]++
}
p[u] = t
}
var n = A.opentag.Utils;
var v = A.opentag.filter.BaseFilter;
var h = A.opentag.filter.Filter;
var d = A.opentag.BaseTag;
var m = A.opentag.Timed;
var e = A.opentag.Tags;
var k = A.opentag.Session;
var r = A.Cookie;
var g = 1;
try {
window.opentag_consentGiven = function() {
a.consentIsGiven = true;
var p = a.getContainers();
for (var t = 0; t < p.length; t++) try {
p[t].run()
} catch (u) {}
}.bind(this)
} catch (p) {}
A.Define.clazz("qubit.opentag.Container", a);
var x = [];
a.register = function(p) {
n.addToArrayIfNotExist(x, p)
};
a.prototype.isTellingLoadTimes = function() {
var p = this.config.tellLoadTimesProbability;
if (p === null) p = 0;
return p > Math.random()
};
a.prototype.destroy = function(p) {
this.destroyed = true;
this.unregister();
if (p)
for (var t in this.tags) {
var u = this.tags[t];
if (u instanceof d) {
u.destroy();
this.tags[t] = null;
delete this.tags[t]
}
}
var c = this.PACKAGE_NAME.split(".");
c = c[c.length - 1];
var b = n.getParentObject(this.PACKAGE_NAME);
b[c] = null;
delete b[c]
};
a.findContainersByName = function(p) {
var t = this.getContainers();
var u = [];
for (var c = 0; c < t.length; c++)
if (t[c].config.name === p) u.push(t[c]);
return u
};
a.getById = function(p) {
var t =
this.getContainers();
for (var u = 0; u < t.length; u++)
if (t[u].getContainerId() === p) return t[u];
return null
};
a.prototype.unregister = function(p) {
a.unregister(this, p)
};
a.unregister = function(p, t) {
n.addToArrayIfNotExist(x, p);
var u = n.removeFromArray(x, p);
if (t)
for (var c in this.tags) {
var b = this.tags[c];
if (b instanceof d) {
b.unregister();
this.tags[c] = null;
delete this.tags[c]
}
}
if (!u || u.length === 0);
};
a.prototype.hasConsent = function() {
return r.get("qubitconsent") === "Accepted"
};
a.prototype.register = function(p) {
a.register(p ||
this)
};
a.getContainers = function() {
return x
};
a.prototype.getContainers = function() {
return a.getContainers()
};
a.prototype.onTagRegistered = function(p) {};
a.prototype.registerTag = function(p) {
var t = p.config.name;
if (this.tags[t]);
else {
this.tags[t] = p;
p.onAfter(this._tagLoadedHandler);
try {
this.onTagRegistered(p)
} catch (u) {}
}
};
a.prototype.registerTags = function(p) {
for (var t = 0; t < p.length; t++) this.registerTag(p[t])
};
a.prototype.setConfig = function(p) {
for (var t in p) this.config[t] = p[t]
};
a.prototype.run = function() {
this.runTags({
command: "runOnceIfFiltersPass"
})
};
a.prototype.runWithoutFilters = function() {
this.runTags({
command: "run"
})
};
a.prototype.getTagByname = function(p) {
return this.tags[p]
};
a.prototype.containerScriptLoadedSynchronously = function() {
var p;
var t;
var u;
var c;
var b;
c = document.getElementsByTagName("script");
for (p = 0, t = c.length; p < t; p += 1) {
u = c[p];
b = u.getAttribute("src");
if (!!b && b.indexOf("" + this.config.clientId + "-" + this.getContainerId() + ".js") > 0) return u.getAttribute("async") === null && (u.getAttribute("defer") === false || u.getAttribute("defer") === "" || u.getAttribute("defer") ===
null)
}
return true
};
a.prototype.prepareSessionIfNeeded = function() {
var p = this.config.trackSession;
if (p !== true && p !== false) {
var t = this.tags;
for (var u in t)
if (t.hasOwnProperty(u)) {
var c = t[u];
c.resolveAllDynamicData();
var b = c.getFilters();
for (var f = 0; f < b.length; f++) {
var l = b[f];
if (l instanceof h && l.isSession()) {
this.trackSession = true;
break
}
}
if (this.trackSession) break
}
} else this.trackSession = p;
if (a.TRACK_SESSION) this.trackSession = true;
if (this.trackSession) this.session = k.setupSession(this);
if (this.session);
};
a.prototype.runTags = function(p, t) {
if (this.destroyed) throw "Container has been destroyed.";
if (!t)
if (a.LOCKED || n.global().QUBIT_CONTAINERS_LOCKED) return;
if (this.onBeforeRun) try {
this.onBeforeRun()
} catch (M) {}
var u = !this.containerScriptLoadedSynchronously();
var c = "runIfFiltersPass";
if (p && p.command) c = p.command;
this.runningStarted = (new Date).valueOf();
var b = {};
if (this.config.scanTags)
if (!this._scanned) {
this.scanForTags();
this._scanned = (new Date).valueOf()
}
this.prepareSessionIfNeeded();
var f = this.getTagsInOrder();
for (var l = 0; l < f.length; l++) try {
var z = f[l];
var D = z.config.name;
if (this.includedToRun(z)) {
var E = z.resolveDependencies();
if (E.length > 0)
for (var F = 0; F < E.length; F++) {
var H = E[F];
var K = H.config.name;
if (!b[K] && this.tags[K]) {
b[K] = H;
this._tagRunner(H, c, u)
}
}
if (!b[D]) {
b[D] = z;
this._tagRunner(z, c, u)
}
}
} catch (M) {}
m.setTimeout(function() {
this.sendPingsNotTooOften()
}.bind(this), 3100);
this.waitForAllTagsToFinish()
};
a.prototype.getTagsInOrder = function() {
var p = [];
for (var t in this.tags) {
var u = this.tags[t];
var c = u.config.priority;
if (+c > 0) {
var b = 0;
for (var f = 0; f < p.length; f++) {
var l = p[f];
if (l) {
var z = +l.config.priority;
if (z > 0 && z > c) b++;
else break
}
}
p.splice(b, 0, u)
} else p.push(u)
}
return p
};
a.prototype._tagRunner = function(p, t, u) {
try {
if (this.includedToRun(p)) {
if (u) p.forceAsynchronous = true;
if (this.config.delayDocWrite) p.delayDocWrite = true;
p.session = p.session || this.session;
p[t]()
}
} catch (c) {}
};
a.prototype.getContainerId = function() {
if (this.config.containerId) return this.config.containerId;
else {
if (this._pkgName) return this._pkgName;
var p =
this.PACKAGE_NAME.split(".");
p = p[p.length - 1];
this._pkgName = p;
return p
}
};
a.prototype.includedToRun = function(p) {
if (!p) return false;
var t = p.config;
if (t.inactive) return false;
if (t.disabled)
if (!p.cookieSaysToRunEvenIfDisabled()) return false;
if (p.disabledByCookie()) return false;
var u = a.consentIsGiven || !t.needsConsent || this.hasConsent();
var c = p.state === d.prototype.STATE.INITIAL;
return this.ignoreTagsState || u && c
};
a.prototype.scanForTags = function(p, t) {
if (p) this.tags = {};
var u;
if (t && typeof t === "object") u = this.findAllTags(t);
else u = this.findAllTagsByClassPath();
this.registerTags(u);
return u
};
a.prototype.findAllTags = function(p, t) {
p = p || this.tagsPackageName || this.PACKAGE_NAME;
return e.findAllTags(p, t)
};
a.prototype.findAllTagsByClassPath = function(p) {
p = p || this.PACKAGE_NAME;
return e.findAllTagsByClassPath(p)
};
a.prototype.findAllFilters = function(p, t) {
p = p || this.tagsPackageName || this.PACKAGE_NAME;
return e.findAllFilters(p, t)
};
a.prototype.waitForAllTagsToFinish = function() {
if (this._waitForAllTagsToFinishWaiting) return;
if (!this._lastWaited) this._lastWaited =
(new Date).valueOf();
var p = (new Date).valueOf() - this._lastWaited > 15 * 1E3;
var t = this.allTagsFinished() || p;
if (!this._showFinishedOnce && t) {
this._lastWaited = null;
if (p);
this._showFinishedOnce = true;
this.runningFinished = (new Date).valueOf();
this._containerAlreadySentPings = (new Date).valueOf();
this.sendPingsNotTooOften();
if (this.onTagsInitiallyRun) this.onTagsInitiallyRun()
} else if (!t) {
this._waitForAllTagsToFinishWaiting = true;
this._showFinishedOnce = false;
m.setTimeout(function() {
this._waitForAllTagsToFinishWaiting =
false;
this.waitForAllTagsToFinish()
}.bind(this), 100)
} else;
};
a.prototype.onTagsInitiallyRun = O;
a.prototype.resetAllTags = function(p) {
for (var t in this.tags)
if (this.tags.hasOwnProperty(t)) {
var u = this.tags[t];
u.reset();
if (!p) u.resetFilters()
}
};
a.prototype.reset = function(p) {
this.runningFinished = undefined;
this._waitForAllTagsToFinishWaiting = undefined;
this.runningStarted = undefined;
this._showFinishedOnce = undefined;
this.resetAllTags(p)
};
a.prototype.sendPingsNotTooOften = function() {
this._sndLck = this._sndLck || {};
m.runIfNotScheduled(this._sendPingsTrigger, 2E3, this._sndLck)
};
a.prototype.sendPings = function() {
if (this.config.noPings) return;
var p;
if (this.isTellingLoadTimes()) {
var t = this.getAllTagsByState();
var u = this;
var c = [];
if (t.run) c = e.getLoadTimes(t.run);
this.lastPingsSentTime = (new Date).valueOf();
this.ping.send(this, c);
c = e.getLoadTimes();
var b = [];
for (p = 0; p < c.length; p++) {
var f = c[p].tag;
if (f.config.dedupe && f.sendDedupePing) b.push(f)
}
if (b.length > 0) {
this.lastDedupePingsSentTime = (new Date).valueOf();
this.ping.sendDedupe(this,
b)
}
if (t.other) {
c = e.getLoadTimes(t.other);
var l = [];
for (p = 0; p < c.length; p++) l.push(c[p]);
if (l.length > 0) this.ping.send(this, l)
}
if (t.awaiting) {
c = e.getLoadTimes(t.awaiting);
var z = [];
for (p = 0; p < c.length; p++) z.push(c[p]);
if (z.length > 0) this.ping.send(this, z)
}
}
};
a.prototype.getAllTagsByState = function() {
return a.getAllTagsByState(this.tags)
};
a.getAllTagsByState = function(p) {
var t = null;
var u = null;
var c = null;
var b = null;
var f = null;
var l = null;
var z = d.prototype.STATE.EXECUTED_WITH_ERRORS;
for (var D in p) {
var E = p[D];
if (E instanceof d) {
var F = E.config.name;
if (E.scriptExecuted > 0) {
t = t || {};
q(t, E, F)
} else if (E.locked) {
l = l || {};
q(l, E, F)
} else if (E.scriptExecuted < 0 || E.state >= z) {
b = b || {};
q(b, E, F)
} else if (E.filtersState() === v.state.SESSION || E.filtersState() > 0) {
c = c || {};
q(c, E, F)
} else if (E.config.needsConsent) {
f = f || {};
q(f, E, F)
} else {
u = u || {};
q(u, E, F)
}
}
}
return {
run: t,
failed: b,
awaiting: c,
consent: f,
locked: l,
other: u
}
};
var w = {};
a.prototype.allTagsFinished = function() {
for (var p in this.tags)
if (this.tags.hasOwnProperty(p)) {
var t = this.tags[p];
if (t instanceof A.opentag.BaseTag) {
var u = t.filtersState();
if (!t.config.disabled) {
var c = t.filtersState() < 0 && !t.locked;
var b = !(t.finished() || t.config.runner && !t.isRunning);
if (c && b) {
var f = u !== v.state.SESSION;
var l = +t.awaitingDependencies > 0;
if (f && !l) return false
}
}
}
}
return true
};
a.prototype.getPageVariables = function() {
var p = [];
for (var t in this.tags)
if (this.tags.hasOwnProperty(t)) {
var u = this.tags[t].getPageVariables();
for (var c = 0; c < u.length; c++) n.addToArrayIfNotExist(p, u[c])
}
return p
};
a.getPageVariableByName =
function(p) {
var t = this.getAllPageVariables();
var u = [];
for (var c = 0; c < t.length; c++)
if (t[c].config.name === p) u.push(t[c]);
return u
};
var y = "qubit.opentag.disableContainerRunning_";
var C = "qubit.opentag.forceContainerRunning";
a.prototype._getCookieNameForDisabling = function() {
return y + this.getContainerId() + this.config.name
};
a.prototype.disabledByCookie = function() {
return !!r.get(this._getCookieNameForDisabling())
};
a.prototype.setCookieToDisable = function() {
r.set(this._getCookieNameForDisabling(), "true")
};
a.prototype.rmCookieToDisable =
function() {
r.rm(this._getCookieNameForDisabling())
};
a.rmAllDisablingCookies = function() {
n.rmCookiesMatching(y)
};
a.setCookieForDisabledContainersToRun = function() {
r.set(C, "true")
};
a.rmCookieForDisabledContainersToRun = function() {
r.rm(C)
}
})();
(function() {
function a(n) {
var v = {
url: null,
html: "",
locationPlaceHolder: "NOT_END",
locationObject: "BODY",
async: true
};
q.setIfUnset(n, v);
a.SUPER.call(this, n)
}
var q = A.opentag.Utils;
A.Define.clazz("qubit.opentag.CustomTag", a, A.opentag.LibraryTag)
})();
(function() {
function a(e) {
return e.replace(/^\s+/,
"").replace(/\s+$/, "")
}
var q = {
callbacks: {},
unfired_events: [],
early_callbacks: null,
currentUV: null
};
var n;
var v = "universal_variable";
var h = 0;
var d = 500;
var m;
q._isArray = function(e) {
return Object.prototype.toString.call(e) === "[object Array]"
};
q._targetChanged = function(e, k, r) {
var g;
var x;
var w;
if (r === null)
if (k === "null") return false;
else return true;
else if (r === undefined)
if (k === r) return false;
else return true;
else {
g = P.parse(k);
x = q._getNested(g, e);
w = q._getNested(r, e);
return !q._jsonIsEqual(x, w)
}
};
q._processCallbacks =
function() {
var e;
if (q.early_callbacks && q.early_callbacks.length > 0) {
for (e = 0; e < q.early_callbacks.length; e += 1) q.push(q.early_callbacks[e]);
q.early_callbacks = null
}
};
q._keyStringToArr = function(e) {
e = a(e);
if (e === "") return [];
else {
e = e.replace(/\[(\w+)\]/g, ".$1");
e = e.replace(/^\./, "");
return e.split(".")
}
};
q._getNested = function(e, k) {
var r = q._keyStringToArr(k);
for (var g; r.length > 0;) {
g = r.shift();
if (e.hasOwnProperty(g)) e = e[g];
else return
}
return e
};
q._jsonIsEqual = function(e, k) {
if (typeof e !== "string") e = P.stringify(e,
q._stripEvents);
if (typeof k !== "string") k = P.stringify(k, q._stripEvents);
return e === k
};
q._stripEvents = function(e, k) {
if (e !== "events") return k;
else return undefined
};
q._on = function(e, k) {
var r;
var g;
r = e.split(":");
e = r[0];
g = r[1];
q.callbacks[e] = q.callbacks[e] || [];
if (g) q.callbacks[e].push({
keyString: g,
func: k
});
else q.callbacks[e].push({
func: k
})
};
q._trigger = function(e, k) {
var r;
var g;
if (q.callbacks[e])
for (r = 0; r < q.callbacks[e].length; r += 1)
if (typeof q.callbacks[e][r].func === "function") {
g = q.callbacks[e][r].keyString;
if (g) {
if (e === "change" && q._targetChanged(g, q.currentUV, n)) q.callbacks[e][r].func(k)
} else q.callbacks[e][r].func(k)
}
};
q._eventsPush = function(e) {
var k;
var r;
n.events[n.events.length] = e;
e.time = e.time || (new Date).getTime();
if (q.callbacks.event) {
k = 0;
r = q.callbacks.event.length;
for (k; k < r; k += 1) q.callbacks.event[k].func(e)
}
e.has_fired = true
};
q._getUnfiredEvents = function() {
var e = 0;
for (e = 0; e < n.events.length; e += 1)
if (!n.events[e].has_fired) {
q.unfired_events.push(n.events.splice(e, 1)[0]);
e -= 1
}
};
q._fireEvents = function() {
for (; q.unfired_events.length >
0;) n.events.push(q.unfired_events.shift())
};
q._resetEventsPush = function() {
n.events = n.events || [];
if (n.events.push.toString().indexOf("[native code]") !== -1) {
n.events.push = q._eventsPush;
q._getUnfiredEvents();
q._fireEvents()
}
};
q._checkForChanges = function() {
if (q.callbacks.change && q.callbacks.change.length > 0)
if (!q._jsonIsEqual(q.currentUV, n)) {
q._trigger("change", n);
q.currentUV = P.stringify(n, q._stripEvents)
}
};
q._setUVLocation = function(e) {
v = e;
q._initUV()
};
q._initUV = function() {
window[v] = window[v] || {
events: []
};
n = window[v];
if (!n.events) n.events = []
};
q.push = function(e) {
if (!q._isArray(e)) return;
if (e[0] === "on") q._on(e[1], e[2]);
else if (e[0] === "trigger" && e[1]) q._trigger(e[1])
};
q.init = function(e, k) {
if (k) v = k;
q._initUV();
if (!window.uv_listener || q._isArray(window.uv_listener)) {
q.early_callbacks = window.uv_listener || null;
window.uv_listener = q;
if (!e) q.start()
} else if (k) window.uv_listener._setUVLocation(v)
};
q.start = function() {
q.currentUV = P.stringify(n, q._stripEvents);
m = setInterval(function() {
q._initUV();
q._resetEventsPush();
q._checkForChanges()
}, d);
q._processCallbacks()
};
J.html.UVListener = q
})();
(function() {
function a() {}
function q() {
var k = false;
if (m.get("opentag_debug") || document.location.href.indexOf("opentag_debug") >= 0) k = true;
return k
}
function n() {
var k = false;
if (m.get("opentag_debug_tool") || document.location.href.indexOf("opentag_debug_tool") >= 0) k = true;
return k
}
function v() {
try {
var k = L.TAGSDK_MAIN_DISABLED_FUNCTION;
if (k && k()) return true
} catch (r) {}
if (document.location.href.indexOf("opentag_disabled\x3dtrue") >= 0) return true;
return false
}
function h(k, r, g) {
if (g && (k[r] === undefined || k[r] === "" || k[r] === null)) k[r] = g
}
function d(k) {
var r = A.opentag.Utils.getParentObject(k.PACKAGE_NAME);
var g = r.ClientConfig;
if (g && g.clientId) return g.clientId;
else {
var x = k.PACKAGE_NAME.split(".");
return x[x.length - 2].substring(1)
}
}
var m = A.Cookie;
var e = A.opentag.Utils;
A.opentag.Log.setLevelFromCookie();
a.run = function() {
var k = false;
if (v()) return;
var r = false;
var g = n();
var x = g || q();
if (!r && x) {
if (!A.DEBUG_MODE) L.TAGSDK_NS_OVERRIDE = true;
else L.TAGSDK_NS_OVERRIDE =
false;
k = true
}
if (A.DEBUG_MODE) L.TAGSDK_NS_OVERRIDE = false;
try {
J.html.UVListener.init()
} catch (w) {}
a.runAllContainers(k)
};
a.runAllContainers = function(k) {
try {
var r = A.opentag.Container.getContainers();
for (var g = 0; g < r.length; g++) {
var x = r[g];
var w = x.config;
if (!x.runningStarted && !x.configuredInMain) {
w.scanTags = true;
var y = e.getParentObject(x.PACKAGE_NAME).ClientConfig;
if (y) h(x.config, "clientId", y.id);
var C = e.getParentObject(x.PACKAGE_NAME).SystemDefaults;
if (C) {
h(w, "pingServerUrl", C.pingServerUrl);
h(w, "tellLoadTimesProbability",
C.tellLoadTimesProbability)
}
x.configuredInMain = true;
if (k) {
x.destroy(true);
a.loadDebugVersion(x)
} else if (!L.QUBIT_OPENTAG_STOP_MAIN_EXECUTION) x.run();
else(function() {
var p = A.opentag.RUN_STOPPED_EXECUTON;
A.opentag.RUN_STOPPED_EXECUTON = function() {
try {
if (p) p()
} finally {
x.run()
}
}
})(x)
}
}
} catch (p) {}
};
a.loadDebugVersion = function(k) {
var r = document.createElement("script");
var g;
var x = k.config.scriptURL;
var w = d(k);
var y = k.getContainerId();
if (x) {
g = x;
var C = "-debug.js".length;
if (g.lastIndexOf("-debug.js") !== g.length -
C) {
g = g.substring(0, g.length - ".js".length);
g += "-debug.js"
}
}
var p = "//d3c3cq33003psk.cloudfront.net/opentag-" + w + "-" + y + "-debug.js";
if (g && p !== g) r.src = g;
else r.src = "//s3-eu-west-1.amazonaws.com/opentag/opentag-" + w + "-" + y + "-debug.js";
document.getElementsByTagName("head")[0].appendChild(r)
};
A.Define.namespace("qubit.opentag.Main", a)
})();
(function q() {
function n() {
function v(u) {
p.level = u
}
function h(u, c) {
p.info(u, "event emitted");
c = g(c || {});
c.meta = c.meta || {};
c.meta.type = u;
y.push(c);
e();
t.listeners = w(t.listeners,
function(b) {
return !b.disposed
})
}
function d(u, c, b) {
function f() {
p.info("Replaying events");
m(function() {
r(t.events, function(E) {
if (z.disposed) return;
if (!x(u, E.meta.type)) return;
c.call(b, E)
})
});
return D
}
function l() {
p.info("Disposing event handler");
z.disposed = true;
return D
}
p.info("Attaching event handler for", u);
var z = {
type: u,
callback: c,
disposed: false,
context: b || window
};
t.listeners.push(z);
var D = {
replay: f,
dispose: l
};
return D
}
function m(u) {
p.info("Calling event handlers");
C++;
try {
u()
} catch (c) {
p.error("UV API Error",
c.stack)
}
C--;
e()
}
function e() {
if (y.length === 0) p.info("No more events to process");
if (y.length > 0 && C > 0) p.info("Event will be processed later");
if (y.length > 0 && C === 0) {
p.info("Processing event");
var u = y.shift();
t.events.push(u);
m(function() {
r(t.listeners, function(c) {
if (c.disposed) return;
if (!x(c.type, u.meta.type)) return;
try {
c.callback.call(c.context, u)
} catch (b) {
p.error("Error emitting UV event", b.stack)
}
})
})
}
}
function k(u, c, b) {
var f = t.on(u, function() {
c.apply(b || window, arguments);
f.dispose()
});
return f
}
function r(u, c) {
var b = u.length;
for (var f = 0; f < b; f++) c(u[f], f)
}
function g(u) {
var c = {};
for (var b in u)
if (u.hasOwnProperty(b)) c[b] = u[b];
return c
}
function x(u, c) {
return typeof u === "string" ? u === c : u.test(c)
}
function w(u, c) {
var b = u.length;
var f = [];
for (var l = 0; l < b; l++)
if (c(u[l])) f.push(u[l]);
return f
}
var y = [];
var C = 0;
var p = {
info: function c() {
if (p.level > v.INFO) return;
if (console && console.info) console.info.apply(console, arguments)
},
error: function b() {
if (p.level > v.ERROR) return;
if (console && console.error) console.error.apply(console,
arguments)
}
};
v.ALL = 0;
v.INFO = 1;
v.ERROR = 2;
v.OFF = 3;
v(v.ERROR);
var t = {
on: d,
emit: h,
once: k,
events: [],
listeners: [],
logLevel: v
};
return t
}
if (typeof module === "object" && module.exports) module.exports = n;
else if (window && window.uv === undefined) window.uv = n()
})();
var Y = {};
var X = [];
var da = false;
var Z = false;
var ha = A.Define.global();
var ga = {
allEventsByType: Y,
subscribe: function(q, n) {
if (Z) {
var v = I();
v.on(q, n)
} else X.push({
on: [q, n]
})
},
getEventHistory: function(q) {
return this.allEventsByType[q]
},
publish: function(q, n) {
if (Z) {
var v =
I();
v.emit(q, n)
} else X.push({
emit: [q, n]
})
},
connect: function() {
B()
}
};
ga.connect();
A.Define.namespace("qubit.qprotocol.PubSub", ga);
(function() {
function q(d) {
q.SUPER.apply(this, arguments)
}
var n = A.qprotocol.PubSub;
var v = A.opentag.Utils;
var h = ":";
A.Define.clazz("qubit.opentag.pagevariable.QProtocolVariable", q, A.opentag.pagevariable.BaseVariable);
q.prototype.init = function() {
if (this.initialized) return false;
else this.initialized = (new Date).valueOf();
this.callHandlersOnRead = true;
if (!this.handlerAttached) {
var d =
this;
var m = this.getValueAndPath(this.value);
this.eventName = m[0];
this.objectPath = m[1];
this.updateValue();
n.subscribe(this.eventName, function(e) {
d.updateValue(e)
});
this.handlerAttached = (new Date).valueOf()
}
};
q.prototype.getValueAndPath = function(d) {
var m = d;
var e;
if (m) {
var k = d.indexOf(h);
if (k !== -1) {
m = d.substring(0, k);
e = d.substring(k + 1)
}
}
return [m, e]
};
q.prototype.getValue = function() {
this.init();
return this.currentValue
};
q.prototype.getEventsHistory = function() {
return n.getEventHistory(this.eventName)
};
q.prototype.updateValue =
function(d) {
if (!d) {
var m = this.getEventsHistory();
if (m) d = m.current
}
var e;
var k = this.objectPath;
if (d && k) e = v.getObjectUsingPath(k, d);
else e = d;
this._updateCurrentValue(e);
return e
};
q.prototype.startObservingForChanges = function() {};
q.prototype.stopObservingForChanges = function() {}
})();
(function() {
function q(n) {
q.SUPER.apply(this, arguments)
}
A.Define.clazz("qubit.opentag.pagevariable.UniversalVariable", q, A.opentag.pagevariable.Expression)
})()
})()
})();
(function() {})();
(function() {
var I = qubit.opentag.Container;
var B = new I({
"maxCookieLength": 3E3,
"cookieDomain": "parade.com",
"pingServerUrl": "",
"delayDocWrite": true,
"name": "parade prod",
"gzip": true,
"disabled": false,
"tellLoadTimesProbability": 1,
"containerId": 547608
});
var G = "paradeprod.Container";
qubit.Define.clientNamespace(G, B)
})();
(function() {
var I = qubit.opentag.pagevariable.BaseVariable;
var B = new I({
"name": "Account Number"
});
var G = "paradeprod.variables.AccountNumber";
qubit.Define.clientNamespace(G, B);
B.value = "p-66loUeMQKS31Y"
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"include": true,
"name": "test target",
"pattern": "/26751/",
"patternType": "CONTAINS",
"priority": 1
});
var G = "paradeprod.filters.TestTarget";
qubit.Define.clientNamespace(G, B);
B.customStarter = null;
B.customScript = null;
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"include": true,
"name": "Default filter: Match all",
"pattern": "",
"patternType": "ALL_URLS",
"priority": 1
});
var G = "paradeprod.filters.DefaultFilterMatchAll";
qubit.Define.clientNamespace(G, B);
B.customStarter = null;
B.customScript = null;
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"name": "Include only Nongallery"
});
var G = "paradeprod.filters.IncludeOnlyNongallery";
qubit.Define.clientNamespace(G, B);
B.customStarter = function(L, V) {
var A = function() {
if (window.parade && typeof window.parade.post !== "undefined") {
if (window.parade.post && window.parade.post.post_content && window.parade.post.post_content.includes("[gallery") !== true) V()
} else setTimeout(A, 200)
};
A()
};
B.customScript = function(L) {
return true
};
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"include": true,
"name": "Include only Posts",
"priority": 1
});
var G = "paradeprod.filters.IncludeOnlyPosts";
qubit.Define.clientNamespace(G, B);
B.customStarter = function(L, V) {
var A = function() {
if ("undefined" !== window.parade && "undefined" !== window.parade.current && "undefined" !== typeof window.parade.current.type)
if (window.parade.current.type.post) V();
else setTimeout(A, 200)
};
A()
};
B.customScript = function(L) {
return true
};
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"include": true,
"name": "Default filter: Match all(2)",
"pattern": "/235876/",
"patternType": "CONTAINS",
"priority": 2
});
var G = "paradeprod.filters.DefaultFilterMatchAll2";
qubit.Define.clientNamespace(G, B);
B.customStarter = null;
B.customScript = null;
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"include": true,
"name": "Default filter: Match all(1)",
"pattern": "/155648/",
"patternType": "CONTAINS",
"priority": 1
});
var G = "paradeprod.filters.DefaultFilterMatchAll1";
qubit.Define.clientNamespace(G, B);
B.customStarter = null;
B.customScript = null;
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.filter.Filter;
var B = new I({
"name": "Include only Gallery"
});
var G = "paradeprod.filters.IncludeOnlyGallery";
qubit.Define.clientNamespace(G, B);
B.customStarter = function(L, V) {
var A = function() {
if (window.parade && typeof window.parade.post !== "undefined") {
if (window.parade.post && window.parade.post.post_content && window.parade.post.post_content.includes("[gallery") === true) V()
} else setTimeout(A, 200)
};
A()
};
B.customScript = function(L) {
return true
};
B.lexicalPattern = ""
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "GumGum",
"disabled": false,
"id": 15394422,
"locked": false,
"locationObject": "BODY"
});
var G = "paradeprod.tags.gumgum.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "\x3cstyle\x3e\n iframe[name\x3d'ggmodal']+div{top:40px!important}\n\x3c/style\x3e\n\x3cscript type\x3d\"text/javascript\"\x3e\n (function (app) {\n //we can't guarantee our value exists, so we need to safely check for it\n //this isEmpty() function is a \"helper\" function; we use it to keep the code short\n //this is a \"named\" function (in contrast with an anonymous function) and we named it isEmpty\n function isEmpty(val) {\n return ('undefined' \x3d\x3d\x3d typeof val || null \x3d\x3d\x3d val) ? true : false;\n }\n if (isEmpty(app.current) || isEmpty(app.current.primary) || isEmpty(app.current.primary.channel)) {\n throw Error('No app.current or app.current.primary or app.current.primary.channel');\n return; //bail out if app.current.primary.channel doesn't exist\n } else if (isEmpty(app.current.primary.channel)) {\n app.current.primary.channel.slug \x3d 'uncategorized';\n }\n //we're going to set this variable, so we declare it\n var id \x3d null;\n //a switch statement is a fancy way of avoiding a lot of if statements\n //calling tolowercase ensures that if we change upper/lower case it still works\n switch (app.current.primary.channel.slug.toLowerCase()) {\n case 'entertainment':\n id \x3d 'e157c3fe';\n break;\n case 'food':\n id \x3d '79a1339f';\n break;\n case 'health':\n id \x3d 'ac796d4d';\n break;\n case 'living':\n id \x3d '7ec15fdb';\n break;\n default:\n id \x3d '9d6a5b89'; //defaults to uncategorized\n break;\n }\n //the gumgum script actually needs a global, so we set it here on the global window object\n //we reach out of the closure explicitly to do so\n window.ggv2id \x3d id;\n })(window.parade || {});\n //we pass in window.parade so that if we make changes (such as assinging\n // 'uncategorized') it only happens to a \"local\" copy and not the actual window.parade object\n //(else you might screw something up accidentally by meddling with the value)\n\x3c/script\x3e\n\x3cscript type\x3d\"text/javascript\" src\x3d\"https://g2.gumgum.com/javascripts/ggv2.js\"\x3e\x3c/script\x3e";
B.addClientFiltersList(["paradeprod.filters.IncludeOnlyNongallery"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": 5E3,
"async": true,
"usesDocumentWrite": false,
"name": "Hotjar",
"disabled": false,
"id": 40061146,
"locked": false,
"locationObject": "HEAD"
});
var G = "paradeprod.tags.hotjar.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = '\x3c!-- Hotjar Tracking Code for www.parade.com --\x3e\n\x3cscript\x3e\n (function(f,b){\n var c;\n f.hj\x3df.hj||function(){(f.hj.q\x3df.hj.q||[]).push(arguments)};\n f._hjSettings\x3d{hjid:34499, hjsv:4};\n c\x3db.createElement("script");c.async\x3d1;\n c.src\x3d"//static.hotjar.com/c/hotjar-"+f._hjSettings.hjid+".js?sv\x3d"+f._hjSettings.hjsv;\n b.getElementsByTagName("head")[0].appendChild(c); \n })(window,document);\n\x3c/script\x3e';
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList([]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "NOT_END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": 5E3,
"async": true,
"usesDocumentWrite": false,
"name": "AMG comscore",
"disabled": false,
"id": 33648037,
"locked": false,
"locationObject": "HEAD"
});
var G = "paradeprod.tags.amgcomscore.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = '\x3c!-- Begin comScore Tag --\x3e \n \x3cscript\x3e \n var _comscore \x3d _comscore || []; \n _comscore.push({ c1: "2", c2: "8207537", c4: "${URL}" }); \n (function() { \n var s \x3d document.createElement("script"), el \x3d \n document.getElementsByTagName("script")[0]; s.async \x3d true; \n s.src \x3d (document.location.protocol \x3d\x3d "https:" ? "https://sb" : "http://b") + \n ".scorecardresearch.com/beacon.js"; \n el.parentNode.insertBefore(s, el); \n })(); \n \x3c/script\x3e \n \x3cnoscript\x3e \n \x3cimg src\x3d"http://b.scorecardresearch.com/p?c1\x3d2\x26c2\x3d6035094\x26c4\x3d${URL}" /\x3e \n \x3c/noscript\x3e \n \x3c!-- End comScore Tag --\x3e';
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList([]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "Quantcast-p1-121013",
"disabled": false,
"id": 15738415,
"locked": false,
"locationObject": "HEAD"
});
var G = "paradeprod.tags.quantcastp1121013.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = '\x3c!-- Quantcast Tag --\x3e\n\x3cscript type\x3d"text/javascript"\x3e\nvar _qevents \x3d _qevents || [];\n\n(function() {\nvar elem \x3d document.createElement(\'script\');\nelem.src \x3d (document.location.protocol \x3d\x3d "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";\nelem.async \x3d true;\nelem.type \x3d "text/javascript";\nvar scpt \x3d document.getElementsByTagName(\'script\')[0];\nscpt.parentNode.insertBefore(elem, scpt);\n})();\n\n\x3c/script\x3e';
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList([]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "NOT_END",
"needsConsent": false,
"active": true,
"url": "https://s7.addthis.com/js/300/addthis_widget.js?#async\x3d1\x26pub_id\x3dra-514ca7213fe7a0c3",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "Addthis v2",
"disabled": false,
"id": 15720926,
"locked": false,
"locationObject": "HEAD"
});
var G = "paradeprod.tags.addthisv2.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "";
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList([]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "NOT_END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "Lytics V4",
"disabled": false,
"id": 15702632,
"locked": false,
"locationObject": "HEAD"
});
var G = "paradeprod.tags.lyticsv4.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = '\x3cscript type\x3d"text/javascript"\x3e\n window.jstag\x3dfunction(){var t\x3d{_q:[],_c:{},ts:(new Date).getTime()},l\x3dfalse,w\x3dwindow,d\x3ddocument,src\x3d"/static/io",as\x3dArray.prototype.slice,sp;t.init\x3dfunction(c){sp\x3dc.js?c.js:c.url||"";c.ext\x3dc.ext||".min.js";t._c\x3dc;return this};t.load\x3dfunction(){var js,fjs\x3dd.getElementsByTagName("script")[0];l\x3dtrue;if(!("JSON"in w\x26\x26Array.prototype.forEach))src+\x3d"w";if(d.getElementById(src))return this;js\x3dd.createElement("script");js.id\x3dsrc;js.src\x3dsp+src+t._c.ext;fjs.parentNode.insertBefore(js,fjs);return this};t.bind\x3dfunction(e){this._q.push([e,as.call(arguments,1)])};t.ready\x3dfunction(){this._q.push(["ready",as.call(arguments)])};t.send\x3dfunction(){if(!l)this.load();this._q.push(["ready","send",as.call(arguments)]);return this};return t}();\n jstag.init({cid:"1299",url:"//c.lytics.io"}).send();\n \n (function(w){\n var lfbInt;\n function waitForFB(){\n try {\n if (w.FB \x26\x26 !w.FB.jstagRun) {\n w.FB.jstagRun \x3d true;\n FB.getLoginStatus(function(response) {\n if (response.status \x3d\x3d\x3d \'connected\') {\n jstag.send({fbstatus:"c",fbuid:response.authResponse.userID})\n }\n clearInterval(lfbInt);\n });\n return\n }\n } catch (err) {}\n }\n lfbInt \x3d setInterval(waitForFB,500);\n }(window));\n \n \x3c/script\x3e';
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "Addthis Init v2",
"disabled": false,
"id": 15720937,
"locked": false,
"locationObject": "BODY"
});
var G = "paradeprod.tags.addthisinitv2.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "\x3cscript type\x3d\"text/javascript\"\x3e\n(function(){\n if ( 'undefined' !\x3d\x3d typeof addthis \x26\x26 'function' \x3d\x3d\x3d typeof addthis.init ) {\n addthis.init();\n } \n})();\n\x3c/script\x3e";
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "Quantcast-p2-121013",
"disabled": false,
"id": 15738418,
"locked": false,
"locationObject": "BODY"
});
var G = "paradeprod.tags.quantcastp2121013.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = '\x3c!-- Quantcast Tag, part 2 --\x3e\n\x3cscript\x3e\n _qevents.push({\n qacct:"p-66loUeMQKS31Y"\n });\n\x3c/script\x3e\n\n\x3cnoscript\x3e\n \x3cdiv style\x3d"display:none;"\x3e\n \t\x3cimg src\x3d"//pixel.quantserve.com/pixel/p-66loUeMQKS31Y.gif" border\x3d"0" height\x3d"1" width\x3d"1" alt\x3d"Quantcast"/\x3e\n \x3c/div\x3e\n\x3c/noscript\x3e\n\x3c!-- End Quantcast tag, part 2 --\x3e';
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.quantcastp1121013.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": 5E3,
"async": true,
"usesDocumentWrite": true,
"name": "Zergnet + Outbrain",
"disabled": false,
"id": 16048338,
"locked": false,
"locationObject": "BODY"
});
var G = "paradeprod.tags.zergnetoutbrain.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "\x3cscript type\x3d\"text/javascript\"\x3e\n // (function () {\n // if ('undefined' !\x3d\x3d typeof window.parade \x26\x26 'undefined' !\x3d\x3d typeof window.jQuery) {\n // var zergnet, znscr, outbrain, obscr, nomatch \x3d false;\n // if ('undefined' !\x3d\x3d typeof window.parade.current \x26\x26 null !\x3d\x3d window.parade.current) {\n // if ('undefined' !\x3d\x3d typeof window.parade.current.primary \x26\x26 null !\x3d\x3d window.parade.current.primary \x26\x26 'undefined' !\x3d\x3d typeof window.parade.current.primary.channel \x26\x26 null !\x3d\x3d window.parade.current.primary.channel) {\n // if (true !\x3d\x3d window.parade.current.format.single){\n // nomatch \x3d true;\n // } else if ('food' \x3d\x3d\x3d window.parade.current.primary.channel.slug) {\n // if (true \x3d\x3d\x3d window.parade.is_desktop) {\n // /* 4x1 @ TKpx tall: 17772*/\n // $('.more_stories \x3e .OUTBRAIN').replaceWith('\x3cdiv id\x3d\"zergnet-widget-17772\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e');\n // zergnet \x3d document.createElement('script');\n // zergnet.type \x3d 'text/javascript';\n // zergnet.async \x3d true;\n // zergnet.src \x3d 'http://www.zergnet.com/zerg.js?id\x3d17772';\n // znscr \x3d document.getElementsByTagName('script')[0];\n // znscr.parentNode.insertBefore(zergnet, znscr);\n // } else if (true \x3d\x3d\x3d window.parade.is_phone) {\n // /* 2x2 @ 300px tall: 18425 */\n // $('.more_stories \x3e .OUTBRAIN').replaceWith('\x3cdiv id\x3d\"zergnet-widget-18425\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e');\n // zergnet \x3d document.createElement('script');\n // zergnet.type \x3d 'text/javascript';\n // zergnet.async \x3d true;\n // zergnet.src \x3d 'http://www.zergnet.com/zerg.js?id\x3d18425'; /* 2x2 @ 350px tall: 18424 */\n // znscr \x3d document.getElementsByTagName('script')[0];\n // znscr.parentNode.insertBefore(zergnet, znscr);\n // } else {\n // nomatch \x3d true;\n // }\n // } else if ('health' \x3d\x3d\x3d window.parade.current.primary.channel.slug || 'living' \x3d\x3d\x3d window.parade.current.primary.channel.slug) {\n // if (true \x3d\x3d\x3d window.parade.is_desktop) {\n // $('.more_stories \x3e .OUTBRAIN').replaceWith('\x3cdiv id\x3d\"zergnet-widget-18426\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e');\n // zergnet \x3d document.createElement('script');\n // zergnet.type \x3d 'text/javascript';\n // zergnet.async \x3d true;\n // zergnet.src \x3d 'http://www.zergnet.com/zerg.js?id\x3d18426';\n // znscr \x3d document.getElementsByTagName('script')[0];\n // znscr.parentNode.insertBefore(zergnet, znscr);\n // } else {\n // nomatch \x3d true;\n // }\n // } else {\n // nomatch \x3d true;\n // }\n // } else {\n // nomatch \x3d true;\n // }\n // }\n // if (true \x3d\x3d\x3d nomatch) {\n // if ('undefined' !\x3d\x3d typeof window.parade.current.format \x26\x26 null !\x3d\x3d window.parade.current.format \x26\x26 true \x3d\x3d\x3d window.parade.current.format.single) {\n // outbrain \x3d document.createElement('script');\n // outbrain.type \x3d 'text/javascript';\n // outbrain.async \x3d true;\n // outbrain.src \x3d 'http://widgets.outbrain.com/outbrain.js';\n // obscr \x3d document.getElementsByTagName('script')[0];\n // obscr.parentNode.insertBefore(outbrain, obscr);\n // }\n // }\n // }\n //})();\n;(function () {\n if (typeof window.parade !\x3d\x3d \"undefined\" \x26\x26 typeof window.jQuery !\x3d\x3d \"undefined\") {\n var zergnet;\n var znscr;\n var outbrain;\n var obscr;\n var nomatch \x3d true;\n var copy \x3d '\x3ch7\x3eFrom Our Partners\x3c/h7\x3e';\n var hasGames \x3d (function hasGames(cats, is_numbrix) {\n return function() {\n if (is_numbrix) {\n \t return true;\n }\n\n var has \x3d false;\n for (var x \x3d 0; x \x3c cats.length; x +\x3d 1) {\n var xitem \x3d cats[x];\n if (xitem.slug \x3d\x3d\x3d \"fun-and-games\") {\n has \x3d true;\n }\n }\n return has;\n };\n }((!!window.parade \x26\x26 !!window.parade.current \x26\x26 !!window.parade.current.categories) ? window.parade.current.categories : [], (!!window.parade \x26\x26 !!window.parade.current \x26\x26 !!window.parade.current.type) ? window.parade.current.type.numbrix : false));\n\n if (typeof window.parade.current !\x3d\x3d \"undefined\" \x26\x26 window.parade.current !\x3d\x3d null \x26\x26 typeof window.parade.current.format !\x3d\x3d \"undefined\"\n \x26\x26 window.parade.current.format !\x3d\x3d null \x26\x26 window.parade.current.format.single) {\n\n if (typeof window.parade.current.primary !\x3d\x3d \"undefined\" \x26\x26 window.parade.current.primary !\x3d\x3d null \x26\x26 typeof window.parade.current.primary.channel !\x3d\x3d \"undefined\" \x26\x26 window.parade.current.primary.channel !\x3d\x3d null) {\n\n nomatch \x3d false;\n var zergWidget \x3d function () {\n if (window.parade.is_desktop) {\n $('.more_stories \x3e .OUTBRAIN').replaceWith(copy + '\x3cdiv id\x3d\"zergnet-widget-29229\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e\x3cdiv id\x3d\"zergnet-widget-35388\"\x3e\x3c/div\x3e');\n\t\t zergnet \x3d document.createElement('script');\n\t\t zergnet.type \x3d 'text/javascript';\n zergnet.async \x3d true;\n\t\t zergnet.src \x3d 'https://www.zergnet.com/zerg.js?id\x3d29229';\n\t\t znscr \x3d document.getElementsByTagName('script')[0];\n\t\t znscr.parentNode.insertBefore(zergnet, znscr);\n\n zergnet_paid \x3d document.createElement('script');\n\t\t zergnet_paid.type \x3d 'text/javascript';\n zergnet_paid.async \x3d true;\n\t\t zergnet_paid.src \x3d 'https://www.zergnet.com/zerg.js?id\x3d35388';\n\t\t znscr.parentNode.insertBefore(zergnet_paid, znscr);\n } else {\n $('.more_stories \x3e .OUTBRAIN').replaceWith(copy + '\x3cdiv id\x3d\"zergnet-widget-29232\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e\x3cdiv id\x3d\"zergnet-widget-35388\"\x3e\x3c/div\x3e');\n\t\t zergnet \x3d document.createElement('script');\n\t\t zergnet.type \x3d 'text/javascript';\n zergnet.async \x3d true;\n\t\t zergnet.src \x3d 'https://www.zergnet.com/zerg.js?id\x3d29232';\n\t\t znscr \x3d document.getElementsByTagName('script')[0];\n\t\t znscr.parentNode.insertBefore(zergnet, znscr);\n \n zergnet_paid \x3d document.createElement('script');\n\t\t zergnet_paid.type \x3d 'text/javascript';\n zergnet_paid.async \x3d true;\n\t\t zergnet_paid.src \x3d 'https://www.zergnet.com/zerg.js?id\x3d35388';\n\t\t znscr.parentNode.insertBefore(zergnet_paid, znscr);\n }\n };\n\n var gamesWidget \x3d function () {\n $('.more_stories \x3e .OUTBRAIN').replaceWith(copy + '\x3cdiv id\x3d\"zergnet-widget-22097\" style\x3d\"text-align:center;\"\x3e\x3c/div\x3e');\n zergnet \x3d document.createElement('script');\n zergnet.type \x3d 'text/javascript';\n zergnet.async \x3d true;\n zergnet.src \x3d 'https://www.zergnet.com/zerg.js?id\x3d22097';\n znscr \x3d document.getElementsByTagName('script')[0];\n znscr.parentNode.insertBefore(zergnet, znscr);\n };\n\n if (!nomatch \x26\x26 hasGames()) {\n gamesWidget();\n } else if (!nomatch) {\n zergWidget();\n }\n\n if (window.parade.is_phone) {\n $('body').append(['\x3cstyle type\x3d\"text/css\"\x3e',\n ' .zerglayoutcl {',\n ' width: 100% !important;',\n ' font-family: \"proxima-nova-n4\", \"proxima-nova\", \"Helvetica Neue\", Helvetica !important;',\n ' }',\n ' .zergentity {',\n ' width: 98% !important;',\n ' margin-left: 1% !important;',\n ' margin-right: 1% !important;',\n ' font-family: \"proxima-nova-n4\", \"proxima-nova\", \"Helvetica Neue\", Helvetica !important;',\n ' }',\n ' .zergentity img {',\n ' display: block !important;',\n ' max-width: 100% !important;',\n ' height: auto !important;',\n ' width: auto !important;',\n ' }',\n ' .zergentity a {',\n ' float: left !important;',\n ' width: 46% !important;',\n ' margin-right: 4%;',\n ' font-family: \"proxima-nova-n4\", \"proxima-nova\", \"Helvetica Neue\", Helvetica !important;',\n ' }',\n ' .zergheadline {',\n ' margin-top: 10px !important;',\n ' text-align: left !important;',\n ' font-family: \"proxima-nova-n4\", \"proxima-nova\", \"Helvetica Neue\", Helvetica !important;',\n ' }',\n ' \x3c/style\x3e'\n ].join(''));\n }\n }\n }\n\n if (nomatch) {\n if (typeof window.parade.current.format !\x3d\x3d \"undefined\" \x26\x26 window.parade.current.format !\x3d\x3d null \x26\x26 window.parade.current.format.single) {\n outbrain \x3d document.createElement('script');\n outbrain.type \x3d 'text/javascript';\n outbrain.async \x3d true;\n outbrain.src \x3d 'https://widgets.outbrain.com/outbrain.js';\n obscr \x3d document.getElementsByTagName('script')[0];\n obscr.parentNode.insertBefore(outbrain, obscr);\n }\n }\n }\n})(); \n\x3c/script\x3e";
B.addClientFiltersList(["paradeprod.filters.DefaultFilterMatchAll"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"locationPlaceHolder": "END",
"name": "GumGum - Gallery",
"disabled": false,
"timeout": "-1"
});
var G = "paradeprod.tags.gumgumgallery.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "\x3cstyle\x3e\n iframe[name\x3d'ggmodal']+div{top:40px!important}\n\x3c/style\x3e\n\x3cscript type\x3d\"text/javascript\"\x3e\n (function (app) {\n //we can't guarantee our value exists, so we need to safely check for it\n //this isEmpty() function is a \"helper\" function; we use it to keep the code short\n //this is a \"named\" function (in contrast with an anonymous function) and we named it isEmpty\n function isEmpty(val) {\n return ('undefined' \x3d\x3d\x3d typeof val || null \x3d\x3d\x3d val) ? true : false;\n }\n if (isEmpty(app.current) || isEmpty(app.current.primary) || isEmpty(app.current.primary.channel)) {\n throw Error('No app.current or app.current.primary or app.current.primary.channel');\n return; //bail out if app.current.primary.channel doesn't exist\n } else if (isEmpty(app.current.primary.channel)) {\n app.current.primary.channel.slug \x3d 'uncategorized';\n }\n //we're going to set this variable, so we declare it\n var id \x3d null;\n //a switch statement is a fancy way of avoiding a lot of if statements\n //calling tolowercase ensures that if we change upper/lower case it still works\n switch (app.current.primary.channel.slug.toLowerCase()) {\n case 'entertainment':\n id \x3d 'e157c3fe';\n break;\n case 'food':\n id \x3d '79a1339f';\n break;\n case 'health':\n id \x3d 'ac796d4d';\n break;\n case 'living':\n id \x3d '7ec15fdb';\n break;\n default:\n id \x3d '9d6a5b89'; //defaults to uncategorized\n break;\n }\n //the gumgum script actually needs a global, so we set it here on the global window object\n //we reach out of the closure explicitly to do so\n window.ggv2id \x3d id;\n })(window.parade || {});\n //we pass in window.parade so that if we make changes (such as assinging\n // 'uncategorized') it only happens to a \"local\" copy and not the actual window.parade object\n //(else you might screw something up accidentally by meddling with the value)\n\x3c/script\x3e\n\x3cscript\x3e!function(){top.ggproducts\x3d[1];var a,b\x3dwindow.ggv2id,c\x3d\"https://g2.gumgum.com/javascripts/ggv2.js\",d\x3dtop,e\x3d\"script\",f\x3dd.document,g\x3df.getElementsByTagName(e)[0],h\x3dd.XMLHttpRequest||d.XDomainRequest,i\x3dfunction(a){var b\x3df.createElement(e);b.src\x3da,b.async\x3d!0,g.parentNode.insertBefore(b,g)},j\x3dfunction(){d.clearTimeout(a)};return d.ggv2id\x3db,h?(h\x3dnew h,h.open(\"GET\",c),h.onload\x3dfunction(){j();try{(d.execScript||function(a){d.eval.call(d,a)})(h.responseText)}catch(a){}},a\x3dd.setTimeout(function(){h.abort()},3e3),void h.send()):i(c)}();\x3c/script\x3e";
B.addClientFiltersList(["paradeprod.filters.IncludeOnlyGallery"]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
var I = qubit.opentag.CustomTag;
var B = new I({
"dedupe": false,
"locationPlaceHolder": "END",
"needsConsent": false,
"active": true,
"url": "",
"timeout": -1,
"async": true,
"usesDocumentWrite": false,
"name": "linksmart",
"disabled": false,
"id": 12513620,
"locked": false,
"locationObject": "BODY"
});
var G = "paradeprod.tags.linksmart.Tag";
qubit.Define.clientNamespace(G, B);
B.htmlContent = "\x3cscript type\x3d\"text/javascript\"\x3e\n// \x3c![CDATA[\nvar _ls_pub_id \x3d \"261\";\n(function(d, t){\nvar mb \x3d d.createElement(t), s \x3d d.getElementsByTagName(t)[0];\nmb.async \x3d mb.src \x3d '//cdn.linksmart.com/linksmart_2.3.0.min.js';\ns.parentNode.insertBefore(mb, s);\n}(document, 'script'));\n// ]]\x3e\n\x3c/script\x3e";
B.addClientFiltersList([]);
B.addClientVariablesMap({});
B.addParameters([]);
B.genericDependencies = [];
B.addClientDependenciesList(["paradeprod.tags.addthisv2.Tag"]);
B.pre = function() {};
B.script = function() {};
B.post = function() {}
})();
(function() {
try {
qubit.opentag.Main.run()
} catch (I) {
try {
console.error("Errors during opentag main runtime.", I)
} catch (B) {}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment