zudoku 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/config/validators/common.d.ts +252 -252
- package/dist/config/validators/common.js +4 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +95 -95
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +1 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +2 -2
- package/dist/lib/components/TopNavigation.js +9 -12
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/context/ZudokuContext.js +9 -4
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +2 -2
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +12 -4
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +3 -3
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +13 -6
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +6 -6
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/vite/config.js +1 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -1
- package/dist/vite/plugin-docs.js +18 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/lib/{AuthenticationPlugin-Cr6xjOJD.js → AuthenticationPlugin-Cij2tPWa.js} +2 -2
- package/lib/{AuthenticationPlugin-Cr6xjOJD.js.map → AuthenticationPlugin-Cij2tPWa.js.map} +1 -1
- package/lib/{Spinner-C6n4eOvh.js → Button-Fp19CMUr.js} +15 -18
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/{Markdown-BlioIqkZ.js → Markdown-DT5Rrq8_.js} +3520 -3260
- package/lib/Markdown-DT5Rrq8_.js.map +1 -0
- package/lib/{MdxPage-7XnN9J9R.js → MdxPage-D2rD1vC4.js} +3 -3
- package/lib/{MdxPage-7XnN9J9R.js.map → MdxPage-D2rD1vC4.js.map} +1 -1
- package/lib/{OasProvider-BaRRMSsD.js → OasProvider-DdEBf2qS.js} +3 -3
- package/lib/{OasProvider-BaRRMSsD.js.map → OasProvider-DdEBf2qS.js.map} +1 -1
- package/lib/{OperationList-BjL1hzSx.js → OperationList-DT4-gm_S.js} +880 -878
- package/lib/OperationList-DT4-gm_S.js.map +1 -0
- package/lib/{Select-FAYHOYTy.js → Select-z1Lwl0-J.js} +3 -3
- package/lib/{Select-FAYHOYTy.js.map → Select-z1Lwl0-J.js.map} +1 -1
- package/lib/{SlotletProvider-CXb3wQiR.js → SlotletProvider-D8OBnr77.js} +2 -2
- package/lib/{SlotletProvider-CXb3wQiR.js.map → SlotletProvider-D8OBnr77.js.map} +1 -1
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/{hook-Bo80UX00.js → hook-DzQC8PzJ.js} +78 -74
- package/lib/hook-DzQC8PzJ.js.map +1 -0
- package/lib/{index-D5m8_oyY.js → index-DdQSV2RF.js} +31 -31
- package/lib/{index-D5m8_oyY.js.map → index-DdQSV2RF.js.map} +1 -1
- package/lib/{useQuery-CQUwWR9i.js → joinUrl-BjDooT-T.js} +240 -223
- package/lib/joinUrl-BjDooT-T.js.map +1 -0
- package/lib/{mutation-B81DztCT.js → mutation-_Z5C2wFZ.js} +2 -2
- package/lib/{mutation-B81DztCT.js.map → mutation-_Z5C2wFZ.js.map} +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Button.js +1 -1
- package/lib/ui/Button.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.components.js +188 -192
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-search-pagefind.js +15 -16
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +3 -1
- package/src/lib/components/InlineCode.tsx +3 -1
- package/src/lib/components/MobileTopNavigation.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +12 -16
- package/src/lib/components/context/ZudokuContext.ts +12 -4
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +2 -2
- package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
- package/src/lib/plugins/openapi/ParamInfos.tsx +27 -4
- package/src/lib/plugins/openapi/ParameterListItem.tsx +5 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +5 -2
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +48 -35
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/util/joinPath.tsx +3 -0
- package/lib/Markdown-BlioIqkZ.js.map +0 -1
- package/lib/OperationList-BjL1hzSx.js.map +0 -1
- package/lib/Spinner-C6n4eOvh.js.map +0 -1
- package/lib/hook-Bo80UX00.js.map +0 -1
- package/lib/joinUrl-10po2Jdj.js +0 -20
- package/lib/joinUrl-10po2Jdj.js.map +0 -1
- package/lib/useQuery-CQUwWR9i.js.map +0 -1
|
@@ -2,8 +2,8 @@ var Le = (t) => {
|
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
4
|
var pe = (t, e, s) => e.has(t) || Le("Cannot " + s);
|
|
5
|
-
var
|
|
6
|
-
import * as
|
|
5
|
+
var i = (t, e, s) => (pe(t, e, "read from private field"), s ? s.call(t) : e.get(t)), d = (t, e, s) => e.has(t) ? Le("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), h = (t, e, s, r) => (pe(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (pe(t, e, "access private method"), s);
|
|
6
|
+
import * as D from "react";
|
|
7
7
|
import { j as at } from "./jsx-runtime-CYK1ROHF.js";
|
|
8
8
|
var Qe = class {
|
|
9
9
|
constructor() {
|
|
@@ -24,7 +24,7 @@ var Qe = class {
|
|
|
24
24
|
}, $ = typeof window > "u" || "Deno" in globalThis;
|
|
25
25
|
function be() {
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Lt(t, e) {
|
|
28
28
|
return typeof t == "function" ? t(e) : t;
|
|
29
29
|
}
|
|
30
30
|
function me(t) {
|
|
@@ -39,17 +39,17 @@ function de(t, e) {
|
|
|
39
39
|
function j(t, e) {
|
|
40
40
|
return typeof t == "function" ? t(e) : t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Nt(t, e) {
|
|
43
43
|
const {
|
|
44
44
|
type: s = "all",
|
|
45
|
-
exact:
|
|
45
|
+
exact: r,
|
|
46
46
|
fetchStatus: n,
|
|
47
47
|
predicate: u,
|
|
48
48
|
queryKey: a,
|
|
49
49
|
stale: c
|
|
50
50
|
} = t;
|
|
51
51
|
if (a) {
|
|
52
|
-
if (
|
|
52
|
+
if (r) {
|
|
53
53
|
if (e.queryHash !== ot(a, e.options))
|
|
54
54
|
return !1;
|
|
55
55
|
} else if (!Ae(e.queryKey, a))
|
|
@@ -62,8 +62,8 @@ function qt(t, e) {
|
|
|
62
62
|
}
|
|
63
63
|
return !(typeof c == "boolean" && e.isStale() !== c || n && n !== e.state.fetchStatus || u && !u(e));
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const { exact: s, status:
|
|
65
|
+
function _t(t, e) {
|
|
66
|
+
const { exact: s, status: r, predicate: n, mutationKey: u } = t;
|
|
67
67
|
if (u) {
|
|
68
68
|
if (!e.options.mutationKey)
|
|
69
69
|
return !1;
|
|
@@ -73,7 +73,7 @@ function Mt(t, e) {
|
|
|
73
73
|
} else if (!Ae(e.options.mutationKey, u))
|
|
74
74
|
return !1;
|
|
75
75
|
}
|
|
76
|
-
return !(
|
|
76
|
+
return !(r && e.state.status !== r || n && !n(e));
|
|
77
77
|
}
|
|
78
78
|
function ot(t, e) {
|
|
79
79
|
return ((e == null ? void 0 : e.queryKeyHashFn) || ge)(t);
|
|
@@ -81,7 +81,7 @@ function ot(t, e) {
|
|
|
81
81
|
function ge(t) {
|
|
82
82
|
return JSON.stringify(
|
|
83
83
|
t,
|
|
84
|
-
(e, s) => Ce(s) ? Object.keys(s).sort().reduce((
|
|
84
|
+
(e, s) => Ce(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
function Ae(t, e) {
|
|
@@ -92,11 +92,11 @@ function Re(t, e) {
|
|
|
92
92
|
return t;
|
|
93
93
|
const s = Ne(t) && Ne(e);
|
|
94
94
|
if (s || Ce(t) && Ce(e)) {
|
|
95
|
-
const
|
|
95
|
+
const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), a = u.length, c = s ? [] : {};
|
|
96
96
|
let l = 0;
|
|
97
97
|
for (let R = 0; R < a; R++) {
|
|
98
98
|
const m = s ? R : u[R];
|
|
99
|
-
(!s &&
|
|
99
|
+
(!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (c[m] = void 0, l++) : (c[m] = Re(t[m], e[m]), c[m] === t[m] && t[m] !== void 0 && l++);
|
|
100
100
|
}
|
|
101
101
|
return n === a && l === n ? t : c;
|
|
102
102
|
}
|
|
@@ -137,25 +137,25 @@ function we(t, e, s) {
|
|
|
137
137
|
if (process.env.NODE_ENV !== "production")
|
|
138
138
|
try {
|
|
139
139
|
return Re(t, e);
|
|
140
|
-
} catch (
|
|
140
|
+
} catch (r) {
|
|
141
141
|
console.error(
|
|
142
|
-
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${
|
|
142
|
+
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
return Re(t, e);
|
|
146
146
|
}
|
|
147
147
|
return e;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function Kt(t) {
|
|
150
150
|
return t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const
|
|
154
|
-
return s &&
|
|
152
|
+
function Ht(t, e, s = 0) {
|
|
153
|
+
const r = [...t, e];
|
|
154
|
+
return s && r.length > s ? r.slice(1) : r;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
return s &&
|
|
156
|
+
function zt(t, e, s = 0) {
|
|
157
|
+
const r = [e, ...t];
|
|
158
|
+
return s && r.length > s ? r.slice(0, -1) : r;
|
|
159
159
|
}
|
|
160
160
|
var Ee = Symbol();
|
|
161
161
|
function ht(t, e) {
|
|
@@ -163,7 +163,7 @@ function ht(t, e) {
|
|
|
163
163
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
164
164
|
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === Ee ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
165
165
|
}
|
|
166
|
-
var _, q, X,
|
|
166
|
+
var _, q, X, Ge, ct = (Ge = class extends Qe {
|
|
167
167
|
constructor() {
|
|
168
168
|
super();
|
|
169
169
|
d(this, _);
|
|
@@ -179,20 +179,20 @@ var _, q, X, ze, ct = (ze = class extends Qe {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
onSubscribe() {
|
|
182
|
-
|
|
182
|
+
i(this, q) || this.setEventListener(i(this, X));
|
|
183
183
|
}
|
|
184
184
|
onUnsubscribe() {
|
|
185
185
|
var e;
|
|
186
|
-
this.hasListeners() || ((e =
|
|
186
|
+
this.hasListeners() || ((e = i(this, q)) == null || e.call(this), h(this, q, void 0));
|
|
187
187
|
}
|
|
188
188
|
setEventListener(e) {
|
|
189
189
|
var s;
|
|
190
|
-
h(this, X, e), (s =
|
|
191
|
-
typeof
|
|
190
|
+
h(this, X, e), (s = i(this, q)) == null || s.call(this), h(this, q, e((r) => {
|
|
191
|
+
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
192
192
|
}));
|
|
193
193
|
}
|
|
194
194
|
setFocused(e) {
|
|
195
|
-
|
|
195
|
+
i(this, _) !== e && (h(this, _, e), this.onFocus());
|
|
196
196
|
}
|
|
197
197
|
onFocus() {
|
|
198
198
|
const e = this.isFocused();
|
|
@@ -202,9 +202,9 @@ var _, q, X, ze, ct = (ze = class extends Qe {
|
|
|
202
202
|
}
|
|
203
203
|
isFocused() {
|
|
204
204
|
var e;
|
|
205
|
-
return typeof
|
|
205
|
+
return typeof i(this, _) == "boolean" ? i(this, _) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
206
206
|
}
|
|
207
|
-
}, _ = new WeakMap(), q = new WeakMap(), X = new WeakMap(),
|
|
207
|
+
}, _ = new WeakMap(), q = new WeakMap(), X = new WeakMap(), Ge), Ye = new ct(), Y, M, Z, Ve, lt = (Ve = class extends Qe {
|
|
208
208
|
constructor() {
|
|
209
209
|
super();
|
|
210
210
|
d(this, Y, !0);
|
|
@@ -212,31 +212,31 @@ var _, q, X, ze, ct = (ze = class extends Qe {
|
|
|
212
212
|
d(this, Z);
|
|
213
213
|
h(this, Z, (e) => {
|
|
214
214
|
if (!$ && window.addEventListener) {
|
|
215
|
-
const s = () => e(!0),
|
|
216
|
-
return window.addEventListener("online", s, !1), window.addEventListener("offline",
|
|
217
|
-
window.removeEventListener("online", s), window.removeEventListener("offline",
|
|
215
|
+
const s = () => e(!0), r = () => e(!1);
|
|
216
|
+
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
217
|
+
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
onSubscribe() {
|
|
223
|
-
|
|
223
|
+
i(this, M) || this.setEventListener(i(this, Z));
|
|
224
224
|
}
|
|
225
225
|
onUnsubscribe() {
|
|
226
226
|
var e;
|
|
227
|
-
this.hasListeners() || ((e =
|
|
227
|
+
this.hasListeners() || ((e = i(this, M)) == null || e.call(this), h(this, M, void 0));
|
|
228
228
|
}
|
|
229
229
|
setEventListener(e) {
|
|
230
230
|
var s;
|
|
231
|
-
h(this, Z, e), (s =
|
|
231
|
+
h(this, Z, e), (s = i(this, M)) == null || s.call(this), h(this, M, e(this.setOnline.bind(this)));
|
|
232
232
|
}
|
|
233
233
|
setOnline(e) {
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
i(this, Y) !== e && (h(this, Y, e), this.listeners.forEach((r) => {
|
|
235
|
+
r(e);
|
|
236
236
|
}));
|
|
237
237
|
}
|
|
238
238
|
isOnline() {
|
|
239
|
-
return
|
|
239
|
+
return i(this, Y);
|
|
240
240
|
}
|
|
241
241
|
}, Y = new WeakMap(), M = new WeakMap(), Z = new WeakMap(), Ve), Ze = new lt();
|
|
242
242
|
function Fe() {
|
|
@@ -246,16 +246,16 @@ function Fe() {
|
|
|
246
246
|
});
|
|
247
247
|
s.status = "pending", s.catch(() => {
|
|
248
248
|
});
|
|
249
|
-
function
|
|
249
|
+
function r(n) {
|
|
250
250
|
Object.assign(s, n), delete s.resolve, delete s.reject;
|
|
251
251
|
}
|
|
252
252
|
return s.resolve = (n) => {
|
|
253
|
-
|
|
253
|
+
r({
|
|
254
254
|
status: "fulfilled",
|
|
255
255
|
value: n
|
|
256
256
|
}), t(n);
|
|
257
257
|
}, s.reject = (n) => {
|
|
258
|
-
|
|
258
|
+
r({
|
|
259
259
|
status: "rejected",
|
|
260
260
|
reason: n
|
|
261
261
|
}), e(n);
|
|
@@ -276,30 +276,30 @@ function ve(t) {
|
|
|
276
276
|
return t instanceof tt;
|
|
277
277
|
}
|
|
278
278
|
function dt(t) {
|
|
279
|
-
let e = !1, s = 0,
|
|
279
|
+
let e = !1, s = 0, r = !1, n;
|
|
280
280
|
const u = Fe(), a = (v) => {
|
|
281
281
|
var p;
|
|
282
|
-
|
|
282
|
+
r || (S(new tt(v)), (p = t.abort) == null || p.call(t));
|
|
283
283
|
}, c = () => {
|
|
284
284
|
e = !0;
|
|
285
285
|
}, l = () => {
|
|
286
286
|
e = !1;
|
|
287
287
|
}, R = () => Ye.isFocused() && (t.networkMode === "always" || Ze.isOnline()) && t.canRun(), m = () => et(t.networkMode) && t.canRun(), o = (v) => {
|
|
288
288
|
var p;
|
|
289
|
-
|
|
289
|
+
r || (r = !0, (p = t.onSuccess) == null || p.call(t, v), n == null || n(), u.resolve(v));
|
|
290
290
|
}, S = (v) => {
|
|
291
291
|
var p;
|
|
292
|
-
|
|
292
|
+
r || (r = !0, (p = t.onError) == null || p.call(t, v), n == null || n(), u.reject(v));
|
|
293
293
|
}, g = () => new Promise((v) => {
|
|
294
294
|
var p;
|
|
295
295
|
n = (E) => {
|
|
296
|
-
(
|
|
296
|
+
(r || R()) && v(E);
|
|
297
297
|
}, (p = t.onPause) == null || p.call(t);
|
|
298
298
|
}).then(() => {
|
|
299
299
|
var v;
|
|
300
|
-
n = void 0,
|
|
300
|
+
n = void 0, r || (v = t.onContinue) == null || v.call(t);
|
|
301
301
|
}), w = () => {
|
|
302
|
-
if (
|
|
302
|
+
if (r)
|
|
303
303
|
return;
|
|
304
304
|
let v;
|
|
305
305
|
const p = s === 0 ? t.initialPromise : void 0;
|
|
@@ -310,7 +310,7 @@ function dt(t) {
|
|
|
310
310
|
}
|
|
311
311
|
Promise.resolve(v).then(o).catch((E) => {
|
|
312
312
|
var ye;
|
|
313
|
-
if (
|
|
313
|
+
if (r)
|
|
314
314
|
return;
|
|
315
315
|
const Q = t.retry ?? ($ ? 0 : 3), N = t.retryDelay ?? ft, ce = typeof N == "function" ? N(s, E) : N, le = Q === !0 || typeof Q == "number" && s < Q || typeof Q == "function" && Q(s, E);
|
|
316
316
|
if (e || !le) {
|
|
@@ -335,7 +335,7 @@ function dt(t) {
|
|
|
335
335
|
function yt() {
|
|
336
336
|
let t = [], e = 0, s = (c) => {
|
|
337
337
|
c();
|
|
338
|
-
},
|
|
338
|
+
}, r = (c) => {
|
|
339
339
|
c();
|
|
340
340
|
}, n = (c) => setTimeout(c, 0);
|
|
341
341
|
const u = (c) => {
|
|
@@ -345,7 +345,7 @@ function yt() {
|
|
|
345
345
|
}, a = () => {
|
|
346
346
|
const c = t;
|
|
347
347
|
t = [], c.length && n(() => {
|
|
348
|
-
|
|
348
|
+
r(() => {
|
|
349
349
|
c.forEach((l) => {
|
|
350
350
|
s(l);
|
|
351
351
|
});
|
|
@@ -384,7 +384,7 @@ function yt() {
|
|
|
384
384
|
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
385
385
|
*/
|
|
386
386
|
setBatchNotifyFunction: (c) => {
|
|
387
|
-
|
|
387
|
+
r = c;
|
|
388
388
|
},
|
|
389
389
|
setScheduler: (c) => {
|
|
390
390
|
n = c;
|
|
@@ -410,56 +410,56 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
410
410
|
);
|
|
411
411
|
}
|
|
412
412
|
clearGcTimeout() {
|
|
413
|
-
|
|
413
|
+
i(this, K) && (clearTimeout(i(this, K)), h(this, K, void 0));
|
|
414
414
|
}
|
|
415
|
-
}, K = new WeakMap(), $e), ee, te,
|
|
415
|
+
}, K = new WeakMap(), $e), ee, te, P, H, C, oe, z, U, A, We, Bt = (We = class extends pt {
|
|
416
416
|
constructor(e) {
|
|
417
417
|
super();
|
|
418
418
|
d(this, U);
|
|
419
419
|
d(this, ee);
|
|
420
420
|
d(this, te);
|
|
421
|
-
d(this,
|
|
421
|
+
d(this, P);
|
|
422
422
|
d(this, H);
|
|
423
423
|
d(this, C);
|
|
424
424
|
d(this, oe);
|
|
425
|
-
d(this,
|
|
426
|
-
h(this,
|
|
425
|
+
d(this, z);
|
|
426
|
+
h(this, z, !1), h(this, oe, e.defaultOptions), this.setOptions(e.options), this.observers = [], h(this, H, e.client), h(this, P, i(this, H).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, h(this, ee, vt(this.options)), this.state = e.state ?? i(this, ee), this.scheduleGc();
|
|
427
427
|
}
|
|
428
428
|
get meta() {
|
|
429
429
|
return this.options.meta;
|
|
430
430
|
}
|
|
431
431
|
get promise() {
|
|
432
432
|
var e;
|
|
433
|
-
return (e =
|
|
433
|
+
return (e = i(this, C)) == null ? void 0 : e.promise;
|
|
434
434
|
}
|
|
435
435
|
setOptions(e) {
|
|
436
|
-
this.options = { ...
|
|
436
|
+
this.options = { ...i(this, oe), ...e }, this.updateGcTime(this.options.gcTime);
|
|
437
437
|
}
|
|
438
438
|
optionalRemove() {
|
|
439
|
-
!this.observers.length && this.state.fetchStatus === "idle" &&
|
|
439
|
+
!this.observers.length && this.state.fetchStatus === "idle" && i(this, P).remove(this);
|
|
440
440
|
}
|
|
441
441
|
setData(e, s) {
|
|
442
|
-
const
|
|
442
|
+
const r = we(this.state.data, e, this.options);
|
|
443
443
|
return b(this, U, A).call(this, {
|
|
444
|
-
data:
|
|
444
|
+
data: r,
|
|
445
445
|
type: "success",
|
|
446
446
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
447
447
|
manual: s == null ? void 0 : s.manual
|
|
448
|
-
}),
|
|
448
|
+
}), r;
|
|
449
449
|
}
|
|
450
450
|
setState(e, s) {
|
|
451
451
|
b(this, U, A).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
452
452
|
}
|
|
453
453
|
cancel(e) {
|
|
454
|
-
var
|
|
455
|
-
const s = (
|
|
456
|
-
return (n =
|
|
454
|
+
var r, n;
|
|
455
|
+
const s = (r = i(this, C)) == null ? void 0 : r.promise;
|
|
456
|
+
return (n = i(this, C)) == null || n.cancel(e), s ? s.then(be).catch(be) : Promise.resolve();
|
|
457
457
|
}
|
|
458
458
|
destroy() {
|
|
459
459
|
super.destroy(), this.cancel({ silent: !0 });
|
|
460
460
|
}
|
|
461
461
|
reset() {
|
|
462
|
-
this.destroy(), this.setState(
|
|
462
|
+
this.destroy(), this.setState(i(this, ee));
|
|
463
463
|
}
|
|
464
464
|
isActive() {
|
|
465
465
|
return this.observers.some(
|
|
@@ -479,19 +479,19 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
479
479
|
}
|
|
480
480
|
onFocus() {
|
|
481
481
|
var s;
|
|
482
|
-
const e = this.observers.find((
|
|
483
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s =
|
|
482
|
+
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
483
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
484
484
|
}
|
|
485
485
|
onOnline() {
|
|
486
486
|
var s;
|
|
487
|
-
const e = this.observers.find((
|
|
488
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s =
|
|
487
|
+
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
488
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
489
489
|
}
|
|
490
490
|
addObserver(e) {
|
|
491
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(),
|
|
491
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, P).notify({ type: "observerAdded", query: this, observer: e }));
|
|
492
492
|
}
|
|
493
493
|
removeObserver(e) {
|
|
494
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (
|
|
494
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, C) && (i(this, z) ? i(this, C).cancel({ revert: !0 }) : i(this, C).cancelRetry()), this.scheduleGc()), i(this, P).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
495
495
|
}
|
|
496
496
|
getObserversCount() {
|
|
497
497
|
return this.observers.length;
|
|
@@ -504,8 +504,8 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
504
504
|
if (this.state.fetchStatus !== "idle") {
|
|
505
505
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
506
506
|
this.cancel({ silent: !0 });
|
|
507
|
-
else if (
|
|
508
|
-
return
|
|
507
|
+
else if (i(this, C))
|
|
508
|
+
return i(this, C).continueRetry(), i(this, C).promise;
|
|
509
509
|
}
|
|
510
510
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
511
511
|
const o = this.observers.find((S) => S.options.queryFn);
|
|
@@ -514,18 +514,18 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
514
514
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
515
515
|
"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']"
|
|
516
516
|
));
|
|
517
|
-
const
|
|
517
|
+
const r = new AbortController(), n = (o) => {
|
|
518
518
|
Object.defineProperty(o, "signal", {
|
|
519
519
|
enumerable: !0,
|
|
520
|
-
get: () => (h(this,
|
|
520
|
+
get: () => (h(this, z, !0), r.signal)
|
|
521
521
|
});
|
|
522
522
|
}, u = () => {
|
|
523
523
|
const o = ht(this.options, s), S = {
|
|
524
|
-
client:
|
|
524
|
+
client: i(this, H),
|
|
525
525
|
queryKey: this.queryKey,
|
|
526
526
|
meta: this.meta
|
|
527
527
|
};
|
|
528
|
-
return n(S), h(this,
|
|
528
|
+
return n(S), h(this, z, !1), this.options.persister ? this.options.persister(
|
|
529
529
|
o,
|
|
530
530
|
S,
|
|
531
531
|
this
|
|
@@ -534,7 +534,7 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
534
534
|
fetchOptions: s,
|
|
535
535
|
options: this.options,
|
|
536
536
|
queryKey: this.queryKey,
|
|
537
|
-
client:
|
|
537
|
+
client: i(this, H),
|
|
538
538
|
state: this.state,
|
|
539
539
|
fetchFn: u
|
|
540
540
|
};
|
|
@@ -547,11 +547,11 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
547
547
|
ve(o) && o.silent || b(this, U, A).call(this, {
|
|
548
548
|
type: "error",
|
|
549
549
|
error: o
|
|
550
|
-
}), ve(o) || ((g = (S =
|
|
550
|
+
}), ve(o) || ((g = (S = i(this, P).config).onError) == null || g.call(
|
|
551
551
|
S,
|
|
552
552
|
o,
|
|
553
553
|
this
|
|
554
|
-
), (v = (w =
|
|
554
|
+
), (v = (w = i(this, P).config).onSettled) == null || v.call(
|
|
555
555
|
w,
|
|
556
556
|
this.state.data,
|
|
557
557
|
o,
|
|
@@ -561,7 +561,7 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
561
561
|
return h(this, C, dt({
|
|
562
562
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
563
563
|
fn: a.fetchFn,
|
|
564
|
-
abort:
|
|
564
|
+
abort: r.abort.bind(r),
|
|
565
565
|
onSuccess: (o) => {
|
|
566
566
|
var S, g, w, v;
|
|
567
567
|
if (o === void 0) {
|
|
@@ -576,7 +576,7 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
576
576
|
c(p);
|
|
577
577
|
return;
|
|
578
578
|
}
|
|
579
|
-
(g = (S =
|
|
579
|
+
(g = (S = i(this, P).config).onSuccess) == null || g.call(S, o, this), (v = (w = i(this, P).config).onSettled) == null || v.call(
|
|
580
580
|
w,
|
|
581
581
|
o,
|
|
582
582
|
this.state.error,
|
|
@@ -597,38 +597,38 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
597
597
|
retryDelay: a.options.retryDelay,
|
|
598
598
|
networkMode: a.options.networkMode,
|
|
599
599
|
canRun: () => !0
|
|
600
|
-
})),
|
|
600
|
+
})), i(this, C).start();
|
|
601
601
|
}
|
|
602
|
-
}, ee = new WeakMap(), te = new WeakMap(),
|
|
603
|
-
const s = (
|
|
602
|
+
}, ee = new WeakMap(), te = new WeakMap(), P = new WeakMap(), H = new WeakMap(), C = new WeakMap(), oe = new WeakMap(), z = new WeakMap(), U = new WeakSet(), A = function(e) {
|
|
603
|
+
const s = (r) => {
|
|
604
604
|
switch (e.type) {
|
|
605
605
|
case "failed":
|
|
606
606
|
return {
|
|
607
|
-
...
|
|
607
|
+
...r,
|
|
608
608
|
fetchFailureCount: e.failureCount,
|
|
609
609
|
fetchFailureReason: e.error
|
|
610
610
|
};
|
|
611
611
|
case "pause":
|
|
612
612
|
return {
|
|
613
|
-
...
|
|
613
|
+
...r,
|
|
614
614
|
fetchStatus: "paused"
|
|
615
615
|
};
|
|
616
616
|
case "continue":
|
|
617
617
|
return {
|
|
618
|
-
...
|
|
618
|
+
...r,
|
|
619
619
|
fetchStatus: "fetching"
|
|
620
620
|
};
|
|
621
621
|
case "fetch":
|
|
622
622
|
return {
|
|
623
|
-
...
|
|
624
|
-
...st(
|
|
623
|
+
...r,
|
|
624
|
+
...st(r.data, this.options),
|
|
625
625
|
fetchMeta: e.meta ?? null
|
|
626
626
|
};
|
|
627
627
|
case "success":
|
|
628
628
|
return {
|
|
629
|
-
...
|
|
629
|
+
...r,
|
|
630
630
|
data: e.data,
|
|
631
|
-
dataUpdateCount:
|
|
631
|
+
dataUpdateCount: r.dataUpdateCount + 1,
|
|
632
632
|
dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
|
|
633
633
|
error: null,
|
|
634
634
|
isInvalidated: !1,
|
|
@@ -641,32 +641,32 @@ var qe = yt(), K, $e, pt = ($e = class {
|
|
|
641
641
|
};
|
|
642
642
|
case "error":
|
|
643
643
|
const n = e.error;
|
|
644
|
-
return ve(n) && n.revert &&
|
|
645
|
-
...
|
|
644
|
+
return ve(n) && n.revert && i(this, te) ? { ...i(this, te), fetchStatus: "idle" } : {
|
|
645
|
+
...r,
|
|
646
646
|
error: n,
|
|
647
|
-
errorUpdateCount:
|
|
647
|
+
errorUpdateCount: r.errorUpdateCount + 1,
|
|
648
648
|
errorUpdatedAt: Date.now(),
|
|
649
|
-
fetchFailureCount:
|
|
649
|
+
fetchFailureCount: r.fetchFailureCount + 1,
|
|
650
650
|
fetchFailureReason: n,
|
|
651
651
|
fetchStatus: "idle",
|
|
652
652
|
status: "error"
|
|
653
653
|
};
|
|
654
654
|
case "invalidate":
|
|
655
655
|
return {
|
|
656
|
-
...
|
|
656
|
+
...r,
|
|
657
657
|
isInvalidated: !0
|
|
658
658
|
};
|
|
659
659
|
case "setState":
|
|
660
660
|
return {
|
|
661
|
-
...
|
|
661
|
+
...r,
|
|
662
662
|
...e.state
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
this.state = s(this.state), qe.batch(() => {
|
|
667
|
-
this.observers.forEach((
|
|
668
|
-
|
|
669
|
-
}),
|
|
667
|
+
this.observers.forEach((r) => {
|
|
668
|
+
r.onQueryUpdate();
|
|
669
|
+
}), i(this, P).notify({ query: this, type: "updated", action: e });
|
|
670
670
|
});
|
|
671
671
|
}, We);
|
|
672
672
|
function st(t, e) {
|
|
@@ -681,11 +681,11 @@ function st(t, e) {
|
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
683
|
function vt(t) {
|
|
684
|
-
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0,
|
|
684
|
+
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
|
|
685
685
|
return {
|
|
686
686
|
data: e,
|
|
687
687
|
dataUpdateCount: 0,
|
|
688
|
-
dataUpdatedAt: s ?
|
|
688
|
+
dataUpdatedAt: s ? r ?? Date.now() : 0,
|
|
689
689
|
error: null,
|
|
690
690
|
errorUpdateCount: 0,
|
|
691
691
|
errorUpdatedAt: 0,
|
|
@@ -697,7 +697,7 @@ function vt(t) {
|
|
|
697
697
|
fetchStatus: "idle"
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
|
-
var T, f, ue, O,
|
|
700
|
+
var T, f, ue, O, B, se, k, I, he, re, ie, G, V, L, ne, y, ae, Oe, Te, Pe, De, Ue, je, xe, rt, Je, bt = (Je = class extends Qe {
|
|
701
701
|
constructor(e, s) {
|
|
702
702
|
super();
|
|
703
703
|
d(this, y);
|
|
@@ -705,7 +705,7 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
705
705
|
d(this, f);
|
|
706
706
|
d(this, ue);
|
|
707
707
|
d(this, O);
|
|
708
|
-
d(this,
|
|
708
|
+
d(this, B);
|
|
709
709
|
d(this, se);
|
|
710
710
|
d(this, k);
|
|
711
711
|
d(this, I);
|
|
@@ -714,11 +714,11 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
714
714
|
// This property keeps track of the last query with defined data.
|
|
715
715
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
716
716
|
d(this, ie);
|
|
717
|
-
d(this,
|
|
717
|
+
d(this, G);
|
|
718
718
|
d(this, V);
|
|
719
719
|
d(this, L);
|
|
720
720
|
d(this, ne, /* @__PURE__ */ new Set());
|
|
721
|
-
this.options = s, h(this, T, e), h(this, I, null), h(this, k, Fe()), this.options.experimental_prefetchInRender ||
|
|
721
|
+
this.options = s, h(this, T, e), h(this, I, null), h(this, k, Fe()), this.options.experimental_prefetchInRender || i(this, k).reject(
|
|
722
722
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
723
723
|
), this.bindMethods(), this.setOptions(s);
|
|
724
724
|
}
|
|
@@ -726,71 +726,71 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
726
726
|
this.refetch = this.refetch.bind(this);
|
|
727
727
|
}
|
|
728
728
|
onSubscribe() {
|
|
729
|
-
this.listeners.size === 1 && (
|
|
729
|
+
this.listeners.size === 1 && (i(this, f).addObserver(this), Ke(i(this, f), this.options) ? b(this, y, ae).call(this) : this.updateResult(), b(this, y, De).call(this));
|
|
730
730
|
}
|
|
731
731
|
onUnsubscribe() {
|
|
732
732
|
this.hasListeners() || this.destroy();
|
|
733
733
|
}
|
|
734
734
|
shouldFetchOnReconnect() {
|
|
735
735
|
return Ie(
|
|
736
|
-
|
|
736
|
+
i(this, f),
|
|
737
737
|
this.options,
|
|
738
738
|
this.options.refetchOnReconnect
|
|
739
739
|
);
|
|
740
740
|
}
|
|
741
741
|
shouldFetchOnWindowFocus() {
|
|
742
742
|
return Ie(
|
|
743
|
-
|
|
743
|
+
i(this, f),
|
|
744
744
|
this.options,
|
|
745
745
|
this.options.refetchOnWindowFocus
|
|
746
746
|
);
|
|
747
747
|
}
|
|
748
748
|
destroy() {
|
|
749
|
-
this.listeners = /* @__PURE__ */ new Set(), b(this, y, Ue).call(this), b(this, y, je).call(this),
|
|
749
|
+
this.listeners = /* @__PURE__ */ new Set(), b(this, y, Ue).call(this), b(this, y, je).call(this), i(this, f).removeObserver(this);
|
|
750
750
|
}
|
|
751
751
|
setOptions(e, s) {
|
|
752
|
-
const
|
|
753
|
-
if (this.options =
|
|
752
|
+
const r = this.options, n = i(this, f);
|
|
753
|
+
if (this.options = i(this, T).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof j(this.options.enabled, i(this, f)) != "boolean")
|
|
754
754
|
throw new Error(
|
|
755
755
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
756
756
|
);
|
|
757
|
-
b(this, y, xe).call(this),
|
|
757
|
+
b(this, y, xe).call(this), i(this, f).setOptions(this.options), r._defaulted && !Se(this.options, r) && i(this, T).getQueryCache().notify({
|
|
758
758
|
type: "observerOptionsUpdated",
|
|
759
|
-
query:
|
|
759
|
+
query: i(this, f),
|
|
760
760
|
observer: this
|
|
761
761
|
});
|
|
762
762
|
const u = this.hasListeners();
|
|
763
763
|
u && He(
|
|
764
|
-
|
|
764
|
+
i(this, f),
|
|
765
765
|
n,
|
|
766
766
|
this.options,
|
|
767
|
-
|
|
768
|
-
) && b(this, y, ae).call(this), this.updateResult(s), u && (
|
|
767
|
+
r
|
|
768
|
+
) && b(this, y, ae).call(this), this.updateResult(s), u && (i(this, f) !== n || j(this.options.enabled, i(this, f)) !== j(r.enabled, i(this, f)) || de(this.options.staleTime, i(this, f)) !== de(r.staleTime, i(this, f))) && b(this, y, Oe).call(this);
|
|
769
769
|
const a = b(this, y, Te).call(this);
|
|
770
|
-
u && (
|
|
770
|
+
u && (i(this, f) !== n || j(this.options.enabled, i(this, f)) !== j(r.enabled, i(this, f)) || a !== i(this, L)) && b(this, y, Pe).call(this, a);
|
|
771
771
|
}
|
|
772
772
|
getOptimisticResult(e) {
|
|
773
|
-
const s =
|
|
774
|
-
return gt(this,
|
|
773
|
+
const s = i(this, T).getQueryCache().build(i(this, T), e), r = this.createResult(s, e);
|
|
774
|
+
return gt(this, r) && (h(this, O, r), h(this, se, this.options), h(this, B, i(this, f).state)), r;
|
|
775
775
|
}
|
|
776
776
|
getCurrentResult() {
|
|
777
|
-
return
|
|
777
|
+
return i(this, O);
|
|
778
778
|
}
|
|
779
779
|
trackResult(e, s) {
|
|
780
|
-
const
|
|
780
|
+
const r = {};
|
|
781
781
|
return Object.keys(e).forEach((n) => {
|
|
782
|
-
Object.defineProperty(
|
|
782
|
+
Object.defineProperty(r, n, {
|
|
783
783
|
configurable: !1,
|
|
784
784
|
enumerable: !0,
|
|
785
785
|
get: () => (this.trackProp(n), s == null || s(n), e[n])
|
|
786
786
|
});
|
|
787
|
-
}),
|
|
787
|
+
}), r;
|
|
788
788
|
}
|
|
789
789
|
trackProp(e) {
|
|
790
|
-
|
|
790
|
+
i(this, ne).add(e);
|
|
791
791
|
}
|
|
792
792
|
getCurrentQuery() {
|
|
793
|
-
return
|
|
793
|
+
return i(this, f);
|
|
794
794
|
}
|
|
795
795
|
refetch({ ...e } = {}) {
|
|
796
796
|
return this.fetch({
|
|
@@ -798,21 +798,21 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
800
|
fetchOptimistic(e) {
|
|
801
|
-
const s =
|
|
802
|
-
return
|
|
801
|
+
const s = i(this, T).defaultQueryOptions(e), r = i(this, T).getQueryCache().build(i(this, T), s);
|
|
802
|
+
return r.fetch().then(() => this.createResult(r, s));
|
|
803
803
|
}
|
|
804
804
|
fetch(e) {
|
|
805
805
|
return b(this, y, ae).call(this, {
|
|
806
806
|
...e,
|
|
807
807
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
808
|
-
}).then(() => (this.updateResult(),
|
|
808
|
+
}).then(() => (this.updateResult(), i(this, O)));
|
|
809
809
|
}
|
|
810
810
|
createResult(e, s) {
|
|
811
811
|
var ke;
|
|
812
|
-
const
|
|
812
|
+
const r = i(this, f), n = this.options, u = i(this, O), a = i(this, B), c = i(this, se), R = e !== r ? e.state : i(this, ue), { state: m } = e;
|
|
813
813
|
let o = { ...m }, S = !1, g;
|
|
814
814
|
if (s._optimisticResults) {
|
|
815
|
-
const F = this.hasListeners(), W = !F && Ke(e, s), J = F && He(e,
|
|
815
|
+
const F = this.hasListeners(), W = !F && Ke(e, s), J = F && He(e, r, s, n);
|
|
816
816
|
(W || J) && (o = {
|
|
817
817
|
...o,
|
|
818
818
|
...st(m.data, e.options)
|
|
@@ -820,8 +820,8 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
820
820
|
}
|
|
821
821
|
let { error: w, errorUpdatedAt: v, status: p } = o;
|
|
822
822
|
if (s.select && o.data !== void 0)
|
|
823
|
-
if (u && o.data === (a == null ? void 0 : a.data) && s.select ===
|
|
824
|
-
g =
|
|
823
|
+
if (u && o.data === (a == null ? void 0 : a.data) && s.select === i(this, he))
|
|
824
|
+
g = i(this, re);
|
|
825
825
|
else
|
|
826
826
|
try {
|
|
827
827
|
h(this, he, s.select), g = s.select(o.data), g = we(u == null ? void 0 : u.data, g, s), h(this, re, g), h(this, I, null);
|
|
@@ -835,8 +835,8 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
835
835
|
if (u != null && u.isPlaceholderData && s.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
836
836
|
F = u.data;
|
|
837
837
|
else if (F = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
838
|
-
(ke =
|
|
839
|
-
|
|
838
|
+
(ke = i(this, ie)) == null ? void 0 : ke.state.data,
|
|
839
|
+
i(this, ie)
|
|
840
840
|
) : s.placeholderData, s.select && F !== void 0)
|
|
841
841
|
try {
|
|
842
842
|
F = s.select(F), h(this, I, null);
|
|
@@ -849,7 +849,7 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
849
849
|
s
|
|
850
850
|
), S = !0);
|
|
851
851
|
}
|
|
852
|
-
|
|
852
|
+
i(this, I) && (w = i(this, I), g = i(this, re), v = Date.now(), p = "error");
|
|
853
853
|
const E = o.fetchStatus === "fetching", Q = p === "pending", N = p === "error", ce = Q && E, le = g !== void 0, x = {
|
|
854
854
|
status: p,
|
|
855
855
|
fetchStatus: o.fetchStatus,
|
|
@@ -875,7 +875,7 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
875
875
|
isRefetchError: N && le,
|
|
876
876
|
isStale: Me(e, s),
|
|
877
877
|
refetch: this.refetch,
|
|
878
|
-
promise:
|
|
878
|
+
promise: i(this, k)
|
|
879
879
|
};
|
|
880
880
|
if (this.options.experimental_prefetchInRender) {
|
|
881
881
|
const F = (fe) => {
|
|
@@ -883,10 +883,10 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
883
883
|
}, W = () => {
|
|
884
884
|
const fe = h(this, k, x.promise = Fe());
|
|
885
885
|
F(fe);
|
|
886
|
-
}, J =
|
|
886
|
+
}, J = i(this, k);
|
|
887
887
|
switch (J.status) {
|
|
888
888
|
case "pending":
|
|
889
|
-
e.queryHash ===
|
|
889
|
+
e.queryHash === r.queryHash && F(J);
|
|
890
890
|
break;
|
|
891
891
|
case "fulfilled":
|
|
892
892
|
(x.status === "error" || x.data !== J.value) && W();
|
|
@@ -899,32 +899,32 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
899
899
|
return x;
|
|
900
900
|
}
|
|
901
901
|
updateResult(e) {
|
|
902
|
-
const s =
|
|
903
|
-
if (h(this,
|
|
902
|
+
const s = i(this, O), r = this.createResult(i(this, f), this.options);
|
|
903
|
+
if (h(this, B, i(this, f).state), h(this, se, this.options), i(this, B).data !== void 0 && h(this, ie, i(this, f)), Se(r, s))
|
|
904
904
|
return;
|
|
905
|
-
h(this, O,
|
|
905
|
+
h(this, O, r);
|
|
906
906
|
const n = {}, u = () => {
|
|
907
907
|
if (!s)
|
|
908
908
|
return !0;
|
|
909
909
|
const { notifyOnChangeProps: a } = this.options, c = typeof a == "function" ? a() : a;
|
|
910
|
-
if (c === "all" || !c && !
|
|
910
|
+
if (c === "all" || !c && !i(this, ne).size)
|
|
911
911
|
return !0;
|
|
912
912
|
const l = new Set(
|
|
913
|
-
c ??
|
|
913
|
+
c ?? i(this, ne)
|
|
914
914
|
);
|
|
915
|
-
return this.options.throwOnError && l.add("error"), Object.keys(
|
|
915
|
+
return this.options.throwOnError && l.add("error"), Object.keys(i(this, O)).some((R) => {
|
|
916
916
|
const m = R;
|
|
917
|
-
return
|
|
917
|
+
return i(this, O)[m] !== s[m] && l.has(m);
|
|
918
918
|
});
|
|
919
919
|
};
|
|
920
920
|
(e == null ? void 0 : e.listeners) !== !1 && u() && (n.listeners = !0), b(this, y, rt).call(this, { ...n, ...e });
|
|
921
921
|
}
|
|
922
922
|
onQueryUpdate() {
|
|
923
|
-
this.updateResult(), this.hasListeners() && b(this, y,
|
|
923
|
+
this.updateResult(), this.hasListeners() && b(this, y, De).call(this);
|
|
924
924
|
}
|
|
925
|
-
}, T = new WeakMap(), f = new WeakMap(), ue = new WeakMap(), O = new WeakMap(),
|
|
925
|
+
}, T = new WeakMap(), f = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), B = new WeakMap(), se = new WeakMap(), k = new WeakMap(), I = new WeakMap(), he = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), G = new WeakMap(), V = new WeakMap(), L = new WeakMap(), ne = new WeakMap(), y = new WeakSet(), ae = function(e) {
|
|
926
926
|
b(this, y, xe).call(this);
|
|
927
|
-
let s =
|
|
927
|
+
let s = i(this, f).fetch(
|
|
928
928
|
this.options,
|
|
929
929
|
e
|
|
930
930
|
);
|
|
@@ -933,38 +933,38 @@ var T, f, ue, O, G, se, k, I, he, re, ie, z, V, L, ne, y, ae, Oe, Te, De, Pe, Ue
|
|
|
933
933
|
b(this, y, Ue).call(this);
|
|
934
934
|
const e = de(
|
|
935
935
|
this.options.staleTime,
|
|
936
|
-
|
|
936
|
+
i(this, f)
|
|
937
937
|
);
|
|
938
|
-
if ($ ||
|
|
938
|
+
if ($ || i(this, O).isStale || !me(e))
|
|
939
939
|
return;
|
|
940
|
-
const
|
|
941
|
-
h(this,
|
|
942
|
-
|
|
943
|
-
},
|
|
940
|
+
const r = Xe(i(this, O).dataUpdatedAt, e) + 1;
|
|
941
|
+
h(this, G, setTimeout(() => {
|
|
942
|
+
i(this, O).isStale || this.updateResult();
|
|
943
|
+
}, r));
|
|
944
944
|
}, Te = function() {
|
|
945
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(
|
|
946
|
-
},
|
|
947
|
-
b(this, y, je).call(this), h(this, L, e), !($ || j(this.options.enabled,
|
|
945
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, f)) : this.options.refetchInterval) ?? !1;
|
|
946
|
+
}, Pe = function(e) {
|
|
947
|
+
b(this, y, je).call(this), h(this, L, e), !($ || j(this.options.enabled, i(this, f)) === !1 || !me(i(this, L)) || i(this, L) === 0) && h(this, V, setInterval(() => {
|
|
948
948
|
(this.options.refetchIntervalInBackground || Ye.isFocused()) && b(this, y, ae).call(this);
|
|
949
|
-
},
|
|
950
|
-
},
|
|
951
|
-
b(this, y, Oe).call(this), b(this, y,
|
|
949
|
+
}, i(this, L)));
|
|
950
|
+
}, De = function() {
|
|
951
|
+
b(this, y, Oe).call(this), b(this, y, Pe).call(this, b(this, y, Te).call(this));
|
|
952
952
|
}, Ue = function() {
|
|
953
|
-
|
|
953
|
+
i(this, G) && (clearTimeout(i(this, G)), h(this, G, void 0));
|
|
954
954
|
}, je = function() {
|
|
955
|
-
|
|
955
|
+
i(this, V) && (clearInterval(i(this, V)), h(this, V, void 0));
|
|
956
956
|
}, xe = function() {
|
|
957
|
-
const e =
|
|
958
|
-
if (e ===
|
|
957
|
+
const e = i(this, T).getQueryCache().build(i(this, T), this.options);
|
|
958
|
+
if (e === i(this, f))
|
|
959
959
|
return;
|
|
960
|
-
const s =
|
|
960
|
+
const s = i(this, f);
|
|
961
961
|
h(this, f, e), h(this, ue, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
962
962
|
}, rt = function(e) {
|
|
963
963
|
qe.batch(() => {
|
|
964
964
|
e.listeners && this.listeners.forEach((s) => {
|
|
965
|
-
s(
|
|
966
|
-
}),
|
|
967
|
-
query:
|
|
965
|
+
s(i(this, O));
|
|
966
|
+
}), i(this, T).getQueryCache().notify({
|
|
967
|
+
query: i(this, f),
|
|
968
968
|
type: "observerResultsUpdated"
|
|
969
969
|
});
|
|
970
970
|
});
|
|
@@ -977,13 +977,13 @@ function Ke(t, e) {
|
|
|
977
977
|
}
|
|
978
978
|
function Ie(t, e, s) {
|
|
979
979
|
if (j(e.enabled, t) !== !1) {
|
|
980
|
-
const
|
|
981
|
-
return
|
|
980
|
+
const r = typeof s == "function" ? s(t) : s;
|
|
981
|
+
return r === "always" || r !== !1 && Me(t, e);
|
|
982
982
|
}
|
|
983
983
|
return !1;
|
|
984
984
|
}
|
|
985
|
-
function He(t, e, s,
|
|
986
|
-
return (t !== e || j(
|
|
985
|
+
function He(t, e, s, r) {
|
|
986
|
+
return (t !== e || j(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Me(t, s);
|
|
987
987
|
}
|
|
988
988
|
function Me(t, e) {
|
|
989
989
|
return j(e.enabled, t) !== !1 && t.isStaleByTime(de(e.staleTime, t));
|
|
@@ -991,21 +991,21 @@ function Me(t, e) {
|
|
|
991
991
|
function gt(t, e) {
|
|
992
992
|
return !Se(t.getCurrentResult(), e);
|
|
993
993
|
}
|
|
994
|
-
var it =
|
|
994
|
+
var it = D.createContext(
|
|
995
995
|
void 0
|
|
996
996
|
), Rt = (t) => {
|
|
997
|
-
const e =
|
|
997
|
+
const e = D.useContext(it);
|
|
998
998
|
if (t)
|
|
999
999
|
return t;
|
|
1000
1000
|
if (!e)
|
|
1001
1001
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1002
1002
|
return e;
|
|
1003
|
-
},
|
|
1003
|
+
}, Gt = ({
|
|
1004
1004
|
client: t,
|
|
1005
1005
|
children: e
|
|
1006
|
-
}) => (
|
|
1006
|
+
}) => (D.useEffect(() => (t.mount(), () => {
|
|
1007
1007
|
t.unmount();
|
|
1008
|
-
}), [t]), /* @__PURE__ */ at.jsx(it.Provider, { value: t, children: e })), nt =
|
|
1008
|
+
}), [t]), /* @__PURE__ */ at.jsx(it.Provider, { value: t, children: e })), nt = D.createContext(!1), St = () => D.useContext(nt);
|
|
1009
1009
|
nt.Provider;
|
|
1010
1010
|
function Ct() {
|
|
1011
1011
|
let t = !1;
|
|
@@ -1019,28 +1019,28 @@ function Ct() {
|
|
|
1019
1019
|
isReset: () => t
|
|
1020
1020
|
};
|
|
1021
1021
|
}
|
|
1022
|
-
var wt =
|
|
1022
|
+
var wt = D.createContext(Ct()), Et = () => D.useContext(wt);
|
|
1023
1023
|
function Ft(t, e) {
|
|
1024
1024
|
return typeof t == "function" ? t(...e) : !!t;
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function ze() {
|
|
1027
1027
|
}
|
|
1028
1028
|
var Ot = (t, e) => {
|
|
1029
1029
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
1030
1030
|
}, Tt = (t) => {
|
|
1031
|
-
|
|
1031
|
+
D.useEffect(() => {
|
|
1032
1032
|
t.clearReset();
|
|
1033
1033
|
}, [t]);
|
|
1034
|
-
},
|
|
1034
|
+
}, Pt = ({
|
|
1035
1035
|
result: t,
|
|
1036
1036
|
errorResetBoundary: e,
|
|
1037
1037
|
throwOnError: s,
|
|
1038
|
-
query:
|
|
1038
|
+
query: r,
|
|
1039
1039
|
suspense: n
|
|
1040
|
-
}) => t.isError && !e.isReset() && !t.isFetching &&
|
|
1040
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || Ft(s, [t.error, r])), Vt = (t, e) => e.state.data === void 0, Dt = (t) => {
|
|
1041
1041
|
const e = t.staleTime;
|
|
1042
1042
|
t.suspense && (t.staleTime = typeof e == "function" ? (...s) => Math.max(e(...s), 1e3) : Math.max(e ?? 1e3, 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
1043
|
-
}, Ut = (t, e) => t.isLoading && t.isFetching && !e, jt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending,
|
|
1043
|
+
}, Ut = (t, e) => t.isLoading && t.isFetching && !e, jt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Be = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1044
1044
|
s.clearReset();
|
|
1045
1045
|
});
|
|
1046
1046
|
function xt(t, e, s) {
|
|
@@ -1049,89 +1049,106 @@ function xt(t, e, s) {
|
|
|
1049
1049
|
throw new Error(
|
|
1050
1050
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1051
1051
|
);
|
|
1052
|
-
const
|
|
1053
|
-
(S = (o =
|
|
1052
|
+
const r = Rt(s), n = St(), u = Et(), a = r.defaultQueryOptions(t);
|
|
1053
|
+
(S = (o = r.getDefaultOptions().queries) == null ? void 0 : o._experimental_beforeQuery) == null || S.call(
|
|
1054
1054
|
o,
|
|
1055
1055
|
a
|
|
1056
|
-
), a._optimisticResults = n ? "isRestoring" : "optimistic",
|
|
1057
|
-
const c = !
|
|
1056
|
+
), a._optimisticResults = n ? "isRestoring" : "optimistic", Dt(a), Ot(a, u), Tt(u);
|
|
1057
|
+
const c = !r.getQueryCache().get(a.queryHash), [l] = D.useState(
|
|
1058
1058
|
() => new e(
|
|
1059
|
-
|
|
1059
|
+
r,
|
|
1060
1060
|
a
|
|
1061
1061
|
)
|
|
1062
1062
|
), R = l.getOptimisticResult(a), m = !n && t.subscribed !== !1;
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
1063
|
+
if (D.useSyncExternalStore(
|
|
1064
|
+
D.useCallback(
|
|
1065
1065
|
(p) => {
|
|
1066
|
-
const E = m ? l.subscribe(qe.batchCalls(p)) :
|
|
1066
|
+
const E = m ? l.subscribe(qe.batchCalls(p)) : ze;
|
|
1067
1067
|
return l.updateResult(), E;
|
|
1068
1068
|
},
|
|
1069
1069
|
[l, m]
|
|
1070
1070
|
),
|
|
1071
1071
|
() => l.getCurrentResult(),
|
|
1072
1072
|
() => l.getCurrentResult()
|
|
1073
|
-
),
|
|
1073
|
+
), D.useEffect(() => {
|
|
1074
1074
|
l.setOptions(a, { listeners: !1 });
|
|
1075
1075
|
}, [a, l]), jt(a, R))
|
|
1076
|
-
throw
|
|
1077
|
-
if (
|
|
1076
|
+
throw Be(a, l, u);
|
|
1077
|
+
if (Pt({
|
|
1078
1078
|
result: R,
|
|
1079
1079
|
errorResetBoundary: u,
|
|
1080
1080
|
throwOnError: a.throwOnError,
|
|
1081
|
-
query:
|
|
1081
|
+
query: r.getQueryCache().get(a.queryHash),
|
|
1082
1082
|
suspense: a.suspense
|
|
1083
1083
|
}))
|
|
1084
1084
|
throw R.error;
|
|
1085
|
-
if ((w = (g =
|
|
1085
|
+
if ((w = (g = r.getDefaultOptions().queries) == null ? void 0 : g._experimental_afterQuery) == null || w.call(
|
|
1086
1086
|
g,
|
|
1087
1087
|
a,
|
|
1088
1088
|
R
|
|
1089
1089
|
), a.experimental_prefetchInRender && !$ && Ut(R, n)) {
|
|
1090
1090
|
const p = c ? (
|
|
1091
1091
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1092
|
-
|
|
1092
|
+
Be(a, l, u)
|
|
1093
1093
|
) : (
|
|
1094
1094
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1095
|
-
(v =
|
|
1095
|
+
(v = r.getQueryCache().get(a.queryHash)) == null ? void 0 : v.promise
|
|
1096
1096
|
);
|
|
1097
|
-
p == null || p.catch(
|
|
1097
|
+
p == null || p.catch(ze).finally(() => {
|
|
1098
1098
|
l.updateResult();
|
|
1099
1099
|
});
|
|
1100
1100
|
}
|
|
1101
1101
|
return a.notifyOnChangeProps ? R : l.trackResult(R);
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function $t(t, e) {
|
|
1104
1104
|
return xt(t, bt, e);
|
|
1105
1105
|
}
|
|
1106
|
+
const It = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, Qt = (t) => t.filter(
|
|
1107
|
+
(e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
|
|
1108
|
+
).map((e) => `${e}`).filter((e) => e), At = (t) => {
|
|
1109
|
+
const e = t.join("/"), [, s = "", r = ""] = e.match(It) ?? [];
|
|
1110
|
+
return {
|
|
1111
|
+
prefix: s,
|
|
1112
|
+
pathname: r.split("/").filter((n) => n !== "")
|
|
1113
|
+
};
|
|
1114
|
+
}, qt = (t) => {
|
|
1115
|
+
const { prefix: e, pathname: s } = t;
|
|
1116
|
+
let r = e;
|
|
1117
|
+
return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
|
|
1118
|
+
}, Wt = (...t) => {
|
|
1119
|
+
const e = Qt(t), s = At(e);
|
|
1120
|
+
return qt(s);
|
|
1121
|
+
};
|
|
1106
1122
|
export {
|
|
1123
|
+
Gt as A,
|
|
1107
1124
|
bt as Q,
|
|
1108
1125
|
pt as R,
|
|
1109
1126
|
Qe as S,
|
|
1110
|
-
|
|
1127
|
+
ze as a,
|
|
1111
1128
|
Ft as b,
|
|
1112
1129
|
dt as c,
|
|
1113
|
-
|
|
1130
|
+
$t as d,
|
|
1114
1131
|
Ee as e,
|
|
1115
1132
|
xt as f,
|
|
1116
|
-
|
|
1133
|
+
Vt as g,
|
|
1117
1134
|
ge as h,
|
|
1118
1135
|
ot as i,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1136
|
+
Wt as j,
|
|
1137
|
+
Kt as k,
|
|
1138
|
+
Bt as l,
|
|
1139
|
+
Nt as m,
|
|
1123
1140
|
qe as n,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1141
|
+
_t as o,
|
|
1142
|
+
be as p,
|
|
1143
|
+
ht as q,
|
|
1144
|
+
zt as r,
|
|
1128
1145
|
Se as s,
|
|
1129
|
-
|
|
1146
|
+
Ht as t,
|
|
1130
1147
|
Rt as u,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1148
|
+
Ye as v,
|
|
1149
|
+
Ze as w,
|
|
1150
|
+
de as x,
|
|
1151
|
+
Lt as y,
|
|
1152
|
+
Ae as z
|
|
1136
1153
|
};
|
|
1137
|
-
//# sourceMappingURL=
|
|
1154
|
+
//# sourceMappingURL=joinUrl-BjDooT-T.js.map
|