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