reactjrx 1.82.0 → 1.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +1058 -1047
  4. package/dist/lib/binding/useSubject.d.ts +2 -2
  5. package/dist/lib/queries/client/QueryClient.d.ts +7 -7
  6. package/dist/lib/queries/client/keys/matchKey.d.ts +1 -1
  7. package/dist/lib/queries/client/mutations/mutation/Mutation.d.ts +5 -0
  8. package/dist/lib/queries/client/mutations/runner/MutationRunner.d.ts +4 -1
  9. package/dist/lib/queries/client/mutations/{defaultMutationState.d.ts → utils/defaultMutationState.d.ts} +1 -1
  10. package/dist/lib/queries/client/mutations/utils/distinctUntilStateChanged.d.ts +4 -0
  11. package/dist/lib/queries/client/mutations/{filters.d.ts → utils/filters.d.ts} +2 -2
  12. package/dist/lib/queries/client/queries/cache/QueryCache.d.ts +1 -1
  13. package/dist/lib/queries/client/queries/observer/QueryObserver.d.ts +3 -3
  14. package/dist/lib/queries/client/queries/observer/types.d.ts +2 -2
  15. package/dist/lib/queries/client/queries/query/delayOnNetworkMode.d.ts +1 -1
  16. package/dist/lib/queries/client/queries/query/execution/executeQuery.d.ts +1 -1
  17. package/dist/lib/queries/client/queries/query/operators.d.ts +1 -1
  18. package/dist/lib/queries/client/queries/query/types.d.ts +2 -0
  19. package/dist/lib/queries/client/queries/types.d.ts +5 -4
  20. package/dist/lib/queries/client/queries/utils.d.ts +3 -1
  21. package/dist/lib/queries/client/types.d.ts +1 -1
  22. package/dist/lib/queries/react/mutations/useIsMutating.d.ts +1 -1
  23. package/dist/lib/queries/react/queries/QueryOptions.rq.types.typeTest.d.ts +1 -0
  24. package/dist/lib/queries/react/queries/isRestoring.d.ts +1 -1
  25. package/dist/lib/queries/react/queries/queryOptions.d.ts +3 -3
  26. package/dist/lib/queries/react/queries/types.d.ts +3 -3
  27. package/dist/lib/state/persistance/adapters/createLocalStorageAdapter.d.ts +1 -1
  28. package/dist/lib/state/persistance/usePersistSignals.d.ts +4 -4
  29. package/dist/lib/utils/types.d.ts +3 -2
  30. package/package.json +2 -2
  31. /package/dist/lib/queries/{react/queries/QueryOptions.rq.types.test.d.ts → client/QueryClient.rq.test.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,80 +1,80 @@
1
- var Wt = Object.defineProperty;
2
- var Gt = (r, e, t) => e in r ? Wt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var b = (r, e, t) => (Gt(r, typeof e != "symbol" ? e + "" : e, t), t), dt = (r, e, t) => {
4
- if (!e.has(r))
1
+ var Jt = Object.defineProperty;
2
+ var Yt = (s, e, t) => e in s ? Jt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var m = (s, e, t) => (Yt(s, typeof e != "symbol" ? e + "" : e, t), t), pt = (s, e, t) => {
4
+ if (!e.has(s))
5
5
  throw TypeError("Cannot " + t);
6
6
  };
7
- var a = (r, e, t) => (dt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), w = (r, e, t) => {
8
- if (e.has(r))
7
+ var a = (s, e, t) => (pt(s, e, "read from private field"), t ? t.call(s) : e.get(s)), C = (s, e, t) => {
8
+ if (e.has(s))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
- e instanceof WeakSet ? e.add(r) : e.set(r, t);
11
- }, M = (r, e, t, s) => (dt(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t);
10
+ e instanceof WeakSet ? e.add(s) : e.set(s, t);
11
+ }, M = (s, e, t, r) => (pt(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
12
12
  import * as We from "react";
13
- import { useRef as ye, useMemo as st, useCallback as le, useSyncExternalStore as Jt, useEffect as X, createContext as Yt, memo as Bt, useContext as Xt, useState as xt } from "react";
14
- import { distinctUntilChanged as Q, tap as E, catchError as B, EMPTY as Me, isObservable as pt, from as ge, of as S, defer as Ae, Subject as I, BehaviorSubject as J, skip as nt, first as Ge, map as g, switchMap as x, zip as Zt, mergeMap as T, merge as C, filter as O, throttleTime as er, asyncScheduler as tr, throwError as Se, timer as Qe, Observable as rr, takeWhile as Je, concatMap as sr, last as Ke, takeUntil as Z, identity as Rt, scan as it, shareReplay as Ue, ignoreElements as he, fromEvent as Ne, noop as N, startWith as oe, pairwise as jt, NEVER as Oe, delay as ut, interval as nr, withLatestFrom as bt, retry as ir, iif as ur, concat as Te, toArray as ke, share as fe, take as He, combineLatest as ar, endWith as cr, lastValueFrom as or } from "rxjs";
15
- import { catchError as yt, mergeMap as Ze, retryWhen as lr, concatMap as hr, first as fr, tap as Mt } from "rxjs/operators";
16
- import { jsxs as dr, jsx as pr } from "react/jsx-runtime";
17
- const H = (r) => {
18
- const e = ye(r);
19
- return st(() => {
20
- e.current = r;
21
- }, [r]), e;
13
+ import { useRef as ye, useMemo as it, useCallback as ce, useSyncExternalStore as Bt, useEffect as X, createContext as Xt, memo as Zt, useContext as es, useState as Rt } from "react";
14
+ import { distinctUntilChanged as Q, tap as E, catchError as B, EMPTY as je, isObservable as bt, from as ge, of as v, defer as Me, Subject as I, BehaviorSubject as J, skip as ut, first as Ge, map as g, switchMap as x, zip as ts, mergeMap as k, merge as F, filter as O, throttleTime as ss, asyncScheduler as rs, throwError as Se, timer as Ae, Observable as ns, takeWhile as Je, concatMap as is, last as Te, takeUntil as re, identity as jt, shareReplay as Qe, ignoreElements as le, scan as Ye, fromEvent as Ke, noop as N, startWith as oe, pairwise as Mt, NEVER as Ne, delay as at, interval as us, withLatestFrom as yt, retry as as, iif as os, concat as De, toArray as ke, share as he, take as qe, combineLatest as cs, endWith as ls, lastValueFrom as hs } from "rxjs";
15
+ import { catchError as gt, mergeMap as et, retryWhen as ds, concatMap as fs, first as ps, tap as At } from "rxjs/operators";
16
+ import { jsxs as bs, jsx as ys } from "react/jsx-runtime";
17
+ const q = (s) => {
18
+ const e = ye(s);
19
+ return it(() => {
20
+ e.current = s;
21
+ }, [s]), e;
22
22
  };
23
- function br(r, e) {
24
- return typeof r == "string" && r === e || typeof r == "number" && r === e || typeof r == "boolean" && r === e || typeof r == "symbol" && r === e || typeof r == "bigint" && r === e || typeof r > "u" && r === e || r === null && r === e;
23
+ function gs(s, e) {
24
+ return typeof s == "string" && s === e || typeof s == "number" && s === e || typeof s == "boolean" && s === e || typeof s == "symbol" && s === e || typeof s == "bigint" && s === e || typeof s > "u" && s === e || s === null && s === e;
25
25
  }
26
- function Ye(r, e, t) {
27
- const s = e != null && !Array.isArray(e) ? e : {
26
+ function Be(s, e, t) {
27
+ const r = e != null && !Array.isArray(e) ? e : {
28
28
  defaultValue: void 0,
29
29
  unsubscribeOnUnmount: !0
30
- }, n = !t && Array.isArray(e) ? e : typeof r == "function" ? t ?? [] : [r], u = ye(
31
- "getValue" in r && typeof r.getValue == "function" ? r.getValue() : s.defaultValue
32
- ), i = H(r), l = H(s), f = le(
33
- (d) => {
34
- const c = i.current, F = (typeof c == "function" ? c : () => c)().pipe(
30
+ }, n = !t && Array.isArray(e) ? e : typeof s == "function" ? t ?? [] : [s], u = ye(
31
+ "getValue" in s && typeof s.getValue == "function" ? s.getValue() : r.defaultValue
32
+ ), i = q(s), c = q(r), l = ce(
33
+ (p) => {
34
+ const d = i.current, b = (typeof d == "function" ? d : () => d)().pipe(
35
35
  /**
36
36
  * @important
37
37
  * We only check primitives because underlying subscription might
38
38
  * be using objects and keeping same reference but pushing new
39
39
  * properties values
40
40
  */
41
- Q(br),
42
- E((p) => {
43
- u.current = p;
41
+ Q(gs),
42
+ E((y) => {
43
+ u.current = y;
44
44
  }),
45
- B((p) => (console.error(p), Me))
46
- ).subscribe(d);
45
+ B((y) => (console.error(y), je))
46
+ ).subscribe(p);
47
47
  return () => {
48
- l.current.unsubscribeOnUnmount !== !1 && F.unsubscribe();
48
+ c.current.unsubscribeOnUnmount !== !1 && b.unsubscribe();
49
49
  };
50
50
  },
51
51
  // eslint-disable-next-line react-hooks/exhaustive-deps
52
52
  [...n]
53
- ), h = le(() => u.current, []);
54
- return Jt(f, h, h);
53
+ ), h = ce(() => u.current, []);
54
+ return Bt(l, h, h);
55
55
  }
56
- function gt(r) {
57
- return r instanceof Promise || r && typeof r.then == "function" && typeof r.catch == "function";
56
+ function mt(s) {
57
+ return s instanceof Promise || s && typeof s.then == "function" && typeof s.catch == "function";
58
58
  }
59
- function U(r) {
60
- if (pt(r))
61
- return r;
62
- if (gt(r))
63
- return ge(r);
64
- if (typeof r != "function")
65
- return S(r);
66
- const e = r;
67
- return Ae(() => {
59
+ function U(s) {
60
+ if (bt(s))
61
+ return s;
62
+ if (mt(s))
63
+ return ge(s);
64
+ if (typeof s != "function")
65
+ return v(s);
66
+ const e = s;
67
+ return Me(() => {
68
68
  const t = e();
69
- return gt(t) ? ge(t) : pt(t) ? t : S(t);
69
+ return mt(t) ? ge(t) : bt(t) ? t : v(t);
70
70
  });
71
71
  }
72
- function At(r, e = []) {
73
- const t = H(r);
72
+ function Qt(s, e = []) {
73
+ const t = q(s);
74
74
  X(() => {
75
- const s = U(t.current).subscribe();
75
+ const r = U(t.current).subscribe();
76
76
  return () => {
77
- s.unsubscribe();
77
+ r.unsubscribe();
78
78
  };
79
79
  }, [
80
80
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -82,136 +82,136 @@ function At(r, e = []) {
82
82
  t
83
83
  ]);
84
84
  }
85
- const Be = (r) => {
85
+ const Xe = (s) => {
86
86
  const e = ye();
87
- return e.current || (e.current = r()), X(() => {
87
+ return e.current || (e.current = s()), X(() => {
88
88
  process.env.NODE_ENV;
89
89
  }, []), e;
90
- }, Qt = ({
91
- onBeforeComplete: r,
90
+ }, Ut = ({
91
+ onBeforeComplete: s,
92
92
  completeOnUnmount: e = !0
93
93
  } = {}) => {
94
- const t = Be(() => new I()), s = ye(!1), n = H(r), u = H(e);
95
- return X(() => (s.current && (t.current = new I(), s.current = !1), () => {
94
+ const t = Xe(() => new I()), r = ye(!1), n = q(s), u = q(e);
95
+ return X(() => (r.current && (t.current = new I(), r.current = !1), () => {
96
96
  if (!u.current) {
97
- s.current = !0;
97
+ r.current = !0;
98
98
  return;
99
99
  }
100
- s.current || (n.current != null && n.current(), t.current.complete(), s.current = !0);
100
+ r.current || (n.current != null && n.current(), t.current.complete(), r.current = !0);
101
101
  }), [u, n, t]), t;
102
- }, hs = () => {
103
- const r = Qt(), e = H(r.current.asObservable()), t = le(
104
- (s) => {
105
- r.current.next(s);
102
+ }, fr = () => {
103
+ const s = Ut(), e = q(s.current.asObservable()), t = ce(
104
+ (r) => {
105
+ s.current.next(r);
106
106
  },
107
107
  // eslint-disable-next-line react-hooks/exhaustive-deps
108
108
  []
109
109
  );
110
110
  return [e.current, t];
111
- }, Ut = (r) => {
112
- const e = Be(() => new J(r)), t = ye(!1), s = ye(r);
113
- return X(() => (t.current && (e.current = new J(s.current), t.current = !1), () => {
111
+ }, It = (s) => {
112
+ const e = Xe(() => new J(s)), t = ye(!1), r = ye(s);
113
+ return X(() => (t.current && (e.current = new J(r.current), t.current = !1), () => {
114
114
  t.current || (e.current.complete(), t.current = !0);
115
115
  }), [e]), e;
116
- }, fs = (r) => {
117
- const e = Ut(r), t = H(e.current.asObservable()), s = le(
116
+ }, pr = (s) => {
117
+ const e = It(s), t = q(e.current.asObservable()), r = ce(
118
118
  (n) => {
119
119
  e.current.next(n);
120
120
  },
121
121
  // eslint-disable-next-line react-hooks/exhaustive-deps
122
122
  [e.current]
123
123
  );
124
- return [t.current, s, e.current.getValue()];
125
- }, yr = Symbol("SIGNAL_RESET");
126
- function ds(r = {}) {
124
+ return [t.current, r, e.current.getValue()];
125
+ }, ms = Symbol("SIGNAL_RESET");
126
+ function br(s = {}) {
127
127
  const e = {
128
- default: r.default,
129
- key: r.key
130
- }, { default: t } = e ?? {}, s = new J(t), n = (i) => {
128
+ default: s.default,
129
+ key: s.key
130
+ }, { default: t } = e ?? {}, r = new J(t), n = (i) => {
131
131
  if (typeof i == "function") {
132
- const l = i(s.getValue());
133
- if (l === s.getValue())
132
+ const c = i(r.getValue());
133
+ if (c === r.getValue())
134
134
  return;
135
- s.next(l);
135
+ r.next(c);
136
136
  return;
137
137
  }
138
- if (i === yr) {
139
- s.next(t ?? void 0);
138
+ if (i === ms) {
139
+ r.next(t ?? void 0);
140
140
  return;
141
141
  }
142
- s.next(i);
143
- }, u = () => s.getValue();
144
- if ("get" in r) {
145
- const i = (f) => (f.subject.pipe(nt(1), Ge()).subscribe(() => {
142
+ r.next(i);
143
+ }, u = () => r.getValue();
144
+ if ("get" in s) {
145
+ const i = (l) => (l.subject.pipe(ut(1), Ge()).subscribe(() => {
146
146
  var o;
147
- const h = (o = r.get) == null ? void 0 : o.call(r, i);
147
+ const h = (o = s.get) == null ? void 0 : o.call(s, i);
148
148
  n(h);
149
- }), f.getValue()), l = r.get(i);
150
- return n(l), {
149
+ }), l.getValue()), c = s.get(i);
150
+ return n(c), {
151
151
  getValue: u,
152
- config: r,
153
- subject: s
152
+ config: s,
153
+ subject: r
154
154
  };
155
155
  }
156
156
  return {
157
157
  setValue: n,
158
158
  getValue: u,
159
159
  config: e,
160
- subject: s
160
+ subject: r
161
161
  };
162
162
  }
163
- function ps(r, e) {
164
- const s = e ?? (() => r.getValue());
165
- return Ye(
166
- () => r.subject.pipe(
167
- g((u) => s(u)),
163
+ function yr(s, e) {
164
+ const r = e ?? (() => s.getValue());
165
+ return Be(
166
+ () => s.subject.pipe(
167
+ g((u) => r(u)),
168
168
  Q()
169
169
  ),
170
170
  {
171
- defaultValue: s(r.getValue())
171
+ defaultValue: r(s.getValue())
172
172
  },
173
173
  []
174
174
  );
175
175
  }
176
- const bs = (r) => ({
176
+ const gr = (s) => ({
177
177
  getItem: async (e) => {
178
- const t = await r.getItem(e);
178
+ const t = await s.getItem(e);
179
179
  if (t)
180
180
  return JSON.parse(t);
181
181
  },
182
182
  setItem: async (e, t) => {
183
- await r.setItem(e, JSON.stringify(t));
183
+ await s.setItem(e, JSON.stringify(t));
184
184
  },
185
185
  removeItem: async (e) => {
186
186
  },
187
187
  clear: async () => {
188
188
  }
189
- }), et = (r) => {
190
- if (!(!r || typeof r != "object"))
191
- return r;
192
- }, gr = ({
193
- adapter: r,
189
+ }), tt = (s) => {
190
+ if (!(!s || typeof s != "object"))
191
+ return s;
192
+ }, Ss = ({
193
+ adapter: s,
194
194
  key: e
195
195
  }) => ({
196
- clear: async () => await r.removeItem(e),
196
+ clear: async () => await s.removeItem(e),
197
197
  removeItem: async (t) => {
198
- const s = await r.getItem(e), { [t]: n, ...u } = et(s) ?? {};
199
- await r.setItem(e, u);
198
+ const r = await s.getItem(e), { [t]: n, ...u } = tt(r) ?? {};
199
+ await s.setItem(e, u);
200
200
  },
201
201
  getItem: async (t) => {
202
- const s = await r.getItem(e), n = et(s) ?? {};
202
+ const r = await s.getItem(e), n = tt(r) ?? {};
203
203
  if (t in n)
204
204
  return n[t];
205
205
  },
206
- setItem: async (t, s) => {
207
- const n = await r.getItem(e), u = et(n) ?? {};
208
- await r.setItem(e, { ...u, [t]: s });
209
- }
210
- }), mr = ({
211
- key: r
212
- } = {}) => r ? gr({
213
- adapter: mr(),
214
- key: r
206
+ setItem: async (t, r) => {
207
+ const n = await s.getItem(e), u = tt(n) ?? {};
208
+ await s.setItem(e, { ...u, [t]: r });
209
+ }
210
+ }), vs = ({
211
+ key: s
212
+ } = {}) => s ? Ss({
213
+ adapter: vs(),
214
+ key: s
215
215
  }) : {
216
216
  clear: async () => {
217
217
  localStorage.clear();
@@ -227,20 +227,20 @@ const bs = (r) => ({
227
227
  setItem: async (e, t) => {
228
228
  localStorage.setItem(e, JSON.stringify(t));
229
229
  }
230
- }, ve = "__reactjrx", Sr = (r) => {
231
- if (typeof r == "object" && r !== null && ve in r && r[ve] === ve)
232
- return r;
230
+ }, ve = "__reactjrx", Os = (s) => {
231
+ if (typeof s == "object" && s !== null && ve in s && s[ve] === ve)
232
+ return s;
233
233
  };
234
- function tt(r) {
235
- return r != null;
234
+ function st(s) {
235
+ return s != null;
236
236
  }
237
- const mt = (r) => {
238
- const e = Ut(r);
237
+ const St = (s) => {
238
+ const e = It(s);
239
239
  return X(() => {
240
- e.current.next(r);
241
- }, [r, e]), e;
242
- }, St = ({
243
- adapter: r,
240
+ e.current.next(s);
241
+ }, [s, e]), e;
242
+ }, vt = ({
243
+ adapter: s,
244
244
  signal: e,
245
245
  version: t
246
246
  }) => {
@@ -249,74 +249,74 @@ const mt = (r) => {
249
249
  [ve]: ve,
250
250
  migrationVersion: t
251
251
  };
252
- return ge(r.setItem(e.config.key, n)).pipe(
253
- B((u) => (console.error(u), S(null)))
252
+ return ge(s.setItem(e.config.key, n)).pipe(
253
+ B((u) => (console.error(u), v(null)))
254
254
  );
255
- }, vr = ({
256
- adapter: r,
255
+ }, $s = ({
256
+ adapter: s,
257
257
  version: e,
258
258
  signal: t
259
- }) => ge(r.getItem(t.config.key)).pipe(
260
- x((s) => {
261
- const n = Sr(s);
262
- return n ? n.migrationVersion !== void 0 && e > n.migrationVersion ? S(s) : (t.setValue(n.value), S(s)) : S(s);
259
+ }) => ge(s.getItem(t.config.key)).pipe(
260
+ x((r) => {
261
+ const n = Os(r);
262
+ return n ? n.migrationVersion !== void 0 && e > n.migrationVersion ? v(r) : (t.setValue(n.value), v(r)) : v(r);
263
263
  })
264
- ), ys = ({
265
- entries: r = [],
264
+ ), mr = ({
265
+ entries: s = [],
266
266
  onReady: e,
267
267
  adapter: t
268
268
  }) => {
269
- const s = H(r), n = H(e), u = mt(t), i = Ye(
269
+ const r = q(s), n = q(e), u = St(t), i = Be(
270
270
  () => {
271
- const f = s.current;
271
+ const l = r.current;
272
272
  return u.current.pipe(
273
273
  x((h) => {
274
274
  if (!h)
275
- return S(!1);
276
- const o = f.length === 0 ? S(!0) : Zt(
277
- ...f.map(
278
- ({ signal: d, version: c }) => vr({
275
+ return v(!1);
276
+ const o = l.length === 0 ? v(!0) : ts(
277
+ ...l.map(
278
+ ({ signal: p, version: d }) => $s({
279
279
  adapter: h,
280
- signal: d,
281
- version: c
280
+ signal: p,
281
+ version: d
282
282
  }).pipe(
283
- T(
284
- () => St({
283
+ k(
284
+ () => vt({
285
285
  adapter: h,
286
- signal: d,
287
- version: c
286
+ signal: p,
287
+ version: d
288
288
  })
289
289
  )
290
290
  )
291
291
  )
292
292
  ).pipe(g(() => !0));
293
- return C(S(!1), o).pipe(
293
+ return F(v(!1), o).pipe(
294
294
  E(() => {
295
295
  n.current != null && n.current();
296
296
  }),
297
- B((d) => (console.error("Unable to hydrate", d), Me))
297
+ B((p) => (console.error("Unable to hydrate", p), je))
298
298
  );
299
299
  })
300
300
  );
301
301
  },
302
302
  { defaultValue: !1 },
303
- [u, s]
304
- ), l = mt(i);
305
- return At(
306
- () => l.current.pipe(
307
- O((f) => f),
303
+ [u, r]
304
+ ), c = St(i);
305
+ return Qt(
306
+ () => c.current.pipe(
307
+ O((l) => l),
308
308
  x(() => u.current),
309
- O(tt),
309
+ O(st),
310
310
  x(
311
- (f) => C(
312
- ...s.current.map(
311
+ (l) => F(
312
+ ...r.current.map(
313
313
  ({ signal: h, version: o }) => h.subject.pipe(
314
- er(500, tr, {
314
+ ss(500, rs, {
315
315
  trailing: !0
316
316
  }),
317
317
  x(() => ge(
318
- St({
319
- adapter: f,
318
+ vt({
319
+ adapter: l,
320
320
  signal: h,
321
321
  version: o
322
322
  })
@@ -326,104 +326,104 @@ const mt = (r) => {
326
326
  )
327
327
  )
328
328
  ),
329
- [l, u]
329
+ [c, u]
330
330
  ), { isHydrated: i };
331
- }, gs = () => {
332
- const r = Qt({
331
+ }, Sr = () => {
332
+ const s = Ut({
333
333
  onBeforeComplete: () => {
334
- r.current.next();
334
+ s.current.next();
335
335
  }
336
336
  });
337
- return r;
337
+ return s;
338
338
  };
339
- function Or(r, e) {
340
- return Math.min(r, e);
339
+ function ws(s, e) {
340
+ return Math.min(s, e);
341
341
  }
342
- function $r(r, e) {
343
- return Math.pow(2, r) * e;
342
+ function Cs(s, e) {
343
+ return Math.pow(2, s) * e;
344
344
  }
345
- function It(r) {
345
+ function Vt(s) {
346
346
  const {
347
347
  retry: e,
348
348
  retryDelay: t,
349
- retryAfterDelay: s,
350
- retryAfter: n = () => S(!0)
351
- } = r, u = typeof e != "function" ? e === !1 ? 0 : e === !0 ? 1 / 0 : e ?? 1 / 0 : 1 / 0, i = typeof e == "function" ? (
349
+ retryAfterDelay: r,
350
+ retryAfter: n = () => v(!0)
351
+ } = s, u = typeof e != "function" ? e === !1 ? 0 : e === !0 ? 1 / 0 : e ?? 1 / 0 : 1 / 0, i = typeof e == "function" ? (
352
352
  // ? (attempt: number, error: TError) => of(retry(attempt, error))
353
353
  e
354
- ) : () => !0, l = typeof t == "number" ? t : 100, f = {
354
+ ) : () => !0, c = typeof t == "number" ? t : 100, l = {
355
355
  shouldRetry: i,
356
- ...r
356
+ ...s
357
357
  }, {
358
358
  maxInterval: h = 1 / 0,
359
359
  resetOnSuccess: o = !1,
360
- backoffDelay: d = $r
361
- } = f;
362
- return (c) => Ae(() => {
363
- let y = 0;
364
- const F = (p, v) => p < u ? i(p, v) : !1;
365
- return c.pipe(
366
- yt((p) => {
367
- var $;
368
- if (y++, !F(y - 1, p))
369
- throw p;
370
- const v = ($ = r.caughtError) == null ? void 0 : $.call(r, y, p);
371
- if (!v)
372
- throw p;
373
- return v.pipe(
374
- Ze(
375
- (q) => C(
376
- S(q),
377
- Se(() => p)
360
+ backoffDelay: p = Cs
361
+ } = l;
362
+ return (d) => Me(() => {
363
+ let f = 0;
364
+ const b = (y, $) => y < u ? i(y, $) : !1;
365
+ return d.pipe(
366
+ gt((y) => {
367
+ var w;
368
+ if (f++, !b(f - 1, y))
369
+ throw y;
370
+ const $ = (w = s.caughtError) == null ? void 0 : w.call(s, f, y);
371
+ if (!$)
372
+ throw y;
373
+ return $.pipe(
374
+ et(
375
+ (H) => F(
376
+ v(H),
377
+ Se(() => y)
378
378
  )
379
379
  )
380
380
  );
381
381
  }),
382
- lr((p) => p.pipe(
383
- hr((v) => {
384
- const $ = y - 1;
382
+ ds((y) => y.pipe(
383
+ fs(($) => {
384
+ const w = f - 1;
385
385
  return n().pipe(
386
- fr(),
387
- Ze(
388
- () => F($, v) ? Qe(
389
- Or(
390
- d($, l),
386
+ ps(),
387
+ et(
388
+ () => b(w, $) ? Ae(
389
+ ws(
390
+ p(w, c),
391
391
  h
392
392
  )
393
393
  ).pipe(
394
- Ze((q) => s && !s($, v) ? Se(() => v) : S(q))
395
- ) : Se(() => v)
394
+ et((H) => r && !r(w, $) ? Se(() => $) : v(H))
395
+ ) : Se(() => $)
396
396
  )
397
397
  );
398
398
  })
399
399
  )),
400
- yt((p) => {
401
- if (r.catchError)
402
- return r.catchError(y, p);
403
- throw p;
400
+ gt((y) => {
401
+ if (s.catchError)
402
+ return s.catchError(f, y);
403
+ throw y;
404
404
  }),
405
- Mt(() => {
406
- o && (y = 0);
405
+ At(() => {
406
+ o && (f = 0);
407
407
  })
408
408
  );
409
409
  });
410
410
  }
411
- function vt(r) {
412
- return Object.prototype.toString.call(r) === "[object Object]";
411
+ function Ot(s) {
412
+ return Object.prototype.toString.call(s) === "[object Object]";
413
413
  }
414
- function rt(r) {
415
- if (!vt(r))
414
+ function rt(s) {
415
+ if (!Ot(s))
416
416
  return !1;
417
- const e = r.constructor;
417
+ const e = s.constructor;
418
418
  if (typeof e > "u")
419
419
  return !0;
420
420
  const t = e.prototype;
421
- return !(!vt(t) || !t.hasOwnProperty("isPrototypeOf"));
421
+ return !(!Ot(t) || !t.hasOwnProperty("isPrototypeOf"));
422
422
  }
423
- const me = (r) => JSON.stringify(
424
- r,
425
- (e, t) => rt(t) ? Object.keys(t).sort().reduce((s, n) => (s[n] = t[n], s), {}) : t
426
- ), at = (r = 21) => crypto.getRandomValues(new Uint8Array(r)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += "-" : e += "_", e), ""), ne = () => ({
423
+ const me = (s) => JSON.stringify(
424
+ s,
425
+ (e, t) => rt(t) ? Object.keys(t).sort().reduce((r, n) => (r[n] = t[n], r), {}) : t
426
+ ), ot = (s = 21) => crypto.getRandomValues(new Uint8Array(s)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += "-" : e += "_", e), ""), de = () => ({
427
427
  context: void 0,
428
428
  data: void 0,
429
429
  error: null,
@@ -434,97 +434,72 @@ const me = (r) => JSON.stringify(
434
434
  failureReason: null,
435
435
  isPaused: !1
436
436
  });
437
- function V(r, e) {
438
- if (r == null || e === void 0 || typeof r != "object" || typeof e != "object")
439
- return r === e;
440
- if (r.constructor !== (e == null ? void 0 : e.constructor))
441
- return !1;
442
- const t = Object.keys(r), s = Object.keys(e);
443
- if (t.length !== s.length)
444
- return !1;
445
- for (const n of t)
446
- if (!e.hasOwnProperty(n) || r[n] !== e[n])
447
- return !1;
448
- return !0;
449
- }
450
- function ct(r) {
437
+ function ct(s) {
451
438
  let e = 0;
452
- return function(s) {
453
- return new rr((n) => {
439
+ return function(r) {
440
+ return new ns((n) => {
454
441
  e++;
455
- const u = s.subscribe(n);
456
- return r(e), () => {
457
- e--, r(e), u.unsubscribe();
442
+ const u = r.subscribe(n);
443
+ return s(e), () => {
444
+ e--, s(e), u.unsubscribe();
458
445
  };
459
446
  });
460
447
  };
461
448
  }
462
- const $e = (r) => r.pipe(
449
+ const Oe = (s) => s.pipe(
463
450
  Je(
464
451
  (e) => e.status !== "error" && e.status !== "success",
465
452
  !0
466
453
  )
467
454
  );
468
- var ee;
469
- class wr {
455
+ var Z;
456
+ class Fs {
470
457
  constructor({
471
458
  __queryFinalizeHook: e
472
459
  } = {}) {
473
- w(this, ee, new I());
474
- b(this, "state$");
475
- const t = new J(0), s = t.pipe(
460
+ C(this, Z, new I());
461
+ m(this, "state$");
462
+ const t = new J(0), r = t.pipe(
476
463
  O((n) => n === 0)
477
464
  );
478
- this.state$ = a(this, ee).pipe(
479
- sr(({ args: n, mutation: u, options: i }) => {
480
- const l = i.mapOperator ?? "merge", f = a(this, ee).pipe(
481
- O(() => l === "merge")
482
- ), h = a(this, ee).pipe(
483
- O(() => l === "switch"),
465
+ this.state$ = a(this, Z).pipe(
466
+ is(({ args: n, mutation: u, options: i }) => {
467
+ const c = i.mapOperator ?? "merge", l = a(this, Z).pipe(
468
+ O(() => c === "merge")
469
+ ), h = a(this, Z).pipe(
470
+ O(() => c === "switch"),
484
471
  E(() => {
485
472
  u.cancel();
486
473
  })
487
- ), o = Ae(() => (u.execute(n), Me)), d = u.state$.pipe(
488
- $e,
489
- Ke(),
490
- T(() => u.state$),
491
- Z(a(this, ee))
492
- ), c = u.state$.pipe(
493
- $e,
494
- nt(1)
495
- ), y = C(
496
- s,
497
- f,
474
+ ), o = Me(() => (u.execute(n), je)), p = u.state$.pipe(
475
+ Oe,
476
+ Te(),
477
+ k(() => u.state$),
478
+ re(a(this, Z))
479
+ ), d = u.state$.pipe(
480
+ Oe,
481
+ ut(1)
482
+ ), f = F(
483
+ r,
484
+ l,
498
485
  h,
499
486
  u.cancelled$
500
487
  );
501
- return C(
502
- c,
488
+ return F(
503
489
  d,
490
+ p,
504
491
  /**
505
492
  * We defer execution so that we return at least
506
493
  * the current state first (same mechanism is used for query)
507
494
  */
508
495
  o
509
496
  ).pipe(
510
- e ?? Rt,
511
- Z(y)
497
+ g((b) => ({ state: b, mutation: u })),
498
+ e ?? jt,
499
+ re(f)
512
500
  );
513
501
  }),
514
- it((n, u) => ({
515
- ...n,
516
- ...u,
517
- ...u.status === "pending" && {
518
- data: u.data ?? n.data
519
- },
520
- ...u.status === "pending" && {
521
- error: u.error ?? n.error
522
- }
523
- }), ne()),
524
- Q(
525
- ({ data: n, ...u }, { data: i, ...l }) => V(u, l) && V(n, i)
526
- ),
527
- Ue({
502
+ Qe({
528
503
  refCount: !0,
529
504
  bufferSize: 1
530
505
  }),
@@ -536,30 +511,48 @@ class wr {
536
511
  trigger({
537
512
  args: e,
538
513
  options: t,
539
- mutation: s
514
+ mutation: r
540
515
  }) {
541
- a(this, ee).next({ args: e, options: t, mutation: s });
516
+ a(this, Z).next({ args: e, options: t, mutation: r });
542
517
  }
543
518
  }
544
- ee = new WeakMap();
545
- function Xe(r, e) {
546
- return r === e ? !0 : typeof r != typeof e ? !1 : r && e && typeof r == "object" && typeof e == "object" ? !Object.keys(e).some((t) => !Xe(r[t], e[t])) : !1;
519
+ Z = new WeakMap();
520
+ function Ze(s, e) {
521
+ return s === e ? !0 : typeof s != typeof e ? !1 : s && e && typeof s == "object" && typeof e == "object" ? !Object.keys(e).some((t) => !Ze(s[t], e[t])) : !1;
522
+ }
523
+ const He = (s, e, { exact: t = !1 } = {}) => t ? me(s) === me(e) : Ze(s, e);
524
+ function V(s, e) {
525
+ if (s == null || e === void 0 || typeof s != "object" || typeof e != "object")
526
+ return s === e;
527
+ if (s.constructor !== (e == null ? void 0 : e.constructor))
528
+ return !1;
529
+ const t = Object.keys(s), r = Object.keys(e);
530
+ if (t.length !== r.length)
531
+ return !1;
532
+ for (const n of t)
533
+ if (!e.hasOwnProperty(n) || s[n] !== e[n])
534
+ return !1;
535
+ return !0;
547
536
  }
548
- const qe = (r, e, { exact: t = !1 } = {}) => t ? me(r) === me(e) : Xe(r, e);
549
- var ie, _;
550
- class Cr {
551
- constructor(e, t = {}, s) {
552
- w(this, ie, void 0);
553
- w(this, _, new J(void 0));
537
+ const Pt = (s) => s.pipe(
538
+ Q(
539
+ ({ data: e, ...t }, { data: r, ...n }) => V(t, n) && V(e, r)
540
+ )
541
+ );
542
+ var ne, L;
543
+ class Es {
544
+ constructor(e, t = {}, r) {
545
+ C(this, ne, void 0);
546
+ C(this, L, new J(void 0));
554
547
  /**
555
548
  * @important
556
549
  * Used to maintain persistance to latest mutation. This ensure
557
550
  * - mutation does not get garbage collected
558
551
  * - mutation mutate options are run on finish
559
552
  */
560
- b(this, "observed$");
561
- b(this, "getObserverResultFromState", (e) => ({
562
- ...ne(),
553
+ m(this, "observed$");
554
+ m(this, "getObserverResultFromState", (e) => ({
555
+ ...de(),
563
556
  ...e,
564
557
  isSuccess: e.status === "success",
565
558
  isPending: e.status === "pending",
@@ -571,23 +564,23 @@ class Cr {
571
564
  reset: this.reset
572
565
  }));
573
566
  var n;
574
- this.client = e, this.options = t, this.options.mutationKey = ((n = this.options) == null ? void 0 : n.mutationKey) ?? [at()], M(this, ie, s ?? new wr(this.options)), this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this), a(this, _).pipe(
575
- O(tt),
576
- T(
577
- (u) => a(this, ie).state$.pipe(
578
- Z(
579
- u.mutation.state$.pipe($e, Ke())
567
+ this.client = e, this.options = t, this.options.mutationKey = ((n = this.options) == null ? void 0 : n.mutationKey) ?? [ot()], M(this, ne, r ?? new Fs(this.options)), this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this), a(this, L).pipe(
568
+ O(st),
569
+ k(
570
+ (u) => a(this, ne).state$.pipe(
571
+ re(
572
+ u.mutation.state$.pipe(Oe, Te())
580
573
  )
581
574
  )
582
575
  )
583
- ).subscribe(), this.observed$ = a(this, _).pipe(
576
+ ).subscribe(), this.observed$ = a(this, L).pipe(
584
577
  x((u) => (u == null ? void 0 : u.mutation.state$.pipe(
585
578
  // last(),
586
579
  g((i) => ({
587
580
  state: i,
588
581
  options: u.options
589
582
  }))
590
- )) ?? Me),
583
+ )) ?? je),
591
584
  E(({ state: u, options: i }) => {
592
585
  u.status === "error" && (i != null && i.onError && (i == null || i.onError(
593
586
  u.error,
@@ -609,7 +602,7 @@ class Cr {
609
602
  u.context
610
603
  )));
611
604
  }),
612
- he()
605
+ le()
613
606
  );
614
607
  }
615
608
  setOptions(e) {
@@ -619,48 +612,62 @@ class Cr {
619
612
  mutationKey: this.options.mutationKey,
620
613
  ...e
621
614
  });
622
- const s = (n = a(this, _).getValue()) == null ? void 0 : n.mutation;
623
- this.options.mutationKey && t.mutationKey && !qe(this.options.mutationKey, t.mutationKey, {
615
+ const r = (n = a(this, L).getValue()) == null ? void 0 : n.mutation;
616
+ this.options.mutationKey && t.mutationKey && !He(this.options.mutationKey, t.mutationKey, {
624
617
  exact: !0
625
- }) ? this.reset() : s == null || s.setOptions(this.options);
618
+ }) ? this.reset() : r == null || r.setOptions(this.options);
626
619
  }
627
620
  observe() {
628
621
  var u;
629
622
  const e = this.getObserverResultFromState(
630
- ((u = a(this, _).getValue()) == null ? void 0 : u.mutation.state) ?? ne()
631
- ), t = a(this, ie).state$.pipe(
623
+ ((u = a(this, L).getValue()) == null ? void 0 : u.mutation.state) ?? de()
624
+ ), t = a(this, ne).state$.pipe(
625
+ Q(
626
+ ({ mutation: i, state: { data: c, ...l } }, { mutation: h, state: { data: o, ...p } }) => i === h && V(l, p) && V(c, o)
627
+ ),
628
+ g(({ state: i }) => i),
629
+ Ye((i, c) => ({
630
+ ...i,
631
+ ...c,
632
+ ...c.status === "pending" && {
633
+ data: c.data ?? i.data
634
+ },
635
+ ...c.status === "pending" && {
636
+ error: c.error ?? i.error
637
+ }
638
+ })),
632
639
  g((i) => this.getObserverResultFromState(i))
633
- ), s = a(this, _).pipe(
634
- O(tt),
640
+ ), r = a(this, L).pipe(
641
+ O(st),
635
642
  x((i) => i.mutation.cancelled$),
636
- g(() => this.getObserverResultFromState(ne()))
643
+ g(() => this.getObserverResultFromState(de()))
637
644
  );
638
- return { result$: C(
645
+ return { result$: F(
639
646
  this.observed$,
640
647
  t,
641
- s
642
- ), lastValue: e };
648
+ r
649
+ ).pipe(Pt), lastValue: e };
643
650
  }
644
651
  /**
645
652
  * @important
646
653
  * Compliance react-query only
647
654
  */
648
655
  subscribe(e) {
649
- const t = this.observe().result$.subscribe((s) => {
650
- e(s);
656
+ const t = this.observe().result$.subscribe((r) => {
657
+ e(r);
651
658
  });
652
659
  return () => {
653
660
  t.unsubscribe();
654
661
  };
655
662
  }
656
663
  async mutate(e, t = {}) {
657
- const s = this.client.getMutationCache().build(this.client, this.options);
658
- return a(this, _).next({ mutation: s, options: t }), a(this, ie).trigger({
664
+ const r = this.client.getMutationCache().build(this.client, this.options);
665
+ return a(this, L).next({ mutation: r, options: t }), a(this, ne).trigger({
659
666
  args: e,
660
667
  options: this.options,
661
- mutation: s
668
+ mutation: r
662
669
  }), await new Promise((n, u) => {
663
- s.state$.pipe($e, Ke()).subscribe({
670
+ r.state$.pipe(Oe, Te()).subscribe({
664
671
  error: (i) => {
665
672
  u(i);
666
673
  },
@@ -674,74 +681,74 @@ class Cr {
674
681
  var t;
675
682
  const e = this.client.getMutationCache().find({ exact: !0, mutationKey: (t = this.options) == null ? void 0 : t.mutationKey });
676
683
  return this.getObserverResultFromState(
677
- (e == null ? void 0 : e.state) ?? ne()
684
+ (e == null ? void 0 : e.state) ?? de()
678
685
  );
679
686
  }
680
687
  reset() {
681
- const { mutation: e } = a(this, _).getValue() ?? {};
682
- a(this, _).next(void 0), e == null || e.cancel();
688
+ const { mutation: e } = a(this, L).getValue() ?? {};
689
+ a(this, L).next(void 0), e == null || e.cancel();
683
690
  }
684
691
  }
685
- ie = new WeakMap(), _ = new WeakMap();
686
- const Vt = Yt(void 0), Fr = ({ client: r }) => (X(() => (r.mount(), () => {
687
- r.unmount();
688
- }), [r]), null), ms = Bt(
689
- ({ children: r, client: e }) => {
690
- const t = st(() => e, [e]);
691
- return /* @__PURE__ */ dr(Vt.Provider, { value: t, children: [
692
- /* @__PURE__ */ pr(Fr, { client: e }),
693
- r
692
+ ne = new WeakMap(), L = new WeakMap();
693
+ const Dt = Xt(void 0), xs = ({ client: s }) => (X(() => (s.mount(), () => {
694
+ s.unmount();
695
+ }), [s]), null), vr = Zt(
696
+ ({ children: s, client: e }) => {
697
+ const t = it(() => e, [e]);
698
+ return /* @__PURE__ */ bs(Dt.Provider, { value: t, children: [
699
+ /* @__PURE__ */ ys(xs, { client: e }),
700
+ s
694
701
  ] });
695
702
  }
696
- ), Pt = (r) => {
697
- const e = Xt(Vt);
698
- if (r)
699
- return r;
703
+ ), kt = (s) => {
704
+ const e = es(Dt);
705
+ if (s)
706
+ return s;
700
707
  if (!e)
701
708
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
702
709
  return e;
703
710
  };
704
- function Er() {
711
+ function Rs() {
705
712
  }
706
- function Ss(r, e) {
707
- const t = Pt(e), s = H(r), n = Be(() => [at()]), u = me(r.mutationKey ?? n.current), [i] = xt(
708
- () => new Cr(
713
+ function Or(s, e) {
714
+ const t = kt(e), r = q(s), n = Xe(() => [ot()]), u = me(s.mutationKey ?? n.current), [i] = Rt(
715
+ () => new Es(
709
716
  t,
710
- r
717
+ s
711
718
  )
712
719
  );
713
720
  X(() => {
714
- i.setOptions(r);
715
- }, [i, r]);
716
- const l = st(() => i.observe(), [u, i]), f = Ye(l.result$) ?? l.lastValue, h = le(
717
- (o, d) => {
718
- i.mutate(o, d).catch(Er);
721
+ i.setOptions(s);
722
+ }, [i, s]);
723
+ const c = it(() => i.observe(), [u, i]), l = Be(c.result$) ?? c.lastValue, h = ce(
724
+ (o, p) => {
725
+ i.mutate(o, p).catch(Rs);
719
726
  },
720
727
  [i]
721
728
  );
722
729
  return X(() => () => {
723
- s.current.cancelOnUnMount && i.reset();
724
- }, [i, s]), { ...f, mutate: h, mutateAsync: f.mutate };
730
+ r.current.cancelOnUnMount && i.reset();
731
+ }, [i, r]), { ...l, mutate: h, mutateAsync: l.mutate };
725
732
  }
726
- function xr(r) {
733
+ function js(s) {
727
734
  return (e) => e.pipe(
728
- Mt((t) => {
729
- r.next(t);
735
+ At((t) => {
736
+ s.next(t);
730
737
  })
731
738
  );
732
739
  }
733
- class Rr {
740
+ class Ms {
734
741
  constructor() {
735
- b(this, "isOnlineSubject", new J(!0));
736
- b(this, "online$", this.isOnlineSubject.pipe(Q()));
737
- b(this, "backToOnline$", this.online$.pipe(
742
+ m(this, "isOnlineSubject", new J(!0));
743
+ m(this, "online$", this.isOnlineSubject.pipe(Q()));
744
+ m(this, "backToOnline$", this.online$.pipe(
738
745
  O((e) => e),
739
746
  Ge()
740
747
  ));
741
- C(
742
- Ne(window, "offline").pipe(g(() => !1)),
743
- Ne(window, "online").pipe(g(() => !0))
744
- ).pipe(xr(this.isOnlineSubject)).subscribe();
748
+ F(
749
+ Ke(window, "offline").pipe(g(() => !1)),
750
+ Ke(window, "online").pipe(g(() => !0))
751
+ ).pipe(js(this.isOnlineSubject)).subscribe();
745
752
  }
746
753
  isOnline() {
747
754
  return this.isOnlineSubject.getValue();
@@ -750,155 +757,155 @@ class Rr {
750
757
  this.isOnlineSubject.getValue() !== e && this.isOnlineSubject.next(e);
751
758
  }
752
759
  }
753
- const se = new Rr();
754
- function ot(r, e) {
755
- return r.isStaleByTime(e.staleTime);
760
+ const se = new Ms();
761
+ function lt(s, e) {
762
+ return s.isStaleByTime(e.staleTime);
756
763
  }
757
- function jr(r, e) {
758
- return e.enabled !== !1 && !r.state.dataUpdatedAt && !(r.state.status === "error" && e.retryOnMount === !1) && r.state.fetchStatus !== "fetching";
764
+ function As(s, e) {
765
+ return e.enabled !== !1 && !s.state.dataUpdatedAt && !(s.state.status === "error" && e.retryOnMount === !1) && s.state.fetchStatus !== "fetching";
759
766
  }
760
- function Ot(r, e) {
761
- return jr(r, e) || r.state.dataUpdatedAt > 0 && Dt(r, e, e.refetchOnMount);
767
+ function $t(s, e) {
768
+ return As(s, e) || s.state.dataUpdatedAt > 0 && Tt(s, e, e.refetchOnMount);
762
769
  }
763
- function $t(r, e, t, s) {
764
- return r.state.fetchStatus !== "fetching" && t.enabled !== !1 && (r !== e || s.enabled === !1) && (!t.suspense || r.state.status !== "error") && ot(r, t);
770
+ function wt(s, e, t, r) {
771
+ return s.state.fetchStatus !== "fetching" && t.enabled !== !1 && (s !== e || r.enabled === !1) && (!t.suspense || s.state.status !== "error") && lt(s, t);
765
772
  }
766
- function Mr(r, e) {
767
- return Dt(r, e, e.refetchOnWindowFocus);
773
+ function Qs(s, e) {
774
+ return Tt(s, e, e.refetchOnWindowFocus);
768
775
  }
769
- function Dt(r, e, t) {
776
+ function Tt(s, e, t) {
770
777
  if (e.enabled !== !1) {
771
- const s = typeof t == "function" ? t(r) : t;
772
- return s === "idle" ? r.state.fetchStatus === "idle" : s === "always" || s !== !1 && ot(r, e);
778
+ const r = typeof t == "function" ? t(s) : t;
779
+ return r === "idle" ? s.state.fetchStatus === "idle" : r === "always" || r !== !1 && lt(s, e);
773
780
  }
774
781
  return !1;
775
782
  }
776
- function Ar(r) {
777
- return (r ?? "online") === "online" ? se.isOnline() : !0;
783
+ function Us(s) {
784
+ return (s ?? "online") === "online" ? se.isOnline() : !0;
778
785
  }
779
- function wt(r, e) {
786
+ function Ct(s, e) {
780
787
  return e.reduce(
781
- (t, s) => s in r ? { ...t, [s]: r[s] } : t,
788
+ (t, r) => r in s ? { ...t, [r]: s[r] } : t,
782
789
  {}
783
790
  );
784
791
  }
785
- function Ct(r) {
786
- return Array.isArray(r) && r.length === Object.keys(r).length;
792
+ function Ft(s) {
793
+ return Array.isArray(s) && s.length === Object.keys(s).length;
787
794
  }
788
- function Tt(r, e) {
789
- if (r === e)
790
- return r;
791
- const t = Ct(r) && Ct(e);
792
- if (t || rt(r) && rt(e)) {
793
- const s = t ? r : Object.keys(r), n = s.length, u = t ? e : Object.keys(e), i = u.length, l = t ? [] : {};
794
- let f = 0;
795
+ function Kt(s, e) {
796
+ if (s === e)
797
+ return s;
798
+ const t = Ft(s) && Ft(e);
799
+ if (t || rt(s) && rt(e)) {
800
+ const r = t ? s : Object.keys(s), n = r.length, u = t ? e : Object.keys(e), i = u.length, c = t ? [] : {};
801
+ let l = 0;
795
802
  for (let h = 0; h < i; h++) {
796
803
  const o = t ? h : u[h];
797
- !t && r[o] === void 0 && e[o] === void 0 && s.includes(o) ? (l[o] = void 0, f++) : (l[o] = Tt(r[o], e[o]), l[o] === r[o] && r[o] !== void 0 && f++);
804
+ !t && s[o] === void 0 && e[o] === void 0 && r.includes(o) ? (c[o] = void 0, l++) : (c[o] = Kt(s[o], e[o]), c[o] === s[o] && s[o] !== void 0 && l++);
798
805
  }
799
- return n === i && f === n ? r : l;
806
+ return n === i && l === n ? s : c;
800
807
  }
801
808
  return e;
802
809
  }
803
- function lt(r, e) {
804
- return ((e == null ? void 0 : e.queryKeyHashFn) ?? me)(r);
810
+ function ht(s, e) {
811
+ return ((e == null ? void 0 : e.queryKeyHashFn) ?? me)(s);
805
812
  }
806
- function Ft(r, e) {
813
+ function Et(s, e) {
807
814
  const {
808
815
  type: t = "all",
809
- exact: s,
816
+ exact: r,
810
817
  fetchStatus: n,
811
818
  predicate: u,
812
819
  queryKey: i,
813
- stale: l
814
- } = r;
820
+ stale: c
821
+ } = s;
815
822
  if (i) {
816
- if (s) {
817
- if (e.queryHash !== lt(i, e.options))
823
+ if (r) {
824
+ if (e.queryHash !== ht(i, e.options))
818
825
  return !1;
819
- } else if (!Xe(e.queryKey, i))
826
+ } else if (!Ze(e.queryKey, i))
820
827
  return !1;
821
828
  }
822
829
  if (t !== "all") {
823
- const f = e.isActive();
824
- if (t === "active" && !f || t === "inactive" && f)
830
+ const l = e.isActive();
831
+ if (t === "active" && !l || t === "inactive" && l)
825
832
  return !1;
826
833
  }
827
- return !(typeof l == "boolean" && e.isStale() !== l || typeof n < "u" && n !== e.state.fetchStatus || u && !u(e));
834
+ return !(typeof c == "boolean" && e.isStale() !== c || typeof n < "u" && n !== e.state.fetchStatus || u && !u(e));
828
835
  }
829
- function Qr(r, e) {
830
- return Math.max(r + (e ?? 0) - Date.now(), 0);
836
+ function Is(s, e) {
837
+ return Math.max(s + (e ?? 0) - Date.now(), 0);
831
838
  }
832
- function Ur(r, e) {
833
- return typeof r == "function" ? r(e) : r;
839
+ function Vs(s, e) {
840
+ return typeof s == "function" ? s(e) : s;
834
841
  }
835
- function Le(r, e, t) {
836
- return typeof t.structuralSharing == "function" ? t.structuralSharing(r, e) : t.structuralSharing !== !1 ? Tt(r, e) : e;
842
+ function _e(s, e, t) {
843
+ return typeof t.structuralSharing == "function" ? t.structuralSharing(s, e) : t.structuralSharing !== !1 ? Kt(s, e) : e;
837
844
  }
838
- const Ir = ({
839
- getOptions: r,
845
+ const nt = Symbol(), Ps = ({
846
+ getOptions: s,
840
847
  getState: e,
841
848
  initialState: t
842
- }) => (s) => s.pipe(
843
- it((n, { command: u, state: i }) => {
849
+ }) => (r) => r.pipe(
850
+ Ye((n, { command: u, state: i }) => {
844
851
  if (u === "reset")
845
852
  return { ...n, ...i };
846
853
  if (u === "cancel") {
847
854
  const j = n.status === "pending" ? "pending" : i.status ?? n.status;
848
855
  return { ...n, ...i, status: j };
849
856
  }
850
- const l = i.data, f = l !== void 0 && l !== n.data, h = "data" in i, o = i.status === "success", d = n.data !== void 0, c = n.error !== void 0 || n.error !== null, y = i.status ?? n.status, F = f ? Le(e().data, l, r()) : h ? i.data : n.data, p = n.status === "error" || n.status === "success", v = i.status === "error" && (n.status === "error" && n.fetchStatus === "fetching" || n.status !== "error") ? n.errorUpdateCount + 1 : n.errorUpdateCount, $ = f ? n.dataUpdateCount + 1 : i.dataUpdateCount ?? n.dataUpdateCount, q = i.status === "pending" && p && // (dataUpdateCount !== 0 || errorUpdateCount !== 0)
851
- (d || c), P = y === "pending" ? null : i.error ?? n.error;
857
+ const c = i.data, l = c !== void 0 && c !== n.data, h = "data" in i, o = i.status === "success", p = n.data !== void 0, d = n.error !== void 0 || n.error !== null, f = i.status ?? n.status, b = l ? _e(e().data, c, s()) : h ? i.data : n.data, y = n.status === "error" || n.status === "success", $ = i.status === "error" && (n.status === "error" && n.fetchStatus === "fetching" || n.status !== "error") ? n.errorUpdateCount + 1 : n.errorUpdateCount, w = l ? n.dataUpdateCount + 1 : i.dataUpdateCount ?? n.dataUpdateCount, H = i.status === "pending" && y && // (dataUpdateCount !== 0 || errorUpdateCount !== 0)
858
+ (p || d), P = f === "pending" ? null : i.error ?? n.error;
852
859
  return {
853
860
  ...n,
854
861
  ...i,
855
- status: y,
862
+ status: f,
856
863
  error: P,
857
- errorUpdateCount: v,
864
+ errorUpdateCount: $,
858
865
  ...o && {
859
866
  isInvalidated: !1
860
867
  },
861
- data: F,
862
- dataUpdateCount: $,
863
- ...q && {
868
+ data: b,
869
+ dataUpdateCount: w,
870
+ ...H && {
864
871
  status: n.status
865
872
  }
866
873
  };
867
874
  }, t)
868
- ), Vr = (r) => r.pipe(
875
+ ), Ds = (s) => s.pipe(
869
876
  g(
870
877
  ({ status: e, fetchStatus: t }) => t === "idle" && (e === "success" || e === "error")
871
878
  )
872
- ), kt = (r) => r.pipe(
879
+ ), Nt = (s) => s.pipe(
873
880
  Je((e) => e.fetchStatus !== "idle", !0)
874
881
  );
875
- var ze, te;
876
- class Pr {
882
+ var ze, ee;
883
+ class ks {
877
884
  constructor() {
878
- w(this, ze, C(
879
- Ne(document, "visibilitychange"),
880
- Ne(window, "visibilitychange")
885
+ C(this, ze, F(
886
+ Ke(document, "visibilitychange"),
887
+ Ke(window, "visibilitychange")
881
888
  ).pipe(g(() => document.visibilityState)));
882
- w(this, te, new J(
889
+ C(this, ee, new J(
883
890
  document.visibilityState === "visible"
884
891
  ));
885
892
  // public readonly focused$ = this.#focusedSubject.pipe(distinctUntilChanged())
886
- b(this, "focused$", a(this, te));
887
- b(this, "focusRegained$", this.focused$.pipe(
888
- nt(1),
893
+ m(this, "focused$", a(this, ee));
894
+ m(this, "focusRegained$", this.focused$.pipe(
895
+ ut(1),
889
896
  O((e) => e)
890
897
  ));
891
898
  a(this, ze).pipe(
892
899
  E((e) => {
893
- a(this, te).next(e === "visible");
900
+ a(this, ee).next(e === "visible");
894
901
  })
895
902
  ).subscribe();
896
903
  }
897
904
  isFocused() {
898
- return a(this, te).getValue();
905
+ return a(this, ee).getValue();
899
906
  }
900
907
  setFocused(e) {
901
- a(this, te).getValue() !== (e ?? !0) && a(this, te).next(e ?? !0);
908
+ a(this, ee).getValue() !== (e ?? !0) && a(this, ee).next(e ?? !0);
902
909
  }
903
910
  subscribe(e) {
904
911
  const t = this.focused$.subscribe(e);
@@ -917,8 +924,8 @@ class Pr {
917
924
  document.dispatchEvent(new Event("visibilitychange"));
918
925
  }
919
926
  }
920
- ze = new WeakMap(), te = new WeakMap();
921
- const _e = new Pr(), Dr = (r) => r.pipe(
927
+ ze = new WeakMap(), ee = new WeakMap();
928
+ const Le = new ks(), Ts = (s) => s.pipe(
922
929
  O((e) => e.status === "success"),
923
930
  g((e) => ({
924
931
  data: e.data,
@@ -927,133 +934,133 @@ const _e = new Pr(), Dr = (r) => r.pipe(
927
934
  })),
928
935
  Q(V)
929
936
  );
930
- var Y, R, we, ue, D, de, Ce;
931
- class Kt {
937
+ var Y, R, $e, ie, D, fe, we;
938
+ class qt {
932
939
  constructor(e, t) {
933
- w(this, Y, void 0);
934
- w(this, R, void 0);
935
- w(this, we, new I());
940
+ C(this, Y, void 0);
941
+ C(this, R, void 0);
942
+ C(this, $e, new I());
936
943
  /**
937
944
  * Used to subscribe to changes in either query or options (or both).
938
945
  * We need to be able to track change to both of them at the same time
939
946
  * in order to react accordingly and in order (such as refetch on options change)
940
947
  */
941
- b(this, "queryUpdateSubject", new I());
948
+ m(this, "queryUpdateSubject", new I());
942
949
  /**
943
950
  * Mostly used to compare the state before and after mount
944
951
  */
945
- w(this, ue, void 0);
952
+ C(this, ie, void 0);
946
953
  /**
947
954
  * Mostly used for internal optimization such as not
948
955
  * running selectors twice, etc
949
956
  */
950
- w(this, D, void 0);
957
+ C(this, D, void 0);
951
958
  // This property keeps track of the last query with defined data.
952
959
  // It will be used to pass the previous data and query to the placeholder function between renders.
953
- w(this, de, void 0);
954
- w(this, Ce, 0);
955
- b(this, "getObserverResultFromQuery", ({
960
+ C(this, fe, void 0);
961
+ C(this, we, 0);
962
+ m(this, "getObserverResultFromQuery", ({
956
963
  options: e,
957
964
  query: t,
958
- optimisticResult: s,
965
+ optimisticResult: r,
959
966
  prevResult: {
960
967
  result: n,
961
968
  options: u,
962
969
  state: i,
963
- select: l,
964
- selectError: f,
970
+ select: c,
971
+ selectError: l,
965
972
  selectResult: h
966
973
  }
967
974
  }) => {
968
- var De;
969
- const o = t.state, d = t.state.status === "pending", c = a(this, R), y = this.options, p = t !== c ? t.state : a(this, ue);
970
- let { errorUpdatedAt: v, fetchStatus: $, error: q } = o;
971
- if (s) {
972
- const k = !!a(this, Ce), ft = !k && Ot(t, e), zt = k && $t(t, c, e, y);
973
- (ft || zt) && ($ = Ar(t.options.networkMode) ? "fetching" : "paused");
975
+ var Pe;
976
+ const o = t.state, p = t.state.status === "pending", d = a(this, R), f = this.options, y = t !== d ? t.state : a(this, ie);
977
+ let { errorUpdatedAt: $, fetchStatus: w, error: H } = o;
978
+ if (r) {
979
+ const T = !!a(this, we), ft = !T && $t(t, e), Gt = T && wt(t, d, e, f);
980
+ (ft || Gt) && (w = Us(t.options.networkMode) ? "fetching" : "paused");
974
981
  }
975
- const P = d && $ === "fetching";
976
- let j, m = f, z = l ?? null, W = h;
982
+ const P = p && w === "fetching";
983
+ let j, S = l, z = c ?? null, W = h;
977
984
  if (e.select && typeof o.data < "u")
978
- if (n && o.data === (i == null ? void 0 : i.data) && e.select === l)
985
+ if (n && o.data === (i == null ? void 0 : i.data) && e.select === c)
979
986
  j = h;
980
987
  else
981
988
  try {
982
- z = e.select, j = e.select(o.data), j = Le(n == null ? void 0 : n.data, j, e), W = j, m = null;
983
- } catch (k) {
984
- j = h, m = k;
989
+ z = e.select, j = e.select(o.data), j = _e(n == null ? void 0 : n.data, j, e), W = j, S = null;
990
+ } catch (T) {
991
+ j = h, S = T;
985
992
  }
986
993
  else
987
- j = o.data, m = null;
988
- let L = $ !== "idle" && !o.dataUpdatedAt ? "pending" : o.status;
989
- m && (q = m, j = h, v = (n == null ? void 0 : n.errorUpdatedAt) ?? v, L = "error");
990
- const Ie = L === "error";
991
- let Ve = !1;
992
- if (typeof e.placeholderData < "u" && typeof j > "u" && L === "pending") {
993
- let k;
994
+ j = o.data, S = null;
995
+ let _ = w !== "idle" && !o.dataUpdatedAt ? "pending" : o.status;
996
+ S && (H = S, j = h, $ = (n == null ? void 0 : n.errorUpdatedAt) ?? $, _ = "error");
997
+ const Ue = _ === "error";
998
+ let Ie = !1;
999
+ if (typeof e.placeholderData < "u" && typeof j > "u" && _ === "pending") {
1000
+ let T;
994
1001
  if (n != null && n.isPlaceholderData && e.placeholderData === (u == null ? void 0 : u.placeholderData))
995
- k = n.data;
996
- else if (k = typeof e.placeholderData == "function" ? e.placeholderData(
997
- (De = a(this, de)) == null ? void 0 : De.state.data,
998
- a(this, de)
999
- ) : e.placeholderData, e.select && typeof k < "u")
1002
+ T = n.data;
1003
+ else if (T = typeof e.placeholderData == "function" ? e.placeholderData(
1004
+ (Pe = a(this, fe)) == null ? void 0 : Pe.state.data,
1005
+ a(this, fe)
1006
+ ) : e.placeholderData, e.select && typeof T < "u")
1000
1007
  try {
1001
- k = e.select(k);
1008
+ T = e.select(T);
1002
1009
  } catch {
1003
1010
  }
1004
- typeof k < "u" && (L = "success", j = Le(
1011
+ typeof T < "u" && (_ = "success", j = _e(
1005
1012
  n == null ? void 0 : n.data,
1006
- k,
1013
+ T,
1007
1014
  e
1008
- ), Ve = !0);
1015
+ ), Ie = !0);
1009
1016
  }
1010
- const Pe = $ === "fetching";
1017
+ const Ve = w === "fetching";
1011
1018
  return {
1012
1019
  result: {
1013
- status: L,
1014
- fetchStatus: $,
1015
- isPending: d,
1016
- isSuccess: L === "success",
1017
- isError: Ie,
1020
+ status: _,
1021
+ fetchStatus: w,
1022
+ isPending: p,
1023
+ isSuccess: _ === "success",
1024
+ isError: Ue,
1018
1025
  isInitialLoading: P,
1019
1026
  isLoading: P,
1020
1027
  data: j,
1021
1028
  dataUpdatedAt: o.dataUpdatedAt,
1022
- error: q,
1023
- errorUpdatedAt: v,
1029
+ error: H,
1030
+ errorUpdatedAt: $,
1024
1031
  failureCount: o.fetchFailureCount,
1025
1032
  failureReason: o.fetchFailureReason,
1026
1033
  errorUpdateCount: o.errorUpdateCount,
1027
1034
  isFetched: o.dataUpdateCount > 0 || o.errorUpdateCount > 0,
1028
- isFetchedAfterMount: o.dataUpdateCount > p.dataUpdateCount || o.errorUpdateCount > p.errorUpdateCount,
1029
- isFetching: Pe,
1030
- isRefetching: Pe && !d,
1031
- isLoadingError: Ie && o.dataUpdatedAt === 0,
1032
- isPaused: $ === "paused",
1033
- isPlaceholderData: Ve,
1034
- isRefetchError: Ie && o.dataUpdatedAt !== 0,
1035
- isStale: ot(t, e),
1035
+ isFetchedAfterMount: o.dataUpdateCount > y.dataUpdateCount || o.errorUpdateCount > y.errorUpdateCount,
1036
+ isFetching: Ve,
1037
+ isRefetching: Ve && !p,
1038
+ isLoadingError: Ue && o.dataUpdatedAt === 0,
1039
+ isPaused: w === "paused",
1040
+ isPlaceholderData: Ie,
1041
+ isRefetchError: Ue && o.dataUpdatedAt !== 0,
1042
+ isStale: lt(t, e),
1036
1043
  // eslint-disable-next-line @typescript-eslint/unbound-method
1037
1044
  refetch: this.refetch
1038
1045
  },
1039
- selectError: m,
1046
+ selectError: S,
1040
1047
  select: z,
1041
1048
  selectResult: W
1042
1049
  };
1043
1050
  });
1044
1051
  this.options = t, M(this, Y, e), this.bindMethods(), M(this, R, this.setOptions(t));
1045
- const s = a(this, R);
1046
- M(this, ue, s.state);
1052
+ const r = a(this, R);
1053
+ M(this, ie, r.state);
1047
1054
  const { result: n, select: u } = this.getObserverResultFromQuery({
1048
- query: s,
1055
+ query: r,
1049
1056
  options: this.options,
1050
1057
  prevResult: {
1051
1058
  options: this.options,
1052
- state: s.state
1059
+ state: r.state
1053
1060
  }
1054
1061
  });
1055
1062
  M(this, D, {
1056
- state: s.state,
1063
+ state: r.state,
1057
1064
  options: t,
1058
1065
  result: n,
1059
1066
  select: u
@@ -1070,11 +1077,11 @@ class Kt {
1070
1077
  observer: this
1071
1078
  }), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
1072
1079
  throw new Error("Expected enabled to be a boolean");
1073
- const s = this.buildQuery(this.options);
1074
- return s !== a(this, R) && (M(this, ue, s.state), M(this, R, s)), this.queryUpdateSubject.next({
1080
+ const r = this.buildQuery(this.options);
1081
+ return r !== a(this, R) && (M(this, ie, r.state), M(this, R, r)), this.queryUpdateSubject.next({
1075
1082
  options: this.options,
1076
- query: s
1077
- }), s;
1083
+ query: r
1084
+ }), r;
1078
1085
  }
1079
1086
  buildQuery(e) {
1080
1087
  const t = a(this, Y).getQueryCache().build(a(this, Y), e);
@@ -1091,22 +1098,22 @@ class Kt {
1091
1098
  return a(this, R);
1092
1099
  }
1093
1100
  getOptimisticResult(e) {
1094
- const t = this.buildQuery(e), s = this.getObserverResultFromQuery({
1101
+ const t = this.buildQuery(e), r = this.getObserverResultFromQuery({
1095
1102
  query: t,
1096
1103
  options: e,
1097
1104
  optimisticResult: !0,
1098
1105
  prevResult: a(this, D)
1099
1106
  });
1100
- return Tr(this, s.result) && this.updateResult({ query: t, ...s }), s.result;
1107
+ return Ks(this, r.result) && this.updateResult({ query: t, ...r }), r.result;
1101
1108
  }
1102
1109
  updateResult({
1103
1110
  query: e,
1104
1111
  result: t,
1105
- selectError: s,
1112
+ selectError: r,
1106
1113
  select: n,
1107
1114
  selectResult: u
1108
1115
  }) {
1109
- a(this, D).state = e.state, a(this, D).result = t, a(this, D).selectResult = u, s !== void 0 && (a(this, D).selectError = s), n !== void 0 && (a(this, D).select = n), a(this, D).options = this.options, e.state.data !== void 0 && M(this, de, e), a(this, Y).getQueryCache().notify({
1116
+ a(this, D).state = e.state, a(this, D).result = t, a(this, D).selectResult = u, r !== void 0 && (a(this, D).selectError = r), n !== void 0 && (a(this, D).select = n), a(this, D).options = this.options, e.state.data !== void 0 && M(this, fe, e), a(this, Y).getQueryCache().notify({
1110
1117
  query: a(this, R),
1111
1118
  type: "observerResultsUpdated"
1112
1119
  });
@@ -1118,17 +1125,17 @@ class Kt {
1118
1125
  }
1119
1126
  async fetch(e) {
1120
1127
  const t = this.buildQuery(this.options);
1121
- t !== a(this, R) && (M(this, R, t), M(this, ue, t.state), this.queryUpdateSubject.next({
1128
+ t !== a(this, R) && (M(this, R, t), M(this, ie, t.state), this.queryUpdateSubject.next({
1122
1129
  options: this.options,
1123
1130
  query: t
1124
1131
  }));
1125
- const s = {
1132
+ const r = {
1126
1133
  ...e,
1127
1134
  cancelRefetch: (e == null ? void 0 : e.cancelRefetch) ?? !0
1128
1135
  };
1129
- a(this, R).fetch(this.options, s).catch(N), a(this, we).next({
1136
+ a(this, R).fetch(this.options, r).catch(N), a(this, $e).next({
1130
1137
  query: t,
1131
- fetchOptions: s
1138
+ fetchOptions: r
1132
1139
  }), await t.getFetchResultAsPromise();
1133
1140
  const { result: n } = this.getObserverResultFromQuery({
1134
1141
  query: t,
@@ -1151,91 +1158,91 @@ class Kt {
1151
1158
  g(({ query: i }) => i),
1152
1159
  oe(a(this, R)),
1153
1160
  Q()
1154
- ), s = this.queryUpdateSubject.pipe(
1161
+ ), r = this.queryUpdateSubject.pipe(
1155
1162
  oe({
1156
1163
  query: a(this, R),
1157
1164
  options: this.options
1158
1165
  }),
1159
- jt(),
1166
+ Mt(),
1160
1167
  E(
1161
- ([{ options: i, query: l }, { options: f, query: h }]) => {
1162
- $t(h, l, f, i) && this.fetch().catch(N);
1168
+ ([{ options: i, query: c }, { options: l, query: h }]) => {
1169
+ wt(h, c, l, i) && this.fetch().catch(N);
1163
1170
  }
1164
1171
  ),
1165
- he()
1172
+ le()
1166
1173
  ), n = t.pipe(
1167
1174
  x((i) => i.observe(this)),
1168
- he()
1175
+ le()
1169
1176
  );
1170
- return C(
1177
+ return F(
1171
1178
  /**
1172
1179
  * It's important to observe the query before we subscribe to its result
1173
1180
  * later in the chain of merge to get the first result right after fetch
1174
1181
  */
1175
1182
  n,
1176
- s,
1183
+ r,
1177
1184
  t.pipe(
1178
1185
  x((i) => {
1179
- const l = this.options, f = this.queryUpdateSubject.pipe(
1180
- oe({ query: i, options: l }),
1181
- O((m) => m.query === i),
1182
- g((m) => m.options),
1186
+ const c = this.options, l = this.queryUpdateSubject.pipe(
1187
+ oe({ query: i, options: c }),
1188
+ O((S) => S.query === i),
1189
+ g((S) => S.options),
1183
1190
  Q(),
1184
- Ue(1)
1185
- ), h = a(this, we).pipe(
1186
- O((m) => m.query === i)
1191
+ Qe(1)
1192
+ ), h = a(this, $e).pipe(
1193
+ O((S) => S.query === i)
1187
1194
  ), o = i.state$.pipe(
1188
- Dr,
1195
+ Ts,
1189
1196
  x(
1190
- (m) => this.options.staleTime === 1 / 0 ? Oe : (this.options.staleTime ?? 0) <= 0 ? S(m).pipe(ut(1)) : Qe(this.options.staleTime ?? 1)
1197
+ (S) => this.options.staleTime === 1 / 0 ? Ne : (this.options.staleTime ?? 0) <= 0 ? v(S).pipe(at(1)) : Ae(this.options.staleTime ?? 1)
1191
1198
  ),
1192
1199
  Je(() => this.options.enabled ?? !0)
1193
- ), d = (m, z) => {
1194
- const W = l.notifyOnChangeProps, L = typeof W == "function" ? W() : W;
1195
- return (Array.isArray(L) ? L.length === 0 ? () => !0 : (Ve, Pe) => {
1196
- const ht = wt(
1200
+ ), p = (S, z) => {
1201
+ const W = c.notifyOnChangeProps, _ = typeof W == "function" ? W() : W;
1202
+ return (Array.isArray(_) ? _.length === 0 ? () => !0 : (Ie, Ve) => {
1203
+ const dt = Ct(
1204
+ Ie,
1205
+ _
1206
+ ), Pe = Ct(
1197
1207
  Ve,
1198
- L
1199
- ), De = wt(
1200
- Pe,
1201
- L
1208
+ _
1202
1209
  );
1203
- return V(ht, De);
1204
- } : V)(m, z);
1205
- }, c = h.pipe(
1210
+ return V(dt, Pe);
1211
+ } : V)(S, z);
1212
+ }, d = h.pipe(
1206
1213
  x(() => i.state$),
1207
- kt
1208
- ), y = f.pipe(
1209
- g(({ refetchInterval: m, refetchIntervalInBackground: z }) => ({
1210
- refetchInterval: (typeof m == "function" ? m(a(this, R)) : m) ?? !1,
1214
+ Nt
1215
+ ), f = l.pipe(
1216
+ g(({ refetchInterval: S, refetchIntervalInBackground: z }) => ({
1217
+ refetchInterval: (typeof S == "function" ? S(a(this, R)) : S) ?? !1,
1211
1218
  refetchIntervalInBackground: z
1212
1219
  })),
1213
1220
  Q(V),
1214
- x(({ refetchInterval: m, refetchIntervalInBackground: z }) => m ? nr(m).pipe(
1221
+ x(({ refetchInterval: S, refetchIntervalInBackground: z }) => S ? us(S).pipe(
1215
1222
  E(() => {
1216
1223
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
1217
- (z || _e.isFocused()) && this.fetch({ cancelRefetch: !1 }).catch(N);
1224
+ (z || Le.isFocused()) && this.fetch({ cancelRefetch: !1 }).catch(N);
1218
1225
  })
1219
- ) : Oe),
1220
- he()
1221
- ), F = f.pipe(
1222
- g(({ enabled: m }) => m ?? !0),
1226
+ ) : Ne),
1227
+ le()
1228
+ ), b = l.pipe(
1229
+ g(({ enabled: S }) => S ?? !0),
1223
1230
  Q()
1224
- ), p = F.pipe(
1225
- O((m) => !m),
1231
+ ), y = b.pipe(
1232
+ O((S) => !S),
1226
1233
  g(() => i.state)
1227
- ), v = F.pipe(
1228
- O((m) => m),
1229
- x(() => _e.focusRegained$),
1230
- bt(f),
1231
- E(([, m]) => {
1232
- Mr(i, m) && this.fetch({ cancelRefetch: !1 }).catch(N);
1234
+ ), $ = b.pipe(
1235
+ O((S) => S),
1236
+ x(() => Le.focusRegained$),
1237
+ yt(l),
1238
+ E(([, S]) => {
1239
+ Qs(i, S) && this.fetch({ cancelRefetch: !1 }).catch(N);
1233
1240
  }),
1234
- he()
1235
- ), $ = p.pipe(
1241
+ le()
1242
+ ), w = y.pipe(
1236
1243
  g(() => i.state)
1237
- ), q = (m) => m.pipe(
1238
- bt(f),
1244
+ ), H = (S) => S.pipe(
1245
+ yt(l),
1239
1246
  g(([, z]) => {
1240
1247
  const W = this.getObserverResultFromQuery({
1241
1248
  query: i,
@@ -1244,26 +1251,26 @@ class Kt {
1244
1251
  });
1245
1252
  return this.updateResult({ query: i, ...W }), W.result;
1246
1253
  })
1247
- ), j = C(
1248
- $,
1249
- c,
1254
+ ), j = F(
1255
+ w,
1256
+ d,
1250
1257
  i.state$,
1251
1258
  // options$,
1252
1259
  o
1253
1260
  ).pipe(
1254
- q,
1261
+ H,
1255
1262
  // This one ensure we don't re-trigger same state
1256
1263
  Q(V),
1257
1264
  // This one make sure we dispatch based on user preference
1258
- Q(d)
1265
+ Q(p)
1259
1266
  );
1260
- return C(y, v, j);
1267
+ return F(f, $, j);
1261
1268
  })
1262
1269
  ).pipe(
1263
- ct((i) => M(this, Ce, i)),
1270
+ ct((i) => M(this, we, i)),
1264
1271
  E({
1265
1272
  subscribe: () => {
1266
- Ot(e, this.options) && this.fetch().catch(N);
1273
+ $t(e, this.options) && this.fetch().catch(N);
1267
1274
  }
1268
1275
  })
1269
1276
  )
@@ -1272,122 +1279,120 @@ class Kt {
1272
1279
  destroy() {
1273
1280
  }
1274
1281
  }
1275
- Y = new WeakMap(), R = new WeakMap(), we = new WeakMap(), ue = new WeakMap(), D = new WeakMap(), de = new WeakMap(), Ce = new WeakMap();
1276
- function Tr(r, e) {
1277
- return !V(r.getCurrentResult(), e);
1282
+ Y = new WeakMap(), R = new WeakMap(), $e = new WeakMap(), ie = new WeakMap(), D = new WeakMap(), fe = new WeakMap(), we = new WeakMap();
1283
+ function Ks(s, e) {
1284
+ return !V(s.getCurrentResult(), e);
1278
1285
  }
1279
- const Nt = We.createContext(!1), kr = () => We.useContext(Nt);
1280
- Nt.Provider;
1281
- function Kr() {
1282
- let r = !1;
1286
+ const Ht = We.createContext(!1), Ns = () => We.useContext(Ht);
1287
+ Ht.Provider;
1288
+ function qs() {
1289
+ let s = !1;
1283
1290
  return {
1284
1291
  clearReset: () => {
1285
- r = !1;
1292
+ s = !1;
1286
1293
  },
1287
1294
  reset: () => {
1288
- r = !0;
1295
+ s = !0;
1289
1296
  },
1290
- isReset: () => r
1297
+ isReset: () => s
1291
1298
  };
1292
1299
  }
1293
- const Nr = We.createContext(Kr()), Hr = () => We.useContext(Nr);
1294
- function qr(r, e) {
1295
- return typeof r == "function" ? r(...e) : !!r;
1300
+ const Hs = We.createContext(qs()), _s = () => We.useContext(Hs);
1301
+ function Ls(s, e) {
1302
+ return typeof s == "function" ? s(...e) : !!s;
1296
1303
  }
1297
- const Lr = ({
1298
- result: r,
1304
+ const zs = ({
1305
+ result: s,
1299
1306
  errorResetBoundary: e,
1300
1307
  throwOnError: t,
1301
- query: s
1302
- }) => r.isError && !e.isReset() && !r.isFetching && s && qr(t, [r.error, s]);
1303
- function Ht(r, e, t) {
1304
- if (process.env.NODE_ENV !== "production" && (typeof r != "object" || Array.isArray(r)))
1308
+ query: r
1309
+ }) => s.isError && !e.isReset() && !s.isFetching && r && Ls(t, [s.error, r]);
1310
+ function _t(s, e, t) {
1311
+ if (process.env.NODE_ENV !== "production" && (typeof s != "object" || Array.isArray(s)))
1305
1312
  throw new Error(
1306
1313
  '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'
1307
1314
  );
1308
- const s = Pt(t), n = kr(), u = Hr(), i = s.defaultQueryOptions(r);
1315
+ const r = kt(t), n = Ns(), u = _s(), i = r.defaultQueryOptions(s);
1309
1316
  i._optimisticResults = n ? "isRestoring" : "optimistic";
1310
- const [l] = xt(
1317
+ const [c] = Rt(
1311
1318
  () => new e(
1312
- s,
1319
+ r,
1313
1320
  i
1314
1321
  )
1315
- ), f = Be(() => l.observe()), h = H(
1316
- l.getOptimisticResult(i)
1322
+ ), l = Xe(() => c.observe()), h = q(
1323
+ c.getOptimisticResult(i)
1317
1324
  ), o = h.current;
1318
- Ye(
1319
- () => f.current.pipe(
1325
+ Be(
1326
+ () => l.current.pipe(
1320
1327
  /**
1321
1328
  * By the time this observer runs the result may have changed (eg: synchronous setData).
1322
1329
  * It's important to not skip the first result (even tho most of the time they are equal).
1323
1330
  * We only skip if they are the same.
1324
1331
  */
1325
- O((c) => !V(c, h.current))
1332
+ O((d) => !V(d, h.current))
1326
1333
  ),
1327
1334
  []
1328
1335
  ), X(() => {
1329
- l.setOptions(i);
1330
- }, [i, l]);
1331
- const d = o.error;
1332
- if (d && Lr({
1336
+ c.setOptions(i);
1337
+ }, [i, c]);
1338
+ const p = o.error;
1339
+ if (p && zs({
1333
1340
  result: o,
1334
1341
  errorResetBoundary: u,
1335
1342
  throwOnError: i.throwOnError,
1336
- query: s.getQueryCache().get(
1337
- i.queryHash
1338
- )
1343
+ query: r.getQueryCache().get(i.queryHash)
1339
1344
  }))
1340
- throw d;
1345
+ throw p;
1341
1346
  return h.current;
1342
1347
  }
1343
- function vs(r, e) {
1344
- return Ht(r, Kt, e);
1348
+ function $r(s, e) {
1349
+ return _t(s, qt, e);
1345
1350
  }
1346
- function Os(r, e) {
1347
- return Ht(
1351
+ function wr(s, e) {
1352
+ return _t(
1348
1353
  {
1349
1354
  refetchOnMount: "idle",
1350
1355
  refetchOnReconnect: !1,
1351
1356
  refetchInterval: !1,
1352
1357
  refetchOnWindowFocus: !1,
1353
- ...r
1358
+ ...s
1354
1359
  },
1355
- Kt,
1360
+ qt,
1356
1361
  e
1357
1362
  );
1358
1363
  }
1359
- function $s(r, e, t = []) {
1360
- const s = e != null && !Array.isArray(e) ? e : {}, n = s.retry ?? !0, u = H(
1361
- s.onError ?? ((f) => {
1362
- console.error(f);
1364
+ function Cr(s, e, t = []) {
1365
+ const r = e != null && !Array.isArray(e) ? e : {}, n = r.retry ?? !0, u = q(
1366
+ r.onError ?? ((l) => {
1367
+ console.error(l);
1363
1368
  })
1364
- ), i = le(() => U(r), t), l = le(
1369
+ ), i = ce(() => U(s), t), c = ce(
1365
1370
  () => i().pipe(
1366
- B((f) => {
1367
- throw u.current(f), f;
1371
+ B((l) => {
1372
+ throw u.current(l), l;
1368
1373
  }),
1369
- n ? ir() : Rt
1374
+ n ? as() : jt
1370
1375
  ),
1371
1376
  [i, n, u]
1372
1377
  );
1373
- At(l, t);
1378
+ Qt(c, t);
1374
1379
  }
1375
- const qt = () => (r) => C(
1380
+ const Lt = () => (s) => F(
1376
1381
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1377
- S({ isPaused: !0 }),
1382
+ v({ isPaused: !0 }),
1378
1383
  se.backToOnline$.pipe(
1379
- T(
1384
+ k(
1380
1385
  () => (
1381
1386
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1382
- C(S({ isPaused: !1 }), r)
1387
+ F(v({ isPaused: !1 }), s)
1383
1388
  )
1384
1389
  )
1385
1390
  )
1386
- ), _r = (r) => {
1391
+ ), Ws = (s) => {
1387
1392
  let e = 0;
1388
- return r.pipe(
1389
- B((t) => (e++, e <= 1 && !se.isOnline() ? C(
1390
- S({
1393
+ return s.pipe(
1394
+ B((t) => (e++, e <= 1 && !se.isOnline() ? F(
1395
+ v({
1391
1396
  failureCount: e,
1392
1397
  failureReason: t
1393
1398
  }),
@@ -1395,148 +1400,150 @@ const qt = () => (r) => C(
1395
1400
  * @important
1396
1401
  * timer needed to be iso RQ, so the state returned by mutation include both previous and next one
1397
1402
  */
1398
- Qe(1).pipe(
1399
- T(() => Se(() => t).pipe(qt()))
1403
+ Ae(1).pipe(
1404
+ k(
1405
+ () => Se(() => t).pipe(Lt())
1406
+ )
1400
1407
  )
1401
1408
  ) : Se(() => t)))
1402
1409
  );
1403
- }, zr = ({
1404
- variables: r,
1410
+ }, Gs = ({
1411
+ variables: s,
1405
1412
  state: e,
1406
1413
  options: t
1407
1414
  }) => {
1408
- const s = e.isPaused, n = async () => await Promise.reject(new Error("No mutationFn found")), u = t.mutationFn ?? n, l = ur(
1409
- () => s,
1410
- S(e.context),
1415
+ const r = e.isPaused, n = async () => await Promise.reject(new Error("No mutationFn found")), u = t.mutationFn ?? n, c = os(
1416
+ () => r,
1417
+ v(e.context),
1411
1418
  U(
1412
1419
  // eslint-disable-next-line @typescript-eslint/promise-function-async
1413
1420
  () => {
1414
- var c;
1415
- return ((c = t.onMutate) == null ? void 0 : c.call(t, r)) ?? void 0;
1421
+ var d;
1422
+ return ((d = t.onMutate) == null ? void 0 : d.call(t, s)) ?? void 0;
1416
1423
  }
1417
1424
  )
1418
- ).pipe(Ue(1)), f = (c, y, F) => U(
1425
+ ).pipe(Qe(1)), l = (d, f, b) => U(
1419
1426
  () => {
1420
- var v;
1421
- return (v = t.onError) == null ? void 0 : v.call(t, c, r, y);
1427
+ var $;
1428
+ return ($ = t.onError) == null ? void 0 : $.call(t, d, s, f);
1422
1429
  }
1423
1430
  ).pipe(
1424
- B(() => S(c)),
1431
+ B(() => v(d)),
1425
1432
  g(
1426
1433
  () => ({
1427
- failureCount: F,
1428
- error: c,
1429
- failureReason: c,
1430
- context: y,
1434
+ failureCount: b,
1435
+ error: d,
1436
+ failureReason: d,
1437
+ context: f,
1431
1438
  status: "error"
1432
1439
  })
1433
1440
  )
1434
- ), h = l.pipe(
1435
- x((c) => {
1436
- const F = (typeof u == "function" ? (
1441
+ ), h = c.pipe(
1442
+ x((d) => {
1443
+ const b = (typeof u == "function" ? (
1437
1444
  // eslint-disable-next-line @typescript-eslint/promise-function-async
1438
- U(() => u(r))
1445
+ U(() => u(s))
1439
1446
  ) : u).pipe(
1440
1447
  g(
1441
- (p) => ({
1448
+ (y) => ({
1442
1449
  result: {
1443
- data: p
1450
+ data: y
1444
1451
  },
1445
1452
  error: null,
1446
- context: c
1453
+ context: d
1447
1454
  })
1448
1455
  ),
1449
- _r,
1450
- It({
1456
+ Ws,
1457
+ Vt({
1451
1458
  ...t,
1452
- retry: (p, v) => {
1453
- const $ = t.retry ?? 0;
1454
- return typeof $ == "function" ? $(p, v) : typeof $ == "boolean" ? $ : p < $;
1459
+ retry: (y, $) => {
1460
+ const w = t.retry ?? 0;
1461
+ return typeof w == "function" ? w(y, $) : typeof w == "boolean" ? w : y < w;
1455
1462
  },
1456
- caughtError: (p, v) => (
1463
+ caughtError: (y, $) => (
1457
1464
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1458
- S({
1459
- failureCount: p,
1460
- failureReason: v
1465
+ v({
1466
+ failureCount: y,
1467
+ failureReason: $
1461
1468
  })
1462
1469
  ),
1463
- catchError: (p, v) => f(v, c, p).pipe(
1464
- g(($) => ({
1465
- ...$,
1470
+ catchError: (y, $) => l($, d, y).pipe(
1471
+ g((w) => ({
1472
+ ...w,
1466
1473
  result: void 0
1467
1474
  }))
1468
1475
  )
1469
1476
  }),
1470
1477
  Je(
1471
- ({ result: p, error: v }) => (p == null ? void 0 : p.data) === void 0 && v === void 0,
1478
+ ({ result: y, error: $ }) => (y == null ? void 0 : y.data) === void 0 && $ === void 0,
1472
1479
  !0
1473
1480
  )
1474
1481
  );
1475
- return se.isOnline() || t.networkMode === "offlineFirst" || t.networkMode === "always" ? F : F.pipe(qt());
1482
+ return se.isOnline() || t.networkMode === "offlineFirst" || t.networkMode === "always" ? b : b.pipe(Lt());
1476
1483
  })
1477
- ), o = S({
1484
+ ), o = v({
1478
1485
  ...e,
1479
- variables: r,
1486
+ variables: s,
1480
1487
  status: "pending",
1481
1488
  isPaused: !1,
1482
1489
  failureCount: 0,
1483
1490
  failureReason: null,
1484
1491
  submittedAt: e.submittedAt ?? (/* @__PURE__ */ new Date()).getTime()
1485
1492
  });
1486
- return C(
1493
+ return F(
1487
1494
  o,
1488
1495
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1489
- l.pipe(g((c) => ({ context: c }))),
1496
+ c.pipe(g((d) => ({ context: d }))),
1490
1497
  h.pipe(
1491
- x(({ result: c, error: y, ...F }) => {
1492
- if (!c && !y)
1493
- return S({
1494
- ...F
1498
+ x(({ result: d, error: f, ...b }) => {
1499
+ if (!d && !f)
1500
+ return v({
1501
+ ...b
1495
1502
  });
1496
- const p = y ? S(null) : U(
1503
+ const y = f ? v(null) : U(
1497
1504
  () => {
1498
1505
  var P;
1499
1506
  return (P = t.onSuccess) == null ? void 0 : P.call(
1500
1507
  t,
1501
- c == null ? void 0 : c.data,
1502
- r,
1503
- F.context
1508
+ d == null ? void 0 : d.data,
1509
+ s,
1510
+ b.context
1504
1511
  );
1505
1512
  }
1506
- ), $ = U(
1513
+ ), w = U(
1507
1514
  () => {
1508
1515
  var P;
1509
1516
  return (P = t.onSettled) == null ? void 0 : P.call(
1510
1517
  t,
1511
- c == null ? void 0 : c.data,
1512
- y,
1513
- r,
1514
- F.context
1518
+ d == null ? void 0 : d.data,
1519
+ f,
1520
+ s,
1521
+ b.context
1515
1522
  );
1516
1523
  }
1517
1524
  ).pipe(
1518
- B((P) => c ? S(c) : S(P))
1525
+ B((P) => d ? v(d) : v(P))
1519
1526
  );
1520
- return Te(p, $).pipe(
1527
+ return De(y, w).pipe(
1521
1528
  ke(),
1522
1529
  g(
1523
- () => y ? {
1524
- error: y,
1530
+ () => f ? {
1531
+ error: f,
1525
1532
  data: void 0,
1526
- variables: r,
1527
- ...F
1533
+ variables: s,
1534
+ ...b
1528
1535
  } : {
1529
1536
  status: "success",
1530
- error: y,
1531
- data: c == null ? void 0 : c.data,
1532
- variables: r,
1537
+ error: f,
1538
+ data: d == null ? void 0 : d.data,
1539
+ variables: s,
1533
1540
  failureCount: 0,
1534
1541
  failureReason: null,
1535
- ...F
1542
+ ...b
1536
1543
  }
1537
1544
  ),
1538
1545
  B(
1539
- (P) => f(P, F.context, 0).pipe(
1546
+ (P) => l(P, b.context, 0).pipe(
1540
1547
  g((j) => ({
1541
1548
  ...j,
1542
1549
  data: void 0
@@ -1547,144 +1554,141 @@ const qt = () => (r) => C(
1547
1554
  })
1548
1555
  )
1549
1556
  ).pipe(
1550
- it((c, y) => ({
1551
- ...c,
1552
- ...y,
1553
- data: y.data ?? c.data,
1554
- error: y.error ?? c.error
1555
- }), ne()),
1556
- Q(
1557
- ({ data: c, ...y }, { data: F, ...p }) => V(y, p) && V(c, F)
1558
- )
1557
+ Ye((d, f) => ({
1558
+ ...d,
1559
+ ...f,
1560
+ data: f.data ?? d.data,
1561
+ error: f.error ?? d.error
1562
+ }), de())
1559
1563
  );
1560
1564
  };
1561
- var Fe, re, pe;
1562
- class Wr {
1565
+ var Ce, te, pe;
1566
+ class Js {
1563
1567
  constructor({
1564
1568
  options: e,
1565
1569
  mutationCache: t,
1566
- state: s
1570
+ state: r
1567
1571
  }) {
1568
- w(this, Fe, new J(0));
1569
- w(this, re, new I());
1570
- w(this, pe, new I());
1571
- b(this, "state", ne());
1572
- b(this, "state$");
1573
- b(this, "options");
1574
- b(this, "observerCount$", a(this, Fe).asObservable());
1575
- b(this, "cancelled$", a(this, re).asObservable());
1576
- this.options = e, this.state = s ?? this.state;
1577
- const n = a(this, pe).pipe(
1572
+ C(this, Ce, new J(0));
1573
+ C(this, te, new I());
1574
+ C(this, pe, new I());
1575
+ m(this, "state", de());
1576
+ m(this, "state$");
1577
+ m(this, "options");
1578
+ m(this, "observerCount$", a(this, Ce).asObservable());
1579
+ m(this, "cancelled$", a(this, te).asObservable());
1580
+ this.options = e, this.state = r ?? this.state;
1581
+ const n = a(this, te).pipe(
1582
+ O(() => this.state.status === "pending"),
1583
+ g(() => ({
1584
+ status: "idle"
1585
+ }))
1586
+ ), u = a(this, pe).pipe(
1578
1587
  x(
1579
- (u) => zr({
1588
+ (c) => Gs({
1580
1589
  options: {
1581
1590
  ...this.options,
1582
- onMutate: (i) => {
1583
- const l = U(
1591
+ onMutate: (l) => {
1592
+ const h = U(
1584
1593
  () => {
1585
- var d, c;
1586
- return (c = (d = t.config).onMutate) == null ? void 0 : c.call(
1587
- d,
1588
- i,
1594
+ var f, b;
1595
+ return (b = (f = t.config).onMutate) == null ? void 0 : b.call(
1596
+ f,
1597
+ l,
1589
1598
  this
1590
1599
  );
1591
1600
  }
1592
- ), h = U(() => {
1593
- var d, c;
1594
- return (c = (d = this.options).onMutate) == null ? void 0 : c.call(d, i);
1601
+ ), p = U(() => {
1602
+ var f, b;
1603
+ return (b = (f = this.options).onMutate) == null ? void 0 : b.call(f, l);
1595
1604
  });
1596
- return l.pipe(
1597
- T(() => h)
1605
+ return h.pipe(
1606
+ k(() => p)
1598
1607
  );
1599
1608
  },
1600
- onError: (i, l, f) => {
1601
- const h = U(
1609
+ onError: (l, h, o) => {
1610
+ const p = U(
1602
1611
  () => {
1603
- var d, c;
1604
- return (c = (d = t.config).onError) == null ? void 0 : c.call(
1605
- d,
1606
- i,
1607
- l,
1612
+ var f, b;
1613
+ return (b = (f = t.config).onError) == null ? void 0 : b.call(
1608
1614
  f,
1615
+ l,
1616
+ h,
1617
+ o,
1609
1618
  this
1610
1619
  );
1611
1620
  }
1612
- ), o = U(
1621
+ ), d = U(
1613
1622
  () => {
1614
- var d, c;
1615
- return (c = (d = this.options).onError) == null ? void 0 : c.call(d, i, l, f);
1623
+ var f, b;
1624
+ return (b = (f = this.options).onError) == null ? void 0 : b.call(f, l, h, o);
1616
1625
  }
1617
1626
  );
1618
- return Te(h, o).pipe(ke());
1627
+ return De(p, d).pipe(ke());
1619
1628
  },
1620
- onSettled: (i, l, f, h) => {
1621
- const o = U(
1629
+ onSettled: (l, h, o, p) => {
1630
+ const d = U(
1622
1631
  () => {
1623
- var c, y;
1624
- return (y = (c = t.config).onSettled) == null ? void 0 : y.call(
1625
- c,
1626
- i,
1632
+ var b, y;
1633
+ return (y = (b = t.config).onSettled) == null ? void 0 : y.call(
1634
+ b,
1627
1635
  l,
1628
- f,
1629
1636
  h,
1637
+ o,
1638
+ p,
1630
1639
  this
1631
1640
  );
1632
1641
  }
1633
- ), d = U(
1642
+ ), f = U(
1634
1643
  () => {
1635
- var c, y;
1636
- return (y = (c = this.options).onSettled) == null ? void 0 : y.call(c, i, l, f, h);
1644
+ var b, y;
1645
+ return (y = (b = this.options).onSettled) == null ? void 0 : y.call(b, l, h, o, p);
1637
1646
  }
1638
1647
  );
1639
- return Te(o, d).pipe(ke());
1648
+ return De(d, f).pipe(ke());
1640
1649
  },
1641
- onSuccess: (i, l, f) => {
1642
- const h = U(
1650
+ onSuccess: (l, h, o) => {
1651
+ const p = U(
1643
1652
  () => {
1644
- var d, c;
1645
- return (c = (d = t.config).onSuccess) == null ? void 0 : c.call(
1646
- d,
1647
- i,
1648
- l,
1653
+ var f, b;
1654
+ return (b = (f = t.config).onSuccess) == null ? void 0 : b.call(
1649
1655
  f,
1656
+ l,
1657
+ h,
1658
+ o,
1650
1659
  this
1651
1660
  );
1652
1661
  }
1653
- ), o = U(
1662
+ ), d = U(
1654
1663
  () => {
1655
- var d, c;
1656
- return (c = (d = this.options).onSuccess) == null ? void 0 : c.call(d, i, l, f);
1664
+ var f, b;
1665
+ return (b = (f = this.options).onSuccess) == null ? void 0 : b.call(f, l, h, o);
1657
1666
  }
1658
1667
  );
1659
- return Te(h, o).pipe(ke());
1668
+ return De(p, d).pipe(ke());
1660
1669
  }
1661
1670
  },
1662
1671
  state: this.state,
1663
- variables: u
1664
- }).pipe(Z(a(this, re)))
1672
+ variables: c
1673
+ }).pipe(re(a(this, te)))
1665
1674
  )
1666
- );
1667
- this.state$ = C(
1668
- n,
1669
- /**
1670
- * We keep state forever since only a explicit destroy
1671
- * may terminate the mutation
1672
- */
1673
- Oe
1674
- ).pipe(
1675
+ ), i = F(n, u);
1676
+ this.state$ = i.pipe(
1675
1677
  oe(this.state),
1676
- E((u) => {
1677
- this.state = { ...this.state, ...u };
1678
+ Ye(
1679
+ (c, l) => ({
1680
+ ...c,
1681
+ ...l
1682
+ }),
1683
+ this.state
1684
+ ),
1685
+ Pt,
1686
+ E((c) => {
1687
+ this.state = c;
1678
1688
  }),
1679
- Z(a(this, re)),
1680
- /**
1681
- * refCount as true somewhat make NEVER complete when there are
1682
- * no more observers. I thought I should have to complete manually (which is
1683
- * why we still cancel the observable when we remove it from cache)
1684
- */
1685
- Ue({ bufferSize: 1, refCount: !1 }),
1686
- ct((u) => {
1687
- a(this, Fe).next(u);
1689
+ Qe(1),
1690
+ ct((c) => {
1691
+ a(this, Ce).next(c);
1688
1692
  })
1689
1693
  );
1690
1694
  }
@@ -1700,60 +1704,64 @@ class Wr {
1700
1704
  * is over, unlike the state which can be re-subscribed later.
1701
1705
  */
1702
1706
  execute(e) {
1703
- return a(this, pe).next(e), a(this, pe).complete(), this.state$.pipe($e);
1707
+ return a(this, pe).next(e), a(this, pe).complete(), this.state$.pipe(Oe);
1704
1708
  }
1705
1709
  continue() {
1706
1710
  return this.execute(this.state.variables);
1707
1711
  }
1708
- // @todo merge with query
1712
+ /**
1713
+ * Cancel if needed and finalize the mutation.
1714
+ * The mutation will be garbage collected automatically
1715
+ * when no more observers are listening
1716
+ */
1709
1717
  cancel() {
1710
- a(this, re).next(), a(this, re).complete();
1718
+ a(this, te).next(), a(this, te).complete();
1711
1719
  }
1712
1720
  }
1713
- Fe = new WeakMap(), re = new WeakMap(), pe = new WeakMap();
1714
- const Et = ({
1715
- mutationKey: r,
1721
+ Ce = new WeakMap(), te = new WeakMap(), pe = new WeakMap();
1722
+ const xt = ({
1723
+ mutationKey: s,
1716
1724
  status: e,
1717
1725
  predicate: t,
1718
- exact: s = !0
1719
- } = {}) => (u) => s && r !== void 0 && u.options.mutationKey !== void 0 && !qe(u.options.mutationKey, r, { exact: s }) || !s && r !== void 0 && u.options.mutationKey !== void 0 && !qe(u.options.mutationKey, r, { exact: s }) || e && u.state.status !== e ? !1 : t ? t(u) : !0;
1720
- class Lt {
1726
+ exact: r = !0
1727
+ } = {}) => (u) => r && s !== void 0 && u.options.mutationKey !== void 0 && !He(u.options.mutationKey, s, { exact: r }) || !r && s !== void 0 && u.options.mutationKey !== void 0 && !He(u.options.mutationKey, s, { exact: r }) || e && u.state.status !== e ? !1 : t ? t(u) : !0;
1728
+ class zt {
1721
1729
  constructor() {
1722
1730
  /**
1723
1731
  * @important
1724
1732
  * Query store. Could be turned into a map for more performance.
1725
1733
  */
1726
- b(this, "entriesSubject", new J([]));
1727
- b(this, "changeSubject", new I());
1728
- b(this, "entries$", this.entriesSubject.pipe(fe()));
1729
- b(this, "added$", this.changeSubject.pipe(
1734
+ m(this, "entriesSubject", new J([]));
1735
+ m(this, "changeSubject", new I());
1736
+ m(this, "entries$", this.entriesSubject.pipe(he()));
1737
+ m(this, "added$", this.changeSubject.pipe(
1730
1738
  O(({ type: e }) => e === "added"),
1731
1739
  g(({ entity: e }) => e),
1732
- fe()
1740
+ he()
1733
1741
  ));
1734
- b(this, "removed$", this.changeSubject.pipe(
1742
+ m(this, "removed$", this.changeSubject.pipe(
1735
1743
  O(({ type: e }) => e === "removed"),
1736
1744
  g(({ entity: e }) => e),
1737
- fe()
1745
+ he()
1738
1746
  ));
1739
- b(this, "stateChange$", C(
1747
+ m(this, "stateChange$", F(
1740
1748
  this.entriesSubject.pipe(
1741
1749
  Ge(),
1742
- T((e) => ge(e))
1750
+ k((e) => ge(e))
1743
1751
  ),
1744
1752
  this.added$
1745
1753
  ).pipe(
1746
- T(
1754
+ k(
1747
1755
  (e) => e.state$.pipe(
1748
1756
  g(() => e),
1749
- Z(
1757
+ re(
1750
1758
  this.removed$.pipe(
1751
1759
  O((t) => t === e)
1752
1760
  )
1753
1761
  )
1754
1762
  )
1755
1763
  ),
1756
- fe()
1764
+ he()
1757
1765
  ));
1758
1766
  }
1759
1767
  getValues() {
@@ -1772,16 +1780,16 @@ class Lt {
1772
1780
  }
1773
1781
  }
1774
1782
  var K;
1775
- class Gr {
1783
+ class Ys {
1776
1784
  constructor(e = {}) {
1777
- w(this, K, new Lt());
1785
+ C(this, K, new zt());
1778
1786
  this.config = e;
1779
1787
  }
1780
- build(e, t, s) {
1781
- const n = new Wr({
1788
+ build(e, t, r) {
1789
+ const n = new Js({
1782
1790
  mutationCache: this,
1783
1791
  options: e.defaultMutationOptions(t),
1784
- state: s
1792
+ state: r
1785
1793
  });
1786
1794
  return n.state$.pipe(
1787
1795
  /**
@@ -1792,12 +1800,12 @@ class Gr {
1792
1800
  x(
1793
1801
  () => n.observerCount$.pipe(
1794
1802
  O((u) => u <= 1),
1795
- He(1)
1803
+ qe(1)
1796
1804
  )
1797
1805
  ),
1798
1806
  // defaults to 5mn
1799
- x(() => Qe(n.options.gcTime ?? 5 * 60 * 1e3)),
1800
- He(1)
1807
+ x(() => Ae(n.options.gcTime ?? 5 * 60 * 1e3)),
1808
+ qe(1)
1801
1809
  ).subscribe({
1802
1810
  complete: () => {
1803
1811
  this.remove(n);
@@ -1808,16 +1816,16 @@ class Gr {
1808
1816
  return this.findAll();
1809
1817
  }
1810
1818
  remove(e) {
1811
- const t = a(this, K).getValues().find((s) => s === e);
1819
+ const t = a(this, K).getValues().find((r) => r === e);
1812
1820
  t == null || t.cancel(), a(this, K).remove(e);
1813
1821
  }
1814
1822
  find(e) {
1815
- const t = { exact: !0, ...e }, s = Et(t);
1816
- return a(this, K).getValues().find((n) => s(n));
1823
+ const t = { exact: !0, ...e }, r = xt(t);
1824
+ return a(this, K).getValues().find((n) => r(n));
1817
1825
  }
1818
1826
  findAll(e = {}) {
1819
- const t = { exact: !0, ...e }, s = Et(t);
1820
- return a(this, K).getValues().filter((n) => s(n)).map((n) => n);
1827
+ const t = { exact: !0, ...e }, r = xt(t);
1828
+ return a(this, K).getValues().filter((n) => r(n)).map((n) => n);
1821
1829
  }
1822
1830
  observe() {
1823
1831
  return a(this, K).stateChange$.pipe(oe());
@@ -1827,32 +1835,32 @@ class Gr {
1827
1835
  * ISO api react-query
1828
1836
  */
1829
1837
  subscribe(e) {
1830
- const t = C(
1838
+ const t = F(
1831
1839
  a(this, K).added$.pipe(
1832
- E((s) => {
1840
+ E((r) => {
1833
1841
  e({
1834
1842
  type: "added",
1835
- mutation: s
1843
+ mutation: r
1836
1844
  });
1837
1845
  })
1838
1846
  ),
1839
1847
  a(this, K).removed$.pipe(
1840
- E((s) => {
1848
+ E((r) => {
1841
1849
  e({
1842
1850
  type: "removed",
1843
- mutation: s
1851
+ mutation: r
1844
1852
  });
1845
1853
  })
1846
1854
  ),
1847
1855
  a(this, K).stateChange$.pipe(
1848
- E((s) => {
1856
+ E((r) => {
1849
1857
  e({
1850
1858
  type: "updated",
1851
1859
  action: {
1852
- ...s.state,
1860
+ ...r.state,
1853
1861
  type: "success"
1854
1862
  },
1855
- mutation: s
1863
+ mutation: r
1856
1864
  });
1857
1865
  })
1858
1866
  )
@@ -1863,12 +1871,12 @@ class Gr {
1863
1871
  }
1864
1872
  resumePausedMutations() {
1865
1873
  const e = this.findAll({
1866
- predicate: (s) => s.state.isPaused
1874
+ predicate: (r) => r.state.isPaused
1867
1875
  });
1868
1876
  if (!e.length)
1869
- return Me;
1870
- const t = e.map((s) => s.continue());
1871
- return ar(t);
1877
+ return je;
1878
+ const t = e.map((r) => r.continue());
1879
+ return cs(t);
1872
1880
  }
1873
1881
  clear() {
1874
1882
  this.getAll().forEach((e) => {
@@ -1877,13 +1885,13 @@ class Gr {
1877
1885
  }
1878
1886
  }
1879
1887
  K = new WeakMap();
1880
- const Jr = typeof window > "u" || "Deno" in window;
1881
- function Yr(r) {
1882
- const e = typeof r.initialData == "function" ? r.initialData() : r.initialData, t = typeof e < "u", s = t ? typeof r.initialDataUpdatedAt == "function" ? r.initialDataUpdatedAt() : r.initialDataUpdatedAt : 0;
1888
+ const Bs = typeof window > "u" || "Deno" in window;
1889
+ function Xs(s) {
1890
+ const e = typeof s.initialData == "function" ? s.initialData() : s.initialData, t = typeof e < "u", r = t ? typeof s.initialDataUpdatedAt == "function" ? s.initialDataUpdatedAt() : s.initialDataUpdatedAt : 0;
1883
1891
  return {
1884
1892
  data: e,
1885
1893
  dataUpdateCount: 0,
1886
- dataUpdatedAt: t ? s ?? Date.now() : 0,
1894
+ dataUpdatedAt: t ? r ?? Date.now() : 0,
1887
1895
  error: null,
1888
1896
  errorUpdateCount: 0,
1889
1897
  errorUpdatedAt: 0,
@@ -1895,61 +1903,64 @@ function Yr(r) {
1895
1903
  fetchStatus: "idle"
1896
1904
  };
1897
1905
  }
1898
- const Br = (r) => Ae(() => _e.isFocused() ? r : _e.focusRegained$.pipe(T(() => r))), Xr = (r) => {
1906
+ const Zs = (s) => Me(() => Le.isFocused() ? s : Le.focusRegained$.pipe(k(() => s))), er = (s) => {
1899
1907
  let e = 0;
1900
1908
  return (t) => {
1901
- const s = se.backToOnline$.pipe(
1902
- T(
1903
- () => C(
1904
- S({ fetchStatus: "fetching" }),
1909
+ const r = se.backToOnline$.pipe(
1910
+ k(
1911
+ () => F(
1912
+ v({ fetchStatus: "fetching" }),
1905
1913
  t
1906
1914
  )
1907
1915
  )
1908
1916
  );
1909
- return Ae(() => (e++, !se.isOnline() && r.networkMode === "offlineFirst" && e > 1 ? C(
1910
- S({ fetchStatus: "paused" }),
1911
- s
1912
- ) : !se.isOnline() && r.networkMode !== "always" && r.networkMode !== "offlineFirst" ? C(
1913
- S({ fetchStatus: "paused" }),
1914
- s
1917
+ return Me(() => (e++, !se.isOnline() && s.networkMode === "offlineFirst" && e > 1 ? F(
1918
+ v({ fetchStatus: "paused" }),
1919
+ r
1920
+ ) : !se.isOnline() && s.networkMode !== "always" && s.networkMode !== "offlineFirst" ? F(
1921
+ v({ fetchStatus: "paused" }),
1922
+ r
1915
1923
  ) : t));
1916
1924
  };
1917
- }, Zr = (r) => (e) => {
1918
- const t = new I(), s = t.pipe(
1925
+ }, tr = (s) => (e) => {
1926
+ const t = new I(), r = t.pipe(
1919
1927
  Ge(),
1920
1928
  /**
1921
1929
  * Since we set hasDataSubject synchronously, we need to wait
1922
1930
  * for the next tick to make sure observable chain received this data at least
1923
1931
  */
1924
- ut(1),
1925
- T(() => r.pipe(O((n) => n === 0)))
1932
+ at(1),
1933
+ k(() => s.pipe(O((n) => n === 0)))
1926
1934
  );
1927
1935
  return e.pipe(
1928
1936
  E(() => {
1929
1937
  t.next();
1930
1938
  }),
1931
- Z(s)
1939
+ re(r)
1932
1940
  );
1933
- }, es = (r) => {
1941
+ }, sr = (s) => {
1934
1942
  const e = async () => await Promise.reject(new Error("No query found"));
1943
+ process.env.NODE_ENV !== "production" && s.queryFn === nt && console.error(
1944
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${s.queryHash}'`
1945
+ );
1935
1946
  let t = !1;
1936
- const s = r.queryFn ?? e, n = new AbortController(), u = {
1937
- meta: r.meta,
1938
- queryKey: r.queryKey
1947
+ const r = s.queryFn && s.queryFn !== nt ? s.queryFn : e, n = new AbortController(), u = {
1948
+ meta: s.meta,
1949
+ queryKey: s.queryKey
1939
1950
  };
1940
1951
  ((o) => {
1941
1952
  Object.defineProperty(o, "signal", {
1942
1953
  enumerable: !0,
1943
- get: () => (r.onSignalConsumed(), n.signal)
1954
+ get: () => (s.onSignalConsumed(), n.signal)
1944
1955
  });
1945
1956
  })(u);
1946
- const f = (typeof s == "function" ? (
1957
+ const l = (typeof r == "function" ? (
1947
1958
  // eslint-disable-next-line @typescript-eslint/promise-function-async
1948
1959
  U(
1949
- () => s(u)
1960
+ () => r(u)
1950
1961
  )
1951
- ) : s).pipe(
1952
- Zr(r.observers$),
1962
+ ) : r).pipe(
1963
+ tr(s.observers$),
1953
1964
  E({
1954
1965
  complete: () => {
1955
1966
  t = !0;
@@ -1961,26 +1972,26 @@ const Br = (r) => Ae(() => _e.isFocused() ? r : _e.focusRegained$.pipe(T(() => r
1961
1972
  })
1962
1973
  ),
1963
1974
  // takeUntil(hasDataAndNoObservers$),
1964
- Xr(r),
1965
- It({
1966
- ...r,
1967
- retryAfter: () => S(!0).pipe(Br),
1968
- catchError: (o, d) => S({
1975
+ er(s),
1976
+ Vt({
1977
+ ...s,
1978
+ retryAfter: () => v(!0).pipe(Zs),
1979
+ catchError: (o, p) => v({
1969
1980
  status: "error",
1970
1981
  fetchStatus: "idle",
1971
1982
  fetchFailureCount: o,
1972
- fetchFailureReason: d,
1973
- error: d
1983
+ fetchFailureReason: p,
1984
+ error: p
1974
1985
  }),
1975
- caughtError: (o, d) => (
1986
+ caughtError: (o, p) => (
1976
1987
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1977
- S({
1988
+ v({
1978
1989
  fetchFailureCount: o,
1979
- fetchFailureReason: d
1990
+ fetchFailureReason: p
1980
1991
  })
1981
1992
  )
1982
1993
  }),
1983
- T((o) => "data" in o ? S({
1994
+ k((o) => "data" in o ? v({
1984
1995
  ...o,
1985
1996
  status: "success",
1986
1997
  fetchStatus: "idle",
@@ -2003,40 +2014,40 @@ const Br = (r) => Ae(() => _e.isFocused() ? r : _e.focusRegained$.pipe(T(() => r
2003
2014
  *
2004
2015
  * There is in theory no problem associated to that.
2005
2016
  */
2006
- ut(1),
2017
+ at(1),
2007
2018
  g(
2008
- (d) => t ? d : { ...d, fetchStatus: "fetching" }
2019
+ (p) => t ? p : { ...p, fetchStatus: "fetching" }
2009
2020
  )
2010
- ) : S(o)),
2021
+ ) : v(o)),
2011
2022
  /**
2012
2023
  * When the fn complete we can release the fetch status, if it was already released
2013
2024
  * before shallow compare will not update the state, otherwise it's our chance to catch
2014
2025
  * the end of observable fn.
2015
2026
  */
2016
- cr({ fetchStatus: "idle" }),
2017
- fe()
2018
- ), h = S({
2027
+ ls({ fetchStatus: "idle" }),
2028
+ he()
2029
+ ), h = v({
2019
2030
  status: "pending",
2020
2031
  fetchStatus: se.isOnline() ? "fetching" : "paused"
2021
2032
  });
2022
2033
  return {
2023
- state$: C(
2034
+ state$: F(
2024
2035
  h,
2025
- f
2036
+ l
2026
2037
  // emitOnComplete$
2027
- ).pipe(fe()),
2038
+ ).pipe(he()),
2028
2039
  abortController: n
2029
2040
  };
2030
2041
  };
2031
- class ts {
2042
+ class rr {
2032
2043
  constructor(e) {
2033
- b(this, "revert");
2034
- b(this, "silent");
2044
+ m(this, "revert");
2045
+ m(this, "silent");
2035
2046
  this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
2036
2047
  }
2037
2048
  }
2038
- const rs = { backgroundColor: "transparent", color: "inherit" };
2039
- function _t(r) {
2049
+ const nr = { backgroundColor: "transparent", color: "inherit" };
2050
+ function Wt(s) {
2040
2051
  const e = {
2041
2052
  namespaces: [
2042
2053
  {
@@ -2044,25 +2055,25 @@ function _t(r) {
2044
2055
  style: { backgroundColor: "#d02f4e", color: "white" }
2045
2056
  }
2046
2057
  ],
2047
- namespace(t, s) {
2048
- const n = _t();
2058
+ namespace(t, r) {
2059
+ const n = Wt();
2049
2060
  return n.namespaces.push({
2050
2061
  name: t,
2051
- style: s ?? rs
2062
+ style: r ?? nr
2052
2063
  }), n;
2053
2064
  },
2054
2065
  printNamespaces() {
2055
2066
  return {
2056
2067
  namespaces: e.namespaces.map(({ name: t }) => `%c ${t} %c`).join(" "),
2057
- styles: e.namespaces.reduce((t, { style: s }) => (t.push(
2058
- `background-color: ${s.backgroundColor}; color: ${s.color};`
2068
+ styles: e.namespaces.reduce((t, { style: r }) => (t.push(
2069
+ `background-color: ${r.backgroundColor}; color: ${r.color};`
2059
2070
  ), t.push("background-color: transparent; color: inherit;"), t), [])
2060
2071
  };
2061
2072
  },
2062
- print(t, ...s) {
2073
+ print(t, ...r) {
2063
2074
  return e;
2064
2075
  },
2065
- printWithoutNamespace(t, ...s) {
2076
+ printWithoutNamespace(t, ...r) {
2066
2077
  return e;
2067
2078
  },
2068
2079
  log(...t) {
@@ -2083,32 +2094,32 @@ function _t(r) {
2083
2094
  };
2084
2095
  return e;
2085
2096
  }
2086
- const ss = _t();
2087
- var Ee, ae;
2088
- class ns {
2097
+ const ir = Wt();
2098
+ var Fe, ue;
2099
+ class ur {
2089
2100
  constructor(e) {
2090
- b(this, "queryKey");
2091
- b(this, "queryHash");
2092
- b(this, "gcTime");
2093
- b(this, "options");
2094
- w(this, Ee, void 0);
2095
- w(this, ae, void 0);
2096
- b(this, "state");
2101
+ m(this, "queryKey");
2102
+ m(this, "queryHash");
2103
+ m(this, "gcTime");
2104
+ m(this, "options");
2105
+ C(this, Fe, void 0);
2106
+ C(this, ue, void 0);
2107
+ m(this, "state");
2097
2108
  // @todo to share with mutation
2098
- b(this, "executeSubject", new I());
2099
- b(this, "cancelSubject", new I());
2100
- b(this, "setDataSubject", new I());
2101
- b(this, "invalidatedSubject", new I());
2102
- b(this, "resetSubject", new I());
2103
- b(this, "destroySubject", new I());
2104
- b(this, "observersSubject", new J([]));
2105
- b(this, "abortSignalConsumed", !1);
2106
- b(this, "observerCount$", this.observersSubject.asObservable().pipe(g((e) => e.length)));
2107
- b(this, "observers$", this.observersSubject.asObservable());
2108
- b(this, "state$");
2109
- M(this, Ee, e.defaultOptions), this.options = this.setOptions(e.options), this.queryKey = e.queryKey, this.queryHash = e.queryHash, M(this, ae, e.state ?? Yr(this.options)), this.state = a(this, ae), this.gcTime = this.updateGcTime(this.options.gcTime), this.state$ = C(
2109
+ m(this, "executeSubject", new I());
2110
+ m(this, "cancelSubject", new I());
2111
+ m(this, "setDataSubject", new I());
2112
+ m(this, "invalidatedSubject", new I());
2113
+ m(this, "resetSubject", new I());
2114
+ m(this, "destroySubject", new I());
2115
+ m(this, "observersSubject", new J([]));
2116
+ m(this, "abortSignalConsumed", !1);
2117
+ m(this, "observerCount$", this.observersSubject.asObservable().pipe(g((e) => e.length)));
2118
+ m(this, "observers$", this.observersSubject.asObservable());
2119
+ m(this, "state$");
2120
+ M(this, Fe, e.defaultOptions), this.options = this.setOptions(e.options), this.queryKey = e.queryKey, this.queryHash = e.queryHash, M(this, ue, e.state ?? Xs(this.options)), this.state = a(this, ue), this.gcTime = this.updateGcTime(this.options.gcTime), this.state$ = F(
2110
2121
  this.resetSubject.pipe(
2111
- g(() => ({ command: "reset", state: a(this, ae) }))
2122
+ g(() => ({ command: "reset", state: a(this, ue) }))
2112
2123
  ),
2113
2124
  this.invalidatedSubject.pipe(
2114
2125
  O(() => !this.state.isInvalidated),
@@ -2126,89 +2137,89 @@ class ns {
2126
2137
  state: {
2127
2138
  status: t != null && t.revert ? this.state.status : "error",
2128
2139
  fetchStatus: "idle",
2129
- error: new ts(t)
2140
+ error: new rr(t)
2130
2141
  }
2131
2142
  }))
2132
2143
  ),
2133
2144
  this.executeSubject.pipe(
2134
- T(() => {
2145
+ k(() => {
2135
2146
  let t = !1;
2136
- const s = this.executeSubject.pipe(
2147
+ const r = this.executeSubject.pipe(
2137
2148
  // should not be needed since the fetch return current promise
2138
2149
  // in case we don't cancel
2139
2150
  O((h) => (h == null ? void 0 : h.cancelRefetch) !== !1)
2140
2151
  ), n = this.observers$.pipe(
2141
- jt(),
2152
+ Mt(),
2142
2153
  E(([h, o]) => {
2143
2154
  o.length === 0 && h.length > 0 ? t = !0 : t = !1;
2144
2155
  }),
2145
- he()
2146
- ), { state$: u, abortController: i } = es({
2156
+ le()
2157
+ ), { state$: u, abortController: i } = sr({
2147
2158
  ...this.options,
2148
2159
  observers$: this.observerCount$,
2149
2160
  queryKey: this.queryKey,
2150
2161
  retry: (h, o) => {
2151
- const d = this.options.retry ?? !0;
2152
- return typeof d == "function" ? d(h, o) : typeof d == "boolean" ? d : h < d;
2162
+ const p = this.options.retry ?? !0;
2163
+ return typeof p == "function" ? p(h, o) : typeof p == "boolean" ? p : h < p;
2153
2164
  },
2154
2165
  retryAfterDelay: () => !t,
2155
2166
  onSignalConsumed: () => {
2156
2167
  this.abortSignalConsumed = !0;
2157
2168
  }
2158
- }), l = this.observerCount$.pipe(
2169
+ }), c = this.observerCount$.pipe(
2159
2170
  O((h) => h === 0 && this.abortSignalConsumed),
2160
2171
  E(() => {
2161
2172
  this.cancelSubject.next({ revert: !0 });
2162
2173
  })
2163
- ), f = C(
2174
+ ), l = F(
2164
2175
  this.cancelSubject,
2165
- s,
2176
+ r,
2166
2177
  this.resetSubject,
2167
- l
2178
+ c
2168
2179
  ).pipe(
2169
2180
  E(() => {
2170
2181
  this.abortSignalConsumed && i.abort();
2171
2182
  })
2172
2183
  );
2173
- return C(u, n).pipe(
2184
+ return F(u, n).pipe(
2174
2185
  g((h) => ({
2175
2186
  command: "execute",
2176
2187
  state: h
2177
2188
  })),
2178
- Z(f)
2189
+ re(l)
2179
2190
  );
2180
2191
  })
2181
2192
  ),
2182
2193
  this.setDataSubject.pipe(
2183
- g(({ data: t, options: s }) => ({
2194
+ g(({ data: t, options: r }) => ({
2184
2195
  command: "setData",
2185
2196
  state: {
2186
2197
  status: "success",
2187
2198
  data: t,
2188
- dataUpdatedAt: (s == null ? void 0 : s.updatedAt) !== void 0 ? s.updatedAt : (/* @__PURE__ */ new Date()).getTime()
2199
+ dataUpdatedAt: (r == null ? void 0 : r.updatedAt) !== void 0 ? r.updatedAt : (/* @__PURE__ */ new Date()).getTime()
2189
2200
  }
2190
2201
  }))
2191
2202
  )
2192
2203
  ).pipe(
2193
- Ir({
2204
+ Ps({
2194
2205
  initialState: this.state,
2195
2206
  getOptions: () => this.options,
2196
2207
  getState: () => this.state
2197
2208
  }),
2198
- oe(a(this, ae)),
2209
+ oe(a(this, ue)),
2199
2210
  Q(V),
2200
2211
  E((t) => {
2201
2212
  this.state = t;
2202
2213
  }),
2203
2214
  B((t) => {
2204
- throw ss.error(t), t;
2215
+ throw ir.error(t), t;
2205
2216
  }),
2206
- Z(this.destroySubject),
2207
- Ue({ bufferSize: 1, refCount: !1 })
2217
+ re(this.destroySubject),
2218
+ Qe({ bufferSize: 1, refCount: !1 })
2208
2219
  );
2209
2220
  }
2210
2221
  setOptions(e) {
2211
- return this.options = { ...a(this, Ee), ...e }, this.updateGcTime(this.options.gcTime), this.options;
2222
+ return this.options = { ...a(this, Fe), ...e }, this.updateGcTime(this.options.gcTime), this.options;
2212
2223
  }
2213
2224
  get meta() {
2214
2225
  return this.options.meta;
@@ -2245,7 +2256,7 @@ class ns {
2245
2256
  },
2246
2257
  unsubscribe: () => {
2247
2258
  this.observersSubject.next(
2248
- this.observersSubject.getValue().filter((s) => s !== e)
2259
+ this.observersSubject.getValue().filter((r) => r !== e)
2249
2260
  );
2250
2261
  }
2251
2262
  })
@@ -2258,7 +2269,7 @@ class ns {
2258
2269
  updateGcTime(e) {
2259
2270
  return this.gcTime = Math.max(
2260
2271
  this.gcTime || 0,
2261
- e ?? (Jr ? 1 / 0 : 5 * 60 * 1e3)
2272
+ e ?? (Bs ? 1 / 0 : 5 * 60 * 1e3)
2262
2273
  ), this.gcTime;
2263
2274
  }
2264
2275
  isActive() {
@@ -2271,25 +2282,25 @@ class ns {
2271
2282
  return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observersSubject.getValue().some((e) => e.getCurrentResult().isStale);
2272
2283
  }
2273
2284
  isStaleByTime(e = 0) {
2274
- return this.state.isInvalidated || !this.state.dataUpdatedAt || !Qr(this.state.dataUpdatedAt, e);
2285
+ return this.state.isInvalidated || !this.state.dataUpdatedAt || !Is(this.state.dataUpdatedAt, e);
2275
2286
  }
2276
2287
  async getFetchResultAsPromise() {
2277
2288
  return await new Promise((e, t) => {
2278
- this.state$.pipe(kt, Ke()).subscribe({
2289
+ this.state$.pipe(Nt, Te()).subscribe({
2279
2290
  error: t,
2280
- next: (s) => {
2281
- s.error ? t(s.error) : e(s.data);
2291
+ next: (r) => {
2292
+ r.error ? t(r.error) : e(r.data);
2282
2293
  }
2283
2294
  });
2284
2295
  });
2285
2296
  }
2286
2297
  async fetch(e, t) {
2287
- const { cancelRefetch: s } = t ?? {};
2288
- return this.state.fetchStatus !== "idle" && !(!!this.state.dataUpdatedAt && s) ? await this.getFetchResultAsPromise() : (e && this.setOptions(e), this.executeSubject.next(t), await this.getFetchResultAsPromise());
2298
+ const { cancelRefetch: r } = t ?? {};
2299
+ return this.state.fetchStatus !== "idle" && !(!!this.state.dataUpdatedAt && r) ? await this.getFetchResultAsPromise() : (e && this.setOptions(e), this.executeSubject.next(t), await this.getFetchResultAsPromise());
2289
2300
  }
2290
2301
  setData(e, t) {
2291
- const s = Le(this.state.data, e, this.options);
2292
- return this.setDataSubject.next({ data: s, options: t }), s;
2302
+ const r = _e(this.state.data, e, this.options);
2303
+ return this.setDataSubject.next({ data: r, options: t }), r;
2293
2304
  }
2294
2305
  invalidate() {
2295
2306
  this.invalidatedSubject.next();
@@ -2306,14 +2317,14 @@ class ns {
2306
2317
  this.resetSubject.next();
2307
2318
  }
2308
2319
  }
2309
- Ee = new WeakMap(), ae = new WeakMap();
2310
- var xe, G;
2311
- class is {
2320
+ Fe = new WeakMap(), ue = new WeakMap();
2321
+ var Ee, G;
2322
+ class ar {
2312
2323
  // protected mountSubscriptions: Subscription[]
2313
2324
  constructor(e = {}) {
2314
2325
  // readonly #queries: QueryStore = new Map<string, Query>()
2315
- w(this, xe, new I());
2316
- w(this, G, new Lt());
2326
+ C(this, Ee, new I());
2327
+ C(this, G, new zt());
2317
2328
  this.config = e;
2318
2329
  }
2319
2330
  mount() {
@@ -2321,7 +2332,7 @@ class is {
2321
2332
  unmount() {
2322
2333
  }
2323
2334
  notify(e) {
2324
- a(this, xe).next(e);
2335
+ a(this, Ee).next(e);
2325
2336
  }
2326
2337
  observeIsFetching(e) {
2327
2338
  return a(this, G).stateChange$.pipe(
@@ -2339,17 +2350,17 @@ class is {
2339
2350
  }
2340
2351
  findAll(e = {}) {
2341
2352
  const t = this.getAll();
2342
- return Object.keys(e).length > 0 ? t.filter((s) => Ft(e, s)) : t;
2353
+ return Object.keys(e).length > 0 ? t.filter((r) => Et(e, r)) : t;
2343
2354
  }
2344
- build(e, t, s) {
2345
- const n = t.queryKey ?? [at()], u = t.queryHash ?? lt(n, t);
2355
+ build(e, t, r) {
2356
+ const n = t.queryKey ?? [ot()], u = t.queryHash ?? ht(n, t);
2346
2357
  let i = this.get(u);
2347
- return i || (i = new ns({
2358
+ return i || (i = new ur({
2348
2359
  cache: this,
2349
2360
  queryKey: n,
2350
2361
  queryHash: u,
2351
2362
  options: e.defaultQueryOptions(t),
2352
- state: s,
2363
+ state: r,
2353
2364
  defaultOptions: e.getQueryDefaults(n)
2354
2365
  }), this.add(i)), i;
2355
2366
  }
@@ -2357,19 +2368,19 @@ class is {
2357
2368
  if (!a(this, G).find((t) => t.queryHash === e.queryHash)) {
2358
2369
  a(this, G).add(e);
2359
2370
  const t = e.observerCount$.pipe(
2360
- O((s) => s < 1),
2361
- He(1)
2371
+ O((r) => r < 1),
2372
+ qe(1)
2362
2373
  );
2363
2374
  e.success$.subscribe(() => {
2364
- var s, n;
2365
- (n = (s = this.config).onSuccess) == null || n.call(s, e.state.data, e);
2375
+ var r, n;
2376
+ (n = (r = this.config).onSuccess) == null || n.call(r, e.state.data, e);
2366
2377
  }), e.error$.subscribe(() => {
2367
- var s, n;
2368
- (n = (s = this.config).onError) == null || n.call(s, e.state.error, e);
2378
+ var r, n;
2379
+ (n = (r = this.config).onError) == null || n.call(r, e.state.error, e);
2369
2380
  }), e.settled$.subscribe(() => {
2370
- var s, n;
2371
- (n = (s = this.config).onSettled) == null || n.call(
2372
- s,
2381
+ var r, n;
2382
+ (n = (r = this.config).onSettled) == null || n.call(
2383
+ r,
2373
2384
  e.state.data,
2374
2385
  e.state.error,
2375
2386
  e
@@ -2379,12 +2390,12 @@ class is {
2379
2390
  * Once a mutation is finished and there are no more observers than us
2380
2391
  * we start the process of cleaning it up based on gc settings
2381
2392
  */
2382
- Vr,
2383
- x((s) => s ? t.pipe(
2393
+ Ds,
2394
+ x((r) => r ? t.pipe(
2384
2395
  // defaults to 5mn
2385
- x(() => e.gcTime === 1 / 0 ? Oe : (setTimeout(N, e.gcTime), Qe(e.gcTime)))
2386
- ) : Oe),
2387
- He(1)
2396
+ x(() => e.gcTime === 1 / 0 ? Ne : (setTimeout(N, e.gcTime), Ae(e.gcTime)))
2397
+ ) : Ne),
2398
+ qe(1)
2388
2399
  ).subscribe({
2389
2400
  complete: () => {
2390
2401
  this.remove(e);
@@ -2398,12 +2409,12 @@ class is {
2398
2409
  find(e) {
2399
2410
  const t = { exact: !0, ...e };
2400
2411
  return this.getAll().find(
2401
- (s) => Ft(t, s)
2412
+ (r) => Et(t, r)
2402
2413
  );
2403
2414
  }
2404
2415
  subscribe(e) {
2405
- const t = C(
2406
- a(this, xe).pipe(E(e))
2416
+ const t = F(
2417
+ a(this, Ee).pipe(E(e))
2407
2418
  // this.#store.added$.pipe(
2408
2419
  // mergeMap((query) => {
2409
2420
  // fn({
@@ -2433,34 +2444,34 @@ class is {
2433
2444
  };
2434
2445
  }
2435
2446
  remove(e) {
2436
- const t = a(this, G).find((s) => s === e);
2447
+ const t = a(this, G).find((r) => r === e);
2437
2448
  t && (e.destroy(), t === e && a(this, G).remove(e));
2438
2449
  }
2439
2450
  clear() {
2440
2451
  }
2441
2452
  }
2442
- xe = new WeakMap(), G = new WeakMap();
2443
- var ce, A, Re, je, be;
2444
- class ws {
2453
+ Ee = new WeakMap(), G = new WeakMap();
2454
+ var ae, A, xe, Re, be;
2455
+ class Fr {
2445
2456
  // #destroy = () => {}
2446
2457
  constructor({
2447
2458
  mutationCache: e,
2448
2459
  queryCache: t,
2449
- defaultOptions: s
2460
+ defaultOptions: r
2450
2461
  } = {}) {
2451
- w(this, ce, void 0);
2452
- w(this, A, void 0);
2453
- w(this, Re, /* @__PURE__ */ new Map());
2454
- w(this, je, /* @__PURE__ */ new Map());
2455
- w(this, be, void 0);
2456
- M(this, ce, e ?? new Gr()), M(this, A, t ?? new is()), M(this, be, s ?? {});
2462
+ C(this, ae, void 0);
2463
+ C(this, A, void 0);
2464
+ C(this, xe, /* @__PURE__ */ new Map());
2465
+ C(this, Re, /* @__PURE__ */ new Map());
2466
+ C(this, be, void 0);
2467
+ M(this, ae, e ?? new Ys()), M(this, A, t ?? new ar()), M(this, be, r ?? {});
2457
2468
  }
2458
2469
  mount() {
2459
2470
  }
2460
2471
  unmount() {
2461
2472
  }
2462
2473
  getMutationCache() {
2463
- return a(this, ce);
2474
+ return a(this, ae);
2464
2475
  }
2465
2476
  getQueryCache() {
2466
2477
  return a(this, A);
@@ -2473,98 +2484,98 @@ class ws {
2473
2484
  };
2474
2485
  }
2475
2486
  defaultQueryOptions(e) {
2476
- if (e != null && e._defaulted)
2487
+ if (e._defaulted)
2477
2488
  return e;
2478
2489
  const t = {
2479
2490
  ...a(this, be).queries,
2480
- ...(e == null ? void 0 : e.queryKey) && this.getQueryDefaults(e.queryKey),
2491
+ ...this.getQueryDefaults(e.queryKey),
2481
2492
  ...e,
2482
2493
  _defaulted: !0
2483
2494
  };
2484
- return t.queryHash || (t.queryHash = lt(
2495
+ return t.queryHash || (t.queryHash = ht(
2485
2496
  t.queryKey,
2486
2497
  t
2487
- )), typeof t.refetchOnReconnect > "u" && (t.refetchOnReconnect = t.networkMode !== "always"), typeof t.throwOnError > "u" && (t.throwOnError = !!t.suspense), typeof t.networkMode > "u" && t.persister && (t.networkMode = "offlineFirst"), t;
2498
+ )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn === nt && (t.enabled = !1), t;
2488
2499
  }
2489
2500
  async fetchQuery(e) {
2490
2501
  const t = this.defaultQueryOptions(e);
2491
2502
  typeof t.retry > "u" && (t.retry = !1);
2492
- const s = a(this, A).build(this, t);
2493
- return s.isStaleByTime(t.staleTime) ? await s.fetch(t) : await Promise.resolve(s.state.data);
2503
+ const r = a(this, A).build(this, t);
2504
+ return r.isStaleByTime(t.staleTime) ? await r.fetch(t) : await Promise.resolve(r.state.data);
2494
2505
  }
2495
2506
  async prefetchQuery(e) {
2496
2507
  await this.fetchQuery(e).then(N).catch(N);
2497
2508
  }
2498
2509
  async resetQueries(e, t) {
2499
- const s = a(this, A), n = {
2510
+ const r = a(this, A), n = {
2500
2511
  type: "active",
2501
2512
  ...e
2502
2513
  };
2503
- s.findAll(e).forEach((u) => {
2514
+ r.findAll(e).forEach((u) => {
2504
2515
  u.reset();
2505
2516
  }), await this.refetchQueries(n, t);
2506
2517
  }
2507
2518
  async refetchQueries(e = {}, t) {
2508
- const s = {
2519
+ const r = {
2509
2520
  ...t,
2510
2521
  cancelRefetch: (t == null ? void 0 : t.cancelRefetch) ?? !0
2511
2522
  }, n = a(this, A).findAll(e).filter((u) => !u.isDisabled()).map(async (u) => {
2512
- let i = u.fetch(void 0, s);
2513
- return s.throwOnError || (i = i.catch(N)), u.state.fetchStatus === "paused" ? void 0 : await i;
2523
+ let i = u.fetch(void 0, r);
2524
+ return r.throwOnError || (i = i.catch(N)), u.state.fetchStatus === "paused" ? void 0 : await i;
2514
2525
  });
2515
2526
  await Promise.all(n).then(N);
2516
2527
  }
2517
2528
  getQueryData(e) {
2518
- var s;
2529
+ var r;
2519
2530
  const t = this.defaultQueryOptions({ queryKey: e });
2520
- return (s = a(this, A).get(t.queryHash)) == null ? void 0 : s.state.data;
2531
+ return (r = a(this, A).get(t.queryHash)) == null ? void 0 : r.state.data;
2521
2532
  }
2522
- setQueryData(e, t, s) {
2523
- const n = a(this, A).find({ queryKey: e }), u = n == null ? void 0 : n.state.data, i = Ur(t, u);
2524
- if (typeof i > "u")
2525
- return;
2526
- const l = this.defaultQueryOptions({ queryKey: e });
2527
- return a(this, A).build(this, l).setData(i, { ...s, manual: !0 });
2533
+ setQueryData(e, t, r) {
2534
+ const n = this.defaultQueryOptions({ queryKey: e }), u = a(this, A).get(
2535
+ n.queryHash
2536
+ ), i = u == null ? void 0 : u.state.data, c = Vs(t, i);
2537
+ if (c !== void 0)
2538
+ return a(this, A).build(this, n).setData(c, { ...r, manual: !0 });
2528
2539
  }
2529
2540
  getMutationDefaults(e) {
2530
- const t = [...a(this, Re).values()];
2531
- let s = {};
2541
+ const t = [...a(this, xe).values()];
2542
+ let r = {};
2532
2543
  return t.forEach((n) => {
2533
- qe(e, n.mutationKey) && (s = { ...s, ...n.defaultOptions });
2534
- }), s;
2544
+ He(e, n.mutationKey) && (r = { ...r, ...n.defaultOptions });
2545
+ }), r;
2535
2546
  }
2536
2547
  getQueryState(e) {
2537
2548
  var t;
2538
2549
  return (t = a(this, A).find({ queryKey: e })) == null ? void 0 : t.state;
2539
2550
  }
2540
2551
  setMutationDefaults(e, t) {
2541
- a(this, Re).set(me(e), {
2552
+ a(this, xe).set(me(e), {
2542
2553
  mutationKey: e,
2543
2554
  defaultOptions: t
2544
2555
  });
2545
2556
  }
2546
2557
  setQueryDefaults(e, t) {
2547
- a(this, je).set(me(e), {
2558
+ a(this, Re).set(me(e), {
2548
2559
  queryKey: e,
2549
2560
  defaultOptions: t
2550
2561
  });
2551
2562
  }
2552
2563
  getQueryDefaults(e) {
2553
- const t = [...a(this, je).values()];
2554
- let s = {};
2564
+ const t = [...a(this, Re).values()];
2565
+ let r = {};
2555
2566
  return t.forEach((n) => {
2556
- Xe(e, n.queryKey) && (s = { ...s, ...n.defaultOptions });
2557
- }), s;
2567
+ Ze(e, n.queryKey) && (r = { ...r, ...n.defaultOptions });
2568
+ }), r;
2558
2569
  }
2559
2570
  removeQueries(e) {
2560
2571
  const t = a(this, A);
2561
- t.findAll(e).forEach((s) => {
2562
- t.remove(s);
2572
+ t.findAll(e).forEach((r) => {
2573
+ t.remove(r);
2563
2574
  });
2564
2575
  }
2565
2576
  async cancelQueries(e = {}, t = {}) {
2566
- const s = { revert: !0, ...t }, n = a(this, A).findAll(e).map(async (u) => {
2567
- await u.cancel(s);
2577
+ const r = { revert: !0, ...t }, n = a(this, A).findAll(e).map(async (u) => {
2578
+ await u.cancel(r);
2568
2579
  });
2569
2580
  await Promise.all(n).then(N).catch(N);
2570
2581
  }
@@ -2575,49 +2586,49 @@ class ws {
2575
2586
  await Promise.resolve();
2576
2587
  return;
2577
2588
  }
2578
- const s = {
2589
+ const r = {
2579
2590
  ...e,
2580
2591
  type: e.refetchType ?? e.type ?? "active"
2581
2592
  };
2582
- await this.refetchQueries(s, t);
2593
+ await this.refetchQueries(r, t);
2583
2594
  }
2584
2595
  async resumePausedMutations() {
2585
- return await or(a(this, ce).resumePausedMutations());
2596
+ return await hs(a(this, ae).resumePausedMutations());
2586
2597
  }
2587
2598
  isFetching(e) {
2588
2599
  return a(this, A).findAll({ ...e, fetchStatus: "fetching" }).length;
2589
2600
  }
2590
2601
  clear() {
2591
- a(this, A).clear(), a(this, ce).clear();
2602
+ a(this, A).clear(), a(this, ae).clear();
2592
2603
  }
2593
2604
  }
2594
- ce = new WeakMap(), A = new WeakMap(), Re = new WeakMap(), je = new WeakMap(), be = new WeakMap();
2605
+ ae = new WeakMap(), A = new WeakMap(), xe = new WeakMap(), Re = new WeakMap(), be = new WeakMap();
2595
2606
  export {
2596
- Gr as MutationCache,
2597
- is as QueryCache,
2598
- ws as QueryClient,
2599
- ms as QueryClientProvider,
2600
- yr as SIGNAL_RESET,
2601
- mr as createLocalStorageAdapter,
2602
- bs as createLocalforageAdapter,
2603
- $r as exponentialBackoffDelay,
2604
- Or as getDelay,
2605
- tt as isDefined,
2606
- It as retryBackoff,
2607
- ds as signal,
2608
- Ut as useBehaviorSubject,
2609
- Os as useForeverQuery,
2610
- H as useLiveRef,
2611
- Ss as useMutation,
2612
- fs as useObservableState,
2613
- Ye as useObserve,
2614
- hs as useObserveCallback,
2615
- ys as usePersistSignals,
2616
- vs as useQuery,
2617
- Pt as useQueryClient,
2618
- ps as useSignalValue,
2619
- Qt as useSubject,
2620
- At as useSubscribe,
2621
- $s as useSubscribeEffect,
2622
- gs as useUnmountObservable
2607
+ Ys as MutationCache,
2608
+ ar as QueryCache,
2609
+ Fr as QueryClient,
2610
+ vr as QueryClientProvider,
2611
+ ms as SIGNAL_RESET,
2612
+ vs as createLocalStorageAdapter,
2613
+ gr as createLocalforageAdapter,
2614
+ Cs as exponentialBackoffDelay,
2615
+ ws as getDelay,
2616
+ st as isDefined,
2617
+ Vt as retryBackoff,
2618
+ br as signal,
2619
+ It as useBehaviorSubject,
2620
+ wr as useForeverQuery,
2621
+ q as useLiveRef,
2622
+ Or as useMutation,
2623
+ pr as useObservableState,
2624
+ Be as useObserve,
2625
+ fr as useObserveCallback,
2626
+ mr as usePersistSignals,
2627
+ $r as useQuery,
2628
+ kt as useQueryClient,
2629
+ yr as useSignalValue,
2630
+ Ut as useSubject,
2631
+ Qt as useSubscribe,
2632
+ Cr as useSubscribeEffect,
2633
+ Sr as useUnmountObservable
2623
2634
  };