@pdf-viewer/react 1.4.2 → 1.4.3

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 (64) hide show
  1. package/dist/Popover-b7402893.js +1445 -0
  2. package/dist/{RPDefaultLayout-e27ef121.js → RPDefaultLayout-f9017f0e.js} +606 -601
  3. package/dist/component-1da194e8.js +337 -0
  4. package/dist/components/RPConfig.js +270 -259
  5. package/dist/components/RPController.js +1 -1
  6. package/dist/components/RPPages.js +2 -2
  7. package/dist/components/RPProvider.js +12 -11
  8. package/dist/components/layout/LayoutContainer.js +3 -2
  9. package/dist/components/layout/RPDefaultLayout.js +1 -1
  10. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  11. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  12. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  13. package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
  14. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  15. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  16. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  17. package/dist/components/layout/toolbar/MostPageTool.js +4 -3
  18. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  19. package/dist/components/layout/toolbar/Paginate.js +1 -1
  20. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  22. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  23. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  24. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/SearchTool.js +4 -3
  26. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  28. package/dist/components/layout/toolbar/ZoomTool.js +4 -3
  29. package/dist/components/page/AnnotationLayer.js +3 -2
  30. package/dist/components/page/CanvasLayer.js +3 -2
  31. package/dist/components/page/DualPage.js +1 -1
  32. package/dist/components/page/RPPage.js +3 -2
  33. package/dist/components/page/SinglePage.js +1 -1
  34. package/dist/components/page/TextHighlightLayer.js +3 -2
  35. package/dist/components/page/TextLayer.js +3 -2
  36. package/dist/components/ui/Checkbox.js +111 -94
  37. package/dist/components/ui/DropDown.js +1 -1
  38. package/dist/components/ui/LoadingIndicator.js +1 -1
  39. package/dist/components/ui/Popover.js +1 -1
  40. package/dist/components/ui/RPTooltip.js +206 -205
  41. package/dist/contexts/PaginationContext.js +1 -1
  42. package/dist/contexts/PrintContext.js +1 -1
  43. package/dist/contexts/SearchContext.js +1 -1
  44. package/dist/contexts/ThumbnailsContext.js +1 -1
  45. package/dist/floating-ui.react-dom-15b9b819.js +1310 -0
  46. package/dist/index-0f08882b.js +1561 -0
  47. package/dist/index-10ac1200.js +150 -0
  48. package/dist/index-271658fe.js +331 -0
  49. package/dist/main.js +1 -1
  50. package/dist/types/utils/hooks/useWatermark.d.ts +1 -1
  51. package/dist/utils/hooks/useFileDownload.js +3 -2
  52. package/dist/utils/hooks/useLicense.js +1 -1
  53. package/dist/utils/hooks/usePaginate.js +3 -2
  54. package/dist/utils/hooks/usePrint.js +3 -2
  55. package/dist/utils/hooks/useScrollToPage.js +3 -2
  56. package/dist/utils/hooks/useSearch.js +3 -2
  57. package/dist/utils/hooks/useThumbnail.js +3 -2
  58. package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
  59. package/dist/utils/hooks/useWatermark.js +59 -28
  60. package/package.json +2 -2
  61. package/dist/Popover-d11ec15c.js +0 -3061
  62. package/dist/floating-ui.react-dom-88a86594.js +0 -1447
  63. package/dist/index-48ca3f30.js +0 -307
  64. package/dist/index-4ba3ab9a.js +0 -1877
