@sesamy/sesamy-js 1.0.1 → 1.0.3
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 +19 -4
- package/dist/sesamy-js.es.js +688 -663
- package/dist/sesamy-js.umd.js +6 -6
- package/package.json +3 -2
package/dist/sesamy-js.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Y = (t, e, n) => (
|
|
1
|
+
var rr = Object.defineProperty;
|
|
2
|
+
var ir = (t, e, n) => e in t ? rr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var Y = (t, e, n) => (ir(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
(function() {
|
|
5
5
|
const e = document.createElement("link").relList;
|
|
6
6
|
if (e && e.supports && e.supports("modulepreload"))
|
|
@@ -25,16 +25,15 @@ var Y = (t, e, n) => (nr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
|
25
25
|
fetch(i.href, o);
|
|
26
26
|
}
|
|
27
27
|
})();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
detail: {},
|
|
28
|
+
function It(t, e) {
|
|
29
|
+
const n = new CustomEvent(t, {
|
|
30
|
+
detail: e,
|
|
32
31
|
bubbles: !0,
|
|
33
32
|
composed: !0
|
|
34
33
|
});
|
|
35
|
-
dispatchEvent(
|
|
34
|
+
dispatchEvent(n);
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function Q(t, e) {
|
|
38
37
|
var n = {};
|
|
39
38
|
for (var r in t)
|
|
40
39
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
@@ -45,14 +44,14 @@ function q(t, e) {
|
|
|
45
44
|
}
|
|
46
45
|
return n;
|
|
47
46
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
47
|
+
var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
48
|
+
function St(t) {
|
|
50
49
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
51
50
|
}
|
|
52
|
-
function
|
|
51
|
+
function _t(t, e) {
|
|
53
52
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
54
53
|
}
|
|
55
|
-
var oe =
|
|
54
|
+
var oe = _t(function(t, e) {
|
|
56
55
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
57
56
|
var n = function() {
|
|
58
57
|
function r() {
|
|
@@ -83,9 +82,9 @@ var oe = kt(function(t, e) {
|
|
|
83
82
|
return n.getInstance();
|
|
84
83
|
};
|
|
85
84
|
});
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
var n =
|
|
85
|
+
St(oe);
|
|
86
|
+
var or = St(_t(function(t, e) {
|
|
87
|
+
var n = se && se.__awaiter || function(u, c, d, h) {
|
|
89
88
|
return new (d || (d = Promise))(function(v, w) {
|
|
90
89
|
function y(I) {
|
|
91
90
|
try {
|
|
@@ -108,7 +107,7 @@ var ir = bt(kt(function(t, e) {
|
|
|
108
107
|
}
|
|
109
108
|
_((h = h.apply(u, c || [])).next());
|
|
110
109
|
});
|
|
111
|
-
}, r =
|
|
110
|
+
}, r = se && se.__generator || function(u, c) {
|
|
112
111
|
var d, h, v, w, y = { label: 0, sent: function() {
|
|
113
112
|
if (1 & v[0])
|
|
114
113
|
throw v[1];
|
|
@@ -171,7 +170,7 @@ var ir = bt(kt(function(t, e) {
|
|
|
171
170
|
}([_, I]);
|
|
172
171
|
};
|
|
173
172
|
}
|
|
174
|
-
}, i =
|
|
173
|
+
}, i = se;
|
|
175
174
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
176
175
|
var o = "browser-tabs-lock-key", a = { key: function(u) {
|
|
177
176
|
return n(i, void 0, void 0, function() {
|
|
@@ -352,63 +351,63 @@ var ir = bt(kt(function(t, e) {
|
|
|
352
351
|
}();
|
|
353
352
|
e.default = m;
|
|
354
353
|
}));
|
|
355
|
-
const
|
|
356
|
-
let J = class
|
|
354
|
+
const ar = { timeoutInSeconds: 60 }, gn = { name: "auth0-spa-js", version: "2.1.3" }, vn = () => Date.now();
|
|
355
|
+
let J = class mt extends Error {
|
|
357
356
|
constructor(e, n) {
|
|
358
|
-
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this,
|
|
357
|
+
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, mt.prototype);
|
|
359
358
|
}
|
|
360
359
|
static fromPayload({ error: e, error_description: n }) {
|
|
361
|
-
return new
|
|
360
|
+
return new mt(e, n);
|
|
362
361
|
}
|
|
363
|
-
},
|
|
362
|
+
}, sr = class yn extends J {
|
|
364
363
|
constructor(e, n, r, i = null) {
|
|
365
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
364
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, yn.prototype);
|
|
366
365
|
}
|
|
367
|
-
},
|
|
366
|
+
}, gt = class wn extends J {
|
|
368
367
|
constructor() {
|
|
369
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
368
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, wn.prototype);
|
|
370
369
|
}
|
|
371
|
-
},
|
|
370
|
+
}, cr = class bn extends gt {
|
|
372
371
|
constructor(e) {
|
|
373
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
372
|
+
super(), this.popup = e, Object.setPrototypeOf(this, bn.prototype);
|
|
374
373
|
}
|
|
375
|
-
},
|
|
374
|
+
}, ur = class kn extends J {
|
|
376
375
|
constructor(e) {
|
|
377
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
376
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, kn.prototype);
|
|
378
377
|
}
|
|
379
|
-
},
|
|
378
|
+
}, lr = class In extends J {
|
|
380
379
|
constructor(e, n, r) {
|
|
381
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
380
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, In.prototype);
|
|
382
381
|
}
|
|
383
|
-
},
|
|
382
|
+
}, Sn = class _n extends J {
|
|
384
383
|
constructor(e, n) {
|
|
385
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
384
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${zt(e, ["default"])}', scope: '${zt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, _n.prototype);
|
|
386
385
|
}
|
|
387
386
|
};
|
|
388
|
-
function
|
|
387
|
+
function zt(t, e = []) {
|
|
389
388
|
return t && !e.includes(t) ? t : "";
|
|
390
389
|
}
|
|
391
|
-
const
|
|
390
|
+
const Je = () => window.crypto, ot = () => {
|
|
392
391
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
393
392
|
let e = "";
|
|
394
|
-
return Array.from(
|
|
395
|
-
},
|
|
396
|
-
var { clientId: e } = t, n =
|
|
393
|
+
return Array.from(Je().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
394
|
+
}, Nt = (t) => btoa(t), vt = (t) => {
|
|
395
|
+
var { clientId: e } = t, n = Q(t, ["clientId"]);
|
|
397
396
|
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();
|
|
398
|
-
},
|
|
397
|
+
}, At = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), dr = async (t, e) => {
|
|
399
398
|
const n = await fetch(t, e);
|
|
400
399
|
return { ok: n.ok, json: await n.json() };
|
|
401
|
-
},
|
|
400
|
+
}, hr = async (t, e, n) => {
|
|
402
401
|
const r = new AbortController();
|
|
403
402
|
let i;
|
|
404
|
-
return e.signal = r.signal, Promise.race([
|
|
403
|
+
return e.signal = r.signal, Promise.race([dr(t, e), new Promise((o, a) => {
|
|
405
404
|
i = setTimeout(() => {
|
|
406
405
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
407
406
|
}, n);
|
|
408
407
|
})]).finally(() => {
|
|
409
408
|
clearTimeout(i);
|
|
410
409
|
});
|
|
411
|
-
},
|
|
410
|
+
}, fr = async (t, e, n, r, i, o, a) => {
|
|
412
411
|
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, f = o, new Promise(function(m, u) {
|
|
413
412
|
const c = new MessageChannel();
|
|
414
413
|
c.port1.onmessage = function(d) {
|
|
@@ -416,34 +415,34 @@ const Ve = () => window.crypto, it = () => {
|
|
|
416
415
|
}, f.postMessage(s, [c.port2]);
|
|
417
416
|
});
|
|
418
417
|
var s, f;
|
|
419
|
-
},
|
|
420
|
-
async function
|
|
421
|
-
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f =
|
|
422
|
-
const m = s ?
|
|
418
|
+
}, pr = async (t, e, n, r, i, o, a = 1e4) => i ? fr(t, e, n, r, a, i, o) : hr(t, r, a);
|
|
419
|
+
async function mr(t, e) {
|
|
420
|
+
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
421
|
+
const m = s ? vt(f) : JSON.stringify(f);
|
|
423
422
|
return await async function(u, c, d, h, v, w, y) {
|
|
424
423
|
let k, _ = null;
|
|
425
424
|
for (let x = 0; x < 3; x++)
|
|
426
425
|
try {
|
|
427
|
-
k = await
|
|
426
|
+
k = await pr(u, d, h, v, w, y, c), _ = null;
|
|
428
427
|
break;
|
|
429
|
-
} catch (
|
|
430
|
-
_ =
|
|
428
|
+
} catch (D) {
|
|
429
|
+
_ = D;
|
|
431
430
|
}
|
|
432
431
|
if (_)
|
|
433
432
|
throw _;
|
|
434
|
-
const I = k.json, { error: g, error_description: b } = I,
|
|
433
|
+
const I = k.json, { error: g, error_description: b } = I, A = Q(I, ["error", "error_description"]), { ok: C } = k;
|
|
435
434
|
if (!C) {
|
|
436
435
|
const x = b || `HTTP error. Unable to fetch ${u}`;
|
|
437
|
-
throw g === "mfa_required" ? new
|
|
436
|
+
throw g === "mfa_required" ? new lr(g, x, A.mfa_token) : g === "missing_refresh_token" ? new Sn(d, h) : new J(g || "request_error", x);
|
|
438
437
|
}
|
|
439
|
-
return
|
|
440
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a ||
|
|
438
|
+
return A;
|
|
439
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || gn)) } }, e, s);
|
|
441
440
|
}
|
|
442
|
-
const
|
|
441
|
+
const Ze = (...t) => {
|
|
443
442
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
444
443
|
var e;
|
|
445
444
|
};
|
|
446
|
-
let
|
|
445
|
+
let ue = class yt {
|
|
447
446
|
constructor(e, n = "@@auth0spajs@@", r) {
|
|
448
447
|
this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
|
|
449
448
|
}
|
|
@@ -452,13 +451,13 @@ let ce = class gt {
|
|
|
452
451
|
}
|
|
453
452
|
static fromKey(e) {
|
|
454
453
|
const [n, r, i, o] = e.split("::");
|
|
455
|
-
return new
|
|
454
|
+
return new yt({ clientId: r, scope: o, audience: i }, n);
|
|
456
455
|
}
|
|
457
456
|
static fromCacheEntry(e) {
|
|
458
457
|
const { scope: n, audience: r, client_id: i } = e;
|
|
459
|
-
return new
|
|
458
|
+
return new yt({ scope: n, audience: r, clientId: i });
|
|
460
459
|
}
|
|
461
|
-
},
|
|
460
|
+
}, gr = class {
|
|
462
461
|
set(e, n) {
|
|
463
462
|
localStorage.setItem(e, JSON.stringify(n));
|
|
464
463
|
}
|
|
@@ -477,7 +476,7 @@ let ce = class gt {
|
|
|
477
476
|
allKeys() {
|
|
478
477
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
479
478
|
}
|
|
480
|
-
},
|
|
479
|
+
}, On = class {
|
|
481
480
|
constructor() {
|
|
482
481
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
483
482
|
let e = {};
|
|
@@ -492,9 +491,9 @@ let ce = class gt {
|
|
|
492
491
|
}, allKeys: () => Object.keys(e) };
|
|
493
492
|
}();
|
|
494
493
|
}
|
|
495
|
-
},
|
|
494
|
+
}, vr = class {
|
|
496
495
|
constructor(e, n, r) {
|
|
497
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
496
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || vn;
|
|
498
497
|
}
|
|
499
498
|
async setIdToken(e, n, r) {
|
|
500
499
|
var i;
|
|
@@ -527,7 +526,7 @@ let ce = class gt {
|
|
|
527
526
|
}
|
|
528
527
|
async set(e) {
|
|
529
528
|
var n;
|
|
530
|
-
const r = new
|
|
529
|
+
const r = new ue({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
|
|
531
530
|
await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
|
|
532
531
|
}
|
|
533
532
|
async clear(e) {
|
|
@@ -546,16 +545,16 @@ let ce = class gt {
|
|
|
546
545
|
return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
|
|
547
546
|
}
|
|
548
547
|
getIdTokenCacheKey(e) {
|
|
549
|
-
return new
|
|
548
|
+
return new ue({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
|
|
550
549
|
}
|
|
551
550
|
matchExistingCacheKey(e, n) {
|
|
552
551
|
return n.filter((r) => {
|
|
553
552
|
var i;
|
|
554
|
-
const o =
|
|
553
|
+
const o = ue.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((m, u) => m && a.has(u), !0);
|
|
555
554
|
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && f;
|
|
556
555
|
})[0];
|
|
557
556
|
}
|
|
558
|
-
},
|
|
557
|
+
}, yr = class {
|
|
559
558
|
constructor(e, n, r) {
|
|
560
559
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
561
560
|
}
|
|
@@ -569,17 +568,17 @@ let ce = class gt {
|
|
|
569
568
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
570
569
|
}
|
|
571
570
|
};
|
|
572
|
-
const
|
|
571
|
+
const Te = (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"], br = (t) => {
|
|
573
572
|
if (!t.id_token)
|
|
574
573
|
throw new Error("ID token is required but missing");
|
|
575
574
|
const e = ((o) => {
|
|
576
575
|
const a = o.split("."), [s, f, m] = a;
|
|
577
576
|
if (a.length !== 3 || !s || !f || !m)
|
|
578
577
|
throw new Error("ID token could not be decoded");
|
|
579
|
-
const u = JSON.parse(
|
|
578
|
+
const u = JSON.parse(At(f)), c = { __raw: o }, d = {};
|
|
580
579
|
return Object.keys(u).forEach((h) => {
|
|
581
|
-
c[h] = u[h],
|
|
582
|
-
}), { encoded: { header: s, payload: f, signature: m }, header: JSON.parse(
|
|
580
|
+
c[h] = u[h], wr.includes(h) || (d[h] = u[h]);
|
|
581
|
+
}), { encoded: { header: s, payload: f, signature: m }, header: JSON.parse(At(s)), claims: c, user: d };
|
|
583
582
|
})(t.id_token);
|
|
584
583
|
if (!e.claims.iss)
|
|
585
584
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -608,21 +607,21 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
608
607
|
if (e.claims.nonce !== t.nonce)
|
|
609
608
|
throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
|
|
610
609
|
}
|
|
611
|
-
if (t.max_age && !
|
|
610
|
+
if (t.max_age && !Te(e.claims.auth_time))
|
|
612
611
|
throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
|
|
613
|
-
if (e.claims.exp == null || !
|
|
612
|
+
if (e.claims.exp == null || !Te(e.claims.exp))
|
|
614
613
|
throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
|
|
615
|
-
if (!
|
|
614
|
+
if (!Te(e.claims.iat))
|
|
616
615
|
throw new Error("Issued At (iat) claim must be a number present in the ID token");
|
|
617
616
|
const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
|
|
618
617
|
if (i.setUTCSeconds(e.claims.exp + n), r > i)
|
|
619
618
|
throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
|
|
620
|
-
if (e.claims.nbf != null &&
|
|
619
|
+
if (e.claims.nbf != null && Te(e.claims.nbf)) {
|
|
621
620
|
const o = /* @__PURE__ */ new Date(0);
|
|
622
621
|
if (o.setUTCSeconds(e.claims.nbf - n), r < o)
|
|
623
622
|
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}`);
|
|
624
623
|
}
|
|
625
|
-
if (e.claims.auth_time != null &&
|
|
624
|
+
if (e.claims.auth_time != null && Te(e.claims.auth_time)) {
|
|
626
625
|
const o = /* @__PURE__ */ new Date(0);
|
|
627
626
|
if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
|
|
628
627
|
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}`);
|
|
@@ -645,8 +644,8 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
645
644
|
}
|
|
646
645
|
return e;
|
|
647
646
|
};
|
|
648
|
-
var
|
|
649
|
-
var n =
|
|
647
|
+
var le = _t(function(t, e) {
|
|
648
|
+
var n = se && se.__assign || function() {
|
|
650
649
|
return n = Object.assign || function(f) {
|
|
651
650
|
for (var m, u = 1, c = arguments.length; u < c; u++)
|
|
652
651
|
for (var d in m = arguments[u])
|
|
@@ -692,27 +691,27 @@ var ue = kt(function(t, e) {
|
|
|
692
691
|
s(f, "", n(n({}, m), { expires: -1 }));
|
|
693
692
|
};
|
|
694
693
|
});
|
|
695
|
-
|
|
696
|
-
var
|
|
697
|
-
const
|
|
698
|
-
const e =
|
|
694
|
+
St(le), le.encode, le.parse, le.getAll;
|
|
695
|
+
var kr = le.get, En = le.set, Pn = le.remove;
|
|
696
|
+
const ge = { get(t) {
|
|
697
|
+
const e = kr(t);
|
|
699
698
|
if (e !== void 0)
|
|
700
699
|
return JSON.parse(e);
|
|
701
700
|
}, save(t, e, n) {
|
|
702
701
|
let r = {};
|
|
703
|
-
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),
|
|
702
|
+
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), En(t, JSON.stringify(e), r);
|
|
704
703
|
}, remove(t, e) {
|
|
705
704
|
let n = {};
|
|
706
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
707
|
-
} },
|
|
708
|
-
return
|
|
705
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n);
|
|
706
|
+
} }, Ir = { get(t) {
|
|
707
|
+
return ge.get(t) || ge.get(`_legacy_${t}`);
|
|
709
708
|
}, save(t, e, n) {
|
|
710
709
|
let r = {};
|
|
711
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
710
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), En(`_legacy_${t}`, JSON.stringify(e), r), ge.save(t, e, n);
|
|
712
711
|
}, remove(t, e) {
|
|
713
712
|
let n = {};
|
|
714
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
715
|
-
} },
|
|
713
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n), ge.remove(t, e), ge.remove(`_legacy_${t}`, e);
|
|
714
|
+
} }, Sr = { get(t) {
|
|
716
715
|
if (typeof sessionStorage > "u")
|
|
717
716
|
return;
|
|
718
717
|
const e = sessionStorage.getItem(t);
|
|
@@ -722,7 +721,7 @@ const pe = { get(t) {
|
|
|
722
721
|
}, remove(t) {
|
|
723
722
|
sessionStorage.removeItem(t);
|
|
724
723
|
} };
|
|
725
|
-
function
|
|
724
|
+
function _r(t, e, n) {
|
|
726
725
|
var r = e === void 0 ? null : e, i = function(f, m) {
|
|
727
726
|
var u = atob(f);
|
|
728
727
|
if (m) {
|
|
@@ -735,11 +734,11 @@ function Sr(t, e, n) {
|
|
|
735
734
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
736
735
|
return URL.createObjectURL(s);
|
|
737
736
|
}
|
|
738
|
-
var
|
|
739
|
-
return
|
|
737
|
+
var Lt, Dt, Ut, at, Or = (Lt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Dt = null, Ut = !1, function(t) {
|
|
738
|
+
return at = at || _r(Lt, Dt, Ut), new Worker(at, t);
|
|
740
739
|
});
|
|
741
|
-
const
|
|
742
|
-
let
|
|
740
|
+
const st = {};
|
|
741
|
+
let Er = class {
|
|
743
742
|
constructor(e, n) {
|
|
744
743
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
745
744
|
}
|
|
@@ -765,57 +764,57 @@ let Or = class {
|
|
|
765
764
|
return `@@auth0spajs@@::${e}`;
|
|
766
765
|
}
|
|
767
766
|
};
|
|
768
|
-
const Pr = { memory: () => new
|
|
769
|
-
const { openUrl: e, onRedirect: n } = t, r =
|
|
767
|
+
const Pr = { memory: () => new On().enclosedCache, localstorage: () => new gr() }, Zt = (t) => Pr[t], Rt = (t) => {
|
|
768
|
+
const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
|
|
770
769
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
771
|
-
},
|
|
772
|
-
let
|
|
770
|
+
}, ct = new or();
|
|
771
|
+
let xr = class {
|
|
773
772
|
constructor(e) {
|
|
774
773
|
let n, r;
|
|
775
|
-
if (this.userCache = new
|
|
776
|
-
await
|
|
774
|
+
if (this.userCache = new On().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
775
|
+
await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
777
776
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
778
|
-
if (!
|
|
777
|
+
if (!Je())
|
|
779
778
|
throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
|
|
780
|
-
if (
|
|
779
|
+
if (Je().subtle === void 0)
|
|
781
780
|
throw new Error(`
|
|
782
781
|
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.
|
|
783
782
|
`);
|
|
784
783
|
})(), 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)
|
|
785
784
|
r = e.cache;
|
|
786
785
|
else {
|
|
787
|
-
if (n = e.cacheLocation || "memory", !
|
|
786
|
+
if (n = e.cacheLocation || "memory", !Zt(n))
|
|
788
787
|
throw new Error(`Invalid cache location "${n}"`);
|
|
789
|
-
r =
|
|
788
|
+
r = Zt(n)();
|
|
790
789
|
}
|
|
791
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ?
|
|
792
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
790
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? ge : Ir, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
791
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : Sr;
|
|
793
792
|
var o;
|
|
794
|
-
this.scope =
|
|
793
|
+
this.scope = Ze("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new yr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || vn, this.cacheManager = new vr(r, r.allKeys ? void 0 : new Er(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 Or());
|
|
795
794
|
}
|
|
796
795
|
_url(e) {
|
|
797
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
796
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || gn)));
|
|
798
797
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
799
798
|
}
|
|
800
799
|
_authorizeUrl(e) {
|
|
801
|
-
return this._url(`/authorize?${
|
|
800
|
+
return this._url(`/authorize?${vt(e)}`);
|
|
802
801
|
}
|
|
803
802
|
async _verifyIdToken(e, n, r) {
|
|
804
803
|
const i = await this.nowProvider();
|
|
805
|
-
return
|
|
804
|
+
return br({ 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 });
|
|
806
805
|
var o;
|
|
807
806
|
}
|
|
808
807
|
_processOrgHint(e) {
|
|
809
808
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
810
809
|
}
|
|
811
810
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
812
|
-
const i =
|
|
811
|
+
const i = Nt(ot()), o = Nt(ot()), a = ot(), s = ((u) => {
|
|
813
812
|
const c = new Uint8Array(u);
|
|
814
813
|
return ((d) => {
|
|
815
814
|
const h = { "+": "-", "/": "_", "=": "" };
|
|
816
815
|
return d.replace(/[+/=]/g, (v) => h[v]);
|
|
817
816
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
818
|
-
})(await (async (u) => await
|
|
817
|
+
})(await (async (u) => await Je().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, d, h, v, w, y, k) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), d), { scope: Ze(c, d.scope), response_type: "code", response_mode: k || "query", state: h, nonce: v, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: w, 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), m = this._authorizeUrl(f);
|
|
819
818
|
return { nonce: o, code_verifier: a, scope: f.scope, audience: f.audience || "default", redirect_uri: f.redirect_uri, state: i, url: m };
|
|
820
819
|
}
|
|
821
820
|
async loginWithPopup(e, n) {
|
|
@@ -830,9 +829,9 @@ let Er = class {
|
|
|
830
829
|
const o = await ((s) => new Promise((f, m) => {
|
|
831
830
|
let u;
|
|
832
831
|
const c = setInterval(() => {
|
|
833
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(d), window.removeEventListener("message", u, !1), m(new
|
|
832
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(d), window.removeEventListener("message", u, !1), m(new ur(s.popup)));
|
|
834
833
|
}, 1e3), d = setTimeout(() => {
|
|
835
|
-
clearInterval(c), m(new
|
|
834
|
+
clearInterval(c), m(new cr(s.popup)), window.removeEventListener("message", u, !1);
|
|
836
835
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
837
836
|
u = function(h) {
|
|
838
837
|
if (h.data && h.data.type === "authorization_response") {
|
|
@@ -859,7 +858,7 @@ let Er = class {
|
|
|
859
858
|
}
|
|
860
859
|
async loginWithRedirect(e = {}) {
|
|
861
860
|
var n;
|
|
862
|
-
const r =
|
|
861
|
+
const r = Rt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = Q(m, ["url"]);
|
|
863
862
|
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), f && { organization: f }));
|
|
864
863
|
const d = o ? `${u}#${o}` : u;
|
|
865
864
|
i ? await i(d) : window.location.assign(d);
|
|
@@ -876,7 +875,7 @@ let Er = class {
|
|
|
876
875
|
if (!s)
|
|
877
876
|
throw new J("missing_transaction", "Invalid state");
|
|
878
877
|
if (this.transactionManager.remove(), o)
|
|
879
|
-
throw new
|
|
878
|
+
throw new sr(o, a || o, r, s.appState);
|
|
880
879
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
881
880
|
throw new J("state_mismatch", "Invalid state");
|
|
882
881
|
const f = s.organization, m = s.nonce, u = s.redirect_uri;
|
|
@@ -895,16 +894,16 @@ let Er = class {
|
|
|
895
894
|
}
|
|
896
895
|
async getTokenSilently(e = {}) {
|
|
897
896
|
var n;
|
|
898
|
-
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
899
|
-
let s =
|
|
897
|
+
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
|
|
898
|
+
let s = st[a];
|
|
900
899
|
return s || (s = o().finally(() => {
|
|
901
|
-
delete
|
|
902
|
-
}),
|
|
900
|
+
delete st[a], s = null;
|
|
901
|
+
}), st[a] = s), s;
|
|
903
902
|
})(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
|
|
904
903
|
return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
|
|
905
904
|
}
|
|
906
905
|
async _getTokenSilently(e) {
|
|
907
|
-
const { cacheMode: n } = e, r =
|
|
906
|
+
const { cacheMode: n } = e, r = Q(e, ["cacheMode"]);
|
|
908
907
|
if (n !== "off") {
|
|
909
908
|
const i = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
910
909
|
if (i)
|
|
@@ -916,8 +915,8 @@ let Er = class {
|
|
|
916
915
|
if (await i())
|
|
917
916
|
return !0;
|
|
918
917
|
return !1;
|
|
919
|
-
})(() =>
|
|
920
|
-
throw new
|
|
918
|
+
})(() => ct.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
|
|
919
|
+
throw new gt();
|
|
921
920
|
try {
|
|
922
921
|
if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
|
|
923
922
|
const m = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
@@ -927,25 +926,25 @@ let Er = class {
|
|
|
927
926
|
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: f } = i;
|
|
928
927
|
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: f });
|
|
929
928
|
} finally {
|
|
930
|
-
await
|
|
929
|
+
await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
931
930
|
}
|
|
932
931
|
}
|
|
933
932
|
}
|
|
934
933
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
935
934
|
var r;
|
|
936
|
-
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
937
|
-
return n = Object.assign(Object.assign({},
|
|
935
|
+
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
936
|
+
return n = Object.assign(Object.assign({}, ar), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ue({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
938
937
|
}
|
|
939
938
|
async isAuthenticated() {
|
|
940
939
|
return !!await this.getUser();
|
|
941
940
|
}
|
|
942
941
|
_buildLogoutUrl(e) {
|
|
943
942
|
e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
|
|
944
|
-
const n = e.logoutParams || {}, { federated: r } = n, i =
|
|
945
|
-
return this._url(`/v2/logout?${
|
|
943
|
+
const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
|
|
944
|
+
return this._url(`/v2/logout?${vt(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
946
945
|
}
|
|
947
946
|
async logout(e = {}) {
|
|
948
|
-
const n =
|
|
947
|
+
const n = Rt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
|
|
949
948
|
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@@");
|
|
950
949
|
const o = this._buildLogoutUrl(i);
|
|
951
950
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -964,14 +963,14 @@ let Er = class {
|
|
|
964
963
|
window.document.body.contains(I) && (window.document.body.removeChild(I), window.removeEventListener("message", b, !1));
|
|
965
964
|
};
|
|
966
965
|
let b;
|
|
967
|
-
const
|
|
968
|
-
_(new
|
|
966
|
+
const A = setTimeout(() => {
|
|
967
|
+
_(new gt()), g();
|
|
969
968
|
}, 1e3 * y);
|
|
970
969
|
b = function(C) {
|
|
971
970
|
if (C.origin != w || !C.data || C.data.type !== "authorization_response")
|
|
972
971
|
return;
|
|
973
972
|
const x = C.source;
|
|
974
|
-
x && x.close(), C.data.response.error ? _(J.fromPayload(C.data.response)) : k(C.data.response), clearTimeout(
|
|
973
|
+
x && x.close(), C.data.response.error ? _(J.fromPayload(C.data.response)) : k(C.data.response), clearTimeout(A), window.removeEventListener("message", b, !1), setTimeout(g, 2e3);
|
|
975
974
|
}, window.addEventListener("message", b, !1), window.document.body.appendChild(I), I.setAttribute("src", v);
|
|
976
975
|
}))(i, this.domainUrl, c);
|
|
977
976
|
if (o !== d.state)
|
|
@@ -983,11 +982,11 @@ let Er = class {
|
|
|
983
982
|
}
|
|
984
983
|
}
|
|
985
984
|
async _getTokenUsingRefreshToken(e) {
|
|
986
|
-
const n = await this.cacheManager.get(new
|
|
985
|
+
const n = await this.cacheManager.get(new ue({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
|
|
987
986
|
if (!(n && n.refresh_token || this.worker)) {
|
|
988
987
|
if (this.options.useRefreshTokensFallback)
|
|
989
988
|
return await this._getTokenFromIFrame(e);
|
|
990
|
-
throw new
|
|
989
|
+
throw new Sn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
991
990
|
}
|
|
992
991
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
993
992
|
try {
|
|
@@ -1000,196 +999,199 @@ let Er = class {
|
|
|
1000
999
|
}
|
|
1001
1000
|
}
|
|
1002
1001
|
async _saveEntryInCache(e) {
|
|
1003
|
-
const { id_token: n, decodedToken: r } = e, i =
|
|
1002
|
+
const { id_token: n, decodedToken: r } = e, i = Q(e, ["id_token", "decodedToken"]);
|
|
1004
1003
|
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);
|
|
1005
1004
|
}
|
|
1006
1005
|
async _getIdTokenFromCache() {
|
|
1007
|
-
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new
|
|
1006
|
+
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new ue({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
|
|
1008
1007
|
return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
|
|
1009
1008
|
}
|
|
1010
1009
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
1011
|
-
const i = await this.cacheManager.get(new
|
|
1010
|
+
const i = await this.cacheManager.get(new ue({ scope: e, audience: n, clientId: r }), 60);
|
|
1012
1011
|
if (i && i.access_token) {
|
|
1013
1012
|
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, f = await this._getIdTokenFromCache();
|
|
1014
1013
|
return f && Object.assign(Object.assign({ id_token: f.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
1015
1014
|
}
|
|
1016
1015
|
}
|
|
1017
1016
|
async _requestToken(e, n) {
|
|
1018
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
1017
|
+
const { nonceIn: r, organization: i } = n || {}, o = await mr(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);
|
|
1019
1018
|
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 });
|
|
1020
1019
|
}
|
|
1021
1020
|
};
|
|
1022
|
-
async function
|
|
1023
|
-
const e = new
|
|
1021
|
+
async function Tr(t) {
|
|
1022
|
+
const e = new xr(t);
|
|
1024
1023
|
return await e.checkSession(), e;
|
|
1025
1024
|
}
|
|
1026
|
-
const jr = "sesamy.com",
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1025
|
+
const jr = "sesamy.com", Cr = "https://logs.sesamy.com/events";
|
|
1026
|
+
var he = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t.AUTHENTICATED = "sesamyAuthenticated", t.LOGOUT = "sesamyLogout", t))(he || {});
|
|
1027
|
+
let B;
|
|
1028
|
+
async function $r({ clientId: t }) {
|
|
1029
|
+
if (B = await Tr({
|
|
1030
1030
|
domain: `token.${jr}`,
|
|
1031
1031
|
clientId: t,
|
|
1032
1032
|
cacheLocation: "localstorage"
|
|
1033
1033
|
}), window.location.search.includes("code="))
|
|
1034
1034
|
try {
|
|
1035
|
-
await
|
|
1035
|
+
await B.handleRedirectCallback();
|
|
1036
|
+
const e = await B.getUser();
|
|
1037
|
+
It(he.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
|
|
1036
1038
|
} catch {
|
|
1037
1039
|
}
|
|
1038
1040
|
}
|
|
1039
|
-
async function
|
|
1040
|
-
if (!
|
|
1041
|
+
async function zr() {
|
|
1042
|
+
if (!B)
|
|
1041
1043
|
throw new Error("Auth0 client not initialized");
|
|
1042
|
-
return
|
|
1044
|
+
return B.isAuthenticated();
|
|
1043
1045
|
}
|
|
1044
|
-
async function
|
|
1045
|
-
if (!
|
|
1046
|
+
async function Nr() {
|
|
1047
|
+
if (!B)
|
|
1046
1048
|
throw new Error("Auth0 client not initialized");
|
|
1047
|
-
return
|
|
1049
|
+
return B.getUser();
|
|
1048
1050
|
}
|
|
1049
|
-
function
|
|
1050
|
-
if (!
|
|
1051
|
+
function Ar() {
|
|
1052
|
+
if (!B)
|
|
1051
1053
|
throw new Error("Auth0 client not initialized");
|
|
1052
|
-
return
|
|
1054
|
+
return B.loginWithRedirect({
|
|
1053
1055
|
authorizationParams: {
|
|
1054
1056
|
redirect_uri: window.location.href
|
|
1055
1057
|
}
|
|
1056
1058
|
});
|
|
1057
1059
|
}
|
|
1058
|
-
function
|
|
1059
|
-
if (!
|
|
1060
|
+
async function Lr() {
|
|
1061
|
+
if (!B)
|
|
1060
1062
|
throw new Error("Auth0 client not initialized");
|
|
1061
|
-
return
|
|
1063
|
+
return It(he.LOGOUT, {}), B.logout({
|
|
1062
1064
|
logoutParams: {
|
|
1063
1065
|
returnTo: window.location.href
|
|
1064
1066
|
}
|
|
1065
1067
|
});
|
|
1066
1068
|
}
|
|
1067
|
-
function
|
|
1069
|
+
function Dr(t = "sesamy") {
|
|
1068
1070
|
window[t] = {
|
|
1069
|
-
getUser:
|
|
1070
|
-
isAuthenticated:
|
|
1071
|
-
loginWithRedirect:
|
|
1072
|
-
logout:
|
|
1071
|
+
getUser: Nr,
|
|
1072
|
+
isAuthenticated: zr,
|
|
1073
|
+
loginWithRedirect: Ar,
|
|
1074
|
+
logout: Lr
|
|
1073
1075
|
};
|
|
1074
1076
|
}
|
|
1075
|
-
function
|
|
1077
|
+
function Wt(t, e, n, r, i) {
|
|
1076
1078
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1077
1079
|
t = t ? t[e[r]] : i;
|
|
1078
1080
|
return t === i ? n : t;
|
|
1079
1081
|
}
|
|
1080
|
-
var
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1082
|
+
var Re = "undefined", Kt = "object", Ur = function() {
|
|
1083
|
+
}, xn = "any", Tn = "*", fe = "__", Ye = typeof process < "u" ? process : {};
|
|
1084
|
+
Ye.env && Ye.env.NODE_ENV;
|
|
1083
1085
|
var H = typeof document < "u";
|
|
1084
|
-
|
|
1086
|
+
Ye.versions != null && Ye.versions.node != null;
|
|
1085
1087
|
typeof Deno < "u" && Deno.core;
|
|
1086
1088
|
H && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1087
|
-
function
|
|
1089
|
+
function jn(t, e) {
|
|
1088
1090
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1089
1091
|
}
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1092
|
+
var Zr = jn.bind(null, "toUpperCase"), Rr = jn.bind(null, "toLowerCase");
|
|
1093
|
+
function Wr(t) {
|
|
1094
|
+
return Cn(t) ? Zr("null") : typeof t == "object" ? Vr(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1093
1095
|
}
|
|
1094
|
-
function
|
|
1096
|
+
function Ge(t, e) {
|
|
1095
1097
|
e === void 0 && (e = !0);
|
|
1096
|
-
var n =
|
|
1097
|
-
return e ?
|
|
1098
|
+
var n = Wr(t);
|
|
1099
|
+
return e ? Rr(n) : n;
|
|
1098
1100
|
}
|
|
1099
1101
|
function De(t, e) {
|
|
1100
1102
|
return typeof e === t;
|
|
1101
1103
|
}
|
|
1102
|
-
var G = De.bind(null, "function"), re = De.bind(null, "string"),
|
|
1104
|
+
var G = De.bind(null, "function"), re = De.bind(null, "string"), ve = De.bind(null, "undefined"), Kr = De.bind(null, "boolean");
|
|
1103
1105
|
De.bind(null, "symbol");
|
|
1104
|
-
function
|
|
1106
|
+
function Cn(t) {
|
|
1105
1107
|
return t === null;
|
|
1106
1108
|
}
|
|
1107
|
-
function
|
|
1108
|
-
return
|
|
1109
|
+
function Mr(t) {
|
|
1110
|
+
return Ge(t) === "number" && !isNaN(t);
|
|
1109
1111
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1112
|
+
function $n(t) {
|
|
1113
|
+
return Ge(t) === "array";
|
|
1112
1114
|
}
|
|
1113
1115
|
function F(t) {
|
|
1114
|
-
if (!
|
|
1116
|
+
if (!Xr(t))
|
|
1115
1117
|
return !1;
|
|
1116
1118
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
1117
1119
|
e = Object.getPrototypeOf(e);
|
|
1118
1120
|
return Object.getPrototypeOf(t) === e;
|
|
1119
1121
|
}
|
|
1120
|
-
function
|
|
1122
|
+
function Xr(t) {
|
|
1121
1123
|
return t && (typeof t == "object" || t !== null);
|
|
1122
1124
|
}
|
|
1123
|
-
function
|
|
1125
|
+
function Vr(t) {
|
|
1124
1126
|
return G(t.constructor) ? t.constructor.name : null;
|
|
1125
1127
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return t instanceof Error || re(t.message) && t.constructor &&
|
|
1128
|
+
function Fr(t) {
|
|
1129
|
+
return t instanceof Error || re(t.message) && t.constructor && Mr(t.constructor.stackTraceLimit);
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1130
|
-
if (typeof e != "object" ||
|
|
1131
|
+
function zn(t, e) {
|
|
1132
|
+
if (typeof e != "object" || Cn(e))
|
|
1131
1133
|
return !1;
|
|
1132
1134
|
if (e instanceof t)
|
|
1133
1135
|
return !0;
|
|
1134
|
-
var n =
|
|
1135
|
-
if (
|
|
1136
|
+
var n = Ge(new t(""));
|
|
1137
|
+
if (Fr(e))
|
|
1136
1138
|
for (; e; ) {
|
|
1137
|
-
if (
|
|
1139
|
+
if (Ge(e) === n)
|
|
1138
1140
|
return !0;
|
|
1139
1141
|
e = Object.getPrototypeOf(e);
|
|
1140
1142
|
}
|
|
1141
1143
|
return !1;
|
|
1142
1144
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
function
|
|
1145
|
+
zn.bind(null, TypeError);
|
|
1146
|
+
zn.bind(null, SyntaxError);
|
|
1147
|
+
function Qe(t, e) {
|
|
1146
1148
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1147
|
-
return n && e ?
|
|
1149
|
+
return n && e ? Jr(t, e) : n;
|
|
1148
1150
|
}
|
|
1149
|
-
function
|
|
1151
|
+
function Jr(t, e) {
|
|
1150
1152
|
return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
|
|
1151
1153
|
}
|
|
1152
|
-
function
|
|
1154
|
+
function et(t) {
|
|
1153
1155
|
var e = [].slice.call(arguments, 1);
|
|
1154
1156
|
return function() {
|
|
1155
1157
|
return t.apply(void 0, [].slice.call(arguments).concat(e));
|
|
1156
1158
|
};
|
|
1157
1159
|
}
|
|
1158
|
-
Qe
|
|
1159
|
-
Qe
|
|
1160
|
-
Qe
|
|
1161
|
-
Qe
|
|
1162
|
-
function
|
|
1163
|
-
return t ?
|
|
1160
|
+
et(Qe, "form");
|
|
1161
|
+
et(Qe, "button");
|
|
1162
|
+
et(Qe, "input");
|
|
1163
|
+
et(Qe, "select");
|
|
1164
|
+
function Hr(t) {
|
|
1165
|
+
return t ? $n(t) ? t : [t] : [];
|
|
1164
1166
|
}
|
|
1165
|
-
function
|
|
1167
|
+
function Mt(t) {
|
|
1166
1168
|
try {
|
|
1167
1169
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1168
1170
|
} catch {
|
|
1169
1171
|
return null;
|
|
1170
1172
|
}
|
|
1171
1173
|
}
|
|
1172
|
-
function
|
|
1174
|
+
function Yr() {
|
|
1173
1175
|
if (H) {
|
|
1174
1176
|
var t = navigator, e = t.languages;
|
|
1175
1177
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1176
1178
|
}
|
|
1177
1179
|
}
|
|
1178
|
-
function
|
|
1180
|
+
function Gr() {
|
|
1179
1181
|
try {
|
|
1180
1182
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1181
1183
|
} catch {
|
|
1182
1184
|
}
|
|
1183
1185
|
}
|
|
1184
|
-
function
|
|
1186
|
+
function Br(t) {
|
|
1185
1187
|
return function(e) {
|
|
1186
1188
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1187
|
-
var o =
|
|
1189
|
+
var o = Mt(n[1]), a = Mt(n[2]);
|
|
1188
1190
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1189
1191
|
}
|
|
1190
1192
|
for (var s in r) {
|
|
1191
1193
|
var f = s.split("[");
|
|
1192
|
-
f.length > 1 && (
|
|
1194
|
+
f.length > 1 && (qr(r, f.map(function(m) {
|
|
1193
1195
|
return m.replace(/[?[\]\\ ]/g, "");
|
|
1194
1196
|
}), r[s]), delete r[s]);
|
|
1195
1197
|
}
|
|
@@ -1202,7 +1204,7 @@ function Gr(t) {
|
|
|
1202
1204
|
return H && window.location.search.substring(1);
|
|
1203
1205
|
}(t));
|
|
1204
1206
|
}
|
|
1205
|
-
function
|
|
1207
|
+
function qr(t, e, n) {
|
|
1206
1208
|
for (var r = e.length - 1, i = 0; i < r; ++i) {
|
|
1207
1209
|
var o = e[i];
|
|
1208
1210
|
if (o === "__proto__" || o === "constructor")
|
|
@@ -1211,27 +1213,27 @@ function Br(t, e, n) {
|
|
|
1211
1213
|
}
|
|
1212
1214
|
t[e[r]] = n;
|
|
1213
1215
|
}
|
|
1214
|
-
function
|
|
1216
|
+
function tt() {
|
|
1215
1217
|
for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
|
|
1216
1218
|
var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
|
|
1217
1219
|
t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
|
|
1218
1220
|
}
|
|
1219
1221
|
return t;
|
|
1220
1222
|
}
|
|
1221
|
-
var
|
|
1222
|
-
function
|
|
1223
|
-
return
|
|
1223
|
+
var $e = "global", Ie = fe + "global" + fe, Se = typeof self === Kt && self.self === self && self || typeof global === Kt && global.global === global && global || void 0;
|
|
1224
|
+
function pe(t) {
|
|
1225
|
+
return Se[Ie][t];
|
|
1224
1226
|
}
|
|
1225
|
-
function
|
|
1226
|
-
return
|
|
1227
|
+
function me(t, e) {
|
|
1228
|
+
return Se[Ie][t] = e;
|
|
1227
1229
|
}
|
|
1228
|
-
function
|
|
1229
|
-
delete
|
|
1230
|
+
function Oe(t) {
|
|
1231
|
+
delete Se[Ie][t];
|
|
1230
1232
|
}
|
|
1231
|
-
function
|
|
1233
|
+
function Ee(t, e, n) {
|
|
1232
1234
|
var r;
|
|
1233
1235
|
try {
|
|
1234
|
-
if (
|
|
1236
|
+
if (Ot(t)) {
|
|
1235
1237
|
var i = window[t];
|
|
1236
1238
|
r = i[e].bind(i);
|
|
1237
1239
|
}
|
|
@@ -1239,41 +1241,41 @@ function _e(t, e, n) {
|
|
|
1239
1241
|
}
|
|
1240
1242
|
return r || n;
|
|
1241
1243
|
}
|
|
1242
|
-
|
|
1243
|
-
var
|
|
1244
|
-
function
|
|
1245
|
-
if (typeof
|
|
1246
|
-
return
|
|
1244
|
+
Se[Ie] || (Se[Ie] = {});
|
|
1245
|
+
var We = {};
|
|
1246
|
+
function Ot(t) {
|
|
1247
|
+
if (typeof We[t] !== Re)
|
|
1248
|
+
return We[t];
|
|
1247
1249
|
try {
|
|
1248
1250
|
var e = window[t];
|
|
1249
|
-
e.setItem(
|
|
1251
|
+
e.setItem(Re, Re), e.removeItem(Re);
|
|
1250
1252
|
} catch {
|
|
1251
|
-
return
|
|
1253
|
+
return We[t] = !1;
|
|
1252
1254
|
}
|
|
1253
|
-
return
|
|
1255
|
+
return We[t] = !0;
|
|
1254
1256
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1257
|
+
function E() {
|
|
1258
|
+
return E = Object.assign || function(t) {
|
|
1257
1259
|
for (var e = 1; e < arguments.length; e++) {
|
|
1258
1260
|
var n = arguments[e];
|
|
1259
1261
|
for (var r in n)
|
|
1260
1262
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1261
1263
|
}
|
|
1262
1264
|
return t;
|
|
1263
|
-
},
|
|
1265
|
+
}, E.apply(this, arguments);
|
|
1264
1266
|
}
|
|
1265
|
-
var ne = "function", ee = "undefined",
|
|
1267
|
+
var ne = "function", ee = "undefined", Qr = "@@redux/" + Math.random().toString(36), Xt = /* @__PURE__ */ function() {
|
|
1266
1268
|
return typeof Symbol === ne && Symbol.observable || "@@observable";
|
|
1267
|
-
}(),
|
|
1268
|
-
function
|
|
1269
|
+
}(), Ke = " != " + ne;
|
|
1270
|
+
function Nn(t, e, n) {
|
|
1269
1271
|
var r;
|
|
1270
1272
|
if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
|
|
1271
1273
|
if (typeof n !== ne)
|
|
1272
|
-
throw new Error("enhancer" +
|
|
1273
|
-
return n(
|
|
1274
|
+
throw new Error("enhancer" + Ke);
|
|
1275
|
+
return n(Nn)(t, e);
|
|
1274
1276
|
}
|
|
1275
1277
|
if (typeof t !== ne)
|
|
1276
|
-
throw new Error("reducer" +
|
|
1278
|
+
throw new Error("reducer" + Ke);
|
|
1277
1279
|
var i = t, o = e, a = [], s = a, f = !1;
|
|
1278
1280
|
function m() {
|
|
1279
1281
|
s === a && (s = a.slice());
|
|
@@ -1283,7 +1285,7 @@ function Tn(t, e, n) {
|
|
|
1283
1285
|
}
|
|
1284
1286
|
function c(h) {
|
|
1285
1287
|
if (typeof h !== ne)
|
|
1286
|
-
throw new Error("Listener" +
|
|
1288
|
+
throw new Error("Listener" + Ke);
|
|
1287
1289
|
var v = !0;
|
|
1288
1290
|
return m(), s.push(h), function() {
|
|
1289
1291
|
if (v) {
|
|
@@ -1311,9 +1313,9 @@ function Tn(t, e, n) {
|
|
|
1311
1313
|
}
|
|
1312
1314
|
return d({ type: "@@redux/INIT" }), (r = { dispatch: d, subscribe: c, getState: u, replaceReducer: function(h) {
|
|
1313
1315
|
if (typeof h !== ne)
|
|
1314
|
-
throw new Error("next reducer" +
|
|
1316
|
+
throw new Error("next reducer" + Ke);
|
|
1315
1317
|
i = h, d({ type: "@@redux/INIT" });
|
|
1316
|
-
} })[
|
|
1318
|
+
} })[Xt] = function() {
|
|
1317
1319
|
var h, v = c;
|
|
1318
1320
|
return (h = { subscribe: function(w) {
|
|
1319
1321
|
if (typeof w != "object")
|
|
@@ -1322,16 +1324,16 @@ function Tn(t, e, n) {
|
|
|
1322
1324
|
w.next && w.next(u());
|
|
1323
1325
|
}
|
|
1324
1326
|
return y(), { unsubscribe: v(y) };
|
|
1325
|
-
} })[
|
|
1327
|
+
} })[Xt] = function() {
|
|
1326
1328
|
return this;
|
|
1327
1329
|
}, h;
|
|
1328
1330
|
}, r;
|
|
1329
1331
|
}
|
|
1330
|
-
function
|
|
1332
|
+
function ei(t, e) {
|
|
1331
1333
|
var n = e && e.type;
|
|
1332
1334
|
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
|
|
1333
1335
|
}
|
|
1334
|
-
function
|
|
1336
|
+
function _e() {
|
|
1335
1337
|
var t = [].slice.call(arguments);
|
|
1336
1338
|
return t.length === 0 ? function(e) {
|
|
1337
1339
|
return e;
|
|
@@ -1341,7 +1343,7 @@ function Ie() {
|
|
|
1341
1343
|
};
|
|
1342
1344
|
});
|
|
1343
1345
|
}
|
|
1344
|
-
function
|
|
1346
|
+
function ti() {
|
|
1345
1347
|
var t = arguments;
|
|
1346
1348
|
return function(e) {
|
|
1347
1349
|
return function(n, r, i) {
|
|
@@ -1350,35 +1352,35 @@ function ei() {
|
|
|
1350
1352
|
} };
|
|
1351
1353
|
return o = [].slice.call(t).map(function(m) {
|
|
1352
1354
|
return m(f);
|
|
1353
|
-
}),
|
|
1355
|
+
}), E({}, a, { dispatch: s = _e.apply(void 0, o)(a.dispatch) });
|
|
1354
1356
|
};
|
|
1355
1357
|
};
|
|
1356
1358
|
}
|
|
1357
|
-
var ie =
|
|
1359
|
+
var ie = fe + "anon_id", de = fe + "user_id", we = fe + "user_traits", te = "userId", ye = "anonymousId", He = ["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"], wt = ["name", "EVENTS", "config", "loaded"], O = He.reduce(function(t, e) {
|
|
1358
1360
|
return t[e] = e, t;
|
|
1359
1361
|
}, { registerPluginType: function(t) {
|
|
1360
1362
|
return "registerPlugin:" + t;
|
|
1361
1363
|
}, pluginReadyType: function(t) {
|
|
1362
1364
|
return "ready:" + t;
|
|
1363
|
-
} }),
|
|
1364
|
-
function
|
|
1365
|
+
} }), Vt = /^utm_/, Ft = /^an_prop_/, Jt = /^an_trait_/;
|
|
1366
|
+
function ni(t) {
|
|
1365
1367
|
var e = t.storage.setItem;
|
|
1366
1368
|
return function(n) {
|
|
1367
1369
|
return function(r) {
|
|
1368
1370
|
return function(i) {
|
|
1369
1371
|
if (i.type === O.bootstrap) {
|
|
1370
1372
|
var o = i.params, a = i.user, s = i.persistedUser, f = i.initialUser, m = s.userId === a.userId;
|
|
1371
|
-
s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(
|
|
1373
|
+
s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(de, a.userId), f.traits && e(we, E({}, m && s.traits ? s.traits : {}, f.traits));
|
|
1372
1374
|
var u = Object.keys(i.params);
|
|
1373
1375
|
if (u.length) {
|
|
1374
1376
|
var c = o.an_uid, d = o.an_event, h = u.reduce(function(v, w) {
|
|
1375
|
-
if (w.match(
|
|
1376
|
-
var y = w.replace(
|
|
1377
|
+
if (w.match(Vt) || w.match(/^(d|g)clid/)) {
|
|
1378
|
+
var y = w.replace(Vt, "");
|
|
1377
1379
|
v.campaign[y === "campaign" ? "name" : y] = o[w];
|
|
1378
1380
|
}
|
|
1379
|
-
return w.match(
|
|
1381
|
+
return w.match(Ft) && (v.props[w.replace(Ft, "")] = o[w]), w.match(Jt) && (v.traits[w.replace(Jt, "")] = o[w]), v;
|
|
1380
1382
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1381
|
-
n.dispatch(
|
|
1383
|
+
n.dispatch(E({ type: O.params, raw: o }, h, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1382
1384
|
return t.identify(c, h.traits);
|
|
1383
1385
|
}, 0), d && setTimeout(function() {
|
|
1384
1386
|
return t.track(d, h.props);
|
|
@@ -1390,19 +1392,19 @@ function ti(t) {
|
|
|
1390
1392
|
};
|
|
1391
1393
|
};
|
|
1392
1394
|
}
|
|
1393
|
-
function
|
|
1395
|
+
function ri(t) {
|
|
1394
1396
|
return function(e, n) {
|
|
1395
1397
|
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === O.setItemEnd) {
|
|
1396
1398
|
if (n.key === ie)
|
|
1397
|
-
return
|
|
1398
|
-
if (n.key ===
|
|
1399
|
-
return
|
|
1399
|
+
return E({}, e, { anonymousId: n.value });
|
|
1400
|
+
if (n.key === de)
|
|
1401
|
+
return E({}, e, { userId: n.value });
|
|
1400
1402
|
}
|
|
1401
1403
|
switch (n.type) {
|
|
1402
1404
|
case O.identify:
|
|
1403
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1405
|
+
return Object.assign({}, e, { userId: n.userId, traits: E({}, e.traits, n.traits) });
|
|
1404
1406
|
case O.reset:
|
|
1405
|
-
return [
|
|
1407
|
+
return [de, ie, we].forEach(function(r) {
|
|
1406
1408
|
t.removeItem(r);
|
|
1407
1409
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
1408
1410
|
default:
|
|
@@ -1410,46 +1412,46 @@ function ni(t) {
|
|
|
1410
1412
|
}
|
|
1411
1413
|
};
|
|
1412
1414
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return { userId: t.getItem(
|
|
1415
|
+
function Ht(t) {
|
|
1416
|
+
return { userId: t.getItem(de), anonymousId: t.getItem(ie), traits: t.getItem(we) };
|
|
1415
1417
|
}
|
|
1416
|
-
var
|
|
1417
|
-
return
|
|
1418
|
+
var bt = function(t) {
|
|
1419
|
+
return fe + "TEMP" + fe + t;
|
|
1418
1420
|
};
|
|
1419
|
-
function
|
|
1421
|
+
function ii(t) {
|
|
1420
1422
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1421
1423
|
return function(o) {
|
|
1422
1424
|
return function(a) {
|
|
1423
1425
|
return function(s) {
|
|
1424
1426
|
var f = s.userId, m = s.traits, u = s.options;
|
|
1425
|
-
if (s.type === O.reset && ([
|
|
1427
|
+
if (s.type === O.reset && ([de, we, ie].forEach(function(h) {
|
|
1426
1428
|
r(h);
|
|
1427
|
-
}), [te,
|
|
1428
|
-
|
|
1429
|
+
}), [te, ye, "traits"].forEach(function(h) {
|
|
1430
|
+
Oe(bt(h));
|
|
1429
1431
|
})), s.type === O.identify) {
|
|
1430
|
-
i(ie) || n(ie,
|
|
1431
|
-
var c = i(
|
|
1432
|
-
c && c !== f && o.dispatch({ type: O.userIdChanged, old: { userId: c, traits: d }, new: { userId: f, traits: m }, options: u }), f && n(
|
|
1432
|
+
i(ie) || n(ie, tt());
|
|
1433
|
+
var c = i(de), d = i(we) || {};
|
|
1434
|
+
c && c !== f && o.dispatch({ type: O.userIdChanged, old: { userId: c, traits: d }, new: { userId: f, traits: m }, options: u }), f && n(de, f), m && n(we, E({}, d, m));
|
|
1433
1435
|
}
|
|
1434
1436
|
return a(s);
|
|
1435
1437
|
};
|
|
1436
1438
|
};
|
|
1437
1439
|
};
|
|
1438
1440
|
}
|
|
1439
|
-
var
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1441
|
+
var Ce = {};
|
|
1442
|
+
function Yt(t, e) {
|
|
1443
|
+
Ce[t] && G(Ce[t]) && (Ce[t](e), delete Ce[t]);
|
|
1442
1444
|
}
|
|
1443
|
-
function
|
|
1445
|
+
function An(t, e, n) {
|
|
1444
1446
|
return new Promise(function(r, i) {
|
|
1445
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1447
|
+
return e() ? r(t) : n < 1 ? i(E({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1446
1448
|
return setTimeout(o, 10);
|
|
1447
1449
|
}).then(function(o) {
|
|
1448
|
-
return
|
|
1450
|
+
return An(t, e, n - 10).then(r, i);
|
|
1449
1451
|
});
|
|
1450
1452
|
});
|
|
1451
1453
|
}
|
|
1452
|
-
function
|
|
1454
|
+
function Ln(t, e, n) {
|
|
1453
1455
|
var r = e(), i = t.getState(), o = i.plugins, a = i.queue, s = i.user;
|
|
1454
1456
|
if (!i.context.offline && a && a.actions && a.actions.length) {
|
|
1455
1457
|
var f = a.actions.reduce(function(u, c, d) {
|
|
@@ -1460,13 +1462,13 @@ function $n(t, e, n) {
|
|
|
1460
1462
|
var c = a.actions[u], d = c.plugin, h = c.payload.type, v = r[d][h];
|
|
1461
1463
|
if (v && G(v)) {
|
|
1462
1464
|
var w = function(k, _) {
|
|
1463
|
-
return k === void 0 && (k = {}), _ === void 0 && (_ = {}), [te,
|
|
1465
|
+
return k === void 0 && (k = {}), _ === void 0 && (_ = {}), [te, ye].reduce(function(I, g) {
|
|
1464
1466
|
return k.hasOwnProperty(g) && _[g] && _[g] !== k[g] && (I[g] = _[g]), I;
|
|
1465
1467
|
}, k);
|
|
1466
1468
|
}(c.payload, s);
|
|
1467
1469
|
v({ payload: w, config: o[d].config, instance: n });
|
|
1468
1470
|
var y = h + ":" + d;
|
|
1469
|
-
t.dispatch(
|
|
1471
|
+
t.dispatch(E({}, w, { type: y, _: { called: y, from: "queueDrain" } }));
|
|
1470
1472
|
}
|
|
1471
1473
|
});
|
|
1472
1474
|
var m = a.actions.filter(function(u, c) {
|
|
@@ -1476,10 +1478,10 @@ function $n(t, e, n) {
|
|
|
1476
1478
|
}
|
|
1477
1479
|
}
|
|
1478
1480
|
}
|
|
1479
|
-
var
|
|
1481
|
+
var ut = function(t) {
|
|
1480
1482
|
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, f = t.EVENTS;
|
|
1481
1483
|
try {
|
|
1482
|
-
var m = i.plugins, u = i.context, c = n.type, d = c.match(
|
|
1484
|
+
var m = i.plugins, u = i.context, c = n.type, d = c.match(be), h = e.exact.map(function(y) {
|
|
1483
1485
|
return y.pluginName;
|
|
1484
1486
|
});
|
|
1485
1487
|
d && (h = a.during.map(function(y) {
|
|
@@ -1487,21 +1489,21 @@ var ct = function(t) {
|
|
|
1487
1489
|
}));
|
|
1488
1490
|
var v = /* @__PURE__ */ function(y, k) {
|
|
1489
1491
|
return function(_, I, g) {
|
|
1490
|
-
var b = I.config,
|
|
1492
|
+
var b = I.config, A = I.name, C = A + "." + _.type;
|
|
1491
1493
|
g && (C = g.event);
|
|
1492
|
-
var x = _.type.match(
|
|
1493
|
-
return function(R,
|
|
1494
|
-
var K = U ? U.name :
|
|
1495
|
-
if (U && (!(M =
|
|
1496
|
-
throw new Error("Method " + L + " can only abort " +
|
|
1497
|
-
return
|
|
1494
|
+
var x = _.type.match(be) ? /* @__PURE__ */ function(D, L, X, U, V) {
|
|
1495
|
+
return function(R, P) {
|
|
1496
|
+
var K = U ? U.name : D, M = P && Le(P) ? P : X;
|
|
1497
|
+
if (U && (!(M = P && Le(P) ? P : [D]).includes(D) || M.length !== 1))
|
|
1498
|
+
throw new Error("Method " + L + " can only abort " + D + " plugin. " + JSON.stringify(M) + " input valid");
|
|
1499
|
+
return E({}, V, { abort: { reason: R, plugins: M, caller: L, _: K } });
|
|
1498
1500
|
};
|
|
1499
|
-
}(
|
|
1501
|
+
}(A, C, k, g, _) : /* @__PURE__ */ function(D, L) {
|
|
1500
1502
|
return function() {
|
|
1501
|
-
throw new Error(
|
|
1503
|
+
throw new Error(D.type + " action not cancellable. Remove abort in " + L);
|
|
1502
1504
|
};
|
|
1503
1505
|
}(_, C);
|
|
1504
|
-
return { payload:
|
|
1506
|
+
return { payload: oi(_), instance: y, config: b || {}, abort: x };
|
|
1505
1507
|
};
|
|
1506
1508
|
}(r, h), w = e.exact.reduce(function(y, k) {
|
|
1507
1509
|
var _ = k.pluginName, I = k.methodName, g = !1;
|
|
@@ -1514,23 +1516,23 @@ var ct = function(t) {
|
|
|
1514
1516
|
function b() {
|
|
1515
1517
|
return Promise.resolve(g);
|
|
1516
1518
|
}
|
|
1517
|
-
var
|
|
1519
|
+
var A = function() {
|
|
1518
1520
|
if (e.namespaced && e.namespaced[I])
|
|
1519
|
-
return Promise.resolve(e.namespaced[I].reduce(function(C, x,
|
|
1521
|
+
return Promise.resolve(e.namespaced[I].reduce(function(C, x, D) {
|
|
1520
1522
|
try {
|
|
1521
1523
|
return Promise.resolve(C).then(function(L) {
|
|
1522
|
-
return x.method && G(x.method) ? (function(R,
|
|
1523
|
-
var K =
|
|
1524
|
-
if (K && K.name ===
|
|
1525
|
-
var M =
|
|
1526
|
-
throw new Error([
|
|
1524
|
+
return x.method && G(x.method) ? (function(R, P) {
|
|
1525
|
+
var K = nn(R);
|
|
1526
|
+
if (K && K.name === P) {
|
|
1527
|
+
var M = nn(K.method);
|
|
1528
|
+
throw new Error([P + " plugin is calling method " + R, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + P + " plugin insteadof " + R].join(`
|
|
1527
1529
|
`));
|
|
1528
1530
|
}
|
|
1529
|
-
}(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (X = L, U = I, V = x.pluginName, function(R,
|
|
1530
|
-
return
|
|
1531
|
-
}), config:
|
|
1532
|
-
var
|
|
1533
|
-
return Promise.resolve(
|
|
1531
|
+
}(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (X = L, U = I, V = x.pluginName, function(R, P) {
|
|
1532
|
+
return E({}, X, { abort: { reason: R, plugins: P || [U], caller: c, from: V || U } });
|
|
1533
|
+
}), config: qt(x.pluginName, m, o), plugins: m })).then(function(R) {
|
|
1534
|
+
var P = F(R) ? R : {};
|
|
1535
|
+
return Promise.resolve(E({}, L, P));
|
|
1534
1536
|
})) : L;
|
|
1535
1537
|
var X, U, V;
|
|
1536
1538
|
});
|
|
@@ -1542,7 +1544,7 @@ var ct = function(t) {
|
|
|
1542
1544
|
});
|
|
1543
1545
|
g[I] = n;
|
|
1544
1546
|
}();
|
|
1545
|
-
return
|
|
1547
|
+
return A && A.then ? A.then(b) : b();
|
|
1546
1548
|
});
|
|
1547
1549
|
} catch (g) {
|
|
1548
1550
|
return Promise.reject(g);
|
|
@@ -1550,23 +1552,23 @@ var ct = function(t) {
|
|
|
1550
1552
|
}, Promise.resolve({}))).then(function(y) {
|
|
1551
1553
|
return Promise.resolve(e.exact.reduce(function(k, _, I) {
|
|
1552
1554
|
try {
|
|
1553
|
-
var g = e.exact.length === I + 1, b = _.pluginName,
|
|
1555
|
+
var g = e.exact.length === I + 1, b = _.pluginName, A = o[b];
|
|
1554
1556
|
return Promise.resolve(k).then(function(C) {
|
|
1555
1557
|
var x = y[b] ? y[b] : {};
|
|
1556
|
-
if (d && (x = C),
|
|
1557
|
-
return
|
|
1558
|
-
if (
|
|
1559
|
-
return g &&
|
|
1558
|
+
if (d && (x = C), dt(x, b))
|
|
1559
|
+
return lt({ data: x, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(C);
|
|
1560
|
+
if (dt(C, b))
|
|
1561
|
+
return g && lt({ data: C, method: c, instance: r, store: s }), Promise.resolve(C);
|
|
1560
1562
|
if (w.hasOwnProperty(b) && w[b] === !0)
|
|
1561
1563
|
return s.dispatch({ type: "queue", plugin: b, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(C);
|
|
1562
|
-
var
|
|
1563
|
-
return Promise.resolve(
|
|
1564
|
-
var X = F(L) ? L : {}, U =
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1564
|
+
var D = v(y[b], o[b]);
|
|
1565
|
+
return Promise.resolve(A[c]({ abort: D.abort, payload: x, instance: r, config: qt(b, m, o), plugins: m })).then(function(L) {
|
|
1566
|
+
var X = F(L) ? L : {}, U = E({}, C, X), V = y[b];
|
|
1567
|
+
if (dt(V, b))
|
|
1568
|
+
lt({ data: V, method: c, instance: r, pluginName: b, store: s });
|
|
1567
1569
|
else {
|
|
1568
1570
|
var R = c + ":" + b;
|
|
1569
|
-
(R.match(/:/g) || []).length < 2 && !c.match(
|
|
1571
|
+
(R.match(/:/g) || []).length < 2 && !c.match(Gt) && !c.match(Bt) && r.dispatch(E({}, d ? U : x, { type: R, _: { called: R, from: "submethod" } }));
|
|
1570
1572
|
}
|
|
1571
1573
|
return Promise.resolve(U);
|
|
1572
1574
|
});
|
|
@@ -1575,11 +1577,11 @@ var ct = function(t) {
|
|
|
1575
1577
|
return Promise.reject(C);
|
|
1576
1578
|
}
|
|
1577
1579
|
}, Promise.resolve(n))).then(function(k) {
|
|
1578
|
-
if (!(c.match(
|
|
1580
|
+
if (!(c.match(be) || c.match(/^registerPlugin/) || c.match(Bt) || c.match(Gt) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
1579
1581
|
if (f.plugins.includes(c), k._ && k._.originalAction === c)
|
|
1580
1582
|
return k;
|
|
1581
|
-
var _ =
|
|
1582
|
-
|
|
1583
|
+
var _ = E({}, k, { _: { originalAction: k.type, called: k.type, from: "engineEnd" } });
|
|
1584
|
+
Dn(k, e.exact.length) && !c.match(/End$/) && (_ = E({}, _, { type: k.type + "Aborted" })), s.dispatch(_);
|
|
1583
1585
|
}
|
|
1584
1586
|
return k;
|
|
1585
1587
|
});
|
|
@@ -1587,53 +1589,53 @@ var ct = function(t) {
|
|
|
1587
1589
|
} catch (y) {
|
|
1588
1590
|
return Promise.reject(y);
|
|
1589
1591
|
}
|
|
1590
|
-
},
|
|
1591
|
-
function
|
|
1592
|
+
}, be = /Start$/, Gt = /^bootstrap/, Bt = /^ready/;
|
|
1593
|
+
function lt(t) {
|
|
1592
1594
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
1593
|
-
t.store.dispatch(
|
|
1595
|
+
t.store.dispatch(E({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
1594
1596
|
}
|
|
1595
|
-
function
|
|
1597
|
+
function qt(t, e, n) {
|
|
1596
1598
|
var r = e[t] || n[t];
|
|
1597
1599
|
return r && r.config ? r.config : {};
|
|
1598
1600
|
}
|
|
1599
|
-
function
|
|
1601
|
+
function Qt(t, e) {
|
|
1600
1602
|
return e.reduce(function(n, r) {
|
|
1601
1603
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
1602
1604
|
}, []);
|
|
1603
1605
|
}
|
|
1604
|
-
function
|
|
1605
|
-
var n = t.replace(
|
|
1606
|
+
function en(t, e) {
|
|
1607
|
+
var n = t.replace(be, ""), r = e ? ":" + e : "";
|
|
1606
1608
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
1607
1609
|
}
|
|
1608
|
-
function
|
|
1610
|
+
function dt(t, e) {
|
|
1609
1611
|
var n = t.abort;
|
|
1610
|
-
return !!n && (n === !0 ||
|
|
1612
|
+
return !!n && (n === !0 || tn(n, e) || n && tn(n.plugins, e));
|
|
1611
1613
|
}
|
|
1612
|
-
function
|
|
1614
|
+
function Dn(t, e) {
|
|
1613
1615
|
var n = t.abort;
|
|
1614
1616
|
if (!n)
|
|
1615
1617
|
return !1;
|
|
1616
1618
|
if (n === !0 || re(n))
|
|
1617
1619
|
return !0;
|
|
1618
1620
|
var r = n.plugins;
|
|
1619
|
-
return
|
|
1621
|
+
return Le(n) && n.length === e || Le(r) && r.length === e;
|
|
1620
1622
|
}
|
|
1621
|
-
function
|
|
1623
|
+
function Le(t) {
|
|
1622
1624
|
return Array.isArray(t);
|
|
1623
1625
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return !(!t || !
|
|
1626
|
+
function tn(t, e) {
|
|
1627
|
+
return !(!t || !Le(t)) && t.includes(e);
|
|
1626
1628
|
}
|
|
1627
|
-
function
|
|
1629
|
+
function nn(t) {
|
|
1628
1630
|
var e = t.match(/(.*):(.*)/);
|
|
1629
1631
|
return !!e && { method: e[1], name: e[2] };
|
|
1630
1632
|
}
|
|
1631
|
-
function
|
|
1633
|
+
function oi(t) {
|
|
1632
1634
|
return Object.keys(t).reduce(function(e, n) {
|
|
1633
1635
|
return n === "type" || (e[n] = F(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
1634
1636
|
}, {});
|
|
1635
1637
|
}
|
|
1636
|
-
function
|
|
1638
|
+
function ai(t, e, n) {
|
|
1637
1639
|
var r = {};
|
|
1638
1640
|
return function(i) {
|
|
1639
1641
|
return function(o) {
|
|
@@ -1645,20 +1647,20 @@ function oi(t, e, n) {
|
|
|
1645
1647
|
if (a.abort)
|
|
1646
1648
|
return Promise.resolve(o(a));
|
|
1647
1649
|
if (m === O.enablePlugin && i.dispatch({ type: O.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), m === O.disablePlugin && setTimeout(function() {
|
|
1648
|
-
return
|
|
1650
|
+
return Yt(a.meta.rid, { payload: a });
|
|
1649
1651
|
}, 0), m === O.initializeEnd) {
|
|
1650
1652
|
var d = e(), h = Object.keys(d), v = h.filter(function(g) {
|
|
1651
1653
|
return u.includes(g);
|
|
1652
1654
|
}).map(function(g) {
|
|
1653
1655
|
return d[g];
|
|
1654
1656
|
}), w = [], y = [], k = a.disabled, _ = v.map(function(g) {
|
|
1655
|
-
var b = g.loaded,
|
|
1656
|
-
return
|
|
1657
|
+
var b = g.loaded, A = g.name, C = g.config;
|
|
1658
|
+
return An(g, function() {
|
|
1657
1659
|
return b({ config: C });
|
|
1658
1660
|
}, 1e4).then(function(x) {
|
|
1659
|
-
return r[
|
|
1660
|
-
return !
|
|
1661
|
-
}) }), r[
|
|
1661
|
+
return r[A] || (i.dispatch({ type: O.pluginReadyType(A), name: A, events: Object.keys(g).filter(function(D) {
|
|
1662
|
+
return !wt.includes(D);
|
|
1663
|
+
}) }), r[A] = !0), w = w.concat(A), g;
|
|
1662
1664
|
}).catch(function(x) {
|
|
1663
1665
|
if (x instanceof Error)
|
|
1664
1666
|
throw new Error(x);
|
|
@@ -1668,22 +1670,22 @@ function oi(t, e, n) {
|
|
|
1668
1670
|
Promise.all(_).then(function(g) {
|
|
1669
1671
|
var b = { plugins: w, failed: y, disabled: k };
|
|
1670
1672
|
setTimeout(function() {
|
|
1671
|
-
h.length === _.length + k.length && i.dispatch(
|
|
1673
|
+
h.length === _.length + k.length && i.dispatch(E({}, { type: O.ready }, b));
|
|
1672
1674
|
}, 0);
|
|
1673
1675
|
});
|
|
1674
1676
|
}
|
|
1675
1677
|
var I = function() {
|
|
1676
1678
|
if (m !== O.bootstrap)
|
|
1677
1679
|
return /^ready:([^:]*)$/.test(m) && setTimeout(function() {
|
|
1678
|
-
return
|
|
1679
|
-
}, 0), Promise.resolve(function(g, b,
|
|
1680
|
+
return Ln(i, e, t);
|
|
1681
|
+
}, 0), Promise.resolve(function(g, b, A, C, x) {
|
|
1680
1682
|
try {
|
|
1681
|
-
var
|
|
1683
|
+
var D = G(b) ? b() : b, L = g.type, X = L.replace(be, "");
|
|
1682
1684
|
if (g._ && g._.called)
|
|
1683
1685
|
return Promise.resolve(g);
|
|
1684
|
-
var U =
|
|
1685
|
-
var p =
|
|
1686
|
-
return
|
|
1686
|
+
var U = A.getState(), V = (K = D, (M = U.plugins) === void 0 && (M = {}), (Pe = g.options) === void 0 && (Pe = {}), Object.keys(K).filter(function(l) {
|
|
1687
|
+
var p = Pe.plugins || {};
|
|
1688
|
+
return Kr(p[l]) ? p[l] : p.all !== !1 && (!M[l] || M[l].enabled !== !1);
|
|
1687
1689
|
}).map(function(l) {
|
|
1688
1690
|
return K[l];
|
|
1689
1691
|
}));
|
|
@@ -1691,48 +1693,48 @@ function oi(t, e, n) {
|
|
|
1691
1693
|
var p = U.plugins[l];
|
|
1692
1694
|
return g.plugins.includes(l) && !p.initialized;
|
|
1693
1695
|
}).map(function(l) {
|
|
1694
|
-
return
|
|
1696
|
+
return D[l];
|
|
1695
1697
|
}));
|
|
1696
1698
|
var R = V.map(function(l) {
|
|
1697
1699
|
return l.name;
|
|
1698
|
-
}),
|
|
1699
|
-
var
|
|
1700
|
-
return
|
|
1700
|
+
}), P = function(l, p, S) {
|
|
1701
|
+
var T = en(l).map(function(j) {
|
|
1702
|
+
return Qt(j, p);
|
|
1701
1703
|
});
|
|
1702
|
-
return p.reduce(function(
|
|
1703
|
-
var W = $.name, N =
|
|
1704
|
-
return
|
|
1705
|
-
}), Z = N[0], z = N[1],
|
|
1706
|
-
return Z.length && (
|
|
1707
|
-
}, { before:
|
|
1704
|
+
return p.reduce(function(j, $) {
|
|
1705
|
+
var W = $.name, N = en(l, W).map(function(xe) {
|
|
1706
|
+
return Qt(xe, p);
|
|
1707
|
+
}), Z = N[0], z = N[1], q = N[2];
|
|
1708
|
+
return Z.length && (j.beforeNS[W] = Z), z.length && (j.duringNS[W] = z), q.length && (j.afterNS[W] = q), j;
|
|
1709
|
+
}, { before: T[0], beforeNS: {}, during: T[1], duringNS: {}, after: T[2], afterNS: {} });
|
|
1708
1710
|
}(L, V);
|
|
1709
|
-
return Promise.resolve(
|
|
1711
|
+
return Promise.resolve(ut({ action: g, data: { exact: P.before, namespaced: P.beforeNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(l) {
|
|
1710
1712
|
function p() {
|
|
1711
|
-
var
|
|
1712
|
-
if (L.match(
|
|
1713
|
-
return Promise.resolve(
|
|
1714
|
-
$.meta && $.meta.hasCallback &&
|
|
1713
|
+
var j = function() {
|
|
1714
|
+
if (L.match(be))
|
|
1715
|
+
return Promise.resolve(ut({ action: E({}, S, { type: X + "End" }), data: { exact: P.after, namespaced: P.afterNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function($) {
|
|
1716
|
+
$.meta && $.meta.hasCallback && Yt($.meta.rid, { payload: $ });
|
|
1715
1717
|
});
|
|
1716
1718
|
}();
|
|
1717
|
-
return
|
|
1719
|
+
return j && j.then ? j.then(function() {
|
|
1718
1720
|
return l;
|
|
1719
1721
|
}) : l;
|
|
1720
1722
|
}
|
|
1721
|
-
if (
|
|
1723
|
+
if (Dn(l, R.length))
|
|
1722
1724
|
return l;
|
|
1723
|
-
var S,
|
|
1725
|
+
var S, T = function() {
|
|
1724
1726
|
if (L !== X)
|
|
1725
|
-
return Promise.resolve(
|
|
1726
|
-
S =
|
|
1727
|
+
return Promise.resolve(ut({ action: E({}, l, { type: X }), data: { exact: P.during, namespaced: P.duringNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(j) {
|
|
1728
|
+
S = j;
|
|
1727
1729
|
});
|
|
1728
1730
|
S = l;
|
|
1729
1731
|
}();
|
|
1730
|
-
return
|
|
1732
|
+
return T && T.then ? T.then(p) : p();
|
|
1731
1733
|
});
|
|
1732
1734
|
} catch (l) {
|
|
1733
1735
|
return Promise.reject(l);
|
|
1734
1736
|
}
|
|
1735
|
-
var K, M,
|
|
1737
|
+
var K, M, Pe;
|
|
1736
1738
|
}(a, e, t, i, n)).then(function(g) {
|
|
1737
1739
|
return s = 1, o(g);
|
|
1738
1740
|
});
|
|
@@ -1745,7 +1747,7 @@ function oi(t, e, n) {
|
|
|
1745
1747
|
};
|
|
1746
1748
|
};
|
|
1747
1749
|
}
|
|
1748
|
-
function
|
|
1750
|
+
function si(t) {
|
|
1749
1751
|
return function(e) {
|
|
1750
1752
|
return function(n) {
|
|
1751
1753
|
return function(r) {
|
|
@@ -1760,7 +1762,7 @@ function ai(t) {
|
|
|
1760
1762
|
};
|
|
1761
1763
|
};
|
|
1762
1764
|
}
|
|
1763
|
-
var
|
|
1765
|
+
var ci = function() {
|
|
1764
1766
|
var t = this;
|
|
1765
1767
|
this.before = [], this.after = [], this.addMiddleware = function(e, n) {
|
|
1766
1768
|
t[n] = t[n].concat(e);
|
|
@@ -1778,86 +1780,86 @@ var si = function() {
|
|
|
1778
1780
|
} }, a = t[e].map(function(s) {
|
|
1779
1781
|
return s(o);
|
|
1780
1782
|
});
|
|
1781
|
-
return
|
|
1783
|
+
return _e.apply(void 0, a)(r)(i);
|
|
1782
1784
|
};
|
|
1783
1785
|
};
|
|
1784
1786
|
};
|
|
1785
1787
|
};
|
|
1786
1788
|
};
|
|
1787
|
-
function
|
|
1789
|
+
function ui(t) {
|
|
1788
1790
|
return function(e, n) {
|
|
1789
1791
|
e === void 0 && (e = {});
|
|
1790
1792
|
var r = {};
|
|
1791
1793
|
if (n.type === "initialize:aborted")
|
|
1792
1794
|
return e;
|
|
1793
1795
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
1794
|
-
var i =
|
|
1796
|
+
var i = rn(n.type, "registerPlugin"), o = t()[i];
|
|
1795
1797
|
if (!o || !i)
|
|
1796
1798
|
return e;
|
|
1797
1799
|
var a = n.enabled, s = o.config;
|
|
1798
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
1800
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, E({}, e, r);
|
|
1799
1801
|
}
|
|
1800
1802
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
1801
|
-
var f =
|
|
1802
|
-
return m && f ? (r[f] =
|
|
1803
|
+
var f = rn(n.type, O.initialize), m = t()[f];
|
|
1804
|
+
return m && f ? (r[f] = E({}, e[f], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), E({}, e, r)) : e;
|
|
1803
1805
|
}
|
|
1804
1806
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
1805
|
-
return r[n.name] =
|
|
1807
|
+
return r[n.name] = E({}, e[n.name], { loaded: !0 }), E({}, e, r);
|
|
1806
1808
|
switch (n.type) {
|
|
1807
1809
|
case O.disablePlugin:
|
|
1808
|
-
return
|
|
1810
|
+
return E({}, e, on(n.plugins, !1, e));
|
|
1809
1811
|
case O.enablePlugin:
|
|
1810
|
-
return
|
|
1812
|
+
return E({}, e, on(n.plugins, !0, e));
|
|
1811
1813
|
default:
|
|
1812
1814
|
return e;
|
|
1813
1815
|
}
|
|
1814
1816
|
};
|
|
1815
1817
|
}
|
|
1816
|
-
function
|
|
1818
|
+
function rn(t, e) {
|
|
1817
1819
|
return t.substring(e.length + 1, t.length);
|
|
1818
1820
|
}
|
|
1819
|
-
function
|
|
1821
|
+
function on(t, e, n) {
|
|
1820
1822
|
return t.reduce(function(r, i) {
|
|
1821
|
-
return r[i] =
|
|
1823
|
+
return r[i] = E({}, n[i], { enabled: e }), r;
|
|
1822
1824
|
}, n);
|
|
1823
1825
|
}
|
|
1824
|
-
function
|
|
1826
|
+
function Un(t) {
|
|
1825
1827
|
try {
|
|
1826
1828
|
return JSON.parse(JSON.stringify(t));
|
|
1827
1829
|
} catch {
|
|
1828
1830
|
}
|
|
1829
1831
|
return t;
|
|
1830
1832
|
}
|
|
1831
|
-
var
|
|
1832
|
-
function
|
|
1833
|
-
t === void 0 && (t =
|
|
1833
|
+
var li = { last: {}, history: [] };
|
|
1834
|
+
function di(t, e) {
|
|
1835
|
+
t === void 0 && (t = li);
|
|
1834
1836
|
var n = e.options, r = e.meta;
|
|
1835
1837
|
if (e.type === O.track) {
|
|
1836
|
-
var i =
|
|
1837
|
-
return
|
|
1838
|
+
var i = Un(E({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
1839
|
+
return E({}, t, { last: i, history: t.history.concat(i) });
|
|
1838
1840
|
}
|
|
1839
1841
|
return t;
|
|
1840
1842
|
}
|
|
1841
|
-
var
|
|
1842
|
-
function
|
|
1843
|
-
t === void 0 && (t =
|
|
1843
|
+
var hi = { actions: [] };
|
|
1844
|
+
function fi(t, e) {
|
|
1845
|
+
t === void 0 && (t = hi);
|
|
1844
1846
|
var n = e.payload;
|
|
1845
1847
|
switch (e.type) {
|
|
1846
1848
|
case "queue":
|
|
1847
1849
|
var r;
|
|
1848
|
-
return r = n && n.type && n.type === O.identify ? [e].concat(t.actions) : t.actions.concat(e),
|
|
1850
|
+
return r = n && n.type && n.type === O.identify ? [e].concat(t.actions) : t.actions.concat(e), E({}, t, { actions: r });
|
|
1849
1851
|
case "dequeue":
|
|
1850
1852
|
return [];
|
|
1851
1853
|
default:
|
|
1852
1854
|
return t;
|
|
1853
1855
|
}
|
|
1854
1856
|
}
|
|
1855
|
-
var
|
|
1856
|
-
function
|
|
1857
|
+
var Zn = /#.*$/;
|
|
1858
|
+
function pi(t) {
|
|
1857
1859
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
1858
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
1860
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(Zn, "") : "");
|
|
1859
1861
|
}
|
|
1860
|
-
var
|
|
1862
|
+
var Rn, Wn, Kn, Mn, mi = function(t) {
|
|
1861
1863
|
if (t === void 0 && (t = {}), !H)
|
|
1862
1864
|
return t;
|
|
1863
1865
|
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, f = o.hash, m = o.search, u = function(d) {
|
|
@@ -1868,42 +1870,42 @@ var Ln, An, Un, Zn, pi = function(t) {
|
|
|
1868
1870
|
return v.getAttribute("href");
|
|
1869
1871
|
}
|
|
1870
1872
|
}();
|
|
1871
|
-
return h ? h.match(/\?/) ? h : h + d : window.location.href.replace(
|
|
1872
|
-
}(m), c = { title: n, url: u, path:
|
|
1873
|
-
return r && r !== "" && (c.referrer = r),
|
|
1874
|
-
},
|
|
1875
|
-
function
|
|
1876
|
-
t === void 0 && (t =
|
|
1873
|
+
return h ? h.match(/\?/) ? h : h + d : window.location.href.replace(Zn, "");
|
|
1874
|
+
}(m), c = { title: n, url: u, path: pi(u), hash: f, search: m, width: a, height: s };
|
|
1875
|
+
return r && r !== "" && (c.referrer = r), E({}, c, t);
|
|
1876
|
+
}, gi = { last: {}, history: [] };
|
|
1877
|
+
function vi(t, e) {
|
|
1878
|
+
t === void 0 && (t = gi);
|
|
1877
1879
|
var n = e.options;
|
|
1878
1880
|
if (e.type === O.page) {
|
|
1879
|
-
var r =
|
|
1880
|
-
return
|
|
1881
|
+
var r = Un(E({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
1882
|
+
return E({}, t, { last: r, history: t.history.concat(r) });
|
|
1881
1883
|
}
|
|
1882
1884
|
return t;
|
|
1883
1885
|
}
|
|
1884
|
-
|
|
1886
|
+
Rn = function() {
|
|
1885
1887
|
if (!H)
|
|
1886
1888
|
return !1;
|
|
1887
1889
|
var t = navigator.appVersion;
|
|
1888
1890
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
1889
|
-
}(),
|
|
1890
|
-
var
|
|
1891
|
-
function
|
|
1892
|
-
t === void 0 && (t =
|
|
1891
|
+
}(), Wn = H ? document.referrer : null, Kn = Yr(), Mn = Gr();
|
|
1892
|
+
var an = { initialized: !1, sessionId: tt(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: Rn }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: Mn, locale: Kn, campaign: {}, referrer: Wn };
|
|
1893
|
+
function yi(t, e) {
|
|
1894
|
+
t === void 0 && (t = an);
|
|
1893
1895
|
var n = t.initialized, r = e.campaign;
|
|
1894
1896
|
switch (e.type) {
|
|
1895
1897
|
case O.campaign:
|
|
1896
|
-
return
|
|
1898
|
+
return E({}, t, { campaign: r });
|
|
1897
1899
|
case O.offline:
|
|
1898
|
-
return
|
|
1900
|
+
return E({}, t, { offline: !0 });
|
|
1899
1901
|
case O.online:
|
|
1900
|
-
return
|
|
1902
|
+
return E({}, t, { offline: !1 });
|
|
1901
1903
|
default:
|
|
1902
|
-
return n ? t :
|
|
1904
|
+
return n ? t : E({}, an, t, { initialized: !0 });
|
|
1903
1905
|
}
|
|
1904
1906
|
}
|
|
1905
|
-
var
|
|
1906
|
-
function
|
|
1907
|
+
var wi = ["plugins", "reducers", "storage"];
|
|
1908
|
+
function bi(t, e, n) {
|
|
1907
1909
|
if (H) {
|
|
1908
1910
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
1909
1911
|
t.split(" ").forEach(function(i) {
|
|
@@ -1911,36 +1913,36 @@ function wi(t, e, n) {
|
|
|
1911
1913
|
});
|
|
1912
1914
|
}
|
|
1913
1915
|
}
|
|
1914
|
-
function
|
|
1915
|
-
var e =
|
|
1916
|
+
function ki(t) {
|
|
1917
|
+
var e = bi.bind(null, "online offline", function(n) {
|
|
1916
1918
|
return Promise.resolve(!navigator.onLine).then(t);
|
|
1917
1919
|
});
|
|
1918
1920
|
return e(!0), function(n) {
|
|
1919
1921
|
return e(!1);
|
|
1920
1922
|
};
|
|
1921
1923
|
}
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
1924
|
+
function Xn() {
|
|
1925
|
+
return me("analytics", []), function(t) {
|
|
1924
1926
|
return function(e, n, r) {
|
|
1925
1927
|
var i = t(e, n, r), o = i.dispatch;
|
|
1926
1928
|
return Object.assign(i, { dispatch: function(a) {
|
|
1927
|
-
return
|
|
1929
|
+
return Se[Ie].analytics.push(a.action || a), o(a);
|
|
1928
1930
|
} });
|
|
1929
1931
|
};
|
|
1930
1932
|
};
|
|
1931
1933
|
}
|
|
1932
|
-
function
|
|
1934
|
+
function sn(t) {
|
|
1933
1935
|
return function() {
|
|
1934
|
-
return
|
|
1936
|
+
return _e(_e.apply(null, arguments), Xn());
|
|
1935
1937
|
};
|
|
1936
1938
|
}
|
|
1937
|
-
function
|
|
1938
|
-
return t ?
|
|
1939
|
+
function ht(t) {
|
|
1940
|
+
return t ? $n(t) ? t : [t] : [];
|
|
1939
1941
|
}
|
|
1940
|
-
function
|
|
1942
|
+
function cn(t, e, n) {
|
|
1941
1943
|
t === void 0 && (t = {});
|
|
1942
|
-
var r, i, o =
|
|
1943
|
-
return e && (
|
|
1944
|
+
var r, i, o = tt();
|
|
1945
|
+
return e && (Ce[o] = (r = e, i = function(a) {
|
|
1944
1946
|
for (var s, f = a || Array.prototype.slice.call(arguments), m = 0; m < f.length; m++)
|
|
1945
1947
|
if (G(f[m])) {
|
|
1946
1948
|
s = f[m];
|
|
@@ -1949,9 +1951,9 @@ function rn(t, e, n) {
|
|
|
1949
1951
|
return s;
|
|
1950
1952
|
}(n), function(a) {
|
|
1951
1953
|
i && i(a), r(a);
|
|
1952
|
-
})),
|
|
1954
|
+
})), E({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
1953
1955
|
}
|
|
1954
|
-
function
|
|
1956
|
+
function Ii(t) {
|
|
1955
1957
|
t === void 0 && (t = {});
|
|
1956
1958
|
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(l, p) {
|
|
1957
1959
|
if (G(p))
|
|
@@ -1965,67 +1967,67 @@ function ki(t) {
|
|
|
1965
1967
|
l.pluginEnabled[p.name] = !(p.enabled === !1 || p.config.enabled === !1), delete p.enabled, p.methods && (l.methods[p.name] = Object.keys(p.methods).reduce(function($, W) {
|
|
1966
1968
|
var N;
|
|
1967
1969
|
return $[W] = (N = p.methods[W], function() {
|
|
1968
|
-
for (var Z = Array.prototype.slice.call(arguments), z = new Array(N.length),
|
|
1969
|
-
z[
|
|
1970
|
+
for (var Z = Array.prototype.slice.call(arguments), z = new Array(N.length), q = 0; q < Z.length; q++)
|
|
1971
|
+
z[q] = Z[q];
|
|
1970
1972
|
return z[z.length] = b, N.apply({ instance: b }, z);
|
|
1971
1973
|
}), $;
|
|
1972
1974
|
}, {}), delete p.methods);
|
|
1973
|
-
var
|
|
1974
|
-
if (l.events = Array.from(
|
|
1975
|
+
var T = Object.keys(p).concat(S), j = new Set(l.events.concat(T));
|
|
1976
|
+
if (l.events = Array.from(j), l.pluginsArray = l.pluginsArray.concat(p), l.plugins[p.name])
|
|
1975
1977
|
throw new Error(p.name + "AlreadyLoaded");
|
|
1976
1978
|
return l.plugins[p.name] = p, l.plugins[p.name].loaded || (l.plugins[p.name].loaded = function() {
|
|
1977
1979
|
return !0;
|
|
1978
1980
|
}), l;
|
|
1979
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem:
|
|
1980
|
-
return function(p, S,
|
|
1981
|
-
return S.getState("user")[p] || (
|
|
1981
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: pe, setItem: me, removeItem: Oe }, o = /* @__PURE__ */ function(l) {
|
|
1982
|
+
return function(p, S, T) {
|
|
1983
|
+
return S.getState("user")[p] || (T && F(T) && T[p] ? T[p] : Ht(l)[p] || pe(bt(p)) || null);
|
|
1982
1984
|
};
|
|
1983
1985
|
}(i), a = r.plugins, s = r.events.filter(function(l) {
|
|
1984
|
-
return !
|
|
1985
|
-
}).sort(), f = new Set(s.concat(
|
|
1986
|
-
return !
|
|
1986
|
+
return !wt.includes(l);
|
|
1987
|
+
}).sort(), f = new Set(s.concat(He).filter(function(l) {
|
|
1988
|
+
return !wt.includes(l);
|
|
1987
1989
|
})), m = Array.from(f).sort(), u = function() {
|
|
1988
1990
|
return a;
|
|
1989
|
-
}, c = new
|
|
1991
|
+
}, c = new ci(), d = c.addMiddleware, h = c.removeMiddleware, v = c.dynamicMiddlewares, w = function() {
|
|
1990
1992
|
throw new Error("Abort disabled inListener");
|
|
1991
|
-
}, y =
|
|
1992
|
-
_.anonymousId || (_.anonymousId =
|
|
1993
|
-
var I =
|
|
1993
|
+
}, y = Br(), k = Ht(i), _ = E({}, k, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
|
|
1994
|
+
_.anonymousId || (_.anonymousId = tt());
|
|
1995
|
+
var I = E({ enable: function(l, p) {
|
|
1994
1996
|
return new Promise(function(S) {
|
|
1995
|
-
|
|
1997
|
+
P.dispatch({ type: O.enablePlugin, plugins: ht(l), _: { originalAction: O.enablePlugin } }, S, [p]);
|
|
1996
1998
|
});
|
|
1997
1999
|
}, disable: function(l, p) {
|
|
1998
2000
|
return new Promise(function(S) {
|
|
1999
|
-
|
|
2001
|
+
P.dispatch({ type: O.disablePlugin, plugins: ht(l), _: { originalAction: O.disablePlugin } }, S, [p]);
|
|
2000
2002
|
});
|
|
2001
|
-
} }, r.methods), g = !1, b = { identify: function(l, p, S,
|
|
2003
|
+
} }, r.methods), g = !1, b = { identify: function(l, p, S, T) {
|
|
2002
2004
|
try {
|
|
2003
|
-
var
|
|
2004
|
-
|
|
2005
|
-
var Z =
|
|
2005
|
+
var j = re(l) ? l : null, $ = F(l) ? l : p, W = S || {}, N = b.user();
|
|
2006
|
+
me(bt(te), j);
|
|
2007
|
+
var Z = j || $.userId || o(te, b, $);
|
|
2006
2008
|
return Promise.resolve(new Promise(function(z) {
|
|
2007
|
-
|
|
2009
|
+
P.dispatch(E({ type: O.identifyStart, userId: Z, traits: $ || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== j && { previousId: N.id }), z, [p, S, T]);
|
|
2008
2010
|
}));
|
|
2009
2011
|
} catch (z) {
|
|
2010
2012
|
return Promise.reject(z);
|
|
2011
2013
|
}
|
|
2012
|
-
}, track: function(l, p, S,
|
|
2014
|
+
}, track: function(l, p, S, T) {
|
|
2013
2015
|
try {
|
|
2014
|
-
var
|
|
2015
|
-
if (!
|
|
2016
|
+
var j = F(l) ? l.event : l;
|
|
2017
|
+
if (!j || !re(j))
|
|
2016
2018
|
throw new Error("EventMissing");
|
|
2017
2019
|
var $ = F(l) ? l : p || {}, W = F(S) ? S : {};
|
|
2018
2020
|
return Promise.resolve(new Promise(function(N) {
|
|
2019
|
-
|
|
2021
|
+
P.dispatch({ type: O.trackStart, event: j, properties: $, options: W, userId: o(te, b, p), anonymousId: o(ye, b, p) }, N, [p, S, T]);
|
|
2020
2022
|
}));
|
|
2021
2023
|
} catch (N) {
|
|
2022
2024
|
return Promise.reject(N);
|
|
2023
2025
|
}
|
|
2024
2026
|
}, page: function(l, p, S) {
|
|
2025
2027
|
try {
|
|
2026
|
-
var
|
|
2028
|
+
var T = F(l) ? l : {}, j = F(p) ? p : {};
|
|
2027
2029
|
return Promise.resolve(new Promise(function($) {
|
|
2028
|
-
|
|
2030
|
+
P.dispatch({ type: O.pageStart, properties: mi(T), options: j, userId: o(te, b, T), anonymousId: o(ye, b, T) }, $, [l, p, S]);
|
|
2029
2031
|
}));
|
|
2030
2032
|
} catch ($) {
|
|
2031
2033
|
return Promise.reject($);
|
|
@@ -2033,13 +2035,13 @@ function ki(t) {
|
|
|
2033
2035
|
}, user: function(l) {
|
|
2034
2036
|
if (l === te || l === "id")
|
|
2035
2037
|
return o(te, b);
|
|
2036
|
-
if (l ===
|
|
2037
|
-
return o(
|
|
2038
|
+
if (l === ye || l === "anonId")
|
|
2039
|
+
return o(ye, b);
|
|
2038
2040
|
var p = b.getState("user");
|
|
2039
|
-
return l ?
|
|
2041
|
+
return l ? Wt(p, l) : p;
|
|
2040
2042
|
}, reset: function(l) {
|
|
2041
2043
|
return new Promise(function(p) {
|
|
2042
|
-
|
|
2044
|
+
P.dispatch({ type: O.resetStart }, p, l);
|
|
2043
2045
|
});
|
|
2044
2046
|
}, ready: function(l) {
|
|
2045
2047
|
return g && l({ plugins: I, instance: b }), b.on(O.ready, function(p) {
|
|
@@ -2052,24 +2054,24 @@ function ki(t) {
|
|
|
2052
2054
|
throw new Error(".on disabled for " + l);
|
|
2053
2055
|
var S = /Start$|Start:/;
|
|
2054
2056
|
if (l === "*") {
|
|
2055
|
-
var
|
|
2057
|
+
var T = function(N) {
|
|
2056
2058
|
return function(Z) {
|
|
2057
2059
|
return function(z) {
|
|
2058
2060
|
return z.type.match(S) && p({ payload: z, instance: b, plugins: a }), Z(z);
|
|
2059
2061
|
};
|
|
2060
2062
|
};
|
|
2061
|
-
},
|
|
2063
|
+
}, j = function(N) {
|
|
2062
2064
|
return function(Z) {
|
|
2063
2065
|
return function(z) {
|
|
2064
2066
|
return z.type.match(S) || p({ payload: z, instance: b, plugins: a }), Z(z);
|
|
2065
2067
|
};
|
|
2066
2068
|
};
|
|
2067
2069
|
};
|
|
2068
|
-
return d(
|
|
2069
|
-
h(
|
|
2070
|
+
return d(T, Me), d(j, Xe), function() {
|
|
2071
|
+
h(T, Me), h(j, Xe);
|
|
2070
2072
|
};
|
|
2071
2073
|
}
|
|
2072
|
-
var $ = l.match(S) ?
|
|
2074
|
+
var $ = l.match(S) ? Me : Xe, W = function(N) {
|
|
2073
2075
|
return function(Z) {
|
|
2074
2076
|
return function(z) {
|
|
2075
2077
|
return z.type === l && p({ payload: z, instance: b, plugins: a, abort: w }), Z(z);
|
|
@@ -2084,56 +2086,56 @@ function ki(t) {
|
|
|
2084
2086
|
return !1;
|
|
2085
2087
|
if (l === O.bootstrap)
|
|
2086
2088
|
throw new Error(".once disabled for " + l);
|
|
2087
|
-
var S = b.on(l, function(
|
|
2088
|
-
p({ payload:
|
|
2089
|
+
var S = b.on(l, function(T) {
|
|
2090
|
+
p({ payload: T.payload, instance: b, plugins: a, abort: w }), S();
|
|
2089
2091
|
});
|
|
2090
2092
|
return S;
|
|
2091
2093
|
}, getState: function(l) {
|
|
2092
|
-
var p =
|
|
2093
|
-
return l ?
|
|
2094
|
+
var p = P.getState();
|
|
2095
|
+
return l ? Wt(p, l) : Object.assign({}, p);
|
|
2094
2096
|
}, dispatch: function(l) {
|
|
2095
2097
|
var p = re(l) ? { type: l } : l;
|
|
2096
|
-
if (
|
|
2098
|
+
if (He.includes(p.type))
|
|
2097
2099
|
throw new Error("reserved action " + p.type);
|
|
2098
|
-
var S =
|
|
2099
|
-
|
|
2100
|
+
var S = E({}, p, { _: E({ originalAction: p.type }, l._ || {}) });
|
|
2101
|
+
P.dispatch(S);
|
|
2100
2102
|
}, enablePlugin: I.enable, disablePlugin: I.disable, plugins: I, storage: { getItem: i.getItem, setItem: function(l, p, S) {
|
|
2101
|
-
|
|
2103
|
+
P.dispatch({ type: O.setItemStart, key: l, value: p, options: S });
|
|
2102
2104
|
}, removeItem: function(l, p) {
|
|
2103
|
-
|
|
2105
|
+
P.dispatch({ type: O.removeItemStart, key: l, options: p });
|
|
2104
2106
|
} }, setAnonymousId: function(l, p) {
|
|
2105
2107
|
b.storage.setItem(ie, l, p);
|
|
2106
|
-
}, events: { core:
|
|
2108
|
+
}, events: { core: He, plugins: s } }, A = r.middlewares.concat([function(l) {
|
|
2107
2109
|
return function(p) {
|
|
2108
2110
|
return function(S) {
|
|
2109
|
-
return S.meta || (S.meta =
|
|
2111
|
+
return S.meta || (S.meta = cn()), p(S);
|
|
2110
2112
|
};
|
|
2111
2113
|
};
|
|
2112
|
-
}, v(
|
|
2114
|
+
}, v(Me), ai(b, u, { all: m, plugins: s }), si(i), ni(b), ii(b), v(Xe)]), C = { context: yi, user: ri(i), page: vi, track: di, plugins: ui(u), queue: fi }, x = _e, D = _e;
|
|
2113
2115
|
if (H && t.debug) {
|
|
2114
2116
|
var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2115
|
-
L && (x = L({ trace: !0, traceLimit: 25 })),
|
|
2116
|
-
return arguments.length === 0 ?
|
|
2117
|
+
L && (x = L({ trace: !0, traceLimit: 25 })), D = function() {
|
|
2118
|
+
return arguments.length === 0 ? Xn() : F(typeof arguments[0]) ? sn() : sn().apply(null, arguments);
|
|
2117
2119
|
};
|
|
2118
2120
|
}
|
|
2119
2121
|
var X, U = function(l) {
|
|
2120
2122
|
return Object.keys(l).reduce(function(p, S) {
|
|
2121
|
-
return
|
|
2123
|
+
return wi.includes(S) || (p[S] = l[S]), p;
|
|
2122
2124
|
}, {});
|
|
2123
2125
|
}(t), V = r.pluginsArray.reduce(function(l, p) {
|
|
2124
|
-
var S = p.name,
|
|
2125
|
-
return l[S] = { enabled: $, initialized: !!$ && !p.initialize, loaded: !!
|
|
2126
|
-
}, {}), R = { context: U, user: _, plugins: V },
|
|
2127
|
-
for (var p = Object.keys(l), S = {},
|
|
2128
|
-
var
|
|
2129
|
-
typeof l[
|
|
2126
|
+
var S = p.name, T = p.config, j = p.loaded, $ = r.pluginEnabled[S];
|
|
2127
|
+
return l[S] = { enabled: $, initialized: !!$ && !p.initialize, loaded: !!j({ config: T }), config: T }, l;
|
|
2128
|
+
}, {}), R = { context: U, user: _, plugins: V }, P = Nn(function(l) {
|
|
2129
|
+
for (var p = Object.keys(l), S = {}, T = 0; T < p.length; T++) {
|
|
2130
|
+
var j = p[T];
|
|
2131
|
+
typeof l[j] === ne && (S[j] = l[j]);
|
|
2130
2132
|
}
|
|
2131
2133
|
var $, W = Object.keys(S);
|
|
2132
2134
|
try {
|
|
2133
2135
|
(function(N) {
|
|
2134
2136
|
Object.keys(N).forEach(function(Z) {
|
|
2135
2137
|
var z = N[Z];
|
|
2136
|
-
if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type:
|
|
2138
|
+
if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type: Qr }) === ee)
|
|
2137
2139
|
throw new Error("reducer " + Z + " " + ee);
|
|
2138
2140
|
});
|
|
2139
2141
|
})(S);
|
|
@@ -2143,69 +2145,69 @@ function ki(t) {
|
|
|
2143
2145
|
return function(N, Z) {
|
|
2144
2146
|
if (N === void 0 && (N = {}), $)
|
|
2145
2147
|
throw $;
|
|
2146
|
-
for (var z = !1,
|
|
2147
|
-
var
|
|
2148
|
-
if (typeof
|
|
2149
|
-
var
|
|
2150
|
-
throw new Error(
|
|
2148
|
+
for (var z = !1, q = {}, xe = 0; xe < W.length; xe++) {
|
|
2149
|
+
var Ue = W[xe], $t = N[Ue], it = (0, S[Ue])($t, Z);
|
|
2150
|
+
if (typeof it === ee) {
|
|
2151
|
+
var nr = ei(Ue, Z);
|
|
2152
|
+
throw new Error(nr);
|
|
2151
2153
|
}
|
|
2152
|
-
|
|
2154
|
+
q[Ue] = it, z = z || it !== $t;
|
|
2153
2155
|
}
|
|
2154
|
-
return z ?
|
|
2156
|
+
return z ? q : N;
|
|
2155
2157
|
};
|
|
2156
|
-
}(
|
|
2157
|
-
|
|
2158
|
-
var
|
|
2159
|
-
return X.apply(null, [
|
|
2158
|
+
}(E({}, C, e)), R, D(x(ti.apply(void 0, A))));
|
|
2159
|
+
P.dispatch = (X = P.dispatch, function(l, p, S) {
|
|
2160
|
+
var T = E({}, l, { meta: cn(l.meta, p, ht(S)) });
|
|
2161
|
+
return X.apply(null, [T]);
|
|
2160
2162
|
});
|
|
2161
2163
|
var K = Object.keys(a);
|
|
2162
|
-
|
|
2164
|
+
P.dispatch({ type: O.bootstrap, plugins: K, config: U, params: y, user: _, initialUser: n, persistedUser: k });
|
|
2163
2165
|
var M = K.filter(function(l) {
|
|
2164
2166
|
return r.pluginEnabled[l];
|
|
2165
|
-
}),
|
|
2167
|
+
}), Pe = K.filter(function(l) {
|
|
2166
2168
|
return !r.pluginEnabled[l];
|
|
2167
2169
|
});
|
|
2168
|
-
return
|
|
2169
|
-
var S = l.bootstrap,
|
|
2170
|
-
S && G(S) && S({ instance: b, config:
|
|
2171
|
-
}),
|
|
2172
|
-
|
|
2170
|
+
return P.dispatch({ type: O.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(l, p) {
|
|
2171
|
+
var S = l.bootstrap, T = l.config, j = l.name;
|
|
2172
|
+
S && G(S) && S({ instance: b, config: T, payload: l }), P.dispatch({ type: O.registerPluginType(j), name: j, enabled: r.pluginEnabled[j], plugin: l }), r.pluginsArray.length === p + 1 && P.dispatch({ type: O.initializeStart, plugins: M, disabled: Pe });
|
|
2173
|
+
}), ki(function(l) {
|
|
2174
|
+
P.dispatch({ type: l ? O.offline : O.online });
|
|
2173
2175
|
}), function(l, p, S) {
|
|
2174
2176
|
setInterval(function() {
|
|
2175
|
-
return
|
|
2177
|
+
return Ln(l, p, S);
|
|
2176
2178
|
}, 3e3);
|
|
2177
|
-
}(
|
|
2179
|
+
}(P, u, b), b;
|
|
2178
2180
|
}
|
|
2179
|
-
var
|
|
2180
|
-
function
|
|
2181
|
-
return
|
|
2181
|
+
var Me = "before", Xe = "after", ze = "cookie", ce = Jn(), Vn = nt, Si = nt;
|
|
2182
|
+
function Fn(t) {
|
|
2183
|
+
return ce ? nt(t, "", -1) : Oe(t);
|
|
2182
2184
|
}
|
|
2183
|
-
function
|
|
2184
|
-
if (
|
|
2185
|
-
return
|
|
2185
|
+
function Jn() {
|
|
2186
|
+
if (ce !== void 0)
|
|
2187
|
+
return ce;
|
|
2186
2188
|
var t = "cookiecookie";
|
|
2187
2189
|
try {
|
|
2188
|
-
|
|
2190
|
+
nt(t, t), ce = document.cookie.indexOf(t) !== -1, Fn(t);
|
|
2189
2191
|
} catch {
|
|
2190
|
-
|
|
2192
|
+
ce = !1;
|
|
2191
2193
|
}
|
|
2192
|
-
return
|
|
2194
|
+
return ce;
|
|
2193
2195
|
}
|
|
2194
|
-
function
|
|
2196
|
+
function nt(t, e, n, r, i, o) {
|
|
2195
2197
|
if (typeof window < "u") {
|
|
2196
2198
|
var a = arguments.length > 1;
|
|
2197
|
-
return
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
var
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
var
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
function
|
|
2199
|
+
return ce === !1 && (a ? me(t, e) : pe(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]);
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
var Ne = "localStorage", _i = Ot.bind(null, "localStorage");
|
|
2203
|
+
Ee("localStorage", "getItem", pe);
|
|
2204
|
+
Ee("localStorage", "setItem", me);
|
|
2205
|
+
Ee("localStorage", "removeItem", Oe);
|
|
2206
|
+
var Ae = "sessionStorage", Oi = Ot.bind(null, "sessionStorage");
|
|
2207
|
+
Ee("sessionStorage", "getItem", pe);
|
|
2208
|
+
Ee("sessionStorage", "setItem", me);
|
|
2209
|
+
Ee("sessionStorage", "removeItem", Oe);
|
|
2210
|
+
function ke(t) {
|
|
2209
2211
|
var e = t;
|
|
2210
2212
|
try {
|
|
2211
2213
|
if ((e = JSON.parse(t)) === "true")
|
|
@@ -2220,57 +2222,57 @@ function we(t) {
|
|
|
2220
2222
|
if (e !== null && e !== "")
|
|
2221
2223
|
return e;
|
|
2222
2224
|
}
|
|
2223
|
-
var
|
|
2224
|
-
function
|
|
2225
|
+
var Ei = _i(), Pi = Oi(), xi = Jn();
|
|
2226
|
+
function Hn(t, e) {
|
|
2225
2227
|
if (t) {
|
|
2226
|
-
var n =
|
|
2227
|
-
if (r && !
|
|
2228
|
+
var n = Et(e), r = !jt(n), i = Pt(n) ? ke(localStorage.getItem(t)) : void 0;
|
|
2229
|
+
if (r && !ve(i))
|
|
2228
2230
|
return i;
|
|
2229
|
-
var o =
|
|
2231
|
+
var o = xt(n) ? ke(Vn(t)) : void 0;
|
|
2230
2232
|
if (r && o)
|
|
2231
2233
|
return o;
|
|
2232
|
-
var a =
|
|
2234
|
+
var a = Tt(n) ? ke(sessionStorage.getItem(t)) : void 0;
|
|
2233
2235
|
if (r && a)
|
|
2234
2236
|
return a;
|
|
2235
|
-
var s =
|
|
2237
|
+
var s = pe(t);
|
|
2236
2238
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2237
2239
|
}
|
|
2238
2240
|
}
|
|
2239
|
-
function
|
|
2240
|
-
if (t && !
|
|
2241
|
-
var r = {}, i =
|
|
2242
|
-
return
|
|
2241
|
+
function Ti(t, e, n) {
|
|
2242
|
+
if (t && !ve(e)) {
|
|
2243
|
+
var r = {}, i = Et(n), o = JSON.stringify(e), a = !jt(i);
|
|
2244
|
+
return Pt(i) && (r[Ne] = Ve(Ne, e, ke(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ne] : xt(i) && (r[ze] = Ve(ze, e, ke(Vn(t))), Si(t, o), a) ? r[ze] : Tt(i) && (r[Ae] = Ve(Ae, e, ke(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ae] : (r[$e] = Ve($e, e, pe(t)), me(t, e), a ? r[$e] : r);
|
|
2243
2245
|
}
|
|
2244
2246
|
}
|
|
2245
2247
|
function ji(t, e) {
|
|
2246
2248
|
if (t) {
|
|
2247
|
-
var n =
|
|
2248
|
-
return !
|
|
2249
|
+
var n = Et(e), r = Hn(t, Tn), i = {};
|
|
2250
|
+
return !ve(r.localStorage) && Pt(n) && (localStorage.removeItem(t), i[Ne] = r.localStorage), !ve(r.cookie) && xt(n) && (Fn(t), i[ze] = r.cookie), !ve(r.sessionStorage) && Tt(n) && (sessionStorage.removeItem(t), i[Ae] = r.sessionStorage), !ve(r.global) && rt(n, $e) && (Oe(t), i[$e] = r.global), i;
|
|
2249
2251
|
}
|
|
2250
2252
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return t ? re(t) ? t : t.storage :
|
|
2253
|
+
function Et(t) {
|
|
2254
|
+
return t ? re(t) ? t : t.storage : xn;
|
|
2253
2255
|
}
|
|
2254
|
-
function
|
|
2255
|
-
return
|
|
2256
|
+
function Pt(t) {
|
|
2257
|
+
return Ei && rt(t, Ne);
|
|
2256
2258
|
}
|
|
2257
|
-
function
|
|
2258
|
-
return
|
|
2259
|
+
function xt(t) {
|
|
2260
|
+
return xi && rt(t, ze);
|
|
2259
2261
|
}
|
|
2260
|
-
function
|
|
2261
|
-
return Pi &&
|
|
2262
|
+
function Tt(t) {
|
|
2263
|
+
return Pi && rt(t, Ae);
|
|
2262
2264
|
}
|
|
2263
|
-
function
|
|
2264
|
-
return t ===
|
|
2265
|
+
function jt(t) {
|
|
2266
|
+
return t === Tn || t === "all";
|
|
2265
2267
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return t ===
|
|
2268
|
+
function rt(t, e) {
|
|
2269
|
+
return t === xn || t === e || jt(t);
|
|
2268
2270
|
}
|
|
2269
|
-
function
|
|
2271
|
+
function Ve(t, e, n) {
|
|
2270
2272
|
return { location: t, current: e, previous: n };
|
|
2271
2273
|
}
|
|
2272
|
-
var
|
|
2273
|
-
function
|
|
2274
|
+
var Ci = { setItem: Ti, getItem: Hn, removeItem: ji };
|
|
2275
|
+
function $i(t, e, n) {
|
|
2274
2276
|
return e in t ? Object.defineProperty(t, e, {
|
|
2275
2277
|
value: n,
|
|
2276
2278
|
enumerable: !0,
|
|
@@ -2278,7 +2280,7 @@ function Ci(t, e, n) {
|
|
|
2278
2280
|
writable: !0
|
|
2279
2281
|
}) : t[e] = n, t;
|
|
2280
2282
|
}
|
|
2281
|
-
function
|
|
2283
|
+
function un(t, e) {
|
|
2282
2284
|
var n = Object.keys(t);
|
|
2283
2285
|
if (Object.getOwnPropertySymbols) {
|
|
2284
2286
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2288,24 +2290,24 @@ function on(t, e) {
|
|
|
2288
2290
|
}
|
|
2289
2291
|
return n;
|
|
2290
2292
|
}
|
|
2291
|
-
function
|
|
2293
|
+
function ln(t) {
|
|
2292
2294
|
for (var e = 1; e < arguments.length; e++) {
|
|
2293
2295
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2294
|
-
e % 2 ?
|
|
2295
|
-
|
|
2296
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2296
|
+
e % 2 ? un(Object(n), !0).forEach(function(r) {
|
|
2297
|
+
$i(t, r, n[r]);
|
|
2298
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : un(Object(n)).forEach(function(r) {
|
|
2297
2299
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2298
2300
|
});
|
|
2299
2301
|
}
|
|
2300
2302
|
return t;
|
|
2301
2303
|
}
|
|
2302
|
-
function
|
|
2304
|
+
function zi() {
|
|
2303
2305
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2304
|
-
storage:
|
|
2306
|
+
storage: Ci
|
|
2305
2307
|
};
|
|
2306
|
-
return
|
|
2308
|
+
return Ii(ln(ln({}, e), t));
|
|
2307
2309
|
}
|
|
2308
|
-
function
|
|
2310
|
+
function Ni(t, e) {
|
|
2309
2311
|
e = e || {};
|
|
2310
2312
|
var n, r, i = [], o = e.max || 1 / 0;
|
|
2311
2313
|
function a() {
|
|
@@ -2327,8 +2329,8 @@ function zi(t, e) {
|
|
|
2327
2329
|
}
|
|
2328
2330
|
};
|
|
2329
2331
|
}
|
|
2330
|
-
const
|
|
2331
|
-
function
|
|
2332
|
+
const Yn = "@sesamy/sesamy-js", Gn = "1.0.2";
|
|
2333
|
+
function Ai(t) {
|
|
2332
2334
|
if (!(typeof window > "u")) {
|
|
2333
2335
|
var e = window, n = e.addEventListener, r = e.history, i = e.location, o = i.pathname;
|
|
2334
2336
|
n("popstate", function() {
|
|
@@ -2336,7 +2338,7 @@ function Ni(t) {
|
|
|
2336
2338
|
}), ["push", "replace"].map(function(a) {
|
|
2337
2339
|
var s = "".concat(a, "State"), f = r[s];
|
|
2338
2340
|
r[s] = function() {
|
|
2339
|
-
var m = arguments, u =
|
|
2341
|
+
var m = arguments, u = Di(arguments[2]);
|
|
2340
2342
|
return o !== u && (o = u, setTimeout(function() {
|
|
2341
2343
|
return t(m[2]);
|
|
2342
2344
|
}, 0)), f.apply(r, arguments);
|
|
@@ -2344,27 +2346,27 @@ function Ni(t) {
|
|
|
2344
2346
|
});
|
|
2345
2347
|
}
|
|
2346
2348
|
}
|
|
2347
|
-
function
|
|
2349
|
+
function Li(t, e) {
|
|
2348
2350
|
var n = t.indexOf(e);
|
|
2349
2351
|
return n > -1 ? t.slice(0, n) : t;
|
|
2350
2352
|
}
|
|
2351
|
-
function
|
|
2353
|
+
function Di(t) {
|
|
2352
2354
|
return ["#", "?"].forEach(function(e) {
|
|
2353
|
-
return t =
|
|
2355
|
+
return t = Li(t, e);
|
|
2354
2356
|
}), t;
|
|
2355
2357
|
}
|
|
2356
|
-
function
|
|
2357
|
-
|
|
2358
|
-
|
|
2358
|
+
function Ui() {
|
|
2359
|
+
Ai(() => {
|
|
2360
|
+
ae.page();
|
|
2359
2361
|
});
|
|
2360
2362
|
}
|
|
2361
|
-
var
|
|
2362
|
-
function
|
|
2363
|
+
var dn = "EventListener";
|
|
2364
|
+
function Zi(t) {
|
|
2363
2365
|
return function(e, n, r, i) {
|
|
2364
|
-
var o = r ||
|
|
2366
|
+
var o = r || Ur, a = i || !1;
|
|
2365
2367
|
if (!H)
|
|
2366
2368
|
return o;
|
|
2367
|
-
var s =
|
|
2369
|
+
var s = Be(n), f = Be(e, !0);
|
|
2368
2370
|
if (!f.length)
|
|
2369
2371
|
throw new Error("noElements");
|
|
2370
2372
|
if (!s.length)
|
|
@@ -2372,9 +2374,9 @@ function Ui(t) {
|
|
|
2372
2374
|
var m = [];
|
|
2373
2375
|
return function u(c) {
|
|
2374
2376
|
c && (m = []);
|
|
2375
|
-
for (var d = c ? "add" +
|
|
2377
|
+
for (var d = c ? "add" + dn : "remove" + dn, h = 0; h < f.length; h++) {
|
|
2376
2378
|
var v = f[h];
|
|
2377
|
-
m[h] = c ? a && a.once ?
|
|
2379
|
+
m[h] = c ? a && a.once ? Ri(o) : o : m[h] || o;
|
|
2378
2380
|
for (var w = 0; w < s.length; w++)
|
|
2379
2381
|
v[d] ? v["on" + s[w]] = c ? m[h] : null : v[d](s[w], m[h], a);
|
|
2380
2382
|
}
|
|
@@ -2382,9 +2384,9 @@ function Ui(t) {
|
|
|
2382
2384
|
}(t);
|
|
2383
2385
|
};
|
|
2384
2386
|
}
|
|
2385
|
-
function
|
|
2387
|
+
function Be(t, e) {
|
|
2386
2388
|
if (re(t))
|
|
2387
|
-
return e ?
|
|
2389
|
+
return e ? Be(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2388
2390
|
return a.trim();
|
|
2389
2391
|
});
|
|
2390
2392
|
var n;
|
|
@@ -2393,31 +2395,31 @@ function Ge(t, e) {
|
|
|
2393
2395
|
r[i] = t[i];
|
|
2394
2396
|
return r;
|
|
2395
2397
|
}
|
|
2396
|
-
var o =
|
|
2398
|
+
var o = Hr(t);
|
|
2397
2399
|
return e ? o.map(function(a) {
|
|
2398
|
-
return re(a) ?
|
|
2400
|
+
return re(a) ? Be(a, !0) : a;
|
|
2399
2401
|
}).flat() : o;
|
|
2400
2402
|
}
|
|
2401
|
-
function
|
|
2403
|
+
function Ri(t, e) {
|
|
2402
2404
|
var n;
|
|
2403
2405
|
return function() {
|
|
2404
2406
|
return t && (n = t.apply(e || this, arguments), t = null), n;
|
|
2405
2407
|
};
|
|
2406
2408
|
}
|
|
2407
|
-
var
|
|
2408
|
-
function
|
|
2409
|
+
var ft = Zi("Event");
|
|
2410
|
+
function Bn(t, e) {
|
|
2409
2411
|
return H && G(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), G(n) ? function() {
|
|
2410
2412
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2411
2413
|
} : r) : window[t] = e;
|
|
2412
2414
|
var n, r, i;
|
|
2413
2415
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
var
|
|
2417
|
-
function
|
|
2418
|
-
if (
|
|
2416
|
+
Bn.bind(null, "onerror");
|
|
2417
|
+
Bn.bind(null, "onload");
|
|
2418
|
+
var qn = typeof window > "u", hn = "hidden";
|
|
2419
|
+
function Wi(t) {
|
|
2420
|
+
if (qn)
|
|
2419
2421
|
return !1;
|
|
2420
|
-
var e =
|
|
2422
|
+
var e = Ki(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2421
2423
|
return t(!!document[e]);
|
|
2422
2424
|
}, i = function() {
|
|
2423
2425
|
return document.addEventListener(n, r);
|
|
@@ -2426,15 +2428,15 @@ function Ri(t) {
|
|
|
2426
2428
|
return document.removeEventListener(n, r), i;
|
|
2427
2429
|
};
|
|
2428
2430
|
}
|
|
2429
|
-
function
|
|
2431
|
+
function Ki() {
|
|
2430
2432
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2431
|
-
return
|
|
2433
|
+
return qn || hn in document ? hn : t.reduce(function(e, n) {
|
|
2432
2434
|
var r = n + "Hidden";
|
|
2433
2435
|
return !e && r in document ? r : e;
|
|
2434
2436
|
}, null);
|
|
2435
2437
|
}
|
|
2436
|
-
var
|
|
2437
|
-
function
|
|
2438
|
+
var Mi = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
|
|
2439
|
+
function Xi(t, e) {
|
|
2438
2440
|
e === void 0 && (e = {});
|
|
2439
2441
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2440
2442
|
var f = this, m = !1;
|
|
@@ -2445,12 +2447,12 @@ function Mi(t, e) {
|
|
|
2445
2447
|
};
|
|
2446
2448
|
}(t, e.throttle || 1e4), r = [];
|
|
2447
2449
|
function i() {
|
|
2448
|
-
var a =
|
|
2450
|
+
var a = Wi(function(s) {
|
|
2449
2451
|
s || n({ type: "tabVisible" });
|
|
2450
2452
|
});
|
|
2451
|
-
return r = [a].concat(
|
|
2452
|
-
return
|
|
2453
|
-
})).concat(
|
|
2453
|
+
return r = [a].concat(Mi.map(function(s) {
|
|
2454
|
+
return ft(document, s, n);
|
|
2455
|
+
})).concat(ft(window, "load", n)).concat(ft(window, "scroll", n, { capture: !0, passive: !0 })), o;
|
|
2454
2456
|
}
|
|
2455
2457
|
function o() {
|
|
2456
2458
|
r.map(function(a) {
|
|
@@ -2461,16 +2463,16 @@ function Mi(t, e) {
|
|
|
2461
2463
|
return o(), i;
|
|
2462
2464
|
};
|
|
2463
2465
|
}
|
|
2464
|
-
function
|
|
2466
|
+
function Vi(t) {
|
|
2465
2467
|
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, f = t.throttle, m = f === void 0 ? 2e3 : f, u = !1, c = !1, d = /* @__PURE__ */ new Date(), h = function() {
|
|
2466
2468
|
return clearTimeout(e);
|
|
2467
2469
|
};
|
|
2468
2470
|
function v(y) {
|
|
2469
|
-
h(), o && !u && o(
|
|
2470
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
2471
|
+
h(), o && !u && o(je(d), y), i && u && (u = !1, i(je(n), y), d = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
2472
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(je(d), y));
|
|
2471
2473
|
}, s);
|
|
2472
2474
|
}
|
|
2473
|
-
var w =
|
|
2475
|
+
var w = Xi(v, { throttle: m });
|
|
2474
2476
|
return { disable: function() {
|
|
2475
2477
|
c = !0, u = !1, h();
|
|
2476
2478
|
var y = w();
|
|
@@ -2478,14 +2480,14 @@ function Xi(t) {
|
|
|
2478
2480
|
return c = !1, d = /* @__PURE__ */ new Date(), v({ type: "load" }), y();
|
|
2479
2481
|
};
|
|
2480
2482
|
}, getStatus: function() {
|
|
2481
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 :
|
|
2483
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : je(d, c), idle: u ? je(n, c) : 0 };
|
|
2482
2484
|
} };
|
|
2483
2485
|
}
|
|
2484
|
-
function
|
|
2486
|
+
function je(t, e) {
|
|
2485
2487
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
2486
2488
|
}
|
|
2487
|
-
const
|
|
2488
|
-
class
|
|
2489
|
+
const fn = 5e3;
|
|
2490
|
+
class Fi {
|
|
2489
2491
|
constructor(e) {
|
|
2490
2492
|
Y(this, "element");
|
|
2491
2493
|
Y(this, "isInViewport", !1);
|
|
@@ -2506,10 +2508,10 @@ class Vi {
|
|
|
2506
2508
|
{
|
|
2507
2509
|
threshold: 0
|
|
2508
2510
|
}
|
|
2509
|
-
), this.observer.observe(this.element),
|
|
2511
|
+
), this.observer.observe(this.element), Vi({
|
|
2510
2512
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
2511
2513
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
2512
|
-
timeout:
|
|
2514
|
+
timeout: fn
|
|
2513
2515
|
});
|
|
2514
2516
|
}
|
|
2515
2517
|
/**
|
|
@@ -2528,7 +2530,7 @@ class Vi {
|
|
|
2528
2530
|
), this.isInViewport = e;
|
|
2529
2531
|
}
|
|
2530
2532
|
handleAwake(e, n) {
|
|
2531
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
2533
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * fn : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
2532
2534
|
}
|
|
2533
2535
|
trackAwake(e, n) {
|
|
2534
2536
|
!e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
|
|
@@ -2537,45 +2539,57 @@ class Vi {
|
|
|
2537
2539
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
2538
2540
|
}
|
|
2539
2541
|
}
|
|
2540
|
-
|
|
2541
|
-
function
|
|
2542
|
+
const pn = "sesamy_session_id";
|
|
2543
|
+
function Ji() {
|
|
2544
|
+
let t = sessionStorage.getItem(pn);
|
|
2545
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(pn, t)), t;
|
|
2546
|
+
}
|
|
2547
|
+
let Qn = !1, kt, mn, qe;
|
|
2548
|
+
function Hi({
|
|
2542
2549
|
clientId: t,
|
|
2543
2550
|
enabled: e = !0,
|
|
2544
|
-
endpoint: n =
|
|
2551
|
+
endpoint: n = Cr
|
|
2545
2552
|
}) {
|
|
2546
|
-
if (
|
|
2553
|
+
if (kt = t, mn = e, qe = n, !mn)
|
|
2547
2554
|
return;
|
|
2548
|
-
|
|
2549
|
-
const r = new
|
|
2555
|
+
Ui();
|
|
2556
|
+
const r = new Fi({
|
|
2550
2557
|
element: document.body,
|
|
2551
2558
|
viewCallback: () => {
|
|
2552
|
-
|
|
2559
|
+
ae.page();
|
|
2553
2560
|
},
|
|
2554
2561
|
activeDurationCallback: (i, o) => {
|
|
2555
|
-
|
|
2562
|
+
ae.track("activeDuration", {
|
|
2556
2563
|
duration: i,
|
|
2557
2564
|
flushing: o
|
|
2558
2565
|
});
|
|
2559
2566
|
},
|
|
2560
2567
|
idleDurationCallback: (i, o) => {
|
|
2561
|
-
|
|
2568
|
+
ae.track("idleDuration", {
|
|
2562
2569
|
duration: i,
|
|
2563
2570
|
flushing: o
|
|
2564
2571
|
});
|
|
2565
2572
|
}
|
|
2566
2573
|
});
|
|
2567
|
-
|
|
2574
|
+
Gi(document.body, () => {
|
|
2568
2575
|
r.flush();
|
|
2576
|
+
}), window.addEventListener(he.AUTHENTICATED, async (i) => {
|
|
2577
|
+
const o = i;
|
|
2578
|
+
await ae.identify(o.detail.sub);
|
|
2579
|
+
}), window.addEventListener(he.LOGOUT, async () => {
|
|
2580
|
+
await ae.track("logout", {}), Ct.flush(), await ae.reset();
|
|
2569
2581
|
});
|
|
2570
2582
|
}
|
|
2571
|
-
function
|
|
2583
|
+
function er(t) {
|
|
2572
2584
|
return JSON.stringify(
|
|
2573
2585
|
t.map((e) => ({
|
|
2574
2586
|
...e,
|
|
2587
|
+
clientId: kt,
|
|
2588
|
+
requestId: Math.random().toString(36).slice(2, 9),
|
|
2589
|
+
sessionId: Ji(),
|
|
2575
2590
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
event: e.event || "page",
|
|
2591
|
+
version: Gn,
|
|
2592
|
+
event: e.event,
|
|
2579
2593
|
context: {
|
|
2580
2594
|
page: {
|
|
2581
2595
|
url: window.location.hostname,
|
|
@@ -2585,18 +2599,18 @@ function Bn(t) {
|
|
|
2585
2599
|
referrer: document.referrer
|
|
2586
2600
|
},
|
|
2587
2601
|
locale: navigator.language,
|
|
2588
|
-
library:
|
|
2602
|
+
library: Yn,
|
|
2589
2603
|
userAgent: navigator.userAgent,
|
|
2590
|
-
clientId:
|
|
2604
|
+
clientId: kt
|
|
2591
2605
|
}
|
|
2592
2606
|
}))
|
|
2593
2607
|
);
|
|
2594
2608
|
}
|
|
2595
|
-
const
|
|
2609
|
+
const Ct = Ni(
|
|
2596
2610
|
async (t) => {
|
|
2597
2611
|
if (t.length > 0) {
|
|
2598
|
-
const e =
|
|
2599
|
-
|
|
2612
|
+
const e = er(t);
|
|
2613
|
+
Qn ? navigator.sendBeacon(qe, e) : (await fetch(qe, {
|
|
2600
2614
|
method: "POST",
|
|
2601
2615
|
body: e,
|
|
2602
2616
|
headers: {
|
|
@@ -2612,22 +2626,24 @@ const qn = zi(
|
|
|
2612
2626
|
// 3s
|
|
2613
2627
|
}
|
|
2614
2628
|
);
|
|
2615
|
-
function
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2629
|
+
function pt(t) {
|
|
2630
|
+
var e;
|
|
2631
|
+
if (t.anonymousId)
|
|
2632
|
+
if ((e = t.properties) != null && e.flushing) {
|
|
2633
|
+
const n = { ...t };
|
|
2634
|
+
delete n.properties.flushing, navigator.sendBeacon(qe, er([n]));
|
|
2635
|
+
} else
|
|
2636
|
+
Ct.push(t);
|
|
2637
|
+
}
|
|
2638
|
+
const ae = zi({
|
|
2639
|
+
app: Yn,
|
|
2640
|
+
version: Gn,
|
|
2625
2641
|
plugins: [
|
|
2626
2642
|
{
|
|
2627
2643
|
name: "custom-analytics-plugin",
|
|
2628
2644
|
page: ({ payload: t }) => {
|
|
2629
2645
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
2630
|
-
|
|
2646
|
+
pt({
|
|
2631
2647
|
anonymousId: n,
|
|
2632
2648
|
userId: r,
|
|
2633
2649
|
properties: e,
|
|
@@ -2637,46 +2653,55 @@ const Je = $i({
|
|
|
2637
2653
|
},
|
|
2638
2654
|
track: ({ payload: t }) => {
|
|
2639
2655
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
2640
|
-
|
|
2656
|
+
pt({
|
|
2641
2657
|
anonymousId: n,
|
|
2642
2658
|
userId: r,
|
|
2643
2659
|
properties: e,
|
|
2644
2660
|
event: i,
|
|
2645
2661
|
type: "track"
|
|
2646
2662
|
});
|
|
2663
|
+
},
|
|
2664
|
+
identify: ({ payload: t }) => {
|
|
2665
|
+
const { properties: e, anonymousId: n, userId: r } = t;
|
|
2666
|
+
pt({
|
|
2667
|
+
anonymousId: n,
|
|
2668
|
+
userId: r,
|
|
2669
|
+
properties: e,
|
|
2670
|
+
type: "identify"
|
|
2671
|
+
});
|
|
2647
2672
|
}
|
|
2648
2673
|
}
|
|
2649
2674
|
]
|
|
2650
2675
|
});
|
|
2651
|
-
function
|
|
2652
|
-
return
|
|
2676
|
+
function Yi() {
|
|
2677
|
+
return Qn = !0, Ct.flush();
|
|
2653
2678
|
}
|
|
2654
|
-
const
|
|
2655
|
-
function
|
|
2656
|
-
|
|
2679
|
+
const tr = /* @__PURE__ */ new Map();
|
|
2680
|
+
function Gi(t, e) {
|
|
2681
|
+
tr.set(t, e);
|
|
2657
2682
|
}
|
|
2658
2683
|
window.addEventListener("beforeunload", () => {
|
|
2659
|
-
|
|
2684
|
+
tr.forEach((t, e) => {
|
|
2660
2685
|
t.bind(e)();
|
|
2661
|
-
}),
|
|
2686
|
+
}), Yi();
|
|
2662
2687
|
});
|
|
2663
|
-
async function
|
|
2664
|
-
|
|
2688
|
+
async function Bi(t) {
|
|
2689
|
+
Hi({
|
|
2665
2690
|
clientId: t.clientId,
|
|
2666
2691
|
// The default client id can be overridden by the config
|
|
2667
2692
|
...t.analytics
|
|
2668
|
-
}),
|
|
2693
|
+
}), await $r(t), Dr(t.namespace), It(he.READY, {});
|
|
2669
2694
|
}
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2695
|
+
const Fe = document.getElementById("sesamy-js");
|
|
2696
|
+
if (Fe != null && Fe.textContent)
|
|
2672
2697
|
try {
|
|
2673
|
-
const t = JSON.parse(
|
|
2674
|
-
|
|
2698
|
+
const t = JSON.parse(Fe.textContent);
|
|
2699
|
+
Bi(t);
|
|
2675
2700
|
} catch (t) {
|
|
2676
2701
|
console.error("Failed to parse config", t);
|
|
2677
2702
|
}
|
|
2678
|
-
const
|
|
2679
|
-
class
|
|
2703
|
+
const qi = "/sesamy.png";
|
|
2704
|
+
class Qi extends HTMLElement {
|
|
2680
2705
|
constructor() {
|
|
2681
2706
|
super();
|
|
2682
2707
|
Y(this, "user");
|
|
@@ -2686,7 +2711,7 @@ class Bi extends HTMLElement {
|
|
|
2686
2711
|
}
|
|
2687
2712
|
async connectedCallback() {
|
|
2688
2713
|
if (this.setupEventListeners(), !window.sesamy) {
|
|
2689
|
-
window.addEventListener(
|
|
2714
|
+
window.addEventListener(he.READY, () => this._handleProfile());
|
|
2690
2715
|
return;
|
|
2691
2716
|
}
|
|
2692
2717
|
this._handleProfile();
|
|
@@ -2695,7 +2720,7 @@ class Bi extends HTMLElement {
|
|
|
2695
2720
|
this.innerHTML = `
|
|
2696
2721
|
<div>
|
|
2697
2722
|
<a href="https://docs.sesamy.com" target="_blank">
|
|
2698
|
-
<img src="${
|
|
2723
|
+
<img src="${qi}" class="logo" alt="Vite logo" />
|
|
2699
2724
|
</a>
|
|
2700
2725
|
<h1>Sesamy JS</h1>
|
|
2701
2726
|
<p class="read-the-docs">
|
|
@@ -2733,4 +2758,4 @@ class Bi extends HTMLElement {
|
|
|
2733
2758
|
});
|
|
2734
2759
|
}
|
|
2735
2760
|
}
|
|
2736
|
-
customElements.define("sesamy-app",
|
|
2761
|
+
customElements.define("sesamy-app", Qi);
|