fetchium 0.2.3 → 0.3.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 (53) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/development/QueryClient-QKhS8mhg.js +2 -0
  3. package/dist/cjs/development/QueryClient-QKhS8mhg.js.map +1 -0
  4. package/dist/cjs/development/index.js +1 -1
  5. package/dist/cjs/{production/mutation-Bleah98u.js → development/mutation-w67Vpuvw.js} +2 -2
  6. package/dist/cjs/{production/mutation-Bleah98u.js.map → development/mutation-w67Vpuvw.js.map} +1 -1
  7. package/dist/cjs/development/react/index.js +1 -1
  8. package/dist/cjs/development/react/index.js.map +1 -1
  9. package/dist/cjs/development/rest/index.js +1 -1
  10. package/dist/cjs/development/topic/index.js +1 -1
  11. package/dist/cjs/production/QueryClient-DIAqDTHF.js +2 -0
  12. package/dist/cjs/production/QueryClient-DIAqDTHF.js.map +1 -0
  13. package/dist/cjs/production/index.js +1 -1
  14. package/dist/cjs/{development/mutation-GI_gTQEB.js → production/mutation-CgS9gXW7.js} +2 -2
  15. package/dist/cjs/{development/mutation-GI_gTQEB.js.map → production/mutation-CgS9gXW7.js.map} +1 -1
  16. package/dist/cjs/production/react/index.js +1 -1
  17. package/dist/cjs/production/react/index.js.map +1 -1
  18. package/dist/cjs/production/rest/index.js +1 -1
  19. package/dist/cjs/production/topic/index.js +1 -1
  20. package/dist/esm/EntityInstance.d.ts.map +1 -1
  21. package/dist/esm/QueryResult.d.ts +4 -3
  22. package/dist/esm/QueryResult.d.ts.map +1 -1
  23. package/dist/esm/development/{QueryClient-CmMSNSpt.js → QueryClient-C9tBdK1Z.js} +351 -332
  24. package/dist/esm/development/QueryClient-C9tBdK1Z.js.map +1 -0
  25. package/dist/esm/development/index.js +2 -2
  26. package/dist/esm/development/{mutation-BAM3eYqd.js → mutation-Dx63NCGk.js} +2 -2
  27. package/dist/esm/development/{mutation-BAM3eYqd.js.map → mutation-Dx63NCGk.js.map} +1 -1
  28. package/dist/esm/development/react/index.js +5 -36
  29. package/dist/esm/development/react/index.js.map +1 -1
  30. package/dist/esm/development/rest/index.js +2 -2
  31. package/dist/esm/development/topic/index.js +1 -1
  32. package/dist/esm/production/{QueryClient-3aWu_mJE.js → QueryClient-D64xo0EA.js} +323 -306
  33. package/dist/esm/production/QueryClient-D64xo0EA.js.map +1 -0
  34. package/dist/esm/production/index.js +2 -2
  35. package/dist/esm/production/{mutation-YpiJLNWU.js → mutation-Aw1JE7VO.js} +2 -2
  36. package/dist/esm/production/{mutation-YpiJLNWU.js.map → mutation-Aw1JE7VO.js.map} +1 -1
  37. package/dist/esm/production/react/index.js +5 -36
  38. package/dist/esm/production/react/index.js.map +1 -1
  39. package/dist/esm/production/rest/index.js +2 -2
  40. package/dist/esm/production/topic/index.js +1 -1
  41. package/dist/esm/react/use-query.d.ts +8 -0
  42. package/dist/esm/react/use-query.d.ts.map +1 -1
  43. package/dist/esm/types.d.ts +3 -3
  44. package/dist/esm/types.d.ts.map +1 -1
  45. package/package.json +6 -6
  46. package/plugin/docs/api/fetchium-react.md +5 -4
  47. package/plugin/docs/api/fetchium.md +2 -2
  48. package/dist/cjs/development/QueryClient-Ce5Mnumb.js +0 -2
  49. package/dist/cjs/development/QueryClient-Ce5Mnumb.js.map +0 -1
  50. package/dist/cjs/production/QueryClient-BXGk-5PR.js +0 -2
  51. package/dist/cjs/production/QueryClient-BXGk-5PR.js.map +0 -1
  52. package/dist/esm/development/QueryClient-CmMSNSpt.js.map +0 -1
  53. package/dist/esm/production/QueryClient-3aWu_mJE.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { notifier as ut, relay as Pt, setScopeOwner as Ee, reactiveMethod as be, signal as jt, context as $t, getContext as Ce, task as Se, reactiveSignal as Oe, isSignal as Re, watcher as xe } from "signalium";
2
- import { registerCustomHash as Ae, hashValue as N } from "signalium/utils";
3
- import { d as Lt } from "./shared-DcuVH8Pf.js";
4
- import { SyncQueryStore as Ne, MemoryPersistentStore as De } from "./stores/sync.js";
1
+ import { notifier as ut, relay as $t, setScopeOwner as Ce, reactiveMethod as Se, signal as Lt, context as Ut, getContext as Oe, task as Re, reactiveSignal as Ae, isSignal as xe, watcher as Ne } from "signalium";
2
+ import { registerCustomHash as De, hashValue as N, registerCustomSnapshot as Ie } from "signalium/utils";
3
+ import { d as qt } from "./shared-DcuVH8Pf.js";
4
+ import { SyncQueryStore as ke, MemoryPersistentStore as Fe } from "./stores/sync.js";
5
5
  var V = /* @__PURE__ */ ((e) => (e.Always = "always", e.Online = "online", e.OfflineFirst = "offlineFirst", e))(V || {}), d = /* @__PURE__ */ ((e) => (e[e.UNDEFINED = 1] = "UNDEFINED", e[e.NULL = 2] = "NULL", e[e.NUMBER = 4] = "NUMBER", e[e.STRING = 8] = "STRING", e[e.BOOLEAN = 16] = "BOOLEAN", e[e.OBJECT = 32] = "OBJECT", e[e.ARRAY = 64] = "ARRAY", e[e.ID = 128] = "ID", e[e.RECORD = 256] = "RECORD", e[e.UNION = 512] = "UNION", e[e.ENTITY = 1024] = "ENTITY", e[e.HAS_FORMAT = 4096] = "HAS_FORMAT", e[e.IS_EAGER_FORMAT = 8192] = "IS_EAGER_FORMAT", e[e.PARSE_RESULT = 16384] = "PARSE_RESULT", e[e.LIVE = 32768] = "LIVE", e))(d || {});
6
- const I = /* @__PURE__ */ Symbol("array"), F = /* @__PURE__ */ Symbol("record"), Ut = /* @__PURE__ */ Symbol("QUERY_ID");
6
+ const I = /* @__PURE__ */ Symbol("array"), k = /* @__PURE__ */ Symbol("record"), Vt = /* @__PURE__ */ Symbol("QUERY_ID");
7
7
  var dt = /* @__PURE__ */ ((e) => (e[e.Array = 0] = "Array", e[e.Value = 1] = "Value", e))(dt || {});
