@solidjs/signals 0.9.1 → 0.9.3

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