@solidjs/signals 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +50 -4
- package/dist/node.cjs +230 -220
- package/dist/prod.js +215 -205
- package/dist/types/core/core.d.ts +2 -0
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/map.d.ts +2 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -132,7 +132,7 @@ function adjustHeight(e, t) {
|
|
|
132
132
|
for (let t = e.j; t; t = t.N) {
|
|
133
133
|
const e = t.L;
|
|
134
134
|
const r = e.I || e;
|
|
135
|
-
if (r.
|
|
135
|
+
if (r.R && r.o >= n) n = r.o + 1;
|
|
136
136
|
}
|
|
137
137
|
if (e.o !== n) {
|
|
138
138
|
e.o = n;
|
|
@@ -150,7 +150,7 @@ let C = false;
|
|
|
150
150
|
let A = false;
|
|
151
151
|
function runLaneEffects(e) {
|
|
152
152
|
for (const t of j) {
|
|
153
|
-
if (t.
|
|
153
|
+
if (t.H || t.T.size > 0) continue;
|
|
154
154
|
const n = t.M[e - 1];
|
|
155
155
|
if (n.length) {
|
|
156
156
|
t.M[e - 1] = [];
|
|
@@ -386,7 +386,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
386
386
|
if (n.oe && n.oe !== y) n.ue = true;
|
|
387
387
|
}
|
|
388
388
|
n.de &= ~d;
|
|
389
|
-
if (n.
|
|
389
|
+
if (n.R) GlobalQueue.U(n, false, true);
|
|
390
390
|
}
|
|
391
391
|
t.length = 0;
|
|
392
392
|
const n = e ? e.B : W.B;
|
|
@@ -413,7 +413,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
413
413
|
for (const t of j) {
|
|
414
414
|
const n = e ? t.ne === e : !t.ne;
|
|
415
415
|
if (!n) continue;
|
|
416
|
-
if (!t.
|
|
416
|
+
if (!t.H) {
|
|
417
417
|
if (t.M[0].length) runQueue(t.M[0], p);
|
|
418
418
|
if (t.M[1].length) runQueue(t.M[1], h);
|
|
419
419
|
}
|
|
@@ -489,21 +489,21 @@ function getOrCreateLane(e) {
|
|
|
489
489
|
}
|
|
490
490
|
const n = e.he;
|
|
491
491
|
const r = n?.re ? findLane(n.re) : null;
|
|
492
|
-
t = { pe: e, T: new Set(), M: [[], []],
|
|
492
|
+
t = { pe: e, T: new Set(), M: [[], []], H: null, ne: k, ye: r };
|
|
493
493
|
E.set(e, t);
|
|
494
494
|
j.add(t);
|
|
495
495
|
e.ge = e.Se || 0;
|
|
496
496
|
return t;
|
|
497
497
|
}
|
|
498
498
|
function findLane(e) {
|
|
499
|
-
while (e.
|
|
499
|
+
while (e.H) e = e.H;
|
|
500
500
|
return e;
|
|
501
501
|
}
|
|
502
502
|
function mergeLanes(e, t) {
|
|
503
503
|
e = findLane(e);
|
|
504
504
|
t = findLane(t);
|
|
505
505
|
if (e === t) return e;
|
|
506
|
-
t.
|
|
506
|
+
t.H = e;
|
|
507
507
|
for (const n of t.T) e.T.add(n);
|
|
508
508
|
e.M[0].push(...t.M[0]);
|
|
509
509
|
e.M[1].push(...t.M[1]);
|
|
@@ -524,7 +524,7 @@ function assignOrMergeLane(e, t) {
|
|
|
524
524
|
const n = findLane(t);
|
|
525
525
|
const r = e.re;
|
|
526
526
|
if (r) {
|
|
527
|
-
if (r.
|
|
527
|
+
if (r.H) {
|
|
528
528
|
e.re = t;
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
@@ -567,7 +567,7 @@ function handleAsync(e, t, r) {
|
|
|
567
567
|
if (r) r(i);
|
|
568
568
|
else if (e.we) {
|
|
569
569
|
const t = e.ce !== g;
|
|
570
|
-
if (e.
|
|
570
|
+
if (e.R) e.ce = i;
|
|
571
571
|
if (!t) {
|
|
572
572
|
e.ae = i;
|
|
573
573
|
insertSubs(e);
|
|
@@ -710,7 +710,7 @@ function unlinkSubs(e) {
|
|
|
710
710
|
t.O = r;
|
|
711
711
|
if (r === null) {
|
|
712
712
|
t.Pe?.();
|
|
713
|
-
t.
|
|
713
|
+
t.R && !t.ke && !(t.m & o) && unobserved(t);
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
return n;
|
|
@@ -837,7 +837,7 @@ function formatId(e, t) {
|
|
|
837
837
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
838
838
|
}
|
|
839
839
|
function getObserver() {
|
|
840
|
-
if (
|
|
840
|
+
if (H || T) return N;
|
|
841
841
|
return L ? M : null;
|
|
842
842
|
}
|
|
843
843
|
function getOwner() {
|
|
@@ -865,7 +865,7 @@ function createOwner(e) {
|
|
|
865
865
|
We: null,
|
|
866
866
|
Le: null,
|
|
867
867
|
fe: t?.fe ?? W,
|
|
868
|
-
|
|
868
|
+
Re: t?.Re || b,
|
|
869
869
|
je: 0,
|
|
870
870
|
Ne: null,
|
|
871
871
|
Ee: null,
|
|
@@ -900,7 +900,7 @@ function effect(e, t, n, r, i) {
|
|
|
900
900
|
},
|
|
901
901
|
lazy: true
|
|
902
902
|
});
|
|
903
|
-
o.
|
|
903
|
+
o.He = r;
|
|
904
904
|
o.Qe = t;
|
|
905
905
|
o.Te = n;
|
|
906
906
|
o.Me = undefined;
|
|
@@ -936,11 +936,11 @@ function runEffect() {
|
|
|
936
936
|
this.Me?.();
|
|
937
937
|
this.Me = undefined;
|
|
938
938
|
try {
|
|
939
|
-
this.Me = this.Qe(this.ae, this.
|
|
939
|
+
this.Me = this.Qe(this.ae, this.He);
|
|
940
940
|
} catch (e) {
|
|
941
941
|
if (!this.fe.notify(this, a, a)) throw e;
|
|
942
942
|
} finally {
|
|
943
|
-
this.
|
|
943
|
+
this.He = this.ae;
|
|
944
944
|
this.ue = false;
|
|
945
945
|
}
|
|
946
946
|
}
|
|
@@ -973,8 +973,8 @@ GlobalQueue.K = recompute;
|
|
|
973
973
|
GlobalQueue.U = disposeChildren;
|
|
974
974
|
let L = false;
|
|
975
975
|
let I = false;
|
|
976
|
-
let H = false;
|
|
977
976
|
let R = false;
|
|
977
|
+
let H = false;
|
|
978
978
|
let Q = false;
|
|
979
979
|
let T = false;
|
|
980
980
|
let M = null;
|
|
@@ -1007,7 +1007,7 @@ function releaseSubtree(e) {
|
|
|
1007
1007
|
t = t.We;
|
|
1008
1008
|
continue;
|
|
1009
1009
|
}
|
|
1010
|
-
if (t.
|
|
1010
|
+
if (t.R) {
|
|
1011
1011
|
const e = t;
|
|
1012
1012
|
e.se = false;
|
|
1013
1013
|
if (e.m & l) {
|
|
@@ -1064,7 +1064,7 @@ function recompute(t, n = false) {
|
|
|
1064
1064
|
if (e) q = e;
|
|
1065
1065
|
}
|
|
1066
1066
|
try {
|
|
1067
|
-
h = handleAsync(t, t.
|
|
1067
|
+
h = handleAsync(t, t.R(h));
|
|
1068
1068
|
clearStatus(t);
|
|
1069
1069
|
const e = resolveLane(t);
|
|
1070
1070
|
if (e) {
|
|
@@ -1133,7 +1133,7 @@ function updateIfNecessary(r) {
|
|
|
1133
1133
|
for (let e = r.j; e; e = e.N) {
|
|
1134
1134
|
const t = e.L;
|
|
1135
1135
|
const i = t.I || t;
|
|
1136
|
-
if (i.
|
|
1136
|
+
if (i.R) {
|
|
1137
1137
|
updateIfNecessary(i);
|
|
1138
1138
|
}
|
|
1139
1139
|
if (r.m & n) {
|
|
@@ -1156,9 +1156,9 @@ function computed(t, n, r) {
|
|
|
1156
1156
|
Pe: r?.unobserved,
|
|
1157
1157
|
Le: null,
|
|
1158
1158
|
fe: M?.fe ?? W,
|
|
1159
|
-
|
|
1159
|
+
Re: M?.Re ?? b,
|
|
1160
1160
|
je: 0,
|
|
1161
|
-
|
|
1161
|
+
R: t,
|
|
1162
1162
|
ae: n,
|
|
1163
1163
|
o: 0,
|
|
1164
1164
|
C: null,
|
|
@@ -1235,8 +1235,14 @@ function optimisticComputed(e, t, n) {
|
|
|
1235
1235
|
function isEqual(e, t) {
|
|
1236
1236
|
return e === t;
|
|
1237
1237
|
}
|
|
1238
|
+
let D = false;
|
|
1239
|
+
function setStrictRead(e) {
|
|
1240
|
+
const t = D;
|
|
1241
|
+
D = e;
|
|
1242
|
+
return t;
|
|
1243
|
+
}
|
|
1238
1244
|
function untrack(e) {
|
|
1239
|
-
if (!L) return e();
|
|
1245
|
+
if (!L && true) return e();
|
|
1240
1246
|
L = false;
|
|
1241
1247
|
try {
|
|
1242
1248
|
return e();
|
|
@@ -1268,25 +1274,25 @@ function read(e) {
|
|
|
1268
1274
|
}
|
|
1269
1275
|
return r;
|
|
1270
1276
|
}
|
|
1271
|
-
if (
|
|
1277
|
+
if (H) {
|
|
1272
1278
|
const t = e.I || e;
|
|
1273
1279
|
const n = getPendingSignal(t);
|
|
1274
|
-
const r =
|
|
1275
|
-
|
|
1280
|
+
const r = H;
|
|
1281
|
+
H = false;
|
|
1276
1282
|
if (read(n)) {
|
|
1277
1283
|
Q = true;
|
|
1278
1284
|
}
|
|
1279
|
-
|
|
1285
|
+
H = r;
|
|
1280
1286
|
return e.ae;
|
|
1281
1287
|
}
|
|
1282
1288
|
let t = M;
|
|
1283
1289
|
if (t?.t) t = t.u;
|
|
1284
|
-
if (
|
|
1290
|
+
if (R && e.R) recompute(e);
|
|
1285
1291
|
if (t && L) {
|
|
1286
|
-
if (e.
|
|
1292
|
+
if (e.R && e.m & u) recompute(e);
|
|
1287
1293
|
link(e, t);
|
|
1288
1294
|
const n = e.I || e;
|
|
1289
|
-
if (n.
|
|
1295
|
+
if (n.R) {
|
|
1290
1296
|
const r = e.m & o;
|
|
1291
1297
|
if (n.o >= (r ? v.W : x.W)) {
|
|
1292
1298
|
markNode(t);
|
|
@@ -1317,7 +1323,7 @@ function read(e) {
|
|
|
1317
1323
|
throw n.Y;
|
|
1318
1324
|
}
|
|
1319
1325
|
}
|
|
1320
|
-
if (e.
|
|
1326
|
+
if (e.R && e.de & a) {
|
|
1321
1327
|
if (e.$ < P) {
|
|
1322
1328
|
recompute(e, true);
|
|
1323
1329
|
return read(e);
|
|
@@ -1341,7 +1347,7 @@ function setSignal(e, t) {
|
|
|
1341
1347
|
if (typeof t === "function") t = t(r);
|
|
1342
1348
|
const i = !e.be || !e.be(r, t);
|
|
1343
1349
|
if (!i) {
|
|
1344
|
-
if (n && e.ce !== g && e.
|
|
1350
|
+
if (n && e.ce !== g && e.R) {
|
|
1345
1351
|
insertSubs(e, true);
|
|
1346
1352
|
schedule();
|
|
1347
1353
|
}
|
|
@@ -1432,14 +1438,14 @@ function getPendingValueComputed(e) {
|
|
|
1432
1438
|
if (!e._e) {
|
|
1433
1439
|
const t = T;
|
|
1434
1440
|
T = false;
|
|
1435
|
-
const n =
|
|
1436
|
-
|
|
1441
|
+
const n = H;
|
|
1442
|
+
H = false;
|
|
1437
1443
|
const r = M;
|
|
1438
1444
|
M = null;
|
|
1439
1445
|
e._e = optimisticComputed(() => read(e));
|
|
1440
1446
|
e._e.he = e;
|
|
1441
1447
|
M = r;
|
|
1442
|
-
|
|
1448
|
+
H = n;
|
|
1443
1449
|
T = t;
|
|
1444
1450
|
}
|
|
1445
1451
|
return e._e;
|
|
@@ -1463,9 +1469,9 @@ function pending(e) {
|
|
|
1463
1469
|
}
|
|
1464
1470
|
}
|
|
1465
1471
|
function isPending(e) {
|
|
1466
|
-
const t =
|
|
1472
|
+
const t = H;
|
|
1467
1473
|
const n = Q;
|
|
1468
|
-
|
|
1474
|
+
H = true;
|
|
1469
1475
|
Q = false;
|
|
1470
1476
|
try {
|
|
1471
1477
|
e();
|
|
@@ -1473,13 +1479,13 @@ function isPending(e) {
|
|
|
1473
1479
|
} catch {
|
|
1474
1480
|
return Q;
|
|
1475
1481
|
} finally {
|
|
1476
|
-
|
|
1482
|
+
H = t;
|
|
1477
1483
|
Q = n;
|
|
1478
1484
|
}
|
|
1479
1485
|
}
|
|
1480
1486
|
function refresh(e) {
|
|
1481
|
-
let t =
|
|
1482
|
-
|
|
1487
|
+
let t = R;
|
|
1488
|
+
R = true;
|
|
1483
1489
|
try {
|
|
1484
1490
|
if (typeof e !== "function") {
|
|
1485
1491
|
recompute(e[_]);
|
|
@@ -1487,14 +1493,14 @@ function refresh(e) {
|
|
|
1487
1493
|
}
|
|
1488
1494
|
return untrack(e);
|
|
1489
1495
|
} finally {
|
|
1490
|
-
|
|
1496
|
+
R = t;
|
|
1491
1497
|
if (!t) {
|
|
1492
1498
|
schedule();
|
|
1493
1499
|
}
|
|
1494
1500
|
}
|
|
1495
1501
|
}
|
|
1496
1502
|
function isRefreshing() {
|
|
1497
|
-
return
|
|
1503
|
+
return R;
|
|
1498
1504
|
}
|
|
1499
1505
|
function createContext(e, t) {
|
|
1500
1506
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1503,7 +1509,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1503
1509
|
if (!t) {
|
|
1504
1510
|
throw new NoOwnerError();
|
|
1505
1511
|
}
|
|
1506
|
-
const n = hasContext(e, t) ? t.
|
|
1512
|
+
const n = hasContext(e, t) ? t.Re[e.id] : e.defaultValue;
|
|
1507
1513
|
if (isUndefined(n)) {
|
|
1508
1514
|
throw new ContextNotFoundError();
|
|
1509
1515
|
}
|
|
@@ -1513,10 +1519,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1513
1519
|
if (!n) {
|
|
1514
1520
|
throw new NoOwnerError();
|
|
1515
1521
|
}
|
|
1516
|
-
n.
|
|
1522
|
+
n.Re = { ...n.Re, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1517
1523
|
}
|
|
1518
1524
|
function hasContext(e, t) {
|
|
1519
|
-
return !isUndefined(t?.
|
|
1525
|
+
return !isUndefined(t?.Re[e.id]);
|
|
1520
1526
|
}
|
|
1521
1527
|
function isUndefined(e) {
|
|
1522
1528
|
return typeof e === "undefined";
|
|
@@ -1634,7 +1640,7 @@ function onSettled(e) {
|
|
|
1634
1640
|
});
|
|
1635
1641
|
}
|
|
1636
1642
|
function unwrap(e) {
|
|
1637
|
-
return e?.[
|
|
1643
|
+
return e?.[z]?.[ee] ?? e;
|
|
1638
1644
|
}
|
|
1639
1645
|
function getOverrideValue(e, t, n, r, i) {
|
|
1640
1646
|
if (i && r in i) return i[r];
|
|
@@ -1646,16 +1652,16 @@ function getAllKeys(e, t, n) {
|
|
|
1646
1652
|
return Array.from(new Set([...r, ...i]));
|
|
1647
1653
|
}
|
|
1648
1654
|
function applyState(e, t, n, r) {
|
|
1649
|
-
const i = t?.[
|
|
1655
|
+
const i = t?.[z];
|
|
1650
1656
|
if (!i) return;
|
|
1651
|
-
const s = i[
|
|
1652
|
-
const o = i[
|
|
1653
|
-
const u = i[
|
|
1654
|
-
let f = i[
|
|
1657
|
+
const s = i[Y];
|
|
1658
|
+
const o = i[Z];
|
|
1659
|
+
const u = i[$];
|
|
1660
|
+
let f = i[ee];
|
|
1655
1661
|
if (e === s && !o && !u) return;
|
|
1656
|
-
(i[
|
|
1657
|
-
i[
|
|
1658
|
-
i[
|
|
1662
|
+
(i[re] || oe).set(e, i[U]);
|
|
1663
|
+
i[Y] = e;
|
|
1664
|
+
i[Z] = undefined;
|
|
1659
1665
|
if (Array.isArray(s)) {
|
|
1660
1666
|
let t = false;
|
|
1661
1667
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
@@ -1683,16 +1689,16 @@ function applyState(e, t, n, r) {
|
|
|
1683
1689
|
if (d > h || d > p) {
|
|
1684
1690
|
for (a = d; a <= h; a++) {
|
|
1685
1691
|
t = true;
|
|
1686
|
-
i[
|
|
1692
|
+
i[ee][a] && setSignal(i[ee][a], wrap(e[a], i));
|
|
1687
1693
|
}
|
|
1688
1694
|
for (; a < e.length; a++) {
|
|
1689
1695
|
t = true;
|
|
1690
1696
|
const s = wrap(w[a], i);
|
|
1691
|
-
i[
|
|
1697
|
+
i[ee][a] && setSignal(i[ee][a], s);
|
|
1692
1698
|
applyState(e[a], s, n, r);
|
|
1693
1699
|
}
|
|
1694
|
-
t && i[
|
|
1695
|
-
l !== e.length && i[
|
|
1700
|
+
t && i[ee][G] && setSignal(i[ee][G], void 0);
|
|
1701
|
+
l !== e.length && i[ee].length && setSignal(i[ee].length, e.length);
|
|
1696
1702
|
return;
|
|
1697
1703
|
}
|
|
1698
1704
|
g = new Array(h + 1);
|
|
@@ -1716,26 +1722,26 @@ function applyState(e, t, n, r) {
|
|
|
1716
1722
|
for (a = d; a < e.length; a++) {
|
|
1717
1723
|
if (a in w) {
|
|
1718
1724
|
const t = wrap(w[a], i);
|
|
1719
|
-
i[
|
|
1725
|
+
i[ee][a] && setSignal(i[ee][a], t);
|
|
1720
1726
|
applyState(e[a], t, n, r);
|
|
1721
|
-
} else i[
|
|
1727
|
+
} else i[ee][a] && setSignal(i[ee][a], wrap(e[a], i));
|
|
1722
1728
|
}
|
|
1723
1729
|
if (d < e.length) t = true;
|
|
1724
1730
|
} else if (e.length) {
|
|
1725
1731
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1726
1732
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1727
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1733
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[ee][t] && setSignal(i[ee][t], e[t]);
|
|
1728
1734
|
}
|
|
1729
1735
|
}
|
|
1730
1736
|
if (l !== e.length) {
|
|
1731
1737
|
t = true;
|
|
1732
|
-
i[
|
|
1738
|
+
i[ee].length && setSignal(i[ee].length, e.length);
|
|
1733
1739
|
}
|
|
1734
|
-
t && i[
|
|
1740
|
+
t && i[ee][G] && setSignal(i[ee][G], void 0);
|
|
1735
1741
|
return;
|
|
1736
1742
|
}
|
|
1737
1743
|
if (f) {
|
|
1738
|
-
const t = f[
|
|
1744
|
+
const t = f[G];
|
|
1739
1745
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1740
1746
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1741
1747
|
const a = l[c];
|
|
@@ -1749,7 +1755,7 @@ function applyState(e, t, n, r) {
|
|
|
1749
1755
|
} else applyState(h, wrap(p, i), n, r);
|
|
1750
1756
|
}
|
|
1751
1757
|
}
|
|
1752
|
-
if ((f = i[
|
|
1758
|
+
if ((f = i[te])) {
|
|
1753
1759
|
const t = Object.keys(f);
|
|
1754
1760
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1755
1761
|
const r = t[n];
|
|
@@ -1771,9 +1777,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1771
1777
|
let r;
|
|
1772
1778
|
const i = new WeakMap();
|
|
1773
1779
|
const wrapper = e => {
|
|
1774
|
-
e[
|
|
1775
|
-
e[
|
|
1776
|
-
Object.defineProperty(e,
|
|
1780
|
+
e[ne] = wrapProjection;
|
|
1781
|
+
e[re] = i;
|
|
1782
|
+
Object.defineProperty(e, ie, {
|
|
1777
1783
|
get() {
|
|
1778
1784
|
return r;
|
|
1779
1785
|
},
|
|
@@ -1782,15 +1788,15 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1782
1788
|
};
|
|
1783
1789
|
const wrapProjection = e => {
|
|
1784
1790
|
if (i.has(e)) return i.get(e);
|
|
1785
|
-
if (e[
|
|
1786
|
-
const t = createStoreProxy(e,
|
|
1791
|
+
if (e[z]?.[ne] === wrapProjection) return e;
|
|
1792
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
1787
1793
|
i.set(e, t);
|
|
1788
1794
|
return t;
|
|
1789
1795
|
};
|
|
1790
1796
|
const s = wrapProjection(t);
|
|
1791
1797
|
r = computed(() => {
|
|
1792
1798
|
const t = getOwner();
|
|
1793
|
-
storeSetter(new Proxy(s,
|
|
1799
|
+
storeSetter(new Proxy(s, B), r => {
|
|
1794
1800
|
const i = handleAsync(t, e(r), e => {
|
|
1795
1801
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1796
1802
|
setSignal(t, undefined);
|
|
@@ -1804,7 +1810,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1804
1810
|
function createProjection(e, t = {}, n) {
|
|
1805
1811
|
return createProjectionInternal(e, t, n).store;
|
|
1806
1812
|
}
|
|
1807
|
-
const
|
|
1813
|
+
const B = {
|
|
1808
1814
|
get(e, t) {
|
|
1809
1815
|
let n;
|
|
1810
1816
|
setWriteOverride(true);
|
|
@@ -1815,7 +1821,7 @@ const D = {
|
|
|
1815
1821
|
setWriteOverride(false);
|
|
1816
1822
|
setProjectionWriteActive(false);
|
|
1817
1823
|
}
|
|
1818
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1824
|
+
return typeof n === "object" && n !== null ? new Proxy(n, B) : n;
|
|
1819
1825
|
},
|
|
1820
1826
|
set(e, t, n) {
|
|
1821
1827
|
setWriteOverride(true);
|
|
@@ -1840,46 +1846,46 @@ const D = {
|
|
|
1840
1846
|
return true;
|
|
1841
1847
|
}
|
|
1842
1848
|
};
|
|
1843
|
-
const
|
|
1844
|
-
G = Symbol(0),
|
|
1849
|
+
const G = Symbol(0),
|
|
1845
1850
|
K = Symbol(0),
|
|
1846
1851
|
z = Symbol(0),
|
|
1847
|
-
U = Symbol(0)
|
|
1848
|
-
|
|
1849
|
-
const X =
|
|
1850
|
-
|
|
1851
|
-
Z = "
|
|
1852
|
-
$ = "
|
|
1853
|
-
ee = "
|
|
1854
|
-
te = "
|
|
1855
|
-
ne = "
|
|
1856
|
-
re = "
|
|
1857
|
-
ie = "
|
|
1858
|
-
|
|
1852
|
+
U = Symbol(0),
|
|
1853
|
+
J = Symbol(0);
|
|
1854
|
+
const X = new WeakMap();
|
|
1855
|
+
const Y = "v",
|
|
1856
|
+
Z = "o",
|
|
1857
|
+
$ = "x",
|
|
1858
|
+
ee = "n",
|
|
1859
|
+
te = "h",
|
|
1860
|
+
ne = "w",
|
|
1861
|
+
re = "l",
|
|
1862
|
+
ie = "f",
|
|
1863
|
+
se = "p";
|
|
1864
|
+
function createStoreProxy(e, t = le, n) {
|
|
1859
1865
|
let r;
|
|
1860
1866
|
if (Array.isArray(e)) {
|
|
1861
1867
|
r = [];
|
|
1862
1868
|
r.v = e;
|
|
1863
1869
|
} else r = { v: e };
|
|
1864
1870
|
n && n(r);
|
|
1865
|
-
return (r[
|
|
1871
|
+
return (r[U] = new Proxy(r, t));
|
|
1866
1872
|
}
|
|
1867
|
-
const
|
|
1873
|
+
const oe = new WeakMap();
|
|
1868
1874
|
function wrap(e, t) {
|
|
1869
|
-
if (t?.[
|
|
1870
|
-
let n = e[
|
|
1871
|
-
if (!n)
|
|
1875
|
+
if (t?.[ne]) return t[ne](e, t);
|
|
1876
|
+
let n = e[U] || oe.get(e);
|
|
1877
|
+
if (!n) oe.set(e, (n = createStoreProxy(e)));
|
|
1872
1878
|
return n;
|
|
1873
1879
|
}
|
|
1874
1880
|
function isWrappable(e) {
|
|
1875
1881
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1876
1882
|
}
|
|
1877
|
-
let
|
|
1883
|
+
let ue = false;
|
|
1878
1884
|
function setWriteOverride(e) {
|
|
1879
|
-
|
|
1885
|
+
ue = e;
|
|
1880
1886
|
}
|
|
1881
1887
|
function writeOnly(e) {
|
|
1882
|
-
return
|
|
1888
|
+
return ue || !!fe?.has(e);
|
|
1883
1889
|
}
|
|
1884
1890
|
function getNodes(e, t) {
|
|
1885
1891
|
let n = e[t];
|
|
@@ -1906,8 +1912,8 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1906
1912
|
}
|
|
1907
1913
|
return (e[t] = u);
|
|
1908
1914
|
}
|
|
1909
|
-
function trackSelf(e, t =
|
|
1910
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1915
|
+
function trackSelf(e, t = G) {
|
|
1916
|
+
getObserver() && read(getNode(getNodes(e, ee), t, undefined, e[ie], false, e[se]));
|
|
1911
1917
|
}
|
|
1912
1918
|
function getKeys(e, t, n = true) {
|
|
1913
1919
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1915,7 +1921,7 @@ function getKeys(e, t, n = true) {
|
|
|
1915
1921
|
const i = new Set(r);
|
|
1916
1922
|
const s = Reflect.ownKeys(t);
|
|
1917
1923
|
for (const e of s) {
|
|
1918
|
-
if (t[e] !==
|
|
1924
|
+
if (t[e] !== J) i.add(e);
|
|
1919
1925
|
else i.delete(e);
|
|
1920
1926
|
}
|
|
1921
1927
|
return Array.from(i);
|
|
@@ -1923,70 +1929,70 @@ function getKeys(e, t, n = true) {
|
|
|
1923
1929
|
function getPropertyDescriptor(e, t, n) {
|
|
1924
1930
|
let r = e;
|
|
1925
1931
|
if (t && n in t) {
|
|
1926
|
-
if (r[n] ===
|
|
1932
|
+
if (r[n] === J) return void 0;
|
|
1927
1933
|
if (!(n in r)) r = t;
|
|
1928
1934
|
}
|
|
1929
1935
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1930
1936
|
}
|
|
1931
|
-
let
|
|
1932
|
-
const
|
|
1937
|
+
let fe = null;
|
|
1938
|
+
const le = {
|
|
1933
1939
|
get(e, t, n) {
|
|
1934
|
-
if (t ===
|
|
1935
|
-
if (t ===
|
|
1936
|
-
if (t === _) return e[
|
|
1937
|
-
if (t ===
|
|
1940
|
+
if (t === z) return e;
|
|
1941
|
+
if (t === U) return n;
|
|
1942
|
+
if (t === _) return e[ie];
|
|
1943
|
+
if (t === G || t === K) {
|
|
1938
1944
|
trackSelf(e, t);
|
|
1939
1945
|
return n;
|
|
1940
1946
|
}
|
|
1941
|
-
const r = getNodes(e,
|
|
1947
|
+
const r = getNodes(e, ee);
|
|
1942
1948
|
const i = r[t];
|
|
1943
|
-
const s = e[
|
|
1944
|
-
const o = s || (e[
|
|
1945
|
-
const u = !!e[
|
|
1946
|
-
const f = s ? e[
|
|
1949
|
+
const s = e[$] && t in e[$];
|
|
1950
|
+
const o = s || (e[Z] && t in e[Z]);
|
|
1951
|
+
const u = !!e[Y][z];
|
|
1952
|
+
const f = s ? e[$] : e[Z] && t in e[Z] ? e[Z] : e[Y];
|
|
1947
1953
|
if (!i) {
|
|
1948
1954
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1949
1955
|
if (e && e.get) return e.get.call(n);
|
|
1950
1956
|
}
|
|
1951
1957
|
if (writeOnly(n)) {
|
|
1952
1958
|
let n = i && (o || !u) ? (i.ce !== g ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1953
|
-
n ===
|
|
1959
|
+
n === J && (n = undefined);
|
|
1954
1960
|
if (!isWrappable(n)) return n;
|
|
1955
1961
|
const r = wrap(n, e);
|
|
1956
|
-
|
|
1962
|
+
fe?.add(r);
|
|
1957
1963
|
return r;
|
|
1958
1964
|
}
|
|
1959
1965
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1960
|
-
l ===
|
|
1966
|
+
l === J && (l = undefined);
|
|
1961
1967
|
if (!i) {
|
|
1962
1968
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1963
1969
|
let t;
|
|
1964
|
-
return !Array.isArray(e[
|
|
1970
|
+
return !Array.isArray(e[Y]) && (t = Object.getPrototypeOf(e[Y])) && t !== Object.prototype
|
|
1965
1971
|
? l.bind(f)
|
|
1966
1972
|
: l;
|
|
1967
1973
|
} else if (getObserver()) {
|
|
1968
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1974
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[ie], isEqual, e[se], e[w]));
|
|
1969
1975
|
}
|
|
1970
1976
|
}
|
|
1971
1977
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1972
1978
|
},
|
|
1973
1979
|
has(e, t) {
|
|
1974
|
-
if (t ===
|
|
1975
|
-
const n = e[
|
|
1976
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1980
|
+
if (t === U || t === G || t === "__proto__") return true;
|
|
1981
|
+
const n = e[$] && t in e[$] ? e[$][t] !== J : e[Z] && t in e[Z] ? e[Z][t] !== J : t in e[Y];
|
|
1982
|
+
getObserver() && read(getNode(getNodes(e, te), t, n, e[ie], isEqual, e[se]));
|
|
1977
1983
|
return n;
|
|
1978
1984
|
},
|
|
1979
1985
|
set(e, t, n) {
|
|
1980
|
-
const r = e[
|
|
1986
|
+
const r = e[U];
|
|
1981
1987
|
if (writeOnly(r)) {
|
|
1982
|
-
if (e[
|
|
1983
|
-
const t = e[
|
|
1988
|
+
if (e[se]) {
|
|
1989
|
+
const t = e[ie];
|
|
1984
1990
|
if (t?.ne) {
|
|
1985
1991
|
W.initTransition(t.ne);
|
|
1986
1992
|
}
|
|
1987
1993
|
}
|
|
1988
1994
|
untrack(() => {
|
|
1989
|
-
const i = e[
|
|
1995
|
+
const i = e[Y];
|
|
1990
1996
|
const s = i[t];
|
|
1991
1997
|
if (F && typeof t !== "symbol") {
|
|
1992
1998
|
if (!e[w]) {
|
|
@@ -1997,23 +2003,23 @@ const fe = {
|
|
|
1997
2003
|
e[w][t] = s;
|
|
1998
2004
|
}
|
|
1999
2005
|
}
|
|
2000
|
-
const o = e[
|
|
2001
|
-
const u = o ?
|
|
2006
|
+
const o = e[se] && !A;
|
|
2007
|
+
const u = o ? $ : Z;
|
|
2002
2008
|
if (o) trackOptimisticStore(r);
|
|
2003
|
-
const f = e[
|
|
2004
|
-
const l = n?.[
|
|
2009
|
+
const f = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : s;
|
|
2010
|
+
const l = n?.[z]?.[Y] ?? n;
|
|
2005
2011
|
if (f === l) return true;
|
|
2006
|
-
const c = e[
|
|
2012
|
+
const c = e[$]?.length || e[Z]?.length || i.length;
|
|
2007
2013
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2008
2014
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2009
2015
|
const a = isWrappable(l);
|
|
2010
2016
|
if (isWrappable(f)) {
|
|
2011
|
-
const e =
|
|
2012
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2017
|
+
const e = X.get(f);
|
|
2018
|
+
e && (e instanceof Set ? e.delete(r) : X.delete(f));
|
|
2013
2019
|
}
|
|
2014
|
-
if (recursivelyNotify(r,
|
|
2015
|
-
e[
|
|
2016
|
-
const d = getNodes(e,
|
|
2020
|
+
if (recursivelyNotify(r, oe) && a) recursivelyAddParent(l, r);
|
|
2021
|
+
e[te]?.[t] && setSignal(e[te][t], true);
|
|
2022
|
+
const d = getNodes(e, ee);
|
|
2017
2023
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2018
2024
|
if (Array.isArray(i)) {
|
|
2019
2025
|
if (t === "length") {
|
|
@@ -2023,44 +2029,44 @@ const fe = {
|
|
|
2023
2029
|
if (e > c) d.length && setSignal(d.length, e);
|
|
2024
2030
|
}
|
|
2025
2031
|
}
|
|
2026
|
-
d[
|
|
2032
|
+
d[G] && setSignal(d[G], undefined);
|
|
2027
2033
|
});
|
|
2028
2034
|
}
|
|
2029
2035
|
return true;
|
|
2030
2036
|
},
|
|
2031
2037
|
deleteProperty(e, t) {
|
|
2032
|
-
const n = e[
|
|
2033
|
-
const r = e[
|
|
2034
|
-
if (writeOnly(e[
|
|
2038
|
+
const n = e[$]?.[t] === J;
|
|
2039
|
+
const r = e[Z]?.[t] === J;
|
|
2040
|
+
if (writeOnly(e[U]) && !n && !r) {
|
|
2035
2041
|
untrack(() => {
|
|
2036
|
-
const n = e[
|
|
2037
|
-
const r = n ?
|
|
2038
|
-
if (n) trackOptimisticStore(e[
|
|
2039
|
-
const i = e[
|
|
2040
|
-
if (t in e[
|
|
2041
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2042
|
+
const n = e[se] && !A;
|
|
2043
|
+
const r = n ? $ : Z;
|
|
2044
|
+
if (n) trackOptimisticStore(e[U]);
|
|
2045
|
+
const i = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : e[Y][t];
|
|
2046
|
+
if (t in e[Y] || (e[Z] && t in e[Z])) {
|
|
2047
|
+
(e[r] || (e[r] = Object.create(null)))[t] = J;
|
|
2042
2048
|
} else if (e[r] && t in e[r]) {
|
|
2043
2049
|
delete e[r][t];
|
|
2044
2050
|
} else return true;
|
|
2045
2051
|
if (isWrappable(i)) {
|
|
2046
|
-
const t =
|
|
2047
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2052
|
+
const t = X.get(i);
|
|
2053
|
+
t && (t instanceof Set ? t.delete(e) : X.delete(i));
|
|
2048
2054
|
}
|
|
2049
|
-
if (e[
|
|
2050
|
-
const s = getNodes(e,
|
|
2055
|
+
if (e[te]?.[t]) setSignal(e[te][t], false);
|
|
2056
|
+
const s = getNodes(e, ee);
|
|
2051
2057
|
s[t] && setSignal(s[t], undefined);
|
|
2052
|
-
s[
|
|
2058
|
+
s[G] && setSignal(s[G], undefined);
|
|
2053
2059
|
});
|
|
2054
2060
|
}
|
|
2055
2061
|
return true;
|
|
2056
2062
|
},
|
|
2057
2063
|
ownKeys(e) {
|
|
2058
2064
|
trackSelf(e);
|
|
2059
|
-
let t = getKeys(e[
|
|
2060
|
-
if (e[
|
|
2065
|
+
let t = getKeys(e[Y], e[Z], false);
|
|
2066
|
+
if (e[$]) {
|
|
2061
2067
|
const n = new Set(t);
|
|
2062
|
-
for (const t of Reflect.ownKeys(e[
|
|
2063
|
-
if (e[
|
|
2068
|
+
for (const t of Reflect.ownKeys(e[$])) {
|
|
2069
|
+
if (e[$][t] !== J) n.add(t);
|
|
2064
2070
|
else n.delete(t);
|
|
2065
2071
|
}
|
|
2066
2072
|
t = Array.from(n);
|
|
@@ -2068,25 +2074,25 @@ const fe = {
|
|
|
2068
2074
|
return t;
|
|
2069
2075
|
},
|
|
2070
2076
|
getOwnPropertyDescriptor(e, t) {
|
|
2071
|
-
if (t ===
|
|
2072
|
-
if (e[
|
|
2073
|
-
if (e[
|
|
2074
|
-
const n = getPropertyDescriptor(e[
|
|
2077
|
+
if (t === U) return { value: e[U], writable: true, configurable: true };
|
|
2078
|
+
if (e[$] && t in e[$]) {
|
|
2079
|
+
if (e[$][t] === J) return undefined;
|
|
2080
|
+
const n = getPropertyDescriptor(e[Y], e[Z], t);
|
|
2075
2081
|
if (n) {
|
|
2076
|
-
return { ...n, value: e[
|
|
2082
|
+
return { ...n, value: e[$][t] };
|
|
2077
2083
|
}
|
|
2078
|
-
return { value: e[
|
|
2084
|
+
return { value: e[$][t], writable: true, enumerable: true, configurable: true };
|
|
2079
2085
|
}
|
|
2080
|
-
return getPropertyDescriptor(e[
|
|
2086
|
+
return getPropertyDescriptor(e[Y], e[Z], t);
|
|
2081
2087
|
},
|
|
2082
2088
|
getPrototypeOf(e) {
|
|
2083
|
-
return Object.getPrototypeOf(e[
|
|
2089
|
+
return Object.getPrototypeOf(e[Y]);
|
|
2084
2090
|
}
|
|
2085
2091
|
};
|
|
2086
2092
|
function storeSetter(e, t) {
|
|
2087
|
-
const n =
|
|
2088
|
-
|
|
2089
|
-
|
|
2093
|
+
const n = fe;
|
|
2094
|
+
fe = new Set();
|
|
2095
|
+
fe.add(e);
|
|
2090
2096
|
try {
|
|
2091
2097
|
const n = t(e);
|
|
2092
2098
|
if (n !== e && n !== undefined) {
|
|
@@ -2102,8 +2108,8 @@ function storeSetter(e, t) {
|
|
|
2102
2108
|
}
|
|
2103
2109
|
}
|
|
2104
2110
|
} finally {
|
|
2105
|
-
|
|
2106
|
-
|
|
2111
|
+
fe.clear();
|
|
2112
|
+
fe = n;
|
|
2107
2113
|
}
|
|
2108
2114
|
}
|
|
2109
2115
|
function createStore(e, t, n) {
|
|
@@ -2112,17 +2118,17 @@ function createStore(e, t, n) {
|
|
|
2112
2118
|
return [i, e => storeSetter(i, e)];
|
|
2113
2119
|
}
|
|
2114
2120
|
function recursivelyNotify(e, t) {
|
|
2115
|
-
let n = e[
|
|
2121
|
+
let n = e[z] || t?.get(e)?.[z];
|
|
2116
2122
|
let r = false;
|
|
2117
2123
|
if (n) {
|
|
2118
|
-
const e = getNodes(n,
|
|
2124
|
+
const e = getNodes(n, ee)[K];
|
|
2119
2125
|
if (e) {
|
|
2120
2126
|
setSignal(e, undefined);
|
|
2121
2127
|
r = true;
|
|
2122
2128
|
}
|
|
2123
|
-
t = n[
|
|
2129
|
+
t = n[re] || t;
|
|
2124
2130
|
}
|
|
2125
|
-
const i =
|
|
2131
|
+
const i = X.get(n?.[Y] || e);
|
|
2126
2132
|
if (!i) return r;
|
|
2127
2133
|
if (i instanceof Set) {
|
|
2128
2134
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2131,16 +2137,16 @@ function recursivelyNotify(e, t) {
|
|
|
2131
2137
|
}
|
|
2132
2138
|
function recursivelyAddParent(e, t) {
|
|
2133
2139
|
let n;
|
|
2134
|
-
const r = e[
|
|
2140
|
+
const r = e[z];
|
|
2135
2141
|
if (r) {
|
|
2136
|
-
n = r[
|
|
2137
|
-
e = r[
|
|
2142
|
+
n = r[Z];
|
|
2143
|
+
e = r[Y];
|
|
2138
2144
|
}
|
|
2139
2145
|
if (t) {
|
|
2140
|
-
let n =
|
|
2141
|
-
if (!n)
|
|
2146
|
+
let n = X.get(e);
|
|
2147
|
+
if (!n) X.set(e, t);
|
|
2142
2148
|
else if (n !== t) {
|
|
2143
|
-
if (!(n instanceof Set))
|
|
2149
|
+
if (!(n instanceof Set)) X.set(e, (n = new Set([n])));
|
|
2144
2150
|
else if (n.has(t)) return;
|
|
2145
2151
|
n.add(t);
|
|
2146
2152
|
} else return;
|
|
@@ -2162,7 +2168,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2162
2168
|
}
|
|
2163
2169
|
function deep(e) {
|
|
2164
2170
|
recursivelyAddParent(e);
|
|
2165
|
-
return e[
|
|
2171
|
+
return e[K];
|
|
2166
2172
|
}
|
|
2167
2173
|
function createOptimisticStore(e, t, n) {
|
|
2168
2174
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2173,39 +2179,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2173
2179
|
return [o, e => storeSetter(o, e)];
|
|
2174
2180
|
}
|
|
2175
2181
|
function clearOptimisticStore(e) {
|
|
2176
|
-
const t = e[
|
|
2177
|
-
if (!t || !t[
|
|
2178
|
-
const n = t[
|
|
2179
|
-
const r = t[
|
|
2182
|
+
const t = e[z];
|
|
2183
|
+
if (!t || !t[$]) return;
|
|
2184
|
+
const n = t[$];
|
|
2185
|
+
const r = t[ee];
|
|
2180
2186
|
setProjectionWriteActive(true);
|
|
2181
2187
|
try {
|
|
2182
2188
|
if (r) {
|
|
2183
2189
|
for (const e of Reflect.ownKeys(n)) {
|
|
2184
2190
|
if (r[e]) {
|
|
2185
2191
|
r[e].re = undefined;
|
|
2186
|
-
const n = t[
|
|
2187
|
-
const i = n ===
|
|
2192
|
+
const n = t[Z] && e in t[Z] ? t[Z][e] : t[Y][e];
|
|
2193
|
+
const i = n === J ? undefined : n;
|
|
2188
2194
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2189
2195
|
}
|
|
2190
2196
|
}
|
|
2191
|
-
if (r[
|
|
2192
|
-
r[
|
|
2193
|
-
setSignal(r[
|
|
2197
|
+
if (r[G]) {
|
|
2198
|
+
r[G].re = undefined;
|
|
2199
|
+
setSignal(r[G], undefined);
|
|
2194
2200
|
}
|
|
2195
2201
|
}
|
|
2196
2202
|
} finally {
|
|
2197
2203
|
setProjectionWriteActive(false);
|
|
2198
2204
|
}
|
|
2199
|
-
delete t[
|
|
2205
|
+
delete t[$];
|
|
2200
2206
|
}
|
|
2201
2207
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2202
2208
|
let r;
|
|
2203
2209
|
const i = new WeakMap();
|
|
2204
2210
|
const wrapper = e => {
|
|
2205
|
-
e[
|
|
2206
|
-
e[
|
|
2207
|
-
e[
|
|
2208
|
-
Object.defineProperty(e,
|
|
2211
|
+
e[ne] = wrapProjection;
|
|
2212
|
+
e[re] = i;
|
|
2213
|
+
e[se] = true;
|
|
2214
|
+
Object.defineProperty(e, ie, {
|
|
2209
2215
|
get() {
|
|
2210
2216
|
return r;
|
|
2211
2217
|
},
|
|
@@ -2214,8 +2220,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2214
2220
|
};
|
|
2215
2221
|
const wrapProjection = e => {
|
|
2216
2222
|
if (i.has(e)) return i.get(e);
|
|
2217
|
-
if (e[
|
|
2218
|
-
const t = createStoreProxy(e,
|
|
2223
|
+
if (e[z]?.[ne] === wrapProjection) return e;
|
|
2224
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
2219
2225
|
i.set(e, t);
|
|
2220
2226
|
return t;
|
|
2221
2227
|
};
|
|
@@ -2225,7 +2231,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2225
2231
|
const t = getOwner();
|
|
2226
2232
|
setProjectionWriteActive(true);
|
|
2227
2233
|
try {
|
|
2228
|
-
storeSetter(new Proxy(s,
|
|
2234
|
+
storeSetter(new Proxy(s, B), r => {
|
|
2229
2235
|
const i = handleAsync(t, e(r), e => {
|
|
2230
2236
|
setProjectionWriteActive(true);
|
|
2231
2237
|
try {
|
|
@@ -2249,12 +2255,12 @@ function snapshot(e, t, n) {
|
|
|
2249
2255
|
if (!isWrappable(e)) return e;
|
|
2250
2256
|
if (t && t.has(e)) return t.get(e);
|
|
2251
2257
|
if (!t) t = new Map();
|
|
2252
|
-
if ((r = e[
|
|
2253
|
-
s = r[
|
|
2254
|
-
i = Array.isArray(r[
|
|
2255
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2256
|
-
e = r[
|
|
2257
|
-
n =
|
|
2258
|
+
if ((r = e[z] || n?.get(e)?.[z])) {
|
|
2259
|
+
s = r[Z];
|
|
2260
|
+
i = Array.isArray(r[Y]);
|
|
2261
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Y]))) : r[Y]);
|
|
2262
|
+
e = r[Y];
|
|
2263
|
+
n = oe;
|
|
2258
2264
|
} else {
|
|
2259
2265
|
i = Array.isArray(e);
|
|
2260
2266
|
t.set(e, e);
|
|
@@ -2263,7 +2269,7 @@ function snapshot(e, t, n) {
|
|
|
2263
2269
|
const r = s?.length || e.length;
|
|
2264
2270
|
for (let i = 0; i < r; i++) {
|
|
2265
2271
|
f = s && i in s ? s[i] : e[i];
|
|
2266
|
-
if (f ===
|
|
2272
|
+
if (f === J) continue;
|
|
2267
2273
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2268
2274
|
if (!o) t.set(e, (o = [...e]));
|
|
2269
2275
|
o[i] = u;
|
|
@@ -2290,13 +2296,13 @@ function snapshot(e, t, n) {
|
|
|
2290
2296
|
function trueFn() {
|
|
2291
2297
|
return true;
|
|
2292
2298
|
}
|
|
2293
|
-
const
|
|
2299
|
+
const ce = {
|
|
2294
2300
|
get(e, t, n) {
|
|
2295
|
-
if (t ===
|
|
2301
|
+
if (t === U) return n;
|
|
2296
2302
|
return e.get(t);
|
|
2297
2303
|
},
|
|
2298
2304
|
has(e, t) {
|
|
2299
|
-
if (t ===
|
|
2305
|
+
if (t === U) return true;
|
|
2300
2306
|
return e.has(t);
|
|
2301
2307
|
},
|
|
2302
2308
|
set: trueFn,
|
|
@@ -2319,15 +2325,15 @@ const le = {
|
|
|
2319
2325
|
function resolveSource(e) {
|
|
2320
2326
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2321
2327
|
}
|
|
2322
|
-
const
|
|
2328
|
+
const ae = Symbol(0);
|
|
2323
2329
|
function merge(...e) {
|
|
2324
2330
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2325
2331
|
let t = false;
|
|
2326
2332
|
const n = [];
|
|
2327
2333
|
for (let r = 0; r < e.length; r++) {
|
|
2328
2334
|
const i = e[r];
|
|
2329
|
-
t = t || (!!i &&
|
|
2330
|
-
const s = !!i && i[
|
|
2335
|
+
t = t || (!!i && U in i);
|
|
2336
|
+
const s = !!i && i[ae];
|
|
2331
2337
|
if (s) n.push(...s);
|
|
2332
2338
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2333
2339
|
}
|
|
@@ -2335,7 +2341,7 @@ function merge(...e) {
|
|
|
2335
2341
|
return new Proxy(
|
|
2336
2342
|
{
|
|
2337
2343
|
get(e) {
|
|
2338
|
-
if (e ===
|
|
2344
|
+
if (e === ae) return n;
|
|
2339
2345
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2340
2346
|
const r = resolveSource(n[t]);
|
|
2341
2347
|
if (e in r) return r[e];
|
|
@@ -2353,7 +2359,7 @@ function merge(...e) {
|
|
|
2353
2359
|
return [...new Set(e)];
|
|
2354
2360
|
}
|
|
2355
2361
|
},
|
|
2356
|
-
|
|
2362
|
+
ce
|
|
2357
2363
|
);
|
|
2358
2364
|
}
|
|
2359
2365
|
const r = Object.create(null);
|
|
@@ -2385,12 +2391,12 @@ function merge(...e) {
|
|
|
2385
2391
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2386
2392
|
else o[t] = n.value;
|
|
2387
2393
|
}
|
|
2388
|
-
o[
|
|
2394
|
+
o[ae] = n;
|
|
2389
2395
|
return o;
|
|
2390
2396
|
}
|
|
2391
2397
|
function omit(e, ...t) {
|
|
2392
2398
|
const n = new Set(t);
|
|
2393
|
-
if (m &&
|
|
2399
|
+
if (m && U in e) {
|
|
2394
2400
|
return new Proxy(
|
|
2395
2401
|
{
|
|
2396
2402
|
get(t) {
|
|
@@ -2403,7 +2409,7 @@ function omit(e, ...t) {
|
|
|
2403
2409
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2404
2410
|
}
|
|
2405
2411
|
},
|
|
2406
|
-
|
|
2412
|
+
ce
|
|
2407
2413
|
);
|
|
2408
2414
|
}
|
|
2409
2415
|
const r = {};
|
|
@@ -2419,34 +2425,36 @@ function omit(e, ...t) {
|
|
|
2419
2425
|
}
|
|
2420
2426
|
function mapArray(e, t, n) {
|
|
2421
2427
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2428
|
+
const i = t.length > 1;
|
|
2429
|
+
const s = t;
|
|
2422
2430
|
return createMemo(
|
|
2423
2431
|
updateKeyedMap.bind({
|
|
2424
2432
|
De: createOwner(),
|
|
2425
2433
|
Be: 0,
|
|
2426
2434
|
Ge: e,
|
|
2427
2435
|
Ke: [],
|
|
2428
|
-
ze:
|
|
2436
|
+
ze: s,
|
|
2429
2437
|
Ue: [],
|
|
2430
2438
|
Je: [],
|
|
2431
2439
|
Xe: r,
|
|
2432
2440
|
Ye: r || n?.keyed === false ? [] : undefined,
|
|
2433
|
-
Ze:
|
|
2441
|
+
Ze: i ? [] : undefined,
|
|
2434
2442
|
$e: n?.fallback
|
|
2435
2443
|
})
|
|
2436
2444
|
);
|
|
2437
2445
|
}
|
|
2438
|
-
const
|
|
2446
|
+
const de = { pureWrite: true };
|
|
2439
2447
|
function updateKeyedMap() {
|
|
2440
2448
|
const e = this.Ge() || [],
|
|
2441
2449
|
t = e.length;
|
|
2442
|
-
e[
|
|
2450
|
+
e[G];
|
|
2443
2451
|
runWithOwner(this.De, () => {
|
|
2444
2452
|
let n,
|
|
2445
2453
|
r,
|
|
2446
2454
|
i = this.Ye
|
|
2447
2455
|
? () => {
|
|
2448
|
-
this.Ye[r] = signal(e[r],
|
|
2449
|
-
this.Ze && (this.Ze[r] = signal(r,
|
|
2456
|
+
this.Ye[r] = signal(e[r], de);
|
|
2457
|
+
this.Ze && (this.Ze[r] = signal(r, de));
|
|
2450
2458
|
return this.ze(
|
|
2451
2459
|
read.bind(null, this.Ye[r]),
|
|
2452
2460
|
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
@@ -2455,7 +2463,7 @@ function updateKeyedMap() {
|
|
|
2455
2463
|
: this.Ze
|
|
2456
2464
|
? () => {
|
|
2457
2465
|
const t = e[r];
|
|
2458
|
-
this.Ze[r] = signal(r,
|
|
2466
|
+
this.Ze[r] = signal(r, de);
|
|
2459
2467
|
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2460
2468
|
}
|
|
2461
2469
|
: () => {
|
|
@@ -2559,12 +2567,13 @@ function updateKeyedMap() {
|
|
|
2559
2567
|
return this.Ue;
|
|
2560
2568
|
}
|
|
2561
2569
|
function repeat(e, t, n) {
|
|
2570
|
+
const r = t;
|
|
2562
2571
|
return updateRepeat.bind({
|
|
2563
2572
|
De: createOwner(),
|
|
2564
2573
|
Be: 0,
|
|
2565
2574
|
et: 0,
|
|
2566
2575
|
tt: e,
|
|
2567
|
-
ze:
|
|
2576
|
+
ze: r,
|
|
2568
2577
|
Je: [],
|
|
2569
2578
|
Ue: [],
|
|
2570
2579
|
nt: n?.from,
|
|
@@ -2754,9 +2763,9 @@ function flattenArray(e, t = [], n) {
|
|
|
2754
2763
|
if (r) throw r;
|
|
2755
2764
|
return i;
|
|
2756
2765
|
}
|
|
2757
|
-
exports.$PROXY =
|
|
2758
|
-
exports.$TARGET =
|
|
2759
|
-
exports.$TRACK =
|
|
2766
|
+
exports.$PROXY = U;
|
|
2767
|
+
exports.$TARGET = z;
|
|
2768
|
+
exports.$TRACK = G;
|
|
2760
2769
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2761
2770
|
exports.NoOwnerError = NoOwnerError;
|
|
2762
2771
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2806,5 +2815,6 @@ exports.resolve = resolve;
|
|
|
2806
2815
|
exports.runWithOwner = runWithOwner;
|
|
2807
2816
|
exports.setContext = setContext;
|
|
2808
2817
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2818
|
+
exports.setStrictRead = setStrictRead;
|
|
2809
2819
|
exports.snapshot = snapshot;
|
|
2810
2820
|
exports.untrack = untrack;
|