@clicktap/state 0.13.17 → 0.13.18

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 +18 -18
  2. package/index.mjs +518 -518
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as ze } from "react/jsx-runtime";
2
- import { createContext as Je, useContext as Ye, useState as Mt, useEffect as qt, cloneElement as _n } from "react";
1
+ import { jsx as Ye } from "react/jsx-runtime";
2
+ import { createContext as Xe, useContext as Qe, useState as Lt, useEffect as Ut, cloneElement as _n } from "react";
3
3
  function In(e, t) {
4
4
  for (var n = 0; n < t.length; n++) {
5
5
  const s = t[n];
@@ -37,7 +37,7 @@ const xn = (e) => {
37
37
  const t = An();
38
38
  t && t.register(e);
39
39
  };
40
- class ut {
40
+ class lt {
41
41
  constructor(t) {
42
42
  this._process = t, this._active = !1, this._current = null, this._last = null;
43
43
  }
@@ -66,13 +66,13 @@ class ut {
66
66
  this._last = null;
67
67
  }
68
68
  }
69
- const Lt = ".", wn = "", Ut = "", bn = "#", On = "*", Pt = "xstate.init", Nn = "xstate.error", ce = "xstate.stop";
69
+ const Pt = ".", wn = "", Ft = "", bn = "#", On = "*", Bt = "xstate.init", Nn = "xstate.error", ue = "xstate.stop";
70
70
  function kn(e, t) {
71
71
  return {
72
72
  type: `xstate.after.${e}.${t}`
73
73
  };
74
74
  }
75
- function Pe(e, t) {
75
+ function Be(e, t) {
76
76
  return {
77
77
  type: `xstate.done.state.${e}`,
78
78
  output: t
@@ -84,25 +84,25 @@ function Cn(e, t) {
84
84
  output: t
85
85
  };
86
86
  }
87
- function Ft(e, t) {
87
+ function jt(e, t) {
88
88
  return {
89
89
  type: `xstate.error.actor.${e}`,
90
90
  error: t
91
91
  };
92
92
  }
93
- function Bt(e) {
93
+ function $t(e) {
94
94
  return {
95
- type: Pt,
95
+ type: Bt,
96
96
  input: e
97
97
  };
98
98
  }
99
- function P(e) {
99
+ function F(e) {
100
100
  setTimeout(() => {
101
101
  throw e;
102
102
  });
103
103
  }
104
104
  const Dn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
105
- function dt(e, t) {
105
+ function ht(e, t) {
106
106
  return `${e.sessionId}.${t}`;
107
107
  }
108
108
  let Rn = 0;
@@ -119,7 +119,7 @@ function Mn(e, t) {
119
119
  delay: v,
120
120
  id: S,
121
121
  startedAt: Date.now()
122
- }, R = dt(f, S);
122
+ }, R = ht(f, S);
123
123
  d._snapshot._scheduledEvents[R] = x;
124
124
  const k = a.setTimeout(() => {
125
125
  delete o[R], delete d._snapshot._scheduledEvents[R], d._relay(f, m, y);
@@ -127,7 +127,7 @@ function Mn(e, t) {
127
127
  o[R] = k;
128
128
  },
129
129
  cancel: (f, m) => {
130
- const y = dt(f, m), v = o[y];
130
+ const y = ht(f, m), v = o[y];
131
131
  delete o[y], delete d._snapshot._scheduledEvents[y], a.clearTimeout(v);
132
132
  },
133
133
  cancelAll: (f) => {
@@ -202,12 +202,12 @@ function Mn(e, t) {
202
202
  };
203
203
  return d;
204
204
  }
205
- function jt(e, t) {
206
- const n = lt(e), s = lt(t);
207
- return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? jt(n[r], s[r]) : !1);
205
+ function Vt(e, t) {
206
+ const n = ft(e), s = ft(t);
207
+ return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? Vt(n[r], s[r]) : !1);
208
208
  }
209
- function Xe(e) {
210
- if (Vt(e))
209
+ function We(e) {
210
+ if (Gt(e))
211
211
  return e;
212
212
  let t = [], n = "";
213
213
  for (let s = 0; s < e.length; s++) {
@@ -223,12 +223,12 @@ function Xe(e) {
223
223
  }
224
224
  return t.push(n), t;
225
225
  }
226
- function lt(e) {
226
+ function ft(e) {
227
227
  if (ls(e))
228
228
  return e.value;
229
229
  if (typeof e != "string")
230
230
  return e;
231
- const t = Xe(e);
231
+ const t = We(e);
232
232
  return qn(t);
233
233
  }
234
234
  function qn(e) {
@@ -245,7 +245,7 @@ function qn(e) {
245
245
  }
246
246
  return t;
247
247
  }
248
- function ht(e, t) {
248
+ function pt(e, t) {
249
249
  const n = {}, s = Object.keys(e);
250
250
  for (let r = 0; r < s.length; r++) {
251
251
  const i = s[r];
@@ -253,35 +253,35 @@ function ht(e, t) {
253
253
  }
254
254
  return n;
255
255
  }
256
- function $t(e) {
257
- return Vt(e) ? e : [e];
256
+ function Ht(e) {
257
+ return Gt(e) ? e : [e];
258
258
  }
259
- function F(e) {
260
- return e === void 0 ? [] : $t(e);
259
+ function B(e) {
260
+ return e === void 0 ? [] : Ht(e);
261
261
  }
262
- function Fe(e, t, n, s) {
262
+ function je(e, t, n, s) {
263
263
  return typeof e == "function" ? e({
264
264
  context: t,
265
265
  event: n,
266
266
  self: s
267
267
  }) : e;
268
268
  }
269
- function Vt(e) {
269
+ function Gt(e) {
270
270
  return Array.isArray(e);
271
271
  }
272
272
  function Ln(e) {
273
273
  return e.type.startsWith("xstate.error.actor");
274
274
  }
275
- function W(e) {
276
- return $t(e).map((t) => typeof t > "u" || typeof t == "string" ? {
275
+ function K(e) {
276
+ return Ht(e).map((t) => typeof t > "u" || typeof t == "string" ? {
277
277
  target: t
278
278
  } : t);
279
279
  }
280
- function Ht(e) {
280
+ function zt(e) {
281
281
  if (!(e === void 0 || e === wn))
282
- return F(e);
282
+ return B(e);
283
283
  }
284
- function ft(e, t, n) {
284
+ function yt(e, t, n) {
285
285
  var i, o, a;
286
286
  const s = typeof e == "object", r = s ? e : void 0;
287
287
  return {
@@ -290,17 +290,17 @@ function ft(e, t, n) {
290
290
  complete: (a = s ? e.complete : n) == null ? void 0 : a.bind(r)
291
291
  };
292
292
  }
293
- function pt(e, t) {
293
+ function mt(e, t) {
294
294
  return `${t}.${e}`;
295
295
  }
296
- function Qe(e, t) {
296
+ function Ke(e, t) {
297
297
  const n = t.match(/^xstate\.invoke\.(\d+)\.(.*)/);
298
298
  if (!n)
299
299
  return e.implementations.actors[t];
300
300
  const [, s, r] = n, o = e.getStateNodeById(r).config.invoke;
301
301
  return (Array.isArray(o) ? o[s] : o).src;
302
302
  }
303
- const We = 1;
303
+ const Ze = 1;
304
304
  let C = /* @__PURE__ */ function(e) {
305
305
  return e[e.NotStarted = 0] = "NotStarted", e[e.Running = 1] = "Running", e[e.Stopped = 2] = "Stopped", e;
306
306
  }({});
@@ -320,7 +320,7 @@ class Pn {
320
320
  * @param options Actor options
321
321
  */
322
322
  constructor(t, n) {
323
- this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new ut(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = C.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 = [];
323
+ this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new lt(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = C.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 = [];
324
324
  const s = {
325
325
  ...Un,
326
326
  ...n
@@ -336,7 +336,7 @@ class Pn {
336
336
  this.system = o ? o.system : Mn(this, {
337
337
  clock: r,
338
338
  logger: i
339
- }), h && !o && this.system.inspect(ft(h)), this.sessionId = this.system._bookId(), this.id = c ?? this.sessionId, this.logger = (n == null ? void 0 : n.logger) ?? this.system._logger, this.clock = (n == null ? void 0 : n.clock) ?? this.system._clock, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? t, this.ref = this, this._actorScope = {
339
+ }), h && !o && this.system.inspect(yt(h)), this.sessionId = this.system._bookId(), this.id = c ?? this.sessionId, this.logger = (n == null ? void 0 : n.logger) ?? this.system._logger, this.clock = (n == null ? void 0 : n.clock) ?? this.system._clock, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? t, this.ref = this, this._actorScope = {
340
340
  self: this,
341
341
  id: this.id,
342
342
  sessionId: this.sessionId,
@@ -393,7 +393,7 @@ class Pn {
393
393
  try {
394
394
  (r = o.next) == null || r.call(o, t);
395
395
  } catch (a) {
396
- P(a);
396
+ F(a);
397
397
  }
398
398
  break;
399
399
  case "done":
@@ -401,7 +401,7 @@ class Pn {
401
401
  try {
402
402
  (i = o.next) == null || i.call(o, t);
403
403
  } catch (a) {
404
- P(a);
404
+ F(a);
405
405
  }
406
406
  this._stopProcedure(), this._complete(), this._doneEvent = Cn(this.id, this._snapshot.output), this._parent && this.system._relay(this, this._parent, this._doneEvent);
407
407
  break;
@@ -466,7 +466,7 @@ class Pn {
466
466
  */
467
467
  subscribe(t, n, s) {
468
468
  var i;
469
- const r = ft(t, n, s);
469
+ const r = yt(t, n, s);
470
470
  if (this._processingStatus !== C.Stopped)
471
471
  this.observers.add(r);
472
472
  else
@@ -475,18 +475,18 @@ class Pn {
475
475
  try {
476
476
  (i = r.complete) == null || i.call(r);
477
477
  } catch (o) {
478
- P(o);
478
+ F(o);
479
479
  }
480
480
  break;
481
481
  case "error": {
482
482
  const o = this._snapshot.error;
483
483
  if (!r.error)
484
- P(o);
484
+ F(o);
485
485
  else
486
486
  try {
487
487
  r.error(o);
488
488
  } catch (a) {
489
- P(a);
489
+ F(a);
490
490
  }
491
491
  break;
492
492
  }
@@ -523,7 +523,7 @@ class Pn {
523
523
  error: () => {
524
524
  }
525
525
  }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = C.Running;
526
- const t = Bt(this.options.input);
526
+ const t = $t(this.options.input);
527
527
  switch (this.system._sendInspectionEvent({
528
528
  type: "@xstate.event",
529
529
  sourceRef: this._parent,
@@ -567,11 +567,11 @@ class Pn {
567
567
  }, this._error(r);
568
568
  return;
569
569
  }
570
- this.update(n, t), t.type === ce && (this._stopProcedure(), this._complete());
570
+ this.update(n, t), t.type === ue && (this._stopProcedure(), this._complete());
571
571
  }
572
572
  _stop() {
573
573
  return this._processingStatus === C.Stopped ? this : (this.mailbox.clear(), this._processingStatus === C.NotStarted ? (this._processingStatus = C.Stopped, this) : (this.mailbox.enqueue({
574
- type: ce
574
+ type: ue
575
575
  }), this));
576
576
  }
577
577
  /**
@@ -588,13 +588,13 @@ class Pn {
588
588
  try {
589
589
  (t = n.complete) == null || t.call(n);
590
590
  } catch (s) {
591
- P(s);
591
+ F(s);
592
592
  }
593
593
  this.observers.clear();
594
594
  }
595
595
  _reportError(t) {
596
596
  if (!this.observers.size) {
597
- this._parent || P(t);
597
+ this._parent || F(t);
598
598
  return;
599
599
  }
600
600
  let n = !1;
@@ -604,13 +604,13 @@ class Pn {
604
604
  try {
605
605
  r == null || r(t);
606
606
  } catch (i) {
607
- P(i);
607
+ F(i);
608
608
  }
609
609
  }
610
- this.observers.clear(), n && P(t);
610
+ this.observers.clear(), n && F(t);
611
611
  }
612
612
  _error(t) {
613
- this._stopProcedure(), this._reportError(t), this._parent && this.system._relay(this, this._parent, Ft(this.id, t));
613
+ this._stopProcedure(), this._reportError(t), this._parent && this.system._relay(this, this._parent, jt(this.id, t));
614
614
  }
615
615
  // TODO: atm children don't belong entirely to the actor so
616
616
  // in a way - it's not even super aware of them
@@ -618,7 +618,7 @@ class Pn {
618
618
  // right now, they are being stopped within the machine's transition
619
619
  // but that could throw and leave us with "orphaned" active actors
620
620
  _stopProcedure() {
621
- return this._processingStatus !== C.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new ut(this._process.bind(this)), this._processingStatus = C.Stopped, this.system._unregister(this), this);
621
+ return this._processingStatus !== C.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new lt(this._process.bind(this)), this._processingStatus = C.Stopped, this.system._unregister(this), this);
622
622
  }
623
623
  /**
624
624
  * @internal
@@ -642,7 +642,7 @@ class Pn {
642
642
  }
643
643
  toJSON() {
644
644
  return {
645
- xstate$$type: We,
645
+ xstate$$type: Ze,
646
646
  id: this.id
647
647
  };
648
648
  }
@@ -682,7 +682,7 @@ class Pn {
682
682
  return this._snapshot;
683
683
  }
684
684
  }
685
- function B(e, ...[t]) {
685
+ function j(e, ...[t]) {
686
686
  return new Pn(e, t);
687
687
  }
688
688
  function Fn(e, t, n, s, {
@@ -708,9 +708,9 @@ function $n(e, t, n, s, {
708
708
  input: a,
709
709
  syncSnapshot: c
710
710
  }) {
711
- const u = typeof o == "string" ? Qe(t.machine, o) : o, h = typeof r == "function" ? r(n) : r;
711
+ const u = typeof o == "string" ? Ke(t.machine, o) : o, h = typeof r == "function" ? r(n) : r;
712
712
  let d;
713
- return u && (d = B(u, {
713
+ return u && (d = j(u, {
714
714
  id: h,
715
715
  src: o,
716
716
  parent: e.self,
@@ -721,7 +721,7 @@ function $n(e, t, n, s, {
721
721
  event: n.event,
722
722
  self: e.self
723
723
  }) : a
724
- })), [J(t, {
724
+ })), [Y(t, {
725
725
  children: {
726
726
  ...t.children,
727
727
  [h]: d
@@ -756,7 +756,7 @@ function Gn(e, t, n, s, {
756
756
  let a = t.children;
757
757
  return o && (a = {
758
758
  ...a
759
- }, delete a[o.id]), [J(t, {
759
+ }, delete a[o.id]), [Y(t, {
760
760
  children: a
761
761
  }), o];
762
762
  }
@@ -771,19 +771,19 @@ function zn(e, t) {
771
771
  });
772
772
  }
773
773
  }
774
- function Gt(e) {
774
+ function Jt(e) {
775
775
  function t(n, s) {
776
776
  }
777
777
  return t.type = "xstate.stopChild", t.actorRef = e, t.resolve = Gn, t.execute = zn, t;
778
778
  }
779
- function Ke(e, t, n, s) {
779
+ function et(e, t, n, s) {
780
780
  const {
781
781
  machine: r
782
782
  } = s, i = typeof e == "function", o = i ? e : r.implementations.guards[typeof e == "string" ? e : e.type];
783
783
  if (!i && !o)
784
784
  throw new Error(`Guard '${typeof e == "string" ? e : e.type}' is not implemented.'.`);
785
785
  if (typeof o != "function")
786
- return Ke(o, t, n, s);
786
+ return et(o, t, n, s);
787
787
  const a = {
788
788
  context: t,
789
789
  event: n
@@ -798,11 +798,11 @@ function Ke(e, t, n, s) {
798
798
  // this holds all params
799
799
  ) : o(a, c);
800
800
  }
801
- const Ze = (e) => e.type === "atomic" || e.type === "final";
802
- function ee(e) {
801
+ const tt = (e) => e.type === "atomic" || e.type === "final";
802
+ function te(e) {
803
803
  return Object.values(e.states).filter((t) => t.type !== "history");
804
804
  }
805
- function de(e, t) {
805
+ function le(e, t) {
806
806
  const n = [];
807
807
  if (t === e)
808
808
  return n;
@@ -811,15 +811,15 @@ function de(e, t) {
811
811
  n.push(s), s = s.parent;
812
812
  return n;
813
813
  }
814
- function ve(e) {
815
- const t = new Set(e), n = Jt(t);
814
+ function _e(e) {
815
+ const t = new Set(e), n = Xt(t);
816
816
  for (const s of t)
817
817
  if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
818
- yt(s).forEach((r) => t.add(r));
818
+ gt(s).forEach((r) => t.add(r));
819
819
  else if (s.type === "parallel") {
820
- for (const r of ee(s))
820
+ for (const r of te(s))
821
821
  if (r.type !== "history" && !t.has(r)) {
822
- const i = yt(r);
822
+ const i = gt(r);
823
823
  for (const o of i)
824
824
  t.add(o);
825
825
  }
@@ -831,37 +831,37 @@ function ve(e) {
831
831
  }
832
832
  return t;
833
833
  }
834
- function zt(e, t) {
834
+ function Yt(e, t) {
835
835
  const n = t.get(e);
836
836
  if (!n)
837
837
  return {};
838
838
  if (e.type === "compound") {
839
839
  const r = n[0];
840
840
  if (r) {
841
- if (Ze(r))
841
+ if (tt(r))
842
842
  return r.key;
843
843
  } else
844
844
  return {};
845
845
  }
846
846
  const s = {};
847
847
  for (const r of n)
848
- s[r.key] = zt(r, t);
848
+ s[r.key] = Yt(r, t);
849
849
  return s;
850
850
  }
851
- function Jt(e) {
851
+ function Xt(e) {
852
852
  const t = /* @__PURE__ */ new Map();
853
853
  for (const n of e)
854
854
  t.has(n) || t.set(n, []), n.parent && (t.has(n.parent) || t.set(n.parent, []), t.get(n.parent).push(n));
855
855
  return t;
856
856
  }
857
- function Yt(e, t) {
858
- const n = ve(t);
859
- return zt(e, Jt(n));
857
+ function Qt(e, t) {
858
+ const n = _e(t);
859
+ return Yt(e, Xt(n));
860
860
  }
861
- function et(e, t) {
862
- return t.type === "compound" ? ee(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? ee(t).every((n) => et(e, n)) : t.type === "final";
861
+ function nt(e, t) {
862
+ return t.type === "compound" ? te(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? te(t).every((n) => nt(e, n)) : t.type === "final";
863
863
  }
864
- const Se = (e) => e[0] === bn;
864
+ const xe = (e) => e[0] === bn;
865
865
  function Jn(e, t) {
866
866
  return e.transitions.get(t) || [...e.transitions.keys()].filter((s) => {
867
867
  if (s === On)
@@ -894,7 +894,7 @@ function Yn(e) {
894
894
  const o = t[r], a = typeof o == "string" ? {
895
895
  target: o
896
896
  } : o, c = Number.isNaN(+r) ? r : +r, u = n(c);
897
- return F(a).map((h) => ({
897
+ return B(a).map((h) => ({
898
898
  ...h,
899
899
  event: u,
900
900
  delay: c
@@ -904,15 +904,15 @@ function Yn(e) {
904
904
  delay: i
905
905
  } = r;
906
906
  return {
907
- ...H(e, r.event, r),
907
+ ...G(e, r.event, r),
908
908
  delay: i
909
909
  };
910
910
  });
911
911
  }
912
- function H(e, t, n) {
913
- const s = Ht(n.target), r = n.reenter ?? !1, i = Wn(e, s), o = {
912
+ function G(e, t, n) {
913
+ const s = zt(n.target), r = n.reenter ?? !1, i = Wn(e, s), o = {
914
914
  ...n,
915
- actions: F(n.actions),
915
+ actions: B(n.actions),
916
916
  guard: n.guard,
917
917
  target: i,
918
918
  source: e,
@@ -930,27 +930,27 @@ function Xn(e) {
930
930
  const t = /* @__PURE__ */ new Map();
931
931
  if (e.config.on)
932
932
  for (const n of Object.keys(e.config.on)) {
933
- if (n === Ut)
933
+ if (n === Ft)
934
934
  throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
935
935
  const s = e.config.on[n];
936
- t.set(n, W(s).map((r) => H(e, n, r)));
936
+ t.set(n, K(s).map((r) => G(e, n, r)));
937
937
  }
938
938
  if (e.config.onDone) {
939
939
  const n = `xstate.done.state.${e.id}`;
940
- t.set(n, W(e.config.onDone).map((s) => H(e, n, s)));
940
+ t.set(n, K(e.config.onDone).map((s) => G(e, n, s)));
941
941
  }
942
942
  for (const n of e.invoke) {
943
943
  if (n.onDone) {
944
944
  const s = `xstate.done.actor.${n.id}`;
945
- t.set(s, W(n.onDone).map((r) => H(e, s, r)));
945
+ t.set(s, K(n.onDone).map((r) => G(e, s, r)));
946
946
  }
947
947
  if (n.onError) {
948
948
  const s = `xstate.error.actor.${n.id}`;
949
- t.set(s, W(n.onError).map((r) => H(e, s, r)));
949
+ t.set(s, K(n.onError).map((r) => G(e, s, r)));
950
950
  }
951
951
  if (n.onSnapshot) {
952
952
  const s = `xstate.snapshot.${n.id}`;
953
- t.set(s, W(n.onSnapshot).map((r) => H(e, s, r)));
953
+ t.set(s, K(n.onSnapshot).map((r) => G(e, s, r)));
954
954
  }
955
955
  }
956
956
  for (const n of e.after) {
@@ -965,7 +965,7 @@ function Qn(e, t) {
965
965
  throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);
966
966
  const s = {
967
967
  source: e,
968
- actions: !t || typeof t == "string" ? [] : F(t.actions),
968
+ actions: !t || typeof t == "string" ? [] : B(t.actions),
969
969
  eventType: null,
970
970
  reenter: !1,
971
971
  target: n ? [n] : [],
@@ -982,15 +982,15 @@ function Wn(e, t) {
982
982
  return t.map((n) => {
983
983
  if (typeof n != "string")
984
984
  return n;
985
- if (Se(n))
985
+ if (xe(n))
986
986
  return e.machine.getStateNodeById(n);
987
- const s = n[0] === Lt;
987
+ const s = n[0] === Pt;
988
988
  if (s && !e.parent)
989
- return Te(e, n.slice(1));
989
+ return Ie(e, n.slice(1));
990
990
  const r = s ? e.key + n : n;
991
991
  if (e.parent)
992
992
  try {
993
- return Te(e.parent, r);
993
+ return Ie(e.parent, r);
994
994
  } catch (i) {
995
995
  throw new Error(`Invalid transition definition for state node '${e.id}':
996
996
  ${i.message}`);
@@ -999,37 +999,37 @@ ${i.message}`);
999
999
  throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`);
1000
1000
  });
1001
1001
  }
1002
- function Xt(e) {
1003
- const t = Ht(e.config.target);
1002
+ function Wt(e) {
1003
+ const t = zt(e.config.target);
1004
1004
  return t ? {
1005
- target: t.map((n) => typeof n == "string" ? Te(e.parent, n) : n)
1005
+ target: t.map((n) => typeof n == "string" ? Ie(e.parent, n) : n)
1006
1006
  } : e.parent.initial;
1007
1007
  }
1008
- function G(e) {
1008
+ function z(e) {
1009
1009
  return e.type === "history";
1010
1010
  }
1011
- function yt(e) {
1012
- const t = Qt(e);
1011
+ function gt(e) {
1012
+ const t = Kt(e);
1013
1013
  for (const n of t)
1014
- for (const s of de(n, e))
1014
+ for (const s of le(n, e))
1015
1015
  t.add(s);
1016
1016
  return t;
1017
1017
  }
1018
- function Qt(e) {
1018
+ function Kt(e) {
1019
1019
  const t = /* @__PURE__ */ new Set();
1020
1020
  function n(s) {
1021
1021
  if (!t.has(s)) {
1022
1022
  if (t.add(s), s.type === "compound")
1023
1023
  n(s.initial.target[0]);
1024
1024
  else if (s.type === "parallel")
1025
- for (const r of ee(s))
1025
+ for (const r of te(s))
1026
1026
  n(r);
1027
1027
  }
1028
1028
  }
1029
1029
  return n(e), t;
1030
1030
  }
1031
- function te(e, t) {
1032
- if (Se(t))
1031
+ function ne(e, t) {
1032
+ if (xe(t))
1033
1033
  return e.machine.getStateNodeById(t);
1034
1034
  if (!e.states)
1035
1035
  throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);
@@ -1038,44 +1038,44 @@ function te(e, t) {
1038
1038
  throw new Error(`Child state '${t}' does not exist on '${e.id}'`);
1039
1039
  return n;
1040
1040
  }
1041
- function Te(e, t) {
1042
- if (typeof t == "string" && Se(t))
1041
+ function Ie(e, t) {
1042
+ if (typeof t == "string" && xe(t))
1043
1043
  try {
1044
1044
  return e.machine.getStateNodeById(t);
1045
1045
  } catch {
1046
1046
  }
1047
- const n = Xe(t).slice();
1047
+ const n = We(t).slice();
1048
1048
  let s = e;
1049
1049
  for (; n.length; ) {
1050
1050
  const r = n.shift();
1051
1051
  if (!r.length)
1052
1052
  break;
1053
- s = te(s, r);
1053
+ s = ne(s, r);
1054
1054
  }
1055
1055
  return s;
1056
1056
  }
1057
- function _e(e, t) {
1057
+ function Se(e, t) {
1058
1058
  if (typeof t == "string") {
1059
1059
  const r = e.states[t];
1060
1060
  if (!r)
1061
1061
  throw new Error(`State '${t}' does not exist on '${e.id}'`);
1062
1062
  return [e, r];
1063
1063
  }
1064
- const n = Object.keys(t), s = n.map((r) => te(e, r)).filter(Boolean);
1064
+ const n = Object.keys(t), s = n.map((r) => ne(e, r)).filter(Boolean);
1065
1065
  return [e.machine.root, e].concat(s, n.reduce((r, i) => {
1066
- const o = te(e, i);
1066
+ const o = ne(e, i);
1067
1067
  if (!o)
1068
1068
  return r;
1069
- const a = _e(o, t[i]);
1069
+ const a = Se(o, t[i]);
1070
1070
  return r.concat(a);
1071
1071
  }, []));
1072
1072
  }
1073
1073
  function Kn(e, t, n, s) {
1074
- const i = te(e, t).next(n, s);
1074
+ const i = ne(e, t).next(n, s);
1075
1075
  return !i || !i.length ? e.next(n, s) : i;
1076
1076
  }
1077
1077
  function Zn(e, t, n, s) {
1078
- const r = Object.keys(t), i = te(e, r[0]), o = tt(i, t[r[0]], n, s);
1078
+ const r = Object.keys(t), i = ne(e, r[0]), o = st(i, t[r[0]], n, s);
1079
1079
  return !o || !o.length ? e.next(n, s) : o;
1080
1080
  }
1081
1081
  function es(e, t, n, s) {
@@ -1084,18 +1084,18 @@ function es(e, t, n, s) {
1084
1084
  const o = t[i];
1085
1085
  if (!o)
1086
1086
  continue;
1087
- const a = te(e, i), c = tt(a, o, n, s);
1087
+ const a = ne(e, i), c = st(a, o, n, s);
1088
1088
  c && r.push(...c);
1089
1089
  }
1090
1090
  return r.length ? r : e.next(n, s);
1091
1091
  }
1092
- function tt(e, t, n, s) {
1092
+ function st(e, t, n, s) {
1093
1093
  return typeof t == "string" ? Kn(e, t, n, s) : Object.keys(t).length === 1 ? Zn(e, t, n, s) : es(e, t, n, s);
1094
1094
  }
1095
1095
  function ts(e) {
1096
1096
  return Object.keys(e.states).map((t) => e.states[t]).filter((t) => t.type === "history");
1097
1097
  }
1098
- function j(e, t) {
1098
+ function $(e, t) {
1099
1099
  let n = e;
1100
1100
  for (; n.parent && n.parent !== t; )
1101
1101
  n = n.parent;
@@ -1111,14 +1111,14 @@ function ns(e, t) {
1111
1111
  return !0;
1112
1112
  return !1;
1113
1113
  }
1114
- function Wt(e, t, n) {
1114
+ function Zt(e, t, n) {
1115
1115
  const s = /* @__PURE__ */ new Set();
1116
1116
  for (const r of e) {
1117
1117
  let i = !1;
1118
1118
  const o = /* @__PURE__ */ new Set();
1119
1119
  for (const a of s)
1120
- if (ns(Be([r], t, n), Be([a], t, n)))
1121
- if (j(r.source, a.source))
1120
+ if (ns($e([r], t, n), $e([a], t, n)))
1121
+ if ($(r.source, a.source))
1122
1122
  o.add(a);
1123
1123
  else {
1124
1124
  i = !0;
@@ -1134,31 +1134,31 @@ function Wt(e, t, n) {
1134
1134
  }
1135
1135
  function ss(e) {
1136
1136
  const [t, ...n] = e;
1137
- for (const s of de(t, void 0))
1138
- if (n.every((r) => j(r, s)))
1137
+ for (const s of le(t, void 0))
1138
+ if (n.every((r) => $(r, s)))
1139
1139
  return s;
1140
1140
  }
1141
- function nt(e, t) {
1141
+ function rt(e, t) {
1142
1142
  if (!e.target)
1143
1143
  return [];
1144
1144
  const n = /* @__PURE__ */ new Set();
1145
1145
  for (const s of e.target)
1146
- if (G(s))
1146
+ if (z(s))
1147
1147
  if (t[s.id])
1148
1148
  for (const r of t[s.id])
1149
1149
  n.add(r);
1150
1150
  else
1151
- for (const r of nt(Xt(s), t))
1151
+ for (const r of rt(Wt(s), t))
1152
1152
  n.add(r);
1153
1153
  else
1154
1154
  n.add(s);
1155
1155
  return [...n];
1156
1156
  }
1157
- function Kt(e, t) {
1158
- const n = nt(e, t);
1157
+ function en(e, t) {
1158
+ const n = rt(e, t);
1159
1159
  if (!n)
1160
1160
  return;
1161
- if (!e.reenter && n.every((r) => r === e.source || j(r, e.source)))
1161
+ if (!e.reenter && n.every((r) => r === e.source || $(r, e.source)))
1162
1162
  return e.source;
1163
1163
  const s = ss(n.concat(e.source));
1164
1164
  if (s)
@@ -1166,15 +1166,15 @@ function Kt(e, t) {
1166
1166
  if (!e.reenter)
1167
1167
  return e.source.machine.root;
1168
1168
  }
1169
- function Be(e, t, n) {
1169
+ function $e(e, t, n) {
1170
1170
  var r;
1171
1171
  const s = /* @__PURE__ */ new Set();
1172
1172
  for (const i of e)
1173
1173
  if ((r = i.target) != null && r.length) {
1174
- const o = Kt(i, n);
1174
+ const o = en(i, n);
1175
1175
  i.reenter && i.source === o && s.add(o);
1176
1176
  for (const a of t)
1177
- j(a, o) && s.add(a);
1177
+ $(a, o) && s.add(a);
1178
1178
  }
1179
1179
  return [...s];
1180
1180
  }
@@ -1186,18 +1186,18 @@ function rs(e, t) {
1186
1186
  return !1;
1187
1187
  return !0;
1188
1188
  }
1189
- function je(e, t, n, s, r, i) {
1189
+ function Ve(e, t, n, s, r, i) {
1190
1190
  if (!e.length)
1191
1191
  return t;
1192
1192
  const o = new Set(t._nodes);
1193
1193
  let a = t.historyValue;
1194
- const c = Wt(e, o, a);
1194
+ const c = Zt(e, o, a);
1195
1195
  let u = t;
1196
- r || ([u, a] = cs(u, s, n, c, o, a, i)), u = ne(u, s, n, c.flatMap((d) => d.actions), i), u = os(u, s, n, c, o, i, a, r);
1196
+ r || ([u, a] = cs(u, s, n, c, o, a, i)), u = se(u, s, n, c.flatMap((d) => d.actions), i), u = os(u, s, n, c, o, i, a, r);
1197
1197
  const h = [...o];
1198
- u.status === "done" && (u = ne(u, s, n, h.sort((d, f) => f.order - d.order).flatMap((d) => d.exit), i));
1198
+ u.status === "done" && (u = se(u, s, n, h.sort((d, f) => f.order - d.order).flatMap((d) => d.exit), i));
1199
1199
  try {
1200
- return a === t.historyValue && rs(t._nodes, o) ? u : J(u, {
1200
+ return a === t.historyValue && rs(t._nodes, o) ? u : Y(u, {
1201
1201
  _nodes: h,
1202
1202
  historyValue: a
1203
1203
  });
@@ -1208,8 +1208,8 @@ function je(e, t, n, s, r, i) {
1208
1208
  function is(e, t, n, s, r) {
1209
1209
  if (s.output === void 0)
1210
1210
  return;
1211
- const i = Pe(r.id, r.output !== void 0 && r.parent ? Fe(r.output, e.context, t, n.self) : void 0);
1212
- return Fe(s.output, e.context, i, n.self);
1211
+ const i = Be(r.id, r.output !== void 0 && r.parent ? je(r.output, e.context, t, n.self) : void 0);
1212
+ return je(s.output, e.context, i, n.self);
1213
1213
  }
1214
1214
  function os(e, t, n, s, r, i, o, a) {
1215
1215
  let c = e;
@@ -1229,14 +1229,14 @@ function os(e, t, n, s, r, i, o, a) {
1229
1229
  const y = f.initial.actions;
1230
1230
  m.push(...y);
1231
1231
  }
1232
- if (c = ne(c, t, n, m, i, f.invoke.map((y) => y.id)), f.type === "final") {
1232
+ if (c = se(c, t, n, m, i, f.invoke.map((y) => y.id)), f.type === "final") {
1233
1233
  const y = f.parent;
1234
1234
  let v = (y == null ? void 0 : y.type) === "parallel" ? y : y == null ? void 0 : y.parent, S = v || f;
1235
- for ((y == null ? void 0 : y.type) === "compound" && i.push(Pe(y.id, f.output !== void 0 ? Fe(f.output, c.context, t, n.self) : void 0)); (v == null ? void 0 : v.type) === "parallel" && !d.has(v) && et(r, v); )
1236
- d.add(v), i.push(Pe(v.id)), S = v, v = v.parent;
1235
+ for ((y == null ? void 0 : y.type) === "compound" && i.push(Be(y.id, f.output !== void 0 ? je(f.output, c.context, t, n.self) : void 0)); (v == null ? void 0 : v.type) === "parallel" && !d.has(v) && nt(r, v); )
1236
+ d.add(v), i.push(Be(v.id)), S = v, v = v.parent;
1237
1237
  if (v)
1238
1238
  continue;
1239
- c = J(c, {
1239
+ c = Y(c, {
1240
1240
  status: "done",
1241
1241
  output: is(c, t, n, c.machine.root, S)
1242
1242
  });
@@ -1246,70 +1246,70 @@ function os(e, t, n, s, r, i, o, a) {
1246
1246
  }
1247
1247
  function as(e, t, n, s) {
1248
1248
  for (const r of e) {
1249
- const i = Kt(r, t);
1249
+ const i = en(r, t);
1250
1250
  for (const a of r.target || [])
1251
- !G(a) && // if the target is different than the source then it will *definitely* be entered
1251
+ !z(a) && // if the target is different than the source then it will *definitely* be entered
1252
1252
  (r.source !== a || // we know that the domain can't lie within the source
1253
1253
  // 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
1254
1254
  r.source !== i || // reentering transitions always enter the target, even if it's the source itself
1255
- r.reenter) && (s.add(a), n.add(a)), K(a, t, n, s);
1256
- const o = nt(r, t);
1255
+ r.reenter) && (s.add(a), n.add(a)), Z(a, t, n, s);
1256
+ const o = rt(r, t);
1257
1257
  for (const a of o) {
1258
- const c = de(a, i);
1259
- (i == null ? void 0 : i.type) === "parallel" && c.push(i), Zt(s, t, n, c, !r.source.parent && r.reenter ? void 0 : i);
1258
+ const c = le(a, i);
1259
+ (i == null ? void 0 : i.type) === "parallel" && c.push(i), tn(s, t, n, c, !r.source.parent && r.reenter ? void 0 : i);
1260
1260
  }
1261
1261
  }
1262
1262
  }
1263
- function K(e, t, n, s) {
1263
+ function Z(e, t, n, s) {
1264
1264
  var r;
1265
- if (G(e))
1265
+ if (z(e))
1266
1266
  if (t[e.id]) {
1267
1267
  const i = t[e.id];
1268
1268
  for (const o of i)
1269
- s.add(o), K(o, t, n, s);
1269
+ s.add(o), Z(o, t, n, s);
1270
1270
  for (const o of i)
1271
- Ne(o, e.parent, s, t, n);
1271
+ Ce(o, e.parent, s, t, n);
1272
1272
  } else {
1273
- const i = Xt(e);
1273
+ const i = Wt(e);
1274
1274
  for (const o of i.target)
1275
- s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), K(o, t, n, s);
1275
+ s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), Z(o, t, n, s);
1276
1276
  for (const o of i.target)
1277
- Ne(o, e.parent, s, t, n);
1277
+ Ce(o, e.parent, s, t, n);
1278
1278
  }
1279
1279
  else if (e.type === "compound") {
1280
1280
  const [i] = e.initial.target;
1281
- G(i) || (s.add(i), n.add(i)), K(i, t, n, s), Ne(i, e, s, t, n);
1281
+ z(i) || (s.add(i), n.add(i)), Z(i, t, n, s), Ce(i, e, s, t, n);
1282
1282
  } else if (e.type === "parallel")
1283
- for (const i of ee(e).filter((o) => !G(o)))
1284
- [...s].some((o) => j(o, i)) || (G(i) || (s.add(i), n.add(i)), K(i, t, n, s));
1283
+ for (const i of te(e).filter((o) => !z(o)))
1284
+ [...s].some((o) => $(o, i)) || (z(i) || (s.add(i), n.add(i)), Z(i, t, n, s));
1285
1285
  }
1286
- function Zt(e, t, n, s, r) {
1286
+ function tn(e, t, n, s, r) {
1287
1287
  for (const i of s)
1288
- if ((!r || j(i, r)) && e.add(i), i.type === "parallel")
1289
- for (const o of ee(i).filter((a) => !G(a)))
1290
- [...e].some((a) => j(a, o)) || (e.add(o), K(o, t, n, e));
1288
+ if ((!r || $(i, r)) && e.add(i), i.type === "parallel")
1289
+ for (const o of te(i).filter((a) => !z(a)))
1290
+ [...e].some((a) => $(a, o)) || (e.add(o), Z(o, t, n, e));
1291
1291
  }
1292
- function Ne(e, t, n, s, r) {
1293
- Zt(n, s, r, de(e, t));
1292
+ function Ce(e, t, n, s, r) {
1293
+ tn(n, s, r, le(e, t));
1294
1294
  }
1295
1295
  function cs(e, t, n, s, r, i, o) {
1296
1296
  let a = e;
1297
- const c = Be(s, r, i);
1297
+ const c = $e(s, r, i);
1298
1298
  c.sort((h, d) => d.order - h.order);
1299
1299
  let u;
1300
1300
  for (const h of c)
1301
1301
  for (const d of ts(h)) {
1302
1302
  let f;
1303
- d.history === "deep" ? f = (m) => Ze(m) && j(m, h) : f = (m) => m.parent === h, u ?? (u = {
1303
+ d.history === "deep" ? f = (m) => tt(m) && $(m, h) : f = (m) => m.parent === h, u ?? (u = {
1304
1304
  ...i
1305
1305
  }), u[d.id] = Array.from(r).filter(f);
1306
1306
  }
1307
1307
  for (const h of c)
1308
- a = ne(a, t, n, [...h.exit, ...h.invoke.map((d) => Gt(d.id))], o), r.delete(h);
1308
+ a = se(a, t, n, [...h.exit, ...h.invoke.map((d) => Jt(d.id))], o), r.delete(h);
1309
1309
  return [a, u || i];
1310
1310
  }
1311
- let mt = !1;
1312
- function en(e, t, n, s, r, i) {
1311
+ let Et = !1;
1312
+ function nn(e, t, n, s, r, i) {
1313
1313
  const {
1314
1314
  machine: o
1315
1315
  } = e;
@@ -1325,9 +1325,9 @@ function en(e, t, n, s, r, i) {
1325
1325
  }
1326
1326
  });
1327
1327
  try {
1328
- mt = h, h(d, f);
1328
+ Et = h, h(d, f);
1329
1329
  } finally {
1330
- mt = !1;
1330
+ Et = !1;
1331
1331
  }
1332
1332
  };
1333
1333
  const u = typeof c == "function", h = u ? c : (
@@ -1362,12 +1362,12 @@ function en(e, t, n, s, r, i) {
1362
1362
  // this holds all params
1363
1363
  r
1364
1364
  );
1365
- a = v, "retryResolve" in y && (i == null || i.push([y, S])), "execute" in y && (n.self._processingStatus === C.Running ? y.execute(n, S) : n.defer(y.execute.bind(null, n, S))), x && (a = en(a, t, n, x, r, i));
1365
+ a = v, "retryResolve" in y && (i == null || i.push([y, S])), "execute" in y && (n.self._processingStatus === C.Running ? y.execute(n, S) : n.defer(y.execute.bind(null, n, S))), x && (a = nn(a, t, n, x, r, i));
1366
1366
  }
1367
1367
  return a;
1368
1368
  }
1369
- function ne(e, t, n, s, r, i) {
1370
- const o = i ? [] : void 0, a = en(e, t, n, s, {
1369
+ function se(e, t, n, s, r, i) {
1370
+ const o = i ? [] : void 0, a = nn(e, t, n, s, {
1371
1371
  internalQueue: r,
1372
1372
  deferredActorIds: i
1373
1373
  }, o);
@@ -1375,7 +1375,7 @@ function ne(e, t, n, s, r, i) {
1375
1375
  c.retryResolve(n, a, u);
1376
1376
  }), a;
1377
1377
  }
1378
- function ke(e, t, n, s = []) {
1378
+ function De(e, t, n, s = []) {
1379
1379
  let r = e;
1380
1380
  const i = [];
1381
1381
  function o(u, h, d) {
@@ -1387,25 +1387,25 @@ function ke(e, t, n, s = []) {
1387
1387
  _transitions: d
1388
1388
  }), i.push(u);
1389
1389
  }
1390
- if (t.type === ce)
1391
- return r = J(gt(r, t, n), {
1390
+ if (t.type === ue)
1391
+ return r = Y(vt(r, t, n), {
1392
1392
  status: "stopped"
1393
1393
  }), o(r, t, []), {
1394
1394
  snapshot: r,
1395
1395
  microstates: i
1396
1396
  };
1397
1397
  let a = t;
1398
- if (a.type !== Pt) {
1399
- const u = a, h = Ln(u), d = Et(u, r);
1398
+ if (a.type !== Bt) {
1399
+ const u = a, h = Ln(u), d = Tt(u, r);
1400
1400
  if (h && !d.length)
1401
- return r = J(e, {
1401
+ return r = Y(e, {
1402
1402
  status: "error",
1403
1403
  error: u.error
1404
1404
  }), o(r, u, []), {
1405
1405
  snapshot: r,
1406
1406
  microstates: i
1407
1407
  };
1408
- r = je(
1408
+ r = Ve(
1409
1409
  d,
1410
1410
  e,
1411
1411
  n,
@@ -1422,44 +1422,44 @@ function ke(e, t, n, s = []) {
1422
1422
  if (!u.length) {
1423
1423
  if (!s.length)
1424
1424
  break;
1425
- a = s.shift(), u = Et(a, r);
1425
+ a = s.shift(), u = Tt(a, r);
1426
1426
  }
1427
- r = je(u, r, n, a, !1, s), c = r !== h, o(r, a, u);
1427
+ r = Ve(u, r, n, a, !1, s), c = r !== h, o(r, a, u);
1428
1428
  }
1429
- return r.status !== "active" && gt(r, a, n), {
1429
+ return r.status !== "active" && vt(r, a, n), {
1430
1430
  snapshot: r,
1431
1431
  microstates: i
1432
1432
  };
1433
1433
  }
1434
- function gt(e, t, n) {
1435
- return ne(e, t, n, Object.values(e.children).map((s) => Gt(s)), []);
1434
+ function vt(e, t, n) {
1435
+ return se(e, t, n, Object.values(e.children).map((s) => Jt(s)), []);
1436
1436
  }
1437
- function Et(e, t) {
1437
+ function Tt(e, t) {
1438
1438
  return t.machine.getTransitionData(t, e);
1439
1439
  }
1440
1440
  function us(e, t) {
1441
- const n = /* @__PURE__ */ new Set(), s = e._nodes.filter(Ze);
1441
+ const n = /* @__PURE__ */ new Set(), s = e._nodes.filter(tt);
1442
1442
  for (const r of s)
1443
1443
  e:
1444
- for (const i of [r].concat(de(r, void 0)))
1444
+ for (const i of [r].concat(le(r, void 0)))
1445
1445
  if (i.always) {
1446
1446
  for (const o of i.always)
1447
- if (o.guard === void 0 || Ke(o.guard, e.context, t, e)) {
1447
+ if (o.guard === void 0 || et(o.guard, e.context, t, e)) {
1448
1448
  n.add(o);
1449
1449
  break e;
1450
1450
  }
1451
1451
  }
1452
- return Wt(Array.from(n), new Set(e._nodes), e.historyValue);
1452
+ return Zt(Array.from(n), new Set(e._nodes), e.historyValue);
1453
1453
  }
1454
1454
  function ds(e, t) {
1455
- const n = ve(_e(e, t));
1456
- return Yt(e, [...n]);
1455
+ const n = _e(Se(e, t));
1456
+ return Qt(e, [...n]);
1457
1457
  }
1458
1458
  function ls(e) {
1459
1459
  return !!e && typeof e == "object" && "machine" in e && "value" in e;
1460
1460
  }
1461
1461
  const hs = function(t) {
1462
- return jt(t, this.value);
1462
+ return Vt(t, this.value);
1463
1463
  }, fs = function(t) {
1464
1464
  return this.tags.has(t);
1465
1465
  }, ps = function(t) {
@@ -1485,7 +1485,7 @@ const hs = function(t) {
1485
1485
  }, ms = function() {
1486
1486
  return this._nodes.reduce((t, n) => (n.meta !== void 0 && (t[n.id] = n.meta), t), {});
1487
1487
  };
1488
- function ye(e, t) {
1488
+ function ge(e, t) {
1489
1489
  return {
1490
1490
  status: e.status,
1491
1491
  output: e.output,
@@ -1493,7 +1493,7 @@ function ye(e, t) {
1493
1493
  machine: t,
1494
1494
  context: e.context,
1495
1495
  _nodes: e._nodes,
1496
- value: Yt(t.root, e._nodes),
1496
+ value: Qt(t.root, e._nodes),
1497
1497
  tags: new Set(e._nodes.flatMap((n) => n.tags)),
1498
1498
  children: e.children,
1499
1499
  historyValue: e.historyValue || {},
@@ -1504,8 +1504,8 @@ function ye(e, t) {
1504
1504
  toJSON: ys
1505
1505
  };
1506
1506
  }
1507
- function J(e, t = {}) {
1508
- return ye({
1507
+ function Y(e, t = {}) {
1508
+ return ge({
1509
1509
  ...e,
1510
1510
  ...t
1511
1511
  }, e.machine);
@@ -1535,11 +1535,11 @@ function gs(e, t) {
1535
1535
  }
1536
1536
  return {
1537
1537
  ...f,
1538
- context: tn(o),
1538
+ context: sn(o),
1539
1539
  children: m
1540
1540
  };
1541
1541
  }
1542
- function tn(e) {
1542
+ function sn(e) {
1543
1543
  let t;
1544
1544
  for (const n in e) {
1545
1545
  const s = e[n];
@@ -1548,11 +1548,11 @@ function tn(e) {
1548
1548
  t ?? (t = Array.isArray(e) ? e.slice() : {
1549
1549
  ...e
1550
1550
  }), t[n] = {
1551
- xstate$$type: We,
1551
+ xstate$$type: Ze,
1552
1552
  id: s.id
1553
1553
  };
1554
1554
  else {
1555
- const r = tn(s);
1555
+ const r = sn(s);
1556
1556
  r !== s && (t ?? (t = Array.isArray(e) ? e.slice() : {
1557
1557
  ...e
1558
1558
  }), t[n] = r);
@@ -1602,7 +1602,7 @@ function Ts(e, t) {
1602
1602
  }
1603
1603
  return n.type = "xstate.raise", n.event = e, n.id = t == null ? void 0 : t.id, n.delay = t == null ? void 0 : t.delay, n.resolve = Es, n.execute = vs, n;
1604
1604
  }
1605
- const vt = /* @__PURE__ */ new WeakMap();
1605
+ const _t = /* @__PURE__ */ new WeakMap();
1606
1606
  function _s(e) {
1607
1607
  return {
1608
1608
  config: e,
@@ -1614,7 +1614,7 @@ function _s(e) {
1614
1614
  receivers: void 0,
1615
1615
  dispose: void 0
1616
1616
  };
1617
- vt.set(r, o), o.dispose = e({
1617
+ _t.set(r, o), o.dispose = e({
1618
1618
  input: n.input,
1619
1619
  system: i,
1620
1620
  self: r,
@@ -1628,8 +1628,8 @@ function _s(e) {
1628
1628
  },
1629
1629
  transition: (n, s, r) => {
1630
1630
  var o, a;
1631
- const i = vt.get(r.self);
1632
- return s.type === ce ? (n = {
1631
+ const i = _t.get(r.self);
1632
+ return s.type === ue ? (n = {
1633
1633
  ...n,
1634
1634
  status: "stopped",
1635
1635
  error: void 0
@@ -1645,8 +1645,8 @@ function _s(e) {
1645
1645
  restoreSnapshot: (n) => n
1646
1646
  };
1647
1647
  }
1648
- const Tt = "xstate.promise.resolve", _t = "xstate.promise.reject", fe = /* @__PURE__ */ new WeakMap();
1649
- function z(e) {
1648
+ const It = "xstate.promise.resolve", St = "xstate.promise.reject", ye = /* @__PURE__ */ new WeakMap();
1649
+ function J(e) {
1650
1650
  return {
1651
1651
  config: e,
1652
1652
  transition: (n, s, r) => {
@@ -1654,7 +1654,7 @@ function z(e) {
1654
1654
  if (n.status !== "active")
1655
1655
  return n;
1656
1656
  switch (s.type) {
1657
- case Tt: {
1657
+ case It: {
1658
1658
  const o = s.data;
1659
1659
  return {
1660
1660
  ...n,
@@ -1663,15 +1663,15 @@ function z(e) {
1663
1663
  input: void 0
1664
1664
  };
1665
1665
  }
1666
- case _t:
1666
+ case St:
1667
1667
  return {
1668
1668
  ...n,
1669
1669
  status: "error",
1670
1670
  error: s.data,
1671
1671
  input: void 0
1672
1672
  };
1673
- case ce:
1674
- return (i = fe.get(r.self)) == null || i.abort(), {
1673
+ case ue:
1674
+ return (i = ye.get(r.self)) == null || i.abort(), {
1675
1675
  ...n,
1676
1676
  status: "stopped",
1677
1677
  input: void 0
@@ -1687,19 +1687,19 @@ function z(e) {
1687
1687
  if (n.status !== "active")
1688
1688
  return;
1689
1689
  const i = new AbortController();
1690
- fe.set(s, i), Promise.resolve(e({
1690
+ ye.set(s, i), Promise.resolve(e({
1691
1691
  input: n.input,
1692
1692
  system: r,
1693
1693
  self: s,
1694
1694
  signal: i.signal
1695
1695
  })).then((a) => {
1696
- s.getSnapshot().status === "active" && (fe.delete(s), r._relay(s, s, {
1697
- type: Tt,
1696
+ s.getSnapshot().status === "active" && (ye.delete(s), r._relay(s, s, {
1697
+ type: It,
1698
1698
  data: a
1699
1699
  }));
1700
1700
  }, (a) => {
1701
- s.getSnapshot().status === "active" && (fe.delete(s), r._relay(s, s, {
1702
- type: _t,
1701
+ s.getSnapshot().status === "active" && (ye.delete(s), r._relay(s, s, {
1702
+ type: St,
1703
1703
  data: a
1704
1704
  }));
1705
1705
  });
@@ -1724,10 +1724,10 @@ function Is(e, {
1724
1724
  input: u
1725
1725
  } = a;
1726
1726
  if (typeof o == "string") {
1727
- const h = Qe(t, o);
1727
+ const h = Ke(t, o);
1728
1728
  if (!h)
1729
1729
  throw new Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);
1730
- const d = B(h, {
1730
+ const d = j(h, {
1731
1731
  id: a.id,
1732
1732
  parent: e.self,
1733
1733
  syncSnapshot: a.syncSnapshot,
@@ -1741,7 +1741,7 @@ function Is(e, {
1741
1741
  });
1742
1742
  return r[d.id] = d, d;
1743
1743
  } else
1744
- return B(o, {
1744
+ return j(o, {
1745
1745
  id: a.id,
1746
1746
  parent: e.self,
1747
1747
  syncSnapshot: a.syncSnapshot,
@@ -1778,7 +1778,7 @@ function Ss(e, t, n, s, {
1778
1778
  a[u] = typeof h == "function" ? h(o, s) : h;
1779
1779
  }
1780
1780
  const c = Object.assign({}, t.context, a);
1781
- return [J(t, {
1781
+ return [Y(t, {
1782
1782
  context: c,
1783
1783
  children: Object.keys(i).length ? {
1784
1784
  ...t.children,
@@ -1804,12 +1804,12 @@ function xs(e, {
1804
1804
  }) {
1805
1805
  e.defer(() => e.emit(t));
1806
1806
  }
1807
- function Ce(e) {
1807
+ function Re(e) {
1808
1808
  function t(n, s) {
1809
1809
  }
1810
1810
  return t.type = "xstate.emit", t.event = e, t.resolve = As, t.execute = xs, t;
1811
1811
  }
1812
- let It = /* @__PURE__ */ function(e) {
1812
+ let At = /* @__PURE__ */ function(e) {
1813
1813
  return e.Parent = "#_parent", e.Internal = "#_internal", e;
1814
1814
  }({});
1815
1815
  function ws(e, t, n, s, {
@@ -1832,7 +1832,7 @@ function ws(e, t, n, s, {
1832
1832
  const f = typeof r == "function" ? r(n, s) : r;
1833
1833
  let m;
1834
1834
  if (typeof f == "string") {
1835
- if (f === It.Parent ? m = e.self._parent : f === It.Internal ? m = e.self : f.startsWith("#_") ? m = t.children[f.slice(2)] : m = (y = c.deferredActorIds) != null && y.includes(f) ? f : t.children[f], !m)
1835
+ if (f === At.Parent ? m = e.self._parent : f === At.Internal ? m = e.self : f.startsWith("#_") ? m = t.children[f.slice(2)] : m = (y = c.deferredActorIds) != null && y.includes(f) ? f : t.children[f], !m)
1836
1836
  throw new Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`);
1837
1837
  } else
1838
1838
  m = f || e.self;
@@ -1863,42 +1863,42 @@ function Os(e, t) {
1863
1863
  // at this point, in a deferred task, it should already be mutated by retryResolveSendTo
1864
1864
  // if it initially started as a string
1865
1865
  n,
1866
- s.type === Nn ? Ft(e.self.id, s.data) : s
1866
+ s.type === Nn ? jt(e.self.id, s.data) : s
1867
1867
  );
1868
1868
  });
1869
1869
  }
1870
- function St(e, t, n) {
1870
+ function xt(e, t, n) {
1871
1871
  function s(r, i) {
1872
1872
  }
1873
1873
  return s.type = "xsnapshot.sendTo", s.to = e, s.event = t, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = ws, s.retryResolve = bs, s.execute = Os, s;
1874
1874
  }
1875
- const At = /* @__PURE__ */ new WeakMap();
1876
- function X(e, t, n) {
1877
- let s = At.get(e);
1875
+ const wt = /* @__PURE__ */ new WeakMap();
1876
+ function Q(e, t, n) {
1877
+ let s = wt.get(e);
1878
1878
  return s ? t in s || (s[t] = n()) : (s = {
1879
1879
  [t]: n()
1880
- }, At.set(e, s)), s[t];
1880
+ }, wt.set(e, s)), s[t];
1881
1881
  }
1882
- const Ns = {}, ie = (e) => typeof e == "string" ? {
1882
+ const Ns = {}, oe = (e) => typeof e == "string" ? {
1883
1883
  type: e
1884
1884
  } : typeof e == "function" ? "resolve" in e ? {
1885
1885
  type: e.type
1886
1886
  } : {
1887
1887
  type: e.name
1888
1888
  } : e;
1889
- class st {
1889
+ class it {
1890
1890
  constructor(t, n) {
1891
- if (this.config = t, 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(Lt), 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 ? ht(this.config.states, (s, r) => new st(s, {
1891
+ if (this.config = t, 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(Pt), 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 ? pt(this.config.states, (s, r) => new it(s, {
1892
1892
  _parent: this,
1893
1893
  _key: r,
1894
1894
  _machine: this.machine
1895
1895
  })) : Ns, this.type === "compound" && !this.config.initial)
1896
1896
  throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);
1897
- this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry = F(this.config.entry).slice(), this.exit = F(this.config.exit).slice(), this.meta = this.config.meta, this.output = this.type === "final" || !this.parent ? this.config.output : void 0, this.tags = F(t.tags).slice();
1897
+ this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry = B(this.config.entry).slice(), this.exit = B(this.config.exit).slice(), this.meta = this.config.meta, this.output = this.type === "final" || !this.parent ? this.config.output : void 0, this.tags = B(t.tags).slice();
1898
1898
  }
1899
1899
  /** @internal */
1900
1900
  _initialize() {
1901
- this.transitions = Xn(this), this.config.always && (this.always = W(this.config.always).map((t) => H(this, Ut, t))), Object.keys(this.states).forEach((t) => {
1901
+ this.transitions = Xn(this), this.config.always && (this.always = K(this.config.always).map((t) => G(this, Ft, t))), Object.keys(this.states).forEach((t) => {
1902
1902
  this.states[t]._initialize();
1903
1903
  });
1904
1904
  }
@@ -1914,25 +1914,25 @@ class st {
1914
1914
  initial: this.initial ? {
1915
1915
  target: this.initial.target,
1916
1916
  source: this,
1917
- actions: this.initial.actions.map(ie),
1917
+ actions: this.initial.actions.map(oe),
1918
1918
  eventType: null,
1919
1919
  reenter: !1,
1920
1920
  toJSON: () => ({
1921
1921
  target: this.initial.target.map((t) => `#${t.id}`),
1922
1922
  source: `#${this.id}`,
1923
- actions: this.initial.actions.map(ie),
1923
+ actions: this.initial.actions.map(oe),
1924
1924
  eventType: null
1925
1925
  })
1926
1926
  } : void 0,
1927
1927
  history: this.history,
1928
- states: ht(this.states, (t) => t.definition),
1928
+ states: pt(this.states, (t) => t.definition),
1929
1929
  on: this.on,
1930
1930
  transitions: [...this.transitions.values()].flat().map((t) => ({
1931
1931
  ...t,
1932
- actions: t.actions.map(ie)
1932
+ actions: t.actions.map(oe)
1933
1933
  })),
1934
- entry: this.entry.map(ie),
1935
- exit: this.exit.map(ie),
1934
+ entry: this.entry.map(oe),
1935
+ exit: this.exit.map(oe),
1936
1936
  meta: this.meta,
1937
1937
  order: this.order || -1,
1938
1938
  output: this.output,
@@ -1949,11 +1949,11 @@ class st {
1949
1949
  * The logic invoked as actors by this state node.
1950
1950
  */
1951
1951
  get invoke() {
1952
- return X(this, "invoke", () => F(this.config.invoke).map((t, n) => {
1952
+ return Q(this, "invoke", () => B(this.config.invoke).map((t, n) => {
1953
1953
  const {
1954
1954
  src: s,
1955
1955
  systemId: r
1956
- } = t, i = t.id ?? pt(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${pt(this.id, n)}`;
1956
+ } = t, i = t.id ?? mt(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${mt(this.id, n)}`;
1957
1957
  return {
1958
1958
  ...t,
1959
1959
  src: o,
@@ -1979,26 +1979,26 @@ class st {
1979
1979
  * The mapping of events to transitions.
1980
1980
  */
1981
1981
  get on() {
1982
- return X(this, "on", () => [...this.transitions].flatMap(([n, s]) => s.map((r) => [n, r])).reduce((n, [s, r]) => (n[s] = n[s] || [], n[s].push(r), n), {}));
1982
+ return Q(this, "on", () => [...this.transitions].flatMap(([n, s]) => s.map((r) => [n, r])).reduce((n, [s, r]) => (n[s] = n[s] || [], n[s].push(r), n), {}));
1983
1983
  }
1984
1984
  get after() {
1985
- return X(this, "delayedTransitions", () => Yn(this));
1985
+ return Q(this, "delayedTransitions", () => Yn(this));
1986
1986
  }
1987
1987
  get initial() {
1988
- return X(this, "initial", () => Qn(this, this.config.initial));
1988
+ return Q(this, "initial", () => Qn(this, this.config.initial));
1989
1989
  }
1990
1990
  /** @internal */
1991
1991
  next(t, n) {
1992
1992
  const s = n.type, r = [];
1993
1993
  let i;
1994
- const o = X(this, `candidates-${s}`, () => Jn(this, s));
1994
+ const o = Q(this, `candidates-${s}`, () => Jn(this, s));
1995
1995
  for (const a of o) {
1996
1996
  const {
1997
1997
  guard: c
1998
1998
  } = a, u = t.context;
1999
1999
  let h = !1;
2000
2000
  try {
2001
- h = !c || Ke(c, u, n, t);
2001
+ h = !c || et(c, u, n, t);
2002
2002
  } catch (d) {
2003
2003
  const f = typeof c == "string" ? c : typeof c == "object" ? c.type : void 0;
2004
2004
  throw new Error(`Unable to evaluate guard ${f ? `'${f}' ` : ""}in transition for event '${s}' in state node '${this.id}':
@@ -2015,7 +2015,7 @@ ${d.message}`);
2015
2015
  * All the event types accepted by this state node and its descendants.
2016
2016
  */
2017
2017
  get events() {
2018
- return X(this, "events", () => {
2018
+ return Q(this, "events", () => {
2019
2019
  const {
2020
2020
  states: t
2021
2021
  } = this, n = new Set(this.ownEvents);
@@ -2040,14 +2040,14 @@ ${d.message}`);
2040
2040
  }
2041
2041
  }
2042
2042
  const ks = "#";
2043
- class rt {
2043
+ class ot {
2044
2044
  constructor(t, n) {
2045
2045
  this.config = t, 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 = t.id || "(machine)", this.implementations = {
2046
2046
  actors: (n == null ? void 0 : n.actors) ?? {},
2047
2047
  actions: (n == null ? void 0 : n.actions) ?? {},
2048
2048
  delays: (n == null ? void 0 : n.delays) ?? {},
2049
2049
  guards: (n == null ? void 0 : n.guards) ?? {}
2050
- }, 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 st(t, {
2050
+ }, 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 it(t, {
2051
2051
  _key: this.id,
2052
2052
  _machine: this
2053
2053
  }), this.root._initialize(), this.states = this.root.states, this.events = this.root.events;
@@ -2068,7 +2068,7 @@ class rt {
2068
2068
  actors: r,
2069
2069
  delays: i
2070
2070
  } = this.implementations;
2071
- return new rt(this.config, {
2071
+ return new ot(this.config, {
2072
2072
  actions: {
2073
2073
  ...n,
2074
2074
  ...t.actions
@@ -2088,12 +2088,12 @@ class rt {
2088
2088
  });
2089
2089
  }
2090
2090
  resolveState(t) {
2091
- const n = ds(this.root, t.value), s = ve(_e(this.root, n));
2092
- return ye({
2091
+ const n = ds(this.root, t.value), s = _e(Se(this.root, n));
2092
+ return ge({
2093
2093
  _nodes: [...s],
2094
2094
  context: t.context || {},
2095
2095
  children: {},
2096
- status: et(s, this.root) ? "done" : t.status || "active",
2096
+ status: nt(s, this.root) ? "done" : t.status || "active",
2097
2097
  output: t.output,
2098
2098
  error: t.error,
2099
2099
  historyValue: t.historyValue
@@ -2107,7 +2107,7 @@ class rt {
2107
2107
  * @param event The received event
2108
2108
  */
2109
2109
  transition(t, n, s) {
2110
- return ke(t, n, s).snapshot;
2110
+ return De(t, n, s).snapshot;
2111
2111
  }
2112
2112
  /**
2113
2113
  * Determines the next state given the current `state` and `event`.
@@ -2117,10 +2117,10 @@ class rt {
2117
2117
  * @param event The received event
2118
2118
  */
2119
2119
  microstep(t, n, s) {
2120
- return ke(t, n, s).microstates;
2120
+ return De(t, n, s).microstates;
2121
2121
  }
2122
2122
  getTransitionData(t, n) {
2123
- return tt(this.root, t.value, t, n) || [];
2123
+ return st(this.root, t.value, t, n) || [];
2124
2124
  }
2125
2125
  /**
2126
2126
  * The initial state _before_ evaluating any microsteps.
@@ -2129,13 +2129,13 @@ class rt {
2129
2129
  getPreInitialState(t, n, s) {
2130
2130
  const {
2131
2131
  context: r
2132
- } = this.config, i = ye({
2132
+ } = this.config, i = ge({
2133
2133
  context: typeof r != "function" && r ? r : {},
2134
2134
  _nodes: [this.root],
2135
2135
  children: {},
2136
2136
  status: "active"
2137
2137
  }, this);
2138
- return typeof r == "function" ? ne(i, n, t, [D(({
2138
+ return typeof r == "function" ? se(i, n, t, [D(({
2139
2139
  spawn: a,
2140
2140
  event: c,
2141
2141
  self: u
@@ -2149,8 +2149,8 @@ class rt {
2149
2149
  * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
2150
2150
  */
2151
2151
  getInitialSnapshot(t, n) {
2152
- const s = Bt(n), r = [], i = this.getPreInitialState(t, s, r), o = je([{
2153
- target: [...Qt(this.root)],
2152
+ const s = $t(n), r = [], i = this.getPreInitialState(t, s, r), o = Ve([{
2153
+ target: [...Kt(this.root)],
2154
2154
  source: this.root,
2155
2155
  reenter: !0,
2156
2156
  actions: [],
@@ -2159,7 +2159,7 @@ class rt {
2159
2159
  // TODO: fix
2160
2160
  }], i, t, s, !0, r), {
2161
2161
  snapshot: a
2162
- } = ke(o, s, t, r);
2162
+ } = De(o, s, t, r);
2163
2163
  return a;
2164
2164
  }
2165
2165
  start(t) {
@@ -2168,10 +2168,10 @@ class rt {
2168
2168
  });
2169
2169
  }
2170
2170
  getStateNodeById(t) {
2171
- const n = Xe(t), s = n.slice(1), r = Se(n[0]) ? n[0].slice(ks.length) : n[0], i = this.idMap.get(r);
2171
+ const n = We(t), s = n.slice(1), r = xe(n[0]) ? n[0].slice(ks.length) : n[0], i = this.idMap.get(r);
2172
2172
  if (!i)
2173
2173
  throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
2174
- return Te(i, s);
2174
+ return Ie(i, s);
2175
2175
  }
2176
2176
  get definition() {
2177
2177
  return this.root.definition;
@@ -2185,10 +2185,10 @@ class rt {
2185
2185
  restoreSnapshot(t, n) {
2186
2186
  const s = {}, r = t.children;
2187
2187
  Object.keys(r).forEach((c) => {
2188
- const u = r[c], h = u.snapshot, d = u.src, f = typeof d == "string" ? Qe(this, d) : d;
2188
+ const u = r[c], h = u.snapshot, d = u.src, f = typeof d == "string" ? Ke(this, d) : d;
2189
2189
  if (!f)
2190
2190
  return;
2191
- const m = B(f, {
2191
+ const m = j(f, {
2192
2192
  id: c,
2193
2193
  parent: n.self,
2194
2194
  syncSnapshot: u.syncSnapshot,
@@ -2198,10 +2198,10 @@ class rt {
2198
2198
  });
2199
2199
  s[c] = m;
2200
2200
  });
2201
- const i = ye({
2201
+ const i = ge({
2202
2202
  ...t,
2203
2203
  children: s,
2204
- _nodes: Array.from(ve(_e(this.root, t.value)))
2204
+ _nodes: Array.from(_e(Se(this.root, t.value)))
2205
2205
  }, this);
2206
2206
  let o = /* @__PURE__ */ new Set();
2207
2207
  function a(c, u) {
@@ -2210,7 +2210,7 @@ class rt {
2210
2210
  for (let h in c) {
2211
2211
  const d = c[h];
2212
2212
  if (d && typeof d == "object") {
2213
- if ("xstate$$type" in d && d.xstate$$type === We) {
2213
+ if ("xstate$$type" in d && d.xstate$$type === Ze) {
2214
2214
  c[h] = u[d.id];
2215
2215
  continue;
2216
2216
  }
@@ -2223,9 +2223,9 @@ class rt {
2223
2223
  }
2224
2224
  }
2225
2225
  function Cs(e, t) {
2226
- return new rt(e, t);
2226
+ return new ot(e, t);
2227
2227
  }
2228
- function Ae({
2228
+ function we({
2229
2229
  schemas: e,
2230
2230
  actors: t,
2231
2231
  actions: n,
@@ -2244,14 +2244,14 @@ function Ae({
2244
2244
  })
2245
2245
  };
2246
2246
  }
2247
- async function De(e, t) {
2247
+ async function Me(e, t) {
2248
2248
  const n = await fetch(e, t);
2249
2249
  return n.status === 200 ? n.json() : Promise.resolve({
2250
2250
  message: n.statusText,
2251
2251
  success: !1
2252
2252
  });
2253
2253
  }
2254
- const xt = Ae({
2254
+ const bt = we({
2255
2255
  types: {
2256
2256
  context: {},
2257
2257
  events: {},
@@ -2319,13 +2319,13 @@ const xt = Ae({
2319
2319
  // },
2320
2320
  },
2321
2321
  actors: {
2322
- refreshAccessToken: z(async ({ input: e }) => {
2322
+ refreshAccessToken: J(async ({ input: e }) => {
2323
2323
  let t;
2324
2324
  if (typeof window > "u") {
2325
2325
  if (e.context.refreshToken === "")
2326
2326
  throw new Error("Unauthorized.");
2327
2327
  try {
2328
- const s = await De(
2328
+ const s = await Me(
2329
2329
  e.context.endpoints.ssrRefresh,
2330
2330
  {
2331
2331
  method: "POST",
@@ -2349,7 +2349,7 @@ const xt = Ae({
2349
2349
  throw console.log(n), new Error("Could not complete refresh request (server)");
2350
2350
  }
2351
2351
  } else {
2352
- t = await De(
2352
+ t = await Me(
2353
2353
  e.context.endpoints.refresh,
2354
2354
  {
2355
2355
  method: "POST",
@@ -2377,9 +2377,9 @@ const xt = Ae({
2377
2377
  };
2378
2378
  }
2379
2379
  }),
2380
- authenticate: z(async ({ input: e }) => {
2380
+ authenticate: J(async ({ input: e }) => {
2381
2381
  var s;
2382
- const n = await De(
2382
+ const n = await Me(
2383
2383
  e.context.endpoints.login,
2384
2384
  {
2385
2385
  method: "POST",
@@ -2406,7 +2406,7 @@ const xt = Ae({
2406
2406
  accessToken: n.accessToken
2407
2407
  };
2408
2408
  }),
2409
- unauthenticate: z(async ({ input: e }) => (await fetch(e.context.endpoints.logout, {
2409
+ unauthenticate: J(async ({ input: e }) => (await fetch(e.context.endpoints.logout, {
2410
2410
  method: "POST",
2411
2411
  mode: "cors",
2412
2412
  credentials: "include",
@@ -2548,13 +2548,13 @@ const xt = Ae({
2548
2548
  // },
2549
2549
  // },
2550
2550
  }
2551
- }), nn = Je(
2551
+ }), rn = Xe(
2552
2552
  {}
2553
2553
  ), Xr = () => {
2554
- const e = Ye(nn), [t, n] = Mt(
2554
+ const e = Qe(rn), [t, n] = Lt(
2555
2555
  typeof window < "u" && e.getSnapshot().value === "loggedIn"
2556
2556
  );
2557
- return qt(() => {
2557
+ return Ut(() => {
2558
2558
  if (typeof window > "u")
2559
2559
  return;
2560
2560
  const s = e.subscribe((r) => {
@@ -2569,14 +2569,14 @@ const xt = Ae({
2569
2569
  endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
2570
2570
  }) => typeof window < "u" ? (console.warn(
2571
2571
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
2572
- ), B(xt, {
2572
+ ), j(bt, {
2573
2573
  inspect: t.inspect,
2574
2574
  input: {
2575
2575
  initialContext: {
2576
2576
  endpoints: t.endpoints
2577
2577
  }
2578
2578
  }
2579
- }).start()) : B(xt, {
2579
+ }).start()) : j(bt, {
2580
2580
  input: {
2581
2581
  initialContext: {
2582
2582
  endpoints: t.endpoints,
@@ -2586,10 +2586,10 @@ const xt = Ae({
2586
2586
  inspect: t.inspect
2587
2587
  }).start();
2588
2588
  function Wr({ actor: e, children: t }) {
2589
- return /* @__PURE__ */ ze(nn.Provider, { value: e, children: t });
2589
+ return /* @__PURE__ */ Ye(rn.Provider, { value: e, children: t });
2590
2590
  }
2591
2591
  let Ds = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
2592
- const Rs = Ae({
2592
+ const Rs = we({
2593
2593
  actors: {
2594
2594
  tick: _s(
2595
2595
  ({ sendBack: e, input: t }) => {
@@ -2667,7 +2667,7 @@ const Rs = Ae({
2667
2667
  type: "final"
2668
2668
  }
2669
2669
  }
2670
- }), Kr = Ae({
2670
+ }), Kr = we({
2671
2671
  actors: {
2672
2672
  timer: Rs
2673
2673
  },
@@ -2759,11 +2759,11 @@ const Rs = Ae({
2759
2759
  target: "idle"
2760
2760
  },
2761
2761
  RESUME_TIMER: {
2762
- actions: St("timer", { type: "RESUME_TIMER" })
2762
+ actions: xt("timer", { type: "RESUME_TIMER" })
2763
2763
  // cond: (context) => context.duration > 0,
2764
2764
  },
2765
2765
  PAUSE_TIMER: {
2766
- actions: St("timer", { type: "PAUSE_TIMER" })
2766
+ actions: xt("timer", { type: "PAUSE_TIMER" })
2767
2767
  // cond: (context) => context.duration > 0,
2768
2768
  }
2769
2769
  }
@@ -2797,12 +2797,12 @@ const Rs = Ae({
2797
2797
  }
2798
2798
  }
2799
2799
  }
2800
- }), sn = Je({}), Zr = () => Ye(sn);
2800
+ }), on = Xe({}), Zr = () => Qe(on);
2801
2801
  function ei({
2802
2802
  children: e,
2803
2803
  actor: t
2804
2804
  }) {
2805
- return /* @__PURE__ */ ze(sn.Provider, { value: t, children: e });
2805
+ return /* @__PURE__ */ Ye(on.Provider, { value: t, children: e });
2806
2806
  }
2807
2807
  function Ms({
2808
2808
  context: e,
@@ -2890,7 +2890,7 @@ function Bs({
2890
2890
  itemsUpdated: n.output.itemsUpdated
2891
2891
  };
2892
2892
  }
2893
- const it = JSON, js = (e) => e.toUpperCase(), $s = (e) => {
2893
+ const at = JSON, js = (e) => e.toUpperCase(), $s = (e) => {
2894
2894
  const t = {};
2895
2895
  return e.forEach((n, s) => {
2896
2896
  t[s] = n;
@@ -2919,7 +2919,7 @@ const it = JSON, js = (e) => e.toUpperCase(), $s = (e) => {
2919
2919
  signal: void 0
2920
2920
  };
2921
2921
  };
2922
- function me(e, t) {
2922
+ function Ee(e, t) {
2923
2923
  if (!!!e)
2924
2924
  throw new Error(t);
2925
2925
  }
@@ -2933,7 +2933,7 @@ function Ys(e, t) {
2933
2933
  );
2934
2934
  }
2935
2935
  const Xs = /\r\n|[\n\r]/g;
2936
- function $e(e, t) {
2936
+ function He(e, t) {
2937
2937
  let n = 0, s = 1;
2938
2938
  for (const r of e.body.matchAll(Xs)) {
2939
2939
  if (typeof r.index == "number" || Ys(!1), r.index >= t)
@@ -2946,26 +2946,26 @@ function $e(e, t) {
2946
2946
  };
2947
2947
  }
2948
2948
  function Qs(e) {
2949
- return rn(
2949
+ return an(
2950
2950
  e.source,
2951
- $e(e.source, e.start)
2951
+ He(e.source, e.start)
2952
2952
  );
2953
2953
  }
2954
- function rn(e, t) {
2954
+ function an(e, t) {
2955
2955
  const n = e.locationOffset.column - 1, s = "".padStart(n) + e.body, r = t.line - 1, i = e.locationOffset.line - 1, o = t.line + i, a = t.line === 1 ? n : 0, c = t.column + a, u = `${e.name}:${o}:${c}
2956
2956
  `, h = s.split(/\r\n|[\n\r]/g), d = h[r];
2957
2957
  if (d.length > 120) {
2958
2958
  const f = Math.floor(c / 80), m = c % 80, y = [];
2959
2959
  for (let v = 0; v < d.length; v += 80)
2960
2960
  y.push(d.slice(v, v + 80));
2961
- return u + wt([
2961
+ return u + Ot([
2962
2962
  [`${o} |`, y[0]],
2963
2963
  ...y.slice(1, f + 1).map((v) => ["|", v]),
2964
2964
  ["|", "^".padStart(m)],
2965
2965
  ["|", y[f + 1]]
2966
2966
  ]);
2967
2967
  }
2968
- return u + wt([
2968
+ return u + Ot([
2969
2969
  // Lines specified like this: ["prefix", "string"],
2970
2970
  [`${o - 1} |`, h[r - 1]],
2971
2971
  [`${o} |`, d],
@@ -2973,7 +2973,7 @@ function rn(e, t) {
2973
2973
  [`${o + 1} |`, h[r + 1]]
2974
2974
  ]);
2975
2975
  }
2976
- function wt(e) {
2976
+ function Ot(e) {
2977
2977
  const t = e.filter(([s, r]) => r !== void 0), n = Math.max(...t.map(([s]) => s.length));
2978
2978
  return t.map(([s, r]) => s.padStart(n) + (r ? " " + r : "")).join(`
2979
2979
  `);
@@ -2989,7 +2989,7 @@ function Ws(e) {
2989
2989
  extensions: e[5]
2990
2990
  } : t;
2991
2991
  }
2992
- class ot extends Error {
2992
+ class ct extends Error {
2993
2993
  /**
2994
2994
  * An array of `{ line, column }` locations within the source GraphQL document
2995
2995
  * which correspond to this error.
@@ -3031,13 +3031,13 @@ class ot extends Error {
3031
3031
  constructor(t, ...n) {
3032
3032
  var s, r, i;
3033
3033
  const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } = Ws(n);
3034
- super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes = bt(
3034
+ super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes = Nt(
3035
3035
  Array.isArray(o) ? o : o ? [o] : void 0
3036
3036
  );
3037
- const f = bt(
3037
+ const f = Nt(
3038
3038
  (s = this.nodes) === null || s === void 0 ? void 0 : s.map((y) => y.loc).filter((y) => y != null)
3039
3039
  );
3040
- this.source = a ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (f == null ? void 0 : f.map((y) => y.start)), this.locations = c && a ? c.map((y) => $e(a, y)) : f == null ? void 0 : f.map((y) => $e(y.source, y.start));
3040
+ this.source = a ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (f == null ? void 0 : f.map((y) => y.start)), this.locations = c && a ? c.map((y) => He(a, y)) : f == null ? void 0 : f.map((y) => He(y.source, y.start));
3041
3041
  const m = Js(
3042
3042
  h == null ? void 0 : h.extensions
3043
3043
  ) ? h == null ? void 0 : h.extensions : void 0;
@@ -3065,7 +3065,7 @@ class ot extends Error {
3065
3065
  value: h.stack,
3066
3066
  writable: !0,
3067
3067
  configurable: !0
3068
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ot) : Object.defineProperty(this, "stack", {
3068
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, ct) : Object.defineProperty(this, "stack", {
3069
3069
  value: Error().stack,
3070
3070
  writable: !0,
3071
3071
  configurable: !0
@@ -3085,7 +3085,7 @@ class ot extends Error {
3085
3085
  for (const n of this.locations)
3086
3086
  t += `
3087
3087
 
3088
- ` + rn(this.source, n);
3088
+ ` + an(this.source, n);
3089
3089
  return t;
3090
3090
  }
3091
3091
  toJSON() {
@@ -3095,11 +3095,11 @@ class ot extends Error {
3095
3095
  return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
3096
3096
  }
3097
3097
  }
3098
- function bt(e) {
3098
+ function Nt(e) {
3099
3099
  return e === void 0 || e.length === 0 ? void 0 : e;
3100
3100
  }
3101
3101
  function b(e, t, n) {
3102
- return new ot(`Syntax Error: ${n}`, {
3102
+ return new ct(`Syntax Error: ${n}`, {
3103
3103
  source: e,
3104
3104
  positions: [t]
3105
3105
  });
@@ -3133,7 +3133,7 @@ class Ks {
3133
3133
  };
3134
3134
  }
3135
3135
  }
3136
- class on {
3136
+ class cn {
3137
3137
  /**
3138
3138
  * The kind of Token.
3139
3139
  */
@@ -3175,7 +3175,7 @@ class on {
3175
3175
  };
3176
3176
  }
3177
3177
  }
3178
- const an = {
3178
+ const un = {
3179
3179
  Name: [],
3180
3180
  Document: ["definitions"],
3181
3181
  OperationDefinition: [
@@ -3249,38 +3249,38 @@ const an = {
3249
3249
  UnionTypeExtension: ["name", "directives", "types"],
3250
3250
  EnumTypeExtension: ["name", "directives", "values"],
3251
3251
  InputObjectTypeExtension: ["name", "directives", "fields"]
3252
- }, Zs = new Set(Object.keys(an));
3253
- function Ot(e) {
3252
+ }, Zs = new Set(Object.keys(un));
3253
+ function kt(e) {
3254
3254
  const t = e == null ? void 0 : e.kind;
3255
3255
  return typeof t == "string" && Zs.has(t);
3256
3256
  }
3257
- var Z;
3257
+ var ee;
3258
3258
  (function(e) {
3259
3259
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
3260
- })(Z || (Z = {}));
3261
- var Ve;
3260
+ })(ee || (ee = {}));
3261
+ var Ge;
3262
3262
  (function(e) {
3263
3263
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
3264
- })(Ve || (Ve = {}));
3264
+ })(Ge || (Ge = {}));
3265
3265
  var T;
3266
3266
  (function(e) {
3267
3267
  e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
3268
3268
  })(T || (T = {}));
3269
- function He(e) {
3269
+ function ze(e) {
3270
3270
  return e === 9 || e === 32;
3271
3271
  }
3272
- function ue(e) {
3272
+ function de(e) {
3273
3273
  return e >= 48 && e <= 57;
3274
3274
  }
3275
- function cn(e) {
3275
+ function dn(e) {
3276
3276
  return e >= 97 && e <= 122 || // A-Z
3277
3277
  e >= 65 && e <= 90;
3278
3278
  }
3279
- function un(e) {
3280
- return cn(e) || e === 95;
3279
+ function ln(e) {
3280
+ return dn(e) || e === 95;
3281
3281
  }
3282
3282
  function er(e) {
3283
- return cn(e) || ue(e) || e === 95;
3283
+ return dn(e) || de(e) || e === 95;
3284
3284
  }
3285
3285
  function tr(e) {
3286
3286
  var t;
@@ -3297,15 +3297,15 @@ function tr(e) {
3297
3297
  }
3298
3298
  function nr(e) {
3299
3299
  let t = 0;
3300
- for (; t < e.length && He(e.charCodeAt(t)); )
3300
+ for (; t < e.length && ze(e.charCodeAt(t)); )
3301
3301
  ++t;
3302
3302
  return t;
3303
3303
  }
3304
3304
  function sr(e, t) {
3305
- const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 || He(m.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), u = a || c, h = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
3305
+ const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 || ze(m.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), u = a || c, h = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
3306
3306
  (!r || e.length > 70 || u || i || o);
3307
3307
  let d = "";
3308
- const f = r && He(e.charCodeAt(0));
3308
+ const f = r && ze(e.charCodeAt(0));
3309
3309
  return (h && !f || i) && (d += `
3310
3310
  `), d += n, (h || u) && (d += `
3311
3311
  `), '"""' + d + '"""';
@@ -3328,7 +3328,7 @@ class rr {
3328
3328
  * The character offset at which the current line begins.
3329
3329
  */
3330
3330
  constructor(t) {
3331
- const n = new on(p.SOF, 0, 0, 0, 0);
3331
+ const n = new cn(p.SOF, 0, 0, 0, 0);
3332
3332
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
3333
3333
  }
3334
3334
  get [Symbol.toStringTag]() {
@@ -3361,19 +3361,19 @@ class rr {
3361
3361
  function ir(e) {
3362
3362
  return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
3363
3363
  }
3364
- function se(e) {
3364
+ function re(e) {
3365
3365
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
3366
3366
  }
3367
- function xe(e, t) {
3368
- return dn(e.charCodeAt(t)) && ln(e.charCodeAt(t + 1));
3367
+ function be(e, t) {
3368
+ return hn(e.charCodeAt(t)) && fn(e.charCodeAt(t + 1));
3369
3369
  }
3370
- function dn(e) {
3370
+ function hn(e) {
3371
3371
  return e >= 55296 && e <= 56319;
3372
3372
  }
3373
- function ln(e) {
3373
+ function fn(e) {
3374
3374
  return e >= 56320 && e <= 57343;
3375
3375
  }
3376
- function Y(e, t) {
3376
+ function X(e, t) {
3377
3377
  const n = e.source.body.codePointAt(t);
3378
3378
  if (n === void 0)
3379
3379
  return p.EOF;
@@ -3385,7 +3385,7 @@ function Y(e, t) {
3385
3385
  }
3386
3386
  function w(e, t, n, s, r) {
3387
3387
  const i = e.line, o = 1 + n - e.lineStart;
3388
- return new on(t, n, s, i, o, r);
3388
+ return new cn(t, n, s, i, o, r);
3389
3389
  }
3390
3390
  function or(e, t) {
3391
3391
  const n = e.source.body, s = n.length;
@@ -3440,14 +3440,14 @@ function or(e, t) {
3440
3440
  case 34:
3441
3441
  return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? fr(e, r) : ur(e, r);
3442
3442
  }
3443
- if (ue(i) || i === 45)
3443
+ if (de(i) || i === 45)
3444
3444
  return cr(e, r, i);
3445
- if (un(i))
3445
+ if (ln(i))
3446
3446
  return pr(e, r);
3447
3447
  throw b(
3448
3448
  e.source,
3449
3449
  r,
3450
- i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : se(i) || xe(n, r) ? `Unexpected character: ${Y(e, r)}.` : `Invalid character: ${Y(e, r)}.`
3450
+ i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : re(i) || be(n, r) ? `Unexpected character: ${X(e, r)}.` : `Invalid character: ${X(e, r)}.`
3451
3451
  );
3452
3452
  }
3453
3453
  return w(e, p.EOF, s, s);
@@ -3459,9 +3459,9 @@ function ar(e, t) {
3459
3459
  const i = n.charCodeAt(r);
3460
3460
  if (i === 10 || i === 13)
3461
3461
  break;
3462
- if (se(i))
3462
+ if (re(i))
3463
3463
  ++r;
3464
- else if (xe(n, r))
3464
+ else if (be(n, r))
3465
3465
  r += 2;
3466
3466
  else
3467
3467
  break;
@@ -3478,22 +3478,22 @@ function cr(e, t, n) {
3478
3478
  const s = e.source.body;
3479
3479
  let r = t, i = n, o = !1;
3480
3480
  if (i === 45 && (i = s.charCodeAt(++r)), i === 48) {
3481
- if (i = s.charCodeAt(++r), ue(i))
3481
+ if (i = s.charCodeAt(++r), de(i))
3482
3482
  throw b(
3483
3483
  e.source,
3484
3484
  r,
3485
- `Invalid number, unexpected digit after 0: ${Y(
3485
+ `Invalid number, unexpected digit after 0: ${X(
3486
3486
  e,
3487
3487
  r
3488
3488
  )}.`
3489
3489
  );
3490
3490
  } else
3491
- r = Re(e, r, i), i = s.charCodeAt(r);
3492
- if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = Re(e, r, i), i = s.charCodeAt(r)), (i === 69 || i === 101) && (o = !0, i = s.charCodeAt(++r), (i === 43 || i === 45) && (i = s.charCodeAt(++r)), r = Re(e, r, i), i = s.charCodeAt(r)), i === 46 || un(i))
3491
+ r = qe(e, r, i), i = s.charCodeAt(r);
3492
+ if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = qe(e, r, i), i = s.charCodeAt(r)), (i === 69 || i === 101) && (o = !0, i = s.charCodeAt(++r), (i === 43 || i === 45) && (i = s.charCodeAt(++r)), r = qe(e, r, i), i = s.charCodeAt(r)), i === 46 || ln(i))
3493
3493
  throw b(
3494
3494
  e.source,
3495
3495
  r,
3496
- `Invalid number, expected digit but got: ${Y(
3496
+ `Invalid number, expected digit but got: ${X(
3497
3497
  e,
3498
3498
  r
3499
3499
  )}.`
@@ -3506,19 +3506,19 @@ function cr(e, t, n) {
3506
3506
  s.slice(t, r)
3507
3507
  );
3508
3508
  }
3509
- function Re(e, t, n) {
3510
- if (!ue(n))
3509
+ function qe(e, t, n) {
3510
+ if (!de(n))
3511
3511
  throw b(
3512
3512
  e.source,
3513
3513
  t,
3514
- `Invalid number, expected digit but got: ${Y(
3514
+ `Invalid number, expected digit but got: ${X(
3515
3515
  e,
3516
3516
  t
3517
3517
  )}.`
3518
3518
  );
3519
3519
  const s = e.source.body;
3520
3520
  let r = t + 1;
3521
- for (; ue(s.charCodeAt(r)); )
3521
+ for (; de(s.charCodeAt(r)); )
3522
3522
  ++r;
3523
3523
  return r;
3524
3524
  }
@@ -3537,15 +3537,15 @@ function ur(e, t) {
3537
3537
  }
3538
3538
  if (a === 10 || a === 13)
3539
3539
  break;
3540
- if (se(a))
3540
+ if (re(a))
3541
3541
  ++r;
3542
- else if (xe(n, r))
3542
+ else if (be(n, r))
3543
3543
  r += 2;
3544
3544
  else
3545
3545
  throw b(
3546
3546
  e.source,
3547
3547
  r,
3548
- `Invalid character within String: ${Y(
3548
+ `Invalid character within String: ${X(
3549
3549
  e,
3550
3550
  r
3551
3551
  )}.`
@@ -3559,14 +3559,14 @@ function dr(e, t) {
3559
3559
  for (; r < 12; ) {
3560
3560
  const i = n.charCodeAt(t + r++);
3561
3561
  if (i === 125) {
3562
- if (r < 5 || !se(s))
3562
+ if (r < 5 || !re(s))
3563
3563
  break;
3564
3564
  return {
3565
3565
  value: String.fromCodePoint(s),
3566
3566
  size: r
3567
3567
  };
3568
3568
  }
3569
- if (s = s << 4 | oe(i), s < 0)
3569
+ if (s = s << 4 | ae(i), s < 0)
3570
3570
  break;
3571
3571
  }
3572
3572
  throw b(
@@ -3579,15 +3579,15 @@ function dr(e, t) {
3579
3579
  );
3580
3580
  }
3581
3581
  function lr(e, t) {
3582
- const n = e.source.body, s = Nt(n, t + 2);
3583
- if (se(s))
3582
+ const n = e.source.body, s = Ct(n, t + 2);
3583
+ if (re(s))
3584
3584
  return {
3585
3585
  value: String.fromCodePoint(s),
3586
3586
  size: 6
3587
3587
  };
3588
- if (dn(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
3589
- const r = Nt(n, t + 8);
3590
- if (ln(r))
3588
+ if (hn(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
3589
+ const r = Ct(n, t + 8);
3590
+ if (fn(r))
3591
3591
  return {
3592
3592
  value: String.fromCodePoint(s, r),
3593
3593
  size: 12
@@ -3599,10 +3599,10 @@ function lr(e, t) {
3599
3599
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
3600
3600
  );
3601
3601
  }
3602
- function Nt(e, t) {
3603
- return oe(e.charCodeAt(t)) << 12 | oe(e.charCodeAt(t + 1)) << 8 | oe(e.charCodeAt(t + 2)) << 4 | oe(e.charCodeAt(t + 3));
3602
+ function Ct(e, t) {
3603
+ return ae(e.charCodeAt(t)) << 12 | ae(e.charCodeAt(t + 1)) << 8 | ae(e.charCodeAt(t + 2)) << 4 | ae(e.charCodeAt(t + 3));
3604
3604
  }
3605
- function oe(e) {
3605
+ function ae(e) {
3606
3606
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
3607
3607
  }
3608
3608
  function hr(e, t) {
@@ -3686,15 +3686,15 @@ function fr(e, t) {
3686
3686
  a += n.slice(o, i), c.push(a), u === 13 && n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, a = "", o = i, r = i;
3687
3687
  continue;
3688
3688
  }
3689
- if (se(u))
3689
+ if (re(u))
3690
3690
  ++i;
3691
- else if (xe(n, i))
3691
+ else if (be(n, i))
3692
3692
  i += 2;
3693
3693
  else
3694
3694
  throw b(
3695
3695
  e.source,
3696
3696
  i,
3697
- `Invalid character within String: ${Y(
3697
+ `Invalid character within String: ${X(
3698
3698
  e,
3699
3699
  i
3700
3700
  )}.`
@@ -3720,11 +3720,11 @@ function pr(e, t) {
3720
3720
  n.slice(t, r)
3721
3721
  );
3722
3722
  }
3723
- const yr = 10, hn = 2;
3724
- function at(e) {
3725
- return we(e, []);
3723
+ const yr = 10, pn = 2;
3724
+ function ut(e) {
3725
+ return Oe(e, []);
3726
3726
  }
3727
- function we(e, t) {
3727
+ function Oe(e, t) {
3728
3728
  switch (typeof e) {
3729
3729
  case "string":
3730
3730
  return JSON.stringify(e);
@@ -3745,7 +3745,7 @@ function mr(e, t) {
3745
3745
  if (gr(e)) {
3746
3746
  const s = e.toJSON();
3747
3747
  if (s !== e)
3748
- return typeof s == "string" ? s : we(s, n);
3748
+ return typeof s == "string" ? s : Oe(s, n);
3749
3749
  } else if (Array.isArray(e))
3750
3750
  return vr(e, n);
3751
3751
  return Er(e, n);
@@ -3755,18 +3755,18 @@ function gr(e) {
3755
3755
  }
3756
3756
  function Er(e, t) {
3757
3757
  const n = Object.entries(e);
3758
- return n.length === 0 ? "{}" : t.length > hn ? "[" + Tr(e) + "]" : "{ " + n.map(
3759
- ([r, i]) => r + ": " + we(i, t)
3758
+ return n.length === 0 ? "{}" : t.length > pn ? "[" + Tr(e) + "]" : "{ " + n.map(
3759
+ ([r, i]) => r + ": " + Oe(i, t)
3760
3760
  ).join(", ") + " }";
3761
3761
  }
3762
3762
  function vr(e, t) {
3763
3763
  if (e.length === 0)
3764
3764
  return "[]";
3765
- if (t.length > hn)
3765
+ if (t.length > pn)
3766
3766
  return "[Array]";
3767
3767
  const n = Math.min(yr, e.length), s = e.length - n, r = [];
3768
3768
  for (let i = 0; i < n; ++i)
3769
- r.push(we(e[i], t));
3769
+ r.push(Oe(e[i], t));
3770
3770
  return s === 1 ? r.push("... 1 more item") : s > 1 && r.push(`... ${s} more items`), "[" + r.join(", ") + "]";
3771
3771
  }
3772
3772
  function Tr(e) {
@@ -3793,7 +3793,7 @@ const _r = (
3793
3793
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (s = t.constructor) === null || s === void 0 ? void 0 : s.name
3794
3794
  );
3795
3795
  if (r === i) {
3796
- const o = at(t);
3796
+ const o = ut(t);
3797
3797
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
3798
3798
 
3799
3799
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -3811,15 +3811,15 @@ spurious results.`);
3811
3811
  return !1;
3812
3812
  }
3813
3813
  );
3814
- class fn {
3814
+ class yn {
3815
3815
  constructor(t, n = "GraphQL request", s = {
3816
3816
  line: 1,
3817
3817
  column: 1
3818
3818
  }) {
3819
- typeof t == "string" || me(!1, `Body must be a string. Received: ${at(t)}.`), this.body = t, this.name = n, this.locationOffset = s, this.locationOffset.line > 0 || me(
3819
+ typeof t == "string" || Ee(!1, `Body must be a string. Received: ${ut(t)}.`), this.body = t, this.name = n, this.locationOffset = s, this.locationOffset.line > 0 || Ee(
3820
3820
  !1,
3821
3821
  "line in locationOffset is 1-indexed and must be positive."
3822
- ), this.locationOffset.column > 0 || me(
3822
+ ), this.locationOffset.column > 0 || Ee(
3823
3823
  !1,
3824
3824
  "column in locationOffset is 1-indexed and must be positive."
3825
3825
  );
@@ -3829,14 +3829,14 @@ class fn {
3829
3829
  }
3830
3830
  }
3831
3831
  function Ir(e) {
3832
- return _r(e, fn);
3832
+ return _r(e, yn);
3833
3833
  }
3834
3834
  function Sr(e, t) {
3835
3835
  return new Ar(e, t).parseDocument();
3836
3836
  }
3837
3837
  class Ar {
3838
3838
  constructor(t, n = {}) {
3839
- const s = Ir(t) ? t : new fn(t);
3839
+ const s = Ir(t) ? t : new yn(t);
3840
3840
  this._lexer = new rr(s), this._options = n, this._tokenCounter = 0;
3841
3841
  }
3842
3842
  /**
@@ -3939,7 +3939,7 @@ class Ar {
3939
3939
  if (this.peek(p.BRACE_L))
3940
3940
  return this.node(t, {
3941
3941
  kind: T.OPERATION_DEFINITION,
3942
- operation: Z.QUERY,
3942
+ operation: ee.QUERY,
3943
3943
  name: void 0,
3944
3944
  variableDefinitions: [],
3945
3945
  directives: [],
@@ -3963,11 +3963,11 @@ class Ar {
3963
3963
  const t = this.expectToken(p.NAME);
3964
3964
  switch (t.value) {
3965
3965
  case "query":
3966
- return Z.QUERY;
3966
+ return ee.QUERY;
3967
3967
  case "mutation":
3968
- return Z.MUTATION;
3968
+ return ee.MUTATION;
3969
3969
  case "subscription":
3970
- return Z.SUBSCRIPTION;
3970
+ return ee.SUBSCRIPTION;
3971
3971
  }
3972
3972
  throw this.unexpected(t);
3973
3973
  }
@@ -4534,7 +4534,7 @@ class Ar {
4534
4534
  throw b(
4535
4535
  this._lexer.source,
4536
4536
  this._lexer.token.start,
4537
- `${pe(
4537
+ `${me(
4538
4538
  this._lexer.token
4539
4539
  )} is reserved and cannot be used for an enum value.`
4540
4540
  );
@@ -4793,7 +4793,7 @@ class Ar {
4793
4793
  */
4794
4794
  parseDirectiveLocation() {
4795
4795
  const t = this._lexer.token, n = this.parseName();
4796
- if (Object.prototype.hasOwnProperty.call(Ve, n.value))
4796
+ if (Object.prototype.hasOwnProperty.call(Ge, n.value))
4797
4797
  return n;
4798
4798
  throw this.unexpected(t);
4799
4799
  }
@@ -4827,7 +4827,7 @@ class Ar {
4827
4827
  throw b(
4828
4828
  this._lexer.source,
4829
4829
  n.start,
4830
- `Expected ${pn(t)}, found ${pe(n)}.`
4830
+ `Expected ${mn(t)}, found ${me(n)}.`
4831
4831
  );
4832
4832
  }
4833
4833
  /**
@@ -4849,7 +4849,7 @@ class Ar {
4849
4849
  throw b(
4850
4850
  this._lexer.source,
4851
4851
  n.start,
4852
- `Expected "${t}", found ${pe(n)}.`
4852
+ `Expected "${t}", found ${me(n)}.`
4853
4853
  );
4854
4854
  }
4855
4855
  /**
@@ -4868,7 +4868,7 @@ class Ar {
4868
4868
  return b(
4869
4869
  this._lexer.source,
4870
4870
  n.start,
4871
- `Unexpected ${pe(n)}.`
4871
+ `Unexpected ${me(n)}.`
4872
4872
  );
4873
4873
  }
4874
4874
  /**
@@ -4935,11 +4935,11 @@ class Ar {
4935
4935
  );
4936
4936
  }
4937
4937
  }
4938
- function pe(e) {
4938
+ function me(e) {
4939
4939
  const t = e.value;
4940
- return pn(e.kind) + (t != null ? ` "${t}"` : "");
4940
+ return mn(e.kind) + (t != null ? ` "${t}"` : "");
4941
4941
  }
4942
- function pn(e) {
4942
+ function mn(e) {
4943
4943
  return ir(e) ? `"${e}"` : e;
4944
4944
  }
4945
4945
  function xr(e) {
@@ -5116,7 +5116,7 @@ const Or = [
5116
5116
  "\\u009E",
5117
5117
  "\\u009F"
5118
5118
  ], Nr = Object.freeze({});
5119
- function kr(e, t, n = an) {
5119
+ function kr(e, t, n = un) {
5120
5120
  const s = /* @__PURE__ */ new Map();
5121
5121
  for (const x of Object.values(T))
5122
5122
  s.set(x, Cr(t, x));
@@ -5130,17 +5130,17 @@ function kr(e, t, n = an) {
5130
5130
  if (i) {
5131
5131
  u = u.slice();
5132
5132
  let M = 0;
5133
- for (const [U, $] of c) {
5134
- const le = U - M;
5135
- $ === null ? (u.splice(le, 1), M++) : u[le] = $;
5133
+ for (const [P, V] of c) {
5134
+ const H = P - M;
5135
+ V === null ? (u.splice(H, 1), M++) : u[H] = V;
5136
5136
  }
5137
5137
  } else {
5138
5138
  u = Object.defineProperties(
5139
5139
  {},
5140
5140
  Object.getOwnPropertyDescriptors(u)
5141
5141
  );
5142
- for (const [M, U] of c)
5143
- u[M] = U;
5142
+ for (const [M, P] of c)
5143
+ u[M] = P;
5144
5144
  }
5145
5145
  a = r.index, o = r.keys, c = r.edits, i = r.inArray, r = r.prev;
5146
5146
  } else if (d) {
@@ -5151,7 +5151,7 @@ function kr(e, t, n = an) {
5151
5151
  let k;
5152
5152
  if (!Array.isArray(u)) {
5153
5153
  var y, v;
5154
- Ot(u) || me(!1, `Invalid AST Node: ${at(u)}.`);
5154
+ kt(u) || Ee(!1, `Invalid AST Node: ${ut(u)}.`);
5155
5155
  const M = x ? (y = s.get(u.kind)) === null || y === void 0 ? void 0 : y.leave : (v = s.get(u.kind)) === null || v === void 0 ? void 0 : v.enter;
5156
5156
  if (k = M == null ? void 0 : M.call(t, u, h, d, f, m), k === Nr)
5157
5157
  break;
@@ -5161,7 +5161,7 @@ function kr(e, t, n = an) {
5161
5161
  continue;
5162
5162
  }
5163
5163
  } else if (k !== void 0 && (c.push([h, k]), !x))
5164
- if (Ot(k))
5164
+ if (kt(k))
5165
5165
  u = k;
5166
5166
  else {
5167
5167
  f.pop();
@@ -5193,7 +5193,7 @@ function Cr(e, t) {
5193
5193
  leave: e.leave
5194
5194
  };
5195
5195
  }
5196
- function yn(e) {
5196
+ function gn(e) {
5197
5197
  return kr(e, Rr);
5198
5198
  }
5199
5199
  const Dr = 80, Rr = {
@@ -5233,7 +5233,7 @@ const Dr = 80, Rr = {
5233
5233
  const i = I("", e, ": ") + t;
5234
5234
  let o = i + I("(", E(n, ", "), ")");
5235
5235
  return o.length > Dr && (o = i + I(`(
5236
- `, ge(E(n, `
5236
+ `, ve(E(n, `
5237
5237
  `)), `
5238
5238
  )`)), E([o, E(s, " "), r], " ");
5239
5239
  }
@@ -5331,8 +5331,8 @@ const Dr = 80, Rr = {
5331
5331
  },
5332
5332
  FieldDefinition: {
5333
5333
  leave: ({ description: e, name: t, arguments: n, type: s, directives: r }) => I("", e, `
5334
- `) + t + (kt(n) ? I(`(
5335
- `, ge(E(n, `
5334
+ `) + t + (Dt(n) ? I(`(
5335
+ `, ve(E(n, `
5336
5336
  `)), `
5337
5337
  )`) : I("(", E(n, ", "), ")")) + ": " + s + I(" ", E(r, " "))
5338
5338
  },
@@ -5377,8 +5377,8 @@ const Dr = 80, Rr = {
5377
5377
  },
5378
5378
  DirectiveDefinition: {
5379
5379
  leave: ({ description: e, name: t, arguments: n, repeatable: s, locations: r }) => I("", e, `
5380
- `) + "directive @" + t + (kt(n) ? I(`(
5381
- `, ge(E(n, `
5380
+ `) + "directive @" + t + (Dt(n) ? I(`(
5381
+ `, ve(E(n, `
5382
5382
  `)), `
5383
5383
  )`) : I("(", E(n, ", "), ")")) + (s ? " repeatable" : "") + " on " + E(r, " | ")
5384
5384
  },
@@ -5439,47 +5439,47 @@ function E(e, t = "") {
5439
5439
  }
5440
5440
  function q(e) {
5441
5441
  return I(`{
5442
- `, ge(E(e, `
5442
+ `, ve(E(e, `
5443
5443
  `)), `
5444
5444
  }`);
5445
5445
  }
5446
5446
  function I(e, t, n = "") {
5447
5447
  return t != null && t !== "" ? e + t + n : "";
5448
5448
  }
5449
- function ge(e) {
5449
+ function ve(e) {
5450
5450
  return I(" ", e.replace(/\n/g, `
5451
5451
  `));
5452
5452
  }
5453
- function kt(e) {
5453
+ function Dt(e) {
5454
5454
  var t;
5455
5455
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
5456
5456
  `))) !== null && t !== void 0 ? t : !1;
5457
5457
  }
5458
- const Ct = (e) => {
5458
+ const Rt = (e) => {
5459
5459
  var s, r;
5460
5460
  let t;
5461
5461
  const n = e.definitions.filter((i) => i.kind === "OperationDefinition");
5462
5462
  return n.length === 1 && (t = (r = (s = n[0]) == null ? void 0 : s.name) == null ? void 0 : r.value), t;
5463
- }, Me = (e) => {
5463
+ }, Le = (e) => {
5464
5464
  if (typeof e == "string") {
5465
5465
  let n;
5466
5466
  try {
5467
5467
  const s = Sr(e);
5468
- n = Ct(s);
5468
+ n = Rt(s);
5469
5469
  } catch {
5470
5470
  }
5471
5471
  return { query: e, operationName: n };
5472
5472
  }
5473
- const t = Ct(e);
5474
- return { query: yn(e), operationName: t };
5473
+ const t = Rt(e);
5474
+ return { query: gn(e), operationName: t };
5475
5475
  };
5476
- class ae extends Error {
5476
+ class ce extends Error {
5477
5477
  constructor(t, n) {
5478
- const s = `${ae.extractMessage(t)}: ${JSON.stringify({
5478
+ const s = `${ce.extractMessage(t)}: ${JSON.stringify({
5479
5479
  response: t,
5480
5480
  request: n
5481
5481
  })}`;
5482
- super(s), Object.setPrototypeOf(this, ae.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, ae);
5482
+ super(s), Object.setPrototypeOf(this, ce.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, ce);
5483
5483
  }
5484
5484
  static extractMessage(t) {
5485
5485
  var n, s;
@@ -5490,7 +5490,7 @@ var Mr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
5490
5490
  function qr(e) {
5491
5491
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5492
5492
  }
5493
- var Ge = { exports: {} };
5493
+ var Je = { exports: {} };
5494
5494
  (function(e, t) {
5495
5495
  var n = typeof self < "u" ? self : Mr, s = function() {
5496
5496
  function i() {
@@ -5622,7 +5622,7 @@ var Ge = { exports: {} };
5622
5622
  var g = new Uint8Array(l.byteLength);
5623
5623
  return g.set(new Uint8Array(l)), g.buffer;
5624
5624
  }
5625
- function U() {
5625
+ function P() {
5626
5626
  return this.bodyUsed = !1, this._initBody = function(l) {
5627
5627
  this._bodyInit = l, l ? typeof l == "string" ? this._bodyText = l : a.blob && Blob.prototype.isPrototypeOf(l) ? this._bodyBlob = l : a.formData && FormData.prototype.isPrototypeOf(l) ? this._bodyFormData = l : a.searchParams && URLSearchParams.prototype.isPrototypeOf(l) ? this._bodyText = l.toString() : a.arrayBuffer && a.blob && c(l) ? (this._bodyArrayBuffer = M(l.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(l) || h(l)) ? this._bodyArrayBuffer = M(l) : this._bodyText = l = Object.prototype.toString.call(l) : this._bodyText = "", this.headers.get("content-type") || (typeof l == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(l) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
5628
5628
  }, a.blob && (this.blob = function() {
@@ -5650,33 +5650,33 @@ var Ge = { exports: {} };
5650
5650
  throw new Error("could not read FormData body as text");
5651
5651
  return Promise.resolve(this._bodyText);
5652
5652
  }, a.formData && (this.formData = function() {
5653
- return this.text().then(En);
5653
+ return this.text().then(he);
5654
5654
  }), this.json = function() {
5655
5655
  return this.text().then(JSON.parse);
5656
5656
  }, this;
5657
5657
  }
5658
- var $ = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
5659
- function le(l) {
5658
+ var V = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
5659
+ function H(l) {
5660
5660
  var g = l.toUpperCase();
5661
- return $.indexOf(g) > -1 ? g : l;
5661
+ return V.indexOf(g) > -1 ? g : l;
5662
5662
  }
5663
- function V(l, g) {
5663
+ function L(l, g) {
5664
5664
  g = g || {};
5665
5665
  var _ = g.body;
5666
- if (l instanceof V) {
5666
+ if (l instanceof L) {
5667
5667
  if (l.bodyUsed)
5668
5668
  throw new TypeError("Already read");
5669
5669
  this.url = l.url, this.credentials = l.credentials, g.headers || (this.headers = new y(l.headers)), this.method = l.method, this.mode = l.mode, this.signal = l.signal, !_ && l._bodyInit != null && (_ = l._bodyInit, l.bodyUsed = !0);
5670
5670
  } else
5671
5671
  this.url = String(l);
5672
- if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new y(g.headers)), this.method = le(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
5672
+ if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new y(g.headers)), this.method = H(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
5673
5673
  throw new TypeError("Body not allowed for GET or HEAD requests");
5674
5674
  this._initBody(_);
5675
5675
  }
5676
- V.prototype.clone = function() {
5677
- return new V(this, { body: this._bodyInit });
5676
+ L.prototype.clone = function() {
5677
+ return new L(this, { body: this._bodyInit });
5678
5678
  };
5679
- function En(l) {
5679
+ function he(l) {
5680
5680
  var g = new FormData();
5681
5681
  return l.trim().split("&").forEach(function(_) {
5682
5682
  if (_) {
@@ -5685,36 +5685,36 @@ var Ge = { exports: {} };
5685
5685
  }
5686
5686
  }), g;
5687
5687
  }
5688
- function vn(l) {
5688
+ function fe(l) {
5689
5689
  var g = new y(), _ = l.replace(/\r?\n[\t ]+/g, " ");
5690
5690
  return _.split(/\r?\n/).forEach(function(N) {
5691
5691
  var O = N.split(":"), A = O.shift().trim();
5692
5692
  if (A) {
5693
- var he = O.join(":").trim();
5694
- g.append(A, he);
5693
+ var pe = O.join(":").trim();
5694
+ g.append(A, pe);
5695
5695
  }
5696
5696
  }), g;
5697
5697
  }
5698
- U.call(V.prototype);
5699
- function L(l, g) {
5698
+ P.call(L.prototype);
5699
+ function U(l, g) {
5700
5700
  g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new y(g.headers), this.url = g.url || "", this._initBody(l);
5701
5701
  }
5702
- U.call(L.prototype), L.prototype.clone = function() {
5703
- return new L(this._bodyInit, {
5702
+ P.call(U.prototype), U.prototype.clone = function() {
5703
+ return new U(this._bodyInit, {
5704
5704
  status: this.status,
5705
5705
  statusText: this.statusText,
5706
5706
  headers: new y(this.headers),
5707
5707
  url: this.url
5708
5708
  });
5709
- }, L.error = function() {
5710
- var l = new L(null, { status: 0, statusText: "" });
5709
+ }, U.error = function() {
5710
+ var l = new U(null, { status: 0, statusText: "" });
5711
5711
  return l.type = "error", l;
5712
5712
  };
5713
5713
  var Tn = [301, 302, 303, 307, 308];
5714
- L.redirect = function(l, g) {
5714
+ U.redirect = function(l, g) {
5715
5715
  if (Tn.indexOf(g) === -1)
5716
5716
  throw new RangeError("Invalid status code");
5717
- return new L(null, { status: g, headers: { location: l } });
5717
+ return new U(null, { status: g, headers: { location: l } });
5718
5718
  }, o.DOMException = i.DOMException;
5719
5719
  try {
5720
5720
  new o.DOMException();
@@ -5725,61 +5725,61 @@ var Ge = { exports: {} };
5725
5725
  this.stack = N.stack;
5726
5726
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
5727
5727
  }
5728
- function be(l, g) {
5728
+ function Ne(l, g) {
5729
5729
  return new Promise(function(_, N) {
5730
- var O = new V(l, g);
5730
+ var O = new L(l, g);
5731
5731
  if (O.signal && O.signal.aborted)
5732
5732
  return N(new o.DOMException("Aborted", "AbortError"));
5733
5733
  var A = new XMLHttpRequest();
5734
- function he() {
5734
+ function pe() {
5735
5735
  A.abort();
5736
5736
  }
5737
5737
  A.onload = function() {
5738
- var re = {
5738
+ var ie = {
5739
5739
  status: A.status,
5740
5740
  statusText: A.statusText,
5741
- headers: vn(A.getAllResponseHeaders() || "")
5741
+ headers: fe(A.getAllResponseHeaders() || "")
5742
5742
  };
5743
- re.url = "responseURL" in A ? A.responseURL : re.headers.get("X-Request-URL");
5744
- var Oe = "response" in A ? A.response : A.responseText;
5745
- _(new L(Oe, re));
5743
+ ie.url = "responseURL" in A ? A.responseURL : ie.headers.get("X-Request-URL");
5744
+ var ke = "response" in A ? A.response : A.responseText;
5745
+ _(new U(ke, ie));
5746
5746
  }, A.onerror = function() {
5747
5747
  N(new TypeError("Network request failed"));
5748
5748
  }, A.ontimeout = function() {
5749
5749
  N(new TypeError("Network request failed"));
5750
5750
  }, A.onabort = function() {
5751
5751
  N(new o.DOMException("Aborted", "AbortError"));
5752
- }, A.open(O.method, O.url, !0), O.credentials === "include" ? A.withCredentials = !0 : O.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), O.headers.forEach(function(re, Oe) {
5753
- A.setRequestHeader(Oe, re);
5754
- }), O.signal && (O.signal.addEventListener("abort", he), A.onreadystatechange = function() {
5755
- A.readyState === 4 && O.signal.removeEventListener("abort", he);
5752
+ }, A.open(O.method, O.url, !0), O.credentials === "include" ? A.withCredentials = !0 : O.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), O.headers.forEach(function(ie, ke) {
5753
+ A.setRequestHeader(ke, ie);
5754
+ }), O.signal && (O.signal.addEventListener("abort", pe), A.onreadystatechange = function() {
5755
+ A.readyState === 4 && O.signal.removeEventListener("abort", pe);
5756
5756
  }), A.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
5757
5757
  });
5758
5758
  }
5759
- return be.polyfill = !0, i.fetch || (i.fetch = be, i.Headers = y, i.Request = V, i.Response = L), o.Headers = y, o.Request = V, o.Response = L, o.fetch = be, Object.defineProperty(o, "__esModule", { value: !0 }), o;
5759
+ return Ne.polyfill = !0, i.fetch || (i.fetch = Ne, i.Headers = y, i.Request = L, i.Response = U), o.Headers = y, o.Request = L, o.Response = U, o.fetch = Ne, Object.defineProperty(o, "__esModule", { value: !0 }), o;
5760
5760
  })({});
5761
5761
  })(s), s.fetch.ponyfill = !0, delete s.fetch.polyfill;
5762
5762
  var r = s;
5763
5763
  t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
5764
- })(Ge, Ge.exports);
5765
- var Ie = Ge.exports;
5766
- const Ee = /* @__PURE__ */ qr(Ie), Lr = /* @__PURE__ */ In({
5764
+ })(Je, Je.exports);
5765
+ var Ae = Je.exports;
5766
+ const Te = /* @__PURE__ */ qr(Ae), Lr = /* @__PURE__ */ In({
5767
5767
  __proto__: null,
5768
- default: Ee
5769
- }, [Ie]), Q = (e) => {
5768
+ default: Te
5769
+ }, [Ae]), W = (e) => {
5770
5770
  let t = {};
5771
- return e && (typeof Headers < "u" && e instanceof Headers || Lr && Ie.Headers && e instanceof Ie.Headers ? t = $s(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
5771
+ return e && (typeof Headers < "u" && e instanceof Headers || Lr && Ae.Headers && e instanceof Ae.Headers ? t = $s(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
5772
5772
  n && s !== void 0 && (t[n] = s);
5773
5773
  }) : t = e), t;
5774
- }, Dt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Ur = (e) => {
5774
+ }, Mt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Ur = (e) => {
5775
5775
  if (!Array.isArray(e.query)) {
5776
- const s = e, r = [`query=${encodeURIComponent(Dt(s.query))}`];
5776
+ const s = e, r = [`query=${encodeURIComponent(Mt(s.query))}`];
5777
5777
  return e.variables && r.push(`variables=${encodeURIComponent(s.jsonSerializer.stringify(s.variables))}`), s.operationName && r.push(`operationName=${encodeURIComponent(s.operationName)}`), r.join("&");
5778
5778
  }
5779
5779
  if (typeof e.variables < "u" && !Array.isArray(e.variables))
5780
5780
  throw new Error("Cannot create query with given variable type, array expected");
5781
5781
  const t = e, n = e.query.reduce((s, r, i) => (s.push({
5782
- query: Dt(r),
5782
+ query: Mt(r),
5783
5783
  variables: t.variables ? t.jsonSerializer.stringify(t.variables[i]) : void 0
5784
5784
  }), s), []);
5785
5785
  return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
@@ -5790,7 +5790,7 @@ const Ee = /* @__PURE__ */ qr(Ie), Lr = /* @__PURE__ */ In({
5790
5790
  query: s,
5791
5791
  variables: r,
5792
5792
  operationName: i,
5793
- jsonSerializer: a.jsonSerializer ?? it
5793
+ jsonSerializer: a.jsonSerializer ?? at
5794
5794
  });
5795
5795
  const f = {
5796
5796
  method: e,
@@ -5805,19 +5805,19 @@ const Ee = /* @__PURE__ */ qr(Ie), Lr = /* @__PURE__ */ In({
5805
5805
  }
5806
5806
  return h && (m = `${m}?${h}`), await o(m, y);
5807
5807
  };
5808
- class mn {
5808
+ class En {
5809
5809
  constructor(t, n = {}) {
5810
5810
  this.url = t, this.requestConfig = n, this.rawRequest = async (...s) => {
5811
- const [r, i, o] = s, a = Hs(r, i, o), { headers: c, fetch: u = Ee, method: h = "POST", requestMiddleware: d, responseMiddleware: f, ...m } = this.requestConfig, { url: y } = this;
5811
+ const [r, i, o] = s, a = Hs(r, i, o), { headers: c, fetch: u = Te, method: h = "POST", requestMiddleware: d, responseMiddleware: f, ...m } = this.requestConfig, { url: y } = this;
5812
5812
  a.signal !== void 0 && (m.signal = a.signal);
5813
- const { operationName: v } = Me(a.query);
5814
- return qe({
5813
+ const { operationName: v } = Le(a.query);
5814
+ return Ue({
5815
5815
  url: y,
5816
5816
  query: a.query,
5817
5817
  variables: a.variables,
5818
5818
  headers: {
5819
- ...Q(Le(c)),
5820
- ...Q(a.requestHeaders)
5819
+ ...W(Pe(c)),
5820
+ ...W(a.requestHeaders)
5821
5821
  },
5822
5822
  operationName: v,
5823
5823
  fetch: u,
@@ -5830,16 +5830,16 @@ class mn {
5830
5830
  };
5831
5831
  }
5832
5832
  async request(t, ...n) {
5833
- const [s, r] = n, i = Vs(t, s, r), { headers: o, fetch: a = Ee, method: c = "POST", requestMiddleware: u, responseMiddleware: h, ...d } = this.requestConfig, { url: f } = this;
5833
+ const [s, r] = n, i = Vs(t, s, r), { headers: o, fetch: a = Te, method: c = "POST", requestMiddleware: u, responseMiddleware: h, ...d } = this.requestConfig, { url: f } = this;
5834
5834
  i.signal !== void 0 && (d.signal = i.signal);
5835
- const { query: m, operationName: y } = Me(i.document);
5836
- return qe({
5835
+ const { query: m, operationName: y } = Le(i.document);
5836
+ return Ue({
5837
5837
  url: f,
5838
5838
  query: m,
5839
5839
  variables: i.variables,
5840
5840
  headers: {
5841
- ...Q(Le(o)),
5842
- ...Q(i.requestHeaders)
5841
+ ...W(Pe(o)),
5842
+ ...W(i.requestHeaders)
5843
5843
  },
5844
5844
  operationName: y,
5845
5845
  fetch: a,
@@ -5854,18 +5854,18 @@ class mn {
5854
5854
  batchRequests(t, n) {
5855
5855
  const s = Gs(t, n), { headers: r, ...i } = this.requestConfig;
5856
5856
  s.signal !== void 0 && (i.signal = s.signal);
5857
- const o = s.documents.map(({ document: c }) => Me(c).query), a = s.documents.map(({ variables: c }) => c);
5858
- return qe({
5857
+ const o = s.documents.map(({ document: c }) => Le(c).query), a = s.documents.map(({ variables: c }) => c);
5858
+ return Ue({
5859
5859
  url: this.url,
5860
5860
  query: o,
5861
5861
  // @ts-expect-error TODO reconcile batch variables into system.
5862
5862
  variables: a,
5863
5863
  headers: {
5864
- ...Q(Le(r)),
5865
- ...Q(s.requestHeaders)
5864
+ ...W(Pe(r)),
5865
+ ...W(s.requestHeaders)
5866
5866
  },
5867
5867
  operationName: void 0,
5868
- fetch: this.requestConfig.fetch ?? Ee,
5868
+ fetch: this.requestConfig.fetch ?? Te,
5869
5869
  method: this.requestConfig.method || "POST",
5870
5870
  fetchOptions: i,
5871
5871
  middleware: this.requestConfig.requestMiddleware
@@ -5890,8 +5890,8 @@ class mn {
5890
5890
  return this.url = t, this;
5891
5891
  }
5892
5892
  }
5893
- const qe = async (e) => {
5894
- const { query: t, variables: n, fetchOptions: s } = e, r = Pr(js(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Br(o, s.jsonSerializer ?? it), c = Array.isArray(a) ? !a.some(({ data: h }) => !h) : !!a.data, u = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || s.errorPolicy === "all" || s.errorPolicy === "ignore";
5893
+ const Ue = async (e) => {
5894
+ const { query: t, variables: n, fetchOptions: s } = e, r = Pr(js(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Br(o, s.jsonSerializer ?? at), c = Array.isArray(a) ? !a.some(({ data: h }) => !h) : !!a.data, u = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || s.errorPolicy === "all" || s.errorPolicy === "ignore";
5895
5895
  if (o.ok && u && c) {
5896
5896
  const { errors: h, ...d } = (Array.isArray(a), a), f = s.errorPolicy === "ignore" ? d : a;
5897
5897
  return {
@@ -5903,21 +5903,21 @@ const qe = async (e) => {
5903
5903
  const h = typeof a == "string" ? {
5904
5904
  error: a
5905
5905
  } : a;
5906
- throw new ae(
5906
+ throw new ce(
5907
5907
  // @ts-expect-error TODO
5908
5908
  { ...h, status: o.status, headers: o.headers },
5909
5909
  { query: t, variables: n }
5910
5910
  );
5911
5911
  }
5912
5912
  };
5913
- async function ct(e, t, ...n) {
5913
+ async function dt(e, t, ...n) {
5914
5914
  const s = zs(e, t, ...n);
5915
- return new mn(s.url).request({
5915
+ return new En(s.url).request({
5916
5916
  ...s
5917
5917
  });
5918
5918
  }
5919
5919
  const Fr = (e, t, n, s) => {
5920
- const r = s ?? it;
5920
+ const r = s ?? at;
5921
5921
  if (!Array.isArray(e))
5922
5922
  return r.stringify({ query: e, variables: t, operationName: n });
5923
5923
  if (typeof t < "u" && !Array.isArray(t))
@@ -5929,7 +5929,7 @@ const Fr = (e, t, n, s) => {
5929
5929
  return e.headers.forEach((s, r) => {
5930
5930
  r.toLowerCase() === "content-type" && (n = s);
5931
5931
  }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
5932
- }, Le = (e) => typeof e == "function" ? e() : e, jr = z(
5932
+ }, Pe = (e) => typeof e == "function" ? e() : e, jr = J(
5933
5933
  async ({ input: e }) => {
5934
5934
  var t;
5935
5935
  if (!e.endpoint || e.endpoint === "")
@@ -5941,7 +5941,7 @@ const Fr = (e, t, n, s) => {
5941
5941
  if (!e.requestHeaders)
5942
5942
  throw new Error("No request headers provided.");
5943
5943
  try {
5944
- const n = await ct(
5944
+ const n = await dt(
5945
5945
  e.endpoint,
5946
5946
  e.document,
5947
5947
  { items: e.items },
@@ -5958,14 +5958,14 @@ const Fr = (e, t, n, s) => {
5958
5958
  throw new Error("Request to add item(s) failed.");
5959
5959
  }
5960
5960
  }
5961
- ), $r = z(async ({ input: e }) => {
5961
+ ), $r = J(async ({ input: e }) => {
5962
5962
  var t;
5963
5963
  if (!e.endpoint || e.endpoint === "")
5964
5964
  throw new Error("No endpoint provided.");
5965
5965
  if (e.items.length < 1)
5966
5966
  throw new Error("No items provided.");
5967
5967
  try {
5968
- const n = await ct(
5968
+ const n = await dt(
5969
5969
  e.endpoint,
5970
5970
  ""
5971
5971
  // input.document,
@@ -5982,7 +5982,7 @@ const Fr = (e, t, n, s) => {
5982
5982
  } catch {
5983
5983
  throw new Error("Request to remove item(s) failed.");
5984
5984
  }
5985
- }), Ue = typeof window > "u", Vr = z(
5985
+ }), Fe = typeof window > "u", Vr = J(
5986
5986
  async ({ input: e }) => {
5987
5987
  var n, s, r, i;
5988
5988
  if (!e.endpoint)
@@ -5995,9 +5995,9 @@ const Fr = (e, t, n, s) => {
5995
5995
  throw console.log("no request document"), new Error("No request document provided.");
5996
5996
  if (!e.requestHeaders)
5997
5997
  throw console.log("no headers"), new Error("No request headers provided.");
5998
- const t = new mn(
5999
- Ue ? e.endpointSsr : e.endpoint,
6000
- Ue ? { fetch, method: "POST" } : {
5998
+ const t = new En(
5999
+ Fe ? e.endpointSsr : e.endpoint,
6000
+ Fe ? { fetch, method: "POST" } : {
6001
6001
  credentials: "include",
6002
6002
  method: "POST",
6003
6003
  mode: "cors"
@@ -6005,9 +6005,9 @@ const Fr = (e, t, n, s) => {
6005
6005
  );
6006
6006
  try {
6007
6007
  const { data: o, headers: a, status: c, errors: u, extensions: h } = await t.rawRequest(
6008
- yn(e.document),
6008
+ gn(e.document),
6009
6009
  {},
6010
- Ue ? {
6010
+ Fe ? {
6011
6011
  ...e.requestHeaders,
6012
6012
  Cookie: `quote_${e.locale}=${e.quoteId ?? ""}`
6013
6013
  } : e.requestHeaders
@@ -6024,7 +6024,7 @@ const Fr = (e, t, n, s) => {
6024
6024
  throw console.log("refresh error", o), new Error("Request to add item(s) failed.");
6025
6025
  }
6026
6026
  }
6027
- ), Hr = z(async ({ input: e }) => {
6027
+ ), Hr = J(async ({ input: e }) => {
6028
6028
  var t;
6029
6029
  if (!e.endpoint || e.endpoint === "")
6030
6030
  throw new Error("No endpoint provided.");
@@ -6035,7 +6035,7 @@ const Fr = (e, t, n, s) => {
6035
6035
  if (!e.requestHeaders)
6036
6036
  throw new Error("No request headers provided.");
6037
6037
  try {
6038
- const n = await ct(
6038
+ const n = await dt(
6039
6039
  e.endpoint,
6040
6040
  e.document,
6041
6041
  { items: e.items },
@@ -6051,7 +6051,7 @@ const Fr = (e, t, n, s) => {
6051
6051
  } catch {
6052
6052
  throw new Error("Request to add item(s) failed.");
6053
6053
  }
6054
- }), Gr = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", zr = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Rt = Ae({
6054
+ }), Gr = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", zr = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, qt = we({
6055
6055
  types: {
6056
6056
  context: {},
6057
6057
  emitted: {},
@@ -6060,9 +6060,9 @@ const Fr = (e, t, n, s) => {
6060
6060
  },
6061
6061
  actions: {
6062
6062
  addItems: D(Ms),
6063
- notifyAddItems: Ce(qs),
6064
- notifyRemoveItems: Ce(Ls),
6065
- notifyUpdateItems: Ce(Us),
6063
+ notifyAddItems: Re(qs),
6064
+ notifyRemoveItems: Re(Ls),
6065
+ notifyUpdateItems: Re(Us),
6066
6066
  removeItems: D(Ps),
6067
6067
  refresh: D(Fs),
6068
6068
  updateItems: D(Bs)
@@ -6082,7 +6082,7 @@ const Fr = (e, t, n, s) => {
6082
6082
  id: "quote",
6083
6083
  initial: "initializing",
6084
6084
  context: ({ input: e }) => {
6085
- var t, n, s, r, i, o, a, c, u, h, d, f, m, y, v, S, x, R, k, M, U, $;
6085
+ var t, n, s, r, i, o, a, c, u, h, d, f, m, y, v, S, x, R, k, M, P, V, H, L, he, fe;
6086
6086
  return {
6087
6087
  quote: {
6088
6088
  id: "",
@@ -6150,12 +6150,12 @@ const Fr = (e, t, n, s) => {
6150
6150
  requestHeaders: ((y = (m = (f = e == null ? void 0 : e.initialContext) == null ? void 0 : f.graphql) == null ? void 0 : m.addItems) == null ? void 0 : y.requestHeaders) ?? void 0
6151
6151
  },
6152
6152
  removeItems: {
6153
- document: ((S = (v = e.initialContext.graphql) == null ? void 0 : v.removeItems) == null ? void 0 : S.document) ?? "",
6154
- requestHeaders: ((R = (x = e.initialContext.graphql) == null ? void 0 : x.removeItems) == null ? void 0 : R.requestHeaders) ?? void 0
6153
+ document: ((x = (S = (v = e == null ? void 0 : e.initialContext) == null ? void 0 : v.graphql) == null ? void 0 : S.removeItems) == null ? void 0 : x.document) ?? "",
6154
+ requestHeaders: ((M = (k = (R = e == null ? void 0 : e.initialContext) == null ? void 0 : R.graphql) == null ? void 0 : k.removeItems) == null ? void 0 : M.requestHeaders) ?? void 0
6155
6155
  },
6156
6156
  updateItems: {
6157
- document: ((M = (k = e.initialContext.graphql) == null ? void 0 : k.updateItems) == null ? void 0 : M.document) ?? "",
6158
- requestHeaders: (($ = (U = e.initialContext.graphql) == null ? void 0 : U.updateItems) == null ? void 0 : $.requestHeaders) ?? void 0
6157
+ document: ((H = (V = (P = e == null ? void 0 : e.initialContext) == null ? void 0 : P.graphql) == null ? void 0 : V.updateItems) == null ? void 0 : H.document) ?? "",
6158
+ requestHeaders: ((fe = (he = (L = e == null ? void 0 : e.initialContext) == null ? void 0 : L.graphql) == null ? void 0 : he.updateItems) == null ? void 0 : fe.requestHeaders) ?? void 0
6159
6159
  }
6160
6160
  }
6161
6161
  };
@@ -6425,15 +6425,15 @@ const Fr = (e, t, n, s) => {
6425
6425
  // removingGiftCard: {},
6426
6426
  // applyingSettings: {},
6427
6427
  }
6428
- }), gn = Je(
6428
+ }), vn = Xe(
6429
6429
  {}
6430
6430
  ), ti = () => {
6431
6431
  var c;
6432
- const e = Ye(gn);
6432
+ const e = Qe(vn);
6433
6433
  if (!e || !e.getSnapshot)
6434
6434
  throw new Error("quoteActor is not properly initialized");
6435
- const [t, n] = Mt(() => e.getSnapshot());
6436
- qt(() => {
6435
+ const [t, n] = Lt(() => e.getSnapshot());
6436
+ Ut(() => {
6437
6437
  if (!e || !e.getSnapshot) {
6438
6438
  console.error("quoteActor is not properly initialized");
6439
6439
  return;
@@ -6464,14 +6464,14 @@ const Fr = (e, t, n, s) => {
6464
6464
  graphql: {}
6465
6465
  }) => typeof window < "u" ? (console.warn(
6466
6466
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
6467
- ), B(Rt, {
6467
+ ), j(qt, {
6468
6468
  inspect: e.inspect,
6469
6469
  input: {
6470
6470
  initialContext: {
6471
6471
  endpoints: e.endpoints
6472
6472
  }
6473
6473
  }
6474
- }).start()) : B(Rt, {
6474
+ }).start()) : j(qt, {
6475
6475
  input: {
6476
6476
  initialContext: {
6477
6477
  endpoints: e.endpoints,
@@ -6485,19 +6485,19 @@ const Fr = (e, t, n, s) => {
6485
6485
  inspect: e.inspect
6486
6486
  }).start();
6487
6487
  function si({ actor: e, children: t }) {
6488
- return /* @__PURE__ */ ze(gn.Provider, { value: e, children: t });
6488
+ return /* @__PURE__ */ Ye(vn.Provider, { value: e, children: t });
6489
6489
  }
6490
6490
  export {
6491
- nn as AuthContext,
6491
+ rn as AuthContext,
6492
6492
  Wr as AuthProvider,
6493
- gn as QuoteContext,
6493
+ vn as QuoteContext,
6494
6494
  si as QuoteProvider,
6495
- sn as ToastContext,
6495
+ on as ToastContext,
6496
6496
  ei as ToastProvider,
6497
- xt as authMachine,
6497
+ bt as authMachine,
6498
6498
  Qr as getAuth,
6499
6499
  ni as getQuote,
6500
- Rt as quoteMachine,
6500
+ qt as quoteMachine,
6501
6501
  Rs as timerMachine,
6502
6502
  Kr as toastMachine,
6503
6503
  Xr as useAuth,