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