@sesamy/sesamy-js 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +2 -0
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +939 -916
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var B = (t, e, n) => (
|
|
4
|
-
function
|
|
1
|
+
var Tr = Object.defineProperty;
|
|
2
|
+
var Or = (t, e, n) => e in t ? Tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var B = (t, e, n) => (Or(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
function We(t, e) {
|
|
5
5
|
const n = new CustomEvent(t, {
|
|
6
6
|
detail: e,
|
|
7
7
|
bubbles: !0,
|
|
@@ -20,14 +20,14 @@ function Q(t, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
23
|
+
var le = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
24
|
+
function xt(t) {
|
|
25
25
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function At(t, e) {
|
|
28
28
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var ce = At(function(t, e) {
|
|
31
31
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
32
32
|
var n = function() {
|
|
33
33
|
function r() {
|
|
@@ -58,9 +58,9 @@ var se = xt(function(t, e) {
|
|
|
58
58
|
return n.getInstance();
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var n =
|
|
61
|
+
xt(ce);
|
|
62
|
+
var Pr = xt(At(function(t, e) {
|
|
63
|
+
var n = le && le.__awaiter || function(u, c, f, d) {
|
|
64
64
|
return new (f || (f = Promise))(function(w, k) {
|
|
65
65
|
function v(g) {
|
|
66
66
|
try {
|
|
@@ -69,7 +69,7 @@ var Or = jt(xt(function(t, e) {
|
|
|
69
69
|
k(l);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function E(g) {
|
|
73
73
|
try {
|
|
74
74
|
S(d.throw(g));
|
|
75
75
|
} catch (l) {
|
|
@@ -79,20 +79,20 @@ var Or = jt(xt(function(t, e) {
|
|
|
79
79
|
function S(g) {
|
|
80
80
|
g.done ? w(g.value) : new f(function(l) {
|
|
81
81
|
l(g.value);
|
|
82
|
-
}).then(v,
|
|
82
|
+
}).then(v, E);
|
|
83
83
|
}
|
|
84
84
|
S((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
|
-
}, r =
|
|
86
|
+
}, r = le && le.__generator || function(u, c) {
|
|
87
87
|
var f, d, w, k, v = { label: 0, sent: function() {
|
|
88
88
|
if (1 & w[0])
|
|
89
89
|
throw w[1];
|
|
90
90
|
return w[1];
|
|
91
91
|
}, trys: [], ops: [] };
|
|
92
|
-
return k = { next:
|
|
92
|
+
return k = { next: E(0), throw: E(1), return: E(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
|
|
93
93
|
return this;
|
|
94
94
|
}), k;
|
|
95
|
-
function
|
|
95
|
+
function E(S) {
|
|
96
96
|
return function(g) {
|
|
97
97
|
return function(l) {
|
|
98
98
|
if (f)
|
|
@@ -146,7 +146,7 @@ var Or = jt(xt(function(t, e) {
|
|
|
146
146
|
}([S, g]);
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
}, i =
|
|
149
|
+
}, i = le;
|
|
150
150
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
151
151
|
var o = "browser-tabs-lock-key", a = { key: function(u) {
|
|
152
152
|
return n(i, void 0, void 0, function() {
|
|
@@ -205,7 +205,7 @@ var Or = jt(xt(function(t, e) {
|
|
|
205
205
|
}
|
|
206
206
|
return u.prototype.acquireLock = function(c, f) {
|
|
207
207
|
return f === void 0 && (f = 5e3), n(this, void 0, void 0, function() {
|
|
208
|
-
var d, w, k, v,
|
|
208
|
+
var d, w, k, v, E, S, g;
|
|
209
209
|
return r(this, function(l) {
|
|
210
210
|
switch (l.label) {
|
|
211
211
|
case 0:
|
|
@@ -213,9 +213,9 @@ var Or = jt(xt(function(t, e) {
|
|
|
213
213
|
case 1:
|
|
214
214
|
return Date.now() < w ? [4, s(30)] : [3, 8];
|
|
215
215
|
case 2:
|
|
216
|
-
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (
|
|
216
|
+
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (E = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
217
217
|
case 3:
|
|
218
|
-
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey:
|
|
218
|
+
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: E, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
219
219
|
case 4:
|
|
220
220
|
return l.sent(), (S = v.getItemSync(k)) !== null && (g = JSON.parse(S)).id === this.id && g.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
|
|
221
221
|
case 5:
|
|
@@ -235,13 +235,13 @@ var Or = jt(xt(function(t, e) {
|
|
|
235
235
|
return r(this, function(w) {
|
|
236
236
|
return setTimeout(function() {
|
|
237
237
|
return n(d, void 0, void 0, function() {
|
|
238
|
-
var k, v,
|
|
238
|
+
var k, v, E;
|
|
239
239
|
return r(this, function(S) {
|
|
240
240
|
switch (S.label) {
|
|
241
241
|
case 0:
|
|
242
|
-
return [4,
|
|
242
|
+
return [4, ce.default().lock(f)];
|
|
243
243
|
case 1:
|
|
244
|
-
return S.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (
|
|
244
|
+
return S.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (ce.default().unlock(f), [2]) : ((E = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(E)), ce.default().unlock(f), this.refreshLockWhileAcquired(c, f), [2])) : (ce.default().unlock(f), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -255,15 +255,15 @@ var Or = jt(xt(function(t, e) {
|
|
|
255
255
|
case 0:
|
|
256
256
|
return [4, new Promise(function(d) {
|
|
257
257
|
var w = !1, k = Date.now(), v = !1;
|
|
258
|
-
function
|
|
259
|
-
if (v || (window.removeEventListener("storage",
|
|
258
|
+
function E() {
|
|
259
|
+
if (v || (window.removeEventListener("storage", E), u.removeFromWaiting(E), clearTimeout(S), v = !0), !w) {
|
|
260
260
|
w = !0;
|
|
261
261
|
var g = 50 - (Date.now() - k);
|
|
262
262
|
g > 0 ? setTimeout(d, g) : d(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
window.addEventListener("storage",
|
|
266
|
-
var S = setTimeout(
|
|
265
|
+
window.addEventListener("storage", E), u.addToWaiting(E);
|
|
266
|
+
var S = setTimeout(E, Math.max(0, c - Date.now()));
|
|
267
267
|
})];
|
|
268
268
|
case 1:
|
|
269
269
|
return f.sent(), [2];
|
|
@@ -297,9 +297,9 @@ var Or = jt(xt(function(t, e) {
|
|
|
297
297
|
return r(this, function(v) {
|
|
298
298
|
switch (v.label) {
|
|
299
299
|
case 0:
|
|
300
|
-
return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = f.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4,
|
|
300
|
+
return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = f.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4, ce.default().lock(k.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
v.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d),
|
|
302
|
+
v.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d), ce.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
@@ -312,78 +312,78 @@ var Or = jt(xt(function(t, e) {
|
|
|
312
312
|
break;
|
|
313
313
|
w.push(v), k++;
|
|
314
314
|
}
|
|
315
|
-
for (var
|
|
315
|
+
for (var E = !1, S = 0; S < w.length; S++) {
|
|
316
316
|
var g = w[S];
|
|
317
317
|
if (g.includes(o)) {
|
|
318
318
|
var l = d.getItemSync(g);
|
|
319
319
|
if (l !== null) {
|
|
320
320
|
var b = JSON.parse(l);
|
|
321
|
-
(b.timeRefreshed === void 0 && b.timeAcquired < f || b.timeRefreshed !== void 0 && b.timeRefreshed < f) && (d.removeItemSync(g),
|
|
321
|
+
(b.timeRefreshed === void 0 && b.timeAcquired < f || b.timeRefreshed !== void 0 && b.timeRefreshed < f) && (d.removeItemSync(g), E = !0);
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
E && u.notifyWaiters();
|
|
326
326
|
}, u.waiters = void 0, u;
|
|
327
327
|
}();
|
|
328
328
|
e.default = p;
|
|
329
329
|
}));
|
|
330
|
-
const
|
|
331
|
-
let Y = class
|
|
330
|
+
const jr = { timeoutInSeconds: 60 }, zn = { name: "auth0-spa-js", version: "2.1.3" }, Nn = () => Date.now();
|
|
331
|
+
let Y = class kt extends Error {
|
|
332
332
|
constructor(e, n) {
|
|
333
|
-
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this,
|
|
333
|
+
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, kt.prototype);
|
|
334
334
|
}
|
|
335
335
|
static fromPayload({ error: e, error_description: n }) {
|
|
336
|
-
return new
|
|
336
|
+
return new kt(e, n);
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, Cr = class Dn extends Y {
|
|
339
339
|
constructor(e, n, r, i = null) {
|
|
340
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
340
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Dn.prototype);
|
|
341
341
|
}
|
|
342
|
-
},
|
|
342
|
+
}, It = class Un extends Y {
|
|
343
343
|
constructor() {
|
|
344
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
344
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, Un.prototype);
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, xr = class Ln extends It {
|
|
347
347
|
constructor(e) {
|
|
348
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
348
|
+
super(), this.popup = e, Object.setPrototypeOf(this, Ln.prototype);
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Ar = class Rn extends Y {
|
|
351
351
|
constructor(e) {
|
|
352
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
352
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Rn.prototype);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, $r = class Mn extends Y {
|
|
355
355
|
constructor(e, n, r) {
|
|
356
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
356
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Mn.prototype);
|
|
357
357
|
}
|
|
358
|
-
},
|
|
358
|
+
}, Zn = class Wn extends Y {
|
|
359
359
|
constructor(e, n) {
|
|
360
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
360
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Ht(e, ["default"])}', scope: '${Ht(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Wn.prototype);
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
function
|
|
363
|
+
function Ht(t, e = []) {
|
|
364
364
|
return t && !e.includes(t) ? t : "";
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const Qe = () => window.crypto, dt = () => {
|
|
367
367
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
368
368
|
let e = "";
|
|
369
|
-
return Array.from(
|
|
370
|
-
},
|
|
369
|
+
return Array.from(Qe().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
370
|
+
}, Jt = (t) => btoa(t), St = (t) => {
|
|
371
371
|
var { clientId: e } = t, n = Q(t, ["clientId"]);
|
|
372
372
|
return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
|
|
373
|
-
},
|
|
373
|
+
}, Xt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), zr = async (t, e) => {
|
|
374
374
|
const n = await fetch(t, e);
|
|
375
375
|
return { ok: n.ok, json: await n.json() };
|
|
376
|
-
},
|
|
376
|
+
}, Nr = async (t, e, n) => {
|
|
377
377
|
const r = new AbortController();
|
|
378
378
|
let i;
|
|
379
|
-
return e.signal = r.signal, Promise.race([
|
|
379
|
+
return e.signal = r.signal, Promise.race([zr(t, e), new Promise((o, a) => {
|
|
380
380
|
i = setTimeout(() => {
|
|
381
381
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
382
382
|
}, n);
|
|
383
383
|
})]).finally(() => {
|
|
384
384
|
clearTimeout(i);
|
|
385
385
|
});
|
|
386
|
-
},
|
|
386
|
+
}, Dr = async (t, e, n, r, i, o, a) => {
|
|
387
387
|
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, h = o, new Promise(function(p, u) {
|
|
388
388
|
const c = new MessageChannel();
|
|
389
389
|
c.port1.onmessage = function(f) {
|
|
@@ -391,34 +391,34 @@ const Be = () => window.crypto, lt = () => {
|
|
|
391
391
|
}, h.postMessage(s, [c.port2]);
|
|
392
392
|
});
|
|
393
393
|
var s, h;
|
|
394
|
-
},
|
|
395
|
-
async function
|
|
394
|
+
}, Ur = async (t, e, n, r, i, o, a = 1e4) => i ? Dr(t, e, n, r, a, i, o) : Nr(t, r, a);
|
|
395
|
+
async function Lr(t, e) {
|
|
396
396
|
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, h = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
|
-
const p = s ?
|
|
397
|
+
const p = s ? St(h) : JSON.stringify(h);
|
|
398
398
|
return await async function(u, c, f, d, w, k, v) {
|
|
399
|
-
let
|
|
399
|
+
let E, S = null;
|
|
400
400
|
for (let $ = 0; $ < 3; $++)
|
|
401
401
|
try {
|
|
402
|
-
|
|
402
|
+
E = await Ur(u, f, d, w, k, v, c), S = null;
|
|
403
403
|
break;
|
|
404
404
|
} catch (L) {
|
|
405
405
|
S = L;
|
|
406
406
|
}
|
|
407
407
|
if (S)
|
|
408
408
|
throw S;
|
|
409
|
-
const g =
|
|
409
|
+
const g = E.json, { error: l, error_description: b } = g, P = Q(g, ["error", "error_description"]), { ok: j } = E;
|
|
410
410
|
if (!j) {
|
|
411
411
|
const $ = b || `HTTP error. Unable to fetch ${u}`;
|
|
412
|
-
throw l === "mfa_required" ? new
|
|
412
|
+
throw l === "mfa_required" ? new $r(l, $, P.mfa_token) : l === "missing_refresh_token" ? new Zn(f, d) : new Y(l || "request_error", $);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
415
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a ||
|
|
414
|
+
return P;
|
|
415
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || zn)) } }, e, s);
|
|
416
416
|
}
|
|
417
|
-
const
|
|
417
|
+
const He = (...t) => {
|
|
418
418
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
419
419
|
var e;
|
|
420
420
|
};
|
|
421
|
-
let
|
|
421
|
+
let he = class _t {
|
|
422
422
|
constructor(e, n = "@@auth0spajs@@", r) {
|
|
423
423
|
this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
|
|
424
424
|
}
|
|
@@ -427,13 +427,13 @@ let le = class St {
|
|
|
427
427
|
}
|
|
428
428
|
static fromKey(e) {
|
|
429
429
|
const [n, r, i, o] = e.split("::");
|
|
430
|
-
return new
|
|
430
|
+
return new _t({ clientId: r, scope: o, audience: i }, n);
|
|
431
431
|
}
|
|
432
432
|
static fromCacheEntry(e) {
|
|
433
433
|
const { scope: n, audience: r, client_id: i } = e;
|
|
434
|
-
return new
|
|
434
|
+
return new _t({ scope: n, audience: r, clientId: i });
|
|
435
435
|
}
|
|
436
|
-
},
|
|
436
|
+
}, Rr = class {
|
|
437
437
|
set(e, n) {
|
|
438
438
|
localStorage.setItem(e, JSON.stringify(n));
|
|
439
439
|
}
|
|
@@ -452,7 +452,7 @@ let le = class St {
|
|
|
452
452
|
allKeys() {
|
|
453
453
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, Kn = class {
|
|
456
456
|
constructor() {
|
|
457
457
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
458
458
|
let e = {};
|
|
@@ -467,9 +467,9 @@ let le = class St {
|
|
|
467
467
|
}, allKeys: () => Object.keys(e) };
|
|
468
468
|
}();
|
|
469
469
|
}
|
|
470
|
-
},
|
|
470
|
+
}, Mr = class {
|
|
471
471
|
constructor(e, n, r) {
|
|
472
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
472
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || Nn;
|
|
473
473
|
}
|
|
474
474
|
async setIdToken(e, n, r) {
|
|
475
475
|
var i;
|
|
@@ -502,7 +502,7 @@ let le = class St {
|
|
|
502
502
|
}
|
|
503
503
|
async set(e) {
|
|
504
504
|
var n;
|
|
505
|
-
const r = new
|
|
505
|
+
const r = new he({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
|
|
506
506
|
await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
|
|
507
507
|
}
|
|
508
508
|
async clear(e) {
|
|
@@ -521,16 +521,16 @@ let le = class St {
|
|
|
521
521
|
return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
|
|
522
522
|
}
|
|
523
523
|
getIdTokenCacheKey(e) {
|
|
524
|
-
return new
|
|
524
|
+
return new he({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
|
|
525
525
|
}
|
|
526
526
|
matchExistingCacheKey(e, n) {
|
|
527
527
|
return n.filter((r) => {
|
|
528
528
|
var i;
|
|
529
|
-
const o =
|
|
529
|
+
const o = he.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], h = o.scope && s.reduce((p, u) => p && a.has(u), !0);
|
|
530
530
|
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && h;
|
|
531
531
|
})[0];
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, Zr = class {
|
|
534
534
|
constructor(e, n, r) {
|
|
535
535
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
536
536
|
}
|
|
@@ -544,17 +544,17 @@ let le = class St {
|
|
|
544
544
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
const
|
|
547
|
+
const ze = (t) => typeof t == "number", Wr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], Kr = (t) => {
|
|
548
548
|
if (!t.id_token)
|
|
549
549
|
throw new Error("ID token is required but missing");
|
|
550
550
|
const e = ((o) => {
|
|
551
551
|
const a = o.split("."), [s, h, p] = a;
|
|
552
552
|
if (a.length !== 3 || !s || !h || !p)
|
|
553
553
|
throw new Error("ID token could not be decoded");
|
|
554
|
-
const u = JSON.parse(
|
|
554
|
+
const u = JSON.parse(Xt(h)), c = { __raw: o }, f = {};
|
|
555
555
|
return Object.keys(u).forEach((d) => {
|
|
556
|
-
c[d] = u[d],
|
|
557
|
-
}), { encoded: { header: s, payload: h, signature: p }, header: JSON.parse(
|
|
556
|
+
c[d] = u[d], Wr.includes(d) || (f[d] = u[d]);
|
|
557
|
+
}), { encoded: { header: s, payload: h, signature: p }, header: JSON.parse(Xt(s)), claims: c, user: f };
|
|
558
558
|
})(t.id_token);
|
|
559
559
|
if (!e.claims.iss)
|
|
560
560
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -583,21 +583,21 @@ const $e = (t) => typeof t == "number", Mr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
583
583
|
if (e.claims.nonce !== t.nonce)
|
|
584
584
|
throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
|
|
585
585
|
}
|
|
586
|
-
if (t.max_age &&
|
|
586
|
+
if (t.max_age && !ze(e.claims.auth_time))
|
|
587
587
|
throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
|
|
588
|
-
if (e.claims.exp == null ||
|
|
588
|
+
if (e.claims.exp == null || !ze(e.claims.exp))
|
|
589
589
|
throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
|
|
590
|
-
if (
|
|
590
|
+
if (!ze(e.claims.iat))
|
|
591
591
|
throw new Error("Issued At (iat) claim must be a number present in the ID token");
|
|
592
592
|
const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
|
|
593
593
|
if (i.setUTCSeconds(e.claims.exp + n), r > i)
|
|
594
594
|
throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
|
|
595
|
-
if (e.claims.nbf != null &&
|
|
595
|
+
if (e.claims.nbf != null && ze(e.claims.nbf)) {
|
|
596
596
|
const o = /* @__PURE__ */ new Date(0);
|
|
597
597
|
if (o.setUTCSeconds(e.claims.nbf - n), r < o)
|
|
598
598
|
throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${o}`);
|
|
599
599
|
}
|
|
600
|
-
if (e.claims.auth_time != null &&
|
|
600
|
+
if (e.claims.auth_time != null && ze(e.claims.auth_time)) {
|
|
601
601
|
const o = /* @__PURE__ */ new Date(0);
|
|
602
602
|
if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
|
|
603
603
|
throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`);
|
|
@@ -620,8 +620,8 @@ const $e = (t) => typeof t == "number", Mr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
620
620
|
}
|
|
621
621
|
return e;
|
|
622
622
|
};
|
|
623
|
-
var
|
|
624
|
-
var n =
|
|
623
|
+
var fe = At(function(t, e) {
|
|
624
|
+
var n = le && le.__assign || function() {
|
|
625
625
|
return n = Object.assign || function(h) {
|
|
626
626
|
for (var p, u = 1, c = arguments.length; u < c; u++)
|
|
627
627
|
for (var f in p = arguments[u])
|
|
@@ -667,27 +667,27 @@ var de = xt(function(t, e) {
|
|
|
667
667
|
s(h, "", n(n({}, p), { expires: -1 }));
|
|
668
668
|
};
|
|
669
669
|
});
|
|
670
|
-
|
|
671
|
-
var
|
|
672
|
-
const
|
|
673
|
-
const e =
|
|
670
|
+
xt(fe), fe.encode, fe.parse, fe.getAll;
|
|
671
|
+
var Fr = fe.get, Fn = fe.set, Hn = fe.remove;
|
|
672
|
+
const be = { get(t) {
|
|
673
|
+
const e = Fr(t);
|
|
674
674
|
if (e !== void 0)
|
|
675
675
|
return JSON.parse(e);
|
|
676
676
|
}, save(t, e, n) {
|
|
677
677
|
let r = {};
|
|
678
|
-
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
678
|
+
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Fn(t, JSON.stringify(e), r);
|
|
679
679
|
}, remove(t, e) {
|
|
680
680
|
let n = {};
|
|
681
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
682
|
-
} },
|
|
683
|
-
return
|
|
681
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Hn(t, n);
|
|
682
|
+
} }, Hr = { get(t) {
|
|
683
|
+
return be.get(t) || be.get(`_legacy_${t}`);
|
|
684
684
|
}, save(t, e, n) {
|
|
685
685
|
let r = {};
|
|
686
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
686
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Fn(`_legacy_${t}`, JSON.stringify(e), r), be.save(t, e, n);
|
|
687
687
|
}, remove(t, e) {
|
|
688
688
|
let n = {};
|
|
689
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
690
|
-
} },
|
|
689
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Hn(t, n), be.remove(t, e), be.remove(`_legacy_${t}`, e);
|
|
690
|
+
} }, Jr = { get(t) {
|
|
691
691
|
if (typeof sessionStorage > "u")
|
|
692
692
|
return;
|
|
693
693
|
const e = sessionStorage.getItem(t);
|
|
@@ -697,7 +697,7 @@ const we = { get(t) {
|
|
|
697
697
|
}, remove(t) {
|
|
698
698
|
sessionStorage.removeItem(t);
|
|
699
699
|
} };
|
|
700
|
-
function
|
|
700
|
+
function Xr(t, e, n) {
|
|
701
701
|
var r = e === void 0 ? null : e, i = function(h, p) {
|
|
702
702
|
var u = atob(h);
|
|
703
703
|
if (p) {
|
|
@@ -710,11 +710,11 @@ function Jr(t, e, n) {
|
|
|
710
710
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
711
711
|
return URL.createObjectURL(s);
|
|
712
712
|
}
|
|
713
|
-
var
|
|
714
|
-
return
|
|
713
|
+
var Vt, Yt, Gt, ht, Vr = (Vt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Yt = null, Gt = !1, function(t) {
|
|
714
|
+
return ht = ht || Xr(Vt, Yt, Gt), new Worker(ht, t);
|
|
715
715
|
});
|
|
716
|
-
const
|
|
717
|
-
let
|
|
716
|
+
const ft = {};
|
|
717
|
+
let Yr = class {
|
|
718
718
|
constructor(e, n) {
|
|
719
719
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
720
720
|
}
|
|
@@ -740,57 +740,57 @@ let Xr = class {
|
|
|
740
740
|
return `@@auth0spajs@@::${e}`;
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
743
|
+
const Gr = { memory: () => new Kn().enclosedCache, localstorage: () => new Rr() }, Bt = (t) => Gr[t], qt = (t) => {
|
|
744
744
|
const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
|
|
745
745
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
746
|
-
},
|
|
747
|
-
let
|
|
746
|
+
}, pt = new Pr();
|
|
747
|
+
let Br = class {
|
|
748
748
|
constructor(e) {
|
|
749
749
|
let n, r;
|
|
750
|
-
if (this.userCache = new
|
|
751
|
-
await
|
|
750
|
+
if (this.userCache = new Kn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
751
|
+
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
752
752
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
753
|
-
if (!
|
|
753
|
+
if (!Qe())
|
|
754
754
|
throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
|
|
755
|
-
if (
|
|
755
|
+
if (Qe().subtle === void 0)
|
|
756
756
|
throw new Error(`
|
|
757
757
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
758
758
|
`);
|
|
759
759
|
})(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
|
|
760
760
|
r = e.cache;
|
|
761
761
|
else {
|
|
762
|
-
if (n = e.cacheLocation || "memory", !
|
|
762
|
+
if (n = e.cacheLocation || "memory", !Bt(n))
|
|
763
763
|
throw new Error(`Invalid cache location "${n}"`);
|
|
764
|
-
r =
|
|
764
|
+
r = Bt(n)();
|
|
765
765
|
}
|
|
766
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ?
|
|
767
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
766
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? be : Hr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
767
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : Jr;
|
|
768
768
|
var o;
|
|
769
|
-
this.scope =
|
|
769
|
+
this.scope = He("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Zr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Nn, this.cacheManager = new Mr(r, r.allKeys ? void 0 : new Yr(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Vr());
|
|
770
770
|
}
|
|
771
771
|
_url(e) {
|
|
772
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
772
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || zn)));
|
|
773
773
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
774
774
|
}
|
|
775
775
|
_authorizeUrl(e) {
|
|
776
|
-
return this._url(`/authorize?${
|
|
776
|
+
return this._url(`/authorize?${St(e)}`);
|
|
777
777
|
}
|
|
778
778
|
async _verifyIdToken(e, n, r) {
|
|
779
779
|
const i = await this.nowProvider();
|
|
780
|
-
return
|
|
780
|
+
return Kr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
|
|
781
781
|
var o;
|
|
782
782
|
}
|
|
783
783
|
_processOrgHint(e) {
|
|
784
784
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
785
785
|
}
|
|
786
786
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
787
|
-
const i =
|
|
787
|
+
const i = Jt(dt()), o = Jt(dt()), a = dt(), s = ((u) => {
|
|
788
788
|
const c = new Uint8Array(u);
|
|
789
789
|
return ((f) => {
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
791
791
|
return f.replace(/[+/=]/g, (w) => d[w]);
|
|
792
792
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
793
|
-
})(await (async (u) => await
|
|
793
|
+
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), h = ((u, c, f, d, w, k, v, E) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), f), { scope: He(c, f.scope), response_type: "code", response_mode: E || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), p = this._authorizeUrl(h);
|
|
794
794
|
return { nonce: o, code_verifier: a, scope: h.scope, audience: h.audience || "default", redirect_uri: h.redirect_uri, state: i, url: p };
|
|
795
795
|
}
|
|
796
796
|
async loginWithPopup(e, n) {
|
|
@@ -805,9 +805,9 @@ let Yr = class {
|
|
|
805
805
|
const o = await ((s) => new Promise((h, p) => {
|
|
806
806
|
let u;
|
|
807
807
|
const c = setInterval(() => {
|
|
808
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), p(new
|
|
808
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), p(new Ar(s.popup)));
|
|
809
809
|
}, 1e3), f = setTimeout(() => {
|
|
810
|
-
clearInterval(c), p(new
|
|
810
|
+
clearInterval(c), p(new xr(s.popup)), window.removeEventListener("message", u, !1);
|
|
811
811
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
812
812
|
u = function(d) {
|
|
813
813
|
if (d.data && d.data.type === "authorization_response") {
|
|
@@ -834,7 +834,7 @@ let Yr = class {
|
|
|
834
834
|
}
|
|
835
835
|
async loginWithRedirect(e = {}) {
|
|
836
836
|
var n;
|
|
837
|
-
const r =
|
|
837
|
+
const r = qt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), h = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, p = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = p, c = Q(p, ["url"]);
|
|
838
838
|
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), h && { organization: h }));
|
|
839
839
|
const f = o ? `${u}#${o}` : u;
|
|
840
840
|
i ? await i(f) : window.location.assign(f);
|
|
@@ -851,7 +851,7 @@ let Yr = class {
|
|
|
851
851
|
if (!s)
|
|
852
852
|
throw new Y("missing_transaction", "Invalid state");
|
|
853
853
|
if (this.transactionManager.remove(), o)
|
|
854
|
-
throw new
|
|
854
|
+
throw new Cr(o, a || o, r, s.appState);
|
|
855
855
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
856
856
|
throw new Y("state_mismatch", "Invalid state");
|
|
857
857
|
const h = s.organization, p = s.nonce, u = s.redirect_uri;
|
|
@@ -870,11 +870,11 @@ let Yr = class {
|
|
|
870
870
|
}
|
|
871
871
|
async getTokenSilently(e = {}) {
|
|
872
872
|
var n;
|
|
873
|
-
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
874
|
-
let s =
|
|
873
|
+
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: He(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
|
|
874
|
+
let s = ft[a];
|
|
875
875
|
return s || (s = o().finally(() => {
|
|
876
|
-
delete
|
|
877
|
-
}),
|
|
876
|
+
delete ft[a], s = null;
|
|
877
|
+
}), ft[a] = s), s;
|
|
878
878
|
})(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
|
|
879
879
|
return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
|
|
880
880
|
}
|
|
@@ -891,8 +891,8 @@ let Yr = class {
|
|
|
891
891
|
if (await i())
|
|
892
892
|
return !0;
|
|
893
893
|
return !1;
|
|
894
|
-
})(() =>
|
|
895
|
-
throw new
|
|
894
|
+
})(() => pt.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
|
|
895
|
+
throw new It();
|
|
896
896
|
try {
|
|
897
897
|
if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
|
|
898
898
|
const p = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
@@ -902,14 +902,14 @@ let Yr = class {
|
|
|
902
902
|
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: h } = i;
|
|
903
903
|
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: h });
|
|
904
904
|
} finally {
|
|
905
|
-
await
|
|
905
|
+
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
909
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
910
910
|
var r;
|
|
911
|
-
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
912
|
-
return n = Object.assign(Object.assign({},
|
|
911
|
+
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: He(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
912
|
+
return n = Object.assign(Object.assign({}, jr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new he({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
913
913
|
}
|
|
914
914
|
async isAuthenticated() {
|
|
915
915
|
return !!await this.getUser();
|
|
@@ -917,10 +917,10 @@ let Yr = class {
|
|
|
917
917
|
_buildLogoutUrl(e) {
|
|
918
918
|
e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
|
|
919
919
|
const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
|
|
920
|
-
return this._url(`/v2/logout?${
|
|
920
|
+
return this._url(`/v2/logout?${St(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
921
921
|
}
|
|
922
922
|
async logout(e = {}) {
|
|
923
|
-
const n =
|
|
923
|
+
const n = qt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
|
|
924
924
|
e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
|
|
925
925
|
const o = this._buildLogoutUrl(i);
|
|
926
926
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -932,21 +932,21 @@ let Yr = class {
|
|
|
932
932
|
try {
|
|
933
933
|
if (window.crossOriginIsolated)
|
|
934
934
|
throw new Y("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
935
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((w, k, v = 60) => new Promise((
|
|
935
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((w, k, v = 60) => new Promise((E, S) => {
|
|
936
936
|
const g = window.document.createElement("iframe");
|
|
937
937
|
g.setAttribute("width", "0"), g.setAttribute("height", "0"), g.style.display = "none";
|
|
938
938
|
const l = () => {
|
|
939
939
|
window.document.body.contains(g) && (window.document.body.removeChild(g), window.removeEventListener("message", b, !1));
|
|
940
940
|
};
|
|
941
941
|
let b;
|
|
942
|
-
const
|
|
943
|
-
S(new
|
|
942
|
+
const P = setTimeout(() => {
|
|
943
|
+
S(new It()), l();
|
|
944
944
|
}, 1e3 * v);
|
|
945
945
|
b = function(j) {
|
|
946
946
|
if (j.origin != k || !j.data || j.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
948
|
const $ = j.source;
|
|
949
|
-
$ && $.close(), j.data.response.error ? S(Y.fromPayload(j.data.response)) :
|
|
949
|
+
$ && $.close(), j.data.response.error ? S(Y.fromPayload(j.data.response)) : E(j.data.response), clearTimeout(P), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
|
|
950
950
|
}, window.addEventListener("message", b, !1), window.document.body.appendChild(g), g.setAttribute("src", w);
|
|
951
951
|
}))(i, this.domainUrl, c);
|
|
952
952
|
if (o !== f.state)
|
|
@@ -958,11 +958,11 @@ let Yr = class {
|
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
async _getTokenUsingRefreshToken(e) {
|
|
961
|
-
const n = await this.cacheManager.get(new
|
|
961
|
+
const n = await this.cacheManager.get(new he({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
|
|
962
962
|
if (!(n && n.refresh_token || this.worker)) {
|
|
963
963
|
if (this.options.useRefreshTokensFallback)
|
|
964
964
|
return await this._getTokenFromIFrame(e);
|
|
965
|
-
throw new
|
|
965
|
+
throw new Zn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
966
966
|
}
|
|
967
967
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
968
968
|
try {
|
|
@@ -979,57 +979,57 @@ let Yr = class {
|
|
|
979
979
|
this.userCache.set("@@user@@", { id_token: n, decodedToken: r }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(i);
|
|
980
980
|
}
|
|
981
981
|
async _getIdTokenFromCache() {
|
|
982
|
-
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new
|
|
982
|
+
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new he({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
|
|
983
983
|
return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
|
|
984
984
|
}
|
|
985
985
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
986
|
-
const i = await this.cacheManager.get(new
|
|
986
|
+
const i = await this.cacheManager.get(new he({ scope: e, audience: n, clientId: r }), 60);
|
|
987
987
|
if (i && i.access_token) {
|
|
988
988
|
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, h = await this._getIdTokenFromCache();
|
|
989
989
|
return h && Object.assign(Object.assign({ id_token: h.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
async _requestToken(e, n) {
|
|
993
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
993
|
+
const { nonceIn: r, organization: i } = n || {}, o = await Lr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
|
|
994
994
|
return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
async function
|
|
998
|
-
const e = new
|
|
997
|
+
async function qr(t) {
|
|
998
|
+
const e = new Br(t);
|
|
999
999
|
return await e.checkSession(), e;
|
|
1000
1000
|
}
|
|
1001
|
-
const
|
|
1002
|
-
var
|
|
1001
|
+
const Jn = "sesamy.com", Qr = "https://logs.sesamy.com/events", Et = "sesamyCacheTimestamp";
|
|
1002
|
+
var ae = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t))(ae || {});
|
|
1003
1003
|
let G;
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1006
|
-
const t = localStorage.getItem(
|
|
1004
|
+
const $t = "sesamyAccessToken", zt = "sesamyExpires";
|
|
1005
|
+
function Nt() {
|
|
1006
|
+
const t = localStorage.getItem(zt);
|
|
1007
1007
|
if (!(!t || parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
|
|
1008
|
-
return localStorage.getItem(
|
|
1008
|
+
return localStorage.getItem($t);
|
|
1009
1009
|
}
|
|
1010
|
-
async function
|
|
1011
|
-
if (t.enabled !== !1 && (G = await
|
|
1012
|
-
domain: t.endpoint || `token.${
|
|
1010
|
+
async function ei(t) {
|
|
1011
|
+
if (t.enabled !== !1 && (G = await qr({
|
|
1012
|
+
domain: t.endpoint || `token.${Jn}`,
|
|
1013
1013
|
clientId: t.clientId
|
|
1014
1014
|
}), window.location.search.includes("code=")))
|
|
1015
1015
|
try {
|
|
1016
1016
|
await G.handleRedirectCallback();
|
|
1017
1017
|
const e = await G.getUser();
|
|
1018
|
-
|
|
1018
|
+
We(ae.AUTHENTICATED, e);
|
|
1019
1019
|
const n = new URL(location.href), r = n.searchParams;
|
|
1020
1020
|
r.delete("code"), r.delete("state"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
|
|
1021
1021
|
} catch {
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
async function
|
|
1025
|
-
if (
|
|
1024
|
+
async function ti() {
|
|
1025
|
+
if (Nt())
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
if (!G)
|
|
1028
1028
|
throw new Error("Auth0 client not initialized");
|
|
1029
1029
|
return G.isAuthenticated();
|
|
1030
1030
|
}
|
|
1031
|
-
async function
|
|
1032
|
-
if (
|
|
1031
|
+
async function ni() {
|
|
1032
|
+
if (Nt())
|
|
1033
1033
|
return {
|
|
1034
1034
|
sub: "local",
|
|
1035
1035
|
name: "Local User"
|
|
@@ -1038,7 +1038,7 @@ async function ei() {
|
|
|
1038
1038
|
throw new Error("Auth0 client not initialized");
|
|
1039
1039
|
return G.getUser();
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function ri() {
|
|
1042
1042
|
if (!G)
|
|
1043
1043
|
throw new Error("Auth0 client not initialized");
|
|
1044
1044
|
return G.loginWithRedirect({
|
|
@@ -1047,8 +1047,8 @@ function ti() {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
const e =
|
|
1050
|
+
async function ii(t = !0) {
|
|
1051
|
+
const e = Nt();
|
|
1052
1052
|
if (e)
|
|
1053
1053
|
return e;
|
|
1054
1054
|
try {
|
|
@@ -1061,16 +1061,16 @@ async function ni(t = !0) {
|
|
|
1061
1061
|
return null;
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
async function
|
|
1065
|
-
if (localStorage.removeItem(
|
|
1064
|
+
async function oi() {
|
|
1065
|
+
if (localStorage.removeItem($t), localStorage.removeItem(zt), !G)
|
|
1066
1066
|
throw new Error("Auth0 client not initialized");
|
|
1067
|
-
return
|
|
1067
|
+
return We(ae.LOGOUT, {}), G.logout({
|
|
1068
1068
|
logoutParams: {
|
|
1069
1069
|
returnTo: window.location.href
|
|
1070
1070
|
}
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function ai(t) {
|
|
1074
1074
|
const e = t.split(".");
|
|
1075
1075
|
if (e.length !== 3)
|
|
1076
1076
|
throw new Error("Invalid JWT token format.");
|
|
@@ -1081,12 +1081,12 @@ function ii(t) {
|
|
|
1081
1081
|
);
|
|
1082
1082
|
return JSON.parse(i);
|
|
1083
1083
|
}
|
|
1084
|
-
async function
|
|
1085
|
-
localStorage.setItem(
|
|
1086
|
-
const n =
|
|
1087
|
-
|
|
1084
|
+
async function Xn(t, e) {
|
|
1085
|
+
localStorage.setItem($t, t), localStorage.setItem(zt, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
|
|
1086
|
+
const n = ai(t);
|
|
1087
|
+
We(ae.AUTHENTICATED, n);
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1089
|
+
const si = (t, e) => e.skipDedupe || e.method !== "GET", ci = (t, e) => e.method + "@" + t, ui = (t) => t.clone(), Qt = ({ skip: t = si, key: e = ci, resolver: n = ui } = {}) => {
|
|
1090
1090
|
const r = /* @__PURE__ */ new Map();
|
|
1091
1091
|
return (i) => (o, a) => {
|
|
1092
1092
|
if (t(o, a))
|
|
@@ -1106,12 +1106,12 @@ const oi = (t, e) => e.skipDedupe || e.method !== "GET", ai = (t, e) => e.method
|
|
|
1106
1106
|
return r.delete(s), Promise.reject(h);
|
|
1107
1107
|
}
|
|
1108
1108
|
};
|
|
1109
|
-
},
|
|
1109
|
+
}, li = (t, e) => t * e, di = (t) => t && t.ok, en = ({ delayTimer: t = 500, delayRamp: e = li, maxAttempts: n = 10, until: r = di, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (h) => (p, u) => {
|
|
1110
1110
|
let c = 0;
|
|
1111
1111
|
if (s && s(p, u))
|
|
1112
1112
|
return h(p, u);
|
|
1113
1113
|
const f = (d, w) => Promise.resolve(r(d, w)).then((k) => k ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((v) => {
|
|
1114
|
-
const
|
|
1114
|
+
const E = e(t, c);
|
|
1115
1115
|
setTimeout(() => {
|
|
1116
1116
|
typeof i == "function" ? Promise.resolve(i({
|
|
1117
1117
|
response: d,
|
|
@@ -1122,7 +1122,7 @@ const oi = (t, e) => e.skipDedupe || e.method !== "GET", ai = (t, e) => e.method
|
|
|
1122
1122
|
var g, l;
|
|
1123
1123
|
v(h((g = S && S.url) !== null && g !== void 0 ? g : p, (l = S && S.options) !== null && l !== void 0 ? l : u));
|
|
1124
1124
|
}) : v(h(p, u));
|
|
1125
|
-
},
|
|
1125
|
+
}, E);
|
|
1126
1126
|
}).then(f).catch((v) => {
|
|
1127
1127
|
if (!o)
|
|
1128
1128
|
throw v;
|
|
@@ -1133,20 +1133,20 @@ const oi = (t, e) => e.skipDedupe || e.method !== "GET", ai = (t, e) => e.method
|
|
|
1133
1133
|
throw d;
|
|
1134
1134
|
return f(null, d);
|
|
1135
1135
|
});
|
|
1136
|
-
},
|
|
1137
|
-
function
|
|
1136
|
+
}, hi = "application/json", Vn = "Content-Type", we = Symbol(), Yn = Symbol();
|
|
1137
|
+
function tn(t = {}) {
|
|
1138
1138
|
var e;
|
|
1139
|
-
return (e = Object.entries(t).find(([n]) => n.toLowerCase() ===
|
|
1139
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Vn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function nn(t) {
|
|
1142
1142
|
return /^application\/.*json.*/.test(t);
|
|
1143
1143
|
}
|
|
1144
|
-
const
|
|
1144
|
+
const pe = function(t, e, n = !1) {
|
|
1145
1145
|
return Object.entries(e).reduce((r, [i, o]) => {
|
|
1146
1146
|
const a = t[i];
|
|
1147
|
-
return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] =
|
|
1147
|
+
return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = pe(a, o, n) : r[i] = o, r;
|
|
1148
1148
|
}, { ...t });
|
|
1149
|
-
},
|
|
1149
|
+
}, Te = {
|
|
1150
1150
|
// Default options
|
|
1151
1151
|
options: {},
|
|
1152
1152
|
// Error type
|
|
@@ -1167,34 +1167,34 @@ const he = function(t, e, n = !1) {
|
|
|
1167
1167
|
return n && i ? new i(...r) : i;
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
function
|
|
1171
|
-
|
|
1170
|
+
function fi(t, e = !1) {
|
|
1171
|
+
Te.options = e ? t : pe(Te.options, t);
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1173
|
+
function pi(t, e = !1) {
|
|
1174
|
+
Te.polyfills = e ? t : pe(Te.polyfills, t);
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1177
|
-
|
|
1176
|
+
function mi(t) {
|
|
1177
|
+
Te.errorType = t;
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1180
|
-
class
|
|
1179
|
+
const gi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1180
|
+
class Gn extends Error {
|
|
1181
1181
|
}
|
|
1182
|
-
const
|
|
1182
|
+
const yi = (t) => {
|
|
1183
1183
|
const e = /* @__PURE__ */ Object.create(null);
|
|
1184
1184
|
t = t._addons.reduce((g, l) => l.beforeRequest && l.beforeRequest(g, t._options, e) || g, t);
|
|
1185
|
-
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, p = new Map(o), u =
|
|
1185
|
+
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, p = new Map(o), u = pe(i.options, r);
|
|
1186
1186
|
let c = n;
|
|
1187
|
-
const f =
|
|
1188
|
-
throw { [
|
|
1187
|
+
const f = gi(s)((g, l) => (c = g, i.polyfill("fetch")(g, l)))(n, u), d = new Error(), w = f.catch((g) => {
|
|
1188
|
+
throw { [we]: g };
|
|
1189
1189
|
}).then((g) => {
|
|
1190
1190
|
if (!g.ok) {
|
|
1191
|
-
const l = new
|
|
1191
|
+
const l = new Gn();
|
|
1192
1192
|
if (l.cause = d, l.stack = l.stack + `
|
|
1193
1193
|
CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
1194
1194
|
throw l;
|
|
1195
1195
|
return g.text().then((b) => {
|
|
1196
|
-
var
|
|
1197
|
-
if (l.message = b, i.errorType === "json" || ((
|
|
1196
|
+
var P;
|
|
1197
|
+
if (l.message = b, i.errorType === "json" || ((P = g.headers.get("Content-Type")) === null || P === void 0 ? void 0 : P.split(";")[0]) === "application/json")
|
|
1198
1198
|
try {
|
|
1199
1199
|
l.json = JSON.parse(b);
|
|
1200
1200
|
} catch {
|
|
@@ -1204,14 +1204,14 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1204
1204
|
}
|
|
1205
1205
|
return g;
|
|
1206
1206
|
}), k = (g) => g.catch((l) => {
|
|
1207
|
-
const b = l.hasOwnProperty(
|
|
1207
|
+
const b = l.hasOwnProperty(we), P = b ? l[we] : l, j = (P == null ? void 0 : P.status) && p.get(P.status) || p.get(P == null ? void 0 : P.name) || b && p.has(we) && p.get(we);
|
|
1208
1208
|
if (j)
|
|
1209
|
-
return j(
|
|
1210
|
-
const $ = p.get(
|
|
1209
|
+
return j(P, t);
|
|
1210
|
+
const $ = p.get(Yn);
|
|
1211
1211
|
if ($)
|
|
1212
|
-
return $(
|
|
1213
|
-
throw
|
|
1214
|
-
}), v = (g) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(g ? w.then((b) => b && b[g]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)),
|
|
1212
|
+
return $(P, t);
|
|
1213
|
+
throw P;
|
|
1214
|
+
}), v = (g) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(g ? w.then((b) => b && b[g]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), E = {
|
|
1215
1215
|
_wretchReq: t,
|
|
1216
1216
|
_fetchReq: f,
|
|
1217
1217
|
_sharedState: e,
|
|
@@ -1243,17 +1243,17 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1243
1243
|
return this.error(500, g);
|
|
1244
1244
|
},
|
|
1245
1245
|
fetchError(g) {
|
|
1246
|
-
return this.error(
|
|
1246
|
+
return this.error(we, g);
|
|
1247
1247
|
}
|
|
1248
1248
|
}, S = h.reduce((g, l) => ({
|
|
1249
1249
|
...g,
|
|
1250
1250
|
...typeof l.resolver == "function" ? l.resolver(g) : l.resolver
|
|
1251
|
-
}),
|
|
1251
|
+
}), E);
|
|
1252
1252
|
return a.reduce((g, l) => l(g, t), S);
|
|
1253
|
-
},
|
|
1253
|
+
}, vi = {
|
|
1254
1254
|
_url: "",
|
|
1255
1255
|
_options: {},
|
|
1256
|
-
_config:
|
|
1256
|
+
_config: Te,
|
|
1257
1257
|
_catchers: /* @__PURE__ */ new Map(),
|
|
1258
1258
|
_resolvers: [],
|
|
1259
1259
|
_deferred: [],
|
|
@@ -1276,7 +1276,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1276
1276
|
...this,
|
|
1277
1277
|
_config: {
|
|
1278
1278
|
...this._config,
|
|
1279
|
-
polyfills: e ? t :
|
|
1279
|
+
polyfills: e ? t : pe(this._config.polyfills, t)
|
|
1280
1280
|
}
|
|
1281
1281
|
};
|
|
1282
1282
|
},
|
|
@@ -1290,17 +1290,17 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1290
1290
|
};
|
|
1291
1291
|
},
|
|
1292
1292
|
options(t, e = !1) {
|
|
1293
|
-
return { ...this, _options: e ? t :
|
|
1293
|
+
return { ...this, _options: e ? t : pe(this._options, t) };
|
|
1294
1294
|
},
|
|
1295
1295
|
headers(t) {
|
|
1296
1296
|
const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
|
|
1297
|
-
return { ...this, _options:
|
|
1297
|
+
return { ...this, _options: pe(this._options, { headers: e }) };
|
|
1298
1298
|
},
|
|
1299
1299
|
accept(t) {
|
|
1300
1300
|
return this.headers({ Accept: t });
|
|
1301
1301
|
},
|
|
1302
1302
|
content(t) {
|
|
1303
|
-
return this.headers({ [
|
|
1303
|
+
return this.headers({ [Vn]: t });
|
|
1304
1304
|
},
|
|
1305
1305
|
auth(t) {
|
|
1306
1306
|
return this.headers({ Authorization: t });
|
|
@@ -1310,7 +1310,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1310
1310
|
return n.set(t, e), { ...this, _catchers: n };
|
|
1311
1311
|
},
|
|
1312
1312
|
catcherFallback(t) {
|
|
1313
|
-
return this.catcher(
|
|
1313
|
+
return this.catcher(Yn, t);
|
|
1314
1314
|
},
|
|
1315
1315
|
resolve(t, e = !1) {
|
|
1316
1316
|
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
@@ -1329,8 +1329,8 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1329
1329
|
},
|
|
1330
1330
|
fetch(t = this._options.method, e = "", n = null) {
|
|
1331
1331
|
let r = this.url(e).options({ method: t });
|
|
1332
|
-
const i =
|
|
1333
|
-
return r = n ? o ? r.json(n, i) : r.body(n) : r,
|
|
1332
|
+
const i = tn(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || nn(i));
|
|
1333
|
+
return r = n ? o ? r.json(n, i) : r.body(n) : r, yi(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1334
1334
|
},
|
|
1335
1335
|
get(t = "") {
|
|
1336
1336
|
return this.fetch("GET", t);
|
|
@@ -1357,272 +1357,294 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1357
1357
|
return { ...this, _options: { ...this._options, body: t } };
|
|
1358
1358
|
},
|
|
1359
1359
|
json(t, e) {
|
|
1360
|
-
const n =
|
|
1361
|
-
return this.content(e ||
|
|
1360
|
+
const n = tn(this._options.headers);
|
|
1361
|
+
return this.content(e || nn(n) && n || hi).body(JSON.stringify(t));
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
|
-
function
|
|
1365
|
-
return { ...
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
function
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1364
|
+
function se(t = "", e = {}) {
|
|
1365
|
+
return { ...vi, _url: t, _options: e };
|
|
1366
|
+
}
|
|
1367
|
+
se.default = se;
|
|
1368
|
+
se.options = fi;
|
|
1369
|
+
se.errorType = mi;
|
|
1370
|
+
se.polyfills = pi;
|
|
1371
|
+
se.WretchError = Gn;
|
|
1372
|
+
function ue() {
|
|
1373
|
+
sessionStorage.removeItem(Et), We(ae.CLEAR_CACHE, {});
|
|
1374
|
+
}
|
|
1375
|
+
function wi(t) {
|
|
1376
|
+
const e = t.endpoint || `https://api2.${Jn}`, n = (_) => async (I, C) => {
|
|
1377
|
+
let D = sessionStorage.getItem(Et);
|
|
1378
|
+
D || (D = Date.now().toString(), sessionStorage.setItem(Et, D));
|
|
1379
|
+
const T = {
|
|
1380
|
+
...C,
|
|
1381
|
+
headers: {
|
|
1382
|
+
...C.headers,
|
|
1383
|
+
"Cache-Timestamp": D
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
return _(I, T);
|
|
1387
|
+
}, r = (_ = !0) => (I) => async (C, D) => {
|
|
1388
|
+
let T = null;
|
|
1389
|
+
if (T = await ii(_), !T) {
|
|
1390
|
+
if (_)
|
|
1377
1391
|
throw new Error("No access token available");
|
|
1378
|
-
return
|
|
1392
|
+
return I(C, D);
|
|
1379
1393
|
}
|
|
1380
|
-
const
|
|
1381
|
-
...
|
|
1394
|
+
const W = {
|
|
1395
|
+
...D,
|
|
1382
1396
|
headers: {
|
|
1383
|
-
...
|
|
1384
|
-
...
|
|
1397
|
+
...D.headers,
|
|
1398
|
+
...T ? { Authorization: `Bearer ${T}` } : {}
|
|
1385
1399
|
}
|
|
1386
1400
|
};
|
|
1387
|
-
return
|
|
1388
|
-
},
|
|
1389
|
-
if (
|
|
1390
|
-
return I
|
|
1391
|
-
const
|
|
1392
|
-
...
|
|
1401
|
+
return I(C, W);
|
|
1402
|
+
}, i = (_) => (I, C) => {
|
|
1403
|
+
if (C.headers.Authorization)
|
|
1404
|
+
return _(I, C);
|
|
1405
|
+
const D = localStorage.getItem("__anon_id"), T = btoa(`${D}:`), W = {
|
|
1406
|
+
...C,
|
|
1393
1407
|
headers: {
|
|
1394
|
-
...
|
|
1395
|
-
Authorization: `Basic ${
|
|
1408
|
+
...C.headers,
|
|
1409
|
+
Authorization: `Basic ${T}`
|
|
1396
1410
|
}
|
|
1397
1411
|
};
|
|
1398
|
-
return I
|
|
1399
|
-
},
|
|
1400
|
-
n
|
|
1401
|
-
|
|
1402
|
-
|
|
1412
|
+
return _(I, W);
|
|
1413
|
+
}, o = se(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1414
|
+
n,
|
|
1415
|
+
r(),
|
|
1416
|
+
Qt(),
|
|
1417
|
+
en({
|
|
1403
1418
|
delayTimer: 1e3,
|
|
1404
|
-
delayRamp: (
|
|
1419
|
+
delayRamp: (_, I) => _ * I,
|
|
1405
1420
|
maxAttempts: 3,
|
|
1406
|
-
until: (
|
|
1421
|
+
until: (_) => !!(_ && (_.ok || _.status >= 400 && _.status < 500)),
|
|
1407
1422
|
retryOnNetworkError: !1
|
|
1408
1423
|
})
|
|
1409
|
-
]),
|
|
1410
|
-
n
|
|
1411
|
-
r,
|
|
1412
|
-
|
|
1413
|
-
|
|
1424
|
+
]), a = se(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1425
|
+
n,
|
|
1426
|
+
r(!1),
|
|
1427
|
+
i,
|
|
1428
|
+
Qt(),
|
|
1429
|
+
en({
|
|
1414
1430
|
delayTimer: 1e3,
|
|
1415
|
-
delayRamp: (
|
|
1431
|
+
delayRamp: (_, I) => _ * I,
|
|
1416
1432
|
maxAttempts: 3,
|
|
1417
|
-
until: (
|
|
1433
|
+
until: (_) => !!(_ && (_.ok || _.status >= 400 && _.status < 500)),
|
|
1418
1434
|
retryOnNetworkError: !1
|
|
1419
1435
|
})
|
|
1420
1436
|
]);
|
|
1421
|
-
async function
|
|
1422
|
-
return
|
|
1437
|
+
async function s() {
|
|
1438
|
+
return o.get("/entitlements").json();
|
|
1423
1439
|
}
|
|
1424
|
-
async function
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1440
|
+
async function h(_) {
|
|
1441
|
+
const I = await o.get("/entitlements").json();
|
|
1442
|
+
return I == null ? void 0 : I.find((C) => C.id === _);
|
|
1427
1443
|
}
|
|
1428
|
-
async function
|
|
1429
|
-
return
|
|
1444
|
+
async function p(_) {
|
|
1445
|
+
return o.get(`/entitlements/${_}/access`).json();
|
|
1430
1446
|
}
|
|
1431
|
-
async function
|
|
1432
|
-
return
|
|
1447
|
+
async function u() {
|
|
1448
|
+
return o.get("/contracts").json();
|
|
1433
1449
|
}
|
|
1434
|
-
async function
|
|
1435
|
-
const
|
|
1436
|
-
return
|
|
1450
|
+
async function c(_) {
|
|
1451
|
+
const I = await o.get("/contracts").json();
|
|
1452
|
+
return I == null ? void 0 : I.find((C) => C.id === _);
|
|
1437
1453
|
}
|
|
1438
|
-
async function
|
|
1439
|
-
return
|
|
1454
|
+
async function f() {
|
|
1455
|
+
return o.get("/bills").json();
|
|
1440
1456
|
}
|
|
1441
|
-
async function
|
|
1442
|
-
const
|
|
1443
|
-
return
|
|
1457
|
+
async function d(_) {
|
|
1458
|
+
const I = await o.get("/bills").json();
|
|
1459
|
+
return I == null ? void 0 : I.find((C) => C.id === _);
|
|
1444
1460
|
}
|
|
1445
|
-
async function
|
|
1446
|
-
|
|
1461
|
+
async function w(_, I) {
|
|
1462
|
+
const C = await o.url(`/user-metadata/${_}`).put(I).json();
|
|
1463
|
+
return ue(), C;
|
|
1447
1464
|
}
|
|
1448
|
-
async function
|
|
1449
|
-
|
|
1465
|
+
async function k(_) {
|
|
1466
|
+
const I = await o.url(`/user-metadata/${_}`).delete().res();
|
|
1467
|
+
return ue(), I.ok;
|
|
1450
1468
|
}
|
|
1451
|
-
async function
|
|
1452
|
-
return (await
|
|
1469
|
+
async function v(_) {
|
|
1470
|
+
return (await o.url(`/user-metadata/${_}`).get().json())[_];
|
|
1453
1471
|
}
|
|
1454
|
-
async function
|
|
1455
|
-
return await
|
|
1472
|
+
async function E() {
|
|
1473
|
+
return await o.url("/user-metadata").get().json();
|
|
1456
1474
|
}
|
|
1457
|
-
async function
|
|
1458
|
-
return await
|
|
1475
|
+
async function S() {
|
|
1476
|
+
return await o.url("/tags").get().json();
|
|
1459
1477
|
}
|
|
1460
|
-
async function
|
|
1461
|
-
|
|
1478
|
+
async function g(_) {
|
|
1479
|
+
const I = await o.url(`/tags/${_}`).delete().res();
|
|
1480
|
+
return ue(), I.ok;
|
|
1462
1481
|
}
|
|
1463
|
-
async function
|
|
1464
|
-
|
|
1482
|
+
async function l(_) {
|
|
1483
|
+
const I = await o.url("/tags").post(_).res();
|
|
1484
|
+
return ue(), I.ok;
|
|
1465
1485
|
}
|
|
1466
|
-
async function
|
|
1467
|
-
return (await
|
|
1486
|
+
async function b(_) {
|
|
1487
|
+
return (await a.url("/tallies").get().json())[_];
|
|
1468
1488
|
}
|
|
1469
|
-
async function
|
|
1470
|
-
return await
|
|
1489
|
+
async function P() {
|
|
1490
|
+
return await a.url("/tallies").get().json();
|
|
1471
1491
|
}
|
|
1472
|
-
async function
|
|
1473
|
-
|
|
1492
|
+
async function j(_) {
|
|
1493
|
+
const I = await a.url(`/tallies/${_}`).delete().res();
|
|
1494
|
+
return ue(), I.ok;
|
|
1474
1495
|
}
|
|
1475
|
-
async function
|
|
1476
|
-
return await
|
|
1496
|
+
async function $(_, I) {
|
|
1497
|
+
return await a.url(`/tallies/${_}/push`).post(I).json();
|
|
1477
1498
|
}
|
|
1478
|
-
async function
|
|
1479
|
-
return await
|
|
1499
|
+
async function L(_) {
|
|
1500
|
+
return await o.url(`/products/${_}`).get().json();
|
|
1480
1501
|
}
|
|
1481
|
-
async function
|
|
1482
|
-
|
|
1502
|
+
async function R(_) {
|
|
1503
|
+
const I = await o.url(`/products/${_}/auto-onboard`).post().json();
|
|
1504
|
+
return I.length && ue(), I;
|
|
1483
1505
|
}
|
|
1484
1506
|
return {
|
|
1485
|
-
getEntitlements:
|
|
1486
|
-
getEntitlement:
|
|
1487
|
-
getEntitlementAccess:
|
|
1488
|
-
getContracts:
|
|
1489
|
-
getContract:
|
|
1490
|
-
getBills:
|
|
1491
|
-
getBill:
|
|
1492
|
-
setUserMetadata:
|
|
1493
|
-
deleteUserMetadata:
|
|
1494
|
-
getUserMetadata:
|
|
1495
|
-
listUserMetadata:
|
|
1496
|
-
getTags:
|
|
1497
|
-
deleteTag:
|
|
1498
|
-
setTag:
|
|
1499
|
-
getTally:
|
|
1500
|
-
getTallies:
|
|
1501
|
-
deleteTally:
|
|
1502
|
-
pushTally:
|
|
1503
|
-
getProduct:
|
|
1504
|
-
autoOnboardProduct:
|
|
1507
|
+
getEntitlements: s,
|
|
1508
|
+
getEntitlement: h,
|
|
1509
|
+
getEntitlementAccess: p,
|
|
1510
|
+
getContracts: u,
|
|
1511
|
+
getContract: c,
|
|
1512
|
+
getBills: f,
|
|
1513
|
+
getBill: d,
|
|
1514
|
+
setUserMetadata: w,
|
|
1515
|
+
deleteUserMetadata: k,
|
|
1516
|
+
getUserMetadata: v,
|
|
1517
|
+
listUserMetadata: E,
|
|
1518
|
+
getTags: S,
|
|
1519
|
+
deleteTag: g,
|
|
1520
|
+
setTag: l,
|
|
1521
|
+
getTally: b,
|
|
1522
|
+
getTallies: P,
|
|
1523
|
+
deleteTally: j,
|
|
1524
|
+
pushTally: $,
|
|
1525
|
+
getProduct: L,
|
|
1526
|
+
autoOnboardProduct: R
|
|
1505
1527
|
};
|
|
1506
1528
|
}
|
|
1507
|
-
const
|
|
1508
|
-
function
|
|
1529
|
+
const Bn = "@sesamy/sesamy-js", Dt = "1.3.2";
|
|
1530
|
+
function rn(t, e, n, r, i) {
|
|
1509
1531
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1510
1532
|
t = t ? t[e[r]] : i;
|
|
1511
1533
|
return t === i ? n : t;
|
|
1512
1534
|
}
|
|
1513
|
-
var
|
|
1514
|
-
},
|
|
1515
|
-
|
|
1516
|
-
var
|
|
1517
|
-
|
|
1535
|
+
var Je = "undefined", on = "object", Tt = function() {
|
|
1536
|
+
}, qn = "any", Qn = "*", ge = "__", tt = typeof process < "u" ? process : {};
|
|
1537
|
+
tt.env && tt.env.NODE_ENV;
|
|
1538
|
+
var H = typeof document < "u";
|
|
1539
|
+
tt.versions != null && tt.versions.node != null;
|
|
1518
1540
|
typeof Deno < "u" && Deno.core;
|
|
1519
|
-
|
|
1520
|
-
function
|
|
1541
|
+
H && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1542
|
+
function er(t, e) {
|
|
1521
1543
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1522
1544
|
}
|
|
1523
|
-
var
|
|
1524
|
-
function
|
|
1525
|
-
return
|
|
1545
|
+
var bi = er.bind(null, "toUpperCase"), ki = er.bind(null, "toLowerCase");
|
|
1546
|
+
function Ii(t) {
|
|
1547
|
+
return tr(t) ? bi("null") : typeof t == "object" ? Ti(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1526
1548
|
}
|
|
1527
|
-
function
|
|
1549
|
+
function nt(t, e) {
|
|
1528
1550
|
e === void 0 && (e = !0);
|
|
1529
|
-
var n =
|
|
1530
|
-
return e ?
|
|
1551
|
+
var n = Ii(t);
|
|
1552
|
+
return e ? ki(n) : n;
|
|
1531
1553
|
}
|
|
1532
|
-
function
|
|
1554
|
+
function Ke(t, e) {
|
|
1533
1555
|
return typeof e === t;
|
|
1534
1556
|
}
|
|
1535
|
-
var V =
|
|
1536
|
-
|
|
1537
|
-
function
|
|
1557
|
+
var V = Ke.bind(null, "function"), ie = Ke.bind(null, "string"), ke = Ke.bind(null, "undefined"), Si = Ke.bind(null, "boolean");
|
|
1558
|
+
Ke.bind(null, "symbol");
|
|
1559
|
+
function tr(t) {
|
|
1538
1560
|
return t === null;
|
|
1539
1561
|
}
|
|
1540
|
-
function
|
|
1541
|
-
return
|
|
1562
|
+
function _i(t) {
|
|
1563
|
+
return nt(t) === "number" && !isNaN(t);
|
|
1542
1564
|
}
|
|
1543
|
-
function
|
|
1544
|
-
return
|
|
1565
|
+
function nr(t) {
|
|
1566
|
+
return nt(t) === "array";
|
|
1545
1567
|
}
|
|
1546
1568
|
function X(t) {
|
|
1547
|
-
if (!
|
|
1569
|
+
if (!Ei(t))
|
|
1548
1570
|
return !1;
|
|
1549
1571
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
1550
1572
|
e = Object.getPrototypeOf(e);
|
|
1551
1573
|
return Object.getPrototypeOf(t) === e;
|
|
1552
1574
|
}
|
|
1553
|
-
function
|
|
1575
|
+
function Ei(t) {
|
|
1554
1576
|
return t && (typeof t == "object" || t !== null);
|
|
1555
1577
|
}
|
|
1556
|
-
function
|
|
1578
|
+
function Ti(t) {
|
|
1557
1579
|
return V(t.constructor) ? t.constructor.name : null;
|
|
1558
1580
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return t instanceof Error || ie(t.message) && t.constructor &&
|
|
1581
|
+
function Oi(t) {
|
|
1582
|
+
return t instanceof Error || ie(t.message) && t.constructor && _i(t.constructor.stackTraceLimit);
|
|
1561
1583
|
}
|
|
1562
|
-
function
|
|
1563
|
-
if (typeof e != "object" ||
|
|
1584
|
+
function rr(t, e) {
|
|
1585
|
+
if (typeof e != "object" || tr(e))
|
|
1564
1586
|
return !1;
|
|
1565
1587
|
if (e instanceof t)
|
|
1566
1588
|
return !0;
|
|
1567
|
-
var n =
|
|
1568
|
-
if (
|
|
1589
|
+
var n = nt(new t(""));
|
|
1590
|
+
if (Oi(e))
|
|
1569
1591
|
for (; e; ) {
|
|
1570
|
-
if (
|
|
1592
|
+
if (nt(e) === n)
|
|
1571
1593
|
return !0;
|
|
1572
1594
|
e = Object.getPrototypeOf(e);
|
|
1573
1595
|
}
|
|
1574
1596
|
return !1;
|
|
1575
1597
|
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
function
|
|
1598
|
+
rr.bind(null, TypeError);
|
|
1599
|
+
rr.bind(null, SyntaxError);
|
|
1600
|
+
function ot(t, e) {
|
|
1579
1601
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1580
|
-
return n && e ?
|
|
1602
|
+
return n && e ? Pi(t, e) : n;
|
|
1581
1603
|
}
|
|
1582
|
-
function
|
|
1604
|
+
function Pi(t, e) {
|
|
1583
1605
|
return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
|
|
1584
1606
|
}
|
|
1585
|
-
function
|
|
1607
|
+
function at(t) {
|
|
1586
1608
|
var e = [].slice.call(arguments, 1);
|
|
1587
1609
|
return function() {
|
|
1588
1610
|
return t.apply(void 0, [].slice.call(arguments).concat(e));
|
|
1589
1611
|
};
|
|
1590
1612
|
}
|
|
1591
|
-
ot
|
|
1592
|
-
ot
|
|
1593
|
-
ot
|
|
1594
|
-
ot
|
|
1595
|
-
function
|
|
1596
|
-
return t ?
|
|
1613
|
+
at(ot, "form");
|
|
1614
|
+
at(ot, "button");
|
|
1615
|
+
at(ot, "input");
|
|
1616
|
+
at(ot, "select");
|
|
1617
|
+
function ji(t) {
|
|
1618
|
+
return t ? nr(t) ? t : [t] : [];
|
|
1597
1619
|
}
|
|
1598
|
-
function
|
|
1620
|
+
function an(t) {
|
|
1599
1621
|
try {
|
|
1600
1622
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1601
1623
|
} catch {
|
|
1602
1624
|
return null;
|
|
1603
1625
|
}
|
|
1604
1626
|
}
|
|
1605
|
-
function
|
|
1606
|
-
if (
|
|
1627
|
+
function Ci() {
|
|
1628
|
+
if (H) {
|
|
1607
1629
|
var t = navigator, e = t.languages;
|
|
1608
1630
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1609
1631
|
}
|
|
1610
1632
|
}
|
|
1611
|
-
function
|
|
1633
|
+
function xi() {
|
|
1612
1634
|
try {
|
|
1613
1635
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1614
1636
|
} catch {
|
|
1615
1637
|
}
|
|
1616
1638
|
}
|
|
1617
|
-
function
|
|
1639
|
+
function Ai(t) {
|
|
1618
1640
|
return function(e) {
|
|
1619
1641
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1620
|
-
var o =
|
|
1642
|
+
var o = an(n[1]), a = an(n[2]);
|
|
1621
1643
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1622
1644
|
}
|
|
1623
1645
|
for (var s in r) {
|
|
1624
1646
|
var h = s.split("[");
|
|
1625
|
-
h.length > 1 && (
|
|
1647
|
+
h.length > 1 && ($i(r, h.map(function(p) {
|
|
1626
1648
|
return p.replace(/[?[\]\\ ]/g, "");
|
|
1627
1649
|
}), r[s]), delete r[s]);
|
|
1628
1650
|
}
|
|
@@ -1632,10 +1654,10 @@ function xi(t) {
|
|
|
1632
1654
|
var n = e.match(/\?(.*)/);
|
|
1633
1655
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1634
1656
|
}
|
|
1635
|
-
return
|
|
1657
|
+
return H && window.location.search.substring(1);
|
|
1636
1658
|
}(t));
|
|
1637
1659
|
}
|
|
1638
|
-
function
|
|
1660
|
+
function $i(t, e, n) {
|
|
1639
1661
|
for (var r = e.length - 1, i = 0; i < r; ++i) {
|
|
1640
1662
|
var o = e[i];
|
|
1641
1663
|
if (o === "__proto__" || o === "constructor")
|
|
@@ -1644,14 +1666,14 @@ function Ci(t, e, n) {
|
|
|
1644
1666
|
}
|
|
1645
1667
|
t[e[r]] = n;
|
|
1646
1668
|
}
|
|
1647
|
-
function
|
|
1669
|
+
function st() {
|
|
1648
1670
|
for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
|
|
1649
1671
|
var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
|
|
1650
1672
|
t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
|
|
1651
1673
|
}
|
|
1652
1674
|
return t;
|
|
1653
1675
|
}
|
|
1654
|
-
function
|
|
1676
|
+
function zi(t, e) {
|
|
1655
1677
|
var n, r, i, o = null, a = 0, s = function() {
|
|
1656
1678
|
a = /* @__PURE__ */ new Date(), o = null, i = t.apply(n, r);
|
|
1657
1679
|
};
|
|
@@ -1662,20 +1684,20 @@ function Ai(t, e) {
|
|
|
1662
1684
|
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = h, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
|
|
1663
1685
|
};
|
|
1664
1686
|
}
|
|
1665
|
-
var
|
|
1666
|
-
function
|
|
1667
|
-
return
|
|
1687
|
+
var Ue = "global", Oe = ge + "global" + ge, Pe = typeof self === on && self.self === self && self || typeof global === on && global.global === global && global || void 0;
|
|
1688
|
+
function ye(t) {
|
|
1689
|
+
return Pe[Oe][t];
|
|
1668
1690
|
}
|
|
1669
|
-
function
|
|
1670
|
-
return
|
|
1691
|
+
function ve(t, e) {
|
|
1692
|
+
return Pe[Oe][t] = e;
|
|
1671
1693
|
}
|
|
1672
|
-
function
|
|
1673
|
-
delete
|
|
1694
|
+
function Ce(t) {
|
|
1695
|
+
delete Pe[Oe][t];
|
|
1674
1696
|
}
|
|
1675
1697
|
function xe(t, e, n) {
|
|
1676
1698
|
var r;
|
|
1677
1699
|
try {
|
|
1678
|
-
if (
|
|
1700
|
+
if (Ut(t)) {
|
|
1679
1701
|
var i = window[t];
|
|
1680
1702
|
r = i[e].bind(i);
|
|
1681
1703
|
}
|
|
@@ -1683,18 +1705,18 @@ function xe(t, e, n) {
|
|
|
1683
1705
|
}
|
|
1684
1706
|
return r || n;
|
|
1685
1707
|
}
|
|
1686
|
-
|
|
1687
|
-
var
|
|
1688
|
-
function
|
|
1689
|
-
if (typeof
|
|
1690
|
-
return
|
|
1708
|
+
Pe[Oe] || (Pe[Oe] = {});
|
|
1709
|
+
var Xe = {};
|
|
1710
|
+
function Ut(t) {
|
|
1711
|
+
if (typeof Xe[t] !== Je)
|
|
1712
|
+
return Xe[t];
|
|
1691
1713
|
try {
|
|
1692
1714
|
var e = window[t];
|
|
1693
|
-
e.setItem(
|
|
1715
|
+
e.setItem(Je, Je), e.removeItem(Je);
|
|
1694
1716
|
} catch {
|
|
1695
|
-
return
|
|
1717
|
+
return Xe[t] = !1;
|
|
1696
1718
|
}
|
|
1697
|
-
return
|
|
1719
|
+
return Xe[t] = !0;
|
|
1698
1720
|
}
|
|
1699
1721
|
function A() {
|
|
1700
1722
|
return A = Object.assign || function(t) {
|
|
@@ -1706,18 +1728,18 @@ function A() {
|
|
|
1706
1728
|
return t;
|
|
1707
1729
|
}, A.apply(this, arguments);
|
|
1708
1730
|
}
|
|
1709
|
-
var re = "function", te = "undefined",
|
|
1731
|
+
var re = "function", te = "undefined", Ni = "@@redux/" + Math.random().toString(36), sn = /* @__PURE__ */ function() {
|
|
1710
1732
|
return typeof Symbol === re && Symbol.observable || "@@observable";
|
|
1711
|
-
}(),
|
|
1712
|
-
function
|
|
1733
|
+
}(), Ve = " != " + re;
|
|
1734
|
+
function ir(t, e, n) {
|
|
1713
1735
|
var r;
|
|
1714
1736
|
if (typeof e === re && typeof n === te && (n = e, e = void 0), typeof n !== te) {
|
|
1715
1737
|
if (typeof n !== re)
|
|
1716
|
-
throw new Error("enhancer" +
|
|
1717
|
-
return n(
|
|
1738
|
+
throw new Error("enhancer" + Ve);
|
|
1739
|
+
return n(ir)(t, e);
|
|
1718
1740
|
}
|
|
1719
1741
|
if (typeof t !== re)
|
|
1720
|
-
throw new Error("reducer" +
|
|
1742
|
+
throw new Error("reducer" + Ve);
|
|
1721
1743
|
var i = t, o = e, a = [], s = a, h = !1;
|
|
1722
1744
|
function p() {
|
|
1723
1745
|
s === a && (s = a.slice());
|
|
@@ -1727,7 +1749,7 @@ function nr(t, e, n) {
|
|
|
1727
1749
|
}
|
|
1728
1750
|
function c(d) {
|
|
1729
1751
|
if (typeof d !== re)
|
|
1730
|
-
throw new Error("Listener" +
|
|
1752
|
+
throw new Error("Listener" + Ve);
|
|
1731
1753
|
var w = !0;
|
|
1732
1754
|
return p(), s.push(d), function() {
|
|
1733
1755
|
if (w) {
|
|
@@ -1755,9 +1777,9 @@ function nr(t, e, n) {
|
|
|
1755
1777
|
}
|
|
1756
1778
|
return f({ type: "@@redux/INIT" }), (r = { dispatch: f, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1757
1779
|
if (typeof d !== re)
|
|
1758
|
-
throw new Error("next reducer" +
|
|
1780
|
+
throw new Error("next reducer" + Ve);
|
|
1759
1781
|
i = d, f({ type: "@@redux/INIT" });
|
|
1760
|
-
} })[
|
|
1782
|
+
} })[sn] = function() {
|
|
1761
1783
|
var d, w = c;
|
|
1762
1784
|
return (d = { subscribe: function(k) {
|
|
1763
1785
|
if (typeof k != "object")
|
|
@@ -1766,16 +1788,16 @@ function nr(t, e, n) {
|
|
|
1766
1788
|
k.next && k.next(u());
|
|
1767
1789
|
}
|
|
1768
1790
|
return v(), { unsubscribe: w(v) };
|
|
1769
|
-
} })[
|
|
1791
|
+
} })[sn] = function() {
|
|
1770
1792
|
return this;
|
|
1771
1793
|
}, d;
|
|
1772
1794
|
}, r;
|
|
1773
1795
|
}
|
|
1774
|
-
function
|
|
1796
|
+
function Di(t, e) {
|
|
1775
1797
|
var n = e && e.type;
|
|
1776
1798
|
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + te;
|
|
1777
1799
|
}
|
|
1778
|
-
function
|
|
1800
|
+
function je() {
|
|
1779
1801
|
var t = [].slice.call(arguments);
|
|
1780
1802
|
return t.length === 0 ? function(e) {
|
|
1781
1803
|
return e;
|
|
@@ -1785,7 +1807,7 @@ function Pe() {
|
|
|
1785
1807
|
};
|
|
1786
1808
|
});
|
|
1787
1809
|
}
|
|
1788
|
-
function
|
|
1810
|
+
function Ui() {
|
|
1789
1811
|
var t = arguments;
|
|
1790
1812
|
return function(e) {
|
|
1791
1813
|
return function(n, r, i) {
|
|
@@ -1794,39 +1816,39 @@ function Ni() {
|
|
|
1794
1816
|
} };
|
|
1795
1817
|
return o = [].slice.call(t).map(function(p) {
|
|
1796
1818
|
return p(h);
|
|
1797
|
-
}), A({}, a, { dispatch: s =
|
|
1819
|
+
}), A({}, a, { dispatch: s = je.apply(void 0, o)(a.dispatch) });
|
|
1798
1820
|
};
|
|
1799
1821
|
};
|
|
1800
1822
|
}
|
|
1801
|
-
var oe =
|
|
1823
|
+
var oe = ge + "anon_id", me = ge + "user_id", Se = ge + "user_traits", ne = "userId", Ie = "anonymousId", et = ["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"], Ot = ["name", "EVENTS", "config", "loaded"], x = et.reduce(function(t, e) {
|
|
1802
1824
|
return t[e] = e, t;
|
|
1803
1825
|
}, { registerPluginType: function(t) {
|
|
1804
1826
|
return "registerPlugin:" + t;
|
|
1805
1827
|
}, pluginReadyType: function(t) {
|
|
1806
1828
|
return "ready:" + t;
|
|
1807
|
-
} }),
|
|
1808
|
-
function
|
|
1829
|
+
} }), cn = /^utm_/, un = /^an_prop_/, ln = /^an_trait_/;
|
|
1830
|
+
function Li(t) {
|
|
1809
1831
|
var e = t.storage.setItem;
|
|
1810
1832
|
return function(n) {
|
|
1811
1833
|
return function(r) {
|
|
1812
1834
|
return function(i) {
|
|
1813
|
-
if (i.type ===
|
|
1835
|
+
if (i.type === x.bootstrap) {
|
|
1814
1836
|
var o = i.params, a = i.user, s = i.persistedUser, h = i.initialUser, p = s.userId === a.userId;
|
|
1815
|
-
s.anonymousId !== a.anonymousId && e(oe, a.anonymousId), p || e(
|
|
1837
|
+
s.anonymousId !== a.anonymousId && e(oe, a.anonymousId), p || e(me, a.userId), h.traits && e(Se, A({}, p && s.traits ? s.traits : {}, h.traits));
|
|
1816
1838
|
var u = Object.keys(i.params);
|
|
1817
1839
|
if (u.length) {
|
|
1818
1840
|
var c = o.an_uid, f = o.an_event, d = u.reduce(function(w, k) {
|
|
1819
|
-
if (k.match(
|
|
1820
|
-
var v = k.replace(
|
|
1841
|
+
if (k.match(cn) || k.match(/^(d|g)clid/)) {
|
|
1842
|
+
var v = k.replace(cn, "");
|
|
1821
1843
|
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1822
1844
|
}
|
|
1823
|
-
return k.match(
|
|
1845
|
+
return k.match(un) && (w.props[k.replace(un, "")] = o[k]), k.match(ln) && (w.traits[k.replace(ln, "")] = o[k]), w;
|
|
1824
1846
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1825
|
-
n.dispatch(A({ type:
|
|
1847
|
+
n.dispatch(A({ type: x.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1826
1848
|
return t.identify(c, d.traits);
|
|
1827
1849
|
}, 0), f && setTimeout(function() {
|
|
1828
1850
|
return t.track(f, d.props);
|
|
1829
|
-
}, 0), Object.keys(d.campaign).length && n.dispatch({ type:
|
|
1851
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: x.campaign, campaign: d.campaign });
|
|
1830
1852
|
}
|
|
1831
1853
|
}
|
|
1832
1854
|
return r(i);
|
|
@@ -1834,19 +1856,19 @@ function Di(t) {
|
|
|
1834
1856
|
};
|
|
1835
1857
|
};
|
|
1836
1858
|
}
|
|
1837
|
-
function
|
|
1859
|
+
function Ri(t) {
|
|
1838
1860
|
return function(e, n) {
|
|
1839
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1861
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === x.setItemEnd) {
|
|
1840
1862
|
if (n.key === oe)
|
|
1841
1863
|
return A({}, e, { anonymousId: n.value });
|
|
1842
|
-
if (n.key ===
|
|
1864
|
+
if (n.key === me)
|
|
1843
1865
|
return A({}, e, { userId: n.value });
|
|
1844
1866
|
}
|
|
1845
1867
|
switch (n.type) {
|
|
1846
|
-
case
|
|
1868
|
+
case x.identify:
|
|
1847
1869
|
return Object.assign({}, e, { userId: n.userId, traits: A({}, e.traits, n.traits) });
|
|
1848
|
-
case
|
|
1849
|
-
return [
|
|
1870
|
+
case x.reset:
|
|
1871
|
+
return [me, oe, Se].forEach(function(r) {
|
|
1850
1872
|
t.removeItem(r);
|
|
1851
1873
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
1852
1874
|
default:
|
|
@@ -1854,49 +1876,49 @@ function Ui(t) {
|
|
|
1854
1876
|
}
|
|
1855
1877
|
};
|
|
1856
1878
|
}
|
|
1857
|
-
function
|
|
1858
|
-
return { userId: t.getItem(
|
|
1879
|
+
function dn(t) {
|
|
1880
|
+
return { userId: t.getItem(me), anonymousId: t.getItem(oe), traits: t.getItem(Se) };
|
|
1859
1881
|
}
|
|
1860
|
-
var
|
|
1861
|
-
return
|
|
1882
|
+
var Pt = function(t) {
|
|
1883
|
+
return ge + "TEMP" + ge + t;
|
|
1862
1884
|
};
|
|
1863
|
-
function
|
|
1885
|
+
function Mi(t) {
|
|
1864
1886
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1865
1887
|
return function(o) {
|
|
1866
1888
|
return function(a) {
|
|
1867
1889
|
return function(s) {
|
|
1868
1890
|
var h = s.userId, p = s.traits, u = s.options;
|
|
1869
|
-
if (s.type ===
|
|
1891
|
+
if (s.type === x.reset && ([me, Se, oe].forEach(function(d) {
|
|
1870
1892
|
r(d);
|
|
1871
|
-
}), [ne,
|
|
1872
|
-
|
|
1873
|
-
})), s.type ===
|
|
1874
|
-
i(oe) || n(oe,
|
|
1875
|
-
var c = i(
|
|
1876
|
-
c && c !== h && o.dispatch({ type:
|
|
1893
|
+
}), [ne, Ie, "traits"].forEach(function(d) {
|
|
1894
|
+
Ce(Pt(d));
|
|
1895
|
+
})), s.type === x.identify) {
|
|
1896
|
+
i(oe) || n(oe, st());
|
|
1897
|
+
var c = i(me), f = i(Se) || {};
|
|
1898
|
+
c && c !== h && o.dispatch({ type: x.userIdChanged, old: { userId: c, traits: f }, new: { userId: h, traits: p }, options: u }), h && n(me, h), p && n(Se, A({}, f, p));
|
|
1877
1899
|
}
|
|
1878
1900
|
return a(s);
|
|
1879
1901
|
};
|
|
1880
1902
|
};
|
|
1881
1903
|
};
|
|
1882
1904
|
}
|
|
1883
|
-
var
|
|
1884
|
-
function
|
|
1885
|
-
|
|
1905
|
+
var De = {};
|
|
1906
|
+
function hn(t, e) {
|
|
1907
|
+
De[t] && V(De[t]) && (De[t](e), delete De[t]);
|
|
1886
1908
|
}
|
|
1887
|
-
function
|
|
1909
|
+
function or(t, e, n) {
|
|
1888
1910
|
return new Promise(function(r, i) {
|
|
1889
1911
|
return e() ? r(t) : n < 1 ? i(A({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1890
1912
|
return setTimeout(o, 10);
|
|
1891
1913
|
}).then(function(o) {
|
|
1892
|
-
return
|
|
1914
|
+
return or(t, e, n - 10).then(r, i);
|
|
1893
1915
|
});
|
|
1894
1916
|
});
|
|
1895
1917
|
}
|
|
1896
|
-
function
|
|
1918
|
+
function Zi(t) {
|
|
1897
1919
|
return { abort: t };
|
|
1898
1920
|
}
|
|
1899
|
-
function
|
|
1921
|
+
function ar(t, e, n) {
|
|
1900
1922
|
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, h = o.user;
|
|
1901
1923
|
if (!o.context.offline && s && s.actions && s.actions.length) {
|
|
1902
1924
|
var p = s.actions.reduce(function(c, f, d) {
|
|
@@ -1906,16 +1928,16 @@ function ir(t, e, n) {
|
|
|
1906
1928
|
p.processIndex.forEach(function(c) {
|
|
1907
1929
|
var f = s.actions[c], d = f.plugin, w = f.payload.type, k = i[d][w];
|
|
1908
1930
|
if (k && V(k)) {
|
|
1909
|
-
var v,
|
|
1910
|
-
return l === void 0 && (l = {}), b === void 0 && (b = {}), [ne,
|
|
1911
|
-
return l.hasOwnProperty(j) && b[j] && b[j] !== l[j] && (
|
|
1931
|
+
var v, E = function(l, b) {
|
|
1932
|
+
return l === void 0 && (l = {}), b === void 0 && (b = {}), [ne, Ie].reduce(function(P, j) {
|
|
1933
|
+
return l.hasOwnProperty(j) && b[j] && b[j] !== l[j] && (P[j] = b[j]), P;
|
|
1912
1934
|
}, l);
|
|
1913
|
-
}(f.payload, h), S = r[
|
|
1914
|
-
if (!S && (v = k({ payload:
|
|
1915
|
-
return void (r[
|
|
1935
|
+
}(f.payload, h), S = r[E.meta.rid];
|
|
1936
|
+
if (!S && (v = k({ payload: E, config: a[d].config, instance: n, abort: Zi })) && X(v) && v.abort)
|
|
1937
|
+
return void (r[E.meta.rid] = !0);
|
|
1916
1938
|
if (!S) {
|
|
1917
1939
|
var g = w + ":" + d;
|
|
1918
|
-
t.dispatch(A({},
|
|
1940
|
+
t.dispatch(A({}, E, { type: g, _: { called: g, from: "queueDrain" } }));
|
|
1919
1941
|
}
|
|
1920
1942
|
}
|
|
1921
1943
|
});
|
|
@@ -1926,164 +1948,164 @@ function ir(t, e, n) {
|
|
|
1926
1948
|
}
|
|
1927
1949
|
}
|
|
1928
1950
|
}
|
|
1929
|
-
var
|
|
1951
|
+
var mt = function(t) {
|
|
1930
1952
|
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, h = t.EVENTS;
|
|
1931
1953
|
try {
|
|
1932
|
-
var p = i.plugins, u = i.context, c = n.type, f = c.match(
|
|
1954
|
+
var p = i.plugins, u = i.context, c = n.type, f = c.match(_e), d = e.exact.map(function(v) {
|
|
1933
1955
|
return v.pluginName;
|
|
1934
1956
|
});
|
|
1935
1957
|
f && (d = a.during.map(function(v) {
|
|
1936
1958
|
return v.pluginName;
|
|
1937
1959
|
}));
|
|
1938
|
-
var w = /* @__PURE__ */ function(v,
|
|
1960
|
+
var w = /* @__PURE__ */ function(v, E) {
|
|
1939
1961
|
return function(S, g, l) {
|
|
1940
|
-
var b = g.config,
|
|
1962
|
+
var b = g.config, P = g.name, j = P + "." + S.type;
|
|
1941
1963
|
l && (j = l.event);
|
|
1942
|
-
var $ = S.type.match(
|
|
1943
|
-
return function(
|
|
1944
|
-
var
|
|
1945
|
-
if (
|
|
1946
|
-
throw new Error("Method " +
|
|
1947
|
-
return A({},
|
|
1964
|
+
var $ = S.type.match(_e) ? /* @__PURE__ */ function(L, R, _, I, C) {
|
|
1965
|
+
return function(D, T) {
|
|
1966
|
+
var W = I ? I.name : L, J = T && Ze(T) ? T : _;
|
|
1967
|
+
if (I && (!(J = T && Ze(T) ? T : [L]).includes(L) || J.length !== 1))
|
|
1968
|
+
throw new Error("Method " + R + " can only abort " + L + " plugin. " + JSON.stringify(J) + " input valid");
|
|
1969
|
+
return A({}, C, { abort: { reason: D, plugins: J, caller: R, _: W } });
|
|
1948
1970
|
};
|
|
1949
|
-
}(
|
|
1971
|
+
}(P, j, E, l, S) : /* @__PURE__ */ function(L, R) {
|
|
1950
1972
|
return function() {
|
|
1951
|
-
throw new Error(L.type + " action not cancellable. Remove abort in " +
|
|
1973
|
+
throw new Error(L.type + " action not cancellable. Remove abort in " + R);
|
|
1952
1974
|
};
|
|
1953
1975
|
}(S, j);
|
|
1954
|
-
return { payload:
|
|
1976
|
+
return { payload: Wi(S), instance: v, config: b || {}, abort: $ };
|
|
1955
1977
|
};
|
|
1956
|
-
}(r, d), k = e.exact.reduce(function(v,
|
|
1957
|
-
var S =
|
|
1978
|
+
}(r, d), k = e.exact.reduce(function(v, E) {
|
|
1979
|
+
var S = E.pluginName, g = E.methodName, l = !1;
|
|
1958
1980
|
return g.match(/^initialize/) || g.match(/^reset/) || (l = !p[S].loaded), u.offline && g.match(/^(page|track|identify)/) && (l = !0), v["" + S] = l, v;
|
|
1959
1981
|
}, {});
|
|
1960
|
-
return Promise.resolve(e.exact.reduce(function(v,
|
|
1982
|
+
return Promise.resolve(e.exact.reduce(function(v, E, S) {
|
|
1961
1983
|
try {
|
|
1962
|
-
var g =
|
|
1984
|
+
var g = E.pluginName;
|
|
1963
1985
|
return Promise.resolve(v).then(function(l) {
|
|
1964
1986
|
function b() {
|
|
1965
1987
|
return Promise.resolve(l);
|
|
1966
1988
|
}
|
|
1967
|
-
var
|
|
1989
|
+
var P = function() {
|
|
1968
1990
|
if (e.namespaced && e.namespaced[g])
|
|
1969
1991
|
return Promise.resolve(e.namespaced[g].reduce(function(j, $, L) {
|
|
1970
1992
|
try {
|
|
1971
|
-
return Promise.resolve(j).then(function(
|
|
1972
|
-
return $.method && V($.method) ? (function(
|
|
1973
|
-
var
|
|
1974
|
-
if (
|
|
1975
|
-
var
|
|
1976
|
-
throw new Error([
|
|
1993
|
+
return Promise.resolve(j).then(function(R) {
|
|
1994
|
+
return $.method && V($.method) ? (function(D, T) {
|
|
1995
|
+
var W = wn(D);
|
|
1996
|
+
if (W && W.name === T) {
|
|
1997
|
+
var J = wn(W.method);
|
|
1998
|
+
throw new Error([T + " plugin is calling method " + D, "Plugins cant call self", "Use " + W.method + " " + (J ? "or " + J.method : "") + " in " + T + " plugin insteadof " + D].join(`
|
|
1977
1999
|
`));
|
|
1978
2000
|
}
|
|
1979
|
-
}($.methodName, $.pluginName), Promise.resolve($.method({ payload:
|
|
1980
|
-
return A({},
|
|
1981
|
-
}), config:
|
|
1982
|
-
var
|
|
1983
|
-
return Promise.resolve(A({},
|
|
1984
|
-
})) :
|
|
1985
|
-
var
|
|
2001
|
+
}($.methodName, $.pluginName), Promise.resolve($.method({ payload: R, instance: r, abort: (_ = R, I = g, C = $.pluginName, function(D, T) {
|
|
2002
|
+
return A({}, _, { abort: { reason: D, plugins: T || [I], caller: c, from: C || I } });
|
|
2003
|
+
}), config: mn($.pluginName, p, o), plugins: p })).then(function(D) {
|
|
2004
|
+
var T = X(D) ? D : {};
|
|
2005
|
+
return Promise.resolve(A({}, R, T));
|
|
2006
|
+
})) : R;
|
|
2007
|
+
var _, I, C;
|
|
1986
2008
|
});
|
|
1987
|
-
} catch (
|
|
1988
|
-
return Promise.reject(
|
|
2009
|
+
} catch (R) {
|
|
2010
|
+
return Promise.reject(R);
|
|
1989
2011
|
}
|
|
1990
2012
|
}, Promise.resolve(n))).then(function(j) {
|
|
1991
2013
|
l[g] = j;
|
|
1992
2014
|
});
|
|
1993
2015
|
l[g] = n;
|
|
1994
2016
|
}();
|
|
1995
|
-
return
|
|
2017
|
+
return P && P.then ? P.then(b) : b();
|
|
1996
2018
|
});
|
|
1997
2019
|
} catch (l) {
|
|
1998
2020
|
return Promise.reject(l);
|
|
1999
2021
|
}
|
|
2000
2022
|
}, Promise.resolve({}))).then(function(v) {
|
|
2001
|
-
return Promise.resolve(e.exact.reduce(function(
|
|
2023
|
+
return Promise.resolve(e.exact.reduce(function(E, S, g) {
|
|
2002
2024
|
try {
|
|
2003
|
-
var l = e.exact.length === g + 1, b = S.pluginName,
|
|
2004
|
-
return Promise.resolve(
|
|
2025
|
+
var l = e.exact.length === g + 1, b = S.pluginName, P = o[b];
|
|
2026
|
+
return Promise.resolve(E).then(function(j) {
|
|
2005
2027
|
var $ = v[b] ? v[b] : {};
|
|
2006
|
-
if (f && ($ = j),
|
|
2007
|
-
return
|
|
2008
|
-
if (
|
|
2009
|
-
return l &&
|
|
2028
|
+
if (f && ($ = j), yt($, b))
|
|
2029
|
+
return gt({ data: $, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(j);
|
|
2030
|
+
if (yt(j, b))
|
|
2031
|
+
return l && gt({ data: j, method: c, instance: r, store: s }), Promise.resolve(j);
|
|
2010
2032
|
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
2011
2033
|
return s.dispatch({ type: "queue", plugin: b, payload: $, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(j);
|
|
2012
2034
|
var L = w(v[b], o[b]);
|
|
2013
|
-
return Promise.resolve(
|
|
2014
|
-
var
|
|
2015
|
-
if (
|
|
2016
|
-
|
|
2035
|
+
return Promise.resolve(P[c]({ abort: L.abort, payload: $, instance: r, config: mn(b, p, o), plugins: p })).then(function(R) {
|
|
2036
|
+
var _ = X(R) ? R : {}, I = A({}, j, _), C = v[b];
|
|
2037
|
+
if (yt(C, b))
|
|
2038
|
+
gt({ data: C, method: c, instance: r, pluginName: b, store: s });
|
|
2017
2039
|
else {
|
|
2018
|
-
var
|
|
2019
|
-
(
|
|
2040
|
+
var D = c + ":" + b;
|
|
2041
|
+
(D.match(/:/g) || []).length < 2 && !c.match(fn) && !c.match(pn) && r.dispatch(A({}, f ? I : $, { type: D, _: { called: D, from: "submethod" } }));
|
|
2020
2042
|
}
|
|
2021
|
-
return Promise.resolve(
|
|
2043
|
+
return Promise.resolve(I);
|
|
2022
2044
|
});
|
|
2023
2045
|
});
|
|
2024
2046
|
} catch (j) {
|
|
2025
2047
|
return Promise.reject(j);
|
|
2026
2048
|
}
|
|
2027
|
-
}, Promise.resolve(n))).then(function(
|
|
2028
|
-
if (!(c.match(
|
|
2029
|
-
if (h.plugins.includes(c),
|
|
2030
|
-
return
|
|
2031
|
-
var S = A({},
|
|
2032
|
-
|
|
2049
|
+
}, Promise.resolve(n))).then(function(E) {
|
|
2050
|
+
if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(pn) || c.match(fn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
2051
|
+
if (h.plugins.includes(c), E._ && E._.originalAction === c)
|
|
2052
|
+
return E;
|
|
2053
|
+
var S = A({}, E, { _: { originalAction: E.type, called: E.type, from: "engineEnd" } });
|
|
2054
|
+
sr(E, e.exact.length) && !c.match(/End$/) && (S = A({}, S, { type: E.type + "Aborted" })), s.dispatch(S);
|
|
2033
2055
|
}
|
|
2034
|
-
return
|
|
2056
|
+
return E;
|
|
2035
2057
|
});
|
|
2036
2058
|
});
|
|
2037
2059
|
} catch (v) {
|
|
2038
2060
|
return Promise.reject(v);
|
|
2039
2061
|
}
|
|
2040
|
-
},
|
|
2041
|
-
function
|
|
2062
|
+
}, _e = /Start$/, fn = /^bootstrap/, pn = /^ready/;
|
|
2063
|
+
function gt(t) {
|
|
2042
2064
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
2043
2065
|
t.store.dispatch(A({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2044
2066
|
}
|
|
2045
|
-
function
|
|
2067
|
+
function mn(t, e, n) {
|
|
2046
2068
|
var r = e[t] || n[t];
|
|
2047
2069
|
return r && r.config ? r.config : {};
|
|
2048
2070
|
}
|
|
2049
|
-
function
|
|
2071
|
+
function gn(t, e) {
|
|
2050
2072
|
return e.reduce(function(n, r) {
|
|
2051
2073
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
2052
2074
|
}, []);
|
|
2053
2075
|
}
|
|
2054
|
-
function
|
|
2055
|
-
var n = t.replace(
|
|
2076
|
+
function yn(t, e) {
|
|
2077
|
+
var n = t.replace(_e, ""), r = e ? ":" + e : "";
|
|
2056
2078
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
2057
2079
|
}
|
|
2058
|
-
function
|
|
2080
|
+
function yt(t, e) {
|
|
2059
2081
|
var n = t.abort;
|
|
2060
|
-
return !!n && (n === !0 ||
|
|
2082
|
+
return !!n && (n === !0 || vn(n, e) || n && vn(n.plugins, e));
|
|
2061
2083
|
}
|
|
2062
|
-
function
|
|
2084
|
+
function sr(t, e) {
|
|
2063
2085
|
var n = t.abort;
|
|
2064
2086
|
if (!n)
|
|
2065
2087
|
return !1;
|
|
2066
2088
|
if (n === !0 || ie(n))
|
|
2067
2089
|
return !0;
|
|
2068
2090
|
var r = n.plugins;
|
|
2069
|
-
return
|
|
2091
|
+
return Ze(n) && n.length === e || Ze(r) && r.length === e;
|
|
2070
2092
|
}
|
|
2071
|
-
function
|
|
2093
|
+
function Ze(t) {
|
|
2072
2094
|
return Array.isArray(t);
|
|
2073
2095
|
}
|
|
2074
|
-
function
|
|
2075
|
-
return !(!t || !
|
|
2096
|
+
function vn(t, e) {
|
|
2097
|
+
return !(!t || !Ze(t)) && t.includes(e);
|
|
2076
2098
|
}
|
|
2077
|
-
function
|
|
2099
|
+
function wn(t) {
|
|
2078
2100
|
var e = t.match(/(.*):(.*)/);
|
|
2079
2101
|
return !!e && { method: e[1], name: e[2] };
|
|
2080
2102
|
}
|
|
2081
|
-
function
|
|
2103
|
+
function Wi(t) {
|
|
2082
2104
|
return Object.keys(t).reduce(function(e, n) {
|
|
2083
2105
|
return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
2084
2106
|
}, {});
|
|
2085
2107
|
}
|
|
2086
|
-
function
|
|
2108
|
+
function Ki(t, e, n) {
|
|
2087
2109
|
var r = {};
|
|
2088
2110
|
return function(i) {
|
|
2089
2111
|
return function(o) {
|
|
@@ -2094,21 +2116,21 @@ function Zi(t, e, n) {
|
|
|
2094
2116
|
}, p = a.type, u = a.plugins, c = a;
|
|
2095
2117
|
if (a.abort)
|
|
2096
2118
|
return Promise.resolve(o(a));
|
|
2097
|
-
if (p ===
|
|
2098
|
-
return
|
|
2099
|
-
}, 0), p ===
|
|
2119
|
+
if (p === x.enablePlugin && i.dispatch({ type: x.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === x.disablePlugin && setTimeout(function() {
|
|
2120
|
+
return hn(a.meta.rid, { payload: a });
|
|
2121
|
+
}, 0), p === x.initializeEnd) {
|
|
2100
2122
|
var f = e(), d = Object.keys(f), w = d.filter(function(l) {
|
|
2101
2123
|
return u.includes(l);
|
|
2102
2124
|
}).map(function(l) {
|
|
2103
2125
|
return f[l];
|
|
2104
|
-
}), k = [], v = [],
|
|
2105
|
-
var b = l.loaded,
|
|
2106
|
-
return
|
|
2126
|
+
}), k = [], v = [], E = a.disabled, S = w.map(function(l) {
|
|
2127
|
+
var b = l.loaded, P = l.name, j = l.config;
|
|
2128
|
+
return or(l, function() {
|
|
2107
2129
|
return b({ config: j });
|
|
2108
2130
|
}, 1e4).then(function($) {
|
|
2109
|
-
return r[
|
|
2110
|
-
return !
|
|
2111
|
-
}) }), r[
|
|
2131
|
+
return r[P] || (i.dispatch({ type: x.pluginReadyType(P), name: P, events: Object.keys(l).filter(function(L) {
|
|
2132
|
+
return !Ot.includes(L);
|
|
2133
|
+
}) }), r[P] = !0), k = k.concat(P), l;
|
|
2112
2134
|
}).catch(function($) {
|
|
2113
2135
|
if ($ instanceof Error)
|
|
2114
2136
|
throw new Error($);
|
|
@@ -2116,64 +2138,64 @@ function Zi(t, e, n) {
|
|
|
2116
2138
|
});
|
|
2117
2139
|
});
|
|
2118
2140
|
Promise.all(S).then(function(l) {
|
|
2119
|
-
var b = { plugins: k, failed: v, disabled:
|
|
2141
|
+
var b = { plugins: k, failed: v, disabled: E };
|
|
2120
2142
|
setTimeout(function() {
|
|
2121
|
-
d.length === S.length +
|
|
2143
|
+
d.length === S.length + E.length && i.dispatch(A({}, { type: x.ready }, b));
|
|
2122
2144
|
}, 0);
|
|
2123
2145
|
});
|
|
2124
2146
|
}
|
|
2125
2147
|
var g = function() {
|
|
2126
|
-
if (p !==
|
|
2148
|
+
if (p !== x.bootstrap)
|
|
2127
2149
|
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2128
|
-
return
|
|
2129
|
-
}, 0), Promise.resolve(function(l, b,
|
|
2150
|
+
return ar(i, e, t);
|
|
2151
|
+
}, 0), Promise.resolve(function(l, b, P, j, $) {
|
|
2130
2152
|
try {
|
|
2131
|
-
var L = V(b) ? b() : b,
|
|
2153
|
+
var L = V(b) ? b() : b, R = l.type, _ = R.replace(_e, "");
|
|
2132
2154
|
if (l._ && l._.called)
|
|
2133
2155
|
return Promise.resolve(l);
|
|
2134
|
-
var
|
|
2135
|
-
var y =
|
|
2136
|
-
return
|
|
2156
|
+
var I = P.getState(), C = (W = L, (J = I.plugins) === void 0 && (J = {}), (Ae = l.options) === void 0 && (Ae = {}), Object.keys(W).filter(function(m) {
|
|
2157
|
+
var y = Ae.plugins || {};
|
|
2158
|
+
return Si(y[m]) ? y[m] : y.all !== !1 && (!J[m] || J[m].enabled !== !1);
|
|
2137
2159
|
}).map(function(m) {
|
|
2138
|
-
return
|
|
2160
|
+
return W[m];
|
|
2139
2161
|
}));
|
|
2140
|
-
|
|
2141
|
-
var y =
|
|
2162
|
+
R === x.initializeStart && l.fromEnable && (C = Object.keys(I.plugins).filter(function(m) {
|
|
2163
|
+
var y = I.plugins[m];
|
|
2142
2164
|
return l.plugins.includes(m) && !y.initialized;
|
|
2143
2165
|
}).map(function(m) {
|
|
2144
2166
|
return L[m];
|
|
2145
2167
|
}));
|
|
2146
|
-
var
|
|
2168
|
+
var D = C.map(function(m) {
|
|
2147
2169
|
return m.name;
|
|
2148
|
-
}),
|
|
2149
|
-
var z =
|
|
2150
|
-
return
|
|
2170
|
+
}), T = function(m, y, O) {
|
|
2171
|
+
var z = yn(m).map(function(N) {
|
|
2172
|
+
return gn(N, y);
|
|
2151
2173
|
});
|
|
2152
|
-
return y.reduce(function(
|
|
2153
|
-
var F = U.name, Z =
|
|
2154
|
-
return
|
|
2155
|
-
}),
|
|
2156
|
-
return
|
|
2174
|
+
return y.reduce(function(N, U) {
|
|
2175
|
+
var F = U.name, Z = yn(m, F).map(function($e) {
|
|
2176
|
+
return gn($e, y);
|
|
2177
|
+
}), K = Z[0], M = Z[1], q = Z[2];
|
|
2178
|
+
return K.length && (N.beforeNS[F] = K), M.length && (N.duringNS[F] = M), q.length && (N.afterNS[F] = q), N;
|
|
2157
2179
|
}, { before: z[0], beforeNS: {}, during: z[1], duringNS: {}, after: z[2], afterNS: {} });
|
|
2158
|
-
}(
|
|
2159
|
-
return Promise.resolve(
|
|
2180
|
+
}(R, C);
|
|
2181
|
+
return Promise.resolve(mt({ action: l, data: { exact: T.before, namespaced: T.beforeNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(m) {
|
|
2160
2182
|
function y() {
|
|
2161
|
-
var
|
|
2162
|
-
if (
|
|
2163
|
-
return Promise.resolve(
|
|
2164
|
-
U.meta && U.meta.hasCallback &&
|
|
2183
|
+
var N = function() {
|
|
2184
|
+
if (R.match(_e))
|
|
2185
|
+
return Promise.resolve(mt({ action: A({}, O, { type: _ + "End" }), data: { exact: T.after, namespaced: T.afterNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(U) {
|
|
2186
|
+
U.meta && U.meta.hasCallback && hn(U.meta.rid, { payload: U });
|
|
2165
2187
|
});
|
|
2166
2188
|
}();
|
|
2167
|
-
return
|
|
2189
|
+
return N && N.then ? N.then(function() {
|
|
2168
2190
|
return m;
|
|
2169
2191
|
}) : m;
|
|
2170
2192
|
}
|
|
2171
|
-
if (
|
|
2193
|
+
if (sr(m, D.length))
|
|
2172
2194
|
return m;
|
|
2173
2195
|
var O, z = function() {
|
|
2174
|
-
if (
|
|
2175
|
-
return Promise.resolve(
|
|
2176
|
-
O =
|
|
2196
|
+
if (R !== _)
|
|
2197
|
+
return Promise.resolve(mt({ action: A({}, m, { type: _ }), data: { exact: T.during, namespaced: T.duringNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(N) {
|
|
2198
|
+
O = N;
|
|
2177
2199
|
});
|
|
2178
2200
|
O = m;
|
|
2179
2201
|
}();
|
|
@@ -2182,7 +2204,7 @@ function Zi(t, e, n) {
|
|
|
2182
2204
|
} catch (m) {
|
|
2183
2205
|
return Promise.reject(m);
|
|
2184
2206
|
}
|
|
2185
|
-
var
|
|
2207
|
+
var W, J, Ae;
|
|
2186
2208
|
}(a, e, t, i, n)).then(function(l) {
|
|
2187
2209
|
return s = 1, o(l);
|
|
2188
2210
|
});
|
|
@@ -2195,22 +2217,22 @@ function Zi(t, e, n) {
|
|
|
2195
2217
|
};
|
|
2196
2218
|
};
|
|
2197
2219
|
}
|
|
2198
|
-
function
|
|
2220
|
+
function Fi(t) {
|
|
2199
2221
|
return function(e) {
|
|
2200
2222
|
return function(n) {
|
|
2201
2223
|
return function(r) {
|
|
2202
2224
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
2203
|
-
if (i ===
|
|
2225
|
+
if (i === x.setItem || i === x.removeItem) {
|
|
2204
2226
|
if (r.abort)
|
|
2205
2227
|
return n(r);
|
|
2206
|
-
i ===
|
|
2228
|
+
i === x.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
2207
2229
|
}
|
|
2208
2230
|
return n(r);
|
|
2209
2231
|
};
|
|
2210
2232
|
};
|
|
2211
2233
|
};
|
|
2212
2234
|
}
|
|
2213
|
-
var
|
|
2235
|
+
var Hi = function() {
|
|
2214
2236
|
var t = this;
|
|
2215
2237
|
this.before = [], this.after = [], this.addMiddleware = function(e, n) {
|
|
2216
2238
|
t[n] = t[n].concat(e);
|
|
@@ -2228,169 +2250,169 @@ var Ki = function() {
|
|
|
2228
2250
|
} }, a = t[e].map(function(s) {
|
|
2229
2251
|
return s(o);
|
|
2230
2252
|
});
|
|
2231
|
-
return
|
|
2253
|
+
return je.apply(void 0, a)(r)(i);
|
|
2232
2254
|
};
|
|
2233
2255
|
};
|
|
2234
2256
|
};
|
|
2235
2257
|
};
|
|
2236
2258
|
};
|
|
2237
|
-
function
|
|
2259
|
+
function Ji(t) {
|
|
2238
2260
|
return function(e, n) {
|
|
2239
2261
|
e === void 0 && (e = {});
|
|
2240
2262
|
var r = {};
|
|
2241
2263
|
if (n.type === "initialize:aborted")
|
|
2242
2264
|
return e;
|
|
2243
2265
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2244
|
-
var i =
|
|
2266
|
+
var i = bn(n.type, "registerPlugin"), o = t()[i];
|
|
2245
2267
|
if (!o || !i)
|
|
2246
2268
|
return e;
|
|
2247
2269
|
var a = n.enabled, s = o.config;
|
|
2248
2270
|
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, A({}, e, r);
|
|
2249
2271
|
}
|
|
2250
2272
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2251
|
-
var h =
|
|
2273
|
+
var h = bn(n.type, x.initialize), p = t()[h];
|
|
2252
2274
|
return p && h ? (r[h] = A({}, e[h], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), A({}, e, r)) : e;
|
|
2253
2275
|
}
|
|
2254
2276
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2255
2277
|
return r[n.name] = A({}, e[n.name], { loaded: !0 }), A({}, e, r);
|
|
2256
2278
|
switch (n.type) {
|
|
2257
|
-
case
|
|
2258
|
-
return A({}, e,
|
|
2259
|
-
case
|
|
2260
|
-
return A({}, e,
|
|
2279
|
+
case x.disablePlugin:
|
|
2280
|
+
return A({}, e, kn(n.plugins, !1, e));
|
|
2281
|
+
case x.enablePlugin:
|
|
2282
|
+
return A({}, e, kn(n.plugins, !0, e));
|
|
2261
2283
|
default:
|
|
2262
2284
|
return e;
|
|
2263
2285
|
}
|
|
2264
2286
|
};
|
|
2265
2287
|
}
|
|
2266
|
-
function
|
|
2288
|
+
function bn(t, e) {
|
|
2267
2289
|
return t.substring(e.length + 1, t.length);
|
|
2268
2290
|
}
|
|
2269
|
-
function
|
|
2291
|
+
function kn(t, e, n) {
|
|
2270
2292
|
return t.reduce(function(r, i) {
|
|
2271
2293
|
return r[i] = A({}, n[i], { enabled: e }), r;
|
|
2272
2294
|
}, n);
|
|
2273
2295
|
}
|
|
2274
|
-
function
|
|
2296
|
+
function cr(t) {
|
|
2275
2297
|
try {
|
|
2276
2298
|
return JSON.parse(JSON.stringify(t));
|
|
2277
2299
|
} catch {
|
|
2278
2300
|
}
|
|
2279
2301
|
return t;
|
|
2280
2302
|
}
|
|
2281
|
-
var
|
|
2282
|
-
function
|
|
2283
|
-
t === void 0 && (t =
|
|
2303
|
+
var Xi = { last: {}, history: [] };
|
|
2304
|
+
function Vi(t, e) {
|
|
2305
|
+
t === void 0 && (t = Xi);
|
|
2284
2306
|
var n = e.options, r = e.meta;
|
|
2285
|
-
if (e.type ===
|
|
2286
|
-
var i =
|
|
2307
|
+
if (e.type === x.track) {
|
|
2308
|
+
var i = cr(A({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2287
2309
|
return A({}, t, { last: i, history: t.history.concat(i) });
|
|
2288
2310
|
}
|
|
2289
2311
|
return t;
|
|
2290
2312
|
}
|
|
2291
|
-
var
|
|
2292
|
-
function
|
|
2293
|
-
t === void 0 && (t =
|
|
2313
|
+
var Yi = { actions: [] };
|
|
2314
|
+
function Gi(t, e) {
|
|
2315
|
+
t === void 0 && (t = Yi);
|
|
2294
2316
|
var n = e.payload;
|
|
2295
2317
|
switch (e.type) {
|
|
2296
2318
|
case "queue":
|
|
2297
2319
|
var r;
|
|
2298
|
-
return r = n && n.type && n.type ===
|
|
2320
|
+
return r = n && n.type && n.type === x.identify ? [e].concat(t.actions) : t.actions.concat(e), A({}, t, { actions: r });
|
|
2299
2321
|
case "dequeue":
|
|
2300
2322
|
return [];
|
|
2301
2323
|
default:
|
|
2302
2324
|
return t;
|
|
2303
2325
|
}
|
|
2304
2326
|
}
|
|
2305
|
-
var
|
|
2306
|
-
function
|
|
2327
|
+
var ur = /#.*$/;
|
|
2328
|
+
function Bi(t) {
|
|
2307
2329
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2308
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2330
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(ur, "") : "");
|
|
2309
2331
|
}
|
|
2310
|
-
var
|
|
2311
|
-
if (t === void 0 && (t = {}), !
|
|
2332
|
+
var lr, dr, hr, fr, qi = function(t) {
|
|
2333
|
+
if (t === void 0 && (t = {}), !H)
|
|
2312
2334
|
return t;
|
|
2313
2335
|
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, h = o.hash, p = o.search, u = function(f) {
|
|
2314
2336
|
var d = function() {
|
|
2315
|
-
if (
|
|
2337
|
+
if (H) {
|
|
2316
2338
|
for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
|
|
2317
2339
|
if (w.getAttribute("rel") === "canonical")
|
|
2318
2340
|
return w.getAttribute("href");
|
|
2319
2341
|
}
|
|
2320
2342
|
}();
|
|
2321
|
-
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(
|
|
2322
|
-
}(p), c = { title: n, url: u, path:
|
|
2343
|
+
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(ur, "");
|
|
2344
|
+
}(p), c = { title: n, url: u, path: Bi(u), hash: h, search: p, width: a, height: s };
|
|
2323
2345
|
return r && r !== "" && (c.referrer = r), A({}, c, t);
|
|
2324
|
-
},
|
|
2325
|
-
function
|
|
2326
|
-
t === void 0 && (t =
|
|
2346
|
+
}, Qi = { last: {}, history: [] };
|
|
2347
|
+
function eo(t, e) {
|
|
2348
|
+
t === void 0 && (t = Qi);
|
|
2327
2349
|
var n = e.options;
|
|
2328
|
-
if (e.type ===
|
|
2329
|
-
var r =
|
|
2350
|
+
if (e.type === x.page) {
|
|
2351
|
+
var r = cr(A({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2330
2352
|
return A({}, t, { last: r, history: t.history.concat(r) });
|
|
2331
2353
|
}
|
|
2332
2354
|
return t;
|
|
2333
2355
|
}
|
|
2334
|
-
|
|
2335
|
-
if (!
|
|
2356
|
+
lr = function() {
|
|
2357
|
+
if (!H)
|
|
2336
2358
|
return !1;
|
|
2337
2359
|
var t = navigator.appVersion;
|
|
2338
2360
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2339
|
-
}(),
|
|
2340
|
-
var
|
|
2341
|
-
function
|
|
2342
|
-
t === void 0 && (t =
|
|
2361
|
+
}(), dr = H ? document.referrer : null, hr = Ci(), fr = xi();
|
|
2362
|
+
var In = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: lr }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: fr, locale: hr, campaign: {}, referrer: dr };
|
|
2363
|
+
function to(t, e) {
|
|
2364
|
+
t === void 0 && (t = In);
|
|
2343
2365
|
var n = t.initialized, r = e.campaign;
|
|
2344
2366
|
switch (e.type) {
|
|
2345
|
-
case
|
|
2367
|
+
case x.campaign:
|
|
2346
2368
|
return A({}, t, { campaign: r });
|
|
2347
|
-
case
|
|
2369
|
+
case x.offline:
|
|
2348
2370
|
return A({}, t, { offline: !0 });
|
|
2349
|
-
case
|
|
2371
|
+
case x.online:
|
|
2350
2372
|
return A({}, t, { offline: !1 });
|
|
2351
2373
|
default:
|
|
2352
|
-
return n ? t : A({},
|
|
2374
|
+
return n ? t : A({}, In, t, { initialized: !0 });
|
|
2353
2375
|
}
|
|
2354
2376
|
}
|
|
2355
|
-
var
|
|
2356
|
-
function
|
|
2357
|
-
if (
|
|
2377
|
+
var no = ["plugins", "reducers", "storage"];
|
|
2378
|
+
function ro(t, e, n) {
|
|
2379
|
+
if (H) {
|
|
2358
2380
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
2359
2381
|
t.split(" ").forEach(function(i) {
|
|
2360
2382
|
r(i, e);
|
|
2361
2383
|
});
|
|
2362
2384
|
}
|
|
2363
2385
|
}
|
|
2364
|
-
function
|
|
2365
|
-
var e =
|
|
2386
|
+
function io(t) {
|
|
2387
|
+
var e = ro.bind(null, "online offline", function(n) {
|
|
2366
2388
|
return Promise.resolve(!navigator.onLine).then(t);
|
|
2367
2389
|
});
|
|
2368
2390
|
return e(!0), function(n) {
|
|
2369
2391
|
return e(!1);
|
|
2370
2392
|
};
|
|
2371
2393
|
}
|
|
2372
|
-
function
|
|
2373
|
-
return
|
|
2394
|
+
function pr() {
|
|
2395
|
+
return ve("analytics", []), function(t) {
|
|
2374
2396
|
return function(e, n, r) {
|
|
2375
2397
|
var i = t(e, n, r), o = i.dispatch;
|
|
2376
2398
|
return Object.assign(i, { dispatch: function(a) {
|
|
2377
|
-
return
|
|
2399
|
+
return Pe[Oe].analytics.push(a.action || a), o(a);
|
|
2378
2400
|
} });
|
|
2379
2401
|
};
|
|
2380
2402
|
};
|
|
2381
2403
|
}
|
|
2382
|
-
function
|
|
2404
|
+
function Sn(t) {
|
|
2383
2405
|
return function() {
|
|
2384
|
-
return
|
|
2406
|
+
return je(je.apply(null, arguments), pr());
|
|
2385
2407
|
};
|
|
2386
2408
|
}
|
|
2387
|
-
function
|
|
2388
|
-
return t ?
|
|
2409
|
+
function vt(t) {
|
|
2410
|
+
return t ? nr(t) ? t : [t] : [];
|
|
2389
2411
|
}
|
|
2390
|
-
function
|
|
2412
|
+
function _n(t, e, n) {
|
|
2391
2413
|
t === void 0 && (t = {});
|
|
2392
|
-
var r, i, o =
|
|
2393
|
-
return e && (
|
|
2414
|
+
var r, i, o = st();
|
|
2415
|
+
return e && (De[o] = (r = e, i = function(a) {
|
|
2394
2416
|
for (var s, h = a || Array.prototype.slice.call(arguments), p = 0; p < h.length; p++)
|
|
2395
2417
|
if (V(h[p])) {
|
|
2396
2418
|
s = h[p];
|
|
@@ -2401,7 +2423,7 @@ function In(t, e, n) {
|
|
|
2401
2423
|
i && i(a), r(a);
|
|
2402
2424
|
})), A({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2403
2425
|
}
|
|
2404
|
-
function
|
|
2426
|
+
function oo(t) {
|
|
2405
2427
|
t === void 0 && (t = {});
|
|
2406
2428
|
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, y) {
|
|
2407
2429
|
if (V(y))
|
|
@@ -2415,67 +2437,67 @@ function ro(t) {
|
|
|
2415
2437
|
m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(U, F) {
|
|
2416
2438
|
var Z;
|
|
2417
2439
|
return U[F] = (Z = y.methods[F], function() {
|
|
2418
|
-
for (var
|
|
2419
|
-
M[q] =
|
|
2440
|
+
for (var K = Array.prototype.slice.call(arguments), M = new Array(Z.length), q = 0; q < K.length; q++)
|
|
2441
|
+
M[q] = K[q];
|
|
2420
2442
|
return M[M.length] = b, Z.apply({ instance: b }, M);
|
|
2421
2443
|
}), U;
|
|
2422
2444
|
}, {}), delete y.methods);
|
|
2423
|
-
var z = Object.keys(y).concat(O),
|
|
2424
|
-
if (m.events = Array.from(
|
|
2445
|
+
var z = Object.keys(y).concat(O), N = new Set(m.events.concat(z));
|
|
2446
|
+
if (m.events = Array.from(N), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
|
|
2425
2447
|
throw new Error(y.name + "AlreadyLoaded");
|
|
2426
2448
|
return m.plugins[y.name] = y, m.plugins[y.name].loaded || (m.plugins[y.name].loaded = function() {
|
|
2427
2449
|
return !0;
|
|
2428
2450
|
}), m;
|
|
2429
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem:
|
|
2451
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ye, setItem: ve, removeItem: Ce }, o = /* @__PURE__ */ function(m) {
|
|
2430
2452
|
return function(y, O, z) {
|
|
2431
|
-
return O.getState("user")[y] || (z && X(z) && z[y] ? z[y] :
|
|
2453
|
+
return O.getState("user")[y] || (z && X(z) && z[y] ? z[y] : dn(m)[y] || ye(Pt(y)) || null);
|
|
2432
2454
|
};
|
|
2433
2455
|
}(i), a = r.plugins, s = r.events.filter(function(m) {
|
|
2434
|
-
return !
|
|
2435
|
-
}).sort(), h = new Set(s.concat(
|
|
2436
|
-
return !
|
|
2456
|
+
return !Ot.includes(m);
|
|
2457
|
+
}).sort(), h = new Set(s.concat(et).filter(function(m) {
|
|
2458
|
+
return !Ot.includes(m);
|
|
2437
2459
|
})), p = Array.from(h).sort(), u = function() {
|
|
2438
2460
|
return a;
|
|
2439
|
-
}, c = new
|
|
2461
|
+
}, c = new Hi(), f = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2440
2462
|
throw new Error("Abort disabled inListener");
|
|
2441
|
-
}, v =
|
|
2442
|
-
S.anonymousId || (S.anonymousId =
|
|
2463
|
+
}, v = Ai(), E = dn(i), S = A({}, E, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2464
|
+
S.anonymousId || (S.anonymousId = st());
|
|
2443
2465
|
var g = A({ enable: function(m, y) {
|
|
2444
2466
|
return new Promise(function(O) {
|
|
2445
|
-
|
|
2467
|
+
T.dispatch({ type: x.enablePlugin, plugins: vt(m), _: { originalAction: x.enablePlugin } }, O, [y]);
|
|
2446
2468
|
});
|
|
2447
2469
|
}, disable: function(m, y) {
|
|
2448
2470
|
return new Promise(function(O) {
|
|
2449
|
-
|
|
2471
|
+
T.dispatch({ type: x.disablePlugin, plugins: vt(m), _: { originalAction: x.disablePlugin } }, O, [y]);
|
|
2450
2472
|
});
|
|
2451
2473
|
} }, r.methods), l = !1, b = { identify: function(m, y, O, z) {
|
|
2452
2474
|
try {
|
|
2453
|
-
var
|
|
2454
|
-
|
|
2455
|
-
var
|
|
2475
|
+
var N = ie(m) ? m : null, U = X(m) ? m : y, F = O || {}, Z = b.user();
|
|
2476
|
+
ve(Pt(ne), N);
|
|
2477
|
+
var K = N || U.userId || o(ne, b, U);
|
|
2456
2478
|
return Promise.resolve(new Promise(function(M) {
|
|
2457
|
-
|
|
2479
|
+
T.dispatch(A({ type: x.identifyStart, userId: K, traits: U || {}, options: F, anonymousId: Z.anonymousId }, Z.id && Z.id !== N && { previousId: Z.id }), M, [y, O, z]);
|
|
2458
2480
|
}));
|
|
2459
2481
|
} catch (M) {
|
|
2460
2482
|
return Promise.reject(M);
|
|
2461
2483
|
}
|
|
2462
2484
|
}, track: function(m, y, O, z) {
|
|
2463
2485
|
try {
|
|
2464
|
-
var
|
|
2465
|
-
if (!
|
|
2486
|
+
var N = X(m) ? m.event : m;
|
|
2487
|
+
if (!N || !ie(N))
|
|
2466
2488
|
throw new Error("EventMissing");
|
|
2467
2489
|
var U = X(m) ? m : y || {}, F = X(O) ? O : {};
|
|
2468
2490
|
return Promise.resolve(new Promise(function(Z) {
|
|
2469
|
-
|
|
2491
|
+
T.dispatch({ type: x.trackStart, event: N, properties: U, options: F, userId: o(ne, b, y), anonymousId: o(Ie, b, y) }, Z, [y, O, z]);
|
|
2470
2492
|
}));
|
|
2471
2493
|
} catch (Z) {
|
|
2472
2494
|
return Promise.reject(Z);
|
|
2473
2495
|
}
|
|
2474
2496
|
}, page: function(m, y, O) {
|
|
2475
2497
|
try {
|
|
2476
|
-
var z = X(m) ? m : {},
|
|
2498
|
+
var z = X(m) ? m : {}, N = X(y) ? y : {};
|
|
2477
2499
|
return Promise.resolve(new Promise(function(U) {
|
|
2478
|
-
|
|
2500
|
+
T.dispatch({ type: x.pageStart, properties: qi(z), options: N, userId: o(ne, b, z), anonymousId: o(Ie, b, z) }, U, [m, y, O]);
|
|
2479
2501
|
}));
|
|
2480
2502
|
} catch (U) {
|
|
2481
2503
|
return Promise.reject(U);
|
|
@@ -2483,46 +2505,46 @@ function ro(t) {
|
|
|
2483
2505
|
}, user: function(m) {
|
|
2484
2506
|
if (m === ne || m === "id")
|
|
2485
2507
|
return o(ne, b);
|
|
2486
|
-
if (m ===
|
|
2487
|
-
return o(
|
|
2508
|
+
if (m === Ie || m === "anonId")
|
|
2509
|
+
return o(Ie, b);
|
|
2488
2510
|
var y = b.getState("user");
|
|
2489
|
-
return m ?
|
|
2511
|
+
return m ? rn(y, m) : y;
|
|
2490
2512
|
}, reset: function(m) {
|
|
2491
2513
|
return new Promise(function(y) {
|
|
2492
|
-
|
|
2514
|
+
T.dispatch({ type: x.resetStart }, y, m);
|
|
2493
2515
|
});
|
|
2494
2516
|
}, ready: function(m) {
|
|
2495
|
-
return l && m({ plugins: g, instance: b }), b.on(
|
|
2517
|
+
return l && m({ plugins: g, instance: b }), b.on(x.ready, function(y) {
|
|
2496
2518
|
m(y), l = !0;
|
|
2497
2519
|
});
|
|
2498
2520
|
}, on: function(m, y) {
|
|
2499
2521
|
if (!m || !V(y))
|
|
2500
2522
|
return !1;
|
|
2501
|
-
if (m ===
|
|
2523
|
+
if (m === x.bootstrap)
|
|
2502
2524
|
throw new Error(".on disabled for " + m);
|
|
2503
2525
|
var O = /Start$|Start:/;
|
|
2504
2526
|
if (m === "*") {
|
|
2505
2527
|
var z = function(Z) {
|
|
2506
|
-
return function(
|
|
2528
|
+
return function(K) {
|
|
2507
2529
|
return function(M) {
|
|
2508
|
-
return M.type.match(O) && y({ payload: M, instance: b, plugins: a }),
|
|
2530
|
+
return M.type.match(O) && y({ payload: M, instance: b, plugins: a }), K(M);
|
|
2509
2531
|
};
|
|
2510
2532
|
};
|
|
2511
|
-
},
|
|
2512
|
-
return function(
|
|
2533
|
+
}, N = function(Z) {
|
|
2534
|
+
return function(K) {
|
|
2513
2535
|
return function(M) {
|
|
2514
|
-
return M.type.match(O) || y({ payload: M, instance: b, plugins: a }),
|
|
2536
|
+
return M.type.match(O) || y({ payload: M, instance: b, plugins: a }), K(M);
|
|
2515
2537
|
};
|
|
2516
2538
|
};
|
|
2517
2539
|
};
|
|
2518
|
-
return f(z,
|
|
2519
|
-
d(z,
|
|
2540
|
+
return f(z, Ye), f(N, Ge), function() {
|
|
2541
|
+
d(z, Ye), d(N, Ge);
|
|
2520
2542
|
};
|
|
2521
2543
|
}
|
|
2522
|
-
var U = m.match(O) ?
|
|
2523
|
-
return function(
|
|
2544
|
+
var U = m.match(O) ? Ye : Ge, F = function(Z) {
|
|
2545
|
+
return function(K) {
|
|
2524
2546
|
return function(M) {
|
|
2525
|
-
return M.type === m && y({ payload: M, instance: b, plugins: a, abort: k }),
|
|
2547
|
+
return M.type === m && y({ payload: M, instance: b, plugins: a, abort: k }), K(M);
|
|
2526
2548
|
};
|
|
2527
2549
|
};
|
|
2528
2550
|
};
|
|
@@ -2532,130 +2554,130 @@ function ro(t) {
|
|
|
2532
2554
|
}, once: function(m, y) {
|
|
2533
2555
|
if (!m || !V(y))
|
|
2534
2556
|
return !1;
|
|
2535
|
-
if (m ===
|
|
2557
|
+
if (m === x.bootstrap)
|
|
2536
2558
|
throw new Error(".once disabled for " + m);
|
|
2537
2559
|
var O = b.on(m, function(z) {
|
|
2538
2560
|
y({ payload: z.payload, instance: b, plugins: a, abort: k }), O();
|
|
2539
2561
|
});
|
|
2540
2562
|
return O;
|
|
2541
2563
|
}, getState: function(m) {
|
|
2542
|
-
var y =
|
|
2543
|
-
return m ?
|
|
2564
|
+
var y = T.getState();
|
|
2565
|
+
return m ? rn(y, m) : Object.assign({}, y);
|
|
2544
2566
|
}, dispatch: function(m) {
|
|
2545
2567
|
var y = ie(m) ? { type: m } : m;
|
|
2546
|
-
if (
|
|
2568
|
+
if (et.includes(y.type))
|
|
2547
2569
|
throw new Error("reserved action " + y.type);
|
|
2548
2570
|
var O = A({}, y, { _: A({ originalAction: y.type }, m._ || {}) });
|
|
2549
|
-
|
|
2571
|
+
T.dispatch(O);
|
|
2550
2572
|
}, enablePlugin: g.enable, disablePlugin: g.disable, plugins: g, storage: { getItem: i.getItem, setItem: function(m, y, O) {
|
|
2551
|
-
|
|
2573
|
+
T.dispatch({ type: x.setItemStart, key: m, value: y, options: O });
|
|
2552
2574
|
}, removeItem: function(m, y) {
|
|
2553
|
-
|
|
2575
|
+
T.dispatch({ type: x.removeItemStart, key: m, options: y });
|
|
2554
2576
|
} }, setAnonymousId: function(m, y) {
|
|
2555
2577
|
b.storage.setItem(oe, m, y);
|
|
2556
|
-
}, events: { core:
|
|
2578
|
+
}, events: { core: et, plugins: s } }, P = r.middlewares.concat([function(m) {
|
|
2557
2579
|
return function(y) {
|
|
2558
2580
|
return function(O) {
|
|
2559
|
-
return O.meta || (O.meta =
|
|
2581
|
+
return O.meta || (O.meta = _n()), y(O);
|
|
2560
2582
|
};
|
|
2561
2583
|
};
|
|
2562
|
-
}, w(
|
|
2563
|
-
if (
|
|
2564
|
-
var
|
|
2565
|
-
|
|
2566
|
-
return arguments.length === 0 ?
|
|
2584
|
+
}, w(Ye), Ki(b, u, { all: p, plugins: s }), Fi(i), Li(b), Mi(b), w(Ge)]), j = { context: to, user: Ri(i), page: eo, track: Vi, plugins: Ji(u), queue: Gi }, $ = je, L = je;
|
|
2585
|
+
if (H && t.debug) {
|
|
2586
|
+
var R = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2587
|
+
R && ($ = R({ trace: !0, traceLimit: 25 })), L = function() {
|
|
2588
|
+
return arguments.length === 0 ? pr() : X(typeof arguments[0]) ? Sn() : Sn().apply(null, arguments);
|
|
2567
2589
|
};
|
|
2568
2590
|
}
|
|
2569
|
-
var
|
|
2591
|
+
var _, I = function(m) {
|
|
2570
2592
|
return Object.keys(m).reduce(function(y, O) {
|
|
2571
|
-
return
|
|
2593
|
+
return no.includes(O) || (y[O] = m[O]), y;
|
|
2572
2594
|
}, {});
|
|
2573
|
-
}(t),
|
|
2574
|
-
var O = y.name, z = y.config,
|
|
2575
|
-
return m[O] = { enabled: U, initialized: !!U && !y.initialize, loaded: !!
|
|
2576
|
-
}, {}),
|
|
2595
|
+
}(t), C = r.pluginsArray.reduce(function(m, y) {
|
|
2596
|
+
var O = y.name, z = y.config, N = y.loaded, U = r.pluginEnabled[O];
|
|
2597
|
+
return m[O] = { enabled: U, initialized: !!U && !y.initialize, loaded: !!N({ config: z }), config: z }, m;
|
|
2598
|
+
}, {}), D = { context: I, user: S, plugins: C }, T = ir(function(m) {
|
|
2577
2599
|
for (var y = Object.keys(m), O = {}, z = 0; z < y.length; z++) {
|
|
2578
|
-
var
|
|
2579
|
-
typeof m[
|
|
2600
|
+
var N = y[z];
|
|
2601
|
+
typeof m[N] === re && (O[N] = m[N]);
|
|
2580
2602
|
}
|
|
2581
2603
|
var U, F = Object.keys(O);
|
|
2582
2604
|
try {
|
|
2583
2605
|
(function(Z) {
|
|
2584
|
-
Object.keys(Z).forEach(function(
|
|
2585
|
-
var M = Z[
|
|
2586
|
-
if (typeof M(void 0, { type: "@@redux/INIT" }) === te || typeof M(void 0, { type:
|
|
2587
|
-
throw new Error("reducer " +
|
|
2606
|
+
Object.keys(Z).forEach(function(K) {
|
|
2607
|
+
var M = Z[K];
|
|
2608
|
+
if (typeof M(void 0, { type: "@@redux/INIT" }) === te || typeof M(void 0, { type: Ni }) === te)
|
|
2609
|
+
throw new Error("reducer " + K + " " + te);
|
|
2588
2610
|
});
|
|
2589
2611
|
})(O);
|
|
2590
2612
|
} catch (Z) {
|
|
2591
2613
|
U = Z;
|
|
2592
2614
|
}
|
|
2593
|
-
return function(Z,
|
|
2615
|
+
return function(Z, K) {
|
|
2594
2616
|
if (Z === void 0 && (Z = {}), U)
|
|
2595
2617
|
throw U;
|
|
2596
|
-
for (var M = !1, q = {},
|
|
2597
|
-
var
|
|
2598
|
-
if (typeof
|
|
2599
|
-
var
|
|
2600
|
-
throw new Error(
|
|
2618
|
+
for (var M = !1, q = {}, $e = 0; $e < F.length; $e++) {
|
|
2619
|
+
var Fe = F[$e], Ft = Z[Fe], lt = (0, O[Fe])(Ft, K);
|
|
2620
|
+
if (typeof lt === te) {
|
|
2621
|
+
var Er = Di(Fe, K);
|
|
2622
|
+
throw new Error(Er);
|
|
2601
2623
|
}
|
|
2602
|
-
q[
|
|
2624
|
+
q[Fe] = lt, M = M || lt !== Ft;
|
|
2603
2625
|
}
|
|
2604
2626
|
return M ? q : Z;
|
|
2605
2627
|
};
|
|
2606
|
-
}(A({}, j, e)),
|
|
2607
|
-
|
|
2608
|
-
var z = A({}, m, { meta:
|
|
2609
|
-
return
|
|
2628
|
+
}(A({}, j, e)), D, L($(Ui.apply(void 0, P))));
|
|
2629
|
+
T.dispatch = (_ = T.dispatch, function(m, y, O) {
|
|
2630
|
+
var z = A({}, m, { meta: _n(m.meta, y, vt(O)) });
|
|
2631
|
+
return _.apply(null, [z]);
|
|
2610
2632
|
});
|
|
2611
|
-
var
|
|
2612
|
-
|
|
2613
|
-
var
|
|
2633
|
+
var W = Object.keys(a);
|
|
2634
|
+
T.dispatch({ type: x.bootstrap, plugins: W, config: I, params: v, user: S, initialUser: n, persistedUser: E });
|
|
2635
|
+
var J = W.filter(function(m) {
|
|
2614
2636
|
return r.pluginEnabled[m];
|
|
2615
|
-
}),
|
|
2637
|
+
}), Ae = W.filter(function(m) {
|
|
2616
2638
|
return !r.pluginEnabled[m];
|
|
2617
2639
|
});
|
|
2618
|
-
return
|
|
2619
|
-
var O = m.bootstrap, z = m.config,
|
|
2620
|
-
O && V(O) && O({ instance: b, config: z, payload: m }),
|
|
2621
|
-
}),
|
|
2622
|
-
|
|
2640
|
+
return T.dispatch({ type: x.registerPlugins, plugins: W, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, y) {
|
|
2641
|
+
var O = m.bootstrap, z = m.config, N = m.name;
|
|
2642
|
+
O && V(O) && O({ instance: b, config: z, payload: m }), T.dispatch({ type: x.registerPluginType(N), name: N, enabled: r.pluginEnabled[N], plugin: m }), r.pluginsArray.length === y + 1 && T.dispatch({ type: x.initializeStart, plugins: J, disabled: Ae });
|
|
2643
|
+
}), io(function(m) {
|
|
2644
|
+
T.dispatch({ type: m ? x.offline : x.online });
|
|
2623
2645
|
}), function(m, y, O) {
|
|
2624
2646
|
setInterval(function() {
|
|
2625
|
-
return
|
|
2647
|
+
return ar(m, y, O);
|
|
2626
2648
|
}, 3e3);
|
|
2627
|
-
}(
|
|
2649
|
+
}(T, u, b), b;
|
|
2628
2650
|
}
|
|
2629
|
-
var
|
|
2630
|
-
function
|
|
2631
|
-
return
|
|
2651
|
+
var Ye = "before", Ge = "after", Le = "cookie", de = yr(), mr = ct, ao = ct;
|
|
2652
|
+
function gr(t) {
|
|
2653
|
+
return de ? ct(t, "", -1) : Ce(t);
|
|
2632
2654
|
}
|
|
2633
|
-
function
|
|
2634
|
-
if (
|
|
2635
|
-
return
|
|
2655
|
+
function yr() {
|
|
2656
|
+
if (de !== void 0)
|
|
2657
|
+
return de;
|
|
2636
2658
|
var t = "cookiecookie";
|
|
2637
2659
|
try {
|
|
2638
|
-
|
|
2660
|
+
ct(t, t), de = document.cookie.indexOf(t) !== -1, gr(t);
|
|
2639
2661
|
} catch {
|
|
2640
|
-
|
|
2662
|
+
de = !1;
|
|
2641
2663
|
}
|
|
2642
|
-
return
|
|
2664
|
+
return de;
|
|
2643
2665
|
}
|
|
2644
|
-
function
|
|
2666
|
+
function ct(t, e, n, r, i, o) {
|
|
2645
2667
|
if (typeof window < "u") {
|
|
2646
2668
|
var a = arguments.length > 1;
|
|
2647
|
-
return
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
var
|
|
2651
|
-
xe("localStorage", "getItem",
|
|
2652
|
-
xe("localStorage", "setItem",
|
|
2653
|
-
xe("localStorage", "removeItem",
|
|
2654
|
-
var
|
|
2655
|
-
xe("sessionStorage", "getItem",
|
|
2656
|
-
xe("sessionStorage", "setItem",
|
|
2657
|
-
xe("sessionStorage", "removeItem",
|
|
2658
|
-
function
|
|
2669
|
+
return de === !1 && (a ? ve(t, e) : ye(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
var Re = "localStorage", so = Ut.bind(null, "localStorage");
|
|
2673
|
+
xe("localStorage", "getItem", ye);
|
|
2674
|
+
xe("localStorage", "setItem", ve);
|
|
2675
|
+
xe("localStorage", "removeItem", Ce);
|
|
2676
|
+
var Me = "sessionStorage", co = Ut.bind(null, "sessionStorage");
|
|
2677
|
+
xe("sessionStorage", "getItem", ye);
|
|
2678
|
+
xe("sessionStorage", "setItem", ve);
|
|
2679
|
+
xe("sessionStorage", "removeItem", Ce);
|
|
2680
|
+
function Ee(t) {
|
|
2659
2681
|
var e = t;
|
|
2660
2682
|
try {
|
|
2661
2683
|
if ((e = JSON.parse(t)) === "true")
|
|
@@ -2670,57 +2692,57 @@ function _e(t) {
|
|
|
2670
2692
|
if (e !== null && e !== "")
|
|
2671
2693
|
return e;
|
|
2672
2694
|
}
|
|
2673
|
-
var
|
|
2674
|
-
function
|
|
2695
|
+
var uo = so(), lo = co(), ho = yr();
|
|
2696
|
+
function vr(t, e) {
|
|
2675
2697
|
if (t) {
|
|
2676
|
-
var n =
|
|
2677
|
-
if (r && !
|
|
2698
|
+
var n = Lt(e), r = !Wt(n), i = Rt(n) ? Ee(localStorage.getItem(t)) : void 0;
|
|
2699
|
+
if (r && !ke(i))
|
|
2678
2700
|
return i;
|
|
2679
|
-
var o =
|
|
2701
|
+
var o = Mt(n) ? Ee(mr(t)) : void 0;
|
|
2680
2702
|
if (r && o)
|
|
2681
2703
|
return o;
|
|
2682
|
-
var a =
|
|
2704
|
+
var a = Zt(n) ? Ee(sessionStorage.getItem(t)) : void 0;
|
|
2683
2705
|
if (r && a)
|
|
2684
2706
|
return a;
|
|
2685
|
-
var s =
|
|
2707
|
+
var s = ye(t);
|
|
2686
2708
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2687
2709
|
}
|
|
2688
2710
|
}
|
|
2689
|
-
function
|
|
2690
|
-
if (t && !
|
|
2691
|
-
var r = {}, i =
|
|
2692
|
-
return
|
|
2711
|
+
function fo(t, e, n) {
|
|
2712
|
+
if (t && !ke(e)) {
|
|
2713
|
+
var r = {}, i = Lt(n), o = JSON.stringify(e), a = !Wt(i);
|
|
2714
|
+
return Rt(i) && (r[Re] = Be(Re, e, Ee(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Re] : Mt(i) && (r[Le] = Be(Le, e, Ee(mr(t))), ao(t, o), a) ? r[Le] : Zt(i) && (r[Me] = Be(Me, e, Ee(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Me] : (r[Ue] = Be(Ue, e, ye(t)), ve(t, e), a ? r[Ue] : r);
|
|
2693
2715
|
}
|
|
2694
2716
|
}
|
|
2695
|
-
function
|
|
2717
|
+
function po(t, e) {
|
|
2696
2718
|
if (t) {
|
|
2697
|
-
var n =
|
|
2698
|
-
return !
|
|
2719
|
+
var n = Lt(e), r = vr(t, Qn), i = {};
|
|
2720
|
+
return !ke(r.localStorage) && Rt(n) && (localStorage.removeItem(t), i[Re] = r.localStorage), !ke(r.cookie) && Mt(n) && (gr(t), i[Le] = r.cookie), !ke(r.sessionStorage) && Zt(n) && (sessionStorage.removeItem(t), i[Me] = r.sessionStorage), !ke(r.global) && ut(n, Ue) && (Ce(t), i[Ue] = r.global), i;
|
|
2699
2721
|
}
|
|
2700
2722
|
}
|
|
2701
|
-
function Dt(t) {
|
|
2702
|
-
return t ? ie(t) ? t : t.storage : Gn;
|
|
2703
|
-
}
|
|
2704
|
-
function Ut(t) {
|
|
2705
|
-
return so && ct(t, Le);
|
|
2706
|
-
}
|
|
2707
2723
|
function Lt(t) {
|
|
2708
|
-
return
|
|
2724
|
+
return t ? ie(t) ? t : t.storage : qn;
|
|
2709
2725
|
}
|
|
2710
2726
|
function Rt(t) {
|
|
2711
|
-
return
|
|
2727
|
+
return uo && ut(t, Re);
|
|
2712
2728
|
}
|
|
2713
2729
|
function Mt(t) {
|
|
2714
|
-
return
|
|
2730
|
+
return ho && ut(t, Le);
|
|
2731
|
+
}
|
|
2732
|
+
function Zt(t) {
|
|
2733
|
+
return lo && ut(t, Me);
|
|
2715
2734
|
}
|
|
2716
|
-
function
|
|
2717
|
-
return t ===
|
|
2735
|
+
function Wt(t) {
|
|
2736
|
+
return t === Qn || t === "all";
|
|
2718
2737
|
}
|
|
2719
|
-
function
|
|
2738
|
+
function ut(t, e) {
|
|
2739
|
+
return t === qn || t === e || Wt(t);
|
|
2740
|
+
}
|
|
2741
|
+
function Be(t, e, n) {
|
|
2720
2742
|
return { location: t, current: e, previous: n };
|
|
2721
2743
|
}
|
|
2722
|
-
var
|
|
2723
|
-
function
|
|
2744
|
+
var mo = { setItem: fo, getItem: vr, removeItem: po };
|
|
2745
|
+
function go(t, e, n) {
|
|
2724
2746
|
return e in t ? Object.defineProperty(t, e, {
|
|
2725
2747
|
value: n,
|
|
2726
2748
|
enumerable: !0,
|
|
@@ -2728,7 +2750,7 @@ function po(t, e, n) {
|
|
|
2728
2750
|
writable: !0
|
|
2729
2751
|
}) : t[e] = n, t;
|
|
2730
2752
|
}
|
|
2731
|
-
function
|
|
2753
|
+
function En(t, e) {
|
|
2732
2754
|
var n = Object.keys(t);
|
|
2733
2755
|
if (Object.getOwnPropertySymbols) {
|
|
2734
2756
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2738,24 +2760,24 @@ function Sn(t, e) {
|
|
|
2738
2760
|
}
|
|
2739
2761
|
return n;
|
|
2740
2762
|
}
|
|
2741
|
-
function
|
|
2763
|
+
function Tn(t) {
|
|
2742
2764
|
for (var e = 1; e < arguments.length; e++) {
|
|
2743
2765
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2744
|
-
e % 2 ?
|
|
2745
|
-
|
|
2746
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2766
|
+
e % 2 ? En(Object(n), !0).forEach(function(r) {
|
|
2767
|
+
go(t, r, n[r]);
|
|
2768
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : En(Object(n)).forEach(function(r) {
|
|
2747
2769
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2748
2770
|
});
|
|
2749
2771
|
}
|
|
2750
2772
|
return t;
|
|
2751
2773
|
}
|
|
2752
|
-
function
|
|
2774
|
+
function yo() {
|
|
2753
2775
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2754
|
-
storage:
|
|
2776
|
+
storage: mo
|
|
2755
2777
|
};
|
|
2756
|
-
return
|
|
2778
|
+
return oo(Tn(Tn({}, e), t));
|
|
2757
2779
|
}
|
|
2758
|
-
function
|
|
2780
|
+
function vo(t, e) {
|
|
2759
2781
|
e = e || {};
|
|
2760
2782
|
var n, r, i = [], o = e.max || 1 / 0;
|
|
2761
2783
|
function a() {
|
|
@@ -2777,7 +2799,7 @@ function go(t, e) {
|
|
|
2777
2799
|
}
|
|
2778
2800
|
};
|
|
2779
2801
|
}
|
|
2780
|
-
function
|
|
2802
|
+
function wo(t) {
|
|
2781
2803
|
if (typeof window > "u")
|
|
2782
2804
|
return;
|
|
2783
2805
|
const { addEventListener: e, history: n, location: r } = window;
|
|
@@ -2789,53 +2811,53 @@ function yo(t) {
|
|
|
2789
2811
|
const s = n[a];
|
|
2790
2812
|
n[a] = function(...h) {
|
|
2791
2813
|
var c;
|
|
2792
|
-
const p = ((c = h[2]) == null ? void 0 : c.toString()) || "", u =
|
|
2814
|
+
const p = ((c = h[2]) == null ? void 0 : c.toString()) || "", u = ko(p);
|
|
2793
2815
|
return i !== u && (i = u, setTimeout(() => t(p), 0)), s.apply(n, h);
|
|
2794
2816
|
};
|
|
2795
2817
|
});
|
|
2796
2818
|
}
|
|
2797
|
-
function
|
|
2819
|
+
function bo(t, e) {
|
|
2798
2820
|
const n = t.indexOf(e);
|
|
2799
2821
|
return n > -1 ? t.slice(0, n) : t;
|
|
2800
2822
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return ["#", "?"].forEach((e) => t =
|
|
2823
|
+
function ko(t) {
|
|
2824
|
+
return ["#", "?"].forEach((e) => t = bo(t, e)), t;
|
|
2803
2825
|
}
|
|
2804
|
-
function
|
|
2805
|
-
|
|
2826
|
+
function Io() {
|
|
2827
|
+
wo(() => {
|
|
2806
2828
|
ee.page();
|
|
2807
2829
|
});
|
|
2808
2830
|
}
|
|
2809
|
-
function
|
|
2810
|
-
if (t === void 0 && (t = {}), !
|
|
2811
|
-
return
|
|
2812
|
-
var e =
|
|
2831
|
+
function So(t) {
|
|
2832
|
+
if (t === void 0 && (t = {}), !H)
|
|
2833
|
+
return Tt;
|
|
2834
|
+
var e = Pn(), n = jt(), r = On(), i = qe(r, e), o = qe(n, e), a = [], s = [], h = [], p = r, u = i, c = o, f = Object.keys(t);
|
|
2813
2835
|
if (!f.length)
|
|
2814
|
-
return
|
|
2836
|
+
return Tt;
|
|
2815
2837
|
var d = f.map(function(k) {
|
|
2816
2838
|
return Number(k);
|
|
2817
|
-
}), w =
|
|
2818
|
-
var k =
|
|
2819
|
-
return
|
|
2820
|
-
return
|
|
2839
|
+
}), w = zi(function() {
|
|
2840
|
+
var k = Pn(), v = function(I, C) {
|
|
2841
|
+
return C.map(function(D) {
|
|
2842
|
+
return D === 100 ? I - 5 : I * (D / 100);
|
|
2821
2843
|
});
|
|
2822
|
-
}(k, d),
|
|
2844
|
+
}(k, d), E = jt(), S = On(), g = qe(S, k), l = qe(E, k);
|
|
2823
2845
|
if (u = g > u ? g : u, c = l < c ? l : c, !(a.length >= d.length)) {
|
|
2824
|
-
var b = p === S,
|
|
2825
|
-
b ?
|
|
2846
|
+
var b = p === S, P = "up";
|
|
2847
|
+
b ? P = "initial" : p <= S && (P = "down");
|
|
2826
2848
|
var j = v, $ = d;
|
|
2827
|
-
(
|
|
2828
|
-
var L = $.reduce(function(
|
|
2829
|
-
var
|
|
2830
|
-
return h.includes(
|
|
2831
|
-
return
|
|
2832
|
-
}),
|
|
2833
|
-
}, { foundFunc: [], singleFunction: null, callbacks: [], direction:
|
|
2834
|
-
if (p = S,
|
|
2835
|
-
V(t[
|
|
2849
|
+
(P === "up" || b) && (j = v.slice().reverse(), $ = d.slice().reverse());
|
|
2850
|
+
var L = $.reduce(function(I, C, D) {
|
|
2851
|
+
var T = j[D];
|
|
2852
|
+
return h.includes(C) && S <= T && (h = h.filter(function(W) {
|
|
2853
|
+
return W !== C;
|
|
2854
|
+
}), I.singleFunction = C), P === "down" && !a.includes(C) && S >= T && C > o ? (s.push(C), I.callbacks = I.callbacks.concat(C), I) : P === "up" && !a.includes(C) && S <= T && C <= g ? (I.foundFunc = [C], I) : (b && S >= T && I.foundFunc.length === 0 && (I.foundFunc = [C]), !s.includes(C) && S >= T && (s.push(C), I.singleFunction ? h.push(C) : I.singleFunction = C), I);
|
|
2855
|
+
}, { foundFunc: [], singleFunction: null, callbacks: [], direction: P });
|
|
2856
|
+
if (p = S, P === "down" && L.callbacks && L.callbacks.forEach(function(I) {
|
|
2857
|
+
V(t[I]) && (t[I]({ trigger: I, direction: P, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(I));
|
|
2836
2858
|
}), L.singleFunction) {
|
|
2837
|
-
var
|
|
2838
|
-
V(t[
|
|
2859
|
+
var R = L.singleFunction, _ = L.direction;
|
|
2860
|
+
V(t[R]) && t[R]({ trigger: R, direction: _, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(R);
|
|
2839
2861
|
}
|
|
2840
2862
|
}
|
|
2841
2863
|
}, 500);
|
|
@@ -2843,31 +2865,31 @@ function ko(t) {
|
|
|
2843
2865
|
return window.removeEventListener("scroll", w);
|
|
2844
2866
|
};
|
|
2845
2867
|
}
|
|
2846
|
-
function
|
|
2847
|
-
return
|
|
2848
|
-
}
|
|
2849
|
-
function Io() {
|
|
2850
|
-
return J ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2868
|
+
function jt() {
|
|
2869
|
+
return H ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
2851
2870
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return
|
|
2871
|
+
function _o() {
|
|
2872
|
+
return H ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2854
2873
|
}
|
|
2855
2874
|
function On() {
|
|
2856
|
-
|
|
2875
|
+
return Math.round(jt() + _o());
|
|
2876
|
+
}
|
|
2877
|
+
function Pn() {
|
|
2878
|
+
if (!H)
|
|
2857
2879
|
return 0;
|
|
2858
2880
|
var t = document.body, e = document.documentElement;
|
|
2859
2881
|
return Math.max(t.scrollHeight, t.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight);
|
|
2860
2882
|
}
|
|
2861
|
-
function
|
|
2883
|
+
function qe(t, e) {
|
|
2862
2884
|
return Math.round(t / e * 100);
|
|
2863
2885
|
}
|
|
2864
|
-
var
|
|
2865
|
-
function
|
|
2886
|
+
var jn = "EventListener";
|
|
2887
|
+
function Eo(t) {
|
|
2866
2888
|
return function(e, n, r, i) {
|
|
2867
|
-
var o = r ||
|
|
2868
|
-
if (!
|
|
2889
|
+
var o = r || Tt, a = i || !1;
|
|
2890
|
+
if (!H)
|
|
2869
2891
|
return o;
|
|
2870
|
-
var s =
|
|
2892
|
+
var s = rt(n), h = rt(e, !0);
|
|
2871
2893
|
if (!h.length)
|
|
2872
2894
|
throw new Error("noElements");
|
|
2873
2895
|
if (!s.length)
|
|
@@ -2875,9 +2897,9 @@ function So(t) {
|
|
|
2875
2897
|
var p = [];
|
|
2876
2898
|
return function u(c) {
|
|
2877
2899
|
c && (p = []);
|
|
2878
|
-
for (var f = c ? "add" +
|
|
2900
|
+
for (var f = c ? "add" + jn : "remove" + jn, d = 0; d < h.length; d++) {
|
|
2879
2901
|
var w = h[d];
|
|
2880
|
-
p[d] = c ? a && a.once ?
|
|
2902
|
+
p[d] = c ? a && a.once ? To(o) : o : p[d] || o;
|
|
2881
2903
|
for (var k = 0; k < s.length; k++)
|
|
2882
2904
|
w[f] ? w["on" + s[k]] = c ? p[d] : null : w[f](s[k], p[d], a);
|
|
2883
2905
|
}
|
|
@@ -2885,9 +2907,9 @@ function So(t) {
|
|
|
2885
2907
|
}(t);
|
|
2886
2908
|
};
|
|
2887
2909
|
}
|
|
2888
|
-
function
|
|
2910
|
+
function rt(t, e) {
|
|
2889
2911
|
if (ie(t))
|
|
2890
|
-
return e ?
|
|
2912
|
+
return e ? rt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2891
2913
|
return a.trim();
|
|
2892
2914
|
});
|
|
2893
2915
|
var n;
|
|
@@ -2896,31 +2918,31 @@ function tt(t, e) {
|
|
|
2896
2918
|
r[i] = t[i];
|
|
2897
2919
|
return r;
|
|
2898
2920
|
}
|
|
2899
|
-
var o =
|
|
2921
|
+
var o = ji(t);
|
|
2900
2922
|
return e ? o.map(function(a) {
|
|
2901
|
-
return ie(a) ?
|
|
2923
|
+
return ie(a) ? rt(a, !0) : a;
|
|
2902
2924
|
}).flat() : o;
|
|
2903
2925
|
}
|
|
2904
|
-
function
|
|
2926
|
+
function To(t, e) {
|
|
2905
2927
|
var n;
|
|
2906
2928
|
return function() {
|
|
2907
2929
|
return t && (n = t.apply(e || this, arguments), t = null), n;
|
|
2908
2930
|
};
|
|
2909
2931
|
}
|
|
2910
|
-
var
|
|
2911
|
-
function
|
|
2912
|
-
return
|
|
2932
|
+
var wt = Eo("Event");
|
|
2933
|
+
function wr(t, e) {
|
|
2934
|
+
return H && V(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), V(n) ? function() {
|
|
2913
2935
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2914
2936
|
} : r) : window[t] = e;
|
|
2915
2937
|
var n, r, i;
|
|
2916
2938
|
}
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
var
|
|
2920
|
-
function
|
|
2921
|
-
if (
|
|
2939
|
+
wr.bind(null, "onerror");
|
|
2940
|
+
wr.bind(null, "onload");
|
|
2941
|
+
var br = typeof window > "u", Cn = "hidden";
|
|
2942
|
+
function Oo(t) {
|
|
2943
|
+
if (br)
|
|
2922
2944
|
return !1;
|
|
2923
|
-
var e =
|
|
2945
|
+
var e = Po(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2924
2946
|
return t(!!document[e]);
|
|
2925
2947
|
}, i = function() {
|
|
2926
2948
|
return document.addEventListener(n, r);
|
|
@@ -2929,15 +2951,15 @@ function Eo(t) {
|
|
|
2929
2951
|
return document.removeEventListener(n, r), i;
|
|
2930
2952
|
};
|
|
2931
2953
|
}
|
|
2932
|
-
function
|
|
2954
|
+
function Po() {
|
|
2933
2955
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2934
|
-
return
|
|
2956
|
+
return br || Cn in document ? Cn : t.reduce(function(e, n) {
|
|
2935
2957
|
var r = n + "Hidden";
|
|
2936
2958
|
return !e && r in document ? r : e;
|
|
2937
2959
|
}, null);
|
|
2938
2960
|
}
|
|
2939
|
-
var
|
|
2940
|
-
function
|
|
2961
|
+
var jo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
|
|
2962
|
+
function Co(t, e) {
|
|
2941
2963
|
e === void 0 && (e = {});
|
|
2942
2964
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2943
2965
|
var h = this, p = !1;
|
|
@@ -2948,12 +2970,12 @@ function Po(t, e) {
|
|
|
2948
2970
|
};
|
|
2949
2971
|
}(t, e.throttle || 1e4), r = [];
|
|
2950
2972
|
function i() {
|
|
2951
|
-
var a =
|
|
2973
|
+
var a = Oo(function(s) {
|
|
2952
2974
|
s || n({ type: "tabVisible" });
|
|
2953
2975
|
});
|
|
2954
|
-
return r = [a].concat(
|
|
2955
|
-
return
|
|
2956
|
-
})).concat(
|
|
2976
|
+
return r = [a].concat(jo.map(function(s) {
|
|
2977
|
+
return wt(document, s, n);
|
|
2978
|
+
})).concat(wt(window, "load", n)).concat(wt(window, "scroll", n, { capture: !0, passive: !0 })), o;
|
|
2957
2979
|
}
|
|
2958
2980
|
function o() {
|
|
2959
2981
|
r.map(function(a) {
|
|
@@ -2964,16 +2986,16 @@ function Po(t, e) {
|
|
|
2964
2986
|
return o(), i;
|
|
2965
2987
|
};
|
|
2966
2988
|
}
|
|
2967
|
-
function
|
|
2989
|
+
function xo(t) {
|
|
2968
2990
|
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, h = t.throttle, p = h === void 0 ? 2e3 : h, u = !1, c = !1, f = /* @__PURE__ */ new Date(), d = function() {
|
|
2969
2991
|
return clearTimeout(e);
|
|
2970
2992
|
};
|
|
2971
2993
|
function w(v) {
|
|
2972
|
-
d(), o && !u && o(
|
|
2973
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
2994
|
+
d(), o && !u && o(Ne(f), v), i && u && (u = !1, i(Ne(n), v), f = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
2995
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ne(f), v));
|
|
2974
2996
|
}, s);
|
|
2975
2997
|
}
|
|
2976
|
-
var k =
|
|
2998
|
+
var k = Co(w, { throttle: p });
|
|
2977
2999
|
return { disable: function() {
|
|
2978
3000
|
c = !0, u = !1, d();
|
|
2979
3001
|
var v = k();
|
|
@@ -2981,14 +3003,14 @@ function jo(t) {
|
|
|
2981
3003
|
return c = !1, f = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
|
|
2982
3004
|
};
|
|
2983
3005
|
}, getStatus: function() {
|
|
2984
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 :
|
|
3006
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : Ne(f, c), idle: u ? Ne(n, c) : 0 };
|
|
2985
3007
|
} };
|
|
2986
3008
|
}
|
|
2987
|
-
function
|
|
3009
|
+
function Ne(t, e) {
|
|
2988
3010
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
2989
3011
|
}
|
|
2990
|
-
const
|
|
2991
|
-
class
|
|
3012
|
+
const xn = 5e3;
|
|
3013
|
+
class Ao {
|
|
2992
3014
|
constructor(e) {
|
|
2993
3015
|
B(this, "element");
|
|
2994
3016
|
B(this, "isInViewport", !1);
|
|
@@ -3010,11 +3032,11 @@ class xo {
|
|
|
3010
3032
|
{
|
|
3011
3033
|
threshold: 0
|
|
3012
3034
|
}
|
|
3013
|
-
), this.observer.observe(this.element),
|
|
3035
|
+
), this.observer.observe(this.element), xo({
|
|
3014
3036
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
3015
3037
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
3016
|
-
timeout:
|
|
3017
|
-
}),
|
|
3038
|
+
timeout: xn
|
|
3039
|
+
}), So({
|
|
3018
3040
|
25: this.handleScroll.bind(this),
|
|
3019
3041
|
50: this.handleScroll.bind(this),
|
|
3020
3042
|
75: this.handleScroll.bind(this),
|
|
@@ -3032,7 +3054,7 @@ class xo {
|
|
|
3032
3054
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
3033
3055
|
}
|
|
3034
3056
|
handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
3035
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
3057
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * xn : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
3036
3058
|
}
|
|
3037
3059
|
handleScroll(e) {
|
|
3038
3060
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -3049,17 +3071,17 @@ class xo {
|
|
|
3049
3071
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
3050
3072
|
}
|
|
3051
3073
|
}
|
|
3052
|
-
const
|
|
3053
|
-
function
|
|
3054
|
-
let t = sessionStorage.getItem(
|
|
3055
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
3074
|
+
const An = "sesamy_session_id";
|
|
3075
|
+
function $o() {
|
|
3076
|
+
let t = sessionStorage.getItem(An);
|
|
3077
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(An, t)), t;
|
|
3056
3078
|
}
|
|
3057
|
-
let
|
|
3058
|
-
function
|
|
3059
|
-
if (
|
|
3079
|
+
let kr = !1, Ct, $n, it;
|
|
3080
|
+
function zo({ clientId: t, enabled: e = !0, endpoint: n = Qr }) {
|
|
3081
|
+
if (Ct = t, $n = e, it = n, !$n)
|
|
3060
3082
|
return;
|
|
3061
|
-
|
|
3062
|
-
const r = new
|
|
3083
|
+
Io();
|
|
3084
|
+
const r = new Ao({
|
|
3063
3085
|
element: document.body,
|
|
3064
3086
|
viewCallback: () => {
|
|
3065
3087
|
ee.page();
|
|
@@ -3084,26 +3106,26 @@ function Ao({ clientId: t, enabled: e = !0, endpoint: n = Br }) {
|
|
|
3084
3106
|
});
|
|
3085
3107
|
}
|
|
3086
3108
|
});
|
|
3087
|
-
|
|
3109
|
+
Uo(document.body, () => {
|
|
3088
3110
|
r.flush();
|
|
3089
|
-
}),
|
|
3111
|
+
}), Lo(document.body, () => {
|
|
3090
3112
|
r.handleVisibilityChange();
|
|
3091
|
-
}), window.addEventListener(
|
|
3113
|
+
}), window.addEventListener(ae.AUTHENTICATED, async (i) => {
|
|
3092
3114
|
const o = i;
|
|
3093
3115
|
await ee.identify(o.detail.sub);
|
|
3094
|
-
}), window.addEventListener(
|
|
3095
|
-
await ee.track("logout", {}),
|
|
3116
|
+
}), window.addEventListener(ae.LOGOUT, async () => {
|
|
3117
|
+
await ee.track("logout", {}), Kt.flush(), await ee.reset();
|
|
3096
3118
|
});
|
|
3097
3119
|
}
|
|
3098
|
-
function
|
|
3120
|
+
function Ir(t) {
|
|
3099
3121
|
return JSON.stringify(
|
|
3100
3122
|
t.map((e) => ({
|
|
3101
3123
|
...e,
|
|
3102
|
-
clientId:
|
|
3124
|
+
clientId: Ct,
|
|
3103
3125
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
3104
|
-
sessionId:
|
|
3126
|
+
sessionId: $o(),
|
|
3105
3127
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3106
|
-
version:
|
|
3128
|
+
version: Dt,
|
|
3107
3129
|
event: e.event,
|
|
3108
3130
|
context: {
|
|
3109
3131
|
page: {
|
|
@@ -3114,18 +3136,18 @@ function br(t) {
|
|
|
3114
3136
|
referrer: document.referrer
|
|
3115
3137
|
},
|
|
3116
3138
|
locale: navigator.language,
|
|
3117
|
-
library:
|
|
3139
|
+
library: Bn,
|
|
3118
3140
|
userAgent: navigator.userAgent,
|
|
3119
|
-
clientId:
|
|
3141
|
+
clientId: Ct
|
|
3120
3142
|
}
|
|
3121
3143
|
}))
|
|
3122
3144
|
);
|
|
3123
3145
|
}
|
|
3124
|
-
const
|
|
3146
|
+
const Kt = vo(
|
|
3125
3147
|
async (t) => {
|
|
3126
3148
|
if (t.length > 0) {
|
|
3127
|
-
const e =
|
|
3128
|
-
|
|
3149
|
+
const e = Ir(t);
|
|
3150
|
+
kr ? navigator.sendBeacon(it, e) : (await fetch(it, {
|
|
3129
3151
|
method: "POST",
|
|
3130
3152
|
body: e,
|
|
3131
3153
|
headers: {
|
|
@@ -3141,24 +3163,24 @@ const Zt = go(
|
|
|
3141
3163
|
// 3s
|
|
3142
3164
|
}
|
|
3143
3165
|
);
|
|
3144
|
-
function
|
|
3166
|
+
function bt(t) {
|
|
3145
3167
|
var e;
|
|
3146
3168
|
if (t.anonymousId)
|
|
3147
3169
|
if ((e = t.properties) != null && e.flushing) {
|
|
3148
3170
|
const n = { ...t };
|
|
3149
|
-
delete n.properties.flushing, navigator.sendBeacon(
|
|
3171
|
+
delete n.properties.flushing, navigator.sendBeacon(it, Ir([n]));
|
|
3150
3172
|
} else
|
|
3151
|
-
|
|
3173
|
+
Kt.push(t);
|
|
3152
3174
|
}
|
|
3153
|
-
const ee =
|
|
3154
|
-
app:
|
|
3155
|
-
version:
|
|
3175
|
+
const ee = yo({
|
|
3176
|
+
app: Bn,
|
|
3177
|
+
version: Dt,
|
|
3156
3178
|
plugins: [
|
|
3157
3179
|
{
|
|
3158
3180
|
name: "custom-analytics-plugin",
|
|
3159
3181
|
page: ({ payload: t }) => {
|
|
3160
3182
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
3161
|
-
|
|
3183
|
+
bt({
|
|
3162
3184
|
anonymousId: n,
|
|
3163
3185
|
userId: r,
|
|
3164
3186
|
properties: e,
|
|
@@ -3168,7 +3190,7 @@ const ee = mo({
|
|
|
3168
3190
|
},
|
|
3169
3191
|
track: ({ payload: t }) => {
|
|
3170
3192
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
3171
|
-
|
|
3193
|
+
bt({
|
|
3172
3194
|
anonymousId: n,
|
|
3173
3195
|
userId: r,
|
|
3174
3196
|
properties: e,
|
|
@@ -3178,7 +3200,7 @@ const ee = mo({
|
|
|
3178
3200
|
},
|
|
3179
3201
|
identify: ({ payload: t }) => {
|
|
3180
3202
|
const { properties: e, anonymousId: n, userId: r } = t;
|
|
3181
|
-
|
|
3203
|
+
bt({
|
|
3182
3204
|
anonymousId: n,
|
|
3183
3205
|
userId: r,
|
|
3184
3206
|
properties: e,
|
|
@@ -3188,31 +3210,31 @@ const ee = mo({
|
|
|
3188
3210
|
}
|
|
3189
3211
|
]
|
|
3190
3212
|
});
|
|
3191
|
-
function
|
|
3213
|
+
function No(t, e) {
|
|
3192
3214
|
ee.track(t, e);
|
|
3193
3215
|
}
|
|
3194
|
-
function
|
|
3195
|
-
return
|
|
3216
|
+
function Do() {
|
|
3217
|
+
return kr = !0, Kt.flush();
|
|
3196
3218
|
}
|
|
3197
|
-
const
|
|
3198
|
-
function
|
|
3199
|
-
|
|
3219
|
+
const Sr = /* @__PURE__ */ new Map();
|
|
3220
|
+
function Uo(t, e) {
|
|
3221
|
+
Sr.set(t, e);
|
|
3200
3222
|
}
|
|
3201
3223
|
window.addEventListener("beforeunload", () => {
|
|
3202
|
-
|
|
3224
|
+
Sr.forEach((t, e) => {
|
|
3203
3225
|
t.bind(e)();
|
|
3204
|
-
}),
|
|
3226
|
+
}), Do();
|
|
3205
3227
|
});
|
|
3206
|
-
const
|
|
3207
|
-
function
|
|
3208
|
-
|
|
3228
|
+
const _r = /* @__PURE__ */ new Map();
|
|
3229
|
+
function Lo(t, e) {
|
|
3230
|
+
_r.set(t, e);
|
|
3209
3231
|
}
|
|
3210
3232
|
window.addEventListener("visibilitychange", () => {
|
|
3211
|
-
document.visibilityState !== "visible" &&
|
|
3233
|
+
document.visibilityState !== "visible" && _r.forEach((t, e) => {
|
|
3212
3234
|
t.bind(e)();
|
|
3213
3235
|
});
|
|
3214
3236
|
});
|
|
3215
|
-
function
|
|
3237
|
+
function Ro(t) {
|
|
3216
3238
|
const {
|
|
3217
3239
|
getEntitlement: e,
|
|
3218
3240
|
getEntitlements: n,
|
|
@@ -3230,20 +3252,20 @@ function Uo(t) {
|
|
|
3230
3252
|
deleteUserMetadata: w,
|
|
3231
3253
|
getTally: k,
|
|
3232
3254
|
getTallies: v,
|
|
3233
|
-
pushTally:
|
|
3255
|
+
pushTally: E,
|
|
3234
3256
|
deleteTally: S,
|
|
3235
3257
|
getProduct: g,
|
|
3236
3258
|
autoOnboardProduct: l
|
|
3237
|
-
} =
|
|
3259
|
+
} = wi(t), b = {
|
|
3238
3260
|
auth: {
|
|
3239
|
-
getUser:
|
|
3240
|
-
isAuthenticated:
|
|
3241
|
-
loginWithRedirect:
|
|
3242
|
-
logout:
|
|
3243
|
-
setToken:
|
|
3261
|
+
getUser: ni,
|
|
3262
|
+
isAuthenticated: ti,
|
|
3263
|
+
loginWithRedirect: ri,
|
|
3264
|
+
logout: oi,
|
|
3265
|
+
setToken: Xn
|
|
3244
3266
|
},
|
|
3245
3267
|
analytics: {
|
|
3246
|
-
track:
|
|
3268
|
+
track: No
|
|
3247
3269
|
},
|
|
3248
3270
|
tags: {
|
|
3249
3271
|
list: h,
|
|
@@ -3272,51 +3294,52 @@ function Uo(t) {
|
|
|
3272
3294
|
tallies: {
|
|
3273
3295
|
get: k,
|
|
3274
3296
|
list: v,
|
|
3275
|
-
push:
|
|
3297
|
+
push: E,
|
|
3276
3298
|
delete: S
|
|
3277
3299
|
},
|
|
3278
3300
|
products: {
|
|
3279
3301
|
get: g,
|
|
3280
3302
|
autoOnboard: l
|
|
3281
3303
|
},
|
|
3282
|
-
getVersion:
|
|
3304
|
+
getVersion: Mo,
|
|
3305
|
+
clearCache: ue
|
|
3283
3306
|
};
|
|
3284
3307
|
return t.namespace && (window[t.namespace] = b), b;
|
|
3285
3308
|
}
|
|
3286
|
-
function
|
|
3287
|
-
return
|
|
3309
|
+
function Mo() {
|
|
3310
|
+
return Dt;
|
|
3288
3311
|
}
|
|
3289
|
-
function
|
|
3312
|
+
function Zo() {
|
|
3290
3313
|
const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
|
|
3291
3314
|
if (e && n) {
|
|
3292
|
-
|
|
3315
|
+
Xn(e, parseInt(n, 10));
|
|
3293
3316
|
const r = new URL(window.location.href);
|
|
3294
3317
|
t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
|
|
3295
3318
|
}
|
|
3296
3319
|
}
|
|
3297
|
-
async function
|
|
3298
|
-
|
|
3320
|
+
async function Wo(t) {
|
|
3321
|
+
zo({
|
|
3299
3322
|
clientId: t.clientId,
|
|
3300
3323
|
// The default client id can be overridden by the config
|
|
3301
3324
|
...t.analytics
|
|
3302
|
-
}), await
|
|
3325
|
+
}), await ei({
|
|
3303
3326
|
clientId: t.clientId,
|
|
3304
3327
|
// The default client id can be overridden by the config
|
|
3305
3328
|
...t.auth
|
|
3306
3329
|
});
|
|
3307
|
-
const e =
|
|
3308
|
-
return
|
|
3330
|
+
const e = Ro(t.api || {});
|
|
3331
|
+
return We(ae.READY, {}), Zo(), e;
|
|
3309
3332
|
}
|
|
3310
3333
|
if (typeof document < "u") {
|
|
3311
3334
|
const t = document.getElementById("sesamy-js");
|
|
3312
3335
|
if (t != null && t.textContent)
|
|
3313
3336
|
try {
|
|
3314
3337
|
const e = JSON.parse(t.textContent);
|
|
3315
|
-
|
|
3338
|
+
Wo(e);
|
|
3316
3339
|
} catch (e) {
|
|
3317
3340
|
console.error("Failed to parse config", e);
|
|
3318
3341
|
}
|
|
3319
3342
|
}
|
|
3320
3343
|
export {
|
|
3321
|
-
|
|
3344
|
+
Wo as init
|
|
3322
3345
|
};
|