@sesamy/sesamy-js 1.4.3 → 1.5.0

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.
@@ -61,43 +61,43 @@ var ae = Tt(function(t, e) {
61
61
  Ot(ae);
62
62
  var kr = Ot(Tt(function(t, e) {
63
63
  var n = ce && ce.__awaiter || function(u, c, h, d) {
64
- return new (h || (h = Promise))(function(w, I) {
65
- function y(v) {
64
+ return new (h || (h = Promise))(function(w, k) {
65
+ function v(y) {
66
66
  try {
67
- E(d.next(v));
67
+ S(d.next(y));
68
68
  } catch (l) {
69
- I(l);
69
+ k(l);
70
70
  }
71
71
  }
72
- function S(v) {
72
+ function _(y) {
73
73
  try {
74
- E(d.throw(v));
74
+ S(d.throw(y));
75
75
  } catch (l) {
76
- I(l);
76
+ k(l);
77
77
  }
78
78
  }
79
- function E(v) {
80
- v.done ? w(v.value) : new h(function(l) {
81
- l(v.value);
82
- }).then(y, S);
79
+ function S(y) {
80
+ y.done ? w(y.value) : new h(function(l) {
81
+ l(y.value);
82
+ }).then(v, _);
83
83
  }
84
- E((d = d.apply(u, c || [])).next());
84
+ S((d = d.apply(u, c || [])).next());
85
85
  });
86
86
  }, r = ce && ce.__generator || function(u, c) {
87
- var h, d, w, I, y = { label: 0, sent: function() {
87
+ var h, d, w, k, v = { label: 0, sent: function() {
88
88
  if (1 & w[0])
89
89
  throw w[1];
90
90
  return w[1];
91
91
  }, trys: [], ops: [] };
92
- return I = { next: S(0), throw: S(1), return: S(2) }, typeof Symbol == "function" && (I[Symbol.iterator] = function() {
92
+ return k = { next: _(0), throw: _(1), return: _(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
93
93
  return this;
94
- }), I;
95
- function S(E) {
96
- return function(v) {
94
+ }), k;
95
+ function _(S) {
96
+ return function(y) {
97
97
  return function(l) {
98
98
  if (h)
99
99
  throw new TypeError("Generator is already executing.");
100
- for (; y; )
100
+ for (; v; )
101
101
  try {
102
102
  if (h = 1, d && (w = 2 & l[0] ? d.return : l[0] ? d.throw || ((w = d.return) && w.call(d), 0) : d.next) && !(w = w.call(d, l[1])).done)
103
103
  return w;
@@ -107,34 +107,34 @@ var kr = Ot(Tt(function(t, e) {
107
107
  w = l;
108
108
  break;
109
109
  case 4:
110
- return y.label++, { value: l[1], done: !1 };
110
+ return v.label++, { value: l[1], done: !1 };
111
111
  case 5:
112
- y.label++, d = l[1], l = [0];
112
+ v.label++, d = l[1], l = [0];
113
113
  continue;
114
114
  case 7:
115
- l = y.ops.pop(), y.trys.pop();
115
+ l = v.ops.pop(), v.trys.pop();
116
116
  continue;
117
117
  default:
118
- if (w = y.trys, !((w = w.length > 0 && w[w.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
119
- y = 0;
118
+ if (w = v.trys, !((w = w.length > 0 && w[w.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
119
+ v = 0;
120
120
  continue;
121
121
  }
122
122
  if (l[0] === 3 && (!w || l[1] > w[0] && l[1] < w[3])) {
123
- y.label = l[1];
123
+ v.label = l[1];
124
124
  break;
125
125
  }
126
- if (l[0] === 6 && y.label < w[1]) {
127
- y.label = w[1], w = l;
126
+ if (l[0] === 6 && v.label < w[1]) {
127
+ v.label = w[1], w = l;
128
128
  break;
129
129
  }
130
- if (w && y.label < w[2]) {
131
- y.label = w[2], y.ops.push(l);
130
+ if (w && v.label < w[2]) {
131
+ v.label = w[2], v.ops.push(l);
132
132
  break;
133
133
  }
134
- w[2] && y.ops.pop(), y.trys.pop();
134
+ w[2] && v.ops.pop(), v.trys.pop();
135
135
  continue;
136
136
  }
137
- l = c.call(u, y);
137
+ l = c.call(u, v);
138
138
  } catch (b) {
139
139
  l = [6, b], d = 0;
140
140
  } finally {
@@ -143,7 +143,7 @@ var kr = Ot(Tt(function(t, e) {
143
143
  if (5 & l[0])
144
144
  throw l[1];
145
145
  return { value: l[0] ? l[1] : void 0, done: !0 };
146
- }([E, v]);
146
+ }([S, y]);
147
147
  };
148
148
  }
149
149
  }, i = ce;
@@ -205,19 +205,19 @@ var kr = Ot(Tt(function(t, e) {
205
205
  }
206
206
  return u.prototype.acquireLock = function(c, h) {
207
207
  return h === void 0 && (h = 5e3), n(this, void 0, void 0, function() {
208
- var d, w, I, y, S, E, v;
208
+ var d, w, k, v, _, S, y;
209
209
  return r(this, function(l) {
210
210
  switch (l.label) {
211
211
  case 0:
212
- d = Date.now() + p(4), w = Date.now() + h, I = o + "-" + c, y = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
212
+ d = Date.now() + p(4), w = Date.now() + h, k = o + "-" + c, v = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
213
213
  case 1:
214
214
  return Date.now() < w ? [4, s(30)] : [3, 8];
215
215
  case 2:
216
- return l.sent(), y.getItemSync(I) !== null ? [3, 5] : (S = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
216
+ return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (_ = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
217
217
  case 3:
218
- return l.sent(), y.setItemSync(I, JSON.stringify({ id: this.id, iat: d, timeoutKey: S, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
218
+ return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: _, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
219
219
  case 4:
220
- return l.sent(), (E = y.getItemSync(I)) !== null && (v = JSON.parse(E)).id === this.id && v.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(I, d), [2, !0]) : [3, 7];
220
+ return l.sent(), (S = v.getItemSync(k)) !== null && (y = JSON.parse(S)).id === this.id && y.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
221
221
  case 5:
222
222
  return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(w)];
223
223
  case 6:
@@ -235,13 +235,13 @@ var kr = Ot(Tt(function(t, e) {
235
235
  return r(this, function(w) {
236
236
  return setTimeout(function() {
237
237
  return n(d, void 0, void 0, function() {
238
- var I, y, S;
239
- return r(this, function(E) {
240
- switch (E.label) {
238
+ var k, v, _;
239
+ return r(this, function(S) {
240
+ switch (S.label) {
241
241
  case 0:
242
242
  return [4, ae.default().lock(h)];
243
243
  case 1:
244
- return E.sent(), this.acquiredIatSet.has(h) ? (I = this.storageHandler === void 0 ? a : this.storageHandler, (y = I.getItemSync(c)) === null ? (ae.default().unlock(h), [2]) : ((S = JSON.parse(y)).timeRefreshed = Date.now(), I.setItemSync(c, JSON.stringify(S)), ae.default().unlock(h), this.refreshLockWhileAcquired(c, h), [2])) : (ae.default().unlock(h), [2]);
244
+ return S.sent(), this.acquiredIatSet.has(h) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (ae.default().unlock(h), [2]) : ((_ = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(_)), ae.default().unlock(h), this.refreshLockWhileAcquired(c, h), [2])) : (ae.default().unlock(h), [2]);
245
245
  }
246
246
  });
247
247
  });
@@ -254,16 +254,16 @@ var kr = Ot(Tt(function(t, e) {
254
254
  switch (h.label) {
255
255
  case 0:
256
256
  return [4, new Promise(function(d) {
257
- var w = !1, I = Date.now(), y = !1;
258
- function S() {
259
- if (y || (window.removeEventListener("storage", S), u.removeFromWaiting(S), clearTimeout(E), y = !0), !w) {
257
+ var w = !1, k = Date.now(), v = !1;
258
+ function _() {
259
+ if (v || (window.removeEventListener("storage", _), u.removeFromWaiting(_), clearTimeout(S), v = !0), !w) {
260
260
  w = !0;
261
- var v = 50 - (Date.now() - I);
262
- v > 0 ? setTimeout(d, v) : d(null);
261
+ var y = 50 - (Date.now() - k);
262
+ y > 0 ? setTimeout(d, y) : d(null);
263
263
  }
264
264
  }
265
- window.addEventListener("storage", S), u.addToWaiting(S);
266
- var E = setTimeout(S, Math.max(0, c - Date.now()));
265
+ window.addEventListener("storage", _), u.addToWaiting(_);
266
+ var S = setTimeout(_, Math.max(0, c - Date.now()));
267
267
  })];
268
268
  case 1:
269
269
  return h.sent(), [2];
@@ -293,36 +293,36 @@ var kr = Ot(Tt(function(t, e) {
293
293
  });
294
294
  }, u.prototype.releaseLock__private__ = function(c) {
295
295
  return n(this, void 0, void 0, function() {
296
- var h, d, w, I;
297
- return r(this, function(y) {
298
- switch (y.label) {
296
+ var h, d, w, k;
297
+ return r(this, function(v) {
298
+ switch (v.label) {
299
299
  case 0:
300
- return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = h.getItemSync(d)) === null ? [2] : (I = JSON.parse(w)).id !== this.id ? [3, 2] : [4, ae.default().lock(I.iat)];
300
+ return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = h.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4, ae.default().lock(k.iat)];
301
301
  case 1:
302
- y.sent(), this.acquiredIatSet.delete(I.iat), h.removeItemSync(d), ae.default().unlock(I.iat), u.notifyWaiters(), y.label = 2;
302
+ v.sent(), this.acquiredIatSet.delete(k.iat), h.removeItemSync(d), ae.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
303
303
  case 2:
304
304
  return [2];
305
305
  }
306
306
  });
307
307
  });
308
308
  }, u.lockCorrector = function(c) {
309
- for (var h = Date.now() - 5e3, d = c, w = [], I = 0; ; ) {
310
- var y = d.keySync(I);
311
- if (y === null)
309
+ for (var h = Date.now() - 5e3, d = c, w = [], k = 0; ; ) {
310
+ var v = d.keySync(k);
311
+ if (v === null)
312
312
  break;
313
- w.push(y), I++;
313
+ w.push(v), k++;
314
314
  }
315
- for (var S = !1, E = 0; E < w.length; E++) {
316
- var v = w[E];
317
- if (v.includes(o)) {
318
- var l = d.getItemSync(v);
315
+ for (var _ = !1, S = 0; S < w.length; S++) {
316
+ var y = w[S];
317
+ if (y.includes(o)) {
318
+ var l = d.getItemSync(y);
319
319
  if (l !== null) {
320
320
  var b = JSON.parse(l);
321
- (b.timeRefreshed === void 0 && b.timeAcquired < h || b.timeRefreshed !== void 0 && b.timeRefreshed < h) && (d.removeItemSync(v), S = !0);
321
+ (b.timeRefreshed === void 0 && b.timeAcquired < h || b.timeRefreshed !== void 0 && b.timeRefreshed < h) && (d.removeItemSync(y), _ = !0);
322
322
  }
323
323
  }
324
324
  }
325
- S && u.notifyWaiters();
325
+ _ && u.notifyWaiters();
326
326
  }, u.waiters = void 0, u;
327
327
  }();
328
328
  e.default = f;
@@ -395,23 +395,23 @@ const Ge = () => window.crypto, ut = () => {
395
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
397
  const f = s ? kt(p) : JSON.stringify(p);
398
- return await async function(u, c, h, d, w, I, y) {
399
- let S, E = null;
400
- for (let _ = 0; _ < 3; _++)
398
+ return await async function(u, c, h, d, w, k, v) {
399
+ let _, S = null;
400
+ for (let A = 0; A < 3; A++)
401
401
  try {
402
- S = await xr(u, h, d, w, I, y, c), E = null;
402
+ _ = await xr(u, h, d, w, k, v, c), S = null;
403
403
  break;
404
- } catch (C) {
405
- E = C;
404
+ } catch (Z) {
405
+ S = Z;
406
406
  }
407
- if (E)
408
- throw E;
409
- const v = S.json, { error: l, error_description: b } = v, j = Q(v, ["error", "error_description"]), { ok: k } = S;
410
- if (!k) {
411
- const _ = b || `HTTP error. Unable to fetch ${u}`;
412
- throw l === "mfa_required" ? new Or(l, _, j.mfa_token) : l === "missing_refresh_token" ? new zn(h, d) : new H(l || "request_error", _);
407
+ if (S)
408
+ throw S;
409
+ const y = _.json, { error: l, error_description: b } = y, C = Q(y, ["error", "error_description"]), { ok: O } = _;
410
+ if (!O) {
411
+ const A = b || `HTTP error. Unable to fetch ${u}`;
412
+ throw l === "mfa_required" ? new Or(l, A, C.mfa_token) : l === "missing_refresh_token" ? new zn(h, d) : new H(l || "request_error", A);
413
413
  }
414
- return j;
414
+ return C;
415
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) => {
@@ -790,7 +790,7 @@ let Jr = class {
790
790
  const d = { "+": "-", "/": "_", "=": "" };
791
791
  return h.replace(/[+/=]/g, (w) => d[w]);
792
792
  })(window.btoa(String.fromCharCode(...Array.from(c))));
793
- })(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, w, I, y, S) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Ke(c, h.scope), response_type: "code", response_mode: S || "query", state: d, nonce: w, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: I, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), f = this._authorizeUrl(p);
793
+ })(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, w, k, v, _) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Ke(c, h.scope), response_type: "code", response_mode: _ || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), f = this._authorizeUrl(p);
794
794
  return { nonce: o, code_verifier: a, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: i, url: f };
795
795
  }
796
796
  async loginWithPopup(e, n) {
@@ -932,22 +932,22 @@ let Jr = class {
932
932
  try {
933
933
  if (window.crossOriginIsolated)
934
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
- const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((w, I, y = 60) => new Promise((S, E) => {
936
- const v = window.document.createElement("iframe");
937
- v.setAttribute("width", "0"), v.setAttribute("height", "0"), v.style.display = "none";
935
+ const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((w, k, v = 60) => new Promise((_, S) => {
936
+ const y = window.document.createElement("iframe");
937
+ y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
938
938
  const l = () => {
939
- window.document.body.contains(v) && (window.document.body.removeChild(v), window.removeEventListener("message", b, !1));
939
+ window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", b, !1));
940
940
  };
941
941
  let b;
942
- const j = setTimeout(() => {
943
- E(new bt()), l();
944
- }, 1e3 * y);
945
- b = function(k) {
946
- if (k.origin != I || !k.data || k.data.type !== "authorization_response")
942
+ const C = setTimeout(() => {
943
+ S(new bt()), l();
944
+ }, 1e3 * v);
945
+ b = function(O) {
946
+ if (O.origin != k || !O.data || O.data.type !== "authorization_response")
947
947
  return;
948
- const _ = k.source;
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
- }, window.addEventListener("message", b, !1), window.document.body.appendChild(v), v.setAttribute("src", w);
948
+ const A = O.source;
949
+ A && A.close(), O.data.response.error ? S(H.fromPayload(O.data.response)) : _(O.data.response), clearTimeout(C), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
950
+ }, window.addEventListener("message", b, !1), window.document.body.appendChild(y), y.setAttribute("src", w);
951
951
  }))(i, this.domainUrl, c);
952
952
  if (o !== h.state)
953
953
  throw new H("state_mismatch", "Invalid state");
@@ -1110,23 +1110,23 @@ const ei = (t, e) => e.skipDedupe || e.method !== "GET", ti = (t, e) => e.method
1110
1110
  let c = 0;
1111
1111
  if (s && s(f, u))
1112
1112
  return p(f, u);
1113
- const h = (d, w) => Promise.resolve(r(d, w)).then((I) => I ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((y) => {
1114
- const S = e(t, c);
1113
+ const h = (d, w) => Promise.resolve(r(d, w)).then((k) => k ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((v) => {
1114
+ const _ = e(t, c);
1115
1115
  setTimeout(() => {
1116
1116
  typeof i == "function" ? Promise.resolve(i({
1117
1117
  response: d,
1118
1118
  error: w,
1119
1119
  url: f,
1120
1120
  options: u
1121
- })).then((E = {}) => {
1122
- var v, l;
1123
- y(p((v = E && E.url) !== null && v !== void 0 ? v : f, (l = E && E.options) !== null && l !== void 0 ? l : u));
1124
- }) : y(p(f, u));
1125
- }, S);
1126
- }).then(h).catch((y) => {
1121
+ })).then((S = {}) => {
1122
+ var y, l;
1123
+ v(p((y = S && S.url) !== null && y !== void 0 ? y : f, (l = S && S.options) !== null && l !== void 0 ? l : u));
1124
+ }) : v(p(f, u));
1125
+ }, _);
1126
+ }).then(h).catch((v) => {
1127
1127
  if (!o)
1128
- throw y;
1129
- return h(null, y);
1128
+ throw v;
1129
+ return h(null, v);
1130
1130
  }) : d && a ? d : Promise.reject(w || new Error("Number of attempts exceeded."))));
1131
1131
  return p(f, u).then(h).catch((d) => {
1132
1132
  if (!o)
@@ -1181,75 +1181,75 @@ class Kn extends Error {
1181
1181
  }
1182
1182
  const li = (t) => {
1183
1183
  const e = /* @__PURE__ */ Object.create(null);
1184
- t = t._addons.reduce((v, l) => l.beforeRequest && l.beforeRequest(v, t._options, e) || v, t);
1184
+ t = t._addons.reduce((y, l) => l.beforeRequest && l.beforeRequest(y, t._options, e) || y, t);
1185
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);
1186
1186
  let c = n;
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 };
1189
- }).then((v) => {
1190
- if (!v.ok) {
1187
+ const h = ui(s)((y, l) => (c = y, i.polyfill("fetch")(y, l)))(n, u), d = new Error(), w = h.catch((y) => {
1188
+ throw { [ve]: y };
1189
+ }).then((y) => {
1190
+ if (!y.ok) {
1191
1191
  const l = new Kn();
1192
1192
  if (l.cause = d, l.stack = l.stack + `
1193
- CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1193
+ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
1194
1194
  throw l;
1195
- return v.text().then((b) => {
1196
- var j;
1197
- if (l.message = b, i.errorType === "json" || ((j = v.headers.get("Content-Type")) === null || j === void 0 ? void 0 : j.split(";")[0]) === "application/json")
1195
+ return y.text().then((b) => {
1196
+ var C;
1197
+ if (l.message = b, i.errorType === "json" || ((C = y.headers.get("Content-Type")) === null || C === void 0 ? void 0 : C.split(";")[0]) === "application/json")
1198
1198
  try {
1199
1199
  l.json = JSON.parse(b);
1200
1200
  } catch {
1201
1201
  }
1202
- throw l.text = b, l.status = v.status, l;
1202
+ throw l.text = b, l.status = y.status, l;
1203
1203
  });
1204
1204
  }
1205
- return v;
1206
- }), I = (v) => v.catch((l) => {
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);
1208
- if (k)
1209
- return k(j, t);
1210
- const _ = f.get(Mn);
1211
- if (_)
1212
- return _(j, t);
1213
- throw j;
1214
- }), y = (v) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ I(v ? w.then((b) => b && b[v]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), S = {
1205
+ return y;
1206
+ }), k = (y) => y.catch((l) => {
1207
+ const b = l.hasOwnProperty(ve), C = b ? l[ve] : l, O = (C == null ? void 0 : C.status) && f.get(C.status) || f.get(C == null ? void 0 : C.name) || b && f.has(ve) && f.get(ve);
1208
+ if (O)
1209
+ return O(C, t);
1210
+ const A = f.get(Mn);
1211
+ if (A)
1212
+ return A(C, t);
1213
+ throw C;
1214
+ }), v = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(y ? w.then((b) => b && b[y]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), _ = {
1215
1215
  _wretchReq: t,
1216
1216
  _fetchReq: h,
1217
1217
  _sharedState: e,
1218
- res: y(null),
1219
- json: y("json"),
1220
- blob: y("blob"),
1221
- formData: y("formData"),
1222
- arrayBuffer: y("arrayBuffer"),
1223
- text: y("text"),
1224
- error(v, l) {
1225
- return f.set(v, l), this;
1218
+ res: v(null),
1219
+ json: v("json"),
1220
+ blob: v("blob"),
1221
+ formData: v("formData"),
1222
+ arrayBuffer: v("arrayBuffer"),
1223
+ text: v("text"),
1224
+ error(y, l) {
1225
+ return f.set(y, l), this;
1226
1226
  },
1227
- badRequest(v) {
1228
- return this.error(400, v);
1227
+ badRequest(y) {
1228
+ return this.error(400, y);
1229
1229
  },
1230
- unauthorized(v) {
1231
- return this.error(401, v);
1230
+ unauthorized(y) {
1231
+ return this.error(401, y);
1232
1232
  },
1233
- forbidden(v) {
1234
- return this.error(403, v);
1233
+ forbidden(y) {
1234
+ return this.error(403, y);
1235
1235
  },
1236
- notFound(v) {
1237
- return this.error(404, v);
1236
+ notFound(y) {
1237
+ return this.error(404, y);
1238
1238
  },
1239
- timeout(v) {
1240
- return this.error(408, v);
1239
+ timeout(y) {
1240
+ return this.error(408, y);
1241
1241
  },
1242
- internalError(v) {
1243
- return this.error(500, v);
1242
+ internalError(y) {
1243
+ return this.error(500, y);
1244
1244
  },
1245
- fetchError(v) {
1246
- return this.error(ve, v);
1245
+ fetchError(y) {
1246
+ return this.error(ve, y);
1247
1247
  }
1248
- }, E = p.reduce((v, l) => ({
1249
- ...v,
1250
- ...typeof l.resolver == "function" ? l.resolver(v) : l.resolver
1251
- }), S);
1252
- return a.reduce((v, l) => l(v, t), E);
1248
+ }, S = p.reduce((y, l) => ({
1249
+ ...y,
1250
+ ...typeof l.resolver == "function" ? l.resolver(y) : l.resolver
1251
+ }), _);
1252
+ return a.reduce((y, l) => l(y, t), S);
1253
1253
  }, di = {
1254
1254
  _url: "",
1255
1255
  _options: {},
@@ -1370,40 +1370,40 @@ oe.errorType = ci;
1370
1370
  oe.polyfills = si;
1371
1371
  oe.WretchError = Kn;
1372
1372
  function hi(t) {
1373
- const e = t.endpoint || `https://api2.${Rn}`, n = (k = !0) => (_) => async (C, D) => {
1373
+ const e = t.endpoint || `https://api2.${Rn}`, n = (I = !0) => (j) => async (N, W) => {
1374
1374
  let R = null;
1375
- if (R = await Br(k), !R) {
1376
- if (k)
1375
+ if (R = await Br(I), !R) {
1376
+ if (I)
1377
1377
  throw new Error("No access token available");
1378
- return _(C, D);
1378
+ return j(N, W);
1379
1379
  }
1380
- const L = {
1381
- ...D,
1380
+ const x = {
1381
+ ...W,
1382
1382
  headers: {
1383
- ...D.headers,
1383
+ ...W.headers,
1384
1384
  ...R ? { Authorization: `Bearer ${R}` } : {}
1385
1385
  }
1386
1386
  };
1387
- return _(C, L);
1388
- }, r = (k) => (_, C) => {
1389
- if (C.headers.Authorization)
1390
- return k(_, C);
1391
- const D = localStorage.getItem("__anon_id"), R = btoa(`${D}:`), L = {
1392
- ...C,
1387
+ return j(N, x);
1388
+ }, r = (I) => (j, N) => {
1389
+ if (N.headers.Authorization)
1390
+ return I(j, N);
1391
+ const W = localStorage.getItem("__anon_id"), R = btoa(`${W}:`), x = {
1392
+ ...N,
1393
1393
  headers: {
1394
- ...C.headers,
1394
+ ...N.headers,
1395
1395
  Authorization: `Basic ${R}`
1396
1396
  }
1397
1397
  };
1398
- return k(_, L);
1398
+ return I(j, x);
1399
1399
  }, i = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
1400
1400
  n(),
1401
1401
  Vt(),
1402
1402
  Yt({
1403
1403
  delayTimer: 1e3,
1404
- delayRamp: (k, _) => k * _,
1404
+ delayRamp: (I, j) => I * j,
1405
1405
  maxAttempts: 3,
1406
- until: (k) => !!(k && (k.ok || k.status >= 400 && k.status < 500)),
1406
+ until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
1407
1407
  retryOnNetworkError: !1
1408
1408
  })
1409
1409
  ]), o = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
@@ -1412,84 +1412,96 @@ function hi(t) {
1412
1412
  Vt(),
1413
1413
  Yt({
1414
1414
  delayTimer: 1e3,
1415
- delayRamp: (k, _) => k * _,
1415
+ delayRamp: (I, j) => I * j,
1416
1416
  maxAttempts: 3,
1417
- until: (k) => !!(k && (k.ok || k.status >= 400 && k.status < 500)),
1417
+ until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
1418
1418
  retryOnNetworkError: !1
1419
1419
  })
1420
1420
  ]);
1421
1421
  async function a() {
1422
1422
  return i.get("/entitlements").json();
1423
1423
  }
1424
- async function s(k) {
1425
- const _ = await i.get("/entitlements").json();
1426
- return _ == null ? void 0 : _.find((C) => C.id === k);
1424
+ async function s(I) {
1425
+ const j = await i.get("/entitlements").json();
1426
+ return j == null ? void 0 : j.find((N) => N.id === I);
1427
1427
  }
1428
- async function p() {
1428
+ async function p(I) {
1429
+ return i.get(`/entitlements/${I}/access`).json();
1430
+ }
1431
+ async function f() {
1429
1432
  return i.get("/contracts").json();
1430
1433
  }
1431
- async function f(k) {
1432
- const _ = await i.get("/contracts").json();
1433
- return _ == null ? void 0 : _.find((C) => C.id === k);
1434
+ async function u(I) {
1435
+ const j = await i.get("/contracts").json();
1436
+ return j == null ? void 0 : j.find((N) => N.id === I);
1434
1437
  }
1435
- async function u() {
1438
+ async function c() {
1436
1439
  return i.get("/bills").json();
1437
1440
  }
1438
- async function c(k) {
1439
- const _ = await i.get("/bills").json();
1440
- return _ == null ? void 0 : _.find((C) => C.id === k);
1441
+ async function h(I) {
1442
+ const j = await i.get("/bills").json();
1443
+ return j == null ? void 0 : j.find((N) => N.id === I);
1441
1444
  }
1442
- async function h(k, _) {
1443
- return await i.url(`/user-metadata/${k}`).put(_).json();
1445
+ async function d(I, j) {
1446
+ return await i.url(`/user-metadata/${I}`).put(j).json();
1444
1447
  }
1445
- async function d(k) {
1446
- return (await i.url(`/user-metadata/${k}`).delete().res()).ok;
1448
+ async function w(I) {
1449
+ return (await i.url(`/user-metadata/${I}`).delete().res()).ok;
1447
1450
  }
1448
- async function w(k) {
1449
- return (await i.url(`/user-metadata/${k}`).get().json())[k];
1451
+ async function k(I) {
1452
+ return (await i.url(`/user-metadata/${I}`).get().json())[I];
1450
1453
  }
1451
- async function I() {
1454
+ async function v() {
1452
1455
  return await i.url("/user-metadata").get().json();
1453
1456
  }
1454
- async function y() {
1457
+ async function _() {
1455
1458
  return await i.url("/tags").get().json();
1456
1459
  }
1457
- async function S(k) {
1458
- return (await i.url(`/tags/${k}`).delete().res()).ok;
1460
+ async function S(I) {
1461
+ return (await i.url(`/tags/${I}`).delete().res()).ok;
1459
1462
  }
1460
- async function E(k) {
1461
- return (await i.url("/tags").post(k).res()).ok;
1463
+ async function y(I) {
1464
+ return (await i.url("/tags").post(I).res()).ok;
1462
1465
  }
1463
- async function v(k) {
1464
- return (await o.url("/tallies").get().json())[k];
1466
+ async function l(I) {
1467
+ return (await o.url("/tallies").get().json())[I];
1465
1468
  }
1466
- async function l() {
1469
+ async function b() {
1467
1470
  return await o.url("/tallies").get().json();
1468
1471
  }
1469
- async function b(k) {
1470
- return (await o.url(`/tallies/${k}`).delete().res()).ok;
1472
+ async function C(I) {
1473
+ return (await o.url(`/tallies/${I}`).delete().res()).ok;
1474
+ }
1475
+ async function O(I, j) {
1476
+ return await o.url(`/tallies/${I}/push`).post(j).json();
1477
+ }
1478
+ async function A(I) {
1479
+ return await i.url(`/products/${I}`).get().json();
1471
1480
  }
1472
- async function j(k, _) {
1473
- return await o.url(`/tallies/${k}/push`).post(_).json();
1481
+ async function Z(I) {
1482
+ return await i.url(`/products/${I}/auto-onboard`).post().json();
1474
1483
  }
1475
1484
  return {
1476
1485
  getEntitlements: a,
1477
1486
  getEntitlement: s,
1478
- getContracts: p,
1479
- getContract: f,
1480
- getBills: u,
1481
- getBill: c,
1482
- setUserMetadata: h,
1483
- deleteUserMetadata: d,
1484
- getUserMetadata: w,
1485
- listUserMetadata: I,
1486
- getTags: y,
1487
+ getEntitlementAccess: p,
1488
+ getContracts: f,
1489
+ getContract: u,
1490
+ getBills: c,
1491
+ getBill: h,
1492
+ setUserMetadata: d,
1493
+ deleteUserMetadata: w,
1494
+ getUserMetadata: k,
1495
+ listUserMetadata: v,
1496
+ getTags: _,
1487
1497
  deleteTag: S,
1488
- setTag: E,
1489
- getTally: v,
1490
- getTallies: l,
1491
- deleteTally: b,
1492
- pushTally: j
1498
+ setTag: y,
1499
+ getTally: l,
1500
+ getTallies: b,
1501
+ deleteTally: C,
1502
+ pushTally: O,
1503
+ getProduct: A,
1504
+ autoOnboardProduct: Z
1493
1505
  };
1494
1506
  }
1495
1507
  const Jn = "@sesamy/sesamy-js", Ct = "1.3.2";
@@ -1497,22 +1509,25 @@ function fi(t) {
1497
1509
  const {
1498
1510
  getEntitlement: e,
1499
1511
  getEntitlements: n,
1500
- getContract: r,
1501
- getContracts: i,
1502
- getBill: o,
1503
- getBills: a,
1504
- getTags: s,
1505
- deleteTag: p,
1506
- setTag: f,
1507
- getUserMetadata: u,
1508
- listUserMetadata: c,
1509
- setUserMetadata: h,
1510
- deleteUserMetadata: d,
1511
- getTally: w,
1512
- getTallies: I,
1513
- pushTally: y,
1514
- deleteTally: S
1515
- } = hi(t), E = {
1512
+ getEntitlementAccess: r,
1513
+ getContract: i,
1514
+ getContracts: o,
1515
+ getBill: a,
1516
+ getBills: s,
1517
+ getTags: p,
1518
+ deleteTag: f,
1519
+ setTag: u,
1520
+ getUserMetadata: c,
1521
+ listUserMetadata: h,
1522
+ setUserMetadata: d,
1523
+ deleteUserMetadata: w,
1524
+ getTally: k,
1525
+ getTallies: v,
1526
+ pushTally: _,
1527
+ deleteTally: S,
1528
+ getProduct: y,
1529
+ autoOnboardProduct: l
1530
+ } = hi(t), b = {
1516
1531
  auth: {
1517
1532
  getUser: Yr,
1518
1533
  isAuthenticated: Vr,
@@ -1521,37 +1536,42 @@ function fi(t) {
1521
1536
  setToken: Zn
1522
1537
  },
1523
1538
  tags: {
1524
- list: s,
1525
- set: f,
1526
- delete: p
1539
+ list: p,
1540
+ set: u,
1541
+ delete: f
1527
1542
  },
1528
1543
  entitlements: {
1529
1544
  get: e,
1530
- list: n
1545
+ list: n,
1546
+ access: r
1531
1547
  },
1532
1548
  contracts: {
1533
- get: r,
1534
- list: i
1549
+ get: i,
1550
+ list: o
1535
1551
  },
1536
1552
  bills: {
1537
- get: o,
1538
- list: a
1553
+ get: a,
1554
+ list: s
1539
1555
  },
1540
1556
  userMetadata: {
1541
- get: u,
1542
- list: c,
1543
- set: h,
1544
- delete: d
1557
+ get: c,
1558
+ list: h,
1559
+ set: d,
1560
+ delete: w
1545
1561
  },
1546
1562
  tallies: {
1547
- get: w,
1548
- list: I,
1549
- push: y,
1563
+ get: k,
1564
+ list: v,
1565
+ push: _,
1550
1566
  delete: S
1551
1567
  },
1568
+ products: {
1569
+ get: y,
1570
+ autoOnboard: l
1571
+ },
1552
1572
  getVersion: pi
1553
1573
  };
1554
- return t.namespace && (window[t.namespace] = E), E;
1574
+ return t.namespace && (window[t.namespace] = b), b;
1555
1575
  }
1556
1576
  function pi() {
1557
1577
  return Ct;
@@ -1594,7 +1614,7 @@ function bi(t) {
1594
1614
  function Yn(t) {
1595
1615
  return Qe(t) === "array";
1596
1616
  }
1597
- function X(t) {
1617
+ function F(t) {
1598
1618
  if (!ki(t))
1599
1619
  return !1;
1600
1620
  for (var e = t; Object.getPrototypeOf(e) !== null; )
@@ -1772,13 +1792,13 @@ function Bn(t, e, n) {
1772
1792
  return f(), s.push(d), function() {
1773
1793
  if (w) {
1774
1794
  w = !1, f();
1775
- var I = s.indexOf(d);
1776
- s.splice(I, 1);
1795
+ var k = s.indexOf(d);
1796
+ s.splice(k, 1);
1777
1797
  }
1778
1798
  };
1779
1799
  }
1780
1800
  function h(d) {
1781
- if (!X(d))
1801
+ if (!F(d))
1782
1802
  throw new Error("Act != obj");
1783
1803
  if (typeof d.type === ee)
1784
1804
  throw new Error("ActType " + ee);
@@ -1789,8 +1809,8 @@ function Bn(t, e, n) {
1789
1809
  } finally {
1790
1810
  p = !1;
1791
1811
  }
1792
- for (var w = a = s, I = 0; I < w.length; I++)
1793
- (0, w[I])();
1812
+ for (var w = a = s, k = 0; k < w.length; k++)
1813
+ (0, w[k])();
1794
1814
  return d;
1795
1815
  }
1796
1816
  return h({ type: "@@redux/INIT" }), (r = { dispatch: h, subscribe: c, getState: u, replaceReducer: function(d) {
@@ -1799,13 +1819,13 @@ function Bn(t, e, n) {
1799
1819
  i = d, h({ type: "@@redux/INIT" });
1800
1820
  } })[tn] = function() {
1801
1821
  var d, w = c;
1802
- return (d = { subscribe: function(I) {
1803
- if (typeof I != "object")
1822
+ return (d = { subscribe: function(k) {
1823
+ if (typeof k != "object")
1804
1824
  throw new TypeError("Observer != obj");
1805
- function y() {
1806
- I.next && I.next(u());
1825
+ function v() {
1826
+ k.next && k.next(u());
1807
1827
  }
1808
- return y(), { unsubscribe: w(y) };
1828
+ return v(), { unsubscribe: w(v) };
1809
1829
  } })[tn] = function() {
1810
1830
  return this;
1811
1831
  }, d;
@@ -1855,12 +1875,12 @@ function $i(t) {
1855
1875
  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));
1856
1876
  var u = Object.keys(i.params);
1857
1877
  if (u.length) {
1858
- var c = o.an_uid, h = o.an_event, d = u.reduce(function(w, I) {
1859
- if (I.match(nn) || I.match(/^(d|g)clid/)) {
1860
- var y = I.replace(nn, "");
1861
- w.campaign[y === "campaign" ? "name" : y] = o[I];
1878
+ var c = o.an_uid, h = o.an_event, d = u.reduce(function(w, k) {
1879
+ if (k.match(nn) || k.match(/^(d|g)clid/)) {
1880
+ var v = k.replace(nn, "");
1881
+ w.campaign[v === "campaign" ? "name" : v] = o[k];
1862
1882
  }
1863
- return I.match(rn) && (w.props[I.replace(rn, "")] = o[I]), I.match(on) && (w.traits[I.replace(on, "")] = o[I]), w;
1883
+ return k.match(rn) && (w.props[k.replace(rn, "")] = o[k]), k.match(on) && (w.traits[k.replace(on, "")] = o[k]), w;
1864
1884
  }, { campaign: {}, props: {}, traits: {} });
1865
1885
  n.dispatch(P({ type: T.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1866
1886
  return t.identify(c, d.traits);
@@ -1944,18 +1964,18 @@ function Qn(t, e, n) {
1944
1964
  }, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
1945
1965
  if (f.processIndex && f.processIndex.length) {
1946
1966
  f.processIndex.forEach(function(c) {
1947
- var h = s.actions[c], d = h.plugin, w = h.payload.type, I = i[d][w];
1948
- if (I && G(I)) {
1949
- var y, S = function(l, b) {
1950
- return l === void 0 && (l = {}), b === void 0 && (b = {}), [te, ke].reduce(function(j, k) {
1951
- return l.hasOwnProperty(k) && b[k] && b[k] !== l[k] && (j[k] = b[k]), j;
1967
+ var h = s.actions[c], d = h.plugin, w = h.payload.type, k = i[d][w];
1968
+ if (k && G(k)) {
1969
+ var v, _ = function(l, b) {
1970
+ return l === void 0 && (l = {}), b === void 0 && (b = {}), [te, ke].reduce(function(C, O) {
1971
+ return l.hasOwnProperty(O) && b[O] && b[O] !== l[O] && (C[O] = b[O]), C;
1952
1972
  }, l);
1953
- }(h.payload, p), E = r[S.meta.rid];
1954
- if (!E && (y = I({ payload: S, config: a[d].config, instance: n, abort: Di })) && X(y) && y.abort)
1955
- return void (r[S.meta.rid] = !0);
1956
- if (!E) {
1957
- var v = w + ":" + d;
1958
- t.dispatch(P({}, S, { type: v, _: { called: v, from: "queueDrain" } }));
1973
+ }(h.payload, p), S = r[_.meta.rid];
1974
+ if (!S && (v = k({ payload: _, config: a[d].config, instance: n, abort: Di })) && F(v) && v.abort)
1975
+ return void (r[_.meta.rid] = !0);
1976
+ if (!S) {
1977
+ var y = w + ":" + d;
1978
+ t.dispatch(P({}, _, { type: y, _: { called: y, from: "queueDrain" } }));
1959
1979
  }
1960
1980
  }
1961
1981
  });
@@ -1969,113 +1989,113 @@ function Qn(t, e, n) {
1969
1989
  var ft = function(t) {
1970
1990
  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;
1971
1991
  try {
1972
- var f = i.plugins, u = i.context, c = n.type, h = c.match(_e), d = e.exact.map(function(y) {
1973
- return y.pluginName;
1992
+ var f = i.plugins, u = i.context, c = n.type, h = c.match(_e), d = e.exact.map(function(v) {
1993
+ return v.pluginName;
1974
1994
  });
1975
- h && (d = a.during.map(function(y) {
1976
- return y.pluginName;
1995
+ h && (d = a.during.map(function(v) {
1996
+ return v.pluginName;
1977
1997
  }));
1978
- var w = /* @__PURE__ */ function(y, S) {
1979
- return function(E, v, l) {
1980
- var b = v.config, j = v.name, k = j + "." + E.type;
1981
- l && (k = l.event);
1982
- var _ = E.type.match(_e) ? /* @__PURE__ */ function(C, D, R, L, F) {
1983
- return function(W, x) {
1984
- var K = L ? L.name : C, J = x && Ze(x) ? x : R;
1985
- if (L && (!(J = x && Ze(x) ? x : [C]).includes(C) || J.length !== 1))
1986
- throw new Error("Method " + D + " can only abort " + C + " plugin. " + JSON.stringify(J) + " input valid");
1987
- return P({}, F, { abort: { reason: W, plugins: J, caller: D, _: K } });
1998
+ var w = /* @__PURE__ */ function(v, _) {
1999
+ return function(S, y, l) {
2000
+ var b = y.config, C = y.name, O = C + "." + S.type;
2001
+ l && (O = l.event);
2002
+ var A = S.type.match(_e) ? /* @__PURE__ */ function(Z, I, j, N, W) {
2003
+ return function(R, x) {
2004
+ var J = N ? N.name : Z, X = x && Ze(x) ? x : j;
2005
+ if (N && (!(X = x && Ze(x) ? x : [Z]).includes(Z) || X.length !== 1))
2006
+ throw new Error("Method " + I + " can only abort " + Z + " plugin. " + JSON.stringify(X) + " input valid");
2007
+ return P({}, W, { abort: { reason: R, plugins: X, caller: I, _: J } });
1988
2008
  };
1989
- }(j, k, S, l, E) : /* @__PURE__ */ function(C, D) {
2009
+ }(C, O, _, l, S) : /* @__PURE__ */ function(Z, I) {
1990
2010
  return function() {
1991
- throw new Error(C.type + " action not cancellable. Remove abort in " + D);
2011
+ throw new Error(Z.type + " action not cancellable. Remove abort in " + I);
1992
2012
  };
1993
- }(E, k);
1994
- return { payload: Ui(E), instance: y, config: b || {}, abort: _ };
2013
+ }(S, O);
2014
+ return { payload: Ui(S), instance: v, config: b || {}, abort: A };
1995
2015
  };
1996
- }(r, d), I = e.exact.reduce(function(y, S) {
1997
- var E = S.pluginName, v = S.methodName, l = !1;
1998
- return v.match(/^initialize/) || v.match(/^reset/) || (l = !f[E].loaded), u.offline && v.match(/^(page|track|identify)/) && (l = !0), y["" + E] = l, y;
2016
+ }(r, d), k = e.exact.reduce(function(v, _) {
2017
+ var S = _.pluginName, y = _.methodName, l = !1;
2018
+ return y.match(/^initialize/) || y.match(/^reset/) || (l = !f[S].loaded), u.offline && y.match(/^(page|track|identify)/) && (l = !0), v["" + S] = l, v;
1999
2019
  }, {});
2000
- return Promise.resolve(e.exact.reduce(function(y, S, E) {
2020
+ return Promise.resolve(e.exact.reduce(function(v, _, S) {
2001
2021
  try {
2002
- var v = S.pluginName;
2003
- return Promise.resolve(y).then(function(l) {
2022
+ var y = _.pluginName;
2023
+ return Promise.resolve(v).then(function(l) {
2004
2024
  function b() {
2005
2025
  return Promise.resolve(l);
2006
2026
  }
2007
- var j = function() {
2008
- if (e.namespaced && e.namespaced[v])
2009
- return Promise.resolve(e.namespaced[v].reduce(function(k, _, C) {
2027
+ var C = function() {
2028
+ if (e.namespaced && e.namespaced[y])
2029
+ return Promise.resolve(e.namespaced[y].reduce(function(O, A, Z) {
2010
2030
  try {
2011
- return Promise.resolve(k).then(function(D) {
2012
- return _.method && G(_.method) ? (function(W, x) {
2013
- var K = pn(W);
2014
- if (K && K.name === x) {
2015
- var J = pn(K.method);
2016
- 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(`
2031
+ return Promise.resolve(O).then(function(I) {
2032
+ return A.method && G(A.method) ? (function(R, x) {
2033
+ var J = pn(R);
2034
+ if (J && J.name === x) {
2035
+ var X = pn(J.method);
2036
+ throw new Error([x + " plugin is calling method " + R, "Plugins cant call self", "Use " + J.method + " " + (X ? "or " + X.method : "") + " in " + x + " plugin insteadof " + R].join(`
2017
2037
  `));
2018
2038
  }
2019
- }(_.methodName, _.pluginName), Promise.resolve(_.method({ payload: D, instance: r, abort: (R = D, L = v, F = _.pluginName, function(W, x) {
2020
- return P({}, R, { abort: { reason: W, plugins: x || [L], caller: c, from: F || L } });
2021
- }), config: ln(_.pluginName, f, o), plugins: f })).then(function(W) {
2022
- var x = X(W) ? W : {};
2023
- return Promise.resolve(P({}, D, x));
2024
- })) : D;
2025
- var R, L, F;
2039
+ }(A.methodName, A.pluginName), Promise.resolve(A.method({ payload: I, instance: r, abort: (j = I, N = y, W = A.pluginName, function(R, x) {
2040
+ return P({}, j, { abort: { reason: R, plugins: x || [N], caller: c, from: W || N } });
2041
+ }), config: ln(A.pluginName, f, o), plugins: f })).then(function(R) {
2042
+ var x = F(R) ? R : {};
2043
+ return Promise.resolve(P({}, I, x));
2044
+ })) : I;
2045
+ var j, N, W;
2026
2046
  });
2027
- } catch (D) {
2028
- return Promise.reject(D);
2047
+ } catch (I) {
2048
+ return Promise.reject(I);
2029
2049
  }
2030
- }, Promise.resolve(n))).then(function(k) {
2031
- l[v] = k;
2050
+ }, Promise.resolve(n))).then(function(O) {
2051
+ l[y] = O;
2032
2052
  });
2033
- l[v] = n;
2053
+ l[y] = n;
2034
2054
  }();
2035
- return j && j.then ? j.then(b) : b();
2055
+ return C && C.then ? C.then(b) : b();
2036
2056
  });
2037
2057
  } catch (l) {
2038
2058
  return Promise.reject(l);
2039
2059
  }
2040
- }, Promise.resolve({}))).then(function(y) {
2041
- return Promise.resolve(e.exact.reduce(function(S, E, v) {
2060
+ }, Promise.resolve({}))).then(function(v) {
2061
+ return Promise.resolve(e.exact.reduce(function(_, S, y) {
2042
2062
  try {
2043
- var l = e.exact.length === v + 1, b = E.pluginName, j = o[b];
2044
- return Promise.resolve(S).then(function(k) {
2045
- var _ = y[b] ? y[b] : {};
2046
- if (h && (_ = k), mt(_, b))
2047
- return pt({ data: _, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(k);
2048
- if (mt(k, b))
2049
- return l && pt({ data: k, method: c, instance: r, store: s }), Promise.resolve(k);
2050
- if (I.hasOwnProperty(b) && I[b] === !0)
2051
- return s.dispatch({ type: "queue", plugin: b, payload: _, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(k);
2052
- var C = w(y[b], o[b]);
2053
- return Promise.resolve(j[c]({ abort: C.abort, payload: _, instance: r, config: ln(b, f, o), plugins: f })).then(function(D) {
2054
- var R = X(D) ? D : {}, L = P({}, k, R), F = y[b];
2055
- if (mt(F, b))
2056
- pt({ data: F, method: c, instance: r, pluginName: b, store: s });
2063
+ var l = e.exact.length === y + 1, b = S.pluginName, C = o[b];
2064
+ return Promise.resolve(_).then(function(O) {
2065
+ var A = v[b] ? v[b] : {};
2066
+ if (h && (A = O), mt(A, b))
2067
+ return pt({ data: A, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(O);
2068
+ if (mt(O, b))
2069
+ return l && pt({ data: O, method: c, instance: r, store: s }), Promise.resolve(O);
2070
+ if (k.hasOwnProperty(b) && k[b] === !0)
2071
+ return s.dispatch({ type: "queue", plugin: b, payload: A, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(O);
2072
+ var Z = w(v[b], o[b]);
2073
+ return Promise.resolve(C[c]({ abort: Z.abort, payload: A, instance: r, config: ln(b, f, o), plugins: f })).then(function(I) {
2074
+ var j = F(I) ? I : {}, N = P({}, O, j), W = v[b];
2075
+ if (mt(W, b))
2076
+ pt({ data: W, method: c, instance: r, pluginName: b, store: s });
2057
2077
  else {
2058
- var W = c + ":" + b;
2059
- (W.match(/:/g) || []).length < 2 && !c.match(cn) && !c.match(un) && r.dispatch(P({}, h ? L : _, { type: W, _: { called: W, from: "submethod" } }));
2078
+ var R = c + ":" + b;
2079
+ (R.match(/:/g) || []).length < 2 && !c.match(cn) && !c.match(un) && r.dispatch(P({}, h ? N : A, { type: R, _: { called: R, from: "submethod" } }));
2060
2080
  }
2061
- return Promise.resolve(L);
2081
+ return Promise.resolve(N);
2062
2082
  });
2063
2083
  });
2064
- } catch (k) {
2065
- return Promise.reject(k);
2084
+ } catch (O) {
2085
+ return Promise.reject(O);
2066
2086
  }
2067
- }, Promise.resolve(n))).then(function(S) {
2087
+ }, Promise.resolve(n))).then(function(_) {
2068
2088
  if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(un) || c.match(cn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
2069
- if (p.plugins.includes(c), S._ && S._.originalAction === c)
2070
- return S;
2071
- var E = P({}, S, { _: { originalAction: S.type, called: S.type, from: "engineEnd" } });
2072
- er(S, e.exact.length) && !c.match(/End$/) && (E = P({}, E, { type: S.type + "Aborted" })), s.dispatch(E);
2089
+ if (p.plugins.includes(c), _._ && _._.originalAction === c)
2090
+ return _;
2091
+ var S = P({}, _, { _: { originalAction: _.type, called: _.type, from: "engineEnd" } });
2092
+ er(_, e.exact.length) && !c.match(/End$/) && (S = P({}, S, { type: _.type + "Aborted" })), s.dispatch(S);
2073
2093
  }
2074
- return S;
2094
+ return _;
2075
2095
  });
2076
2096
  });
2077
- } catch (y) {
2078
- return Promise.reject(y);
2097
+ } catch (v) {
2098
+ return Promise.reject(v);
2079
2099
  }
2080
2100
  }, _e = /Start$/, cn = /^bootstrap/, un = /^ready/;
2081
2101
  function pt(t) {
@@ -2120,7 +2140,7 @@ function pn(t) {
2120
2140
  }
2121
2141
  function Ui(t) {
2122
2142
  return Object.keys(t).reduce(function(e, n) {
2123
- return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2143
+ return n === "type" || (e[n] = F(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2124
2144
  }, {});
2125
2145
  }
2126
2146
  function Li(t, e, n) {
@@ -2141,93 +2161,93 @@ function Li(t, e, n) {
2141
2161
  return u.includes(l);
2142
2162
  }).map(function(l) {
2143
2163
  return h[l];
2144
- }), I = [], y = [], S = a.disabled, E = w.map(function(l) {
2145
- var b = l.loaded, j = l.name, k = l.config;
2164
+ }), k = [], v = [], _ = a.disabled, S = w.map(function(l) {
2165
+ var b = l.loaded, C = l.name, O = l.config;
2146
2166
  return qn(l, function() {
2147
- return b({ config: k });
2148
- }, 1e4).then(function(_) {
2149
- return r[j] || (i.dispatch({ type: T.pluginReadyType(j), name: j, events: Object.keys(l).filter(function(C) {
2150
- return !_t.includes(C);
2151
- }) }), r[j] = !0), I = I.concat(j), l;
2152
- }).catch(function(_) {
2153
- if (_ instanceof Error)
2154
- throw new Error(_);
2155
- return y = y.concat(_.name), _;
2167
+ return b({ config: O });
2168
+ }, 1e4).then(function(A) {
2169
+ return r[C] || (i.dispatch({ type: T.pluginReadyType(C), name: C, events: Object.keys(l).filter(function(Z) {
2170
+ return !_t.includes(Z);
2171
+ }) }), r[C] = !0), k = k.concat(C), l;
2172
+ }).catch(function(A) {
2173
+ if (A instanceof Error)
2174
+ throw new Error(A);
2175
+ return v = v.concat(A.name), A;
2156
2176
  });
2157
2177
  });
2158
- Promise.all(E).then(function(l) {
2159
- var b = { plugins: I, failed: y, disabled: S };
2178
+ Promise.all(S).then(function(l) {
2179
+ var b = { plugins: k, failed: v, disabled: _ };
2160
2180
  setTimeout(function() {
2161
- d.length === E.length + S.length && i.dispatch(P({}, { type: T.ready }, b));
2181
+ d.length === S.length + _.length && i.dispatch(P({}, { type: T.ready }, b));
2162
2182
  }, 0);
2163
2183
  });
2164
2184
  }
2165
- var v = function() {
2185
+ var y = function() {
2166
2186
  if (f !== T.bootstrap)
2167
2187
  return /^ready:([^:]*)$/.test(f) && setTimeout(function() {
2168
2188
  return Qn(i, e, t);
2169
- }, 0), Promise.resolve(function(l, b, j, k, _) {
2189
+ }, 0), Promise.resolve(function(l, b, C, O, A) {
2170
2190
  try {
2171
- var C = G(b) ? b() : b, D = l.type, R = D.replace(_e, "");
2191
+ var Z = G(b) ? b() : b, I = l.type, j = I.replace(_e, "");
2172
2192
  if (l._ && l._.called)
2173
2193
  return Promise.resolve(l);
2174
- var L = j.getState(), F = (K = C, (J = L.plugins) === void 0 && (J = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2194
+ var N = C.getState(), W = (J = Z, (X = N.plugins) === void 0 && (X = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(J).filter(function(m) {
2175
2195
  var g = Ce.plugins || {};
2176
- return wi(g[m]) ? g[m] : g.all !== !1 && (!J[m] || J[m].enabled !== !1);
2196
+ return wi(g[m]) ? g[m] : g.all !== !1 && (!X[m] || X[m].enabled !== !1);
2177
2197
  }).map(function(m) {
2178
- return K[m];
2198
+ return J[m];
2179
2199
  }));
2180
- D === T.initializeStart && l.fromEnable && (F = Object.keys(L.plugins).filter(function(m) {
2181
- var g = L.plugins[m];
2200
+ I === T.initializeStart && l.fromEnable && (W = Object.keys(N.plugins).filter(function(m) {
2201
+ var g = N.plugins[m];
2182
2202
  return l.plugins.includes(m) && !g.initialized;
2183
2203
  }).map(function(m) {
2184
- return C[m];
2204
+ return Z[m];
2185
2205
  }));
2186
- var W = F.map(function(m) {
2206
+ var R = W.map(function(m) {
2187
2207
  return m.name;
2188
- }), x = function(m, g, O) {
2189
- var A = hn(m).map(function($) {
2190
- return dn($, g);
2208
+ }), x = function(m, g, E) {
2209
+ var $ = hn(m).map(function(z) {
2210
+ return dn(z, g);
2191
2211
  });
2192
- return g.reduce(function($, z) {
2193
- var M = z.name, U = hn(m, M).map(function(Ae) {
2212
+ return g.reduce(function(z, D) {
2213
+ var K = D.name, L = hn(m, K).map(function(Ae) {
2194
2214
  return dn(Ae, g);
2195
- }), Z = U[0], N = U[1], q = U[2];
2196
- return Z.length && ($.beforeNS[M] = Z), N.length && ($.duringNS[M] = N), q.length && ($.afterNS[M] = q), $;
2197
- }, { before: A[0], beforeNS: {}, during: A[1], duringNS: {}, after: A[2], afterNS: {} });
2198
- }(D, F);
2199
- return Promise.resolve(ft({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(m) {
2215
+ }), M = L[0], U = L[1], q = L[2];
2216
+ return M.length && (z.beforeNS[K] = M), U.length && (z.duringNS[K] = U), q.length && (z.afterNS[K] = q), z;
2217
+ }, { before: $[0], beforeNS: {}, during: $[1], duringNS: {}, after: $[2], afterNS: {} });
2218
+ }(I, W);
2219
+ return Promise.resolve(ft({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: N, allPlugins: Z, allMatches: x, instance: C, store: O, EVENTS: A })).then(function(m) {
2200
2220
  function g() {
2201
- var $ = function() {
2202
- if (D.match(_e))
2203
- return Promise.resolve(ft({ action: P({}, O, { type: R + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(z) {
2204
- z.meta && z.meta.hasCallback && sn(z.meta.rid, { payload: z });
2221
+ var z = function() {
2222
+ if (I.match(_e))
2223
+ return Promise.resolve(ft({ action: P({}, E, { type: j + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: N, allPlugins: Z, allMatches: x, instance: C, store: O, EVENTS: A })).then(function(D) {
2224
+ D.meta && D.meta.hasCallback && sn(D.meta.rid, { payload: D });
2205
2225
  });
2206
2226
  }();
2207
- return $ && $.then ? $.then(function() {
2227
+ return z && z.then ? z.then(function() {
2208
2228
  return m;
2209
2229
  }) : m;
2210
2230
  }
2211
- if (er(m, W.length))
2231
+ if (er(m, R.length))
2212
2232
  return m;
2213
- var O, A = function() {
2214
- if (D !== R)
2215
- return Promise.resolve(ft({ action: P({}, m, { type: R }), data: { exact: x.during, namespaced: x.duringNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function($) {
2216
- O = $;
2233
+ var E, $ = function() {
2234
+ if (I !== j)
2235
+ return Promise.resolve(ft({ action: P({}, m, { type: j }), data: { exact: x.during, namespaced: x.duringNS }, state: N, allPlugins: Z, allMatches: x, instance: C, store: O, EVENTS: A })).then(function(z) {
2236
+ E = z;
2217
2237
  });
2218
- O = m;
2238
+ E = m;
2219
2239
  }();
2220
- return A && A.then ? A.then(g) : g();
2240
+ return $ && $.then ? $.then(g) : g();
2221
2241
  });
2222
2242
  } catch (m) {
2223
2243
  return Promise.reject(m);
2224
2244
  }
2225
- var K, J, Ce;
2245
+ var J, X, Ce;
2226
2246
  }(a, e, t, i, n)).then(function(l) {
2227
2247
  return s = 1, o(l);
2228
2248
  });
2229
2249
  }();
2230
- return Promise.resolve(v && v.then ? v.then(p) : p(v));
2250
+ return Promise.resolve(y && y.then ? y.then(p) : p(y));
2231
2251
  } catch (l) {
2232
2252
  return Promise.reject(l);
2233
2253
  }
@@ -2353,7 +2373,7 @@ var rr, ir, or, ar, Hi = function(t) {
2353
2373
  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) {
2354
2374
  var d = function() {
2355
2375
  if (Y) {
2356
- for (var w, I = document.getElementsByTagName("link"), y = 0; w = I[y]; y++)
2376
+ for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
2357
2377
  if (w.getAttribute("rel") === "canonical")
2358
2378
  return w.getAttribute("href");
2359
2379
  }
@@ -2449,26 +2469,26 @@ function eo(t) {
2449
2469
  if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
2450
2470
  throw new Error("https://lytics.dev/errors/1");
2451
2471
  g.config || (g.config = {});
2452
- var O = g.EVENTS ? Object.keys(g.EVENTS).map(function(z) {
2453
- return g.EVENTS[z];
2472
+ var E = g.EVENTS ? Object.keys(g.EVENTS).map(function(D) {
2473
+ return g.EVENTS[D];
2454
2474
  }) : [];
2455
- 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) {
2456
- var U;
2457
- return z[M] = (U = g.methods[M], function() {
2458
- for (var Z = Array.prototype.slice.call(arguments), N = new Array(U.length), q = 0; q < Z.length; q++)
2459
- N[q] = Z[q];
2460
- return N[N.length] = b, U.apply({ instance: b }, N);
2461
- }), z;
2475
+ 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(D, K) {
2476
+ var L;
2477
+ return D[K] = (L = g.methods[K], function() {
2478
+ for (var M = Array.prototype.slice.call(arguments), U = new Array(L.length), q = 0; q < M.length; q++)
2479
+ U[q] = M[q];
2480
+ return U[U.length] = b, L.apply({ instance: b }, U);
2481
+ }), D;
2462
2482
  }, {}), delete g.methods);
2463
- var A = Object.keys(g).concat(O), $ = new Set(m.events.concat(A));
2464
- if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2483
+ var $ = Object.keys(g).concat(E), z = new Set(m.events.concat($));
2484
+ if (m.events = Array.from(z), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2465
2485
  throw new Error(g.name + "AlreadyLoaded");
2466
2486
  return m.plugins[g.name] = g, m.plugins[g.name].loaded || (m.plugins[g.name].loaded = function() {
2467
2487
  return !0;
2468
2488
  }), m;
2469
2489
  }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: je }, o = /* @__PURE__ */ function(m) {
2470
- return function(g, O, A) {
2471
- return O.getState("user")[g] || (A && X(A) && A[g] ? A[g] : an(m)[g] || ge(St(g)) || null);
2490
+ return function(g, E, $) {
2491
+ return E.getState("user")[g] || ($ && F($) && $[g] ? $[g] : an(m)[g] || ge(St(g)) || null);
2472
2492
  };
2473
2493
  }(i), a = r.plugins, s = r.events.filter(function(m) {
2474
2494
  return !_t.includes(m);
@@ -2476,49 +2496,49 @@ function eo(t) {
2476
2496
  return !_t.includes(m);
2477
2497
  })), f = Array.from(p).sort(), u = function() {
2478
2498
  return a;
2479
- }, c = new Zi(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, I = function() {
2499
+ }, c = new Zi(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
2480
2500
  throw new Error("Abort disabled inListener");
2481
- }, y = Pi(), S = an(i), E = P({}, S, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
2482
- E.anonymousId || (E.anonymousId = ot());
2483
- var v = P({ enable: function(m, g) {
2484
- return new Promise(function(O) {
2485
- x.dispatch({ type: T.enablePlugin, plugins: gt(m), _: { originalAction: T.enablePlugin } }, O, [g]);
2501
+ }, v = Pi(), _ = an(i), S = P({}, _, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
2502
+ S.anonymousId || (S.anonymousId = ot());
2503
+ var y = P({ enable: function(m, g) {
2504
+ return new Promise(function(E) {
2505
+ x.dispatch({ type: T.enablePlugin, plugins: gt(m), _: { originalAction: T.enablePlugin } }, E, [g]);
2486
2506
  });
2487
2507
  }, disable: function(m, g) {
2488
- return new Promise(function(O) {
2489
- x.dispatch({ type: T.disablePlugin, plugins: gt(m), _: { originalAction: T.disablePlugin } }, O, [g]);
2508
+ return new Promise(function(E) {
2509
+ x.dispatch({ type: T.disablePlugin, plugins: gt(m), _: { originalAction: T.disablePlugin } }, E, [g]);
2490
2510
  });
2491
- } }, r.methods), l = !1, b = { identify: function(m, g, O, A) {
2511
+ } }, r.methods), l = !1, b = { identify: function(m, g, E, $) {
2492
2512
  try {
2493
- var $ = re(m) ? m : null, z = X(m) ? m : g, M = O || {}, U = b.user();
2494
- ye(St(te), $);
2495
- var Z = $ || z.userId || o(te, b, z);
2496
- return Promise.resolve(new Promise(function(N) {
2497
- x.dispatch(P({ type: T.identifyStart, userId: Z, traits: z || {}, options: M, anonymousId: U.anonymousId }, U.id && U.id !== $ && { previousId: U.id }), N, [g, O, A]);
2513
+ var z = re(m) ? m : null, D = F(m) ? m : g, K = E || {}, L = b.user();
2514
+ ye(St(te), z);
2515
+ var M = z || D.userId || o(te, b, D);
2516
+ return Promise.resolve(new Promise(function(U) {
2517
+ x.dispatch(P({ type: T.identifyStart, userId: M, traits: D || {}, options: K, anonymousId: L.anonymousId }, L.id && L.id !== z && { previousId: L.id }), U, [g, E, $]);
2498
2518
  }));
2499
- } catch (N) {
2500
- return Promise.reject(N);
2519
+ } catch (U) {
2520
+ return Promise.reject(U);
2501
2521
  }
2502
- }, track: function(m, g, O, A) {
2522
+ }, track: function(m, g, E, $) {
2503
2523
  try {
2504
- var $ = X(m) ? m.event : m;
2505
- if (!$ || !re($))
2524
+ var z = F(m) ? m.event : m;
2525
+ if (!z || !re(z))
2506
2526
  throw new Error("EventMissing");
2507
- var z = X(m) ? m : g || {}, M = X(O) ? O : {};
2508
- return Promise.resolve(new Promise(function(U) {
2509
- x.dispatch({ type: T.trackStart, event: $, properties: z, options: M, userId: o(te, b, g), anonymousId: o(ke, b, g) }, U, [g, O, A]);
2527
+ var D = F(m) ? m : g || {}, K = F(E) ? E : {};
2528
+ return Promise.resolve(new Promise(function(L) {
2529
+ x.dispatch({ type: T.trackStart, event: z, properties: D, options: K, userId: o(te, b, g), anonymousId: o(ke, b, g) }, L, [g, E, $]);
2510
2530
  }));
2511
- } catch (U) {
2512
- return Promise.reject(U);
2531
+ } catch (L) {
2532
+ return Promise.reject(L);
2513
2533
  }
2514
- }, page: function(m, g, O) {
2534
+ }, page: function(m, g, E) {
2515
2535
  try {
2516
- var A = X(m) ? m : {}, $ = X(g) ? g : {};
2517
- return Promise.resolve(new Promise(function(z) {
2518
- x.dispatch({ type: T.pageStart, properties: Hi(A), options: $, userId: o(te, b, A), anonymousId: o(ke, b, A) }, z, [m, g, O]);
2536
+ var $ = F(m) ? m : {}, z = F(g) ? g : {};
2537
+ return Promise.resolve(new Promise(function(D) {
2538
+ x.dispatch({ type: T.pageStart, properties: Hi($), options: z, userId: o(te, b, $), anonymousId: o(ke, b, $) }, D, [m, g, E]);
2519
2539
  }));
2520
- } catch (z) {
2521
- return Promise.reject(z);
2540
+ } catch (D) {
2541
+ return Promise.reject(D);
2522
2542
  }
2523
2543
  }, user: function(m) {
2524
2544
  if (m === te || m === "id")
@@ -2532,7 +2552,7 @@ function eo(t) {
2532
2552
  x.dispatch({ type: T.resetStart }, g, m);
2533
2553
  });
2534
2554
  }, ready: function(m) {
2535
- return l && m({ plugins: v, instance: b }), b.on(T.ready, function(g) {
2555
+ return l && m({ plugins: y, instance: b }), b.on(T.ready, function(g) {
2536
2556
  m(g), l = !0;
2537
2557
  });
2538
2558
  }, on: function(m, g) {
@@ -2540,44 +2560,44 @@ function eo(t) {
2540
2560
  return !1;
2541
2561
  if (m === T.bootstrap)
2542
2562
  throw new Error(".on disabled for " + m);
2543
- var O = /Start$|Start:/;
2563
+ var E = /Start$|Start:/;
2544
2564
  if (m === "*") {
2545
- var A = function(U) {
2546
- return function(Z) {
2547
- return function(N) {
2548
- return N.type.match(O) && g({ payload: N, instance: b, plugins: a }), Z(N);
2565
+ var $ = function(L) {
2566
+ return function(M) {
2567
+ return function(U) {
2568
+ return U.type.match(E) && g({ payload: U, instance: b, plugins: a }), M(U);
2549
2569
  };
2550
2570
  };
2551
- }, $ = function(U) {
2552
- return function(Z) {
2553
- return function(N) {
2554
- return N.type.match(O) || g({ payload: N, instance: b, plugins: a }), Z(N);
2571
+ }, z = function(L) {
2572
+ return function(M) {
2573
+ return function(U) {
2574
+ return U.type.match(E) || g({ payload: U, instance: b, plugins: a }), M(U);
2555
2575
  };
2556
2576
  };
2557
2577
  };
2558
- return h(A, He), h($, Ve), function() {
2559
- d(A, He), d($, Ve);
2578
+ return h($, He), h(z, Ve), function() {
2579
+ d($, He), d(z, Ve);
2560
2580
  };
2561
2581
  }
2562
- var z = m.match(O) ? He : Ve, M = function(U) {
2563
- return function(Z) {
2564
- return function(N) {
2565
- return N.type === m && g({ payload: N, instance: b, plugins: a, abort: I }), Z(N);
2582
+ var D = m.match(E) ? He : Ve, K = function(L) {
2583
+ return function(M) {
2584
+ return function(U) {
2585
+ return U.type === m && g({ payload: U, instance: b, plugins: a, abort: k }), M(U);
2566
2586
  };
2567
2587
  };
2568
2588
  };
2569
- return h(M, z), function() {
2570
- return d(M, z);
2589
+ return h(K, D), function() {
2590
+ return d(K, D);
2571
2591
  };
2572
2592
  }, once: function(m, g) {
2573
2593
  if (!m || !G(g))
2574
2594
  return !1;
2575
2595
  if (m === T.bootstrap)
2576
2596
  throw new Error(".once disabled for " + m);
2577
- var O = b.on(m, function(A) {
2578
- g({ payload: A.payload, instance: b, plugins: a, abort: I }), O();
2597
+ var E = b.on(m, function($) {
2598
+ g({ payload: $.payload, instance: b, plugins: a, abort: k }), E();
2579
2599
  });
2580
- return O;
2600
+ return E;
2581
2601
  }, getState: function(m) {
2582
2602
  var g = x.getState();
2583
2603
  return m ? qt(g, m) : Object.assign({}, g);
@@ -2585,84 +2605,84 @@ function eo(t) {
2585
2605
  var g = re(m) ? { type: m } : m;
2586
2606
  if (Be.includes(g.type))
2587
2607
  throw new Error("reserved action " + g.type);
2588
- var O = P({}, g, { _: P({ originalAction: g.type }, m._ || {}) });
2589
- x.dispatch(O);
2590
- }, enablePlugin: v.enable, disablePlugin: v.disable, plugins: v, storage: { getItem: i.getItem, setItem: function(m, g, O) {
2591
- x.dispatch({ type: T.setItemStart, key: m, value: g, options: O });
2608
+ var E = P({}, g, { _: P({ originalAction: g.type }, m._ || {}) });
2609
+ x.dispatch(E);
2610
+ }, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(m, g, E) {
2611
+ x.dispatch({ type: T.setItemStart, key: m, value: g, options: E });
2592
2612
  }, removeItem: function(m, g) {
2593
2613
  x.dispatch({ type: T.removeItemStart, key: m, options: g });
2594
2614
  } }, setAnonymousId: function(m, g) {
2595
2615
  b.storage.setItem(ie, m, g);
2596
- }, events: { core: Be, plugins: s } }, j = r.middlewares.concat([function(m) {
2616
+ }, events: { core: Be, plugins: s } }, C = r.middlewares.concat([function(m) {
2597
2617
  return function(g) {
2598
- return function(O) {
2599
- return O.meta || (O.meta = wn()), g(O);
2618
+ return function(E) {
2619
+ return E.meta || (E.meta = wn()), g(E);
2600
2620
  };
2601
2621
  };
2602
- }, 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, C = Pe;
2622
+ }, w(He), Li(b, u, { all: f, plugins: s }), Ri(i), $i(b), Ni(b), w(Ve)]), O = { context: Gi, user: zi(i), page: Yi, track: Ki, plugins: Wi(u), queue: Xi }, A = Pe, Z = Pe;
2603
2623
  if (Y && t.debug) {
2604
- var D = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2605
- D && (_ = D({ trace: !0, traceLimit: 25 })), C = function() {
2606
- return arguments.length === 0 ? sr() : X(typeof arguments[0]) ? vn() : vn().apply(null, arguments);
2624
+ var I = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2625
+ I && (A = I({ trace: !0, traceLimit: 25 })), Z = function() {
2626
+ return arguments.length === 0 ? sr() : F(typeof arguments[0]) ? vn() : vn().apply(null, arguments);
2607
2627
  };
2608
2628
  }
2609
- var R, L = function(m) {
2610
- return Object.keys(m).reduce(function(g, O) {
2611
- return Bi.includes(O) || (g[O] = m[O]), g;
2629
+ var j, N = function(m) {
2630
+ return Object.keys(m).reduce(function(g, E) {
2631
+ return Bi.includes(E) || (g[E] = m[E]), g;
2612
2632
  }, {});
2613
- }(t), F = r.pluginsArray.reduce(function(m, g) {
2614
- var O = g.name, A = g.config, $ = g.loaded, z = r.pluginEnabled[O];
2615
- return m[O] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!$({ config: A }), config: A }, m;
2616
- }, {}), W = { context: L, user: E, plugins: F }, x = Bn(function(m) {
2617
- for (var g = Object.keys(m), O = {}, A = 0; A < g.length; A++) {
2618
- var $ = g[A];
2619
- typeof m[$] === ne && (O[$] = m[$]);
2633
+ }(t), W = r.pluginsArray.reduce(function(m, g) {
2634
+ var E = g.name, $ = g.config, z = g.loaded, D = r.pluginEnabled[E];
2635
+ return m[E] = { enabled: D, initialized: !!D && !g.initialize, loaded: !!z({ config: $ }), config: $ }, m;
2636
+ }, {}), R = { context: N, user: S, plugins: W }, x = Bn(function(m) {
2637
+ for (var g = Object.keys(m), E = {}, $ = 0; $ < g.length; $++) {
2638
+ var z = g[$];
2639
+ typeof m[z] === ne && (E[z] = m[z]);
2620
2640
  }
2621
- var z, M = Object.keys(O);
2641
+ var D, K = Object.keys(E);
2622
2642
  try {
2623
- (function(U) {
2624
- Object.keys(U).forEach(function(Z) {
2625
- var N = U[Z];
2626
- if (typeof N(void 0, { type: "@@redux/INIT" }) === ee || typeof N(void 0, { type: xi }) === ee)
2627
- throw new Error("reducer " + Z + " " + ee);
2643
+ (function(L) {
2644
+ Object.keys(L).forEach(function(M) {
2645
+ var U = L[M];
2646
+ if (typeof U(void 0, { type: "@@redux/INIT" }) === ee || typeof U(void 0, { type: xi }) === ee)
2647
+ throw new Error("reducer " + M + " " + ee);
2628
2648
  });
2629
- })(O);
2630
- } catch (U) {
2631
- z = U;
2649
+ })(E);
2650
+ } catch (L) {
2651
+ D = L;
2632
2652
  }
2633
- return function(U, Z) {
2634
- if (U === void 0 && (U = {}), z)
2635
- throw z;
2636
- for (var N = !1, q = {}, Ae = 0; Ae < M.length; Ae++) {
2637
- var Me = M[Ae], Rt = U[Me], ct = (0, O[Me])(Rt, Z);
2653
+ return function(L, M) {
2654
+ if (L === void 0 && (L = {}), D)
2655
+ throw D;
2656
+ for (var U = !1, q = {}, Ae = 0; Ae < K.length; Ae++) {
2657
+ var Me = K[Ae], Rt = L[Me], ct = (0, E[Me])(Rt, M);
2638
2658
  if (typeof ct === ee) {
2639
- var vr = Ci(Me, Z);
2659
+ var vr = Ci(Me, M);
2640
2660
  throw new Error(vr);
2641
2661
  }
2642
- q[Me] = ct, N = N || ct !== Rt;
2662
+ q[Me] = ct, U = U || ct !== Rt;
2643
2663
  }
2644
- return N ? q : U;
2664
+ return U ? q : L;
2645
2665
  };
2646
- }(P({}, k, e)), W, C(_(Ai.apply(void 0, j))));
2647
- x.dispatch = (R = x.dispatch, function(m, g, O) {
2648
- var A = P({}, m, { meta: wn(m.meta, g, gt(O)) });
2649
- return R.apply(null, [A]);
2666
+ }(P({}, O, e)), R, Z(A(Ai.apply(void 0, C))));
2667
+ x.dispatch = (j = x.dispatch, function(m, g, E) {
2668
+ var $ = P({}, m, { meta: wn(m.meta, g, gt(E)) });
2669
+ return j.apply(null, [$]);
2650
2670
  });
2651
- var K = Object.keys(a);
2652
- x.dispatch({ type: T.bootstrap, plugins: K, config: L, params: y, user: E, initialUser: n, persistedUser: S });
2653
- var J = K.filter(function(m) {
2671
+ var J = Object.keys(a);
2672
+ x.dispatch({ type: T.bootstrap, plugins: J, config: N, params: v, user: S, initialUser: n, persistedUser: _ });
2673
+ var X = J.filter(function(m) {
2654
2674
  return r.pluginEnabled[m];
2655
- }), Ce = K.filter(function(m) {
2675
+ }), Ce = J.filter(function(m) {
2656
2676
  return !r.pluginEnabled[m];
2657
2677
  });
2658
- return x.dispatch({ type: T.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, g) {
2659
- var O = m.bootstrap, A = m.config, $ = m.name;
2660
- O && G(O) && O({ instance: b, config: A, payload: m }), x.dispatch({ type: T.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: T.initializeStart, plugins: J, disabled: Ce });
2678
+ return x.dispatch({ type: T.registerPlugins, plugins: J, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, g) {
2679
+ var E = m.bootstrap, $ = m.config, z = m.name;
2680
+ E && G(E) && E({ instance: b, config: $, payload: m }), x.dispatch({ type: T.registerPluginType(z), name: z, enabled: r.pluginEnabled[z], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: T.initializeStart, plugins: X, disabled: Ce });
2661
2681
  }), Qi(function(m) {
2662
2682
  x.dispatch({ type: m ? T.offline : T.online });
2663
- }), function(m, g, O) {
2683
+ }), function(m, g, E) {
2664
2684
  setInterval(function() {
2665
- return Qn(m, g, O);
2685
+ return Qn(m, g, E);
2666
2686
  }, 3e3);
2667
2687
  }(x, u, b), b;
2668
2688
  }
@@ -2702,7 +2722,7 @@ function Se(t) {
2702
2722
  return !0;
2703
2723
  if (e === "false")
2704
2724
  return !1;
2705
- if (X(e))
2725
+ if (F(e))
2706
2726
  return e;
2707
2727
  parseFloat(e) === e && (e = parseFloat(e));
2708
2728
  } catch {
@@ -2863,8 +2883,8 @@ function vo(t) {
2863
2883
  for (var h = c ? "add" + In : "remove" + In, d = 0; d < p.length; d++) {
2864
2884
  var w = p[d];
2865
2885
  f[d] = c ? a && a.once ? wo(o) : o : f[d] || o;
2866
- for (var I = 0; I < s.length; I++)
2867
- w[h] ? w["on" + s[I]] = c ? f[d] : null : w[h](s[I], f[d], a);
2886
+ for (var k = 0; k < s.length; k++)
2887
+ w[h] ? w["on" + s[k]] = c ? f[d] : null : w[h](s[k], f[d], a);
2868
2888
  }
2869
2889
  return u.bind(null, !c);
2870
2890
  }(t);
@@ -2953,17 +2973,17 @@ function So(t) {
2953
2973
  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() {
2954
2974
  return clearTimeout(e);
2955
2975
  };
2956
- function w(y) {
2957
- d(), o && !u && o(ze(h), y), i && u && (u = !1, i(ze(n), y), h = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2958
- u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(h), y));
2976
+ function w(v) {
2977
+ d(), o && !u && o(ze(h), v), i && u && (u = !1, i(ze(n), v), h = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2978
+ u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(h), v));
2959
2979
  }, s);
2960
2980
  }
2961
- var I = _o(w, { throttle: f });
2981
+ var k = _o(w, { throttle: f });
2962
2982
  return { disable: function() {
2963
2983
  c = !0, u = !1, d();
2964
- var y = I();
2984
+ var v = k();
2965
2985
  return function() {
2966
- return c = !1, h = /* @__PURE__ */ new Date(), w({ type: "load" }), y();
2986
+ return c = !1, h = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
2967
2987
  };
2968
2988
  }, getStatus: function() {
2969
2989
  return { isIdle: u, isDisabled: c, active: u ? 0 : ze(h, c), idle: u ? ze(n, c) : 0 };