@solidjs/signals 0.10.2 → 0.10.4

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.
package/dist/node.cjs CHANGED
@@ -101,12 +101,12 @@ function markNode(e, r = n) {
101
101
  if ((i & (t | n)) >= r) return;
102
102
  e.m = (i & -4) | r;
103
103
  for (let n = e.O; n !== null; n = n.P) {
104
- markNode(n.A, t);
104
+ markNode(n.k, t);
105
105
  }
106
- if (e.k !== null) {
107
- for (let n = e.k; n !== null; n = n.C) {
106
+ if (e.C !== null) {
107
+ for (let n = e.C; n !== null; n = n.A) {
108
108
  for (let e = n.O; e !== null; e = e.P) {
109
- markNode(e.A, t);
109
+ markNode(e.k, t);
110
110
  }
111
111
  }
112
112
  }
@@ -134,19 +134,19 @@ function adjustHeight(e, t) {
134
134
  if (e.o !== n) {
135
135
  e.o = n;
136
136
  for (let n = e.O; n !== null; n = n.P) {
137
- insertIntoHeapHeight(n.A, t);
137
+ insertIntoHeapHeight(n.k, t);
138
138
  }
139
139
  }
140
140
  }
141
141
  const m = new Set();
142
- const b = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
143
142
  const _ = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
143
+ const b = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
144
144
  let O = 0;
145
145
  let x = null;
146
146
  let v = false;
147
147
  let P = false;
148
148
  function runLaneEffects(e) {
149
- for (const t of C) {
149
+ for (const t of A) {
150
150
  if (t.R || t.T.size > 0) continue;
151
151
  const n = t.M[e - 1];
152
152
  if (n.length) {
@@ -161,7 +161,7 @@ function setProjectionWriteActive(e) {
161
161
  function schedule() {
162
162
  if (v) return;
163
163
  v = true;
164
- if (!A.q) queueMicrotask(flush);
164
+ if (!k.q) queueMicrotask(flush);
165
165
  }
166
166
  class Queue {
167
167
  i = null;
@@ -238,12 +238,12 @@ class GlobalQueue extends Queue {
238
238
  if (this.q) return;
239
239
  this.q = true;
240
240
  try {
241
- runHeap(b, GlobalQueue.K);
241
+ runHeap(_, GlobalQueue.K);
242
242
  if (x) {
243
243
  const e = transitionComplete(x);
244
244
  if (!e) {
245
245
  let e = x;
246
- runHeap(_, GlobalQueue.K);
246
+ runHeap(b, GlobalQueue.K);
247
247
  this.D = [];
248
248
  this.B = [];
249
249
  this.G = new Set();
@@ -251,7 +251,7 @@ class GlobalQueue extends Queue {
251
251
  runLaneEffects(p);
252
252
  this.stashQueues(x.X);
253
253
  O++;
254
- v = b.S >= b.W;
254
+ v = _.S >= _.W;
255
255
  reassignPendingTransition(x.D);
256
256
  x = null;
257
257
  finalizePureQueue(null, true);
@@ -265,11 +265,11 @@ class GlobalQueue extends Queue {
265
265
  reassignPendingTransition(this.D);
266
266
  finalizePureQueue(t);
267
267
  } else {
268
- if (m.size) runHeap(_, GlobalQueue.K);
268
+ if (m.size) runHeap(b, GlobalQueue.K);
269
269
  finalizePureQueue();
270
270
  }
271
271
  O++;
272
- v = b.S >= b.W;
272
+ v = _.S >= _.W;
273
273
  runLaneEffects(d);
274
274
  this.run(d);
275
275
  runLaneEffects(p);
@@ -310,7 +310,7 @@ class GlobalQueue extends Queue {
310
310
  const t = x;
311
311
  t.te = e;
312
312
  e.ee.push(...t.ee);
313
- for (const n of C) {
313
+ for (const n of A) {
314
314
  if (n.ne === t) n.ne = e;
315
315
  }
316
316
  e.B.push(...t.B);
@@ -334,7 +334,7 @@ class GlobalQueue extends Queue {
334
334
  x.B.push(t);
335
335
  }
336
336
  this.B = x.B;
337
- for (const e of C) {
337
+ for (const e of A) {
338
338
  if (!e.ne) e.ne = x;
339
339
  }
340
340
  for (const e of this.G) x.G.add(e);
@@ -345,13 +345,13 @@ function insertSubs(e, t = false) {
345
345
  const n = e.re || R;
346
346
  for (let r = e.O; r !== null; r = r.P) {
347
347
  if (t && n) {
348
- r.A.m |= f;
349
- assignOrMergeLane(r.A, n);
348
+ r.k.m |= f;
349
+ assignOrMergeLane(r.k, n);
350
350
  } else if (t) {
351
- r.A.m |= f;
352
- r.A.re = undefined;
351
+ r.k.m |= f;
352
+ r.k.re = undefined;
353
353
  }
354
- const e = r.A;
354
+ const e = r.k;
355
355
  if (e.ie === h) {
356
356
  if (!e.se) {
357
357
  e.se = true;
@@ -359,17 +359,17 @@ function insertSubs(e, t = false) {
359
359
  }
360
360
  continue;
361
361
  }
362
- const i = r.A.m & o ? _ : b;
363
- if (i.W > r.A.o) i.W = r.A.o;
364
- insertIntoHeap(r.A, i);
362
+ const i = r.k.m & o ? b : _;
363
+ if (i.W > r.k.o) i.W = r.k.o;
364
+ insertIntoHeap(r.k, i);
365
365
  }
366
366
  }
367
367
  function finalizePureQueue(e = null, t = false) {
368
368
  let n = !t;
369
- if (!t) checkBoundaryChildren(A);
370
- if (b.S >= b.W) runHeap(b, GlobalQueue.K);
369
+ if (!t) checkBoundaryChildren(k);
370
+ if (_.S >= _.W) runHeap(_, GlobalQueue.K);
371
371
  if (n) {
372
- const t = A.D;
372
+ const t = k.D;
373
373
  for (let e = 0; e < t.length; e++) {
374
374
  const n = t[e];
375
375
  if (n.fe !== y) {
@@ -381,7 +381,7 @@ function finalizePureQueue(e = null, t = false) {
381
381
  if (n.H) GlobalQueue.U(n, false, true);
382
382
  }
383
383
  t.length = 0;
384
- const n = e ? e.B : A.B;
384
+ const n = e ? e.B : k.B;
385
385
  for (let e = 0; e < n.length; e++) {
386
386
  const t = n[e];
387
387
  const r = t.fe;
@@ -394,7 +394,7 @@ function finalizePureQueue(e = null, t = false) {
394
394
  t.ne = null;
395
395
  }
396
396
  n.length = 0;
397
- const r = e ? e.G : A.G;
397
+ const r = e ? e.G : k.G;
398
398
  if (GlobalQueue.J && r.size) {
399
399
  for (const e of r) {
400
400
  GlobalQueue.J(e);
@@ -402,7 +402,7 @@ function finalizePureQueue(e = null, t = false) {
402
402
  r.clear();
403
403
  schedule();
404
404
  }
405
- for (const t of C) {
405
+ for (const t of A) {
406
406
  const n = e ? t.ne === e : !t.ne;
407
407
  if (!n) continue;
408
408
  if (!t.R) {
@@ -413,8 +413,8 @@ function finalizePureQueue(e = null, t = false) {
413
413
  t.T.clear();
414
414
  t.M[0].length = 0;
415
415
  t.M[1].length = 0;
416
- C.delete(t);
417
- k.delete(t.ae);
416
+ A.delete(t);
417
+ C.delete(t.ae);
418
418
  }
419
419
  }
420
420
  }
@@ -425,7 +425,7 @@ function checkBoundaryChildren(e) {
425
425
  }
426
426
  }
427
427
  function trackOptimisticStore(e) {
428
- A.G.add(e);
428
+ k.G.add(e);
429
429
  schedule();
430
430
  }
431
431
  function reassignPendingTransition(e) {
@@ -433,10 +433,10 @@ function reassignPendingTransition(e) {
433
433
  e[t].ne = x;
434
434
  }
435
435
  }
436
- const A = new GlobalQueue();
436
+ const k = new GlobalQueue();
437
437
  function flush() {
438
438
  while (v) {
439
- A.flush();
439
+ k.flush();
440
440
  }
441
441
  }
442
442
  function runQueue(e, t) {
@@ -472,18 +472,18 @@ function runInTransition(e, t) {
472
472
  x = n;
473
473
  }
474
474
  }
475
- const k = new WeakMap();
476
- const C = new Set();
475
+ const C = new WeakMap();
476
+ const A = new Set();
477
477
  function getOrCreateLane(e) {
478
- let t = k.get(e);
478
+ let t = C.get(e);
479
479
  if (t) {
480
480
  return findLane(t);
481
481
  }
482
482
  const n = e.de;
483
483
  const r = n?.re ? findLane(n.re) : null;
484
484
  t = { ae: e, T: new Set(), M: [[], []], R: null, ne: x, pe: r };
485
- k.set(e, t);
486
- C.add(t);
485
+ C.set(e, t);
486
+ A.add(t);
487
487
  e.he = e.ye || 0;
488
488
  return t;
489
489
  }
@@ -505,7 +505,7 @@ function resolveLane(e) {
505
505
  const t = e.re;
506
506
  if (!t) return undefined;
507
507
  const n = findLane(t);
508
- if (C.has(n)) return n;
508
+ if (A.has(n)) return n;
509
509
  e.re = undefined;
510
510
  return undefined;
511
511
  }
@@ -521,7 +521,7 @@ function assignOrMergeLane(e, t) {
521
521
  return;
522
522
  }
523
523
  const i = findLane(r);
524
- if (C.has(i)) {
524
+ if (A.has(i)) {
525
525
  if (i !== n && !hasActiveOverride(e)) {
526
526
  if (n.pe && findLane(n.pe) === i) {
527
527
  e.re = t;
@@ -545,14 +545,14 @@ function handleAsync(e, t, r) {
545
545
  let u;
546
546
  const handleError = n => {
547
547
  if (e.we !== t) return;
548
- A.initTransition(e.ne);
548
+ k.initTransition(e.ne);
549
549
  notifyStatus(e, n instanceof NotReadyError ? l : c, n);
550
550
  e.$ = O;
551
551
  };
552
552
  const asyncWrite = (i, s) => {
553
553
  if (e.we !== t) return;
554
554
  if (e.m & (n | f)) return;
555
- A.initTransition(e.ne);
555
+ k.initTransition(e.ne);
556
556
  clearStatus(e);
557
557
  const o = resolveLane(e);
558
558
  if (o) o.T.delete(e);
@@ -599,7 +599,7 @@ function handleAsync(e, t, r) {
599
599
  );
600
600
  r = false;
601
601
  if (!n) {
602
- A.initTransition(e.ne);
602
+ k.initTransition(e.ne);
603
603
  throw new NotReadyError(Q);
604
604
  }
605
605
  }
@@ -631,7 +631,7 @@ function handleAsync(e, t, r) {
631
631
  };
632
632
  const i = iterate();
633
633
  if (!r && !i) {
634
- A.initTransition(e.ne);
634
+ k.initTransition(e.ne);
635
635
  throw new NotReadyError(Q);
636
636
  }
637
637
  }
@@ -641,7 +641,7 @@ function clearStatus(e) {
641
641
  e.ce = e.ce & a;
642
642
  e.Y = null;
643
643
  updatePendingSignal(e);
644
- e.be?.();
644
+ e._e?.();
645
645
  }
646
646
  function notifyStatus(e, t, n, r, i) {
647
647
  if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
@@ -665,122 +665,100 @@ function notifyStatus(e, t, n, r, i) {
665
665
  }
666
666
  const f = r || u;
667
667
  const d = r || o ? undefined : i;
668
- if (e.be) {
668
+ if (e._e) {
669
669
  if (f) {
670
- e.be(t, n);
670
+ e._e(t, n);
671
671
  } else {
672
- e.be();
672
+ e._e();
673
673
  }
674
674
  return;
675
675
  }
676
676
  for (let r = e.O; r !== null; r = r.P) {
677
- r.A.$ = O;
678
- if (r.A.Y !== n) {
679
- !r.A.ne && A.D.push(r.A);
680
- notifyStatus(r.A, t, n, f, d);
677
+ r.k.$ = O;
678
+ if (r.k.Y !== n) {
679
+ !r.k.ne && k.D.push(r.k);
680
+ notifyStatus(r.k, t, n, f, d);
681
681
  }
682
682
  }
683
- for (let r = e.k; r !== null; r = r.C) {
683
+ for (let r = e.C; r !== null; r = r.A) {
684
684
  for (let e = r.O; e !== null; e = e.P) {
685
- e.A.$ = O;
686
- if (e.A.Y !== n) {
687
- !e.A.ne && A.D.push(e.A);
688
- notifyStatus(e.A, t, n, f, d);
685
+ e.k.$ = O;
686
+ if (e.k.Y !== n) {
687
+ !e.k.ne && k.D.push(e.k);
688
+ notifyStatus(e.k, t, n, f, d);
689
689
  }
690
690
  }
691
691
  }
692
692
  }
693
- function effect(e, t, n, r, i) {
694
- let s = false;
695
- const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
696
- ...i,
697
- equals: () => {
698
- o.se = !o.Y;
699
- if (s) o.oe.enqueue(o.ie, runEffect.bind(o));
700
- return false;
701
- },
702
- lazy: true
703
- });
704
- o._e = r;
705
- o.Oe = t;
706
- o.xe = n;
707
- o.ve = undefined;
708
- o.ie = i?.render ? d : p;
709
- o.be = (e, t) => {
710
- const n = e !== undefined ? e : o.ce;
711
- const r = t !== undefined ? t : o.Y;
712
- if (n & c) {
713
- let e = r;
714
- o.oe.notify(o, l, 0);
715
- if (o.ie === p) {
716
- try {
717
- return o.xe
718
- ? o.xe(e, () => {
719
- o.ve?.();
720
- o.ve = undefined;
721
- })
722
- : console.error(e);
723
- } catch (t) {
724
- e = t;
725
- }
726
- }
727
- if (!o.oe.notify(o, c, c)) throw e;
728
- } else if (o.ie === d) o.oe.notify(o, l | c, n, r);
729
- };
730
- recompute(o, true);
731
- !i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
732
- s = true;
733
- onCleanup(() => o.ve?.());
693
+ function unlinkSubs(e) {
694
+ const t = e.L;
695
+ const n = e.N;
696
+ const r = e.P;
697
+ const i = e.be;
698
+ if (r !== null) r.be = i;
699
+ else t.Oe = i;
700
+ if (i !== null) i.P = r;
701
+ else {
702
+ t.O = r;
703
+ if (r === null) {
704
+ t.xe?.();
705
+ t.H && !t.ve && unobserved(t);
706
+ }
707
+ }
708
+ return n;
734
709
  }
735
- function runEffect() {
736
- if (!this.se || this.m & u) return;
737
- this.ve?.();
738
- this.ve = undefined;
739
- try {
740
- this.ve = this.Oe(this.le, this._e);
741
- } catch (e) {
742
- if (!this.oe.notify(this, c, c)) throw e;
743
- } finally {
744
- this._e = this.le;
745
- this.se = false;
710
+ function unobserved(e) {
711
+ deleteFromHeap(e, e.m & o ? b : _);
712
+ let t = e.j;
713
+ while (t !== null) {
714
+ t = unlinkSubs(t);
746
715
  }
716
+ e.j = null;
717
+ disposeChildren(e, true);
747
718
  }
748
- function trackedEffect(e, t) {
749
- const run = () => {
750
- if (!n.se || n.m & u) return;
751
- n.se = false;
752
- recompute(n);
753
- };
754
- const n = computed(
755
- () => {
756
- try {
757
- n.ve?.();
758
- n.ve = undefined;
759
- n.ve = staleValues(e) || undefined;
760
- } finally {
761
- }
762
- },
763
- undefined,
764
- { ...t, lazy: true, pureWrite: true }
765
- );
766
- n.ve = undefined;
767
- n.se = true;
768
- n.ie = h;
769
- n.ue = run;
770
- n.oe.enqueue(p, run);
771
- onCleanup(() => n.ve?.());
719
+ function link(e, t) {
720
+ const n = t.Pe;
721
+ if (n !== null && n.L === e) return;
722
+ let i = null;
723
+ const s = t.m & r;
724
+ if (s) {
725
+ i = n !== null ? n.N : t.j;
726
+ if (i !== null && i.L === e) {
727
+ t.Pe = i;
728
+ return;
729
+ }
730
+ }
731
+ const o = e.Oe;
732
+ if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
733
+ const u = (t.Pe = e.Oe = { L: e, k: t, N: i, be: o, P: null });
734
+ if (n !== null) n.N = u;
735
+ else t.j = u;
736
+ if (o !== null) o.P = u;
737
+ else e.O = u;
738
+ }
739
+ function isValidLink(e, t) {
740
+ const n = t.Pe;
741
+ if (n !== null) {
742
+ let r = t.j;
743
+ do {
744
+ if (r === e) return true;
745
+ if (r === n) break;
746
+ r = r.N;
747
+ } while (r !== null);
748
+ }
749
+ return false;
772
750
  }
773
751
  const W = {};
774
752
  function markDisposal(e) {
775
- let t = e.Pe;
753
+ let t = e.ke;
776
754
  while (t) {
777
755
  t.m |= o;
778
756
  if (t.m & i) {
779
- deleteFromHeap(t, b);
780
- insertIntoHeap(t, _);
757
+ deleteFromHeap(t, _);
758
+ insertIntoHeap(t, b);
781
759
  }
782
760
  markDisposal(t);
783
- t = t.Ae;
761
+ t = t.Ce;
784
762
  }
785
763
  }
786
764
  function dispose(e) {
@@ -789,33 +767,33 @@ function dispose(e) {
789
767
  t = unlinkSubs(t);
790
768
  } while (t !== null);
791
769
  e.j = null;
792
- e.ke = null;
770
+ e.Pe = null;
793
771
  disposeChildren(e, true);
794
772
  }
795
773
  function disposeChildren(e, t = false, n) {
796
774
  if (e.m & u) return;
797
775
  if (t) e.m = u;
798
- let r = n ? e.Ce : e.Pe;
776
+ let r = n ? e.Ae : e.ke;
799
777
  while (r) {
800
- const e = r.Ae;
778
+ const e = r.Ce;
801
779
  if (r.j) {
802
780
  const e = r;
803
- deleteFromHeap(e, e.m & o ? _ : b);
781
+ deleteFromHeap(e, e.m & o ? b : _);
804
782
  let t = e.j;
805
783
  do {
806
784
  t = unlinkSubs(t);
807
785
  } while (t !== null);
808
786
  e.j = null;
809
- e.ke = null;
787
+ e.Pe = null;
810
788
  }
811
789
  disposeChildren(r, true);
812
790
  r = e;
813
791
  }
814
792
  if (n) {
815
- e.Ce = null;
816
- } else {
817
- e.Pe = null;
818
793
  e.Ae = null;
794
+ } else {
795
+ e.ke = null;
796
+ e.Ce = null;
819
797
  e.We = 0;
820
798
  }
821
799
  runDisposal(e, n);
@@ -833,10 +811,18 @@ function runDisposal(e, t) {
833
811
  }
834
812
  t ? (e.Ee = null) : (e.je = null);
835
813
  }
836
- function getNextChildId(e) {
837
- if (e.id != null) return formatId(e.id, e.We++);
814
+ function childId(e, t) {
815
+ let n = e;
816
+ while (n.Ne && n.i) n = n.i;
817
+ if (n.id != null) return formatId(n.id, t ? n.We++ : n.We);
838
818
  throw new Error("Cannot get child id from owner without an id");
839
819
  }
820
+ function getNextChildId(e) {
821
+ return childId(e, true);
822
+ }
823
+ function peekNextChildId(e) {
824
+ return childId(e, false);
825
+ }
840
826
  function formatId(e, t) {
841
827
  const n = t.toString(36),
842
828
  r = n.length - 1;
@@ -858,95 +844,119 @@ function onCleanup(e) {
858
844
  }
859
845
  function createOwner(e) {
860
846
  const t = Q;
861
- const n = {
862
- id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
847
+ const n = e?.transparent ?? false;
848
+ const r = {
849
+ id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
850
+ Ne: n || undefined,
863
851
  t: true,
864
852
  u: t?.t ? t.u : t,
865
- Pe: null,
866
- Ae: null,
853
+ ke: null,
854
+ Ce: null,
867
855
  je: null,
868
- oe: t?.oe ?? A,
869
- Ne: t?.Ne || w,
856
+ oe: t?.oe ?? k,
857
+ Le: t?.Le || w,
870
858
  We: 0,
871
859
  Ee: null,
872
- Ce: null,
860
+ Ae: null,
873
861
  i: t,
874
862
  dispose(e = true) {
875
- disposeChildren(n, e);
863
+ disposeChildren(r, e);
876
864
  }
877
865
  };
878
866
  if (t) {
879
- const e = t.Pe;
867
+ const e = t.ke;
880
868
  if (e === null) {
881
- t.Pe = n;
869
+ t.ke = r;
882
870
  } else {
883
- n.Ae = e;
884
- t.Pe = n;
871
+ r.Ce = e;
872
+ t.ke = r;
885
873
  }
886
874
  }
887
- return n;
875
+ return r;
888
876
  }
889
877
  function createRoot(e, t) {
890
878
  const n = createOwner(t);
891
879
  return runWithOwner(n, () => e(n.dispose));
892
880
  }
893
- function unlinkSubs(e) {
894
- const t = e.L;
895
- const n = e.N;
896
- const r = e.P;
897
- const i = e.Le;
898
- if (r !== null) r.Le = i;
899
- else t.Ie = i;
900
- if (i !== null) i.P = r;
901
- else {
902
- t.O = r;
903
- if (r === null) {
904
- t.He?.();
905
- t.H && !t.Qe && unobserved(t);
906
- }
907
- }
908
- return n;
909
- }
910
- function unobserved(e) {
911
- deleteFromHeap(e, e.m & o ? _ : b);
912
- let t = e.j;
913
- while (t !== null) {
914
- t = unlinkSubs(t);
915
- }
916
- e.j = null;
917
- disposeChildren(e, true);
881
+ function effect(e, t, n, r, i) {
882
+ let s = false;
883
+ const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
884
+ ...i,
885
+ equals: () => {
886
+ o.se = !o.Y;
887
+ if (s) o.oe.enqueue(o.ie, runEffect.bind(o));
888
+ return false;
889
+ },
890
+ lazy: true
891
+ });
892
+ o.Ie = r;
893
+ o.He = t;
894
+ o.Qe = n;
895
+ o.Re = undefined;
896
+ o.ie = i?.render ? d : p;
897
+ o._e = (e, t) => {
898
+ const n = e !== undefined ? e : o.ce;
899
+ const r = t !== undefined ? t : o.Y;
900
+ if (n & c) {
901
+ let e = r;
902
+ o.oe.notify(o, l, 0);
903
+ if (o.ie === p) {
904
+ try {
905
+ return o.Qe
906
+ ? o.Qe(e, () => {
907
+ o.Re?.();
908
+ o.Re = undefined;
909
+ })
910
+ : console.error(e);
911
+ } catch (t) {
912
+ e = t;
913
+ }
914
+ }
915
+ if (!o.oe.notify(o, c, c)) throw e;
916
+ } else if (o.ie === d) o.oe.notify(o, l | c, n, r);
917
+ };
918
+ recompute(o, true);
919
+ !i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
920
+ s = true;
921
+ onCleanup(() => o.Re?.());
918
922
  }
919
- function link(e, t) {
920
- const n = t.ke;
921
- if (n !== null && n.L === e) return;
922
- let i = null;
923
- const s = t.m & r;
924
- if (s) {
925
- i = n !== null ? n.N : t.j;
926
- if (i !== null && i.L === e) {
927
- t.ke = i;
928
- return;
929
- }
923
+ function runEffect() {
924
+ if (!this.se || this.m & u) return;
925
+ this.Re?.();
926
+ this.Re = undefined;
927
+ try {
928
+ this.Re = this.He(this.le, this.Ie);
929
+ } catch (e) {
930
+ if (!this.oe.notify(this, c, c)) throw e;
931
+ } finally {
932
+ this.Ie = this.le;
933
+ this.se = false;
930
934
  }
931
- const o = e.Ie;
932
- if (o !== null && o.A === t && (!s || isValidLink(o, t))) return;
933
- const u = (t.ke = e.Ie = { L: e, A: t, N: i, Le: o, P: null });
934
- if (n !== null) n.N = u;
935
- else t.j = u;
936
- if (o !== null) o.P = u;
937
- else e.O = u;
938
935
  }
939
- function isValidLink(e, t) {
940
- const n = t.ke;
941
- if (n !== null) {
942
- let r = t.j;
943
- do {
944
- if (r === e) return true;
945
- if (r === n) break;
946
- r = r.N;
947
- } while (r !== null);
948
- }
949
- return false;
936
+ function trackedEffect(e, t) {
937
+ const run = () => {
938
+ if (!n.se || n.m & u) return;
939
+ n.se = false;
940
+ recompute(n);
941
+ };
942
+ const n = computed(
943
+ () => {
944
+ try {
945
+ n.Re?.();
946
+ n.Re = undefined;
947
+ n.Re = staleValues(e) || undefined;
948
+ } finally {
949
+ }
950
+ },
951
+ undefined,
952
+ { ...t, lazy: true, pureWrite: true }
953
+ );
954
+ n.Re = undefined;
955
+ n.se = true;
956
+ n.ie = h;
957
+ n.ue = run;
958
+ n.oe.enqueue(p, run);
959
+ onCleanup(() => n.Re?.());
950
960
  }
951
961
  GlobalQueue.K = recompute;
952
962
  GlobalQueue.U = disposeChildren;
@@ -961,15 +971,15 @@ let R = null;
961
971
  function recompute(t, n = false) {
962
972
  const i = t.ie;
963
973
  if (!n) {
964
- if (t.ne && (!i || x) && x !== t.ne) A.initTransition(t.ne);
965
- deleteFromHeap(t, t.m & o ? _ : b);
974
+ if (t.ne && (!i || x) && x !== t.ne) k.initTransition(t.ne);
975
+ deleteFromHeap(t, t.m & o ? b : _);
966
976
  if (t.ne || i === h) disposeChildren(t);
967
977
  else {
968
978
  markDisposal(t);
969
979
  t.Ee = t.je;
970
- t.Ce = t.Pe;
980
+ t.Ae = t.ke;
971
981
  t.je = null;
972
- t.Pe = null;
982
+ t.ke = null;
973
983
  t.We = 0;
974
984
  }
975
985
  }
@@ -978,7 +988,7 @@ function recompute(t, n = false) {
978
988
  const a = !!(t.ce & l);
979
989
  const d = Q;
980
990
  Q = t;
981
- t.ke = null;
991
+ t.Pe = null;
982
992
  t.m = r;
983
993
  t.$ = O;
984
994
  let p = t.fe === y ? t.le : t.fe;
@@ -1020,7 +1030,7 @@ function recompute(t, n = false) {
1020
1030
  Q = d;
1021
1031
  }
1022
1032
  if (!t.Y) {
1023
- const e = t.ke;
1033
+ const e = t.Pe;
1024
1034
  let r = e !== null ? e.N : t.j;
1025
1035
  if (r !== null) {
1026
1036
  do {
@@ -1047,12 +1057,12 @@ function recompute(t, n = false) {
1047
1057
  t.fe = p;
1048
1058
  } else if (t.o != g) {
1049
1059
  for (let e = t.O; e !== null; e = e.P) {
1050
- insertIntoHeapHeight(e.A, e.A.m & o ? _ : b);
1060
+ insertIntoHeapHeight(e.k, e.k.m & o ? b : _);
1051
1061
  }
1052
1062
  }
1053
1063
  }
1054
1064
  R = S;
1055
- (!n || t.ce & l) && !t.ne && !(x && t.ge) && A.D.push(t);
1065
+ (!n || t.ce & l) && !t.ne && !(x && t.ge) && k.D.push(t);
1056
1066
  t.ne && i && x !== t.ne && runInTransition(t.ne, () => recompute(t));
1057
1067
  }
1058
1068
  function updateIfNecessary(r) {
@@ -1074,66 +1084,68 @@ function updateIfNecessary(r) {
1074
1084
  r.m = e;
1075
1085
  }
1076
1086
  function computed(t, n, r) {
1077
- const i = {
1078
- id: r?.id ?? (Q?.id != null ? getNextChildId(Q) : undefined),
1087
+ const i = r?.transparent ?? false;
1088
+ const s = {
1089
+ id: r?.id ?? (i ? Q?.id : Q?.id != null ? getNextChildId(Q) : undefined),
1090
+ Ne: i || undefined,
1079
1091
  Se: r?.equals != null ? r.equals : isEqual,
1080
- Re: !!r?.pureWrite,
1081
- He: r?.unobserved,
1092
+ Te: !!r?.pureWrite,
1093
+ xe: r?.unobserved,
1082
1094
  je: null,
1083
- oe: Q?.oe ?? A,
1084
- Ne: Q?.Ne ?? w,
1095
+ oe: Q?.oe ?? k,
1096
+ Le: Q?.Le ?? w,
1085
1097
  We: 0,
1086
1098
  H: t,
1087
1099
  le: n,
1088
1100
  o: 0,
1089
- k: null,
1101
+ C: null,
1090
1102
  h: undefined,
1091
1103
  p: null,
1092
1104
  j: null,
1093
- ke: null,
1105
+ Pe: null,
1094
1106
  O: null,
1095
- Ie: null,
1107
+ Oe: null,
1096
1108
  i: Q,
1097
- Ae: null,
1098
- Pe: null,
1109
+ Ce: null,
1110
+ ke: null,
1099
1111
  m: e,
1100
1112
  ce: a,
1101
1113
  $: O,
1102
1114
  fe: y,
1103
1115
  Ee: null,
1104
- Ce: null,
1116
+ Ae: null,
1105
1117
  we: null,
1106
1118
  ne: null
1107
1119
  };
1108
- i.p = i;
1109
- const s = Q?.t ? Q.u : Q;
1120
+ s.p = s;
1121
+ const o = Q?.t ? Q.u : Q;
1110
1122
  if (Q) {
1111
- const e = Q.Pe;
1123
+ const e = Q.ke;
1112
1124
  if (e === null) {
1113
- Q.Pe = i;
1125
+ Q.ke = s;
1114
1126
  } else {
1115
- i.Ae = e;
1116
- Q.Pe = i;
1127
+ s.Ce = e;
1128
+ Q.ke = s;
1117
1129
  }
1118
1130
  }
1119
- if (s) i.o = s.o + 1;
1120
- !r?.lazy && recompute(i, true);
1121
- return i;
1131
+ if (o) s.o = o.o + 1;
1132
+ !r?.lazy && recompute(s, true);
1133
+ return s;
1122
1134
  }
1123
1135
  function signal(e, t, n = null) {
1124
1136
  const r = {
1125
1137
  Se: t?.equals != null ? t.equals : isEqual,
1126
- Re: !!t?.pureWrite,
1127
- He: t?.unobserved,
1138
+ Te: !!t?.pureWrite,
1139
+ xe: t?.unobserved,
1128
1140
  le: e,
1129
1141
  O: null,
1130
- Ie: null,
1142
+ Oe: null,
1131
1143
  $: O,
1132
1144
  I: n,
1133
- C: n?.k || null,
1145
+ A: n?.C || null,
1134
1146
  fe: y
1135
1147
  };
1136
- n && (n.k = r);
1148
+ n && (n.C = r);
1137
1149
  return r;
1138
1150
  }
1139
1151
  function optimisticSignal(e, t) {
@@ -1195,9 +1207,9 @@ function read(e) {
1195
1207
  const n = e.I || e;
1196
1208
  if (n.H) {
1197
1209
  const r = e.m & o;
1198
- if (n.o >= (r ? _.W : b.W)) {
1210
+ if (n.o >= (r ? b.W : _.W)) {
1199
1211
  markNode(t);
1200
- markHeap(r ? _ : b);
1212
+ markHeap(r ? b : _);
1201
1213
  updateIfNecessary(n);
1202
1214
  }
1203
1215
  const i = n.o;
@@ -1229,7 +1241,7 @@ function read(e) {
1229
1241
  return !t || R !== null || e.fe === y || (j && e.ne && x !== e.ne) ? e.le : e.fe;
1230
1242
  }
1231
1243
  function setSignal(e, t) {
1232
- if (e.ne && x !== e.ne) A.initTransition(e.ne);
1244
+ if (e.ne && x !== e.ne) k.initTransition(e.ne);
1233
1245
  const n = e.ge && !P;
1234
1246
  const r = n ? e.le : e.fe === y ? e.le : e.fe;
1235
1247
  if (typeof t === "function") t = t(r);
@@ -1242,22 +1254,22 @@ function setSignal(e, t) {
1242
1254
  return t;
1243
1255
  }
1244
1256
  if (n) {
1245
- const n = A.B.includes(e);
1257
+ const n = k.B.includes(e);
1246
1258
  if (e.ne && n) {
1247
- A.initTransition(e.ne);
1259
+ k.initTransition(e.ne);
1248
1260
  }
1249
1261
  if (e.fe === y) {
1250
1262
  e.fe = e.le;
1251
1263
  }
1252
1264
  if (!n) {
1253
- A.B.push(e);
1265
+ k.B.push(e);
1254
1266
  }
1255
1267
  e.ye = (e.ye || 0) + 1;
1256
1268
  const r = getOrCreateLane(e);
1257
1269
  e.re = r;
1258
1270
  e.le = t;
1259
1271
  } else {
1260
- if (e.fe === y) A.D.push(e);
1272
+ if (e.fe === y) k.D.push(e);
1261
1273
  e.fe = t;
1262
1274
  }
1263
1275
  updatePendingSignal(e);
@@ -1282,14 +1294,14 @@ function runWithOwner(e, t) {
1282
1294
  }
1283
1295
  }
1284
1296
  function getPendingSignal(e) {
1285
- if (!e.Te) {
1286
- e.Te = optimisticSignal(false, { pureWrite: true });
1297
+ if (!e.Me) {
1298
+ e.Me = optimisticSignal(false, { pureWrite: true });
1287
1299
  if (e.de) {
1288
- e.Te.de = e;
1300
+ e.Me.de = e;
1289
1301
  }
1290
- if (computePendingState(e)) setSignal(e.Te, true);
1302
+ if (computePendingState(e)) setSignal(e.Me, true);
1291
1303
  }
1292
- return e.Te;
1304
+ return e.Me;
1293
1305
  }
1294
1306
  function computePendingState(e) {
1295
1307
  const t = e;
@@ -1305,9 +1317,9 @@ function computePendingState(e) {
1305
1317
  return !!(t.ce & l && !(t.ce & a));
1306
1318
  }
1307
1319
  function updatePendingSignal(e) {
1308
- if (e.Te) {
1320
+ if (e.Me) {
1309
1321
  const t = computePendingState(e);
1310
- const n = e.Te;
1322
+ const n = e.Me;
1311
1323
  setSignal(n, t);
1312
1324
  if (!t && n.re) {
1313
1325
  const t = resolveLane(e);
@@ -1317,7 +1329,7 @@ function updatePendingSignal(e) {
1317
1329
  mergeLanes(t, e);
1318
1330
  }
1319
1331
  }
1320
- k.delete(n);
1332
+ C.delete(n);
1321
1333
  n.re = undefined;
1322
1334
  }
1323
1335
  }
@@ -1397,7 +1409,7 @@ function getContext(e, t = getOwner()) {
1397
1409
  if (!t) {
1398
1410
  throw new NoOwnerError();
1399
1411
  }
1400
- const n = hasContext(e, t) ? t.Ne[e.id] : e.defaultValue;
1412
+ const n = hasContext(e, t) ? t.Le[e.id] : e.defaultValue;
1401
1413
  if (isUndefined(n)) {
1402
1414
  throw new ContextNotFoundError();
1403
1415
  }
@@ -1407,16 +1419,16 @@ function setContext(e, t, n = getOwner()) {
1407
1419
  if (!n) {
1408
1420
  throw new NoOwnerError();
1409
1421
  }
1410
- n.Ne = { ...n.Ne, [e.id]: isUndefined(t) ? e.defaultValue : t };
1422
+ n.Le = { ...n.Le, [e.id]: isUndefined(t) ? e.defaultValue : t };
1411
1423
  }
1412
1424
  function hasContext(e, t) {
1413
- return !isUndefined(t?.Ne[e.id]);
1425
+ return !isUndefined(t?.Le[e.id]);
1414
1426
  }
1415
1427
  function isUndefined(e) {
1416
1428
  return typeof e === "undefined";
1417
1429
  }
1418
1430
  function restoreTransition(e, t) {
1419
- A.initTransition(e);
1431
+ k.initTransition(e);
1420
1432
  const n = t();
1421
1433
  flush();
1422
1434
  return n;
@@ -1425,7 +1437,7 @@ function action(e) {
1425
1437
  return (...t) =>
1426
1438
  new Promise((n, r) => {
1427
1439
  const i = e(...t);
1428
- A.initTransition();
1440
+ k.initTransition();
1429
1441
  let s = x;
1430
1442
  s.ee.push(i);
1431
1443
  const done = (e, t) => {
@@ -1522,7 +1534,7 @@ function createOptimistic(e, t, n) {
1522
1534
  function onSettled(e) {
1523
1535
  getOwner()
1524
1536
  ? createTrackedEffect(() => untrack(e))
1525
- : A.enqueue(p, () => {
1537
+ : k.enqueue(p, () => {
1526
1538
  const t = e();
1527
1539
  t?.();
1528
1540
  });
@@ -1692,7 +1704,7 @@ function createProjectionInternal(e, t = {}, n) {
1692
1704
  i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
1693
1705
  });
1694
1706
  });
1695
- r.Qe = true;
1707
+ r.ve = true;
1696
1708
  return { store: s, node: r };
1697
1709
  }
1698
1710
  function createProjection(e, t = {}, n) {
@@ -1871,7 +1883,7 @@ const re = {
1871
1883
  if (e[$]) {
1872
1884
  const t = e[Z];
1873
1885
  if (t?.ne) {
1874
- A.initTransition(t.ne);
1886
+ k.initTransition(t.ne);
1875
1887
  }
1876
1888
  }
1877
1889
  untrack(() => {
@@ -2120,7 +2132,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
2120
2132
  setProjectionWriteActive(false);
2121
2133
  }
2122
2134
  });
2123
- r.Qe = true;
2135
+ r.ve = true;
2124
2136
  }
2125
2137
  return { store: s, node: r };
2126
2138
  }
@@ -2301,68 +2313,68 @@ function mapArray(e, t, n) {
2301
2313
  const r = typeof n?.keyed === "function" ? n.keyed : undefined;
2302
2314
  return createMemo(
2303
2315
  updateKeyedMap.bind({
2304
- Me: createOwner(),
2305
- qe: 0,
2306
- Fe: e,
2307
- Ve: [],
2308
- De: t,
2309
- Be: [],
2316
+ qe: createOwner(),
2317
+ Fe: 0,
2318
+ Ve: e,
2319
+ De: [],
2320
+ Be: t,
2310
2321
  Ge: [],
2311
- Ke: r,
2312
- ze: r || n?.keyed === false ? [] : undefined,
2313
- Ue: t.length > 1 ? [] : undefined,
2314
- Je: n?.fallback
2322
+ Ke: [],
2323
+ ze: r,
2324
+ Ue: r || n?.keyed === false ? [] : undefined,
2325
+ Je: t.length > 1 ? [] : undefined,
2326
+ Xe: n?.fallback
2315
2327
  })
2316
2328
  );
2317
2329
  }
2318
2330
  const oe = { pureWrite: true };
2319
2331
  function updateKeyedMap() {
2320
- const e = this.Fe() || [],
2332
+ const e = this.Ve() || [],
2321
2333
  t = e.length;
2322
2334
  e[M];
2323
- runWithOwner(this.Me, () => {
2335
+ runWithOwner(this.qe, () => {
2324
2336
  let n,
2325
2337
  r,
2326
- i = this.ze
2338
+ i = this.Ue
2327
2339
  ? () => {
2328
- this.ze[r] = signal(e[r], oe);
2329
- this.Ue && (this.Ue[r] = signal(r, oe));
2330
- return this.De(
2331
- read.bind(null, this.ze[r]),
2332
- this.Ue ? read.bind(null, this.Ue[r]) : undefined
2340
+ this.Ue[r] = signal(e[r], oe);
2341
+ this.Je && (this.Je[r] = signal(r, oe));
2342
+ return this.Be(
2343
+ read.bind(null, this.Ue[r]),
2344
+ this.Je ? read.bind(null, this.Je[r]) : undefined
2333
2345
  );
2334
2346
  }
2335
- : this.Ue
2347
+ : this.Je
2336
2348
  ? () => {
2337
2349
  const t = e[r];
2338
- this.Ue[r] = signal(r, oe);
2339
- return this.De(() => t, read.bind(null, this.Ue[r]));
2350
+ this.Je[r] = signal(r, oe);
2351
+ return this.Be(() => t, read.bind(null, this.Je[r]));
2340
2352
  }
2341
2353
  : () => {
2342
2354
  const t = e[r];
2343
- return this.De(() => t);
2355
+ return this.Be(() => t);
2344
2356
  };
2345
2357
  if (t === 0) {
2346
- if (this.qe !== 0) {
2347
- this.Me.dispose(false);
2358
+ if (this.Fe !== 0) {
2359
+ this.qe.dispose(false);
2360
+ this.Ke = [];
2361
+ this.De = [];
2348
2362
  this.Ge = [];
2349
- this.Ve = [];
2350
- this.Be = [];
2351
- this.qe = 0;
2352
- this.ze && (this.ze = []);
2363
+ this.Fe = 0;
2353
2364
  this.Ue && (this.Ue = []);
2365
+ this.Je && (this.Je = []);
2354
2366
  }
2355
- if (this.Je && !this.Be[0]) {
2356
- this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
2367
+ if (this.Xe && !this.Ge[0]) {
2368
+ this.Ge[0] = runWithOwner((this.Ke[0] = createOwner()), this.Xe);
2357
2369
  }
2358
- } else if (this.qe === 0) {
2359
- if (this.Ge[0]) this.Ge[0].dispose();
2360
- this.Be = new Array(t);
2370
+ } else if (this.Fe === 0) {
2371
+ if (this.Ke[0]) this.Ke[0].dispose();
2372
+ this.Ge = new Array(t);
2361
2373
  for (r = 0; r < t; r++) {
2362
- this.Ve[r] = e[r];
2363
- this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
2374
+ this.De[r] = e[r];
2375
+ this.Ge[r] = runWithOwner((this.Ke[r] = createOwner()), i);
2364
2376
  }
2365
- this.qe = t;
2377
+ this.Fe = t;
2366
2378
  } else {
2367
2379
  let s,
2368
2380
  o,
@@ -2373,144 +2385,144 @@ function updateKeyedMap() {
2373
2385
  a,
2374
2386
  d = new Array(t),
2375
2387
  p = new Array(t),
2376
- h = this.ze ? new Array(t) : undefined,
2377
- y = this.Ue ? new Array(t) : undefined;
2388
+ h = this.Ue ? new Array(t) : undefined,
2389
+ y = this.Je ? new Array(t) : undefined;
2378
2390
  for (
2379
- s = 0, o = Math.min(this.qe, t);
2380
- s < o && (this.Ve[s] === e[s] || (this.ze && compare(this.Ke, this.Ve[s], e[s])));
2391
+ s = 0, o = Math.min(this.Fe, t);
2392
+ s < o && (this.De[s] === e[s] || (this.Ue && compare(this.ze, this.De[s], e[s])));
2381
2393
  s++
2382
2394
  ) {
2383
- if (this.ze) setSignal(this.ze[s], e[s]);
2395
+ if (this.Ue) setSignal(this.Ue[s], e[s]);
2384
2396
  }
2385
2397
  for (
2386
- o = this.qe - 1, u = t - 1;
2398
+ o = this.Fe - 1, u = t - 1;
2387
2399
  o >= s &&
2388
2400
  u >= s &&
2389
- (this.Ve[o] === e[u] || (this.ze && compare(this.Ke, this.Ve[o], e[u])));
2401
+ (this.De[o] === e[u] || (this.Ue && compare(this.ze, this.De[o], e[u])));
2390
2402
  o--, u--
2391
2403
  ) {
2392
- d[u] = this.Be[o];
2393
- p[u] = this.Ge[o];
2394
- h && (h[u] = this.ze[o]);
2395
- y && (y[u] = this.Ue[o]);
2404
+ d[u] = this.Ge[o];
2405
+ p[u] = this.Ke[o];
2406
+ h && (h[u] = this.Ue[o]);
2407
+ y && (y[u] = this.Je[o]);
2396
2408
  }
2397
2409
  c = new Map();
2398
2410
  a = new Array(u + 1);
2399
2411
  for (r = u; r >= s; r--) {
2400
2412
  f = e[r];
2401
- l = this.Ke ? this.Ke(f) : f;
2413
+ l = this.ze ? this.ze(f) : f;
2402
2414
  n = c.get(l);
2403
2415
  a[r] = n === undefined ? -1 : n;
2404
2416
  c.set(l, r);
2405
2417
  }
2406
2418
  for (n = s; n <= o; n++) {
2407
- f = this.Ve[n];
2408
- l = this.Ke ? this.Ke(f) : f;
2419
+ f = this.De[n];
2420
+ l = this.ze ? this.ze(f) : f;
2409
2421
  r = c.get(l);
2410
2422
  if (r !== undefined && r !== -1) {
2411
- d[r] = this.Be[n];
2412
- p[r] = this.Ge[n];
2413
- h && (h[r] = this.ze[n]);
2414
- y && (y[r] = this.Ue[n]);
2423
+ d[r] = this.Ge[n];
2424
+ p[r] = this.Ke[n];
2425
+ h && (h[r] = this.Ue[n]);
2426
+ y && (y[r] = this.Je[n]);
2415
2427
  r = a[r];
2416
2428
  c.set(l, r);
2417
- } else this.Ge[n].dispose();
2429
+ } else this.Ke[n].dispose();
2418
2430
  }
2419
2431
  for (r = s; r < t; r++) {
2420
2432
  if (r in d) {
2421
- this.Be[r] = d[r];
2422
- this.Ge[r] = p[r];
2433
+ this.Ge[r] = d[r];
2434
+ this.Ke[r] = p[r];
2423
2435
  if (h) {
2424
- this.ze[r] = h[r];
2425
- setSignal(this.ze[r], e[r]);
2436
+ this.Ue[r] = h[r];
2437
+ setSignal(this.Ue[r], e[r]);
2426
2438
  }
2427
2439
  if (y) {
2428
- this.Ue[r] = y[r];
2429
- setSignal(this.Ue[r], r);
2440
+ this.Je[r] = y[r];
2441
+ setSignal(this.Je[r], r);
2430
2442
  }
2431
2443
  } else {
2432
- this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
2444
+ this.Ge[r] = runWithOwner((this.Ke[r] = createOwner()), i);
2433
2445
  }
2434
2446
  }
2435
- this.Be = this.Be.slice(0, (this.qe = t));
2436
- this.Ve = e.slice(0);
2447
+ this.Ge = this.Ge.slice(0, (this.Fe = t));
2448
+ this.De = e.slice(0);
2437
2449
  }
2438
2450
  });
2439
- return this.Be;
2451
+ return this.Ge;
2440
2452
  }
2441
2453
  function repeat(e, t, n) {
2442
2454
  return updateRepeat.bind({
2443
- Me: createOwner(),
2444
- qe: 0,
2445
- Xe: 0,
2446
- Ye: e,
2447
- De: t,
2455
+ qe: createOwner(),
2456
+ Fe: 0,
2457
+ Ye: 0,
2458
+ Ze: e,
2459
+ Be: t,
2460
+ Ke: [],
2448
2461
  Ge: [],
2449
- Be: [],
2450
- Ze: n?.from,
2451
- Je: n?.fallback
2462
+ $e: n?.from,
2463
+ Xe: n?.fallback
2452
2464
  });
2453
2465
  }
2454
2466
  function updateRepeat() {
2455
- const e = this.Ye();
2456
- const t = this.Ze?.() || 0;
2457
- runWithOwner(this.Me, () => {
2467
+ const e = this.Ze();
2468
+ const t = this.$e?.() || 0;
2469
+ runWithOwner(this.qe, () => {
2458
2470
  if (e === 0) {
2459
- if (this.qe !== 0) {
2460
- this.Me.dispose(false);
2471
+ if (this.Fe !== 0) {
2472
+ this.qe.dispose(false);
2473
+ this.Ke = [];
2461
2474
  this.Ge = [];
2462
- this.Be = [];
2463
- this.qe = 0;
2475
+ this.Fe = 0;
2464
2476
  }
2465
- if (this.Je && !this.Be[0]) {
2466
- this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
2477
+ if (this.Xe && !this.Ge[0]) {
2478
+ this.Ge[0] = runWithOwner((this.Ke[0] = createOwner()), this.Xe);
2467
2479
  }
2468
2480
  return;
2469
2481
  }
2470
2482
  const n = t + e;
2471
- const r = this.Xe + this.qe;
2472
- if (this.qe === 0 && this.Ge[0]) this.Ge[0].dispose();
2473
- for (let e = n; e < r; e++) this.Ge[e - this.Xe].dispose();
2474
- if (this.Xe < t) {
2475
- let e = this.Xe;
2476
- while (e < t && e < this.qe) this.Ge[e++].dispose();
2477
- this.Ge.splice(0, t - this.Xe);
2478
- this.Be.splice(0, t - this.Xe);
2479
- } else if (this.Xe > t) {
2480
- let n = r - this.Xe - 1;
2481
- let i = this.Xe - t;
2482
- this.Ge.length = this.Be.length = e;
2483
+ const r = this.Ye + this.Fe;
2484
+ if (this.Fe === 0 && this.Ke[0]) this.Ke[0].dispose();
2485
+ for (let e = n; e < r; e++) this.Ke[e - this.Ye].dispose();
2486
+ if (this.Ye < t) {
2487
+ let e = this.Ye;
2488
+ while (e < t && e < this.Fe) this.Ke[e++].dispose();
2489
+ this.Ke.splice(0, t - this.Ye);
2490
+ this.Ge.splice(0, t - this.Ye);
2491
+ } else if (this.Ye > t) {
2492
+ let n = r - this.Ye - 1;
2493
+ let i = this.Ye - t;
2494
+ this.Ke.length = this.Ge.length = e;
2483
2495
  while (n >= i) {
2496
+ this.Ke[n] = this.Ke[n - i];
2484
2497
  this.Ge[n] = this.Ge[n - i];
2485
- this.Be[n] = this.Be[n - i];
2486
2498
  n--;
2487
2499
  }
2488
2500
  for (let e = 0; e < i; e++) {
2489
- this.Be[e] = runWithOwner((this.Ge[e] = createOwner()), () => this.De(e + t));
2501
+ this.Ge[e] = runWithOwner((this.Ke[e] = createOwner()), () => this.Be(e + t));
2490
2502
  }
2491
2503
  }
2492
2504
  for (let e = r; e < n; e++) {
2493
- this.Be[e - t] = runWithOwner((this.Ge[e - t] = createOwner()), () => this.De(e));
2505
+ this.Ge[e - t] = runWithOwner((this.Ke[e - t] = createOwner()), () => this.Be(e));
2494
2506
  }
2495
- this.Be = this.Be.slice(0, e);
2496
- this.Xe = t;
2497
- this.qe = e;
2507
+ this.Ge = this.Ge.slice(0, e);
2508
+ this.Ye = t;
2509
+ this.Fe = e;
2498
2510
  });
2499
- return this.Be;
2511
+ return this.Ge;
2500
2512
  }
2501
2513
  function compare(e, t, n) {
2502
2514
  return e ? e(t) === e(n) : true;
2503
2515
  }
2504
2516
  function boundaryComputed(e, t) {
2505
2517
  const n = computed(e, undefined, { lazy: true });
2506
- n.be = (e, t) => {
2518
+ n._e = (e, t) => {
2507
2519
  const r = e !== undefined ? e : n.ce;
2508
2520
  const i = t !== undefined ? t : n.Y;
2509
- n.ce &= ~n.$e;
2510
- n.oe.notify(n, n.$e, r, i);
2521
+ n.ce &= ~n.et;
2522
+ n.oe.notify(n, n.et, r, i);
2511
2523
  };
2512
- n.$e = t;
2513
- n.Qe = true;
2524
+ n.et = t;
2525
+ n.ve = true;
2514
2526
  recompute(n, true);
2515
2527
  return n;
2516
2528
  }
@@ -2524,36 +2536,36 @@ function createBoundChildren(e, t, n, r) {
2524
2536
  });
2525
2537
  }
2526
2538
  class CollectionQueue extends Queue {
2527
- et;
2528
- tt = new Set();
2529
- nt = signal(false, { pureWrite: true });
2530
- rt = false;
2539
+ tt;
2540
+ nt = new Set();
2541
+ rt = signal(false, { pureWrite: true });
2542
+ it = false;
2531
2543
  constructor(e) {
2532
2544
  super();
2533
- this.et = e;
2545
+ this.tt = e;
2534
2546
  }
2535
2547
  run(e) {
2536
- if (!e || read(this.nt)) return;
2548
+ if (!e || read(this.rt)) return;
2537
2549
  return super.run(e);
2538
2550
  }
2539
2551
  notify(e, t, n, r) {
2540
- if (!(t & this.et) || (this.et & l && this.rt)) return super.notify(e, t, n, r);
2541
- if (n & this.et) {
2552
+ if (!(t & this.tt) || (this.tt & l && this.it)) return super.notify(e, t, n, r);
2553
+ if (n & this.tt) {
2542
2554
  const t = r?.source || e.Y?.source;
2543
2555
  if (t) {
2544
- const e = this.tt.size === 0;
2545
- this.tt.add(t);
2546
- if (e) setSignal(this.nt, true);
2556
+ const e = this.nt.size === 0;
2557
+ this.nt.add(t);
2558
+ if (e) setSignal(this.rt, true);
2547
2559
  }
2548
2560
  }
2549
- t &= ~this.et;
2561
+ t &= ~this.tt;
2550
2562
  return t ? super.notify(e, t, n, r) : true;
2551
2563
  }
2552
2564
  checkSources() {
2553
- for (const e of this.tt) {
2554
- if (!(e.ce & this.et)) this.tt.delete(e);
2565
+ for (const e of this.nt) {
2566
+ if (!(e.ce & this.tt)) this.nt.delete(e);
2555
2567
  }
2556
- if (!this.tt.size) setSignal(this.nt, false);
2568
+ if (!this.nt.size) setSignal(this.rt, false);
2557
2569
  }
2558
2570
  }
2559
2571
  function createCollectionBoundary(e, t, n) {
@@ -2561,10 +2573,10 @@ function createCollectionBoundary(e, t, n) {
2561
2573
  const i = new CollectionQueue(e);
2562
2574
  const s = createBoundChildren(r, t, i, e);
2563
2575
  const o = computed(() => {
2564
- if (!read(i.nt)) {
2576
+ if (!read(i.rt)) {
2565
2577
  const e = read(s);
2566
- if (!untrack(() => read(i.nt))) {
2567
- i.rt = true;
2578
+ if (!untrack(() => read(i.rt))) {
2579
+ i.it = true;
2568
2580
  return e;
2569
2581
  }
2570
2582
  }
@@ -2577,10 +2589,10 @@ function createLoadBoundary(e, t) {
2577
2589
  }
2578
2590
  function createErrorBoundary(e, t) {
2579
2591
  return createCollectionBoundary(c, e, e => {
2580
- let n = e.tt.values().next().value;
2592
+ let n = e.nt.values().next().value;
2581
2593
  const r = n.Y?.cause ?? n.Y;
2582
2594
  return t(r, () => {
2583
- for (const t of e.tt) recompute(t);
2595
+ for (const t of e.nt) recompute(t);
2584
2596
  schedule();
2585
2597
  });
2586
2598
  });
@@ -2673,6 +2685,7 @@ exports.merge = merge;
2673
2685
  exports.omit = omit;
2674
2686
  exports.onCleanup = onCleanup;
2675
2687
  exports.onSettled = onSettled;
2688
+ exports.peekNextChildId = peekNextChildId;
2676
2689
  exports.pending = pending;
2677
2690
  exports.reconcile = reconcile;
2678
2691
  exports.refresh = refresh;