@sesamy/sesamy-js 1.13.3 → 1.13.4

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.
@@ -21,13 +21,13 @@ function te(t, e) {
21
21
  return n;
22
22
  }
23
23
  var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
24
- function Ut(t) {
24
+ function Lt(t) {
25
25
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
26
26
  }
27
- function Lt(t, e) {
27
+ function Ut(t, e) {
28
28
  return t(e = { exports: {} }, e.exports), e.exports;
29
29
  }
30
- var de = Lt(function(t, e) {
30
+ var de = Ut(function(t, e) {
31
31
  Object.defineProperty(e, "__esModule", { value: !0 });
32
32
  var n = function() {
33
33
  function r() {
@@ -58,8 +58,8 @@ var de = Lt(function(t, e) {
58
58
  return n.getInstance();
59
59
  };
60
60
  });
61
- Ut(de);
62
- var Dr = Ut(Lt(function(t, e) {
61
+ Lt(de);
62
+ var Dr = Lt(Ut(function(t, e) {
63
63
  var n = he && he.__awaiter || function(u, c, p, d) {
64
64
  return new (p || (p = Promise))(function(b, S) {
65
65
  function w(v) {
@@ -418,7 +418,7 @@ const Xe = (...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 pe = class Tt {
421
+ let me = class Tt {
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
  }
@@ -502,7 +502,7 @@ let pe = class Tt {
502
502
  }
503
503
  async set(e) {
504
504
  var n;
505
- const r = new pe({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
505
+ const r = new me({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
506
506
  await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
507
507
  }
508
508
  async clear(e) {
@@ -521,12 +521,12 @@ let pe = class Tt {
521
521
  return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
522
522
  }
523
523
  getIdTokenCacheKey(e) {
524
- return new pe({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
524
+ return new me({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
525
525
  }
526
526
  matchExistingCacheKey(e, n) {
527
527
  return n.filter((r) => {
528
528
  var i;
529
- const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], h = o.scope && s.reduce((f, u) => f && a.has(u), !0);
529
+ const o = me.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], h = o.scope && s.reduce((f, u) => f && a.has(u), !0);
530
530
  return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && h;
531
531
  })[0];
532
532
  }
@@ -620,7 +620,7 @@ const Ne = (t) => typeof t == "number", Qr = ["iss", "aud", "exp", "nbf", "iat",
620
620
  }
621
621
  return e;
622
622
  };
623
- var me = Lt(function(t, e) {
623
+ var ge = Ut(function(t, e) {
624
624
  var n = he && he.__assign || function() {
625
625
  return n = Object.assign || function(h) {
626
626
  for (var f, u = 1, c = arguments.length; u < c; u++)
@@ -667,9 +667,9 @@ var me = Lt(function(t, e) {
667
667
  s(h, "", n(n({}, f), { expires: -1 }));
668
668
  };
669
669
  });
670
- Ut(me), me.encode, me.parse, me.getAll;
671
- var ti = me.get, qn = me.set, Qn = me.remove;
672
- const Ie = { get(t) {
670
+ Lt(ge), ge.encode, ge.parse, ge.getAll;
671
+ var ti = ge.get, qn = ge.set, Qn = ge.remove;
672
+ const Se = { get(t) {
673
673
  const e = ti(t);
674
674
  if (e !== void 0)
675
675
  return JSON.parse(e);
@@ -680,13 +680,13 @@ const Ie = { get(t) {
680
680
  let n = {};
681
681
  e != null && e.cookieDomain && (n.domain = e.cookieDomain), Qn(t, n);
682
682
  } }, ni = { get(t) {
683
- return Ie.get(t) || Ie.get(`_legacy_${t}`);
683
+ return Se.get(t) || Se.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), qn(`_legacy_${t}`, JSON.stringify(e), r), Ie.save(t, e, n);
686
+ window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), qn(`_legacy_${t}`, JSON.stringify(e), r), Se.save(t, e, n);
687
687
  }, remove(t, e) {
688
688
  let n = {};
689
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Qn(t, n), Ie.remove(t, e), Ie.remove(`_legacy_${t}`, e);
689
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), Qn(t, n), Se.remove(t, e), Se.remove(`_legacy_${t}`, e);
690
690
  } }, ri = { get(t) {
691
691
  if (typeof sessionStorage > "u")
692
692
  return;
@@ -763,7 +763,7 @@ let ci = class {
763
763
  throw new Error(`Invalid cache location "${n}"`);
764
764
  r = en(n)();
765
765
  }
766
- this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie : ni, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
766
+ this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Se : ni, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
767
767
  const i = e.useCookiesForTransactions ? this.cookieStorage : ri;
768
768
  var o;
769
769
  this.scope = Xe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new qr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Wn, this.cacheManager = new Br(r, r.allKeys ? void 0 : new ai(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 oi());
@@ -909,7 +909,7 @@ let ci = class {
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: Xe(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
912
- return n = Object.assign(Object.assign({}, Mr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new pe({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
912
+ return n = Object.assign(Object.assign({}, Mr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new me({ 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();
@@ -958,7 +958,7 @@ let ci = class {
958
958
  }
959
959
  }
960
960
  async _getTokenUsingRefreshToken(e) {
961
- const n = await this.cacheManager.get(new pe({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
961
+ const n = await this.cacheManager.get(new me({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
962
962
  if (!(n && n.refresh_token || this.worker)) {
963
963
  if (this.options.useRefreshTokensFallback)
964
964
  return await this._getTokenFromIFrame(e);
@@ -979,11 +979,11 @@ let ci = class {
979
979
  this.userCache.set("@@user@@", { id_token: n, decodedToken: r }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(i);
980
980
  }
981
981
  async _getIdTokenFromCache() {
982
- const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new pe({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
982
+ const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new me({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
983
983
  return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
984
984
  }
985
985
  async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
986
- const i = await this.cacheManager.get(new pe({ scope: e, audience: n, clientId: r }), 60);
986
+ const i = await this.cacheManager.get(new me({ scope: e, audience: n, clientId: r }), 60);
987
987
  if (i && i.access_token) {
988
988
  const { access_token: o, oauthTokenScope: a, expires_in: s } = i, h = await this._getIdTokenFromCache();
989
989
  return h && Object.assign(Object.assign({ id_token: h.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
@@ -998,7 +998,7 @@ async function ui(t) {
998
998
  const e = new ci(t);
999
999
  return await e.checkSession(), e;
1000
1000
  }
1001
- const Se = "sesamy.com", li = "https://sesa.my", di = "https://logs.sesamy.com/events", Ot = "sesamyCacheTimestamp";
1001
+ const fe = "sesamy.com", li = "https://sesa.my", di = "https://logs.sesamy.com/events", Ot = "sesamyCacheTimestamp";
1002
1002
  var q = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t.USER_ATTRIBUTE_CHANGED = "sesamyUserAttributeChanged", t.PURCHASE = "sesamyJsPurchase", t))(q || {});
1003
1003
  let G, er;
1004
1004
  const We = "sesamyAccessToken";
@@ -1009,25 +1009,37 @@ function Nt() {
1009
1009
  const e = tr(t);
1010
1010
  return (!e || !e.exp || e.exp < (/* @__PURE__ */ new Date()).getTime() / 1e3) && localStorage.removeItem(We), t;
1011
1011
  }
1012
- async function hi(t) {
1013
- if (t.enabled !== !1 && (er = t.organization, G = await ui({
1014
- domain: t.endpoint || `token.${Se}`,
1012
+ function hi(t) {
1013
+ try {
1014
+ const e = new URL(t).hostname, n = e.split(".");
1015
+ return n.length > 1 ? n.slice(-2).join(".") : e;
1016
+ } catch {
1017
+ return null;
1018
+ }
1019
+ }
1020
+ async function fi(t) {
1021
+ if (t.enabled === !1)
1022
+ return;
1023
+ er = t.organization;
1024
+ const e = {
1025
+ domain: t.endpoint || `token.${fe}`,
1015
1026
  clientId: t.clientId
1016
- }), window.location.search.includes("code=")))
1027
+ };
1028
+ if (hi(window.location.href) !== fe && (e.cacheLocation = "localstorage", e.useRefreshTokens = !0), G = await ui(e), window.location.search.includes("code="))
1017
1029
  try {
1018
1030
  await G.handleRedirectCallback();
1019
- const e = await G.getUser();
1020
- ue(q.AUTHENTICATED, e);
1021
- const n = new URL(location.href), r = n.searchParams;
1022
- r.delete("code"), r.delete("state"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
1023
- } catch (e) {
1024
- console.error(e);
1031
+ const n = await G.getUser();
1032
+ ue(q.AUTHENTICATED, n);
1033
+ const r = new URL(location.href), i = r.searchParams;
1034
+ i.delete("code"), i.delete("state"), r.search = i.toString(), window.history.replaceState({}, document.title, r.toString());
1035
+ } catch (n) {
1036
+ console.error(n);
1025
1037
  }
1026
1038
  }
1027
1039
  async function Rt() {
1028
1040
  return Nt() ? !0 : G ? G.isAuthenticated() : !1;
1029
1041
  }
1030
- async function fi() {
1042
+ async function pi() {
1031
1043
  return Nt() ? {
1032
1044
  sub: "local",
1033
1045
  name: "Local User"
@@ -1054,7 +1066,7 @@ async function Ve(t = !0) {
1054
1066
  return null;
1055
1067
  }
1056
1068
  }
1057
- async function pi(t = {}) {
1069
+ async function mi(t = {}) {
1058
1070
  if (localStorage.removeItem(We), ue(q.LOGOUT, {}), !!G)
1059
1071
  return G.logout({
1060
1072
  ...t,
@@ -1079,7 +1091,7 @@ async function nr(t) {
1079
1091
  throw new Error("Invalid token");
1080
1092
  localStorage.setItem(We, t), ue(q.AUTHENTICATED, e);
1081
1093
  }
1082
- const mi = (t, e) => e.skipDedupe || e.method !== "GET", gi = (t, e) => e.method + "@" + t, yi = (t) => t.clone(), nn = ({ skip: t = mi, key: e = gi, resolver: n = yi } = {}) => {
1094
+ const gi = (t, e) => e.skipDedupe || e.method !== "GET", yi = (t, e) => e.method + "@" + t, vi = (t) => t.clone(), nn = ({ skip: t = gi, key: e = yi, resolver: n = vi } = {}) => {
1083
1095
  const r = /* @__PURE__ */ new Map();
1084
1096
  return (i) => (o, a) => {
1085
1097
  if (t(o, a))
@@ -1099,7 +1111,7 @@ const mi = (t, e) => e.skipDedupe || e.method !== "GET", gi = (t, e) => e.method
1099
1111
  return r.delete(s), Promise.reject(h);
1100
1112
  }
1101
1113
  };
1102
- }, vi = (t, e) => t * e, wi = (t) => t && t.ok, rn = ({ delayTimer: t = 500, delayRamp: e = vi, maxAttempts: n = 10, until: r = wi, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (h) => (f, u) => {
1114
+ }, wi = (t, e) => t * e, bi = (t) => t && t.ok, rn = ({ delayTimer: t = 500, delayRamp: e = wi, maxAttempts: n = 10, until: r = bi, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (h) => (f, u) => {
1103
1115
  let c = 0;
1104
1116
  if (s && s(f, u))
1105
1117
  return h(f, u);
@@ -1126,7 +1138,7 @@ const mi = (t, e) => e.skipDedupe || e.method !== "GET", gi = (t, e) => e.method
1126
1138
  throw d;
1127
1139
  return p(null, d);
1128
1140
  });
1129
- }, bi = "application/json", rr = "Content-Type", ke = Symbol(), ir = Symbol();
1141
+ }, ki = "application/json", rr = "Content-Type", Ie = Symbol(), ir = Symbol();
1130
1142
  function on(t = {}) {
1131
1143
  var e;
1132
1144
  return (e = Object.entries(t).find(([n]) => n.toLowerCase() === rr.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
@@ -1134,10 +1146,10 @@ function on(t = {}) {
1134
1146
  function an(t) {
1135
1147
  return /^application\/.*json.*/.test(t);
1136
1148
  }
1137
- const ge = function(t, e, n = !1) {
1149
+ const ye = function(t, e, n = !1) {
1138
1150
  return Object.entries(e).reduce((r, [i, o]) => {
1139
1151
  const a = t[i];
1140
- return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = ge(a, o, n) : r[i] = o, r;
1152
+ return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = ye(a, o, n) : r[i] = o, r;
1141
1153
  }, { ...t });
1142
1154
  }, je = {
1143
1155
  // Default options
@@ -1148,10 +1160,11 @@ const ge = function(t, e, n = !1) {
1148
1160
  polyfills: {
1149
1161
  // fetch: null,
1150
1162
  // FormData: null,
1163
+ // URL: null,
1151
1164
  // URLSearchParams: null,
1152
1165
  // performance: null,
1153
1166
  // PerformanceObserver: null,
1154
- // AbortController: null
1167
+ // AbortController: null,
1155
1168
  },
1156
1169
  polyfill(t, e = !0, n = !1, ...r) {
1157
1170
  const i = this.polyfills[t] || (typeof self < "u" ? self[t] : null) || (typeof global < "u" ? global[t] : null);
@@ -1160,25 +1173,25 @@ const ge = function(t, e, n = !1) {
1160
1173
  return n && i ? new i(...r) : i;
1161
1174
  }
1162
1175
  };
1163
- function ki(t, e = !1) {
1164
- je.options = e ? t : ge(je.options, t);
1165
- }
1166
1176
  function Ii(t, e = !1) {
1167
- je.polyfills = e ? t : ge(je.polyfills, t);
1177
+ je.options = e ? t : ye(je.options, t);
1178
+ }
1179
+ function Si(t, e = !1) {
1180
+ je.polyfills = e ? t : ye(je.polyfills, t);
1168
1181
  }
1169
- function Si(t) {
1182
+ function _i(t) {
1170
1183
  je.errorType = t;
1171
1184
  }
1172
- const _i = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1185
+ const Ei = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1173
1186
  class or extends Error {
1174
1187
  }
1175
- const Ei = (t) => {
1188
+ const Pi = (t) => {
1176
1189
  const e = /* @__PURE__ */ Object.create(null);
1177
1190
  t = t._addons.reduce((v, l) => l.beforeRequest && l.beforeRequest(v, t._options, e) || v, t);
1178
- const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, f = new Map(o), u = ge(i.options, r);
1191
+ const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, f = new Map(o), u = ye(i.options, r);
1179
1192
  let c = n;
1180
- const p = _i(s)((v, l) => (c = v, i.polyfill("fetch")(v, l)))(n, u), d = new Error(), b = p.catch((v) => {
1181
- throw { [ke]: v };
1193
+ const p = Ei(s)((v, l) => (c = v, i.polyfill("fetch")(v, l)))(n, u), d = new Error(), b = p.catch((v) => {
1194
+ throw { [Ie]: v };
1182
1195
  }).then((v) => {
1183
1196
  if (!v.ok) {
1184
1197
  const l = new or();
@@ -1197,7 +1210,7 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1197
1210
  }
1198
1211
  return v;
1199
1212
  }), S = (v) => v.catch((l) => {
1200
- const k = l.hasOwnProperty(ke), T = k ? l[ke] : l, O = (T == null ? void 0 : T.status) && f.get(T.status) || f.get(T == null ? void 0 : T.name) || k && f.has(ke) && f.get(ke);
1213
+ const k = l.hasOwnProperty(Ie), T = k ? l[Ie] : l, O = (T == null ? void 0 : T.status) && f.get(T.status) || f.get(T == null ? void 0 : T.name) || k && f.has(Ie) && f.get(Ie);
1201
1214
  if (O)
1202
1215
  return O(T, t);
1203
1216
  const C = f.get(ir);
@@ -1236,14 +1249,14 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1236
1249
  return this.error(500, v);
1237
1250
  },
1238
1251
  fetchError(v) {
1239
- return this.error(ke, v);
1252
+ return this.error(Ie, v);
1240
1253
  }
1241
1254
  }, _ = h.reduce((v, l) => ({
1242
1255
  ...v,
1243
1256
  ...typeof l.resolver == "function" ? l.resolver(v) : l.resolver
1244
1257
  }), P);
1245
1258
  return a.reduce((v, l) => l(v, t), _);
1246
- }, Pi = {
1259
+ }, Ti = {
1247
1260
  _url: "",
1248
1261
  _options: {},
1249
1262
  _config: je,
@@ -1269,7 +1282,7 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1269
1282
  ...this,
1270
1283
  _config: {
1271
1284
  ...this._config,
1272
- polyfills: e ? t : ge(this._config.polyfills, t)
1285
+ polyfills: e ? t : ye(this._config.polyfills, t)
1273
1286
  }
1274
1287
  };
1275
1288
  },
@@ -1283,11 +1296,11 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1283
1296
  };
1284
1297
  },
1285
1298
  options(t, e = !1) {
1286
- return { ...this, _options: e ? t : ge(this._options, t) };
1299
+ return { ...this, _options: e ? t : ye(this._options, t) };
1287
1300
  },
1288
1301
  headers(t) {
1289
1302
  const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
1290
- return { ...this, _options: ge(this._options, { headers: e }) };
1303
+ return { ...this, _options: ye(this._options, { headers: e }) };
1291
1304
  },
1292
1305
  accept(t) {
1293
1306
  return this.headers({ Accept: t });
@@ -1322,8 +1335,8 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1322
1335
  },
1323
1336
  fetch(t = this._options.method, e = "", n = null) {
1324
1337
  let r = this.url(e).options({ method: t });
1325
- const i = on(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || an(i));
1326
- return r = n ? o ? r.json(n, i) : r.body(n) : r, Ei(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
1338
+ const i = on(r._options.headers), o = this._config.polyfill("FormData", !1), a = typeof n == "object" && !(o && n instanceof o) && (!r._options.headers || !i || an(i));
1339
+ return r = n ? a ? r.json(n, i) : r.body(n) : r, Pi(r._deferred.reduce((s, h) => h(s, s._url, s._options), r));
1327
1340
  },
1328
1341
  get(t = "") {
1329
1342
  return this.fetch("GET", t);
@@ -1351,43 +1364,43 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1351
1364
  },
1352
1365
  json(t, e) {
1353
1366
  const n = on(this._options.headers);
1354
- return this.content(e || an(n) && n || bi).body(JSON.stringify(t));
1367
+ return this.content(e || an(n) && n || ki).body(JSON.stringify(t));
1355
1368
  }
1356
1369
  };
1357
1370
  function ie(t = "", e = {}) {
1358
- return { ...Pi, _url: t, _options: e };
1371
+ return { ...Ti, _url: t, _options: e };
1359
1372
  }
1360
1373
  ie.default = ie;
1361
- ie.options = ki;
1362
- ie.errorType = Si;
1363
- ie.polyfills = Ii;
1374
+ ie.options = Ii;
1375
+ ie.errorType = _i;
1376
+ ie.polyfills = Si;
1364
1377
  ie.WretchError = or;
1365
1378
  function ee() {
1366
1379
  sessionStorage.removeItem(Ot), ue(q.CLEAR_CACHE, {});
1367
1380
  }
1368
- function Ti(t) {
1369
- const e = t.endpoint || `https://api2.${Se}`, n = (g) => async (I, E) => {
1370
- let U = sessionStorage.getItem(Ot);
1371
- U || (U = Date.now().toString(), sessionStorage.setItem(Ot, U));
1381
+ function Oi(t) {
1382
+ const e = t.endpoint || `https://api2.${fe}`, n = (g) => async (I, E) => {
1383
+ let L = sessionStorage.getItem(Ot);
1384
+ L || (L = Date.now().toString(), sessionStorage.setItem(Ot, L));
1372
1385
  const Z = {
1373
1386
  ...E,
1374
1387
  headers: {
1375
1388
  ...E.headers,
1376
- "Cache-Timestamp": U
1389
+ "Cache-Timestamp": L
1377
1390
  }
1378
1391
  };
1379
1392
  return g(I, Z);
1380
- }, r = (g = !0) => (I) => async (E, U) => {
1393
+ }, r = (g = !1) => (I) => async (E, L) => {
1381
1394
  let Z = null;
1382
1395
  if (Z = await Ve(g), !Z) {
1383
1396
  if (g)
1384
1397
  throw new Error("No access token available");
1385
- return I(E, U);
1398
+ return I(E, L);
1386
1399
  }
1387
1400
  const N = {
1388
- ...U,
1401
+ ...L,
1389
1402
  headers: {
1390
- ...U.headers,
1403
+ ...L.headers,
1391
1404
  ...Z ? { Authorization: `Bearer ${Z}` } : {}
1392
1405
  }
1393
1406
  };
@@ -1395,7 +1408,7 @@ function Ti(t) {
1395
1408
  }, i = (g) => (I, E) => {
1396
1409
  if (E.headers.Authorization)
1397
1410
  return g(I, E);
1398
- const U = localStorage.getItem("__anon_id"), Z = btoa(`${U}:`), N = {
1411
+ const L = localStorage.getItem("__anon_id"), Z = btoa(`${L}:`), N = {
1399
1412
  ...E,
1400
1413
  headers: {
1401
1414
  ...E.headers,
@@ -1502,7 +1515,7 @@ function Ti(t) {
1502
1515
  const I = await o.url("/profile").patch(g).res();
1503
1516
  return ee(), I.ok;
1504
1517
  }
1505
- async function L() {
1518
+ async function U() {
1506
1519
  return await o.url("/payment-issues").get().json();
1507
1520
  }
1508
1521
  async function M() {
@@ -1515,7 +1528,7 @@ function Ti(t) {
1515
1528
  const I = await Ve(!1);
1516
1529
  if (!I)
1517
1530
  throw new Error("No access token available");
1518
- const E = new URL(`https://spotify-oas.${Se}/sesamy-callback`);
1531
+ const E = new URL(`https://spotify-oas.${fe}/sesamy-callback`);
1519
1532
  E.searchParams.set("access_token", I), E.searchParams.set("state", g), window.location.href = E.toString();
1520
1533
  }
1521
1534
  async function J(g) {
@@ -1531,10 +1544,10 @@ function Ti(t) {
1531
1544
  let E;
1532
1545
  switch (g.target) {
1533
1546
  case "account":
1534
- E = new URL(`https://account.${Se}/subscriptions/${t.clientId}`);
1547
+ E = new URL(`https://account.${fe}/subscriptions/${t.clientId}`);
1535
1548
  break;
1536
1549
  case "consume":
1537
- E = new URL(`https://consume.${Se}/@${t.clientId}/${g.sku}`), g.episodeId && (E.href += `/${g.episodeId}`);
1550
+ E = new URL(`https://consume.${fe}/@${t.clientId}/${g.sku}`), g.episodeId && (E.href += `/${g.episodeId}`);
1538
1551
  break;
1539
1552
  default:
1540
1553
  throw new Error("Invalid target");
@@ -1542,7 +1555,7 @@ function Ti(t) {
1542
1555
  return I && (E.hash = `#access_token=${I}`), g.shorten ? le(E.href, g.ttl) : E.href;
1543
1556
  }
1544
1557
  async function y() {
1545
- const g = await Ve(!1), I = new URL(`https://account.${Se}/subscriptions/${t.clientId}`);
1558
+ const g = await Ve(!1), I = new URL(`https://account.${fe}/subscriptions/${t.clientId}`);
1546
1559
  g && (I.hash = `#access_token=${g}`), window.location.href = I.toString();
1547
1560
  }
1548
1561
  return {
@@ -1568,7 +1581,7 @@ function Ti(t) {
1568
1581
  deleteTally: C,
1569
1582
  pushTally: R,
1570
1583
  getProduct: z,
1571
- getPaymentIssues: L,
1584
+ getPaymentIssues: U,
1572
1585
  autoOnboardProduct: J,
1573
1586
  isSpotifyLinked: M,
1574
1587
  unlinkSpotify: j,
@@ -1584,7 +1597,7 @@ function sn(t, e, n, r, i) {
1584
1597
  return t === i ? n : t;
1585
1598
  }
1586
1599
  var Ye = "undefined", cn = "object", jt = function() {
1587
- }, sr = "any", cr = "*", ve = "__", it = typeof process < "u" ? process : {};
1600
+ }, sr = "any", cr = "*", we = "__", it = typeof process < "u" ? process : {};
1588
1601
  it.env && it.env.NODE_ENV;
1589
1602
  var H = typeof document < "u";
1590
1603
  it.versions != null && it.versions.node != null;
@@ -1593,44 +1606,44 @@ H && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !
1593
1606
  function ur(t, e) {
1594
1607
  return e.charAt(0)[t]() + e.slice(1);
1595
1608
  }
1596
- var Oi = ur.bind(null, "toUpperCase"), ji = ur.bind(null, "toLowerCase");
1597
- function Ci(t) {
1598
- return lr(t) ? Oi("null") : typeof t == "object" ? Ui(t) : Object.prototype.toString.call(t).slice(8, -1);
1609
+ var ji = ur.bind(null, "toUpperCase"), Ci = ur.bind(null, "toLowerCase");
1610
+ function xi(t) {
1611
+ return lr(t) ? ji("null") : typeof t == "object" ? Ui(t) : Object.prototype.toString.call(t).slice(8, -1);
1599
1612
  }
1600
1613
  function ot(t, e) {
1601
1614
  e === void 0 && (e = !0);
1602
- var n = Ci(t);
1603
- return e ? ji(n) : n;
1615
+ var n = xi(t);
1616
+ return e ? Ci(n) : n;
1604
1617
  }
1605
1618
  function He(t, e) {
1606
1619
  return typeof e === t;
1607
1620
  }
1608
- var V = He.bind(null, "function"), se = He.bind(null, "string"), _e = He.bind(null, "undefined"), xi = He.bind(null, "boolean");
1621
+ var V = He.bind(null, "function"), se = He.bind(null, "string"), _e = He.bind(null, "undefined"), Ai = He.bind(null, "boolean");
1609
1622
  He.bind(null, "symbol");
1610
1623
  function lr(t) {
1611
1624
  return t === null;
1612
1625
  }
1613
- function Ai(t) {
1626
+ function $i(t) {
1614
1627
  return ot(t) === "number" && !isNaN(t);
1615
1628
  }
1616
1629
  function dr(t) {
1617
1630
  return ot(t) === "array";
1618
1631
  }
1619
1632
  function X(t) {
1620
- if (!$i(t))
1633
+ if (!Li(t))
1621
1634
  return !1;
1622
1635
  for (var e = t; Object.getPrototypeOf(e) !== null; )
1623
1636
  e = Object.getPrototypeOf(e);
1624
1637
  return Object.getPrototypeOf(t) === e;
1625
1638
  }
1626
- function $i(t) {
1639
+ function Li(t) {
1627
1640
  return t && (typeof t == "object" || t !== null);
1628
1641
  }
1629
1642
  function Ui(t) {
1630
1643
  return V(t.constructor) ? t.constructor.name : null;
1631
1644
  }
1632
- function Li(t) {
1633
- return t instanceof Error || se(t.message) && t.constructor && Ai(t.constructor.stackTraceLimit);
1645
+ function Ni(t) {
1646
+ return t instanceof Error || se(t.message) && t.constructor && $i(t.constructor.stackTraceLimit);
1634
1647
  }
1635
1648
  function hr(t, e) {
1636
1649
  if (typeof e != "object" || lr(e))
@@ -1638,7 +1651,7 @@ function hr(t, e) {
1638
1651
  if (e instanceof t)
1639
1652
  return !0;
1640
1653
  var n = ot(new t(""));
1641
- if (Li(e))
1654
+ if (Ni(e))
1642
1655
  for (; e; ) {
1643
1656
  if (ot(e) === n)
1644
1657
  return !0;
@@ -1650,9 +1663,9 @@ hr.bind(null, TypeError);
1650
1663
  hr.bind(null, SyntaxError);
1651
1664
  function ct(t, e) {
1652
1665
  var n = t instanceof Element || t instanceof HTMLDocument;
1653
- return n && e ? Ni(t, e) : n;
1666
+ return n && e ? Ri(t, e) : n;
1654
1667
  }
1655
- function Ni(t, e) {
1668
+ function Ri(t, e) {
1656
1669
  return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
1657
1670
  }
1658
1671
  function ut(t) {
@@ -1665,7 +1678,7 @@ ut(ct, "form");
1665
1678
  ut(ct, "button");
1666
1679
  ut(ct, "input");
1667
1680
  ut(ct, "select");
1668
- function Ri(t) {
1681
+ function zi(t) {
1669
1682
  return t ? dr(t) ? t : [t] : [];
1670
1683
  }
1671
1684
  function un(t) {
@@ -1675,19 +1688,19 @@ function un(t) {
1675
1688
  return null;
1676
1689
  }
1677
1690
  }
1678
- function zi() {
1691
+ function Di() {
1679
1692
  if (H) {
1680
1693
  var t = navigator, e = t.languages;
1681
1694
  return t.userLanguage || (e && e.length ? e[0] : t.language);
1682
1695
  }
1683
1696
  }
1684
- function Di() {
1697
+ function Mi() {
1685
1698
  try {
1686
1699
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
1687
1700
  } catch {
1688
1701
  }
1689
1702
  }
1690
- function Mi(t) {
1703
+ function Zi(t) {
1691
1704
  return function(e) {
1692
1705
  for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
1693
1706
  var o = un(n[1]), a = un(n[2]);
@@ -1695,7 +1708,7 @@ function Mi(t) {
1695
1708
  }
1696
1709
  for (var s in r) {
1697
1710
  var h = s.split("[");
1698
- h.length > 1 && (Zi(r, h.map(function(f) {
1711
+ h.length > 1 && (Ki(r, h.map(function(f) {
1699
1712
  return f.replace(/[?[\]\\ ]/g, "");
1700
1713
  }), r[s]), delete r[s]);
1701
1714
  }
@@ -1704,7 +1717,7 @@ function Mi(t) {
1704
1717
  return H && window.location.search.substring(1);
1705
1718
  }());
1706
1719
  }
1707
- function Zi(t, e, n) {
1720
+ function Ki(t, e, n) {
1708
1721
  for (var r = e.length - 1, i = 0; i < r; ++i) {
1709
1722
  var o = e[i];
1710
1723
  if (o === "__proto__" || o === "constructor")
@@ -1720,7 +1733,7 @@ function lt() {
1720
1733
  }
1721
1734
  return t;
1722
1735
  }
1723
- function Ki(t, e) {
1736
+ function Wi(t, e) {
1724
1737
  var n, r, i, o = null, a = 0, s = function() {
1725
1738
  a = /* @__PURE__ */ new Date(), o = null, i = t.apply(n, r);
1726
1739
  };
@@ -1731,17 +1744,17 @@ function Ki(t, e) {
1731
1744
  return n = this, r = arguments, f <= 0 ? (clearTimeout(o), o = null, a = h, i = t.apply(n, r)) : o || (o = setTimeout(s, f)), i;
1732
1745
  };
1733
1746
  }
1734
- var De = "global", Ce = ve + "global" + ve, xe = typeof self === cn && self.self === self && self || typeof global === cn && global.global === global && global || void 0;
1735
- function we(t) {
1747
+ var De = "global", Ce = we + "global" + we, xe = typeof self === cn && self.self === self && self || typeof global === cn && global.global === global && global || void 0;
1748
+ function be(t) {
1736
1749
  return xe[Ce][t];
1737
1750
  }
1738
- function be(t, e) {
1751
+ function ke(t, e) {
1739
1752
  return xe[Ce][t] = e;
1740
1753
  }
1741
1754
  function $e(t) {
1742
1755
  delete xe[Ce][t];
1743
1756
  }
1744
- function Ue(t, e, n) {
1757
+ function Le(t, e, n) {
1745
1758
  var r;
1746
1759
  try {
1747
1760
  if (Mt(t)) {
@@ -1775,7 +1788,7 @@ function A() {
1775
1788
  return t;
1776
1789
  }, A.apply(this, arguments);
1777
1790
  }
1778
- var ae = "function", re = "undefined", Wi = "@@redux/" + Math.random().toString(36), ln = /* @__PURE__ */ function() {
1791
+ var ae = "function", re = "undefined", Fi = "@@redux/" + Math.random().toString(36), ln = /* @__PURE__ */ function() {
1779
1792
  return typeof Symbol === ae && Symbol.observable || "@@observable";
1780
1793
  }(), Be = " != " + ae;
1781
1794
  function fr(t, e, n) {
@@ -1840,7 +1853,7 @@ function fr(t, e, n) {
1840
1853
  }, d;
1841
1854
  }, r;
1842
1855
  }
1843
- function Fi(t, e) {
1856
+ function Hi(t, e) {
1844
1857
  var n = e && e.type;
1845
1858
  return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + re;
1846
1859
  }
@@ -1854,7 +1867,7 @@ function Ae() {
1854
1867
  };
1855
1868
  });
1856
1869
  }
1857
- function Hi() {
1870
+ function Ji() {
1858
1871
  var t = arguments;
1859
1872
  return function(e) {
1860
1873
  return function(n, r, i) {
@@ -1867,21 +1880,21 @@ function Hi() {
1867
1880
  };
1868
1881
  };
1869
1882
  }
1870
- var ce = ve + "anon_id", ye = ve + "user_id", Pe = ve + "user_traits", oe = "userId", Ee = "anonymousId", rt = ["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"], Ct = ["name", "EVENTS", "config", "loaded"], x = rt.reduce(function(t, e) {
1883
+ var ce = we + "anon_id", ve = we + "user_id", Pe = we + "user_traits", oe = "userId", Ee = "anonymousId", rt = ["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"], Ct = ["name", "EVENTS", "config", "loaded"], x = rt.reduce(function(t, e) {
1871
1884
  return t[e] = e, t;
1872
1885
  }, { registerPluginType: function(t) {
1873
1886
  return "registerPlugin:" + t;
1874
1887
  }, pluginReadyType: function(t) {
1875
1888
  return "ready:" + t;
1876
1889
  } }), dn = /^utm_/, hn = /^an_prop_/, fn = /^an_trait_/;
1877
- function Ji(t) {
1890
+ function Xi(t) {
1878
1891
  var e = t.storage.setItem;
1879
1892
  return function(n) {
1880
1893
  return function(r) {
1881
1894
  return function(i) {
1882
1895
  if (i.type === x.bootstrap) {
1883
1896
  var o = i.params, a = i.user, s = i.persistedUser, h = i.initialUser, f = s.userId === a.userId;
1884
- s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), f || e(ye, a.userId), h.traits && e(Pe, A({}, f && s.traits ? s.traits : {}, h.traits));
1897
+ s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), f || e(ve, a.userId), h.traits && e(Pe, A({}, f && s.traits ? s.traits : {}, h.traits));
1885
1898
  var u = Object.keys(i.params);
1886
1899
  if (u.length) {
1887
1900
  var c = o.an_uid, p = o.an_event, d = u.reduce(function(b, S) {
@@ -1903,19 +1916,19 @@ function Ji(t) {
1903
1916
  };
1904
1917
  };
1905
1918
  }
1906
- function Xi(t) {
1919
+ function Vi(t) {
1907
1920
  return function(e, n) {
1908
1921
  if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === x.setItemEnd) {
1909
1922
  if (n.key === ce)
1910
1923
  return A({}, e, { anonymousId: n.value });
1911
- if (n.key === ye)
1924
+ if (n.key === ve)
1912
1925
  return A({}, e, { userId: n.value });
1913
1926
  }
1914
1927
  switch (n.type) {
1915
1928
  case x.identify:
1916
1929
  return Object.assign({}, e, { userId: n.userId, traits: A({}, e.traits, n.traits) });
1917
1930
  case x.reset:
1918
- return [ye, ce, Pe].forEach(function(r) {
1931
+ return [ve, ce, Pe].forEach(function(r) {
1919
1932
  t.removeItem(r);
1920
1933
  }), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
1921
1934
  default:
@@ -1924,25 +1937,25 @@ function Xi(t) {
1924
1937
  };
1925
1938
  }
1926
1939
  function pn(t) {
1927
- return { userId: t.getItem(ye), anonymousId: t.getItem(ce), traits: t.getItem(Pe) };
1940
+ return { userId: t.getItem(ve), anonymousId: t.getItem(ce), traits: t.getItem(Pe) };
1928
1941
  }
1929
1942
  var xt = function(t) {
1930
- return ve + "TEMP" + ve + t;
1943
+ return we + "TEMP" + we + t;
1931
1944
  };
1932
- function Vi(t) {
1945
+ function Yi(t) {
1933
1946
  var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
1934
1947
  return function(o) {
1935
1948
  return function(a) {
1936
1949
  return function(s) {
1937
1950
  var h = s.userId, f = s.traits, u = s.options;
1938
- if (s.type === x.reset && ([ye, Pe, ce].forEach(function(d) {
1951
+ if (s.type === x.reset && ([ve, Pe, ce].forEach(function(d) {
1939
1952
  r(d);
1940
1953
  }), [oe, Ee, "traits"].forEach(function(d) {
1941
1954
  $e(xt(d));
1942
1955
  })), s.type === x.identify) {
1943
1956
  i(ce) || n(ce, lt());
1944
- var c = i(ye), p = i(Pe) || {};
1945
- c && c !== h && o.dispatch({ type: x.userIdChanged, old: { userId: c, traits: p }, new: { userId: h, traits: f }, options: u }), h && n(ye, h), f && n(Pe, A({}, p, f));
1957
+ var c = i(ve), p = i(Pe) || {};
1958
+ c && c !== h && o.dispatch({ type: x.userIdChanged, old: { userId: c, traits: p }, new: { userId: h, traits: f }, options: u }), h && n(ve, h), f && n(Pe, A({}, p, f));
1946
1959
  }
1947
1960
  return a(s);
1948
1961
  };
@@ -1962,7 +1975,7 @@ function pr(t, e, n) {
1962
1975
  });
1963
1976
  });
1964
1977
  }
1965
- function Yi(t) {
1978
+ function Gi(t) {
1966
1979
  return { abort: t };
1967
1980
  }
1968
1981
  function mr(t, e, n) {
@@ -1980,7 +1993,7 @@ function mr(t, e, n) {
1980
1993
  return l.hasOwnProperty(O) && k[O] && k[O] !== l[O] && (T[O] = k[O]), T;
1981
1994
  }, l);
1982
1995
  }(p.payload, h), _ = r[P.meta.rid];
1983
- if (!_ && (w = S({ payload: P, config: a[d].config, instance: n, abort: Yi })) && X(w) && w.abort)
1996
+ if (!_ && (w = S({ payload: P, config: a[d].config, instance: n, abort: Gi })) && X(w) && w.abort)
1984
1997
  return void (r[P.meta.rid] = !0);
1985
1998
  if (!_) {
1986
1999
  var v = b + ":" + d;
@@ -2008,19 +2021,19 @@ var vt = function(t) {
2008
2021
  return function(_, v, l) {
2009
2022
  var k = v.config, T = v.name, O = T + "." + _.type;
2010
2023
  l && (O = l.event);
2011
- var C = _.type.match(Te) ? /* @__PURE__ */ function(R, z, K, $, L) {
2024
+ var C = _.type.match(Te) ? /* @__PURE__ */ function(R, z, K, $, U) {
2012
2025
  return function(M, j) {
2013
2026
  var W = $ ? $.name : R, J = j && Fe(j) ? j : K;
2014
2027
  if ($ && (!(J = j && Fe(j) ? j : [R]).includes(R) || J.length !== 1))
2015
2028
  throw new Error("Method " + z + " can only abort " + R + " plugin. " + JSON.stringify(J) + " input valid");
2016
- return A({}, L, { abort: { reason: M, plugins: J, caller: z, _: W } });
2029
+ return A({}, U, { abort: { reason: M, plugins: J, caller: z, _: W } });
2017
2030
  };
2018
2031
  }(T, O, P, l, _) : /* @__PURE__ */ function(R, z) {
2019
2032
  return function() {
2020
2033
  throw new Error(R.type + " action not cancellable. Remove abort in " + z);
2021
2034
  };
2022
2035
  }(_, O);
2023
- return { payload: Gi(_), instance: w, config: k || {}, abort: C };
2036
+ return { payload: Bi(_), instance: w, config: k || {}, abort: C };
2024
2037
  };
2025
2038
  }(r, d), S = e.exact.reduce(function(w, P) {
2026
2039
  var _ = P.pluginName, v = P.methodName, l = !1;
@@ -2045,13 +2058,13 @@ var vt = function(t) {
2045
2058
  throw new Error([j + " plugin is calling method " + M, "Plugins cant call self", "Use " + W.method + " " + (J ? "or " + J.method : "") + " in " + j + " plugin insteadof " + M].join(`
2046
2059
  `));
2047
2060
  }
2048
- }(C.methodName, C.pluginName), Promise.resolve(C.method({ payload: z, instance: r, abort: (K = z, $ = v, L = C.pluginName, function(M, j) {
2049
- return A({}, K, { abort: { reason: M, plugins: j || [$], caller: c, from: L || $ } });
2061
+ }(C.methodName, C.pluginName), Promise.resolve(C.method({ payload: z, instance: r, abort: (K = z, $ = v, U = C.pluginName, function(M, j) {
2062
+ return A({}, K, { abort: { reason: M, plugins: j || [$], caller: c, from: U || $ } });
2050
2063
  }), config: vn(C.pluginName, f, o), plugins: f })).then(function(M) {
2051
2064
  var j = X(M) ? M : {};
2052
2065
  return Promise.resolve(A({}, z, j));
2053
2066
  })) : z;
2054
- var K, $, L;
2067
+ var K, $, U;
2055
2068
  });
2056
2069
  } catch (z) {
2057
2070
  return Promise.reject(z);
@@ -2080,9 +2093,9 @@ var vt = function(t) {
2080
2093
  return s.dispatch({ type: "queue", plugin: k, payload: C, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(O);
2081
2094
  var R = b(w[k], o[k]);
2082
2095
  return Promise.resolve(T[c]({ abort: R.abort, payload: C, instance: r, config: vn(k, f, o), plugins: f })).then(function(z) {
2083
- var K = X(z) ? z : {}, $ = A({}, O, K), L = w[k];
2084
- if (bt(L, k))
2085
- wt({ data: L, method: c, instance: r, pluginName: k, store: s });
2096
+ var K = X(z) ? z : {}, $ = A({}, O, K), U = w[k];
2097
+ if (bt(U, k))
2098
+ wt({ data: U, method: c, instance: r, pluginName: k, store: s });
2086
2099
  else {
2087
2100
  var M = c + ":" + k;
2088
2101
  (M.match(/:/g) || []).length < 2 && !c.match(gn) && !c.match(yn) && r.dispatch(A({}, p ? $ : C, { type: M, _: { called: M, from: "submethod" } }));
@@ -2147,12 +2160,12 @@ function In(t) {
2147
2160
  var e = t.match(/(.*):(.*)/);
2148
2161
  return !!e && { method: e[1], name: e[2] };
2149
2162
  }
2150
- function Gi(t) {
2163
+ function Bi(t) {
2151
2164
  return Object.keys(t).reduce(function(e, n) {
2152
2165
  return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2153
2166
  }, {});
2154
2167
  }
2155
- function Bi(t, e, n) {
2168
+ function qi(t, e, n) {
2156
2169
  var r = {};
2157
2170
  return function(i) {
2158
2171
  return function(o) {
@@ -2200,37 +2213,37 @@ function Bi(t, e, n) {
2200
2213
  var R = V(k) ? k() : k, z = l.type, K = z.replace(Te, "");
2201
2214
  if (l._ && l._.called)
2202
2215
  return Promise.resolve(l);
2203
- var $ = T.getState(), L = (W = R, (J = $.plugins) === void 0 && (J = {}), (le = l.options) === void 0 && (le = {}), Object.keys(W).filter(function(m) {
2216
+ var $ = T.getState(), U = (W = R, (J = $.plugins) === void 0 && (J = {}), (le = l.options) === void 0 && (le = {}), Object.keys(W).filter(function(m) {
2204
2217
  var y = le.plugins || {};
2205
- return xi(y[m]) ? y[m] : y.all !== !1 && (!J[m] || J[m].enabled !== !1);
2218
+ return Ai(y[m]) ? y[m] : y.all !== !1 && (!J[m] || J[m].enabled !== !1);
2206
2219
  }).map(function(m) {
2207
2220
  return W[m];
2208
2221
  }));
2209
- z === x.initializeStart && l.fromEnable && (L = Object.keys($.plugins).filter(function(m) {
2222
+ z === x.initializeStart && l.fromEnable && (U = Object.keys($.plugins).filter(function(m) {
2210
2223
  var y = $.plugins[m];
2211
2224
  return l.plugins.includes(m) && !y.initialized;
2212
2225
  }).map(function(m) {
2213
2226
  return R[m];
2214
2227
  }));
2215
- var M = L.map(function(m) {
2228
+ var M = U.map(function(m) {
2216
2229
  return m.name;
2217
2230
  }), j = function(m, y, g) {
2218
2231
  var I = bn(m).map(function(E) {
2219
2232
  return wn(E, y);
2220
2233
  });
2221
- return y.reduce(function(E, U) {
2222
- var Z = U.name, N = bn(m, Z).map(function(Le) {
2223
- return wn(Le, y);
2234
+ return y.reduce(function(E, L) {
2235
+ var Z = L.name, N = bn(m, Z).map(function(Ue) {
2236
+ return wn(Ue, y);
2224
2237
  }), F = N[0], D = N[1], Q = N[2];
2225
2238
  return F.length && (E.beforeNS[Z] = F), D.length && (E.duringNS[Z] = D), Q.length && (E.afterNS[Z] = Q), E;
2226
2239
  }, { before: I[0], beforeNS: {}, during: I[1], duringNS: {}, after: I[2], afterNS: {} });
2227
- }(z, L);
2240
+ }(z, U);
2228
2241
  return Promise.resolve(vt({ action: l, data: { exact: j.before, namespaced: j.beforeNS }, state: $, allPlugins: R, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(m) {
2229
2242
  function y() {
2230
2243
  var E = function() {
2231
2244
  if (z.match(Te))
2232
- return Promise.resolve(vt({ action: A({}, g, { type: K + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: $, allPlugins: R, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(U) {
2233
- U.meta && U.meta.hasCallback && mn(U.meta.rid, { payload: U });
2245
+ return Promise.resolve(vt({ action: A({}, g, { type: K + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: $, allPlugins: R, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(L) {
2246
+ L.meta && L.meta.hasCallback && mn(L.meta.rid, { payload: L });
2234
2247
  });
2235
2248
  }();
2236
2249
  return E && E.then ? E.then(function() {
@@ -2264,7 +2277,7 @@ function Bi(t, e, n) {
2264
2277
  };
2265
2278
  };
2266
2279
  }
2267
- function qi(t) {
2280
+ function Qi(t) {
2268
2281
  return function(e) {
2269
2282
  return function(n) {
2270
2283
  return function(r) {
@@ -2279,7 +2292,7 @@ function qi(t) {
2279
2292
  };
2280
2293
  };
2281
2294
  }
2282
- var Qi = function() {
2295
+ var eo = function() {
2283
2296
  var t = this;
2284
2297
  this.before = [], this.after = [], this.addMiddleware = function(e, n) {
2285
2298
  t[n] = t[n].concat(e);
@@ -2303,7 +2316,7 @@ var Qi = function() {
2303
2316
  };
2304
2317
  };
2305
2318
  };
2306
- function eo(t) {
2319
+ function to(t) {
2307
2320
  return function(e, n) {
2308
2321
  e === void 0 && (e = {});
2309
2322
  var r = {};
@@ -2347,9 +2360,9 @@ function yr(t) {
2347
2360
  }
2348
2361
  return t;
2349
2362
  }
2350
- var to = { last: {}, history: [] };
2351
- function no(t, e) {
2352
- t === void 0 && (t = to);
2363
+ var no = { last: {}, history: [] };
2364
+ function ro(t, e) {
2365
+ t === void 0 && (t = no);
2353
2366
  var n = e.options, r = e.meta;
2354
2367
  if (e.type === x.track) {
2355
2368
  var i = yr(A({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
@@ -2357,9 +2370,9 @@ function no(t, e) {
2357
2370
  }
2358
2371
  return t;
2359
2372
  }
2360
- var ro = { actions: [] };
2361
- function io(t, e) {
2362
- t === void 0 && (t = ro);
2373
+ var io = { actions: [] };
2374
+ function oo(t, e) {
2375
+ t === void 0 && (t = io);
2363
2376
  var n = e.payload;
2364
2377
  switch (e.type) {
2365
2378
  case "queue":
@@ -2372,11 +2385,11 @@ function io(t, e) {
2372
2385
  }
2373
2386
  }
2374
2387
  var vr = /#.*$/;
2375
- function oo(t) {
2388
+ function ao(t) {
2376
2389
  var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
2377
2390
  return "/" + (e && e[3] ? e[3].split("?")[0].replace(vr, "") : "");
2378
2391
  }
2379
- var wr, br, kr, Ir, ao = function(t) {
2392
+ var wr, br, kr, Ir, so = function(t) {
2380
2393
  if (t === void 0 && (t = {}), !H)
2381
2394
  return t;
2382
2395
  var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, h = o.hash, f = o.search, u = function(p) {
@@ -2388,11 +2401,11 @@ var wr, br, kr, Ir, ao = function(t) {
2388
2401
  }
2389
2402
  }();
2390
2403
  return d ? d.match(/\?/) ? d : d + p : window.location.href.replace(vr, "");
2391
- }(f), c = { title: n, url: u, path: oo(u), hash: h, search: f, width: a, height: s };
2404
+ }(f), c = { title: n, url: u, path: ao(u), hash: h, search: f, width: a, height: s };
2392
2405
  return r && r !== "" && (c.referrer = r), A({}, c, t);
2393
- }, so = { last: {}, history: [] };
2394
- function co(t, e) {
2395
- t === void 0 && (t = so);
2406
+ }, co = { last: {}, history: [] };
2407
+ function uo(t, e) {
2408
+ t === void 0 && (t = co);
2396
2409
  var n = e.options;
2397
2410
  if (e.type === x.page) {
2398
2411
  var r = yr(A({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
@@ -2405,9 +2418,9 @@ wr = function() {
2405
2418
  return !1;
2406
2419
  var t = navigator.appVersion;
2407
2420
  return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
2408
- }(), br = H ? document.referrer : null, kr = zi(), Ir = Di();
2421
+ }(), br = H ? document.referrer : null, kr = Di(), Ir = Mi();
2409
2422
  var En = { initialized: !1, sessionId: lt(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: wr }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: Ir, locale: kr, campaign: {}, referrer: br };
2410
- function uo(t, e) {
2423
+ function lo(t, e) {
2411
2424
  t === void 0 && (t = En);
2412
2425
  var n = t.initialized, r = e.campaign;
2413
2426
  switch (e.type) {
@@ -2421,8 +2434,8 @@ function uo(t, e) {
2421
2434
  return n ? t : A({}, En, t, { initialized: !0 });
2422
2435
  }
2423
2436
  }
2424
- var lo = ["plugins", "reducers", "storage"];
2425
- function ho(t, e, n) {
2437
+ var ho = ["plugins", "reducers", "storage"];
2438
+ function fo(t, e, n) {
2426
2439
  if (H) {
2427
2440
  var r = window[(n ? "add" : "remove") + "EventListener"];
2428
2441
  t.split(" ").forEach(function(i) {
@@ -2430,8 +2443,8 @@ function ho(t, e, n) {
2430
2443
  });
2431
2444
  }
2432
2445
  }
2433
- function fo(t) {
2434
- var e = ho.bind(null, "online offline", function(n) {
2446
+ function po(t) {
2447
+ var e = fo.bind(null, "online offline", function(n) {
2435
2448
  return Promise.resolve(!navigator.onLine).then(t);
2436
2449
  });
2437
2450
  return e(!0), function(n) {
@@ -2439,7 +2452,7 @@ function fo(t) {
2439
2452
  };
2440
2453
  }
2441
2454
  function Sr() {
2442
- return be("analytics", []), function(t) {
2455
+ return ke("analytics", []), function(t) {
2443
2456
  return function(e, n, r) {
2444
2457
  var i = t(e, n, r), o = i.dispatch;
2445
2458
  return Object.assign(i, { dispatch: function(a) {
@@ -2470,7 +2483,7 @@ function Tn(t, e, n) {
2470
2483
  i && i(a), r(a);
2471
2484
  })), A({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2472
2485
  }
2473
- function po(t) {
2486
+ function mo(t) {
2474
2487
  t === void 0 && (t = {});
2475
2488
  var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, y) {
2476
2489
  if (V(y))
@@ -2478,16 +2491,16 @@ function po(t) {
2478
2491
  if (y.NAMESPACE && (y.name = y.NAMESPACE), !y.name)
2479
2492
  throw new Error("https://lytics.dev/errors/1");
2480
2493
  y.config || (y.config = {});
2481
- var g = y.EVENTS ? Object.keys(y.EVENTS).map(function(U) {
2482
- return y.EVENTS[U];
2494
+ var g = y.EVENTS ? Object.keys(y.EVENTS).map(function(L) {
2495
+ return y.EVENTS[L];
2483
2496
  }) : [];
2484
- m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(U, Z) {
2497
+ m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(L, Z) {
2485
2498
  var N;
2486
- return U[Z] = (N = y.methods[Z], function() {
2499
+ return L[Z] = (N = y.methods[Z], function() {
2487
2500
  for (var F = Array.prototype.slice.call(arguments), D = new Array(N.length), Q = 0; Q < F.length; Q++)
2488
2501
  D[Q] = F[Q];
2489
2502
  return D[D.length] = k, N.apply({ instance: k }, D);
2490
- }), U;
2503
+ }), L;
2491
2504
  }, {}), delete y.methods);
2492
2505
  var I = Object.keys(y).concat(g), E = new Set(m.events.concat(I));
2493
2506
  if (m.events = Array.from(E), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
@@ -2495,9 +2508,9 @@ function po(t) {
2495
2508
  return m.plugins[y.name] = y, m.plugins[y.name].loaded || (m.plugins[y.name].loaded = function() {
2496
2509
  return !0;
2497
2510
  }), m;
2498
- }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: $e }, o = /* @__PURE__ */ function(m) {
2511
+ }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: be, setItem: ke, removeItem: $e }, o = /* @__PURE__ */ function(m) {
2499
2512
  return function(y, g, I) {
2500
- return g.getState("user")[y] || (I && X(I) && I[y] ? I[y] : pn(m)[y] || we(xt(y)) || null);
2513
+ return g.getState("user")[y] || (I && X(I) && I[y] ? I[y] : pn(m)[y] || be(xt(y)) || null);
2501
2514
  };
2502
2515
  }(i), a = r.plugins, s = r.events.filter(function(m) {
2503
2516
  return !Ct.includes(m);
@@ -2505,9 +2518,9 @@ function po(t) {
2505
2518
  return !Ct.includes(m);
2506
2519
  })), f = Array.from(h).sort(), u = function() {
2507
2520
  return a;
2508
- }, c = new Qi(), p = c.addMiddleware, d = c.removeMiddleware, b = c.dynamicMiddlewares, S = function() {
2521
+ }, c = new eo(), p = c.addMiddleware, d = c.removeMiddleware, b = c.dynamicMiddlewares, S = function() {
2509
2522
  throw new Error("Abort disabled inListener");
2510
- }, w = Mi(), P = pn(i), _ = A({}, P, n, w.an_uid ? { userId: w.an_uid } : {}, w.an_aid ? { anonymousId: w.an_aid } : {});
2523
+ }, w = Zi(), P = pn(i), _ = A({}, P, n, w.an_uid ? { userId: w.an_uid } : {}, w.an_aid ? { anonymousId: w.an_aid } : {});
2511
2524
  _.anonymousId || (_.anonymousId = lt());
2512
2525
  var v = A({ enable: function(m, y) {
2513
2526
  return new Promise(function(g) {
@@ -2519,11 +2532,11 @@ function po(t) {
2519
2532
  });
2520
2533
  } }, r.methods), l = !1, k = { identify: function(m, y, g, I) {
2521
2534
  try {
2522
- var E = se(m) ? m : null, U = X(m) ? m : y, Z = g || {}, N = k.user();
2523
- be(xt(oe), E);
2524
- var F = E || U.userId || o(oe, k, U);
2535
+ var E = se(m) ? m : null, L = X(m) ? m : y, Z = g || {}, N = k.user();
2536
+ ke(xt(oe), E);
2537
+ var F = E || L.userId || o(oe, k, L);
2525
2538
  return Promise.resolve(new Promise(function(D) {
2526
- j.dispatch(A({ type: x.identifyStart, userId: F, traits: U || {}, options: Z, anonymousId: N.anonymousId }, N.id && N.id !== E && { previousId: N.id }), D, [y, g, I]);
2539
+ j.dispatch(A({ type: x.identifyStart, userId: F, traits: L || {}, options: Z, anonymousId: N.anonymousId }, N.id && N.id !== E && { previousId: N.id }), D, [y, g, I]);
2527
2540
  }));
2528
2541
  } catch (D) {
2529
2542
  return Promise.reject(D);
@@ -2533,9 +2546,9 @@ function po(t) {
2533
2546
  var E = X(m) ? m.event : m;
2534
2547
  if (!E || !se(E))
2535
2548
  throw new Error("EventMissing");
2536
- var U = X(m) ? m : y || {}, Z = X(g) ? g : {};
2549
+ var L = X(m) ? m : y || {}, Z = X(g) ? g : {};
2537
2550
  return Promise.resolve(new Promise(function(N) {
2538
- j.dispatch({ type: x.trackStart, event: E, properties: U, options: Z, userId: o(oe, k, y), anonymousId: o(Ee, k, y) }, N, [y, g, I]);
2551
+ j.dispatch({ type: x.trackStart, event: E, properties: L, options: Z, userId: o(oe, k, y), anonymousId: o(Ee, k, y) }, N, [y, g, I]);
2539
2552
  }));
2540
2553
  } catch (N) {
2541
2554
  return Promise.reject(N);
@@ -2543,11 +2556,11 @@ function po(t) {
2543
2556
  }, page: function(m, y, g) {
2544
2557
  try {
2545
2558
  var I = X(m) ? m : {}, E = X(y) ? y : {};
2546
- return Promise.resolve(new Promise(function(U) {
2547
- j.dispatch({ type: x.pageStart, properties: ao(I), options: E, userId: o(oe, k, I), anonymousId: o(Ee, k, I) }, U, [m, y, g]);
2559
+ return Promise.resolve(new Promise(function(L) {
2560
+ j.dispatch({ type: x.pageStart, properties: so(I), options: E, userId: o(oe, k, I), anonymousId: o(Ee, k, I) }, L, [m, y, g]);
2548
2561
  }));
2549
- } catch (U) {
2550
- return Promise.reject(U);
2562
+ } catch (L) {
2563
+ return Promise.reject(L);
2551
2564
  }
2552
2565
  }, user: function(m) {
2553
2566
  if (m === oe || m === "id")
@@ -2588,15 +2601,15 @@ function po(t) {
2588
2601
  d(I, qe), d(E, Qe);
2589
2602
  };
2590
2603
  }
2591
- var U = m.match(g) ? qe : Qe, Z = function(N) {
2604
+ var L = m.match(g) ? qe : Qe, Z = function(N) {
2592
2605
  return function(F) {
2593
2606
  return function(D) {
2594
2607
  return D.type === m && y({ payload: D, instance: k, plugins: a, abort: S }), F(D);
2595
2608
  };
2596
2609
  };
2597
2610
  };
2598
- return p(Z, U), function() {
2599
- return d(Z, U);
2611
+ return p(Z, L), function() {
2612
+ return d(Z, L);
2600
2613
  };
2601
2614
  }, once: function(m, y) {
2602
2615
  if (!m || !V(y))
@@ -2628,7 +2641,7 @@ function po(t) {
2628
2641
  return g.meta || (g.meta = Tn()), y(g);
2629
2642
  };
2630
2643
  };
2631
- }, b(qe), Bi(k, u, { all: f, plugins: s }), qi(i), Ji(k), Vi(k), b(Qe)]), O = { context: uo, user: Xi(i), page: co, track: no, plugins: eo(u), queue: io }, C = Ae, R = Ae;
2644
+ }, b(qe), qi(k, u, { all: f, plugins: s }), Qi(i), Xi(k), Yi(k), b(Qe)]), O = { context: lo, user: Vi(i), page: uo, track: ro, plugins: to(u), queue: oo }, C = Ae, R = Ae;
2632
2645
  if (H && t.debug) {
2633
2646
  var z = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2634
2647
  z && (C = z({ trace: !0, traceLimit: 25 })), R = function() {
@@ -2637,42 +2650,42 @@ function po(t) {
2637
2650
  }
2638
2651
  var K, $ = function(m) {
2639
2652
  return Object.keys(m).reduce(function(y, g) {
2640
- return lo.includes(g) || (y[g] = m[g]), y;
2653
+ return ho.includes(g) || (y[g] = m[g]), y;
2641
2654
  }, {});
2642
- }(t), L = r.pluginsArray.reduce(function(m, y) {
2643
- var g = y.name, I = y.config, E = y.loaded, U = r.pluginEnabled[g];
2644
- return m[g] = { enabled: U, initialized: !!U && !y.initialize, loaded: !!E({ config: I }), config: I }, m;
2645
- }, {}), M = { context: $, user: _, plugins: L }, j = fr(function(m) {
2655
+ }(t), U = r.pluginsArray.reduce(function(m, y) {
2656
+ var g = y.name, I = y.config, E = y.loaded, L = r.pluginEnabled[g];
2657
+ return m[g] = { enabled: L, initialized: !!L && !y.initialize, loaded: !!E({ config: I }), config: I }, m;
2658
+ }, {}), M = { context: $, user: _, plugins: U }, j = fr(function(m) {
2646
2659
  for (var y = Object.keys(m), g = {}, I = 0; I < y.length; I++) {
2647
2660
  var E = y[I];
2648
2661
  typeof m[E] === ae && (g[E] = m[E]);
2649
2662
  }
2650
- var U, Z = Object.keys(g);
2663
+ var L, Z = Object.keys(g);
2651
2664
  try {
2652
2665
  (function(N) {
2653
2666
  Object.keys(N).forEach(function(F) {
2654
2667
  var D = N[F];
2655
- if (typeof D(void 0, { type: "@@redux/INIT" }) === re || typeof D(void 0, { type: Wi }) === re)
2668
+ if (typeof D(void 0, { type: "@@redux/INIT" }) === re || typeof D(void 0, { type: Fi }) === re)
2656
2669
  throw new Error("reducer " + F + " " + re);
2657
2670
  });
2658
2671
  })(g);
2659
2672
  } catch (N) {
2660
- U = N;
2673
+ L = N;
2661
2674
  }
2662
2675
  return function(N, F) {
2663
- if (N === void 0 && (N = {}), U)
2664
- throw U;
2665
- for (var D = !1, Q = {}, Le = 0; Le < Z.length; Le++) {
2666
- var Je = Z[Le], Xt = N[Je], ft = (0, g[Je])(Xt, F);
2676
+ if (N === void 0 && (N = {}), L)
2677
+ throw L;
2678
+ for (var D = !1, Q = {}, Ue = 0; Ue < Z.length; Ue++) {
2679
+ var Je = Z[Ue], Xt = N[Je], ft = (0, g[Je])(Xt, F);
2667
2680
  if (typeof ft === re) {
2668
- var Nr = Fi(Je, F);
2681
+ var Nr = Hi(Je, F);
2669
2682
  throw new Error(Nr);
2670
2683
  }
2671
2684
  Q[Je] = ft, D = D || ft !== Xt;
2672
2685
  }
2673
2686
  return D ? Q : N;
2674
2687
  };
2675
- }(A({}, O, e)), M, R(C(Hi.apply(void 0, T))));
2688
+ }(A({}, O, e)), M, R(C(Ji.apply(void 0, T))));
2676
2689
  j.dispatch = (K = j.dispatch, function(m, y, g) {
2677
2690
  var I = A({}, m, { meta: Tn(m.meta, y, kt(g)) });
2678
2691
  return K.apply(null, [I]);
@@ -2687,7 +2700,7 @@ function po(t) {
2687
2700
  return j.dispatch({ type: x.registerPlugins, plugins: W, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, y) {
2688
2701
  var g = m.bootstrap, I = m.config, E = m.name;
2689
2702
  g && V(g) && g({ instance: k, config: I, payload: m }), j.dispatch({ type: x.registerPluginType(E), name: E, enabled: r.pluginEnabled[E], plugin: m }), r.pluginsArray.length === y + 1 && j.dispatch({ type: x.initializeStart, plugins: J, disabled: le });
2690
- }), fo(function(m) {
2703
+ }), po(function(m) {
2691
2704
  j.dispatch({ type: m ? x.offline : x.online });
2692
2705
  }), function(m, y, g) {
2693
2706
  setInterval(function() {
@@ -2695,35 +2708,35 @@ function po(t) {
2695
2708
  }, 3e3);
2696
2709
  }(j, u, k), k;
2697
2710
  }
2698
- var qe = "before", Qe = "after", Me = "cookie", fe = Pr(), _r = dt, mo = dt;
2711
+ var qe = "before", Qe = "after", Me = "cookie", pe = Pr(), _r = dt, go = dt;
2699
2712
  function Er(t) {
2700
- return fe ? dt(t, "", -1) : $e(t);
2713
+ return pe ? dt(t, "", -1) : $e(t);
2701
2714
  }
2702
2715
  function Pr() {
2703
- if (fe !== void 0)
2704
- return fe;
2716
+ if (pe !== void 0)
2717
+ return pe;
2705
2718
  var t = "cookiecookie";
2706
2719
  try {
2707
- dt(t, t), fe = document.cookie.indexOf(t) !== -1, Er(t);
2720
+ dt(t, t), pe = document.cookie.indexOf(t) !== -1, Er(t);
2708
2721
  } catch {
2709
- fe = !1;
2722
+ pe = !1;
2710
2723
  }
2711
- return fe;
2724
+ return pe;
2712
2725
  }
2713
2726
  function dt(t, e, n, r, i, o) {
2714
2727
  if (typeof window < "u") {
2715
2728
  var a = arguments.length > 1;
2716
- return fe === !1 && (a ? be(t, e) : we(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]);
2729
+ return pe === !1 && (a ? ke(t, e) : be(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]);
2717
2730
  }
2718
2731
  }
2719
- var Ze = "localStorage", go = Mt.bind(null, "localStorage");
2720
- Ue("localStorage", "getItem", we);
2721
- Ue("localStorage", "setItem", be);
2722
- Ue("localStorage", "removeItem", $e);
2723
- var Ke = "sessionStorage", yo = Mt.bind(null, "sessionStorage");
2724
- Ue("sessionStorage", "getItem", we);
2725
- Ue("sessionStorage", "setItem", be);
2726
- Ue("sessionStorage", "removeItem", $e);
2732
+ var Ze = "localStorage", yo = Mt.bind(null, "localStorage");
2733
+ Le("localStorage", "getItem", be);
2734
+ Le("localStorage", "setItem", ke);
2735
+ Le("localStorage", "removeItem", $e);
2736
+ var Ke = "sessionStorage", vo = Mt.bind(null, "sessionStorage");
2737
+ Le("sessionStorage", "getItem", be);
2738
+ Le("sessionStorage", "setItem", ke);
2739
+ Le("sessionStorage", "removeItem", $e);
2727
2740
  function Oe(t) {
2728
2741
  var e = t;
2729
2742
  try {
@@ -2739,7 +2752,7 @@ function Oe(t) {
2739
2752
  if (e !== null && e !== "")
2740
2753
  return e;
2741
2754
  }
2742
- var vo = go(), wo = yo(), bo = Pr();
2755
+ var wo = yo(), bo = vo(), ko = Pr();
2743
2756
  function Tr(t, e) {
2744
2757
  if (t) {
2745
2758
  var n = Zt(e), r = !Ht(n), i = Kt(n) ? Oe(localStorage.getItem(t)) : void 0;
@@ -2751,17 +2764,17 @@ function Tr(t, e) {
2751
2764
  var a = Ft(n) ? Oe(sessionStorage.getItem(t)) : void 0;
2752
2765
  if (r && a)
2753
2766
  return a;
2754
- var s = we(t);
2767
+ var s = be(t);
2755
2768
  return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
2756
2769
  }
2757
2770
  }
2758
- function ko(t, e, n) {
2771
+ function Io(t, e, n) {
2759
2772
  if (t && !_e(e)) {
2760
2773
  var r = {}, i = Zt(n), o = JSON.stringify(e), a = !Ht(i);
2761
- return Kt(i) && (r[Ze] = et(Ze, e, Oe(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ze] : Wt(i) && (r[Me] = et(Me, e, Oe(_r(t))), mo(t, o), a) ? r[Me] : Ft(i) && (r[Ke] = et(Ke, e, Oe(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ke] : (r[De] = et(De, e, we(t)), be(t, e), a ? r[De] : r);
2774
+ return Kt(i) && (r[Ze] = et(Ze, e, Oe(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ze] : Wt(i) && (r[Me] = et(Me, e, Oe(_r(t))), go(t, o), a) ? r[Me] : Ft(i) && (r[Ke] = et(Ke, e, Oe(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ke] : (r[De] = et(De, e, be(t)), ke(t, e), a ? r[De] : r);
2762
2775
  }
2763
2776
  }
2764
- function Io(t, e) {
2777
+ function So(t, e) {
2765
2778
  if (t) {
2766
2779
  var n = Zt(e), r = Tr(t, cr), i = {};
2767
2780
  return !_e(r.localStorage) && Kt(n) && (localStorage.removeItem(t), i[Ze] = r.localStorage), !_e(r.cookie) && Wt(n) && (Er(t), i[Me] = r.cookie), !_e(r.sessionStorage) && Ft(n) && (sessionStorage.removeItem(t), i[Ke] = r.sessionStorage), !_e(r.global) && ht(n, De) && ($e(t), i[De] = r.global), i;
@@ -2771,13 +2784,13 @@ function Zt(t) {
2771
2784
  return t ? se(t) ? t : t.storage : sr;
2772
2785
  }
2773
2786
  function Kt(t) {
2774
- return vo && ht(t, Ze);
2787
+ return wo && ht(t, Ze);
2775
2788
  }
2776
2789
  function Wt(t) {
2777
- return bo && ht(t, Me);
2790
+ return ko && ht(t, Me);
2778
2791
  }
2779
2792
  function Ft(t) {
2780
- return wo && ht(t, Ke);
2793
+ return bo && ht(t, Ke);
2781
2794
  }
2782
2795
  function Ht(t) {
2783
2796
  return t === cr || t === "all";
@@ -2788,8 +2801,8 @@ function ht(t, e) {
2788
2801
  function et(t, e, n) {
2789
2802
  return { location: t, current: e, previous: n };
2790
2803
  }
2791
- var So = { setItem: ko, getItem: Tr, removeItem: Io };
2792
- function _o(t, e, n) {
2804
+ var _o = { setItem: Io, getItem: Tr, removeItem: So };
2805
+ function Eo(t, e, n) {
2793
2806
  return e in t ? Object.defineProperty(t, e, {
2794
2807
  value: n,
2795
2808
  enumerable: !0,
@@ -2811,20 +2824,20 @@ function jn(t) {
2811
2824
  for (var e = 1; e < arguments.length; e++) {
2812
2825
  var n = arguments[e] != null ? arguments[e] : {};
2813
2826
  e % 2 ? On(Object(n), !0).forEach(function(r) {
2814
- _o(t, r, n[r]);
2827
+ Eo(t, r, n[r]);
2815
2828
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : On(Object(n)).forEach(function(r) {
2816
2829
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
2817
2830
  });
2818
2831
  }
2819
2832
  return t;
2820
2833
  }
2821
- function Eo() {
2834
+ function Po() {
2822
2835
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
2823
- storage: So
2836
+ storage: _o
2824
2837
  };
2825
- return po(jn(jn({}, e), t));
2838
+ return mo(jn(jn({}, e), t));
2826
2839
  }
2827
- function Po(t, e) {
2840
+ function To(t, e) {
2828
2841
  e = e || {};
2829
2842
  var n, r, i = [], o = e.max || 1 / 0;
2830
2843
  function a() {
@@ -2846,7 +2859,7 @@ function Po(t, e) {
2846
2859
  }
2847
2860
  };
2848
2861
  }
2849
- function To(t) {
2862
+ function Oo(t) {
2850
2863
  if (typeof window > "u")
2851
2864
  return;
2852
2865
  const { addEventListener: e, history: n, location: r } = window;
@@ -2858,24 +2871,24 @@ function To(t) {
2858
2871
  const s = n[a];
2859
2872
  n[a] = function(...h) {
2860
2873
  var c;
2861
- const f = ((c = h[2]) == null ? void 0 : c.toString()) || "", u = jo(f);
2874
+ const f = ((c = h[2]) == null ? void 0 : c.toString()) || "", u = Co(f);
2862
2875
  return i !== u && (i = u, setTimeout(() => t(f), 0)), s.apply(n, h);
2863
2876
  };
2864
2877
  });
2865
2878
  }
2866
- function Oo(t, e) {
2879
+ function jo(t, e) {
2867
2880
  const n = t.indexOf(e);
2868
2881
  return n > -1 ? t.slice(0, n) : t;
2869
2882
  }
2870
- function jo(t) {
2871
- return ["#", "?"].forEach((e) => t = Oo(t, e)), t;
2883
+ function Co(t) {
2884
+ return ["#", "?"].forEach((e) => t = jo(t, e)), t;
2872
2885
  }
2873
- function Co() {
2874
- To(() => {
2886
+ function xo() {
2887
+ Oo(() => {
2875
2888
  ne.page();
2876
2889
  });
2877
2890
  }
2878
- function xo(t) {
2891
+ function Ao(t) {
2879
2892
  if (t === void 0 && (t = {}), !H)
2880
2893
  return jt;
2881
2894
  var e = xn(), n = At(), r = Cn(), i = tt(r, e), o = tt(n, e), a = [], s = [], h = [], f = r, u = i, c = o, p = Object.keys(t);
@@ -2883,9 +2896,9 @@ function xo(t) {
2883
2896
  return jt;
2884
2897
  var d = p.map(function(S) {
2885
2898
  return Number(S);
2886
- }), b = Ki(function() {
2887
- var S = xn(), w = function($, L) {
2888
- return L.map(function(M) {
2899
+ }), b = Wi(function() {
2900
+ var S = xn(), w = function($, U) {
2901
+ return U.map(function(M) {
2889
2902
  return M === 100 ? $ - 5 : $ * (M / 100);
2890
2903
  });
2891
2904
  }(S, d), P = At(), _ = Cn(), v = tt(_, S), l = tt(P, S);
@@ -2894,11 +2907,11 @@ function xo(t) {
2894
2907
  k ? T = "initial" : f <= _ && (T = "down");
2895
2908
  var O = w, C = d;
2896
2909
  (T === "up" || k) && (O = w.slice().reverse(), C = d.slice().reverse());
2897
- var R = C.reduce(function($, L, M) {
2910
+ var R = C.reduce(function($, U, M) {
2898
2911
  var j = O[M];
2899
- return h.includes(L) && _ <= j && (h = h.filter(function(W) {
2900
- return W !== L;
2901
- }), $.singleFunction = L), T === "down" && !a.includes(L) && _ >= j && L > o ? (s.push(L), $.callbacks = $.callbacks.concat(L), $) : T === "up" && !a.includes(L) && _ <= j && L <= v ? ($.foundFunc = [L], $) : (k && _ >= j && $.foundFunc.length === 0 && ($.foundFunc = [L]), !s.includes(L) && _ >= j && (s.push(L), $.singleFunction ? h.push(L) : $.singleFunction = L), $);
2912
+ return h.includes(U) && _ <= j && (h = h.filter(function(W) {
2913
+ return W !== U;
2914
+ }), $.singleFunction = U), T === "down" && !a.includes(U) && _ >= j && U > o ? (s.push(U), $.callbacks = $.callbacks.concat(U), $) : T === "up" && !a.includes(U) && _ <= j && U <= v ? ($.foundFunc = [U], $) : (k && _ >= j && $.foundFunc.length === 0 && ($.foundFunc = [U]), !s.includes(U) && _ >= j && (s.push(U), $.singleFunction ? h.push(U) : $.singleFunction = U), $);
2902
2915
  }, { foundFunc: [], singleFunction: null, callbacks: [], direction: T });
2903
2916
  if (f = _, T === "down" && R.callbacks && R.callbacks.forEach(function($) {
2904
2917
  V(t[$]) && (t[$]({ trigger: $, direction: T, scrollMin: c, scrollMax: u, range: [c, u] }), a.push($));
@@ -2915,11 +2928,11 @@ function xo(t) {
2915
2928
  function At() {
2916
2929
  return H ? document.body.scrollTop || document.documentElement.scrollTop : 0;
2917
2930
  }
2918
- function Ao() {
2931
+ function $o() {
2919
2932
  return H ? window.innerHeight || document.documentElement.clientHeight : 0;
2920
2933
  }
2921
2934
  function Cn() {
2922
- return Math.round(At() + Ao());
2935
+ return Math.round(At() + $o());
2923
2936
  }
2924
2937
  function xn() {
2925
2938
  if (!H)
@@ -2931,7 +2944,7 @@ function tt(t, e) {
2931
2944
  return Math.round(t / e * 100);
2932
2945
  }
2933
2946
  var An = "EventListener";
2934
- function $o(t) {
2947
+ function Lo(t) {
2935
2948
  return function(e, n, r, i) {
2936
2949
  var o = r || jt, a = i || !1;
2937
2950
  if (!H)
@@ -2965,7 +2978,7 @@ function at(t, e) {
2965
2978
  r[i] = t[i];
2966
2979
  return r;
2967
2980
  }
2968
- var o = Ri(t);
2981
+ var o = zi(t);
2969
2982
  return e ? o.map(function(a) {
2970
2983
  return se(a) ? at(a, !0) : a;
2971
2984
  }).flat() : o;
@@ -2976,7 +2989,7 @@ function Uo(t, e) {
2976
2989
  return t && (n = t.apply(this, arguments), t = null), n;
2977
2990
  };
2978
2991
  }
2979
- var It = $o("Event");
2992
+ var It = Lo("Event");
2980
2993
  function Or(t, e) {
2981
2994
  return H && V(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), V(n) ? function() {
2982
2995
  n.apply(i, arguments), r.apply(i, arguments);
@@ -2986,10 +2999,10 @@ function Or(t, e) {
2986
2999
  Or.bind(null, "onerror");
2987
3000
  Or.bind(null, "onload");
2988
3001
  var jr = typeof window > "u", $n = "hidden";
2989
- function Lo(t) {
3002
+ function No(t) {
2990
3003
  if (jr)
2991
3004
  return !1;
2992
- var e = No(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
3005
+ var e = Ro(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2993
3006
  return t(!!document[e]);
2994
3007
  }, i = function() {
2995
3008
  return document.addEventListener(n, r);
@@ -2998,15 +3011,15 @@ function Lo(t) {
2998
3011
  return document.removeEventListener(n, r), i;
2999
3012
  };
3000
3013
  }
3001
- function No() {
3014
+ function Ro() {
3002
3015
  var t = ["webkit", "moz", "ms", "o"];
3003
3016
  return jr || $n in document ? $n : t.reduce(function(e, n) {
3004
3017
  var r = n + "Hidden";
3005
3018
  return !e && r in document ? r : e;
3006
3019
  }, null);
3007
3020
  }
3008
- var Ro = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
3009
- function zo(t, e) {
3021
+ var zo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
3022
+ function Do(t, e) {
3010
3023
  e === void 0 && (e = {});
3011
3024
  var n = /* @__PURE__ */ function(a, s) {
3012
3025
  var h = this, f = !1;
@@ -3017,10 +3030,10 @@ function zo(t, e) {
3017
3030
  };
3018
3031
  }(t, e.throttle || 1e4), r = [];
3019
3032
  function i() {
3020
- var a = Lo(function(s) {
3033
+ var a = No(function(s) {
3021
3034
  s || n({ type: "tabVisible" });
3022
3035
  });
3023
- return r = [a].concat(Ro.map(function(s) {
3036
+ return r = [a].concat(zo.map(function(s) {
3024
3037
  return It(document, s, n);
3025
3038
  })).concat(It(window, "load", n)).concat(It(window, "scroll", n, { capture: !0, passive: !0 })), o;
3026
3039
  }
@@ -3033,7 +3046,7 @@ function zo(t, e) {
3033
3046
  return o(), i;
3034
3047
  };
3035
3048
  }
3036
- function Do(t) {
3049
+ function Mo(t) {
3037
3050
  var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, h = t.throttle, f = h === void 0 ? 2e3 : h, u = !1, c = !1, p = /* @__PURE__ */ new Date(), d = function() {
3038
3051
  return clearTimeout(e);
3039
3052
  };
@@ -3042,7 +3055,7 @@ function Do(t) {
3042
3055
  u = !0, r && (n = /* @__PURE__ */ new Date(), r(Re(p), w));
3043
3056
  }, s);
3044
3057
  }
3045
- var S = zo(b, { throttle: f });
3058
+ var S = Do(b, { throttle: f });
3046
3059
  return { disable: function() {
3047
3060
  c = !0, u = !1, d();
3048
3061
  var w = S();
@@ -3056,8 +3069,8 @@ function Do(t) {
3056
3069
  function Re(t, e) {
3057
3070
  return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
3058
3071
  }
3059
- const Un = 5e3;
3060
- class Mo {
3072
+ const Ln = 5e3;
3073
+ class Zo {
3061
3074
  constructor(e) {
3062
3075
  B(this, "element");
3063
3076
  B(this, "isInViewport", !1);
@@ -3079,11 +3092,11 @@ class Mo {
3079
3092
  {
3080
3093
  threshold: 0
3081
3094
  }
3082
- ), this.observer.observe(this.element), Do({
3095
+ ), this.observer.observe(this.element), Mo({
3083
3096
  onIdle: (n) => this.handleAwake(!1, n),
3084
3097
  onWakeUp: (n) => this.handleAwake(!0, n),
3085
- timeout: Un
3086
- }), xo({
3098
+ timeout: Ln
3099
+ }), Ao({
3087
3100
  25: this.handleScroll.bind(this),
3088
3101
  50: this.handleScroll.bind(this),
3089
3102
  75: this.handleScroll.bind(this),
@@ -3101,7 +3114,7 @@ class Mo {
3101
3114
  e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
3102
3115
  }
3103
3116
  handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
3104
- this.isAwake = e, this.lastEventAt = e ? Date.now() - n * Un : Date.now(), this.isInViewport && this.trackAwake(e, n);
3117
+ this.isAwake = e, this.lastEventAt = e ? Date.now() - n * Ln : Date.now(), this.isInViewport && this.trackAwake(e, n);
3105
3118
  }
3106
3119
  handleScroll(e) {
3107
3120
  this.scrollCallback && this.scrollCallback(e);
@@ -3118,17 +3131,17 @@ class Mo {
3118
3131
  this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
3119
3132
  }
3120
3133
  }
3121
- const Ln = "sesamy_session_id";
3122
- function Zo() {
3123
- let t = sessionStorage.getItem(Ln);
3124
- return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(Ln, t)), t;
3134
+ const Un = "sesamy_session_id";
3135
+ function Ko() {
3136
+ let t = sessionStorage.getItem(Un);
3137
+ return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(Un, t)), t;
3125
3138
  }
3126
3139
  let Cr = !1, $t, Nn, st;
3127
- function Ko({ clientId: t, enabled: e = !0, endpoint: n = di }) {
3140
+ function Wo({ clientId: t, enabled: e = !0, endpoint: n = di }) {
3128
3141
  if ($t = t, Nn = e, st = n, !Nn)
3129
3142
  return;
3130
- Co();
3131
- const r = new Mo({
3143
+ xo();
3144
+ const r = new Zo({
3132
3145
  element: document.body,
3133
3146
  viewCallback: () => {
3134
3147
  ne.page();
@@ -3153,9 +3166,9 @@ function Ko({ clientId: t, enabled: e = !0, endpoint: n = di }) {
3153
3166
  });
3154
3167
  }
3155
3168
  });
3156
- Ho(document.body, () => {
3169
+ Jo(document.body, () => {
3157
3170
  r.flush();
3158
- }), Jo(document.body, () => {
3171
+ }), Xo(document.body, () => {
3159
3172
  r.handleVisibilityChange();
3160
3173
  }), window.addEventListener(q.AUTHENTICATED, async (i) => {
3161
3174
  const o = i;
@@ -3170,7 +3183,7 @@ function xr(t) {
3170
3183
  ...e,
3171
3184
  clientId: $t,
3172
3185
  requestId: Math.random().toString(36).slice(2, 9),
3173
- sessionId: Zo(),
3186
+ sessionId: Ko(),
3174
3187
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3175
3188
  version: Dt,
3176
3189
  event: e.event,
@@ -3190,7 +3203,7 @@ function xr(t) {
3190
3203
  }))
3191
3204
  );
3192
3205
  }
3193
- const Jt = Po(
3206
+ const Jt = To(
3194
3207
  async (t) => {
3195
3208
  if (t.length > 0) {
3196
3209
  const e = xr(t);
@@ -3219,7 +3232,7 @@ function St(t) {
3219
3232
  } else
3220
3233
  Jt.push(t);
3221
3234
  }
3222
- const ne = Eo({
3235
+ const ne = Po({
3223
3236
  app: ar,
3224
3237
  version: Dt,
3225
3238
  plugins: [
@@ -3257,23 +3270,23 @@ const ne = Eo({
3257
3270
  }
3258
3271
  ]
3259
3272
  });
3260
- function Wo(t, e) {
3273
+ function Fo(t, e) {
3261
3274
  ne.track(t, e);
3262
3275
  }
3263
- function Fo() {
3276
+ function Ho() {
3264
3277
  return Cr = !0, Jt.flush();
3265
3278
  }
3266
3279
  const Ar = /* @__PURE__ */ new Map();
3267
- function Ho(t, e) {
3280
+ function Jo(t, e) {
3268
3281
  Ar.set(t, e);
3269
3282
  }
3270
3283
  window.addEventListener("beforeunload", () => {
3271
3284
  Ar.forEach((t, e) => {
3272
3285
  t.bind(e)();
3273
- }), Fo();
3286
+ }), Ho();
3274
3287
  });
3275
3288
  const $r = /* @__PURE__ */ new Map();
3276
- function Jo(t, e) {
3289
+ function Xo(t, e) {
3277
3290
  $r.set(t, e);
3278
3291
  }
3279
3292
  window.addEventListener("visibilitychange", () => {
@@ -3281,16 +3294,16 @@ window.addEventListener("visibilitychange", () => {
3281
3294
  t.bind(e)();
3282
3295
  });
3283
3296
  });
3284
- const Ur = "sesamySignedURLs";
3285
- function Lr() {
3286
- const t = sessionStorage.getItem(Ur);
3297
+ const Lr = "sesamySignedURLs";
3298
+ function Ur() {
3299
+ const t = sessionStorage.getItem(Lr);
3287
3300
  return t ? JSON.parse(t) : [];
3288
3301
  }
3289
- function Xo(t) {
3290
- const e = Lr();
3291
- e.push(t), sessionStorage.setItem(Ur, JSON.stringify(e));
3292
- }
3293
3302
  function Vo(t) {
3303
+ const e = Ur();
3304
+ e.push(t), sessionStorage.setItem(Lr, JSON.stringify(e));
3305
+ }
3306
+ function Yo(t) {
3294
3307
  const {
3295
3308
  getEntitlement: e,
3296
3309
  getEntitlements: n,
@@ -3320,13 +3333,13 @@ function Vo(t) {
3320
3333
  linkSpotify: z,
3321
3334
  autoOnboardProduct: K,
3322
3335
  openHostedAccountPage: $,
3323
- generateLink: L
3324
- } = Ti(t), M = {
3336
+ generateLink: U
3337
+ } = Oi(t), M = {
3325
3338
  auth: {
3326
3339
  getUser: f,
3327
3340
  isAuthenticated: Rt,
3328
3341
  loginWithRedirect: zt,
3329
- logout: pi,
3342
+ logout: mi,
3330
3343
  setToken: nr
3331
3344
  },
3332
3345
  profile: {
@@ -3337,7 +3350,7 @@ function Vo(t) {
3337
3350
  unlinkSpotify: R
3338
3351
  },
3339
3352
  analytics: {
3340
- track: Wo
3353
+ track: Fo
3341
3354
  },
3342
3355
  tags: {
3343
3356
  list: c,
@@ -3348,7 +3361,7 @@ function Vo(t) {
3348
3361
  get: e,
3349
3362
  list: n,
3350
3363
  access: r,
3351
- signedLinks: Lr
3364
+ signedLinks: Ur
3352
3365
  },
3353
3366
  contracts: {
3354
3367
  get: o,
@@ -3378,17 +3391,17 @@ function Vo(t) {
3378
3391
  autoOnboard: K,
3379
3392
  linkSpotify: z
3380
3393
  },
3381
- getVersion: Yo,
3394
+ getVersion: Go,
3382
3395
  getPaymentIssues: O,
3383
- generateLink: L,
3396
+ generateLink: U,
3384
3397
  clearCache: ee
3385
3398
  };
3386
3399
  return t.namespace && (window[t.namespace] = M), M;
3387
3400
  }
3388
- function Yo() {
3401
+ function Go() {
3389
3402
  return Dt;
3390
3403
  }
3391
- function Go() {
3404
+ function Bo() {
3392
3405
  const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token");
3393
3406
  if (e) {
3394
3407
  nr(e);
@@ -3397,21 +3410,21 @@ function Go() {
3397
3410
  }
3398
3411
  }
3399
3412
  const Rn = "sesamy-refresh", zn = "force-refetch-entitlements";
3400
- function Bo() {
3413
+ function qo() {
3401
3414
  const t = new URLSearchParams(window.location.search), e = t.get(zn), n = t.get(Rn);
3402
3415
  if (e !== null || n !== null) {
3403
3416
  const r = new URL(window.location.href);
3404
3417
  t.delete(zn), t.delete(Rn), r.search = t.toString(), ee(), window.history.replaceState(null, "", r);
3405
3418
  }
3406
3419
  }
3407
- function qo() {
3420
+ function Qo() {
3408
3421
  const t = new URLSearchParams(window.location.search), e = t.get("token"), n = t.get("se");
3409
3422
  if (!n || !e)
3410
3423
  return;
3411
3424
  const r = parseInt(n, 10);
3412
3425
  if (Number.isNaN(r) || r < Date.now())
3413
3426
  return;
3414
- Xo({
3427
+ Vo({
3415
3428
  url: window.location.href.split("?")[0],
3416
3429
  token: e,
3417
3430
  expiresAt: r,
@@ -3421,17 +3434,17 @@ function qo() {
3421
3434
  i.searchParams.delete("ss"), i.searchParams.delete("se"), i.searchParams.delete("sp"), i.searchParams.delete("so"), i.searchParams.delete("token"), window.history.replaceState(null, "", i);
3422
3435
  }
3423
3436
  const Dn = "sesamy-user";
3424
- async function Qo() {
3437
+ async function ea() {
3425
3438
  const e = new URLSearchParams(window.location.search).get(Dn);
3426
3439
  if (!e)
3427
3440
  return;
3428
- const n = await fi();
3441
+ const n = await pi();
3429
3442
  (n == null ? void 0 : n.email) !== e && zt({ authorizationParams: { email_hint: e } });
3430
3443
  const r = new URL(window.location.href);
3431
3444
  r.searchParams.delete(Dn), window.history.replaceState(null, "", r);
3432
3445
  }
3433
3446
  const Mn = "sesamy-purchase";
3434
- function ea() {
3447
+ function ta() {
3435
3448
  const t = new URLSearchParams(window.location.search), e = t.get(Mn);
3436
3449
  if (e !== null) {
3437
3450
  const n = new URL(window.location.href);
@@ -3439,37 +3452,37 @@ function ea() {
3439
3452
  }
3440
3453
  }
3441
3454
  const Zn = "sesamy-login";
3442
- async function ta() {
3455
+ async function na() {
3443
3456
  if (!new URLSearchParams(window.location.search).get(Zn))
3444
3457
  return;
3445
3458
  await Rt() || zt();
3446
3459
  const r = new URL(window.location.href);
3447
3460
  r.searchParams.delete(Zn), window.history.replaceState(null, "", r);
3448
3461
  }
3449
- async function na(t) {
3450
- Ko({
3462
+ async function ra(t) {
3463
+ Wo({
3451
3464
  clientId: t.clientId,
3452
3465
  // The default client id can be overridden by the config
3453
3466
  ...t.analytics
3454
- }), await hi({
3467
+ }), await fi({
3455
3468
  clientId: t.clientId,
3456
3469
  organization: t.organization,
3457
3470
  // The default client id can be overridden by the config
3458
3471
  ...t.auth
3459
3472
  });
3460
- const e = Vo({ clientId: t.clientId, ...t.api });
3461
- return ue(q.READY, {}), Go(), Bo(), qo(), await ta(), await Qo(), ea(), e;
3473
+ const e = Yo({ clientId: t.clientId, ...t.api });
3474
+ return ue(q.READY, {}), Bo(), qo(), Qo(), await na(), await ea(), ta(), e;
3462
3475
  }
3463
3476
  if (typeof document < "u") {
3464
3477
  const t = document.getElementById("sesamy-js");
3465
3478
  if (t != null && t.textContent)
3466
3479
  try {
3467
3480
  const e = JSON.parse(t.textContent);
3468
- na(e);
3481
+ ra(e);
3469
3482
  } catch (e) {
3470
3483
  console.error("Failed to parse config", e);
3471
3484
  }
3472
3485
  }
3473
3486
  export {
3474
- na as init
3487
+ ra as init
3475
3488
  };