Comparing version 0.8.9 to 0.8.11
@@ -580,3 +580,9 @@ var _analytics = (function (exports) { | ||
var X = function (e) { | ||
function X(e) { | ||
return { | ||
abort: e | ||
}; | ||
} | ||
var H = function (e) { | ||
var t = e.data, | ||
@@ -595,3 +601,3 @@ n = e.action, | ||
p = n.type, | ||
m = p.match(H), | ||
m = p.match(W), | ||
h = t.exact.map(function (e) { | ||
@@ -610,7 +616,7 @@ return e.pluginName; | ||
i && (u = i.event); | ||
var c = n.type.match(H) ? function (e, t, n, r, i) { | ||
var c = n.type.match(W) ? function (e, t, n, r, i) { | ||
return function (a, o) { | ||
var u = r ? r.name : e, | ||
c = o && te(o) ? o : n; | ||
if (r && (!(c = o && te(o) ? o : [e]).includes(e) || 1 !== c.length)) throw new Error("Method " + t + " can only abort " + e + " plugin. " + JSON.stringify(c) + " input valid"); | ||
c = o && ne(o) ? o : n; | ||
if (r && (!(c = o && ne(o) ? o : [e]).includes(e) || 1 !== c.length)) throw new Error("Method " + t + " can only abort " + e + " plugin. " + JSON.stringify(c) + " input valid"); | ||
return g$1({}, i, { | ||
@@ -631,3 +637,3 @@ abort: { | ||
return { | ||
payload: ie(n), | ||
payload: ae(n), | ||
instance: e, | ||
@@ -659,6 +665,6 @@ config: a || {}, | ||
return t.method && W$1(t.method) ? (function (e, t) { | ||
var n = re(e); | ||
var n = ie(e); | ||
if (n && n.name === t) { | ||
var r = re(n.method); | ||
var r = ie(n.method); | ||
throw new Error([t + " plugin is calling method " + e, "Plugins cant call self", "Use " + n.method + " " + (r ? "or " + r.method : "") + " in " + t + " plugin insteadof " + e].join("\n")); | ||
@@ -679,3 +685,3 @@ } | ||
}), | ||
config: K(t.pluginName, f, a), | ||
config: Q(t.pluginName, f, a), | ||
plugins: f | ||
@@ -710,3 +716,3 @@ })).then(function (t) { | ||
var n = e[l] ? e[l] : {}; | ||
if (m && (n = t), Z(n, l)) return G$1({ | ||
if (m && (n = t), ee(n, l)) return K({ | ||
data: n, | ||
@@ -718,3 +724,3 @@ method: p, | ||
}), Promise.resolve(t); | ||
if (Z(t, l)) return s && G$1({ | ||
if (ee(t, l)) return s && K({ | ||
data: t, | ||
@@ -739,3 +745,3 @@ method: p, | ||
instance: r, | ||
config: K(l, f, a), | ||
config: Q(l, f, a), | ||
plugins: f | ||
@@ -746,3 +752,3 @@ })).then(function (i) { | ||
s = e[l]; | ||
if (Z(s, l)) G$1({ | ||
if (ee(s, l)) K({ | ||
data: s, | ||
@@ -755,3 +761,3 @@ method: p, | ||
var f = p + ":" + l; | ||
(f.match(/:/g) || []).length < 2 && !p.match(W) && !p.match(F$1) && r.dispatch(g$1({}, m ? o : n, { | ||
(f.match(/:/g) || []).length < 2 && !p.match(F$1) && !p.match(G$1) && r.dispatch(g$1({}, m ? o : n, { | ||
type: f, | ||
@@ -771,3 +777,3 @@ _: { | ||
}, Promise.resolve(n))).then(function (e) { | ||
if (!(p.match(H) || p.match(/^registerPlugin/) || p.match(F$1) || p.match(W) || p.match(/^params/) || p.match(/^userIdChanged/))) { | ||
if (!(p.match(W) || p.match(/^registerPlugin/) || p.match(G$1) || p.match(F$1) || p.match(/^params/) || p.match(/^userIdChanged/))) { | ||
if (s.plugins.includes(p), e._ && e._.originalAction === p) return e; | ||
@@ -781,3 +787,3 @@ var n = g$1({}, e, { | ||
}); | ||
ee(e, t.exact.length) && !p.match(/End$/) && (n = g$1({}, n, { | ||
te(e, t.exact.length) && !p.match(/End$/) && (n = g$1({}, n, { | ||
type: e.type + "Aborted" | ||
@@ -794,7 +800,7 @@ })), u.dispatch(n); | ||
}, | ||
H = /Start$/, | ||
W = /^bootstrap/, | ||
F$1 = /^ready/; | ||
W = /Start$/, | ||
F$1 = /^bootstrap/, | ||
G$1 = /^ready/; | ||
function G$1(e) { | ||
function K(e) { | ||
var t = e.pluginName, | ||
@@ -811,3 +817,3 @@ n = e.method + "Aborted" + (t ? ":" + t : ""); | ||
function K(e, t, n) { | ||
function Q(e, t, n) { | ||
var r = t[e] || n[e]; | ||
@@ -817,3 +823,3 @@ return r && r.config ? r.config : {}; | ||
function Q(e, t) { | ||
function Y(e, t) { | ||
return t.reduce(function (t, n) { | ||
@@ -828,4 +834,4 @@ return n[e] ? t.concat({ | ||
function Y(e, t) { | ||
var n = e.replace(H, ""), | ||
function Z(e, t) { | ||
var n = e.replace(W, ""), | ||
r = t ? ":" + t : ""; | ||
@@ -835,8 +841,8 @@ return ["" + e + r, "" + n + r, n + "End" + r]; | ||
function Z(e, t) { | ||
function ee(e, t) { | ||
var n = e.abort; | ||
return !!n && (!0 === n || ne(n, t) || n && ne(n.plugins, t)); | ||
return !!n && (!0 === n || re(n, t) || n && re(n.plugins, t)); | ||
} | ||
function ee(e, t) { | ||
function te(e, t) { | ||
var n = e.abort; | ||
@@ -846,14 +852,14 @@ if (!n) return !1; | ||
var r = n.plugins; | ||
return te(n) && n.length === t || te(r) && r.length === t; | ||
return ne(n) && n.length === t || ne(r) && r.length === t; | ||
} | ||
function te(e) { | ||
function ne(e) { | ||
return Array.isArray(e); | ||
} | ||
function ne(e, t) { | ||
return !(!e || !te(e)) && e.includes(t); | ||
function re(e, t) { | ||
return !(!e || !ne(e)) && e.includes(t); | ||
} | ||
function re(e) { | ||
function ie(e) { | ||
var t = e.match(/(.*):(.*)/); | ||
@@ -866,3 +872,3 @@ return !!t && { | ||
function ie(e) { | ||
function ae(e) { | ||
return Object.keys(e).reduce(function (t, n) { | ||
@@ -873,3 +879,3 @@ return "type" === n || (t[n] = on(e[n]) ? Object.assign({}, e[n]) : e[n]), t; | ||
function ae(e, t, n) { | ||
function oe(e, t, n) { | ||
var r = {}; | ||
@@ -881,33 +887,33 @@ return function (i) { | ||
var u, | ||
c = function (e) { | ||
return u ? e : a(p); | ||
s = function (e) { | ||
return u ? e : a(m); | ||
}, | ||
s = o.type, | ||
d = o.plugins, | ||
p = o; | ||
d = o.type, | ||
p = o.plugins, | ||
m = o; | ||
if (o.abort) return Promise.resolve(a(o)); | ||
if (s === z.enablePlugin && i.dispatch({ | ||
if (d === z.enablePlugin && i.dispatch({ | ||
type: z.initializeStart, | ||
plugins: d, | ||
plugins: p, | ||
disabled: [], | ||
fromEnable: !0, | ||
meta: o.meta | ||
}), s === z.disablePlugin && setTimeout(function () { | ||
}), d === z.disablePlugin && setTimeout(function () { | ||
return L$1(o.meta.rid, { | ||
payload: o | ||
}); | ||
}, 0), s === z.initializeEnd) { | ||
var m = t(), | ||
h = Object.keys(m), | ||
v = h.filter(function (e) { | ||
return d.includes(e); | ||
}, 0), d === z.initializeEnd) { | ||
var h = t(), | ||
v = Object.keys(h), | ||
y = v.filter(function (e) { | ||
return p.includes(e); | ||
}).map(function (e) { | ||
return m[e]; | ||
return h[e]; | ||
}), | ||
y = [], | ||
b = [], | ||
I = o.disabled, | ||
w = v.map(function (e) { | ||
I = [], | ||
w = o.disabled, | ||
E = y.map(function (e) { | ||
var t = e.loaded, | ||
@@ -927,16 +933,16 @@ n = e.name, | ||
}) | ||
}), r[n] = !0), y = y.concat(n), e; | ||
}), r[n] = !0), b = b.concat(n), e; | ||
}).catch(function (e) { | ||
if (e instanceof Error) throw new Error(e); | ||
return b = b.concat(e.name), e; | ||
return I = I.concat(e.name), e; | ||
}); | ||
}); | ||
Promise.all(w).then(function (e) { | ||
Promise.all(E).then(function (e) { | ||
var t = { | ||
plugins: y, | ||
failed: b, | ||
disabled: I | ||
plugins: b, | ||
failed: I, | ||
disabled: w | ||
}; | ||
setTimeout(function () { | ||
h.length === w.length + I.length && i.dispatch(g$1({}, { | ||
v.length === E.length + w.length && i.dispatch(g$1({}, { | ||
type: z.ready | ||
@@ -948,14 +954,15 @@ }, t)); | ||
var E = function () { | ||
if (s !== z.bootstrap) return /^ready:([^:]*)$/.test(s) && setTimeout(function () { | ||
var P = function () { | ||
if (d !== z.bootstrap) return /^ready:([^:]*)$/.test(d) && setTimeout(function () { | ||
return function (e, t, n) { | ||
var r = t(), | ||
i = e.getState(), | ||
a = i.plugins, | ||
o = i.queue, | ||
u = i.user; | ||
var r = {}, | ||
i = t(), | ||
a = e.getState(), | ||
o = a.plugins, | ||
u = a.queue, | ||
s = a.user; | ||
if (!i.context.offline && o && o.actions && o.actions.length) { | ||
var c = o.actions.reduce(function (e, t, n) { | ||
return a[t.plugin].loaded ? (e.process.push(t), e.processIndex.push(n)) : (e.requeue.push(t), e.requeueIndex.push(n)), e; | ||
if (!a.context.offline && u && u.actions && u.actions.length) { | ||
var f = u.actions.reduce(function (e, t, n) { | ||
return o[t.plugin].loaded ? (e.process.push(t), e.processIndex.push(n)) : (e.requeue.push(t), e.requeueIndex.push(n)), e; | ||
}, { | ||
@@ -968,35 +975,41 @@ processIndex: [], | ||
if (c.processIndex && c.processIndex.length) { | ||
c.processIndex.forEach(function (t) { | ||
var i = o.actions[t], | ||
c = i.plugin, | ||
s = i.payload.type, | ||
f = r[c][s]; | ||
if (f.processIndex && f.processIndex.length) { | ||
f.processIndex.forEach(function (t) { | ||
var a = u.actions[t], | ||
f = a.plugin, | ||
d = a.payload.type, | ||
p = i[f][d]; | ||
if (f && W$1(f)) { | ||
var d = function (e, t) { | ||
if (p && W$1(p)) { | ||
var m, | ||
h = function (e, t) { | ||
return void 0 === e && (e = {}), void 0 === t && (t = {}), [j, k$1].reduce(function (n, r) { | ||
return e.hasOwnProperty(r) && t[r] && t[r] !== e[r] && (n[r] = t[r]), n; | ||
}, e); | ||
}(i.payload, u); | ||
}(a.payload, s), | ||
v = r[h.meta.rid]; | ||
f({ | ||
payload: d, | ||
config: a[c].config, | ||
instance: n | ||
}); | ||
var p = s + ":" + c; | ||
e.dispatch(g$1({}, d, { | ||
type: p, | ||
_: { | ||
called: p, | ||
from: "queueDrain" | ||
} | ||
})); | ||
if (!v && (m = p({ | ||
payload: h, | ||
config: o[f].config, | ||
instance: n, | ||
abort: X | ||
})) && on(m) && m.abort) return void (r[h.meta.rid] = !0); | ||
if (!v) { | ||
var y = d + ":" + f; | ||
e.dispatch(g$1({}, h, { | ||
type: y, | ||
_: { | ||
called: y, | ||
from: "queueDrain" | ||
} | ||
})); | ||
} | ||
} | ||
}); | ||
var s = o.actions.filter(function (e, t) { | ||
return !~c.processIndex.indexOf(t); | ||
var d = u.actions.filter(function (e, t) { | ||
return !~f.processIndex.indexOf(t); | ||
}); | ||
o.actions = s; | ||
u.actions = d; | ||
} | ||
@@ -1009,3 +1022,3 @@ } | ||
o = e.type, | ||
u = o.replace(H, ""); | ||
u = o.replace(W, ""); | ||
if (e._ && e._.called) return Promise.resolve(e); | ||
@@ -1030,9 +1043,9 @@ var c = n.getState(), | ||
p = function (e, t, n) { | ||
var r = Y(e).map(function (e) { | ||
return Q(e, t); | ||
var r = Z(e).map(function (e) { | ||
return Y(e, t); | ||
}); | ||
return t.reduce(function (n, r) { | ||
var i = r.name, | ||
a = Y(e, i).map(function (e) { | ||
return Q(e, t); | ||
a = Z(e, i).map(function (e) { | ||
return Y(e, t); | ||
}), | ||
@@ -1053,3 +1066,3 @@ o = a[0], | ||
return Promise.resolve(X({ | ||
return Promise.resolve(H({ | ||
action: e, | ||
@@ -1069,3 +1082,3 @@ data: { | ||
var t = function () { | ||
if (o.match(H)) return Promise.resolve(X({ | ||
if (o.match(W)) return Promise.resolve(H({ | ||
action: g$1({}, s, { | ||
@@ -1096,7 +1109,7 @@ type: u + "End" | ||
if (ee(e, d.length)) return e; | ||
if (te(e, d.length)) return e; | ||
var s, | ||
l = function () { | ||
if (o !== u) return Promise.resolve(X({ | ||
if (o !== u) return Promise.resolve(H({ | ||
action: g$1({}, e, { | ||
@@ -1133,3 +1146,3 @@ type: u | ||
return Promise.resolve(E && E.then ? E.then(c) : c(E)); | ||
return Promise.resolve(P && P.then ? P.then(s) : s(P)); | ||
} catch (e) { | ||
@@ -1143,3 +1156,3 @@ return Promise.reject(e); | ||
function oe(e) { | ||
function ue(e) { | ||
return function (t) { | ||
@@ -1164,3 +1177,3 @@ return function (t) { | ||
var ue = function () { | ||
var ce = function () { | ||
var e = this; | ||
@@ -1194,3 +1207,3 @@ this.before = [], this.after = [], this.addMiddleware = function (t, n) { | ||
function ce(e) { | ||
function se(e) { | ||
return function (t, n) { | ||
@@ -1202,3 +1215,3 @@ void 0 === t && (t = {}); | ||
if (/^registerPlugin:([^:]*)$/.test(n.type)) { | ||
var i = se(n.type, "registerPlugin"), | ||
var i = le(n.type, "registerPlugin"), | ||
a = e()[i]; | ||
@@ -1219,3 +1232,3 @@ if (!a || !i) return t; | ||
if (/^initialize:([^:]*)$/.test(n.type)) { | ||
var c = se(n.type, z.initialize), | ||
var c = le(n.type, z.initialize), | ||
s = e()[c]; | ||
@@ -1236,6 +1249,6 @@ return s && c ? (r[c] = g$1({}, t[c], { | ||
case z.disablePlugin: | ||
return g$1({}, t, le(n.plugins, !1, t)); | ||
return g$1({}, t, fe(n.plugins, !1, t)); | ||
case z.enablePlugin: | ||
return g$1({}, t, le(n.plugins, !0, t)); | ||
return g$1({}, t, fe(n.plugins, !0, t)); | ||
@@ -1248,7 +1261,7 @@ default: | ||
function se(e, t) { | ||
function le(e, t) { | ||
return e.substring(t.length + 1, e.length); | ||
} | ||
function le(e, t, n) { | ||
function fe(e, t, n) { | ||
return e.reduce(function (e, r) { | ||
@@ -1261,3 +1274,3 @@ return e[r] = g$1({}, n[r], { | ||
function fe(e) { | ||
function de(e) { | ||
try { | ||
@@ -1270,3 +1283,3 @@ return JSON.parse(JSON.stringify(e)); | ||
var de = { | ||
var pe = { | ||
last: {}, | ||
@@ -1276,4 +1289,4 @@ history: [] | ||
function pe(e, t) { | ||
void 0 === e && (e = de); | ||
function me(e, t) { | ||
void 0 === e && (e = pe); | ||
var n = t.options, | ||
@@ -1283,3 +1296,3 @@ r = t.meta; | ||
if (t.type === z.track) { | ||
var i = fe(g$1({ | ||
var i = de(g$1({ | ||
event: t.event, | ||
@@ -1301,8 +1314,8 @@ properties: t.properties | ||
var me = { | ||
var ge = { | ||
actions: [] | ||
}; | ||
function ge(e, t) { | ||
void 0 === e && (e = me); | ||
function he(e, t) { | ||
void 0 === e && (e = ge); | ||
var n = t.payload; | ||
@@ -1325,11 +1338,11 @@ | ||
var he = /#.*$/; | ||
var ve = /#.*$/; | ||
function ve(e) { | ||
function ye(e) { | ||
var t = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e); | ||
return "/" + (t && t[3] ? t[3].split("?")[0].replace(he, "") : ""); | ||
return "/" + (t && t[3] ? t[3].split("?")[0].replace(ve, "") : ""); | ||
} | ||
var ye, | ||
be = function (e) { | ||
var be, | ||
Ie = function (e) { | ||
if (void 0 === e && (e = {}), !$$1) return e; | ||
@@ -1351,3 +1364,3 @@ | ||
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(he, ""); | ||
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(ve, ""); | ||
}(s), | ||
@@ -1357,3 +1370,3 @@ f = { | ||
url: l, | ||
path: ve(l), | ||
path: ye(l), | ||
hash: c, | ||
@@ -1367,3 +1380,3 @@ search: s, | ||
}, | ||
Ie = { | ||
we = { | ||
last: {}, | ||
@@ -1373,8 +1386,8 @@ history: [] | ||
function we(e, t) { | ||
void 0 === e && (e = Ie); | ||
function Ee(e, t) { | ||
void 0 === e && (e = we); | ||
var n = t.options; | ||
if (t.type === z.page) { | ||
var r = fe(g$1({ | ||
var r = de(g$1({ | ||
properties: t.properties, | ||
@@ -1394,4 +1407,4 @@ meta: t.meta | ||
ye = {}; | ||
var Ee = { | ||
be = {}; | ||
var Pe = { | ||
initialized: !1, | ||
@@ -1409,3 +1422,3 @@ sessionId: y$1(), | ||
name: "analytics", | ||
version: "0.12.5" | ||
version: "0.12.7" | ||
}, | ||
@@ -1415,7 +1428,7 @@ timezone: void 0, | ||
campaign: {}, | ||
referrer: ye | ||
referrer: be | ||
}; | ||
function Pe(e, t) { | ||
void 0 === e && (e = Ee); | ||
function Se(e, t) { | ||
void 0 === e && (e = Pe); | ||
var n = e.initialized, | ||
@@ -1441,3 +1454,3 @@ r = t.campaign; | ||
default: | ||
return n ? e : g$1({}, Ee, e, { | ||
return n ? e : g$1({}, Pe, e, { | ||
initialized: !0 | ||
@@ -1448,5 +1461,5 @@ }); | ||
var Se = ["plugins", "reducers", "storage"]; | ||
var Ne = ["plugins", "reducers", "storage"]; | ||
function Ne() { | ||
function Ae() { | ||
return f("analytics", []), function (e) { | ||
@@ -1465,13 +1478,13 @@ return function (t, n$1, r) { | ||
function Ae(e) { | ||
function _e(e) { | ||
return function () { | ||
return P(P.apply(null, arguments), Ne()); | ||
return P(P.apply(null, arguments), Ae()); | ||
}; | ||
} | ||
function _e(e) { | ||
function Oe(e) { | ||
return e ? rn(e) ? e : [e] : []; | ||
} | ||
function Oe(t, n, r) { | ||
function je(t, n, r) { | ||
void 0 === t && (t = {}); | ||
@@ -1498,3 +1511,3 @@ var i, | ||
function je(o) { | ||
function ke(o) { | ||
void 0 === o && (o = {}); | ||
@@ -1556,3 +1569,3 @@ | ||
}, | ||
q = new ue(), | ||
q = new ce(), | ||
V = q.addMiddleware, | ||
@@ -1578,3 +1591,3 @@ B = q.removeMiddleware, | ||
type: z.enablePlugin, | ||
plugins: _e(e), | ||
plugins: Oe(e), | ||
_: { | ||
@@ -1590,3 +1603,3 @@ originalAction: z.enablePlugin | ||
type: z.disablePlugin, | ||
plugins: _e(e), | ||
plugins: Oe(e), | ||
_: { | ||
@@ -1651,3 +1664,3 @@ originalAction: z.disablePlugin | ||
type: z.pageStart, | ||
properties: be(r), | ||
properties: Ie(r), | ||
options: i, | ||
@@ -1712,8 +1725,8 @@ userId: b(j, K, r), | ||
return V(r, ke), V(i, xe), function () { | ||
B(r, ke), B(i, xe); | ||
return V(r, xe), V(i, Te), function () { | ||
B(r, xe), B(i, Te); | ||
}; | ||
} | ||
var a = e.match(n) ? ke : xe, | ||
var a = e.match(n) ? xe : Te, | ||
o = function (n) { | ||
@@ -1797,16 +1810,16 @@ return function (n) { | ||
return function (t) { | ||
return t.meta || (t.meta = Oe()), e(t); | ||
return t.meta || (t.meta = je()), e(t); | ||
}; | ||
}; | ||
}, L(ke), ae(K, M, { | ||
}, L(xe), oe(K, M, { | ||
all: O, | ||
plugins: A | ||
}), oe(m), C$1(K), D(K), L(xe)]), | ||
}), ue(m), C$1(K), D(K), L(Te)]), | ||
Y = { | ||
context: Pe, | ||
context: Se, | ||
user: U(m), | ||
page: we, | ||
track: pe, | ||
plugins: ce(M), | ||
queue: ge | ||
page: Ee, | ||
track: me, | ||
plugins: se(M), | ||
queue: he | ||
}, | ||
@@ -1822,3 +1835,3 @@ Z = P, | ||
})), ee = function () { | ||
return 0 === arguments.length ? Ne() : on(typeof arguments[0]) ? Ae() : Ae().apply(null, arguments); | ||
return 0 === arguments.length ? Ae() : on(typeof arguments[0]) ? _e() : _e().apply(null, arguments); | ||
}; | ||
@@ -1830,3 +1843,3 @@ } | ||
return Object.keys(e).reduce(function (t, n) { | ||
return Se.includes(n) || (t[n] = e[n]), t; | ||
return Ne.includes(n) || (t[n] = e[n]), t; | ||
}, {}); | ||
@@ -1848,3 +1861,3 @@ }(o), | ||
}, {}), | ||
se = { | ||
ae = { | ||
context: re, | ||
@@ -1896,7 +1909,7 @@ user: W, | ||
}; | ||
}(g$1({}, Y, u)), se, ee(Z(S.apply(void 0, Q)))); | ||
}(g$1({}, Y, u)), ae, ee(Z(S.apply(void 0, Q)))); | ||
le.dispatch = (ne = le.dispatch, function (e, t, n) { | ||
var r = g$1({}, e, { | ||
meta: Oe(e.meta, t, _e(n)) | ||
meta: je(e.meta, t, Oe(n)) | ||
}); | ||
@@ -1918,3 +1931,3 @@ return ne.apply(null, [r]); | ||
}), | ||
me = fe.filter(function (e) { | ||
pe = fe.filter(function (e) { | ||
return !f$1.pluginEnabled[e]; | ||
@@ -1942,3 +1955,3 @@ }); | ||
plugins: de, | ||
disabled: me | ||
disabled: pe | ||
}); | ||
@@ -1948,4 +1961,4 @@ }), K; | ||
var ke = "before", | ||
xe = "after"; | ||
var xe = "before", | ||
Te = "after"; | ||
@@ -2092,3 +2105,3 @@ var t = "cookie", | ||
}; | ||
return je(_objectSpread2(_objectSpread2({}, defaultSettings), opts)); | ||
return ke(_objectSpread2(_objectSpread2({}, defaultSettings), opts)); | ||
} | ||
@@ -2095,0 +2108,0 @@ |
@@ -1,1 +0,1 @@ | ||
var _analytics=function(e){"use strict";function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function n(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function J(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var r="undefined",i="object",o="any",a="*",u="__",c="undefined"!=typeof process?process:{},F=(c.env&&c.env.NODE_ENV,"undefined"!=typeof document);function s(e,t){return t.charAt(0)[e]()+t.slice(1)}null!=c.versions&&c.versions.node,F&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var l=s.bind(null,"toUpperCase"),f=s.bind(null,"toLowerCase");function d(e){return y(e)?l("null"):"object"==typeof e?C((t=e).constructor)?t.constructor.name:null:Object.prototype.toString.call(e).slice(8,-1);var t}function p(e,t){void 0===t&&(t=!0);e=d(e);return t?f(e):e}function g(e,t){return typeof t===e}var C=g.bind(null,"function"),H=g.bind(null,"string"),m=g.bind(null,"undefined"),I=g.bind(null,"boolean");function y(e){return null===e}function D(e){if((t=e)&&("object"==typeof t||null!==t)){for(var t,n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}}function v(e){return e instanceof Error||H(e.message)&&e.constructor&&("number"===p(e=e.constructor.stackTraceLimit)&&!isNaN(e))}function h(e,t){if("object"!=typeof t||y(t))return!1;if(t instanceof e)return!0;var n=p(new e(""));if(v(t))for(;t;){if(p(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}function b(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?(void 0===(t=t)&&(t=""),(e=e)&&e.nodeName===t.toUpperCase()):n}function w(){[].slice.call(arguments,1);return 1}function X(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function W(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+="-"==r||"4"==r?r:("x"==r?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}g.bind(null,"symbol"),h.bind(null,TypeError),h.bind(null,SyntaxError),w(b,"form"),w(b,"button"),w(b,"input"),w(b,"select");var S="global",P=u+"global"+u,E=typeof self==i&&self.self===self&&self||typeof global==i&&global.global===global&&global||void 0;function G(e){return E[P][e]}function K(e,t){return E[P][e]=t}function Q(e){delete E[P][e]}function O(e,t,n){var r,i;try{j(e)&&(i=(r=window[e])[t].bind(r))}catch(e){}return i||n}E[P]||(E[P]={});var x={};function j(t){if(typeof x[t]!=r)return x[t];try{var e=window[t];e.setItem(r,r),e.removeItem(r)}catch(e){return x[t]=!1}return x[t]=!0}function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var q="function",R="undefined",Y="@@redux/"+Math.random().toString(36),N=function(){return typeof Symbol===q&&Symbol.observable||"@@observable"}(),_=" != "+q;function Z(e,t,n){if(typeof t===q&&typeof n===R&&(n=t,t=void 0),typeof n!==R){if(typeof n!==q)throw new Error("enhancer"+_);return n(Z)(e,t)}if(typeof e!==q)throw new Error("reducer"+_);var r=e,i=t,o=[],a=o,u=!1;function c(){a===o&&(a=o.slice())}function l(){return i}function f(t){if(typeof t!==q)throw new Error("Listener"+_);var n=!0;return c(),a.push(t),function(){var e;n&&(n=!1,c(),e=a.indexOf(t),a.splice(e,1))}}function s(e){if(!D(e))throw new Error("Act != obj");if(typeof e.type===R)throw new Error("ActType "+R);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=r(i,e)}finally{u=!1}for(var t=o=a,n=0;n<t.length;n++)(0,t[n])();return e}return s({type:"@@redux/INIT"}),(n={dispatch:s,subscribe:f,getState:l,replaceReducer:function(e){if(typeof e!==q)throw new Error("next reducer"+_);r=e,s({type:"@@redux/INIT"})}})[N]=function(){var e,n=f;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Observer != obj");function t(){e.next&&e.next(l())}return t(),{unsubscribe:n(t)}}})[N]=function(){return this},e},n}function ee(){var e=[].slice.call(arguments);return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce(function(e,t){return function(){return e(t.apply(void 0,[].slice.call(arguments)))}})}var V=u+"anon_id",L=u+"user_id",te=u+"user_traits",c={__proto__:null,ANON_ID:V,USER_ID:L,USER_TRAITS:te},$="userId",ne="anonymousId",re=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ie=["name","EVENTS","config","loaded"],B=re.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),oe=/^utm_/,ae=/^an_prop_/,ue=/^an_trait_/;function ce(e){return{userId:e.getItem(L),anonymousId:e.getItem(V),traits:e.getItem(te)}}var se=function(e){return u+"TEMP"+u+e};var k={};function A(e,t){k[e]&&C(k[e])&&(k[e](t),delete k[e])}function T(e){var p,m,r=e.data,i=e.action,l=e.instance,t=e.state,f=e.allPlugins,n=e.allMatches,c=e.store,o=e.EVENTS;try{var d=t.plugins,a=t.context,g=i.type,s=g.match(M),u=r.exact.map(function(e){return e.pluginName}),y=(s&&(u=n.during.map(function(e){return e.pluginName})),p=l,m=u,function(e,t,n){var r,i,o,a,l,u,f,c,d=t.config,t=t.name,s=t+"."+e.type,t=(n&&(s=n.event),e.type.match(M)?(o=t,a=s,l=m,u=n,f=e,function(e,t){var n=u?u.name:o,r=t&&ve(t)?t:l;if(u&&(!(r=t&&ve(t)?t:[o]).includes(o)||1!==r.length))throw new Error("Method "+a+" can only abort "+o+" plugin. "+JSON.stringify(r)+" input valid");return U({},f,{abort:{reason:e,plugins:r,caller:a,_:n}})}):(r=e,i=s,function(){throw new Error(r.type+" action not cancellable. Remove abort in "+i)}));return{payload:(c=e,Object.keys(c).reduce(function(e,t){return"type"===t||(e[t]=D(c[t])?Object.assign({},c[t]):c[t]),e},{})),instance:p,config:d||{},abort:t}}),v=r.exact.reduce(function(e,t){var n=t.pluginName,t=t.methodName,r=!1;return t.match(/^initialize/)||t.match(/^reset/)||(r=!d[n].loaded),a.offline&&t.match(/^(page|track|identify)/)&&(r=!0),e[""+n]=r,e},{});return Promise.resolve(r.exact.reduce(function(e,t,n){try{var s=t.pluginName;return Promise.resolve(e).then(function(t){function e(){return Promise.resolve(t)}var n=r.namespaced&&r.namespaced[s]?Promise.resolve(r.namespaced[s].reduce(function(e,c,t){try{return Promise.resolve(e).then(function(t){{if(c.method&&C(c.method)){var e=c.methodName,n=c.pluginName,r,i=be(e);if(i&&i.name===n)throw r=be(i.method),new Error([n+" plugin is calling method "+e,"Plugins cant call self","Use "+i.method+" "+(r?"or "+r.method:"")+" in "+n+" plugin insteadof "+e].join("\n"));return Promise.resolve(c.method({payload:t,instance:l,abort:(o=t,a=s,u=c.pluginName,function(e,t){return U({},o,{abort:{reason:e,plugins:t||[a],caller:g,from:u||a}})}),config:de(c.pluginName,d,f),plugins:d})).then(function(e){e=D(e)?e:{};return Promise.resolve(U({},t,e))})}return t}var o,a,u})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){t[s]=e}):void(t[s]=i);return n&&n.then?n.then(e):e()})}catch(e){return Promise.reject(e)}},Promise.resolve({}))).then(function(u){return Promise.resolve(r.exact.reduce(function(e,t,n){try{var i=r.exact.length===n+1,o=t.pluginName,a=f[o];return Promise.resolve(e).then(function(n){var r=u[o]||{};if(me(r=s?n:r,o))return fe({data:r,method:g,instance:l,pluginName:o,store:c}),Promise.resolve(n);if(me(n,o))return i&&fe({data:n,method:g,instance:l,store:c}),Promise.resolve(n);if(v.hasOwnProperty(o)&&!0===v[o])return c.dispatch({type:"queue",plugin:o,payload:r,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(n);var e=y(u[o],f[o]);return Promise.resolve(a[g]({abort:e.abort,payload:r,instance:l,config:de(o,d,f),plugins:d})).then(function(e){var e=D(e)?e:{},e=U({},n,e),t=u[o];return me(t,o)?fe({data:t,method:g,instance:l,pluginName:o,store:c}):((t=g+":"+o).match(/:/g)||[]).length<2&&!g.match(z)&&!g.match(le)&&l.dispatch(U({},s?e:r,{type:t,_:{called:t,from:"submethod"}})),Promise.resolve(e)})})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){if(!(g.match(M)||g.match(/^registerPlugin/)||g.match(le)||g.match(z)||g.match(/^params/)||g.match(/^userIdChanged/))){if(o.plugins.includes(g),e._&&e._.originalAction===g)return e;var t=U({},e,{_:{originalAction:e.type,called:e.type,from:"engineEnd"}});ye(e,r.exact.length)&&!g.match(/End$/)&&(t=U({},t,{type:e.type+"Aborted"})),c.dispatch(t)}return e})})}catch(e){return Promise.reject(e)}}var M=/Start$/,z=/^bootstrap/,le=/^ready/;function fe(e){var t=e.pluginName,t=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(U({},e.data,{type:t,_:{called:t,from:"abort"}}))}function de(e,t,n){t=t[e]||n[e];return t&&t.config?t.config:{}}function pe(n,e){return e.reduce(function(e,t){return t[n]?e.concat({methodName:n,pluginName:t.name,method:t[n]}):e},[])}function ge(e,t){var n=e.replace(M,""),t=t?":"+t:"";return[e+t,n+t,n+"End"+t]}function me(e,t){e=e.abort;return e&&(!0===e||he(e,t)||e&&he(e.plugins,t))}function ye(e,t){e=e.abort;if(e){if(!0===e||H(e))return 1;var n=e.plugins;return ve(e)&&e.length===t||ve(n)&&n.length===t}}function ve(e){return Array.isArray(e)}function he(e,t){return!(!e||!ve(e))&&e.includes(t)}function be(e){e=e.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Ie(y,v,h){var b={};return function(m){return function(g){return function(e){try{var t,n,r,l,i,o,a,u,f=function(e){return t?e:g(p)},c=e.type,d=e.plugins,p=e;if(e.abort)return Promise.resolve(g(e));c===B.enablePlugin&&m.dispatch({type:B.initializeStart,plugins:d,disabled:[],fromEnable:!0,meta:e.meta}),c===B.disablePlugin&&setTimeout(function(){return A(e.meta.rid,{payload:e})},0),c===B.initializeEnd&&(n=v(),l=(r=Object.keys(n)).filter(function(e){return d.includes(e)}).map(function(e){return n[e]}),i=[],o=[],a=e.disabled,u=l.map(function(t){var e=t.loaded,n=t.name,r=t.config;return function r(i,o,a){return new Promise(function(t,n){return o()?t(i):a<1?n(U({},i,{queue:!0})):new Promise(function(e){return setTimeout(e,10)}).then(function(e){return r(i,o,a-10).then(t,n)})})}(t,function(){return e({config:r})},1e4).then(function(e){return b[n]||(m.dispatch({type:B.pluginReadyType(n),name:n,events:Object.keys(t).filter(function(e){return!ie.includes(e)})}),b[n]=!0),i=i.concat(n),t}).catch(function(e){if(e instanceof Error)throw new Error(e);return o=o.concat(e.name),e})}),Promise.all(u).then(function(e){var t={plugins:i,failed:o,disabled:a};setTimeout(function(){r.length===u.length+a.length&&m.dispatch(U({},{type:B.ready},t))},0)}));var s=function(){if(c!==B.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){var a,u,n,c,e,s,l,f;a=m,u=y,c=v(),e=a.getState(),s=e.plugins,l=e.queue,f=e.user,!e.context.offline&&l&&l.actions&&l.actions.length&&((n=l.actions.reduce(function(e,t,n){return s[t.plugin].loaded?(e.process.push(t),e.processIndex.push(n)):(e.requeue.push(t),e.requeueIndex.push(n)),e},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(e){var n,r,e=l.actions[e],t=e.plugin,i=e.payload.type,o=c[t][i];o&&C(o)&&(void 0===(n=e.payload)&&(n={}),void 0===(r=f)&&(r={}),o({payload:e=[$,ne].reduce(function(e,t){return n.hasOwnProperty(t)&&r[t]&&r[t]!==n[t]&&(e[t]=r[t]),e},n),config:s[t].config,instance:u}),a.dispatch(U({},e,{type:o=i+":"+t,_:{called:o,from:"queueDrain"}})))}),e=l.actions.filter(function(e,t){return!~n.processIndex.indexOf(t)}),l.actions=e))},0),Promise.resolve(function(n,e,i,l,f){try{var o=C(e)?e():e,a=n.type,d=a.replace(M,"");if(n._&&n._.called)return Promise.resolve(n);var u=i.getState(),p=(y=o,void 0===(r=u.plugins)&&(r={}),void 0===(v=n.options)&&(v={}),Object.keys(y).filter(function(e){var t=v.plugins||{};return I(t[e])?t[e]:!1!==t.all&&(!r[e]||!1!==r[e].enabled)}).map(function(e){return y[e]})),g=(p=a===B.initializeStart&&n.fromEnable?Object.keys(u.plugins).filter(function(e){var t=u.plugins[e];return n.plugins.includes(e)&&!t.initialized}).map(function(e){return o[e]}):p).map(function(e){return e.name}),c=(s=p,t=ge(m=a).map(function(e){return pe(e,s)}),s.reduce(function(e,t){var t=t.name,n=ge(m,t).map(function(e){return pe(e,s)}),r=n[0],i=n[1],n=n[2];return r.length&&(e.beforeNS[t]=r),i.length&&(e.duringNS[t]=i),n.length&&(e.afterNS[t]=n),e},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}}));return Promise.resolve(T({action:n,data:{exact:c.before,namespaced:c.beforeNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(t){function e(){var e=function(){if(a.match(M))return Promise.resolve(T({action:U({},n,{type:d+"End"}),data:{exact:c.after,namespaced:c.afterNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){e.meta&&e.meta.hasCallback&&A(e.meta.rid,{payload:e})})}();return e&&e.then?e.then(function(){return t}):t}if(ye(t,g.length))return t;var n,r=a!==d?Promise.resolve(T({action:U({},t,{type:d}),data:{exact:c.during,namespaced:c.duringNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){n=e}):void(n=t);return r&&r.then?r.then(e):e()})}catch(n){return Promise.reject(n)}var m,s,t,y,r,v}(e,v,y,m,h)).then(function(e){return t=1,g(e)})}();return Promise.resolve(s&&s.then?s.then(f):f(s))}catch(e){return Promise.reject(e)}}}}}var we=function(){var a=this;this.before=[],this.after=[],this.addMiddleware=function(e,t){a[t]=a[t].concat(e)},this.removeMiddleware=function(t,e){var n=a[e].findIndex(function(e){return e===t});-1!==n&&(a[e]=[].concat(a[e].slice(0,n),a[e].slice(n+1)))},this.dynamicMiddlewares=function(o){return function(i){return function(r){return function(e){var t={getState:i.getState,dispatch:function(e){return i.dispatch(e)}},n=a[o].map(function(e){return e(t)});return ee.apply(void 0,n)(r)(e)}}}}};function Se(e,t){return e.substring(t.length+1,e.length)}function Pe(e,n,r){return e.reduce(function(e,t){return e[t]=U({},r[t],{enabled:n}),e},r)}function Ee(e){try{return JSON.parse(JSON.stringify(e))}catch(e){}return e}var Oe={last:{},history:[]};function xe(e,t){void 0===e&&(e=Oe);var n=t.options,r=t.meta;return t.type===B.track?(t=Ee(U({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r})),U({},e,{last:t,history:e.history.concat(t)})):e}var je={actions:[]};function Ne(e,t){void 0===e&&(e=je);var n=t.payload;switch(t.type){case"queue":var r=n&&n.type&&n.type===B.identify?[t].concat(e.actions):e.actions.concat(t);return U({},e,{actions:r});case"dequeue":return[];default:return e}}var _e=/#.*$/;var ke=function(e){if(void 0===e&&(e={}),!F)return e;var t,n=document,r=n.title,n=n.referrer,i=window,o=i.location,a=i.innerWidth,i=i.innerHeight,u=o.hash,o=o.search,c=(t=o,(c=function(){if(F)for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}())?c.match(/\?/)?c:c+t:window.location.href.replace(_e,"")),r={title:r,url:c,path:"/"+((t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t=c))&&t[3]?t[3].split("?")[0].replace(_e,""):""),hash:u,search:o,width:a,height:i};return n&&""!==n&&(r.referrer=n),U({},r,e)},Ae={last:{},history:[]};function Te(e,t){void 0===e&&(e=Ae);var n=t.options;return t.type===B.page?(t=Ee(U({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n})),U({},e,{last:t,history:e.history.concat(t)})):e}var i={},Me={initialized:!1,sessionId:W(),app:null,version:null,debug:!1,offline:!!F&&!navigator.onLine,os:{name:"na"},userAgent:F?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.5"},timezone:void 0,locale:void 0,campaign:{},referrer:i};function ze(e,t){var n=(e=void 0===e?Me:e).initialized,r=t.campaign;switch(t.type){case B.campaign:return U({},e,{campaign:r});case B.offline:return U({},e,{offline:!0});case B.online:return U({},e,{offline:!1});default:return n?e:U({},Me,e,{initialized:!0})}}var Ce=["plugins","reducers","storage"];function De(){return K("analytics",[]),function(i){return function(e,t,n){var e=i(e,t,n),r=e.dispatch;return Object.assign(e,{dispatch:function(e){return E[P].analytics.push(e.action||e),r(e)}})}}}function Ue(){return function(){return ee(ee.apply(null,arguments),De())}}function qe(e){return e?"array"===p(e)?e:[e]:[]}function Re(e,t,n){void 0===e&&(e={});var r,i,o=W();return t&&(k[o]=(r=t,i=function(e){for(var t,n=e||Array.prototype.slice.call(arguments),r=0;r<n.length;r++)if(C(n[r])){t=n[r];break}return t}(n),function(e){i&&i(e),r(e)})),U({},e,{rid:o,ts:(new Date).getTime()},t?{hasCallback:!0}:{})}function Ve(e){function o(){return u}function c(){throw new Error("Abort disabled inListener")}var d,p,g,m,y,v,h,b,I,w=(e=void 0===e?{}:e).reducers||{},S=e.initialUser||{},a=(e.plugins||[]).reduce(function(e,n){if(C(n))return e.middlewares=e.middlewares.concat(n),e;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error("https://lytics.dev/errors/1");n.config||(n.config={});var t=n.EVENTS?Object.keys(n.EVENTS).map(function(e){return n.EVENTS[e]}):[],t=(e.pluginEnabled[n.name]=!(!1===n.enabled||!1===n.config.enabled),delete n.enabled,n.methods&&(e.methods[n.name]=Object.keys(n.methods).reduce(function(e,t){var r;return e[t]=(r=n.methods[t],function(){for(var e=Array.prototype.slice.call(arguments),t=new Array(r.length),n=0;n<e.length;n++)t[n]=e[n];return t[t.length]=l,r.apply({instance:l},t)}),e},{}),delete n.methods),Object.keys(n).concat(t)),t=new Set(e.events.concat(t));if(e.events=Array.from(t),e.pluginsArray=e.pluginsArray.concat(n),e.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return e.plugins[n.name]=n,e.plugins[n.name].loaded||(e.plugins[n.name].loaded=function(){return!0}),e},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),t=e.storage||{getItem:G,setItem:K,removeItem:Q},s=(d=t,function(e,t,n){return t.getState("user")[e]||(n&&D(n)&&n[e]?n[e]:ce(d)[e]||G(se(e))||null)}),u=a.plugins,P=a.events.filter(function(e){return!ie.includes(e)}).sort(),n=new Set(P.concat(re).filter(function(e){return!ie.includes(e)})),n=Array.from(n).sort(),r=new we,E=r.addMiddleware,O=r.removeMiddleware,r=r.dynamicMiddlewares,i=function(e){for(var t,l=e?(e=e.match(/\?(.*)/))&&e[1]?e[1].split("#")[0]:"":F&&window.location.search.substring(1),n=Object.create(null),f=/([^&=]+)=?([^&]*)/g;i=f.exec(l);){var r=X(i[1]),i=X(i[2]);"[]"===r.substring(r.length-2)?(n[r=r.substring(0,r.length-2)]||(n[r]=[])).push(i):n[r]=""===i||i}for(t in n){var d=t.split("[");if(1<d.length){{o=void 0;a=void 0;p=void 0;u=void 0;c=void 0;s=void 0;var o=n;var a=d.map(function(e){return e.replace(/[?[\]\\ ]/g,"")});var p=n[t];for(var u=a.length-1,c=0;c<u;++c){var s=a[c];if("__proto__"===s||"constructor"===s)break;s in o||(o[s]={}),o=o[s]}o[a[u]]=p}delete n[t]}}return n}(),x=ce(t),j=U({},x,S,i.an_uid?{userId:i.an_uid}:{},i.an_aid?{anonymousId:i.an_aid}:{}),N=(j.anonymousId||(j.anonymousId=W()),U({enable:function(t,n){return new Promise(function(e){f.dispatch({type:B.enablePlugin,plugins:qe(t),_:{originalAction:B.enablePlugin}},e,[n])})},disable:function(t,n){return new Promise(function(e){f.dispatch({type:B.disablePlugin,plugins:qe(t),_:{originalAction:B.disablePlugin}},e,[n])})}},a.methods)),_=!1,l={identify:function(e,t,n,r){try{var i=H(e)?e:null,o=D(e)?e:t,a=n||{},u=l.user(),c=(K(se($),i),i||o.userId||s($,l,o));return Promise.resolve(new Promise(function(e){f.dispatch(U({type:B.identifyStart,userId:c,traits:o||{},options:a,anonymousId:u.anonymousId},u.id&&u.id!==i&&{previousId:u.id}),e,[t,n,r])}))}catch(e){return Promise.reject(e)}},track:function(e,t,n,r){try{var i=D(e)?e.event:e;if(!i||!H(i))throw new Error("EventMissing");var o=D(e)?e:t||{},a=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.trackStart,event:i,properties:o,options:a,userId:s($,l,t),anonymousId:s(ne,l,t)},e,[t,n,r])}))}catch(e){return Promise.reject(e)}},page:function(t,n,r){try{var i=D(t)?t:{},o=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.pageStart,properties:ke(i),options:o,userId:s($,l,i),anonymousId:s(ne,l,i)},e,[t,n,r])}))}catch(t){return Promise.reject(t)}},user:function(e){if(e===$||"id"===e)return s($,l);if(e===ne||"anonId"===e)return s(ne,l);var t=l.getState("user");return e?J(t,e):t},reset:function(t){return new Promise(function(e){f.dispatch({type:B.resetStart},e,t)})},ready:function(t){return _&&t({plugins:N,instance:l}),l.on(B.ready,function(e){t(e),_=!0})},on:function(n,r){if(!n||!C(r))return!1;if(n===B.bootstrap)throw new Error(".on disabled for "+n);var e,t,i=/Start$|Start:/;if("*"===n)return t=function(e){return function(t){return function(e){return e.type.match(i)||r({payload:e,instance:l,plugins:u}),t(e)}}},E(e=function(e){return function(t){return function(e){return e.type.match(i)&&r({payload:e,instance:l,plugins:u}),t(e)}}},Le),E(t,$e),function(){O(e,Le),O(t,$e)};function o(e){return function(t){return function(e){return e.type===n&&r({payload:e,instance:l,plugins:u,abort:c}),t(e)}}}var a=n.match(i)?Le:$e;return E(o,a),function(){return O(o,a)}},once:function(e,t){if(!e||!C(t))return!1;if(e===B.bootstrap)throw new Error(".once disabled for "+e);var n=l.on(e,function(e){t({payload:e.payload,instance:l,plugins:u,abort:c}),n()});return n},getState:function(e){var t=f.getState();return e?J(t,e):Object.assign({},t)},dispatch:function(e){var t=H(e)?{type:e}:e;if(re.includes(t.type))throw new Error("reserved action "+t.type);t=U({},t,{_:U({originalAction:t.type},e._||{})});f.dispatch(t)},enablePlugin:N.enable,disablePlugin:N.disable,plugins:N,storage:{getItem:t.getItem,setItem:function(e,t,n){f.dispatch({type:B.setItemStart,key:e,value:t,options:n})},removeItem:function(e,t){f.dispatch({type:B.removeItemStart,key:e,options:t})}},setAnonymousId:function(e,t){l.storage.setItem(V,e,t)},events:{core:re,plugins:P}},P=a.middlewares.concat([function(e){return function(t){return function(e){return e.meta||(e.meta=Re()),t(e)}}},r(Le),Ie(l,o,{all:n,plugins:P}),(I=t,function(e){return function(o){return function(e){var t=e.type,n=e.key,r=e.value,i=e.options;if(t===B.setItem||t===B.removeItem){if(e.abort)return o(e);t===B.setItem?I.setItem(n,r,i):I.removeItem(n,i)}return o(e)}}}),(b=(h=l).storage.setItem,function(l){return function(s){return function(e){var r,t,n,i,o,a,u,c;return e.type===B.bootstrap&&(r=e.params,o=e.user,t=e.persistedUser,n=e.initialUser,i=t.userId===o.userId,t.anonymousId!==o.anonymousId&&b(V,o.anonymousId),i||b(L,o.userId),n.traits&&b(te,U({},i&&t.traits?t.traits:{},n.traits)),(o=Object.keys(e.params)).length&&(a=r.an_uid,u=r.an_event,c=o.reduce(function(e,t){var n;return(t.match(oe)||t.match(/^(d|g)clid/))&&(n=t.replace(oe,""),e.campaign["campaign"===n?"name":n]=r[t]),t.match(ae)&&(e.props[t.replace(ae,"")]=r[t]),t.match(ue)&&(e.traits[t.replace(ue,"")]=r[t]),e},{campaign:{},props:{},traits:{}}),l.dispatch(U({type:B.params,raw:r},c,a?{userId:a}:{})),a&&setTimeout(function(){return h.identify(a,c.traits)},0),u&&setTimeout(function(){return h.track(u,c.props)},0),Object.keys(c.campaign).length&&l.dispatch({type:B.campaign,campaign:c.campaign}))),s(e)}}}),(m=(n=(n=l).storage).setItem,y=n.removeItem,v=n.getItem,function(u){return function(a){return function(e){var t,n,r=e.userId,i=e.traits,o=e.options;return e.type===B.reset&&([L,te,V].forEach(function(e){y(e)}),[$,ne,"traits"].forEach(function(e){Q(se(e))})),e.type===B.identify&&(v(V)||m(V,W()),t=v(L),n=v(te)||{},t&&t!==r&&u.dispatch({type:B.userIdChanged,old:{userId:t,traits:n},new:{userId:r,traits:i},options:o}),r&&m(L,r),i&&m(te,U({},n,i))),a(e)}}}),r($e)]),n={context:ze,user:(g=t,function(e,t){if(void 0===e&&(e={}),(t=void 0===t?{}:t).type===B.setItemEnd){if(t.key===V)return U({},e,{anonymousId:t.value});if(t.key===L)return U({},e,{userId:t.value})}switch(t.type){case B.identify:return Object.assign({},e,{userId:t.userId,traits:U({},e.traits,t.traits)});case B.reset:return[L,V,te].forEach(function(e){g.removeItem(e)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}),page:Te,track:xe,plugins:(p=o,function(e,t){void 0===e&&(e={});var n={};if("initialize:aborted"===t.type)return e;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=Se(t.type,"registerPlugin"),i=p()[r];if(!i||!r)return e;var o=t.enabled,a=i.config;return n[r]={enabled:o,initialized:!!o&&Boolean(!i.initialize),loaded:!!o&&Boolean(i.loaded({config:a})),config:a},U({},e,n)}if(/^initialize:([^:]*)$/.test(t.type))return r=Se(t.type,B.initialize),(o=p()[r])&&r?(n[r]=U({},e[r],{initialized:!0,loaded:Boolean(o.loaded({config:o.config}))}),U({},e,n)):e;if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=U({},e[t.name],{loaded:!0}),U({},e,n);switch(t.type){case B.disablePlugin:return U({},e,Pe(t.plugins,!1,e));case B.enablePlugin:return U({},e,Pe(t.plugins,!0,e));default:return e}}),queue:Ne},r=ee,t=ee;F&&e.debug&&((T=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(r=T({trace:!0,traceLimit:25})),t=function(){return 0===arguments.length?De():D(typeof arguments[0])?Ue():Ue().apply(null,arguments)});A=e;var k,A,T=Object.keys(A).reduce(function(e,t){return Ce.includes(t)||(e[t]=A[t]),e},{}),e={context:T,user:j,plugins:a.pluginsArray.reduce(function(e,t){var n=t.name,r=t.config,i=t.loaded,o=a.pluginEnabled[n];return e[n]={enabled:o,initialized:!!o&&Boolean(!t.initialize),loaded:Boolean(i({config:r})),config:r},e},{})},f=Z(function(e){for(var t=Object.keys(e),l={},n=0;n<t.length;n++){var r=t[n];typeof e[r]===q&&(l[r]=e[r])}var f,i,d=Object.keys(l);try{i=l,Object.keys(i).forEach(function(e){var t=i[e];if(typeof t(void 0,{type:"@@redux/INIT"})===R||typeof t(void 0,{type:Y})===R)throw new Error("reducer "+e+" "+R)})}catch(e){f=e}return function(e,t){if(void 0===e&&(e={}),f)throw f;for(var n,r=!1,i={},o=0;o<d.length;o++){var a,u=d[o],c=e[u],s=(0,l[u])(c,t);if(typeof s===R)throw n=u,a="action "+((a=(a=t)&&a.type)&&a.toString()||"?")+"reducer "+n+" returns "+R,new Error(a);i[u]=s,r=r||s!==c}return r?i:e}}(U({},n,w)),e,t(r(function(){var a=arguments;return function(o){return function(e,t,n){var e=o(e,t,n),r=e.dispatch,i={getState:e.getState,dispatch:function(e){return r(e)}},t=[].slice.call(a).map(function(e){return e(i)});return U({},e,{dispatch:r=ee.apply(void 0,t)(e.dispatch)})}}}.apply(void 0,P)))),n=(f.dispatch=(k=f.dispatch,function(e,t,n){e=U({},e,{meta:Re(e.meta,t,qe(n))});return k.apply(null,[e])}),Object.keys(u)),M=(f.dispatch({type:B.bootstrap,plugins:n,config:T,params:i,user:j,initialUser:S,persistedUser:x}),n.filter(function(e){return a.pluginEnabled[e]})),z=n.filter(function(e){return!a.pluginEnabled[e]});return f.dispatch({type:B.registerPlugins,plugins:n,enabled:a.pluginEnabled}),a.pluginsArray.map(function(e,t){var n=e.bootstrap,r=e.config,i=e.name;n&&C(n)&&n({instance:l,config:r,payload:e}),f.dispatch({type:B.registerPluginType(i),name:i,enabled:a.pluginEnabled[i],plugin:e}),a.pluginsArray.length===t+1&&f.dispatch({type:B.initializeStart,plugins:M,disabled:z})}),l}var Le="before",$e="after",Be="cookie",Je=We(),Fe=Ge,He=Ge;function Xe(e){return Je?Ge(e,"",-1):Q(e)}function We(){if(void 0!==Je)return Je;var e="cookiecookie";try{Ge(e,e),Je=-1!==document.cookie.indexOf(e),Xe(e)}catch(e){Je=!1}return Je}function Ge(e,t,n,r,i,o){var a;if("undefined"!=typeof window)return a=1<arguments.length,!1===Je&&(a?K(e,t):G(e)),a?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}var Ke="localStorage",i=j.bind(null,"localStorage"),Qe=(O("localStorage","getItem",G),O("localStorage","setItem",K),O("localStorage","removeItem",Q),"sessionStorage"),Ye=j.bind(null,"sessionStorage");function Ze(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(D(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}O("sessionStorage","getItem",G),O("sessionStorage","setItem",K),O("sessionStorage","removeItem",Q);var et=i(),tt=Ye(),nt=We();function rt(e,t){if(e){var t=it(t),n=!ct(t),r=ot(t)?Ze(localStorage.getItem(e)):void 0;if(n&&!m(r))return r;var i=at(t)?Ze(Fe(e)):void 0;if(n&&i)return i;t=ut(t)?Ze(sessionStorage.getItem(e)):void 0;if(n&&t)return t;e=G(e);return n?e:{localStorage:r,sessionStorage:t,cookie:i,global:e}}}function it(e){return e?H(e)?e:e.storage:o}function ot(e){return et&&st(e,Ke)}function at(e){return nt&&st(e,Be)}function ut(e){return tt&&st(e,Qe)}function ct(e){return e===a||"all"===e}function st(e,t){return e===o||e===t||ct(e)}function lt(e,t,n){return{location:e,current:t,previous:n}}var ft={setItem:function(e,t,n){var r,i,o;if(e&&!m(t))return r={},n=it(n),i=JSON.stringify(t),o=!ct(n),ot(n)&&(r[Ke]=lt(Ke,t,Ze(localStorage.getItem(e))),localStorage.setItem(e,i),o)?r[Ke]:at(n)&&(r[Be]=lt(Be,t,Ze(Fe(e))),He(e,i),o)?r[Be]:ut(n)&&(r[Qe]=lt(Qe,t,Ze(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?r[Qe]:(r[S]=lt(S,t,G(e)),K(e,t),o?r[S]:r)},getItem:rt,removeItem:function(e,t){var n,r;if(e)return t=it(t),n=rt(e,a),r={},!m(n.localStorage)&&ot(t)&&(localStorage.removeItem(e),r[Ke]=n.localStorage),!m(n.cookie)&&at(t)&&(Xe(e),r[Be]=n.cookie),!m(n.sessionStorage)&&ut(t)&&(sessionStorage.removeItem(e),r[Qe]=n.sessionStorage),!m(n.global)&&st(t,S)&&(Q(e),r[S]=n.global),r}};function dt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Ve(n(n({},{storage:ft}),e))}return e.Analytics=dt,e.CONSTANTS=c,e.EVENTS=B,e.default=dt,e.init=dt,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var _analytics=function(e){"use strict";function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function n(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function J(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var r="undefined",i="object",o="any",a="*",u="__",c="undefined"!=typeof process?process:{},F=(c.env&&c.env.NODE_ENV,"undefined"!=typeof document);function s(e,t){return t.charAt(0)[e]()+t.slice(1)}null!=c.versions&&c.versions.node,F&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var l=s.bind(null,"toUpperCase"),f=s.bind(null,"toLowerCase");function d(e){return y(e)?l("null"):"object"==typeof e?C((t=e).constructor)?t.constructor.name:null:Object.prototype.toString.call(e).slice(8,-1);var t}function p(e,t){void 0===t&&(t=!0);e=d(e);return t?f(e):e}function g(e,t){return typeof t===e}var C=g.bind(null,"function"),H=g.bind(null,"string"),m=g.bind(null,"undefined"),I=g.bind(null,"boolean");function y(e){return null===e}function D(e){if((t=e)&&("object"==typeof t||null!==t)){for(var t,n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}}function v(e){return e instanceof Error||H(e.message)&&e.constructor&&("number"===p(e=e.constructor.stackTraceLimit)&&!isNaN(e))}function h(e,t){if("object"!=typeof t||y(t))return!1;if(t instanceof e)return!0;var n=p(new e(""));if(v(t))for(;t;){if(p(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}function b(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?(void 0===(t=t)&&(t=""),(e=e)&&e.nodeName===t.toUpperCase()):n}function w(){[].slice.call(arguments,1);return 1}function X(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function W(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+="-"==r||"4"==r?r:("x"==r?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}g.bind(null,"symbol"),h.bind(null,TypeError),h.bind(null,SyntaxError),w(b,"form"),w(b,"button"),w(b,"input"),w(b,"select");var S="global",P=u+"global"+u,E=typeof self==i&&self.self===self&&self||typeof global==i&&global.global===global&&global||void 0;function G(e){return E[P][e]}function K(e,t){return E[P][e]=t}function Q(e){delete E[P][e]}function O(e,t,n){var r,i;try{j(e)&&(i=(r=window[e])[t].bind(r))}catch(e){}return i||n}E[P]||(E[P]={});var x={};function j(t){if(typeof x[t]!=r)return x[t];try{var e=window[t];e.setItem(r,r),e.removeItem(r)}catch(e){return x[t]=!1}return x[t]=!0}function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var q="function",R="undefined",Y="@@redux/"+Math.random().toString(36),N=function(){return typeof Symbol===q&&Symbol.observable||"@@observable"}(),_=" != "+q;function Z(e,t,n){if(typeof t===q&&typeof n===R&&(n=t,t=void 0),typeof n!==R){if(typeof n!==q)throw new Error("enhancer"+_);return n(Z)(e,t)}if(typeof e!==q)throw new Error("reducer"+_);var r=e,i=t,o=[],a=o,u=!1;function c(){a===o&&(a=o.slice())}function l(){return i}function f(t){if(typeof t!==q)throw new Error("Listener"+_);var n=!0;return c(),a.push(t),function(){var e;n&&(n=!1,c(),e=a.indexOf(t),a.splice(e,1))}}function s(e){if(!D(e))throw new Error("Act != obj");if(typeof e.type===R)throw new Error("ActType "+R);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=r(i,e)}finally{u=!1}for(var t=o=a,n=0;n<t.length;n++)(0,t[n])();return e}return s({type:"@@redux/INIT"}),(n={dispatch:s,subscribe:f,getState:l,replaceReducer:function(e){if(typeof e!==q)throw new Error("next reducer"+_);r=e,s({type:"@@redux/INIT"})}})[N]=function(){var e,n=f;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Observer != obj");function t(){e.next&&e.next(l())}return t(),{unsubscribe:n(t)}}})[N]=function(){return this},e},n}function ee(){var e=[].slice.call(arguments);return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce(function(e,t){return function(){return e(t.apply(void 0,[].slice.call(arguments)))}})}var V=u+"anon_id",L=u+"user_id",te=u+"user_traits",c={__proto__:null,ANON_ID:V,USER_ID:L,USER_TRAITS:te},$="userId",ne="anonymousId",re=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ie=["name","EVENTS","config","loaded"],B=re.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),oe=/^utm_/,ae=/^an_prop_/,ue=/^an_trait_/;function ce(e){return{userId:e.getItem(L),anonymousId:e.getItem(V),traits:e.getItem(te)}}var se=function(e){return u+"TEMP"+u+e};var k={};function A(e,t){k[e]&&C(k[e])&&(k[e](t),delete k[e])}function T(e){return{abort:e}}function M(e){var p,m,r=e.data,i=e.action,l=e.instance,t=e.state,f=e.allPlugins,n=e.allMatches,c=e.store,o=e.EVENTS;try{var d=t.plugins,a=t.context,g=i.type,s=g.match(z),u=r.exact.map(function(e){return e.pluginName}),y=(s&&(u=n.during.map(function(e){return e.pluginName})),p=l,m=u,function(e,t,n){var r,i,o,a,l,u,f,c,d=t.config,t=t.name,s=t+"."+e.type,t=(n&&(s=n.event),e.type.match(z)?(o=t,a=s,l=m,u=n,f=e,function(e,t){var n=u?u.name:o,r=t&&he(t)?t:l;if(u&&(!(r=t&&he(t)?t:[o]).includes(o)||1!==r.length))throw new Error("Method "+a+" can only abort "+o+" plugin. "+JSON.stringify(r)+" input valid");return U({},f,{abort:{reason:e,plugins:r,caller:a,_:n}})}):(r=e,i=s,function(){throw new Error(r.type+" action not cancellable. Remove abort in "+i)}));return{payload:(c=e,Object.keys(c).reduce(function(e,t){return"type"===t||(e[t]=D(c[t])?Object.assign({},c[t]):c[t]),e},{})),instance:p,config:d||{},abort:t}}),v=r.exact.reduce(function(e,t){var n=t.pluginName,t=t.methodName,r=!1;return t.match(/^initialize/)||t.match(/^reset/)||(r=!d[n].loaded),a.offline&&t.match(/^(page|track|identify)/)&&(r=!0),e[""+n]=r,e},{});return Promise.resolve(r.exact.reduce(function(e,t,n){try{var s=t.pluginName;return Promise.resolve(e).then(function(t){function e(){return Promise.resolve(t)}var n=r.namespaced&&r.namespaced[s]?Promise.resolve(r.namespaced[s].reduce(function(e,c,t){try{return Promise.resolve(e).then(function(t){{if(c.method&&C(c.method)){var e=c.methodName,n=c.pluginName,r,i=Ie(e);if(i&&i.name===n)throw r=Ie(i.method),new Error([n+" plugin is calling method "+e,"Plugins cant call self","Use "+i.method+" "+(r?"or "+r.method:"")+" in "+n+" plugin insteadof "+e].join("\n"));return Promise.resolve(c.method({payload:t,instance:l,abort:(o=t,a=s,u=c.pluginName,function(e,t){return U({},o,{abort:{reason:e,plugins:t||[a],caller:g,from:u||a}})}),config:pe(c.pluginName,d,f),plugins:d})).then(function(e){e=D(e)?e:{};return Promise.resolve(U({},t,e))})}return t}var o,a,u})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){t[s]=e}):void(t[s]=i);return n&&n.then?n.then(e):e()})}catch(e){return Promise.reject(e)}},Promise.resolve({}))).then(function(u){return Promise.resolve(r.exact.reduce(function(e,t,n){try{var i=r.exact.length===n+1,o=t.pluginName,a=f[o];return Promise.resolve(e).then(function(n){var r=u[o]||{};if(ye(r=s?n:r,o))return de({data:r,method:g,instance:l,pluginName:o,store:c}),Promise.resolve(n);if(ye(n,o))return i&&de({data:n,method:g,instance:l,store:c}),Promise.resolve(n);if(v.hasOwnProperty(o)&&!0===v[o])return c.dispatch({type:"queue",plugin:o,payload:r,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(n);var e=y(u[o],f[o]);return Promise.resolve(a[g]({abort:e.abort,payload:r,instance:l,config:pe(o,d,f),plugins:d})).then(function(e){var e=D(e)?e:{},e=U({},n,e),t=u[o];return ye(t,o)?de({data:t,method:g,instance:l,pluginName:o,store:c}):((t=g+":"+o).match(/:/g)||[]).length<2&&!g.match(le)&&!g.match(fe)&&l.dispatch(U({},s?e:r,{type:t,_:{called:t,from:"submethod"}})),Promise.resolve(e)})})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){if(!(g.match(z)||g.match(/^registerPlugin/)||g.match(fe)||g.match(le)||g.match(/^params/)||g.match(/^userIdChanged/))){if(o.plugins.includes(g),e._&&e._.originalAction===g)return e;var t=U({},e,{_:{originalAction:e.type,called:e.type,from:"engineEnd"}});ve(e,r.exact.length)&&!g.match(/End$/)&&(t=U({},t,{type:e.type+"Aborted"})),c.dispatch(t)}return e})})}catch(e){return Promise.reject(e)}}var z=/Start$/,le=/^bootstrap/,fe=/^ready/;function de(e){var t=e.pluginName,t=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(U({},e.data,{type:t,_:{called:t,from:"abort"}}))}function pe(e,t,n){t=t[e]||n[e];return t&&t.config?t.config:{}}function ge(n,e){return e.reduce(function(e,t){return t[n]?e.concat({methodName:n,pluginName:t.name,method:t[n]}):e},[])}function me(e,t){var n=e.replace(z,""),t=t?":"+t:"";return[e+t,n+t,n+"End"+t]}function ye(e,t){e=e.abort;return e&&(!0===e||be(e,t)||e&&be(e.plugins,t))}function ve(e,t){e=e.abort;if(e){if(!0===e||H(e))return 1;var n=e.plugins;return he(e)&&e.length===t||he(n)&&n.length===t}}function he(e){return Array.isArray(e)}function be(e,t){return!(!e||!he(e))&&e.includes(t)}function Ie(e){e=e.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function we(y,v,h){var b={};return function(m){return function(g){return function(e){try{var t,n,r,l,i,o,a,u,f=function(e){return t?e:g(p)},c=e.type,d=e.plugins,p=e;if(e.abort)return Promise.resolve(g(e));c===B.enablePlugin&&m.dispatch({type:B.initializeStart,plugins:d,disabled:[],fromEnable:!0,meta:e.meta}),c===B.disablePlugin&&setTimeout(function(){return A(e.meta.rid,{payload:e})},0),c===B.initializeEnd&&(n=v(),l=(r=Object.keys(n)).filter(function(e){return d.includes(e)}).map(function(e){return n[e]}),i=[],o=[],a=e.disabled,u=l.map(function(t){var e=t.loaded,n=t.name,r=t.config;return function r(i,o,a){return new Promise(function(t,n){return o()?t(i):a<1?n(U({},i,{queue:!0})):new Promise(function(e){return setTimeout(e,10)}).then(function(e){return r(i,o,a-10).then(t,n)})})}(t,function(){return e({config:r})},1e4).then(function(e){return b[n]||(m.dispatch({type:B.pluginReadyType(n),name:n,events:Object.keys(t).filter(function(e){return!ie.includes(e)})}),b[n]=!0),i=i.concat(n),t}).catch(function(e){if(e instanceof Error)throw new Error(e);return o=o.concat(e.name),e})}),Promise.all(u).then(function(e){var t={plugins:i,failed:o,disabled:a};setTimeout(function(){r.length===u.length+a.length&&m.dispatch(U({},{type:B.ready},t))},0)}));var s=function(){if(c!==B.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){var c,s,n,l,f,e,d,p,g;c=m,s=y,l={},f=v(),e=c.getState(),d=e.plugins,p=e.queue,g=e.user,!e.context.offline&&p&&p.actions&&p.actions.length&&((n=p.actions.reduce(function(e,t,n){return d[t.plugin].loaded?(e.process.push(t),e.processIndex.push(n)):(e.requeue.push(t),e.requeueIndex.push(n)),e},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(e){var t,n,r,i,e=p.actions[e],o=e.plugin,a=e.payload.type,u=f[o][a];u&&C(u)&&(void 0===(r=e.payload)&&(r={}),void 0===(i=g)&&(i={}),e=[$,ne].reduce(function(e,t){return r.hasOwnProperty(t)&&i[t]&&i[t]!==r[t]&&(e[t]=i[t]),e},r),!(n=l[e.meta.rid])&&(t=u({payload:e,config:d[o].config,instance:s,abort:T}))&&D(t)&&t.abort?l[e.meta.rid]=!0:n||c.dispatch(U({},e,{type:u=a+":"+o,_:{called:u,from:"queueDrain"}})))}),e=p.actions.filter(function(e,t){return!~n.processIndex.indexOf(t)}),p.actions=e))},0),Promise.resolve(function(n,e,i,l,f){try{var o=C(e)?e():e,a=n.type,d=a.replace(z,"");if(n._&&n._.called)return Promise.resolve(n);var u=i.getState(),p=(y=o,void 0===(r=u.plugins)&&(r={}),void 0===(v=n.options)&&(v={}),Object.keys(y).filter(function(e){var t=v.plugins||{};return I(t[e])?t[e]:!1!==t.all&&(!r[e]||!1!==r[e].enabled)}).map(function(e){return y[e]})),g=(p=a===B.initializeStart&&n.fromEnable?Object.keys(u.plugins).filter(function(e){var t=u.plugins[e];return n.plugins.includes(e)&&!t.initialized}).map(function(e){return o[e]}):p).map(function(e){return e.name}),c=(s=p,t=me(m=a).map(function(e){return ge(e,s)}),s.reduce(function(e,t){var t=t.name,n=me(m,t).map(function(e){return ge(e,s)}),r=n[0],i=n[1],n=n[2];return r.length&&(e.beforeNS[t]=r),i.length&&(e.duringNS[t]=i),n.length&&(e.afterNS[t]=n),e},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}}));return Promise.resolve(M({action:n,data:{exact:c.before,namespaced:c.beforeNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(t){function e(){var e=function(){if(a.match(z))return Promise.resolve(M({action:U({},n,{type:d+"End"}),data:{exact:c.after,namespaced:c.afterNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){e.meta&&e.meta.hasCallback&&A(e.meta.rid,{payload:e})})}();return e&&e.then?e.then(function(){return t}):t}if(ve(t,g.length))return t;var n,r=a!==d?Promise.resolve(M({action:U({},t,{type:d}),data:{exact:c.during,namespaced:c.duringNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){n=e}):void(n=t);return r&&r.then?r.then(e):e()})}catch(n){return Promise.reject(n)}var m,s,t,y,r,v}(e,v,y,m,h)).then(function(e){return t=1,g(e)})}();return Promise.resolve(s&&s.then?s.then(f):f(s))}catch(e){return Promise.reject(e)}}}}}var Se=function(){var a=this;this.before=[],this.after=[],this.addMiddleware=function(e,t){a[t]=a[t].concat(e)},this.removeMiddleware=function(t,e){var n=a[e].findIndex(function(e){return e===t});-1!==n&&(a[e]=[].concat(a[e].slice(0,n),a[e].slice(n+1)))},this.dynamicMiddlewares=function(o){return function(i){return function(r){return function(e){var t={getState:i.getState,dispatch:function(e){return i.dispatch(e)}},n=a[o].map(function(e){return e(t)});return ee.apply(void 0,n)(r)(e)}}}}};function Pe(e,t){return e.substring(t.length+1,e.length)}function Ee(e,n,r){return e.reduce(function(e,t){return e[t]=U({},r[t],{enabled:n}),e},r)}function Oe(e){try{return JSON.parse(JSON.stringify(e))}catch(e){}return e}var xe={last:{},history:[]};function je(e,t){void 0===e&&(e=xe);var n=t.options,r=t.meta;return t.type===B.track?(t=Oe(U({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r})),U({},e,{last:t,history:e.history.concat(t)})):e}var Ne={actions:[]};function _e(e,t){void 0===e&&(e=Ne);var n=t.payload;switch(t.type){case"queue":var r=n&&n.type&&n.type===B.identify?[t].concat(e.actions):e.actions.concat(t);return U({},e,{actions:r});case"dequeue":return[];default:return e}}var ke=/#.*$/;var Ae=function(e){if(void 0===e&&(e={}),!F)return e;var t,n=document,r=n.title,n=n.referrer,i=window,o=i.location,a=i.innerWidth,i=i.innerHeight,u=o.hash,o=o.search,c=(t=o,(c=function(){if(F)for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}())?c.match(/\?/)?c:c+t:window.location.href.replace(ke,"")),r={title:r,url:c,path:"/"+((t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t=c))&&t[3]?t[3].split("?")[0].replace(ke,""):""),hash:u,search:o,width:a,height:i};return n&&""!==n&&(r.referrer=n),U({},r,e)},Te={last:{},history:[]};function Me(e,t){void 0===e&&(e=Te);var n=t.options;return t.type===B.page?(t=Oe(U({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n})),U({},e,{last:t,history:e.history.concat(t)})):e}var i={},ze={initialized:!1,sessionId:W(),app:null,version:null,debug:!1,offline:!!F&&!navigator.onLine,os:{name:"na"},userAgent:F?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.7"},timezone:void 0,locale:void 0,campaign:{},referrer:i};function Ce(e,t){var n=(e=void 0===e?ze:e).initialized,r=t.campaign;switch(t.type){case B.campaign:return U({},e,{campaign:r});case B.offline:return U({},e,{offline:!0});case B.online:return U({},e,{offline:!1});default:return n?e:U({},ze,e,{initialized:!0})}}var De=["plugins","reducers","storage"];function Ue(){return K("analytics",[]),function(i){return function(e,t,n){var e=i(e,t,n),r=e.dispatch;return Object.assign(e,{dispatch:function(e){return E[P].analytics.push(e.action||e),r(e)}})}}}function qe(){return function(){return ee(ee.apply(null,arguments),Ue())}}function Re(e){return e?"array"===p(e)?e:[e]:[]}function Ve(e,t,n){void 0===e&&(e={});var r,i,o=W();return t&&(k[o]=(r=t,i=function(e){for(var t,n=e||Array.prototype.slice.call(arguments),r=0;r<n.length;r++)if(C(n[r])){t=n[r];break}return t}(n),function(e){i&&i(e),r(e)})),U({},e,{rid:o,ts:(new Date).getTime()},t?{hasCallback:!0}:{})}function Le(e){function o(){return u}function c(){throw new Error("Abort disabled inListener")}var d,p,g,m,y,v,h,b,I,w=(e=void 0===e?{}:e).reducers||{},S=e.initialUser||{},a=(e.plugins||[]).reduce(function(e,n){if(C(n))return e.middlewares=e.middlewares.concat(n),e;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error("https://lytics.dev/errors/1");n.config||(n.config={});var t=n.EVENTS?Object.keys(n.EVENTS).map(function(e){return n.EVENTS[e]}):[],t=(e.pluginEnabled[n.name]=!(!1===n.enabled||!1===n.config.enabled),delete n.enabled,n.methods&&(e.methods[n.name]=Object.keys(n.methods).reduce(function(e,t){var r;return e[t]=(r=n.methods[t],function(){for(var e=Array.prototype.slice.call(arguments),t=new Array(r.length),n=0;n<e.length;n++)t[n]=e[n];return t[t.length]=l,r.apply({instance:l},t)}),e},{}),delete n.methods),Object.keys(n).concat(t)),t=new Set(e.events.concat(t));if(e.events=Array.from(t),e.pluginsArray=e.pluginsArray.concat(n),e.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return e.plugins[n.name]=n,e.plugins[n.name].loaded||(e.plugins[n.name].loaded=function(){return!0}),e},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),t=e.storage||{getItem:G,setItem:K,removeItem:Q},s=(d=t,function(e,t,n){return t.getState("user")[e]||(n&&D(n)&&n[e]?n[e]:ce(d)[e]||G(se(e))||null)}),u=a.plugins,P=a.events.filter(function(e){return!ie.includes(e)}).sort(),n=new Set(P.concat(re).filter(function(e){return!ie.includes(e)})),n=Array.from(n).sort(),r=new Se,E=r.addMiddleware,O=r.removeMiddleware,r=r.dynamicMiddlewares,i=function(e){for(var t,l=e?(e=e.match(/\?(.*)/))&&e[1]?e[1].split("#")[0]:"":F&&window.location.search.substring(1),n=Object.create(null),f=/([^&=]+)=?([^&]*)/g;i=f.exec(l);){var r=X(i[1]),i=X(i[2]);"[]"===r.substring(r.length-2)?(n[r=r.substring(0,r.length-2)]||(n[r]=[])).push(i):n[r]=""===i||i}for(t in n){var d=t.split("[");if(1<d.length){{o=void 0;a=void 0;p=void 0;u=void 0;c=void 0;s=void 0;var o=n;var a=d.map(function(e){return e.replace(/[?[\]\\ ]/g,"")});var p=n[t];for(var u=a.length-1,c=0;c<u;++c){var s=a[c];if("__proto__"===s||"constructor"===s)break;s in o||(o[s]={}),o=o[s]}o[a[u]]=p}delete n[t]}}return n}(),x=ce(t),j=U({},x,S,i.an_uid?{userId:i.an_uid}:{},i.an_aid?{anonymousId:i.an_aid}:{}),N=(j.anonymousId||(j.anonymousId=W()),U({enable:function(t,n){return new Promise(function(e){f.dispatch({type:B.enablePlugin,plugins:Re(t),_:{originalAction:B.enablePlugin}},e,[n])})},disable:function(t,n){return new Promise(function(e){f.dispatch({type:B.disablePlugin,plugins:Re(t),_:{originalAction:B.disablePlugin}},e,[n])})}},a.methods)),_=!1,l={identify:function(e,t,n,r){try{var i=H(e)?e:null,o=D(e)?e:t,a=n||{},u=l.user(),c=(K(se($),i),i||o.userId||s($,l,o));return Promise.resolve(new Promise(function(e){f.dispatch(U({type:B.identifyStart,userId:c,traits:o||{},options:a,anonymousId:u.anonymousId},u.id&&u.id!==i&&{previousId:u.id}),e,[t,n,r])}))}catch(e){return Promise.reject(e)}},track:function(e,t,n,r){try{var i=D(e)?e.event:e;if(!i||!H(i))throw new Error("EventMissing");var o=D(e)?e:t||{},a=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.trackStart,event:i,properties:o,options:a,userId:s($,l,t),anonymousId:s(ne,l,t)},e,[t,n,r])}))}catch(e){return Promise.reject(e)}},page:function(t,n,r){try{var i=D(t)?t:{},o=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.pageStart,properties:Ae(i),options:o,userId:s($,l,i),anonymousId:s(ne,l,i)},e,[t,n,r])}))}catch(t){return Promise.reject(t)}},user:function(e){if(e===$||"id"===e)return s($,l);if(e===ne||"anonId"===e)return s(ne,l);var t=l.getState("user");return e?J(t,e):t},reset:function(t){return new Promise(function(e){f.dispatch({type:B.resetStart},e,t)})},ready:function(t){return _&&t({plugins:N,instance:l}),l.on(B.ready,function(e){t(e),_=!0})},on:function(n,r){if(!n||!C(r))return!1;if(n===B.bootstrap)throw new Error(".on disabled for "+n);var e,t,i=/Start$|Start:/;if("*"===n)return t=function(e){return function(t){return function(e){return e.type.match(i)||r({payload:e,instance:l,plugins:u}),t(e)}}},E(e=function(e){return function(t){return function(e){return e.type.match(i)&&r({payload:e,instance:l,plugins:u}),t(e)}}},$e),E(t,Be),function(){O(e,$e),O(t,Be)};function o(e){return function(t){return function(e){return e.type===n&&r({payload:e,instance:l,plugins:u,abort:c}),t(e)}}}var a=n.match(i)?$e:Be;return E(o,a),function(){return O(o,a)}},once:function(e,t){if(!e||!C(t))return!1;if(e===B.bootstrap)throw new Error(".once disabled for "+e);var n=l.on(e,function(e){t({payload:e.payload,instance:l,plugins:u,abort:c}),n()});return n},getState:function(e){var t=f.getState();return e?J(t,e):Object.assign({},t)},dispatch:function(e){var t=H(e)?{type:e}:e;if(re.includes(t.type))throw new Error("reserved action "+t.type);t=U({},t,{_:U({originalAction:t.type},e._||{})});f.dispatch(t)},enablePlugin:N.enable,disablePlugin:N.disable,plugins:N,storage:{getItem:t.getItem,setItem:function(e,t,n){f.dispatch({type:B.setItemStart,key:e,value:t,options:n})},removeItem:function(e,t){f.dispatch({type:B.removeItemStart,key:e,options:t})}},setAnonymousId:function(e,t){l.storage.setItem(V,e,t)},events:{core:re,plugins:P}},P=a.middlewares.concat([function(e){return function(t){return function(e){return e.meta||(e.meta=Ve()),t(e)}}},r($e),we(l,o,{all:n,plugins:P}),(I=t,function(e){return function(o){return function(e){var t=e.type,n=e.key,r=e.value,i=e.options;if(t===B.setItem||t===B.removeItem){if(e.abort)return o(e);t===B.setItem?I.setItem(n,r,i):I.removeItem(n,i)}return o(e)}}}),(b=(h=l).storage.setItem,function(l){return function(s){return function(e){var r,t,n,i,o,a,u,c;return e.type===B.bootstrap&&(r=e.params,o=e.user,t=e.persistedUser,n=e.initialUser,i=t.userId===o.userId,t.anonymousId!==o.anonymousId&&b(V,o.anonymousId),i||b(L,o.userId),n.traits&&b(te,U({},i&&t.traits?t.traits:{},n.traits)),(o=Object.keys(e.params)).length&&(a=r.an_uid,u=r.an_event,c=o.reduce(function(e,t){var n;return(t.match(oe)||t.match(/^(d|g)clid/))&&(n=t.replace(oe,""),e.campaign["campaign"===n?"name":n]=r[t]),t.match(ae)&&(e.props[t.replace(ae,"")]=r[t]),t.match(ue)&&(e.traits[t.replace(ue,"")]=r[t]),e},{campaign:{},props:{},traits:{}}),l.dispatch(U({type:B.params,raw:r},c,a?{userId:a}:{})),a&&setTimeout(function(){return h.identify(a,c.traits)},0),u&&setTimeout(function(){return h.track(u,c.props)},0),Object.keys(c.campaign).length&&l.dispatch({type:B.campaign,campaign:c.campaign}))),s(e)}}}),(m=(n=(n=l).storage).setItem,y=n.removeItem,v=n.getItem,function(u){return function(a){return function(e){var t,n,r=e.userId,i=e.traits,o=e.options;return e.type===B.reset&&([L,te,V].forEach(function(e){y(e)}),[$,ne,"traits"].forEach(function(e){Q(se(e))})),e.type===B.identify&&(v(V)||m(V,W()),t=v(L),n=v(te)||{},t&&t!==r&&u.dispatch({type:B.userIdChanged,old:{userId:t,traits:n},new:{userId:r,traits:i},options:o}),r&&m(L,r),i&&m(te,U({},n,i))),a(e)}}}),r(Be)]),n={context:Ce,user:(g=t,function(e,t){if(void 0===e&&(e={}),(t=void 0===t?{}:t).type===B.setItemEnd){if(t.key===V)return U({},e,{anonymousId:t.value});if(t.key===L)return U({},e,{userId:t.value})}switch(t.type){case B.identify:return Object.assign({},e,{userId:t.userId,traits:U({},e.traits,t.traits)});case B.reset:return[L,V,te].forEach(function(e){g.removeItem(e)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}),page:Me,track:je,plugins:(p=o,function(e,t){void 0===e&&(e={});var n={};if("initialize:aborted"===t.type)return e;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=Pe(t.type,"registerPlugin"),i=p()[r];if(!i||!r)return e;var o=t.enabled,a=i.config;return n[r]={enabled:o,initialized:!!o&&Boolean(!i.initialize),loaded:!!o&&Boolean(i.loaded({config:a})),config:a},U({},e,n)}if(/^initialize:([^:]*)$/.test(t.type))return r=Pe(t.type,B.initialize),(o=p()[r])&&r?(n[r]=U({},e[r],{initialized:!0,loaded:Boolean(o.loaded({config:o.config}))}),U({},e,n)):e;if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=U({},e[t.name],{loaded:!0}),U({},e,n);switch(t.type){case B.disablePlugin:return U({},e,Ee(t.plugins,!1,e));case B.enablePlugin:return U({},e,Ee(t.plugins,!0,e));default:return e}}),queue:_e},r=ee,t=ee;F&&e.debug&&((T=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(r=T({trace:!0,traceLimit:25})),t=function(){return 0===arguments.length?Ue():D(typeof arguments[0])?qe():qe().apply(null,arguments)});A=e;var k,A,T=Object.keys(A).reduce(function(e,t){return De.includes(t)||(e[t]=A[t]),e},{}),e={context:T,user:j,plugins:a.pluginsArray.reduce(function(e,t){var n=t.name,r=t.config,i=t.loaded,o=a.pluginEnabled[n];return e[n]={enabled:o,initialized:!!o&&Boolean(!t.initialize),loaded:Boolean(i({config:r})),config:r},e},{})},f=Z(function(e){for(var t=Object.keys(e),l={},n=0;n<t.length;n++){var r=t[n];typeof e[r]===q&&(l[r]=e[r])}var f,i,d=Object.keys(l);try{i=l,Object.keys(i).forEach(function(e){var t=i[e];if(typeof t(void 0,{type:"@@redux/INIT"})===R||typeof t(void 0,{type:Y})===R)throw new Error("reducer "+e+" "+R)})}catch(e){f=e}return function(e,t){if(void 0===e&&(e={}),f)throw f;for(var n,r=!1,i={},o=0;o<d.length;o++){var a,u=d[o],c=e[u],s=(0,l[u])(c,t);if(typeof s===R)throw n=u,a="action "+((a=(a=t)&&a.type)&&a.toString()||"?")+"reducer "+n+" returns "+R,new Error(a);i[u]=s,r=r||s!==c}return r?i:e}}(U({},n,w)),e,t(r(function(){var a=arguments;return function(o){return function(e,t,n){var e=o(e,t,n),r=e.dispatch,i={getState:e.getState,dispatch:function(e){return r(e)}},t=[].slice.call(a).map(function(e){return e(i)});return U({},e,{dispatch:r=ee.apply(void 0,t)(e.dispatch)})}}}.apply(void 0,P)))),n=(f.dispatch=(k=f.dispatch,function(e,t,n){e=U({},e,{meta:Ve(e.meta,t,Re(n))});return k.apply(null,[e])}),Object.keys(u)),M=(f.dispatch({type:B.bootstrap,plugins:n,config:T,params:i,user:j,initialUser:S,persistedUser:x}),n.filter(function(e){return a.pluginEnabled[e]})),z=n.filter(function(e){return!a.pluginEnabled[e]});return f.dispatch({type:B.registerPlugins,plugins:n,enabled:a.pluginEnabled}),a.pluginsArray.map(function(e,t){var n=e.bootstrap,r=e.config,i=e.name;n&&C(n)&&n({instance:l,config:r,payload:e}),f.dispatch({type:B.registerPluginType(i),name:i,enabled:a.pluginEnabled[i],plugin:e}),a.pluginsArray.length===t+1&&f.dispatch({type:B.initializeStart,plugins:M,disabled:z})}),l}var $e="before",Be="after",Je="cookie",Fe=Ge(),He=Ke,Xe=Ke;function We(e){return Fe?Ke(e,"",-1):Q(e)}function Ge(){if(void 0!==Fe)return Fe;var e="cookiecookie";try{Ke(e,e),Fe=-1!==document.cookie.indexOf(e),We(e)}catch(e){Fe=!1}return Fe}function Ke(e,t,n,r,i,o){var a;if("undefined"!=typeof window)return a=1<arguments.length,!1===Fe&&(a?K(e,t):G(e)),a?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}var Qe="localStorage",i=j.bind(null,"localStorage"),Ye=(O("localStorage","getItem",G),O("localStorage","setItem",K),O("localStorage","removeItem",Q),"sessionStorage"),Ze=j.bind(null,"sessionStorage");function et(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(D(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}O("sessionStorage","getItem",G),O("sessionStorage","setItem",K),O("sessionStorage","removeItem",Q);var tt=i(),nt=Ze(),rt=Ge();function it(e,t){if(e){var t=ot(t),n=!st(t),r=at(t)?et(localStorage.getItem(e)):void 0;if(n&&!m(r))return r;var i=ut(t)?et(He(e)):void 0;if(n&&i)return i;t=ct(t)?et(sessionStorage.getItem(e)):void 0;if(n&&t)return t;e=G(e);return n?e:{localStorage:r,sessionStorage:t,cookie:i,global:e}}}function ot(e){return e?H(e)?e:e.storage:o}function at(e){return tt&<(e,Qe)}function ut(e){return rt&<(e,Je)}function ct(e){return nt&<(e,Ye)}function st(e){return e===a||"all"===e}function lt(e,t){return e===o||e===t||st(e)}function ft(e,t,n){return{location:e,current:t,previous:n}}var dt={setItem:function(e,t,n){var r,i,o;if(e&&!m(t))return r={},n=ot(n),i=JSON.stringify(t),o=!st(n),at(n)&&(r[Qe]=ft(Qe,t,et(localStorage.getItem(e))),localStorage.setItem(e,i),o)?r[Qe]:ut(n)&&(r[Je]=ft(Je,t,et(He(e))),Xe(e,i),o)?r[Je]:ct(n)&&(r[Ye]=ft(Ye,t,et(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?r[Ye]:(r[S]=ft(S,t,G(e)),K(e,t),o?r[S]:r)},getItem:it,removeItem:function(e,t){var n,r;if(e)return t=ot(t),n=it(e,a),r={},!m(n.localStorage)&&at(t)&&(localStorage.removeItem(e),r[Qe]=n.localStorage),!m(n.cookie)&&ut(t)&&(We(e),r[Je]=n.cookie),!m(n.sessionStorage)&&ct(t)&&(sessionStorage.removeItem(e),r[Ye]=n.sessionStorage),!m(n.global)&<(t,S)&&(Q(e),r[S]=n.global),r}};function pt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Le(n(n({},{storage:dt}),e))}return e.Analytics=pt,e.CONSTANTS=c,e.EVENTS=B,e.default=pt,e.init=pt,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
{ | ||
"name": "analytics", | ||
"version": "0.8.9", | ||
"version": "0.8.11", | ||
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.", | ||
@@ -65,3 +65,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@analytics/core": "^0.12.7", | ||
"@analytics/core": "^0.12.9", | ||
"@analytics/storage-utils": "^0.4.2" | ||
@@ -94,4 +94,3 @@ }, | ||
"sinon": "7.2.3" | ||
}, | ||
"gitHead": "935e9cbc2c8662395f560deaa84b95702e82c0af" | ||
} | ||
} |
@@ -714,7 +714,7 @@ # Analytics | ||
|:---------------------------|:---------------:|:-----------:| | ||
| **[@analytics/activity-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity)** <br/> User activity listener utilities | <a href="https://www.npmjs.com/package/@analytics/activity-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/activity-utils.svg"></a> | **0.1.15** | | ||
| **[@analytics/activity-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity)** <br/> User activity listener utilities | <a href="https://www.npmjs.com/package/@analytics/activity-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/activity-utils.svg"></a> | **0.1.16** | | ||
| **[@analytics/amplitude](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-amplitude)** <br/> Amplitude integration for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/amplitude"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/amplitude.svg"></a> | **0.1.3** | | ||
| **[@analytics/aws-pinpoint](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-aws-pinpoint)** <br/> AWS Pinpoint integration for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/aws-pinpoint"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/aws-pinpoint.svg"></a> | **0.7.9** | | ||
| **[@analytics/aws-pinpoint](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-aws-pinpoint)** <br/> AWS Pinpoint integration for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/aws-pinpoint"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/aws-pinpoint.svg"></a> | **0.7.11** | | ||
| **[@analytics/cookie-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage-cookie)** <br/> Tiny cookie utility library | <a href="https://www.npmjs.com/package/@analytics/cookie-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/cookie-utils.svg"></a> | **0.2.12** | | ||
| **[@analytics/core](https://github.com/DavidWells/analytics/tree/master/packages/analytics-core)** <br/> Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system. | <a href="https://www.npmjs.com/package/@analytics/core"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/core.svg"></a> | **0.12.5** | | ||
| **[@analytics/core](https://github.com/DavidWells/analytics/tree/master/packages/analytics-core)** <br/> Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system. | <a href="https://www.npmjs.com/package/@analytics/core"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/core.svg"></a> | **0.12.7** | | ||
| **[@analytics/countly](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-countly)** <br/> Countly plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/countly"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/countly.svg"></a> | **0.21.12** | | ||
@@ -728,3 +728,3 @@ | **[@analytics/crazy-egg](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-crazy-egg)** <br/> Crazy Egg integration for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/crazy-egg"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/crazy-egg.svg"></a> | **0.1.2** | | ||
| **[@analytics/google-analytics](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-google-analytics)** <br/> Google analytics v4 plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/google-analytics"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/google-analytics.svg"></a> | **1.0.7** | | ||
| **[@analytics/google-tag-manager](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-google-tag-manager)** <br/> Google tag manager plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/google-tag-manager"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/google-tag-manager.svg"></a> | **0.5.4** | | ||
| **[@analytics/google-tag-manager](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-google-tag-manager)** <br/> Google tag manager plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/google-tag-manager"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/google-tag-manager.svg"></a> | **0.5.5** | | ||
| **[@analytics/google-analytics-v3](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-google-analytics-v3)** <br/> Google analytics v3 plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/google-analytics-v3"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/google-analytics-v3.svg"></a> | **0.6.1** | | ||
@@ -734,3 +734,3 @@ | **[@analytics/gosquared](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-gosquared)** <br/> GoSquared integration for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/gosquared"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/gosquared.svg"></a> | **0.1.3** | | ||
| **[@analytics/intercom](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-intercom)** <br/> Intercom integration for 'analytics' module for browser & node | <a href="https://www.npmjs.com/package/@analytics/intercom"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/intercom.svg"></a> | **1.0.2** | | ||
| **[@analytics/listener-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-listener)** <br/> Backward compatible event listener library for attaching & detaching event handlers | <a href="https://www.npmjs.com/package/@analytics/listener-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/listener-utils.svg"></a> | **0.3.2** | | ||
| **[@analytics/listener-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-listener)** <br/> Backward compatible event listener library for attaching & detaching event handlers | <a href="https://www.npmjs.com/package/@analytics/listener-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/listener-utils.svg"></a> | **0.4.0** | | ||
| **[@analytics/localstorage-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage-local)** <br/> Tiny LocalStorage utility library | <a href="https://www.npmjs.com/package/@analytics/localstorage-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/localstorage-utils.svg"></a> | **0.1.10** | | ||
@@ -746,6 +746,6 @@ | **[@analytics/mixpanel](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-mixpanel)** <br/> Mixpanel plugin for 'analytics' module | <a href="https://www.npmjs.com/package/@analytics/mixpanel"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/mixpanel.svg"></a> | **0.4.0** | | ||
| **[@analytics/scroll-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-scroll)** <br/> Scroll utility library to fire events on scroll | <a href="https://www.npmjs.com/package/@analytics/scroll-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/scroll-utils.svg"></a> | **0.1.22** | | ||
| **[@analytics/segment](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-segment)** <br/> Segment integration for 'analytics' module for browser & node | <a href="https://www.npmjs.com/package/@analytics/segment"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/segment.svg"></a> | **1.1.4** | | ||
| **[@analytics/segment](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-segment)** <br/> Segment integration for 'analytics' module for browser & node | <a href="https://www.npmjs.com/package/@analytics/segment"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/segment.svg"></a> | **2.1.0** | | ||
| **[@analytics/session-storage-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage-session)** <br/> Tiny SessionStorage utility library | <a href="https://www.npmjs.com/package/@analytics/session-storage-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/session-storage-utils.svg"></a> | **0.0.7** | | ||
| **[@analytics/session-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-session)** <br/> Tiny session utility library | <a href="https://www.npmjs.com/package/@analytics/session-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/session-utils.svg"></a> | **0.1.19** | | ||
| **[@analytics/simple-analytics](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics)** <br/> Simple analytics plugin for 'analytics' module for browser | <a href="https://www.npmjs.com/package/@analytics/simple-analytics"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/simple-analytics.svg"></a> | **0.3.4** | | ||
| **[@analytics/simple-analytics](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics)** <br/> Simple analytics plugin for 'analytics' module for browser | <a href="https://www.npmjs.com/package/@analytics/simple-analytics"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/simple-analytics.svg"></a> | **0.4.0** | | ||
| **[@analytics/snowplow](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-snowplow)** <br/> Snowplow integration for 'analytics' module for browser & node | <a href="https://www.npmjs.com/package/@analytics/snowplow"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/snowplow.svg"></a> | **0.3.3** | | ||
@@ -762,3 +762,3 @@ | **[@analytics/storage-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage)** <br/> Storage utility with fallbacks | <a href="https://www.npmjs.com/package/@analytics/storage-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/@analytics/storage-utils.svg"></a> | **0.4.2** | | ||
| **[analytics-plugin-tab-events](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-tab-events)** <br/> Expose tab visibility events plugin for 'analytics' module | <a href="https://www.npmjs.com/package/analytics-plugin-tab-events"><img width="360" height="22" src="https://img.shields.io/npm/dm/analytics-plugin-tab-events.svg"></a> | **0.2.1** | | ||
| **[use-analytics](https://github.com/DavidWells/analytics/tree/master/packages/use-analytics)** <br/> Analytics hooks for React | <a href="https://www.npmjs.com/package/use-analytics"><img width="360" height="22" src="https://img.shields.io/npm/dm/use-analytics.svg"></a> | **1.0.0** | | ||
| **[use-analytics](https://github.com/DavidWells/analytics/tree/master/packages/use-analytics)** <br/> Analytics hooks for React | <a href="https://www.npmjs.com/package/use-analytics"><img width="360" height="22" src="https://img.shields.io/npm/dm/use-analytics.svg"></a> | **1.1.0** | | ||
| **[analytics-util-params](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-params)** <br/> Url Parameter helper functions | <a href="https://www.npmjs.com/package/analytics-util-params"><img width="360" height="22" src="https://img.shields.io/npm/dm/analytics-util-params.svg"></a> | **0.1.2** | | ||
@@ -781,4 +781,6 @@ | **[analytics-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-utils)** <br/> Analytics utility functions used by 'analytics' module | <a href="https://www.npmjs.com/package/analytics-utils"><img width="360" height="22" src="https://img.shields.io/npm/dm/analytics-utils.svg"></a> | **1.0.12** | | ||
- [Logrocket](https://www.npmjs.com/package/analytics-plugin-logrocket) Adds Analytics support for LogRocket | ||
- [Planhat](https://www.npmjs.com/package/analytics-plugin-planhat) Adds Analytics support for Planhat | ||
- [Plausible](https://www.npmjs.com/package/analytics-plugin-plausible) Adds Analytics support for Plausible | ||
- [PostHog](https://www.npmjs.com/package/@metro-fs/analytics-plugin-posthog) Adds Analytics support for PostHog | ||
- [PostHog](https://www.npmjs.com/package/@metro-fs/analytics-plugin-posthog) Adds Analytics support for PostHog by @metro-fs | ||
- [PostHog](https://www.npmjs.com/package/analytics-plugin-posthog) Adds Analytics support for PostHog by deevus | ||
- [ProfitWell](https://github.com/deevus/analytics-plugin-profitwell) Adds Analytics support for ProfitWell | ||
@@ -785,0 +787,0 @@ - [Reddit Pixel](https://www.npmjs.com/package/analytics-plugin-reddit-pixel) Adds Analytics support for Reddit Pixel |
2621
1046
159152
9
Updated@analytics/core@^0.12.9