@sesamy/sesamy-js 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +4 -2
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +974 -967
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (t, e, n) => (
|
|
1
|
+
var Ur = Object.defineProperty;
|
|
2
|
+
var zr = (t, e, n) => e in t ? Ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var q = (t, e, n) => (zr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
function ue(t, e) {
|
|
5
5
|
const n = new CustomEvent(t, {
|
|
6
6
|
detail: e,
|
|
@@ -21,13 +21,13 @@ function ne(t, e) {
|
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
23
|
var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
24
|
-
function
|
|
24
|
+
function At(t) {
|
|
25
25
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function $t(t, e) {
|
|
28
28
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
29
29
|
}
|
|
30
|
-
var de =
|
|
30
|
+
var de = $t(function(t, e) {
|
|
31
31
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
32
32
|
var n = function() {
|
|
33
33
|
function r() {
|
|
@@ -58,48 +58,48 @@ var de = At(function(t, e) {
|
|
|
58
58
|
return n.getInstance();
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var n = he && he.__awaiter || function(u, c,
|
|
64
|
-
return new (
|
|
61
|
+
At(de);
|
|
62
|
+
var Rr = At($t(function(t, e) {
|
|
63
|
+
var n = he && he.__awaiter || function(u, c, m, d) {
|
|
64
|
+
return new (m || (m = Promise))(function(w, k) {
|
|
65
65
|
function v(y) {
|
|
66
66
|
try {
|
|
67
67
|
S(d.next(y));
|
|
68
68
|
} catch (l) {
|
|
69
|
-
|
|
69
|
+
k(l);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function _(y) {
|
|
73
73
|
try {
|
|
74
74
|
S(d.throw(y));
|
|
75
75
|
} catch (l) {
|
|
76
|
-
|
|
76
|
+
k(l);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
function S(y) {
|
|
80
|
-
y.done ? w(y.value) : new
|
|
80
|
+
y.done ? w(y.value) : new m(function(l) {
|
|
81
81
|
l(y.value);
|
|
82
82
|
}).then(v, _);
|
|
83
83
|
}
|
|
84
84
|
S((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
86
|
}, r = he && he.__generator || function(u, c) {
|
|
87
|
-
var
|
|
87
|
+
var m, d, w, k, v = { label: 0, sent: function() {
|
|
88
88
|
if (1 & w[0])
|
|
89
89
|
throw w[1];
|
|
90
90
|
return w[1];
|
|
91
91
|
}, trys: [], ops: [] };
|
|
92
|
-
return
|
|
92
|
+
return k = { next: _(0), throw: _(1), return: _(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
|
|
93
93
|
return this;
|
|
94
|
-
}),
|
|
94
|
+
}), k;
|
|
95
95
|
function _(S) {
|
|
96
96
|
return function(y) {
|
|
97
97
|
return function(l) {
|
|
98
|
-
if (
|
|
98
|
+
if (m)
|
|
99
99
|
throw new TypeError("Generator is already executing.");
|
|
100
100
|
for (; v; )
|
|
101
101
|
try {
|
|
102
|
-
if (
|
|
102
|
+
if (m = 1, d && (w = 2 & l[0] ? d.return : l[0] ? d.throw || ((w = d.return) && w.call(d), 0) : d.next) && !(w = w.call(d, l[1])).done)
|
|
103
103
|
return w;
|
|
104
104
|
switch (d = 0, w && (l = [2 & l[0], w.value]), l[0]) {
|
|
105
105
|
case 0:
|
|
@@ -135,10 +135,10 @@ var Ur = xt(At(function(t, e) {
|
|
|
135
135
|
continue;
|
|
136
136
|
}
|
|
137
137
|
l = c.call(u, v);
|
|
138
|
-
} catch (
|
|
139
|
-
l = [6,
|
|
138
|
+
} catch (b) {
|
|
139
|
+
l = [6, b], d = 0;
|
|
140
140
|
} finally {
|
|
141
|
-
|
|
141
|
+
m = w = 0;
|
|
142
142
|
}
|
|
143
143
|
if (5 & l[0])
|
|
144
144
|
throw l[1];
|
|
@@ -174,7 +174,7 @@ var Ur = xt(At(function(t, e) {
|
|
|
174
174
|
});
|
|
175
175
|
}, setItem: function(u, c) {
|
|
176
176
|
return n(i, void 0, void 0, function() {
|
|
177
|
-
return r(this, function(
|
|
177
|
+
return r(this, function(m) {
|
|
178
178
|
throw new Error("Unsupported");
|
|
179
179
|
});
|
|
180
180
|
});
|
|
@@ -194,54 +194,54 @@ var Ur = xt(At(function(t, e) {
|
|
|
194
194
|
return setTimeout(c, u);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",
|
|
199
|
-
|
|
200
|
-
return
|
|
197
|
+
function f(u) {
|
|
198
|
+
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", m = "", d = 0; d < u; d++)
|
|
199
|
+
m += c[Math.floor(Math.random() * c.length)];
|
|
200
|
+
return m;
|
|
201
201
|
}
|
|
202
|
-
var
|
|
202
|
+
var p = function() {
|
|
203
203
|
function u(c) {
|
|
204
|
-
this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() +
|
|
204
|
+
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 = []);
|
|
205
205
|
}
|
|
206
|
-
return u.prototype.acquireLock = function(c,
|
|
207
|
-
return
|
|
208
|
-
var d, w,
|
|
206
|
+
return u.prototype.acquireLock = function(c, m) {
|
|
207
|
+
return m === void 0 && (m = 5e3), n(this, void 0, void 0, function() {
|
|
208
|
+
var d, w, k, v, _, S, y;
|
|
209
209
|
return r(this, function(l) {
|
|
210
210
|
switch (l.label) {
|
|
211
211
|
case 0:
|
|
212
|
-
d = Date.now() +
|
|
212
|
+
d = Date.now() + f(4), w = Date.now() + m, k = o + "-" + c, v = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
|
|
213
213
|
case 1:
|
|
214
214
|
return Date.now() < w ? [4, s(30)] : [3, 8];
|
|
215
215
|
case 2:
|
|
216
|
-
return l.sent(), v.getItemSync(
|
|
216
|
+
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (_ = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
217
217
|
case 3:
|
|
218
|
-
return l.sent(), v.setItemSync(
|
|
218
|
+
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: _, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
219
219
|
case 4:
|
|
220
|
-
return l.sent(), (S = v.getItemSync(
|
|
220
|
+
return l.sent(), (S = v.getItemSync(k)) !== null && (y = JSON.parse(S)).id === this.id && y.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
|
|
221
221
|
case 5:
|
|
222
222
|
return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(w)];
|
|
223
223
|
case 6:
|
|
224
224
|
l.sent(), l.label = 7;
|
|
225
225
|
case 7:
|
|
226
|
-
return d = Date.now() +
|
|
226
|
+
return d = Date.now() + f(4), [3, 1];
|
|
227
227
|
case 8:
|
|
228
228
|
return [2, !1];
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
});
|
|
232
|
-
}, u.prototype.refreshLockWhileAcquired = function(c,
|
|
232
|
+
}, u.prototype.refreshLockWhileAcquired = function(c, m) {
|
|
233
233
|
return n(this, void 0, void 0, function() {
|
|
234
234
|
var d = this;
|
|
235
235
|
return r(this, function(w) {
|
|
236
236
|
return setTimeout(function() {
|
|
237
237
|
return n(d, void 0, void 0, function() {
|
|
238
|
-
var
|
|
238
|
+
var k, v, _;
|
|
239
239
|
return r(this, function(S) {
|
|
240
240
|
switch (S.label) {
|
|
241
241
|
case 0:
|
|
242
|
-
return [4, de.default().lock(
|
|
242
|
+
return [4, de.default().lock(m)];
|
|
243
243
|
case 1:
|
|
244
|
-
return S.sent(), this.acquiredIatSet.has(
|
|
244
|
+
return S.sent(), this.acquiredIatSet.has(m) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (de.default().unlock(m), [2]) : ((_ = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(_)), de.default().unlock(m), this.refreshLockWhileAcquired(c, m), [2])) : (de.default().unlock(m), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -250,15 +250,15 @@ var Ur = xt(At(function(t, e) {
|
|
|
250
250
|
});
|
|
251
251
|
}, u.prototype.waitForSomethingToChange = function(c) {
|
|
252
252
|
return n(this, void 0, void 0, function() {
|
|
253
|
-
return r(this, function(
|
|
254
|
-
switch (
|
|
253
|
+
return r(this, function(m) {
|
|
254
|
+
switch (m.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
return [4, new Promise(function(d) {
|
|
257
|
-
var w = !1,
|
|
257
|
+
var w = !1, k = Date.now(), v = !1;
|
|
258
258
|
function _() {
|
|
259
259
|
if (v || (window.removeEventListener("storage", _), u.removeFromWaiting(_), clearTimeout(S), v = !0), !w) {
|
|
260
260
|
w = !0;
|
|
261
|
-
var y = 50 - (Date.now() -
|
|
261
|
+
var y = 50 - (Date.now() - k);
|
|
262
262
|
y > 0 ? setTimeout(d, y) : d(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -266,15 +266,15 @@ var Ur = xt(At(function(t, e) {
|
|
|
266
266
|
var S = setTimeout(_, Math.max(0, c - Date.now()));
|
|
267
267
|
})];
|
|
268
268
|
case 1:
|
|
269
|
-
return
|
|
269
|
+
return m.sent(), [2];
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
}, u.addToWaiting = function(c) {
|
|
274
274
|
this.removeFromWaiting(c), u.waiters !== void 0 && u.waiters.push(c);
|
|
275
275
|
}, u.removeFromWaiting = function(c) {
|
|
276
|
-
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(
|
|
277
|
-
return
|
|
276
|
+
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(m) {
|
|
277
|
+
return m !== c;
|
|
278
278
|
}));
|
|
279
279
|
}, u.notifyWaiters = function() {
|
|
280
280
|
u.waiters !== void 0 && u.waiters.slice().forEach(function(c) {
|
|
@@ -282,52 +282,52 @@ var Ur = xt(At(function(t, e) {
|
|
|
282
282
|
});
|
|
283
283
|
}, u.prototype.releaseLock = function(c) {
|
|
284
284
|
return n(this, void 0, void 0, function() {
|
|
285
|
-
return r(this, function(
|
|
286
|
-
switch (
|
|
285
|
+
return r(this, function(m) {
|
|
286
|
+
switch (m.label) {
|
|
287
287
|
case 0:
|
|
288
288
|
return [4, this.releaseLock__private__(c)];
|
|
289
289
|
case 1:
|
|
290
|
-
return [2,
|
|
290
|
+
return [2, m.sent()];
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
});
|
|
294
294
|
}, u.prototype.releaseLock__private__ = function(c) {
|
|
295
295
|
return n(this, void 0, void 0, function() {
|
|
296
|
-
var
|
|
296
|
+
var m, d, w, k;
|
|
297
297
|
return r(this, function(v) {
|
|
298
298
|
switch (v.label) {
|
|
299
299
|
case 0:
|
|
300
|
-
return
|
|
300
|
+
return m = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = m.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4, de.default().lock(k.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
v.sent(), this.acquiredIatSet.delete(
|
|
302
|
+
v.sent(), this.acquiredIatSet.delete(k.iat), m.removeItemSync(d), de.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
}, u.lockCorrector = function(c) {
|
|
309
|
-
for (var
|
|
310
|
-
var v = d.keySync(
|
|
309
|
+
for (var m = Date.now() - 5e3, d = c, w = [], k = 0; ; ) {
|
|
310
|
+
var v = d.keySync(k);
|
|
311
311
|
if (v === null)
|
|
312
312
|
break;
|
|
313
|
-
w.push(v),
|
|
313
|
+
w.push(v), k++;
|
|
314
314
|
}
|
|
315
315
|
for (var _ = !1, S = 0; S < w.length; S++) {
|
|
316
316
|
var y = w[S];
|
|
317
317
|
if (y.includes(o)) {
|
|
318
318
|
var l = d.getItemSync(y);
|
|
319
319
|
if (l !== null) {
|
|
320
|
-
var
|
|
321
|
-
(
|
|
320
|
+
var b = JSON.parse(l);
|
|
321
|
+
(b.timeRefreshed === void 0 && b.timeAcquired < m || b.timeRefreshed !== void 0 && b.timeRefreshed < m) && (d.removeItemSync(y), _ = !0);
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
_ && u.notifyWaiters();
|
|
326
326
|
}, u.waiters = void 0, u;
|
|
327
327
|
}();
|
|
328
|
-
e.default =
|
|
328
|
+
e.default = p;
|
|
329
329
|
}));
|
|
330
|
-
const
|
|
330
|
+
const Dr = { timeoutInSeconds: 60 }, Mn = { name: "auth0-spa-js", version: "2.1.3" }, Zn = () => Date.now();
|
|
331
331
|
let G = class kt extends Error {
|
|
332
332
|
constructor(e, n) {
|
|
333
333
|
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, kt.prototype);
|
|
@@ -335,84 +335,84 @@ let G = class kt extends Error {
|
|
|
335
335
|
static fromPayload({ error: e, error_description: n }) {
|
|
336
336
|
return new kt(e, n);
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, Lr = class Kn extends G {
|
|
339
339
|
constructor(e, n, r, i = null) {
|
|
340
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
340
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Kn.prototype);
|
|
341
341
|
}
|
|
342
|
-
}, It = class
|
|
342
|
+
}, It = class Wn extends G {
|
|
343
343
|
constructor() {
|
|
344
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
344
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, Wn.prototype);
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, Mr = class Hn extends It {
|
|
347
347
|
constructor(e) {
|
|
348
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
348
|
+
super(), this.popup = e, Object.setPrototypeOf(this, Hn.prototype);
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Zr = class Fn extends G {
|
|
351
351
|
constructor(e) {
|
|
352
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
352
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Fn.prototype);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, Kr = class Jn extends G {
|
|
355
355
|
constructor(e, n, r) {
|
|
356
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
356
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Jn.prototype);
|
|
357
357
|
}
|
|
358
|
-
},
|
|
358
|
+
}, Xn = class Vn extends G {
|
|
359
359
|
constructor(e, n) {
|
|
360
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
360
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Jt(e, ["default"])}', scope: '${Jt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Vn.prototype);
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
function
|
|
363
|
+
function Jt(t, e = []) {
|
|
364
364
|
return t && !e.includes(t) ? t : "";
|
|
365
365
|
}
|
|
366
366
|
const Qe = () => window.crypto, dt = () => {
|
|
367
367
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
368
368
|
let e = "";
|
|
369
369
|
return Array.from(Qe().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
370
|
-
},
|
|
370
|
+
}, Xt = (t) => btoa(t), St = (t) => {
|
|
371
371
|
var { clientId: e } = t, n = ne(t, ["clientId"]);
|
|
372
372
|
return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
|
|
373
|
-
},
|
|
373
|
+
}, Vt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Wr = async (t, e) => {
|
|
374
374
|
const n = await fetch(t, e);
|
|
375
375
|
return { ok: n.ok, json: await n.json() };
|
|
376
|
-
},
|
|
376
|
+
}, Hr = async (t, e, n) => {
|
|
377
377
|
const r = new AbortController();
|
|
378
378
|
let i;
|
|
379
|
-
return e.signal = r.signal, Promise.race([
|
|
379
|
+
return e.signal = r.signal, Promise.race([Wr(t, e), new Promise((o, a) => {
|
|
380
380
|
i = setTimeout(() => {
|
|
381
381
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
382
382
|
}, n);
|
|
383
383
|
})]).finally(() => {
|
|
384
384
|
clearTimeout(i);
|
|
385
385
|
});
|
|
386
|
-
},
|
|
387
|
-
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a },
|
|
386
|
+
}, Fr = async (t, e, n, r, i, o, a) => {
|
|
387
|
+
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, f = o, new Promise(function(p, u) {
|
|
388
388
|
const c = new MessageChannel();
|
|
389
|
-
c.port1.onmessage = function(
|
|
390
|
-
|
|
391
|
-
},
|
|
389
|
+
c.port1.onmessage = function(m) {
|
|
390
|
+
m.data.error ? u(new Error(m.data.error)) : p(m.data), c.port1.close();
|
|
391
|
+
}, f.postMessage(s, [c.port2]);
|
|
392
392
|
});
|
|
393
|
-
var s,
|
|
394
|
-
},
|
|
395
|
-
async function
|
|
396
|
-
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t,
|
|
397
|
-
const
|
|
398
|
-
return await async function(u, c,
|
|
393
|
+
var s, f;
|
|
394
|
+
}, Jr = async (t, e, n, r, i, o, a = 1e4) => i ? Fr(t, e, n, r, a, i, o) : Hr(t, r, a);
|
|
395
|
+
async function Xr(t, e) {
|
|
396
|
+
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = ne(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
|
+
const p = s ? St(f) : JSON.stringify(f);
|
|
398
|
+
return await async function(u, c, m, d, w, k, v) {
|
|
399
399
|
let _, S = null;
|
|
400
|
-
for (let
|
|
400
|
+
for (let C = 0; C < 3; C++)
|
|
401
401
|
try {
|
|
402
|
-
_ = await
|
|
402
|
+
_ = await Jr(u, m, d, w, k, v, c), S = null;
|
|
403
403
|
break;
|
|
404
|
-
} catch (
|
|
405
|
-
S =
|
|
404
|
+
} catch (D) {
|
|
405
|
+
S = D;
|
|
406
406
|
}
|
|
407
407
|
if (S)
|
|
408
408
|
throw S;
|
|
409
|
-
const y = _.json, { error: l, error_description:
|
|
409
|
+
const y = _.json, { error: l, error_description: b } = y, T = ne(y, ["error", "error_description"]), { ok: O } = _;
|
|
410
410
|
if (!O) {
|
|
411
|
-
const
|
|
412
|
-
throw l === "mfa_required" ? new
|
|
411
|
+
const C = b || `HTTP error. Unable to fetch ${u}`;
|
|
412
|
+
throw l === "mfa_required" ? new Kr(l, C, T.mfa_token) : l === "missing_refresh_token" ? new Xn(m, d) : new G(l || "request_error", C);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
415
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body:
|
|
414
|
+
return T;
|
|
415
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || Mn)) } }, e, s);
|
|
416
416
|
}
|
|
417
417
|
const Fe = (...t) => {
|
|
418
418
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
@@ -433,7 +433,7 @@ let pe = class _t {
|
|
|
433
433
|
const { scope: n, audience: r, client_id: i } = e;
|
|
434
434
|
return new _t({ scope: n, audience: r, clientId: i });
|
|
435
435
|
}
|
|
436
|
-
},
|
|
436
|
+
}, Vr = class {
|
|
437
437
|
set(e, n) {
|
|
438
438
|
localStorage.setItem(e, JSON.stringify(n));
|
|
439
439
|
}
|
|
@@ -452,7 +452,7 @@ let pe = class _t {
|
|
|
452
452
|
allKeys() {
|
|
453
453
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, Yn = class {
|
|
456
456
|
constructor() {
|
|
457
457
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
458
458
|
let e = {};
|
|
@@ -467,9 +467,9 @@ let pe = class _t {
|
|
|
467
467
|
}, allKeys: () => Object.keys(e) };
|
|
468
468
|
}();
|
|
469
469
|
}
|
|
470
|
-
},
|
|
470
|
+
}, Yr = class {
|
|
471
471
|
constructor(e, n, r) {
|
|
472
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
472
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || Zn;
|
|
473
473
|
}
|
|
474
474
|
async setIdToken(e, n, r) {
|
|
475
475
|
var i;
|
|
@@ -492,8 +492,8 @@ let pe = class _t {
|
|
|
492
492
|
const s = await this.getCacheKeys();
|
|
493
493
|
if (!s)
|
|
494
494
|
return;
|
|
495
|
-
const
|
|
496
|
-
|
|
495
|
+
const f = this.matchExistingCacheKey(e, s);
|
|
496
|
+
f && (i = await this.cache.get(f));
|
|
497
497
|
}
|
|
498
498
|
if (!i)
|
|
499
499
|
return;
|
|
@@ -526,11 +526,11 @@ let pe = class _t {
|
|
|
526
526
|
matchExistingCacheKey(e, n) {
|
|
527
527
|
return n.filter((r) => {
|
|
528
528
|
var i;
|
|
529
|
-
const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [],
|
|
530
|
-
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience &&
|
|
529
|
+
const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((p, u) => p && a.has(u), !0);
|
|
530
|
+
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && f;
|
|
531
531
|
})[0];
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, Gr = class {
|
|
534
534
|
constructor(e, n, r) {
|
|
535
535
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
536
536
|
}
|
|
@@ -544,17 +544,17 @@ let pe = class _t {
|
|
|
544
544
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
const Ue = (t) => typeof t == "number",
|
|
547
|
+
const Ue = (t) => typeof t == "number", Br = ["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"], qr = (t) => {
|
|
548
548
|
if (!t.id_token)
|
|
549
549
|
throw new Error("ID token is required but missing");
|
|
550
550
|
const e = ((o) => {
|
|
551
|
-
const a = o.split("."), [s,
|
|
552
|
-
if (a.length !== 3 || !s || !
|
|
551
|
+
const a = o.split("."), [s, f, p] = a;
|
|
552
|
+
if (a.length !== 3 || !s || !f || !p)
|
|
553
553
|
throw new Error("ID token could not be decoded");
|
|
554
|
-
const u = JSON.parse(
|
|
554
|
+
const u = JSON.parse(Vt(f)), c = { __raw: o }, m = {};
|
|
555
555
|
return Object.keys(u).forEach((d) => {
|
|
556
|
-
c[d] = u[d],
|
|
557
|
-
}), { encoded: { header: s, payload:
|
|
556
|
+
c[d] = u[d], Br.includes(d) || (m[d] = u[d]);
|
|
557
|
+
}), { encoded: { header: s, payload: f, signature: p }, header: JSON.parse(Vt(s)), claims: c, user: m };
|
|
558
558
|
})(t.id_token);
|
|
559
559
|
if (!e.claims.iss)
|
|
560
560
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -620,74 +620,74 @@ const Ue = (t) => typeof t == "number", Yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
620
620
|
}
|
|
621
621
|
return e;
|
|
622
622
|
};
|
|
623
|
-
var me =
|
|
623
|
+
var me = $t(function(t, e) {
|
|
624
624
|
var n = he && he.__assign || function() {
|
|
625
|
-
return n = Object.assign || function(
|
|
626
|
-
for (var
|
|
627
|
-
for (var
|
|
628
|
-
Object.prototype.hasOwnProperty.call(
|
|
629
|
-
return
|
|
625
|
+
return n = Object.assign || function(f) {
|
|
626
|
+
for (var p, u = 1, c = arguments.length; u < c; u++)
|
|
627
|
+
for (var m in p = arguments[u])
|
|
628
|
+
Object.prototype.hasOwnProperty.call(p, m) && (f[m] = p[m]);
|
|
629
|
+
return f;
|
|
630
630
|
}, n.apply(this, arguments);
|
|
631
631
|
};
|
|
632
|
-
function r(
|
|
633
|
-
if (!
|
|
632
|
+
function r(f, p) {
|
|
633
|
+
if (!p)
|
|
634
634
|
return "";
|
|
635
|
-
var u = "; " +
|
|
636
|
-
return
|
|
635
|
+
var u = "; " + f;
|
|
636
|
+
return p === !0 ? u : u + "=" + p;
|
|
637
637
|
}
|
|
638
|
-
function i(
|
|
639
|
-
return encodeURIComponent(
|
|
638
|
+
function i(f, p, u) {
|
|
639
|
+
return encodeURIComponent(f).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(p).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(c) {
|
|
640
640
|
if (typeof c.expires == "number") {
|
|
641
|
-
var
|
|
642
|
-
|
|
641
|
+
var m = /* @__PURE__ */ new Date();
|
|
642
|
+
m.setMilliseconds(m.getMilliseconds() + 864e5 * c.expires), c.expires = m;
|
|
643
643
|
}
|
|
644
644
|
return r("Expires", c.expires ? c.expires.toUTCString() : "") + r("Domain", c.domain) + r("Path", c.path) + r("Secure", c.secure) + r("SameSite", c.sameSite);
|
|
645
645
|
}(u);
|
|
646
646
|
}
|
|
647
|
-
function o(
|
|
648
|
-
for (var
|
|
649
|
-
var d = u[
|
|
647
|
+
function o(f) {
|
|
648
|
+
for (var p = {}, u = f ? f.split("; ") : [], c = /(%[\dA-F]{2})+/gi, m = 0; m < u.length; m++) {
|
|
649
|
+
var d = u[m].split("="), w = d.slice(1).join("=");
|
|
650
650
|
w.charAt(0) === '"' && (w = w.slice(1, -1));
|
|
651
651
|
try {
|
|
652
|
-
|
|
652
|
+
p[d[0].replace(c, decodeURIComponent)] = w.replace(c, decodeURIComponent);
|
|
653
653
|
} catch {
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
return
|
|
656
|
+
return p;
|
|
657
657
|
}
|
|
658
658
|
function a() {
|
|
659
659
|
return o(document.cookie);
|
|
660
660
|
}
|
|
661
|
-
function s(
|
|
662
|
-
document.cookie = i(
|
|
661
|
+
function s(f, p, u) {
|
|
662
|
+
document.cookie = i(f, p, n({ path: "/" }, u));
|
|
663
663
|
}
|
|
664
|
-
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(
|
|
665
|
-
return a()[
|
|
666
|
-
}, e.set = s, e.remove = function(
|
|
667
|
-
s(
|
|
664
|
+
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(f) {
|
|
665
|
+
return a()[f];
|
|
666
|
+
}, e.set = s, e.remove = function(f, p) {
|
|
667
|
+
s(f, "", n(n({}, p), { expires: -1 }));
|
|
668
668
|
};
|
|
669
669
|
});
|
|
670
|
-
|
|
671
|
-
var
|
|
670
|
+
At(me), me.encode, me.parse, me.getAll;
|
|
671
|
+
var Qr = me.get, Gn = me.set, Bn = me.remove;
|
|
672
672
|
const Ie = { get(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = Qr(t);
|
|
674
674
|
if (e !== void 0)
|
|
675
675
|
return JSON.parse(e);
|
|
676
676
|
}, save(t, e, n) {
|
|
677
677
|
let r = {};
|
|
678
|
-
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
678
|
+
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Gn(t, JSON.stringify(e), r);
|
|
679
679
|
}, remove(t, e) {
|
|
680
680
|
let n = {};
|
|
681
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
682
|
-
} },
|
|
681
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Bn(t, n);
|
|
682
|
+
} }, ei = { get(t) {
|
|
683
683
|
return Ie.get(t) || Ie.get(`_legacy_${t}`);
|
|
684
684
|
}, save(t, e, n) {
|
|
685
685
|
let r = {};
|
|
686
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
686
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Gn(`_legacy_${t}`, JSON.stringify(e), r), Ie.save(t, e, n);
|
|
687
687
|
}, remove(t, e) {
|
|
688
688
|
let n = {};
|
|
689
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
690
|
-
} },
|
|
689
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Bn(t, n), Ie.remove(t, e), Ie.remove(`_legacy_${t}`, e);
|
|
690
|
+
} }, ti = { get(t) {
|
|
691
691
|
if (typeof sessionStorage > "u")
|
|
692
692
|
return;
|
|
693
693
|
const e = sessionStorage.getItem(t);
|
|
@@ -697,12 +697,12 @@ const Ie = { get(t) {
|
|
|
697
697
|
}, remove(t) {
|
|
698
698
|
sessionStorage.removeItem(t);
|
|
699
699
|
} };
|
|
700
|
-
function
|
|
701
|
-
var r = e === void 0 ? null : e, i = function(
|
|
702
|
-
var u = atob(
|
|
703
|
-
if (
|
|
704
|
-
for (var c = new Uint8Array(u.length),
|
|
705
|
-
c[
|
|
700
|
+
function ni(t, e, n) {
|
|
701
|
+
var r = e === void 0 ? null : e, i = function(f, p) {
|
|
702
|
+
var u = atob(f);
|
|
703
|
+
if (p) {
|
|
704
|
+
for (var c = new Uint8Array(u.length), m = 0, d = u.length; m < d; ++m)
|
|
705
|
+
c[m] = u.charCodeAt(m);
|
|
706
706
|
return String.fromCharCode.apply(null, new Uint16Array(c.buffer));
|
|
707
707
|
}
|
|
708
708
|
return u;
|
|
@@ -710,11 +710,11 @@ function ei(t, e, n) {
|
|
|
710
710
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
711
711
|
return URL.createObjectURL(s);
|
|
712
712
|
}
|
|
713
|
-
var
|
|
714
|
-
return ht = ht ||
|
|
713
|
+
var Yt, Gt, Bt, ht, ri = (Yt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Gt = null, Bt = !1, function(t) {
|
|
714
|
+
return ht = ht || ni(Yt, Gt, Bt), new Worker(ht, t);
|
|
715
715
|
});
|
|
716
716
|
const ft = {};
|
|
717
|
-
let
|
|
717
|
+
let ii = class {
|
|
718
718
|
constructor(e, n) {
|
|
719
719
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
720
720
|
}
|
|
@@ -740,14 +740,14 @@ let ni = class {
|
|
|
740
740
|
return `@@auth0spajs@@::${e}`;
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
743
|
+
const oi = { memory: () => new Yn().enclosedCache, localstorage: () => new Vr() }, qt = (t) => oi[t], Qt = (t) => {
|
|
744
744
|
const { openUrl: e, onRedirect: n } = t, r = ne(t, ["openUrl", "onRedirect"]);
|
|
745
745
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
746
|
-
}, pt = new
|
|
747
|
-
let
|
|
746
|
+
}, pt = new Rr();
|
|
747
|
+
let ai = class {
|
|
748
748
|
constructor(e) {
|
|
749
749
|
let n, r;
|
|
750
|
-
if (this.userCache = new
|
|
750
|
+
if (this.userCache = new Yn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
751
751
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
752
752
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
753
753
|
if (!Qe())
|
|
@@ -759,17 +759,17 @@ let ii = class {
|
|
|
759
759
|
})(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
|
|
760
760
|
r = e.cache;
|
|
761
761
|
else {
|
|
762
|
-
if (n = e.cacheLocation || "memory", !
|
|
762
|
+
if (n = e.cacheLocation || "memory", !qt(n))
|
|
763
763
|
throw new Error(`Invalid cache location "${n}"`);
|
|
764
|
-
r =
|
|
764
|
+
r = qt(n)();
|
|
765
765
|
}
|
|
766
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie :
|
|
767
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
766
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie : ei, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
767
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : ti;
|
|
768
768
|
var o;
|
|
769
|
-
this.scope = Fe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new
|
|
769
|
+
this.scope = Fe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Gr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Zn, this.cacheManager = new Yr(r, r.allKeys ? void 0 : new ii(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 ri());
|
|
770
770
|
}
|
|
771
771
|
_url(e) {
|
|
772
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
772
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Mn)));
|
|
773
773
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
774
774
|
}
|
|
775
775
|
_authorizeUrl(e) {
|
|
@@ -777,43 +777,43 @@ let ii = class {
|
|
|
777
777
|
}
|
|
778
778
|
async _verifyIdToken(e, n, r) {
|
|
779
779
|
const i = await this.nowProvider();
|
|
780
|
-
return
|
|
780
|
+
return qr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
|
|
781
781
|
var o;
|
|
782
782
|
}
|
|
783
783
|
_processOrgHint(e) {
|
|
784
784
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
785
785
|
}
|
|
786
786
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
787
|
-
const i =
|
|
787
|
+
const i = Xt(dt()), o = Xt(dt()), a = dt(), s = ((u) => {
|
|
788
788
|
const c = new Uint8Array(u);
|
|
789
|
-
return ((
|
|
789
|
+
return ((m) => {
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
791
|
-
return
|
|
791
|
+
return m.replace(/[+/=]/g, (w) => d[w]);
|
|
792
792
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
793
|
-
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)),
|
|
794
|
-
return { nonce: o, code_verifier: a, scope:
|
|
793
|
+
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, m, d, w, k, v, _) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), m), { scope: Fe(c, m.scope), response_type: "code", response_mode: _ || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), p = this._authorizeUrl(f);
|
|
794
|
+
return { nonce: o, code_verifier: a, scope: f.scope, audience: f.audience || "default", redirect_uri: f.redirect_uri, state: i, url: p };
|
|
795
795
|
}
|
|
796
796
|
async loginWithPopup(e, n) {
|
|
797
797
|
var r;
|
|
798
798
|
if (e = e || {}, !(n = n || {}).popup && (n.popup = ((s) => {
|
|
799
|
-
const
|
|
800
|
-
return window.open(s, "auth0:authorize:popup", `left=${
|
|
799
|
+
const f = window.screenX + (window.innerWidth - 400) / 2, p = window.screenY + (window.innerHeight - 600) / 2;
|
|
800
|
+
return window.open(s, "auth0:authorize:popup", `left=${f},top=${p},width=400,height=600,resizable,scrollbars=yes,status=1`);
|
|
801
801
|
})(""), !n.popup))
|
|
802
802
|
throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
|
|
803
803
|
const i = await this._prepareAuthorizeUrl(e.authorizationParams || {}, { response_mode: "web_message" }, window.location.origin);
|
|
804
804
|
n.popup.location.href = i.url;
|
|
805
|
-
const o = await ((s) => new Promise((
|
|
805
|
+
const o = await ((s) => new Promise((f, p) => {
|
|
806
806
|
let u;
|
|
807
807
|
const c = setInterval(() => {
|
|
808
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(
|
|
809
|
-
}, 1e3),
|
|
810
|
-
clearInterval(c),
|
|
808
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(m), window.removeEventListener("message", u, !1), p(new Zr(s.popup)));
|
|
809
|
+
}, 1e3), m = setTimeout(() => {
|
|
810
|
+
clearInterval(c), p(new Mr(s.popup)), window.removeEventListener("message", u, !1);
|
|
811
811
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
812
812
|
u = function(d) {
|
|
813
813
|
if (d.data && d.data.type === "authorization_response") {
|
|
814
|
-
if (clearTimeout(
|
|
815
|
-
return
|
|
816
|
-
|
|
814
|
+
if (clearTimeout(m), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
|
|
815
|
+
return p(G.fromPayload(d.data.response));
|
|
816
|
+
f(d.data.response);
|
|
817
817
|
}
|
|
818
818
|
}, window.addEventListener("message", u);
|
|
819
819
|
}))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
|
|
@@ -834,10 +834,10 @@ let ii = class {
|
|
|
834
834
|
}
|
|
835
835
|
async loginWithRedirect(e = {}) {
|
|
836
836
|
var n;
|
|
837
|
-
const r =
|
|
838
|
-
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }),
|
|
839
|
-
const
|
|
840
|
-
i ? await i(
|
|
837
|
+
const r = Qt(e), { openUrl: i, fragment: o, appState: a } = r, s = ne(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, p = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = p, c = ne(p, ["url"]);
|
|
838
|
+
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), f && { organization: f }));
|
|
839
|
+
const m = o ? `${u}#${o}` : u;
|
|
840
|
+
i ? await i(m) : window.location.assign(m);
|
|
841
841
|
}
|
|
842
842
|
async handleRedirectCallback(e = window.location.href) {
|
|
843
843
|
const n = e.split("?").slice(1);
|
|
@@ -845,17 +845,17 @@ let ii = class {
|
|
|
845
845
|
throw new Error("There are no query params available for parsing.");
|
|
846
846
|
const { state: r, code: i, error: o, error_description: a } = ((c) => {
|
|
847
847
|
c.indexOf("#") > -1 && (c = c.substring(0, c.indexOf("#")));
|
|
848
|
-
const
|
|
849
|
-
return { state:
|
|
848
|
+
const m = new URLSearchParams(c);
|
|
849
|
+
return { state: m.get("state"), code: m.get("code") || void 0, error: m.get("error") || void 0, error_description: m.get("error_description") || void 0 };
|
|
850
850
|
})(n.join("")), s = this.transactionManager.get();
|
|
851
851
|
if (!s)
|
|
852
852
|
throw new G("missing_transaction", "Invalid state");
|
|
853
853
|
if (this.transactionManager.remove(), o)
|
|
854
|
-
throw new
|
|
854
|
+
throw new Lr(o, a || o, r, s.appState);
|
|
855
855
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
856
856
|
throw new G("state_mismatch", "Invalid state");
|
|
857
|
-
const
|
|
858
|
-
return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn:
|
|
857
|
+
const f = s.organization, p = s.nonce, u = s.redirect_uri;
|
|
858
|
+
return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: p, organization: f }), { appState: s.appState };
|
|
859
859
|
}
|
|
860
860
|
async checkSession(e) {
|
|
861
861
|
if (!this.cookieStorage.get(this.isAuthenticatedCookieName)) {
|
|
@@ -895,12 +895,12 @@ let ii = class {
|
|
|
895
895
|
throw new It();
|
|
896
896
|
try {
|
|
897
897
|
if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
900
|
-
return
|
|
898
|
+
const p = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
899
|
+
if (p)
|
|
900
|
+
return p;
|
|
901
901
|
}
|
|
902
|
-
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in:
|
|
903
|
-
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in:
|
|
902
|
+
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;
|
|
903
|
+
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: f });
|
|
904
904
|
} finally {
|
|
905
905
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
906
906
|
}
|
|
@@ -909,7 +909,7 @@ let ii = class {
|
|
|
909
909
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
910
910
|
var r;
|
|
911
911
|
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Fe(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
912
|
-
return n = Object.assign(Object.assign({},
|
|
912
|
+
return n = Object.assign(Object.assign({}, Dr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new pe({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
913
913
|
}
|
|
914
914
|
async isAuthenticated() {
|
|
915
915
|
return !!await this.getUser();
|
|
@@ -920,7 +920,7 @@ let ii = class {
|
|
|
920
920
|
return this._url(`/v2/logout?${St(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
921
921
|
}
|
|
922
922
|
async logout(e = {}) {
|
|
923
|
-
const n =
|
|
923
|
+
const n = Qt(e), { openUrl: r } = n, i = ne(n, ["openUrl"]);
|
|
924
924
|
e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
|
|
925
925
|
const o = this._buildLogoutUrl(i);
|
|
926
926
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -928,31 +928,31 @@ let ii = class {
|
|
|
928
928
|
async _getTokenFromIFrame(e) {
|
|
929
929
|
const n = Object.assign(Object.assign({}, e.authorizationParams), { prompt: "none" }), r = this.cookieStorage.get(this.orgHintCookieName);
|
|
930
930
|
r && !n.organization && (n.organization = r);
|
|
931
|
-
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri:
|
|
931
|
+
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: f, scope: p, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
|
|
932
932
|
try {
|
|
933
933
|
if (window.crossOriginIsolated)
|
|
934
934
|
throw new G("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
935
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds,
|
|
935
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, m = await ((w, k, v = 60) => new Promise((_, S) => {
|
|
936
936
|
const y = window.document.createElement("iframe");
|
|
937
937
|
y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
|
|
938
938
|
const l = () => {
|
|
939
|
-
window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message",
|
|
939
|
+
window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", b, !1));
|
|
940
940
|
};
|
|
941
|
-
let
|
|
942
|
-
const
|
|
941
|
+
let b;
|
|
942
|
+
const T = setTimeout(() => {
|
|
943
943
|
S(new It()), l();
|
|
944
944
|
}, 1e3 * v);
|
|
945
|
-
|
|
946
|
-
if (O.origin !=
|
|
945
|
+
b = function(O) {
|
|
946
|
+
if (O.origin != k || !O.data || O.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
}, window.addEventListener("message",
|
|
948
|
+
const C = O.source;
|
|
949
|
+
C && C.close(), O.data.response.error ? S(G.fromPayload(O.data.response)) : _(O.data.response), clearTimeout(T), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
|
|
950
|
+
}, window.addEventListener("message", b, !1), window.document.body.appendChild(y), y.setAttribute("src", w);
|
|
951
951
|
}))(i, this.domainUrl, c);
|
|
952
|
-
if (o !==
|
|
952
|
+
if (o !== m.state)
|
|
953
953
|
throw new G("state_mismatch", "Invalid state");
|
|
954
|
-
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code:
|
|
955
|
-
return Object.assign(Object.assign({}, d), { scope:
|
|
954
|
+
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: m.code, grant_type: "authorization_code", redirect_uri: f, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
|
|
955
|
+
return Object.assign(Object.assign({}, d), { scope: p, oauthTokenScope: d.scope, audience: u });
|
|
956
956
|
} catch (c) {
|
|
957
957
|
throw c.error === "login_required" && this.logout({ openUrl: !1 }), c;
|
|
958
958
|
}
|
|
@@ -962,7 +962,7 @@ let ii = class {
|
|
|
962
962
|
if (!(n && n.refresh_token || this.worker)) {
|
|
963
963
|
if (this.options.useRefreshTokensFallback)
|
|
964
964
|
return await this._getTokenFromIFrame(e);
|
|
965
|
-
throw new
|
|
965
|
+
throw new Xn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
966
966
|
}
|
|
967
967
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
968
968
|
try {
|
|
@@ -985,31 +985,31 @@ let ii = class {
|
|
|
985
985
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
986
986
|
const i = await this.cacheManager.get(new pe({ scope: e, audience: n, clientId: r }), 60);
|
|
987
987
|
if (i && i.access_token) {
|
|
988
|
-
const { access_token: o, oauthTokenScope: a, expires_in: s } = i,
|
|
989
|
-
return
|
|
988
|
+
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, f = await this._getIdTokenFromCache();
|
|
989
|
+
return f && Object.assign(Object.assign({ id_token: f.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
async _requestToken(e, n) {
|
|
993
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
993
|
+
const { nonceIn: r, organization: i } = n || {}, o = await Xr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
|
|
994
994
|
return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
async function
|
|
998
|
-
const e = new
|
|
997
|
+
async function si(t) {
|
|
998
|
+
const e = new ai(t);
|
|
999
999
|
return await e.checkSession(), e;
|
|
1000
1000
|
}
|
|
1001
|
-
const
|
|
1001
|
+
const Et = "sesamy.com", ci = "https://logs.sesamy.com/events", Pt = "sesamyCacheTimestamp";
|
|
1002
1002
|
var Q = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t.USER_ATTRIBUTE_CHANGED = "sesamyUserAttributeChanged", t.PURCHASE = "sesamyJsPurchase", t))(Q || {});
|
|
1003
1003
|
let B;
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1006
|
-
const t = localStorage.getItem(
|
|
1004
|
+
const Nt = "sesamyAccessToken", Ut = "sesamyExpires";
|
|
1005
|
+
function zt() {
|
|
1006
|
+
const t = localStorage.getItem(Ut);
|
|
1007
1007
|
if (!(t && parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
|
|
1008
|
-
return localStorage.getItem(
|
|
1008
|
+
return localStorage.getItem(Nt);
|
|
1009
1009
|
}
|
|
1010
|
-
async function
|
|
1011
|
-
if (t.enabled !== !1 && (B = await
|
|
1012
|
-
domain: t.endpoint || `token.${
|
|
1010
|
+
async function ui(t) {
|
|
1011
|
+
if (t.enabled !== !1 && (B = await si({
|
|
1012
|
+
domain: t.endpoint || `token.${Et}`,
|
|
1013
1013
|
clientId: t.clientId
|
|
1014
1014
|
}), window.location.search.includes("code=")))
|
|
1015
1015
|
try {
|
|
@@ -1021,15 +1021,15 @@ async function si(t) {
|
|
|
1021
1021
|
} catch {
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
async function
|
|
1025
|
-
if (
|
|
1024
|
+
async function qn() {
|
|
1025
|
+
if (zt())
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
if (!B)
|
|
1028
1028
|
throw new Error("Auth0 client not initialized");
|
|
1029
1029
|
return B.isAuthenticated();
|
|
1030
1030
|
}
|
|
1031
|
-
async function
|
|
1032
|
-
if (
|
|
1031
|
+
async function li() {
|
|
1032
|
+
if (zt())
|
|
1033
1033
|
return {
|
|
1034
1034
|
sub: "local",
|
|
1035
1035
|
name: "Local User"
|
|
@@ -1038,7 +1038,7 @@ async function ui() {
|
|
|
1038
1038
|
throw new Error("Auth0 client not initialized");
|
|
1039
1039
|
return B.getUser();
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Qn() {
|
|
1042
1042
|
if (!B)
|
|
1043
1043
|
throw new Error("Auth0 client not initialized");
|
|
1044
1044
|
return B.loginWithRedirect({
|
|
@@ -1047,8 +1047,8 @@ function Bn() {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
const e =
|
|
1050
|
+
async function en(t = !0) {
|
|
1051
|
+
const e = zt();
|
|
1052
1052
|
if (e)
|
|
1053
1053
|
return e;
|
|
1054
1054
|
try {
|
|
@@ -1062,7 +1062,7 @@ async function li(t = !0) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
async function di() {
|
|
1065
|
-
if (localStorage.removeItem(
|
|
1065
|
+
if (localStorage.removeItem(Nt), localStorage.removeItem(Ut), !B)
|
|
1066
1066
|
throw new Error("Auth0 client not initialized");
|
|
1067
1067
|
return ue(Q.LOGOUT, {}), B.logout({
|
|
1068
1068
|
logoutParams: {
|
|
@@ -1081,12 +1081,12 @@ function hi(t) {
|
|
|
1081
1081
|
);
|
|
1082
1082
|
return JSON.parse(i);
|
|
1083
1083
|
}
|
|
1084
|
-
async function
|
|
1085
|
-
localStorage.setItem(
|
|
1084
|
+
async function er(t, e) {
|
|
1085
|
+
localStorage.setItem(Nt, t), e && localStorage.setItem(Ut, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
|
|
1086
1086
|
const n = hi(t);
|
|
1087
1087
|
ue(Q.AUTHENTICATED, n);
|
|
1088
1088
|
}
|
|
1089
|
-
const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method + "@" + t, mi = (t) => t.clone(),
|
|
1089
|
+
const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method + "@" + t, mi = (t) => t.clone(), tn = ({ skip: t = fi, key: e = pi, resolver: n = mi } = {}) => {
|
|
1090
1090
|
const r = /* @__PURE__ */ new Map();
|
|
1091
1091
|
return (i) => (o, a) => {
|
|
1092
1092
|
if (t(o, a))
|
|
@@ -1095,50 +1095,50 @@ const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method
|
|
|
1095
1095
|
if (!r.has(s))
|
|
1096
1096
|
r.set(s, []);
|
|
1097
1097
|
else
|
|
1098
|
-
return new Promise((
|
|
1099
|
-
r.get(s).push([
|
|
1098
|
+
return new Promise((f, p) => {
|
|
1099
|
+
r.get(s).push([f, p]);
|
|
1100
1100
|
});
|
|
1101
1101
|
try {
|
|
1102
|
-
return i(o, a).then((
|
|
1103
|
-
throw r.get(s).forEach(([
|
|
1102
|
+
return i(o, a).then((f) => (r.get(s).forEach(([p]) => p(n(f))), r.delete(s), f)).catch((f) => {
|
|
1103
|
+
throw r.get(s).forEach(([p, u]) => u(f)), r.delete(s), f;
|
|
1104
1104
|
});
|
|
1105
|
-
} catch (
|
|
1106
|
-
return r.delete(s), Promise.reject(
|
|
1105
|
+
} catch (f) {
|
|
1106
|
+
return r.delete(s), Promise.reject(f);
|
|
1107
1107
|
}
|
|
1108
1108
|
};
|
|
1109
|
-
}, gi = (t, e) => t * e, yi = (t) => t && t.ok,
|
|
1109
|
+
}, gi = (t, e) => t * e, yi = (t) => t && t.ok, nn = ({ delayTimer: t = 500, delayRamp: e = gi, maxAttempts: n = 10, until: r = yi, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (f) => (p, u) => {
|
|
1110
1110
|
let c = 0;
|
|
1111
|
-
if (s && s(
|
|
1112
|
-
return
|
|
1113
|
-
const
|
|
1111
|
+
if (s && s(p, u))
|
|
1112
|
+
return f(p, u);
|
|
1113
|
+
const m = (d, w) => Promise.resolve(r(d, w)).then((k) => k ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((v) => {
|
|
1114
1114
|
const _ = e(t, c);
|
|
1115
1115
|
setTimeout(() => {
|
|
1116
1116
|
typeof i == "function" ? Promise.resolve(i({
|
|
1117
1117
|
response: d,
|
|
1118
1118
|
error: w,
|
|
1119
|
-
url:
|
|
1119
|
+
url: p,
|
|
1120
1120
|
options: u
|
|
1121
1121
|
})).then((S = {}) => {
|
|
1122
1122
|
var y, l;
|
|
1123
|
-
v(
|
|
1124
|
-
}) : v(
|
|
1123
|
+
v(f((y = S && S.url) !== null && y !== void 0 ? y : p, (l = S && S.options) !== null && l !== void 0 ? l : u));
|
|
1124
|
+
}) : v(f(p, u));
|
|
1125
1125
|
}, _);
|
|
1126
|
-
}).then(
|
|
1126
|
+
}).then(m).catch((v) => {
|
|
1127
1127
|
if (!o)
|
|
1128
1128
|
throw v;
|
|
1129
|
-
return
|
|
1129
|
+
return m(null, v);
|
|
1130
1130
|
}) : d && a ? d : Promise.reject(w || new Error("Number of attempts exceeded."))));
|
|
1131
|
-
return
|
|
1131
|
+
return f(p, u).then(m).catch((d) => {
|
|
1132
1132
|
if (!o)
|
|
1133
1133
|
throw d;
|
|
1134
|
-
return
|
|
1134
|
+
return m(null, d);
|
|
1135
1135
|
});
|
|
1136
|
-
}, vi = "application/json",
|
|
1137
|
-
function
|
|
1136
|
+
}, vi = "application/json", tr = "Content-Type", ke = Symbol(), nr = Symbol();
|
|
1137
|
+
function rn(t = {}) {
|
|
1138
1138
|
var e;
|
|
1139
|
-
return (e = Object.entries(t).find(([n]) => n.toLowerCase() ===
|
|
1139
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === tr.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function on(t) {
|
|
1142
1142
|
return /^application\/.*json.*/.test(t);
|
|
1143
1143
|
}
|
|
1144
1144
|
const ge = function(t, e, n = !1) {
|
|
@@ -1177,43 +1177,43 @@ function ki(t) {
|
|
|
1177
1177
|
Oe.errorType = t;
|
|
1178
1178
|
}
|
|
1179
1179
|
const Ii = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1180
|
-
class
|
|
1180
|
+
class rr extends Error {
|
|
1181
1181
|
}
|
|
1182
1182
|
const Si = (t) => {
|
|
1183
1183
|
const e = /* @__PURE__ */ Object.create(null);
|
|
1184
1184
|
t = t._addons.reduce((y, l) => l.beforeRequest && l.beforeRequest(y, t._options, e) || y, t);
|
|
1185
|
-
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons:
|
|
1185
|
+
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: f } = t, p = new Map(o), u = ge(i.options, r);
|
|
1186
1186
|
let c = n;
|
|
1187
|
-
const
|
|
1187
|
+
const m = Ii(s)((y, l) => (c = y, i.polyfill("fetch")(y, l)))(n, u), d = new Error(), w = m.catch((y) => {
|
|
1188
1188
|
throw { [ke]: y };
|
|
1189
1189
|
}).then((y) => {
|
|
1190
1190
|
if (!y.ok) {
|
|
1191
|
-
const l = new
|
|
1191
|
+
const l = new rr();
|
|
1192
1192
|
if (l.cause = d, l.stack = l.stack + `
|
|
1193
1193
|
CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
1194
1194
|
throw l;
|
|
1195
|
-
return y.text().then((
|
|
1196
|
-
var
|
|
1197
|
-
if (l.message =
|
|
1195
|
+
return y.text().then((b) => {
|
|
1196
|
+
var T;
|
|
1197
|
+
if (l.message = b, i.errorType === "json" || ((T = y.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
|
|
1198
1198
|
try {
|
|
1199
|
-
l.json = JSON.parse(
|
|
1199
|
+
l.json = JSON.parse(b);
|
|
1200
1200
|
} catch {
|
|
1201
1201
|
}
|
|
1202
|
-
throw l.text =
|
|
1202
|
+
throw l.text = b, l.status = y.status, l;
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
1205
|
return y;
|
|
1206
|
-
}),
|
|
1207
|
-
const
|
|
1206
|
+
}), k = (y) => y.catch((l) => {
|
|
1207
|
+
const b = l.hasOwnProperty(ke), T = b ? l[ke] : l, O = (T == null ? void 0 : T.status) && p.get(T.status) || p.get(T == null ? void 0 : T.name) || b && p.has(ke) && p.get(ke);
|
|
1208
1208
|
if (O)
|
|
1209
|
-
return O(
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1213
|
-
throw
|
|
1214
|
-
}), v = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */
|
|
1209
|
+
return O(T, t);
|
|
1210
|
+
const C = p.get(nr);
|
|
1211
|
+
if (C)
|
|
1212
|
+
return C(T, t);
|
|
1213
|
+
throw T;
|
|
1214
|
+
}), v = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(y ? w.then((b) => b && b[y]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), _ = {
|
|
1215
1215
|
_wretchReq: t,
|
|
1216
|
-
_fetchReq:
|
|
1216
|
+
_fetchReq: m,
|
|
1217
1217
|
_sharedState: e,
|
|
1218
1218
|
res: v(null),
|
|
1219
1219
|
json: v("json"),
|
|
@@ -1222,7 +1222,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1222
1222
|
arrayBuffer: v("arrayBuffer"),
|
|
1223
1223
|
text: v("text"),
|
|
1224
1224
|
error(y, l) {
|
|
1225
|
-
return
|
|
1225
|
+
return p.set(y, l), this;
|
|
1226
1226
|
},
|
|
1227
1227
|
badRequest(y) {
|
|
1228
1228
|
return this.error(400, y);
|
|
@@ -1245,7 +1245,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1245
1245
|
fetchError(y) {
|
|
1246
1246
|
return this.error(ke, y);
|
|
1247
1247
|
}
|
|
1248
|
-
}, S =
|
|
1248
|
+
}, S = f.reduce((y, l) => ({
|
|
1249
1249
|
...y,
|
|
1250
1250
|
...typeof l.resolver == "function" ? l.resolver(y) : l.resolver
|
|
1251
1251
|
}), _);
|
|
@@ -1300,7 +1300,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1300
1300
|
return this.headers({ Accept: t });
|
|
1301
1301
|
},
|
|
1302
1302
|
content(t) {
|
|
1303
|
-
return this.headers({ [
|
|
1303
|
+
return this.headers({ [tr]: t });
|
|
1304
1304
|
},
|
|
1305
1305
|
auth(t) {
|
|
1306
1306
|
return this.headers({ Authorization: t });
|
|
@@ -1310,7 +1310,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1310
1310
|
return n.set(t, e), { ...this, _catchers: n };
|
|
1311
1311
|
},
|
|
1312
1312
|
catcherFallback(t) {
|
|
1313
|
-
return this.catcher(
|
|
1313
|
+
return this.catcher(nr, t);
|
|
1314
1314
|
},
|
|
1315
1315
|
resolve(t, e = !1) {
|
|
1316
1316
|
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
@@ -1329,7 +1329,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1329
1329
|
},
|
|
1330
1330
|
fetch(t = this._options.method, e = "", n = null) {
|
|
1331
1331
|
let r = this.url(e).options({ method: t });
|
|
1332
|
-
const i =
|
|
1332
|
+
const i = rn(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || on(i));
|
|
1333
1333
|
return r = n ? o ? r.json(n, i) : r.body(n) : r, Si(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1334
1334
|
},
|
|
1335
1335
|
get(t = "") {
|
|
@@ -1357,8 +1357,8 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1357
1357
|
return { ...this, _options: { ...this._options, body: t } };
|
|
1358
1358
|
},
|
|
1359
1359
|
json(t, e) {
|
|
1360
|
-
const n =
|
|
1361
|
-
return this.content(e ||
|
|
1360
|
+
const n = rn(this._options.headers);
|
|
1361
|
+
return this.content(e || on(n) && n || vi).body(JSON.stringify(t));
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
1364
|
function le(t = "", e = {}) {
|
|
@@ -1368,109 +1368,109 @@ le.default = le;
|
|
|
1368
1368
|
le.options = wi;
|
|
1369
1369
|
le.errorType = ki;
|
|
1370
1370
|
le.polyfills = bi;
|
|
1371
|
-
le.WretchError =
|
|
1371
|
+
le.WretchError = rr;
|
|
1372
1372
|
function te() {
|
|
1373
|
-
sessionStorage.removeItem(
|
|
1373
|
+
sessionStorage.removeItem(Pt), ue(Q.CLEAR_CACHE, {});
|
|
1374
1374
|
}
|
|
1375
1375
|
function Ei(t) {
|
|
1376
|
-
const e = t.endpoint || `https://api2.${
|
|
1377
|
-
let
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
...
|
|
1376
|
+
const e = t.endpoint || `https://api2.${Et}`, n = (I) => async (E, W) => {
|
|
1377
|
+
let h = sessionStorage.getItem(Pt);
|
|
1378
|
+
h || (h = Date.now().toString(), sessionStorage.setItem(Pt, h));
|
|
1379
|
+
const g = {
|
|
1380
|
+
...W,
|
|
1381
1381
|
headers: {
|
|
1382
|
-
...
|
|
1383
|
-
"Cache-Timestamp":
|
|
1382
|
+
...W.headers,
|
|
1383
|
+
"Cache-Timestamp": h
|
|
1384
1384
|
}
|
|
1385
1385
|
};
|
|
1386
|
-
return
|
|
1387
|
-
}, r = (
|
|
1388
|
-
let
|
|
1389
|
-
if (
|
|
1390
|
-
if (
|
|
1386
|
+
return I(E, g);
|
|
1387
|
+
}, r = (I = !0) => (E) => async (W, h) => {
|
|
1388
|
+
let g = null;
|
|
1389
|
+
if (g = await en(I), !g) {
|
|
1390
|
+
if (I)
|
|
1391
1391
|
throw new Error("No access token available");
|
|
1392
|
-
return E(
|
|
1392
|
+
return E(W, h);
|
|
1393
1393
|
}
|
|
1394
|
-
const
|
|
1395
|
-
...
|
|
1394
|
+
const P = {
|
|
1395
|
+
...h,
|
|
1396
1396
|
headers: {
|
|
1397
|
-
...
|
|
1398
|
-
...
|
|
1397
|
+
...h.headers,
|
|
1398
|
+
...g ? { Authorization: `Bearer ${g}` } : {}
|
|
1399
1399
|
}
|
|
1400
1400
|
};
|
|
1401
|
-
return E(
|
|
1402
|
-
}, i = (
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1405
|
-
const
|
|
1406
|
-
...
|
|
1401
|
+
return E(W, P);
|
|
1402
|
+
}, i = (I) => (E, W) => {
|
|
1403
|
+
if (W.headers.Authorization)
|
|
1404
|
+
return I(E, W);
|
|
1405
|
+
const h = localStorage.getItem("__anon_id"), g = btoa(`${h}:`), P = {
|
|
1406
|
+
...W,
|
|
1407
1407
|
headers: {
|
|
1408
|
-
...
|
|
1409
|
-
Authorization: `Basic ${
|
|
1408
|
+
...W.headers,
|
|
1409
|
+
Authorization: `Basic ${g}`
|
|
1410
1410
|
}
|
|
1411
1411
|
};
|
|
1412
|
-
return
|
|
1412
|
+
return I(E, P);
|
|
1413
1413
|
}, o = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1414
1414
|
n,
|
|
1415
1415
|
r(),
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
tn(),
|
|
1417
|
+
nn({
|
|
1418
1418
|
delayTimer: 1e3,
|
|
1419
|
-
delayRamp: (
|
|
1419
|
+
delayRamp: (I, E) => I * E,
|
|
1420
1420
|
maxAttempts: 3,
|
|
1421
|
-
until: (
|
|
1421
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
|
|
1422
1422
|
retryOnNetworkError: !1
|
|
1423
1423
|
})
|
|
1424
1424
|
]), a = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1425
1425
|
n,
|
|
1426
1426
|
r(!1),
|
|
1427
1427
|
i,
|
|
1428
|
-
|
|
1429
|
-
|
|
1428
|
+
tn(),
|
|
1429
|
+
nn({
|
|
1430
1430
|
delayTimer: 1e3,
|
|
1431
|
-
delayRamp: (
|
|
1431
|
+
delayRamp: (I, E) => I * E,
|
|
1432
1432
|
maxAttempts: 3,
|
|
1433
|
-
until: (
|
|
1433
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
|
|
1434
1434
|
retryOnNetworkError: !1
|
|
1435
1435
|
})
|
|
1436
1436
|
]);
|
|
1437
1437
|
async function s() {
|
|
1438
1438
|
return o.get("/entitlements").json();
|
|
1439
1439
|
}
|
|
1440
|
-
async function
|
|
1440
|
+
async function f(I) {
|
|
1441
1441
|
const E = await o.get("/entitlements").json();
|
|
1442
|
-
return E == null ? void 0 : E.find((
|
|
1442
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1443
1443
|
}
|
|
1444
|
-
async function
|
|
1445
|
-
return o.get(`/entitlements/${
|
|
1444
|
+
async function p(I) {
|
|
1445
|
+
return o.get(`/entitlements/${I}/access`).json();
|
|
1446
1446
|
}
|
|
1447
1447
|
async function u() {
|
|
1448
1448
|
return o.get("/contracts").json();
|
|
1449
1449
|
}
|
|
1450
|
-
async function c(
|
|
1450
|
+
async function c(I) {
|
|
1451
1451
|
const E = await o.get("/contracts").json();
|
|
1452
|
-
return E == null ? void 0 : E.find((
|
|
1452
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1453
1453
|
}
|
|
1454
|
-
async function
|
|
1454
|
+
async function m() {
|
|
1455
1455
|
return o.get("/subscriptions").json();
|
|
1456
1456
|
}
|
|
1457
1457
|
async function d() {
|
|
1458
1458
|
return o.get("/bills").json();
|
|
1459
1459
|
}
|
|
1460
|
-
async function w(
|
|
1460
|
+
async function w(I) {
|
|
1461
1461
|
const E = await o.get("/bills").json();
|
|
1462
|
-
return E == null ? void 0 : E.find((
|
|
1462
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1463
1463
|
}
|
|
1464
|
-
async function I
|
|
1465
|
-
const
|
|
1466
|
-
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), te(),
|
|
1464
|
+
async function k(I, E) {
|
|
1465
|
+
const W = await o.url(`/user-metadata/${I}`).put(E).json();
|
|
1466
|
+
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), te(), W;
|
|
1467
1467
|
}
|
|
1468
|
-
async function v(
|
|
1469
|
-
const E = await o.url(`/user-metadata/${
|
|
1468
|
+
async function v(I) {
|
|
1469
|
+
const E = await o.url(`/user-metadata/${I}`).delete().res();
|
|
1470
1470
|
return te(), E.ok;
|
|
1471
1471
|
}
|
|
1472
|
-
async function _(
|
|
1473
|
-
return (await o.url(`/user-metadata/${
|
|
1472
|
+
async function _(I) {
|
|
1473
|
+
return (await o.url(`/user-metadata/${I}`).get().json())[I];
|
|
1474
1474
|
}
|
|
1475
1475
|
async function S() {
|
|
1476
1476
|
return await o.url("/user-metadata").get().json();
|
|
@@ -1478,90 +1478,95 @@ function Ei(t) {
|
|
|
1478
1478
|
async function y() {
|
|
1479
1479
|
return await o.url("/tags").get().json();
|
|
1480
1480
|
}
|
|
1481
|
-
async function l(
|
|
1482
|
-
const E = await o.url(`/tags/${
|
|
1481
|
+
async function l(I) {
|
|
1482
|
+
const E = await o.url(`/tags/${I}`).delete().res();
|
|
1483
1483
|
return te(), E.ok;
|
|
1484
1484
|
}
|
|
1485
|
-
async function
|
|
1486
|
-
const E = await o.url("/tags").post(
|
|
1485
|
+
async function b(I) {
|
|
1486
|
+
const E = await o.url("/tags").post(I).res();
|
|
1487
1487
|
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), te(), E.ok;
|
|
1488
1488
|
}
|
|
1489
|
-
async function
|
|
1490
|
-
return (await a.url("/tallies").get().json())[
|
|
1489
|
+
async function T(I) {
|
|
1490
|
+
return (await a.url("/tallies").get().json())[I];
|
|
1491
1491
|
}
|
|
1492
1492
|
async function O() {
|
|
1493
1493
|
return await a.url("/tallies").get().json();
|
|
1494
1494
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
const E = await a.url(`/tallies/${
|
|
1495
|
+
async function C(I) {
|
|
1496
|
+
const E = await a.url(`/tallies/${I}`).delete().res();
|
|
1497
1497
|
return te(), E.ok;
|
|
1498
1498
|
}
|
|
1499
|
-
async function
|
|
1500
|
-
return await a.url(`/tallies/${
|
|
1499
|
+
async function D(I, E) {
|
|
1500
|
+
return await a.url(`/tallies/${I}/push`).post(E).json();
|
|
1501
1501
|
}
|
|
1502
|
-
async function
|
|
1503
|
-
return await o.url(`/products/${
|
|
1502
|
+
async function z(I) {
|
|
1503
|
+
return await o.url(`/products/${I}`).get().json();
|
|
1504
1504
|
}
|
|
1505
|
-
async function
|
|
1506
|
-
return await o.url("/profile").get().json();
|
|
1505
|
+
async function F() {
|
|
1506
|
+
return await qn() ? await o.url("/profile").get().json() : null;
|
|
1507
1507
|
}
|
|
1508
|
-
async function
|
|
1509
|
-
const E = await o.url("/profile").patch(
|
|
1508
|
+
async function $(I) {
|
|
1509
|
+
const E = await o.url("/profile").patch(I).res();
|
|
1510
1510
|
return te(), E.ok;
|
|
1511
1511
|
}
|
|
1512
1512
|
async function R() {
|
|
1513
1513
|
return await o.url("/payment-issues").get().json();
|
|
1514
1514
|
}
|
|
1515
|
-
async function K(
|
|
1516
|
-
const E = await o.url(`/products/${
|
|
1515
|
+
async function K(I) {
|
|
1516
|
+
const E = await o.url(`/products/${I}/auto-onboard`).post().json();
|
|
1517
1517
|
return E.length && te(), E;
|
|
1518
1518
|
}
|
|
1519
|
+
async function j() {
|
|
1520
|
+
const I = await en(!1), E = new URL(`https://account.${Et}/subscriptions/${t.clientId}`);
|
|
1521
|
+
I && (E.hash = `#access_token=${I}`), window.location.href = E.toString();
|
|
1522
|
+
}
|
|
1519
1523
|
return {
|
|
1520
1524
|
getEntitlements: s,
|
|
1521
|
-
getEntitlement:
|
|
1522
|
-
getEntitlementAccess:
|
|
1525
|
+
getEntitlement: f,
|
|
1526
|
+
getEntitlementAccess: p,
|
|
1523
1527
|
getContracts: u,
|
|
1524
1528
|
getContract: c,
|
|
1525
|
-
getProfile:
|
|
1526
|
-
updateProfile:
|
|
1527
|
-
getSubscriptions:
|
|
1529
|
+
getProfile: F,
|
|
1530
|
+
updateProfile: $,
|
|
1531
|
+
getSubscriptions: m,
|
|
1528
1532
|
getBills: d,
|
|
1529
1533
|
getBill: w,
|
|
1530
|
-
setUserMetadata:
|
|
1534
|
+
setUserMetadata: k,
|
|
1531
1535
|
deleteUserMetadata: v,
|
|
1532
1536
|
getUserMetadata: _,
|
|
1533
1537
|
listUserMetadata: S,
|
|
1534
1538
|
getTags: y,
|
|
1535
1539
|
deleteTag: l,
|
|
1536
|
-
setTag:
|
|
1537
|
-
getTally:
|
|
1540
|
+
setTag: b,
|
|
1541
|
+
getTally: T,
|
|
1538
1542
|
getTallies: O,
|
|
1539
|
-
deleteTally:
|
|
1540
|
-
pushTally:
|
|
1541
|
-
getProduct:
|
|
1543
|
+
deleteTally: C,
|
|
1544
|
+
pushTally: D,
|
|
1545
|
+
getProduct: z,
|
|
1542
1546
|
getPaymentIssues: R,
|
|
1543
|
-
autoOnboardProduct: K
|
|
1547
|
+
autoOnboardProduct: K,
|
|
1548
|
+
openHostedAccountPage: j
|
|
1544
1549
|
};
|
|
1545
1550
|
}
|
|
1546
|
-
const
|
|
1547
|
-
function
|
|
1551
|
+
const ir = "@sesamy/sesamy-js", Rt = "1.3.2";
|
|
1552
|
+
function an(t, e, n, r, i) {
|
|
1548
1553
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1549
1554
|
t = t ? t[e[r]] : i;
|
|
1550
1555
|
return t === i ? n : t;
|
|
1551
1556
|
}
|
|
1552
|
-
var Je = "undefined",
|
|
1553
|
-
},
|
|
1557
|
+
var Je = "undefined", sn = "object", Tt = function() {
|
|
1558
|
+
}, or = "any", ar = "*", ve = "__", tt = typeof process < "u" ? process : {};
|
|
1554
1559
|
tt.env && tt.env.NODE_ENV;
|
|
1555
|
-
var
|
|
1560
|
+
var X = typeof document < "u";
|
|
1556
1561
|
tt.versions != null && tt.versions.node != null;
|
|
1557
1562
|
typeof Deno < "u" && Deno.core;
|
|
1558
|
-
|
|
1559
|
-
function
|
|
1563
|
+
X && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1564
|
+
function sr(t, e) {
|
|
1560
1565
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1561
1566
|
}
|
|
1562
|
-
var Pi =
|
|
1567
|
+
var Pi = sr.bind(null, "toUpperCase"), Ti = sr.bind(null, "toLowerCase");
|
|
1563
1568
|
function Oi(t) {
|
|
1564
|
-
return
|
|
1569
|
+
return cr(t) ? Pi("null") : typeof t == "object" ? Ai(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1565
1570
|
}
|
|
1566
1571
|
function nt(t, e) {
|
|
1567
1572
|
e === void 0 && (e = !0);
|
|
@@ -1573,13 +1578,13 @@ function We(t, e) {
|
|
|
1573
1578
|
}
|
|
1574
1579
|
var Y = We.bind(null, "function"), se = We.bind(null, "string"), Se = We.bind(null, "undefined"), ji = We.bind(null, "boolean");
|
|
1575
1580
|
We.bind(null, "symbol");
|
|
1576
|
-
function
|
|
1581
|
+
function cr(t) {
|
|
1577
1582
|
return t === null;
|
|
1578
1583
|
}
|
|
1579
1584
|
function Ci(t) {
|
|
1580
1585
|
return nt(t) === "number" && !isNaN(t);
|
|
1581
1586
|
}
|
|
1582
|
-
function
|
|
1587
|
+
function ur(t) {
|
|
1583
1588
|
return nt(t) === "array";
|
|
1584
1589
|
}
|
|
1585
1590
|
function V(t) {
|
|
@@ -1598,8 +1603,8 @@ function Ai(t) {
|
|
|
1598
1603
|
function $i(t) {
|
|
1599
1604
|
return t instanceof Error || se(t.message) && t.constructor && Ci(t.constructor.stackTraceLimit);
|
|
1600
1605
|
}
|
|
1601
|
-
function
|
|
1602
|
-
if (typeof e != "object" ||
|
|
1606
|
+
function lr(t, e) {
|
|
1607
|
+
if (typeof e != "object" || cr(e))
|
|
1603
1608
|
return !1;
|
|
1604
1609
|
if (e instanceof t)
|
|
1605
1610
|
return !0;
|
|
@@ -1612,8 +1617,8 @@ function cr(t, e) {
|
|
|
1612
1617
|
}
|
|
1613
1618
|
return !1;
|
|
1614
1619
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1620
|
+
lr.bind(null, TypeError);
|
|
1621
|
+
lr.bind(null, SyntaxError);
|
|
1617
1622
|
function ot(t, e) {
|
|
1618
1623
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1619
1624
|
return n && e ? Ni(t, e) : n;
|
|
@@ -1632,9 +1637,9 @@ at(ot, "button");
|
|
|
1632
1637
|
at(ot, "input");
|
|
1633
1638
|
at(ot, "select");
|
|
1634
1639
|
function Ui(t) {
|
|
1635
|
-
return t ?
|
|
1640
|
+
return t ? ur(t) ? t : [t] : [];
|
|
1636
1641
|
}
|
|
1637
|
-
function
|
|
1642
|
+
function cn(t) {
|
|
1638
1643
|
try {
|
|
1639
1644
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1640
1645
|
} catch {
|
|
@@ -1642,7 +1647,7 @@ function an(t) {
|
|
|
1642
1647
|
}
|
|
1643
1648
|
}
|
|
1644
1649
|
function zi() {
|
|
1645
|
-
if (
|
|
1650
|
+
if (X) {
|
|
1646
1651
|
var t = navigator, e = t.languages;
|
|
1647
1652
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1648
1653
|
}
|
|
@@ -1656,13 +1661,13 @@ function Ri() {
|
|
|
1656
1661
|
function Di(t) {
|
|
1657
1662
|
return function(e) {
|
|
1658
1663
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1659
|
-
var o =
|
|
1664
|
+
var o = cn(n[1]), a = cn(n[2]);
|
|
1660
1665
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1661
1666
|
}
|
|
1662
1667
|
for (var s in r) {
|
|
1663
|
-
var
|
|
1664
|
-
|
|
1665
|
-
return
|
|
1668
|
+
var f = s.split("[");
|
|
1669
|
+
f.length > 1 && (Li(r, f.map(function(p) {
|
|
1670
|
+
return p.replace(/[?[\]\\ ]/g, "");
|
|
1666
1671
|
}), r[s]), delete r[s]);
|
|
1667
1672
|
}
|
|
1668
1673
|
return r;
|
|
@@ -1671,7 +1676,7 @@ function Di(t) {
|
|
|
1671
1676
|
var n = e.match(/\?(.*)/);
|
|
1672
1677
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1673
1678
|
}
|
|
1674
|
-
return
|
|
1679
|
+
return X && window.location.search.substring(1);
|
|
1675
1680
|
}(t));
|
|
1676
1681
|
}
|
|
1677
1682
|
function Li(t, e, n) {
|
|
@@ -1695,13 +1700,13 @@ function Mi(t, e) {
|
|
|
1695
1700
|
a = /* @__PURE__ */ new Date(), o = null, i = t.apply(n, r);
|
|
1696
1701
|
};
|
|
1697
1702
|
return function() {
|
|
1698
|
-
var
|
|
1699
|
-
a || (a =
|
|
1700
|
-
var
|
|
1701
|
-
return n = this, r = arguments,
|
|
1703
|
+
var f = /* @__PURE__ */ new Date();
|
|
1704
|
+
a || (a = f);
|
|
1705
|
+
var p = e - (f - a);
|
|
1706
|
+
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = f, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
|
|
1702
1707
|
};
|
|
1703
1708
|
}
|
|
1704
|
-
var De = "global", je = ve + "global" + ve, Ce = typeof self ===
|
|
1709
|
+
var De = "global", je = ve + "global" + ve, Ce = typeof self === sn && self.self === self && self || typeof global === sn && global.global === global && global || void 0;
|
|
1705
1710
|
function we(t) {
|
|
1706
1711
|
return Ce[je][t];
|
|
1707
1712
|
}
|
|
@@ -1714,7 +1719,7 @@ function Ae(t) {
|
|
|
1714
1719
|
function $e(t, e, n) {
|
|
1715
1720
|
var r;
|
|
1716
1721
|
try {
|
|
1717
|
-
if (
|
|
1722
|
+
if (Dt(t)) {
|
|
1718
1723
|
var i = window[t];
|
|
1719
1724
|
r = i[e].bind(i);
|
|
1720
1725
|
}
|
|
@@ -1724,7 +1729,7 @@ function $e(t, e, n) {
|
|
|
1724
1729
|
}
|
|
1725
1730
|
Ce[je] || (Ce[je] = {});
|
|
1726
1731
|
var Xe = {};
|
|
1727
|
-
function
|
|
1732
|
+
function Dt(t) {
|
|
1728
1733
|
if (typeof Xe[t] !== Je)
|
|
1729
1734
|
return Xe[t];
|
|
1730
1735
|
try {
|
|
@@ -1735,30 +1740,30 @@ function Rt(t) {
|
|
|
1735
1740
|
}
|
|
1736
1741
|
return Xe[t] = !0;
|
|
1737
1742
|
}
|
|
1738
|
-
function
|
|
1739
|
-
return
|
|
1743
|
+
function A() {
|
|
1744
|
+
return A = Object.assign || function(t) {
|
|
1740
1745
|
for (var e = 1; e < arguments.length; e++) {
|
|
1741
1746
|
var n = arguments[e];
|
|
1742
1747
|
for (var r in n)
|
|
1743
1748
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1744
1749
|
}
|
|
1745
1750
|
return t;
|
|
1746
|
-
},
|
|
1751
|
+
}, A.apply(this, arguments);
|
|
1747
1752
|
}
|
|
1748
|
-
var ae = "function", ie = "undefined", Zi = "@@redux/" + Math.random().toString(36),
|
|
1753
|
+
var ae = "function", ie = "undefined", Zi = "@@redux/" + Math.random().toString(36), un = /* @__PURE__ */ function() {
|
|
1749
1754
|
return typeof Symbol === ae && Symbol.observable || "@@observable";
|
|
1750
1755
|
}(), Ve = " != " + ae;
|
|
1751
|
-
function
|
|
1756
|
+
function dr(t, e, n) {
|
|
1752
1757
|
var r;
|
|
1753
1758
|
if (typeof e === ae && typeof n === ie && (n = e, e = void 0), typeof n !== ie) {
|
|
1754
1759
|
if (typeof n !== ae)
|
|
1755
1760
|
throw new Error("enhancer" + Ve);
|
|
1756
|
-
return n(
|
|
1761
|
+
return n(dr)(t, e);
|
|
1757
1762
|
}
|
|
1758
1763
|
if (typeof t !== ae)
|
|
1759
1764
|
throw new Error("reducer" + Ve);
|
|
1760
|
-
var i = t, o = e, a = [], s = a,
|
|
1761
|
-
function
|
|
1765
|
+
var i = t, o = e, a = [], s = a, f = !1;
|
|
1766
|
+
function p() {
|
|
1762
1767
|
s === a && (s = a.slice());
|
|
1763
1768
|
}
|
|
1764
1769
|
function u() {
|
|
@@ -1768,44 +1773,44 @@ function ur(t, e, n) {
|
|
|
1768
1773
|
if (typeof d !== ae)
|
|
1769
1774
|
throw new Error("Listener" + Ve);
|
|
1770
1775
|
var w = !0;
|
|
1771
|
-
return
|
|
1776
|
+
return p(), s.push(d), function() {
|
|
1772
1777
|
if (w) {
|
|
1773
|
-
w = !1,
|
|
1774
|
-
var
|
|
1775
|
-
s.splice(
|
|
1778
|
+
w = !1, p();
|
|
1779
|
+
var k = s.indexOf(d);
|
|
1780
|
+
s.splice(k, 1);
|
|
1776
1781
|
}
|
|
1777
1782
|
};
|
|
1778
1783
|
}
|
|
1779
|
-
function
|
|
1784
|
+
function m(d) {
|
|
1780
1785
|
if (!V(d))
|
|
1781
1786
|
throw new Error("Act != obj");
|
|
1782
1787
|
if (typeof d.type === ie)
|
|
1783
1788
|
throw new Error("ActType " + ie);
|
|
1784
|
-
if (
|
|
1789
|
+
if (f)
|
|
1785
1790
|
throw new Error("Dispatch in reducer");
|
|
1786
1791
|
try {
|
|
1787
|
-
|
|
1792
|
+
f = !0, o = i(o, d);
|
|
1788
1793
|
} finally {
|
|
1789
|
-
|
|
1794
|
+
f = !1;
|
|
1790
1795
|
}
|
|
1791
|
-
for (var w = a = s,
|
|
1792
|
-
(0, w[
|
|
1796
|
+
for (var w = a = s, k = 0; k < w.length; k++)
|
|
1797
|
+
(0, w[k])();
|
|
1793
1798
|
return d;
|
|
1794
1799
|
}
|
|
1795
|
-
return
|
|
1800
|
+
return m({ type: "@@redux/INIT" }), (r = { dispatch: m, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1796
1801
|
if (typeof d !== ae)
|
|
1797
1802
|
throw new Error("next reducer" + Ve);
|
|
1798
|
-
i = d,
|
|
1799
|
-
} })[
|
|
1803
|
+
i = d, m({ type: "@@redux/INIT" });
|
|
1804
|
+
} })[un] = function() {
|
|
1800
1805
|
var d, w = c;
|
|
1801
|
-
return (d = { subscribe: function(
|
|
1802
|
-
if (typeof
|
|
1806
|
+
return (d = { subscribe: function(k) {
|
|
1807
|
+
if (typeof k != "object")
|
|
1803
1808
|
throw new TypeError("Observer != obj");
|
|
1804
1809
|
function v() {
|
|
1805
|
-
|
|
1810
|
+
k.next && k.next(u());
|
|
1806
1811
|
}
|
|
1807
1812
|
return v(), { unsubscribe: w(v) };
|
|
1808
|
-
} })[
|
|
1813
|
+
} })[un] = function() {
|
|
1809
1814
|
return this;
|
|
1810
1815
|
}, d;
|
|
1811
1816
|
}, r;
|
|
@@ -1828,44 +1833,44 @@ function Wi() {
|
|
|
1828
1833
|
var t = arguments;
|
|
1829
1834
|
return function(e) {
|
|
1830
1835
|
return function(n, r, i) {
|
|
1831
|
-
var o, a = e(n, r, i), s = a.dispatch,
|
|
1832
|
-
return s(
|
|
1836
|
+
var o, a = e(n, r, i), s = a.dispatch, f = { getState: a.getState, dispatch: function(p) {
|
|
1837
|
+
return s(p);
|
|
1833
1838
|
} };
|
|
1834
|
-
return o = [].slice.call(t).map(function(
|
|
1835
|
-
return f
|
|
1836
|
-
}),
|
|
1839
|
+
return o = [].slice.call(t).map(function(p) {
|
|
1840
|
+
return p(f);
|
|
1841
|
+
}), A({}, a, { dispatch: s = xe.apply(void 0, o)(a.dispatch) });
|
|
1837
1842
|
};
|
|
1838
1843
|
};
|
|
1839
1844
|
}
|
|
1840
|
-
var ce = ve + "anon_id", ye = ve + "user_id", Ee = ve + "user_traits", oe = "userId", _e = "anonymousId", et = ["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"],
|
|
1845
|
+
var ce = ve + "anon_id", ye = ve + "user_id", Ee = ve + "user_traits", oe = "userId", _e = "anonymousId", et = ["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"], Ot = ["name", "EVENTS", "config", "loaded"], x = et.reduce(function(t, e) {
|
|
1841
1846
|
return t[e] = e, t;
|
|
1842
1847
|
}, { registerPluginType: function(t) {
|
|
1843
1848
|
return "registerPlugin:" + t;
|
|
1844
1849
|
}, pluginReadyType: function(t) {
|
|
1845
1850
|
return "ready:" + t;
|
|
1846
|
-
} }),
|
|
1851
|
+
} }), ln = /^utm_/, dn = /^an_prop_/, hn = /^an_trait_/;
|
|
1847
1852
|
function Hi(t) {
|
|
1848
1853
|
var e = t.storage.setItem;
|
|
1849
1854
|
return function(n) {
|
|
1850
1855
|
return function(r) {
|
|
1851
1856
|
return function(i) {
|
|
1852
|
-
if (i.type ===
|
|
1853
|
-
var o = i.params, a = i.user, s = i.persistedUser,
|
|
1854
|
-
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId),
|
|
1857
|
+
if (i.type === x.bootstrap) {
|
|
1858
|
+
var o = i.params, a = i.user, s = i.persistedUser, f = i.initialUser, p = s.userId === a.userId;
|
|
1859
|
+
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), p || e(ye, a.userId), f.traits && e(Ee, A({}, p && s.traits ? s.traits : {}, f.traits));
|
|
1855
1860
|
var u = Object.keys(i.params);
|
|
1856
1861
|
if (u.length) {
|
|
1857
|
-
var c = o.an_uid,
|
|
1858
|
-
if (
|
|
1859
|
-
var v =
|
|
1860
|
-
w.campaign[v === "campaign" ? "name" : v] = o[
|
|
1862
|
+
var c = o.an_uid, m = o.an_event, d = u.reduce(function(w, k) {
|
|
1863
|
+
if (k.match(ln) || k.match(/^(d|g)clid/)) {
|
|
1864
|
+
var v = k.replace(ln, "");
|
|
1865
|
+
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1861
1866
|
}
|
|
1862
|
-
return
|
|
1867
|
+
return k.match(dn) && (w.props[k.replace(dn, "")] = o[k]), k.match(hn) && (w.traits[k.replace(hn, "")] = o[k]), w;
|
|
1863
1868
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1864
|
-
n.dispatch(
|
|
1869
|
+
n.dispatch(A({ type: x.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1865
1870
|
return t.identify(c, d.traits);
|
|
1866
|
-
}, 0),
|
|
1867
|
-
return t.track(
|
|
1868
|
-
}, 0), Object.keys(d.campaign).length && n.dispatch({ type:
|
|
1871
|
+
}, 0), m && setTimeout(function() {
|
|
1872
|
+
return t.track(m, d.props);
|
|
1873
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: x.campaign, campaign: d.campaign });
|
|
1869
1874
|
}
|
|
1870
1875
|
}
|
|
1871
1876
|
return r(i);
|
|
@@ -1875,16 +1880,16 @@ function Hi(t) {
|
|
|
1875
1880
|
}
|
|
1876
1881
|
function Fi(t) {
|
|
1877
1882
|
return function(e, n) {
|
|
1878
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1883
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === x.setItemEnd) {
|
|
1879
1884
|
if (n.key === ce)
|
|
1880
|
-
return
|
|
1885
|
+
return A({}, e, { anonymousId: n.value });
|
|
1881
1886
|
if (n.key === ye)
|
|
1882
|
-
return
|
|
1887
|
+
return A({}, e, { userId: n.value });
|
|
1883
1888
|
}
|
|
1884
1889
|
switch (n.type) {
|
|
1885
|
-
case
|
|
1886
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1887
|
-
case
|
|
1890
|
+
case x.identify:
|
|
1891
|
+
return Object.assign({}, e, { userId: n.userId, traits: A({}, e.traits, n.traits) });
|
|
1892
|
+
case x.reset:
|
|
1888
1893
|
return [ye, ce, Ee].forEach(function(r) {
|
|
1889
1894
|
t.removeItem(r);
|
|
1890
1895
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
@@ -1893,10 +1898,10 @@ function Fi(t) {
|
|
|
1893
1898
|
}
|
|
1894
1899
|
};
|
|
1895
1900
|
}
|
|
1896
|
-
function
|
|
1901
|
+
function fn(t) {
|
|
1897
1902
|
return { userId: t.getItem(ye), anonymousId: t.getItem(ce), traits: t.getItem(Ee) };
|
|
1898
1903
|
}
|
|
1899
|
-
var
|
|
1904
|
+
var jt = function(t) {
|
|
1900
1905
|
return ve + "TEMP" + ve + t;
|
|
1901
1906
|
};
|
|
1902
1907
|
function Ji(t) {
|
|
@@ -1904,15 +1909,15 @@ function Ji(t) {
|
|
|
1904
1909
|
return function(o) {
|
|
1905
1910
|
return function(a) {
|
|
1906
1911
|
return function(s) {
|
|
1907
|
-
var
|
|
1908
|
-
if (s.type ===
|
|
1912
|
+
var f = s.userId, p = s.traits, u = s.options;
|
|
1913
|
+
if (s.type === x.reset && ([ye, Ee, ce].forEach(function(d) {
|
|
1909
1914
|
r(d);
|
|
1910
1915
|
}), [oe, _e, "traits"].forEach(function(d) {
|
|
1911
|
-
Ae(
|
|
1912
|
-
})), s.type ===
|
|
1916
|
+
Ae(jt(d));
|
|
1917
|
+
})), s.type === x.identify) {
|
|
1913
1918
|
i(ce) || n(ce, st());
|
|
1914
|
-
var c = i(ye),
|
|
1915
|
-
c && c !==
|
|
1919
|
+
var c = i(ye), m = i(Ee) || {};
|
|
1920
|
+
c && c !== f && o.dispatch({ type: x.userIdChanged, old: { userId: c, traits: m }, new: { userId: f, traits: p }, options: u }), f && n(ye, f), p && n(Ee, A({}, m, p));
|
|
1916
1921
|
}
|
|
1917
1922
|
return a(s);
|
|
1918
1923
|
};
|
|
@@ -1920,118 +1925,118 @@ function Ji(t) {
|
|
|
1920
1925
|
};
|
|
1921
1926
|
}
|
|
1922
1927
|
var Re = {};
|
|
1923
|
-
function
|
|
1928
|
+
function pn(t, e) {
|
|
1924
1929
|
Re[t] && Y(Re[t]) && (Re[t](e), delete Re[t]);
|
|
1925
1930
|
}
|
|
1926
|
-
function
|
|
1931
|
+
function hr(t, e, n) {
|
|
1927
1932
|
return new Promise(function(r, i) {
|
|
1928
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1933
|
+
return e() ? r(t) : n < 1 ? i(A({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1929
1934
|
return setTimeout(o, 10);
|
|
1930
1935
|
}).then(function(o) {
|
|
1931
|
-
return
|
|
1936
|
+
return hr(t, e, n - 10).then(r, i);
|
|
1932
1937
|
});
|
|
1933
1938
|
});
|
|
1934
1939
|
}
|
|
1935
1940
|
function Xi(t) {
|
|
1936
1941
|
return { abort: t };
|
|
1937
1942
|
}
|
|
1938
|
-
function
|
|
1939
|
-
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue,
|
|
1943
|
+
function fr(t, e, n) {
|
|
1944
|
+
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, f = o.user;
|
|
1940
1945
|
if (!o.context.offline && s && s.actions && s.actions.length) {
|
|
1941
|
-
var
|
|
1942
|
-
return a[
|
|
1946
|
+
var p = s.actions.reduce(function(c, m, d) {
|
|
1947
|
+
return a[m.plugin].loaded ? (c.process.push(m), c.processIndex.push(d)) : (c.requeue.push(m), c.requeueIndex.push(d)), c;
|
|
1943
1948
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1946
|
-
var
|
|
1947
|
-
if (
|
|
1948
|
-
var v, _ = function(l,
|
|
1949
|
-
return l === void 0 && (l = {}),
|
|
1950
|
-
return l.hasOwnProperty(O) &&
|
|
1949
|
+
if (p.processIndex && p.processIndex.length) {
|
|
1950
|
+
p.processIndex.forEach(function(c) {
|
|
1951
|
+
var m = s.actions[c], d = m.plugin, w = m.payload.type, k = i[d][w];
|
|
1952
|
+
if (k && Y(k)) {
|
|
1953
|
+
var v, _ = function(l, b) {
|
|
1954
|
+
return l === void 0 && (l = {}), b === void 0 && (b = {}), [oe, _e].reduce(function(T, O) {
|
|
1955
|
+
return l.hasOwnProperty(O) && b[O] && b[O] !== l[O] && (T[O] = b[O]), T;
|
|
1951
1956
|
}, l);
|
|
1952
|
-
}(
|
|
1953
|
-
if (!S && (v =
|
|
1957
|
+
}(m.payload, f), S = r[_.meta.rid];
|
|
1958
|
+
if (!S && (v = k({ payload: _, config: a[d].config, instance: n, abort: Xi })) && V(v) && v.abort)
|
|
1954
1959
|
return void (r[_.meta.rid] = !0);
|
|
1955
1960
|
if (!S) {
|
|
1956
1961
|
var y = w + ":" + d;
|
|
1957
|
-
t.dispatch(
|
|
1962
|
+
t.dispatch(A({}, _, { type: y, _: { called: y, from: "queueDrain" } }));
|
|
1958
1963
|
}
|
|
1959
1964
|
}
|
|
1960
1965
|
});
|
|
1961
|
-
var u = s.actions.filter(function(c,
|
|
1962
|
-
return !~
|
|
1966
|
+
var u = s.actions.filter(function(c, m) {
|
|
1967
|
+
return !~p.processIndex.indexOf(m);
|
|
1963
1968
|
});
|
|
1964
1969
|
s.actions = u;
|
|
1965
1970
|
}
|
|
1966
1971
|
}
|
|
1967
1972
|
}
|
|
1968
1973
|
var mt = function(t) {
|
|
1969
|
-
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store,
|
|
1974
|
+
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;
|
|
1970
1975
|
try {
|
|
1971
|
-
var
|
|
1976
|
+
var p = i.plugins, u = i.context, c = n.type, m = c.match(Pe), d = e.exact.map(function(v) {
|
|
1972
1977
|
return v.pluginName;
|
|
1973
1978
|
});
|
|
1974
|
-
|
|
1979
|
+
m && (d = a.during.map(function(v) {
|
|
1975
1980
|
return v.pluginName;
|
|
1976
1981
|
}));
|
|
1977
1982
|
var w = /* @__PURE__ */ function(v, _) {
|
|
1978
1983
|
return function(S, y, l) {
|
|
1979
|
-
var
|
|
1984
|
+
var b = y.config, T = y.name, O = T + "." + S.type;
|
|
1980
1985
|
l && (O = l.event);
|
|
1981
|
-
var
|
|
1982
|
-
return function(K,
|
|
1983
|
-
var
|
|
1984
|
-
if (
|
|
1985
|
-
throw new Error("Method " +
|
|
1986
|
-
return
|
|
1986
|
+
var C = S.type.match(Pe) ? /* @__PURE__ */ function(D, z, F, $, R) {
|
|
1987
|
+
return function(K, j) {
|
|
1988
|
+
var I = $ ? $.name : D, E = j && Ke(j) ? j : F;
|
|
1989
|
+
if ($ && (!(E = j && Ke(j) ? j : [D]).includes(D) || E.length !== 1))
|
|
1990
|
+
throw new Error("Method " + z + " can only abort " + D + " plugin. " + JSON.stringify(E) + " input valid");
|
|
1991
|
+
return A({}, R, { abort: { reason: K, plugins: E, caller: z, _: I } });
|
|
1987
1992
|
};
|
|
1988
|
-
}(
|
|
1993
|
+
}(T, O, _, l, S) : /* @__PURE__ */ function(D, z) {
|
|
1989
1994
|
return function() {
|
|
1990
|
-
throw new Error(
|
|
1995
|
+
throw new Error(D.type + " action not cancellable. Remove abort in " + z);
|
|
1991
1996
|
};
|
|
1992
1997
|
}(S, O);
|
|
1993
|
-
return { payload: Vi(S), instance: v, config:
|
|
1998
|
+
return { payload: Vi(S), instance: v, config: b || {}, abort: C };
|
|
1994
1999
|
};
|
|
1995
|
-
}(r, d),
|
|
2000
|
+
}(r, d), k = e.exact.reduce(function(v, _) {
|
|
1996
2001
|
var S = _.pluginName, y = _.methodName, l = !1;
|
|
1997
|
-
return y.match(/^initialize/) || y.match(/^reset/) || (l = !
|
|
2002
|
+
return y.match(/^initialize/) || y.match(/^reset/) || (l = !p[S].loaded), u.offline && y.match(/^(page|track|identify)/) && (l = !0), v["" + S] = l, v;
|
|
1998
2003
|
}, {});
|
|
1999
2004
|
return Promise.resolve(e.exact.reduce(function(v, _, S) {
|
|
2000
2005
|
try {
|
|
2001
2006
|
var y = _.pluginName;
|
|
2002
2007
|
return Promise.resolve(v).then(function(l) {
|
|
2003
|
-
function
|
|
2008
|
+
function b() {
|
|
2004
2009
|
return Promise.resolve(l);
|
|
2005
2010
|
}
|
|
2006
|
-
var
|
|
2011
|
+
var T = function() {
|
|
2007
2012
|
if (e.namespaced && e.namespaced[y])
|
|
2008
|
-
return Promise.resolve(e.namespaced[y].reduce(function(O,
|
|
2013
|
+
return Promise.resolve(e.namespaced[y].reduce(function(O, C, D) {
|
|
2009
2014
|
try {
|
|
2010
|
-
return Promise.resolve(O).then(function(
|
|
2011
|
-
return
|
|
2012
|
-
var
|
|
2013
|
-
if (
|
|
2014
|
-
var
|
|
2015
|
-
throw new Error([
|
|
2015
|
+
return Promise.resolve(O).then(function(z) {
|
|
2016
|
+
return C.method && Y(C.method) ? (function(K, j) {
|
|
2017
|
+
var I = kn(K);
|
|
2018
|
+
if (I && I.name === j) {
|
|
2019
|
+
var E = kn(I.method);
|
|
2020
|
+
throw new Error([j + " plugin is calling method " + K, "Plugins cant call self", "Use " + I.method + " " + (E ? "or " + E.method : "") + " in " + j + " plugin insteadof " + K].join(`
|
|
2016
2021
|
`));
|
|
2017
2022
|
}
|
|
2018
|
-
}(
|
|
2019
|
-
return
|
|
2020
|
-
}), config:
|
|
2021
|
-
var
|
|
2022
|
-
return Promise.resolve(
|
|
2023
|
-
})) :
|
|
2024
|
-
var
|
|
2023
|
+
}(C.methodName, C.pluginName), Promise.resolve(C.method({ payload: z, instance: r, abort: (F = z, $ = y, R = C.pluginName, function(K, j) {
|
|
2024
|
+
return A({}, F, { abort: { reason: K, plugins: j || [$], caller: c, from: R || $ } });
|
|
2025
|
+
}), config: yn(C.pluginName, p, o), plugins: p })).then(function(K) {
|
|
2026
|
+
var j = V(K) ? K : {};
|
|
2027
|
+
return Promise.resolve(A({}, z, j));
|
|
2028
|
+
})) : z;
|
|
2029
|
+
var F, $, R;
|
|
2025
2030
|
});
|
|
2026
|
-
} catch (
|
|
2027
|
-
return Promise.reject(
|
|
2031
|
+
} catch (z) {
|
|
2032
|
+
return Promise.reject(z);
|
|
2028
2033
|
}
|
|
2029
2034
|
}, Promise.resolve(n))).then(function(O) {
|
|
2030
2035
|
l[y] = O;
|
|
2031
2036
|
});
|
|
2032
2037
|
l[y] = n;
|
|
2033
2038
|
}();
|
|
2034
|
-
return
|
|
2039
|
+
return T && T.then ? T.then(b) : b();
|
|
2035
2040
|
});
|
|
2036
2041
|
} catch (l) {
|
|
2037
2042
|
return Promise.reject(l);
|
|
@@ -2039,36 +2044,36 @@ var mt = function(t) {
|
|
|
2039
2044
|
}, Promise.resolve({}))).then(function(v) {
|
|
2040
2045
|
return Promise.resolve(e.exact.reduce(function(_, S, y) {
|
|
2041
2046
|
try {
|
|
2042
|
-
var l = e.exact.length === y + 1,
|
|
2047
|
+
var l = e.exact.length === y + 1, b = S.pluginName, T = o[b];
|
|
2043
2048
|
return Promise.resolve(_).then(function(O) {
|
|
2044
|
-
var
|
|
2045
|
-
if (
|
|
2046
|
-
return gt({ data:
|
|
2047
|
-
if (yt(O,
|
|
2049
|
+
var C = v[b] ? v[b] : {};
|
|
2050
|
+
if (m && (C = O), yt(C, b))
|
|
2051
|
+
return gt({ data: C, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(O);
|
|
2052
|
+
if (yt(O, b))
|
|
2048
2053
|
return l && gt({ data: O, method: c, instance: r, store: s }), Promise.resolve(O);
|
|
2049
|
-
if (
|
|
2050
|
-
return s.dispatch({ type: "queue", plugin:
|
|
2051
|
-
var
|
|
2052
|
-
return Promise.resolve(
|
|
2053
|
-
var
|
|
2054
|
-
if (yt(R,
|
|
2055
|
-
gt({ data: R, method: c, instance: r, pluginName:
|
|
2054
|
+
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
2055
|
+
return s.dispatch({ type: "queue", plugin: b, payload: C, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(O);
|
|
2056
|
+
var D = w(v[b], o[b]);
|
|
2057
|
+
return Promise.resolve(T[c]({ abort: D.abort, payload: C, instance: r, config: yn(b, p, o), plugins: p })).then(function(z) {
|
|
2058
|
+
var F = V(z) ? z : {}, $ = A({}, O, F), R = v[b];
|
|
2059
|
+
if (yt(R, b))
|
|
2060
|
+
gt({ data: R, method: c, instance: r, pluginName: b, store: s });
|
|
2056
2061
|
else {
|
|
2057
|
-
var K = c + ":" +
|
|
2058
|
-
(K.match(/:/g) || []).length < 2 && !c.match(
|
|
2062
|
+
var K = c + ":" + b;
|
|
2063
|
+
(K.match(/:/g) || []).length < 2 && !c.match(mn) && !c.match(gn) && r.dispatch(A({}, m ? $ : C, { type: K, _: { called: K, from: "submethod" } }));
|
|
2059
2064
|
}
|
|
2060
|
-
return Promise.resolve(
|
|
2065
|
+
return Promise.resolve($);
|
|
2061
2066
|
});
|
|
2062
2067
|
});
|
|
2063
2068
|
} catch (O) {
|
|
2064
2069
|
return Promise.reject(O);
|
|
2065
2070
|
}
|
|
2066
2071
|
}, Promise.resolve(n))).then(function(_) {
|
|
2067
|
-
if (!(c.match(Pe) || c.match(/^registerPlugin/) || c.match(
|
|
2068
|
-
if (
|
|
2072
|
+
if (!(c.match(Pe) || c.match(/^registerPlugin/) || c.match(gn) || c.match(mn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
2073
|
+
if (f.plugins.includes(c), _._ && _._.originalAction === c)
|
|
2069
2074
|
return _;
|
|
2070
|
-
var S =
|
|
2071
|
-
|
|
2075
|
+
var S = A({}, _, { _: { originalAction: _.type, called: _.type, from: "engineEnd" } });
|
|
2076
|
+
pr(_, e.exact.length) && !c.match(/End$/) && (S = A({}, S, { type: _.type + "Aborted" })), s.dispatch(S);
|
|
2072
2077
|
}
|
|
2073
2078
|
return _;
|
|
2074
2079
|
});
|
|
@@ -2076,29 +2081,29 @@ var mt = function(t) {
|
|
|
2076
2081
|
} catch (v) {
|
|
2077
2082
|
return Promise.reject(v);
|
|
2078
2083
|
}
|
|
2079
|
-
}, Pe = /Start$/,
|
|
2084
|
+
}, Pe = /Start$/, mn = /^bootstrap/, gn = /^ready/;
|
|
2080
2085
|
function gt(t) {
|
|
2081
2086
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
2082
|
-
t.store.dispatch(
|
|
2087
|
+
t.store.dispatch(A({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2083
2088
|
}
|
|
2084
|
-
function
|
|
2089
|
+
function yn(t, e, n) {
|
|
2085
2090
|
var r = e[t] || n[t];
|
|
2086
2091
|
return r && r.config ? r.config : {};
|
|
2087
2092
|
}
|
|
2088
|
-
function
|
|
2093
|
+
function vn(t, e) {
|
|
2089
2094
|
return e.reduce(function(n, r) {
|
|
2090
2095
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
2091
2096
|
}, []);
|
|
2092
2097
|
}
|
|
2093
|
-
function
|
|
2098
|
+
function wn(t, e) {
|
|
2094
2099
|
var n = t.replace(Pe, ""), r = e ? ":" + e : "";
|
|
2095
2100
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
2096
2101
|
}
|
|
2097
2102
|
function yt(t, e) {
|
|
2098
2103
|
var n = t.abort;
|
|
2099
|
-
return !!n && (n === !0 ||
|
|
2104
|
+
return !!n && (n === !0 || bn(n, e) || n && bn(n.plugins, e));
|
|
2100
2105
|
}
|
|
2101
|
-
function
|
|
2106
|
+
function pr(t, e) {
|
|
2102
2107
|
var n = t.abort;
|
|
2103
2108
|
if (!n)
|
|
2104
2109
|
return !1;
|
|
@@ -2110,10 +2115,10 @@ function hr(t, e) {
|
|
|
2110
2115
|
function Ke(t) {
|
|
2111
2116
|
return Array.isArray(t);
|
|
2112
2117
|
}
|
|
2113
|
-
function
|
|
2118
|
+
function bn(t, e) {
|
|
2114
2119
|
return !(!t || !Ke(t)) && t.includes(e);
|
|
2115
2120
|
}
|
|
2116
|
-
function
|
|
2121
|
+
function kn(t) {
|
|
2117
2122
|
var e = t.match(/(.*):(.*)/);
|
|
2118
2123
|
return !!e && { method: e[1], name: e[2] };
|
|
2119
2124
|
}
|
|
@@ -2128,105 +2133,105 @@ function Yi(t, e, n) {
|
|
|
2128
2133
|
return function(o) {
|
|
2129
2134
|
return function(a) {
|
|
2130
2135
|
try {
|
|
2131
|
-
var s,
|
|
2136
|
+
var s, f = function(l) {
|
|
2132
2137
|
return s ? l : o(c);
|
|
2133
|
-
},
|
|
2138
|
+
}, p = a.type, u = a.plugins, c = a;
|
|
2134
2139
|
if (a.abort)
|
|
2135
2140
|
return Promise.resolve(o(a));
|
|
2136
|
-
if (
|
|
2137
|
-
return
|
|
2138
|
-
}, 0),
|
|
2139
|
-
var
|
|
2141
|
+
if (p === x.enablePlugin && i.dispatch({ type: x.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === x.disablePlugin && setTimeout(function() {
|
|
2142
|
+
return pn(a.meta.rid, { payload: a });
|
|
2143
|
+
}, 0), p === x.initializeEnd) {
|
|
2144
|
+
var m = e(), d = Object.keys(m), w = d.filter(function(l) {
|
|
2140
2145
|
return u.includes(l);
|
|
2141
2146
|
}).map(function(l) {
|
|
2142
|
-
return
|
|
2143
|
-
}),
|
|
2144
|
-
var
|
|
2145
|
-
return
|
|
2146
|
-
return
|
|
2147
|
-
}, 1e4).then(function(
|
|
2148
|
-
return r[
|
|
2149
|
-
return !
|
|
2150
|
-
}) }), r[
|
|
2151
|
-
}).catch(function(
|
|
2152
|
-
if (
|
|
2153
|
-
throw new Error(
|
|
2154
|
-
return v = v.concat(
|
|
2147
|
+
return m[l];
|
|
2148
|
+
}), k = [], v = [], _ = a.disabled, S = w.map(function(l) {
|
|
2149
|
+
var b = l.loaded, T = l.name, O = l.config;
|
|
2150
|
+
return hr(l, function() {
|
|
2151
|
+
return b({ config: O });
|
|
2152
|
+
}, 1e4).then(function(C) {
|
|
2153
|
+
return r[T] || (i.dispatch({ type: x.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(D) {
|
|
2154
|
+
return !Ot.includes(D);
|
|
2155
|
+
}) }), r[T] = !0), k = k.concat(T), l;
|
|
2156
|
+
}).catch(function(C) {
|
|
2157
|
+
if (C instanceof Error)
|
|
2158
|
+
throw new Error(C);
|
|
2159
|
+
return v = v.concat(C.name), C;
|
|
2155
2160
|
});
|
|
2156
2161
|
});
|
|
2157
2162
|
Promise.all(S).then(function(l) {
|
|
2158
|
-
var
|
|
2163
|
+
var b = { plugins: k, failed: v, disabled: _ };
|
|
2159
2164
|
setTimeout(function() {
|
|
2160
|
-
d.length === S.length + _.length && i.dispatch(
|
|
2165
|
+
d.length === S.length + _.length && i.dispatch(A({}, { type: x.ready }, b));
|
|
2161
2166
|
}, 0);
|
|
2162
2167
|
});
|
|
2163
2168
|
}
|
|
2164
2169
|
var y = function() {
|
|
2165
|
-
if (
|
|
2166
|
-
return /^ready:([^:]*)$/.test(
|
|
2167
|
-
return
|
|
2168
|
-
}, 0), Promise.resolve(function(l,
|
|
2170
|
+
if (p !== x.bootstrap)
|
|
2171
|
+
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2172
|
+
return fr(i, e, t);
|
|
2173
|
+
}, 0), Promise.resolve(function(l, b, T, O, C) {
|
|
2169
2174
|
try {
|
|
2170
|
-
var
|
|
2175
|
+
var D = Y(b) ? b() : b, z = l.type, F = z.replace(Pe, "");
|
|
2171
2176
|
if (l._ && l._.called)
|
|
2172
2177
|
return Promise.resolve(l);
|
|
2173
|
-
var
|
|
2174
|
-
var g =
|
|
2175
|
-
return ji(g[
|
|
2176
|
-
}).map(function(
|
|
2177
|
-
return
|
|
2178
|
+
var $ = T.getState(), R = (I = D, (E = $.plugins) === void 0 && (E = {}), (W = l.options) === void 0 && (W = {}), Object.keys(I).filter(function(h) {
|
|
2179
|
+
var g = W.plugins || {};
|
|
2180
|
+
return ji(g[h]) ? g[h] : g.all !== !1 && (!E[h] || E[h].enabled !== !1);
|
|
2181
|
+
}).map(function(h) {
|
|
2182
|
+
return I[h];
|
|
2178
2183
|
}));
|
|
2179
|
-
|
|
2180
|
-
var g =
|
|
2181
|
-
return l.plugins.includes(
|
|
2182
|
-
}).map(function(
|
|
2183
|
-
return
|
|
2184
|
+
z === x.initializeStart && l.fromEnable && (R = Object.keys($.plugins).filter(function(h) {
|
|
2185
|
+
var g = $.plugins[h];
|
|
2186
|
+
return l.plugins.includes(h) && !g.initialized;
|
|
2187
|
+
}).map(function(h) {
|
|
2188
|
+
return D[h];
|
|
2184
2189
|
}));
|
|
2185
|
-
var K = R.map(function(
|
|
2186
|
-
return
|
|
2187
|
-
}),
|
|
2188
|
-
var
|
|
2189
|
-
return
|
|
2190
|
+
var K = R.map(function(h) {
|
|
2191
|
+
return h.name;
|
|
2192
|
+
}), j = function(h, g, P) {
|
|
2193
|
+
var N = wn(h).map(function(U) {
|
|
2194
|
+
return vn(U, g);
|
|
2190
2195
|
});
|
|
2191
|
-
return g.reduce(function(
|
|
2192
|
-
var
|
|
2193
|
-
return
|
|
2194
|
-
}),
|
|
2195
|
-
return
|
|
2196
|
-
}, { before:
|
|
2197
|
-
}(
|
|
2198
|
-
return Promise.resolve(mt({ action: l, data: { exact:
|
|
2196
|
+
return g.reduce(function(U, L) {
|
|
2197
|
+
var J = L.name, Z = wn(h, J).map(function(Ne) {
|
|
2198
|
+
return vn(Ne, g);
|
|
2199
|
+
}), H = Z[0], M = Z[1], ee = Z[2];
|
|
2200
|
+
return H.length && (U.beforeNS[J] = H), M.length && (U.duringNS[J] = M), ee.length && (U.afterNS[J] = ee), U;
|
|
2201
|
+
}, { before: N[0], beforeNS: {}, during: N[1], duringNS: {}, after: N[2], afterNS: {} });
|
|
2202
|
+
}(z, R);
|
|
2203
|
+
return Promise.resolve(mt({ action: l, data: { exact: j.before, namespaced: j.beforeNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(h) {
|
|
2199
2204
|
function g() {
|
|
2200
|
-
var
|
|
2201
|
-
if (
|
|
2202
|
-
return Promise.resolve(mt({ action:
|
|
2203
|
-
|
|
2205
|
+
var U = function() {
|
|
2206
|
+
if (z.match(Pe))
|
|
2207
|
+
return Promise.resolve(mt({ action: A({}, P, { type: F + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(L) {
|
|
2208
|
+
L.meta && L.meta.hasCallback && pn(L.meta.rid, { payload: L });
|
|
2204
2209
|
});
|
|
2205
2210
|
}();
|
|
2206
|
-
return
|
|
2207
|
-
return
|
|
2208
|
-
}) :
|
|
2211
|
+
return U && U.then ? U.then(function() {
|
|
2212
|
+
return h;
|
|
2213
|
+
}) : h;
|
|
2209
2214
|
}
|
|
2210
|
-
if (
|
|
2211
|
-
return
|
|
2212
|
-
var
|
|
2213
|
-
if (
|
|
2214
|
-
return Promise.resolve(mt({ action:
|
|
2215
|
-
|
|
2215
|
+
if (pr(h, K.length))
|
|
2216
|
+
return h;
|
|
2217
|
+
var P, N = function() {
|
|
2218
|
+
if (z !== F)
|
|
2219
|
+
return Promise.resolve(mt({ action: A({}, h, { type: F }), data: { exact: j.during, namespaced: j.duringNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(U) {
|
|
2220
|
+
P = U;
|
|
2216
2221
|
});
|
|
2217
|
-
|
|
2222
|
+
P = h;
|
|
2218
2223
|
}();
|
|
2219
|
-
return
|
|
2224
|
+
return N && N.then ? N.then(g) : g();
|
|
2220
2225
|
});
|
|
2221
|
-
} catch (
|
|
2222
|
-
return Promise.reject(
|
|
2226
|
+
} catch (h) {
|
|
2227
|
+
return Promise.reject(h);
|
|
2223
2228
|
}
|
|
2224
|
-
var
|
|
2229
|
+
var I, E, W;
|
|
2225
2230
|
}(a, e, t, i, n)).then(function(l) {
|
|
2226
2231
|
return s = 1, o(l);
|
|
2227
2232
|
});
|
|
2228
2233
|
}();
|
|
2229
|
-
return Promise.resolve(y && y.then ? y.then(
|
|
2234
|
+
return Promise.resolve(y && y.then ? y.then(f) : f(y));
|
|
2230
2235
|
} catch (l) {
|
|
2231
2236
|
return Promise.reject(l);
|
|
2232
2237
|
}
|
|
@@ -2239,10 +2244,10 @@ function Gi(t) {
|
|
|
2239
2244
|
return function(n) {
|
|
2240
2245
|
return function(r) {
|
|
2241
2246
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
2242
|
-
if (i ===
|
|
2247
|
+
if (i === x.setItem || i === x.removeItem) {
|
|
2243
2248
|
if (r.abort)
|
|
2244
2249
|
return n(r);
|
|
2245
|
-
i ===
|
|
2250
|
+
i === x.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
2246
2251
|
}
|
|
2247
2252
|
return n(r);
|
|
2248
2253
|
};
|
|
@@ -2280,37 +2285,37 @@ function qi(t) {
|
|
|
2280
2285
|
if (n.type === "initialize:aborted")
|
|
2281
2286
|
return e;
|
|
2282
2287
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2283
|
-
var i =
|
|
2288
|
+
var i = In(n.type, "registerPlugin"), o = t()[i];
|
|
2284
2289
|
if (!o || !i)
|
|
2285
2290
|
return e;
|
|
2286
2291
|
var a = n.enabled, s = o.config;
|
|
2287
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
2292
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, A({}, e, r);
|
|
2288
2293
|
}
|
|
2289
2294
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2290
|
-
var
|
|
2291
|
-
return
|
|
2295
|
+
var f = In(n.type, x.initialize), p = t()[f];
|
|
2296
|
+
return p && f ? (r[f] = A({}, e[f], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), A({}, e, r)) : e;
|
|
2292
2297
|
}
|
|
2293
2298
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2294
|
-
return r[n.name] =
|
|
2299
|
+
return r[n.name] = A({}, e[n.name], { loaded: !0 }), A({}, e, r);
|
|
2295
2300
|
switch (n.type) {
|
|
2296
|
-
case
|
|
2297
|
-
return
|
|
2298
|
-
case
|
|
2299
|
-
return
|
|
2301
|
+
case x.disablePlugin:
|
|
2302
|
+
return A({}, e, Sn(n.plugins, !1, e));
|
|
2303
|
+
case x.enablePlugin:
|
|
2304
|
+
return A({}, e, Sn(n.plugins, !0, e));
|
|
2300
2305
|
default:
|
|
2301
2306
|
return e;
|
|
2302
2307
|
}
|
|
2303
2308
|
};
|
|
2304
2309
|
}
|
|
2305
|
-
function
|
|
2310
|
+
function In(t, e) {
|
|
2306
2311
|
return t.substring(e.length + 1, t.length);
|
|
2307
2312
|
}
|
|
2308
|
-
function
|
|
2313
|
+
function Sn(t, e, n) {
|
|
2309
2314
|
return t.reduce(function(r, i) {
|
|
2310
|
-
return r[i] =
|
|
2315
|
+
return r[i] = A({}, n[i], { enabled: e }), r;
|
|
2311
2316
|
}, n);
|
|
2312
2317
|
}
|
|
2313
|
-
function
|
|
2318
|
+
function mr(t) {
|
|
2314
2319
|
try {
|
|
2315
2320
|
return JSON.parse(JSON.stringify(t));
|
|
2316
2321
|
} catch {
|
|
@@ -2321,9 +2326,9 @@ var Qi = { last: {}, history: [] };
|
|
|
2321
2326
|
function eo(t, e) {
|
|
2322
2327
|
t === void 0 && (t = Qi);
|
|
2323
2328
|
var n = e.options, r = e.meta;
|
|
2324
|
-
if (e.type ===
|
|
2325
|
-
var i =
|
|
2326
|
-
return
|
|
2329
|
+
if (e.type === x.track) {
|
|
2330
|
+
var i = mr(A({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2331
|
+
return A({}, t, { last: i, history: t.history.concat(i) });
|
|
2327
2332
|
}
|
|
2328
2333
|
return t;
|
|
2329
2334
|
}
|
|
@@ -2334,66 +2339,66 @@ function no(t, e) {
|
|
|
2334
2339
|
switch (e.type) {
|
|
2335
2340
|
case "queue":
|
|
2336
2341
|
var r;
|
|
2337
|
-
return r = n && n.type && n.type ===
|
|
2342
|
+
return r = n && n.type && n.type === x.identify ? [e].concat(t.actions) : t.actions.concat(e), A({}, t, { actions: r });
|
|
2338
2343
|
case "dequeue":
|
|
2339
2344
|
return [];
|
|
2340
2345
|
default:
|
|
2341
2346
|
return t;
|
|
2342
2347
|
}
|
|
2343
2348
|
}
|
|
2344
|
-
var
|
|
2349
|
+
var gr = /#.*$/;
|
|
2345
2350
|
function ro(t) {
|
|
2346
2351
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2347
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2352
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(gr, "") : "");
|
|
2348
2353
|
}
|
|
2349
|
-
var
|
|
2350
|
-
if (t === void 0 && (t = {}), !
|
|
2354
|
+
var yr, vr, wr, br, io = function(t) {
|
|
2355
|
+
if (t === void 0 && (t = {}), !X)
|
|
2351
2356
|
return t;
|
|
2352
|
-
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight,
|
|
2357
|
+
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, f = o.hash, p = o.search, u = function(m) {
|
|
2353
2358
|
var d = function() {
|
|
2354
|
-
if (
|
|
2355
|
-
for (var w,
|
|
2359
|
+
if (X) {
|
|
2360
|
+
for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
|
|
2356
2361
|
if (w.getAttribute("rel") === "canonical")
|
|
2357
2362
|
return w.getAttribute("href");
|
|
2358
2363
|
}
|
|
2359
2364
|
}();
|
|
2360
|
-
return d ? d.match(/\?/) ? d : d +
|
|
2361
|
-
}(
|
|
2362
|
-
return r && r !== "" && (c.referrer = r),
|
|
2365
|
+
return d ? d.match(/\?/) ? d : d + m : window.location.href.replace(gr, "");
|
|
2366
|
+
}(p), c = { title: n, url: u, path: ro(u), hash: f, search: p, width: a, height: s };
|
|
2367
|
+
return r && r !== "" && (c.referrer = r), A({}, c, t);
|
|
2363
2368
|
}, oo = { last: {}, history: [] };
|
|
2364
2369
|
function ao(t, e) {
|
|
2365
2370
|
t === void 0 && (t = oo);
|
|
2366
2371
|
var n = e.options;
|
|
2367
|
-
if (e.type ===
|
|
2368
|
-
var r =
|
|
2369
|
-
return
|
|
2372
|
+
if (e.type === x.page) {
|
|
2373
|
+
var r = mr(A({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2374
|
+
return A({}, t, { last: r, history: t.history.concat(r) });
|
|
2370
2375
|
}
|
|
2371
2376
|
return t;
|
|
2372
2377
|
}
|
|
2373
|
-
|
|
2374
|
-
if (!
|
|
2378
|
+
yr = function() {
|
|
2379
|
+
if (!X)
|
|
2375
2380
|
return !1;
|
|
2376
2381
|
var t = navigator.appVersion;
|
|
2377
2382
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2378
|
-
}(),
|
|
2379
|
-
var
|
|
2383
|
+
}(), vr = X ? document.referrer : null, wr = zi(), br = Ri();
|
|
2384
|
+
var _n = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!X && !navigator.onLine, os: { name: yr }, userAgent: X ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: br, locale: wr, campaign: {}, referrer: vr };
|
|
2380
2385
|
function so(t, e) {
|
|
2381
|
-
t === void 0 && (t =
|
|
2386
|
+
t === void 0 && (t = _n);
|
|
2382
2387
|
var n = t.initialized, r = e.campaign;
|
|
2383
2388
|
switch (e.type) {
|
|
2384
|
-
case
|
|
2385
|
-
return
|
|
2386
|
-
case
|
|
2387
|
-
return
|
|
2388
|
-
case
|
|
2389
|
-
return
|
|
2389
|
+
case x.campaign:
|
|
2390
|
+
return A({}, t, { campaign: r });
|
|
2391
|
+
case x.offline:
|
|
2392
|
+
return A({}, t, { offline: !0 });
|
|
2393
|
+
case x.online:
|
|
2394
|
+
return A({}, t, { offline: !1 });
|
|
2390
2395
|
default:
|
|
2391
|
-
return n ? t :
|
|
2396
|
+
return n ? t : A({}, _n, t, { initialized: !0 });
|
|
2392
2397
|
}
|
|
2393
2398
|
}
|
|
2394
2399
|
var co = ["plugins", "reducers", "storage"];
|
|
2395
2400
|
function uo(t, e, n) {
|
|
2396
|
-
if (
|
|
2401
|
+
if (X) {
|
|
2397
2402
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
2398
2403
|
t.split(" ").forEach(function(i) {
|
|
2399
2404
|
r(i, e);
|
|
@@ -2408,7 +2413,7 @@ function lo(t) {
|
|
|
2408
2413
|
return e(!1);
|
|
2409
2414
|
};
|
|
2410
2415
|
}
|
|
2411
|
-
function
|
|
2416
|
+
function kr() {
|
|
2412
2417
|
return be("analytics", []), function(t) {
|
|
2413
2418
|
return function(e, n, r) {
|
|
2414
2419
|
var i = t(e, n, r), o = i.dispatch;
|
|
@@ -2418,263 +2423,263 @@ function wr() {
|
|
|
2418
2423
|
};
|
|
2419
2424
|
};
|
|
2420
2425
|
}
|
|
2421
|
-
function
|
|
2426
|
+
function En(t) {
|
|
2422
2427
|
return function() {
|
|
2423
|
-
return xe(xe.apply(null, arguments),
|
|
2428
|
+
return xe(xe.apply(null, arguments), kr());
|
|
2424
2429
|
};
|
|
2425
2430
|
}
|
|
2426
2431
|
function vt(t) {
|
|
2427
|
-
return t ?
|
|
2432
|
+
return t ? ur(t) ? t : [t] : [];
|
|
2428
2433
|
}
|
|
2429
|
-
function
|
|
2434
|
+
function Pn(t, e, n) {
|
|
2430
2435
|
t === void 0 && (t = {});
|
|
2431
2436
|
var r, i, o = st();
|
|
2432
2437
|
return e && (Re[o] = (r = e, i = function(a) {
|
|
2433
|
-
for (var s,
|
|
2434
|
-
if (Y(
|
|
2435
|
-
s =
|
|
2438
|
+
for (var s, f = a || Array.prototype.slice.call(arguments), p = 0; p < f.length; p++)
|
|
2439
|
+
if (Y(f[p])) {
|
|
2440
|
+
s = f[p];
|
|
2436
2441
|
break;
|
|
2437
2442
|
}
|
|
2438
2443
|
return s;
|
|
2439
2444
|
}(n), function(a) {
|
|
2440
2445
|
i && i(a), r(a);
|
|
2441
|
-
})),
|
|
2446
|
+
})), A({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2442
2447
|
}
|
|
2443
2448
|
function ho(t) {
|
|
2444
2449
|
t === void 0 && (t = {});
|
|
2445
|
-
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(
|
|
2450
|
+
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(h, g) {
|
|
2446
2451
|
if (Y(g))
|
|
2447
|
-
return
|
|
2452
|
+
return h.middlewares = h.middlewares.concat(g), h;
|
|
2448
2453
|
if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
|
|
2449
2454
|
throw new Error("https://lytics.dev/errors/1");
|
|
2450
2455
|
g.config || (g.config = {});
|
|
2451
|
-
var
|
|
2452
|
-
return g.EVENTS[
|
|
2456
|
+
var P = g.EVENTS ? Object.keys(g.EVENTS).map(function(L) {
|
|
2457
|
+
return g.EVENTS[L];
|
|
2453
2458
|
}) : [];
|
|
2454
|
-
|
|
2459
|
+
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(L, J) {
|
|
2455
2460
|
var Z;
|
|
2456
|
-
return
|
|
2457
|
-
for (var
|
|
2458
|
-
M[ee] =
|
|
2459
|
-
return M[M.length] =
|
|
2460
|
-
}),
|
|
2461
|
+
return L[J] = (Z = g.methods[J], function() {
|
|
2462
|
+
for (var H = Array.prototype.slice.call(arguments), M = new Array(Z.length), ee = 0; ee < H.length; ee++)
|
|
2463
|
+
M[ee] = H[ee];
|
|
2464
|
+
return M[M.length] = b, Z.apply({ instance: b }, M);
|
|
2465
|
+
}), L;
|
|
2461
2466
|
}, {}), delete g.methods);
|
|
2462
|
-
var
|
|
2463
|
-
if (
|
|
2467
|
+
var N = Object.keys(g).concat(P), U = new Set(h.events.concat(N));
|
|
2468
|
+
if (h.events = Array.from(U), h.pluginsArray = h.pluginsArray.concat(g), h.plugins[g.name])
|
|
2464
2469
|
throw new Error(g.name + "AlreadyLoaded");
|
|
2465
|
-
return
|
|
2470
|
+
return h.plugins[g.name] = g, h.plugins[g.name].loaded || (h.plugins[g.name].loaded = function() {
|
|
2466
2471
|
return !0;
|
|
2467
|
-
}),
|
|
2468
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(
|
|
2469
|
-
return function(g,
|
|
2470
|
-
return
|
|
2472
|
+
}), h;
|
|
2473
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(h) {
|
|
2474
|
+
return function(g, P, N) {
|
|
2475
|
+
return P.getState("user")[g] || (N && V(N) && N[g] ? N[g] : fn(h)[g] || we(jt(g)) || null);
|
|
2471
2476
|
};
|
|
2472
|
-
}(i), a = r.plugins, s = r.events.filter(function(
|
|
2473
|
-
return !
|
|
2474
|
-
}).sort(),
|
|
2475
|
-
return !
|
|
2476
|
-
})),
|
|
2477
|
+
}(i), a = r.plugins, s = r.events.filter(function(h) {
|
|
2478
|
+
return !Ot.includes(h);
|
|
2479
|
+
}).sort(), f = new Set(s.concat(et).filter(function(h) {
|
|
2480
|
+
return !Ot.includes(h);
|
|
2481
|
+
})), p = Array.from(f).sort(), u = function() {
|
|
2477
2482
|
return a;
|
|
2478
|
-
}, c = new Bi(),
|
|
2483
|
+
}, c = new Bi(), m = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2479
2484
|
throw new Error("Abort disabled inListener");
|
|
2480
|
-
}, v = Di(), _ =
|
|
2485
|
+
}, v = Di(), _ = fn(i), S = A({}, _, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2481
2486
|
S.anonymousId || (S.anonymousId = st());
|
|
2482
|
-
var y =
|
|
2483
|
-
return new Promise(function(
|
|
2484
|
-
|
|
2487
|
+
var y = A({ enable: function(h, g) {
|
|
2488
|
+
return new Promise(function(P) {
|
|
2489
|
+
j.dispatch({ type: x.enablePlugin, plugins: vt(h), _: { originalAction: x.enablePlugin } }, P, [g]);
|
|
2485
2490
|
});
|
|
2486
|
-
}, disable: function(
|
|
2487
|
-
return new Promise(function(
|
|
2488
|
-
|
|
2491
|
+
}, disable: function(h, g) {
|
|
2492
|
+
return new Promise(function(P) {
|
|
2493
|
+
j.dispatch({ type: x.disablePlugin, plugins: vt(h), _: { originalAction: x.disablePlugin } }, P, [g]);
|
|
2489
2494
|
});
|
|
2490
|
-
} }, r.methods), l = !1,
|
|
2495
|
+
} }, r.methods), l = !1, b = { identify: function(h, g, P, N) {
|
|
2491
2496
|
try {
|
|
2492
|
-
var
|
|
2493
|
-
be(
|
|
2494
|
-
var
|
|
2497
|
+
var U = se(h) ? h : null, L = V(h) ? h : g, J = P || {}, Z = b.user();
|
|
2498
|
+
be(jt(oe), U);
|
|
2499
|
+
var H = U || L.userId || o(oe, b, L);
|
|
2495
2500
|
return Promise.resolve(new Promise(function(M) {
|
|
2496
|
-
|
|
2501
|
+
j.dispatch(A({ type: x.identifyStart, userId: H, traits: L || {}, options: J, anonymousId: Z.anonymousId }, Z.id && Z.id !== U && { previousId: Z.id }), M, [g, P, N]);
|
|
2497
2502
|
}));
|
|
2498
2503
|
} catch (M) {
|
|
2499
2504
|
return Promise.reject(M);
|
|
2500
2505
|
}
|
|
2501
|
-
}, track: function(
|
|
2506
|
+
}, track: function(h, g, P, N) {
|
|
2502
2507
|
try {
|
|
2503
|
-
var
|
|
2504
|
-
if (!
|
|
2508
|
+
var U = V(h) ? h.event : h;
|
|
2509
|
+
if (!U || !se(U))
|
|
2505
2510
|
throw new Error("EventMissing");
|
|
2506
|
-
var
|
|
2511
|
+
var L = V(h) ? h : g || {}, J = V(P) ? P : {};
|
|
2507
2512
|
return Promise.resolve(new Promise(function(Z) {
|
|
2508
|
-
|
|
2513
|
+
j.dispatch({ type: x.trackStart, event: U, properties: L, options: J, userId: o(oe, b, g), anonymousId: o(_e, b, g) }, Z, [g, P, N]);
|
|
2509
2514
|
}));
|
|
2510
2515
|
} catch (Z) {
|
|
2511
2516
|
return Promise.reject(Z);
|
|
2512
2517
|
}
|
|
2513
|
-
}, page: function(
|
|
2518
|
+
}, page: function(h, g, P) {
|
|
2514
2519
|
try {
|
|
2515
|
-
var
|
|
2516
|
-
return Promise.resolve(new Promise(function(
|
|
2517
|
-
|
|
2520
|
+
var N = V(h) ? h : {}, U = V(g) ? g : {};
|
|
2521
|
+
return Promise.resolve(new Promise(function(L) {
|
|
2522
|
+
j.dispatch({ type: x.pageStart, properties: io(N), options: U, userId: o(oe, b, N), anonymousId: o(_e, b, N) }, L, [h, g, P]);
|
|
2518
2523
|
}));
|
|
2519
|
-
} catch (
|
|
2520
|
-
return Promise.reject(
|
|
2524
|
+
} catch (L) {
|
|
2525
|
+
return Promise.reject(L);
|
|
2521
2526
|
}
|
|
2522
|
-
}, user: function(
|
|
2523
|
-
if (
|
|
2524
|
-
return o(oe,
|
|
2525
|
-
if (
|
|
2526
|
-
return o(_e,
|
|
2527
|
-
var g =
|
|
2528
|
-
return
|
|
2529
|
-
}, reset: function(
|
|
2527
|
+
}, user: function(h) {
|
|
2528
|
+
if (h === oe || h === "id")
|
|
2529
|
+
return o(oe, b);
|
|
2530
|
+
if (h === _e || h === "anonId")
|
|
2531
|
+
return o(_e, b);
|
|
2532
|
+
var g = b.getState("user");
|
|
2533
|
+
return h ? an(g, h) : g;
|
|
2534
|
+
}, reset: function(h) {
|
|
2530
2535
|
return new Promise(function(g) {
|
|
2531
|
-
|
|
2536
|
+
j.dispatch({ type: x.resetStart }, g, h);
|
|
2532
2537
|
});
|
|
2533
|
-
}, ready: function(
|
|
2534
|
-
return l &&
|
|
2535
|
-
|
|
2538
|
+
}, ready: function(h) {
|
|
2539
|
+
return l && h({ plugins: y, instance: b }), b.on(x.ready, function(g) {
|
|
2540
|
+
h(g), l = !0;
|
|
2536
2541
|
});
|
|
2537
|
-
}, on: function(
|
|
2538
|
-
if (!
|
|
2542
|
+
}, on: function(h, g) {
|
|
2543
|
+
if (!h || !Y(g))
|
|
2539
2544
|
return !1;
|
|
2540
|
-
if (
|
|
2541
|
-
throw new Error(".on disabled for " +
|
|
2542
|
-
var
|
|
2543
|
-
if (
|
|
2544
|
-
var
|
|
2545
|
-
return function(
|
|
2545
|
+
if (h === x.bootstrap)
|
|
2546
|
+
throw new Error(".on disabled for " + h);
|
|
2547
|
+
var P = /Start$|Start:/;
|
|
2548
|
+
if (h === "*") {
|
|
2549
|
+
var N = function(Z) {
|
|
2550
|
+
return function(H) {
|
|
2546
2551
|
return function(M) {
|
|
2547
|
-
return M.type.match(
|
|
2552
|
+
return M.type.match(P) && g({ payload: M, instance: b, plugins: a }), H(M);
|
|
2548
2553
|
};
|
|
2549
2554
|
};
|
|
2550
|
-
},
|
|
2551
|
-
return function(
|
|
2555
|
+
}, U = function(Z) {
|
|
2556
|
+
return function(H) {
|
|
2552
2557
|
return function(M) {
|
|
2553
|
-
return M.type.match(
|
|
2558
|
+
return M.type.match(P) || g({ payload: M, instance: b, plugins: a }), H(M);
|
|
2554
2559
|
};
|
|
2555
2560
|
};
|
|
2556
2561
|
};
|
|
2557
|
-
return
|
|
2558
|
-
d(
|
|
2562
|
+
return m(N, Ye), m(U, Ge), function() {
|
|
2563
|
+
d(N, Ye), d(U, Ge);
|
|
2559
2564
|
};
|
|
2560
2565
|
}
|
|
2561
|
-
var
|
|
2562
|
-
return function(
|
|
2566
|
+
var L = h.match(P) ? Ye : Ge, J = function(Z) {
|
|
2567
|
+
return function(H) {
|
|
2563
2568
|
return function(M) {
|
|
2564
|
-
return M.type ===
|
|
2569
|
+
return M.type === h && g({ payload: M, instance: b, plugins: a, abort: k }), H(M);
|
|
2565
2570
|
};
|
|
2566
2571
|
};
|
|
2567
2572
|
};
|
|
2568
|
-
return
|
|
2569
|
-
return d(
|
|
2573
|
+
return m(J, L), function() {
|
|
2574
|
+
return d(J, L);
|
|
2570
2575
|
};
|
|
2571
|
-
}, once: function(
|
|
2572
|
-
if (!
|
|
2576
|
+
}, once: function(h, g) {
|
|
2577
|
+
if (!h || !Y(g))
|
|
2573
2578
|
return !1;
|
|
2574
|
-
if (
|
|
2575
|
-
throw new Error(".once disabled for " +
|
|
2576
|
-
var
|
|
2577
|
-
g({ payload:
|
|
2579
|
+
if (h === x.bootstrap)
|
|
2580
|
+
throw new Error(".once disabled for " + h);
|
|
2581
|
+
var P = b.on(h, function(N) {
|
|
2582
|
+
g({ payload: N.payload, instance: b, plugins: a, abort: k }), P();
|
|
2578
2583
|
});
|
|
2579
|
-
return
|
|
2580
|
-
}, getState: function(
|
|
2581
|
-
var g =
|
|
2582
|
-
return
|
|
2583
|
-
}, dispatch: function(
|
|
2584
|
-
var g = se(
|
|
2584
|
+
return P;
|
|
2585
|
+
}, getState: function(h) {
|
|
2586
|
+
var g = j.getState();
|
|
2587
|
+
return h ? an(g, h) : Object.assign({}, g);
|
|
2588
|
+
}, dispatch: function(h) {
|
|
2589
|
+
var g = se(h) ? { type: h } : h;
|
|
2585
2590
|
if (et.includes(g.type))
|
|
2586
2591
|
throw new Error("reserved action " + g.type);
|
|
2587
|
-
var
|
|
2588
|
-
|
|
2589
|
-
}, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(
|
|
2590
|
-
|
|
2591
|
-
}, removeItem: function(
|
|
2592
|
-
|
|
2593
|
-
} }, setAnonymousId: function(
|
|
2594
|
-
|
|
2595
|
-
}, events: { core: et, plugins: s } },
|
|
2592
|
+
var P = A({}, g, { _: A({ originalAction: g.type }, h._ || {}) });
|
|
2593
|
+
j.dispatch(P);
|
|
2594
|
+
}, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(h, g, P) {
|
|
2595
|
+
j.dispatch({ type: x.setItemStart, key: h, value: g, options: P });
|
|
2596
|
+
}, removeItem: function(h, g) {
|
|
2597
|
+
j.dispatch({ type: x.removeItemStart, key: h, options: g });
|
|
2598
|
+
} }, setAnonymousId: function(h, g) {
|
|
2599
|
+
b.storage.setItem(ce, h, g);
|
|
2600
|
+
}, events: { core: et, plugins: s } }, T = r.middlewares.concat([function(h) {
|
|
2596
2601
|
return function(g) {
|
|
2597
|
-
return function(
|
|
2598
|
-
return
|
|
2602
|
+
return function(P) {
|
|
2603
|
+
return P.meta || (P.meta = Pn()), g(P);
|
|
2599
2604
|
};
|
|
2600
2605
|
};
|
|
2601
|
-
}, w(Ye), Yi(
|
|
2602
|
-
if (
|
|
2603
|
-
var
|
|
2604
|
-
|
|
2605
|
-
return arguments.length === 0 ?
|
|
2606
|
+
}, w(Ye), Yi(b, u, { all: p, plugins: s }), Gi(i), Hi(b), Ji(b), w(Ge)]), O = { context: so, user: Fi(i), page: ao, track: eo, plugins: qi(u), queue: no }, C = xe, D = xe;
|
|
2607
|
+
if (X && t.debug) {
|
|
2608
|
+
var z = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2609
|
+
z && (C = z({ trace: !0, traceLimit: 25 })), D = function() {
|
|
2610
|
+
return arguments.length === 0 ? kr() : V(typeof arguments[0]) ? En() : En().apply(null, arguments);
|
|
2606
2611
|
};
|
|
2607
2612
|
}
|
|
2608
|
-
var
|
|
2609
|
-
return Object.keys(
|
|
2610
|
-
return co.includes(
|
|
2613
|
+
var F, $ = function(h) {
|
|
2614
|
+
return Object.keys(h).reduce(function(g, P) {
|
|
2615
|
+
return co.includes(P) || (g[P] = h[P]), g;
|
|
2611
2616
|
}, {});
|
|
2612
|
-
}(t), R = r.pluginsArray.reduce(function(
|
|
2613
|
-
var
|
|
2614
|
-
return
|
|
2615
|
-
}, {}), K = { context:
|
|
2616
|
-
for (var g = Object.keys(
|
|
2617
|
-
var
|
|
2618
|
-
typeof
|
|
2617
|
+
}(t), R = r.pluginsArray.reduce(function(h, g) {
|
|
2618
|
+
var P = g.name, N = g.config, U = g.loaded, L = r.pluginEnabled[P];
|
|
2619
|
+
return h[P] = { enabled: L, initialized: !!L && !g.initialize, loaded: !!U({ config: N }), config: N }, h;
|
|
2620
|
+
}, {}), K = { context: $, user: S, plugins: R }, j = dr(function(h) {
|
|
2621
|
+
for (var g = Object.keys(h), P = {}, N = 0; N < g.length; N++) {
|
|
2622
|
+
var U = g[N];
|
|
2623
|
+
typeof h[U] === ae && (P[U] = h[U]);
|
|
2619
2624
|
}
|
|
2620
|
-
var
|
|
2625
|
+
var L, J = Object.keys(P);
|
|
2621
2626
|
try {
|
|
2622
2627
|
(function(Z) {
|
|
2623
|
-
Object.keys(Z).forEach(function(
|
|
2624
|
-
var M = Z[
|
|
2628
|
+
Object.keys(Z).forEach(function(H) {
|
|
2629
|
+
var M = Z[H];
|
|
2625
2630
|
if (typeof M(void 0, { type: "@@redux/INIT" }) === ie || typeof M(void 0, { type: Zi }) === ie)
|
|
2626
|
-
throw new Error("reducer " +
|
|
2631
|
+
throw new Error("reducer " + H + " " + ie);
|
|
2627
2632
|
});
|
|
2628
|
-
})(
|
|
2633
|
+
})(P);
|
|
2629
2634
|
} catch (Z) {
|
|
2630
|
-
|
|
2635
|
+
L = Z;
|
|
2631
2636
|
}
|
|
2632
|
-
return function(Z,
|
|
2633
|
-
if (Z === void 0 && (Z = {}),
|
|
2634
|
-
throw
|
|
2635
|
-
for (var M = !1, ee = {}, Ne = 0; Ne <
|
|
2636
|
-
var He =
|
|
2637
|
+
return function(Z, H) {
|
|
2638
|
+
if (Z === void 0 && (Z = {}), L)
|
|
2639
|
+
throw L;
|
|
2640
|
+
for (var M = !1, ee = {}, Ne = 0; Ne < J.length; Ne++) {
|
|
2641
|
+
var He = J[Ne], Ft = Z[He], lt = (0, P[He])(Ft, H);
|
|
2637
2642
|
if (typeof lt === ie) {
|
|
2638
|
-
var
|
|
2639
|
-
throw new Error(
|
|
2643
|
+
var Nr = Ki(He, H);
|
|
2644
|
+
throw new Error(Nr);
|
|
2640
2645
|
}
|
|
2641
|
-
ee[He] = lt, M = M || lt !==
|
|
2646
|
+
ee[He] = lt, M = M || lt !== Ft;
|
|
2642
2647
|
}
|
|
2643
2648
|
return M ? ee : Z;
|
|
2644
2649
|
};
|
|
2645
|
-
}(
|
|
2646
|
-
|
|
2647
|
-
var
|
|
2648
|
-
return
|
|
2650
|
+
}(A({}, O, e)), K, D(C(Wi.apply(void 0, T))));
|
|
2651
|
+
j.dispatch = (F = j.dispatch, function(h, g, P) {
|
|
2652
|
+
var N = A({}, h, { meta: Pn(h.meta, g, vt(P)) });
|
|
2653
|
+
return F.apply(null, [N]);
|
|
2649
2654
|
});
|
|
2650
|
-
var
|
|
2651
|
-
|
|
2652
|
-
var
|
|
2653
|
-
return r.pluginEnabled[
|
|
2654
|
-
}),
|
|
2655
|
-
return !r.pluginEnabled[
|
|
2655
|
+
var I = Object.keys(a);
|
|
2656
|
+
j.dispatch({ type: x.bootstrap, plugins: I, config: $, params: v, user: S, initialUser: n, persistedUser: _ });
|
|
2657
|
+
var E = I.filter(function(h) {
|
|
2658
|
+
return r.pluginEnabled[h];
|
|
2659
|
+
}), W = I.filter(function(h) {
|
|
2660
|
+
return !r.pluginEnabled[h];
|
|
2656
2661
|
});
|
|
2657
|
-
return
|
|
2658
|
-
var
|
|
2659
|
-
|
|
2660
|
-
}), lo(function(
|
|
2661
|
-
|
|
2662
|
-
}), function(
|
|
2662
|
+
return j.dispatch({ type: x.registerPlugins, plugins: I, enabled: r.pluginEnabled }), r.pluginsArray.map(function(h, g) {
|
|
2663
|
+
var P = h.bootstrap, N = h.config, U = h.name;
|
|
2664
|
+
P && Y(P) && P({ instance: b, config: N, payload: h }), j.dispatch({ type: x.registerPluginType(U), name: U, enabled: r.pluginEnabled[U], plugin: h }), r.pluginsArray.length === g + 1 && j.dispatch({ type: x.initializeStart, plugins: E, disabled: W });
|
|
2665
|
+
}), lo(function(h) {
|
|
2666
|
+
j.dispatch({ type: h ? x.offline : x.online });
|
|
2667
|
+
}), function(h, g, P) {
|
|
2663
2668
|
setInterval(function() {
|
|
2664
|
-
return
|
|
2669
|
+
return fr(h, g, P);
|
|
2665
2670
|
}, 3e3);
|
|
2666
|
-
}(
|
|
2671
|
+
}(j, u, b), b;
|
|
2667
2672
|
}
|
|
2668
|
-
var Ye = "before", Ge = "after", Le = "cookie", fe =
|
|
2669
|
-
function
|
|
2673
|
+
var Ye = "before", Ge = "after", Le = "cookie", fe = _r(), Ir = ct, fo = ct;
|
|
2674
|
+
function Sr(t) {
|
|
2670
2675
|
return fe ? ct(t, "", -1) : Ae(t);
|
|
2671
2676
|
}
|
|
2672
|
-
function
|
|
2677
|
+
function _r() {
|
|
2673
2678
|
if (fe !== void 0)
|
|
2674
2679
|
return fe;
|
|
2675
2680
|
var t = "cookiecookie";
|
|
2676
2681
|
try {
|
|
2677
|
-
ct(t, t), fe = document.cookie.indexOf(t) !== -1,
|
|
2682
|
+
ct(t, t), fe = document.cookie.indexOf(t) !== -1, Sr(t);
|
|
2678
2683
|
} catch {
|
|
2679
2684
|
fe = !1;
|
|
2680
2685
|
}
|
|
@@ -2686,11 +2691,11 @@ function ct(t, e, n, r, i, o) {
|
|
|
2686
2691
|
return fe === !1 && (a ? be(t, e) : we(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
|
|
2687
2692
|
}
|
|
2688
2693
|
}
|
|
2689
|
-
var Me = "localStorage", po =
|
|
2694
|
+
var Me = "localStorage", po = Dt.bind(null, "localStorage");
|
|
2690
2695
|
$e("localStorage", "getItem", we);
|
|
2691
2696
|
$e("localStorage", "setItem", be);
|
|
2692
2697
|
$e("localStorage", "removeItem", Ae);
|
|
2693
|
-
var Ze = "sessionStorage", mo =
|
|
2698
|
+
var Ze = "sessionStorage", mo = Dt.bind(null, "sessionStorage");
|
|
2694
2699
|
$e("sessionStorage", "getItem", we);
|
|
2695
2700
|
$e("sessionStorage", "setItem", be);
|
|
2696
2701
|
$e("sessionStorage", "removeItem", Ae);
|
|
@@ -2709,16 +2714,16 @@ function Te(t) {
|
|
|
2709
2714
|
if (e !== null && e !== "")
|
|
2710
2715
|
return e;
|
|
2711
2716
|
}
|
|
2712
|
-
var go = po(), yo = mo(), vo =
|
|
2713
|
-
function
|
|
2717
|
+
var go = po(), yo = mo(), vo = _r();
|
|
2718
|
+
function Er(t, e) {
|
|
2714
2719
|
if (t) {
|
|
2715
|
-
var n =
|
|
2720
|
+
var n = Lt(e), r = !Wt(n), i = Mt(n) ? Te(localStorage.getItem(t)) : void 0;
|
|
2716
2721
|
if (r && !Se(i))
|
|
2717
2722
|
return i;
|
|
2718
|
-
var o =
|
|
2723
|
+
var o = Zt(n) ? Te(Ir(t)) : void 0;
|
|
2719
2724
|
if (r && o)
|
|
2720
2725
|
return o;
|
|
2721
|
-
var a =
|
|
2726
|
+
var a = Kt(n) ? Te(sessionStorage.getItem(t)) : void 0;
|
|
2722
2727
|
if (r && a)
|
|
2723
2728
|
return a;
|
|
2724
2729
|
var s = we(t);
|
|
@@ -2727,38 +2732,38 @@ function Sr(t, e) {
|
|
|
2727
2732
|
}
|
|
2728
2733
|
function wo(t, e, n) {
|
|
2729
2734
|
if (t && !Se(e)) {
|
|
2730
|
-
var r = {}, i =
|
|
2731
|
-
return
|
|
2735
|
+
var r = {}, i = Lt(n), o = JSON.stringify(e), a = !Wt(i);
|
|
2736
|
+
return Mt(i) && (r[Me] = Be(Me, e, Te(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Me] : Zt(i) && (r[Le] = Be(Le, e, Te(Ir(t))), fo(t, o), a) ? r[Le] : Kt(i) && (r[Ze] = Be(Ze, e, Te(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ze] : (r[De] = Be(De, e, we(t)), be(t, e), a ? r[De] : r);
|
|
2732
2737
|
}
|
|
2733
2738
|
}
|
|
2734
2739
|
function bo(t, e) {
|
|
2735
2740
|
if (t) {
|
|
2736
|
-
var n =
|
|
2737
|
-
return !Se(r.localStorage) &&
|
|
2741
|
+
var n = Lt(e), r = Er(t, ar), i = {};
|
|
2742
|
+
return !Se(r.localStorage) && Mt(n) && (localStorage.removeItem(t), i[Me] = r.localStorage), !Se(r.cookie) && Zt(n) && (Sr(t), i[Le] = r.cookie), !Se(r.sessionStorage) && Kt(n) && (sessionStorage.removeItem(t), i[Ze] = r.sessionStorage), !Se(r.global) && ut(n, De) && (Ae(t), i[De] = r.global), i;
|
|
2738
2743
|
}
|
|
2739
2744
|
}
|
|
2740
|
-
function Dt(t) {
|
|
2741
|
-
return t ? se(t) ? t : t.storage : rr;
|
|
2742
|
-
}
|
|
2743
2745
|
function Lt(t) {
|
|
2744
|
-
return
|
|
2746
|
+
return t ? se(t) ? t : t.storage : or;
|
|
2745
2747
|
}
|
|
2746
2748
|
function Mt(t) {
|
|
2747
|
-
return
|
|
2749
|
+
return go && ut(t, Me);
|
|
2748
2750
|
}
|
|
2749
2751
|
function Zt(t) {
|
|
2750
|
-
return
|
|
2752
|
+
return vo && ut(t, Le);
|
|
2751
2753
|
}
|
|
2752
2754
|
function Kt(t) {
|
|
2753
|
-
return
|
|
2755
|
+
return yo && ut(t, Ze);
|
|
2756
|
+
}
|
|
2757
|
+
function Wt(t) {
|
|
2758
|
+
return t === ar || t === "all";
|
|
2754
2759
|
}
|
|
2755
2760
|
function ut(t, e) {
|
|
2756
|
-
return t ===
|
|
2761
|
+
return t === or || t === e || Wt(t);
|
|
2757
2762
|
}
|
|
2758
2763
|
function Be(t, e, n) {
|
|
2759
2764
|
return { location: t, current: e, previous: n };
|
|
2760
2765
|
}
|
|
2761
|
-
var ko = { setItem: wo, getItem:
|
|
2766
|
+
var ko = { setItem: wo, getItem: Er, removeItem: bo };
|
|
2762
2767
|
function Io(t, e, n) {
|
|
2763
2768
|
return e in t ? Object.defineProperty(t, e, {
|
|
2764
2769
|
value: n,
|
|
@@ -2767,7 +2772,7 @@ function Io(t, e, n) {
|
|
|
2767
2772
|
writable: !0
|
|
2768
2773
|
}) : t[e] = n, t;
|
|
2769
2774
|
}
|
|
2770
|
-
function
|
|
2775
|
+
function Tn(t, e) {
|
|
2771
2776
|
var n = Object.keys(t);
|
|
2772
2777
|
if (Object.getOwnPropertySymbols) {
|
|
2773
2778
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2777,12 +2782,12 @@ function En(t, e) {
|
|
|
2777
2782
|
}
|
|
2778
2783
|
return n;
|
|
2779
2784
|
}
|
|
2780
|
-
function
|
|
2785
|
+
function On(t) {
|
|
2781
2786
|
for (var e = 1; e < arguments.length; e++) {
|
|
2782
2787
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2783
|
-
e % 2 ?
|
|
2788
|
+
e % 2 ? Tn(Object(n), !0).forEach(function(r) {
|
|
2784
2789
|
Io(t, r, n[r]);
|
|
2785
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2790
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Tn(Object(n)).forEach(function(r) {
|
|
2786
2791
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2787
2792
|
});
|
|
2788
2793
|
}
|
|
@@ -2792,7 +2797,7 @@ function So() {
|
|
|
2792
2797
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2793
2798
|
storage: ko
|
|
2794
2799
|
};
|
|
2795
|
-
return ho(
|
|
2800
|
+
return ho(On(On({}, e), t));
|
|
2796
2801
|
}
|
|
2797
2802
|
function _o(t, e) {
|
|
2798
2803
|
e = e || {};
|
|
@@ -2805,14 +2810,14 @@ function _o(t, e) {
|
|
|
2805
2810
|
}
|
|
2806
2811
|
return s(), {
|
|
2807
2812
|
flush: a,
|
|
2808
|
-
push: function(
|
|
2809
|
-
return r = i.push(
|
|
2813
|
+
push: function(f) {
|
|
2814
|
+
return r = i.push(f), r >= o && a(), r;
|
|
2810
2815
|
},
|
|
2811
2816
|
size: function() {
|
|
2812
2817
|
return i.length;
|
|
2813
2818
|
},
|
|
2814
|
-
end: function(
|
|
2815
|
-
|
|
2819
|
+
end: function(f) {
|
|
2820
|
+
f && a(), clearInterval(n);
|
|
2816
2821
|
}
|
|
2817
2822
|
};
|
|
2818
2823
|
}
|
|
@@ -2826,10 +2831,10 @@ function Eo(t) {
|
|
|
2826
2831
|
if (a !== "pushState" && a !== "replaceState")
|
|
2827
2832
|
return;
|
|
2828
2833
|
const s = n[a];
|
|
2829
|
-
n[a] = function(...
|
|
2834
|
+
n[a] = function(...f) {
|
|
2830
2835
|
var c;
|
|
2831
|
-
const
|
|
2832
|
-
return i !== u && (i = u, setTimeout(() => t(
|
|
2836
|
+
const p = ((c = f[2]) == null ? void 0 : c.toString()) || "", u = To(p);
|
|
2837
|
+
return i !== u && (i = u, setTimeout(() => t(p), 0)), s.apply(n, f);
|
|
2833
2838
|
};
|
|
2834
2839
|
});
|
|
2835
2840
|
}
|
|
@@ -2846,35 +2851,35 @@ function Oo() {
|
|
|
2846
2851
|
});
|
|
2847
2852
|
}
|
|
2848
2853
|
function jo(t) {
|
|
2849
|
-
if (t === void 0 && (t = {}), !
|
|
2850
|
-
return
|
|
2851
|
-
var e =
|
|
2852
|
-
if (!
|
|
2853
|
-
return
|
|
2854
|
-
var d =
|
|
2855
|
-
return Number(
|
|
2854
|
+
if (t === void 0 && (t = {}), !X)
|
|
2855
|
+
return Tt;
|
|
2856
|
+
var e = Cn(), n = Ct(), r = jn(), i = qe(r, e), o = qe(n, e), a = [], s = [], f = [], p = r, u = i, c = o, m = Object.keys(t);
|
|
2857
|
+
if (!m.length)
|
|
2858
|
+
return Tt;
|
|
2859
|
+
var d = m.map(function(k) {
|
|
2860
|
+
return Number(k);
|
|
2856
2861
|
}), w = Mi(function() {
|
|
2857
|
-
var
|
|
2862
|
+
var k = Cn(), v = function($, R) {
|
|
2858
2863
|
return R.map(function(K) {
|
|
2859
|
-
return K === 100 ?
|
|
2864
|
+
return K === 100 ? $ - 5 : $ * (K / 100);
|
|
2860
2865
|
});
|
|
2861
|
-
}(
|
|
2866
|
+
}(k, d), _ = Ct(), S = jn(), y = qe(S, k), l = qe(_, k);
|
|
2862
2867
|
if (u = y > u ? y : u, c = l < c ? l : c, !(a.length >= d.length)) {
|
|
2863
|
-
var
|
|
2864
|
-
|
|
2865
|
-
var O = v,
|
|
2866
|
-
(
|
|
2867
|
-
var
|
|
2868
|
-
var
|
|
2869
|
-
return
|
|
2870
|
-
return
|
|
2871
|
-
}),
|
|
2872
|
-
}, { foundFunc: [], singleFunction: null, callbacks: [], direction:
|
|
2873
|
-
if (
|
|
2874
|
-
Y(t[
|
|
2875
|
-
}),
|
|
2876
|
-
var
|
|
2877
|
-
Y(t[
|
|
2868
|
+
var b = p === S, T = "up";
|
|
2869
|
+
b ? T = "initial" : p <= S && (T = "down");
|
|
2870
|
+
var O = v, C = d;
|
|
2871
|
+
(T === "up" || b) && (O = v.slice().reverse(), C = d.slice().reverse());
|
|
2872
|
+
var D = C.reduce(function($, R, K) {
|
|
2873
|
+
var j = O[K];
|
|
2874
|
+
return f.includes(R) && S <= j && (f = f.filter(function(I) {
|
|
2875
|
+
return I !== R;
|
|
2876
|
+
}), $.singleFunction = R), T === "down" && !a.includes(R) && S >= j && R > o ? (s.push(R), $.callbacks = $.callbacks.concat(R), $) : T === "up" && !a.includes(R) && S <= j && R <= y ? ($.foundFunc = [R], $) : (b && S >= j && $.foundFunc.length === 0 && ($.foundFunc = [R]), !s.includes(R) && S >= j && (s.push(R), $.singleFunction ? f.push(R) : $.singleFunction = R), $);
|
|
2877
|
+
}, { foundFunc: [], singleFunction: null, callbacks: [], direction: T });
|
|
2878
|
+
if (p = S, T === "down" && D.callbacks && D.callbacks.forEach(function($) {
|
|
2879
|
+
Y(t[$]) && (t[$]({ trigger: $, direction: T, scrollMin: c, scrollMax: u, range: [c, u] }), a.push($));
|
|
2880
|
+
}), D.singleFunction) {
|
|
2881
|
+
var z = D.singleFunction, F = D.direction;
|
|
2882
|
+
Y(t[z]) && t[z]({ trigger: z, direction: F, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(z);
|
|
2878
2883
|
}
|
|
2879
2884
|
}
|
|
2880
2885
|
}, 500);
|
|
@@ -2882,17 +2887,17 @@ function jo(t) {
|
|
|
2882
2887
|
return window.removeEventListener("scroll", w);
|
|
2883
2888
|
};
|
|
2884
2889
|
}
|
|
2885
|
-
function
|
|
2886
|
-
return
|
|
2890
|
+
function Ct() {
|
|
2891
|
+
return X ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
2887
2892
|
}
|
|
2888
2893
|
function Co() {
|
|
2889
|
-
return
|
|
2894
|
+
return X ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2890
2895
|
}
|
|
2891
|
-
function
|
|
2892
|
-
return Math.round(
|
|
2896
|
+
function jn() {
|
|
2897
|
+
return Math.round(Ct() + Co());
|
|
2893
2898
|
}
|
|
2894
|
-
function
|
|
2895
|
-
if (!
|
|
2899
|
+
function Cn() {
|
|
2900
|
+
if (!X)
|
|
2896
2901
|
return 0;
|
|
2897
2902
|
var t = document.body, e = document.documentElement;
|
|
2898
2903
|
return Math.max(t.scrollHeight, t.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight);
|
|
@@ -2900,25 +2905,25 @@ function On() {
|
|
|
2900
2905
|
function qe(t, e) {
|
|
2901
2906
|
return Math.round(t / e * 100);
|
|
2902
2907
|
}
|
|
2903
|
-
var
|
|
2908
|
+
var xn = "EventListener";
|
|
2904
2909
|
function xo(t) {
|
|
2905
2910
|
return function(e, n, r, i) {
|
|
2906
|
-
var o = r ||
|
|
2907
|
-
if (!
|
|
2911
|
+
var o = r || Tt, a = i || !1;
|
|
2912
|
+
if (!X)
|
|
2908
2913
|
return o;
|
|
2909
|
-
var s = rt(n),
|
|
2910
|
-
if (!
|
|
2914
|
+
var s = rt(n), f = rt(e, !0);
|
|
2915
|
+
if (!f.length)
|
|
2911
2916
|
throw new Error("noElements");
|
|
2912
2917
|
if (!s.length)
|
|
2913
2918
|
throw new Error("noEvent");
|
|
2914
|
-
var
|
|
2919
|
+
var p = [];
|
|
2915
2920
|
return function u(c) {
|
|
2916
|
-
c && (
|
|
2917
|
-
for (var
|
|
2918
|
-
var w =
|
|
2919
|
-
|
|
2920
|
-
for (var
|
|
2921
|
-
w[
|
|
2921
|
+
c && (p = []);
|
|
2922
|
+
for (var m = c ? "add" + xn : "remove" + xn, d = 0; d < f.length; d++) {
|
|
2923
|
+
var w = f[d];
|
|
2924
|
+
p[d] = c ? a && a.once ? Ao(o) : o : p[d] || o;
|
|
2925
|
+
for (var k = 0; k < s.length; k++)
|
|
2926
|
+
w[m] ? w["on" + s[k]] = c ? p[d] : null : w[m](s[k], p[d], a);
|
|
2922
2927
|
}
|
|
2923
2928
|
return u.bind(null, !c);
|
|
2924
2929
|
}(t);
|
|
@@ -2947,17 +2952,17 @@ function Ao(t, e) {
|
|
|
2947
2952
|
};
|
|
2948
2953
|
}
|
|
2949
2954
|
var wt = xo("Event");
|
|
2950
|
-
function
|
|
2951
|
-
return
|
|
2955
|
+
function Pr(t, e) {
|
|
2956
|
+
return X && Y(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), Y(n) ? function() {
|
|
2952
2957
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2953
2958
|
} : r) : window[t] = e;
|
|
2954
2959
|
var n, r, i;
|
|
2955
2960
|
}
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
var
|
|
2961
|
+
Pr.bind(null, "onerror");
|
|
2962
|
+
Pr.bind(null, "onload");
|
|
2963
|
+
var Tr = typeof window > "u", An = "hidden";
|
|
2959
2964
|
function $o(t) {
|
|
2960
|
-
if (
|
|
2965
|
+
if (Tr)
|
|
2961
2966
|
return !1;
|
|
2962
2967
|
var e = No(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2963
2968
|
return t(!!document[e]);
|
|
@@ -2970,7 +2975,7 @@ function $o(t) {
|
|
|
2970
2975
|
}
|
|
2971
2976
|
function No() {
|
|
2972
2977
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2973
|
-
return
|
|
2978
|
+
return Tr || An in document ? An : t.reduce(function(e, n) {
|
|
2974
2979
|
var r = n + "Hidden";
|
|
2975
2980
|
return !e && r in document ? r : e;
|
|
2976
2981
|
}, null);
|
|
@@ -2979,10 +2984,10 @@ var Uo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keyd
|
|
|
2979
2984
|
function zo(t, e) {
|
|
2980
2985
|
e === void 0 && (e = {});
|
|
2981
2986
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2982
|
-
var
|
|
2987
|
+
var f = this, p = !1;
|
|
2983
2988
|
return function(u) {
|
|
2984
|
-
|
|
2985
|
-
return
|
|
2989
|
+
p || (a.call(f, u), p = !0, setTimeout(function() {
|
|
2990
|
+
return p = !1;
|
|
2986
2991
|
}, s));
|
|
2987
2992
|
};
|
|
2988
2993
|
}(t, e.throttle || 1e4), r = [];
|
|
@@ -3004,29 +3009,29 @@ function zo(t, e) {
|
|
|
3004
3009
|
};
|
|
3005
3010
|
}
|
|
3006
3011
|
function Ro(t) {
|
|
3007
|
-
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a,
|
|
3012
|
+
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, f = t.throttle, p = f === void 0 ? 2e3 : f, u = !1, c = !1, m = /* @__PURE__ */ new Date(), d = function() {
|
|
3008
3013
|
return clearTimeout(e);
|
|
3009
3014
|
};
|
|
3010
3015
|
function w(v) {
|
|
3011
|
-
d(), o && !u && o(ze(
|
|
3012
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(
|
|
3016
|
+
d(), o && !u && o(ze(m), v), i && u && (u = !1, i(ze(n), v), m = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
3017
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(m), v));
|
|
3013
3018
|
}, s);
|
|
3014
3019
|
}
|
|
3015
|
-
var
|
|
3020
|
+
var k = zo(w, { throttle: p });
|
|
3016
3021
|
return { disable: function() {
|
|
3017
3022
|
c = !0, u = !1, d();
|
|
3018
|
-
var v =
|
|
3023
|
+
var v = k();
|
|
3019
3024
|
return function() {
|
|
3020
|
-
return c = !1,
|
|
3025
|
+
return c = !1, m = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
|
|
3021
3026
|
};
|
|
3022
3027
|
}, getStatus: function() {
|
|
3023
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 : ze(
|
|
3028
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : ze(m, c), idle: u ? ze(n, c) : 0 };
|
|
3024
3029
|
} };
|
|
3025
3030
|
}
|
|
3026
3031
|
function ze(t, e) {
|
|
3027
3032
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
3028
3033
|
}
|
|
3029
|
-
const
|
|
3034
|
+
const $n = 5e3;
|
|
3030
3035
|
class Do {
|
|
3031
3036
|
constructor(e) {
|
|
3032
3037
|
q(this, "element");
|
|
@@ -3052,7 +3057,7 @@ class Do {
|
|
|
3052
3057
|
), this.observer.observe(this.element), Ro({
|
|
3053
3058
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
3054
3059
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
3055
|
-
timeout:
|
|
3060
|
+
timeout: $n
|
|
3056
3061
|
}), jo({
|
|
3057
3062
|
25: this.handleScroll.bind(this),
|
|
3058
3063
|
50: this.handleScroll.bind(this),
|
|
@@ -3071,7 +3076,7 @@ class Do {
|
|
|
3071
3076
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
3072
3077
|
}
|
|
3073
3078
|
handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
3074
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
3079
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * $n : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
3075
3080
|
}
|
|
3076
3081
|
handleScroll(e) {
|
|
3077
3082
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -3088,14 +3093,14 @@ class Do {
|
|
|
3088
3093
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
3089
3094
|
}
|
|
3090
3095
|
}
|
|
3091
|
-
const
|
|
3096
|
+
const Nn = "sesamy_session_id";
|
|
3092
3097
|
function Lo() {
|
|
3093
|
-
let t = sessionStorage.getItem(
|
|
3094
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
3098
|
+
let t = sessionStorage.getItem(Nn);
|
|
3099
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(Nn, t)), t;
|
|
3095
3100
|
}
|
|
3096
|
-
let
|
|
3097
|
-
function Mo({ clientId: t, enabled: e = !0, endpoint: n =
|
|
3098
|
-
if (
|
|
3101
|
+
let Or = !1, xt, Un, it;
|
|
3102
|
+
function Mo({ clientId: t, enabled: e = !0, endpoint: n = ci }) {
|
|
3103
|
+
if (xt = t, Un = e, it = n, !Un)
|
|
3099
3104
|
return;
|
|
3100
3105
|
Oo();
|
|
3101
3106
|
const r = new Do({
|
|
@@ -3131,18 +3136,18 @@ function Mo({ clientId: t, enabled: e = !0, endpoint: n = ai }) {
|
|
|
3131
3136
|
const o = i;
|
|
3132
3137
|
await re.identify(o.detail.sub);
|
|
3133
3138
|
}), window.addEventListener(Q.LOGOUT, async () => {
|
|
3134
|
-
await re.track("logout", {}),
|
|
3139
|
+
await re.track("logout", {}), Ht.flush(), await re.reset();
|
|
3135
3140
|
});
|
|
3136
3141
|
}
|
|
3137
|
-
function
|
|
3142
|
+
function jr(t) {
|
|
3138
3143
|
return JSON.stringify(
|
|
3139
3144
|
t.map((e) => ({
|
|
3140
3145
|
...e,
|
|
3141
|
-
clientId:
|
|
3146
|
+
clientId: xt,
|
|
3142
3147
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
3143
3148
|
sessionId: Lo(),
|
|
3144
3149
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3145
|
-
version:
|
|
3150
|
+
version: Rt,
|
|
3146
3151
|
event: e.event,
|
|
3147
3152
|
context: {
|
|
3148
3153
|
page: {
|
|
@@ -3153,18 +3158,18 @@ function Tr(t) {
|
|
|
3153
3158
|
referrer: document.referrer
|
|
3154
3159
|
},
|
|
3155
3160
|
locale: navigator.language,
|
|
3156
|
-
library:
|
|
3161
|
+
library: ir,
|
|
3157
3162
|
userAgent: navigator.userAgent,
|
|
3158
|
-
clientId:
|
|
3163
|
+
clientId: xt
|
|
3159
3164
|
}
|
|
3160
3165
|
}))
|
|
3161
3166
|
);
|
|
3162
3167
|
}
|
|
3163
|
-
const
|
|
3168
|
+
const Ht = _o(
|
|
3164
3169
|
async (t) => {
|
|
3165
3170
|
if (t.length > 0) {
|
|
3166
|
-
const e =
|
|
3167
|
-
|
|
3171
|
+
const e = jr(t);
|
|
3172
|
+
Or ? navigator.sendBeacon(it, e) : (await fetch(it, {
|
|
3168
3173
|
method: "POST",
|
|
3169
3174
|
body: e,
|
|
3170
3175
|
headers: {
|
|
@@ -3185,13 +3190,13 @@ function bt(t) {
|
|
|
3185
3190
|
if (t.anonymousId)
|
|
3186
3191
|
if ((e = t.properties) != null && e.flushing) {
|
|
3187
3192
|
const n = { ...t };
|
|
3188
|
-
delete n.properties.flushing, navigator.sendBeacon(it,
|
|
3193
|
+
delete n.properties.flushing, navigator.sendBeacon(it, jr([n]));
|
|
3189
3194
|
} else
|
|
3190
|
-
|
|
3195
|
+
Ht.push(t);
|
|
3191
3196
|
}
|
|
3192
3197
|
const re = So({
|
|
3193
|
-
app:
|
|
3194
|
-
version:
|
|
3198
|
+
app: ir,
|
|
3199
|
+
version: Rt,
|
|
3195
3200
|
plugins: [
|
|
3196
3201
|
{
|
|
3197
3202
|
name: "custom-analytics-plugin",
|
|
@@ -3231,34 +3236,34 @@ function Zo(t, e) {
|
|
|
3231
3236
|
re.track(t, e);
|
|
3232
3237
|
}
|
|
3233
3238
|
function Ko() {
|
|
3234
|
-
return
|
|
3239
|
+
return Or = !0, Ht.flush();
|
|
3235
3240
|
}
|
|
3236
|
-
const
|
|
3241
|
+
const Cr = /* @__PURE__ */ new Map();
|
|
3237
3242
|
function Wo(t, e) {
|
|
3238
|
-
|
|
3243
|
+
Cr.set(t, e);
|
|
3239
3244
|
}
|
|
3240
3245
|
window.addEventListener("beforeunload", () => {
|
|
3241
|
-
|
|
3246
|
+
Cr.forEach((t, e) => {
|
|
3242
3247
|
t.bind(e)();
|
|
3243
3248
|
}), Ko();
|
|
3244
3249
|
});
|
|
3245
|
-
const
|
|
3250
|
+
const xr = /* @__PURE__ */ new Map();
|
|
3246
3251
|
function Ho(t, e) {
|
|
3247
|
-
|
|
3252
|
+
xr.set(t, e);
|
|
3248
3253
|
}
|
|
3249
3254
|
window.addEventListener("visibilitychange", () => {
|
|
3250
|
-
document.visibilityState !== "visible" &&
|
|
3255
|
+
document.visibilityState !== "visible" && xr.forEach((t, e) => {
|
|
3251
3256
|
t.bind(e)();
|
|
3252
3257
|
});
|
|
3253
3258
|
});
|
|
3254
|
-
const
|
|
3255
|
-
function
|
|
3256
|
-
const t = sessionStorage.getItem(
|
|
3259
|
+
const Ar = "sesamySignedURLs";
|
|
3260
|
+
function $r() {
|
|
3261
|
+
const t = sessionStorage.getItem(Ar);
|
|
3257
3262
|
return t ? JSON.parse(t) : [];
|
|
3258
3263
|
}
|
|
3259
3264
|
function Fo(t) {
|
|
3260
|
-
const e =
|
|
3261
|
-
e.push(t), sessionStorage.setItem(
|
|
3265
|
+
const e = $r();
|
|
3266
|
+
e.push(t), sessionStorage.setItem(Ar, JSON.stringify(e));
|
|
3262
3267
|
}
|
|
3263
3268
|
function Jo(t) {
|
|
3264
3269
|
const {
|
|
@@ -3269,34 +3274,36 @@ function Jo(t) {
|
|
|
3269
3274
|
getContract: o,
|
|
3270
3275
|
getContracts: a,
|
|
3271
3276
|
getBill: s,
|
|
3272
|
-
getBills:
|
|
3273
|
-
getProfile:
|
|
3277
|
+
getBills: f,
|
|
3278
|
+
getProfile: p,
|
|
3274
3279
|
updateProfile: u,
|
|
3275
3280
|
getTags: c,
|
|
3276
|
-
deleteTag:
|
|
3281
|
+
deleteTag: m,
|
|
3277
3282
|
setTag: d,
|
|
3278
3283
|
getUserMetadata: w,
|
|
3279
|
-
listUserMetadata:
|
|
3284
|
+
listUserMetadata: k,
|
|
3280
3285
|
setUserMetadata: v,
|
|
3281
3286
|
deleteUserMetadata: _,
|
|
3282
3287
|
getTally: S,
|
|
3283
3288
|
getTallies: y,
|
|
3284
3289
|
pushTally: l,
|
|
3285
|
-
deleteTally:
|
|
3286
|
-
getProduct:
|
|
3290
|
+
deleteTally: b,
|
|
3291
|
+
getProduct: T,
|
|
3287
3292
|
getPaymentIssues: O,
|
|
3288
|
-
autoOnboardProduct:
|
|
3293
|
+
autoOnboardProduct: C,
|
|
3294
|
+
openHostedAccountPage: D
|
|
3289
3295
|
} = Ei(t), z = {
|
|
3290
3296
|
auth: {
|
|
3291
|
-
getUser:
|
|
3292
|
-
isAuthenticated:
|
|
3293
|
-
loginWithRedirect:
|
|
3297
|
+
getUser: p,
|
|
3298
|
+
isAuthenticated: qn,
|
|
3299
|
+
loginWithRedirect: Qn,
|
|
3294
3300
|
logout: di,
|
|
3295
|
-
setToken:
|
|
3301
|
+
setToken: er
|
|
3296
3302
|
},
|
|
3297
3303
|
profile: {
|
|
3298
|
-
get:
|
|
3299
|
-
update: u
|
|
3304
|
+
get: p,
|
|
3305
|
+
update: u,
|
|
3306
|
+
openHostedAccountPage: D
|
|
3300
3307
|
},
|
|
3301
3308
|
analytics: {
|
|
3302
3309
|
track: Zo
|
|
@@ -3304,13 +3311,13 @@ function Jo(t) {
|
|
|
3304
3311
|
tags: {
|
|
3305
3312
|
list: c,
|
|
3306
3313
|
set: d,
|
|
3307
|
-
delete:
|
|
3314
|
+
delete: m
|
|
3308
3315
|
},
|
|
3309
3316
|
entitlements: {
|
|
3310
3317
|
get: e,
|
|
3311
3318
|
list: n,
|
|
3312
3319
|
access: r,
|
|
3313
|
-
signedLinks:
|
|
3320
|
+
signedLinks: $r
|
|
3314
3321
|
},
|
|
3315
3322
|
contracts: {
|
|
3316
3323
|
get: o,
|
|
@@ -3318,11 +3325,11 @@ function Jo(t) {
|
|
|
3318
3325
|
},
|
|
3319
3326
|
bills: {
|
|
3320
3327
|
get: s,
|
|
3321
|
-
list:
|
|
3328
|
+
list: f
|
|
3322
3329
|
},
|
|
3323
3330
|
userMetadata: {
|
|
3324
3331
|
get: w,
|
|
3325
|
-
list:
|
|
3332
|
+
list: k,
|
|
3326
3333
|
set: v,
|
|
3327
3334
|
delete: _
|
|
3328
3335
|
},
|
|
@@ -3330,14 +3337,14 @@ function Jo(t) {
|
|
|
3330
3337
|
get: S,
|
|
3331
3338
|
list: y,
|
|
3332
3339
|
push: l,
|
|
3333
|
-
delete:
|
|
3340
|
+
delete: b
|
|
3334
3341
|
},
|
|
3335
3342
|
subscriptions: {
|
|
3336
3343
|
list: i
|
|
3337
3344
|
},
|
|
3338
3345
|
products: {
|
|
3339
|
-
get:
|
|
3340
|
-
autoOnboard:
|
|
3346
|
+
get: T,
|
|
3347
|
+
autoOnboard: C
|
|
3341
3348
|
},
|
|
3342
3349
|
getVersion: Xo,
|
|
3343
3350
|
getPaymentIssues: O,
|
|
@@ -3346,22 +3353,22 @@ function Jo(t) {
|
|
|
3346
3353
|
return t.namespace && (window[t.namespace] = z), z;
|
|
3347
3354
|
}
|
|
3348
3355
|
function Xo() {
|
|
3349
|
-
return
|
|
3356
|
+
return Rt;
|
|
3350
3357
|
}
|
|
3351
3358
|
function Vo() {
|
|
3352
3359
|
const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
|
|
3353
3360
|
if (e) {
|
|
3354
|
-
|
|
3361
|
+
er(e, n ? parseInt(n, 10) : void 0);
|
|
3355
3362
|
const r = new URL(window.location.href);
|
|
3356
3363
|
t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
|
|
3357
3364
|
}
|
|
3358
3365
|
}
|
|
3359
|
-
const
|
|
3366
|
+
const zn = "sesamy-refresh", Rn = "force-refetch-entitlements";
|
|
3360
3367
|
function Yo() {
|
|
3361
|
-
const t = new URLSearchParams(window.location.search), e = t.get(
|
|
3368
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Rn), n = t.get(zn);
|
|
3362
3369
|
if (e !== null || n !== null) {
|
|
3363
3370
|
const r = new URL(window.location.href);
|
|
3364
|
-
t.delete(
|
|
3371
|
+
t.delete(Rn), t.delete(zn), r.search = t.toString(), te(), window.history.replaceState(null, "", r);
|
|
3365
3372
|
}
|
|
3366
3373
|
}
|
|
3367
3374
|
function Go() {
|
|
@@ -3380,22 +3387,22 @@ function Go() {
|
|
|
3380
3387
|
const i = new URL(window.location.href);
|
|
3381
3388
|
i.searchParams.delete("ss"), i.searchParams.delete("se"), i.searchParams.delete("sp"), i.searchParams.delete("so"), i.searchParams.delete("token"), window.history.replaceState(null, "", i);
|
|
3382
3389
|
}
|
|
3383
|
-
const
|
|
3390
|
+
const Dn = "sesamy-user";
|
|
3384
3391
|
async function Bo() {
|
|
3385
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
3392
|
+
const e = new URLSearchParams(window.location.search).get(Dn);
|
|
3386
3393
|
if (!e)
|
|
3387
3394
|
return;
|
|
3388
|
-
const n = await
|
|
3389
|
-
(n == null ? void 0 : n.email) !== e &&
|
|
3395
|
+
const n = await li();
|
|
3396
|
+
(n == null ? void 0 : n.email) !== e && Qn();
|
|
3390
3397
|
const r = new URL(window.location.href);
|
|
3391
|
-
r.searchParams.delete(
|
|
3398
|
+
r.searchParams.delete(Dn), window.history.replaceState(null, "", r);
|
|
3392
3399
|
}
|
|
3393
|
-
const
|
|
3400
|
+
const Ln = "sesamy-purchase";
|
|
3394
3401
|
function qo() {
|
|
3395
|
-
const t = new URLSearchParams(window.location.search), e = t.get(
|
|
3402
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Ln);
|
|
3396
3403
|
if (e !== null) {
|
|
3397
3404
|
const n = new URL(window.location.href);
|
|
3398
|
-
t.delete(
|
|
3405
|
+
t.delete(Ln), n.search = t.toString(), ue(Q.PURCHASE, { itemSrc: e }), te(), window.history.replaceState(null, "", n);
|
|
3399
3406
|
}
|
|
3400
3407
|
}
|
|
3401
3408
|
async function Qo(t) {
|
|
@@ -3403,12 +3410,12 @@ async function Qo(t) {
|
|
|
3403
3410
|
clientId: t.clientId,
|
|
3404
3411
|
// The default client id can be overridden by the config
|
|
3405
3412
|
...t.analytics
|
|
3406
|
-
}), await
|
|
3413
|
+
}), await ui({
|
|
3407
3414
|
clientId: t.clientId,
|
|
3408
3415
|
// The default client id can be overridden by the config
|
|
3409
3416
|
...t.auth
|
|
3410
3417
|
});
|
|
3411
|
-
const e = Jo(t.api
|
|
3418
|
+
const e = Jo({ clientId: t.clientId, ...t.api });
|
|
3412
3419
|
return ue(Q.READY, {}), Vo(), Yo(), Go(), await Bo(), qo(), e;
|
|
3413
3420
|
}
|
|
3414
3421
|
if (typeof document < "u") {
|