mhz-helpers 1.4.13 → 1.4.15
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/dist/query/index.js +368 -356
- package/dist/usePage/index.js +2 -2
- package/dist/usePagination/index.d.ts +1 -1
- package/dist/usePagination/index.js +2 -2
- package/package.json +9 -9
package/dist/query/index.js
CHANGED
|
@@ -16,13 +16,50 @@ var o = class {
|
|
|
16
16
|
}
|
|
17
17
|
onSubscribe() {}
|
|
18
18
|
onUnsubscribe() {}
|
|
19
|
-
}, s = {
|
|
19
|
+
}, s = new class extends o {
|
|
20
|
+
#e;
|
|
21
|
+
#t;
|
|
22
|
+
#n;
|
|
23
|
+
constructor() {
|
|
24
|
+
super(), this.#n = (e) => {
|
|
25
|
+
if (typeof window < "u" && window.addEventListener) {
|
|
26
|
+
let t = () => e();
|
|
27
|
+
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
28
|
+
window.removeEventListener("visibilitychange", t);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
onSubscribe() {
|
|
34
|
+
this.#t || this.setEventListener(this.#n);
|
|
35
|
+
}
|
|
36
|
+
onUnsubscribe() {
|
|
37
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
38
|
+
}
|
|
39
|
+
setEventListener(e) {
|
|
40
|
+
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
41
|
+
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
setFocused(e) {
|
|
45
|
+
this.#e !== e && (this.#e = e, this.onFocus());
|
|
46
|
+
}
|
|
47
|
+
onFocus() {
|
|
48
|
+
let e = this.isFocused();
|
|
49
|
+
this.listeners.forEach((t) => {
|
|
50
|
+
t(e);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
isFocused() {
|
|
54
|
+
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
55
|
+
}
|
|
56
|
+
}(), c = {
|
|
20
57
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
21
58
|
clearTimeout: (e) => clearTimeout(e),
|
|
22
59
|
setInterval: (e, t) => setInterval(e, t),
|
|
23
60
|
clearInterval: (e) => clearInterval(e)
|
|
24
|
-
},
|
|
25
|
-
#e =
|
|
61
|
+
}, l = new class {
|
|
62
|
+
#e = c;
|
|
26
63
|
#t = !1;
|
|
27
64
|
setTimeoutProvider(e) {
|
|
28
65
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
|
|
@@ -43,34 +80,34 @@ var o = class {
|
|
|
43
80
|
this.#e.clearInterval(e);
|
|
44
81
|
}
|
|
45
82
|
}();
|
|
46
|
-
function
|
|
83
|
+
function u(e) {
|
|
47
84
|
setTimeout(e, 0);
|
|
48
85
|
}
|
|
49
86
|
//#endregion
|
|
50
87
|
//#region ../../node_modules/@tanstack/query-core/build/modern/utils.js
|
|
51
|
-
var
|
|
52
|
-
function
|
|
53
|
-
function
|
|
88
|
+
var d = typeof window > "u" || "Deno" in globalThis;
|
|
89
|
+
function f() {}
|
|
90
|
+
function p(e, t) {
|
|
54
91
|
return typeof e == "function" ? e(t) : e;
|
|
55
92
|
}
|
|
56
|
-
function
|
|
93
|
+
function m(e) {
|
|
57
94
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
58
95
|
}
|
|
59
|
-
function m(e, t) {
|
|
60
|
-
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
61
|
-
}
|
|
62
96
|
function h(e, t) {
|
|
63
|
-
return
|
|
97
|
+
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
64
98
|
}
|
|
65
99
|
function g(e, t) {
|
|
66
100
|
return typeof e == "function" ? e(t) : e;
|
|
67
101
|
}
|
|
68
102
|
function _(e, t) {
|
|
103
|
+
return typeof e == "function" ? e(t) : e;
|
|
104
|
+
}
|
|
105
|
+
function v(e, t) {
|
|
69
106
|
let { type: n = "all", exact: r, fetchStatus: i, predicate: a, queryKey: o, stale: s } = e;
|
|
70
107
|
if (o) {
|
|
71
108
|
if (r) {
|
|
72
|
-
if (t.queryHash !==
|
|
73
|
-
} else if (!
|
|
109
|
+
if (t.queryHash !== b(o, t.options)) return !1;
|
|
110
|
+
} else if (!S(t.queryKey, o)) return !1;
|
|
74
111
|
}
|
|
75
112
|
if (n !== "all") {
|
|
76
113
|
let e = t.isActive();
|
|
@@ -78,36 +115,36 @@ function _(e, t) {
|
|
|
78
115
|
}
|
|
79
116
|
return !(typeof s == "boolean" && t.isStale() !== s || i && i !== t.state.fetchStatus || a && !a(t));
|
|
80
117
|
}
|
|
81
|
-
function
|
|
118
|
+
function y(e, t) {
|
|
82
119
|
let { exact: n, status: r, predicate: i, mutationKey: a } = e;
|
|
83
120
|
if (a) {
|
|
84
121
|
if (!t.options.mutationKey) return !1;
|
|
85
122
|
if (n) {
|
|
86
|
-
if (
|
|
87
|
-
} else if (!
|
|
123
|
+
if (x(t.options.mutationKey) !== x(a)) return !1;
|
|
124
|
+
} else if (!S(t.options.mutationKey, a)) return !1;
|
|
88
125
|
}
|
|
89
126
|
return !(r && t.state.status !== r || i && !i(t));
|
|
90
127
|
}
|
|
91
|
-
function
|
|
92
|
-
return (t?.queryKeyHashFn ||
|
|
128
|
+
function b(e, t) {
|
|
129
|
+
return (t?.queryKeyHashFn || x)(e);
|
|
93
130
|
}
|
|
94
|
-
function
|
|
95
|
-
return JSON.stringify(e, (e, t) =>
|
|
131
|
+
function x(e) {
|
|
132
|
+
return JSON.stringify(e, (e, t) => T(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
96
133
|
}
|
|
97
|
-
function
|
|
98
|
-
return e === t ? !0 : typeof e == typeof t && e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((n) =>
|
|
134
|
+
function S(e, t) {
|
|
135
|
+
return e === t ? !0 : typeof e == typeof t && e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((n) => S(e[n], t[n])) : !1;
|
|
99
136
|
}
|
|
100
|
-
var
|
|
137
|
+
var ee = Object.prototype.hasOwnProperty;
|
|
101
138
|
function C(e, t, n = 0) {
|
|
102
139
|
if (e === t) return e;
|
|
103
140
|
if (n > 500) return t;
|
|
104
|
-
let r =
|
|
105
|
-
if (!r && !(
|
|
141
|
+
let r = te(e) && te(t);
|
|
142
|
+
if (!r && !(T(e) && T(t))) return t;
|
|
106
143
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
107
144
|
for (let l = 0; l < o; l++) {
|
|
108
145
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
109
146
|
if (u === d) {
|
|
110
|
-
s[o] = u, (r ? l < i :
|
|
147
|
+
s[o] = u, (r ? l < i : ee.call(e, o)) && c++;
|
|
111
148
|
continue;
|
|
112
149
|
}
|
|
113
150
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
@@ -124,25 +161,25 @@ function w(e, t) {
|
|
|
124
161
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
125
162
|
return !0;
|
|
126
163
|
}
|
|
127
|
-
function
|
|
164
|
+
function te(e) {
|
|
128
165
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
129
166
|
}
|
|
130
|
-
function
|
|
131
|
-
if (!
|
|
167
|
+
function T(e) {
|
|
168
|
+
if (!ne(e)) return !1;
|
|
132
169
|
let t = e.constructor;
|
|
133
170
|
if (t === void 0) return !0;
|
|
134
171
|
let n = t.prototype;
|
|
135
|
-
return !(!
|
|
172
|
+
return !(!ne(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
136
173
|
}
|
|
137
|
-
function
|
|
174
|
+
function ne(e) {
|
|
138
175
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
139
176
|
}
|
|
140
|
-
function
|
|
177
|
+
function re(e) {
|
|
141
178
|
return new Promise((t) => {
|
|
142
|
-
|
|
179
|
+
l.setTimeout(t, e);
|
|
143
180
|
});
|
|
144
181
|
}
|
|
145
|
-
function
|
|
182
|
+
function E(e, t, n) {
|
|
146
183
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
147
184
|
if (n.structuralSharing !== !1) {
|
|
148
185
|
if (process.env.NODE_ENV !== "production") try {
|
|
@@ -154,69 +191,44 @@ function O(e, t, n) {
|
|
|
154
191
|
}
|
|
155
192
|
return t;
|
|
156
193
|
}
|
|
157
|
-
function
|
|
194
|
+
function ie(e, t, n = 0) {
|
|
158
195
|
let r = [...e, t];
|
|
159
196
|
return n && r.length > n ? r.slice(1) : r;
|
|
160
197
|
}
|
|
161
|
-
function
|
|
198
|
+
function ae(e, t, n = 0) {
|
|
162
199
|
let r = [t, ...e];
|
|
163
200
|
return n && r.length > n ? r.slice(0, -1) : r;
|
|
164
201
|
}
|
|
165
|
-
var
|
|
166
|
-
function
|
|
167
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
202
|
+
var D = /* @__PURE__ */ Symbol();
|
|
203
|
+
function O(e, t) {
|
|
204
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === D && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === D ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
168
205
|
}
|
|
169
|
-
function
|
|
206
|
+
function k(e, t) {
|
|
170
207
|
return typeof e == "function" ? e(...t) : !!e;
|
|
171
208
|
}
|
|
172
|
-
function
|
|
209
|
+
function oe(e, t, n) {
|
|
173
210
|
let r = !1, i;
|
|
174
211
|
return Object.defineProperty(e, "signal", {
|
|
175
212
|
enumerable: !0,
|
|
176
213
|
get: () => (i ??= t(), r ? i : (r = !0, i.aborted ? n() : i.addEventListener("abort", n, { once: !0 }), i))
|
|
177
214
|
}), e;
|
|
178
215
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
onSubscribe() {
|
|
194
|
-
this.#t || this.setEventListener(this.#n);
|
|
195
|
-
}
|
|
196
|
-
onUnsubscribe() {
|
|
197
|
-
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
198
|
-
}
|
|
199
|
-
setEventListener(e) {
|
|
200
|
-
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
201
|
-
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
setFocused(e) {
|
|
205
|
-
this.#e !== e && (this.#e = e, this.onFocus());
|
|
206
|
-
}
|
|
207
|
-
onFocus() {
|
|
208
|
-
let e = this.isFocused();
|
|
209
|
-
this.listeners.forEach((t) => {
|
|
210
|
-
t(e);
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
isFocused() {
|
|
214
|
-
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
215
|
-
}
|
|
216
|
-
}();
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region ../../node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
218
|
+
var A = /* @__PURE__ */ (() => {
|
|
219
|
+
let e = () => d;
|
|
220
|
+
return {
|
|
221
|
+
isServer() {
|
|
222
|
+
return e();
|
|
223
|
+
},
|
|
224
|
+
setIsServer(t) {
|
|
225
|
+
e = t;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
})();
|
|
217
229
|
//#endregion
|
|
218
230
|
//#region ../../node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
219
|
-
function
|
|
231
|
+
function j() {
|
|
220
232
|
let e, t, n = new Promise((n, r) => {
|
|
221
233
|
e = n, t = r;
|
|
222
234
|
});
|
|
@@ -238,13 +250,13 @@ function M() {
|
|
|
238
250
|
}
|
|
239
251
|
//#endregion
|
|
240
252
|
//#region ../../node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
241
|
-
var
|
|
242
|
-
function
|
|
253
|
+
var se = u;
|
|
254
|
+
function ce() {
|
|
243
255
|
let e = [], t = 0, n = (e) => {
|
|
244
256
|
e();
|
|
245
257
|
}, r = (e) => {
|
|
246
258
|
e();
|
|
247
|
-
}, i =
|
|
259
|
+
}, i = se, a = (r) => {
|
|
248
260
|
t ? e.push(r) : i(() => {
|
|
249
261
|
n(r);
|
|
250
262
|
});
|
|
@@ -286,13 +298,13 @@ function oe() {
|
|
|
286
298
|
}
|
|
287
299
|
};
|
|
288
300
|
}
|
|
289
|
-
var
|
|
301
|
+
var M = ce(), N = new class extends o {
|
|
290
302
|
#e = !0;
|
|
291
303
|
#t;
|
|
292
304
|
#n;
|
|
293
305
|
constructor() {
|
|
294
306
|
super(), this.#n = (e) => {
|
|
295
|
-
if (
|
|
307
|
+
if (typeof window < "u" && window.addEventListener) {
|
|
296
308
|
let t = () => e(!0), n = () => e(!1);
|
|
297
309
|
return window.addEventListener("online", t, !1), window.addEventListener("offline", n, !1), () => {
|
|
298
310
|
window.removeEventListener("online", t), window.removeEventListener("offline", n);
|
|
@@ -320,34 +332,34 @@ var N = oe(), P = new class extends o {
|
|
|
320
332
|
}();
|
|
321
333
|
//#endregion
|
|
322
334
|
//#region ../../node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
323
|
-
function
|
|
335
|
+
function le(e) {
|
|
324
336
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
325
337
|
}
|
|
326
|
-
function
|
|
327
|
-
return (e ?? "online") === "online" ?
|
|
338
|
+
function ue(e) {
|
|
339
|
+
return (e ?? "online") === "online" ? N.isOnline() : !0;
|
|
328
340
|
}
|
|
329
|
-
var
|
|
341
|
+
var P = class extends Error {
|
|
330
342
|
constructor(e) {
|
|
331
343
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
332
344
|
}
|
|
333
345
|
};
|
|
334
|
-
function
|
|
335
|
-
let t = !1, n = 0, r, i =
|
|
346
|
+
function de(e) {
|
|
347
|
+
let t = !1, n = 0, r, i = j(), a = () => i.status !== "pending", o = (t) => {
|
|
336
348
|
if (!a()) {
|
|
337
|
-
let n = new
|
|
349
|
+
let n = new P(t);
|
|
338
350
|
p(n), e.onCancel?.(n);
|
|
339
351
|
}
|
|
340
|
-
}, s = () => {
|
|
341
|
-
t = !0;
|
|
342
352
|
}, c = () => {
|
|
353
|
+
t = !0;
|
|
354
|
+
}, l = () => {
|
|
343
355
|
t = !1;
|
|
344
|
-
},
|
|
356
|
+
}, u = () => s.isFocused() && (e.networkMode === "always" || N.isOnline()) && e.canRun(), d = () => ue(e.networkMode) && e.canRun(), f = (e) => {
|
|
345
357
|
a() || (r?.(), i.resolve(e));
|
|
346
358
|
}, p = (e) => {
|
|
347
359
|
a() || (r?.(), i.reject(e));
|
|
348
360
|
}, m = () => new Promise((t) => {
|
|
349
361
|
r = (e) => {
|
|
350
|
-
(a() ||
|
|
362
|
+
(a() || u()) && t(e);
|
|
351
363
|
}, e.onPause?.();
|
|
352
364
|
}).then(() => {
|
|
353
365
|
r = void 0, a() || e.onContinue?.();
|
|
@@ -361,12 +373,12 @@ function le(e) {
|
|
|
361
373
|
}
|
|
362
374
|
Promise.resolve(r).then(f).catch((r) => {
|
|
363
375
|
if (a()) return;
|
|
364
|
-
let i = e.retry ?? (
|
|
376
|
+
let i = e.retry ?? (A.isServer() ? 0 : 3), o = e.retryDelay ?? le, s = typeof o == "function" ? o(n, r) : o, c = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
|
|
365
377
|
if (t || !c) {
|
|
366
378
|
p(r);
|
|
367
379
|
return;
|
|
368
380
|
}
|
|
369
|
-
n++, e.onFail?.(n, r),
|
|
381
|
+
n++, e.onFail?.(n, r), re(s).then(() => u() ? void 0 : m()).then(() => {
|
|
370
382
|
t ? p(r) : h();
|
|
371
383
|
});
|
|
372
384
|
});
|
|
@@ -376,31 +388,31 @@ function le(e) {
|
|
|
376
388
|
status: () => i.status,
|
|
377
389
|
cancel: o,
|
|
378
390
|
continue: () => (r?.(), i),
|
|
379
|
-
cancelRetry:
|
|
380
|
-
continueRetry:
|
|
391
|
+
cancelRetry: c,
|
|
392
|
+
continueRetry: l,
|
|
381
393
|
canStart: d,
|
|
382
394
|
start: () => (d() ? h() : m().then(h), i)
|
|
383
395
|
};
|
|
384
396
|
}
|
|
385
397
|
//#endregion
|
|
386
398
|
//#region ../../node_modules/@tanstack/query-core/build/modern/removable.js
|
|
387
|
-
var
|
|
399
|
+
var fe = class {
|
|
388
400
|
#e;
|
|
389
401
|
destroy() {
|
|
390
402
|
this.clearGcTimeout();
|
|
391
403
|
}
|
|
392
404
|
scheduleGc() {
|
|
393
|
-
this.clearGcTimeout(),
|
|
405
|
+
this.clearGcTimeout(), m(this.gcTime) && (this.#e = l.setTimeout(() => {
|
|
394
406
|
this.optionalRemove();
|
|
395
407
|
}, this.gcTime));
|
|
396
408
|
}
|
|
397
409
|
updateGcTime(e) {
|
|
398
|
-
this.gcTime = Math.max(this.gcTime || 0, e ?? (
|
|
410
|
+
this.gcTime = Math.max(this.gcTime || 0, e ?? (A.isServer() ? Infinity : 300 * 1e3));
|
|
399
411
|
}
|
|
400
412
|
clearGcTimeout() {
|
|
401
|
-
this.#e &&= (
|
|
413
|
+
this.#e &&= (l.clearTimeout(this.#e), void 0);
|
|
402
414
|
}
|
|
403
|
-
},
|
|
415
|
+
}, pe = class extends fe {
|
|
404
416
|
#e;
|
|
405
417
|
#t;
|
|
406
418
|
#n;
|
|
@@ -409,7 +421,7 @@ var ue = class {
|
|
|
409
421
|
#a;
|
|
410
422
|
#o;
|
|
411
423
|
constructor(e) {
|
|
412
|
-
super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#r = e.client, this.#n = this.#r.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e =
|
|
424
|
+
super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#r = e.client, this.#n = this.#r.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = F(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
|
|
413
425
|
}
|
|
414
426
|
get meta() {
|
|
415
427
|
return this.options.meta;
|
|
@@ -422,15 +434,15 @@ var ue = class {
|
|
|
422
434
|
...this.#a,
|
|
423
435
|
...e
|
|
424
436
|
}, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
425
|
-
let e =
|
|
426
|
-
e.data !== void 0 && (this.setState(
|
|
437
|
+
let e = F(this.options);
|
|
438
|
+
e.data !== void 0 && (this.setState(he(e.data, e.dataUpdatedAt)), this.#e = e);
|
|
427
439
|
}
|
|
428
440
|
}
|
|
429
441
|
optionalRemove() {
|
|
430
442
|
!this.observers.length && this.state.fetchStatus === "idle" && this.#n.remove(this);
|
|
431
443
|
}
|
|
432
444
|
setData(e, t) {
|
|
433
|
-
let n =
|
|
445
|
+
let n = E(this.state.data, e, this.options);
|
|
434
446
|
return this.#s({
|
|
435
447
|
data: n,
|
|
436
448
|
type: "success",
|
|
@@ -447,7 +459,7 @@ var ue = class {
|
|
|
447
459
|
}
|
|
448
460
|
cancel(e) {
|
|
449
461
|
let t = this.#i?.promise;
|
|
450
|
-
return this.#i?.cancel(e), t ? t.then(
|
|
462
|
+
return this.#i?.cancel(e), t ? t.then(f).catch(f) : Promise.resolve();
|
|
451
463
|
}
|
|
452
464
|
destroy() {
|
|
453
465
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -456,19 +468,19 @@ var ue = class {
|
|
|
456
468
|
this.destroy(), this.setState(this.#e);
|
|
457
469
|
}
|
|
458
470
|
isActive() {
|
|
459
|
-
return this.observers.some((e) =>
|
|
471
|
+
return this.observers.some((e) => _(e.options.enabled, this) !== !1);
|
|
460
472
|
}
|
|
461
473
|
isDisabled() {
|
|
462
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
474
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === D || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
463
475
|
}
|
|
464
476
|
isStatic() {
|
|
465
|
-
return this.getObserversCount() > 0 ? this.observers.some((e) =>
|
|
477
|
+
return this.getObserversCount() > 0 ? this.observers.some((e) => g(e.options.staleTime, this) === "static") : !1;
|
|
466
478
|
}
|
|
467
479
|
isStale() {
|
|
468
480
|
return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
|
|
469
481
|
}
|
|
470
482
|
isStaleByTime(e = 0) {
|
|
471
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
483
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !h(this.state.dataUpdatedAt, e);
|
|
472
484
|
}
|
|
473
485
|
onFocus() {
|
|
474
486
|
this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#i?.continue();
|
|
@@ -512,7 +524,7 @@ var ue = class {
|
|
|
512
524
|
get: () => (this.#o = !0, n.signal)
|
|
513
525
|
});
|
|
514
526
|
}, i = () => {
|
|
515
|
-
let e =
|
|
527
|
+
let e = O(this.options, t), n = (() => {
|
|
516
528
|
let e = {
|
|
517
529
|
client: this.#r,
|
|
518
530
|
queryKey: this.queryKey,
|
|
@@ -535,11 +547,11 @@ var ue = class {
|
|
|
535
547
|
this.options.behavior?.onFetch(a, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#s({
|
|
536
548
|
type: "fetch",
|
|
537
549
|
meta: a.fetchOptions?.meta
|
|
538
|
-
}), this.#i =
|
|
550
|
+
}), this.#i = de({
|
|
539
551
|
initialPromise: t?.initialPromise,
|
|
540
552
|
fn: a.fetchFn,
|
|
541
553
|
onCancel: (e) => {
|
|
542
|
-
e instanceof
|
|
554
|
+
e instanceof P && e.revert && this.setState({
|
|
543
555
|
...this.#t,
|
|
544
556
|
fetchStatus: "idle"
|
|
545
557
|
}), n.abort();
|
|
@@ -567,7 +579,7 @@ var ue = class {
|
|
|
567
579
|
if (e === void 0) throw process.env.NODE_ENV !== "production" && console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`), Error(`${this.queryHash} data is undefined`);
|
|
568
580
|
return this.setData(e), this.#n.config.onSuccess?.(e, this), this.#n.config.onSettled?.(e, this.state.error, this), e;
|
|
569
581
|
} catch (e) {
|
|
570
|
-
if (e instanceof
|
|
582
|
+
if (e instanceof P) {
|
|
571
583
|
if (e.silent) return this.#i.promise;
|
|
572
584
|
if (e.revert) {
|
|
573
585
|
if (this.state.data === void 0) throw e;
|
|
@@ -600,13 +612,13 @@ var ue = class {
|
|
|
600
612
|
};
|
|
601
613
|
case "fetch": return {
|
|
602
614
|
...t,
|
|
603
|
-
...
|
|
615
|
+
...me(t.data, this.options),
|
|
604
616
|
fetchMeta: e.meta ?? null
|
|
605
617
|
};
|
|
606
618
|
case "success":
|
|
607
619
|
let n = {
|
|
608
620
|
...t,
|
|
609
|
-
...
|
|
621
|
+
...he(e.data, e.dataUpdatedAt),
|
|
610
622
|
dataUpdateCount: t.dataUpdateCount + 1,
|
|
611
623
|
...!e.manual && {
|
|
612
624
|
fetchStatus: "idle",
|
|
@@ -637,7 +649,7 @@ var ue = class {
|
|
|
637
649
|
...e.state
|
|
638
650
|
};
|
|
639
651
|
}
|
|
640
|
-
})(this.state),
|
|
652
|
+
})(this.state), M.batch(() => {
|
|
641
653
|
this.observers.forEach((e) => {
|
|
642
654
|
e.onQueryUpdate();
|
|
643
655
|
}), this.#n.notify({
|
|
@@ -648,18 +660,18 @@ var ue = class {
|
|
|
648
660
|
});
|
|
649
661
|
}
|
|
650
662
|
};
|
|
651
|
-
function
|
|
663
|
+
function me(e, t) {
|
|
652
664
|
return {
|
|
653
665
|
fetchFailureCount: 0,
|
|
654
666
|
fetchFailureReason: null,
|
|
655
|
-
fetchStatus:
|
|
667
|
+
fetchStatus: ue(t.networkMode) ? "fetching" : "paused",
|
|
656
668
|
...e === void 0 && {
|
|
657
669
|
error: null,
|
|
658
670
|
status: "pending"
|
|
659
671
|
}
|
|
660
672
|
};
|
|
661
673
|
}
|
|
662
|
-
function
|
|
674
|
+
function he(e, t) {
|
|
663
675
|
return {
|
|
664
676
|
data: e,
|
|
665
677
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -668,7 +680,7 @@ function I(e, t) {
|
|
|
668
680
|
status: "success"
|
|
669
681
|
};
|
|
670
682
|
}
|
|
671
|
-
function
|
|
683
|
+
function F(e) {
|
|
672
684
|
let t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = t !== void 0, r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
673
685
|
return {
|
|
674
686
|
data: t,
|
|
@@ -687,9 +699,9 @@ function pe(e) {
|
|
|
687
699
|
}
|
|
688
700
|
//#endregion
|
|
689
701
|
//#region ../../node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
690
|
-
var
|
|
702
|
+
var ge = class extends o {
|
|
691
703
|
constructor(e, t) {
|
|
692
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
704
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = j(), this.bindMethods(), this.setOptions(t);
|
|
693
705
|
}
|
|
694
706
|
#e;
|
|
695
707
|
#t = void 0;
|
|
@@ -710,7 +722,7 @@ var me = class extends o {
|
|
|
710
722
|
this.refetch = this.refetch.bind(this);
|
|
711
723
|
}
|
|
712
724
|
onSubscribe() {
|
|
713
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
725
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), I(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
714
726
|
}
|
|
715
727
|
onUnsubscribe() {
|
|
716
728
|
this.hasListeners() || this.destroy();
|
|
@@ -726,16 +738,16 @@ var me = class extends o {
|
|
|
726
738
|
}
|
|
727
739
|
setOptions(e) {
|
|
728
740
|
let t = this.options, n = this.#t;
|
|
729
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
741
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof _(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
730
742
|
this.#S(), this.#t.setOptions(this.options), t._defaulted && !w(this.options, t) && this.#e.getQueryCache().notify({
|
|
731
743
|
type: "observerOptionsUpdated",
|
|
732
744
|
query: this.#t,
|
|
733
745
|
observer: this
|
|
734
746
|
});
|
|
735
747
|
let r = this.hasListeners();
|
|
736
|
-
r &&
|
|
748
|
+
r && R(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || _(this.options.enabled, this.#t) !== _(t.enabled, this.#t) || g(this.options.staleTime, this.#t) !== g(t.staleTime, this.#t)) && this.#g();
|
|
737
749
|
let i = this.#_();
|
|
738
|
-
r && (this.#t !== n ||
|
|
750
|
+
r && (this.#t !== n || _(this.options.enabled, this.#t) !== _(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
739
751
|
}
|
|
740
752
|
getOptimisticResult(e) {
|
|
741
753
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
@@ -769,14 +781,14 @@ var me = class extends o {
|
|
|
769
781
|
#h(e) {
|
|
770
782
|
this.#S();
|
|
771
783
|
let t = this.#t.fetch(this.options, e);
|
|
772
|
-
return e?.throwOnError || (t = t.catch(
|
|
784
|
+
return e?.throwOnError || (t = t.catch(f)), t;
|
|
773
785
|
}
|
|
774
786
|
#g() {
|
|
775
787
|
this.#b();
|
|
776
|
-
let e =
|
|
777
|
-
if (
|
|
778
|
-
let t =
|
|
779
|
-
this.#d =
|
|
788
|
+
let e = g(this.options.staleTime, this.#t);
|
|
789
|
+
if (A.isServer() || this.#r.isStale || !m(e)) return;
|
|
790
|
+
let t = h(this.#r.dataUpdatedAt, e) + 1;
|
|
791
|
+
this.#d = l.setTimeout(() => {
|
|
780
792
|
this.#r.isStale || this.updateResult();
|
|
781
793
|
}, t);
|
|
782
794
|
}
|
|
@@ -784,26 +796,26 @@ var me = class extends o {
|
|
|
784
796
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
785
797
|
}
|
|
786
798
|
#v(e) {
|
|
787
|
-
this.#x(), this.#p = e, !(
|
|
788
|
-
(this.options.refetchIntervalInBackground ||
|
|
799
|
+
this.#x(), this.#p = e, !(A.isServer() || _(this.options.enabled, this.#t) === !1 || !m(this.#p) || this.#p === 0) && (this.#f = l.setInterval(() => {
|
|
800
|
+
(this.options.refetchIntervalInBackground || s.isFocused()) && this.#h();
|
|
789
801
|
}, this.#p));
|
|
790
802
|
}
|
|
791
803
|
#y() {
|
|
792
804
|
this.#g(), this.#v(this.#_());
|
|
793
805
|
}
|
|
794
806
|
#b() {
|
|
795
|
-
this.#d &&= (
|
|
807
|
+
this.#d &&= (l.clearTimeout(this.#d), void 0);
|
|
796
808
|
}
|
|
797
809
|
#x() {
|
|
798
|
-
this.#f &&= (
|
|
810
|
+
this.#f &&= (l.clearInterval(this.#f), void 0);
|
|
799
811
|
}
|
|
800
812
|
createResult(e, t) {
|
|
801
813
|
let n = this.#t, r = this.options, i = this.#r, a = this.#i, o = this.#a, s = e === n ? this.#n : e.state, { state: c } = e, l = { ...c }, u = !1, d;
|
|
802
814
|
if (t._optimisticResults) {
|
|
803
|
-
let i = this.hasListeners(), a = !i &&
|
|
815
|
+
let i = this.hasListeners(), a = !i && I(e, t), o = i && R(e, n, t, r);
|
|
804
816
|
(a || o) && (l = {
|
|
805
817
|
...l,
|
|
806
|
-
...
|
|
818
|
+
...me(c.data, e.options)
|
|
807
819
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
808
820
|
}
|
|
809
821
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -811,16 +823,16 @@ var me = class extends o {
|
|
|
811
823
|
let h = !1;
|
|
812
824
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
813
825
|
let e;
|
|
814
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
826
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = E(i?.data, e, t), u = !0);
|
|
815
827
|
}
|
|
816
828
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
817
829
|
else try {
|
|
818
|
-
this.#c = t.select, d = t.select(d), d =
|
|
830
|
+
this.#c = t.select, d = t.select(d), d = E(i?.data, d, t), this.#l = d, this.#s = null;
|
|
819
831
|
} catch (e) {
|
|
820
832
|
this.#s = e;
|
|
821
833
|
}
|
|
822
834
|
this.#s && (f = this.#s, d = this.#l, p = Date.now(), m = "error");
|
|
823
|
-
let
|
|
835
|
+
let g = l.fetchStatus === "fetching", v = m === "pending", y = m === "error", b = v && g, x = d !== void 0, S = {
|
|
824
836
|
status: m,
|
|
825
837
|
fetchStatus: l.fetchStatus,
|
|
826
838
|
isPending: v,
|
|
@@ -837,22 +849,22 @@ var me = class extends o {
|
|
|
837
849
|
errorUpdateCount: l.errorUpdateCount,
|
|
838
850
|
isFetched: l.dataUpdateCount > 0 || l.errorUpdateCount > 0,
|
|
839
851
|
isFetchedAfterMount: l.dataUpdateCount > s.dataUpdateCount || l.errorUpdateCount > s.errorUpdateCount,
|
|
840
|
-
isFetching:
|
|
841
|
-
isRefetching:
|
|
852
|
+
isFetching: g,
|
|
853
|
+
isRefetching: g && !v,
|
|
842
854
|
isLoadingError: y && !x,
|
|
843
855
|
isPaused: l.fetchStatus === "paused",
|
|
844
856
|
isPlaceholderData: u,
|
|
845
857
|
isRefetchError: y && x,
|
|
846
|
-
isStale:
|
|
858
|
+
isStale: z(e, t),
|
|
847
859
|
refetch: this.refetch,
|
|
848
860
|
promise: this.#o,
|
|
849
|
-
isEnabled:
|
|
861
|
+
isEnabled: _(t.enabled, e) !== !1
|
|
850
862
|
};
|
|
851
863
|
if (this.options.experimental_prefetchInRender) {
|
|
852
864
|
let t = S.data !== void 0, r = S.status === "error" && !t, i = (e) => {
|
|
853
865
|
r ? e.reject(S.error) : t && e.resolve(S.data);
|
|
854
866
|
}, a = () => {
|
|
855
|
-
i(this.#o = S.promise =
|
|
867
|
+
i(this.#o = S.promise = j());
|
|
856
868
|
}, o = this.#o;
|
|
857
869
|
switch (o.status) {
|
|
858
870
|
case "pending":
|
|
@@ -891,7 +903,7 @@ var me = class extends o {
|
|
|
891
903
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
892
904
|
}
|
|
893
905
|
#C(e) {
|
|
894
|
-
|
|
906
|
+
M.batch(() => {
|
|
895
907
|
e.listeners && this.listeners.forEach((e) => {
|
|
896
908
|
e(this.#r);
|
|
897
909
|
}), this.#e.getQueryCache().notify({
|
|
@@ -901,24 +913,24 @@ var me = class extends o {
|
|
|
901
913
|
});
|
|
902
914
|
}
|
|
903
915
|
};
|
|
904
|
-
function
|
|
905
|
-
return
|
|
916
|
+
function _e(e, t) {
|
|
917
|
+
return _(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
906
918
|
}
|
|
907
|
-
function
|
|
908
|
-
return
|
|
919
|
+
function I(e, t) {
|
|
920
|
+
return _e(e, t) || e.state.data !== void 0 && L(e, t, t.refetchOnMount);
|
|
909
921
|
}
|
|
910
922
|
function L(e, t, n) {
|
|
911
|
-
if (
|
|
923
|
+
if (_(t.enabled, e) !== !1 && g(t.staleTime, e) !== "static") {
|
|
912
924
|
let r = typeof n == "function" ? n(e) : n;
|
|
913
|
-
return r === "always" || r !== !1 &&
|
|
925
|
+
return r === "always" || r !== !1 && z(e, t);
|
|
914
926
|
}
|
|
915
927
|
return !1;
|
|
916
928
|
}
|
|
917
|
-
function
|
|
918
|
-
return (e !== t ||
|
|
929
|
+
function R(e, t, n, r) {
|
|
930
|
+
return (e !== t || _(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && z(e, n);
|
|
919
931
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
932
|
+
function z(e, t) {
|
|
933
|
+
return _(t.enabled, e) !== !1 && e.isStaleByTime(g(t.staleTime, e));
|
|
922
934
|
}
|
|
923
935
|
function ve(e, t) {
|
|
924
936
|
return !w(e.getCurrentResult(), t);
|
|
@@ -932,8 +944,8 @@ function ye(e) {
|
|
|
932
944
|
pageParams: []
|
|
933
945
|
}, c = 0, l = async () => {
|
|
934
946
|
let n = !1, l = (e) => {
|
|
935
|
-
|
|
936
|
-
}, u =
|
|
947
|
+
oe(e, () => t.signal, () => n = !0);
|
|
948
|
+
}, u = O(t.options, t.fetchOptions), d = async (e, r, i) => {
|
|
937
949
|
if (n) return Promise.reject();
|
|
938
950
|
if (r == null && e.pages.length) return Promise.resolve(e);
|
|
939
951
|
let a = await u((() => {
|
|
@@ -945,7 +957,7 @@ function ye(e) {
|
|
|
945
957
|
meta: t.options.meta
|
|
946
958
|
};
|
|
947
959
|
return l(e), e;
|
|
948
|
-
})()), { maxPages: o } = t.options, s = i ?
|
|
960
|
+
})()), { maxPages: o } = t.options, s = i ? ae : ie;
|
|
949
961
|
return {
|
|
950
962
|
pages: s(e.pages, a, o),
|
|
951
963
|
pageParams: s(e.pageParams, r, o)
|
|
@@ -984,7 +996,7 @@ function xe(e, { pages: t, pageParams: n }) {
|
|
|
984
996
|
}
|
|
985
997
|
//#endregion
|
|
986
998
|
//#region ../../node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
987
|
-
var Se = class extends
|
|
999
|
+
var Se = class extends fe {
|
|
988
1000
|
#e;
|
|
989
1001
|
#t;
|
|
990
1002
|
#n;
|
|
@@ -1026,7 +1038,7 @@ var Se = class extends ue {
|
|
|
1026
1038
|
meta: this.options.meta,
|
|
1027
1039
|
mutationKey: this.options.mutationKey
|
|
1028
1040
|
};
|
|
1029
|
-
this.#r =
|
|
1041
|
+
this.#r = de({
|
|
1030
1042
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, n) : Promise.reject(/* @__PURE__ */ Error("No mutationFn found")),
|
|
1031
1043
|
onFail: (e, t) => {
|
|
1032
1044
|
this.#i({
|
|
@@ -1142,7 +1154,7 @@ var Se = class extends ue {
|
|
|
1142
1154
|
status: "error"
|
|
1143
1155
|
};
|
|
1144
1156
|
}
|
|
1145
|
-
})(this.state),
|
|
1157
|
+
})(this.state), M.batch(() => {
|
|
1146
1158
|
this.#t.forEach((t) => {
|
|
1147
1159
|
t.onMutationUpdate(e);
|
|
1148
1160
|
}), this.#n.notify({
|
|
@@ -1187,7 +1199,7 @@ var we = class extends o {
|
|
|
1187
1199
|
}
|
|
1188
1200
|
add(e) {
|
|
1189
1201
|
this.#e.add(e);
|
|
1190
|
-
let t =
|
|
1202
|
+
let t = B(e);
|
|
1191
1203
|
if (typeof t == "string") {
|
|
1192
1204
|
let n = this.#t.get(t);
|
|
1193
1205
|
n ? n.push(e) : this.#t.set(t, [e]);
|
|
@@ -1199,7 +1211,7 @@ var we = class extends o {
|
|
|
1199
1211
|
}
|
|
1200
1212
|
remove(e) {
|
|
1201
1213
|
if (this.#e.delete(e)) {
|
|
1202
|
-
let t =
|
|
1214
|
+
let t = B(e);
|
|
1203
1215
|
if (typeof t == "string") {
|
|
1204
1216
|
let n = this.#t.get(t);
|
|
1205
1217
|
if (n) if (n.length > 1) {
|
|
@@ -1214,18 +1226,18 @@ var we = class extends o {
|
|
|
1214
1226
|
});
|
|
1215
1227
|
}
|
|
1216
1228
|
canRun(e) {
|
|
1217
|
-
let t =
|
|
1229
|
+
let t = B(e);
|
|
1218
1230
|
if (typeof t == "string") {
|
|
1219
1231
|
let n = this.#t.get(t)?.find((e) => e.state.status === "pending");
|
|
1220
1232
|
return !n || n === e;
|
|
1221
1233
|
} else return !0;
|
|
1222
1234
|
}
|
|
1223
1235
|
runNext(e) {
|
|
1224
|
-
let t =
|
|
1236
|
+
let t = B(e);
|
|
1225
1237
|
return typeof t == "string" ? (this.#t.get(t)?.find((t) => t !== e && t.state.isPaused))?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
1226
1238
|
}
|
|
1227
1239
|
clear() {
|
|
1228
|
-
|
|
1240
|
+
M.batch(() => {
|
|
1229
1241
|
this.#e.forEach((e) => {
|
|
1230
1242
|
this.notify({
|
|
1231
1243
|
type: "removed",
|
|
@@ -1242,13 +1254,13 @@ var we = class extends o {
|
|
|
1242
1254
|
exact: !0,
|
|
1243
1255
|
...e
|
|
1244
1256
|
};
|
|
1245
|
-
return this.getAll().find((e) =>
|
|
1257
|
+
return this.getAll().find((e) => y(t, e));
|
|
1246
1258
|
}
|
|
1247
1259
|
findAll(e = {}) {
|
|
1248
|
-
return this.getAll().filter((t) =>
|
|
1260
|
+
return this.getAll().filter((t) => y(e, t));
|
|
1249
1261
|
}
|
|
1250
1262
|
notify(e) {
|
|
1251
|
-
|
|
1263
|
+
M.batch(() => {
|
|
1252
1264
|
this.listeners.forEach((t) => {
|
|
1253
1265
|
t(e);
|
|
1254
1266
|
});
|
|
@@ -1256,10 +1268,10 @@ var we = class extends o {
|
|
|
1256
1268
|
}
|
|
1257
1269
|
resumePausedMutations() {
|
|
1258
1270
|
let e = this.getAll().filter((e) => e.state.isPaused);
|
|
1259
|
-
return
|
|
1271
|
+
return M.batch(() => Promise.all(e.map((e) => e.continue().catch(f))));
|
|
1260
1272
|
}
|
|
1261
1273
|
};
|
|
1262
|
-
function
|
|
1274
|
+
function B(e) {
|
|
1263
1275
|
return e.options.scope?.id;
|
|
1264
1276
|
}
|
|
1265
1277
|
//#endregion
|
|
@@ -1281,7 +1293,7 @@ var Te = class extends o {
|
|
|
1281
1293
|
type: "observerOptionsUpdated",
|
|
1282
1294
|
mutation: this.#n,
|
|
1283
1295
|
observer: this
|
|
1284
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
1296
|
+
}), t?.mutationKey && this.options.mutationKey && x(t.mutationKey) !== x(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
1285
1297
|
}
|
|
1286
1298
|
onUnsubscribe() {
|
|
1287
1299
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -1311,7 +1323,7 @@ var Te = class extends o {
|
|
|
1311
1323
|
};
|
|
1312
1324
|
}
|
|
1313
1325
|
#a(e) {
|
|
1314
|
-
|
|
1326
|
+
M.batch(() => {
|
|
1315
1327
|
if (this.#r && this.hasListeners()) {
|
|
1316
1328
|
let t = this.#t.variables, n = this.#t.context, r = {
|
|
1317
1329
|
client: this.#e,
|
|
@@ -1347,14 +1359,14 @@ var Te = class extends o {
|
|
|
1347
1359
|
});
|
|
1348
1360
|
});
|
|
1349
1361
|
}
|
|
1350
|
-
},
|
|
1362
|
+
}, Ee = class extends o {
|
|
1351
1363
|
constructor(e = {}) {
|
|
1352
1364
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
|
|
1353
1365
|
}
|
|
1354
1366
|
#e;
|
|
1355
1367
|
build(e, t, n) {
|
|
1356
|
-
let r = t.queryKey, i = t.queryHash ??
|
|
1357
|
-
return a || (a = new
|
|
1368
|
+
let r = t.queryKey, i = t.queryHash ?? b(r, t), a = this.get(i);
|
|
1369
|
+
return a || (a = new pe({
|
|
1358
1370
|
client: e,
|
|
1359
1371
|
queryKey: r,
|
|
1360
1372
|
queryHash: i,
|
|
@@ -1377,7 +1389,7 @@ var Te = class extends o {
|
|
|
1377
1389
|
}));
|
|
1378
1390
|
}
|
|
1379
1391
|
clear() {
|
|
1380
|
-
|
|
1392
|
+
M.batch(() => {
|
|
1381
1393
|
this.getAll().forEach((e) => {
|
|
1382
1394
|
this.remove(e);
|
|
1383
1395
|
});
|
|
@@ -1394,34 +1406,34 @@ var Te = class extends o {
|
|
|
1394
1406
|
exact: !0,
|
|
1395
1407
|
...e
|
|
1396
1408
|
};
|
|
1397
|
-
return this.getAll().find((e) =>
|
|
1409
|
+
return this.getAll().find((e) => v(t, e));
|
|
1398
1410
|
}
|
|
1399
1411
|
findAll(e = {}) {
|
|
1400
1412
|
let t = this.getAll();
|
|
1401
|
-
return Object.keys(e).length > 0 ? t.filter((t) =>
|
|
1413
|
+
return Object.keys(e).length > 0 ? t.filter((t) => v(e, t)) : t;
|
|
1402
1414
|
}
|
|
1403
1415
|
notify(e) {
|
|
1404
|
-
|
|
1416
|
+
M.batch(() => {
|
|
1405
1417
|
this.listeners.forEach((t) => {
|
|
1406
1418
|
t(e);
|
|
1407
1419
|
});
|
|
1408
1420
|
});
|
|
1409
1421
|
}
|
|
1410
1422
|
onFocus() {
|
|
1411
|
-
|
|
1423
|
+
M.batch(() => {
|
|
1412
1424
|
this.getAll().forEach((e) => {
|
|
1413
1425
|
e.onFocus();
|
|
1414
1426
|
});
|
|
1415
1427
|
});
|
|
1416
1428
|
}
|
|
1417
1429
|
onOnline() {
|
|
1418
|
-
|
|
1430
|
+
M.batch(() => {
|
|
1419
1431
|
this.getAll().forEach((e) => {
|
|
1420
1432
|
e.onOnline();
|
|
1421
1433
|
});
|
|
1422
1434
|
});
|
|
1423
1435
|
}
|
|
1424
|
-
},
|
|
1436
|
+
}, De = class {
|
|
1425
1437
|
#e;
|
|
1426
1438
|
#t;
|
|
1427
1439
|
#n;
|
|
@@ -1431,12 +1443,12 @@ var Te = class extends o {
|
|
|
1431
1443
|
#o;
|
|
1432
1444
|
#s;
|
|
1433
1445
|
constructor(e = {}) {
|
|
1434
|
-
this.#e = e.queryCache || new
|
|
1446
|
+
this.#e = e.queryCache || new Ee(), this.#t = e.mutationCache || new we(), this.#n = e.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
|
|
1435
1447
|
}
|
|
1436
1448
|
mount() {
|
|
1437
|
-
this.#a++, this.#a === 1 && (this.#o =
|
|
1449
|
+
this.#a++, this.#a === 1 && (this.#o = s.subscribe(async (e) => {
|
|
1438
1450
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1439
|
-
}), this.#s =
|
|
1451
|
+
}), this.#s = N.subscribe(async (e) => {
|
|
1440
1452
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
1441
1453
|
}));
|
|
1442
1454
|
}
|
|
@@ -1461,20 +1473,20 @@ var Te = class extends o {
|
|
|
1461
1473
|
}
|
|
1462
1474
|
ensureQueryData(e) {
|
|
1463
1475
|
let t = this.defaultQueryOptions(e), n = this.#e.build(this, t), r = n.state.data;
|
|
1464
|
-
return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && n.isStaleByTime(
|
|
1476
|
+
return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && n.isStaleByTime(g(t.staleTime, n)) && this.prefetchQuery(t), Promise.resolve(r));
|
|
1465
1477
|
}
|
|
1466
1478
|
getQueriesData(e) {
|
|
1467
1479
|
return this.#e.findAll(e).map(({ queryKey: e, state: t }) => [e, t.data]);
|
|
1468
1480
|
}
|
|
1469
1481
|
setQueryData(e, t, n) {
|
|
1470
|
-
let r = this.defaultQueryOptions({ queryKey: e }), i = this.#e.get(r.queryHash)?.state.data, a =
|
|
1482
|
+
let r = this.defaultQueryOptions({ queryKey: e }), i = this.#e.get(r.queryHash)?.state.data, a = p(t, i);
|
|
1471
1483
|
if (a !== void 0) return this.#e.build(this, r).setData(a, {
|
|
1472
1484
|
...n,
|
|
1473
1485
|
manual: !0
|
|
1474
1486
|
});
|
|
1475
1487
|
}
|
|
1476
1488
|
setQueriesData(e, t, n) {
|
|
1477
|
-
return
|
|
1489
|
+
return M.batch(() => this.#e.findAll(e).map(({ queryKey: e }) => [e, this.setQueryData(e, t, n)]));
|
|
1478
1490
|
}
|
|
1479
1491
|
getQueryState(e) {
|
|
1480
1492
|
let t = this.defaultQueryOptions({ queryKey: e });
|
|
@@ -1482,7 +1494,7 @@ var Te = class extends o {
|
|
|
1482
1494
|
}
|
|
1483
1495
|
removeQueries(e) {
|
|
1484
1496
|
let t = this.#e;
|
|
1485
|
-
|
|
1497
|
+
M.batch(() => {
|
|
1486
1498
|
t.findAll(e).forEach((e) => {
|
|
1487
1499
|
t.remove(e);
|
|
1488
1500
|
});
|
|
@@ -1490,7 +1502,7 @@ var Te = class extends o {
|
|
|
1490
1502
|
}
|
|
1491
1503
|
resetQueries(e, t) {
|
|
1492
1504
|
let n = this.#e;
|
|
1493
|
-
return
|
|
1505
|
+
return M.batch(() => (n.findAll(e).forEach((e) => {
|
|
1494
1506
|
e.reset();
|
|
1495
1507
|
}), this.refetchQueries({
|
|
1496
1508
|
type: "active",
|
|
@@ -1501,11 +1513,11 @@ var Te = class extends o {
|
|
|
1501
1513
|
let n = {
|
|
1502
1514
|
revert: !0,
|
|
1503
1515
|
...t
|
|
1504
|
-
}, r =
|
|
1505
|
-
return Promise.all(r).then(
|
|
1516
|
+
}, r = M.batch(() => this.#e.findAll(e).map((e) => e.cancel(n)));
|
|
1517
|
+
return Promise.all(r).then(f).catch(f);
|
|
1506
1518
|
}
|
|
1507
1519
|
invalidateQueries(e, t = {}) {
|
|
1508
|
-
return
|
|
1520
|
+
return M.batch(() => (this.#e.findAll(e).forEach((e) => {
|
|
1509
1521
|
e.invalidate();
|
|
1510
1522
|
}), e?.refetchType === "none" ? Promise.resolve() : this.refetchQueries({
|
|
1511
1523
|
...e,
|
|
@@ -1516,32 +1528,32 @@ var Te = class extends o {
|
|
|
1516
1528
|
let n = {
|
|
1517
1529
|
...t,
|
|
1518
1530
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
1519
|
-
}, r =
|
|
1531
|
+
}, r = M.batch(() => this.#e.findAll(e).filter((e) => !e.isDisabled() && !e.isStatic()).map((e) => {
|
|
1520
1532
|
let t = e.fetch(void 0, n);
|
|
1521
|
-
return n.throwOnError || (t = t.catch(
|
|
1533
|
+
return n.throwOnError || (t = t.catch(f)), e.state.fetchStatus === "paused" ? Promise.resolve() : t;
|
|
1522
1534
|
}));
|
|
1523
|
-
return Promise.all(r).then(
|
|
1535
|
+
return Promise.all(r).then(f);
|
|
1524
1536
|
}
|
|
1525
1537
|
fetchQuery(e) {
|
|
1526
1538
|
let t = this.defaultQueryOptions(e);
|
|
1527
1539
|
t.retry === void 0 && (t.retry = !1);
|
|
1528
1540
|
let n = this.#e.build(this, t);
|
|
1529
|
-
return n.isStaleByTime(
|
|
1541
|
+
return n.isStaleByTime(g(t.staleTime, n)) ? n.fetch(t) : Promise.resolve(n.state.data);
|
|
1530
1542
|
}
|
|
1531
1543
|
prefetchQuery(e) {
|
|
1532
|
-
return this.fetchQuery(e).then(
|
|
1544
|
+
return this.fetchQuery(e).then(f).catch(f);
|
|
1533
1545
|
}
|
|
1534
1546
|
fetchInfiniteQuery(e) {
|
|
1535
1547
|
return e.behavior = ye(e.pages), this.fetchQuery(e);
|
|
1536
1548
|
}
|
|
1537
1549
|
prefetchInfiniteQuery(e) {
|
|
1538
|
-
return this.fetchInfiniteQuery(e).then(
|
|
1550
|
+
return this.fetchInfiniteQuery(e).then(f).catch(f);
|
|
1539
1551
|
}
|
|
1540
1552
|
ensureInfiniteQueryData(e) {
|
|
1541
1553
|
return e.behavior = ye(e.pages), this.ensureQueryData(e);
|
|
1542
1554
|
}
|
|
1543
1555
|
resumePausedMutations() {
|
|
1544
|
-
return
|
|
1556
|
+
return N.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
1545
1557
|
}
|
|
1546
1558
|
getQueryCache() {
|
|
1547
1559
|
return this.#e;
|
|
@@ -1556,7 +1568,7 @@ var Te = class extends o {
|
|
|
1556
1568
|
this.#n = e;
|
|
1557
1569
|
}
|
|
1558
1570
|
setQueryDefaults(e, t) {
|
|
1559
|
-
this.#r.set(
|
|
1571
|
+
this.#r.set(x(e), {
|
|
1560
1572
|
queryKey: e,
|
|
1561
1573
|
defaultOptions: t
|
|
1562
1574
|
});
|
|
@@ -1564,11 +1576,11 @@ var Te = class extends o {
|
|
|
1564
1576
|
getQueryDefaults(e) {
|
|
1565
1577
|
let t = [...this.#r.values()], n = {};
|
|
1566
1578
|
return t.forEach((t) => {
|
|
1567
|
-
|
|
1579
|
+
S(e, t.queryKey) && Object.assign(n, t.defaultOptions);
|
|
1568
1580
|
}), n;
|
|
1569
1581
|
}
|
|
1570
1582
|
setMutationDefaults(e, t) {
|
|
1571
|
-
this.#i.set(
|
|
1583
|
+
this.#i.set(x(e), {
|
|
1572
1584
|
mutationKey: e,
|
|
1573
1585
|
defaultOptions: t
|
|
1574
1586
|
});
|
|
@@ -1576,7 +1588,7 @@ var Te = class extends o {
|
|
|
1576
1588
|
getMutationDefaults(e) {
|
|
1577
1589
|
let t = [...this.#i.values()], n = {};
|
|
1578
1590
|
return t.forEach((t) => {
|
|
1579
|
-
|
|
1591
|
+
S(e, t.mutationKey) && Object.assign(n, t.defaultOptions);
|
|
1580
1592
|
}), n;
|
|
1581
1593
|
}
|
|
1582
1594
|
defaultQueryOptions(e) {
|
|
@@ -1587,7 +1599,7 @@ var Te = class extends o {
|
|
|
1587
1599
|
...e,
|
|
1588
1600
|
_defaulted: !0
|
|
1589
1601
|
};
|
|
1590
|
-
return t.queryHash ||=
|
|
1602
|
+
return t.queryHash ||= b(t.queryKey, t), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === D && (t.enabled = !1), t;
|
|
1591
1603
|
}
|
|
1592
1604
|
defaultMutationOptions(e) {
|
|
1593
1605
|
return e?._defaulted ? e : {
|
|
@@ -1603,19 +1615,19 @@ var Te = class extends o {
|
|
|
1603
1615
|
}, V = /* @__PURE__ */ t({
|
|
1604
1616
|
Vue: () => a,
|
|
1605
1617
|
Vue2: () => void 0,
|
|
1606
|
-
del: () =>
|
|
1607
|
-
install: () =>
|
|
1618
|
+
del: () => je,
|
|
1619
|
+
install: () => ke,
|
|
1608
1620
|
isVue2: () => !1,
|
|
1609
1621
|
isVue3: () => !0,
|
|
1610
|
-
set: () =>
|
|
1622
|
+
set: () => Ae
|
|
1611
1623
|
});
|
|
1612
|
-
import * as
|
|
1613
|
-
r(V,
|
|
1614
|
-
function
|
|
1615
|
-
function
|
|
1624
|
+
import * as Oe from "vue";
|
|
1625
|
+
r(V, Oe);
|
|
1626
|
+
function ke() {}
|
|
1627
|
+
function Ae(e, t, n) {
|
|
1616
1628
|
return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
|
|
1617
1629
|
}
|
|
1618
|
-
function
|
|
1630
|
+
function je(e, t) {
|
|
1619
1631
|
if (Array.isArray(e)) {
|
|
1620
1632
|
e.splice(t, 1);
|
|
1621
1633
|
return;
|
|
@@ -1624,113 +1636,113 @@ function Ae(e, t) {
|
|
|
1624
1636
|
}
|
|
1625
1637
|
//#endregion
|
|
1626
1638
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/utils.js
|
|
1627
|
-
var
|
|
1628
|
-
function
|
|
1629
|
-
return `${
|
|
1639
|
+
var Me = "VUE_QUERY_CLIENT";
|
|
1640
|
+
function Ne(e) {
|
|
1641
|
+
return `${Me}${e ? `:${e}` : ""}`;
|
|
1630
1642
|
}
|
|
1631
|
-
function
|
|
1643
|
+
function H(e, t) {
|
|
1632
1644
|
Object.keys(e).forEach((n) => {
|
|
1633
1645
|
e[n] = t[n];
|
|
1634
1646
|
});
|
|
1635
1647
|
}
|
|
1636
|
-
function
|
|
1648
|
+
function U(e, t, n = "", r = 0) {
|
|
1637
1649
|
if (t) {
|
|
1638
1650
|
let i = t(e, n, r);
|
|
1639
1651
|
if (i === void 0 && (0, V.isRef)(e) || i !== void 0) return i;
|
|
1640
1652
|
}
|
|
1641
|
-
if (Array.isArray(e)) return e.map((e, n) =>
|
|
1642
|
-
if (typeof e == "object" &&
|
|
1643
|
-
let n = Object.entries(e).map(([e, n]) => [e,
|
|
1653
|
+
if (Array.isArray(e)) return e.map((e, n) => U(e, t, String(n), r + 1));
|
|
1654
|
+
if (typeof e == "object" && Fe(e)) {
|
|
1655
|
+
let n = Object.entries(e).map(([e, n]) => [e, U(n, t, e, r + 1)]);
|
|
1644
1656
|
return Object.fromEntries(n);
|
|
1645
1657
|
}
|
|
1646
1658
|
return e;
|
|
1647
1659
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return
|
|
1660
|
+
function Pe(e, t) {
|
|
1661
|
+
return U(e, t);
|
|
1650
1662
|
}
|
|
1651
|
-
function
|
|
1652
|
-
return
|
|
1653
|
-
if (r === 1 && n === "queryKey") return
|
|
1654
|
-
if (t &&
|
|
1655
|
-
if ((0, V.isRef)(e)) return
|
|
1663
|
+
function W(e, t = !1) {
|
|
1664
|
+
return Pe(e, (e, n, r) => {
|
|
1665
|
+
if (r === 1 && n === "queryKey") return W(e, !0);
|
|
1666
|
+
if (t && Ie(e)) return W(e(), t);
|
|
1667
|
+
if ((0, V.isRef)(e)) return W((0, V.unref)(e), t);
|
|
1656
1668
|
});
|
|
1657
1669
|
}
|
|
1658
|
-
function
|
|
1670
|
+
function Fe(e) {
|
|
1659
1671
|
if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
1660
1672
|
let t = Object.getPrototypeOf(e);
|
|
1661
1673
|
return t === null || t === Object.prototype;
|
|
1662
1674
|
}
|
|
1663
|
-
function
|
|
1675
|
+
function Ie(e) {
|
|
1664
1676
|
return typeof e == "function";
|
|
1665
1677
|
}
|
|
1666
1678
|
//#endregion
|
|
1667
1679
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/useQueryClient.js
|
|
1668
|
-
function
|
|
1680
|
+
function G(e = "") {
|
|
1669
1681
|
if (!(0, V.hasInjectionContext)()) throw Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");
|
|
1670
|
-
let t = (0, V.inject)(
|
|
1682
|
+
let t = (0, V.inject)(Ne(e));
|
|
1671
1683
|
if (!t) throw Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");
|
|
1672
1684
|
return t;
|
|
1673
1685
|
}
|
|
1674
1686
|
//#endregion
|
|
1675
1687
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/queryCache.js
|
|
1676
|
-
var
|
|
1688
|
+
var Le = class extends Ee {
|
|
1677
1689
|
find(e) {
|
|
1678
|
-
return super.find(
|
|
1690
|
+
return super.find(W(e));
|
|
1679
1691
|
}
|
|
1680
1692
|
findAll(e = {}) {
|
|
1681
|
-
return super.findAll(
|
|
1693
|
+
return super.findAll(W(e));
|
|
1682
1694
|
}
|
|
1683
|
-
},
|
|
1695
|
+
}, Re = class extends we {
|
|
1684
1696
|
find(e) {
|
|
1685
|
-
return super.find(
|
|
1697
|
+
return super.find(W(e));
|
|
1686
1698
|
}
|
|
1687
1699
|
findAll(e = {}) {
|
|
1688
|
-
return super.findAll(
|
|
1700
|
+
return super.findAll(W(e));
|
|
1689
1701
|
}
|
|
1690
|
-
},
|
|
1702
|
+
}, ze = class extends De {
|
|
1691
1703
|
constructor(e = {}) {
|
|
1692
1704
|
let t = {
|
|
1693
1705
|
defaultOptions: e.defaultOptions,
|
|
1694
|
-
queryCache: e.queryCache || new
|
|
1695
|
-
mutationCache: e.mutationCache || new
|
|
1706
|
+
queryCache: e.queryCache || new Le(),
|
|
1707
|
+
mutationCache: e.mutationCache || new Re()
|
|
1696
1708
|
};
|
|
1697
1709
|
super(t), this.isRestoring = (0, V.ref)(!1);
|
|
1698
1710
|
}
|
|
1699
1711
|
isFetching(e = {}) {
|
|
1700
|
-
return super.isFetching(
|
|
1712
|
+
return super.isFetching(W(e));
|
|
1701
1713
|
}
|
|
1702
1714
|
isMutating(e = {}) {
|
|
1703
|
-
return super.isMutating(
|
|
1715
|
+
return super.isMutating(W(e));
|
|
1704
1716
|
}
|
|
1705
1717
|
getQueryData(e) {
|
|
1706
|
-
return super.getQueryData(
|
|
1718
|
+
return super.getQueryData(W(e));
|
|
1707
1719
|
}
|
|
1708
1720
|
ensureQueryData(e) {
|
|
1709
|
-
return super.ensureQueryData(
|
|
1721
|
+
return super.ensureQueryData(W(e));
|
|
1710
1722
|
}
|
|
1711
1723
|
getQueriesData(e) {
|
|
1712
|
-
return super.getQueriesData(
|
|
1724
|
+
return super.getQueriesData(W(e));
|
|
1713
1725
|
}
|
|
1714
1726
|
setQueryData(e, t, n = {}) {
|
|
1715
|
-
return super.setQueryData(
|
|
1727
|
+
return super.setQueryData(W(e), t, W(n));
|
|
1716
1728
|
}
|
|
1717
1729
|
setQueriesData(e, t, n = {}) {
|
|
1718
|
-
return super.setQueriesData(
|
|
1730
|
+
return super.setQueriesData(W(e), t, W(n));
|
|
1719
1731
|
}
|
|
1720
1732
|
getQueryState(e) {
|
|
1721
|
-
return super.getQueryState(
|
|
1733
|
+
return super.getQueryState(W(e));
|
|
1722
1734
|
}
|
|
1723
1735
|
removeQueries(e = {}) {
|
|
1724
|
-
return super.removeQueries(
|
|
1736
|
+
return super.removeQueries(W(e));
|
|
1725
1737
|
}
|
|
1726
1738
|
resetQueries(e = {}, t = {}) {
|
|
1727
|
-
return super.resetQueries(
|
|
1739
|
+
return super.resetQueries(W(e), W(t));
|
|
1728
1740
|
}
|
|
1729
1741
|
cancelQueries(e = {}, t = {}) {
|
|
1730
|
-
return super.cancelQueries(
|
|
1742
|
+
return super.cancelQueries(W(e), W(t));
|
|
1731
1743
|
}
|
|
1732
1744
|
invalidateQueries(e = {}, t = {}) {
|
|
1733
|
-
let n =
|
|
1745
|
+
let n = W(e), r = W(t);
|
|
1734
1746
|
if (super.invalidateQueries({
|
|
1735
1747
|
...n,
|
|
1736
1748
|
refetchType: "none"
|
|
@@ -1742,54 +1754,54 @@ var Fe = class extends B {
|
|
|
1742
1754
|
return (0, V.nextTick)().then(() => super.refetchQueries(i, r));
|
|
1743
1755
|
}
|
|
1744
1756
|
refetchQueries(e = {}, t = {}) {
|
|
1745
|
-
return super.refetchQueries(
|
|
1757
|
+
return super.refetchQueries(W(e), W(t));
|
|
1746
1758
|
}
|
|
1747
1759
|
fetchQuery(e) {
|
|
1748
|
-
return super.fetchQuery(
|
|
1760
|
+
return super.fetchQuery(W(e));
|
|
1749
1761
|
}
|
|
1750
1762
|
prefetchQuery(e) {
|
|
1751
|
-
return super.prefetchQuery(
|
|
1763
|
+
return super.prefetchQuery(W(e));
|
|
1752
1764
|
}
|
|
1753
1765
|
fetchInfiniteQuery(e) {
|
|
1754
|
-
return super.fetchInfiniteQuery(
|
|
1766
|
+
return super.fetchInfiniteQuery(W(e));
|
|
1755
1767
|
}
|
|
1756
1768
|
prefetchInfiniteQuery(e) {
|
|
1757
|
-
return super.prefetchInfiniteQuery(
|
|
1769
|
+
return super.prefetchInfiniteQuery(W(e));
|
|
1758
1770
|
}
|
|
1759
1771
|
setDefaultOptions(e) {
|
|
1760
|
-
super.setDefaultOptions(
|
|
1772
|
+
super.setDefaultOptions(W(e));
|
|
1761
1773
|
}
|
|
1762
1774
|
setQueryDefaults(e, t) {
|
|
1763
|
-
super.setQueryDefaults(
|
|
1775
|
+
super.setQueryDefaults(W(e), W(t));
|
|
1764
1776
|
}
|
|
1765
1777
|
getQueryDefaults(e) {
|
|
1766
|
-
return super.getQueryDefaults(
|
|
1778
|
+
return super.getQueryDefaults(W(e));
|
|
1767
1779
|
}
|
|
1768
1780
|
setMutationDefaults(e, t) {
|
|
1769
|
-
super.setMutationDefaults(
|
|
1781
|
+
super.setMutationDefaults(W(e), W(t));
|
|
1770
1782
|
}
|
|
1771
1783
|
getMutationDefaults(e) {
|
|
1772
|
-
return super.getMutationDefaults(
|
|
1784
|
+
return super.getMutationDefaults(W(e));
|
|
1773
1785
|
}
|
|
1774
1786
|
};
|
|
1775
1787
|
//#endregion
|
|
1776
1788
|
//#region ../../node_modules/@vue/devtools-api/lib/esm/env.js
|
|
1777
|
-
function
|
|
1778
|
-
return
|
|
1789
|
+
function Be() {
|
|
1790
|
+
return Ve().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1779
1791
|
}
|
|
1780
|
-
function
|
|
1792
|
+
function Ve() {
|
|
1781
1793
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
1782
1794
|
}
|
|
1783
|
-
var
|
|
1784
|
-
function
|
|
1785
|
-
return
|
|
1795
|
+
var He = typeof Proxy == "function", Ue = "devtools-plugin:setup", We = "plugin:settings:set", K, q;
|
|
1796
|
+
function Ge() {
|
|
1797
|
+
return K === void 0 && (typeof window < "u" && window.performance ? (K = !0, q = window.performance) : typeof globalThis < "u" && globalThis.perf_hooks?.performance ? (K = !0, q = globalThis.perf_hooks.performance) : K = !1), K;
|
|
1786
1798
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1799
|
+
function Ke() {
|
|
1800
|
+
return Ge() ? q.now() : Date.now();
|
|
1789
1801
|
}
|
|
1790
1802
|
//#endregion
|
|
1791
1803
|
//#region ../../node_modules/@vue/devtools-api/lib/esm/proxy.js
|
|
1792
|
-
var
|
|
1804
|
+
var qe = class {
|
|
1793
1805
|
constructor(e, t) {
|
|
1794
1806
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = e, this.hook = t;
|
|
1795
1807
|
let n = {};
|
|
@@ -1810,9 +1822,9 @@ var Ge = class {
|
|
|
1810
1822
|
i = e;
|
|
1811
1823
|
},
|
|
1812
1824
|
now() {
|
|
1813
|
-
return
|
|
1825
|
+
return Ke();
|
|
1814
1826
|
}
|
|
1815
|
-
}, t && t.on(
|
|
1827
|
+
}, t && t.on(We, (e, t) => {
|
|
1816
1828
|
e === this.plugin.id && this.fallbacks.setSettings(t);
|
|
1817
1829
|
}), this.proxiedOn = new Proxy({}, { get: (e, t) => this.target ? this.target.on[t] : (...e) => {
|
|
1818
1830
|
this.onQueue.push({
|
|
@@ -1839,11 +1851,11 @@ var Ge = class {
|
|
|
1839
1851
|
};
|
|
1840
1852
|
//#endregion
|
|
1841
1853
|
//#region ../../node_modules/@vue/devtools-api/lib/esm/index.js
|
|
1842
|
-
function
|
|
1843
|
-
let n = e, r =
|
|
1844
|
-
if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !a)) i.emit(
|
|
1854
|
+
function Je(e, t) {
|
|
1855
|
+
let n = e, r = Ve(), i = Be(), a = He && n.enableEarlyProxy;
|
|
1856
|
+
if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !a)) i.emit(Ue, e, t);
|
|
1845
1857
|
else {
|
|
1846
|
-
let e = a ? new
|
|
1858
|
+
let e = a ? new qe(n, i) : null;
|
|
1847
1859
|
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1848
1860
|
pluginDescriptor: n,
|
|
1849
1861
|
setupFn: t,
|
|
@@ -1853,7 +1865,7 @@ function Ke(e, t) {
|
|
|
1853
1865
|
}
|
|
1854
1866
|
//#endregion
|
|
1855
1867
|
//#region ../../node_modules/@tanstack/match-sorter-utils/build/lib/index.mjs
|
|
1856
|
-
var
|
|
1868
|
+
var Ye = {
|
|
1857
1869
|
À: "A",
|
|
1858
1870
|
Á: "A",
|
|
1859
1871
|
Â: "A",
|
|
@@ -2253,11 +2265,11 @@ var qe = {
|
|
|
2253
2265
|
x̧: "x",
|
|
2254
2266
|
Z̧: "Z",
|
|
2255
2267
|
z̧: "z"
|
|
2256
|
-
},
|
|
2257
|
-
function
|
|
2258
|
-
return e.replace(
|
|
2268
|
+
}, Xe = Object.keys(Ye).join("|"), Ze = new RegExp(Xe, "g");
|
|
2269
|
+
function Qe(e) {
|
|
2270
|
+
return e.replace(Ze, (e) => Ye[e]);
|
|
2259
2271
|
}
|
|
2260
|
-
var
|
|
2272
|
+
var J = {
|
|
2261
2273
|
CASE_SENSITIVE_EQUAL: 7,
|
|
2262
2274
|
EQUAL: 6,
|
|
2263
2275
|
STARTS_WITH: 5,
|
|
@@ -2267,9 +2279,9 @@ var Y = {
|
|
|
2267
2279
|
MATCHES: 1,
|
|
2268
2280
|
NO_MATCH: 0
|
|
2269
2281
|
};
|
|
2270
|
-
function
|
|
2271
|
-
if (n ||= {}, n.threshold = n.threshold ??
|
|
2272
|
-
let r =
|
|
2282
|
+
function $e(e, t, n) {
|
|
2283
|
+
if (n ||= {}, n.threshold = n.threshold ?? J.MATCHES, !n.accessors) {
|
|
2284
|
+
let r = et(e, t, n);
|
|
2273
2285
|
return {
|
|
2274
2286
|
rankedValue: e,
|
|
2275
2287
|
rank: r,
|
|
@@ -2278,23 +2290,23 @@ function Ze(e, t, n) {
|
|
|
2278
2290
|
passed: r >= n.threshold
|
|
2279
2291
|
};
|
|
2280
2292
|
}
|
|
2281
|
-
let r =
|
|
2293
|
+
let r = at(e, n.accessors), i = {
|
|
2282
2294
|
rankedValue: e,
|
|
2283
|
-
rank:
|
|
2295
|
+
rank: J.NO_MATCH,
|
|
2284
2296
|
accessorIndex: -1,
|
|
2285
2297
|
accessorThreshold: n.threshold,
|
|
2286
2298
|
passed: !1
|
|
2287
2299
|
};
|
|
2288
2300
|
for (let e = 0; e < r.length; e++) {
|
|
2289
|
-
let a = r[e], o =
|
|
2290
|
-
o < s && o >=
|
|
2301
|
+
let a = r[e], o = et(a.itemValue, t, n), { minRanking: s, maxRanking: c, threshold: l = n.threshold } = a.attributes;
|
|
2302
|
+
o < s && o >= J.MATCHES ? o = s : o > c && (o = c), o = Math.min(o, c), o >= l && o > i.rank && (i.rank = o, i.passed = !0, i.accessorIndex = e, i.accessorThreshold = l, i.rankedValue = a.itemValue);
|
|
2291
2303
|
}
|
|
2292
2304
|
return i;
|
|
2293
2305
|
}
|
|
2294
|
-
function
|
|
2295
|
-
return e =
|
|
2306
|
+
function et(e, t, n) {
|
|
2307
|
+
return e = rt(e, n), t = rt(t, n), t.length > e.length ? J.NO_MATCH : e === t ? J.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? J.EQUAL : e.startsWith(t) ? J.STARTS_WITH : e.includes(` ${t}`) ? J.WORD_STARTS_WITH : e.includes(t) ? J.CONTAINS : t.length === 1 ? J.NO_MATCH : tt(e).includes(t) ? J.ACRONYM : nt(e, t));
|
|
2296
2308
|
}
|
|
2297
|
-
function
|
|
2309
|
+
function tt(e) {
|
|
2298
2310
|
let t = "";
|
|
2299
2311
|
return e.split(" ").forEach((e) => {
|
|
2300
2312
|
e.split("-").forEach((e) => {
|
|
@@ -2302,7 +2314,7 @@ function $e(e) {
|
|
|
2302
2314
|
});
|
|
2303
2315
|
}), t;
|
|
2304
2316
|
}
|
|
2305
|
-
function
|
|
2317
|
+
function nt(e, t) {
|
|
2306
2318
|
let n = 0, r = 0;
|
|
2307
2319
|
function i(e, t, r) {
|
|
2308
2320
|
for (let i = r, a = t.length; i < a; i++) if (t[i] === e) return n += 1, i + 1;
|
|
@@ -2310,31 +2322,31 @@ function et(e, t) {
|
|
|
2310
2322
|
}
|
|
2311
2323
|
function a(e) {
|
|
2312
2324
|
let r = 1 / e, i = n / t.length;
|
|
2313
|
-
return
|
|
2325
|
+
return J.MATCHES + i * r;
|
|
2314
2326
|
}
|
|
2315
2327
|
let o = i(t[0], e, 0);
|
|
2316
|
-
if (o < 0) return
|
|
2328
|
+
if (o < 0) return J.NO_MATCH;
|
|
2317
2329
|
r = o;
|
|
2318
2330
|
for (let n = 1, a = t.length; n < a; n++) {
|
|
2319
2331
|
let a = t[n];
|
|
2320
|
-
if (r = i(a, e, r), !(r > -1)) return
|
|
2332
|
+
if (r = i(a, e, r), !(r > -1)) return J.NO_MATCH;
|
|
2321
2333
|
}
|
|
2322
2334
|
return a(r - o);
|
|
2323
2335
|
}
|
|
2324
|
-
function
|
|
2336
|
+
function rt(e, t) {
|
|
2325
2337
|
let { keepDiacritics: n } = t;
|
|
2326
|
-
return e = `${e}`, n || (e =
|
|
2338
|
+
return e = `${e}`, n || (e = Qe(e)), e;
|
|
2327
2339
|
}
|
|
2328
|
-
function
|
|
2340
|
+
function it(e, t) {
|
|
2329
2341
|
let n = t;
|
|
2330
2342
|
typeof t == "object" && (n = t.accessor);
|
|
2331
2343
|
let r = n(e);
|
|
2332
2344
|
return r == null ? [] : Array.isArray(r) ? r : [String(r)];
|
|
2333
2345
|
}
|
|
2334
|
-
function
|
|
2346
|
+
function at(e, t) {
|
|
2335
2347
|
let n = [];
|
|
2336
2348
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
2337
|
-
let i = t[r], a =
|
|
2349
|
+
let i = t[r], a = st(i), o = it(e, i);
|
|
2338
2350
|
for (let e = 0, t = o.length; e < t; e++) n.push({
|
|
2339
2351
|
itemValue: o[e],
|
|
2340
2352
|
attributes: a
|
|
@@ -2342,39 +2354,39 @@ function rt(e, t) {
|
|
|
2342
2354
|
}
|
|
2343
2355
|
return n;
|
|
2344
2356
|
}
|
|
2345
|
-
var
|
|
2357
|
+
var ot = {
|
|
2346
2358
|
maxRanking: Infinity,
|
|
2347
2359
|
minRanking: -Infinity
|
|
2348
2360
|
};
|
|
2349
|
-
function
|
|
2350
|
-
return typeof e == "function" ?
|
|
2351
|
-
...
|
|
2361
|
+
function st(e) {
|
|
2362
|
+
return typeof e == "function" ? ot : {
|
|
2363
|
+
...ot,
|
|
2352
2364
|
...e
|
|
2353
2365
|
};
|
|
2354
2366
|
}
|
|
2355
2367
|
//#endregion
|
|
2356
2368
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/devtools/utils.js
|
|
2357
|
-
function
|
|
2369
|
+
function Y(e) {
|
|
2358
2370
|
return e.state.fetchStatus === "fetching" ? 0 : e.state.fetchStatus === "paused" ? 4 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3;
|
|
2359
2371
|
}
|
|
2360
|
-
function
|
|
2361
|
-
let t =
|
|
2372
|
+
function X(e) {
|
|
2373
|
+
let t = Y(e);
|
|
2362
2374
|
return t === 0 ? "fetching" : t === 4 ? "paused" : t === 2 ? "stale" : t === 3 ? "inactive" : "fresh";
|
|
2363
2375
|
}
|
|
2364
|
-
function st(e) {
|
|
2365
|
-
return X(e) === 2 ? 0 : 16777215;
|
|
2366
|
-
}
|
|
2367
2376
|
function ct(e) {
|
|
2368
|
-
|
|
2377
|
+
return Y(e) === 2 ? 0 : 16777215;
|
|
2378
|
+
}
|
|
2379
|
+
function lt(e) {
|
|
2380
|
+
let t = Y(e);
|
|
2369
2381
|
return t === 0 ? 27647 : t === 4 ? 9193963 : t === 2 ? 16757248 : t === 3 ? 4148832 : 33575;
|
|
2370
2382
|
}
|
|
2371
|
-
var
|
|
2372
|
-
"Status > Last Updated":
|
|
2373
|
-
"Query Hash":
|
|
2374
|
-
"Last Updated":
|
|
2383
|
+
var ut = (e, t) => e.queryHash.localeCompare(t.queryHash), dt = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, ft = (e, t) => Y(e) === Y(t) ? dt(e, t) : Y(e) > Y(t) ? 1 : -1, Z = {
|
|
2384
|
+
"Status > Last Updated": ft,
|
|
2385
|
+
"Query Hash": ut,
|
|
2386
|
+
"Last Updated": dt
|
|
2375
2387
|
}, Q = "vue-query", $ = "Vue Query";
|
|
2376
|
-
function
|
|
2377
|
-
|
|
2388
|
+
function pt(e, t) {
|
|
2389
|
+
Je({
|
|
2378
2390
|
id: Q,
|
|
2379
2391
|
label: $,
|
|
2380
2392
|
packageName: "vue-query",
|
|
@@ -2420,7 +2432,7 @@ function ft(e, t) {
|
|
|
2420
2432
|
}
|
|
2421
2433
|
}, (e) => {
|
|
2422
2434
|
let n = e.getSettings();
|
|
2423
|
-
|
|
2435
|
+
N.setOnline(!!n.onlineMode.valueOf());
|
|
2424
2436
|
let r = t.getQueryCache();
|
|
2425
2437
|
e.addInspector({
|
|
2426
2438
|
id: Q,
|
|
@@ -2501,19 +2513,19 @@ function ft(e, t) {
|
|
|
2501
2513
|
}
|
|
2502
2514
|
});
|
|
2503
2515
|
}), e.on.setPluginSettings((e) => {
|
|
2504
|
-
e.key === "onlineMode" &&
|
|
2516
|
+
e.key === "onlineMode" && N.setOnline(!!e.newValue);
|
|
2505
2517
|
}), e.on.getInspectorTree((t) => {
|
|
2506
2518
|
if (t.inspectorId === Q) {
|
|
2507
2519
|
let n = r.getAll(), i = e.getSettings();
|
|
2508
|
-
t.rootNodes = (t.filter ? n.filter((e) =>
|
|
2509
|
-
let t =
|
|
2520
|
+
t.rootNodes = (t.filter ? n.filter((e) => $e(e.queryHash, t.filter).passed) : [...n]).sort((e, t) => Z[i.sortFn](e, t) * i.baseSort).map((e) => {
|
|
2521
|
+
let t = X(e);
|
|
2510
2522
|
return {
|
|
2511
2523
|
id: e.queryHash,
|
|
2512
2524
|
label: e.queryHash,
|
|
2513
2525
|
tags: [{
|
|
2514
2526
|
label: `${t} [${e.getObserversCount()}]`,
|
|
2515
|
-
textColor:
|
|
2516
|
-
backgroundColor:
|
|
2527
|
+
textColor: ct(e),
|
|
2528
|
+
backgroundColor: lt(e)
|
|
2517
2529
|
}]
|
|
2518
2530
|
};
|
|
2519
2531
|
});
|
|
@@ -2530,7 +2542,7 @@ function ft(e, t) {
|
|
|
2530
2542
|
},
|
|
2531
2543
|
{
|
|
2532
2544
|
key: "Query status",
|
|
2533
|
-
value:
|
|
2545
|
+
value: X(t)
|
|
2534
2546
|
},
|
|
2535
2547
|
{
|
|
2536
2548
|
key: "Observers",
|
|
@@ -2556,9 +2568,9 @@ function ft(e, t) {
|
|
|
2556
2568
|
}
|
|
2557
2569
|
//#endregion
|
|
2558
2570
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/vueQueryPlugin.js
|
|
2559
|
-
var
|
|
2560
|
-
let n =
|
|
2561
|
-
r = "queryClient" in t && t.queryClient ? t.queryClient : new
|
|
2571
|
+
var mt = { install: (e, t = {}) => {
|
|
2572
|
+
let n = Ne(t.queryClientKey), r;
|
|
2573
|
+
r = "queryClient" in t && t.queryClient ? t.queryClient : new ze("queryClientConfig" in t ? t.queryClientConfig : void 0), d || r.mount();
|
|
2562
2574
|
let i = () => {};
|
|
2563
2575
|
if (t.clientPersister) {
|
|
2564
2576
|
r.isRestoring && (r.isRestoring.value = !0);
|
|
@@ -2577,27 +2589,27 @@ var pt = { install: (e, t = {}) => {
|
|
|
2577
2589
|
a(), t();
|
|
2578
2590
|
};
|
|
2579
2591
|
}
|
|
2580
|
-
e.provide(n, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin &&
|
|
2592
|
+
e.provide(n, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin && pt(e, r);
|
|
2581
2593
|
} };
|
|
2582
2594
|
//#endregion
|
|
2583
2595
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/useBaseQuery.js
|
|
2584
|
-
function
|
|
2596
|
+
function ht(e, t, n) {
|
|
2585
2597
|
process.env.NODE_ENV === "development" && ((0, V.getCurrentScope)() || console.warn("vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks."));
|
|
2586
|
-
let r = n ||
|
|
2598
|
+
let r = n || G(), i = (0, V.computed)(() => {
|
|
2587
2599
|
let e = t;
|
|
2588
2600
|
typeof e == "function" && (e = e());
|
|
2589
|
-
let n =
|
|
2601
|
+
let n = W(e);
|
|
2590
2602
|
typeof n.enabled == "function" && (n.enabled = n.enabled());
|
|
2591
2603
|
let i = r.defaultQueryOptions(n);
|
|
2592
2604
|
return i._optimisticResults = r.isRestoring?.value ? "isRestoring" : "optimistic", i;
|
|
2593
2605
|
}), a = new e(r, i.value), o = i.value.shallow ? (0, V.shallowReactive)(a.getCurrentResult()) : (0, V.reactive)(a.getCurrentResult()), s = () => {};
|
|
2594
2606
|
r.isRestoring && (0, V.watch)(r.isRestoring, (e) => {
|
|
2595
2607
|
e || (s(), s = a.subscribe((e) => {
|
|
2596
|
-
|
|
2608
|
+
H(o, e);
|
|
2597
2609
|
}));
|
|
2598
2610
|
}, { immediate: !0 });
|
|
2599
2611
|
let c = () => {
|
|
2600
|
-
a.setOptions(i.value),
|
|
2612
|
+
a.setOptions(i.value), H(o, a.getCurrentResult());
|
|
2601
2613
|
};
|
|
2602
2614
|
(0, V.watch)(i, c), (0, V.onScopeDispose)(() => {
|
|
2603
2615
|
s();
|
|
@@ -2608,14 +2620,14 @@ function mt(e, t, n) {
|
|
|
2608
2620
|
a.setOptions(i.value);
|
|
2609
2621
|
let r = a.getOptimisticResult(i.value);
|
|
2610
2622
|
r.isStale ? (n(), a.fetchOptimistic(i.value).then(e, (n) => {
|
|
2611
|
-
|
|
2623
|
+
k(i.value.throwOnError, [n, a.getCurrentQuery()]) ? t(n) : e(a.getCurrentResult());
|
|
2612
2624
|
})) : (n(), e(r));
|
|
2613
2625
|
}
|
|
2614
2626
|
};
|
|
2615
2627
|
r(), n = (0, V.watch)(i, r);
|
|
2616
2628
|
});
|
|
2617
2629
|
(0, V.watch)(() => o.error, (e) => {
|
|
2618
|
-
if (o.isError && !o.isFetching &&
|
|
2630
|
+
if (o.isError && !o.isFetching && k(i.value.throwOnError, [e, a.getCurrentQuery()])) throw e;
|
|
2619
2631
|
});
|
|
2620
2632
|
let d = (0, V.toRefs)(i.value.shallow ? (0, V.shallowReadonly)(o) : (0, V.readonly)(o));
|
|
2621
2633
|
for (let e in o) typeof o[e] == "function" && (d[e] = o[e]);
|
|
@@ -2623,18 +2635,18 @@ function mt(e, t, n) {
|
|
|
2623
2635
|
}
|
|
2624
2636
|
//#endregion
|
|
2625
2637
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/useQuery.js
|
|
2626
|
-
function
|
|
2627
|
-
return
|
|
2638
|
+
function gt(e, t) {
|
|
2639
|
+
return ht(ge, e, t);
|
|
2628
2640
|
}
|
|
2629
2641
|
//#endregion
|
|
2630
2642
|
//#region ../../node_modules/@tanstack/vue-query/build/modern/useMutation.js
|
|
2631
|
-
function
|
|
2643
|
+
function _t(e, t) {
|
|
2632
2644
|
process.env.NODE_ENV === "development" && ((0, V.getCurrentScope)() || console.warn("vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks."));
|
|
2633
|
-
let n = t ||
|
|
2645
|
+
let n = t || G(), r = (0, V.computed)(() => {
|
|
2634
2646
|
let t = typeof e == "function" ? e() : e;
|
|
2635
|
-
return n.defaultMutationOptions(
|
|
2647
|
+
return n.defaultMutationOptions(W(t));
|
|
2636
2648
|
}), i = new Te(n, r.value), a = r.value.shallow ? (0, V.shallowReactive)(i.getCurrentResult()) : (0, V.reactive)(i.getCurrentResult()), o = i.subscribe((e) => {
|
|
2637
|
-
|
|
2649
|
+
H(a, e);
|
|
2638
2650
|
}), s = (e, t) => {
|
|
2639
2651
|
i.mutate(e, t).catch(() => {});
|
|
2640
2652
|
};
|
|
@@ -2645,7 +2657,7 @@ function gt(e, t) {
|
|
|
2645
2657
|
});
|
|
2646
2658
|
let c = (0, V.toRefs)(r.value.shallow ? (0, V.shallowReadonly)(a) : (0, V.readonly)(a));
|
|
2647
2659
|
return (0, V.watch)(() => a.error, (e) => {
|
|
2648
|
-
if (e &&
|
|
2660
|
+
if (e && k(r.value.throwOnError, [e])) throw e;
|
|
2649
2661
|
}), {
|
|
2650
2662
|
...c,
|
|
2651
2663
|
mutate: s,
|
|
@@ -2655,10 +2667,10 @@ function gt(e, t) {
|
|
|
2655
2667
|
}
|
|
2656
2668
|
//#endregion
|
|
2657
2669
|
//#region src/helpers/query.ts
|
|
2658
|
-
var
|
|
2659
|
-
function
|
|
2670
|
+
var vt = new ze();
|
|
2671
|
+
function yt(t, r, a) {
|
|
2660
2672
|
return { queryClientConfig: {
|
|
2661
|
-
queryCache: new
|
|
2673
|
+
queryCache: new Le({ onError: (o) => {
|
|
2662
2674
|
let s = o.code === "ERR_NETWORK", c = [403, 401].includes(o.response?.status);
|
|
2663
2675
|
s ? t.error("Ошибка подключения к сети") : c ? i(r, e, a) : t.error(n(o));
|
|
2664
2676
|
} }),
|
|
@@ -2675,4 +2687,4 @@ function vt(t, r, a) {
|
|
|
2675
2687
|
} };
|
|
2676
2688
|
}
|
|
2677
2689
|
//#endregion
|
|
2678
|
-
export {
|
|
2690
|
+
export { mt as VueQueryPlugin, vt as queryClient, _t as useMutation, gt as useQuery, G as useQueryClient, yt as vueQueryOptions };
|