8
8
  class B {
9
9
  type;
@@ -47,7 +47,7 @@ function T(e) {
47
47
  return S.get(e);
48
48
  }
49
49
  var X = /* @__PURE__ */ ((e) => (e[e.Query = 0] = "Query", e[e.Entity = 1] = "Entity", e))(X || {});
50
- class Ie {
50
+ class Me {
51
51
  constructor(t, n, i) {
52
52
  this._onEvict = n, this._intervalId = setInterval(this._tick, t * 6e4 * i);
53
53
  }
@@ -70,7 +70,7 @@ class Ie {
70
70
  clearInterval(this._intervalId);
71
71
  }
72
72
  }
73
- class Fe {
73
+ class Te {
74
74
  _buckets = /* @__PURE__ */ new Map();
75
75
  _nextTickEntries = /* @__PURE__ */ new Map();
76
76
  _nextTickScheduled = !1;
@@ -88,7 +88,7 @@ class Fe {
88
88
  }
89
89
  const { _buckets: r } = this;
90
90
  let s = r.get(n);
91
- s || (s = new Ie(n, this._onEvict, this._multiplier), r.set(n, s)), s.schedule(t, i);
91
+ s || (s = new Me(n, this._onEvict, this._multiplier), r.set(n, s)), s.schedule(t, i);
92
92
  }
93
93
  cancel(t, n) {
94
94
  if (n !== 1 / 0) {
@@ -113,7 +113,7 @@ class Fe {
113
113
  t.clear(), n.clear();
114
114
  }
115
115
  }
116
- class Me {
116
+ class Pe {
117
117
  schedule(t, n, i) {
118
118
  }
119
119
  cancel(t, n) {
@@ -121,15 +121,15 @@ class Me {
121
121
  destroy() {
122
122
  }
123
123
  }
124
- const W = /* @__PURE__ */ Symbol("fieldRef"), D = /* @__PURE__ */ Symbol("fieldRefPath"), ht = /* @__PURE__ */ Symbol("DEFINITION_TARGET"), z = /* @__PURE__ */ Symbol("CANCEL_PROXY"), ke = /\[([^\]]+)\]/g;
125
- function qt(e) {
124
+ const W = /* @__PURE__ */ Symbol("fieldRef"), D = /* @__PURE__ */ Symbol("fieldRefPath"), ht = /* @__PURE__ */ Symbol("DEFINITION_TARGET"), z = /* @__PURE__ */ Symbol("CANCEL_PROXY"), je = /\[([^\]]+)\]/g;
125
+ function Kt(e) {
126
126
  const t = {
127
127
  [W]: !0,
128
128
  [D]: e
129
129
  };
130
- return new Proxy(t, Te);
130
+ return new Proxy(t, $e);
131
131
  }
132
- const Te = {
132
+ const $e = {
133
133
  get(e, t) {
134
134
  if (t === W) return !0;
135
135
  if (t === D) return e[D];
@@ -139,19 +139,19 @@ const Te = {
139
139
  }
140
140
  if (typeof t == "symbol") return;
141
141
  const n = e[D];
142
- return qt([...n, t]);
142
+ return Kt([...n, t]);
143
143
  },
144
144
  has(e, t) {
145
145
  return t === W || t === D;
146
146
  }
147
147
  };
148
- function Vt(e) {
148
+ function Bt(e) {
149
149
  return typeof e == "object" && e !== null && e[W] === !0;
150
150
  }
151
- function Kt(e) {
151
+ function Qt(e) {
152
152
  return e[D];
153
153
  }
154
- function Bt(e) {
154
+ function Yt(e) {
155
155
  let t = !1;
156
156
  return new Proxy(e, {
157
157
  set(n, i, r) {
@@ -162,11 +162,11 @@ function Bt(e) {
162
162
  throw new Error("Definition proxy accessed after extraction. Avoid arrow functions that capture `this`.");
163
163
  return i === ht ? n : i === z ? () => {
164
164
  t = !0;
165
- } : typeof i == "symbol" ? n[i] : qt([i]);
165
+ } : typeof i == "symbol" ? n[i] : Kt([i]);
166
166
  }
167
167
  });
168
168
  }
169
- function Pe(e) {
169
+ function Le(e) {
170
170
  const t = e[ht];
171
171
  e[z]();
172
172
  const n = {};
@@ -192,17 +192,17 @@ function lt(e, t) {
192
192
  }
193
193
  return n;
194
194
  }
195
- function je(e, t) {
196
- return e.replace(ke, (n, i) => {
195
+ function Ue(e, t) {
196
+ return e.replace(je, (n, i) => {
197
197
  const r = i.split("."), s = lt(r, t);
198
198
  return s != null ? encodeURIComponent(String(s)) : "";
199
199
  });
200
200
  }
201
201
  function J(e, t) {
202
- if (Vt(e))
203
- return lt(Kt(e), t);
202
+ if (Bt(e))
203
+ return lt(Qt(e), t);
204
204
  if (typeof e == "string")
205
- return je(e, t);
205
+ return Ue(e, t);
206
206
  if (Array.isArray(e))
207
207
  return e.map((n) => J(n, t));
208
208
  if (typeof e == "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype) {
@@ -222,14 +222,14 @@ function it(e, t, n) {
222
222
  o[a] = c.bind(o);
223
223
  return o;
224
224
  }
225
- class Qt {
225
+ class yt {
226
226
  static cache;
227
227
  constructor() {
228
- return Bt(this);
228
+ return Yt(this);
229
229
  }
230
230
  }
231
- const Yt = Object.entries, rt = Object.keys;
232
- let Gt = () => {
231
+ const Gt = Object.entries, rt = Object.keys;
232
+ let Ht = () => {
233
233
  };
234
234
  {
235
235
  const t = (i, r) => {
@@ -266,20 +266,20 @@ let Gt = () => {
266
266
  }
267
267
  return !1;
268
268
  };
269
- Gt = (i, r, s, o) => {
269
+ Ht = (i, r, s, o) => {
270
270
  if (!n(s, o))
271
271
  throw new Error(
272
272
  `[fetchium] Entity typename '${i}' has incompatible type for field '${r}' across different entity definitions`
273
273
  );
274
274
  };
275
275
  }
276
- function St(e) {
276
+ function Ot(e) {
277
277
  return typeof e == "number" ? e | d.UNDEFINED : e instanceof m ? (e.mask & d.UNDEFINED) !== 0 ? e : m.cloneWith(e, d.UNDEFINED) : e;
278
278
  }
279
- function Ot(e) {
279
+ function Rt(e) {
280
280
  return e instanceof m && (e.mask & d.OBJECT) !== 0 && (e.mask & (d.ENTITY | d.ARRAY | d.UNION | d.RECORD | d.LIVE)) === 0;
281
281
  }
282
- function Ht(e, t, n) {
282
+ function Wt(e, t, n) {
283
283
  const i = /* @__PURE__ */ new Set();
284
284
  for (const s of e)
285
285
  if (s !== void 0)
@@ -292,13 +292,13 @@ function Ht(e, t, n) {
292
292
  let f = !0;
293
293
  for (const h of e) {
294
294
  const u = h?.[s];
295
- u !== void 0 ? (o++, a === void 0 && (a = u), a !== void 0 && u !== a && !Ot(u) && Gt(n, s, a, u), Ot(u) ? c.push(u.shape) : (f = !1, c.push(void 0))) : (f = !1, c.push(void 0));
295
+ u !== void 0 ? (o++, a === void 0 && (a = u), a !== void 0 && u !== a && !Rt(u) && Ht(n, s, a, u), Rt(u) ? c.push(u.shape) : (f = !1, c.push(void 0))) : (f = !1, c.push(void 0));
296
296
  }
297
297
  if (f && o > 0) {
298
- const h = Ht(c, t, n), u = new m(d.OBJECT, h);
299
- r[s] = o < t ? St(u) : u;
298
+ const h = Wt(c, t, n), u = new m(d.OBJECT, h);
299
+ r[s] = o < t ? Ot(u) : u;
300
300
  } else
301
- r[s] = o < t ? St(a) : a;
301
+ r[s] = o < t ? Ot(a) : a;
302
302
  }
303
303
  return r;
304
304
  }
@@ -336,7 +336,7 @@ class m {
336
336
  }
337
337
  static merge(t) {
338
338
  if (t.length === 1) return t[0];
339
- const n = t.length, i = t.map((f) => f.shape), r = t[0].typenameValue ?? "(unknown)", s = Ht(i, n, r);
339
+ const n = t.length, i = t.map((f) => f.shape), r = t[0].typenameValue ?? "(unknown)", s = Wt(i, n, r);
340
340
  let o, a, c;
341
341
  for (const f of t) {
342
342
  if (o === void 0 && f.idField !== void 0)
@@ -403,28 +403,28 @@ class $ extends Set {
403
403
  return t;
404
404
  }
405
405
  }
406
- const $e = 1128875347;
407
- Ae($, (e) => {
408
- let t = $e;
406
+ const qe = 1128875347;
407
+ De($, (e) => {
408
+ let t = qe;
409
409
  for (const n of e)
410
410
  t += N(n);
411
411
  return t >>> 0;
412
412
  });
413
- function yt(e, t) {
413
+ function pt(e, t) {
414
414
  return new m(e, t);
415
415
  }
416
- function Le(e) {
417
- return yt(d.ARRAY, e);
416
+ function Ve(e) {
417
+ return pt(d.ARRAY, e);
418
418
  }
419
- function Ue(e) {
420
- return yt(d.RECORD | d.OBJECT, e);
419
+ function Ke(e) {
420
+ return pt(d.RECORD | d.OBJECT, e);
421
421
  }
422
- function qe(e) {
423
- return yt(d.PARSE_RESULT, e);
422
+ function Be(e) {
423
+ return pt(d.PARSE_RESULT, e);
424
424
  }
425
- function Wt(e, t) {
425
+ function zt(e, t) {
426
426
  let n = e, i, r, s;
427
- for (const [o, a] of Yt(t))
427
+ for (const [o, a] of Gt(t))
428
428
  switch (typeof a) {
429
429
  case "number":
430
430
  if ((a & d.ID) !== 0) {
@@ -446,10 +446,10 @@ function Wt(e, t) {
446
446
  }
447
447
  return new m(n, t, void 0, r, s, i);
448
448
  }
449
- function Ve(e) {
450
- return Wt(d.OBJECT, e);
449
+ function Qe(e) {
450
+ return zt(d.OBJECT, e);
451
451
  }
452
- function Rt(e, t, n) {
452
+ function At(e, t, n) {
453
453
  const i = e.mask;
454
454
  if ((i & d.UNION) !== 0) {
455
455
  const r = e;
@@ -462,7 +462,7 @@ function Rt(e, t, n) {
462
462
  }
463
463
  const s = r.shape;
464
464
  if (s !== void 0)
465
- for (const o of [...rt(s), I, F]) {
465
+ for (const o of [...rt(s), I, k]) {
466
466
  const a = s[o];
467
467
  if (t[o] !== void 0 && t[o] !== a)
468
468
  throw new Error(
@@ -475,9 +475,9 @@ function Rt(e, t, n) {
475
475
  throw new Error("Array shape already defined");
476
476
  t[I] = e.shape;
477
477
  } else if ((i & d.RECORD) !== 0) {
478
- if (t[F] !== void 0)
478
+ if (t[k] !== void 0)
479
479
  throw new Error("Record shape already defined");
480
- t[F] = e.shape;
480
+ t[k] = e.shape;
481
481
  } else {
482
482
  const r = e.typenameField, s = e.typenameValue;
483
483
  if (s === void 0)
@@ -490,7 +490,7 @@ function Rt(e, t, n) {
490
490
  }
491
491
  return n;
492
492
  }
493
- function pt(...e) {
493
+ function gt(...e) {
494
494
  const t = e;
495
495
  let n = 0, i = 0, r, s, o, a, c = 0;
496
496
  for (const h of t) {
@@ -510,7 +510,7 @@ function pt(...e) {
510
510
  r = h;
511
511
  continue;
512
512
  }
513
- i === 2 && (o = /* @__PURE__ */ Object.create(null), a = Rt(r, o, a)), a = Rt(h, o, a);
513
+ i === 2 && (o = /* @__PURE__ */ Object.create(null), a = At(r, o, a)), a = At(h, o, a);
514
514
  }
515
515
  if (i === 0)
516
516
  return s === void 0 ? n : n === 0 ? s : new m(n | d.UNION, void 0, s);
@@ -519,36 +519,36 @@ function pt(...e) {
519
519
  const f = n | c | d.UNION;
520
520
  return new m(f, o, s, a);
521
521
  }
522
- function gt(e, t, n) {
522
+ function mt(e, t, n) {
523
523
  const i = e;
524
524
  if (typeof i == "number")
525
525
  return i | t;
526
526
  if (i instanceof Set)
527
- return pt(e, t);
527
+ return gt(e, t);
528
528
  let r = n.get(i);
529
529
  return r === void 0 && (r = m.cloneWith(i, t), n.set(i, r)), r;
530
530
  }
531
- const Ke = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap();
532
- function Ye(e) {
533
- return gt(e, d.UNDEFINED | d.NULL, Qe);
531
+ const Ye = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap();
532
+ function We(e) {
533
+ return mt(e, d.UNDEFINED | d.NULL, He);
534
534
  }
535
- function Ge(e) {
536
- return gt(e, d.UNDEFINED, Ke);
535
+ function ze(e) {
536
+ return mt(e, d.UNDEFINED, Ye);
537
537
  }
538
- function He(e) {
539
- return gt(e, d.NULL, Be);
538
+ function Je(e) {
539
+ return mt(e, d.NULL, Ge);
540
540
  }
541
- function We(e) {
541
+ function Xe(e) {
542
542
  return e;
543
543
  }
544
- function ze(e) {
544
+ function Ze(e) {
545
545
  return /* @__PURE__ */ new Set([e]);
546
546
  }
547
- const zt = ((...e) => new Set(e));
548
- zt.caseInsensitive = (...e) => new $(e);
549
- const mt = 16;
550
- let Je = 0;
551
- const st = [], Jt = [], Xt = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new WeakSet();
547
+ const Jt = ((...e) => new Set(e));
548
+ Jt.caseInsensitive = (...e) => new $(e);
549
+ const vt = 16;
550
+ let tn = 0;
551
+ const st = [], Xt = [], Zt = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new WeakSet();
552
552
  class Q {
553
553
  _raw;
554
554
  _formatted;
@@ -561,26 +561,26 @@ class Q {
561
561
  return this._parsed || (this._formatted = st[this._formatId](this._raw), this._parsed = !0), this._formatted;
562
562
  }
563
563
  toJSON() {
564
- return this._parsed ? Jt[this._formatId](this._formatted) : this._raw;
564
+ return this._parsed ? Xt[this._formatId](this._formatted) : this._raw;
565
565
  }
566
566
  }
567
- function Xe(e) {
568
- const t = Xt.get(e);
567
+ function en(e) {
568
+ const t = Zt.get(e);
569
569
  if (t === void 0)
570
570
  throw new Error(`Format ${e} not registered`);
571
571
  return t;
572
572
  }
573
573
  function xt(e) {
574
- const t = e >> mt;
575
- return Zt.get(t);
574
+ const t = e >> vt;
575
+ return te.get(t);
576
576
  }
577
- function te(e, t, n, i, r) {
578
- const s = Je++;
579
- st[s] = n, Jt[s] = i, Zt.set(s, e);
580
- const o = r?.eager ?? !0, c = s << mt | t | d.HAS_FORMAT | (o ? d.IS_EAGER_FORMAT : 0);
581
- Xt.set(e, c);
577
+ function ee(e, t, n, i, r) {
578
+ const s = tn++;
579
+ st[s] = n, Xt[s] = i, te.set(s, e);
580
+ const o = r?.eager ?? !0, c = s << vt | t | d.HAS_FORMAT | (o ? d.IS_EAGER_FORMAT : 0);
581
+ Zt.set(e, c);
582
582
  }
583
- te(
583
+ ee(
584
584
  "date",
585
585
  d.STRING,
586
586
  (e) => {
@@ -597,7 +597,7 @@ te(
597
597
  return `${t}-${n}-${i}`;
598
598
  }
599
599
  );
600
- te(
600
+ ee(
601
601
  "date-time",
602
602
  d.STRING,
603
603
  (e) => {
@@ -608,14 +608,14 @@ te(
608
608
  },
609
609
  (e) => e.toISOString()
610
610
  );
611
- const At = /* @__PURE__ */ new WeakMap();
611
+ const Nt = /* @__PURE__ */ new WeakMap();
612
612
  function j(e) {
613
- let t = At.get(e);
613
+ let t = Nt.get(e);
614
614
  if (t === void 0) {
615
615
  const n = new e(), i = n[ht] ?? n;
616
616
  n[z] && n[z]();
617
617
  const r = {};
618
- for (const [f, h] of Yt(i)) {
618
+ for (const [f, h] of Gt(i)) {
619
619
  if (!(typeof h == "number" || typeof h == "string" || h instanceof Set || h instanceof m || h instanceof $))
620
620
  throw new Error(
621
621
  `[fetchium] Entity '${e.name}' field '${f}' has an invalid type definition. All entity fields must be type definitions (e.g. t.string, t.number, t.entity(...), etc). Got: ${typeof h == "object" ? h?.constructor?.name ?? typeof h : typeof h}`
@@ -625,7 +625,7 @@ function j(e) {
625
625
  const s = Object.getPrototypeOf(e.prototype);
626
626
  if (s != null) {
627
627
  const f = s.constructor;
628
- if (f !== Qt && typeof f == "function") {
628
+ if (f !== yt && typeof f == "function") {
629
629
  const u = j(f).shape;
630
630
  for (const l of rt(u))
631
631
  if (l in r && r[l] !== u[l])
@@ -635,16 +635,16 @@ function j(e) {
635
635
  const o = {}, a = e.prototype;
636
636
  for (const f of Object.getOwnPropertyNames(a))
637
637
  f !== "constructor" && typeof a[f] == "function" && (o[f] = a[f]);
638
- t = Wt(d.ENTITY | d.OBJECT, r), t._entityClass = e, rt(o).length > 0 && (t._methods = o), typeof o.__subscribe == "function" && (t._entityConfig = { hasSubscribe: !0 });
638
+ t = zt(d.ENTITY | d.OBJECT, r), t._entityClass = e, rt(o).length > 0 && (t._methods = o), typeof o.__subscribe == "function" && (t._entityConfig = { hasSubscribe: !0 });
639
639
  const c = e;
640
- c.cache && (t._entityCache = c.cache), At.set(e, t);
640
+ c.cache && (t._entityCache = c.cache), Nt.set(e, t);
641
641
  }
642
642
  return t;
643
643
  }
644
- function Ze(e) {
644
+ function nn(e) {
645
645
  return j(e);
646
646
  }
647
- function ee(e, t) {
647
+ function ne(e, t) {
648
648
  if (t == null) return;
649
649
  const n = /* @__PURE__ */ new Map();
650
650
  if (Array.isArray(t))
@@ -667,50 +667,50 @@ function ee(e, t) {
667
667
  }
668
668
  return n.size > 0 ? n : void 0;
669
669
  }
670
- function ne(e) {
670
+ function ie(e) {
671
671
  return Array.isArray(e) ? e.map((t) => j(t)) : [j(e)];
672
672
  }
673
- function tn(e, t) {
674
- const n = ne(e), i = n.length === 1 ? n[0] : pt(...n.map((o) => o)), r = d.ARRAY | d.LIVE, s = new m(r, i);
673
+ function rn(e, t) {
674
+ const n = ie(e), i = n.length === 1 ? n[0] : gt(...n.map((o) => o)), r = d.ARRAY | d.LIVE, s = new m(r, i);
675
675
  return s._liveConfig = B.array(
676
676
  n,
677
- ee(n, t?.constraints),
677
+ ne(n, t?.constraints),
678
678
  t?.sort
679
679
  ), s;
680
680
  }
681
- function en(e, t, n) {
682
- const i = ne(t), r = e, s = d.LIVE, o = new m(s, void 0);
681
+ function sn(e, t, n) {
682
+ const i = ie(t), r = e, s = d.LIVE, o = new m(s, void 0);
683
683
  return o._liveConfig = B.value(
684
684
  i,
685
- ee(i, n?.constraints),
685
+ ne(i, n?.constraints),
686
686
  r,
687
687
  n.onCreate,
688
688
  n.onUpdate,
689
689
  n.onDelete
690
690
  ), o;
691
691
  }
692
- const nn = {
693
- format: Xe,
694
- typename: We,
695
- const: ze,
696
- enum: zt,
692
+ const on = {
693
+ format: en,
694
+ typename: Xe,
695
+ const: Ze,
696
+ enum: Jt,
697
697
  id: d.ID | d.STRING | d.NUMBER,
698
698
  string: d.STRING,
699
699
  number: d.NUMBER,
700
700
  boolean: d.BOOLEAN,
701
701
  null: d.NULL,
702
702
  undefined: d.UNDEFINED,
703
- array: Le,
704
- object: Ve,
705
- record: Ue,
706
- union: pt,
707
- nullish: Ye,
708
- optional: Ge,
709
- nullable: He,
710
- result: qe,
711
- entity: Ze,
712
- liveArray: tn,
713
- liveValue: en
703
+ array: Ve,
704
+ object: Qe,
705
+ record: Ke,
706
+ union: gt,
707
+ nullish: We,
708
+ optional: ze,
709
+ nullable: Je,
710
+ result: Be,
711
+ entity: nn,
712
+ liveArray: rn,
713
+ liveValue: sn
714
714
  };
715
715
  function K(e) {
716
716
  if (e instanceof $)
@@ -739,9 +739,9 @@ function K(e) {
739
739
  i.push(o);
740
740
  }
741
741
  if (n.shape !== void 0) {
742
- n.shape[I] !== void 0 && i.push(`Array<${K(n.shape[I])}>`), n.shape[F] !== void 0 && i.push(`Record<string, ${K(n.shape[F])}>`);
742
+ n.shape[I] !== void 0 && i.push(`Array<${K(n.shape[I])}>`), n.shape[k] !== void 0 && i.push(`Record<string, ${K(n.shape[k])}>`);
743
743
  for (const [s, o] of Object.entries(n.shape))
744
- s !== I && s !== F && i.push(s);
744
+ s !== I && s !== k && i.push(s);
745
745
  }
746
746
  if (t = n.mask, (t & d.HAS_FORMAT) !== 0) {
747
747
  const s = xt(t);
@@ -770,8 +770,8 @@ function q(e, t, n) {
770
770
  `Validation error at ${e}: expected ${K(t)}, got ${typeof n == "object" ? n === null ? "null" : Array.isArray(n) ? "array" : "object" : typeof n}`
771
771
  );
772
772
  }
773
- const ie = Array.isArray;
774
- function Nt(e) {
773
+ const re = Array.isArray;
774
+ function Dt(e) {
775
775
  if (e === null) return d.NULL;
776
776
  switch (typeof e) {
777
777
  case "number":
@@ -783,18 +783,18 @@ function Nt(e) {
783
783
  case "undefined":
784
784
  return d.UNDEFINED;
785
785
  case "object":
786
- return ie(e) ? d.ARRAY : d.OBJECT;
786
+ return re(e) ? d.ARRAY : d.OBJECT;
787
787
  default:
788
788
  throw new Error(`Invalid type: ${typeof e}`);
789
789
  }
790
790
  }
791
- function Tn(e) {
791
+ function Ln(e) {
792
792
  return P(e);
793
793
  }
794
794
  function P(e) {
795
795
  if (e === null || typeof e != "object")
796
796
  return e;
797
- if (ie(e))
797
+ if (re(e))
798
798
  return e.map((n) => P(n));
799
799
  if (e instanceof Date)
800
800
  return new Date(e.getTime());
@@ -815,12 +815,12 @@ function P(e) {
815
815
  t[n] = P(e[n]);
816
816
  return t;
817
817
  }
818
- const vt = Object.entries, rn = () => {
818
+ const _t = Object.entries, an = () => {
819
819
  };
820
820
  class ot {
821
821
  queryClient = void 0;
822
822
  preloadedEntities = void 0;
823
- warn = rn;
823
+ warn = an;
824
824
  /** When true, missing optional fields on existing entities are set to
825
825
  * undefined. False for mutation events (truly partial payloads). */
826
826
  isPartialEvent = !1;
@@ -830,14 +830,14 @@ class ot {
830
830
  this.queryClient = t, this.preloadedEntities = n, this.warn = i, this.isPartialEvent = r, t !== void 0 && (this.seen === void 0 ? (this.seen = /* @__PURE__ */ new Map(), this.seenByKey = /* @__PURE__ */ new Map()) : (this.seen.clear(), this.seenByKey.clear()));
831
831
  }
832
832
  }
833
- function re(e, t, n) {
834
- return M(e, t, n, "");
833
+ function se(e, t, n) {
834
+ return F(e, t, n, "");
835
835
  }
836
- function sn(e, t, n) {
837
- return _t(e, t, n);
836
+ function cn(e, t, n) {
837
+ return wt(e, t, n);
838
838
  }
839
- function Dt(e, t, n, i) {
840
- const r = e >> mt;
839
+ function It(e, t, n, i) {
840
+ const r = e >> vt;
841
841
  if ((e & d.IS_EAGER_FORMAT) !== 0)
842
842
  try {
843
843
  return new Q(t, r, !0);
@@ -854,7 +854,7 @@ function Dt(e, t, n, i) {
854
854
  }
855
855
  return new Q(t, r, !1);
856
856
  }
857
- function M(e, t, n, i) {
857
+ function F(e, t, n, i) {
858
858
  const r = t;
859
859
  if (r instanceof $) {
860
860
  const c = r.get(e);
@@ -871,7 +871,7 @@ function M(e, t, n, i) {
871
871
  return e;
872
872
  }
873
873
  if (typeof r == "number") {
874
- const c = Nt(e);
874
+ const c = Dt(e);
875
875
  if ((r & c) === 0) {
876
876
  if ((r & d.UNDEFINED) !== 0) {
877
877
  n.warn("Invalid value for optional type, defaulting to undefined", { value: e, path: i });
@@ -879,18 +879,18 @@ function M(e, t, n, i) {
879
879
  }
880
880
  throw q(i, r, e);
881
881
  }
882
- return (r & d.HAS_FORMAT) !== 0 && e !== null && e !== void 0 ? Dt(r, e, n, i) : e;
882
+ return (r & d.HAS_FORMAT) !== 0 && e !== null && e !== void 0 ? It(r, e, n, i) : e;
883
883
  }
884
884
  const s = r.mask, o = r._liveConfig;
885
885
  if (o !== void 0 && o.type === dt.Value)
886
- return o.valueType !== void 0 ? M(e, o.valueType, n, i) : e;
886
+ return o.valueType !== void 0 ? F(e, o.valueType, n, i) : e;
887
887
  if ((s & d.PARSE_RESULT) !== 0)
888
888
  try {
889
- return { success: !0, value: M(e, r.shape, n, i) };
889
+ return { success: !0, value: F(e, r.shape, n, i) };
890
890
  } catch (c) {
891
891
  return { success: !1, error: c instanceof Error ? c : new Error(String(c)) };
892
892
  }
893
- const a = Nt(e);
893
+ const a = Dt(e);
894
894
  if ((s & a) === 0 && !r.values?.has(e)) {
895
895
  if ((s & d.UNDEFINED) !== 0) {
896
896
  n.warn("Invalid value for optional type, defaulting to undefined", { value: e, path: i });
@@ -898,33 +898,33 @@ function M(e, t, n, i) {
898
898
  }
899
899
  throw q(i, s, e);
900
900
  }
901
- return a < d.OBJECT ? (s & d.HAS_FORMAT) !== 0 && e !== null && e !== void 0 ? Dt(s, e, n, i) : e : (s & d.UNION) !== 0 ? on(a, e, r, n, i) : a === d.ARRAY ? se(e, r.shape, n, i) : (s & d.RECORD) !== 0 ? oe(e, r.shape, n, i) : (s & d.ENTITY) !== 0 && n.queryClient !== void 0 ? _t(e, r, n) : ae(e, r, n, i);
901
+ return a < d.OBJECT ? (s & d.HAS_FORMAT) !== 0 && e !== null && e !== void 0 ? It(s, e, n, i) : e : (s & d.UNION) !== 0 ? fn(a, e, r, n, i) : a === d.ARRAY ? oe(e, r.shape, n, i) : (s & d.RECORD) !== 0 ? ae(e, r.shape, n, i) : (s & d.ENTITY) !== 0 && n.queryClient !== void 0 ? wt(e, r, n) : ce(e, r, n, i);
902
902
  }
903
- function on(e, t, n, i, r) {
903
+ function fn(e, t, n, i, r) {
904
904
  if (e === d.ARRAY) {
905
905
  const s = n.shape[I];
906
- return s === void 0 || typeof s == "number" ? t : se(t, s, i, r);
906
+ return s === void 0 || typeof s == "number" ? t : oe(t, s, i, r);
907
907
  } else {
908
908
  const s = n.typenameField, o = s ? t[s] : void 0;
909
909
  if (o === void 0 || typeof o != "string") {
910
- const c = n.shape[F];
910
+ const c = n.shape[k];
911
911
  if (c === void 0)
912
912
  throw new Error(
913
913
  `Typename field '${s}' is required for union discrimination but was not found in the data`
914
914
  );
915
- return oe(t, c, i, r);
915
+ return ae(t, c, i, r);
916
916
  }
917
917
  const a = n.shape[o];
918
918
  if (a === void 0 || typeof a == "number")
919
919
  throw new Error(`Unknown typename '${o}' in union`);
920
- return a.mask & d.ENTITY && i.queryClient !== void 0 ? _t(t, a, i) : ae(t, a, i, r);
920
+ return a.mask & d.ENTITY && i.queryClient !== void 0 ? wt(t, a, i) : ce(t, a, i, r);
921
921
  }
922
922
  }
923
- function se(e, t, n, i) {
923
+ function oe(e, t, n, i) {
924
924
  const r = [];
925
925
  for (let s = 0; s < e.length; s++)
926
926
  try {
927
- r.push(M(e[s], t, n, `${i}[${s}]`));
927
+ r.push(F(e[s], t, n, `${i}[${s}]`));
928
928
  } catch (o) {
929
929
  n.warn("Failed to parse array item, filtering out", {
930
930
  index: s,
@@ -934,20 +934,20 @@ function se(e, t, n, i) {
934
934
  }
935
935
  return r;
936
936
  }
937
- function oe(e, t, n, i) {
938
- for (const [r, s] of vt(e))
939
- e[r] = M(s, t, n, `${i}["${r}"]`);
937
+ function ae(e, t, n, i) {
938
+ for (const [r, s] of _t(e))
939
+ e[r] = F(s, t, n, `${i}["${r}"]`);
940
940
  return e;
941
941
  }
942
- function ae(e, t, n, i) {
942
+ function ce(e, t, n, i) {
943
943
  if (S.has(e))
944
944
  return e;
945
945
  const r = t.shape;
946
- for (const [s, o] of vt(r))
947
- e[s] = M(e[s], o, n, `${i}.${s}`);
946
+ for (const [s, o] of _t(r))
947
+ e[s] = F(e[s], o, n, `${i}.${s}`);
948
948
  return e;
949
949
  }
950
- function _t(e, t, n) {
950
+ function wt(e, t, n) {
951
951
  const i = n.queryClient, r = n.preloadedEntities;
952
952
  let s, o;
953
953
  if (r !== void 0)
@@ -977,14 +977,14 @@ function _t(e, t, n) {
977
977
  };
978
978
  n.seen.set(c, u), n.seenByKey.set(s, u);
979
979
  const l = `[[${t.typenameValue}:${o}]]`, g = t.shape;
980
- for (const [p, w] of vt(g))
981
- h && !(p in e) || (c[p] = M(e[p], w, n, `${l}.${p}`));
980
+ for (const [p, w] of _t(g))
981
+ h && !(p in e) || (c[p] = F(e[p], w, n, `${l}.${p}`));
982
982
  return c;
983
983
  }
984
- function an(e, t) {
985
- return cn(e, t.shape, t.typenameField);
984
+ function un(e, t) {
985
+ return dn(e, t.shape, t.typenameField);
986
986
  }
987
- function cn(e, t, n) {
987
+ function dn(e, t, n) {
988
988
  if (t === void 0) return !0;
989
989
  for (const i of Object.keys(t)) {
990
990
  if (i === n) continue;
@@ -999,27 +999,27 @@ function cn(e, t, n) {
999
999
  }
1000
1000
  return !0;
1001
1001
  }
1002
- const fn = Object.prototype, H = /* @__PURE__ */ new WeakMap();
1003
- function A(e) {
1002
+ const hn = Object.prototype, H = /* @__PURE__ */ new WeakMap();
1003
+ function x(e) {
1004
1004
  if (typeof e != "object" || e === null) return e;
1005
- if (Z.has(e)) return A(e.getValue());
1005
+ if (Z.has(e)) return x(e.getValue());
1006
1006
  if (S.has(e)) return e;
1007
1007
  if (Array.isArray(e)) {
1008
1008
  let t = H.get(e);
1009
- return t === void 0 && (t = new Proxy(e, un), H.set(e, t)), t;
1009
+ return t === void 0 && (t = new Proxy(e, ln), H.set(e, t)), t;
1010
1010
  }
1011
- if (Object.getPrototypeOf(e) === fn) {
1011
+ if (Object.getPrototypeOf(e) === hn) {
1012
1012
  let t = H.get(e);
1013
- return t === void 0 && (t = new Proxy(e, dn), H.set(e, t)), t;
1013
+ return t === void 0 && (t = new Proxy(e, yn), H.set(e, t)), t;
1014
1014
  }
1015
1015
  return e;
1016
1016
  }
1017
- const un = {
1017
+ const ln = {
1018
1018
  get(e, t, n) {
1019
1019
  if (typeof t == "string") {
1020
1020
  const i = Number(t);
1021
1021
  if (Number.isInteger(i) && i >= 0 && i < e.length)
1022
- return A(e[i]);
1022
+ return x(e[i]);
1023
1023
  }
1024
1024
  return Reflect.get(e, t, n);
1025
1025
  },
@@ -1029,9 +1029,9 @@ const un = {
1029
1029
  deleteProperty() {
1030
1030
  throw new Error("Cannot mutate a read-only array");
1031
1031
  }
1032
- }, dn = {
1032
+ }, yn = {
1033
1033
  get(e, t, n) {
1034
- return typeof t == "string" ? A(e[t]) : Reflect.get(e, t, n);
1034
+ return typeof t == "string" ? x(e[t]) : Reflect.get(e, t, n);
1035
1035
  },
1036
1036
  set() {
1037
1037
  throw new Error("Cannot mutate a read-only object");
@@ -1048,8 +1048,23 @@ const un = {
1048
1048
  getOwnPropertyDescriptor(e, t) {
1049
1049
  return Object.getOwnPropertyDescriptor(e, t);
1050
1050
  }
1051
- };
1052
- class hn {
1051
+ }, pn = (e, t, n) => {
1052
+ const i = e, r = Object.keys(i), s = t !== null && typeof t == "object" && !Array.isArray(t) ? t : void 0;
1053
+ let o = !s || Object.keys(s).length !== r.length;
1054
+ const a = {};
1055
+ for (let c = 0; c < r.length; c++) {
1056
+ const f = r[c], h = i[f];
1057
+ let u;
1058
+ typeof h == "function" ? u = h : u = n(h, s?.[f]), a[f] = u, !o && u !== s?.[f] && (o = !0);
1059
+ }
1060
+ return o ? a : s;
1061
+ }, kt = /* @__PURE__ */ new WeakSet();
1062
+ function fe(e) {
1063
+ const t = e.prototype;
1064
+ kt.has(t) || (kt.add(t), Ie(e, pn));
1065
+ }
1066
+ fe(yt);
1067
+ class gn {
1053
1068
  _notifier;
1054
1069
  _queryClient;
1055
1070
  _proxies = /* @__PURE__ */ new Map();
@@ -1113,13 +1128,13 @@ class hn {
1113
1128
  getProxy(t) {
1114
1129
  const n = t;
1115
1130
  let i = this._proxies.get(n);
1116
- return i === void 0 && (i = yn(this, this.key, t, this._notifier, this._queryClient), this._proxies.set(n, i)), i;
1131
+ return i === void 0 && (i = vn(this, this.key, t, this._notifier, this._queryClient), this._proxies.set(n, i)), i;
1117
1132
  }
1118
1133
  get proxy() {
1119
1134
  return this._proxies.values().next().value;
1120
1135
  }
1121
1136
  satisfiesDef(t) {
1122
- return this.satisfiedDefs.has(t) ? !0 : an(this.data, t) ? (this.satisfiedDefs.add(t), !0) : !1;
1137
+ return this.satisfiedDefs.has(t) ? !0 : un(this.data, t) ? (this.satisfiedDefs.add(t), !0) : !1;
1123
1138
  }
1124
1139
  save() {
1125
1140
  this._queryClient.entityMap.save(this);
@@ -1131,7 +1146,7 @@ class hn {
1131
1146
  this._notifier.consume();
1132
1147
  }
1133
1148
  }
1134
- function ln(e, t, n) {
1149
+ function mn(e, t, n) {
1135
1150
  const i = [];
1136
1151
  for (const r of e) {
1137
1152
  if (typeof r != "object" || r === null) continue;
@@ -1142,10 +1157,12 @@ function ln(e, t, n) {
1142
1157
  }
1143
1158
  return i;
1144
1159
  }
1145
- function yn(e, t, n, i, r) {
1146
- const s = n.shape ?? {}, o = n, a = o._methods, c = o._entityClass, f = o._entityConfig, h = c ? c.prototype : Qt.prototype, u = n.typenameField, l = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), p = () => ({ __entityRef: t });
1160
+ function vn(e, t, n, i, r) {
1161
+ const s = n.shape ?? {}, o = n, a = o._methods, c = o._entityClass, f = o._entityConfig, h = c ? c.prototype : yt.prototype;
1162
+ c !== void 0 && fe(c);
1163
+ const u = n.typenameField, l = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), p = () => ({ __entityRef: t });
1147
1164
  let w;
1148
- f?.hasSubscribe && a && "__subscribe" in a && (w = Pt((E) => {
1165
+ f?.hasSubscribe && a && "__subscribe" in a && (w = $t((E) => {
1149
1166
  const y = (b) => {
1150
1167
  b.__eventSource = t, r.applyMutationEvent(b);
1151
1168
  }, _ = a.__subscribe.call(v, y);
@@ -1158,11 +1175,11 @@ function yn(e, t, n, i, r) {
1158
1175
  if (O.includes("__typename") || O.push("__typename"), a)
1159
1176
  for (const E of Object.keys(a))
1160
1177
  O.includes(E) || O.push(E);
1161
- let k, R = O;
1178
+ let M, R = O;
1162
1179
  function L() {
1163
1180
  const E = e._extraMethods;
1164
- if (E !== k) {
1165
- if (k = E, R = O.slice(), E !== void 0)
1181
+ if (E !== M) {
1182
+ if (M = E, R = O.slice(), E !== void 0)
1166
1183
  for (const _ of Object.keys(E))
1167
1184
  R.includes(_) || R.push(_);
1168
1185
  const y = e._extraGetters;
@@ -1185,40 +1202,40 @@ function yn(e, t, n, i, r) {
1185
1202
  const b = e._extraGetters;
1186
1203
  if (b !== void 0 && y in b)
1187
1204
  return b[y]();
1188
- const x = e._extraMethods;
1189
- if (x !== void 0 && y in x) {
1205
+ const A = e._extraMethods;
1206
+ if (A !== void 0 && y in A) {
1190
1207
  let C = l.get(y);
1191
- return C || (C = x[y].bind(v), l.set(y, C)), C;
1208
+ return C || (C = A[y].bind(v), l.set(y, C)), C;
1192
1209
  }
1193
1210
  if (a && y in a) {
1194
1211
  let C = l.get(y);
1195
- return C || (C = be(v, a[y].bind(v)), l.set(y, C)), C;
1212
+ return C || (C = Se(v, a[y].bind(v)), l.set(y, C)), C;
1196
1213
  }
1197
1214
  }
1198
1215
  const _ = e.data[y];
1199
1216
  if (typeof _ == "object" && _ !== null && Z.has(_))
1200
- return A(_.getValue());
1217
+ return x(_.getValue());
1201
1218
  if (Array.isArray(_) && typeof y == "string") {
1202
1219
  const b = s[y];
1203
1220
  if (b instanceof m && (b.mask & d.ARRAY) !== 0) {
1204
- const x = b.shape;
1205
- if (x instanceof m && (x.mask & d.ENTITY) !== 0) {
1206
- const C = x.typenameValue;
1221
+ const A = b.shape;
1222
+ if (A instanceof m && (A.mask & d.ENTITY) !== 0) {
1223
+ const C = A.typenameValue;
1207
1224
  if (C !== void 0) {
1208
- const bt = r.getEntityDefsForTypename(C);
1209
- if (bt !== void 0 && bt.length > 1) {
1225
+ const Ct = r.getEntityDefsForTypename(C);
1226
+ if (Ct !== void 0 && Ct.length > 1) {
1210
1227
  const tt = g.get(y);
1211
1228
  if (tt !== void 0 && tt.source === _)
1212
- return A(tt.filtered);
1213
- const Ct = ln(_, x, r);
1214
- return g.set(y, { source: _, filtered: Ct }), A(Ct);
1229
+ return x(tt.filtered);
1230
+ const St = mn(_, A, r);
1231
+ return g.set(y, { source: _, filtered: St }), x(St);
1215
1232
  }
1216
1233
  }
1217
1234
  }
1218
1235
  }
1219
- return A(_);
1236
+ return x(_);
1220
1237
  }
1221
- return A(_);
1238
+ return x(_);
1222
1239
  },
1223
1240
  set() {
1224
1241
  throw new Error("Entity properties are read-only");
@@ -1253,9 +1270,9 @@ function yn(e, t, n, i, r) {
1253
1270
  }
1254
1271
  }
1255
1272
  };
1256
- return v = new Proxy({}, U), S.set(v, t), Ee(v, r), v;
1273
+ return v = new Proxy({}, U), S.set(v, t), Ce(v, r), v;
1257
1274
  }
1258
- class pn {
1275
+ class _n {
1259
1276
  instances = /* @__PURE__ */ new Map();
1260
1277
  persistEntity;
1261
1278
  constructor(t) {
@@ -1277,7 +1294,7 @@ class pn {
1277
1294
  if (typeof a != "string" && typeof a != "number")
1278
1295
  throw new Error(`Entity id must be string or number: ${i.typenameValue}`);
1279
1296
  const c = i;
1280
- s = new hn(t, i.typenameValue, a, o, n, r), s._entityCache = c._entityCache, this.instances.set(t, s);
1297
+ s = new gn(t, i.typenameValue, a, o, n, r), s._entityCache = c._entityCache, this.instances.set(t, s);
1281
1298
  }
1282
1299
  return s.parseId = r.currentParseId, s;
1283
1300
  }
@@ -1293,13 +1310,13 @@ class pn {
1293
1310
  this.persistEntity(t.key, t.data, n);
1294
1311
  }
1295
1312
  }
1296
- class ce {
1313
+ class ue {
1297
1314
  onlineSignal;
1298
1315
  manualOverride = void 0;
1299
1316
  eventListenersAttached = !1;
1300
1317
  constructor(t) {
1301
1318
  const n = t ?? this.detectOnlineStatus();
1302
- this.onlineSignal = jt(n), this.canAttachListeners() && this.attachEventListeners();
1319
+ this.onlineSignal = Lt(n), this.canAttachListeners() && this.attachEventListeners();
1303
1320
  }
1304
1321
  /**
1305
1322
  * Returns true if the network is currently online
@@ -1357,8 +1374,8 @@ class ce {
1357
1374
  }, window.addEventListener("online", this.handleOnline), window.addEventListener("offline", this.handleOffline), this.eventListenersAttached = !0);
1358
1375
  }
1359
1376
  }
1360
- class fe {
1361
- static onlineSignal = jt(!0);
1377
+ class de {
1378
+ static onlineSignal = Lt(!0);
1362
1379
  get isOnline() {
1363
1380
  return !0;
1364
1381
  }
@@ -1367,19 +1384,19 @@ class fe {
1367
1384
  clearManualOverride() {
1368
1385
  }
1369
1386
  getOnlineSignal() {
1370
- return fe.onlineSignal;
1387
+ return de.onlineSignal;
1371
1388
  }
1372
1389
  destroy() {
1373
1390
  }
1374
1391
  }
1375
- const gn = new ce(), Pn = $t(gn);
1376
- function wt(e, t = typeof window > "u") {
1392
+ const wn = new ue(), Un = Ut(wn);
1393
+ function Et(e, t = typeof window > "u") {
1377
1394
  let n;
1378
1395
  e === !1 ? n = 0 : e === void 0 || e === !0 ? n = t ? 0 : 3 : typeof e == "number" ? n = e : n = e.retries;
1379
1396
  const i = typeof e == "object" && e.retryDelay ? e.retryDelay : (r) => 1e3 * Math.pow(2, r);
1380
1397
  return { retries: n, retryDelay: i };
1381
1398
  }
1382
- class jn {
1399
+ class qn {
1383
1400
  static cache;
1384
1401
  /**
1385
1402
  * The adapter class responsible for sending requests for this query type.
@@ -1389,10 +1406,10 @@ class jn {
1389
1406
  params;
1390
1407
  config;
1391
1408
  constructor() {
1392
- return Bt(this);
1409
+ return Yt(this);
1393
1410
  }
1394
1411
  }
1395
- const It = /* @__PURE__ */ new WeakMap();
1412
+ const Ft = /* @__PURE__ */ new WeakMap();
1396
1413
  class G {
1397
1414
  constructor(t, n) {
1398
1415
  this.captured = n, this.statics = t;
@@ -1402,14 +1419,14 @@ class G {
1402
1419
  return it(this.captured, t, n);
1403
1420
  }
1404
1421
  resolveOptions(t) {
1405
- const { methods: n } = this.captured, i = n.getConfig ? n.getConfig.call(t) : t.config, r = wt(i?.retry);
1422
+ const { methods: n } = this.captured, i = n.getConfig ? n.getConfig.call(t) : t.config, r = Et(i?.retry);
1406
1423
  return { config: i, retryConfig: r };
1407
1424
  }
1408
1425
  static for(t) {
1409
- let n = It.get(t);
1426
+ let n = Ft.get(t);
1410
1427
  if (n !== void 0)
1411
1428
  return n;
1412
- const i = new t(), r = Pe(i), s = String(r.methods.getIdentityKey.call(r.fields)), o = r.fields.result, a = o instanceof m ? o : nn.object(o), c = (a.mask & d.ENTITY) !== 0, f = t.cache, h = r.fields.fetchNext, u = t.adapter;
1429
+ const i = new t(), r = Le(i), s = String(r.methods.getIdentityKey.call(r.fields)), o = r.fields.result, a = o instanceof m ? o : on.object(o), c = (a.mask & d.ENTITY) !== 0, f = t.cache, h = r.fields.fetchNext, u = t.adapter;
1413
1430
  if (!u)
1414
1431
  throw new Error(
1415
1432
  `Query class "${t.name}" must define a static \`adapter\` property. Extend RESTQuery (from fetchium/rest) or set \`static adapter = MyAdapter\` on your query class.`
@@ -1421,21 +1438,21 @@ class G {
1421
1438
  void 0,
1422
1439
  s,
1423
1440
  // typenameValue — unique per query class
1424
- Ut
1441
+ Vt
1425
1442
  // idField — symbol, injected onto payload before parse
1426
1443
  );
1427
1444
  return n = new G(
1428
1445
  { id: s, shape: g, cache: f, rawFetchNext: h, hasSendNext: l, isEntityResult: c, adapterClass: u },
1429
1446
  r
1430
- ), It.set(t, n), n;
1447
+ ), Ft.set(t, n), n;
1431
1448
  }
1432
1449
  }
1433
- const $n = (e, t) => {
1450
+ const Vn = (e, t) => {
1434
1451
  const n = G.for(e);
1435
- return Et(n, t);
1452
+ return bt(n, t);
1436
1453
  };
1437
- function Ln(e, ...t) {
1438
- const n = G.for(e), i = Ce(Nn);
1454
+ function Kn(e, ...t) {
1455
+ const n = G.for(e), i = Oe(Fn);
1439
1456
  if (i === void 0)
1440
1457
  throw new Error("QueryClient not found");
1441
1458
  const r = t[0];
@@ -1448,7 +1465,7 @@ function at(e) {
1448
1465
  const t = new Error("The operation was aborted");
1449
1466
  return t.name = "AbortError", t;
1450
1467
  }
1451
- function ue(e, t) {
1468
+ function he(e, t) {
1452
1469
  return new Promise((n, i) => {
1453
1470
  if (t?.aborted) {
1454
1471
  i(at(t));
@@ -1476,12 +1493,12 @@ async function ct(e, t, n) {
1476
1493
  return await e();
1477
1494
  } catch (o) {
1478
1495
  if (r = o, s >= i) throw o;
1479
- await ue(t.retryDelay(s), n);
1496
+ await he(t.retryDelay(s), n);
1480
1497
  }
1481
1498
  }
1482
1499
  throw r;
1483
1500
  }
1484
- class mn {
1501
+ class En {
1485
1502
  def;
1486
1503
  queryKey;
1487
1504
  storageKey = -1;
@@ -1493,12 +1510,13 @@ class mn {
1493
1510
  params = void 0;
1494
1511
  unsubscribe = void 0;
1495
1512
  _relayState = void 0;
1513
+ _isActive = !1;
1496
1514
  wasPaused = !1;
1497
1515
  currentParams = void 0;
1498
1516
  debounceTimer = void 0;
1499
1517
  /** Resolved per-instance options (depend on actual params). */
1500
1518
  config = void 0;
1501
- retryConfig = wt(void 0);
1519
+ retryConfig = Et(void 0);
1502
1520
  /** Cancels in-flight fetches and retry waits. */
1503
1521
  _abortController = void 0;
1504
1522
  /** Cached execution context, recreated only when storageKey (params) changes. */
@@ -1521,13 +1539,13 @@ class mn {
1521
1539
  }
1522
1540
  constructor(t, n, i, r) {
1523
1541
  this.def = t, this.queryClient = n, this.queryKey = i, this.params = r, this._extraMethods = { __refetch: this.refetch }, t.statics.hasSendNext && (this._extraMethods.__fetchNext = this.fetchNext);
1524
- const s = Tt(r);
1525
- this._queryId = s !== void 0 ? N(s) : 0, this.relay = Pt(
1542
+ const s = jt(r);
1543
+ this._queryId = s !== void 0 ? N(s) : 0, this.relay = $t(
1526
1544
  (o) => {
1527
1545
  this._relayState = o;
1528
1546
  const a = () => {
1529
- clearTimeout(this.debounceTimer), this.debounceTimer = void 0, this._abortController?.abort(), this._abortController = void 0, this._fetchNextAbort?.abort(), this._fetchNextAbort = void 0, this._fetchNextPromise = void 0, this.unsubscribe?.(), this.unsubscribe = void 0;
1530
- const f = this.config?.gcTime ?? Lt;
1547
+ this._isActive = !1, clearTimeout(this.debounceTimer), this.debounceTimer = void 0, this._abortController?.abort(), this._abortController = void 0, this._fetchNextAbort?.abort(), this._fetchNextAbort = void 0, this._fetchNextPromise = void 0, this.unsubscribe?.(), this.unsubscribe = void 0;
1548
+ const f = this.config?.gcTime ?? qt;
1531
1549
  this.queryClient.gcManager.schedule(this.queryKey, f, X.Query);
1532
1550
  }, c = (f = !1) => {
1533
1551
  const { wasPaused: h, isPaused: u, initialized: l } = this;
@@ -1535,7 +1553,8 @@ class mn {
1535
1553
  a();
1536
1554
  return;
1537
1555
  }
1538
- const g = Tt(this.params), p = Et(this.def, g), w = p !== this.storageKey;
1556
+ this._isActive = !0;
1557
+ const g = jt(this.params), p = bt(this.def, g), w = p !== this.storageKey;
1539
1558
  w && (this.currentParams = g, this.storageKey = p), this.getOrCreateExecutionContext(), this.initialized ? h || f ? (this.queryClient.activateQuery(this), f && this.updatedAt !== void 0 && this.setupSubscription(), this.relayState.isPending && this._abortController === void 0 ? this.runQueryImmediately() : (this.config?.refreshStaleOnReconnect ?? !0) && this.isStale && this.runDebounced()) : w && (this.setupSubscription(), this.runDebounced()) : (this.queryClient.activateQuery(this), this.initialize());
1540
1559
  };
1541
1560
  return c(!0), {
@@ -1585,7 +1604,7 @@ class mn {
1585
1604
  if (!this.isPaused)
1586
1605
  try {
1587
1606
  if (i !== void 0 && this.setupSubscription(), i === void 0 || this.isStale) {
1588
- if (await ue(0), this.isPaused) return;
1607
+ if (await he(0), this.isPaused) return;
1589
1608
  this.runQueryImmediately();
1590
1609
  }
1591
1610
  } catch (r) {
@@ -1642,7 +1661,7 @@ class mn {
1642
1661
  // ======================================================
1643
1662
  refetch = () => this.relayState.isPending ? this.relay : (this.runQueryImmediately(), this.relay);
1644
1663
  markStale() {
1645
- this.updatedAt = 0;
1664
+ this.updatedAt = 0, this._isActive && !this.isPaused && this.runDebounced();
1646
1665
  }
1647
1666
  get resolvedParams() {
1648
1667
  return this.currentParams;
@@ -1707,7 +1726,7 @@ class mn {
1707
1726
  }
1708
1727
  }
1709
1728
  }
1710
- class vn {
1729
+ class bn {
1711
1730
  def;
1712
1731
  queryClient;
1713
1732
  _inFlight = !1;
@@ -1716,7 +1735,7 @@ class vn {
1716
1735
  this.def = t, this.queryClient = n, this.task = this.createTask();
1717
1736
  }
1718
1737
  createTask() {
1719
- return Se(
1738
+ return Re(
1720
1739
  async (t) => {
1721
1740
  if (this._inFlight)
1722
1741
  throw new Error("A mutation is already in progress. Await the previous call before starting a new one.");
@@ -1737,7 +1756,7 @@ class vn {
1737
1756
  return t;
1738
1757
  const i = this.queryClient.getContext().log?.warn ?? (() => {
1739
1758
  }), r = new ot();
1740
- return r.reset(void 0, void 0, i), re(t, n, r);
1759
+ return r.reset(void 0, void 0, i), se(t, n, r);
1741
1760
  }
1742
1761
  // ======================================================
1743
1762
  // Effects processing
@@ -1763,7 +1782,7 @@ class vn {
1763
1782
  // Retry logic
1764
1783
  // ======================================================
1765
1784
  executeWithRetry(t) {
1766
- const n = wt(this.def.config?.retry, !0), i = this.queryClient.getAdapter(this.def.adapterClass);
1785
+ const n = Et(this.def.config?.retry, !0), i = this.queryClient.getAdapter(this.def.adapterClass);
1767
1786
  if (!i.sendMutation)
1768
1787
  throw new Error(
1769
1788
  `Adapter "${this.def.adapterClass.name}" does not implement sendMutation(). Add a sendMutation() method to handle mutations.`
@@ -1778,24 +1797,24 @@ class vn {
1778
1797
  }, n);
1779
1798
  }
1780
1799
  }
1781
- function _n(e) {
1800
+ function Cn(e) {
1782
1801
  return typeof e == "string" ? e : j(e).typenameValue;
1783
1802
  }
1784
1803
  function et(e, t, n) {
1785
1804
  if (e)
1786
1805
  for (const [i, r] of e) {
1787
- const s = _n(i);
1806
+ const s = Cn(i);
1788
1807
  s !== void 0 && n.applyMutationEvent({ type: t, typename: s, data: r });
1789
1808
  }
1790
1809
  }
1791
- const de = "__eventSource";
1792
- function he(e) {
1810
+ const le = "__eventSource";
1811
+ function ye(e) {
1793
1812
  return { field: e, segments: e.indexOf(".") !== -1 ? e.split(".") : void 0 };
1794
1813
  }
1795
- function wn(e) {
1796
- return e.map(he);
1814
+ function Sn(e) {
1815
+ return e.map(ye);
1797
1816
  }
1798
- function En(e, t) {
1817
+ function On(e, t) {
1799
1818
  if (t.segments === void 0) return e[t.field];
1800
1819
  let n = e;
1801
1820
  for (const i of t.segments) {
@@ -1804,16 +1823,16 @@ function En(e, t) {
1804
1823
  }
1805
1824
  return n;
1806
1825
  }
1807
- function le(e, t) {
1826
+ function pe(e, t) {
1808
1827
  const n = [];
1809
1828
  for (let i = 0; i < t.length; i++) {
1810
- const r = t[i], s = En(e, r);
1829
+ const r = t[i], s = On(e, r);
1811
1830
  if (s === void 0) return;
1812
1831
  n.push(r.field, s);
1813
1832
  }
1814
1833
  return N(n);
1815
1834
  }
1816
- function bn(e, t) {
1835
+ function Rn(e, t) {
1817
1836
  if (e === void 0) return;
1818
1837
  const n = /* @__PURE__ */ new Map();
1819
1838
  for (const [i, r] of e) {
@@ -1821,8 +1840,8 @@ function bn(e, t) {
1821
1840
  let a = !0;
1822
1841
  for (const [c, f] of s) {
1823
1842
  let h;
1824
- if (Vt(f)) {
1825
- const u = Kt(f);
1843
+ if (Bt(f)) {
1844
+ const u = Qt(f);
1826
1845
  h = lt(u, t);
1827
1846
  } else
1828
1847
  h = f;
@@ -1836,17 +1855,17 @@ function bn(e, t) {
1836
1855
  }
1837
1856
  return n.size > 0 ? n : void 0;
1838
1857
  }
1839
- function Ft(e, t) {
1858
+ function Mt(e, t) {
1840
1859
  const n = e.get(t);
1841
1860
  if (n !== void 0)
1842
1861
  return n.map(([i]) => i).sort();
1843
1862
  }
1844
- class Cn {
1863
+ class An {
1845
1864
  fields;
1846
1865
  fieldPaths;
1847
1866
  _bindings = /* @__PURE__ */ new Map();
1848
1867
  constructor(t) {
1849
- this.fields = t, this.fieldPaths = t.map(he);
1868
+ this.fields = t, this.fieldPaths = t.map(ye);
1850
1869
  }
1851
1870
  register(t, n) {
1852
1871
  let i = this._bindings.get(t);
@@ -1863,38 +1882,38 @@ class Cn {
1863
1882
  return this._bindings.size === 0;
1864
1883
  }
1865
1884
  }
1866
- function Mt(e) {
1885
+ function Tt(e) {
1867
1886
  return N(e);
1868
1887
  }
1869
- class Sn {
1888
+ class xn {
1870
1889
  _groups = /* @__PURE__ */ new Map();
1871
1890
  getOrCreateGroup(t) {
1872
- const n = Mt(t);
1891
+ const n = Tt(t);
1873
1892
  let i = this._groups.get(n);
1874
- return i === void 0 && (i = new Cn(t), this._groups.set(n, i)), i;
1893
+ return i === void 0 && (i = new An(t), this._groups.set(n, i)), i;
1875
1894
  }
1876
1895
  register(t, n, i) {
1877
1896
  this.getOrCreateGroup(n).register(t, i);
1878
1897
  }
1879
1898
  unregister(t, n, i) {
1880
- const r = Mt(n), s = this._groups.get(r);
1899
+ const r = Tt(n), s = this._groups.get(r);
1881
1900
  s !== void 0 && (s.unregister(t, i), s.isEmpty && this._groups.delete(r));
1882
1901
  }
1883
1902
  registerBinding(t, n) {
1884
1903
  const i = t._constraintHashes.get(n);
1885
1904
  if (i === void 0) return;
1886
- const r = Ft(t._constraintFieldRefs, n);
1905
+ const r = Mt(t._constraintFieldRefs, n);
1887
1906
  r !== void 0 && this.register(i, r, t);
1888
1907
  }
1889
1908
  unregisterBinding(t, n) {
1890
1909
  const i = t._constraintHashes.get(n);
1891
1910
  if (i === void 0) return;
1892
- const r = Ft(t._constraintFieldRefs, n);
1911
+ const r = Mt(t._constraintFieldRefs, n);
1893
1912
  r !== void 0 && this.unregister(i, r, t);
1894
1913
  }
1895
1914
  routeEvent(t, n, i, r, s, o) {
1896
1915
  for (const a of this._groups.values()) {
1897
- const c = le(n, a.fieldPaths);
1916
+ const c = pe(n, a.fieldPaths);
1898
1917
  if (c === void 0) continue;
1899
1918
  const f = a.getMatching(c);
1900
1919
  if (f !== void 0)
@@ -1903,7 +1922,7 @@ class Sn {
1903
1922
  }
1904
1923
  }
1905
1924
  }
1906
- function kt(e) {
1925
+ function Pt(e) {
1907
1926
  const t = /* @__PURE__ */ new Set();
1908
1927
  for (const n of e)
1909
1928
  if (typeof n == "object" && n !== null) {
@@ -1912,7 +1931,7 @@ function kt(e) {
1912
1931
  }
1913
1932
  return t;
1914
1933
  }
1915
- class ye {
1934
+ class ge {
1916
1935
  _queryClient;
1917
1936
  _parent;
1918
1937
  _constraintHashes;
@@ -1962,7 +1981,7 @@ class ye {
1962
1981
  n !== -1 && t.splice(n, 1);
1963
1982
  }
1964
1983
  }
1965
- class On {
1984
+ class Nn {
1966
1985
  _notifier;
1967
1986
  _items;
1968
1987
  _keys;
@@ -1970,9 +1989,9 @@ class On {
1970
1989
  _queryClient;
1971
1990
  _parent;
1972
1991
  constructor(t, n, i, r, s, o) {
1973
- this._notifier = ut(), this._items = i, this._keys = kt(i), this._queryClient = t, this._parent = n;
1992
+ this._notifier = ut(), this._items = i, this._keys = Pt(i), this._queryClient = t, this._parent = n;
1974
1993
  const a = r !== void 0 && s !== void 0, c = o !== void 0;
1975
- (a || c) && (this._outputSignal = Oe(() => {
1994
+ (a || c) && (this._outputSignal = Ae(() => {
1976
1995
  this._notifier.consume();
1977
1996
  let f = this._items;
1978
1997
  if (a) {
@@ -1992,7 +2011,7 @@ class On {
1992
2011
  h.push(u);
1993
2012
  continue;
1994
2013
  }
1995
- g.consume(), le(g.data, r) === s && h.push(u);
2014
+ g.consume(), pe(g.data, r) === s && h.push(u);
1996
2015
  }
1997
2016
  f = h;
1998
2017
  }
@@ -2037,7 +2056,7 @@ class On {
2037
2056
  }
2038
2057
  reset(t) {
2039
2058
  const n = this._items, i = Array.isArray(t) ? t : [];
2040
- this._items = i, this._keys = kt(i);
2059
+ this._items = i, this._keys = Pt(i);
2041
2060
  for (const r of i)
2042
2061
  if (typeof r == "object" && r !== null) {
2043
2062
  const s = T(r);
@@ -2073,7 +2092,7 @@ class On {
2073
2092
  return -1;
2074
2093
  }
2075
2094
  }
2076
- class Rn {
2095
+ class Dn {
2077
2096
  _notifier;
2078
2097
  _value;
2079
2098
  _createdKeys;
@@ -2114,16 +2133,16 @@ class Rn {
2114
2133
  append(t) {
2115
2134
  }
2116
2135
  }
2117
- function pe(e, t, n, i, r) {
2136
+ function me(e, t, n, i, r) {
2118
2137
  let s = e.constraintFieldRefs;
2119
2138
  if (s === void 0) {
2120
2139
  s = /* @__PURE__ */ new Map();
2121
2140
  for (const f of e.entityDefs) {
2122
2141
  const h = f.typenameValue;
2123
- h !== void 0 && s.set(h, [[de, n.key]]);
2142
+ h !== void 0 && s.set(h, [[le, n.key]]);
2124
2143
  }
2125
2144
  }
2126
- const o = bn(s, i) ?? /* @__PURE__ */ new Map();
2145
+ const o = Rn(s, i) ?? /* @__PURE__ */ new Map();
2127
2146
  let a;
2128
2147
  if (e.type === dt.Array) {
2129
2148
  let f, h;
@@ -2133,11 +2152,11 @@ function pe(e, t, n, i, r) {
2133
2152
  if (l !== void 0) {
2134
2153
  h = l;
2135
2154
  const g = e.constraintFieldRefs.get(u);
2136
- g !== void 0 && (f = wn(g.map(([p]) => p)));
2155
+ g !== void 0 && (f = Sn(g.map(([p]) => p)));
2137
2156
  break;
2138
2157
  }
2139
2158
  }
2140
- a = new On(
2159
+ a = new Nn(
2141
2160
  r,
2142
2161
  n,
2143
2162
  Array.isArray(t) ? t : [],
@@ -2146,7 +2165,7 @@ function pe(e, t, n, i, r) {
2146
2165
  e.sort
2147
2166
  );
2148
2167
  } else
2149
- a = new Rn(
2168
+ a = new Dn(
2150
2169
  r,
2151
2170
  n,
2152
2171
  t,
@@ -2154,7 +2173,7 @@ function pe(e, t, n, i, r) {
2154
2173
  e.onUpdate,
2155
2174
  e.onDelete
2156
2175
  );
2157
- const c = new ye(
2176
+ const c = new ge(
2158
2177
  e.entityDefs,
2159
2178
  s,
2160
2179
  r,
@@ -2164,7 +2183,7 @@ function pe(e, t, n, i, r) {
2164
2183
  );
2165
2184
  return n.liveCollections.push(c), r.registerLiveCollection(c), c;
2166
2185
  }
2167
- const ge = Object.entries, me = Object.prototype;
2186
+ const ve = Object.entries, _e = Object.prototype;
2168
2187
  function nt(e, t, n, i = !1) {
2169
2188
  const r = e.queryClient;
2170
2189
  r.currentParseId++;
@@ -2175,7 +2194,7 @@ function Y(e, t, n, i, r, s) {
2175
2194
  if (typeof e != "object" || e === null) return e;
2176
2195
  const o = t.get(e);
2177
2196
  if (o !== void 0)
2178
- return xn(o, t, n, i, r, s);
2197
+ return In(o, t, n, i, r, s);
2179
2198
  if (Array.isArray(e)) {
2180
2199
  for (let a = 0; a < e.length; a++) {
2181
2200
  const c = e[a];
@@ -2183,7 +2202,7 @@ function Y(e, t, n, i, r, s) {
2183
2202
  }
2184
2203
  return e;
2185
2204
  }
2186
- if (Object.getPrototypeOf(e) === me && !S.has(e)) {
2205
+ if (Object.getPrototypeOf(e) === _e && !S.has(e)) {
2187
2206
  const a = e;
2188
2207
  for (const c of Object.keys(a)) {
2189
2208
  const f = a[c];
@@ -2192,12 +2211,12 @@ function Y(e, t, n, i, r, s) {
2192
2211
  }
2193
2212
  return e;
2194
2213
  }
2195
- function ve(e) {
2214
+ function we(e) {
2196
2215
  return typeof e == "object" && e !== null && !(e instanceof Q) && !S.has(e);
2197
2216
  }
2198
- function xn(e, t, n, i, r, s) {
2217
+ function In(e, t, n, i, r, s) {
2199
2218
  const { key: o, data: a, shape: c, rawKeys: f } = e, h = c.shape, u = n.prepareEntity(o, a, c), l = u.data, g = l !== a, p = g && f !== void 0 && u.entityRefs !== void 0 ? new Map(u.entityRefs) : /* @__PURE__ */ new Map();
2200
- if (g ? (_e(
2219
+ if (g ? (Ee(
2201
2220
  h,
2202
2221
  a,
2203
2222
  l,
@@ -2209,13 +2228,13 @@ function xn(e, t, n, i, r, s) {
2209
2228
  i,
2210
2229
  p,
2211
2230
  s
2212
- ), u.notify()) : we(h, a, u, a, t, n, i, p, s), s && u.liveCollections.length > 0)
2231
+ ), u.notify()) : be(h, a, u, a, t, n, i, p, s), s && u.liveCollections.length > 0)
2213
2232
  for (const v of u.liveCollections) {
2214
2233
  const O = v.instance.getRawValue();
2215
2234
  if (Array.isArray(O))
2216
- for (const k of O) {
2217
- if (typeof k != "object" || k === null) continue;
2218
- const R = S.get(k);
2235
+ for (const M of O) {
2236
+ if (typeof M != "object" || M === null) continue;
2237
+ const R = S.get(M);
2219
2238
  if (R === void 0) continue;
2220
2239
  const L = n.entityMap.getEntity(R);
2221
2240
  L !== void 0 && p.set(L, (p.get(L) ?? 0) + 1);
@@ -2225,12 +2244,12 @@ function xn(e, t, n, i, r, s) {
2225
2244
  const w = u.getProxy(c);
2226
2245
  return r.set(u, (r.get(u) ?? 0) + 1), w;
2227
2246
  }
2228
- function _e(e, t, n, i, r, s, o, a, c, f, h) {
2229
- for (const [u, l] of ge(e))
2247
+ function Ee(e, t, n, i, r, s, o, a, c, f, h) {
2248
+ for (const [u, l] of ve(e))
2230
2249
  if (!(i !== void 0 && !i.has(u)))
2231
- if (ve(t[u]) && (t[u] = Y(t[u], o, a, c, f, h)), l instanceof m && l._liveConfig !== void 0) {
2250
+ if (we(t[u]) && (t[u] = Y(t[u], o, a, c, f, h)), l instanceof m && l._liveConfig !== void 0) {
2232
2251
  const g = n[u];
2233
- g instanceof ye ? h ? g.append(t[u]) : g.reset(t[u]) : n[u] = pe(
2252
+ g instanceof ge ? h ? g.append(t[u]) : g.reset(t[u]) : n[u] = me(
2234
2253
  l._liveConfig,
2235
2254
  t[u],
2236
2255
  r,
@@ -2242,7 +2261,7 @@ function _e(e, t, n, i, r, s, o, a, c, f, h) {
2242
2261
  if (ft(g) && ft(p)) {
2243
2262
  const w = l instanceof m && l.shape !== void 0 ? l.shape : void 0;
2244
2263
  if (w !== void 0)
2245
- _e(
2264
+ Ee(
2246
2265
  w,
2247
2266
  g,
2248
2267
  p,
@@ -2263,11 +2282,11 @@ function _e(e, t, n, i, r, s, o, a, c, f, h) {
2263
2282
  n[u] = g;
2264
2283
  }
2265
2284
  }
2266
- function we(e, t, n, i, r, s, o, a, c) {
2267
- for (const [f, h] of ge(e))
2285
+ function be(e, t, n, i, r, s, o, a, c) {
2286
+ for (const [f, h] of ve(e))
2268
2287
  if (f in t)
2269
- if (ve(t[f]) && (t[f] = Y(t[f], r, s, o, a, c)), h instanceof m && h._liveConfig !== void 0)
2270
- t[f] = pe(
2288
+ if (we(t[f]) && (t[f] = Y(t[f], r, s, o, a, c)), h instanceof m && h._liveConfig !== void 0)
2289
+ t[f] = me(
2271
2290
  h._liveConfig,
2272
2291
  t[f],
2273
2292
  n,
@@ -2278,30 +2297,30 @@ function we(e, t, n, i, r, s, o, a, c) {
2278
2297
  const u = t[f];
2279
2298
  if (ft(u)) {
2280
2299
  const l = h instanceof m && h.shape !== void 0 ? h.shape : void 0;
2281
- l !== void 0 && we(l, u, n, i, r, s, o, a, c);
2300
+ l !== void 0 && be(l, u, n, i, r, s, o, a, c);
2282
2301
  }
2283
2302
  }
2284
2303
  }
2285
2304
  function ft(e) {
2286
- return typeof e == "object" && e !== null && !Array.isArray(e) && Object.getPrototypeOf(e) === me && !S.has(e);
2305
+ return typeof e == "object" && e !== null && !Array.isArray(e) && Object.getPrototypeOf(e) === _e && !S.has(e);
2287
2306
  }
2288
- function Un(e) {
2307
+ function Bn(e) {
2289
2308
  if (e !== void 0)
2290
2309
  return typeof e == "string" ? e : typeof e == "function" ? e() : e.value;
2291
2310
  }
2292
- function An(e) {
2293
- return Re(e);
2311
+ function kn(e) {
2312
+ return xe(e);
2294
2313
  }
2295
- function Tt(e) {
2314
+ function jt(e) {
2296
2315
  if (e === void 0)
2297
2316
  return;
2298
2317
  const t = {};
2299
2318
  for (const [n, i] of Object.entries(e))
2300
- An(i) ? t[n] = i.value : t[n] = i;
2319
+ kn(i) ? t[n] = i.value : t[n] = i;
2301
2320
  return t;
2302
2321
  }
2303
- const Et = (e, t) => N([e.statics.id, t]);
2304
- class qn {
2322
+ const bt = (e, t) => N([e.statics.id, t]);
2323
+ class Qn {
2305
2324
  entityMap;
2306
2325
  queryInstances = /* @__PURE__ */ new Map();
2307
2326
  mutationInstances = /* @__PURE__ */ new Map();
@@ -2318,7 +2337,7 @@ class qn {
2318
2337
  networkUnsubscribe;
2319
2338
  constructor(t = {}) {
2320
2339
  const {
2321
- store: n = new Ne(new De()),
2340
+ store: n = new ke(new Fe()),
2322
2341
  log: i,
2323
2342
  evictionMultiplier: r,
2324
2343
  adapters: s,
@@ -2326,10 +2345,10 @@ class qn {
2326
2345
  gcManager: a,
2327
2346
  ...c
2328
2347
  } = t;
2329
- this.isServer = typeof window > "u", this.store = n, this.context = { ...c, log: i ?? console, evictionMultiplier: r }, this.gcManager = t.gcManager ?? (this.isServer ? new Me() : new Fe(this.handleEviction, r)), this.networkManager = t.networkManager ?? new ce(), this.entityMap = new pn((u, l, g) => this.store.saveEntity(u, l, g));
2348
+ this.isServer = typeof window > "u", this.store = n, this.context = { ...c, log: i ?? console, evictionMultiplier: r }, this.gcManager = t.gcManager ?? (this.isServer ? new Pe() : new Te(this.handleEviction, r)), this.networkManager = t.networkManager ?? new ue(), this.entityMap = new _n((u, l, g) => this.store.saveEntity(u, l, g));
2330
2349
  for (const u of t.adapters ?? [])
2331
2350
  this.adapters.set(u.constructor, u), u.register(this);
2332
- const f = this.networkManager.getOnlineSignal(), h = xe(() => f.value);
2351
+ const f = this.networkManager.getOnlineSignal(), h = Ne(() => f.value);
2333
2352
  this.networkUnsubscribe = h.addListener(
2334
2353
  () => {
2335
2354
  const u = f.value;
@@ -2414,7 +2433,7 @@ class qn {
2414
2433
  activateQuery(t) {
2415
2434
  const { def: n, queryKey: i, storageKey: r, config: s } = t;
2416
2435
  this.store.activateQuery(n, r);
2417
- const o = s?.gcTime ?? Lt;
2436
+ const o = s?.gcTime ?? qt;
2418
2437
  this.gcManager.cancel(i, o);
2419
2438
  }
2420
2439
  loadCachedQuery(t, n) {
@@ -2425,9 +2444,9 @@ class qn {
2425
2444
  * that triggers fetches and prepopulates with cached data
2426
2445
  */
2427
2446
  getQuery(t, n) {
2428
- const i = Et(t, n);
2447
+ const i = bt(t, n);
2429
2448
  let r = this.queryInstances.get(i);
2430
- return r === void 0 && (r = new mn(t, this, i, n), this.queryInstances.set(i, r)), r.relay;
2449
+ return r === void 0 && (r = new En(t, this, i, n), this.queryInstances.set(i, r)), r.relay;
2431
2450
  }
2432
2451
  /**
2433
2452
  * Gets or creates a MutationResult for the given mutation definition.
@@ -2436,7 +2455,7 @@ class qn {
2436
2455
  getMutation(t) {
2437
2456
  const n = t.id;
2438
2457
  let i = this.mutationInstances.get(n);
2439
- return i === void 0 && (i = new vn(t, this), this.mutationInstances.set(n, i)), i.task;
2458
+ return i === void 0 && (i = new bn(t, this), this.mutationInstances.set(n, i)), i.task;
2440
2459
  }
2441
2460
  /**
2442
2461
  * Parse data: validates, formats, produces parsed entity data objects.
@@ -2445,7 +2464,7 @@ class qn {
2445
2464
  parseData(t, n, i) {
2446
2465
  const r = this.context.log?.warn ?? (() => {
2447
2466
  }), s = new ot();
2448
- return s.reset(this, i, r), { data: re(t, n, s), ctx: s };
2467
+ return s.reset(this, i, r), { data: se(t, n, s), ctx: s };
2449
2468
  }
2450
2469
  /**
2451
2470
  * Apply entities from parseData() via a single depth-first walk: creates/
@@ -2461,7 +2480,7 @@ class qn {
2461
2480
  * found in the store by the standard entity pipeline).
2462
2481
  */
2463
2482
  parseAndApplyRootEntity(t, n, i, r, s = !1, o) {
2464
- typeof i.idField == "symbol" && typeof t == "object" && t !== null && !("__entityRef" in t) && (t[Ut] = n);
2483
+ typeof i.idField == "symbol" && typeof t == "object" && t !== null && !("__entityRef" in t) && (t[Vt] = n);
2465
2484
  const a = this.parseData(t, i, o), c = nt(a.ctx, a.data, r, s), f = S.get(c.data);
2466
2485
  return this.entityMap.getEntity(f);
2467
2486
  }
@@ -2494,7 +2513,7 @@ class qn {
2494
2513
  /* isPartialEvent */
2495
2514
  !0
2496
2515
  );
2497
- const O = sn(h, r, v);
2516
+ const O = cn(h, r, v);
2498
2517
  nt(v, O, !0);
2499
2518
  } catch (w) {
2500
2519
  if (this.context.log?.warn?.("Failed to apply mutation event", w), u === void 0) {
@@ -2519,7 +2538,7 @@ class qn {
2519
2538
  for (const n of t) {
2520
2539
  const i = Array.isArray(n), r = i ? n[0] : n, s = i ? n[1] : void 0, a = G.for(r).statics.id;
2521
2540
  for (const [, c] of this.queryInstances)
2522
- c.def.statics.id === a && (s === void 0 || Dn(c.resolvedParams, s)) && c.markStale();
2541
+ c.def.statics.id === a && (s === void 0 || Mn(c.resolvedParams, s)) && c.markStale();
2523
2542
  }
2524
2543
  }
2525
2544
  // ======================================================
@@ -2540,7 +2559,7 @@ class qn {
2540
2559
  // ======================================================
2541
2560
  getOrCreateMatcher(t) {
2542
2561
  let n = this.constraintRegistry.get(t);
2543
- return n === void 0 && (n = new Sn(), this.constraintRegistry.set(t, n)), n;
2562
+ return n === void 0 && (n = new xn(), this.constraintRegistry.set(t, n)), n;
2544
2563
  }
2545
2564
  registerLiveCollection(t) {
2546
2565
  for (const [n, i] of t._entityDefsByTypename)
@@ -2555,7 +2574,7 @@ class qn {
2555
2574
  routeEvent(t, n, i, r, s, o, a) {
2556
2575
  const c = this.constraintRegistry.get(t);
2557
2576
  if (c === void 0) return;
2558
- const f = s !== void 0 ? { ...n, [de]: s } : n;
2577
+ const f = s !== void 0 ? { ...n, [le]: s } : n;
2559
2578
  c.routeEvent(t, f, i, r, o, a);
2560
2579
  }
2561
2580
  destroy() {
@@ -2565,8 +2584,8 @@ class qn {
2565
2584
  this.adapters.clear(), this.queryInstances.clear(), this.mutationInstances.clear(), this.constraintRegistry.clear(), this.typenameRegistry.clear(), this.mergedDefCache.clear();
2566
2585
  }
2567
2586
  }
2568
- const Nn = $t(void 0);
2569
- function Dn(e, t) {
2587
+ const Fn = Ut(void 0);
2588
+ function Mn(e, t) {
2570
2589
  if (e === void 0) return !1;
2571
2590
  for (const n in t)
2572
2591
  if (e[n] !== t[n]) return !1;
@@ -2574,31 +2593,31 @@ function Dn(e, t) {
2574
2593
  }
2575
2594
  export {
2576
2595
  I as A,
2577
- Qt as E,
2578
- Fe as G,
2596
+ yt as E,
2597
+ Te as G,
2579
2598
  B as L,
2580
2599
  d as M,
2581
- ce as N,
2582
- Ut as Q,
2583
- F as R,
2600
+ ue as N,
2601
+ Vt as Q,
2602
+ k as R,
2584
2603
  m as V,
2585
2604
  dt as a,
2586
- Pn as b,
2605
+ Un as b,
2587
2606
  V as c,
2588
- Me as d,
2589
- fe as e,
2590
- jn as f,
2591
- qn as g,
2592
- Nn as h,
2593
- gn as i,
2594
- Tn as j,
2595
- Ln as k,
2596
- Bt as l,
2597
- Pe as m,
2607
+ Pe as d,
2608
+ de as e,
2609
+ qn as f,
2610
+ Qn as g,
2611
+ Fn as h,
2612
+ wn as i,
2613
+ Ln as j,
2614
+ Kn as k,
2615
+ Yt as l,
2616
+ Le as m,
2598
2617
  J as n,
2599
- Un as o,
2600
- $n as q,
2601
- te as r,
2602
- nn as t
2618
+ Bn as o,
2619
+ Vn as q,
2620
+ ee as r,
2621
+ on as t
2603
2622
  };
2604
- //# sourceMappingURL=QueryClient-CmMSNSpt.js.map
2623
+ //# sourceMappingURL=QueryClient-C9tBdK1Z.js.map