@solidjs/signals 0.4.0 → 0.4.1

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
@@ -39,20 +39,20 @@ function schedule() {
39
39
  if (scheduled)
40
40
  return;
41
41
  scheduled = true;
42
- if (!globalQueue.J)
42
+ if (!globalQueue.K)
43
43
  queueMicrotask(flush);
44
44
  }
45
45
  var pureQueue = [];
46
46
  var Queue = class {
47
47
  o = null;
48
- J = false;
49
- K = [[], []];
50
- E = [];
48
+ K = false;
49
+ L = [[], []];
50
+ F = [];
51
51
  created = clock;
52
52
  enqueue(type, fn) {
53
53
  pureQueue.push(fn);
54
54
  if (type)
55
- this.K[type - 1].push(fn);
55
+ this.L[type - 1].push(fn);
56
56
  schedule();
57
57
  }
58
58
  run(type) {
@@ -60,19 +60,19 @@ var Queue = class {
60
60
  pureQueue.length && runQueue(pureQueue, type);
61
61
  pureQueue = [];
62
62
  return;
63
- } else if (this.K[type - 1].length) {
64
- const effects = this.K[type - 1];
65
- this.K[type - 1] = [];
63
+ } else if (this.L[type - 1].length) {
64
+ const effects = this.L[type - 1];
65
+ this.L[type - 1] = [];
66
66
  runQueue(effects, type);
67
67
  }
68
- for (let i = 0; i < this.E.length; i++) {
69
- this.E[i].run(type);
68
+ for (let i = 0; i < this.F.length; i++) {
69
+ this.F[i].run(type);
70
70
  }
71
71
  }
72
72
  flush() {
73
- if (this.J)
73
+ if (this.K)
74
74
  return;
75
- this.J = true;
75
+ this.K = true;
76
76
  try {
77
77
  this.run(EFFECT_PURE);
78
78
  incrementClock();
@@ -80,17 +80,17 @@ var Queue = class {
80
80
  this.run(EFFECT_RENDER);
81
81
  this.run(EFFECT_USER);
82
82
  } finally {
83
- this.J = false;
83
+ this.K = false;
84
84
  }
85
85
  }
86
86
  addChild(child) {
87
- this.E.push(child);
87
+ this.F.push(child);
88
88
  child.o = this;
89
89
  }
90
90
  removeChild(child) {
91
- const index = this.E.indexOf(child);
91
+ const index = this.F.indexOf(child);
92
92
  if (index >= 0)
93
- this.E.splice(index, 1);
93
+ this.F.splice(index, 1);
94
94
  }
95
95
  notify(...args) {
96
96
  if (this.o)
@@ -160,20 +160,20 @@ var Owner = class {
160
160
  let head = self ? this.t || this.o : this, current = this.m, next = null;
161
161
  while (current && current.o === this) {
162
162
  current.dispose(true);
163
- current.y();
163
+ current.z();
164
164
  next = current.m;
165
165
  current.m = null;
166
166
  current = next;
167
167
  }
168
168
  this.W = 0;
169
169
  if (self)
170
- this.y();
170
+ this.z();
171
171
  if (current)
172
172
  current.t = !self ? this : this.t;
173
173
  if (head)
174
174
  head.m = current;
175
175
  }
176
- y() {
176
+ z() {
177
177
  if (this.t)
178
178
  this.t.m = null;
179
179
  this.o = null;
@@ -274,45 +274,45 @@ var Computation = class extends Owner {
274
274
  c = null;
275
275
  d = null;
276
276
  g;
277
- F;
278
- z;
277
+ G;
278
+ A;
279
279
  // Used in __DEV__ mode, hopefully removed in production
280
280
  ca;
281
281
  // Using false is an optimization as an alternative to _equals: () => false
282
282
  // which could enable more efficient DIRTY notification
283
- R = isEqual;
283
+ S = isEqual;
284
284
  X;
285
285
  _ = false;
286
286
  /** Whether the computation is an error or has ancestors that are unresolved */
287
287
  f = 0;
288
288
  /** Which flags raised by sources are handled, vs. being passed through. */
289
- S = DEFAULT_FLAGS;
290
- A = -1;
291
- w = false;
289
+ T = DEFAULT_FLAGS;
290
+ B = -1;
291
+ x = false;
292
292
  constructor(initialValue, compute2, options) {
293
293
  super(options == null ? void 0 : options.id, compute2 === null);
294
- this.z = compute2;
294
+ this.A = compute2;
295
295
  this.a = compute2 ? STATE_DIRTY : STATE_CLEAN;
296
296
  this.f = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
297
297
  this.g = initialValue;
298
298
  if ((options == null ? void 0 : options.equals) !== void 0)
299
- this.R = options.equals;
299
+ this.S = options.equals;
300
300
  if (options == null ? void 0 : options.pureWrite)
301
301
  this._ = true;
302
302
  if (options == null ? void 0 : options.unobserved)
303
303
  this.X = options == null ? void 0 : options.unobserved;
304
304
  }
305
305
  Y() {
306
- if (this.z) {
307
- if (this.f & ERROR_BIT && this.A <= getClock())
306
+ if (this.A) {
307
+ if (this.f & ERROR_BIT && this.B <= getClock())
308
308
  update(this);
309
309
  else
310
- this.x();
310
+ this.y();
311
311
  }
312
312
  track(this);
313
313
  newFlags |= this.f & ~currentMask;
314
314
  if (this.f & ERROR_BIT) {
315
- throw this.F;
315
+ throw this.G;
316
316
  } else {
317
317
  return this.g;
318
318
  }
@@ -332,10 +332,10 @@ var Computation = class extends Owner {
332
332
  * before continuing
333
333
  */
334
334
  wait() {
335
- if (this.z && this.f & ERROR_BIT && this.A <= getClock()) {
335
+ if (this.A && this.f & ERROR_BIT && this.B <= getClock()) {
336
336
  update(this);
337
337
  } else {
338
- this.x();
338
+ this.y();
339
339
  }
340
340
  track(this);
341
341
  if ((notStale || this.f & UNINITIALIZED_BIT) && this.f & LOADING_BIT) {
@@ -350,14 +350,14 @@ var Computation = class extends Owner {
350
350
  write(value, flags = 0, raw = false) {
351
351
  const newValue = !raw && typeof value === "function" ? value(this.g) : value;
352
352
  const valueChanged = newValue !== UNCHANGED && (!!(this.f & UNINITIALIZED_BIT) || // this._stateFlags & LOADING_BIT & ~flags ||
353
- this.R === false || !this.R(this.g, newValue));
353
+ this.S === false || !this.S(this.g, newValue));
354
354
  if (valueChanged) {
355
355
  this.g = newValue;
356
- this.F = void 0;
356
+ this.G = void 0;
357
357
  }
358
358
  const changedFlagsMask = this.f ^ flags, changedFlags = changedFlagsMask & flags;
359
359
  this.f = flags;
360
- this.A = getClock() + 1;
360
+ this.B = getClock() + 1;
361
361
  if (this.d) {
362
362
  for (let i = 0; i < this.d.length; i++) {
363
363
  if (valueChanged) {
@@ -373,9 +373,9 @@ var Computation = class extends Owner {
373
373
  * Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
374
374
  */
375
375
  r(state, skipQueue) {
376
- if (this.a >= state && !this.w)
376
+ if (this.a >= state && !this.x)
377
377
  return;
378
- this.w = !!skipQueue;
378
+ this.x = !!skipQueue;
379
379
  this.a = state;
380
380
  if (this.d) {
381
381
  for (let i = 0; i < this.d.length; i++) {
@@ -392,7 +392,7 @@ var Computation = class extends Owner {
392
392
  Z(mask, newFlags2) {
393
393
  if (this.a >= STATE_DIRTY)
394
394
  return;
395
- if (mask & this.S) {
395
+ if (mask & this.T) {
396
396
  this.r(STATE_DIRTY);
397
397
  return;
398
398
  }
@@ -411,8 +411,8 @@ var Computation = class extends Owner {
411
411
  }
412
412
  }
413
413
  }
414
- L(error) {
415
- this.F = error;
414
+ M(error) {
415
+ this.G = error;
416
416
  this.write(UNCHANGED, this.f & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
417
417
  }
418
418
  /**
@@ -422,8 +422,8 @@ var Computation = class extends Owner {
422
422
  *
423
423
  * This function will ensure that the value and states we read from the computation are up to date
424
424
  */
425
- x() {
426
- if (!this.z) {
425
+ y() {
426
+ if (!this.A) {
427
427
  return;
428
428
  }
429
429
  if (this.a === STATE_DISPOSED) {
@@ -435,7 +435,7 @@ var Computation = class extends Owner {
435
435
  let observerFlags = 0;
436
436
  if (this.a === STATE_CHECK) {
437
437
  for (let i = 0; i < this.c.length; i++) {
438
- this.c[i].x();
438
+ this.c[i].y();
439
439
  observerFlags |= this.c[i].f;
440
440
  if (this.a === STATE_DIRTY) {
441
441
  break;
@@ -452,12 +452,12 @@ var Computation = class extends Owner {
452
452
  /**
453
453
  * Remove ourselves from the owner graph and the computation graph
454
454
  */
455
- y() {
455
+ z() {
456
456
  if (this.a === STATE_DISPOSED)
457
457
  return;
458
458
  if (this.c)
459
459
  removeSourceObservers(this, 0);
460
- super.y();
460
+ super.z();
461
461
  }
462
462
  };
463
463
  function track(computation) {
@@ -470,7 +470,7 @@ function track(computation) {
470
470
  newSources.push(computation);
471
471
  }
472
472
  if (updateCheck) {
473
- updateCheck.g = computation.A > currentObserver.A;
473
+ updateCheck.g = computation.B > currentObserver.B;
474
474
  }
475
475
  }
476
476
  }
@@ -482,13 +482,13 @@ function update(node) {
482
482
  try {
483
483
  node.dispose(false);
484
484
  node.emptyDisposal();
485
- const result = compute(node, node.z, node);
485
+ const result = compute(node, node.A, node);
486
486
  node.write(result, newFlags, true);
487
487
  } catch (error) {
488
488
  if (error instanceof NotReadyError) {
489
489
  node.write(UNCHANGED, newFlags | LOADING_BIT | node.f & UNINITIALIZED_BIT);
490
490
  } else {
491
- node.L(error);
491
+ node.M(error);
492
492
  }
493
493
  } finally {
494
494
  if (newSources) {
@@ -518,7 +518,7 @@ function update(node) {
518
518
  newSources = prevSources;
519
519
  newSourcesIndex = prevSourcesIndex;
520
520
  newFlags = prevFlags;
521
- node.A = getClock() + 1;
521
+ node.B = getClock() + 1;
522
522
  node.a = STATE_CLEAN;
523
523
  }
524
524
  }
@@ -583,7 +583,7 @@ function isPending(fn, loadingValue) {
583
583
  if (!currentObserver)
584
584
  return pendingCheck(fn, loadingValue);
585
585
  const c = new Computation(void 0, () => pendingCheck(fn, loadingValue));
586
- c.S |= LOADING_BIT;
586
+ c.T |= LOADING_BIT;
587
587
  return c.read();
588
588
  }
589
589
  function latest(fn, fallback) {
@@ -616,7 +616,7 @@ function runWithObserver(observer, run) {
616
616
  newFlags | LOADING_BIT | observer.f & UNINITIALIZED_BIT
617
617
  );
618
618
  } else {
619
- observer.L(error);
619
+ observer.M(error);
620
620
  }
621
621
  } finally {
622
622
  if (newSources) {
@@ -645,7 +645,7 @@ function runWithObserver(observer, run) {
645
645
  function compute(owner, fn, observer) {
646
646
  const prevOwner = setOwner(owner), prevObserver = currentObserver, prevMask = currentMask, prevNotStale = notStale;
647
647
  currentObserver = observer;
648
- currentMask = (observer == null ? void 0 : observer.S) ?? DEFAULT_FLAGS;
648
+ currentMask = (observer == null ? void 0 : observer.T) ?? DEFAULT_FLAGS;
649
649
  notStale = true;
650
650
  try {
651
651
  return fn(observer ? observer.g : void 0);
@@ -659,23 +659,23 @@ function compute(owner, fn, observer) {
659
659
 
660
660
  // src/core/effect.ts
661
661
  var Effect = class extends Computation {
662
- T;
663
- M;
664
- B;
665
- U = false;
662
+ U;
666
663
  N;
664
+ C;
665
+ V = false;
666
+ O;
667
667
  s;
668
668
  constructor(initialValue, compute2, effect, error, options) {
669
669
  super(initialValue, compute2, options);
670
- this.T = effect;
671
- this.M = error;
672
- this.N = initialValue;
670
+ this.U = effect;
671
+ this.N = error;
672
+ this.O = initialValue;
673
673
  this.s = (options == null ? void 0 : options.render) ? EFFECT_RENDER : EFFECT_USER;
674
674
  if (this.s === EFFECT_RENDER) {
675
- this.z = (p) => getClock() > this.h.created && !(this.f & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
675
+ this.A = (p) => getClock() > this.h.created && !(this.f & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
676
676
  }
677
- this.x();
678
- !(options == null ? void 0 : options.defer) && (this.s === EFFECT_USER ? this.h.enqueue(this.s, this.V.bind(this)) : this.V(this.s));
677
+ this.y();
678
+ !(options == null ? void 0 : options.defer) && (this.s === EFFECT_USER ? this.h.enqueue(this.s, this.u.bind(this)) : this.u(this.s));
679
679
  }
680
680
  write(value, flags = 0) {
681
681
  if (this.a == STATE_DIRTY) {
@@ -688,26 +688,26 @@ var Effect = class extends Computation {
688
688
  if (value === UNCHANGED)
689
689
  return this.g;
690
690
  this.g = value;
691
- this.U = true;
691
+ this.V = true;
692
692
  return value;
693
693
  }
694
694
  r(state, skipQueue) {
695
695
  if (this.a >= state || skipQueue)
696
696
  return;
697
697
  if (this.a === STATE_CLEAN)
698
- this.h.enqueue(this.s, this.V.bind(this));
698
+ this.h.enqueue(this.s, this.u.bind(this));
699
699
  this.a = state;
700
700
  }
701
- L(error) {
702
- this.F = error;
701
+ M(error) {
702
+ this.G = error;
703
703
  this.h.notify(this, LOADING_BIT, 0);
704
704
  this.f = ERROR_BIT;
705
705
  if (this.s === EFFECT_USER) {
706
706
  try {
707
- return this.M ? this.M(error, () => {
707
+ return this.N ? this.N(error, () => {
708
708
  var _a;
709
- (_a = this.B) == null ? void 0 : _a.call(this);
710
- this.B = void 0;
709
+ (_a = this.C) == null ? void 0 : _a.call(this);
710
+ this.C = void 0;
711
711
  }) : console.error(error);
712
712
  } catch (e) {
713
713
  error = e;
@@ -716,51 +716,51 @@ var Effect = class extends Computation {
716
716
  if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
717
717
  throw error;
718
718
  }
719
- y() {
719
+ z() {
720
720
  var _a;
721
721
  if (this.a === STATE_DISPOSED)
722
722
  return;
723
- this.T = void 0;
723
+ this.U = void 0;
724
+ this.O = void 0;
724
725
  this.N = void 0;
725
- this.M = void 0;
726
- (_a = this.B) == null ? void 0 : _a.call(this);
727
- this.B = void 0;
728
- super.y();
726
+ (_a = this.C) == null ? void 0 : _a.call(this);
727
+ this.C = void 0;
728
+ super.z();
729
729
  }
730
- V(type) {
730
+ u(type) {
731
731
  var _a;
732
732
  if (type) {
733
- if (this.U && this.a !== STATE_DISPOSED) {
734
- (_a = this.B) == null ? void 0 : _a.call(this);
733
+ if (this.V && this.a !== STATE_DISPOSED) {
734
+ (_a = this.C) == null ? void 0 : _a.call(this);
735
735
  try {
736
- this.B = this.T(this.g, this.N);
736
+ this.C = this.U(this.g, this.O);
737
737
  } catch (e) {
738
738
  if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
739
739
  throw e;
740
740
  } finally {
741
- this.N = this.g;
742
- this.U = false;
741
+ this.O = this.g;
742
+ this.V = false;
743
743
  }
744
744
  }
745
745
  } else
746
746
  this.a !== STATE_CLEAN && runTop(this);
747
747
  }
748
748
  };
749
- function runComputation() {
750
- this.a !== STATE_CLEAN && runTop(this);
751
- }
752
749
  var EagerComputation = class extends Computation {
753
750
  constructor(initialValue, compute2, options) {
754
751
  super(initialValue, compute2, options);
755
- !(options == null ? void 0 : options.defer) && this.x();
752
+ !(options == null ? void 0 : options.defer) && this.y();
756
753
  }
757
754
  r(state, skipQueue) {
758
- if (this.a >= state && !this.w)
755
+ if (this.a >= state && !this.x)
759
756
  return;
760
- if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
761
- this.h.enqueue(EFFECT_PURE, runComputation.bind(this));
757
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.x))
758
+ this.h.enqueue(EFFECT_PURE, this.u.bind(this));
762
759
  super.r(state, skipQueue);
763
760
  }
761
+ u() {
762
+ this.a !== STATE_CLEAN && runTop(this);
763
+ }
764
764
  };
765
765
  var FirewallComputation = class extends Computation {
766
766
  firewall = true;
@@ -768,12 +768,15 @@ var FirewallComputation = class extends Computation {
768
768
  super(void 0, compute2);
769
769
  }
770
770
  r(state, skipQueue) {
771
- if (this.a >= state && !this.w)
771
+ if (this.a >= state && !this.x)
772
772
  return;
773
- if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
774
- this.h.enqueue(EFFECT_PURE, runComputation.bind(this));
773
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.x))
774
+ this.h.enqueue(EFFECT_PURE, this.u.bind(this));
775
775
  super.r(state, true);
776
- this.w = !!skipQueue;
776
+ this.x = !!skipQueue;
777
+ }
778
+ u() {
779
+ this.a !== STATE_CLEAN && runTop(this);
777
780
  }
778
781
  };
779
782
  function runTop(node) {
@@ -785,7 +788,7 @@ function runTop(node) {
785
788
  }
786
789
  for (let i = ancestors.length - 1; i >= 0; i--) {
787
790
  if (ancestors[i].a !== STATE_DISPOSED)
788
- ancestors[i].x();
791
+ ancestors[i].y();
789
792
  }
790
793
  }
791
794
 
@@ -858,7 +861,7 @@ function createAsync(compute2, value, options) {
858
861
  (error) => {
859
862
  if (abort)
860
863
  return;
861
- node.L(error);
864
+ node.M(error);
862
865
  }
863
866
  );
864
867
  } else {
@@ -884,7 +887,7 @@ function createAsync(compute2, value, options) {
884
887
  read.refresh = () => {
885
888
  node.a = STATE_DIRTY;
886
889
  refreshing = true;
887
- node.x();
890
+ node.y();
888
891
  };
889
892
  return read;
890
893
  }
@@ -1593,53 +1596,53 @@ function omit(props, ...keys) {
1593
1596
  function mapArray(list, map, options) {
1594
1597
  const keyFn = typeof (options == null ? void 0 : options.keyed) === "function" ? options.keyed : void 0;
1595
1598
  return updateKeyedMap.bind({
1596
- G: new Owner(),
1599
+ H: new Owner(),
1597
1600
  i: 0,
1598
1601
  $: list,
1599
- u: [],
1600
- C: map,
1602
+ w: [],
1603
+ D: map,
1601
1604
  e: [],
1602
1605
  b: [],
1603
- D: keyFn,
1606
+ E: keyFn,
1604
1607
  j: keyFn || (options == null ? void 0 : options.keyed) === false ? [] : void 0,
1605
1608
  k: map.length > 1 ? [] : void 0,
1606
- H: options == null ? void 0 : options.fallback
1609
+ I: options == null ? void 0 : options.fallback
1607
1610
  });
1608
1611
  }
1609
1612
  var pureOptions = { pureWrite: true };
1610
1613
  function updateKeyedMap() {
1611
1614
  const newItems = this.$() || [], newLen = newItems.length;
1612
1615
  newItems[$TRACK];
1613
- runWithOwner(this.G, () => {
1616
+ runWithOwner(this.H, () => {
1614
1617
  let i, j, mapper = this.j ? () => {
1615
1618
  this.j[j] = new Computation(newItems[j], null, pureOptions);
1616
1619
  this.k && (this.k[j] = new Computation(j, null, pureOptions));
1617
- return this.C(
1620
+ return this.D(
1618
1621
  Computation.prototype.read.bind(this.j[j]),
1619
1622
  this.k ? Computation.prototype.read.bind(this.k[j]) : void 0
1620
1623
  );
1621
1624
  } : this.k ? () => {
1622
1625
  const item = newItems[j];
1623
1626
  this.k[j] = new Computation(j, null, pureOptions);
1624
- return this.C(() => item, Computation.prototype.read.bind(this.k[j]));
1627
+ return this.D(() => item, Computation.prototype.read.bind(this.k[j]));
1625
1628
  } : () => {
1626
1629
  const item = newItems[j];
1627
- return this.C(() => item);
1630
+ return this.D(() => item);
1628
1631
  };
1629
1632
  if (newLen === 0) {
1630
1633
  if (this.i !== 0) {
1631
- this.G.dispose(false);
1634
+ this.H.dispose(false);
1632
1635
  this.b = [];
1633
- this.u = [];
1636
+ this.w = [];
1634
1637
  this.e = [];
1635
1638
  this.i = 0;
1636
1639
  this.j && (this.j = []);
1637
1640
  this.k && (this.k = []);
1638
1641
  }
1639
- if (this.H && !this.e[0]) {
1642
+ if (this.I && !this.e[0]) {
1640
1643
  this.e[0] = compute(
1641
1644
  this.b[0] = new Owner(),
1642
- this.H,
1645
+ this.I,
1643
1646
  null
1644
1647
  );
1645
1648
  }
@@ -1648,17 +1651,17 @@ function updateKeyedMap() {
1648
1651
  this.b[0].dispose();
1649
1652
  this.e = new Array(newLen);
1650
1653
  for (j = 0; j < newLen; j++) {
1651
- this.u[j] = newItems[j];
1654
+ this.w[j] = newItems[j];
1652
1655
  this.e[j] = compute(this.b[j] = new Owner(), mapper, null);
1653
1656
  }
1654
1657
  this.i = newLen;
1655
1658
  } else {
1656
1659
  let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.j ? new Array(newLen) : void 0, tempIndexes = this.k ? new Array(newLen) : void 0;
1657
- for (start = 0, end = Math.min(this.i, newLen); start < end && (this.u[start] === newItems[start] || this.j && compare(this.D, this.u[start], newItems[start])); start++) {
1660
+ for (start = 0, end = Math.min(this.i, newLen); start < end && (this.w[start] === newItems[start] || this.j && compare(this.E, this.w[start], newItems[start])); start++) {
1658
1661
  if (this.j)
1659
1662
  this.j[start].write(newItems[start]);
1660
1663
  }
1661
- for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.u[end] === newItems[newEnd] || this.j && compare(this.D, this.u[end], newItems[newEnd])); end--, newEnd--) {
1664
+ for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.w[end] === newItems[newEnd] || this.j && compare(this.E, this.w[end], newItems[newEnd])); end--, newEnd--) {
1662
1665
  temp[newEnd] = this.e[end];
1663
1666
  tempNodes[newEnd] = this.b[end];
1664
1667
  tempRows && (tempRows[newEnd] = this.j[end]);
@@ -1668,14 +1671,14 @@ function updateKeyedMap() {
1668
1671
  newIndicesNext = new Array(newEnd + 1);
1669
1672
  for (j = newEnd; j >= start; j--) {
1670
1673
  item = newItems[j];
1671
- key = this.D ? this.D(item) : item;
1674
+ key = this.E ? this.E(item) : item;
1672
1675
  i = newIndices.get(key);
1673
1676
  newIndicesNext[j] = i === void 0 ? -1 : i;
1674
1677
  newIndices.set(key, j);
1675
1678
  }
1676
1679
  for (i = start; i <= end; i++) {
1677
- item = this.u[i];
1678
- key = this.D ? this.D(item) : item;
1680
+ item = this.w[i];
1681
+ key = this.E ? this.E(item) : item;
1679
1682
  j = newIndices.get(key);
1680
1683
  if (j !== void 0 && j !== -1) {
1681
1684
  temp[j] = this.e[i];
@@ -1704,40 +1707,40 @@ function updateKeyedMap() {
1704
1707
  }
1705
1708
  }
1706
1709
  this.e = this.e.slice(0, this.i = newLen);
1707
- this.u = newItems.slice(0);
1710
+ this.w = newItems.slice(0);
1708
1711
  }
1709
1712
  });
1710
1713
  return this.e;
1711
1714
  }
1712
1715
  function repeat(count, map, options) {
1713
1716
  return updateRepeat.bind({
1714
- G: new Owner(),
1717
+ H: new Owner(),
1715
1718
  i: 0,
1716
1719
  q: 0,
1717
1720
  aa: count,
1718
- C: map,
1721
+ D: map,
1719
1722
  b: [],
1720
1723
  e: [],
1721
1724
  ba: options == null ? void 0 : options.from,
1722
- H: options == null ? void 0 : options.fallback
1725
+ I: options == null ? void 0 : options.fallback
1723
1726
  });
1724
1727
  }
1725
1728
  function updateRepeat() {
1726
1729
  var _a;
1727
1730
  const newLen = this.aa();
1728
1731
  const from = ((_a = this.ba) == null ? void 0 : _a.call(this)) || 0;
1729
- runWithOwner(this.G, () => {
1732
+ runWithOwner(this.H, () => {
1730
1733
  if (newLen === 0) {
1731
1734
  if (this.i !== 0) {
1732
- this.G.dispose(false);
1735
+ this.H.dispose(false);
1733
1736
  this.b = [];
1734
1737
  this.e = [];
1735
1738
  this.i = 0;
1736
1739
  }
1737
- if (this.H && !this.e[0]) {
1740
+ if (this.I && !this.e[0]) {
1738
1741
  this.e[0] = compute(
1739
1742
  this.b[0] = new Owner(),
1740
- this.H,
1743
+ this.I,
1741
1744
  null
1742
1745
  );
1743
1746
  }
@@ -1767,7 +1770,7 @@ function updateRepeat() {
1767
1770
  for (let i2 = 0; i2 < difference; i2++) {
1768
1771
  this.e[i2] = compute(
1769
1772
  this.b[i2] = new Owner(),
1770
- () => this.C(i2 + from),
1773
+ () => this.D(i2 + from),
1771
1774
  null
1772
1775
  );
1773
1776
  }
@@ -1775,7 +1778,7 @@ function updateRepeat() {
1775
1778
  for (let i = prevTo; i < to; i++) {
1776
1779
  this.e[i - from] = compute(
1777
1780
  this.b[i - from] = new Owner(),
1778
- () => this.C(i),
1781
+ () => this.D(i),
1779
1782
  null
1780
1783
  );
1781
1784
  }
@@ -1791,17 +1794,17 @@ function compare(key, a, b) {
1791
1794
 
1792
1795
  // src/boundaries.ts
1793
1796
  var BoundaryComputation = class extends EagerComputation {
1794
- I;
1797
+ J;
1795
1798
  constructor(compute2, propagationMask) {
1796
1799
  super(void 0, compute2, { defer: true });
1797
- this.I = propagationMask;
1800
+ this.J = propagationMask;
1798
1801
  }
1799
1802
  write(value, flags) {
1800
- super.write(value, flags & ~this.I);
1801
- if (this.I & LOADING_BIT && !(this.f & UNINITIALIZED_BIT)) {
1803
+ super.write(value, flags & ~this.J);
1804
+ if (this.J & LOADING_BIT && !(this.f & UNINITIALIZED_BIT)) {
1802
1805
  flags &= ~LOADING_BIT;
1803
1806
  }
1804
- this.h.notify(this, this.I, flags);
1807
+ this.h.notify(this, this.J, flags);
1805
1808
  return this.g;
1806
1809
  }
1807
1810
  };
@@ -1820,8 +1823,8 @@ function createBoundChildren(owner, fn, queue, mask) {
1820
1823
  }
1821
1824
  var ConditionalQueue = class extends Queue {
1822
1825
  n;
1823
- O = /* @__PURE__ */ new Set();
1824
1826
  P = /* @__PURE__ */ new Set();
1827
+ Q = /* @__PURE__ */ new Set();
1825
1828
  constructor(disabled) {
1826
1829
  super();
1827
1830
  this.n = disabled;
@@ -1835,16 +1838,16 @@ var ConditionalQueue = class extends Queue {
1835
1838
  if (this.n.read()) {
1836
1839
  if (type & LOADING_BIT) {
1837
1840
  if (flags & LOADING_BIT) {
1838
- this.P.add(node);
1841
+ this.Q.add(node);
1839
1842
  type &= ~LOADING_BIT;
1840
- } else if (this.P.delete(node))
1843
+ } else if (this.Q.delete(node))
1841
1844
  type &= ~LOADING_BIT;
1842
1845
  }
1843
1846
  if (type & ERROR_BIT) {
1844
1847
  if (flags & ERROR_BIT) {
1845
- this.O.add(node);
1848
+ this.P.add(node);
1846
1849
  type &= ~ERROR_BIT;
1847
- } else if (this.O.delete(node))
1850
+ } else if (this.P.delete(node))
1848
1851
  type &= ~ERROR_BIT;
1849
1852
  }
1850
1853
  }
@@ -1852,12 +1855,12 @@ var ConditionalQueue = class extends Queue {
1852
1855
  }
1853
1856
  };
1854
1857
  var CollectionQueue = class extends Queue {
1855
- Q;
1858
+ R;
1856
1859
  b = /* @__PURE__ */ new Set();
1857
1860
  n = new Computation(false, null, { pureWrite: true });
1858
1861
  constructor(type) {
1859
1862
  super();
1860
- this.Q = type;
1863
+ this.R = type;
1861
1864
  }
1862
1865
  run(type) {
1863
1866
  if (!type || this.n.read())
@@ -1865,9 +1868,9 @@ var CollectionQueue = class extends Queue {
1865
1868
  return super.run(type);
1866
1869
  }
1867
1870
  notify(node, type, flags) {
1868
- if (!(type & this.Q))
1871
+ if (!(type & this.R))
1869
1872
  return super.notify(node, type, flags);
1870
- if (flags & this.Q) {
1873
+ if (flags & this.R) {
1871
1874
  this.b.add(node);
1872
1875
  if (this.b.size === 1)
1873
1876
  this.n.write(true);
@@ -1876,7 +1879,7 @@ var CollectionQueue = class extends Queue {
1876
1879
  if (this.b.size === 0)
1877
1880
  this.n.write(false);
1878
1881
  }
1879
- type &= ~this.Q;
1882
+ type &= ~this.R;
1880
1883
  return type ? super.notify(node, type, flags) : true;
1881
1884
  }
1882
1885
  };
@@ -1888,12 +1891,12 @@ function createBoundary(fn, condition) {
1888
1891
  const tree = createBoundChildren(owner, fn, queue, 0);
1889
1892
  new EagerComputation(void 0, () => {
1890
1893
  const disabled = queue.n.read();
1891
- tree.I = disabled ? ERROR_BIT | LOADING_BIT : 0;
1894
+ tree.J = disabled ? ERROR_BIT | LOADING_BIT : 0;
1892
1895
  if (!disabled) {
1893
- queue.P.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
1894
- queue.O.forEach((node) => queue.notify(node, ERROR_BIT, ERROR_BIT));
1896
+ queue.Q.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
1897
+ queue.P.forEach((node) => queue.notify(node, ERROR_BIT, ERROR_BIT));
1898
+ queue.Q.clear();
1895
1899
  queue.P.clear();
1896
- queue.O.clear();
1897
1900
  }
1898
1901
  });
1899
1902
  return () => queue.n.read() ? void 0 : tree.read();
@@ -1919,12 +1922,12 @@ function createErrorBoundary(fn, fallback) {
1919
1922
  return createCollectionBoundary(
1920
1923
  ERROR_BIT,
1921
1924
  fn,
1922
- (queue) => fallback(queue.b.values().next().value.F, () => {
1925
+ (queue) => fallback(queue.b.values().next().value.G, () => {
1923
1926
  var _a;
1924
1927
  incrementClock();
1925
1928
  for (let node of queue.b) {
1926
1929
  node.a = STATE_DIRTY;
1927
- (_a = node.h) == null ? void 0 : _a.enqueue(node.s, node);
1930
+ (_a = node.h) == null ? void 0 : _a.enqueue(node.s, node.u.bind(node));
1928
1931
  }
1929
1932
  })
1930
1933
  );