@solidjs/signals 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.cjs CHANGED
@@ -117,10 +117,10 @@ function runHeap(e, t) {
117
117
  function adjustHeight(e, t) {
118
118
  deleteFromHeap(e, t);
119
119
  let n = e.o;
120
- for (let t = e.W; t; t = t.P) {
121
- const e = t.H;
122
- const r = e.I || e;
123
- if (r.F && r.o >= n) n = r.o + 1;
120
+ for (let t = e.P; t; t = t.W) {
121
+ const e = t.I;
122
+ const r = e.F || e;
123
+ if (r.H && r.o >= n) n = r.o + 1;
124
124
  }
125
125
  if (e.o !== n) {
126
126
  e.o = n;
@@ -130,21 +130,22 @@ function adjustHeight(e, t) {
130
130
  }
131
131
  }
132
132
  const w = new Set();
133
- const _ = { l: new Array(2e3).fill(undefined), m: false, A: 0, _: 0 };
133
+ let _ = false;
134
134
  const S = { l: new Array(2e3).fill(undefined), m: false, A: 0, _: 0 };
135
- let b = 0;
136
- let m = null;
135
+ const b = { l: new Array(2e3).fill(undefined), m: false, A: 0, _: 0 };
136
+ let m = 0;
137
+ let O = null;
137
138
  let x = false;
138
139
  function schedule() {
139
140
  if (x) return;
140
141
  x = true;
141
- if (!O.R) queueMicrotask(flush);
142
+ if (!C.R) queueMicrotask(flush);
142
143
  }
143
144
  class Queue {
144
145
  i = null;
145
146
  V = [[], []];
146
147
  q = [];
147
- created = b;
148
+ created = m;
148
149
  addChild(e) {
149
150
  this.q.push(e);
150
151
  e.i = this;
@@ -201,41 +202,35 @@ class Queue {
201
202
  class GlobalQueue extends Queue {
202
203
  R = false;
203
204
  M = [];
204
- static D;
205
+ D = [];
205
206
  static B;
207
+ static T;
206
208
  flush() {
207
209
  if (this.R) return;
208
210
  this.R = true;
209
211
  try {
210
- runHeap(_, GlobalQueue.D);
211
- if (m) {
212
- if (!transitionComplete(m)) {
213
- runHeap(S, GlobalQueue.D);
212
+ runHeap(S, GlobalQueue.B);
213
+ if (O) {
214
+ if (!transitionComplete(O)) {
215
+ let e = O;
216
+ runHeap(b, GlobalQueue.B);
214
217
  this.M = [];
215
- this.stashQueues(m.queueStash);
216
- b++;
218
+ this.stashQueues(O.queueStash);
219
+ m++;
217
220
  x = false;
218
- runPending(m.pendingNodes, true);
219
- m = null;
221
+ runTransitionPending(O.pendingNodes, true);
222
+ O = null;
223
+ runOptimistic(e);
220
224
  return;
221
225
  }
222
- this.M.push(...m.pendingNodes);
223
- this.restoreQueues(m.queueStash);
224
- w.delete(m);
225
- m = null;
226
- if (runPending(this.M, false)) runHeap(_, GlobalQueue.D);
227
- } else if (w.size) runHeap(S, GlobalQueue.D);
228
- for (let e = 0; e < this.M.length; e++) {
229
- const t = this.M[e];
230
- if (t.K !== p) {
231
- t.G = t.K;
232
- t.K = p;
233
- if (t.T) t.U = true;
234
- }
235
- if (t.F) GlobalQueue.B(t, false, true);
236
- }
237
- this.M.length = 0;
238
- b++;
226
+ this.M.push(...O.pendingNodes);
227
+ this.restoreQueues(O.queueStash);
228
+ w.delete(O);
229
+ O = null;
230
+ runTransitionPending(this.M, false);
231
+ } else if (w.size) runHeap(b, GlobalQueue.B);
232
+ runOptimistic();
233
+ m++;
239
234
  x = false;
240
235
  this.run(d);
241
236
  this.run(h);
@@ -246,8 +241,8 @@ class GlobalQueue extends Queue {
246
241
  notify(e, t, n) {
247
242
  if (t & f) {
248
243
  if (n & f) {
249
- if (m && !m.asyncNodes.includes(e.L.cause)) {
250
- m.asyncNodes.push(e.L.cause);
244
+ if (O && !O.asyncNodes.includes(e.K.cause)) {
245
+ O.asyncNodes.push(e.K.cause);
251
246
  schedule();
252
247
  }
253
248
  }
@@ -256,48 +251,92 @@ class GlobalQueue extends Queue {
256
251
  return false;
257
252
  }
258
253
  initTransition(e) {
259
- if (m && m.time === b) return;
260
- if (!m) {
261
- m = e.J ?? { time: b, pendingNodes: [], asyncNodes: [], queueStash: { V: [[], []], q: [] } };
254
+ if (O && O.time === m) return;
255
+ if (!O) {
256
+ O = e.G ?? {
257
+ time: m,
258
+ pendingNodes: [],
259
+ asyncNodes: [],
260
+ optimisticNodes: [],
261
+ queueStash: { V: [[], []], q: [] },
262
+ done: false
263
+ };
262
264
  }
263
- w.add(m);
264
- m.time = b;
265
+ w.add(O);
266
+ O.time = m;
265
267
  for (let e = 0; e < this.M.length; e++) {
266
268
  const t = this.M[e];
267
- t.J = m;
268
- m.pendingNodes.push(t);
269
+ t.G = O;
270
+ O.pendingNodes.push(t);
271
+ }
272
+ for (let e = 0; e < this.D.length; e++) {
273
+ const t = this.D[e];
274
+ t.G = O;
275
+ O.optimisticNodes.push(t);
269
276
  }
270
- this.M = m.pendingNodes;
277
+ this.M = O.pendingNodes;
278
+ this.D = O.optimisticNodes;
279
+ }
280
+ }
281
+ function notifySubs(e) {
282
+ for (let t = e.O; t !== null; t = t.C) {
283
+ const e = t.N.S & o ? b : S;
284
+ if (e.A > t.N.o) e.A = t.N.o;
285
+ insertIntoHeap(t.N, e);
271
286
  }
272
287
  }
273
- function runPending(e, t) {
274
- let n = false;
275
- const r = e.slice();
276
- for (let e = 0; e < r.length; e++) {
277
- const i = r[e];
278
- i.J = m;
279
- if (i.X) {
280
- i.X.Y(t);
281
- n = true;
288
+ function runOptimistic(e = null) {
289
+ let t = !e;
290
+ const n = C.D;
291
+ _ = true;
292
+ for (let t = 0; t < n.length; t++) {
293
+ const r = n[t];
294
+ if (!e && (!r.G || r.G.done) && r.U !== p) {
295
+ r.L = r.U;
296
+ r.U = p;
282
297
  }
283
- if (i.Z && i.Z.K !== p) {
284
- i.Z.Y(i.Z.K);
285
- i.Z.K = p;
286
- n = true;
298
+ r.G = e;
299
+ notifySubs(r);
300
+ }
301
+ C.D = [];
302
+ if (S._ >= S.A) {
303
+ t = true;
304
+ runHeap(S, GlobalQueue.B);
305
+ }
306
+ _ = false;
307
+ t && runPending(C.M);
308
+ }
309
+ function runPending(e) {
310
+ for (let t = 0; t < e.length; t++) {
311
+ const n = e[t];
312
+ if (n.U !== p) {
313
+ n.L = n.U;
314
+ n.U = p;
315
+ if (n.J) n.X = true;
287
316
  }
317
+ if (n.H) GlobalQueue.T(n, false, true);
288
318
  }
289
- return n;
319
+ e.length = 0;
290
320
  }
291
- const O = new GlobalQueue();
321
+ function runTransitionPending(e, t) {
322
+ const n = e.slice();
323
+ for (let e = 0; e < n.length; e++) {
324
+ const r = n[e];
325
+ r.G = O;
326
+ if (r.Y) r.Y.Z(t);
327
+ }
328
+ }
329
+ const C = new GlobalQueue();
292
330
  function flush() {
293
331
  while (x) {
294
- O.flush();
332
+ C.flush();
295
333
  }
296
334
  }
297
335
  function runQueue(e, t) {
298
336
  for (let n = 0; n < e.length; n++) e[n](t);
299
337
  }
300
338
  function transitionComplete(e) {
339
+ if (e.done) return true;
301
340
  let t = true;
302
341
  for (let n = 0; n < e.asyncNodes.length; n++) {
303
342
  if (e.asyncNodes[n].$ & f) {
@@ -305,35 +344,29 @@ function transitionComplete(e) {
305
344
  break;
306
345
  }
307
346
  }
347
+ t && (e.done = true);
308
348
  return t;
309
349
  }
310
350
  function runInTransition(e, t) {
311
- const n = m;
312
- m = e.J;
351
+ const n = O;
352
+ O = e.G;
313
353
  t(e);
314
- m = n;
354
+ O = n;
315
355
  }
316
- GlobalQueue.D = recompute;
317
- GlobalQueue.B = disposeChildren;
318
- let C = false;
319
- let v = false;
356
+ GlobalQueue.B = recompute;
357
+ GlobalQueue.T = disposeChildren;
320
358
  let N = false;
321
- let k = null;
322
- let j = false;
323
- let A = null;
324
- function notifySubs(e) {
325
- for (let t = e.O; t !== null; t = t.C) {
326
- const e = t.N.S & o ? S : _;
327
- if (e.A > t.N.o) e.A = t.N.o;
328
- insertIntoHeap(t.N, e);
329
- }
330
- }
359
+ let v = false;
360
+ let k = false;
361
+ let j = null;
362
+ let A = false;
363
+ let E = null;
331
364
  function recompute(t, n = false) {
332
- const i = t.T && t.J != m;
365
+ const i = t.J && t.G != O;
333
366
  if (!n) {
334
- if (t.J && m !== t.J && !i) O.initTransition(t);
335
- deleteFromHeap(t, t.S & o ? S : _);
336
- if (t.J) disposeChildren(t);
367
+ if (t.G && O !== t.G && !i) C.initTransition(t);
368
+ deleteFromHeap(t, t.S & o ? b : S);
369
+ if (t.G) disposeChildren(t);
337
370
  else {
338
371
  markDisposal(t);
339
372
  t.ee = t.te;
@@ -342,20 +375,20 @@ function recompute(t, n = false) {
342
375
  t.re = null;
343
376
  }
344
377
  }
345
- const s = A;
346
- A = t;
378
+ const s = E;
379
+ E = t;
347
380
  t.ie = null;
348
381
  t.S = r;
349
- t.se = b;
350
- let u = t.K === p ? t.G : t.K;
382
+ t.se = m;
383
+ let u = t.U === p || (t.oe && t.G) ? t.L : t.U;
351
384
  let d = t.o;
352
385
  let h = t.$;
353
- let y = t.L;
354
- let g = C;
386
+ let y = t.K;
387
+ let g = N;
355
388
  setStatusFlags(t, l | (h & a));
356
- C = true;
389
+ N = true;
357
390
  try {
358
- u = handleAsync(t, t.F(u));
391
+ u = handleAsync(t, t.H(u));
359
392
  t.$ &= ~a;
360
393
  } catch (e) {
361
394
  if (e instanceof NotReadyError) {
@@ -363,63 +396,60 @@ function recompute(t, n = false) {
363
396
  setStatusFlags(t, (h & ~c) | f, e);
364
397
  } else setStatusFlags(t, c, e);
365
398
  } finally {
366
- C = g;
399
+ N = g;
367
400
  }
368
401
  t.S = e;
369
- A = s;
402
+ E = s;
370
403
  if (!(t.$ & f)) {
371
404
  const e = t.ie;
372
- let n = e !== null ? e.P : t.W;
405
+ let n = e !== null ? e.W : t.P;
373
406
  if (n !== null) {
374
407
  do {
375
408
  n = unlinkSubs(n);
376
409
  } while (n !== null);
377
- if (e !== null) e.P = null;
378
- else t.W = null;
410
+ if (e !== null) e.W = null;
411
+ else t.P = null;
379
412
  }
380
413
  }
381
- const w = !t.oe || !t.oe(t.K === p || t.ue || i ? t.G : t.K, u);
382
- const x = t.$ !== h || t.L !== y;
414
+ const w = !t.ue || !t.ue(t.U === p || t.oe || i ? t.L : t.U, u);
415
+ const x = t.$ !== h || t.K !== y;
383
416
  t.le?.(x, h);
384
417
  if (w || x) {
385
418
  if (w) {
386
- if (n || t.ue || i) t.G = u;
387
- else t.K = u;
388
- if (t.Z) t.Z.K = u;
389
- }
390
- for (let e = t.O; e !== null; e = e.C) {
391
- const n = e.N.S & o ? S : _;
392
- if (e.N.o < t.o && n.A > e.N.o) n.A = e.N.o;
393
- insertIntoHeap(e.N, n);
419
+ if (n || t.oe || i) t.L = u;
420
+ else t.U = u;
421
+ if (t.fe) setSignal(t.fe, u);
394
422
  }
423
+ (!t.oe || _) && notifySubs(t);
395
424
  } else if (t.o != d) {
396
425
  for (let e = t.O; e !== null; e = e.C) {
397
- insertIntoHeapHeight(e.N, e.N.S & o ? S : _);
426
+ insertIntoHeapHeight(e.N, e.N.S & o ? b : S);
398
427
  }
399
428
  }
400
- if ((!n || t.$ & f) && !t.ue && !t.J) O.M.push(t);
401
- if (t.J && i) runInTransition(t, recompute);
429
+ t.oe && !_ && C.D.push(t);
430
+ (!n || t.$ & f) && !t.G && C.M.push(t);
431
+ t.G && i && runInTransition(t, recompute);
402
432
  }
403
433
  function handleAsync(e, t, n) {
404
434
  const r = typeof t === "object" && t !== null;
405
435
  const i = r && t instanceof Promise;
406
436
  const s = r && untrack(() => t[Symbol.asyncIterator]);
407
437
  if (!i && !s) {
408
- e.fe = null;
438
+ e.ce = null;
409
439
  return t;
410
440
  }
411
- e.fe = t;
441
+ e.ce = t;
412
442
  if (i) {
413
443
  t.then(r => {
414
- if (e.fe !== t) return;
415
- O.initTransition(e);
444
+ if (e.ce !== t) return;
445
+ C.initTransition(e);
416
446
  n?.(r) ?? setSignal(e, () => r);
417
447
  flush();
418
448
  }).catch(n => {
419
- if (e.fe !== t) return;
420
- O.initTransition(e);
449
+ if (e.ce !== t) return;
450
+ C.initTransition(e);
421
451
  setStatusFlags(e, c, n);
422
- e.se = b;
452
+ e.se = m;
423
453
  notifySubs(e);
424
454
  schedule();
425
455
  flush();
@@ -428,31 +458,31 @@ function handleAsync(e, t, n) {
428
458
  (async () => {
429
459
  try {
430
460
  for await (let r of t) {
431
- if (e.fe !== t) return;
432
- O.initTransition(e);
461
+ if (e.ce !== t) return;
462
+ C.initTransition(e);
433
463
  n?.(r) ?? setSignal(e, () => r);
434
464
  flush();
435
465
  }
436
466
  } catch (n) {
437
- if (e.fe !== t) return;
438
- O.initTransition(e);
467
+ if (e.ce !== t) return;
468
+ C.initTransition(e);
439
469
  setStatusFlags(e, c, n);
440
- e.se = b;
470
+ e.se = m;
441
471
  notifySubs(e);
442
472
  schedule();
443
473
  flush();
444
474
  }
445
475
  })();
446
476
  }
447
- O.initTransition(e);
448
- throw new NotReadyError(A);
477
+ C.initTransition(e);
478
+ throw new NotReadyError(E);
449
479
  }
450
480
  function updateIfNecessary(r) {
451
481
  if (r.S & t) {
452
- for (let e = r.W; e; e = e.P) {
453
- const t = e.H;
454
- const i = t.I || t;
455
- if (i.F) {
482
+ for (let e = r.P; e; e = e.W) {
483
+ const t = e.I;
484
+ const i = t.F || t;
485
+ if (i.H) {
456
486
  updateIfNecessary(i);
457
487
  }
458
488
  if (r.S & n) {
@@ -466,85 +496,85 @@ function updateIfNecessary(r) {
466
496
  r.S = e;
467
497
  }
468
498
  function unlinkSubs(e) {
469
- const t = e.H;
470
- const n = e.P;
499
+ const t = e.I;
500
+ const n = e.W;
471
501
  const r = e.C;
472
- const i = e.ce;
473
- if (r !== null) r.ce = i;
474
- else t.ae = i;
502
+ const i = e.ae;
503
+ if (r !== null) r.ae = i;
504
+ else t.de = i;
475
505
  if (i !== null) i.C = r;
476
506
  else {
477
507
  t.O = r;
478
508
  if (r === null) {
479
- t.de?.();
480
- t.F && !t.he && unobserved(t);
509
+ t.he?.();
510
+ t.H && !t.pe && unobserved(t);
481
511
  }
482
512
  }
483
513
  return n;
484
514
  }
485
515
  function unobserved(e) {
486
- deleteFromHeap(e, e.S & o ? S : _);
487
- let t = e.W;
516
+ deleteFromHeap(e, e.S & o ? b : S);
517
+ let t = e.P;
488
518
  while (t !== null) {
489
519
  t = unlinkSubs(t);
490
520
  }
491
- e.W = null;
521
+ e.P = null;
492
522
  disposeChildren(e, true);
493
523
  }
494
524
  function link(e, t) {
495
525
  const n = t.ie;
496
- if (n !== null && n.H === e) return;
526
+ if (n !== null && n.I === e) return;
497
527
  let i = null;
498
528
  const s = t.S & r;
499
529
  if (s) {
500
- i = n !== null ? n.P : t.W;
501
- if (i !== null && i.H === e) {
530
+ i = n !== null ? n.W : t.P;
531
+ if (i !== null && i.I === e) {
502
532
  t.ie = i;
503
533
  return;
504
534
  }
505
535
  }
506
- const o = e.ae;
536
+ const o = e.de;
507
537
  if (o !== null && o.N === t && (!s || isValidLink(o, t))) return;
508
- const u = (t.ie = e.ae = { H: e, N: t, P: i, ce: o, C: null });
509
- if (n !== null) n.P = u;
510
- else t.W = u;
538
+ const u = (t.ie = e.de = { I: e, N: t, W: i, ae: o, C: null });
539
+ if (n !== null) n.W = u;
540
+ else t.P = u;
511
541
  if (o !== null) o.C = u;
512
542
  else e.O = u;
513
543
  }
514
544
  function isValidLink(e, t) {
515
545
  const n = t.ie;
516
546
  if (n !== null) {
517
- let r = t.W;
547
+ let r = t.P;
518
548
  do {
519
549
  if (r === e) return true;
520
550
  if (r === n) break;
521
- r = r.P;
551
+ r = r.W;
522
552
  } while (r !== null);
523
553
  }
524
554
  return false;
525
555
  }
526
556
  function setStatusFlags(e, t, n = null) {
527
557
  e.$ = t;
528
- e.L = n;
558
+ e.K = n;
529
559
  }
530
560
  function markDisposal(e) {
531
561
  let t = e.re;
532
562
  while (t) {
533
563
  t.S |= o;
534
564
  if (t.S & i) {
535
- deleteFromHeap(t, _);
536
- insertIntoHeap(t, S);
565
+ deleteFromHeap(t, S);
566
+ insertIntoHeap(t, b);
537
567
  }
538
568
  markDisposal(t);
539
- t = t.pe;
569
+ t = t.ye;
540
570
  }
541
571
  }
542
572
  function dispose(e) {
543
- let t = e.W || null;
573
+ let t = e.P || null;
544
574
  do {
545
575
  t = unlinkSubs(t);
546
576
  } while (t !== null);
547
- e.W = null;
577
+ e.P = null;
548
578
  e.ie = null;
549
579
  disposeChildren(e, true);
550
580
  }
@@ -553,15 +583,15 @@ function disposeChildren(e, t = false, n) {
553
583
  if (t) e.S = u;
554
584
  let r = n ? e.ne : e.re;
555
585
  while (r) {
556
- const e = r.pe;
557
- if (r.W) {
586
+ const e = r.ye;
587
+ if (r.P) {
558
588
  const e = r;
559
- deleteFromHeap(e, e.S & o ? S : _);
560
- let t = e.W;
589
+ deleteFromHeap(e, e.S & o ? b : S);
590
+ let t = e.P;
561
591
  do {
562
592
  t = unlinkSubs(t);
563
593
  } while (t !== null);
564
- e.W = null;
594
+ e.P = null;
565
595
  e.ie = null;
566
596
  }
567
597
  disposeChildren(r, true);
@@ -571,7 +601,7 @@ function disposeChildren(e, t = false, n) {
571
601
  e.ne = null;
572
602
  } else {
573
603
  e.re = null;
574
- e.pe = null;
604
+ e.ye = null;
575
605
  }
576
606
  runDisposal(e, n);
577
607
  }
@@ -589,7 +619,7 @@ function runDisposal(e, t) {
589
619
  t ? (e.ee = null) : (e.te = null);
590
620
  }
591
621
  function getNextChildId(e) {
592
- if (e.id != null) return formatId(e.id, e.ye++);
622
+ if (e.id != null) return formatId(e.id, e.ge++);
593
623
  throw new Error("Cannot get child id from owner without an id");
594
624
  }
595
625
  function formatId(e, t) {
@@ -599,66 +629,66 @@ function formatId(e, t) {
599
629
  }
600
630
  function computed(t, n, r) {
601
631
  const i = {
602
- id: r?.id ?? (A?.id != null ? getNextChildId(A) : undefined),
603
- oe: r?.equals != null ? r.equals : isEqual,
604
- ge: !!r?.pureWrite,
605
- de: r?.unobserved,
632
+ id: r?.id ?? (E?.id != null ? getNextChildId(E) : undefined),
633
+ ue: r?.equals != null ? r.equals : isEqual,
634
+ we: !!r?.pureWrite,
635
+ he: r?.unobserved,
606
636
  te: null,
607
- we: A?.we ?? O,
608
- _e: A?._e ?? g,
609
- ye: 0,
610
- F: t,
611
- G: n,
637
+ _e: E?._e ?? C,
638
+ Se: E?.Se ?? g,
639
+ ge: 0,
640
+ H: t,
641
+ L: n,
612
642
  o: 0,
613
643
  k: null,
614
644
  p: undefined,
615
645
  h: null,
616
- W: null,
646
+ P: null,
617
647
  ie: null,
618
648
  O: null,
619
- ae: null,
620
- i: A,
621
- pe: null,
649
+ de: null,
650
+ i: E,
651
+ ye: null,
622
652
  re: null,
623
653
  S: e,
624
654
  $: a,
625
- se: b,
626
- K: p,
655
+ se: m,
656
+ U: p,
627
657
  ee: null,
628
658
  ne: null,
629
- fe: null,
630
- J: null
659
+ ce: null,
660
+ G: null
631
661
  };
632
- if (r?.Se) Object.assign(i, r.Se);
662
+ if (r?.be) Object.assign(i, r.be);
633
663
  i.h = i;
634
- const s = A?.t ? A.u : A;
635
- if (A) {
636
- const e = A.re;
664
+ const s = E?.t ? E.u : E;
665
+ if (E) {
666
+ const e = E.re;
637
667
  if (e === null) {
638
- A.re = i;
668
+ E.re = i;
639
669
  } else {
640
- i.pe = e;
641
- A.re = i;
670
+ i.ye = e;
671
+ E.re = i;
642
672
  }
643
673
  }
644
674
  if (s) i.o = s.o + 1;
645
- recompute(i, true);
675
+ !r?.lazy && recompute(i, true);
646
676
  return i;
647
677
  }
648
678
  function signal(e, t, n = null) {
649
679
  const r = {
650
- id: t?.id ?? (A?.id != null ? getNextChildId(A) : undefined),
651
- oe: t?.equals != null ? t.equals : isEqual,
652
- ge: !!t?.pureWrite,
653
- de: t?.unobserved,
654
- G: e,
680
+ id: t?.id ?? (E?.id != null ? getNextChildId(E) : undefined),
681
+ ue: t?.equals != null ? t.equals : isEqual,
682
+ we: !!t?.pureWrite,
683
+ he: t?.unobserved,
684
+ L: e,
655
685
  O: null,
656
- ae: null,
686
+ de: null,
657
687
  $: l,
658
- se: b,
659
- I: n,
688
+ se: m,
689
+ F: n,
660
690
  j: n?.k || null,
661
- K: p
691
+ U: p
662
692
  };
663
693
  n && (n.k = r);
664
694
  return r;
@@ -667,27 +697,27 @@ function isEqual(e, t) {
667
697
  return e === t;
668
698
  }
669
699
  function untrack(e) {
670
- if (!C) return e();
671
- C = false;
700
+ if (!N) return e();
701
+ N = false;
672
702
  try {
673
703
  return e();
674
704
  } finally {
675
- C = true;
705
+ N = true;
676
706
  }
677
707
  }
678
708
  function read(e) {
679
- let t = A;
709
+ let t = E;
680
710
  if (t?.t) t = t.u;
681
- if (j && e.F) recompute(e);
682
- if (t && C && !k && !N) {
683
- if (e.F && e.S & u) recompute(e);
711
+ if (A && e.H) recompute(e);
712
+ if (t && N && !j && !k) {
713
+ if (e.H && e.S & u) recompute(e);
684
714
  link(e, t);
685
- const n = e.I || e;
686
- if (n.F) {
715
+ const n = e.F || e;
716
+ if (n.H) {
687
717
  const r = e.S & o;
688
- if (n.o >= (r ? S.A : _.A)) {
718
+ if (n.o >= (r ? b.A : S.A)) {
689
719
  markNode(t);
690
- markHeap(r ? S : _);
720
+ markHeap(r ? b : S);
691
721
  updateIfNecessary(n);
692
722
  }
693
723
  const i = n.o;
@@ -696,75 +726,74 @@ function read(e) {
696
726
  }
697
727
  }
698
728
  }
699
- if (k) {
700
- if (!e.X) {
701
- e.X = signal(false);
702
- e.X.ue = true;
703
- e.X.Y = t => setSignal(e.X, t);
704
- }
705
- const t = k;
706
- k = null;
707
- t.G = read(e.X) || t.G;
708
- k = t;
729
+ if (j) {
730
+ if (!e.Y) {
731
+ e.Y = signal(false);
732
+ e.Y.oe = true;
733
+ e.Y.Z = t => setSignal(e.Y, t);
734
+ }
735
+ const t = j;
736
+ j = null;
737
+ t.L = read(e.Y) || t.L;
738
+ j = t;
709
739
  }
710
- if (N) {
711
- if (!e.Z) {
712
- e.Z = signal(e.G);
713
- e.Z.ue = true;
714
- e.Z.Y = t => setSignal(e.Z, t);
740
+ if (k) {
741
+ if (!e.fe) {
742
+ e.fe = signal(e.L);
743
+ e.fe.oe = true;
715
744
  }
716
- N = false;
745
+ k = false;
717
746
  try {
718
- return read(e.Z);
747
+ return read(e.fe);
719
748
  } finally {
720
- N = true;
749
+ k = true;
721
750
  }
722
751
  }
723
- if (e.$ & f && !k) {
724
- if ((t && !v) || e.$ & a) throw e.L;
752
+ if (e.$ & f && !j) {
753
+ if ((t && !v) || e.$ & a) throw e.K;
725
754
  else if (t && v) {
726
- setStatusFlags(t, t.$ | 1, e.L);
755
+ setStatusFlags(t, t.$ | 1, e.K);
727
756
  }
728
757
  }
729
758
  if (e.$ & c) {
730
- if (e.se < b) {
759
+ if (e.se < m) {
731
760
  recompute(e, true);
732
761
  return read(e);
733
762
  } else {
734
- throw e.L;
763
+ throw e.K;
735
764
  }
736
765
  }
737
- return !t || e.ue || e.K === p || (v && !k && e.J && m !== e.J) ? e.G : e.K;
766
+ return !t || e.oe || e.U === p || (v && !j && (t.oe || (e.G && O !== e.G))) ? e.L : e.U;
738
767
  }
739
768
  function setSignal(e, t) {
740
769
  if (typeof t === "function") {
741
- t = t(e.K === p ? e.G : e.K);
770
+ t = t(e.U === p || (e.oe && e.G) ? e.L : e.U);
742
771
  }
743
- const n = !e.oe || !e.oe(e.K === p || e.ue ? e.G : e.K, t);
772
+ const n = !e.ue || !e.ue(e.U === p || e.oe ? e.L : e.U, t);
744
773
  if (!n && !e.$) return t;
745
774
  if (n) {
746
- if (e.ue) e.G = t;
775
+ if (e.oe) e.L = t;
747
776
  else {
748
- if (e.K === p) O.M.push(e);
749
- e.K = t;
777
+ if (e.U === p) C.M.push(e);
778
+ e.U = t;
750
779
  }
751
- if (e.Z) e.Z.K = t;
780
+ if (e.fe) setSignal(e.fe, t);
752
781
  }
753
782
  setStatusFlags(e, l);
754
- e.se = b;
755
- notifySubs(e);
783
+ e.se = m;
784
+ e.oe && !_ ? C.D.push(e) : notifySubs(e);
756
785
  schedule();
757
786
  return t;
758
787
  }
759
788
  function getObserver() {
760
- return C ? A : null;
789
+ return N ? E : null;
761
790
  }
762
791
  function getOwner() {
763
- return A;
792
+ return E;
764
793
  }
765
794
  function onCleanup(e) {
766
- if (!A) return e;
767
- const t = A;
795
+ if (!E) return e;
796
+ const t = E;
768
797
  if (!t.te) {
769
798
  t.te = e;
770
799
  } else if (Array.isArray(t.te)) {
@@ -775,17 +804,17 @@ function onCleanup(e) {
775
804
  return e;
776
805
  }
777
806
  function createOwner(e) {
778
- const t = A;
807
+ const t = E;
779
808
  const n = {
780
809
  t: true,
781
810
  u: t?.t ? t.u : t,
782
811
  re: null,
783
- pe: null,
812
+ ye: null,
784
813
  te: null,
785
814
  id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
786
- we: t?.we ?? O,
787
- _e: t?._e || g,
788
- ye: 0,
815
+ _e: t?._e ?? C,
816
+ Se: t?.Se || g,
817
+ ge: 0,
789
818
  ee: null,
790
819
  ne: null,
791
820
  i: t,
@@ -798,7 +827,7 @@ function createOwner(e) {
798
827
  if (e === null) {
799
828
  t.re = n;
800
829
  } else {
801
- n.pe = e;
830
+ n.ye = e;
802
831
  t.re = n;
803
832
  }
804
833
  }
@@ -809,12 +838,12 @@ function createRoot(e, t) {
809
838
  return runWithOwner(n, () => e(n.dispose));
810
839
  }
811
840
  function runWithOwner(e, t) {
812
- const n = A;
813
- A = e;
841
+ const n = E;
842
+ E = e;
814
843
  try {
815
844
  return t();
816
845
  } finally {
817
- A = n;
846
+ E = n;
818
847
  }
819
848
  }
820
849
  function staleValues(e, t = true) {
@@ -827,34 +856,34 @@ function staleValues(e, t = true) {
827
856
  }
828
857
  }
829
858
  function pending(e) {
830
- const t = N;
831
- N = true;
859
+ const t = k;
860
+ k = true;
832
861
  try {
833
862
  return staleValues(e, false);
834
863
  } finally {
835
- N = t;
864
+ k = t;
836
865
  }
837
866
  }
838
867
  function isPending(e) {
839
- const t = k;
840
- k = { G: false };
868
+ const t = j;
869
+ j = { L: false };
841
870
  try {
842
871
  staleValues(e);
843
- return k.G;
872
+ return j.L;
844
873
  } catch (e) {
845
874
  if (!(e instanceof NotReadyError)) return false;
846
875
  throw e;
847
876
  } finally {
848
- k = t;
877
+ j = t;
849
878
  }
850
879
  }
851
880
  function refresh(e) {
852
- let t = j;
853
- j = true;
881
+ let t = A;
882
+ A = true;
854
883
  try {
855
884
  return untrack(e);
856
885
  } finally {
857
- j = t;
886
+ A = t;
858
887
  if (!t) {
859
888
  schedule();
860
889
  flush();
@@ -862,7 +891,7 @@ function refresh(e) {
862
891
  }
863
892
  }
864
893
  function isRefreshing() {
865
- return j;
894
+ return A;
866
895
  }
867
896
  function createContext(e, t) {
868
897
  return { id: Symbol(t), defaultValue: e };
@@ -871,7 +900,7 @@ function getContext(e, t = getOwner()) {
871
900
  if (!t) {
872
901
  throw new NoOwnerError();
873
902
  }
874
- const n = hasContext(e, t) ? t._e[e.id] : e.defaultValue;
903
+ const n = hasContext(e, t) ? t.Se[e.id] : e.defaultValue;
875
904
  if (isUndefined(n)) {
876
905
  throw new ContextNotFoundError();
877
906
  }
@@ -881,10 +910,10 @@ function setContext(e, t, n = getOwner()) {
881
910
  if (!n) {
882
911
  throw new NoOwnerError();
883
912
  }
884
- n._e = { ...n._e, [e.id]: isUndefined(t) ? e.defaultValue : t };
913
+ n.Se = { ...n.Se, [e.id]: isUndefined(t) ? e.defaultValue : t };
885
914
  }
886
915
  function hasContext(e, t) {
887
- return !isUndefined(t?._e[e.id]);
916
+ return !isUndefined(t?.Se[e.id]);
888
917
  }
889
918
  function isUndefined(e) {
890
919
  return typeof e === "undefined";
@@ -893,59 +922,59 @@ function effect(e, t, n, r, i) {
893
922
  let s = false;
894
923
  const o = computed(e, r, {
895
924
  ...i,
896
- Se: {
897
- U: true,
898
- be: r,
899
- me: t,
925
+ be: {
926
+ X: true,
927
+ me: r,
928
+ Oe: t,
900
929
  xe: n,
901
- Oe: undefined,
902
- T: i?.render ? d : h,
930
+ Ce: undefined,
931
+ J: i?.render ? d : h,
903
932
  le(e, t) {
904
933
  if (s) {
905
934
  const n = this.$ && this.$ === t && e;
906
- this.U = !(this.$ & c) && !(this.$ & f & ~t) && !n;
907
- if (this.U) this.we.enqueue(this.T, runEffect.bind(this));
935
+ this.X = !(this.$ & c) && !(this.$ & f & ~t) && !n;
936
+ if (this.X) this._e.enqueue(this.J, runEffect.bind(this));
908
937
  }
909
938
  if (this.$ & c) {
910
- let e = this.L;
911
- this.we.notify(this, f, 0);
912
- if (this.T === h) {
939
+ let e = this.K;
940
+ this._e.notify(this, f, 0);
941
+ if (this.J === h) {
913
942
  try {
914
943
  return this.xe
915
944
  ? this.xe(e, () => {
916
- this.Oe?.();
917
- this.Oe = undefined;
945
+ this.Ce?.();
946
+ this.Ce = undefined;
918
947
  })
919
948
  : console.error(e);
920
949
  } catch (t) {
921
950
  e = t;
922
951
  }
923
952
  }
924
- if (!this.we.notify(this, c, c)) throw e;
925
- } else if (this.T === d) {
926
- this.we.notify(this, f | c, this.$);
953
+ if (!this._e.notify(this, c, c)) throw e;
954
+ } else if (this.J === d) {
955
+ this._e.notify(this, f | c, this.$);
927
956
  }
928
957
  }
929
958
  }
930
959
  });
931
960
  s = true;
932
- if (o.T === d) o.F = t => staleValues(() => e(t));
961
+ if (o.J === d) o.H = t => staleValues(() => e(t));
933
962
  !i?.defer &&
934
963
  !(o.$ & (c | f)) &&
935
- (o.T === h ? o.we.enqueue(o.T, runEffect.bind(o)) : runEffect.call(o));
936
- onCleanup(() => o.Oe?.());
964
+ (o.J === h ? o._e.enqueue(o.J, runEffect.bind(o)) : runEffect.call(o));
965
+ onCleanup(() => o.Ce?.());
937
966
  }
938
967
  function runEffect() {
939
- if (!this.U || this.S & u) return;
940
- this.Oe?.();
941
- this.Oe = undefined;
968
+ if (!this.X || this.S & u) return;
969
+ this.Ce?.();
970
+ this.Ce = undefined;
942
971
  try {
943
- this.Oe = this.me(this.G, this.be);
972
+ this.Ce = this.Oe(this.L, this.me);
944
973
  } catch (e) {
945
- if (!this.we.notify(this, c, c)) throw e;
974
+ if (!this._e.notify(this, c, c)) throw e;
946
975
  } finally {
947
- this.be = this.G;
948
- this.U = false;
976
+ this.me = this.L;
977
+ this.X = false;
949
978
  }
950
979
  }
951
980
  function createSignal(e, t, n) {
@@ -1005,19 +1034,42 @@ function resolve(e) {
1005
1034
  });
1006
1035
  }
1007
1036
  function createOptimistic(e, t, n) {
1008
- return {};
1037
+ if (typeof e === "function") {
1038
+ const r = computed(
1039
+ t => {
1040
+ let n = r || getOwner();
1041
+ n.U = e(t);
1042
+ return t;
1043
+ },
1044
+ t,
1045
+ n
1046
+ );
1047
+ r.oe = true;
1048
+ return [read.bind(null, r), setSignal.bind(null, r)];
1049
+ }
1050
+ const r = getOwner();
1051
+ const i = r?.id != null;
1052
+ const s = signal(e, i ? { id: getNextChildId(r), ...t } : t);
1053
+ s.oe = true;
1054
+ return [
1055
+ read.bind(null, s),
1056
+ t => {
1057
+ s.U = e;
1058
+ return setSignal(s, t);
1059
+ }
1060
+ ];
1009
1061
  }
1010
1062
  function onSettled(e) {
1011
1063
  let t;
1012
1064
  const n = getOwner();
1013
1065
  if (n) onCleanup(() => t?.());
1014
- O.enqueue(h, () => {
1066
+ C.enqueue(h, () => {
1015
1067
  t = e();
1016
1068
  !n && t?.();
1017
1069
  });
1018
1070
  }
1019
1071
  function unwrap(e) {
1020
- return e?.[P]?.[V] ?? e;
1072
+ return e?.[I]?.[q] ?? e;
1021
1073
  }
1022
1074
  function getOverrideValue(e, t, n, r) {
1023
1075
  return n && r in n ? read(n[r]) : t && r in t ? t[r] : e[r];
@@ -1028,15 +1080,15 @@ function getAllKeys(e, t, n) {
1028
1080
  return Array.from(new Set([...r, ...i]));
1029
1081
  }
1030
1082
  function applyState(e, t, n, r) {
1031
- const i = t?.[P];
1083
+ const i = t?.[I];
1032
1084
  if (!i) return;
1033
- const s = i[Q];
1034
- const o = i[R];
1035
- let u = i[V];
1085
+ const s = i[R];
1086
+ const o = i[V];
1087
+ let u = i[q];
1036
1088
  if (e === s && !o) return;
1037
- (i[D] || K).set(e, i[H]);
1038
- i[Q] = e;
1039
- i[R] = undefined;
1089
+ (i[B] || K).set(e, i[F]);
1090
+ i[R] = e;
1091
+ i[V] = undefined;
1040
1092
  if (Array.isArray(s)) {
1041
1093
  let t = false;
1042
1094
  const l = getOverrideValue(s, o, u, "length");
@@ -1063,16 +1115,16 @@ function applyState(e, t, n, r) {
1063
1115
  if (a > h || a > d) {
1064
1116
  for (c = a; c <= h; c++) {
1065
1117
  t = true;
1066
- i[V][c] && setSignal(i[V][c], wrap(e[c], i));
1118
+ i[q][c] && setSignal(i[q][c], wrap(e[c], i));
1067
1119
  }
1068
1120
  for (; c < e.length; c++) {
1069
1121
  t = true;
1070
1122
  const s = wrap(w[c], i);
1071
- i[V][c] && setSignal(i[V][c], s);
1123
+ i[q][c] && setSignal(i[q][c], s);
1072
1124
  applyState(e[c], s, n, r);
1073
1125
  }
1074
- t && i[V][E] && setSignal(i[V][E], void 0);
1075
- l !== e.length && i[V].length && setSignal(i[V].length, e.length);
1126
+ t && i[q][P] && setSignal(i[q][P], void 0);
1127
+ l !== e.length && i[q].length && setSignal(i[q].length, e.length);
1076
1128
  return;
1077
1129
  }
1078
1130
  y = new Array(h + 1);
@@ -1096,9 +1148,9 @@ function applyState(e, t, n, r) {
1096
1148
  for (c = a; c < e.length; c++) {
1097
1149
  if (c in w) {
1098
1150
  const t = wrap(w[c], i);
1099
- i[V][c] && setSignal(i[V][c], t);
1151
+ i[q][c] && setSignal(i[q][c], t);
1100
1152
  applyState(e[c], t, n, r);
1101
- } else i[V][c] && setSignal(i[V][c], wrap(e[c], i));
1153
+ } else i[q][c] && setSignal(i[q][c], wrap(e[c], i));
1102
1154
  }
1103
1155
  if (a < e.length) t = true;
1104
1156
  } else if (l && e.length) {
@@ -1109,13 +1161,13 @@ function applyState(e, t, n, r) {
1109
1161
  }
1110
1162
  if (l !== e.length) {
1111
1163
  t = true;
1112
- i[V].length && setSignal(i[V].length, e.length);
1164
+ i[q].length && setSignal(i[q].length, e.length);
1113
1165
  }
1114
- t && i[V][E] && setSignal(i[V][E], void 0);
1166
+ t && i[q][P] && setSignal(i[q][P], void 0);
1115
1167
  return;
1116
1168
  }
1117
1169
  if (u) {
1118
- const t = u[E];
1170
+ const t = u[P];
1119
1171
  const l = t || r ? getAllKeys(s, o, e) : Object.keys(u);
1120
1172
  for (let f = 0, c = l.length; f < c; f++) {
1121
1173
  const c = l[f];
@@ -1129,7 +1181,7 @@ function applyState(e, t, n, r) {
1129
1181
  } else applyState(h, wrap(d, i), n, r);
1130
1182
  }
1131
1183
  }
1132
- if ((u = i[q])) {
1184
+ if ((u = i[M])) {
1133
1185
  const t = Object.keys(u);
1134
1186
  for (let n = 0, r = t.length; n < r; n++) {
1135
1187
  const r = t[n];
@@ -1152,11 +1204,11 @@ function createProjectionInternal(e, t = {}, n) {
1152
1204
  const i = new WeakMap();
1153
1205
  const wrapProjection = e => {
1154
1206
  if (i.has(e)) return i.get(e);
1155
- if (e[P]?.[M] === wrapProjection) return e;
1156
- const t = createStoreProxy(e, T, {
1157
- [M]: wrapProjection,
1158
- [D]: i,
1159
- [B]() {
1207
+ if (e[I]?.[D] === wrapProjection) return e;
1208
+ const t = createStoreProxy(e, U, {
1209
+ [D]: wrapProjection,
1210
+ [B]: i,
1211
+ [T]() {
1160
1212
  return r;
1161
1213
  }
1162
1214
  });
@@ -1178,32 +1230,32 @@ function createProjectionInternal(e, t = {}, n) {
1178
1230
  function createProjection(e, t = {}, n) {
1179
1231
  return createProjectionInternal(e, t, n).store;
1180
1232
  }
1181
- const E = Symbol(0),
1233
+ const P = Symbol(0),
1182
1234
  W = Symbol(0),
1183
- P = Symbol(0),
1184
- H = Symbol(0),
1185
- I = Symbol(0);
1186
- const F = new WeakMap();
1187
- const Q = "v",
1188
- R = "o",
1189
- V = "n",
1190
- q = "h",
1191
- M = "w",
1192
- D = "l",
1193
- B = "f";
1194
- function createStoreProxy(e, t = T, n) {
1235
+ I = Symbol(0),
1236
+ F = Symbol(0),
1237
+ H = Symbol(0);
1238
+ const Q = new WeakMap();
1239
+ const R = "v",
1240
+ V = "o",
1241
+ q = "n",
1242
+ M = "h",
1243
+ D = "w",
1244
+ B = "l",
1245
+ T = "f";
1246
+ function createStoreProxy(e, t = U, n) {
1195
1247
  let r;
1196
1248
  if (Array.isArray(e)) {
1197
1249
  r = [];
1198
1250
  r.v = e;
1199
1251
  } else r = { v: e };
1200
1252
  n && Object.assign(r, n);
1201
- return (r[H] = new Proxy(r, t));
1253
+ return (r[F] = new Proxy(r, t));
1202
1254
  }
1203
1255
  const K = new WeakMap();
1204
1256
  function wrap(e, t) {
1205
- if (t?.[M]) return t[M](e, t);
1206
- let n = e[H] || K.get(e);
1257
+ if (t?.[D]) return t[D](e, t);
1258
+ let n = e[F] || K.get(e);
1207
1259
  if (!n) K.set(e, (n = createStoreProxy(e)));
1208
1260
  return n;
1209
1261
  }
@@ -1228,8 +1280,8 @@ function getNode(e, t, n, r, i = isEqual) {
1228
1280
  r
1229
1281
  ));
1230
1282
  }
1231
- function trackSelf(e, t = E) {
1232
- getObserver() && read(getNode(getNodes(e, V), t, undefined, e[B]?.(), false));
1283
+ function trackSelf(e, t = P) {
1284
+ getObserver() && read(getNode(getNodes(e, q), t, undefined, e[T]?.(), false));
1233
1285
  }
1234
1286
  function getKeys(e, t, n = true) {
1235
1287
  const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
@@ -1237,7 +1289,7 @@ function getKeys(e, t, n = true) {
1237
1289
  const i = new Set(r);
1238
1290
  const s = Reflect.ownKeys(t);
1239
1291
  for (const e of s) {
1240
- if (t[e] !== I) i.add(e);
1292
+ if (t[e] !== H) i.add(e);
1241
1293
  else i.delete(e);
1242
1294
  }
1243
1295
  return Array.from(i);
@@ -1245,118 +1297,118 @@ function getKeys(e, t, n = true) {
1245
1297
  function getPropertyDescriptor(e, t, n) {
1246
1298
  let r = e;
1247
1299
  if (t && n in t) {
1248
- if (r[n] === I) return void 0;
1300
+ if (r[n] === H) return void 0;
1249
1301
  if (!(n in r)) r = t;
1250
1302
  }
1251
1303
  return Reflect.getOwnPropertyDescriptor(r, n);
1252
1304
  }
1253
1305
  let G = null;
1254
- const T = {
1306
+ const U = {
1255
1307
  get(e, t, n) {
1256
- if (t === P) return e;
1257
- if (t === H) return n;
1258
- if (t === E || t === W) {
1308
+ if (t === I) return e;
1309
+ if (t === F) return n;
1310
+ if (t === P || t === W) {
1259
1311
  trackSelf(e, t);
1260
1312
  return n;
1261
1313
  }
1262
- const r = getNodes(e, V);
1314
+ const r = getNodes(e, q);
1263
1315
  const i = r[t];
1264
- const s = e[R] && t in e[R];
1265
- const o = !!e[Q][P];
1266
- const u = s ? e[R] : e[Q];
1316
+ const s = e[V] && t in e[V];
1317
+ const o = !!e[R][I];
1318
+ const u = s ? e[V] : e[R];
1267
1319
  if (!i) {
1268
1320
  const e = Object.getOwnPropertyDescriptor(u, t);
1269
1321
  if (e && e.get) return e.get.call(n);
1270
1322
  }
1271
1323
  if (G?.has(n)) {
1272
- let n = i && (s || !o) ? (i.K !== p ? i.K : i.G) : u[t];
1273
- n === I && (n = undefined);
1324
+ let n = i && (s || !o) ? (i.U !== p ? i.U : i.L) : u[t];
1325
+ n === H && (n = undefined);
1274
1326
  if (!isWrappable(n)) return n;
1275
1327
  const r = wrap(n, e);
1276
1328
  G.add(r);
1277
1329
  return r;
1278
1330
  }
1279
1331
  let l = i ? (s || !o ? read(r[t]) : (read(r[t]), u[t])) : u[t];
1280
- l === I && (l = undefined);
1332
+ l === H && (l = undefined);
1281
1333
  if (!i) {
1282
1334
  if (!s && typeof l === "function" && !u.hasOwnProperty(t)) {
1283
1335
  let t;
1284
- return !Array.isArray(e[Q]) && (t = Object.getPrototypeOf(e[Q])) && t !== Object.prototype
1336
+ return !Array.isArray(e[R]) && (t = Object.getPrototypeOf(e[R])) && t !== Object.prototype
1285
1337
  ? l.bind(u)
1286
1338
  : l;
1287
1339
  } else if (getObserver()) {
1288
- return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[B]?.()));
1340
+ return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[T]?.()));
1289
1341
  }
1290
1342
  }
1291
1343
  return isWrappable(l) ? wrap(l, e) : l;
1292
1344
  },
1293
1345
  has(e, t) {
1294
- if (t === H || t === E || t === "__proto__") return true;
1295
- const n = e[R] && t in e[R] ? e[R][t] !== I : t in e[Q];
1296
- getObserver() && read(getNode(getNodes(e, q), t, n, e[B]?.()));
1346
+ if (t === F || t === P || t === "__proto__") return true;
1347
+ const n = e[V] && t in e[V] ? e[V][t] !== H : t in e[R];
1348
+ getObserver() && read(getNode(getNodes(e, M), t, n, e[T]?.()));
1297
1349
  return n;
1298
1350
  },
1299
1351
  set(e, t, n) {
1300
- const r = e[H];
1301
- if (G?.has(e[H])) {
1352
+ const r = e[F];
1353
+ if (G?.has(e[F])) {
1302
1354
  untrack(() => {
1303
- const i = e[Q];
1355
+ const i = e[R];
1304
1356
  const s = i[t];
1305
- const o = e[R] && t in e[R] ? e[R][t] : s;
1306
- const u = n?.[P]?.[Q] ?? n;
1357
+ const o = e[V] && t in e[V] ? e[V][t] : s;
1358
+ const u = n?.[I]?.[R] ?? n;
1307
1359
  if (o === u) return true;
1308
- const l = e[R]?.length || i.length;
1309
- if (u !== undefined && u === s) delete e[R][t];
1310
- else (e[R] || (e[R] = Object.create(null)))[t] = u;
1360
+ const l = e[V]?.length || i.length;
1361
+ if (u !== undefined && u === s) delete e[V][t];
1362
+ else (e[V] || (e[V] = Object.create(null)))[t] = u;
1311
1363
  const f = isWrappable(u);
1312
1364
  if (isWrappable(o)) {
1313
- const e = F.get(o);
1314
- e && (e instanceof Set ? e.delete(r) : F.delete(o));
1365
+ const e = Q.get(o);
1366
+ e && (e instanceof Set ? e.delete(r) : Q.delete(o));
1315
1367
  }
1316
1368
  if (recursivelyNotify(r, K) && f) recursivelyAddParent(u, r);
1317
- e[q]?.[t] && setSignal(e[q][t], true);
1318
- const c = getNodes(e, V);
1369
+ e[M]?.[t] && setSignal(e[M][t], true);
1370
+ const c = getNodes(e, q);
1319
1371
  c[t] && setSignal(c[t], () => (f ? wrap(u, e) : u));
1320
1372
  if (Array.isArray(i)) {
1321
1373
  const e = parseInt(t) + 1;
1322
1374
  if (e > l) c.length && setSignal(c.length, e);
1323
1375
  }
1324
- c[E] && setSignal(c[E], undefined);
1376
+ c[P] && setSignal(c[P], undefined);
1325
1377
  });
1326
1378
  }
1327
1379
  return true;
1328
1380
  },
1329
1381
  deleteProperty(e, t) {
1330
- if (G?.has(e[H]) && e[R]?.[t] !== I) {
1382
+ if (G?.has(e[F]) && e[V]?.[t] !== H) {
1331
1383
  untrack(() => {
1332
- const n = e[R] && t in e[R] ? e[R][t] : e[Q][t];
1333
- if (t in e[Q]) {
1334
- (e[R] || (e[R] = Object.create(null)))[t] = I;
1335
- } else if (e[R] && t in e[R]) {
1336
- delete e[R][t];
1384
+ const n = e[V] && t in e[V] ? e[V][t] : e[R][t];
1385
+ if (t in e[R]) {
1386
+ (e[V] || (e[V] = Object.create(null)))[t] = H;
1387
+ } else if (e[V] && t in e[V]) {
1388
+ delete e[V][t];
1337
1389
  } else return true;
1338
1390
  if (isWrappable(n)) {
1339
- const t = F.get(n);
1340
- t && (t instanceof Set ? t.delete(e) : F.delete(n));
1391
+ const t = Q.get(n);
1392
+ t && (t instanceof Set ? t.delete(e) : Q.delete(n));
1341
1393
  }
1342
- if (e[q]?.[t]) setSignal(e[q][t], false);
1343
- const r = getNodes(e, V);
1394
+ if (e[M]?.[t]) setSignal(e[M][t], false);
1395
+ const r = getNodes(e, q);
1344
1396
  r[t] && setSignal(r[t], undefined);
1345
- r[E] && setSignal(r[E], undefined);
1397
+ r[P] && setSignal(r[P], undefined);
1346
1398
  });
1347
1399
  }
1348
1400
  return true;
1349
1401
  },
1350
1402
  ownKeys(e) {
1351
1403
  trackSelf(e);
1352
- return getKeys(e[Q], e[R], false);
1404
+ return getKeys(e[R], e[V], false);
1353
1405
  },
1354
1406
  getOwnPropertyDescriptor(e, t) {
1355
- if (t === H) return { value: e[H], writable: true, configurable: true };
1356
- return getPropertyDescriptor(e[Q], e[R], t);
1407
+ if (t === F) return { value: e[F], writable: true, configurable: true };
1408
+ return getPropertyDescriptor(e[R], e[V], t);
1357
1409
  },
1358
1410
  getPrototypeOf(e) {
1359
- return Object.getPrototypeOf(e[Q]);
1411
+ return Object.getPrototypeOf(e[R]);
1360
1412
  }
1361
1413
  };
1362
1414
  function storeSetter(e, t) {
@@ -1388,17 +1440,17 @@ function createStore(e, t, n) {
1388
1440
  return [i, e => storeSetter(i, e)];
1389
1441
  }
1390
1442
  function recursivelyNotify(e, t) {
1391
- let n = e[P] || t?.get(e)?.[P];
1443
+ let n = e[I] || t?.get(e)?.[I];
1392
1444
  let r = false;
1393
1445
  if (n) {
1394
- const e = getNodes(n, V)[W];
1446
+ const e = getNodes(n, q)[W];
1395
1447
  if (e) {
1396
1448
  setSignal(e, undefined);
1397
1449
  r = true;
1398
1450
  }
1399
- t = n[D] || t;
1451
+ t = n[B] || t;
1400
1452
  }
1401
- const i = F.get(n?.[Q] || e);
1453
+ const i = Q.get(n?.[R] || e);
1402
1454
  if (!i) return r;
1403
1455
  if (i instanceof Set) {
1404
1456
  for (let e of i) r = recursivelyNotify(e, t) || r;
@@ -1407,16 +1459,16 @@ function recursivelyNotify(e, t) {
1407
1459
  }
1408
1460
  function recursivelyAddParent(e, t) {
1409
1461
  let n;
1410
- const r = e[P];
1462
+ const r = e[I];
1411
1463
  if (r) {
1412
- n = r[R];
1413
- e = r[Q];
1464
+ n = r[V];
1465
+ e = r[R];
1414
1466
  }
1415
1467
  if (t) {
1416
- let n = F.get(e);
1417
- if (!n) F.set(e, t);
1468
+ let n = Q.get(e);
1469
+ if (!n) Q.set(e, t);
1418
1470
  else if (n !== t) {
1419
- if (!(n instanceof Set)) F.set(e, (n = new Set([n])));
1471
+ if (!(n instanceof Set)) Q.set(e, (n = new Set([n])));
1420
1472
  else if (n.has(t)) return;
1421
1473
  n.add(t);
1422
1474
  } else return;
@@ -1448,11 +1500,11 @@ function snapshot(e, t, n) {
1448
1500
  if (!isWrappable(e)) return e;
1449
1501
  if (t && t.has(e)) return t.get(e);
1450
1502
  if (!t) t = new Map();
1451
- if ((r = e[P] || n?.get(e)?.[P])) {
1452
- s = r[R];
1453
- i = Array.isArray(r[Q]);
1454
- t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Q]))) : r[Q]);
1455
- e = r[Q];
1503
+ if ((r = e[I] || n?.get(e)?.[I])) {
1504
+ s = r[V];
1505
+ i = Array.isArray(r[R]);
1506
+ t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[R]))) : r[R]);
1507
+ e = r[R];
1456
1508
  n = K;
1457
1509
  } else {
1458
1510
  i = Array.isArray(e);
@@ -1462,7 +1514,7 @@ function snapshot(e, t, n) {
1462
1514
  const r = s?.length || e.length;
1463
1515
  for (let i = 0; i < r; i++) {
1464
1516
  l = s && i in s ? s[i] : e[i];
1465
- if (l === I) continue;
1517
+ if (l === H) continue;
1466
1518
  if ((u = snapshot(l, t, n)) !== l || o) {
1467
1519
  if (!o) t.set(e, (o = [...e]));
1468
1520
  o[i] = u;
@@ -1489,13 +1541,13 @@ function snapshot(e, t, n) {
1489
1541
  function trueFn() {
1490
1542
  return true;
1491
1543
  }
1492
- const U = {
1544
+ const L = {
1493
1545
  get(e, t, n) {
1494
- if (t === H) return n;
1546
+ if (t === F) return n;
1495
1547
  return e.get(t);
1496
1548
  },
1497
1549
  has(e, t) {
1498
- if (t === H) return true;
1550
+ if (t === F) return true;
1499
1551
  return e.has(t);
1500
1552
  },
1501
1553
  set: trueFn,
@@ -1518,15 +1570,15 @@ const U = {
1518
1570
  function resolveSource(e) {
1519
1571
  return !(e = typeof e === "function" ? e() : e) ? {} : e;
1520
1572
  }
1521
- const L = Symbol(0);
1573
+ const z = Symbol(0);
1522
1574
  function merge(...e) {
1523
1575
  if (e.length === 1 && typeof e[0] !== "function") return e[0];
1524
1576
  let t = false;
1525
1577
  const n = [];
1526
1578
  for (let r = 0; r < e.length; r++) {
1527
1579
  const i = e[r];
1528
- t = t || (!!i && H in i);
1529
- const s = !!i && i[L];
1580
+ t = t || (!!i && F in i);
1581
+ const s = !!i && i[z];
1530
1582
  if (s) n.push(...s);
1531
1583
  else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
1532
1584
  }
@@ -1534,7 +1586,7 @@ function merge(...e) {
1534
1586
  return new Proxy(
1535
1587
  {
1536
1588
  get(e) {
1537
- if (e === L) return n;
1589
+ if (e === z) return n;
1538
1590
  for (let t = n.length - 1; t >= 0; t--) {
1539
1591
  const r = resolveSource(n[t]);
1540
1592
  if (e in r) return r[e];
@@ -1552,7 +1604,7 @@ function merge(...e) {
1552
1604
  return [...new Set(e)];
1553
1605
  }
1554
1606
  },
1555
- U
1607
+ L
1556
1608
  );
1557
1609
  }
1558
1610
  const r = Object.create(null);
@@ -1584,12 +1636,12 @@ function merge(...e) {
1584
1636
  if (n.get) Object.defineProperty(o, t, n);
1585
1637
  else o[t] = n.value;
1586
1638
  }
1587
- o[L] = n;
1639
+ o[z] = n;
1588
1640
  return o;
1589
1641
  }
1590
1642
  function omit(e, ...t) {
1591
1643
  const n = new Set(t);
1592
- if (y && H in e) {
1644
+ if (y && F in e) {
1593
1645
  return new Proxy(
1594
1646
  {
1595
1647
  get(t) {
@@ -1602,7 +1654,7 @@ function omit(e, ...t) {
1602
1654
  return Object.keys(e).filter(e => !n.has(e));
1603
1655
  }
1604
1656
  },
1605
- U
1657
+ L
1606
1658
  );
1607
1659
  }
1608
1660
  const r = {};
@@ -1620,66 +1672,66 @@ function mapArray(e, t, n) {
1620
1672
  const r = typeof n?.keyed === "function" ? n.keyed : undefined;
1621
1673
  return createMemo(
1622
1674
  updateKeyedMap.bind({
1623
- Ce: createOwner(),
1675
+ Ne: createOwner(),
1624
1676
  ve: 0,
1625
- Ne: e,
1626
- ke: [],
1627
- je: t,
1628
- Ae: [],
1677
+ ke: e,
1678
+ je: [],
1679
+ Ae: t,
1629
1680
  Ee: [],
1681
+ Pe: [],
1630
1682
  We: r,
1631
- Pe: r || n?.keyed === false ? [] : undefined,
1632
- He: t.length > 1 ? [] : undefined,
1633
- Ie: n?.fallback
1683
+ Ie: r || n?.keyed === false ? [] : undefined,
1684
+ Fe: t.length > 1 ? [] : undefined,
1685
+ He: n?.fallback
1634
1686
  })
1635
1687
  );
1636
1688
  }
1637
- const z = { pureWrite: true };
1689
+ const J = { pureWrite: true };
1638
1690
  function updateKeyedMap() {
1639
- const e = this.Ne() || [],
1691
+ const e = this.ke() || [],
1640
1692
  t = e.length;
1641
- e[E];
1642
- runWithOwner(this.Ce, () => {
1693
+ e[P];
1694
+ runWithOwner(this.Ne, () => {
1643
1695
  let n,
1644
1696
  r,
1645
- i = this.Pe
1697
+ i = this.Ie
1646
1698
  ? () => {
1647
- this.Pe[r] = signal(e[r], z);
1648
- this.He && (this.He[r] = signal(r, z));
1649
- return this.je(
1650
- read.bind(null, this.Pe[r]),
1651
- this.He ? read.bind(null, this.He[r]) : undefined
1699
+ this.Ie[r] = signal(e[r], J);
1700
+ this.Fe && (this.Fe[r] = signal(r, J));
1701
+ return this.Ae(
1702
+ read.bind(null, this.Ie[r]),
1703
+ this.Fe ? read.bind(null, this.Fe[r]) : undefined
1652
1704
  );
1653
1705
  }
1654
- : this.He
1706
+ : this.Fe
1655
1707
  ? () => {
1656
1708
  const t = e[r];
1657
- this.He[r] = signal(r, z);
1658
- return this.je(() => t, read.bind(null, this.He[r]));
1709
+ this.Fe[r] = signal(r, J);
1710
+ return this.Ae(() => t, read.bind(null, this.Fe[r]));
1659
1711
  }
1660
1712
  : () => {
1661
1713
  const t = e[r];
1662
- return this.je(() => t);
1714
+ return this.Ae(() => t);
1663
1715
  };
1664
1716
  if (t === 0) {
1665
1717
  if (this.ve !== 0) {
1666
- this.Ce.dispose(false);
1718
+ this.Ne.dispose(false);
1719
+ this.Pe = [];
1720
+ this.je = [];
1667
1721
  this.Ee = [];
1668
- this.ke = [];
1669
- this.Ae = [];
1670
1722
  this.ve = 0;
1671
- this.Pe && (this.Pe = []);
1672
- this.He && (this.He = []);
1723
+ this.Ie && (this.Ie = []);
1724
+ this.Fe && (this.Fe = []);
1673
1725
  }
1674
- if (this.Ie && !this.Ae[0]) {
1675
- this.Ae[0] = runWithOwner((this.Ee[0] = createOwner()), this.Ie);
1726
+ if (this.He && !this.Ee[0]) {
1727
+ this.Ee[0] = runWithOwner((this.Pe[0] = createOwner()), this.He);
1676
1728
  }
1677
1729
  } else if (this.ve === 0) {
1678
- if (this.Ee[0]) this.Ee[0].dispose();
1679
- this.Ae = new Array(t);
1730
+ if (this.Pe[0]) this.Pe[0].dispose();
1731
+ this.Ee = new Array(t);
1680
1732
  for (r = 0; r < t; r++) {
1681
- this.ke[r] = e[r];
1682
- this.Ae[r] = runWithOwner((this.Ee[r] = createOwner()), i);
1733
+ this.je[r] = e[r];
1734
+ this.Ee[r] = runWithOwner((this.Pe[r] = createOwner()), i);
1683
1735
  }
1684
1736
  this.ve = t;
1685
1737
  } else {
@@ -1692,26 +1744,26 @@ function updateKeyedMap() {
1692
1744
  a,
1693
1745
  d = new Array(t),
1694
1746
  h = new Array(t),
1695
- p = this.Pe ? new Array(t) : undefined,
1696
- y = this.He ? new Array(t) : undefined;
1747
+ p = this.Ie ? new Array(t) : undefined,
1748
+ y = this.Fe ? new Array(t) : undefined;
1697
1749
  for (
1698
1750
  s = 0, o = Math.min(this.ve, t);
1699
- s < o && (this.ke[s] === e[s] || (this.Pe && compare(this.We, this.ke[s], e[s])));
1751
+ s < o && (this.je[s] === e[s] || (this.Ie && compare(this.We, this.je[s], e[s])));
1700
1752
  s++
1701
1753
  ) {
1702
- if (this.Pe) setSignal(this.Pe[s], e[s]);
1754
+ if (this.Ie) setSignal(this.Ie[s], e[s]);
1703
1755
  }
1704
1756
  for (
1705
1757
  o = this.ve - 1, u = t - 1;
1706
1758
  o >= s &&
1707
1759
  u >= s &&
1708
- (this.ke[o] === e[u] || (this.Pe && compare(this.We, this.ke[o], e[u])));
1760
+ (this.je[o] === e[u] || (this.Ie && compare(this.We, this.je[o], e[u])));
1709
1761
  o--, u--
1710
1762
  ) {
1711
- d[u] = this.Ae[o];
1712
- h[u] = this.Ee[o];
1713
- p && (p[u] = this.Pe[o]);
1714
- y && (y[u] = this.He[o]);
1763
+ d[u] = this.Ee[o];
1764
+ h[u] = this.Pe[o];
1765
+ p && (p[u] = this.Ie[o]);
1766
+ y && (y[u] = this.Fe[o]);
1715
1767
  }
1716
1768
  c = new Map();
1717
1769
  a = new Array(u + 1);
@@ -1723,144 +1775,144 @@ function updateKeyedMap() {
1723
1775
  c.set(f, r);
1724
1776
  }
1725
1777
  for (n = s; n <= o; n++) {
1726
- l = this.ke[n];
1778
+ l = this.je[n];
1727
1779
  f = this.We ? this.We(l) : l;
1728
1780
  r = c.get(f);
1729
1781
  if (r !== undefined && r !== -1) {
1730
- d[r] = this.Ae[n];
1731
- h[r] = this.Ee[n];
1732
- p && (p[r] = this.Pe[n]);
1733
- y && (y[r] = this.He[n]);
1782
+ d[r] = this.Ee[n];
1783
+ h[r] = this.Pe[n];
1784
+ p && (p[r] = this.Ie[n]);
1785
+ y && (y[r] = this.Fe[n]);
1734
1786
  r = a[r];
1735
1787
  c.set(f, r);
1736
- } else this.Ee[n].dispose();
1788
+ } else this.Pe[n].dispose();
1737
1789
  }
1738
1790
  for (r = s; r < t; r++) {
1739
1791
  if (r in d) {
1740
- this.Ae[r] = d[r];
1741
- this.Ee[r] = h[r];
1792
+ this.Ee[r] = d[r];
1793
+ this.Pe[r] = h[r];
1742
1794
  if (p) {
1743
- this.Pe[r] = p[r];
1744
- setSignal(this.Pe[r], e[r]);
1795
+ this.Ie[r] = p[r];
1796
+ setSignal(this.Ie[r], e[r]);
1745
1797
  }
1746
1798
  if (y) {
1747
- this.He[r] = y[r];
1748
- setSignal(this.He[r], r);
1799
+ this.Fe[r] = y[r];
1800
+ setSignal(this.Fe[r], r);
1749
1801
  }
1750
1802
  } else {
1751
- this.Ae[r] = runWithOwner((this.Ee[r] = createOwner()), i);
1803
+ this.Ee[r] = runWithOwner((this.Pe[r] = createOwner()), i);
1752
1804
  }
1753
1805
  }
1754
- this.Ae = this.Ae.slice(0, (this.ve = t));
1755
- this.ke = e.slice(0);
1806
+ this.Ee = this.Ee.slice(0, (this.ve = t));
1807
+ this.je = e.slice(0);
1756
1808
  }
1757
1809
  });
1758
- return this.Ae;
1810
+ return this.Ee;
1759
1811
  }
1760
1812
  function repeat(e, t, n) {
1761
1813
  return updateRepeat.bind({
1762
- Ce: createOwner(),
1814
+ Ne: createOwner(),
1763
1815
  ve: 0,
1764
- Fe: 0,
1765
- Qe: e,
1766
- je: t,
1816
+ Qe: 0,
1817
+ Re: e,
1818
+ Ae: t,
1819
+ Pe: [],
1767
1820
  Ee: [],
1768
- Ae: [],
1769
- Re: n?.from,
1770
- Ie: n?.fallback
1821
+ Ve: n?.from,
1822
+ He: n?.fallback
1771
1823
  });
1772
1824
  }
1773
1825
  function updateRepeat() {
1774
- const e = this.Qe();
1775
- const t = this.Re?.() || 0;
1776
- runWithOwner(this.Ce, () => {
1826
+ const e = this.Re();
1827
+ const t = this.Ve?.() || 0;
1828
+ runWithOwner(this.Ne, () => {
1777
1829
  if (e === 0) {
1778
1830
  if (this.ve !== 0) {
1779
- this.Ce.dispose(false);
1831
+ this.Ne.dispose(false);
1832
+ this.Pe = [];
1780
1833
  this.Ee = [];
1781
- this.Ae = [];
1782
1834
  this.ve = 0;
1783
1835
  }
1784
- if (this.Ie && !this.Ae[0]) {
1785
- this.Ae[0] = runWithOwner((this.Ee[0] = createOwner()), this.Ie);
1836
+ if (this.He && !this.Ee[0]) {
1837
+ this.Ee[0] = runWithOwner((this.Pe[0] = createOwner()), this.He);
1786
1838
  }
1787
1839
  return;
1788
1840
  }
1789
1841
  const n = t + e;
1790
- const r = this.Fe + this.ve;
1791
- if (this.ve === 0 && this.Ee[0]) this.Ee[0].dispose();
1792
- for (let e = n; e < r; e++) this.Ee[e - this.Fe].dispose();
1793
- if (this.Fe < t) {
1794
- let e = this.Fe;
1795
- while (e < t && e < this.ve) this.Ee[e++].dispose();
1796
- this.Ee.splice(0, t - this.Fe);
1797
- this.Ae.splice(0, t - this.Fe);
1798
- } else if (this.Fe > t) {
1799
- let n = r - this.Fe - 1;
1800
- let i = this.Fe - t;
1801
- this.Ee.length = this.Ae.length = e;
1842
+ const r = this.Qe + this.ve;
1843
+ if (this.ve === 0 && this.Pe[0]) this.Pe[0].dispose();
1844
+ for (let e = n; e < r; e++) this.Pe[e - this.Qe].dispose();
1845
+ if (this.Qe < t) {
1846
+ let e = this.Qe;
1847
+ while (e < t && e < this.ve) this.Pe[e++].dispose();
1848
+ this.Pe.splice(0, t - this.Qe);
1849
+ this.Ee.splice(0, t - this.Qe);
1850
+ } else if (this.Qe > t) {
1851
+ let n = r - this.Qe - 1;
1852
+ let i = this.Qe - t;
1853
+ this.Pe.length = this.Ee.length = e;
1802
1854
  while (n >= i) {
1855
+ this.Pe[n] = this.Pe[n - i];
1803
1856
  this.Ee[n] = this.Ee[n - i];
1804
- this.Ae[n] = this.Ae[n - i];
1805
1857
  n--;
1806
1858
  }
1807
1859
  for (let e = 0; e < i; e++) {
1808
- this.Ae[e] = runWithOwner((this.Ee[e] = createOwner()), () => this.je(e + t));
1860
+ this.Ee[e] = runWithOwner((this.Pe[e] = createOwner()), () => this.Ae(e + t));
1809
1861
  }
1810
1862
  }
1811
1863
  for (let e = r; e < n; e++) {
1812
- this.Ae[e - t] = runWithOwner((this.Ee[e - t] = createOwner()), () => this.je(e));
1864
+ this.Ee[e - t] = runWithOwner((this.Pe[e - t] = createOwner()), () => this.Ae(e));
1813
1865
  }
1814
- this.Ae = this.Ae.slice(0, e);
1815
- this.Fe = t;
1866
+ this.Ee = this.Ee.slice(0, e);
1867
+ this.Qe = t;
1816
1868
  this.ve = e;
1817
1869
  });
1818
- return this.Ae;
1870
+ return this.Ee;
1819
1871
  }
1820
1872
  function compare(e, t, n) {
1821
1873
  return e ? e(t) === e(n) : true;
1822
1874
  }
1823
1875
  function boundaryComputed(e, t) {
1824
1876
  const n = computed(e, undefined, {
1825
- Se: {
1877
+ be: {
1826
1878
  le() {
1827
1879
  let e = this.$;
1828
- this.$ &= ~this.Ve;
1829
- if (this.Ve & f && !(this.$ & a)) {
1880
+ this.$ &= ~this.qe;
1881
+ if (this.qe & f && !(this.$ & a)) {
1830
1882
  e &= ~f;
1831
1883
  }
1832
- this.we.notify(this, this.Ve, e);
1884
+ this._e.notify(this, this.qe, e);
1833
1885
  },
1834
- Ve: t
1886
+ qe: t
1835
1887
  }
1836
1888
  });
1837
- n.Ve = t;
1838
- n.he = true;
1889
+ n.qe = t;
1890
+ n.pe = true;
1839
1891
  return n;
1840
1892
  }
1841
1893
  function createBoundChildren(e, t, n, r) {
1842
- const i = e.we;
1843
- i.addChild((e.we = n));
1844
- onCleanup(() => i.removeChild(e.we));
1894
+ const i = e._e;
1895
+ i.addChild((e._e = n));
1896
+ onCleanup(() => i.removeChild(e._e));
1845
1897
  return runWithOwner(e, () => {
1846
1898
  const e = computed(t);
1847
1899
  return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
1848
1900
  });
1849
1901
  }
1850
1902
  class ConditionalQueue extends Queue {
1851
- qe;
1852
- Me = new Set();
1903
+ Me;
1904
+ De = new Set();
1853
1905
  M = new Set();
1854
1906
  constructor(e) {
1855
1907
  super();
1856
- this.qe = e;
1908
+ this.Me = e;
1857
1909
  }
1858
1910
  run(e) {
1859
- if (!e || read(this.qe)) return;
1911
+ if (!e || read(this.Me)) return;
1860
1912
  return super.run(e);
1861
1913
  }
1862
1914
  notify(e, t, n) {
1863
- if (read(this.qe)) {
1915
+ if (read(this.Me)) {
1864
1916
  if (t & f) {
1865
1917
  if (n & f) {
1866
1918
  this.M.add(e);
@@ -1869,69 +1921,69 @@ class ConditionalQueue extends Queue {
1869
1921
  }
1870
1922
  if (t & c) {
1871
1923
  if (n & c) {
1872
- this.Me.add(e);
1924
+ this.De.add(e);
1873
1925
  t &= ~c;
1874
- } else if (this.Me.delete(e)) t &= ~c;
1926
+ } else if (this.De.delete(e)) t &= ~c;
1875
1927
  }
1876
1928
  }
1877
1929
  return t ? super.notify(e, t, n) : true;
1878
1930
  }
1879
1931
  }
1880
1932
  class CollectionQueue extends Queue {
1881
- De;
1882
- Ee = new Set();
1883
- qe = signal(false, { pureWrite: true });
1884
- Be = false;
1933
+ Be;
1934
+ Pe = new Set();
1935
+ Me = signal(false, { pureWrite: true });
1936
+ Te = false;
1885
1937
  constructor(e) {
1886
1938
  super();
1887
- this.De = e;
1939
+ this.Be = e;
1888
1940
  }
1889
1941
  run(e) {
1890
- if (!e || read(this.qe)) return;
1942
+ if (!e || read(this.Me)) return;
1891
1943
  return super.run(e);
1892
1944
  }
1893
1945
  notify(e, t, n) {
1894
- if (!(t & this.De) || (this.De & f && this.Be)) return super.notify(e, t, n);
1895
- if (n & this.De) {
1896
- this.Ee.add(e);
1897
- if (this.Ee.size === 1) setSignal(this.qe, true);
1898
- } else if (this.Ee.size > 0) {
1899
- this.Ee.delete(e);
1900
- if (this.Ee.size === 0) setSignal(this.qe, false);
1901
- }
1902
- t &= ~this.De;
1946
+ if (!(t & this.Be) || (this.Be & f && this.Te)) return super.notify(e, t, n);
1947
+ if (n & this.Be) {
1948
+ this.Pe.add(e);
1949
+ if (this.Pe.size === 1) setSignal(this.Me, true);
1950
+ } else if (this.Pe.size > 0) {
1951
+ this.Pe.delete(e);
1952
+ if (this.Pe.size === 0) setSignal(this.Me, false);
1953
+ }
1954
+ t &= ~this.Be;
1903
1955
  return t ? super.notify(e, t, n) : true;
1904
1956
  }
1905
1957
  }
1906
- var J;
1958
+ var X;
1907
1959
  (function (e) {
1908
1960
  e["VISIBLE"] = "visible";
1909
1961
  e["HIDDEN"] = "hidden";
1910
- })(J || (J = {}));
1962
+ })(X || (X = {}));
1911
1963
  function createBoundary(e, t) {
1912
1964
  const n = createOwner();
1913
- const r = new ConditionalQueue(computed(() => t() === J.HIDDEN));
1965
+ const r = new ConditionalQueue(computed(() => t() === X.HIDDEN));
1914
1966
  const i = createBoundChildren(n, e, r, 0);
1915
1967
  computed(() => {
1916
- const e = read(r.qe);
1917
- i.Ve = e ? c | f : 0;
1968
+ const e = read(r.Me);
1969
+ i.qe = e ? c | f : 0;
1918
1970
  if (!e) {
1919
1971
  r.M.forEach(e => r.notify(e, f, f));
1920
- r.Me.forEach(e => r.notify(e, c, c));
1972
+ r.De.forEach(e => r.notify(e, c, c));
1921
1973
  r.M.clear();
1922
- r.Me.clear();
1974
+ r.De.clear();
1923
1975
  }
1924
1976
  });
1925
- return () => (read(r.qe) ? undefined : read(i));
1977
+ return () => (read(r.Me) ? undefined : read(i));
1926
1978
  }
1927
1979
  function createCollectionBoundary(e, t, n) {
1928
1980
  const r = createOwner();
1929
1981
  const i = new CollectionQueue(e);
1930
1982
  const s = createBoundChildren(r, t, i, e);
1931
1983
  const o = computed(() => {
1932
- if (!read(i.qe)) {
1984
+ if (!read(i.Me)) {
1933
1985
  const e = read(s);
1934
- if (!untrack(() => read(i.qe))) i.Be = true;
1986
+ if (!untrack(() => read(i.Me))) i.Te = true;
1935
1987
  return e;
1936
1988
  }
1937
1989
  return n(i);
@@ -1943,23 +1995,23 @@ function createLoadBoundary(e, t) {
1943
1995
  }
1944
1996
  function collectErrorSources(e, t) {
1945
1997
  let n = true;
1946
- let r = e.W;
1998
+ let r = e.P;
1947
1999
  while (r !== null) {
1948
- const e = r.H;
1949
- if (e.W && e.$ & c) {
2000
+ const e = r.I;
2001
+ if (e.P && e.$ & c) {
1950
2002
  n = false;
1951
2003
  collectErrorSources(e, t);
1952
2004
  }
1953
- r = r.P;
2005
+ r = r.W;
1954
2006
  }
1955
2007
  n && t.push(e);
1956
2008
  }
1957
2009
  function createErrorBoundary(e, t) {
1958
2010
  return createCollectionBoundary(c, e, e => {
1959
- let n = e.Ee.values().next().value;
1960
- return t(n.L, () => {
2011
+ let n = e.Pe.values().next().value;
2012
+ return t(n.K, () => {
1961
2013
  const t = [];
1962
- for (const n of e.Ee) collectErrorSources(n, t);
2014
+ for (const n of e.Pe) collectErrorSources(n, t);
1963
2015
  for (const e of t) recompute(e);
1964
2016
  schedule();
1965
2017
  });
@@ -2014,9 +2066,9 @@ function flattenArray(e, t = [], n) {
2014
2066
  if (r) throw r;
2015
2067
  return i;
2016
2068
  }
2017
- exports.$PROXY = H;
2018
- exports.$TARGET = P;
2019
- exports.$TRACK = E;
2069
+ exports.$PROXY = F;
2070
+ exports.$TARGET = I;
2071
+ exports.$TRACK = P;
2020
2072
  exports.ContextNotFoundError = ContextNotFoundError;
2021
2073
  exports.NoOwnerError = NoOwnerError;
2022
2074
  exports.NotReadyError = NotReadyError;