zudoku 0.0.0-e4d0ea8 → 0.0.0-e53033e

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