@solidjs/signals 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/prod.js CHANGED
@@ -82,10 +82,10 @@ function deleteFromHeap(e, t) {
82
82
  else {
83
83
  const n = e.S;
84
84
  const r = t.l[i];
85
- const s = n ?? r;
85
+ const o = n ?? r;
86
86
  if (e === r) t.l[i] = n;
87
87
  else e.T.S = n;
88
- s.T = e.T;
88
+ o.T = e.T;
89
89
  }
90
90
  e.T = e;
91
91
  e.S = undefined;
@@ -107,7 +107,7 @@ function markNode(e, t = REACTIVE_DIRTY) {
107
107
  markNode(t.h, REACTIVE_CHECK);
108
108
  }
109
109
  if (e.A !== null) {
110
- for (let t = e.A; t !== null; t = t.P) {
110
+ for (let t = e.A; t !== null; t = t.N) {
111
111
  for (let e = t.I; e !== null; e = e.p) {
112
112
  markNode(e.h, REACTIVE_CHECK);
113
113
  }
@@ -116,12 +116,12 @@ function markNode(e, t = REACTIVE_DIRTY) {
116
116
  }
117
117
  function runHeap(e, t) {
118
118
  e._ = false;
119
- for (e.N = 0; e.N <= e.R; e.N++) {
120
- let n = e.l[e.N];
119
+ for (e.P = 0; e.P <= e.R; e.P++) {
120
+ let n = e.l[e.P];
121
121
  while (n !== undefined) {
122
122
  if (n.O & REACTIVE_IN_HEAP) t(n);
123
123
  else adjustHeight(n, e);
124
- n = e.l[e.N];
124
+ n = e.l[e.P];
125
125
  }
126
126
  }
127
127
  e.R = 0;
@@ -130,8 +130,8 @@ function adjustHeight(e, t) {
130
130
  deleteFromHeap(e, t);
131
131
  let n = e.o;
132
132
  for (let t = e.C; t; t = t.D) {
133
- const e = t.V;
134
- const i = e.m || e;
133
+ const e = t.m;
134
+ const i = e.V || e;
135
135
  if (i.L && i.o >= n) n = i.o + 1;
136
136
  }
137
137
  if (e.o !== n) {
@@ -142,13 +142,13 @@ function adjustHeight(e, t) {
142
142
  }
143
143
  }
144
144
  const transitions = new Set();
145
- const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, N: 0, R: 0 };
146
- const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, N: 0, R: 0 };
145
+ const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, P: 0, R: 0 };
146
+ const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, P: 0, R: 0 };
147
147
  let clock = 0;
148
148
  let activeTransition = null;
149
149
  let scheduled = false;
150
150
  let projectionWriteActive = false;
151
- function setOnUnhandledAsync(e) {}
151
+ function enforceLoadingBoundary(e) {}
152
152
  function runLaneEffects(e) {
153
153
  for (const t of activeLanes) {
154
154
  if (t.k || t.U.size > 0) continue;
@@ -170,16 +170,16 @@ function schedule() {
170
170
  class Queue {
171
171
  i = null;
172
172
  G = [[], []];
173
- M = [];
173
+ F = [];
174
174
  created = clock;
175
175
  addChild(e) {
176
- this.M.push(e);
176
+ this.F.push(e);
177
177
  e.i = this;
178
178
  }
179
179
  removeChild(e) {
180
- const t = this.M.indexOf(e);
180
+ const t = this.F.indexOf(e);
181
181
  if (t >= 0) {
182
- this.M.splice(t, 1);
182
+ this.F.splice(t, 1);
183
183
  e.i = null;
184
184
  }
185
185
  }
@@ -193,7 +193,7 @@ class Queue {
193
193
  this.G[e - 1] = [];
194
194
  runQueue(t, e);
195
195
  }
196
- for (let t = 0; t < this.M.length; t++) this.M[t].run?.(e);
196
+ for (let t = 0; t < this.F.length; t++) this.F[t].run?.(e);
197
197
  }
198
198
  enqueue(e, t) {
199
199
  if (e) {
@@ -210,12 +210,12 @@ class Queue {
210
210
  e.G[0].push(...this.G[0]);
211
211
  e.G[1].push(...this.G[1]);
212
212
  this.G = [[], []];
213
- for (let t = 0; t < this.M.length; t++) {
214
- let n = this.M[t];
215
- let i = e.M[t];
213
+ for (let t = 0; t < this.F.length; t++) {
214
+ let n = this.F[t];
215
+ let i = e.F[t];
216
216
  if (!i) {
217
- i = { G: [[], []], M: [] };
218
- e.M[t] = i;
217
+ i = { G: [[], []], F: [] };
218
+ e.F[t] = i;
219
219
  }
220
220
  n.stashQueues(i);
221
221
  }
@@ -223,21 +223,21 @@ class Queue {
223
223
  restoreQueues(e) {
224
224
  this.G[0].push(...e.G[0]);
225
225
  this.G[1].push(...e.G[1]);
226
- for (let t = 0; t < e.M.length; t++) {
227
- const n = e.M[t];
228
- let i = this.M[t];
226
+ for (let t = 0; t < e.F.length; t++) {
227
+ const n = e.F[t];
228
+ let i = this.F[t];
229
229
  if (i) i.restoreQueues(n);
230
230
  }
231
231
  }
232
232
  }
233
233
  class GlobalQueue extends Queue {
234
234
  H = false;
235
- F = [];
235
+ M = [];
236
236
  $ = [];
237
237
  j = new Set();
238
238
  static K;
239
239
  static Y;
240
- static Z = null;
240
+ static B = null;
241
241
  flush() {
242
242
  if (this.H) return;
243
243
  this.H = true;
@@ -248,32 +248,32 @@ class GlobalQueue extends Queue {
248
248
  if (!e) {
249
249
  let e = activeTransition;
250
250
  runHeap(zombieQueue, GlobalQueue.K);
251
- this.F = [];
251
+ this.M = [];
252
252
  this.$ = [];
253
253
  this.j = new Set();
254
254
  runLaneEffects(EFFECT_RENDER);
255
255
  runLaneEffects(EFFECT_USER);
256
- this.stashQueues(activeTransition.B);
256
+ this.stashQueues(activeTransition.Z);
257
257
  clock++;
258
- scheduled = dirtyQueue.R >= dirtyQueue.N;
259
- reassignPendingTransition(activeTransition.F);
258
+ scheduled = dirtyQueue.R >= dirtyQueue.P;
259
+ reassignPendingTransition(activeTransition.M);
260
260
  activeTransition = null;
261
261
  finalizePureQueue(null, true);
262
262
  return;
263
263
  }
264
- this.F !== activeTransition.F && this.F.push(...activeTransition.F);
265
- this.restoreQueues(activeTransition.B);
264
+ this.M !== activeTransition.M && this.M.push(...activeTransition.M);
265
+ this.restoreQueues(activeTransition.Z);
266
266
  transitions.delete(activeTransition);
267
267
  const t = activeTransition;
268
268
  activeTransition = null;
269
- reassignPendingTransition(this.F);
269
+ reassignPendingTransition(this.M);
270
270
  finalizePureQueue(t);
271
271
  } else {
272
272
  if (transitions.size) runHeap(zombieQueue, GlobalQueue.K);
273
273
  finalizePureQueue();
274
274
  }
275
275
  clock++;
276
- scheduled = dirtyQueue.R >= dirtyQueue.N;
276
+ scheduled = dirtyQueue.R >= dirtyQueue.P;
277
277
  runLaneEffects(EFFECT_RENDER);
278
278
  this.run(EFFECT_RENDER);
279
279
  runLaneEffects(EFFECT_USER);
@@ -285,9 +285,9 @@ class GlobalQueue extends Queue {
285
285
  notify(e, t, n, i) {
286
286
  if (t & STATUS_PENDING) {
287
287
  if (n & STATUS_PENDING) {
288
- const t = i !== undefined ? i : e.X;
289
- if (activeTransition && t && !activeTransition.q.includes(t.source)) {
290
- activeTransition.q.push(t.source);
288
+ const t = i !== undefined ? i : e.q;
289
+ if (activeTransition && t && !activeTransition.X.includes(t.source)) {
290
+ activeTransition.X.push(t.source);
291
291
  schedule();
292
292
  }
293
293
  }
@@ -302,12 +302,12 @@ class GlobalQueue extends Queue {
302
302
  if (!activeTransition) {
303
303
  activeTransition = e ?? {
304
304
  J: clock,
305
- F: [],
306
- q: [],
305
+ M: [],
306
+ X: [],
307
307
  $: [],
308
308
  j: new Set(),
309
309
  ee: [],
310
- B: { G: [[], []], M: [] },
310
+ Z: { G: [[], []], F: [] },
311
311
  te: false
312
312
  };
313
313
  } else if (e) {
@@ -326,12 +326,12 @@ class GlobalQueue extends Queue {
326
326
  }
327
327
  transitions.add(activeTransition);
328
328
  activeTransition.J = clock;
329
- for (let e = 0; e < this.F.length; e++) {
330
- const t = this.F[e];
329
+ for (let e = 0; e < this.M.length; e++) {
330
+ const t = this.M[e];
331
331
  t.ne = activeTransition;
332
- activeTransition.F.push(t);
332
+ activeTransition.M.push(t);
333
333
  }
334
- this.F = activeTransition.F;
334
+ this.M = activeTransition.M;
335
335
  for (let e = 0; e < this.$.length; e++) {
336
336
  const t = this.$[e];
337
337
  t.ne = activeTransition;
@@ -349,7 +349,7 @@ function insertSubs(e, t = false) {
349
349
  const n = e.ie || currentOptimisticLane;
350
350
  const i = e.re !== undefined;
351
351
  for (let r = e.I; r !== null; r = r.p) {
352
- if (i && r.h.se) {
352
+ if (i && r.h.oe) {
353
353
  r.h.O |= REACTIVE_SNAPSHOT_STALE;
354
354
  continue;
355
355
  }
@@ -361,54 +361,59 @@ function insertSubs(e, t = false) {
361
361
  r.h.ie = undefined;
362
362
  }
363
363
  const e = r.h;
364
- if (e.oe === EFFECT_TRACKED) {
364
+ if (e.se === EFFECT_TRACKED) {
365
365
  if (!e.ue) {
366
366
  e.ue = true;
367
- e.ce.enqueue(EFFECT_USER, e.le);
367
+ e.ce.enqueue(EFFECT_USER, e.ae);
368
368
  }
369
369
  continue;
370
370
  }
371
- const s = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
372
- if (s.N > r.h.o) s.N = r.h.o;
373
- insertIntoHeap(r.h, s);
371
+ const o = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
372
+ if (o.P > r.h.o) o.P = r.h.o;
373
+ insertIntoHeap(r.h, o);
374
374
  }
375
375
  }
376
+ function commitPendingNodes() {
377
+ const e = globalQueue.M;
378
+ for (let t = 0; t < e.length; t++) {
379
+ const n = e[t];
380
+ if (n.le !== NOT_PENDING) {
381
+ n.fe = n.le;
382
+ n.le = NOT_PENDING;
383
+ if (n.se && n.se !== EFFECT_TRACKED) n.ue = true;
384
+ }
385
+ if (!(n.Ee & STATUS_PENDING)) n.Ee &= ~STATUS_UNINITIALIZED;
386
+ if (n.L) GlobalQueue.Y(n, false, true);
387
+ }
388
+ e.length = 0;
389
+ }
376
390
  function finalizePureQueue(e = null, t = false) {
377
391
  let n = !t;
392
+ if (n) commitPendingNodes();
378
393
  if (!t) checkBoundaryChildren(globalQueue);
379
- if (dirtyQueue.R >= dirtyQueue.N) runHeap(dirtyQueue, GlobalQueue.K);
394
+ if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.K);
380
395
  if (n) {
381
- const t = globalQueue.F;
396
+ commitPendingNodes();
397
+ const t = e ? e.$ : globalQueue.$;
382
398
  for (let e = 0; e < t.length; e++) {
383
399
  const n = t[e];
384
- if (n.ae !== NOT_PENDING) {
385
- n.fe = n.ae;
386
- n.ae = NOT_PENDING;
387
- if (n.oe && n.oe !== EFFECT_TRACKED) n.ue = true;
400
+ n.ie = undefined;
401
+ if (n.le !== NOT_PENDING) {
402
+ n.fe = n.le;
403
+ n.le = NOT_PENDING;
388
404
  }
389
- if (!(n.Ee & STATUS_PENDING)) n.Ee &= ~STATUS_UNINITIALIZED;
390
- if (n.L) GlobalQueue.Y(n, false, true);
405
+ const i = n.Te;
406
+ n.Te = NOT_PENDING;
407
+ if (i !== NOT_PENDING && n.fe !== i) insertSubs(n, true);
408
+ n.ne = null;
391
409
  }
392
410
  t.length = 0;
393
- const n = e ? e.$ : globalQueue.$;
394
- for (let e = 0; e < n.length; e++) {
395
- const t = n[e];
396
- const i = t.ae;
397
- t.ie = undefined;
398
- if (i !== NOT_PENDING && t.fe !== i) {
399
- t.fe = i;
400
- insertSubs(t, true);
401
- }
402
- t.ae = NOT_PENDING;
403
- t.ne = null;
404
- }
405
- n.length = 0;
406
- const i = e ? e.j : globalQueue.j;
407
- if (GlobalQueue.Z && i.size) {
408
- for (const e of i) {
409
- GlobalQueue.Z(e);
410
- }
411
- i.clear();
411
+ const n = e ? e.j : globalQueue.j;
412
+ if (GlobalQueue.B && n.size) {
413
+ for (const e of n) {
414
+ GlobalQueue.B(e);
415
+ }
416
+ n.clear();
412
417
  schedule();
413
418
  }
414
419
  for (const t of activeLanes) {
@@ -418,17 +423,17 @@ function finalizePureQueue(e = null, t = false) {
418
423
  if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
419
424
  if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
420
425
  }
421
- if (t.Te.ie === t) t.Te.ie = undefined;
426
+ if (t.de.ie === t) t.de.ie = undefined;
422
427
  t.U.clear();
423
428
  t.W[0].length = 0;
424
429
  t.W[1].length = 0;
425
430
  activeLanes.delete(t);
426
- signalLanes.delete(t.Te);
431
+ signalLanes.delete(t.de);
427
432
  }
428
433
  }
429
434
  }
430
435
  function checkBoundaryChildren(e) {
431
- for (const t of e.M) {
436
+ for (const t of e.F) {
432
437
  t.checkSources?.();
433
438
  checkBoundaryChildren(t);
434
439
  }
@@ -455,9 +460,9 @@ function transitionComplete(e) {
455
460
  if (e.te) return true;
456
461
  if (e.ee.length) return false;
457
462
  let t = true;
458
- for (let n = 0; n < e.q.length; n++) {
459
- const i = e.q[n];
460
- if (i.Ee & STATUS_PENDING && i.X?.source === i) {
463
+ for (let n = 0; n < e.X.length; n++) {
464
+ const i = e.X[n];
465
+ if (i.Ee & STATUS_PENDING && i.q?.source === i) {
461
466
  t = false;
462
467
  break;
463
468
  }
@@ -488,12 +493,12 @@ function getOrCreateLane(e) {
488
493
  if (t) {
489
494
  return findLane(t);
490
495
  }
491
- const n = e.de;
496
+ const n = e.Se;
492
497
  const i = n?.ie ? findLane(n.ie) : null;
493
- t = { Te: e, U: new Set(), W: [[], []], k: null, ne: activeTransition, Se: i };
498
+ t = { de: e, U: new Set(), W: [[], []], k: null, ne: activeTransition, Re: i };
494
499
  signalLanes.set(e, t);
495
500
  activeLanes.add(t);
496
- e.Re = e.Oe || 0;
501
+ e.Oe = false;
497
502
  return t;
498
503
  }
499
504
  function findLane(e) {
@@ -519,7 +524,7 @@ function resolveLane(e) {
519
524
  return undefined;
520
525
  }
521
526
  function hasActiveOverride(e) {
522
- return !!(e._e && e.ae !== NOT_PENDING);
527
+ return !!(e.Te !== undefined && e.Te !== NOT_PENDING);
523
528
  }
524
529
  function assignOrMergeLane(e, t) {
525
530
  const n = findLane(t);
@@ -532,9 +537,9 @@ function assignOrMergeLane(e, t) {
532
537
  const r = findLane(i);
533
538
  if (activeLanes.has(r)) {
534
539
  if (r !== n && !hasActiveOverride(e)) {
535
- if (n.Se && findLane(n.Se) === r) {
540
+ if (n.Re && findLane(n.Re) === r) {
536
541
  e.ie = t;
537
- } else if (r.Se && findLane(r.Se) === n);
542
+ } else if (r.Re && findLane(r.Re) === n);
538
543
  else mergeLanes(n, r);
539
544
  }
540
545
  return;
@@ -545,43 +550,42 @@ function assignOrMergeLane(e, t) {
545
550
  function handleAsync(e, t, n) {
546
551
  const i = typeof t === "object" && t !== null;
547
552
  const r = i && untrack(() => t[Symbol.asyncIterator]);
548
- const s = !r && i && untrack(() => typeof t.then === "function");
549
- if (!s && !r) {
550
- e.Ie = null;
553
+ const o = !r && i && untrack(() => typeof t.then === "function");
554
+ if (!o && !r) {
555
+ e._e = null;
551
556
  return t;
552
557
  }
553
- e.Ie = t;
554
- let o;
558
+ e._e = t;
559
+ let s;
555
560
  const handleError = n => {
556
- if (e.Ie !== t) return;
561
+ if (e._e !== t) return;
557
562
  globalQueue.initTransition(e.ne);
558
563
  notifyStatus(e, n instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n);
559
564
  e.J = clock;
560
565
  };
561
566
  const asyncWrite = (i, r) => {
562
- if (e.Ie !== t) return;
567
+ if (e._e !== t) return;
563
568
  if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
564
569
  globalQueue.initTransition(e.ne);
565
570
  clearStatus(e);
566
- const s = resolveLane(e);
567
- if (s) s.U.delete(e);
571
+ const o = resolveLane(e);
572
+ if (o) o.U.delete(e);
568
573
  if (n) n(i);
569
- else if (e._e) {
570
- const t = e.ae !== NOT_PENDING;
571
- if (e.L) e.ae = i;
572
- if (!t) {
574
+ else if (e.Te !== undefined) {
575
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) e.le = i;
576
+ else {
573
577
  e.fe = i;
574
578
  insertSubs(e);
575
579
  }
576
580
  e.J = clock;
577
- } else if (s) {
581
+ } else if (o) {
578
582
  const t = e.fe;
579
- const n = e.pe;
583
+ const n = e.Ie;
580
584
  if (!n || !n(i, t)) {
581
585
  e.fe = i;
582
586
  e.J = clock;
583
- if (e.he) {
584
- setSignal(e.he, i);
587
+ if (e.pe) {
588
+ setSignal(e.pe, i);
585
589
  }
586
590
  insertSubs(e, true);
587
591
  }
@@ -592,13 +596,13 @@ function handleAsync(e, t, n) {
592
596
  flush();
593
597
  r?.();
594
598
  };
595
- if (s) {
599
+ if (o) {
596
600
  let n = false,
597
601
  i = true;
598
602
  t.then(
599
603
  e => {
600
604
  if (i) {
601
- o = e;
605
+ s = e;
602
606
  n = true;
603
607
  } else asyncWrite(e);
604
608
  },
@@ -636,7 +640,7 @@ function handleAsync(e, t, n) {
636
640
  );
637
641
  r = false;
638
642
  if (t && !e.done) {
639
- o = e.value;
643
+ s = e.value;
640
644
  i = true;
641
645
  return iterate();
642
646
  }
@@ -648,23 +652,23 @@ function handleAsync(e, t, n) {
648
652
  throw new NotReadyError(context);
649
653
  }
650
654
  }
651
- return o;
655
+ return s;
652
656
  }
653
657
  function clearStatus(e) {
654
658
  e.Ee = e.Ee & STATUS_UNINITIALIZED;
655
- e.X = null;
659
+ e.q = null;
656
660
  updatePendingSignal(e);
657
- e.Ae?.();
661
+ e.he?.();
658
662
  }
659
663
  function notifyStatus(e, t, n, i, r) {
660
664
  if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError))
661
665
  n = new StatusError(e, n);
662
- const s = n instanceof NotReadyError && n.source === e;
663
- const o = t === STATUS_PENDING && e._e && !s;
664
- const u = o && hasActiveOverride(e);
666
+ const o = n instanceof NotReadyError && n.source === e;
667
+ const s = t === STATUS_PENDING && e.Te !== undefined && !o;
668
+ const u = s && hasActiveOverride(e);
665
669
  if (!i) {
666
670
  e.Ee = t | (t !== STATUS_ERROR ? e.Ee & STATUS_UNINITIALIZED : 0);
667
- e.X = n;
671
+ e.q = n;
668
672
  updatePendingSignal(e);
669
673
  }
670
674
  if (r && !i) {
@@ -672,50 +676,50 @@ function notifyStatus(e, t, n, i, r) {
672
676
  }
673
677
  if (u && activeTransition && n instanceof NotReadyError) {
674
678
  const e = n.source;
675
- if (!activeTransition.q.includes(e)) {
676
- activeTransition.q.push(e);
679
+ if (!activeTransition.X.includes(e)) {
680
+ activeTransition.X.push(e);
677
681
  }
678
682
  }
679
683
  const c = i || u;
680
- const l = i || o ? undefined : r;
681
- if (e.Ae) {
684
+ const a = i || s ? undefined : r;
685
+ if (e.he) {
682
686
  if (c) {
683
- e.Ae(t, n);
687
+ e.he(t, n);
684
688
  } else {
685
- e.Ae();
689
+ e.he();
686
690
  }
687
691
  return;
688
692
  }
689
693
  for (let i = e.I; i !== null; i = i.p) {
690
694
  i.h.J = clock;
691
- if (i.h.X !== n) {
692
- !i.h.ne && globalQueue.F.push(i.h);
693
- notifyStatus(i.h, t, n, c, l);
695
+ if (i.h.q !== n) {
696
+ !i.h.ne && globalQueue.M.push(i.h);
697
+ notifyStatus(i.h, t, n, c, a);
694
698
  }
695
699
  }
696
- for (let i = e.A; i !== null; i = i.P) {
700
+ for (let i = e.A; i !== null; i = i.N) {
697
701
  for (let e = i.I; e !== null; e = e.p) {
698
702
  e.h.J = clock;
699
- if (e.h.X !== n) {
700
- !e.h.ne && globalQueue.F.push(e.h);
701
- notifyStatus(e.h, t, n, c, l);
703
+ if (e.h.q !== n) {
704
+ !e.h.ne && globalQueue.M.push(e.h);
705
+ notifyStatus(e.h, t, n, c, a);
702
706
  }
703
707
  }
704
708
  }
705
709
  }
706
710
  function unlinkSubs(e) {
707
- const t = e.V;
711
+ const t = e.m;
708
712
  const n = e.D;
709
713
  const i = e.p;
710
- const r = e.Pe;
711
- if (i !== null) i.Pe = r;
714
+ const r = e.Ae;
715
+ if (i !== null) i.Ae = r;
712
716
  else t.Ne = r;
713
717
  if (r !== null) r.p = i;
714
718
  else {
715
719
  t.I = i;
716
720
  if (i === null) {
717
721
  t.ge?.();
718
- t.L && !t.Ce && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
722
+ t.L && !t.Pe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
719
723
  }
720
724
  }
721
725
  return n;
@@ -730,27 +734,27 @@ function unobserved(e) {
730
734
  disposeChildren(e, true);
731
735
  }
732
736
  function link(e, t) {
733
- const n = t.ye;
734
- if (n !== null && n.V === e) return;
737
+ const n = t.Ce;
738
+ if (n !== null && n.m === e) return;
735
739
  let i = null;
736
740
  const r = t.O & REACTIVE_RECOMPUTING_DEPS;
737
741
  if (r) {
738
742
  i = n !== null ? n.D : t.C;
739
- if (i !== null && i.V === e) {
740
- t.ye = i;
743
+ if (i !== null && i.m === e) {
744
+ t.Ce = i;
741
745
  return;
742
746
  }
743
747
  }
744
- const s = e.Ne;
745
- if (s !== null && s.h === t && (!r || isValidLink(s, t))) return;
746
- const o = (t.ye = e.Ne = { V: e, h: t, D: i, Pe: s, p: null });
747
- if (n !== null) n.D = o;
748
- else t.C = o;
749
- if (s !== null) s.p = o;
750
- else e.I = o;
748
+ const o = e.Ne;
749
+ if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
750
+ const s = (t.Ce = e.Ne = { m: e, h: t, D: i, Ae: o, p: null });
751
+ if (n !== null) n.D = s;
752
+ else t.C = s;
753
+ if (o !== null) o.p = s;
754
+ else e.I = s;
751
755
  }
752
756
  function isValidLink(e, t) {
753
- const n = t.ye;
757
+ const n = t.Ce;
754
758
  if (n !== null) {
755
759
  let i = t.C;
756
760
  do {
@@ -771,7 +775,7 @@ function markDisposal(e) {
771
775
  insertIntoHeap(t, zombieQueue);
772
776
  }
773
777
  markDisposal(t);
774
- t = t.ve;
778
+ t = t.ye;
775
779
  }
776
780
  }
777
781
  function dispose(e) {
@@ -780,15 +784,15 @@ function dispose(e) {
780
784
  t = unlinkSubs(t);
781
785
  } while (t !== null);
782
786
  e.C = null;
783
- e.ye = null;
787
+ e.Ce = null;
784
788
  disposeChildren(e, true);
785
789
  }
786
790
  function disposeChildren(e, t = false, n) {
787
791
  if (e.O & REACTIVE_DISPOSED) return;
788
792
  if (t) e.O = REACTIVE_DISPOSED;
789
- let i = n ? e.be : e.De;
793
+ let i = n ? e.ve : e.De;
790
794
  while (i) {
791
- const e = i.ve;
795
+ const e = i.ye;
792
796
  if (i.C) {
793
797
  const e = i;
794
798
  deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
@@ -797,22 +801,21 @@ function disposeChildren(e, t = false, n) {
797
801
  t = unlinkSubs(t);
798
802
  } while (t !== null);
799
803
  e.C = null;
800
- e.ye = null;
804
+ e.Ce = null;
801
805
  }
802
806
  disposeChildren(i, true);
803
807
  i = e;
804
808
  }
805
809
  if (n) {
806
- e.be = null;
810
+ e.ve = null;
807
811
  } else {
808
812
  e.De = null;
809
- e.ve = null;
810
813
  e.we = 0;
811
814
  }
812
815
  runDisposal(e, n);
813
816
  }
814
817
  function runDisposal(e, t) {
815
- let n = t ? e.Ve : e.me;
818
+ let n = t ? e.be : e.me;
816
819
  if (!n) return;
817
820
  if (Array.isArray(n)) {
818
821
  for (let e = 0; e < n.length; e++) {
@@ -822,11 +825,11 @@ function runDisposal(e, t) {
822
825
  } else {
823
826
  n.call(n);
824
827
  }
825
- t ? (e.Ve = null) : (e.me = null);
828
+ t ? (e.be = null) : (e.me = null);
826
829
  }
827
830
  function childId(e, t) {
828
831
  let n = e;
829
- while (n.Le && n.i) n = n.i;
832
+ while (n.Ve && n.i) n = n.i;
830
833
  if (n.id != null) return formatId(n.id, t ? n.we++ : n.we);
831
834
  throw new Error("Cannot get child id from owner without an id");
832
835
  }
@@ -863,17 +866,17 @@ function createOwner(e) {
863
866
  const n = e?.transparent ?? false;
864
867
  const i = {
865
868
  id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
866
- Le: n || undefined,
869
+ Ve: n || undefined,
867
870
  t: true,
868
871
  u: t?.t ? t.u : t,
869
872
  De: null,
870
- ve: null,
873
+ ye: null,
871
874
  me: null,
872
875
  ce: t?.ce ?? globalQueue,
873
- ke: t?.ke || defaultContext,
876
+ Le: t?.Le || defaultContext,
874
877
  we: 0,
875
- Ve: null,
876
878
  be: null,
879
+ ve: null,
877
880
  i: t,
878
881
  dispose(e = true) {
879
882
  disposeChildren(i, e);
@@ -884,7 +887,7 @@ function createOwner(e) {
884
887
  if (e === null) {
885
888
  t.De = i;
886
889
  } else {
887
- i.ve = e;
890
+ i.ye = e;
888
891
  t.De = i;
889
892
  }
890
893
  }
@@ -895,57 +898,59 @@ function createRoot(e, t) {
895
898
  return runWithOwner(n, () => e(n.dispose));
896
899
  }
897
900
  function effect(e, t, n, i, r) {
898
- let s = false;
899
- const o = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
901
+ let o = false;
902
+ const s = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
900
903
  ...r,
901
904
  equals: () => {
902
- o.ue = !o.X;
903
- if (s) o.ce.enqueue(o.oe, runEffect.bind(o));
905
+ s.ue = !s.q;
906
+ if (o) s.ce.enqueue(s.se, runEffect.bind(s));
904
907
  return false;
905
908
  },
906
909
  lazy: true
907
910
  });
908
- o.Ue = i;
909
- o.We = t;
910
- o.He = n;
911
- o.xe = undefined;
912
- o.oe = r?.render ? EFFECT_RENDER : EFFECT_USER;
913
- o.Ae = (e, t) => {
914
- const n = e !== undefined ? e : o.Ee;
915
- const i = t !== undefined ? t : o.X;
911
+ s.ke = i;
912
+ s.Ue = t;
913
+ s.xe = n;
914
+ s.We = undefined;
915
+ s.se = r?.render ? EFFECT_RENDER : EFFECT_USER;
916
+ s.he = (e, t) => {
917
+ const n = e !== undefined ? e : s.Ee;
918
+ const i = t !== undefined ? t : s.q;
916
919
  if (n & STATUS_ERROR) {
917
920
  let e = i;
918
- o.ce.notify(o, STATUS_PENDING, 0);
919
- if (o.oe === EFFECT_USER) {
921
+ s.ce.notify(s, STATUS_PENDING, 0);
922
+ if (s.se === EFFECT_USER) {
920
923
  try {
921
- return o.He
922
- ? o.He(e, () => {
923
- o.xe?.();
924
- o.xe = undefined;
924
+ return s.xe
925
+ ? s.xe(e, () => {
926
+ s.We?.();
927
+ s.We = undefined;
925
928
  })
926
929
  : console.error(e);
927
930
  } catch (t) {
928
931
  e = t;
929
932
  }
930
933
  }
931
- if (!o.ce.notify(o, STATUS_ERROR, STATUS_ERROR)) throw e;
932
- } else if (o.oe === EFFECT_RENDER) o.ce.notify(o, STATUS_PENDING | STATUS_ERROR, n, i);
934
+ if (!s.ce.notify(s, STATUS_ERROR, STATUS_ERROR)) throw e;
935
+ } else if (s.se === EFFECT_RENDER) {
936
+ s.ce.notify(s, STATUS_PENDING | STATUS_ERROR, n, i);
937
+ }
933
938
  };
934
- recompute(o, true);
935
- !r?.defer && (o.oe === EFFECT_USER ? o.ce.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
936
- s = true;
937
- onCleanup(() => o.xe?.());
939
+ recompute(s, true);
940
+ !r?.defer && (s.se === EFFECT_USER ? s.ce.enqueue(s.se, runEffect.bind(s)) : runEffect.call(s));
941
+ o = true;
942
+ onCleanup(() => s.We?.());
938
943
  }
939
944
  function runEffect() {
940
945
  if (!this.ue || this.O & REACTIVE_DISPOSED) return;
941
- this.xe?.();
942
- this.xe = undefined;
946
+ this.We?.();
947
+ this.We = undefined;
943
948
  try {
944
- this.xe = this.We(this.fe, this.Ue);
949
+ this.We = this.Ue(this.fe, this.ke);
945
950
  } catch (e) {
946
951
  if (!this.ce.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
947
952
  } finally {
948
- this.Ue = this.fe;
953
+ this.ke = this.fe;
949
954
  this.ue = false;
950
955
  }
951
956
  }
@@ -958,21 +963,44 @@ function trackedEffect(e, t) {
958
963
  const n = computed(
959
964
  () => {
960
965
  try {
961
- n.xe?.();
962
- n.xe = undefined;
963
- n.xe = staleValues(e) || undefined;
966
+ n.We?.();
967
+ n.We = undefined;
968
+ n.We = staleValues(e) || undefined;
964
969
  } finally {
965
970
  }
966
971
  },
967
972
  undefined,
968
973
  { ...t, lazy: true }
969
974
  );
970
- n.xe = undefined;
975
+ n.We = undefined;
971
976
  n.ue = true;
972
- n.oe = EFFECT_TRACKED;
973
- n.le = run;
977
+ n.se = EFFECT_TRACKED;
978
+ n.ae = run;
974
979
  n.ce.enqueue(EFFECT_USER, run);
975
- onCleanup(() => n.xe?.());
980
+ onCleanup(() => n.We?.());
981
+ }
982
+ let externalSourceConfig = null;
983
+ function enableExternalSource(e) {
984
+ const { factory: t, untrack: n = e => e() } = e;
985
+ if (externalSourceConfig) {
986
+ const { factory: e, untrack: i } = externalSourceConfig;
987
+ externalSourceConfig = {
988
+ factory: (n, i) => {
989
+ const r = e(n, i);
990
+ const o = t(e => r.track(e), i);
991
+ return {
992
+ track: e => o.track(e),
993
+ dispose() {
994
+ o.dispose();
995
+ r.dispose();
996
+ }
997
+ };
998
+ },
999
+ untrack: e => i(() => n(e))
1000
+ };
1001
+ } else {
1002
+ externalSourceConfig = { factory: t, untrack: n };
1003
+ }
976
1004
  }
977
1005
  GlobalQueue.K = recompute;
978
1006
  GlobalQueue.Y = disposeChildren;
@@ -988,7 +1016,7 @@ let snapshotCaptureActive = false;
988
1016
  let snapshotSources = null;
989
1017
  function ownerInSnapshotScope(e) {
990
1018
  while (e) {
991
- if (e.Qe) return true;
1019
+ if (e.He) return true;
992
1020
  e = e.i;
993
1021
  }
994
1022
  return false;
@@ -998,32 +1026,32 @@ function setSnapshotCapture(e) {
998
1026
  if (e && !snapshotSources) snapshotSources = new Set();
999
1027
  }
1000
1028
  function markSnapshotScope(e) {
1001
- e.Qe = true;
1029
+ e.He = true;
1002
1030
  }
1003
1031
  function releaseSnapshotScope(e) {
1004
- e.Qe = false;
1032
+ e.He = false;
1005
1033
  releaseSubtree(e);
1006
1034
  schedule();
1007
1035
  }
1008
1036
  function releaseSubtree(e) {
1009
1037
  let t = e.De;
1010
1038
  while (t) {
1011
- if (t.Qe) {
1012
- t = t.ve;
1039
+ if (t.He) {
1040
+ t = t.ye;
1013
1041
  continue;
1014
1042
  }
1015
1043
  if (t.L) {
1016
1044
  const e = t;
1017
- e.se = false;
1045
+ e.oe = false;
1018
1046
  if (e.O & REACTIVE_SNAPSHOT_STALE) {
1019
1047
  e.O &= ~REACTIVE_SNAPSHOT_STALE;
1020
1048
  e.O |= REACTIVE_DIRTY;
1021
- if (dirtyQueue.N > e.o) dirtyQueue.N = e.o;
1049
+ if (dirtyQueue.P > e.o) dirtyQueue.P = e.o;
1022
1050
  insertIntoHeap(e, dirtyQueue);
1023
1051
  }
1024
1052
  }
1025
1053
  releaseSubtree(t);
1026
- t = t.ve;
1054
+ t = t.ye;
1027
1055
  }
1028
1056
  }
1029
1057
  function clearSnapshots() {
@@ -1037,7 +1065,7 @@ function clearSnapshots() {
1037
1065
  snapshotCaptureActive = false;
1038
1066
  }
1039
1067
  function recompute(e, t = false) {
1040
- const n = e.oe;
1068
+ const n = e.se;
1041
1069
  if (!t) {
1042
1070
  if (e.ne && (!n || activeTransition) && activeTransition !== e.ne)
1043
1071
  globalQueue.initTransition(e.ne);
@@ -1045,25 +1073,25 @@ function recompute(e, t = false) {
1045
1073
  if (e.ne || n === EFFECT_TRACKED) disposeChildren(e);
1046
1074
  else {
1047
1075
  markDisposal(e);
1048
- e.Ve = e.me;
1049
- e.be = e.De;
1076
+ e.be = e.me;
1077
+ e.ve = e.De;
1050
1078
  e.me = null;
1051
1079
  e.De = null;
1052
1080
  e.we = 0;
1053
1081
  }
1054
1082
  }
1055
1083
  const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
1056
- const r = hasActiveOverride(e);
1057
- const s = !!(e.Ee & STATUS_PENDING);
1058
- const o = context;
1084
+ const r = e.Te !== undefined && e.Te !== NOT_PENDING;
1085
+ const o = !!(e.Ee & STATUS_PENDING);
1086
+ const s = context;
1059
1087
  context = e;
1060
- e.ye = null;
1088
+ e.Ce = null;
1061
1089
  e.O = REACTIVE_RECOMPUTING_DEPS;
1062
1090
  e.J = clock;
1063
- let u = e.ae === NOT_PENDING ? e.fe : e.ae;
1091
+ let u = e.le === NOT_PENDING ? e.fe : e.le;
1064
1092
  let c = e.o;
1065
- let l = tracking;
1066
- let a = currentOptimisticLane;
1093
+ let a = tracking;
1094
+ let l = currentOptimisticLane;
1067
1095
  tracking = true;
1068
1096
  if (i) {
1069
1097
  const t = resolveLane(e);
@@ -1075,15 +1103,15 @@ function recompute(e, t = false) {
1075
1103
  const t = resolveLane(e);
1076
1104
  if (t) {
1077
1105
  t.U.delete(e);
1078
- updatePendingSignal(t.Te);
1106
+ updatePendingSignal(t.de);
1079
1107
  }
1080
1108
  } catch (t) {
1081
1109
  if (t instanceof NotReadyError && currentOptimisticLane) {
1082
1110
  const t = findLane(currentOptimisticLane);
1083
- if (t.Te !== e) {
1111
+ if (t.de !== e) {
1084
1112
  t.U.add(e);
1085
1113
  e.ie = t;
1086
- updatePendingSignal(t.Te);
1114
+ updatePendingSignal(t.de);
1087
1115
  }
1088
1116
  }
1089
1117
  notifyStatus(
@@ -1094,51 +1122,50 @@ function recompute(e, t = false) {
1094
1122
  t instanceof NotReadyError ? e.ie : undefined
1095
1123
  );
1096
1124
  } finally {
1097
- tracking = l;
1125
+ tracking = a;
1098
1126
  e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
1099
- context = o;
1127
+ context = s;
1100
1128
  }
1101
- if (!e.X) {
1102
- const o = e.ye;
1103
- let l = o !== null ? o.D : e.C;
1104
- if (l !== null) {
1129
+ if (!e.q) {
1130
+ const s = e.Ce;
1131
+ let a = s !== null ? s.D : e.C;
1132
+ if (a !== null) {
1105
1133
  do {
1106
- l = unlinkSubs(l);
1107
- } while (l !== null);
1108
- if (o !== null) o.D = null;
1134
+ a = unlinkSubs(a);
1135
+ } while (a !== null);
1136
+ if (s !== null) s.D = null;
1109
1137
  else e.C = null;
1110
1138
  }
1111
- const a = r ? e.fe : e.ae === NOT_PENDING ? e.fe : e.ae;
1112
- const f = !e.pe || !e.pe(a, u);
1139
+ const l = r ? e.Te : e.le === NOT_PENDING ? e.fe : e.le;
1140
+ const f = !e.Ie || !e.Ie(l, u);
1113
1141
  if (f) {
1114
- const o = r ? e.fe : undefined;
1115
- if (t || (n && activeTransition !== e.ne) || i) e.fe = u;
1116
- else e.ae = u;
1117
- if (r && !i && s) {
1118
- const t = e.Oe || 0;
1119
- const n = e.Re || 0;
1120
- if (t <= n) e.fe = u;
1121
- }
1122
- if (!r || i || e.fe !== o) {
1123
- insertSubs(e, i || r);
1124
- }
1142
+ const s = r ? e.Te : undefined;
1143
+ if (t || (n && activeTransition !== e.ne) || i) {
1144
+ e.fe = u;
1145
+ if (r && i) {
1146
+ e.Te = u;
1147
+ e.le = u;
1148
+ }
1149
+ } else e.le = u;
1150
+ if (r && !i && o && !e.Oe) e.Te = u;
1151
+ if (!r || i || e.Te !== s) insertSubs(e, i || r);
1125
1152
  } else if (r) {
1126
- e.ae = u;
1153
+ e.le = u;
1127
1154
  } else if (e.o != c) {
1128
1155
  for (let t = e.I; t !== null; t = t.p) {
1129
1156
  insertIntoHeapHeight(t.h, t.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
1130
1157
  }
1131
1158
  }
1132
1159
  }
1133
- currentOptimisticLane = a;
1134
- (!t || e.Ee & STATUS_PENDING) && !e.ne && !(activeTransition && e._e) && globalQueue.F.push(e);
1160
+ currentOptimisticLane = l;
1161
+ (!t || e.Ee & STATUS_PENDING) && !e.ne && !(activeTransition && r) && globalQueue.M.push(e);
1135
1162
  e.ne && n && activeTransition !== e.ne && runInTransition(e.ne, () => recompute(e));
1136
1163
  }
1137
1164
  function updateIfNecessary(e) {
1138
1165
  if (e.O & REACTIVE_CHECK) {
1139
1166
  for (let t = e.C; t; t = t.D) {
1140
- const n = t.V;
1141
- const i = n.m || n;
1167
+ const n = t.m;
1168
+ const i = n.V || n;
1142
1169
  if (i.L) {
1143
1170
  updateIfNecessary(i);
1144
1171
  }
@@ -1147,7 +1174,7 @@ function updateIfNecessary(e) {
1147
1174
  }
1148
1175
  }
1149
1176
  }
1150
- if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.X && e.J < clock && !e.Ie)) {
1177
+ if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.q && e.J < clock && !e._e)) {
1151
1178
  recompute(e);
1152
1179
  }
1153
1180
  e.O = REACTIVE_NONE | (e.O & REACTIVE_SNAPSHOT_STALE);
@@ -1156,13 +1183,13 @@ function computed(e, t, n) {
1156
1183
  const i = n?.transparent ?? false;
1157
1184
  const r = {
1158
1185
  id: n?.id ?? (i ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
1159
- Le: i || undefined,
1160
- pe: n?.equals != null ? n.equals : isEqual,
1186
+ Ve: i || undefined,
1187
+ Ie: n?.equals != null ? n.equals : isEqual,
1161
1188
  Ge: !!n?.pureWrite,
1162
1189
  ge: n?.unobserved,
1163
1190
  me: null,
1164
1191
  ce: context?.ce ?? globalQueue,
1165
- ke: context?.ke ?? defaultContext,
1192
+ Le: context?.Le ?? defaultContext,
1166
1193
  we: 0,
1167
1194
  L: e,
1168
1195
  fe: t,
@@ -1171,34 +1198,45 @@ function computed(e, t, n) {
1171
1198
  S: undefined,
1172
1199
  T: null,
1173
1200
  C: null,
1174
- ye: null,
1201
+ Ce: null,
1175
1202
  I: null,
1176
1203
  Ne: null,
1177
1204
  i: context,
1178
- ve: null,
1205
+ ye: null,
1179
1206
  De: null,
1180
1207
  O: n?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
1181
1208
  Ee: STATUS_UNINITIALIZED,
1182
1209
  J: clock,
1183
- ae: NOT_PENDING,
1184
- Ve: null,
1210
+ le: NOT_PENDING,
1185
1211
  be: null,
1186
- Ie: null,
1212
+ ve: null,
1213
+ _e: null,
1187
1214
  ne: null
1188
1215
  };
1189
1216
  r.T = r;
1190
- const s = context?.t ? context.u : context;
1217
+ const o = context?.t ? context.u : context;
1191
1218
  if (context) {
1192
1219
  const e = context.De;
1193
1220
  if (e === null) {
1194
1221
  context.De = r;
1195
1222
  } else {
1196
- r.ve = e;
1223
+ r.ye = e;
1197
1224
  context.De = r;
1198
1225
  }
1199
1226
  }
1200
- if (s) r.o = s.o + 1;
1201
- if (snapshotCaptureActive && ownerInSnapshotScope(context)) r.se = true;
1227
+ if (o) r.o = o.o + 1;
1228
+ if (snapshotCaptureActive && ownerInSnapshotScope(context)) r.oe = true;
1229
+ if (externalSourceConfig) {
1230
+ const e = signal(undefined, { equals: false, pureWrite: true });
1231
+ const t = externalSourceConfig.factory(r.L, () => {
1232
+ setSignal(e, undefined);
1233
+ });
1234
+ onCleanup(() => t.dispose());
1235
+ r.L = n => {
1236
+ read(e);
1237
+ return t.track(n);
1238
+ };
1239
+ }
1202
1240
  !n?.lazy && recompute(r, true);
1203
1241
  if (snapshotCaptureActive && !n?.lazy) {
1204
1242
  if (!(r.Ee & STATUS_PENDING)) {
@@ -1210,19 +1248,19 @@ function computed(e, t, n) {
1210
1248
  }
1211
1249
  function signal(e, t, n = null) {
1212
1250
  const i = {
1213
- pe: t?.equals != null ? t.equals : isEqual,
1251
+ Ie: t?.equals != null ? t.equals : isEqual,
1214
1252
  Ge: !!t?.pureWrite,
1215
1253
  ge: t?.unobserved,
1216
1254
  fe: e,
1217
1255
  I: null,
1218
1256
  Ne: null,
1219
1257
  J: clock,
1220
- m: n,
1221
- P: n?.A || null,
1222
- ae: NOT_PENDING
1258
+ V: n,
1259
+ N: n?.A || null,
1260
+ le: NOT_PENDING
1223
1261
  };
1224
1262
  n && (n.A = i);
1225
- if (snapshotCaptureActive && !i.Ge) {
1263
+ if (snapshotCaptureActive && !i.Ge && !((n?.Ee ?? 0) & STATUS_PENDING)) {
1226
1264
  i.re = e === undefined ? NO_SNAPSHOT : e;
1227
1265
  snapshotSources.add(i);
1228
1266
  }
@@ -1230,22 +1268,23 @@ function signal(e, t, n = null) {
1230
1268
  }
1231
1269
  function optimisticSignal(e, t) {
1232
1270
  const n = signal(e, t);
1233
- n._e = true;
1271
+ n.Te = NOT_PENDING;
1234
1272
  return n;
1235
1273
  }
1236
1274
  function optimisticComputed(e, t, n) {
1237
1275
  const i = computed(e, t, n);
1238
- i._e = true;
1276
+ i.Te = NOT_PENDING;
1239
1277
  return i;
1240
1278
  }
1241
1279
  function isEqual(e, t) {
1242
1280
  return e === t;
1243
1281
  }
1244
1282
  function untrack(e, t) {
1245
- if (!tracking && true) return e();
1283
+ if (!externalSourceConfig && !tracking && true) return e();
1246
1284
  const n = tracking;
1247
1285
  tracking = false;
1248
1286
  try {
1287
+ if (externalSourceConfig) return externalSourceConfig.untrack(e);
1249
1288
  return e();
1250
1289
  } finally {
1251
1290
  tracking = n;
@@ -1256,27 +1295,28 @@ function read(e) {
1256
1295
  const t = getLatestValueComputed(e);
1257
1296
  const n = latestReadActive;
1258
1297
  latestReadActive = false;
1259
- let i;
1298
+ const i = e.Te !== undefined && e.Te !== NOT_PENDING ? e.Te : e.fe;
1299
+ let r;
1260
1300
  try {
1261
- i = read(t);
1262
- } catch (t) {
1263
- if (!context && t instanceof NotReadyError) return e.fe;
1264
- throw t;
1301
+ r = read(t);
1302
+ } catch (e) {
1303
+ if (!context && e instanceof NotReadyError) return i;
1304
+ throw e;
1265
1305
  } finally {
1266
1306
  latestReadActive = n;
1267
1307
  }
1268
- if (t.Ee & STATUS_PENDING) return e.fe;
1308
+ if (t.Ee & STATUS_PENDING) return i;
1269
1309
  if (stale && currentOptimisticLane && t.ie) {
1270
- const n = findLane(t.ie);
1271
- const i = findLane(currentOptimisticLane);
1272
- if (n !== i && n.U.size > 0) {
1273
- return e.fe;
1310
+ const e = findLane(t.ie);
1311
+ const n = findLane(currentOptimisticLane);
1312
+ if (e !== n && e.U.size > 0) {
1313
+ return i;
1274
1314
  }
1275
1315
  }
1276
- return i;
1316
+ return r;
1277
1317
  }
1278
1318
  if (pendingCheckActive) {
1279
- const t = e.m || e;
1319
+ const t = e.V || e;
1280
1320
  const n = getPendingSignal(t);
1281
1321
  const i = pendingCheckActive;
1282
1322
  pendingCheckActive = false;
@@ -1293,13 +1333,13 @@ function read(e) {
1293
1333
  e.O &= ~REACTIVE_LAZY;
1294
1334
  recompute(e, true);
1295
1335
  }
1296
- const n = e.m || e;
1336
+ const n = e.V || e;
1297
1337
  if (t && tracking) {
1298
1338
  if (e.L && e.O & REACTIVE_DISPOSED) recompute(e);
1299
1339
  link(e, t);
1300
1340
  if (n.L) {
1301
1341
  const i = e.O & REACTIVE_ZOMBIE;
1302
- if (n.o >= (i ? zombieQueue.N : dirtyQueue.N)) {
1342
+ if (n.o >= (i ? zombieQueue.P : dirtyQueue.P)) {
1303
1343
  markNode(t);
1304
1344
  markHeap(i ? zombieQueue : dirtyQueue);
1305
1345
  updateIfNecessary(n);
@@ -1316,74 +1356,73 @@ function read(e) {
1316
1356
  const i = n.ie;
1317
1357
  const r = findLane(currentOptimisticLane);
1318
1358
  if (i && findLane(i) === r && !hasActiveOverride(n)) {
1319
- if (!tracking) link(e, t);
1320
- throw n.X;
1359
+ if (!tracking && e !== t) link(e, t);
1360
+ throw n.q;
1321
1361
  }
1322
1362
  } else {
1323
- if (!tracking) link(e, t);
1324
- throw n.X;
1363
+ if (!tracking && e !== t) link(e, t);
1364
+ throw n.q;
1325
1365
  }
1326
1366
  } else if (!t && n.Ee & STATUS_UNINITIALIZED) {
1327
- throw n.X;
1367
+ throw n.q;
1328
1368
  }
1329
1369
  }
1330
1370
  if (e.L && e.Ee & STATUS_ERROR) {
1331
1371
  if (e.J < clock) {
1332
1372
  recompute(e, true);
1333
1373
  return read(e);
1334
- } else throw e.X;
1374
+ } else throw e.q;
1335
1375
  }
1336
- if (snapshotCaptureActive && t && t.se) {
1376
+ if (snapshotCaptureActive && t && t.oe) {
1337
1377
  const n = e.re;
1338
1378
  if (n !== undefined) {
1339
1379
  const i = n === NO_SNAPSHOT ? undefined : n;
1340
- const r = e.ae !== NOT_PENDING ? e.ae : e.fe;
1380
+ const r = e.le !== NOT_PENDING ? e.le : e.fe;
1341
1381
  if (r !== i) t.O |= REACTIVE_SNAPSHOT_STALE;
1342
1382
  return i;
1343
1383
  }
1344
1384
  }
1385
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) return e.Te;
1345
1386
  return !t ||
1346
- (currentOptimisticLane !== null && (e._e || e.ie || n === e || !!(n.Ee & STATUS_PENDING))) ||
1347
- e.ae === NOT_PENDING ||
1387
+ (currentOptimisticLane !== null &&
1388
+ (e.Te !== undefined || e.ie || n === e || !!(n.Ee & STATUS_PENDING))) ||
1389
+ e.le === NOT_PENDING ||
1348
1390
  (stale && e.ne && activeTransition !== e.ne)
1349
1391
  ? e.fe
1350
- : e.ae;
1392
+ : e.le;
1351
1393
  }
1352
1394
  function setSignal(e, t) {
1353
1395
  if (e.ne && activeTransition !== e.ne) globalQueue.initTransition(e.ne);
1354
- const n = e._e && !projectionWriteActive;
1355
- const i = n ? e.fe : e.ae === NOT_PENDING ? e.fe : e.ae;
1356
- if (typeof t === "function") t = t(i);
1357
- const r = !e.pe || !e.pe(i, t) || !!(e.Ee & STATUS_UNINITIALIZED);
1358
- if (!r) {
1359
- if (n && e.ae !== NOT_PENDING && e.L) {
1396
+ const n = e.Te !== undefined && !projectionWriteActive;
1397
+ const i = e.Te !== undefined && e.Te !== NOT_PENDING;
1398
+ const r = n ? (i ? e.Te : e.fe) : e.le === NOT_PENDING ? e.fe : e.le;
1399
+ if (typeof t === "function") t = t(r);
1400
+ const o = !e.Ie || !e.Ie(r, t) || !!(e.Ee & STATUS_UNINITIALIZED);
1401
+ if (!o) {
1402
+ if (n && i && e.L) {
1360
1403
  insertSubs(e, true);
1361
1404
  schedule();
1362
1405
  }
1363
1406
  return t;
1364
1407
  }
1365
1408
  if (n) {
1366
- const n = globalQueue.$.includes(e);
1367
- if (e.ne && n) {
1368
- globalQueue.initTransition(e.ne);
1369
- }
1370
- if (e.ae === NOT_PENDING) {
1371
- e.ae = e.fe;
1372
- }
1373
- if (!n) {
1409
+ const n = e.Te === NOT_PENDING;
1410
+ if (!n && e.ne) globalQueue.initTransition(e.ne);
1411
+ if (n) {
1412
+ e.le = e.fe;
1374
1413
  globalQueue.$.push(e);
1375
1414
  }
1376
- e.Oe = (e.Oe || 0) + 1;
1415
+ e.Oe = true;
1377
1416
  const i = getOrCreateLane(e);
1378
1417
  e.ie = i;
1379
- e.fe = t;
1418
+ e.Te = t;
1380
1419
  } else {
1381
- if (e.ae === NOT_PENDING) globalQueue.F.push(e);
1382
- e.ae = t;
1420
+ if (e.le === NOT_PENDING) globalQueue.M.push(e);
1421
+ e.le = t;
1383
1422
  }
1384
1423
  updatePendingSignal(e);
1385
- if (e.he) {
1386
- setSignal(e.he, t);
1424
+ if (e.pe) {
1425
+ setSignal(e.pe, t);
1387
1426
  }
1388
1427
  e.J = clock;
1389
1428
  insertSubs(e, n);
@@ -1403,32 +1442,32 @@ function runWithOwner(e, t) {
1403
1442
  }
1404
1443
  }
1405
1444
  function getPendingSignal(e) {
1406
- if (!e.Me) {
1407
- e.Me = optimisticSignal(false, { pureWrite: true });
1408
- if (e.de) {
1409
- e.Me.de = e;
1445
+ if (!e.Qe) {
1446
+ e.Qe = optimisticSignal(false, { pureWrite: true });
1447
+ if (e.Se) {
1448
+ e.Qe.Se = e;
1410
1449
  }
1411
- if (computePendingState(e)) setSignal(e.Me, true);
1450
+ if (computePendingState(e)) setSignal(e.Qe, true);
1412
1451
  }
1413
- return e.Me;
1452
+ return e.Qe;
1414
1453
  }
1415
1454
  function computePendingState(e) {
1416
1455
  const t = e;
1417
- if (e._e && e.ae !== NOT_PENDING) {
1456
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) {
1418
1457
  if (t.Ee & STATUS_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1419
- if (e.de) {
1458
+ if (e.Se) {
1420
1459
  const t = e.ie ? findLane(e.ie) : null;
1421
1460
  return !!(t && t.U.size > 0);
1422
1461
  }
1423
1462
  return true;
1424
1463
  }
1425
- if (e.ae !== NOT_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1464
+ if (e.le !== NOT_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1426
1465
  return !!(t.Ee & STATUS_PENDING && !(t.Ee & STATUS_UNINITIALIZED));
1427
1466
  }
1428
1467
  function updatePendingSignal(e) {
1429
- if (e.Me) {
1468
+ if (e.Qe) {
1430
1469
  const t = computePendingState(e);
1431
- const n = e.Me;
1470
+ const n = e.Qe;
1432
1471
  setSignal(n, t);
1433
1472
  if (!t && n.ie) {
1434
1473
  const t = resolveLane(e);
@@ -1444,20 +1483,20 @@ function updatePendingSignal(e) {
1444
1483
  }
1445
1484
  }
1446
1485
  function getLatestValueComputed(e) {
1447
- if (!e.he) {
1486
+ if (!e.pe) {
1448
1487
  const t = latestReadActive;
1449
1488
  latestReadActive = false;
1450
1489
  const n = pendingCheckActive;
1451
1490
  pendingCheckActive = false;
1452
1491
  const i = context;
1453
1492
  context = null;
1454
- e.he = optimisticComputed(() => read(e));
1455
- e.he.de = e;
1493
+ e.pe = optimisticComputed(() => read(e));
1494
+ e.pe.Se = e;
1456
1495
  context = i;
1457
1496
  pendingCheckActive = n;
1458
1497
  latestReadActive = t;
1459
1498
  }
1460
- return e.he;
1499
+ return e.pe;
1461
1500
  }
1462
1501
  function staleValues(e, t = true) {
1463
1502
  const n = stale;
@@ -1518,7 +1557,7 @@ function getContext(e, t = getOwner()) {
1518
1557
  if (!t) {
1519
1558
  throw new NoOwnerError();
1520
1559
  }
1521
- const n = hasContext(e, t) ? t.ke[e.id] : e.defaultValue;
1560
+ const n = hasContext(e, t) ? t.Le[e.id] : e.defaultValue;
1522
1561
  if (isUndefined(n)) {
1523
1562
  throw new ContextNotFoundError();
1524
1563
  }
@@ -1528,10 +1567,10 @@ function setContext(e, t, n = getOwner()) {
1528
1567
  if (!n) {
1529
1568
  throw new NoOwnerError();
1530
1569
  }
1531
- n.ke = { ...n.ke, [e.id]: isUndefined(t) ? e.defaultValue : t };
1570
+ n.Le = { ...n.Le, [e.id]: isUndefined(t) ? e.defaultValue : t };
1532
1571
  }
1533
1572
  function hasContext(e, t) {
1534
- return !isUndefined(t?.ke[e.id]);
1573
+ return !isUndefined(t?.Le[e.id]);
1535
1574
  }
1536
1575
  function isUndefined(e) {
1537
1576
  return typeof e === "undefined";
@@ -1547,13 +1586,13 @@ function action(e) {
1547
1586
  new Promise((n, i) => {
1548
1587
  const r = e(...t);
1549
1588
  globalQueue.initTransition();
1550
- let s = activeTransition;
1551
- s.ee.push(r);
1589
+ let o = activeTransition;
1590
+ o.ee.push(r);
1552
1591
  const done = (e, t) => {
1553
- s = currentTransition(s);
1554
- const o = s.ee.indexOf(r);
1555
- if (o >= 0) s.ee.splice(o, 1);
1556
- setActiveTransition(s);
1592
+ o = currentTransition(o);
1593
+ const s = o.ee.indexOf(r);
1594
+ if (s >= 0) o.ee.splice(s, 1);
1595
+ setActiveTransition(o);
1557
1596
  schedule();
1558
1597
  t ? i(t) : n(e);
1559
1598
  };
@@ -1565,32 +1604,37 @@ function action(e) {
1565
1604
  return done(undefined, e);
1566
1605
  }
1567
1606
  if (n instanceof Promise)
1568
- return void n.then(run, e => restoreTransition(s, () => step(e, true)));
1607
+ return void n.then(run, e => restoreTransition(o, () => step(e, true)));
1569
1608
  run(n);
1570
1609
  };
1571
1610
  const run = e => {
1572
1611
  if (e.done) return done(e.value);
1573
1612
  if (e.value instanceof Promise)
1574
1613
  return void e.value.then(
1575
- e => restoreTransition(s, () => step(e)),
1576
- e => restoreTransition(s, () => step(e, true))
1614
+ e => restoreTransition(o, () => step(e)),
1615
+ e => restoreTransition(o, () => step(e, true))
1577
1616
  );
1578
- restoreTransition(s, () => step(e.value));
1617
+ restoreTransition(o, () => step(e.value));
1579
1618
  };
1580
1619
  step();
1581
1620
  });
1582
1621
  }
1622
+ function accessor(e) {
1623
+ const t = read.bind(null, e);
1624
+ t.$r = true;
1625
+ return t;
1626
+ }
1583
1627
  function createSignal(e, t, n) {
1584
1628
  if (typeof e === "function") {
1585
1629
  const i = computed(e, t, n);
1586
- return [read.bind(null, i), setSignal.bind(null, i)];
1630
+ return [accessor(i), setSignal.bind(null, i)];
1587
1631
  }
1588
1632
  const i = signal(e, t);
1589
- return [read.bind(null, i), setSignal.bind(null, i)];
1633
+ return [accessor(i), setSignal.bind(null, i)];
1590
1634
  }
1591
1635
  function createMemo(e, t, n) {
1592
1636
  let i = computed(e, t, n);
1593
- return read.bind(null, i);
1637
+ return accessor(i);
1594
1638
  }
1595
1639
  function createEffect(e, t, n, i) {
1596
1640
  effect(e, t.effect || t, t.error, n, i);
@@ -1638,7 +1682,7 @@ function resolve(e) {
1638
1682
  }
1639
1683
  function createOptimistic(e, t, n) {
1640
1684
  const i = typeof e === "function" ? optimisticComputed(e, t, n) : optimisticSignal(e, t);
1641
- return [read.bind(null, i), setSignal.bind(null, i)];
1685
+ return [accessor(i), setSignal.bind(null, i)];
1642
1686
  }
1643
1687
  function onSettled(e) {
1644
1688
  getOwner()
@@ -1660,128 +1704,128 @@ function getAllKeys(e, t, n) {
1660
1704
  const r = Object.keys(n);
1661
1705
  return Array.from(new Set([...i, ...r]));
1662
1706
  }
1663
- function applyState(e, t, n, i) {
1664
- const r = t?.[$TARGET];
1665
- if (!r) return;
1666
- const s = r[STORE_VALUE];
1667
- const o = r[STORE_OVERRIDE];
1668
- const u = r[STORE_OPTIMISTIC_OVERRIDE];
1669
- let c = r[STORE_NODE];
1670
- if (e === s && !o && !u) return;
1671
- (r[STORE_LOOKUP] || storeLookup).set(e, r[$PROXY]);
1672
- r[STORE_VALUE] = e;
1673
- r[STORE_OVERRIDE] = undefined;
1674
- if (Array.isArray(s)) {
1707
+ function applyState(e, t, n) {
1708
+ const i = t?.[$TARGET];
1709
+ if (!i) return;
1710
+ const r = i[STORE_VALUE];
1711
+ const o = i[STORE_OVERRIDE];
1712
+ const s = i[STORE_OPTIMISTIC_OVERRIDE];
1713
+ let u = i[STORE_NODE];
1714
+ if (e === r && !o && !s) return;
1715
+ (i[STORE_LOOKUP] || storeLookup).set(e, i[$PROXY]);
1716
+ i[STORE_VALUE] = e;
1717
+ i[STORE_OVERRIDE] = undefined;
1718
+ if (Array.isArray(r)) {
1675
1719
  let t = false;
1676
- const l = getOverrideValue(s, o, c, "length", u);
1677
- if (e.length && l && e[0] && n(e[0]) != null) {
1678
- let a, f, E, T, d, S, R, O;
1720
+ const c = getOverrideValue(r, o, u, "length", s);
1721
+ if (e.length && c && e[0] && n(e[0]) != null) {
1722
+ let a, l, f, E, T, d, S, R;
1679
1723
  for (
1680
- E = 0, T = Math.min(l, e.length);
1681
- E < T &&
1682
- ((S = getOverrideValue(s, o, c, E, u)) === e[E] || (S && e[E] && n(S) === n(e[E])));
1683
- E++
1724
+ f = 0, E = Math.min(c, e.length);
1725
+ f < E &&
1726
+ ((d = getOverrideValue(r, o, u, f, s)) === e[f] || (d && e[f] && n(d) === n(e[f])));
1727
+ f++
1684
1728
  ) {
1685
- applyState(e[E], wrap(S, r), n, i);
1729
+ applyState(e[f], wrap(d, i), n);
1686
1730
  }
1687
- const _ = new Array(e.length),
1688
- I = new Map();
1731
+ const O = new Array(e.length),
1732
+ _ = new Map();
1689
1733
  for (
1690
- T = l - 1, d = e.length - 1;
1691
- T >= E &&
1692
- d >= E &&
1693
- ((S = getOverrideValue(s, o, c, T, u)) === e[d] || (S && e[d] && n(S) === n(e[d])));
1694
- T--, d--
1734
+ E = c - 1, T = e.length - 1;
1735
+ E >= f &&
1736
+ T >= f &&
1737
+ ((d = getOverrideValue(r, o, u, E, s)) === e[T] || (d && e[T] && n(d) === n(e[T])));
1738
+ E--, T--
1695
1739
  ) {
1696
- _[d] = S;
1740
+ O[T] = d;
1697
1741
  }
1698
- if (E > d || E > T) {
1699
- for (f = E; f <= d; f++) {
1742
+ if (f > T || f > E) {
1743
+ for (l = f; l <= T; l++) {
1700
1744
  t = true;
1701
- r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], wrap(e[f], r));
1745
+ i[STORE_NODE][l] && setSignal(i[STORE_NODE][l], wrap(e[l], i));
1702
1746
  }
1703
- for (; f < e.length; f++) {
1747
+ for (; l < e.length; l++) {
1704
1748
  t = true;
1705
- const s = wrap(_[f], r);
1706
- r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], s);
1707
- applyState(e[f], s, n, i);
1749
+ const r = wrap(O[l], i);
1750
+ i[STORE_NODE][l] && setSignal(i[STORE_NODE][l], r);
1751
+ applyState(e[l], r, n);
1708
1752
  }
1709
- t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
1710
- l !== e.length && r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
1753
+ t && i[STORE_NODE][$TRACK] && setSignal(i[STORE_NODE][$TRACK], void 0);
1754
+ c !== e.length && i[STORE_NODE].length && setSignal(i[STORE_NODE].length, e.length);
1711
1755
  return;
1712
1756
  }
1713
- R = new Array(d + 1);
1714
- for (f = d; f >= E; f--) {
1715
- S = e[f];
1716
- O = S ? n(S) : S;
1717
- a = I.get(O);
1718
- R[f] = a === undefined ? -1 : a;
1719
- I.set(O, f);
1720
- }
1721
- for (a = E; a <= T; a++) {
1722
- S = getOverrideValue(s, o, c, a, u);
1723
- O = S ? n(S) : S;
1724
- f = I.get(O);
1725
- if (f !== undefined && f !== -1) {
1726
- _[f] = S;
1727
- f = R[f];
1728
- I.set(O, f);
1757
+ S = new Array(T + 1);
1758
+ for (l = T; l >= f; l--) {
1759
+ d = e[l];
1760
+ R = d ? n(d) : d;
1761
+ a = _.get(R);
1762
+ S[l] = a === undefined ? -1 : a;
1763
+ _.set(R, l);
1764
+ }
1765
+ for (a = f; a <= E; a++) {
1766
+ d = getOverrideValue(r, o, u, a, s);
1767
+ R = d ? n(d) : d;
1768
+ l = _.get(R);
1769
+ if (l !== undefined && l !== -1) {
1770
+ O[l] = d;
1771
+ l = S[l];
1772
+ _.set(R, l);
1729
1773
  }
1730
1774
  }
1731
- for (f = E; f < e.length; f++) {
1732
- if (f in _) {
1733
- const t = wrap(_[f], r);
1734
- r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], t);
1735
- applyState(e[f], t, n, i);
1736
- } else r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], wrap(e[f], r));
1775
+ for (l = f; l < e.length; l++) {
1776
+ if (l in O) {
1777
+ const t = wrap(O[l], i);
1778
+ i[STORE_NODE][l] && setSignal(i[STORE_NODE][l], t);
1779
+ applyState(e[l], t, n);
1780
+ } else i[STORE_NODE][l] && setSignal(i[STORE_NODE][l], wrap(e[l], i));
1737
1781
  }
1738
- if (E < e.length) t = true;
1782
+ if (f < e.length) t = true;
1739
1783
  } else if (e.length) {
1740
- for (let t = 0, l = e.length; t < l; t++) {
1741
- const l = getOverrideValue(s, o, c, t, u);
1742
- isWrappable(l)
1743
- ? applyState(e[t], wrap(l, r), n, i)
1744
- : r[STORE_NODE][t] && setSignal(r[STORE_NODE][t], e[t]);
1784
+ for (let t = 0, c = e.length; t < c; t++) {
1785
+ const c = getOverrideValue(r, o, u, t, s);
1786
+ isWrappable(c)
1787
+ ? applyState(e[t], wrap(c, i), n)
1788
+ : i[STORE_NODE][t] && setSignal(i[STORE_NODE][t], e[t]);
1745
1789
  }
1746
1790
  }
1747
- if (l !== e.length) {
1791
+ if (c !== e.length) {
1748
1792
  t = true;
1749
- r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
1793
+ i[STORE_NODE].length && setSignal(i[STORE_NODE].length, e.length);
1750
1794
  }
1751
- t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
1795
+ t && i[STORE_NODE][$TRACK] && setSignal(i[STORE_NODE][$TRACK], void 0);
1752
1796
  return;
1753
1797
  }
1754
- if (c) {
1755
- const t = c[$TRACK];
1756
- const l = t || i ? getAllKeys(s, o, e) : Object.keys(c);
1757
- for (let a = 0, f = l.length; a < f; a++) {
1758
- const f = l[a];
1759
- const E = c[f];
1760
- const T = unwrap(getOverrideValue(s, o, c, f, u));
1761
- let d = unwrap(e[f]);
1762
- if (T === d) continue;
1763
- if (!T || !isWrappable(T) || !isWrappable(d) || (n(T) != null && n(T) !== n(d))) {
1798
+ if (u) {
1799
+ const t = u[$TRACK];
1800
+ const c = t ? getAllKeys(r, o, e) : Object.keys(u);
1801
+ for (let a = 0, l = c.length; a < l; a++) {
1802
+ const l = c[a];
1803
+ const f = u[l];
1804
+ const E = unwrap(getOverrideValue(r, o, u, l, s));
1805
+ let T = unwrap(e[l]);
1806
+ if (E === T) continue;
1807
+ if (!E || !isWrappable(E) || !isWrappable(T) || (n(E) != null && n(E) !== n(T))) {
1764
1808
  t && setSignal(t, void 0);
1765
- E && setSignal(E, isWrappable(d) ? wrap(d, r) : d);
1766
- } else applyState(d, wrap(T, r), n, i);
1809
+ f && setSignal(f, isWrappable(T) ? wrap(T, i) : T);
1810
+ } else applyState(T, wrap(E, i), n);
1767
1811
  }
1768
1812
  }
1769
- if ((c = r[STORE_HAS])) {
1770
- const t = Object.keys(c);
1813
+ if ((u = i[STORE_HAS])) {
1814
+ const t = Object.keys(u);
1771
1815
  for (let n = 0, i = t.length; n < i; n++) {
1772
1816
  const i = t[n];
1773
- setSignal(c[i], i in e);
1817
+ setSignal(u[i], i in e);
1774
1818
  }
1775
1819
  }
1776
1820
  }
1777
- function reconcile(e, t, n = false) {
1778
- return i => {
1779
- if (i == null) throw new Error("Cannot reconcile null or undefined state");
1780
- const r = typeof t === "string" ? e => e[t] : t;
1781
- const s = r(i);
1782
- if (s !== undefined && r(e) !== r(i))
1821
+ function reconcile(e, t) {
1822
+ return n => {
1823
+ if (n == null) throw new Error("Cannot reconcile null or undefined state");
1824
+ const i = typeof t === "string" ? e => e[t] : t;
1825
+ const r = i(n);
1826
+ if (r !== undefined && i(e) !== i(n))
1783
1827
  throw new Error("Cannot reconcile states with different identity");
1784
- applyState(e, i, r, n);
1828
+ applyState(e, n, i);
1785
1829
  };
1786
1830
  }
1787
1831
  function createProjectionInternal(e, t = {}, n) {
@@ -1804,18 +1848,18 @@ function createProjectionInternal(e, t = {}, n) {
1804
1848
  r.set(e, t);
1805
1849
  return t;
1806
1850
  };
1807
- const s = wrapProjection(t);
1851
+ const o = wrapProjection(t);
1808
1852
  i = computed(() => {
1809
1853
  const t = getOwner();
1810
- storeSetter(new Proxy(s, writeTraps), i => {
1854
+ storeSetter(new Proxy(o, writeTraps), i => {
1811
1855
  const r = handleAsync(t, e(i), e => {
1812
- e !== i && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
1856
+ e !== i && e !== undefined && storeSetter(o, reconcile(e, n?.key || "id"));
1813
1857
  });
1814
- r !== i && r !== undefined && reconcile(r, n?.key || "id", n?.all)(s);
1858
+ r !== i && r !== undefined && reconcile(r, n?.key || "id")(o);
1815
1859
  });
1816
1860
  });
1817
- i.Ce = true;
1818
- return { store: s, node: i };
1861
+ i.Pe = true;
1862
+ return { store: o, node: i };
1819
1863
  }
1820
1864
  function createProjection(e, t = {}, n) {
1821
1865
  return createProjectionInternal(e, t, n).store;
@@ -1857,11 +1901,9 @@ const writeTraps = {
1857
1901
  }
1858
1902
  };
1859
1903
  const $TRACK = Symbol(0),
1860
- $DEEP = Symbol(0),
1861
1904
  $TARGET = Symbol(0),
1862
1905
  $PROXY = Symbol(0),
1863
1906
  $DELETED = Symbol(0);
1864
- const PARENTS = new WeakMap();
1865
1907
  const STORE_VALUE = "v",
1866
1908
  STORE_OVERRIDE = "o",
1867
1909
  STORE_OPTIMISTIC_OVERRIDE = "x",
@@ -1902,7 +1944,7 @@ function getNodes(e, t) {
1902
1944
  if (!n) e[t] = n = Object.create(null);
1903
1945
  return n;
1904
1946
  }
1905
- function getNode(e, t, n, i, r = isEqual, s, o) {
1947
+ function getNode(e, t, n, i, r = isEqual, o, s) {
1906
1948
  if (e[t]) return e[t];
1907
1949
  const u = signal(
1908
1950
  n,
@@ -1914,9 +1956,11 @@ function getNode(e, t, n, i, r = isEqual, s, o) {
1914
1956
  },
1915
1957
  i
1916
1958
  );
1917
- if (s) u._e = true;
1918
- if (o && t in o) {
1919
- const e = o[t];
1959
+ if (o) {
1960
+ u.Te = NOT_PENDING;
1961
+ }
1962
+ if (s && t in s) {
1963
+ const e = s[t];
1920
1964
  u.re = e === undefined ? NO_SNAPSHOT : e;
1921
1965
  snapshotSources?.add(u);
1922
1966
  }
@@ -1932,8 +1976,8 @@ function getKeys(e, t, n = true) {
1932
1976
  const i = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
1933
1977
  if (!t) return i;
1934
1978
  const r = new Set(i);
1935
- const s = Reflect.ownKeys(t);
1936
- for (const e of s) {
1979
+ const o = Reflect.ownKeys(t);
1980
+ for (const e of o) {
1937
1981
  if (t[e] !== $DELETED) r.add(e);
1938
1982
  else r.delete(e);
1939
1983
  }
@@ -1953,16 +1997,16 @@ const storeTraps = {
1953
1997
  if (t === $TARGET) return e;
1954
1998
  if (t === $PROXY) return n;
1955
1999
  if (t === $REFRESH) return e[STORE_FIREWALL];
1956
- if (t === $TRACK || t === $DEEP) {
1957
- trackSelf(e, t);
2000
+ if (t === $TRACK) {
2001
+ trackSelf(e);
1958
2002
  return n;
1959
2003
  }
1960
2004
  const i = getNodes(e, STORE_NODE);
1961
2005
  const r = i[t];
1962
- const s = e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE];
1963
- const o = s || (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]);
2006
+ const o = e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE];
2007
+ const s = o || (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]);
1964
2008
  const u = !!e[STORE_VALUE][$TARGET];
1965
- const c = s
2009
+ const c = o
1966
2010
  ? e[STORE_OPTIMISTIC_OVERRIDE]
1967
2011
  : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
1968
2012
  ? e[STORE_OVERRIDE]
@@ -1972,29 +2016,36 @@ const storeTraps = {
1972
2016
  if (e && e.get) return e.get.call(n);
1973
2017
  }
1974
2018
  if (writeOnly(n)) {
1975
- let n = r && (o || !u) ? (r.ae !== NOT_PENDING ? (r._e ? r.fe : r.ae) : r.fe) : c[t];
2019
+ let n =
2020
+ r && (s || !u)
2021
+ ? r.Te !== undefined && r.Te !== NOT_PENDING
2022
+ ? r.Te
2023
+ : r.le !== NOT_PENDING
2024
+ ? r.le
2025
+ : r.fe
2026
+ : c[t];
1976
2027
  n === $DELETED && (n = undefined);
1977
2028
  if (!isWrappable(n)) return n;
1978
2029
  const i = wrap(n, e);
1979
2030
  Writing?.add(i);
1980
2031
  return i;
1981
2032
  }
1982
- let l = r ? (o || !u ? read(i[t]) : (read(i[t]), c[t])) : c[t];
1983
- l === $DELETED && (l = undefined);
2033
+ let a = r ? (s || !u ? read(i[t]) : (read(i[t]), c[t])) : c[t];
2034
+ a === $DELETED && (a = undefined);
1984
2035
  if (!r) {
1985
- if (!o && typeof l === "function" && !c.hasOwnProperty(t)) {
2036
+ if (!s && typeof a === "function" && !c.hasOwnProperty(t)) {
1986
2037
  let t;
1987
2038
  return !Array.isArray(e[STORE_VALUE]) &&
1988
2039
  (t = Object.getPrototypeOf(e[STORE_VALUE])) &&
1989
2040
  t !== Object.prototype
1990
- ? l.bind(c)
1991
- : l;
2041
+ ? a.bind(c)
2042
+ : a;
1992
2043
  } else if (getObserver()) {
1993
2044
  return read(
1994
2045
  getNode(
1995
2046
  i,
1996
2047
  t,
1997
- isWrappable(l) ? wrap(l, e) : l,
2048
+ isWrappable(a) ? wrap(a, e) : a,
1998
2049
  e[STORE_FIREWALL],
1999
2050
  isEqual,
2000
2051
  e[STORE_OPTIMISTIC],
@@ -2003,7 +2054,7 @@ const storeTraps = {
2003
2054
  );
2004
2055
  }
2005
2056
  }
2006
- return isWrappable(l) ? wrap(l, e) : l;
2057
+ return isWrappable(a) ? wrap(a, e) : a;
2007
2058
  },
2008
2059
  has(e, t) {
2009
2060
  if (t === $PROXY || t === $TRACK || t === "__proto__") return true;
@@ -2028,45 +2079,44 @@ const storeTraps = {
2028
2079
  }
2029
2080
  untrack(() => {
2030
2081
  const r = e[STORE_VALUE];
2031
- const s = r[t];
2032
- if (snapshotCaptureActive && typeof t !== "symbol") {
2082
+ const o = r[t];
2083
+ if (
2084
+ snapshotCaptureActive &&
2085
+ typeof t !== "symbol" &&
2086
+ !((e[STORE_FIREWALL]?.Ee ?? 0) & STATUS_PENDING)
2087
+ ) {
2033
2088
  if (!e[STORE_SNAPSHOT_PROPS]) {
2034
2089
  e[STORE_SNAPSHOT_PROPS] = Object.create(null);
2035
2090
  snapshotSources?.add(e);
2036
2091
  }
2037
2092
  if (!(t in e[STORE_SNAPSHOT_PROPS])) {
2038
- e[STORE_SNAPSHOT_PROPS][t] = s;
2093
+ e[STORE_SNAPSHOT_PROPS][t] = o;
2039
2094
  }
2040
2095
  }
2041
- const o = e[STORE_OPTIMISTIC] && !projectionWriteActive;
2042
- const u = o ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
2043
- if (o) trackOptimisticStore(i);
2096
+ const s = e[STORE_OPTIMISTIC] && !projectionWriteActive;
2097
+ const u = s ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
2098
+ if (s) trackOptimisticStore(i);
2044
2099
  const c =
2045
2100
  e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
2046
2101
  ? e[STORE_OPTIMISTIC_OVERRIDE][t]
2047
2102
  : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
2048
2103
  ? e[STORE_OVERRIDE][t]
2049
- : s;
2050
- const l = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2051
- if (c === l) return true;
2052
- const a = e[STORE_OPTIMISTIC_OVERRIDE]?.length || e[STORE_OVERRIDE]?.length || r.length;
2053
- if (l !== undefined && l === s) delete e[u][t];
2054
- else (e[u] || (e[u] = Object.create(null)))[t] = l;
2055
- const f = isWrappable(l);
2056
- if (isWrappable(c)) {
2057
- const e = PARENTS.get(c);
2058
- e && (e instanceof Set ? e.delete(i) : PARENTS.delete(c));
2059
- }
2060
- if (recursivelyNotify(i, storeLookup) && f) recursivelyAddParent(l, i);
2104
+ : o;
2105
+ const a = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2106
+ if (c === a) return true;
2107
+ const l = e[STORE_OPTIMISTIC_OVERRIDE]?.length || e[STORE_OVERRIDE]?.length || r.length;
2108
+ if (a !== undefined && a === o) delete e[u][t];
2109
+ else (e[u] || (e[u] = Object.create(null)))[t] = a;
2110
+ const f = isWrappable(a);
2061
2111
  e[STORE_HAS]?.[t] && setSignal(e[STORE_HAS][t], true);
2062
2112
  const E = getNodes(e, STORE_NODE);
2063
- E[t] && setSignal(E[t], () => (f ? wrap(l, e) : l));
2113
+ E[t] && setSignal(E[t], () => (f ? wrap(a, e) : a));
2064
2114
  if (Array.isArray(r)) {
2065
2115
  if (t === "length") {
2066
- E.length && setSignal(E.length, l);
2116
+ E.length && setSignal(E.length, a);
2067
2117
  } else {
2068
2118
  const e = parseInt(t) + 1;
2069
- if (e > a) E.length && setSignal(E.length, e);
2119
+ if (e > l) E.length && setSignal(E.length, e);
2070
2120
  }
2071
2121
  }
2072
2122
  E[$TRACK] && setSignal(E[$TRACK], undefined);
@@ -2093,14 +2143,10 @@ const storeTraps = {
2093
2143
  } else if (e[i] && t in e[i]) {
2094
2144
  delete e[i][t];
2095
2145
  } else return true;
2096
- if (isWrappable(r)) {
2097
- const t = PARENTS.get(r);
2098
- t && (t instanceof Set ? t.delete(e) : PARENTS.delete(r));
2099
- }
2100
2146
  if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], false);
2101
- const s = getNodes(e, STORE_NODE);
2102
- s[t] && setSignal(s[t], undefined);
2103
- s[$TRACK] && setSignal(s[$TRACK], undefined);
2147
+ const o = getNodes(e, STORE_NODE);
2148
+ o[t] && setSignal(o[t], undefined);
2149
+ o[$TRACK] && setSignal(o[$TRACK], undefined);
2104
2150
  });
2105
2151
  }
2106
2152
  return true;
@@ -2167,66 +2213,13 @@ function createStore(e, t, n) {
2167
2213
  r = i ? createProjectionInternal(e, t, n).store : wrap(e);
2168
2214
  return [r, e => storeSetter(r, e)];
2169
2215
  }
2170
- function recursivelyNotify(e, t) {
2171
- let n = e[$TARGET] || t?.get(e)?.[$TARGET];
2172
- let i = false;
2173
- if (n) {
2174
- const e = getNodes(n, STORE_NODE)[$DEEP];
2175
- if (e) {
2176
- setSignal(e, undefined);
2177
- i = true;
2178
- }
2179
- t = n[STORE_LOOKUP] || t;
2180
- }
2181
- const r = PARENTS.get(n?.[STORE_VALUE] || e);
2182
- if (!r) return i;
2183
- if (r instanceof Set) {
2184
- for (let e of r) i = recursivelyNotify(e, t) || i;
2185
- } else i = recursivelyNotify(r, t) || i;
2186
- return i;
2187
- }
2188
- function recursivelyAddParent(e, t) {
2189
- let n;
2190
- const i = e[$TARGET];
2191
- if (i) {
2192
- n = i[STORE_OVERRIDE];
2193
- e = i[STORE_VALUE];
2194
- }
2195
- if (t) {
2196
- let n = PARENTS.get(e);
2197
- if (!n) PARENTS.set(e, t);
2198
- else if (n !== t) {
2199
- if (!(n instanceof Set)) PARENTS.set(e, (n = new Set([n])));
2200
- else if (n.has(t)) return;
2201
- n.add(t);
2202
- } else return;
2203
- }
2204
- if (Array.isArray(e)) {
2205
- const t = n?.length || e.length;
2206
- for (let i = 0; i < t; i++) {
2207
- const t = n && i in n ? n[i] : e[i];
2208
- isWrappable(t) && recursivelyAddParent(t, e);
2209
- }
2210
- } else {
2211
- const t = getKeys(e, n);
2212
- for (let i = 0; i < t.length; i++) {
2213
- const r = t[i];
2214
- const s = n && r in n ? n[r] : e[r];
2215
- isWrappable(s) && recursivelyAddParent(s, e);
2216
- }
2217
- }
2218
- }
2219
- function deep(e) {
2220
- recursivelyAddParent(e);
2221
- return e[$DEEP];
2222
- }
2223
2216
  function createOptimisticStore(e, t, n) {
2224
- GlobalQueue.Z ||= clearOptimisticStore;
2217
+ GlobalQueue.B ||= clearOptimisticStore;
2225
2218
  const i = typeof e === "function";
2226
2219
  const r = (i ? t : e) ?? {};
2227
- const s = i ? e : undefined;
2228
- const { store: o } = createOptimisticProjectionInternal(s, r, n);
2229
- return [o, e => storeSetter(o, e)];
2220
+ const o = i ? e : undefined;
2221
+ const { store: s } = createOptimisticProjectionInternal(o, r, n);
2222
+ return [s, e => storeSetter(s, e)];
2230
2223
  }
2231
2224
  function clearOptimisticStore(e) {
2232
2225
  const t = e[$TARGET];
@@ -2276,30 +2269,30 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
2276
2269
  r.set(e, t);
2277
2270
  return t;
2278
2271
  };
2279
- const s = wrapProjection(t);
2272
+ const o = wrapProjection(t);
2280
2273
  if (e) {
2281
2274
  i = computed(() => {
2282
2275
  const t = getOwner();
2283
2276
  setProjectionWriteActive(true);
2284
2277
  try {
2285
- storeSetter(new Proxy(s, writeTraps), i => {
2278
+ storeSetter(new Proxy(o, writeTraps), i => {
2286
2279
  const r = handleAsync(t, e(i), e => {
2287
2280
  setProjectionWriteActive(true);
2288
2281
  try {
2289
- e !== i && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
2282
+ e !== i && e !== undefined && storeSetter(o, reconcile(e, n?.key || "id"));
2290
2283
  } finally {
2291
2284
  setProjectionWriteActive(false);
2292
2285
  }
2293
2286
  });
2294
- r !== i && r !== undefined && reconcile(r, n?.key || "id", n?.all)(s);
2287
+ r !== i && r !== undefined && reconcile(r, n?.key || "id")(o);
2295
2288
  });
2296
2289
  } finally {
2297
2290
  setProjectionWriteActive(false);
2298
2291
  }
2299
2292
  });
2300
- i.Ce = true;
2293
+ i.Pe = true;
2301
2294
  }
2302
- return { store: s, node: i };
2295
+ return { store: o, node: i };
2303
2296
  }
2304
2297
  const DELETE = Symbol(0);
2305
2298
  function updatePath(e, t, n = 0) {
@@ -2307,8 +2300,8 @@ function updatePath(e, t, n = 0) {
2307
2300
  r = e;
2308
2301
  if (n < t.length - 1) {
2309
2302
  i = t[n];
2310
- const s = typeof i;
2311
- const o = Array.isArray(e);
2303
+ const o = typeof i;
2304
+ const s = Array.isArray(e);
2312
2305
  if (Array.isArray(i)) {
2313
2306
  for (let r = 0; r < i.length; r++) {
2314
2307
  t[n] = i[r];
@@ -2316,7 +2309,7 @@ function updatePath(e, t, n = 0) {
2316
2309
  }
2317
2310
  t[n] = i;
2318
2311
  return;
2319
- } else if (o && s === "function") {
2312
+ } else if (s && o === "function") {
2320
2313
  for (let r = 0; r < e.length; r++) {
2321
2314
  if (i(e[r], r)) {
2322
2315
  t[n] = r;
@@ -2325,9 +2318,9 @@ function updatePath(e, t, n = 0) {
2325
2318
  }
2326
2319
  t[n] = i;
2327
2320
  return;
2328
- } else if (o && s === "object") {
2329
- const { from: r = 0, to: s = e.length - 1, by: o = 1 } = i;
2330
- for (let i = r; i <= s; i += o) {
2321
+ } else if (s && o === "object") {
2322
+ const { from: r = 0, to: o = e.length - 1, by: s = 1 } = i;
2323
+ for (let i = r; i <= o; i += s) {
2331
2324
  t[n] = i;
2332
2325
  updatePath(e, t, n);
2333
2326
  }
@@ -2339,20 +2332,20 @@ function updatePath(e, t, n = 0) {
2339
2332
  }
2340
2333
  r = e[i];
2341
2334
  }
2342
- let s = t[t.length - 1];
2343
- if (typeof s === "function") {
2344
- s = s(r);
2345
- if (s === r) return;
2335
+ let o = t[t.length - 1];
2336
+ if (typeof o === "function") {
2337
+ o = o(r);
2338
+ if (o === r) return;
2346
2339
  }
2347
- if (i === undefined && s == undefined) return;
2348
- if (s === DELETE) {
2340
+ if (i === undefined && o == undefined) return;
2341
+ if (o === DELETE) {
2349
2342
  delete e[i];
2350
- } else if (i === undefined || (isWrappable(r) && isWrappable(s) && !Array.isArray(s))) {
2343
+ } else if (i === undefined || (isWrappable(r) && isWrappable(o) && !Array.isArray(o))) {
2351
2344
  const t = i !== undefined ? e[i] : e;
2352
- const n = Object.keys(s);
2353
- for (let e = 0; e < n.length; e++) t[n[e]] = s[n[e]];
2345
+ const n = Object.keys(o);
2346
+ for (let e = 0; e < n.length; e++) t[n[e]] = o[n[e]];
2354
2347
  } else {
2355
- e[i] = s;
2348
+ e[i] = o;
2356
2349
  }
2357
2350
  }
2358
2351
  const storePath = Object.assign(
@@ -2363,51 +2356,60 @@ const storePath = Object.assign(
2363
2356
  },
2364
2357
  { DELETE: DELETE }
2365
2358
  );
2366
- function snapshot(e, t, n) {
2367
- let i, r, s, o, u, c;
2359
+ function snapshotImpl(e, t, n, i) {
2360
+ let r, o, s, u, c, a;
2368
2361
  if (!isWrappable(e)) return e;
2369
- if (t && t.has(e)) return t.get(e);
2370
- if (!t) t = new Map();
2371
- if ((i = e[$TARGET] || n?.get(e)?.[$TARGET])) {
2372
- s = i[STORE_OVERRIDE];
2373
- r = Array.isArray(i[STORE_VALUE]);
2374
- t.set(
2362
+ if (n && n.has(e)) return n.get(e);
2363
+ if (!n) n = new Map();
2364
+ if ((r = e[$TARGET] || i?.get(e)?.[$TARGET])) {
2365
+ if (t) trackSelf(r, $TRACK);
2366
+ s = r[STORE_OVERRIDE];
2367
+ o = Array.isArray(r[STORE_VALUE]);
2368
+ n.set(
2375
2369
  e,
2376
- s ? (o = r ? [] : Object.create(Object.getPrototypeOf(i[STORE_VALUE]))) : i[STORE_VALUE]
2370
+ s ? (u = o ? [] : Object.create(Object.getPrototypeOf(r[STORE_VALUE]))) : r[STORE_VALUE]
2377
2371
  );
2378
- e = i[STORE_VALUE];
2379
- n = storeLookup;
2372
+ e = r[STORE_VALUE];
2373
+ i = storeLookup;
2380
2374
  } else {
2381
- r = Array.isArray(e);
2382
- t.set(e, e);
2375
+ o = Array.isArray(e);
2376
+ n.set(e, e);
2383
2377
  }
2384
- if (r) {
2385
- const i = s?.length || e.length;
2386
- for (let r = 0; r < i; r++) {
2387
- c = s && r in s ? s[r] : e[r];
2388
- if (c === $DELETED) continue;
2389
- if ((u = snapshot(c, t, n)) !== c || o) {
2390
- if (!o) t.set(e, (o = [...e]));
2391
- o[r] = u;
2378
+ if (o) {
2379
+ const o = s?.length || e.length;
2380
+ for (let l = 0; l < o; l++) {
2381
+ a = s && l in s ? s[l] : e[l];
2382
+ if (a === $DELETED) continue;
2383
+ if (t && isWrappable(a)) wrap(a, r);
2384
+ if ((c = snapshotImpl(a, t, n, i)) !== a || u) {
2385
+ if (!u) n.set(e, (u = [...e]));
2386
+ u[l] = c;
2392
2387
  }
2393
2388
  }
2394
2389
  } else {
2395
- const i = getKeys(e, s);
2396
- for (let r = 0, l = i.length; r < l; r++) {
2397
- let l = i[r];
2398
- const a = getPropertyDescriptor(e, s, l);
2399
- if (a.get) continue;
2400
- c = s && l in s ? s[l] : e[l];
2401
- if ((u = snapshot(c, t, n)) !== e[l] || o) {
2402
- if (!o) {
2403
- o = Object.create(Object.getPrototypeOf(e));
2404
- Object.assign(o, e);
2390
+ const o = getKeys(e, s);
2391
+ for (let l = 0, f = o.length; l < f; l++) {
2392
+ let f = o[l];
2393
+ const E = getPropertyDescriptor(e, s, f);
2394
+ if (E.get) continue;
2395
+ a = s && f in s ? s[f] : e[f];
2396
+ if (t && isWrappable(a)) wrap(a, r);
2397
+ if ((c = snapshotImpl(a, t, n, i)) !== e[f] || u) {
2398
+ if (!u) {
2399
+ u = Object.create(Object.getPrototypeOf(e));
2400
+ Object.assign(u, e);
2405
2401
  }
2406
- o[l] = u;
2402
+ u[f] = c;
2407
2403
  }
2408
2404
  }
2409
2405
  }
2410
- return o || e;
2406
+ return u || e;
2407
+ }
2408
+ function snapshot(e, t, n) {
2409
+ return snapshotImpl(e, false, t, n);
2410
+ }
2411
+ function deep(e) {
2412
+ return snapshotImpl(e, true);
2411
2413
  }
2412
2414
  function trueFn() {
2413
2415
  return true;
@@ -2449,8 +2451,8 @@ function merge(...e) {
2449
2451
  for (let i = 0; i < e.length; i++) {
2450
2452
  const r = e[i];
2451
2453
  t = t || (!!r && $PROXY in r);
2452
- const s = !!r && r[$SOURCES];
2453
- if (s) n.push(...s);
2454
+ const o = !!r && r[$SOURCES];
2455
+ if (o) n.push(...o);
2454
2456
  else n.push(typeof r === "function" ? ((t = true), createMemo(r)) : r);
2455
2457
  }
2456
2458
  if (SUPPORTS_PROXY && t) {
@@ -2480,35 +2482,35 @@ function merge(...e) {
2480
2482
  }
2481
2483
  const i = Object.create(null);
2482
2484
  let r = false;
2483
- let s = n.length - 1;
2484
- for (let e = s; e >= 0; e--) {
2485
+ let o = n.length - 1;
2486
+ for (let e = o; e >= 0; e--) {
2485
2487
  const t = n[e];
2486
2488
  if (!t) {
2487
- e === s && s--;
2489
+ e === o && o--;
2488
2490
  continue;
2489
2491
  }
2490
- const o = Object.getOwnPropertyNames(t);
2491
- for (let n = o.length - 1; n >= 0; n--) {
2492
- const u = o[n];
2492
+ const s = Object.getOwnPropertyNames(t);
2493
+ for (let n = s.length - 1; n >= 0; n--) {
2494
+ const u = s[n];
2493
2495
  if (u === "__proto__" || u === "constructor") continue;
2494
2496
  if (!i[u]) {
2495
- r = r || e !== s;
2497
+ r = r || e !== o;
2496
2498
  const n = Object.getOwnPropertyDescriptor(t, u);
2497
2499
  i[u] = n.get ? { enumerable: true, configurable: true, get: n.get.bind(t) } : n;
2498
2500
  }
2499
2501
  }
2500
2502
  }
2501
- if (!r) return n[s];
2502
- const o = {};
2503
+ if (!r) return n[o];
2504
+ const s = {};
2503
2505
  const u = Object.keys(i);
2504
2506
  for (let e = u.length - 1; e >= 0; e--) {
2505
2507
  const t = u[e],
2506
2508
  n = i[t];
2507
- if (n.get) Object.defineProperty(o, t, n);
2508
- else o[t] = n.value;
2509
+ if (n.get) Object.defineProperty(s, t, n);
2510
+ else s[t] = n.value;
2509
2511
  }
2510
- o[$SOURCES] = n;
2511
- return o;
2512
+ s[$SOURCES] = n;
2513
+ return s;
2512
2514
  }
2513
2515
  function omit(e, ...t) {
2514
2516
  const n = new Set(t);
@@ -2542,26 +2544,26 @@ function omit(e, ...t) {
2542
2544
  function mapArray(e, t, n) {
2543
2545
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
2544
2546
  const r = t.length > 1;
2545
- const s = t;
2547
+ const o = t;
2546
2548
  return createMemo(
2547
2549
  updateKeyedMap.bind({
2548
2550
  Fe: createOwner(),
2549
- $e: 0,
2550
- je: e,
2551
- Ke: [],
2552
- Ye: s,
2553
- Ze: [],
2551
+ Me: 0,
2552
+ $e: e,
2553
+ je: [],
2554
+ Ke: o,
2555
+ Ye: [],
2554
2556
  Be: [],
2555
- Xe: i,
2557
+ Ze: i,
2556
2558
  qe: i || n?.keyed === false ? [] : undefined,
2557
- ze: r ? [] : undefined,
2558
- Je: n?.fallback
2559
+ Xe: r ? [] : undefined,
2560
+ ze: n?.fallback
2559
2561
  })
2560
2562
  );
2561
2563
  }
2562
2564
  const pureOptions = { pureWrite: true };
2563
2565
  function updateKeyedMap() {
2564
- const e = this.je() || [],
2566
+ const e = this.$e() || [],
2565
2567
  t = e.length;
2566
2568
  e[$TRACK];
2567
2569
  runWithOwner(this.Fe, () => {
@@ -2570,192 +2572,189 @@ function updateKeyedMap() {
2570
2572
  r = this.qe
2571
2573
  ? () => {
2572
2574
  this.qe[i] = signal(e[i], pureOptions);
2573
- this.ze && (this.ze[i] = signal(i, pureOptions));
2574
- return this.Ye(
2575
- read.bind(null, this.qe[i]),
2576
- this.ze ? read.bind(null, this.ze[i]) : undefined
2577
- );
2575
+ this.Xe && (this.Xe[i] = signal(i, pureOptions));
2576
+ return this.Ke(accessor(this.qe[i]), this.Xe ? accessor(this.Xe[i]) : undefined);
2578
2577
  }
2579
- : this.ze
2578
+ : this.Xe
2580
2579
  ? () => {
2581
2580
  const t = e[i];
2582
- this.ze[i] = signal(i, pureOptions);
2583
- return this.Ye(() => t, read.bind(null, this.ze[i]));
2581
+ this.Xe[i] = signal(i, pureOptions);
2582
+ return this.Ke(() => t, accessor(this.Xe[i]));
2584
2583
  }
2585
2584
  : () => {
2586
2585
  const t = e[i];
2587
- return this.Ye(() => t);
2586
+ return this.Ke(() => t);
2588
2587
  };
2589
2588
  if (t === 0) {
2590
- if (this.$e !== 0) {
2589
+ if (this.Me !== 0) {
2591
2590
  this.Fe.dispose(false);
2592
2591
  this.Be = [];
2593
- this.Ke = [];
2594
- this.Ze = [];
2595
- this.$e = 0;
2592
+ this.je = [];
2593
+ this.Ye = [];
2594
+ this.Me = 0;
2596
2595
  this.qe && (this.qe = []);
2597
- this.ze && (this.ze = []);
2596
+ this.Xe && (this.Xe = []);
2598
2597
  }
2599
- if (this.Je && !this.Ze[0]) {
2600
- this.Ze[0] = runWithOwner((this.Be[0] = createOwner()), this.Je);
2598
+ if (this.ze && !this.Ye[0]) {
2599
+ this.Ye[0] = runWithOwner((this.Be[0] = createOwner()), this.ze);
2601
2600
  }
2602
- } else if (this.$e === 0) {
2601
+ } else if (this.Me === 0) {
2603
2602
  if (this.Be[0]) this.Be[0].dispose();
2604
- this.Ze = new Array(t);
2603
+ this.Ye = new Array(t);
2605
2604
  for (i = 0; i < t; i++) {
2606
- this.Ke[i] = e[i];
2607
- this.Ze[i] = runWithOwner((this.Be[i] = createOwner()), r);
2605
+ this.je[i] = e[i];
2606
+ this.Ye[i] = runWithOwner((this.Be[i] = createOwner()), r);
2608
2607
  }
2609
- this.$e = t;
2608
+ this.Me = t;
2610
2609
  } else {
2611
- let s,
2612
- o,
2610
+ let o,
2611
+ s,
2613
2612
  u,
2614
2613
  c,
2615
- l,
2616
2614
  a,
2615
+ l,
2617
2616
  f,
2618
2617
  E = new Array(t),
2619
2618
  T = new Array(t),
2620
2619
  d = this.qe ? new Array(t) : undefined,
2621
- S = this.ze ? new Array(t) : undefined;
2620
+ S = this.Xe ? new Array(t) : undefined;
2622
2621
  for (
2623
- s = 0, o = Math.min(this.$e, t);
2624
- s < o && (this.Ke[s] === e[s] || (this.qe && compare(this.Xe, this.Ke[s], e[s])));
2625
- s++
2622
+ o = 0, s = Math.min(this.Me, t);
2623
+ o < s && (this.je[o] === e[o] || (this.qe && compare(this.Ze, this.je[o], e[o])));
2624
+ o++
2626
2625
  ) {
2627
- if (this.qe) setSignal(this.qe[s], e[s]);
2626
+ if (this.qe) setSignal(this.qe[o], e[o]);
2628
2627
  }
2629
2628
  for (
2630
- o = this.$e - 1, u = t - 1;
2631
- o >= s &&
2632
- u >= s &&
2633
- (this.Ke[o] === e[u] || (this.qe && compare(this.Xe, this.Ke[o], e[u])));
2634
- o--, u--
2629
+ s = this.Me - 1, u = t - 1;
2630
+ s >= o &&
2631
+ u >= o &&
2632
+ (this.je[s] === e[u] || (this.qe && compare(this.Ze, this.je[s], e[u])));
2633
+ s--, u--
2635
2634
  ) {
2636
- E[u] = this.Ze[o];
2637
- T[u] = this.Be[o];
2638
- d && (d[u] = this.qe[o]);
2639
- S && (S[u] = this.ze[o]);
2635
+ E[u] = this.Ye[s];
2636
+ T[u] = this.Be[s];
2637
+ d && (d[u] = this.qe[s]);
2638
+ S && (S[u] = this.Xe[s]);
2640
2639
  }
2641
- a = new Map();
2640
+ l = new Map();
2642
2641
  f = new Array(u + 1);
2643
- for (i = u; i >= s; i--) {
2642
+ for (i = u; i >= o; i--) {
2644
2643
  c = e[i];
2645
- l = this.Xe ? this.Xe(c) : c;
2646
- n = a.get(l);
2644
+ a = this.Ze ? this.Ze(c) : c;
2645
+ n = l.get(a);
2647
2646
  f[i] = n === undefined ? -1 : n;
2648
- a.set(l, i);
2647
+ l.set(a, i);
2649
2648
  }
2650
- for (n = s; n <= o; n++) {
2651
- c = this.Ke[n];
2652
- l = this.Xe ? this.Xe(c) : c;
2653
- i = a.get(l);
2649
+ for (n = o; n <= s; n++) {
2650
+ c = this.je[n];
2651
+ a = this.Ze ? this.Ze(c) : c;
2652
+ i = l.get(a);
2654
2653
  if (i !== undefined && i !== -1) {
2655
- E[i] = this.Ze[n];
2654
+ E[i] = this.Ye[n];
2656
2655
  T[i] = this.Be[n];
2657
2656
  d && (d[i] = this.qe[n]);
2658
- S && (S[i] = this.ze[n]);
2657
+ S && (S[i] = this.Xe[n]);
2659
2658
  i = f[i];
2660
- a.set(l, i);
2659
+ l.set(a, i);
2661
2660
  } else this.Be[n].dispose();
2662
2661
  }
2663
- for (i = s; i < t; i++) {
2662
+ for (i = o; i < t; i++) {
2664
2663
  if (i in E) {
2665
- this.Ze[i] = E[i];
2664
+ this.Ye[i] = E[i];
2666
2665
  this.Be[i] = T[i];
2667
2666
  if (d) {
2668
2667
  this.qe[i] = d[i];
2669
2668
  setSignal(this.qe[i], e[i]);
2670
2669
  }
2671
2670
  if (S) {
2672
- this.ze[i] = S[i];
2673
- setSignal(this.ze[i], i);
2671
+ this.Xe[i] = S[i];
2672
+ setSignal(this.Xe[i], i);
2674
2673
  }
2675
2674
  } else {
2676
- this.Ze[i] = runWithOwner((this.Be[i] = createOwner()), r);
2675
+ this.Ye[i] = runWithOwner((this.Be[i] = createOwner()), r);
2677
2676
  }
2678
2677
  }
2679
- this.Ze = this.Ze.slice(0, (this.$e = t));
2680
- this.Ke = e.slice(0);
2678
+ this.Ye = this.Ye.slice(0, (this.Me = t));
2679
+ this.je = e.slice(0);
2681
2680
  }
2682
2681
  });
2683
- return this.Ze;
2682
+ return this.Ye;
2684
2683
  }
2685
2684
  function repeat(e, t, n) {
2686
2685
  const i = t;
2687
2686
  return updateRepeat.bind({
2688
2687
  Fe: createOwner(),
2689
- $e: 0,
2690
- et: 0,
2691
- tt: e,
2692
- Ye: i,
2688
+ Me: 0,
2689
+ Je: 0,
2690
+ et: e,
2691
+ Ke: i,
2693
2692
  Be: [],
2694
- Ze: [],
2695
- nt: n?.from,
2696
- Je: n?.fallback
2693
+ Ye: [],
2694
+ tt: n?.from,
2695
+ ze: n?.fallback
2697
2696
  });
2698
2697
  }
2699
2698
  function updateRepeat() {
2700
- const e = this.tt();
2701
- const t = this.nt?.() || 0;
2699
+ const e = this.et();
2700
+ const t = this.tt?.() || 0;
2702
2701
  runWithOwner(this.Fe, () => {
2703
2702
  if (e === 0) {
2704
- if (this.$e !== 0) {
2703
+ if (this.Me !== 0) {
2705
2704
  this.Fe.dispose(false);
2706
2705
  this.Be = [];
2707
- this.Ze = [];
2708
- this.$e = 0;
2706
+ this.Ye = [];
2707
+ this.Me = 0;
2709
2708
  }
2710
- if (this.Je && !this.Ze[0]) {
2711
- this.Ze[0] = runWithOwner((this.Be[0] = createOwner()), this.Je);
2709
+ if (this.ze && !this.Ye[0]) {
2710
+ this.Ye[0] = runWithOwner((this.Be[0] = createOwner()), this.ze);
2712
2711
  }
2713
2712
  return;
2714
2713
  }
2715
2714
  const n = t + e;
2716
- const i = this.et + this.$e;
2717
- if (this.$e === 0 && this.Be[0]) this.Be[0].dispose();
2718
- for (let e = n; e < i; e++) this.Be[e - this.et].dispose();
2719
- if (this.et < t) {
2720
- let e = this.et;
2721
- while (e < t && e < this.$e) this.Be[e++].dispose();
2722
- this.Be.splice(0, t - this.et);
2723
- this.Ze.splice(0, t - this.et);
2724
- } else if (this.et > t) {
2725
- let n = i - this.et - 1;
2726
- let r = this.et - t;
2727
- this.Be.length = this.Ze.length = e;
2715
+ const i = this.Je + this.Me;
2716
+ if (this.Me === 0 && this.Be[0]) this.Be[0].dispose();
2717
+ for (let e = n; e < i; e++) this.Be[e - this.Je].dispose();
2718
+ if (this.Je < t) {
2719
+ let e = this.Je;
2720
+ while (e < t && e < this.Me) this.Be[e++].dispose();
2721
+ this.Be.splice(0, t - this.Je);
2722
+ this.Ye.splice(0, t - this.Je);
2723
+ } else if (this.Je > t) {
2724
+ let n = i - this.Je - 1;
2725
+ let r = this.Je - t;
2726
+ this.Be.length = this.Ye.length = e;
2728
2727
  while (n >= r) {
2729
2728
  this.Be[n] = this.Be[n - r];
2730
- this.Ze[n] = this.Ze[n - r];
2729
+ this.Ye[n] = this.Ye[n - r];
2731
2730
  n--;
2732
2731
  }
2733
2732
  for (let e = 0; e < r; e++) {
2734
- this.Ze[e] = runWithOwner((this.Be[e] = createOwner()), () => this.Ye(e + t));
2733
+ this.Ye[e] = runWithOwner((this.Be[e] = createOwner()), () => this.Ke(e + t));
2735
2734
  }
2736
2735
  }
2737
2736
  for (let e = i; e < n; e++) {
2738
- this.Ze[e - t] = runWithOwner((this.Be[e - t] = createOwner()), () => this.Ye(e));
2737
+ this.Ye[e - t] = runWithOwner((this.Be[e - t] = createOwner()), () => this.Ke(e));
2739
2738
  }
2740
- this.Ze = this.Ze.slice(0, e);
2741
- this.et = t;
2742
- this.$e = e;
2739
+ this.Ye = this.Ye.slice(0, e);
2740
+ this.Je = t;
2741
+ this.Me = e;
2743
2742
  });
2744
- return this.Ze;
2743
+ return this.Ye;
2745
2744
  }
2746
2745
  function compare(e, t, n) {
2747
2746
  return e ? e(t) === e(n) : true;
2748
2747
  }
2749
2748
  function boundaryComputed(e, t) {
2750
2749
  const n = computed(e, undefined, { lazy: true });
2751
- n.Ae = (e, t) => {
2750
+ n.he = (e, t) => {
2752
2751
  const i = e !== undefined ? e : n.Ee;
2753
- const r = t !== undefined ? t : n.X;
2754
- n.Ee &= ~n.it;
2755
- n.ce.notify(n, n.it, i, r);
2752
+ const r = t !== undefined ? t : n.q;
2753
+ n.Ee &= ~n.nt;
2754
+ n.ce.notify(n, n.nt, i, r);
2756
2755
  };
2757
- n.it = t;
2758
- n.Ce = true;
2756
+ n.nt = t;
2757
+ n.Pe = true;
2759
2758
  recompute(n, true);
2760
2759
  return n;
2761
2760
  }
@@ -2768,64 +2767,90 @@ function createBoundChildren(e, t, n, i) {
2768
2767
  return boundaryComputed(() => staleValues(() => flatten(read(e))), i);
2769
2768
  });
2770
2769
  }
2770
+ const ON_INIT = Symbol();
2771
2771
  class CollectionQueue extends Queue {
2772
- rt;
2773
- st = new Set();
2772
+ it;
2773
+ rt = new Set();
2774
2774
  ot = signal(false, { pureWrite: true });
2775
- ut = false;
2775
+ st = false;
2776
+ ut;
2777
+ ct = ON_INIT;
2776
2778
  constructor(e) {
2777
2779
  super();
2778
- this.rt = e;
2780
+ this.it = e;
2779
2781
  }
2780
2782
  run(e) {
2781
2783
  if (!e || read(this.ot)) return;
2782
2784
  return super.run(e);
2783
2785
  }
2784
2786
  notify(e, t, n, i) {
2785
- if (!(t & this.rt) || (this.rt & STATUS_PENDING && this.ut)) return super.notify(e, t, n, i);
2786
- if (n & this.rt) {
2787
- const t = i?.source || e.X?.source;
2787
+ if (!(t & this.it)) return super.notify(e, t, n, i);
2788
+ if (this.st && this.ut) {
2789
+ const e = untrack(() => {
2790
+ try {
2791
+ return this.ut();
2792
+ } catch {
2793
+ return ON_INIT;
2794
+ }
2795
+ });
2796
+ if (e !== this.ct) {
2797
+ this.ct = e;
2798
+ this.st = false;
2799
+ this.rt.clear();
2800
+ }
2801
+ }
2802
+ if (this.it & STATUS_PENDING && this.st) return super.notify(e, t, n, i);
2803
+ if (n & this.it) {
2804
+ const t = i?.source || e.q?.source;
2788
2805
  if (t) {
2789
- const e = this.st.size === 0;
2790
- this.st.add(t);
2806
+ const e = this.rt.size === 0;
2807
+ this.rt.add(t);
2791
2808
  if (e) setSignal(this.ot, true);
2792
2809
  }
2793
2810
  }
2794
- t &= ~this.rt;
2811
+ t &= ~this.it;
2795
2812
  return t ? super.notify(e, t, n, i) : true;
2796
2813
  }
2797
2814
  checkSources() {
2798
- for (const e of this.st) {
2799
- if (!(e.Ee & this.rt)) this.st.delete(e);
2815
+ for (const e of this.rt) {
2816
+ if (!(e.Ee & this.it)) this.rt.delete(e);
2817
+ }
2818
+ if (!this.rt.size) {
2819
+ setSignal(this.ot, false);
2820
+ if (this.ut) {
2821
+ try {
2822
+ this.ct = untrack(() => this.ut());
2823
+ } catch {}
2824
+ }
2800
2825
  }
2801
- if (!this.st.size) setSignal(this.ot, false);
2802
2826
  }
2803
2827
  }
2804
- function createCollectionBoundary(e, t, n) {
2805
- const i = createOwner();
2806
- const r = new CollectionQueue(e);
2807
- const s = createBoundChildren(i, t, r, e);
2808
- const o = computed(() => {
2809
- if (!read(r.ot)) {
2828
+ function createCollectionBoundary(e, t, n, i) {
2829
+ const r = createOwner();
2830
+ const o = new CollectionQueue(e);
2831
+ if (i) o.ut = i;
2832
+ const s = createBoundChildren(r, t, o, e);
2833
+ const u = computed(() => {
2834
+ if (!read(o.ot)) {
2810
2835
  const e = read(s);
2811
- if (!untrack(() => read(r.ot))) {
2812
- r.ut = true;
2836
+ if (!untrack(() => read(o.ot))) {
2837
+ o.st = true;
2813
2838
  return e;
2814
2839
  }
2815
2840
  }
2816
- return n(r);
2841
+ return n(o);
2817
2842
  });
2818
- return read.bind(null, o);
2843
+ return accessor(u);
2819
2844
  }
2820
- function createLoadBoundary(e, t) {
2821
- return createCollectionBoundary(STATUS_PENDING, e, () => t());
2845
+ function createLoadingBoundary(e, t, n) {
2846
+ return createCollectionBoundary(STATUS_PENDING, e, () => t(), n?.on);
2822
2847
  }
2823
2848
  function createErrorBoundary(e, t) {
2824
2849
  return createCollectionBoundary(STATUS_ERROR, e, e => {
2825
- let n = e.st.values().next().value;
2826
- const i = n.X?.cause ?? n.X;
2850
+ let n = e.rt.values().next().value;
2851
+ const i = n.q?.cause ?? n.q;
2827
2852
  return t(i, () => {
2828
- for (const t of e.st) recompute(t);
2853
+ for (const t of e.rt) recompute(t);
2829
2854
  schedule();
2830
2855
  });
2831
2856
  });
@@ -2854,9 +2879,9 @@ function flatten(e, t) {
2854
2879
  function flattenArray(e, t = [], n) {
2855
2880
  let i = null;
2856
2881
  let r = false;
2857
- for (let s = 0; s < e.length; s++) {
2882
+ for (let o = 0; o < e.length; o++) {
2858
2883
  try {
2859
- let i = e[s];
2884
+ let i = e[o];
2860
2885
  if (typeof i === "function" && !i.length) {
2861
2886
  if (n?.doNotUnwrap) {
2862
2887
  t.push(i);
@@ -2893,7 +2918,7 @@ export {
2893
2918
  createContext,
2894
2919
  createEffect,
2895
2920
  createErrorBoundary,
2896
- createLoadBoundary,
2921
+ createLoadingBoundary,
2897
2922
  createMemo,
2898
2923
  createOptimistic,
2899
2924
  createOptimisticStore,
@@ -2906,6 +2931,8 @@ export {
2906
2931
  createStore,
2907
2932
  createTrackedEffect,
2908
2933
  deep,
2934
+ enableExternalSource,
2935
+ enforceLoadingBoundary,
2909
2936
  flatten,
2910
2937
  flush,
2911
2938
  getContext,
@@ -2932,7 +2959,6 @@ export {
2932
2959
  resolve,
2933
2960
  runWithOwner,
2934
2961
  setContext,
2935
- setOnUnhandledAsync,
2936
2962
  setSnapshotCapture,
2937
2963
  snapshot,
2938
2964
  storePath,