zudoku 0.0.0-e4d0ea8 → 0.0.0-e53033e
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/cli.js +2 -2
- package/dist/app/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +0 -3
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +0 -1
- package/dist/app/main.js +21 -6
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/config/validators/SidebarSchema.d.ts +1 -1
- package/dist/config/validators/SidebarSchema.js +9 -5
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +14 -76
- package/dist/config/validators/validate.js +6 -7
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Header.js +1 -5
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +5 -30
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
- package/dist/lib/components/context/ZudokuContext.js +20 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +3 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +3 -1
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +14 -10
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +6 -3
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +0 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -0
- package/dist/lib/plugins/markdown/generateRoutes.js +21 -0
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
- package/dist/lib/plugins/markdown/index.d.ts +6 -5
- package/dist/lib/plugins/markdown/index.js +3 -31
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +2 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +1 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.js +15 -20
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +2 -5
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/prerender.d.ts +1 -5
- package/dist/vite/prerender.js +5 -6
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{AuthenticationPlugin-Cnqy9csQ.js → AuthenticationPlugin-D_5jC4vE.js} +2 -2
- package/lib/{AuthenticationPlugin-Cnqy9csQ.js.map → AuthenticationPlugin-D_5jC4vE.js.map} +1 -1
- package/lib/{Input-x-t53FyR.js → Input-CYTkk51A.js} +3 -3
- package/lib/{Input-x-t53FyR.js.map → Input-CYTkk51A.js.map} +1 -1
- package/lib/{MdxPage-C5I9c7R1.js → MdxPage-Cbj8ILOL.js} +24 -25
- package/lib/{MdxPage-C5I9c7R1.js.map → MdxPage-Cbj8ILOL.js.map} +1 -1
- package/lib/{OperationList-qsBOguHS.js → OperationList-Dto8Wvgo.js} +4 -4
- package/lib/OperationList-Dto8Wvgo.js.map +1 -0
- package/lib/{Route-DlKvXPAO.js → Route-DLH-PALM.js} +2 -2
- package/lib/{Route-DlKvXPAO.js.map → Route-DLH-PALM.js.map} +1 -1
- package/lib/{SidebarBadge-DaA0-bFW.js → SidebarBadge-BWvFQTc1.js} +2 -2
- package/lib/{SidebarBadge-DaA0-bFW.js.map → SidebarBadge-BWvFQTc1.js.map} +1 -1
- package/lib/{ZudokuContext-DSipF8sq.js → ZudokuContext-uV_XfHPK.js} +411 -460
- package/lib/ZudokuContext-uV_XfHPK.js.map +1 -0
- package/lib/assets/{worker-DaFlmuyf.js → worker-Bf8vjASY.js} +2306 -2220
- package/lib/assets/{worker-DaFlmuyf.js.map → worker-Bf8vjASY.js.map} +1 -1
- package/lib/{index-CKmSo0py.js → index-LstIRx3V.js} +3 -3
- package/lib/{index-CKmSo0py.js.map → index-LstIRx3V.js.map} +1 -1
- package/lib/{index-Dssw7Gff.js → index-SyxHzsgJ.js} +2 -2
- package/lib/{index-Dssw7Gff.js.map → index-SyxHzsgJ.js.map} +1 -1
- package/lib/{index-BIl-R3aH.js → index-aHWE7ArR.js} +566 -554
- package/lib/index-aHWE7ArR.js.map +1 -0
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.js.map +1 -0
- package/lib/{AnchorLink-DovtSBJk.js → utils-CCcr3AZm.js} +275 -231
- package/lib/utils-CCcr3AZm.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +554 -564
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +2354 -2268
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +3 -3
- package/lib/zudoku.plugin-markdown.js +27 -93
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -4
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/package.json +1 -1
- package/src/app/entry.client.tsx +2 -4
- package/src/app/entry.server.tsx +0 -4
- package/src/app/main.css +0 -4
- package/src/app/main.tsx +25 -9
- package/src/app/standalone.tsx +1 -1
- package/src/lib/components/Header.tsx +2 -10
- package/src/lib/components/TopNavigation.tsx +24 -58
- package/src/lib/components/context/ZudokuContext.ts +20 -28
- package/src/lib/components/navigation/Sidebar.tsx +5 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -1
- package/src/lib/components/navigation/SidebarItem.tsx +3 -1
- package/src/lib/components/navigation/utils.ts +16 -11
- package/src/lib/core/DevPortalContext.ts +2 -3
- package/src/lib/core/plugins.ts +0 -2
- package/src/lib/plugins/markdown/generateRoutes.tsx +38 -0
- package/src/lib/plugins/markdown/index.tsx +12 -49
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +0 -38
- package/dist/lib/plugins/markdown/resolver.js +0 -75
- package/dist/lib/plugins/markdown/resolver.js.map +0 -1
- package/dist/vite/debug.d.ts +0 -1
- package/dist/vite/debug.js +0 -10
- package/dist/vite/debug.js.map +0 -1
- package/lib/AnchorLink-DovtSBJk.js.map +0 -1
- package/lib/OperationList-qsBOguHS.js.map +0 -1
- package/lib/ZudokuContext-DSipF8sq.js.map +0 -1
- package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
- package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
- package/lib/index-BIl-R3aH.js.map +0 -1
- package/src/lib/plugins/markdown/resolver.ts +0 -92
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Le = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var i = (t, e, s) => (
|
|
6
|
-
import * as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { j as
|
|
9
|
-
import { b as
|
|
10
|
-
|
|
11
|
-
var ke = class {
|
|
4
|
+
var pe = (t, e, s) => e.has(t) || Le("Cannot " + s);
|
|
5
|
+
var i = (t, e, s) => (pe(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (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), c = (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 P from "react";
|
|
7
|
+
import { createContext as ut, useContext as ht } from "react";
|
|
8
|
+
import { j as ct } from "./jsx-runtime-B6kdoens.js";
|
|
9
|
+
import { b as Je } from "./index-SrtqdZ3j.js";
|
|
10
|
+
var xe = class {
|
|
12
11
|
constructor() {
|
|
13
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
14
13
|
}
|
|
@@ -25,35 +24,35 @@ var ke = class {
|
|
|
25
24
|
onUnsubscribe() {
|
|
26
25
|
}
|
|
27
26
|
}, V = typeof window > "u" || "Deno" in globalThis;
|
|
28
|
-
function
|
|
27
|
+
function be() {
|
|
29
28
|
}
|
|
30
|
-
function
|
|
29
|
+
function Gt(t, e) {
|
|
31
30
|
return typeof t == "function" ? t(e) : t;
|
|
32
31
|
}
|
|
33
|
-
function
|
|
32
|
+
function me(t) {
|
|
34
33
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
35
34
|
}
|
|
36
|
-
function
|
|
35
|
+
function Ze(t, e) {
|
|
37
36
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
38
37
|
}
|
|
39
|
-
function
|
|
38
|
+
function de(t, e) {
|
|
40
39
|
return typeof t == "function" ? t(e) : t;
|
|
41
40
|
}
|
|
42
|
-
function
|
|
41
|
+
function I(t, e) {
|
|
43
42
|
return typeof t == "function" ? t(e) : t;
|
|
44
43
|
}
|
|
45
|
-
function
|
|
44
|
+
function zt(t, e) {
|
|
46
45
|
const {
|
|
47
46
|
type: s = "all",
|
|
48
47
|
exact: r,
|
|
49
48
|
fetchStatus: n,
|
|
50
|
-
predicate:
|
|
49
|
+
predicate: o,
|
|
51
50
|
queryKey: a,
|
|
52
|
-
stale:
|
|
51
|
+
stale: h
|
|
53
52
|
} = t;
|
|
54
53
|
if (a) {
|
|
55
54
|
if (r) {
|
|
56
|
-
if (e.queryHash !==
|
|
55
|
+
if (e.queryHash !== lt(a, e.options))
|
|
57
56
|
return !1;
|
|
58
57
|
} else if (!Qe(e.queryKey, a))
|
|
59
58
|
return !1;
|
|
@@ -63,28 +62,28 @@ function Zt(t, e) {
|
|
|
63
62
|
if (s === "active" && !l || s === "inactive" && l)
|
|
64
63
|
return !1;
|
|
65
64
|
}
|
|
66
|
-
return !(typeof
|
|
65
|
+
return !(typeof h == "boolean" && e.isStale() !== h || n && n !== e.state.fetchStatus || o && !o(e));
|
|
67
66
|
}
|
|
68
|
-
function
|
|
69
|
-
const { exact: s, status: r, predicate: n, mutationKey:
|
|
70
|
-
if (
|
|
67
|
+
function Vt(t, e) {
|
|
68
|
+
const { exact: s, status: r, predicate: n, mutationKey: o } = t;
|
|
69
|
+
if (o) {
|
|
71
70
|
if (!e.options.mutationKey)
|
|
72
71
|
return !1;
|
|
73
72
|
if (s) {
|
|
74
|
-
if (
|
|
73
|
+
if (ge(e.options.mutationKey) !== ge(o))
|
|
75
74
|
return !1;
|
|
76
|
-
} else if (!Qe(e.options.mutationKey,
|
|
75
|
+
} else if (!Qe(e.options.mutationKey, o))
|
|
77
76
|
return !1;
|
|
78
77
|
}
|
|
79
78
|
return !(r && e.state.status !== r || n && !n(e));
|
|
80
79
|
}
|
|
81
|
-
function
|
|
82
|
-
return ((e == null ? void 0 : e.queryKeyHashFn) ||
|
|
80
|
+
function lt(t, e) {
|
|
81
|
+
return ((e == null ? void 0 : e.queryKeyHashFn) || ge)(t);
|
|
83
82
|
}
|
|
84
|
-
function
|
|
83
|
+
function ge(t) {
|
|
85
84
|
return JSON.stringify(
|
|
86
85
|
t,
|
|
87
|
-
(e, s) =>
|
|
86
|
+
(e, s) => Ce(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
88
87
|
);
|
|
89
88
|
}
|
|
90
89
|
function Qe(t, e) {
|
|
@@ -93,19 +92,19 @@ function Qe(t, e) {
|
|
|
93
92
|
function Re(t, e) {
|
|
94
93
|
if (t === e)
|
|
95
94
|
return t;
|
|
96
|
-
const s =
|
|
97
|
-
if (s ||
|
|
98
|
-
const r = s ? t : Object.keys(t), n = r.length,
|
|
95
|
+
const s = Ne(t) && Ne(e);
|
|
96
|
+
if (s || Ce(t) && Ce(e)) {
|
|
97
|
+
const r = s ? t : Object.keys(t), n = r.length, o = s ? e : Object.keys(e), a = o.length, h = s ? [] : {};
|
|
99
98
|
let l = 0;
|
|
100
|
-
for (let
|
|
101
|
-
const v = s ?
|
|
102
|
-
(!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (
|
|
99
|
+
for (let R = 0; R < a; R++) {
|
|
100
|
+
const v = s ? R : o[R];
|
|
101
|
+
(!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (h[v] = void 0, l++) : (h[v] = Re(t[v], e[v]), h[v] === t[v] && t[v] !== void 0 && l++);
|
|
103
102
|
}
|
|
104
|
-
return n === a && l === n ? t :
|
|
103
|
+
return n === a && l === n ? t : h;
|
|
105
104
|
}
|
|
106
105
|
return e;
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function Se(t, e) {
|
|
109
108
|
if (!e || Object.keys(t).length !== Object.keys(e).length)
|
|
110
109
|
return !1;
|
|
111
110
|
for (const s in t)
|
|
@@ -113,27 +112,27 @@ function we(t, e) {
|
|
|
113
112
|
return !1;
|
|
114
113
|
return !0;
|
|
115
114
|
}
|
|
116
|
-
function
|
|
115
|
+
function Ne(t) {
|
|
117
116
|
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
118
117
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
118
|
+
function Ce(t) {
|
|
119
|
+
if (!Ke(t))
|
|
121
120
|
return !1;
|
|
122
121
|
const e = t.constructor;
|
|
123
122
|
if (e === void 0)
|
|
124
123
|
return !0;
|
|
125
124
|
const s = e.prototype;
|
|
126
|
-
return !(!
|
|
125
|
+
return !(!Ke(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
127
126
|
}
|
|
128
|
-
function
|
|
127
|
+
function Ke(t) {
|
|
129
128
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
130
129
|
}
|
|
131
|
-
function
|
|
130
|
+
function dt(t) {
|
|
132
131
|
return new Promise((e) => {
|
|
133
132
|
setTimeout(e, t);
|
|
134
133
|
});
|
|
135
134
|
}
|
|
136
|
-
function
|
|
135
|
+
function we(t, e, s) {
|
|
137
136
|
if (typeof s.structuralSharing == "function")
|
|
138
137
|
return s.structuralSharing(t, e);
|
|
139
138
|
if (s.structuralSharing !== !1) {
|
|
@@ -149,27 +148,27 @@ function Oe(t, e, s) {
|
|
|
149
148
|
}
|
|
150
149
|
return e;
|
|
151
150
|
}
|
|
152
|
-
function
|
|
151
|
+
function $t(t, e, s = 0) {
|
|
153
152
|
const r = [...t, e];
|
|
154
153
|
return s && r.length > s ? r.slice(1) : r;
|
|
155
154
|
}
|
|
156
|
-
function
|
|
155
|
+
function Wt(t, e, s = 0) {
|
|
157
156
|
const r = [e, ...t];
|
|
158
157
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
159
158
|
}
|
|
160
|
-
var
|
|
161
|
-
function
|
|
162
|
-
return process.env.NODE_ENV !== "production" && t.queryFn ===
|
|
159
|
+
var fe = Symbol();
|
|
160
|
+
function ft(t, e) {
|
|
161
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error(
|
|
163
162
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
164
|
-
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn ===
|
|
163
|
+
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === fe ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
165
164
|
}
|
|
166
|
-
var K,
|
|
165
|
+
var K, A, J, Ge, yt = (Ge = class extends xe {
|
|
167
166
|
constructor() {
|
|
168
167
|
super();
|
|
169
168
|
y(this, K);
|
|
170
|
-
y(this,
|
|
171
|
-
y(this,
|
|
172
|
-
c(this,
|
|
169
|
+
y(this, A);
|
|
170
|
+
y(this, J);
|
|
171
|
+
c(this, J, (e) => {
|
|
173
172
|
if (!V && window.addEventListener) {
|
|
174
173
|
const s = () => e();
|
|
175
174
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
@@ -179,15 +178,15 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
179
178
|
});
|
|
180
179
|
}
|
|
181
180
|
onSubscribe() {
|
|
182
|
-
i(this,
|
|
181
|
+
i(this, A) || this.setEventListener(i(this, J));
|
|
183
182
|
}
|
|
184
183
|
onUnsubscribe() {
|
|
185
184
|
var e;
|
|
186
|
-
this.hasListeners() || ((e = i(this,
|
|
185
|
+
this.hasListeners() || ((e = i(this, A)) == null || e.call(this), c(this, A, void 0));
|
|
187
186
|
}
|
|
188
187
|
setEventListener(e) {
|
|
189
188
|
var s;
|
|
190
|
-
c(this,
|
|
189
|
+
c(this, J, e), (s = i(this, A)) == null || s.call(this), c(this, A, e((r) => {
|
|
191
190
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
192
191
|
}));
|
|
193
192
|
}
|
|
@@ -204,13 +203,13 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
204
203
|
var e;
|
|
205
204
|
return typeof i(this, K) == "boolean" ? i(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
206
205
|
}
|
|
207
|
-
}, K = new WeakMap(),
|
|
206
|
+
}, K = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ge), Xe = new yt(), Z, k, X, ze, pt = (ze = class extends xe {
|
|
208
207
|
constructor() {
|
|
209
208
|
super();
|
|
210
|
-
y(this,
|
|
211
|
-
y(this,
|
|
212
|
-
y(this,
|
|
213
|
-
c(this,
|
|
209
|
+
y(this, Z, !0);
|
|
210
|
+
y(this, k);
|
|
211
|
+
y(this, X);
|
|
212
|
+
c(this, X, (e) => {
|
|
214
213
|
if (!V && window.addEventListener) {
|
|
215
214
|
const s = () => e(!0), r = () => e(!1);
|
|
216
215
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
@@ -220,29 +219,29 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
220
219
|
});
|
|
221
220
|
}
|
|
222
221
|
onSubscribe() {
|
|
223
|
-
i(this,
|
|
222
|
+
i(this, k) || this.setEventListener(i(this, X));
|
|
224
223
|
}
|
|
225
224
|
onUnsubscribe() {
|
|
226
225
|
var e;
|
|
227
|
-
this.hasListeners() || ((e = i(this,
|
|
226
|
+
this.hasListeners() || ((e = i(this, k)) == null || e.call(this), c(this, k, void 0));
|
|
228
227
|
}
|
|
229
228
|
setEventListener(e) {
|
|
230
229
|
var s;
|
|
231
|
-
c(this,
|
|
230
|
+
c(this, X, e), (s = i(this, k)) == null || s.call(this), c(this, k, e(this.setOnline.bind(this)));
|
|
232
231
|
}
|
|
233
232
|
setOnline(e) {
|
|
234
|
-
i(this,
|
|
233
|
+
i(this, Z) !== e && (c(this, Z, e), this.listeners.forEach((r) => {
|
|
235
234
|
r(e);
|
|
236
235
|
}));
|
|
237
236
|
}
|
|
238
237
|
isOnline() {
|
|
239
|
-
return i(this,
|
|
238
|
+
return i(this, Z);
|
|
240
239
|
}
|
|
241
|
-
},
|
|
242
|
-
function
|
|
240
|
+
}, Z = new WeakMap(), k = new WeakMap(), X = new WeakMap(), ze), Ye = new pt();
|
|
241
|
+
function Ee() {
|
|
243
242
|
let t, e;
|
|
244
|
-
const s = new Promise((n,
|
|
245
|
-
t = n, e =
|
|
243
|
+
const s = new Promise((n, o) => {
|
|
244
|
+
t = n, e = o;
|
|
246
245
|
});
|
|
247
246
|
s.status = "pending", s.catch(() => {
|
|
248
247
|
});
|
|
@@ -261,39 +260,39 @@ function Fe() {
|
|
|
261
260
|
}), e(n);
|
|
262
261
|
}, s;
|
|
263
262
|
}
|
|
264
|
-
function
|
|
263
|
+
function vt(t) {
|
|
265
264
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
266
265
|
}
|
|
267
|
-
function
|
|
268
|
-
return (t ?? "online") === "online" ?
|
|
266
|
+
function et(t) {
|
|
267
|
+
return (t ?? "online") === "online" ? Ye.isOnline() : !0;
|
|
269
268
|
}
|
|
270
|
-
var
|
|
269
|
+
var tt = class extends Error {
|
|
271
270
|
constructor(t) {
|
|
272
271
|
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
273
272
|
}
|
|
274
273
|
};
|
|
275
|
-
function
|
|
276
|
-
return t instanceof
|
|
274
|
+
function ve(t) {
|
|
275
|
+
return t instanceof tt;
|
|
277
276
|
}
|
|
278
|
-
function
|
|
277
|
+
function bt(t) {
|
|
279
278
|
let e = !1, s = 0, r = !1, n;
|
|
280
|
-
const
|
|
279
|
+
const o = Ee(), a = (f) => {
|
|
281
280
|
var g;
|
|
282
|
-
r || (m(new
|
|
283
|
-
},
|
|
281
|
+
r || (m(new tt(f)), (g = t.abort) == null || g.call(t));
|
|
282
|
+
}, h = () => {
|
|
284
283
|
e = !0;
|
|
285
284
|
}, l = () => {
|
|
286
285
|
e = !1;
|
|
287
|
-
},
|
|
286
|
+
}, R = () => Xe.isFocused() && (t.networkMode === "always" || Ye.isOnline()) && t.canRun(), v = () => et(t.networkMode) && t.canRun(), u = (f) => {
|
|
288
287
|
var g;
|
|
289
|
-
r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(),
|
|
288
|
+
r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(), o.resolve(f));
|
|
290
289
|
}, m = (f) => {
|
|
291
290
|
var g;
|
|
292
|
-
r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(),
|
|
291
|
+
r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(), o.reject(f));
|
|
293
292
|
}, S = () => new Promise((f) => {
|
|
294
293
|
var g;
|
|
295
|
-
n = (
|
|
296
|
-
(r ||
|
|
294
|
+
n = (T) => {
|
|
295
|
+
(r || R()) && f(T);
|
|
297
296
|
}, (g = t.onPause) == null || g.call(t);
|
|
298
297
|
}).then(() => {
|
|
299
298
|
var f;
|
|
@@ -305,59 +304,59 @@ function Rt(t) {
|
|
|
305
304
|
const g = s === 0 ? t.initialPromise : void 0;
|
|
306
305
|
try {
|
|
307
306
|
f = g ?? t.fn();
|
|
308
|
-
} catch (
|
|
309
|
-
f = Promise.reject(
|
|
307
|
+
} catch (T) {
|
|
308
|
+
f = Promise.reject(T);
|
|
310
309
|
}
|
|
311
|
-
Promise.resolve(f).then(
|
|
312
|
-
var
|
|
310
|
+
Promise.resolve(f).then(u).catch((T) => {
|
|
311
|
+
var ye;
|
|
313
312
|
if (r)
|
|
314
313
|
return;
|
|
315
|
-
const
|
|
316
|
-
if (e || !
|
|
317
|
-
m(
|
|
314
|
+
const Q = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? vt, he = typeof N == "function" ? N(s, T) : N, ce = Q === !0 || typeof Q == "number" && s < Q || typeof Q == "function" && Q(s, T);
|
|
315
|
+
if (e || !ce) {
|
|
316
|
+
m(T);
|
|
318
317
|
return;
|
|
319
318
|
}
|
|
320
|
-
s++, (
|
|
321
|
-
e ? m(
|
|
319
|
+
s++, (ye = t.onFail) == null || ye.call(t, s, T), dt(he).then(() => R() ? void 0 : S()).then(() => {
|
|
320
|
+
e ? m(T) : w();
|
|
322
321
|
});
|
|
323
322
|
});
|
|
324
323
|
};
|
|
325
324
|
return {
|
|
326
|
-
promise:
|
|
325
|
+
promise: o,
|
|
327
326
|
cancel: a,
|
|
328
|
-
continue: () => (n == null || n(),
|
|
329
|
-
cancelRetry:
|
|
327
|
+
continue: () => (n == null || n(), o),
|
|
328
|
+
cancelRetry: h,
|
|
330
329
|
continueRetry: l,
|
|
331
330
|
canStart: v,
|
|
332
|
-
start: () => (v() ? w() : S().then(w),
|
|
331
|
+
start: () => (v() ? w() : S().then(w), o)
|
|
333
332
|
};
|
|
334
333
|
}
|
|
335
|
-
function
|
|
336
|
-
let t = [], e = 0, s = (
|
|
337
|
-
|
|
338
|
-
}, r = (
|
|
339
|
-
|
|
340
|
-
}, n = (
|
|
341
|
-
const
|
|
342
|
-
e ? t.push(
|
|
343
|
-
s(
|
|
334
|
+
function mt() {
|
|
335
|
+
let t = [], e = 0, s = (h) => {
|
|
336
|
+
h();
|
|
337
|
+
}, r = (h) => {
|
|
338
|
+
h();
|
|
339
|
+
}, n = (h) => setTimeout(h, 0);
|
|
340
|
+
const o = (h) => {
|
|
341
|
+
e ? t.push(h) : n(() => {
|
|
342
|
+
s(h);
|
|
344
343
|
});
|
|
345
344
|
}, a = () => {
|
|
346
|
-
const
|
|
347
|
-
t = [],
|
|
345
|
+
const h = t;
|
|
346
|
+
t = [], h.length && n(() => {
|
|
348
347
|
r(() => {
|
|
349
|
-
|
|
348
|
+
h.forEach((l) => {
|
|
350
349
|
s(l);
|
|
351
350
|
});
|
|
352
351
|
});
|
|
353
352
|
});
|
|
354
353
|
};
|
|
355
354
|
return {
|
|
356
|
-
batch: (
|
|
355
|
+
batch: (h) => {
|
|
357
356
|
let l;
|
|
358
357
|
e++;
|
|
359
358
|
try {
|
|
360
|
-
l =
|
|
359
|
+
l = h();
|
|
361
360
|
} finally {
|
|
362
361
|
e--, e || a();
|
|
363
362
|
}
|
|
@@ -366,32 +365,32 @@ function wt() {
|
|
|
366
365
|
/**
|
|
367
366
|
* All calls to the wrapped function will be batched.
|
|
368
367
|
*/
|
|
369
|
-
batchCalls: (
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
batchCalls: (h) => (...l) => {
|
|
369
|
+
o(() => {
|
|
370
|
+
h(...l);
|
|
372
371
|
});
|
|
373
372
|
},
|
|
374
|
-
schedule:
|
|
373
|
+
schedule: o,
|
|
375
374
|
/**
|
|
376
375
|
* Use this method to set a custom notify function.
|
|
377
376
|
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
378
377
|
*/
|
|
379
|
-
setNotifyFunction: (
|
|
380
|
-
s =
|
|
378
|
+
setNotifyFunction: (h) => {
|
|
379
|
+
s = h;
|
|
381
380
|
},
|
|
382
381
|
/**
|
|
383
382
|
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
384
383
|
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
385
384
|
*/
|
|
386
|
-
setBatchNotifyFunction: (
|
|
387
|
-
r =
|
|
385
|
+
setBatchNotifyFunction: (h) => {
|
|
386
|
+
r = h;
|
|
388
387
|
},
|
|
389
|
-
setScheduler: (
|
|
390
|
-
n =
|
|
388
|
+
setScheduler: (h) => {
|
|
389
|
+
n = h;
|
|
391
390
|
}
|
|
392
391
|
};
|
|
393
392
|
}
|
|
394
|
-
var
|
|
393
|
+
var je = mt(), _, Ve, gt = (Ve = class {
|
|
395
394
|
constructor() {
|
|
396
395
|
y(this, _);
|
|
397
396
|
}
|
|
@@ -399,7 +398,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
399
398
|
this.clearGcTimeout();
|
|
400
399
|
}
|
|
401
400
|
scheduleGc() {
|
|
402
|
-
this.clearGcTimeout(),
|
|
401
|
+
this.clearGcTimeout(), me(this.gcTime) && c(this, _, setTimeout(() => {
|
|
403
402
|
this.optionalRemove();
|
|
404
403
|
}, this.gcTime));
|
|
405
404
|
}
|
|
@@ -412,34 +411,34 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
412
411
|
clearGcTimeout() {
|
|
413
412
|
i(this, _) && (clearTimeout(i(this, _)), c(this, _, void 0));
|
|
414
413
|
}
|
|
415
|
-
}, _ = new WeakMap(),
|
|
414
|
+
}, _ = new WeakMap(), Ve), Y, ee, D, C, ae, H, q, j, $e, Jt = ($e = class extends gt {
|
|
416
415
|
constructor(e) {
|
|
417
416
|
super();
|
|
418
|
-
y(this,
|
|
417
|
+
y(this, q);
|
|
418
|
+
y(this, Y);
|
|
419
419
|
y(this, ee);
|
|
420
|
-
y(this, te);
|
|
421
420
|
y(this, D);
|
|
422
|
-
y(this,
|
|
423
|
-
y(this,
|
|
421
|
+
y(this, C);
|
|
422
|
+
y(this, ae);
|
|
424
423
|
y(this, H);
|
|
425
|
-
c(this, H, !1), c(this,
|
|
424
|
+
c(this, H, !1), c(this, ae, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, D, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, Y, Rt(this.options)), this.state = e.state ?? i(this, Y), this.scheduleGc();
|
|
426
425
|
}
|
|
427
426
|
get meta() {
|
|
428
427
|
return this.options.meta;
|
|
429
428
|
}
|
|
430
429
|
get promise() {
|
|
431
430
|
var e;
|
|
432
|
-
return (e = i(this,
|
|
431
|
+
return (e = i(this, C)) == null ? void 0 : e.promise;
|
|
433
432
|
}
|
|
434
433
|
setOptions(e) {
|
|
435
|
-
this.options = { ...i(this,
|
|
434
|
+
this.options = { ...i(this, ae), ...e }, this.updateGcTime(this.options.gcTime);
|
|
436
435
|
}
|
|
437
436
|
optionalRemove() {
|
|
438
437
|
!this.observers.length && this.state.fetchStatus === "idle" && i(this, D).remove(this);
|
|
439
438
|
}
|
|
440
439
|
setData(e, s) {
|
|
441
|
-
const r =
|
|
442
|
-
return b(this,
|
|
440
|
+
const r = we(this.state.data, e, this.options);
|
|
441
|
+
return b(this, q, j).call(this, {
|
|
443
442
|
data: r,
|
|
444
443
|
type: "success",
|
|
445
444
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -447,26 +446,26 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
447
446
|
}), r;
|
|
448
447
|
}
|
|
449
448
|
setState(e, s) {
|
|
450
|
-
b(this,
|
|
449
|
+
b(this, q, j).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
451
450
|
}
|
|
452
451
|
cancel(e) {
|
|
453
452
|
var r, n;
|
|
454
|
-
const s = (r = i(this,
|
|
455
|
-
return (n = i(this,
|
|
453
|
+
const s = (r = i(this, C)) == null ? void 0 : r.promise;
|
|
454
|
+
return (n = i(this, C)) == null || n.cancel(e), s ? s.then(be).catch(be) : Promise.resolve();
|
|
456
455
|
}
|
|
457
456
|
destroy() {
|
|
458
457
|
super.destroy(), this.cancel({ silent: !0 });
|
|
459
458
|
}
|
|
460
459
|
reset() {
|
|
461
|
-
this.destroy(), this.setState(i(this,
|
|
460
|
+
this.destroy(), this.setState(i(this, Y));
|
|
462
461
|
}
|
|
463
462
|
isActive() {
|
|
464
463
|
return this.observers.some(
|
|
465
|
-
(e) =>
|
|
464
|
+
(e) => I(e.options.enabled, this) !== !1
|
|
466
465
|
);
|
|
467
466
|
}
|
|
468
467
|
isDisabled() {
|
|
469
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
468
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === fe || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
470
469
|
}
|
|
471
470
|
isStale() {
|
|
472
471
|
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -474,129 +473,129 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
474
473
|
) : this.state.data === void 0;
|
|
475
474
|
}
|
|
476
475
|
isStaleByTime(e = 0) {
|
|
477
|
-
return this.state.isInvalidated || this.state.data === void 0 || !
|
|
476
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Ze(this.state.dataUpdatedAt, e);
|
|
478
477
|
}
|
|
479
478
|
onFocus() {
|
|
480
479
|
var s;
|
|
481
480
|
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
482
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this,
|
|
481
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
483
482
|
}
|
|
484
483
|
onOnline() {
|
|
485
484
|
var s;
|
|
486
485
|
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
487
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this,
|
|
486
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
488
487
|
}
|
|
489
488
|
addObserver(e) {
|
|
490
489
|
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, D).notify({ type: "observerAdded", query: this, observer: e }));
|
|
491
490
|
}
|
|
492
491
|
removeObserver(e) {
|
|
493
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this,
|
|
492
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, C) && (i(this, H) ? i(this, C).cancel({ revert: !0 }) : i(this, C).cancelRetry()), this.scheduleGc()), i(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
494
493
|
}
|
|
495
494
|
getObserversCount() {
|
|
496
495
|
return this.observers.length;
|
|
497
496
|
}
|
|
498
497
|
invalidate() {
|
|
499
|
-
this.state.isInvalidated || b(this,
|
|
498
|
+
this.state.isInvalidated || b(this, q, j).call(this, { type: "invalidate" });
|
|
500
499
|
}
|
|
501
500
|
fetch(e, s) {
|
|
502
|
-
var l,
|
|
501
|
+
var l, R, v;
|
|
503
502
|
if (this.state.fetchStatus !== "idle") {
|
|
504
503
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
505
504
|
this.cancel({ silent: !0 });
|
|
506
|
-
else if (i(this,
|
|
507
|
-
return i(this,
|
|
505
|
+
else if (i(this, C))
|
|
506
|
+
return i(this, C).continueRetry(), i(this, C).promise;
|
|
508
507
|
}
|
|
509
508
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
510
|
-
const
|
|
511
|
-
|
|
509
|
+
const u = this.observers.find((m) => m.options.queryFn);
|
|
510
|
+
u && this.setOptions(u.options);
|
|
512
511
|
}
|
|
513
512
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
514
513
|
"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']"
|
|
515
514
|
));
|
|
516
|
-
const r = new AbortController(), n = (
|
|
517
|
-
Object.defineProperty(
|
|
515
|
+
const r = new AbortController(), n = (u) => {
|
|
516
|
+
Object.defineProperty(u, "signal", {
|
|
518
517
|
enumerable: !0,
|
|
519
518
|
get: () => (c(this, H, !0), r.signal)
|
|
520
519
|
});
|
|
521
|
-
},
|
|
522
|
-
const
|
|
520
|
+
}, o = () => {
|
|
521
|
+
const u = ft(this.options, s), m = {
|
|
523
522
|
queryKey: this.queryKey,
|
|
524
523
|
meta: this.meta
|
|
525
524
|
};
|
|
526
525
|
return n(m), c(this, H, !1), this.options.persister ? this.options.persister(
|
|
527
|
-
|
|
526
|
+
u,
|
|
528
527
|
m,
|
|
529
528
|
this
|
|
530
|
-
) :
|
|
529
|
+
) : u(m);
|
|
531
530
|
}, a = {
|
|
532
531
|
fetchOptions: s,
|
|
533
532
|
options: this.options,
|
|
534
533
|
queryKey: this.queryKey,
|
|
535
534
|
state: this.state,
|
|
536
|
-
fetchFn:
|
|
535
|
+
fetchFn: o
|
|
537
536
|
};
|
|
538
537
|
n(a), (l = this.options.behavior) == null || l.onFetch(
|
|
539
538
|
a,
|
|
540
539
|
this
|
|
541
|
-
), c(this,
|
|
542
|
-
const
|
|
540
|
+
), c(this, ee, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((R = a.fetchOptions) == null ? void 0 : R.meta)) && b(this, q, j).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
|
|
541
|
+
const h = (u) => {
|
|
543
542
|
var m, S, w, f;
|
|
544
|
-
|
|
543
|
+
ve(u) && u.silent || b(this, q, j).call(this, {
|
|
545
544
|
type: "error",
|
|
546
|
-
error:
|
|
547
|
-
}),
|
|
545
|
+
error: u
|
|
546
|
+
}), ve(u) || ((S = (m = i(this, D).config).onError) == null || S.call(
|
|
548
547
|
m,
|
|
549
|
-
|
|
548
|
+
u,
|
|
550
549
|
this
|
|
551
550
|
), (f = (w = i(this, D).config).onSettled) == null || f.call(
|
|
552
551
|
w,
|
|
553
552
|
this.state.data,
|
|
554
|
-
|
|
553
|
+
u,
|
|
555
554
|
this
|
|
556
555
|
)), this.scheduleGc();
|
|
557
556
|
};
|
|
558
|
-
return c(this,
|
|
557
|
+
return c(this, C, bt({
|
|
559
558
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
560
559
|
fn: a.fetchFn,
|
|
561
560
|
abort: r.abort.bind(r),
|
|
562
|
-
onSuccess: (
|
|
561
|
+
onSuccess: (u) => {
|
|
563
562
|
var m, S, w, f;
|
|
564
|
-
if (
|
|
563
|
+
if (u === void 0) {
|
|
565
564
|
process.env.NODE_ENV !== "production" && console.error(
|
|
566
565
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
567
|
-
),
|
|
566
|
+
), h(new Error(`${this.queryHash} data is undefined`));
|
|
568
567
|
return;
|
|
569
568
|
}
|
|
570
569
|
try {
|
|
571
|
-
this.setData(
|
|
570
|
+
this.setData(u);
|
|
572
571
|
} catch (g) {
|
|
573
|
-
|
|
572
|
+
h(g);
|
|
574
573
|
return;
|
|
575
574
|
}
|
|
576
|
-
(S = (m = i(this, D).config).onSuccess) == null || S.call(m,
|
|
575
|
+
(S = (m = i(this, D).config).onSuccess) == null || S.call(m, u, this), (f = (w = i(this, D).config).onSettled) == null || f.call(
|
|
577
576
|
w,
|
|
578
|
-
|
|
577
|
+
u,
|
|
579
578
|
this.state.error,
|
|
580
579
|
this
|
|
581
580
|
), this.scheduleGc();
|
|
582
581
|
},
|
|
583
|
-
onError:
|
|
584
|
-
onFail: (
|
|
585
|
-
b(this,
|
|
582
|
+
onError: h,
|
|
583
|
+
onFail: (u, m) => {
|
|
584
|
+
b(this, q, j).call(this, { type: "failed", failureCount: u, error: m });
|
|
586
585
|
},
|
|
587
586
|
onPause: () => {
|
|
588
|
-
b(this,
|
|
587
|
+
b(this, q, j).call(this, { type: "pause" });
|
|
589
588
|
},
|
|
590
589
|
onContinue: () => {
|
|
591
|
-
b(this,
|
|
590
|
+
b(this, q, j).call(this, { type: "continue" });
|
|
592
591
|
},
|
|
593
592
|
retry: a.options.retry,
|
|
594
593
|
retryDelay: a.options.retryDelay,
|
|
595
594
|
networkMode: a.options.networkMode,
|
|
596
595
|
canRun: () => !0
|
|
597
|
-
})), i(this,
|
|
596
|
+
})), i(this, C).start();
|
|
598
597
|
}
|
|
599
|
-
},
|
|
598
|
+
}, Y = new WeakMap(), ee = new WeakMap(), D = new WeakMap(), C = new WeakMap(), ae = new WeakMap(), H = new WeakMap(), q = new WeakSet(), j = function(e) {
|
|
600
599
|
const s = (r) => {
|
|
601
600
|
switch (e.type) {
|
|
602
601
|
case "failed":
|
|
@@ -618,7 +617,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
618
617
|
case "fetch":
|
|
619
618
|
return {
|
|
620
619
|
...r,
|
|
621
|
-
...
|
|
620
|
+
...st(r.data, this.options),
|
|
622
621
|
fetchMeta: e.meta ?? null
|
|
623
622
|
};
|
|
624
623
|
case "success":
|
|
@@ -638,7 +637,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
638
637
|
};
|
|
639
638
|
case "error":
|
|
640
639
|
const n = e.error;
|
|
641
|
-
return
|
|
640
|
+
return ve(n) && n.revert && i(this, ee) ? { ...i(this, ee), fetchStatus: "idle" } : {
|
|
642
641
|
...r,
|
|
643
642
|
error: n,
|
|
644
643
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
@@ -660,24 +659,24 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
660
659
|
};
|
|
661
660
|
}
|
|
662
661
|
};
|
|
663
|
-
this.state = s(this.state),
|
|
662
|
+
this.state = s(this.state), je.batch(() => {
|
|
664
663
|
this.observers.forEach((r) => {
|
|
665
664
|
r.onQueryUpdate();
|
|
666
665
|
}), i(this, D).notify({ query: this, type: "updated", action: e });
|
|
667
666
|
});
|
|
668
|
-
},
|
|
669
|
-
function
|
|
667
|
+
}, $e);
|
|
668
|
+
function st(t, e) {
|
|
670
669
|
return {
|
|
671
670
|
fetchFailureCount: 0,
|
|
672
671
|
fetchFailureReason: null,
|
|
673
|
-
fetchStatus:
|
|
672
|
+
fetchStatus: et(e.networkMode) ? "fetching" : "paused",
|
|
674
673
|
...t === void 0 && {
|
|
675
674
|
error: null,
|
|
676
675
|
status: "pending"
|
|
677
676
|
}
|
|
678
677
|
};
|
|
679
678
|
}
|
|
680
|
-
function
|
|
679
|
+
function Rt(t) {
|
|
681
680
|
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;
|
|
682
681
|
return {
|
|
683
682
|
data: e,
|
|
@@ -694,28 +693,28 @@ function Ot(t) {
|
|
|
694
693
|
fetchStatus: "idle"
|
|
695
694
|
};
|
|
696
695
|
}
|
|
697
|
-
var
|
|
696
|
+
var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe, qe, Ie, it, We, rt = (We = class extends xe {
|
|
698
697
|
constructor(e, s) {
|
|
699
698
|
super();
|
|
700
699
|
y(this, p);
|
|
701
|
-
y(this, F);
|
|
702
|
-
y(this, d);
|
|
703
|
-
y(this, ue);
|
|
704
700
|
y(this, O);
|
|
701
|
+
y(this, d);
|
|
702
|
+
y(this, oe);
|
|
703
|
+
y(this, F);
|
|
705
704
|
y(this, B);
|
|
706
|
-
y(this,
|
|
707
|
-
y(this,
|
|
705
|
+
y(this, te);
|
|
706
|
+
y(this, M);
|
|
708
707
|
y(this, x);
|
|
709
|
-
y(this,
|
|
710
|
-
y(this,
|
|
708
|
+
y(this, ue);
|
|
709
|
+
y(this, se);
|
|
711
710
|
// This property keeps track of the last query with defined data.
|
|
712
711
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
713
|
-
y(this,
|
|
712
|
+
y(this, re);
|
|
714
713
|
y(this, G);
|
|
715
714
|
y(this, z);
|
|
716
|
-
y(this,
|
|
717
|
-
y(this,
|
|
718
|
-
this.options = s, c(this,
|
|
715
|
+
y(this, L);
|
|
716
|
+
y(this, ie, /* @__PURE__ */ new Set());
|
|
717
|
+
this.options = s, c(this, O, e), c(this, x, null), c(this, M, Ee()), this.options.experimental_prefetchInRender || i(this, M).reject(
|
|
719
718
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
720
719
|
), this.bindMethods(), this.setOptions(s);
|
|
721
720
|
}
|
|
@@ -723,7 +722,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
723
722
|
this.refetch = this.refetch.bind(this);
|
|
724
723
|
}
|
|
725
724
|
onSubscribe() {
|
|
726
|
-
this.listeners.size === 1 && (i(this, d).addObserver(this),
|
|
725
|
+
this.listeners.size === 1 && (i(this, d).addObserver(this), _e(i(this, d), this.options) ? b(this, p, ne).call(this) : this.updateResult(), b(this, p, De).call(this));
|
|
727
726
|
}
|
|
728
727
|
onUnsubscribe() {
|
|
729
728
|
this.hasListeners() || this.destroy();
|
|
@@ -743,35 +742,35 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
743
742
|
);
|
|
744
743
|
}
|
|
745
744
|
destroy() {
|
|
746
|
-
this.listeners = /* @__PURE__ */ new Set(), b(this, p,
|
|
745
|
+
this.listeners = /* @__PURE__ */ new Set(), b(this, p, Pe).call(this), b(this, p, qe).call(this), i(this, d).removeObserver(this);
|
|
747
746
|
}
|
|
748
747
|
setOptions(e, s) {
|
|
749
748
|
const r = this.options, n = i(this, d);
|
|
750
|
-
if (this.options = i(this,
|
|
749
|
+
if (this.options = i(this, O).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof I(this.options.enabled, i(this, d)) != "boolean")
|
|
751
750
|
throw new Error(
|
|
752
751
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
753
752
|
);
|
|
754
|
-
b(this, p,
|
|
753
|
+
b(this, p, Ie).call(this), i(this, d).setOptions(this.options), r._defaulted && !Se(this.options, r) && i(this, O).getQueryCache().notify({
|
|
755
754
|
type: "observerOptionsUpdated",
|
|
756
755
|
query: i(this, d),
|
|
757
756
|
observer: this
|
|
758
757
|
});
|
|
759
|
-
const
|
|
760
|
-
|
|
758
|
+
const o = this.hasListeners();
|
|
759
|
+
o && He(
|
|
761
760
|
i(this, d),
|
|
762
761
|
n,
|
|
763
762
|
this.options,
|
|
764
763
|
r
|
|
765
|
-
) && b(this, p,
|
|
766
|
-
const a = b(this, p,
|
|
767
|
-
|
|
764
|
+
) && b(this, p, ne).call(this), this.updateResult(s), o && (i(this, d) !== n || I(this.options.enabled, i(this, d)) !== I(r.enabled, i(this, d)) || de(this.options.staleTime, i(this, d)) !== de(r.staleTime, i(this, d))) && b(this, p, Fe).call(this);
|
|
765
|
+
const a = b(this, p, Oe).call(this);
|
|
766
|
+
o && (i(this, d) !== n || I(this.options.enabled, i(this, d)) !== I(r.enabled, i(this, d)) || a !== i(this, L)) && b(this, p, Te).call(this, a);
|
|
768
767
|
}
|
|
769
768
|
getOptimisticResult(e) {
|
|
770
|
-
const s = i(this,
|
|
771
|
-
return
|
|
769
|
+
const s = i(this, O).getQueryCache().build(i(this, O), e), r = this.createResult(s, e);
|
|
770
|
+
return Ct(this, r) && (c(this, F, r), c(this, te, this.options), c(this, B, i(this, d).state)), r;
|
|
772
771
|
}
|
|
773
772
|
getCurrentResult() {
|
|
774
|
-
return i(this,
|
|
773
|
+
return i(this, F);
|
|
775
774
|
}
|
|
776
775
|
trackResult(e, s) {
|
|
777
776
|
const r = {};
|
|
@@ -784,7 +783,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
784
783
|
}), r;
|
|
785
784
|
}
|
|
786
785
|
trackProp(e) {
|
|
787
|
-
i(this,
|
|
786
|
+
i(this, ie).add(e);
|
|
788
787
|
}
|
|
789
788
|
getCurrentQuery() {
|
|
790
789
|
return i(this, d);
|
|
@@ -795,214 +794,214 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
795
794
|
});
|
|
796
795
|
}
|
|
797
796
|
fetchOptimistic(e) {
|
|
798
|
-
const s = i(this,
|
|
797
|
+
const s = i(this, O).defaultQueryOptions(e), r = i(this, O).getQueryCache().build(i(this, O), s);
|
|
799
798
|
return r.fetch().then(() => this.createResult(r, s));
|
|
800
799
|
}
|
|
801
800
|
fetch(e) {
|
|
802
|
-
return b(this, p,
|
|
801
|
+
return b(this, p, ne).call(this, {
|
|
803
802
|
...e,
|
|
804
803
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
805
|
-
}).then(() => (this.updateResult(), i(this,
|
|
804
|
+
}).then(() => (this.updateResult(), i(this, F)));
|
|
806
805
|
}
|
|
807
806
|
createResult(e, s) {
|
|
808
|
-
var
|
|
809
|
-
const r = i(this, d), n = this.options,
|
|
810
|
-
let
|
|
807
|
+
var Me;
|
|
808
|
+
const r = i(this, d), n = this.options, o = i(this, F), a = i(this, B), h = i(this, te), R = e !== r ? e.state : i(this, oe), { state: v } = e;
|
|
809
|
+
let u = { ...v }, m = !1, S;
|
|
811
810
|
if (s._optimisticResults) {
|
|
812
|
-
const E = this.hasListeners(),
|
|
813
|
-
(
|
|
814
|
-
...
|
|
815
|
-
...
|
|
816
|
-
}), s._optimisticResults === "isRestoring" && (
|
|
811
|
+
const E = this.hasListeners(), $ = !E && _e(e, s), W = E && He(e, r, s, n);
|
|
812
|
+
($ || W) && (u = {
|
|
813
|
+
...u,
|
|
814
|
+
...st(v.data, e.options)
|
|
815
|
+
}), s._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
|
|
817
816
|
}
|
|
818
|
-
let { error: w, errorUpdatedAt: f, status: g } =
|
|
819
|
-
if (s.select &&
|
|
820
|
-
if (
|
|
821
|
-
S = i(this,
|
|
817
|
+
let { error: w, errorUpdatedAt: f, status: g } = u;
|
|
818
|
+
if (s.select && u.data !== void 0)
|
|
819
|
+
if (o && u.data === (a == null ? void 0 : a.data) && s.select === i(this, ue))
|
|
820
|
+
S = i(this, se);
|
|
822
821
|
else
|
|
823
822
|
try {
|
|
824
|
-
c(this,
|
|
823
|
+
c(this, ue, s.select), S = s.select(u.data), S = we(o == null ? void 0 : o.data, S, s), c(this, se, S), c(this, x, null);
|
|
825
824
|
} catch (E) {
|
|
826
825
|
c(this, x, E);
|
|
827
826
|
}
|
|
828
827
|
else
|
|
829
|
-
S =
|
|
828
|
+
S = u.data;
|
|
830
829
|
if (s.placeholderData !== void 0 && S === void 0 && g === "pending") {
|
|
831
830
|
let E;
|
|
832
|
-
if (
|
|
833
|
-
E =
|
|
831
|
+
if (o != null && o.isPlaceholderData && s.placeholderData === (h == null ? void 0 : h.placeholderData))
|
|
832
|
+
E = o.data;
|
|
834
833
|
else if (E = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
835
|
-
(
|
|
836
|
-
i(this,
|
|
834
|
+
(Me = i(this, re)) == null ? void 0 : Me.state.data,
|
|
835
|
+
i(this, re)
|
|
837
836
|
) : s.placeholderData, s.select && E !== void 0)
|
|
838
837
|
try {
|
|
839
838
|
E = s.select(E), c(this, x, null);
|
|
840
|
-
} catch (
|
|
841
|
-
c(this, x,
|
|
839
|
+
} catch ($) {
|
|
840
|
+
c(this, x, $);
|
|
842
841
|
}
|
|
843
|
-
E !== void 0 && (g = "success", S =
|
|
844
|
-
|
|
842
|
+
E !== void 0 && (g = "success", S = we(
|
|
843
|
+
o == null ? void 0 : o.data,
|
|
845
844
|
E,
|
|
846
845
|
s
|
|
847
846
|
), m = !0);
|
|
848
847
|
}
|
|
849
|
-
i(this, x) && (w = i(this, x), S = i(this,
|
|
850
|
-
const
|
|
848
|
+
i(this, x) && (w = i(this, x), S = i(this, se), f = Date.now(), g = "error");
|
|
849
|
+
const T = u.fetchStatus === "fetching", Q = g === "pending", N = g === "error", he = Q && T, ce = S !== void 0, U = {
|
|
851
850
|
status: g,
|
|
852
|
-
fetchStatus:
|
|
853
|
-
isPending:
|
|
851
|
+
fetchStatus: u.fetchStatus,
|
|
852
|
+
isPending: Q,
|
|
854
853
|
isSuccess: g === "success",
|
|
855
854
|
isError: N,
|
|
856
|
-
isInitialLoading:
|
|
857
|
-
isLoading:
|
|
855
|
+
isInitialLoading: he,
|
|
856
|
+
isLoading: he,
|
|
858
857
|
data: S,
|
|
859
|
-
dataUpdatedAt:
|
|
858
|
+
dataUpdatedAt: u.dataUpdatedAt,
|
|
860
859
|
error: w,
|
|
861
860
|
errorUpdatedAt: f,
|
|
862
|
-
failureCount:
|
|
863
|
-
failureReason:
|
|
864
|
-
errorUpdateCount:
|
|
865
|
-
isFetched:
|
|
866
|
-
isFetchedAfterMount:
|
|
867
|
-
isFetching:
|
|
868
|
-
isRefetching:
|
|
869
|
-
isLoadingError: N && !
|
|
870
|
-
isPaused:
|
|
861
|
+
failureCount: u.fetchFailureCount,
|
|
862
|
+
failureReason: u.fetchFailureReason,
|
|
863
|
+
errorUpdateCount: u.errorUpdateCount,
|
|
864
|
+
isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
|
|
865
|
+
isFetchedAfterMount: u.dataUpdateCount > R.dataUpdateCount || u.errorUpdateCount > R.errorUpdateCount,
|
|
866
|
+
isFetching: T,
|
|
867
|
+
isRefetching: T && !Q,
|
|
868
|
+
isLoadingError: N && !ce,
|
|
869
|
+
isPaused: u.fetchStatus === "paused",
|
|
871
870
|
isPlaceholderData: m,
|
|
872
|
-
isRefetchError: N &&
|
|
873
|
-
isStale:
|
|
871
|
+
isRefetchError: N && ce,
|
|
872
|
+
isStale: Ae(e, s),
|
|
874
873
|
refetch: this.refetch,
|
|
875
|
-
promise: i(this,
|
|
874
|
+
promise: i(this, M)
|
|
876
875
|
};
|
|
877
876
|
if (this.options.experimental_prefetchInRender) {
|
|
878
|
-
const E = (
|
|
879
|
-
|
|
880
|
-
},
|
|
881
|
-
const
|
|
882
|
-
E(
|
|
883
|
-
},
|
|
884
|
-
switch (
|
|
877
|
+
const E = (le) => {
|
|
878
|
+
U.status === "error" ? le.reject(U.error) : U.data !== void 0 && le.resolve(U.data);
|
|
879
|
+
}, $ = () => {
|
|
880
|
+
const le = c(this, M, U.promise = Ee());
|
|
881
|
+
E(le);
|
|
882
|
+
}, W = i(this, M);
|
|
883
|
+
switch (W.status) {
|
|
885
884
|
case "pending":
|
|
886
|
-
e.queryHash === r.queryHash && E(
|
|
885
|
+
e.queryHash === r.queryHash && E(W);
|
|
887
886
|
break;
|
|
888
887
|
case "fulfilled":
|
|
889
|
-
(
|
|
888
|
+
(U.status === "error" || U.data !== W.value) && $();
|
|
890
889
|
break;
|
|
891
890
|
case "rejected":
|
|
892
|
-
(
|
|
891
|
+
(U.status !== "error" || U.error !== W.reason) && $();
|
|
893
892
|
break;
|
|
894
893
|
}
|
|
895
894
|
}
|
|
896
|
-
return
|
|
895
|
+
return U;
|
|
897
896
|
}
|
|
898
897
|
updateResult(e) {
|
|
899
|
-
const s = i(this,
|
|
900
|
-
if (c(this, B, i(this, d).state), c(this,
|
|
898
|
+
const s = i(this, F), r = this.createResult(i(this, d), this.options);
|
|
899
|
+
if (c(this, B, i(this, d).state), c(this, te, this.options), i(this, B).data !== void 0 && c(this, re, i(this, d)), Se(r, s))
|
|
901
900
|
return;
|
|
902
|
-
c(this,
|
|
903
|
-
const n = {},
|
|
901
|
+
c(this, F, r);
|
|
902
|
+
const n = {}, o = () => {
|
|
904
903
|
if (!s)
|
|
905
904
|
return !0;
|
|
906
|
-
const { notifyOnChangeProps: a } = this.options,
|
|
907
|
-
if (
|
|
905
|
+
const { notifyOnChangeProps: a } = this.options, h = typeof a == "function" ? a() : a;
|
|
906
|
+
if (h === "all" || !h && !i(this, ie).size)
|
|
908
907
|
return !0;
|
|
909
908
|
const l = new Set(
|
|
910
|
-
|
|
909
|
+
h ?? i(this, ie)
|
|
911
910
|
);
|
|
912
|
-
return this.options.throwOnError && l.add("error"), Object.keys(i(this,
|
|
913
|
-
const v =
|
|
914
|
-
return i(this,
|
|
911
|
+
return this.options.throwOnError && l.add("error"), Object.keys(i(this, F)).some((R) => {
|
|
912
|
+
const v = R;
|
|
913
|
+
return i(this, F)[v] !== s[v] && l.has(v);
|
|
915
914
|
});
|
|
916
915
|
};
|
|
917
|
-
(e == null ? void 0 : e.listeners) !== !1 &&
|
|
916
|
+
(e == null ? void 0 : e.listeners) !== !1 && o() && (n.listeners = !0), b(this, p, it).call(this, { ...n, ...e });
|
|
918
917
|
}
|
|
919
918
|
onQueryUpdate() {
|
|
920
|
-
this.updateResult(), this.hasListeners() && b(this, p,
|
|
919
|
+
this.updateResult(), this.hasListeners() && b(this, p, De).call(this);
|
|
921
920
|
}
|
|
922
|
-
},
|
|
923
|
-
b(this, p,
|
|
921
|
+
}, O = new WeakMap(), d = new WeakMap(), oe = new WeakMap(), F = new WeakMap(), B = new WeakMap(), te = new WeakMap(), M = new WeakMap(), x = new WeakMap(), ue = new WeakMap(), se = new WeakMap(), re = new WeakMap(), G = new WeakMap(), z = new WeakMap(), L = new WeakMap(), ie = new WeakMap(), p = new WeakSet(), ne = function(e) {
|
|
922
|
+
b(this, p, Ie).call(this);
|
|
924
923
|
let s = i(this, d).fetch(
|
|
925
924
|
this.options,
|
|
926
925
|
e
|
|
927
926
|
);
|
|
928
|
-
return e != null && e.throwOnError || (s = s.catch(
|
|
929
|
-
},
|
|
930
|
-
b(this, p,
|
|
931
|
-
const e =
|
|
927
|
+
return e != null && e.throwOnError || (s = s.catch(be)), s;
|
|
928
|
+
}, Fe = function() {
|
|
929
|
+
b(this, p, Pe).call(this);
|
|
930
|
+
const e = de(
|
|
932
931
|
this.options.staleTime,
|
|
933
932
|
i(this, d)
|
|
934
933
|
);
|
|
935
|
-
if (V || i(this,
|
|
934
|
+
if (V || i(this, F).isStale || !me(e))
|
|
936
935
|
return;
|
|
937
|
-
const r =
|
|
936
|
+
const r = Ze(i(this, F).dataUpdatedAt, e) + 1;
|
|
938
937
|
c(this, G, setTimeout(() => {
|
|
939
|
-
i(this,
|
|
938
|
+
i(this, F).isStale || this.updateResult();
|
|
940
939
|
}, r));
|
|
941
|
-
},
|
|
940
|
+
}, Oe = function() {
|
|
942
941
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
|
|
943
|
-
},
|
|
944
|
-
b(this, p,
|
|
945
|
-
(this.options.refetchIntervalInBackground ||
|
|
946
|
-
}, i(this,
|
|
947
|
-
},
|
|
948
|
-
b(this, p,
|
|
949
|
-
},
|
|
942
|
+
}, Te = function(e) {
|
|
943
|
+
b(this, p, qe).call(this), c(this, L, e), !(V || I(this.options.enabled, i(this, d)) === !1 || !me(i(this, L)) || i(this, L) === 0) && c(this, z, setInterval(() => {
|
|
944
|
+
(this.options.refetchIntervalInBackground || Xe.isFocused()) && b(this, p, ne).call(this);
|
|
945
|
+
}, i(this, L)));
|
|
946
|
+
}, De = function() {
|
|
947
|
+
b(this, p, Fe).call(this), b(this, p, Te).call(this, b(this, p, Oe).call(this));
|
|
948
|
+
}, Pe = function() {
|
|
950
949
|
i(this, G) && (clearTimeout(i(this, G)), c(this, G, void 0));
|
|
951
|
-
},
|
|
950
|
+
}, qe = function() {
|
|
952
951
|
i(this, z) && (clearInterval(i(this, z)), c(this, z, void 0));
|
|
953
|
-
},
|
|
954
|
-
const e = i(this,
|
|
952
|
+
}, Ie = function() {
|
|
953
|
+
const e = i(this, O).getQueryCache().build(i(this, O), this.options);
|
|
955
954
|
if (e === i(this, d))
|
|
956
955
|
return;
|
|
957
956
|
const s = i(this, d);
|
|
958
|
-
c(this, d, e), c(this,
|
|
959
|
-
},
|
|
960
|
-
|
|
957
|
+
c(this, d, e), c(this, oe, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
958
|
+
}, it = function(e) {
|
|
959
|
+
je.batch(() => {
|
|
961
960
|
e.listeners && this.listeners.forEach((s) => {
|
|
962
|
-
s(i(this,
|
|
963
|
-
}), i(this,
|
|
961
|
+
s(i(this, F));
|
|
962
|
+
}), i(this, O).getQueryCache().notify({
|
|
964
963
|
query: i(this, d),
|
|
965
964
|
type: "observerResultsUpdated"
|
|
966
965
|
});
|
|
967
966
|
});
|
|
968
|
-
},
|
|
969
|
-
function
|
|
970
|
-
return
|
|
967
|
+
}, We);
|
|
968
|
+
function St(t, e) {
|
|
969
|
+
return I(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
971
970
|
}
|
|
972
|
-
function
|
|
973
|
-
return
|
|
971
|
+
function _e(t, e) {
|
|
972
|
+
return St(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
|
|
974
973
|
}
|
|
975
974
|
function Ue(t, e, s) {
|
|
976
|
-
if (
|
|
975
|
+
if (I(e.enabled, t) !== !1) {
|
|
977
976
|
const r = typeof s == "function" ? s(t) : s;
|
|
978
|
-
return r === "always" || r !== !1 &&
|
|
977
|
+
return r === "always" || r !== !1 && Ae(t, e);
|
|
979
978
|
}
|
|
980
979
|
return !1;
|
|
981
980
|
}
|
|
982
|
-
function
|
|
983
|
-
return (t !== e ||
|
|
981
|
+
function He(t, e, s, r) {
|
|
982
|
+
return (t !== e || I(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Ae(t, s);
|
|
984
983
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
984
|
+
function Ae(t, e) {
|
|
985
|
+
return I(e.enabled, t) !== !1 && t.isStaleByTime(de(e.staleTime, t));
|
|
987
986
|
}
|
|
988
|
-
function
|
|
989
|
-
return !
|
|
987
|
+
function Ct(t, e) {
|
|
988
|
+
return !Se(t.getCurrentResult(), e);
|
|
990
989
|
}
|
|
991
|
-
var
|
|
990
|
+
var nt = P.createContext(
|
|
992
991
|
void 0
|
|
993
|
-
),
|
|
994
|
-
const e =
|
|
992
|
+
), wt = (t) => {
|
|
993
|
+
const e = P.useContext(nt);
|
|
995
994
|
if (!e)
|
|
996
995
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
997
996
|
return e;
|
|
998
|
-
},
|
|
997
|
+
}, Zt = ({
|
|
999
998
|
client: t,
|
|
1000
999
|
children: e
|
|
1001
|
-
}) => (
|
|
1000
|
+
}) => (P.useEffect(() => (t.mount(), () => {
|
|
1002
1001
|
t.unmount();
|
|
1003
|
-
}), [t]), /* @__PURE__ */
|
|
1004
|
-
|
|
1005
|
-
function
|
|
1002
|
+
}), [t]), /* @__PURE__ */ ct.jsx(nt.Provider, { value: t, children: e })), at = P.createContext(!1), Et = () => P.useContext(at);
|
|
1003
|
+
at.Provider;
|
|
1004
|
+
function Ft() {
|
|
1006
1005
|
let t = !1;
|
|
1007
1006
|
return {
|
|
1008
1007
|
clearReset: () => {
|
|
@@ -1014,209 +1013,161 @@ function Tt() {
|
|
|
1014
1013
|
isReset: () => t
|
|
1015
1014
|
};
|
|
1016
1015
|
}
|
|
1017
|
-
var
|
|
1018
|
-
function
|
|
1016
|
+
var Ot = P.createContext(Ft()), Tt = () => P.useContext(Ot);
|
|
1017
|
+
function Dt(t, e) {
|
|
1019
1018
|
return typeof t == "function" ? t(...e) : !!t;
|
|
1020
1019
|
}
|
|
1021
|
-
function
|
|
1020
|
+
function Pt() {
|
|
1022
1021
|
}
|
|
1023
|
-
var
|
|
1022
|
+
var qt = (t, e) => {
|
|
1024
1023
|
(t.suspense || t.throwOnError) && (e.isReset() || (t.retryOnMount = !1));
|
|
1025
|
-
},
|
|
1026
|
-
|
|
1024
|
+
}, It = (t) => {
|
|
1025
|
+
P.useEffect(() => {
|
|
1027
1026
|
t.clearReset();
|
|
1028
1027
|
}, [t]);
|
|
1029
|
-
},
|
|
1028
|
+
}, Ut = ({
|
|
1030
1029
|
result: t,
|
|
1031
1030
|
errorResetBoundary: e,
|
|
1032
1031
|
throwOnError: s,
|
|
1033
1032
|
query: r
|
|
1034
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r &&
|
|
1033
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && Dt(s, [t.error, r]), xt = (t, e) => e.state.data === void 0, Qt = (t) => {
|
|
1035
1034
|
t.suspense && (typeof t.staleTime != "number" && (t.staleTime = 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
1036
|
-
},
|
|
1035
|
+
}, jt = (t, e) => t.isLoading && t.isFetching && !e, At = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Be = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1037
1036
|
s.clearReset();
|
|
1038
1037
|
});
|
|
1039
|
-
function
|
|
1040
|
-
var v,
|
|
1038
|
+
function ot(t, e, s) {
|
|
1039
|
+
var v, u, m, S, w;
|
|
1041
1040
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1042
1041
|
throw new Error(
|
|
1043
1042
|
'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'
|
|
1044
1043
|
);
|
|
1045
|
-
const r =
|
|
1046
|
-
(
|
|
1044
|
+
const r = wt(), n = Et(), o = Tt(), a = r.defaultQueryOptions(t);
|
|
1045
|
+
(u = (v = r.getDefaultOptions().queries) == null ? void 0 : v._experimental_beforeQuery) == null || u.call(
|
|
1047
1046
|
v,
|
|
1048
1047
|
a
|
|
1049
|
-
), a._optimisticResults = n ? "isRestoring" : "optimistic",
|
|
1050
|
-
const
|
|
1048
|
+
), a._optimisticResults = n ? "isRestoring" : "optimistic", Qt(a), qt(a, o), It(o);
|
|
1049
|
+
const h = !r.getQueryCache().get(a.queryHash), [l] = P.useState(
|
|
1051
1050
|
() => new e(
|
|
1052
1051
|
r,
|
|
1053
1052
|
a
|
|
1054
1053
|
)
|
|
1055
|
-
),
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1054
|
+
), R = l.getOptimisticResult(a);
|
|
1055
|
+
if (P.useSyncExternalStore(
|
|
1056
|
+
P.useCallback(
|
|
1058
1057
|
(f) => {
|
|
1059
1058
|
const g = n ? () => {
|
|
1060
|
-
} : l.subscribe(
|
|
1059
|
+
} : l.subscribe(je.batchCalls(f));
|
|
1061
1060
|
return l.updateResult(), g;
|
|
1062
1061
|
},
|
|
1063
1062
|
[l, n]
|
|
1064
1063
|
),
|
|
1065
1064
|
() => l.getCurrentResult(),
|
|
1066
1065
|
() => l.getCurrentResult()
|
|
1067
|
-
),
|
|
1066
|
+
), P.useEffect(() => {
|
|
1068
1067
|
l.setOptions(a, { listeners: !1 });
|
|
1069
|
-
}, [a, l]),
|
|
1070
|
-
throw
|
|
1071
|
-
if (
|
|
1072
|
-
result:
|
|
1073
|
-
errorResetBoundary:
|
|
1068
|
+
}, [a, l]), At(a, R))
|
|
1069
|
+
throw Be(a, l, o);
|
|
1070
|
+
if (Ut({
|
|
1071
|
+
result: R,
|
|
1072
|
+
errorResetBoundary: o,
|
|
1074
1073
|
throwOnError: a.throwOnError,
|
|
1075
1074
|
query: r.getQueryCache().get(a.queryHash)
|
|
1076
1075
|
}))
|
|
1077
|
-
throw
|
|
1076
|
+
throw R.error;
|
|
1078
1077
|
if ((S = (m = r.getDefaultOptions().queries) == null ? void 0 : m._experimental_afterQuery) == null || S.call(
|
|
1079
1078
|
m,
|
|
1080
1079
|
a,
|
|
1081
|
-
|
|
1082
|
-
), a.experimental_prefetchInRender && !V &&
|
|
1083
|
-
const f =
|
|
1080
|
+
R
|
|
1081
|
+
), a.experimental_prefetchInRender && !V && jt(R, n)) {
|
|
1082
|
+
const f = h ? (
|
|
1084
1083
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1085
|
-
|
|
1084
|
+
Be(a, l, o)
|
|
1086
1085
|
) : (
|
|
1087
1086
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1088
1087
|
(w = r.getQueryCache().get(a.queryHash)) == null ? void 0 : w.promise
|
|
1089
1088
|
);
|
|
1090
|
-
f == null || f.catch(
|
|
1089
|
+
f == null || f.catch(Pt).finally(() => {
|
|
1091
1090
|
l.hasListeners() || l.updateResult();
|
|
1092
1091
|
});
|
|
1093
1092
|
}
|
|
1094
|
-
return a.notifyOnChangeProps ?
|
|
1093
|
+
return a.notifyOnChangeProps ? R : l.trackResult(R);
|
|
1095
1094
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
1095
|
+
function kt(t, e) {
|
|
1096
|
+
return ot(t, rt);
|
|
1098
1097
|
}
|
|
1099
|
-
function
|
|
1100
|
-
return process.env.NODE_ENV !== "production" && t.queryFn ===
|
|
1098
|
+
function Mt(t, e) {
|
|
1099
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error("skipToken is not allowed for useSuspenseQuery"), ot(
|
|
1101
1100
|
{
|
|
1102
1101
|
...t,
|
|
1103
1102
|
enabled: !0,
|
|
1104
1103
|
suspense: !0,
|
|
1105
|
-
throwOnError:
|
|
1104
|
+
throwOnError: xt,
|
|
1106
1105
|
placeholderData: void 0
|
|
1107
1106
|
},
|
|
1108
|
-
|
|
1107
|
+
rt
|
|
1109
1108
|
);
|
|
1110
1109
|
}
|
|
1111
|
-
const
|
|
1112
|
-
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1113
|
-
return e ? `/${e}` : "/";
|
|
1114
|
-
}, Me = (t, e) => {
|
|
1115
|
-
for (const s of t) {
|
|
1116
|
-
const r = Ne(s, e);
|
|
1117
|
-
if (r !== void 0) return r;
|
|
1118
|
-
}
|
|
1119
|
-
}, Ne = (t, e, s = []) => {
|
|
1120
|
-
const r = e(t, s);
|
|
1121
|
-
if (r !== void 0) return r;
|
|
1122
|
-
if (t.type === "category")
|
|
1123
|
-
for (const n of t.items) {
|
|
1124
|
-
const u = Ne(n, e, [
|
|
1125
|
-
...s,
|
|
1126
|
-
t
|
|
1127
|
-
]);
|
|
1128
|
-
if (u !== void 0) return u;
|
|
1129
|
-
}
|
|
1130
|
-
}, rs = () => {
|
|
1131
|
-
const t = pe(), s = lt().data.sidebar;
|
|
1132
|
-
return Me(s, (r) => {
|
|
1133
|
-
if (r.type === "doc" && $(r.id) === t.pathname)
|
|
1134
|
-
return r;
|
|
1135
|
-
});
|
|
1136
|
-
}, is = (t) => {
|
|
1137
|
-
const e = pe();
|
|
1138
|
-
return Ne(t, (s) => {
|
|
1139
|
-
if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
|
|
1140
|
-
return !0;
|
|
1141
|
-
});
|
|
1142
|
-
}, ns = () => {
|
|
1143
|
-
const t = pe().pathname, s = lt().data.sidebar;
|
|
1144
|
-
let r, n, u = !1;
|
|
1145
|
-
return Me(s, (a) => {
|
|
1146
|
-
const o = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
|
|
1147
|
-
if (o) {
|
|
1148
|
-
if (u)
|
|
1149
|
-
return n = { label: a.label, id: o }, !0;
|
|
1150
|
-
t === o ? u = !0 : r = { label: a.label, id: o };
|
|
1151
|
-
}
|
|
1152
|
-
}), { prev: r, next: n };
|
|
1153
|
-
}, Bt = dt(
|
|
1110
|
+
const Lt = ut(
|
|
1154
1111
|
void 0
|
|
1155
|
-
),
|
|
1156
|
-
const t =
|
|
1112
|
+
), ke = () => {
|
|
1113
|
+
const t = ht(Lt);
|
|
1157
1114
|
if (!t)
|
|
1158
1115
|
throw new Error("useDevPortal must be used within a DevPortalProvider.");
|
|
1159
1116
|
return t;
|
|
1160
|
-
},
|
|
1161
|
-
const { getApiIdentities: t } =
|
|
1162
|
-
return
|
|
1117
|
+
}, Xt = () => {
|
|
1118
|
+
const { getApiIdentities: t } = ke();
|
|
1119
|
+
return kt({
|
|
1163
1120
|
queryFn: t,
|
|
1164
1121
|
queryKey: ["api-identities"]
|
|
1165
1122
|
});
|
|
1166
|
-
},
|
|
1167
|
-
const {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1123
|
+
}, Nt = () => {
|
|
1124
|
+
const { topNavigation: t } = ke(), s = Je().pathname.split("/").at(1);
|
|
1125
|
+
if (s)
|
|
1126
|
+
return t.find((r) => r.id === s);
|
|
1127
|
+
}, Yt = () => {
|
|
1128
|
+
const { getPluginSidebar: t, sidebars: e } = ke(), s = Nt(), r = s == null ? void 0 : s.id, n = r ? e[r] ?? [] : [], o = Je();
|
|
1129
|
+
return Mt({
|
|
1172
1130
|
queryFn: async () => {
|
|
1173
|
-
const a = await t(r.pathname);
|
|
1131
|
+
const a = r ? await t(r) : await t(o.pathname);
|
|
1174
1132
|
return {
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
...a
|
|
1178
|
-
],
|
|
1179
|
-
topNavItem: u
|
|
1133
|
+
items: [...n, ...a],
|
|
1134
|
+
currentTopNavItem: s
|
|
1180
1135
|
};
|
|
1181
1136
|
},
|
|
1182
|
-
queryKey: ["navigation", r
|
|
1137
|
+
queryKey: ["navigation", r]
|
|
1183
1138
|
});
|
|
1184
1139
|
};
|
|
1185
1140
|
export {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
fe as
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
ye as w,
|
|
1218
|
-
$ as x,
|
|
1219
|
-
lt as y,
|
|
1220
|
-
Me as z
|
|
1141
|
+
kt as A,
|
|
1142
|
+
Jt as Q,
|
|
1143
|
+
gt as R,
|
|
1144
|
+
xe as S,
|
|
1145
|
+
Lt as Z,
|
|
1146
|
+
wt as a,
|
|
1147
|
+
Mt as b,
|
|
1148
|
+
Nt as c,
|
|
1149
|
+
Pt as d,
|
|
1150
|
+
Dt as e,
|
|
1151
|
+
lt as f,
|
|
1152
|
+
Vt as g,
|
|
1153
|
+
ge as h,
|
|
1154
|
+
be as i,
|
|
1155
|
+
ft as j,
|
|
1156
|
+
Wt as k,
|
|
1157
|
+
$t as l,
|
|
1158
|
+
zt as m,
|
|
1159
|
+
je as n,
|
|
1160
|
+
Xe as o,
|
|
1161
|
+
Ye as p,
|
|
1162
|
+
Gt as q,
|
|
1163
|
+
de as r,
|
|
1164
|
+
Se as s,
|
|
1165
|
+
Qe as t,
|
|
1166
|
+
ke as u,
|
|
1167
|
+
fe as v,
|
|
1168
|
+
Zt as w,
|
|
1169
|
+
Yt as x,
|
|
1170
|
+
bt as y,
|
|
1171
|
+
Xt as z
|
|
1221
1172
|
};
|
|
1222
|
-
//# sourceMappingURL=ZudokuContext-
|
|
1173
|
+
//# sourceMappingURL=ZudokuContext-uV_XfHPK.js.map
|