@sesamy/sesamy-js 1.4.0 → 1.4.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.
@@ -401,8 +401,8 @@ async function Cr(t, e) {
401
401
  try {
402
402
  S = await xr(u, h, d, w, I, y, c), E = null;
403
403
  break;
404
- } catch ($) {
405
- E = $;
404
+ } catch (C) {
405
+ E = C;
406
406
  }
407
407
  if (E)
408
408
  throw E;
@@ -1001,7 +1001,7 @@ async function Xr(t) {
1001
1001
  const Rn = "sesamy.com", Fr = "https://logs.sesamy.com/events";
1002
1002
  var pe = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.SOFT_PAYWALL = "sesamyJsSoftPaywall", t))(pe || {});
1003
1003
  let V;
1004
- const Pt = "sesamyAccessToken", jt = "sesamyExpiresAt";
1004
+ const Pt = "sesamyAccessToken", jt = "sesamyExpires";
1005
1005
  function xt() {
1006
1006
  const t = localStorage.getItem(jt);
1007
1007
  if (!(!t || parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
@@ -1017,7 +1017,7 @@ async function Hr(t) {
1017
1017
  const e = await V.getUser();
1018
1018
  nt(pe.AUTHENTICATED, e);
1019
1019
  const n = new URL(location.href), r = n.searchParams;
1020
- r.delete("code"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
1020
+ r.delete("code"), r.delete("state"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
1021
1021
  } catch {
1022
1022
  }
1023
1023
  }
@@ -1047,13 +1047,19 @@ function Gr() {
1047
1047
  }
1048
1048
  });
1049
1049
  }
1050
- async function Br() {
1051
- const t = xt();
1052
- if (t)
1053
- return t;
1054
- if (!V)
1055
- throw new Error("Auth0 client not initialized");
1056
- return V.getTokenSilently();
1050
+ async function Br(t = !0) {
1051
+ const e = xt();
1052
+ if (e)
1053
+ return e;
1054
+ try {
1055
+ if (!V)
1056
+ throw new Error("Auth0 client not initialized");
1057
+ return await V.getTokenSilently();
1058
+ } catch (n) {
1059
+ if (t)
1060
+ throw n;
1061
+ return null;
1062
+ }
1057
1063
  }
1058
1064
  async function qr() {
1059
1065
  if (localStorage.removeItem(Pt), localStorage.removeItem(jt), !V)
@@ -1364,23 +1370,28 @@ oe.errorType = ci;
1364
1370
  oe.polyfills = si;
1365
1371
  oe.WretchError = Kn;
1366
1372
  function hi(t) {
1367
- const e = t.endpoint || `https://api2.${Rn}`, n = (k = !0) => (_) => async ($, U) => {
1373
+ const e = t.endpoint || `https://api2.${Rn}`, n = (k = !0) => (_) => async (C, D) => {
1368
1374
  let R = null;
1369
- if (R = await Br(), !R && k)
1370
- throw new Error("No access token available");
1375
+ if (R = await Br(k), !R) {
1376
+ if (k)
1377
+ throw new Error("No access token available");
1378
+ return _(C, D);
1379
+ }
1371
1380
  const L = {
1372
- ...U,
1381
+ ...D,
1373
1382
  headers: {
1374
- ...U.headers,
1383
+ ...D.headers,
1375
1384
  ...R ? { Authorization: `Bearer ${R}` } : {}
1376
1385
  }
1377
1386
  };
1378
- return _($, L);
1379
- }, r = (k) => (_, $) => {
1380
- const U = localStorage.getItem("__anon_id"), R = btoa(`${U}:`), L = {
1381
- ...$,
1387
+ return _(C, L);
1388
+ }, r = (k) => (_, C) => {
1389
+ if (C.headers.Authorization)
1390
+ return k(_, C);
1391
+ const D = localStorage.getItem("__anon_id"), R = btoa(`${D}:`), L = {
1392
+ ...C,
1382
1393
  headers: {
1383
- ...$.headers,
1394
+ ...C.headers,
1384
1395
  Authorization: `Basic ${R}`
1385
1396
  }
1386
1397
  };
@@ -1412,21 +1423,21 @@ function hi(t) {
1412
1423
  }
1413
1424
  async function s(k) {
1414
1425
  const _ = await i.get("/entitlements").json();
1415
- return _ == null ? void 0 : _.find(($) => $.id === k);
1426
+ return _ == null ? void 0 : _.find((C) => C.id === k);
1416
1427
  }
1417
1428
  async function p() {
1418
1429
  return i.get("/contracts").json();
1419
1430
  }
1420
1431
  async function f(k) {
1421
1432
  const _ = await i.get("/contracts").json();
1422
- return _ == null ? void 0 : _.find(($) => $.id === k);
1433
+ return _ == null ? void 0 : _.find((C) => C.id === k);
1423
1434
  }
1424
1435
  async function u() {
1425
1436
  return i.get("/bills").json();
1426
1437
  }
1427
1438
  async function c(k) {
1428
1439
  const _ = await i.get("/bills").json();
1429
- return _ == null ? void 0 : _.find(($) => $.id === k);
1440
+ return _ == null ? void 0 : _.find((C) => C.id === k);
1430
1441
  }
1431
1442
  async function h(k, _) {
1432
1443
  return await i.url(`/user-metadata/${k}`).put(_).json();
@@ -1438,7 +1449,7 @@ function hi(t) {
1438
1449
  return (await i.url(`/user-metadata/${k}`).get().json())[k];
1439
1450
  }
1440
1451
  async function I() {
1441
- return i.url("/user-metadata").get().json();
1452
+ return await i.url("/user-metadata").get().json();
1442
1453
  }
1443
1454
  async function y() {
1444
1455
  return await i.url("/tags").get().json();
@@ -1968,16 +1979,16 @@ var ft = function(t) {
1968
1979
  return function(E, v, l) {
1969
1980
  var b = v.config, j = v.name, k = j + "." + E.type;
1970
1981
  l && (k = l.event);
1971
- var _ = E.type.match(_e) ? /* @__PURE__ */ function($, U, R, L, F) {
1982
+ var _ = E.type.match(_e) ? /* @__PURE__ */ function(C, D, R, L, F) {
1972
1983
  return function(W, x) {
1973
- var K = L ? L.name : $, J = x && Ze(x) ? x : R;
1974
- if (L && (!(J = x && Ze(x) ? x : [$]).includes($) || J.length !== 1))
1975
- throw new Error("Method " + U + " can only abort " + $ + " plugin. " + JSON.stringify(J) + " input valid");
1976
- return P({}, F, { abort: { reason: W, plugins: J, caller: U, _: K } });
1984
+ var K = L ? L.name : C, J = x && Ze(x) ? x : R;
1985
+ if (L && (!(J = x && Ze(x) ? x : [C]).includes(C) || J.length !== 1))
1986
+ throw new Error("Method " + D + " can only abort " + C + " plugin. " + JSON.stringify(J) + " input valid");
1987
+ return P({}, F, { abort: { reason: W, plugins: J, caller: D, _: K } });
1977
1988
  };
1978
- }(j, k, S, l, E) : /* @__PURE__ */ function($, U) {
1989
+ }(j, k, S, l, E) : /* @__PURE__ */ function(C, D) {
1979
1990
  return function() {
1980
- throw new Error($.type + " action not cancellable. Remove abort in " + U);
1991
+ throw new Error(C.type + " action not cancellable. Remove abort in " + D);
1981
1992
  };
1982
1993
  }(E, k);
1983
1994
  return { payload: Ui(E), instance: y, config: b || {}, abort: _ };
@@ -1995,9 +2006,9 @@ var ft = function(t) {
1995
2006
  }
1996
2007
  var j = function() {
1997
2008
  if (e.namespaced && e.namespaced[v])
1998
- return Promise.resolve(e.namespaced[v].reduce(function(k, _, $) {
2009
+ return Promise.resolve(e.namespaced[v].reduce(function(k, _, C) {
1999
2010
  try {
2000
- return Promise.resolve(k).then(function(U) {
2011
+ return Promise.resolve(k).then(function(D) {
2001
2012
  return _.method && G(_.method) ? (function(W, x) {
2002
2013
  var K = pn(W);
2003
2014
  if (K && K.name === x) {
@@ -2005,16 +2016,16 @@ var ft = function(t) {
2005
2016
  throw new Error([x + " plugin is calling method " + W, "Plugins cant call self", "Use " + K.method + " " + (J ? "or " + J.method : "") + " in " + x + " plugin insteadof " + W].join(`
2006
2017
  `));
2007
2018
  }
2008
- }(_.methodName, _.pluginName), Promise.resolve(_.method({ payload: U, instance: r, abort: (R = U, L = v, F = _.pluginName, function(W, x) {
2019
+ }(_.methodName, _.pluginName), Promise.resolve(_.method({ payload: D, instance: r, abort: (R = D, L = v, F = _.pluginName, function(W, x) {
2009
2020
  return P({}, R, { abort: { reason: W, plugins: x || [L], caller: c, from: F || L } });
2010
2021
  }), config: ln(_.pluginName, f, o), plugins: f })).then(function(W) {
2011
2022
  var x = X(W) ? W : {};
2012
- return Promise.resolve(P({}, U, x));
2013
- })) : U;
2023
+ return Promise.resolve(P({}, D, x));
2024
+ })) : D;
2014
2025
  var R, L, F;
2015
2026
  });
2016
- } catch (U) {
2017
- return Promise.reject(U);
2027
+ } catch (D) {
2028
+ return Promise.reject(D);
2018
2029
  }
2019
2030
  }, Promise.resolve(n))).then(function(k) {
2020
2031
  l[v] = k;
@@ -2038,9 +2049,9 @@ var ft = function(t) {
2038
2049
  return l && pt({ data: k, method: c, instance: r, store: s }), Promise.resolve(k);
2039
2050
  if (I.hasOwnProperty(b) && I[b] === !0)
2040
2051
  return s.dispatch({ type: "queue", plugin: b, payload: _, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(k);
2041
- var $ = w(y[b], o[b]);
2042
- return Promise.resolve(j[c]({ abort: $.abort, payload: _, instance: r, config: ln(b, f, o), plugins: f })).then(function(U) {
2043
- var R = X(U) ? U : {}, L = P({}, k, R), F = y[b];
2052
+ var C = w(y[b], o[b]);
2053
+ return Promise.resolve(j[c]({ abort: C.abort, payload: _, instance: r, config: ln(b, f, o), plugins: f })).then(function(D) {
2054
+ var R = X(D) ? D : {}, L = P({}, k, R), F = y[b];
2044
2055
  if (mt(F, b))
2045
2056
  pt({ data: F, method: c, instance: r, pluginName: b, store: s });
2046
2057
  else {
@@ -2135,8 +2146,8 @@ function Li(t, e, n) {
2135
2146
  return qn(l, function() {
2136
2147
  return b({ config: k });
2137
2148
  }, 1e4).then(function(_) {
2138
- return r[j] || (i.dispatch({ type: T.pluginReadyType(j), name: j, events: Object.keys(l).filter(function($) {
2139
- return !_t.includes($);
2149
+ return r[j] || (i.dispatch({ type: T.pluginReadyType(j), name: j, events: Object.keys(l).filter(function(C) {
2150
+ return !_t.includes(C);
2140
2151
  }) }), r[j] = !0), I = I.concat(j), l;
2141
2152
  }).catch(function(_) {
2142
2153
  if (_ instanceof Error)
@@ -2157,56 +2168,56 @@ function Li(t, e, n) {
2157
2168
  return Qn(i, e, t);
2158
2169
  }, 0), Promise.resolve(function(l, b, j, k, _) {
2159
2170
  try {
2160
- var $ = G(b) ? b() : b, U = l.type, R = U.replace(_e, "");
2171
+ var C = G(b) ? b() : b, D = l.type, R = D.replace(_e, "");
2161
2172
  if (l._ && l._.called)
2162
2173
  return Promise.resolve(l);
2163
- var L = j.getState(), F = (K = $, (J = L.plugins) === void 0 && (J = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2174
+ var L = j.getState(), F = (K = C, (J = L.plugins) === void 0 && (J = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2164
2175
  var g = Ce.plugins || {};
2165
2176
  return wi(g[m]) ? g[m] : g.all !== !1 && (!J[m] || J[m].enabled !== !1);
2166
2177
  }).map(function(m) {
2167
2178
  return K[m];
2168
2179
  }));
2169
- U === T.initializeStart && l.fromEnable && (F = Object.keys(L.plugins).filter(function(m) {
2180
+ D === T.initializeStart && l.fromEnable && (F = Object.keys(L.plugins).filter(function(m) {
2170
2181
  var g = L.plugins[m];
2171
2182
  return l.plugins.includes(m) && !g.initialized;
2172
2183
  }).map(function(m) {
2173
- return $[m];
2184
+ return C[m];
2174
2185
  }));
2175
2186
  var W = F.map(function(m) {
2176
2187
  return m.name;
2177
2188
  }), x = function(m, g, O) {
2178
- var C = hn(m).map(function(A) {
2179
- return dn(A, g);
2189
+ var A = hn(m).map(function($) {
2190
+ return dn($, g);
2180
2191
  });
2181
- return g.reduce(function(A, z) {
2182
- var M = z.name, D = hn(m, M).map(function(Ae) {
2192
+ return g.reduce(function($, z) {
2193
+ var M = z.name, U = hn(m, M).map(function(Ae) {
2183
2194
  return dn(Ae, g);
2184
- }), Z = D[0], N = D[1], q = D[2];
2185
- return Z.length && (A.beforeNS[M] = Z), N.length && (A.duringNS[M] = N), q.length && (A.afterNS[M] = q), A;
2186
- }, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
2187
- }(U, F);
2188
- return Promise.resolve(ft({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(m) {
2195
+ }), Z = U[0], N = U[1], q = U[2];
2196
+ return Z.length && ($.beforeNS[M] = Z), N.length && ($.duringNS[M] = N), q.length && ($.afterNS[M] = q), $;
2197
+ }, { before: A[0], beforeNS: {}, during: A[1], duringNS: {}, after: A[2], afterNS: {} });
2198
+ }(D, F);
2199
+ return Promise.resolve(ft({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(m) {
2189
2200
  function g() {
2190
- var A = function() {
2191
- if (U.match(_e))
2192
- return Promise.resolve(ft({ action: P({}, O, { type: R + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(z) {
2201
+ var $ = function() {
2202
+ if (D.match(_e))
2203
+ return Promise.resolve(ft({ action: P({}, O, { type: R + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(z) {
2193
2204
  z.meta && z.meta.hasCallback && sn(z.meta.rid, { payload: z });
2194
2205
  });
2195
2206
  }();
2196
- return A && A.then ? A.then(function() {
2207
+ return $ && $.then ? $.then(function() {
2197
2208
  return m;
2198
2209
  }) : m;
2199
2210
  }
2200
2211
  if (er(m, W.length))
2201
2212
  return m;
2202
- var O, C = function() {
2203
- if (U !== R)
2204
- return Promise.resolve(ft({ action: P({}, m, { type: R }), data: { exact: x.during, namespaced: x.duringNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(A) {
2205
- O = A;
2213
+ var O, A = function() {
2214
+ if (D !== R)
2215
+ return Promise.resolve(ft({ action: P({}, m, { type: R }), data: { exact: x.during, namespaced: x.duringNS }, state: L, allPlugins: C, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function($) {
2216
+ O = $;
2206
2217
  });
2207
2218
  O = m;
2208
2219
  }();
2209
- return C && C.then ? C.then(g) : g();
2220
+ return A && A.then ? A.then(g) : g();
2210
2221
  });
2211
2222
  } catch (m) {
2212
2223
  return Promise.reject(m);
@@ -2442,22 +2453,22 @@ function eo(t) {
2442
2453
  return g.EVENTS[z];
2443
2454
  }) : [];
2444
2455
  m.pluginEnabled[g.name] = !(g.enabled === !1 || g.config.enabled === !1), delete g.enabled, g.methods && (m.methods[g.name] = Object.keys(g.methods).reduce(function(z, M) {
2445
- var D;
2446
- return z[M] = (D = g.methods[M], function() {
2447
- for (var Z = Array.prototype.slice.call(arguments), N = new Array(D.length), q = 0; q < Z.length; q++)
2456
+ var U;
2457
+ return z[M] = (U = g.methods[M], function() {
2458
+ for (var Z = Array.prototype.slice.call(arguments), N = new Array(U.length), q = 0; q < Z.length; q++)
2448
2459
  N[q] = Z[q];
2449
- return N[N.length] = b, D.apply({ instance: b }, N);
2460
+ return N[N.length] = b, U.apply({ instance: b }, N);
2450
2461
  }), z;
2451
2462
  }, {}), delete g.methods);
2452
- var C = Object.keys(g).concat(O), A = new Set(m.events.concat(C));
2453
- if (m.events = Array.from(A), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2463
+ var A = Object.keys(g).concat(O), $ = new Set(m.events.concat(A));
2464
+ if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2454
2465
  throw new Error(g.name + "AlreadyLoaded");
2455
2466
  return m.plugins[g.name] = g, m.plugins[g.name].loaded || (m.plugins[g.name].loaded = function() {
2456
2467
  return !0;
2457
2468
  }), m;
2458
2469
  }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: je }, o = /* @__PURE__ */ function(m) {
2459
- return function(g, O, C) {
2460
- return O.getState("user")[g] || (C && X(C) && C[g] ? C[g] : an(m)[g] || ge(St(g)) || null);
2470
+ return function(g, O, A) {
2471
+ return O.getState("user")[g] || (A && X(A) && A[g] ? A[g] : an(m)[g] || ge(St(g)) || null);
2461
2472
  };
2462
2473
  }(i), a = r.plugins, s = r.events.filter(function(m) {
2463
2474
  return !_t.includes(m);
@@ -2477,34 +2488,34 @@ function eo(t) {
2477
2488
  return new Promise(function(O) {
2478
2489
  x.dispatch({ type: T.disablePlugin, plugins: gt(m), _: { originalAction: T.disablePlugin } }, O, [g]);
2479
2490
  });
2480
- } }, r.methods), l = !1, b = { identify: function(m, g, O, C) {
2491
+ } }, r.methods), l = !1, b = { identify: function(m, g, O, A) {
2481
2492
  try {
2482
- var A = re(m) ? m : null, z = X(m) ? m : g, M = O || {}, D = b.user();
2483
- ye(St(te), A);
2484
- var Z = A || z.userId || o(te, b, z);
2493
+ var $ = re(m) ? m : null, z = X(m) ? m : g, M = O || {}, U = b.user();
2494
+ ye(St(te), $);
2495
+ var Z = $ || z.userId || o(te, b, z);
2485
2496
  return Promise.resolve(new Promise(function(N) {
2486
- x.dispatch(P({ type: T.identifyStart, userId: Z, traits: z || {}, options: M, anonymousId: D.anonymousId }, D.id && D.id !== A && { previousId: D.id }), N, [g, O, C]);
2497
+ x.dispatch(P({ type: T.identifyStart, userId: Z, traits: z || {}, options: M, anonymousId: U.anonymousId }, U.id && U.id !== $ && { previousId: U.id }), N, [g, O, A]);
2487
2498
  }));
2488
2499
  } catch (N) {
2489
2500
  return Promise.reject(N);
2490
2501
  }
2491
- }, track: function(m, g, O, C) {
2502
+ }, track: function(m, g, O, A) {
2492
2503
  try {
2493
- var A = X(m) ? m.event : m;
2494
- if (!A || !re(A))
2504
+ var $ = X(m) ? m.event : m;
2505
+ if (!$ || !re($))
2495
2506
  throw new Error("EventMissing");
2496
2507
  var z = X(m) ? m : g || {}, M = X(O) ? O : {};
2497
- return Promise.resolve(new Promise(function(D) {
2498
- x.dispatch({ type: T.trackStart, event: A, properties: z, options: M, userId: o(te, b, g), anonymousId: o(ke, b, g) }, D, [g, O, C]);
2508
+ return Promise.resolve(new Promise(function(U) {
2509
+ x.dispatch({ type: T.trackStart, event: $, properties: z, options: M, userId: o(te, b, g), anonymousId: o(ke, b, g) }, U, [g, O, A]);
2499
2510
  }));
2500
- } catch (D) {
2501
- return Promise.reject(D);
2511
+ } catch (U) {
2512
+ return Promise.reject(U);
2502
2513
  }
2503
2514
  }, page: function(m, g, O) {
2504
2515
  try {
2505
- var C = X(m) ? m : {}, A = X(g) ? g : {};
2516
+ var A = X(m) ? m : {}, $ = X(g) ? g : {};
2506
2517
  return Promise.resolve(new Promise(function(z) {
2507
- x.dispatch({ type: T.pageStart, properties: Hi(C), options: A, userId: o(te, b, C), anonymousId: o(ke, b, C) }, z, [m, g, O]);
2518
+ x.dispatch({ type: T.pageStart, properties: Hi(A), options: $, userId: o(te, b, A), anonymousId: o(ke, b, A) }, z, [m, g, O]);
2508
2519
  }));
2509
2520
  } catch (z) {
2510
2521
  return Promise.reject(z);
@@ -2531,24 +2542,24 @@ function eo(t) {
2531
2542
  throw new Error(".on disabled for " + m);
2532
2543
  var O = /Start$|Start:/;
2533
2544
  if (m === "*") {
2534
- var C = function(D) {
2545
+ var A = function(U) {
2535
2546
  return function(Z) {
2536
2547
  return function(N) {
2537
2548
  return N.type.match(O) && g({ payload: N, instance: b, plugins: a }), Z(N);
2538
2549
  };
2539
2550
  };
2540
- }, A = function(D) {
2551
+ }, $ = function(U) {
2541
2552
  return function(Z) {
2542
2553
  return function(N) {
2543
2554
  return N.type.match(O) || g({ payload: N, instance: b, plugins: a }), Z(N);
2544
2555
  };
2545
2556
  };
2546
2557
  };
2547
- return h(C, He), h(A, Ve), function() {
2548
- d(C, He), d(A, Ve);
2558
+ return h(A, He), h($, Ve), function() {
2559
+ d(A, He), d($, Ve);
2549
2560
  };
2550
2561
  }
2551
- var z = m.match(O) ? He : Ve, M = function(D) {
2562
+ var z = m.match(O) ? He : Ve, M = function(U) {
2552
2563
  return function(Z) {
2553
2564
  return function(N) {
2554
2565
  return N.type === m && g({ payload: N, instance: b, plugins: a, abort: I }), Z(N);
@@ -2563,8 +2574,8 @@ function eo(t) {
2563
2574
  return !1;
2564
2575
  if (m === T.bootstrap)
2565
2576
  throw new Error(".once disabled for " + m);
2566
- var O = b.on(m, function(C) {
2567
- g({ payload: C.payload, instance: b, plugins: a, abort: I }), O();
2577
+ var O = b.on(m, function(A) {
2578
+ g({ payload: A.payload, instance: b, plugins: a, abort: I }), O();
2568
2579
  });
2569
2580
  return O;
2570
2581
  }, getState: function(m) {
@@ -2588,10 +2599,10 @@ function eo(t) {
2588
2599
  return O.meta || (O.meta = wn()), g(O);
2589
2600
  };
2590
2601
  };
2591
- }, w(He), Li(b, u, { all: f, plugins: s }), Ri(i), $i(b), Ni(b), w(Ve)]), k = { context: Gi, user: zi(i), page: Yi, track: Ki, plugins: Wi(u), queue: Xi }, _ = Pe, $ = Pe;
2602
+ }, w(He), Li(b, u, { all: f, plugins: s }), Ri(i), $i(b), Ni(b), w(Ve)]), k = { context: Gi, user: zi(i), page: Yi, track: Ki, plugins: Wi(u), queue: Xi }, _ = Pe, C = Pe;
2592
2603
  if (Y && t.debug) {
2593
- var U = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2594
- U && (_ = U({ trace: !0, traceLimit: 25 })), $ = function() {
2604
+ var D = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2605
+ D && (_ = D({ trace: !0, traceLimit: 25 })), C = function() {
2595
2606
  return arguments.length === 0 ? sr() : X(typeof arguments[0]) ? vn() : vn().apply(null, arguments);
2596
2607
  };
2597
2608
  }
@@ -2600,42 +2611,42 @@ function eo(t) {
2600
2611
  return Bi.includes(O) || (g[O] = m[O]), g;
2601
2612
  }, {});
2602
2613
  }(t), F = r.pluginsArray.reduce(function(m, g) {
2603
- var O = g.name, C = g.config, A = g.loaded, z = r.pluginEnabled[O];
2604
- return m[O] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!A({ config: C }), config: C }, m;
2614
+ var O = g.name, A = g.config, $ = g.loaded, z = r.pluginEnabled[O];
2615
+ return m[O] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!$({ config: A }), config: A }, m;
2605
2616
  }, {}), W = { context: L, user: E, plugins: F }, x = Bn(function(m) {
2606
- for (var g = Object.keys(m), O = {}, C = 0; C < g.length; C++) {
2607
- var A = g[C];
2608
- typeof m[A] === ne && (O[A] = m[A]);
2617
+ for (var g = Object.keys(m), O = {}, A = 0; A < g.length; A++) {
2618
+ var $ = g[A];
2619
+ typeof m[$] === ne && (O[$] = m[$]);
2609
2620
  }
2610
2621
  var z, M = Object.keys(O);
2611
2622
  try {
2612
- (function(D) {
2613
- Object.keys(D).forEach(function(Z) {
2614
- var N = D[Z];
2623
+ (function(U) {
2624
+ Object.keys(U).forEach(function(Z) {
2625
+ var N = U[Z];
2615
2626
  if (typeof N(void 0, { type: "@@redux/INIT" }) === ee || typeof N(void 0, { type: xi }) === ee)
2616
2627
  throw new Error("reducer " + Z + " " + ee);
2617
2628
  });
2618
2629
  })(O);
2619
- } catch (D) {
2620
- z = D;
2630
+ } catch (U) {
2631
+ z = U;
2621
2632
  }
2622
- return function(D, Z) {
2623
- if (D === void 0 && (D = {}), z)
2633
+ return function(U, Z) {
2634
+ if (U === void 0 && (U = {}), z)
2624
2635
  throw z;
2625
2636
  for (var N = !1, q = {}, Ae = 0; Ae < M.length; Ae++) {
2626
- var Me = M[Ae], Rt = D[Me], ct = (0, O[Me])(Rt, Z);
2637
+ var Me = M[Ae], Rt = U[Me], ct = (0, O[Me])(Rt, Z);
2627
2638
  if (typeof ct === ee) {
2628
2639
  var vr = Ci(Me, Z);
2629
2640
  throw new Error(vr);
2630
2641
  }
2631
2642
  q[Me] = ct, N = N || ct !== Rt;
2632
2643
  }
2633
- return N ? q : D;
2644
+ return N ? q : U;
2634
2645
  };
2635
- }(P({}, k, e)), W, $(_(Ai.apply(void 0, j))));
2646
+ }(P({}, k, e)), W, C(_(Ai.apply(void 0, j))));
2636
2647
  x.dispatch = (R = x.dispatch, function(m, g, O) {
2637
- var C = P({}, m, { meta: wn(m.meta, g, gt(O)) });
2638
- return R.apply(null, [C]);
2648
+ var A = P({}, m, { meta: wn(m.meta, g, gt(O)) });
2649
+ return R.apply(null, [A]);
2639
2650
  });
2640
2651
  var K = Object.keys(a);
2641
2652
  x.dispatch({ type: T.bootstrap, plugins: K, config: L, params: y, user: E, initialUser: n, persistedUser: S });
@@ -2645,8 +2656,8 @@ function eo(t) {
2645
2656
  return !r.pluginEnabled[m];
2646
2657
  });
2647
2658
  return x.dispatch({ type: T.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, g) {
2648
- var O = m.bootstrap, C = m.config, A = m.name;
2649
- O && G(O) && O({ instance: b, config: C, payload: m }), x.dispatch({ type: T.registerPluginType(A), name: A, enabled: r.pluginEnabled[A], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: T.initializeStart, plugins: J, disabled: Ce });
2659
+ var O = m.bootstrap, A = m.config, $ = m.name;
2660
+ O && G(O) && O({ instance: b, config: A, payload: m }), x.dispatch({ type: T.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: T.initializeStart, plugins: J, disabled: Ce });
2650
2661
  }), Qi(function(m) {
2651
2662
  x.dispatch({ type: m ? T.offline : T.online });
2652
2663
  }), function(m, g, O) {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "registry": "https://registry.npmjs.org/",
7
7
  "tag": "latest"
8
8
  },
9
- "version": "1.4.0",
9
+ "version": "1.4.2",
10
10
  "main": "dist/sesamy-js.cjs",
11
11
  "module": "dist/sesamy-js.mjs",
12
12
  "types": "dist/sesamy-js.d.ts",