@myxtra/authentication-green 1.16.0 → 2.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/{App-fd69d599.mjs → App-b8d0f682.mjs} +1073 -1168
- package/dist/index-c468a93b.mjs +9006 -0
- package/dist/xtra-authentication.mjs +2 -2
- package/package.json +4 -5
- package/dist/index-ab1ba154.mjs +0 -8992
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
1
|
+
var gt = (e, t, s) => {
|
|
2
2
|
if (!t.has(e))
|
|
3
3
|
throw TypeError("Cannot " + s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var n = (e, t, s) => (gt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), p = (e, t, s) => {
|
|
6
6
|
if (t.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
9
|
-
}, h = (e, t, s, r) => (
|
|
10
|
-
var
|
|
11
|
-
set _(
|
|
12
|
-
h(e, t,
|
|
9
|
+
}, h = (e, t, s, r) => (gt(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s);
|
|
10
|
+
var at = (e, t, s, r) => ({
|
|
11
|
+
set _(a) {
|
|
12
|
+
h(e, t, a, s);
|
|
13
13
|
},
|
|
14
14
|
get _() {
|
|
15
|
-
return
|
|
15
|
+
return n(e, t, r);
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
18
|
-
import { r as d, j as i, u as
|
|
19
|
-
var
|
|
17
|
+
}), x = (e, t, s) => (gt(e, t, "access private method"), s);
|
|
18
|
+
import { r as d, j as i, u as Ks, a as Gs, b as _e, P as Qt, c as cs, d as Vs, e as qs, E as Ws, C as Zs } from "./index-c468a93b.mjs";
|
|
19
|
+
var Ke = class {
|
|
20
20
|
constructor() {
|
|
21
21
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
22
22
|
}
|
|
@@ -32,82 +32,82 @@ var Ge = class {
|
|
|
32
32
|
}
|
|
33
33
|
onUnsubscribe() {
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, $e = typeof window > "u" || "Deno" in window;
|
|
36
36
|
function Z() {
|
|
37
37
|
}
|
|
38
38
|
function Ys(e, t) {
|
|
39
39
|
return typeof e == "function" ? e(t) : e;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function xt(e) {
|
|
42
42
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function us(e, t) {
|
|
45
45
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Ht(e, t) {
|
|
48
48
|
const {
|
|
49
49
|
type: s = "all",
|
|
50
50
|
exact: r,
|
|
51
|
-
fetchStatus:
|
|
51
|
+
fetchStatus: a,
|
|
52
52
|
predicate: o,
|
|
53
53
|
queryKey: l,
|
|
54
54
|
stale: c
|
|
55
55
|
} = e;
|
|
56
56
|
if (l) {
|
|
57
57
|
if (r) {
|
|
58
|
-
if (t.queryHash !==
|
|
58
|
+
if (t.queryHash !== Ft(l, t.options))
|
|
59
59
|
return !1;
|
|
60
|
-
} else if (!
|
|
60
|
+
} else if (!Ve(t.queryKey, l))
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
63
|
if (s !== "all") {
|
|
64
|
-
const
|
|
65
|
-
if (s === "active" && !
|
|
64
|
+
const m = t.isActive();
|
|
65
|
+
if (s === "active" && !m || s === "inactive" && m)
|
|
66
66
|
return !1;
|
|
67
67
|
}
|
|
68
|
-
return !(typeof c == "boolean" && t.isStale() !== c || typeof
|
|
68
|
+
return !(typeof c == "boolean" && t.isStale() !== c || typeof a < "u" && a !== t.state.fetchStatus || o && !o(t));
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const { exact: s, status: r, predicate:
|
|
70
|
+
function $t(e, t) {
|
|
71
|
+
const { exact: s, status: r, predicate: a, mutationKey: o } = e;
|
|
72
72
|
if (o) {
|
|
73
73
|
if (!t.options.mutationKey)
|
|
74
74
|
return !1;
|
|
75
75
|
if (s) {
|
|
76
|
-
if (
|
|
76
|
+
if (we(t.options.mutationKey) !== we(o))
|
|
77
77
|
return !1;
|
|
78
|
-
} else if (!
|
|
78
|
+
} else if (!Ve(t.options.mutationKey, o))
|
|
79
79
|
return !1;
|
|
80
80
|
}
|
|
81
|
-
return !(r && t.state.status !== r ||
|
|
81
|
+
return !(r && t.state.status !== r || a && !a(t));
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
return ((t == null ? void 0 : t.queryKeyHashFn) ||
|
|
83
|
+
function Ft(e, t) {
|
|
84
|
+
return ((t == null ? void 0 : t.queryKeyHashFn) || we)(e);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function we(e) {
|
|
87
87
|
return JSON.stringify(
|
|
88
88
|
e,
|
|
89
|
-
(t, s) =>
|
|
89
|
+
(t, s) => bt(s) ? Object.keys(s).sort().reduce((r, a) => (r[a] = s[a], r), {}) : s
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !
|
|
92
|
+
function Ve(e, t) {
|
|
93
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !Ve(e[s], t[s])) : !1;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function ds(e, t) {
|
|
96
96
|
if (e === t)
|
|
97
97
|
return e;
|
|
98
|
-
const s =
|
|
99
|
-
if (s ||
|
|
100
|
-
const r = s ? e : Object.keys(e),
|
|
101
|
-
let
|
|
102
|
-
for (let
|
|
103
|
-
const u = s ?
|
|
104
|
-
!s && e[u] === void 0 && t[u] === void 0 && r.includes(u) ? (c[u] = void 0,
|
|
98
|
+
const s = Kt(e) && Kt(t);
|
|
99
|
+
if (s || bt(e) && bt(t)) {
|
|
100
|
+
const r = s ? e : Object.keys(e), a = r.length, o = s ? t : Object.keys(t), l = o.length, c = s ? [] : {};
|
|
101
|
+
let m = 0;
|
|
102
|
+
for (let C = 0; C < l; C++) {
|
|
103
|
+
const u = s ? C : o[C];
|
|
104
|
+
!s && e[u] === void 0 && t[u] === void 0 && r.includes(u) ? (c[u] = void 0, m++) : (c[u] = ds(e[u], t[u]), c[u] === e[u] && e[u] !== void 0 && m++);
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return a === l && m === a ? e : c;
|
|
107
107
|
}
|
|
108
108
|
return t;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function ct(e, t) {
|
|
111
111
|
if (e && !t || t && !e)
|
|
112
112
|
return !1;
|
|
113
113
|
for (const s in e)
|
|
@@ -115,45 +115,45 @@ function ht(e, t) {
|
|
|
115
115
|
return !1;
|
|
116
116
|
return !0;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Kt(e) {
|
|
119
119
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
121
|
+
function bt(e) {
|
|
122
|
+
if (!Gt(e))
|
|
123
123
|
return !1;
|
|
124
124
|
const t = e.constructor;
|
|
125
125
|
if (typeof t > "u")
|
|
126
126
|
return !0;
|
|
127
127
|
const s = t.prototype;
|
|
128
|
-
return !(!
|
|
128
|
+
return !(!Gt(s) || !s.hasOwnProperty("isPrototypeOf"));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Gt(e) {
|
|
131
131
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function zs(e) {
|
|
134
134
|
return new Promise((t) => {
|
|
135
135
|
setTimeout(t, e);
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ?
|
|
138
|
+
function wt(e, t, s) {
|
|
139
|
+
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ? ds(e, t) : t;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Js(e, t, s = 0) {
|
|
142
142
|
const r = [...e, t];
|
|
143
143
|
return s && r.length > s ? r.slice(1) : r;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Xs(e, t, s = 0) {
|
|
146
146
|
const r = [t, ...e];
|
|
147
147
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
148
148
|
}
|
|
149
|
-
var
|
|
149
|
+
var pe, ne, Ee, Bt, Is = (Bt = class extends Ke {
|
|
150
150
|
constructor() {
|
|
151
151
|
super();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
h(this,
|
|
156
|
-
if (
|
|
152
|
+
p(this, pe, void 0);
|
|
153
|
+
p(this, ne, void 0);
|
|
154
|
+
p(this, Ee, void 0);
|
|
155
|
+
h(this, Ee, (t) => {
|
|
156
|
+
if (!$e && window.addEventListener) {
|
|
157
157
|
const s = () => t();
|
|
158
158
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
159
159
|
window.removeEventListener("visibilitychange", s);
|
|
@@ -162,20 +162,20 @@ var me, ae, Ae, rs, Bs = (rs = class extends Ge {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
onSubscribe() {
|
|
165
|
-
|
|
165
|
+
n(this, ne) || this.setEventListener(n(this, Ee));
|
|
166
166
|
}
|
|
167
167
|
onUnsubscribe() {
|
|
168
168
|
var t;
|
|
169
|
-
this.hasListeners() || ((t =
|
|
169
|
+
this.hasListeners() || ((t = n(this, ne)) == null || t.call(this), h(this, ne, void 0));
|
|
170
170
|
}
|
|
171
171
|
setEventListener(t) {
|
|
172
172
|
var s;
|
|
173
|
-
h(this,
|
|
173
|
+
h(this, Ee, t), (s = n(this, ne)) == null || s.call(this), h(this, ne, t((r) => {
|
|
174
174
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
setFocused(t) {
|
|
178
|
-
|
|
178
|
+
n(this, pe) !== t && (h(this, pe, t), this.onFocus());
|
|
179
179
|
}
|
|
180
180
|
onFocus() {
|
|
181
181
|
this.listeners.forEach((t) => {
|
|
@@ -184,16 +184,16 @@ var me, ae, Ae, rs, Bs = (rs = class extends Ge {
|
|
|
184
184
|
}
|
|
185
185
|
isFocused() {
|
|
186
186
|
var t;
|
|
187
|
-
return typeof
|
|
187
|
+
return typeof n(this, pe) == "boolean" ? n(this, pe) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
188
188
|
}
|
|
189
|
-
},
|
|
189
|
+
}, pe = new WeakMap(), ne = new WeakMap(), Ee = new WeakMap(), Bt), ut = new Is(), Se, ae, Ae, es, Bs = (es = class extends Ke {
|
|
190
190
|
constructor() {
|
|
191
191
|
super();
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
h(this,
|
|
196
|
-
if (
|
|
192
|
+
p(this, Se, !0);
|
|
193
|
+
p(this, ae, void 0);
|
|
194
|
+
p(this, Ae, void 0);
|
|
195
|
+
h(this, Ae, (t) => {
|
|
196
|
+
if (!$e && window.addEventListener) {
|
|
197
197
|
const s = () => t(!0), r = () => t(!1);
|
|
198
198
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
199
199
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
@@ -202,192 +202,192 @@ var me, ae, Ae, rs, Bs = (rs = class extends Ge {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
onSubscribe() {
|
|
205
|
-
|
|
205
|
+
n(this, ae) || this.setEventListener(n(this, Ae));
|
|
206
206
|
}
|
|
207
207
|
onUnsubscribe() {
|
|
208
208
|
var t;
|
|
209
|
-
this.hasListeners() || ((t =
|
|
209
|
+
this.hasListeners() || ((t = n(this, ae)) == null || t.call(this), h(this, ae, void 0));
|
|
210
210
|
}
|
|
211
211
|
setEventListener(t) {
|
|
212
212
|
var s;
|
|
213
|
-
h(this,
|
|
213
|
+
h(this, Ae, t), (s = n(this, ae)) == null || s.call(this), h(this, ae, t(this.setOnline.bind(this)));
|
|
214
214
|
}
|
|
215
215
|
setOnline(t) {
|
|
216
|
-
|
|
216
|
+
n(this, Se) !== t && (h(this, Se, t), this.listeners.forEach((r) => {
|
|
217
217
|
r(t);
|
|
218
218
|
}));
|
|
219
219
|
}
|
|
220
220
|
isOnline() {
|
|
221
|
-
return
|
|
221
|
+
return n(this, Se);
|
|
222
222
|
}
|
|
223
|
-
}, Se = new WeakMap(),
|
|
224
|
-
function
|
|
223
|
+
}, Se = new WeakMap(), ae = new WeakMap(), Ae = new WeakMap(), es), dt = new Bs();
|
|
224
|
+
function er(e) {
|
|
225
225
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
return (e ?? "online") === "online" ?
|
|
227
|
+
function vt(e) {
|
|
228
|
+
return (e ?? "online") === "online" ? dt.isOnline() : !0;
|
|
229
229
|
}
|
|
230
|
-
var
|
|
230
|
+
var hs = class {
|
|
231
231
|
constructor(e) {
|
|
232
232
|
this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
function
|
|
236
|
-
return e instanceof
|
|
235
|
+
function Ct(e) {
|
|
236
|
+
return e instanceof hs;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
let t = !1, s = 0, r = !1,
|
|
240
|
-
const c = new Promise((
|
|
241
|
-
o =
|
|
242
|
-
}),
|
|
243
|
-
var
|
|
244
|
-
r || (
|
|
245
|
-
},
|
|
238
|
+
function fs(e) {
|
|
239
|
+
let t = !1, s = 0, r = !1, a, o, l;
|
|
240
|
+
const c = new Promise((y, g) => {
|
|
241
|
+
o = y, l = g;
|
|
242
|
+
}), m = (y) => {
|
|
243
|
+
var g;
|
|
244
|
+
r || (f(new hs(y)), (g = e.abort) == null || g.call(e));
|
|
245
|
+
}, C = () => {
|
|
246
246
|
t = !0;
|
|
247
247
|
}, u = () => {
|
|
248
248
|
t = !1;
|
|
249
|
-
},
|
|
250
|
-
var
|
|
251
|
-
r || (r = !0, (
|
|
252
|
-
},
|
|
253
|
-
var
|
|
254
|
-
r || (r = !0, (
|
|
255
|
-
}, w = () => new Promise((
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
}, (
|
|
249
|
+
}, b = () => !ut.isFocused() || e.networkMode !== "always" && !dt.isOnline(), v = (y) => {
|
|
250
|
+
var g;
|
|
251
|
+
r || (r = !0, (g = e.onSuccess) == null || g.call(e, y), a == null || a(), o(y));
|
|
252
|
+
}, f = (y) => {
|
|
253
|
+
var g;
|
|
254
|
+
r || (r = !0, (g = e.onError) == null || g.call(e, y), a == null || a(), l(y));
|
|
255
|
+
}, w = () => new Promise((y) => {
|
|
256
|
+
var g;
|
|
257
|
+
a = (S) => {
|
|
258
|
+
const _ = r || !b();
|
|
259
|
+
return _ && y(S), _;
|
|
260
|
+
}, (g = e.onPause) == null || g.call(e);
|
|
261
261
|
}).then(() => {
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
}),
|
|
262
|
+
var y;
|
|
263
|
+
a = void 0, r || (y = e.onContinue) == null || y.call(e);
|
|
264
|
+
}), E = () => {
|
|
265
265
|
if (r)
|
|
266
266
|
return;
|
|
267
|
-
let
|
|
267
|
+
let y;
|
|
268
268
|
try {
|
|
269
|
-
|
|
270
|
-
} catch (
|
|
271
|
-
|
|
269
|
+
y = e.fn();
|
|
270
|
+
} catch (g) {
|
|
271
|
+
y = Promise.reject(g);
|
|
272
272
|
}
|
|
273
|
-
Promise.resolve(
|
|
273
|
+
Promise.resolve(y).then(v).catch((g) => {
|
|
274
274
|
var $;
|
|
275
275
|
if (r)
|
|
276
276
|
return;
|
|
277
|
-
const S = e.retry ?? (
|
|
278
|
-
if (t || !
|
|
279
|
-
|
|
277
|
+
const S = e.retry ?? ($e ? 0 : 3), _ = e.retryDelay ?? er, k = typeof _ == "function" ? _(s, g) : _, L = S === !0 || typeof S == "number" && s < S || typeof S == "function" && S(s, g);
|
|
278
|
+
if (t || !L) {
|
|
279
|
+
f(g);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
s++, ($ = e.onFail) == null || $.call(e, s,
|
|
283
|
-
if (
|
|
282
|
+
s++, ($ = e.onFail) == null || $.call(e, s, g), zs(k).then(() => {
|
|
283
|
+
if (b())
|
|
284
284
|
return w();
|
|
285
285
|
}).then(() => {
|
|
286
|
-
t ?
|
|
286
|
+
t ? f(g) : E();
|
|
287
287
|
});
|
|
288
288
|
});
|
|
289
289
|
};
|
|
290
|
-
return
|
|
290
|
+
return vt(e.networkMode) ? E() : w().then(E), {
|
|
291
291
|
promise: c,
|
|
292
|
-
cancel:
|
|
293
|
-
continue: () => (
|
|
294
|
-
cancelRetry:
|
|
292
|
+
cancel: m,
|
|
293
|
+
continue: () => (a == null ? void 0 : a()) ? c : Promise.resolve(),
|
|
294
|
+
cancelRetry: C,
|
|
295
295
|
continueRetry: u
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
let e = [], t = 0, s = (
|
|
300
|
-
|
|
301
|
-
}, r = (
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
const o = (
|
|
305
|
-
|
|
306
|
-
}, l = (
|
|
307
|
-
let
|
|
298
|
+
function tr() {
|
|
299
|
+
let e = [], t = 0, s = (v) => {
|
|
300
|
+
v();
|
|
301
|
+
}, r = (v) => {
|
|
302
|
+
v();
|
|
303
|
+
}, a = (v) => setTimeout(v, 0);
|
|
304
|
+
const o = (v) => {
|
|
305
|
+
a = v;
|
|
306
|
+
}, l = (v) => {
|
|
307
|
+
let f;
|
|
308
308
|
t++;
|
|
309
309
|
try {
|
|
310
|
-
|
|
310
|
+
f = v();
|
|
311
311
|
} finally {
|
|
312
|
-
t--, t ||
|
|
312
|
+
t--, t || C();
|
|
313
313
|
}
|
|
314
|
-
return
|
|
315
|
-
}, c = (
|
|
316
|
-
t ? e.push(
|
|
317
|
-
s(
|
|
314
|
+
return f;
|
|
315
|
+
}, c = (v) => {
|
|
316
|
+
t ? e.push(v) : a(() => {
|
|
317
|
+
s(v);
|
|
318
318
|
});
|
|
319
|
-
},
|
|
319
|
+
}, m = (v) => (...f) => {
|
|
320
320
|
c(() => {
|
|
321
|
-
|
|
321
|
+
v(...f);
|
|
322
322
|
});
|
|
323
|
-
},
|
|
324
|
-
const
|
|
325
|
-
e = [],
|
|
323
|
+
}, C = () => {
|
|
324
|
+
const v = e;
|
|
325
|
+
e = [], v.length && a(() => {
|
|
326
326
|
r(() => {
|
|
327
|
-
|
|
328
|
-
s(
|
|
327
|
+
v.forEach((f) => {
|
|
328
|
+
s(f);
|
|
329
329
|
});
|
|
330
330
|
});
|
|
331
331
|
});
|
|
332
332
|
};
|
|
333
333
|
return {
|
|
334
334
|
batch: l,
|
|
335
|
-
batchCalls:
|
|
335
|
+
batchCalls: m,
|
|
336
336
|
schedule: c,
|
|
337
|
-
setNotifyFunction: (
|
|
338
|
-
s =
|
|
337
|
+
setNotifyFunction: (v) => {
|
|
338
|
+
s = v;
|
|
339
339
|
},
|
|
340
|
-
setBatchNotifyFunction: (
|
|
341
|
-
r =
|
|
340
|
+
setBatchNotifyFunction: (v) => {
|
|
341
|
+
r = v;
|
|
342
342
|
},
|
|
343
343
|
setScheduler: o
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
var
|
|
346
|
+
var R = tr(), me, ts, ps = (ts = class {
|
|
347
347
|
constructor() {
|
|
348
|
-
|
|
348
|
+
p(this, me, void 0);
|
|
349
349
|
}
|
|
350
350
|
destroy() {
|
|
351
351
|
this.clearGcTimeout();
|
|
352
352
|
}
|
|
353
353
|
scheduleGc() {
|
|
354
|
-
this.clearGcTimeout(),
|
|
354
|
+
this.clearGcTimeout(), xt(this.gcTime) && h(this, me, setTimeout(() => {
|
|
355
355
|
this.optionalRemove();
|
|
356
356
|
}, this.gcTime));
|
|
357
357
|
}
|
|
358
358
|
updateGcTime(e) {
|
|
359
359
|
this.gcTime = Math.max(
|
|
360
360
|
this.gcTime || 0,
|
|
361
|
-
e ?? (
|
|
361
|
+
e ?? ($e ? 1 / 0 : 5 * 60 * 1e3)
|
|
362
362
|
);
|
|
363
363
|
}
|
|
364
364
|
clearGcTimeout() {
|
|
365
|
-
|
|
365
|
+
n(this, me) && (clearTimeout(n(this, me)), h(this, me, void 0));
|
|
366
366
|
}
|
|
367
|
-
},
|
|
367
|
+
}, me = new WeakMap(), ts), Pe, Ne, V, oe, q, D, qe, ve, ke, ot, z, te, ss, sr = (ss = class extends ps {
|
|
368
368
|
constructor(t) {
|
|
369
369
|
super();
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
h(this,
|
|
370
|
+
p(this, ke);
|
|
371
|
+
p(this, z);
|
|
372
|
+
p(this, Pe, void 0);
|
|
373
|
+
p(this, Ne, void 0);
|
|
374
|
+
p(this, V, void 0);
|
|
375
|
+
p(this, oe, void 0);
|
|
376
|
+
p(this, q, void 0);
|
|
377
|
+
p(this, D, void 0);
|
|
378
|
+
p(this, qe, void 0);
|
|
379
|
+
p(this, ve, void 0);
|
|
380
|
+
h(this, ve, !1), h(this, qe, t.defaultOptions), x(this, ke, ot).call(this, t.options), h(this, D, []), h(this, V, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, h(this, Pe, t.state || rr(this.options)), this.state = n(this, Pe), this.scheduleGc();
|
|
381
381
|
}
|
|
382
382
|
get meta() {
|
|
383
383
|
return this.options.meta;
|
|
384
384
|
}
|
|
385
385
|
optionalRemove() {
|
|
386
|
-
!
|
|
386
|
+
!n(this, D).length && this.state.fetchStatus === "idle" && n(this, V).remove(this);
|
|
387
387
|
}
|
|
388
388
|
setData(t, s) {
|
|
389
|
-
const r =
|
|
390
|
-
return
|
|
389
|
+
const r = wt(this.state.data, t, this.options);
|
|
390
|
+
return x(this, z, te).call(this, {
|
|
391
391
|
data: r,
|
|
392
392
|
type: "success",
|
|
393
393
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -395,21 +395,21 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
395
395
|
}), r;
|
|
396
396
|
}
|
|
397
397
|
setState(t, s) {
|
|
398
|
-
|
|
398
|
+
x(this, z, te).call(this, { type: "setState", state: t, setStateOptions: s });
|
|
399
399
|
}
|
|
400
400
|
cancel(t) {
|
|
401
401
|
var r;
|
|
402
|
-
const s =
|
|
403
|
-
return (r =
|
|
402
|
+
const s = n(this, oe);
|
|
403
|
+
return (r = n(this, q)) == null || r.cancel(t), s ? s.then(Z).catch(Z) : Promise.resolve();
|
|
404
404
|
}
|
|
405
405
|
destroy() {
|
|
406
406
|
super.destroy(), this.cancel({ silent: !0 });
|
|
407
407
|
}
|
|
408
408
|
reset() {
|
|
409
|
-
this.destroy(), this.setState(
|
|
409
|
+
this.destroy(), this.setState(n(this, Pe));
|
|
410
410
|
}
|
|
411
411
|
isActive() {
|
|
412
|
-
return
|
|
412
|
+
return n(this, D).some(
|
|
413
413
|
(t) => t.options.enabled !== !1
|
|
414
414
|
);
|
|
415
415
|
}
|
|
@@ -417,61 +417,61 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
417
417
|
return this.getObserversCount() > 0 && !this.isActive();
|
|
418
418
|
}
|
|
419
419
|
isStale() {
|
|
420
|
-
return this.state.isInvalidated || !this.state.dataUpdatedAt ||
|
|
420
|
+
return this.state.isInvalidated || !this.state.dataUpdatedAt || n(this, D).some((t) => t.getCurrentResult().isStale);
|
|
421
421
|
}
|
|
422
422
|
isStaleByTime(t = 0) {
|
|
423
|
-
return this.state.isInvalidated || !this.state.dataUpdatedAt || !
|
|
423
|
+
return this.state.isInvalidated || !this.state.dataUpdatedAt || !us(this.state.dataUpdatedAt, t);
|
|
424
424
|
}
|
|
425
425
|
onFocus() {
|
|
426
426
|
var s;
|
|
427
|
-
const t =
|
|
428
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s =
|
|
427
|
+
const t = n(this, D).find((r) => r.shouldFetchOnWindowFocus());
|
|
428
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = n(this, q)) == null || s.continue();
|
|
429
429
|
}
|
|
430
430
|
onOnline() {
|
|
431
431
|
var s;
|
|
432
|
-
const t =
|
|
433
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s =
|
|
432
|
+
const t = n(this, D).find((r) => r.shouldFetchOnReconnect());
|
|
433
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = n(this, q)) == null || s.continue();
|
|
434
434
|
}
|
|
435
435
|
addObserver(t) {
|
|
436
|
-
|
|
436
|
+
n(this, D).includes(t) || (n(this, D).push(t), this.clearGcTimeout(), n(this, V).notify({ type: "observerAdded", query: this, observer: t }));
|
|
437
437
|
}
|
|
438
438
|
removeObserver(t) {
|
|
439
|
-
|
|
439
|
+
n(this, D).includes(t) && (h(this, D, n(this, D).filter((s) => s !== t)), n(this, D).length || (n(this, q) && (n(this, ve) ? n(this, q).cancel({ revert: !0 }) : n(this, q).cancelRetry()), this.scheduleGc()), n(this, V).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
440
440
|
}
|
|
441
441
|
getObserversCount() {
|
|
442
|
-
return
|
|
442
|
+
return n(this, D).length;
|
|
443
443
|
}
|
|
444
444
|
invalidate() {
|
|
445
|
-
this.state.isInvalidated ||
|
|
445
|
+
this.state.isInvalidated || x(this, z, te).call(this, { type: "invalidate" });
|
|
446
446
|
}
|
|
447
447
|
fetch(t, s) {
|
|
448
|
-
var
|
|
448
|
+
var C, u, b, v;
|
|
449
449
|
if (this.state.fetchStatus !== "idle") {
|
|
450
450
|
if (this.state.dataUpdatedAt && (s != null && s.cancelRefetch))
|
|
451
451
|
this.cancel({ silent: !0 });
|
|
452
|
-
else if (
|
|
453
|
-
return (
|
|
452
|
+
else if (n(this, oe))
|
|
453
|
+
return (C = n(this, q)) == null || C.continueRetry(), n(this, oe);
|
|
454
454
|
}
|
|
455
|
-
if (t &&
|
|
456
|
-
const
|
|
457
|
-
|
|
455
|
+
if (t && x(this, ke, ot).call(this, t), !this.options.queryFn) {
|
|
456
|
+
const f = n(this, D).find((w) => w.options.queryFn);
|
|
457
|
+
f && x(this, ke, ot).call(this, f.options);
|
|
458
458
|
}
|
|
459
|
-
const r = new AbortController(),
|
|
459
|
+
const r = new AbortController(), a = {
|
|
460
460
|
queryKey: this.queryKey,
|
|
461
461
|
meta: this.meta
|
|
462
|
-
}, o = (
|
|
463
|
-
Object.defineProperty(
|
|
462
|
+
}, o = (f) => {
|
|
463
|
+
Object.defineProperty(f, "signal", {
|
|
464
464
|
enumerable: !0,
|
|
465
|
-
get: () => (h(this,
|
|
465
|
+
get: () => (h(this, ve, !0), r.signal)
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
|
-
o(
|
|
469
|
-
const l = () => this.options.queryFn ? (h(this,
|
|
468
|
+
o(a);
|
|
469
|
+
const l = () => this.options.queryFn ? (h(this, ve, !1), this.options.persister ? this.options.persister(
|
|
470
470
|
this.options.queryFn,
|
|
471
|
-
|
|
471
|
+
a,
|
|
472
472
|
this
|
|
473
473
|
) : this.options.queryFn(
|
|
474
|
-
|
|
474
|
+
a
|
|
475
475
|
)) : Promise.reject(
|
|
476
476
|
new Error(`Missing queryFn: '${this.options.queryHash}'`)
|
|
477
477
|
), c = {
|
|
@@ -484,57 +484,57 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
484
484
|
o(c), (u = this.options.behavior) == null || u.onFetch(
|
|
485
485
|
c,
|
|
486
486
|
this
|
|
487
|
-
), h(this, Ne, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((
|
|
488
|
-
const
|
|
489
|
-
var w,
|
|
490
|
-
|
|
487
|
+
), h(this, Ne, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((b = c.fetchOptions) == null ? void 0 : b.meta)) && x(this, z, te).call(this, { type: "fetch", meta: (v = c.fetchOptions) == null ? void 0 : v.meta });
|
|
488
|
+
const m = (f) => {
|
|
489
|
+
var w, E, y, g;
|
|
490
|
+
Ct(f) && f.silent || x(this, z, te).call(this, {
|
|
491
491
|
type: "error",
|
|
492
|
-
error:
|
|
493
|
-
}),
|
|
492
|
+
error: f
|
|
493
|
+
}), Ct(f) || ((E = (w = n(this, V).config).onError) == null || E.call(
|
|
494
494
|
w,
|
|
495
|
-
|
|
495
|
+
f,
|
|
496
496
|
this
|
|
497
|
-
), (
|
|
498
|
-
|
|
497
|
+
), (g = (y = n(this, V).config).onSettled) == null || g.call(
|
|
498
|
+
y,
|
|
499
499
|
this.state.data,
|
|
500
|
-
|
|
500
|
+
f,
|
|
501
501
|
this
|
|
502
502
|
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
503
503
|
};
|
|
504
|
-
return h(this,
|
|
504
|
+
return h(this, q, fs({
|
|
505
505
|
fn: c.fetchFn,
|
|
506
506
|
abort: r.abort.bind(r),
|
|
507
|
-
onSuccess: (
|
|
508
|
-
var w,
|
|
509
|
-
if (typeof
|
|
510
|
-
|
|
507
|
+
onSuccess: (f) => {
|
|
508
|
+
var w, E, y, g;
|
|
509
|
+
if (typeof f > "u") {
|
|
510
|
+
m(new Error(`${this.queryHash} data is undefined`));
|
|
511
511
|
return;
|
|
512
512
|
}
|
|
513
|
-
this.setData(
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
this.setData(f), (E = (w = n(this, V).config).onSuccess) == null || E.call(w, f, this), (g = (y = n(this, V).config).onSettled) == null || g.call(
|
|
514
|
+
y,
|
|
515
|
+
f,
|
|
516
516
|
this.state.error,
|
|
517
517
|
this
|
|
518
518
|
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
519
519
|
},
|
|
520
|
-
onError:
|
|
521
|
-
onFail: (
|
|
522
|
-
|
|
520
|
+
onError: m,
|
|
521
|
+
onFail: (f, w) => {
|
|
522
|
+
x(this, z, te).call(this, { type: "failed", failureCount: f, error: w });
|
|
523
523
|
},
|
|
524
524
|
onPause: () => {
|
|
525
|
-
|
|
525
|
+
x(this, z, te).call(this, { type: "pause" });
|
|
526
526
|
},
|
|
527
527
|
onContinue: () => {
|
|
528
|
-
|
|
528
|
+
x(this, z, te).call(this, { type: "continue" });
|
|
529
529
|
},
|
|
530
530
|
retry: c.options.retry,
|
|
531
531
|
retryDelay: c.options.retryDelay,
|
|
532
532
|
networkMode: c.options.networkMode
|
|
533
|
-
})), h(this,
|
|
533
|
+
})), h(this, oe, n(this, q).promise), n(this, oe);
|
|
534
534
|
}
|
|
535
|
-
}, Pe = new WeakMap(), Ne = new WeakMap(),
|
|
536
|
-
this.options = { ...
|
|
537
|
-
},
|
|
535
|
+
}, Pe = new WeakMap(), Ne = new WeakMap(), V = new WeakMap(), oe = new WeakMap(), q = new WeakMap(), D = new WeakMap(), qe = new WeakMap(), ve = new WeakMap(), ke = new WeakSet(), ot = function(t) {
|
|
536
|
+
this.options = { ...n(this, qe), ...t }, this.updateGcTime(this.options.gcTime);
|
|
537
|
+
}, z = new WeakSet(), te = function(t) {
|
|
538
538
|
const s = (r) => {
|
|
539
539
|
switch (t.type) {
|
|
540
540
|
case "failed":
|
|
@@ -559,7 +559,7 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
559
559
|
fetchFailureCount: 0,
|
|
560
560
|
fetchFailureReason: null,
|
|
561
561
|
fetchMeta: t.meta ?? null,
|
|
562
|
-
fetchStatus:
|
|
562
|
+
fetchStatus: vt(this.options.networkMode) ? "fetching" : "paused",
|
|
563
563
|
...!r.dataUpdatedAt && {
|
|
564
564
|
error: null,
|
|
565
565
|
status: "pending"
|
|
@@ -581,14 +581,14 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
583
|
case "error":
|
|
584
|
-
const
|
|
585
|
-
return
|
|
584
|
+
const a = t.error;
|
|
585
|
+
return Ct(a) && a.revert && n(this, Ne) ? { ...n(this, Ne), fetchStatus: "idle" } : {
|
|
586
586
|
...r,
|
|
587
|
-
error:
|
|
587
|
+
error: a,
|
|
588
588
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
589
589
|
errorUpdatedAt: Date.now(),
|
|
590
590
|
fetchFailureCount: r.fetchFailureCount + 1,
|
|
591
|
-
fetchFailureReason:
|
|
591
|
+
fetchFailureReason: a,
|
|
592
592
|
fetchStatus: "idle",
|
|
593
593
|
status: "error"
|
|
594
594
|
};
|
|
@@ -604,13 +604,13 @@ var F = sr(), ve, ns, ys = (ns = class {
|
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
606
|
};
|
|
607
|
-
this.state = s(this.state),
|
|
608
|
-
|
|
607
|
+
this.state = s(this.state), R.batch(() => {
|
|
608
|
+
n(this, D).forEach((r) => {
|
|
609
609
|
r.onQueryUpdate();
|
|
610
|
-
}),
|
|
610
|
+
}), n(this, V).notify({ query: this, type: "updated", action: t });
|
|
611
611
|
});
|
|
612
|
-
},
|
|
613
|
-
function
|
|
612
|
+
}, ss);
|
|
613
|
+
function rr(e) {
|
|
614
614
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = typeof t < "u", r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
615
615
|
return {
|
|
616
616
|
data: t,
|
|
@@ -627,183 +627,183 @@ function ir(e) {
|
|
|
627
627
|
fetchStatus: "idle"
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
|
-
var
|
|
630
|
+
var J, rs, ir = (rs = class extends Ke {
|
|
631
631
|
constructor(t = {}) {
|
|
632
632
|
super();
|
|
633
|
-
|
|
634
|
-
this.config = t, h(this,
|
|
633
|
+
p(this, J, void 0);
|
|
634
|
+
this.config = t, h(this, J, /* @__PURE__ */ new Map());
|
|
635
635
|
}
|
|
636
636
|
build(t, s, r) {
|
|
637
|
-
const
|
|
637
|
+
const a = s.queryKey, o = s.queryHash ?? Ft(a, s);
|
|
638
638
|
let l = this.get(o);
|
|
639
|
-
return l || (l = new
|
|
639
|
+
return l || (l = new sr({
|
|
640
640
|
cache: this,
|
|
641
|
-
queryKey:
|
|
641
|
+
queryKey: a,
|
|
642
642
|
queryHash: o,
|
|
643
643
|
options: t.defaultQueryOptions(s),
|
|
644
644
|
state: r,
|
|
645
|
-
defaultOptions: t.getQueryDefaults(
|
|
645
|
+
defaultOptions: t.getQueryDefaults(a)
|
|
646
646
|
}), this.add(l)), l;
|
|
647
647
|
}
|
|
648
648
|
add(t) {
|
|
649
|
-
|
|
649
|
+
n(this, J).has(t.queryHash) || (n(this, J).set(t.queryHash, t), this.notify({
|
|
650
650
|
type: "added",
|
|
651
651
|
query: t
|
|
652
652
|
}));
|
|
653
653
|
}
|
|
654
654
|
remove(t) {
|
|
655
|
-
const s =
|
|
656
|
-
s && (t.destroy(), s === t &&
|
|
655
|
+
const s = n(this, J).get(t.queryHash);
|
|
656
|
+
s && (t.destroy(), s === t && n(this, J).delete(t.queryHash), this.notify({ type: "removed", query: t }));
|
|
657
657
|
}
|
|
658
658
|
clear() {
|
|
659
|
-
|
|
659
|
+
R.batch(() => {
|
|
660
660
|
this.getAll().forEach((t) => {
|
|
661
661
|
this.remove(t);
|
|
662
662
|
});
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
665
|
get(t) {
|
|
666
|
-
return
|
|
666
|
+
return n(this, J).get(t);
|
|
667
667
|
}
|
|
668
668
|
getAll() {
|
|
669
|
-
return [...
|
|
669
|
+
return [...n(this, J).values()];
|
|
670
670
|
}
|
|
671
671
|
find(t) {
|
|
672
672
|
const s = { exact: !0, ...t };
|
|
673
673
|
return this.getAll().find(
|
|
674
|
-
(r) =>
|
|
674
|
+
(r) => Ht(s, r)
|
|
675
675
|
);
|
|
676
676
|
}
|
|
677
677
|
findAll(t = {}) {
|
|
678
678
|
const s = this.getAll();
|
|
679
|
-
return Object.keys(t).length > 0 ? s.filter((r) =>
|
|
679
|
+
return Object.keys(t).length > 0 ? s.filter((r) => Ht(t, r)) : s;
|
|
680
680
|
}
|
|
681
681
|
notify(t) {
|
|
682
|
-
|
|
682
|
+
R.batch(() => {
|
|
683
683
|
this.listeners.forEach((s) => {
|
|
684
684
|
s(t);
|
|
685
685
|
});
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
onFocus() {
|
|
689
|
-
|
|
689
|
+
R.batch(() => {
|
|
690
690
|
this.getAll().forEach((t) => {
|
|
691
691
|
t.onFocus();
|
|
692
692
|
});
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
695
|
onOnline() {
|
|
696
|
-
|
|
696
|
+
R.batch(() => {
|
|
697
697
|
this.getAll().forEach((t) => {
|
|
698
698
|
t.onOnline();
|
|
699
699
|
});
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
|
-
},
|
|
702
|
+
}, J = new WeakMap(), rs), X, We, K, Me, I, ie, is, nr = (is = class extends ps {
|
|
703
703
|
constructor(t) {
|
|
704
704
|
super();
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
this.mutationId = t.mutationId, h(this,
|
|
705
|
+
p(this, I);
|
|
706
|
+
p(this, X, void 0);
|
|
707
|
+
p(this, We, void 0);
|
|
708
|
+
p(this, K, void 0);
|
|
709
|
+
p(this, Me, void 0);
|
|
710
|
+
this.mutationId = t.mutationId, h(this, We, t.defaultOptions), h(this, K, t.mutationCache), h(this, X, []), this.state = t.state || ms(), this.setOptions(t.options), this.scheduleGc();
|
|
711
711
|
}
|
|
712
712
|
setOptions(t) {
|
|
713
|
-
this.options = { ...
|
|
713
|
+
this.options = { ...n(this, We), ...t }, this.updateGcTime(this.options.gcTime);
|
|
714
714
|
}
|
|
715
715
|
get meta() {
|
|
716
716
|
return this.options.meta;
|
|
717
717
|
}
|
|
718
718
|
addObserver(t) {
|
|
719
|
-
|
|
719
|
+
n(this, X).includes(t) || (n(this, X).push(t), this.clearGcTimeout(), n(this, K).notify({
|
|
720
720
|
type: "observerAdded",
|
|
721
721
|
mutation: this,
|
|
722
722
|
observer: t
|
|
723
723
|
}));
|
|
724
724
|
}
|
|
725
725
|
removeObserver(t) {
|
|
726
|
-
h(this,
|
|
726
|
+
h(this, X, n(this, X).filter((s) => s !== t)), this.scheduleGc(), n(this, K).notify({
|
|
727
727
|
type: "observerRemoved",
|
|
728
728
|
mutation: this,
|
|
729
729
|
observer: t
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
732
|
optionalRemove() {
|
|
733
|
-
|
|
733
|
+
n(this, X).length || (this.state.status === "pending" ? this.scheduleGc() : n(this, K).remove(this));
|
|
734
734
|
}
|
|
735
735
|
continue() {
|
|
736
736
|
var t;
|
|
737
|
-
return ((t =
|
|
737
|
+
return ((t = n(this, Me)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
738
738
|
this.execute(this.state.variables);
|
|
739
739
|
}
|
|
740
740
|
async execute(t) {
|
|
741
|
-
var
|
|
742
|
-
const s = () => (h(this,
|
|
741
|
+
var a, o, l, c, m, C, u, b, v, f, w, E, y, g, S, _, k, L, $, T;
|
|
742
|
+
const s = () => (h(this, Me, fs({
|
|
743
743
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
744
|
-
onFail: (M,
|
|
745
|
-
|
|
744
|
+
onFail: (M, ee) => {
|
|
745
|
+
x(this, I, ie).call(this, { type: "failed", failureCount: M, error: ee });
|
|
746
746
|
},
|
|
747
747
|
onPause: () => {
|
|
748
|
-
|
|
748
|
+
x(this, I, ie).call(this, { type: "pause" });
|
|
749
749
|
},
|
|
750
750
|
onContinue: () => {
|
|
751
|
-
|
|
751
|
+
x(this, I, ie).call(this, { type: "continue" });
|
|
752
752
|
},
|
|
753
753
|
retry: this.options.retry ?? 0,
|
|
754
754
|
retryDelay: this.options.retryDelay,
|
|
755
755
|
networkMode: this.options.networkMode
|
|
756
|
-
})),
|
|
756
|
+
})), n(this, Me).promise), r = this.state.status === "pending";
|
|
757
757
|
try {
|
|
758
758
|
if (!r) {
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
x(this, I, ie).call(this, { type: "pending", variables: t }), await ((o = (a = n(this, K).config).onMutate) == null ? void 0 : o.call(
|
|
760
|
+
a,
|
|
761
761
|
t,
|
|
762
762
|
this
|
|
763
763
|
));
|
|
764
|
-
const
|
|
765
|
-
|
|
764
|
+
const ee = await ((c = (l = this.options).onMutate) == null ? void 0 : c.call(l, t));
|
|
765
|
+
ee !== this.state.context && x(this, I, ie).call(this, {
|
|
766
766
|
type: "pending",
|
|
767
|
-
context:
|
|
767
|
+
context: ee,
|
|
768
768
|
variables: t
|
|
769
769
|
});
|
|
770
770
|
}
|
|
771
771
|
const M = await s();
|
|
772
|
-
return await ((
|
|
773
|
-
|
|
772
|
+
return await ((C = (m = n(this, K).config).onSuccess) == null ? void 0 : C.call(
|
|
773
|
+
m,
|
|
774
774
|
M,
|
|
775
775
|
t,
|
|
776
776
|
this.state.context,
|
|
777
777
|
this
|
|
778
|
-
)), await ((
|
|
779
|
-
|
|
778
|
+
)), await ((b = (u = this.options).onSuccess) == null ? void 0 : b.call(u, M, t, this.state.context)), await ((f = (v = n(this, K).config).onSettled) == null ? void 0 : f.call(
|
|
779
|
+
v,
|
|
780
780
|
M,
|
|
781
781
|
null,
|
|
782
782
|
this.state.variables,
|
|
783
783
|
this.state.context,
|
|
784
784
|
this
|
|
785
|
-
)), await ((
|
|
785
|
+
)), await ((E = (w = this.options).onSettled) == null ? void 0 : E.call(w, M, null, t, this.state.context)), x(this, I, ie).call(this, { type: "success", data: M }), M;
|
|
786
786
|
} catch (M) {
|
|
787
787
|
try {
|
|
788
|
-
throw await ((
|
|
789
|
-
|
|
788
|
+
throw await ((g = (y = n(this, K).config).onError) == null ? void 0 : g.call(
|
|
789
|
+
y,
|
|
790
790
|
M,
|
|
791
791
|
t,
|
|
792
792
|
this.state.context,
|
|
793
793
|
this
|
|
794
|
-
)), await ((
|
|
794
|
+
)), await ((_ = (S = this.options).onError) == null ? void 0 : _.call(
|
|
795
795
|
S,
|
|
796
796
|
M,
|
|
797
797
|
t,
|
|
798
798
|
this.state.context
|
|
799
|
-
)), await ((
|
|
799
|
+
)), await ((L = (k = n(this, K).config).onSettled) == null ? void 0 : L.call(
|
|
800
800
|
k,
|
|
801
801
|
void 0,
|
|
802
802
|
M,
|
|
803
803
|
this.state.variables,
|
|
804
804
|
this.state.context,
|
|
805
805
|
this
|
|
806
|
-
)), await ((
|
|
806
|
+
)), await ((T = ($ = this.options).onSettled) == null ? void 0 : T.call(
|
|
807
807
|
$,
|
|
808
808
|
void 0,
|
|
809
809
|
M,
|
|
@@ -811,11 +811,11 @@ var X, os, nr = (os = class extends Ge {
|
|
|
811
811
|
this.state.context
|
|
812
812
|
)), M;
|
|
813
813
|
} finally {
|
|
814
|
-
|
|
814
|
+
x(this, I, ie).call(this, { type: "error", error: M });
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
},
|
|
818
|
+
}, X = new WeakMap(), We = new WeakMap(), K = new WeakMap(), Me = new WeakMap(), I = new WeakSet(), ie = function(t) {
|
|
819
819
|
const s = (r) => {
|
|
820
820
|
switch (t.type) {
|
|
821
821
|
case "failed":
|
|
@@ -842,7 +842,7 @@ var X, os, nr = (os = class extends Ge {
|
|
|
842
842
|
failureCount: 0,
|
|
843
843
|
failureReason: null,
|
|
844
844
|
error: null,
|
|
845
|
-
isPaused: !
|
|
845
|
+
isPaused: !vt(this.options.networkMode),
|
|
846
846
|
status: "pending",
|
|
847
847
|
variables: t.variables,
|
|
848
848
|
submittedAt: Date.now()
|
|
@@ -869,17 +869,17 @@ var X, os, nr = (os = class extends Ge {
|
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
|
-
this.state = s(this.state),
|
|
873
|
-
|
|
872
|
+
this.state = s(this.state), R.batch(() => {
|
|
873
|
+
n(this, X).forEach((r) => {
|
|
874
874
|
r.onMutationUpdate(t);
|
|
875
|
-
}),
|
|
875
|
+
}), n(this, K).notify({
|
|
876
876
|
mutation: this,
|
|
877
877
|
type: "updated",
|
|
878
878
|
action: t
|
|
879
879
|
});
|
|
880
880
|
});
|
|
881
|
-
},
|
|
882
|
-
function
|
|
881
|
+
}, is);
|
|
882
|
+
function ms() {
|
|
883
883
|
return {
|
|
884
884
|
context: void 0,
|
|
885
885
|
data: void 0,
|
|
@@ -892,61 +892,61 @@ function Cs() {
|
|
|
892
892
|
submittedAt: 0
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
|
-
var W,
|
|
895
|
+
var W, Ze, ye, ns, ar = (ns = class extends Ke {
|
|
896
896
|
constructor(t = {}) {
|
|
897
897
|
super();
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.config = t, h(this, W, []), h(this,
|
|
898
|
+
p(this, W, void 0);
|
|
899
|
+
p(this, Ze, void 0);
|
|
900
|
+
p(this, ye, void 0);
|
|
901
|
+
this.config = t, h(this, W, []), h(this, Ze, 0);
|
|
902
902
|
}
|
|
903
903
|
build(t, s, r) {
|
|
904
|
-
const
|
|
904
|
+
const a = new nr({
|
|
905
905
|
mutationCache: this,
|
|
906
|
-
mutationId: ++
|
|
906
|
+
mutationId: ++at(this, Ze)._,
|
|
907
907
|
options: t.defaultMutationOptions(s),
|
|
908
908
|
state: r
|
|
909
909
|
});
|
|
910
|
-
return this.add(
|
|
910
|
+
return this.add(a), a;
|
|
911
911
|
}
|
|
912
912
|
add(t) {
|
|
913
|
-
|
|
913
|
+
n(this, W).push(t), this.notify({ type: "added", mutation: t });
|
|
914
914
|
}
|
|
915
915
|
remove(t) {
|
|
916
|
-
h(this, W,
|
|
916
|
+
h(this, W, n(this, W).filter((s) => s !== t)), this.notify({ type: "removed", mutation: t });
|
|
917
917
|
}
|
|
918
918
|
clear() {
|
|
919
|
-
|
|
920
|
-
|
|
919
|
+
R.batch(() => {
|
|
920
|
+
n(this, W).forEach((t) => {
|
|
921
921
|
this.remove(t);
|
|
922
922
|
});
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
925
|
getAll() {
|
|
926
|
-
return
|
|
926
|
+
return n(this, W);
|
|
927
927
|
}
|
|
928
928
|
find(t) {
|
|
929
929
|
const s = { exact: !0, ...t };
|
|
930
|
-
return
|
|
931
|
-
(r) =>
|
|
930
|
+
return n(this, W).find(
|
|
931
|
+
(r) => $t(s, r)
|
|
932
932
|
);
|
|
933
933
|
}
|
|
934
934
|
findAll(t = {}) {
|
|
935
|
-
return
|
|
936
|
-
(s) =>
|
|
935
|
+
return n(this, W).filter(
|
|
936
|
+
(s) => $t(t, s)
|
|
937
937
|
);
|
|
938
938
|
}
|
|
939
939
|
notify(t) {
|
|
940
|
-
|
|
940
|
+
R.batch(() => {
|
|
941
941
|
this.listeners.forEach((s) => {
|
|
942
942
|
s(t);
|
|
943
943
|
});
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
946
|
resumePausedMutations() {
|
|
947
|
-
return h(this, ye, (
|
|
948
|
-
const t =
|
|
949
|
-
return
|
|
947
|
+
return h(this, ye, (n(this, ye) ?? Promise.resolve()).then(() => {
|
|
948
|
+
const t = n(this, W).filter((s) => s.state.isPaused);
|
|
949
|
+
return R.batch(
|
|
950
950
|
() => t.reduce(
|
|
951
951
|
(s, r) => s.then(() => r.continue().catch(Z)),
|
|
952
952
|
Promise.resolve()
|
|
@@ -954,69 +954,69 @@ var W, Ye, ye, cs, or = (cs = class extends Ge {
|
|
|
954
954
|
);
|
|
955
955
|
}).then(() => {
|
|
956
956
|
h(this, ye, void 0);
|
|
957
|
-
})),
|
|
957
|
+
})), n(this, ye);
|
|
958
958
|
}
|
|
959
|
-
}, W = new WeakMap(),
|
|
960
|
-
function
|
|
959
|
+
}, W = new WeakMap(), Ze = new WeakMap(), ye = new WeakMap(), ns);
|
|
960
|
+
function or(e) {
|
|
961
961
|
return {
|
|
962
962
|
onFetch: (t, s) => {
|
|
963
963
|
const r = async () => {
|
|
964
|
-
var w,
|
|
965
|
-
const
|
|
966
|
-
let
|
|
967
|
-
const u = (
|
|
968
|
-
Object.defineProperty(
|
|
964
|
+
var w, E, y, g, S;
|
|
965
|
+
const a = t.options, o = (y = (E = (w = t.fetchOptions) == null ? void 0 : w.meta) == null ? void 0 : E.fetchMore) == null ? void 0 : y.direction, l = ((g = t.state.data) == null ? void 0 : g.pages) || [], c = ((S = t.state.data) == null ? void 0 : S.pageParams) || [], m = { pages: [], pageParams: [] };
|
|
966
|
+
let C = !1;
|
|
967
|
+
const u = (_) => {
|
|
968
|
+
Object.defineProperty(_, "signal", {
|
|
969
969
|
enumerable: !0,
|
|
970
|
-
get: () => (t.signal.aborted ?
|
|
971
|
-
|
|
970
|
+
get: () => (t.signal.aborted ? C = !0 : t.signal.addEventListener("abort", () => {
|
|
971
|
+
C = !0;
|
|
972
972
|
}), t.signal)
|
|
973
973
|
});
|
|
974
|
-
},
|
|
974
|
+
}, b = t.options.queryFn || (() => Promise.reject(
|
|
975
975
|
new Error(`Missing queryFn: '${t.options.queryHash}'`)
|
|
976
|
-
)),
|
|
977
|
-
if (
|
|
976
|
+
)), v = async (_, k, L) => {
|
|
977
|
+
if (C)
|
|
978
978
|
return Promise.reject();
|
|
979
|
-
if (k == null &&
|
|
980
|
-
return Promise.resolve(
|
|
979
|
+
if (k == null && _.pages.length)
|
|
980
|
+
return Promise.resolve(_);
|
|
981
981
|
const $ = {
|
|
982
982
|
queryKey: t.queryKey,
|
|
983
983
|
pageParam: k,
|
|
984
|
-
direction:
|
|
984
|
+
direction: L ? "backward" : "forward",
|
|
985
985
|
meta: t.options.meta
|
|
986
986
|
};
|
|
987
987
|
u($);
|
|
988
|
-
const
|
|
988
|
+
const T = await b(
|
|
989
989
|
$
|
|
990
|
-
), { maxPages: M } = t.options,
|
|
990
|
+
), { maxPages: M } = t.options, ee = L ? Xs : Js;
|
|
991
991
|
return {
|
|
992
|
-
pages:
|
|
993
|
-
pageParams:
|
|
992
|
+
pages: ee(_.pages, T, M),
|
|
993
|
+
pageParams: ee(_.pageParams, k, M)
|
|
994
994
|
};
|
|
995
995
|
};
|
|
996
|
-
let
|
|
996
|
+
let f;
|
|
997
997
|
if (o && l.length) {
|
|
998
|
-
const
|
|
998
|
+
const _ = o === "backward", k = _ ? lr : Vt, L = {
|
|
999
999
|
pages: l,
|
|
1000
1000
|
pageParams: c
|
|
1001
|
-
}, $ = k(
|
|
1002
|
-
|
|
1001
|
+
}, $ = k(a, L);
|
|
1002
|
+
f = await v(L, $, _);
|
|
1003
1003
|
} else {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
c[0] ??
|
|
1004
|
+
f = await v(
|
|
1005
|
+
m,
|
|
1006
|
+
c[0] ?? a.initialPageParam
|
|
1007
1007
|
);
|
|
1008
|
-
const
|
|
1009
|
-
for (let k = 1; k <
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1008
|
+
const _ = e ?? l.length;
|
|
1009
|
+
for (let k = 1; k < _; k++) {
|
|
1010
|
+
const L = Vt(a, f);
|
|
1011
|
+
f = await v(f, L);
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
return
|
|
1014
|
+
return f;
|
|
1015
1015
|
};
|
|
1016
1016
|
t.options.persister ? t.fetchFn = () => {
|
|
1017
|
-
var
|
|
1018
|
-
return (o = (
|
|
1019
|
-
|
|
1017
|
+
var a, o;
|
|
1018
|
+
return (o = (a = t.options).persister) == null ? void 0 : o.call(
|
|
1019
|
+
a,
|
|
1020
1020
|
r,
|
|
1021
1021
|
{
|
|
1022
1022
|
queryKey: t.queryKey,
|
|
@@ -1029,7 +1029,7 @@ function lr(e) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Vt(e, { pages: t, pageParams: s }) {
|
|
1033
1033
|
const r = t.length - 1;
|
|
1034
1034
|
return e.getNextPageParam(
|
|
1035
1035
|
t[r],
|
|
@@ -1038,7 +1038,7 @@ function Yt(e, { pages: t, pageParams: s }) {
|
|
|
1038
1038
|
s
|
|
1039
1039
|
);
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function lr(e, { pages: t, pageParams: s }) {
|
|
1042
1042
|
var r;
|
|
1043
1043
|
return (r = e.getPreviousPageParam) == null ? void 0 : r.call(
|
|
1044
1044
|
e,
|
|
@@ -1048,38 +1048,38 @@ function cr(e, { pages: t, pageParams: s }) {
|
|
|
1048
1048
|
s
|
|
1049
1049
|
);
|
|
1050
1050
|
}
|
|
1051
|
-
var
|
|
1051
|
+
var F, le, ce, Oe, Le, ue, Fe, Re, as, vs = (as = class {
|
|
1052
1052
|
constructor(e = {}) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
h(this,
|
|
1053
|
+
p(this, F, void 0);
|
|
1054
|
+
p(this, le, void 0);
|
|
1055
|
+
p(this, ce, void 0);
|
|
1056
|
+
p(this, Oe, void 0);
|
|
1057
|
+
p(this, Le, void 0);
|
|
1058
|
+
p(this, ue, void 0);
|
|
1059
|
+
p(this, Fe, void 0);
|
|
1060
|
+
p(this, Re, void 0);
|
|
1061
|
+
h(this, F, e.queryCache || new ir()), h(this, le, e.mutationCache || new ar()), h(this, ce, e.defaultOptions || {}), h(this, Oe, /* @__PURE__ */ new Map()), h(this, Le, /* @__PURE__ */ new Map()), h(this, ue, 0);
|
|
1062
1062
|
}
|
|
1063
1063
|
mount() {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
})), h(this,
|
|
1067
|
-
|
|
1064
|
+
at(this, ue)._++, n(this, ue) === 1 && (h(this, Fe, ut.subscribe(() => {
|
|
1065
|
+
ut.isFocused() && (this.resumePausedMutations(), n(this, F).onFocus());
|
|
1066
|
+
})), h(this, Re, dt.subscribe(() => {
|
|
1067
|
+
dt.isOnline() && (this.resumePausedMutations(), n(this, F).onOnline());
|
|
1068
1068
|
})));
|
|
1069
1069
|
}
|
|
1070
1070
|
unmount() {
|
|
1071
1071
|
var e, t;
|
|
1072
|
-
|
|
1072
|
+
at(this, ue)._--, n(this, ue) === 0 && ((e = n(this, Fe)) == null || e.call(this), h(this, Fe, void 0), (t = n(this, Re)) == null || t.call(this), h(this, Re, void 0));
|
|
1073
1073
|
}
|
|
1074
1074
|
isFetching(e) {
|
|
1075
|
-
return
|
|
1075
|
+
return n(this, F).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
1076
1076
|
}
|
|
1077
1077
|
isMutating(e) {
|
|
1078
|
-
return
|
|
1078
|
+
return n(this, le).findAll({ ...e, status: "pending" }).length;
|
|
1079
1079
|
}
|
|
1080
1080
|
getQueryData(e) {
|
|
1081
1081
|
var t;
|
|
1082
|
-
return (t =
|
|
1082
|
+
return (t = n(this, F).find({ queryKey: e })) == null ? void 0 : t.state.data;
|
|
1083
1083
|
}
|
|
1084
1084
|
ensureQueryData(e) {
|
|
1085
1085
|
const t = this.getQueryData(e.queryKey);
|
|
@@ -1092,14 +1092,14 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
1094
|
setQueryData(e, t, s) {
|
|
1095
|
-
const r =
|
|
1095
|
+
const r = n(this, F).find({ queryKey: e }), a = r == null ? void 0 : r.state.data, o = Ys(t, a);
|
|
1096
1096
|
if (typeof o > "u")
|
|
1097
1097
|
return;
|
|
1098
1098
|
const l = this.defaultQueryOptions({ queryKey: e });
|
|
1099
|
-
return
|
|
1099
|
+
return n(this, F).build(this, l).setData(o, { ...s, manual: !0 });
|
|
1100
1100
|
}
|
|
1101
1101
|
setQueriesData(e, t, s) {
|
|
1102
|
-
return
|
|
1102
|
+
return R.batch(
|
|
1103
1103
|
() => this.getQueryCache().findAll(e).map(({ queryKey: r }) => [
|
|
1104
1104
|
r,
|
|
1105
1105
|
this.setQueryData(r, t, s)
|
|
@@ -1108,34 +1108,34 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
getQueryState(e) {
|
|
1110
1110
|
var t;
|
|
1111
|
-
return (t =
|
|
1111
|
+
return (t = n(this, F).find({ queryKey: e })) == null ? void 0 : t.state;
|
|
1112
1112
|
}
|
|
1113
1113
|
removeQueries(e) {
|
|
1114
|
-
const t =
|
|
1115
|
-
|
|
1114
|
+
const t = n(this, F);
|
|
1115
|
+
R.batch(() => {
|
|
1116
1116
|
t.findAll(e).forEach((s) => {
|
|
1117
1117
|
t.remove(s);
|
|
1118
1118
|
});
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
resetQueries(e, t) {
|
|
1122
|
-
const s =
|
|
1122
|
+
const s = n(this, F), r = {
|
|
1123
1123
|
type: "active",
|
|
1124
1124
|
...e
|
|
1125
1125
|
};
|
|
1126
|
-
return
|
|
1127
|
-
|
|
1126
|
+
return R.batch(() => (s.findAll(e).forEach((a) => {
|
|
1127
|
+
a.reset();
|
|
1128
1128
|
}), this.refetchQueries(r, t)));
|
|
1129
1129
|
}
|
|
1130
1130
|
cancelQueries(e = {}, t = {}) {
|
|
1131
|
-
const s = { revert: !0, ...t }, r =
|
|
1132
|
-
() =>
|
|
1131
|
+
const s = { revert: !0, ...t }, r = R.batch(
|
|
1132
|
+
() => n(this, F).findAll(e).map((a) => a.cancel(s))
|
|
1133
1133
|
);
|
|
1134
1134
|
return Promise.all(r).then(Z).catch(Z);
|
|
1135
1135
|
}
|
|
1136
1136
|
invalidateQueries(e = {}, t = {}) {
|
|
1137
|
-
return
|
|
1138
|
-
if (
|
|
1137
|
+
return R.batch(() => {
|
|
1138
|
+
if (n(this, F).findAll(e).forEach((r) => {
|
|
1139
1139
|
r.invalidate();
|
|
1140
1140
|
}), e.refetchType === "none")
|
|
1141
1141
|
return Promise.resolve();
|
|
@@ -1150,10 +1150,10 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1150
1150
|
const s = {
|
|
1151
1151
|
...t,
|
|
1152
1152
|
cancelRefetch: (t == null ? void 0 : t.cancelRefetch) ?? !0
|
|
1153
|
-
}, r =
|
|
1154
|
-
() =>
|
|
1155
|
-
let o =
|
|
1156
|
-
return s.throwOnError || (o = o.catch(Z)),
|
|
1153
|
+
}, r = R.batch(
|
|
1154
|
+
() => n(this, F).findAll(e).filter((a) => !a.isDisabled()).map((a) => {
|
|
1155
|
+
let o = a.fetch(void 0, s);
|
|
1156
|
+
return s.throwOnError || (o = o.catch(Z)), a.state.fetchStatus === "paused" ? Promise.resolve() : o;
|
|
1157
1157
|
})
|
|
1158
1158
|
);
|
|
1159
1159
|
return Promise.all(r).then(Z);
|
|
@@ -1161,165 +1161,165 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1161
1161
|
fetchQuery(e) {
|
|
1162
1162
|
const t = this.defaultQueryOptions(e);
|
|
1163
1163
|
typeof t.retry > "u" && (t.retry = !1);
|
|
1164
|
-
const s =
|
|
1164
|
+
const s = n(this, F).build(this, t);
|
|
1165
1165
|
return s.isStaleByTime(t.staleTime) ? s.fetch(t) : Promise.resolve(s.state.data);
|
|
1166
1166
|
}
|
|
1167
1167
|
prefetchQuery(e) {
|
|
1168
1168
|
return this.fetchQuery(e).then(Z).catch(Z);
|
|
1169
1169
|
}
|
|
1170
1170
|
fetchInfiniteQuery(e) {
|
|
1171
|
-
return e.behavior =
|
|
1171
|
+
return e.behavior = or(e.pages), this.fetchQuery(e);
|
|
1172
1172
|
}
|
|
1173
1173
|
prefetchInfiniteQuery(e) {
|
|
1174
1174
|
return this.fetchInfiniteQuery(e).then(Z).catch(Z);
|
|
1175
1175
|
}
|
|
1176
1176
|
resumePausedMutations() {
|
|
1177
|
-
return
|
|
1177
|
+
return n(this, le).resumePausedMutations();
|
|
1178
1178
|
}
|
|
1179
1179
|
getQueryCache() {
|
|
1180
|
-
return
|
|
1180
|
+
return n(this, F);
|
|
1181
1181
|
}
|
|
1182
1182
|
getMutationCache() {
|
|
1183
|
-
return
|
|
1183
|
+
return n(this, le);
|
|
1184
1184
|
}
|
|
1185
1185
|
getDefaultOptions() {
|
|
1186
|
-
return
|
|
1186
|
+
return n(this, ce);
|
|
1187
1187
|
}
|
|
1188
1188
|
setDefaultOptions(e) {
|
|
1189
|
-
h(this,
|
|
1189
|
+
h(this, ce, e);
|
|
1190
1190
|
}
|
|
1191
1191
|
setQueryDefaults(e, t) {
|
|
1192
|
-
|
|
1192
|
+
n(this, Oe).set(we(e), {
|
|
1193
1193
|
queryKey: e,
|
|
1194
1194
|
defaultOptions: t
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
getQueryDefaults(e) {
|
|
1198
|
-
const t = [...
|
|
1198
|
+
const t = [...n(this, Oe).values()];
|
|
1199
1199
|
let s = {};
|
|
1200
1200
|
return t.forEach((r) => {
|
|
1201
|
-
|
|
1201
|
+
Ve(e, r.queryKey) && (s = { ...s, ...r.defaultOptions });
|
|
1202
1202
|
}), s;
|
|
1203
1203
|
}
|
|
1204
1204
|
setMutationDefaults(e, t) {
|
|
1205
|
-
|
|
1205
|
+
n(this, Le).set(we(e), {
|
|
1206
1206
|
mutationKey: e,
|
|
1207
1207
|
defaultOptions: t
|
|
1208
1208
|
});
|
|
1209
1209
|
}
|
|
1210
1210
|
getMutationDefaults(e) {
|
|
1211
|
-
const t = [...
|
|
1211
|
+
const t = [...n(this, Le).values()];
|
|
1212
1212
|
let s = {};
|
|
1213
1213
|
return t.forEach((r) => {
|
|
1214
|
-
|
|
1214
|
+
Ve(e, r.mutationKey) && (s = { ...s, ...r.defaultOptions });
|
|
1215
1215
|
}), s;
|
|
1216
1216
|
}
|
|
1217
1217
|
defaultQueryOptions(e) {
|
|
1218
1218
|
if (e != null && e._defaulted)
|
|
1219
1219
|
return e;
|
|
1220
1220
|
const t = {
|
|
1221
|
-
...
|
|
1221
|
+
...n(this, ce).queries,
|
|
1222
1222
|
...(e == null ? void 0 : e.queryKey) && this.getQueryDefaults(e.queryKey),
|
|
1223
1223
|
...e,
|
|
1224
1224
|
_defaulted: !0
|
|
1225
1225
|
};
|
|
1226
|
-
return t.queryHash || (t.queryHash =
|
|
1226
|
+
return t.queryHash || (t.queryHash = Ft(
|
|
1227
1227
|
t.queryKey,
|
|
1228
1228
|
t
|
|
1229
1229
|
)), typeof t.refetchOnReconnect > "u" && (t.refetchOnReconnect = t.networkMode !== "always"), typeof t.throwOnError > "u" && (t.throwOnError = !!t.suspense), typeof t.networkMode > "u" && t.persister && (t.networkMode = "offlineFirst"), t;
|
|
1230
1230
|
}
|
|
1231
1231
|
defaultMutationOptions(e) {
|
|
1232
1232
|
return e != null && e._defaulted ? e : {
|
|
1233
|
-
...
|
|
1233
|
+
...n(this, ce).mutations,
|
|
1234
1234
|
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
|
|
1235
1235
|
...e,
|
|
1236
1236
|
_defaulted: !0
|
|
1237
1237
|
};
|
|
1238
1238
|
}
|
|
1239
1239
|
clear() {
|
|
1240
|
-
|
|
1240
|
+
n(this, F).clear(), n(this, le).clear();
|
|
1241
1241
|
}
|
|
1242
|
-
},
|
|
1242
|
+
}, F = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), Oe = new WeakMap(), Le = new WeakMap(), ue = new WeakMap(), Fe = new WeakMap(), Re = new WeakMap(), as), Q, N, Ye, U, ge, De, B, ze, Te, Ue, Ce, xe, de, Qe, be, Ge, Je, jt, Xe, _t, Ie, Et, Be, St, et, At, tt, Pt, st, Nt, mt, ys, os, cr = (os = class extends Ke {
|
|
1243
1243
|
constructor(t, s) {
|
|
1244
1244
|
super();
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1245
|
+
p(this, be);
|
|
1246
|
+
p(this, Je);
|
|
1247
|
+
p(this, Xe);
|
|
1248
|
+
p(this, Ie);
|
|
1249
|
+
p(this, Be);
|
|
1250
|
+
p(this, et);
|
|
1251
|
+
p(this, tt);
|
|
1252
|
+
p(this, st);
|
|
1253
|
+
p(this, mt);
|
|
1254
|
+
p(this, Q, void 0);
|
|
1255
|
+
p(this, N, void 0);
|
|
1256
|
+
p(this, Ye, void 0);
|
|
1257
|
+
p(this, U, void 0);
|
|
1258
|
+
p(this, ge, void 0);
|
|
1259
|
+
p(this, De, void 0);
|
|
1260
|
+
p(this, B, void 0);
|
|
1261
|
+
p(this, ze, void 0);
|
|
1262
|
+
p(this, Te, void 0);
|
|
1263
1263
|
// This property keeps track of the last query with defined data.
|
|
1264
1264
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
this.options = s, h(this, Q, t), h(this,
|
|
1265
|
+
p(this, Ue, void 0);
|
|
1266
|
+
p(this, Ce, void 0);
|
|
1267
|
+
p(this, xe, void 0);
|
|
1268
|
+
p(this, de, void 0);
|
|
1269
|
+
p(this, Qe, /* @__PURE__ */ new Set());
|
|
1270
|
+
this.options = s, h(this, Q, t), h(this, B, null), this.bindMethods(), this.setOptions(s);
|
|
1271
1271
|
}
|
|
1272
1272
|
bindMethods() {
|
|
1273
1273
|
this.refetch = this.refetch.bind(this);
|
|
1274
1274
|
}
|
|
1275
1275
|
onSubscribe() {
|
|
1276
|
-
this.listeners.size === 1 && (
|
|
1276
|
+
this.listeners.size === 1 && (n(this, N).addObserver(this), qt(n(this, N), this.options) ? x(this, be, Ge).call(this) : this.updateResult(), x(this, Be, St).call(this));
|
|
1277
1277
|
}
|
|
1278
1278
|
onUnsubscribe() {
|
|
1279
1279
|
this.hasListeners() || this.destroy();
|
|
1280
1280
|
}
|
|
1281
1281
|
shouldFetchOnReconnect() {
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1282
|
+
return kt(
|
|
1283
|
+
n(this, N),
|
|
1284
1284
|
this.options,
|
|
1285
1285
|
this.options.refetchOnReconnect
|
|
1286
1286
|
);
|
|
1287
1287
|
}
|
|
1288
1288
|
shouldFetchOnWindowFocus() {
|
|
1289
|
-
return
|
|
1290
|
-
|
|
1289
|
+
return kt(
|
|
1290
|
+
n(this, N),
|
|
1291
1291
|
this.options,
|
|
1292
1292
|
this.options.refetchOnWindowFocus
|
|
1293
1293
|
);
|
|
1294
1294
|
}
|
|
1295
1295
|
destroy() {
|
|
1296
|
-
this.listeners = /* @__PURE__ */ new Set(),
|
|
1296
|
+
this.listeners = /* @__PURE__ */ new Set(), x(this, et, At).call(this), x(this, tt, Pt).call(this), n(this, N).removeObserver(this);
|
|
1297
1297
|
}
|
|
1298
1298
|
setOptions(t, s) {
|
|
1299
|
-
const r = this.options,
|
|
1300
|
-
if (this.options =
|
|
1299
|
+
const r = this.options, a = n(this, N);
|
|
1300
|
+
if (this.options = n(this, Q).defaultQueryOptions(t), ct(r, this.options) || n(this, Q).getQueryCache().notify({
|
|
1301
1301
|
type: "observerOptionsUpdated",
|
|
1302
|
-
query:
|
|
1302
|
+
query: n(this, N),
|
|
1303
1303
|
observer: this
|
|
1304
1304
|
}), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
|
|
1305
1305
|
throw new Error("Expected enabled to be a boolean");
|
|
1306
|
-
this.options.queryKey || (this.options.queryKey = r.queryKey),
|
|
1306
|
+
this.options.queryKey || (this.options.queryKey = r.queryKey), x(this, st, Nt).call(this);
|
|
1307
1307
|
const o = this.hasListeners();
|
|
1308
|
-
o &&
|
|
1309
|
-
|
|
1310
|
-
|
|
1308
|
+
o && Wt(
|
|
1309
|
+
n(this, N),
|
|
1310
|
+
a,
|
|
1311
1311
|
this.options,
|
|
1312
1312
|
r
|
|
1313
|
-
) &&
|
|
1314
|
-
const l =
|
|
1315
|
-
o && (
|
|
1313
|
+
) && x(this, be, Ge).call(this), this.updateResult(s), o && (n(this, N) !== a || this.options.enabled !== r.enabled || this.options.staleTime !== r.staleTime) && x(this, Je, jt).call(this);
|
|
1314
|
+
const l = x(this, Xe, _t).call(this);
|
|
1315
|
+
o && (n(this, N) !== a || this.options.enabled !== r.enabled || l !== n(this, de)) && x(this, Ie, Et).call(this, l);
|
|
1316
1316
|
}
|
|
1317
1317
|
getOptimisticResult(t) {
|
|
1318
|
-
const s =
|
|
1319
|
-
return
|
|
1318
|
+
const s = n(this, Q).getQueryCache().build(n(this, Q), t), r = this.createResult(s, t);
|
|
1319
|
+
return dr(this, r) && (h(this, U, r), h(this, De, this.options), h(this, ge, n(this, N).state)), r;
|
|
1320
1320
|
}
|
|
1321
1321
|
getCurrentResult() {
|
|
1322
|
-
return
|
|
1322
|
+
return n(this, U);
|
|
1323
1323
|
}
|
|
1324
1324
|
trackResult(t) {
|
|
1325
1325
|
const s = {};
|
|
@@ -1327,12 +1327,12 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1327
1327
|
Object.defineProperty(s, r, {
|
|
1328
1328
|
configurable: !1,
|
|
1329
1329
|
enumerable: !0,
|
|
1330
|
-
get: () => (
|
|
1330
|
+
get: () => (n(this, Qe).add(r), t[r])
|
|
1331
1331
|
});
|
|
1332
1332
|
}), s;
|
|
1333
1333
|
}
|
|
1334
1334
|
getCurrentQuery() {
|
|
1335
|
-
return
|
|
1335
|
+
return n(this, N);
|
|
1336
1336
|
}
|
|
1337
1337
|
refetch({ ...t } = {}) {
|
|
1338
1338
|
return this.fetch({
|
|
@@ -1340,183 +1340,183 @@ var L, ce, ue, Le, Fe, de, Re, De, us, xs = (us = class {
|
|
|
1340
1340
|
});
|
|
1341
1341
|
}
|
|
1342
1342
|
fetchOptimistic(t) {
|
|
1343
|
-
const s =
|
|
1343
|
+
const s = n(this, Q).defaultQueryOptions(t), r = n(this, Q).getQueryCache().build(n(this, Q), s);
|
|
1344
1344
|
return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, s));
|
|
1345
1345
|
}
|
|
1346
1346
|
fetch(t) {
|
|
1347
|
-
return
|
|
1347
|
+
return x(this, be, Ge).call(this, {
|
|
1348
1348
|
...t,
|
|
1349
1349
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
1350
|
-
}).then(() => (this.updateResult(),
|
|
1350
|
+
}).then(() => (this.updateResult(), n(this, U)));
|
|
1351
1351
|
}
|
|
1352
1352
|
createResult(t, s) {
|
|
1353
1353
|
var $;
|
|
1354
|
-
const r =
|
|
1355
|
-
let { error:
|
|
1354
|
+
const r = n(this, N), a = this.options, o = n(this, U), l = n(this, ge), c = n(this, De), C = t !== r ? t.state : n(this, Ye), { state: u } = t;
|
|
1355
|
+
let { error: b, errorUpdatedAt: v, fetchStatus: f, status: w } = u, E = !1, y;
|
|
1356
1356
|
if (s._optimisticResults) {
|
|
1357
|
-
const
|
|
1358
|
-
(M ||
|
|
1357
|
+
const T = this.hasListeners(), M = !T && qt(t, s), ee = T && Wt(t, r, s, a);
|
|
1358
|
+
(M || ee) && (f = vt(t.options.networkMode) ? "fetching" : "paused", u.dataUpdatedAt || (w = "pending")), s._optimisticResults === "isRestoring" && (f = "idle");
|
|
1359
1359
|
}
|
|
1360
1360
|
if (s.select && typeof u.data < "u")
|
|
1361
|
-
if (o && u.data === (l == null ? void 0 : l.data) && s.select ===
|
|
1362
|
-
|
|
1361
|
+
if (o && u.data === (l == null ? void 0 : l.data) && s.select === n(this, ze))
|
|
1362
|
+
y = n(this, Te);
|
|
1363
1363
|
else
|
|
1364
1364
|
try {
|
|
1365
|
-
h(this,
|
|
1366
|
-
} catch (
|
|
1367
|
-
h(this,
|
|
1365
|
+
h(this, ze, s.select), y = s.select(u.data), y = wt(o == null ? void 0 : o.data, y, s), h(this, Te, y), h(this, B, null);
|
|
1366
|
+
} catch (T) {
|
|
1367
|
+
h(this, B, T);
|
|
1368
1368
|
}
|
|
1369
1369
|
else
|
|
1370
|
-
|
|
1371
|
-
if (typeof s.placeholderData < "u" && typeof
|
|
1372
|
-
let
|
|
1370
|
+
y = u.data;
|
|
1371
|
+
if (typeof s.placeholderData < "u" && typeof y > "u" && w === "pending") {
|
|
1372
|
+
let T;
|
|
1373
1373
|
if (o != null && o.isPlaceholderData && s.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
1374
|
-
|
|
1375
|
-
else if (
|
|
1376
|
-
($ =
|
|
1377
|
-
|
|
1378
|
-
) : s.placeholderData, s.select && typeof
|
|
1374
|
+
T = o.data;
|
|
1375
|
+
else if (T = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
1376
|
+
($ = n(this, Ue)) == null ? void 0 : $.state.data,
|
|
1377
|
+
n(this, Ue)
|
|
1378
|
+
) : s.placeholderData, s.select && typeof T < "u")
|
|
1379
1379
|
try {
|
|
1380
|
-
|
|
1380
|
+
T = s.select(T), h(this, B, null);
|
|
1381
1381
|
} catch (M) {
|
|
1382
|
-
h(this,
|
|
1382
|
+
h(this, B, M);
|
|
1383
1383
|
}
|
|
1384
|
-
typeof
|
|
1384
|
+
typeof T < "u" && (w = "success", y = wt(
|
|
1385
1385
|
o == null ? void 0 : o.data,
|
|
1386
|
-
|
|
1386
|
+
T,
|
|
1387
1387
|
s
|
|
1388
|
-
),
|
|
1388
|
+
), E = !0);
|
|
1389
1389
|
}
|
|
1390
|
-
|
|
1391
|
-
const
|
|
1390
|
+
n(this, B) && (b = n(this, B), y = n(this, Te), v = Date.now(), w = "error");
|
|
1391
|
+
const g = f === "fetching", S = w === "pending", _ = w === "error", k = S && g;
|
|
1392
1392
|
return {
|
|
1393
1393
|
status: w,
|
|
1394
|
-
fetchStatus:
|
|
1394
|
+
fetchStatus: f,
|
|
1395
1395
|
isPending: S,
|
|
1396
1396
|
isSuccess: w === "success",
|
|
1397
|
-
isError:
|
|
1397
|
+
isError: _,
|
|
1398
1398
|
isInitialLoading: k,
|
|
1399
1399
|
isLoading: k,
|
|
1400
|
-
data:
|
|
1400
|
+
data: y,
|
|
1401
1401
|
dataUpdatedAt: u.dataUpdatedAt,
|
|
1402
|
-
error:
|
|
1403
|
-
errorUpdatedAt:
|
|
1402
|
+
error: b,
|
|
1403
|
+
errorUpdatedAt: v,
|
|
1404
1404
|
failureCount: u.fetchFailureCount,
|
|
1405
1405
|
failureReason: u.fetchFailureReason,
|
|
1406
1406
|
errorUpdateCount: u.errorUpdateCount,
|
|
1407
1407
|
isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
|
|
1408
|
-
isFetchedAfterMount: u.dataUpdateCount >
|
|
1409
|
-
isFetching:
|
|
1410
|
-
isRefetching:
|
|
1411
|
-
isLoadingError:
|
|
1412
|
-
isPaused:
|
|
1413
|
-
isPlaceholderData:
|
|
1414
|
-
isRefetchError:
|
|
1415
|
-
isStale:
|
|
1408
|
+
isFetchedAfterMount: u.dataUpdateCount > C.dataUpdateCount || u.errorUpdateCount > C.errorUpdateCount,
|
|
1409
|
+
isFetching: g,
|
|
1410
|
+
isRefetching: g && !S,
|
|
1411
|
+
isLoadingError: _ && u.dataUpdatedAt === 0,
|
|
1412
|
+
isPaused: f === "paused",
|
|
1413
|
+
isPlaceholderData: E,
|
|
1414
|
+
isRefetchError: _ && u.dataUpdatedAt !== 0,
|
|
1415
|
+
isStale: Rt(t, s),
|
|
1416
1416
|
refetch: this.refetch
|
|
1417
1417
|
};
|
|
1418
1418
|
}
|
|
1419
1419
|
updateResult(t) {
|
|
1420
|
-
const s =
|
|
1421
|
-
if (h(this,
|
|
1420
|
+
const s = n(this, U), r = this.createResult(n(this, N), this.options);
|
|
1421
|
+
if (h(this, ge, n(this, N).state), h(this, De, this.options), n(this, ge).data !== void 0 && h(this, Ue, n(this, N)), ct(r, s))
|
|
1422
1422
|
return;
|
|
1423
1423
|
h(this, U, r);
|
|
1424
|
-
const
|
|
1424
|
+
const a = {}, o = () => {
|
|
1425
1425
|
if (!s)
|
|
1426
1426
|
return !0;
|
|
1427
1427
|
const { notifyOnChangeProps: l } = this.options, c = typeof l == "function" ? l() : l;
|
|
1428
|
-
if (c === "all" || !c && !
|
|
1428
|
+
if (c === "all" || !c && !n(this, Qe).size)
|
|
1429
1429
|
return !0;
|
|
1430
|
-
const
|
|
1431
|
-
c ??
|
|
1430
|
+
const m = new Set(
|
|
1431
|
+
c ?? n(this, Qe)
|
|
1432
1432
|
);
|
|
1433
|
-
return this.options.throwOnError &&
|
|
1434
|
-
const u =
|
|
1435
|
-
return
|
|
1433
|
+
return this.options.throwOnError && m.add("error"), Object.keys(n(this, U)).some((C) => {
|
|
1434
|
+
const u = C;
|
|
1435
|
+
return n(this, U)[u] !== s[u] && m.has(u);
|
|
1436
1436
|
});
|
|
1437
1437
|
};
|
|
1438
|
-
(t == null ? void 0 : t.listeners) !== !1 && o() && (
|
|
1438
|
+
(t == null ? void 0 : t.listeners) !== !1 && o() && (a.listeners = !0), x(this, mt, ys).call(this, { ...a, ...t });
|
|
1439
1439
|
}
|
|
1440
1440
|
onQueryUpdate() {
|
|
1441
|
-
this.updateResult(), this.hasListeners() &&
|
|
1441
|
+
this.updateResult(), this.hasListeners() && x(this, Be, St).call(this);
|
|
1442
1442
|
}
|
|
1443
|
-
}, Q = new WeakMap(), N = new WeakMap(),
|
|
1444
|
-
|
|
1445
|
-
let s =
|
|
1443
|
+
}, Q = new WeakMap(), N = new WeakMap(), Ye = new WeakMap(), U = new WeakMap(), ge = new WeakMap(), De = new WeakMap(), B = new WeakMap(), ze = new WeakMap(), Te = new WeakMap(), Ue = new WeakMap(), Ce = new WeakMap(), xe = new WeakMap(), de = new WeakMap(), Qe = new WeakMap(), be = new WeakSet(), Ge = function(t) {
|
|
1444
|
+
x(this, st, Nt).call(this);
|
|
1445
|
+
let s = n(this, N).fetch(
|
|
1446
1446
|
this.options,
|
|
1447
1447
|
t
|
|
1448
1448
|
);
|
|
1449
1449
|
return t != null && t.throwOnError || (s = s.catch(Z)), s;
|
|
1450
|
-
},
|
|
1451
|
-
if (
|
|
1450
|
+
}, Je = new WeakSet(), jt = function() {
|
|
1451
|
+
if (x(this, et, At).call(this), $e || n(this, U).isStale || !xt(this.options.staleTime))
|
|
1452
1452
|
return;
|
|
1453
|
-
const s =
|
|
1454
|
-
|
|
1453
|
+
const s = us(
|
|
1454
|
+
n(this, U).dataUpdatedAt,
|
|
1455
1455
|
this.options.staleTime
|
|
1456
1456
|
) + 1;
|
|
1457
|
-
h(this,
|
|
1458
|
-
|
|
1457
|
+
h(this, Ce, setTimeout(() => {
|
|
1458
|
+
n(this, U).isStale || this.updateResult();
|
|
1459
1459
|
}, s));
|
|
1460
|
+
}, Xe = new WeakSet(), _t = function() {
|
|
1461
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, N)) : this.options.refetchInterval) ?? !1;
|
|
1462
|
+
}, Ie = new WeakSet(), Et = function(t) {
|
|
1463
|
+
x(this, tt, Pt).call(this), h(this, de, t), !($e || this.options.enabled === !1 || !xt(n(this, de)) || n(this, de) === 0) && h(this, xe, setInterval(() => {
|
|
1464
|
+
(this.options.refetchIntervalInBackground || ut.isFocused()) && x(this, be, Ge).call(this);
|
|
1465
|
+
}, n(this, de)));
|
|
1460
1466
|
}, Be = new WeakSet(), St = function() {
|
|
1461
|
-
|
|
1462
|
-
}, et = new WeakSet(),
|
|
1463
|
-
|
|
1464
|
-
(this.options.refetchIntervalInBackground || ft.isFocused()) && b(this, we, Ve).call(this);
|
|
1465
|
-
}, a(this, he)));
|
|
1467
|
+
x(this, Je, jt).call(this), x(this, Ie, Et).call(this, x(this, Xe, _t).call(this));
|
|
1468
|
+
}, et = new WeakSet(), At = function() {
|
|
1469
|
+
n(this, Ce) && (clearTimeout(n(this, Ce)), h(this, Ce, void 0));
|
|
1466
1470
|
}, tt = new WeakSet(), Pt = function() {
|
|
1467
|
-
|
|
1471
|
+
n(this, xe) && (clearInterval(n(this, xe)), h(this, xe, void 0));
|
|
1468
1472
|
}, st = new WeakSet(), Nt = function() {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
a(this, be) && (clearInterval(a(this, be)), h(this, be, void 0));
|
|
1472
|
-
}, it = new WeakSet(), Ot = function() {
|
|
1473
|
-
const t = a(this, Q).getQueryCache().build(a(this, Q), this.options);
|
|
1474
|
-
if (t === a(this, N))
|
|
1473
|
+
const t = n(this, Q).getQueryCache().build(n(this, Q), this.options);
|
|
1474
|
+
if (t === n(this, N))
|
|
1475
1475
|
return;
|
|
1476
|
-
const s =
|
|
1477
|
-
h(this, N, t), h(this,
|
|
1478
|
-
},
|
|
1479
|
-
|
|
1476
|
+
const s = n(this, N);
|
|
1477
|
+
h(this, N, t), h(this, Ye, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
|
|
1478
|
+
}, mt = new WeakSet(), ys = function(t) {
|
|
1479
|
+
R.batch(() => {
|
|
1480
1480
|
t.listeners && this.listeners.forEach((s) => {
|
|
1481
|
-
s(
|
|
1482
|
-
}),
|
|
1483
|
-
query:
|
|
1481
|
+
s(n(this, U));
|
|
1482
|
+
}), n(this, Q).getQueryCache().notify({
|
|
1483
|
+
query: n(this, N),
|
|
1484
1484
|
type: "observerResultsUpdated"
|
|
1485
1485
|
});
|
|
1486
1486
|
});
|
|
1487
|
-
},
|
|
1488
|
-
function
|
|
1487
|
+
}, os);
|
|
1488
|
+
function ur(e, t) {
|
|
1489
1489
|
return t.enabled !== !1 && !e.state.dataUpdatedAt && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1491
|
+
function qt(e, t) {
|
|
1492
|
+
return ur(e, t) || e.state.dataUpdatedAt > 0 && kt(e, t, t.refetchOnMount);
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function kt(e, t, s) {
|
|
1495
1495
|
if (t.enabled !== !1) {
|
|
1496
1496
|
const r = typeof s == "function" ? s(e) : s;
|
|
1497
|
-
return r === "always" || r !== !1 &&
|
|
1497
|
+
return r === "always" || r !== !1 && Rt(e, t);
|
|
1498
1498
|
}
|
|
1499
1499
|
return !1;
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1502
|
-
return s.enabled !== !1 && (e !== t || r.enabled === !1) && (!s.suspense || e.state.status !== "error") &&
|
|
1501
|
+
function Wt(e, t, s, r) {
|
|
1502
|
+
return s.enabled !== !1 && (e !== t || r.enabled === !1) && (!s.suspense || e.state.status !== "error") && Rt(e, s);
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function Rt(e, t) {
|
|
1505
1505
|
return e.isStaleByTime(t.staleTime);
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return !
|
|
1507
|
+
function dr(e, t) {
|
|
1508
|
+
return !ct(e.getCurrentResult(), t);
|
|
1509
1509
|
}
|
|
1510
|
-
var
|
|
1510
|
+
var he, se, G, re, He, lt, rt, Mt, ls, hr = (ls = class extends Ke {
|
|
1511
1511
|
constructor(t, s) {
|
|
1512
1512
|
super();
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
h(this,
|
|
1513
|
+
p(this, He);
|
|
1514
|
+
p(this, rt);
|
|
1515
|
+
p(this, he, void 0);
|
|
1516
|
+
p(this, se, void 0);
|
|
1517
|
+
p(this, G, void 0);
|
|
1518
|
+
p(this, re, void 0);
|
|
1519
|
+
h(this, se, void 0), h(this, he, t), this.setOptions(s), this.bindMethods(), x(this, He, lt).call(this);
|
|
1520
1520
|
}
|
|
1521
1521
|
bindMethods() {
|
|
1522
1522
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -1524,34 +1524,34 @@ var fe, re, G, ie, $e, dt, nt, Ft, hs, fr = (hs = class extends Ge {
|
|
|
1524
1524
|
setOptions(t) {
|
|
1525
1525
|
var r;
|
|
1526
1526
|
const s = this.options;
|
|
1527
|
-
this.options =
|
|
1527
|
+
this.options = n(this, he).defaultMutationOptions(t), ct(s, this.options) || n(this, he).getMutationCache().notify({
|
|
1528
1528
|
type: "observerOptionsUpdated",
|
|
1529
|
-
mutation:
|
|
1529
|
+
mutation: n(this, G),
|
|
1530
1530
|
observer: this
|
|
1531
|
-
}), (r =
|
|
1531
|
+
}), (r = n(this, G)) == null || r.setOptions(this.options), s != null && s.mutationKey && this.options.mutationKey && we(s.mutationKey) !== we(this.options.mutationKey) && this.reset();
|
|
1532
1532
|
}
|
|
1533
1533
|
onUnsubscribe() {
|
|
1534
1534
|
var t;
|
|
1535
|
-
this.hasListeners() || (t =
|
|
1535
|
+
this.hasListeners() || (t = n(this, G)) == null || t.removeObserver(this);
|
|
1536
1536
|
}
|
|
1537
1537
|
onMutationUpdate(t) {
|
|
1538
|
-
|
|
1538
|
+
x(this, He, lt).call(this), x(this, rt, Mt).call(this, t);
|
|
1539
1539
|
}
|
|
1540
1540
|
getCurrentResult() {
|
|
1541
|
-
return
|
|
1541
|
+
return n(this, se);
|
|
1542
1542
|
}
|
|
1543
1543
|
reset() {
|
|
1544
1544
|
var t;
|
|
1545
|
-
(t =
|
|
1545
|
+
(t = n(this, G)) == null || t.removeObserver(this), h(this, G, void 0), x(this, He, lt).call(this), x(this, rt, Mt).call(this);
|
|
1546
1546
|
}
|
|
1547
1547
|
mutate(t, s) {
|
|
1548
1548
|
var r;
|
|
1549
|
-
return h(this,
|
|
1549
|
+
return h(this, re, s), (r = n(this, G)) == null || r.removeObserver(this), h(this, G, n(this, he).getMutationCache().build(n(this, he), this.options)), n(this, G).addObserver(this), n(this, G).execute(t);
|
|
1550
1550
|
}
|
|
1551
|
-
},
|
|
1551
|
+
}, he = new WeakMap(), se = new WeakMap(), G = new WeakMap(), re = new WeakMap(), He = new WeakSet(), lt = function() {
|
|
1552
1552
|
var s;
|
|
1553
|
-
const t = ((s =
|
|
1554
|
-
h(this,
|
|
1553
|
+
const t = ((s = n(this, G)) == null ? void 0 : s.state) ?? ms();
|
|
1554
|
+
h(this, se, {
|
|
1555
1555
|
...t,
|
|
1556
1556
|
isPending: t.status === "pending",
|
|
1557
1557
|
isSuccess: t.status === "success",
|
|
@@ -1560,40 +1560,40 @@ var fe, re, G, ie, $e, dt, nt, Ft, hs, fr = (hs = class extends Ge {
|
|
|
1560
1560
|
mutate: this.mutate,
|
|
1561
1561
|
reset: this.reset
|
|
1562
1562
|
});
|
|
1563
|
-
},
|
|
1564
|
-
|
|
1565
|
-
var s, r,
|
|
1566
|
-
if (
|
|
1567
|
-
const u =
|
|
1568
|
-
(t == null ? void 0 : t.type) === "success" ? ((r = (s =
|
|
1569
|
-
|
|
1563
|
+
}, rt = new WeakSet(), Mt = function(t) {
|
|
1564
|
+
R.batch(() => {
|
|
1565
|
+
var s, r, a, o, l, c, m, C;
|
|
1566
|
+
if (n(this, re) && this.hasListeners()) {
|
|
1567
|
+
const u = n(this, se).variables, b = n(this, se).context;
|
|
1568
|
+
(t == null ? void 0 : t.type) === "success" ? ((r = (s = n(this, re)).onSuccess) == null || r.call(s, t.data, u, b), (o = (a = n(this, re)).onSettled) == null || o.call(a, t.data, null, u, b)) : (t == null ? void 0 : t.type) === "error" && ((c = (l = n(this, re)).onError) == null || c.call(l, t.error, u, b), (C = (m = n(this, re)).onSettled) == null || C.call(
|
|
1569
|
+
m,
|
|
1570
1570
|
void 0,
|
|
1571
1571
|
t.error,
|
|
1572
1572
|
u,
|
|
1573
|
-
|
|
1573
|
+
b
|
|
1574
1574
|
));
|
|
1575
1575
|
}
|
|
1576
1576
|
this.listeners.forEach((u) => {
|
|
1577
|
-
u(
|
|
1577
|
+
u(n(this, se));
|
|
1578
1578
|
});
|
|
1579
1579
|
});
|
|
1580
|
-
},
|
|
1580
|
+
}, ls), gs = d.createContext(
|
|
1581
1581
|
void 0
|
|
1582
|
-
),
|
|
1583
|
-
const t = d.useContext(
|
|
1582
|
+
), Dt = (e) => {
|
|
1583
|
+
const t = d.useContext(gs);
|
|
1584
1584
|
if (e)
|
|
1585
1585
|
return e;
|
|
1586
1586
|
if (!t)
|
|
1587
1587
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1588
1588
|
return t;
|
|
1589
|
-
},
|
|
1589
|
+
}, fr = ({
|
|
1590
1590
|
client: e,
|
|
1591
1591
|
children: t
|
|
1592
1592
|
}) => (d.useEffect(() => (e.mount(), () => {
|
|
1593
1593
|
e.unmount();
|
|
1594
|
-
}), [e]), /* @__PURE__ */ d.createElement(
|
|
1595
|
-
|
|
1596
|
-
function
|
|
1594
|
+
}), [e]), /* @__PURE__ */ d.createElement(gs.Provider, { value: e }, t)), Cs = d.createContext(!1), pr = () => d.useContext(Cs);
|
|
1595
|
+
Cs.Provider;
|
|
1596
|
+
function mr() {
|
|
1597
1597
|
let e = !1;
|
|
1598
1598
|
return {
|
|
1599
1599
|
clearReset: () => {
|
|
@@ -1605,65 +1605,65 @@ function vr() {
|
|
|
1605
1605
|
isReset: () => e
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
|
-
var
|
|
1609
|
-
function
|
|
1608
|
+
var vr = d.createContext(mr()), yr = () => d.useContext(vr);
|
|
1609
|
+
function xs(e, t) {
|
|
1610
1610
|
return typeof e == "function" ? e(...t) : !!e;
|
|
1611
1611
|
}
|
|
1612
|
-
var
|
|
1612
|
+
var gr = (e, t) => {
|
|
1613
1613
|
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
1614
|
-
},
|
|
1614
|
+
}, Cr = (e) => {
|
|
1615
1615
|
d.useEffect(() => {
|
|
1616
1616
|
e.clearReset();
|
|
1617
1617
|
}, [e]);
|
|
1618
|
-
},
|
|
1618
|
+
}, xr = ({
|
|
1619
1619
|
result: e,
|
|
1620
1620
|
errorResetBoundary: t,
|
|
1621
1621
|
throwOnError: s,
|
|
1622
1622
|
query: r
|
|
1623
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r &&
|
|
1623
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && xs(s, [e.error, r]), br = (e) => {
|
|
1624
1624
|
e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
|
|
1625
|
-
},
|
|
1625
|
+
}, wr = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, jr = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1626
1626
|
s.clearReset();
|
|
1627
1627
|
});
|
|
1628
|
-
function
|
|
1629
|
-
const r =
|
|
1630
|
-
l._optimisticResults =
|
|
1628
|
+
function _r(e, t, s) {
|
|
1629
|
+
const r = Dt(s), a = pr(), o = yr(), l = r.defaultQueryOptions(e);
|
|
1630
|
+
l._optimisticResults = a ? "isRestoring" : "optimistic", br(l), gr(l, o), Cr(o);
|
|
1631
1631
|
const [c] = d.useState(
|
|
1632
1632
|
() => new t(
|
|
1633
1633
|
r,
|
|
1634
1634
|
l
|
|
1635
1635
|
)
|
|
1636
|
-
),
|
|
1636
|
+
), m = c.getOptimisticResult(l);
|
|
1637
1637
|
if (d.useSyncExternalStore(
|
|
1638
1638
|
d.useCallback(
|
|
1639
|
-
(
|
|
1640
|
-
const u =
|
|
1641
|
-
} : c.subscribe(
|
|
1639
|
+
(C) => {
|
|
1640
|
+
const u = a ? () => {
|
|
1641
|
+
} : c.subscribe(R.batchCalls(C));
|
|
1642
1642
|
return c.updateResult(), u;
|
|
1643
1643
|
},
|
|
1644
|
-
[c,
|
|
1644
|
+
[c, a]
|
|
1645
1645
|
),
|
|
1646
1646
|
() => c.getCurrentResult(),
|
|
1647
1647
|
() => c.getCurrentResult()
|
|
1648
1648
|
), d.useEffect(() => {
|
|
1649
1649
|
c.setOptions(l, { listeners: !1 });
|
|
1650
|
-
}, [l, c]),
|
|
1651
|
-
throw
|
|
1652
|
-
if (
|
|
1653
|
-
result:
|
|
1650
|
+
}, [l, c]), wr(l, m))
|
|
1651
|
+
throw jr(l, c, o);
|
|
1652
|
+
if (xr({
|
|
1653
|
+
result: m,
|
|
1654
1654
|
errorResetBoundary: o,
|
|
1655
1655
|
throwOnError: l.throwOnError,
|
|
1656
1656
|
query: r.getQueryCache().get(l.queryHash)
|
|
1657
1657
|
}))
|
|
1658
|
-
throw
|
|
1659
|
-
return l.notifyOnChangeProps ?
|
|
1658
|
+
throw m.error;
|
|
1659
|
+
return l.notifyOnChangeProps ? m : c.trackResult(m);
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return
|
|
1661
|
+
function bs(e, t) {
|
|
1662
|
+
return _r(e, cr, t);
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1665
|
-
const s =
|
|
1666
|
-
() => new
|
|
1664
|
+
function Er(e, t) {
|
|
1665
|
+
const s = Dt(t), [r] = d.useState(
|
|
1666
|
+
() => new hr(
|
|
1667
1667
|
s,
|
|
1668
1668
|
e
|
|
1669
1669
|
)
|
|
@@ -1671,9 +1671,9 @@ function Ar(e, t) {
|
|
|
1671
1671
|
d.useEffect(() => {
|
|
1672
1672
|
r.setOptions(e);
|
|
1673
1673
|
}, [r, e]);
|
|
1674
|
-
const
|
|
1674
|
+
const a = d.useSyncExternalStore(
|
|
1675
1675
|
d.useCallback(
|
|
1676
|
-
(l) => r.subscribe(
|
|
1676
|
+
(l) => r.subscribe(R.batchCalls(l)),
|
|
1677
1677
|
[r]
|
|
1678
1678
|
),
|
|
1679
1679
|
() => r.getCurrentResult(),
|
|
@@ -1684,103 +1684,103 @@ function Ar(e, t) {
|
|
|
1684
1684
|
},
|
|
1685
1685
|
[r]
|
|
1686
1686
|
);
|
|
1687
|
-
if (
|
|
1688
|
-
throw
|
|
1689
|
-
return { ...
|
|
1687
|
+
if (a.error && xs(r.options.throwOnError, [a.error]))
|
|
1688
|
+
throw a.error;
|
|
1689
|
+
return { ...a, mutate: o, mutateAsync: a.mutate };
|
|
1690
1690
|
}
|
|
1691
1691
|
function Sr() {
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function ws(e) {
|
|
1694
1694
|
var t, s, r = "";
|
|
1695
1695
|
if (typeof e == "string" || typeof e == "number")
|
|
1696
1696
|
r += e;
|
|
1697
1697
|
else if (typeof e == "object")
|
|
1698
1698
|
if (Array.isArray(e)) {
|
|
1699
|
-
var
|
|
1700
|
-
for (t = 0; t <
|
|
1701
|
-
e[t] && (s =
|
|
1699
|
+
var a = e.length;
|
|
1700
|
+
for (t = 0; t < a; t++)
|
|
1701
|
+
e[t] && (s = ws(e[t])) && (r && (r += " "), r += s);
|
|
1702
1702
|
} else
|
|
1703
1703
|
for (s in e)
|
|
1704
1704
|
e[s] && (r && (r += " "), r += s);
|
|
1705
1705
|
return r;
|
|
1706
1706
|
}
|
|
1707
1707
|
function P() {
|
|
1708
|
-
for (var e, t, s = 0, r = "",
|
|
1709
|
-
(e = arguments[s]) && (t =
|
|
1708
|
+
for (var e, t, s = 0, r = "", a = arguments.length; s < a; s++)
|
|
1709
|
+
(e = arguments[s]) && (t = ws(e)) && (r && (r += " "), r += t);
|
|
1710
1710
|
return r;
|
|
1711
1711
|
}
|
|
1712
|
-
var
|
|
1712
|
+
var Ar = Object.defineProperty, Pr = Object.defineProperties, Nr = Object.getOwnPropertyDescriptors, ht = Object.getOwnPropertySymbols, js = Object.prototype.hasOwnProperty, _s = Object.prototype.propertyIsEnumerable, Zt = (e, t, s) => t in e ? Ar(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, j = (e, t) => {
|
|
1713
1713
|
for (var s in t || (t = {}))
|
|
1714
|
-
|
|
1715
|
-
if (
|
|
1716
|
-
for (var s of
|
|
1717
|
-
|
|
1714
|
+
js.call(t, s) && Zt(e, s, t[s]);
|
|
1715
|
+
if (ht)
|
|
1716
|
+
for (var s of ht(t))
|
|
1717
|
+
_s.call(t, s) && Zt(e, s, t[s]);
|
|
1718
1718
|
return e;
|
|
1719
1719
|
}, A = (e, t) => Pr(e, Nr(t)), O = (e, t) => {
|
|
1720
1720
|
var s = {};
|
|
1721
1721
|
for (var r in e)
|
|
1722
|
-
|
|
1723
|
-
if (e != null &&
|
|
1724
|
-
for (var r of
|
|
1725
|
-
t.indexOf(r) < 0 &&
|
|
1722
|
+
js.call(e, r) && t.indexOf(r) < 0 && (s[r] = e[r]);
|
|
1723
|
+
if (e != null && ht)
|
|
1724
|
+
for (var r of ht(e))
|
|
1725
|
+
t.indexOf(r) < 0 && _s.call(e, r) && (s[r] = e[r]);
|
|
1726
1726
|
return s;
|
|
1727
1727
|
};
|
|
1728
|
-
function
|
|
1729
|
-
return
|
|
1728
|
+
function ft() {
|
|
1729
|
+
return ft = Object.assign ? Object.assign.bind() : function(e) {
|
|
1730
1730
|
for (var t = 1; t < arguments.length; t++) {
|
|
1731
1731
|
var s = arguments[t];
|
|
1732
1732
|
for (var r in s)
|
|
1733
1733
|
Object.prototype.hasOwnProperty.call(s, r) && (e[r] = s[r]);
|
|
1734
1734
|
}
|
|
1735
1735
|
return e;
|
|
1736
|
-
},
|
|
1736
|
+
}, ft.apply(this, arguments);
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1738
|
+
function kr(e, t) {
|
|
1739
1739
|
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function Mr(...e) {
|
|
1742
1742
|
return (t) => e.forEach(
|
|
1743
|
-
(s) =>
|
|
1743
|
+
(s) => kr(s, t)
|
|
1744
1744
|
);
|
|
1745
1745
|
}
|
|
1746
|
-
var
|
|
1747
|
-
const s = e, { children: r } = s,
|
|
1746
|
+
var Or = /* @__PURE__ */ d.forwardRef((e, t) => {
|
|
1747
|
+
const s = e, { children: r } = s, a = O(s, ["children"]), o = d.Children.toArray(r), l = o.find(Fr);
|
|
1748
1748
|
if (l) {
|
|
1749
|
-
const c = l.props.children,
|
|
1750
|
-
return /* @__PURE__ */ d.createElement(
|
|
1749
|
+
const c = l.props.children, m = o.map((C) => C === l ? d.Children.count(c) > 1 ? d.Children.only(null) : /* @__PURE__ */ d.isValidElement(c) ? c.props.children : null : C);
|
|
1750
|
+
return /* @__PURE__ */ d.createElement(Ot, ft({}, a, {
|
|
1751
1751
|
ref: t
|
|
1752
|
-
}), /* @__PURE__ */ d.isValidElement(c) ? /* @__PURE__ */ d.cloneElement(c, void 0,
|
|
1752
|
+
}), /* @__PURE__ */ d.isValidElement(c) ? /* @__PURE__ */ d.cloneElement(c, void 0, m) : null);
|
|
1753
1753
|
}
|
|
1754
|
-
return /* @__PURE__ */ d.createElement(
|
|
1754
|
+
return /* @__PURE__ */ d.createElement(Ot, ft({}, a, {
|
|
1755
1755
|
ref: t
|
|
1756
1756
|
}), r);
|
|
1757
1757
|
});
|
|
1758
|
-
|
|
1759
|
-
var
|
|
1760
|
-
const s = e, { children: r } = s,
|
|
1761
|
-
return /* @__PURE__ */ d.isValidElement(r) ? /* @__PURE__ */ d.cloneElement(r, A(j({},
|
|
1762
|
-
ref: t ?
|
|
1758
|
+
Or.displayName = "Slot";
|
|
1759
|
+
var Ot = /* @__PURE__ */ d.forwardRef((e, t) => {
|
|
1760
|
+
const s = e, { children: r } = s, a = O(s, ["children"]);
|
|
1761
|
+
return /* @__PURE__ */ d.isValidElement(r) ? /* @__PURE__ */ d.cloneElement(r, A(j({}, Rr(a, r.props)), {
|
|
1762
|
+
ref: t ? Mr(t, r.ref) : r.ref
|
|
1763
1763
|
})) : d.Children.count(r) > 1 ? d.Children.only(null) : null;
|
|
1764
1764
|
});
|
|
1765
|
-
|
|
1766
|
-
var
|
|
1767
|
-
function
|
|
1768
|
-
return /* @__PURE__ */ d.isValidElement(e) && e.type ===
|
|
1765
|
+
Ot.displayName = "SlotClone";
|
|
1766
|
+
var Lr = ({ children: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, e);
|
|
1767
|
+
function Fr(e) {
|
|
1768
|
+
return /* @__PURE__ */ d.isValidElement(e) && e.type === Lr;
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function Rr(e, t) {
|
|
1771
1771
|
const s = j({}, t);
|
|
1772
1772
|
for (const r in t) {
|
|
1773
|
-
const
|
|
1774
|
-
/^on[A-Z]/.test(r) ?
|
|
1775
|
-
o(...c),
|
|
1776
|
-
} :
|
|
1777
|
-
|
|
1773
|
+
const a = e[r], o = t[r];
|
|
1774
|
+
/^on[A-Z]/.test(r) ? a && o ? s[r] = (...c) => {
|
|
1775
|
+
o(...c), a(...c);
|
|
1776
|
+
} : a && (s[r] = a) : r === "style" ? s[r] = j(j({}, a), o) : r === "className" && (s[r] = [
|
|
1777
|
+
a,
|
|
1778
1778
|
o
|
|
1779
1779
|
].filter(Boolean).join(" "));
|
|
1780
1780
|
}
|
|
1781
1781
|
return j(j({}, e), s);
|
|
1782
1782
|
}
|
|
1783
|
-
var
|
|
1783
|
+
var Dr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
1784
1784
|
const r = `${e.charAt(0)}${t.charAt(0)}`;
|
|
1785
1785
|
return /* @__PURE__ */ i.jsx(
|
|
1786
1786
|
"span",
|
|
@@ -1791,16 +1791,16 @@ var Tr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1791
1791
|
children: /* @__PURE__ */ i.jsx("span", { className: "avatar__initials", children: r })
|
|
1792
1792
|
}
|
|
1793
1793
|
);
|
|
1794
|
-
},
|
|
1794
|
+
}, it = d.forwardRef(
|
|
1795
1795
|
(e, t) => {
|
|
1796
1796
|
var s = e, {
|
|
1797
1797
|
iconLeft: r,
|
|
1798
|
-
iconRight:
|
|
1798
|
+
iconRight: a,
|
|
1799
1799
|
isPending: o = !1,
|
|
1800
1800
|
isFilled: l = !1,
|
|
1801
1801
|
variant: c,
|
|
1802
|
-
className:
|
|
1803
|
-
children:
|
|
1802
|
+
className: m,
|
|
1803
|
+
children: C
|
|
1804
1804
|
} = s, u = O(s, [
|
|
1805
1805
|
"iconLeft",
|
|
1806
1806
|
"iconRight",
|
|
@@ -1810,7 +1810,7 @@ var Tr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1810
1810
|
"className",
|
|
1811
1811
|
"children"
|
|
1812
1812
|
]);
|
|
1813
|
-
const
|
|
1813
|
+
const b = !!r || !!a;
|
|
1814
1814
|
return /* @__PURE__ */ i.jsxs(
|
|
1815
1815
|
"button",
|
|
1816
1816
|
A(j({
|
|
@@ -1820,24 +1820,24 @@ var Tr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1820
1820
|
"button",
|
|
1821
1821
|
c && `button--${c}`,
|
|
1822
1822
|
c && l && `button--${c}--filled`,
|
|
1823
|
-
|
|
1823
|
+
b && "button--with-icon",
|
|
1824
1824
|
o && "button--pending",
|
|
1825
|
-
|
|
1825
|
+
m
|
|
1826
1826
|
),
|
|
1827
1827
|
children: [
|
|
1828
1828
|
r && /* @__PURE__ */ i.jsx("div", { className: "button__icon", children: r }),
|
|
1829
|
-
!!
|
|
1830
|
-
|
|
1829
|
+
!!C && /* @__PURE__ */ i.jsx("span", { className: "button__label", children: C }),
|
|
1830
|
+
a && /* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: a })
|
|
1831
1831
|
]
|
|
1832
1832
|
})
|
|
1833
1833
|
);
|
|
1834
1834
|
}
|
|
1835
1835
|
);
|
|
1836
|
-
|
|
1836
|
+
it.displayName = "Button";
|
|
1837
1837
|
d.createContext(void 0);
|
|
1838
|
-
var
|
|
1838
|
+
var Tr = d.forwardRef(
|
|
1839
1839
|
(e, t) => {
|
|
1840
|
-
var s = e, { prefix: r, suffix:
|
|
1840
|
+
var s = e, { prefix: r, suffix: a, className: o } = s, l = O(s, ["prefix", "suffix", "className"]);
|
|
1841
1841
|
return /* @__PURE__ */ i.jsxs("div", { className: "input__wrapper", children: [
|
|
1842
1842
|
r && /* @__PURE__ */ i.jsx("span", { className: "input__prefix", children: r }),
|
|
1843
1843
|
/* @__PURE__ */ i.jsx(
|
|
@@ -1847,21 +1847,21 @@ var Ur = d.forwardRef(
|
|
|
1847
1847
|
className: P(
|
|
1848
1848
|
"input",
|
|
1849
1849
|
r && "input--with-prefix",
|
|
1850
|
-
|
|
1850
|
+
a && "input--with-suffix",
|
|
1851
1851
|
o
|
|
1852
1852
|
)
|
|
1853
1853
|
}, l)
|
|
1854
1854
|
),
|
|
1855
|
-
|
|
1855
|
+
a && /* @__PURE__ */ i.jsx("span", { className: "input__suffix", children: a })
|
|
1856
1856
|
] });
|
|
1857
1857
|
}
|
|
1858
1858
|
);
|
|
1859
|
-
|
|
1859
|
+
Tr.displayName = "TextField";
|
|
1860
1860
|
d.createContext(void 0);
|
|
1861
|
-
var
|
|
1862
|
-
var t = e, { children: s, className: r } = t,
|
|
1863
|
-
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("card__body", r) },
|
|
1864
|
-
},
|
|
1861
|
+
var Ur = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__header__action", children: e }), Qr = (e) => {
|
|
1862
|
+
var t = e, { children: s, className: r } = t, a = O(t, ["children", "className"]);
|
|
1863
|
+
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("card__body", r) }, a), { children: s }));
|
|
1864
|
+
}, Hr = (e) => /* @__PURE__ */ i.jsx(
|
|
1865
1865
|
"svg",
|
|
1866
1866
|
A(j({
|
|
1867
1867
|
width: "24",
|
|
@@ -1881,7 +1881,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1881
1881
|
}
|
|
1882
1882
|
)
|
|
1883
1883
|
})
|
|
1884
|
-
),
|
|
1884
|
+
), Tt = Hr, $r = (e) => /* @__PURE__ */ i.jsx(
|
|
1885
1885
|
"svg",
|
|
1886
1886
|
A(j({
|
|
1887
1887
|
width: "24",
|
|
@@ -1901,7 +1901,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1901
1901
|
}
|
|
1902
1902
|
)
|
|
1903
1903
|
})
|
|
1904
|
-
),
|
|
1904
|
+
), Kr = $r, Gr = (e) => /* @__PURE__ */ i.jsx(
|
|
1905
1905
|
"svg",
|
|
1906
1906
|
A(j({
|
|
1907
1907
|
width: "24",
|
|
@@ -1920,7 +1920,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1920
1920
|
}
|
|
1921
1921
|
)
|
|
1922
1922
|
})
|
|
1923
|
-
), Vr =
|
|
1923
|
+
), Vr = Gr, qr = (e) => /* @__PURE__ */ i.jsx(
|
|
1924
1924
|
"svg",
|
|
1925
1925
|
A(j({
|
|
1926
1926
|
width: "24",
|
|
@@ -1939,7 +1939,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1939
1939
|
}
|
|
1940
1940
|
)
|
|
1941
1941
|
})
|
|
1942
|
-
),
|
|
1942
|
+
), Wr = qr, Zr = (e) => /* @__PURE__ */ i.jsx(
|
|
1943
1943
|
"svg",
|
|
1944
1944
|
A(j({
|
|
1945
1945
|
width: "24",
|
|
@@ -1958,7 +1958,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1958
1958
|
}
|
|
1959
1959
|
)
|
|
1960
1960
|
})
|
|
1961
|
-
), Yr =
|
|
1961
|
+
), Yr = Zr, zr = (e) => /* @__PURE__ */ i.jsxs(
|
|
1962
1962
|
"svg",
|
|
1963
1963
|
A(j({
|
|
1964
1964
|
width: "24",
|
|
@@ -1995,7 +1995,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1995
1995
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_19_444", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
1996
1996
|
]
|
|
1997
1997
|
})
|
|
1998
|
-
),
|
|
1998
|
+
), Jr = zr, Xr = (e) => /* @__PURE__ */ i.jsxs(
|
|
1999
1999
|
"svg",
|
|
2000
2000
|
A(j({
|
|
2001
2001
|
width: "24",
|
|
@@ -2027,7 +2027,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2027
2027
|
)
|
|
2028
2028
|
]
|
|
2029
2029
|
})
|
|
2030
|
-
),
|
|
2030
|
+
), Ir = Xr, Br = (e) => /* @__PURE__ */ i.jsxs(
|
|
2031
2031
|
"svg",
|
|
2032
2032
|
A(j({
|
|
2033
2033
|
width: "24",
|
|
@@ -2079,31 +2079,36 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2079
2079
|
)
|
|
2080
2080
|
]
|
|
2081
2081
|
})
|
|
2082
|
-
),
|
|
2083
|
-
"
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
{
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2082
|
+
), ei = Br, ti = (e) => {
|
|
2083
|
+
var t = e, { className: s } = t, r = O(t, ["className"]);
|
|
2084
|
+
return /* @__PURE__ */ i.jsxs(
|
|
2085
|
+
"svg",
|
|
2086
|
+
A(j({
|
|
2087
|
+
width: "20",
|
|
2088
|
+
height: "20",
|
|
2089
|
+
viewBox: "0 0 20 20",
|
|
2090
|
+
fill: "none",
|
|
2091
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2092
|
+
className: P("spinner", s)
|
|
2093
|
+
}, r), {
|
|
2094
|
+
children: [
|
|
2095
|
+
/* @__PURE__ */ i.jsx("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "1.5" }),
|
|
2096
|
+
/* @__PURE__ */ i.jsx(
|
|
2097
|
+
"circle",
|
|
2098
|
+
{
|
|
2099
|
+
cx: "10",
|
|
2100
|
+
cy: "10",
|
|
2101
|
+
r: "9",
|
|
2102
|
+
stroke: "currentColor",
|
|
2103
|
+
strokeWidth: "1.5",
|
|
2104
|
+
strokeLinecap: "round",
|
|
2105
|
+
strokeDasharray: "42.42 14.14"
|
|
2106
|
+
}
|
|
2107
|
+
)
|
|
2108
|
+
]
|
|
2109
|
+
})
|
|
2110
|
+
);
|
|
2111
|
+
}, si = ti, ri = (e) => /* @__PURE__ */ i.jsxs(
|
|
2107
2112
|
"svg",
|
|
2108
2113
|
A(j({
|
|
2109
2114
|
width: "24",
|
|
@@ -2137,7 +2142,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2137
2142
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_762_2934", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2138
2143
|
]
|
|
2139
2144
|
})
|
|
2140
|
-
),
|
|
2145
|
+
), ii = ri, ni = (e) => {
|
|
2141
2146
|
const t = (s) => `${s}${e.suffix ? `_${e.suffix}` : ""}`;
|
|
2142
2147
|
return /* @__PURE__ */ i.jsxs(
|
|
2143
2148
|
"svg",
|
|
@@ -2308,7 +2313,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2308
2313
|
]
|
|
2309
2314
|
})
|
|
2310
2315
|
);
|
|
2311
|
-
},
|
|
2316
|
+
}, Es = ni, ai = (e) => /* @__PURE__ */ i.jsxs(
|
|
2312
2317
|
"svg",
|
|
2313
2318
|
A(j({
|
|
2314
2319
|
fill: "none",
|
|
@@ -2370,7 +2375,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2370
2375
|
)
|
|
2371
2376
|
]
|
|
2372
2377
|
})
|
|
2373
|
-
),
|
|
2378
|
+
), oi = ai, li = (e) => /* @__PURE__ */ i.jsx(
|
|
2374
2379
|
"svg",
|
|
2375
2380
|
A(j({
|
|
2376
2381
|
fill: "none",
|
|
@@ -2390,7 +2395,7 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2390
2395
|
}
|
|
2391
2396
|
)
|
|
2392
2397
|
})
|
|
2393
|
-
),
|
|
2398
|
+
), ci = li, ui = (e) => /* @__PURE__ */ i.jsxs(
|
|
2394
2399
|
"svg",
|
|
2395
2400
|
A(j({
|
|
2396
2401
|
width: "24",
|
|
@@ -2417,15 +2422,15 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2417
2422
|
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 20.7)", fill: "currentColor" })
|
|
2418
2423
|
]
|
|
2419
2424
|
})
|
|
2420
|
-
),
|
|
2425
|
+
), di = ui, hi = (e) => {
|
|
2421
2426
|
var t = e, {
|
|
2422
2427
|
variant: s,
|
|
2423
2428
|
icon: r,
|
|
2424
|
-
isStandalone:
|
|
2429
|
+
isStandalone: a,
|
|
2425
2430
|
title: o,
|
|
2426
2431
|
description: l,
|
|
2427
2432
|
className: c
|
|
2428
|
-
} = t,
|
|
2433
|
+
} = t, m = O(t, [
|
|
2429
2434
|
"variant",
|
|
2430
2435
|
"icon",
|
|
2431
2436
|
"isStandalone",
|
|
@@ -2435,15 +2440,15 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2435
2440
|
]);
|
|
2436
2441
|
return /* @__PURE__ */ i.jsx(
|
|
2437
2442
|
"div",
|
|
2438
|
-
A(j({},
|
|
2443
|
+
A(j({}, m), {
|
|
2439
2444
|
className: P(
|
|
2440
2445
|
"card__empty-state",
|
|
2441
2446
|
s === "error" && "card__empty-state--error",
|
|
2442
|
-
|
|
2447
|
+
a && "card__empty-state--standalone",
|
|
2443
2448
|
c
|
|
2444
2449
|
),
|
|
2445
2450
|
children: /* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__wrapper", children: [
|
|
2446
|
-
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(
|
|
2451
|
+
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(ii, {}) : r }),
|
|
2447
2452
|
/* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__content", children: [
|
|
2448
2453
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__title", children: o }),
|
|
2449
2454
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__description", children: l })
|
|
@@ -2451,11 +2456,11 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2451
2456
|
] })
|
|
2452
2457
|
})
|
|
2453
2458
|
);
|
|
2454
|
-
},
|
|
2459
|
+
}, fi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__footer", children: e }), pi = (e) => {
|
|
2455
2460
|
var t = e, {
|
|
2456
2461
|
variant: s = "default",
|
|
2457
2462
|
sticky: r,
|
|
2458
|
-
className:
|
|
2463
|
+
className: a,
|
|
2459
2464
|
children: o
|
|
2460
2465
|
} = t, l = O(t, [
|
|
2461
2466
|
"variant",
|
|
@@ -2470,17 +2475,17 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2470
2475
|
"card__header",
|
|
2471
2476
|
s && `card__header--${s}`,
|
|
2472
2477
|
r && "card__header--sticky",
|
|
2473
|
-
|
|
2478
|
+
a
|
|
2474
2479
|
),
|
|
2475
2480
|
children: o
|
|
2476
2481
|
})
|
|
2477
2482
|
);
|
|
2478
|
-
},
|
|
2483
|
+
}, mi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__image", children: e }), vi = ({ children: e, className: t }) => /* @__PURE__ */ i.jsx("div", { className: P("card__body__item", t), children: e }), yi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__body__subtitle", children: e }), gi = ({ icon: e, children: t }) => /* @__PURE__ */ i.jsxs("div", { className: "card__header__title", children: [
|
|
2479
2484
|
e && /* @__PURE__ */ i.jsx("span", { className: "card__header__title__icon", children: e }),
|
|
2480
2485
|
t
|
|
2481
|
-
] }),
|
|
2486
|
+
] }), Ss = d.forwardRef(
|
|
2482
2487
|
(e, t) => {
|
|
2483
|
-
var s = e, { type: r, children:
|
|
2488
|
+
var s = e, { type: r, children: a, className: o, variant: l = "default", disabled: c = !1 } = s, m = O(s, ["type", "children", "className", "variant", "disabled"]);
|
|
2484
2489
|
return d.createElement(
|
|
2485
2490
|
r,
|
|
2486
2491
|
j({
|
|
@@ -2491,48 +2496,48 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2491
2496
|
o
|
|
2492
2497
|
),
|
|
2493
2498
|
ref: t
|
|
2494
|
-
},
|
|
2495
|
-
|
|
2499
|
+
}, m),
|
|
2500
|
+
a
|
|
2496
2501
|
);
|
|
2497
2502
|
}
|
|
2498
2503
|
);
|
|
2499
|
-
|
|
2500
|
-
Object.assign(
|
|
2501
|
-
Header:
|
|
2502
|
-
Action:
|
|
2503
|
-
Title:
|
|
2504
|
+
Ss.displayName = "Card";
|
|
2505
|
+
Object.assign(Ss, {
|
|
2506
|
+
Header: pi,
|
|
2507
|
+
Action: Ur,
|
|
2508
|
+
Title: gi,
|
|
2504
2509
|
Subtitle: yi,
|
|
2505
|
-
Body:
|
|
2506
|
-
Image:
|
|
2507
|
-
Item:
|
|
2508
|
-
Footer:
|
|
2509
|
-
EmptyState:
|
|
2510
|
+
Body: Qr,
|
|
2511
|
+
Image: mi,
|
|
2512
|
+
Item: vi,
|
|
2513
|
+
Footer: fi,
|
|
2514
|
+
EmptyState: hi
|
|
2510
2515
|
});
|
|
2511
|
-
var
|
|
2512
|
-
var t = e, { className: s, children: r } = t,
|
|
2513
|
-
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("checkbox__content", s) },
|
|
2514
|
-
},
|
|
2515
|
-
var t = e, { className: s, children: r } = t,
|
|
2516
|
-
return /* @__PURE__ */ i.jsx("span", A(j({ className: P("checkbox__hint", s) },
|
|
2517
|
-
},
|
|
2518
|
-
const e = d.useContext(
|
|
2516
|
+
var Ci = (e) => {
|
|
2517
|
+
var t = e, { className: s, children: r } = t, a = O(t, ["className", "children"]);
|
|
2518
|
+
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("checkbox__content", s) }, a), { children: r }));
|
|
2519
|
+
}, xi = (e) => {
|
|
2520
|
+
var t = e, { className: s, children: r } = t, a = O(t, ["className", "children"]);
|
|
2521
|
+
return /* @__PURE__ */ i.jsx("span", A(j({ className: P("checkbox__hint", s) }, a), { children: r }));
|
|
2522
|
+
}, As = d.createContext(void 0), bi = ({ id: e, name: t, children: s }) => /* @__PURE__ */ i.jsx(As.Provider, { value: { id: e, name: t }, children: s }), wi = () => {
|
|
2523
|
+
const e = d.useContext(As);
|
|
2519
2524
|
if (!e)
|
|
2520
2525
|
throw new Error("Checkbox compound components can not be rendered outside of Checkbox");
|
|
2521
2526
|
return e;
|
|
2522
|
-
},
|
|
2523
|
-
var t = e, { className: s, children: r } = t,
|
|
2524
|
-
const { id: o } =
|
|
2525
|
-
return /* @__PURE__ */ i.jsx("label", A(j({ htmlFor: o, className: P("checkbox__label", s) },
|
|
2526
|
-
},
|
|
2527
|
+
}, ji = (e) => {
|
|
2528
|
+
var t = e, { className: s, children: r } = t, a = O(t, ["className", "children"]);
|
|
2529
|
+
const { id: o } = wi();
|
|
2530
|
+
return /* @__PURE__ */ i.jsx("label", A(j({ htmlFor: o, className: P("checkbox__label", s) }, a), { children: r }));
|
|
2531
|
+
}, je = (e) => {
|
|
2527
2532
|
var t = e, {
|
|
2528
2533
|
id: s,
|
|
2529
2534
|
name: r,
|
|
2530
|
-
isPending:
|
|
2535
|
+
isPending: a = !1,
|
|
2531
2536
|
variant: o = "neutral",
|
|
2532
2537
|
hasError: l = !1,
|
|
2533
2538
|
single: c,
|
|
2534
|
-
className:
|
|
2535
|
-
children:
|
|
2539
|
+
className: m,
|
|
2540
|
+
children: C
|
|
2536
2541
|
} = t, u = O(t, [
|
|
2537
2542
|
"id",
|
|
2538
2543
|
"name",
|
|
@@ -2543,10 +2548,10 @@ var xi = (e) => {
|
|
|
2543
2548
|
"className",
|
|
2544
2549
|
"children"
|
|
2545
2550
|
]);
|
|
2546
|
-
const
|
|
2551
|
+
const b = d.useRef(null);
|
|
2547
2552
|
return d.useEffect(() => {
|
|
2548
|
-
|
|
2549
|
-
}, [
|
|
2553
|
+
b.current && (a ? b.current.indeterminate = !0 : b.current.indeterminate = !1);
|
|
2554
|
+
}, [a]), /* @__PURE__ */ i.jsxs(
|
|
2550
2555
|
"div",
|
|
2551
2556
|
{
|
|
2552
2557
|
className: P("checkbox", o && `checkbox--${o}`, l && "checkbox--error"),
|
|
@@ -2557,84 +2562,84 @@ var xi = (e) => {
|
|
|
2557
2562
|
id: s,
|
|
2558
2563
|
name: r,
|
|
2559
2564
|
type: "checkbox",
|
|
2560
|
-
ref:
|
|
2561
|
-
className: P("checkbox__input",
|
|
2565
|
+
ref: b,
|
|
2566
|
+
className: P("checkbox__input", m),
|
|
2562
2567
|
value: c ? "true" : ""
|
|
2563
2568
|
}, u)
|
|
2564
2569
|
),
|
|
2565
|
-
|
|
2566
|
-
/* @__PURE__ */ i.jsx(
|
|
2570
|
+
a ? /* @__PURE__ */ i.jsx(si, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ i.jsx(Kr, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
|
|
2571
|
+
/* @__PURE__ */ i.jsx(bi, { id: s, name: r, children: C })
|
|
2567
2572
|
]
|
|
2568
2573
|
}
|
|
2569
2574
|
);
|
|
2570
2575
|
};
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
var
|
|
2576
|
-
var t = e, { type: s = "div", className: r, children:
|
|
2577
|
-
return d.createElement(s, j({ className: P("dialog__body", r) }, o),
|
|
2578
|
-
},
|
|
2579
|
-
var t = e, { className: s, children: r, shouldAnimate:
|
|
2580
|
-
const { ref: l, defaultOpen: c, isModal:
|
|
2576
|
+
je.Content = Ci;
|
|
2577
|
+
je.Label = ji;
|
|
2578
|
+
je.Hint = xi;
|
|
2579
|
+
je.Error = Error;
|
|
2580
|
+
var _i = (e) => {
|
|
2581
|
+
var t = e, { type: s = "div", className: r, children: a } = t, o = O(t, ["type", "className", "children"]);
|
|
2582
|
+
return d.createElement(s, j({ className: P("dialog__body", r) }, o), a);
|
|
2583
|
+
}, Lt = () => document.body.style.removeProperty("overflow"), Yt = (e) => e.preventDefault(), Ei = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])', Si = (e) => {
|
|
2584
|
+
var t = e, { className: s, children: r, shouldAnimate: a = !0 } = t, o = O(t, ["className", "children", "shouldAnimate"]);
|
|
2585
|
+
const { ref: l, defaultOpen: c, isModal: m, onClose: C } = nt();
|
|
2581
2586
|
return d.useEffect(() => {
|
|
2582
2587
|
const u = l == null ? void 0 : l.current;
|
|
2583
2588
|
if (u != null && u.open) {
|
|
2584
|
-
const
|
|
2585
|
-
if (!(
|
|
2589
|
+
const b = u.querySelectorAll(Ei), v = b[0], f = b[b.length - 1], w = (E) => {
|
|
2590
|
+
if (!(E.key === "Tab"))
|
|
2586
2591
|
return;
|
|
2587
|
-
|
|
2592
|
+
E.shiftKey ? document.activeElement === v && (f.focus(), E.preventDefault()) : document.activeElement === f && (v.focus(), E.preventDefault());
|
|
2588
2593
|
};
|
|
2589
|
-
return document.body.style.overflow = "hidden", u.addEventListener("keydown", w), window.addEventListener("popstate", () =>
|
|
2590
|
-
u.removeEventListener("keydown", w), window.removeEventListener("popstate", () =>
|
|
2594
|
+
return document.body.style.overflow = "hidden", u.addEventListener("keydown", w), window.addEventListener("popstate", () => Lt()), () => {
|
|
2595
|
+
u.removeEventListener("keydown", w), window.removeEventListener("popstate", () => Lt());
|
|
2591
2596
|
};
|
|
2592
2597
|
}
|
|
2593
2598
|
}, [l]), d.useEffect(() => {
|
|
2594
2599
|
const u = l == null ? void 0 : l.current;
|
|
2595
2600
|
if (!u)
|
|
2596
2601
|
return;
|
|
2597
|
-
if (c && (u.removeAttribute("open"), u.showModal(), u.focus()),
|
|
2598
|
-
return u.addEventListener("cancel",
|
|
2599
|
-
const
|
|
2600
|
-
const { top: w, right:
|
|
2601
|
-
S && !(
|
|
2602
|
+
if (c && (u.removeAttribute("open"), u.showModal(), u.focus()), m)
|
|
2603
|
+
return u.addEventListener("cancel", Yt), () => u.removeEventListener("cancel", Yt);
|
|
2604
|
+
const b = ({ clientX: v, clientY: f }) => {
|
|
2605
|
+
const { top: w, right: E, bottom: y, left: g } = u.getBoundingClientRect(), S = 0 < f && 0 < v, _ = w < f && f < y, k = g < v && v < E;
|
|
2606
|
+
S && !(_ && k) && C();
|
|
2602
2607
|
};
|
|
2603
|
-
return u.addEventListener("cancel",
|
|
2604
|
-
u.removeEventListener("cancel",
|
|
2608
|
+
return u.addEventListener("cancel", C), u.addEventListener("mousedown", b), () => {
|
|
2609
|
+
u.removeEventListener("cancel", C), u.removeEventListener("mousedown", b);
|
|
2605
2610
|
};
|
|
2606
|
-
}, [l,
|
|
2611
|
+
}, [l, m, C, c]), /* @__PURE__ */ i.jsx(
|
|
2607
2612
|
"dialog",
|
|
2608
2613
|
A(j({
|
|
2609
2614
|
ref: l,
|
|
2610
2615
|
open: c,
|
|
2611
|
-
"aria-modal": !!
|
|
2616
|
+
"aria-modal": !!m,
|
|
2612
2617
|
"aria-labelledby": "dialogTitle",
|
|
2613
|
-
className: P("dialog",
|
|
2618
|
+
className: P("dialog", a && "dialog--animated", s)
|
|
2614
2619
|
}, o), {
|
|
2615
2620
|
children: r
|
|
2616
2621
|
})
|
|
2617
2622
|
);
|
|
2618
|
-
},
|
|
2619
|
-
const
|
|
2623
|
+
}, Ps = d.createContext(void 0), Ai = ({ defaultOpen: e, onClose: t, isModal: s, children: r }) => {
|
|
2624
|
+
const a = d.useRef(null), o = d.useRef(t), l = d.useCallback(() => {
|
|
2620
2625
|
var c;
|
|
2621
|
-
|
|
2622
|
-
}, [
|
|
2623
|
-
return /* @__PURE__ */ i.jsx(
|
|
2624
|
-
},
|
|
2625
|
-
const e = d.useContext(
|
|
2626
|
+
Lt(), (c = a.current) == null || c.close(), o.current && (o == null || o.current());
|
|
2627
|
+
}, [a]);
|
|
2628
|
+
return /* @__PURE__ */ i.jsx(Ps.Provider, { value: { ref: a, defaultOpen: e, isModal: s, onClose: l }, children: r });
|
|
2629
|
+
}, nt = () => {
|
|
2630
|
+
const e = d.useContext(Ps);
|
|
2626
2631
|
if (!e)
|
|
2627
2632
|
throw new Error("Dialog compound components can not be rendered outside of Dialog");
|
|
2628
2633
|
return e;
|
|
2629
2634
|
}, Pi = (e) => {
|
|
2630
2635
|
var t = e, { children: s } = t, r = O(t, ["children"]);
|
|
2631
|
-
const { onClose:
|
|
2632
|
-
return /* @__PURE__ */ i.jsx(
|
|
2633
|
-
},
|
|
2634
|
-
var s = e, { className: r } = s,
|
|
2635
|
-
const { onClose: o } =
|
|
2636
|
+
const { onClose: a } = nt();
|
|
2637
|
+
return /* @__PURE__ */ i.jsx(it, A(j({ onClick: a }, r), { children: s }));
|
|
2638
|
+
}, Ns = d.forwardRef((e, t) => {
|
|
2639
|
+
var s = e, { className: r } = s, a = O(s, ["className"]);
|
|
2640
|
+
const { onClose: o } = nt();
|
|
2636
2641
|
return /* @__PURE__ */ i.jsx(
|
|
2637
|
-
|
|
2642
|
+
it,
|
|
2638
2643
|
j({
|
|
2639
2644
|
type: "submit",
|
|
2640
2645
|
ref: t,
|
|
@@ -2643,16 +2648,16 @@ var Ei = (e) => {
|
|
|
2643
2648
|
iconLeft: /* @__PURE__ */ i.jsx(Vr, {}),
|
|
2644
2649
|
variant: "icon--secondary",
|
|
2645
2650
|
className: P("dialog__close button--icon", r)
|
|
2646
|
-
},
|
|
2651
|
+
}, a)
|
|
2647
2652
|
);
|
|
2648
2653
|
});
|
|
2649
|
-
|
|
2654
|
+
Ns.displayName = "Close";
|
|
2650
2655
|
var Ni = (e) => {
|
|
2651
|
-
var t = e, { className: s, children: r } = t,
|
|
2652
|
-
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("dialog__footer", s) },
|
|
2653
|
-
},
|
|
2654
|
-
var t = e, { icon: s, children: r, className:
|
|
2655
|
-
const { ref: l } =
|
|
2656
|
+
var t = e, { className: s, children: r } = t, a = O(t, ["className", "children"]);
|
|
2657
|
+
return /* @__PURE__ */ i.jsx("div", A(j({ className: P("dialog__footer", s) }, a), { children: r }));
|
|
2658
|
+
}, ki = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "dialog__header", children: e }), Mi = (e) => {
|
|
2659
|
+
var t = e, { icon: s, children: r, className: a } = t, o = O(t, ["icon", "children", "className"]);
|
|
2660
|
+
const { ref: l } = nt(), c = d.useRef(null);
|
|
2656
2661
|
return d.useEffect(() => {
|
|
2657
2662
|
l != null && l.current && l.current.focus();
|
|
2658
2663
|
}, [l]), /* @__PURE__ */ i.jsxs(
|
|
@@ -2661,7 +2666,7 @@ var Ni = (e) => {
|
|
|
2661
2666
|
tabIndex: 0,
|
|
2662
2667
|
ref: c,
|
|
2663
2668
|
id: "dialogTitle",
|
|
2664
|
-
className: P("dialog__header__title",
|
|
2669
|
+
className: P("dialog__header__title", a)
|
|
2665
2670
|
}, o), {
|
|
2666
2671
|
children: [
|
|
2667
2672
|
s && /* @__PURE__ */ i.jsx("span", { className: "dialog__header__icon", children: s }),
|
|
@@ -2669,96 +2674,96 @@ var Ni = (e) => {
|
|
|
2669
2674
|
]
|
|
2670
2675
|
})
|
|
2671
2676
|
);
|
|
2672
|
-
},
|
|
2677
|
+
}, Oi = (e) => {
|
|
2673
2678
|
var t = e, { children: s } = t, r = O(t, ["children"]);
|
|
2674
|
-
const { ref:
|
|
2675
|
-
return /* @__PURE__ */ i.jsx(
|
|
2679
|
+
const { ref: a } = nt();
|
|
2680
|
+
return /* @__PURE__ */ i.jsx(it, A(j({ onClick: () => {
|
|
2676
2681
|
var o;
|
|
2677
|
-
return (o =
|
|
2682
|
+
return (o = a == null ? void 0 : a.current) == null ? void 0 : o.showModal();
|
|
2678
2683
|
} }, r), { children: s }));
|
|
2679
|
-
}, H = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(
|
|
2680
|
-
H.Trigger =
|
|
2684
|
+
}, H = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(Ai, { defaultOpen: !!e, isModal: t, onClose: r, children: s });
|
|
2685
|
+
H.Trigger = Oi;
|
|
2681
2686
|
H.Root = Si;
|
|
2682
|
-
H.Title =
|
|
2683
|
-
H.Header =
|
|
2684
|
-
H.Body =
|
|
2687
|
+
H.Title = Mi;
|
|
2688
|
+
H.Header = ki;
|
|
2689
|
+
H.Body = _i;
|
|
2685
2690
|
H.Footer = Ni;
|
|
2686
2691
|
H.Button = Pi;
|
|
2687
|
-
H.Close =
|
|
2688
|
-
var
|
|
2692
|
+
H.Close = Ns;
|
|
2693
|
+
var ks = d.createContext(void 0), Li = ({
|
|
2689
2694
|
id: e,
|
|
2690
2695
|
position: t,
|
|
2691
2696
|
isOpen: s,
|
|
2692
2697
|
setIsOpen: r,
|
|
2693
|
-
activeItemIndex:
|
|
2698
|
+
activeItemIndex: a,
|
|
2694
2699
|
setActiveItemIndex: o,
|
|
2695
2700
|
clearActiveItemIndex: l,
|
|
2696
2701
|
triggerRef: c,
|
|
2697
|
-
contentRef:
|
|
2698
|
-
children:
|
|
2702
|
+
contentRef: m,
|
|
2703
|
+
children: C
|
|
2699
2704
|
}) => /* @__PURE__ */ i.jsx(
|
|
2700
|
-
|
|
2705
|
+
ks.Provider,
|
|
2701
2706
|
{
|
|
2702
2707
|
value: {
|
|
2703
2708
|
id: e,
|
|
2704
2709
|
position: t,
|
|
2705
2710
|
isOpen: s,
|
|
2706
2711
|
setIsOpen: r,
|
|
2707
|
-
activeItemIndex:
|
|
2712
|
+
activeItemIndex: a,
|
|
2708
2713
|
setActiveItemIndex: o,
|
|
2709
2714
|
clearActiveItemIndex: l,
|
|
2710
2715
|
triggerRef: c,
|
|
2711
|
-
contentRef:
|
|
2716
|
+
contentRef: m
|
|
2712
2717
|
},
|
|
2713
|
-
children:
|
|
2718
|
+
children: C
|
|
2714
2719
|
}
|
|
2715
|
-
),
|
|
2716
|
-
const e = d.useContext(
|
|
2720
|
+
), Ms = () => {
|
|
2721
|
+
const e = d.useContext(ks);
|
|
2717
2722
|
if (e === void 0)
|
|
2718
2723
|
throw new Error("useMenu must be used within a MenuProvider");
|
|
2719
2724
|
return e;
|
|
2720
|
-
},
|
|
2725
|
+
}, Fi = ({ as: e, children: t }) => {
|
|
2721
2726
|
const {
|
|
2722
2727
|
id: s,
|
|
2723
2728
|
position: r,
|
|
2724
|
-
isOpen:
|
|
2729
|
+
isOpen: a,
|
|
2725
2730
|
setIsOpen: o,
|
|
2726
2731
|
activeItemIndex: l,
|
|
2727
2732
|
setActiveItemIndex: c,
|
|
2728
|
-
clearActiveItemIndex:
|
|
2729
|
-
triggerRef:
|
|
2733
|
+
clearActiveItemIndex: m,
|
|
2734
|
+
triggerRef: C,
|
|
2730
2735
|
contentRef: u
|
|
2731
|
-
} =
|
|
2732
|
-
var
|
|
2733
|
-
if (!
|
|
2736
|
+
} = Ms(), b = (v) => {
|
|
2737
|
+
var f;
|
|
2738
|
+
if (!a)
|
|
2734
2739
|
return;
|
|
2735
|
-
if (
|
|
2736
|
-
return
|
|
2737
|
-
const w =
|
|
2738
|
-
switch (
|
|
2740
|
+
if (v.key === "Escape")
|
|
2741
|
+
return m(), o(!1), (f = C.current) == null ? void 0 : f.focus();
|
|
2742
|
+
const w = v.shiftKey, E = Ls(u.current).length - 1;
|
|
2743
|
+
switch (v.key) {
|
|
2739
2744
|
case "Tab": {
|
|
2740
2745
|
if (w && l !== 0)
|
|
2741
|
-
return
|
|
2742
|
-
if (!w && l !==
|
|
2743
|
-
|
|
2744
|
-
const
|
|
2745
|
-
return c(Math.min(
|
|
2746
|
+
return v.preventDefault(), c(l ? Math.max(0, l - 1) : 0);
|
|
2747
|
+
if (!w && l !== E) {
|
|
2748
|
+
v.preventDefault();
|
|
2749
|
+
const y = l !== void 0 ? l + 1 : 0;
|
|
2750
|
+
return c(Math.min(E, y));
|
|
2746
2751
|
}
|
|
2747
2752
|
break;
|
|
2748
2753
|
}
|
|
2749
2754
|
case "ArrowUp":
|
|
2750
2755
|
case "ArrowLeft":
|
|
2751
|
-
return
|
|
2756
|
+
return v.preventDefault(), c(l ? Math.max(0, l - 1) : 0);
|
|
2752
2757
|
case "ArrowDown":
|
|
2753
2758
|
case "ArrowRight": {
|
|
2754
|
-
|
|
2755
|
-
const
|
|
2756
|
-
return c(Math.min(
|
|
2759
|
+
v.preventDefault();
|
|
2760
|
+
const y = l !== void 0 ? l + 1 : 0;
|
|
2761
|
+
return c(Math.min(E, y));
|
|
2757
2762
|
}
|
|
2758
2763
|
case "Home":
|
|
2759
|
-
return
|
|
2764
|
+
return v.preventDefault(), c(0);
|
|
2760
2765
|
case "End":
|
|
2761
|
-
return
|
|
2766
|
+
return v.preventDefault(), c(E);
|
|
2762
2767
|
}
|
|
2763
2768
|
};
|
|
2764
2769
|
return e ? d.createElement(
|
|
@@ -2766,8 +2771,8 @@ var Fs = d.createContext(void 0), Fi = ({
|
|
|
2766
2771
|
{
|
|
2767
2772
|
id: `${s}-content`,
|
|
2768
2773
|
ref: u,
|
|
2769
|
-
className: P("menu__list", `menu__list--${r}`,
|
|
2770
|
-
onKeyDown:
|
|
2774
|
+
className: P("menu__list", `menu__list--${r}`, a && "menu__list--active"),
|
|
2775
|
+
onKeyDown: b
|
|
2771
2776
|
},
|
|
2772
2777
|
t
|
|
2773
2778
|
) : (
|
|
@@ -2777,22 +2782,22 @@ var Fs = d.createContext(void 0), Fi = ({
|
|
|
2777
2782
|
{
|
|
2778
2783
|
id: `${s}-content`,
|
|
2779
2784
|
ref: u,
|
|
2780
|
-
className: P("menu__list", `menu__list--${r}`,
|
|
2781
|
-
onKeyDown:
|
|
2785
|
+
className: P("menu__list", `menu__list--${r}`, a && "menu__list--active"),
|
|
2786
|
+
onKeyDown: b,
|
|
2782
2787
|
children: t
|
|
2783
2788
|
}
|
|
2784
2789
|
)
|
|
2785
2790
|
);
|
|
2786
|
-
},
|
|
2787
|
-
var t = e, { children: s, className: r } = t,
|
|
2788
|
-
return /* @__PURE__ */ i.jsx("li", A(j({},
|
|
2789
|
-
},
|
|
2790
|
-
const { id: s, isOpen: r, setIsOpen:
|
|
2791
|
-
o(),
|
|
2792
|
-
},
|
|
2791
|
+
}, Ri = (e) => {
|
|
2792
|
+
var t = e, { children: s, className: r } = t, a = O(t, ["children", "className"]);
|
|
2793
|
+
return /* @__PURE__ */ i.jsx("li", A(j({}, a), { className: P("menu__list-item", r), children: s }));
|
|
2794
|
+
}, Os = ({ children: e, className: t }) => {
|
|
2795
|
+
const { id: s, isOpen: r, setIsOpen: a, clearActiveItemIndex: o, setActiveItemIndex: l, triggerRef: c } = Ms(), m = () => {
|
|
2796
|
+
o(), a((u) => !u), r || l(0);
|
|
2797
|
+
}, C = (u) => {
|
|
2793
2798
|
if (r) {
|
|
2794
2799
|
if (u.key === "Escape")
|
|
2795
|
-
return o(),
|
|
2800
|
+
return o(), a(!1);
|
|
2796
2801
|
u.key === "ArrowDown" && (u.preventDefault(), l(0));
|
|
2797
2802
|
}
|
|
2798
2803
|
};
|
|
@@ -2800,40 +2805,40 @@ var Fs = d.createContext(void 0), Fi = ({
|
|
|
2800
2805
|
id: `${s}-trigger`,
|
|
2801
2806
|
ref: c,
|
|
2802
2807
|
className: P("menu__trigger", t),
|
|
2803
|
-
onClick:
|
|
2804
|
-
onKeyDown:
|
|
2808
|
+
onClick: m,
|
|
2809
|
+
onKeyDown: C,
|
|
2805
2810
|
"aria-expanded": r,
|
|
2806
2811
|
"aria-controls": `${s}-content`
|
|
2807
2812
|
});
|
|
2808
2813
|
};
|
|
2809
|
-
|
|
2810
|
-
var
|
|
2811
|
-
var t = e, { type: s, id: r, position:
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
const
|
|
2815
|
-
w(void 0),
|
|
2816
|
-
}, S = (
|
|
2814
|
+
Os.displayName = "Trigger";
|
|
2815
|
+
var Ls = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsByTagName("ul")).reduce((s, r) => [...s, ...Array.from(r.getElementsByTagName("li"))], []) : [], Y = (e) => {
|
|
2816
|
+
var t = e, { type: s, id: r, position: a = "right", children: o, className: l } = t, c = O(t, ["type", "id", "position", "children", "className"]);
|
|
2817
|
+
const m = d.useRef(null), C = d.useRef(null), u = d.useRef(null), [b, v] = d.useState(!1), [f, w] = d.useState(), [E, y] = d.useState(f);
|
|
2818
|
+
f !== E && f !== void 0 && u.current && (Ls(u.current)[f].firstChild.focus(), y(f));
|
|
2819
|
+
const g = () => {
|
|
2820
|
+
w(void 0), y(void 0);
|
|
2821
|
+
}, S = (_) => {
|
|
2817
2822
|
var k;
|
|
2818
|
-
((k =
|
|
2823
|
+
((k = m.current) == null ? void 0 : k.contains(_.relatedTarget)) || (g(), v(!1));
|
|
2819
2824
|
};
|
|
2820
2825
|
return /* @__PURE__ */ i.jsx(
|
|
2821
|
-
|
|
2826
|
+
Li,
|
|
2822
2827
|
{
|
|
2823
2828
|
id: r,
|
|
2824
|
-
position:
|
|
2825
|
-
isOpen:
|
|
2826
|
-
setIsOpen:
|
|
2827
|
-
activeItemIndex:
|
|
2829
|
+
position: a,
|
|
2830
|
+
isOpen: b,
|
|
2831
|
+
setIsOpen: v,
|
|
2832
|
+
activeItemIndex: f,
|
|
2828
2833
|
setActiveItemIndex: w,
|
|
2829
|
-
clearActiveItemIndex:
|
|
2830
|
-
triggerRef:
|
|
2834
|
+
clearActiveItemIndex: g,
|
|
2835
|
+
triggerRef: C,
|
|
2831
2836
|
contentRef: u,
|
|
2832
2837
|
children: d.createElement(
|
|
2833
2838
|
s,
|
|
2834
2839
|
A(j({}, c), {
|
|
2835
2840
|
id: r,
|
|
2836
|
-
ref:
|
|
2841
|
+
ref: m,
|
|
2837
2842
|
className: `menu ${l || ""}`,
|
|
2838
2843
|
onBlur: S
|
|
2839
2844
|
}),
|
|
@@ -2842,29 +2847,29 @@ var Ts = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsBy
|
|
|
2842
2847
|
}
|
|
2843
2848
|
);
|
|
2844
2849
|
};
|
|
2845
|
-
Y.Trigger =
|
|
2846
|
-
Y.Content =
|
|
2847
|
-
Y.Item =
|
|
2850
|
+
Y.Trigger = Os;
|
|
2851
|
+
Y.Content = Fi;
|
|
2852
|
+
Y.Item = Ri;
|
|
2848
2853
|
d.createContext(void 0);
|
|
2849
|
-
var
|
|
2850
|
-
[...new Set(
|
|
2854
|
+
var Di = (/* @__PURE__ */ new Map()).set("BE", "32").set("FR", "33").set("NL", "31").set("LU", "352").set("DE", "49").set("CA", "1").set("PR", "1").set("TC", "1").set("US", "1").set("BS", "1242").set("BB", "1246").set("AI", "1264").set("AG", "1268").set("KY", "1345").set("BM", "1441").set("GD", "1473").set("MS", "1664").set("GU", "1671").set("LC", "1758").set("DM", "1767").set("VC", "1784").set("DO", "1809").set("TT", "1868").set("KN", "1869").set("JM", "1876").set("EG", "20").set("SS", "211").set("MA", "212").set("DZ", "213").set("TN", "216").set("LY", "218").set("GM", "220").set("SN", "221").set("MR", "222").set("ML", "223").set("GN", "224").set("CI", "225").set("BF", "226").set("NE", "227").set("TG", "228").set("BJ", "229").set("MU", "230").set("LR", "231").set("SL", "232").set("GH", "233").set("NG", "234").set("TD", "235").set("CF", "236").set("CM", "237").set("CV", "238").set("ST", "239").set("GQ", "240").set("GA", "241").set("CG", "242").set("CD", "243").set("AO", "244").set("GW", "245").set("SC", "248").set("SD", "249").set("RW", "250").set("ET", "251").set("SO", "252").set("DJ", "253").set("KE", "254").set("TZ", "255").set("UG", "256").set("BI", "257").set("MZ", "258").set("ZM", "260").set("MG", "261").set("RE", "262").set("ZW", "263").set("NA", "264").set("MW", "265").set("LS", "266").set("BW", "267").set("SZ", "268").set("KM", "269").set("ZA", "27").set("VG", "284").set("ER", "291").set("AW", "297").set("FO", "298").set("GL", "299").set("GR", "30").set("ES", "34").set("GI", "350").set("PT", "351").set("IE", "353").set("IS", "354").set("AL", "355").set("MT", "356").set("CY", "357").set("FI", "358").set("BG", "359").set("HU", "36").set("LT", "370").set("LV", "371").set("EE", "372").set("MD", "373").set("AM", "374").set("BY", "375").set("AD", "376").set("MC", "377").set("SM", "378").set("UA", "380").set("RS", "381").set("ME", "382").set("HR", "385").set("SI", "386").set("BA", "387").set("MK", "389").set("IT", "39").set("RO", "40").set("CH", "41").set("CZ", "420").set("SK", "421").set("LI", "423").set("AT", "43").set("GB", "44").set("DK", "45").set("SE", "46").set("NO", "47").set("PL", "48").set("FK", "500").set("BZ", "501").set("GT", "502").set("SV", "503").set("HN", "504").set("NI", "505").set("CR", "506").set("PA", "507").set("PM", "508").set("HT", "509").set("PE", "51").set("MX", "52").set("CU", "53").set("AR", "54").set("BR", "55").set("CL", "56").set("CO", "57").set("VE", "58").set("GP", "590").set("BO", "591").set("GY", "592").set("EC", "593").set("FG", "594").set("PY", "595").set("MQ", "596").set("SR", "597").set("UY", "598").set("CW", "599").set("AN", "599").set("MY", "60").set("AU", "61").set("ID", "62").set("PH", "63").set("NZ", "64").set("SG", "65").set("TH", "66").set("TP", "670").set("BN", "673").set("PG", "675").set("TO", "676").set("SB", "677").set("VU", "678").set("FJ", "679").set("PW", "680").set("CK", "682").set("NU", "683").set("AS", "684").set("WS", "685").set("KI", "686").set("NC", "687").set("TV", "688").set("PF", "689").set("FM", "691").set("KZ", "7").set("RU", "7").set("JP", "81").set("KR", "82").set("VN", "84").set("KP", "850").set("HK", "852").set("MO", "853").set("KH", "855").set("LA", "856").set("CN", "86").set("BD", "880").set("TW", "886").set("TR", "90").set("IN", "91").set("PK", "92").set("AF", "93").set("LK", "94").set("MM", "95").set("MV", "960").set("LB", "961").set("JO", "962").set("SY", "963").set("IQ", "964").set("KW", "965").set("SA", "966").set("YE", "967").set("OM", "968").set("PS", "970").set("AE", "971").set("IL", "972").set("BH", "973").set("QA", "974").set("BT", "975").set("MN", "976").set("NP", "977").set("IR", "98").set("TK", "992").set("TM", "993").set("AZ", "994").set("GE", "995").set("KG", "996").set("UZ", "998");
|
|
2855
|
+
[...new Set(Di.values())].map((e) => ({
|
|
2851
2856
|
label: `+${e}`,
|
|
2852
2857
|
value: e
|
|
2853
2858
|
}));
|
|
2854
2859
|
d.createContext(void 0);
|
|
2855
2860
|
d.createContext(void 0);
|
|
2856
|
-
var
|
|
2857
|
-
const
|
|
2861
|
+
var pt = /* @__PURE__ */ ((e) => (e[e.categoriesVegetables = 0] = "categoriesVegetables", e[e.categoriesMeat = 1] = "categoriesMeat", e[e.categoriesFish = 2] = "categoriesFish", e[e.categoriesDairy = 3] = "categoriesDairy", e[e.categoriesBreakfast = 4] = "categoriesBreakfast", e[e.categoriesSnacks = 5] = "categoriesSnacks", e[e.categoriesCandy = 6] = "categoriesCandy", e[e.categoriesNonFood = 7] = "categoriesNonFood", e[e.categoriesDryFood = 8] = "categoriesDryFood", e[e.categoriesTins = 9] = "categoriesTins", e[e.categoriesGrid = 10] = "categoriesGrid", e[e.categoriesSoda = 11] = "categoriesSoda", e[e.categoriesBakery = 12] = "categoriesBakery", e[e.categoriesWine = 13] = "categoriesWine", e[e.categoriesBaby = 14] = "categoriesBaby", e[e.categoriesDiet = 15] = "categoriesDiet", e[e.categoriesHygiene = 16] = "categoriesHygiene", e[e.categoriesCleaning = 17] = "categoriesCleaning", e[e.categoriesPets = 18] = "categoriesPets", e[e.categoriesFreezer = 19] = "categoriesFreezer", e[e.categoriesBbq = 20] = "categoriesBbq", e[e.categoriesMealbox = 21] = "categoriesMealbox", e[e.categoriesBrik = 22] = "categoriesBrik", e[e.categoriesGranen = 23] = "categoriesGranen", e[e.categoriesConserve = 24] = "categoriesConserve", e[e.categoriesHome = 25] = "categoriesHome", e[e.categoriesEaster = 26] = "categoriesEaster", e[e.categoriesOnlinePromo = 27] = "categoriesOnlinePromo", e[e.categoriesSportFood = 28] = "categoriesSportFood", e[e.categoriesClothing = 29] = "categoriesClothing", e[e.categoriesEnergy = 30] = "categoriesEnergy", e[e.categoriesDeskAndTravel = 31] = "categoriesDeskAndTravel", e[e.categoriesCigarette = 32] = "categoriesCigarette", e[e.categoriesFood = 33] = "categoriesFood", e[e.categoriesChild = 34] = "categoriesChild", e[e.categoriesPuzzle = 35] = "categoriesPuzzle", e[e.categoriesToys = 36] = "categoriesToys", e[e.categoriesCar = 37] = "categoriesCar", e[e.categoriesPlaceholder = 38] = "categoriesPlaceholder", e[e.categoriesFuel = 39] = "categoriesFuel", e[e.categoriesCarAndBike = 40] = "categoriesCarAndBike", e[e.categoriesToyAndHobby = 41] = "categoriesToyAndHobby", e[e.categoriesMultimedia = 42] = "categoriesMultimedia", e[e.categoriesParty = 43] = "categoriesParty", e[e.toolsPay = 44] = "toolsPay", e[e.toolsReceipt = 45] = "toolsReceipt", e[e.toolsFuel = 46] = "toolsFuel", e[e.toolsStoreLocator = 47] = "toolsStoreLocator", e[e.toolsStats = 48] = "toolsStats", e[e.toolsShowXtraOld = 49] = "toolsShowXtraOld", e[e.toolsShowXtraNew = 50] = "toolsShowXtraNew", e[e.toolsScan2 = 51] = "toolsScan2", e[e.toolsRecipes2 = 52] = "toolsRecipes2", e[e.toolsWarranty = 53] = "toolsWarranty", e[e.toolsCoupons = 54] = "toolsCoupons", e[e.toolsFavoriteInactive = 55] = "toolsFavoriteInactive", e[e.toolsFavoriteActive = 56] = "toolsFavoriteActive", e[e.toolsAssortment = 57] = "toolsAssortment", e[e.toolsPromo = 58] = "toolsPromo", e[e.fuelCng = 59] = "fuelCng", e[e.fuelE5 = 60] = "fuelE5", e[e.fuelAdblue = 61] = "fuelAdblue", e[e.fuelB7 = 62] = "fuelB7", e[e.fuelH2 = 63] = "fuelH2", e[e.fuelE10 = 64] = "fuelE10", e[e.fuelFreeTireInflation = 65] = "fuelFreeTireInflation", e[e.functionalClose = 66] = "functionalClose", e[e.functionalBack = 67] = "functionalBack", e[e.functionalSearch = 68] = "functionalSearch", e[e.functionalEdit = 69] = "functionalEdit", e[e.functionalShare = 70] = "functionalShare", e[e.functionalLocation = 71] = "functionalLocation", e[e.functionalTrash = 72] = "functionalTrash", e[e.functionalCamera = 73] = "functionalCamera", e[e.functionalPhone = 74] = "functionalPhone", e[e.functionalPushNotifications = 75] = "functionalPushNotifications", e[e.functionalMail = 76] = "functionalMail", e[e.functionalGift = 77] = "functionalGift", e[e.functionalPresent = 78] = "functionalPresent", e[e.functionalLoading = 79] = "functionalLoading", e[e.functionalChevronRight = 80] = "functionalChevronRight", e[e.functionalCheck = 81] = "functionalCheck", e[e.functionalChevronDown = 82] = "functionalChevronDown", e[e.functionalChevronUp = 83] = "functionalChevronUp", e[e.functionalPlus = 84] = "functionalPlus", e[e.functionalReset = 85] = "functionalReset", e[e.functionalDownload = 86] = "functionalDownload", e[e.functionalExport = 87] = "functionalExport", e[e.functionalCustomerService = 88] = "functionalCustomerService", e[e.functionalTruck = 89] = "functionalTruck", e[e.functionalBox = 90] = "functionalBox", e[e.functionalEllipsis = 91] = "functionalEllipsis", e[e.functionalLocationHome = 92] = "functionalLocationHome", e[e.functionalLocationPickup = 93] = "functionalLocationPickup", e[e.functionalAccount = 94] = "functionalAccount", e[e.functionalPrivacy = 95] = "functionalPrivacy", e[e.functionalSettings = 96] = "functionalSettings", e[e.functionalUserInfo = 97] = "functionalUserInfo", e[e.functionalPinOutlines = 98] = "functionalPinOutlines", e[e.functionalCalendar = 99] = "functionalCalendar", e[e.functionalMinus = 100] = "functionalMinus", e[e.functionalLifestyle = 101] = "functionalLifestyle", e[e.functionalSms = 102] = "functionalSms", e[e.functionalSwitch = 103] = "functionalSwitch", e[e.functionalSorting = 104] = "functionalSorting", e[e.functionalWarningCircle = 105] = "functionalWarningCircle", e[e.functionalQuestionCircle = 106] = "functionalQuestionCircle", e[e.functionalErrorCircle = 107] = "functionalErrorCircle", e[e.functionalSuccessCircle = 108] = "functionalSuccessCircle", e[e.functionalMessage = 109] = "functionalMessage", e[e.functionalExternalLink = 110] = "functionalExternalLink", e[e.functionalAddToList = 111] = "functionalAddToList", e[e.functionalShoppingcart = 112] = "functionalShoppingcart", e[e.functionalFilter = 113] = "functionalFilter", e[e.functionalLocate = 114] = "functionalLocate", e[e.functionalBarcode = 115] = "functionalBarcode", e[e.functionalClock = 116] = "functionalClock", e[e.functionalHistory = 117] = "functionalHistory", e[e.functionalShops = 118] = "functionalShops", e[e.functionalAddUser = 119] = "functionalAddUser", e[e.functionalOther = 120] = "functionalOther", e[e.functionalInAppNotifications = 121] = "functionalInAppNotifications", e[e.functionalExit = 122] = "functionalExit", e[e.functionalShared = 123] = "functionalShared", e[e.functionalThumbsup = 124] = "functionalThumbsup", e[e.functionalDiscount = 125] = "functionalDiscount", e[e.functionalPercentage = 126] = "functionalPercentage", e[e.functionalList = 127] = "functionalList", e[e.functionalMapLocation = 128] = "functionalMapLocation", e[e.functionalNoConnection = 129] = "functionalNoConnection", e[e.functionalSwap = 130] = "functionalSwap", e[e.functionalPiece = 131] = "functionalPiece", e[e.functionalWeight = 132] = "functionalWeight", e[e.functionalPack = 133] = "functionalPack", e[e.functionalCommunications = 134] = "functionalCommunications", e[e.functionalDeliveryAddresses = 135] = "functionalDeliveryAddresses", e[e["functional18+"] = 136] = "functional18+", e[e.functionalReadtime = 137] = "functionalReadtime", e[e.functionalCopy = 138] = "functionalCopy", e[e.functionalMessageField = 139] = "functionalMessageField", e[e.functionalNext = 140] = "functionalNext", e[e.functionalSave = 141] = "functionalSave", e[e.functionalLogin = 142] = "functionalLogin", e[e.functionalLogout = 143] = "functionalLogout", e[e.functionalWebsite = 144] = "functionalWebsite", e[e.functionalMenu = 145] = "functionalMenu", e[e.functionalRegister = 146] = "functionalRegister", e[e.functionalNews = 147] = "functionalNews", e[e.functionalTimer = 148] = "functionalTimer", e[e.functionalEyeShow = 149] = "functionalEyeShow", e[e.functionalMobilePay = 150] = "functionalMobilePay", e[e.functionalConnectionCable = 151] = "functionalConnectionCable", e[e.functionalDryCleaning = 152] = "functionalDryCleaning", e[e.functionalKiosk = 153] = "functionalKiosk", e[e.functionalConnectedDevice = 154] = "functionalConnectedDevice", e[e.functionalCookies = 155] = "functionalCookies", e[e.functionalViewFile = 156] = "functionalViewFile", e[e.functionalLastAdded = 157] = "functionalLastAdded", e[e.functionalFirstAdded = 158] = "functionalFirstAdded", e[e.functionalStoreLayout = 159] = "functionalStoreLayout", e[e.functionalBlock = 160] = "functionalBlock", e[e.functionalChecklist = 161] = "functionalChecklist", e[e.functionalCartCheckout = 162] = "functionalCartCheckout", e[e.functionalCartEdit = 163] = "functionalCartEdit", e[e.functionalEyeHidden = 164] = "functionalEyeHidden", e[e.functionalWarningCircleFilled = 165] = "functionalWarningCircleFilled", e[e.functionalErrorCircleFilled = 166] = "functionalErrorCircleFilled", e[e.functionalSuccessCircleFilled = 167] = "functionalSuccessCircleFilled", e[e.functionalPlusCircle = 168] = "functionalPlusCircle", e[e.functionalSpinner = 169] = "functionalSpinner", e[e.functionalEcoEarth = 170] = "functionalEcoEarth", e[e.functionalAlphaBeta = 171] = "functionalAlphaBeta", e[e.functionalEuro = 172] = "functionalEuro", e[e.functionalNumber = 173] = "functionalNumber", e[e.functionalIdea = 174] = "functionalIdea", e[e.functionalMultifactorAuthenticator = 175] = "functionalMultifactorAuthenticator", e[e.functionalPassword = 176] = "functionalPassword", e[e.functionalDiscountCode = 177] = "functionalDiscountCode", e))(pt || {});
|
|
2862
|
+
const Ti = "/icons/bouMenuIcons.svg", Ui = ({
|
|
2858
2863
|
bouIconId: e,
|
|
2859
2864
|
...t
|
|
2860
|
-
}) => /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i.jsx("use", { href: `${
|
|
2865
|
+
}) => /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i.jsx("use", { href: `${Ti}#${pt[e]}` }) }), fe = ({
|
|
2861
2866
|
className: e,
|
|
2862
2867
|
label: t,
|
|
2863
2868
|
mobileUrl: s,
|
|
2864
2869
|
desktopUrl: r,
|
|
2865
|
-
icon:
|
|
2870
|
+
icon: a
|
|
2866
2871
|
}) => {
|
|
2867
|
-
const o =
|
|
2872
|
+
const o = Ks(), l = () => typeof a == "string" && a in pt ? /* @__PURE__ */ i.jsx(Ui, { bouIconId: pt[a] }) : a;
|
|
2868
2873
|
return /* @__PURE__ */ i.jsxs(Y.Item, { className: e, children: [
|
|
2869
2874
|
(!o || o && !r) && /* @__PURE__ */ i.jsxs("a", { href: s, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2870
2875
|
l(),
|
|
@@ -2875,50 +2880,120 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2875
2880
|
t
|
|
2876
2881
|
] })
|
|
2877
2882
|
] });
|
|
2878
|
-
},
|
|
2879
|
-
|
|
2880
|
-
bouMenuItems: t,
|
|
2881
|
-
authenticationStatus: s,
|
|
2882
|
-
profile: r,
|
|
2883
|
-
children: n
|
|
2884
|
-
}) => /* @__PURE__ */ i.jsx(Us.Provider, { value: { position: e, bouMenuItems: t, authenticationStatus: s, profile: r }, children: n }), Gt = () => {
|
|
2885
|
-
const e = d.useContext(Us);
|
|
2883
|
+
}, Fs = d.createContext(void 0), Qi = ({ position: e, bouMenuItems: t, children: s }) => /* @__PURE__ */ i.jsx(Fs.Provider, { value: { position: e, bouMenuItems: t }, children: s }), Rs = () => {
|
|
2884
|
+
const e = d.useContext(Fs);
|
|
2886
2885
|
if (!e)
|
|
2887
2886
|
throw new Error("Authentication context can not be rendered outside of Authentication");
|
|
2888
2887
|
return e;
|
|
2889
|
-
},
|
|
2890
|
-
const e = d.useContext(
|
|
2888
|
+
}, Ds = d.createContext(void 0), Hi = ({ apiUrl: e, redirectUrl: t, children: s }) => /* @__PURE__ */ i.jsx(Ds.Provider, { value: { apiUrl: e, redirectUrl: t }, children: s }), Ut = () => {
|
|
2889
|
+
const e = d.useContext(Ds);
|
|
2891
2890
|
if (!e)
|
|
2892
2891
|
throw new Error("Api context can not be rendered outside of Api");
|
|
2893
2892
|
return e;
|
|
2894
|
-
},
|
|
2893
|
+
}, Ts = ({ apiUrl: e, redirectUrl: t, trackingInfo: s }) => {
|
|
2895
2894
|
const r = new URLSearchParams({ redirectUrl: t });
|
|
2896
2895
|
s && r.append("trackingInfo", s);
|
|
2897
|
-
const
|
|
2898
|
-
return { loginUrl:
|
|
2899
|
-
},
|
|
2900
|
-
const { apiUrl: e, redirectUrl: t } =
|
|
2901
|
-
return
|
|
2902
|
-
},
|
|
2903
|
-
const { apiUrl: e } =
|
|
2896
|
+
const a = `${e}/login?${r.toString()}`, o = `${e}/logout?${r.toString()}`;
|
|
2897
|
+
return { loginUrl: a, logoutUrl: o };
|
|
2898
|
+
}, yt = () => {
|
|
2899
|
+
const { apiUrl: e, redirectUrl: t } = Ut(), s = Gs();
|
|
2900
|
+
return Ts({ apiUrl: e, redirectUrl: t, trackingInfo: s });
|
|
2901
|
+
}, $i = () => {
|
|
2902
|
+
const { apiUrl: e } = Ut();
|
|
2903
|
+
return `${`${e}/xtra`}/authentication/v1/user/profile`;
|
|
2904
|
+
}, zt = (e) => e ? `+${e.countryCode} ${e.number}` : "", Jt = (e, t) => t == null ? void 0 : t.find((s) => s.type === e), Xt = ({ apiUrl: e, redirectUrl: t }) => {
|
|
2905
|
+
const { loginUrl: s } = Ts({ apiUrl: e, redirectUrl: t });
|
|
2906
|
+
window.location.replace(s);
|
|
2907
|
+
}, It = (e) => {
|
|
2908
|
+
if (!e)
|
|
2909
|
+
return { user: { state: () => "NotAuthenticated" }, tryToLogon: Xt };
|
|
2910
|
+
const t = new Date(e.dateOfBirth), s = Jt(Qt.Mobile, e.phone), r = Jt(Qt.Fixed, e.phone), a = zt(s) ?? zt(r) ?? "";
|
|
2904
2911
|
return {
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2912
|
+
user: {
|
|
2913
|
+
firstName: () => e.firstName,
|
|
2914
|
+
lastName: () => e.lastName,
|
|
2915
|
+
dob: () => t.getDate(),
|
|
2916
|
+
mob: () => t.getMonth() + 1,
|
|
2917
|
+
yob: () => t.getFullYear(),
|
|
2918
|
+
gender: () => e.genderCode,
|
|
2919
|
+
phone: () => a,
|
|
2920
|
+
streetName: () => {
|
|
2921
|
+
var o;
|
|
2922
|
+
return (o = e.address) == null ? void 0 : o.streetName;
|
|
2923
|
+
},
|
|
2924
|
+
houseNr: () => {
|
|
2925
|
+
var o;
|
|
2926
|
+
return (o = e.address) == null ? void 0 : o.houseNumber;
|
|
2927
|
+
},
|
|
2928
|
+
box: () => {
|
|
2929
|
+
var o;
|
|
2930
|
+
return (o = e.address) == null ? void 0 : o.letterBoxName;
|
|
2931
|
+
},
|
|
2932
|
+
zip: () => {
|
|
2933
|
+
var o;
|
|
2934
|
+
return (o = e.address) == null ? void 0 : o.postalCode;
|
|
2935
|
+
},
|
|
2936
|
+
city: () => {
|
|
2937
|
+
var o;
|
|
2938
|
+
return (o = e.address) == null ? void 0 : o.locationName;
|
|
2939
|
+
},
|
|
2940
|
+
country: () => {
|
|
2941
|
+
var o;
|
|
2942
|
+
return (o = e.address) == null ? void 0 : o.countryCode;
|
|
2943
|
+
},
|
|
2944
|
+
email: () => e.email,
|
|
2945
|
+
cbh: () => e.customerIdentifier,
|
|
2946
|
+
state: () => "Authenticated"
|
|
2947
|
+
},
|
|
2948
|
+
tryToLogon: Xt
|
|
2910
2949
|
};
|
|
2911
|
-
},
|
|
2912
|
-
|
|
2950
|
+
}, Us = ["profile"], Qs = () => {
|
|
2951
|
+
const { i18n: e } = _e(), t = $i(), s = sessionStorage.getItem("profile"), r = !!s;
|
|
2952
|
+
return bs({
|
|
2953
|
+
queryKey: Us,
|
|
2954
|
+
queryFn: async () => {
|
|
2955
|
+
const o = await fetch(t, {
|
|
2956
|
+
credentials: "include",
|
|
2957
|
+
mode: "cors",
|
|
2958
|
+
headers: { "Accept-Language": e.language }
|
|
2959
|
+
});
|
|
2960
|
+
if (!o.ok) {
|
|
2961
|
+
if (o.status === 401)
|
|
2962
|
+
return window.XTRA = { ...window.XTRA, ...It() }, window.postMessage(
|
|
2963
|
+
{ source: "xtra-authentication", isAuthenticated: !1 },
|
|
2964
|
+
new URL(window.location.href).origin
|
|
2965
|
+
), sessionStorage.removeItem("profile"), { authenticationStatus: "NotAuthenticated" };
|
|
2966
|
+
if (r)
|
|
2967
|
+
return { authenticationStatus: "Authenticated", profile: JSON.parse(s) };
|
|
2968
|
+
throw new Error("Failed to retrieve profile");
|
|
2969
|
+
}
|
|
2970
|
+
const l = await o.json(), { firstName: c, lastName: m } = l;
|
|
2971
|
+
return sessionStorage.setItem("profile", JSON.stringify({ firstName: c, lastName: m })), window.postMessage(
|
|
2972
|
+
{ source: "xtra-authentication", isAuthenticated: !0 },
|
|
2973
|
+
new URL(window.location.href).origin
|
|
2974
|
+
), window.XTRA = { ...window.XTRA, ...It(l) }, {
|
|
2975
|
+
authenticationStatus: "Authenticated",
|
|
2976
|
+
profile: { firstName: l.firstName, lastName: l.lastName }
|
|
2977
|
+
};
|
|
2978
|
+
},
|
|
2979
|
+
initialData: r ? {
|
|
2980
|
+
authenticationStatus: "Authenticated",
|
|
2981
|
+
profile: JSON.parse(s)
|
|
2982
|
+
} : void 0,
|
|
2983
|
+
placeholderData: { authenticationStatus: "Pending" },
|
|
2984
|
+
refetchOnWindowFocus: !1
|
|
2985
|
+
});
|
|
2986
|
+
}, Ki = (e) => e != null && e.length ? /* @__PURE__ */ i.jsx("ul", { className: "bou-menu__list", children: e == null ? void 0 : e.map(({ label: t, icon: s, url: r }, a) => /* @__PURE__ */ i.jsx(
|
|
2987
|
+
fe,
|
|
2913
2988
|
{
|
|
2914
2989
|
className: "bou-menu-item",
|
|
2915
2990
|
mobileUrl: r,
|
|
2916
2991
|
icon: s,
|
|
2917
2992
|
label: t
|
|
2918
2993
|
},
|
|
2919
|
-
|
|
2994
|
+
a
|
|
2920
2995
|
)) }) : null, Gi = () => {
|
|
2921
|
-
const { t: e } =
|
|
2996
|
+
const { t: e } = _e(), t = cs(), { position: s, bouMenuItems: r } = Rs(), { logoutUrl: a } = yt(), l = Dt().getQueryData(Us), c = (l == null ? void 0 : l.profile.firstName) ?? "", m = (l == null ? void 0 : l.profile.lastName) ?? "";
|
|
2922
2997
|
return /* @__PURE__ */ i.jsxs(Y, { type: "nav", id: "xtra-menu", position: s, children: [
|
|
2923
2998
|
/* @__PURE__ */ i.jsx(
|
|
2924
2999
|
Y.Trigger,
|
|
@@ -2930,67 +3005,67 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2930
3005
|
"button--authentication--authenticated"
|
|
2931
3006
|
),
|
|
2932
3007
|
children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
2933
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
2934
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__label", children:
|
|
2935
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3008
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Dr, { variant: "small", firstName: c, lastName: m }) }),
|
|
3009
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: c }),
|
|
3010
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Tt, {}) })
|
|
2936
3011
|
] })
|
|
2937
3012
|
}
|
|
2938
3013
|
),
|
|
2939
3014
|
/* @__PURE__ */ i.jsxs(Y.Content, { as: "div", children: [
|
|
2940
|
-
Ki(
|
|
3015
|
+
Ki(r),
|
|
2941
3016
|
/* @__PURE__ */ i.jsxs("ul", { children: [
|
|
2942
3017
|
/* @__PURE__ */ i.jsx(
|
|
2943
|
-
|
|
3018
|
+
fe,
|
|
2944
3019
|
{
|
|
2945
3020
|
className: "manage-profile",
|
|
2946
3021
|
mobileUrl: `${t}/manage-profile`,
|
|
2947
3022
|
desktopUrl: `${t}/manage-profile/personal-data`,
|
|
2948
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3023
|
+
icon: /* @__PURE__ */ i.jsx(Ir, {}),
|
|
2949
3024
|
label: e("manageProfile")
|
|
2950
3025
|
}
|
|
2951
3026
|
),
|
|
2952
3027
|
/* @__PURE__ */ i.jsx(
|
|
2953
|
-
|
|
3028
|
+
fe,
|
|
2954
3029
|
{
|
|
2955
3030
|
className: "payment",
|
|
2956
3031
|
mobileUrl: `${t}/payment`,
|
|
2957
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3032
|
+
icon: /* @__PURE__ */ i.jsx(ci, {}),
|
|
2958
3033
|
label: e("payment")
|
|
2959
3034
|
}
|
|
2960
3035
|
),
|
|
2961
3036
|
/* @__PURE__ */ i.jsx(
|
|
2962
|
-
|
|
3037
|
+
fe,
|
|
2963
3038
|
{
|
|
2964
3039
|
className: "gift-cards",
|
|
2965
3040
|
mobileUrl: `${t}/gift-cards`,
|
|
2966
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3041
|
+
icon: /* @__PURE__ */ i.jsx(oi, {}),
|
|
2967
3042
|
label: e("giftCards")
|
|
2968
3043
|
}
|
|
2969
3044
|
),
|
|
2970
3045
|
/* @__PURE__ */ i.jsx(
|
|
2971
|
-
|
|
3046
|
+
fe,
|
|
2972
3047
|
{
|
|
2973
3048
|
mobileUrl: `${t}/identifiers`,
|
|
2974
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3049
|
+
icon: /* @__PURE__ */ i.jsx(di, {}),
|
|
2975
3050
|
label: e("qrCode")
|
|
2976
3051
|
}
|
|
2977
3052
|
),
|
|
2978
3053
|
/* @__PURE__ */ i.jsx(
|
|
2979
|
-
|
|
3054
|
+
fe,
|
|
2980
3055
|
{
|
|
2981
3056
|
className: "manage-privacy",
|
|
2982
3057
|
mobileUrl: `${t}/manage-privacy`,
|
|
2983
3058
|
desktopUrl: `${t}/manage-privacy/permissions`,
|
|
2984
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3059
|
+
icon: /* @__PURE__ */ i.jsx(Jr, {}),
|
|
2985
3060
|
label: e("privacy")
|
|
2986
3061
|
}
|
|
2987
3062
|
),
|
|
2988
|
-
/* @__PURE__ */ i.jsx(
|
|
3063
|
+
/* @__PURE__ */ i.jsx(fe, { mobileUrl: a, icon: /* @__PURE__ */ i.jsx(Yr, {}), label: e("logout") })
|
|
2989
3064
|
] })
|
|
2990
3065
|
] })
|
|
2991
3066
|
] });
|
|
2992
|
-
},
|
|
2993
|
-
const { t: e } =
|
|
3067
|
+
}, Vi = () => {
|
|
3068
|
+
const { t: e } = _e();
|
|
2994
3069
|
return /* @__PURE__ */ i.jsxs("button", { className: P("button", "button--neutral", "button--authentication"), children: [
|
|
2995
3070
|
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx("i", { className: "spinner" }) }),
|
|
2996
3071
|
/* @__PURE__ */ i.jsxs("span", { className: "button__label", children: [
|
|
@@ -2998,8 +3073,8 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2998
3073
|
"..."
|
|
2999
3074
|
] })
|
|
3000
3075
|
] });
|
|
3001
|
-
},
|
|
3002
|
-
const { t } =
|
|
3076
|
+
}, qi = ({ className: e }) => {
|
|
3077
|
+
const { t } = _e(), { loginUrl: s } = yt();
|
|
3003
3078
|
return /* @__PURE__ */ i.jsxs(
|
|
3004
3079
|
"a",
|
|
3005
3080
|
{
|
|
@@ -3012,15 +3087,15 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
3012
3087
|
e
|
|
3013
3088
|
),
|
|
3014
3089
|
children: [
|
|
3015
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3090
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Es, { width: 24, height: 24, suffix: "desktop" }) }),
|
|
3016
3091
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: t("login") }),
|
|
3017
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3092
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Tt, {}) })
|
|
3018
3093
|
]
|
|
3019
3094
|
}
|
|
3020
3095
|
);
|
|
3021
3096
|
};
|
|
3022
3097
|
const Wi = () => {
|
|
3023
|
-
const { t: e } =
|
|
3098
|
+
const { t: e } = _e(), { loginUrl: t } = yt(), s = cs(), { position: r } = Rs();
|
|
3024
3099
|
return /* @__PURE__ */ i.jsxs(
|
|
3025
3100
|
Y,
|
|
3026
3101
|
{
|
|
@@ -3031,281 +3106,111 @@ const Wi = () => {
|
|
|
3031
3106
|
"aria-label": e("xtraMenuAriaLabel"),
|
|
3032
3107
|
children: [
|
|
3033
3108
|
/* @__PURE__ */ i.jsx(Y.Trigger, { className: P("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3034
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3035
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3109
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Es, { width: 24, height: 24, suffix: "mobile" }) }),
|
|
3110
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Tt, {}) })
|
|
3036
3111
|
] }) }),
|
|
3037
3112
|
/* @__PURE__ */ i.jsxs(Y.Content, { children: [
|
|
3038
3113
|
/* @__PURE__ */ i.jsx(Y.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: t, className: "button button--with-icon", children: [
|
|
3039
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3114
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Wr, {}) }),
|
|
3040
3115
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("login") })
|
|
3041
3116
|
] }) }),
|
|
3042
3117
|
/* @__PURE__ */ i.jsx(Y.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: `${s}/onboarding/register`, className: "button button--with-icon", children: [
|
|
3043
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3118
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(ei, {}) }),
|
|
3044
3119
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("register") })
|
|
3045
3120
|
] }) })
|
|
3046
3121
|
] })
|
|
3047
3122
|
]
|
|
3048
3123
|
}
|
|
3049
3124
|
);
|
|
3050
|
-
}
|
|
3051
|
-
var
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
/* @__PURE__ */ i.jsx(Vi, {}),
|
|
3125
|
+
}, Zi = () => {
|
|
3126
|
+
var t, s;
|
|
3127
|
+
const e = Qs();
|
|
3128
|
+
return ((t = e.data) == null ? void 0 : t.authenticationStatus) === "Authenticated" ? /* @__PURE__ */ i.jsx(Gi, {}) : ((s = e.data) == null ? void 0 : s.authenticationStatus) === "NotAuthenticated" || e.isError ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
3129
|
+
/* @__PURE__ */ i.jsx(qi, {}),
|
|
3056
3130
|
/* @__PURE__ */ i.jsx(Wi, {})
|
|
3057
|
-
] }) :
|
|
3058
|
-
}
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
e[r] = s[r];
|
|
3065
|
-
}
|
|
3066
|
-
return e;
|
|
3067
|
-
}
|
|
3068
|
-
var zi = {
|
|
3069
|
-
read: function(e) {
|
|
3070
|
-
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
3071
|
-
},
|
|
3072
|
-
write: function(e) {
|
|
3073
|
-
return encodeURIComponent(e).replace(
|
|
3074
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
3075
|
-
decodeURIComponent
|
|
3076
|
-
);
|
|
3077
|
-
}
|
|
3078
|
-
};
|
|
3079
|
-
function Tt(e, t) {
|
|
3080
|
-
function s(n, o, l) {
|
|
3081
|
-
if (!(typeof document > "u")) {
|
|
3082
|
-
l = ct({}, t, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires && (l.expires = l.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3083
|
-
var c = "";
|
|
3084
|
-
for (var f in l)
|
|
3085
|
-
l[f] && (c += "; " + f, l[f] !== !0 && (c += "=" + l[f].split(";")[0]));
|
|
3086
|
-
return document.cookie = n + "=" + e.write(o, n) + c;
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
function r(n) {
|
|
3090
|
-
if (!(typeof document > "u" || arguments.length && !n)) {
|
|
3091
|
-
for (var o = document.cookie ? document.cookie.split("; ") : [], l = {}, c = 0; c < o.length; c++) {
|
|
3092
|
-
var f = o[c].split("="), y = f.slice(1).join("=");
|
|
3093
|
-
try {
|
|
3094
|
-
var u = decodeURIComponent(f[0]);
|
|
3095
|
-
if (l[u] = e.read(y, u), n === u)
|
|
3096
|
-
break;
|
|
3097
|
-
} catch {
|
|
3098
|
-
}
|
|
3099
|
-
}
|
|
3100
|
-
return n ? l[n] : l;
|
|
3101
|
-
}
|
|
3102
|
-
}
|
|
3103
|
-
return Object.create(
|
|
3104
|
-
{
|
|
3105
|
-
set: s,
|
|
3106
|
-
get: r,
|
|
3107
|
-
remove: function(n, o) {
|
|
3108
|
-
s(
|
|
3109
|
-
n,
|
|
3110
|
-
"",
|
|
3111
|
-
ct({}, o, {
|
|
3112
|
-
expires: -1
|
|
3113
|
-
})
|
|
3114
|
-
);
|
|
3115
|
-
},
|
|
3116
|
-
withAttributes: function(n) {
|
|
3117
|
-
return Tt(this.converter, ct({}, this.attributes, n));
|
|
3118
|
-
},
|
|
3119
|
-
withConverter: function(n) {
|
|
3120
|
-
return Tt(ct({}, this.converter, n), this.attributes);
|
|
3121
|
-
}
|
|
3122
|
-
},
|
|
3123
|
-
{
|
|
3124
|
-
attributes: { value: Object.freeze(t) },
|
|
3125
|
-
converter: { value: Object.freeze(e) }
|
|
3126
|
-
}
|
|
3127
|
-
);
|
|
3128
|
-
}
|
|
3129
|
-
var Ut = Tt(zi, { path: "/" });
|
|
3130
|
-
class yt extends Error {
|
|
3131
|
-
constructor(t) {
|
|
3132
|
-
super(t), this.name = "UnauthorizedError";
|
|
3133
|
-
}
|
|
3134
|
-
}
|
|
3135
|
-
const Yi = () => {
|
|
3136
|
-
const { i18n: e } = Ee(), { profileEndpoint: t } = qe();
|
|
3137
|
-
return As({
|
|
3138
|
-
queryKey: ["profile"],
|
|
3139
|
-
queryFn: async () => {
|
|
3140
|
-
const r = await fetch(t, {
|
|
3141
|
-
credentials: "include",
|
|
3142
|
-
mode: "cors",
|
|
3143
|
-
headers: { "Accept-Language": e.language }
|
|
3144
|
-
});
|
|
3145
|
-
if (!r.ok)
|
|
3146
|
-
throw r.status === 401 ? new yt(`${r.status} - ${r.statusText}`) : new Error("Network response was not ok");
|
|
3147
|
-
return await r.json();
|
|
3148
|
-
},
|
|
3149
|
-
retry: (r, n) => n instanceof yt ? !1 : r < 2,
|
|
3150
|
-
refetchOnWindowFocus: !1
|
|
3151
|
-
});
|
|
3152
|
-
}, es = (e) => e ? `+${e.countryCode} ${e.number}` : "", ts = (e, t) => t == null ? void 0 : t.find((s) => s.type === e), ss = ({ apiUrl: e, redirectUrl: t }) => {
|
|
3153
|
-
const { loginUrl: s } = $s({ apiUrl: e, redirectUrl: t });
|
|
3154
|
-
window.location.replace(s);
|
|
3155
|
-
}, Ji = (e) => {
|
|
3156
|
-
if (!e)
|
|
3157
|
-
return { user: { state: () => z.NotAuthenticated }, tryToLogon: ss };
|
|
3158
|
-
const t = new Date(e.dateOfBirth), s = ts(qt.Mobile, e.phone), r = ts(qt.Fixed, e.phone), n = es(s) ?? es(r) ?? "";
|
|
3159
|
-
return {
|
|
3160
|
-
user: {
|
|
3161
|
-
firstName: () => e.firstName,
|
|
3162
|
-
lastName: () => e.lastName,
|
|
3163
|
-
dob: () => t.getDate(),
|
|
3164
|
-
mob: () => t.getMonth() + 1,
|
|
3165
|
-
yob: () => t.getFullYear(),
|
|
3166
|
-
gender: () => e.genderCode,
|
|
3167
|
-
phone: () => n,
|
|
3168
|
-
streetName: () => {
|
|
3169
|
-
var o;
|
|
3170
|
-
return (o = e.address) == null ? void 0 : o.streetName;
|
|
3171
|
-
},
|
|
3172
|
-
houseNr: () => {
|
|
3173
|
-
var o;
|
|
3174
|
-
return (o = e.address) == null ? void 0 : o.houseNumber;
|
|
3175
|
-
},
|
|
3176
|
-
box: () => {
|
|
3177
|
-
var o;
|
|
3178
|
-
return (o = e.address) == null ? void 0 : o.letterBoxName;
|
|
3179
|
-
},
|
|
3180
|
-
zip: () => {
|
|
3181
|
-
var o;
|
|
3182
|
-
return (o = e.address) == null ? void 0 : o.postalCode;
|
|
3183
|
-
},
|
|
3184
|
-
city: () => {
|
|
3185
|
-
var o;
|
|
3186
|
-
return (o = e.address) == null ? void 0 : o.locationName;
|
|
3187
|
-
},
|
|
3188
|
-
country: () => {
|
|
3189
|
-
var o;
|
|
3190
|
-
return (o = e.address) == null ? void 0 : o.countryCode;
|
|
3191
|
-
},
|
|
3192
|
-
email: () => e.email,
|
|
3193
|
-
cbh: () => e.customerIdentifier,
|
|
3194
|
-
state: () => z.Authenticated
|
|
3195
|
-
},
|
|
3196
|
-
tryToLogon: ss
|
|
3197
|
-
};
|
|
3198
|
-
}, Gs = () => {
|
|
3199
|
-
const e = Yi(), t = Ut.get("profile"), s = !!t, [r, n] = d.useState(
|
|
3200
|
-
s ? z.Authenticated : z.Pending
|
|
3201
|
-
), [o, l] = d.useState(
|
|
3202
|
-
s ? JSON.parse(t) : void 0
|
|
3203
|
-
);
|
|
3204
|
-
return d.useEffect(() => {
|
|
3205
|
-
e.isError && e.error instanceof yt && (Ut.remove("profile"), n(z.NotAuthenticated)), e.isError && !(e.error instanceof yt) && n(
|
|
3206
|
-
s ? z.Authenticated : z.NotAuthenticated
|
|
3207
|
-
), e.isSuccess && (n(z.Authenticated), l(e.data), window.postMessage(
|
|
3208
|
-
{ source: "xtra-authentication", isAuthenticated: !0 },
|
|
3209
|
-
new URL(window.location.href).origin
|
|
3210
|
-
)), window.XTRA = {
|
|
3211
|
-
...window.XTRA,
|
|
3212
|
-
...Ji(e.data)
|
|
3213
|
-
};
|
|
3214
|
-
}, [
|
|
3215
|
-
s,
|
|
3216
|
-
e.data,
|
|
3217
|
-
e.error,
|
|
3218
|
-
e.isError,
|
|
3219
|
-
e.isSuccess
|
|
3220
|
-
]), { authenticationStatus: r, profile: o };
|
|
3221
|
-
}, Xi = ({ position: e, bouMenuItems: t }) => {
|
|
3222
|
-
const { authenticationStatus: s, profile: r } = Gs();
|
|
3223
|
-
return /* @__PURE__ */ i.jsx(
|
|
3224
|
-
Hi,
|
|
3225
|
-
{
|
|
3226
|
-
bouMenuItems: t,
|
|
3227
|
-
authenticationStatus: s,
|
|
3228
|
-
position: e,
|
|
3229
|
-
profile: r,
|
|
3230
|
-
children: /* @__PURE__ */ i.jsx(Zi, {})
|
|
3231
|
-
}
|
|
3232
|
-
);
|
|
3233
|
-
}, Ii = () => {
|
|
3234
|
-
const { postTermsAndConditionsEndpoint: e } = qe(), t = new xs();
|
|
3235
|
-
return Ar({
|
|
3131
|
+
] }) : /* @__PURE__ */ i.jsx(Vi, {});
|
|
3132
|
+
}, Hs = () => {
|
|
3133
|
+
const { apiUrl: e } = Ut();
|
|
3134
|
+
return `${`${e}/xtra`}/authentication/v1/gdpr`;
|
|
3135
|
+
}, Yi = () => {
|
|
3136
|
+
const e = Hs(), t = new vs();
|
|
3137
|
+
return Er({
|
|
3236
3138
|
mutationFn: async (r) => {
|
|
3237
|
-
const
|
|
3238
|
-
method: "post",
|
|
3139
|
+
const a = await fetch(`${e}/tc`, {
|
|
3239
3140
|
body: JSON.stringify({ acceptedTC: r }),
|
|
3240
3141
|
credentials: "include",
|
|
3142
|
+
method: "POST",
|
|
3241
3143
|
mode: "cors"
|
|
3242
3144
|
});
|
|
3243
|
-
if (!
|
|
3145
|
+
if (!a.ok)
|
|
3244
3146
|
throw new Error("Network response was not ok");
|
|
3245
|
-
return
|
|
3147
|
+
return a;
|
|
3246
3148
|
},
|
|
3247
3149
|
onSuccess: async () => {
|
|
3248
3150
|
await t.invalidateQueries({ queryKey: ["gdpr"] });
|
|
3249
3151
|
}
|
|
3250
3152
|
});
|
|
3251
|
-
},
|
|
3252
|
-
|
|
3253
|
-
|
|
3153
|
+
}, zi = () => {
|
|
3154
|
+
var o;
|
|
3155
|
+
const { i18n: e } = _e(), t = Hs(), r = ((o = Qs().data) == null ? void 0 : o.authenticationStatus) === "Authenticated";
|
|
3156
|
+
return bs({
|
|
3254
3157
|
queryKey: ["gdpr"],
|
|
3255
3158
|
queryFn: async () => {
|
|
3256
|
-
const
|
|
3159
|
+
const l = await fetch(`${t}/tc/check`, {
|
|
3257
3160
|
credentials: "include",
|
|
3258
3161
|
mode: "cors",
|
|
3259
3162
|
headers: { "Accept-Language": e.language }
|
|
3260
3163
|
});
|
|
3261
|
-
if (!
|
|
3164
|
+
if (!l.ok)
|
|
3262
3165
|
throw new Error("Network response was not ok");
|
|
3263
|
-
return await
|
|
3166
|
+
return l.status === 204 ? [] : await l.json();
|
|
3264
3167
|
},
|
|
3265
|
-
enabled:
|
|
3266
|
-
initialData: n
|
|
3168
|
+
enabled: r
|
|
3267
3169
|
});
|
|
3268
|
-
},
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3170
|
+
}, Ji = () => {
|
|
3171
|
+
var y;
|
|
3172
|
+
const { t: e } = _e();
|
|
3173
|
+
Vs({ element: "xtra-authentication" });
|
|
3174
|
+
const { logoutUrl: t } = yt(), s = d.useRef(null), [r, a] = d.useState(0), [o, l] = d.useState({}), { mutate: c, isError: m } = Yi(), { AccessibleFormMessage: C, formRef: u } = qs({ submitCount: r, errors: o }), b = zi(), v = !!((y = b.data) != null && y.length), f = e("termsAndConditions.error.required"), w = () => {
|
|
3175
|
+
var g;
|
|
3176
|
+
(g = s == null ? void 0 : s.current) == null || g.click(), document.body.style.removeProperty("overflow");
|
|
3272
3177
|
};
|
|
3273
3178
|
d.useEffect(() => {
|
|
3274
|
-
|
|
3275
|
-
}, [
|
|
3276
|
-
|
|
3277
|
-
}, [
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
const { acceptedTC:
|
|
3281
|
-
if (
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3179
|
+
v && document.body.style.setProperty("overflow", "hidden");
|
|
3180
|
+
}, [v]), d.useEffect(() => {
|
|
3181
|
+
m && l({ acceptedTC: f });
|
|
3182
|
+
}, [f, m]);
|
|
3183
|
+
const E = (g) => {
|
|
3184
|
+
g.preventDefault(), a(r + 1);
|
|
3185
|
+
const { acceptedTC: S } = g.target;
|
|
3186
|
+
if (S instanceof RadioNodeList) {
|
|
3187
|
+
const _ = Object.values(S);
|
|
3188
|
+
_.every((L) => L.checked) ? (l({}), c(_.map((L) => L.value)), w()) : l({ acceptedTC: f });
|
|
3284
3189
|
} else
|
|
3285
|
-
|
|
3190
|
+
S != null && S.checked ? (l({}), c([S.value]), w()) : l({ acceptedTC: f });
|
|
3286
3191
|
};
|
|
3287
|
-
return
|
|
3288
|
-
|
|
3192
|
+
return v ? /* @__PURE__ */ i.jsxs(H, { defaultOpen: v, isModal: !0, children: [
|
|
3193
|
+
C,
|
|
3289
3194
|
/* @__PURE__ */ i.jsxs(H.Root, { children: [
|
|
3290
|
-
/* @__PURE__ */ i.jsx(H.Header, { children: /* @__PURE__ */ i.jsx(H.Title, { icon: /* @__PURE__ */ i.jsx(
|
|
3291
|
-
/* @__PURE__ */ i.jsx(H.Body, { children: /* @__PURE__ */ i.jsxs(
|
|
3292
|
-
/* @__PURE__ */ i.jsxs(
|
|
3195
|
+
/* @__PURE__ */ i.jsx(H.Header, { children: /* @__PURE__ */ i.jsx(H.Title, { icon: /* @__PURE__ */ i.jsx("i", { className: "commerce__icon" }), children: /* @__PURE__ */ i.jsx(en, { children: e("termsAndConditions.title") }) }) }),
|
|
3196
|
+
/* @__PURE__ */ i.jsx(H.Body, { children: /* @__PURE__ */ i.jsxs($s, { ref: u, id: "tc-form", onSubmit: E, children: [
|
|
3197
|
+
/* @__PURE__ */ i.jsxs(Ii, { children: [
|
|
3293
3198
|
e("termsAndConditions.description"),
|
|
3294
|
-
o.acceptedTC && /* @__PURE__ */ i.jsx(
|
|
3199
|
+
o.acceptedTC && /* @__PURE__ */ i.jsx(tn, { children: f })
|
|
3295
3200
|
] }),
|
|
3296
|
-
|
|
3297
|
-
|
|
3201
|
+
b.data.map(({ tcCode: g, title: S, URL: _ }) => /* @__PURE__ */ i.jsx(
|
|
3202
|
+
je,
|
|
3298
3203
|
{
|
|
3299
|
-
id:
|
|
3300
|
-
value:
|
|
3204
|
+
id: g,
|
|
3205
|
+
value: g,
|
|
3301
3206
|
name: "acceptedTC",
|
|
3302
3207
|
variant: "primary",
|
|
3303
|
-
children: /* @__PURE__ */ i.jsxs(
|
|
3304
|
-
/* @__PURE__ */ i.jsx(
|
|
3305
|
-
/* @__PURE__ */ i.jsx(
|
|
3208
|
+
children: /* @__PURE__ */ i.jsxs(je.Content, { children: [
|
|
3209
|
+
/* @__PURE__ */ i.jsx(Xi, { children: S }),
|
|
3210
|
+
/* @__PURE__ */ i.jsx(Bi, { href: _, children: e("termsAndConditions.action", { title: S }) })
|
|
3306
3211
|
] })
|
|
3307
3212
|
},
|
|
3308
|
-
|
|
3213
|
+
g
|
|
3309
3214
|
))
|
|
3310
3215
|
] }) }),
|
|
3311
3216
|
/* @__PURE__ */ i.jsxs(H.Footer, { children: [
|
|
@@ -3317,19 +3222,19 @@ const Yi = () => {
|
|
|
3317
3222
|
children: e("logout")
|
|
3318
3223
|
}
|
|
3319
3224
|
),
|
|
3320
|
-
/* @__PURE__ */ i.jsx(
|
|
3225
|
+
/* @__PURE__ */ i.jsx(it, { form: "tc-form", type: "submit", variant: "primary", children: e("confirm") })
|
|
3321
3226
|
] })
|
|
3322
3227
|
] })
|
|
3323
3228
|
] }) : /* @__PURE__ */ i.jsx(i.Fragment, {});
|
|
3324
|
-
},
|
|
3229
|
+
}, Xi = ({
|
|
3325
3230
|
children: e,
|
|
3326
3231
|
...t
|
|
3327
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
3328
|
-
|
|
3329
|
-
const
|
|
3232
|
+
}) => /* @__PURE__ */ i.jsx(je.Label, { className: "form--tc__label", ...t, children: e }), $s = d.forwardRef(({ children: e, ...t }, s) => /* @__PURE__ */ i.jsx("form", { className: "form--tc", ref: s, ...t, children: e }));
|
|
3233
|
+
$s.displayName = "TermsAndConditionsForm";
|
|
3234
|
+
const Ii = ({
|
|
3330
3235
|
children: e,
|
|
3331
3236
|
...t
|
|
3332
|
-
}) => /* @__PURE__ */ i.jsx("p", { className: "form--tc__description", ...t, children: e }),
|
|
3237
|
+
}) => /* @__PURE__ */ i.jsx("p", { className: "form--tc__description", ...t, children: e }), Bi = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx(
|
|
3333
3238
|
"a",
|
|
3334
3239
|
{
|
|
3335
3240
|
className: "form--tc__link",
|
|
@@ -3340,10 +3245,10 @@ const sn = ({
|
|
|
3340
3245
|
...t,
|
|
3341
3246
|
children: e
|
|
3342
3247
|
}
|
|
3343
|
-
),
|
|
3344
|
-
/* @__PURE__ */ i.jsx(
|
|
3345
|
-
/* @__PURE__ */ i.jsx(
|
|
3346
|
-
] }) }) });
|
|
3248
|
+
), en = ({ children: e }) => /* @__PURE__ */ i.jsx("h1", { className: "form--tc__title", children: e }), tn = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx("span", { className: "form--tc__error", role: "alert", ...t, children: e }), sn = new vs(), an = ({ environment: e, redirectUrl: t, apiUrl: s, position: r, commerceId: a, bouMenuItems: o }) => /* @__PURE__ */ i.jsx(Ws, { environment: e, children: /* @__PURE__ */ i.jsx(Zs, { commerceId: a, children: /* @__PURE__ */ i.jsx(Hi, { apiUrl: s, redirectUrl: t, children: /* @__PURE__ */ i.jsxs(fr, { client: sn, children: [
|
|
3249
|
+
/* @__PURE__ */ i.jsx(Qi, { position: r, bouMenuItems: o, children: /* @__PURE__ */ i.jsx(Zi, {}) }),
|
|
3250
|
+
/* @__PURE__ */ i.jsx(Ji, {})
|
|
3251
|
+
] }) }) }) });
|
|
3347
3252
|
export {
|
|
3348
|
-
|
|
3253
|
+
an as default
|
|
3349
3254
|
};
|