zudoku 0.3.0-dev.83 → 0.3.0-dev.84
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 +5 -1
- package/dist/app/demo.js +5 -4
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +3 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +5 -4
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/validators/ResolvedSidebarSchema.d.ts +18 -0
- package/dist/config/validators/ResolvedSidebarSchema.js +76 -0
- package/dist/config/validators/ResolvedSidebarSchema.js.map +1 -0
- package/dist/config/validators/SidebarSchema.d.ts +177 -0
- package/dist/config/validators/SidebarSchema.js +71 -0
- package/dist/config/validators/SidebarSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +411 -59
- package/dist/config/validators/validate.js +22 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/components/DevPortal.js +1 -1
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +5 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +9 -3
- package/dist/lib/components/context/DevPortalProvider.js +11 -23
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/context/ThemeContext.d.ts +1 -4
- package/dist/lib/components/context/ThemeContext.js +3 -29
- package/dist/lib/components/context/ThemeContext.js.map +1 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +4 -0
- package/dist/lib/components/context/ThemeProvider.js +23 -0
- package/dist/lib/components/context/ThemeProvider.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +1 -0
- package/dist/lib/components/navigation/Sidebar.js +12 -0
- package/dist/lib/components/navigation/Sidebar.js.map +1 -0
- package/dist/lib/components/navigation/SidebarBadge.d.ts +22 -0
- package/dist/lib/components/navigation/SidebarBadge.js +24 -0
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -0
- package/dist/lib/components/navigation/SidebarCategory.d.ts +5 -0
- package/dist/lib/components/navigation/SidebarCategory.js +33 -0
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -0
- package/dist/lib/components/navigation/SidebarItem.d.ts +12 -0
- package/dist/lib/components/navigation/SidebarItem.js +42 -0
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -0
- package/dist/lib/components/navigation/{SideNavigationWrapper.d.ts → SidebarWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SideNavigationWrapper.js → SidebarWrapper.js} +2 -2
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +16 -0
- package/dist/lib/components/navigation/utils.js +85 -0
- package/dist/lib/components/navigation/utils.js.map +1 -0
- package/dist/lib/core/DevPortalContext.d.ts +9 -32
- package/dist/lib/core/DevPortalContext.js +8 -5
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +6 -8
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +5 -36
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +20 -43
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +12 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +14 -11
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js +31 -17
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +3 -0
- package/dist/vite/plugin-sidebar.js +23 -0
- package/dist/vite/plugin-sidebar.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AuthenticationPlugin-XS0DoAhE.js → AuthenticationPlugin-DgwV0hVu.js} +7 -7
- package/lib/{AuthenticationPlugin-XS0DoAhE.js.map → AuthenticationPlugin-DgwV0hVu.js.map} +1 -1
- package/lib/{CategoryHeading-DCmchnA1.js → CategoryHeading-BWq12Bfa.js} +3 -3
- package/lib/{CategoryHeading-DCmchnA1.js.map → CategoryHeading-BWq12Bfa.js.map} +1 -1
- package/lib/{Combination-C442XfGG.js → Combination-DkycFHkm.js} +4 -4
- package/lib/{Combination-C442XfGG.js.map → Combination-DkycFHkm.js.map} +1 -1
- package/lib/{DevPortalProvider-BWeAysxF.js → DevPortalProvider-CTxoCHIT.js} +375 -417
- package/lib/DevPortalProvider-CTxoCHIT.js.map +1 -0
- package/lib/DeveloperHint-BQSFXH01.js +10 -0
- package/lib/{DeveloperHint-DQVwIery.js.map → DeveloperHint-BQSFXH01.js.map} +1 -1
- package/lib/{Input-3IEt27jb.js → Input-BclXSY0g.js} +5 -5
- package/lib/{Input-3IEt27jb.js.map → Input-BclXSY0g.js.map} +1 -1
- package/lib/{Markdown-QsZ-PHET.js → Markdown-B_Gax7at.js} +1136 -1152
- package/lib/{Markdown-QsZ-PHET.js.map → Markdown-B_Gax7at.js.map} +1 -1
- package/lib/{MdxPage-CA1WmW14.js → MdxPage-Crlr0GmN.js} +67 -81
- package/lib/MdxPage-Crlr0GmN.js.map +1 -0
- package/lib/{OperationList-CHK_erYP.js → OperationList-nQ0bd8TU.js} +8 -8
- package/lib/{OperationList-CHK_erYP.js.map → OperationList-nQ0bd8TU.js.map} +1 -1
- package/lib/Route-CNvxEBnR.js +14 -0
- package/lib/{Route-D70pGn9n.js.map → Route-CNvxEBnR.js.map} +1 -1
- package/lib/{SlotletProvider-B71hNEUL.js → SlotletProvider-CzMAO73_.js} +12 -12
- package/lib/{SlotletProvider-B71hNEUL.js.map → SlotletProvider-CzMAO73_.js.map} +1 -1
- package/lib/Spinner-fF-Xv-gw.js +274 -0
- package/lib/Spinner-fF-Xv-gw.js.map +1 -0
- package/lib/index-7kcHaXD6.js +1771 -0
- package/lib/index-7kcHaXD6.js.map +1 -0
- package/lib/{index-Bl6YeerK.js → index-CgCPw6Jn.js} +1026 -1043
- package/lib/index-CgCPw6Jn.js.map +1 -0
- package/lib/{index-BH-Ub36F.js → index-DkuZvRNP.js} +4 -4
- package/lib/{index-BH-Ub36F.js.map → index-DkuZvRNP.js.map} +1 -1
- package/lib/joinPath-VeNuJa7y.js +8 -0
- package/lib/joinPath-VeNuJa7y.js.map +1 -0
- package/lib/jsx-runtime-B6kdoens.js +635 -0
- package/lib/jsx-runtime-B6kdoens.js.map +1 -0
- package/lib/{AnchorLink-BZcpTwOs.js → utils-CzT_9Tsn.js} +258 -214
- package/lib/utils-CzT_9Tsn.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 +1229 -1227
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +19 -19
- package/lib/zudoku.plugin-custom-page.js +2 -2
- package/lib/zudoku.plugin-markdown.js +21 -38
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/package.json +4 -1
- package/src/app/demo.tsx +5 -4
- package/src/app/main.css +2 -2
- package/src/app/main.tsx +3 -1
- package/src/app/standalone.tsx +5 -4
- package/src/lib/components/DevPortal.tsx +1 -1
- package/src/lib/components/Header.tsx +2 -2
- package/src/lib/components/Layout.tsx +2 -2
- package/src/lib/components/TopNavigation.tsx +5 -5
- package/src/lib/components/context/DevPortalProvider.ts +11 -28
- package/src/lib/components/context/ThemeContext.tsx +3 -41
- package/src/lib/components/context/ThemeProvider.tsx +27 -0
- package/src/lib/components/navigation/{SideNavigation.tsx → Sidebar.tsx} +7 -7
- package/src/lib/components/navigation/SidebarBadge.tsx +40 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +105 -0
- package/src/lib/components/navigation/SidebarItem.tsx +96 -0
- package/src/lib/components/navigation/{SideNavigationWrapper.tsx → SidebarWrapper.tsx} +1 -1
- package/src/lib/components/navigation/utils.ts +120 -0
- package/src/lib/core/DevPortalContext.ts +12 -44
- package/src/lib/core/plugins.ts +6 -13
- package/src/lib/plugins/markdown/MdxPage.tsx +14 -50
- package/src/lib/plugins/markdown/generateRoutes.tsx +29 -57
- package/src/lib/plugins/openapi/Sidecar.tsx +15 -2
- package/src/lib/plugins/openapi/index.tsx +17 -23
- package/src/lib/plugins/openapi/interfaces.ts +1 -1
- package/src/lib/util/useScrollToAnchor.ts +39 -18
- package/dist/lib/components/navigation/SideNavigation.d.ts +0 -1
- package/dist/lib/components/navigation/SideNavigation.js +0 -12
- package/dist/lib/components/navigation/SideNavigation.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationCategory.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationCategory.js +0 -26
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -9
- package/dist/lib/components/navigation/SideNavigationItem.js +0 -44
- package/dist/lib/components/navigation/SideNavigationItem.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +0 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +0 -9
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +0 -28
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +0 -1
- package/dist/lib/components/navigation/util.d.ts +0 -8
- package/dist/lib/components/navigation/util.js +0 -15
- package/dist/lib/components/navigation/util.js.map +0 -1
- package/dist/lib/plugins/openapi/MethodBadge.d.ts +0 -13
- package/dist/lib/plugins/openapi/MethodBadge.js +0 -26
- package/dist/lib/plugins/openapi/MethodBadge.js.map +0 -1
- package/dist/lib/util/traverseNavigation.d.ts +0 -6
- package/dist/lib/util/traverseNavigation.js +0 -30
- package/dist/lib/util/traverseNavigation.js.map +0 -1
- package/lib/AnchorLink-BZcpTwOs.js.map +0 -1
- package/lib/DevPortalProvider-BWeAysxF.js.map +0 -1
- package/lib/DeveloperHint-DQVwIery.js +0 -10
- package/lib/MdxPage-CA1WmW14.js.map +0 -1
- package/lib/Route-D70pGn9n.js +0 -13
- package/lib/Spinner-Coi7ORUV.js +0 -244
- package/lib/Spinner-Coi7ORUV.js.map +0 -1
- package/lib/index-Bl6YeerK.js.map +0 -1
- package/lib/index-Dt-pU7Vu.js +0 -916
- package/lib/index-Dt-pU7Vu.js.map +0 -1
- package/lib/jsx-runtime-CJBdjYYx.js +0 -1526
- package/lib/jsx-runtime-CJBdjYYx.js.map +0 -1
- package/src/lib/components/navigation/SideNavigationCategory.tsx +0 -72
- package/src/lib/components/navigation/SideNavigationItem.tsx +0 -148
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +0 -42
- package/src/lib/components/navigation/util.ts +0 -38
- package/src/lib/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/lib/util/traverseNavigation.ts +0 -55
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var qt = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var ct = (e, t, s) => t.has(e) ||
|
|
5
|
-
var i = (e, t, s) => (ct(e, t, "read from private field"), s ? s.call(e) : t.get(e)),
|
|
6
|
-
import * as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { j as
|
|
9
|
-
import {
|
|
10
|
-
var
|
|
4
|
+
var ct = (e, t, s) => t.has(e) || qt("Cannot " + s);
|
|
5
|
+
var i = (e, t, s) => (ct(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => t.has(e) ? qt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), h = (e, t, s, r) => (ct(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), v = (e, t, s) => (ct(e, t, "access private method"), s);
|
|
6
|
+
import * as T from "react";
|
|
7
|
+
import { createContext as re, useContext as ie } from "react";
|
|
8
|
+
import { j as ne } from "./jsx-runtime-B6kdoens.js";
|
|
9
|
+
import { u as ae } from "./index-7kcHaXD6.js";
|
|
10
|
+
var Dt = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -24,15 +24,15 @@ var Pt = class {
|
|
|
24
24
|
onUnsubscribe() {
|
|
25
25
|
}
|
|
26
26
|
}, st = typeof window > "u" || "Deno" in globalThis;
|
|
27
|
-
function
|
|
27
|
+
function dt() {
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Le(e, t) {
|
|
30
30
|
return typeof e == "function" ? e(t) : e;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function ft(e) {
|
|
33
33
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Bt(e, t) {
|
|
36
36
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
37
37
|
}
|
|
38
38
|
function ut(e, t) {
|
|
@@ -41,43 +41,43 @@ function ut(e, t) {
|
|
|
41
41
|
function q(e, t) {
|
|
42
42
|
return typeof e == "function" ? e(t) : e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ne(e, t) {
|
|
45
45
|
const {
|
|
46
46
|
type: s = "all",
|
|
47
47
|
exact: r,
|
|
48
48
|
fetchStatus: n,
|
|
49
|
-
predicate:
|
|
49
|
+
predicate: c,
|
|
50
50
|
queryKey: o,
|
|
51
51
|
stale: l
|
|
52
52
|
} = e;
|
|
53
53
|
if (o) {
|
|
54
54
|
if (r) {
|
|
55
|
-
if (t.queryHash !==
|
|
55
|
+
if (t.queryHash !== oe(o, t.options))
|
|
56
56
|
return !1;
|
|
57
|
-
} else if (!
|
|
57
|
+
} else if (!Pt(t.queryKey, o))
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
if (s !== "all") {
|
|
61
|
-
const
|
|
62
|
-
if (s === "active" && !
|
|
61
|
+
const b = t.isActive();
|
|
62
|
+
if (s === "active" && !b || s === "inactive" && b)
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
|
-
return !(typeof l == "boolean" && t.isStale() !== l || n && n !== t.state.fetchStatus ||
|
|
65
|
+
return !(typeof l == "boolean" && t.isStale() !== l || n && n !== t.state.fetchStatus || c && !c(t));
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const { exact: s, status: r, predicate: n, mutationKey:
|
|
69
|
-
if (
|
|
67
|
+
function Ke(e, t) {
|
|
68
|
+
const { exact: s, status: r, predicate: n, mutationKey: c } = e;
|
|
69
|
+
if (c) {
|
|
70
70
|
if (!t.options.mutationKey)
|
|
71
71
|
return !1;
|
|
72
72
|
if (s) {
|
|
73
|
-
if (yt(t.options.mutationKey) !== yt(
|
|
73
|
+
if (yt(t.options.mutationKey) !== yt(c))
|
|
74
74
|
return !1;
|
|
75
|
-
} else if (!
|
|
75
|
+
} else if (!Pt(t.options.mutationKey, c))
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
78
|
return !(r && t.state.status !== r || n && !n(t));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function oe(e, t) {
|
|
81
81
|
return ((t == null ? void 0 : t.queryKeyHashFn) || yt)(e);
|
|
82
82
|
}
|
|
83
83
|
function yt(e) {
|
|
@@ -86,21 +86,21 @@ function yt(e) {
|
|
|
86
86
|
(t, s) => vt(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !
|
|
89
|
+
function Pt(e, t) {
|
|
90
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !Pt(e[s], t[s])) : !1;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Gt(e, t) {
|
|
93
93
|
if (e === t)
|
|
94
94
|
return e;
|
|
95
|
-
const s =
|
|
95
|
+
const s = It(e) && It(t);
|
|
96
96
|
if (s || vt(e) && vt(t)) {
|
|
97
|
-
const r = s ? e : Object.keys(e), n = r.length,
|
|
98
|
-
let
|
|
97
|
+
const r = s ? e : Object.keys(e), n = r.length, c = s ? t : Object.keys(t), o = c.length, l = s ? [] : {};
|
|
98
|
+
let b = 0;
|
|
99
99
|
for (let R = 0; R < o; R++) {
|
|
100
|
-
const
|
|
101
|
-
(!s && r.includes(
|
|
100
|
+
const m = s ? R : c[R];
|
|
101
|
+
(!s && r.includes(m) || s) && e[m] === void 0 && t[m] === void 0 ? (l[m] = void 0, b++) : (l[m] = Gt(e[m], t[m]), l[m] === e[m] && e[m] !== void 0 && b++);
|
|
102
102
|
}
|
|
103
|
-
return n === o &&
|
|
103
|
+
return n === o && b === n ? e : l;
|
|
104
104
|
}
|
|
105
105
|
return t;
|
|
106
106
|
}
|
|
@@ -112,7 +112,7 @@ function pt(e, t) {
|
|
|
112
112
|
return !1;
|
|
113
113
|
return !0;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function It(e) {
|
|
116
116
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
117
117
|
}
|
|
118
118
|
function vt(e) {
|
|
@@ -127,31 +127,31 @@ function vt(e) {
|
|
|
127
127
|
function xt(e) {
|
|
128
128
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function ue(e) {
|
|
131
131
|
return new Promise((t) => {
|
|
132
132
|
setTimeout(t, e);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
function mt(e, t, s) {
|
|
136
|
-
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ?
|
|
136
|
+
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ? Gt(e, t) : t;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function _e(e, t, s = 0) {
|
|
139
139
|
const r = [...e, t];
|
|
140
140
|
return s && r.length > s ? r.slice(1) : r;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Be(e, t, s = 0) {
|
|
143
143
|
const r = [t, ...e];
|
|
144
144
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
145
145
|
}
|
|
146
|
-
var bt = Symbol(),
|
|
146
|
+
var bt = Symbol(), he = (e, t) => (process.env.NODE_ENV !== "production" && e.queryFn === bt && console.error(
|
|
147
147
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
148
|
-
), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === bt ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn), N,
|
|
148
|
+
), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === bt ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn), N, M, z, kt, ce = (kt = class extends Dt {
|
|
149
149
|
constructor() {
|
|
150
150
|
super();
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
f(this, N);
|
|
152
|
+
f(this, M);
|
|
153
|
+
f(this, z);
|
|
154
|
+
h(this, z, (t) => {
|
|
155
155
|
if (!st && window.addEventListener) {
|
|
156
156
|
const s = () => t();
|
|
157
157
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
@@ -161,20 +161,20 @@ var bt = Symbol(), fe = (e, t) => (process.env.NODE_ENV !== "production" && e.qu
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
onSubscribe() {
|
|
164
|
-
i(this,
|
|
164
|
+
i(this, M) || this.setEventListener(i(this, z));
|
|
165
165
|
}
|
|
166
166
|
onUnsubscribe() {
|
|
167
167
|
var t;
|
|
168
|
-
this.hasListeners() || ((t = i(this,
|
|
168
|
+
this.hasListeners() || ((t = i(this, M)) == null || t.call(this), h(this, M, void 0));
|
|
169
169
|
}
|
|
170
170
|
setEventListener(t) {
|
|
171
171
|
var s;
|
|
172
|
-
|
|
172
|
+
h(this, z, t), (s = i(this, M)) == null || s.call(this), h(this, M, t((r) => {
|
|
173
173
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
176
|
setFocused(t) {
|
|
177
|
-
i(this, N) !== t && (
|
|
177
|
+
i(this, N) !== t && (h(this, N, t), this.onFocus());
|
|
178
178
|
}
|
|
179
179
|
onFocus() {
|
|
180
180
|
const t = this.isFocused();
|
|
@@ -186,13 +186,13 @@ var bt = Symbol(), fe = (e, t) => (process.env.NODE_ENV !== "production" && e.qu
|
|
|
186
186
|
var t;
|
|
187
187
|
return typeof i(this, N) == "boolean" ? i(this, N) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
188
188
|
}
|
|
189
|
-
}, N = new WeakMap(),
|
|
189
|
+
}, N = new WeakMap(), M = new WeakMap(), z = new WeakMap(), kt), Ht = new ce(), $, k, W, Lt, le = (Lt = class extends Dt {
|
|
190
190
|
constructor() {
|
|
191
191
|
super();
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
f(this, $, !0);
|
|
193
|
+
f(this, k);
|
|
194
|
+
f(this, W);
|
|
195
|
+
h(this, W, (t) => {
|
|
196
196
|
if (!st && window.addEventListener) {
|
|
197
197
|
const s = () => t(!0), r = () => t(!1);
|
|
198
198
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
@@ -202,128 +202,128 @@ var bt = Symbol(), fe = (e, t) => (process.env.NODE_ENV !== "production" && e.qu
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
onSubscribe() {
|
|
205
|
-
i(this,
|
|
205
|
+
i(this, k) || this.setEventListener(i(this, W));
|
|
206
206
|
}
|
|
207
207
|
onUnsubscribe() {
|
|
208
208
|
var t;
|
|
209
|
-
this.hasListeners() || ((t = i(this,
|
|
209
|
+
this.hasListeners() || ((t = i(this, k)) == null || t.call(this), h(this, k, void 0));
|
|
210
210
|
}
|
|
211
211
|
setEventListener(t) {
|
|
212
212
|
var s;
|
|
213
|
-
|
|
213
|
+
h(this, W, t), (s = i(this, k)) == null || s.call(this), h(this, k, t(this.setOnline.bind(this)));
|
|
214
214
|
}
|
|
215
215
|
setOnline(t) {
|
|
216
|
-
i(this,
|
|
216
|
+
i(this, $) !== t && (h(this, $, t), this.listeners.forEach((r) => {
|
|
217
217
|
r(t);
|
|
218
218
|
}));
|
|
219
219
|
}
|
|
220
220
|
isOnline() {
|
|
221
|
-
return i(this,
|
|
221
|
+
return i(this, $);
|
|
222
222
|
}
|
|
223
|
-
},
|
|
224
|
-
function
|
|
223
|
+
}, $ = new WeakMap(), k = new WeakMap(), W = new WeakMap(), Lt), Vt = new le();
|
|
224
|
+
function de(e) {
|
|
225
225
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
return (e ?? "online") === "online" ?
|
|
227
|
+
function zt(e) {
|
|
228
|
+
return (e ?? "online") === "online" ? Vt.isOnline() : !0;
|
|
229
229
|
}
|
|
230
|
-
var
|
|
230
|
+
var $t = class {
|
|
231
231
|
constructor(e) {
|
|
232
232
|
this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
235
|
function lt(e) {
|
|
236
|
-
return e instanceof
|
|
236
|
+
return e instanceof $t;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
let t = !1, s = 0, r = !1, n,
|
|
240
|
-
const l = new Promise((g,
|
|
241
|
-
|
|
242
|
-
}),
|
|
243
|
-
var
|
|
244
|
-
r || (O(new
|
|
238
|
+
function fe(e) {
|
|
239
|
+
let t = !1, s = 0, r = !1, n, c, o;
|
|
240
|
+
const l = new Promise((g, S) => {
|
|
241
|
+
c = g, o = S;
|
|
242
|
+
}), b = (g) => {
|
|
243
|
+
var S;
|
|
244
|
+
r || (O(new $t(g)), (S = e.abort) == null || S.call(e));
|
|
245
245
|
}, R = () => {
|
|
246
246
|
t = !0;
|
|
247
|
-
},
|
|
247
|
+
}, m = () => {
|
|
248
248
|
t = !1;
|
|
249
|
-
}, a = () =>
|
|
250
|
-
var
|
|
251
|
-
r || (r = !0, (
|
|
249
|
+
}, a = () => Ht.isFocused() && (e.networkMode === "always" || Vt.isOnline()) && e.canRun(), u = () => zt(e.networkMode) && e.canRun(), p = (g) => {
|
|
250
|
+
var S;
|
|
251
|
+
r || (r = !0, (S = e.onSuccess) == null || S.call(e, g), n == null || n(), c(g));
|
|
252
252
|
}, O = (g) => {
|
|
253
|
-
var
|
|
254
|
-
r || (r = !0, (
|
|
255
|
-
},
|
|
256
|
-
var
|
|
257
|
-
n = (
|
|
258
|
-
(r || a()) && g(
|
|
259
|
-
}, (
|
|
253
|
+
var S;
|
|
254
|
+
r || (r = !0, (S = e.onError) == null || S.call(e, g), n == null || n(), o(g));
|
|
255
|
+
}, U = () => new Promise((g) => {
|
|
256
|
+
var S;
|
|
257
|
+
n = (D) => {
|
|
258
|
+
(r || a()) && g(D);
|
|
259
|
+
}, (S = e.onPause) == null || S.call(e);
|
|
260
260
|
}).then(() => {
|
|
261
261
|
var g;
|
|
262
262
|
n = void 0, r || (g = e.onContinue) == null || g.call(e);
|
|
263
|
-
}),
|
|
263
|
+
}), A = () => {
|
|
264
264
|
if (r)
|
|
265
265
|
return;
|
|
266
266
|
let g;
|
|
267
|
-
const
|
|
267
|
+
const S = s === 0 ? e.initialPromise : void 0;
|
|
268
268
|
try {
|
|
269
|
-
g =
|
|
270
|
-
} catch (
|
|
271
|
-
g = Promise.reject(
|
|
269
|
+
g = S ?? e.fn();
|
|
270
|
+
} catch (D) {
|
|
271
|
+
g = Promise.reject(D);
|
|
272
272
|
}
|
|
273
|
-
Promise.resolve(g).then(p).catch((
|
|
273
|
+
Promise.resolve(g).then(p).catch((D) => {
|
|
274
274
|
var w;
|
|
275
275
|
if (r)
|
|
276
276
|
return;
|
|
277
|
-
const
|
|
277
|
+
const j = e.retry ?? (st ? 0 : 3), V = e.retryDelay ?? de, Qt = typeof V == "function" ? V(s, D) : V, ot = j === !0 || typeof j == "number" && s < j || typeof j == "function" && j(s, D);
|
|
278
278
|
if (t || !ot) {
|
|
279
|
-
O(
|
|
279
|
+
O(D);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
s++, (w = e.onFail) == null || w.call(e, s,
|
|
283
|
-
t ? O(
|
|
282
|
+
s++, (w = e.onFail) == null || w.call(e, s, D), ue(Qt).then(() => a() ? void 0 : U()).then(() => {
|
|
283
|
+
t ? O(D) : A();
|
|
284
284
|
});
|
|
285
285
|
});
|
|
286
286
|
};
|
|
287
287
|
return {
|
|
288
288
|
promise: l,
|
|
289
|
-
cancel:
|
|
289
|
+
cancel: b,
|
|
290
290
|
continue: () => (n == null || n(), l),
|
|
291
291
|
cancelRetry: R,
|
|
292
|
-
continueRetry:
|
|
293
|
-
canStart:
|
|
294
|
-
start: () => (
|
|
292
|
+
continueRetry: m,
|
|
293
|
+
canStart: u,
|
|
294
|
+
start: () => (u() ? A() : U().then(A), l)
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
let e = [], t = 0, s = (
|
|
299
|
-
|
|
300
|
-
}, r = (
|
|
301
|
-
|
|
302
|
-
}, n = (
|
|
303
|
-
const
|
|
304
|
-
n =
|
|
305
|
-
}, o = (
|
|
297
|
+
function ye() {
|
|
298
|
+
let e = [], t = 0, s = (u) => {
|
|
299
|
+
u();
|
|
300
|
+
}, r = (u) => {
|
|
301
|
+
u();
|
|
302
|
+
}, n = (u) => setTimeout(u, 0);
|
|
303
|
+
const c = (u) => {
|
|
304
|
+
n = u;
|
|
305
|
+
}, o = (u) => {
|
|
306
306
|
let p;
|
|
307
307
|
t++;
|
|
308
308
|
try {
|
|
309
|
-
p =
|
|
309
|
+
p = u();
|
|
310
310
|
} finally {
|
|
311
311
|
t--, t || R();
|
|
312
312
|
}
|
|
313
313
|
return p;
|
|
314
|
-
}, l = (
|
|
315
|
-
t ? e.push(
|
|
316
|
-
s(
|
|
314
|
+
}, l = (u) => {
|
|
315
|
+
t ? e.push(u) : n(() => {
|
|
316
|
+
s(u);
|
|
317
317
|
});
|
|
318
|
-
},
|
|
318
|
+
}, b = (u) => (...p) => {
|
|
319
319
|
l(() => {
|
|
320
|
-
|
|
320
|
+
u(...p);
|
|
321
321
|
});
|
|
322
322
|
}, R = () => {
|
|
323
|
-
const
|
|
324
|
-
e = [],
|
|
323
|
+
const u = e;
|
|
324
|
+
e = [], u.length && n(() => {
|
|
325
325
|
r(() => {
|
|
326
|
-
|
|
326
|
+
u.forEach((p) => {
|
|
327
327
|
s(p);
|
|
328
328
|
});
|
|
329
329
|
});
|
|
@@ -331,26 +331,26 @@ function me() {
|
|
|
331
331
|
};
|
|
332
332
|
return {
|
|
333
333
|
batch: o,
|
|
334
|
-
batchCalls:
|
|
334
|
+
batchCalls: b,
|
|
335
335
|
schedule: l,
|
|
336
|
-
setNotifyFunction: (
|
|
337
|
-
s =
|
|
336
|
+
setNotifyFunction: (u) => {
|
|
337
|
+
s = u;
|
|
338
338
|
},
|
|
339
|
-
setBatchNotifyFunction: (
|
|
340
|
-
r =
|
|
339
|
+
setBatchNotifyFunction: (u) => {
|
|
340
|
+
r = u;
|
|
341
341
|
},
|
|
342
|
-
setScheduler:
|
|
342
|
+
setScheduler: c
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
-
var
|
|
345
|
+
var Tt = ye(), K, Nt, pe = (Nt = class {
|
|
346
346
|
constructor() {
|
|
347
|
-
|
|
347
|
+
f(this, K);
|
|
348
348
|
}
|
|
349
349
|
destroy() {
|
|
350
350
|
this.clearGcTimeout();
|
|
351
351
|
}
|
|
352
352
|
scheduleGc() {
|
|
353
|
-
this.clearGcTimeout(),
|
|
353
|
+
this.clearGcTimeout(), ft(this.gcTime) && h(this, K, setTimeout(() => {
|
|
354
354
|
this.optionalRemove();
|
|
355
355
|
}, this.gcTime));
|
|
356
356
|
}
|
|
@@ -361,36 +361,36 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
363
|
clearGcTimeout() {
|
|
364
|
-
i(this, K) && (clearTimeout(i(this, K)),
|
|
364
|
+
i(this, K) && (clearTimeout(i(this, K)), h(this, K, void 0));
|
|
365
365
|
}
|
|
366
|
-
}, K = new WeakMap(),
|
|
366
|
+
}, K = new WeakMap(), Nt), J, X, P, C, it, _, Q, x, Kt, Ge = (Kt = class extends pe {
|
|
367
367
|
constructor(t) {
|
|
368
368
|
super();
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
f(this, Q);
|
|
370
|
+
f(this, J);
|
|
371
|
+
f(this, X);
|
|
372
|
+
f(this, P);
|
|
373
|
+
f(this, C);
|
|
374
|
+
f(this, it);
|
|
375
|
+
f(this, _);
|
|
376
|
+
h(this, _, !1), h(this, it, t.defaultOptions), this.setOptions(t.options), this.observers = [], h(this, P, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, h(this, J, t.state || ve(this.options)), this.state = i(this, J), this.scheduleGc();
|
|
377
377
|
}
|
|
378
378
|
get meta() {
|
|
379
379
|
return this.options.meta;
|
|
380
380
|
}
|
|
381
381
|
get promise() {
|
|
382
382
|
var t;
|
|
383
|
-
return (t = i(this,
|
|
383
|
+
return (t = i(this, C)) == null ? void 0 : t.promise;
|
|
384
384
|
}
|
|
385
385
|
setOptions(t) {
|
|
386
386
|
this.options = { ...i(this, it), ...t }, this.updateGcTime(this.options.gcTime);
|
|
387
387
|
}
|
|
388
388
|
optionalRemove() {
|
|
389
|
-
!this.observers.length && this.state.fetchStatus === "idle" && i(this,
|
|
389
|
+
!this.observers.length && this.state.fetchStatus === "idle" && i(this, P).remove(this);
|
|
390
390
|
}
|
|
391
391
|
setData(t, s) {
|
|
392
392
|
const r = mt(this.state.data, t, this.options);
|
|
393
|
-
return v(this, Q,
|
|
393
|
+
return v(this, Q, x).call(this, {
|
|
394
394
|
data: r,
|
|
395
395
|
type: "success",
|
|
396
396
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -398,12 +398,12 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
398
398
|
}), r;
|
|
399
399
|
}
|
|
400
400
|
setState(t, s) {
|
|
401
|
-
v(this, Q,
|
|
401
|
+
v(this, Q, x).call(this, { type: "setState", state: t, setStateOptions: s });
|
|
402
402
|
}
|
|
403
403
|
cancel(t) {
|
|
404
404
|
var r, n;
|
|
405
|
-
const s = (r = i(this,
|
|
406
|
-
return (n = i(this,
|
|
405
|
+
const s = (r = i(this, C)) == null ? void 0 : r.promise;
|
|
406
|
+
return (n = i(this, C)) == null || n.cancel(t), s ? s.then(dt).catch(dt) : Promise.resolve();
|
|
407
407
|
}
|
|
408
408
|
destroy() {
|
|
409
409
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -425,40 +425,40 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
425
425
|
) : this.state.data === void 0;
|
|
426
426
|
}
|
|
427
427
|
isStaleByTime(t = 0) {
|
|
428
|
-
return this.state.isInvalidated || this.state.data === void 0 || !
|
|
428
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Bt(this.state.dataUpdatedAt, t);
|
|
429
429
|
}
|
|
430
430
|
onFocus() {
|
|
431
431
|
var s;
|
|
432
432
|
const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
433
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this,
|
|
433
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
434
434
|
}
|
|
435
435
|
onOnline() {
|
|
436
436
|
var s;
|
|
437
437
|
const t = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
438
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this,
|
|
438
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
|
|
439
439
|
}
|
|
440
440
|
addObserver(t) {
|
|
441
|
-
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), i(this,
|
|
441
|
+
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), i(this, P).notify({ type: "observerAdded", query: this, observer: t }));
|
|
442
442
|
}
|
|
443
443
|
removeObserver(t) {
|
|
444
|
-
this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (i(this,
|
|
444
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (i(this, C) && (i(this, _) ? i(this, C).cancel({ revert: !0 }) : i(this, C).cancelRetry()), this.scheduleGc()), i(this, P).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
445
445
|
}
|
|
446
446
|
getObserversCount() {
|
|
447
447
|
return this.observers.length;
|
|
448
448
|
}
|
|
449
449
|
invalidate() {
|
|
450
|
-
this.state.isInvalidated || v(this, Q,
|
|
450
|
+
this.state.isInvalidated || v(this, Q, x).call(this, { type: "invalidate" });
|
|
451
451
|
}
|
|
452
452
|
fetch(t, s) {
|
|
453
|
-
var
|
|
453
|
+
var b, R, m;
|
|
454
454
|
if (this.state.fetchStatus !== "idle") {
|
|
455
455
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
456
456
|
this.cancel({ silent: !0 });
|
|
457
|
-
else if (i(this,
|
|
458
|
-
return i(this,
|
|
457
|
+
else if (i(this, C))
|
|
458
|
+
return i(this, C).continueRetry(), i(this, C).promise;
|
|
459
459
|
}
|
|
460
460
|
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
461
|
-
const a = this.observers.find((
|
|
461
|
+
const a = this.observers.find((u) => u.options.queryFn);
|
|
462
462
|
a && this.setOptions(a.options);
|
|
463
463
|
}
|
|
464
464
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
@@ -467,58 +467,58 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
467
467
|
const r = new AbortController(), n = (a) => {
|
|
468
468
|
Object.defineProperty(a, "signal", {
|
|
469
469
|
enumerable: !0,
|
|
470
|
-
get: () => (
|
|
470
|
+
get: () => (h(this, _, !0), r.signal)
|
|
471
471
|
});
|
|
472
|
-
},
|
|
473
|
-
const a =
|
|
472
|
+
}, c = () => {
|
|
473
|
+
const a = he(this.options, s), u = {
|
|
474
474
|
queryKey: this.queryKey,
|
|
475
475
|
meta: this.meta
|
|
476
476
|
};
|
|
477
|
-
return n(
|
|
477
|
+
return n(u), h(this, _, !1), this.options.persister ? this.options.persister(
|
|
478
478
|
a,
|
|
479
|
-
|
|
479
|
+
u,
|
|
480
480
|
this
|
|
481
|
-
) : a(
|
|
481
|
+
) : a(u);
|
|
482
482
|
}, o = {
|
|
483
483
|
fetchOptions: s,
|
|
484
484
|
options: this.options,
|
|
485
485
|
queryKey: this.queryKey,
|
|
486
486
|
state: this.state,
|
|
487
|
-
fetchFn:
|
|
487
|
+
fetchFn: c
|
|
488
488
|
};
|
|
489
|
-
n(o), (
|
|
489
|
+
n(o), (b = this.options.behavior) == null || b.onFetch(
|
|
490
490
|
o,
|
|
491
491
|
this
|
|
492
|
-
),
|
|
492
|
+
), h(this, X, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((R = o.fetchOptions) == null ? void 0 : R.meta)) && v(this, Q, x).call(this, { type: "fetch", meta: (m = o.fetchOptions) == null ? void 0 : m.meta });
|
|
493
493
|
const l = (a) => {
|
|
494
|
-
var
|
|
495
|
-
lt(a) && a.silent || v(this, Q,
|
|
494
|
+
var u, p, O, U;
|
|
495
|
+
lt(a) && a.silent || v(this, Q, x).call(this, {
|
|
496
496
|
type: "error",
|
|
497
497
|
error: a
|
|
498
|
-
}), lt(a) || ((p = (
|
|
499
|
-
|
|
498
|
+
}), lt(a) || ((p = (u = i(this, P).config).onError) == null || p.call(
|
|
499
|
+
u,
|
|
500
500
|
a,
|
|
501
501
|
this
|
|
502
|
-
), (
|
|
502
|
+
), (U = (O = i(this, P).config).onSettled) == null || U.call(
|
|
503
503
|
O,
|
|
504
504
|
this.state.data,
|
|
505
505
|
a,
|
|
506
506
|
this
|
|
507
507
|
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
508
508
|
};
|
|
509
|
-
return
|
|
509
|
+
return h(this, C, fe({
|
|
510
510
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
511
511
|
fn: o.fetchFn,
|
|
512
512
|
abort: r.abort.bind(r),
|
|
513
513
|
onSuccess: (a) => {
|
|
514
|
-
var
|
|
514
|
+
var u, p, O, U;
|
|
515
515
|
if (a === void 0) {
|
|
516
516
|
process.env.NODE_ENV !== "production" && console.error(
|
|
517
517
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
518
518
|
), l(new Error(`${this.queryHash} data is undefined`));
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
|
-
this.setData(a), (p = (
|
|
521
|
+
this.setData(a), (p = (u = i(this, P).config).onSuccess) == null || p.call(u, a, this), (U = (O = i(this, P).config).onSettled) == null || U.call(
|
|
522
522
|
O,
|
|
523
523
|
a,
|
|
524
524
|
this.state.error,
|
|
@@ -526,22 +526,22 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
526
526
|
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
527
527
|
},
|
|
528
528
|
onError: l,
|
|
529
|
-
onFail: (a,
|
|
530
|
-
v(this, Q,
|
|
529
|
+
onFail: (a, u) => {
|
|
530
|
+
v(this, Q, x).call(this, { type: "failed", failureCount: a, error: u });
|
|
531
531
|
},
|
|
532
532
|
onPause: () => {
|
|
533
|
-
v(this, Q,
|
|
533
|
+
v(this, Q, x).call(this, { type: "pause" });
|
|
534
534
|
},
|
|
535
535
|
onContinue: () => {
|
|
536
|
-
v(this, Q,
|
|
536
|
+
v(this, Q, x).call(this, { type: "continue" });
|
|
537
537
|
},
|
|
538
538
|
retry: o.options.retry,
|
|
539
539
|
retryDelay: o.options.retryDelay,
|
|
540
540
|
networkMode: o.options.networkMode,
|
|
541
541
|
canRun: () => !0
|
|
542
|
-
})), i(this,
|
|
542
|
+
})), i(this, C).start();
|
|
543
543
|
}
|
|
544
|
-
}, J = new WeakMap(), X = new WeakMap(),
|
|
544
|
+
}, J = new WeakMap(), X = new WeakMap(), P = new WeakMap(), C = new WeakMap(), it = new WeakMap(), _ = new WeakMap(), Q = new WeakSet(), x = function(t) {
|
|
545
545
|
const s = (r) => {
|
|
546
546
|
switch (t.type) {
|
|
547
547
|
case "failed":
|
|
@@ -563,7 +563,7 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
563
563
|
case "fetch":
|
|
564
564
|
return {
|
|
565
565
|
...r,
|
|
566
|
-
...
|
|
566
|
+
...Wt(r.data, this.options),
|
|
567
567
|
fetchMeta: t.meta ?? null
|
|
568
568
|
};
|
|
569
569
|
case "success":
|
|
@@ -605,24 +605,24 @@ var At = me(), K, Kt, be = (Kt = class {
|
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
|
-
this.state = s(this.state),
|
|
608
|
+
this.state = s(this.state), Tt.batch(() => {
|
|
609
609
|
this.observers.forEach((r) => {
|
|
610
610
|
r.onQueryUpdate();
|
|
611
|
-
}), i(this,
|
|
611
|
+
}), i(this, P).notify({ query: this, type: "updated", action: t });
|
|
612
612
|
});
|
|
613
|
-
},
|
|
614
|
-
function
|
|
613
|
+
}, Kt);
|
|
614
|
+
function Wt(e, t) {
|
|
615
615
|
return {
|
|
616
616
|
fetchFailureCount: 0,
|
|
617
617
|
fetchFailureReason: null,
|
|
618
|
-
fetchStatus:
|
|
618
|
+
fetchStatus: zt(t.networkMode) ? "fetching" : "paused",
|
|
619
619
|
...e === void 0 && {
|
|
620
620
|
error: null,
|
|
621
621
|
status: "pending"
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function ve(e) {
|
|
626
626
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
627
627
|
return {
|
|
628
628
|
data: t,
|
|
@@ -639,78 +639,78 @@ function ge(e) {
|
|
|
639
639
|
fetchStatus: "idle"
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
|
-
var E,
|
|
642
|
+
var E, d, nt, F, B, Y, I, at, Z, tt, G, H, L, et, y, rt, gt, Rt, St, Ct, wt, Ft, Ot, Xt, _t, Jt = (_t = class extends Dt {
|
|
643
643
|
constructor(t, s) {
|
|
644
644
|
super();
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
645
|
+
f(this, y);
|
|
646
|
+
f(this, E);
|
|
647
|
+
f(this, d);
|
|
648
|
+
f(this, nt);
|
|
649
|
+
f(this, F);
|
|
650
|
+
f(this, B);
|
|
651
|
+
f(this, Y);
|
|
652
|
+
f(this, I);
|
|
653
|
+
f(this, at);
|
|
654
|
+
f(this, Z);
|
|
655
655
|
// This property keeps track of the last query with defined data.
|
|
656
656
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
this.options = s,
|
|
657
|
+
f(this, tt);
|
|
658
|
+
f(this, G);
|
|
659
|
+
f(this, H);
|
|
660
|
+
f(this, L);
|
|
661
|
+
f(this, et, /* @__PURE__ */ new Set());
|
|
662
|
+
this.options = s, h(this, E, t), h(this, I, null), this.bindMethods(), this.setOptions(s);
|
|
663
663
|
}
|
|
664
664
|
bindMethods() {
|
|
665
665
|
this.refetch = this.refetch.bind(this);
|
|
666
666
|
}
|
|
667
667
|
onSubscribe() {
|
|
668
|
-
this.listeners.size === 1 && (i(this,
|
|
668
|
+
this.listeners.size === 1 && (i(this, d).addObserver(this), jt(i(this, d), this.options) ? v(this, y, rt).call(this) : this.updateResult(), v(this, y, Ct).call(this));
|
|
669
669
|
}
|
|
670
670
|
onUnsubscribe() {
|
|
671
671
|
this.hasListeners() || this.destroy();
|
|
672
672
|
}
|
|
673
673
|
shouldFetchOnReconnect() {
|
|
674
674
|
return Et(
|
|
675
|
-
i(this,
|
|
675
|
+
i(this, d),
|
|
676
676
|
this.options,
|
|
677
677
|
this.options.refetchOnReconnect
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
680
|
shouldFetchOnWindowFocus() {
|
|
681
681
|
return Et(
|
|
682
|
-
i(this,
|
|
682
|
+
i(this, d),
|
|
683
683
|
this.options,
|
|
684
684
|
this.options.refetchOnWindowFocus
|
|
685
685
|
);
|
|
686
686
|
}
|
|
687
687
|
destroy() {
|
|
688
|
-
this.listeners = /* @__PURE__ */ new Set(), v(this, y, wt).call(this), v(this, y, Ft).call(this), i(this,
|
|
688
|
+
this.listeners = /* @__PURE__ */ new Set(), v(this, y, wt).call(this), v(this, y, Ft).call(this), i(this, d).removeObserver(this);
|
|
689
689
|
}
|
|
690
690
|
setOptions(t, s) {
|
|
691
|
-
const r = this.options, n = i(this,
|
|
692
|
-
if (this.options = i(this, E).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof q(this.options.enabled, i(this,
|
|
691
|
+
const r = this.options, n = i(this, d);
|
|
692
|
+
if (this.options = i(this, E).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof q(this.options.enabled, i(this, d)) != "boolean")
|
|
693
693
|
throw new Error(
|
|
694
694
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
695
695
|
);
|
|
696
|
-
v(this, y, Ot).call(this), i(this,
|
|
696
|
+
v(this, y, Ot).call(this), i(this, d).setOptions(this.options), r._defaulted && !pt(this.options, r) && i(this, E).getQueryCache().notify({
|
|
697
697
|
type: "observerOptionsUpdated",
|
|
698
|
-
query: i(this,
|
|
698
|
+
query: i(this, d),
|
|
699
699
|
observer: this
|
|
700
700
|
});
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
i(this,
|
|
701
|
+
const c = this.hasListeners();
|
|
702
|
+
c && Mt(
|
|
703
|
+
i(this, d),
|
|
704
704
|
n,
|
|
705
705
|
this.options,
|
|
706
706
|
r
|
|
707
|
-
) && v(this, y, rt).call(this), this.updateResult(s),
|
|
707
|
+
) && v(this, y, rt).call(this), this.updateResult(s), c && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || ut(this.options.staleTime, i(this, d)) !== ut(r.staleTime, i(this, d))) && v(this, y, gt).call(this);
|
|
708
708
|
const o = v(this, y, Rt).call(this);
|
|
709
|
-
|
|
709
|
+
c && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || o !== i(this, L)) && v(this, y, St).call(this, o);
|
|
710
710
|
}
|
|
711
711
|
getOptimisticResult(t) {
|
|
712
712
|
const s = i(this, E).getQueryCache().build(i(this, E), t), r = this.createResult(s, t);
|
|
713
|
-
return
|
|
713
|
+
return be(this, r) && (h(this, F, r), h(this, Y, this.options), h(this, B, i(this, d).state)), r;
|
|
714
714
|
}
|
|
715
715
|
getCurrentResult() {
|
|
716
716
|
return i(this, F);
|
|
@@ -729,7 +729,7 @@ var E, f, nt, F, B, Y, I, at, Z, tt, G, H, L, et, y, rt, gt, Rt, Ct, St, wt, Ft,
|
|
|
729
729
|
i(this, et).add(t);
|
|
730
730
|
}
|
|
731
731
|
getCurrentQuery() {
|
|
732
|
-
return i(this,
|
|
732
|
+
return i(this, d);
|
|
733
733
|
}
|
|
734
734
|
refetch({ ...t } = {}) {
|
|
735
735
|
return this.fetch({
|
|
@@ -748,183 +748,183 @@ var E, f, nt, F, B, Y, I, at, Z, tt, G, H, L, et, y, rt, gt, Rt, Ct, St, wt, Ft,
|
|
|
748
748
|
}
|
|
749
749
|
createResult(t, s) {
|
|
750
750
|
var ot;
|
|
751
|
-
const r = i(this,
|
|
752
|
-
let a = { ...
|
|
751
|
+
const r = i(this, d), n = this.options, c = i(this, F), o = i(this, B), l = i(this, Y), R = t !== r ? t.state : i(this, nt), { state: m } = t;
|
|
752
|
+
let a = { ...m }, u = !1, p;
|
|
753
753
|
if (s._optimisticResults) {
|
|
754
|
-
const w = this.hasListeners(), ht = !w &&
|
|
755
|
-
(ht ||
|
|
754
|
+
const w = this.hasListeners(), ht = !w && jt(t, s), se = w && Mt(t, r, s, n);
|
|
755
|
+
(ht || se) && (a = {
|
|
756
756
|
...a,
|
|
757
|
-
...
|
|
757
|
+
...Wt(m.data, t.options)
|
|
758
758
|
}), s._optimisticResults === "isRestoring" && (a.fetchStatus = "idle");
|
|
759
759
|
}
|
|
760
|
-
let { error: O, errorUpdatedAt:
|
|
760
|
+
let { error: O, errorUpdatedAt: U, status: A } = a;
|
|
761
761
|
if (s.select && a.data !== void 0)
|
|
762
|
-
if (
|
|
762
|
+
if (c && a.data === (o == null ? void 0 : o.data) && s.select === i(this, at))
|
|
763
763
|
p = i(this, Z);
|
|
764
764
|
else
|
|
765
765
|
try {
|
|
766
|
-
|
|
766
|
+
h(this, at, s.select), p = s.select(a.data), p = mt(c == null ? void 0 : c.data, p, s), h(this, Z, p), h(this, I, null);
|
|
767
767
|
} catch (w) {
|
|
768
|
-
|
|
768
|
+
h(this, I, w);
|
|
769
769
|
}
|
|
770
770
|
else
|
|
771
771
|
p = a.data;
|
|
772
|
-
if (s.placeholderData !== void 0 && p === void 0 &&
|
|
772
|
+
if (s.placeholderData !== void 0 && p === void 0 && A === "pending") {
|
|
773
773
|
let w;
|
|
774
|
-
if (
|
|
775
|
-
w =
|
|
774
|
+
if (c != null && c.isPlaceholderData && s.placeholderData === (l == null ? void 0 : l.placeholderData))
|
|
775
|
+
w = c.data;
|
|
776
776
|
else if (w = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
777
777
|
(ot = i(this, tt)) == null ? void 0 : ot.state.data,
|
|
778
778
|
i(this, tt)
|
|
779
779
|
) : s.placeholderData, s.select && w !== void 0)
|
|
780
780
|
try {
|
|
781
|
-
w = s.select(w),
|
|
781
|
+
w = s.select(w), h(this, I, null);
|
|
782
782
|
} catch (ht) {
|
|
783
|
-
|
|
783
|
+
h(this, I, ht);
|
|
784
784
|
}
|
|
785
|
-
w !== void 0 && (
|
|
786
|
-
|
|
785
|
+
w !== void 0 && (A = "success", p = mt(
|
|
786
|
+
c == null ? void 0 : c.data,
|
|
787
787
|
w,
|
|
788
788
|
s
|
|
789
|
-
),
|
|
789
|
+
), u = !0);
|
|
790
790
|
}
|
|
791
|
-
i(this, I) && (O = i(this, I), p = i(this, Z),
|
|
792
|
-
const g = a.fetchStatus === "fetching",
|
|
791
|
+
i(this, I) && (O = i(this, I), p = i(this, Z), U = Date.now(), A = "error");
|
|
792
|
+
const g = a.fetchStatus === "fetching", S = A === "pending", D = A === "error", j = S && g, V = p !== void 0;
|
|
793
793
|
return {
|
|
794
|
-
status:
|
|
794
|
+
status: A,
|
|
795
795
|
fetchStatus: a.fetchStatus,
|
|
796
|
-
isPending:
|
|
797
|
-
isSuccess:
|
|
798
|
-
isError:
|
|
799
|
-
isInitialLoading:
|
|
800
|
-
isLoading:
|
|
796
|
+
isPending: S,
|
|
797
|
+
isSuccess: A === "success",
|
|
798
|
+
isError: D,
|
|
799
|
+
isInitialLoading: j,
|
|
800
|
+
isLoading: j,
|
|
801
801
|
data: p,
|
|
802
802
|
dataUpdatedAt: a.dataUpdatedAt,
|
|
803
803
|
error: O,
|
|
804
|
-
errorUpdatedAt:
|
|
804
|
+
errorUpdatedAt: U,
|
|
805
805
|
failureCount: a.fetchFailureCount,
|
|
806
806
|
failureReason: a.fetchFailureReason,
|
|
807
807
|
errorUpdateCount: a.errorUpdateCount,
|
|
808
808
|
isFetched: a.dataUpdateCount > 0 || a.errorUpdateCount > 0,
|
|
809
809
|
isFetchedAfterMount: a.dataUpdateCount > R.dataUpdateCount || a.errorUpdateCount > R.errorUpdateCount,
|
|
810
810
|
isFetching: g,
|
|
811
|
-
isRefetching: g && !
|
|
812
|
-
isLoadingError:
|
|
811
|
+
isRefetching: g && !S,
|
|
812
|
+
isLoadingError: D && !V,
|
|
813
813
|
isPaused: a.fetchStatus === "paused",
|
|
814
|
-
isPlaceholderData:
|
|
815
|
-
isRefetchError:
|
|
816
|
-
isStale:
|
|
814
|
+
isPlaceholderData: u,
|
|
815
|
+
isRefetchError: D && V,
|
|
816
|
+
isStale: Ut(t, s),
|
|
817
817
|
refetch: this.refetch
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
820
|
updateResult(t) {
|
|
821
|
-
const s = i(this, F), r = this.createResult(i(this,
|
|
822
|
-
if (
|
|
821
|
+
const s = i(this, F), r = this.createResult(i(this, d), this.options);
|
|
822
|
+
if (h(this, B, i(this, d).state), h(this, Y, this.options), i(this, B).data !== void 0 && h(this, tt, i(this, d)), pt(r, s))
|
|
823
823
|
return;
|
|
824
|
-
|
|
825
|
-
const n = {},
|
|
824
|
+
h(this, F, r);
|
|
825
|
+
const n = {}, c = () => {
|
|
826
826
|
if (!s)
|
|
827
827
|
return !0;
|
|
828
828
|
const { notifyOnChangeProps: o } = this.options, l = typeof o == "function" ? o() : o;
|
|
829
829
|
if (l === "all" || !l && !i(this, et).size)
|
|
830
830
|
return !0;
|
|
831
|
-
const
|
|
831
|
+
const b = new Set(
|
|
832
832
|
l ?? i(this, et)
|
|
833
833
|
);
|
|
834
|
-
return this.options.throwOnError &&
|
|
835
|
-
const
|
|
836
|
-
return i(this, F)[
|
|
834
|
+
return this.options.throwOnError && b.add("error"), Object.keys(i(this, F)).some((R) => {
|
|
835
|
+
const m = R;
|
|
836
|
+
return i(this, F)[m] !== s[m] && b.has(m);
|
|
837
837
|
});
|
|
838
838
|
};
|
|
839
|
-
(t == null ? void 0 : t.listeners) !== !1 &&
|
|
839
|
+
(t == null ? void 0 : t.listeners) !== !1 && c() && (n.listeners = !0), v(this, y, Xt).call(this, { ...n, ...t });
|
|
840
840
|
}
|
|
841
841
|
onQueryUpdate() {
|
|
842
|
-
this.updateResult(), this.hasListeners() && v(this, y,
|
|
842
|
+
this.updateResult(), this.hasListeners() && v(this, y, Ct).call(this);
|
|
843
843
|
}
|
|
844
|
-
}, E = new WeakMap(),
|
|
844
|
+
}, E = new WeakMap(), d = new WeakMap(), nt = new WeakMap(), F = new WeakMap(), B = new WeakMap(), Y = new WeakMap(), I = new WeakMap(), at = new WeakMap(), Z = new WeakMap(), tt = new WeakMap(), G = new WeakMap(), H = new WeakMap(), L = new WeakMap(), et = new WeakMap(), y = new WeakSet(), rt = function(t) {
|
|
845
845
|
v(this, y, Ot).call(this);
|
|
846
|
-
let s = i(this,
|
|
846
|
+
let s = i(this, d).fetch(
|
|
847
847
|
this.options,
|
|
848
848
|
t
|
|
849
849
|
);
|
|
850
|
-
return t != null && t.throwOnError || (s = s.catch(
|
|
850
|
+
return t != null && t.throwOnError || (s = s.catch(dt)), s;
|
|
851
851
|
}, gt = function() {
|
|
852
852
|
v(this, y, wt).call(this);
|
|
853
853
|
const t = ut(
|
|
854
854
|
this.options.staleTime,
|
|
855
|
-
i(this,
|
|
855
|
+
i(this, d)
|
|
856
856
|
);
|
|
857
|
-
if (st || i(this, F).isStale || !
|
|
857
|
+
if (st || i(this, F).isStale || !ft(t))
|
|
858
858
|
return;
|
|
859
|
-
const r =
|
|
860
|
-
|
|
859
|
+
const r = Bt(i(this, F).dataUpdatedAt, t) + 1;
|
|
860
|
+
h(this, G, setTimeout(() => {
|
|
861
861
|
i(this, F).isStale || this.updateResult();
|
|
862
862
|
}, r));
|
|
863
863
|
}, Rt = function() {
|
|
864
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this,
|
|
865
|
-
},
|
|
866
|
-
v(this, y, Ft).call(this),
|
|
867
|
-
(this.options.refetchIntervalInBackground ||
|
|
864
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
|
|
865
|
+
}, St = function(t) {
|
|
866
|
+
v(this, y, Ft).call(this), h(this, L, t), !(st || q(this.options.enabled, i(this, d)) === !1 || !ft(i(this, L)) || i(this, L) === 0) && h(this, H, setInterval(() => {
|
|
867
|
+
(this.options.refetchIntervalInBackground || Ht.isFocused()) && v(this, y, rt).call(this);
|
|
868
868
|
}, i(this, L)));
|
|
869
|
-
},
|
|
870
|
-
v(this, y, gt).call(this), v(this, y,
|
|
869
|
+
}, Ct = function() {
|
|
870
|
+
v(this, y, gt).call(this), v(this, y, St).call(this, v(this, y, Rt).call(this));
|
|
871
871
|
}, wt = function() {
|
|
872
|
-
i(this, G) && (clearTimeout(i(this, G)),
|
|
872
|
+
i(this, G) && (clearTimeout(i(this, G)), h(this, G, void 0));
|
|
873
873
|
}, Ft = function() {
|
|
874
|
-
i(this, H) && (clearInterval(i(this, H)),
|
|
874
|
+
i(this, H) && (clearInterval(i(this, H)), h(this, H, void 0));
|
|
875
875
|
}, Ot = function() {
|
|
876
876
|
const t = i(this, E).getQueryCache().build(i(this, E), this.options);
|
|
877
|
-
if (t === i(this,
|
|
877
|
+
if (t === i(this, d))
|
|
878
878
|
return;
|
|
879
|
-
const s = i(this,
|
|
880
|
-
|
|
881
|
-
},
|
|
882
|
-
|
|
879
|
+
const s = i(this, d);
|
|
880
|
+
h(this, d, t), h(this, nt, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
|
|
881
|
+
}, Xt = function(t) {
|
|
882
|
+
Tt.batch(() => {
|
|
883
883
|
t.listeners && this.listeners.forEach((s) => {
|
|
884
884
|
s(i(this, F));
|
|
885
885
|
}), i(this, E).getQueryCache().notify({
|
|
886
|
-
query: i(this,
|
|
886
|
+
query: i(this, d),
|
|
887
887
|
type: "observerResultsUpdated"
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
|
-
},
|
|
891
|
-
function
|
|
890
|
+
}, _t);
|
|
891
|
+
function me(e, t) {
|
|
892
892
|
return q(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
894
|
+
function jt(e, t) {
|
|
895
|
+
return me(e, t) || e.state.data !== void 0 && Et(e, t, t.refetchOnMount);
|
|
896
896
|
}
|
|
897
897
|
function Et(e, t, s) {
|
|
898
898
|
if (q(t.enabled, e) !== !1) {
|
|
899
899
|
const r = typeof s == "function" ? s(e) : s;
|
|
900
|
-
return r === "always" || r !== !1 &&
|
|
900
|
+
return r === "always" || r !== !1 && Ut(e, t);
|
|
901
901
|
}
|
|
902
902
|
return !1;
|
|
903
903
|
}
|
|
904
904
|
function Mt(e, t, s, r) {
|
|
905
|
-
return (e !== t || q(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") &&
|
|
905
|
+
return (e !== t || q(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && Ut(e, s);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Ut(e, t) {
|
|
908
908
|
return q(t.enabled, e) !== !1 && e.isStaleByTime(ut(t.staleTime, e));
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function be(e, t) {
|
|
911
911
|
return !pt(e.getCurrentResult(), t);
|
|
912
912
|
}
|
|
913
|
-
var
|
|
913
|
+
var Yt = T.createContext(
|
|
914
914
|
void 0
|
|
915
|
-
),
|
|
916
|
-
const t =
|
|
915
|
+
), ge = (e) => {
|
|
916
|
+
const t = T.useContext(Yt);
|
|
917
917
|
if (!t)
|
|
918
918
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
919
919
|
return t;
|
|
920
|
-
},
|
|
920
|
+
}, He = ({
|
|
921
921
|
client: e,
|
|
922
922
|
children: t
|
|
923
|
-
}) => (
|
|
923
|
+
}) => (T.useEffect(() => (e.mount(), () => {
|
|
924
924
|
e.unmount();
|
|
925
|
-
}), [e]), /* @__PURE__ */
|
|
926
|
-
|
|
927
|
-
function
|
|
925
|
+
}), [e]), /* @__PURE__ */ ne.jsx(Yt.Provider, { value: e, children: t })), Zt = T.createContext(!1), Re = () => T.useContext(Zt);
|
|
926
|
+
Zt.Provider;
|
|
927
|
+
function Se() {
|
|
928
928
|
let e = !1;
|
|
929
929
|
return {
|
|
930
930
|
clearReset: () => {
|
|
@@ -936,191 +936,149 @@ function Fe() {
|
|
|
936
936
|
isReset: () => e
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
|
-
var
|
|
940
|
-
function
|
|
939
|
+
var Ce = T.createContext(Se()), we = () => T.useContext(Ce);
|
|
940
|
+
function Fe(e, t) {
|
|
941
941
|
return typeof e == "function" ? e(...t) : !!e;
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Ve() {
|
|
944
944
|
}
|
|
945
|
-
var
|
|
945
|
+
var Oe = (e, t) => {
|
|
946
946
|
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
947
|
-
},
|
|
948
|
-
|
|
947
|
+
}, Ee = (e) => {
|
|
948
|
+
T.useEffect(() => {
|
|
949
949
|
e.clearReset();
|
|
950
950
|
}, [e]);
|
|
951
|
-
},
|
|
951
|
+
}, De = ({
|
|
952
952
|
result: e,
|
|
953
953
|
errorResetBoundary: t,
|
|
954
954
|
throwOnError: s,
|
|
955
955
|
query: r
|
|
956
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r &&
|
|
956
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && Fe(s, [e.error, r]), Pe = (e, t) => t.state.data === void 0, Te = (e) => {
|
|
957
957
|
e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
|
|
958
|
-
},
|
|
958
|
+
}, Ue = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Ae = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
959
959
|
s.clearReset();
|
|
960
960
|
});
|
|
961
|
-
function
|
|
962
|
-
var R,
|
|
961
|
+
function te(e, t, s) {
|
|
962
|
+
var R, m, a, u;
|
|
963
963
|
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
964
964
|
throw new Error(
|
|
965
965
|
'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'
|
|
966
966
|
);
|
|
967
|
-
const r =
|
|
968
|
-
(
|
|
967
|
+
const r = ge(), n = Re(), c = we(), o = r.defaultQueryOptions(e);
|
|
968
|
+
(m = (R = r.getDefaultOptions().queries) == null ? void 0 : R._experimental_beforeQuery) == null || m.call(
|
|
969
969
|
R,
|
|
970
970
|
o
|
|
971
|
-
), o._optimisticResults = n ? "isRestoring" : "optimistic",
|
|
972
|
-
const [l] =
|
|
971
|
+
), o._optimisticResults = n ? "isRestoring" : "optimistic", Te(o), Oe(o, c), Ee(c);
|
|
972
|
+
const [l] = T.useState(
|
|
973
973
|
() => new t(
|
|
974
974
|
r,
|
|
975
975
|
o
|
|
976
976
|
)
|
|
977
|
-
),
|
|
978
|
-
if (
|
|
979
|
-
|
|
977
|
+
), b = l.getOptimisticResult(o);
|
|
978
|
+
if (T.useSyncExternalStore(
|
|
979
|
+
T.useCallback(
|
|
980
980
|
(p) => {
|
|
981
981
|
const O = n ? () => {
|
|
982
|
-
} : l.subscribe(
|
|
982
|
+
} : l.subscribe(Tt.batchCalls(p));
|
|
983
983
|
return l.updateResult(), O;
|
|
984
984
|
},
|
|
985
985
|
[l, n]
|
|
986
986
|
),
|
|
987
987
|
() => l.getCurrentResult(),
|
|
988
988
|
() => l.getCurrentResult()
|
|
989
|
-
),
|
|
989
|
+
), T.useEffect(() => {
|
|
990
990
|
l.setOptions(o, { listeners: !1 });
|
|
991
|
-
}, [o, l]),
|
|
992
|
-
throw
|
|
993
|
-
if (
|
|
994
|
-
result:
|
|
995
|
-
errorResetBoundary:
|
|
991
|
+
}, [o, l]), Ue(o, b))
|
|
992
|
+
throw Ae(o, l, c);
|
|
993
|
+
if (De({
|
|
994
|
+
result: b,
|
|
995
|
+
errorResetBoundary: c,
|
|
996
996
|
throwOnError: o.throwOnError,
|
|
997
997
|
query: r.getQueryCache().get(o.queryHash)
|
|
998
998
|
}))
|
|
999
|
-
throw
|
|
1000
|
-
return (
|
|
999
|
+
throw b.error;
|
|
1000
|
+
return (u = (a = r.getDefaultOptions().queries) == null ? void 0 : a._experimental_afterQuery) == null || u.call(
|
|
1001
1001
|
a,
|
|
1002
1002
|
o,
|
|
1003
|
-
|
|
1004
|
-
), o.notifyOnChangeProps ?
|
|
1003
|
+
b
|
|
1004
|
+
), o.notifyOnChangeProps ? b : l.trackResult(b);
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1006
|
+
function Qe(e, t) {
|
|
1007
|
+
return te(e, Jt);
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return process.env.NODE_ENV !== "production" && e.queryFn === bt && console.error("skipToken is not allowed for useSuspenseQuery"),
|
|
1009
|
+
function qe(e, t) {
|
|
1010
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === bt && console.error("skipToken is not allowed for useSuspenseQuery"), te(
|
|
1011
1011
|
{
|
|
1012
1012
|
...e,
|
|
1013
1013
|
enabled: !0,
|
|
1014
1014
|
suspense: !0,
|
|
1015
|
-
throwOnError:
|
|
1015
|
+
throwOnError: Pe,
|
|
1016
1016
|
placeholderData: void 0
|
|
1017
1017
|
},
|
|
1018
|
-
|
|
1018
|
+
Jt
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
|
-
const
|
|
1022
|
-
e,
|
|
1023
|
-
(r, n) => {
|
|
1024
|
-
if (re(r) && Gt(n, t))
|
|
1025
|
-
return !0;
|
|
1026
|
-
},
|
|
1027
|
-
s
|
|
1028
|
-
), ke = (...e) => {
|
|
1029
|
-
const t = e.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1030
|
-
return t ? `/${t}` : "";
|
|
1031
|
-
}, Ut = (e, t, s, r = []) => {
|
|
1032
|
-
const n = re(e) ? ke(s, e.path) : s, u = t(e, n, r);
|
|
1033
|
-
if (u !== void 0) return u;
|
|
1034
|
-
if ("children" in e && e.children) {
|
|
1035
|
-
const o = [...r, e];
|
|
1036
|
-
for (const l of e.children) {
|
|
1037
|
-
const m = Ut(
|
|
1038
|
-
l,
|
|
1039
|
-
t,
|
|
1040
|
-
n,
|
|
1041
|
-
o
|
|
1042
|
-
);
|
|
1043
|
-
if (m !== void 0) return m;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
}, Me = (e, t) => {
|
|
1047
|
-
if (e.categories)
|
|
1048
|
-
for (const s of e.categories) {
|
|
1049
|
-
const r = Ut(s, t, e.path);
|
|
1050
|
-
if (r !== void 0) return r;
|
|
1051
|
-
}
|
|
1052
|
-
}, ie = ae(
|
|
1021
|
+
const ee = re(
|
|
1053
1022
|
void 0
|
|
1054
|
-
),
|
|
1055
|
-
const e =
|
|
1023
|
+
), ze = ee.Provider, At = () => {
|
|
1024
|
+
const e = ie(ee);
|
|
1056
1025
|
if (!e)
|
|
1057
1026
|
throw new Error("useDevPortal must be used within a DevPortalProvider.");
|
|
1058
1027
|
return e;
|
|
1059
|
-
},
|
|
1060
|
-
const { getApiIdentities: e } =
|
|
1061
|
-
return
|
|
1028
|
+
}, $e = () => {
|
|
1029
|
+
const { getApiIdentities: e } = At();
|
|
1030
|
+
return Qe({
|
|
1062
1031
|
queryFn: e,
|
|
1063
1032
|
queryKey: ["api-identities"]
|
|
1064
1033
|
});
|
|
1065
|
-
},
|
|
1066
|
-
const {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
},
|
|
1079
|
-
|
|
1080
|
-
return xe({
|
|
1081
|
-
queryFn: async () => ({
|
|
1082
|
-
items: [...(t == null ? void 0 : t.categories) ?? [], ...await e(s)],
|
|
1083
|
-
currentTopNavItem: t
|
|
1084
|
-
}),
|
|
1085
|
-
queryKey: ["navigation", s]
|
|
1034
|
+
}, Ie = () => {
|
|
1035
|
+
const { topNavigation: e } = At(), s = ae().pathname.split("/").at(1);
|
|
1036
|
+
if (s)
|
|
1037
|
+
return e.find((r) => r.id === s);
|
|
1038
|
+
}, We = () => {
|
|
1039
|
+
const { getPluginNavigation: e, sidebars: t } = At(), s = Ie(), r = s == null ? void 0 : s.id, n = r ? t[r] ?? [] : [];
|
|
1040
|
+
return qe({
|
|
1041
|
+
queryFn: async () => {
|
|
1042
|
+
const c = r ? await e(r) : [];
|
|
1043
|
+
return {
|
|
1044
|
+
items: [...n, ...c],
|
|
1045
|
+
currentTopNavItem: s
|
|
1046
|
+
};
|
|
1047
|
+
},
|
|
1048
|
+
queryKey: ["navigation", r]
|
|
1086
1049
|
});
|
|
1087
1050
|
};
|
|
1088
1051
|
export {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
$e as d,
|
|
1103
|
-
fe as e,
|
|
1104
|
-
$t as f,
|
|
1105
|
-
Ge as g,
|
|
1106
|
-
ce as h,
|
|
1052
|
+
fe as A,
|
|
1053
|
+
ze as D,
|
|
1054
|
+
Ge as Q,
|
|
1055
|
+
pe as R,
|
|
1056
|
+
Dt as S,
|
|
1057
|
+
Ke as a,
|
|
1058
|
+
dt as b,
|
|
1059
|
+
Be as c,
|
|
1060
|
+
_e as d,
|
|
1061
|
+
he as e,
|
|
1062
|
+
Ht as f,
|
|
1063
|
+
Le as g,
|
|
1064
|
+
oe as h,
|
|
1107
1065
|
yt as i,
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1066
|
+
He as j,
|
|
1067
|
+
Ie as k,
|
|
1068
|
+
We as l,
|
|
1069
|
+
Ne as m,
|
|
1070
|
+
Tt as n,
|
|
1071
|
+
Vt as o,
|
|
1072
|
+
Pt as p,
|
|
1073
|
+
ge as q,
|
|
1116
1074
|
ut as r,
|
|
1117
1075
|
bt as s,
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1076
|
+
qe as t,
|
|
1077
|
+
At as u,
|
|
1078
|
+
$e as v,
|
|
1079
|
+
Qe as w,
|
|
1080
|
+
pt as x,
|
|
1081
|
+
Ve as y,
|
|
1082
|
+
Fe as z
|
|
1125
1083
|
};
|
|
1126
|
-
//# sourceMappingURL=DevPortalProvider-
|
|
1084
|
+
//# sourceMappingURL=DevPortalProvider-CTxoCHIT.js.map
|