@solidjs/signals 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +252 -2
- package/dist/dev.js +28 -18
- package/dist/node.cjs +520 -516
- package/dist/prod.js +141 -137
- package/dist/types/core/constants.d.ts +1 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -33,18 +33,19 @@ const o = 1 << 5;
|
|
|
33
33
|
const u = 1 << 6;
|
|
34
34
|
const f = 1 << 7;
|
|
35
35
|
const l = 1 << 8;
|
|
36
|
-
const c = 1 <<
|
|
37
|
-
const a = 1 <<
|
|
38
|
-
const d = 1 <<
|
|
39
|
-
const p = 1;
|
|
40
|
-
const h =
|
|
41
|
-
const y =
|
|
42
|
-
const g =
|
|
36
|
+
const c = 1 << 9;
|
|
37
|
+
const a = 1 << 0;
|
|
38
|
+
const d = 1 << 1;
|
|
39
|
+
const p = 1 << 2;
|
|
40
|
+
const h = 1;
|
|
41
|
+
const y = 2;
|
|
42
|
+
const g = 3;
|
|
43
43
|
const S = {};
|
|
44
|
-
const w =
|
|
44
|
+
const w = {};
|
|
45
|
+
const m = "sp";
|
|
45
46
|
const b = typeof Proxy === "function";
|
|
46
|
-
const
|
|
47
|
-
const
|
|
47
|
+
const _ = {};
|
|
48
|
+
const O = Symbol("refresh");
|
|
48
49
|
function actualInsertIntoHeap(e, t) {
|
|
49
50
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
50
51
|
if (n >= e.o) e.o = n + 1;
|
|
@@ -141,15 +142,15 @@ function adjustHeight(e, t) {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
const x = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
145
|
+
const x = new Set();
|
|
146
146
|
const v = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
147
|
-
|
|
148
|
-
let k =
|
|
149
|
-
let A =
|
|
147
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
+
let k = 0;
|
|
149
|
+
let A = null;
|
|
150
150
|
let C = false;
|
|
151
|
+
let E = false;
|
|
151
152
|
function runLaneEffects(e) {
|
|
152
|
-
for (const t of
|
|
153
|
+
for (const t of N) {
|
|
153
154
|
if (t.H || t.T.size > 0) continue;
|
|
154
155
|
const n = t.M[e - 1];
|
|
155
156
|
if (n.length) {
|
|
@@ -159,18 +160,18 @@ function runLaneEffects(e) {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
function setProjectionWriteActive(e) {
|
|
162
|
-
|
|
163
|
+
E = e;
|
|
163
164
|
}
|
|
164
165
|
function schedule() {
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
if (!
|
|
166
|
+
if (C) return;
|
|
167
|
+
C = true;
|
|
168
|
+
if (!j.q) queueMicrotask(flush);
|
|
168
169
|
}
|
|
169
170
|
class Queue {
|
|
170
171
|
i = null;
|
|
171
172
|
F = [[], []];
|
|
172
173
|
V = [];
|
|
173
|
-
created =
|
|
174
|
+
created = k;
|
|
174
175
|
addChild(e) {
|
|
175
176
|
this.V.push(e);
|
|
176
177
|
e.i = this;
|
|
@@ -196,8 +197,8 @@ class Queue {
|
|
|
196
197
|
}
|
|
197
198
|
enqueue(e, t) {
|
|
198
199
|
if (e) {
|
|
199
|
-
if (
|
|
200
|
-
const n = findLane(
|
|
200
|
+
if (F) {
|
|
201
|
+
const n = findLane(F);
|
|
201
202
|
n.M[e - 1].push(t);
|
|
202
203
|
} else {
|
|
203
204
|
this.F[e - 1].push(t);
|
|
@@ -241,52 +242,52 @@ class GlobalQueue extends Queue {
|
|
|
241
242
|
if (this.q) return;
|
|
242
243
|
this.q = true;
|
|
243
244
|
try {
|
|
244
|
-
runHeap(
|
|
245
|
-
if (
|
|
246
|
-
const e = transitionComplete(
|
|
245
|
+
runHeap(v, GlobalQueue.K);
|
|
246
|
+
if (A) {
|
|
247
|
+
const e = transitionComplete(A);
|
|
247
248
|
if (!e) {
|
|
248
|
-
let e =
|
|
249
|
-
runHeap(
|
|
249
|
+
let e = A;
|
|
250
|
+
runHeap(P, GlobalQueue.K);
|
|
250
251
|
this.D = [];
|
|
251
252
|
this.B = [];
|
|
252
253
|
this.G = new Set();
|
|
253
|
-
runLaneEffects(p);
|
|
254
254
|
runLaneEffects(h);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
runLaneEffects(y);
|
|
256
|
+
this.stashQueues(A.X);
|
|
257
|
+
k++;
|
|
258
|
+
C = v.S >= v.j;
|
|
259
|
+
reassignPendingTransition(A.D);
|
|
260
|
+
A = null;
|
|
260
261
|
finalizePureQueue(null, true);
|
|
261
262
|
return;
|
|
262
263
|
}
|
|
263
|
-
this.D !==
|
|
264
|
-
this.restoreQueues(
|
|
265
|
-
|
|
266
|
-
const t =
|
|
267
|
-
|
|
264
|
+
this.D !== A.D && this.D.push(...A.D);
|
|
265
|
+
this.restoreQueues(A.X);
|
|
266
|
+
x.delete(A);
|
|
267
|
+
const t = A;
|
|
268
|
+
A = null;
|
|
268
269
|
reassignPendingTransition(this.D);
|
|
269
270
|
finalizePureQueue(t);
|
|
270
271
|
} else {
|
|
271
|
-
if (
|
|
272
|
+
if (x.size) runHeap(P, GlobalQueue.K);
|
|
272
273
|
finalizePureQueue();
|
|
273
274
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
runLaneEffects(p);
|
|
277
|
-
this.run(p);
|
|
275
|
+
k++;
|
|
276
|
+
C = v.S >= v.j;
|
|
278
277
|
runLaneEffects(h);
|
|
279
278
|
this.run(h);
|
|
279
|
+
runLaneEffects(y);
|
|
280
|
+
this.run(y);
|
|
280
281
|
} finally {
|
|
281
282
|
this.q = false;
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
notify(e, t, n, r) {
|
|
285
|
-
if (t &
|
|
286
|
-
if (n &
|
|
286
|
+
if (t & a) {
|
|
287
|
+
if (n & a) {
|
|
287
288
|
const t = r !== undefined ? r : e.Y;
|
|
288
|
-
if (
|
|
289
|
-
|
|
289
|
+
if (A && t && !A.Z.includes(t.source)) {
|
|
290
|
+
A.Z.push(t.source);
|
|
290
291
|
schedule();
|
|
291
292
|
}
|
|
292
293
|
}
|
|
@@ -296,11 +297,11 @@ class GlobalQueue extends Queue {
|
|
|
296
297
|
}
|
|
297
298
|
initTransition(e) {
|
|
298
299
|
if (e) e = currentTransition(e);
|
|
299
|
-
if (e && e ===
|
|
300
|
-
if (!e &&
|
|
301
|
-
if (!
|
|
302
|
-
|
|
303
|
-
$:
|
|
300
|
+
if (e && e === A) return;
|
|
301
|
+
if (!e && A && A.$ === k) return;
|
|
302
|
+
if (!A) {
|
|
303
|
+
A = e ?? {
|
|
304
|
+
$: k,
|
|
304
305
|
D: [],
|
|
305
306
|
Z: [],
|
|
306
307
|
B: [],
|
|
@@ -310,42 +311,42 @@ class GlobalQueue extends Queue {
|
|
|
310
311
|
te: false
|
|
311
312
|
};
|
|
312
313
|
} else if (e) {
|
|
313
|
-
const t =
|
|
314
|
+
const t = A;
|
|
314
315
|
t.te = e;
|
|
315
316
|
e.ee.push(...t.ee);
|
|
316
|
-
for (const n of
|
|
317
|
+
for (const n of N) {
|
|
317
318
|
if (n.ne === t) n.ne = e;
|
|
318
319
|
}
|
|
319
320
|
e.B.push(...t.B);
|
|
320
321
|
for (const n of t.G) {
|
|
321
322
|
e.G.add(n);
|
|
322
323
|
}
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
x.delete(t);
|
|
325
|
+
A = e;
|
|
325
326
|
}
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
x.add(A);
|
|
328
|
+
A.$ = k;
|
|
328
329
|
for (let e = 0; e < this.D.length; e++) {
|
|
329
330
|
const t = this.D[e];
|
|
330
|
-
t.ne =
|
|
331
|
-
|
|
331
|
+
t.ne = A;
|
|
332
|
+
A.D.push(t);
|
|
332
333
|
}
|
|
333
|
-
this.D =
|
|
334
|
+
this.D = A.D;
|
|
334
335
|
for (let e = 0; e < this.B.length; e++) {
|
|
335
336
|
const t = this.B[e];
|
|
336
|
-
t.ne =
|
|
337
|
-
|
|
337
|
+
t.ne = A;
|
|
338
|
+
A.B.push(t);
|
|
338
339
|
}
|
|
339
|
-
this.B =
|
|
340
|
-
for (const e of
|
|
341
|
-
if (!e.ne) e.ne =
|
|
340
|
+
this.B = A.B;
|
|
341
|
+
for (const e of N) {
|
|
342
|
+
if (!e.ne) e.ne = A;
|
|
342
343
|
}
|
|
343
|
-
for (const e of this.G)
|
|
344
|
-
this.G =
|
|
344
|
+
for (const e of this.G) A.G.add(e);
|
|
345
|
+
this.G = A.G;
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
348
|
function insertSubs(e, t = false) {
|
|
348
|
-
const n = e.re ||
|
|
349
|
+
const n = e.re || F;
|
|
349
350
|
const r = e.ie !== undefined;
|
|
350
351
|
for (let i = e.O; i !== null; i = i.P) {
|
|
351
352
|
if (r && i.k.se) {
|
|
@@ -360,49 +361,49 @@ function insertSubs(e, t = false) {
|
|
|
360
361
|
i.k.re = undefined;
|
|
361
362
|
}
|
|
362
363
|
const e = i.k;
|
|
363
|
-
if (e.oe ===
|
|
364
|
+
if (e.oe === g) {
|
|
364
365
|
if (!e.ue) {
|
|
365
366
|
e.ue = true;
|
|
366
|
-
e.fe.enqueue(
|
|
367
|
+
e.fe.enqueue(y, e.le);
|
|
367
368
|
}
|
|
368
369
|
continue;
|
|
369
370
|
}
|
|
370
|
-
const s = i.k.m & o ?
|
|
371
|
+
const s = i.k.m & o ? P : v;
|
|
371
372
|
if (s.j > i.k.o) s.j = i.k.o;
|
|
372
373
|
insertIntoHeap(i.k, s);
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
function finalizePureQueue(e = null, t = false) {
|
|
376
377
|
let n = !t;
|
|
377
|
-
if (!t) checkBoundaryChildren(
|
|
378
|
-
if (
|
|
378
|
+
if (!t) checkBoundaryChildren(j);
|
|
379
|
+
if (v.S >= v.j) runHeap(v, GlobalQueue.K);
|
|
379
380
|
if (n) {
|
|
380
|
-
const t =
|
|
381
|
+
const t = j.D;
|
|
381
382
|
for (let e = 0; e < t.length; e++) {
|
|
382
383
|
const n = t[e];
|
|
383
|
-
if (n.ce !==
|
|
384
|
+
if (n.ce !== S) {
|
|
384
385
|
n.ae = n.ce;
|
|
385
|
-
n.ce =
|
|
386
|
-
if (n.oe && n.oe !==
|
|
386
|
+
n.ce = S;
|
|
387
|
+
if (n.oe && n.oe !== g) n.ue = true;
|
|
387
388
|
}
|
|
388
|
-
n.de &= ~
|
|
389
|
+
if (!(n.de & a)) n.de &= ~p;
|
|
389
390
|
if (n.R) GlobalQueue.U(n, false, true);
|
|
390
391
|
}
|
|
391
392
|
t.length = 0;
|
|
392
|
-
const n = e ? e.B :
|
|
393
|
+
const n = e ? e.B : j.B;
|
|
393
394
|
for (let e = 0; e < n.length; e++) {
|
|
394
395
|
const t = n[e];
|
|
395
396
|
const r = t.ce;
|
|
396
397
|
t.re = undefined;
|
|
397
|
-
if (r !==
|
|
398
|
+
if (r !== S && t.ae !== r) {
|
|
398
399
|
t.ae = r;
|
|
399
400
|
insertSubs(t, true);
|
|
400
401
|
}
|
|
401
|
-
t.ce =
|
|
402
|
+
t.ce = S;
|
|
402
403
|
t.ne = null;
|
|
403
404
|
}
|
|
404
405
|
n.length = 0;
|
|
405
|
-
const r = e ? e.G :
|
|
406
|
+
const r = e ? e.G : j.G;
|
|
406
407
|
if (GlobalQueue.J && r.size) {
|
|
407
408
|
for (const e of r) {
|
|
408
409
|
GlobalQueue.J(e);
|
|
@@ -410,19 +411,19 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
410
411
|
r.clear();
|
|
411
412
|
schedule();
|
|
412
413
|
}
|
|
413
|
-
for (const t of
|
|
414
|
+
for (const t of N) {
|
|
414
415
|
const n = e ? t.ne === e : !t.ne;
|
|
415
416
|
if (!n) continue;
|
|
416
417
|
if (!t.H) {
|
|
417
|
-
if (t.M[0].length) runQueue(t.M[0],
|
|
418
|
-
if (t.M[1].length) runQueue(t.M[1],
|
|
418
|
+
if (t.M[0].length) runQueue(t.M[0], h);
|
|
419
|
+
if (t.M[1].length) runQueue(t.M[1], y);
|
|
419
420
|
}
|
|
420
421
|
if (t.pe.re === t) t.pe.re = undefined;
|
|
421
422
|
t.T.clear();
|
|
422
423
|
t.M[0].length = 0;
|
|
423
424
|
t.M[1].length = 0;
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
N.delete(t);
|
|
426
|
+
W.delete(t.pe);
|
|
426
427
|
}
|
|
427
428
|
}
|
|
428
429
|
}
|
|
@@ -433,18 +434,18 @@ function checkBoundaryChildren(e) {
|
|
|
433
434
|
}
|
|
434
435
|
}
|
|
435
436
|
function trackOptimisticStore(e) {
|
|
436
|
-
|
|
437
|
+
j.G.add(e);
|
|
437
438
|
schedule();
|
|
438
439
|
}
|
|
439
440
|
function reassignPendingTransition(e) {
|
|
440
441
|
for (let t = 0; t < e.length; t++) {
|
|
441
|
-
e[t].ne =
|
|
442
|
+
e[t].ne = A;
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
|
-
const
|
|
445
|
+
const j = new GlobalQueue();
|
|
445
446
|
function flush() {
|
|
446
|
-
while (
|
|
447
|
-
|
|
447
|
+
while (C) {
|
|
448
|
+
j.flush();
|
|
448
449
|
}
|
|
449
450
|
}
|
|
450
451
|
function runQueue(e, t) {
|
|
@@ -456,7 +457,7 @@ function transitionComplete(e) {
|
|
|
456
457
|
let t = true;
|
|
457
458
|
for (let n = 0; n < e.Z.length; n++) {
|
|
458
459
|
const r = e.Z[n];
|
|
459
|
-
if (r.de &
|
|
460
|
+
if (r.de & a && r.Y?.source === r) {
|
|
460
461
|
t = false;
|
|
461
462
|
break;
|
|
462
463
|
}
|
|
@@ -469,29 +470,29 @@ function currentTransition(e) {
|
|
|
469
470
|
return e;
|
|
470
471
|
}
|
|
471
472
|
function setActiveTransition(e) {
|
|
472
|
-
|
|
473
|
+
A = e;
|
|
473
474
|
}
|
|
474
475
|
function runInTransition(e, t) {
|
|
475
|
-
const n =
|
|
476
|
+
const n = A;
|
|
476
477
|
try {
|
|
477
|
-
|
|
478
|
+
A = currentTransition(e);
|
|
478
479
|
return t();
|
|
479
480
|
} finally {
|
|
480
|
-
|
|
481
|
+
A = n;
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
|
-
const
|
|
484
|
-
const
|
|
484
|
+
const W = new WeakMap();
|
|
485
|
+
const N = new Set();
|
|
485
486
|
function getOrCreateLane(e) {
|
|
486
|
-
let t =
|
|
487
|
+
let t = W.get(e);
|
|
487
488
|
if (t) {
|
|
488
489
|
return findLane(t);
|
|
489
490
|
}
|
|
490
491
|
const n = e.he;
|
|
491
492
|
const r = n?.re ? findLane(n.re) : null;
|
|
492
|
-
t = { pe: e, T: new Set(), M: [[], []], H: null, ne:
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
t = { pe: e, T: new Set(), M: [[], []], H: null, ne: A, ye: r };
|
|
494
|
+
W.set(e, t);
|
|
495
|
+
N.add(t);
|
|
495
496
|
e.ge = e.Se || 0;
|
|
496
497
|
return t;
|
|
497
498
|
}
|
|
@@ -513,12 +514,12 @@ function resolveLane(e) {
|
|
|
513
514
|
const t = e.re;
|
|
514
515
|
if (!t) return undefined;
|
|
515
516
|
const n = findLane(t);
|
|
516
|
-
if (
|
|
517
|
+
if (N.has(n)) return n;
|
|
517
518
|
e.re = undefined;
|
|
518
519
|
return undefined;
|
|
519
520
|
}
|
|
520
521
|
function hasActiveOverride(e) {
|
|
521
|
-
return !!(e.we && e.ce !==
|
|
522
|
+
return !!(e.we && e.ce !== S);
|
|
522
523
|
}
|
|
523
524
|
function assignOrMergeLane(e, t) {
|
|
524
525
|
const n = findLane(t);
|
|
@@ -529,7 +530,7 @@ function assignOrMergeLane(e, t) {
|
|
|
529
530
|
return;
|
|
530
531
|
}
|
|
531
532
|
const i = findLane(r);
|
|
532
|
-
if (
|
|
533
|
+
if (N.has(i)) {
|
|
533
534
|
if (i !== n && !hasActiveOverride(e)) {
|
|
534
535
|
if (n.ye && findLane(n.ye) === i) {
|
|
535
536
|
e.re = t;
|
|
@@ -546,39 +547,39 @@ function handleAsync(e, t, r) {
|
|
|
546
547
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
547
548
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
548
549
|
if (!o && !s) {
|
|
549
|
-
e.
|
|
550
|
+
e.me = null;
|
|
550
551
|
return t;
|
|
551
552
|
}
|
|
552
|
-
e.
|
|
553
|
+
e.me = t;
|
|
553
554
|
let u;
|
|
554
555
|
const handleError = n => {
|
|
555
|
-
if (e.
|
|
556
|
-
|
|
557
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
558
|
-
e.$ =
|
|
556
|
+
if (e.me !== t) return;
|
|
557
|
+
j.initTransition(e.ne);
|
|
558
|
+
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
559
|
+
e.$ = k;
|
|
559
560
|
};
|
|
560
561
|
const asyncWrite = (i, s) => {
|
|
561
|
-
if (e.
|
|
562
|
+
if (e.me !== t) return;
|
|
562
563
|
if (e.m & (n | f)) return;
|
|
563
|
-
|
|
564
|
+
j.initTransition(e.ne);
|
|
564
565
|
clearStatus(e);
|
|
565
566
|
const o = resolveLane(e);
|
|
566
567
|
if (o) o.T.delete(e);
|
|
567
568
|
if (r) r(i);
|
|
568
569
|
else if (e.we) {
|
|
569
|
-
const t = e.ce !==
|
|
570
|
+
const t = e.ce !== S;
|
|
570
571
|
if (e.R) e.ce = i;
|
|
571
572
|
if (!t) {
|
|
572
573
|
e.ae = i;
|
|
573
574
|
insertSubs(e);
|
|
574
575
|
}
|
|
575
|
-
e.$ =
|
|
576
|
+
e.$ = k;
|
|
576
577
|
} else if (o) {
|
|
577
578
|
const t = e.ae;
|
|
578
|
-
const n = e.
|
|
579
|
+
const n = e.be;
|
|
579
580
|
if (!n || !n(i, t)) {
|
|
580
581
|
e.ae = i;
|
|
581
|
-
e.$ =
|
|
582
|
+
e.$ = k;
|
|
582
583
|
if (e._e) {
|
|
583
584
|
setSignal(e._e, i);
|
|
584
585
|
}
|
|
@@ -607,8 +608,8 @@ function handleAsync(e, t, r) {
|
|
|
607
608
|
);
|
|
608
609
|
r = false;
|
|
609
610
|
if (!n) {
|
|
610
|
-
|
|
611
|
-
throw new NotReadyError(
|
|
611
|
+
j.initTransition(e.ne);
|
|
612
|
+
throw new NotReadyError(q);
|
|
612
613
|
}
|
|
613
614
|
}
|
|
614
615
|
if (s) {
|
|
@@ -639,36 +640,36 @@ function handleAsync(e, t, r) {
|
|
|
639
640
|
};
|
|
640
641
|
const i = iterate();
|
|
641
642
|
if (!r && !i) {
|
|
642
|
-
|
|
643
|
-
throw new NotReadyError(
|
|
643
|
+
j.initTransition(e.ne);
|
|
644
|
+
throw new NotReadyError(q);
|
|
644
645
|
}
|
|
645
646
|
}
|
|
646
647
|
return u;
|
|
647
648
|
}
|
|
648
649
|
function clearStatus(e) {
|
|
649
|
-
e.de = e.de &
|
|
650
|
+
e.de = e.de & p;
|
|
650
651
|
e.Y = null;
|
|
651
652
|
updatePendingSignal(e);
|
|
652
653
|
e.Oe?.();
|
|
653
654
|
}
|
|
654
655
|
function notifyStatus(e, t, n, r, i) {
|
|
655
|
-
if (t ===
|
|
656
|
+
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
656
657
|
n = new StatusError(e, n);
|
|
657
658
|
const s = n instanceof NotReadyError && n.source === e;
|
|
658
|
-
const o = t ===
|
|
659
|
+
const o = t === a && e.we && !s;
|
|
659
660
|
const u = o && hasActiveOverride(e);
|
|
660
661
|
if (!r) {
|
|
661
|
-
e.de = t | (t !==
|
|
662
|
+
e.de = t | (t !== d ? e.de & p : 0);
|
|
662
663
|
e.Y = n;
|
|
663
664
|
updatePendingSignal(e);
|
|
664
665
|
}
|
|
665
666
|
if (i && !r) {
|
|
666
667
|
assignOrMergeLane(e, i);
|
|
667
668
|
}
|
|
668
|
-
if (u &&
|
|
669
|
+
if (u && A && n instanceof NotReadyError) {
|
|
669
670
|
const e = n.source;
|
|
670
|
-
if (!
|
|
671
|
-
|
|
671
|
+
if (!A.Z.includes(e)) {
|
|
672
|
+
A.Z.push(e);
|
|
672
673
|
}
|
|
673
674
|
}
|
|
674
675
|
const f = r || u;
|
|
@@ -682,17 +683,17 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
682
683
|
return;
|
|
683
684
|
}
|
|
684
685
|
for (let r = e.O; r !== null; r = r.P) {
|
|
685
|
-
r.k.$ =
|
|
686
|
+
r.k.$ = k;
|
|
686
687
|
if (r.k.Y !== n) {
|
|
687
|
-
!r.k.ne &&
|
|
688
|
+
!r.k.ne && j.D.push(r.k);
|
|
688
689
|
notifyStatus(r.k, t, n, f, l);
|
|
689
690
|
}
|
|
690
691
|
}
|
|
691
692
|
for (let r = e.A; r !== null; r = r.C) {
|
|
692
693
|
for (let e = r.O; e !== null; e = e.P) {
|
|
693
|
-
e.k.$ =
|
|
694
|
+
e.k.$ = k;
|
|
694
695
|
if (e.k.Y !== n) {
|
|
695
|
-
!e.k.ne &&
|
|
696
|
+
!e.k.ne && j.D.push(e.k);
|
|
696
697
|
notifyStatus(e.k, t, n, f, l);
|
|
697
698
|
}
|
|
698
699
|
}
|
|
@@ -716,7 +717,7 @@ function unlinkSubs(e) {
|
|
|
716
717
|
return n;
|
|
717
718
|
}
|
|
718
719
|
function unobserved(e) {
|
|
719
|
-
deleteFromHeap(e, e.m & o ?
|
|
720
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
720
721
|
let t = e.W;
|
|
721
722
|
while (t !== null) {
|
|
722
723
|
t = unlinkSubs(t);
|
|
@@ -756,14 +757,14 @@ function isValidLink(e, t) {
|
|
|
756
757
|
}
|
|
757
758
|
return false;
|
|
758
759
|
}
|
|
759
|
-
const
|
|
760
|
+
const L = {};
|
|
760
761
|
function markDisposal(e) {
|
|
761
762
|
let t = e.Ce;
|
|
762
763
|
while (t) {
|
|
763
764
|
t.m |= o;
|
|
764
765
|
if (t.m & i) {
|
|
765
|
-
deleteFromHeap(t,
|
|
766
|
-
insertIntoHeap(t,
|
|
766
|
+
deleteFromHeap(t, v);
|
|
767
|
+
insertIntoHeap(t, P);
|
|
767
768
|
}
|
|
768
769
|
markDisposal(t);
|
|
769
770
|
t = t.Ee;
|
|
@@ -786,7 +787,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
786
787
|
const e = r.Ee;
|
|
787
788
|
if (r.W) {
|
|
788
789
|
const e = r;
|
|
789
|
-
deleteFromHeap(e, e.m & o ?
|
|
790
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
790
791
|
let t = e.W;
|
|
791
792
|
do {
|
|
792
793
|
t = unlinkSubs(t);
|
|
@@ -837,24 +838,24 @@ function formatId(e, t) {
|
|
|
837
838
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
838
839
|
}
|
|
839
840
|
function getObserver() {
|
|
840
|
-
if (
|
|
841
|
-
return
|
|
841
|
+
if (Q || M) return L;
|
|
842
|
+
return I ? q : null;
|
|
842
843
|
}
|
|
843
844
|
function getOwner() {
|
|
844
|
-
return
|
|
845
|
+
return q;
|
|
845
846
|
}
|
|
846
847
|
function onCleanup(e) {
|
|
847
|
-
if (!
|
|
848
|
-
if (!
|
|
849
|
-
else if (Array.isArray(
|
|
850
|
-
else
|
|
848
|
+
if (!q) return e;
|
|
849
|
+
if (!q.Le) q.Le = e;
|
|
850
|
+
else if (Array.isArray(q.Le)) q.Le.push(e);
|
|
851
|
+
else q.Le = [q.Le, e];
|
|
851
852
|
return e;
|
|
852
853
|
}
|
|
853
854
|
function isDisposed(e) {
|
|
854
855
|
return !!(e.m & (u | o));
|
|
855
856
|
}
|
|
856
857
|
function createOwner(e) {
|
|
857
|
-
const t =
|
|
858
|
+
const t = q;
|
|
858
859
|
const n = e?.transparent ?? false;
|
|
859
860
|
const r = {
|
|
860
861
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
@@ -864,8 +865,8 @@ function createOwner(e) {
|
|
|
864
865
|
Ce: null,
|
|
865
866
|
Ee: null,
|
|
866
867
|
Le: null,
|
|
867
|
-
fe: t?.fe ??
|
|
868
|
-
Re: t?.Re ||
|
|
868
|
+
fe: t?.fe ?? j,
|
|
869
|
+
Re: t?.Re || _,
|
|
869
870
|
We: 0,
|
|
870
871
|
Ne: null,
|
|
871
872
|
je: null,
|
|
@@ -904,14 +905,14 @@ function effect(e, t, n, r, i) {
|
|
|
904
905
|
o.Qe = t;
|
|
905
906
|
o.Te = n;
|
|
906
907
|
o.Me = undefined;
|
|
907
|
-
o.oe = i?.render ?
|
|
908
|
+
o.oe = i?.render ? h : y;
|
|
908
909
|
o.Oe = (e, t) => {
|
|
909
910
|
const n = e !== undefined ? e : o.de;
|
|
910
911
|
const r = t !== undefined ? t : o.Y;
|
|
911
|
-
if (n &
|
|
912
|
+
if (n & d) {
|
|
912
913
|
let e = r;
|
|
913
|
-
o.fe.notify(o,
|
|
914
|
-
if (o.oe ===
|
|
914
|
+
o.fe.notify(o, a, 0);
|
|
915
|
+
if (o.oe === y) {
|
|
915
916
|
try {
|
|
916
917
|
return o.Te
|
|
917
918
|
? o.Te(e, () => {
|
|
@@ -923,11 +924,11 @@ function effect(e, t, n, r, i) {
|
|
|
923
924
|
e = t;
|
|
924
925
|
}
|
|
925
926
|
}
|
|
926
|
-
if (!o.fe.notify(o,
|
|
927
|
-
} else if (o.oe ===
|
|
927
|
+
if (!o.fe.notify(o, d, d)) throw e;
|
|
928
|
+
} else if (o.oe === h) o.fe.notify(o, a | d, n, r);
|
|
928
929
|
};
|
|
929
930
|
recompute(o, true);
|
|
930
|
-
!i?.defer && (o.oe ===
|
|
931
|
+
!i?.defer && (o.oe === y ? o.fe.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
|
|
931
932
|
s = true;
|
|
932
933
|
onCleanup(() => o.Me?.());
|
|
933
934
|
}
|
|
@@ -938,7 +939,7 @@ function runEffect() {
|
|
|
938
939
|
try {
|
|
939
940
|
this.Me = this.Qe(this.ae, this.He);
|
|
940
941
|
} catch (e) {
|
|
941
|
-
if (!this.fe.notify(this,
|
|
942
|
+
if (!this.fe.notify(this, d, d)) throw e;
|
|
942
943
|
} finally {
|
|
943
944
|
this.He = this.ae;
|
|
944
945
|
this.ue = false;
|
|
@@ -964,23 +965,23 @@ function trackedEffect(e, t) {
|
|
|
964
965
|
);
|
|
965
966
|
n.Me = undefined;
|
|
966
967
|
n.ue = true;
|
|
967
|
-
n.oe =
|
|
968
|
+
n.oe = g;
|
|
968
969
|
n.le = run;
|
|
969
|
-
n.fe.enqueue(
|
|
970
|
+
n.fe.enqueue(y, run);
|
|
970
971
|
onCleanup(() => n.Me?.());
|
|
971
972
|
}
|
|
972
973
|
GlobalQueue.K = recompute;
|
|
973
974
|
GlobalQueue.U = disposeChildren;
|
|
974
|
-
let L = false;
|
|
975
975
|
let I = false;
|
|
976
976
|
let R = false;
|
|
977
977
|
let H = false;
|
|
978
978
|
let Q = false;
|
|
979
979
|
let T = false;
|
|
980
|
-
let M =
|
|
980
|
+
let M = false;
|
|
981
981
|
let q = null;
|
|
982
|
-
let F =
|
|
983
|
-
let V =
|
|
982
|
+
let F = null;
|
|
983
|
+
let V = false;
|
|
984
|
+
let D = null;
|
|
984
985
|
function ownerInSnapshotScope(e) {
|
|
985
986
|
while (e) {
|
|
986
987
|
if (e.qe) return true;
|
|
@@ -989,8 +990,8 @@ function ownerInSnapshotScope(e) {
|
|
|
989
990
|
return false;
|
|
990
991
|
}
|
|
991
992
|
function setSnapshotCapture(e) {
|
|
992
|
-
|
|
993
|
-
if (e && !
|
|
993
|
+
V = e;
|
|
994
|
+
if (e && !D) D = new Set();
|
|
994
995
|
}
|
|
995
996
|
function markSnapshotScope(e) {
|
|
996
997
|
e.qe = true;
|
|
@@ -1013,8 +1014,8 @@ function releaseSubtree(e) {
|
|
|
1013
1014
|
if (e.m & l) {
|
|
1014
1015
|
e.m &= ~l;
|
|
1015
1016
|
e.m |= n;
|
|
1016
|
-
if (
|
|
1017
|
-
insertIntoHeap(e,
|
|
1017
|
+
if (v.j > e.o) v.j = e.o;
|
|
1018
|
+
insertIntoHeap(e, v);
|
|
1018
1019
|
}
|
|
1019
1020
|
}
|
|
1020
1021
|
releaseSubtree(t);
|
|
@@ -1022,21 +1023,21 @@ function releaseSubtree(e) {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1024
1025
|
function clearSnapshots() {
|
|
1025
|
-
if (
|
|
1026
|
-
for (const e of
|
|
1026
|
+
if (D) {
|
|
1027
|
+
for (const e of D) {
|
|
1027
1028
|
delete e.ie;
|
|
1028
|
-
delete e[
|
|
1029
|
+
delete e[m];
|
|
1029
1030
|
}
|
|
1030
|
-
|
|
1031
|
+
D = null;
|
|
1031
1032
|
}
|
|
1032
|
-
|
|
1033
|
+
V = false;
|
|
1033
1034
|
}
|
|
1034
1035
|
function recompute(t, n = false) {
|
|
1035
1036
|
const i = t.oe;
|
|
1036
1037
|
if (!n) {
|
|
1037
|
-
if (t.ne && (!i ||
|
|
1038
|
-
deleteFromHeap(t, t.m & o ?
|
|
1039
|
-
if (t.ne || i ===
|
|
1038
|
+
if (t.ne && (!i || A) && A !== t.ne) j.initTransition(t.ne);
|
|
1039
|
+
deleteFromHeap(t, t.m & o ? P : v);
|
|
1040
|
+
if (t.ne || i === g) disposeChildren(t);
|
|
1040
1041
|
else {
|
|
1041
1042
|
markDisposal(t);
|
|
1042
1043
|
t.Ne = t.Le;
|
|
@@ -1048,20 +1049,20 @@ function recompute(t, n = false) {
|
|
|
1048
1049
|
}
|
|
1049
1050
|
const s = !!(t.m & f);
|
|
1050
1051
|
const u = hasActiveOverride(t);
|
|
1051
|
-
const
|
|
1052
|
-
const p =
|
|
1053
|
-
|
|
1052
|
+
const c = !!(t.de & a);
|
|
1053
|
+
const p = q;
|
|
1054
|
+
q = t;
|
|
1054
1055
|
t.Ae = null;
|
|
1055
1056
|
t.m = r;
|
|
1056
|
-
t.$ =
|
|
1057
|
-
let h = t.ce ===
|
|
1058
|
-
let
|
|
1059
|
-
let w =
|
|
1060
|
-
let
|
|
1061
|
-
|
|
1057
|
+
t.$ = k;
|
|
1058
|
+
let h = t.ce === S ? t.ae : t.ce;
|
|
1059
|
+
let y = t.o;
|
|
1060
|
+
let w = I;
|
|
1061
|
+
let m = F;
|
|
1062
|
+
I = true;
|
|
1062
1063
|
if (s) {
|
|
1063
1064
|
const e = resolveLane(t);
|
|
1064
|
-
if (e)
|
|
1065
|
+
if (e) F = e;
|
|
1065
1066
|
}
|
|
1066
1067
|
try {
|
|
1067
1068
|
h = handleAsync(t, t.R(h));
|
|
@@ -1072,8 +1073,8 @@ function recompute(t, n = false) {
|
|
|
1072
1073
|
updatePendingSignal(e.pe);
|
|
1073
1074
|
}
|
|
1074
1075
|
} catch (e) {
|
|
1075
|
-
if (e instanceof NotReadyError &&
|
|
1076
|
-
const e = findLane(
|
|
1076
|
+
if (e instanceof NotReadyError && F) {
|
|
1077
|
+
const e = findLane(F);
|
|
1077
1078
|
if (e.pe !== t) {
|
|
1078
1079
|
e.T.add(t);
|
|
1079
1080
|
t.re = e;
|
|
@@ -1082,15 +1083,15 @@ function recompute(t, n = false) {
|
|
|
1082
1083
|
}
|
|
1083
1084
|
notifyStatus(
|
|
1084
1085
|
t,
|
|
1085
|
-
e instanceof NotReadyError ?
|
|
1086
|
+
e instanceof NotReadyError ? a : d,
|
|
1086
1087
|
e,
|
|
1087
1088
|
undefined,
|
|
1088
1089
|
e instanceof NotReadyError ? t.re : undefined
|
|
1089
1090
|
);
|
|
1090
1091
|
} finally {
|
|
1091
|
-
|
|
1092
|
+
I = w;
|
|
1092
1093
|
t.m = e | (n ? t.m & l : 0);
|
|
1093
|
-
|
|
1094
|
+
q = p;
|
|
1094
1095
|
}
|
|
1095
1096
|
if (!t.Y) {
|
|
1096
1097
|
const e = t.Ae;
|
|
@@ -1102,13 +1103,13 @@ function recompute(t, n = false) {
|
|
|
1102
1103
|
if (e !== null) e.N = null;
|
|
1103
1104
|
else t.W = null;
|
|
1104
1105
|
}
|
|
1105
|
-
const f = u ? t.ae : t.ce ===
|
|
1106
|
-
const l = !t.
|
|
1106
|
+
const f = u ? t.ae : t.ce === S ? t.ae : t.ce;
|
|
1107
|
+
const l = !t.be || !t.be(f, h);
|
|
1107
1108
|
if (l) {
|
|
1108
1109
|
const e = u ? t.ae : undefined;
|
|
1109
|
-
if (n || (i &&
|
|
1110
|
+
if (n || (i && A !== t.ne) || s) t.ae = h;
|
|
1110
1111
|
else t.ce = h;
|
|
1111
|
-
if (u && !s &&
|
|
1112
|
+
if (u && !s && c) {
|
|
1112
1113
|
const e = t.Se || 0;
|
|
1113
1114
|
const n = t.ge || 0;
|
|
1114
1115
|
if (e <= n) t.ae = h;
|
|
@@ -1118,15 +1119,15 @@ function recompute(t, n = false) {
|
|
|
1118
1119
|
}
|
|
1119
1120
|
} else if (u) {
|
|
1120
1121
|
t.ce = h;
|
|
1121
|
-
} else if (t.o !=
|
|
1122
|
+
} else if (t.o != y) {
|
|
1122
1123
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1123
|
-
insertIntoHeapHeight(e.k, e.k.m & o ?
|
|
1124
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? P : v);
|
|
1124
1125
|
}
|
|
1125
1126
|
}
|
|
1126
1127
|
}
|
|
1127
|
-
|
|
1128
|
-
(!n || t.de &
|
|
1129
|
-
t.ne && i &&
|
|
1128
|
+
F = m;
|
|
1129
|
+
(!n || t.de & a) && !t.ne && !(A && t.we) && j.D.push(t);
|
|
1130
|
+
t.ne && i && A !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1130
1131
|
}
|
|
1131
1132
|
function updateIfNecessary(r) {
|
|
1132
1133
|
if (r.m & t) {
|
|
@@ -1141,7 +1142,7 @@ function updateIfNecessary(r) {
|
|
|
1141
1142
|
}
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
|
-
if (r.m & (n | f) || (r.Y && r.$ <
|
|
1145
|
+
if (r.m & (n | f) || (r.Y && r.$ < k)) {
|
|
1145
1146
|
recompute(r);
|
|
1146
1147
|
}
|
|
1147
1148
|
r.m = e | (r.m & l);
|
|
@@ -1149,14 +1150,14 @@ function updateIfNecessary(r) {
|
|
|
1149
1150
|
function computed(t, n, r) {
|
|
1150
1151
|
const i = r?.transparent ?? false;
|
|
1151
1152
|
const s = {
|
|
1152
|
-
id: r?.id ?? (i ?
|
|
1153
|
+
id: r?.id ?? (i ? q?.id : q?.id != null ? getNextChildId(q) : undefined),
|
|
1153
1154
|
Ie: i || undefined,
|
|
1154
|
-
|
|
1155
|
+
be: r?.equals != null ? r.equals : isEqual,
|
|
1155
1156
|
Fe: !!r?.pureWrite,
|
|
1156
1157
|
Pe: r?.unobserved,
|
|
1157
1158
|
Le: null,
|
|
1158
|
-
fe:
|
|
1159
|
-
Re:
|
|
1159
|
+
fe: q?.fe ?? j,
|
|
1160
|
+
Re: q?.Re ?? _,
|
|
1160
1161
|
We: 0,
|
|
1161
1162
|
R: t,
|
|
1162
1163
|
ae: n,
|
|
@@ -1168,57 +1169,57 @@ function computed(t, n, r) {
|
|
|
1168
1169
|
Ae: null,
|
|
1169
1170
|
O: null,
|
|
1170
1171
|
ve: null,
|
|
1171
|
-
i:
|
|
1172
|
+
i: q,
|
|
1172
1173
|
Ee: null,
|
|
1173
1174
|
Ce: null,
|
|
1174
|
-
m: e,
|
|
1175
|
-
de:
|
|
1176
|
-
$:
|
|
1177
|
-
ce:
|
|
1175
|
+
m: r?.lazy ? c : e,
|
|
1176
|
+
de: p,
|
|
1177
|
+
$: k,
|
|
1178
|
+
ce: S,
|
|
1178
1179
|
Ne: null,
|
|
1179
1180
|
je: null,
|
|
1180
|
-
|
|
1181
|
+
me: null,
|
|
1181
1182
|
ne: null
|
|
1182
1183
|
};
|
|
1183
1184
|
s.p = s;
|
|
1184
|
-
const o =
|
|
1185
|
-
if (
|
|
1186
|
-
const e =
|
|
1185
|
+
const o = q?.t ? q.u : q;
|
|
1186
|
+
if (q) {
|
|
1187
|
+
const e = q.Ce;
|
|
1187
1188
|
if (e === null) {
|
|
1188
|
-
|
|
1189
|
+
q.Ce = s;
|
|
1189
1190
|
} else {
|
|
1190
1191
|
s.Ee = e;
|
|
1191
|
-
|
|
1192
|
+
q.Ce = s;
|
|
1192
1193
|
}
|
|
1193
1194
|
}
|
|
1194
1195
|
if (o) s.o = o.o + 1;
|
|
1195
|
-
if (
|
|
1196
|
+
if (V && ownerInSnapshotScope(q)) s.se = true;
|
|
1196
1197
|
!r?.lazy && recompute(s, true);
|
|
1197
|
-
if (
|
|
1198
|
-
if (!(s.de &
|
|
1199
|
-
s.ie = s.ae === undefined ?
|
|
1200
|
-
|
|
1198
|
+
if (V && !r?.lazy) {
|
|
1199
|
+
if (!(s.de & a)) {
|
|
1200
|
+
s.ie = s.ae === undefined ? w : s.ae;
|
|
1201
|
+
D.add(s);
|
|
1201
1202
|
}
|
|
1202
1203
|
}
|
|
1203
1204
|
return s;
|
|
1204
1205
|
}
|
|
1205
1206
|
function signal(e, t, n = null) {
|
|
1206
1207
|
const r = {
|
|
1207
|
-
|
|
1208
|
+
be: t?.equals != null ? t.equals : isEqual,
|
|
1208
1209
|
Fe: !!t?.pureWrite,
|
|
1209
1210
|
Pe: t?.unobserved,
|
|
1210
1211
|
ae: e,
|
|
1211
1212
|
O: null,
|
|
1212
1213
|
ve: null,
|
|
1213
|
-
$:
|
|
1214
|
+
$: k,
|
|
1214
1215
|
I: n,
|
|
1215
1216
|
C: n?.A || null,
|
|
1216
|
-
ce:
|
|
1217
|
+
ce: S
|
|
1217
1218
|
};
|
|
1218
1219
|
n && (n.A = r);
|
|
1219
|
-
if (
|
|
1220
|
-
r.ie = e === undefined ?
|
|
1221
|
-
|
|
1220
|
+
if (V && !r.Fe) {
|
|
1221
|
+
r.ie = e === undefined ? w : e;
|
|
1222
|
+
D.add(r);
|
|
1222
1223
|
}
|
|
1223
1224
|
return r;
|
|
1224
1225
|
}
|
|
@@ -1235,68 +1236,72 @@ function optimisticComputed(e, t, n) {
|
|
|
1235
1236
|
function isEqual(e, t) {
|
|
1236
1237
|
return e === t;
|
|
1237
1238
|
}
|
|
1238
|
-
let
|
|
1239
|
+
let B = false;
|
|
1239
1240
|
function setStrictRead(e) {
|
|
1240
|
-
const t =
|
|
1241
|
-
|
|
1241
|
+
const t = B;
|
|
1242
|
+
B = e;
|
|
1242
1243
|
return t;
|
|
1243
1244
|
}
|
|
1244
1245
|
function untrack(e) {
|
|
1245
|
-
if (!
|
|
1246
|
-
|
|
1246
|
+
if (!I && true) return e();
|
|
1247
|
+
I = false;
|
|
1247
1248
|
try {
|
|
1248
1249
|
return e();
|
|
1249
1250
|
} finally {
|
|
1250
|
-
|
|
1251
|
+
I = true;
|
|
1251
1252
|
}
|
|
1252
1253
|
}
|
|
1253
1254
|
function read(e) {
|
|
1254
|
-
if (
|
|
1255
|
+
if (M) {
|
|
1255
1256
|
const t = getLatestValueComputed(e);
|
|
1256
|
-
const n =
|
|
1257
|
-
|
|
1257
|
+
const n = M;
|
|
1258
|
+
M = false;
|
|
1258
1259
|
let r;
|
|
1259
1260
|
try {
|
|
1260
1261
|
r = read(t);
|
|
1261
1262
|
} catch (t) {
|
|
1262
|
-
if (!
|
|
1263
|
+
if (!q && t instanceof NotReadyError) return e.ae;
|
|
1263
1264
|
throw t;
|
|
1264
1265
|
} finally {
|
|
1265
|
-
|
|
1266
|
+
M = n;
|
|
1266
1267
|
}
|
|
1267
|
-
if (t.de &
|
|
1268
|
-
if (
|
|
1268
|
+
if (t.de & a) return e.ae;
|
|
1269
|
+
if (R && F && t.re) {
|
|
1269
1270
|
const n = findLane(t.re);
|
|
1270
|
-
const r = findLane(
|
|
1271
|
+
const r = findLane(F);
|
|
1271
1272
|
if (n !== r && n.T.size > 0) {
|
|
1272
1273
|
return e.ae;
|
|
1273
1274
|
}
|
|
1274
1275
|
}
|
|
1275
1276
|
return r;
|
|
1276
1277
|
}
|
|
1277
|
-
if (
|
|
1278
|
+
if (Q) {
|
|
1278
1279
|
const t = e.I || e;
|
|
1279
1280
|
const n = getPendingSignal(t);
|
|
1280
|
-
const r =
|
|
1281
|
-
|
|
1281
|
+
const r = Q;
|
|
1282
|
+
Q = false;
|
|
1282
1283
|
if (read(n)) {
|
|
1283
|
-
|
|
1284
|
+
T = true;
|
|
1284
1285
|
}
|
|
1285
|
-
|
|
1286
|
+
Q = r;
|
|
1286
1287
|
return e.ae;
|
|
1287
1288
|
}
|
|
1288
|
-
let t =
|
|
1289
|
+
let t = q;
|
|
1289
1290
|
if (t?.t) t = t.u;
|
|
1290
|
-
if (
|
|
1291
|
-
if (
|
|
1291
|
+
if (H && e.R) recompute(e);
|
|
1292
|
+
if (e.m & c) {
|
|
1293
|
+
e.m &= ~c;
|
|
1294
|
+
recompute(e, true);
|
|
1295
|
+
}
|
|
1296
|
+
const n = e.I || e;
|
|
1297
|
+
if (t && I) {
|
|
1292
1298
|
if (e.R && e.m & u) recompute(e);
|
|
1293
1299
|
link(e, t);
|
|
1294
|
-
const n = e.I || e;
|
|
1295
1300
|
if (n.R) {
|
|
1296
1301
|
const r = e.m & o;
|
|
1297
|
-
if (n.o >= (r ?
|
|
1302
|
+
if (n.o >= (r ? P.j : v.j)) {
|
|
1298
1303
|
markNode(t);
|
|
1299
|
-
markHeap(r ?
|
|
1304
|
+
markHeap(r ? P : v);
|
|
1300
1305
|
updateIfNecessary(n);
|
|
1301
1306
|
}
|
|
1302
1307
|
const i = n.o;
|
|
@@ -1305,92 +1310,91 @@ function read(e) {
|
|
|
1305
1310
|
}
|
|
1306
1311
|
}
|
|
1307
1312
|
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
if (q) {
|
|
1313
|
+
if (n.de & a) {
|
|
1314
|
+
if (t && !(R && n.ne && A !== n.ne)) {
|
|
1315
|
+
if (F) {
|
|
1312
1316
|
const r = n.re;
|
|
1313
|
-
const i = findLane(
|
|
1317
|
+
const i = findLane(F);
|
|
1314
1318
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1315
|
-
if (!
|
|
1319
|
+
if (!I) link(e, t);
|
|
1316
1320
|
throw n.Y;
|
|
1317
1321
|
}
|
|
1318
1322
|
} else {
|
|
1319
|
-
if (!
|
|
1323
|
+
if (!I) link(e, t);
|
|
1320
1324
|
throw n.Y;
|
|
1321
1325
|
}
|
|
1322
|
-
} else if (!t && n.de &
|
|
1326
|
+
} else if (!t && n.de & p) {
|
|
1323
1327
|
throw n.Y;
|
|
1324
1328
|
}
|
|
1325
1329
|
}
|
|
1326
|
-
if (e.R && e.de &
|
|
1327
|
-
if (e.$ <
|
|
1330
|
+
if (e.R && e.de & d) {
|
|
1331
|
+
if (e.$ < k) {
|
|
1328
1332
|
recompute(e, true);
|
|
1329
1333
|
return read(e);
|
|
1330
1334
|
} else throw e.Y;
|
|
1331
1335
|
}
|
|
1332
|
-
if (
|
|
1336
|
+
if (V && t && t.se) {
|
|
1333
1337
|
const n = e.ie;
|
|
1334
1338
|
if (n !== undefined) {
|
|
1335
|
-
const r = n ===
|
|
1336
|
-
const i = e.ce !==
|
|
1339
|
+
const r = n === w ? undefined : n;
|
|
1340
|
+
const i = e.ce !== S ? e.ce : e.ae;
|
|
1337
1341
|
if (i !== r) t.m |= l;
|
|
1338
1342
|
return r;
|
|
1339
1343
|
}
|
|
1340
1344
|
}
|
|
1341
|
-
return !t ||
|
|
1345
|
+
return !t || F !== null || e.ce === S || (R && e.ne && A !== e.ne) ? e.ae : e.ce;
|
|
1342
1346
|
}
|
|
1343
1347
|
function setSignal(e, t) {
|
|
1344
|
-
if (e.ne &&
|
|
1345
|
-
const n = e.we && !
|
|
1346
|
-
const r = n ? e.ae : e.ce ===
|
|
1348
|
+
if (e.ne && A !== e.ne) j.initTransition(e.ne);
|
|
1349
|
+
const n = e.we && !E;
|
|
1350
|
+
const r = n ? e.ae : e.ce === S ? e.ae : e.ce;
|
|
1347
1351
|
if (typeof t === "function") t = t(r);
|
|
1348
|
-
const i = !e.
|
|
1352
|
+
const i = !e.be || !e.be(r, t) || !!(e.de & p);
|
|
1349
1353
|
if (!i) {
|
|
1350
|
-
if (n && e.ce !==
|
|
1354
|
+
if (n && e.ce !== S && e.R) {
|
|
1351
1355
|
insertSubs(e, true);
|
|
1352
1356
|
schedule();
|
|
1353
1357
|
}
|
|
1354
1358
|
return t;
|
|
1355
1359
|
}
|
|
1356
1360
|
if (n) {
|
|
1357
|
-
const n =
|
|
1361
|
+
const n = j.B.includes(e);
|
|
1358
1362
|
if (e.ne && n) {
|
|
1359
|
-
|
|
1363
|
+
j.initTransition(e.ne);
|
|
1360
1364
|
}
|
|
1361
|
-
if (e.ce ===
|
|
1365
|
+
if (e.ce === S) {
|
|
1362
1366
|
e.ce = e.ae;
|
|
1363
1367
|
}
|
|
1364
1368
|
if (!n) {
|
|
1365
|
-
|
|
1369
|
+
j.B.push(e);
|
|
1366
1370
|
}
|
|
1367
1371
|
e.Se = (e.Se || 0) + 1;
|
|
1368
1372
|
const r = getOrCreateLane(e);
|
|
1369
1373
|
e.re = r;
|
|
1370
1374
|
e.ae = t;
|
|
1371
1375
|
} else {
|
|
1372
|
-
if (e.ce ===
|
|
1376
|
+
if (e.ce === S) j.D.push(e);
|
|
1373
1377
|
e.ce = t;
|
|
1374
1378
|
}
|
|
1375
1379
|
updatePendingSignal(e);
|
|
1376
1380
|
if (e._e) {
|
|
1377
1381
|
setSignal(e._e, t);
|
|
1378
1382
|
}
|
|
1379
|
-
e.$ =
|
|
1383
|
+
e.$ = k;
|
|
1380
1384
|
insertSubs(e, n);
|
|
1381
1385
|
schedule();
|
|
1382
1386
|
return t;
|
|
1383
1387
|
}
|
|
1384
1388
|
function runWithOwner(e, t) {
|
|
1385
|
-
const n =
|
|
1386
|
-
const r =
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
+
const n = q;
|
|
1390
|
+
const r = I;
|
|
1391
|
+
q = e;
|
|
1392
|
+
I = false;
|
|
1389
1393
|
try {
|
|
1390
1394
|
return t();
|
|
1391
1395
|
} finally {
|
|
1392
|
-
|
|
1393
|
-
|
|
1396
|
+
q = n;
|
|
1397
|
+
I = r;
|
|
1394
1398
|
}
|
|
1395
1399
|
}
|
|
1396
1400
|
function getPendingSignal(e) {
|
|
@@ -1405,16 +1409,16 @@ function getPendingSignal(e) {
|
|
|
1405
1409
|
}
|
|
1406
1410
|
function computePendingState(e) {
|
|
1407
1411
|
const t = e;
|
|
1408
|
-
if (e.we && e.ce !==
|
|
1409
|
-
if (t.de &
|
|
1412
|
+
if (e.we && e.ce !== S) {
|
|
1413
|
+
if (t.de & a && !(t.de & p)) return true;
|
|
1410
1414
|
if (e.he) {
|
|
1411
1415
|
const t = e.re ? findLane(e.re) : null;
|
|
1412
1416
|
return !!(t && t.T.size > 0);
|
|
1413
1417
|
}
|
|
1414
1418
|
return true;
|
|
1415
1419
|
}
|
|
1416
|
-
if (e.ce !==
|
|
1417
|
-
return !!(t.de &
|
|
1420
|
+
if (e.ce !== S && !(t.de & p)) return true;
|
|
1421
|
+
return !!(t.de & a && !(t.de & p));
|
|
1418
1422
|
}
|
|
1419
1423
|
function updatePendingSignal(e) {
|
|
1420
1424
|
if (e.Ve) {
|
|
@@ -1429,78 +1433,78 @@ function updatePendingSignal(e) {
|
|
|
1429
1433
|
mergeLanes(t, e);
|
|
1430
1434
|
}
|
|
1431
1435
|
}
|
|
1432
|
-
|
|
1436
|
+
W.delete(n);
|
|
1433
1437
|
n.re = undefined;
|
|
1434
1438
|
}
|
|
1435
1439
|
}
|
|
1436
1440
|
}
|
|
1437
1441
|
function getLatestValueComputed(e) {
|
|
1438
1442
|
if (!e._e) {
|
|
1439
|
-
const t =
|
|
1440
|
-
|
|
1441
|
-
const n =
|
|
1442
|
-
|
|
1443
|
-
const r =
|
|
1444
|
-
|
|
1443
|
+
const t = M;
|
|
1444
|
+
M = false;
|
|
1445
|
+
const n = Q;
|
|
1446
|
+
Q = false;
|
|
1447
|
+
const r = q;
|
|
1448
|
+
q = null;
|
|
1445
1449
|
e._e = optimisticComputed(() => read(e));
|
|
1446
1450
|
e._e.he = e;
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1451
|
+
q = r;
|
|
1452
|
+
Q = n;
|
|
1453
|
+
M = t;
|
|
1450
1454
|
}
|
|
1451
1455
|
return e._e;
|
|
1452
1456
|
}
|
|
1453
1457
|
function staleValues(e, t = true) {
|
|
1454
|
-
const n =
|
|
1455
|
-
|
|
1458
|
+
const n = R;
|
|
1459
|
+
R = t;
|
|
1456
1460
|
try {
|
|
1457
1461
|
return e();
|
|
1458
1462
|
} finally {
|
|
1459
|
-
|
|
1463
|
+
R = n;
|
|
1460
1464
|
}
|
|
1461
1465
|
}
|
|
1462
1466
|
function latest(e) {
|
|
1463
|
-
const t =
|
|
1464
|
-
|
|
1467
|
+
const t = M;
|
|
1468
|
+
M = true;
|
|
1465
1469
|
try {
|
|
1466
1470
|
return e();
|
|
1467
1471
|
} finally {
|
|
1468
|
-
|
|
1472
|
+
M = t;
|
|
1469
1473
|
}
|
|
1470
1474
|
}
|
|
1471
1475
|
function isPending(e) {
|
|
1472
|
-
const t =
|
|
1473
|
-
const n =
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
+
const t = Q;
|
|
1477
|
+
const n = T;
|
|
1478
|
+
Q = true;
|
|
1479
|
+
T = false;
|
|
1476
1480
|
try {
|
|
1477
1481
|
e();
|
|
1478
|
-
return
|
|
1482
|
+
return T;
|
|
1479
1483
|
} catch {
|
|
1480
|
-
return
|
|
1484
|
+
return T;
|
|
1481
1485
|
} finally {
|
|
1482
|
-
|
|
1483
|
-
|
|
1486
|
+
Q = t;
|
|
1487
|
+
T = n;
|
|
1484
1488
|
}
|
|
1485
1489
|
}
|
|
1486
1490
|
function refresh(e) {
|
|
1487
|
-
let t =
|
|
1488
|
-
|
|
1491
|
+
let t = H;
|
|
1492
|
+
H = true;
|
|
1489
1493
|
try {
|
|
1490
1494
|
if (typeof e !== "function") {
|
|
1491
|
-
recompute(e[
|
|
1495
|
+
recompute(e[O]);
|
|
1492
1496
|
return e;
|
|
1493
1497
|
}
|
|
1494
1498
|
return untrack(e);
|
|
1495
1499
|
} finally {
|
|
1496
|
-
|
|
1500
|
+
H = t;
|
|
1497
1501
|
if (!t) {
|
|
1498
1502
|
schedule();
|
|
1499
1503
|
}
|
|
1500
1504
|
}
|
|
1501
1505
|
}
|
|
1502
1506
|
function isRefreshing() {
|
|
1503
|
-
return
|
|
1507
|
+
return H;
|
|
1504
1508
|
}
|
|
1505
1509
|
function createContext(e, t) {
|
|
1506
1510
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1528,7 +1532,7 @@ function isUndefined(e) {
|
|
|
1528
1532
|
return typeof e === "undefined";
|
|
1529
1533
|
}
|
|
1530
1534
|
function restoreTransition(e, t) {
|
|
1531
|
-
|
|
1535
|
+
j.initTransition(e);
|
|
1532
1536
|
const n = t();
|
|
1533
1537
|
flush();
|
|
1534
1538
|
return n;
|
|
@@ -1537,8 +1541,8 @@ function action(e) {
|
|
|
1537
1541
|
return (...t) =>
|
|
1538
1542
|
new Promise((n, r) => {
|
|
1539
1543
|
const i = e(...t);
|
|
1540
|
-
|
|
1541
|
-
let s =
|
|
1544
|
+
j.initTransition();
|
|
1545
|
+
let s = A;
|
|
1542
1546
|
s.ee.push(i);
|
|
1543
1547
|
const done = (e, t) => {
|
|
1544
1548
|
s = currentTransition(s);
|
|
@@ -1634,13 +1638,13 @@ function createOptimistic(e, t, n) {
|
|
|
1634
1638
|
function onSettled(e) {
|
|
1635
1639
|
getOwner()
|
|
1636
1640
|
? createTrackedEffect(() => untrack(e))
|
|
1637
|
-
:
|
|
1641
|
+
: j.enqueue(y, () => {
|
|
1638
1642
|
const t = e();
|
|
1639
1643
|
t?.();
|
|
1640
1644
|
});
|
|
1641
1645
|
}
|
|
1642
1646
|
function unwrap(e) {
|
|
1643
|
-
return e?.[
|
|
1647
|
+
return e?.[U]?.[te] ?? e;
|
|
1644
1648
|
}
|
|
1645
1649
|
function getOverrideValue(e, t, n, r, i) {
|
|
1646
1650
|
if (i && r in i) return i[r];
|
|
@@ -1652,16 +1656,16 @@ function getAllKeys(e, t, n) {
|
|
|
1652
1656
|
return Array.from(new Set([...r, ...i]));
|
|
1653
1657
|
}
|
|
1654
1658
|
function applyState(e, t, n, r) {
|
|
1655
|
-
const i = t?.[
|
|
1659
|
+
const i = t?.[U];
|
|
1656
1660
|
if (!i) return;
|
|
1657
|
-
const s = i[
|
|
1658
|
-
const o = i[
|
|
1659
|
-
const u = i[
|
|
1660
|
-
let f = i[
|
|
1661
|
+
const s = i[Z];
|
|
1662
|
+
const o = i[$];
|
|
1663
|
+
const u = i[ee];
|
|
1664
|
+
let f = i[te];
|
|
1661
1665
|
if (e === s && !o && !u) return;
|
|
1662
|
-
(i[
|
|
1663
|
-
i[
|
|
1664
|
-
i[
|
|
1666
|
+
(i[ie] || ue).set(e, i[J]);
|
|
1667
|
+
i[Z] = e;
|
|
1668
|
+
i[$] = undefined;
|
|
1665
1669
|
if (Array.isArray(s)) {
|
|
1666
1670
|
let t = false;
|
|
1667
1671
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
@@ -1676,7 +1680,7 @@ function applyState(e, t, n, r) {
|
|
|
1676
1680
|
applyState(e[d], wrap(y, i), n, r);
|
|
1677
1681
|
}
|
|
1678
1682
|
const w = new Array(e.length),
|
|
1679
|
-
|
|
1683
|
+
m = new Map();
|
|
1680
1684
|
for (
|
|
1681
1685
|
p = l - 1, h = e.length - 1;
|
|
1682
1686
|
p >= d &&
|
|
@@ -1689,59 +1693,59 @@ function applyState(e, t, n, r) {
|
|
|
1689
1693
|
if (d > h || d > p) {
|
|
1690
1694
|
for (a = d; a <= h; a++) {
|
|
1691
1695
|
t = true;
|
|
1692
|
-
i[
|
|
1696
|
+
i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1693
1697
|
}
|
|
1694
1698
|
for (; a < e.length; a++) {
|
|
1695
1699
|
t = true;
|
|
1696
1700
|
const s = wrap(w[a], i);
|
|
1697
|
-
i[
|
|
1701
|
+
i[te][a] && setSignal(i[te][a], s);
|
|
1698
1702
|
applyState(e[a], s, n, r);
|
|
1699
1703
|
}
|
|
1700
|
-
t && i[
|
|
1701
|
-
l !== e.length && i[
|
|
1704
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1705
|
+
l !== e.length && i[te].length && setSignal(i[te].length, e.length);
|
|
1702
1706
|
return;
|
|
1703
1707
|
}
|
|
1704
1708
|
g = new Array(h + 1);
|
|
1705
1709
|
for (a = h; a >= d; a--) {
|
|
1706
1710
|
y = e[a];
|
|
1707
1711
|
S = y ? n(y) : y;
|
|
1708
|
-
c =
|
|
1712
|
+
c = m.get(S);
|
|
1709
1713
|
g[a] = c === undefined ? -1 : c;
|
|
1710
|
-
|
|
1714
|
+
m.set(S, a);
|
|
1711
1715
|
}
|
|
1712
1716
|
for (c = d; c <= p; c++) {
|
|
1713
1717
|
y = getOverrideValue(s, o, f, c, u);
|
|
1714
1718
|
S = y ? n(y) : y;
|
|
1715
|
-
a =
|
|
1719
|
+
a = m.get(S);
|
|
1716
1720
|
if (a !== undefined && a !== -1) {
|
|
1717
1721
|
w[a] = y;
|
|
1718
1722
|
a = g[a];
|
|
1719
|
-
|
|
1723
|
+
m.set(S, a);
|
|
1720
1724
|
}
|
|
1721
1725
|
}
|
|
1722
1726
|
for (a = d; a < e.length; a++) {
|
|
1723
1727
|
if (a in w) {
|
|
1724
1728
|
const t = wrap(w[a], i);
|
|
1725
|
-
i[
|
|
1729
|
+
i[te][a] && setSignal(i[te][a], t);
|
|
1726
1730
|
applyState(e[a], t, n, r);
|
|
1727
|
-
} else i[
|
|
1731
|
+
} else i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1728
1732
|
}
|
|
1729
1733
|
if (d < e.length) t = true;
|
|
1730
1734
|
} else if (e.length) {
|
|
1731
1735
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1732
1736
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1733
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1737
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[te][t] && setSignal(i[te][t], e[t]);
|
|
1734
1738
|
}
|
|
1735
1739
|
}
|
|
1736
1740
|
if (l !== e.length) {
|
|
1737
1741
|
t = true;
|
|
1738
|
-
i[
|
|
1742
|
+
i[te].length && setSignal(i[te].length, e.length);
|
|
1739
1743
|
}
|
|
1740
|
-
t && i[
|
|
1744
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1741
1745
|
return;
|
|
1742
1746
|
}
|
|
1743
1747
|
if (f) {
|
|
1744
|
-
const t = f[
|
|
1748
|
+
const t = f[K];
|
|
1745
1749
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1746
1750
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1747
1751
|
const a = l[c];
|
|
@@ -1755,7 +1759,7 @@ function applyState(e, t, n, r) {
|
|
|
1755
1759
|
} else applyState(h, wrap(p, i), n, r);
|
|
1756
1760
|
}
|
|
1757
1761
|
}
|
|
1758
|
-
if ((f = i[
|
|
1762
|
+
if ((f = i[ne])) {
|
|
1759
1763
|
const t = Object.keys(f);
|
|
1760
1764
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1761
1765
|
const r = t[n];
|
|
@@ -1777,9 +1781,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1777
1781
|
let r;
|
|
1778
1782
|
const i = new WeakMap();
|
|
1779
1783
|
const wrapper = e => {
|
|
1780
|
-
e[
|
|
1781
|
-
e[
|
|
1782
|
-
Object.defineProperty(e,
|
|
1784
|
+
e[re] = wrapProjection;
|
|
1785
|
+
e[ie] = i;
|
|
1786
|
+
Object.defineProperty(e, se, {
|
|
1783
1787
|
get() {
|
|
1784
1788
|
return r;
|
|
1785
1789
|
},
|
|
@@ -1788,15 +1792,15 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1788
1792
|
};
|
|
1789
1793
|
const wrapProjection = e => {
|
|
1790
1794
|
if (i.has(e)) return i.get(e);
|
|
1791
|
-
if (e[
|
|
1792
|
-
const t = createStoreProxy(e,
|
|
1795
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
1796
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
1793
1797
|
i.set(e, t);
|
|
1794
1798
|
return t;
|
|
1795
1799
|
};
|
|
1796
1800
|
const s = wrapProjection(t);
|
|
1797
1801
|
r = computed(() => {
|
|
1798
1802
|
const t = getOwner();
|
|
1799
|
-
storeSetter(new Proxy(s,
|
|
1803
|
+
storeSetter(new Proxy(s, G), r => {
|
|
1800
1804
|
const i = handleAsync(t, e(r), e => {
|
|
1801
1805
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1802
1806
|
setSignal(t, undefined);
|
|
@@ -1810,7 +1814,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1810
1814
|
function createProjection(e, t = {}, n) {
|
|
1811
1815
|
return createProjectionInternal(e, t, n).store;
|
|
1812
1816
|
}
|
|
1813
|
-
const
|
|
1817
|
+
const G = {
|
|
1814
1818
|
get(e, t) {
|
|
1815
1819
|
let n;
|
|
1816
1820
|
setWriteOverride(true);
|
|
@@ -1821,7 +1825,7 @@ const B = {
|
|
|
1821
1825
|
setWriteOverride(false);
|
|
1822
1826
|
setProjectionWriteActive(false);
|
|
1823
1827
|
}
|
|
1824
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1828
|
+
return typeof n === "object" && n !== null ? new Proxy(n, G) : n;
|
|
1825
1829
|
},
|
|
1826
1830
|
set(e, t, n) {
|
|
1827
1831
|
setWriteOverride(true);
|
|
@@ -1846,46 +1850,46 @@ const B = {
|
|
|
1846
1850
|
return true;
|
|
1847
1851
|
}
|
|
1848
1852
|
};
|
|
1849
|
-
const
|
|
1850
|
-
K = Symbol(0),
|
|
1853
|
+
const K = Symbol(0),
|
|
1851
1854
|
z = Symbol(0),
|
|
1852
1855
|
U = Symbol(0),
|
|
1853
|
-
J = Symbol(0)
|
|
1854
|
-
|
|
1855
|
-
const Y =
|
|
1856
|
-
|
|
1857
|
-
$ = "
|
|
1858
|
-
ee = "
|
|
1859
|
-
te = "
|
|
1860
|
-
ne = "
|
|
1861
|
-
re = "
|
|
1862
|
-
ie = "
|
|
1863
|
-
se = "
|
|
1864
|
-
|
|
1856
|
+
J = Symbol(0),
|
|
1857
|
+
X = Symbol(0);
|
|
1858
|
+
const Y = new WeakMap();
|
|
1859
|
+
const Z = "v",
|
|
1860
|
+
$ = "o",
|
|
1861
|
+
ee = "x",
|
|
1862
|
+
te = "n",
|
|
1863
|
+
ne = "h",
|
|
1864
|
+
re = "w",
|
|
1865
|
+
ie = "l",
|
|
1866
|
+
se = "f",
|
|
1867
|
+
oe = "p";
|
|
1868
|
+
function createStoreProxy(e, t = ce, n) {
|
|
1865
1869
|
let r;
|
|
1866
1870
|
if (Array.isArray(e)) {
|
|
1867
1871
|
r = [];
|
|
1868
1872
|
r.v = e;
|
|
1869
1873
|
} else r = { v: e };
|
|
1870
1874
|
n && n(r);
|
|
1871
|
-
return (r[
|
|
1875
|
+
return (r[J] = new Proxy(r, t));
|
|
1872
1876
|
}
|
|
1873
|
-
const
|
|
1877
|
+
const ue = new WeakMap();
|
|
1874
1878
|
function wrap(e, t) {
|
|
1875
|
-
if (t?.[
|
|
1876
|
-
let n = e[
|
|
1877
|
-
if (!n)
|
|
1879
|
+
if (t?.[re]) return t[re](e, t);
|
|
1880
|
+
let n = e[J] || ue.get(e);
|
|
1881
|
+
if (!n) ue.set(e, (n = createStoreProxy(e)));
|
|
1878
1882
|
return n;
|
|
1879
1883
|
}
|
|
1880
1884
|
function isWrappable(e) {
|
|
1881
1885
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1882
1886
|
}
|
|
1883
|
-
let
|
|
1887
|
+
let fe = false;
|
|
1884
1888
|
function setWriteOverride(e) {
|
|
1885
|
-
|
|
1889
|
+
fe = e;
|
|
1886
1890
|
}
|
|
1887
1891
|
function writeOnly(e) {
|
|
1888
|
-
return
|
|
1892
|
+
return fe || !!le?.has(e);
|
|
1889
1893
|
}
|
|
1890
1894
|
function getNodes(e, t) {
|
|
1891
1895
|
let n = e[t];
|
|
@@ -1907,13 +1911,13 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1907
1911
|
if (s) u.we = true;
|
|
1908
1912
|
if (o && t in o) {
|
|
1909
1913
|
const e = o[t];
|
|
1910
|
-
u.ie = e === undefined ?
|
|
1911
|
-
|
|
1914
|
+
u.ie = e === undefined ? w : e;
|
|
1915
|
+
D?.add(u);
|
|
1912
1916
|
}
|
|
1913
1917
|
return (e[t] = u);
|
|
1914
1918
|
}
|
|
1915
|
-
function trackSelf(e, t =
|
|
1916
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1919
|
+
function trackSelf(e, t = K) {
|
|
1920
|
+
getObserver() && read(getNode(getNodes(e, te), t, undefined, e[se], false, e[oe]));
|
|
1917
1921
|
}
|
|
1918
1922
|
function getKeys(e, t, n = true) {
|
|
1919
1923
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1921,7 +1925,7 @@ function getKeys(e, t, n = true) {
|
|
|
1921
1925
|
const i = new Set(r);
|
|
1922
1926
|
const s = Reflect.ownKeys(t);
|
|
1923
1927
|
for (const e of s) {
|
|
1924
|
-
if (t[e] !==
|
|
1928
|
+
if (t[e] !== X) i.add(e);
|
|
1925
1929
|
else i.delete(e);
|
|
1926
1930
|
}
|
|
1927
1931
|
return Array.from(i);
|
|
@@ -1929,97 +1933,97 @@ function getKeys(e, t, n = true) {
|
|
|
1929
1933
|
function getPropertyDescriptor(e, t, n) {
|
|
1930
1934
|
let r = e;
|
|
1931
1935
|
if (t && n in t) {
|
|
1932
|
-
if (r[n] ===
|
|
1936
|
+
if (r[n] === X) return void 0;
|
|
1933
1937
|
if (!(n in r)) r = t;
|
|
1934
1938
|
}
|
|
1935
1939
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1936
1940
|
}
|
|
1937
|
-
let
|
|
1938
|
-
const
|
|
1941
|
+
let le = null;
|
|
1942
|
+
const ce = {
|
|
1939
1943
|
get(e, t, n) {
|
|
1940
|
-
if (t ===
|
|
1941
|
-
if (t ===
|
|
1942
|
-
if (t ===
|
|
1943
|
-
if (t ===
|
|
1944
|
+
if (t === U) return e;
|
|
1945
|
+
if (t === J) return n;
|
|
1946
|
+
if (t === O) return e[se];
|
|
1947
|
+
if (t === K || t === z) {
|
|
1944
1948
|
trackSelf(e, t);
|
|
1945
1949
|
return n;
|
|
1946
1950
|
}
|
|
1947
|
-
const r = getNodes(e,
|
|
1951
|
+
const r = getNodes(e, te);
|
|
1948
1952
|
const i = r[t];
|
|
1949
|
-
const s = e[
|
|
1950
|
-
const o = s || (e[
|
|
1951
|
-
const u = !!e[
|
|
1952
|
-
const f = s ? e[
|
|
1953
|
+
const s = e[ee] && t in e[ee];
|
|
1954
|
+
const o = s || (e[$] && t in e[$]);
|
|
1955
|
+
const u = !!e[Z][U];
|
|
1956
|
+
const f = s ? e[ee] : e[$] && t in e[$] ? e[$] : e[Z];
|
|
1953
1957
|
if (!i) {
|
|
1954
1958
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1955
1959
|
if (e && e.get) return e.get.call(n);
|
|
1956
1960
|
}
|
|
1957
1961
|
if (writeOnly(n)) {
|
|
1958
|
-
let n = i && (o || !u) ? (i.ce !==
|
|
1959
|
-
n ===
|
|
1962
|
+
let n = i && (o || !u) ? (i.ce !== S ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1963
|
+
n === X && (n = undefined);
|
|
1960
1964
|
if (!isWrappable(n)) return n;
|
|
1961
1965
|
const r = wrap(n, e);
|
|
1962
|
-
|
|
1966
|
+
le?.add(r);
|
|
1963
1967
|
return r;
|
|
1964
1968
|
}
|
|
1965
1969
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1966
|
-
l ===
|
|
1970
|
+
l === X && (l = undefined);
|
|
1967
1971
|
if (!i) {
|
|
1968
1972
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1969
1973
|
let t;
|
|
1970
|
-
return !Array.isArray(e[
|
|
1974
|
+
return !Array.isArray(e[Z]) && (t = Object.getPrototypeOf(e[Z])) && t !== Object.prototype
|
|
1971
1975
|
? l.bind(f)
|
|
1972
1976
|
: l;
|
|
1973
1977
|
} else if (getObserver()) {
|
|
1974
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1978
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[se], isEqual, e[oe], e[m]));
|
|
1975
1979
|
}
|
|
1976
1980
|
}
|
|
1977
1981
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1978
1982
|
},
|
|
1979
1983
|
has(e, t) {
|
|
1980
|
-
if (t ===
|
|
1981
|
-
const n = e[
|
|
1982
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1984
|
+
if (t === J || t === K || t === "__proto__") return true;
|
|
1985
|
+
const n = e[ee] && t in e[ee] ? e[ee][t] !== X : e[$] && t in e[$] ? e[$][t] !== X : t in e[Z];
|
|
1986
|
+
getObserver() && read(getNode(getNodes(e, ne), t, n, e[se], isEqual, e[oe]));
|
|
1983
1987
|
return n;
|
|
1984
1988
|
},
|
|
1985
1989
|
set(e, t, n) {
|
|
1986
|
-
const r = e[
|
|
1990
|
+
const r = e[J];
|
|
1987
1991
|
if (writeOnly(r)) {
|
|
1988
|
-
if (e[
|
|
1989
|
-
const t = e[
|
|
1992
|
+
if (e[oe]) {
|
|
1993
|
+
const t = e[se];
|
|
1990
1994
|
if (t?.ne) {
|
|
1991
|
-
|
|
1995
|
+
j.initTransition(t.ne);
|
|
1992
1996
|
}
|
|
1993
1997
|
}
|
|
1994
1998
|
untrack(() => {
|
|
1995
|
-
const i = e[
|
|
1999
|
+
const i = e[Z];
|
|
1996
2000
|
const s = i[t];
|
|
1997
|
-
if (
|
|
1998
|
-
if (!e[
|
|
1999
|
-
e[
|
|
2000
|
-
|
|
2001
|
+
if (V && typeof t !== "symbol") {
|
|
2002
|
+
if (!e[m]) {
|
|
2003
|
+
e[m] = Object.create(null);
|
|
2004
|
+
D?.add(e);
|
|
2001
2005
|
}
|
|
2002
|
-
if (!(t in e[
|
|
2003
|
-
e[
|
|
2006
|
+
if (!(t in e[m])) {
|
|
2007
|
+
e[m][t] = s;
|
|
2004
2008
|
}
|
|
2005
2009
|
}
|
|
2006
|
-
const o = e[
|
|
2007
|
-
const u = o ?
|
|
2010
|
+
const o = e[oe] && !E;
|
|
2011
|
+
const u = o ? ee : $;
|
|
2008
2012
|
if (o) trackOptimisticStore(r);
|
|
2009
|
-
const f = e[
|
|
2010
|
-
const l = n?.[
|
|
2013
|
+
const f = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : s;
|
|
2014
|
+
const l = n?.[U]?.[Z] ?? n;
|
|
2011
2015
|
if (f === l) return true;
|
|
2012
|
-
const c = e[
|
|
2016
|
+
const c = e[ee]?.length || e[$]?.length || i.length;
|
|
2013
2017
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2014
2018
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2015
2019
|
const a = isWrappable(l);
|
|
2016
2020
|
if (isWrappable(f)) {
|
|
2017
|
-
const e =
|
|
2018
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2021
|
+
const e = Y.get(f);
|
|
2022
|
+
e && (e instanceof Set ? e.delete(r) : Y.delete(f));
|
|
2019
2023
|
}
|
|
2020
|
-
if (recursivelyNotify(r,
|
|
2021
|
-
e[
|
|
2022
|
-
const d = getNodes(e,
|
|
2024
|
+
if (recursivelyNotify(r, ue) && a) recursivelyAddParent(l, r);
|
|
2025
|
+
e[ne]?.[t] && setSignal(e[ne][t], true);
|
|
2026
|
+
const d = getNodes(e, te);
|
|
2023
2027
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2024
2028
|
if (Array.isArray(i)) {
|
|
2025
2029
|
if (t === "length") {
|
|
@@ -2029,44 +2033,44 @@ const le = {
|
|
|
2029
2033
|
if (e > c) d.length && setSignal(d.length, e);
|
|
2030
2034
|
}
|
|
2031
2035
|
}
|
|
2032
|
-
d[
|
|
2036
|
+
d[K] && setSignal(d[K], undefined);
|
|
2033
2037
|
});
|
|
2034
2038
|
}
|
|
2035
2039
|
return true;
|
|
2036
2040
|
},
|
|
2037
2041
|
deleteProperty(e, t) {
|
|
2038
|
-
const n = e[
|
|
2039
|
-
const r = e[
|
|
2040
|
-
if (writeOnly(e[
|
|
2042
|
+
const n = e[ee]?.[t] === X;
|
|
2043
|
+
const r = e[$]?.[t] === X;
|
|
2044
|
+
if (writeOnly(e[J]) && !n && !r) {
|
|
2041
2045
|
untrack(() => {
|
|
2042
|
-
const n = e[
|
|
2043
|
-
const r = n ?
|
|
2044
|
-
if (n) trackOptimisticStore(e[
|
|
2045
|
-
const i = e[
|
|
2046
|
-
if (t in e[
|
|
2047
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2046
|
+
const n = e[oe] && !E;
|
|
2047
|
+
const r = n ? ee : $;
|
|
2048
|
+
if (n) trackOptimisticStore(e[J]);
|
|
2049
|
+
const i = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : e[Z][t];
|
|
2050
|
+
if (t in e[Z] || (e[$] && t in e[$])) {
|
|
2051
|
+
(e[r] || (e[r] = Object.create(null)))[t] = X;
|
|
2048
2052
|
} else if (e[r] && t in e[r]) {
|
|
2049
2053
|
delete e[r][t];
|
|
2050
2054
|
} else return true;
|
|
2051
2055
|
if (isWrappable(i)) {
|
|
2052
|
-
const t =
|
|
2053
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2056
|
+
const t = Y.get(i);
|
|
2057
|
+
t && (t instanceof Set ? t.delete(e) : Y.delete(i));
|
|
2054
2058
|
}
|
|
2055
|
-
if (e[
|
|
2056
|
-
const s = getNodes(e,
|
|
2059
|
+
if (e[ne]?.[t]) setSignal(e[ne][t], false);
|
|
2060
|
+
const s = getNodes(e, te);
|
|
2057
2061
|
s[t] && setSignal(s[t], undefined);
|
|
2058
|
-
s[
|
|
2062
|
+
s[K] && setSignal(s[K], undefined);
|
|
2059
2063
|
});
|
|
2060
2064
|
}
|
|
2061
2065
|
return true;
|
|
2062
2066
|
},
|
|
2063
2067
|
ownKeys(e) {
|
|
2064
2068
|
trackSelf(e);
|
|
2065
|
-
let t = getKeys(e[
|
|
2066
|
-
if (e[
|
|
2069
|
+
let t = getKeys(e[Z], e[$], false);
|
|
2070
|
+
if (e[ee]) {
|
|
2067
2071
|
const n = new Set(t);
|
|
2068
|
-
for (const t of Reflect.ownKeys(e[
|
|
2069
|
-
if (e[
|
|
2072
|
+
for (const t of Reflect.ownKeys(e[ee])) {
|
|
2073
|
+
if (e[ee][t] !== X) n.add(t);
|
|
2070
2074
|
else n.delete(t);
|
|
2071
2075
|
}
|
|
2072
2076
|
t = Array.from(n);
|
|
@@ -2074,25 +2078,25 @@ const le = {
|
|
|
2074
2078
|
return t;
|
|
2075
2079
|
},
|
|
2076
2080
|
getOwnPropertyDescriptor(e, t) {
|
|
2077
|
-
if (t ===
|
|
2078
|
-
if (e[
|
|
2079
|
-
if (e[
|
|
2080
|
-
const n = getPropertyDescriptor(e[
|
|
2081
|
+
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2082
|
+
if (e[ee] && t in e[ee]) {
|
|
2083
|
+
if (e[ee][t] === X) return undefined;
|
|
2084
|
+
const n = getPropertyDescriptor(e[Z], e[$], t);
|
|
2081
2085
|
if (n) {
|
|
2082
|
-
return { ...n, value: e[
|
|
2086
|
+
return { ...n, value: e[ee][t] };
|
|
2083
2087
|
}
|
|
2084
|
-
return { value: e[
|
|
2088
|
+
return { value: e[ee][t], writable: true, enumerable: true, configurable: true };
|
|
2085
2089
|
}
|
|
2086
|
-
return getPropertyDescriptor(e[
|
|
2090
|
+
return getPropertyDescriptor(e[Z], e[$], t);
|
|
2087
2091
|
},
|
|
2088
2092
|
getPrototypeOf(e) {
|
|
2089
|
-
return Object.getPrototypeOf(e[
|
|
2093
|
+
return Object.getPrototypeOf(e[Z]);
|
|
2090
2094
|
}
|
|
2091
2095
|
};
|
|
2092
2096
|
function storeSetter(e, t) {
|
|
2093
|
-
const n =
|
|
2094
|
-
|
|
2095
|
-
|
|
2097
|
+
const n = le;
|
|
2098
|
+
le = new Set();
|
|
2099
|
+
le.add(e);
|
|
2096
2100
|
try {
|
|
2097
2101
|
const n = t(e);
|
|
2098
2102
|
if (n !== e && n !== undefined) {
|
|
@@ -2108,8 +2112,8 @@ function storeSetter(e, t) {
|
|
|
2108
2112
|
}
|
|
2109
2113
|
}
|
|
2110
2114
|
} finally {
|
|
2111
|
-
|
|
2112
|
-
|
|
2115
|
+
le.clear();
|
|
2116
|
+
le = n;
|
|
2113
2117
|
}
|
|
2114
2118
|
}
|
|
2115
2119
|
function createStore(e, t, n) {
|
|
@@ -2118,17 +2122,17 @@ function createStore(e, t, n) {
|
|
|
2118
2122
|
return [i, e => storeSetter(i, e)];
|
|
2119
2123
|
}
|
|
2120
2124
|
function recursivelyNotify(e, t) {
|
|
2121
|
-
let n = e[
|
|
2125
|
+
let n = e[U] || t?.get(e)?.[U];
|
|
2122
2126
|
let r = false;
|
|
2123
2127
|
if (n) {
|
|
2124
|
-
const e = getNodes(n,
|
|
2128
|
+
const e = getNodes(n, te)[z];
|
|
2125
2129
|
if (e) {
|
|
2126
2130
|
setSignal(e, undefined);
|
|
2127
2131
|
r = true;
|
|
2128
2132
|
}
|
|
2129
|
-
t = n[
|
|
2133
|
+
t = n[ie] || t;
|
|
2130
2134
|
}
|
|
2131
|
-
const i =
|
|
2135
|
+
const i = Y.get(n?.[Z] || e);
|
|
2132
2136
|
if (!i) return r;
|
|
2133
2137
|
if (i instanceof Set) {
|
|
2134
2138
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2137,16 +2141,16 @@ function recursivelyNotify(e, t) {
|
|
|
2137
2141
|
}
|
|
2138
2142
|
function recursivelyAddParent(e, t) {
|
|
2139
2143
|
let n;
|
|
2140
|
-
const r = e[
|
|
2144
|
+
const r = e[U];
|
|
2141
2145
|
if (r) {
|
|
2142
|
-
n = r[
|
|
2143
|
-
e = r[
|
|
2146
|
+
n = r[$];
|
|
2147
|
+
e = r[Z];
|
|
2144
2148
|
}
|
|
2145
2149
|
if (t) {
|
|
2146
|
-
let n =
|
|
2147
|
-
if (!n)
|
|
2150
|
+
let n = Y.get(e);
|
|
2151
|
+
if (!n) Y.set(e, t);
|
|
2148
2152
|
else if (n !== t) {
|
|
2149
|
-
if (!(n instanceof Set))
|
|
2153
|
+
if (!(n instanceof Set)) Y.set(e, (n = new Set([n])));
|
|
2150
2154
|
else if (n.has(t)) return;
|
|
2151
2155
|
n.add(t);
|
|
2152
2156
|
} else return;
|
|
@@ -2168,7 +2172,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2168
2172
|
}
|
|
2169
2173
|
function deep(e) {
|
|
2170
2174
|
recursivelyAddParent(e);
|
|
2171
|
-
return e[
|
|
2175
|
+
return e[z];
|
|
2172
2176
|
}
|
|
2173
2177
|
function createOptimisticStore(e, t, n) {
|
|
2174
2178
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2179,39 +2183,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2179
2183
|
return [o, e => storeSetter(o, e)];
|
|
2180
2184
|
}
|
|
2181
2185
|
function clearOptimisticStore(e) {
|
|
2182
|
-
const t = e[
|
|
2183
|
-
if (!t || !t[
|
|
2184
|
-
const n = t[
|
|
2185
|
-
const r = t[
|
|
2186
|
+
const t = e[U];
|
|
2187
|
+
if (!t || !t[ee]) return;
|
|
2188
|
+
const n = t[ee];
|
|
2189
|
+
const r = t[te];
|
|
2186
2190
|
setProjectionWriteActive(true);
|
|
2187
2191
|
try {
|
|
2188
2192
|
if (r) {
|
|
2189
2193
|
for (const e of Reflect.ownKeys(n)) {
|
|
2190
2194
|
if (r[e]) {
|
|
2191
2195
|
r[e].re = undefined;
|
|
2192
|
-
const n = t[
|
|
2193
|
-
const i = n ===
|
|
2196
|
+
const n = t[$] && e in t[$] ? t[$][e] : t[Z][e];
|
|
2197
|
+
const i = n === X ? undefined : n;
|
|
2194
2198
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2195
2199
|
}
|
|
2196
2200
|
}
|
|
2197
|
-
if (r[
|
|
2198
|
-
r[
|
|
2199
|
-
setSignal(r[
|
|
2201
|
+
if (r[K]) {
|
|
2202
|
+
r[K].re = undefined;
|
|
2203
|
+
setSignal(r[K], undefined);
|
|
2200
2204
|
}
|
|
2201
2205
|
}
|
|
2202
2206
|
} finally {
|
|
2203
2207
|
setProjectionWriteActive(false);
|
|
2204
2208
|
}
|
|
2205
|
-
delete t[
|
|
2209
|
+
delete t[ee];
|
|
2206
2210
|
}
|
|
2207
2211
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2208
2212
|
let r;
|
|
2209
2213
|
const i = new WeakMap();
|
|
2210
2214
|
const wrapper = e => {
|
|
2211
|
-
e[
|
|
2212
|
-
e[
|
|
2213
|
-
e[
|
|
2214
|
-
Object.defineProperty(e,
|
|
2215
|
+
e[re] = wrapProjection;
|
|
2216
|
+
e[ie] = i;
|
|
2217
|
+
e[oe] = true;
|
|
2218
|
+
Object.defineProperty(e, se, {
|
|
2215
2219
|
get() {
|
|
2216
2220
|
return r;
|
|
2217
2221
|
},
|
|
@@ -2220,8 +2224,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2220
2224
|
};
|
|
2221
2225
|
const wrapProjection = e => {
|
|
2222
2226
|
if (i.has(e)) return i.get(e);
|
|
2223
|
-
if (e[
|
|
2224
|
-
const t = createStoreProxy(e,
|
|
2227
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
2228
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
2225
2229
|
i.set(e, t);
|
|
2226
2230
|
return t;
|
|
2227
2231
|
};
|
|
@@ -2231,7 +2235,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2231
2235
|
const t = getOwner();
|
|
2232
2236
|
setProjectionWriteActive(true);
|
|
2233
2237
|
try {
|
|
2234
|
-
storeSetter(new Proxy(s,
|
|
2238
|
+
storeSetter(new Proxy(s, G), r => {
|
|
2235
2239
|
const i = handleAsync(t, e(r), e => {
|
|
2236
2240
|
setProjectionWriteActive(true);
|
|
2237
2241
|
try {
|
|
@@ -2250,7 +2254,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2250
2254
|
}
|
|
2251
2255
|
return { store: s, node: r };
|
|
2252
2256
|
}
|
|
2253
|
-
const
|
|
2257
|
+
const ae = Symbol(0);
|
|
2254
2258
|
function updatePath(e, t, n = 0) {
|
|
2255
2259
|
let r,
|
|
2256
2260
|
i = e;
|
|
@@ -2294,7 +2298,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2294
2298
|
if (s === i) return;
|
|
2295
2299
|
}
|
|
2296
2300
|
if (r === undefined && s == undefined) return;
|
|
2297
|
-
if (s ===
|
|
2301
|
+
if (s === ae) {
|
|
2298
2302
|
delete e[r];
|
|
2299
2303
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2300
2304
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2304,25 +2308,25 @@ function updatePath(e, t, n = 0) {
|
|
|
2304
2308
|
e[r] = s;
|
|
2305
2309
|
}
|
|
2306
2310
|
}
|
|
2307
|
-
const
|
|
2311
|
+
const de = Object.assign(
|
|
2308
2312
|
function storePath(...e) {
|
|
2309
2313
|
return t => {
|
|
2310
2314
|
updatePath(t, e);
|
|
2311
2315
|
};
|
|
2312
2316
|
},
|
|
2313
|
-
{ DELETE:
|
|
2317
|
+
{ DELETE: ae }
|
|
2314
2318
|
);
|
|
2315
2319
|
function snapshot(e, t, n) {
|
|
2316
2320
|
let r, i, s, o, u, f;
|
|
2317
2321
|
if (!isWrappable(e)) return e;
|
|
2318
2322
|
if (t && t.has(e)) return t.get(e);
|
|
2319
2323
|
if (!t) t = new Map();
|
|
2320
|
-
if ((r = e[
|
|
2321
|
-
s = r[
|
|
2322
|
-
i = Array.isArray(r[
|
|
2323
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2324
|
-
e = r[
|
|
2325
|
-
n =
|
|
2324
|
+
if ((r = e[U] || n?.get(e)?.[U])) {
|
|
2325
|
+
s = r[$];
|
|
2326
|
+
i = Array.isArray(r[Z]);
|
|
2327
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Z]))) : r[Z]);
|
|
2328
|
+
e = r[Z];
|
|
2329
|
+
n = ue;
|
|
2326
2330
|
} else {
|
|
2327
2331
|
i = Array.isArray(e);
|
|
2328
2332
|
t.set(e, e);
|
|
@@ -2331,7 +2335,7 @@ function snapshot(e, t, n) {
|
|
|
2331
2335
|
const r = s?.length || e.length;
|
|
2332
2336
|
for (let i = 0; i < r; i++) {
|
|
2333
2337
|
f = s && i in s ? s[i] : e[i];
|
|
2334
|
-
if (f ===
|
|
2338
|
+
if (f === X) continue;
|
|
2335
2339
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2336
2340
|
if (!o) t.set(e, (o = [...e]));
|
|
2337
2341
|
o[i] = u;
|
|
@@ -2358,13 +2362,13 @@ function snapshot(e, t, n) {
|
|
|
2358
2362
|
function trueFn() {
|
|
2359
2363
|
return true;
|
|
2360
2364
|
}
|
|
2361
|
-
const
|
|
2365
|
+
const pe = {
|
|
2362
2366
|
get(e, t, n) {
|
|
2363
|
-
if (t ===
|
|
2367
|
+
if (t === J) return n;
|
|
2364
2368
|
return e.get(t);
|
|
2365
2369
|
},
|
|
2366
2370
|
has(e, t) {
|
|
2367
|
-
if (t ===
|
|
2371
|
+
if (t === J) return true;
|
|
2368
2372
|
return e.has(t);
|
|
2369
2373
|
},
|
|
2370
2374
|
set: trueFn,
|
|
@@ -2387,15 +2391,15 @@ const de = {
|
|
|
2387
2391
|
function resolveSource(e) {
|
|
2388
2392
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2389
2393
|
}
|
|
2390
|
-
const
|
|
2394
|
+
const he = Symbol(0);
|
|
2391
2395
|
function merge(...e) {
|
|
2392
2396
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2393
2397
|
let t = false;
|
|
2394
2398
|
const n = [];
|
|
2395
2399
|
for (let r = 0; r < e.length; r++) {
|
|
2396
2400
|
const i = e[r];
|
|
2397
|
-
t = t || (!!i &&
|
|
2398
|
-
const s = !!i && i[
|
|
2401
|
+
t = t || (!!i && J in i);
|
|
2402
|
+
const s = !!i && i[he];
|
|
2399
2403
|
if (s) n.push(...s);
|
|
2400
2404
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2401
2405
|
}
|
|
@@ -2403,7 +2407,7 @@ function merge(...e) {
|
|
|
2403
2407
|
return new Proxy(
|
|
2404
2408
|
{
|
|
2405
2409
|
get(e) {
|
|
2406
|
-
if (e ===
|
|
2410
|
+
if (e === he) return n;
|
|
2407
2411
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2408
2412
|
const r = resolveSource(n[t]);
|
|
2409
2413
|
if (e in r) return r[e];
|
|
@@ -2421,7 +2425,7 @@ function merge(...e) {
|
|
|
2421
2425
|
return [...new Set(e)];
|
|
2422
2426
|
}
|
|
2423
2427
|
},
|
|
2424
|
-
|
|
2428
|
+
pe
|
|
2425
2429
|
);
|
|
2426
2430
|
}
|
|
2427
2431
|
const r = Object.create(null);
|
|
@@ -2453,12 +2457,12 @@ function merge(...e) {
|
|
|
2453
2457
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2454
2458
|
else o[t] = n.value;
|
|
2455
2459
|
}
|
|
2456
|
-
o[
|
|
2460
|
+
o[he] = n;
|
|
2457
2461
|
return o;
|
|
2458
2462
|
}
|
|
2459
2463
|
function omit(e, ...t) {
|
|
2460
2464
|
const n = new Set(t);
|
|
2461
|
-
if (b &&
|
|
2465
|
+
if (b && J in e) {
|
|
2462
2466
|
return new Proxy(
|
|
2463
2467
|
{
|
|
2464
2468
|
get(t) {
|
|
@@ -2471,7 +2475,7 @@ function omit(e, ...t) {
|
|
|
2471
2475
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2472
2476
|
}
|
|
2473
2477
|
},
|
|
2474
|
-
|
|
2478
|
+
pe
|
|
2475
2479
|
);
|
|
2476
2480
|
}
|
|
2477
2481
|
const r = {};
|
|
@@ -2505,18 +2509,18 @@ function mapArray(e, t, n) {
|
|
|
2505
2509
|
})
|
|
2506
2510
|
);
|
|
2507
2511
|
}
|
|
2508
|
-
const
|
|
2512
|
+
const ye = { pureWrite: true };
|
|
2509
2513
|
function updateKeyedMap() {
|
|
2510
2514
|
const e = this.Ge() || [],
|
|
2511
2515
|
t = e.length;
|
|
2512
|
-
e[
|
|
2516
|
+
e[K];
|
|
2513
2517
|
runWithOwner(this.De, () => {
|
|
2514
2518
|
let n,
|
|
2515
2519
|
r,
|
|
2516
2520
|
i = this.Ye
|
|
2517
2521
|
? () => {
|
|
2518
|
-
this.Ye[r] = signal(e[r],
|
|
2519
|
-
this.Ze && (this.Ze[r] = signal(r,
|
|
2522
|
+
this.Ye[r] = signal(e[r], ye);
|
|
2523
|
+
this.Ze && (this.Ze[r] = signal(r, ye));
|
|
2520
2524
|
return this.ze(
|
|
2521
2525
|
read.bind(null, this.Ye[r]),
|
|
2522
2526
|
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
@@ -2525,7 +2529,7 @@ function updateKeyedMap() {
|
|
|
2525
2529
|
: this.Ze
|
|
2526
2530
|
? () => {
|
|
2527
2531
|
const t = e[r];
|
|
2528
|
-
this.Ze[r] = signal(r,
|
|
2532
|
+
this.Ze[r] = signal(r, ye);
|
|
2529
2533
|
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2530
2534
|
}
|
|
2531
2535
|
: () => {
|
|
@@ -2728,7 +2732,7 @@ class CollectionQueue extends Queue {
|
|
|
2728
2732
|
return super.run(e);
|
|
2729
2733
|
}
|
|
2730
2734
|
notify(e, t, n, r) {
|
|
2731
|
-
if (!(t & this.it) || (this.it &
|
|
2735
|
+
if (!(t & this.it) || (this.it & a && this.ut)) return super.notify(e, t, n, r);
|
|
2732
2736
|
if (n & this.it) {
|
|
2733
2737
|
const t = r?.source || e.Y?.source;
|
|
2734
2738
|
if (t) {
|
|
@@ -2764,10 +2768,10 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2764
2768
|
return read.bind(null, o);
|
|
2765
2769
|
}
|
|
2766
2770
|
function createLoadBoundary(e, t) {
|
|
2767
|
-
return createCollectionBoundary(
|
|
2771
|
+
return createCollectionBoundary(a, e, () => t());
|
|
2768
2772
|
}
|
|
2769
2773
|
function createErrorBoundary(e, t) {
|
|
2770
|
-
return createCollectionBoundary(
|
|
2774
|
+
return createCollectionBoundary(d, e, e => {
|
|
2771
2775
|
let n = e.st.values().next().value;
|
|
2772
2776
|
const r = n.Y?.cause ?? n.Y;
|
|
2773
2777
|
return t(r, () => {
|
|
@@ -2825,9 +2829,9 @@ function flattenArray(e, t = [], n) {
|
|
|
2825
2829
|
if (r) throw r;
|
|
2826
2830
|
return i;
|
|
2827
2831
|
}
|
|
2828
|
-
exports.$PROXY =
|
|
2829
|
-
exports.$TARGET =
|
|
2830
|
-
exports.$TRACK =
|
|
2832
|
+
exports.$PROXY = J;
|
|
2833
|
+
exports.$TARGET = U;
|
|
2834
|
+
exports.$TRACK = K;
|
|
2831
2835
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2832
2836
|
exports.NoOwnerError = NoOwnerError;
|
|
2833
2837
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2879,5 +2883,5 @@ exports.setContext = setContext;
|
|
|
2879
2883
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2880
2884
|
exports.setStrictRead = setStrictRead;
|
|
2881
2885
|
exports.snapshot = snapshot;
|
|
2882
|
-
exports.storePath =
|
|
2886
|
+
exports.storePath = de;
|
|
2883
2887
|
exports.untrack = untrack;
|