@solidjs/signals 0.9.9 → 0.9.11
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 +48 -13
- package/dist/node.cjs +568 -536
- package/dist/prod.js +587 -555
- package/dist/types/core/core.d.ts +1 -0
- package/dist/types/core/scheduler.d.ts +1 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -156,64 +156,69 @@ function getOrCreateLane(e) {
|
|
|
156
156
|
if (t) {
|
|
157
157
|
return findLane(t);
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
const n = e.T;
|
|
160
|
+
const r = n?.M ? findLane(n.M) : null;
|
|
161
|
+
t = { t: e, q: new Set(), F: [[], []], V: null, B: x, D: r };
|
|
160
162
|
C.set(e, t);
|
|
161
163
|
k.add(t);
|
|
162
|
-
e.
|
|
164
|
+
e.G = e.K || 0;
|
|
163
165
|
return t;
|
|
164
166
|
}
|
|
165
167
|
function findLane(e) {
|
|
166
|
-
while (e.
|
|
168
|
+
while (e.V) e = e.V;
|
|
167
169
|
return e;
|
|
168
170
|
}
|
|
169
171
|
function mergeLanes(e, t) {
|
|
170
172
|
e = findLane(e);
|
|
171
173
|
t = findLane(t);
|
|
172
174
|
if (e === t) return e;
|
|
173
|
-
t.
|
|
174
|
-
for (const n of t.
|
|
175
|
-
e.
|
|
176
|
-
e.
|
|
175
|
+
t.V = e;
|
|
176
|
+
for (const n of t.q) e.q.add(n);
|
|
177
|
+
e.F[0].push(...t.F[0]);
|
|
178
|
+
e.F[1].push(...t.F[1]);
|
|
177
179
|
return e;
|
|
178
180
|
}
|
|
179
181
|
function clearLaneEntry(e) {
|
|
180
182
|
C.delete(e);
|
|
181
183
|
}
|
|
182
184
|
function resolveLane(e) {
|
|
183
|
-
const t = e.
|
|
185
|
+
const t = e.M;
|
|
184
186
|
if (!t) return undefined;
|
|
185
187
|
const n = findLane(t);
|
|
186
188
|
if (k.has(n)) return n;
|
|
187
|
-
e.
|
|
189
|
+
e.M = undefined;
|
|
188
190
|
return undefined;
|
|
189
191
|
}
|
|
190
192
|
function hasActiveOverride(e) {
|
|
191
|
-
return !!(e.
|
|
193
|
+
return !!(e.U && e.J !== y);
|
|
192
194
|
}
|
|
193
195
|
function assignOrMergeLane(e, t) {
|
|
194
196
|
const n = findLane(t);
|
|
195
|
-
const r = e.
|
|
197
|
+
const r = e.M;
|
|
196
198
|
if (r) {
|
|
197
|
-
if (r.
|
|
198
|
-
e.
|
|
199
|
+
if (r.V) {
|
|
200
|
+
e.M = t;
|
|
199
201
|
return;
|
|
200
202
|
}
|
|
201
203
|
const i = findLane(r);
|
|
202
204
|
if (k.has(i)) {
|
|
203
205
|
if (i !== n && !hasActiveOverride(e)) {
|
|
204
|
-
|
|
206
|
+
if (n.D && findLane(n.D) === i) {
|
|
207
|
+
e.M = t;
|
|
208
|
+
} else if (i.D && findLane(i.D) === n);
|
|
209
|
+
else mergeLanes(n, i);
|
|
205
210
|
}
|
|
206
211
|
return;
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
|
-
e.
|
|
214
|
+
e.M = t;
|
|
210
215
|
}
|
|
211
216
|
function runLaneEffects(e) {
|
|
212
217
|
for (const t of k) {
|
|
213
|
-
if (t.
|
|
214
|
-
const n = t.
|
|
218
|
+
if (t.V || t.q.size > 0) continue;
|
|
219
|
+
const n = t.F[e - 1];
|
|
215
220
|
if (n.length) {
|
|
216
|
-
t.
|
|
221
|
+
t.F[e - 1] = [];
|
|
217
222
|
runQueue(n, e);
|
|
218
223
|
}
|
|
219
224
|
}
|
|
@@ -224,21 +229,21 @@ function setProjectionWriteActive(e) {
|
|
|
224
229
|
function schedule() {
|
|
225
230
|
if (v) return;
|
|
226
231
|
v = true;
|
|
227
|
-
if (!E.
|
|
232
|
+
if (!E.X) queueMicrotask(flush);
|
|
228
233
|
}
|
|
229
234
|
class Queue {
|
|
230
235
|
o = null;
|
|
231
|
-
|
|
232
|
-
|
|
236
|
+
Y = [[], []];
|
|
237
|
+
Z = [];
|
|
233
238
|
created = O;
|
|
234
239
|
addChild(e) {
|
|
235
|
-
this.
|
|
240
|
+
this.Z.push(e);
|
|
236
241
|
e.o = this;
|
|
237
242
|
}
|
|
238
243
|
removeChild(e) {
|
|
239
|
-
const t = this.
|
|
244
|
+
const t = this.Z.indexOf(e);
|
|
240
245
|
if (t >= 0) {
|
|
241
|
-
this.
|
|
246
|
+
this.Z.splice(t, 1);
|
|
242
247
|
e.o = null;
|
|
243
248
|
}
|
|
244
249
|
}
|
|
@@ -247,88 +252,88 @@ class Queue {
|
|
|
247
252
|
return false;
|
|
248
253
|
}
|
|
249
254
|
run(e) {
|
|
250
|
-
if (this.
|
|
251
|
-
const t = this.
|
|
252
|
-
this.
|
|
255
|
+
if (this.Y[e - 1].length) {
|
|
256
|
+
const t = this.Y[e - 1];
|
|
257
|
+
this.Y[e - 1] = [];
|
|
253
258
|
runQueue(t, e);
|
|
254
259
|
}
|
|
255
|
-
for (let t = 0; t < this.
|
|
260
|
+
for (let t = 0; t < this.Z.length; t++) this.Z[t].run?.(e);
|
|
256
261
|
}
|
|
257
262
|
enqueue(e, t) {
|
|
258
263
|
if (e) {
|
|
259
264
|
if (A) {
|
|
260
265
|
const n = findLane(A);
|
|
261
|
-
n.
|
|
266
|
+
n.F[e - 1].push(t);
|
|
262
267
|
} else {
|
|
263
|
-
this.
|
|
268
|
+
this.Y[e - 1].push(t);
|
|
264
269
|
}
|
|
265
270
|
}
|
|
266
271
|
schedule();
|
|
267
272
|
}
|
|
268
273
|
stashQueues(e) {
|
|
269
|
-
e.
|
|
270
|
-
e.
|
|
271
|
-
this.
|
|
272
|
-
for (let t = 0; t < this.
|
|
273
|
-
let n = this.
|
|
274
|
-
let r = e.
|
|
274
|
+
e.Y[0].push(...this.Y[0]);
|
|
275
|
+
e.Y[1].push(...this.Y[1]);
|
|
276
|
+
this.Y = [[], []];
|
|
277
|
+
for (let t = 0; t < this.Z.length; t++) {
|
|
278
|
+
let n = this.Z[t];
|
|
279
|
+
let r = e.Z[t];
|
|
275
280
|
if (!r) {
|
|
276
|
-
r = {
|
|
277
|
-
e.
|
|
281
|
+
r = { Y: [[], []], Z: [] };
|
|
282
|
+
e.Z[t] = r;
|
|
278
283
|
}
|
|
279
284
|
n.stashQueues(r);
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
287
|
restoreQueues(e) {
|
|
283
|
-
this.
|
|
284
|
-
this.
|
|
285
|
-
for (let t = 0; t < e.
|
|
286
|
-
const n = e.
|
|
287
|
-
let r = this.
|
|
288
|
+
this.Y[0].push(...e.Y[0]);
|
|
289
|
+
this.Y[1].push(...e.Y[1]);
|
|
290
|
+
for (let t = 0; t < e.Z.length; t++) {
|
|
291
|
+
const n = e.Z[t];
|
|
292
|
+
let r = this.Z[t];
|
|
288
293
|
if (r) r.restoreQueues(n);
|
|
289
294
|
}
|
|
290
295
|
}
|
|
291
296
|
}
|
|
292
297
|
class GlobalQueue extends Queue {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
static
|
|
298
|
-
static
|
|
299
|
-
static
|
|
298
|
+
X = false;
|
|
299
|
+
$ = [];
|
|
300
|
+
ee = [];
|
|
301
|
+
te = new Set();
|
|
302
|
+
static ne;
|
|
303
|
+
static re;
|
|
304
|
+
static ie = null;
|
|
300
305
|
flush() {
|
|
301
|
-
if (this.
|
|
302
|
-
this.
|
|
306
|
+
if (this.X) return;
|
|
307
|
+
this.X = true;
|
|
303
308
|
try {
|
|
304
|
-
runHeap(_, GlobalQueue.
|
|
309
|
+
runHeap(_, GlobalQueue.ne);
|
|
305
310
|
if (x) {
|
|
306
311
|
const e = transitionComplete(x);
|
|
307
312
|
if (!e) {
|
|
308
313
|
let e = x;
|
|
309
|
-
runHeap(b, GlobalQueue.
|
|
310
|
-
this
|
|
311
|
-
this.
|
|
312
|
-
this
|
|
314
|
+
runHeap(b, GlobalQueue.ne);
|
|
315
|
+
this.$ = [];
|
|
316
|
+
this.ee = [];
|
|
317
|
+
this.te = new Set();
|
|
313
318
|
runLaneEffects(d);
|
|
314
319
|
runLaneEffects(p);
|
|
315
|
-
this.stashQueues(x.
|
|
320
|
+
this.stashQueues(x.se);
|
|
316
321
|
O++;
|
|
317
322
|
v = _.m >= _.j;
|
|
318
|
-
reassignPendingTransition(x
|
|
323
|
+
reassignPendingTransition(x.$);
|
|
319
324
|
x = null;
|
|
320
325
|
finalizePureQueue(null, true);
|
|
321
326
|
return;
|
|
322
327
|
}
|
|
323
|
-
this
|
|
324
|
-
this.restoreQueues(x.
|
|
328
|
+
this.$ !== x.$ && this.$.push(...x.$);
|
|
329
|
+
this.restoreQueues(x.se);
|
|
325
330
|
m.delete(x);
|
|
326
331
|
const t = x;
|
|
327
332
|
x = null;
|
|
328
|
-
reassignPendingTransition(this
|
|
333
|
+
reassignPendingTransition(this.$);
|
|
329
334
|
finalizePureQueue(t);
|
|
330
335
|
} else {
|
|
331
|
-
if (m.size) runHeap(b, GlobalQueue.
|
|
336
|
+
if (m.size) runHeap(b, GlobalQueue.ne);
|
|
332
337
|
finalizePureQueue();
|
|
333
338
|
}
|
|
334
339
|
O++;
|
|
@@ -338,15 +343,15 @@ class GlobalQueue extends Queue {
|
|
|
338
343
|
runLaneEffects(p);
|
|
339
344
|
this.run(p);
|
|
340
345
|
} finally {
|
|
341
|
-
this.
|
|
346
|
+
this.X = false;
|
|
342
347
|
}
|
|
343
348
|
}
|
|
344
349
|
notify(e, t, n, r) {
|
|
345
350
|
if (t & l) {
|
|
346
351
|
if (n & l) {
|
|
347
|
-
const t = r !== undefined ? r : e.
|
|
348
|
-
if (x && t && !x.
|
|
349
|
-
x.
|
|
352
|
+
const t = r !== undefined ? r : e.oe;
|
|
353
|
+
if (x && t && !x.ue.includes(t.t)) {
|
|
354
|
+
x.ue.push(t.t);
|
|
350
355
|
schedule();
|
|
351
356
|
}
|
|
352
357
|
}
|
|
@@ -357,68 +362,68 @@ class GlobalQueue extends Queue {
|
|
|
357
362
|
initTransition(e) {
|
|
358
363
|
if (e) e = currentTransition(e);
|
|
359
364
|
if (e && e === x) return;
|
|
360
|
-
if (!e && x && x.
|
|
365
|
+
if (!e && x && x.fe === O) return;
|
|
361
366
|
if (!x) {
|
|
362
367
|
x = e ?? {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
se: [],
|
|
366
|
-
Z: [],
|
|
367
|
-
$: new Set(),
|
|
368
|
+
fe: O,
|
|
369
|
+
$: [],
|
|
368
370
|
ue: [],
|
|
369
|
-
|
|
370
|
-
|
|
371
|
+
ee: [],
|
|
372
|
+
te: new Set(),
|
|
373
|
+
le: [],
|
|
374
|
+
se: { Y: [[], []], Z: [] },
|
|
375
|
+
ce: false
|
|
371
376
|
};
|
|
372
377
|
} else if (e) {
|
|
373
378
|
const t = x;
|
|
374
|
-
t.
|
|
375
|
-
e.
|
|
379
|
+
t.ce = e;
|
|
380
|
+
e.le.push(...t.le);
|
|
376
381
|
for (const n of k) {
|
|
377
|
-
if (n.
|
|
382
|
+
if (n.B === t) n.B = e;
|
|
378
383
|
}
|
|
379
|
-
e.
|
|
380
|
-
for (const n of t
|
|
381
|
-
e
|
|
384
|
+
e.ee.push(...t.ee);
|
|
385
|
+
for (const n of t.te) {
|
|
386
|
+
e.te.add(n);
|
|
382
387
|
}
|
|
383
388
|
m.delete(t);
|
|
384
389
|
x = e;
|
|
385
390
|
}
|
|
386
391
|
m.add(x);
|
|
387
|
-
x.
|
|
388
|
-
for (let e = 0; e < this
|
|
389
|
-
const t = this
|
|
390
|
-
t.
|
|
391
|
-
x
|
|
392
|
-
}
|
|
393
|
-
this.Y = x.Y;
|
|
394
|
-
for (let e = 0; e < this.Z.length; e++) {
|
|
395
|
-
const t = this.Z[e];
|
|
396
|
-
t.F = x;
|
|
397
|
-
x.Z.push(t);
|
|
398
|
-
}
|
|
399
|
-
this.Z = x.Z;
|
|
400
|
-
for (const e of k) {
|
|
401
|
-
if (!e.F) e.F = x;
|
|
392
|
+
x.fe = O;
|
|
393
|
+
for (let e = 0; e < this.$.length; e++) {
|
|
394
|
+
const t = this.$[e];
|
|
395
|
+
t.B = x;
|
|
396
|
+
x.$.push(t);
|
|
402
397
|
}
|
|
403
|
-
for (const e of this.$) x.$.add(e);
|
|
404
398
|
this.$ = x.$;
|
|
399
|
+
for (let e = 0; e < this.ee.length; e++) {
|
|
400
|
+
const t = this.ee[e];
|
|
401
|
+
t.B = x;
|
|
402
|
+
x.ee.push(t);
|
|
403
|
+
}
|
|
404
|
+
this.ee = x.ee;
|
|
405
|
+
for (const e of k) {
|
|
406
|
+
if (!e.B) e.B = x;
|
|
407
|
+
}
|
|
408
|
+
for (const e of this.te) x.te.add(e);
|
|
409
|
+
this.te = x.te;
|
|
405
410
|
}
|
|
406
411
|
}
|
|
407
412
|
function insertSubs(e, t = false) {
|
|
408
|
-
const n = e.
|
|
413
|
+
const n = e.M || A;
|
|
409
414
|
for (let r = e.P; r !== null; r = r.C) {
|
|
410
415
|
if (t && n) {
|
|
411
416
|
r.k._ |= f;
|
|
412
417
|
assignOrMergeLane(r.k, n);
|
|
413
418
|
} else if (t) {
|
|
414
419
|
r.k._ |= f;
|
|
415
|
-
r.k.
|
|
420
|
+
r.k.M = undefined;
|
|
416
421
|
}
|
|
417
422
|
const e = r.k;
|
|
418
|
-
if (e.
|
|
419
|
-
if (!e.
|
|
420
|
-
e.
|
|
421
|
-
e.
|
|
423
|
+
if (e.ae === h) {
|
|
424
|
+
if (!e.de) {
|
|
425
|
+
e.de = true;
|
|
426
|
+
e.pe.enqueue(p, e.he);
|
|
422
427
|
}
|
|
423
428
|
continue;
|
|
424
429
|
}
|
|
@@ -430,70 +435,70 @@ function insertSubs(e, t = false) {
|
|
|
430
435
|
function finalizePureQueue(e = null, t = false) {
|
|
431
436
|
let n = !t;
|
|
432
437
|
if (!t) checkBoundaryChildren(E);
|
|
433
|
-
if (_.m >= _.j) runHeap(_, GlobalQueue.
|
|
438
|
+
if (_.m >= _.j) runHeap(_, GlobalQueue.ne);
|
|
434
439
|
if (n) {
|
|
435
|
-
const t = E
|
|
440
|
+
const t = E.$;
|
|
436
441
|
for (let e = 0; e < t.length; e++) {
|
|
437
442
|
const n = t[e];
|
|
438
|
-
if (n.
|
|
439
|
-
n.
|
|
440
|
-
n.
|
|
441
|
-
if (n.
|
|
443
|
+
if (n.J !== y) {
|
|
444
|
+
n.ye = n.J;
|
|
445
|
+
n.J = y;
|
|
446
|
+
if (n.ae && n.ae !== h) n.de = true;
|
|
442
447
|
}
|
|
443
|
-
n.
|
|
444
|
-
if (n.R) GlobalQueue.
|
|
448
|
+
n.ge &= ~a;
|
|
449
|
+
if (n.R) GlobalQueue.re(n, false, true);
|
|
445
450
|
}
|
|
446
451
|
t.length = 0;
|
|
447
|
-
const n = e ? e.
|
|
452
|
+
const n = e ? e.ee : E.ee;
|
|
448
453
|
for (let e = 0; e < n.length; e++) {
|
|
449
454
|
const t = n[e];
|
|
450
|
-
const r = t.
|
|
451
|
-
t.
|
|
452
|
-
if (r !== y && t.
|
|
453
|
-
t.
|
|
455
|
+
const r = t.J;
|
|
456
|
+
t.M = undefined;
|
|
457
|
+
if (r !== y && t.ye !== r) {
|
|
458
|
+
t.ye = r;
|
|
454
459
|
insertSubs(t, true);
|
|
455
460
|
}
|
|
456
|
-
t.
|
|
457
|
-
t.
|
|
461
|
+
t.J = y;
|
|
462
|
+
t.B = null;
|
|
458
463
|
}
|
|
459
464
|
n.length = 0;
|
|
460
|
-
const r = e ? e
|
|
461
|
-
if (GlobalQueue.
|
|
465
|
+
const r = e ? e.te : E.te;
|
|
466
|
+
if (GlobalQueue.ie && r.size) {
|
|
462
467
|
for (const e of r) {
|
|
463
|
-
GlobalQueue.
|
|
468
|
+
GlobalQueue.ie(e);
|
|
464
469
|
}
|
|
465
470
|
r.clear();
|
|
466
471
|
schedule();
|
|
467
472
|
}
|
|
468
473
|
for (const t of k) {
|
|
469
|
-
const n = e ? t.
|
|
474
|
+
const n = e ? t.B === e : !t.B;
|
|
470
475
|
if (!n) continue;
|
|
471
|
-
if (!t.
|
|
472
|
-
if (t.
|
|
473
|
-
if (t.
|
|
474
|
-
}
|
|
475
|
-
if (t.t.
|
|
476
|
-
t.
|
|
477
|
-
t.
|
|
478
|
-
t.
|
|
476
|
+
if (!t.V) {
|
|
477
|
+
if (t.F[0].length) runQueue(t.F[0], d);
|
|
478
|
+
if (t.F[1].length) runQueue(t.F[1], p);
|
|
479
|
+
}
|
|
480
|
+
if (t.t.M === t) t.t.M = undefined;
|
|
481
|
+
t.q.clear();
|
|
482
|
+
t.F[0].length = 0;
|
|
483
|
+
t.F[1].length = 0;
|
|
479
484
|
k.delete(t);
|
|
480
485
|
C.delete(t.t);
|
|
481
486
|
}
|
|
482
487
|
}
|
|
483
488
|
}
|
|
484
489
|
function checkBoundaryChildren(e) {
|
|
485
|
-
for (const t of e.
|
|
490
|
+
for (const t of e.Z) {
|
|
486
491
|
t.checkSources?.();
|
|
487
492
|
checkBoundaryChildren(t);
|
|
488
493
|
}
|
|
489
494
|
}
|
|
490
495
|
function trackOptimisticStore(e) {
|
|
491
|
-
E
|
|
496
|
+
E.te.add(e);
|
|
492
497
|
schedule();
|
|
493
498
|
}
|
|
494
499
|
function reassignPendingTransition(e) {
|
|
495
500
|
for (let t = 0; t < e.length; t++) {
|
|
496
|
-
e[t].
|
|
501
|
+
e[t].B = x;
|
|
497
502
|
}
|
|
498
503
|
}
|
|
499
504
|
const E = new GlobalQueue();
|
|
@@ -506,20 +511,21 @@ function runQueue(e, t) {
|
|
|
506
511
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
507
512
|
}
|
|
508
513
|
function transitionComplete(e) {
|
|
509
|
-
if (e.
|
|
510
|
-
if (e.
|
|
514
|
+
if (e.ce) return true;
|
|
515
|
+
if (e.le.length) return false;
|
|
511
516
|
let t = true;
|
|
512
|
-
for (let n = 0; n < e.
|
|
513
|
-
|
|
517
|
+
for (let n = 0; n < e.ue.length; n++) {
|
|
518
|
+
const r = e.ue[n];
|
|
519
|
+
if (r.ge & l && r.oe?.t === r) {
|
|
514
520
|
t = false;
|
|
515
521
|
break;
|
|
516
522
|
}
|
|
517
523
|
}
|
|
518
|
-
t && (e.
|
|
524
|
+
t && (e.ce = true);
|
|
519
525
|
return t;
|
|
520
526
|
}
|
|
521
527
|
function currentTransition(e) {
|
|
522
|
-
while (e.
|
|
528
|
+
while (e.ce && typeof e.ce === "object") e = e.ce;
|
|
523
529
|
return e;
|
|
524
530
|
}
|
|
525
531
|
function runInTransition(e, t) {
|
|
@@ -543,11 +549,11 @@ function action(e) {
|
|
|
543
549
|
const i = e(...t);
|
|
544
550
|
E.initTransition();
|
|
545
551
|
let s = x;
|
|
546
|
-
s.
|
|
552
|
+
s.le.push(i);
|
|
547
553
|
const done = (e, t) => {
|
|
548
554
|
s = currentTransition(s);
|
|
549
|
-
const o = s.
|
|
550
|
-
if (o >= 0) s.
|
|
555
|
+
const o = s.le.indexOf(i);
|
|
556
|
+
if (o >= 0) s.le.splice(o, 1);
|
|
551
557
|
x = s;
|
|
552
558
|
schedule();
|
|
553
559
|
t ? r(t) : n(e);
|
|
@@ -575,8 +581,8 @@ function action(e) {
|
|
|
575
581
|
step();
|
|
576
582
|
});
|
|
577
583
|
}
|
|
578
|
-
GlobalQueue.
|
|
579
|
-
GlobalQueue.
|
|
584
|
+
GlobalQueue.ne = recompute;
|
|
585
|
+
GlobalQueue.re = disposeChildren;
|
|
580
586
|
let W = false;
|
|
581
587
|
let j = false;
|
|
582
588
|
let N = false;
|
|
@@ -585,28 +591,28 @@ let Q = false;
|
|
|
585
591
|
let I = false;
|
|
586
592
|
let H = null;
|
|
587
593
|
function recompute(t, n = false) {
|
|
588
|
-
const i = t.
|
|
594
|
+
const i = t.ae;
|
|
589
595
|
if (!n) {
|
|
590
|
-
if (t.
|
|
596
|
+
if (t.B && (!i || x) && x !== t.B) E.initTransition(t.B);
|
|
591
597
|
deleteFromHeap(t, t._ & o ? b : _);
|
|
592
|
-
if (t.
|
|
598
|
+
if (t.B || i === h) disposeChildren(t);
|
|
593
599
|
else {
|
|
594
600
|
markDisposal(t);
|
|
595
|
-
t.ye = t.ge;
|
|
596
601
|
t.we = t.Se;
|
|
597
|
-
t.
|
|
602
|
+
t.me = t._e;
|
|
598
603
|
t.Se = null;
|
|
604
|
+
t._e = null;
|
|
599
605
|
}
|
|
600
606
|
}
|
|
601
607
|
const s = !!(t._ & f);
|
|
602
608
|
const u = hasActiveOverride(t);
|
|
603
|
-
const a = !!(t.
|
|
609
|
+
const a = !!(t.ge & l);
|
|
604
610
|
const d = H;
|
|
605
611
|
H = t;
|
|
606
|
-
t.
|
|
612
|
+
t.be = null;
|
|
607
613
|
t._ = r;
|
|
608
|
-
t.
|
|
609
|
-
let p = t.
|
|
614
|
+
t.fe = O;
|
|
615
|
+
let p = t.J === y ? t.ye : t.J;
|
|
610
616
|
let g = t.u;
|
|
611
617
|
let w = W;
|
|
612
618
|
let S = A;
|
|
@@ -619,13 +625,17 @@ function recompute(t, n = false) {
|
|
|
619
625
|
p = handleAsync(t, t.R(p));
|
|
620
626
|
clearStatus(t);
|
|
621
627
|
const e = resolveLane(t);
|
|
622
|
-
if (e)
|
|
628
|
+
if (e) {
|
|
629
|
+
e.q.delete(t);
|
|
630
|
+
updatePendingSignal(e.t);
|
|
631
|
+
}
|
|
623
632
|
} catch (e) {
|
|
624
633
|
if (e instanceof NotReadyError && A) {
|
|
625
634
|
const e = findLane(A);
|
|
626
635
|
if (e.t !== t) {
|
|
627
|
-
e.
|
|
628
|
-
t.
|
|
636
|
+
e.q.add(t);
|
|
637
|
+
t.M = e;
|
|
638
|
+
updatePendingSignal(e.t);
|
|
629
639
|
}
|
|
630
640
|
}
|
|
631
641
|
notifyStatus(
|
|
@@ -633,15 +643,15 @@ function recompute(t, n = false) {
|
|
|
633
643
|
e instanceof NotReadyError ? l : c,
|
|
634
644
|
e,
|
|
635
645
|
undefined,
|
|
636
|
-
e instanceof NotReadyError ? t.
|
|
646
|
+
e instanceof NotReadyError ? t.M : undefined
|
|
637
647
|
);
|
|
638
648
|
} finally {
|
|
639
649
|
W = w;
|
|
640
650
|
t._ = e;
|
|
641
651
|
H = d;
|
|
642
652
|
}
|
|
643
|
-
if (!t.
|
|
644
|
-
const e = t.
|
|
653
|
+
if (!t.oe) {
|
|
654
|
+
const e = t.be;
|
|
645
655
|
let r = e !== null ? e.L : t.N;
|
|
646
656
|
if (r !== null) {
|
|
647
657
|
do {
|
|
@@ -650,22 +660,22 @@ function recompute(t, n = false) {
|
|
|
650
660
|
if (e !== null) e.L = null;
|
|
651
661
|
else t.N = null;
|
|
652
662
|
}
|
|
653
|
-
const f = u ? t.
|
|
654
|
-
const l = !t.
|
|
663
|
+
const f = u ? t.ye : t.J === y ? t.ye : t.J;
|
|
664
|
+
const l = !t.Oe || !t.Oe(f, p);
|
|
655
665
|
if (l) {
|
|
656
|
-
const e = u ? t.
|
|
657
|
-
if (n || (i && x !== t.
|
|
658
|
-
else t.
|
|
666
|
+
const e = u ? t.ye : undefined;
|
|
667
|
+
if (n || (i && x !== t.B) || s) t.ye = p;
|
|
668
|
+
else t.J = p;
|
|
659
669
|
if (u && !s && a) {
|
|
660
|
-
const e = t.
|
|
661
|
-
const n = t.
|
|
662
|
-
if (e <= n) t.
|
|
670
|
+
const e = t.K || 0;
|
|
671
|
+
const n = t.G || 0;
|
|
672
|
+
if (e <= n) t.ye = p;
|
|
663
673
|
}
|
|
664
|
-
if (!u || s || t.
|
|
674
|
+
if (!u || s || t.ye !== e) {
|
|
665
675
|
insertSubs(t, s || u);
|
|
666
676
|
}
|
|
667
677
|
} else if (u) {
|
|
668
|
-
t.
|
|
678
|
+
t.J = p;
|
|
669
679
|
} else if (t.u != g) {
|
|
670
680
|
for (let e = t.P; e !== null; e = e.C) {
|
|
671
681
|
insertIntoHeapHeight(e.k, e.k._ & o ? b : _);
|
|
@@ -673,49 +683,49 @@ function recompute(t, n = false) {
|
|
|
673
683
|
}
|
|
674
684
|
}
|
|
675
685
|
setCurrentOptimisticLane(S);
|
|
676
|
-
(!n || t.
|
|
677
|
-
t.
|
|
686
|
+
(!n || t.ge & l) && !t.B && !(x && t.U) && E.$.push(t);
|
|
687
|
+
t.B && i && x !== t.B && runInTransition(t.B, () => recompute(t));
|
|
678
688
|
}
|
|
679
689
|
function handleAsync(e, t, r) {
|
|
680
690
|
const i = typeof t === "object" && t !== null;
|
|
681
691
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
682
692
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
683
693
|
if (!o && !s) {
|
|
684
|
-
e.
|
|
694
|
+
e.xe = null;
|
|
685
695
|
return t;
|
|
686
696
|
}
|
|
687
|
-
e.
|
|
697
|
+
e.xe = t;
|
|
688
698
|
let u;
|
|
689
699
|
const handleError = n => {
|
|
690
|
-
if (e.
|
|
691
|
-
E.initTransition(e.
|
|
700
|
+
if (e.xe !== t) return;
|
|
701
|
+
E.initTransition(e.B);
|
|
692
702
|
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
693
|
-
e.
|
|
703
|
+
e.fe = O;
|
|
694
704
|
};
|
|
695
705
|
const asyncWrite = (i, s) => {
|
|
696
|
-
if (e.
|
|
706
|
+
if (e.xe !== t) return;
|
|
697
707
|
if (e._ & (n | f)) return;
|
|
698
|
-
E.initTransition(e.
|
|
708
|
+
E.initTransition(e.B);
|
|
699
709
|
clearStatus(e);
|
|
700
710
|
const o = resolveLane(e);
|
|
701
|
-
if (o) o.
|
|
711
|
+
if (o) o.q.delete(e);
|
|
702
712
|
if (r) r(i);
|
|
703
|
-
else if (e.
|
|
704
|
-
const t = e.
|
|
705
|
-
if (e.R) e.
|
|
713
|
+
else if (e.U) {
|
|
714
|
+
const t = e.J !== y;
|
|
715
|
+
if (e.R) e.J = i;
|
|
706
716
|
if (!t) {
|
|
707
|
-
e.
|
|
717
|
+
e.ye = i;
|
|
708
718
|
insertSubs(e);
|
|
709
719
|
}
|
|
710
|
-
e.
|
|
720
|
+
e.fe = O;
|
|
711
721
|
} else if (o) {
|
|
712
|
-
const t = e.
|
|
713
|
-
const n = e.
|
|
722
|
+
const t = e.ye;
|
|
723
|
+
const n = e.Oe;
|
|
714
724
|
if (!n || !n(i, t)) {
|
|
715
|
-
e.
|
|
716
|
-
e.
|
|
717
|
-
if (e.
|
|
718
|
-
setSignal(e.
|
|
725
|
+
e.ye = i;
|
|
726
|
+
e.fe = O;
|
|
727
|
+
if (e.ve) {
|
|
728
|
+
setSignal(e.ve, i);
|
|
719
729
|
}
|
|
720
730
|
insertSubs(e, true);
|
|
721
731
|
}
|
|
@@ -742,7 +752,7 @@ function handleAsync(e, t, r) {
|
|
|
742
752
|
);
|
|
743
753
|
r = false;
|
|
744
754
|
if (!n) {
|
|
745
|
-
E.initTransition(e.
|
|
755
|
+
E.initTransition(e.B);
|
|
746
756
|
throw new NotReadyError(H);
|
|
747
757
|
}
|
|
748
758
|
}
|
|
@@ -774,27 +784,27 @@ function handleAsync(e, t, r) {
|
|
|
774
784
|
};
|
|
775
785
|
const i = iterate();
|
|
776
786
|
if (!r && !i) {
|
|
777
|
-
E.initTransition(e.
|
|
787
|
+
E.initTransition(e.B);
|
|
778
788
|
throw new NotReadyError(H);
|
|
779
789
|
}
|
|
780
790
|
}
|
|
781
791
|
return u;
|
|
782
792
|
}
|
|
783
793
|
function clearStatus(e) {
|
|
784
|
-
e.
|
|
785
|
-
e.
|
|
794
|
+
e.ge = e.ge & a;
|
|
795
|
+
e.oe = null;
|
|
786
796
|
updatePendingSignal(e);
|
|
787
|
-
e.
|
|
797
|
+
e.Pe?.();
|
|
788
798
|
}
|
|
789
799
|
function notifyStatus(e, t, n, r, i) {
|
|
790
800
|
if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
791
801
|
n = new StatusError(e, n);
|
|
792
802
|
const s = n instanceof NotReadyError && n.t === e;
|
|
793
|
-
const o = t === l && e.
|
|
803
|
+
const o = t === l && e.U && !s;
|
|
794
804
|
const u = o && hasActiveOverride(e);
|
|
795
805
|
if (!r) {
|
|
796
|
-
e.
|
|
797
|
-
e.
|
|
806
|
+
e.ge = t | (t !== c ? e.ge & a : 0);
|
|
807
|
+
e.oe = n;
|
|
798
808
|
updatePendingSignal(e);
|
|
799
809
|
}
|
|
800
810
|
if (i && !r) {
|
|
@@ -802,32 +812,32 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
802
812
|
}
|
|
803
813
|
if (u && x && n instanceof NotReadyError) {
|
|
804
814
|
const e = n.t;
|
|
805
|
-
if (!x.
|
|
806
|
-
x.
|
|
815
|
+
if (!x.ue.includes(e)) {
|
|
816
|
+
x.ue.push(e);
|
|
807
817
|
}
|
|
808
818
|
}
|
|
809
819
|
const f = r || u;
|
|
810
820
|
const d = r || o ? undefined : i;
|
|
811
|
-
if (e.
|
|
821
|
+
if (e.Pe) {
|
|
812
822
|
if (f) {
|
|
813
|
-
e.
|
|
823
|
+
e.Pe(t, n);
|
|
814
824
|
} else {
|
|
815
|
-
e.
|
|
825
|
+
e.Pe();
|
|
816
826
|
}
|
|
817
827
|
return;
|
|
818
828
|
}
|
|
819
829
|
for (let r = e.P; r !== null; r = r.C) {
|
|
820
|
-
r.k.
|
|
821
|
-
if (r.k.
|
|
822
|
-
!r.k.
|
|
830
|
+
r.k.fe = O;
|
|
831
|
+
if (r.k.oe !== n) {
|
|
832
|
+
!r.k.B && E.$.push(r.k);
|
|
823
833
|
notifyStatus(r.k, t, n, f, d);
|
|
824
834
|
}
|
|
825
835
|
}
|
|
826
836
|
for (let r = e.A; r !== null; r = r.W) {
|
|
827
837
|
for (let e = r.P; e !== null; e = e.C) {
|
|
828
|
-
e.k.
|
|
829
|
-
if (e.k.
|
|
830
|
-
!e.k.
|
|
838
|
+
e.k.fe = O;
|
|
839
|
+
if (e.k.oe !== n) {
|
|
840
|
+
!e.k.B && E.$.push(e.k);
|
|
831
841
|
notifyStatus(e.k, t, n, f, d);
|
|
832
842
|
}
|
|
833
843
|
}
|
|
@@ -846,7 +856,7 @@ function updateIfNecessary(r) {
|
|
|
846
856
|
}
|
|
847
857
|
}
|
|
848
858
|
}
|
|
849
|
-
if (r._ & (n | f) || (r.
|
|
859
|
+
if (r._ & (n | f) || (r.oe && r.fe < O)) {
|
|
850
860
|
recompute(r);
|
|
851
861
|
}
|
|
852
862
|
r._ = e;
|
|
@@ -855,15 +865,15 @@ function unlinkSubs(e) {
|
|
|
855
865
|
const t = e.I;
|
|
856
866
|
const n = e.L;
|
|
857
867
|
const r = e.C;
|
|
858
|
-
const i = e.
|
|
859
|
-
if (r !== null) r.
|
|
860
|
-
else t.
|
|
868
|
+
const i = e.Ce;
|
|
869
|
+
if (r !== null) r.Ce = i;
|
|
870
|
+
else t.ke = i;
|
|
861
871
|
if (i !== null) i.C = r;
|
|
862
872
|
else {
|
|
863
873
|
t.P = r;
|
|
864
874
|
if (r === null) {
|
|
865
|
-
t.
|
|
866
|
-
t.R && !t.
|
|
875
|
+
t.Ae?.();
|
|
876
|
+
t.R && !t.Ee && unobserved(t);
|
|
867
877
|
}
|
|
868
878
|
}
|
|
869
879
|
return n;
|
|
@@ -878,27 +888,27 @@ function unobserved(e) {
|
|
|
878
888
|
disposeChildren(e, true);
|
|
879
889
|
}
|
|
880
890
|
function link(e, t) {
|
|
881
|
-
const n = t.
|
|
891
|
+
const n = t.be;
|
|
882
892
|
if (n !== null && n.I === e) return;
|
|
883
893
|
let i = null;
|
|
884
894
|
const s = t._ & r;
|
|
885
895
|
if (s) {
|
|
886
896
|
i = n !== null ? n.L : t.N;
|
|
887
897
|
if (i !== null && i.I === e) {
|
|
888
|
-
t.
|
|
898
|
+
t.be = i;
|
|
889
899
|
return;
|
|
890
900
|
}
|
|
891
901
|
}
|
|
892
|
-
const o = e.
|
|
902
|
+
const o = e.ke;
|
|
893
903
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
894
|
-
const u = (t.
|
|
904
|
+
const u = (t.be = e.ke = { I: e, k: t, L: i, Ce: o, C: null });
|
|
895
905
|
if (n !== null) n.L = u;
|
|
896
906
|
else t.N = u;
|
|
897
907
|
if (o !== null) o.C = u;
|
|
898
908
|
else e.P = u;
|
|
899
909
|
}
|
|
900
910
|
function isValidLink(e, t) {
|
|
901
|
-
const n = t.
|
|
911
|
+
const n = t.be;
|
|
902
912
|
if (n !== null) {
|
|
903
913
|
let r = t.N;
|
|
904
914
|
do {
|
|
@@ -910,7 +920,7 @@ function isValidLink(e, t) {
|
|
|
910
920
|
return false;
|
|
911
921
|
}
|
|
912
922
|
function markDisposal(e) {
|
|
913
|
-
let t = e.
|
|
923
|
+
let t = e._e;
|
|
914
924
|
while (t) {
|
|
915
925
|
t._ |= o;
|
|
916
926
|
if (t._ & i) {
|
|
@@ -918,7 +928,7 @@ function markDisposal(e) {
|
|
|
918
928
|
insertIntoHeap(t, b);
|
|
919
929
|
}
|
|
920
930
|
markDisposal(t);
|
|
921
|
-
t = t.
|
|
931
|
+
t = t.We;
|
|
922
932
|
}
|
|
923
933
|
}
|
|
924
934
|
function dispose(e) {
|
|
@@ -927,15 +937,15 @@ function dispose(e) {
|
|
|
927
937
|
t = unlinkSubs(t);
|
|
928
938
|
} while (t !== null);
|
|
929
939
|
e.N = null;
|
|
930
|
-
e.
|
|
940
|
+
e.be = null;
|
|
931
941
|
disposeChildren(e, true);
|
|
932
942
|
}
|
|
933
943
|
function disposeChildren(e, t = false, n) {
|
|
934
944
|
if (e._ & u) return;
|
|
935
945
|
if (t) e._ = u;
|
|
936
|
-
let r = n ? e.
|
|
946
|
+
let r = n ? e.me : e._e;
|
|
937
947
|
while (r) {
|
|
938
|
-
const e = r.
|
|
948
|
+
const e = r.We;
|
|
939
949
|
if (r.N) {
|
|
940
950
|
const e = r;
|
|
941
951
|
deleteFromHeap(e, e._ & o ? b : _);
|
|
@@ -944,21 +954,21 @@ function disposeChildren(e, t = false, n) {
|
|
|
944
954
|
t = unlinkSubs(t);
|
|
945
955
|
} while (t !== null);
|
|
946
956
|
e.N = null;
|
|
947
|
-
e.
|
|
957
|
+
e.be = null;
|
|
948
958
|
}
|
|
949
959
|
disposeChildren(r, true);
|
|
950
960
|
r = e;
|
|
951
961
|
}
|
|
952
962
|
if (n) {
|
|
953
|
-
e.
|
|
963
|
+
e.me = null;
|
|
954
964
|
} else {
|
|
955
|
-
e.
|
|
956
|
-
e.
|
|
965
|
+
e._e = null;
|
|
966
|
+
e.We = null;
|
|
957
967
|
}
|
|
958
968
|
runDisposal(e, n);
|
|
959
969
|
}
|
|
960
970
|
function runDisposal(e, t) {
|
|
961
|
-
let n = t ? e.
|
|
971
|
+
let n = t ? e.we : e.Se;
|
|
962
972
|
if (!n) return;
|
|
963
973
|
if (Array.isArray(n)) {
|
|
964
974
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -968,10 +978,10 @@ function runDisposal(e, t) {
|
|
|
968
978
|
} else {
|
|
969
979
|
n.call(n);
|
|
970
980
|
}
|
|
971
|
-
t ? (e.
|
|
981
|
+
t ? (e.we = null) : (e.Se = null);
|
|
972
982
|
}
|
|
973
983
|
function getNextChildId(e) {
|
|
974
|
-
if (e.id != null) return formatId(e.id, e.
|
|
984
|
+
if (e.id != null) return formatId(e.id, e.je++);
|
|
975
985
|
throw new Error("Cannot get child id from owner without an id");
|
|
976
986
|
}
|
|
977
987
|
function formatId(e, t) {
|
|
@@ -982,44 +992,44 @@ function formatId(e, t) {
|
|
|
982
992
|
function computed(t, n, r) {
|
|
983
993
|
const i = {
|
|
984
994
|
id: r?.id ?? (H?.id != null ? getNextChildId(H) : undefined),
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
995
|
+
Oe: r?.equals != null ? r.equals : isEqual,
|
|
996
|
+
Ne: !!r?.pureWrite,
|
|
997
|
+
Ae: r?.unobserved,
|
|
998
|
+
Se: null,
|
|
999
|
+
pe: H?.pe ?? E,
|
|
1000
|
+
Le: H?.Le ?? w,
|
|
1001
|
+
je: 0,
|
|
992
1002
|
R: t,
|
|
993
|
-
|
|
1003
|
+
ye: n,
|
|
994
1004
|
u: 0,
|
|
995
1005
|
A: null,
|
|
996
1006
|
S: undefined,
|
|
997
1007
|
h: null,
|
|
998
1008
|
N: null,
|
|
999
|
-
|
|
1009
|
+
be: null,
|
|
1000
1010
|
P: null,
|
|
1001
|
-
|
|
1011
|
+
ke: null,
|
|
1002
1012
|
o: H,
|
|
1003
|
-
|
|
1004
|
-
|
|
1013
|
+
We: null,
|
|
1014
|
+
_e: null,
|
|
1005
1015
|
_: e,
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
ye: null,
|
|
1016
|
+
ge: a,
|
|
1017
|
+
fe: O,
|
|
1018
|
+
J: y,
|
|
1010
1019
|
we: null,
|
|
1011
|
-
|
|
1012
|
-
|
|
1020
|
+
me: null,
|
|
1021
|
+
xe: null,
|
|
1022
|
+
B: null
|
|
1013
1023
|
};
|
|
1014
1024
|
i.h = i;
|
|
1015
1025
|
const s = H?.i ? H.l : H;
|
|
1016
1026
|
if (H) {
|
|
1017
|
-
const e = H.
|
|
1027
|
+
const e = H._e;
|
|
1018
1028
|
if (e === null) {
|
|
1019
|
-
H.
|
|
1029
|
+
H._e = i;
|
|
1020
1030
|
} else {
|
|
1021
|
-
i.
|
|
1022
|
-
H.
|
|
1031
|
+
i.We = e;
|
|
1032
|
+
H._e = i;
|
|
1023
1033
|
}
|
|
1024
1034
|
}
|
|
1025
1035
|
if (s) i.u = s.u + 1;
|
|
@@ -1028,69 +1038,84 @@ function computed(t, n, r) {
|
|
|
1028
1038
|
}
|
|
1029
1039
|
function signal(e, t, n = null) {
|
|
1030
1040
|
const r = {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1041
|
+
Oe: t?.equals != null ? t.equals : isEqual,
|
|
1042
|
+
Ne: !!t?.pureWrite,
|
|
1043
|
+
Ae: t?.unobserved,
|
|
1044
|
+
ye: e,
|
|
1035
1045
|
P: null,
|
|
1036
|
-
|
|
1037
|
-
|
|
1046
|
+
ke: null,
|
|
1047
|
+
fe: O,
|
|
1038
1048
|
H: n,
|
|
1039
1049
|
W: n?.A || null,
|
|
1040
|
-
|
|
1050
|
+
J: y
|
|
1041
1051
|
};
|
|
1042
1052
|
n && (n.A = r);
|
|
1043
1053
|
return r;
|
|
1044
1054
|
}
|
|
1045
1055
|
function optimisticSignal(e, t) {
|
|
1046
1056
|
const n = signal(e, t);
|
|
1047
|
-
n.
|
|
1057
|
+
n.U = true;
|
|
1048
1058
|
return n;
|
|
1049
1059
|
}
|
|
1050
1060
|
function optimisticComputed(e, t, n) {
|
|
1051
1061
|
const r = computed(e, t, n);
|
|
1052
|
-
r.
|
|
1062
|
+
r.U = true;
|
|
1053
1063
|
return r;
|
|
1054
1064
|
}
|
|
1055
1065
|
function getPendingSignal(e) {
|
|
1056
|
-
if (!e.
|
|
1057
|
-
e.
|
|
1058
|
-
if (
|
|
1066
|
+
if (!e.Qe) {
|
|
1067
|
+
e.Qe = optimisticSignal(false, { pureWrite: true });
|
|
1068
|
+
if (e.T) {
|
|
1069
|
+
e.Qe.T = e;
|
|
1070
|
+
}
|
|
1071
|
+
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
1059
1072
|
}
|
|
1060
|
-
return e.
|
|
1073
|
+
return e.Qe;
|
|
1061
1074
|
}
|
|
1062
1075
|
function computePendingState(e) {
|
|
1063
1076
|
const t = e;
|
|
1064
|
-
if (e.
|
|
1065
|
-
|
|
1077
|
+
if (e.U && e.J !== y) {
|
|
1078
|
+
if (t.ge & l && !(t.ge & a)) return true;
|
|
1079
|
+
if (e.T) {
|
|
1080
|
+
const t = e.M ? findLane(e.M) : null;
|
|
1081
|
+
return !!(t && t.q.size > 0);
|
|
1082
|
+
}
|
|
1083
|
+
return true;
|
|
1084
|
+
}
|
|
1085
|
+
if (e.J !== y && !(t.ge & a)) return true;
|
|
1086
|
+
return !!(t.ge & l && !(t.ge & a));
|
|
1066
1087
|
}
|
|
1067
1088
|
function getPendingValueComputed(e) {
|
|
1068
|
-
if (!e.
|
|
1089
|
+
if (!e.ve) {
|
|
1069
1090
|
const t = I;
|
|
1070
1091
|
I = false;
|
|
1071
|
-
const n =
|
|
1092
|
+
const n = L;
|
|
1093
|
+
L = false;
|
|
1094
|
+
const r = H;
|
|
1072
1095
|
H = null;
|
|
1073
|
-
e.
|
|
1074
|
-
|
|
1096
|
+
e.ve = optimisticComputed(() => read(e));
|
|
1097
|
+
e.ve.T = e;
|
|
1098
|
+
H = r;
|
|
1099
|
+
L = n;
|
|
1075
1100
|
I = t;
|
|
1076
1101
|
}
|
|
1077
|
-
return e.
|
|
1102
|
+
return e.ve;
|
|
1078
1103
|
}
|
|
1079
1104
|
function updatePendingSignal(e) {
|
|
1080
|
-
if (e.
|
|
1105
|
+
if (e.Qe) {
|
|
1081
1106
|
const t = computePendingState(e);
|
|
1082
|
-
const n = e.
|
|
1107
|
+
const n = e.Qe;
|
|
1083
1108
|
setSignal(n, t);
|
|
1084
|
-
if (!t && n.
|
|
1109
|
+
if (!t && n.M) {
|
|
1085
1110
|
const t = resolveLane(e);
|
|
1086
|
-
if (t && t.
|
|
1087
|
-
const e = findLane(n.
|
|
1111
|
+
if (t && t.q.size > 0) {
|
|
1112
|
+
const e = findLane(n.M);
|
|
1088
1113
|
if (e !== t) {
|
|
1089
1114
|
mergeLanes(t, e);
|
|
1090
1115
|
}
|
|
1091
1116
|
}
|
|
1092
1117
|
clearLaneEntry(n);
|
|
1093
|
-
n.
|
|
1118
|
+
n.M = undefined;
|
|
1094
1119
|
}
|
|
1095
1120
|
}
|
|
1096
1121
|
}
|
|
@@ -1107,6 +1132,22 @@ function untrack(e) {
|
|
|
1107
1132
|
}
|
|
1108
1133
|
}
|
|
1109
1134
|
function read(e) {
|
|
1135
|
+
if (I) {
|
|
1136
|
+
const t = getPendingValueComputed(e);
|
|
1137
|
+
const n = I;
|
|
1138
|
+
I = false;
|
|
1139
|
+
const r = read(t);
|
|
1140
|
+
I = n;
|
|
1141
|
+
if (t.ge & l) return e.ye;
|
|
1142
|
+
if (j && A && t.M) {
|
|
1143
|
+
const n = findLane(t.M);
|
|
1144
|
+
const r = findLane(A);
|
|
1145
|
+
if (n !== r && n.q.size > 0) {
|
|
1146
|
+
return e.ye;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
return r;
|
|
1150
|
+
}
|
|
1110
1151
|
if (L) {
|
|
1111
1152
|
const t = e.H || e;
|
|
1112
1153
|
const n = getPendingSignal(t);
|
|
@@ -1116,16 +1157,7 @@ function read(e) {
|
|
|
1116
1157
|
Q = true;
|
|
1117
1158
|
}
|
|
1118
1159
|
L = r;
|
|
1119
|
-
return e.
|
|
1120
|
-
}
|
|
1121
|
-
if (I) {
|
|
1122
|
-
const t = getPendingValueComputed(e);
|
|
1123
|
-
const n = I;
|
|
1124
|
-
I = false;
|
|
1125
|
-
const r = read(t);
|
|
1126
|
-
I = n;
|
|
1127
|
-
if (t.he & l) return e.pe;
|
|
1128
|
-
return r;
|
|
1160
|
+
return e.ye;
|
|
1129
1161
|
}
|
|
1130
1162
|
let t = H;
|
|
1131
1163
|
if (t?.i) t = t.l;
|
|
@@ -1148,64 +1180,64 @@ function read(e) {
|
|
|
1148
1180
|
}
|
|
1149
1181
|
}
|
|
1150
1182
|
const n = e.H || e;
|
|
1151
|
-
if (t && n.
|
|
1183
|
+
if (t && n.ge & l && !(j && n.B && x !== n.B)) {
|
|
1152
1184
|
if (A) {
|
|
1153
|
-
const r = n.
|
|
1185
|
+
const r = n.M;
|
|
1154
1186
|
const i = findLane(A);
|
|
1155
1187
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1156
1188
|
if (!W) link(e, t);
|
|
1157
|
-
throw n.
|
|
1189
|
+
throw n.oe;
|
|
1158
1190
|
}
|
|
1159
1191
|
} else {
|
|
1160
1192
|
if (!W) link(e, t);
|
|
1161
|
-
throw n.
|
|
1193
|
+
throw n.oe;
|
|
1162
1194
|
}
|
|
1163
1195
|
}
|
|
1164
|
-
if (e.R && e.
|
|
1165
|
-
if (e.
|
|
1196
|
+
if (e.R && e.ge & c) {
|
|
1197
|
+
if (e.fe < O) {
|
|
1166
1198
|
recompute(e, true);
|
|
1167
1199
|
return read(e);
|
|
1168
|
-
} else throw e.
|
|
1200
|
+
} else throw e.oe;
|
|
1169
1201
|
}
|
|
1170
|
-
return !t || A !== null || e.
|
|
1202
|
+
return !t || A !== null || e.J === y || (j && e.B && x !== e.B) ? e.ye : e.J;
|
|
1171
1203
|
}
|
|
1172
1204
|
function setSignal(e, t) {
|
|
1173
|
-
if (e.
|
|
1174
|
-
const n = e.
|
|
1175
|
-
const r = n ? e.
|
|
1205
|
+
if (e.B && x !== e.B) E.initTransition(e.B);
|
|
1206
|
+
const n = e.U && !P;
|
|
1207
|
+
const r = n ? e.ye : e.J === y ? e.ye : e.J;
|
|
1176
1208
|
if (typeof t === "function") t = t(r);
|
|
1177
|
-
const i = !e.
|
|
1209
|
+
const i = !e.Oe || !e.Oe(r, t);
|
|
1178
1210
|
if (!i) {
|
|
1179
|
-
if (n && e.
|
|
1211
|
+
if (n && e.J !== y && e.R) {
|
|
1180
1212
|
insertSubs(e, true);
|
|
1181
1213
|
schedule();
|
|
1182
1214
|
}
|
|
1183
1215
|
return t;
|
|
1184
1216
|
}
|
|
1185
1217
|
if (n) {
|
|
1186
|
-
const n = E.
|
|
1187
|
-
if (e.
|
|
1188
|
-
E.initTransition(e.
|
|
1218
|
+
const n = E.ee.includes(e);
|
|
1219
|
+
if (e.B && n) {
|
|
1220
|
+
E.initTransition(e.B);
|
|
1189
1221
|
}
|
|
1190
|
-
if (e.
|
|
1191
|
-
e.
|
|
1222
|
+
if (e.J === y) {
|
|
1223
|
+
e.J = e.ye;
|
|
1192
1224
|
}
|
|
1193
1225
|
if (!n) {
|
|
1194
|
-
E.
|
|
1226
|
+
E.ee.push(e);
|
|
1195
1227
|
}
|
|
1196
|
-
e.
|
|
1228
|
+
e.K = (e.K || 0) + 1;
|
|
1197
1229
|
const r = getOrCreateLane(e);
|
|
1198
|
-
e.
|
|
1199
|
-
e.
|
|
1230
|
+
e.M = r;
|
|
1231
|
+
e.ye = t;
|
|
1200
1232
|
} else {
|
|
1201
|
-
if (e.
|
|
1202
|
-
e.
|
|
1233
|
+
if (e.J === y) E.$.push(e);
|
|
1234
|
+
e.J = t;
|
|
1203
1235
|
}
|
|
1204
1236
|
updatePendingSignal(e);
|
|
1205
|
-
if (e.
|
|
1206
|
-
setSignal(e.
|
|
1237
|
+
if (e.ve) {
|
|
1238
|
+
setSignal(e.ve, t);
|
|
1207
1239
|
}
|
|
1208
|
-
e.
|
|
1240
|
+
e.fe = O;
|
|
1209
1241
|
insertSubs(e, n);
|
|
1210
1242
|
schedule();
|
|
1211
1243
|
return t;
|
|
@@ -1220,9 +1252,9 @@ function getOwner() {
|
|
|
1220
1252
|
}
|
|
1221
1253
|
function onCleanup(e) {
|
|
1222
1254
|
if (!H) return e;
|
|
1223
|
-
if (!H.
|
|
1224
|
-
else if (Array.isArray(H.
|
|
1225
|
-
else H.
|
|
1255
|
+
if (!H.Se) H.Se = e;
|
|
1256
|
+
else if (Array.isArray(H.Se)) H.Se.push(e);
|
|
1257
|
+
else H.Se = [H.Se, e];
|
|
1226
1258
|
return e;
|
|
1227
1259
|
}
|
|
1228
1260
|
function createOwner(e) {
|
|
@@ -1231,26 +1263,26 @@ function createOwner(e) {
|
|
|
1231
1263
|
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
1232
1264
|
i: true,
|
|
1233
1265
|
l: t?.i ? t.l : t,
|
|
1266
|
+
_e: null,
|
|
1267
|
+
We: null,
|
|
1234
1268
|
Se: null,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
je: t?.je || w,
|
|
1239
|
-
Ee: 0,
|
|
1240
|
-
ye: null,
|
|
1269
|
+
pe: t?.pe ?? E,
|
|
1270
|
+
Le: t?.Le || w,
|
|
1271
|
+
je: 0,
|
|
1241
1272
|
we: null,
|
|
1273
|
+
me: null,
|
|
1242
1274
|
o: t,
|
|
1243
1275
|
dispose(e = true) {
|
|
1244
1276
|
disposeChildren(n, e);
|
|
1245
1277
|
}
|
|
1246
1278
|
};
|
|
1247
1279
|
if (t) {
|
|
1248
|
-
const e = t.
|
|
1280
|
+
const e = t._e;
|
|
1249
1281
|
if (e === null) {
|
|
1250
|
-
t.
|
|
1282
|
+
t._e = n;
|
|
1251
1283
|
} else {
|
|
1252
|
-
n.
|
|
1253
|
-
t.
|
|
1284
|
+
n.We = e;
|
|
1285
|
+
t._e = n;
|
|
1254
1286
|
}
|
|
1255
1287
|
}
|
|
1256
1288
|
return n;
|
|
@@ -1330,7 +1362,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1330
1362
|
if (!t) {
|
|
1331
1363
|
throw new NoOwnerError();
|
|
1332
1364
|
}
|
|
1333
|
-
const n = hasContext(e, t) ? t.
|
|
1365
|
+
const n = hasContext(e, t) ? t.Le[e.id] : e.defaultValue;
|
|
1334
1366
|
if (isUndefined(n)) {
|
|
1335
1367
|
throw new ContextNotFoundError();
|
|
1336
1368
|
}
|
|
@@ -1340,10 +1372,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1340
1372
|
if (!n) {
|
|
1341
1373
|
throw new NoOwnerError();
|
|
1342
1374
|
}
|
|
1343
|
-
n.
|
|
1375
|
+
n.Le = { ...n.Le, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1344
1376
|
}
|
|
1345
1377
|
function hasContext(e, t) {
|
|
1346
|
-
return !isUndefined(t?.
|
|
1378
|
+
return !isUndefined(t?.Le[e.id]);
|
|
1347
1379
|
}
|
|
1348
1380
|
function isUndefined(e) {
|
|
1349
1381
|
return typeof e === "undefined";
|
|
@@ -1353,80 +1385,80 @@ function effect(e, t, n, r, i) {
|
|
|
1353
1385
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
1354
1386
|
...i,
|
|
1355
1387
|
equals: () => {
|
|
1356
|
-
o.
|
|
1357
|
-
if (s) o.
|
|
1388
|
+
o.de = !o.oe;
|
|
1389
|
+
if (s) o.pe.enqueue(o.ae, runEffect.bind(o));
|
|
1358
1390
|
return false;
|
|
1359
1391
|
},
|
|
1360
1392
|
lazy: true
|
|
1361
1393
|
});
|
|
1362
|
-
o.
|
|
1363
|
-
o.
|
|
1364
|
-
o.
|
|
1365
|
-
o.
|
|
1366
|
-
o.
|
|
1367
|
-
o.
|
|
1368
|
-
const n = e !== undefined ? e : o.
|
|
1369
|
-
const r = t !== undefined ? t : o.
|
|
1394
|
+
o.Ie = r;
|
|
1395
|
+
o.He = t;
|
|
1396
|
+
o.Re = n;
|
|
1397
|
+
o.Te = undefined;
|
|
1398
|
+
o.ae = i?.render ? d : p;
|
|
1399
|
+
o.Pe = (e, t) => {
|
|
1400
|
+
const n = e !== undefined ? e : o.ge;
|
|
1401
|
+
const r = t !== undefined ? t : o.oe;
|
|
1370
1402
|
if (n & c) {
|
|
1371
1403
|
let e = r;
|
|
1372
|
-
o.
|
|
1373
|
-
if (o.
|
|
1404
|
+
o.pe.notify(o, l, 0);
|
|
1405
|
+
if (o.ae === p) {
|
|
1374
1406
|
try {
|
|
1375
|
-
return o.
|
|
1376
|
-
? o.
|
|
1377
|
-
o.
|
|
1378
|
-
o.
|
|
1407
|
+
return o.Re
|
|
1408
|
+
? o.Re(e, () => {
|
|
1409
|
+
o.Te?.();
|
|
1410
|
+
o.Te = undefined;
|
|
1379
1411
|
})
|
|
1380
1412
|
: console.error(e);
|
|
1381
1413
|
} catch (t) {
|
|
1382
1414
|
e = t;
|
|
1383
1415
|
}
|
|
1384
1416
|
}
|
|
1385
|
-
if (!o.
|
|
1386
|
-
} else if (o.
|
|
1417
|
+
if (!o.pe.notify(o, c, c)) throw e;
|
|
1418
|
+
} else if (o.ae === d) o.pe.notify(o, l | c, n, r);
|
|
1387
1419
|
};
|
|
1388
1420
|
recompute(o, true);
|
|
1389
|
-
!i?.defer && (o.
|
|
1421
|
+
!i?.defer && (o.ae === p ? o.pe.enqueue(o.ae, runEffect.bind(o)) : runEffect.call(o));
|
|
1390
1422
|
s = true;
|
|
1391
|
-
onCleanup(() => o.
|
|
1423
|
+
onCleanup(() => o.Te?.());
|
|
1392
1424
|
}
|
|
1393
1425
|
function runEffect() {
|
|
1394
|
-
if (!this.
|
|
1395
|
-
this.
|
|
1396
|
-
this.
|
|
1426
|
+
if (!this.de || this._ & u) return;
|
|
1427
|
+
this.Te?.();
|
|
1428
|
+
this.Te = undefined;
|
|
1397
1429
|
try {
|
|
1398
|
-
this.
|
|
1430
|
+
this.Te = this.He(this.ye, this.Ie);
|
|
1399
1431
|
} catch (e) {
|
|
1400
|
-
if (!this.
|
|
1432
|
+
if (!this.pe.notify(this, c, c)) throw e;
|
|
1401
1433
|
} finally {
|
|
1402
|
-
this.
|
|
1403
|
-
this.
|
|
1434
|
+
this.Ie = this.ye;
|
|
1435
|
+
this.de = false;
|
|
1404
1436
|
}
|
|
1405
1437
|
}
|
|
1406
1438
|
function trackedEffect(e, t) {
|
|
1407
1439
|
const run = () => {
|
|
1408
|
-
if (!n.
|
|
1409
|
-
n.
|
|
1440
|
+
if (!n.de || n._ & u) return;
|
|
1441
|
+
n.de = false;
|
|
1410
1442
|
recompute(n);
|
|
1411
1443
|
};
|
|
1412
1444
|
const n = computed(
|
|
1413
1445
|
() => {
|
|
1414
1446
|
try {
|
|
1415
|
-
n.
|
|
1416
|
-
n.
|
|
1417
|
-
n.
|
|
1447
|
+
n.Te?.();
|
|
1448
|
+
n.Te = undefined;
|
|
1449
|
+
n.Te = staleValues(e) || undefined;
|
|
1418
1450
|
} finally {
|
|
1419
1451
|
}
|
|
1420
1452
|
},
|
|
1421
1453
|
undefined,
|
|
1422
1454
|
{ ...t, lazy: true, pureWrite: true }
|
|
1423
1455
|
);
|
|
1424
|
-
n.
|
|
1425
|
-
n.
|
|
1426
|
-
n.
|
|
1427
|
-
n.
|
|
1428
|
-
n.
|
|
1429
|
-
onCleanup(() => n.
|
|
1456
|
+
n.Te = undefined;
|
|
1457
|
+
n.de = true;
|
|
1458
|
+
n.ae = h;
|
|
1459
|
+
n.he = run;
|
|
1460
|
+
n.pe.enqueue(p, run);
|
|
1461
|
+
onCleanup(() => n.Te?.());
|
|
1430
1462
|
}
|
|
1431
1463
|
function createSignal(e, t, n) {
|
|
1432
1464
|
if (typeof e === "function") {
|
|
@@ -1603,7 +1635,7 @@ function applyState(e, t, n, r) {
|
|
|
1603
1635
|
const d = unwrap(getOverrideValue(s, o, u, c));
|
|
1604
1636
|
let p = unwrap(e[c]);
|
|
1605
1637
|
if (d === p) continue;
|
|
1606
|
-
if (!d || !isWrappable(d) || (n(d) != null && n(d) !== n(p))) {
|
|
1638
|
+
if (!d || !isWrappable(d) || !isWrappable(p) || (n(d) != null && n(d) !== n(p))) {
|
|
1607
1639
|
t && setSignal(t, void 0);
|
|
1608
1640
|
a && setSignal(a, isWrappable(p) ? wrap(p, i) : p);
|
|
1609
1641
|
} else applyState(p, wrap(d, i), n, r);
|
|
@@ -1658,7 +1690,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1658
1690
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1659
1691
|
});
|
|
1660
1692
|
});
|
|
1661
|
-
r.
|
|
1693
|
+
r.Ee = true;
|
|
1662
1694
|
return { store: s, node: r };
|
|
1663
1695
|
}
|
|
1664
1696
|
function createProjection(e, t = {}, n) {
|
|
@@ -1758,7 +1790,7 @@ function getNode(e, t, n, r, i = isEqual, s) {
|
|
|
1758
1790
|
},
|
|
1759
1791
|
r
|
|
1760
1792
|
);
|
|
1761
|
-
if (s) o.
|
|
1793
|
+
if (s) o.U = true;
|
|
1762
1794
|
return (e[t] = o);
|
|
1763
1795
|
}
|
|
1764
1796
|
function trackSelf(e, t = M) {
|
|
@@ -1804,7 +1836,7 @@ const re = {
|
|
|
1804
1836
|
if (e && e.get) return e.get.call(n);
|
|
1805
1837
|
}
|
|
1806
1838
|
if (writeOnly(n)) {
|
|
1807
|
-
let n = i && (o || !u) ? (i.
|
|
1839
|
+
let n = i && (o || !u) ? (i.J !== y ? (i.U ? i.ye : i.J) : i.ye) : f[t];
|
|
1808
1840
|
n === B && (n = undefined);
|
|
1809
1841
|
if (!isWrappable(n)) return n;
|
|
1810
1842
|
const r = wrap(n, e);
|
|
@@ -1836,8 +1868,8 @@ const re = {
|
|
|
1836
1868
|
if (writeOnly(r)) {
|
|
1837
1869
|
if (e[$]) {
|
|
1838
1870
|
const t = e[Z];
|
|
1839
|
-
if (t?.
|
|
1840
|
-
E.initTransition(t.
|
|
1871
|
+
if (t?.B) {
|
|
1872
|
+
E.initTransition(t.B);
|
|
1841
1873
|
}
|
|
1842
1874
|
}
|
|
1843
1875
|
untrack(() => {
|
|
@@ -2011,7 +2043,7 @@ function deep(e) {
|
|
|
2011
2043
|
return e[q];
|
|
2012
2044
|
}
|
|
2013
2045
|
function createOptimisticStore(e, t, n) {
|
|
2014
|
-
GlobalQueue.
|
|
2046
|
+
GlobalQueue.ie ||= clearOptimisticStore;
|
|
2015
2047
|
const r = typeof e === "function";
|
|
2016
2048
|
const i = (r ? t : e) ?? {};
|
|
2017
2049
|
const s = r ? e : undefined;
|
|
@@ -2028,14 +2060,14 @@ function clearOptimisticStore(e) {
|
|
|
2028
2060
|
if (r) {
|
|
2029
2061
|
for (const e of Reflect.ownKeys(n)) {
|
|
2030
2062
|
if (r[e]) {
|
|
2031
|
-
r[e].
|
|
2063
|
+
r[e].M = undefined;
|
|
2032
2064
|
const n = t[K] && e in t[K] ? t[K][e] : t[G][e];
|
|
2033
2065
|
const i = n === B ? undefined : n;
|
|
2034
2066
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2035
2067
|
}
|
|
2036
2068
|
}
|
|
2037
2069
|
if (r[M]) {
|
|
2038
|
-
r[M].
|
|
2070
|
+
r[M].M = undefined;
|
|
2039
2071
|
setSignal(r[M], undefined);
|
|
2040
2072
|
}
|
|
2041
2073
|
}
|
|
@@ -2086,7 +2118,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2086
2118
|
setProjectionWriteActive(false);
|
|
2087
2119
|
}
|
|
2088
2120
|
});
|
|
2089
|
-
r.
|
|
2121
|
+
r.Ee = true;
|
|
2090
2122
|
}
|
|
2091
2123
|
return { store: s, node: r };
|
|
2092
2124
|
}
|
|
@@ -2267,68 +2299,68 @@ function mapArray(e, t, n) {
|
|
|
2267
2299
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2268
2300
|
return createMemo(
|
|
2269
2301
|
updateKeyedMap.bind({
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
qe: [],
|
|
2274
|
-
Fe: t,
|
|
2302
|
+
Me: createOwner(),
|
|
2303
|
+
qe: 0,
|
|
2304
|
+
Fe: e,
|
|
2275
2305
|
Ve: [],
|
|
2276
|
-
Be:
|
|
2277
|
-
De:
|
|
2278
|
-
Ge:
|
|
2279
|
-
Ke:
|
|
2280
|
-
ze: n?.
|
|
2306
|
+
Be: t,
|
|
2307
|
+
De: [],
|
|
2308
|
+
Ge: [],
|
|
2309
|
+
Ke: r,
|
|
2310
|
+
ze: r || n?.keyed === false ? [] : undefined,
|
|
2311
|
+
Ue: t.length > 1 ? [] : undefined,
|
|
2312
|
+
Je: n?.fallback
|
|
2281
2313
|
})
|
|
2282
2314
|
);
|
|
2283
2315
|
}
|
|
2284
2316
|
const oe = { pureWrite: true };
|
|
2285
2317
|
function updateKeyedMap() {
|
|
2286
|
-
const e = this.
|
|
2318
|
+
const e = this.Fe() || [],
|
|
2287
2319
|
t = e.length;
|
|
2288
2320
|
e[M];
|
|
2289
|
-
runWithOwner(this.
|
|
2321
|
+
runWithOwner(this.Me, () => {
|
|
2290
2322
|
let n,
|
|
2291
2323
|
r,
|
|
2292
|
-
i = this.
|
|
2324
|
+
i = this.ze
|
|
2293
2325
|
? () => {
|
|
2294
|
-
this.
|
|
2295
|
-
this.
|
|
2296
|
-
return this.
|
|
2297
|
-
read.bind(null, this.
|
|
2298
|
-
this.
|
|
2326
|
+
this.ze[r] = signal(e[r], oe);
|
|
2327
|
+
this.Ue && (this.Ue[r] = signal(r, oe));
|
|
2328
|
+
return this.Be(
|
|
2329
|
+
read.bind(null, this.ze[r]),
|
|
2330
|
+
this.Ue ? read.bind(null, this.Ue[r]) : undefined
|
|
2299
2331
|
);
|
|
2300
2332
|
}
|
|
2301
|
-
: this.
|
|
2333
|
+
: this.Ue
|
|
2302
2334
|
? () => {
|
|
2303
2335
|
const t = e[r];
|
|
2304
|
-
this.
|
|
2305
|
-
return this.
|
|
2336
|
+
this.Ue[r] = signal(r, oe);
|
|
2337
|
+
return this.Be(() => t, read.bind(null, this.Ue[r]));
|
|
2306
2338
|
}
|
|
2307
2339
|
: () => {
|
|
2308
2340
|
const t = e[r];
|
|
2309
|
-
return this.
|
|
2341
|
+
return this.Be(() => t);
|
|
2310
2342
|
};
|
|
2311
2343
|
if (t === 0) {
|
|
2312
|
-
if (this.
|
|
2313
|
-
this.
|
|
2314
|
-
this.
|
|
2315
|
-
this.qe = [];
|
|
2344
|
+
if (this.qe !== 0) {
|
|
2345
|
+
this.Me.dispose(false);
|
|
2346
|
+
this.Ge = [];
|
|
2316
2347
|
this.Ve = [];
|
|
2317
|
-
this.
|
|
2318
|
-
this.
|
|
2319
|
-
this.
|
|
2348
|
+
this.De = [];
|
|
2349
|
+
this.qe = 0;
|
|
2350
|
+
this.ze && (this.ze = []);
|
|
2351
|
+
this.Ue && (this.Ue = []);
|
|
2320
2352
|
}
|
|
2321
|
-
if (this.
|
|
2322
|
-
this.
|
|
2353
|
+
if (this.Je && !this.De[0]) {
|
|
2354
|
+
this.De[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2323
2355
|
}
|
|
2324
|
-
} else if (this.
|
|
2325
|
-
if (this.
|
|
2326
|
-
this.
|
|
2356
|
+
} else if (this.qe === 0) {
|
|
2357
|
+
if (this.Ge[0]) this.Ge[0].dispose();
|
|
2358
|
+
this.De = new Array(t);
|
|
2327
2359
|
for (r = 0; r < t; r++) {
|
|
2328
|
-
this.
|
|
2329
|
-
this.
|
|
2360
|
+
this.Ve[r] = e[r];
|
|
2361
|
+
this.De[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2330
2362
|
}
|
|
2331
|
-
this.
|
|
2363
|
+
this.qe = t;
|
|
2332
2364
|
} else {
|
|
2333
2365
|
let s,
|
|
2334
2366
|
o,
|
|
@@ -2339,217 +2371,217 @@ function updateKeyedMap() {
|
|
|
2339
2371
|
a,
|
|
2340
2372
|
d = new Array(t),
|
|
2341
2373
|
p = new Array(t),
|
|
2342
|
-
h = this.
|
|
2343
|
-
y = this.
|
|
2374
|
+
h = this.ze ? new Array(t) : undefined,
|
|
2375
|
+
y = this.Ue ? new Array(t) : undefined;
|
|
2344
2376
|
for (
|
|
2345
|
-
s = 0, o = Math.min(this.
|
|
2346
|
-
s < o && (this.
|
|
2377
|
+
s = 0, o = Math.min(this.qe, t);
|
|
2378
|
+
s < o && (this.Ve[s] === e[s] || (this.ze && compare(this.Ke, this.Ve[s], e[s])));
|
|
2347
2379
|
s++
|
|
2348
2380
|
) {
|
|
2349
|
-
if (this.
|
|
2381
|
+
if (this.ze) setSignal(this.ze[s], e[s]);
|
|
2350
2382
|
}
|
|
2351
2383
|
for (
|
|
2352
|
-
o = this.
|
|
2384
|
+
o = this.qe - 1, u = t - 1;
|
|
2353
2385
|
o >= s &&
|
|
2354
2386
|
u >= s &&
|
|
2355
|
-
(this.
|
|
2387
|
+
(this.Ve[o] === e[u] || (this.ze && compare(this.Ke, this.Ve[o], e[u])));
|
|
2356
2388
|
o--, u--
|
|
2357
2389
|
) {
|
|
2358
|
-
d[u] = this.
|
|
2359
|
-
p[u] = this.
|
|
2360
|
-
h && (h[u] = this.
|
|
2361
|
-
y && (y[u] = this.
|
|
2390
|
+
d[u] = this.De[o];
|
|
2391
|
+
p[u] = this.Ge[o];
|
|
2392
|
+
h && (h[u] = this.ze[o]);
|
|
2393
|
+
y && (y[u] = this.Ue[o]);
|
|
2362
2394
|
}
|
|
2363
2395
|
c = new Map();
|
|
2364
2396
|
a = new Array(u + 1);
|
|
2365
2397
|
for (r = u; r >= s; r--) {
|
|
2366
2398
|
f = e[r];
|
|
2367
|
-
l = this.
|
|
2399
|
+
l = this.Ke ? this.Ke(f) : f;
|
|
2368
2400
|
n = c.get(l);
|
|
2369
2401
|
a[r] = n === undefined ? -1 : n;
|
|
2370
2402
|
c.set(l, r);
|
|
2371
2403
|
}
|
|
2372
2404
|
for (n = s; n <= o; n++) {
|
|
2373
|
-
f = this.
|
|
2374
|
-
l = this.
|
|
2405
|
+
f = this.Ve[n];
|
|
2406
|
+
l = this.Ke ? this.Ke(f) : f;
|
|
2375
2407
|
r = c.get(l);
|
|
2376
2408
|
if (r !== undefined && r !== -1) {
|
|
2377
|
-
d[r] = this.
|
|
2378
|
-
p[r] = this.
|
|
2379
|
-
h && (h[r] = this.
|
|
2380
|
-
y && (y[r] = this.
|
|
2409
|
+
d[r] = this.De[n];
|
|
2410
|
+
p[r] = this.Ge[n];
|
|
2411
|
+
h && (h[r] = this.ze[n]);
|
|
2412
|
+
y && (y[r] = this.Ue[n]);
|
|
2381
2413
|
r = a[r];
|
|
2382
2414
|
c.set(l, r);
|
|
2383
|
-
} else this.
|
|
2415
|
+
} else this.Ge[n].dispose();
|
|
2384
2416
|
}
|
|
2385
2417
|
for (r = s; r < t; r++) {
|
|
2386
2418
|
if (r in d) {
|
|
2387
|
-
this.
|
|
2388
|
-
this.
|
|
2419
|
+
this.De[r] = d[r];
|
|
2420
|
+
this.Ge[r] = p[r];
|
|
2389
2421
|
if (h) {
|
|
2390
|
-
this.
|
|
2391
|
-
setSignal(this.
|
|
2422
|
+
this.ze[r] = h[r];
|
|
2423
|
+
setSignal(this.ze[r], e[r]);
|
|
2392
2424
|
}
|
|
2393
2425
|
if (y) {
|
|
2394
|
-
this.
|
|
2395
|
-
setSignal(this.
|
|
2426
|
+
this.Ue[r] = y[r];
|
|
2427
|
+
setSignal(this.Ue[r], r);
|
|
2396
2428
|
}
|
|
2397
2429
|
} else {
|
|
2398
|
-
this.
|
|
2430
|
+
this.De[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2399
2431
|
}
|
|
2400
2432
|
}
|
|
2401
|
-
this.
|
|
2402
|
-
this.
|
|
2433
|
+
this.De = this.De.slice(0, (this.qe = t));
|
|
2434
|
+
this.Ve = e.slice(0);
|
|
2403
2435
|
}
|
|
2404
2436
|
});
|
|
2405
|
-
return this.
|
|
2437
|
+
return this.De;
|
|
2406
2438
|
}
|
|
2407
2439
|
function repeat(e, t, n) {
|
|
2408
2440
|
return updateRepeat.bind({
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2441
|
+
Me: createOwner(),
|
|
2442
|
+
qe: 0,
|
|
2443
|
+
Xe: 0,
|
|
2444
|
+
Ye: e,
|
|
2445
|
+
Be: t,
|
|
2446
|
+
Ge: [],
|
|
2447
|
+
De: [],
|
|
2448
|
+
Ze: n?.from,
|
|
2449
|
+
Je: n?.fallback
|
|
2418
2450
|
});
|
|
2419
2451
|
}
|
|
2420
2452
|
function updateRepeat() {
|
|
2421
|
-
const e = this.
|
|
2422
|
-
const t = this.
|
|
2423
|
-
runWithOwner(this.
|
|
2453
|
+
const e = this.Ye();
|
|
2454
|
+
const t = this.Ze?.() || 0;
|
|
2455
|
+
runWithOwner(this.Me, () => {
|
|
2424
2456
|
if (e === 0) {
|
|
2425
|
-
if (this.
|
|
2426
|
-
this.
|
|
2427
|
-
this.
|
|
2428
|
-
this.
|
|
2429
|
-
this.
|
|
2457
|
+
if (this.qe !== 0) {
|
|
2458
|
+
this.Me.dispose(false);
|
|
2459
|
+
this.Ge = [];
|
|
2460
|
+
this.De = [];
|
|
2461
|
+
this.qe = 0;
|
|
2430
2462
|
}
|
|
2431
|
-
if (this.
|
|
2432
|
-
this.
|
|
2463
|
+
if (this.Je && !this.De[0]) {
|
|
2464
|
+
this.De[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2433
2465
|
}
|
|
2434
2466
|
return;
|
|
2435
2467
|
}
|
|
2436
2468
|
const n = t + e;
|
|
2437
|
-
const r = this.
|
|
2438
|
-
if (this.
|
|
2439
|
-
for (let e = n; e < r; e++) this.
|
|
2440
|
-
if (this.
|
|
2441
|
-
let e = this.
|
|
2442
|
-
while (e < t && e < this.
|
|
2443
|
-
this.
|
|
2444
|
-
this.
|
|
2445
|
-
} else if (this.
|
|
2446
|
-
let n = r - this.
|
|
2447
|
-
let i = this.
|
|
2448
|
-
this.
|
|
2469
|
+
const r = this.Xe + this.qe;
|
|
2470
|
+
if (this.qe === 0 && this.Ge[0]) this.Ge[0].dispose();
|
|
2471
|
+
for (let e = n; e < r; e++) this.Ge[e - this.Xe].dispose();
|
|
2472
|
+
if (this.Xe < t) {
|
|
2473
|
+
let e = this.Xe;
|
|
2474
|
+
while (e < t && e < this.qe) this.Ge[e++].dispose();
|
|
2475
|
+
this.Ge.splice(0, t - this.Xe);
|
|
2476
|
+
this.De.splice(0, t - this.Xe);
|
|
2477
|
+
} else if (this.Xe > t) {
|
|
2478
|
+
let n = r - this.Xe - 1;
|
|
2479
|
+
let i = this.Xe - t;
|
|
2480
|
+
this.Ge.length = this.De.length = e;
|
|
2449
2481
|
while (n >= i) {
|
|
2450
|
-
this.
|
|
2451
|
-
this.
|
|
2482
|
+
this.Ge[n] = this.Ge[n - i];
|
|
2483
|
+
this.De[n] = this.De[n - i];
|
|
2452
2484
|
n--;
|
|
2453
2485
|
}
|
|
2454
2486
|
for (let e = 0; e < i; e++) {
|
|
2455
|
-
this.
|
|
2487
|
+
this.De[e] = runWithOwner((this.Ge[e] = createOwner()), () => this.Be(e + t));
|
|
2456
2488
|
}
|
|
2457
2489
|
}
|
|
2458
2490
|
for (let e = r; e < n; e++) {
|
|
2459
|
-
this.
|
|
2491
|
+
this.De[e - t] = runWithOwner((this.Ge[e - t] = createOwner()), () => this.Be(e));
|
|
2460
2492
|
}
|
|
2461
|
-
this.
|
|
2462
|
-
this.
|
|
2463
|
-
this.
|
|
2493
|
+
this.De = this.De.slice(0, e);
|
|
2494
|
+
this.Xe = t;
|
|
2495
|
+
this.qe = e;
|
|
2464
2496
|
});
|
|
2465
|
-
return this.
|
|
2497
|
+
return this.De;
|
|
2466
2498
|
}
|
|
2467
2499
|
function compare(e, t, n) {
|
|
2468
2500
|
return e ? e(t) === e(n) : true;
|
|
2469
2501
|
}
|
|
2470
2502
|
function boundaryComputed(e, t) {
|
|
2471
2503
|
const n = computed(e, undefined, { lazy: true });
|
|
2472
|
-
n.
|
|
2473
|
-
const r = e !== undefined ? e : n.
|
|
2474
|
-
const i = t !== undefined ? t : n.
|
|
2475
|
-
n.
|
|
2476
|
-
n.
|
|
2504
|
+
n.Pe = (e, t) => {
|
|
2505
|
+
const r = e !== undefined ? e : n.ge;
|
|
2506
|
+
const i = t !== undefined ? t : n.oe;
|
|
2507
|
+
n.ge &= ~n.$e;
|
|
2508
|
+
n.pe.notify(n, n.$e, r, i);
|
|
2477
2509
|
};
|
|
2478
|
-
n
|
|
2479
|
-
n.
|
|
2510
|
+
n.$e = t;
|
|
2511
|
+
n.Ee = true;
|
|
2480
2512
|
recompute(n, true);
|
|
2481
2513
|
return n;
|
|
2482
2514
|
}
|
|
2483
2515
|
function createBoundChildren(e, t, n, r) {
|
|
2484
|
-
const i = e.
|
|
2485
|
-
i.addChild((e.
|
|
2486
|
-
onCleanup(() => i.removeChild(e.
|
|
2516
|
+
const i = e.pe;
|
|
2517
|
+
i.addChild((e.pe = n));
|
|
2518
|
+
onCleanup(() => i.removeChild(e.pe));
|
|
2487
2519
|
return runWithOwner(e, () => {
|
|
2488
2520
|
const e = computed(t);
|
|
2489
2521
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2490
2522
|
});
|
|
2491
2523
|
}
|
|
2492
2524
|
class ConditionalQueue extends Queue {
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2525
|
+
et;
|
|
2526
|
+
tt = new Set();
|
|
2527
|
+
$ = new Set();
|
|
2496
2528
|
constructor(e) {
|
|
2497
2529
|
super();
|
|
2498
|
-
this.
|
|
2530
|
+
this.et = e;
|
|
2499
2531
|
}
|
|
2500
2532
|
run(e) {
|
|
2501
|
-
if (!e || read(this.
|
|
2533
|
+
if (!e || read(this.et)) return;
|
|
2502
2534
|
return super.run(e);
|
|
2503
2535
|
}
|
|
2504
2536
|
notify(e, t, n, r) {
|
|
2505
|
-
if (read(this.
|
|
2537
|
+
if (read(this.et)) {
|
|
2506
2538
|
if (t & l) {
|
|
2507
2539
|
if (n & l) {
|
|
2508
|
-
this
|
|
2540
|
+
this.$.add(e);
|
|
2509
2541
|
t &= ~l;
|
|
2510
|
-
} else if (this
|
|
2542
|
+
} else if (this.$.delete(e)) t &= ~l;
|
|
2511
2543
|
}
|
|
2512
2544
|
if (t & c) {
|
|
2513
2545
|
if (n & c) {
|
|
2514
|
-
this
|
|
2546
|
+
this.tt.add(e);
|
|
2515
2547
|
t &= ~c;
|
|
2516
|
-
} else if (this
|
|
2548
|
+
} else if (this.tt.delete(e)) t &= ~c;
|
|
2517
2549
|
}
|
|
2518
2550
|
}
|
|
2519
|
-
return t ? super.notify(e, t, n, r ?? e.
|
|
2551
|
+
return t ? super.notify(e, t, n, r ?? e.oe) : true;
|
|
2520
2552
|
}
|
|
2521
2553
|
}
|
|
2522
2554
|
class CollectionQueue extends Queue {
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2555
|
+
nt;
|
|
2556
|
+
rt = new Set();
|
|
2557
|
+
et = signal(false, { pureWrite: true });
|
|
2558
|
+
it = false;
|
|
2527
2559
|
constructor(e) {
|
|
2528
2560
|
super();
|
|
2529
|
-
this.
|
|
2561
|
+
this.nt = e;
|
|
2530
2562
|
}
|
|
2531
2563
|
run(e) {
|
|
2532
|
-
if (!e || read(this.
|
|
2564
|
+
if (!e || read(this.et)) return;
|
|
2533
2565
|
return super.run(e);
|
|
2534
2566
|
}
|
|
2535
2567
|
notify(e, t, n, r) {
|
|
2536
|
-
if (!(t & this.
|
|
2537
|
-
if (n & this.
|
|
2538
|
-
const t = r?.t || e.
|
|
2568
|
+
if (!(t & this.nt) || (this.nt & l && this.it)) return super.notify(e, t, n, r);
|
|
2569
|
+
if (n & this.nt) {
|
|
2570
|
+
const t = r?.t || e.oe?.t;
|
|
2539
2571
|
if (t) {
|
|
2540
|
-
const e = this.
|
|
2541
|
-
this.
|
|
2542
|
-
if (e) setSignal(this.
|
|
2572
|
+
const e = this.rt.size === 0;
|
|
2573
|
+
this.rt.add(t);
|
|
2574
|
+
if (e) setSignal(this.et, true);
|
|
2543
2575
|
}
|
|
2544
2576
|
}
|
|
2545
|
-
t &= ~this.
|
|
2577
|
+
t &= ~this.nt;
|
|
2546
2578
|
return t ? super.notify(e, t, n, r) : true;
|
|
2547
2579
|
}
|
|
2548
2580
|
checkSources() {
|
|
2549
|
-
for (const e of this.
|
|
2550
|
-
if (!(e.
|
|
2581
|
+
for (const e of this.rt) {
|
|
2582
|
+
if (!(e.ge & this.nt)) this.rt.delete(e);
|
|
2551
2583
|
}
|
|
2552
|
-
if (!this.
|
|
2584
|
+
if (!this.rt.size) setSignal(this.et, false);
|
|
2553
2585
|
}
|
|
2554
2586
|
}
|
|
2555
2587
|
var ue;
|
|
@@ -2562,26 +2594,26 @@ function createBoundary(e, t) {
|
|
|
2562
2594
|
const r = new ConditionalQueue(computed(() => t() === ue.HIDDEN));
|
|
2563
2595
|
const i = createBoundChildren(n, e, r, 0);
|
|
2564
2596
|
computed(() => {
|
|
2565
|
-
const e = read(r.
|
|
2566
|
-
i
|
|
2597
|
+
const e = read(r.et);
|
|
2598
|
+
i.$e = e ? c | l : 0;
|
|
2567
2599
|
if (!e) {
|
|
2568
|
-
r
|
|
2569
|
-
r
|
|
2570
|
-
r
|
|
2571
|
-
r
|
|
2600
|
+
r.$.forEach(e => r.notify(e, l, l, e.oe));
|
|
2601
|
+
r.tt.forEach(e => r.notify(e, c, c, e.oe));
|
|
2602
|
+
r.$.clear();
|
|
2603
|
+
r.tt.clear();
|
|
2572
2604
|
}
|
|
2573
2605
|
});
|
|
2574
|
-
return () => (read(r.
|
|
2606
|
+
return () => (read(r.et) ? undefined : read(i));
|
|
2575
2607
|
}
|
|
2576
2608
|
function createCollectionBoundary(e, t, n) {
|
|
2577
2609
|
const r = createOwner();
|
|
2578
2610
|
const i = new CollectionQueue(e);
|
|
2579
2611
|
const s = createBoundChildren(r, t, i, e);
|
|
2580
2612
|
const o = computed(() => {
|
|
2581
|
-
if (!read(i.
|
|
2613
|
+
if (!read(i.et)) {
|
|
2582
2614
|
const e = read(s);
|
|
2583
|
-
if (!untrack(() => read(i.
|
|
2584
|
-
i.
|
|
2615
|
+
if (!untrack(() => read(i.et))) {
|
|
2616
|
+
i.it = true;
|
|
2585
2617
|
return e;
|
|
2586
2618
|
}
|
|
2587
2619
|
}
|
|
@@ -2594,10 +2626,10 @@ function createLoadBoundary(e, t) {
|
|
|
2594
2626
|
}
|
|
2595
2627
|
function createErrorBoundary(e, t) {
|
|
2596
2628
|
return createCollectionBoundary(c, e, e => {
|
|
2597
|
-
let n = e.
|
|
2598
|
-
const r = n.
|
|
2629
|
+
let n = e.rt.values().next().value;
|
|
2630
|
+
const r = n.oe?.cause ?? n.oe;
|
|
2599
2631
|
return t(r, () => {
|
|
2600
|
-
for (const t of e.
|
|
2632
|
+
for (const t of e.rt) recompute(t);
|
|
2601
2633
|
schedule();
|
|
2602
2634
|
});
|
|
2603
2635
|
});
|