@@ -1,27 +1,27 @@
1
- var we = (t, e, s) => {
1
+ var Pe = (t, e, s) => {
2
2
  if (!e.has(t))
3
3
  throw TypeError("Cannot " + s);
4
4
  };
5
- var i = (t, e, s) => (we(t, e, "read from private field"), s ? s.call(t) : e.get(t)), l = (t, e, s) => {
5
+ var i = (t, e, s) => (Pe(t, e, "read from private field"), s ? s.call(t) : e.get(t)), l = (t, e, s) => {
6
6
  if (e.has(t))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  e instanceof WeakSet ? e.add(t) : e.set(t, s);
9
- }, o = (t, e, s, r) => (we(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
10
- var ye = (t, e, s, r) => ({
9
+ }, o = (t, e, s, r) => (Pe(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
10
+ var pe = (t, e, s, r) => ({
11
11
  set _(n) {
12
12
  o(t, e, n, s);
13
13
  },
14
14
  get _() {
15
15
  return i(t, e, r);
16
16
  }
17
- }), P = (t, e, s) => (we(t, e, "access private method"), s);
17
+ }), P = (t, e, s) => (Pe(t, e, "access private method"), s);
18
18
  import { jsx as oe } from "react/jsx-runtime";
19
- import { RPTheme as ze } from "./RPTheme.js";
20
- import { ConfigContextProvider as Be } from "../contexts/ConfigContext.js";
21
- import { useLoadWorker as Je } from "../utils/hooks/useLoadWorker.js";
22
- import * as He from "react";
23
- import { LicenseProvider as We } from "../contexts/LicenseContext.js";
24
- var ge = class {
19
+ import { RPTheme as Be } from "./RPTheme.js";
20
+ import { ConfigContextProvider as Je } from "../contexts/ConfigContext.js";
21
+ import { useLoadWorker as We } from "../utils/hooks/useLoadWorker.js";
22
+ import * as Le from "react";
23
+ import { LicenseProvider as Xe } from "../contexts/LicenseContext.js";
24
+ var be = class {
25
25
  constructor() {
26
26
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
27
27
  }
@@ -37,36 +37,36 @@ var ge = class {
37
37
  }
38
38
  onUnsubscribe() {
39
39
  }
40
- }, be = typeof window > "u" || "Deno" in globalThis;
40
+ }, we = typeof window > "u" || "Deno" in globalThis;
41
41
  function Q() {
42
42
  }
43
- function Xe(t, e) {
43
+ function Ye(t, e) {
44
44
  return typeof t == "function" ? t(e) : t;
45
45
  }
46
- function Ye(t) {
46
+ function Ze(t) {
47
47
  return typeof t == "number" && t >= 0 && t !== 1 / 0;
48
48
  }
49
- function Ze(t, e) {
49
+ function et(t, e) {
50
50
  return Math.max(t + (e || 0) - Date.now(), 0);
51
51
  }
52
- function Ce(t, e) {
52
+ function qe(t, e) {
53
53
  return typeof t == "function" ? t(e) : t;
54
54
  }
55
- function et(t, e) {
55
+ function tt(t, e) {
56
56
  return typeof t == "function" ? t(e) : t;
57
57
  }
58
- function qe(t, e) {
58
+ function Ee(t, e) {
59
59
  const {
60
60
  type: s = "all",
61
61
  exact: r,
62
62
  fetchStatus: n,
63
- predicate: u,
63
+ predicate: a,
64
64
  queryKey: h,
65
- stale: a
65
+ stale: u
66
66
  } = t;
67
67
  if (h) {
68
68
  if (r) {
69
- if (e.queryHash !== Fe(h, e.options))
69
+ if (e.queryHash !== Ce(h, e.options))
70
70
  return !1;
71
71
  } else if (!ce(e.queryKey, h))
72
72
  return !1;
@@ -76,106 +76,106 @@ function qe(t, e) {
76
76
  if (s === "active" && !f || s === "inactive" && f)
77
77
  return !1;
78
78
  }
79
- return !(typeof a == "boolean" && e.isStale() !== a || n && n !== e.state.fetchStatus || u && !u(e));
79
+ return !(typeof u == "boolean" && e.isStale() !== u || n && n !== e.state.fetchStatus || a && !a(e));
80
80
  }
81
- function Ee(t, e) {
82
- const { exact: s, status: r, predicate: n, mutationKey: u } = t;
83
- if (u) {
81
+ function De(t, e) {
82
+ const { exact: s, status: r, predicate: n, mutationKey: a } = t;
83
+ if (a) {
84
84
  if (!e.options.mutationKey)
85
85
  return !1;
86
86
  if (s) {
87
- if (he(e.options.mutationKey) !== he(u))
87
+ if (he(e.options.mutationKey) !== he(a))
88
88
  return !1;
89
- } else if (!ce(e.options.mutationKey, u))
89
+ } else if (!ce(e.options.mutationKey, a))
90
90
  return !1;
91
91
  }
92
92
  return !(r && e.state.status !== r || n && !n(e));
93
93
  }
94
- function Fe(t, e) {
94
+ function Ce(t, e) {
95
95
  return ((e == null ? void 0 : e.queryKeyHashFn) || he)(t);
96
96
  }
97
97
  function he(t) {
98
98
  return JSON.stringify(
99
99
  t,
100
- (e, s) => Se(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
100
+ (e, s) => Fe(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
101
101
  );
102
102
  }
103
103
  function ce(t, e) {
104
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !ce(t[s], e[s])) : !1;
104
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => ce(t[s], e[s])) : !1;
105
105
  }
106
- function Oe(t, e) {
106
+ function Se(t, e) {
107
107
  if (t === e)
108
108
  return t;
109
- const s = De(t) && De(e);
110
- if (s || Se(t) && Se(e)) {
111
- const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), h = u.length, a = s ? [] : {};
109
+ const s = Ae(t) && Ae(e);
110
+ if (s || Fe(t) && Fe(e)) {
111
+ const r = s ? t : Object.keys(t), n = r.length, a = s ? e : Object.keys(e), h = a.length, u = s ? [] : {};
112
112
  let f = 0;
113
113
  for (let w = 0; w < h; w++) {
114
- const m = s ? w : u[w];
115
- (!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (a[m] = void 0, f++) : (a[m] = Oe(t[m], e[m]), a[m] === t[m] && t[m] !== void 0 && f++);
114
+ const m = s ? w : a[w];
115
+ (!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (u[m] = void 0, f++) : (u[m] = Se(t[m], e[m]), u[m] === t[m] && t[m] !== void 0 && f++);
116
116
  }
117
- return n === h && f === n ? t : a;
117
+ return n === h && f === n ? t : u;
118
118
  }
119
119
  return e;
120
120
  }
121
- function De(t) {
121
+ function Ae(t) {
122
122
  return Array.isArray(t) && t.length === Object.keys(t).length;
123
123
  }
124
- function Se(t) {
125
- if (!Ae(t))
124
+ function Fe(t) {
125
+ if (!Me(t))
126
126
  return !1;
127
127
  const e = t.constructor;
128
128
  if (e === void 0)
129
129
  return !0;
130
130
  const s = e.prototype;
131
- return !(!Ae(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
131
+ return !(!Me(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
132
132
  }
133
- function Ae(t) {
133
+ function Me(t) {
134
134
  return Object.prototype.toString.call(t) === "[object Object]";
135
135
  }
136
- function tt(t) {
136
+ function st(t) {
137
137
  return new Promise((e) => {
138
138
  setTimeout(e, t);
139
139
  });
140
140
  }
141
- function st(t, e, s) {
141
+ function rt(t, e, s) {
142
142
  if (typeof s.structuralSharing == "function")
143
143
  return s.structuralSharing(t, e);
144
144
  if (s.structuralSharing !== !1) {
145
145
  if (process.env.NODE_ENV !== "production")
146
146
  try {
147
- return Oe(t, e);
147
+ return Se(t, e);
148
148
  } catch (r) {
149
- console.error(
149
+ throw console.error(
150
150
  `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
151
- );
151
+ ), r;
152
152
  }
153
- return Oe(t, e);
153
+ return Se(t, e);
154
154
  }
155
155
  return e;
156
156
  }
157
- function rt(t, e, s = 0) {
157
+ function it(t, e, s = 0) {
158
158
  const r = [...t, e];
159
159
  return s && r.length > s ? r.slice(1) : r;
160
160
  }
161
- function it(t, e, s = 0) {
161
+ function nt(t, e, s = 0) {
162
162
  const r = [e, ...t];
163
163
  return s && r.length > s ? r.slice(0, -1) : r;
164
164
  }
165
- var me = Symbol();
166
- function Le(t, e) {
167
- return process.env.NODE_ENV !== "production" && t.queryFn === me && console.error(
165
+ var ve = Symbol();
166
+ function Ne(t, e) {
167
+ return process.env.NODE_ENV !== "production" && t.queryFn === ve && console.error(
168
168
  `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
169
- ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === me ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
169
+ ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ve ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
170
170
  }
171
- var B, N, Z, Re, nt = (Re = class extends ge {
171
+ var z, N, Y, Te, at = (Te = class extends be {
172
172
  constructor() {
173
173
  super();
174
- l(this, B, void 0);
174
+ l(this, z, void 0);
175
175
  l(this, N, void 0);
176
- l(this, Z, void 0);
177
- o(this, Z, (e) => {
178
- if (!be && window.addEventListener) {
176
+ l(this, Y, void 0);
177
+ o(this, Y, (e) => {
178
+ if (!we && window.addEventListener) {
179
179
  const s = () => e();
180
180
  return window.addEventListener("visibilitychange", s, !1), () => {
181
181
  window.removeEventListener("visibilitychange", s);
@@ -184,7 +184,7 @@ var B, N, Z, Re, nt = (Re = class extends ge {
184
184
  });
185
185
  }
186
186
  onSubscribe() {
187
- i(this, N) || this.setEventListener(i(this, Z));
187
+ i(this, N) || this.setEventListener(i(this, Y));
188
188
  }
189
189
  onUnsubscribe() {
190
190
  var e;
@@ -192,12 +192,12 @@ var B, N, Z, Re, nt = (Re = class extends ge {
192
192
  }
193
193
  setEventListener(e) {
194
194
  var s;
195
- o(this, Z, e), (s = i(this, N)) == null || s.call(this), o(this, N, e((r) => {
195
+ o(this, Y, e), (s = i(this, N)) == null || s.call(this), o(this, N, e((r) => {
196
196
  typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
197
197
  }));
198
198
  }
199
199
  setFocused(e) {
200
- i(this, B) !== e && (o(this, B, e), this.onFocus());
200
+ i(this, z) !== e && (o(this, z, e), this.onFocus());
201
201
  }
202
202
  onFocus() {
203
203
  const e = this.isFocused();
@@ -207,16 +207,16 @@ var B, N, Z, Re, nt = (Re = class extends ge {
207
207
  }
208
208
  isFocused() {
209
209
  var e;
210
- return typeof i(this, B) == "boolean" ? i(this, B) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
210
+ return typeof i(this, z) == "boolean" ? i(this, z) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
211
211
  }
212
- }, B = new WeakMap(), N = new WeakMap(), Z = new WeakMap(), Re), Ne = new nt(), ee, G, te, Te, at = (Te = class extends ge {
212
+ }, z = new WeakMap(), N = new WeakMap(), Y = new WeakMap(), Te), Ge = new at(), Z, G, ee, je, ut = (je = class extends be {
213
213
  constructor() {
214
214
  super();
215
- l(this, ee, !0);
215
+ l(this, Z, !0);
216
216
  l(this, G, void 0);
217
- l(this, te, void 0);
218
- o(this, te, (e) => {
219
- if (!be && window.addEventListener) {
217
+ l(this, ee, void 0);
218
+ o(this, ee, (e) => {
219
+ if (!we && window.addEventListener) {
220
220
  const s = () => e(!0), r = () => e(!1);
221
221
  return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
222
222
  window.removeEventListener("online", s), window.removeEventListener("offline", r);
@@ -225,7 +225,7 @@ var B, N, Z, Re, nt = (Re = class extends ge {
225
225
  });
226
226
  }
227
227
  onSubscribe() {
228
- i(this, G) || this.setEventListener(i(this, te));
228
+ i(this, G) || this.setEventListener(i(this, ee));
229
229
  }
230
230
  onUnsubscribe() {
231
231
  var e;
@@ -233,21 +233,21 @@ var B, N, Z, Re, nt = (Re = class extends ge {
233
233
  }
234
234
  setEventListener(e) {
235
235
  var s;
236
- o(this, te, e), (s = i(this, G)) == null || s.call(this), o(this, G, e(this.setOnline.bind(this)));
236
+ o(this, ee, e), (s = i(this, G)) == null || s.call(this), o(this, G, e(this.setOnline.bind(this)));
237
237
  }
238
238
  setOnline(e) {
239
- i(this, ee) !== e && (o(this, ee, e), this.listeners.forEach((r) => {
239
+ i(this, Z) !== e && (o(this, Z, e), this.listeners.forEach((r) => {
240
240
  r(e);
241
241
  }));
242
242
  }
243
243
  isOnline() {
244
- return i(this, ee);
244
+ return i(this, Z);
245
245
  }
246
- }, ee = new WeakMap(), G = new WeakMap(), te = new WeakMap(), Te), ve = new at();
247
- function ut() {
246
+ }, Z = new WeakMap(), G = new WeakMap(), ee = new WeakMap(), je), ge = new ut();
247
+ function ot() {
248
248
  let t, e;
249
- const s = new Promise((n, u) => {
250
- t = n, e = u;
249
+ const s = new Promise((n, a) => {
250
+ t = n, e = a;
251
251
  });
252
252
  s.status = "pending", s.catch(() => {
253
253
  });
@@ -266,35 +266,35 @@ function ut() {
266
266
  }), e(n);
267
267
  }, s;
268
268
  }
269
- function ot(t) {
269
+ function ht(t) {
270
270
  return Math.min(1e3 * 2 ** t, 3e4);
271
271
  }
272
- function Ge(t) {
273
- return (t ?? "online") === "online" ? ve.isOnline() : !0;
272
+ function _e(t) {
273
+ return (t ?? "online") === "online" ? ge.isOnline() : !0;
274
274
  }
275
- var _e = class extends Error {
275
+ var Ve = class extends Error {
276
276
  constructor(t) {
277
277
  super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
278
278
  }
279
279
  };
280
- function Pe(t) {
281
- return t instanceof _e;
280
+ function Oe(t) {
281
+ return t instanceof Ve;
282
282
  }
283
- function Ve(t) {
283
+ function $e(t) {
284
284
  let e = !1, s = 0, r = !1, n;
285
- const u = ut(), h = (c) => {
285
+ const a = ot(), h = (c) => {
286
286
  var p;
287
- r || (y(new _e(c)), (p = t.abort) == null || p.call(t));
288
- }, a = () => {
287
+ r || (y(new Ve(c)), (p = t.abort) == null || p.call(t));
288
+ }, u = () => {
289
289
  e = !0;
290
290
  }, f = () => {
291
291
  e = !1;
292
- }, w = () => Ne.isFocused() && (t.networkMode === "always" || ve.isOnline()) && t.canRun(), m = () => Ge(t.networkMode) && t.canRun(), d = (c) => {
292
+ }, w = () => Ge.isFocused() && (t.networkMode === "always" || ge.isOnline()) && t.canRun(), m = () => _e(t.networkMode) && t.canRun(), d = (c) => {
293
293
  var p;
294
- r || (r = !0, (p = t.onSuccess) == null || p.call(t, c), n == null || n(), u.resolve(c));
294
+ r || (r = !0, (p = t.onSuccess) == null || p.call(t, c), n == null || n(), a.resolve(c));
295
295
  }, y = (c) => {
296
296
  var p;
297
- r || (r = !0, (p = t.onError) == null || p.call(t, c), n == null || n(), u.reject(c));
297
+ r || (r = !0, (p = t.onError) == null || p.call(t, c), n == null || n(), a.reject(c));
298
298
  }, q = () => new Promise((c) => {
299
299
  var p;
300
300
  n = (E) => {
@@ -317,52 +317,53 @@ function Ve(t) {
317
317
  var k;
318
318
  if (r)
319
319
  return;
320
- const M = t.retry ?? (be ? 0 : 3), g = t.retryDelay ?? ot, D = typeof g == "function" ? g(s, E) : g, j = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, E);
320
+ const M = t.retry ?? (we ? 0 : 3), g = t.retryDelay ?? ht, D = typeof g == "function" ? g(s, E) : g, j = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, E);
321
321
  if (e || !j) {
322
322
  y(E);
323
323
  return;
324
324
  }
325
- s++, (k = t.onFail) == null || k.call(t, s, E), tt(D).then(() => w() ? void 0 : q()).then(() => {
325
+ s++, (k = t.onFail) == null || k.call(t, s, E), st(D).then(() => w() ? void 0 : q()).then(() => {
326
326
  e ? y(E) : S();
327
327
  });
328
328
  });
329
329
  };
330
330
  return {
331
- promise: u,
331
+ promise: a,
332
332
  cancel: h,
333
- continue: () => (n == null || n(), u),
334
- cancelRetry: a,
333
+ continue: () => (n == null || n(), a),
334
+ cancelRetry: u,
335
335
  continueRetry: f,
336
336
  canStart: m,
337
- start: () => (m() ? S() : q().then(S), u)
337
+ start: () => (m() ? S() : q().then(S), a)
338
338
  };
339
339
  }
340
- function ht() {
341
- let t = [], e = 0, s = (a) => {
342
- a();
343
- }, r = (a) => {
344
- a();
345
- }, n = (a) => setTimeout(a, 0);
346
- const u = (a) => {
347
- e ? t.push(a) : n(() => {
348
- s(a);
340
+ var ct = (t) => setTimeout(t, 0);
341
+ function lt() {
342
+ let t = [], e = 0, s = (u) => {
343
+ u();
344
+ }, r = (u) => {
345
+ u();
346
+ }, n = ct;
347
+ const a = (u) => {
348
+ e ? t.push(u) : n(() => {
349
+ s(u);
349
350
  });
350
351
  }, h = () => {
351
- const a = t;
352
- t = [], a.length && n(() => {
352
+ const u = t;
353
+ t = [], u.length && n(() => {
353
354
  r(() => {
354
- a.forEach((f) => {
355
+ u.forEach((f) => {
355
356
  s(f);
356
357
  });
357
358
  });
358
359
  });
359
360
  };
360
361
  return {
361
- batch: (a) => {
362
+ batch: (u) => {
362
363
  let f;
363
364
  e++;
364
365
  try {
365
- f = a();
366
+ f = u();
366
367
  } finally {
367
368
  e--, e || h();
368
369
  }
@@ -371,64 +372,64 @@ function ht() {
371
372
  /**
372
373
  * All calls to the wrapped function will be batched.
373
374
  */
374
- batchCalls: (a) => (...f) => {
375
- u(() => {
376
- a(...f);
375
+ batchCalls: (u) => (...f) => {
376
+ a(() => {
377
+ u(...f);
377
378
  });
378
379
  },
379
- schedule: u,
380
+ schedule: a,
380
381
  /**
381
382
  * Use this method to set a custom notify function.
382
383
  * This can be used to for example wrap notifications with `React.act` while running tests.
383
384
  */
384
- setNotifyFunction: (a) => {
385
- s = a;
385
+ setNotifyFunction: (u) => {
386
+ s = u;
386
387
  },
387
388
  /**
388
389
  * Use this method to set a custom function to batch notifications together into a single tick.
389
390
  * By default React Query will use the batch function provided by ReactDOM or React Native.
390
391
  */
391
- setBatchNotifyFunction: (a) => {
392
- r = a;
392
+ setBatchNotifyFunction: (u) => {
393
+ r = u;
393
394
  },
394
- setScheduler: (a) => {
395
- n = a;
395
+ setScheduler: (u) => {
396
+ n = u;
396
397
  }
397
398
  };
398
399
  }
399
- var C = ht(), J, je, $e = (je = class {
400
+ var C = lt(), B, ke, ze = (ke = class {
400
401
  constructor() {
401
- l(this, J, void 0);
402
+ l(this, B, void 0);
402
403
  }
403
404
  destroy() {
404
405
  this.clearGcTimeout();
405
406
  }
406
407
  scheduleGc() {
407
- this.clearGcTimeout(), Ye(this.gcTime) && o(this, J, setTimeout(() => {
408
+ this.clearGcTimeout(), Ze(this.gcTime) && o(this, B, setTimeout(() => {
408
409
  this.optionalRemove();
409
410
  }, this.gcTime));
410
411
  }
411
412
  updateGcTime(t) {
412
413
  this.gcTime = Math.max(
413
414
  this.gcTime || 0,
414
- t ?? (be ? 1 / 0 : 5 * 60 * 1e3)
415
+ t ?? (we ? 1 / 0 : 5 * 60 * 1e3)
415
416
  );
416
417
  }
417
418
  clearGcTimeout() {
418
- i(this, J) && (clearTimeout(i(this, J)), o(this, J, void 0));
419
+ i(this, B) && (clearTimeout(i(this, B)), o(this, B, void 0));
419
420
  }
420
- }, J = new WeakMap(), je), se, re, A, W, O, le, X, R, x, ke, ct = (ke = class extends $e {
421
+ }, B = new WeakMap(), ke), te, se, A, J, O, le, W, R, x, Ue, dt = (Ue = class extends ze {
421
422
  constructor(e) {
422
423
  super();
423
424
  l(this, R);
425
+ l(this, te, void 0);
424
426
  l(this, se, void 0);
425
- l(this, re, void 0);
426
427
  l(this, A, void 0);
427
- l(this, W, void 0);
428
+ l(this, J, void 0);
428
429
  l(this, O, void 0);
429
430
  l(this, le, void 0);
430
- l(this, X, void 0);
431
- o(this, X, !1), o(this, le, e.defaultOptions), this.setOptions(e.options), this.observers = [], o(this, W, e.client), o(this, A, i(this, W).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, o(this, se, dt(this.options)), this.state = e.state ?? i(this, se), this.scheduleGc();
431
+ l(this, W, void 0);
432
+ o(this, W, !1), o(this, le, e.defaultOptions), this.setOptions(e.options), this.observers = [], o(this, J, e.client), o(this, A, i(this, J).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, o(this, te, yt(this.options)), this.state = e.state ?? i(this, te), this.scheduleGc();
432
433
  }
433
434
  get meta() {
434
435
  return this.options.meta;
@@ -444,7 +445,7 @@ var C = ht(), J, je, $e = (je = class {
444
445
  !this.observers.length && this.state.fetchStatus === "idle" && i(this, A).remove(this);
445
446
  }
446
447
  setData(e, s) {
447
- const r = st(this.state.data, e, this.options);
448
+ const r = rt(this.state.data, e, this.options);
448
449
  return P(this, R, x).call(this, {
449
450
  data: r,
450
451
  type: "success",
@@ -464,15 +465,15 @@ var C = ht(), J, je, $e = (je = class {
464
465
  super.destroy(), this.cancel({ silent: !0 });
465
466
  }
466
467
  reset() {
467
- this.destroy(), this.setState(i(this, se));
468
+ this.destroy(), this.setState(i(this, te));
468
469
  }
469
470
  isActive() {
470
471
  return this.observers.some(
471
- (e) => et(e.options.enabled, this) !== !1
472
+ (e) => tt(e.options.enabled, this) !== !1
472
473
  );
473
474
  }
474
475
  isDisabled() {
475
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === me || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
476
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ve || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
476
477
  }
477
478
  isStale() {
478
479
  return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
@@ -480,7 +481,7 @@ var C = ht(), J, je, $e = (je = class {
480
481
  ) : this.state.data === void 0;
481
482
  }
482
483
  isStaleByTime(e = 0) {
483
- return this.state.isInvalidated || this.state.data === void 0 || !Ze(this.state.dataUpdatedAt, e);
484
+ return this.state.isInvalidated || this.state.data === void 0 || !et(this.state.dataUpdatedAt, e);
484
485
  }
485
486
  onFocus() {
486
487
  var s;
@@ -496,7 +497,7 @@ var C = ht(), J, je, $e = (je = class {
496
497
  this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, A).notify({ type: "observerAdded", query: this, observer: e }));
497
498
  }
498
499
  removeObserver(e) {
499
- this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, O) && (i(this, X) ? i(this, O).cancel({ revert: !0 }) : i(this, O).cancelRetry()), this.scheduleGc()), i(this, A).notify({ type: "observerRemoved", query: this, observer: e }));
500
+ this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, O) && (i(this, W) ? i(this, O).cancel({ revert: !0 }) : i(this, O).cancelRetry()), this.scheduleGc()), i(this, A).notify({ type: "observerRemoved", query: this, observer: e }));
500
501
  }
501
502
  getObserversCount() {
502
503
  return this.observers.length;
@@ -522,15 +523,15 @@ var C = ht(), J, je, $e = (je = class {
522
523
  const r = new AbortController(), n = (d) => {
523
524
  Object.defineProperty(d, "signal", {
524
525
  enumerable: !0,
525
- get: () => (o(this, X, !0), r.signal)
526
+ get: () => (o(this, W, !0), r.signal)
526
527
  });
527
- }, u = () => {
528
- const d = Le(this.options, s), y = {
529
- client: i(this, W),
528
+ }, a = () => {
529
+ const d = Ne(this.options, s), y = {
530
+ client: i(this, J),
530
531
  queryKey: this.queryKey,
531
532
  meta: this.meta
532
533
  };
533
- return n(y), o(this, X, !1), this.options.persister ? this.options.persister(
534
+ return n(y), o(this, W, !1), this.options.persister ? this.options.persister(
534
535
  d,
535
536
  y,
536
537
  this
@@ -539,20 +540,20 @@ var C = ht(), J, je, $e = (je = class {
539
540
  fetchOptions: s,
540
541
  options: this.options,
541
542
  queryKey: this.queryKey,
542
- client: i(this, W),
543
+ client: i(this, J),
543
544
  state: this.state,
544
- fetchFn: u
545
+ fetchFn: a
545
546
  };
546
547
  n(h), (f = this.options.behavior) == null || f.onFetch(
547
548
  h,
548
549
  this
549
- ), o(this, re, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((w = h.fetchOptions) == null ? void 0 : w.meta)) && P(this, R, x).call(this, { type: "fetch", meta: (m = h.fetchOptions) == null ? void 0 : m.meta });
550
- const a = (d) => {
550
+ ), o(this, se, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((w = h.fetchOptions) == null ? void 0 : w.meta)) && P(this, R, x).call(this, { type: "fetch", meta: (m = h.fetchOptions) == null ? void 0 : m.meta });
551
+ const u = (d) => {
551
552
  var y, q, S, c;
552
- Pe(d) && d.silent || P(this, R, x).call(this, {
553
+ Oe(d) && d.silent || P(this, R, x).call(this, {
553
554
  type: "error",
554
555
  error: d
555
- }), Pe(d) || ((q = (y = i(this, A).config).onError) == null || q.call(
556
+ }), Oe(d) || ((q = (y = i(this, A).config).onError) == null || q.call(
556
557
  y,
557
558
  d,
558
559
  this
@@ -563,7 +564,7 @@ var C = ht(), J, je, $e = (je = class {
563
564
  this
564
565
  )), this.scheduleGc();
565
566
  };
566
- return o(this, O, Ve({
567
+ return o(this, O, $e({
567
568
  initialPromise: s == null ? void 0 : s.initialPromise,
568
569
  fn: h.fetchFn,
569
570
  abort: r.abort.bind(r),
@@ -572,13 +573,13 @@ var C = ht(), J, je, $e = (je = class {
572
573
  if (d === void 0) {
573
574
  process.env.NODE_ENV !== "production" && console.error(
574
575
  `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
575
- ), a(new Error(`${this.queryHash} data is undefined`));
576
+ ), u(new Error(`${this.queryHash} data is undefined`));
576
577
  return;
577
578
  }
578
579
  try {
579
580
  this.setData(d);
580
581
  } catch (p) {
581
- a(p);
582
+ u(p);
582
583
  return;
583
584
  }
584
585
  (q = (y = i(this, A).config).onSuccess) == null || q.call(y, d, this), (c = (S = i(this, A).config).onSettled) == null || c.call(
@@ -588,7 +589,7 @@ var C = ht(), J, je, $e = (je = class {
588
589
  this
589
590
  ), this.scheduleGc();
590
591
  },
591
- onError: a,
592
+ onError: u,
592
593
  onFail: (d, y) => {
593
594
  P(this, R, x).call(this, { type: "failed", failureCount: d, error: y });
594
595
  },
@@ -604,7 +605,7 @@ var C = ht(), J, je, $e = (je = class {
604
605
  canRun: () => !0
605
606
  })), i(this, O).start();
606
607
  }
607
- }, se = new WeakMap(), re = new WeakMap(), A = new WeakMap(), W = new WeakMap(), O = new WeakMap(), le = new WeakMap(), X = new WeakMap(), R = new WeakSet(), x = function(e) {
608
+ }, te = new WeakMap(), se = new WeakMap(), A = new WeakMap(), J = new WeakMap(), O = new WeakMap(), le = new WeakMap(), W = new WeakMap(), R = new WeakSet(), x = function(e) {
608
609
  const s = (r) => {
609
610
  switch (e.type) {
610
611
  case "failed":
@@ -626,7 +627,7 @@ var C = ht(), J, je, $e = (je = class {
626
627
  case "fetch":
627
628
  return {
628
629
  ...r,
629
- ...lt(r.data, this.options),
630
+ ...ft(r.data, this.options),
630
631
  fetchMeta: e.meta ?? null
631
632
  };
632
633
  case "success":
@@ -646,7 +647,7 @@ var C = ht(), J, je, $e = (je = class {
646
647
  };
647
648
  case "error":
648
649
  const n = e.error;
649
- return Pe(n) && n.revert && i(this, re) ? { ...i(this, re), fetchStatus: "idle" } : {
650
+ return Oe(n) && n.revert && i(this, se) ? { ...i(this, se), fetchStatus: "idle" } : {
650
651
  ...r,
651
652
  error: n,
652
653
  errorUpdateCount: r.errorUpdateCount + 1,
@@ -673,19 +674,19 @@ var C = ht(), J, je, $e = (je = class {
673
674
  r.onQueryUpdate();
674
675
  }), i(this, A).notify({ query: this, type: "updated", action: e });
675
676
  });
676
- }, ke);
677
- function lt(t, e) {
677
+ }, Ue);
678
+ function ft(t, e) {
678
679
  return {
679
680
  fetchFailureCount: 0,
680
681
  fetchFailureReason: null,
681
- fetchStatus: Ge(e.networkMode) ? "fetching" : "paused",
682
+ fetchStatus: _e(e.networkMode) ? "fetching" : "paused",
682
683
  ...t === void 0 && {
683
684
  error: null,
684
685
  status: "pending"
685
686
  }
686
687
  };
687
688
  }
688
- function dt(t) {
689
+ function yt(t) {
689
690
  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;
690
691
  return {
691
692
  data: e,
@@ -702,19 +703,19 @@ function dt(t) {
702
703
  fetchStatus: "idle"
703
704
  };
704
705
  }
705
- var U, Ue, ft = (Ue = class extends ge {
706
+ var U, Ke, pt = (Ke = class extends be {
706
707
  constructor(e = {}) {
707
708
  super();
708
709
  l(this, U, void 0);
709
710
  this.config = e, o(this, U, /* @__PURE__ */ new Map());
710
711
  }
711
712
  build(e, s, r) {
712
- const n = s.queryKey, u = s.queryHash ?? Fe(n, s);
713
- let h = this.get(u);
714
- return h || (h = new ct({
713
+ const n = s.queryKey, a = s.queryHash ?? Ce(n, s);
714
+ let h = this.get(a);
715
+ return h || (h = new dt({
715
716
  client: e,
716
717
  queryKey: n,
717
- queryHash: u,
718
+ queryHash: a,
718
719
  options: e.defaultQueryOptions(s),
719
720
  state: r,
720
721
  defaultOptions: e.getQueryDefaults(n)
@@ -746,12 +747,12 @@ var U, Ue, ft = (Ue = class extends ge {
746
747
  find(e) {
747
748
  const s = { exact: !0, ...e };
748
749
  return this.getAll().find(
749
- (r) => qe(s, r)
750
+ (r) => Ee(s, r)
750
751
  );
751
752
  }
752
753
  findAll(e = {}) {
753
754
  const s = this.getAll();
754
- return Object.keys(e).length > 0 ? s.filter((r) => qe(e, r)) : s;
755
+ return Object.keys(e).length > 0 ? s.filter((r) => Ee(e, r)) : s;
755
756
  }
756
757
  notify(e) {
757
758
  C.batch(() => {
@@ -774,14 +775,14 @@ var U, Ue, ft = (Ue = class extends ge {
774
775
  });
775
776
  });
776
777
  }
777
- }, U = new WeakMap(), Ue), K, F, Y, I, L, Ke, yt = (Ke = class extends $e {
778
+ }, U = new WeakMap(), Ke), K, F, X, I, L, Ie, mt = (Ie = class extends ze {
778
779
  constructor(e) {
779
780
  super();
780
781
  l(this, I);
781
782
  l(this, K, void 0);
782
783
  l(this, F, void 0);
783
- l(this, Y, void 0);
784
- this.mutationId = e.mutationId, o(this, F, e.mutationCache), o(this, K, []), this.state = e.state || pt(), this.setOptions(e.options), this.scheduleGc();
784
+ l(this, X, void 0);
785
+ this.mutationId = e.mutationId, o(this, F, e.mutationCache), o(this, K, []), this.state = e.state || vt(), this.setOptions(e.options), this.scheduleGc();
785
786
  }
786
787
  setOptions(e) {
787
788
  this.options = e, this.updateGcTime(this.options.gcTime);
@@ -808,80 +809,83 @@ var U, Ue, ft = (Ue = class extends ge {
808
809
  }
809
810
  continue() {
810
811
  var e;
811
- return ((e = i(this, Y)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
812
+ return ((e = i(this, X)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
812
813
  this.execute(this.state.variables);
813
814
  }
814
815
  async execute(e) {
815
- var n, u, h, a, f, w, m, d, y, q, S, c, p, E, M, g, D, j, k, fe;
816
- o(this, Y, Ve({
816
+ var a, h, u, f, w, m, d, y, q, S, c, p, E, M, g, D, j, k, fe, ue;
817
+ const s = () => {
818
+ P(this, I, L).call(this, { type: "continue" });
819
+ };
820
+ o(this, X, $e({
817
821
  fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
818
- onFail: (b, z) => {
819
- P(this, I, L).call(this, { type: "failed", failureCount: b, error: z });
822
+ onFail: (b, ye) => {
823
+ P(this, I, L).call(this, { type: "failed", failureCount: b, error: ye });
820
824
  },
821
825
  onPause: () => {
822
826
  P(this, I, L).call(this, { type: "pause" });
823
827
  },
824
- onContinue: () => {
825
- P(this, I, L).call(this, { type: "continue" });
826
- },
828
+ onContinue: s,
827
829
  retry: this.options.retry ?? 0,
828
830
  retryDelay: this.options.retryDelay,
829
831
  networkMode: this.options.networkMode,
830
832
  canRun: () => i(this, F).canRun(this)
831
833
  }));
832
- const s = this.state.status === "pending", r = !i(this, Y).canStart();
834
+ const r = this.state.status === "pending", n = !i(this, X).canStart();
833
835
  try {
834
- if (!s) {
835
- P(this, I, L).call(this, { type: "pending", variables: e, isPaused: r }), await ((u = (n = i(this, F).config).onMutate) == null ? void 0 : u.call(
836
- n,
836
+ if (r)
837
+ s();
838
+ else {
839
+ P(this, I, L).call(this, { type: "pending", variables: e, isPaused: n }), await ((h = (a = i(this, F).config).onMutate) == null ? void 0 : h.call(
840
+ a,
837
841
  e,
838
842
  this
839
843
  ));
840
- const z = await ((a = (h = this.options).onMutate) == null ? void 0 : a.call(h, e));
841
- z !== this.state.context && P(this, I, L).call(this, {
844
+ const ye = await ((f = (u = this.options).onMutate) == null ? void 0 : f.call(u, e));
845
+ ye !== this.state.context && P(this, I, L).call(this, {
842
846
  type: "pending",
843
- context: z,
847
+ context: ye,
844
848
  variables: e,
845
- isPaused: r
849
+ isPaused: n
846
850
  });
847
851
  }
848
- const b = await i(this, Y).start();
849
- return await ((w = (f = i(this, F).config).onSuccess) == null ? void 0 : w.call(
850
- f,
852
+ const b = await i(this, X).start();
853
+ return await ((m = (w = i(this, F).config).onSuccess) == null ? void 0 : m.call(
854
+ w,
851
855
  b,
852
856
  e,
853
857
  this.state.context,
854
858
  this
855
- )), await ((d = (m = this.options).onSuccess) == null ? void 0 : d.call(m, b, e, this.state.context)), await ((q = (y = i(this, F).config).onSettled) == null ? void 0 : q.call(
856
- y,
859
+ )), await ((y = (d = this.options).onSuccess) == null ? void 0 : y.call(d, b, e, this.state.context)), await ((S = (q = i(this, F).config).onSettled) == null ? void 0 : S.call(
860
+ q,
857
861
  b,
858
862
  null,
859
863
  this.state.variables,
860
864
  this.state.context,
861
865
  this
862
- )), await ((c = (S = this.options).onSettled) == null ? void 0 : c.call(S, b, null, e, this.state.context)), P(this, I, L).call(this, { type: "success", data: b }), b;
866
+ )), await ((p = (c = this.options).onSettled) == null ? void 0 : p.call(c, b, null, e, this.state.context)), P(this, I, L).call(this, { type: "success", data: b }), b;
863
867
  } catch (b) {
864
868
  try {
865
- throw await ((E = (p = i(this, F).config).onError) == null ? void 0 : E.call(
866
- p,
869
+ throw await ((M = (E = i(this, F).config).onError) == null ? void 0 : M.call(
870
+ E,
867
871
  b,
868
872
  e,
869
873
  this.state.context,
870
874
  this
871
- )), await ((g = (M = this.options).onError) == null ? void 0 : g.call(
872
- M,
875
+ )), await ((D = (g = this.options).onError) == null ? void 0 : D.call(
876
+ g,
873
877
  b,
874
878
  e,
875
879
  this.state.context
876
- )), await ((j = (D = i(this, F).config).onSettled) == null ? void 0 : j.call(
877
- D,
880
+ )), await ((k = (j = i(this, F).config).onSettled) == null ? void 0 : k.call(
881
+ j,
878
882
  void 0,
879
883
  b,
880
884
  this.state.variables,
881
885
  this.state.context,
882
886
  this
883
- )), await ((fe = (k = this.options).onSettled) == null ? void 0 : fe.call(
884
- k,
887
+ )), await ((ue = (fe = this.options).onSettled) == null ? void 0 : ue.call(
888
+ fe,
885
889
  void 0,
886
890
  b,
887
891
  e,
@@ -894,7 +898,7 @@ var U, Ue, ft = (Ue = class extends ge {
894
898
  i(this, F).runNext(this);
895
899
  }
896
900
  }
897
- }, K = new WeakMap(), F = new WeakMap(), Y = new WeakMap(), I = new WeakSet(), L = function(e) {
901
+ }, K = new WeakMap(), F = new WeakMap(), X = new WeakMap(), I = new WeakSet(), L = function(e) {
898
902
  const s = (r) => {
899
903
  switch (e.type) {
900
904
  case "failed":
@@ -957,8 +961,8 @@ var U, Ue, ft = (Ue = class extends ge {
957
961
  action: e
958
962
  });
959
963
  });
960
- }, Ke);
961
- function pt() {
964
+ }, Ie);
965
+ function vt() {
962
966
  return {
963
967
  context: void 0,
964
968
  data: void 0,
@@ -971,7 +975,7 @@ function pt() {
971
975
  submittedAt: 0
972
976
  };
973
977
  }
974
- var H, T, de, Ie, mt = (Ie = class extends ge {
978
+ var H, T, de, xe, gt = (xe = class extends be {
975
979
  constructor(e = {}) {
976
980
  super();
977
981
  l(this, H, void 0);
@@ -980,9 +984,9 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
980
984
  this.config = e, o(this, H, /* @__PURE__ */ new Set()), o(this, T, /* @__PURE__ */ new Map()), o(this, de, 0);
981
985
  }
982
986
  build(e, s, r) {
983
- const n = new yt({
987
+ const n = new mt({
984
988
  mutationCache: this,
985
- mutationId: ++ye(this, de)._,
989
+ mutationId: ++pe(this, de)._,
986
990
  options: e.defaultMutationOptions(s),
987
991
  state: r
988
992
  });
@@ -990,7 +994,7 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
990
994
  }
991
995
  add(e) {
992
996
  i(this, H).add(e);
993
- const s = pe(e);
997
+ const s = me(e);
994
998
  if (typeof s == "string") {
995
999
  const r = i(this, T).get(s);
996
1000
  r ? r.push(e) : i(this, T).set(s, [e]);
@@ -999,7 +1003,7 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
999
1003
  }
1000
1004
  remove(e) {
1001
1005
  if (i(this, H).delete(e)) {
1002
- const s = pe(e);
1006
+ const s = me(e);
1003
1007
  if (typeof s == "string") {
1004
1008
  const r = i(this, T).get(s);
1005
1009
  if (r)
@@ -1013,10 +1017,10 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
1013
1017
  this.notify({ type: "removed", mutation: e });
1014
1018
  }
1015
1019
  canRun(e) {
1016
- const s = pe(e);
1020
+ const s = me(e);
1017
1021
  if (typeof s == "string") {
1018
1022
  const r = i(this, T).get(s), n = r == null ? void 0 : r.find(
1019
- (u) => u.state.status === "pending"
1023
+ (a) => a.state.status === "pending"
1020
1024
  );
1021
1025
  return !n || n === e;
1022
1026
  } else
@@ -1024,9 +1028,9 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
1024
1028
  }
1025
1029
  runNext(e) {
1026
1030
  var r;
1027
- const s = pe(e);
1031
+ const s = me(e);
1028
1032
  if (typeof s == "string") {
1029
- const n = (r = i(this, T).get(s)) == null ? void 0 : r.find((u) => u !== e && u.state.isPaused);
1033
+ const n = (r = i(this, T).get(s)) == null ? void 0 : r.find((a) => a !== e && a.state.isPaused);
1030
1034
  return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
1031
1035
  } else
1032
1036
  return Promise.resolve();
@@ -1044,11 +1048,11 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
1044
1048
  find(e) {
1045
1049
  const s = { exact: !0, ...e };
1046
1050
  return this.getAll().find(
1047
- (r) => Ee(s, r)
1051
+ (r) => De(s, r)
1048
1052
  );
1049
1053
  }
1050
1054
  findAll(e = {}) {
1051
- return this.getAll().filter((s) => Ee(e, s));
1055
+ return this.getAll().filter((s) => De(e, s));
1052
1056
  }
1053
1057
  notify(e) {
1054
1058
  C.batch(() => {
@@ -1065,17 +1069,17 @@ var H, T, de, Ie, mt = (Ie = class extends ge {
1065
1069
  )
1066
1070
  );
1067
1071
  }
1068
- }, H = new WeakMap(), T = new WeakMap(), de = new WeakMap(), Ie);
1069
- function pe(t) {
1072
+ }, H = new WeakMap(), T = new WeakMap(), de = new WeakMap(), xe);
1073
+ function me(t) {
1070
1074
  var e;
1071
1075
  return (e = t.options.scope) == null ? void 0 : e.id;
1072
1076
  }
1073
- function Me(t) {
1077
+ function Qe(t) {
1074
1078
  return {
1075
1079
  onFetch: (e, s) => {
1076
1080
  var m, d, y, q, S;
1077
- const r = e.options, n = (y = (d = (m = e.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : y.direction, u = ((q = e.state.data) == null ? void 0 : q.pages) || [], h = ((S = e.state.data) == null ? void 0 : S.pageParams) || [];
1078
- let a = { pages: [], pageParams: [] }, f = 0;
1081
+ const r = e.options, n = (y = (d = (m = e.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : y.direction, a = ((q = e.state.data) == null ? void 0 : q.pages) || [], h = ((S = e.state.data) == null ? void 0 : S.pageParams) || [];
1082
+ let u = { pages: [], pageParams: [] }, f = 0;
1079
1083
  const w = async () => {
1080
1084
  let c = !1;
1081
1085
  const p = (g) => {
@@ -1085,7 +1089,7 @@ function Me(t) {
1085
1089
  c = !0;
1086
1090
  }), e.signal)
1087
1091
  });
1088
- }, E = Le(e.options, e.fetchOptions), M = async (g, D, j) => {
1092
+ }, E = Ne(e.options, e.fetchOptions), M = async (g, D, j) => {
1089
1093
  if (c)
1090
1094
  return Promise.reject();
1091
1095
  if (D == null && g.pages.length)
@@ -1100,28 +1104,28 @@ function Me(t) {
1100
1104
  p(k);
1101
1105
  const fe = await E(
1102
1106
  k
1103
- ), { maxPages: b } = e.options, z = j ? it : rt;
1107
+ ), { maxPages: ue } = e.options, b = j ? nt : it;
1104
1108
  return {
1105
- pages: z(g.pages, fe, b),
1106
- pageParams: z(g.pageParams, D, b)
1109
+ pages: b(g.pages, fe, ue),
1110
+ pageParams: b(g.pageParams, D, ue)
1107
1111
  };
1108
1112
  };
1109
- if (n && u.length) {
1110
- const g = n === "backward", D = g ? vt : Qe, j = {
1111
- pages: u,
1113
+ if (n && a.length) {
1114
+ const g = n === "backward", D = g ? bt : Re, j = {
1115
+ pages: a,
1112
1116
  pageParams: h
1113
1117
  }, k = D(r, j);
1114
- a = await M(j, k, g);
1118
+ u = await M(j, k, g);
1115
1119
  } else {
1116
- const g = t ?? u.length;
1120
+ const g = t ?? a.length;
1117
1121
  do {
1118
- const D = f === 0 ? h[0] ?? r.initialPageParam : Qe(r, a);
1122
+ const D = f === 0 ? h[0] ?? r.initialPageParam : Re(r, u);
1119
1123
  if (f > 0 && D == null)
1120
1124
  break;
1121
- a = await M(a, D), f++;
1125
+ u = await M(u, D), f++;
1122
1126
  } while (f < g);
1123
1127
  }
1124
- return a;
1128
+ return u;
1125
1129
  };
1126
1130
  e.options.persister ? e.fetchFn = () => {
1127
1131
  var c, p;
@@ -1140,7 +1144,7 @@ function Me(t) {
1140
1144
  }
1141
1145
  };
1142
1146
  }
1143
- function Qe(t, { pages: e, pageParams: s }) {
1147
+ function Re(t, { pages: e, pageParams: s }) {
1144
1148
  const r = e.length - 1;
1145
1149
  return e.length > 0 ? t.getNextPageParam(
1146
1150
  e[r],
@@ -1149,32 +1153,32 @@ function Qe(t, { pages: e, pageParams: s }) {
1149
1153
  s
1150
1154
  ) : void 0;
1151
1155
  }
1152
- function vt(t, { pages: e, pageParams: s }) {
1156
+ function bt(t, { pages: e, pageParams: s }) {
1153
1157
  var r;
1154
1158
  return e.length > 0 ? (r = t.getPreviousPageParam) == null ? void 0 : r.call(t, e[0], e, s[0], s) : void 0;
1155
1159
  }
1156
- var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1160
+ var v, _, V, re, ie, $, ne, ae, He, wt = (He = class {
1157
1161
  constructor(t = {}) {
1158
1162
  l(this, v, void 0);
1159
1163
  l(this, _, void 0);
1160
1164
  l(this, V, void 0);
1165
+ l(this, re, void 0);
1161
1166
  l(this, ie, void 0);
1162
- l(this, ne, void 0);
1163
1167
  l(this, $, void 0);
1168
+ l(this, ne, void 0);
1164
1169
  l(this, ae, void 0);
1165
- l(this, ue, void 0);
1166
- o(this, v, t.queryCache || new ft()), o(this, _, t.mutationCache || new mt()), o(this, V, t.defaultOptions || {}), o(this, ie, /* @__PURE__ */ new Map()), o(this, ne, /* @__PURE__ */ new Map()), o(this, $, 0);
1170
+ o(this, v, t.queryCache || new pt()), o(this, _, t.mutationCache || new gt()), o(this, V, t.defaultOptions || {}), o(this, re, /* @__PURE__ */ new Map()), o(this, ie, /* @__PURE__ */ new Map()), o(this, $, 0);
1167
1171
  }
1168
1172
  mount() {
1169
- ye(this, $)._++, i(this, $) === 1 && (o(this, ae, Ne.subscribe(async (t) => {
1173
+ pe(this, $)._++, i(this, $) === 1 && (o(this, ne, Ge.subscribe(async (t) => {
1170
1174
  t && (await this.resumePausedMutations(), i(this, v).onFocus());
1171
- })), o(this, ue, ve.subscribe(async (t) => {
1175
+ })), o(this, ae, ge.subscribe(async (t) => {
1172
1176
  t && (await this.resumePausedMutations(), i(this, v).onOnline());
1173
1177
  })));
1174
1178
  }
1175
1179
  unmount() {
1176
1180
  var t, e;
1177
- ye(this, $)._--, i(this, $) === 0 && ((t = i(this, ae)) == null || t.call(this), o(this, ae, void 0), (e = i(this, ue)) == null || e.call(this), o(this, ue, void 0));
1181
+ pe(this, $)._--, i(this, $) === 0 && ((t = i(this, ne)) == null || t.call(this), o(this, ne, void 0), (e = i(this, ae)) == null || e.call(this), o(this, ae, void 0));
1178
1182
  }
1179
1183
  isFetching(t) {
1180
1184
  return i(this, v).findAll({ ...t, fetchStatus: "fetching" }).length;
@@ -1182,6 +1186,13 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1182
1186
  isMutating(t) {
1183
1187
  return i(this, _).findAll({ ...t, status: "pending" }).length;
1184
1188
  }
1189
+ /**
1190
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
1191
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1192
+ *
1193
+ * Hint: Do not use this function inside a component, because it won't receive updates.
1194
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1195
+ */
1185
1196
  getQueryData(t) {
1186
1197
  var s;
1187
1198
  const e = this.defaultQueryOptions({ queryKey: t });
@@ -1189,7 +1200,7 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1189
1200
  }
1190
1201
  ensureQueryData(t) {
1191
1202
  const e = this.defaultQueryOptions(t), s = i(this, v).build(this, e), r = s.state.data;
1192
- return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(Ce(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
1203
+ return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(qe(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
1193
1204
  }
1194
1205
  getQueriesData(t) {
1195
1206
  return i(this, v).findAll(t).map(({ queryKey: e, state: s }) => {
@@ -1200,7 +1211,7 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1200
1211
  setQueryData(t, e, s) {
1201
1212
  const r = this.defaultQueryOptions({ queryKey: t }), n = i(this, v).get(
1202
1213
  r.queryHash
1203
- ), u = n == null ? void 0 : n.state.data, h = Xe(e, u);
1214
+ ), a = n == null ? void 0 : n.state.data, h = Ye(e, a);
1204
1215
  if (h !== void 0)
1205
1216
  return i(this, v).build(this, r).setData(h, { ...s, manual: !0 });
1206
1217
  }
@@ -1262,8 +1273,8 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1262
1273
  cancelRefetch: e.cancelRefetch ?? !0
1263
1274
  }, r = C.batch(
1264
1275
  () => i(this, v).findAll(t).filter((n) => !n.isDisabled()).map((n) => {
1265
- let u = n.fetch(void 0, s);
1266
- return s.throwOnError || (u = u.catch(Q)), n.state.fetchStatus === "paused" ? Promise.resolve() : u;
1276
+ let a = n.fetch(void 0, s);
1277
+ return s.throwOnError || (a = a.catch(Q)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1267
1278
  })
1268
1279
  );
1269
1280
  return Promise.all(r).then(Q);
@@ -1273,23 +1284,23 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1273
1284
  e.retry === void 0 && (e.retry = !1);
1274
1285
  const s = i(this, v).build(this, e);
1275
1286
  return s.isStaleByTime(
1276
- Ce(e.staleTime, s)
1287
+ qe(e.staleTime, s)
1277
1288
  ) ? s.fetch(e) : Promise.resolve(s.state.data);
1278
1289
  }
1279
1290
  prefetchQuery(t) {
1280
1291
  return this.fetchQuery(t).then(Q).catch(Q);
1281
1292
  }
1282
1293
  fetchInfiniteQuery(t) {
1283
- return t.behavior = Me(t.pages), this.fetchQuery(t);
1294
+ return t.behavior = Qe(t.pages), this.fetchQuery(t);
1284
1295
  }
1285
1296
  prefetchInfiniteQuery(t) {
1286
1297
  return this.fetchInfiniteQuery(t).then(Q).catch(Q);
1287
1298
  }
1288
1299
  ensureInfiniteQueryData(t) {
1289
- return t.behavior = Me(t.pages), this.ensureQueryData(t);
1300
+ return t.behavior = Qe(t.pages), this.ensureQueryData(t);
1290
1301
  }
1291
1302
  resumePausedMutations() {
1292
- return ve.isOnline() ? i(this, _).resumePausedMutations() : Promise.resolve();
1303
+ return ge.isOnline() ? i(this, _).resumePausedMutations() : Promise.resolve();
1293
1304
  }
1294
1305
  getQueryCache() {
1295
1306
  return i(this, v);
@@ -1304,25 +1315,25 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1304
1315
  o(this, V, t);
1305
1316
  }
1306
1317
  setQueryDefaults(t, e) {
1307
- i(this, ie).set(he(t), {
1318
+ i(this, re).set(he(t), {
1308
1319
  queryKey: t,
1309
1320
  defaultOptions: e
1310
1321
  });
1311
1322
  }
1312
1323
  getQueryDefaults(t) {
1313
- const e = [...i(this, ie).values()], s = {};
1324
+ const e = [...i(this, re).values()], s = {};
1314
1325
  return e.forEach((r) => {
1315
1326
  ce(t, r.queryKey) && Object.assign(s, r.defaultOptions);
1316
1327
  }), s;
1317
1328
  }
1318
1329
  setMutationDefaults(t, e) {
1319
- i(this, ne).set(he(t), {
1330
+ i(this, ie).set(he(t), {
1320
1331
  mutationKey: t,
1321
1332
  defaultOptions: e
1322
1333
  });
1323
1334
  }
1324
1335
  getMutationDefaults(t) {
1325
- const e = [...i(this, ne).values()], s = {};
1336
+ const e = [...i(this, ie).values()], s = {};
1326
1337
  return e.forEach((r) => {
1327
1338
  ce(t, r.mutationKey) && Object.assign(s, r.defaultOptions);
1328
1339
  }), s;
@@ -1336,10 +1347,10 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1336
1347
  ...t,
1337
1348
  _defaulted: !0
1338
1349
  };
1339
- return e.queryHash || (e.queryHash = Fe(
1350
+ return e.queryHash || (e.queryHash = Ce(
1340
1351
  e.queryKey,
1341
1352
  e
1342
- )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === me && (e.enabled = !1), e;
1353
+ )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === ve && (e.enabled = !1), e;
1343
1354
  }
1344
1355
  defaultMutationOptions(t) {
1345
1356
  return t != null && t._defaulted ? t : {
@@ -1352,18 +1363,18 @@ var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
1352
1363
  clear() {
1353
1364
  i(this, v).clear(), i(this, _).clear();
1354
1365
  }
1355
- }, v = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), $ = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), xe), bt = He.createContext(
1366
+ }, v = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), $ = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), He), Pt = Le.createContext(
1356
1367
  void 0
1357
- ), wt = ({
1368
+ ), Ot = ({
1358
1369
  client: t,
1359
1370
  children: e
1360
- }) => (He.useEffect(() => (t.mount(), () => {
1371
+ }) => (Le.useEffect(() => (t.mount(), () => {
1361
1372
  t.unmount();
1362
- }), [t]), /* @__PURE__ */ oe(bt.Provider, { value: t, children: e }));
1363
- const Pt = new gt(), Dt = (t) => {
1364
- const { children: e, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: u, ...h } = t, { workerUrlAdded: a } = Je(n);
1365
- return /* @__PURE__ */ oe(wt, { client: Pt, children: /* @__PURE__ */ oe(We, { licenseKey: u, children: /* @__PURE__ */ oe(Be, { workerUrlAdded: a, ...h, children: /* @__PURE__ */ oe(ze, { customDarkVariables: r, customVariables: s, children: e }) }) }) });
1373
+ }), [t]), /* @__PURE__ */ oe(Pt.Provider, { value: t, children: e }));
1374
+ const St = new wt(), Mt = (t) => {
1375
+ const { children: e, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: a, ...h } = t, { workerUrlAdded: u } = We(n);
1376
+ return /* @__PURE__ */ oe(Ot, { client: St, children: /* @__PURE__ */ oe(Xe, { licenseKey: a, children: /* @__PURE__ */ oe(Je, { workerUrlAdded: u, ...h, children: /* @__PURE__ */ oe(Be, { customDarkVariables: r, customVariables: s, children: e }) }) }) });
1366
1377
  };
1367
1378
  export {
1368
- Dt as RPConfig
1379
+ Mt as RPConfig
1369
1380
  };