@solidjs/signals 0.10.8 → 0.11.1
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 +98 -27
- package/dist/node.cjs +630 -562
- package/dist/prod.js +257 -189
- package/dist/types/core/constants.d.ts +1 -0
- package/dist/types/core/core.d.ts +2 -2
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/index.d.ts +2 -0
- package/dist/types/store/storePath.d.ts +30 -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 =
|
|
45
|
-
const m =
|
|
46
|
-
const b =
|
|
47
|
-
const _ =
|
|
44
|
+
const w = {};
|
|
45
|
+
const m = "sp";
|
|
46
|
+
const b = typeof Proxy === "function";
|
|
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;
|
|
@@ -106,8 +107,8 @@ function markNode(e, r = n) {
|
|
|
106
107
|
for (let n = e.O; n !== null; n = n.P) {
|
|
107
108
|
markNode(n.k, t);
|
|
108
109
|
}
|
|
109
|
-
if (e.
|
|
110
|
-
for (let n = e.
|
|
110
|
+
if (e.A !== null) {
|
|
111
|
+
for (let n = e.A; n !== null; n = n.C) {
|
|
111
112
|
for (let e = n.O; e !== null; e = e.P) {
|
|
112
113
|
markNode(e.k, t);
|
|
113
114
|
}
|
|
@@ -116,12 +117,12 @@ function markNode(e, r = n) {
|
|
|
116
117
|
}
|
|
117
118
|
function runHeap(e, t) {
|
|
118
119
|
e._ = false;
|
|
119
|
-
for (e.
|
|
120
|
-
let n = e.l[e.
|
|
120
|
+
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
121
|
+
let n = e.l[e.j];
|
|
121
122
|
while (n !== undefined) {
|
|
122
123
|
if (n.m & i) t(n);
|
|
123
124
|
else adjustHeight(n, e);
|
|
124
|
-
n = e.l[e.
|
|
125
|
+
n = e.l[e.j];
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
e.S = 0;
|
|
@@ -129,7 +130,7 @@ function runHeap(e, t) {
|
|
|
129
130
|
function adjustHeight(e, t) {
|
|
130
131
|
deleteFromHeap(e, t);
|
|
131
132
|
let n = e.o;
|
|
132
|
-
for (let t = e.
|
|
133
|
+
for (let t = e.W; t; t = t.N) {
|
|
133
134
|
const e = t.L;
|
|
134
135
|
const r = e.I || e;
|
|
135
136
|
if (r.R && r.o >= n) n = r.o + 1;
|
|
@@ -141,15 +142,15 @@ function adjustHeight(e, t) {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
let
|
|
148
|
-
let
|
|
145
|
+
const x = new Set();
|
|
146
|
+
const v = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
147
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
+
let k = 0;
|
|
149
|
+
let A = null;
|
|
149
150
|
let C = false;
|
|
150
|
-
let
|
|
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
166
|
if (C) return;
|
|
166
167
|
C = true;
|
|
167
|
-
if (!
|
|
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
|
-
C =
|
|
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
|
-
if (s.
|
|
371
|
+
const s = i.k.m & o ? P : v;
|
|
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
|
+
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
447
|
while (C) {
|
|
447
|
-
|
|
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;
|
|
@@ -553,32 +554,32 @@ function handleAsync(e, t, r) {
|
|
|
553
554
|
let u;
|
|
554
555
|
const handleError = n => {
|
|
555
556
|
if (e.me !== t) return;
|
|
556
|
-
|
|
557
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
558
|
-
e.$ =
|
|
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
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
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
|
-
for (let r = e.
|
|
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,38 +717,38 @@ function unlinkSubs(e) {
|
|
|
716
717
|
return n;
|
|
717
718
|
}
|
|
718
719
|
function unobserved(e) {
|
|
719
|
-
deleteFromHeap(e, e.m & o ?
|
|
720
|
-
let t = e.
|
|
720
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
721
|
+
let t = e.W;
|
|
721
722
|
while (t !== null) {
|
|
722
723
|
t = unlinkSubs(t);
|
|
723
724
|
}
|
|
724
|
-
e.
|
|
725
|
+
e.W = null;
|
|
725
726
|
disposeChildren(e, true);
|
|
726
727
|
}
|
|
727
728
|
function link(e, t) {
|
|
728
|
-
const n = t.
|
|
729
|
+
const n = t.Ae;
|
|
729
730
|
if (n !== null && n.L === e) return;
|
|
730
731
|
let i = null;
|
|
731
732
|
const s = t.m & r;
|
|
732
733
|
if (s) {
|
|
733
|
-
i = n !== null ? n.N : t.
|
|
734
|
+
i = n !== null ? n.N : t.W;
|
|
734
735
|
if (i !== null && i.L === e) {
|
|
735
|
-
t.
|
|
736
|
+
t.Ae = i;
|
|
736
737
|
return;
|
|
737
738
|
}
|
|
738
739
|
}
|
|
739
740
|
const o = e.ve;
|
|
740
741
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
741
|
-
const u = (t.
|
|
742
|
+
const u = (t.Ae = e.ve = { L: e, k: t, N: i, xe: o, P: null });
|
|
742
743
|
if (n !== null) n.N = u;
|
|
743
|
-
else t.
|
|
744
|
+
else t.W = u;
|
|
744
745
|
if (o !== null) o.P = u;
|
|
745
746
|
else e.O = u;
|
|
746
747
|
}
|
|
747
748
|
function isValidLink(e, t) {
|
|
748
|
-
const n = t.
|
|
749
|
+
const n = t.Ae;
|
|
749
750
|
if (n !== null) {
|
|
750
|
-
let r = t.
|
|
751
|
+
let r = t.W;
|
|
751
752
|
do {
|
|
752
753
|
if (r === e) return true;
|
|
753
754
|
if (r === n) break;
|
|
@@ -756,53 +757,53 @@ function isValidLink(e, t) {
|
|
|
756
757
|
}
|
|
757
758
|
return false;
|
|
758
759
|
}
|
|
759
|
-
const
|
|
760
|
+
const L = {};
|
|
760
761
|
function markDisposal(e) {
|
|
761
|
-
let t = e.
|
|
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
|
-
t = t.
|
|
770
|
+
t = t.Ee;
|
|
770
771
|
}
|
|
771
772
|
}
|
|
772
773
|
function dispose(e) {
|
|
773
|
-
let t = e.
|
|
774
|
+
let t = e.W || null;
|
|
774
775
|
do {
|
|
775
776
|
t = unlinkSubs(t);
|
|
776
777
|
} while (t !== null);
|
|
777
|
-
e.
|
|
778
|
-
e.
|
|
778
|
+
e.W = null;
|
|
779
|
+
e.Ae = null;
|
|
779
780
|
disposeChildren(e, true);
|
|
780
781
|
}
|
|
781
782
|
function disposeChildren(e, t = false, n) {
|
|
782
783
|
if (e.m & u) return;
|
|
783
784
|
if (t) e.m = u;
|
|
784
|
-
let r = n ? e.
|
|
785
|
+
let r = n ? e.je : e.Ce;
|
|
785
786
|
while (r) {
|
|
786
|
-
const e = r.
|
|
787
|
-
if (r.
|
|
787
|
+
const e = r.Ee;
|
|
788
|
+
if (r.W) {
|
|
788
789
|
const e = r;
|
|
789
|
-
deleteFromHeap(e, e.m & o ?
|
|
790
|
-
let t = e.
|
|
790
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
791
|
+
let t = e.W;
|
|
791
792
|
do {
|
|
792
793
|
t = unlinkSubs(t);
|
|
793
794
|
} while (t !== null);
|
|
794
|
-
e.
|
|
795
|
-
e.
|
|
795
|
+
e.W = null;
|
|
796
|
+
e.Ae = null;
|
|
796
797
|
}
|
|
797
798
|
disposeChildren(r, true);
|
|
798
799
|
r = e;
|
|
799
800
|
}
|
|
800
801
|
if (n) {
|
|
801
|
-
e.
|
|
802
|
+
e.je = null;
|
|
802
803
|
} else {
|
|
803
|
-
e.
|
|
804
|
-
e.
|
|
805
|
-
e.
|
|
804
|
+
e.Ce = null;
|
|
805
|
+
e.Ee = null;
|
|
806
|
+
e.We = 0;
|
|
806
807
|
}
|
|
807
808
|
runDisposal(e, n);
|
|
808
809
|
}
|
|
@@ -822,7 +823,7 @@ function runDisposal(e, t) {
|
|
|
822
823
|
function childId(e, t) {
|
|
823
824
|
let n = e;
|
|
824
825
|
while (n.Ie && n.i) n = n.i;
|
|
825
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
826
|
+
if (n.id != null) return formatId(n.id, t ? n.We++ : n.We);
|
|
826
827
|
throw new Error("Cannot get child id from owner without an id");
|
|
827
828
|
}
|
|
828
829
|
function getNextChildId(e) {
|
|
@@ -837,50 +838,50 @@ 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),
|
|
861
862
|
Ie: n || undefined,
|
|
862
863
|
t: true,
|
|
863
864
|
u: t?.t ? t.u : t,
|
|
864
|
-
|
|
865
|
-
|
|
865
|
+
Ce: null,
|
|
866
|
+
Ee: null,
|
|
866
867
|
Le: null,
|
|
867
|
-
fe: t?.fe ??
|
|
868
|
-
Re: t?.Re ||
|
|
869
|
-
|
|
868
|
+
fe: t?.fe ?? j,
|
|
869
|
+
Re: t?.Re || _,
|
|
870
|
+
We: 0,
|
|
870
871
|
Ne: null,
|
|
871
|
-
|
|
872
|
+
je: null,
|
|
872
873
|
i: t,
|
|
873
874
|
dispose(e = true) {
|
|
874
875
|
disposeChildren(r, e);
|
|
875
876
|
}
|
|
876
877
|
};
|
|
877
878
|
if (t) {
|
|
878
|
-
const e = t.
|
|
879
|
+
const e = t.Ce;
|
|
879
880
|
if (e === null) {
|
|
880
|
-
t.
|
|
881
|
+
t.Ce = r;
|
|
881
882
|
} else {
|
|
882
|
-
r.
|
|
883
|
-
t.
|
|
883
|
+
r.Ee = e;
|
|
884
|
+
t.Ce = r;
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
887
|
return r;
|
|
@@ -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;
|
|
@@ -960,27 +961,27 @@ function trackedEffect(e, t) {
|
|
|
960
961
|
}
|
|
961
962
|
},
|
|
962
963
|
undefined,
|
|
963
|
-
{ ...t, lazy: true
|
|
964
|
+
{ ...t, lazy: true }
|
|
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;
|
|
@@ -1001,10 +1002,10 @@ function releaseSnapshotScope(e) {
|
|
|
1001
1002
|
schedule();
|
|
1002
1003
|
}
|
|
1003
1004
|
function releaseSubtree(e) {
|
|
1004
|
-
let t = e.
|
|
1005
|
+
let t = e.Ce;
|
|
1005
1006
|
while (t) {
|
|
1006
1007
|
if (t.qe) {
|
|
1007
|
-
t = t.
|
|
1008
|
+
t = t.Ee;
|
|
1008
1009
|
continue;
|
|
1009
1010
|
}
|
|
1010
1011
|
if (t.R) {
|
|
@@ -1013,55 +1014,55 @@ 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);
|
|
1021
|
-
t = t.
|
|
1022
|
+
t = t.Ee;
|
|
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;
|
|
1043
|
-
t.
|
|
1044
|
+
t.je = t.Ce;
|
|
1044
1045
|
t.Le = null;
|
|
1045
|
-
t.
|
|
1046
|
-
t.
|
|
1046
|
+
t.Ce = null;
|
|
1047
|
+
t.We = 0;
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
1050
|
const s = !!(t.m & f);
|
|
1050
1051
|
const u = hasActiveOverride(t);
|
|
1051
|
-
const
|
|
1052
|
-
const p =
|
|
1053
|
-
|
|
1054
|
-
t.
|
|
1052
|
+
const c = !!(t.de & a);
|
|
1053
|
+
const p = q;
|
|
1054
|
+
q = t;
|
|
1055
|
+
t.Ae = null;
|
|
1055
1056
|
t.m = r;
|
|
1056
|
-
t.$ =
|
|
1057
|
-
let h = t.ce ===
|
|
1058
|
-
let
|
|
1059
|
-
let w =
|
|
1060
|
-
let m =
|
|
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,33 +1083,33 @@ 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
|
-
const e = t.
|
|
1097
|
-
let r = e !== null ? e.N : t.
|
|
1097
|
+
const e = t.Ae;
|
|
1098
|
+
let r = e !== null ? e.N : t.W;
|
|
1098
1099
|
if (r !== null) {
|
|
1099
1100
|
do {
|
|
1100
1101
|
r = unlinkSubs(r);
|
|
1101
1102
|
} while (r !== null);
|
|
1102
1103
|
if (e !== null) e.N = null;
|
|
1103
|
-
else t.
|
|
1104
|
+
else t.W = null;
|
|
1104
1105
|
}
|
|
1105
|
-
const f = u ? t.ae : t.ce ===
|
|
1106
|
+
const f = u ? t.ae : t.ce === S ? t.ae : t.ce;
|
|
1106
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,19 +1119,19 @@ 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) {
|
|
1133
|
-
for (let e = r.
|
|
1134
|
+
for (let e = r.W; e; e = e.N) {
|
|
1134
1135
|
const t = e.L;
|
|
1135
1136
|
const i = t.I || t;
|
|
1136
1137
|
if (i.R) {
|
|
@@ -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,55 +1150,55 @@ 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:
|
|
1160
|
-
|
|
1159
|
+
fe: q?.fe ?? j,
|
|
1160
|
+
Re: q?.Re ?? _,
|
|
1161
|
+
We: 0,
|
|
1161
1162
|
R: t,
|
|
1162
1163
|
ae: n,
|
|
1163
1164
|
o: 0,
|
|
1164
|
-
|
|
1165
|
+
A: null,
|
|
1165
1166
|
h: undefined,
|
|
1166
1167
|
p: null,
|
|
1167
|
-
|
|
1168
|
-
|
|
1168
|
+
W: null,
|
|
1169
|
+
Ae: null,
|
|
1169
1170
|
O: null,
|
|
1170
1171
|
ve: null,
|
|
1171
|
-
i:
|
|
1172
|
-
We: null,
|
|
1173
|
-
Ae: null,
|
|
1174
|
-
m: e,
|
|
1175
|
-
de: d,
|
|
1176
|
-
$: P,
|
|
1177
|
-
ce: g,
|
|
1178
|
-
Ne: null,
|
|
1172
|
+
i: q,
|
|
1179
1173
|
Ee: null,
|
|
1174
|
+
Ce: null,
|
|
1175
|
+
m: r?.lazy ? c : e,
|
|
1176
|
+
de: p,
|
|
1177
|
+
$: k,
|
|
1178
|
+
ce: S,
|
|
1179
|
+
Ne: null,
|
|
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
|
-
s.
|
|
1191
|
-
|
|
1191
|
+
s.Ee = e;
|
|
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;
|
|
@@ -1210,15 +1211,15 @@ function signal(e, t, n = null) {
|
|
|
1210
1211
|
ae: e,
|
|
1211
1212
|
O: null,
|
|
1212
1213
|
ve: null,
|
|
1213
|
-
$:
|
|
1214
|
+
$: k,
|
|
1214
1215
|
I: n,
|
|
1215
|
-
|
|
1216
|
-
ce:
|
|
1216
|
+
C: n?.A || null,
|
|
1217
|
+
ce: S
|
|
1217
1218
|
};
|
|
1218
|
-
n && (n.
|
|
1219
|
-
if (
|
|
1220
|
-
r.ie = e === undefined ?
|
|
1221
|
-
|
|
1219
|
+
n && (n.A = r);
|
|
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
|
-
const t =
|
|
1256
|
-
const n =
|
|
1257
|
-
|
|
1255
|
+
if (M) {
|
|
1256
|
+
const t = getLatestValueComputed(e);
|
|
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
|
+
if (t && I) {
|
|
1292
1297
|
if (e.R && e.m & u) recompute(e);
|
|
1293
1298
|
link(e, t);
|
|
1294
1299
|
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;
|
|
@@ -1306,91 +1311,91 @@ function read(e) {
|
|
|
1306
1311
|
}
|
|
1307
1312
|
}
|
|
1308
1313
|
const n = e.I || e;
|
|
1309
|
-
if (n.de &
|
|
1310
|
-
if (t && !(
|
|
1311
|
-
if (
|
|
1314
|
+
if (n.de & a) {
|
|
1315
|
+
if (t && !(R && n.ne && A !== n.ne)) {
|
|
1316
|
+
if (F) {
|
|
1312
1317
|
const r = n.re;
|
|
1313
|
-
const i = findLane(
|
|
1318
|
+
const i = findLane(F);
|
|
1314
1319
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1315
|
-
if (!
|
|
1320
|
+
if (!I) link(e, t);
|
|
1316
1321
|
throw n.Y;
|
|
1317
1322
|
}
|
|
1318
1323
|
} else {
|
|
1319
|
-
if (!
|
|
1324
|
+
if (!I) link(e, t);
|
|
1320
1325
|
throw n.Y;
|
|
1321
1326
|
}
|
|
1322
|
-
} else if (!t && n.de &
|
|
1327
|
+
} else if (!t && n.de & p) {
|
|
1323
1328
|
throw n.Y;
|
|
1324
1329
|
}
|
|
1325
1330
|
}
|
|
1326
|
-
if (e.R && e.de &
|
|
1327
|
-
if (e.$ <
|
|
1331
|
+
if (e.R && e.de & d) {
|
|
1332
|
+
if (e.$ < k) {
|
|
1328
1333
|
recompute(e, true);
|
|
1329
1334
|
return read(e);
|
|
1330
1335
|
} else throw e.Y;
|
|
1331
1336
|
}
|
|
1332
|
-
if (
|
|
1337
|
+
if (V && t && t.se) {
|
|
1333
1338
|
const n = e.ie;
|
|
1334
1339
|
if (n !== undefined) {
|
|
1335
|
-
const r = n ===
|
|
1336
|
-
const i = e.ce !==
|
|
1340
|
+
const r = n === w ? undefined : n;
|
|
1341
|
+
const i = e.ce !== S ? e.ce : e.ae;
|
|
1337
1342
|
if (i !== r) t.m |= l;
|
|
1338
1343
|
return r;
|
|
1339
1344
|
}
|
|
1340
1345
|
}
|
|
1341
|
-
return !t ||
|
|
1346
|
+
return !t || F !== null || e.ce === S || (R && e.ne && A !== e.ne) ? e.ae : e.ce;
|
|
1342
1347
|
}
|
|
1343
1348
|
function setSignal(e, t) {
|
|
1344
|
-
if (e.ne &&
|
|
1345
|
-
const n = e.we && !
|
|
1346
|
-
const r = n ? e.ae : e.ce ===
|
|
1349
|
+
if (e.ne && A !== e.ne) j.initTransition(e.ne);
|
|
1350
|
+
const n = e.we && !E;
|
|
1351
|
+
const r = n ? e.ae : e.ce === S ? e.ae : e.ce;
|
|
1347
1352
|
if (typeof t === "function") t = t(r);
|
|
1348
1353
|
const i = !e.be || !e.be(r, t);
|
|
1349
1354
|
if (!i) {
|
|
1350
|
-
if (n && e.ce !==
|
|
1355
|
+
if (n && e.ce !== S && e.R) {
|
|
1351
1356
|
insertSubs(e, true);
|
|
1352
1357
|
schedule();
|
|
1353
1358
|
}
|
|
1354
1359
|
return t;
|
|
1355
1360
|
}
|
|
1356
1361
|
if (n) {
|
|
1357
|
-
const n =
|
|
1362
|
+
const n = j.B.includes(e);
|
|
1358
1363
|
if (e.ne && n) {
|
|
1359
|
-
|
|
1364
|
+
j.initTransition(e.ne);
|
|
1360
1365
|
}
|
|
1361
|
-
if (e.ce ===
|
|
1366
|
+
if (e.ce === S) {
|
|
1362
1367
|
e.ce = e.ae;
|
|
1363
1368
|
}
|
|
1364
1369
|
if (!n) {
|
|
1365
|
-
|
|
1370
|
+
j.B.push(e);
|
|
1366
1371
|
}
|
|
1367
1372
|
e.Se = (e.Se || 0) + 1;
|
|
1368
1373
|
const r = getOrCreateLane(e);
|
|
1369
1374
|
e.re = r;
|
|
1370
1375
|
e.ae = t;
|
|
1371
1376
|
} else {
|
|
1372
|
-
if (e.ce ===
|
|
1377
|
+
if (e.ce === S) j.D.push(e);
|
|
1373
1378
|
e.ce = t;
|
|
1374
1379
|
}
|
|
1375
1380
|
updatePendingSignal(e);
|
|
1376
1381
|
if (e._e) {
|
|
1377
1382
|
setSignal(e._e, t);
|
|
1378
1383
|
}
|
|
1379
|
-
e.$ =
|
|
1384
|
+
e.$ = k;
|
|
1380
1385
|
insertSubs(e, n);
|
|
1381
1386
|
schedule();
|
|
1382
1387
|
return t;
|
|
1383
1388
|
}
|
|
1384
1389
|
function runWithOwner(e, t) {
|
|
1385
|
-
const n =
|
|
1386
|
-
const r =
|
|
1387
|
-
|
|
1388
|
-
|
|
1390
|
+
const n = q;
|
|
1391
|
+
const r = I;
|
|
1392
|
+
q = e;
|
|
1393
|
+
I = false;
|
|
1389
1394
|
try {
|
|
1390
1395
|
return t();
|
|
1391
1396
|
} finally {
|
|
1392
|
-
|
|
1393
|
-
|
|
1397
|
+
q = n;
|
|
1398
|
+
I = r;
|
|
1394
1399
|
}
|
|
1395
1400
|
}
|
|
1396
1401
|
function getPendingSignal(e) {
|
|
@@ -1405,16 +1410,16 @@ function getPendingSignal(e) {
|
|
|
1405
1410
|
}
|
|
1406
1411
|
function computePendingState(e) {
|
|
1407
1412
|
const t = e;
|
|
1408
|
-
if (e.we && e.ce !==
|
|
1409
|
-
if (t.de &
|
|
1413
|
+
if (e.we && e.ce !== S) {
|
|
1414
|
+
if (t.de & a && !(t.de & p)) return true;
|
|
1410
1415
|
if (e.he) {
|
|
1411
1416
|
const t = e.re ? findLane(e.re) : null;
|
|
1412
1417
|
return !!(t && t.T.size > 0);
|
|
1413
1418
|
}
|
|
1414
1419
|
return true;
|
|
1415
1420
|
}
|
|
1416
|
-
if (e.ce !==
|
|
1417
|
-
return !!(t.de &
|
|
1421
|
+
if (e.ce !== S && !(t.de & p)) return true;
|
|
1422
|
+
return !!(t.de & a && !(t.de & p));
|
|
1418
1423
|
}
|
|
1419
1424
|
function updatePendingSignal(e) {
|
|
1420
1425
|
if (e.Ve) {
|
|
@@ -1429,78 +1434,78 @@ function updatePendingSignal(e) {
|
|
|
1429
1434
|
mergeLanes(t, e);
|
|
1430
1435
|
}
|
|
1431
1436
|
}
|
|
1432
|
-
|
|
1437
|
+
W.delete(n);
|
|
1433
1438
|
n.re = undefined;
|
|
1434
1439
|
}
|
|
1435
1440
|
}
|
|
1436
1441
|
}
|
|
1437
|
-
function
|
|
1442
|
+
function getLatestValueComputed(e) {
|
|
1438
1443
|
if (!e._e) {
|
|
1439
|
-
const t =
|
|
1440
|
-
|
|
1441
|
-
const n =
|
|
1442
|
-
|
|
1443
|
-
const r =
|
|
1444
|
-
|
|
1444
|
+
const t = M;
|
|
1445
|
+
M = false;
|
|
1446
|
+
const n = Q;
|
|
1447
|
+
Q = false;
|
|
1448
|
+
const r = q;
|
|
1449
|
+
q = null;
|
|
1445
1450
|
e._e = optimisticComputed(() => read(e));
|
|
1446
1451
|
e._e.he = e;
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1452
|
+
q = r;
|
|
1453
|
+
Q = n;
|
|
1454
|
+
M = t;
|
|
1450
1455
|
}
|
|
1451
1456
|
return e._e;
|
|
1452
1457
|
}
|
|
1453
1458
|
function staleValues(e, t = true) {
|
|
1454
|
-
const n =
|
|
1455
|
-
|
|
1459
|
+
const n = R;
|
|
1460
|
+
R = t;
|
|
1456
1461
|
try {
|
|
1457
1462
|
return e();
|
|
1458
1463
|
} finally {
|
|
1459
|
-
|
|
1464
|
+
R = n;
|
|
1460
1465
|
}
|
|
1461
1466
|
}
|
|
1462
|
-
function
|
|
1463
|
-
const t =
|
|
1464
|
-
|
|
1467
|
+
function latest(e) {
|
|
1468
|
+
const t = M;
|
|
1469
|
+
M = true;
|
|
1465
1470
|
try {
|
|
1466
1471
|
return e();
|
|
1467
1472
|
} finally {
|
|
1468
|
-
|
|
1473
|
+
M = t;
|
|
1469
1474
|
}
|
|
1470
1475
|
}
|
|
1471
1476
|
function isPending(e) {
|
|
1472
|
-
const t =
|
|
1473
|
-
const n =
|
|
1474
|
-
|
|
1475
|
-
|
|
1477
|
+
const t = Q;
|
|
1478
|
+
const n = T;
|
|
1479
|
+
Q = true;
|
|
1480
|
+
T = false;
|
|
1476
1481
|
try {
|
|
1477
1482
|
e();
|
|
1478
|
-
return
|
|
1483
|
+
return T;
|
|
1479
1484
|
} catch {
|
|
1480
|
-
return
|
|
1485
|
+
return T;
|
|
1481
1486
|
} finally {
|
|
1482
|
-
|
|
1483
|
-
|
|
1487
|
+
Q = t;
|
|
1488
|
+
T = n;
|
|
1484
1489
|
}
|
|
1485
1490
|
}
|
|
1486
1491
|
function refresh(e) {
|
|
1487
|
-
let t =
|
|
1488
|
-
|
|
1492
|
+
let t = H;
|
|
1493
|
+
H = true;
|
|
1489
1494
|
try {
|
|
1490
1495
|
if (typeof e !== "function") {
|
|
1491
|
-
recompute(e[
|
|
1496
|
+
recompute(e[O]);
|
|
1492
1497
|
return e;
|
|
1493
1498
|
}
|
|
1494
1499
|
return untrack(e);
|
|
1495
1500
|
} finally {
|
|
1496
|
-
|
|
1501
|
+
H = t;
|
|
1497
1502
|
if (!t) {
|
|
1498
1503
|
schedule();
|
|
1499
1504
|
}
|
|
1500
1505
|
}
|
|
1501
1506
|
}
|
|
1502
1507
|
function isRefreshing() {
|
|
1503
|
-
return
|
|
1508
|
+
return H;
|
|
1504
1509
|
}
|
|
1505
1510
|
function createContext(e, t) {
|
|
1506
1511
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1528,7 +1533,7 @@ function isUndefined(e) {
|
|
|
1528
1533
|
return typeof e === "undefined";
|
|
1529
1534
|
}
|
|
1530
1535
|
function restoreTransition(e, t) {
|
|
1531
|
-
|
|
1536
|
+
j.initTransition(e);
|
|
1532
1537
|
const n = t();
|
|
1533
1538
|
flush();
|
|
1534
1539
|
return n;
|
|
@@ -1537,8 +1542,8 @@ function action(e) {
|
|
|
1537
1542
|
return (...t) =>
|
|
1538
1543
|
new Promise((n, r) => {
|
|
1539
1544
|
const i = e(...t);
|
|
1540
|
-
|
|
1541
|
-
let s =
|
|
1545
|
+
j.initTransition();
|
|
1546
|
+
let s = A;
|
|
1542
1547
|
s.ee.push(i);
|
|
1543
1548
|
const done = (e, t) => {
|
|
1544
1549
|
s = currentTransition(s);
|
|
@@ -1634,13 +1639,13 @@ function createOptimistic(e, t, n) {
|
|
|
1634
1639
|
function onSettled(e) {
|
|
1635
1640
|
getOwner()
|
|
1636
1641
|
? createTrackedEffect(() => untrack(e))
|
|
1637
|
-
:
|
|
1642
|
+
: j.enqueue(y, () => {
|
|
1638
1643
|
const t = e();
|
|
1639
1644
|
t?.();
|
|
1640
1645
|
});
|
|
1641
1646
|
}
|
|
1642
1647
|
function unwrap(e) {
|
|
1643
|
-
return e?.[
|
|
1648
|
+
return e?.[U]?.[te] ?? e;
|
|
1644
1649
|
}
|
|
1645
1650
|
function getOverrideValue(e, t, n, r, i) {
|
|
1646
1651
|
if (i && r in i) return i[r];
|
|
@@ -1652,16 +1657,16 @@ function getAllKeys(e, t, n) {
|
|
|
1652
1657
|
return Array.from(new Set([...r, ...i]));
|
|
1653
1658
|
}
|
|
1654
1659
|
function applyState(e, t, n, r) {
|
|
1655
|
-
const i = t?.[
|
|
1660
|
+
const i = t?.[U];
|
|
1656
1661
|
if (!i) return;
|
|
1657
|
-
const s = i[
|
|
1658
|
-
const o = i[
|
|
1659
|
-
const u = i[
|
|
1660
|
-
let f = i[
|
|
1662
|
+
const s = i[Z];
|
|
1663
|
+
const o = i[$];
|
|
1664
|
+
const u = i[ee];
|
|
1665
|
+
let f = i[te];
|
|
1661
1666
|
if (e === s && !o && !u) return;
|
|
1662
|
-
(i[
|
|
1663
|
-
i[
|
|
1664
|
-
i[
|
|
1667
|
+
(i[ie] || ue).set(e, i[J]);
|
|
1668
|
+
i[Z] = e;
|
|
1669
|
+
i[$] = undefined;
|
|
1665
1670
|
if (Array.isArray(s)) {
|
|
1666
1671
|
let t = false;
|
|
1667
1672
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
@@ -1689,16 +1694,16 @@ function applyState(e, t, n, r) {
|
|
|
1689
1694
|
if (d > h || d > p) {
|
|
1690
1695
|
for (a = d; a <= h; a++) {
|
|
1691
1696
|
t = true;
|
|
1692
|
-
i[
|
|
1697
|
+
i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1693
1698
|
}
|
|
1694
1699
|
for (; a < e.length; a++) {
|
|
1695
1700
|
t = true;
|
|
1696
1701
|
const s = wrap(w[a], i);
|
|
1697
|
-
i[
|
|
1702
|
+
i[te][a] && setSignal(i[te][a], s);
|
|
1698
1703
|
applyState(e[a], s, n, r);
|
|
1699
1704
|
}
|
|
1700
|
-
t && i[
|
|
1701
|
-
l !== e.length && i[
|
|
1705
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1706
|
+
l !== e.length && i[te].length && setSignal(i[te].length, e.length);
|
|
1702
1707
|
return;
|
|
1703
1708
|
}
|
|
1704
1709
|
g = new Array(h + 1);
|
|
@@ -1722,26 +1727,26 @@ function applyState(e, t, n, r) {
|
|
|
1722
1727
|
for (a = d; a < e.length; a++) {
|
|
1723
1728
|
if (a in w) {
|
|
1724
1729
|
const t = wrap(w[a], i);
|
|
1725
|
-
i[
|
|
1730
|
+
i[te][a] && setSignal(i[te][a], t);
|
|
1726
1731
|
applyState(e[a], t, n, r);
|
|
1727
|
-
} else i[
|
|
1732
|
+
} else i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1728
1733
|
}
|
|
1729
1734
|
if (d < e.length) t = true;
|
|
1730
1735
|
} else if (e.length) {
|
|
1731
1736
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1732
1737
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1733
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1738
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[te][t] && setSignal(i[te][t], e[t]);
|
|
1734
1739
|
}
|
|
1735
1740
|
}
|
|
1736
1741
|
if (l !== e.length) {
|
|
1737
1742
|
t = true;
|
|
1738
|
-
i[
|
|
1743
|
+
i[te].length && setSignal(i[te].length, e.length);
|
|
1739
1744
|
}
|
|
1740
|
-
t && i[
|
|
1745
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1741
1746
|
return;
|
|
1742
1747
|
}
|
|
1743
1748
|
if (f) {
|
|
1744
|
-
const t = f[
|
|
1749
|
+
const t = f[K];
|
|
1745
1750
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1746
1751
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1747
1752
|
const a = l[c];
|
|
@@ -1755,7 +1760,7 @@ function applyState(e, t, n, r) {
|
|
|
1755
1760
|
} else applyState(h, wrap(p, i), n, r);
|
|
1756
1761
|
}
|
|
1757
1762
|
}
|
|
1758
|
-
if ((f = i[
|
|
1763
|
+
if ((f = i[ne])) {
|
|
1759
1764
|
const t = Object.keys(f);
|
|
1760
1765
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1761
1766
|
const r = t[n];
|
|
@@ -1777,9 +1782,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1777
1782
|
let r;
|
|
1778
1783
|
const i = new WeakMap();
|
|
1779
1784
|
const wrapper = e => {
|
|
1780
|
-
e[
|
|
1781
|
-
e[
|
|
1782
|
-
Object.defineProperty(e,
|
|
1785
|
+
e[re] = wrapProjection;
|
|
1786
|
+
e[ie] = i;
|
|
1787
|
+
Object.defineProperty(e, se, {
|
|
1783
1788
|
get() {
|
|
1784
1789
|
return r;
|
|
1785
1790
|
},
|
|
@@ -1788,15 +1793,15 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1788
1793
|
};
|
|
1789
1794
|
const wrapProjection = e => {
|
|
1790
1795
|
if (i.has(e)) return i.get(e);
|
|
1791
|
-
if (e[
|
|
1792
|
-
const t = createStoreProxy(e,
|
|
1796
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
1797
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
1793
1798
|
i.set(e, t);
|
|
1794
1799
|
return t;
|
|
1795
1800
|
};
|
|
1796
1801
|
const s = wrapProjection(t);
|
|
1797
1802
|
r = computed(() => {
|
|
1798
1803
|
const t = getOwner();
|
|
1799
|
-
storeSetter(new Proxy(s,
|
|
1804
|
+
storeSetter(new Proxy(s, G), r => {
|
|
1800
1805
|
const i = handleAsync(t, e(r), e => {
|
|
1801
1806
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1802
1807
|
setSignal(t, undefined);
|
|
@@ -1810,7 +1815,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1810
1815
|
function createProjection(e, t = {}, n) {
|
|
1811
1816
|
return createProjectionInternal(e, t, n).store;
|
|
1812
1817
|
}
|
|
1813
|
-
const
|
|
1818
|
+
const G = {
|
|
1814
1819
|
get(e, t) {
|
|
1815
1820
|
let n;
|
|
1816
1821
|
setWriteOverride(true);
|
|
@@ -1821,7 +1826,7 @@ const B = {
|
|
|
1821
1826
|
setWriteOverride(false);
|
|
1822
1827
|
setProjectionWriteActive(false);
|
|
1823
1828
|
}
|
|
1824
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1829
|
+
return typeof n === "object" && n !== null ? new Proxy(n, G) : n;
|
|
1825
1830
|
},
|
|
1826
1831
|
set(e, t, n) {
|
|
1827
1832
|
setWriteOverride(true);
|
|
@@ -1846,46 +1851,46 @@ const B = {
|
|
|
1846
1851
|
return true;
|
|
1847
1852
|
}
|
|
1848
1853
|
};
|
|
1849
|
-
const
|
|
1850
|
-
K = Symbol(0),
|
|
1854
|
+
const K = Symbol(0),
|
|
1851
1855
|
z = Symbol(0),
|
|
1852
1856
|
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
|
-
|
|
1857
|
+
J = Symbol(0),
|
|
1858
|
+
X = Symbol(0);
|
|
1859
|
+
const Y = new WeakMap();
|
|
1860
|
+
const Z = "v",
|
|
1861
|
+
$ = "o",
|
|
1862
|
+
ee = "x",
|
|
1863
|
+
te = "n",
|
|
1864
|
+
ne = "h",
|
|
1865
|
+
re = "w",
|
|
1866
|
+
ie = "l",
|
|
1867
|
+
se = "f",
|
|
1868
|
+
oe = "p";
|
|
1869
|
+
function createStoreProxy(e, t = ce, n) {
|
|
1865
1870
|
let r;
|
|
1866
1871
|
if (Array.isArray(e)) {
|
|
1867
1872
|
r = [];
|
|
1868
1873
|
r.v = e;
|
|
1869
1874
|
} else r = { v: e };
|
|
1870
1875
|
n && n(r);
|
|
1871
|
-
return (r[
|
|
1876
|
+
return (r[J] = new Proxy(r, t));
|
|
1872
1877
|
}
|
|
1873
|
-
const
|
|
1878
|
+
const ue = new WeakMap();
|
|
1874
1879
|
function wrap(e, t) {
|
|
1875
|
-
if (t?.[
|
|
1876
|
-
let n = e[
|
|
1877
|
-
if (!n)
|
|
1880
|
+
if (t?.[re]) return t[re](e, t);
|
|
1881
|
+
let n = e[J] || ue.get(e);
|
|
1882
|
+
if (!n) ue.set(e, (n = createStoreProxy(e)));
|
|
1878
1883
|
return n;
|
|
1879
1884
|
}
|
|
1880
1885
|
function isWrappable(e) {
|
|
1881
1886
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1882
1887
|
}
|
|
1883
|
-
let
|
|
1888
|
+
let fe = false;
|
|
1884
1889
|
function setWriteOverride(e) {
|
|
1885
|
-
|
|
1890
|
+
fe = e;
|
|
1886
1891
|
}
|
|
1887
1892
|
function writeOnly(e) {
|
|
1888
|
-
return
|
|
1893
|
+
return fe || !!le?.has(e);
|
|
1889
1894
|
}
|
|
1890
1895
|
function getNodes(e, t) {
|
|
1891
1896
|
let n = e[t];
|
|
@@ -1907,13 +1912,13 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1907
1912
|
if (s) u.we = true;
|
|
1908
1913
|
if (o && t in o) {
|
|
1909
1914
|
const e = o[t];
|
|
1910
|
-
u.ie = e === undefined ?
|
|
1911
|
-
|
|
1915
|
+
u.ie = e === undefined ? w : e;
|
|
1916
|
+
D?.add(u);
|
|
1912
1917
|
}
|
|
1913
1918
|
return (e[t] = u);
|
|
1914
1919
|
}
|
|
1915
|
-
function trackSelf(e, t =
|
|
1916
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1920
|
+
function trackSelf(e, t = K) {
|
|
1921
|
+
getObserver() && read(getNode(getNodes(e, te), t, undefined, e[se], false, e[oe]));
|
|
1917
1922
|
}
|
|
1918
1923
|
function getKeys(e, t, n = true) {
|
|
1919
1924
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1921,7 +1926,7 @@ function getKeys(e, t, n = true) {
|
|
|
1921
1926
|
const i = new Set(r);
|
|
1922
1927
|
const s = Reflect.ownKeys(t);
|
|
1923
1928
|
for (const e of s) {
|
|
1924
|
-
if (t[e] !==
|
|
1929
|
+
if (t[e] !== X) i.add(e);
|
|
1925
1930
|
else i.delete(e);
|
|
1926
1931
|
}
|
|
1927
1932
|
return Array.from(i);
|
|
@@ -1929,97 +1934,97 @@ function getKeys(e, t, n = true) {
|
|
|
1929
1934
|
function getPropertyDescriptor(e, t, n) {
|
|
1930
1935
|
let r = e;
|
|
1931
1936
|
if (t && n in t) {
|
|
1932
|
-
if (r[n] ===
|
|
1937
|
+
if (r[n] === X) return void 0;
|
|
1933
1938
|
if (!(n in r)) r = t;
|
|
1934
1939
|
}
|
|
1935
1940
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1936
1941
|
}
|
|
1937
|
-
let
|
|
1938
|
-
const
|
|
1942
|
+
let le = null;
|
|
1943
|
+
const ce = {
|
|
1939
1944
|
get(e, t, n) {
|
|
1940
|
-
if (t ===
|
|
1941
|
-
if (t ===
|
|
1942
|
-
if (t ===
|
|
1943
|
-
if (t ===
|
|
1945
|
+
if (t === U) return e;
|
|
1946
|
+
if (t === J) return n;
|
|
1947
|
+
if (t === O) return e[se];
|
|
1948
|
+
if (t === K || t === z) {
|
|
1944
1949
|
trackSelf(e, t);
|
|
1945
1950
|
return n;
|
|
1946
1951
|
}
|
|
1947
|
-
const r = getNodes(e,
|
|
1952
|
+
const r = getNodes(e, te);
|
|
1948
1953
|
const i = r[t];
|
|
1949
|
-
const s = e[
|
|
1950
|
-
const o = s || (e[
|
|
1951
|
-
const u = !!e[
|
|
1952
|
-
const f = s ? e[
|
|
1954
|
+
const s = e[ee] && t in e[ee];
|
|
1955
|
+
const o = s || (e[$] && t in e[$]);
|
|
1956
|
+
const u = !!e[Z][U];
|
|
1957
|
+
const f = s ? e[ee] : e[$] && t in e[$] ? e[$] : e[Z];
|
|
1953
1958
|
if (!i) {
|
|
1954
1959
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1955
1960
|
if (e && e.get) return e.get.call(n);
|
|
1956
1961
|
}
|
|
1957
1962
|
if (writeOnly(n)) {
|
|
1958
|
-
let n = i && (o || !u) ? (i.ce !==
|
|
1959
|
-
n ===
|
|
1963
|
+
let n = i && (o || !u) ? (i.ce !== S ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1964
|
+
n === X && (n = undefined);
|
|
1960
1965
|
if (!isWrappable(n)) return n;
|
|
1961
1966
|
const r = wrap(n, e);
|
|
1962
|
-
|
|
1967
|
+
le?.add(r);
|
|
1963
1968
|
return r;
|
|
1964
1969
|
}
|
|
1965
1970
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1966
|
-
l ===
|
|
1971
|
+
l === X && (l = undefined);
|
|
1967
1972
|
if (!i) {
|
|
1968
1973
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1969
1974
|
let t;
|
|
1970
|
-
return !Array.isArray(e[
|
|
1975
|
+
return !Array.isArray(e[Z]) && (t = Object.getPrototypeOf(e[Z])) && t !== Object.prototype
|
|
1971
1976
|
? l.bind(f)
|
|
1972
1977
|
: l;
|
|
1973
1978
|
} else if (getObserver()) {
|
|
1974
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1979
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[se], isEqual, e[oe], e[m]));
|
|
1975
1980
|
}
|
|
1976
1981
|
}
|
|
1977
1982
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1978
1983
|
},
|
|
1979
1984
|
has(e, t) {
|
|
1980
|
-
if (t ===
|
|
1981
|
-
const n = e[
|
|
1982
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1985
|
+
if (t === J || t === K || t === "__proto__") return true;
|
|
1986
|
+
const n = e[ee] && t in e[ee] ? e[ee][t] !== X : e[$] && t in e[$] ? e[$][t] !== X : t in e[Z];
|
|
1987
|
+
getObserver() && read(getNode(getNodes(e, ne), t, n, e[se], isEqual, e[oe]));
|
|
1983
1988
|
return n;
|
|
1984
1989
|
},
|
|
1985
1990
|
set(e, t, n) {
|
|
1986
|
-
const r = e[
|
|
1991
|
+
const r = e[J];
|
|
1987
1992
|
if (writeOnly(r)) {
|
|
1988
|
-
if (e[
|
|
1989
|
-
const t = e[
|
|
1993
|
+
if (e[oe]) {
|
|
1994
|
+
const t = e[se];
|
|
1990
1995
|
if (t?.ne) {
|
|
1991
|
-
|
|
1996
|
+
j.initTransition(t.ne);
|
|
1992
1997
|
}
|
|
1993
1998
|
}
|
|
1994
1999
|
untrack(() => {
|
|
1995
|
-
const i = e[
|
|
2000
|
+
const i = e[Z];
|
|
1996
2001
|
const s = i[t];
|
|
1997
|
-
if (
|
|
1998
|
-
if (!e[
|
|
1999
|
-
e[
|
|
2000
|
-
|
|
2002
|
+
if (V && typeof t !== "symbol") {
|
|
2003
|
+
if (!e[m]) {
|
|
2004
|
+
e[m] = Object.create(null);
|
|
2005
|
+
D?.add(e);
|
|
2001
2006
|
}
|
|
2002
|
-
if (!(t in e[
|
|
2003
|
-
e[
|
|
2007
|
+
if (!(t in e[m])) {
|
|
2008
|
+
e[m][t] = s;
|
|
2004
2009
|
}
|
|
2005
2010
|
}
|
|
2006
|
-
const o = e[
|
|
2007
|
-
const u = o ?
|
|
2011
|
+
const o = e[oe] && !E;
|
|
2012
|
+
const u = o ? ee : $;
|
|
2008
2013
|
if (o) trackOptimisticStore(r);
|
|
2009
|
-
const f = e[
|
|
2010
|
-
const l = n?.[
|
|
2014
|
+
const f = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : s;
|
|
2015
|
+
const l = n?.[U]?.[Z] ?? n;
|
|
2011
2016
|
if (f === l) return true;
|
|
2012
|
-
const c = e[
|
|
2017
|
+
const c = e[ee]?.length || e[$]?.length || i.length;
|
|
2013
2018
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2014
2019
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2015
2020
|
const a = isWrappable(l);
|
|
2016
2021
|
if (isWrappable(f)) {
|
|
2017
|
-
const e =
|
|
2018
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2022
|
+
const e = Y.get(f);
|
|
2023
|
+
e && (e instanceof Set ? e.delete(r) : Y.delete(f));
|
|
2019
2024
|
}
|
|
2020
|
-
if (recursivelyNotify(r,
|
|
2021
|
-
e[
|
|
2022
|
-
const d = getNodes(e,
|
|
2025
|
+
if (recursivelyNotify(r, ue) && a) recursivelyAddParent(l, r);
|
|
2026
|
+
e[ne]?.[t] && setSignal(e[ne][t], true);
|
|
2027
|
+
const d = getNodes(e, te);
|
|
2023
2028
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2024
2029
|
if (Array.isArray(i)) {
|
|
2025
2030
|
if (t === "length") {
|
|
@@ -2029,44 +2034,44 @@ const le = {
|
|
|
2029
2034
|
if (e > c) d.length && setSignal(d.length, e);
|
|
2030
2035
|
}
|
|
2031
2036
|
}
|
|
2032
|
-
d[
|
|
2037
|
+
d[K] && setSignal(d[K], undefined);
|
|
2033
2038
|
});
|
|
2034
2039
|
}
|
|
2035
2040
|
return true;
|
|
2036
2041
|
},
|
|
2037
2042
|
deleteProperty(e, t) {
|
|
2038
|
-
const n = e[
|
|
2039
|
-
const r = e[
|
|
2040
|
-
if (writeOnly(e[
|
|
2043
|
+
const n = e[ee]?.[t] === X;
|
|
2044
|
+
const r = e[$]?.[t] === X;
|
|
2045
|
+
if (writeOnly(e[J]) && !n && !r) {
|
|
2041
2046
|
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] =
|
|
2047
|
+
const n = e[oe] && !E;
|
|
2048
|
+
const r = n ? ee : $;
|
|
2049
|
+
if (n) trackOptimisticStore(e[J]);
|
|
2050
|
+
const i = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : e[Z][t];
|
|
2051
|
+
if (t in e[Z] || (e[$] && t in e[$])) {
|
|
2052
|
+
(e[r] || (e[r] = Object.create(null)))[t] = X;
|
|
2048
2053
|
} else if (e[r] && t in e[r]) {
|
|
2049
2054
|
delete e[r][t];
|
|
2050
2055
|
} else return true;
|
|
2051
2056
|
if (isWrappable(i)) {
|
|
2052
|
-
const t =
|
|
2053
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2057
|
+
const t = Y.get(i);
|
|
2058
|
+
t && (t instanceof Set ? t.delete(e) : Y.delete(i));
|
|
2054
2059
|
}
|
|
2055
|
-
if (e[
|
|
2056
|
-
const s = getNodes(e,
|
|
2060
|
+
if (e[ne]?.[t]) setSignal(e[ne][t], false);
|
|
2061
|
+
const s = getNodes(e, te);
|
|
2057
2062
|
s[t] && setSignal(s[t], undefined);
|
|
2058
|
-
s[
|
|
2063
|
+
s[K] && setSignal(s[K], undefined);
|
|
2059
2064
|
});
|
|
2060
2065
|
}
|
|
2061
2066
|
return true;
|
|
2062
2067
|
},
|
|
2063
2068
|
ownKeys(e) {
|
|
2064
2069
|
trackSelf(e);
|
|
2065
|
-
let t = getKeys(e[
|
|
2066
|
-
if (e[
|
|
2070
|
+
let t = getKeys(e[Z], e[$], false);
|
|
2071
|
+
if (e[ee]) {
|
|
2067
2072
|
const n = new Set(t);
|
|
2068
|
-
for (const t of Reflect.ownKeys(e[
|
|
2069
|
-
if (e[
|
|
2073
|
+
for (const t of Reflect.ownKeys(e[ee])) {
|
|
2074
|
+
if (e[ee][t] !== X) n.add(t);
|
|
2070
2075
|
else n.delete(t);
|
|
2071
2076
|
}
|
|
2072
2077
|
t = Array.from(n);
|
|
@@ -2074,25 +2079,25 @@ const le = {
|
|
|
2074
2079
|
return t;
|
|
2075
2080
|
},
|
|
2076
2081
|
getOwnPropertyDescriptor(e, t) {
|
|
2077
|
-
if (t ===
|
|
2078
|
-
if (e[
|
|
2079
|
-
if (e[
|
|
2080
|
-
const n = getPropertyDescriptor(e[
|
|
2082
|
+
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2083
|
+
if (e[ee] && t in e[ee]) {
|
|
2084
|
+
if (e[ee][t] === X) return undefined;
|
|
2085
|
+
const n = getPropertyDescriptor(e[Z], e[$], t);
|
|
2081
2086
|
if (n) {
|
|
2082
|
-
return { ...n, value: e[
|
|
2087
|
+
return { ...n, value: e[ee][t] };
|
|
2083
2088
|
}
|
|
2084
|
-
return { value: e[
|
|
2089
|
+
return { value: e[ee][t], writable: true, enumerable: true, configurable: true };
|
|
2085
2090
|
}
|
|
2086
|
-
return getPropertyDescriptor(e[
|
|
2091
|
+
return getPropertyDescriptor(e[Z], e[$], t);
|
|
2087
2092
|
},
|
|
2088
2093
|
getPrototypeOf(e) {
|
|
2089
|
-
return Object.getPrototypeOf(e[
|
|
2094
|
+
return Object.getPrototypeOf(e[Z]);
|
|
2090
2095
|
}
|
|
2091
2096
|
};
|
|
2092
2097
|
function storeSetter(e, t) {
|
|
2093
|
-
const n =
|
|
2094
|
-
|
|
2095
|
-
|
|
2098
|
+
const n = le;
|
|
2099
|
+
le = new Set();
|
|
2100
|
+
le.add(e);
|
|
2096
2101
|
try {
|
|
2097
2102
|
const n = t(e);
|
|
2098
2103
|
if (n !== e && n !== undefined) {
|
|
@@ -2108,8 +2113,8 @@ function storeSetter(e, t) {
|
|
|
2108
2113
|
}
|
|
2109
2114
|
}
|
|
2110
2115
|
} finally {
|
|
2111
|
-
|
|
2112
|
-
|
|
2116
|
+
le.clear();
|
|
2117
|
+
le = n;
|
|
2113
2118
|
}
|
|
2114
2119
|
}
|
|
2115
2120
|
function createStore(e, t, n) {
|
|
@@ -2118,17 +2123,17 @@ function createStore(e, t, n) {
|
|
|
2118
2123
|
return [i, e => storeSetter(i, e)];
|
|
2119
2124
|
}
|
|
2120
2125
|
function recursivelyNotify(e, t) {
|
|
2121
|
-
let n = e[
|
|
2126
|
+
let n = e[U] || t?.get(e)?.[U];
|
|
2122
2127
|
let r = false;
|
|
2123
2128
|
if (n) {
|
|
2124
|
-
const e = getNodes(n,
|
|
2129
|
+
const e = getNodes(n, te)[z];
|
|
2125
2130
|
if (e) {
|
|
2126
2131
|
setSignal(e, undefined);
|
|
2127
2132
|
r = true;
|
|
2128
2133
|
}
|
|
2129
|
-
t = n[
|
|
2134
|
+
t = n[ie] || t;
|
|
2130
2135
|
}
|
|
2131
|
-
const i =
|
|
2136
|
+
const i = Y.get(n?.[Z] || e);
|
|
2132
2137
|
if (!i) return r;
|
|
2133
2138
|
if (i instanceof Set) {
|
|
2134
2139
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2137,16 +2142,16 @@ function recursivelyNotify(e, t) {
|
|
|
2137
2142
|
}
|
|
2138
2143
|
function recursivelyAddParent(e, t) {
|
|
2139
2144
|
let n;
|
|
2140
|
-
const r = e[
|
|
2145
|
+
const r = e[U];
|
|
2141
2146
|
if (r) {
|
|
2142
|
-
n = r[
|
|
2143
|
-
e = r[
|
|
2147
|
+
n = r[$];
|
|
2148
|
+
e = r[Z];
|
|
2144
2149
|
}
|
|
2145
2150
|
if (t) {
|
|
2146
|
-
let n =
|
|
2147
|
-
if (!n)
|
|
2151
|
+
let n = Y.get(e);
|
|
2152
|
+
if (!n) Y.set(e, t);
|
|
2148
2153
|
else if (n !== t) {
|
|
2149
|
-
if (!(n instanceof Set))
|
|
2154
|
+
if (!(n instanceof Set)) Y.set(e, (n = new Set([n])));
|
|
2150
2155
|
else if (n.has(t)) return;
|
|
2151
2156
|
n.add(t);
|
|
2152
2157
|
} else return;
|
|
@@ -2168,7 +2173,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2168
2173
|
}
|
|
2169
2174
|
function deep(e) {
|
|
2170
2175
|
recursivelyAddParent(e);
|
|
2171
|
-
return e[
|
|
2176
|
+
return e[z];
|
|
2172
2177
|
}
|
|
2173
2178
|
function createOptimisticStore(e, t, n) {
|
|
2174
2179
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2179,39 +2184,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2179
2184
|
return [o, e => storeSetter(o, e)];
|
|
2180
2185
|
}
|
|
2181
2186
|
function clearOptimisticStore(e) {
|
|
2182
|
-
const t = e[
|
|
2183
|
-
if (!t || !t[
|
|
2184
|
-
const n = t[
|
|
2185
|
-
const r = t[
|
|
2187
|
+
const t = e[U];
|
|
2188
|
+
if (!t || !t[ee]) return;
|
|
2189
|
+
const n = t[ee];
|
|
2190
|
+
const r = t[te];
|
|
2186
2191
|
setProjectionWriteActive(true);
|
|
2187
2192
|
try {
|
|
2188
2193
|
if (r) {
|
|
2189
2194
|
for (const e of Reflect.ownKeys(n)) {
|
|
2190
2195
|
if (r[e]) {
|
|
2191
2196
|
r[e].re = undefined;
|
|
2192
|
-
const n = t[
|
|
2193
|
-
const i = n ===
|
|
2197
|
+
const n = t[$] && e in t[$] ? t[$][e] : t[Z][e];
|
|
2198
|
+
const i = n === X ? undefined : n;
|
|
2194
2199
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2195
2200
|
}
|
|
2196
2201
|
}
|
|
2197
|
-
if (r[
|
|
2198
|
-
r[
|
|
2199
|
-
setSignal(r[
|
|
2202
|
+
if (r[K]) {
|
|
2203
|
+
r[K].re = undefined;
|
|
2204
|
+
setSignal(r[K], undefined);
|
|
2200
2205
|
}
|
|
2201
2206
|
}
|
|
2202
2207
|
} finally {
|
|
2203
2208
|
setProjectionWriteActive(false);
|
|
2204
2209
|
}
|
|
2205
|
-
delete t[
|
|
2210
|
+
delete t[ee];
|
|
2206
2211
|
}
|
|
2207
2212
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2208
2213
|
let r;
|
|
2209
2214
|
const i = new WeakMap();
|
|
2210
2215
|
const wrapper = e => {
|
|
2211
|
-
e[
|
|
2212
|
-
e[
|
|
2213
|
-
e[
|
|
2214
|
-
Object.defineProperty(e,
|
|
2216
|
+
e[re] = wrapProjection;
|
|
2217
|
+
e[ie] = i;
|
|
2218
|
+
e[oe] = true;
|
|
2219
|
+
Object.defineProperty(e, se, {
|
|
2215
2220
|
get() {
|
|
2216
2221
|
return r;
|
|
2217
2222
|
},
|
|
@@ -2220,8 +2225,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2220
2225
|
};
|
|
2221
2226
|
const wrapProjection = e => {
|
|
2222
2227
|
if (i.has(e)) return i.get(e);
|
|
2223
|
-
if (e[
|
|
2224
|
-
const t = createStoreProxy(e,
|
|
2228
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
2229
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
2225
2230
|
i.set(e, t);
|
|
2226
2231
|
return t;
|
|
2227
2232
|
};
|
|
@@ -2231,7 +2236,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2231
2236
|
const t = getOwner();
|
|
2232
2237
|
setProjectionWriteActive(true);
|
|
2233
2238
|
try {
|
|
2234
|
-
storeSetter(new Proxy(s,
|
|
2239
|
+
storeSetter(new Proxy(s, G), r => {
|
|
2235
2240
|
const i = handleAsync(t, e(r), e => {
|
|
2236
2241
|
setProjectionWriteActive(true);
|
|
2237
2242
|
try {
|
|
@@ -2250,17 +2255,79 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2250
2255
|
}
|
|
2251
2256
|
return { store: s, node: r };
|
|
2252
2257
|
}
|
|
2258
|
+
const ae = Symbol(0);
|
|
2259
|
+
function updatePath(e, t, n = 0) {
|
|
2260
|
+
let r,
|
|
2261
|
+
i = e;
|
|
2262
|
+
if (n < t.length - 1) {
|
|
2263
|
+
r = t[n];
|
|
2264
|
+
const s = typeof r;
|
|
2265
|
+
const o = Array.isArray(e);
|
|
2266
|
+
if (Array.isArray(r)) {
|
|
2267
|
+
for (let i = 0; i < r.length; i++) {
|
|
2268
|
+
t[n] = r[i];
|
|
2269
|
+
updatePath(e, t, n);
|
|
2270
|
+
}
|
|
2271
|
+
t[n] = r;
|
|
2272
|
+
return;
|
|
2273
|
+
} else if (o && s === "function") {
|
|
2274
|
+
for (let i = 0; i < e.length; i++) {
|
|
2275
|
+
if (r(e[i], i)) {
|
|
2276
|
+
t[n] = i;
|
|
2277
|
+
updatePath(e, t, n);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
t[n] = r;
|
|
2281
|
+
return;
|
|
2282
|
+
} else if (o && s === "object") {
|
|
2283
|
+
const { from: i = 0, to: s = e.length - 1, by: o = 1 } = r;
|
|
2284
|
+
for (let r = i; r <= s; r += o) {
|
|
2285
|
+
t[n] = r;
|
|
2286
|
+
updatePath(e, t, n);
|
|
2287
|
+
}
|
|
2288
|
+
t[n] = r;
|
|
2289
|
+
return;
|
|
2290
|
+
} else if (n < t.length - 2) {
|
|
2291
|
+
updatePath(e[r], t, n + 1);
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
i = e[r];
|
|
2295
|
+
}
|
|
2296
|
+
let s = t[t.length - 1];
|
|
2297
|
+
if (typeof s === "function") {
|
|
2298
|
+
s = s(i);
|
|
2299
|
+
if (s === i) return;
|
|
2300
|
+
}
|
|
2301
|
+
if (r === undefined && s == undefined) return;
|
|
2302
|
+
if (s === ae) {
|
|
2303
|
+
delete e[r];
|
|
2304
|
+
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2305
|
+
const t = r !== undefined ? e[r] : e;
|
|
2306
|
+
const n = Object.keys(s);
|
|
2307
|
+
for (let e = 0; e < n.length; e++) t[n[e]] = s[n[e]];
|
|
2308
|
+
} else {
|
|
2309
|
+
e[r] = s;
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
const de = Object.assign(
|
|
2313
|
+
function storePath(...e) {
|
|
2314
|
+
return t => {
|
|
2315
|
+
updatePath(t, e);
|
|
2316
|
+
};
|
|
2317
|
+
},
|
|
2318
|
+
{ DELETE: ae }
|
|
2319
|
+
);
|
|
2253
2320
|
function snapshot(e, t, n) {
|
|
2254
2321
|
let r, i, s, o, u, f;
|
|
2255
2322
|
if (!isWrappable(e)) return e;
|
|
2256
2323
|
if (t && t.has(e)) return t.get(e);
|
|
2257
2324
|
if (!t) t = new Map();
|
|
2258
|
-
if ((r = e[
|
|
2259
|
-
s = r[
|
|
2260
|
-
i = Array.isArray(r[
|
|
2261
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2262
|
-
e = r[
|
|
2263
|
-
n =
|
|
2325
|
+
if ((r = e[U] || n?.get(e)?.[U])) {
|
|
2326
|
+
s = r[$];
|
|
2327
|
+
i = Array.isArray(r[Z]);
|
|
2328
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Z]))) : r[Z]);
|
|
2329
|
+
e = r[Z];
|
|
2330
|
+
n = ue;
|
|
2264
2331
|
} else {
|
|
2265
2332
|
i = Array.isArray(e);
|
|
2266
2333
|
t.set(e, e);
|
|
@@ -2269,7 +2336,7 @@ function snapshot(e, t, n) {
|
|
|
2269
2336
|
const r = s?.length || e.length;
|
|
2270
2337
|
for (let i = 0; i < r; i++) {
|
|
2271
2338
|
f = s && i in s ? s[i] : e[i];
|
|
2272
|
-
if (f ===
|
|
2339
|
+
if (f === X) continue;
|
|
2273
2340
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2274
2341
|
if (!o) t.set(e, (o = [...e]));
|
|
2275
2342
|
o[i] = u;
|
|
@@ -2296,13 +2363,13 @@ function snapshot(e, t, n) {
|
|
|
2296
2363
|
function trueFn() {
|
|
2297
2364
|
return true;
|
|
2298
2365
|
}
|
|
2299
|
-
const
|
|
2366
|
+
const pe = {
|
|
2300
2367
|
get(e, t, n) {
|
|
2301
|
-
if (t ===
|
|
2368
|
+
if (t === J) return n;
|
|
2302
2369
|
return e.get(t);
|
|
2303
2370
|
},
|
|
2304
2371
|
has(e, t) {
|
|
2305
|
-
if (t ===
|
|
2372
|
+
if (t === J) return true;
|
|
2306
2373
|
return e.has(t);
|
|
2307
2374
|
},
|
|
2308
2375
|
set: trueFn,
|
|
@@ -2325,23 +2392,23 @@ const ce = {
|
|
|
2325
2392
|
function resolveSource(e) {
|
|
2326
2393
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2327
2394
|
}
|
|
2328
|
-
const
|
|
2395
|
+
const he = Symbol(0);
|
|
2329
2396
|
function merge(...e) {
|
|
2330
2397
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2331
2398
|
let t = false;
|
|
2332
2399
|
const n = [];
|
|
2333
2400
|
for (let r = 0; r < e.length; r++) {
|
|
2334
2401
|
const i = e[r];
|
|
2335
|
-
t = t || (!!i &&
|
|
2336
|
-
const s = !!i && i[
|
|
2402
|
+
t = t || (!!i && J in i);
|
|
2403
|
+
const s = !!i && i[he];
|
|
2337
2404
|
if (s) n.push(...s);
|
|
2338
2405
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2339
2406
|
}
|
|
2340
|
-
if (
|
|
2407
|
+
if (b && t) {
|
|
2341
2408
|
return new Proxy(
|
|
2342
2409
|
{
|
|
2343
2410
|
get(e) {
|
|
2344
|
-
if (e ===
|
|
2411
|
+
if (e === he) return n;
|
|
2345
2412
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2346
2413
|
const r = resolveSource(n[t]);
|
|
2347
2414
|
if (e in r) return r[e];
|
|
@@ -2359,7 +2426,7 @@ function merge(...e) {
|
|
|
2359
2426
|
return [...new Set(e)];
|
|
2360
2427
|
}
|
|
2361
2428
|
},
|
|
2362
|
-
|
|
2429
|
+
pe
|
|
2363
2430
|
);
|
|
2364
2431
|
}
|
|
2365
2432
|
const r = Object.create(null);
|
|
@@ -2391,12 +2458,12 @@ function merge(...e) {
|
|
|
2391
2458
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2392
2459
|
else o[t] = n.value;
|
|
2393
2460
|
}
|
|
2394
|
-
o[
|
|
2461
|
+
o[he] = n;
|
|
2395
2462
|
return o;
|
|
2396
2463
|
}
|
|
2397
2464
|
function omit(e, ...t) {
|
|
2398
2465
|
const n = new Set(t);
|
|
2399
|
-
if (
|
|
2466
|
+
if (b && J in e) {
|
|
2400
2467
|
return new Proxy(
|
|
2401
2468
|
{
|
|
2402
2469
|
get(t) {
|
|
@@ -2409,7 +2476,7 @@ function omit(e, ...t) {
|
|
|
2409
2476
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2410
2477
|
}
|
|
2411
2478
|
},
|
|
2412
|
-
|
|
2479
|
+
pe
|
|
2413
2480
|
);
|
|
2414
2481
|
}
|
|
2415
2482
|
const r = {};
|
|
@@ -2443,18 +2510,18 @@ function mapArray(e, t, n) {
|
|
|
2443
2510
|
})
|
|
2444
2511
|
);
|
|
2445
2512
|
}
|
|
2446
|
-
const
|
|
2513
|
+
const ye = { pureWrite: true };
|
|
2447
2514
|
function updateKeyedMap() {
|
|
2448
2515
|
const e = this.Ge() || [],
|
|
2449
2516
|
t = e.length;
|
|
2450
|
-
e[
|
|
2517
|
+
e[K];
|
|
2451
2518
|
runWithOwner(this.De, () => {
|
|
2452
2519
|
let n,
|
|
2453
2520
|
r,
|
|
2454
2521
|
i = this.Ye
|
|
2455
2522
|
? () => {
|
|
2456
|
-
this.Ye[r] = signal(e[r],
|
|
2457
|
-
this.Ze && (this.Ze[r] = signal(r,
|
|
2523
|
+
this.Ye[r] = signal(e[r], ye);
|
|
2524
|
+
this.Ze && (this.Ze[r] = signal(r, ye));
|
|
2458
2525
|
return this.ze(
|
|
2459
2526
|
read.bind(null, this.Ye[r]),
|
|
2460
2527
|
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
@@ -2463,7 +2530,7 @@ function updateKeyedMap() {
|
|
|
2463
2530
|
: this.Ze
|
|
2464
2531
|
? () => {
|
|
2465
2532
|
const t = e[r];
|
|
2466
|
-
this.Ze[r] = signal(r,
|
|
2533
|
+
this.Ze[r] = signal(r, ye);
|
|
2467
2534
|
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2468
2535
|
}
|
|
2469
2536
|
: () => {
|
|
@@ -2666,7 +2733,7 @@ class CollectionQueue extends Queue {
|
|
|
2666
2733
|
return super.run(e);
|
|
2667
2734
|
}
|
|
2668
2735
|
notify(e, t, n, r) {
|
|
2669
|
-
if (!(t & this.it) || (this.it &
|
|
2736
|
+
if (!(t & this.it) || (this.it & a && this.ut)) return super.notify(e, t, n, r);
|
|
2670
2737
|
if (n & this.it) {
|
|
2671
2738
|
const t = r?.source || e.Y?.source;
|
|
2672
2739
|
if (t) {
|
|
@@ -2702,10 +2769,10 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2702
2769
|
return read.bind(null, o);
|
|
2703
2770
|
}
|
|
2704
2771
|
function createLoadBoundary(e, t) {
|
|
2705
|
-
return createCollectionBoundary(
|
|
2772
|
+
return createCollectionBoundary(a, e, () => t());
|
|
2706
2773
|
}
|
|
2707
2774
|
function createErrorBoundary(e, t) {
|
|
2708
|
-
return createCollectionBoundary(
|
|
2775
|
+
return createCollectionBoundary(d, e, e => {
|
|
2709
2776
|
let n = e.st.values().next().value;
|
|
2710
2777
|
const r = n.Y?.cause ?? n.Y;
|
|
2711
2778
|
return t(r, () => {
|
|
@@ -2763,13 +2830,13 @@ function flattenArray(e, t = [], n) {
|
|
|
2763
2830
|
if (r) throw r;
|
|
2764
2831
|
return i;
|
|
2765
2832
|
}
|
|
2766
|
-
exports.$PROXY =
|
|
2767
|
-
exports.$TARGET =
|
|
2768
|
-
exports.$TRACK =
|
|
2833
|
+
exports.$PROXY = J;
|
|
2834
|
+
exports.$TARGET = U;
|
|
2835
|
+
exports.$TRACK = K;
|
|
2769
2836
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2770
2837
|
exports.NoOwnerError = NoOwnerError;
|
|
2771
2838
|
exports.NotReadyError = NotReadyError;
|
|
2772
|
-
exports.SUPPORTS_PROXY =
|
|
2839
|
+
exports.SUPPORTS_PROXY = b;
|
|
2773
2840
|
exports.action = action;
|
|
2774
2841
|
exports.clearSnapshots = clearSnapshots;
|
|
2775
2842
|
exports.createContext = createContext;
|
|
@@ -2799,6 +2866,7 @@ exports.isEqual = isEqual;
|
|
|
2799
2866
|
exports.isPending = isPending;
|
|
2800
2867
|
exports.isRefreshing = isRefreshing;
|
|
2801
2868
|
exports.isWrappable = isWrappable;
|
|
2869
|
+
exports.latest = latest;
|
|
2802
2870
|
exports.mapArray = mapArray;
|
|
2803
2871
|
exports.markSnapshotScope = markSnapshotScope;
|
|
2804
2872
|
exports.merge = merge;
|
|
@@ -2806,7 +2874,6 @@ exports.omit = omit;
|
|
|
2806
2874
|
exports.onCleanup = onCleanup;
|
|
2807
2875
|
exports.onSettled = onSettled;
|
|
2808
2876
|
exports.peekNextChildId = peekNextChildId;
|
|
2809
|
-
exports.pending = pending;
|
|
2810
2877
|
exports.reconcile = reconcile;
|
|
2811
2878
|
exports.refresh = refresh;
|
|
2812
2879
|
exports.releaseSnapshotScope = releaseSnapshotScope;
|
|
@@ -2817,4 +2884,5 @@ exports.setContext = setContext;
|
|
|
2817
2884
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2818
2885
|
exports.setStrictRead = setStrictRead;
|
|
2819
2886
|
exports.snapshot = snapshot;
|
|
2887
|
+
exports.storePath = de;
|
|
2820
2888
|
exports.untrack = untrack;
|