@solidjs/signals 0.4.5 → 0.4.7

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/prod.js CHANGED
@@ -120,7 +120,7 @@ var Queue = class {
120
120
  this.f[0].push.apply(this.f[0], queue.f[0]);
121
121
  this.f[1].push.apply(this.f[1], queue.f[1]);
122
122
  for (let i = 0; i < queue.e.length; i++) {
123
- const og = this.e.find((c) => c.g === queue.e[i].g);
123
+ const og = this.e.find((c) => c.h === queue.e[i].h);
124
124
  if (og)
125
125
  og.merge(queue.e[i]);
126
126
  else
@@ -143,7 +143,7 @@ var Transition = class _Transition {
143
143
  s = /* @__PURE__ */ new Set();
144
144
  R = /* @__PURE__ */ new Set();
145
145
  W = /* @__PURE__ */ new Set();
146
- I = false;
146
+ J = false;
147
147
  f = [[], []];
148
148
  u = /* @__PURE__ */ new Map();
149
149
  E = [];
@@ -219,7 +219,7 @@ var Transition = class _Transition {
219
219
  this.f[1].push.apply(this.f[1], queue.f[1]);
220
220
  this.E.push.apply(this.E, queue.E);
221
221
  for (let i = 0; i < queue.e.length; i++) {
222
- const og = this.e.find((c) => c.g === queue.e[i].g);
222
+ const og = this.e.find((c) => c.h === queue.e[i].h);
223
223
  if (og)
224
224
  og.merge(queue.e[i]);
225
225
  else
@@ -234,9 +234,9 @@ var Transition = class _Transition {
234
234
  queueMicrotask(() => this.flush());
235
235
  }
236
236
  runTransition(fn, force = false) {
237
- if (this.I) {
238
- if (this.I instanceof _Transition)
239
- return this.I.runTransition(fn, force);
237
+ if (this.J) {
238
+ if (this.J instanceof _Transition)
239
+ return this.J.runTransition(fn, force);
240
240
  if (!force)
241
241
  throw new Error("Transition already completed");
242
242
  fn();
@@ -260,12 +260,12 @@ var Transition = class _Transition {
260
260
  }
261
261
  }
262
262
  addOptimistic(fn) {
263
- if (fn.k && fn.k !== this) {
264
- mergeTransitions(fn.k, this);
265
- ActiveTransition = fn.k;
263
+ if (fn.j && fn.j !== this) {
264
+ mergeTransitions(fn.j, this);
265
+ ActiveTransition = fn.j;
266
266
  return;
267
267
  }
268
- fn.k = this;
268
+ fn.j = this;
269
269
  this.W.add(fn);
270
270
  }
271
271
  };
@@ -274,12 +274,12 @@ function transition(fn) {
274
274
  queueMicrotask(() => t.runTransition(() => fn((fn2) => t.runTransition(fn2))));
275
275
  }
276
276
  function cloneGraph(node) {
277
- if (node.k) {
278
- if (node.k !== ActiveTransition) {
279
- mergeTransitions(node.k, ActiveTransition);
280
- ActiveTransition = node.k;
277
+ if (node.j) {
278
+ if (node.j !== ActiveTransition) {
279
+ mergeTransitions(node.j, ActiveTransition);
280
+ ActiveTransition = node.j;
281
281
  }
282
- return node.k.a.get(node);
282
+ return node.j.a.get(node);
283
283
  }
284
284
  const clone = Object.create(Object.getPrototypeOf(node));
285
285
  Object.assign(clone, node, {
@@ -287,10 +287,12 @@ function cloneGraph(node) {
287
287
  r: null,
288
288
  b: null,
289
289
  a: node.a ? [...node.a] : null,
290
- g: node
290
+ h: node
291
291
  });
292
+ if (clone.F)
293
+ clone.g |= UNINITIALIZED_BIT;
292
294
  ActiveTransition.a.set(node, clone);
293
- node.k = ActiveTransition;
295
+ node.j = ActiveTransition;
294
296
  if (node.a) {
295
297
  for (let i = 0; i < node.a.length; i++)
296
298
  node.a[i].b.push(clone);
@@ -298,7 +300,7 @@ function cloneGraph(node) {
298
300
  if (node.b) {
299
301
  clone.b = [];
300
302
  for (let i = 0, length = node.b.length; i < length; i++) {
301
- !node.b[i].g && clone.b.push(cloneGraph(node.b[i]));
303
+ !node.b[i].h && clone.b.push(cloneGraph(node.b[i]));
302
304
  }
303
305
  }
304
306
  return clone;
@@ -311,7 +313,7 @@ function replaceSourceObservers(node, transition2) {
311
313
  transitionSource = transition2.a.get(node.a[i]);
312
314
  source = transitionSource || node.a[i];
313
315
  if (source.b && (swap = source.b.indexOf(node)) !== -1) {
314
- source.b[swap] = transitionSource ? node.g : source.b[source.b.length - 1];
316
+ source.b[swap] = transitionSource ? node.h : source.b[source.b.length - 1];
315
317
  !transitionSource && source.b.pop();
316
318
  }
317
319
  }
@@ -319,15 +321,15 @@ function replaceSourceObservers(node, transition2) {
319
321
  function cloneQueue(queue, parent, clonedQueues) {
320
322
  const clone = Object.create(Object.getPrototypeOf(queue));
321
323
  Object.assign(clone, queue, {
322
- g: queue,
324
+ h: queue,
323
325
  m: parent,
324
326
  e: [],
325
327
  enqueue(type, fn) {
326
328
  ActiveTransition?.enqueue(type, fn);
327
329
  },
328
330
  notify(node, type, flags) {
329
- node = node.g || node;
330
- if (!clone.F || type & LOADING_BIT) {
331
+ node = node.h || node;
332
+ if (!clone.G || type & LOADING_BIT) {
331
333
  type &= ~LOADING_BIT;
332
334
  ActiveTransition?.notify(node, LOADING_BIT, flags);
333
335
  if (!type)
@@ -344,7 +346,7 @@ function cloneQueue(queue, parent, clonedQueues) {
344
346
  }
345
347
  function resolveQueues(children) {
346
348
  for (const child of children) {
347
- const og = child.g;
349
+ const og = child.h;
348
350
  if (og) {
349
351
  const clonedChildren = child.e;
350
352
  delete child.enqueue;
@@ -352,47 +354,49 @@ function resolveQueues(children) {
352
354
  delete child.m;
353
355
  delete child.e;
354
356
  Object.assign(og, child);
355
- delete og.g;
357
+ delete og.h;
356
358
  resolveQueues(clonedChildren);
357
- } else if (child.m.g) {
358
- child.m.g.addChild(child);
359
+ } else if (child.m.h) {
360
+ child.m.h.addChild(child);
359
361
  }
360
362
  }
361
363
  }
362
364
  function mergeTransitions(t1, t2) {
363
365
  t2.a.forEach((value, key) => {
364
- key.k = t1;
366
+ key.j = t1;
365
367
  t1.a.set(key, value);
366
368
  });
367
369
  t2.W.forEach((c) => {
368
- c.k = t1;
370
+ c.j = t1;
369
371
  t1.W.add(c);
370
372
  });
371
373
  t2.R.forEach((p) => t1.R.add(p));
372
374
  t2.s.forEach((n) => t1.s.add(n));
373
375
  t1.merge(t2);
374
- t2.I = t1;
376
+ t2.J = t1;
375
377
  }
376
378
  function finishTransition(transition2) {
377
- if (transition2.I || transition2.X || transition2.R.size || transition2.s.size)
379
+ if (transition2.J || transition2.X || transition2.R.size || transition2.s.size)
378
380
  return;
379
381
  for (const [source, clone] of transition2.a) {
380
- if (source === clone || source.k !== transition2)
382
+ if (source === clone || source.j !== transition2)
381
383
  continue;
382
384
  if (clone.a)
383
385
  replaceSourceObservers(clone, transition2);
384
- source.dispose(false);
385
- source.emptyDisposal();
386
- Object.assign(source, clone);
387
- delete source.g;
388
- delete source.k;
386
+ if (!(clone.g & UNINITIALIZED_BIT)) {
387
+ source.dispose(false);
388
+ source.emptyDisposal();
389
+ Object.assign(source, clone);
390
+ delete source.h;
391
+ }
392
+ delete source.j;
389
393
  }
390
394
  globalQueue.f[0].push.apply(globalQueue.f[0], transition2.f[0]);
391
395
  globalQueue.f[1].push.apply(globalQueue.f[1], transition2.f[1]);
392
396
  resolveQueues(transition2.e);
393
- transition2.I = true;
397
+ transition2.J = true;
394
398
  for (const reset of transition2.W) {
395
- delete reset.k;
399
+ delete reset.j;
396
400
  reset();
397
401
  }
398
402
  globalQueue.flush();
@@ -449,20 +453,20 @@ var Owner = class {
449
453
  let head = self ? this.B || this.m : this, current = this.r, next = null;
450
454
  while (current && current.m === this) {
451
455
  current.dispose(true);
452
- current.J();
456
+ current.K();
453
457
  next = current.r;
454
458
  current.r = null;
455
459
  current = next;
456
460
  }
457
461
  this.ea = 0;
458
462
  if (self)
459
- this.J();
463
+ this.K();
460
464
  if (current)
461
465
  current.B = !self ? this : this.B;
462
466
  if (head)
463
467
  head.r = current;
464
468
  }
465
- J() {
469
+ K() {
466
470
  if (this.B)
467
471
  this.B.r = null;
468
472
  this.m = null;
@@ -552,9 +556,9 @@ var UNCHANGED = Symbol(0);
552
556
  var Computation = class extends Owner {
553
557
  a = null;
554
558
  b = null;
555
- j;
556
- K;
559
+ k;
557
560
  L;
561
+ F;
558
562
  // Used in __DEV__ mode, hopefully removed in production
559
563
  ka;
560
564
  // Using false is an optimization as an alternative to _equals: () => false
@@ -563,19 +567,19 @@ var Computation = class extends Owner {
563
567
  da;
564
568
  ga = false;
565
569
  /** Whether the computation is an error or has ancestors that are unresolved */
566
- h = 0;
570
+ g = 0;
567
571
  /** Which flags raised by sources are handled, vs. being passed through. */
568
572
  aa = DEFAULT_FLAGS;
569
573
  M = -1;
570
- G = false;
571
- k;
572
- g;
574
+ H = false;
575
+ j;
576
+ h;
573
577
  constructor(initialValue, compute2, options) {
574
578
  super(options?.id, compute2 === null);
575
- this.L = compute2;
579
+ this.F = compute2;
576
580
  this.c = compute2 ? STATE_DIRTY : STATE_CLEAN;
577
- this.h = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
578
- this.j = initialValue;
581
+ this.g = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
582
+ this.k = initialValue;
579
583
  if (options?.equals !== void 0)
580
584
  this.$ = options.equals;
581
585
  if (options?.pureWrite)
@@ -583,17 +587,17 @@ var Computation = class extends Owner {
583
587
  if (options?.unobserved)
584
588
  this.da = options?.unobserved;
585
589
  if (ActiveTransition) {
586
- this.k = ActiveTransition;
590
+ this.j = ActiveTransition;
587
591
  ActiveTransition.a.set(this, this);
588
592
  }
589
593
  }
590
594
  fa() {
591
595
  track(this);
592
- newFlags |= this.h & ~currentMask;
593
- if (this.h & ERROR_BIT) {
594
- throw this.K;
596
+ newFlags |= this.g & ~currentMask;
597
+ if (this.g & ERROR_BIT) {
598
+ throw this.L;
595
599
  } else {
596
- return this.j;
600
+ return this.k;
597
601
  }
598
602
  }
599
603
  /**
@@ -601,16 +605,16 @@ var Computation = class extends Owner {
601
605
  * Automatically re-executes the surrounding computation when the value changes
602
606
  */
603
607
  read() {
604
- if (ActiveTransition && (ActiveTransition.a.has(this) || !this.g && this.h & UNINITIALIZED_BIT)) {
608
+ if (ActiveTransition && (ActiveTransition.a.has(this) || !this.h && this.g & UNINITIALIZED_BIT)) {
605
609
  const clone = ActiveTransition.a.get(this) || cloneGraph(this);
606
610
  if (clone !== this)
607
611
  return clone.read();
608
612
  }
609
- if (this.L) {
610
- if (this.h & ERROR_BIT && this.M <= clock)
613
+ if (this.F) {
614
+ if (this.g & ERROR_BIT && this.M <= clock)
611
615
  update(this);
612
616
  else
613
- this.H();
617
+ this.I();
614
618
  }
615
619
  return this.fa();
616
620
  }
@@ -622,42 +626,42 @@ var Computation = class extends Owner {
622
626
  * before continuing
623
627
  */
624
628
  wait() {
625
- if (ActiveTransition && (ActiveTransition.a.has(this) || !this.g && this.h & UNINITIALIZED_BIT)) {
629
+ if (ActiveTransition && (ActiveTransition.a.has(this) || !this.h && this.g & UNINITIALIZED_BIT)) {
626
630
  const clone = ActiveTransition.a.get(this) || cloneGraph(this);
627
631
  if (clone !== this)
628
632
  return clone.wait();
629
633
  }
630
- if (this.L) {
631
- if (this.h & ERROR_BIT && this.M <= clock)
634
+ if (this.F) {
635
+ if (this.g & ERROR_BIT && this.M <= clock)
632
636
  update(this);
633
637
  else
634
- this.H();
638
+ this.I();
635
639
  }
636
- if ((notStale || this.h & UNINITIALIZED_BIT) && this.h & LOADING_BIT) {
640
+ if ((notStale || this.g & UNINITIALIZED_BIT) && this.g & LOADING_BIT) {
637
641
  track(this);
638
642
  throw new NotReadyError();
639
643
  }
640
- if (staleCheck && this.h & LOADING_BIT) {
641
- staleCheck.j = true;
644
+ if (staleCheck && this.g & LOADING_BIT) {
645
+ staleCheck.k = true;
642
646
  }
643
647
  return this.fa();
644
648
  }
645
649
  /** Update the computation with a new value. */
646
650
  write(value, flags = 0, raw = false) {
647
- if (ActiveTransition && !this.g) {
651
+ if (ActiveTransition && !this.h) {
648
652
  const clone = cloneGraph(this);
649
653
  if (clone !== this)
650
654
  return clone.write(value, flags, raw);
651
655
  }
652
- const newValue = !raw && typeof value === "function" ? value(this.j) : value;
653
- const valueChanged = newValue !== UNCHANGED && (!!(this.h & UNINITIALIZED_BIT) || // this._stateFlags & LOADING_BIT & ~flags ||
654
- this.$ === false || !this.$(this.j, newValue));
656
+ const newValue = !raw && typeof value === "function" ? value(this.k) : value;
657
+ const valueChanged = newValue !== UNCHANGED && (!!(this.g & UNINITIALIZED_BIT) || // this._stateFlags & LOADING_BIT & ~flags ||
658
+ this.$ === false || !this.$(this.k, newValue));
655
659
  if (valueChanged) {
656
- this.j = newValue;
657
- this.K = void 0;
660
+ this.k = newValue;
661
+ this.L = void 0;
658
662
  }
659
- const changedFlagsMask = this.h ^ flags, changedFlags = changedFlagsMask & flags;
660
- this.h = flags;
663
+ const changedFlagsMask = this.g ^ flags, changedFlags = changedFlagsMask & flags;
664
+ this.g = flags;
661
665
  this.M = clock + 1;
662
666
  if (this.b) {
663
667
  for (let i = 0; i < this.b.length; i++) {
@@ -668,15 +672,15 @@ var Computation = class extends Owner {
668
672
  }
669
673
  }
670
674
  }
671
- return this.j;
675
+ return this.k;
672
676
  }
673
677
  /**
674
678
  * Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
675
679
  */
676
680
  x(state, skipQueue) {
677
- if (this.c >= state && !this.G)
681
+ if (this.c >= state && !this.H)
678
682
  return;
679
- this.G = !!skipQueue;
683
+ this.H = !!skipQueue;
680
684
  this.c = state;
681
685
  if (this.b) {
682
686
  for (let i = 0; i < this.b.length; i++) {
@@ -699,12 +703,12 @@ var Computation = class extends Owner {
699
703
  }
700
704
  if (this.c >= STATE_CHECK)
701
705
  return;
702
- const prevFlags = this.h & mask;
706
+ const prevFlags = this.g & mask;
703
707
  const deltaFlags = prevFlags ^ newFlags2;
704
708
  if (newFlags2 === prevFlags) ; else if (deltaFlags & prevFlags & mask) {
705
709
  this.x(STATE_CHECK);
706
710
  } else {
707
- this.h ^= deltaFlags;
711
+ this.g ^= deltaFlags;
708
712
  if (this.b) {
709
713
  for (let i = 0; i < this.b.length; i++) {
710
714
  this.b[i].Y(mask, newFlags2);
@@ -713,13 +717,13 @@ var Computation = class extends Owner {
713
717
  }
714
718
  }
715
719
  N(error) {
716
- if (ActiveTransition && !this.g) {
720
+ if (ActiveTransition && !this.h) {
717
721
  const clone = cloneGraph(this);
718
722
  if (clone !== this)
719
723
  return clone.N(error);
720
724
  }
721
- this.K = error;
722
- this.write(UNCHANGED, this.h & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
725
+ this.L = error;
726
+ this.write(UNCHANGED, this.g & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
723
727
  }
724
728
  /**
725
729
  * This is the core part of the reactivity system, which makes sure that the values are updated
@@ -728,8 +732,8 @@ var Computation = class extends Owner {
728
732
  *
729
733
  * This function will ensure that the value and states we read from the computation are up to date
730
734
  */
731
- H() {
732
- if (!this.L) {
735
+ I() {
736
+ if (!this.F) {
733
737
  return;
734
738
  }
735
739
  if (this.c === STATE_DISPOSED) {
@@ -742,8 +746,8 @@ var Computation = class extends Owner {
742
746
  if (this.c === STATE_CHECK) {
743
747
  for (let i = 0; i < this.a.length; i++) {
744
748
  const source = ActiveTransition && ActiveTransition.a.get(this.a[i]) || this.a[i];
745
- source.H();
746
- observerFlags |= source.h & ~UNINITIALIZED_BIT;
749
+ source.I();
750
+ observerFlags |= source.g & ~UNINITIALIZED_BIT;
747
751
  if (this.c === STATE_DIRTY) {
748
752
  break;
749
753
  }
@@ -759,17 +763,17 @@ var Computation = class extends Owner {
759
763
  /**
760
764
  * Remove ourselves from the owner graph and the computation graph
761
765
  */
762
- J() {
766
+ K() {
763
767
  if (this.c === STATE_DISPOSED)
764
768
  return;
765
769
  if (this.a)
766
770
  removeSourceObservers(this, 0);
767
- super.J();
771
+ super.K();
768
772
  }
769
773
  };
770
774
  function track(computation) {
771
- if (ActiveTransition && computation.g)
772
- computation = computation.g;
775
+ if (ActiveTransition && computation.h)
776
+ computation = computation.h;
773
777
  if (currentObserver) {
774
778
  if (!newSources && currentObserver.a && currentObserver.a[newSourcesIndex] === computation) {
775
779
  newSourcesIndex++;
@@ -779,7 +783,7 @@ function track(computation) {
779
783
  newSources.push(computation);
780
784
  }
781
785
  if (updateCheck) {
782
- updateCheck.j = computation.M > currentObserver.M;
786
+ updateCheck.k = computation.M > currentObserver.M;
783
787
  }
784
788
  }
785
789
  }
@@ -791,11 +795,11 @@ function update(node) {
791
795
  try {
792
796
  node.dispose(false);
793
797
  node.emptyDisposal();
794
- const result = compute(node, node.L, node);
798
+ const result = compute(node, node.F, node);
795
799
  node.write(result, newFlags, true);
796
800
  } catch (error) {
797
801
  if (error instanceof NotReadyError) {
798
- node.write(UNCHANGED, newFlags | LOADING_BIT | node.h & UNINITIALIZED_BIT);
802
+ node.write(UNCHANGED, newFlags | LOADING_BIT | node.g & UNINITIALIZED_BIT);
799
803
  } else {
800
804
  node.N(error);
801
805
  }
@@ -855,20 +859,20 @@ function untrack(fn) {
855
859
  }
856
860
  function hasUpdated(fn) {
857
861
  const current = updateCheck;
858
- updateCheck = { j: false };
862
+ updateCheck = { k: false };
859
863
  try {
860
864
  fn();
861
- return updateCheck.j;
865
+ return updateCheck.k;
862
866
  } finally {
863
867
  updateCheck = current;
864
868
  }
865
869
  }
866
870
  function pendingCheck(fn, loadingValue) {
867
871
  const current = staleCheck;
868
- staleCheck = { j: false };
872
+ staleCheck = { k: false };
869
873
  try {
870
874
  latest(fn);
871
- return staleCheck.j;
875
+ return staleCheck.k;
872
876
  } catch (err) {
873
877
  if (!(err instanceof NotReadyError))
874
878
  return false;
@@ -913,7 +917,7 @@ function runWithObserver(observer, run) {
913
917
  if (error instanceof NotReadyError) {
914
918
  observer.write(
915
919
  UNCHANGED,
916
- newFlags | LOADING_BIT | observer.h & UNINITIALIZED_BIT
920
+ newFlags | LOADING_BIT | observer.g & UNINITIALIZED_BIT
917
921
  );
918
922
  } else {
919
923
  observer.N(error);
@@ -948,7 +952,7 @@ function compute(owner, fn, observer) {
948
952
  currentMask = observer?.aa ?? DEFAULT_FLAGS;
949
953
  notStale = true;
950
954
  try {
951
- return fn.call(observer, observer ? observer.j : void 0);
955
+ return fn.call(observer, observer ? observer.k : void 0);
952
956
  } finally {
953
957
  setOwner(prevOwner);
954
958
  currentObserver = prevObserver;
@@ -972,25 +976,25 @@ var Effect = class extends Computation {
972
976
  this._ = initialValue;
973
977
  this.A = options?.render ? EFFECT_RENDER : EFFECT_USER;
974
978
  if (this.A === EFFECT_RENDER) {
975
- this.L = function(p) {
976
- return !this.g && clock > this.l.created && !(this.h & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
979
+ this.F = function(p) {
980
+ return !this.h && clock > this.l.created && !(this.g & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
977
981
  };
978
982
  }
979
- this.H();
983
+ this.I();
980
984
  !options?.defer && (this.A === EFFECT_USER ? this.l.enqueue(this.A, this.C.bind(this)) : this.C(this.A));
981
985
  }
982
986
  write(value, flags = 0) {
983
987
  if (this.c == STATE_DIRTY) {
984
- this.h = flags;
988
+ this.g = flags;
985
989
  if (this.A === EFFECT_RENDER) {
986
- this.l.notify(this, LOADING_BIT | ERROR_BIT, this.h);
990
+ this.l.notify(this, LOADING_BIT | ERROR_BIT, this.g);
987
991
  }
988
992
  }
989
993
  if (value === UNCHANGED)
990
- return this.j;
991
- this.j = value;
994
+ return this.k;
995
+ this.k = value;
992
996
  this.ca = true;
993
- this.K = void 0;
997
+ this.L = void 0;
994
998
  return value;
995
999
  }
996
1000
  x(state, skipQueue) {
@@ -1001,7 +1005,7 @@ var Effect = class extends Computation {
1001
1005
  this.c = state;
1002
1006
  }
1003
1007
  Y(mask, newFlags2) {
1004
- if (this.g) {
1008
+ if (this.h) {
1005
1009
  if (this.c >= STATE_DIRTY)
1006
1010
  return;
1007
1011
  if (mask & 3) {
@@ -1012,9 +1016,9 @@ var Effect = class extends Computation {
1012
1016
  super.Y(mask, newFlags2);
1013
1017
  }
1014
1018
  N(error) {
1015
- this.K = error;
1019
+ this.L = error;
1016
1020
  this.l.notify(this, LOADING_BIT, 0);
1017
- this.h = ERROR_BIT;
1021
+ this.g = ERROR_BIT;
1018
1022
  if (this.A === EFFECT_USER) {
1019
1023
  try {
1020
1024
  return this.Z ? this.Z(error, () => {
@@ -1028,7 +1032,7 @@ var Effect = class extends Computation {
1028
1032
  if (!this.l.notify(this, ERROR_BIT, ERROR_BIT))
1029
1033
  throw error;
1030
1034
  }
1031
- J() {
1035
+ K() {
1032
1036
  if (this.c === STATE_DISPOSED)
1033
1037
  return;
1034
1038
  this.ba = void 0;
@@ -1036,20 +1040,21 @@ var Effect = class extends Computation {
1036
1040
  this.Z = void 0;
1037
1041
  this.O?.();
1038
1042
  this.O = void 0;
1039
- super.J();
1043
+ this.l.notify(this, ERROR_BIT | LOADING_BIT, 0);
1044
+ super.K();
1040
1045
  }
1041
1046
  C(type) {
1042
1047
  if (type) {
1043
- const effect = this.g || this;
1048
+ const effect = this.h || this;
1044
1049
  if (effect.ca && effect.c !== STATE_DISPOSED) {
1045
1050
  effect.O?.();
1046
1051
  try {
1047
- effect.O = effect.ba(effect.j, effect._);
1052
+ effect.O = effect.ba(effect.k, effect._);
1048
1053
  } catch (e) {
1049
1054
  if (!effect.l.notify(effect, ERROR_BIT, ERROR_BIT))
1050
1055
  throw e;
1051
1056
  } finally {
1052
- effect._ = effect.j;
1057
+ effect._ = effect.k;
1053
1058
  effect.ca = false;
1054
1059
  }
1055
1060
  }
@@ -1060,12 +1065,12 @@ var Effect = class extends Computation {
1060
1065
  var EagerComputation = class extends Computation {
1061
1066
  constructor(initialValue, compute2, options) {
1062
1067
  super(initialValue, compute2, options);
1063
- !options?.defer && this.H();
1068
+ !options?.defer && this.I();
1064
1069
  }
1065
1070
  x(state, skipQueue) {
1066
- if (this.c >= state && !this.G)
1071
+ if (this.c >= state && !this.H)
1067
1072
  return;
1068
- if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.G))
1073
+ if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.H))
1069
1074
  this.l.enqueue(EFFECT_PURE, this.C.bind(this));
1070
1075
  super.x(state, skipQueue);
1071
1076
  }
@@ -1079,12 +1084,12 @@ var FirewallComputation = class extends Computation {
1079
1084
  super(void 0, compute2);
1080
1085
  }
1081
1086
  x(state, skipQueue) {
1082
- if (this.c >= state && !this.G)
1087
+ if (this.c >= state && !this.H)
1083
1088
  return;
1084
- if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.G))
1089
+ if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.H))
1085
1090
  this.l.enqueue(EFFECT_PURE, this.C.bind(this));
1086
1091
  super.x(state, true);
1087
- this.G = !!skipQueue;
1092
+ this.H = !!skipQueue;
1088
1093
  }
1089
1094
  C() {
1090
1095
  this.c !== STATE_CLEAN && runTop(this);
@@ -1099,7 +1104,7 @@ function runTop(node) {
1099
1104
  }
1100
1105
  for (let i = ancestors.length - 1; i >= 0; i--) {
1101
1106
  if (ancestors[i].c !== STATE_DISPOSED)
1102
- ancestors[i].H();
1107
+ ancestors[i].I();
1103
1108
  }
1104
1109
  }
1105
1110
 
@@ -1233,7 +1238,7 @@ var storeTraps = {
1233
1238
  return desc.get.call(receiver);
1234
1239
  }
1235
1240
  if (Writing?.has(receiver)) {
1236
- let value2 = tracked && (overridden || !proxySource) ? tracked.j : storeValue[property];
1241
+ let value2 = tracked && (overridden || !proxySource) ? tracked.k : storeValue[property];
1237
1242
  value2 === $DELETED && (value2 = void 0);
1238
1243
  if (!isWrappable(value2))
1239
1244
  return value2;
@@ -1770,7 +1775,7 @@ function createMemo(compute2, value, options) {
1770
1775
  return resolvedValue;
1771
1776
  }
1772
1777
  resolvedValue = node.wait();
1773
- if (!node.a?.length && node.r?.m !== node && !(node.h & UNINITIALIZED_BIT)) {
1778
+ if (!node.a?.length && node.r?.m !== node && !(node.g & UNINITIALIZED_BIT)) {
1774
1779
  node.dispose();
1775
1780
  node = void 0;
1776
1781
  }
@@ -1832,12 +1837,12 @@ function createAsync(compute2, value, options) {
1832
1837
  const read = node.wait.bind(node);
1833
1838
  read.refresh = () => {
1834
1839
  let n = node;
1835
- if (ActiveTransition && !node.g) {
1840
+ if (ActiveTransition && !node.h) {
1836
1841
  n = cloneGraph(node);
1837
1842
  }
1838
1843
  n.c = STATE_DIRTY;
1839
1844
  refreshing = true;
1840
- n.H();
1845
+ n.I();
1841
1846
  };
1842
1847
  return read;
1843
1848
  }
@@ -1905,7 +1910,7 @@ function createOptimistic(initial, compute2, key) {
1905
1910
  if (!ActiveTransition)
1906
1911
  throw new Error("createOptimistic can only be updated inside a transition");
1907
1912
  ActiveTransition.addOptimistic(reset2);
1908
- queueMicrotask(() => node.write(v));
1913
+ queueMicrotask(() => reset2.j && node.write(v));
1909
1914
  };
1910
1915
  var write = write2;
1911
1916
  const node = new Computation(initial, null);
@@ -1936,7 +1941,7 @@ function createOptimistic(initial, compute2, key) {
1936
1941
  throw new Error("createOptimistic can only be updated inside a transition");
1937
1942
  ActiveTransition.addOptimistic(reset);
1938
1943
  queueMicrotask(
1939
- () => setStore((s) => {
1944
+ () => reset.j && setStore((s) => {
1940
1945
  lastChange = typeof v === "function" ? v(lastChange) : v;
1941
1946
  compute2(s.value, lastChange);
1942
1947
  })
@@ -2153,11 +2158,11 @@ var BoundaryComputation = class extends EagerComputation {
2153
2158
  }
2154
2159
  write(value, flags) {
2155
2160
  super.write(value, flags & ~this.U);
2156
- if (this.U & LOADING_BIT && !(this.h & UNINITIALIZED_BIT)) {
2161
+ if (this.U & LOADING_BIT && !(this.g & UNINITIALIZED_BIT)) {
2157
2162
  flags &= ~LOADING_BIT;
2158
2163
  }
2159
2164
  this.l.notify(this, this.U, flags);
2160
- return this.j;
2165
+ return this.k;
2161
2166
  }
2162
2167
  };
2163
2168
  function createBoundChildren(owner, fn, queue, mask) {
@@ -2214,12 +2219,12 @@ var ConditionalQueue = class extends Queue {
2214
2219
  }
2215
2220
  };
2216
2221
  var CollectionQueue = class extends Queue {
2217
- F;
2222
+ G;
2218
2223
  d = /* @__PURE__ */ new Set();
2219
2224
  t = new Computation(false, null, { pureWrite: true });
2220
2225
  constructor(type) {
2221
2226
  super();
2222
- this.F = type;
2227
+ this.G = type;
2223
2228
  }
2224
2229
  run(type) {
2225
2230
  if (!type || this.t.read())
@@ -2229,9 +2234,9 @@ var CollectionQueue = class extends Queue {
2229
2234
  notify(node, type, flags) {
2230
2235
  if (ActiveTransition && ActiveTransition.u.has(this))
2231
2236
  return ActiveTransition.u.get(this).notify(node, type, flags);
2232
- if (!(type & this.F))
2237
+ if (!(type & this.G))
2233
2238
  return super.notify(node, type, flags);
2234
- if (flags & this.F) {
2239
+ if (flags & this.G) {
2235
2240
  this.d.add(node);
2236
2241
  if (this.d.size === 1)
2237
2242
  this.t.write(true);
@@ -2240,11 +2245,11 @@ var CollectionQueue = class extends Queue {
2240
2245
  if (this.d.size === 0)
2241
2246
  this.t.write(false);
2242
2247
  }
2243
- type &= ~this.F;
2248
+ type &= ~this.G;
2244
2249
  return type ? super.notify(node, type, flags) : true;
2245
2250
  }
2246
2251
  merge(queue) {
2247
- queue.d.forEach((n) => this.notify(n, this.F, this.F));
2252
+ queue.d.forEach((n) => this.notify(n, this.G, this.G));
2248
2253
  super.merge(queue);
2249
2254
  }
2250
2255
  };
@@ -2287,10 +2292,10 @@ function createErrorBoundary(fn, fallback) {
2287
2292
  return createCollectionBoundary(ERROR_BIT, fn, (queue) => {
2288
2293
  let node = queue.d.values().next().value;
2289
2294
  ActiveTransition && ActiveTransition.a.has(node) && (node = ActiveTransition.a.get(node));
2290
- return fallback(node.K, () => {
2295
+ return fallback(node.L, () => {
2291
2296
  incrementClock();
2292
2297
  for (let node2 of queue.d) {
2293
- if (ActiveTransition && !node2.g)
2298
+ if (ActiveTransition && !node2.h)
2294
2299
  node2 = cloneGraph(node2);
2295
2300
  node2.c = STATE_DIRTY;
2296
2301
  node2.l?.enqueue(node2.A, node2.C.bind(node2));