@clicktap/state 0.13.14 → 0.13.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +23 -23
- package/index.mjs +584 -504
- package/package.json +1 -1
- package/quote/QuoteProvider.d.ts +54 -6
- package/quote/actions/addItems.d.ts +6 -1
- package/quote/actions/index.d.ts +2 -0
- package/quote/actions/notifyAddItems.d.ts +6 -0
- package/quote/actions/notifyRemoveItems.d.ts +6 -0
- package/quote/actions/refresh.d.ts +5 -1
- package/quote/actions/removeItems.d.ts +6 -1
- package/quote/actors/addItems.d.ts +4 -0
- package/quote/actors/removeItems.d.ts +4 -0
- package/quote/quote.d.ts +18 -2
- package/quote/types.d.ts +16 -1
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as Ge } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as ze, useContext as Je, useState as
|
|
3
|
-
function
|
|
2
|
+
import { createContext as ze, useContext as Je, useState as Rt, useEffect as Mt, cloneElement as _n } from "react";
|
|
3
|
+
function In(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const s = t[n];
|
|
6
6
|
if (typeof s != "string" && !Array.isArray(s)) {
|
|
@@ -16,7 +16,7 @@ function _n(e, t) {
|
|
|
16
16
|
}
|
|
17
17
|
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Sn() {
|
|
20
20
|
if (typeof globalThis < "u")
|
|
21
21
|
return globalThis;
|
|
22
22
|
if (typeof self < "u")
|
|
@@ -26,15 +26,15 @@ function In() {
|
|
|
26
26
|
if (typeof global < "u")
|
|
27
27
|
return global;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const e =
|
|
29
|
+
function An() {
|
|
30
|
+
const e = Sn();
|
|
31
31
|
if (e.__xstate__)
|
|
32
32
|
return e.__xstate__;
|
|
33
33
|
}
|
|
34
34
|
const xn = (e) => {
|
|
35
35
|
if (typeof window > "u")
|
|
36
36
|
return;
|
|
37
|
-
const t =
|
|
37
|
+
const t = An();
|
|
38
38
|
t && t.register(e);
|
|
39
39
|
};
|
|
40
40
|
class at {
|
|
@@ -66,65 +66,65 @@ class at {
|
|
|
66
66
|
this._last = null;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const Lt = ".",
|
|
70
|
-
function
|
|
69
|
+
const Lt = ".", wn = "", qt = "", bn = "#", On = "*", Pt = "xstate.init", Nn = "xstate.error", ae = "xstate.stop";
|
|
70
|
+
function kn(e, t) {
|
|
71
71
|
return {
|
|
72
72
|
type: `xstate.after.${e}.${t}`
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Pe(e, t) {
|
|
76
76
|
return {
|
|
77
77
|
type: `xstate.done.state.${e}`,
|
|
78
78
|
output: t
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Cn(e, t) {
|
|
82
82
|
return {
|
|
83
83
|
type: `xstate.done.actor.${e}`,
|
|
84
84
|
output: t
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ft(e, t) {
|
|
88
88
|
return {
|
|
89
89
|
type: `xstate.error.actor.${e}`,
|
|
90
90
|
error: t
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Ut(e) {
|
|
94
94
|
return {
|
|
95
95
|
type: Pt,
|
|
96
96
|
input: e
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function P(e) {
|
|
100
100
|
setTimeout(() => {
|
|
101
101
|
throw e;
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const Dn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
|
|
105
105
|
function ct(e, t) {
|
|
106
106
|
return `${e.sessionId}.${t}`;
|
|
107
107
|
}
|
|
108
|
-
let
|
|
109
|
-
function
|
|
108
|
+
let Rn = 0;
|
|
109
|
+
function Mn(e, t) {
|
|
110
110
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Set(), o = {}, {
|
|
111
111
|
clock: a,
|
|
112
112
|
logger: c
|
|
113
113
|
} = t, u = {
|
|
114
114
|
schedule: (f, m, y, v, S = Math.random().toString(36).slice(2)) => {
|
|
115
|
-
const
|
|
115
|
+
const x = {
|
|
116
116
|
source: f,
|
|
117
117
|
target: m,
|
|
118
118
|
event: y,
|
|
119
119
|
delay: v,
|
|
120
120
|
id: S,
|
|
121
121
|
startedAt: Date.now()
|
|
122
|
-
},
|
|
123
|
-
d._snapshot._scheduledEvents[
|
|
124
|
-
const
|
|
125
|
-
delete o[
|
|
122
|
+
}, C = ct(f, S);
|
|
123
|
+
d._snapshot._scheduledEvents[C] = x;
|
|
124
|
+
const R = a.setTimeout(() => {
|
|
125
|
+
delete o[C], delete d._snapshot._scheduledEvents[C], d._relay(f, m, y);
|
|
126
126
|
}, v);
|
|
127
|
-
o[
|
|
127
|
+
o[C] = R;
|
|
128
128
|
},
|
|
129
129
|
cancel: (f, m) => {
|
|
130
130
|
const y = ct(f, m), v = o[y];
|
|
@@ -151,7 +151,7 @@ function Rn(e, t) {
|
|
|
151
151
|
_snapshot: {
|
|
152
152
|
_scheduledEvents: ((t == null ? void 0 : t.snapshot) && t.snapshot.scheduler) ?? {}
|
|
153
153
|
},
|
|
154
|
-
_bookId: () => `x:${
|
|
154
|
+
_bookId: () => `x:${Rn++}`,
|
|
155
155
|
_register: (f, m) => (n.set(f, m), f),
|
|
156
156
|
_unregister: (f) => {
|
|
157
157
|
n.delete(f.sessionId);
|
|
@@ -191,10 +191,10 @@ function Rn(e, t) {
|
|
|
191
191
|
source: y,
|
|
192
192
|
target: v,
|
|
193
193
|
event: S,
|
|
194
|
-
delay:
|
|
195
|
-
id:
|
|
194
|
+
delay: x,
|
|
195
|
+
id: C
|
|
196
196
|
} = f[m];
|
|
197
|
-
u.schedule(y, v, S,
|
|
197
|
+
u.schedule(y, v, S, x, C);
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
200
|
_clock: a,
|
|
@@ -202,12 +202,12 @@ function Rn(e, t) {
|
|
|
202
202
|
};
|
|
203
203
|
return d;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Bt(e, t) {
|
|
206
206
|
const n = ut(e), s = ut(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 ?
|
|
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 ? Bt(n[r], s[r]) : !1);
|
|
208
208
|
}
|
|
209
209
|
function Ye(e) {
|
|
210
|
-
if (
|
|
210
|
+
if ($t(e))
|
|
211
211
|
return e;
|
|
212
212
|
let t = [], n = "";
|
|
213
213
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -224,7 +224,7 @@ function Ye(e) {
|
|
|
224
224
|
return t.push(n), t;
|
|
225
225
|
}
|
|
226
226
|
function ut(e) {
|
|
227
|
-
if (
|
|
227
|
+
if (ls(e))
|
|
228
228
|
return e.value;
|
|
229
229
|
if (typeof e != "string")
|
|
230
230
|
return e;
|
|
@@ -253,11 +253,11 @@ function dt(e, t) {
|
|
|
253
253
|
}
|
|
254
254
|
return n;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
256
|
+
function jt(e) {
|
|
257
|
+
return $t(e) ? e : [e];
|
|
258
258
|
}
|
|
259
259
|
function F(e) {
|
|
260
|
-
return e === void 0 ? [] :
|
|
260
|
+
return e === void 0 ? [] : jt(e);
|
|
261
261
|
}
|
|
262
262
|
function Fe(e, t, n, s) {
|
|
263
263
|
return typeof e == "function" ? e({
|
|
@@ -266,19 +266,19 @@ function Fe(e, t, n, s) {
|
|
|
266
266
|
self: s
|
|
267
267
|
}) : e;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function $t(e) {
|
|
270
270
|
return Array.isArray(e);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function qn(e) {
|
|
273
273
|
return e.type.startsWith("xstate.error.actor");
|
|
274
274
|
}
|
|
275
275
|
function X(e) {
|
|
276
|
-
return
|
|
276
|
+
return jt(e).map((t) => typeof t > "u" || typeof t == "string" ? {
|
|
277
277
|
target: t
|
|
278
278
|
} : t);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
if (!(e === void 0 || e ===
|
|
280
|
+
function Vt(e) {
|
|
281
|
+
if (!(e === void 0 || e === wn))
|
|
282
282
|
return F(e);
|
|
283
283
|
}
|
|
284
284
|
function lt(e, t, n) {
|
|
@@ -312,7 +312,7 @@ const Pn = {
|
|
|
312
312
|
logger: console.log.bind(console),
|
|
313
313
|
devTools: !1
|
|
314
314
|
};
|
|
315
|
-
class
|
|
315
|
+
class Fn {
|
|
316
316
|
/**
|
|
317
317
|
* Creates a new actor instance for the given logic with the provided options, if any.
|
|
318
318
|
*
|
|
@@ -333,7 +333,7 @@ class qn {
|
|
|
333
333
|
systemId: u,
|
|
334
334
|
inspect: h
|
|
335
335
|
} = s;
|
|
336
|
-
this.system = o ? o.system :
|
|
336
|
+
this.system = o ? o.system : Mn(this, {
|
|
337
337
|
clock: r,
|
|
338
338
|
logger: i
|
|
339
339
|
}), h && !o && this.system.inspect(lt(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 = {
|
|
@@ -393,7 +393,7 @@ class qn {
|
|
|
393
393
|
try {
|
|
394
394
|
(r = o.next) == null || r.call(o, t);
|
|
395
395
|
} catch (a) {
|
|
396
|
-
|
|
396
|
+
P(a);
|
|
397
397
|
}
|
|
398
398
|
break;
|
|
399
399
|
case "done":
|
|
@@ -401,9 +401,9 @@ class qn {
|
|
|
401
401
|
try {
|
|
402
402
|
(i = o.next) == null || i.call(o, t);
|
|
403
403
|
} catch (a) {
|
|
404
|
-
|
|
404
|
+
P(a);
|
|
405
405
|
}
|
|
406
|
-
this._stopProcedure(), this._complete(), this._doneEvent =
|
|
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;
|
|
408
408
|
case "error":
|
|
409
409
|
this._error(this._snapshot.error);
|
|
@@ -475,18 +475,18 @@ class qn {
|
|
|
475
475
|
try {
|
|
476
476
|
(i = r.complete) == null || i.call(r);
|
|
477
477
|
} catch (o) {
|
|
478
|
-
|
|
478
|
+
P(o);
|
|
479
479
|
}
|
|
480
480
|
break;
|
|
481
481
|
case "error": {
|
|
482
482
|
const o = this._snapshot.error;
|
|
483
483
|
if (!r.error)
|
|
484
|
-
|
|
484
|
+
P(o);
|
|
485
485
|
else
|
|
486
486
|
try {
|
|
487
487
|
r.error(o);
|
|
488
488
|
} catch (a) {
|
|
489
|
-
|
|
489
|
+
P(a);
|
|
490
490
|
}
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
@@ -523,7 +523,7 @@ class qn {
|
|
|
523
523
|
error: () => {
|
|
524
524
|
}
|
|
525
525
|
}), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = k.Running;
|
|
526
|
-
const t =
|
|
526
|
+
const t = Ut(this.options.input);
|
|
527
527
|
switch (this.system._sendInspectionEvent({
|
|
528
528
|
type: "@xstate.event",
|
|
529
529
|
sourceRef: this._parent,
|
|
@@ -588,13 +588,13 @@ class qn {
|
|
|
588
588
|
try {
|
|
589
589
|
(t = n.complete) == null || t.call(n);
|
|
590
590
|
} catch (s) {
|
|
591
|
-
|
|
591
|
+
P(s);
|
|
592
592
|
}
|
|
593
593
|
this.observers.clear();
|
|
594
594
|
}
|
|
595
595
|
_reportError(t) {
|
|
596
596
|
if (!this.observers.size) {
|
|
597
|
-
this._parent ||
|
|
597
|
+
this._parent || P(t);
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
600
|
let n = !1;
|
|
@@ -604,13 +604,13 @@ class qn {
|
|
|
604
604
|
try {
|
|
605
605
|
r == null || r(t);
|
|
606
606
|
} catch (i) {
|
|
607
|
-
|
|
607
|
+
P(i);
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
this.observers.clear(), n &&
|
|
610
|
+
this.observers.clear(), n && P(t);
|
|
611
611
|
}
|
|
612
612
|
_error(t) {
|
|
613
|
-
this._stopProcedure(), this._reportError(t), this._parent && this.system._relay(this, this._parent,
|
|
613
|
+
this._stopProcedure(), this._reportError(t), this._parent && this.system._relay(this, this._parent, Ft(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
|
|
@@ -661,7 +661,7 @@ class qn {
|
|
|
661
661
|
getPersistedSnapshot(t) {
|
|
662
662
|
return this.logic.getPersistedSnapshot(this._snapshot, t);
|
|
663
663
|
}
|
|
664
|
-
[
|
|
664
|
+
[Dn]() {
|
|
665
665
|
return this;
|
|
666
666
|
}
|
|
667
667
|
/**
|
|
@@ -683,25 +683,25 @@ class qn {
|
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
function U(e, ...[t]) {
|
|
686
|
-
return new
|
|
686
|
+
return new Fn(e, t);
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function Un(e, t, n, s, {
|
|
689
689
|
sendId: r
|
|
690
690
|
}) {
|
|
691
691
|
const i = typeof r == "function" ? r(n, s) : r;
|
|
692
692
|
return [t, i];
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Bn(e, t) {
|
|
695
695
|
e.defer(() => {
|
|
696
696
|
e.system.scheduler.cancel(e.self, t);
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function jn(e) {
|
|
700
700
|
function t(n, s) {
|
|
701
701
|
}
|
|
702
|
-
return t.type = "xstate.cancel", t.sendId = e, t.resolve =
|
|
702
|
+
return t.type = "xstate.cancel", t.sendId = e, t.resolve = Un, t.execute = Bn, t;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function $n(e, t, n, s, {
|
|
705
705
|
id: r,
|
|
706
706
|
systemId: i,
|
|
707
707
|
src: o,
|
|
@@ -731,7 +731,7 @@ function jn(e, t, n, s, {
|
|
|
731
731
|
actorRef: d
|
|
732
732
|
}];
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Vn(e, {
|
|
735
735
|
id: t,
|
|
736
736
|
actorRef: n
|
|
737
737
|
}) {
|
|
@@ -739,7 +739,7 @@ function $n(e, {
|
|
|
739
739
|
n._processingStatus !== k.Stopped && n.start();
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Hn(...[e, {
|
|
743
743
|
id: t,
|
|
744
744
|
systemId: n,
|
|
745
745
|
input: s,
|
|
@@ -747,9 +747,9 @@ function Vn(...[e, {
|
|
|
747
747
|
} = {}]) {
|
|
748
748
|
function i(o, a) {
|
|
749
749
|
}
|
|
750
|
-
return i.type = "snapshot.spawnChild", i.id = t, i.systemId = n, i.src = e, i.input = s, i.syncSnapshot = r, i.resolve =
|
|
750
|
+
return i.type = "snapshot.spawnChild", i.id = t, i.systemId = n, i.src = e, i.input = s, i.syncSnapshot = r, i.resolve = $n, i.execute = Vn, i;
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Gn(e, t, n, s, {
|
|
753
753
|
actorRef: r
|
|
754
754
|
}) {
|
|
755
755
|
const i = typeof r == "function" ? r(n, s) : r, o = typeof i == "string" ? t.children[i] : i;
|
|
@@ -760,7 +760,7 @@ function Hn(e, t, n, s, {
|
|
|
760
760
|
children: a
|
|
761
761
|
}), o];
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function zn(e, t) {
|
|
764
764
|
if (t) {
|
|
765
765
|
if (e.system._unregister(t), t._processingStatus !== k.Running) {
|
|
766
766
|
e.stopChild(t);
|
|
@@ -771,10 +771,10 @@ function Gn(e, t) {
|
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Ht(e) {
|
|
775
775
|
function t(n, s) {
|
|
776
776
|
}
|
|
777
|
-
return t.type = "xstate.stopChild", t.actorRef = e, t.resolve =
|
|
777
|
+
return t.type = "xstate.stopChild", t.actorRef = e, t.resolve = Gn, t.execute = zn, t;
|
|
778
778
|
}
|
|
779
779
|
function We(e, t, n, s) {
|
|
780
780
|
const {
|
|
@@ -812,7 +812,7 @@ function ue(e, t) {
|
|
|
812
812
|
return n;
|
|
813
813
|
}
|
|
814
814
|
function ve(e) {
|
|
815
|
-
const t = new Set(e), n =
|
|
815
|
+
const t = new Set(e), n = zt(t);
|
|
816
816
|
for (const s of t)
|
|
817
817
|
if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
|
|
818
818
|
ft(s).forEach((r) => t.add(r));
|
|
@@ -831,7 +831,7 @@ function ve(e) {
|
|
|
831
831
|
}
|
|
832
832
|
return t;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Gt(e, t) {
|
|
835
835
|
const n = t.get(e);
|
|
836
836
|
if (!n)
|
|
837
837
|
return {};
|
|
@@ -845,26 +845,26 @@ function Ht(e, t) {
|
|
|
845
845
|
}
|
|
846
846
|
const s = {};
|
|
847
847
|
for (const r of n)
|
|
848
|
-
s[r.key] =
|
|
848
|
+
s[r.key] = Gt(r, t);
|
|
849
849
|
return s;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function zt(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
|
|
857
|
+
function Jt(e, t) {
|
|
858
858
|
const n = ve(t);
|
|
859
|
-
return
|
|
859
|
+
return Gt(e, zt(n));
|
|
860
860
|
}
|
|
861
861
|
function Ze(e, t) {
|
|
862
862
|
return t.type === "compound" ? Z(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? Z(t).every((n) => Ze(e, n)) : t.type === "final";
|
|
863
863
|
}
|
|
864
|
-
const Se = (e) => e[0] ===
|
|
865
|
-
function
|
|
864
|
+
const Se = (e) => e[0] === bn;
|
|
865
|
+
function Jn(e, t) {
|
|
866
866
|
return e.transitions.get(t) || [...e.transitions.keys()].filter((s) => {
|
|
867
|
-
if (s ===
|
|
867
|
+
if (s === On)
|
|
868
868
|
return !0;
|
|
869
869
|
if (!s.endsWith(".*"))
|
|
870
870
|
return !1;
|
|
@@ -879,16 +879,16 @@ function zn(e, t) {
|
|
|
879
879
|
return !0;
|
|
880
880
|
}).sort((s, r) => r.length - s.length).flatMap((s) => e.transitions.get(s));
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function Yn(e) {
|
|
883
883
|
const t = e.config.after;
|
|
884
884
|
if (!t)
|
|
885
885
|
return [];
|
|
886
886
|
const n = (r, i) => {
|
|
887
|
-
const o =
|
|
888
|
-
return e.entry.push(
|
|
887
|
+
const o = kn(r, e.id), a = o.type;
|
|
888
|
+
return e.entry.push(Ts(o, {
|
|
889
889
|
id: a,
|
|
890
890
|
delay: r
|
|
891
|
-
})), e.exit.push(
|
|
891
|
+
})), e.exit.push(jn(a)), a;
|
|
892
892
|
};
|
|
893
893
|
return Object.keys(t).flatMap((r, i) => {
|
|
894
894
|
const o = t[r], a = typeof o == "string" ? {
|
|
@@ -910,7 +910,7 @@ function Jn(e) {
|
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
function $(e, t, n) {
|
|
913
|
-
const s =
|
|
913
|
+
const s = Vt(n.target), r = n.reenter ?? !1, i = Wn(e, s), o = {
|
|
914
914
|
...n,
|
|
915
915
|
actions: F(n.actions),
|
|
916
916
|
guard: n.guard,
|
|
@@ -926,11 +926,11 @@ function $(e, t, n) {
|
|
|
926
926
|
};
|
|
927
927
|
return o;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
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 ===
|
|
933
|
+
if (n === qt)
|
|
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
936
|
t.set(n, X(s).map((r) => $(e, n, r)));
|
|
@@ -959,7 +959,7 @@ function Yn(e) {
|
|
|
959
959
|
}
|
|
960
960
|
return t;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function Qn(e, t) {
|
|
963
963
|
const n = typeof t == "string" ? e.states[t] : t ? e.states[t.target] : void 0;
|
|
964
964
|
if (!n && t)
|
|
965
965
|
throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);
|
|
@@ -977,7 +977,7 @@ function Xn(e, t) {
|
|
|
977
977
|
};
|
|
978
978
|
return s;
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Wn(e, t) {
|
|
981
981
|
if (t !== void 0)
|
|
982
982
|
return t.map((n) => {
|
|
983
983
|
if (typeof n != "string")
|
|
@@ -999,8 +999,8 @@ ${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
|
|
1003
|
-
const t =
|
|
1002
|
+
function Yt(e) {
|
|
1003
|
+
const t = Vt(e.config.target);
|
|
1004
1004
|
return t ? {
|
|
1005
1005
|
target: t.map((n) => typeof n == "string" ? Te(e.parent, n) : n)
|
|
1006
1006
|
} : e.parent.initial;
|
|
@@ -1009,13 +1009,13 @@ function V(e) {
|
|
|
1009
1009
|
return e.type === "history";
|
|
1010
1010
|
}
|
|
1011
1011
|
function ft(e) {
|
|
1012
|
-
const t =
|
|
1012
|
+
const t = Xt(e);
|
|
1013
1013
|
for (const n of t)
|
|
1014
1014
|
for (const s of ue(n, e))
|
|
1015
1015
|
t.add(s);
|
|
1016
1016
|
return t;
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function Xt(e) {
|
|
1019
1019
|
const t = /* @__PURE__ */ new Set();
|
|
1020
1020
|
function n(s) {
|
|
1021
1021
|
if (!t.has(s)) {
|
|
@@ -1070,15 +1070,15 @@ function _e(e, t) {
|
|
|
1070
1070
|
return r.concat(a);
|
|
1071
1071
|
}, []));
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Kn(e, t, n, s) {
|
|
1074
1074
|
const i = ee(e, t).next(n, s);
|
|
1075
1075
|
return !i || !i.length ? e.next(n, s) : i;
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function Zn(e, t, n, s) {
|
|
1078
1078
|
const r = Object.keys(t), i = ee(e, r[0]), o = et(i, t[r[0]], n, s);
|
|
1079
1079
|
return !o || !o.length ? e.next(n, s) : o;
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function es(e, t, n, s) {
|
|
1082
1082
|
const r = [];
|
|
1083
1083
|
for (const i of Object.keys(t)) {
|
|
1084
1084
|
const o = t[i];
|
|
@@ -1090,9 +1090,9 @@ function Zn(e, t, n, s) {
|
|
|
1090
1090
|
return r.length ? r : e.next(n, s);
|
|
1091
1091
|
}
|
|
1092
1092
|
function et(e, t, n, s) {
|
|
1093
|
-
return typeof t == "string" ?
|
|
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
|
-
function
|
|
1095
|
+
function ts(e) {
|
|
1096
1096
|
return Object.keys(e.states).map((t) => e.states[t]).filter((t) => t.type === "history");
|
|
1097
1097
|
}
|
|
1098
1098
|
function B(e, t) {
|
|
@@ -1101,7 +1101,7 @@ function B(e, t) {
|
|
|
1101
1101
|
n = n.parent;
|
|
1102
1102
|
return n.parent === t;
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function ns(e, t) {
|
|
1105
1105
|
const n = new Set(e), s = new Set(t);
|
|
1106
1106
|
for (const r of n)
|
|
1107
1107
|
if (s.has(r))
|
|
@@ -1111,13 +1111,13 @@ function ts(e, t) {
|
|
|
1111
1111
|
return !0;
|
|
1112
1112
|
return !1;
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function Qt(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 (
|
|
1120
|
+
if (ns(Ue([r], t, n), Ue([a], t, n)))
|
|
1121
1121
|
if (B(r.source, a.source))
|
|
1122
1122
|
o.add(a);
|
|
1123
1123
|
else {
|
|
@@ -1132,7 +1132,7 @@ function Xt(e, t, n) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
return Array.from(s);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function ss(e) {
|
|
1136
1136
|
const [t, ...n] = e;
|
|
1137
1137
|
for (const s of ue(t, void 0))
|
|
1138
1138
|
if (n.every((r) => B(r, s)))
|
|
@@ -1148,19 +1148,19 @@ function tt(e, t) {
|
|
|
1148
1148
|
for (const r of t[s.id])
|
|
1149
1149
|
n.add(r);
|
|
1150
1150
|
else
|
|
1151
|
-
for (const r of tt(
|
|
1151
|
+
for (const r of tt(Yt(s), t))
|
|
1152
1152
|
n.add(r);
|
|
1153
1153
|
else
|
|
1154
1154
|
n.add(s);
|
|
1155
1155
|
return [...n];
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function Wt(e, t) {
|
|
1158
1158
|
const n = tt(e, t);
|
|
1159
1159
|
if (!n)
|
|
1160
1160
|
return;
|
|
1161
1161
|
if (!e.reenter && n.every((r) => r === e.source || B(r, e.source)))
|
|
1162
1162
|
return e.source;
|
|
1163
|
-
const s =
|
|
1163
|
+
const s = ss(n.concat(e.source));
|
|
1164
1164
|
if (s)
|
|
1165
1165
|
return s;
|
|
1166
1166
|
if (!e.reenter)
|
|
@@ -1171,14 +1171,14 @@ function Ue(e, t, n) {
|
|
|
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 =
|
|
1174
|
+
const o = Wt(i, n);
|
|
1175
1175
|
i.reenter && i.source === o && s.add(o);
|
|
1176
1176
|
for (const a of t)
|
|
1177
1177
|
B(a, o) && s.add(a);
|
|
1178
1178
|
}
|
|
1179
1179
|
return [...s];
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function rs(e, t) {
|
|
1182
1182
|
if (e.length !== t.size)
|
|
1183
1183
|
return !1;
|
|
1184
1184
|
for (const n of e)
|
|
@@ -1191,13 +1191,13 @@ function Be(e, t, n, s, r, i) {
|
|
|
1191
1191
|
return t;
|
|
1192
1192
|
const o = new Set(t._nodes);
|
|
1193
1193
|
let a = t.historyValue;
|
|
1194
|
-
const c =
|
|
1194
|
+
const c = Qt(e, o, a);
|
|
1195
1195
|
let u = t;
|
|
1196
|
-
r || ([u, a] =
|
|
1196
|
+
r || ([u, a] = cs(u, s, n, c, o, a, i)), u = te(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
1198
|
u.status === "done" && (u = te(u, s, n, h.sort((d, f) => f.order - d.order).flatMap((d) => d.exit), i));
|
|
1199
1199
|
try {
|
|
1200
|
-
return a === t.historyValue &&
|
|
1200
|
+
return a === t.historyValue && rs(t._nodes, o) ? u : H(u, {
|
|
1201
1201
|
_nodes: h,
|
|
1202
1202
|
historyValue: a
|
|
1203
1203
|
});
|
|
@@ -1205,23 +1205,23 @@ function Be(e, t, n, s, r, i) {
|
|
|
1205
1205
|
throw d;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function is(e, t, n, s, r) {
|
|
1209
1209
|
if (s.output === void 0)
|
|
1210
1210
|
return;
|
|
1211
|
-
const i =
|
|
1211
|
+
const i = Pe(r.id, r.output !== void 0 && r.parent ? Fe(r.output, e.context, t, n.self) : void 0);
|
|
1212
1212
|
return Fe(s.output, e.context, i, n.self);
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function os(e, t, n, s, r, i, o, a) {
|
|
1215
1215
|
let c = e;
|
|
1216
1216
|
const u = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
|
|
1217
|
-
|
|
1217
|
+
as(s, o, h, u), a && h.add(e.machine.root);
|
|
1218
1218
|
const d = /* @__PURE__ */ new Set();
|
|
1219
1219
|
for (const f of [...u].sort((m, y) => m.order - y.order)) {
|
|
1220
1220
|
r.add(f);
|
|
1221
1221
|
const m = [];
|
|
1222
1222
|
m.push(...f.entry);
|
|
1223
1223
|
for (const y of f.invoke)
|
|
1224
|
-
m.push(
|
|
1224
|
+
m.push(Hn(y.src, {
|
|
1225
1225
|
...y,
|
|
1226
1226
|
syncSnapshot: !!y.onSnapshot
|
|
1227
1227
|
}));
|
|
@@ -1232,21 +1232,21 @@ function is(e, t, n, s, r, i, o, a) {
|
|
|
1232
1232
|
if (c = te(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(
|
|
1236
|
-
d.add(v), i.push(
|
|
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) && Ze(r, v); )
|
|
1236
|
+
d.add(v), i.push(Pe(v.id)), S = v, v = v.parent;
|
|
1237
1237
|
if (v)
|
|
1238
1238
|
continue;
|
|
1239
1239
|
c = H(c, {
|
|
1240
1240
|
status: "done",
|
|
1241
|
-
output:
|
|
1241
|
+
output: is(c, t, n, c.machine.root, S)
|
|
1242
1242
|
});
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
return c;
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1247
|
+
function as(e, t, n, s) {
|
|
1248
1248
|
for (const r of e) {
|
|
1249
|
-
const i =
|
|
1249
|
+
const i = Wt(r, t);
|
|
1250
1250
|
for (const a of r.target || [])
|
|
1251
1251
|
!V(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
|
|
@@ -1256,7 +1256,7 @@ function os(e, t, n, s) {
|
|
|
1256
1256
|
const o = tt(r, t);
|
|
1257
1257
|
for (const a of o) {
|
|
1258
1258
|
const c = ue(a, i);
|
|
1259
|
-
(i == null ? void 0 : i.type) === "parallel" && c.push(i),
|
|
1259
|
+
(i == null ? void 0 : i.type) === "parallel" && c.push(i), Kt(s, t, n, c, !r.source.parent && r.reenter ? void 0 : i);
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
@@ -1270,7 +1270,7 @@ function Q(e, t, n, s) {
|
|
|
1270
1270
|
for (const o of i)
|
|
1271
1271
|
Ne(o, e.parent, s, t, n);
|
|
1272
1272
|
} else {
|
|
1273
|
-
const i =
|
|
1273
|
+
const i = Yt(e);
|
|
1274
1274
|
for (const o of i.target)
|
|
1275
1275
|
s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), Q(o, t, n, s);
|
|
1276
1276
|
for (const o of i.target)
|
|
@@ -1283,33 +1283,33 @@ function Q(e, t, n, s) {
|
|
|
1283
1283
|
for (const i of Z(e).filter((o) => !V(o)))
|
|
1284
1284
|
[...s].some((o) => B(o, i)) || (V(i) || (s.add(i), n.add(i)), Q(i, t, n, s));
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1286
|
+
function Kt(e, t, n, s, r) {
|
|
1287
1287
|
for (const i of s)
|
|
1288
1288
|
if ((!r || B(i, r)) && e.add(i), i.type === "parallel")
|
|
1289
1289
|
for (const o of Z(i).filter((a) => !V(a)))
|
|
1290
1290
|
[...e].some((a) => B(a, o)) || (e.add(o), Q(o, t, n, e));
|
|
1291
1291
|
}
|
|
1292
1292
|
function Ne(e, t, n, s, r) {
|
|
1293
|
-
|
|
1293
|
+
Kt(n, s, r, ue(e, t));
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function cs(e, t, n, s, r, i, o) {
|
|
1296
1296
|
let a = e;
|
|
1297
1297
|
const c = Ue(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
|
-
for (const d of
|
|
1301
|
+
for (const d of ts(h)) {
|
|
1302
1302
|
let f;
|
|
1303
1303
|
d.history === "deep" ? f = (m) => Ke(m) && B(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 = te(a, t, n, [...h.exit, ...h.invoke.map((d) =>
|
|
1308
|
+
a = te(a, t, n, [...h.exit, ...h.invoke.map((d) => Ht(d.id))], o), r.delete(h);
|
|
1309
1309
|
return [a, u || i];
|
|
1310
1310
|
}
|
|
1311
1311
|
let pt = !1;
|
|
1312
|
-
function
|
|
1312
|
+
function Zt(e, t, n, s, r, i) {
|
|
1313
1313
|
const {
|
|
1314
1314
|
machine: o
|
|
1315
1315
|
} = e;
|
|
@@ -1353,7 +1353,7 @@ function Kt(e, t, n, s, r, i) {
|
|
|
1353
1353
|
});
|
|
1354
1354
|
continue;
|
|
1355
1355
|
}
|
|
1356
|
-
const y = h, [v, S,
|
|
1356
|
+
const y = h, [v, S, x] = y.resolve(
|
|
1357
1357
|
n,
|
|
1358
1358
|
a,
|
|
1359
1359
|
d,
|
|
@@ -1362,12 +1362,12 @@ function Kt(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 === k.Running ? y.execute(n, S) : n.defer(y.execute.bind(null, n, S))),
|
|
1365
|
+
a = v, "retryResolve" in y && (i == null || i.push([y, S])), "execute" in y && (n.self._processingStatus === k.Running ? y.execute(n, S) : n.defer(y.execute.bind(null, n, S))), x && (a = Zt(a, t, n, x, r, i));
|
|
1366
1366
|
}
|
|
1367
1367
|
return a;
|
|
1368
1368
|
}
|
|
1369
1369
|
function te(e, t, n, s, r, i) {
|
|
1370
|
-
const o = i ? [] : void 0, a =
|
|
1370
|
+
const o = i ? [] : void 0, a = Zt(e, t, n, s, {
|
|
1371
1371
|
internalQueue: r,
|
|
1372
1372
|
deferredActorIds: i
|
|
1373
1373
|
}, o);
|
|
@@ -1396,7 +1396,7 @@ function ke(e, t, n, s = []) {
|
|
|
1396
1396
|
};
|
|
1397
1397
|
let a = t;
|
|
1398
1398
|
if (a.type !== Pt) {
|
|
1399
|
-
const u = a, h =
|
|
1399
|
+
const u = a, h = qn(u), d = mt(u, r);
|
|
1400
1400
|
if (h && !d.length)
|
|
1401
1401
|
return r = H(e, {
|
|
1402
1402
|
status: "error",
|
|
@@ -1417,7 +1417,7 @@ function ke(e, t, n, s = []) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
let c = !0;
|
|
1419
1419
|
for (; r.status === "active"; ) {
|
|
1420
|
-
let u = c ?
|
|
1420
|
+
let u = c ? us(r, a) : [];
|
|
1421
1421
|
const h = u.length ? r : void 0;
|
|
1422
1422
|
if (!u.length) {
|
|
1423
1423
|
if (!s.length)
|
|
@@ -1432,12 +1432,12 @@ function ke(e, t, n, s = []) {
|
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
function yt(e, t, n) {
|
|
1435
|
-
return te(e, t, n, Object.values(e.children).map((s) =>
|
|
1435
|
+
return te(e, t, n, Object.values(e.children).map((s) => Ht(s)), []);
|
|
1436
1436
|
}
|
|
1437
1437
|
function mt(e, t) {
|
|
1438
1438
|
return t.machine.getTransitionData(t, e);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function us(e, t) {
|
|
1441
1441
|
const n = /* @__PURE__ */ new Set(), s = e._nodes.filter(Ke);
|
|
1442
1442
|
for (const r of s)
|
|
1443
1443
|
e:
|
|
@@ -1449,24 +1449,24 @@ function cs(e, t) {
|
|
|
1449
1449
|
break e;
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1452
|
+
return Qt(Array.from(n), new Set(e._nodes), e.historyValue);
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function ds(e, t) {
|
|
1455
1455
|
const n = ve(_e(e, t));
|
|
1456
|
-
return
|
|
1456
|
+
return Jt(e, [...n]);
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function ls(e) {
|
|
1459
1459
|
return !!e && typeof e == "object" && "machine" in e && "value" in e;
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1463
|
-
}, hs = function(t) {
|
|
1464
|
-
return this.tags.has(t);
|
|
1461
|
+
const hs = function(t) {
|
|
1462
|
+
return Bt(t, this.value);
|
|
1465
1463
|
}, fs = function(t) {
|
|
1464
|
+
return this.tags.has(t);
|
|
1465
|
+
}, ps = function(t) {
|
|
1466
1466
|
const n = this.machine.getTransitionData(this, t);
|
|
1467
1467
|
return !!(n != null && n.length) && // Check that at least one transition is not forbidden
|
|
1468
1468
|
n.some((s) => s.target !== void 0 || s.actions.length);
|
|
1469
|
-
},
|
|
1469
|
+
}, ys = function() {
|
|
1470
1470
|
const {
|
|
1471
1471
|
_nodes: t,
|
|
1472
1472
|
tags: n,
|
|
@@ -1482,7 +1482,7 @@ const ls = function(t) {
|
|
|
1482
1482
|
...u,
|
|
1483
1483
|
tags: Array.from(n)
|
|
1484
1484
|
};
|
|
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
1488
|
function ye(e, t) {
|
|
@@ -1493,15 +1493,15 @@ function ye(e, t) {
|
|
|
1493
1493
|
machine: t,
|
|
1494
1494
|
context: e.context,
|
|
1495
1495
|
_nodes: e._nodes,
|
|
1496
|
-
value:
|
|
1496
|
+
value: Jt(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 || {},
|
|
1500
|
-
matches:
|
|
1501
|
-
hasTag:
|
|
1502
|
-
can:
|
|
1503
|
-
getMeta:
|
|
1504
|
-
toJSON:
|
|
1500
|
+
matches: hs,
|
|
1501
|
+
hasTag: fs,
|
|
1502
|
+
can: ps,
|
|
1503
|
+
getMeta: ms,
|
|
1504
|
+
toJSON: ys
|
|
1505
1505
|
};
|
|
1506
1506
|
}
|
|
1507
1507
|
function H(e, t = {}) {
|
|
@@ -1510,7 +1510,7 @@ function H(e, t = {}) {
|
|
|
1510
1510
|
...t
|
|
1511
1511
|
}, e.machine);
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1513
|
+
function gs(e, t) {
|
|
1514
1514
|
const {
|
|
1515
1515
|
_nodes: n,
|
|
1516
1516
|
tags: s,
|
|
@@ -1535,11 +1535,11 @@ function ms(e, t) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
return {
|
|
1537
1537
|
...f,
|
|
1538
|
-
context:
|
|
1538
|
+
context: en(o),
|
|
1539
1539
|
children: m
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1542
|
+
function en(e) {
|
|
1543
1543
|
let t;
|
|
1544
1544
|
for (const n in e) {
|
|
1545
1545
|
const s = e[n];
|
|
@@ -1552,7 +1552,7 @@ function Zt(e) {
|
|
|
1552
1552
|
id: s.id
|
|
1553
1553
|
};
|
|
1554
1554
|
else {
|
|
1555
|
-
const r =
|
|
1555
|
+
const r = en(s);
|
|
1556
1556
|
r !== s && (t ?? (t = Array.isArray(e) ? e.slice() : {
|
|
1557
1557
|
...e
|
|
1558
1558
|
}), t[n] = r);
|
|
@@ -1560,7 +1560,7 @@ function Zt(e) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
return t ?? e;
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function Es(e, t, n, s, {
|
|
1564
1564
|
event: r,
|
|
1565
1565
|
id: i,
|
|
1566
1566
|
delay: o
|
|
@@ -1583,7 +1583,7 @@ function gs(e, t, n, s, {
|
|
|
1583
1583
|
delay: h
|
|
1584
1584
|
}];
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function vs(e, t) {
|
|
1587
1587
|
const {
|
|
1588
1588
|
event: n,
|
|
1589
1589
|
delay: s,
|
|
@@ -1597,13 +1597,13 @@ function Es(e, t) {
|
|
|
1597
1597
|
return;
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function Ts(e, t) {
|
|
1601
1601
|
function n(s, r) {
|
|
1602
1602
|
}
|
|
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 =
|
|
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
1605
|
const gt = /* @__PURE__ */ new WeakMap();
|
|
1606
|
-
function
|
|
1606
|
+
function _s(e) {
|
|
1607
1607
|
return {
|
|
1608
1608
|
config: e,
|
|
1609
1609
|
start: (n, s) => {
|
|
@@ -1714,7 +1714,7 @@ function K(e) {
|
|
|
1714
1714
|
restoreSnapshot: (n) => n
|
|
1715
1715
|
};
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Is(e, {
|
|
1718
1718
|
machine: t,
|
|
1719
1719
|
context: n
|
|
1720
1720
|
}, s, r) {
|
|
@@ -1757,7 +1757,7 @@ function _s(e, {
|
|
|
1757
1757
|
}), c;
|
|
1758
1758
|
};
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1760
|
+
function Ss(e, t, n, s, {
|
|
1761
1761
|
assignment: r
|
|
1762
1762
|
}) {
|
|
1763
1763
|
if (!t.context)
|
|
@@ -1765,7 +1765,7 @@ function Is(e, t, n, s, {
|
|
|
1765
1765
|
const i = {}, o = {
|
|
1766
1766
|
context: t.context,
|
|
1767
1767
|
event: n.event,
|
|
1768
|
-
spawn:
|
|
1768
|
+
spawn: Is(e, t, n.event, i),
|
|
1769
1769
|
self: e.self,
|
|
1770
1770
|
system: e.system
|
|
1771
1771
|
};
|
|
@@ -1786,15 +1786,33 @@ function Is(e, t, n, s, {
|
|
|
1786
1786
|
} : t.children
|
|
1787
1787
|
})];
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1789
|
+
function D(e) {
|
|
1790
1790
|
function t(n, s) {
|
|
1791
1791
|
}
|
|
1792
|
-
return t.type = "xstate.assign", t.assignment = e, t.resolve =
|
|
1792
|
+
return t.type = "xstate.assign", t.assignment = e, t.resolve = Ss, t;
|
|
1793
1793
|
}
|
|
1794
|
-
|
|
1794
|
+
function As(e, t, n, s, {
|
|
1795
|
+
event: r
|
|
1796
|
+
}) {
|
|
1797
|
+
const i = typeof r == "function" ? r(n, s) : r;
|
|
1798
|
+
return [t, {
|
|
1799
|
+
event: i
|
|
1800
|
+
}];
|
|
1801
|
+
}
|
|
1802
|
+
function xs(e, {
|
|
1803
|
+
event: t
|
|
1804
|
+
}) {
|
|
1805
|
+
e.defer(() => e.emit(t));
|
|
1806
|
+
}
|
|
1807
|
+
function Tt(e) {
|
|
1808
|
+
function t(n, s) {
|
|
1809
|
+
}
|
|
1810
|
+
return t.type = "xstate.emit", t.event = e, t.resolve = As, t.execute = xs, t;
|
|
1811
|
+
}
|
|
1812
|
+
let _t = /* @__PURE__ */ function(e) {
|
|
1795
1813
|
return e.Parent = "#_parent", e.Internal = "#_internal", e;
|
|
1796
1814
|
}({});
|
|
1797
|
-
function
|
|
1815
|
+
function ws(e, t, n, s, {
|
|
1798
1816
|
to: r,
|
|
1799
1817
|
event: i,
|
|
1800
1818
|
id: o,
|
|
@@ -1814,7 +1832,7 @@ function Ss(e, t, n, s, {
|
|
|
1814
1832
|
const f = typeof r == "function" ? r(n, s) : r;
|
|
1815
1833
|
let m;
|
|
1816
1834
|
if (typeof f == "string") {
|
|
1817
|
-
if (f ===
|
|
1835
|
+
if (f === _t.Parent ? m = e.self._parent : f === _t.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)
|
|
1818
1836
|
throw new Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`);
|
|
1819
1837
|
} else
|
|
1820
1838
|
m = f || e.self;
|
|
@@ -1825,10 +1843,10 @@ function Ss(e, t, n, s, {
|
|
|
1825
1843
|
delay: d
|
|
1826
1844
|
}];
|
|
1827
1845
|
}
|
|
1828
|
-
function
|
|
1846
|
+
function bs(e, t, n) {
|
|
1829
1847
|
typeof n.to == "string" && (n.to = t.children[n.to]);
|
|
1830
1848
|
}
|
|
1831
|
-
function
|
|
1849
|
+
function Os(e, t) {
|
|
1832
1850
|
e.defer(() => {
|
|
1833
1851
|
const {
|
|
1834
1852
|
to: n,
|
|
@@ -1845,23 +1863,23 @@ function As(e, t) {
|
|
|
1845
1863
|
// at this point, in a deferred task, it should already be mutated by retryResolveSendTo
|
|
1846
1864
|
// if it initially started as a string
|
|
1847
1865
|
n,
|
|
1848
|
-
s.type ===
|
|
1866
|
+
s.type === Nn ? Ft(e.self.id, s.data) : s
|
|
1849
1867
|
);
|
|
1850
1868
|
});
|
|
1851
1869
|
}
|
|
1852
|
-
function
|
|
1870
|
+
function It(e, t, n) {
|
|
1853
1871
|
function s(r, i) {
|
|
1854
1872
|
}
|
|
1855
|
-
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 =
|
|
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;
|
|
1856
1874
|
}
|
|
1857
|
-
const
|
|
1875
|
+
const St = /* @__PURE__ */ new WeakMap();
|
|
1858
1876
|
function J(e, t, n) {
|
|
1859
|
-
let s =
|
|
1877
|
+
let s = St.get(e);
|
|
1860
1878
|
return s ? t in s || (s[t] = n()) : (s = {
|
|
1861
1879
|
[t]: n()
|
|
1862
|
-
},
|
|
1880
|
+
}, St.set(e, s)), s[t];
|
|
1863
1881
|
}
|
|
1864
|
-
const
|
|
1882
|
+
const Ns = {}, re = (e) => typeof e == "string" ? {
|
|
1865
1883
|
type: e
|
|
1866
1884
|
} : typeof e == "function" ? "resolve" in e ? {
|
|
1867
1885
|
type: e.type
|
|
@@ -1874,13 +1892,13 @@ class nt {
|
|
|
1874
1892
|
_parent: this,
|
|
1875
1893
|
_key: r,
|
|
1876
1894
|
_machine: this.machine
|
|
1877
|
-
})) :
|
|
1895
|
+
})) : Ns, this.type === "compound" && !this.config.initial)
|
|
1878
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.`);
|
|
1879
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();
|
|
1880
1898
|
}
|
|
1881
1899
|
/** @internal */
|
|
1882
1900
|
_initialize() {
|
|
1883
|
-
this.transitions =
|
|
1901
|
+
this.transitions = Xn(this), this.config.always && (this.always = X(this.config.always).map((t) => $(this, qt, t))), Object.keys(this.states).forEach((t) => {
|
|
1884
1902
|
this.states[t]._initialize();
|
|
1885
1903
|
});
|
|
1886
1904
|
}
|
|
@@ -1964,16 +1982,16 @@ class nt {
|
|
|
1964
1982
|
return J(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), {}));
|
|
1965
1983
|
}
|
|
1966
1984
|
get after() {
|
|
1967
|
-
return J(this, "delayedTransitions", () =>
|
|
1985
|
+
return J(this, "delayedTransitions", () => Yn(this));
|
|
1968
1986
|
}
|
|
1969
1987
|
get initial() {
|
|
1970
|
-
return J(this, "initial", () =>
|
|
1988
|
+
return J(this, "initial", () => Qn(this, this.config.initial));
|
|
1971
1989
|
}
|
|
1972
1990
|
/** @internal */
|
|
1973
1991
|
next(t, n) {
|
|
1974
1992
|
const s = n.type, r = [];
|
|
1975
1993
|
let i;
|
|
1976
|
-
const o = J(this, `candidates-${s}`, () =>
|
|
1994
|
+
const o = J(this, `candidates-${s}`, () => Jn(this, s));
|
|
1977
1995
|
for (const a of o) {
|
|
1978
1996
|
const {
|
|
1979
1997
|
guard: c
|
|
@@ -2021,7 +2039,7 @@ ${d.message}`);
|
|
|
2021
2039
|
return Array.from(t);
|
|
2022
2040
|
}
|
|
2023
2041
|
}
|
|
2024
|
-
const
|
|
2042
|
+
const ks = "#";
|
|
2025
2043
|
class st {
|
|
2026
2044
|
constructor(t, n) {
|
|
2027
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 = {
|
|
@@ -2070,7 +2088,7 @@ class st {
|
|
|
2070
2088
|
});
|
|
2071
2089
|
}
|
|
2072
2090
|
resolveState(t) {
|
|
2073
|
-
const n =
|
|
2091
|
+
const n = ds(this.root, t.value), s = ve(_e(this.root, n));
|
|
2074
2092
|
return ye({
|
|
2075
2093
|
_nodes: [...s],
|
|
2076
2094
|
context: t.context || {},
|
|
@@ -2117,7 +2135,7 @@ class st {
|
|
|
2117
2135
|
children: {},
|
|
2118
2136
|
status: "active"
|
|
2119
2137
|
}, this);
|
|
2120
|
-
return typeof r == "function" ? te(i, n, t, [
|
|
2138
|
+
return typeof r == "function" ? te(i, n, t, [D(({
|
|
2121
2139
|
spawn: a,
|
|
2122
2140
|
event: c,
|
|
2123
2141
|
self: u
|
|
@@ -2131,8 +2149,8 @@ class st {
|
|
|
2131
2149
|
* Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
|
|
2132
2150
|
*/
|
|
2133
2151
|
getInitialSnapshot(t, n) {
|
|
2134
|
-
const s =
|
|
2135
|
-
target: [...
|
|
2152
|
+
const s = Ut(n), r = [], i = this.getPreInitialState(t, s, r), o = Be([{
|
|
2153
|
+
target: [...Xt(this.root)],
|
|
2136
2154
|
source: this.root,
|
|
2137
2155
|
reenter: !0,
|
|
2138
2156
|
actions: [],
|
|
@@ -2150,7 +2168,7 @@ class st {
|
|
|
2150
2168
|
});
|
|
2151
2169
|
}
|
|
2152
2170
|
getStateNodeById(t) {
|
|
2153
|
-
const n = Ye(t), s = n.slice(1), r = Se(n[0]) ? n[0].slice(
|
|
2171
|
+
const n = Ye(t), s = n.slice(1), r = Se(n[0]) ? n[0].slice(ks.length) : n[0], i = this.idMap.get(r);
|
|
2154
2172
|
if (!i)
|
|
2155
2173
|
throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
|
|
2156
2174
|
return Te(i, s);
|
|
@@ -2162,7 +2180,7 @@ class st {
|
|
|
2162
2180
|
return this.definition;
|
|
2163
2181
|
}
|
|
2164
2182
|
getPersistedSnapshot(t, n) {
|
|
2165
|
-
return
|
|
2183
|
+
return gs(t, n);
|
|
2166
2184
|
}
|
|
2167
2185
|
restoreSnapshot(t, n) {
|
|
2168
2186
|
const s = {}, r = t.children;
|
|
@@ -2204,10 +2222,10 @@ class st {
|
|
|
2204
2222
|
return a(i.context, s), i;
|
|
2205
2223
|
}
|
|
2206
2224
|
}
|
|
2207
|
-
function
|
|
2225
|
+
function Cs(e, t) {
|
|
2208
2226
|
return new st(e, t);
|
|
2209
2227
|
}
|
|
2210
|
-
function
|
|
2228
|
+
function Ae({
|
|
2211
2229
|
schemas: e,
|
|
2212
2230
|
actors: t,
|
|
2213
2231
|
actions: n,
|
|
@@ -2215,7 +2233,7 @@ function xe({
|
|
|
2215
2233
|
delays: r
|
|
2216
2234
|
}) {
|
|
2217
2235
|
return {
|
|
2218
|
-
createMachine: (i) =>
|
|
2236
|
+
createMachine: (i) => Cs({
|
|
2219
2237
|
...i,
|
|
2220
2238
|
schemas: e
|
|
2221
2239
|
}, {
|
|
@@ -2233,14 +2251,14 @@ async function Ce(e, t) {
|
|
|
2233
2251
|
success: !1
|
|
2234
2252
|
});
|
|
2235
2253
|
}
|
|
2236
|
-
const
|
|
2254
|
+
const At = Ae({
|
|
2237
2255
|
types: {
|
|
2238
2256
|
context: {},
|
|
2239
2257
|
events: {},
|
|
2240
2258
|
input: {}
|
|
2241
2259
|
},
|
|
2242
2260
|
actions: {
|
|
2243
|
-
setUserContext:
|
|
2261
|
+
setUserContext: D(({ context: e, event: t }) => {
|
|
2244
2262
|
if (!t.type.includes("xstate.done.actor"))
|
|
2245
2263
|
return e;
|
|
2246
2264
|
const n = t;
|
|
@@ -2249,13 +2267,13 @@ const St = xe({
|
|
|
2249
2267
|
ignoreRefreshToken: !1
|
|
2250
2268
|
};
|
|
2251
2269
|
}),
|
|
2252
|
-
unsetUserContext:
|
|
2270
|
+
unsetUserContext: D(() => ({
|
|
2253
2271
|
user: null,
|
|
2254
2272
|
accessToken: "",
|
|
2255
2273
|
refreshToken: "",
|
|
2256
2274
|
ignoreRefreshToken: !1
|
|
2257
2275
|
})),
|
|
2258
|
-
setAccessToken:
|
|
2276
|
+
setAccessToken: D(({ context: e, event: t }) => {
|
|
2259
2277
|
if (!t.type.includes("xstate.done.actor"))
|
|
2260
2278
|
return e;
|
|
2261
2279
|
const n = t;
|
|
@@ -2264,13 +2282,13 @@ const St = xe({
|
|
|
2264
2282
|
ignoreRefreshToken: !1
|
|
2265
2283
|
};
|
|
2266
2284
|
}),
|
|
2267
|
-
unsetRefreshToken:
|
|
2285
|
+
unsetRefreshToken: D(() => ({
|
|
2268
2286
|
refreshToken: ""
|
|
2269
2287
|
})),
|
|
2270
|
-
setIgnoreRefreshToken:
|
|
2288
|
+
setIgnoreRefreshToken: D(() => ({
|
|
2271
2289
|
ignoreRefreshToken: !0
|
|
2272
2290
|
})),
|
|
2273
|
-
addError:
|
|
2291
|
+
addError: D(({ context: e, event: t }) => {
|
|
2274
2292
|
if (!t.type.includes("xstate.error.actor"))
|
|
2275
2293
|
return e;
|
|
2276
2294
|
const n = t;
|
|
@@ -2278,7 +2296,7 @@ const St = xe({
|
|
|
2278
2296
|
errors: [...e.errors, String(n.error).replace("Error: ", "")]
|
|
2279
2297
|
};
|
|
2280
2298
|
}),
|
|
2281
|
-
clearErrors:
|
|
2299
|
+
clearErrors: D(() => ({
|
|
2282
2300
|
errors: []
|
|
2283
2301
|
}))
|
|
2284
2302
|
// onLogin: ({ event, self }) => {
|
|
@@ -2530,13 +2548,13 @@ const St = xe({
|
|
|
2530
2548
|
// },
|
|
2531
2549
|
// },
|
|
2532
2550
|
}
|
|
2533
|
-
}),
|
|
2551
|
+
}), tn = ze(
|
|
2534
2552
|
{}
|
|
2535
|
-
),
|
|
2536
|
-
const e = Je(
|
|
2553
|
+
), zr = () => {
|
|
2554
|
+
const e = Je(tn), [t, n] = Rt(
|
|
2537
2555
|
typeof window < "u" && e.getSnapshot().value === "loggedIn"
|
|
2538
2556
|
);
|
|
2539
|
-
return
|
|
2557
|
+
return Mt(() => {
|
|
2540
2558
|
if (typeof window > "u")
|
|
2541
2559
|
return;
|
|
2542
2560
|
const s = e.subscribe((r) => {
|
|
@@ -2546,19 +2564,19 @@ const St = xe({
|
|
|
2546
2564
|
s.unsubscribe();
|
|
2547
2565
|
};
|
|
2548
2566
|
}, [e]), { authActor: e, isLoggedIn: t };
|
|
2549
|
-
},
|
|
2567
|
+
}, Jr = async (e = "", t = {
|
|
2550
2568
|
inspect: void 0,
|
|
2551
2569
|
endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
|
|
2552
2570
|
}) => typeof window < "u" ? (console.warn(
|
|
2553
2571
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
2554
|
-
), U(
|
|
2572
|
+
), U(At, {
|
|
2555
2573
|
inspect: t.inspect,
|
|
2556
2574
|
input: {
|
|
2557
2575
|
initialContext: {
|
|
2558
2576
|
endpoints: t.endpoints
|
|
2559
2577
|
}
|
|
2560
2578
|
}
|
|
2561
|
-
}).start()) : U(
|
|
2579
|
+
}).start()) : U(At, {
|
|
2562
2580
|
input: {
|
|
2563
2581
|
initialContext: {
|
|
2564
2582
|
endpoints: t.endpoints,
|
|
@@ -2567,13 +2585,13 @@ const St = xe({
|
|
|
2567
2585
|
},
|
|
2568
2586
|
inspect: t.inspect
|
|
2569
2587
|
}).start();
|
|
2570
|
-
function
|
|
2571
|
-
return /* @__PURE__ */ Ge(
|
|
2588
|
+
function Yr({ actor: e, children: t }) {
|
|
2589
|
+
return /* @__PURE__ */ Ge(tn.Provider, { value: e, children: t });
|
|
2572
2590
|
}
|
|
2573
|
-
let
|
|
2574
|
-
const
|
|
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({
|
|
2575
2593
|
actors: {
|
|
2576
|
-
tick:
|
|
2594
|
+
tick: _s(
|
|
2577
2595
|
({ sendBack: e, input: t }) => {
|
|
2578
2596
|
const n = setInterval(() => {
|
|
2579
2597
|
e({ type: "TICK" });
|
|
@@ -2638,7 +2656,7 @@ const ks = xe({
|
|
|
2638
2656
|
],
|
|
2639
2657
|
on: {
|
|
2640
2658
|
TICK: {
|
|
2641
|
-
actions:
|
|
2659
|
+
actions: D(({ context: e, event: t }) => t.type !== "TICK" ? e : {
|
|
2642
2660
|
elapsed: e.elapsed + e.interval
|
|
2643
2661
|
})
|
|
2644
2662
|
},
|
|
@@ -2649,9 +2667,9 @@ const ks = xe({
|
|
|
2649
2667
|
type: "final"
|
|
2650
2668
|
}
|
|
2651
2669
|
}
|
|
2652
|
-
}),
|
|
2670
|
+
}), Xr = Ae({
|
|
2653
2671
|
actors: {
|
|
2654
|
-
timer:
|
|
2672
|
+
timer: Rs
|
|
2655
2673
|
},
|
|
2656
2674
|
types: {
|
|
2657
2675
|
context: {},
|
|
@@ -2659,10 +2677,10 @@ const ks = xe({
|
|
|
2659
2677
|
input: {}
|
|
2660
2678
|
},
|
|
2661
2679
|
actions: {
|
|
2662
|
-
addItem:
|
|
2680
|
+
addItem: D(({ context: e, event: t }) => {
|
|
2663
2681
|
if (t.type !== "ADD_ITEM")
|
|
2664
2682
|
return e;
|
|
2665
|
-
const n = `notification-${
|
|
2683
|
+
const n = `notification-${Ds()}`, s = t.duration ?? e.duration, r = _n(t.item, {
|
|
2666
2684
|
duration: s,
|
|
2667
2685
|
id: n,
|
|
2668
2686
|
key: t.item.key ?? n,
|
|
@@ -2677,7 +2695,7 @@ const ks = xe({
|
|
|
2677
2695
|
activeItem: n
|
|
2678
2696
|
};
|
|
2679
2697
|
}),
|
|
2680
|
-
removeItem:
|
|
2698
|
+
removeItem: D(({ context: e, event: t }) => {
|
|
2681
2699
|
if (t.type !== "REMOVE_ITEM" && t.type !== "xstate.done.actor.timer")
|
|
2682
2700
|
return e;
|
|
2683
2701
|
const n = e.items;
|
|
@@ -2741,11 +2759,11 @@ const ks = xe({
|
|
|
2741
2759
|
target: "idle"
|
|
2742
2760
|
},
|
|
2743
2761
|
RESUME_TIMER: {
|
|
2744
|
-
actions:
|
|
2762
|
+
actions: It("timer", { type: "RESUME_TIMER" })
|
|
2745
2763
|
// cond: (context) => context.duration > 0,
|
|
2746
2764
|
},
|
|
2747
2765
|
PAUSE_TIMER: {
|
|
2748
|
-
actions:
|
|
2766
|
+
actions: It("timer", { type: "PAUSE_TIMER" })
|
|
2749
2767
|
// cond: (context) => context.duration > 0,
|
|
2750
2768
|
}
|
|
2751
2769
|
}
|
|
@@ -2779,14 +2797,14 @@ const ks = xe({
|
|
|
2779
2797
|
}
|
|
2780
2798
|
}
|
|
2781
2799
|
}
|
|
2782
|
-
}),
|
|
2783
|
-
function
|
|
2800
|
+
}), nn = ze({}), Qr = () => Je(nn);
|
|
2801
|
+
function Wr({
|
|
2784
2802
|
children: e,
|
|
2785
2803
|
actor: t
|
|
2786
2804
|
}) {
|
|
2787
|
-
return /* @__PURE__ */ Ge(
|
|
2805
|
+
return /* @__PURE__ */ Ge(nn.Provider, { value: t, children: e });
|
|
2788
2806
|
}
|
|
2789
|
-
function
|
|
2807
|
+
function Ms({
|
|
2790
2808
|
context: e,
|
|
2791
2809
|
event: t
|
|
2792
2810
|
}) {
|
|
@@ -2794,10 +2812,33 @@ function Cs({
|
|
|
2794
2812
|
return e;
|
|
2795
2813
|
const n = t;
|
|
2796
2814
|
return n.output.type !== "ADD_ITEMS_SUCCESS" ? e : {
|
|
2797
|
-
quote: { ...e.quote, ...n.output.quote }
|
|
2815
|
+
quote: { ...e.quote, ...n.output.quote },
|
|
2816
|
+
itemsAdded: n.output.itemsAdded
|
|
2798
2817
|
};
|
|
2799
2818
|
}
|
|
2800
|
-
function
|
|
2819
|
+
function Ls({
|
|
2820
|
+
event: e
|
|
2821
|
+
}) {
|
|
2822
|
+
if (!e.type.includes("xstate.done.actor"))
|
|
2823
|
+
return { type: "EMIT_ADD_ITEMS", itemsAdded: [] };
|
|
2824
|
+
const t = e;
|
|
2825
|
+
return t.output.type !== "ADD_ITEMS_SUCCESS" ? { type: "EMIT_ADD_ITEMS", itemsAdded: [] } : {
|
|
2826
|
+
type: "EMIT_ADD_ITEMS",
|
|
2827
|
+
itemsAdded: t.output.itemsAdded
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2830
|
+
function qs({
|
|
2831
|
+
event: e
|
|
2832
|
+
}) {
|
|
2833
|
+
if (!e.type.includes("xstate.done.actor"))
|
|
2834
|
+
return { type: "EMIT_REMOVE_ITEMS", itemsRemoved: [] };
|
|
2835
|
+
const t = e;
|
|
2836
|
+
return t.output.type !== "REMOVE_ITEMS_SUCCESS" ? { type: "EMIT_REMOVE_ITEMS", itemsRemoved: [] } : {
|
|
2837
|
+
type: "EMIT_REMOVE_ITEMS",
|
|
2838
|
+
itemsRemoved: t.output.itemsRemoved
|
|
2839
|
+
};
|
|
2840
|
+
}
|
|
2841
|
+
function Ps({
|
|
2801
2842
|
context: e,
|
|
2802
2843
|
event: t
|
|
2803
2844
|
}) {
|
|
@@ -2805,10 +2846,11 @@ function Ds({
|
|
|
2805
2846
|
return e;
|
|
2806
2847
|
const n = t;
|
|
2807
2848
|
return n.output.type !== "REMOVE_ITEMS_SUCCESS" ? e : {
|
|
2808
|
-
quote: { ...e.quote, ...n.output.quote }
|
|
2849
|
+
quote: { ...e.quote, ...n.output.quote },
|
|
2850
|
+
itemsRemoved: n.output.itemsRemoved
|
|
2809
2851
|
};
|
|
2810
2852
|
}
|
|
2811
|
-
function
|
|
2853
|
+
function Fs({
|
|
2812
2854
|
context: e,
|
|
2813
2855
|
event: t
|
|
2814
2856
|
}) {
|
|
@@ -2819,26 +2861,26 @@ function Rs({
|
|
|
2819
2861
|
quote: { ...e.quote, ...n.output.quote }
|
|
2820
2862
|
};
|
|
2821
2863
|
}
|
|
2822
|
-
const rt = JSON,
|
|
2864
|
+
const rt = JSON, Us = (e) => e.toUpperCase(), Bs = (e) => {
|
|
2823
2865
|
const t = {};
|
|
2824
2866
|
return e.forEach((n, s) => {
|
|
2825
2867
|
t[s] = n;
|
|
2826
2868
|
}), t;
|
|
2827
|
-
},
|
|
2869
|
+
}, js = (e, t, n) => e.document ? e : {
|
|
2828
2870
|
document: e,
|
|
2829
2871
|
variables: t,
|
|
2830
2872
|
requestHeaders: n,
|
|
2831
2873
|
signal: void 0
|
|
2832
|
-
},
|
|
2874
|
+
}, $s = (e, t, n) => e.query ? e : {
|
|
2833
2875
|
query: e,
|
|
2834
2876
|
variables: t,
|
|
2835
2877
|
requestHeaders: n,
|
|
2836
2878
|
signal: void 0
|
|
2837
|
-
},
|
|
2879
|
+
}, Vs = (e, t) => e.documents ? e : {
|
|
2838
2880
|
documents: e,
|
|
2839
2881
|
requestHeaders: t,
|
|
2840
2882
|
signal: void 0
|
|
2841
|
-
},
|
|
2883
|
+
}, Hs = (e, t, ...n) => {
|
|
2842
2884
|
const [s, r] = n;
|
|
2843
2885
|
return e.document ? e : {
|
|
2844
2886
|
url: e,
|
|
@@ -2852,20 +2894,20 @@ function me(e, t) {
|
|
|
2852
2894
|
if (!!!e)
|
|
2853
2895
|
throw new Error(t);
|
|
2854
2896
|
}
|
|
2855
|
-
function
|
|
2897
|
+
function Gs(e) {
|
|
2856
2898
|
return typeof e == "object" && e !== null;
|
|
2857
2899
|
}
|
|
2858
|
-
function
|
|
2900
|
+
function zs(e, t) {
|
|
2859
2901
|
if (!!!e)
|
|
2860
2902
|
throw new Error(
|
|
2861
2903
|
t ?? "Unexpected invariant triggered."
|
|
2862
2904
|
);
|
|
2863
2905
|
}
|
|
2864
|
-
const
|
|
2906
|
+
const Js = /\r\n|[\n\r]/g;
|
|
2865
2907
|
function je(e, t) {
|
|
2866
2908
|
let n = 0, s = 1;
|
|
2867
|
-
for (const r of e.body.matchAll(
|
|
2868
|
-
if (typeof r.index == "number" ||
|
|
2909
|
+
for (const r of e.body.matchAll(Js)) {
|
|
2910
|
+
if (typeof r.index == "number" || zs(!1), r.index >= t)
|
|
2869
2911
|
break;
|
|
2870
2912
|
n = r.index + r[0].length, s += 1;
|
|
2871
2913
|
}
|
|
@@ -2874,13 +2916,13 @@ function je(e, t) {
|
|
|
2874
2916
|
column: t + 1 - n
|
|
2875
2917
|
};
|
|
2876
2918
|
}
|
|
2877
|
-
function
|
|
2878
|
-
return
|
|
2919
|
+
function Ys(e) {
|
|
2920
|
+
return sn(
|
|
2879
2921
|
e.source,
|
|
2880
2922
|
je(e.source, e.start)
|
|
2881
2923
|
);
|
|
2882
2924
|
}
|
|
2883
|
-
function
|
|
2925
|
+
function sn(e, t) {
|
|
2884
2926
|
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}
|
|
2885
2927
|
`, h = s.split(/\r\n|[\n\r]/g), d = h[r];
|
|
2886
2928
|
if (d.length > 120) {
|
|
@@ -2907,7 +2949,7 @@ function xt(e) {
|
|
|
2907
2949
|
return t.map(([s, r]) => s.padStart(n) + (r ? " " + r : "")).join(`
|
|
2908
2950
|
`);
|
|
2909
2951
|
}
|
|
2910
|
-
function
|
|
2952
|
+
function Xs(e) {
|
|
2911
2953
|
const t = e[0];
|
|
2912
2954
|
return t == null || "kind" in t || "length" in t ? {
|
|
2913
2955
|
nodes: t,
|
|
@@ -2959,15 +3001,15 @@ class it extends Error {
|
|
|
2959
3001
|
*/
|
|
2960
3002
|
constructor(t, ...n) {
|
|
2961
3003
|
var s, r, i;
|
|
2962
|
-
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } =
|
|
2963
|
-
super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes =
|
|
3004
|
+
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } = Xs(n);
|
|
3005
|
+
super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes = wt(
|
|
2964
3006
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
2965
3007
|
);
|
|
2966
|
-
const f =
|
|
3008
|
+
const f = wt(
|
|
2967
3009
|
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((y) => y.loc).filter((y) => y != null)
|
|
2968
3010
|
);
|
|
2969
3011
|
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) => je(a, y)) : f == null ? void 0 : f.map((y) => je(y.source, y.start));
|
|
2970
|
-
const m =
|
|
3012
|
+
const m = Gs(
|
|
2971
3013
|
h == null ? void 0 : h.extensions
|
|
2972
3014
|
) ? h == null ? void 0 : h.extensions : void 0;
|
|
2973
3015
|
this.extensions = (i = d ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -3009,12 +3051,12 @@ class it extends Error {
|
|
|
3009
3051
|
for (const n of this.nodes)
|
|
3010
3052
|
n.loc && (t += `
|
|
3011
3053
|
|
|
3012
|
-
` +
|
|
3054
|
+
` + Ys(n.loc));
|
|
3013
3055
|
else if (this.source && this.locations)
|
|
3014
3056
|
for (const n of this.locations)
|
|
3015
3057
|
t += `
|
|
3016
3058
|
|
|
3017
|
-
` +
|
|
3059
|
+
` + sn(this.source, n);
|
|
3018
3060
|
return t;
|
|
3019
3061
|
}
|
|
3020
3062
|
toJSON() {
|
|
@@ -3024,7 +3066,7 @@ class it extends Error {
|
|
|
3024
3066
|
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;
|
|
3025
3067
|
}
|
|
3026
3068
|
}
|
|
3027
|
-
function
|
|
3069
|
+
function wt(e) {
|
|
3028
3070
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
3029
3071
|
}
|
|
3030
3072
|
function b(e, t, n) {
|
|
@@ -3033,7 +3075,7 @@ function b(e, t, n) {
|
|
|
3033
3075
|
positions: [t]
|
|
3034
3076
|
});
|
|
3035
3077
|
}
|
|
3036
|
-
class
|
|
3078
|
+
class Qs {
|
|
3037
3079
|
/**
|
|
3038
3080
|
* The character offset at which this Node begins.
|
|
3039
3081
|
*/
|
|
@@ -3062,7 +3104,7 @@ class Gs {
|
|
|
3062
3104
|
};
|
|
3063
3105
|
}
|
|
3064
3106
|
}
|
|
3065
|
-
class
|
|
3107
|
+
class rn {
|
|
3066
3108
|
/**
|
|
3067
3109
|
* The kind of Token.
|
|
3068
3110
|
*/
|
|
@@ -3104,7 +3146,7 @@ class sn {
|
|
|
3104
3146
|
};
|
|
3105
3147
|
}
|
|
3106
3148
|
}
|
|
3107
|
-
const
|
|
3149
|
+
const on = {
|
|
3108
3150
|
Name: [],
|
|
3109
3151
|
Document: ["definitions"],
|
|
3110
3152
|
OperationDefinition: [
|
|
@@ -3178,10 +3220,10 @@ const rn = {
|
|
|
3178
3220
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
3179
3221
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
3180
3222
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
3181
|
-
},
|
|
3182
|
-
function
|
|
3223
|
+
}, Ws = new Set(Object.keys(on));
|
|
3224
|
+
function bt(e) {
|
|
3183
3225
|
const t = e == null ? void 0 : e.kind;
|
|
3184
|
-
return typeof t == "string" &&
|
|
3226
|
+
return typeof t == "string" && Ws.has(t);
|
|
3185
3227
|
}
|
|
3186
3228
|
var W;
|
|
3187
3229
|
(function(e) {
|
|
@@ -3201,22 +3243,22 @@ function Ve(e) {
|
|
|
3201
3243
|
function ce(e) {
|
|
3202
3244
|
return e >= 48 && e <= 57;
|
|
3203
3245
|
}
|
|
3204
|
-
function
|
|
3246
|
+
function an(e) {
|
|
3205
3247
|
return e >= 97 && e <= 122 || // A-Z
|
|
3206
3248
|
e >= 65 && e <= 90;
|
|
3207
3249
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return
|
|
3250
|
+
function cn(e) {
|
|
3251
|
+
return an(e) || e === 95;
|
|
3210
3252
|
}
|
|
3211
|
-
function
|
|
3212
|
-
return
|
|
3253
|
+
function Ks(e) {
|
|
3254
|
+
return an(e) || ce(e) || e === 95;
|
|
3213
3255
|
}
|
|
3214
|
-
function
|
|
3256
|
+
function Zs(e) {
|
|
3215
3257
|
var t;
|
|
3216
3258
|
let n = Number.MAX_SAFE_INTEGER, s = null, r = -1;
|
|
3217
3259
|
for (let o = 0; o < e.length; ++o) {
|
|
3218
3260
|
var i;
|
|
3219
|
-
const a = e[o], c =
|
|
3261
|
+
const a = e[o], c = er(a);
|
|
3220
3262
|
c !== a.length && (s = (i = s) !== null && i !== void 0 ? i : o, r = o, o !== 0 && c < n && (n = c));
|
|
3221
3263
|
}
|
|
3222
3264
|
return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
|
|
@@ -3224,13 +3266,13 @@ function Ys(e) {
|
|
|
3224
3266
|
r + 1
|
|
3225
3267
|
);
|
|
3226
3268
|
}
|
|
3227
|
-
function
|
|
3269
|
+
function er(e) {
|
|
3228
3270
|
let t = 0;
|
|
3229
3271
|
for (; t < e.length && Ve(e.charCodeAt(t)); )
|
|
3230
3272
|
++t;
|
|
3231
3273
|
return t;
|
|
3232
3274
|
}
|
|
3233
|
-
function
|
|
3275
|
+
function tr(e, t) {
|
|
3234
3276
|
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 || Ve(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
|
|
3235
3277
|
(!r || e.length > 70 || u || i || o);
|
|
3236
3278
|
let d = "";
|
|
@@ -3243,7 +3285,7 @@ var p;
|
|
|
3243
3285
|
(function(e) {
|
|
3244
3286
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
3245
3287
|
})(p || (p = {}));
|
|
3246
|
-
class
|
|
3288
|
+
class nr {
|
|
3247
3289
|
/**
|
|
3248
3290
|
* The previously focused non-ignored token.
|
|
3249
3291
|
*/
|
|
@@ -3257,7 +3299,7 @@ class Ws {
|
|
|
3257
3299
|
* The character offset at which the current line begins.
|
|
3258
3300
|
*/
|
|
3259
3301
|
constructor(t) {
|
|
3260
|
-
const n = new
|
|
3302
|
+
const n = new rn(p.SOF, 0, 0, 0, 0);
|
|
3261
3303
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
3262
3304
|
}
|
|
3263
3305
|
get [Symbol.toStringTag]() {
|
|
@@ -3280,26 +3322,26 @@ class Ws {
|
|
|
3280
3322
|
if (t.next)
|
|
3281
3323
|
t = t.next;
|
|
3282
3324
|
else {
|
|
3283
|
-
const n =
|
|
3325
|
+
const n = rr(this, t.end);
|
|
3284
3326
|
t.next = n, n.prev = t, t = n;
|
|
3285
3327
|
}
|
|
3286
3328
|
while (t.kind === p.COMMENT);
|
|
3287
3329
|
return t;
|
|
3288
3330
|
}
|
|
3289
3331
|
}
|
|
3290
|
-
function
|
|
3332
|
+
function sr(e) {
|
|
3291
3333
|
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;
|
|
3292
3334
|
}
|
|
3293
3335
|
function ne(e) {
|
|
3294
3336
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
3295
3337
|
}
|
|
3296
|
-
function
|
|
3297
|
-
return
|
|
3338
|
+
function xe(e, t) {
|
|
3339
|
+
return un(e.charCodeAt(t)) && dn(e.charCodeAt(t + 1));
|
|
3298
3340
|
}
|
|
3299
|
-
function
|
|
3341
|
+
function un(e) {
|
|
3300
3342
|
return e >= 55296 && e <= 56319;
|
|
3301
3343
|
}
|
|
3302
|
-
function
|
|
3344
|
+
function dn(e) {
|
|
3303
3345
|
return e >= 56320 && e <= 57343;
|
|
3304
3346
|
}
|
|
3305
3347
|
function G(e, t) {
|
|
@@ -3314,9 +3356,9 @@ function G(e, t) {
|
|
|
3314
3356
|
}
|
|
3315
3357
|
function w(e, t, n, s, r) {
|
|
3316
3358
|
const i = e.line, o = 1 + n - e.lineStart;
|
|
3317
|
-
return new
|
|
3359
|
+
return new rn(t, n, s, i, o, r);
|
|
3318
3360
|
}
|
|
3319
|
-
function
|
|
3361
|
+
function rr(e, t) {
|
|
3320
3362
|
const n = e.source.body, s = n.length;
|
|
3321
3363
|
let r = t;
|
|
3322
3364
|
for (; r < s; ) {
|
|
@@ -3335,7 +3377,7 @@ function Zs(e, t) {
|
|
|
3335
3377
|
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
3336
3378
|
continue;
|
|
3337
3379
|
case 35:
|
|
3338
|
-
return
|
|
3380
|
+
return ir(e, r);
|
|
3339
3381
|
case 33:
|
|
3340
3382
|
return w(e, p.BANG, r, r + 1);
|
|
3341
3383
|
case 36:
|
|
@@ -3367,21 +3409,21 @@ function Zs(e, t) {
|
|
|
3367
3409
|
case 125:
|
|
3368
3410
|
return w(e, p.BRACE_R, r, r + 1);
|
|
3369
3411
|
case 34:
|
|
3370
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ?
|
|
3412
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? lr(e, r) : ar(e, r);
|
|
3371
3413
|
}
|
|
3372
3414
|
if (ce(i) || i === 45)
|
|
3373
|
-
return
|
|
3374
|
-
if (
|
|
3375
|
-
return
|
|
3415
|
+
return or(e, r, i);
|
|
3416
|
+
if (cn(i))
|
|
3417
|
+
return hr(e, r);
|
|
3376
3418
|
throw b(
|
|
3377
3419
|
e.source,
|
|
3378
3420
|
r,
|
|
3379
|
-
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : ne(i) ||
|
|
3421
|
+
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : ne(i) || xe(n, r) ? `Unexpected character: ${G(e, r)}.` : `Invalid character: ${G(e, r)}.`
|
|
3380
3422
|
);
|
|
3381
3423
|
}
|
|
3382
3424
|
return w(e, p.EOF, s, s);
|
|
3383
3425
|
}
|
|
3384
|
-
function
|
|
3426
|
+
function ir(e, t) {
|
|
3385
3427
|
const n = e.source.body, s = n.length;
|
|
3386
3428
|
let r = t + 1;
|
|
3387
3429
|
for (; r < s; ) {
|
|
@@ -3390,7 +3432,7 @@ function er(e, t) {
|
|
|
3390
3432
|
break;
|
|
3391
3433
|
if (ne(i))
|
|
3392
3434
|
++r;
|
|
3393
|
-
else if (
|
|
3435
|
+
else if (xe(n, r))
|
|
3394
3436
|
r += 2;
|
|
3395
3437
|
else
|
|
3396
3438
|
break;
|
|
@@ -3403,7 +3445,7 @@ function er(e, t) {
|
|
|
3403
3445
|
n.slice(t + 1, r)
|
|
3404
3446
|
);
|
|
3405
3447
|
}
|
|
3406
|
-
function
|
|
3448
|
+
function or(e, t, n) {
|
|
3407
3449
|
const s = e.source.body;
|
|
3408
3450
|
let r = t, i = n, o = !1;
|
|
3409
3451
|
if (i === 45 && (i = s.charCodeAt(++r)), i === 48) {
|
|
@@ -3418,7 +3460,7 @@ function tr(e, t, n) {
|
|
|
3418
3460
|
);
|
|
3419
3461
|
} else
|
|
3420
3462
|
r = De(e, r, i), i = s.charCodeAt(r);
|
|
3421
|
-
if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = De(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 = De(e, r, i), i = s.charCodeAt(r)), i === 46 ||
|
|
3463
|
+
if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = De(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 = De(e, r, i), i = s.charCodeAt(r)), i === 46 || cn(i))
|
|
3422
3464
|
throw b(
|
|
3423
3465
|
e.source,
|
|
3424
3466
|
r,
|
|
@@ -3451,7 +3493,7 @@ function De(e, t, n) {
|
|
|
3451
3493
|
++r;
|
|
3452
3494
|
return r;
|
|
3453
3495
|
}
|
|
3454
|
-
function
|
|
3496
|
+
function ar(e, t) {
|
|
3455
3497
|
const n = e.source.body, s = n.length;
|
|
3456
3498
|
let r = t + 1, i = r, o = "";
|
|
3457
3499
|
for (; r < s; ) {
|
|
@@ -3460,7 +3502,7 @@ function nr(e, t) {
|
|
|
3460
3502
|
return o += n.slice(i, r), w(e, p.STRING, t, r + 1, o);
|
|
3461
3503
|
if (a === 92) {
|
|
3462
3504
|
o += n.slice(i, r);
|
|
3463
|
-
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ?
|
|
3505
|
+
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? cr(e, r) : ur(e, r) : dr(e, r);
|
|
3464
3506
|
o += c.value, r += c.size, i = r;
|
|
3465
3507
|
continue;
|
|
3466
3508
|
}
|
|
@@ -3468,7 +3510,7 @@ function nr(e, t) {
|
|
|
3468
3510
|
break;
|
|
3469
3511
|
if (ne(a))
|
|
3470
3512
|
++r;
|
|
3471
|
-
else if (
|
|
3513
|
+
else if (xe(n, r))
|
|
3472
3514
|
r += 2;
|
|
3473
3515
|
else
|
|
3474
3516
|
throw b(
|
|
@@ -3482,7 +3524,7 @@ function nr(e, t) {
|
|
|
3482
3524
|
}
|
|
3483
3525
|
throw b(e.source, r, "Unterminated string.");
|
|
3484
3526
|
}
|
|
3485
|
-
function
|
|
3527
|
+
function cr(e, t) {
|
|
3486
3528
|
const n = e.source.body;
|
|
3487
3529
|
let s = 0, r = 3;
|
|
3488
3530
|
for (; r < 12; ) {
|
|
@@ -3507,16 +3549,16 @@ function sr(e, t) {
|
|
|
3507
3549
|
)}".`
|
|
3508
3550
|
);
|
|
3509
3551
|
}
|
|
3510
|
-
function
|
|
3511
|
-
const n = e.source.body, s =
|
|
3552
|
+
function ur(e, t) {
|
|
3553
|
+
const n = e.source.body, s = Ot(n, t + 2);
|
|
3512
3554
|
if (ne(s))
|
|
3513
3555
|
return {
|
|
3514
3556
|
value: String.fromCodePoint(s),
|
|
3515
3557
|
size: 6
|
|
3516
3558
|
};
|
|
3517
|
-
if (
|
|
3518
|
-
const r =
|
|
3519
|
-
if (
|
|
3559
|
+
if (un(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
3560
|
+
const r = Ot(n, t + 8);
|
|
3561
|
+
if (dn(r))
|
|
3520
3562
|
return {
|
|
3521
3563
|
value: String.fromCodePoint(s, r),
|
|
3522
3564
|
size: 12
|
|
@@ -3528,13 +3570,13 @@ function rr(e, t) {
|
|
|
3528
3570
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
3529
3571
|
);
|
|
3530
3572
|
}
|
|
3531
|
-
function
|
|
3573
|
+
function Ot(e, t) {
|
|
3532
3574
|
return ie(e.charCodeAt(t)) << 12 | ie(e.charCodeAt(t + 1)) << 8 | ie(e.charCodeAt(t + 2)) << 4 | ie(e.charCodeAt(t + 3));
|
|
3533
3575
|
}
|
|
3534
3576
|
function ie(e) {
|
|
3535
3577
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
3536
3578
|
}
|
|
3537
|
-
function
|
|
3579
|
+
function dr(e, t) {
|
|
3538
3580
|
const n = e.source.body;
|
|
3539
3581
|
switch (n.charCodeAt(t + 1)) {
|
|
3540
3582
|
case 34:
|
|
@@ -3588,7 +3630,7 @@ function ir(e, t) {
|
|
|
3588
3630
|
)}".`
|
|
3589
3631
|
);
|
|
3590
3632
|
}
|
|
3591
|
-
function
|
|
3633
|
+
function lr(e, t) {
|
|
3592
3634
|
const n = e.source.body, s = n.length;
|
|
3593
3635
|
let r = e.lineStart, i = t + 3, o = i, a = "";
|
|
3594
3636
|
const c = [];
|
|
@@ -3602,7 +3644,7 @@ function or(e, t) {
|
|
|
3602
3644
|
t,
|
|
3603
3645
|
i + 3,
|
|
3604
3646
|
// Return a string of the lines joined with U+000A.
|
|
3605
|
-
|
|
3647
|
+
Zs(c).join(`
|
|
3606
3648
|
`)
|
|
3607
3649
|
);
|
|
3608
3650
|
return e.line += c.length - 1, e.lineStart = r, h;
|
|
@@ -3617,7 +3659,7 @@ function or(e, t) {
|
|
|
3617
3659
|
}
|
|
3618
3660
|
if (ne(u))
|
|
3619
3661
|
++i;
|
|
3620
|
-
else if (
|
|
3662
|
+
else if (xe(n, i))
|
|
3621
3663
|
i += 2;
|
|
3622
3664
|
else
|
|
3623
3665
|
throw b(
|
|
@@ -3631,12 +3673,12 @@ function or(e, t) {
|
|
|
3631
3673
|
}
|
|
3632
3674
|
throw b(e.source, i, "Unterminated string.");
|
|
3633
3675
|
}
|
|
3634
|
-
function
|
|
3676
|
+
function hr(e, t) {
|
|
3635
3677
|
const n = e.source.body, s = n.length;
|
|
3636
3678
|
let r = t + 1;
|
|
3637
3679
|
for (; r < s; ) {
|
|
3638
3680
|
const i = n.charCodeAt(r);
|
|
3639
|
-
if (
|
|
3681
|
+
if (Ks(i))
|
|
3640
3682
|
++r;
|
|
3641
3683
|
else
|
|
3642
3684
|
break;
|
|
@@ -3649,7 +3691,7 @@ function ar(e, t) {
|
|
|
3649
3691
|
n.slice(t, r)
|
|
3650
3692
|
);
|
|
3651
3693
|
}
|
|
3652
|
-
const
|
|
3694
|
+
const fr = 10, ln = 2;
|
|
3653
3695
|
function ot(e) {
|
|
3654
3696
|
return we(e, []);
|
|
3655
3697
|
}
|
|
@@ -3660,45 +3702,45 @@ function we(e, t) {
|
|
|
3660
3702
|
case "function":
|
|
3661
3703
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
3662
3704
|
case "object":
|
|
3663
|
-
return
|
|
3705
|
+
return pr(e, t);
|
|
3664
3706
|
default:
|
|
3665
3707
|
return String(e);
|
|
3666
3708
|
}
|
|
3667
3709
|
}
|
|
3668
|
-
function
|
|
3710
|
+
function pr(e, t) {
|
|
3669
3711
|
if (e === null)
|
|
3670
3712
|
return "null";
|
|
3671
3713
|
if (t.includes(e))
|
|
3672
3714
|
return "[Circular]";
|
|
3673
3715
|
const n = [...t, e];
|
|
3674
|
-
if (
|
|
3716
|
+
if (yr(e)) {
|
|
3675
3717
|
const s = e.toJSON();
|
|
3676
3718
|
if (s !== e)
|
|
3677
3719
|
return typeof s == "string" ? s : we(s, n);
|
|
3678
3720
|
} else if (Array.isArray(e))
|
|
3679
|
-
return
|
|
3680
|
-
return
|
|
3721
|
+
return gr(e, n);
|
|
3722
|
+
return mr(e, n);
|
|
3681
3723
|
}
|
|
3682
|
-
function
|
|
3724
|
+
function yr(e) {
|
|
3683
3725
|
return typeof e.toJSON == "function";
|
|
3684
3726
|
}
|
|
3685
|
-
function
|
|
3727
|
+
function mr(e, t) {
|
|
3686
3728
|
const n = Object.entries(e);
|
|
3687
|
-
return n.length === 0 ? "{}" : t.length >
|
|
3729
|
+
return n.length === 0 ? "{}" : t.length > ln ? "[" + Er(e) + "]" : "{ " + n.map(
|
|
3688
3730
|
([r, i]) => r + ": " + we(i, t)
|
|
3689
3731
|
).join(", ") + " }";
|
|
3690
3732
|
}
|
|
3691
|
-
function
|
|
3733
|
+
function gr(e, t) {
|
|
3692
3734
|
if (e.length === 0)
|
|
3693
3735
|
return "[]";
|
|
3694
|
-
if (t.length >
|
|
3736
|
+
if (t.length > ln)
|
|
3695
3737
|
return "[Array]";
|
|
3696
|
-
const n = Math.min(
|
|
3738
|
+
const n = Math.min(fr, e.length), s = e.length - n, r = [];
|
|
3697
3739
|
for (let i = 0; i < n; ++i)
|
|
3698
3740
|
r.push(we(e[i], t));
|
|
3699
3741
|
return s === 1 ? r.push("... 1 more item") : s > 1 && r.push(`... ${s} more items`), "[" + r.join(", ") + "]";
|
|
3700
3742
|
}
|
|
3701
|
-
function
|
|
3743
|
+
function Er(e) {
|
|
3702
3744
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
3703
3745
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
3704
3746
|
const n = e.constructor.name;
|
|
@@ -3707,7 +3749,7 @@ function fr(e) {
|
|
|
3707
3749
|
}
|
|
3708
3750
|
return t;
|
|
3709
3751
|
}
|
|
3710
|
-
const
|
|
3752
|
+
const vr = (
|
|
3711
3753
|
/* c8 ignore next 6 */
|
|
3712
3754
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
3713
3755
|
globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
|
|
@@ -3740,7 +3782,7 @@ spurious results.`);
|
|
|
3740
3782
|
return !1;
|
|
3741
3783
|
}
|
|
3742
3784
|
);
|
|
3743
|
-
class
|
|
3785
|
+
class hn {
|
|
3744
3786
|
constructor(t, n = "GraphQL request", s = {
|
|
3745
3787
|
line: 1,
|
|
3746
3788
|
column: 1
|
|
@@ -3757,16 +3799,16 @@ class ln {
|
|
|
3757
3799
|
return "Source";
|
|
3758
3800
|
}
|
|
3759
3801
|
}
|
|
3760
|
-
function
|
|
3761
|
-
return
|
|
3802
|
+
function Tr(e) {
|
|
3803
|
+
return vr(e, hn);
|
|
3762
3804
|
}
|
|
3763
|
-
function
|
|
3764
|
-
return new
|
|
3805
|
+
function _r(e, t) {
|
|
3806
|
+
return new Ir(e, t).parseDocument();
|
|
3765
3807
|
}
|
|
3766
|
-
class
|
|
3808
|
+
class Ir {
|
|
3767
3809
|
constructor(t, n = {}) {
|
|
3768
|
-
const s =
|
|
3769
|
-
this._lexer = new
|
|
3810
|
+
const s = Tr(t) ? t : new hn(t);
|
|
3811
|
+
this._lexer = new nr(s), this._options = n, this._tokenCounter = 0;
|
|
3770
3812
|
}
|
|
3771
3813
|
/**
|
|
3772
3814
|
* Converts a name lex token into a name parse node.
|
|
@@ -4733,7 +4775,7 @@ class gr {
|
|
|
4733
4775
|
* given parsed object.
|
|
4734
4776
|
*/
|
|
4735
4777
|
node(t, n) {
|
|
4736
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
4778
|
+
return this._options.noLocation !== !0 && (n.loc = new Qs(
|
|
4737
4779
|
t,
|
|
4738
4780
|
this._lexer.lastToken,
|
|
4739
4781
|
this._lexer.source
|
|
@@ -4756,7 +4798,7 @@ class gr {
|
|
|
4756
4798
|
throw b(
|
|
4757
4799
|
this._lexer.source,
|
|
4758
4800
|
n.start,
|
|
4759
|
-
`Expected ${
|
|
4801
|
+
`Expected ${fn(t)}, found ${pe(n)}.`
|
|
4760
4802
|
);
|
|
4761
4803
|
}
|
|
4762
4804
|
/**
|
|
@@ -4866,19 +4908,19 @@ class gr {
|
|
|
4866
4908
|
}
|
|
4867
4909
|
function pe(e) {
|
|
4868
4910
|
const t = e.value;
|
|
4869
|
-
return
|
|
4911
|
+
return fn(e.kind) + (t != null ? ` "${t}"` : "");
|
|
4870
4912
|
}
|
|
4871
|
-
function
|
|
4872
|
-
return
|
|
4913
|
+
function fn(e) {
|
|
4914
|
+
return sr(e) ? `"${e}"` : e;
|
|
4873
4915
|
}
|
|
4874
|
-
function
|
|
4875
|
-
return `"${e.replace(
|
|
4916
|
+
function Sr(e) {
|
|
4917
|
+
return `"${e.replace(Ar, xr)}"`;
|
|
4876
4918
|
}
|
|
4877
|
-
const
|
|
4878
|
-
function
|
|
4879
|
-
return
|
|
4919
|
+
const Ar = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
4920
|
+
function xr(e) {
|
|
4921
|
+
return wr[e.charCodeAt(0)];
|
|
4880
4922
|
}
|
|
4881
|
-
const
|
|
4923
|
+
const wr = [
|
|
4882
4924
|
"\\u0000",
|
|
4883
4925
|
"\\u0001",
|
|
4884
4926
|
"\\u0002",
|
|
@@ -5044,32 +5086,32 @@ const _r = [
|
|
|
5044
5086
|
"\\u009D",
|
|
5045
5087
|
"\\u009E",
|
|
5046
5088
|
"\\u009F"
|
|
5047
|
-
],
|
|
5048
|
-
function
|
|
5089
|
+
], br = Object.freeze({});
|
|
5090
|
+
function Or(e, t, n = on) {
|
|
5049
5091
|
const s = /* @__PURE__ */ new Map();
|
|
5050
|
-
for (const
|
|
5051
|
-
s.set(
|
|
5092
|
+
for (const x of Object.values(T))
|
|
5093
|
+
s.set(x, Nr(t, x));
|
|
5052
5094
|
let r, i = Array.isArray(e), o = [e], a = -1, c = [], u = e, h, d;
|
|
5053
5095
|
const f = [], m = [];
|
|
5054
5096
|
do {
|
|
5055
5097
|
a++;
|
|
5056
|
-
const
|
|
5057
|
-
if (
|
|
5058
|
-
if (h = m.length === 0 ? void 0 : f[f.length - 1], u = d, d = m.pop(),
|
|
5098
|
+
const x = a === o.length, C = x && c.length !== 0;
|
|
5099
|
+
if (x) {
|
|
5100
|
+
if (h = m.length === 0 ? void 0 : f[f.length - 1], u = d, d = m.pop(), C)
|
|
5059
5101
|
if (i) {
|
|
5060
5102
|
u = u.slice();
|
|
5061
|
-
let
|
|
5103
|
+
let M = 0;
|
|
5062
5104
|
for (const [z, de] of c) {
|
|
5063
|
-
const le = z -
|
|
5064
|
-
de === null ? (u.splice(le, 1),
|
|
5105
|
+
const le = z - M;
|
|
5106
|
+
de === null ? (u.splice(le, 1), M++) : u[le] = de;
|
|
5065
5107
|
}
|
|
5066
5108
|
} else {
|
|
5067
5109
|
u = Object.defineProperties(
|
|
5068
5110
|
{},
|
|
5069
5111
|
Object.getOwnPropertyDescriptors(u)
|
|
5070
5112
|
);
|
|
5071
|
-
for (const [
|
|
5072
|
-
u[
|
|
5113
|
+
for (const [M, z] of c)
|
|
5114
|
+
u[M] = z;
|
|
5073
5115
|
}
|
|
5074
5116
|
a = r.index, o = r.keys, c = r.edits, i = r.inArray, r = r.prev;
|
|
5075
5117
|
} else if (d) {
|
|
@@ -5077,27 +5119,27 @@ function Sr(e, t, n = rn) {
|
|
|
5077
5119
|
continue;
|
|
5078
5120
|
f.push(h);
|
|
5079
5121
|
}
|
|
5080
|
-
let
|
|
5122
|
+
let R;
|
|
5081
5123
|
if (!Array.isArray(u)) {
|
|
5082
5124
|
var y, v;
|
|
5083
|
-
|
|
5084
|
-
const
|
|
5085
|
-
if (
|
|
5125
|
+
bt(u) || me(!1, `Invalid AST Node: ${ot(u)}.`);
|
|
5126
|
+
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;
|
|
5127
|
+
if (R = M == null ? void 0 : M.call(t, u, h, d, f, m), R === br)
|
|
5086
5128
|
break;
|
|
5087
|
-
if (
|
|
5088
|
-
if (!
|
|
5129
|
+
if (R === !1) {
|
|
5130
|
+
if (!x) {
|
|
5089
5131
|
f.pop();
|
|
5090
5132
|
continue;
|
|
5091
5133
|
}
|
|
5092
|
-
} else if (
|
|
5093
|
-
if (
|
|
5094
|
-
u =
|
|
5134
|
+
} else if (R !== void 0 && (c.push([h, R]), !x))
|
|
5135
|
+
if (bt(R))
|
|
5136
|
+
u = R;
|
|
5095
5137
|
else {
|
|
5096
5138
|
f.pop();
|
|
5097
5139
|
continue;
|
|
5098
5140
|
}
|
|
5099
5141
|
}
|
|
5100
|
-
if (
|
|
5142
|
+
if (R === void 0 && C && c.push([h, u]), x)
|
|
5101
5143
|
f.pop();
|
|
5102
5144
|
else {
|
|
5103
5145
|
var S;
|
|
@@ -5112,7 +5154,7 @@ function Sr(e, t, n = rn) {
|
|
|
5112
5154
|
} while (r !== void 0);
|
|
5113
5155
|
return c.length !== 0 ? c[c.length - 1][1] : e;
|
|
5114
5156
|
}
|
|
5115
|
-
function
|
|
5157
|
+
function Nr(e, t) {
|
|
5116
5158
|
const n = e[t];
|
|
5117
5159
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
5118
5160
|
enter: n,
|
|
@@ -5122,10 +5164,10 @@ function xr(e, t) {
|
|
|
5122
5164
|
leave: e.leave
|
|
5123
5165
|
};
|
|
5124
5166
|
}
|
|
5125
|
-
function
|
|
5126
|
-
return
|
|
5167
|
+
function pn(e) {
|
|
5168
|
+
return Or(e, Cr);
|
|
5127
5169
|
}
|
|
5128
|
-
const
|
|
5170
|
+
const kr = 80, Cr = {
|
|
5129
5171
|
Name: {
|
|
5130
5172
|
leave: (e) => e.value
|
|
5131
5173
|
},
|
|
@@ -5155,13 +5197,13 @@ const Ar = 80, wr = {
|
|
|
5155
5197
|
leave: ({ variable: e, type: t, defaultValue: n, directives: s }) => e + ": " + t + I(" = ", n) + I(" ", E(s, " "))
|
|
5156
5198
|
},
|
|
5157
5199
|
SelectionSet: {
|
|
5158
|
-
leave: ({ selections: e }) =>
|
|
5200
|
+
leave: ({ selections: e }) => L(e)
|
|
5159
5201
|
},
|
|
5160
5202
|
Field: {
|
|
5161
5203
|
leave({ alias: e, name: t, arguments: n, directives: s, selectionSet: r }) {
|
|
5162
5204
|
const i = I("", e, ": ") + t;
|
|
5163
5205
|
let o = i + I("(", E(n, ", "), ")");
|
|
5164
|
-
return o.length >
|
|
5206
|
+
return o.length > kr && (o = i + I(`(
|
|
5165
5207
|
`, ge(E(n, `
|
|
5166
5208
|
`)), `
|
|
5167
5209
|
)`)), E([o, E(s, " "), r], " ");
|
|
@@ -5199,7 +5241,7 @@ const Ar = 80, wr = {
|
|
|
5199
5241
|
leave: ({ value: e }) => e
|
|
5200
5242
|
},
|
|
5201
5243
|
StringValue: {
|
|
5202
|
-
leave: ({ value: e, block: t }) => t ?
|
|
5244
|
+
leave: ({ value: e, block: t }) => t ? tr(e) : Sr(e)
|
|
5203
5245
|
},
|
|
5204
5246
|
BooleanValue: {
|
|
5205
5247
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -5236,7 +5278,7 @@ const Ar = 80, wr = {
|
|
|
5236
5278
|
// Type System Definitions
|
|
5237
5279
|
SchemaDefinition: {
|
|
5238
5280
|
leave: ({ description: e, directives: t, operationTypes: n }) => I("", e, `
|
|
5239
|
-
`) + E(["schema", E(t, " "),
|
|
5281
|
+
`) + E(["schema", E(t, " "), L(n)], " ")
|
|
5240
5282
|
},
|
|
5241
5283
|
OperationTypeDefinition: {
|
|
5242
5284
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
@@ -5253,14 +5295,14 @@ const Ar = 80, wr = {
|
|
|
5253
5295
|
t,
|
|
5254
5296
|
I("implements ", E(n, " & ")),
|
|
5255
5297
|
E(s, " "),
|
|
5256
|
-
|
|
5298
|
+
L(r)
|
|
5257
5299
|
],
|
|
5258
5300
|
" "
|
|
5259
5301
|
)
|
|
5260
5302
|
},
|
|
5261
5303
|
FieldDefinition: {
|
|
5262
5304
|
leave: ({ description: e, name: t, arguments: n, type: s, directives: r }) => I("", e, `
|
|
5263
|
-
`) + t + (
|
|
5305
|
+
`) + t + (Nt(n) ? I(`(
|
|
5264
5306
|
`, ge(E(n, `
|
|
5265
5307
|
`)), `
|
|
5266
5308
|
)`) : I("(", E(n, ", "), ")")) + ": " + s + I(" ", E(r, " "))
|
|
@@ -5280,7 +5322,7 @@ const Ar = 80, wr = {
|
|
|
5280
5322
|
t,
|
|
5281
5323
|
I("implements ", E(n, " & ")),
|
|
5282
5324
|
E(s, " "),
|
|
5283
|
-
|
|
5325
|
+
L(r)
|
|
5284
5326
|
],
|
|
5285
5327
|
" "
|
|
5286
5328
|
)
|
|
@@ -5294,7 +5336,7 @@ const Ar = 80, wr = {
|
|
|
5294
5336
|
},
|
|
5295
5337
|
EnumTypeDefinition: {
|
|
5296
5338
|
leave: ({ description: e, name: t, directives: n, values: s }) => I("", e, `
|
|
5297
|
-
`) + E(["enum", t, E(n, " "),
|
|
5339
|
+
`) + E(["enum", t, E(n, " "), L(s)], " ")
|
|
5298
5340
|
},
|
|
5299
5341
|
EnumValueDefinition: {
|
|
5300
5342
|
leave: ({ description: e, name: t, directives: n }) => I("", e, `
|
|
@@ -5302,18 +5344,18 @@ const Ar = 80, wr = {
|
|
|
5302
5344
|
},
|
|
5303
5345
|
InputObjectTypeDefinition: {
|
|
5304
5346
|
leave: ({ description: e, name: t, directives: n, fields: s }) => I("", e, `
|
|
5305
|
-
`) + E(["input", t, E(n, " "),
|
|
5347
|
+
`) + E(["input", t, E(n, " "), L(s)], " ")
|
|
5306
5348
|
},
|
|
5307
5349
|
DirectiveDefinition: {
|
|
5308
5350
|
leave: ({ description: e, name: t, arguments: n, repeatable: s, locations: r }) => I("", e, `
|
|
5309
|
-
`) + "directive @" + t + (
|
|
5351
|
+
`) + "directive @" + t + (Nt(n) ? I(`(
|
|
5310
5352
|
`, ge(E(n, `
|
|
5311
5353
|
`)), `
|
|
5312
5354
|
)`) : I("(", E(n, ", "), ")")) + (s ? " repeatable" : "") + " on " + E(r, " | ")
|
|
5313
5355
|
},
|
|
5314
5356
|
SchemaExtension: {
|
|
5315
5357
|
leave: ({ directives: e, operationTypes: t }) => E(
|
|
5316
|
-
["extend schema", E(e, " "),
|
|
5358
|
+
["extend schema", E(e, " "), L(t)],
|
|
5317
5359
|
" "
|
|
5318
5360
|
)
|
|
5319
5361
|
},
|
|
@@ -5327,7 +5369,7 @@ const Ar = 80, wr = {
|
|
|
5327
5369
|
e,
|
|
5328
5370
|
I("implements ", E(t, " & ")),
|
|
5329
5371
|
E(n, " "),
|
|
5330
|
-
|
|
5372
|
+
L(s)
|
|
5331
5373
|
],
|
|
5332
5374
|
" "
|
|
5333
5375
|
)
|
|
@@ -5339,7 +5381,7 @@ const Ar = 80, wr = {
|
|
|
5339
5381
|
e,
|
|
5340
5382
|
I("implements ", E(t, " & ")),
|
|
5341
5383
|
E(n, " "),
|
|
5342
|
-
|
|
5384
|
+
L(s)
|
|
5343
5385
|
],
|
|
5344
5386
|
" "
|
|
5345
5387
|
)
|
|
@@ -5356,17 +5398,17 @@ const Ar = 80, wr = {
|
|
|
5356
5398
|
)
|
|
5357
5399
|
},
|
|
5358
5400
|
EnumTypeExtension: {
|
|
5359
|
-
leave: ({ name: e, directives: t, values: n }) => E(["extend enum", e, E(t, " "),
|
|
5401
|
+
leave: ({ name: e, directives: t, values: n }) => E(["extend enum", e, E(t, " "), L(n)], " ")
|
|
5360
5402
|
},
|
|
5361
5403
|
InputObjectTypeExtension: {
|
|
5362
|
-
leave: ({ name: e, directives: t, fields: n }) => E(["extend input", e, E(t, " "),
|
|
5404
|
+
leave: ({ name: e, directives: t, fields: n }) => E(["extend input", e, E(t, " "), L(n)], " ")
|
|
5363
5405
|
}
|
|
5364
5406
|
};
|
|
5365
5407
|
function E(e, t = "") {
|
|
5366
5408
|
var n;
|
|
5367
5409
|
return (n = e == null ? void 0 : e.filter((s) => s).join(t)) !== null && n !== void 0 ? n : "";
|
|
5368
5410
|
}
|
|
5369
|
-
function
|
|
5411
|
+
function L(e) {
|
|
5370
5412
|
return I(`{
|
|
5371
5413
|
`, ge(E(e, `
|
|
5372
5414
|
`)), `
|
|
@@ -5379,12 +5421,12 @@ function ge(e) {
|
|
|
5379
5421
|
return I(" ", e.replace(/\n/g, `
|
|
5380
5422
|
`));
|
|
5381
5423
|
}
|
|
5382
|
-
function
|
|
5424
|
+
function Nt(e) {
|
|
5383
5425
|
var t;
|
|
5384
5426
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
5385
5427
|
`))) !== null && t !== void 0 ? t : !1;
|
|
5386
5428
|
}
|
|
5387
|
-
const
|
|
5429
|
+
const kt = (e) => {
|
|
5388
5430
|
var s, r;
|
|
5389
5431
|
let t;
|
|
5390
5432
|
const n = e.definitions.filter((i) => i.kind === "OperationDefinition");
|
|
@@ -5393,14 +5435,14 @@ const Nt = (e) => {
|
|
|
5393
5435
|
if (typeof e == "string") {
|
|
5394
5436
|
let n;
|
|
5395
5437
|
try {
|
|
5396
|
-
const s =
|
|
5397
|
-
n =
|
|
5438
|
+
const s = _r(e);
|
|
5439
|
+
n = kt(s);
|
|
5398
5440
|
} catch {
|
|
5399
5441
|
}
|
|
5400
5442
|
return { query: e, operationName: n };
|
|
5401
5443
|
}
|
|
5402
|
-
const t =
|
|
5403
|
-
return { query:
|
|
5444
|
+
const t = kt(e);
|
|
5445
|
+
return { query: pn(e), operationName: t };
|
|
5404
5446
|
};
|
|
5405
5447
|
class oe extends Error {
|
|
5406
5448
|
constructor(t, n) {
|
|
@@ -5415,13 +5457,13 @@ class oe extends Error {
|
|
|
5415
5457
|
return ((s = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : s.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
5416
5458
|
}
|
|
5417
5459
|
}
|
|
5418
|
-
var
|
|
5419
|
-
function
|
|
5460
|
+
var Dr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5461
|
+
function Rr(e) {
|
|
5420
5462
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5421
5463
|
}
|
|
5422
5464
|
var He = { exports: {} };
|
|
5423
5465
|
(function(e, t) {
|
|
5424
|
-
var n = typeof self < "u" ? self :
|
|
5466
|
+
var n = typeof self < "u" ? self : Dr, s = function() {
|
|
5425
5467
|
function i() {
|
|
5426
5468
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
5427
5469
|
}
|
|
@@ -5532,20 +5574,20 @@ var He = { exports: {} };
|
|
|
5532
5574
|
};
|
|
5533
5575
|
});
|
|
5534
5576
|
}
|
|
5535
|
-
function
|
|
5577
|
+
function x(l) {
|
|
5536
5578
|
var g = new FileReader(), _ = S(g);
|
|
5537
5579
|
return g.readAsArrayBuffer(l), _;
|
|
5538
5580
|
}
|
|
5539
|
-
function
|
|
5581
|
+
function C(l) {
|
|
5540
5582
|
var g = new FileReader(), _ = S(g);
|
|
5541
5583
|
return g.readAsText(l), _;
|
|
5542
5584
|
}
|
|
5543
|
-
function
|
|
5585
|
+
function R(l) {
|
|
5544
5586
|
for (var g = new Uint8Array(l), _ = new Array(g.length), N = 0; N < g.length; N++)
|
|
5545
5587
|
_[N] = String.fromCharCode(g[N]);
|
|
5546
5588
|
return _.join("");
|
|
5547
5589
|
}
|
|
5548
|
-
function
|
|
5590
|
+
function M(l) {
|
|
5549
5591
|
if (l.slice)
|
|
5550
5592
|
return l.slice(0);
|
|
5551
5593
|
var g = new Uint8Array(l.byteLength);
|
|
@@ -5553,7 +5595,7 @@ var He = { exports: {} };
|
|
|
5553
5595
|
}
|
|
5554
5596
|
function z() {
|
|
5555
5597
|
return this.bodyUsed = !1, this._initBody = function(l) {
|
|
5556
|
-
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 =
|
|
5598
|
+
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"));
|
|
5557
5599
|
}, a.blob && (this.blob = function() {
|
|
5558
5600
|
var l = v(this);
|
|
5559
5601
|
if (l)
|
|
@@ -5566,20 +5608,20 @@ var He = { exports: {} };
|
|
|
5566
5608
|
throw new Error("could not read FormData body as blob");
|
|
5567
5609
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
5568
5610
|
}, this.arrayBuffer = function() {
|
|
5569
|
-
return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(
|
|
5611
|
+
return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(x);
|
|
5570
5612
|
}), this.text = function() {
|
|
5571
5613
|
var l = v(this);
|
|
5572
5614
|
if (l)
|
|
5573
5615
|
return l;
|
|
5574
5616
|
if (this._bodyBlob)
|
|
5575
|
-
return
|
|
5617
|
+
return C(this._bodyBlob);
|
|
5576
5618
|
if (this._bodyArrayBuffer)
|
|
5577
|
-
return Promise.resolve(
|
|
5619
|
+
return Promise.resolve(R(this._bodyArrayBuffer));
|
|
5578
5620
|
if (this._bodyFormData)
|
|
5579
5621
|
throw new Error("could not read FormData body as text");
|
|
5580
5622
|
return Promise.resolve(this._bodyText);
|
|
5581
5623
|
}, a.formData && (this.formData = function() {
|
|
5582
|
-
return this.text().then(
|
|
5624
|
+
return this.text().then(En);
|
|
5583
5625
|
}), this.json = function() {
|
|
5584
5626
|
return this.text().then(JSON.parse);
|
|
5585
5627
|
}, this;
|
|
@@ -5605,45 +5647,45 @@ var He = { exports: {} };
|
|
|
5605
5647
|
j.prototype.clone = function() {
|
|
5606
5648
|
return new j(this, { body: this._bodyInit });
|
|
5607
5649
|
};
|
|
5608
|
-
function
|
|
5650
|
+
function En(l) {
|
|
5609
5651
|
var g = new FormData();
|
|
5610
5652
|
return l.trim().split("&").forEach(function(_) {
|
|
5611
5653
|
if (_) {
|
|
5612
|
-
var N = _.split("="), O = N.shift().replace(/\+/g, " "),
|
|
5613
|
-
g.append(decodeURIComponent(O), decodeURIComponent(
|
|
5654
|
+
var N = _.split("="), O = N.shift().replace(/\+/g, " "), A = N.join("=").replace(/\+/g, " ");
|
|
5655
|
+
g.append(decodeURIComponent(O), decodeURIComponent(A));
|
|
5614
5656
|
}
|
|
5615
5657
|
}), g;
|
|
5616
5658
|
}
|
|
5617
|
-
function
|
|
5659
|
+
function vn(l) {
|
|
5618
5660
|
var g = new y(), _ = l.replace(/\r?\n[\t ]+/g, " ");
|
|
5619
5661
|
return _.split(/\r?\n/).forEach(function(N) {
|
|
5620
|
-
var O = N.split(":"),
|
|
5621
|
-
if (
|
|
5662
|
+
var O = N.split(":"), A = O.shift().trim();
|
|
5663
|
+
if (A) {
|
|
5622
5664
|
var he = O.join(":").trim();
|
|
5623
|
-
g.append(
|
|
5665
|
+
g.append(A, he);
|
|
5624
5666
|
}
|
|
5625
5667
|
}), g;
|
|
5626
5668
|
}
|
|
5627
5669
|
z.call(j.prototype);
|
|
5628
|
-
function
|
|
5670
|
+
function q(l, g) {
|
|
5629
5671
|
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);
|
|
5630
5672
|
}
|
|
5631
|
-
z.call(
|
|
5632
|
-
return new
|
|
5673
|
+
z.call(q.prototype), q.prototype.clone = function() {
|
|
5674
|
+
return new q(this._bodyInit, {
|
|
5633
5675
|
status: this.status,
|
|
5634
5676
|
statusText: this.statusText,
|
|
5635
5677
|
headers: new y(this.headers),
|
|
5636
5678
|
url: this.url
|
|
5637
5679
|
});
|
|
5638
|
-
},
|
|
5639
|
-
var l = new
|
|
5680
|
+
}, q.error = function() {
|
|
5681
|
+
var l = new q(null, { status: 0, statusText: "" });
|
|
5640
5682
|
return l.type = "error", l;
|
|
5641
5683
|
};
|
|
5642
|
-
var
|
|
5643
|
-
|
|
5644
|
-
if (
|
|
5684
|
+
var Tn = [301, 302, 303, 307, 308];
|
|
5685
|
+
q.redirect = function(l, g) {
|
|
5686
|
+
if (Tn.indexOf(g) === -1)
|
|
5645
5687
|
throw new RangeError("Invalid status code");
|
|
5646
|
-
return new
|
|
5688
|
+
return new q(null, { status: g, headers: { location: l } });
|
|
5647
5689
|
}, o.DOMException = i.DOMException;
|
|
5648
5690
|
try {
|
|
5649
5691
|
new o.DOMException();
|
|
@@ -5659,63 +5701,63 @@ var He = { exports: {} };
|
|
|
5659
5701
|
var O = new j(l, g);
|
|
5660
5702
|
if (O.signal && O.signal.aborted)
|
|
5661
5703
|
return N(new o.DOMException("Aborted", "AbortError"));
|
|
5662
|
-
var
|
|
5704
|
+
var A = new XMLHttpRequest();
|
|
5663
5705
|
function he() {
|
|
5664
|
-
|
|
5706
|
+
A.abort();
|
|
5665
5707
|
}
|
|
5666
|
-
|
|
5708
|
+
A.onload = function() {
|
|
5667
5709
|
var se = {
|
|
5668
|
-
status:
|
|
5669
|
-
statusText:
|
|
5670
|
-
headers:
|
|
5710
|
+
status: A.status,
|
|
5711
|
+
statusText: A.statusText,
|
|
5712
|
+
headers: vn(A.getAllResponseHeaders() || "")
|
|
5671
5713
|
};
|
|
5672
|
-
se.url = "responseURL" in
|
|
5673
|
-
var Oe = "response" in
|
|
5674
|
-
_(new
|
|
5675
|
-
},
|
|
5714
|
+
se.url = "responseURL" in A ? A.responseURL : se.headers.get("X-Request-URL");
|
|
5715
|
+
var Oe = "response" in A ? A.response : A.responseText;
|
|
5716
|
+
_(new q(Oe, se));
|
|
5717
|
+
}, A.onerror = function() {
|
|
5676
5718
|
N(new TypeError("Network request failed"));
|
|
5677
|
-
},
|
|
5719
|
+
}, A.ontimeout = function() {
|
|
5678
5720
|
N(new TypeError("Network request failed"));
|
|
5679
|
-
},
|
|
5721
|
+
}, A.onabort = function() {
|
|
5680
5722
|
N(new o.DOMException("Aborted", "AbortError"));
|
|
5681
|
-
},
|
|
5682
|
-
|
|
5683
|
-
}), O.signal && (O.signal.addEventListener("abort", he),
|
|
5684
|
-
|
|
5685
|
-
}),
|
|
5723
|
+
}, 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(se, Oe) {
|
|
5724
|
+
A.setRequestHeader(Oe, se);
|
|
5725
|
+
}), O.signal && (O.signal.addEventListener("abort", he), A.onreadystatechange = function() {
|
|
5726
|
+
A.readyState === 4 && O.signal.removeEventListener("abort", he);
|
|
5727
|
+
}), A.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
|
|
5686
5728
|
});
|
|
5687
5729
|
}
|
|
5688
|
-
return be.polyfill = !0, i.fetch || (i.fetch = be, i.Headers = y, i.Request = j, i.Response =
|
|
5730
|
+
return be.polyfill = !0, i.fetch || (i.fetch = be, i.Headers = y, i.Request = j, i.Response = q), o.Headers = y, o.Request = j, o.Response = q, o.fetch = be, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
5689
5731
|
})({});
|
|
5690
5732
|
})(s), s.fetch.ponyfill = !0, delete s.fetch.polyfill;
|
|
5691
5733
|
var r = s;
|
|
5692
5734
|
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;
|
|
5693
5735
|
})(He, He.exports);
|
|
5694
5736
|
var Ie = He.exports;
|
|
5695
|
-
const Ee = /* @__PURE__ */
|
|
5737
|
+
const Ee = /* @__PURE__ */ Rr(Ie), Mr = /* @__PURE__ */ In({
|
|
5696
5738
|
__proto__: null,
|
|
5697
5739
|
default: Ee
|
|
5698
5740
|
}, [Ie]), Y = (e) => {
|
|
5699
5741
|
let t = {};
|
|
5700
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
5742
|
+
return e && (typeof Headers < "u" && e instanceof Headers || Mr && Ie.Headers && e instanceof Ie.Headers ? t = Bs(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
|
|
5701
5743
|
n && s !== void 0 && (t[n] = s);
|
|
5702
5744
|
}) : t = e), t;
|
|
5703
|
-
},
|
|
5745
|
+
}, Ct = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Lr = (e) => {
|
|
5704
5746
|
if (!Array.isArray(e.query)) {
|
|
5705
|
-
const s = e, r = [`query=${encodeURIComponent(
|
|
5747
|
+
const s = e, r = [`query=${encodeURIComponent(Ct(s.query))}`];
|
|
5706
5748
|
return e.variables && r.push(`variables=${encodeURIComponent(s.jsonSerializer.stringify(s.variables))}`), s.operationName && r.push(`operationName=${encodeURIComponent(s.operationName)}`), r.join("&");
|
|
5707
5749
|
}
|
|
5708
5750
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
5709
5751
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
5710
5752
|
const t = e, n = e.query.reduce((s, r, i) => (s.push({
|
|
5711
|
-
query:
|
|
5753
|
+
query: Ct(r),
|
|
5712
5754
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[i]) : void 0
|
|
5713
5755
|
}), s), []);
|
|
5714
5756
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
5715
|
-
},
|
|
5757
|
+
}, qr = (e) => async (t) => {
|
|
5716
5758
|
const { url: n, query: s, variables: r, operationName: i, fetch: o, fetchOptions: a, middleware: c } = t, u = { ...t.headers };
|
|
5717
5759
|
let h = "", d;
|
|
5718
|
-
e === "POST" ? (d =
|
|
5760
|
+
e === "POST" ? (d = Pr(s, r, i, a.jsonSerializer), typeof d == "string" && (u["Content-Type"] = "application/json")) : h = Lr({
|
|
5719
5761
|
query: s,
|
|
5720
5762
|
variables: r,
|
|
5721
5763
|
operationName: i,
|
|
@@ -5729,23 +5771,23 @@ const Ee = /* @__PURE__ */ Or(Ie), Nr = /* @__PURE__ */ _n({
|
|
|
5729
5771
|
};
|
|
5730
5772
|
let m = n, y = f;
|
|
5731
5773
|
if (c) {
|
|
5732
|
-
const v = await Promise.resolve(c({ ...f, url: n, operationName: i, variables: r })), { url: S, ...
|
|
5733
|
-
m = S, y =
|
|
5774
|
+
const v = await Promise.resolve(c({ ...f, url: n, operationName: i, variables: r })), { url: S, ...x } = v;
|
|
5775
|
+
m = S, y = x;
|
|
5734
5776
|
}
|
|
5735
5777
|
return h && (m = `${m}?${h}`), await o(m, y);
|
|
5736
5778
|
};
|
|
5737
|
-
class
|
|
5779
|
+
class yn {
|
|
5738
5780
|
constructor(t, n = {}) {
|
|
5739
5781
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...s) => {
|
|
5740
|
-
const [r, i, o] = s, a =
|
|
5782
|
+
const [r, i, o] = s, a = $s(r, i, o), { headers: c, fetch: u = Ee, method: h = "POST", requestMiddleware: d, responseMiddleware: f, ...m } = this.requestConfig, { url: y } = this;
|
|
5741
5783
|
a.signal !== void 0 && (m.signal = a.signal);
|
|
5742
5784
|
const { operationName: v } = Re(a.query);
|
|
5743
|
-
return
|
|
5785
|
+
return Me({
|
|
5744
5786
|
url: y,
|
|
5745
5787
|
query: a.query,
|
|
5746
5788
|
variables: a.variables,
|
|
5747
5789
|
headers: {
|
|
5748
|
-
...Y(
|
|
5790
|
+
...Y(Le(c)),
|
|
5749
5791
|
...Y(a.requestHeaders)
|
|
5750
5792
|
},
|
|
5751
5793
|
operationName: v,
|
|
@@ -5759,15 +5801,15 @@ class pn {
|
|
|
5759
5801
|
};
|
|
5760
5802
|
}
|
|
5761
5803
|
async request(t, ...n) {
|
|
5762
|
-
const [s, r] = n, i =
|
|
5804
|
+
const [s, r] = n, i = js(t, s, r), { headers: o, fetch: a = Ee, method: c = "POST", requestMiddleware: u, responseMiddleware: h, ...d } = this.requestConfig, { url: f } = this;
|
|
5763
5805
|
i.signal !== void 0 && (d.signal = i.signal);
|
|
5764
5806
|
const { query: m, operationName: y } = Re(i.document);
|
|
5765
|
-
return
|
|
5807
|
+
return Me({
|
|
5766
5808
|
url: f,
|
|
5767
5809
|
query: m,
|
|
5768
5810
|
variables: i.variables,
|
|
5769
5811
|
headers: {
|
|
5770
|
-
...Y(
|
|
5812
|
+
...Y(Le(o)),
|
|
5771
5813
|
...Y(i.requestHeaders)
|
|
5772
5814
|
},
|
|
5773
5815
|
operationName: y,
|
|
@@ -5781,16 +5823,16 @@ class pn {
|
|
|
5781
5823
|
}
|
|
5782
5824
|
// prettier-ignore
|
|
5783
5825
|
batchRequests(t, n) {
|
|
5784
|
-
const s =
|
|
5826
|
+
const s = Vs(t, n), { headers: r, ...i } = this.requestConfig;
|
|
5785
5827
|
s.signal !== void 0 && (i.signal = s.signal);
|
|
5786
5828
|
const o = s.documents.map(({ document: c }) => Re(c).query), a = s.documents.map(({ variables: c }) => c);
|
|
5787
|
-
return
|
|
5829
|
+
return Me({
|
|
5788
5830
|
url: this.url,
|
|
5789
5831
|
query: o,
|
|
5790
5832
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
5791
5833
|
variables: a,
|
|
5792
5834
|
headers: {
|
|
5793
|
-
...Y(
|
|
5835
|
+
...Y(Le(r)),
|
|
5794
5836
|
...Y(s.requestHeaders)
|
|
5795
5837
|
},
|
|
5796
5838
|
operationName: void 0,
|
|
@@ -5819,8 +5861,8 @@ class pn {
|
|
|
5819
5861
|
return this.url = t, this;
|
|
5820
5862
|
}
|
|
5821
5863
|
}
|
|
5822
|
-
const
|
|
5823
|
-
const { query: t, variables: n, fetchOptions: s } = e, r =
|
|
5864
|
+
const Me = async (e) => {
|
|
5865
|
+
const { query: t, variables: n, fetchOptions: s } = e, r = qr(Us(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Fr(o, s.jsonSerializer ?? rt), 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";
|
|
5824
5866
|
if (o.ok && u && c) {
|
|
5825
5867
|
const { errors: h, ...d } = (Array.isArray(a), a), f = s.errorPolicy === "ignore" ? d : a;
|
|
5826
5868
|
return {
|
|
@@ -5839,13 +5881,13 @@ const Le = async (e) => {
|
|
|
5839
5881
|
);
|
|
5840
5882
|
}
|
|
5841
5883
|
};
|
|
5842
|
-
async function
|
|
5843
|
-
const s =
|
|
5844
|
-
return new
|
|
5884
|
+
async function mn(e, t, ...n) {
|
|
5885
|
+
const s = Hs(e, t, ...n);
|
|
5886
|
+
return new yn(s.url).request({
|
|
5845
5887
|
...s
|
|
5846
5888
|
});
|
|
5847
5889
|
}
|
|
5848
|
-
const
|
|
5890
|
+
const Pr = (e, t, n, s) => {
|
|
5849
5891
|
const r = s ?? rt;
|
|
5850
5892
|
if (!Array.isArray(e))
|
|
5851
5893
|
return r.stringify({ query: e, variables: t, operationName: n });
|
|
@@ -5853,12 +5895,12 @@ const Dr = (e, t, n, s) => {
|
|
|
5853
5895
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
5854
5896
|
const i = e.reduce((o, a, c) => (o.push({ query: a, variables: t ? t[c] : void 0 }), o), []);
|
|
5855
5897
|
return r.stringify(i);
|
|
5856
|
-
},
|
|
5898
|
+
}, Fr = async (e, t) => {
|
|
5857
5899
|
let n;
|
|
5858
5900
|
return e.headers.forEach((s, r) => {
|
|
5859
5901
|
r.toLowerCase() === "content-type" && (n = s);
|
|
5860
5902
|
}), 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();
|
|
5861
|
-
},
|
|
5903
|
+
}, Le = (e) => typeof e == "function" ? e() : e, Ur = K(
|
|
5862
5904
|
async ({ input: e }) => {
|
|
5863
5905
|
var t;
|
|
5864
5906
|
if (!e.endpoint || e.endpoint === "")
|
|
@@ -5870,7 +5912,7 @@ const Dr = (e, t, n, s) => {
|
|
|
5870
5912
|
if (!e.requestHeaders)
|
|
5871
5913
|
throw new Error("No request headers provided.");
|
|
5872
5914
|
try {
|
|
5873
|
-
const n = await
|
|
5915
|
+
const n = await mn(
|
|
5874
5916
|
e.endpoint,
|
|
5875
5917
|
e.document,
|
|
5876
5918
|
{ items: e.items },
|
|
@@ -5878,19 +5920,23 @@ const Dr = (e, t, n, s) => {
|
|
|
5878
5920
|
);
|
|
5879
5921
|
if (!((t = n.quoteAddItem) != null && t.quote))
|
|
5880
5922
|
throw new Error("Could not add items to quote.");
|
|
5881
|
-
return {
|
|
5923
|
+
return {
|
|
5924
|
+
type: "ADD_ITEMS_SUCCESS",
|
|
5925
|
+
quote: n.quoteAddItem.quote,
|
|
5926
|
+
itemsAdded: n.quoteAddItem.itemsAdded
|
|
5927
|
+
};
|
|
5882
5928
|
} catch {
|
|
5883
5929
|
throw new Error("Request to add item(s) failed.");
|
|
5884
5930
|
}
|
|
5885
5931
|
}
|
|
5886
|
-
),
|
|
5932
|
+
), Br = K(async ({ input: e }) => {
|
|
5887
5933
|
var t;
|
|
5888
5934
|
if (!e.endpoint || e.endpoint === "")
|
|
5889
5935
|
throw new Error("No endpoint provided.");
|
|
5890
5936
|
if (e.items.length < 1)
|
|
5891
5937
|
throw new Error("No items provided.");
|
|
5892
5938
|
try {
|
|
5893
|
-
const n = await
|
|
5939
|
+
const n = await mn(
|
|
5894
5940
|
e.endpoint,
|
|
5895
5941
|
""
|
|
5896
5942
|
// input.document,
|
|
@@ -5901,12 +5947,13 @@ const Dr = (e, t, n, s) => {
|
|
|
5901
5947
|
throw new Error("Could not remove items from quote.");
|
|
5902
5948
|
return {
|
|
5903
5949
|
type: "REMOVE_ITEMS_SUCCESS",
|
|
5904
|
-
quote: n.quoteRemoveItem.quote
|
|
5950
|
+
quote: n.quoteRemoveItem.quote,
|
|
5951
|
+
itemsRemoved: n.quoteRemoveItem.itemsRemoved
|
|
5905
5952
|
};
|
|
5906
5953
|
} catch {
|
|
5907
5954
|
throw new Error("Request to remove item(s) failed.");
|
|
5908
5955
|
}
|
|
5909
|
-
}),
|
|
5956
|
+
}), qe = typeof window > "u", jr = K(
|
|
5910
5957
|
async ({ input: e }) => {
|
|
5911
5958
|
var n, s, r, i;
|
|
5912
5959
|
if (!e.endpoint)
|
|
@@ -5919,9 +5966,9 @@ const Dr = (e, t, n, s) => {
|
|
|
5919
5966
|
throw console.log("no request document"), new Error("No request document provided.");
|
|
5920
5967
|
if (!e.requestHeaders)
|
|
5921
5968
|
throw console.log("no headers"), new Error("No request headers provided.");
|
|
5922
|
-
const t = new
|
|
5923
|
-
|
|
5924
|
-
|
|
5969
|
+
const t = new yn(
|
|
5970
|
+
qe ? e.endpointSsr : e.endpoint,
|
|
5971
|
+
qe ? { fetch, method: "POST" } : {
|
|
5925
5972
|
credentials: "include",
|
|
5926
5973
|
method: "POST",
|
|
5927
5974
|
mode: "cors"
|
|
@@ -5929,9 +5976,9 @@ const Dr = (e, t, n, s) => {
|
|
|
5929
5976
|
);
|
|
5930
5977
|
try {
|
|
5931
5978
|
const { data: o, headers: a, status: c, errors: u, extensions: h } = await t.rawRequest(
|
|
5932
|
-
|
|
5979
|
+
pn(e.document),
|
|
5933
5980
|
{},
|
|
5934
|
-
|
|
5981
|
+
qe ? {
|
|
5935
5982
|
...e.requestHeaders,
|
|
5936
5983
|
Cookie: `quote_${e.locale}=${e.quoteId ?? ""}`
|
|
5937
5984
|
} : e.requestHeaders
|
|
@@ -5948,32 +5995,35 @@ const Dr = (e, t, n, s) => {
|
|
|
5948
5995
|
throw console.log("refresh error", o), new Error("Request to add item(s) failed.");
|
|
5949
5996
|
}
|
|
5950
5997
|
}
|
|
5951
|
-
),
|
|
5998
|
+
), $r = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", Vr = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Dt = Ae({
|
|
5952
5999
|
types: {
|
|
5953
6000
|
context: {},
|
|
6001
|
+
emitted: {},
|
|
5954
6002
|
events: {},
|
|
5955
6003
|
input: {}
|
|
5956
6004
|
},
|
|
5957
6005
|
actions: {
|
|
5958
|
-
addItems:
|
|
5959
|
-
|
|
5960
|
-
|
|
6006
|
+
addItems: D(Ms),
|
|
6007
|
+
notifyAddItems: Tt(Ls),
|
|
6008
|
+
notifyRemoveItems: Tt(qs),
|
|
6009
|
+
removeItems: D(Ps),
|
|
6010
|
+
refresh: D(Fs)
|
|
5961
6011
|
},
|
|
5962
6012
|
actors: {
|
|
5963
|
-
addItems:
|
|
5964
|
-
removeItems:
|
|
5965
|
-
refresh:
|
|
6013
|
+
addItems: Ur,
|
|
6014
|
+
removeItems: Br,
|
|
6015
|
+
refresh: jr
|
|
5966
6016
|
},
|
|
5967
6017
|
guards: {
|
|
5968
|
-
canRefresh:
|
|
5969
|
-
hasItems:
|
|
6018
|
+
canRefresh: $r,
|
|
6019
|
+
hasItems: Vr
|
|
5970
6020
|
}
|
|
5971
6021
|
}).createMachine({
|
|
5972
6022
|
/** @todo do we need to add the view to the id? (e.g. quote_en-us) */
|
|
5973
6023
|
id: "quote",
|
|
5974
6024
|
initial: "initializing",
|
|
5975
6025
|
context: ({ input: e }) => {
|
|
5976
|
-
var t, n, s, r, i, o, a, c, u, h, d, f, m, y;
|
|
6026
|
+
var t, n, s, r, i, o, a, c, u, h, d, f, m, y, v, S, x, C;
|
|
5977
6027
|
return {
|
|
5978
6028
|
quote: {
|
|
5979
6029
|
id: "",
|
|
@@ -6007,6 +6057,9 @@ const Dr = (e, t, n, s) => {
|
|
|
6007
6057
|
// settings: [],
|
|
6008
6058
|
...(t = e == null ? void 0 : e.initialContext) == null ? void 0 : t.quote
|
|
6009
6059
|
},
|
|
6060
|
+
// itemsAdded: [],
|
|
6061
|
+
// itemsRemoved: [],
|
|
6062
|
+
errors: [],
|
|
6010
6063
|
endpoints: {
|
|
6011
6064
|
client: "",
|
|
6012
6065
|
server: "",
|
|
@@ -6036,15 +6089,12 @@ const Dr = (e, t, n, s) => {
|
|
|
6036
6089
|
addItems: {
|
|
6037
6090
|
document: ((d = (h = (u = e == null ? void 0 : e.initialContext) == null ? void 0 : u.graphql) == null ? void 0 : h.addItems) == null ? void 0 : d.document) ?? "",
|
|
6038
6091
|
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
|
|
6092
|
+
},
|
|
6093
|
+
removeItems: {
|
|
6094
|
+
document: ((S = (v = e.initialContext.graphql) == null ? void 0 : v.removeItems) == null ? void 0 : S.document) ?? "",
|
|
6095
|
+
requestHeaders: ((C = (x = e.initialContext.graphql) == null ? void 0 : x.removeItems) == null ? void 0 : C.requestHeaders) ?? void 0
|
|
6039
6096
|
}
|
|
6040
|
-
|
|
6041
|
-
// document: input.initialContext.graphql?.removeItems?.document ?? '',
|
|
6042
|
-
// requestHeaders:
|
|
6043
|
-
// input.initialContext.graphql?.removeItems?.requestHeaders ??
|
|
6044
|
-
// undefined,
|
|
6045
|
-
// },
|
|
6046
|
-
},
|
|
6047
|
-
errors: []
|
|
6097
|
+
}
|
|
6048
6098
|
};
|
|
6049
6099
|
},
|
|
6050
6100
|
states: {
|
|
@@ -6157,7 +6207,7 @@ const Dr = (e, t, n, s) => {
|
|
|
6157
6207
|
src: "addItems",
|
|
6158
6208
|
onDone: [
|
|
6159
6209
|
{
|
|
6160
|
-
actions: ["addItems"],
|
|
6210
|
+
actions: ["addItems", "notifyAddItems"],
|
|
6161
6211
|
target: "active"
|
|
6162
6212
|
}
|
|
6163
6213
|
],
|
|
@@ -6178,6 +6228,36 @@ const Dr = (e, t, n, s) => {
|
|
|
6178
6228
|
* Removing item(s) from quote
|
|
6179
6229
|
*/
|
|
6180
6230
|
removingItems: {
|
|
6231
|
+
invoke: {
|
|
6232
|
+
/** @todo is there any way to limit the event to be a known event? */
|
|
6233
|
+
input: ({ context: e, event: t }) => {
|
|
6234
|
+
var n, s;
|
|
6235
|
+
return {
|
|
6236
|
+
endpoint: e.endpoints.client,
|
|
6237
|
+
items: t.type === "REMOVE_ITEMS" ? t.items : [],
|
|
6238
|
+
document: (n = e.graphql.removeItems) == null ? void 0 : n.document,
|
|
6239
|
+
requestHeaders: (s = e.graphql.removeItems) == null ? void 0 : s.requestHeaders
|
|
6240
|
+
};
|
|
6241
|
+
},
|
|
6242
|
+
src: "removeItems",
|
|
6243
|
+
onDone: [
|
|
6244
|
+
{
|
|
6245
|
+
actions: ["removeItems", "notifyRemoveItems"],
|
|
6246
|
+
target: "checkingItems"
|
|
6247
|
+
}
|
|
6248
|
+
],
|
|
6249
|
+
onError: [
|
|
6250
|
+
{
|
|
6251
|
+
/** @todo log error? */
|
|
6252
|
+
// actions: ['addItems'],
|
|
6253
|
+
guard: "hasItems",
|
|
6254
|
+
target: "active"
|
|
6255
|
+
},
|
|
6256
|
+
{
|
|
6257
|
+
target: "empty"
|
|
6258
|
+
}
|
|
6259
|
+
]
|
|
6260
|
+
}
|
|
6181
6261
|
// invoke: {
|
|
6182
6262
|
// /** @todo is there any way to limit the event to be a known event? */
|
|
6183
6263
|
// input: ({ context, event }) => ({
|
|
@@ -6238,15 +6318,15 @@ const Dr = (e, t, n, s) => {
|
|
|
6238
6318
|
// removingGiftCard: {},
|
|
6239
6319
|
// applyingSettings: {},
|
|
6240
6320
|
}
|
|
6241
|
-
}),
|
|
6321
|
+
}), gn = ze(
|
|
6242
6322
|
{}
|
|
6243
|
-
),
|
|
6323
|
+
), Kr = () => {
|
|
6244
6324
|
var c;
|
|
6245
|
-
const e = Je(
|
|
6325
|
+
const e = Je(gn);
|
|
6246
6326
|
if (!e || !e.getSnapshot)
|
|
6247
6327
|
throw new Error("quoteActor is not properly initialized");
|
|
6248
|
-
const [t, n] =
|
|
6249
|
-
|
|
6328
|
+
const [t, n] = Rt(() => e.getSnapshot());
|
|
6329
|
+
Mt(() => {
|
|
6250
6330
|
if (!e || !e.getSnapshot) {
|
|
6251
6331
|
console.error("quoteActor is not properly initialized");
|
|
6252
6332
|
return;
|
|
@@ -6270,21 +6350,21 @@ const Dr = (e, t, n, s) => {
|
|
|
6270
6350
|
isRemovingItems: o,
|
|
6271
6351
|
isUpdatingItems: a
|
|
6272
6352
|
};
|
|
6273
|
-
},
|
|
6353
|
+
}, Zr = async (e = {
|
|
6274
6354
|
inspect: void 0,
|
|
6275
6355
|
quote: { id: "", locale: "" },
|
|
6276
6356
|
endpoints: { client: "", server: "" },
|
|
6277
6357
|
graphql: {}
|
|
6278
6358
|
}) => typeof window < "u" ? (console.warn(
|
|
6279
6359
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
6280
|
-
), U(
|
|
6360
|
+
), U(Dt, {
|
|
6281
6361
|
inspect: e.inspect,
|
|
6282
6362
|
input: {
|
|
6283
6363
|
initialContext: {
|
|
6284
6364
|
endpoints: e.endpoints
|
|
6285
6365
|
}
|
|
6286
6366
|
}
|
|
6287
|
-
}).start()) : U(
|
|
6367
|
+
}).start()) : U(Dt, {
|
|
6288
6368
|
input: {
|
|
6289
6369
|
initialContext: {
|
|
6290
6370
|
endpoints: e.endpoints,
|
|
@@ -6297,23 +6377,23 @@ const Dr = (e, t, n, s) => {
|
|
|
6297
6377
|
},
|
|
6298
6378
|
inspect: e.inspect
|
|
6299
6379
|
}).start();
|
|
6300
|
-
function
|
|
6301
|
-
return /* @__PURE__ */ Ge(
|
|
6380
|
+
function ei({ actor: e, children: t }) {
|
|
6381
|
+
return /* @__PURE__ */ Ge(gn.Provider, { value: e, children: t });
|
|
6302
6382
|
}
|
|
6303
6383
|
export {
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6384
|
+
tn as AuthContext,
|
|
6385
|
+
Yr as AuthProvider,
|
|
6386
|
+
gn as QuoteContext,
|
|
6387
|
+
ei as QuoteProvider,
|
|
6388
|
+
nn as ToastContext,
|
|
6389
|
+
Wr as ToastProvider,
|
|
6390
|
+
At as authMachine,
|
|
6391
|
+
Jr as getAuth,
|
|
6392
|
+
Zr as getQuote,
|
|
6393
|
+
Dt as quoteMachine,
|
|
6394
|
+
Rs as timerMachine,
|
|
6395
|
+
Xr as toastMachine,
|
|
6396
|
+
zr as useAuth,
|
|
6397
|
+
Kr as useQuote,
|
|
6398
|
+
Qr as useToast
|
|
6319
6399
|
};
|