@solidjs/signals 0.13.12 → 2.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/dev.js +188 -102
- package/dist/node.cjs +501 -446
- package/dist/prod.js +368 -305
- package/dist/types/core/graph.d.ts +1 -0
- package/dist/types/core/types.d.ts +2 -2
- package/dist/types/signals.d.ts +15 -21
- package/dist/types/store/optimistic.d.ts +2 -2
- package/dist/types/store/projection.d.ts +4 -4
- package/dist/types/store/store.d.ts +2 -2
- package/dist/types-cjs/boundaries.d.cts +52 -0
- package/dist/types-cjs/core/action.d.cts +1 -0
- package/dist/types-cjs/core/async.d.cts +6 -0
- package/dist/types-cjs/core/constants.d.cts +25 -0
- package/dist/types-cjs/core/context.d.cts +28 -0
- package/dist/types-cjs/core/core.d.cts +54 -0
- package/dist/types-cjs/core/dev.d.cts +49 -0
- package/dist/types-cjs/core/effect.d.cts +30 -0
- package/dist/types-cjs/core/error.d.cts +14 -0
- package/dist/types-cjs/core/external.d.cts +26 -0
- package/dist/types-cjs/core/graph.d.cts +4 -0
- package/dist/types-cjs/core/heap.d.cts +14 -0
- package/dist/types-cjs/core/index.d.cts +12 -0
- package/dist/types-cjs/core/lanes.d.cts +54 -0
- package/dist/types-cjs/core/owner.d.cts +26 -0
- package/dist/types-cjs/core/scheduler.d.cts +81 -0
- package/dist/types-cjs/core/types.d.cts +86 -0
- package/dist/types-cjs/index.d.cts +9 -0
- package/dist/types-cjs/map.d.cts +24 -0
- package/dist/types-cjs/package.json +3 -0
- package/dist/types-cjs/signals.d.cts +186 -0
- package/dist/types-cjs/store/index.d.cts +9 -0
- package/dist/types-cjs/store/optimistic.d.cts +19 -0
- package/dist/types-cjs/store/projection.d.cts +26 -0
- package/dist/types-cjs/store/reconcile.d.cts +1 -0
- package/dist/types-cjs/store/store.d.cts +68 -0
- package/dist/types-cjs/store/storePath.d.cts +30 -0
- package/dist/types-cjs/store/utils.d.cts +43 -0
- package/package.json +31 -24
package/dist/node.cjs
CHANGED
|
@@ -38,13 +38,13 @@ const a = 1 << 0;
|
|
|
38
38
|
const d = 1 << 1;
|
|
39
39
|
const h = 1 << 2;
|
|
40
40
|
const p = 1;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const y = 2;
|
|
42
|
+
const g = 3;
|
|
43
43
|
const S = {};
|
|
44
44
|
const w = {};
|
|
45
45
|
const m = "sp";
|
|
46
|
-
const
|
|
47
|
-
const
|
|
46
|
+
const b = typeof Proxy === "function";
|
|
47
|
+
const _ = {};
|
|
48
48
|
const O = Symbol("refresh");
|
|
49
49
|
function actualInsertIntoHeap(e, t) {
|
|
50
50
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
@@ -117,12 +117,12 @@ function markNode(e, r = n) {
|
|
|
117
117
|
}
|
|
118
118
|
function runHeap(e, t) {
|
|
119
119
|
e._ = false;
|
|
120
|
-
for (e.
|
|
121
|
-
let n = e.l[e.
|
|
120
|
+
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
121
|
+
let n = e.l[e.j];
|
|
122
122
|
while (n !== undefined) {
|
|
123
123
|
if (n.m & i) t(n);
|
|
124
124
|
else adjustHeight(n, e);
|
|
125
|
-
n = e.l[e.
|
|
125
|
+
n = e.l[e.j];
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
e.S = 0;
|
|
@@ -130,7 +130,7 @@ function runHeap(e, t) {
|
|
|
130
130
|
function adjustHeight(e, t) {
|
|
131
131
|
deleteFromHeap(e, t);
|
|
132
132
|
let n = e.o;
|
|
133
|
-
for (let t = e.
|
|
133
|
+
for (let t = e.A; t; t = t.N) {
|
|
134
134
|
const e = t.R;
|
|
135
135
|
const r = e.L || e;
|
|
136
136
|
if (r.I && r.o >= n) n = r.o + 1;
|
|
@@ -144,16 +144,16 @@ function adjustHeight(e, t) {
|
|
|
144
144
|
}
|
|
145
145
|
const x = undefined;
|
|
146
146
|
const v = new Set();
|
|
147
|
-
const P = { l: new Array(2e3).fill(undefined), _: false,
|
|
148
|
-
const k = { l: new Array(2e3).fill(undefined), _: false,
|
|
147
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
+
const k = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
149
149
|
let E = 0;
|
|
150
150
|
let C = null;
|
|
151
151
|
let W = false;
|
|
152
|
-
let
|
|
153
|
-
let
|
|
152
|
+
let j = false;
|
|
153
|
+
let A = null;
|
|
154
154
|
function enforceLoadingBoundary(e) {}
|
|
155
155
|
function shouldReadStashedOptimisticValue(e) {
|
|
156
|
-
return !!
|
|
156
|
+
return !!A?.has(e);
|
|
157
157
|
}
|
|
158
158
|
function runLaneEffects(e) {
|
|
159
159
|
for (const t of L) {
|
|
@@ -169,25 +169,25 @@ function queueStashedOptimisticEffects(e) {
|
|
|
169
169
|
for (let t = e.O; t !== null; t = t.P) {
|
|
170
170
|
const e = t.k;
|
|
171
171
|
if (!e.D) continue;
|
|
172
|
-
if (e.D ===
|
|
172
|
+
if (e.D === g) {
|
|
173
173
|
if (!e.F) {
|
|
174
174
|
e.F = true;
|
|
175
|
-
e.
|
|
175
|
+
e.V.enqueue(y, e.M);
|
|
176
176
|
}
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
179
|
const n = e.m & o ? k : P;
|
|
180
|
-
if (n.
|
|
180
|
+
if (n.j > e.o) n.j = e.o;
|
|
181
181
|
insertIntoHeap(e, n);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
function setProjectionWriteActive(e) {
|
|
185
|
-
|
|
185
|
+
j = e;
|
|
186
186
|
}
|
|
187
187
|
function mergeTransitionState(e, t) {
|
|
188
188
|
t.B = e;
|
|
189
|
-
e.
|
|
190
|
-
for (const n of L) if (n.
|
|
189
|
+
e.K.push(...t.K);
|
|
190
|
+
for (const n of L) if (n.G === t) n.G = e;
|
|
191
191
|
e.U.push(...t.U);
|
|
192
192
|
for (const n of t.J) e.J.add(n);
|
|
193
193
|
for (const [n, r] of t.X) {
|
|
@@ -207,17 +207,17 @@ function resolveOptimisticNodes(e) {
|
|
|
207
207
|
const r = n.ee;
|
|
208
208
|
n.ee = S;
|
|
209
209
|
if (r !== S && n.$ !== r) insertSubs(n, true);
|
|
210
|
-
n.
|
|
210
|
+
n.G = null;
|
|
211
211
|
}
|
|
212
212
|
e.length = 0;
|
|
213
213
|
}
|
|
214
214
|
function cleanupCompletedLanes(e) {
|
|
215
215
|
for (const t of L) {
|
|
216
|
-
const n = e ? t.
|
|
216
|
+
const n = e ? t.G === e : !t.G;
|
|
217
217
|
if (!n) continue;
|
|
218
218
|
if (!t.T) {
|
|
219
219
|
if (t.q[0].length) runQueue(t.q[0], p);
|
|
220
|
-
if (t.q[1].length) runQueue(t.q[1],
|
|
220
|
+
if (t.q[1].length) runQueue(t.q[1], y);
|
|
221
221
|
}
|
|
222
222
|
if (t.te.Y === t) t.te.Y = undefined;
|
|
223
223
|
t.H.clear();
|
|
@@ -230,7 +230,7 @@ function cleanupCompletedLanes(e) {
|
|
|
230
230
|
function schedule() {
|
|
231
231
|
if (W) return;
|
|
232
232
|
W = true;
|
|
233
|
-
if (!
|
|
233
|
+
if (!N.ne && !j) queueMicrotask(flush);
|
|
234
234
|
}
|
|
235
235
|
class Queue {
|
|
236
236
|
i = null;
|
|
@@ -317,25 +317,25 @@ class GlobalQueue extends Queue {
|
|
|
317
317
|
this.U = [];
|
|
318
318
|
this.J = new Set();
|
|
319
319
|
runLaneEffects(p);
|
|
320
|
-
runLaneEffects(
|
|
320
|
+
runLaneEffects(y);
|
|
321
321
|
this.stashQueues(e.le);
|
|
322
322
|
E++;
|
|
323
|
-
W = P.S >= P.
|
|
323
|
+
W = P.S >= P.j;
|
|
324
324
|
reassignPendingTransition(e.se);
|
|
325
325
|
C = null;
|
|
326
|
-
if (!e.
|
|
327
|
-
|
|
326
|
+
if (!e.K.length && e.U.length) {
|
|
327
|
+
A = new Set();
|
|
328
328
|
for (let t = 0; t < e.U.length; t++) {
|
|
329
329
|
const n = e.U[t];
|
|
330
330
|
if (n.I || n.ce) continue;
|
|
331
|
-
|
|
331
|
+
A.add(n);
|
|
332
332
|
queueStashedOptimisticEffects(n);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
try {
|
|
336
336
|
finalizePureQueue(null, true);
|
|
337
337
|
} finally {
|
|
338
|
-
|
|
338
|
+
A = null;
|
|
339
339
|
}
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
@@ -351,11 +351,11 @@ class GlobalQueue extends Queue {
|
|
|
351
351
|
finalizePureQueue();
|
|
352
352
|
}
|
|
353
353
|
E++;
|
|
354
|
-
W = P.S >= P.
|
|
354
|
+
W = P.S >= P.j;
|
|
355
355
|
runLaneEffects(p);
|
|
356
356
|
this.run(p);
|
|
357
|
-
runLaneEffects(
|
|
358
|
-
this.run(
|
|
357
|
+
runLaneEffects(y);
|
|
358
|
+
this.run(y);
|
|
359
359
|
if (false);
|
|
360
360
|
} finally {
|
|
361
361
|
this.ne = false;
|
|
@@ -389,7 +389,7 @@ class GlobalQueue extends Queue {
|
|
|
389
389
|
X: new Map(),
|
|
390
390
|
U: [],
|
|
391
391
|
J: new Set(),
|
|
392
|
-
|
|
392
|
+
K: [],
|
|
393
393
|
le: { re: [[], []], ie: [] },
|
|
394
394
|
B: false
|
|
395
395
|
};
|
|
@@ -404,7 +404,7 @@ class GlobalQueue extends Queue {
|
|
|
404
404
|
if (this.se !== C.se) {
|
|
405
405
|
for (let e = 0; e < this.se.length; e++) {
|
|
406
406
|
const t = this.se[e];
|
|
407
|
-
t.
|
|
407
|
+
t.G = C;
|
|
408
408
|
C.se.push(t);
|
|
409
409
|
}
|
|
410
410
|
this.se = C.se;
|
|
@@ -412,13 +412,13 @@ class GlobalQueue extends Queue {
|
|
|
412
412
|
if (this.U !== C.U) {
|
|
413
413
|
for (let e = 0; e < this.U.length; e++) {
|
|
414
414
|
const t = this.U[e];
|
|
415
|
-
t.
|
|
415
|
+
t.G = C;
|
|
416
416
|
C.U.push(t);
|
|
417
417
|
}
|
|
418
418
|
this.U = C.U;
|
|
419
419
|
}
|
|
420
420
|
for (const e of L) {
|
|
421
|
-
if (!e.
|
|
421
|
+
if (!e.G) e.G = C;
|
|
422
422
|
}
|
|
423
423
|
if (this.J !== C.J) {
|
|
424
424
|
for (const e of this.J) C.J.add(e);
|
|
@@ -442,28 +442,28 @@ function insertSubs(e, t = false) {
|
|
|
442
442
|
i.k.Y = undefined;
|
|
443
443
|
}
|
|
444
444
|
const e = i.k;
|
|
445
|
-
if (e.D ===
|
|
445
|
+
if (e.D === g) {
|
|
446
446
|
if (!e.F) {
|
|
447
447
|
e.F = true;
|
|
448
|
-
e.
|
|
448
|
+
e.V.enqueue(y, e.M);
|
|
449
449
|
}
|
|
450
450
|
continue;
|
|
451
451
|
}
|
|
452
452
|
const s = i.k.m & o ? k : P;
|
|
453
|
-
if (s.
|
|
453
|
+
if (s.j > i.k.o) s.j = i.k.o;
|
|
454
454
|
insertIntoHeap(i.k, s);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
function commitPendingNodes() {
|
|
458
|
-
const e =
|
|
458
|
+
const e = N.se;
|
|
459
459
|
for (let t = 0; t < e.length; t++) {
|
|
460
460
|
const n = e[t];
|
|
461
461
|
if (n.Z !== S) {
|
|
462
462
|
n.$ = n.Z;
|
|
463
463
|
n.Z = S;
|
|
464
|
-
if (n.D && n.D !==
|
|
464
|
+
if (n.D && n.D !== g) n.F = true;
|
|
465
465
|
}
|
|
466
|
-
if (!(n.
|
|
466
|
+
if (!(n.ye & a)) n.ye &= ~h;
|
|
467
467
|
if (n.I) GlobalQueue.ue(n, false, true);
|
|
468
468
|
}
|
|
469
469
|
e.length = 0;
|
|
@@ -471,12 +471,12 @@ function commitPendingNodes() {
|
|
|
471
471
|
function finalizePureQueue(e = null, t = false) {
|
|
472
472
|
const n = !t;
|
|
473
473
|
if (n) commitPendingNodes();
|
|
474
|
-
if (!t) checkBoundaryChildren(
|
|
475
|
-
if (P.S >= P.
|
|
474
|
+
if (!t) checkBoundaryChildren(N);
|
|
475
|
+
if (P.S >= P.j) runHeap(P, GlobalQueue.oe);
|
|
476
476
|
if (n) {
|
|
477
477
|
commitPendingNodes();
|
|
478
|
-
resolveOptimisticNodes(e ? e.U :
|
|
479
|
-
const t = e ? e.J :
|
|
478
|
+
resolveOptimisticNodes(e ? e.U : N.U);
|
|
479
|
+
const t = e ? e.J : N.J;
|
|
480
480
|
if (GlobalQueue.fe && t.size) {
|
|
481
481
|
for (const e of t) {
|
|
482
482
|
GlobalQueue.fe(e);
|
|
@@ -494,21 +494,21 @@ function checkBoundaryChildren(e) {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
function trackOptimisticStore(e) {
|
|
497
|
-
|
|
497
|
+
N.J.add(e);
|
|
498
498
|
schedule();
|
|
499
499
|
}
|
|
500
500
|
function reassignPendingTransition(e) {
|
|
501
501
|
for (let t = 0; t < e.length; t++) {
|
|
502
|
-
e[t].
|
|
502
|
+
e[t].G = C;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const
|
|
505
|
+
const N = new GlobalQueue();
|
|
506
506
|
function flush() {
|
|
507
|
-
if (
|
|
507
|
+
if (N.ne) {
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
510
|
while (W || C) {
|
|
511
|
-
|
|
511
|
+
N.flush();
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
function runQueue(e, t) {
|
|
@@ -516,19 +516,19 @@ function runQueue(e, t) {
|
|
|
516
516
|
}
|
|
517
517
|
function reporterBlocksSource(e, t) {
|
|
518
518
|
if (e.m & (o | u)) return false;
|
|
519
|
-
if (e.
|
|
520
|
-
for (let n = e.
|
|
519
|
+
if (e.ge === t || e.Se?.has(t)) return true;
|
|
520
|
+
for (let n = e.A; n; n = n.N) {
|
|
521
521
|
let e = n.R;
|
|
522
522
|
while (e) {
|
|
523
523
|
if (e === t || e.L === t) return true;
|
|
524
524
|
e = e.we;
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
return !!(e.
|
|
527
|
+
return !!(e.ye & a && e.ae instanceof NotReadyError && e.ae.source === t);
|
|
528
528
|
}
|
|
529
529
|
function transitionComplete(e) {
|
|
530
530
|
if (e.B) return true;
|
|
531
|
-
if (e.
|
|
531
|
+
if (e.K.length) return false;
|
|
532
532
|
let t = true;
|
|
533
533
|
for (const [n, r] of e.X) {
|
|
534
534
|
let i = false;
|
|
@@ -540,7 +540,7 @@ function transitionComplete(e) {
|
|
|
540
540
|
r.delete(e);
|
|
541
541
|
}
|
|
542
542
|
if (!i) e.X.delete(n);
|
|
543
|
-
else if (n.
|
|
543
|
+
else if (n.ye & a && n.ae?.source === n) {
|
|
544
544
|
t = false;
|
|
545
545
|
break;
|
|
546
546
|
}
|
|
@@ -550,8 +550,8 @@ function transitionComplete(e) {
|
|
|
550
550
|
const r = e.U[n];
|
|
551
551
|
if (
|
|
552
552
|
hasActiveOverride(r) &&
|
|
553
|
-
"
|
|
554
|
-
r.
|
|
553
|
+
"ye" in r &&
|
|
554
|
+
r.ye & a &&
|
|
555
555
|
r.ae instanceof NotReadyError &&
|
|
556
556
|
r.ae.source !== r
|
|
557
557
|
) {
|
|
@@ -588,10 +588,10 @@ function getOrCreateLane(e) {
|
|
|
588
588
|
}
|
|
589
589
|
const n = e.we;
|
|
590
590
|
const r = n?.Y ? findLane(n.Y) : null;
|
|
591
|
-
t = { te: e, H: new Set(), q: [[], []], T: null,
|
|
591
|
+
t = { te: e, H: new Set(), q: [[], []], T: null, G: C, me: r };
|
|
592
592
|
R.set(e, t);
|
|
593
593
|
L.add(t);
|
|
594
|
-
e.
|
|
594
|
+
e.be = false;
|
|
595
595
|
return t;
|
|
596
596
|
}
|
|
597
597
|
function findLane(e) {
|
|
@@ -617,7 +617,7 @@ function resolveLane(e) {
|
|
|
617
617
|
return undefined;
|
|
618
618
|
}
|
|
619
619
|
function resolveTransition(e) {
|
|
620
|
-
return resolveLane(e)?.
|
|
620
|
+
return resolveLane(e)?.G ?? e.G;
|
|
621
621
|
}
|
|
622
622
|
function hasActiveOverride(e) {
|
|
623
623
|
return !!(e.ee !== undefined && e.ee !== S);
|
|
@@ -645,10 +645,10 @@ function assignOrMergeLane(e, t) {
|
|
|
645
645
|
}
|
|
646
646
|
function unlinkSubs(e) {
|
|
647
647
|
const t = e.R;
|
|
648
|
-
const n = e.
|
|
648
|
+
const n = e.N;
|
|
649
649
|
const r = e.P;
|
|
650
|
-
const i = e.
|
|
651
|
-
if (r !== null) r.
|
|
650
|
+
const i = e._e;
|
|
651
|
+
if (r !== null) r._e = i;
|
|
652
652
|
else t.Oe = i;
|
|
653
653
|
if (i !== null) i.P = r;
|
|
654
654
|
else {
|
|
@@ -662,11 +662,12 @@ function unlinkSubs(e) {
|
|
|
662
662
|
}
|
|
663
663
|
function unobserved(e) {
|
|
664
664
|
deleteFromHeap(e, e.m & o ? k : P);
|
|
665
|
-
let t = e.
|
|
665
|
+
let t = e.A;
|
|
666
666
|
while (t !== null) {
|
|
667
667
|
t = unlinkSubs(t);
|
|
668
668
|
}
|
|
669
|
-
e.
|
|
669
|
+
e.A = null;
|
|
670
|
+
e.Pe = null;
|
|
670
671
|
disposeChildren(e, true);
|
|
671
672
|
}
|
|
672
673
|
function link(e, t) {
|
|
@@ -675,7 +676,7 @@ function link(e, t) {
|
|
|
675
676
|
let i = null;
|
|
676
677
|
const s = t.m & r;
|
|
677
678
|
if (s) {
|
|
678
|
-
i = n !== null ? n.
|
|
679
|
+
i = n !== null ? n.N : t.A;
|
|
679
680
|
if (i !== null && i.R === e) {
|
|
680
681
|
t.Pe = i;
|
|
681
682
|
return;
|
|
@@ -683,20 +684,20 @@ function link(e, t) {
|
|
|
683
684
|
}
|
|
684
685
|
const o = e.Oe;
|
|
685
686
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
686
|
-
const u = (t.Pe = e.Oe = { R: e, k: t,
|
|
687
|
-
if (n !== null) n.
|
|
688
|
-
else t.
|
|
687
|
+
const u = (t.Pe = e.Oe = { R: e, k: t, N: i, _e: o, P: null });
|
|
688
|
+
if (n !== null) n.N = u;
|
|
689
|
+
else t.A = u;
|
|
689
690
|
if (o !== null) o.P = u;
|
|
690
691
|
else e.O = u;
|
|
691
692
|
}
|
|
692
693
|
function isValidLink(e, t) {
|
|
693
694
|
const n = t.Pe;
|
|
694
695
|
if (n !== null) {
|
|
695
|
-
let r = t.
|
|
696
|
+
let r = t.A;
|
|
696
697
|
do {
|
|
697
698
|
if (r === e) return true;
|
|
698
699
|
if (r === n) break;
|
|
699
|
-
r = r.
|
|
700
|
+
r = r.N;
|
|
700
701
|
} while (r !== null);
|
|
701
702
|
}
|
|
702
703
|
return false;
|
|
@@ -715,11 +716,11 @@ function markDisposal(e) {
|
|
|
715
716
|
}
|
|
716
717
|
}
|
|
717
718
|
function dispose(e) {
|
|
718
|
-
let t = e.
|
|
719
|
+
let t = e.A || null;
|
|
719
720
|
do {
|
|
720
721
|
t = unlinkSubs(t);
|
|
721
722
|
} while (t !== null);
|
|
722
|
-
e.
|
|
723
|
+
e.A = null;
|
|
723
724
|
e.Pe = null;
|
|
724
725
|
disposeChildren(e, true);
|
|
725
726
|
}
|
|
@@ -730,14 +731,14 @@ function disposeChildren(e, t = false, n) {
|
|
|
730
731
|
let r = n ? e.We : e.ke;
|
|
731
732
|
while (r) {
|
|
732
733
|
const e = r.Ee;
|
|
733
|
-
if (r.
|
|
734
|
+
if (r.A) {
|
|
734
735
|
const e = r;
|
|
735
736
|
deleteFromHeap(e, e.m & o ? k : P);
|
|
736
|
-
let t = e.
|
|
737
|
+
let t = e.A;
|
|
737
738
|
do {
|
|
738
739
|
t = unlinkSubs(t);
|
|
739
740
|
} while (t !== null);
|
|
740
|
-
e.
|
|
741
|
+
e.A = null;
|
|
741
742
|
e.Pe = null;
|
|
742
743
|
}
|
|
743
744
|
disposeChildren(r, true);
|
|
@@ -747,12 +748,12 @@ function disposeChildren(e, t = false, n) {
|
|
|
747
748
|
e.We = null;
|
|
748
749
|
} else {
|
|
749
750
|
e.ke = null;
|
|
750
|
-
e.
|
|
751
|
+
e.je = 0;
|
|
751
752
|
}
|
|
752
753
|
runDisposal(e, n);
|
|
753
754
|
}
|
|
754
755
|
function runDisposal(e, t) {
|
|
755
|
-
let n = t ? e.
|
|
756
|
+
let n = t ? e.Ae : e.Ne;
|
|
756
757
|
if (!n) return;
|
|
757
758
|
if (Array.isArray(n)) {
|
|
758
759
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -762,12 +763,12 @@ function runDisposal(e, t) {
|
|
|
762
763
|
} else {
|
|
763
764
|
n.call(n);
|
|
764
765
|
}
|
|
765
|
-
t ? (e.
|
|
766
|
+
t ? (e.Ae = null) : (e.Ne = null);
|
|
766
767
|
}
|
|
767
768
|
function childId(e, t) {
|
|
768
769
|
let n = e;
|
|
769
770
|
while (n.Re && n.i) n = n.i;
|
|
770
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
771
|
+
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
771
772
|
throw new Error("Cannot get child id from owner without an id");
|
|
772
773
|
}
|
|
773
774
|
function getNextChildId(e) {
|
|
@@ -782,24 +783,24 @@ function formatId(e, t) {
|
|
|
782
783
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
783
784
|
}
|
|
784
785
|
function getObserver() {
|
|
785
|
-
if (D ||
|
|
786
|
-
return H ?
|
|
786
|
+
if (D || V) return I;
|
|
787
|
+
return H ? M : null;
|
|
787
788
|
}
|
|
788
789
|
function getOwner() {
|
|
789
|
-
return
|
|
790
|
+
return M;
|
|
790
791
|
}
|
|
791
792
|
function cleanup(e) {
|
|
792
|
-
if (!
|
|
793
|
-
if (!
|
|
794
|
-
else if (Array.isArray(
|
|
795
|
-
else
|
|
793
|
+
if (!M) return e;
|
|
794
|
+
if (!M.Ne) M.Ne = e;
|
|
795
|
+
else if (Array.isArray(M.Ne)) M.Ne.push(e);
|
|
796
|
+
else M.Ne = [M.Ne, e];
|
|
796
797
|
return e;
|
|
797
798
|
}
|
|
798
799
|
function isDisposed(e) {
|
|
799
800
|
return !!(e.m & (u | o));
|
|
800
801
|
}
|
|
801
802
|
function createOwner(e) {
|
|
802
|
-
const t =
|
|
803
|
+
const t = M;
|
|
803
804
|
const n = e?.transparent ?? false;
|
|
804
805
|
const r = {
|
|
805
806
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
@@ -808,11 +809,11 @@ function createOwner(e) {
|
|
|
808
809
|
u: t?.t ? t.u : t,
|
|
809
810
|
ke: null,
|
|
810
811
|
Ee: null,
|
|
811
|
-
je: null,
|
|
812
|
-
M: t?.M ?? j,
|
|
813
|
-
Le: t?.Le || b,
|
|
814
|
-
Ae: 0,
|
|
815
812
|
Ne: null,
|
|
813
|
+
V: t?.V ?? N,
|
|
814
|
+
Le: t?.Le || _,
|
|
815
|
+
je: 0,
|
|
816
|
+
Ae: null,
|
|
816
817
|
We: null,
|
|
817
818
|
i: t,
|
|
818
819
|
dispose(e = true) {
|
|
@@ -835,28 +836,28 @@ function createRoot(e, t) {
|
|
|
835
836
|
return runWithOwner(n, () => e(n.dispose));
|
|
836
837
|
}
|
|
837
838
|
function addPendingSource(e, t) {
|
|
838
|
-
if (e.
|
|
839
|
-
if (!e.
|
|
840
|
-
e.
|
|
839
|
+
if (e.ge === t || e.Se?.has(t)) return false;
|
|
840
|
+
if (!e.ge) {
|
|
841
|
+
e.ge = t;
|
|
841
842
|
return true;
|
|
842
843
|
}
|
|
843
844
|
if (!e.Se) {
|
|
844
|
-
e.Se = new Set([e.
|
|
845
|
+
e.Se = new Set([e.ge, t]);
|
|
845
846
|
} else {
|
|
846
847
|
e.Se.add(t);
|
|
847
848
|
}
|
|
848
|
-
e.
|
|
849
|
+
e.ge = undefined;
|
|
849
850
|
return true;
|
|
850
851
|
}
|
|
851
852
|
function removePendingSource(e, t) {
|
|
852
|
-
if (e.
|
|
853
|
-
if (e.
|
|
854
|
-
e.
|
|
853
|
+
if (e.ge) {
|
|
854
|
+
if (e.ge !== t) return false;
|
|
855
|
+
e.ge = undefined;
|
|
855
856
|
return true;
|
|
856
857
|
}
|
|
857
858
|
if (!e.Se?.delete(t)) return false;
|
|
858
859
|
if (e.Se.size === 1) {
|
|
859
|
-
e.
|
|
860
|
+
e.ge = e.Se.values().next().value;
|
|
860
861
|
e.Se = undefined;
|
|
861
862
|
} else if (e.Se.size === 0) {
|
|
862
863
|
e.Se = undefined;
|
|
@@ -864,7 +865,7 @@ function removePendingSource(e, t) {
|
|
|
864
865
|
return true;
|
|
865
866
|
}
|
|
866
867
|
function clearPendingSources(e) {
|
|
867
|
-
e.
|
|
868
|
+
e.ge = undefined;
|
|
868
869
|
e.Se?.clear();
|
|
869
870
|
e.Se = undefined;
|
|
870
871
|
}
|
|
@@ -895,24 +896,24 @@ function settlePendingSource(e) {
|
|
|
895
896
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
896
897
|
n.add(r);
|
|
897
898
|
r.de = E;
|
|
898
|
-
const i = r.
|
|
899
|
+
const i = r.ge ?? r.Se?.values().next().value;
|
|
899
900
|
if (i) {
|
|
900
901
|
setPendingError(r, i);
|
|
901
902
|
updatePendingSignal(r);
|
|
902
903
|
} else {
|
|
903
|
-
r.
|
|
904
|
+
r.ye &= ~a;
|
|
904
905
|
setPendingError(r);
|
|
905
906
|
updatePendingSignal(r);
|
|
906
907
|
if (r.Ie) {
|
|
907
|
-
if (r.D ===
|
|
908
|
+
if (r.D === g) {
|
|
908
909
|
const e = r;
|
|
909
910
|
if (!e.F) {
|
|
910
911
|
e.F = true;
|
|
911
|
-
e.
|
|
912
|
+
e.V.enqueue(y, e.M);
|
|
912
913
|
}
|
|
913
914
|
} else {
|
|
914
915
|
const e = r.m & o ? k : P;
|
|
915
|
-
if (e.
|
|
916
|
+
if (e.j > r.o) e.j = r.o;
|
|
916
917
|
insertIntoHeap(r, e);
|
|
917
918
|
}
|
|
918
919
|
t = true;
|
|
@@ -936,17 +937,18 @@ function handleAsync(e, t, r) {
|
|
|
936
937
|
let u;
|
|
937
938
|
const handleError = n => {
|
|
938
939
|
if (e.Ce !== t) return;
|
|
939
|
-
|
|
940
|
+
N.initTransition(resolveTransition(e));
|
|
940
941
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
941
942
|
e.de = E;
|
|
942
943
|
};
|
|
943
944
|
const asyncWrite = (i, s) => {
|
|
944
945
|
if (e.Ce !== t) return;
|
|
945
946
|
if (e.m & (n | f)) return;
|
|
946
|
-
|
|
947
|
+
N.initTransition(resolveTransition(e));
|
|
948
|
+
const o = !!(e.ye & h);
|
|
947
949
|
clearStatus(e);
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
+
const u = resolveLane(e);
|
|
951
|
+
if (u) u.H.delete(e);
|
|
950
952
|
if (r) r(i);
|
|
951
953
|
else if (e.ee !== undefined) {
|
|
952
954
|
if (e.ee !== undefined && e.ee !== S) e.Z = i;
|
|
@@ -955,10 +957,11 @@ function handleAsync(e, t, r) {
|
|
|
955
957
|
insertSubs(e);
|
|
956
958
|
}
|
|
957
959
|
e.de = E;
|
|
958
|
-
} else if (
|
|
959
|
-
const t = e
|
|
960
|
-
const n = e
|
|
961
|
-
|
|
960
|
+
} else if (u) {
|
|
961
|
+
const t = e.D;
|
|
962
|
+
const n = e.$;
|
|
963
|
+
const r = e.Te;
|
|
964
|
+
if ((!t && o) || !r || !r(i, n)) {
|
|
962
965
|
e.$ = i;
|
|
963
966
|
e.de = E;
|
|
964
967
|
if (e.He) {
|
|
@@ -990,8 +993,8 @@ function handleAsync(e, t, r) {
|
|
|
990
993
|
);
|
|
991
994
|
r = false;
|
|
992
995
|
if (!n) {
|
|
993
|
-
|
|
994
|
-
throw new NotReadyError(
|
|
996
|
+
N.initTransition(resolveTransition(e));
|
|
997
|
+
throw new NotReadyError(M);
|
|
995
998
|
}
|
|
996
999
|
}
|
|
997
1000
|
if (s) {
|
|
@@ -1044,8 +1047,8 @@ function handleAsync(e, t, r) {
|
|
|
1044
1047
|
};
|
|
1045
1048
|
const s = iterate();
|
|
1046
1049
|
if (!r && !s) {
|
|
1047
|
-
|
|
1048
|
-
throw new NotReadyError(
|
|
1050
|
+
N.initTransition(resolveTransition(e));
|
|
1051
|
+
throw new NotReadyError(M);
|
|
1049
1052
|
}
|
|
1050
1053
|
}
|
|
1051
1054
|
return u;
|
|
@@ -1053,7 +1056,7 @@ function handleAsync(e, t, r) {
|
|
|
1053
1056
|
function clearStatus(e, t = false) {
|
|
1054
1057
|
clearPendingSources(e);
|
|
1055
1058
|
e.Ie = false;
|
|
1056
|
-
e.
|
|
1059
|
+
e.ye = t ? 0 : e.ye & h;
|
|
1057
1060
|
setPendingError(e);
|
|
1058
1061
|
updatePendingSignal(e);
|
|
1059
1062
|
e.Qe?.();
|
|
@@ -1068,11 +1071,11 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1068
1071
|
if (!r) {
|
|
1069
1072
|
if (t === a && s) {
|
|
1070
1073
|
addPendingSource(e, s);
|
|
1071
|
-
e.
|
|
1074
|
+
e.ye = a | (e.ye & h);
|
|
1072
1075
|
setPendingError(e, s, n);
|
|
1073
1076
|
} else {
|
|
1074
1077
|
clearPendingSources(e);
|
|
1075
|
-
e.
|
|
1078
|
+
e.ye = t | (t !== d ? e.ye & h : 0);
|
|
1076
1079
|
e.ae = n;
|
|
1077
1080
|
}
|
|
1078
1081
|
updatePendingSignal(e);
|
|
@@ -1096,10 +1099,10 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1096
1099
|
forEachDependent(e, e => {
|
|
1097
1100
|
e.de = E;
|
|
1098
1101
|
if (
|
|
1099
|
-
(t === a && s && e.
|
|
1100
|
-
(t !== a && (e.ae !== n || e.
|
|
1102
|
+
(t === a && s && e.ge !== s && !e.Se?.has(s)) ||
|
|
1103
|
+
(t !== a && (e.ae !== n || e.ge || e.Se))
|
|
1101
1104
|
) {
|
|
1102
|
-
if (!l && !e.
|
|
1105
|
+
if (!l && !e.G) N.se.push(e);
|
|
1103
1106
|
notifyStatus(e, t, n, l, c);
|
|
1104
1107
|
}
|
|
1105
1108
|
});
|
|
@@ -1134,11 +1137,11 @@ let Q = false;
|
|
|
1134
1137
|
let q = false;
|
|
1135
1138
|
let D = false;
|
|
1136
1139
|
let F = false;
|
|
1137
|
-
let
|
|
1138
|
-
let
|
|
1140
|
+
let V = false;
|
|
1141
|
+
let M = null;
|
|
1139
1142
|
let B = null;
|
|
1140
|
-
let
|
|
1141
|
-
let
|
|
1143
|
+
let K = false;
|
|
1144
|
+
let G = null;
|
|
1142
1145
|
function ownerInSnapshotScope(e) {
|
|
1143
1146
|
while (e) {
|
|
1144
1147
|
if (e.qe) return true;
|
|
@@ -1147,8 +1150,8 @@ function ownerInSnapshotScope(e) {
|
|
|
1147
1150
|
return false;
|
|
1148
1151
|
}
|
|
1149
1152
|
function setSnapshotCapture(e) {
|
|
1150
|
-
|
|
1151
|
-
if (e && !
|
|
1153
|
+
K = e;
|
|
1154
|
+
if (e && !G) G = new Set();
|
|
1152
1155
|
}
|
|
1153
1156
|
function markSnapshotScope(e) {
|
|
1154
1157
|
e.qe = true;
|
|
@@ -1171,7 +1174,7 @@ function releaseSubtree(e) {
|
|
|
1171
1174
|
if (e.m & l) {
|
|
1172
1175
|
e.m &= ~l;
|
|
1173
1176
|
e.m |= n;
|
|
1174
|
-
if (P.
|
|
1177
|
+
if (P.j > e.o) P.j = e.o;
|
|
1175
1178
|
insertIntoHeap(e, P);
|
|
1176
1179
|
}
|
|
1177
1180
|
}
|
|
@@ -1180,50 +1183,51 @@ function releaseSubtree(e) {
|
|
|
1180
1183
|
}
|
|
1181
1184
|
}
|
|
1182
1185
|
function clearSnapshots() {
|
|
1183
|
-
if (
|
|
1184
|
-
for (const e of
|
|
1186
|
+
if (G) {
|
|
1187
|
+
for (const e of G) {
|
|
1185
1188
|
delete e.he;
|
|
1186
1189
|
delete e[m];
|
|
1187
1190
|
}
|
|
1188
|
-
|
|
1191
|
+
G = null;
|
|
1189
1192
|
}
|
|
1190
|
-
|
|
1193
|
+
K = false;
|
|
1191
1194
|
}
|
|
1192
1195
|
function recompute(t, n = false) {
|
|
1193
1196
|
const i = t.D;
|
|
1194
1197
|
if (!n) {
|
|
1195
|
-
if (t.
|
|
1198
|
+
if (t.G && (!i || C) && C !== t.G) N.initTransition(t.G);
|
|
1196
1199
|
deleteFromHeap(t, t.m & o ? k : P);
|
|
1197
1200
|
t.Ce = null;
|
|
1198
|
-
if (t.
|
|
1201
|
+
if (t.G || i === g) disposeChildren(t);
|
|
1199
1202
|
else {
|
|
1200
1203
|
markDisposal(t);
|
|
1201
|
-
t.
|
|
1204
|
+
t.Ae = t.Ne;
|
|
1202
1205
|
t.We = t.ke;
|
|
1203
|
-
t.
|
|
1206
|
+
t.Ne = null;
|
|
1204
1207
|
t.ke = null;
|
|
1205
|
-
t.
|
|
1208
|
+
t.je = 0;
|
|
1206
1209
|
}
|
|
1207
1210
|
}
|
|
1208
1211
|
const s = !!(t.m & f);
|
|
1209
1212
|
const u = t.ee !== undefined && t.ee !== S;
|
|
1210
|
-
const c = !!(t.
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
+
const c = !!(t.ye & a);
|
|
1214
|
+
const p = !!(t.ye & h);
|
|
1215
|
+
const y = M;
|
|
1216
|
+
M = t;
|
|
1213
1217
|
t.Pe = null;
|
|
1214
1218
|
t.m = r;
|
|
1215
1219
|
t.de = E;
|
|
1216
|
-
let
|
|
1217
|
-
let
|
|
1218
|
-
let
|
|
1219
|
-
let
|
|
1220
|
+
let w = t.Z === S ? t.$ : t.Z;
|
|
1221
|
+
let m = t.o;
|
|
1222
|
+
let b = H;
|
|
1223
|
+
let _ = B;
|
|
1220
1224
|
H = true;
|
|
1221
1225
|
if (s) {
|
|
1222
1226
|
const e = resolveLane(t);
|
|
1223
1227
|
if (e) B = e;
|
|
1224
1228
|
}
|
|
1225
1229
|
try {
|
|
1226
|
-
|
|
1230
|
+
w = handleAsync(t, t.I(w));
|
|
1227
1231
|
clearStatus(t, n);
|
|
1228
1232
|
const e = resolveLane(t);
|
|
1229
1233
|
if (e) {
|
|
@@ -1248,48 +1252,48 @@ function recompute(t, n = false) {
|
|
|
1248
1252
|
e instanceof NotReadyError ? t.Y : undefined
|
|
1249
1253
|
);
|
|
1250
1254
|
} finally {
|
|
1251
|
-
H =
|
|
1255
|
+
H = b;
|
|
1252
1256
|
t.m = e | (n ? t.m & l : 0);
|
|
1253
|
-
|
|
1257
|
+
M = y;
|
|
1254
1258
|
}
|
|
1255
1259
|
if (!t.ae) {
|
|
1256
1260
|
const e = t.Pe;
|
|
1257
|
-
let r = e !== null ? e.
|
|
1261
|
+
let r = e !== null ? e.N : t.A;
|
|
1258
1262
|
if (r !== null) {
|
|
1259
1263
|
do {
|
|
1260
1264
|
r = unlinkSubs(r);
|
|
1261
1265
|
} while (r !== null);
|
|
1262
|
-
if (e !== null) e.
|
|
1263
|
-
else t.
|
|
1266
|
+
if (e !== null) e.N = null;
|
|
1267
|
+
else t.A = null;
|
|
1264
1268
|
}
|
|
1265
1269
|
const f = u ? t.ee : t.Z === S ? t.$ : t.Z;
|
|
1266
|
-
const l = !t.Te || !t.Te(f,
|
|
1270
|
+
const l = (!i && p) || !t.Te || !t.Te(f, w);
|
|
1267
1271
|
if (l) {
|
|
1268
1272
|
const e = u ? t.ee : undefined;
|
|
1269
|
-
if (n || (i && C !== t.
|
|
1270
|
-
t.$ =
|
|
1273
|
+
if (n || (i && C !== t.G) || s) {
|
|
1274
|
+
t.$ = w;
|
|
1271
1275
|
if (u && s) {
|
|
1272
|
-
t.ee =
|
|
1273
|
-
t.Z =
|
|
1276
|
+
t.ee = w;
|
|
1277
|
+
t.Z = w;
|
|
1274
1278
|
}
|
|
1275
|
-
} else t.Z =
|
|
1276
|
-
if (u && !s && c && !t.
|
|
1279
|
+
} else t.Z = w;
|
|
1280
|
+
if (u && !s && c && !t.be) t.ee = w;
|
|
1277
1281
|
if (!u || s || t.ee !== e) insertSubs(t, s || u);
|
|
1278
1282
|
} else if (u) {
|
|
1279
|
-
t.Z =
|
|
1280
|
-
} else if (t.o !=
|
|
1283
|
+
t.Z = w;
|
|
1284
|
+
} else if (t.o != m) {
|
|
1281
1285
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1282
1286
|
insertIntoHeapHeight(e.k, e.k.m & o ? k : P);
|
|
1283
1287
|
}
|
|
1284
1288
|
}
|
|
1285
1289
|
}
|
|
1286
|
-
B =
|
|
1287
|
-
(!n || t.
|
|
1288
|
-
t.
|
|
1290
|
+
B = _;
|
|
1291
|
+
(!n || t.ye & a) && !t.G && !(C && u) && N.se.push(t);
|
|
1292
|
+
t.G && i && C !== t.G && runInTransition(t.G, () => recompute(t));
|
|
1289
1293
|
}
|
|
1290
1294
|
function updateIfNecessary(e) {
|
|
1291
1295
|
if (e.m & t) {
|
|
1292
|
-
for (let t = e.
|
|
1296
|
+
for (let t = e.A; t; t = t.N) {
|
|
1293
1297
|
const r = t.R;
|
|
1294
1298
|
const i = r.L || r;
|
|
1295
1299
|
if (i.I) {
|
|
@@ -1308,52 +1312,52 @@ function updateIfNecessary(e) {
|
|
|
1308
1312
|
function computed(t, n, r) {
|
|
1309
1313
|
const i = r?.transparent ?? false;
|
|
1310
1314
|
const s = {
|
|
1311
|
-
id: r?.id ?? (i ?
|
|
1315
|
+
id: r?.id ?? (i ? M?.id : M?.id != null ? getNextChildId(M) : undefined),
|
|
1312
1316
|
Re: i || undefined,
|
|
1313
1317
|
Te: r?.equals != null ? r.equals : isEqual,
|
|
1314
|
-
ce: !!r?.
|
|
1318
|
+
ce: !!r?.ownedWrite,
|
|
1315
1319
|
xe: r?.unobserved,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
Le:
|
|
1319
|
-
|
|
1320
|
+
Ne: null,
|
|
1321
|
+
V: M?.V ?? N,
|
|
1322
|
+
Le: M?.Le ?? _,
|
|
1323
|
+
je: 0,
|
|
1320
1324
|
I: t,
|
|
1321
1325
|
$: n,
|
|
1322
1326
|
o: 0,
|
|
1323
1327
|
C: null,
|
|
1324
1328
|
p: undefined,
|
|
1325
1329
|
h: null,
|
|
1326
|
-
|
|
1330
|
+
A: null,
|
|
1327
1331
|
Pe: null,
|
|
1328
1332
|
O: null,
|
|
1329
1333
|
Oe: null,
|
|
1330
|
-
i:
|
|
1334
|
+
i: M,
|
|
1331
1335
|
Ee: null,
|
|
1332
1336
|
ke: null,
|
|
1333
1337
|
m: r?.lazy ? c : e,
|
|
1334
|
-
|
|
1338
|
+
ye: h,
|
|
1335
1339
|
de: E,
|
|
1336
1340
|
Z: S,
|
|
1337
|
-
|
|
1341
|
+
Ae: null,
|
|
1338
1342
|
We: null,
|
|
1339
1343
|
Ce: null,
|
|
1340
|
-
|
|
1344
|
+
G: null
|
|
1341
1345
|
};
|
|
1342
1346
|
s.h = s;
|
|
1343
|
-
const o =
|
|
1344
|
-
if (
|
|
1345
|
-
const e =
|
|
1347
|
+
const o = M?.t ? M.u : M;
|
|
1348
|
+
if (M) {
|
|
1349
|
+
const e = M.ke;
|
|
1346
1350
|
if (e === null) {
|
|
1347
|
-
|
|
1351
|
+
M.ke = s;
|
|
1348
1352
|
} else {
|
|
1349
1353
|
s.Ee = e;
|
|
1350
|
-
|
|
1354
|
+
M.ke = s;
|
|
1351
1355
|
}
|
|
1352
1356
|
}
|
|
1353
1357
|
if (o) s.o = o.o + 1;
|
|
1354
|
-
if (
|
|
1358
|
+
if (K && ownerInSnapshotScope(M)) s.pe = true;
|
|
1355
1359
|
if (T) {
|
|
1356
|
-
const e = signal(undefined, { equals: false,
|
|
1360
|
+
const e = signal(undefined, { equals: false, ownedWrite: true });
|
|
1357
1361
|
const t = T.factory(s.I, () => {
|
|
1358
1362
|
setSignal(e, undefined);
|
|
1359
1363
|
});
|
|
@@ -1364,10 +1368,10 @@ function computed(t, n, r) {
|
|
|
1364
1368
|
};
|
|
1365
1369
|
}
|
|
1366
1370
|
!r?.lazy && recompute(s, true);
|
|
1367
|
-
if (
|
|
1368
|
-
if (!(s.
|
|
1371
|
+
if (K && !r?.lazy) {
|
|
1372
|
+
if (!(s.ye & a)) {
|
|
1369
1373
|
s.he = s.$ === undefined ? w : s.$;
|
|
1370
|
-
|
|
1374
|
+
G.add(s);
|
|
1371
1375
|
}
|
|
1372
1376
|
}
|
|
1373
1377
|
return s;
|
|
@@ -1375,7 +1379,7 @@ function computed(t, n, r) {
|
|
|
1375
1379
|
function signal(e, t, n = null) {
|
|
1376
1380
|
const r = {
|
|
1377
1381
|
Te: t?.equals != null ? t.equals : isEqual,
|
|
1378
|
-
ce: !!t?.
|
|
1382
|
+
ce: !!t?.ownedWrite,
|
|
1379
1383
|
De: !!t?.De,
|
|
1380
1384
|
xe: t?.unobserved,
|
|
1381
1385
|
$: e,
|
|
@@ -1387,9 +1391,9 @@ function signal(e, t, n = null) {
|
|
|
1387
1391
|
Z: S
|
|
1388
1392
|
};
|
|
1389
1393
|
n && (n.C = r);
|
|
1390
|
-
if (
|
|
1394
|
+
if (K && !r.De && !((n?.ye ?? 0) & a)) {
|
|
1391
1395
|
r.he = e === undefined ? w : e;
|
|
1392
|
-
|
|
1396
|
+
G.add(r);
|
|
1393
1397
|
}
|
|
1394
1398
|
return r;
|
|
1395
1399
|
}
|
|
@@ -1418,21 +1422,21 @@ function untrack(e, t) {
|
|
|
1418
1422
|
}
|
|
1419
1423
|
}
|
|
1420
1424
|
function read(e) {
|
|
1421
|
-
if (
|
|
1425
|
+
if (V) {
|
|
1422
1426
|
const t = getLatestValueComputed(e);
|
|
1423
|
-
const n =
|
|
1424
|
-
|
|
1427
|
+
const n = V;
|
|
1428
|
+
V = false;
|
|
1425
1429
|
const r = e.ee !== undefined && e.ee !== S ? e.ee : e.$;
|
|
1426
1430
|
let i;
|
|
1427
1431
|
try {
|
|
1428
1432
|
i = read(t);
|
|
1429
1433
|
} catch (e) {
|
|
1430
|
-
if (!
|
|
1434
|
+
if (!M && e instanceof NotReadyError) return r;
|
|
1431
1435
|
throw e;
|
|
1432
1436
|
} finally {
|
|
1433
|
-
|
|
1437
|
+
V = n;
|
|
1434
1438
|
}
|
|
1435
|
-
if (t.
|
|
1439
|
+
if (t.ye & a) return r;
|
|
1436
1440
|
if (Q && B && t.Y) {
|
|
1437
1441
|
const e = findLane(t.Y);
|
|
1438
1442
|
const n = findLane(B);
|
|
@@ -1447,10 +1451,10 @@ function read(e) {
|
|
|
1447
1451
|
const n = D;
|
|
1448
1452
|
D = false;
|
|
1449
1453
|
if (t && e.ee !== undefined) {
|
|
1450
|
-
if (e.ee !== S && (t.Ce || !!(t.
|
|
1454
|
+
if (e.ee !== S && (t.Ce || !!(t.ye & a))) {
|
|
1451
1455
|
F = true;
|
|
1452
1456
|
}
|
|
1453
|
-
let n =
|
|
1457
|
+
let n = M;
|
|
1454
1458
|
if (n?.t) n = n.u;
|
|
1455
1459
|
if (n && H) link(e, n);
|
|
1456
1460
|
read(getPendingSignal(e));
|
|
@@ -1462,57 +1466,62 @@ function read(e) {
|
|
|
1462
1466
|
D = n;
|
|
1463
1467
|
return e.$;
|
|
1464
1468
|
}
|
|
1465
|
-
let t =
|
|
1469
|
+
let t = M;
|
|
1466
1470
|
if (t?.t) t = t.u;
|
|
1467
|
-
|
|
1468
|
-
if (
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1471
|
+
const n = e;
|
|
1472
|
+
if (typeof n.I === "function") {
|
|
1473
|
+
const t = e;
|
|
1474
|
+
if (q && !(t.m & u)) recompute(t);
|
|
1475
|
+
if (t.m & c) {
|
|
1476
|
+
t.m &= ~c;
|
|
1477
|
+
recompute(t, true);
|
|
1478
|
+
} else if (t.m & u) {
|
|
1479
|
+
recompute(t, true);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
const r = e.L || e;
|
|
1473
1483
|
if (t && H) {
|
|
1474
|
-
if (e.I && e.m & u) recompute(e);
|
|
1475
1484
|
link(e, t);
|
|
1476
|
-
if (
|
|
1477
|
-
const
|
|
1478
|
-
if (
|
|
1485
|
+
if (r.I) {
|
|
1486
|
+
const n = e.m & o;
|
|
1487
|
+
if (r.o >= (n ? k.j : P.j)) {
|
|
1479
1488
|
markNode(t);
|
|
1480
|
-
markHeap(
|
|
1481
|
-
updateIfNecessary(
|
|
1489
|
+
markHeap(n ? k : P);
|
|
1490
|
+
updateIfNecessary(r);
|
|
1482
1491
|
}
|
|
1483
|
-
const i =
|
|
1492
|
+
const i = r.o;
|
|
1484
1493
|
if (i >= t.o && e.i !== t) {
|
|
1485
1494
|
t.o = i + 1;
|
|
1486
1495
|
}
|
|
1487
1496
|
}
|
|
1488
1497
|
}
|
|
1489
|
-
if (
|
|
1490
|
-
if (t && !(Q &&
|
|
1498
|
+
if (r.ye & a) {
|
|
1499
|
+
if (t && !(Q && r.G && C !== r.G)) {
|
|
1491
1500
|
if (B) {
|
|
1492
|
-
const
|
|
1501
|
+
const n = r.Y;
|
|
1493
1502
|
const i = findLane(B);
|
|
1494
|
-
if (
|
|
1503
|
+
if (n && findLane(n) === i && !hasActiveOverride(r)) {
|
|
1495
1504
|
if (!H && e !== t) link(e, t);
|
|
1496
|
-
throw
|
|
1505
|
+
throw r.ae;
|
|
1497
1506
|
}
|
|
1498
1507
|
} else {
|
|
1499
1508
|
if (!H && e !== t) link(e, t);
|
|
1500
|
-
throw
|
|
1509
|
+
throw r.ae;
|
|
1501
1510
|
}
|
|
1502
|
-
} else if (t &&
|
|
1511
|
+
} else if (t && r !== e && r.ye & h) {
|
|
1503
1512
|
if (!H && e !== t) link(e, t);
|
|
1504
|
-
throw
|
|
1505
|
-
} else if (!t &&
|
|
1506
|
-
throw
|
|
1513
|
+
throw r.ae;
|
|
1514
|
+
} else if (!t && r.ye & h) {
|
|
1515
|
+
throw r.ae;
|
|
1507
1516
|
}
|
|
1508
1517
|
}
|
|
1509
|
-
if (e.I && e.
|
|
1518
|
+
if (e.I && e.ye & d) {
|
|
1510
1519
|
if (e.de < E) {
|
|
1511
1520
|
recompute(e);
|
|
1512
1521
|
return read(e);
|
|
1513
1522
|
} else throw e.ae;
|
|
1514
1523
|
}
|
|
1515
|
-
if (
|
|
1524
|
+
if (K && t && t.pe) {
|
|
1516
1525
|
const n = e.he;
|
|
1517
1526
|
if (n !== undefined) {
|
|
1518
1527
|
const r = n === w ? undefined : n;
|
|
@@ -1525,20 +1534,25 @@ function read(e) {
|
|
|
1525
1534
|
if (t && Q && shouldReadStashedOptimisticValue(e)) return e.$;
|
|
1526
1535
|
return e.ee;
|
|
1527
1536
|
}
|
|
1528
|
-
|
|
1529
|
-
|
|
1537
|
+
const i =
|
|
1538
|
+
!t ||
|
|
1539
|
+
(B !== null && (e.ee !== undefined || e.Y || (r === e && Q) || !!(r.ye & a))) ||
|
|
1530
1540
|
e.Z === S ||
|
|
1531
|
-
(Q && e.
|
|
1532
|
-
|
|
1533
|
-
|
|
1541
|
+
(Q && e.G && C !== e.G)
|
|
1542
|
+
? e.$
|
|
1543
|
+
: e.Z;
|
|
1544
|
+
if (!t && r === e && typeof n.I === "function" && !n.ve && !(r.ye & a) && !n.i && !e.O) {
|
|
1545
|
+
unobserved(e);
|
|
1546
|
+
}
|
|
1547
|
+
return i;
|
|
1534
1548
|
}
|
|
1535
1549
|
function setSignal(e, t) {
|
|
1536
|
-
if (e.
|
|
1537
|
-
const n = e.ee !== undefined && !
|
|
1550
|
+
if (e.G && C !== e.G) N.initTransition(e.G);
|
|
1551
|
+
const n = e.ee !== undefined && !j;
|
|
1538
1552
|
const r = e.ee !== undefined && e.ee !== S;
|
|
1539
1553
|
const i = n ? (r ? e.ee : e.$) : e.Z === S ? e.$ : e.Z;
|
|
1540
1554
|
if (typeof t === "function") t = t(i);
|
|
1541
|
-
const s = !e.Te || !e.Te(i, t) || !!(e.
|
|
1555
|
+
const s = !e.Te || !e.Te(i, t) || !!(e.ye & h);
|
|
1542
1556
|
if (!s) {
|
|
1543
1557
|
if (n && r && e.I) {
|
|
1544
1558
|
insertSubs(e, true);
|
|
@@ -1548,17 +1562,17 @@ function setSignal(e, t) {
|
|
|
1548
1562
|
}
|
|
1549
1563
|
if (n) {
|
|
1550
1564
|
const n = e.ee === S;
|
|
1551
|
-
if (!n)
|
|
1565
|
+
if (!n) N.initTransition(resolveTransition(e));
|
|
1552
1566
|
if (n) {
|
|
1553
1567
|
e.Z = e.$;
|
|
1554
|
-
|
|
1568
|
+
N.U.push(e);
|
|
1555
1569
|
}
|
|
1556
|
-
e.
|
|
1570
|
+
e.be = true;
|
|
1557
1571
|
const r = getOrCreateLane(e);
|
|
1558
1572
|
e.Y = r;
|
|
1559
1573
|
e.ee = t;
|
|
1560
1574
|
} else {
|
|
1561
|
-
if (e.Z === S)
|
|
1575
|
+
if (e.Z === S) N.se.push(e);
|
|
1562
1576
|
e.Z = t;
|
|
1563
1577
|
}
|
|
1564
1578
|
updatePendingSignal(e);
|
|
@@ -1571,20 +1585,20 @@ function setSignal(e, t) {
|
|
|
1571
1585
|
return t;
|
|
1572
1586
|
}
|
|
1573
1587
|
function runWithOwner(e, t) {
|
|
1574
|
-
const n =
|
|
1588
|
+
const n = M;
|
|
1575
1589
|
const r = H;
|
|
1576
|
-
|
|
1590
|
+
M = e;
|
|
1577
1591
|
H = false;
|
|
1578
1592
|
try {
|
|
1579
1593
|
return t();
|
|
1580
1594
|
} finally {
|
|
1581
|
-
|
|
1595
|
+
M = n;
|
|
1582
1596
|
H = r;
|
|
1583
1597
|
}
|
|
1584
1598
|
}
|
|
1585
1599
|
function getPendingSignal(e) {
|
|
1586
1600
|
if (!e.Fe) {
|
|
1587
|
-
e.Fe = optimisticSignal(false, {
|
|
1601
|
+
e.Fe = optimisticSignal(false, { ownedWrite: true });
|
|
1588
1602
|
if (e.we) {
|
|
1589
1603
|
e.Fe.we = e;
|
|
1590
1604
|
}
|
|
@@ -1596,10 +1610,10 @@ function computePendingState(e) {
|
|
|
1596
1610
|
const t = e;
|
|
1597
1611
|
const n = e.L;
|
|
1598
1612
|
if (n && e.Z !== S) {
|
|
1599
|
-
return !n.Ce && !(n.
|
|
1613
|
+
return !n.Ce && !(n.ye & a);
|
|
1600
1614
|
}
|
|
1601
1615
|
if (e.ee !== undefined && e.ee !== S) {
|
|
1602
|
-
if (t.
|
|
1616
|
+
if (t.ye & a && !(t.ye & h)) return true;
|
|
1603
1617
|
if (e.we) {
|
|
1604
1618
|
const t = e.Y ? findLane(e.Y) : null;
|
|
1605
1619
|
return !!(t && t.H.size > 0);
|
|
@@ -1609,8 +1623,8 @@ function computePendingState(e) {
|
|
|
1609
1623
|
if (e.ee !== undefined && e.ee === S && !e.we) {
|
|
1610
1624
|
return false;
|
|
1611
1625
|
}
|
|
1612
|
-
if (e.Z !== S && !(t.
|
|
1613
|
-
return !!(t.
|
|
1626
|
+
if (e.Z !== S && !(t.ye & h)) return true;
|
|
1627
|
+
return !!(t.ye & a && !(t.ye & h));
|
|
1614
1628
|
}
|
|
1615
1629
|
function updatePendingSignal(e) {
|
|
1616
1630
|
if (e.Fe) {
|
|
@@ -1632,17 +1646,17 @@ function updatePendingSignal(e) {
|
|
|
1632
1646
|
}
|
|
1633
1647
|
function getLatestValueComputed(e) {
|
|
1634
1648
|
if (!e.He) {
|
|
1635
|
-
const t =
|
|
1636
|
-
|
|
1649
|
+
const t = V;
|
|
1650
|
+
V = false;
|
|
1637
1651
|
const n = D;
|
|
1638
1652
|
D = false;
|
|
1639
|
-
const r =
|
|
1640
|
-
|
|
1653
|
+
const r = M;
|
|
1654
|
+
M = null;
|
|
1641
1655
|
e.He = optimisticComputed(() => read(e));
|
|
1642
1656
|
e.He.we = e;
|
|
1643
|
-
|
|
1657
|
+
M = r;
|
|
1644
1658
|
D = n;
|
|
1645
|
-
|
|
1659
|
+
V = t;
|
|
1646
1660
|
}
|
|
1647
1661
|
return e.He;
|
|
1648
1662
|
}
|
|
@@ -1656,12 +1670,12 @@ function staleValues(e, t = true) {
|
|
|
1656
1670
|
}
|
|
1657
1671
|
}
|
|
1658
1672
|
function latest(e) {
|
|
1659
|
-
const t =
|
|
1660
|
-
|
|
1673
|
+
const t = V;
|
|
1674
|
+
V = true;
|
|
1661
1675
|
try {
|
|
1662
1676
|
return e();
|
|
1663
1677
|
} finally {
|
|
1664
|
-
|
|
1678
|
+
V = t;
|
|
1665
1679
|
}
|
|
1666
1680
|
}
|
|
1667
1681
|
function isPending(e) {
|
|
@@ -1729,58 +1743,58 @@ function effect(e, t, n, r, i) {
|
|
|
1729
1743
|
...i,
|
|
1730
1744
|
equals: () => {
|
|
1731
1745
|
o.F = !o.ae;
|
|
1732
|
-
if (s) o.
|
|
1746
|
+
if (s) o.V.enqueue(o.D, runEffect.bind(o));
|
|
1733
1747
|
return false;
|
|
1734
1748
|
},
|
|
1735
1749
|
lazy: true
|
|
1736
1750
|
});
|
|
1737
|
-
o.
|
|
1738
|
-
o.
|
|
1751
|
+
o.Ve = r;
|
|
1752
|
+
o.Me = t;
|
|
1739
1753
|
o.Be = n;
|
|
1740
|
-
o.
|
|
1741
|
-
o.D = i?.render ? p :
|
|
1754
|
+
o.Ke = undefined;
|
|
1755
|
+
o.D = i?.render ? p : y;
|
|
1742
1756
|
o.Qe = (e, t) => {
|
|
1743
|
-
const n = e !== undefined ? e : o.
|
|
1757
|
+
const n = e !== undefined ? e : o.ye;
|
|
1744
1758
|
const r = t !== undefined ? t : o.ae;
|
|
1745
1759
|
if (n & d) {
|
|
1746
1760
|
let e = r;
|
|
1747
|
-
o.
|
|
1748
|
-
if (o.D ===
|
|
1761
|
+
o.V.notify(o, a, 0);
|
|
1762
|
+
if (o.D === y) {
|
|
1749
1763
|
try {
|
|
1750
1764
|
return o.Be
|
|
1751
1765
|
? o.Be(e, () => {
|
|
1752
|
-
o.
|
|
1753
|
-
o.
|
|
1766
|
+
o.Ke?.();
|
|
1767
|
+
o.Ke = undefined;
|
|
1754
1768
|
})
|
|
1755
1769
|
: console.error(e);
|
|
1756
1770
|
} catch (t) {
|
|
1757
1771
|
e = t;
|
|
1758
1772
|
}
|
|
1759
1773
|
}
|
|
1760
|
-
if (!o.
|
|
1774
|
+
if (!o.V.notify(o, d, d)) throw e;
|
|
1761
1775
|
} else if (o.D === p) {
|
|
1762
|
-
o.
|
|
1776
|
+
o.V.notify(o, a | d, n, r);
|
|
1763
1777
|
}
|
|
1764
1778
|
};
|
|
1765
1779
|
recompute(o, true);
|
|
1766
|
-
!i?.defer && (o.D ===
|
|
1780
|
+
!i?.defer && (o.D === y ? o.V.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
|
|
1767
1781
|
s = true;
|
|
1768
|
-
cleanup(() => o.
|
|
1782
|
+
cleanup(() => o.Ke?.());
|
|
1769
1783
|
}
|
|
1770
1784
|
function runEffect() {
|
|
1771
1785
|
if (!this.F || this.m & u) return;
|
|
1772
|
-
this.
|
|
1773
|
-
this.
|
|
1786
|
+
this.Ke?.();
|
|
1787
|
+
this.Ke = undefined;
|
|
1774
1788
|
try {
|
|
1775
|
-
const e = this.
|
|
1789
|
+
const e = this.Me(this.$, this.Ve);
|
|
1776
1790
|
if (false && e !== undefined && typeof e !== "function");
|
|
1777
|
-
this.
|
|
1791
|
+
this.Ke = e;
|
|
1778
1792
|
} catch (e) {
|
|
1779
1793
|
this.ae = new StatusError(this, e);
|
|
1780
|
-
this.
|
|
1781
|
-
if (!this.
|
|
1794
|
+
this.ye |= d;
|
|
1795
|
+
if (!this.V.notify(this, d, d)) throw e;
|
|
1782
1796
|
} finally {
|
|
1783
|
-
this.
|
|
1797
|
+
this.Ve = this.$;
|
|
1784
1798
|
this.F = false;
|
|
1785
1799
|
}
|
|
1786
1800
|
}
|
|
@@ -1795,32 +1809,32 @@ function trackedEffect(e, t) {
|
|
|
1795
1809
|
};
|
|
1796
1810
|
const n = computed(
|
|
1797
1811
|
() => {
|
|
1798
|
-
n.
|
|
1799
|
-
n.
|
|
1812
|
+
n.Ke?.();
|
|
1813
|
+
n.Ke = undefined;
|
|
1800
1814
|
const t = staleValues(e);
|
|
1801
|
-
n.
|
|
1815
|
+
n.Ke = t;
|
|
1802
1816
|
},
|
|
1803
1817
|
undefined,
|
|
1804
1818
|
{ ...t, lazy: true }
|
|
1805
1819
|
);
|
|
1806
|
-
n.
|
|
1807
|
-
n.
|
|
1820
|
+
n.Ke = undefined;
|
|
1821
|
+
n.Ge = true;
|
|
1808
1822
|
n.F = true;
|
|
1809
|
-
n.D =
|
|
1823
|
+
n.D = g;
|
|
1810
1824
|
n.Qe = (e, t) => {
|
|
1811
|
-
const r = e !== undefined ? e : n.
|
|
1825
|
+
const r = e !== undefined ? e : n.ye;
|
|
1812
1826
|
if (r & d) {
|
|
1813
|
-
n.
|
|
1827
|
+
n.V.notify(n, a, 0);
|
|
1814
1828
|
const e = t !== undefined ? t : n.ae;
|
|
1815
|
-
if (!n.
|
|
1829
|
+
if (!n.V.notify(n, d, d)) throw e;
|
|
1816
1830
|
}
|
|
1817
1831
|
};
|
|
1818
|
-
n.
|
|
1819
|
-
n.
|
|
1820
|
-
cleanup(() => n.
|
|
1832
|
+
n.M = run;
|
|
1833
|
+
n.V.enqueue(y, run);
|
|
1834
|
+
cleanup(() => n.Ke?.());
|
|
1821
1835
|
}
|
|
1822
1836
|
function restoreTransition(e, t) {
|
|
1823
|
-
|
|
1837
|
+
N.initTransition(e);
|
|
1824
1838
|
const n = t();
|
|
1825
1839
|
flush();
|
|
1826
1840
|
return n;
|
|
@@ -1829,13 +1843,13 @@ function action(e) {
|
|
|
1829
1843
|
return (...t) =>
|
|
1830
1844
|
new Promise((n, r) => {
|
|
1831
1845
|
const i = e(...t);
|
|
1832
|
-
|
|
1846
|
+
N.initTransition();
|
|
1833
1847
|
let s = C;
|
|
1834
|
-
s.
|
|
1848
|
+
s.K.push(i);
|
|
1835
1849
|
const done = (e, t) => {
|
|
1836
1850
|
s = currentTransition(s);
|
|
1837
|
-
const o = s.
|
|
1838
|
-
if (o >= 0) s.
|
|
1851
|
+
const o = s.K.indexOf(i);
|
|
1852
|
+
if (o >= 0) s.K.splice(o, 1);
|
|
1839
1853
|
setActiveTransition(s);
|
|
1840
1854
|
schedule();
|
|
1841
1855
|
t ? r(t) : n(e);
|
|
@@ -1871,23 +1885,24 @@ function accessor(e) {
|
|
|
1871
1885
|
t.$r = true;
|
|
1872
1886
|
return t;
|
|
1873
1887
|
}
|
|
1874
|
-
function createSignal(e, t
|
|
1888
|
+
function createSignal(e, t) {
|
|
1875
1889
|
if (typeof e === "function") {
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1890
|
+
const n = computed(e, undefined, t);
|
|
1891
|
+
n.ve = true;
|
|
1892
|
+
return [accessor(n), setSignal.bind(null, n)];
|
|
1878
1893
|
}
|
|
1879
|
-
const
|
|
1880
|
-
return [accessor(
|
|
1894
|
+
const n = signal(e, t);
|
|
1895
|
+
return [accessor(n), setSignal.bind(null, n)];
|
|
1881
1896
|
}
|
|
1882
|
-
function createMemo(e, t
|
|
1883
|
-
let
|
|
1884
|
-
return accessor(
|
|
1897
|
+
function createMemo(e, t) {
|
|
1898
|
+
let n = computed(e, undefined, t);
|
|
1899
|
+
return accessor(n);
|
|
1885
1900
|
}
|
|
1886
|
-
function createEffect(e, t, n
|
|
1887
|
-
effect(e, t.effect || t, t.error,
|
|
1901
|
+
function createEffect(e, t, n) {
|
|
1902
|
+
effect(e, t.effect || t, t.error, undefined, n);
|
|
1888
1903
|
}
|
|
1889
|
-
function createRenderEffect(e, t, n
|
|
1890
|
-
effect(e, t, undefined,
|
|
1904
|
+
function createRenderEffect(e, t, n) {
|
|
1905
|
+
effect(e, t, undefined, undefined, { render: true, ...n });
|
|
1891
1906
|
}
|
|
1892
1907
|
function createTrackedEffect(e, t) {
|
|
1893
1908
|
trackedEffect(e, t);
|
|
@@ -1929,19 +1944,20 @@ function resolve(e) {
|
|
|
1929
1944
|
});
|
|
1930
1945
|
});
|
|
1931
1946
|
}
|
|
1932
|
-
function createOptimistic(e, t
|
|
1947
|
+
function createOptimistic(e, t) {
|
|
1933
1948
|
if (typeof e === "function") {
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1949
|
+
const n = optimisticComputed(e, undefined, t);
|
|
1950
|
+
n.ve = true;
|
|
1951
|
+
return [accessor(n), setSignal.bind(null, n)];
|
|
1936
1952
|
}
|
|
1937
|
-
const
|
|
1938
|
-
return [accessor(
|
|
1953
|
+
const n = optimisticSignal(e, t);
|
|
1954
|
+
return [accessor(n), setSignal.bind(null, n)];
|
|
1939
1955
|
}
|
|
1940
1956
|
function onSettled(e) {
|
|
1941
1957
|
const t = getOwner();
|
|
1942
|
-
t && !t.
|
|
1958
|
+
t && !t.Ge
|
|
1943
1959
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
1944
|
-
:
|
|
1960
|
+
: N.enqueue(y, () => {
|
|
1945
1961
|
const t = e();
|
|
1946
1962
|
t?.();
|
|
1947
1963
|
});
|
|
@@ -1973,7 +1989,7 @@ function applyState(e, t, n) {
|
|
|
1973
1989
|
let t = false;
|
|
1974
1990
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
1975
1991
|
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1976
|
-
let l, c, a, d, h, p,
|
|
1992
|
+
let l, c, a, d, h, p, y, g;
|
|
1977
1993
|
for (
|
|
1978
1994
|
a = 0, d = Math.min(f, e.length);
|
|
1979
1995
|
a < d &&
|
|
@@ -2008,22 +2024,22 @@ function applyState(e, t, n) {
|
|
|
2008
2024
|
f !== e.length && r[ee].length && setSignal(r[ee].length, e.length);
|
|
2009
2025
|
return;
|
|
2010
2026
|
}
|
|
2011
|
-
|
|
2027
|
+
y = new Array(h + 1);
|
|
2012
2028
|
for (c = h; c >= a; c--) {
|
|
2013
2029
|
p = e[c];
|
|
2014
|
-
|
|
2015
|
-
l = w.get(
|
|
2016
|
-
|
|
2017
|
-
w.set(
|
|
2030
|
+
g = p ? n(p) : p;
|
|
2031
|
+
l = w.get(g);
|
|
2032
|
+
y[c] = l === undefined ? -1 : l;
|
|
2033
|
+
w.set(g, c);
|
|
2018
2034
|
}
|
|
2019
2035
|
for (l = a; l <= d; l++) {
|
|
2020
2036
|
p = getOverrideValue(i, s, u, l, o);
|
|
2021
|
-
|
|
2022
|
-
c = w.get(
|
|
2037
|
+
g = p ? n(p) : p;
|
|
2038
|
+
c = w.get(g);
|
|
2023
2039
|
if (c !== undefined && c !== -1) {
|
|
2024
2040
|
S[c] = p;
|
|
2025
|
-
c =
|
|
2026
|
-
w.set(
|
|
2041
|
+
c = y[c];
|
|
2042
|
+
w.set(g, c);
|
|
2027
2043
|
}
|
|
2028
2044
|
}
|
|
2029
2045
|
for (c = a; c < e.length; c++) {
|
|
@@ -2080,7 +2096,7 @@ function reconcile(e, t) {
|
|
|
2080
2096
|
applyState(e, n, r);
|
|
2081
2097
|
};
|
|
2082
2098
|
}
|
|
2083
|
-
function createProjectionInternal(e, t
|
|
2099
|
+
function createProjectionInternal(e, t, n) {
|
|
2084
2100
|
let r;
|
|
2085
2101
|
const i = new WeakMap();
|
|
2086
2102
|
const wrapper = e => {
|
|
@@ -2121,7 +2137,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2121
2137
|
r.ve = true;
|
|
2122
2138
|
return { store: s, node: r };
|
|
2123
2139
|
}
|
|
2124
|
-
function createProjection(e, t
|
|
2140
|
+
function createProjection(e, t, n) {
|
|
2125
2141
|
return createProjectionInternal(e, t, n).store;
|
|
2126
2142
|
}
|
|
2127
2143
|
function createWriteTraps(e) {
|
|
@@ -2244,7 +2260,7 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2244
2260
|
if (o && t in o) {
|
|
2245
2261
|
const e = o[t];
|
|
2246
2262
|
u.he = e === undefined ? w : e;
|
|
2247
|
-
|
|
2263
|
+
G?.add(u);
|
|
2248
2264
|
}
|
|
2249
2265
|
return (e[t] = u);
|
|
2250
2266
|
}
|
|
@@ -2263,12 +2279,50 @@ function getKeys(e, t, n = true) {
|
|
|
2263
2279
|
return Array.from(i);
|
|
2264
2280
|
}
|
|
2265
2281
|
function getPropertyDescriptor(e, t, n) {
|
|
2266
|
-
let r = e;
|
|
2267
2282
|
if (t && n in t) {
|
|
2268
|
-
if (
|
|
2269
|
-
|
|
2283
|
+
if (t[n] === X) return void 0;
|
|
2284
|
+
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2285
|
+
if (r?.get || r?.set || !(n in e)) return r;
|
|
2286
|
+
}
|
|
2287
|
+
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2288
|
+
}
|
|
2289
|
+
function prepareStoreWrite(e, t, n) {
|
|
2290
|
+
if (e[se]) {
|
|
2291
|
+
const t = e[ie];
|
|
2292
|
+
if (t?.G) {
|
|
2293
|
+
N.initTransition(t.G);
|
|
2294
|
+
}
|
|
2270
2295
|
}
|
|
2271
|
-
|
|
2296
|
+
const r = e[Y];
|
|
2297
|
+
const i = r[n];
|
|
2298
|
+
if (K && typeof n !== "symbol" && !((e[ie]?.ye ?? 0) & a)) {
|
|
2299
|
+
if (!e[m]) {
|
|
2300
|
+
e[m] = Object.create(null);
|
|
2301
|
+
G?.add(e);
|
|
2302
|
+
}
|
|
2303
|
+
if (!(n in e[m])) {
|
|
2304
|
+
e[m][n] = i;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
const s = e[se] && !j;
|
|
2308
|
+
const o = s ? $ : Z;
|
|
2309
|
+
if (s) trackOptimisticStore(t);
|
|
2310
|
+
return { base: i, overrideKey: o, state: r };
|
|
2311
|
+
}
|
|
2312
|
+
function notifyStoreProperty(e, t, n, r) {
|
|
2313
|
+
if (e[te]?.[t]) setSignal(e[te][t], n !== "delete");
|
|
2314
|
+
const i = getNodes(e, ee);
|
|
2315
|
+
if (n === "set") {
|
|
2316
|
+
i[t] && setSignal(i[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2317
|
+
} else if (n === "invalidate") {
|
|
2318
|
+
if (i[t]) {
|
|
2319
|
+
setSignal(i[t], {});
|
|
2320
|
+
delete i[t];
|
|
2321
|
+
}
|
|
2322
|
+
} else {
|
|
2323
|
+
i[t] && setSignal(i[t], undefined);
|
|
2324
|
+
}
|
|
2325
|
+
i[z] && setSignal(i[z], undefined);
|
|
2272
2326
|
}
|
|
2273
2327
|
let fe = null;
|
|
2274
2328
|
const le = {
|
|
@@ -2324,55 +2378,46 @@ const le = {
|
|
|
2324
2378
|
set(e, t, n) {
|
|
2325
2379
|
const r = e[J];
|
|
2326
2380
|
if (writeOnly(r)) {
|
|
2327
|
-
if (e[se]) {
|
|
2328
|
-
const t = e[ie];
|
|
2329
|
-
if (t?.K) {
|
|
2330
|
-
j.initTransition(t.K);
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
2381
|
untrack(() => {
|
|
2334
|
-
const i = e
|
|
2335
|
-
const
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
if (!(t in e[m])) {
|
|
2342
|
-
e[m][t] = s;
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
const o = e[se] && !A;
|
|
2346
|
-
const u = o ? $ : Z;
|
|
2347
|
-
if (o) trackOptimisticStore(r);
|
|
2348
|
-
const f = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : s;
|
|
2349
|
-
const l = n?.[U]?.[Y] ?? n;
|
|
2350
|
-
const c = Array.isArray(i) && t !== "length";
|
|
2351
|
-
const d = c ? parseInt(t) + 1 : 0;
|
|
2352
|
-
const h =
|
|
2353
|
-
c &&
|
|
2382
|
+
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2383
|
+
const u = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : i;
|
|
2384
|
+
const f = n?.[U]?.[Y] ?? n;
|
|
2385
|
+
const l = Array.isArray(o) && t !== "length";
|
|
2386
|
+
const c = l ? parseInt(t) + 1 : 0;
|
|
2387
|
+
const a =
|
|
2388
|
+
l &&
|
|
2354
2389
|
(e[$] && "length" in e[$]
|
|
2355
2390
|
? e[$].length
|
|
2356
2391
|
: e[Z] && "length" in e[Z]
|
|
2357
2392
|
? e[Z].length
|
|
2358
|
-
:
|
|
2359
|
-
const
|
|
2360
|
-
if (
|
|
2361
|
-
if (
|
|
2393
|
+
: o.length);
|
|
2394
|
+
const d = l && c > a ? c : undefined;
|
|
2395
|
+
if (u === f && d === undefined) return true;
|
|
2396
|
+
if (f !== undefined && f === i && d === undefined) delete e[s]?.[t];
|
|
2362
2397
|
else {
|
|
2363
|
-
const n = e[
|
|
2364
|
-
n[t] =
|
|
2365
|
-
if (
|
|
2398
|
+
const n = e[s] || (e[s] = Object.create(null));
|
|
2399
|
+
n[t] = f;
|
|
2400
|
+
if (d !== undefined) n.length = d;
|
|
2366
2401
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
const e = t === "length" ? l : p;
|
|
2373
|
-
e !== undefined && y.length && setSignal(y.length, e);
|
|
2402
|
+
notifyStoreProperty(e, t, "set", f);
|
|
2403
|
+
if (Array.isArray(o)) {
|
|
2404
|
+
const n = getNodes(e, ee);
|
|
2405
|
+
const r = t === "length" ? f : d;
|
|
2406
|
+
r !== undefined && n.length && setSignal(n.length, r);
|
|
2374
2407
|
}
|
|
2375
|
-
|
|
2408
|
+
if (false);
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
return true;
|
|
2412
|
+
},
|
|
2413
|
+
defineProperty(e, t, n) {
|
|
2414
|
+
const r = e[J];
|
|
2415
|
+
if (writeOnly(r)) {
|
|
2416
|
+
untrack(() => {
|
|
2417
|
+
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
2418
|
+
const o = "value" in n ? { ...n, value: n.value?.[U]?.[Y] ?? n.value } : n;
|
|
2419
|
+
Object.defineProperty(e[s] || (e[s] = Object.create(null)), t, o);
|
|
2420
|
+
notifyStoreProperty(e, t, "invalidate");
|
|
2376
2421
|
if (false);
|
|
2377
2422
|
});
|
|
2378
2423
|
}
|
|
@@ -2383,7 +2428,7 @@ const le = {
|
|
|
2383
2428
|
const r = e[Z]?.[t] === X;
|
|
2384
2429
|
if (writeOnly(e[J]) && !n && !r) {
|
|
2385
2430
|
untrack(() => {
|
|
2386
|
-
const n = e[se] && !
|
|
2431
|
+
const n = e[se] && !j;
|
|
2387
2432
|
const r = n ? $ : Z;
|
|
2388
2433
|
if (n) trackOptimisticStore(e[J]);
|
|
2389
2434
|
const i = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : e[Y][t];
|
|
@@ -2392,10 +2437,7 @@ const le = {
|
|
|
2392
2437
|
} else if (e[r] && t in e[r]) {
|
|
2393
2438
|
delete e[r][t];
|
|
2394
2439
|
} else return true;
|
|
2395
|
-
|
|
2396
|
-
const s = getNodes(e, ee);
|
|
2397
|
-
s[t] && setSignal(s[t], undefined);
|
|
2398
|
-
s[z] && setSignal(s[z], undefined);
|
|
2440
|
+
notifyStoreProperty(e, t, "delete");
|
|
2399
2441
|
});
|
|
2400
2442
|
}
|
|
2401
2443
|
return true;
|
|
@@ -2417,9 +2459,11 @@ const le = {
|
|
|
2417
2459
|
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2418
2460
|
if (e[$] && t in e[$]) {
|
|
2419
2461
|
if (e[$][t] === X) return undefined;
|
|
2420
|
-
const n =
|
|
2421
|
-
if (n)
|
|
2422
|
-
|
|
2462
|
+
const n = Reflect.getOwnPropertyDescriptor(e[$], t);
|
|
2463
|
+
if (n?.get || n?.set || !(t in e[Y])) return n;
|
|
2464
|
+
const r = getPropertyDescriptor(e[Y], e[Z], t);
|
|
2465
|
+
if (r) {
|
|
2466
|
+
return { ...r, value: e[$][t] };
|
|
2423
2467
|
}
|
|
2424
2468
|
return { value: e[$][t], writable: true, enumerable: true, configurable: true };
|
|
2425
2469
|
}
|
|
@@ -2460,7 +2504,7 @@ function createStore(e, t, n) {
|
|
|
2460
2504
|
function createOptimisticStore(e, t, n) {
|
|
2461
2505
|
GlobalQueue.fe ||= clearOptimisticStore;
|
|
2462
2506
|
const r = typeof e === "function";
|
|
2463
|
-
const i =
|
|
2507
|
+
const i = r ? t : e;
|
|
2464
2508
|
const s = r ? e : undefined;
|
|
2465
2509
|
const { store: o } = createOptimisticProjectionInternal(s, i, n);
|
|
2466
2510
|
return [o, e => storeSetter(o, e)];
|
|
@@ -2491,7 +2535,7 @@ function clearOptimisticStore(e) {
|
|
|
2491
2535
|
}
|
|
2492
2536
|
delete t[$];
|
|
2493
2537
|
}
|
|
2494
|
-
function createOptimisticProjectionInternal(e, t
|
|
2538
|
+
function createOptimisticProjectionInternal(e, t, n) {
|
|
2495
2539
|
let r;
|
|
2496
2540
|
const i = new WeakMap();
|
|
2497
2541
|
const wrapper = e => {
|
|
@@ -2594,7 +2638,12 @@ function updatePath(e, t, n = 0) {
|
|
|
2594
2638
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2595
2639
|
const t = r !== undefined ? e[r] : e;
|
|
2596
2640
|
const n = Object.keys(s);
|
|
2597
|
-
for (let e = 0; e < n.length; e++)
|
|
2641
|
+
for (let e = 0; e < n.length; e++) {
|
|
2642
|
+
const r = n[e];
|
|
2643
|
+
const i = Object.getOwnPropertyDescriptor(s, r);
|
|
2644
|
+
if (i.get || i.set) Object.defineProperty(t, r, i);
|
|
2645
|
+
else t[r] = i.value;
|
|
2646
|
+
}
|
|
2598
2647
|
} else {
|
|
2599
2648
|
e[r] = s;
|
|
2600
2649
|
}
|
|
@@ -2703,7 +2752,7 @@ function merge(...e) {
|
|
|
2703
2752
|
if (s) n.push(...s);
|
|
2704
2753
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2705
2754
|
}
|
|
2706
|
-
if (
|
|
2755
|
+
if (b && t) {
|
|
2707
2756
|
return new Proxy(
|
|
2708
2757
|
{
|
|
2709
2758
|
get(e) {
|
|
@@ -2762,7 +2811,7 @@ function merge(...e) {
|
|
|
2762
2811
|
}
|
|
2763
2812
|
function omit(e, ...t) {
|
|
2764
2813
|
const n = new Set(t);
|
|
2765
|
-
if (
|
|
2814
|
+
if (b && J in e) {
|
|
2766
2815
|
return new Proxy(
|
|
2767
2816
|
{
|
|
2768
2817
|
get(t) {
|
|
@@ -2793,7 +2842,7 @@ function mapArray(e, t, n) {
|
|
|
2793
2842
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2794
2843
|
const i = t.length > 1;
|
|
2795
2844
|
const s = t;
|
|
2796
|
-
|
|
2845
|
+
const o = computed(
|
|
2797
2846
|
updateKeyedMap.bind({
|
|
2798
2847
|
ze: createOwner(),
|
|
2799
2848
|
Ue: 0,
|
|
@@ -2808,8 +2857,10 @@ function mapArray(e, t, n) {
|
|
|
2808
2857
|
rt: n?.fallback
|
|
2809
2858
|
})
|
|
2810
2859
|
);
|
|
2860
|
+
o.ve = true;
|
|
2861
|
+
return accessor(o);
|
|
2811
2862
|
}
|
|
2812
|
-
const pe = {
|
|
2863
|
+
const pe = { ownedWrite: true };
|
|
2813
2864
|
function updateKeyedMap() {
|
|
2814
2865
|
const e = this.Je() || [],
|
|
2815
2866
|
t = e.length;
|
|
@@ -2865,7 +2916,7 @@ function updateKeyedMap() {
|
|
|
2865
2916
|
d = new Array(t),
|
|
2866
2917
|
h = new Array(t),
|
|
2867
2918
|
p = this.tt ? new Array(t) : undefined,
|
|
2868
|
-
|
|
2919
|
+
y = this.nt ? new Array(t) : undefined;
|
|
2869
2920
|
for (
|
|
2870
2921
|
s = 0, o = Math.min(this.Ue, t);
|
|
2871
2922
|
s < o && (this.Xe[s] === e[s] || (this.tt && compare(this.et, this.Xe[s], e[s])));
|
|
@@ -2883,7 +2934,7 @@ function updateKeyedMap() {
|
|
|
2883
2934
|
d[u] = this.Ze[o];
|
|
2884
2935
|
h[u] = this.$e[o];
|
|
2885
2936
|
p && (p[u] = this.tt[o]);
|
|
2886
|
-
|
|
2937
|
+
y && (y[u] = this.nt[o]);
|
|
2887
2938
|
}
|
|
2888
2939
|
c = new Map();
|
|
2889
2940
|
a = new Array(u + 1);
|
|
@@ -2902,7 +2953,7 @@ function updateKeyedMap() {
|
|
|
2902
2953
|
d[r] = this.Ze[n];
|
|
2903
2954
|
h[r] = this.$e[n];
|
|
2904
2955
|
p && (p[r] = this.tt[n]);
|
|
2905
|
-
|
|
2956
|
+
y && (y[r] = this.nt[n]);
|
|
2906
2957
|
r = a[r];
|
|
2907
2958
|
c.set(l, r);
|
|
2908
2959
|
} else this.$e[n].dispose();
|
|
@@ -2915,8 +2966,8 @@ function updateKeyedMap() {
|
|
|
2915
2966
|
this.tt[r] = p[r];
|
|
2916
2967
|
setSignal(this.tt[r], e[r]);
|
|
2917
2968
|
}
|
|
2918
|
-
if (
|
|
2919
|
-
this.nt[r] =
|
|
2969
|
+
if (y) {
|
|
2970
|
+
this.nt[r] = y[r];
|
|
2920
2971
|
setSignal(this.nt[r], r);
|
|
2921
2972
|
}
|
|
2922
2973
|
} else {
|
|
@@ -2931,17 +2982,21 @@ function updateKeyedMap() {
|
|
|
2931
2982
|
}
|
|
2932
2983
|
function repeat(e, t, n) {
|
|
2933
2984
|
const r = t;
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2985
|
+
const i = computed(
|
|
2986
|
+
updateRepeat.bind({
|
|
2987
|
+
ze: createOwner(),
|
|
2988
|
+
Ue: 0,
|
|
2989
|
+
it: 0,
|
|
2990
|
+
st: e,
|
|
2991
|
+
Ye: r,
|
|
2992
|
+
$e: [],
|
|
2993
|
+
Ze: [],
|
|
2994
|
+
ot: n?.from,
|
|
2995
|
+
rt: n?.fallback
|
|
2996
|
+
})
|
|
2997
|
+
);
|
|
2998
|
+
i.ve = true;
|
|
2999
|
+
return accessor(i);
|
|
2945
3000
|
}
|
|
2946
3001
|
function updateRepeat() {
|
|
2947
3002
|
const e = this.st();
|
|
@@ -2996,10 +3051,10 @@ function compare(e, t, n) {
|
|
|
2996
3051
|
function boundaryComputed(e, t) {
|
|
2997
3052
|
const n = computed(e, undefined, { lazy: true });
|
|
2998
3053
|
n.Qe = (e, t) => {
|
|
2999
|
-
const r = e !== undefined ? e : n.
|
|
3054
|
+
const r = e !== undefined ? e : n.ye;
|
|
3000
3055
|
const i = t !== undefined ? t : n.ae;
|
|
3001
|
-
n.
|
|
3002
|
-
n.
|
|
3056
|
+
n.ye &= ~n.ut;
|
|
3057
|
+
n.V.notify(n, n.ut, r, i);
|
|
3003
3058
|
};
|
|
3004
3059
|
n.ut = t;
|
|
3005
3060
|
n.ve = true;
|
|
@@ -3007,16 +3062,16 @@ function boundaryComputed(e, t) {
|
|
|
3007
3062
|
return n;
|
|
3008
3063
|
}
|
|
3009
3064
|
function createBoundChildren(e, t, n, r) {
|
|
3010
|
-
const i = e.
|
|
3011
|
-
i.addChild((e.
|
|
3012
|
-
cleanup(() => i.removeChild(e.
|
|
3065
|
+
const i = e.V;
|
|
3066
|
+
i.addChild((e.V = n));
|
|
3067
|
+
cleanup(() => i.removeChild(e.V));
|
|
3013
3068
|
return runWithOwner(e, () => {
|
|
3014
3069
|
const e = computed(t);
|
|
3015
3070
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
3016
3071
|
});
|
|
3017
3072
|
}
|
|
3018
|
-
const
|
|
3019
|
-
const
|
|
3073
|
+
const ye = Symbol();
|
|
3074
|
+
const ge = createContext(null);
|
|
3020
3075
|
let Se = false;
|
|
3021
3076
|
const FALSE_ACCESSOR = () => false;
|
|
3022
3077
|
function isRevealController(e) {
|
|
@@ -3032,25 +3087,25 @@ function setSlotState(e, t, n, r) {
|
|
|
3032
3087
|
if (!n && e.ht === t) e.ht = undefined;
|
|
3033
3088
|
return e.evaluate(n, r);
|
|
3034
3089
|
}
|
|
3035
|
-
if (!n && e.
|
|
3090
|
+
if (!n && e.yt === t && e.gt) e.yt = undefined;
|
|
3036
3091
|
}
|
|
3037
3092
|
class RevealController {
|
|
3038
3093
|
St;
|
|
3039
3094
|
wt;
|
|
3040
|
-
|
|
3095
|
+
bt = [];
|
|
3041
3096
|
ht;
|
|
3042
|
-
ct = signal(false, {
|
|
3043
|
-
dt = signal(false, {
|
|
3044
|
-
|
|
3097
|
+
ct = signal(false, { ownedWrite: true, De: true });
|
|
3098
|
+
dt = signal(false, { ownedWrite: true, De: true });
|
|
3099
|
+
_t = true;
|
|
3045
3100
|
Ot = false;
|
|
3046
3101
|
constructor(e, t) {
|
|
3047
3102
|
this.St = e;
|
|
3048
3103
|
this.wt = t;
|
|
3049
3104
|
}
|
|
3050
3105
|
xt(e) {
|
|
3051
|
-
for (let t = 0; t < this.
|
|
3052
|
-
const n = this.
|
|
3053
|
-
if ((isRevealController(n) ? n.ht : n.
|
|
3106
|
+
for (let t = 0; t < this.bt.length; t++) {
|
|
3107
|
+
const n = this.bt[t];
|
|
3108
|
+
if ((isRevealController(n) ? n.ht : n.yt) !== this) continue;
|
|
3054
3109
|
if (e(n) === false) return false;
|
|
3055
3110
|
}
|
|
3056
3111
|
return true;
|
|
@@ -3059,21 +3114,21 @@ class RevealController {
|
|
|
3059
3114
|
return this.xt(isSlotReady);
|
|
3060
3115
|
}
|
|
3061
3116
|
register(e) {
|
|
3062
|
-
if (this.
|
|
3063
|
-
this.
|
|
3117
|
+
if (this.bt.includes(e)) return;
|
|
3118
|
+
this.bt.push(e);
|
|
3064
3119
|
const t = !!untrack(this.St);
|
|
3065
|
-
setSignal(e.ct, true), setSignal(e.dt, t ? false : !!untrack(this.wt));
|
|
3120
|
+
(setSignal(e.ct, true), setSignal(e.dt, t ? false : !!untrack(this.wt)));
|
|
3066
3121
|
untrack(() => this.evaluate());
|
|
3067
3122
|
}
|
|
3068
3123
|
unregister(e) {
|
|
3069
|
-
const t = this.
|
|
3070
|
-
if (t >= 0) this.
|
|
3124
|
+
const t = this.bt.indexOf(e);
|
|
3125
|
+
if (t >= 0) this.bt.splice(t, 1);
|
|
3071
3126
|
untrack(() => this.evaluate());
|
|
3072
3127
|
}
|
|
3073
3128
|
evaluate(e, t) {
|
|
3074
3129
|
if (this.Ot) return;
|
|
3075
3130
|
this.Ot = true;
|
|
3076
|
-
const n = this.
|
|
3131
|
+
const n = this._t;
|
|
3077
3132
|
try {
|
|
3078
3133
|
const n = e ?? read(this.ct),
|
|
3079
3134
|
r = !!untrack(this.wt),
|
|
@@ -3092,10 +3147,10 @@ class RevealController {
|
|
|
3092
3147
|
});
|
|
3093
3148
|
}
|
|
3094
3149
|
} finally {
|
|
3095
|
-
this.
|
|
3150
|
+
this._t = this.isReady();
|
|
3096
3151
|
this.Ot = false;
|
|
3097
3152
|
}
|
|
3098
|
-
if (this.ht && n !== this.
|
|
3153
|
+
if (this.ht && n !== this._t) this.ht.evaluate();
|
|
3099
3154
|
}
|
|
3100
3155
|
}
|
|
3101
3156
|
class CollectionQueue extends Queue {
|
|
@@ -3103,12 +3158,12 @@ class CollectionQueue extends Queue {
|
|
|
3103
3158
|
ft = new Set();
|
|
3104
3159
|
Pt;
|
|
3105
3160
|
lt = true;
|
|
3106
|
-
ct = signal(false, {
|
|
3107
|
-
dt = signal(false, {
|
|
3108
|
-
|
|
3109
|
-
|
|
3161
|
+
ct = signal(false, { ownedWrite: true, De: true });
|
|
3162
|
+
dt = signal(false, { ownedWrite: true, De: true });
|
|
3163
|
+
yt;
|
|
3164
|
+
gt = false;
|
|
3110
3165
|
kt;
|
|
3111
|
-
Et =
|
|
3166
|
+
Et = ye;
|
|
3112
3167
|
constructor(e) {
|
|
3113
3168
|
super();
|
|
3114
3169
|
this.vt = e;
|
|
@@ -3119,21 +3174,21 @@ class CollectionQueue extends Queue {
|
|
|
3119
3174
|
}
|
|
3120
3175
|
notify(e, t, n, r) {
|
|
3121
3176
|
if (!(t & this.vt)) return super.notify(e, t, n, r);
|
|
3122
|
-
if (this.
|
|
3177
|
+
if (this.gt && this.kt) {
|
|
3123
3178
|
const e = untrack(() => {
|
|
3124
3179
|
try {
|
|
3125
3180
|
return this.kt();
|
|
3126
3181
|
} catch {
|
|
3127
|
-
return
|
|
3182
|
+
return ye;
|
|
3128
3183
|
}
|
|
3129
3184
|
});
|
|
3130
3185
|
if (e !== this.Et) {
|
|
3131
3186
|
this.Et = e;
|
|
3132
|
-
this.
|
|
3187
|
+
this.gt = false;
|
|
3133
3188
|
this.ft.clear();
|
|
3134
3189
|
}
|
|
3135
3190
|
}
|
|
3136
|
-
if (this.vt & a && this.
|
|
3191
|
+
if (this.vt & a && this.gt) return super.notify(e, t, n, r);
|
|
3137
3192
|
if (this.vt & a && n & d) {
|
|
3138
3193
|
return super.notify(e, d, n, r);
|
|
3139
3194
|
}
|
|
@@ -3151,11 +3206,11 @@ class CollectionQueue extends Queue {
|
|
|
3151
3206
|
}
|
|
3152
3207
|
checkSources() {
|
|
3153
3208
|
for (const e of this.ft) {
|
|
3154
|
-
if (e.m & u || (!(e.
|
|
3209
|
+
if (e.m & u || (!(e.ye & this.vt) && !(this.vt & d && e.ye & a))) this.ft.delete(e);
|
|
3155
3210
|
}
|
|
3156
3211
|
if (!this.ft.size) {
|
|
3157
|
-
if (this.vt & a && this.lt && !this.
|
|
3158
|
-
this.lt = !!(this.Pt.
|
|
3212
|
+
if (this.vt & a && this.lt && !this.gt && this.Pt) {
|
|
3213
|
+
this.lt = !!(this.Pt.ye & this.vt);
|
|
3159
3214
|
} else {
|
|
3160
3215
|
this.lt = false;
|
|
3161
3216
|
}
|
|
@@ -3168,12 +3223,12 @@ class CollectionQueue extends Queue {
|
|
|
3168
3223
|
}
|
|
3169
3224
|
}
|
|
3170
3225
|
}
|
|
3171
|
-
if (Se) this.
|
|
3226
|
+
if (Se) this.yt?.evaluate();
|
|
3172
3227
|
}
|
|
3173
3228
|
}
|
|
3174
3229
|
function createCollectionBoundary(e, t, n, r) {
|
|
3175
3230
|
const i = createOwner();
|
|
3176
|
-
if (Se) setContext(
|
|
3231
|
+
if (Se) setContext(ge, null, i);
|
|
3177
3232
|
const s = new CollectionQueue(e);
|
|
3178
3233
|
if (r) s.kt = r;
|
|
3179
3234
|
const o = (s.Pt = createBoundChildren(i, t, s, e));
|
|
@@ -3185,18 +3240,18 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3185
3240
|
if (e instanceof NotReadyError) t = true;
|
|
3186
3241
|
else throw e;
|
|
3187
3242
|
}
|
|
3188
|
-
s.lt = t || !!(o.
|
|
3243
|
+
s.lt = t || !!(o.ye & e) || o.ae instanceof NotReadyError;
|
|
3189
3244
|
});
|
|
3190
|
-
const u = Se && e === a ? getContext(
|
|
3245
|
+
const u = Se && e === a ? getContext(ge) : null;
|
|
3191
3246
|
if (u) {
|
|
3192
|
-
s.
|
|
3247
|
+
s.yt = u;
|
|
3193
3248
|
u.register(s);
|
|
3194
3249
|
cleanup(() => u.unregister(s));
|
|
3195
3250
|
}
|
|
3196
3251
|
const f = computed(() => {
|
|
3197
3252
|
if (!read(s.ct)) {
|
|
3198
3253
|
const e = read(o);
|
|
3199
|
-
if (!untrack(() => read(s.ct))) return (s.
|
|
3254
|
+
if (!untrack(() => read(s.ct))) return ((s.gt = true), e);
|
|
3200
3255
|
}
|
|
3201
3256
|
if (Se && read(s.dt)) return undefined;
|
|
3202
3257
|
return n(s);
|
|
@@ -3219,11 +3274,11 @@ function createErrorBoundary(e, t) {
|
|
|
3219
3274
|
function createRevealOrder(e, t) {
|
|
3220
3275
|
Se = true;
|
|
3221
3276
|
const n = createOwner();
|
|
3222
|
-
const r = getContext(
|
|
3277
|
+
const r = getContext(ge);
|
|
3223
3278
|
const i = t?.together || FALSE_ACCESSOR,
|
|
3224
3279
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3225
3280
|
const o = new RevealController(i, s);
|
|
3226
|
-
setContext(
|
|
3281
|
+
setContext(ge, o, n);
|
|
3227
3282
|
return runWithOwner(n, () => {
|
|
3228
3283
|
const t = e();
|
|
3229
3284
|
computed(() => {
|
|
@@ -3297,7 +3352,7 @@ exports.ContextNotFoundError = ContextNotFoundError;
|
|
|
3297
3352
|
exports.DEV = we;
|
|
3298
3353
|
exports.NoOwnerError = NoOwnerError;
|
|
3299
3354
|
exports.NotReadyError = NotReadyError;
|
|
3300
|
-
exports.SUPPORTS_PROXY =
|
|
3355
|
+
exports.SUPPORTS_PROXY = b;
|
|
3301
3356
|
exports.action = action;
|
|
3302
3357
|
exports.clearSnapshots = clearSnapshots;
|
|
3303
3358
|
exports.createContext = createContext;
|