@gen-epix/ui-client-common 4.8.0 → 4.10.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/dist/@types/mui.d.ts +2 -0
- package/dist/_chunks/CrudPage.js +3 -3
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +39 -35
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +602 -582
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +1668 -1659
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +41 -32
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +3 -3
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/{_cacheHas.js → _arrayIncludesWith.js} +17 -17
- package/dist/_chunks/_arrayIncludesWith.js.map +1 -0
- package/dist/_chunks/{isArrayLike.js → _arrayMap.js} +94 -94
- package/dist/_chunks/_arrayMap.js.map +1 -0
- package/dist/_chunks/_baseGet.js +61 -61
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +28 -28
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js +7 -7
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +74 -58
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +264 -262
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +46 -21
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +2 -2
- package/dist/_chunks/uniq.js.map +1 -1
- package/dist/_chunks/useMutation.js +17 -17
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +103 -103
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +8 -6
- package/dist/classes/services/EmotionCacheService/index.js +3 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/components/app/App/index.js +1 -1
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +2 -0
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -0
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +1 -1
- package/dist/components/ui/Sidebar/index.js.map +1 -1
- package/dist/components/ui/Table/Table.d.ts +4 -0
- package/dist/dataHooks/useSitesQuery/index.d.ts +1 -0
- package/dist/dataHooks/useSitesQuery/index.js +18 -0
- package/dist/dataHooks/useSitesQuery/index.js.map +1 -0
- package/dist/dataHooks/useSitesQuery/useSitesQuery.d.ts +5 -0
- package/dist/locale/en.json +2 -0
- package/dist/locale/nl.json +2 -0
- package/dist/models/table.models.d.ts +1 -1
- package/dist/models/table.models.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +12 -11
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +55 -55
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +90 -90
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/theme/demoTheme/index.js +6 -2
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +8 -1
- package/package.json +33 -27
- package/dist/_chunks/_baseFlatten.js +0 -26
- package/dist/_chunks/_baseFlatten.js.map +0 -1
- package/dist/_chunks/_cacheHas.js.map +0 -1
- package/dist/_chunks/isArrayLike.js.map +0 -1
- package/dist/test/lib/index.d.ts +0 -1
- package/dist/test/lib/render.d.ts +0 -2
package/dist/_chunks/query.js
CHANGED
|
@@ -1,11 +1,62 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
2
|
-
var e = {
|
|
1
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
2
|
+
var e = class {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
5
|
+
}
|
|
6
|
+
subscribe(e) {
|
|
7
|
+
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
8
|
+
this.listeners.delete(e), this.onUnsubscribe();
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
hasListeners() {
|
|
12
|
+
return this.listeners.size > 0;
|
|
13
|
+
}
|
|
14
|
+
onSubscribe() {}
|
|
15
|
+
onUnsubscribe() {}
|
|
16
|
+
}, t = new class extends e {
|
|
17
|
+
#e;
|
|
18
|
+
#t;
|
|
19
|
+
#n;
|
|
20
|
+
constructor() {
|
|
21
|
+
super(), this.#n = (e) => {
|
|
22
|
+
if (typeof window < "u" && window.addEventListener) {
|
|
23
|
+
let t = () => e();
|
|
24
|
+
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
25
|
+
window.removeEventListener("visibilitychange", t);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
onSubscribe() {
|
|
31
|
+
this.#t || this.setEventListener(this.#n);
|
|
32
|
+
}
|
|
33
|
+
onUnsubscribe() {
|
|
34
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
35
|
+
}
|
|
36
|
+
setEventListener(e) {
|
|
37
|
+
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
38
|
+
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
setFocused(e) {
|
|
42
|
+
this.#e !== e && (this.#e = e, this.onFocus());
|
|
43
|
+
}
|
|
44
|
+
onFocus() {
|
|
45
|
+
let e = this.isFocused();
|
|
46
|
+
this.listeners.forEach((t) => {
|
|
47
|
+
t(e);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
isFocused() {
|
|
51
|
+
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
52
|
+
}
|
|
53
|
+
}(), n = {
|
|
3
54
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
4
55
|
clearTimeout: (e) => clearTimeout(e),
|
|
5
56
|
setInterval: (e, t) => setInterval(e, t),
|
|
6
57
|
clearInterval: (e) => clearInterval(e)
|
|
7
|
-
},
|
|
8
|
-
#e =
|
|
58
|
+
}, r = new class {
|
|
59
|
+
#e = n;
|
|
9
60
|
#t = !1;
|
|
10
61
|
setTimeoutProvider(e) {
|
|
11
62
|
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.", {
|
|
@@ -26,30 +77,30 @@ var e = {
|
|
|
26
77
|
this.#e.clearInterval(e);
|
|
27
78
|
}
|
|
28
79
|
}();
|
|
29
|
-
function
|
|
80
|
+
function i(e) {
|
|
30
81
|
setTimeout(e, 0);
|
|
31
82
|
}
|
|
32
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
function
|
|
83
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/utils.js
|
|
84
|
+
var a = typeof window > "u" || "Deno" in globalThis;
|
|
85
|
+
function o() {}
|
|
86
|
+
function s(e, t) {
|
|
36
87
|
return typeof e == "function" ? e(t) : e;
|
|
37
88
|
}
|
|
38
|
-
function
|
|
89
|
+
function c(e) {
|
|
39
90
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
40
91
|
}
|
|
41
|
-
function
|
|
92
|
+
function l(e, t) {
|
|
42
93
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
43
94
|
}
|
|
44
|
-
function
|
|
95
|
+
function u(e, t) {
|
|
45
96
|
return typeof e == "function" ? e(t) : e;
|
|
46
97
|
}
|
|
47
|
-
function
|
|
98
|
+
function d(e, t) {
|
|
48
99
|
let { type: n = "all", exact: r, fetchStatus: i, predicate: a, queryKey: o, stale: s } = e;
|
|
49
100
|
if (o) {
|
|
50
101
|
if (r) {
|
|
51
|
-
if (t.queryHash !==
|
|
52
|
-
} else if (!
|
|
102
|
+
if (t.queryHash !== p(o, t.options)) return !1;
|
|
103
|
+
} else if (!h(t.queryKey, o)) return !1;
|
|
53
104
|
}
|
|
54
105
|
if (n !== "all") {
|
|
55
106
|
let e = t.isActive();
|
|
@@ -57,180 +108,186 @@ function l(e, t) {
|
|
|
57
108
|
}
|
|
58
109
|
return !(typeof s == "boolean" && t.isStale() !== s || i && i !== t.state.fetchStatus || a && !a(t));
|
|
59
110
|
}
|
|
60
|
-
function
|
|
111
|
+
function f(e, t) {
|
|
61
112
|
let { exact: n, status: r, predicate: i, mutationKey: a } = e;
|
|
62
113
|
if (a) {
|
|
63
114
|
if (!t.options.mutationKey) return !1;
|
|
64
115
|
if (n) {
|
|
65
|
-
if (
|
|
66
|
-
} else if (!
|
|
116
|
+
if (m(t.options.mutationKey) !== m(a)) return !1;
|
|
117
|
+
} else if (!h(t.options.mutationKey, a)) return !1;
|
|
67
118
|
}
|
|
68
119
|
return !(r && t.state.status !== r || i && !i(t));
|
|
69
120
|
}
|
|
70
|
-
function
|
|
71
|
-
return (t?.queryKeyHashFn ||
|
|
121
|
+
function p(e, t) {
|
|
122
|
+
return (t?.queryKeyHashFn || m)(e);
|
|
72
123
|
}
|
|
73
|
-
function
|
|
74
|
-
return JSON.stringify(e, (e, t) =>
|
|
124
|
+
function m(e) {
|
|
125
|
+
return JSON.stringify(e, (e, t) => b(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
75
126
|
}
|
|
76
|
-
function
|
|
127
|
+
function h(e, t) {
|
|
77
128
|
if (e === t) return !0;
|
|
78
129
|
if (typeof e != typeof t) return !1;
|
|
79
130
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
131
|
+
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
80
132
|
if (Array.isArray(e) && Array.isArray(t)) {
|
|
81
133
|
if (t.length > e.length) return !1;
|
|
82
|
-
for (let n = 0; n < t.length; n++) if (!
|
|
134
|
+
for (let n = 0; n < t.length; n++) if (!h(e[n], t[n])) return !1;
|
|
83
135
|
return !0;
|
|
84
136
|
}
|
|
85
137
|
let n = Object.keys(t);
|
|
86
|
-
for (let r of n) if (!
|
|
138
|
+
for (let r of n) if (!h(e[r], t[r])) return !1;
|
|
87
139
|
return !0;
|
|
88
140
|
}
|
|
89
141
|
return !1;
|
|
90
142
|
}
|
|
91
|
-
var
|
|
92
|
-
function
|
|
143
|
+
var g = Object.prototype.hasOwnProperty;
|
|
144
|
+
function _(e, t, n = 0) {
|
|
93
145
|
if (e === t) return e;
|
|
94
146
|
if (n > 500) return t;
|
|
95
|
-
let r =
|
|
96
|
-
if (!r && !(
|
|
147
|
+
let r = y(e) && y(t);
|
|
148
|
+
if (!r && !(b(e) && b(t))) return t;
|
|
97
149
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
98
150
|
for (let l = 0; l < o; l++) {
|
|
99
151
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
100
152
|
if (u === d) {
|
|
101
|
-
s[o] = u, (r ? l < i :
|
|
153
|
+
s[o] = u, (r ? l < i : g.call(e, o)) && c++;
|
|
102
154
|
continue;
|
|
103
155
|
}
|
|
104
156
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
105
157
|
s[o] = d;
|
|
106
158
|
continue;
|
|
107
159
|
}
|
|
108
|
-
let f =
|
|
160
|
+
let f = _(u, d, n + 1);
|
|
109
161
|
s[o] = f, f === u && c++;
|
|
110
162
|
}
|
|
111
163
|
return i === o && c === i ? e : s;
|
|
112
164
|
}
|
|
113
|
-
function
|
|
165
|
+
function v(e, t) {
|
|
114
166
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
115
|
-
for (let n of Object.keys(e)) if (!
|
|
167
|
+
for (let n of Object.keys(e)) if (!g.call(t, n) || e[n] !== t[n]) return !1;
|
|
116
168
|
return !0;
|
|
117
169
|
}
|
|
118
|
-
function
|
|
170
|
+
function y(e) {
|
|
119
171
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
120
172
|
}
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
173
|
+
function b(e) {
|
|
174
|
+
if (!x(e)) return !1;
|
|
123
175
|
let t = Object.getPrototypeOf(e), n = t?.constructor;
|
|
124
176
|
if (n === void 0) return !0;
|
|
125
177
|
if (typeof n != "function") return !1;
|
|
126
178
|
let r = n.prototype;
|
|
127
|
-
return !(!
|
|
179
|
+
return !(!x(r) || !r.hasOwnProperty("isPrototypeOf") || t !== Object.prototype);
|
|
128
180
|
}
|
|
129
|
-
function
|
|
181
|
+
function x(e) {
|
|
130
182
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
131
183
|
}
|
|
132
|
-
function
|
|
133
|
-
return new Promise((
|
|
134
|
-
|
|
184
|
+
function S(e) {
|
|
185
|
+
return new Promise((t) => {
|
|
186
|
+
r.setTimeout(t, e);
|
|
135
187
|
});
|
|
136
188
|
}
|
|
137
|
-
function
|
|
189
|
+
function C(e, t, n) {
|
|
138
190
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
139
191
|
if (n.structuralSharing !== !1) {
|
|
140
192
|
if (process.env.NODE_ENV !== "production") try {
|
|
141
|
-
return
|
|
193
|
+
return _(e, t);
|
|
142
194
|
} catch (e) {
|
|
143
195
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
144
196
|
}
|
|
145
|
-
return
|
|
197
|
+
return _(e, t);
|
|
146
198
|
}
|
|
147
199
|
return t;
|
|
148
200
|
}
|
|
149
|
-
function
|
|
150
|
-
let
|
|
151
|
-
return n &&
|
|
152
|
-
}
|
|
153
|
-
function C(e, t, n = 0) {
|
|
154
|
-
let r = [t, ...e];
|
|
155
|
-
return n && r.length > n ? r.slice(0, n) : r;
|
|
156
|
-
}
|
|
157
|
-
var w = Symbol();
|
|
158
|
-
function T(e, t) {
|
|
159
|
-
return process.env.NODE_ENV !== "production" && e.queryFn === w && 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 === w ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
201
|
+
function w(e, t, n, r) {
|
|
202
|
+
let i = r ? [t, ...e] : [...e, t];
|
|
203
|
+
return n && i.length > n ? r ? i.slice(0, n) : i.slice(-n) : i;
|
|
160
204
|
}
|
|
205
|
+
var T = Symbol();
|
|
161
206
|
function E(e, t) {
|
|
207
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === T && 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 === T ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
208
|
+
}
|
|
209
|
+
function D(e, t) {
|
|
162
210
|
return typeof e == "function" ? e(...t) : !!e;
|
|
163
211
|
}
|
|
164
|
-
var
|
|
165
|
-
function
|
|
212
|
+
var O = Symbol();
|
|
213
|
+
function k(e, t, n, r) {
|
|
166
214
|
let i = !1, a;
|
|
167
215
|
return Object.defineProperties(e, {
|
|
168
|
-
[
|
|
216
|
+
[O]: { value: r },
|
|
169
217
|
signal: {
|
|
170
218
|
enumerable: !0,
|
|
171
219
|
get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
|
|
172
220
|
}
|
|
173
221
|
}), e;
|
|
174
222
|
}
|
|
175
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
223
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
224
|
+
var A = () => a, j = () => A();
|
|
225
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
|
|
226
|
+
function M(e) {
|
|
227
|
+
return { onFetch: (t, n) => {
|
|
228
|
+
let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
|
|
229
|
+
pages: [],
|
|
230
|
+
pageParams: []
|
|
231
|
+
}, c = 0, l = async () => {
|
|
232
|
+
let n = !1, l = t, u = (e) => {
|
|
233
|
+
k(e, () => t.signal, () => n = !0, l[O]);
|
|
234
|
+
}, d = E(t.options, t.fetchOptions), f = async (e, r, i) => {
|
|
235
|
+
if (n) return Promise.reject(t.signal.reason);
|
|
236
|
+
if (r == null && e.pages.length) return Promise.resolve(e);
|
|
237
|
+
let a = (() => {
|
|
238
|
+
let e = {
|
|
239
|
+
client: t.client,
|
|
240
|
+
queryKey: t.queryKey,
|
|
241
|
+
pageParam: r,
|
|
242
|
+
direction: i ? "backward" : "forward",
|
|
243
|
+
meta: t.options.meta
|
|
244
|
+
};
|
|
245
|
+
return u(e), e;
|
|
246
|
+
})(), o = await d(a), { maxPages: s } = t.options;
|
|
247
|
+
return {
|
|
248
|
+
pages: w(e.pages, o, s, i),
|
|
249
|
+
pageParams: w(e.pageParams, r, s, i)
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
if (i && a.length) {
|
|
253
|
+
let e = i === "backward", t = e ? P : N, n = {
|
|
254
|
+
pages: a,
|
|
255
|
+
pageParams: o
|
|
200
256
|
};
|
|
257
|
+
s = await f(n, t(r, n), e);
|
|
258
|
+
} else {
|
|
259
|
+
let t = e ?? a.length;
|
|
260
|
+
do {
|
|
261
|
+
let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : N(r, s);
|
|
262
|
+
if (c > 0 && e == null) break;
|
|
263
|
+
s = await f(s, e), c++;
|
|
264
|
+
} while (c < t);
|
|
201
265
|
}
|
|
266
|
+
return s;
|
|
202
267
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
t(e);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
isFocused() {
|
|
225
|
-
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
226
|
-
}
|
|
227
|
-
}(), N = n;
|
|
228
|
-
function P() {
|
|
268
|
+
t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
|
|
269
|
+
client: t.client,
|
|
270
|
+
queryKey: t.queryKey,
|
|
271
|
+
meta: t.options.meta,
|
|
272
|
+
signal: t.signal
|
|
273
|
+
}, n) : l;
|
|
274
|
+
} };
|
|
275
|
+
}
|
|
276
|
+
function N(e, { pages: t, pageParams: n }) {
|
|
277
|
+
let r = t.length - 1;
|
|
278
|
+
return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
|
|
279
|
+
}
|
|
280
|
+
function P(e, { pages: t, pageParams: n }) {
|
|
281
|
+
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
|
|
282
|
+
}
|
|
283
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
284
|
+
var F = i;
|
|
285
|
+
function I() {
|
|
229
286
|
let e = [], t = 0, n = (e) => {
|
|
230
287
|
e();
|
|
231
288
|
}, r = (e) => {
|
|
232
289
|
e();
|
|
233
|
-
}, i =
|
|
290
|
+
}, i = F, a = (r) => {
|
|
234
291
|
t ? e.push(r) : i(() => {
|
|
235
292
|
n(r);
|
|
236
293
|
});
|
|
@@ -272,7 +329,23 @@ function P() {
|
|
|
272
329
|
}
|
|
273
330
|
};
|
|
274
331
|
}
|
|
275
|
-
var
|
|
332
|
+
var L = I(), R = class {
|
|
333
|
+
#e;
|
|
334
|
+
destroy() {
|
|
335
|
+
this.clearGcTimeout();
|
|
336
|
+
}
|
|
337
|
+
scheduleGc() {
|
|
338
|
+
this.clearGcTimeout(), c(this.gcTime) && (this.#e = r.setTimeout(() => {
|
|
339
|
+
this.optionalRemove();
|
|
340
|
+
}, this.gcTime));
|
|
341
|
+
}
|
|
342
|
+
updateGcTime(e) {
|
|
343
|
+
this.gcTime = Math.max(this.gcTime || 0, e ?? (j() ? Infinity : 3e5));
|
|
344
|
+
}
|
|
345
|
+
clearGcTimeout() {
|
|
346
|
+
this.#e !== void 0 && (r.clearTimeout(this.#e), this.#e = void 0);
|
|
347
|
+
}
|
|
348
|
+
}, z = new class extends e {
|
|
276
349
|
#e = !0;
|
|
277
350
|
#t;
|
|
278
351
|
#n;
|
|
@@ -304,145 +377,71 @@ var F = P(), I = new class extends j {
|
|
|
304
377
|
return this.#e;
|
|
305
378
|
}
|
|
306
379
|
}();
|
|
307
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
308
|
-
function
|
|
380
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
381
|
+
function B(e) {
|
|
309
382
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
310
383
|
}
|
|
311
|
-
function
|
|
312
|
-
return (e ?? "online") !== "online" ||
|
|
384
|
+
function V(e) {
|
|
385
|
+
return (e ?? "online") !== "online" || z.isOnline();
|
|
313
386
|
}
|
|
314
|
-
var
|
|
387
|
+
var H = class extends Error {
|
|
315
388
|
constructor(e) {
|
|
316
389
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
317
390
|
}
|
|
318
391
|
};
|
|
319
|
-
function
|
|
320
|
-
let
|
|
321
|
-
|
|
392
|
+
function U(e) {
|
|
393
|
+
let n = !1, r = 0, i, a = "pending", s, c, l = new Promise((e, t) => {
|
|
394
|
+
s = e, c = t;
|
|
322
395
|
});
|
|
323
|
-
|
|
324
|
-
let
|
|
325
|
-
if (!
|
|
326
|
-
let n = new
|
|
327
|
-
|
|
396
|
+
l.catch(o);
|
|
397
|
+
let u = () => a !== "pending", d = (t) => {
|
|
398
|
+
if (!u()) {
|
|
399
|
+
let n = new H(t);
|
|
400
|
+
_(n), e.onCancel?.(n);
|
|
328
401
|
}
|
|
329
|
-
}, d = () => {
|
|
330
|
-
t = !0;
|
|
331
402
|
}, f = () => {
|
|
332
|
-
|
|
333
|
-
}, p = () =>
|
|
334
|
-
|
|
335
|
-
}, g = (e) => {
|
|
336
|
-
|
|
337
|
-
}, _ = (
|
|
338
|
-
|
|
339
|
-
|
|
403
|
+
n = !0;
|
|
404
|
+
}, p = () => {
|
|
405
|
+
n = !1;
|
|
406
|
+
}, m = () => t.isFocused() && (e.networkMode === "always" || z.isOnline()) && e.canRun(), h = () => V(e.networkMode) && e.canRun(), g = (e) => {
|
|
407
|
+
u() || (i?.(), a = "resolved", s(e));
|
|
408
|
+
}, _ = (e) => {
|
|
409
|
+
u() || (i?.(), a = "rejected", c(e));
|
|
410
|
+
}, v = (t) => new Promise((n) => {
|
|
411
|
+
i = (e) => {
|
|
412
|
+
(u() || t()) && n(e);
|
|
340
413
|
}, e.onPause?.();
|
|
341
414
|
}).then(() => {
|
|
342
|
-
|
|
343
|
-
}),
|
|
344
|
-
if (
|
|
345
|
-
let
|
|
415
|
+
i = void 0, u() || e.onContinue?.();
|
|
416
|
+
}), y = () => {
|
|
417
|
+
if (u()) return;
|
|
418
|
+
let t, i = r === 0 ? e.initialPromise : void 0;
|
|
346
419
|
try {
|
|
347
|
-
|
|
420
|
+
t = i ?? e.fn();
|
|
348
421
|
} catch (e) {
|
|
349
|
-
|
|
422
|
+
t = Promise.reject(e);
|
|
350
423
|
}
|
|
351
|
-
Promise.resolve(
|
|
352
|
-
if (
|
|
353
|
-
let i = e.retry ?? (
|
|
354
|
-
|
|
355
|
-
|
|
424
|
+
Promise.resolve(t).then(g).catch((t) => {
|
|
425
|
+
if (u()) return;
|
|
426
|
+
let i = e.retry ?? (j() ? 0 : 3), a = e.retryDelay ?? B, o = typeof a == "function" ? a(r, t) : a, s = i === !0 || typeof i == "number" && r < i || typeof i == "function" && i(r, t);
|
|
427
|
+
n || !s ? _(t) : (r++, e.onFail?.(r, t), S(o).then(() => u() || m() ? void 0 : v(m)).then(() => {
|
|
428
|
+
n ? _(t) : y();
|
|
356
429
|
}));
|
|
357
430
|
});
|
|
358
431
|
};
|
|
359
432
|
return {
|
|
360
|
-
promise:
|
|
433
|
+
promise: l,
|
|
361
434
|
status: () => a,
|
|
362
|
-
cancel:
|
|
363
|
-
continue: () => (
|
|
364
|
-
cancelRetry:
|
|
365
|
-
continueRetry:
|
|
366
|
-
canStart:
|
|
367
|
-
start: () => (
|
|
435
|
+
cancel: d,
|
|
436
|
+
continue: () => (i?.(), l),
|
|
437
|
+
cancelRetry: f,
|
|
438
|
+
continueRetry: p,
|
|
439
|
+
canStart: h,
|
|
440
|
+
start: () => (h() ? y() : v(h).then(y), l)
|
|
368
441
|
};
|
|
369
442
|
}
|
|
370
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
371
|
-
|
|
372
|
-
return { onFetch: (t, n) => {
|
|
373
|
-
let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
|
|
374
|
-
pages: [],
|
|
375
|
-
pageParams: []
|
|
376
|
-
}, c = 0, l = async () => {
|
|
377
|
-
let n = !1, l = t, u = (e) => {
|
|
378
|
-
O(e, () => t.signal, () => n = !0, l[D]);
|
|
379
|
-
}, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
|
|
380
|
-
if (n) return Promise.reject(t.signal.reason);
|
|
381
|
-
if (r == null && e.pages.length) return Promise.resolve(e);
|
|
382
|
-
let a = (() => {
|
|
383
|
-
let e = {
|
|
384
|
-
client: t.client,
|
|
385
|
-
queryKey: t.queryKey,
|
|
386
|
-
pageParam: r,
|
|
387
|
-
direction: i ? "backward" : "forward",
|
|
388
|
-
meta: t.options.meta
|
|
389
|
-
};
|
|
390
|
-
return u(e), e;
|
|
391
|
-
})(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
|
|
392
|
-
return {
|
|
393
|
-
pages: c(e.pages, o, s),
|
|
394
|
-
pageParams: c(e.pageParams, r, s)
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
if (i && a.length) {
|
|
398
|
-
let e = i === "backward", t = e ? U : H, n = {
|
|
399
|
-
pages: a,
|
|
400
|
-
pageParams: o
|
|
401
|
-
};
|
|
402
|
-
s = await f(n, t(r, n), e);
|
|
403
|
-
} else {
|
|
404
|
-
let t = e ?? a.length;
|
|
405
|
-
do {
|
|
406
|
-
let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : H(r, s);
|
|
407
|
-
if (c > 0 && e == null) break;
|
|
408
|
-
s = await f(s, e), c++;
|
|
409
|
-
} while (c < t);
|
|
410
|
-
}
|
|
411
|
-
return s;
|
|
412
|
-
};
|
|
413
|
-
t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
|
|
414
|
-
client: t.client,
|
|
415
|
-
queryKey: t.queryKey,
|
|
416
|
-
meta: t.options.meta,
|
|
417
|
-
signal: t.signal
|
|
418
|
-
}, n) : l;
|
|
419
|
-
} };
|
|
420
|
-
}
|
|
421
|
-
function H(e, { pages: t, pageParams: n }) {
|
|
422
|
-
let r = t.length - 1;
|
|
423
|
-
return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
|
|
424
|
-
}
|
|
425
|
-
function U(e, { pages: t, pageParams: n }) {
|
|
426
|
-
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
|
|
427
|
-
}
|
|
428
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/removable.js
|
|
429
|
-
var W = class {
|
|
430
|
-
#e;
|
|
431
|
-
destroy() {
|
|
432
|
-
this.clearGcTimeout();
|
|
433
|
-
}
|
|
434
|
-
scheduleGc() {
|
|
435
|
-
this.clearGcTimeout(), o(this.gcTime) && (this.#e = t.setTimeout(() => {
|
|
436
|
-
this.optionalRemove();
|
|
437
|
-
}, this.gcTime));
|
|
438
|
-
}
|
|
439
|
-
updateGcTime(e) {
|
|
440
|
-
this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
|
|
441
|
-
}
|
|
442
|
-
clearGcTimeout() {
|
|
443
|
-
this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
|
|
444
|
-
}
|
|
445
|
-
}, G = class extends W {
|
|
443
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/query.js
|
|
444
|
+
var W = class extends R {
|
|
446
445
|
#e;
|
|
447
446
|
#t;
|
|
448
447
|
#n;
|
|
@@ -453,7 +452,7 @@ var W = class {
|
|
|
453
452
|
#s;
|
|
454
453
|
#c;
|
|
455
454
|
constructor(e) {
|
|
456
|
-
super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t =
|
|
455
|
+
super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = q(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
|
|
457
456
|
}
|
|
458
457
|
get meta() {
|
|
459
458
|
return this.options.meta;
|
|
@@ -469,16 +468,16 @@ var W = class {
|
|
|
469
468
|
...this.#s,
|
|
470
469
|
...e
|
|
471
470
|
}, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
472
|
-
let e =
|
|
473
|
-
e.data !== void 0 && (this.setState(
|
|
471
|
+
let e = q(this.options);
|
|
472
|
+
e.data !== void 0 && (this.setState(K(e.data, e.dataUpdatedAt)), this.#t = e);
|
|
474
473
|
}
|
|
475
474
|
}
|
|
476
475
|
optionalRemove() {
|
|
477
476
|
!this.observers.length && this.state.fetchStatus === "idle" && this.#r.remove(this);
|
|
478
477
|
}
|
|
479
478
|
setData(e, t) {
|
|
480
|
-
let n =
|
|
481
|
-
return this.#
|
|
479
|
+
let n = C(this.state.data, e, this.options);
|
|
480
|
+
return this.#u({
|
|
482
481
|
data: n,
|
|
483
482
|
type: "success",
|
|
484
483
|
dataUpdatedAt: t?.updatedAt,
|
|
@@ -486,17 +485,17 @@ var W = class {
|
|
|
486
485
|
}), n;
|
|
487
486
|
}
|
|
488
487
|
setState(e) {
|
|
489
|
-
this.#
|
|
488
|
+
this.#u({
|
|
490
489
|
type: "setState",
|
|
491
490
|
state: e
|
|
492
491
|
});
|
|
493
492
|
}
|
|
494
493
|
cancel(e) {
|
|
495
494
|
let t = this.#a?.promise;
|
|
496
|
-
return this.#a?.cancel(e), t ? t.then(
|
|
495
|
+
return this.#a?.cancel(e), t ? t.then(o).catch(o) : Promise.resolve();
|
|
497
496
|
}
|
|
498
497
|
destroy() {
|
|
499
|
-
|
|
498
|
+
this.cancel({ silent: !0 }), super.destroy();
|
|
500
499
|
}
|
|
501
500
|
get resetState() {
|
|
502
501
|
return this.#t;
|
|
@@ -505,22 +504,22 @@ var W = class {
|
|
|
505
504
|
this.destroy(), this.setState(this.resetState);
|
|
506
505
|
}
|
|
507
506
|
isActive() {
|
|
508
|
-
return this.observers.some((e) =>
|
|
507
|
+
return this.observers.some((e) => u(e.options.enabled, this) !== !1);
|
|
509
508
|
}
|
|
510
509
|
isDisabled() {
|
|
511
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
510
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === T || !this.isFetched();
|
|
512
511
|
}
|
|
513
512
|
isFetched() {
|
|
514
513
|
return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
|
|
515
514
|
}
|
|
516
515
|
isStatic() {
|
|
517
|
-
return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) =>
|
|
516
|
+
return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => u(e.options.staleTime, this) === "static");
|
|
518
517
|
}
|
|
519
518
|
isStale() {
|
|
520
519
|
return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
|
|
521
520
|
}
|
|
522
521
|
isStaleByTime(e = 0) {
|
|
523
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
522
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !l(this.state.dataUpdatedAt, e);
|
|
524
523
|
}
|
|
525
524
|
onFocus() {
|
|
526
525
|
this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#a?.continue();
|
|
@@ -537,7 +536,7 @@ var W = class {
|
|
|
537
536
|
}
|
|
538
537
|
removeObserver(e) {
|
|
539
538
|
let t = this.observers.indexOf(e);
|
|
540
|
-
t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this
|
|
539
|
+
t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.#l()), this.#r.notify({
|
|
541
540
|
type: "observerRemoved",
|
|
542
541
|
query: this,
|
|
543
542
|
observer: e
|
|
@@ -547,7 +546,7 @@ var W = class {
|
|
|
547
546
|
return this.observers.length;
|
|
548
547
|
}
|
|
549
548
|
invalidate() {
|
|
550
|
-
this.state.isInvalidated || this.#
|
|
549
|
+
this.state.isInvalidated || this.#u({ type: "invalidate" });
|
|
551
550
|
}
|
|
552
551
|
async fetch(e, t) {
|
|
553
552
|
if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
|
|
@@ -561,7 +560,7 @@ var W = class {
|
|
|
561
560
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));
|
|
562
561
|
let n = new AbortController(), r = (e) => {
|
|
563
562
|
Object.defineProperties(e, {
|
|
564
|
-
[
|
|
563
|
+
[O]: {
|
|
565
564
|
value: n.signal,
|
|
566
565
|
enumerable: !0
|
|
567
566
|
},
|
|
@@ -571,7 +570,7 @@ var W = class {
|
|
|
571
570
|
}
|
|
572
571
|
});
|
|
573
572
|
}, i = () => {
|
|
574
|
-
let e =
|
|
573
|
+
let e = E(this.options, t), n = (() => {
|
|
575
574
|
let e = {
|
|
576
575
|
client: this.#i,
|
|
577
576
|
queryKey: this.queryKey,
|
|
@@ -591,31 +590,31 @@ var W = class {
|
|
|
591
590
|
};
|
|
592
591
|
return r(e), e;
|
|
593
592
|
})();
|
|
594
|
-
(this.#e === "infinite" ?
|
|
593
|
+
(this.#e === "infinite" ? M(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#u({
|
|
595
594
|
type: "fetch",
|
|
596
595
|
meta: a.fetchOptions?.meta
|
|
597
596
|
});
|
|
598
|
-
let o = this.#a =
|
|
597
|
+
let o = this.#a = U({
|
|
599
598
|
initialPromise: t?.initialPromise,
|
|
600
599
|
fn: a.fetchFn,
|
|
601
600
|
onCancel: (e) => {
|
|
602
|
-
e instanceof
|
|
601
|
+
e instanceof H && e.revert && this.setState({
|
|
603
602
|
...this.#n,
|
|
604
603
|
fetchStatus: "idle"
|
|
605
604
|
}), n.abort();
|
|
606
605
|
},
|
|
607
606
|
onFail: (e, t) => {
|
|
608
|
-
this.#
|
|
607
|
+
this.#u({
|
|
609
608
|
type: "failed",
|
|
610
609
|
failureCount: e,
|
|
611
610
|
error: t
|
|
612
611
|
});
|
|
613
612
|
},
|
|
614
613
|
onPause: () => {
|
|
615
|
-
this.#
|
|
614
|
+
this.#u({ type: "pause" });
|
|
616
615
|
},
|
|
617
616
|
onContinue: () => {
|
|
618
|
-
this.#
|
|
617
|
+
this.#u({ type: "continue" });
|
|
619
618
|
},
|
|
620
619
|
retry: a.options.retry,
|
|
621
620
|
retryDelay: a.options.retryDelay,
|
|
@@ -627,7 +626,7 @@ var W = class {
|
|
|
627
626
|
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`);
|
|
628
627
|
return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
|
|
629
628
|
} catch (e) {
|
|
630
|
-
if (e instanceof
|
|
629
|
+
if (e instanceof H) {
|
|
631
630
|
if (e.silent) {
|
|
632
631
|
if (this.#a !== o && this.#o) return this.#o;
|
|
633
632
|
throw e;
|
|
@@ -637,17 +636,20 @@ var W = class {
|
|
|
637
636
|
return this.state.data;
|
|
638
637
|
}
|
|
639
638
|
}
|
|
640
|
-
throw this.#
|
|
639
|
+
throw this.#u({
|
|
641
640
|
type: "error",
|
|
642
641
|
error: e
|
|
643
642
|
}), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
|
|
644
643
|
} finally {
|
|
645
|
-
this.#a === o && (this.#a = void 0, this.#o = void 0), this
|
|
644
|
+
this.#a === o && (this.#a = void 0, this.#o = void 0), this.#l();
|
|
646
645
|
}
|
|
647
646
|
})();
|
|
648
647
|
return this.#o = s, o.start(), s;
|
|
649
648
|
}
|
|
650
|
-
#l(
|
|
649
|
+
#l() {
|
|
650
|
+
this.#r.get(this.queryHash) === this && this.scheduleGc();
|
|
651
|
+
}
|
|
652
|
+
#u(e) {
|
|
651
653
|
let t = (t) => {
|
|
652
654
|
switch (e.type) {
|
|
653
655
|
case "failed": return {
|
|
@@ -665,13 +667,13 @@ var W = class {
|
|
|
665
667
|
};
|
|
666
668
|
case "fetch": return {
|
|
667
669
|
...t,
|
|
668
|
-
...
|
|
670
|
+
...G(t.data, this.options),
|
|
669
671
|
fetchMeta: e.meta ?? null
|
|
670
672
|
};
|
|
671
673
|
case "success": {
|
|
672
674
|
let n = {
|
|
673
675
|
...t,
|
|
674
|
-
...
|
|
676
|
+
...K(e.data, e.dataUpdatedAt),
|
|
675
677
|
dataUpdateCount: t.dataUpdateCount + 1,
|
|
676
678
|
...!e.manual && {
|
|
677
679
|
fetchStatus: "idle",
|
|
@@ -705,7 +707,7 @@ var W = class {
|
|
|
705
707
|
};
|
|
706
708
|
}
|
|
707
709
|
};
|
|
708
|
-
this.state = t(this.state),
|
|
710
|
+
this.state = t(this.state), L.batch(() => {
|
|
709
711
|
this.observers.slice().forEach((e) => {
|
|
710
712
|
e.onQueryUpdate();
|
|
711
713
|
}), this.#r.notify({
|
|
@@ -716,18 +718,18 @@ var W = class {
|
|
|
716
718
|
});
|
|
717
719
|
}
|
|
718
720
|
};
|
|
719
|
-
function
|
|
721
|
+
function G(e, t) {
|
|
720
722
|
return {
|
|
721
723
|
fetchFailureCount: 0,
|
|
722
724
|
fetchFailureReason: null,
|
|
723
|
-
fetchStatus:
|
|
725
|
+
fetchStatus: V(t.networkMode) ? "fetching" : "paused",
|
|
724
726
|
...e === void 0 && {
|
|
725
727
|
error: null,
|
|
726
728
|
status: "pending"
|
|
727
729
|
}
|
|
728
730
|
};
|
|
729
731
|
}
|
|
730
|
-
function
|
|
732
|
+
function K(e, t) {
|
|
731
733
|
return {
|
|
732
734
|
data: e,
|
|
733
735
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -736,7 +738,7 @@ function q(e, t) {
|
|
|
736
738
|
status: "success"
|
|
737
739
|
};
|
|
738
740
|
}
|
|
739
|
-
function
|
|
741
|
+
function q(e) {
|
|
740
742
|
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;
|
|
741
743
|
return {
|
|
742
744
|
data: t,
|
|
@@ -753,6 +755,6 @@ function J(e) {
|
|
|
753
755
|
fetchStatus: "idle"
|
|
754
756
|
};
|
|
755
757
|
}
|
|
756
|
-
export {
|
|
758
|
+
export { t as C, r as S, u as _, R as a, T as b, s as c, c as d, f, C as g, h, z as i, m as l, o as m, G as n, L as o, d as p, U as r, j as s, W as t, p as u, v, e as w, l as x, D as y };
|
|
757
759
|
|
|
758
760
|
//# sourceMappingURL=query.js.map
|