@scrippsproduct/networks-ui-library 1.1.7 → 1.1.9

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.
@@ -2,7 +2,7 @@ var pe = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var Wt = (e, t, s) => t.has(e) || pe("Cannot " + s);
5
- var r = (e, t, s) => (Wt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), o = (e, t, s, i) => (Wt(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), v = (e, t, s) => (Wt(e, t, "access private method"), s);
5
+ var r = (e, t, s) => (Wt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), o = (e, t, s, i) => (Wt(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), m = (e, t, s) => (Wt(e, t, "access private method"), s);
6
6
  var Ht = (e, t, s, i) => ({
7
7
  set _(n) {
8
8
  o(e, t, n, s);
@@ -115,8 +115,8 @@ function ge(e, t) {
115
115
  return !1;
116
116
  }
117
117
  if (s !== "all") {
118
- const d = t.isActive();
119
- if (s === "active" && !d || s === "inactive" && d)
118
+ const l = t.isActive();
119
+ if (s === "active" && !l || s === "inactive" && l)
120
120
  return !1;
121
121
  }
122
122
  return !(typeof u == "boolean" && t.isStale() !== u || n && n !== t.state.fetchStatus || a && !a(t));
@@ -153,11 +153,11 @@ function Xt(e, t) {
153
153
  const s = we(e) && we(t);
154
154
  if (!s && !(te(e) && te(t))) return t;
155
155
  const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), h = a.length, u = s ? new Array(h) : {};
156
- let d = 0;
156
+ let l = 0;
157
157
  for (let b = 0; b < h; b++) {
158
158
  const O = s ? b : a[b], f = e[O], P = t[O];
159
159
  if (f === P) {
160
- u[O] = f, (s ? b < n : ss.call(e, O)) && d++;
160
+ u[O] = f, (s ? b < n : ss.call(e, O)) && l++;
161
161
  continue;
162
162
  }
163
163
  if (f === null || P === null || typeof f != "object" || typeof P != "object") {
@@ -165,9 +165,9 @@ function Xt(e, t) {
165
165
  continue;
166
166
  }
167
167
  const y = Xt(f, P);
168
- u[O] = y, y === f && d++;
168
+ u[O] = y, y === f && l++;
169
169
  }
170
- return n === h && d === n ? e : u;
170
+ return n === h && l === n ? e : u;
171
171
  }
172
172
  function Yt(e, t) {
173
173
  if (!t || Object.keys(e).length !== Object.keys(t).length)
@@ -181,15 +181,15 @@ function we(e) {
181
181
  return Array.isArray(e) && e.length === Object.keys(e).length;
182
182
  }
183
183
  function te(e) {
184
- if (!Se(e))
184
+ if (!Ce(e))
185
185
  return !1;
186
186
  const t = e.constructor;
187
187
  if (t === void 0)
188
188
  return !0;
189
189
  const s = t.prototype;
190
- return !(!Se(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
190
+ return !(!Ce(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
191
191
  }
192
- function Se(e) {
192
+ function Ce(e) {
193
193
  return Object.prototype.toString.call(e) === "[object Object]";
194
194
  }
195
195
  function rs(e) {
@@ -230,13 +230,13 @@ function ke(e, t) {
230
230
  function as(e, t) {
231
231
  return typeof e == "function" ? e(...t) : !!e;
232
232
  }
233
- var ct, tt, St, De, os = (De = class extends Kt {
233
+ var ct, tt, Ct, De, os = (De = class extends Kt {
234
234
  constructor() {
235
235
  super();
236
236
  c(this, ct);
237
237
  c(this, tt);
238
- c(this, St);
239
- o(this, St, (t) => {
238
+ c(this, Ct);
239
+ o(this, Ct, (t) => {
240
240
  if (!bt && window.addEventListener) {
241
241
  const s = () => t();
242
242
  return window.addEventListener("visibilitychange", s, !1), () => {
@@ -246,7 +246,7 @@ var ct, tt, St, De, os = (De = class extends Kt {
246
246
  });
247
247
  }
248
248
  onSubscribe() {
249
- r(this, tt) || this.setEventListener(r(this, St));
249
+ r(this, tt) || this.setEventListener(r(this, Ct));
250
250
  }
251
251
  onUnsubscribe() {
252
252
  var t;
@@ -254,7 +254,7 @@ var ct, tt, St, De, os = (De = class extends Kt {
254
254
  }
255
255
  setEventListener(t) {
256
256
  var s;
257
- o(this, St, t), (s = r(this, tt)) == null || s.call(this), o(this, tt, t((i) => {
257
+ o(this, Ct, t), (s = r(this, tt)) == null || s.call(this), o(this, tt, t((i) => {
258
258
  typeof i == "boolean" ? this.setFocused(i) : this.onFocus();
259
259
  }));
260
260
  }
@@ -271,7 +271,7 @@ var ct, tt, St, De, os = (De = class extends Kt {
271
271
  var t;
272
272
  return typeof r(this, ct) == "boolean" ? r(this, ct) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
273
273
  }
274
- }, ct = new WeakMap(), tt = new WeakMap(), St = new WeakMap(), De), fe = new os();
274
+ }, ct = new WeakMap(), tt = new WeakMap(), Ct = new WeakMap(), De), fe = new os();
275
275
  function se() {
276
276
  let e, t;
277
277
  const s = new Promise((n, a) => {
@@ -309,29 +309,29 @@ function hs() {
309
309
  const u = e;
310
310
  e = [], u.length && n(() => {
311
311
  i(() => {
312
- u.forEach((d) => {
313
- s(d);
312
+ u.forEach((l) => {
313
+ s(l);
314
314
  });
315
315
  });
316
316
  });
317
317
  };
318
318
  return {
319
319
  batch: (u) => {
320
- let d;
320
+ let l;
321
321
  t++;
322
322
  try {
323
- d = u();
323
+ l = u();
324
324
  } finally {
325
325
  t--, t || h();
326
326
  }
327
- return d;
327
+ return l;
328
328
  },
329
329
  /**
330
330
  * All calls to the wrapped function will be batched.
331
331
  */
332
- batchCalls: (u) => (...d) => {
332
+ batchCalls: (u) => (...l) => {
333
333
  a(() => {
334
- u(...d);
334
+ u(...l);
335
335
  });
336
336
  },
337
337
  schedule: a,
@@ -354,10 +354,10 @@ function hs() {
354
354
  }
355
355
  };
356
356
  }
357
- var T = hs(), Ct, et, Ot, Te, cs = (Te = class extends Kt {
357
+ var T = hs(), St, et, Ot, Te, cs = (Te = class extends Kt {
358
358
  constructor() {
359
359
  super();
360
- c(this, Ct, !0);
360
+ c(this, St, !0);
361
361
  c(this, et);
362
362
  c(this, Ot);
363
363
  o(this, Ot, (t) => {
@@ -381,14 +381,14 @@ var T = hs(), Ct, et, Ot, Te, cs = (Te = class extends Kt {
381
381
  o(this, Ot, t), (s = r(this, et)) == null || s.call(this), o(this, et, t(this.setOnline.bind(this)));
382
382
  }
383
383
  setOnline(t) {
384
- r(this, Ct) !== t && (o(this, Ct, t), this.listeners.forEach((i) => {
384
+ r(this, St) !== t && (o(this, St, t), this.listeners.forEach((i) => {
385
385
  i(t);
386
386
  }));
387
387
  }
388
388
  isOnline() {
389
- return r(this, Ct);
389
+ return r(this, St);
390
390
  }
391
- }, Ct = new WeakMap(), et = new WeakMap(), Ot = new WeakMap(), Te), $t = new cs();
391
+ }, St = new WeakMap(), et = new WeakMap(), Ot = new WeakMap(), Te), $t = new cs();
392
392
  function ls(e) {
393
393
  return Math.min(1e3 * 2 ** e, 3e4);
394
394
  }
@@ -402,49 +402,49 @@ var re = class extends Error {
402
402
  };
403
403
  function Le(e) {
404
404
  let t = !1, s = 0, i;
405
- const n = se(), a = () => n.status !== "pending", h = (m) => {
406
- var p;
405
+ const n = se(), a = () => n.status !== "pending", h = (p) => {
406
+ var g;
407
407
  if (!a()) {
408
- const C = new re(m);
409
- P(C), (p = e.onCancel) == null || p.call(e, C);
408
+ const w = new re(p);
409
+ P(w), (g = e.onCancel) == null || g.call(e, w);
410
410
  }
411
411
  }, u = () => {
412
412
  t = !0;
413
- }, d = () => {
413
+ }, l = () => {
414
414
  t = !1;
415
- }, b = () => fe.isFocused() && (e.networkMode === "always" || $t.isOnline()) && e.canRun(), O = () => Ke(e.networkMode) && e.canRun(), f = (m) => {
416
- a() || (i == null || i(), n.resolve(m));
417
- }, P = (m) => {
418
- a() || (i == null || i(), n.reject(m));
419
- }, y = () => new Promise((m) => {
420
- var p;
421
- i = (C) => {
422
- (a() || b()) && m(C);
423
- }, (p = e.onPause) == null || p.call(e);
415
+ }, b = () => fe.isFocused() && (e.networkMode === "always" || $t.isOnline()) && e.canRun(), O = () => Ke(e.networkMode) && e.canRun(), f = (p) => {
416
+ a() || (i == null || i(), n.resolve(p));
417
+ }, P = (p) => {
418
+ a() || (i == null || i(), n.reject(p));
419
+ }, y = () => new Promise((p) => {
420
+ var g;
421
+ i = (w) => {
422
+ (a() || b()) && p(w);
423
+ }, (g = e.onPause) == null || g.call(e);
424
424
  }).then(() => {
425
- var m;
426
- i = void 0, a() || (m = e.onContinue) == null || m.call(e);
427
- }), R = () => {
425
+ var p;
426
+ i = void 0, a() || (p = e.onContinue) == null || p.call(e);
427
+ }), F = () => {
428
428
  if (a())
429
429
  return;
430
- let m;
431
- const p = s === 0 ? e.initialPromise : void 0;
430
+ let p;
431
+ const g = s === 0 ? e.initialPromise : void 0;
432
432
  try {
433
- m = p ?? e.fn();
434
- } catch (C) {
435
- m = Promise.reject(C);
433
+ p = g ?? e.fn();
434
+ } catch (w) {
435
+ p = Promise.reject(w);
436
436
  }
437
- Promise.resolve(m).then(f).catch((C) => {
437
+ Promise.resolve(p).then(f).catch((w) => {
438
438
  var x;
439
439
  if (a())
440
440
  return;
441
- const M = e.retry ?? (bt ? 0 : 3), E = e.retryDelay ?? ls, l = typeof E == "function" ? E(s, C) : E, Q = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, C);
441
+ const R = e.retry ?? (bt ? 0 : 3), E = e.retryDelay ?? ls, d = typeof E == "function" ? E(s, w) : E, Q = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, w);
442
442
  if (t || !Q) {
443
- P(C);
443
+ P(w);
444
444
  return;
445
445
  }
446
- s++, (x = e.onFail) == null || x.call(e, s, C), rs(l).then(() => b() ? void 0 : y()).then(() => {
447
- t ? P(C) : R();
446
+ s++, (x = e.onFail) == null || x.call(e, s, w), rs(d).then(() => b() ? void 0 : y()).then(() => {
447
+ t ? P(w) : F();
448
448
  });
449
449
  });
450
450
  };
@@ -454,9 +454,9 @@ function Le(e) {
454
454
  cancel: h,
455
455
  continue: () => (i == null || i(), n),
456
456
  cancelRetry: u,
457
- continueRetry: d,
457
+ continueRetry: l,
458
458
  canStart: O,
459
- start: () => (O() ? R() : y().then(R), n)
459
+ start: () => (O() ? F() : y().then(F), n)
460
460
  };
461
461
  }
462
462
  var lt, Ie, He = (Ie = class {
@@ -504,7 +504,7 @@ var lt, Ie, He = (Ie = class {
504
504
  if (this.options = { ...r(this, Ut), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
505
505
  const s = Oe(this.options);
506
506
  s.data !== void 0 && (this.setState(
507
- Ce(s.data, s.dataUpdatedAt)
507
+ Se(s.data, s.dataUpdatedAt)
508
508
  ), o(this, dt, s));
509
509
  }
510
510
  }
@@ -513,7 +513,7 @@ var lt, Ie, He = (Ie = class {
513
513
  }
514
514
  setData(t, s) {
515
515
  const i = ee(this.state.data, t, this.options);
516
- return v(this, L, $).call(this, {
516
+ return m(this, L, $).call(this, {
517
517
  data: i,
518
518
  type: "success",
519
519
  dataUpdatedAt: s == null ? void 0 : s.updatedAt,
@@ -521,7 +521,7 @@ var lt, Ie, He = (Ie = class {
521
521
  }), i;
522
522
  }
523
523
  setState(t, s) {
524
- v(this, L, $).call(this, { type: "setState", state: t, setStateOptions: s });
524
+ m(this, L, $).call(this, { type: "setState", state: t, setStateOptions: s });
525
525
  }
526
526
  cancel(t) {
527
527
  var i, n;
@@ -575,33 +575,33 @@ var lt, Ie, He = (Ie = class {
575
575
  return this.observers.length;
576
576
  }
577
577
  invalidate() {
578
- this.state.isInvalidated || v(this, L, $).call(this, { type: "invalidate" });
578
+ this.state.isInvalidated || m(this, L, $).call(this, { type: "invalidate" });
579
579
  }
580
580
  async fetch(t, s) {
581
- var d, b, O, f, P, y, R, m, p, C, M, E;
581
+ var l, b, O, f, P, y, F, p, g, w, R, E;
582
582
  if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
583
583
  // re-start the fetch; there is a chance that the query is still in a
584
584
  // pending state when that happens
585
- ((d = r(this, D)) == null ? void 0 : d.status()) !== "rejected") {
585
+ ((l = r(this, D)) == null ? void 0 : l.status()) !== "rejected") {
586
586
  if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
587
587
  this.cancel({ silent: !0 });
588
588
  else if (r(this, D))
589
589
  return r(this, D).continueRetry(), r(this, D).promise;
590
590
  }
591
591
  if (t && this.setOptions(t), !this.options.queryFn) {
592
- const l = this.observers.find((Q) => Q.options.queryFn);
593
- l && this.setOptions(l.options);
592
+ const d = this.observers.find((Q) => Q.options.queryFn);
593
+ d && this.setOptions(d.options);
594
594
  }
595
595
  process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
596
596
  "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
597
597
  ));
598
- const i = new AbortController(), n = (l) => {
599
- Object.defineProperty(l, "signal", {
598
+ const i = new AbortController(), n = (d) => {
599
+ Object.defineProperty(d, "signal", {
600
600
  enumerable: !0,
601
601
  get: () => (o(this, yt, !0), i.signal)
602
602
  });
603
603
  }, a = () => {
604
- const l = ke(this.options, s), x = (() => {
604
+ const d = ke(this.options, s), x = (() => {
605
605
  const Z = {
606
606
  client: r(this, ft),
607
607
  queryKey: this.queryKey,
@@ -610,12 +610,12 @@ var lt, Ie, He = (Ie = class {
610
610
  return n(Z), Z;
611
611
  })();
612
612
  return o(this, yt, !1), this.options.persister ? this.options.persister(
613
- l,
613
+ d,
614
614
  x,
615
615
  this
616
- ) : l(x);
616
+ ) : d(x);
617
617
  }, u = (() => {
618
- const l = {
618
+ const d = {
619
619
  fetchOptions: s,
620
620
  options: this.options,
621
621
  queryKey: this.queryKey,
@@ -623,25 +623,25 @@ var lt, Ie, He = (Ie = class {
623
623
  state: this.state,
624
624
  fetchFn: a
625
625
  };
626
- return n(l), l;
626
+ return n(d), d;
627
627
  })();
628
- (b = this.options.behavior) == null || b.onFetch(u, this), o(this, Pt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((O = u.fetchOptions) == null ? void 0 : O.meta)) && v(this, L, $).call(this, { type: "fetch", meta: (f = u.fetchOptions) == null ? void 0 : f.meta }), o(this, D, Le({
628
+ (b = this.options.behavior) == null || b.onFetch(u, this), o(this, Pt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((O = u.fetchOptions) == null ? void 0 : O.meta)) && m(this, L, $).call(this, { type: "fetch", meta: (f = u.fetchOptions) == null ? void 0 : f.meta }), o(this, D, Le({
629
629
  initialPromise: s == null ? void 0 : s.initialPromise,
630
630
  fn: u.fetchFn,
631
- onCancel: (l) => {
632
- l instanceof re && l.revert && this.setState({
631
+ onCancel: (d) => {
632
+ d instanceof re && d.revert && this.setState({
633
633
  ...r(this, Pt),
634
634
  fetchStatus: "idle"
635
635
  }), i.abort();
636
636
  },
637
- onFail: (l, Q) => {
638
- v(this, L, $).call(this, { type: "failed", failureCount: l, error: Q });
637
+ onFail: (d, Q) => {
638
+ m(this, L, $).call(this, { type: "failed", failureCount: d, error: Q });
639
639
  },
640
640
  onPause: () => {
641
- v(this, L, $).call(this, { type: "pause" });
641
+ m(this, L, $).call(this, { type: "pause" });
642
642
  },
643
643
  onContinue: () => {
644
- v(this, L, $).call(this, { type: "continue" });
644
+ m(this, L, $).call(this, { type: "continue" });
645
645
  },
646
646
  retry: u.options.retry,
647
647
  retryDelay: u.options.retryDelay,
@@ -649,40 +649,40 @@ var lt, Ie, He = (Ie = class {
649
649
  canRun: () => !0
650
650
  }));
651
651
  try {
652
- const l = await r(this, D).start();
653
- if (l === void 0)
652
+ const d = await r(this, D).start();
653
+ if (d === void 0)
654
654
  throw process.env.NODE_ENV !== "production" && console.error(
655
655
  `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
656
656
  ), new Error(`${this.queryHash} data is undefined`);
657
- return this.setData(l), (y = (P = r(this, _).config).onSuccess) == null || y.call(P, l, this), (m = (R = r(this, _).config).onSettled) == null || m.call(
658
- R,
659
- l,
657
+ return this.setData(d), (y = (P = r(this, _).config).onSuccess) == null || y.call(P, d, this), (p = (F = r(this, _).config).onSettled) == null || p.call(
658
+ F,
659
+ d,
660
660
  this.state.error,
661
661
  this
662
- ), l;
663
- } catch (l) {
664
- if (l instanceof re) {
665
- if (l.silent)
662
+ ), d;
663
+ } catch (d) {
664
+ if (d instanceof re) {
665
+ if (d.silent)
666
666
  return r(this, D).promise;
667
- if (l.revert) {
667
+ if (d.revert) {
668
668
  if (this.state.data === void 0)
669
- throw l;
669
+ throw d;
670
670
  return this.state.data;
671
671
  }
672
672
  }
673
- throw v(this, L, $).call(this, {
673
+ throw m(this, L, $).call(this, {
674
674
  type: "error",
675
- error: l
676
- }), (C = (p = r(this, _).config).onError) == null || C.call(
677
- p,
678
- l,
675
+ error: d
676
+ }), (w = (g = r(this, _).config).onError) == null || w.call(
677
+ g,
678
+ d,
679
679
  this
680
- ), (E = (M = r(this, _).config).onSettled) == null || E.call(
681
- M,
680
+ ), (E = (R = r(this, _).config).onSettled) == null || E.call(
681
+ R,
682
682
  this.state.data,
683
- l,
683
+ d,
684
684
  this
685
- ), l;
685
+ ), d;
686
686
  } finally {
687
687
  this.scheduleGc();
688
688
  }
@@ -715,7 +715,7 @@ var lt, Ie, He = (Ie = class {
715
715
  case "success":
716
716
  const n = {
717
717
  ...i,
718
- ...Ce(t.data, t.dataUpdatedAt),
718
+ ...Se(t.data, t.dataUpdatedAt),
719
719
  dataUpdateCount: i.dataUpdateCount + 1,
720
720
  ...!t.manual && {
721
721
  fetchStatus: "idle",
@@ -765,7 +765,7 @@ function Ge(e, t) {
765
765
  }
766
766
  };
767
767
  }
768
- function Ce(e, t) {
768
+ function Se(e, t) {
769
769
  return {
770
770
  data: e,
771
771
  dataUpdatedAt: t ?? Date.now(),
@@ -791,12 +791,12 @@ function Oe(e) {
791
791
  fetchStatus: "idle"
792
792
  };
793
793
  }
794
- var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, oe, ue, he, ce, Be, Ae, fs = (Ae = class extends Kt {
794
+ var U, v, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, oe, ue, he, ce, Be, Ae, fs = (Ae = class extends Kt {
795
795
  constructor(t, s) {
796
796
  super();
797
797
  c(this, S);
798
798
  c(this, U);
799
- c(this, g);
799
+ c(this, v);
800
800
  c(this, jt);
801
801
  c(this, q);
802
802
  c(this, pt);
@@ -818,52 +818,52 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
818
818
  this.refetch = this.refetch.bind(this);
819
819
  }
820
820
  onSubscribe() {
821
- this.listeners.size === 1 && (r(this, g).addObserver(this), Pe(r(this, g), this.options) ? v(this, S, qt).call(this) : this.updateResult(), v(this, S, oe).call(this));
821
+ this.listeners.size === 1 && (r(this, v).addObserver(this), Pe(r(this, v), this.options) ? m(this, S, qt).call(this) : this.updateResult(), m(this, S, oe).call(this));
822
822
  }
823
823
  onUnsubscribe() {
824
824
  this.hasListeners() || this.destroy();
825
825
  }
826
826
  shouldFetchOnReconnect() {
827
827
  return le(
828
- r(this, g),
828
+ r(this, v),
829
829
  this.options,
830
830
  this.options.refetchOnReconnect
831
831
  );
832
832
  }
833
833
  shouldFetchOnWindowFocus() {
834
834
  return le(
835
- r(this, g),
835
+ r(this, v),
836
836
  this.options,
837
837
  this.options.refetchOnWindowFocus
838
838
  );
839
839
  }
840
840
  destroy() {
841
- this.listeners = /* @__PURE__ */ new Set(), v(this, S, ue).call(this), v(this, S, he).call(this), r(this, g).removeObserver(this);
841
+ this.listeners = /* @__PURE__ */ new Set(), m(this, S, ue).call(this), m(this, S, he).call(this), r(this, v).removeObserver(this);
842
842
  }
843
843
  setOptions(t) {
844
- const s = this.options, i = r(this, g);
845
- if (this.options = r(this, U).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, r(this, g)) != "boolean")
844
+ const s = this.options, i = r(this, v);
845
+ if (this.options = r(this, U).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, r(this, v)) != "boolean")
846
846
  throw new Error(
847
847
  "Expected enabled to be a boolean or a callback that returns a boolean"
848
848
  );
849
- v(this, S, ce).call(this), r(this, g).setOptions(this.options), s._defaulted && !Yt(this.options, s) && r(this, U).getQueryCache().notify({
849
+ m(this, S, ce).call(this), r(this, v).setOptions(this.options), s._defaulted && !Yt(this.options, s) && r(this, U).getQueryCache().notify({
850
850
  type: "observerOptionsUpdated",
851
- query: r(this, g),
851
+ query: r(this, v),
852
852
  observer: this
853
853
  });
854
854
  const n = this.hasListeners();
855
855
  n && Ee(
856
- r(this, g),
856
+ r(this, v),
857
857
  i,
858
858
  this.options,
859
859
  s
860
- ) && v(this, S, qt).call(this), this.updateResult(), n && (r(this, g) !== i || k(this.options.enabled, r(this, g)) !== k(s.enabled, r(this, g)) || ot(this.options.staleTime, r(this, g)) !== ot(s.staleTime, r(this, g))) && v(this, S, ie).call(this);
861
- const a = v(this, S, ne).call(this);
862
- n && (r(this, g) !== i || k(this.options.enabled, r(this, g)) !== k(s.enabled, r(this, g)) || a !== r(this, rt)) && v(this, S, ae).call(this, a);
860
+ ) && m(this, S, qt).call(this), this.updateResult(), n && (r(this, v) !== i || k(this.options.enabled, r(this, v)) !== k(s.enabled, r(this, v)) || ot(this.options.staleTime, r(this, v)) !== ot(s.staleTime, r(this, v))) && m(this, S, ie).call(this);
861
+ const a = m(this, S, ne).call(this);
862
+ n && (r(this, v) !== i || k(this.options.enabled, r(this, v)) !== k(s.enabled, r(this, v)) || a !== r(this, rt)) && m(this, S, ae).call(this, a);
863
863
  }
864
864
  getOptimisticResult(t) {
865
865
  const s = r(this, U).getQueryCache().build(r(this, U), t), i = this.createResult(s, t);
866
- return ps(this, i) && (o(this, q, i), o(this, Et, this.options), o(this, pt, r(this, g).state)), i;
866
+ return ps(this, i) && (o(this, q, i), o(this, Et, this.options), o(this, pt, r(this, v).state)), i;
867
867
  }
868
868
  getCurrentResult() {
869
869
  return r(this, q);
@@ -881,7 +881,7 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
881
881
  r(this, Mt).add(t);
882
882
  }
883
883
  getCurrentQuery() {
884
- return r(this, g);
884
+ return r(this, v);
885
885
  }
886
886
  refetch({ ...t } = {}) {
887
887
  return this.fetch({
@@ -893,84 +893,84 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
893
893
  return i.fetch().then(() => this.createResult(i, s));
894
894
  }
895
895
  fetch(t) {
896
- return v(this, S, qt).call(this, {
896
+ return m(this, S, qt).call(this, {
897
897
  ...t,
898
898
  cancelRefetch: t.cancelRefetch ?? !0
899
899
  }).then(() => (this.updateResult(), r(this, q)));
900
900
  }
901
901
  createResult(t, s) {
902
902
  var X;
903
- const i = r(this, g), n = this.options, a = r(this, q), h = r(this, pt), u = r(this, Et), b = t !== i ? t.state : r(this, jt), { state: O } = t;
903
+ const i = r(this, v), n = this.options, a = r(this, q), h = r(this, pt), u = r(this, Et), b = t !== i ? t.state : r(this, jt), { state: O } = t;
904
904
  let f = { ...O }, P = !1, y;
905
905
  if (s._optimisticResults) {
906
- const w = this.hasListeners(), N = !w && Pe(t, s), wt = w && Ee(t, i, s, n);
906
+ const C = this.hasListeners(), N = !C && Pe(t, s), wt = C && Ee(t, i, s, n);
907
907
  (N || wt) && (f = {
908
908
  ...f,
909
909
  ...Ge(O.data, t.options)
910
910
  }), s._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
911
911
  }
912
- let { error: R, errorUpdatedAt: m, status: p } = f;
912
+ let { error: F, errorUpdatedAt: p, status: g } = f;
913
913
  y = f.data;
914
- let C = !1;
915
- if (s.placeholderData !== void 0 && y === void 0 && p === "pending") {
916
- let w;
917
- a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (w = a.data, C = !0) : w = typeof s.placeholderData == "function" ? s.placeholderData(
914
+ let w = !1;
915
+ if (s.placeholderData !== void 0 && y === void 0 && g === "pending") {
916
+ let C;
917
+ a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (C = a.data, w = !0) : C = typeof s.placeholderData == "function" ? s.placeholderData(
918
918
  (X = r(this, Rt)) == null ? void 0 : X.state.data,
919
919
  r(this, Rt)
920
- ) : s.placeholderData, w !== void 0 && (p = "success", y = ee(
920
+ ) : s.placeholderData, C !== void 0 && (g = "success", y = ee(
921
921
  a == null ? void 0 : a.data,
922
- w,
922
+ C,
923
923
  s
924
924
  ), P = !0);
925
925
  }
926
- if (s.select && y !== void 0 && !C)
926
+ if (s.select && y !== void 0 && !w)
927
927
  if (a && y === (h == null ? void 0 : h.data) && s.select === r(this, Nt))
928
928
  y = r(this, Ft);
929
929
  else
930
930
  try {
931
931
  o(this, Nt, s.select), y = s.select(y), y = ee(a == null ? void 0 : a.data, y, s), o(this, Ft, y), o(this, st, null);
932
- } catch (w) {
933
- o(this, st, w);
932
+ } catch (C) {
933
+ o(this, st, C);
934
934
  }
935
- r(this, st) && (R = r(this, st), y = r(this, Ft), m = Date.now(), p = "error");
936
- const M = f.fetchStatus === "fetching", E = p === "pending", l = p === "error", Q = E && M, x = y !== void 0, I = {
937
- status: p,
935
+ r(this, st) && (F = r(this, st), y = r(this, Ft), p = Date.now(), g = "error");
936
+ const R = f.fetchStatus === "fetching", E = g === "pending", d = g === "error", Q = E && R, x = y !== void 0, I = {
937
+ status: g,
938
938
  fetchStatus: f.fetchStatus,
939
939
  isPending: E,
940
- isSuccess: p === "success",
941
- isError: l,
940
+ isSuccess: g === "success",
941
+ isError: d,
942
942
  isInitialLoading: Q,
943
943
  isLoading: Q,
944
944
  data: y,
945
945
  dataUpdatedAt: f.dataUpdatedAt,
946
- error: R,
947
- errorUpdatedAt: m,
946
+ error: F,
947
+ errorUpdatedAt: p,
948
948
  failureCount: f.fetchFailureCount,
949
949
  failureReason: f.fetchFailureReason,
950
950
  errorUpdateCount: f.errorUpdateCount,
951
951
  isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
952
952
  isFetchedAfterMount: f.dataUpdateCount > b.dataUpdateCount || f.errorUpdateCount > b.errorUpdateCount,
953
- isFetching: M,
954
- isRefetching: M && !E,
955
- isLoadingError: l && !x,
953
+ isFetching: R,
954
+ isRefetching: R && !E,
955
+ isLoadingError: d && !x,
956
956
  isPaused: f.fetchStatus === "paused",
957
957
  isPlaceholderData: P,
958
- isRefetchError: l && x,
958
+ isRefetchError: d && x,
959
959
  isStale: ye(t, s),
960
960
  refetch: this.refetch,
961
961
  promise: r(this, W),
962
962
  isEnabled: k(s.enabled, t) !== !1
963
963
  };
964
964
  if (this.options.experimental_prefetchInRender) {
965
- const w = (Lt) => {
965
+ const C = (Lt) => {
966
966
  I.status === "error" ? Lt.reject(I.error) : I.data !== void 0 && Lt.resolve(I.data);
967
967
  }, N = () => {
968
968
  const Lt = o(this, W, I.promise = se());
969
- w(Lt);
969
+ C(Lt);
970
970
  }, wt = r(this, W);
971
971
  switch (wt.status) {
972
972
  case "pending":
973
- t.queryHash === i.queryHash && w(wt);
973
+ t.queryHash === i.queryHash && C(wt);
974
974
  break;
975
975
  case "fulfilled":
976
976
  (I.status === "error" || I.data !== wt.value) && N();
@@ -983,8 +983,8 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
983
983
  return I;
984
984
  }
985
985
  updateResult() {
986
- const t = r(this, q), s = this.createResult(r(this, g), this.options);
987
- if (o(this, pt, r(this, g).state), o(this, Et, this.options), r(this, pt).data !== void 0 && o(this, Rt, r(this, g)), Yt(s, t))
986
+ const t = r(this, q), s = this.createResult(r(this, v), this.options);
987
+ if (o(this, pt, r(this, v).state), o(this, Et, this.options), r(this, pt).data !== void 0 && o(this, Rt, r(this, v)), Yt(s, t))
988
988
  return;
989
989
  o(this, q, s);
990
990
  const i = () => {
@@ -997,27 +997,27 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
997
997
  a ?? r(this, Mt)
998
998
  );
999
999
  return this.options.throwOnError && h.add("error"), Object.keys(r(this, q)).some((u) => {
1000
- const d = u;
1001
- return r(this, q)[d] !== t[d] && h.has(d);
1000
+ const l = u;
1001
+ return r(this, q)[l] !== t[l] && h.has(l);
1002
1002
  });
1003
1003
  };
1004
- v(this, S, Be).call(this, { listeners: i() });
1004
+ m(this, S, Be).call(this, { listeners: i() });
1005
1005
  }
1006
1006
  onQueryUpdate() {
1007
- this.updateResult(), this.hasListeners() && v(this, S, oe).call(this);
1007
+ this.updateResult(), this.hasListeners() && m(this, S, oe).call(this);
1008
1008
  }
1009
- }, U = new WeakMap(), g = new WeakMap(), jt = new WeakMap(), q = new WeakMap(), pt = new WeakMap(), Et = new WeakMap(), W = new WeakMap(), st = new WeakMap(), Nt = new WeakMap(), Ft = new WeakMap(), Rt = new WeakMap(), mt = new WeakMap(), vt = new WeakMap(), rt = new WeakMap(), Mt = new WeakMap(), S = new WeakSet(), qt = function(t) {
1010
- v(this, S, ce).call(this);
1011
- let s = r(this, g).fetch(
1009
+ }, U = new WeakMap(), v = new WeakMap(), jt = new WeakMap(), q = new WeakMap(), pt = new WeakMap(), Et = new WeakMap(), W = new WeakMap(), st = new WeakMap(), Nt = new WeakMap(), Ft = new WeakMap(), Rt = new WeakMap(), mt = new WeakMap(), vt = new WeakMap(), rt = new WeakMap(), Mt = new WeakMap(), S = new WeakSet(), qt = function(t) {
1010
+ m(this, S, ce).call(this);
1011
+ let s = r(this, v).fetch(
1012
1012
  this.options,
1013
1013
  t
1014
1014
  );
1015
1015
  return t != null && t.throwOnError || (s = s.catch(j)), s;
1016
1016
  }, ie = function() {
1017
- v(this, S, ue).call(this);
1017
+ m(this, S, ue).call(this);
1018
1018
  const t = ot(
1019
1019
  this.options.staleTime,
1020
- r(this, g)
1020
+ r(this, v)
1021
1021
  );
1022
1022
  if (bt || r(this, q).isStale || !Zt(t))
1023
1023
  return;
@@ -1026,29 +1026,29 @@ var U, g, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
1026
1026
  r(this, q).isStale || this.updateResult();
1027
1027
  }, i));
1028
1028
  }, ne = function() {
1029
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(r(this, g)) : this.options.refetchInterval) ?? !1;
1029
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(r(this, v)) : this.options.refetchInterval) ?? !1;
1030
1030
  }, ae = function(t) {
1031
- v(this, S, he).call(this), o(this, rt, t), !(bt || k(this.options.enabled, r(this, g)) === !1 || !Zt(r(this, rt)) || r(this, rt) === 0) && o(this, vt, ut.setInterval(() => {
1032
- (this.options.refetchIntervalInBackground || fe.isFocused()) && v(this, S, qt).call(this);
1031
+ m(this, S, he).call(this), o(this, rt, t), !(bt || k(this.options.enabled, r(this, v)) === !1 || !Zt(r(this, rt)) || r(this, rt) === 0) && o(this, vt, ut.setInterval(() => {
1032
+ (this.options.refetchIntervalInBackground || fe.isFocused()) && m(this, S, qt).call(this);
1033
1033
  }, r(this, rt)));
1034
1034
  }, oe = function() {
1035
- v(this, S, ie).call(this), v(this, S, ae).call(this, v(this, S, ne).call(this));
1035
+ m(this, S, ie).call(this), m(this, S, ae).call(this, m(this, S, ne).call(this));
1036
1036
  }, ue = function() {
1037
1037
  r(this, mt) && (ut.clearTimeout(r(this, mt)), o(this, mt, void 0));
1038
1038
  }, he = function() {
1039
1039
  r(this, vt) && (ut.clearInterval(r(this, vt)), o(this, vt, void 0));
1040
1040
  }, ce = function() {
1041
1041
  const t = r(this, U).getQueryCache().build(r(this, U), this.options);
1042
- if (t === r(this, g))
1042
+ if (t === r(this, v))
1043
1043
  return;
1044
- const s = r(this, g);
1045
- o(this, g, t), o(this, jt, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1044
+ const s = r(this, v);
1045
+ o(this, v, t), o(this, jt, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1046
1046
  }, Be = function(t) {
1047
1047
  T.batch(() => {
1048
1048
  t.listeners && this.listeners.forEach((s) => {
1049
1049
  s(r(this, q));
1050
1050
  }), r(this, U).getQueryCache().notify({
1051
- query: r(this, g),
1051
+ query: r(this, v),
1052
1052
  type: "observerResultsUpdated"
1053
1053
  });
1054
1054
  });
@@ -1078,59 +1078,59 @@ function ps(e, t) {
1078
1078
  function Fe(e) {
1079
1079
  return {
1080
1080
  onFetch: (t, s) => {
1081
- var O, f, P, y, R;
1082
- const i = t.options, n = (P = (f = (O = t.fetchOptions) == null ? void 0 : O.meta) == null ? void 0 : f.fetchMore) == null ? void 0 : P.direction, a = ((y = t.state.data) == null ? void 0 : y.pages) || [], h = ((R = t.state.data) == null ? void 0 : R.pageParams) || [];
1083
- let u = { pages: [], pageParams: [] }, d = 0;
1081
+ var O, f, P, y, F;
1082
+ const i = t.options, n = (P = (f = (O = t.fetchOptions) == null ? void 0 : O.meta) == null ? void 0 : f.fetchMore) == null ? void 0 : P.direction, a = ((y = t.state.data) == null ? void 0 : y.pages) || [], h = ((F = t.state.data) == null ? void 0 : F.pageParams) || [];
1083
+ let u = { pages: [], pageParams: [] }, l = 0;
1084
1084
  const b = async () => {
1085
- let m = !1;
1086
- const p = (E) => {
1085
+ let p = !1;
1086
+ const g = (E) => {
1087
1087
  Object.defineProperty(E, "signal", {
1088
1088
  enumerable: !0,
1089
- get: () => (t.signal.aborted ? m = !0 : t.signal.addEventListener("abort", () => {
1090
- m = !0;
1089
+ get: () => (t.signal.aborted ? p = !0 : t.signal.addEventListener("abort", () => {
1090
+ p = !0;
1091
1091
  }), t.signal)
1092
1092
  });
1093
- }, C = ke(t.options, t.fetchOptions), M = async (E, l, Q) => {
1094
- if (m)
1093
+ }, w = ke(t.options, t.fetchOptions), R = async (E, d, Q) => {
1094
+ if (p)
1095
1095
  return Promise.reject();
1096
- if (l == null && E.pages.length)
1096
+ if (d == null && E.pages.length)
1097
1097
  return Promise.resolve(E);
1098
1098
  const Z = (() => {
1099
1099
  const N = {
1100
1100
  client: t.client,
1101
1101
  queryKey: t.queryKey,
1102
- pageParam: l,
1102
+ pageParam: d,
1103
1103
  direction: Q ? "backward" : "forward",
1104
1104
  meta: t.options.meta
1105
1105
  };
1106
- return p(N), N;
1107
- })(), I = await C(Z), { maxPages: X } = t.options, w = Q ? ns : is;
1106
+ return g(N), N;
1107
+ })(), I = await w(Z), { maxPages: X } = t.options, C = Q ? ns : is;
1108
1108
  return {
1109
- pages: w(E.pages, I, X),
1110
- pageParams: w(E.pageParams, l, X)
1109
+ pages: C(E.pages, I, X),
1110
+ pageParams: C(E.pageParams, d, X)
1111
1111
  };
1112
1112
  };
1113
1113
  if (n && a.length) {
1114
- const E = n === "backward", l = E ? ms : Re, Q = {
1114
+ const E = n === "backward", d = E ? ms : Re, Q = {
1115
1115
  pages: a,
1116
1116
  pageParams: h
1117
- }, x = l(i, Q);
1118
- u = await M(Q, x, E);
1117
+ }, x = d(i, Q);
1118
+ u = await R(Q, x, E);
1119
1119
  } else {
1120
1120
  const E = e ?? a.length;
1121
1121
  do {
1122
- const l = d === 0 ? h[0] ?? i.initialPageParam : Re(i, u);
1123
- if (d > 0 && l == null)
1122
+ const d = l === 0 ? h[0] ?? i.initialPageParam : Re(i, u);
1123
+ if (l > 0 && d == null)
1124
1124
  break;
1125
- u = await M(u, l), d++;
1126
- } while (d < E);
1125
+ u = await R(u, d), l++;
1126
+ } while (l < E);
1127
1127
  }
1128
1128
  return u;
1129
1129
  };
1130
1130
  t.options.persister ? t.fetchFn = () => {
1131
- var m, p;
1132
- return (p = (m = t.options).persister) == null ? void 0 : p.call(
1133
- m,
1131
+ var p, g;
1132
+ return (g = (p = t.options).persister) == null ? void 0 : g.call(
1133
+ p,
1134
1134
  b,
1135
1135
  {
1136
1136
  client: t.client,
@@ -1196,9 +1196,9 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1196
1196
  this.execute(this.state.variables);
1197
1197
  }
1198
1198
  async execute(t) {
1199
- var h, u, d, b, O, f, P, y, R, m, p, C, M, E, l, Q, x, Z, I, X;
1199
+ var h, u, l, b, O, f, P, y, F, p, g, w, R, E, d, Q, x, Z, I, X;
1200
1200
  const s = () => {
1201
- v(this, V, Y).call(this, { type: "continue" });
1201
+ m(this, V, Y).call(this, { type: "continue" });
1202
1202
  }, i = {
1203
1203
  client: r(this, _t),
1204
1204
  meta: this.options.meta,
@@ -1206,11 +1206,11 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1206
1206
  };
1207
1207
  o(this, gt, Le({
1208
1208
  fn: () => this.options.mutationFn ? this.options.mutationFn(t, i) : Promise.reject(new Error("No mutationFn found")),
1209
- onFail: (w, N) => {
1210
- v(this, V, Y).call(this, { type: "failed", failureCount: w, error: N });
1209
+ onFail: (C, N) => {
1210
+ m(this, V, Y).call(this, { type: "failed", failureCount: C, error: N });
1211
1211
  },
1212
1212
  onPause: () => {
1213
- v(this, V, Y).call(this, { type: "pause" });
1213
+ m(this, V, Y).call(this, { type: "pause" });
1214
1214
  },
1215
1215
  onContinue: s,
1216
1216
  retry: this.options.retry ?? 0,
@@ -1223,73 +1223,73 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1223
1223
  if (n)
1224
1224
  s();
1225
1225
  else {
1226
- v(this, V, Y).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (h = r(this, A).config).onMutate) == null ? void 0 : u.call(
1226
+ m(this, V, Y).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (h = r(this, A).config).onMutate) == null ? void 0 : u.call(
1227
1227
  h,
1228
1228
  t,
1229
1229
  this,
1230
1230
  i
1231
1231
  ));
1232
- const N = await ((b = (d = this.options).onMutate) == null ? void 0 : b.call(
1233
- d,
1232
+ const N = await ((b = (l = this.options).onMutate) == null ? void 0 : b.call(
1233
+ l,
1234
1234
  t,
1235
1235
  i
1236
1236
  ));
1237
- N !== this.state.context && v(this, V, Y).call(this, {
1237
+ N !== this.state.context && m(this, V, Y).call(this, {
1238
1238
  type: "pending",
1239
1239
  context: N,
1240
1240
  variables: t,
1241
1241
  isPaused: a
1242
1242
  });
1243
1243
  }
1244
- const w = await r(this, gt).start();
1244
+ const C = await r(this, gt).start();
1245
1245
  return await ((f = (O = r(this, A).config).onSuccess) == null ? void 0 : f.call(
1246
1246
  O,
1247
- w,
1247
+ C,
1248
1248
  t,
1249
1249
  this.state.context,
1250
1250
  this,
1251
1251
  i
1252
1252
  )), await ((y = (P = this.options).onSuccess) == null ? void 0 : y.call(
1253
1253
  P,
1254
- w,
1254
+ C,
1255
1255
  t,
1256
1256
  this.state.context,
1257
1257
  i
1258
- )), await ((m = (R = r(this, A).config).onSettled) == null ? void 0 : m.call(
1259
- R,
1260
- w,
1258
+ )), await ((p = (F = r(this, A).config).onSettled) == null ? void 0 : p.call(
1259
+ F,
1260
+ C,
1261
1261
  null,
1262
1262
  this.state.variables,
1263
1263
  this.state.context,
1264
1264
  this,
1265
1265
  i
1266
- )), await ((C = (p = this.options).onSettled) == null ? void 0 : C.call(
1267
- p,
1268
- w,
1266
+ )), await ((w = (g = this.options).onSettled) == null ? void 0 : w.call(
1267
+ g,
1268
+ C,
1269
1269
  null,
1270
1270
  t,
1271
1271
  this.state.context,
1272
1272
  i
1273
- )), v(this, V, Y).call(this, { type: "success", data: w }), w;
1274
- } catch (w) {
1273
+ )), m(this, V, Y).call(this, { type: "success", data: C }), C;
1274
+ } catch (C) {
1275
1275
  try {
1276
- throw await ((E = (M = r(this, A).config).onError) == null ? void 0 : E.call(
1277
- M,
1278
- w,
1276
+ throw await ((E = (R = r(this, A).config).onError) == null ? void 0 : E.call(
1277
+ R,
1278
+ C,
1279
1279
  t,
1280
1280
  this.state.context,
1281
1281
  this,
1282
1282
  i
1283
- )), await ((Q = (l = this.options).onError) == null ? void 0 : Q.call(
1284
- l,
1285
- w,
1283
+ )), await ((Q = (d = this.options).onError) == null ? void 0 : Q.call(
1284
+ d,
1285
+ C,
1286
1286
  t,
1287
1287
  this.state.context,
1288
1288
  i
1289
1289
  )), await ((Z = (x = r(this, A).config).onSettled) == null ? void 0 : Z.call(
1290
1290
  x,
1291
1291
  void 0,
1292
- w,
1292
+ C,
1293
1293
  this.state.variables,
1294
1294
  this.state.context,
1295
1295
  this,
@@ -1297,13 +1297,13 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1297
1297
  )), await ((X = (I = this.options).onSettled) == null ? void 0 : X.call(
1298
1298
  I,
1299
1299
  void 0,
1300
- w,
1300
+ C,
1301
1301
  t,
1302
1302
  this.state.context,
1303
1303
  i
1304
- )), w;
1304
+ )), C;
1305
1305
  } finally {
1306
- v(this, V, Y).call(this, { type: "error", error: w });
1306
+ m(this, V, Y).call(this, { type: "error", error: C });
1307
1307
  }
1308
1308
  } finally {
1309
1309
  r(this, A).runNext(this);
@@ -1557,9 +1557,9 @@ var z, je, ws = (je = class extends Kt {
1557
1557
  });
1558
1558
  });
1559
1559
  }
1560
- }, z = new WeakMap(), je), F, it, nt, Qt, Dt, at, Tt, It, Ne, Ss = (Ne = class {
1560
+ }, z = new WeakMap(), je), M, it, nt, Qt, Dt, at, Tt, It, Ne, Cs = (Ne = class {
1561
1561
  constructor(e = {}) {
1562
- c(this, F);
1562
+ c(this, M);
1563
1563
  c(this, it);
1564
1564
  c(this, nt);
1565
1565
  c(this, Qt);
@@ -1567,13 +1567,13 @@ var z, je, ws = (je = class extends Kt {
1567
1567
  c(this, at);
1568
1568
  c(this, Tt);
1569
1569
  c(this, It);
1570
- o(this, F, e.queryCache || new ws()), o(this, it, e.mutationCache || new bs()), o(this, nt, e.defaultOptions || {}), o(this, Qt, /* @__PURE__ */ new Map()), o(this, Dt, /* @__PURE__ */ new Map()), o(this, at, 0);
1570
+ o(this, M, e.queryCache || new ws()), o(this, it, e.mutationCache || new bs()), o(this, nt, e.defaultOptions || {}), o(this, Qt, /* @__PURE__ */ new Map()), o(this, Dt, /* @__PURE__ */ new Map()), o(this, at, 0);
1571
1571
  }
1572
1572
  mount() {
1573
1573
  Ht(this, at)._++, r(this, at) === 1 && (o(this, Tt, fe.subscribe(async (e) => {
1574
- e && (await this.resumePausedMutations(), r(this, F).onFocus());
1574
+ e && (await this.resumePausedMutations(), r(this, M).onFocus());
1575
1575
  })), o(this, It, $t.subscribe(async (e) => {
1576
- e && (await this.resumePausedMutations(), r(this, F).onOnline());
1576
+ e && (await this.resumePausedMutations(), r(this, M).onOnline());
1577
1577
  })));
1578
1578
  }
1579
1579
  unmount() {
@@ -1581,7 +1581,7 @@ var z, je, ws = (je = class extends Kt {
1581
1581
  Ht(this, at)._--, r(this, at) === 0 && ((e = r(this, Tt)) == null || e.call(this), o(this, Tt, void 0), (t = r(this, It)) == null || t.call(this), o(this, It, void 0));
1582
1582
  }
1583
1583
  isFetching(e) {
1584
- return r(this, F).findAll({ ...e, fetchStatus: "fetching" }).length;
1584
+ return r(this, M).findAll({ ...e, fetchStatus: "fetching" }).length;
1585
1585
  }
1586
1586
  isMutating(e) {
1587
1587
  return r(this, it).findAll({ ...e, status: "pending" }).length;
@@ -1596,28 +1596,28 @@ var z, je, ws = (je = class extends Kt {
1596
1596
  getQueryData(e) {
1597
1597
  var s;
1598
1598
  const t = this.defaultQueryOptions({ queryKey: e });
1599
- return (s = r(this, F).get(t.queryHash)) == null ? void 0 : s.state.data;
1599
+ return (s = r(this, M).get(t.queryHash)) == null ? void 0 : s.state.data;
1600
1600
  }
1601
1601
  ensureQueryData(e) {
1602
- const t = this.defaultQueryOptions(e), s = r(this, F).build(this, t), i = s.state.data;
1602
+ const t = this.defaultQueryOptions(e), s = r(this, M).build(this, t), i = s.state.data;
1603
1603
  return i === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(ot(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(i));
1604
1604
  }
1605
1605
  getQueriesData(e) {
1606
- return r(this, F).findAll(e).map(({ queryKey: t, state: s }) => {
1606
+ return r(this, M).findAll(e).map(({ queryKey: t, state: s }) => {
1607
1607
  const i = s.data;
1608
1608
  return [t, i];
1609
1609
  });
1610
1610
  }
1611
1611
  setQueryData(e, t, s) {
1612
- const i = this.defaultQueryOptions({ queryKey: e }), n = r(this, F).get(
1612
+ const i = this.defaultQueryOptions({ queryKey: e }), n = r(this, M).get(
1613
1613
  i.queryHash
1614
1614
  ), a = n == null ? void 0 : n.state.data, h = es(t, a);
1615
1615
  if (h !== void 0)
1616
- return r(this, F).build(this, i).setData(h, { ...s, manual: !0 });
1616
+ return r(this, M).build(this, i).setData(h, { ...s, manual: !0 });
1617
1617
  }
1618
1618
  setQueriesData(e, t, s) {
1619
1619
  return T.batch(
1620
- () => r(this, F).findAll(e).map(({ queryKey: i }) => [
1620
+ () => r(this, M).findAll(e).map(({ queryKey: i }) => [
1621
1621
  i,
1622
1622
  this.setQueryData(i, t, s)
1623
1623
  ])
@@ -1626,12 +1626,12 @@ var z, je, ws = (je = class extends Kt {
1626
1626
  getQueryState(e) {
1627
1627
  var s;
1628
1628
  const t = this.defaultQueryOptions({ queryKey: e });
1629
- return (s = r(this, F).get(
1629
+ return (s = r(this, M).get(
1630
1630
  t.queryHash
1631
1631
  )) == null ? void 0 : s.state;
1632
1632
  }
1633
1633
  removeQueries(e) {
1634
- const t = r(this, F);
1634
+ const t = r(this, M);
1635
1635
  T.batch(() => {
1636
1636
  t.findAll(e).forEach((s) => {
1637
1637
  t.remove(s);
@@ -1639,7 +1639,7 @@ var z, je, ws = (je = class extends Kt {
1639
1639
  });
1640
1640
  }
1641
1641
  resetQueries(e, t) {
1642
- const s = r(this, F);
1642
+ const s = r(this, M);
1643
1643
  return T.batch(() => (s.findAll(e).forEach((i) => {
1644
1644
  i.reset();
1645
1645
  }), this.refetchQueries(
@@ -1652,12 +1652,12 @@ var z, je, ws = (je = class extends Kt {
1652
1652
  }
1653
1653
  cancelQueries(e, t = {}) {
1654
1654
  const s = { revert: !0, ...t }, i = T.batch(
1655
- () => r(this, F).findAll(e).map((n) => n.cancel(s))
1655
+ () => r(this, M).findAll(e).map((n) => n.cancel(s))
1656
1656
  );
1657
1657
  return Promise.all(i).then(j).catch(j);
1658
1658
  }
1659
1659
  invalidateQueries(e, t = {}) {
1660
- return T.batch(() => (r(this, F).findAll(e).forEach((s) => {
1660
+ return T.batch(() => (r(this, M).findAll(e).forEach((s) => {
1661
1661
  s.invalidate();
1662
1662
  }), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
1663
1663
  {
@@ -1672,7 +1672,7 @@ var z, je, ws = (je = class extends Kt {
1672
1672
  ...t,
1673
1673
  cancelRefetch: t.cancelRefetch ?? !0
1674
1674
  }, i = T.batch(
1675
- () => r(this, F).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1675
+ () => r(this, M).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1676
1676
  let a = n.fetch(void 0, s);
1677
1677
  return s.throwOnError || (a = a.catch(j)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1678
1678
  })
@@ -1682,7 +1682,7 @@ var z, je, ws = (je = class extends Kt {
1682
1682
  fetchQuery(e) {
1683
1683
  const t = this.defaultQueryOptions(e);
1684
1684
  t.retry === void 0 && (t.retry = !1);
1685
- const s = r(this, F).build(this, t);
1685
+ const s = r(this, M).build(this, t);
1686
1686
  return s.isStaleByTime(
1687
1687
  ot(t.staleTime, s)
1688
1688
  ) ? s.fetch(t) : Promise.resolve(s.state.data);
@@ -1703,7 +1703,7 @@ var z, je, ws = (je = class extends Kt {
1703
1703
  return $t.isOnline() ? r(this, it).resumePausedMutations() : Promise.resolve();
1704
1704
  }
1705
1705
  getQueryCache() {
1706
- return r(this, F);
1706
+ return r(this, M);
1707
1707
  }
1708
1708
  getMutationCache() {
1709
1709
  return r(this, it);
@@ -1761,11 +1761,11 @@ var z, je, ws = (je = class extends Kt {
1761
1761
  };
1762
1762
  }
1763
1763
  clear() {
1764
- r(this, F).clear(), r(this, it).clear();
1764
+ r(this, M).clear(), r(this, it).clear();
1765
1765
  }
1766
- }, F = new WeakMap(), it = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), It = new WeakMap(), Ne), Ve = K.createContext(
1766
+ }, M = new WeakMap(), it = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), It = new WeakMap(), Ne), Ve = K.createContext(
1767
1767
  void 0
1768
- ), Cs = (e) => {
1768
+ ), Ss = (e) => {
1769
1769
  const t = K.useContext(Ve);
1770
1770
  if (!t)
1771
1771
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
@@ -1813,38 +1813,38 @@ var Fs = K.createContext(Es()), Rs = () => K.useContext(Fs), Ms = (e, t) => {
1813
1813
  s.clearReset();
1814
1814
  });
1815
1815
  function As(e, t, s) {
1816
- var f, P, y, R, m;
1816
+ var f, P, y, F, p;
1817
1817
  if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
1818
1818
  throw new Error(
1819
1819
  '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'
1820
1820
  );
1821
- const i = Ps(), n = Rs(), a = Cs(), h = a.defaultQueryOptions(e);
1821
+ const i = Ps(), n = Rs(), a = Ss(), h = a.defaultQueryOptions(e);
1822
1822
  (P = (f = a.getDefaultOptions().queries) == null ? void 0 : f._experimental_beforeQuery) == null || P.call(
1823
1823
  f,
1824
1824
  h
1825
1825
  ), process.env.NODE_ENV !== "production" && (h.queryFn || console.error(
1826
1826
  `[${h.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1827
1827
  )), h._optimisticResults = i ? "isRestoring" : "optimistic", Ts(h), Ms(h, n), Qs(n);
1828
- const u = !a.getQueryCache().get(h.queryHash), [d] = K.useState(
1828
+ const u = !a.getQueryCache().get(h.queryHash), [l] = K.useState(
1829
1829
  () => new t(
1830
1830
  a,
1831
1831
  h
1832
1832
  )
1833
- ), b = d.getOptimisticResult(h), O = !i && e.subscribed !== !1;
1833
+ ), b = l.getOptimisticResult(h), O = !i && e.subscribed !== !1;
1834
1834
  if (K.useSyncExternalStore(
1835
1835
  K.useCallback(
1836
- (p) => {
1837
- const C = O ? d.subscribe(T.batchCalls(p)) : j;
1838
- return d.updateResult(), C;
1836
+ (g) => {
1837
+ const w = O ? l.subscribe(T.batchCalls(g)) : j;
1838
+ return l.updateResult(), w;
1839
1839
  },
1840
- [d, O]
1840
+ [l, O]
1841
1841
  ),
1842
- () => d.getCurrentResult(),
1843
- () => d.getCurrentResult()
1842
+ () => l.getCurrentResult(),
1843
+ () => l.getCurrentResult()
1844
1844
  ), K.useEffect(() => {
1845
- d.setOptions(h);
1846
- }, [h, d]), qs(h, b))
1847
- throw Me(h, d, n);
1845
+ l.setOptions(h);
1846
+ }, [h, l]), qs(h, b))
1847
+ throw Me(h, l, n);
1848
1848
  if (Ds({
1849
1849
  result: b,
1850
1850
  errorResetBoundary: n,
@@ -1853,28 +1853,28 @@ function As(e, t, s) {
1853
1853
  suspense: h.suspense
1854
1854
  }))
1855
1855
  throw b.error;
1856
- if ((R = (y = a.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || R.call(
1856
+ if ((F = (y = a.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || F.call(
1857
1857
  y,
1858
1858
  h,
1859
1859
  b
1860
1860
  ), h.experimental_prefetchInRender && !bt && Is(b, i)) {
1861
- const p = u ? (
1861
+ const g = u ? (
1862
1862
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1863
- Me(h, d, n)
1863
+ Me(h, l, n)
1864
1864
  ) : (
1865
1865
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1866
- (m = a.getQueryCache().get(h.queryHash)) == null ? void 0 : m.promise
1866
+ (p = a.getQueryCache().get(h.queryHash)) == null ? void 0 : p.promise
1867
1867
  );
1868
- p == null || p.catch(j).finally(() => {
1869
- d.updateResult();
1868
+ g == null || g.catch(j).finally(() => {
1869
+ l.updateResult();
1870
1870
  });
1871
1871
  }
1872
- return h.notifyOnChangeProps ? b : d.trackResult(b);
1872
+ return h.notifyOnChangeProps ? b : l.trackResult(b);
1873
1873
  }
1874
1874
  function xs(e, t) {
1875
1875
  return As(e, fs);
1876
1876
  }
1877
- const Us = $e(void 0), js = new Ss({
1877
+ const Us = $e(void 0), js = new Cs({
1878
1878
  defaultOptions: {
1879
1879
  queries: {
1880
1880
  retry: 1,
@@ -1891,12 +1891,12 @@ function Ns({
1891
1891
  handleDateChanged: i = () => !0,
1892
1892
  children: n
1893
1893
  }) {
1894
- const [a, h] = me(s[0][0].date), [u, d] = me(!1), b = We(Jt(s[0][0].date, "yyyy-MM-dd"));
1894
+ const [a, h] = me(s[0][0].date), [u, l] = me(!1), b = We(Jt(s[0][0].date, "yyyy-MM-dd"));
1895
1895
  Gt.setComponent("ScheduleContext"), Gt.log("ScheduleProvider initialized with date: ", a);
1896
- const O = Je((p) => {
1897
- const C = Jt(p, "yyyy-MM-dd");
1898
- C !== b.current && (d(!0), b.current = C), h(p), i(p);
1899
- }, [i]), { data: f, isLoading: P, isError: y, error: R } = xs({
1896
+ const O = Je((w) => {
1897
+ const R = Jt(w, "yyyy-MM-dd");
1898
+ R !== b.current && (l(!0), b.current = R), h(w), i(w);
1899
+ }, [i]), { data: f, isLoading: P, isFetching: y, isError: F, error: p } = xs({
1900
1900
  queryKey: ["schedule", Jt(a, "yyyy-MM-dd")],
1901
1901
  queryFn: () => e(a),
1902
1902
  staleTime: 1e3 * 60 * 15,
@@ -1904,19 +1904,26 @@ function Ns({
1904
1904
  retry: 1
1905
1905
  });
1906
1906
  ve(() => {
1907
- f !== void 0 && u && d(!1);
1908
- }, [f, u]), ve(() => {
1909
- y && (Gt.log("Error fetching schedule for date:", a), Gt.log("Error detials: ", R));
1910
- }, [a, y, R]);
1911
- const m = Ze(() => ({
1907
+ if (f !== void 0 && u)
1908
+ if (!y) {
1909
+ const R = setTimeout(() => {
1910
+ l(!1);
1911
+ }, 500);
1912
+ return () => clearTimeout(R);
1913
+ } else
1914
+ l(!1);
1915
+ }, [f, u, y]), ve(() => {
1916
+ F && (Gt.log("Error fetching schedule for date:", a), Gt.log("Error detials: ", p));
1917
+ }, [a, F, p]);
1918
+ const g = Ze(() => ({
1912
1919
  schedule: f ?? t,
1913
1920
  weeks: s,
1914
1921
  currentDate: a,
1915
1922
  isLoading: P || u,
1916
- isError: y,
1923
+ isError: F,
1917
1924
  setCurrentDate: O
1918
- }), [f, t, s, a, P, u, y, O]);
1919
- return /* @__PURE__ */ Vt(Us.Provider, { value: m, children: n });
1925
+ }), [f, t, s, a, P, u, F, O]);
1926
+ return /* @__PURE__ */ Vt(Us.Provider, { value: g, children: n });
1920
1927
  }
1921
1928
  function Gs(e) {
1922
1929
  return /* @__PURE__ */ Vt(Os, { client: js, children: /* @__PURE__ */ Vt(Ns, { ...e }) });