@clicktap/state 0.12.11 → 0.12.12

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.
Files changed (3) hide show
  1. package/index.js +5 -5
  2. package/index.mjs +252 -251
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as Ee } from "react/jsx-runtime";
2
- import { createContext as we, useContext as _e, useState as ln, useEffect as dn, cloneElement as hn } from "react";
1
+ import { jsx as Se } from "react/jsx-runtime";
2
+ import { createContext as Ee, useContext as we, useState as ln, useEffect as dn, cloneElement as hn } from "react";
3
3
  function pn() {
4
4
  if (typeof globalThis < "u")
5
5
  return globalThis;
@@ -21,7 +21,7 @@ const mn = (t) => {
21
21
  const e = yn();
22
22
  e && e.register(t);
23
23
  };
24
- class Wt {
24
+ class qt {
25
25
  constructor(e) {
26
26
  this._process = e, this._active = !1, this._current = null, this._last = null;
27
27
  }
@@ -50,7 +50,7 @@ class Wt {
50
50
  this._last = null;
51
51
  }
52
52
  }
53
- const Te = ".", gn = "", ve = "", Sn = "#", En = "*", be = "xstate.init", wn = "xstate.error", W = "xstate.stop";
53
+ const _e = ".", gn = "", Te = "", Sn = "#", En = "*", ve = "xstate.init", wn = "xstate.error", W = "xstate.stop";
54
54
  function _n(t, e) {
55
55
  return {
56
56
  type: `xstate.after.${t}.${e}`
@@ -68,15 +68,15 @@ function Tn(t, e) {
68
68
  output: e
69
69
  };
70
70
  }
71
- function Ae(t, e) {
71
+ function be(t, e) {
72
72
  return {
73
73
  type: `xstate.error.actor.${t}`,
74
74
  error: e
75
75
  };
76
76
  }
77
- function xe(t) {
77
+ function Ae(t) {
78
78
  return {
79
- type: be,
79
+ type: ve,
80
80
  input: t
81
81
  };
82
82
  }
@@ -86,7 +86,7 @@ function x(t) {
86
86
  });
87
87
  }
88
88
  const vn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
89
- function Kt(t, e) {
89
+ function Wt(t, e) {
90
90
  return `${t.sessionId}.${e}`;
91
91
  }
92
92
  let bn = 0;
@@ -100,7 +100,7 @@ function An(t, e) {
100
100
  delay: h,
101
101
  id: m,
102
102
  startedAt: Date.now()
103
- }, E = Kt(f, m);
103
+ }, E = Wt(f, m);
104
104
  l._snapshot._scheduledEvents[E] = S;
105
105
  const O = a.setTimeout(() => {
106
106
  delete o[E], delete l._snapshot._scheduledEvents[E], l._relay(f, p, y);
@@ -108,7 +108,7 @@ function An(t, e) {
108
108
  o[E] = O;
109
109
  },
110
110
  cancel: (f, p) => {
111
- const y = Kt(f, p), h = o[y];
111
+ const y = Wt(f, p), h = o[y];
112
112
  delete o[y], delete l._snapshot._scheduledEvents[y], a.clearTimeout(h);
113
113
  },
114
114
  cancelAll: (f) => {
@@ -181,12 +181,12 @@ function An(t, e) {
181
181
  };
182
182
  return l;
183
183
  }
184
- function Re(t, e) {
185
- const n = Vt(t), s = Vt(e);
186
- return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? Re(n[r], s[r]) : !1);
184
+ function xe(t, e) {
185
+ const n = Kt(t), s = Kt(e);
186
+ return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? xe(n[r], s[r]) : !1);
187
187
  }
188
- function kt(t) {
189
- if (ke(t))
188
+ function Ot(t) {
189
+ if (Oe(t))
190
190
  return t;
191
191
  let e = [], n = "";
192
192
  for (let s = 0; s < t.length; s++) {
@@ -202,12 +202,12 @@ function kt(t) {
202
202
  }
203
203
  return e.push(n), e;
204
204
  }
205
- function Vt(t) {
205
+ function Kt(t) {
206
206
  if (ns(t))
207
207
  return t.value;
208
208
  if (typeof t != "string")
209
209
  return t;
210
- const e = kt(t);
210
+ const e = Ot(t);
211
211
  return xn(e);
212
212
  }
213
213
  function xn(t) {
@@ -224,7 +224,7 @@ function xn(t) {
224
224
  }
225
225
  return e;
226
226
  }
227
- function Gt(t, e) {
227
+ function Vt(t, e) {
228
228
  const n = {}, s = Object.keys(t);
229
229
  for (let r = 0; r < s.length; r++) {
230
230
  const i = s[r];
@@ -232,11 +232,11 @@ function Gt(t, e) {
232
232
  }
233
233
  return n;
234
234
  }
235
- function Oe(t) {
236
- return ke(t) ? t : [t];
235
+ function Re(t) {
236
+ return Oe(t) ? t : [t];
237
237
  }
238
238
  function I(t) {
239
- return t === void 0 ? [] : Oe(t);
239
+ return t === void 0 ? [] : Re(t);
240
240
  }
241
241
  function _t(t, e, n, s) {
242
242
  return typeof t == "function" ? t({
@@ -245,22 +245,22 @@ function _t(t, e, n, s) {
245
245
  self: s
246
246
  }) : t;
247
247
  }
248
- function ke(t) {
248
+ function Oe(t) {
249
249
  return Array.isArray(t);
250
250
  }
251
251
  function Rn(t) {
252
252
  return t.type.startsWith("xstate.error.actor");
253
253
  }
254
254
  function N(t) {
255
- return Oe(t).map((e) => typeof e > "u" || typeof e == "string" ? {
255
+ return Re(t).map((e) => typeof e > "u" || typeof e == "string" ? {
256
256
  target: e
257
257
  } : e);
258
258
  }
259
- function Ie(t) {
259
+ function ke(t) {
260
260
  if (!(t === void 0 || t === gn))
261
261
  return I(t);
262
262
  }
263
- function Xt(t, e, n) {
263
+ function Gt(t, e, n) {
264
264
  var i, o, a;
265
265
  const s = typeof t == "object", r = s ? t : void 0;
266
266
  return {
@@ -269,17 +269,17 @@ function Xt(t, e, n) {
269
269
  complete: (a = s ? t.complete : n) == null ? void 0 : a.bind(r)
270
270
  };
271
271
  }
272
- function Yt(t, e) {
272
+ function Xt(t, e) {
273
273
  return `${e}.${t}`;
274
274
  }
275
- function It(t, e) {
275
+ function kt(t, e) {
276
276
  const n = e.match(/^xstate\.invoke\.(\d+)\.(.*)/);
277
277
  if (!n)
278
278
  return t.implementations.actors[e];
279
279
  const [, s, r] = n, o = t.getStateNodeById(r).config.invoke;
280
280
  return (Array.isArray(o) ? o[s] : o).src;
281
281
  }
282
- const Ct = 1;
282
+ const It = 1;
283
283
  let _ = /* @__PURE__ */ function(t) {
284
284
  return t[t.NotStarted = 0] = "NotStarted", t[t.Running = 1] = "Running", t[t.Stopped = 2] = "Stopped", t;
285
285
  }({});
@@ -299,7 +299,7 @@ class kn {
299
299
  * @param options Actor options
300
300
  */
301
301
  constructor(e, n) {
302
- this.logic = e, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new Wt(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = _.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
302
+ this.logic = e, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new qt(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = _.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
303
303
  const s = {
304
304
  ...On,
305
305
  ...n
@@ -314,7 +314,7 @@ class kn {
314
314
  } = s;
315
315
  this.system = o ? o.system : An(this, {
316
316
  clock: r
317
- }), l && !o && this.system.inspect(Xt(l)), this.sessionId = this.system._bookId(), this.id = u ?? this.sessionId, this.logger = i, this.clock = r, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? e, this.ref = this, this._actorScope = {
317
+ }), l && !o && this.system.inspect(Gt(l)), this.sessionId = this.system._bookId(), this.id = u ?? this.sessionId, this.logger = i, this.clock = r, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? e, this.ref = this, this._actorScope = {
318
318
  self: this,
319
319
  id: this.id,
320
320
  sessionId: this.sessionId,
@@ -444,7 +444,7 @@ class kn {
444
444
  */
445
445
  subscribe(e, n, s) {
446
446
  var i;
447
- const r = Xt(e, n, s);
447
+ const r = Gt(e, n, s);
448
448
  if (this._processingStatus !== _.Stopped)
449
449
  this.observers.add(r);
450
450
  else
@@ -501,7 +501,7 @@ class kn {
501
501
  error: () => {
502
502
  }
503
503
  }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = _.Running;
504
- const e = xe(this.options.input);
504
+ const e = Ae(this.options.input);
505
505
  switch (this.system._sendInspectionEvent({
506
506
  type: "@xstate.event",
507
507
  sourceRef: this._parent,
@@ -588,7 +588,7 @@ class kn {
588
588
  this.observers.clear(), n && x(e);
589
589
  }
590
590
  _error(e) {
591
- this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent, Ae(this.id, e));
591
+ this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent, be(this.id, e));
592
592
  }
593
593
  // TODO: atm children don't belong entirely to the actor so
594
594
  // in a way - it's not even super aware of them
@@ -596,7 +596,7 @@ class kn {
596
596
  // right now, they are being stopped within the machine's transition
597
597
  // but that could throw and leave us with "orphaned" active actors
598
598
  _stopProcedure() {
599
- return this._processingStatus !== _.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new Wt(this._process.bind(this)), this._processingStatus = _.Stopped, this.system._unregister(this), this);
599
+ return this._processingStatus !== _.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new qt(this._process.bind(this)), this._processingStatus = _.Stopped, this.system._unregister(this), this);
600
600
  }
601
601
  /**
602
602
  * @internal
@@ -620,7 +620,7 @@ class kn {
620
620
  }
621
621
  toJSON() {
622
622
  return {
623
- xstate$$type: Ct,
623
+ xstate$$type: It,
624
624
  id: this.id
625
625
  };
626
626
  }
@@ -686,7 +686,7 @@ function Dn(t, e, n, s, {
686
686
  input: a,
687
687
  syncSnapshot: u
688
688
  }) {
689
- const c = typeof o == "string" ? It(e.machine, o) : o, l = typeof r == "function" ? r(n) : r;
689
+ const c = typeof o == "string" ? kt(e.machine, o) : o, l = typeof r == "function" ? r(n) : r;
690
690
  let f;
691
691
  return c && (f = $(c, {
692
692
  id: l,
@@ -749,19 +749,19 @@ function jn(t, e) {
749
749
  });
750
750
  }
751
751
  }
752
- function Ce(t) {
752
+ function Ie(t) {
753
753
  function e(n, s) {
754
754
  }
755
755
  return e.type = "xstate.stopChild", e.actorRef = t, e.resolve = Nn, e.execute = jn, e;
756
756
  }
757
- function Pt(t, e, n, s) {
757
+ function Ct(t, e, n, s) {
758
758
  const {
759
759
  machine: r
760
760
  } = s, i = typeof t == "function", o = i ? t : r.implementations.guards[typeof t == "string" ? t : t.type];
761
761
  if (!i && !o)
762
762
  throw new Error(`Guard '${typeof t == "string" ? t : t.type}' is not implemented.'.`);
763
763
  if (typeof o != "function")
764
- return Pt(o, e, n, s);
764
+ return Ct(o, e, n, s);
765
765
  const a = {
766
766
  context: e,
767
767
  event: n
@@ -776,7 +776,7 @@ function Pt(t, e, n, s) {
776
776
  // this holds all params
777
777
  ) : o(a, u);
778
778
  }
779
- const Dt = (t) => t.type === "atomic" || t.type === "final";
779
+ const Pt = (t) => t.type === "atomic" || t.type === "final";
780
780
  function L(t) {
781
781
  return Object.values(t.states).filter((e) => e.type !== "history");
782
782
  }
@@ -790,14 +790,14 @@ function V(t, e) {
790
790
  return n;
791
791
  }
792
792
  function st(t) {
793
- const e = new Set(t), n = De(e);
793
+ const e = new Set(t), n = Pe(e);
794
794
  for (const s of e)
795
795
  if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
796
- Zt(s).forEach((r) => e.add(r));
796
+ Yt(s).forEach((r) => e.add(r));
797
797
  else if (s.type === "parallel") {
798
798
  for (const r of L(s))
799
799
  if (r.type !== "history" && !e.has(r)) {
800
- const i = Zt(r);
800
+ const i = Yt(r);
801
801
  for (const o of i)
802
802
  e.add(o);
803
803
  }
@@ -809,35 +809,35 @@ function st(t) {
809
809
  }
810
810
  return e;
811
811
  }
812
- function Pe(t, e) {
812
+ function Ce(t, e) {
813
813
  const n = e.get(t);
814
814
  if (!n)
815
815
  return {};
816
816
  if (t.type === "compound") {
817
817
  const r = n[0];
818
818
  if (r) {
819
- if (Dt(r))
819
+ if (Pt(r))
820
820
  return r.key;
821
821
  } else
822
822
  return {};
823
823
  }
824
824
  const s = {};
825
825
  for (const r of n)
826
- s[r.key] = Pe(r, e);
826
+ s[r.key] = Ce(r, e);
827
827
  return s;
828
828
  }
829
- function De(t) {
829
+ function Pe(t) {
830
830
  const e = /* @__PURE__ */ new Map();
831
831
  for (const n of t)
832
832
  e.has(n) || e.set(n, []), n.parent && (e.has(n.parent) || e.set(n.parent, []), e.get(n.parent).push(n));
833
833
  return e;
834
834
  }
835
- function Me(t, e) {
835
+ function De(t, e) {
836
836
  const n = st(e);
837
- return Pe(t, De(n));
837
+ return Ce(t, Pe(n));
838
838
  }
839
- function Mt(t, e) {
840
- return e.type === "compound" ? L(e).some((n) => n.type === "final" && t.has(n)) : e.type === "parallel" ? L(e).every((n) => Mt(t, n)) : e.type === "final";
839
+ function Dt(t, e) {
840
+ return e.type === "compound" ? L(e).some((n) => n.type === "final" && t.has(n)) : e.type === "parallel" ? L(e).every((n) => Dt(t, n)) : e.type === "final";
841
841
  }
842
842
  const at = (t) => t[0] === Sn;
843
843
  function $n(t, e) {
@@ -888,7 +888,7 @@ function Ln(t) {
888
888
  });
889
889
  }
890
890
  function P(t, e, n) {
891
- const s = Ie(n.target), r = n.reenter ?? !1, i = Hn(t, s), o = {
891
+ const s = ke(n.target), r = n.reenter ?? !1, i = Hn(t, s), o = {
892
892
  ...n,
893
893
  actions: I(n.actions),
894
894
  guard: n.guard,
@@ -908,7 +908,7 @@ function Bn(t) {
908
908
  const e = /* @__PURE__ */ new Map();
909
909
  if (t.config.on)
910
910
  for (const n of Object.keys(t.config.on)) {
911
- if (n === ve)
911
+ if (n === Te)
912
912
  throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
913
913
  const s = t.config.on[n];
914
914
  e.set(n, N(s).map((r) => P(t, n, r)));
@@ -962,7 +962,7 @@ function Hn(t, e) {
962
962
  return n;
963
963
  if (at(n))
964
964
  return t.machine.getStateNodeById(n);
965
- const s = n[0] === Te;
965
+ const s = n[0] === _e;
966
966
  if (s && !t.parent)
967
967
  return rt(t, n.slice(1));
968
968
  const r = s ? t.key + n : n;
@@ -977,8 +977,8 @@ ${i.message}`);
977
977
  throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`);
978
978
  });
979
979
  }
980
- function Ue(t) {
981
- const e = Ie(t.config.target);
980
+ function Me(t) {
981
+ const e = ke(t.config.target);
982
982
  return e ? {
983
983
  target: e.map((n) => typeof n == "string" ? rt(t.parent, n) : n)
984
984
  } : t.parent.initial;
@@ -986,14 +986,14 @@ function Ue(t) {
986
986
  function D(t) {
987
987
  return t.type === "history";
988
988
  }
989
- function Zt(t) {
990
- const e = Ne(t);
989
+ function Yt(t) {
990
+ const e = Ue(t);
991
991
  for (const n of e)
992
992
  for (const s of V(n, t))
993
993
  e.add(s);
994
994
  return e;
995
995
  }
996
- function Ne(t) {
996
+ function Ue(t) {
997
997
  const e = /* @__PURE__ */ new Set();
998
998
  function n(s) {
999
999
  if (!e.has(s)) {
@@ -1022,7 +1022,7 @@ function rt(t, e) {
1022
1022
  return t.machine.getStateNodeById(e);
1023
1023
  } catch {
1024
1024
  }
1025
- const n = kt(e).slice();
1025
+ const n = Ot(e).slice();
1026
1026
  let s = t;
1027
1027
  for (; n.length; ) {
1028
1028
  const r = n.shift();
@@ -1053,7 +1053,7 @@ function zn(t, e, n, s) {
1053
1053
  return !i || !i.length ? t.next(n, s) : i;
1054
1054
  }
1055
1055
  function Jn(t, e, n, s) {
1056
- const r = Object.keys(e), i = B(t, r[0]), o = Ut(i, e[r[0]], n, s);
1056
+ const r = Object.keys(e), i = B(t, r[0]), o = Mt(i, e[r[0]], n, s);
1057
1057
  return !o || !o.length ? t.next(n, s) : o;
1058
1058
  }
1059
1059
  function qn(t, e, n, s) {
@@ -1062,12 +1062,12 @@ function qn(t, e, n, s) {
1062
1062
  const o = e[i];
1063
1063
  if (!o)
1064
1064
  continue;
1065
- const a = B(t, i), u = Ut(a, o, n, s);
1065
+ const a = B(t, i), u = Mt(a, o, n, s);
1066
1066
  u && r.push(...u);
1067
1067
  }
1068
1068
  return r.length ? r : t.next(n, s);
1069
1069
  }
1070
- function Ut(t, e, n, s) {
1070
+ function Mt(t, e, n, s) {
1071
1071
  return typeof e == "string" ? zn(t, e, n, s) : Object.keys(e).length === 1 ? Jn(t, e, n, s) : qn(t, e, n, s);
1072
1072
  }
1073
1073
  function Wn(t) {
@@ -1089,7 +1089,7 @@ function Kn(t, e) {
1089
1089
  return !0;
1090
1090
  return !1;
1091
1091
  }
1092
- function je(t, e, n) {
1092
+ function Ne(t, e, n) {
1093
1093
  const s = /* @__PURE__ */ new Set();
1094
1094
  for (const r of t) {
1095
1095
  let i = !1;
@@ -1116,7 +1116,7 @@ function Vn(t) {
1116
1116
  if (n.every((r) => C(r, s)))
1117
1117
  return s;
1118
1118
  }
1119
- function Nt(t, e) {
1119
+ function Ut(t, e) {
1120
1120
  if (!t.target)
1121
1121
  return [];
1122
1122
  const n = /* @__PURE__ */ new Set();
@@ -1126,14 +1126,14 @@ function Nt(t, e) {
1126
1126
  for (const r of e[s.id])
1127
1127
  n.add(r);
1128
1128
  else
1129
- for (const r of Nt(Ue(s), e))
1129
+ for (const r of Ut(Me(s), e))
1130
1130
  n.add(r);
1131
1131
  else
1132
1132
  n.add(s);
1133
1133
  return [...n];
1134
1134
  }
1135
- function $e(t, e) {
1136
- const n = Nt(t, e);
1135
+ function je(t, e) {
1136
+ const n = Ut(t, e);
1137
1137
  if (!n)
1138
1138
  return;
1139
1139
  if (!t.reenter && n.every((r) => r === t.source || C(r, t.source)))
@@ -1149,7 +1149,7 @@ function Tt(t, e, n) {
1149
1149
  const s = /* @__PURE__ */ new Set();
1150
1150
  for (const i of t)
1151
1151
  if ((r = i.target) != null && r.length) {
1152
- const o = $e(i, n);
1152
+ const o = je(i, n);
1153
1153
  i.reenter && i.source === o && s.add(o);
1154
1154
  for (const a of e)
1155
1155
  C(a, o) && s.add(a);
@@ -1169,7 +1169,7 @@ function vt(t, e, n, s, r, i) {
1169
1169
  return e;
1170
1170
  const o = new Set(e._nodes);
1171
1171
  let a = e.historyValue;
1172
- const u = je(t, o, a);
1172
+ const u = Ne(t, o, a);
1173
1173
  let c = e;
1174
1174
  r || ([c, a] = Qn(c, s, n, u, o, a, i)), c = F(c, s, n, u.flatMap((f) => f.actions), i), c = Yn(c, s, n, u, o, i, a, r);
1175
1175
  const l = [...o];
@@ -1210,7 +1210,7 @@ function Yn(t, e, n, s, r, i, o, a) {
1210
1210
  if (u = F(u, e, n, y, i, p.invoke.map((h) => h.id)), p.type === "final") {
1211
1211
  const h = p.parent;
1212
1212
  let m = (h == null ? void 0 : h.type) === "parallel" ? h : h == null ? void 0 : h.parent, S = m || p;
1213
- for ((h == null ? void 0 : h.type) === "compound" && i.push(wt(h.id, p.output !== void 0 ? _t(p.output, u.context, e, n.self) : void 0)); (m == null ? void 0 : m.type) === "parallel" && !f.has(m) && Mt(r, m); )
1213
+ for ((h == null ? void 0 : h.type) === "compound" && i.push(wt(h.id, p.output !== void 0 ? _t(p.output, u.context, e, n.self) : void 0)); (m == null ? void 0 : m.type) === "parallel" && !f.has(m) && Dt(r, m); )
1214
1214
  f.add(m), i.push(wt(m.id)), S = m, m = m.parent;
1215
1215
  if (m)
1216
1216
  continue;
@@ -1224,17 +1224,17 @@ function Yn(t, e, n, s, r, i, o, a) {
1224
1224
  }
1225
1225
  function Zn(t, e, n, s) {
1226
1226
  for (const r of t) {
1227
- const i = $e(r, e);
1227
+ const i = je(r, e);
1228
1228
  for (const a of r.target || [])
1229
1229
  !D(a) && // if the target is different than the source then it will *definitely* be entered
1230
1230
  (r.source !== a || // we know that the domain can't lie within the source
1231
1231
  // if it's different than the source then it's outside of it and it means that the target has to be entered as well
1232
1232
  r.source !== i || // reentering transitions always enter the target, even if it's the source itself
1233
1233
  r.reenter) && (s.add(a), n.add(a)), j(a, e, n, s);
1234
- const o = Nt(r, e);
1234
+ const o = Ut(r, e);
1235
1235
  for (const a of o) {
1236
1236
  const u = V(a, i);
1237
- (i == null ? void 0 : i.type) === "parallel" && u.push(i), Le(s, e, n, u, !r.source.parent && r.reenter ? void 0 : i);
1237
+ (i == null ? void 0 : i.type) === "parallel" && u.push(i), $e(s, e, n, u, !r.source.parent && r.reenter ? void 0 : i);
1238
1238
  }
1239
1239
  }
1240
1240
  }
@@ -1248,7 +1248,7 @@ function j(t, e, n, s) {
1248
1248
  for (const o of i)
1249
1249
  ht(o, t.parent, s, e, n);
1250
1250
  } else {
1251
- const i = Ue(t);
1251
+ const i = Me(t);
1252
1252
  for (const o of i.target)
1253
1253
  s.add(o), i === ((r = t.parent) == null ? void 0 : r.initial) && n.add(t.parent), j(o, e, n, s);
1254
1254
  for (const o of i.target)
@@ -1261,14 +1261,14 @@ function j(t, e, n, s) {
1261
1261
  for (const i of L(t).filter((o) => !D(o)))
1262
1262
  [...s].some((o) => C(o, i)) || (D(i) || (s.add(i), n.add(i)), j(i, e, n, s));
1263
1263
  }
1264
- function Le(t, e, n, s, r) {
1264
+ function $e(t, e, n, s, r) {
1265
1265
  for (const i of s)
1266
1266
  if ((!r || C(i, r)) && t.add(i), i.type === "parallel")
1267
1267
  for (const o of L(i).filter((a) => !D(a)))
1268
1268
  [...t].some((a) => C(a, o)) || (t.add(o), j(o, e, n, t));
1269
1269
  }
1270
1270
  function ht(t, e, n, s, r) {
1271
- Le(n, s, r, V(t, e));
1271
+ $e(n, s, r, V(t, e));
1272
1272
  }
1273
1273
  function Qn(t, e, n, s, r, i, o) {
1274
1274
  let a = t;
@@ -1278,15 +1278,15 @@ function Qn(t, e, n, s, r, i, o) {
1278
1278
  for (const l of u)
1279
1279
  for (const f of Wn(l)) {
1280
1280
  let p;
1281
- f.history === "deep" ? p = (y) => Dt(y) && C(y, l) : p = (y) => y.parent === l, c ?? (c = {
1281
+ f.history === "deep" ? p = (y) => Pt(y) && C(y, l) : p = (y) => y.parent === l, c ?? (c = {
1282
1282
  ...i
1283
1283
  }), c[f.id] = Array.from(r).filter(p);
1284
1284
  }
1285
1285
  for (const l of u)
1286
- a = F(a, e, n, [...l.exit, ...l.invoke.map((f) => Ce(f.id))], o), r.delete(l);
1286
+ a = F(a, e, n, [...l.exit, ...l.invoke.map((f) => Ie(f.id))], o), r.delete(l);
1287
1287
  return [a, c || i];
1288
1288
  }
1289
- function Be(t, e, n, s, r, i) {
1289
+ function Le(t, e, n, s, r, i) {
1290
1290
  const {
1291
1291
  machine: o
1292
1292
  } = t;
@@ -1334,12 +1334,12 @@ function Be(t, e, n, s, r, i) {
1334
1334
  // this holds all params
1335
1335
  r
1336
1336
  );
1337
- a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a = Be(a, e, n, E, r, i));
1337
+ a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a = Le(a, e, n, E, r, i));
1338
1338
  }
1339
1339
  return a;
1340
1340
  }
1341
1341
  function F(t, e, n, s, r, i) {
1342
- const o = i ? [] : void 0, a = Be(t, e, n, s, {
1342
+ const o = i ? [] : void 0, a = Le(t, e, n, s, {
1343
1343
  internalQueue: r,
1344
1344
  deferredActorIds: i
1345
1345
  }, o);
@@ -1360,15 +1360,15 @@ function pt(t, e, n, s = []) {
1360
1360
  }), i.push(c);
1361
1361
  }
1362
1362
  if (e.type === W)
1363
- return r = M(Qt(r, e, n), {
1363
+ return r = M(Zt(r, e, n), {
1364
1364
  status: "stopped"
1365
1365
  }), o(r, e, []), {
1366
1366
  snapshot: r,
1367
1367
  microstates: i
1368
1368
  };
1369
1369
  let a = e;
1370
- if (a.type !== be) {
1371
- const c = a, l = Rn(c), f = te(c, r);
1370
+ if (a.type !== ve) {
1371
+ const c = a, l = Rn(c), f = Qt(c, r);
1372
1372
  if (l && !f.length)
1373
1373
  return r = M(t, {
1374
1374
  status: "error",
@@ -1394,44 +1394,44 @@ function pt(t, e, n, s = []) {
1394
1394
  if (!c.length) {
1395
1395
  if (!s.length)
1396
1396
  break;
1397
- a = s.shift(), c = te(a, r);
1397
+ a = s.shift(), c = Qt(a, r);
1398
1398
  }
1399
1399
  r = vt(c, r, n, a, !1, s), u = r !== l, o(r, a, c);
1400
1400
  }
1401
- return r.status !== "active" && Qt(r, a, n), {
1401
+ return r.status !== "active" && Zt(r, a, n), {
1402
1402
  snapshot: r,
1403
1403
  microstates: i
1404
1404
  };
1405
1405
  }
1406
- function Qt(t, e, n) {
1407
- return F(t, e, n, Object.values(t.children).map((s) => Ce(s)), []);
1406
+ function Zt(t, e, n) {
1407
+ return F(t, e, n, Object.values(t.children).map((s) => Ie(s)), []);
1408
1408
  }
1409
- function te(t, e) {
1409
+ function Qt(t, e) {
1410
1410
  return e.machine.getTransitionData(e, t);
1411
1411
  }
1412
1412
  function ts(t, e) {
1413
- const n = /* @__PURE__ */ new Set(), s = t._nodes.filter(Dt);
1413
+ const n = /* @__PURE__ */ new Set(), s = t._nodes.filter(Pt);
1414
1414
  for (const r of s)
1415
1415
  t:
1416
1416
  for (const i of [r].concat(V(r, void 0)))
1417
1417
  if (i.always) {
1418
1418
  for (const o of i.always)
1419
- if (o.guard === void 0 || Pt(o.guard, t.context, e, t)) {
1419
+ if (o.guard === void 0 || Ct(o.guard, t.context, e, t)) {
1420
1420
  n.add(o);
1421
1421
  break t;
1422
1422
  }
1423
1423
  }
1424
- return je(Array.from(n), new Set(t._nodes), t.historyValue);
1424
+ return Ne(Array.from(n), new Set(t._nodes), t.historyValue);
1425
1425
  }
1426
1426
  function es(t, e) {
1427
1427
  const n = st(it(t, e));
1428
- return Me(t, [...n]);
1428
+ return De(t, [...n]);
1429
1429
  }
1430
1430
  function ns(t) {
1431
1431
  return !!t && typeof t == "object" && "machine" in t && "value" in t;
1432
1432
  }
1433
1433
  const ss = function(e) {
1434
- return Re(e, this.value);
1434
+ return xe(e, this.value);
1435
1435
  }, rs = function(e) {
1436
1436
  return this.tags.has(e);
1437
1437
  }, is = function(e) {
@@ -1465,7 +1465,7 @@ function Z(t, e) {
1465
1465
  machine: e,
1466
1466
  context: t.context,
1467
1467
  _nodes: t._nodes,
1468
- value: Me(e.root, t._nodes),
1468
+ value: De(e.root, t._nodes),
1469
1469
  tags: new Set(t._nodes.flatMap((n) => n.tags)),
1470
1470
  children: t.children,
1471
1471
  historyValue: t.historyValue || {},
@@ -1507,11 +1507,11 @@ function cs(t, e) {
1507
1507
  }
1508
1508
  return {
1509
1509
  ...p,
1510
- context: Fe(o),
1510
+ context: Be(o),
1511
1511
  children: y
1512
1512
  };
1513
1513
  }
1514
- function Fe(t) {
1514
+ function Be(t) {
1515
1515
  let e;
1516
1516
  for (const n in t) {
1517
1517
  const s = t[n];
@@ -1520,11 +1520,11 @@ function Fe(t) {
1520
1520
  e ?? (e = Array.isArray(t) ? t.slice() : {
1521
1521
  ...t
1522
1522
  }), e[n] = {
1523
- xstate$$type: Ct,
1523
+ xstate$$type: It,
1524
1524
  id: s.id
1525
1525
  };
1526
1526
  else {
1527
- const r = Fe(s);
1527
+ const r = Be(s);
1528
1528
  r !== s && (e ?? (e = Array.isArray(t) ? t.slice() : {
1529
1529
  ...t
1530
1530
  }), e[n] = r);
@@ -1574,7 +1574,7 @@ function ls(t, e) {
1574
1574
  }
1575
1575
  return n.type = "xstate.raise", n.event = t, n.id = e == null ? void 0 : e.id, n.delay = e == null ? void 0 : e.delay, n.resolve = us, n.execute = fs, n;
1576
1576
  }
1577
- const ee = /* @__PURE__ */ new WeakMap();
1577
+ const te = /* @__PURE__ */ new WeakMap();
1578
1578
  function ds(t) {
1579
1579
  return {
1580
1580
  config: t,
@@ -1586,7 +1586,7 @@ function ds(t) {
1586
1586
  receivers: void 0,
1587
1587
  dispose: void 0
1588
1588
  };
1589
- ee.set(r, o), o.dispose = t({
1589
+ te.set(r, o), o.dispose = t({
1590
1590
  input: n.input,
1591
1591
  system: i,
1592
1592
  self: r,
@@ -1600,7 +1600,7 @@ function ds(t) {
1600
1600
  },
1601
1601
  transition: (n, s, r) => {
1602
1602
  var o, a;
1603
- const i = ee.get(r.self);
1603
+ const i = te.get(r.self);
1604
1604
  return s.type === W ? (n = {
1605
1605
  ...n,
1606
1606
  status: "stopped",
@@ -1617,7 +1617,7 @@ function ds(t) {
1617
1617
  restoreSnapshot: (n) => n
1618
1618
  };
1619
1619
  }
1620
- const ne = "xstate.promise.resolve", se = "xstate.promise.reject";
1620
+ const ee = "xstate.promise.resolve", ne = "xstate.promise.reject";
1621
1621
  function yt(t) {
1622
1622
  return {
1623
1623
  config: t,
@@ -1625,7 +1625,7 @@ function yt(t) {
1625
1625
  if (n.status !== "active")
1626
1626
  return n;
1627
1627
  switch (s.type) {
1628
- case ne: {
1628
+ case ee: {
1629
1629
  const r = s.data;
1630
1630
  return {
1631
1631
  ...n,
@@ -1634,7 +1634,7 @@ function yt(t) {
1634
1634
  input: void 0
1635
1635
  };
1636
1636
  }
1637
- case se:
1637
+ case ne:
1638
1638
  return {
1639
1639
  ...n,
1640
1640
  status: "error",
@@ -1663,12 +1663,12 @@ function yt(t) {
1663
1663
  self: s
1664
1664
  })).then((o) => {
1665
1665
  s.getSnapshot().status === "active" && r._relay(s, s, {
1666
- type: ne,
1666
+ type: ee,
1667
1667
  data: o
1668
1668
  });
1669
1669
  }, (o) => {
1670
1670
  s.getSnapshot().status === "active" && r._relay(s, s, {
1671
- type: se,
1671
+ type: ne,
1672
1672
  data: o
1673
1673
  });
1674
1674
  });
@@ -1693,7 +1693,7 @@ function hs(t, {
1693
1693
  input: c
1694
1694
  } = a;
1695
1695
  if (typeof o == "string") {
1696
- const l = It(e, o);
1696
+ const l = kt(e, o);
1697
1697
  if (!l)
1698
1698
  throw new Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);
1699
1699
  const f = $(l, {
@@ -1760,7 +1760,7 @@ function v(t) {
1760
1760
  }
1761
1761
  return e.type = "xstate.assign", e.assignment = t, e.resolve = ps, e;
1762
1762
  }
1763
- let re = /* @__PURE__ */ function(t) {
1763
+ let se = /* @__PURE__ */ function(t) {
1764
1764
  return t.Parent = "#_parent", t.Internal = "#_internal", t;
1765
1765
  }({});
1766
1766
  function ys(t, e, n, s, {
@@ -1783,7 +1783,7 @@ function ys(t, e, n, s, {
1783
1783
  const p = typeof r == "function" ? r(n, s) : r;
1784
1784
  let y;
1785
1785
  if (typeof p == "string") {
1786
- if (p === re.Parent ? y = t.self._parent : p === re.Internal ? y = t.self : p.startsWith("#_") ? y = e.children[p.slice(2)] : y = (h = u.deferredActorIds) != null && h.includes(p) ? p : e.children[p], !y)
1786
+ if (p === se.Parent ? y = t.self._parent : p === se.Internal ? y = t.self : p.startsWith("#_") ? y = e.children[p.slice(2)] : y = (h = u.deferredActorIds) != null && h.includes(p) ? p : e.children[p], !y)
1787
1787
  throw new Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`);
1788
1788
  } else
1789
1789
  y = p || t.self;
@@ -1814,21 +1814,21 @@ function gs(t, e) {
1814
1814
  // at this point, in a deferred task, it should already be mutated by retryResolveSendTo
1815
1815
  // if it initially started as a string
1816
1816
  n,
1817
- s.type === wn ? Ae(t.self.id, s.data) : s
1817
+ s.type === wn ? be(t.self.id, s.data) : s
1818
1818
  );
1819
1819
  });
1820
1820
  }
1821
- function ie(t, e, n) {
1821
+ function re(t, e, n) {
1822
1822
  function s(r, i) {
1823
1823
  }
1824
1824
  return s.type = "xsnapshot.sendTo", s.to = t, s.event = e, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = ys, s.retryResolve = ms, s.execute = gs, s;
1825
1825
  }
1826
- const oe = /* @__PURE__ */ new WeakMap();
1826
+ const ie = /* @__PURE__ */ new WeakMap();
1827
1827
  function U(t, e, n) {
1828
- let s = oe.get(t);
1828
+ let s = ie.get(t);
1829
1829
  return s ? e in s || (s[e] = n()) : (s = {
1830
1830
  [e]: n()
1831
- }, oe.set(t, s)), s[e];
1831
+ }, ie.set(t, s)), s[e];
1832
1832
  }
1833
1833
  const Ss = {}, J = (t) => typeof t == "string" ? {
1834
1834
  type: t
@@ -1837,9 +1837,9 @@ const Ss = {}, J = (t) => typeof t == "string" ? {
1837
1837
  } : {
1838
1838
  type: t.name
1839
1839
  } : t;
1840
- class jt {
1840
+ class Nt {
1841
1841
  constructor(e, n) {
1842
- if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Te), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Gt(this.config.states, (s, r) => new jt(s, {
1842
+ if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(_e), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Vt(this.config.states, (s, r) => new Nt(s, {
1843
1843
  _parent: this,
1844
1844
  _key: r,
1845
1845
  _machine: this.machine
@@ -1849,7 +1849,7 @@ class jt {
1849
1849
  }
1850
1850
  /** @internal */
1851
1851
  _initialize() {
1852
- this.transitions = Bn(this), this.config.always && (this.always = N(this.config.always).map((e) => P(this, ve, e))), Object.keys(this.states).forEach((e) => {
1852
+ this.transitions = Bn(this), this.config.always && (this.always = N(this.config.always).map((e) => P(this, Te, e))), Object.keys(this.states).forEach((e) => {
1853
1853
  this.states[e]._initialize();
1854
1854
  });
1855
1855
  }
@@ -1876,7 +1876,7 @@ class jt {
1876
1876
  })
1877
1877
  } : void 0,
1878
1878
  history: this.history,
1879
- states: Gt(this.states, (e) => e.definition),
1879
+ states: Vt(this.states, (e) => e.definition),
1880
1880
  on: this.on,
1881
1881
  transitions: [...this.transitions.values()].flat().map((e) => ({
1882
1882
  ...e,
@@ -1904,7 +1904,7 @@ class jt {
1904
1904
  const {
1905
1905
  src: s,
1906
1906
  systemId: r
1907
- } = e, i = e.id ?? Yt(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${Yt(this.id, n)}`;
1907
+ } = e, i = e.id ?? Xt(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${Xt(this.id, n)}`;
1908
1908
  return {
1909
1909
  ...e,
1910
1910
  src: o,
@@ -1949,7 +1949,7 @@ class jt {
1949
1949
  } = a, c = e.context;
1950
1950
  let l = !1;
1951
1951
  try {
1952
- l = !u || Pt(u, c, n, e);
1952
+ l = !u || Ct(u, c, n, e);
1953
1953
  } catch (f) {
1954
1954
  const p = typeof u == "string" ? u : typeof u == "object" ? u.type : void 0;
1955
1955
  throw new Error(`Unable to evaluate guard ${p ? `'${p}' ` : ""}in transition for event '${s}' in state node '${this.id}':
@@ -1991,14 +1991,14 @@ ${f.message}`);
1991
1991
  }
1992
1992
  }
1993
1993
  const Es = "#";
1994
- class $t {
1994
+ class jt {
1995
1995
  constructor(e, n) {
1996
1996
  this.config = e, this.version = void 0, this.schemas = void 0, this.implementations = void 0, this.__xstatenode = !0, this.idMap = /* @__PURE__ */ new Map(), this.root = void 0, this.id = void 0, this.states = void 0, this.events = void 0, this.__TResolvedTypesMeta = void 0, this.id = e.id || "(machine)", this.implementations = {
1997
1997
  actors: (n == null ? void 0 : n.actors) ?? {},
1998
1998
  actions: (n == null ? void 0 : n.actions) ?? {},
1999
1999
  delays: (n == null ? void 0 : n.delays) ?? {},
2000
2000
  guards: (n == null ? void 0 : n.guards) ?? {}
2001
- }, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new jt(e, {
2001
+ }, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new Nt(e, {
2002
2002
  _key: this.id,
2003
2003
  _machine: this
2004
2004
  }), this.root._initialize(), this.states = this.root.states, this.events = this.root.events;
@@ -2019,7 +2019,7 @@ class $t {
2019
2019
  actors: r,
2020
2020
  delays: i
2021
2021
  } = this.implementations;
2022
- return new $t(this.config, {
2022
+ return new jt(this.config, {
2023
2023
  actions: {
2024
2024
  ...n,
2025
2025
  ...e.actions
@@ -2044,7 +2044,7 @@ class $t {
2044
2044
  _nodes: [...s],
2045
2045
  context: e.context || {},
2046
2046
  children: {},
2047
- status: Mt(s, this.root) ? "done" : e.status || "active",
2047
+ status: Dt(s, this.root) ? "done" : e.status || "active",
2048
2048
  output: e.output,
2049
2049
  error: e.error,
2050
2050
  historyValue: e.historyValue
@@ -2071,7 +2071,7 @@ class $t {
2071
2071
  return pt(e, n, s).microstates;
2072
2072
  }
2073
2073
  getTransitionData(e, n) {
2074
- return Ut(this.root, e.value, e, n) || [];
2074
+ return Mt(this.root, e.value, e, n) || [];
2075
2075
  }
2076
2076
  /**
2077
2077
  * The initial state _before_ evaluating any microsteps.
@@ -2100,8 +2100,8 @@ class $t {
2100
2100
  * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
2101
2101
  */
2102
2102
  getInitialSnapshot(e, n) {
2103
- const s = xe(n), r = [], i = this.getPreInitialState(e, s, r), o = vt([{
2104
- target: [...Ne(this.root)],
2103
+ const s = Ae(n), r = [], i = this.getPreInitialState(e, s, r), o = vt([{
2104
+ target: [...Ue(this.root)],
2105
2105
  source: this.root,
2106
2106
  reenter: !0,
2107
2107
  actions: [],
@@ -2119,7 +2119,7 @@ class $t {
2119
2119
  });
2120
2120
  }
2121
2121
  getStateNodeById(e) {
2122
- const n = kt(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(Es.length) : n[0], i = this.idMap.get(r);
2122
+ const n = Ot(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(Es.length) : n[0], i = this.idMap.get(r);
2123
2123
  if (!i)
2124
2124
  throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
2125
2125
  return rt(i, s);
@@ -2136,7 +2136,7 @@ class $t {
2136
2136
  restoreSnapshot(e, n) {
2137
2137
  const s = {}, r = e.children;
2138
2138
  Object.keys(r).forEach((u) => {
2139
- const c = r[u], l = c.snapshot, f = c.src, p = typeof f == "string" ? It(this, f) : f;
2139
+ const c = r[u], l = c.snapshot, f = c.src, p = typeof f == "string" ? kt(this, f) : f;
2140
2140
  if (!p)
2141
2141
  return;
2142
2142
  const y = $(p, {
@@ -2161,7 +2161,7 @@ class $t {
2161
2161
  for (let l in u) {
2162
2162
  const f = u[l];
2163
2163
  if (f && typeof f == "object") {
2164
- if ("xstate$$type" in f && f.xstate$$type === Ct) {
2164
+ if ("xstate$$type" in f && f.xstate$$type === It) {
2165
2165
  u[l] = c[f.id];
2166
2166
  continue;
2167
2167
  }
@@ -2174,9 +2174,9 @@ class $t {
2174
2174
  }
2175
2175
  }
2176
2176
  function ws(t, e) {
2177
- return new $t(t, e);
2177
+ return new jt(t, e);
2178
2178
  }
2179
- function Lt({
2179
+ function $t({
2180
2180
  schemas: t,
2181
2181
  actors: e,
2182
2182
  actions: n,
@@ -2195,27 +2195,27 @@ function Lt({
2195
2195
  })
2196
2196
  };
2197
2197
  }
2198
- function He(t, e) {
2198
+ function Fe(t, e) {
2199
2199
  return function() {
2200
2200
  return t.apply(e, arguments);
2201
2201
  };
2202
2202
  }
2203
- const { toString: _s } = Object.prototype, { getPrototypeOf: Bt } = Object, ct = ((t) => (e) => {
2203
+ const { toString: _s } = Object.prototype, { getPrototypeOf: Lt } = Object, ct = ((t) => (e) => {
2204
2204
  const n = _s.call(e);
2205
2205
  return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
2206
2206
  })(/* @__PURE__ */ Object.create(null)), A = (t) => (t = t.toLowerCase(), (e) => ct(e) === t), ut = (t) => (e) => typeof e === t, { isArray: z } = Array, K = ut("undefined");
2207
2207
  function Ts(t) {
2208
2208
  return t !== null && !K(t) && t.constructor !== null && !K(t.constructor) && T(t.constructor.isBuffer) && t.constructor.isBuffer(t);
2209
2209
  }
2210
- const ze = A("ArrayBuffer");
2210
+ const He = A("ArrayBuffer");
2211
2211
  function vs(t) {
2212
2212
  let e;
2213
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && ze(t.buffer), e;
2213
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && He(t.buffer), e;
2214
2214
  }
2215
- const bs = ut("string"), T = ut("function"), Je = ut("number"), ft = (t) => t !== null && typeof t == "object", As = (t) => t === !0 || t === !1, Q = (t) => {
2215
+ const bs = ut("string"), T = ut("function"), ze = ut("number"), ft = (t) => t !== null && typeof t == "object", As = (t) => t === !0 || t === !1, Q = (t) => {
2216
2216
  if (ct(t) !== "object")
2217
2217
  return !1;
2218
- const e = Bt(t);
2218
+ const e = Lt(t);
2219
2219
  return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
2220
2220
  }, xs = A("Date"), Rs = A("File"), Os = A("Blob"), ks = A("FileList"), Is = (t) => ft(t) && T(t.pipe), Cs = (t) => {
2221
2221
  let e;
@@ -2236,7 +2236,7 @@ function G(t, e, { allOwnKeys: n = !1 } = {}) {
2236
2236
  a = i[s], e.call(null, t[a], a, t);
2237
2237
  }
2238
2238
  }
2239
- function qe(t, e) {
2239
+ function Je(t, e) {
2240
2240
  e = e.toLowerCase();
2241
2241
  const n = Object.keys(t);
2242
2242
  let s = n.length, r;
@@ -2245,10 +2245,10 @@ function qe(t, e) {
2245
2245
  return r;
2246
2246
  return null;
2247
2247
  }
2248
- const We = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ke = (t) => !K(t) && t !== We;
2248
+ const qe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), We = (t) => !K(t) && t !== qe;
2249
2249
  function bt() {
2250
- const { caseless: t } = Ke(this) && this || {}, e = {}, n = (s, r) => {
2251
- const i = t && qe(e, r) || r;
2250
+ const { caseless: t } = We(this) && this || {}, e = {}, n = (s, r) => {
2251
+ const i = t && Je(e, r) || r;
2252
2252
  Q(e[i]) && Q(s) ? e[i] = bt(e[i], s) : Q(s) ? e[i] = bt({}, s) : z(s) ? e[i] = s.slice() : e[i] = s;
2253
2253
  };
2254
2254
  for (let s = 0, r = arguments.length; s < r; s++)
@@ -2256,7 +2256,7 @@ function bt() {
2256
2256
  return e;
2257
2257
  }
2258
2258
  const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2259
- n && T(r) ? t[i] = He(r, n) : t[i] = r;
2259
+ n && T(r) ? t[i] = Fe(r, n) : t[i] = r;
2260
2260
  }, { allOwnKeys: s }), t), Us = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ns = (t, e, n, s) => {
2261
2261
  t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
2262
2262
  value: e.prototype
@@ -2269,7 +2269,7 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2269
2269
  do {
2270
2270
  for (r = Object.getOwnPropertyNames(t), i = r.length; i-- > 0; )
2271
2271
  o = r[i], (!s || s(o, t, e)) && !a[o] && (e[o] = t[o], a[o] = !0);
2272
- t = n !== !1 && Bt(t);
2272
+ t = n !== !1 && Lt(t);
2273
2273
  } while (t && (!n || n(t, e)) && t !== Object.prototype);
2274
2274
  return e;
2275
2275
  }, $s = (t, e, n) => {
@@ -2282,13 +2282,13 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2282
2282
  if (z(t))
2283
2283
  return t;
2284
2284
  let e = t.length;
2285
- if (!Je(e))
2285
+ if (!ze(e))
2286
2286
  return null;
2287
2287
  const n = new Array(e);
2288
2288
  for (; e-- > 0; )
2289
2289
  n[e] = t[e];
2290
2290
  return n;
2291
- }, Bs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Bt(Uint8Array)), Fs = (t, e) => {
2291
+ }, Bs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Lt(Uint8Array)), Fs = (t, e) => {
2292
2292
  const s = (t && t[Symbol.iterator]).call(t);
2293
2293
  let r;
2294
2294
  for (; (r = s.next()) && !r.done; ) {
@@ -2306,14 +2306,14 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2306
2306
  function(n, s, r) {
2307
2307
  return s.toUpperCase() + r;
2308
2308
  }
2309
- ), ae = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), qs = A("RegExp"), Ve = (t, e) => {
2309
+ ), oe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), qs = A("RegExp"), Ke = (t, e) => {
2310
2310
  const n = Object.getOwnPropertyDescriptors(t), s = {};
2311
2311
  G(n, (r, i) => {
2312
2312
  let o;
2313
2313
  (o = e(r, i, t)) !== !1 && (s[i] = o || r);
2314
2314
  }), Object.defineProperties(t, s);
2315
2315
  }, Ws = (t) => {
2316
- Ve(t, (e, n) => {
2316
+ Ke(t, (e, n) => {
2317
2317
  if (T(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
2318
2318
  return !1;
2319
2319
  const s = t[n];
@@ -2335,11 +2335,11 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2335
2335
  };
2336
2336
  return z(t) ? s(t) : s(String(t).split(e)), n;
2337
2337
  }, Vs = () => {
2338
- }, Gs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), mt = "abcdefghijklmnopqrstuvwxyz", ce = "0123456789", Ge = {
2339
- DIGIT: ce,
2338
+ }, Gs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), mt = "abcdefghijklmnopqrstuvwxyz", ae = "0123456789", Ve = {
2339
+ DIGIT: ae,
2340
2340
  ALPHA: mt,
2341
- ALPHA_DIGIT: mt + mt.toUpperCase() + ce
2342
- }, Xs = (t = 16, e = Ge.ALPHA_DIGIT) => {
2341
+ ALPHA_DIGIT: mt + mt.toUpperCase() + ae
2342
+ }, Xs = (t = 16, e = Ve.ALPHA_DIGIT) => {
2343
2343
  let n = "";
2344
2344
  const { length: s } = e;
2345
2345
  for (; t--; )
@@ -2368,12 +2368,12 @@ const Zs = (t) => {
2368
2368
  return n(t, 0);
2369
2369
  }, Qs = A("AsyncFunction"), tr = (t) => t && (ft(t) || T(t)) && T(t.then) && T(t.catch), d = {
2370
2370
  isArray: z,
2371
- isArrayBuffer: ze,
2371
+ isArrayBuffer: He,
2372
2372
  isBuffer: Ts,
2373
2373
  isFormData: Cs,
2374
2374
  isArrayBufferView: vs,
2375
2375
  isString: bs,
2376
- isNumber: Je,
2376
+ isNumber: ze,
2377
2377
  isBoolean: As,
2378
2378
  isObject: ft,
2379
2379
  isPlainObject: Q,
@@ -2401,19 +2401,19 @@ const Zs = (t) => {
2401
2401
  forEachEntry: Fs,
2402
2402
  matchAll: Hs,
2403
2403
  isHTMLForm: zs,
2404
- hasOwnProperty: ae,
2405
- hasOwnProp: ae,
2404
+ hasOwnProperty: oe,
2405
+ hasOwnProp: oe,
2406
2406
  // an alias to avoid ESLint no-prototype-builtins detection
2407
- reduceDescriptors: Ve,
2407
+ reduceDescriptors: Ke,
2408
2408
  freezeMethods: Ws,
2409
2409
  toObjectSet: Ks,
2410
2410
  toCamelCase: Js,
2411
2411
  noop: Vs,
2412
2412
  toFiniteNumber: Gs,
2413
- findKey: qe,
2414
- global: We,
2415
- isContextDefined: Ke,
2416
- ALPHABET: Ge,
2413
+ findKey: Je,
2414
+ global: qe,
2415
+ isContextDefined: We,
2416
+ ALPHABET: Ve,
2417
2417
  generateString: Xs,
2418
2418
  isSpecCompliantForm: Ys,
2419
2419
  toJSONObject: Zs,
@@ -2444,7 +2444,7 @@ d.inherits(g, Error, {
2444
2444
  };
2445
2445
  }
2446
2446
  });
2447
- const Xe = g.prototype, Ye = {};
2447
+ const Ge = g.prototype, Xe = {};
2448
2448
  [
2449
2449
  "ERR_BAD_OPTION_VALUE",
2450
2450
  "ERR_BAD_OPTION",
@@ -2460,12 +2460,12 @@ const Xe = g.prototype, Ye = {};
2460
2460
  "ERR_INVALID_URL"
2461
2461
  // eslint-disable-next-line func-names
2462
2462
  ].forEach((t) => {
2463
- Ye[t] = { value: t };
2463
+ Xe[t] = { value: t };
2464
2464
  });
2465
- Object.defineProperties(g, Ye);
2466
- Object.defineProperty(Xe, "isAxiosError", { value: !0 });
2465
+ Object.defineProperties(g, Xe);
2466
+ Object.defineProperty(Ge, "isAxiosError", { value: !0 });
2467
2467
  g.from = (t, e, n, s, r, i) => {
2468
- const o = Object.create(Xe);
2468
+ const o = Object.create(Ge);
2469
2469
  return d.toFlatObject(t, o, function(u) {
2470
2470
  return u !== Error.prototype;
2471
2471
  }, (a) => a !== "isAxiosError"), g.call(o, t.message, e, n, s, r), o.cause = t, o.name = t.name, i && Object.assign(o, i), o;
@@ -2474,12 +2474,12 @@ const er = null;
2474
2474
  function At(t) {
2475
2475
  return d.isPlainObject(t) || d.isArray(t);
2476
2476
  }
2477
- function Ze(t) {
2477
+ function Ye(t) {
2478
2478
  return d.endsWith(t, "[]") ? t.slice(0, -2) : t;
2479
2479
  }
2480
- function ue(t, e, n) {
2480
+ function ce(t, e, n) {
2481
2481
  return t ? t.concat(e).map(function(r, i) {
2482
- return r = Ze(r), !n && i ? "[" + r + "]" : r;
2482
+ return r = Ye(r), !n && i ? "[" + r + "]" : r;
2483
2483
  }).join(n ? "." : "") : e;
2484
2484
  }
2485
2485
  function nr(t) {
@@ -2516,15 +2516,15 @@ function lt(t, e, n) {
2516
2516
  if (d.endsWith(m, "{}"))
2517
2517
  m = s ? m : m.slice(0, -2), h = JSON.stringify(h);
2518
2518
  else if (d.isArray(h) && nr(h) || (d.isFileList(h) || d.endsWith(m, "[]")) && (E = d.toArray(h)))
2519
- return m = Ze(m), E.forEach(function(Y, fn) {
2519
+ return m = Ye(m), E.forEach(function(Y, fn) {
2520
2520
  !(d.isUndefined(Y) || Y === null) && e.append(
2521
2521
  // eslint-disable-next-line no-nested-ternary
2522
- o === !0 ? ue([m], fn, i) : o === null ? m : m + "[]",
2522
+ o === !0 ? ce([m], fn, i) : o === null ? m : m + "[]",
2523
2523
  c(Y)
2524
2524
  );
2525
2525
  }), !1;
2526
2526
  }
2527
- return At(h) ? !0 : (e.append(ue(S, m, i), c(h)), !1);
2527
+ return At(h) ? !0 : (e.append(ce(S, m, i), c(h)), !1);
2528
2528
  }
2529
2529
  const f = [], p = Object.assign(sr, {
2530
2530
  defaultVisitor: l,
@@ -2550,7 +2550,7 @@ function lt(t, e, n) {
2550
2550
  throw new TypeError("data must be an object");
2551
2551
  return y(t), e;
2552
2552
  }
2553
- function fe(t) {
2553
+ function ue(t) {
2554
2554
  const e = {
2555
2555
  "!": "%21",
2556
2556
  "'": "%27",
@@ -2564,17 +2564,17 @@ function fe(t) {
2564
2564
  return e[s];
2565
2565
  });
2566
2566
  }
2567
- function Ft(t, e) {
2567
+ function Bt(t, e) {
2568
2568
  this._pairs = [], t && lt(t, this, e);
2569
2569
  }
2570
- const Qe = Ft.prototype;
2571
- Qe.append = function(e, n) {
2570
+ const Ze = Bt.prototype;
2571
+ Ze.append = function(e, n) {
2572
2572
  this._pairs.push([e, n]);
2573
2573
  };
2574
- Qe.toString = function(e) {
2574
+ Ze.toString = function(e) {
2575
2575
  const n = e ? function(s) {
2576
- return e.call(this, s, fe);
2577
- } : fe;
2576
+ return e.call(this, s, ue);
2577
+ } : ue;
2578
2578
  return this._pairs.map(function(r) {
2579
2579
  return n(r[0]) + "=" + n(r[1]);
2580
2580
  }, "").join("&");
@@ -2582,12 +2582,12 @@ Qe.toString = function(e) {
2582
2582
  function rr(t) {
2583
2583
  return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2584
2584
  }
2585
- function tn(t, e, n) {
2585
+ function Qe(t, e, n) {
2586
2586
  if (!e)
2587
2587
  return t;
2588
2588
  const s = n && n.encode || rr, r = n && n.serialize;
2589
2589
  let i;
2590
- if (r ? i = r(e, n) : i = d.isURLSearchParams(e) ? e.toString() : new Ft(e, n).toString(s), i) {
2590
+ if (r ? i = r(e, n) : i = d.isURLSearchParams(e) ? e.toString() : new Bt(e, n).toString(s), i) {
2591
2591
  const o = t.indexOf("#");
2592
2592
  o !== -1 && (t = t.slice(0, o)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
2593
2593
  }
@@ -2647,11 +2647,11 @@ class ir {
2647
2647
  });
2648
2648
  }
2649
2649
  }
2650
- const le = ir, en = {
2650
+ const fe = ir, tn = {
2651
2651
  silentJSONParsing: !0,
2652
2652
  forcedJSONParsing: !0,
2653
2653
  clarifyTimeoutError: !1
2654
- }, or = typeof URLSearchParams < "u" ? URLSearchParams : Ft, ar = typeof FormData < "u" ? FormData : null, cr = typeof Blob < "u" ? Blob : null, ur = (() => {
2654
+ }, or = typeof URLSearchParams < "u" ? URLSearchParams : Bt, ar = typeof FormData < "u" ? FormData : null, cr = typeof Blob < "u" ? Blob : null, ur = (() => {
2655
2655
  let t;
2656
2656
  return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
2657
2657
  })(), fr = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
@@ -2685,7 +2685,7 @@ function hr(t) {
2685
2685
  i = n[s], e[i] = t[i];
2686
2686
  return e;
2687
2687
  }
2688
- function nn(t) {
2688
+ function en(t) {
2689
2689
  function e(n, s, r, i) {
2690
2690
  let o = n[i++];
2691
2691
  const a = Number.isFinite(+o), u = i >= n.length;
@@ -2709,13 +2709,13 @@ function pr(t, e, n) {
2709
2709
  }
2710
2710
  return (n || JSON.stringify)(t);
2711
2711
  }
2712
- const Ht = {
2713
- transitional: en,
2712
+ const Ft = {
2713
+ transitional: tn,
2714
2714
  adapter: b.isNode ? "http" : "xhr",
2715
2715
  transformRequest: [function(e, n) {
2716
2716
  const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, i = d.isObject(e);
2717
2717
  if (i && d.isHTMLForm(e) && (e = new FormData(e)), d.isFormData(e))
2718
- return r && r ? JSON.stringify(nn(e)) : e;
2718
+ return r && r ? JSON.stringify(en(e)) : e;
2719
2719
  if (d.isArrayBuffer(e) || d.isBuffer(e) || d.isStream(e) || d.isFile(e) || d.isBlob(e))
2720
2720
  return e;
2721
2721
  if (d.isArrayBufferView(e))
@@ -2738,7 +2738,7 @@ const Ht = {
2738
2738
  return i || r ? (n.setContentType("application/json", !1), pr(e)) : e;
2739
2739
  }],
2740
2740
  transformResponse: [function(e) {
2741
- const n = this.transitional || Ht.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
2741
+ const n = this.transitional || Ft.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
2742
2742
  if (e && d.isString(e) && (s && !this.responseType || r)) {
2743
2743
  const o = !(n && n.silentJSONParsing) && r;
2744
2744
  try {
@@ -2774,9 +2774,9 @@ const Ht = {
2774
2774
  }
2775
2775
  };
2776
2776
  d.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
2777
- Ht.headers[t] = {};
2777
+ Ft.headers[t] = {};
2778
2778
  });
2779
- const zt = Ht, yr = d.toObjectSet([
2779
+ const Ht = Ft, yr = d.toObjectSet([
2780
2780
  "age",
2781
2781
  "authorization",
2782
2782
  "content-length",
@@ -2801,7 +2801,7 @@ const zt = Ht, yr = d.toObjectSet([
2801
2801
  `).forEach(function(o) {
2802
2802
  r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || e[n] && yr[n]) && (n === "set-cookie" ? e[n] ? e[n].push(s) : e[n] = [s] : e[n] = e[n] ? e[n] + ", " + s : s);
2803
2803
  }), e;
2804
- }, de = Symbol("internals");
2804
+ }, le = Symbol("internals");
2805
2805
  function q(t) {
2806
2806
  return t && String(t).trim().toLowerCase();
2807
2807
  }
@@ -2939,7 +2939,7 @@ class dt {
2939
2939
  return n.forEach((r) => s.set(r)), s;
2940
2940
  }
2941
2941
  static accessor(e) {
2942
- const s = (this[de] = this[de] = {
2942
+ const s = (this[le] = this[le] = {
2943
2943
  accessors: {}
2944
2944
  }).accessors, r = this.prototype;
2945
2945
  function i(o) {
@@ -2962,13 +2962,13 @@ d.reduceDescriptors(dt.prototype, ({ value: t }, e) => {
2962
2962
  d.freezeMethods(dt);
2963
2963
  const R = dt;
2964
2964
  function St(t, e) {
2965
- const n = this || zt, s = e || n, r = R.from(s.headers);
2965
+ const n = this || Ht, s = e || n, r = R.from(s.headers);
2966
2966
  let i = s.data;
2967
2967
  return d.forEach(t, function(a) {
2968
2968
  i = a.call(n, i, r.normalize(), e ? e.status : void 0);
2969
2969
  }), r.normalize(), i;
2970
2970
  }
2971
- function sn(t) {
2971
+ function nn(t) {
2972
2972
  return !!(t && t.__CANCEL__);
2973
2973
  }
2974
2974
  function X(t, e, n) {
@@ -3024,7 +3024,7 @@ function vr(t) {
3024
3024
  function br(t, e) {
3025
3025
  return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
3026
3026
  }
3027
- function rn(t, e) {
3027
+ function sn(t, e) {
3028
3028
  return t && !vr(e) ? br(t, e) : e;
3029
3029
  }
3030
3030
  const Ar = b.isStandardBrowserEnv ? (
@@ -3079,7 +3079,7 @@ function Rr(t, e) {
3079
3079
  return y ? Math.round(p * 1e3 / y) : void 0;
3080
3080
  };
3081
3081
  }
3082
- function he(t, e) {
3082
+ function de(t, e) {
3083
3083
  let n = 0;
3084
3084
  const s = Rr(50, 250);
3085
3085
  return (r) => {
@@ -3111,8 +3111,8 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3111
3111
  const y = t.auth.username || "", h = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
3112
3112
  i.set("Authorization", "Basic " + btoa(y + ":" + h));
3113
3113
  }
3114
- const l = rn(t.baseURL, t.url);
3115
- c.open(t.method.toUpperCase(), tn(l, t.params, t.paramsSerializer), !0), c.timeout = t.timeout;
3114
+ const l = sn(t.baseURL, t.url);
3115
+ c.open(t.method.toUpperCase(), Qe(l, t.params, t.paramsSerializer), !0), c.timeout = t.timeout;
3116
3116
  function f() {
3117
3117
  if (!c)
3118
3118
  return;
@@ -3140,7 +3140,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3140
3140
  s(new g("Network Error", g.ERR_NETWORK, t, c)), c = null;
3141
3141
  }, c.ontimeout = function() {
3142
3142
  let h = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
3143
- const m = t.transitional || en;
3143
+ const m = t.transitional || tn;
3144
3144
  t.timeoutErrorMessage && (h = t.timeoutErrorMessage), s(new g(
3145
3145
  h,
3146
3146
  m.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
@@ -3153,7 +3153,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3153
3153
  }
3154
3154
  r === void 0 && i.setContentType(null), "setRequestHeader" in c && d.forEach(i.toJSON(), function(h, m) {
3155
3155
  c.setRequestHeader(m, h);
3156
- }), d.isUndefined(t.withCredentials) || (c.withCredentials = !!t.withCredentials), o && o !== "json" && (c.responseType = t.responseType), typeof t.onDownloadProgress == "function" && c.addEventListener("progress", he(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", he(t.onUploadProgress)), (t.cancelToken || t.signal) && (a = (y) => {
3156
+ }), d.isUndefined(t.withCredentials) || (c.withCredentials = !!t.withCredentials), o && o !== "json" && (c.responseType = t.responseType), typeof t.onDownloadProgress == "function" && c.addEventListener("progress", de(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", de(t.onUploadProgress)), (t.cancelToken || t.signal) && (a = (y) => {
3157
3157
  c && (s(!y || y.type ? new X(null, t, c) : y), c.abort(), c = null);
3158
3158
  }, t.cancelToken && t.cancelToken.subscribe(a), t.signal && (t.signal.aborted ? a() : t.signal.addEventListener("abort", a)));
3159
3159
  const p = xr(l);
@@ -3176,7 +3176,7 @@ d.forEach(et, (t, e) => {
3176
3176
  Object.defineProperty(t, "adapterName", { value: e });
3177
3177
  }
3178
3178
  });
3179
- const on = {
3179
+ const rn = {
3180
3180
  getAdapter: (t) => {
3181
3181
  t = d.isArray(t) ? t : [t];
3182
3182
  const { length: e } = t;
@@ -3200,25 +3200,25 @@ function Et(t) {
3200
3200
  if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
3201
3201
  throw new X(null, t);
3202
3202
  }
3203
- function pe(t) {
3203
+ function he(t) {
3204
3204
  return Et(t), t.headers = R.from(t.headers), t.data = St.call(
3205
3205
  t,
3206
3206
  t.transformRequest
3207
- ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), on.getAdapter(t.adapter || zt.adapter)(t).then(function(s) {
3207
+ ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), rn.getAdapter(t.adapter || Ht.adapter)(t).then(function(s) {
3208
3208
  return Et(t), s.data = St.call(
3209
3209
  t,
3210
3210
  t.transformResponse,
3211
3211
  s
3212
3212
  ), s.headers = R.from(s.headers), s;
3213
3213
  }, function(s) {
3214
- return sn(s) || (Et(t), s && s.response && (s.response.data = St.call(
3214
+ return nn(s) || (Et(t), s && s.response && (s.response.data = St.call(
3215
3215
  t,
3216
3216
  t.transformResponse,
3217
3217
  s.response
3218
3218
  ), s.response.headers = R.from(s.response.headers))), Promise.reject(s);
3219
3219
  });
3220
3220
  }
3221
- const ye = (t) => t instanceof R ? t.toJSON() : t;
3221
+ const pe = (t) => t instanceof R ? t.toJSON() : t;
3222
3222
  function H(t, e) {
3223
3223
  e = e || {};
3224
3224
  const n = {};
@@ -3277,23 +3277,23 @@ function H(t, e) {
3277
3277
  socketPath: o,
3278
3278
  responseEncoding: o,
3279
3279
  validateStatus: a,
3280
- headers: (c, l) => r(ye(c), ye(l), !0)
3280
+ headers: (c, l) => r(pe(c), pe(l), !0)
3281
3281
  };
3282
3282
  return d.forEach(Object.keys(Object.assign({}, t, e)), function(l) {
3283
3283
  const f = u[l] || r, p = f(t[l], e[l], l);
3284
3284
  d.isUndefined(p) && f !== a || (n[l] = p);
3285
3285
  }), n;
3286
3286
  }
3287
- const an = "1.5.0", Jt = {};
3287
+ const on = "1.5.0", zt = {};
3288
3288
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
3289
- Jt[t] = function(s) {
3289
+ zt[t] = function(s) {
3290
3290
  return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
3291
3291
  };
3292
3292
  });
3293
- const me = {};
3294
- Jt.transitional = function(e, n, s) {
3293
+ const ye = {};
3294
+ zt.transitional = function(e, n, s) {
3295
3295
  function r(i, o) {
3296
- return "[Axios v" + an + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
3296
+ return "[Axios v" + on + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
3297
3297
  }
3298
3298
  return (i, o, a) => {
3299
3299
  if (e === !1)
@@ -3301,7 +3301,7 @@ Jt.transitional = function(e, n, s) {
3301
3301
  r(o, " has been removed" + (n ? " in " + n : "")),
3302
3302
  g.ERR_DEPRECATED
3303
3303
  );
3304
- return n && !me[o] && (me[o] = !0, console.warn(
3304
+ return n && !ye[o] && (ye[o] = !0, console.warn(
3305
3305
  r(
3306
3306
  o,
3307
3307
  " has been deprecated since v" + n + " and will be removed in the near future"
@@ -3328,13 +3328,13 @@ function Ir(t, e, n) {
3328
3328
  }
3329
3329
  const xt = {
3330
3330
  assertOptions: Ir,
3331
- validators: Jt
3331
+ validators: zt
3332
3332
  }, k = xt.validators;
3333
3333
  class ot {
3334
3334
  constructor(e) {
3335
3335
  this.defaults = e, this.interceptors = {
3336
- request: new le(),
3337
- response: new le()
3336
+ request: new fe(),
3337
+ response: new fe()
3338
3338
  };
3339
3339
  }
3340
3340
  /**
@@ -3379,7 +3379,7 @@ class ot {
3379
3379
  });
3380
3380
  let l, f = 0, p;
3381
3381
  if (!u) {
3382
- const h = [pe.bind(this), void 0];
3382
+ const h = [he.bind(this), void 0];
3383
3383
  for (h.unshift.apply(h, a), h.push.apply(h, c), p = h.length, l = Promise.resolve(n); f < p; )
3384
3384
  l = l.then(h[f++], h[f++]);
3385
3385
  return l;
@@ -3396,7 +3396,7 @@ class ot {
3396
3396
  }
3397
3397
  }
3398
3398
  try {
3399
- l = pe.call(this, y);
3399
+ l = he.call(this, y);
3400
3400
  } catch (h) {
3401
3401
  return Promise.reject(h);
3402
3402
  }
@@ -3406,8 +3406,8 @@ class ot {
3406
3406
  }
3407
3407
  getUri(e) {
3408
3408
  e = H(this.defaults, e);
3409
- const n = rn(e.baseURL, e.url);
3410
- return tn(n, e.params, e.paramsSerializer);
3409
+ const n = sn(e.baseURL, e.url);
3410
+ return Qe(n, e.params, e.paramsSerializer);
3411
3411
  }
3412
3412
  }
3413
3413
  d.forEach(["delete", "get", "head", "options"], function(e) {
@@ -3435,7 +3435,7 @@ d.forEach(["post", "put", "patch"], function(e) {
3435
3435
  ot.prototype[e] = n(), ot.prototype[e + "Form"] = n(!0);
3436
3436
  });
3437
3437
  const nt = ot;
3438
- class qt {
3438
+ class Jt {
3439
3439
  constructor(e) {
3440
3440
  if (typeof e != "function")
3441
3441
  throw new TypeError("executor must be a function.");
@@ -3496,14 +3496,14 @@ class qt {
3496
3496
  static source() {
3497
3497
  let e;
3498
3498
  return {
3499
- token: new qt(function(r) {
3499
+ token: new Jt(function(r) {
3500
3500
  e = r;
3501
3501
  }),
3502
3502
  cancel: e
3503
3503
  };
3504
3504
  }
3505
3505
  }
3506
- const Cr = qt;
3506
+ const Cr = Jt;
3507
3507
  function Pr(t) {
3508
3508
  return function(n) {
3509
3509
  return t.apply(null, n);
@@ -3581,18 +3581,18 @@ Object.entries(Rt).forEach(([t, e]) => {
3581
3581
  Rt[e] = t;
3582
3582
  });
3583
3583
  const Mr = Rt;
3584
- function cn(t) {
3585
- const e = new nt(t), n = He(nt.prototype.request, e);
3584
+ function an(t) {
3585
+ const e = new nt(t), n = Fe(nt.prototype.request, e);
3586
3586
  return d.extend(n, nt.prototype, e, { allOwnKeys: !0 }), d.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(r) {
3587
- return cn(H(t, r));
3587
+ return an(H(t, r));
3588
3588
  }, n;
3589
3589
  }
3590
- const w = cn(zt);
3590
+ const w = an(Ht);
3591
3591
  w.Axios = nt;
3592
3592
  w.CanceledError = X;
3593
3593
  w.CancelToken = Cr;
3594
- w.isCancel = sn;
3595
- w.VERSION = an;
3594
+ w.isCancel = nn;
3595
+ w.VERSION = on;
3596
3596
  w.toFormData = lt;
3597
3597
  w.AxiosError = g;
3598
3598
  w.Cancel = w.CanceledError;
@@ -3603,19 +3603,19 @@ w.spread = Pr;
3603
3603
  w.isAxiosError = Dr;
3604
3604
  w.mergeConfig = H;
3605
3605
  w.AxiosHeaders = R;
3606
- w.formToJSON = (t) => nn(d.isHTMLForm(t) ? new FormData(t) : t);
3607
- w.getAdapter = on.getAdapter;
3606
+ w.formToJSON = (t) => en(d.isHTMLForm(t) ? new FormData(t) : t);
3607
+ w.getAdapter = rn.getAdapter;
3608
3608
  w.HttpStatusCode = Mr;
3609
3609
  w.default = w;
3610
3610
  const Ur = w;
3611
- async function ge(t, e) {
3611
+ async function me(t, e) {
3612
3612
  const n = await fetch(t, e);
3613
3613
  return n.status === 200 ? n.json() : Promise.resolve({
3614
3614
  message: n.statusText,
3615
3615
  success: !1
3616
3616
  });
3617
3617
  }
3618
- const Se = Lt({
3618
+ const ge = $t({
3619
3619
  types: {
3620
3620
  context: {},
3621
3621
  events: {},
@@ -3712,7 +3712,7 @@ const Se = Lt({
3712
3712
  throw new Error("Could not complete refresh request (server)");
3713
3713
  }
3714
3714
  } else {
3715
- e = await ge(
3715
+ e = await me(
3716
3716
  t.context.endpoints.refresh,
3717
3717
  {
3718
3718
  method: "POST",
@@ -3742,7 +3742,7 @@ const Se = Lt({
3742
3742
  }),
3743
3743
  authenticate: yt(async ({ input: t }) => {
3744
3744
  var s;
3745
- const n = await ge(
3745
+ const n = await me(
3746
3746
  t.context.endpoints.login,
3747
3747
  {
3748
3748
  method: "POST",
@@ -3911,14 +3911,15 @@ const Se = Lt({
3911
3911
  // },
3912
3912
  // },
3913
3913
  }
3914
- }), Ot = we(
3914
+ }), cn = Ee(
3915
3915
  {}
3916
3916
  ), Br = () => {
3917
- console.log("useAuth"), console.log(typeof window), console.log(Ot);
3918
- const t = _e(Ot), [e, n] = ln(
3919
- t.getSnapshot().value === "loggedIn"
3917
+ const t = we(cn), [e, n] = ln(
3918
+ typeof window < "u" && t.getSnapshot().value === "loggedIn"
3920
3919
  );
3921
3920
  return dn(() => {
3921
+ if (typeof window > "u")
3922
+ return;
3922
3923
  const s = t.subscribe((r) => {
3923
3924
  (r.value === "loggedIn" || r.value === "loggedOut") && n(r.value === "loggedIn");
3924
3925
  });
@@ -3931,14 +3932,14 @@ const Se = Lt({
3931
3932
  endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
3932
3933
  }) => typeof window < "u" ? (console.warn(
3933
3934
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
3934
- ), $(Se, {
3935
+ ), $(ge, {
3935
3936
  inspect: e.inspect,
3936
3937
  input: {
3937
3938
  initialContext: {
3938
3939
  endpoints: e.endpoints
3939
3940
  }
3940
3941
  }
3941
- }).start()) : $(Se, {
3942
+ }).start()) : $(ge, {
3942
3943
  input: {
3943
3944
  initialContext: {
3944
3945
  endpoints: e.endpoints,
@@ -3948,10 +3949,10 @@ const Se = Lt({
3948
3949
  inspect: e.inspect
3949
3950
  }).start();
3950
3951
  function Hr({ actor: t, children: e }) {
3951
- return /* @__PURE__ */ Ee(Ot.Provider, { value: t, children: e });
3952
+ return /* @__PURE__ */ Se(cn.Provider, { value: t, children: e });
3952
3953
  }
3953
3954
  let Nr = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
3954
- const jr = Lt({
3955
+ const jr = $t({
3955
3956
  actors: {
3956
3957
  tick: ds(
3957
3958
  ({ sendBack: t, input: e }) => {
@@ -4029,7 +4030,7 @@ const jr = Lt({
4029
4030
  type: "final"
4030
4031
  }
4031
4032
  }
4032
- }), zr = Lt({
4033
+ }), zr = $t({
4033
4034
  actors: {
4034
4035
  timer: jr
4035
4036
  },
@@ -4119,11 +4120,11 @@ const jr = Lt({
4119
4120
  target: "idle"
4120
4121
  },
4121
4122
  RESUME_TIMER: {
4122
- actions: ie("timer", { type: "RESUME_TIMER" })
4123
+ actions: re("timer", { type: "RESUME_TIMER" })
4123
4124
  // cond: (context) => context.duration > 0,
4124
4125
  },
4125
4126
  PAUSE_TIMER: {
4126
- actions: ie("timer", { type: "PAUSE_TIMER" })
4127
+ actions: re("timer", { type: "PAUSE_TIMER" })
4127
4128
  // cond: (context) => context.duration > 0,
4128
4129
  }
4129
4130
  }
@@ -4157,19 +4158,19 @@ const jr = Lt({
4157
4158
  }
4158
4159
  }
4159
4160
  }
4160
- }), un = we({}), Jr = () => _e(un);
4161
+ }), un = Ee({}), Jr = () => we(un);
4161
4162
  function qr({
4162
4163
  children: t,
4163
4164
  actor: e
4164
4165
  }) {
4165
- return /* @__PURE__ */ Ee(un.Provider, { value: e, children: t });
4166
+ return /* @__PURE__ */ Se(un.Provider, { value: e, children: t });
4166
4167
  }
4167
4168
  export {
4168
- Ot as AuthContext,
4169
+ cn as AuthContext,
4169
4170
  Hr as AuthProvider,
4170
4171
  un as ToastContext,
4171
4172
  qr as ToastProvider,
4172
- Se as authMachine,
4173
+ ge as authMachine,
4173
4174
  Fr as getAuth,
4174
4175
  jr as timerMachine,
4175
4176
  zr as toastMachine,