@sesamy/sesamy-js 1.0.3 → 1.0.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.
@@ -1,6 +1,6 @@
1
- var rr = Object.defineProperty;
2
- var ir = (t, e, n) => e in t ? rr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var Y = (t, e, n) => (ir(t, typeof e != "symbol" ? e + "" : e, n), n);
1
+ var pr = Object.defineProperty;
2
+ var mr = (t, e, n) => e in t ? pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var G = (t, e, n) => (mr(t, typeof e != "symbol" ? e + "" : e, n), n);
4
4
  (function() {
5
5
  const e = document.createElement("link").relList;
6
6
  if (e && e.supports && e.supports("modulepreload"))
@@ -25,7 +25,7 @@ var Y = (t, e, n) => (ir(t, typeof e != "symbol" ? e + "" : e, n), n);
25
25
  fetch(i.href, o);
26
26
  }
27
27
  })();
28
- function It(t, e) {
28
+ function Ot(t, e) {
29
29
  const n = new CustomEvent(t, {
30
30
  detail: e,
31
31
  bubbles: !0,
@@ -45,13 +45,13 @@ function Q(t, e) {
45
45
  return n;
46
46
  }
47
47
  var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
48
- function St(t) {
48
+ function Pt(t) {
49
49
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
50
50
  }
51
- function _t(t, e) {
51
+ function Tt(t, e) {
52
52
  return t(e = { exports: {} }, e.exports), e.exports;
53
53
  }
54
- var oe = _t(function(t, e) {
54
+ var oe = Tt(function(t, e) {
55
55
  Object.defineProperty(e, "__esModule", { value: !0 });
56
56
  var n = function() {
57
57
  function r() {
@@ -82,92 +82,92 @@ var oe = _t(function(t, e) {
82
82
  return n.getInstance();
83
83
  };
84
84
  });
85
- St(oe);
86
- var or = St(_t(function(t, e) {
87
- var n = se && se.__awaiter || function(u, c, d, h) {
88
- return new (d || (d = Promise))(function(v, w) {
89
- function y(I) {
85
+ Pt(oe);
86
+ var gr = Pt(Tt(function(t, e) {
87
+ var n = se && se.__awaiter || function(u, c, f, d) {
88
+ return new (f || (f = Promise))(function(v, k) {
89
+ function w(y) {
90
90
  try {
91
- _(h.next(I));
92
- } catch (g) {
93
- w(g);
91
+ _(d.next(y));
92
+ } catch (l) {
93
+ k(l);
94
94
  }
95
95
  }
96
- function k(I) {
96
+ function I(y) {
97
97
  try {
98
- _(h.throw(I));
99
- } catch (g) {
100
- w(g);
98
+ _(d.throw(y));
99
+ } catch (l) {
100
+ k(l);
101
101
  }
102
102
  }
103
- function _(I) {
104
- I.done ? v(I.value) : new d(function(g) {
105
- g(I.value);
106
- }).then(y, k);
103
+ function _(y) {
104
+ y.done ? v(y.value) : new f(function(l) {
105
+ l(y.value);
106
+ }).then(w, I);
107
107
  }
108
- _((h = h.apply(u, c || [])).next());
108
+ _((d = d.apply(u, c || [])).next());
109
109
  });
110
110
  }, r = se && se.__generator || function(u, c) {
111
- var d, h, v, w, y = { label: 0, sent: function() {
111
+ var f, d, v, k, w = { label: 0, sent: function() {
112
112
  if (1 & v[0])
113
113
  throw v[1];
114
114
  return v[1];
115
115
  }, trys: [], ops: [] };
116
- return w = { next: k(0), throw: k(1), return: k(2) }, typeof Symbol == "function" && (w[Symbol.iterator] = function() {
116
+ return k = { next: I(0), throw: I(1), return: I(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
117
117
  return this;
118
- }), w;
119
- function k(_) {
120
- return function(I) {
121
- return function(g) {
122
- if (d)
118
+ }), k;
119
+ function I(_) {
120
+ return function(y) {
121
+ return function(l) {
122
+ if (f)
123
123
  throw new TypeError("Generator is already executing.");
124
- for (; y; )
124
+ for (; w; )
125
125
  try {
126
- if (d = 1, h && (v = 2 & g[0] ? h.return : g[0] ? h.throw || ((v = h.return) && v.call(h), 0) : h.next) && !(v = v.call(h, g[1])).done)
126
+ if (f = 1, d && (v = 2 & l[0] ? d.return : l[0] ? d.throw || ((v = d.return) && v.call(d), 0) : d.next) && !(v = v.call(d, l[1])).done)
127
127
  return v;
128
- switch (h = 0, v && (g = [2 & g[0], v.value]), g[0]) {
128
+ switch (d = 0, v && (l = [2 & l[0], v.value]), l[0]) {
129
129
  case 0:
130
130
  case 1:
131
- v = g;
131
+ v = l;
132
132
  break;
133
133
  case 4:
134
- return y.label++, { value: g[1], done: !1 };
134
+ return w.label++, { value: l[1], done: !1 };
135
135
  case 5:
136
- y.label++, h = g[1], g = [0];
136
+ w.label++, d = l[1], l = [0];
137
137
  continue;
138
138
  case 7:
139
- g = y.ops.pop(), y.trys.pop();
139
+ l = w.ops.pop(), w.trys.pop();
140
140
  continue;
141
141
  default:
142
- if (v = y.trys, !((v = v.length > 0 && v[v.length - 1]) || g[0] !== 6 && g[0] !== 2)) {
143
- y = 0;
142
+ if (v = w.trys, !((v = v.length > 0 && v[v.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
143
+ w = 0;
144
144
  continue;
145
145
  }
146
- if (g[0] === 3 && (!v || g[1] > v[0] && g[1] < v[3])) {
147
- y.label = g[1];
146
+ if (l[0] === 3 && (!v || l[1] > v[0] && l[1] < v[3])) {
147
+ w.label = l[1];
148
148
  break;
149
149
  }
150
- if (g[0] === 6 && y.label < v[1]) {
151
- y.label = v[1], v = g;
150
+ if (l[0] === 6 && w.label < v[1]) {
151
+ w.label = v[1], v = l;
152
152
  break;
153
153
  }
154
- if (v && y.label < v[2]) {
155
- y.label = v[2], y.ops.push(g);
154
+ if (v && w.label < v[2]) {
155
+ w.label = v[2], w.ops.push(l);
156
156
  break;
157
157
  }
158
- v[2] && y.ops.pop(), y.trys.pop();
158
+ v[2] && w.ops.pop(), w.trys.pop();
159
159
  continue;
160
160
  }
161
- g = c.call(u, y);
161
+ l = c.call(u, w);
162
162
  } catch (b) {
163
- g = [6, b], h = 0;
163
+ l = [6, b], d = 0;
164
164
  } finally {
165
- d = v = 0;
165
+ f = v = 0;
166
166
  }
167
- if (5 & g[0])
168
- throw g[1];
169
- return { value: g[0] ? g[1] : void 0, done: !0 };
170
- }([_, I]);
167
+ if (5 & l[0])
168
+ throw l[1];
169
+ return { value: l[0] ? l[1] : void 0, done: !0 };
170
+ }([_, y]);
171
171
  };
172
172
  }
173
173
  }, i = se;
@@ -198,7 +198,7 @@ var or = St(_t(function(t, e) {
198
198
  });
199
199
  }, setItem: function(u, c) {
200
200
  return n(i, void 0, void 0, function() {
201
- return r(this, function(d) {
201
+ return r(this, function(f) {
202
202
  throw new Error("Unsupported");
203
203
  });
204
204
  });
@@ -218,54 +218,54 @@ var or = St(_t(function(t, e) {
218
218
  return setTimeout(c, u);
219
219
  });
220
220
  }
221
- function f(u) {
222
- for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", d = "", h = 0; h < u; h++)
223
- d += c[Math.floor(Math.random() * c.length)];
224
- return d;
221
+ function p(u) {
222
+ for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", f = "", d = 0; d < u; d++)
223
+ f += c[Math.floor(Math.random() * c.length)];
224
+ return f;
225
225
  }
226
226
  var m = function() {
227
227
  function u(c) {
228
- this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() + f(15), this.acquireLock = this.acquireLock.bind(this), this.releaseLock = this.releaseLock.bind(this), this.releaseLock__private__ = this.releaseLock__private__.bind(this), this.waitForSomethingToChange = this.waitForSomethingToChange.bind(this), this.refreshLockWhileAcquired = this.refreshLockWhileAcquired.bind(this), this.storageHandler = c, u.waiters === void 0 && (u.waiters = []);
228
+ this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() + p(15), this.acquireLock = this.acquireLock.bind(this), this.releaseLock = this.releaseLock.bind(this), this.releaseLock__private__ = this.releaseLock__private__.bind(this), this.waitForSomethingToChange = this.waitForSomethingToChange.bind(this), this.refreshLockWhileAcquired = this.refreshLockWhileAcquired.bind(this), this.storageHandler = c, u.waiters === void 0 && (u.waiters = []);
229
229
  }
230
- return u.prototype.acquireLock = function(c, d) {
231
- return d === void 0 && (d = 5e3), n(this, void 0, void 0, function() {
232
- var h, v, w, y, k, _, I;
233
- return r(this, function(g) {
234
- switch (g.label) {
230
+ return u.prototype.acquireLock = function(c, f) {
231
+ return f === void 0 && (f = 5e3), n(this, void 0, void 0, function() {
232
+ var d, v, k, w, I, _, y;
233
+ return r(this, function(l) {
234
+ switch (l.label) {
235
235
  case 0:
236
- h = Date.now() + f(4), v = Date.now() + d, w = o + "-" + c, y = this.storageHandler === void 0 ? a : this.storageHandler, g.label = 1;
236
+ d = Date.now() + p(4), v = Date.now() + f, k = o + "-" + c, w = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
237
237
  case 1:
238
238
  return Date.now() < v ? [4, s(30)] : [3, 8];
239
239
  case 2:
240
- return g.sent(), y.getItemSync(w) !== null ? [3, 5] : (k = this.id + "-" + c + "-" + h, [4, s(Math.floor(25 * Math.random()))]);
240
+ return l.sent(), w.getItemSync(k) !== null ? [3, 5] : (I = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
241
241
  case 3:
242
- return g.sent(), y.setItemSync(w, JSON.stringify({ id: this.id, iat: h, timeoutKey: k, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
242
+ return l.sent(), w.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: I, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
243
243
  case 4:
244
- return g.sent(), (_ = y.getItemSync(w)) !== null && (I = JSON.parse(_)).id === this.id && I.iat === h ? (this.acquiredIatSet.add(h), this.refreshLockWhileAcquired(w, h), [2, !0]) : [3, 7];
244
+ return l.sent(), (_ = w.getItemSync(k)) !== null && (y = JSON.parse(_)).id === this.id && y.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
245
245
  case 5:
246
246
  return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(v)];
247
247
  case 6:
248
- g.sent(), g.label = 7;
248
+ l.sent(), l.label = 7;
249
249
  case 7:
250
- return h = Date.now() + f(4), [3, 1];
250
+ return d = Date.now() + p(4), [3, 1];
251
251
  case 8:
252
252
  return [2, !1];
253
253
  }
254
254
  });
255
255
  });
256
- }, u.prototype.refreshLockWhileAcquired = function(c, d) {
256
+ }, u.prototype.refreshLockWhileAcquired = function(c, f) {
257
257
  return n(this, void 0, void 0, function() {
258
- var h = this;
258
+ var d = this;
259
259
  return r(this, function(v) {
260
260
  return setTimeout(function() {
261
- return n(h, void 0, void 0, function() {
262
- var w, y, k;
261
+ return n(d, void 0, void 0, function() {
262
+ var k, w, I;
263
263
  return r(this, function(_) {
264
264
  switch (_.label) {
265
265
  case 0:
266
- return [4, oe.default().lock(d)];
266
+ return [4, oe.default().lock(f)];
267
267
  case 1:
268
- return _.sent(), this.acquiredIatSet.has(d) ? (w = this.storageHandler === void 0 ? a : this.storageHandler, (y = w.getItemSync(c)) === null ? (oe.default().unlock(d), [2]) : ((k = JSON.parse(y)).timeRefreshed = Date.now(), w.setItemSync(c, JSON.stringify(k)), oe.default().unlock(d), this.refreshLockWhileAcquired(c, d), [2])) : (oe.default().unlock(d), [2]);
268
+ return _.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (w = k.getItemSync(c)) === null ? (oe.default().unlock(f), [2]) : ((I = JSON.parse(w)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(I)), oe.default().unlock(f), this.refreshLockWhileAcquired(c, f), [2])) : (oe.default().unlock(f), [2]);
269
269
  }
270
270
  });
271
271
  });
@@ -274,31 +274,31 @@ var or = St(_t(function(t, e) {
274
274
  });
275
275
  }, u.prototype.waitForSomethingToChange = function(c) {
276
276
  return n(this, void 0, void 0, function() {
277
- return r(this, function(d) {
278
- switch (d.label) {
277
+ return r(this, function(f) {
278
+ switch (f.label) {
279
279
  case 0:
280
- return [4, new Promise(function(h) {
281
- var v = !1, w = Date.now(), y = !1;
282
- function k() {
283
- if (y || (window.removeEventListener("storage", k), u.removeFromWaiting(k), clearTimeout(_), y = !0), !v) {
280
+ return [4, new Promise(function(d) {
281
+ var v = !1, k = Date.now(), w = !1;
282
+ function I() {
283
+ if (w || (window.removeEventListener("storage", I), u.removeFromWaiting(I), clearTimeout(_), w = !0), !v) {
284
284
  v = !0;
285
- var I = 50 - (Date.now() - w);
286
- I > 0 ? setTimeout(h, I) : h(null);
285
+ var y = 50 - (Date.now() - k);
286
+ y > 0 ? setTimeout(d, y) : d(null);
287
287
  }
288
288
  }
289
- window.addEventListener("storage", k), u.addToWaiting(k);
290
- var _ = setTimeout(k, Math.max(0, c - Date.now()));
289
+ window.addEventListener("storage", I), u.addToWaiting(I);
290
+ var _ = setTimeout(I, Math.max(0, c - Date.now()));
291
291
  })];
292
292
  case 1:
293
- return d.sent(), [2];
293
+ return f.sent(), [2];
294
294
  }
295
295
  });
296
296
  });
297
297
  }, u.addToWaiting = function(c) {
298
298
  this.removeFromWaiting(c), u.waiters !== void 0 && u.waiters.push(c);
299
299
  }, u.removeFromWaiting = function(c) {
300
- u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(d) {
301
- return d !== c;
300
+ u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(f) {
301
+ return f !== c;
302
302
  }));
303
303
  }, u.notifyWaiters = function() {
304
304
  u.waiters !== void 0 && u.waiters.slice().forEach(function(c) {
@@ -306,143 +306,143 @@ var or = St(_t(function(t, e) {
306
306
  });
307
307
  }, u.prototype.releaseLock = function(c) {
308
308
  return n(this, void 0, void 0, function() {
309
- return r(this, function(d) {
310
- switch (d.label) {
309
+ return r(this, function(f) {
310
+ switch (f.label) {
311
311
  case 0:
312
312
  return [4, this.releaseLock__private__(c)];
313
313
  case 1:
314
- return [2, d.sent()];
314
+ return [2, f.sent()];
315
315
  }
316
316
  });
317
317
  });
318
318
  }, u.prototype.releaseLock__private__ = function(c) {
319
319
  return n(this, void 0, void 0, function() {
320
- var d, h, v, w;
321
- return r(this, function(y) {
322
- switch (y.label) {
320
+ var f, d, v, k;
321
+ return r(this, function(w) {
322
+ switch (w.label) {
323
323
  case 0:
324
- return d = this.storageHandler === void 0 ? a : this.storageHandler, h = o + "-" + c, (v = d.getItemSync(h)) === null ? [2] : (w = JSON.parse(v)).id !== this.id ? [3, 2] : [4, oe.default().lock(w.iat)];
324
+ return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (v = f.getItemSync(d)) === null ? [2] : (k = JSON.parse(v)).id !== this.id ? [3, 2] : [4, oe.default().lock(k.iat)];
325
325
  case 1:
326
- y.sent(), this.acquiredIatSet.delete(w.iat), d.removeItemSync(h), oe.default().unlock(w.iat), u.notifyWaiters(), y.label = 2;
326
+ w.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d), oe.default().unlock(k.iat), u.notifyWaiters(), w.label = 2;
327
327
  case 2:
328
328
  return [2];
329
329
  }
330
330
  });
331
331
  });
332
332
  }, u.lockCorrector = function(c) {
333
- for (var d = Date.now() - 5e3, h = c, v = [], w = 0; ; ) {
334
- var y = h.keySync(w);
335
- if (y === null)
333
+ for (var f = Date.now() - 5e3, d = c, v = [], k = 0; ; ) {
334
+ var w = d.keySync(k);
335
+ if (w === null)
336
336
  break;
337
- v.push(y), w++;
337
+ v.push(w), k++;
338
338
  }
339
- for (var k = !1, _ = 0; _ < v.length; _++) {
340
- var I = v[_];
341
- if (I.includes(o)) {
342
- var g = h.getItemSync(I);
343
- if (g !== null) {
344
- var b = JSON.parse(g);
345
- (b.timeRefreshed === void 0 && b.timeAcquired < d || b.timeRefreshed !== void 0 && b.timeRefreshed < d) && (h.removeItemSync(I), k = !0);
339
+ for (var I = !1, _ = 0; _ < v.length; _++) {
340
+ var y = v[_];
341
+ if (y.includes(o)) {
342
+ var l = d.getItemSync(y);
343
+ if (l !== null) {
344
+ var b = JSON.parse(l);
345
+ (b.timeRefreshed === void 0 && b.timeAcquired < f || b.timeRefreshed !== void 0 && b.timeRefreshed < f) && (d.removeItemSync(y), I = !0);
346
346
  }
347
347
  }
348
348
  }
349
- k && u.notifyWaiters();
349
+ I && u.notifyWaiters();
350
350
  }, u.waiters = void 0, u;
351
351
  }();
352
352
  e.default = m;
353
353
  }));
354
- const ar = { timeoutInSeconds: 60 }, gn = { name: "auth0-spa-js", version: "2.1.3" }, vn = () => Date.now();
355
- let J = class mt extends Error {
354
+ const yr = { timeoutInSeconds: 60 }, In = { name: "auth0-spa-js", version: "2.1.3" }, _n = () => Date.now();
355
+ let V = class wt extends Error {
356
356
  constructor(e, n) {
357
- super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, mt.prototype);
357
+ super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, wt.prototype);
358
358
  }
359
359
  static fromPayload({ error: e, error_description: n }) {
360
- return new mt(e, n);
360
+ return new wt(e, n);
361
361
  }
362
- }, sr = class yn extends J {
362
+ }, vr = class Sn extends V {
363
363
  constructor(e, n, r, i = null) {
364
- super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, yn.prototype);
364
+ super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Sn.prototype);
365
365
  }
366
- }, gt = class wn extends J {
366
+ }, bt = class En extends V {
367
367
  constructor() {
368
- super("timeout", "Timeout"), Object.setPrototypeOf(this, wn.prototype);
368
+ super("timeout", "Timeout"), Object.setPrototypeOf(this, En.prototype);
369
369
  }
370
- }, cr = class bn extends gt {
370
+ }, wr = class On extends bt {
371
371
  constructor(e) {
372
- super(), this.popup = e, Object.setPrototypeOf(this, bn.prototype);
372
+ super(), this.popup = e, Object.setPrototypeOf(this, On.prototype);
373
373
  }
374
- }, ur = class kn extends J {
374
+ }, br = class Pn extends V {
375
375
  constructor(e) {
376
- super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, kn.prototype);
376
+ super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Pn.prototype);
377
377
  }
378
- }, lr = class In extends J {
378
+ }, kr = class Tn extends V {
379
379
  constructor(e, n, r) {
380
- super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, In.prototype);
380
+ super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Tn.prototype);
381
381
  }
382
- }, Sn = class _n extends J {
382
+ }, jn = class xn extends V {
383
383
  constructor(e, n) {
384
- super("missing_refresh_token", `Missing Refresh Token (audience: '${zt(e, ["default"])}', scope: '${zt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, _n.prototype);
384
+ super("missing_refresh_token", `Missing Refresh Token (audience: '${Dt(e, ["default"])}', scope: '${Dt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, xn.prototype);
385
385
  }
386
386
  };
387
- function zt(t, e = []) {
387
+ function Dt(t, e = []) {
388
388
  return t && !e.includes(t) ? t : "";
389
389
  }
390
- const Je = () => window.crypto, ot = () => {
390
+ const Be = () => window.crypto, ut = () => {
391
391
  const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
392
392
  let e = "";
393
- return Array.from(Je().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
394
- }, Nt = (t) => btoa(t), vt = (t) => {
393
+ return Array.from(Be().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
394
+ }, Ut = (t) => btoa(t), kt = (t) => {
395
395
  var { clientId: e } = t, n = Q(t, ["clientId"]);
396
396
  return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
397
- }, At = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), dr = async (t, e) => {
397
+ }, Rt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Ir = async (t, e) => {
398
398
  const n = await fetch(t, e);
399
399
  return { ok: n.ok, json: await n.json() };
400
- }, hr = async (t, e, n) => {
400
+ }, _r = async (t, e, n) => {
401
401
  const r = new AbortController();
402
402
  let i;
403
- return e.signal = r.signal, Promise.race([dr(t, e), new Promise((o, a) => {
403
+ return e.signal = r.signal, Promise.race([Ir(t, e), new Promise((o, a) => {
404
404
  i = setTimeout(() => {
405
405
  r.abort(), a(new Error("Timeout when executing 'fetch'"));
406
406
  }, n);
407
407
  })]).finally(() => {
408
408
  clearTimeout(i);
409
409
  });
410
- }, fr = async (t, e, n, r, i, o, a) => {
411
- return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, f = o, new Promise(function(m, u) {
410
+ }, Sr = async (t, e, n, r, i, o, a) => {
411
+ return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, p = o, new Promise(function(m, u) {
412
412
  const c = new MessageChannel();
413
- c.port1.onmessage = function(d) {
414
- d.data.error ? u(new Error(d.data.error)) : m(d.data), c.port1.close();
415
- }, f.postMessage(s, [c.port2]);
413
+ c.port1.onmessage = function(f) {
414
+ f.data.error ? u(new Error(f.data.error)) : m(f.data), c.port1.close();
415
+ }, p.postMessage(s, [c.port2]);
416
416
  });
417
- var s, f;
418
- }, pr = async (t, e, n, r, i, o, a = 1e4) => i ? fr(t, e, n, r, a, i, o) : hr(t, r, a);
419
- async function mr(t, e) {
420
- var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
421
- const m = s ? vt(f) : JSON.stringify(f);
422
- return await async function(u, c, d, h, v, w, y) {
423
- let k, _ = null;
424
- for (let x = 0; x < 3; x++)
417
+ var s, p;
418
+ }, Er = async (t, e, n, r, i, o, a = 1e4) => i ? Sr(t, e, n, r, a, i, o) : _r(t, r, a);
419
+ async function Or(t, e) {
420
+ var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, p = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
421
+ const m = s ? kt(p) : JSON.stringify(p);
422
+ return await async function(u, c, f, d, v, k, w) {
423
+ let I, _ = null;
424
+ for (let j = 0; j < 3; j++)
425
425
  try {
426
- k = await pr(u, d, h, v, w, y, c), _ = null;
426
+ I = await Er(u, f, d, v, k, w, c), _ = null;
427
427
  break;
428
428
  } catch (D) {
429
429
  _ = D;
430
430
  }
431
431
  if (_)
432
432
  throw _;
433
- const I = k.json, { error: g, error_description: b } = I, A = Q(I, ["error", "error_description"]), { ok: C } = k;
434
- if (!C) {
435
- const x = b || `HTTP error. Unable to fetch ${u}`;
436
- throw g === "mfa_required" ? new lr(g, x, A.mfa_token) : g === "missing_refresh_token" ? new Sn(d, h) : new J(g || "request_error", x);
433
+ const y = I.json, { error: l, error_description: b } = y, T = Q(y, ["error", "error_description"]), { ok: x } = I;
434
+ if (!x) {
435
+ const j = b || `HTTP error. Unable to fetch ${u}`;
436
+ throw l === "mfa_required" ? new kr(l, j, T.mfa_token) : l === "missing_refresh_token" ? new jn(f, d) : new V(l || "request_error", j);
437
437
  }
438
- return A;
439
- }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || gn)) } }, e, s);
438
+ return T;
439
+ }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || In)) } }, e, s);
440
440
  }
441
- const Ze = (...t) => {
441
+ const Me = (...t) => {
442
442
  return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
443
443
  var e;
444
444
  };
445
- let ue = class yt {
445
+ let ue = class It {
446
446
  constructor(e, n = "@@auth0spajs@@", r) {
447
447
  this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
448
448
  }
@@ -451,13 +451,13 @@ let ue = class yt {
451
451
  }
452
452
  static fromKey(e) {
453
453
  const [n, r, i, o] = e.split("::");
454
- return new yt({ clientId: r, scope: o, audience: i }, n);
454
+ return new It({ clientId: r, scope: o, audience: i }, n);
455
455
  }
456
456
  static fromCacheEntry(e) {
457
457
  const { scope: n, audience: r, client_id: i } = e;
458
- return new yt({ scope: n, audience: r, clientId: i });
458
+ return new It({ scope: n, audience: r, clientId: i });
459
459
  }
460
- }, gr = class {
460
+ }, Pr = class {
461
461
  set(e, n) {
462
462
  localStorage.setItem(e, JSON.stringify(n));
463
463
  }
@@ -476,7 +476,7 @@ let ue = class yt {
476
476
  allKeys() {
477
477
  return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
478
478
  }
479
- }, On = class {
479
+ }, Cn = class {
480
480
  constructor() {
481
481
  this.enclosedCache = /* @__PURE__ */ function() {
482
482
  let e = {};
@@ -491,9 +491,9 @@ let ue = class yt {
491
491
  }, allKeys: () => Object.keys(e) };
492
492
  }();
493
493
  }
494
- }, vr = class {
494
+ }, Tr = class {
495
495
  constructor(e, n, r) {
496
- this.cache = e, this.keyManifest = n, this.nowProvider = r || vn;
496
+ this.cache = e, this.keyManifest = n, this.nowProvider = r || _n;
497
497
  }
498
498
  async setIdToken(e, n, r) {
499
499
  var i;
@@ -516,8 +516,8 @@ let ue = class yt {
516
516
  const s = await this.getCacheKeys();
517
517
  if (!s)
518
518
  return;
519
- const f = this.matchExistingCacheKey(e, s);
520
- f && (i = await this.cache.get(f));
519
+ const p = this.matchExistingCacheKey(e, s);
520
+ p && (i = await this.cache.get(p));
521
521
  }
522
522
  if (!i)
523
523
  return;
@@ -550,11 +550,11 @@ let ue = class yt {
550
550
  matchExistingCacheKey(e, n) {
551
551
  return n.filter((r) => {
552
552
  var i;
553
- const o = ue.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((m, u) => m && a.has(u), !0);
554
- return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && f;
553
+ const o = ue.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], p = o.scope && s.reduce((m, u) => m && a.has(u), !0);
554
+ return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && p;
555
555
  })[0];
556
556
  }
557
- }, yr = class {
557
+ }, jr = class {
558
558
  constructor(e, n, r) {
559
559
  this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
560
560
  }
@@ -568,17 +568,17 @@ let ue = class yt {
568
568
  this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
569
569
  }
570
570
  };
571
- const Te = (t) => typeof t == "number", wr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], br = (t) => {
571
+ const ze = (t) => typeof t == "number", xr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], Cr = (t) => {
572
572
  if (!t.id_token)
573
573
  throw new Error("ID token is required but missing");
574
574
  const e = ((o) => {
575
- const a = o.split("."), [s, f, m] = a;
576
- if (a.length !== 3 || !s || !f || !m)
575
+ const a = o.split("."), [s, p, m] = a;
576
+ if (a.length !== 3 || !s || !p || !m)
577
577
  throw new Error("ID token could not be decoded");
578
- const u = JSON.parse(At(f)), c = { __raw: o }, d = {};
579
- return Object.keys(u).forEach((h) => {
580
- c[h] = u[h], wr.includes(h) || (d[h] = u[h]);
581
- }), { encoded: { header: s, payload: f, signature: m }, header: JSON.parse(At(s)), claims: c, user: d };
578
+ const u = JSON.parse(Rt(p)), c = { __raw: o }, f = {};
579
+ return Object.keys(u).forEach((d) => {
580
+ c[d] = u[d], xr.includes(d) || (f[d] = u[d]);
581
+ }), { encoded: { header: s, payload: p, signature: m }, header: JSON.parse(Rt(s)), claims: c, user: f };
582
582
  })(t.id_token);
583
583
  if (!e.claims.iss)
584
584
  throw new Error("Issuer (iss) claim must be a string present in the ID token");
@@ -607,21 +607,21 @@ const Te = (t) => typeof t == "number", wr = ["iss", "aud", "exp", "nbf", "iat",
607
607
  if (e.claims.nonce !== t.nonce)
608
608
  throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
609
609
  }
610
- if (t.max_age && !Te(e.claims.auth_time))
610
+ if (t.max_age && !ze(e.claims.auth_time))
611
611
  throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
612
- if (e.claims.exp == null || !Te(e.claims.exp))
612
+ if (e.claims.exp == null || !ze(e.claims.exp))
613
613
  throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
614
- if (!Te(e.claims.iat))
614
+ if (!ze(e.claims.iat))
615
615
  throw new Error("Issued At (iat) claim must be a number present in the ID token");
616
616
  const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
617
617
  if (i.setUTCSeconds(e.claims.exp + n), r > i)
618
618
  throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
619
- if (e.claims.nbf != null && Te(e.claims.nbf)) {
619
+ if (e.claims.nbf != null && ze(e.claims.nbf)) {
620
620
  const o = /* @__PURE__ */ new Date(0);
621
621
  if (o.setUTCSeconds(e.claims.nbf - n), r < o)
622
622
  throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${o}`);
623
623
  }
624
- if (e.claims.auth_time != null && Te(e.claims.auth_time)) {
624
+ if (e.claims.auth_time != null && ze(e.claims.auth_time)) {
625
625
  const o = /* @__PURE__ */ new Date(0);
626
626
  if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
627
627
  throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`);
@@ -644,36 +644,36 @@ const Te = (t) => typeof t == "number", wr = ["iss", "aud", "exp", "nbf", "iat",
644
644
  }
645
645
  return e;
646
646
  };
647
- var le = _t(function(t, e) {
647
+ var le = Tt(function(t, e) {
648
648
  var n = se && se.__assign || function() {
649
- return n = Object.assign || function(f) {
649
+ return n = Object.assign || function(p) {
650
650
  for (var m, u = 1, c = arguments.length; u < c; u++)
651
- for (var d in m = arguments[u])
652
- Object.prototype.hasOwnProperty.call(m, d) && (f[d] = m[d]);
653
- return f;
651
+ for (var f in m = arguments[u])
652
+ Object.prototype.hasOwnProperty.call(m, f) && (p[f] = m[f]);
653
+ return p;
654
654
  }, n.apply(this, arguments);
655
655
  };
656
- function r(f, m) {
656
+ function r(p, m) {
657
657
  if (!m)
658
658
  return "";
659
- var u = "; " + f;
659
+ var u = "; " + p;
660
660
  return m === !0 ? u : u + "=" + m;
661
661
  }
662
- function i(f, m, u) {
663
- return encodeURIComponent(f).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(m).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(c) {
662
+ function i(p, m, u) {
663
+ return encodeURIComponent(p).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(m).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(c) {
664
664
  if (typeof c.expires == "number") {
665
- var d = /* @__PURE__ */ new Date();
666
- d.setMilliseconds(d.getMilliseconds() + 864e5 * c.expires), c.expires = d;
665
+ var f = /* @__PURE__ */ new Date();
666
+ f.setMilliseconds(f.getMilliseconds() + 864e5 * c.expires), c.expires = f;
667
667
  }
668
668
  return r("Expires", c.expires ? c.expires.toUTCString() : "") + r("Domain", c.domain) + r("Path", c.path) + r("Secure", c.secure) + r("SameSite", c.sameSite);
669
669
  }(u);
670
670
  }
671
- function o(f) {
672
- for (var m = {}, u = f ? f.split("; ") : [], c = /(%[\dA-F]{2})+/gi, d = 0; d < u.length; d++) {
673
- var h = u[d].split("="), v = h.slice(1).join("=");
671
+ function o(p) {
672
+ for (var m = {}, u = p ? p.split("; ") : [], c = /(%[\dA-F]{2})+/gi, f = 0; f < u.length; f++) {
673
+ var d = u[f].split("="), v = d.slice(1).join("=");
674
674
  v.charAt(0) === '"' && (v = v.slice(1, -1));
675
675
  try {
676
- m[h[0].replace(c, decodeURIComponent)] = v.replace(c, decodeURIComponent);
676
+ m[d[0].replace(c, decodeURIComponent)] = v.replace(c, decodeURIComponent);
677
677
  } catch {
678
678
  }
679
679
  }
@@ -682,36 +682,36 @@ var le = _t(function(t, e) {
682
682
  function a() {
683
683
  return o(document.cookie);
684
684
  }
685
- function s(f, m, u) {
686
- document.cookie = i(f, m, n({ path: "/" }, u));
685
+ function s(p, m, u) {
686
+ document.cookie = i(p, m, n({ path: "/" }, u));
687
687
  }
688
- e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(f) {
689
- return a()[f];
690
- }, e.set = s, e.remove = function(f, m) {
691
- s(f, "", n(n({}, m), { expires: -1 }));
688
+ e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(p) {
689
+ return a()[p];
690
+ }, e.set = s, e.remove = function(p, m) {
691
+ s(p, "", n(n({}, m), { expires: -1 }));
692
692
  };
693
693
  });
694
- St(le), le.encode, le.parse, le.getAll;
695
- var kr = le.get, En = le.set, Pn = le.remove;
696
- const ge = { get(t) {
697
- const e = kr(t);
694
+ Pt(le), le.encode, le.parse, le.getAll;
695
+ var $r = le.get, $n = le.set, zn = le.remove;
696
+ const we = { get(t) {
697
+ const e = $r(t);
698
698
  if (e !== void 0)
699
699
  return JSON.parse(e);
700
700
  }, save(t, e, n) {
701
701
  let r = {};
702
- window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), En(t, JSON.stringify(e), r);
702
+ window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), $n(t, JSON.stringify(e), r);
703
703
  }, remove(t, e) {
704
704
  let n = {};
705
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n);
706
- } }, Ir = { get(t) {
707
- return ge.get(t) || ge.get(`_legacy_${t}`);
705
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), zn(t, n);
706
+ } }, zr = { get(t) {
707
+ return we.get(t) || we.get(`_legacy_${t}`);
708
708
  }, save(t, e, n) {
709
709
  let r = {};
710
- window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), En(`_legacy_${t}`, JSON.stringify(e), r), ge.save(t, e, n);
710
+ window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), $n(`_legacy_${t}`, JSON.stringify(e), r), we.save(t, e, n);
711
711
  }, remove(t, e) {
712
712
  let n = {};
713
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n), ge.remove(t, e), ge.remove(`_legacy_${t}`, e);
714
- } }, Sr = { get(t) {
713
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), zn(t, n), we.remove(t, e), we.remove(`_legacy_${t}`, e);
714
+ } }, Ar = { get(t) {
715
715
  if (typeof sessionStorage > "u")
716
716
  return;
717
717
  const e = sessionStorage.getItem(t);
@@ -721,12 +721,12 @@ const ge = { get(t) {
721
721
  }, remove(t) {
722
722
  sessionStorage.removeItem(t);
723
723
  } };
724
- function _r(t, e, n) {
725
- var r = e === void 0 ? null : e, i = function(f, m) {
726
- var u = atob(f);
724
+ function Nr(t, e, n) {
725
+ var r = e === void 0 ? null : e, i = function(p, m) {
726
+ var u = atob(p);
727
727
  if (m) {
728
- for (var c = new Uint8Array(u.length), d = 0, h = u.length; d < h; ++d)
729
- c[d] = u.charCodeAt(d);
728
+ for (var c = new Uint8Array(u.length), f = 0, d = u.length; f < d; ++f)
729
+ c[f] = u.charCodeAt(f);
730
730
  return String.fromCharCode.apply(null, new Uint16Array(c.buffer));
731
731
  }
732
732
  return u;
@@ -734,11 +734,11 @@ function _r(t, e, n) {
734
734
  `, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
735
735
  return URL.createObjectURL(s);
736
736
  }
737
- var Lt, Dt, Ut, at, Or = (Lt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Dt = null, Ut = !1, function(t) {
738
- return at = at || _r(Lt, Dt, Ut), new Worker(at, t);
737
+ var Zt, Wt, Kt, lt, Lr = (Zt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Wt = null, Kt = !1, function(t) {
738
+ return lt = lt || Nr(Zt, Wt, Kt), new Worker(lt, t);
739
739
  });
740
- const st = {};
741
- let Er = class {
740
+ const dt = {};
741
+ let Dr = class {
742
742
  constructor(e, n) {
743
743
  this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
744
744
  }
@@ -764,85 +764,85 @@ let Er = class {
764
764
  return `@@auth0spajs@@::${e}`;
765
765
  }
766
766
  };
767
- const Pr = { memory: () => new On().enclosedCache, localstorage: () => new gr() }, Zt = (t) => Pr[t], Rt = (t) => {
767
+ const Ur = { memory: () => new Cn().enclosedCache, localstorage: () => new Pr() }, Mt = (t) => Ur[t], Xt = (t) => {
768
768
  const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
769
769
  return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
770
- }, ct = new or();
771
- let xr = class {
770
+ }, ht = new gr();
771
+ let Rr = class {
772
772
  constructor(e) {
773
773
  let n, r;
774
- if (this.userCache = new On().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
775
- await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
774
+ if (this.userCache = new Cn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
775
+ await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
776
776
  }, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
777
- if (!Je())
777
+ if (!Be())
778
778
  throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
779
- if (Je().subtle === void 0)
779
+ if (Be().subtle === void 0)
780
780
  throw new Error(`
781
781
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
782
782
  `);
783
783
  })(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
784
784
  r = e.cache;
785
785
  else {
786
- if (n = e.cacheLocation || "memory", !Zt(n))
786
+ if (n = e.cacheLocation || "memory", !Mt(n))
787
787
  throw new Error(`Invalid cache location "${n}"`);
788
- r = Zt(n)();
788
+ r = Mt(n)();
789
789
  }
790
- this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? ge : Ir, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
791
- const i = e.useCookiesForTransactions ? this.cookieStorage : Sr;
790
+ this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? we : zr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
791
+ const i = e.useCookiesForTransactions ? this.cookieStorage : Ar;
792
792
  var o;
793
- this.scope = Ze("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new yr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || vn, this.cacheManager = new vr(r, r.allKeys ? void 0 : new Er(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Or());
793
+ this.scope = Me("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new jr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || _n, this.cacheManager = new Tr(r, r.allKeys ? void 0 : new Dr(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 Lr());
794
794
  }
795
795
  _url(e) {
796
- const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || gn)));
796
+ const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || In)));
797
797
  return `${this.domainUrl}${e}&auth0Client=${n}`;
798
798
  }
799
799
  _authorizeUrl(e) {
800
- return this._url(`/authorize?${vt(e)}`);
800
+ return this._url(`/authorize?${kt(e)}`);
801
801
  }
802
802
  async _verifyIdToken(e, n, r) {
803
803
  const i = await this.nowProvider();
804
- return br({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
804
+ return Cr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
805
805
  var o;
806
806
  }
807
807
  _processOrgHint(e) {
808
808
  e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
809
809
  }
810
810
  async _prepareAuthorizeUrl(e, n, r) {
811
- const i = Nt(ot()), o = Nt(ot()), a = ot(), s = ((u) => {
811
+ const i = Ut(ut()), o = Ut(ut()), a = ut(), s = ((u) => {
812
812
  const c = new Uint8Array(u);
813
- return ((d) => {
814
- const h = { "+": "-", "/": "_", "=": "" };
815
- return d.replace(/[+/=]/g, (v) => h[v]);
813
+ return ((f) => {
814
+ const d = { "+": "-", "/": "_", "=": "" };
815
+ return f.replace(/[+/=]/g, (v) => d[v]);
816
816
  })(window.btoa(String.fromCharCode(...Array.from(c))));
817
- })(await (async (u) => await Je().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, d, h, v, w, y, k) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), d), { scope: Ze(c, d.scope), response_type: "code", response_mode: k || "query", state: h, nonce: v, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: w, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), m = this._authorizeUrl(f);
818
- return { nonce: o, code_verifier: a, scope: f.scope, audience: f.audience || "default", redirect_uri: f.redirect_uri, state: i, url: m };
817
+ })(await (async (u) => await Be().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, f, d, v, k, w, I) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), f), { scope: Me(c, f.scope), response_type: "code", response_mode: I || "query", state: d, nonce: v, redirect_uri: w || 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), m = this._authorizeUrl(p);
818
+ return { nonce: o, code_verifier: a, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: i, url: m };
819
819
  }
820
820
  async loginWithPopup(e, n) {
821
821
  var r;
822
822
  if (e = e || {}, !(n = n || {}).popup && (n.popup = ((s) => {
823
- const f = window.screenX + (window.innerWidth - 400) / 2, m = window.screenY + (window.innerHeight - 600) / 2;
824
- return window.open(s, "auth0:authorize:popup", `left=${f},top=${m},width=400,height=600,resizable,scrollbars=yes,status=1`);
823
+ const p = window.screenX + (window.innerWidth - 400) / 2, m = window.screenY + (window.innerHeight - 600) / 2;
824
+ return window.open(s, "auth0:authorize:popup", `left=${p},top=${m},width=400,height=600,resizable,scrollbars=yes,status=1`);
825
825
  })(""), !n.popup))
826
826
  throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
827
827
  const i = await this._prepareAuthorizeUrl(e.authorizationParams || {}, { response_mode: "web_message" }, window.location.origin);
828
828
  n.popup.location.href = i.url;
829
- const o = await ((s) => new Promise((f, m) => {
829
+ const o = await ((s) => new Promise((p, m) => {
830
830
  let u;
831
831
  const c = setInterval(() => {
832
- s.popup && s.popup.closed && (clearInterval(c), clearTimeout(d), window.removeEventListener("message", u, !1), m(new ur(s.popup)));
833
- }, 1e3), d = setTimeout(() => {
834
- clearInterval(c), m(new cr(s.popup)), window.removeEventListener("message", u, !1);
832
+ s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), m(new br(s.popup)));
833
+ }, 1e3), f = setTimeout(() => {
834
+ clearInterval(c), m(new wr(s.popup)), window.removeEventListener("message", u, !1);
835
835
  }, 1e3 * (s.timeoutInSeconds || 60));
836
- u = function(h) {
837
- if (h.data && h.data.type === "authorization_response") {
838
- if (clearTimeout(d), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), h.data.response.error)
839
- return m(J.fromPayload(h.data.response));
840
- f(h.data.response);
836
+ u = function(d) {
837
+ if (d.data && d.data.type === "authorization_response") {
838
+ if (clearTimeout(f), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
839
+ return m(V.fromPayload(d.data.response));
840
+ p(d.data.response);
841
841
  }
842
842
  }, window.addEventListener("message", u);
843
843
  }))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
844
844
  if (i.state !== o.state)
845
- throw new J("state_mismatch", "Invalid state");
845
+ throw new V("state_mismatch", "Invalid state");
846
846
  const a = ((r = e.authorizationParams) === null || r === void 0 ? void 0 : r.organization) || this.options.authorizationParams.organization;
847
847
  await this._requestToken({ audience: i.audience, scope: i.scope, code_verifier: i.code_verifier, grant_type: "authorization_code", code: o.code, redirect_uri: i.redirect_uri }, { nonceIn: i.nonce, organization: a });
848
848
  }
@@ -858,10 +858,10 @@ let xr = class {
858
858
  }
859
859
  async loginWithRedirect(e = {}) {
860
860
  var n;
861
- const r = Rt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = Q(m, ["url"]);
862
- this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), f && { organization: f }));
863
- const d = o ? `${u}#${o}` : u;
864
- i ? await i(d) : window.location.assign(d);
861
+ const r = Xt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), p = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = Q(m, ["url"]);
862
+ this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), p && { organization: p }));
863
+ const f = o ? `${u}#${o}` : u;
864
+ i ? await i(f) : window.location.assign(f);
865
865
  }
866
866
  async handleRedirectCallback(e = window.location.href) {
867
867
  const n = e.split("?").slice(1);
@@ -869,17 +869,17 @@ let xr = class {
869
869
  throw new Error("There are no query params available for parsing.");
870
870
  const { state: r, code: i, error: o, error_description: a } = ((c) => {
871
871
  c.indexOf("#") > -1 && (c = c.substring(0, c.indexOf("#")));
872
- const d = new URLSearchParams(c);
873
- return { state: d.get("state"), code: d.get("code") || void 0, error: d.get("error") || void 0, error_description: d.get("error_description") || void 0 };
872
+ const f = new URLSearchParams(c);
873
+ return { state: f.get("state"), code: f.get("code") || void 0, error: f.get("error") || void 0, error_description: f.get("error_description") || void 0 };
874
874
  })(n.join("")), s = this.transactionManager.get();
875
875
  if (!s)
876
- throw new J("missing_transaction", "Invalid state");
876
+ throw new V("missing_transaction", "Invalid state");
877
877
  if (this.transactionManager.remove(), o)
878
- throw new sr(o, a || o, r, s.appState);
878
+ throw new vr(o, a || o, r, s.appState);
879
879
  if (!s.code_verifier || s.state && s.state !== r)
880
- throw new J("state_mismatch", "Invalid state");
881
- const f = s.organization, m = s.nonce, u = s.redirect_uri;
882
- return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: m, organization: f }), { appState: s.appState };
880
+ throw new V("state_mismatch", "Invalid state");
881
+ const p = s.organization, m = s.nonce, u = s.redirect_uri;
882
+ return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: m, organization: p }), { appState: s.appState };
883
883
  }
884
884
  async checkSession(e) {
885
885
  if (!this.cookieStorage.get(this.isAuthenticatedCookieName)) {
@@ -894,11 +894,11 @@ let xr = class {
894
894
  }
895
895
  async getTokenSilently(e = {}) {
896
896
  var n;
897
- const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
898
- let s = st[a];
897
+ const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
898
+ let s = dt[a];
899
899
  return s || (s = o().finally(() => {
900
- delete st[a], s = null;
901
- }), st[a] = s), s;
900
+ delete dt[a], s = null;
901
+ }), dt[a] = s), s;
902
902
  })(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
903
903
  return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
904
904
  }
@@ -915,25 +915,25 @@ let xr = class {
915
915
  if (await i())
916
916
  return !0;
917
917
  return !1;
918
- })(() => ct.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
919
- throw new gt();
918
+ })(() => ht.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
919
+ throw new bt();
920
920
  try {
921
921
  if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
922
922
  const m = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
923
923
  if (m)
924
924
  return m;
925
925
  }
926
- const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: f } = i;
927
- return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: f });
926
+ const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: p } = i;
927
+ return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: p });
928
928
  } finally {
929
- await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
929
+ await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
930
930
  }
931
931
  }
932
932
  }
933
933
  async getTokenWithPopup(e = {}, n = {}) {
934
934
  var r;
935
- const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
936
- return n = Object.assign(Object.assign({}, ar), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ue({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
935
+ const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
936
+ return n = Object.assign(Object.assign({}, yr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ue({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
937
937
  }
938
938
  async isAuthenticated() {
939
939
  return !!await this.getUser();
@@ -941,10 +941,10 @@ let xr = class {
941
941
  _buildLogoutUrl(e) {
942
942
  e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
943
943
  const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
944
- return this._url(`/v2/logout?${vt(Object.assign({ clientId: e.clientId }, i))}`) + o;
944
+ return this._url(`/v2/logout?${kt(Object.assign({ clientId: e.clientId }, i))}`) + o;
945
945
  }
946
946
  async logout(e = {}) {
947
- const n = Rt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
947
+ const n = Xt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
948
948
  e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
949
949
  const o = this._buildLogoutUrl(i);
950
950
  r ? await r(o) : r !== !1 && window.location.assign(o);
@@ -952,31 +952,31 @@ let xr = class {
952
952
  async _getTokenFromIFrame(e) {
953
953
  const n = Object.assign(Object.assign({}, e.authorizationParams), { prompt: "none" }), r = this.cookieStorage.get(this.orgHintCookieName);
954
954
  r && !n.organization && (n.organization = r);
955
- const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: f, scope: m, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
955
+ const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: p, scope: m, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
956
956
  try {
957
957
  if (window.crossOriginIsolated)
958
- throw new J("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
959
- const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, d = await ((v, w, y = 60) => new Promise((k, _) => {
960
- const I = window.document.createElement("iframe");
961
- I.setAttribute("width", "0"), I.setAttribute("height", "0"), I.style.display = "none";
962
- const g = () => {
963
- window.document.body.contains(I) && (window.document.body.removeChild(I), window.removeEventListener("message", b, !1));
958
+ throw new V("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
959
+ const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((v, k, w = 60) => new Promise((I, _) => {
960
+ const y = window.document.createElement("iframe");
961
+ y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
962
+ const l = () => {
963
+ window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", b, !1));
964
964
  };
965
965
  let b;
966
- const A = setTimeout(() => {
967
- _(new gt()), g();
968
- }, 1e3 * y);
969
- b = function(C) {
970
- if (C.origin != w || !C.data || C.data.type !== "authorization_response")
966
+ const T = setTimeout(() => {
967
+ _(new bt()), l();
968
+ }, 1e3 * w);
969
+ b = function(x) {
970
+ if (x.origin != k || !x.data || x.data.type !== "authorization_response")
971
971
  return;
972
- const x = C.source;
973
- x && x.close(), C.data.response.error ? _(J.fromPayload(C.data.response)) : k(C.data.response), clearTimeout(A), window.removeEventListener("message", b, !1), setTimeout(g, 2e3);
974
- }, window.addEventListener("message", b, !1), window.document.body.appendChild(I), I.setAttribute("src", v);
972
+ const j = x.source;
973
+ j && j.close(), x.data.response.error ? _(V.fromPayload(x.data.response)) : I(x.data.response), clearTimeout(T), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
974
+ }, window.addEventListener("message", b, !1), window.document.body.appendChild(y), y.setAttribute("src", v);
975
975
  }))(i, this.domainUrl, c);
976
- if (o !== d.state)
977
- throw new J("state_mismatch", "Invalid state");
978
- const h = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: d.code, grant_type: "authorization_code", redirect_uri: f, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
979
- return Object.assign(Object.assign({}, h), { scope: m, oauthTokenScope: h.scope, audience: u });
976
+ if (o !== f.state)
977
+ throw new V("state_mismatch", "Invalid state");
978
+ const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: f.code, grant_type: "authorization_code", redirect_uri: p, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
979
+ return Object.assign(Object.assign({}, d), { scope: m, oauthTokenScope: d.scope, audience: u });
980
980
  } catch (c) {
981
981
  throw c.error === "login_required" && this.logout({ openUrl: !1 }), c;
982
982
  }
@@ -986,7 +986,7 @@ let xr = class {
986
986
  if (!(n && n.refresh_token || this.worker)) {
987
987
  if (this.options.useRefreshTokensFallback)
988
988
  return await this._getTokenFromIFrame(e);
989
- throw new Sn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
989
+ throw new jn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
990
990
  }
991
991
  const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
992
992
  try {
@@ -1009,189 +1009,512 @@ let xr = class {
1009
1009
  async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
1010
1010
  const i = await this.cacheManager.get(new ue({ scope: e, audience: n, clientId: r }), 60);
1011
1011
  if (i && i.access_token) {
1012
- const { access_token: o, oauthTokenScope: a, expires_in: s } = i, f = await this._getIdTokenFromCache();
1013
- return f && Object.assign(Object.assign({ id_token: f.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
1012
+ const { access_token: o, oauthTokenScope: a, expires_in: s } = i, p = await this._getIdTokenFromCache();
1013
+ return p && Object.assign(Object.assign({ id_token: p.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
1014
1014
  }
1015
1015
  }
1016
1016
  async _requestToken(e, n) {
1017
- const { nonceIn: r, organization: i } = n || {}, o = await mr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
1017
+ const { nonceIn: r, organization: i } = n || {}, o = await Or(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
1018
1018
  return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
1019
1019
  }
1020
1020
  };
1021
- async function Tr(t) {
1022
- const e = new xr(t);
1021
+ async function Zr(t) {
1022
+ const e = new Rr(t);
1023
1023
  return await e.checkSession(), e;
1024
1024
  }
1025
- const jr = "sesamy.com", Cr = "https://logs.sesamy.com/events";
1026
- var he = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t.AUTHENTICATED = "sesamyAuthenticated", t.LOGOUT = "sesamyLogout", t))(he || {});
1027
- let B;
1028
- async function $r({ clientId: t }) {
1029
- if (B = await Tr({
1030
- domain: `token.${jr}`,
1025
+ const An = "sesamy.com", Wr = "https://logs.sesamy.com/events";
1026
+ var fe = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t.AUTHENTICATED = "sesamyAuthenticated", t.LOGOUT = "sesamyLogout", t))(fe || {});
1027
+ let X;
1028
+ async function Kr({ clientId: t }) {
1029
+ if (X = await Zr({
1030
+ domain: `token.${An}`,
1031
1031
  clientId: t,
1032
1032
  cacheLocation: "localstorage"
1033
1033
  }), window.location.search.includes("code="))
1034
1034
  try {
1035
- await B.handleRedirectCallback();
1036
- const e = await B.getUser();
1037
- It(he.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
1035
+ await X.handleRedirectCallback();
1036
+ const e = await X.getUser();
1037
+ Ot(fe.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
1038
+ const n = await X.getTokenSilently();
1039
+ localStorage.setItem("accessToken", n);
1038
1040
  } catch {
1039
1041
  }
1040
1042
  }
1041
- async function zr() {
1042
- if (!B)
1043
+ async function Mr() {
1044
+ if (!X)
1043
1045
  throw new Error("Auth0 client not initialized");
1044
- return B.isAuthenticated();
1046
+ return X.isAuthenticated();
1045
1047
  }
1046
- async function Nr() {
1047
- if (!B)
1048
+ async function Xr() {
1049
+ if (!X)
1048
1050
  throw new Error("Auth0 client not initialized");
1049
- return B.getUser();
1051
+ return X.getUser();
1050
1052
  }
1051
- function Ar() {
1052
- if (!B)
1053
+ function Fr() {
1054
+ if (!X)
1053
1055
  throw new Error("Auth0 client not initialized");
1054
- return B.loginWithRedirect({
1056
+ return X.loginWithRedirect({
1055
1057
  authorizationParams: {
1056
1058
  redirect_uri: window.location.href
1057
1059
  }
1058
1060
  });
1059
1061
  }
1060
- async function Lr() {
1061
- if (!B)
1062
+ async function Jr() {
1063
+ if (!X)
1064
+ throw new Error("Auth0 client not initialized");
1065
+ return X.getTokenSilently();
1066
+ }
1067
+ async function Hr() {
1068
+ if (!X)
1062
1069
  throw new Error("Auth0 client not initialized");
1063
- return It(he.LOGOUT, {}), B.logout({
1070
+ return Ot(fe.LOGOUT, {}), X.logout({
1064
1071
  logoutParams: {
1065
1072
  returnTo: window.location.href
1066
1073
  }
1067
1074
  });
1068
1075
  }
1069
- function Dr(t = "sesamy") {
1076
+ const Vr = (t, e) => e.skipDedupe || e.method !== "GET", Yr = (t, e) => e.method + "@" + t, Gr = (t) => t.clone(), Br = ({ skip: t = Vr, key: e = Yr, resolver: n = Gr } = {}) => {
1077
+ const r = /* @__PURE__ */ new Map();
1078
+ return (i) => (o, a) => {
1079
+ if (t(o, a))
1080
+ return i(o, a);
1081
+ const s = e(o, a);
1082
+ if (!r.has(s))
1083
+ r.set(s, []);
1084
+ else
1085
+ return new Promise((p, m) => {
1086
+ r.get(s).push([p, m]);
1087
+ });
1088
+ try {
1089
+ return i(o, a).then((p) => (r.get(s).forEach(([m]) => m(n(p))), r.delete(s), p)).catch((p) => {
1090
+ throw r.get(s).forEach(([m, u]) => u(p)), r.delete(s), p;
1091
+ });
1092
+ } catch (p) {
1093
+ return r.delete(s), Promise.reject(p);
1094
+ }
1095
+ };
1096
+ }, qr = (t, e) => t * e, Qr = (t) => t && t.ok, ei = ({ delayTimer: t = 500, delayRamp: e = qr, maxAttempts: n = 10, until: r = Qr, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (p) => (m, u) => {
1097
+ let c = 0;
1098
+ if (s && s(m, u))
1099
+ return p(m, u);
1100
+ const f = (d, v) => Promise.resolve(r(d, v)).then((k) => k ? d && a ? d : v ? Promise.reject(v) : d : (c++, !n || c <= n ? new Promise((w) => {
1101
+ const I = e(t, c);
1102
+ setTimeout(() => {
1103
+ typeof i == "function" ? Promise.resolve(i({
1104
+ response: d,
1105
+ error: v,
1106
+ url: m,
1107
+ options: u
1108
+ })).then((_ = {}) => {
1109
+ var y, l;
1110
+ w(p((y = _ && _.url) !== null && y !== void 0 ? y : m, (l = _ && _.options) !== null && l !== void 0 ? l : u));
1111
+ }) : w(p(m, u));
1112
+ }, I);
1113
+ }).then(f).catch((w) => {
1114
+ if (!o)
1115
+ throw w;
1116
+ return f(null, w);
1117
+ }) : d && a ? d : Promise.reject(v || new Error("Number of attempts exceeded."))));
1118
+ return p(m, u).then(f).catch((d) => {
1119
+ if (!o)
1120
+ throw d;
1121
+ return f(null, d);
1122
+ });
1123
+ }, ti = "application/json", Nn = "Content-Type", ve = Symbol(), Ln = Symbol();
1124
+ function Ft(t = {}) {
1125
+ var e;
1126
+ return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Nn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
1127
+ }
1128
+ function Jt(t) {
1129
+ return /^application\/.*json.*/.test(t);
1130
+ }
1131
+ const de = function(t, e, n = !1) {
1132
+ return Object.entries(e).reduce((r, [i, o]) => {
1133
+ const a = t[i];
1134
+ return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = de(a, o, n) : r[i] = o, r;
1135
+ }, { ...t });
1136
+ }, Ee = {
1137
+ // Default options
1138
+ options: {},
1139
+ // Error type
1140
+ errorType: "text",
1141
+ // Polyfills
1142
+ polyfills: {
1143
+ // fetch: null,
1144
+ // FormData: null,
1145
+ // URLSearchParams: null,
1146
+ // performance: null,
1147
+ // PerformanceObserver: null,
1148
+ // AbortController: null
1149
+ },
1150
+ polyfill(t, e = !0, n = !1, ...r) {
1151
+ const i = this.polyfills[t] || (typeof self < "u" ? self[t] : null) || (typeof global < "u" ? global[t] : null);
1152
+ if (e && !i)
1153
+ throw new Error(t + " is not defined");
1154
+ return n && i ? new i(...r) : i;
1155
+ }
1156
+ };
1157
+ function ni(t, e = !1) {
1158
+ Ee.options = e ? t : de(Ee.options, t);
1159
+ }
1160
+ function ri(t, e = !1) {
1161
+ Ee.polyfills = e ? t : de(Ee.polyfills, t);
1162
+ }
1163
+ function ii(t) {
1164
+ Ee.errorType = t;
1165
+ }
1166
+ const oi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1167
+ class Dn extends Error {
1168
+ }
1169
+ const ai = (t) => {
1170
+ const e = /* @__PURE__ */ Object.create(null);
1171
+ t = t._addons.reduce((y, l) => l.beforeRequest && l.beforeRequest(y, t._options, e) || y, t);
1172
+ const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: p } = t, m = new Map(o), u = de(i.options, r);
1173
+ let c = n;
1174
+ const f = oi(s)((y, l) => (c = y, i.polyfill("fetch")(y, l)))(n, u), d = new Error(), v = f.catch((y) => {
1175
+ throw { [ve]: y };
1176
+ }).then((y) => {
1177
+ if (!y.ok) {
1178
+ const l = new Dn();
1179
+ if (l.cause = d, l.stack = l.stack + `
1180
+ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
1181
+ throw l;
1182
+ return y.text().then((b) => {
1183
+ var T;
1184
+ if (l.message = b, i.errorType === "json" || ((T = y.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
1185
+ try {
1186
+ l.json = JSON.parse(b);
1187
+ } catch {
1188
+ }
1189
+ throw l.text = b, l.status = y.status, l;
1190
+ });
1191
+ }
1192
+ return y;
1193
+ }), k = (y) => y.catch((l) => {
1194
+ const b = l.hasOwnProperty(ve), T = b ? l[ve] : l, x = (T == null ? void 0 : T.status) && m.get(T.status) || m.get(T == null ? void 0 : T.name) || b && m.has(ve) && m.get(ve);
1195
+ if (x)
1196
+ return x(T, t);
1197
+ const j = m.get(Ln);
1198
+ if (j)
1199
+ return j(T, t);
1200
+ throw T;
1201
+ }), w = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(y ? v.then((b) => b && b[y]()).then((b) => l ? l(b) : b) : v.then((b) => l ? l(b) : b)), I = {
1202
+ _wretchReq: t,
1203
+ _fetchReq: f,
1204
+ _sharedState: e,
1205
+ res: w(null),
1206
+ json: w("json"),
1207
+ blob: w("blob"),
1208
+ formData: w("formData"),
1209
+ arrayBuffer: w("arrayBuffer"),
1210
+ text: w("text"),
1211
+ error(y, l) {
1212
+ return m.set(y, l), this;
1213
+ },
1214
+ badRequest(y) {
1215
+ return this.error(400, y);
1216
+ },
1217
+ unauthorized(y) {
1218
+ return this.error(401, y);
1219
+ },
1220
+ forbidden(y) {
1221
+ return this.error(403, y);
1222
+ },
1223
+ notFound(y) {
1224
+ return this.error(404, y);
1225
+ },
1226
+ timeout(y) {
1227
+ return this.error(408, y);
1228
+ },
1229
+ internalError(y) {
1230
+ return this.error(500, y);
1231
+ },
1232
+ fetchError(y) {
1233
+ return this.error(ve, y);
1234
+ }
1235
+ }, _ = p.reduce((y, l) => ({
1236
+ ...y,
1237
+ ...typeof l.resolver == "function" ? l.resolver(y) : l.resolver
1238
+ }), I);
1239
+ return a.reduce((y, l) => l(y, t), _);
1240
+ }, si = {
1241
+ _url: "",
1242
+ _options: {},
1243
+ _config: Ee,
1244
+ _catchers: /* @__PURE__ */ new Map(),
1245
+ _resolvers: [],
1246
+ _deferred: [],
1247
+ _middlewares: [],
1248
+ _addons: [],
1249
+ addon(t) {
1250
+ return { ...this, _addons: [...this._addons, t], ...t.wretch };
1251
+ },
1252
+ errorType(t) {
1253
+ return {
1254
+ ...this,
1255
+ _config: {
1256
+ ...this._config,
1257
+ errorType: t
1258
+ }
1259
+ };
1260
+ },
1261
+ polyfills(t, e = !1) {
1262
+ return {
1263
+ ...this,
1264
+ _config: {
1265
+ ...this._config,
1266
+ polyfills: e ? t : de(this._config.polyfills, t)
1267
+ }
1268
+ };
1269
+ },
1270
+ url(t, e = !1) {
1271
+ if (e)
1272
+ return { ...this, _url: t };
1273
+ const n = this._url.split("?");
1274
+ return {
1275
+ ...this,
1276
+ _url: n.length > 1 ? n[0] + t + "?" + n[1] : this._url + t
1277
+ };
1278
+ },
1279
+ options(t, e = !1) {
1280
+ return { ...this, _options: e ? t : de(this._options, t) };
1281
+ },
1282
+ headers(t) {
1283
+ const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
1284
+ return { ...this, _options: de(this._options, { headers: e }) };
1285
+ },
1286
+ accept(t) {
1287
+ return this.headers({ Accept: t });
1288
+ },
1289
+ content(t) {
1290
+ return this.headers({ [Nn]: t });
1291
+ },
1292
+ auth(t) {
1293
+ return this.headers({ Authorization: t });
1294
+ },
1295
+ catcher(t, e) {
1296
+ const n = new Map(this._catchers);
1297
+ return n.set(t, e), { ...this, _catchers: n };
1298
+ },
1299
+ catcherFallback(t) {
1300
+ return this.catcher(Ln, t);
1301
+ },
1302
+ resolve(t, e = !1) {
1303
+ return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
1304
+ },
1305
+ defer(t, e = !1) {
1306
+ return {
1307
+ ...this,
1308
+ _deferred: e ? [t] : [...this._deferred, t]
1309
+ };
1310
+ },
1311
+ middlewares(t, e = !1) {
1312
+ return {
1313
+ ...this,
1314
+ _middlewares: e ? t : [...this._middlewares, ...t]
1315
+ };
1316
+ },
1317
+ fetch(t = this._options.method, e = "", n = null) {
1318
+ let r = this.url(e).options({ method: t });
1319
+ const i = Ft(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Jt(i));
1320
+ return r = n ? o ? r.json(n, i) : r.body(n) : r, ai(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
1321
+ },
1322
+ get(t = "") {
1323
+ return this.fetch("GET", t);
1324
+ },
1325
+ delete(t = "") {
1326
+ return this.fetch("DELETE", t);
1327
+ },
1328
+ put(t, e = "") {
1329
+ return this.fetch("PUT", e, t);
1330
+ },
1331
+ post(t, e = "") {
1332
+ return this.fetch("POST", e, t);
1333
+ },
1334
+ patch(t, e = "") {
1335
+ return this.fetch("PATCH", e, t);
1336
+ },
1337
+ head(t = "") {
1338
+ return this.fetch("HEAD", t);
1339
+ },
1340
+ opts(t = "") {
1341
+ return this.fetch("OPTIONS", t);
1342
+ },
1343
+ body(t) {
1344
+ return { ...this, _options: { ...this._options, body: t } };
1345
+ },
1346
+ json(t, e) {
1347
+ const n = Ft(this._options.headers);
1348
+ return this.content(e || Jt(n) && n || ti).body(JSON.stringify(t));
1349
+ }
1350
+ };
1351
+ function pe(t = "", e = {}) {
1352
+ return { ...si, _url: t, _options: e };
1353
+ }
1354
+ pe.default = pe;
1355
+ pe.options = ni;
1356
+ pe.errorType = ii;
1357
+ pe.polyfills = ri;
1358
+ pe.WretchError = Dn;
1359
+ const ci = (t) => (e, n) => new Promise(async (r, i) => {
1360
+ try {
1361
+ const o = await Jr(), a = {
1362
+ ...n,
1363
+ headers: {
1364
+ ...n.headers,
1365
+ Authorization: `Bearer ${o}`
1366
+ }
1367
+ };
1368
+ r(t(e, a));
1369
+ } catch (o) {
1370
+ console.error("Error fetching access token:", o), i(o);
1371
+ }
1372
+ }), Un = pe(`https://api2.${An}`).headers({ "Content-Type": "application/json" }).middlewares([
1373
+ ci,
1374
+ Br(),
1375
+ ei({
1376
+ delayTimer: 1e3,
1377
+ delayRamp: (t, e) => t * e,
1378
+ maxAttempts: 3,
1379
+ until: (t) => (t == null ? void 0 : t.ok) || !1,
1380
+ retryOnNetworkError: !1
1381
+ })
1382
+ ]);
1383
+ async function ui() {
1384
+ return Un.get("/entitlements").json();
1385
+ }
1386
+ async function li(t) {
1387
+ const e = await Un.get("/entitlements").json();
1388
+ return e == null ? void 0 : e.find((n) => n.id === t);
1389
+ }
1390
+ function di(t = "sesamy") {
1070
1391
  window[t] = {
1071
- getUser: Nr,
1072
- isAuthenticated: zr,
1073
- loginWithRedirect: Ar,
1074
- logout: Lr
1392
+ getUser: Xr,
1393
+ getEntitlement: li,
1394
+ getEntitlements: ui,
1395
+ isAuthenticated: Mr,
1396
+ loginWithRedirect: Fr,
1397
+ logout: Hr
1075
1398
  };
1076
1399
  }
1077
- function Wt(t, e, n, r, i) {
1400
+ function Ht(t, e, n, r, i) {
1078
1401
  for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
1079
1402
  t = t ? t[e[r]] : i;
1080
1403
  return t === i ? n : t;
1081
1404
  }
1082
- var Re = "undefined", Kt = "object", Ur = function() {
1083
- }, xn = "any", Tn = "*", fe = "__", Ye = typeof process < "u" ? process : {};
1084
- Ye.env && Ye.env.NODE_ENV;
1085
- var H = typeof document < "u";
1086
- Ye.versions != null && Ye.versions.node != null;
1405
+ var Xe = "undefined", Vt = "object", hi = function() {
1406
+ }, Rn = "any", Zn = "*", me = "__", Qe = typeof process < "u" ? process : {};
1407
+ Qe.env && Qe.env.NODE_ENV;
1408
+ var Y = typeof document < "u";
1409
+ Qe.versions != null && Qe.versions.node != null;
1087
1410
  typeof Deno < "u" && Deno.core;
1088
- H && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
1089
- function jn(t, e) {
1411
+ Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
1412
+ function Wn(t, e) {
1090
1413
  return e.charAt(0)[t]() + e.slice(1);
1091
1414
  }
1092
- var Zr = jn.bind(null, "toUpperCase"), Rr = jn.bind(null, "toLowerCase");
1093
- function Wr(t) {
1094
- return Cn(t) ? Zr("null") : typeof t == "object" ? Vr(t) : Object.prototype.toString.call(t).slice(8, -1);
1415
+ var fi = Wn.bind(null, "toUpperCase"), pi = Wn.bind(null, "toLowerCase");
1416
+ function mi(t) {
1417
+ return Kn(t) ? fi("null") : typeof t == "object" ? wi(t) : Object.prototype.toString.call(t).slice(8, -1);
1095
1418
  }
1096
- function Ge(t, e) {
1419
+ function et(t, e) {
1097
1420
  e === void 0 && (e = !0);
1098
- var n = Wr(t);
1099
- return e ? Rr(n) : n;
1421
+ var n = mi(t);
1422
+ return e ? pi(n) : n;
1100
1423
  }
1101
- function De(t, e) {
1424
+ function We(t, e) {
1102
1425
  return typeof e === t;
1103
1426
  }
1104
- var G = De.bind(null, "function"), re = De.bind(null, "string"), ve = De.bind(null, "undefined"), Kr = De.bind(null, "boolean");
1105
- De.bind(null, "symbol");
1106
- function Cn(t) {
1427
+ var B = We.bind(null, "function"), re = We.bind(null, "string"), be = We.bind(null, "undefined"), gi = We.bind(null, "boolean");
1428
+ We.bind(null, "symbol");
1429
+ function Kn(t) {
1107
1430
  return t === null;
1108
1431
  }
1109
- function Mr(t) {
1110
- return Ge(t) === "number" && !isNaN(t);
1432
+ function yi(t) {
1433
+ return et(t) === "number" && !isNaN(t);
1111
1434
  }
1112
- function $n(t) {
1113
- return Ge(t) === "array";
1435
+ function Mn(t) {
1436
+ return et(t) === "array";
1114
1437
  }
1115
- function F(t) {
1116
- if (!Xr(t))
1438
+ function H(t) {
1439
+ if (!vi(t))
1117
1440
  return !1;
1118
1441
  for (var e = t; Object.getPrototypeOf(e) !== null; )
1119
1442
  e = Object.getPrototypeOf(e);
1120
1443
  return Object.getPrototypeOf(t) === e;
1121
1444
  }
1122
- function Xr(t) {
1445
+ function vi(t) {
1123
1446
  return t && (typeof t == "object" || t !== null);
1124
1447
  }
1125
- function Vr(t) {
1126
- return G(t.constructor) ? t.constructor.name : null;
1448
+ function wi(t) {
1449
+ return B(t.constructor) ? t.constructor.name : null;
1127
1450
  }
1128
- function Fr(t) {
1129
- return t instanceof Error || re(t.message) && t.constructor && Mr(t.constructor.stackTraceLimit);
1451
+ function bi(t) {
1452
+ return t instanceof Error || re(t.message) && t.constructor && yi(t.constructor.stackTraceLimit);
1130
1453
  }
1131
- function zn(t, e) {
1132
- if (typeof e != "object" || Cn(e))
1454
+ function Xn(t, e) {
1455
+ if (typeof e != "object" || Kn(e))
1133
1456
  return !1;
1134
1457
  if (e instanceof t)
1135
1458
  return !0;
1136
- var n = Ge(new t(""));
1137
- if (Fr(e))
1459
+ var n = et(new t(""));
1460
+ if (bi(e))
1138
1461
  for (; e; ) {
1139
- if (Ge(e) === n)
1462
+ if (et(e) === n)
1140
1463
  return !0;
1141
1464
  e = Object.getPrototypeOf(e);
1142
1465
  }
1143
1466
  return !1;
1144
1467
  }
1145
- zn.bind(null, TypeError);
1146
- zn.bind(null, SyntaxError);
1147
- function Qe(t, e) {
1468
+ Xn.bind(null, TypeError);
1469
+ Xn.bind(null, SyntaxError);
1470
+ function rt(t, e) {
1148
1471
  var n = t instanceof Element || t instanceof HTMLDocument;
1149
- return n && e ? Jr(t, e) : n;
1472
+ return n && e ? ki(t, e) : n;
1150
1473
  }
1151
- function Jr(t, e) {
1474
+ function ki(t, e) {
1152
1475
  return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
1153
1476
  }
1154
- function et(t) {
1477
+ function it(t) {
1155
1478
  var e = [].slice.call(arguments, 1);
1156
1479
  return function() {
1157
1480
  return t.apply(void 0, [].slice.call(arguments).concat(e));
1158
1481
  };
1159
1482
  }
1160
- et(Qe, "form");
1161
- et(Qe, "button");
1162
- et(Qe, "input");
1163
- et(Qe, "select");
1164
- function Hr(t) {
1165
- return t ? $n(t) ? t : [t] : [];
1483
+ it(rt, "form");
1484
+ it(rt, "button");
1485
+ it(rt, "input");
1486
+ it(rt, "select");
1487
+ function Ii(t) {
1488
+ return t ? Mn(t) ? t : [t] : [];
1166
1489
  }
1167
- function Mt(t) {
1490
+ function Yt(t) {
1168
1491
  try {
1169
1492
  return decodeURIComponent(t.replace(/\+/g, " "));
1170
1493
  } catch {
1171
1494
  return null;
1172
1495
  }
1173
1496
  }
1174
- function Yr() {
1175
- if (H) {
1497
+ function _i() {
1498
+ if (Y) {
1176
1499
  var t = navigator, e = t.languages;
1177
1500
  return t.userLanguage || (e && e.length ? e[0] : t.language);
1178
1501
  }
1179
1502
  }
1180
- function Gr() {
1503
+ function Si() {
1181
1504
  try {
1182
1505
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
1183
1506
  } catch {
1184
1507
  }
1185
1508
  }
1186
- function Br(t) {
1509
+ function Ei(t) {
1187
1510
  return function(e) {
1188
1511
  for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
1189
- var o = Mt(n[1]), a = Mt(n[2]);
1512
+ var o = Yt(n[1]), a = Yt(n[2]);
1190
1513
  o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
1191
1514
  }
1192
1515
  for (var s in r) {
1193
- var f = s.split("[");
1194
- f.length > 1 && (qr(r, f.map(function(m) {
1516
+ var p = s.split("[");
1517
+ p.length > 1 && (Oi(r, p.map(function(m) {
1195
1518
  return m.replace(/[?[\]\\ ]/g, "");
1196
1519
  }), r[s]), delete r[s]);
1197
1520
  }
@@ -1201,10 +1524,10 @@ function Br(t) {
1201
1524
  var n = e.match(/\?(.*)/);
1202
1525
  return n && n[1] ? n[1].split("#")[0] : "";
1203
1526
  }
1204
- return H && window.location.search.substring(1);
1527
+ return Y && window.location.search.substring(1);
1205
1528
  }(t));
1206
1529
  }
1207
- function qr(t, e, n) {
1530
+ function Oi(t, e, n) {
1208
1531
  for (var r = e.length - 1, i = 0; i < r; ++i) {
1209
1532
  var o = e[i];
1210
1533
  if (o === "__proto__" || o === "constructor")
@@ -1213,27 +1536,27 @@ function qr(t, e, n) {
1213
1536
  }
1214
1537
  t[e[r]] = n;
1215
1538
  }
1216
- function tt() {
1539
+ function ot() {
1217
1540
  for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
1218
1541
  var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
1219
1542
  t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
1220
1543
  }
1221
1544
  return t;
1222
1545
  }
1223
- var $e = "global", Ie = fe + "global" + fe, Se = typeof self === Kt && self.self === self && self || typeof global === Kt && global.global === global && global || void 0;
1224
- function pe(t) {
1225
- return Se[Ie][t];
1546
+ var Le = "global", Oe = me + "global" + me, Pe = typeof self === Vt && self.self === self && self || typeof global === Vt && global.global === global && global || void 0;
1547
+ function ge(t) {
1548
+ return Pe[Oe][t];
1226
1549
  }
1227
- function me(t, e) {
1228
- return Se[Ie][t] = e;
1550
+ function ye(t, e) {
1551
+ return Pe[Oe][t] = e;
1229
1552
  }
1230
- function Oe(t) {
1231
- delete Se[Ie][t];
1553
+ function je(t) {
1554
+ delete Pe[Oe][t];
1232
1555
  }
1233
- function Ee(t, e, n) {
1556
+ function xe(t, e, n) {
1234
1557
  var r;
1235
1558
  try {
1236
- if (Ot(t)) {
1559
+ if (jt(t)) {
1237
1560
  var i = window[t];
1238
1561
  r = i[e].bind(i);
1239
1562
  }
@@ -1241,99 +1564,99 @@ function Ee(t, e, n) {
1241
1564
  }
1242
1565
  return r || n;
1243
1566
  }
1244
- Se[Ie] || (Se[Ie] = {});
1245
- var We = {};
1246
- function Ot(t) {
1247
- if (typeof We[t] !== Re)
1248
- return We[t];
1567
+ Pe[Oe] || (Pe[Oe] = {});
1568
+ var Fe = {};
1569
+ function jt(t) {
1570
+ if (typeof Fe[t] !== Xe)
1571
+ return Fe[t];
1249
1572
  try {
1250
1573
  var e = window[t];
1251
- e.setItem(Re, Re), e.removeItem(Re);
1574
+ e.setItem(Xe, Xe), e.removeItem(Xe);
1252
1575
  } catch {
1253
- return We[t] = !1;
1576
+ return Fe[t] = !1;
1254
1577
  }
1255
- return We[t] = !0;
1578
+ return Fe[t] = !0;
1256
1579
  }
1257
- function E() {
1258
- return E = Object.assign || function(t) {
1580
+ function O() {
1581
+ return O = Object.assign || function(t) {
1259
1582
  for (var e = 1; e < arguments.length; e++) {
1260
1583
  var n = arguments[e];
1261
1584
  for (var r in n)
1262
1585
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
1263
1586
  }
1264
1587
  return t;
1265
- }, E.apply(this, arguments);
1588
+ }, O.apply(this, arguments);
1266
1589
  }
1267
- var ne = "function", ee = "undefined", Qr = "@@redux/" + Math.random().toString(36), Xt = /* @__PURE__ */ function() {
1590
+ var ne = "function", ee = "undefined", Pi = "@@redux/" + Math.random().toString(36), Gt = /* @__PURE__ */ function() {
1268
1591
  return typeof Symbol === ne && Symbol.observable || "@@observable";
1269
- }(), Ke = " != " + ne;
1270
- function Nn(t, e, n) {
1592
+ }(), Je = " != " + ne;
1593
+ function Fn(t, e, n) {
1271
1594
  var r;
1272
1595
  if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
1273
1596
  if (typeof n !== ne)
1274
- throw new Error("enhancer" + Ke);
1275
- return n(Nn)(t, e);
1597
+ throw new Error("enhancer" + Je);
1598
+ return n(Fn)(t, e);
1276
1599
  }
1277
1600
  if (typeof t !== ne)
1278
- throw new Error("reducer" + Ke);
1279
- var i = t, o = e, a = [], s = a, f = !1;
1601
+ throw new Error("reducer" + Je);
1602
+ var i = t, o = e, a = [], s = a, p = !1;
1280
1603
  function m() {
1281
1604
  s === a && (s = a.slice());
1282
1605
  }
1283
1606
  function u() {
1284
1607
  return o;
1285
1608
  }
1286
- function c(h) {
1287
- if (typeof h !== ne)
1288
- throw new Error("Listener" + Ke);
1609
+ function c(d) {
1610
+ if (typeof d !== ne)
1611
+ throw new Error("Listener" + Je);
1289
1612
  var v = !0;
1290
- return m(), s.push(h), function() {
1613
+ return m(), s.push(d), function() {
1291
1614
  if (v) {
1292
1615
  v = !1, m();
1293
- var w = s.indexOf(h);
1294
- s.splice(w, 1);
1616
+ var k = s.indexOf(d);
1617
+ s.splice(k, 1);
1295
1618
  }
1296
1619
  };
1297
1620
  }
1298
- function d(h) {
1299
- if (!F(h))
1621
+ function f(d) {
1622
+ if (!H(d))
1300
1623
  throw new Error("Act != obj");
1301
- if (typeof h.type === ee)
1624
+ if (typeof d.type === ee)
1302
1625
  throw new Error("ActType " + ee);
1303
- if (f)
1626
+ if (p)
1304
1627
  throw new Error("Dispatch in reducer");
1305
1628
  try {
1306
- f = !0, o = i(o, h);
1629
+ p = !0, o = i(o, d);
1307
1630
  } finally {
1308
- f = !1;
1631
+ p = !1;
1309
1632
  }
1310
- for (var v = a = s, w = 0; w < v.length; w++)
1311
- (0, v[w])();
1312
- return h;
1313
- }
1314
- return d({ type: "@@redux/INIT" }), (r = { dispatch: d, subscribe: c, getState: u, replaceReducer: function(h) {
1315
- if (typeof h !== ne)
1316
- throw new Error("next reducer" + Ke);
1317
- i = h, d({ type: "@@redux/INIT" });
1318
- } })[Xt] = function() {
1319
- var h, v = c;
1320
- return (h = { subscribe: function(w) {
1321
- if (typeof w != "object")
1633
+ for (var v = a = s, k = 0; k < v.length; k++)
1634
+ (0, v[k])();
1635
+ return d;
1636
+ }
1637
+ return f({ type: "@@redux/INIT" }), (r = { dispatch: f, subscribe: c, getState: u, replaceReducer: function(d) {
1638
+ if (typeof d !== ne)
1639
+ throw new Error("next reducer" + Je);
1640
+ i = d, f({ type: "@@redux/INIT" });
1641
+ } })[Gt] = function() {
1642
+ var d, v = c;
1643
+ return (d = { subscribe: function(k) {
1644
+ if (typeof k != "object")
1322
1645
  throw new TypeError("Observer != obj");
1323
- function y() {
1324
- w.next && w.next(u());
1646
+ function w() {
1647
+ k.next && k.next(u());
1325
1648
  }
1326
- return y(), { unsubscribe: v(y) };
1327
- } })[Xt] = function() {
1649
+ return w(), { unsubscribe: v(w) };
1650
+ } })[Gt] = function() {
1328
1651
  return this;
1329
- }, h;
1652
+ }, d;
1330
1653
  }, r;
1331
1654
  }
1332
- function ei(t, e) {
1655
+ function Ti(t, e) {
1333
1656
  var n = e && e.type;
1334
1657
  return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
1335
1658
  }
1336
- function _e() {
1659
+ function Te() {
1337
1660
  var t = [].slice.call(arguments);
1338
1661
  return t.length === 0 ? function(e) {
1339
1662
  return e;
@@ -1343,48 +1666,48 @@ function _e() {
1343
1666
  };
1344
1667
  });
1345
1668
  }
1346
- function ti() {
1669
+ function ji() {
1347
1670
  var t = arguments;
1348
1671
  return function(e) {
1349
1672
  return function(n, r, i) {
1350
- var o, a = e(n, r, i), s = a.dispatch, f = { getState: a.getState, dispatch: function(m) {
1673
+ var o, a = e(n, r, i), s = a.dispatch, p = { getState: a.getState, dispatch: function(m) {
1351
1674
  return s(m);
1352
1675
  } };
1353
1676
  return o = [].slice.call(t).map(function(m) {
1354
- return m(f);
1355
- }), E({}, a, { dispatch: s = _e.apply(void 0, o)(a.dispatch) });
1677
+ return m(p);
1678
+ }), O({}, a, { dispatch: s = Te.apply(void 0, o)(a.dispatch) });
1356
1679
  };
1357
1680
  };
1358
1681
  }
1359
- var ie = fe + "anon_id", de = fe + "user_id", we = fe + "user_traits", te = "userId", ye = "anonymousId", He = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], wt = ["name", "EVENTS", "config", "loaded"], O = He.reduce(function(t, e) {
1682
+ var ie = me + "anon_id", he = me + "user_id", Ie = me + "user_traits", te = "userId", ke = "anonymousId", qe = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], _t = ["name", "EVENTS", "config", "loaded"], E = qe.reduce(function(t, e) {
1360
1683
  return t[e] = e, t;
1361
1684
  }, { registerPluginType: function(t) {
1362
1685
  return "registerPlugin:" + t;
1363
1686
  }, pluginReadyType: function(t) {
1364
1687
  return "ready:" + t;
1365
- } }), Vt = /^utm_/, Ft = /^an_prop_/, Jt = /^an_trait_/;
1366
- function ni(t) {
1688
+ } }), Bt = /^utm_/, qt = /^an_prop_/, Qt = /^an_trait_/;
1689
+ function xi(t) {
1367
1690
  var e = t.storage.setItem;
1368
1691
  return function(n) {
1369
1692
  return function(r) {
1370
1693
  return function(i) {
1371
- if (i.type === O.bootstrap) {
1372
- var o = i.params, a = i.user, s = i.persistedUser, f = i.initialUser, m = s.userId === a.userId;
1373
- s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(de, a.userId), f.traits && e(we, E({}, m && s.traits ? s.traits : {}, f.traits));
1694
+ if (i.type === E.bootstrap) {
1695
+ var o = i.params, a = i.user, s = i.persistedUser, p = i.initialUser, m = s.userId === a.userId;
1696
+ s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(he, a.userId), p.traits && e(Ie, O({}, m && s.traits ? s.traits : {}, p.traits));
1374
1697
  var u = Object.keys(i.params);
1375
1698
  if (u.length) {
1376
- var c = o.an_uid, d = o.an_event, h = u.reduce(function(v, w) {
1377
- if (w.match(Vt) || w.match(/^(d|g)clid/)) {
1378
- var y = w.replace(Vt, "");
1379
- v.campaign[y === "campaign" ? "name" : y] = o[w];
1699
+ var c = o.an_uid, f = o.an_event, d = u.reduce(function(v, k) {
1700
+ if (k.match(Bt) || k.match(/^(d|g)clid/)) {
1701
+ var w = k.replace(Bt, "");
1702
+ v.campaign[w === "campaign" ? "name" : w] = o[k];
1380
1703
  }
1381
- return w.match(Ft) && (v.props[w.replace(Ft, "")] = o[w]), w.match(Jt) && (v.traits[w.replace(Jt, "")] = o[w]), v;
1704
+ return k.match(qt) && (v.props[k.replace(qt, "")] = o[k]), k.match(Qt) && (v.traits[k.replace(Qt, "")] = o[k]), v;
1382
1705
  }, { campaign: {}, props: {}, traits: {} });
1383
- n.dispatch(E({ type: O.params, raw: o }, h, c ? { userId: c } : {})), c && setTimeout(function() {
1384
- return t.identify(c, h.traits);
1385
- }, 0), d && setTimeout(function() {
1386
- return t.track(d, h.props);
1387
- }, 0), Object.keys(h.campaign).length && n.dispatch({ type: O.campaign, campaign: h.campaign });
1706
+ n.dispatch(O({ type: E.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1707
+ return t.identify(c, d.traits);
1708
+ }, 0), f && setTimeout(function() {
1709
+ return t.track(f, d.props);
1710
+ }, 0), Object.keys(d.campaign).length && n.dispatch({ type: E.campaign, campaign: d.campaign });
1388
1711
  }
1389
1712
  }
1390
1713
  return r(i);
@@ -1392,19 +1715,19 @@ function ni(t) {
1392
1715
  };
1393
1716
  };
1394
1717
  }
1395
- function ri(t) {
1718
+ function Ci(t) {
1396
1719
  return function(e, n) {
1397
- if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === O.setItemEnd) {
1720
+ if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === E.setItemEnd) {
1398
1721
  if (n.key === ie)
1399
- return E({}, e, { anonymousId: n.value });
1400
- if (n.key === de)
1401
- return E({}, e, { userId: n.value });
1722
+ return O({}, e, { anonymousId: n.value });
1723
+ if (n.key === he)
1724
+ return O({}, e, { userId: n.value });
1402
1725
  }
1403
1726
  switch (n.type) {
1404
- case O.identify:
1405
- return Object.assign({}, e, { userId: n.userId, traits: E({}, e.traits, n.traits) });
1406
- case O.reset:
1407
- return [de, ie, we].forEach(function(r) {
1727
+ case E.identify:
1728
+ return Object.assign({}, e, { userId: n.userId, traits: O({}, e.traits, n.traits) });
1729
+ case E.reset:
1730
+ return [he, ie, Ie].forEach(function(r) {
1408
1731
  t.removeItem(r);
1409
1732
  }), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
1410
1733
  default:
@@ -1412,357 +1735,357 @@ function ri(t) {
1412
1735
  }
1413
1736
  };
1414
1737
  }
1415
- function Ht(t) {
1416
- return { userId: t.getItem(de), anonymousId: t.getItem(ie), traits: t.getItem(we) };
1738
+ function en(t) {
1739
+ return { userId: t.getItem(he), anonymousId: t.getItem(ie), traits: t.getItem(Ie) };
1417
1740
  }
1418
- var bt = function(t) {
1419
- return fe + "TEMP" + fe + t;
1741
+ var St = function(t) {
1742
+ return me + "TEMP" + me + t;
1420
1743
  };
1421
- function ii(t) {
1744
+ function $i(t) {
1422
1745
  var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
1423
1746
  return function(o) {
1424
1747
  return function(a) {
1425
1748
  return function(s) {
1426
- var f = s.userId, m = s.traits, u = s.options;
1427
- if (s.type === O.reset && ([de, we, ie].forEach(function(h) {
1428
- r(h);
1429
- }), [te, ye, "traits"].forEach(function(h) {
1430
- Oe(bt(h));
1431
- })), s.type === O.identify) {
1432
- i(ie) || n(ie, tt());
1433
- var c = i(de), d = i(we) || {};
1434
- c && c !== f && o.dispatch({ type: O.userIdChanged, old: { userId: c, traits: d }, new: { userId: f, traits: m }, options: u }), f && n(de, f), m && n(we, E({}, d, m));
1749
+ var p = s.userId, m = s.traits, u = s.options;
1750
+ if (s.type === E.reset && ([he, Ie, ie].forEach(function(d) {
1751
+ r(d);
1752
+ }), [te, ke, "traits"].forEach(function(d) {
1753
+ je(St(d));
1754
+ })), s.type === E.identify) {
1755
+ i(ie) || n(ie, ot());
1756
+ var c = i(he), f = i(Ie) || {};
1757
+ c && c !== p && o.dispatch({ type: E.userIdChanged, old: { userId: c, traits: f }, new: { userId: p, traits: m }, options: u }), p && n(he, p), m && n(Ie, O({}, f, m));
1435
1758
  }
1436
1759
  return a(s);
1437
1760
  };
1438
1761
  };
1439
1762
  };
1440
1763
  }
1441
- var Ce = {};
1442
- function Yt(t, e) {
1443
- Ce[t] && G(Ce[t]) && (Ce[t](e), delete Ce[t]);
1764
+ var Ne = {};
1765
+ function tn(t, e) {
1766
+ Ne[t] && B(Ne[t]) && (Ne[t](e), delete Ne[t]);
1444
1767
  }
1445
- function An(t, e, n) {
1768
+ function Jn(t, e, n) {
1446
1769
  return new Promise(function(r, i) {
1447
- return e() ? r(t) : n < 1 ? i(E({}, t, { queue: !0 })) : new Promise(function(o) {
1770
+ return e() ? r(t) : n < 1 ? i(O({}, t, { queue: !0 })) : new Promise(function(o) {
1448
1771
  return setTimeout(o, 10);
1449
1772
  }).then(function(o) {
1450
- return An(t, e, n - 10).then(r, i);
1773
+ return Jn(t, e, n - 10).then(r, i);
1451
1774
  });
1452
1775
  });
1453
1776
  }
1454
- function Ln(t, e, n) {
1777
+ function Hn(t, e, n) {
1455
1778
  var r = e(), i = t.getState(), o = i.plugins, a = i.queue, s = i.user;
1456
1779
  if (!i.context.offline && a && a.actions && a.actions.length) {
1457
- var f = a.actions.reduce(function(u, c, d) {
1458
- return o[c.plugin].loaded ? (u.process.push(c), u.processIndex.push(d)) : (u.requeue.push(c), u.requeueIndex.push(d)), u;
1780
+ var p = a.actions.reduce(function(u, c, f) {
1781
+ return o[c.plugin].loaded ? (u.process.push(c), u.processIndex.push(f)) : (u.requeue.push(c), u.requeueIndex.push(f)), u;
1459
1782
  }, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
1460
- if (f.processIndex && f.processIndex.length) {
1461
- f.processIndex.forEach(function(u) {
1462
- var c = a.actions[u], d = c.plugin, h = c.payload.type, v = r[d][h];
1463
- if (v && G(v)) {
1464
- var w = function(k, _) {
1465
- return k === void 0 && (k = {}), _ === void 0 && (_ = {}), [te, ye].reduce(function(I, g) {
1466
- return k.hasOwnProperty(g) && _[g] && _[g] !== k[g] && (I[g] = _[g]), I;
1467
- }, k);
1783
+ if (p.processIndex && p.processIndex.length) {
1784
+ p.processIndex.forEach(function(u) {
1785
+ var c = a.actions[u], f = c.plugin, d = c.payload.type, v = r[f][d];
1786
+ if (v && B(v)) {
1787
+ var k = function(I, _) {
1788
+ return I === void 0 && (I = {}), _ === void 0 && (_ = {}), [te, ke].reduce(function(y, l) {
1789
+ return I.hasOwnProperty(l) && _[l] && _[l] !== I[l] && (y[l] = _[l]), y;
1790
+ }, I);
1468
1791
  }(c.payload, s);
1469
- v({ payload: w, config: o[d].config, instance: n });
1470
- var y = h + ":" + d;
1471
- t.dispatch(E({}, w, { type: y, _: { called: y, from: "queueDrain" } }));
1792
+ v({ payload: k, config: o[f].config, instance: n });
1793
+ var w = d + ":" + f;
1794
+ t.dispatch(O({}, k, { type: w, _: { called: w, from: "queueDrain" } }));
1472
1795
  }
1473
1796
  });
1474
1797
  var m = a.actions.filter(function(u, c) {
1475
- return !~f.processIndex.indexOf(c);
1798
+ return !~p.processIndex.indexOf(c);
1476
1799
  });
1477
1800
  a.actions = m;
1478
1801
  }
1479
1802
  }
1480
1803
  }
1481
- var ut = function(t) {
1482
- var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, f = t.EVENTS;
1804
+ var ft = function(t) {
1805
+ 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;
1483
1806
  try {
1484
- var m = i.plugins, u = i.context, c = n.type, d = c.match(be), h = e.exact.map(function(y) {
1485
- return y.pluginName;
1807
+ var m = i.plugins, u = i.context, c = n.type, f = c.match(_e), d = e.exact.map(function(w) {
1808
+ return w.pluginName;
1486
1809
  });
1487
- d && (h = a.during.map(function(y) {
1488
- return y.pluginName;
1810
+ f && (d = a.during.map(function(w) {
1811
+ return w.pluginName;
1489
1812
  }));
1490
- var v = /* @__PURE__ */ function(y, k) {
1491
- return function(_, I, g) {
1492
- var b = I.config, A = I.name, C = A + "." + _.type;
1493
- g && (C = g.event);
1494
- var x = _.type.match(be) ? /* @__PURE__ */ function(D, L, X, U, V) {
1495
- return function(R, P) {
1496
- var K = U ? U.name : D, M = P && Le(P) ? P : X;
1497
- if (U && (!(M = P && Le(P) ? P : [D]).includes(D) || M.length !== 1))
1813
+ var v = /* @__PURE__ */ function(w, I) {
1814
+ return function(_, y, l) {
1815
+ var b = y.config, T = y.name, x = T + "." + _.type;
1816
+ l && (x = l.event);
1817
+ var j = _.type.match(_e) ? /* @__PURE__ */ function(D, L, F, U, J) {
1818
+ return function(Z, P) {
1819
+ var K = U ? U.name : D, M = P && Ze(P) ? P : F;
1820
+ if (U && (!(M = P && Ze(P) ? P : [D]).includes(D) || M.length !== 1))
1498
1821
  throw new Error("Method " + L + " can only abort " + D + " plugin. " + JSON.stringify(M) + " input valid");
1499
- return E({}, V, { abort: { reason: R, plugins: M, caller: L, _: K } });
1822
+ return O({}, J, { abort: { reason: Z, plugins: M, caller: L, _: K } });
1500
1823
  };
1501
- }(A, C, k, g, _) : /* @__PURE__ */ function(D, L) {
1824
+ }(T, x, I, l, _) : /* @__PURE__ */ function(D, L) {
1502
1825
  return function() {
1503
1826
  throw new Error(D.type + " action not cancellable. Remove abort in " + L);
1504
1827
  };
1505
- }(_, C);
1506
- return { payload: oi(_), instance: y, config: b || {}, abort: x };
1828
+ }(_, x);
1829
+ return { payload: zi(_), instance: w, config: b || {}, abort: j };
1507
1830
  };
1508
- }(r, h), w = e.exact.reduce(function(y, k) {
1509
- var _ = k.pluginName, I = k.methodName, g = !1;
1510
- return I.match(/^initialize/) || I.match(/^reset/) || (g = !m[_].loaded), u.offline && I.match(/^(page|track|identify)/) && (g = !0), y["" + _] = g, y;
1831
+ }(r, d), k = e.exact.reduce(function(w, I) {
1832
+ var _ = I.pluginName, y = I.methodName, l = !1;
1833
+ return y.match(/^initialize/) || y.match(/^reset/) || (l = !m[_].loaded), u.offline && y.match(/^(page|track|identify)/) && (l = !0), w["" + _] = l, w;
1511
1834
  }, {});
1512
- return Promise.resolve(e.exact.reduce(function(y, k, _) {
1835
+ return Promise.resolve(e.exact.reduce(function(w, I, _) {
1513
1836
  try {
1514
- var I = k.pluginName;
1515
- return Promise.resolve(y).then(function(g) {
1837
+ var y = I.pluginName;
1838
+ return Promise.resolve(w).then(function(l) {
1516
1839
  function b() {
1517
- return Promise.resolve(g);
1840
+ return Promise.resolve(l);
1518
1841
  }
1519
- var A = function() {
1520
- if (e.namespaced && e.namespaced[I])
1521
- return Promise.resolve(e.namespaced[I].reduce(function(C, x, D) {
1842
+ var T = function() {
1843
+ if (e.namespaced && e.namespaced[y])
1844
+ return Promise.resolve(e.namespaced[y].reduce(function(x, j, D) {
1522
1845
  try {
1523
- return Promise.resolve(C).then(function(L) {
1524
- return x.method && G(x.method) ? (function(R, P) {
1525
- var K = nn(R);
1846
+ return Promise.resolve(x).then(function(L) {
1847
+ return j.method && B(j.method) ? (function(Z, P) {
1848
+ var K = un(Z);
1526
1849
  if (K && K.name === P) {
1527
- var M = nn(K.method);
1528
- throw new Error([P + " plugin is calling method " + R, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + P + " plugin insteadof " + R].join(`
1850
+ var M = un(K.method);
1851
+ throw new Error([P + " plugin is calling method " + Z, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + P + " plugin insteadof " + Z].join(`
1529
1852
  `));
1530
1853
  }
1531
- }(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (X = L, U = I, V = x.pluginName, function(R, P) {
1532
- return E({}, X, { abort: { reason: R, plugins: P || [U], caller: c, from: V || U } });
1533
- }), config: qt(x.pluginName, m, o), plugins: m })).then(function(R) {
1534
- var P = F(R) ? R : {};
1535
- return Promise.resolve(E({}, L, P));
1854
+ }(j.methodName, j.pluginName), Promise.resolve(j.method({ payload: L, instance: r, abort: (F = L, U = y, J = j.pluginName, function(Z, P) {
1855
+ return O({}, F, { abort: { reason: Z, plugins: P || [U], caller: c, from: J || U } });
1856
+ }), config: on(j.pluginName, m, o), plugins: m })).then(function(Z) {
1857
+ var P = H(Z) ? Z : {};
1858
+ return Promise.resolve(O({}, L, P));
1536
1859
  })) : L;
1537
- var X, U, V;
1860
+ var F, U, J;
1538
1861
  });
1539
1862
  } catch (L) {
1540
1863
  return Promise.reject(L);
1541
1864
  }
1542
- }, Promise.resolve(n))).then(function(C) {
1543
- g[I] = C;
1865
+ }, Promise.resolve(n))).then(function(x) {
1866
+ l[y] = x;
1544
1867
  });
1545
- g[I] = n;
1868
+ l[y] = n;
1546
1869
  }();
1547
- return A && A.then ? A.then(b) : b();
1870
+ return T && T.then ? T.then(b) : b();
1548
1871
  });
1549
- } catch (g) {
1550
- return Promise.reject(g);
1872
+ } catch (l) {
1873
+ return Promise.reject(l);
1551
1874
  }
1552
- }, Promise.resolve({}))).then(function(y) {
1553
- return Promise.resolve(e.exact.reduce(function(k, _, I) {
1875
+ }, Promise.resolve({}))).then(function(w) {
1876
+ return Promise.resolve(e.exact.reduce(function(I, _, y) {
1554
1877
  try {
1555
- var g = e.exact.length === I + 1, b = _.pluginName, A = o[b];
1556
- return Promise.resolve(k).then(function(C) {
1557
- var x = y[b] ? y[b] : {};
1558
- if (d && (x = C), dt(x, b))
1559
- return lt({ data: x, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(C);
1560
- if (dt(C, b))
1561
- return g && lt({ data: C, method: c, instance: r, store: s }), Promise.resolve(C);
1562
- if (w.hasOwnProperty(b) && w[b] === !0)
1563
- return s.dispatch({ type: "queue", plugin: b, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(C);
1564
- var D = v(y[b], o[b]);
1565
- return Promise.resolve(A[c]({ abort: D.abort, payload: x, instance: r, config: qt(b, m, o), plugins: m })).then(function(L) {
1566
- var X = F(L) ? L : {}, U = E({}, C, X), V = y[b];
1567
- if (dt(V, b))
1568
- lt({ data: V, method: c, instance: r, pluginName: b, store: s });
1878
+ var l = e.exact.length === y + 1, b = _.pluginName, T = o[b];
1879
+ return Promise.resolve(I).then(function(x) {
1880
+ var j = w[b] ? w[b] : {};
1881
+ if (f && (j = x), mt(j, b))
1882
+ return pt({ data: j, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(x);
1883
+ if (mt(x, b))
1884
+ return l && pt({ data: x, method: c, instance: r, store: s }), Promise.resolve(x);
1885
+ if (k.hasOwnProperty(b) && k[b] === !0)
1886
+ return s.dispatch({ type: "queue", plugin: b, payload: j, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(x);
1887
+ var D = v(w[b], o[b]);
1888
+ return Promise.resolve(T[c]({ abort: D.abort, payload: j, instance: r, config: on(b, m, o), plugins: m })).then(function(L) {
1889
+ var F = H(L) ? L : {}, U = O({}, x, F), J = w[b];
1890
+ if (mt(J, b))
1891
+ pt({ data: J, method: c, instance: r, pluginName: b, store: s });
1569
1892
  else {
1570
- var R = c + ":" + b;
1571
- (R.match(/:/g) || []).length < 2 && !c.match(Gt) && !c.match(Bt) && r.dispatch(E({}, d ? U : x, { type: R, _: { called: R, from: "submethod" } }));
1893
+ var Z = c + ":" + b;
1894
+ (Z.match(/:/g) || []).length < 2 && !c.match(nn) && !c.match(rn) && r.dispatch(O({}, f ? U : j, { type: Z, _: { called: Z, from: "submethod" } }));
1572
1895
  }
1573
1896
  return Promise.resolve(U);
1574
1897
  });
1575
1898
  });
1576
- } catch (C) {
1577
- return Promise.reject(C);
1899
+ } catch (x) {
1900
+ return Promise.reject(x);
1578
1901
  }
1579
- }, Promise.resolve(n))).then(function(k) {
1580
- if (!(c.match(be) || c.match(/^registerPlugin/) || c.match(Bt) || c.match(Gt) || c.match(/^params/) || c.match(/^userIdChanged/))) {
1581
- if (f.plugins.includes(c), k._ && k._.originalAction === c)
1582
- return k;
1583
- var _ = E({}, k, { _: { originalAction: k.type, called: k.type, from: "engineEnd" } });
1584
- Dn(k, e.exact.length) && !c.match(/End$/) && (_ = E({}, _, { type: k.type + "Aborted" })), s.dispatch(_);
1902
+ }, Promise.resolve(n))).then(function(I) {
1903
+ if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(rn) || c.match(nn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
1904
+ if (p.plugins.includes(c), I._ && I._.originalAction === c)
1905
+ return I;
1906
+ var _ = O({}, I, { _: { originalAction: I.type, called: I.type, from: "engineEnd" } });
1907
+ Vn(I, e.exact.length) && !c.match(/End$/) && (_ = O({}, _, { type: I.type + "Aborted" })), s.dispatch(_);
1585
1908
  }
1586
- return k;
1909
+ return I;
1587
1910
  });
1588
1911
  });
1589
- } catch (y) {
1590
- return Promise.reject(y);
1912
+ } catch (w) {
1913
+ return Promise.reject(w);
1591
1914
  }
1592
- }, be = /Start$/, Gt = /^bootstrap/, Bt = /^ready/;
1593
- function lt(t) {
1915
+ }, _e = /Start$/, nn = /^bootstrap/, rn = /^ready/;
1916
+ function pt(t) {
1594
1917
  var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
1595
- t.store.dispatch(E({}, t.data, { type: n, _: { called: n, from: "abort" } }));
1918
+ t.store.dispatch(O({}, t.data, { type: n, _: { called: n, from: "abort" } }));
1596
1919
  }
1597
- function qt(t, e, n) {
1920
+ function on(t, e, n) {
1598
1921
  var r = e[t] || n[t];
1599
1922
  return r && r.config ? r.config : {};
1600
1923
  }
1601
- function Qt(t, e) {
1924
+ function an(t, e) {
1602
1925
  return e.reduce(function(n, r) {
1603
1926
  return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
1604
1927
  }, []);
1605
1928
  }
1606
- function en(t, e) {
1607
- var n = t.replace(be, ""), r = e ? ":" + e : "";
1929
+ function sn(t, e) {
1930
+ var n = t.replace(_e, ""), r = e ? ":" + e : "";
1608
1931
  return ["" + t + r, "" + n + r, n + "End" + r];
1609
1932
  }
1610
- function dt(t, e) {
1933
+ function mt(t, e) {
1611
1934
  var n = t.abort;
1612
- return !!n && (n === !0 || tn(n, e) || n && tn(n.plugins, e));
1935
+ return !!n && (n === !0 || cn(n, e) || n && cn(n.plugins, e));
1613
1936
  }
1614
- function Dn(t, e) {
1937
+ function Vn(t, e) {
1615
1938
  var n = t.abort;
1616
1939
  if (!n)
1617
1940
  return !1;
1618
1941
  if (n === !0 || re(n))
1619
1942
  return !0;
1620
1943
  var r = n.plugins;
1621
- return Le(n) && n.length === e || Le(r) && r.length === e;
1944
+ return Ze(n) && n.length === e || Ze(r) && r.length === e;
1622
1945
  }
1623
- function Le(t) {
1946
+ function Ze(t) {
1624
1947
  return Array.isArray(t);
1625
1948
  }
1626
- function tn(t, e) {
1627
- return !(!t || !Le(t)) && t.includes(e);
1949
+ function cn(t, e) {
1950
+ return !(!t || !Ze(t)) && t.includes(e);
1628
1951
  }
1629
- function nn(t) {
1952
+ function un(t) {
1630
1953
  var e = t.match(/(.*):(.*)/);
1631
1954
  return !!e && { method: e[1], name: e[2] };
1632
1955
  }
1633
- function oi(t) {
1956
+ function zi(t) {
1634
1957
  return Object.keys(t).reduce(function(e, n) {
1635
- return n === "type" || (e[n] = F(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
1958
+ return n === "type" || (e[n] = H(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
1636
1959
  }, {});
1637
1960
  }
1638
- function ai(t, e, n) {
1961
+ function Ai(t, e, n) {
1639
1962
  var r = {};
1640
1963
  return function(i) {
1641
1964
  return function(o) {
1642
1965
  return function(a) {
1643
1966
  try {
1644
- var s, f = function(g) {
1645
- return s ? g : o(c);
1967
+ var s, p = function(l) {
1968
+ return s ? l : o(c);
1646
1969
  }, m = a.type, u = a.plugins, c = a;
1647
1970
  if (a.abort)
1648
1971
  return Promise.resolve(o(a));
1649
- if (m === O.enablePlugin && i.dispatch({ type: O.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), m === O.disablePlugin && setTimeout(function() {
1650
- return Yt(a.meta.rid, { payload: a });
1651
- }, 0), m === O.initializeEnd) {
1652
- var d = e(), h = Object.keys(d), v = h.filter(function(g) {
1653
- return u.includes(g);
1654
- }).map(function(g) {
1655
- return d[g];
1656
- }), w = [], y = [], k = a.disabled, _ = v.map(function(g) {
1657
- var b = g.loaded, A = g.name, C = g.config;
1658
- return An(g, function() {
1659
- return b({ config: C });
1660
- }, 1e4).then(function(x) {
1661
- return r[A] || (i.dispatch({ type: O.pluginReadyType(A), name: A, events: Object.keys(g).filter(function(D) {
1662
- return !wt.includes(D);
1663
- }) }), r[A] = !0), w = w.concat(A), g;
1664
- }).catch(function(x) {
1665
- if (x instanceof Error)
1666
- throw new Error(x);
1667
- return y = y.concat(x.name), x;
1972
+ if (m === E.enablePlugin && i.dispatch({ type: E.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), m === E.disablePlugin && setTimeout(function() {
1973
+ return tn(a.meta.rid, { payload: a });
1974
+ }, 0), m === E.initializeEnd) {
1975
+ var f = e(), d = Object.keys(f), v = d.filter(function(l) {
1976
+ return u.includes(l);
1977
+ }).map(function(l) {
1978
+ return f[l];
1979
+ }), k = [], w = [], I = a.disabled, _ = v.map(function(l) {
1980
+ var b = l.loaded, T = l.name, x = l.config;
1981
+ return Jn(l, function() {
1982
+ return b({ config: x });
1983
+ }, 1e4).then(function(j) {
1984
+ return r[T] || (i.dispatch({ type: E.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(D) {
1985
+ return !_t.includes(D);
1986
+ }) }), r[T] = !0), k = k.concat(T), l;
1987
+ }).catch(function(j) {
1988
+ if (j instanceof Error)
1989
+ throw new Error(j);
1990
+ return w = w.concat(j.name), j;
1668
1991
  });
1669
1992
  });
1670
- Promise.all(_).then(function(g) {
1671
- var b = { plugins: w, failed: y, disabled: k };
1993
+ Promise.all(_).then(function(l) {
1994
+ var b = { plugins: k, failed: w, disabled: I };
1672
1995
  setTimeout(function() {
1673
- h.length === _.length + k.length && i.dispatch(E({}, { type: O.ready }, b));
1996
+ d.length === _.length + I.length && i.dispatch(O({}, { type: E.ready }, b));
1674
1997
  }, 0);
1675
1998
  });
1676
1999
  }
1677
- var I = function() {
1678
- if (m !== O.bootstrap)
2000
+ var y = function() {
2001
+ if (m !== E.bootstrap)
1679
2002
  return /^ready:([^:]*)$/.test(m) && setTimeout(function() {
1680
- return Ln(i, e, t);
1681
- }, 0), Promise.resolve(function(g, b, A, C, x) {
2003
+ return Hn(i, e, t);
2004
+ }, 0), Promise.resolve(function(l, b, T, x, j) {
1682
2005
  try {
1683
- var D = G(b) ? b() : b, L = g.type, X = L.replace(be, "");
1684
- if (g._ && g._.called)
1685
- return Promise.resolve(g);
1686
- var U = A.getState(), V = (K = D, (M = U.plugins) === void 0 && (M = {}), (Pe = g.options) === void 0 && (Pe = {}), Object.keys(K).filter(function(l) {
1687
- var p = Pe.plugins || {};
1688
- return Kr(p[l]) ? p[l] : p.all !== !1 && (!M[l] || M[l].enabled !== !1);
1689
- }).map(function(l) {
1690
- return K[l];
2006
+ var D = B(b) ? b() : b, L = l.type, F = L.replace(_e, "");
2007
+ if (l._ && l._.called)
2008
+ return Promise.resolve(l);
2009
+ var U = T.getState(), J = (K = D, (M = U.plugins) === void 0 && (M = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(h) {
2010
+ var g = Ce.plugins || {};
2011
+ return gi(g[h]) ? g[h] : g.all !== !1 && (!M[h] || M[h].enabled !== !1);
2012
+ }).map(function(h) {
2013
+ return K[h];
1691
2014
  }));
1692
- L === O.initializeStart && g.fromEnable && (V = Object.keys(U.plugins).filter(function(l) {
1693
- var p = U.plugins[l];
1694
- return g.plugins.includes(l) && !p.initialized;
1695
- }).map(function(l) {
1696
- return D[l];
2015
+ L === E.initializeStart && l.fromEnable && (J = Object.keys(U.plugins).filter(function(h) {
2016
+ var g = U.plugins[h];
2017
+ return l.plugins.includes(h) && !g.initialized;
2018
+ }).map(function(h) {
2019
+ return D[h];
1697
2020
  }));
1698
- var R = V.map(function(l) {
1699
- return l.name;
1700
- }), P = function(l, p, S) {
1701
- var T = en(l).map(function(j) {
1702
- return Qt(j, p);
2021
+ var Z = J.map(function(h) {
2022
+ return h.name;
2023
+ }), P = function(h, g, S) {
2024
+ var C = sn(h).map(function($) {
2025
+ return an($, g);
1703
2026
  });
1704
- return p.reduce(function(j, $) {
1705
- var W = $.name, N = en(l, W).map(function(xe) {
1706
- return Qt(xe, p);
1707
- }), Z = N[0], z = N[1], q = N[2];
1708
- return Z.length && (j.beforeNS[W] = Z), z.length && (j.duringNS[W] = z), q.length && (j.afterNS[W] = q), j;
1709
- }, { before: T[0], beforeNS: {}, during: T[1], duringNS: {}, after: T[2], afterNS: {} });
1710
- }(L, V);
1711
- return Promise.resolve(ut({ action: g, data: { exact: P.before, namespaced: P.beforeNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(l) {
1712
- function p() {
1713
- var j = function() {
1714
- if (L.match(be))
1715
- return Promise.resolve(ut({ action: E({}, S, { type: X + "End" }), data: { exact: P.after, namespaced: P.afterNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function($) {
1716
- $.meta && $.meta.hasCallback && Yt($.meta.rid, { payload: $ });
2027
+ return g.reduce(function($, z) {
2028
+ var W = z.name, N = sn(h, W).map(function($e) {
2029
+ return an($e, g);
2030
+ }), R = N[0], A = N[1], q = N[2];
2031
+ return R.length && ($.beforeNS[W] = R), A.length && ($.duringNS[W] = A), q.length && ($.afterNS[W] = q), $;
2032
+ }, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
2033
+ }(L, J);
2034
+ return Promise.resolve(ft({ action: l, data: { exact: P.before, namespaced: P.beforeNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function(h) {
2035
+ function g() {
2036
+ var $ = function() {
2037
+ if (L.match(_e))
2038
+ return Promise.resolve(ft({ action: O({}, S, { type: F + "End" }), data: { exact: P.after, namespaced: P.afterNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function(z) {
2039
+ z.meta && z.meta.hasCallback && tn(z.meta.rid, { payload: z });
1717
2040
  });
1718
2041
  }();
1719
- return j && j.then ? j.then(function() {
1720
- return l;
1721
- }) : l;
2042
+ return $ && $.then ? $.then(function() {
2043
+ return h;
2044
+ }) : h;
1722
2045
  }
1723
- if (Dn(l, R.length))
1724
- return l;
1725
- var S, T = function() {
1726
- if (L !== X)
1727
- return Promise.resolve(ut({ action: E({}, l, { type: X }), data: { exact: P.during, namespaced: P.duringNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(j) {
1728
- S = j;
2046
+ if (Vn(h, Z.length))
2047
+ return h;
2048
+ var S, C = function() {
2049
+ if (L !== F)
2050
+ return Promise.resolve(ft({ action: O({}, h, { type: F }), data: { exact: P.during, namespaced: P.duringNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function($) {
2051
+ S = $;
1729
2052
  });
1730
- S = l;
2053
+ S = h;
1731
2054
  }();
1732
- return T && T.then ? T.then(p) : p();
2055
+ return C && C.then ? C.then(g) : g();
1733
2056
  });
1734
- } catch (l) {
1735
- return Promise.reject(l);
2057
+ } catch (h) {
2058
+ return Promise.reject(h);
1736
2059
  }
1737
- var K, M, Pe;
1738
- }(a, e, t, i, n)).then(function(g) {
1739
- return s = 1, o(g);
2060
+ var K, M, Ce;
2061
+ }(a, e, t, i, n)).then(function(l) {
2062
+ return s = 1, o(l);
1740
2063
  });
1741
2064
  }();
1742
- return Promise.resolve(I && I.then ? I.then(f) : f(I));
1743
- } catch (g) {
1744
- return Promise.reject(g);
2065
+ return Promise.resolve(y && y.then ? y.then(p) : p(y));
2066
+ } catch (l) {
2067
+ return Promise.reject(l);
1745
2068
  }
1746
2069
  };
1747
2070
  };
1748
2071
  };
1749
2072
  }
1750
- function si(t) {
2073
+ function Ni(t) {
1751
2074
  return function(e) {
1752
2075
  return function(n) {
1753
2076
  return function(r) {
1754
2077
  var i = r.type, o = r.key, a = r.value, s = r.options;
1755
- if (i === O.setItem || i === O.removeItem) {
2078
+ if (i === E.setItem || i === E.removeItem) {
1756
2079
  if (r.abort)
1757
2080
  return n(r);
1758
- i === O.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
2081
+ i === E.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
1759
2082
  }
1760
2083
  return n(r);
1761
2084
  };
1762
2085
  };
1763
2086
  };
1764
2087
  }
1765
- var ci = function() {
2088
+ var Li = function() {
1766
2089
  var t = this;
1767
2090
  this.before = [], this.after = [], this.addMiddleware = function(e, n) {
1768
2091
  t[n] = t[n].concat(e);
@@ -1780,441 +2103,441 @@ var ci = function() {
1780
2103
  } }, a = t[e].map(function(s) {
1781
2104
  return s(o);
1782
2105
  });
1783
- return _e.apply(void 0, a)(r)(i);
2106
+ return Te.apply(void 0, a)(r)(i);
1784
2107
  };
1785
2108
  };
1786
2109
  };
1787
2110
  };
1788
2111
  };
1789
- function ui(t) {
2112
+ function Di(t) {
1790
2113
  return function(e, n) {
1791
2114
  e === void 0 && (e = {});
1792
2115
  var r = {};
1793
2116
  if (n.type === "initialize:aborted")
1794
2117
  return e;
1795
2118
  if (/^registerPlugin:([^:]*)$/.test(n.type)) {
1796
- var i = rn(n.type, "registerPlugin"), o = t()[i];
2119
+ var i = ln(n.type, "registerPlugin"), o = t()[i];
1797
2120
  if (!o || !i)
1798
2121
  return e;
1799
2122
  var a = n.enabled, s = o.config;
1800
- return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, E({}, e, r);
2123
+ return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, O({}, e, r);
1801
2124
  }
1802
2125
  if (/^initialize:([^:]*)$/.test(n.type)) {
1803
- var f = rn(n.type, O.initialize), m = t()[f];
1804
- return m && f ? (r[f] = E({}, e[f], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), E({}, e, r)) : e;
2126
+ var p = ln(n.type, E.initialize), m = t()[p];
2127
+ return m && p ? (r[p] = O({}, e[p], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), O({}, e, r)) : e;
1805
2128
  }
1806
2129
  if (/^ready:([^:]*)$/.test(n.type))
1807
- return r[n.name] = E({}, e[n.name], { loaded: !0 }), E({}, e, r);
2130
+ return r[n.name] = O({}, e[n.name], { loaded: !0 }), O({}, e, r);
1808
2131
  switch (n.type) {
1809
- case O.disablePlugin:
1810
- return E({}, e, on(n.plugins, !1, e));
1811
- case O.enablePlugin:
1812
- return E({}, e, on(n.plugins, !0, e));
2132
+ case E.disablePlugin:
2133
+ return O({}, e, dn(n.plugins, !1, e));
2134
+ case E.enablePlugin:
2135
+ return O({}, e, dn(n.plugins, !0, e));
1813
2136
  default:
1814
2137
  return e;
1815
2138
  }
1816
2139
  };
1817
2140
  }
1818
- function rn(t, e) {
2141
+ function ln(t, e) {
1819
2142
  return t.substring(e.length + 1, t.length);
1820
2143
  }
1821
- function on(t, e, n) {
2144
+ function dn(t, e, n) {
1822
2145
  return t.reduce(function(r, i) {
1823
- return r[i] = E({}, n[i], { enabled: e }), r;
2146
+ return r[i] = O({}, n[i], { enabled: e }), r;
1824
2147
  }, n);
1825
2148
  }
1826
- function Un(t) {
2149
+ function Yn(t) {
1827
2150
  try {
1828
2151
  return JSON.parse(JSON.stringify(t));
1829
2152
  } catch {
1830
2153
  }
1831
2154
  return t;
1832
2155
  }
1833
- var li = { last: {}, history: [] };
1834
- function di(t, e) {
1835
- t === void 0 && (t = li);
2156
+ var Ui = { last: {}, history: [] };
2157
+ function Ri(t, e) {
2158
+ t === void 0 && (t = Ui);
1836
2159
  var n = e.options, r = e.meta;
1837
- if (e.type === O.track) {
1838
- var i = Un(E({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
1839
- return E({}, t, { last: i, history: t.history.concat(i) });
2160
+ if (e.type === E.track) {
2161
+ var i = Yn(O({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
2162
+ return O({}, t, { last: i, history: t.history.concat(i) });
1840
2163
  }
1841
2164
  return t;
1842
2165
  }
1843
- var hi = { actions: [] };
1844
- function fi(t, e) {
1845
- t === void 0 && (t = hi);
2166
+ var Zi = { actions: [] };
2167
+ function Wi(t, e) {
2168
+ t === void 0 && (t = Zi);
1846
2169
  var n = e.payload;
1847
2170
  switch (e.type) {
1848
2171
  case "queue":
1849
2172
  var r;
1850
- return r = n && n.type && n.type === O.identify ? [e].concat(t.actions) : t.actions.concat(e), E({}, t, { actions: r });
2173
+ return r = n && n.type && n.type === E.identify ? [e].concat(t.actions) : t.actions.concat(e), O({}, t, { actions: r });
1851
2174
  case "dequeue":
1852
2175
  return [];
1853
2176
  default:
1854
2177
  return t;
1855
2178
  }
1856
2179
  }
1857
- var Zn = /#.*$/;
1858
- function pi(t) {
2180
+ var Gn = /#.*$/;
2181
+ function Ki(t) {
1859
2182
  var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
1860
- return "/" + (e && e[3] ? e[3].split("?")[0].replace(Zn, "") : "");
2183
+ return "/" + (e && e[3] ? e[3].split("?")[0].replace(Gn, "") : "");
1861
2184
  }
1862
- var Rn, Wn, Kn, Mn, mi = function(t) {
1863
- if (t === void 0 && (t = {}), !H)
2185
+ var Bn, qn, Qn, er, Mi = function(t) {
2186
+ if (t === void 0 && (t = {}), !Y)
1864
2187
  return t;
1865
- var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, f = o.hash, m = o.search, u = function(d) {
1866
- var h = function() {
1867
- if (H) {
1868
- for (var v, w = document.getElementsByTagName("link"), y = 0; v = w[y]; y++)
2188
+ var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, p = o.hash, m = o.search, u = function(f) {
2189
+ var d = function() {
2190
+ if (Y) {
2191
+ for (var v, k = document.getElementsByTagName("link"), w = 0; v = k[w]; w++)
1869
2192
  if (v.getAttribute("rel") === "canonical")
1870
2193
  return v.getAttribute("href");
1871
2194
  }
1872
2195
  }();
1873
- return h ? h.match(/\?/) ? h : h + d : window.location.href.replace(Zn, "");
1874
- }(m), c = { title: n, url: u, path: pi(u), hash: f, search: m, width: a, height: s };
1875
- return r && r !== "" && (c.referrer = r), E({}, c, t);
1876
- }, gi = { last: {}, history: [] };
1877
- function vi(t, e) {
1878
- t === void 0 && (t = gi);
2196
+ return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(Gn, "");
2197
+ }(m), c = { title: n, url: u, path: Ki(u), hash: p, search: m, width: a, height: s };
2198
+ return r && r !== "" && (c.referrer = r), O({}, c, t);
2199
+ }, Xi = { last: {}, history: [] };
2200
+ function Fi(t, e) {
2201
+ t === void 0 && (t = Xi);
1879
2202
  var n = e.options;
1880
- if (e.type === O.page) {
1881
- var r = Un(E({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
1882
- return E({}, t, { last: r, history: t.history.concat(r) });
2203
+ if (e.type === E.page) {
2204
+ var r = Yn(O({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
2205
+ return O({}, t, { last: r, history: t.history.concat(r) });
1883
2206
  }
1884
2207
  return t;
1885
2208
  }
1886
- Rn = function() {
1887
- if (!H)
2209
+ Bn = function() {
2210
+ if (!Y)
1888
2211
  return !1;
1889
2212
  var t = navigator.appVersion;
1890
2213
  return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
1891
- }(), Wn = H ? document.referrer : null, Kn = Yr(), Mn = Gr();
1892
- var an = { initialized: !1, sessionId: tt(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: Rn }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: Mn, locale: Kn, campaign: {}, referrer: Wn };
1893
- function yi(t, e) {
1894
- t === void 0 && (t = an);
2214
+ }(), qn = Y ? document.referrer : null, Qn = _i(), er = Si();
2215
+ var hn = { initialized: !1, sessionId: ot(), app: null, version: null, debug: !1, offline: !!Y && !navigator.onLine, os: { name: Bn }, userAgent: Y ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: er, locale: Qn, campaign: {}, referrer: qn };
2216
+ function Ji(t, e) {
2217
+ t === void 0 && (t = hn);
1895
2218
  var n = t.initialized, r = e.campaign;
1896
2219
  switch (e.type) {
1897
- case O.campaign:
1898
- return E({}, t, { campaign: r });
1899
- case O.offline:
1900
- return E({}, t, { offline: !0 });
1901
- case O.online:
1902
- return E({}, t, { offline: !1 });
2220
+ case E.campaign:
2221
+ return O({}, t, { campaign: r });
2222
+ case E.offline:
2223
+ return O({}, t, { offline: !0 });
2224
+ case E.online:
2225
+ return O({}, t, { offline: !1 });
1903
2226
  default:
1904
- return n ? t : E({}, an, t, { initialized: !0 });
2227
+ return n ? t : O({}, hn, t, { initialized: !0 });
1905
2228
  }
1906
2229
  }
1907
- var wi = ["plugins", "reducers", "storage"];
1908
- function bi(t, e, n) {
1909
- if (H) {
2230
+ var Hi = ["plugins", "reducers", "storage"];
2231
+ function Vi(t, e, n) {
2232
+ if (Y) {
1910
2233
  var r = window[(n ? "add" : "remove") + "EventListener"];
1911
2234
  t.split(" ").forEach(function(i) {
1912
2235
  r(i, e);
1913
2236
  });
1914
2237
  }
1915
2238
  }
1916
- function ki(t) {
1917
- var e = bi.bind(null, "online offline", function(n) {
2239
+ function Yi(t) {
2240
+ var e = Vi.bind(null, "online offline", function(n) {
1918
2241
  return Promise.resolve(!navigator.onLine).then(t);
1919
2242
  });
1920
2243
  return e(!0), function(n) {
1921
2244
  return e(!1);
1922
2245
  };
1923
2246
  }
1924
- function Xn() {
1925
- return me("analytics", []), function(t) {
2247
+ function tr() {
2248
+ return ye("analytics", []), function(t) {
1926
2249
  return function(e, n, r) {
1927
2250
  var i = t(e, n, r), o = i.dispatch;
1928
2251
  return Object.assign(i, { dispatch: function(a) {
1929
- return Se[Ie].analytics.push(a.action || a), o(a);
2252
+ return Pe[Oe].analytics.push(a.action || a), o(a);
1930
2253
  } });
1931
2254
  };
1932
2255
  };
1933
2256
  }
1934
- function sn(t) {
2257
+ function fn(t) {
1935
2258
  return function() {
1936
- return _e(_e.apply(null, arguments), Xn());
2259
+ return Te(Te.apply(null, arguments), tr());
1937
2260
  };
1938
2261
  }
1939
- function ht(t) {
1940
- return t ? $n(t) ? t : [t] : [];
2262
+ function gt(t) {
2263
+ return t ? Mn(t) ? t : [t] : [];
1941
2264
  }
1942
- function cn(t, e, n) {
2265
+ function pn(t, e, n) {
1943
2266
  t === void 0 && (t = {});
1944
- var r, i, o = tt();
1945
- return e && (Ce[o] = (r = e, i = function(a) {
1946
- for (var s, f = a || Array.prototype.slice.call(arguments), m = 0; m < f.length; m++)
1947
- if (G(f[m])) {
1948
- s = f[m];
2267
+ var r, i, o = ot();
2268
+ return e && (Ne[o] = (r = e, i = function(a) {
2269
+ for (var s, p = a || Array.prototype.slice.call(arguments), m = 0; m < p.length; m++)
2270
+ if (B(p[m])) {
2271
+ s = p[m];
1949
2272
  break;
1950
2273
  }
1951
2274
  return s;
1952
2275
  }(n), function(a) {
1953
2276
  i && i(a), r(a);
1954
- })), E({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2277
+ })), O({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
1955
2278
  }
1956
- function Ii(t) {
2279
+ function Gi(t) {
1957
2280
  t === void 0 && (t = {});
1958
- var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(l, p) {
1959
- if (G(p))
1960
- return l.middlewares = l.middlewares.concat(p), l;
1961
- if (p.NAMESPACE && (p.name = p.NAMESPACE), !p.name)
2281
+ var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(h, g) {
2282
+ if (B(g))
2283
+ return h.middlewares = h.middlewares.concat(g), h;
2284
+ if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
1962
2285
  throw new Error("https://lytics.dev/errors/1");
1963
- p.config || (p.config = {});
1964
- var S = p.EVENTS ? Object.keys(p.EVENTS).map(function($) {
1965
- return p.EVENTS[$];
2286
+ g.config || (g.config = {});
2287
+ var S = g.EVENTS ? Object.keys(g.EVENTS).map(function(z) {
2288
+ return g.EVENTS[z];
1966
2289
  }) : [];
1967
- l.pluginEnabled[p.name] = !(p.enabled === !1 || p.config.enabled === !1), delete p.enabled, p.methods && (l.methods[p.name] = Object.keys(p.methods).reduce(function($, W) {
2290
+ h.pluginEnabled[g.name] = !(g.enabled === !1 || g.config.enabled === !1), delete g.enabled, g.methods && (h.methods[g.name] = Object.keys(g.methods).reduce(function(z, W) {
1968
2291
  var N;
1969
- return $[W] = (N = p.methods[W], function() {
1970
- for (var Z = Array.prototype.slice.call(arguments), z = new Array(N.length), q = 0; q < Z.length; q++)
1971
- z[q] = Z[q];
1972
- return z[z.length] = b, N.apply({ instance: b }, z);
1973
- }), $;
1974
- }, {}), delete p.methods);
1975
- var T = Object.keys(p).concat(S), j = new Set(l.events.concat(T));
1976
- if (l.events = Array.from(j), l.pluginsArray = l.pluginsArray.concat(p), l.plugins[p.name])
1977
- throw new Error(p.name + "AlreadyLoaded");
1978
- return l.plugins[p.name] = p, l.plugins[p.name].loaded || (l.plugins[p.name].loaded = function() {
2292
+ return z[W] = (N = g.methods[W], function() {
2293
+ for (var R = Array.prototype.slice.call(arguments), A = new Array(N.length), q = 0; q < R.length; q++)
2294
+ A[q] = R[q];
2295
+ return A[A.length] = b, N.apply({ instance: b }, A);
2296
+ }), z;
2297
+ }, {}), delete g.methods);
2298
+ var C = Object.keys(g).concat(S), $ = new Set(h.events.concat(C));
2299
+ if (h.events = Array.from($), h.pluginsArray = h.pluginsArray.concat(g), h.plugins[g.name])
2300
+ throw new Error(g.name + "AlreadyLoaded");
2301
+ return h.plugins[g.name] = g, h.plugins[g.name].loaded || (h.plugins[g.name].loaded = function() {
1979
2302
  return !0;
1980
- }), l;
1981
- }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: pe, setItem: me, removeItem: Oe }, o = /* @__PURE__ */ function(l) {
1982
- return function(p, S, T) {
1983
- return S.getState("user")[p] || (T && F(T) && T[p] ? T[p] : Ht(l)[p] || pe(bt(p)) || null);
2303
+ }), h;
2304
+ }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: je }, o = /* @__PURE__ */ function(h) {
2305
+ return function(g, S, C) {
2306
+ return S.getState("user")[g] || (C && H(C) && C[g] ? C[g] : en(h)[g] || ge(St(g)) || null);
1984
2307
  };
1985
- }(i), a = r.plugins, s = r.events.filter(function(l) {
1986
- return !wt.includes(l);
1987
- }).sort(), f = new Set(s.concat(He).filter(function(l) {
1988
- return !wt.includes(l);
1989
- })), m = Array.from(f).sort(), u = function() {
2308
+ }(i), a = r.plugins, s = r.events.filter(function(h) {
2309
+ return !_t.includes(h);
2310
+ }).sort(), p = new Set(s.concat(qe).filter(function(h) {
2311
+ return !_t.includes(h);
2312
+ })), m = Array.from(p).sort(), u = function() {
1990
2313
  return a;
1991
- }, c = new ci(), d = c.addMiddleware, h = c.removeMiddleware, v = c.dynamicMiddlewares, w = function() {
2314
+ }, c = new Li(), f = c.addMiddleware, d = c.removeMiddleware, v = c.dynamicMiddlewares, k = function() {
1992
2315
  throw new Error("Abort disabled inListener");
1993
- }, y = Br(), k = Ht(i), _ = E({}, k, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
1994
- _.anonymousId || (_.anonymousId = tt());
1995
- var I = E({ enable: function(l, p) {
2316
+ }, w = Ei(), I = en(i), _ = O({}, I, n, w.an_uid ? { userId: w.an_uid } : {}, w.an_aid ? { anonymousId: w.an_aid } : {});
2317
+ _.anonymousId || (_.anonymousId = ot());
2318
+ var y = O({ enable: function(h, g) {
1996
2319
  return new Promise(function(S) {
1997
- P.dispatch({ type: O.enablePlugin, plugins: ht(l), _: { originalAction: O.enablePlugin } }, S, [p]);
2320
+ P.dispatch({ type: E.enablePlugin, plugins: gt(h), _: { originalAction: E.enablePlugin } }, S, [g]);
1998
2321
  });
1999
- }, disable: function(l, p) {
2322
+ }, disable: function(h, g) {
2000
2323
  return new Promise(function(S) {
2001
- P.dispatch({ type: O.disablePlugin, plugins: ht(l), _: { originalAction: O.disablePlugin } }, S, [p]);
2324
+ P.dispatch({ type: E.disablePlugin, plugins: gt(h), _: { originalAction: E.disablePlugin } }, S, [g]);
2002
2325
  });
2003
- } }, r.methods), g = !1, b = { identify: function(l, p, S, T) {
2326
+ } }, r.methods), l = !1, b = { identify: function(h, g, S, C) {
2004
2327
  try {
2005
- var j = re(l) ? l : null, $ = F(l) ? l : p, W = S || {}, N = b.user();
2006
- me(bt(te), j);
2007
- var Z = j || $.userId || o(te, b, $);
2008
- return Promise.resolve(new Promise(function(z) {
2009
- P.dispatch(E({ type: O.identifyStart, userId: Z, traits: $ || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== j && { previousId: N.id }), z, [p, S, T]);
2328
+ var $ = re(h) ? h : null, z = H(h) ? h : g, W = S || {}, N = b.user();
2329
+ ye(St(te), $);
2330
+ var R = $ || z.userId || o(te, b, z);
2331
+ return Promise.resolve(new Promise(function(A) {
2332
+ P.dispatch(O({ type: E.identifyStart, userId: R, traits: z || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== $ && { previousId: N.id }), A, [g, S, C]);
2010
2333
  }));
2011
- } catch (z) {
2012
- return Promise.reject(z);
2334
+ } catch (A) {
2335
+ return Promise.reject(A);
2013
2336
  }
2014
- }, track: function(l, p, S, T) {
2337
+ }, track: function(h, g, S, C) {
2015
2338
  try {
2016
- var j = F(l) ? l.event : l;
2017
- if (!j || !re(j))
2339
+ var $ = H(h) ? h.event : h;
2340
+ if (!$ || !re($))
2018
2341
  throw new Error("EventMissing");
2019
- var $ = F(l) ? l : p || {}, W = F(S) ? S : {};
2342
+ var z = H(h) ? h : g || {}, W = H(S) ? S : {};
2020
2343
  return Promise.resolve(new Promise(function(N) {
2021
- P.dispatch({ type: O.trackStart, event: j, properties: $, options: W, userId: o(te, b, p), anonymousId: o(ye, b, p) }, N, [p, S, T]);
2344
+ P.dispatch({ type: E.trackStart, event: $, properties: z, options: W, userId: o(te, b, g), anonymousId: o(ke, b, g) }, N, [g, S, C]);
2022
2345
  }));
2023
2346
  } catch (N) {
2024
2347
  return Promise.reject(N);
2025
2348
  }
2026
- }, page: function(l, p, S) {
2349
+ }, page: function(h, g, S) {
2027
2350
  try {
2028
- var T = F(l) ? l : {}, j = F(p) ? p : {};
2029
- return Promise.resolve(new Promise(function($) {
2030
- P.dispatch({ type: O.pageStart, properties: mi(T), options: j, userId: o(te, b, T), anonymousId: o(ye, b, T) }, $, [l, p, S]);
2351
+ var C = H(h) ? h : {}, $ = H(g) ? g : {};
2352
+ return Promise.resolve(new Promise(function(z) {
2353
+ P.dispatch({ type: E.pageStart, properties: Mi(C), options: $, userId: o(te, b, C), anonymousId: o(ke, b, C) }, z, [h, g, S]);
2031
2354
  }));
2032
- } catch ($) {
2033
- return Promise.reject($);
2355
+ } catch (z) {
2356
+ return Promise.reject(z);
2034
2357
  }
2035
- }, user: function(l) {
2036
- if (l === te || l === "id")
2358
+ }, user: function(h) {
2359
+ if (h === te || h === "id")
2037
2360
  return o(te, b);
2038
- if (l === ye || l === "anonId")
2039
- return o(ye, b);
2040
- var p = b.getState("user");
2041
- return l ? Wt(p, l) : p;
2042
- }, reset: function(l) {
2043
- return new Promise(function(p) {
2044
- P.dispatch({ type: O.resetStart }, p, l);
2361
+ if (h === ke || h === "anonId")
2362
+ return o(ke, b);
2363
+ var g = b.getState("user");
2364
+ return h ? Ht(g, h) : g;
2365
+ }, reset: function(h) {
2366
+ return new Promise(function(g) {
2367
+ P.dispatch({ type: E.resetStart }, g, h);
2045
2368
  });
2046
- }, ready: function(l) {
2047
- return g && l({ plugins: I, instance: b }), b.on(O.ready, function(p) {
2048
- l(p), g = !0;
2369
+ }, ready: function(h) {
2370
+ return l && h({ plugins: y, instance: b }), b.on(E.ready, function(g) {
2371
+ h(g), l = !0;
2049
2372
  });
2050
- }, on: function(l, p) {
2051
- if (!l || !G(p))
2373
+ }, on: function(h, g) {
2374
+ if (!h || !B(g))
2052
2375
  return !1;
2053
- if (l === O.bootstrap)
2054
- throw new Error(".on disabled for " + l);
2376
+ if (h === E.bootstrap)
2377
+ throw new Error(".on disabled for " + h);
2055
2378
  var S = /Start$|Start:/;
2056
- if (l === "*") {
2057
- var T = function(N) {
2058
- return function(Z) {
2059
- return function(z) {
2060
- return z.type.match(S) && p({ payload: z, instance: b, plugins: a }), Z(z);
2379
+ if (h === "*") {
2380
+ var C = function(N) {
2381
+ return function(R) {
2382
+ return function(A) {
2383
+ return A.type.match(S) && g({ payload: A, instance: b, plugins: a }), R(A);
2061
2384
  };
2062
2385
  };
2063
- }, j = function(N) {
2064
- return function(Z) {
2065
- return function(z) {
2066
- return z.type.match(S) || p({ payload: z, instance: b, plugins: a }), Z(z);
2386
+ }, $ = function(N) {
2387
+ return function(R) {
2388
+ return function(A) {
2389
+ return A.type.match(S) || g({ payload: A, instance: b, plugins: a }), R(A);
2067
2390
  };
2068
2391
  };
2069
2392
  };
2070
- return d(T, Me), d(j, Xe), function() {
2071
- h(T, Me), h(j, Xe);
2393
+ return f(C, He), f($, Ve), function() {
2394
+ d(C, He), d($, Ve);
2072
2395
  };
2073
2396
  }
2074
- var $ = l.match(S) ? Me : Xe, W = function(N) {
2075
- return function(Z) {
2076
- return function(z) {
2077
- return z.type === l && p({ payload: z, instance: b, plugins: a, abort: w }), Z(z);
2397
+ var z = h.match(S) ? He : Ve, W = function(N) {
2398
+ return function(R) {
2399
+ return function(A) {
2400
+ return A.type === h && g({ payload: A, instance: b, plugins: a, abort: k }), R(A);
2078
2401
  };
2079
2402
  };
2080
2403
  };
2081
- return d(W, $), function() {
2082
- return h(W, $);
2404
+ return f(W, z), function() {
2405
+ return d(W, z);
2083
2406
  };
2084
- }, once: function(l, p) {
2085
- if (!l || !G(p))
2407
+ }, once: function(h, g) {
2408
+ if (!h || !B(g))
2086
2409
  return !1;
2087
- if (l === O.bootstrap)
2088
- throw new Error(".once disabled for " + l);
2089
- var S = b.on(l, function(T) {
2090
- p({ payload: T.payload, instance: b, plugins: a, abort: w }), S();
2410
+ if (h === E.bootstrap)
2411
+ throw new Error(".once disabled for " + h);
2412
+ var S = b.on(h, function(C) {
2413
+ g({ payload: C.payload, instance: b, plugins: a, abort: k }), S();
2091
2414
  });
2092
2415
  return S;
2093
- }, getState: function(l) {
2094
- var p = P.getState();
2095
- return l ? Wt(p, l) : Object.assign({}, p);
2096
- }, dispatch: function(l) {
2097
- var p = re(l) ? { type: l } : l;
2098
- if (He.includes(p.type))
2099
- throw new Error("reserved action " + p.type);
2100
- var S = E({}, p, { _: E({ originalAction: p.type }, l._ || {}) });
2416
+ }, getState: function(h) {
2417
+ var g = P.getState();
2418
+ return h ? Ht(g, h) : Object.assign({}, g);
2419
+ }, dispatch: function(h) {
2420
+ var g = re(h) ? { type: h } : h;
2421
+ if (qe.includes(g.type))
2422
+ throw new Error("reserved action " + g.type);
2423
+ var S = O({}, g, { _: O({ originalAction: g.type }, h._ || {}) });
2101
2424
  P.dispatch(S);
2102
- }, enablePlugin: I.enable, disablePlugin: I.disable, plugins: I, storage: { getItem: i.getItem, setItem: function(l, p, S) {
2103
- P.dispatch({ type: O.setItemStart, key: l, value: p, options: S });
2104
- }, removeItem: function(l, p) {
2105
- P.dispatch({ type: O.removeItemStart, key: l, options: p });
2106
- } }, setAnonymousId: function(l, p) {
2107
- b.storage.setItem(ie, l, p);
2108
- }, events: { core: He, plugins: s } }, A = r.middlewares.concat([function(l) {
2109
- return function(p) {
2425
+ }, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(h, g, S) {
2426
+ P.dispatch({ type: E.setItemStart, key: h, value: g, options: S });
2427
+ }, removeItem: function(h, g) {
2428
+ P.dispatch({ type: E.removeItemStart, key: h, options: g });
2429
+ } }, setAnonymousId: function(h, g) {
2430
+ b.storage.setItem(ie, h, g);
2431
+ }, events: { core: qe, plugins: s } }, T = r.middlewares.concat([function(h) {
2432
+ return function(g) {
2110
2433
  return function(S) {
2111
- return S.meta || (S.meta = cn()), p(S);
2434
+ return S.meta || (S.meta = pn()), g(S);
2112
2435
  };
2113
2436
  };
2114
- }, v(Me), ai(b, u, { all: m, plugins: s }), si(i), ni(b), ii(b), v(Xe)]), C = { context: yi, user: ri(i), page: vi, track: di, plugins: ui(u), queue: fi }, x = _e, D = _e;
2115
- if (H && t.debug) {
2437
+ }, v(He), Ai(b, u, { all: m, plugins: s }), Ni(i), xi(b), $i(b), v(Ve)]), x = { context: Ji, user: Ci(i), page: Fi, track: Ri, plugins: Di(u), queue: Wi }, j = Te, D = Te;
2438
+ if (Y && t.debug) {
2116
2439
  var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2117
- L && (x = L({ trace: !0, traceLimit: 25 })), D = function() {
2118
- return arguments.length === 0 ? Xn() : F(typeof arguments[0]) ? sn() : sn().apply(null, arguments);
2440
+ L && (j = L({ trace: !0, traceLimit: 25 })), D = function() {
2441
+ return arguments.length === 0 ? tr() : H(typeof arguments[0]) ? fn() : fn().apply(null, arguments);
2119
2442
  };
2120
2443
  }
2121
- var X, U = function(l) {
2122
- return Object.keys(l).reduce(function(p, S) {
2123
- return wi.includes(S) || (p[S] = l[S]), p;
2444
+ var F, U = function(h) {
2445
+ return Object.keys(h).reduce(function(g, S) {
2446
+ return Hi.includes(S) || (g[S] = h[S]), g;
2124
2447
  }, {});
2125
- }(t), V = r.pluginsArray.reduce(function(l, p) {
2126
- var S = p.name, T = p.config, j = p.loaded, $ = r.pluginEnabled[S];
2127
- return l[S] = { enabled: $, initialized: !!$ && !p.initialize, loaded: !!j({ config: T }), config: T }, l;
2128
- }, {}), R = { context: U, user: _, plugins: V }, P = Nn(function(l) {
2129
- for (var p = Object.keys(l), S = {}, T = 0; T < p.length; T++) {
2130
- var j = p[T];
2131
- typeof l[j] === ne && (S[j] = l[j]);
2448
+ }(t), J = r.pluginsArray.reduce(function(h, g) {
2449
+ var S = g.name, C = g.config, $ = g.loaded, z = r.pluginEnabled[S];
2450
+ return h[S] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!$({ config: C }), config: C }, h;
2451
+ }, {}), Z = { context: U, user: _, plugins: J }, P = Fn(function(h) {
2452
+ for (var g = Object.keys(h), S = {}, C = 0; C < g.length; C++) {
2453
+ var $ = g[C];
2454
+ typeof h[$] === ne && (S[$] = h[$]);
2132
2455
  }
2133
- var $, W = Object.keys(S);
2456
+ var z, W = Object.keys(S);
2134
2457
  try {
2135
2458
  (function(N) {
2136
- Object.keys(N).forEach(function(Z) {
2137
- var z = N[Z];
2138
- if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type: Qr }) === ee)
2139
- throw new Error("reducer " + Z + " " + ee);
2459
+ Object.keys(N).forEach(function(R) {
2460
+ var A = N[R];
2461
+ if (typeof A(void 0, { type: "@@redux/INIT" }) === ee || typeof A(void 0, { type: Pi }) === ee)
2462
+ throw new Error("reducer " + R + " " + ee);
2140
2463
  });
2141
2464
  })(S);
2142
2465
  } catch (N) {
2143
- $ = N;
2466
+ z = N;
2144
2467
  }
2145
- return function(N, Z) {
2146
- if (N === void 0 && (N = {}), $)
2147
- throw $;
2148
- for (var z = !1, q = {}, xe = 0; xe < W.length; xe++) {
2149
- var Ue = W[xe], $t = N[Ue], it = (0, S[Ue])($t, Z);
2150
- if (typeof it === ee) {
2151
- var nr = ei(Ue, Z);
2152
- throw new Error(nr);
2468
+ return function(N, R) {
2469
+ if (N === void 0 && (N = {}), z)
2470
+ throw z;
2471
+ for (var A = !1, q = {}, $e = 0; $e < W.length; $e++) {
2472
+ var Ke = W[$e], Lt = N[Ke], ct = (0, S[Ke])(Lt, R);
2473
+ if (typeof ct === ee) {
2474
+ var fr = Ti(Ke, R);
2475
+ throw new Error(fr);
2153
2476
  }
2154
- q[Ue] = it, z = z || it !== $t;
2477
+ q[Ke] = ct, A = A || ct !== Lt;
2155
2478
  }
2156
- return z ? q : N;
2479
+ return A ? q : N;
2157
2480
  };
2158
- }(E({}, C, e)), R, D(x(ti.apply(void 0, A))));
2159
- P.dispatch = (X = P.dispatch, function(l, p, S) {
2160
- var T = E({}, l, { meta: cn(l.meta, p, ht(S)) });
2161
- return X.apply(null, [T]);
2481
+ }(O({}, x, e)), Z, D(j(ji.apply(void 0, T))));
2482
+ P.dispatch = (F = P.dispatch, function(h, g, S) {
2483
+ var C = O({}, h, { meta: pn(h.meta, g, gt(S)) });
2484
+ return F.apply(null, [C]);
2162
2485
  });
2163
2486
  var K = Object.keys(a);
2164
- P.dispatch({ type: O.bootstrap, plugins: K, config: U, params: y, user: _, initialUser: n, persistedUser: k });
2165
- var M = K.filter(function(l) {
2166
- return r.pluginEnabled[l];
2167
- }), Pe = K.filter(function(l) {
2168
- return !r.pluginEnabled[l];
2487
+ P.dispatch({ type: E.bootstrap, plugins: K, config: U, params: w, user: _, initialUser: n, persistedUser: I });
2488
+ var M = K.filter(function(h) {
2489
+ return r.pluginEnabled[h];
2490
+ }), Ce = K.filter(function(h) {
2491
+ return !r.pluginEnabled[h];
2169
2492
  });
2170
- return P.dispatch({ type: O.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(l, p) {
2171
- var S = l.bootstrap, T = l.config, j = l.name;
2172
- S && G(S) && S({ instance: b, config: T, payload: l }), P.dispatch({ type: O.registerPluginType(j), name: j, enabled: r.pluginEnabled[j], plugin: l }), r.pluginsArray.length === p + 1 && P.dispatch({ type: O.initializeStart, plugins: M, disabled: Pe });
2173
- }), ki(function(l) {
2174
- P.dispatch({ type: l ? O.offline : O.online });
2175
- }), function(l, p, S) {
2493
+ return P.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(h, g) {
2494
+ var S = h.bootstrap, C = h.config, $ = h.name;
2495
+ S && B(S) && S({ instance: b, config: C, payload: h }), P.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: h }), r.pluginsArray.length === g + 1 && P.dispatch({ type: E.initializeStart, plugins: M, disabled: Ce });
2496
+ }), Yi(function(h) {
2497
+ P.dispatch({ type: h ? E.offline : E.online });
2498
+ }), function(h, g, S) {
2176
2499
  setInterval(function() {
2177
- return Ln(l, p, S);
2500
+ return Hn(h, g, S);
2178
2501
  }, 3e3);
2179
2502
  }(P, u, b), b;
2180
2503
  }
2181
- var Me = "before", Xe = "after", ze = "cookie", ce = Jn(), Vn = nt, Si = nt;
2182
- function Fn(t) {
2183
- return ce ? nt(t, "", -1) : Oe(t);
2504
+ var He = "before", Ve = "after", De = "cookie", ce = ir(), nr = at, Bi = at;
2505
+ function rr(t) {
2506
+ return ce ? at(t, "", -1) : je(t);
2184
2507
  }
2185
- function Jn() {
2508
+ function ir() {
2186
2509
  if (ce !== void 0)
2187
2510
  return ce;
2188
2511
  var t = "cookiecookie";
2189
2512
  try {
2190
- nt(t, t), ce = document.cookie.indexOf(t) !== -1, Fn(t);
2513
+ at(t, t), ce = document.cookie.indexOf(t) !== -1, rr(t);
2191
2514
  } catch {
2192
2515
  ce = !1;
2193
2516
  }
2194
2517
  return ce;
2195
2518
  }
2196
- function nt(t, e, n, r, i, o) {
2519
+ function at(t, e, n, r, i, o) {
2197
2520
  if (typeof window < "u") {
2198
2521
  var a = arguments.length > 1;
2199
- return ce === !1 && (a ? me(t, e) : pe(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
2200
- }
2201
- }
2202
- var Ne = "localStorage", _i = Ot.bind(null, "localStorage");
2203
- Ee("localStorage", "getItem", pe);
2204
- Ee("localStorage", "setItem", me);
2205
- Ee("localStorage", "removeItem", Oe);
2206
- var Ae = "sessionStorage", Oi = Ot.bind(null, "sessionStorage");
2207
- Ee("sessionStorage", "getItem", pe);
2208
- Ee("sessionStorage", "setItem", me);
2209
- Ee("sessionStorage", "removeItem", Oe);
2210
- function ke(t) {
2522
+ return ce === !1 && (a ? ye(t, e) : ge(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
2523
+ }
2524
+ }
2525
+ var Ue = "localStorage", qi = jt.bind(null, "localStorage");
2526
+ xe("localStorage", "getItem", ge);
2527
+ xe("localStorage", "setItem", ye);
2528
+ xe("localStorage", "removeItem", je);
2529
+ var Re = "sessionStorage", Qi = jt.bind(null, "sessionStorage");
2530
+ xe("sessionStorage", "getItem", ge);
2531
+ xe("sessionStorage", "setItem", ye);
2532
+ xe("sessionStorage", "removeItem", je);
2533
+ function Se(t) {
2211
2534
  var e = t;
2212
2535
  try {
2213
2536
  if ((e = JSON.parse(t)) === "true")
2214
2537
  return !0;
2215
2538
  if (e === "false")
2216
2539
  return !1;
2217
- if (F(e))
2540
+ if (H(e))
2218
2541
  return e;
2219
2542
  parseFloat(e) === e && (e = parseFloat(e));
2220
2543
  } catch {
@@ -2222,57 +2545,57 @@ function ke(t) {
2222
2545
  if (e !== null && e !== "")
2223
2546
  return e;
2224
2547
  }
2225
- var Ei = _i(), Pi = Oi(), xi = Jn();
2226
- function Hn(t, e) {
2548
+ var eo = qi(), to = Qi(), no = ir();
2549
+ function or(t, e) {
2227
2550
  if (t) {
2228
- var n = Et(e), r = !jt(n), i = Pt(n) ? ke(localStorage.getItem(t)) : void 0;
2229
- if (r && !ve(i))
2551
+ var n = xt(e), r = !At(n), i = Ct(n) ? Se(localStorage.getItem(t)) : void 0;
2552
+ if (r && !be(i))
2230
2553
  return i;
2231
- var o = xt(n) ? ke(Vn(t)) : void 0;
2554
+ var o = $t(n) ? Se(nr(t)) : void 0;
2232
2555
  if (r && o)
2233
2556
  return o;
2234
- var a = Tt(n) ? ke(sessionStorage.getItem(t)) : void 0;
2557
+ var a = zt(n) ? Se(sessionStorage.getItem(t)) : void 0;
2235
2558
  if (r && a)
2236
2559
  return a;
2237
- var s = pe(t);
2560
+ var s = ge(t);
2238
2561
  return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
2239
2562
  }
2240
2563
  }
2241
- function Ti(t, e, n) {
2242
- if (t && !ve(e)) {
2243
- var r = {}, i = Et(n), o = JSON.stringify(e), a = !jt(i);
2244
- return Pt(i) && (r[Ne] = Ve(Ne, e, ke(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ne] : xt(i) && (r[ze] = Ve(ze, e, ke(Vn(t))), Si(t, o), a) ? r[ze] : Tt(i) && (r[Ae] = Ve(Ae, e, ke(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ae] : (r[$e] = Ve($e, e, pe(t)), me(t, e), a ? r[$e] : r);
2564
+ function ro(t, e, n) {
2565
+ if (t && !be(e)) {
2566
+ var r = {}, i = xt(n), o = JSON.stringify(e), a = !At(i);
2567
+ return Ct(i) && (r[Ue] = Ye(Ue, e, Se(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ue] : $t(i) && (r[De] = Ye(De, e, Se(nr(t))), Bi(t, o), a) ? r[De] : zt(i) && (r[Re] = Ye(Re, e, Se(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Re] : (r[Le] = Ye(Le, e, ge(t)), ye(t, e), a ? r[Le] : r);
2245
2568
  }
2246
2569
  }
2247
- function ji(t, e) {
2570
+ function io(t, e) {
2248
2571
  if (t) {
2249
- var n = Et(e), r = Hn(t, Tn), i = {};
2250
- return !ve(r.localStorage) && Pt(n) && (localStorage.removeItem(t), i[Ne] = r.localStorage), !ve(r.cookie) && xt(n) && (Fn(t), i[ze] = r.cookie), !ve(r.sessionStorage) && Tt(n) && (sessionStorage.removeItem(t), i[Ae] = r.sessionStorage), !ve(r.global) && rt(n, $e) && (Oe(t), i[$e] = r.global), i;
2572
+ var n = xt(e), r = or(t, Zn), i = {};
2573
+ return !be(r.localStorage) && Ct(n) && (localStorage.removeItem(t), i[Ue] = r.localStorage), !be(r.cookie) && $t(n) && (rr(t), i[De] = r.cookie), !be(r.sessionStorage) && zt(n) && (sessionStorage.removeItem(t), i[Re] = r.sessionStorage), !be(r.global) && st(n, Le) && (je(t), i[Le] = r.global), i;
2251
2574
  }
2252
2575
  }
2253
- function Et(t) {
2254
- return t ? re(t) ? t : t.storage : xn;
2576
+ function xt(t) {
2577
+ return t ? re(t) ? t : t.storage : Rn;
2255
2578
  }
2256
- function Pt(t) {
2257
- return Ei && rt(t, Ne);
2579
+ function Ct(t) {
2580
+ return eo && st(t, Ue);
2258
2581
  }
2259
- function xt(t) {
2260
- return xi && rt(t, ze);
2582
+ function $t(t) {
2583
+ return no && st(t, De);
2261
2584
  }
2262
- function Tt(t) {
2263
- return Pi && rt(t, Ae);
2585
+ function zt(t) {
2586
+ return to && st(t, Re);
2264
2587
  }
2265
- function jt(t) {
2266
- return t === Tn || t === "all";
2588
+ function At(t) {
2589
+ return t === Zn || t === "all";
2267
2590
  }
2268
- function rt(t, e) {
2269
- return t === xn || t === e || jt(t);
2591
+ function st(t, e) {
2592
+ return t === Rn || t === e || At(t);
2270
2593
  }
2271
- function Ve(t, e, n) {
2594
+ function Ye(t, e, n) {
2272
2595
  return { location: t, current: e, previous: n };
2273
2596
  }
2274
- var Ci = { setItem: Ti, getItem: Hn, removeItem: ji };
2275
- function $i(t, e, n) {
2597
+ var oo = { setItem: ro, getItem: or, removeItem: io };
2598
+ function ao(t, e, n) {
2276
2599
  return e in t ? Object.defineProperty(t, e, {
2277
2600
  value: n,
2278
2601
  enumerable: !0,
@@ -2280,7 +2603,7 @@ function $i(t, e, n) {
2280
2603
  writable: !0
2281
2604
  }) : t[e] = n, t;
2282
2605
  }
2283
- function un(t, e) {
2606
+ function mn(t, e) {
2284
2607
  var n = Object.keys(t);
2285
2608
  if (Object.getOwnPropertySymbols) {
2286
2609
  var r = Object.getOwnPropertySymbols(t);
@@ -2290,24 +2613,24 @@ function un(t, e) {
2290
2613
  }
2291
2614
  return n;
2292
2615
  }
2293
- function ln(t) {
2616
+ function gn(t) {
2294
2617
  for (var e = 1; e < arguments.length; e++) {
2295
2618
  var n = arguments[e] != null ? arguments[e] : {};
2296
- e % 2 ? un(Object(n), !0).forEach(function(r) {
2297
- $i(t, r, n[r]);
2298
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : un(Object(n)).forEach(function(r) {
2619
+ e % 2 ? mn(Object(n), !0).forEach(function(r) {
2620
+ ao(t, r, n[r]);
2621
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : mn(Object(n)).forEach(function(r) {
2299
2622
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
2300
2623
  });
2301
2624
  }
2302
2625
  return t;
2303
2626
  }
2304
- function zi() {
2627
+ function so() {
2305
2628
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
2306
- storage: Ci
2629
+ storage: oo
2307
2630
  };
2308
- return Ii(ln(ln({}, e), t));
2631
+ return Gi(gn(gn({}, e), t));
2309
2632
  }
2310
- function Ni(t, e) {
2633
+ function co(t, e) {
2311
2634
  e = e || {};
2312
2635
  var n, r, i = [], o = e.max || 1 / 0;
2313
2636
  function a() {
@@ -2318,75 +2641,75 @@ function Ni(t, e) {
2318
2641
  }
2319
2642
  return s(), {
2320
2643
  flush: a,
2321
- push: function(f) {
2322
- return r = i.push(f), r >= o && a(), r;
2644
+ push: function(p) {
2645
+ return r = i.push(p), r >= o && a(), r;
2323
2646
  },
2324
2647
  size: function() {
2325
2648
  return i.length;
2326
2649
  },
2327
- end: function(f) {
2328
- f && a(), clearInterval(n);
2650
+ end: function(p) {
2651
+ p && a(), clearInterval(n);
2329
2652
  }
2330
2653
  };
2331
2654
  }
2332
- const Yn = "@sesamy/sesamy-js", Gn = "1.0.2";
2333
- function Ai(t) {
2655
+ const ar = "@sesamy/sesamy-js", sr = "1.0.3";
2656
+ function uo(t) {
2334
2657
  if (!(typeof window > "u")) {
2335
2658
  var e = window, n = e.addEventListener, r = e.history, i = e.location, o = i.pathname;
2336
2659
  n("popstate", function() {
2337
2660
  return t(i.pathname);
2338
2661
  }), ["push", "replace"].map(function(a) {
2339
- var s = "".concat(a, "State"), f = r[s];
2662
+ var s = "".concat(a, "State"), p = r[s];
2340
2663
  r[s] = function() {
2341
- var m = arguments, u = Di(arguments[2]);
2664
+ var m = arguments, u = ho(arguments[2]);
2342
2665
  return o !== u && (o = u, setTimeout(function() {
2343
2666
  return t(m[2]);
2344
- }, 0)), f.apply(r, arguments);
2667
+ }, 0)), p.apply(r, arguments);
2345
2668
  };
2346
2669
  });
2347
2670
  }
2348
2671
  }
2349
- function Li(t, e) {
2672
+ function lo(t, e) {
2350
2673
  var n = t.indexOf(e);
2351
2674
  return n > -1 ? t.slice(0, n) : t;
2352
2675
  }
2353
- function Di(t) {
2676
+ function ho(t) {
2354
2677
  return ["#", "?"].forEach(function(e) {
2355
- return t = Li(t, e);
2678
+ return t = lo(t, e);
2356
2679
  }), t;
2357
2680
  }
2358
- function Ui() {
2359
- Ai(() => {
2681
+ function fo() {
2682
+ uo(() => {
2360
2683
  ae.page();
2361
2684
  });
2362
2685
  }
2363
- var dn = "EventListener";
2364
- function Zi(t) {
2686
+ var yn = "EventListener";
2687
+ function po(t) {
2365
2688
  return function(e, n, r, i) {
2366
- var o = r || Ur, a = i || !1;
2367
- if (!H)
2689
+ var o = r || hi, a = i || !1;
2690
+ if (!Y)
2368
2691
  return o;
2369
- var s = Be(n), f = Be(e, !0);
2370
- if (!f.length)
2692
+ var s = tt(n), p = tt(e, !0);
2693
+ if (!p.length)
2371
2694
  throw new Error("noElements");
2372
2695
  if (!s.length)
2373
2696
  throw new Error("noEvent");
2374
2697
  var m = [];
2375
2698
  return function u(c) {
2376
2699
  c && (m = []);
2377
- for (var d = c ? "add" + dn : "remove" + dn, h = 0; h < f.length; h++) {
2378
- var v = f[h];
2379
- m[h] = c ? a && a.once ? Ri(o) : o : m[h] || o;
2380
- for (var w = 0; w < s.length; w++)
2381
- v[d] ? v["on" + s[w]] = c ? m[h] : null : v[d](s[w], m[h], a);
2700
+ for (var f = c ? "add" + yn : "remove" + yn, d = 0; d < p.length; d++) {
2701
+ var v = p[d];
2702
+ m[d] = c ? a && a.once ? mo(o) : o : m[d] || o;
2703
+ for (var k = 0; k < s.length; k++)
2704
+ v[f] ? v["on" + s[k]] = c ? m[d] : null : v[f](s[k], m[d], a);
2382
2705
  }
2383
2706
  return u.bind(null, !c);
2384
2707
  }(t);
2385
2708
  };
2386
2709
  }
2387
- function Be(t, e) {
2710
+ function tt(t, e) {
2388
2711
  if (re(t))
2389
- return e ? Be(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
2712
+ return e ? tt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
2390
2713
  return a.trim();
2391
2714
  });
2392
2715
  var n;
@@ -2395,31 +2718,31 @@ function Be(t, e) {
2395
2718
  r[i] = t[i];
2396
2719
  return r;
2397
2720
  }
2398
- var o = Hr(t);
2721
+ var o = Ii(t);
2399
2722
  return e ? o.map(function(a) {
2400
- return re(a) ? Be(a, !0) : a;
2723
+ return re(a) ? tt(a, !0) : a;
2401
2724
  }).flat() : o;
2402
2725
  }
2403
- function Ri(t, e) {
2726
+ function mo(t, e) {
2404
2727
  var n;
2405
2728
  return function() {
2406
2729
  return t && (n = t.apply(e || this, arguments), t = null), n;
2407
2730
  };
2408
2731
  }
2409
- var ft = Zi("Event");
2410
- function Bn(t, e) {
2411
- return H && G(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), G(n) ? function() {
2732
+ var yt = po("Event");
2733
+ function cr(t, e) {
2734
+ return Y && B(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), B(n) ? function() {
2412
2735
  n.apply(i, arguments), r.apply(i, arguments);
2413
2736
  } : r) : window[t] = e;
2414
2737
  var n, r, i;
2415
2738
  }
2416
- Bn.bind(null, "onerror");
2417
- Bn.bind(null, "onload");
2418
- var qn = typeof window > "u", hn = "hidden";
2419
- function Wi(t) {
2420
- if (qn)
2739
+ cr.bind(null, "onerror");
2740
+ cr.bind(null, "onload");
2741
+ var ur = typeof window > "u", vn = "hidden";
2742
+ function go(t) {
2743
+ if (ur)
2421
2744
  return !1;
2422
- var e = Ki(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2745
+ var e = yo(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2423
2746
  return t(!!document[e]);
2424
2747
  }, i = function() {
2425
2748
  return document.addEventListener(n, r);
@@ -2428,31 +2751,31 @@ function Wi(t) {
2428
2751
  return document.removeEventListener(n, r), i;
2429
2752
  };
2430
2753
  }
2431
- function Ki() {
2754
+ function yo() {
2432
2755
  var t = ["webkit", "moz", "ms", "o"];
2433
- return qn || hn in document ? hn : t.reduce(function(e, n) {
2756
+ return ur || vn in document ? vn : t.reduce(function(e, n) {
2434
2757
  var r = n + "Hidden";
2435
2758
  return !e && r in document ? r : e;
2436
2759
  }, null);
2437
2760
  }
2438
- var Mi = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2439
- function Xi(t, e) {
2761
+ var vo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2762
+ function wo(t, e) {
2440
2763
  e === void 0 && (e = {});
2441
2764
  var n = /* @__PURE__ */ function(a, s) {
2442
- var f = this, m = !1;
2765
+ var p = this, m = !1;
2443
2766
  return function(u) {
2444
- m || (a.call(f, u), m = !0, setTimeout(function() {
2767
+ m || (a.call(p, u), m = !0, setTimeout(function() {
2445
2768
  return m = !1;
2446
2769
  }, s));
2447
2770
  };
2448
2771
  }(t, e.throttle || 1e4), r = [];
2449
2772
  function i() {
2450
- var a = Wi(function(s) {
2773
+ var a = go(function(s) {
2451
2774
  s || n({ type: "tabVisible" });
2452
2775
  });
2453
- return r = [a].concat(Mi.map(function(s) {
2454
- return ft(document, s, n);
2455
- })).concat(ft(window, "load", n)).concat(ft(window, "scroll", n, { capture: !0, passive: !0 })), o;
2776
+ return r = [a].concat(vo.map(function(s) {
2777
+ return yt(document, s, n);
2778
+ })).concat(yt(window, "load", n)).concat(yt(window, "scroll", n, { capture: !0, passive: !0 })), o;
2456
2779
  }
2457
2780
  function o() {
2458
2781
  r.map(function(a) {
@@ -2463,42 +2786,42 @@ function Xi(t, e) {
2463
2786
  return o(), i;
2464
2787
  };
2465
2788
  }
2466
- function Vi(t) {
2467
- var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, f = t.throttle, m = f === void 0 ? 2e3 : f, u = !1, c = !1, d = /* @__PURE__ */ new Date(), h = function() {
2789
+ function bo(t) {
2790
+ var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, p = t.throttle, m = p === void 0 ? 2e3 : p, u = !1, c = !1, f = /* @__PURE__ */ new Date(), d = function() {
2468
2791
  return clearTimeout(e);
2469
2792
  };
2470
- function v(y) {
2471
- h(), o && !u && o(je(d), y), i && u && (u = !1, i(je(n), y), d = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2472
- u = !0, r && (n = /* @__PURE__ */ new Date(), r(je(d), y));
2793
+ function v(w) {
2794
+ d(), o && !u && o(Ae(f), w), i && u && (u = !1, i(Ae(n), w), f = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2795
+ u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ae(f), w));
2473
2796
  }, s);
2474
2797
  }
2475
- var w = Xi(v, { throttle: m });
2798
+ var k = wo(v, { throttle: m });
2476
2799
  return { disable: function() {
2477
- c = !0, u = !1, h();
2478
- var y = w();
2800
+ c = !0, u = !1, d();
2801
+ var w = k();
2479
2802
  return function() {
2480
- return c = !1, d = /* @__PURE__ */ new Date(), v({ type: "load" }), y();
2803
+ return c = !1, f = /* @__PURE__ */ new Date(), v({ type: "load" }), w();
2481
2804
  };
2482
2805
  }, getStatus: function() {
2483
- return { isIdle: u, isDisabled: c, active: u ? 0 : je(d, c), idle: u ? je(n, c) : 0 };
2806
+ return { isIdle: u, isDisabled: c, active: u ? 0 : Ae(f, c), idle: u ? Ae(n, c) : 0 };
2484
2807
  } };
2485
2808
  }
2486
- function je(t, e) {
2809
+ function Ae(t, e) {
2487
2810
  return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
2488
2811
  }
2489
- const fn = 5e3;
2490
- class Fi {
2812
+ const wn = 5e3;
2813
+ class ko {
2491
2814
  constructor(e) {
2492
- Y(this, "element");
2493
- Y(this, "isInViewport", !1);
2494
- Y(this, "isAwake", !1);
2495
- Y(this, "isFlushing");
2496
- Y(this, "observer");
2497
- Y(this, "lastEventAt", Date.now());
2498
- Y(this, "registeredView", !1);
2499
- Y(this, "viewCallback");
2500
- Y(this, "activeDurationCallback");
2501
- Y(this, "idleDurationCallback");
2815
+ G(this, "element");
2816
+ G(this, "isInViewport", !1);
2817
+ G(this, "isAwake", !1);
2818
+ G(this, "isFlushing");
2819
+ G(this, "observer");
2820
+ G(this, "lastEventAt", Date.now());
2821
+ G(this, "registeredView", !1);
2822
+ G(this, "viewCallback");
2823
+ G(this, "activeDurationCallback");
2824
+ G(this, "idleDurationCallback");
2502
2825
  this.element = e.element, this.viewCallback = e.viewCallback, this.activeDurationCallback = e.activeDurationCallback, this.idleDurationCallback = e.idleDurationCallback, this.observer = new IntersectionObserver(
2503
2826
  (n) => {
2504
2827
  n.forEach((r) => {
@@ -2508,10 +2831,10 @@ class Fi {
2508
2831
  {
2509
2832
  threshold: 0
2510
2833
  }
2511
- ), this.observer.observe(this.element), Vi({
2834
+ ), this.observer.observe(this.element), bo({
2512
2835
  onIdle: (n) => this.handleAwake(!1, n),
2513
2836
  onWakeUp: (n) => this.handleAwake(!0, n),
2514
- timeout: fn
2837
+ timeout: wn
2515
2838
  });
2516
2839
  }
2517
2840
  /**
@@ -2530,7 +2853,7 @@ class Fi {
2530
2853
  ), this.isInViewport = e;
2531
2854
  }
2532
2855
  handleAwake(e, n) {
2533
- this.isAwake = e, this.lastEventAt = e ? Date.now() - n * fn : Date.now(), this.isInViewport && this.trackAwake(e, n);
2856
+ this.isAwake = e, this.lastEventAt = e ? Date.now() - n * wn : Date.now(), this.isInViewport && this.trackAwake(e, n);
2534
2857
  }
2535
2858
  trackAwake(e, n) {
2536
2859
  !e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
@@ -2539,21 +2862,21 @@ class Fi {
2539
2862
  this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
2540
2863
  }
2541
2864
  }
2542
- const pn = "sesamy_session_id";
2543
- function Ji() {
2544
- let t = sessionStorage.getItem(pn);
2545
- return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(pn, t)), t;
2865
+ const bn = "sesamy_session_id";
2866
+ function Io() {
2867
+ let t = sessionStorage.getItem(bn);
2868
+ return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(bn, t)), t;
2546
2869
  }
2547
- let Qn = !1, kt, mn, qe;
2548
- function Hi({
2870
+ let lr = !1, Et, kn, nt;
2871
+ function _o({
2549
2872
  clientId: t,
2550
2873
  enabled: e = !0,
2551
- endpoint: n = Cr
2874
+ endpoint: n = Wr
2552
2875
  }) {
2553
- if (kt = t, mn = e, qe = n, !mn)
2876
+ if (Et = t, kn = e, nt = n, !kn)
2554
2877
  return;
2555
- Ui();
2556
- const r = new Fi({
2878
+ fo();
2879
+ const r = new ko({
2557
2880
  element: document.body,
2558
2881
  viewCallback: () => {
2559
2882
  ae.page();
@@ -2571,24 +2894,24 @@ function Hi({
2571
2894
  });
2572
2895
  }
2573
2896
  });
2574
- Gi(document.body, () => {
2897
+ Eo(document.body, () => {
2575
2898
  r.flush();
2576
- }), window.addEventListener(he.AUTHENTICATED, async (i) => {
2899
+ }), window.addEventListener(fe.AUTHENTICATED, async (i) => {
2577
2900
  const o = i;
2578
2901
  await ae.identify(o.detail.sub);
2579
- }), window.addEventListener(he.LOGOUT, async () => {
2580
- await ae.track("logout", {}), Ct.flush(), await ae.reset();
2902
+ }), window.addEventListener(fe.LOGOUT, async () => {
2903
+ await ae.track("logout", {}), Nt.flush(), await ae.reset();
2581
2904
  });
2582
2905
  }
2583
- function er(t) {
2906
+ function dr(t) {
2584
2907
  return JSON.stringify(
2585
2908
  t.map((e) => ({
2586
2909
  ...e,
2587
- clientId: kt,
2910
+ clientId: Et,
2588
2911
  requestId: Math.random().toString(36).slice(2, 9),
2589
- sessionId: Ji(),
2912
+ sessionId: Io(),
2590
2913
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2591
- version: Gn,
2914
+ version: sr,
2592
2915
  event: e.event,
2593
2916
  context: {
2594
2917
  page: {
@@ -2599,18 +2922,18 @@ function er(t) {
2599
2922
  referrer: document.referrer
2600
2923
  },
2601
2924
  locale: navigator.language,
2602
- library: Yn,
2925
+ library: ar,
2603
2926
  userAgent: navigator.userAgent,
2604
- clientId: kt
2927
+ clientId: Et
2605
2928
  }
2606
2929
  }))
2607
2930
  );
2608
2931
  }
2609
- const Ct = Ni(
2932
+ const Nt = co(
2610
2933
  async (t) => {
2611
2934
  if (t.length > 0) {
2612
- const e = er(t);
2613
- Qn ? navigator.sendBeacon(qe, e) : (await fetch(qe, {
2935
+ const e = dr(t);
2936
+ lr ? navigator.sendBeacon(nt, e) : (await fetch(nt, {
2614
2937
  method: "POST",
2615
2938
  body: e,
2616
2939
  headers: {
@@ -2626,24 +2949,24 @@ const Ct = Ni(
2626
2949
  // 3s
2627
2950
  }
2628
2951
  );
2629
- function pt(t) {
2952
+ function vt(t) {
2630
2953
  var e;
2631
2954
  if (t.anonymousId)
2632
2955
  if ((e = t.properties) != null && e.flushing) {
2633
2956
  const n = { ...t };
2634
- delete n.properties.flushing, navigator.sendBeacon(qe, er([n]));
2957
+ delete n.properties.flushing, navigator.sendBeacon(nt, dr([n]));
2635
2958
  } else
2636
- Ct.push(t);
2959
+ Nt.push(t);
2637
2960
  }
2638
- const ae = zi({
2639
- app: Yn,
2640
- version: Gn,
2961
+ const ae = so({
2962
+ app: ar,
2963
+ version: sr,
2641
2964
  plugins: [
2642
2965
  {
2643
2966
  name: "custom-analytics-plugin",
2644
2967
  page: ({ payload: t }) => {
2645
2968
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
2646
- pt({
2969
+ vt({
2647
2970
  anonymousId: n,
2648
2971
  userId: r,
2649
2972
  properties: e,
@@ -2653,7 +2976,7 @@ const ae = zi({
2653
2976
  },
2654
2977
  track: ({ payload: t }) => {
2655
2978
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
2656
- pt({
2979
+ vt({
2657
2980
  anonymousId: n,
2658
2981
  userId: r,
2659
2982
  properties: e,
@@ -2663,7 +2986,7 @@ const ae = zi({
2663
2986
  },
2664
2987
  identify: ({ payload: t }) => {
2665
2988
  const { properties: e, anonymousId: n, userId: r } = t;
2666
- pt({
2989
+ vt({
2667
2990
  anonymousId: n,
2668
2991
  userId: r,
2669
2992
  properties: e,
@@ -2673,45 +2996,45 @@ const ae = zi({
2673
2996
  }
2674
2997
  ]
2675
2998
  });
2676
- function Yi() {
2677
- return Qn = !0, Ct.flush();
2999
+ function So() {
3000
+ return lr = !0, Nt.flush();
2678
3001
  }
2679
- const tr = /* @__PURE__ */ new Map();
2680
- function Gi(t, e) {
2681
- tr.set(t, e);
3002
+ const hr = /* @__PURE__ */ new Map();
3003
+ function Eo(t, e) {
3004
+ hr.set(t, e);
2682
3005
  }
2683
3006
  window.addEventListener("beforeunload", () => {
2684
- tr.forEach((t, e) => {
3007
+ hr.forEach((t, e) => {
2685
3008
  t.bind(e)();
2686
- }), Yi();
3009
+ }), So();
2687
3010
  });
2688
- async function Bi(t) {
2689
- Hi({
3011
+ async function Oo(t) {
3012
+ _o({
2690
3013
  clientId: t.clientId,
2691
3014
  // The default client id can be overridden by the config
2692
3015
  ...t.analytics
2693
- }), await $r(t), Dr(t.namespace), It(he.READY, {});
3016
+ }), await Kr(t), di(t.namespace), Ot(fe.READY, {});
2694
3017
  }
2695
- const Fe = document.getElementById("sesamy-js");
2696
- if (Fe != null && Fe.textContent)
3018
+ const Ge = document.getElementById("sesamy-js");
3019
+ if (Ge != null && Ge.textContent)
2697
3020
  try {
2698
- const t = JSON.parse(Fe.textContent);
2699
- Bi(t);
3021
+ const t = JSON.parse(Ge.textContent);
3022
+ Oo(t);
2700
3023
  } catch (t) {
2701
3024
  console.error("Failed to parse config", t);
2702
3025
  }
2703
- const qi = "/sesamy.png";
2704
- class Qi extends HTMLElement {
3026
+ const Po = "/sesamy.png";
3027
+ class To extends HTMLElement {
2705
3028
  constructor() {
2706
3029
  super();
2707
- Y(this, "user");
3030
+ G(this, "user");
2708
3031
  }
2709
3032
  async _handleProfile() {
2710
3033
  this.user = await window.sesamy.getUser(), this.render();
2711
3034
  }
2712
3035
  async connectedCallback() {
2713
3036
  if (this.setupEventListeners(), !window.sesamy) {
2714
- window.addEventListener(he.READY, () => this._handleProfile());
3037
+ window.addEventListener(fe.READY, () => this._handleProfile());
2715
3038
  return;
2716
3039
  }
2717
3040
  this._handleProfile();
@@ -2720,7 +3043,7 @@ class Qi extends HTMLElement {
2720
3043
  this.innerHTML = `
2721
3044
  <div>
2722
3045
  <a href="https://docs.sesamy.com" target="_blank">
2723
- <img src="${qi}" class="logo" alt="Vite logo" />
3046
+ <img src="${Po}" class="logo" alt="Vite logo" />
2724
3047
  </a>
2725
3048
  <h1>Sesamy JS</h1>
2726
3049
  <p class="read-the-docs">
@@ -2749,6 +3072,11 @@ class Qi extends HTMLElement {
2749
3072
  <div class="logout-wrap">
2750
3073
  <a href="#" class="logout-btn" id="logout-btn"> Logout </a>
2751
3074
  </div>
3075
+ <div>
3076
+ <a href="/entitlements.html">
3077
+ View Entitlements
3078
+ </a>
3079
+ </div>
2752
3080
  </div>`;
2753
3081
  }
2754
3082
  setupEventListeners() {
@@ -2758,4 +3086,4 @@ class Qi extends HTMLElement {
2758
3086
  });
2759
3087
  }
2760
3088
  }
2761
- customElements.define("sesamy-app", Qi);
3089
+ customElements.define("sesamy-app", To);