@solidjs/signals 0.9.11 → 0.10.0
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 +537 -598
- package/dist/node.cjs +849 -903
- package/dist/prod.js +794 -848
- package/dist/types/boundaries.d.ts +0 -5
- package/dist/types/core/action.d.ts +1 -0
- package/dist/types/core/async.d.ts +5 -0
- package/dist/types/core/context.d.ts +1 -1
- package/dist/types/core/core.d.ts +25 -104
- package/dist/types/core/effect.d.ts +4 -3
- package/dist/types/core/graph.d.ts +3 -0
- package/dist/types/core/heap.d.ts +1 -1
- package/dist/types/core/index.d.ts +4 -2
- package/dist/types/core/lanes.d.ts +52 -0
- package/dist/types/core/owner.d.ts +22 -0
- package/dist/types/core/scheduler.d.ts +6 -59
- package/dist/types/core/types.d.ts +74 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/signals.d.ts +73 -76
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/optimistic.d.ts +9 -12
- package/dist/types/store/projection.d.ts +12 -4
- package/dist/types/store/store.d.ts +26 -1
- package/package.json +2 -2
package/dist/node.cjs
CHANGED
|
@@ -100,12 +100,12 @@ function markNode(e, r = n) {
|
|
|
100
100
|
const i = e._;
|
|
101
101
|
if ((i & (t | n)) >= r) return;
|
|
102
102
|
e._ = (i & -4) | r;
|
|
103
|
-
for (let n = e.P; n !== null; n = n.
|
|
103
|
+
for (let n = e.P; n !== null; n = n.A) {
|
|
104
104
|
markNode(n.k, t);
|
|
105
105
|
}
|
|
106
|
-
if (e.
|
|
107
|
-
for (let n = e.
|
|
108
|
-
for (let e = n.P; e !== null; e = e.
|
|
106
|
+
if (e.C !== null) {
|
|
107
|
+
for (let n = e.C; n !== null; n = n.W) {
|
|
108
|
+
for (let e = n.P; e !== null; e = e.A) {
|
|
109
109
|
markNode(e.k, t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -133,7 +133,7 @@ function adjustHeight(e, t) {
|
|
|
133
133
|
}
|
|
134
134
|
if (e.u !== n) {
|
|
135
135
|
e.u = n;
|
|
136
|
-
for (let n = e.P; n !== null; n = n.
|
|
136
|
+
for (let n = e.P; n !== null; n = n.A) {
|
|
137
137
|
insertIntoHeapHeight(n.k, t);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -145,80 +145,12 @@ let O = 0;
|
|
|
145
145
|
let x = null;
|
|
146
146
|
let v = false;
|
|
147
147
|
let P = false;
|
|
148
|
-
const C = new WeakMap();
|
|
149
|
-
const k = new Set();
|
|
150
|
-
let A = null;
|
|
151
|
-
function setCurrentOptimisticLane(e) {
|
|
152
|
-
A = e;
|
|
153
|
-
}
|
|
154
|
-
function getOrCreateLane(e) {
|
|
155
|
-
let t = C.get(e);
|
|
156
|
-
if (t) {
|
|
157
|
-
return findLane(t);
|
|
158
|
-
}
|
|
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 };
|
|
162
|
-
C.set(e, t);
|
|
163
|
-
k.add(t);
|
|
164
|
-
e.G = e.K || 0;
|
|
165
|
-
return t;
|
|
166
|
-
}
|
|
167
|
-
function findLane(e) {
|
|
168
|
-
while (e.V) e = e.V;
|
|
169
|
-
return e;
|
|
170
|
-
}
|
|
171
|
-
function mergeLanes(e, t) {
|
|
172
|
-
e = findLane(e);
|
|
173
|
-
t = findLane(t);
|
|
174
|
-
if (e === t) return 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]);
|
|
179
|
-
return e;
|
|
180
|
-
}
|
|
181
|
-
function clearLaneEntry(e) {
|
|
182
|
-
C.delete(e);
|
|
183
|
-
}
|
|
184
|
-
function resolveLane(e) {
|
|
185
|
-
const t = e.M;
|
|
186
|
-
if (!t) return undefined;
|
|
187
|
-
const n = findLane(t);
|
|
188
|
-
if (k.has(n)) return n;
|
|
189
|
-
e.M = undefined;
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
function hasActiveOverride(e) {
|
|
193
|
-
return !!(e.U && e.J !== y);
|
|
194
|
-
}
|
|
195
|
-
function assignOrMergeLane(e, t) {
|
|
196
|
-
const n = findLane(t);
|
|
197
|
-
const r = e.M;
|
|
198
|
-
if (r) {
|
|
199
|
-
if (r.V) {
|
|
200
|
-
e.M = t;
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
const i = findLane(r);
|
|
204
|
-
if (k.has(i)) {
|
|
205
|
-
if (i !== n && !hasActiveOverride(e)) {
|
|
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);
|
|
210
|
-
}
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
e.M = t;
|
|
215
|
-
}
|
|
216
148
|
function runLaneEffects(e) {
|
|
217
|
-
for (const t of
|
|
218
|
-
if (t.
|
|
219
|
-
const n = t.
|
|
149
|
+
for (const t of C) {
|
|
150
|
+
if (t.T || t.M.size > 0) continue;
|
|
151
|
+
const n = t.q[e - 1];
|
|
220
152
|
if (n.length) {
|
|
221
|
-
t.
|
|
153
|
+
t.q[e - 1] = [];
|
|
222
154
|
runQueue(n, e);
|
|
223
155
|
}
|
|
224
156
|
}
|
|
@@ -229,21 +161,21 @@ function setProjectionWriteActive(e) {
|
|
|
229
161
|
function schedule() {
|
|
230
162
|
if (v) return;
|
|
231
163
|
v = true;
|
|
232
|
-
if (!
|
|
164
|
+
if (!A.F) queueMicrotask(flush);
|
|
233
165
|
}
|
|
234
166
|
class Queue {
|
|
235
167
|
o = null;
|
|
236
|
-
|
|
237
|
-
|
|
168
|
+
V = [[], []];
|
|
169
|
+
D = [];
|
|
238
170
|
created = O;
|
|
239
171
|
addChild(e) {
|
|
240
|
-
this.
|
|
172
|
+
this.D.push(e);
|
|
241
173
|
e.o = this;
|
|
242
174
|
}
|
|
243
175
|
removeChild(e) {
|
|
244
|
-
const t = this.
|
|
176
|
+
const t = this.D.indexOf(e);
|
|
245
177
|
if (t >= 0) {
|
|
246
|
-
this.
|
|
178
|
+
this.D.splice(t, 1);
|
|
247
179
|
e.o = null;
|
|
248
180
|
}
|
|
249
181
|
}
|
|
@@ -252,88 +184,88 @@ class Queue {
|
|
|
252
184
|
return false;
|
|
253
185
|
}
|
|
254
186
|
run(e) {
|
|
255
|
-
if (this.
|
|
256
|
-
const t = this.
|
|
257
|
-
this.
|
|
187
|
+
if (this.V[e - 1].length) {
|
|
188
|
+
const t = this.V[e - 1];
|
|
189
|
+
this.V[e - 1] = [];
|
|
258
190
|
runQueue(t, e);
|
|
259
191
|
}
|
|
260
|
-
for (let t = 0; t < this.
|
|
192
|
+
for (let t = 0; t < this.D.length; t++) this.D[t].run?.(e);
|
|
261
193
|
}
|
|
262
194
|
enqueue(e, t) {
|
|
263
195
|
if (e) {
|
|
264
|
-
if (
|
|
265
|
-
const n = findLane(
|
|
266
|
-
n.
|
|
196
|
+
if (R) {
|
|
197
|
+
const n = findLane(R);
|
|
198
|
+
n.q[e - 1].push(t);
|
|
267
199
|
} else {
|
|
268
|
-
this.
|
|
200
|
+
this.V[e - 1].push(t);
|
|
269
201
|
}
|
|
270
202
|
}
|
|
271
203
|
schedule();
|
|
272
204
|
}
|
|
273
205
|
stashQueues(e) {
|
|
274
|
-
e.
|
|
275
|
-
e.
|
|
276
|
-
this.
|
|
277
|
-
for (let t = 0; t < this.
|
|
278
|
-
let n = this.
|
|
279
|
-
let r = e.
|
|
206
|
+
e.V[0].push(...this.V[0]);
|
|
207
|
+
e.V[1].push(...this.V[1]);
|
|
208
|
+
this.V = [[], []];
|
|
209
|
+
for (let t = 0; t < this.D.length; t++) {
|
|
210
|
+
let n = this.D[t];
|
|
211
|
+
let r = e.D[t];
|
|
280
212
|
if (!r) {
|
|
281
|
-
r = {
|
|
282
|
-
e.
|
|
213
|
+
r = { V: [[], []], D: [] };
|
|
214
|
+
e.D[t] = r;
|
|
283
215
|
}
|
|
284
216
|
n.stashQueues(r);
|
|
285
217
|
}
|
|
286
218
|
}
|
|
287
219
|
restoreQueues(e) {
|
|
288
|
-
this.
|
|
289
|
-
this.
|
|
290
|
-
for (let t = 0; t < e.
|
|
291
|
-
const n = e.
|
|
292
|
-
let r = this.
|
|
220
|
+
this.V[0].push(...e.V[0]);
|
|
221
|
+
this.V[1].push(...e.V[1]);
|
|
222
|
+
for (let t = 0; t < e.D.length; t++) {
|
|
223
|
+
const n = e.D[t];
|
|
224
|
+
let r = this.D[t];
|
|
293
225
|
if (r) r.restoreQueues(n);
|
|
294
226
|
}
|
|
295
227
|
}
|
|
296
228
|
}
|
|
297
229
|
class GlobalQueue extends Queue {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
static
|
|
303
|
-
static
|
|
304
|
-
static
|
|
230
|
+
F = false;
|
|
231
|
+
B = [];
|
|
232
|
+
G = [];
|
|
233
|
+
K = new Set();
|
|
234
|
+
static U;
|
|
235
|
+
static J;
|
|
236
|
+
static X = null;
|
|
305
237
|
flush() {
|
|
306
|
-
if (this.
|
|
307
|
-
this.
|
|
238
|
+
if (this.F) return;
|
|
239
|
+
this.F = true;
|
|
308
240
|
try {
|
|
309
|
-
runHeap(_, GlobalQueue.
|
|
241
|
+
runHeap(_, GlobalQueue.U);
|
|
310
242
|
if (x) {
|
|
311
243
|
const e = transitionComplete(x);
|
|
312
244
|
if (!e) {
|
|
313
245
|
let e = x;
|
|
314
|
-
runHeap(b, GlobalQueue.
|
|
315
|
-
this
|
|
316
|
-
this.
|
|
317
|
-
this.
|
|
246
|
+
runHeap(b, GlobalQueue.U);
|
|
247
|
+
this.B = [];
|
|
248
|
+
this.G = [];
|
|
249
|
+
this.K = new Set();
|
|
318
250
|
runLaneEffects(d);
|
|
319
251
|
runLaneEffects(p);
|
|
320
|
-
this.stashQueues(x.
|
|
252
|
+
this.stashQueues(x.Y);
|
|
321
253
|
O++;
|
|
322
254
|
v = _.m >= _.j;
|
|
323
|
-
reassignPendingTransition(x
|
|
255
|
+
reassignPendingTransition(x.B);
|
|
324
256
|
x = null;
|
|
325
257
|
finalizePureQueue(null, true);
|
|
326
258
|
return;
|
|
327
259
|
}
|
|
328
|
-
this
|
|
329
|
-
this.restoreQueues(x.
|
|
260
|
+
this.B !== x.B && this.B.push(...x.B);
|
|
261
|
+
this.restoreQueues(x.Y);
|
|
330
262
|
m.delete(x);
|
|
331
263
|
const t = x;
|
|
332
264
|
x = null;
|
|
333
|
-
reassignPendingTransition(this
|
|
265
|
+
reassignPendingTransition(this.B);
|
|
334
266
|
finalizePureQueue(t);
|
|
335
267
|
} else {
|
|
336
|
-
if (m.size) runHeap(b, GlobalQueue.
|
|
268
|
+
if (m.size) runHeap(b, GlobalQueue.U);
|
|
337
269
|
finalizePureQueue();
|
|
338
270
|
}
|
|
339
271
|
O++;
|
|
@@ -343,15 +275,15 @@ class GlobalQueue extends Queue {
|
|
|
343
275
|
runLaneEffects(p);
|
|
344
276
|
this.run(p);
|
|
345
277
|
} finally {
|
|
346
|
-
this.
|
|
278
|
+
this.F = false;
|
|
347
279
|
}
|
|
348
280
|
}
|
|
349
281
|
notify(e, t, n, r) {
|
|
350
282
|
if (t & l) {
|
|
351
283
|
if (n & l) {
|
|
352
|
-
const t = r !== undefined ? r : e.
|
|
353
|
-
if (x && t && !x
|
|
354
|
-
x
|
|
284
|
+
const t = r !== undefined ? r : e.Z;
|
|
285
|
+
if (x && t && !x.$.includes(t.t)) {
|
|
286
|
+
x.$.push(t.t);
|
|
355
287
|
schedule();
|
|
356
288
|
}
|
|
357
289
|
}
|
|
@@ -362,68 +294,68 @@ class GlobalQueue extends Queue {
|
|
|
362
294
|
initTransition(e) {
|
|
363
295
|
if (e) e = currentTransition(e);
|
|
364
296
|
if (e && e === x) return;
|
|
365
|
-
if (!e && x && x.
|
|
297
|
+
if (!e && x && x.ee === O) return;
|
|
366
298
|
if (!x) {
|
|
367
299
|
x = e ?? {
|
|
368
|
-
|
|
300
|
+
ee: O,
|
|
301
|
+
B: [],
|
|
369
302
|
$: [],
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
te:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
ce: false
|
|
303
|
+
G: [],
|
|
304
|
+
K: new Set(),
|
|
305
|
+
te: [],
|
|
306
|
+
Y: { V: [[], []], D: [] },
|
|
307
|
+
ne: false
|
|
376
308
|
};
|
|
377
309
|
} else if (e) {
|
|
378
310
|
const t = x;
|
|
379
|
-
t.
|
|
380
|
-
e.
|
|
381
|
-
for (const n of
|
|
382
|
-
if (n.
|
|
311
|
+
t.ne = e;
|
|
312
|
+
e.te.push(...t.te);
|
|
313
|
+
for (const n of C) {
|
|
314
|
+
if (n.re === t) n.re = e;
|
|
383
315
|
}
|
|
384
|
-
e.
|
|
385
|
-
for (const n of t.
|
|
386
|
-
e.
|
|
316
|
+
e.G.push(...t.G);
|
|
317
|
+
for (const n of t.K) {
|
|
318
|
+
e.K.add(n);
|
|
387
319
|
}
|
|
388
320
|
m.delete(t);
|
|
389
321
|
x = e;
|
|
390
322
|
}
|
|
391
323
|
m.add(x);
|
|
392
|
-
x.
|
|
393
|
-
for (let e = 0; e < this
|
|
394
|
-
const t = this
|
|
395
|
-
t.
|
|
396
|
-
x
|
|
324
|
+
x.ee = O;
|
|
325
|
+
for (let e = 0; e < this.B.length; e++) {
|
|
326
|
+
const t = this.B[e];
|
|
327
|
+
t.re = x;
|
|
328
|
+
x.B.push(t);
|
|
397
329
|
}
|
|
398
|
-
this
|
|
399
|
-
for (let e = 0; e < this.
|
|
400
|
-
const t = this.
|
|
401
|
-
t.
|
|
402
|
-
x.
|
|
330
|
+
this.B = x.B;
|
|
331
|
+
for (let e = 0; e < this.G.length; e++) {
|
|
332
|
+
const t = this.G[e];
|
|
333
|
+
t.re = x;
|
|
334
|
+
x.G.push(t);
|
|
403
335
|
}
|
|
404
|
-
this.
|
|
405
|
-
for (const e of
|
|
406
|
-
if (!e.
|
|
336
|
+
this.G = x.G;
|
|
337
|
+
for (const e of C) {
|
|
338
|
+
if (!e.re) e.re = x;
|
|
407
339
|
}
|
|
408
|
-
for (const e of this.
|
|
409
|
-
this.
|
|
340
|
+
for (const e of this.K) x.K.add(e);
|
|
341
|
+
this.K = x.K;
|
|
410
342
|
}
|
|
411
343
|
}
|
|
412
344
|
function insertSubs(e, t = false) {
|
|
413
|
-
const n = e.
|
|
414
|
-
for (let r = e.P; r !== null; r = r.
|
|
345
|
+
const n = e.ie || R;
|
|
346
|
+
for (let r = e.P; r !== null; r = r.A) {
|
|
415
347
|
if (t && n) {
|
|
416
348
|
r.k._ |= f;
|
|
417
349
|
assignOrMergeLane(r.k, n);
|
|
418
350
|
} else if (t) {
|
|
419
351
|
r.k._ |= f;
|
|
420
|
-
r.k.
|
|
352
|
+
r.k.ie = undefined;
|
|
421
353
|
}
|
|
422
354
|
const e = r.k;
|
|
423
|
-
if (e.
|
|
424
|
-
if (!e.
|
|
425
|
-
e.
|
|
426
|
-
e.
|
|
355
|
+
if (e.se === h) {
|
|
356
|
+
if (!e.oe) {
|
|
357
|
+
e.oe = true;
|
|
358
|
+
e.ue.enqueue(p, e.fe);
|
|
427
359
|
}
|
|
428
360
|
continue;
|
|
429
361
|
}
|
|
@@ -434,100 +366,103 @@ function insertSubs(e, t = false) {
|
|
|
434
366
|
}
|
|
435
367
|
function finalizePureQueue(e = null, t = false) {
|
|
436
368
|
let n = !t;
|
|
437
|
-
if (!t) checkBoundaryChildren(
|
|
438
|
-
if (_.m >= _.j) runHeap(_, GlobalQueue.
|
|
369
|
+
if (!t) checkBoundaryChildren(A);
|
|
370
|
+
if (_.m >= _.j) runHeap(_, GlobalQueue.U);
|
|
439
371
|
if (n) {
|
|
440
|
-
const t =
|
|
372
|
+
const t = A.B;
|
|
441
373
|
for (let e = 0; e < t.length; e++) {
|
|
442
374
|
const n = t[e];
|
|
443
|
-
if (n.
|
|
444
|
-
n.
|
|
445
|
-
n.
|
|
446
|
-
if (n.
|
|
375
|
+
if (n.le !== y) {
|
|
376
|
+
n.ce = n.le;
|
|
377
|
+
n.le = y;
|
|
378
|
+
if (n.se && n.se !== h) n.oe = true;
|
|
447
379
|
}
|
|
448
|
-
n.
|
|
449
|
-
if (n.R) GlobalQueue.
|
|
380
|
+
n.ae &= ~a;
|
|
381
|
+
if (n.R) GlobalQueue.J(n, false, true);
|
|
450
382
|
}
|
|
451
383
|
t.length = 0;
|
|
452
|
-
const n = e ? e.
|
|
384
|
+
const n = e ? e.G : A.G;
|
|
453
385
|
for (let e = 0; e < n.length; e++) {
|
|
454
386
|
const t = n[e];
|
|
455
|
-
const r = t.
|
|
456
|
-
t.
|
|
457
|
-
if (r !== y && t.
|
|
458
|
-
t.
|
|
387
|
+
const r = t.le;
|
|
388
|
+
t.ie = undefined;
|
|
389
|
+
if (r !== y && t.ce !== r) {
|
|
390
|
+
t.ce = r;
|
|
459
391
|
insertSubs(t, true);
|
|
460
392
|
}
|
|
461
|
-
t.
|
|
462
|
-
t.
|
|
393
|
+
t.le = y;
|
|
394
|
+
t.re = null;
|
|
463
395
|
}
|
|
464
396
|
n.length = 0;
|
|
465
|
-
const r = e ? e.
|
|
466
|
-
if (GlobalQueue.
|
|
397
|
+
const r = e ? e.K : A.K;
|
|
398
|
+
if (GlobalQueue.X && r.size) {
|
|
467
399
|
for (const e of r) {
|
|
468
|
-
GlobalQueue.
|
|
400
|
+
GlobalQueue.X(e);
|
|
469
401
|
}
|
|
470
402
|
r.clear();
|
|
471
403
|
schedule();
|
|
472
404
|
}
|
|
473
|
-
for (const t of
|
|
474
|
-
const n = e ? t.
|
|
405
|
+
for (const t of C) {
|
|
406
|
+
const n = e ? t.re === e : !t.re;
|
|
475
407
|
if (!n) continue;
|
|
476
|
-
if (!t.
|
|
477
|
-
if (t.
|
|
478
|
-
if (t.
|
|
408
|
+
if (!t.T) {
|
|
409
|
+
if (t.q[0].length) runQueue(t.q[0], d);
|
|
410
|
+
if (t.q[1].length) runQueue(t.q[1], p);
|
|
479
411
|
}
|
|
480
|
-
if (t.t.
|
|
481
|
-
t.
|
|
482
|
-
t.
|
|
483
|
-
t.
|
|
484
|
-
|
|
485
|
-
|
|
412
|
+
if (t.t.ie === t) t.t.ie = undefined;
|
|
413
|
+
t.M.clear();
|
|
414
|
+
t.q[0].length = 0;
|
|
415
|
+
t.q[1].length = 0;
|
|
416
|
+
C.delete(t);
|
|
417
|
+
k.delete(t.t);
|
|
486
418
|
}
|
|
487
419
|
}
|
|
488
420
|
}
|
|
489
421
|
function checkBoundaryChildren(e) {
|
|
490
|
-
for (const t of e.
|
|
422
|
+
for (const t of e.D) {
|
|
491
423
|
t.checkSources?.();
|
|
492
424
|
checkBoundaryChildren(t);
|
|
493
425
|
}
|
|
494
426
|
}
|
|
495
427
|
function trackOptimisticStore(e) {
|
|
496
|
-
|
|
428
|
+
A.K.add(e);
|
|
497
429
|
schedule();
|
|
498
430
|
}
|
|
499
431
|
function reassignPendingTransition(e) {
|
|
500
432
|
for (let t = 0; t < e.length; t++) {
|
|
501
|
-
e[t].
|
|
433
|
+
e[t].re = x;
|
|
502
434
|
}
|
|
503
435
|
}
|
|
504
|
-
const
|
|
436
|
+
const A = new GlobalQueue();
|
|
505
437
|
function flush() {
|
|
506
438
|
while (v) {
|
|
507
|
-
|
|
439
|
+
A.flush();
|
|
508
440
|
}
|
|
509
441
|
}
|
|
510
442
|
function runQueue(e, t) {
|
|
511
443
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
512
444
|
}
|
|
513
445
|
function transitionComplete(e) {
|
|
514
|
-
if (e.
|
|
515
|
-
if (e.
|
|
446
|
+
if (e.ne) return true;
|
|
447
|
+
if (e.te.length) return false;
|
|
516
448
|
let t = true;
|
|
517
|
-
for (let n = 0; n < e
|
|
518
|
-
const r = e
|
|
519
|
-
if (r.
|
|
449
|
+
for (let n = 0; n < e.$.length; n++) {
|
|
450
|
+
const r = e.$[n];
|
|
451
|
+
if (r.ae & l && r.Z?.t === r) {
|
|
520
452
|
t = false;
|
|
521
453
|
break;
|
|
522
454
|
}
|
|
523
455
|
}
|
|
524
|
-
t && (e.
|
|
456
|
+
t && (e.ne = true);
|
|
525
457
|
return t;
|
|
526
458
|
}
|
|
527
459
|
function currentTransition(e) {
|
|
528
|
-
while (e.
|
|
460
|
+
while (e.ne && typeof e.ne === "object") e = e.ne;
|
|
529
461
|
return e;
|
|
530
462
|
}
|
|
463
|
+
function setActiveTransition(e) {
|
|
464
|
+
x = e;
|
|
465
|
+
}
|
|
531
466
|
function runInTransition(e, t) {
|
|
532
467
|
const n = x;
|
|
533
468
|
try {
|
|
@@ -537,195 +472,107 @@ function runInTransition(e, t) {
|
|
|
537
472
|
x = n;
|
|
538
473
|
}
|
|
539
474
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
475
|
+
const k = new WeakMap();
|
|
476
|
+
const C = new Set();
|
|
477
|
+
function getOrCreateLane(e) {
|
|
478
|
+
let t = k.get(e);
|
|
479
|
+
if (t) {
|
|
480
|
+
return findLane(t);
|
|
481
|
+
}
|
|
482
|
+
const n = e.de;
|
|
483
|
+
const r = n?.ie ? findLane(n.ie) : null;
|
|
484
|
+
t = { t: e, M: new Set(), q: [[], []], T: null, re: x, pe: r };
|
|
485
|
+
k.set(e, t);
|
|
486
|
+
C.add(t);
|
|
487
|
+
e.he = e.ye || 0;
|
|
488
|
+
return t;
|
|
545
489
|
}
|
|
546
|
-
function
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
const i = e(...t);
|
|
550
|
-
E.initTransition();
|
|
551
|
-
let s = x;
|
|
552
|
-
s.le.push(i);
|
|
553
|
-
const done = (e, t) => {
|
|
554
|
-
s = currentTransition(s);
|
|
555
|
-
const o = s.le.indexOf(i);
|
|
556
|
-
if (o >= 0) s.le.splice(o, 1);
|
|
557
|
-
x = s;
|
|
558
|
-
schedule();
|
|
559
|
-
t ? r(t) : n(e);
|
|
560
|
-
};
|
|
561
|
-
const step = (e, t) => {
|
|
562
|
-
let n;
|
|
563
|
-
try {
|
|
564
|
-
n = t ? i.throw(e) : i.next(e);
|
|
565
|
-
} catch (e) {
|
|
566
|
-
return done(undefined, e);
|
|
567
|
-
}
|
|
568
|
-
if (n instanceof Promise)
|
|
569
|
-
return void n.then(run, e => restoreTransition(s, () => step(e, true)));
|
|
570
|
-
run(n);
|
|
571
|
-
};
|
|
572
|
-
const run = e => {
|
|
573
|
-
if (e.done) return done(e.value);
|
|
574
|
-
if (e.value instanceof Promise)
|
|
575
|
-
return void e.value.then(
|
|
576
|
-
e => restoreTransition(s, () => step(e)),
|
|
577
|
-
e => restoreTransition(s, () => step(e, true))
|
|
578
|
-
);
|
|
579
|
-
restoreTransition(s, () => step(e.value));
|
|
580
|
-
};
|
|
581
|
-
step();
|
|
582
|
-
});
|
|
490
|
+
function findLane(e) {
|
|
491
|
+
while (e.T) e = e.T;
|
|
492
|
+
return e;
|
|
583
493
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
t.be = null;
|
|
613
|
-
t._ = r;
|
|
614
|
-
t.fe = O;
|
|
615
|
-
let p = t.J === y ? t.ye : t.J;
|
|
616
|
-
let g = t.u;
|
|
617
|
-
let w = W;
|
|
618
|
-
let S = A;
|
|
619
|
-
W = true;
|
|
620
|
-
if (s) {
|
|
621
|
-
const e = resolveLane(t);
|
|
622
|
-
if (e) setCurrentOptimisticLane(e);
|
|
623
|
-
}
|
|
624
|
-
try {
|
|
625
|
-
p = handleAsync(t, t.R(p));
|
|
626
|
-
clearStatus(t);
|
|
627
|
-
const e = resolveLane(t);
|
|
628
|
-
if (e) {
|
|
629
|
-
e.q.delete(t);
|
|
630
|
-
updatePendingSignal(e.t);
|
|
631
|
-
}
|
|
632
|
-
} catch (e) {
|
|
633
|
-
if (e instanceof NotReadyError && A) {
|
|
634
|
-
const e = findLane(A);
|
|
635
|
-
if (e.t !== t) {
|
|
636
|
-
e.q.add(t);
|
|
637
|
-
t.M = e;
|
|
638
|
-
updatePendingSignal(e.t);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
notifyStatus(
|
|
642
|
-
t,
|
|
643
|
-
e instanceof NotReadyError ? l : c,
|
|
644
|
-
e,
|
|
645
|
-
undefined,
|
|
646
|
-
e instanceof NotReadyError ? t.M : undefined
|
|
647
|
-
);
|
|
648
|
-
} finally {
|
|
649
|
-
W = w;
|
|
650
|
-
t._ = e;
|
|
651
|
-
H = d;
|
|
652
|
-
}
|
|
653
|
-
if (!t.oe) {
|
|
654
|
-
const e = t.be;
|
|
655
|
-
let r = e !== null ? e.L : t.N;
|
|
656
|
-
if (r !== null) {
|
|
657
|
-
do {
|
|
658
|
-
r = unlinkSubs(r);
|
|
659
|
-
} while (r !== null);
|
|
660
|
-
if (e !== null) e.L = null;
|
|
661
|
-
else t.N = null;
|
|
494
|
+
function mergeLanes(e, t) {
|
|
495
|
+
e = findLane(e);
|
|
496
|
+
t = findLane(t);
|
|
497
|
+
if (e === t) return e;
|
|
498
|
+
t.T = e;
|
|
499
|
+
for (const n of t.M) e.M.add(n);
|
|
500
|
+
e.q[0].push(...t.q[0]);
|
|
501
|
+
e.q[1].push(...t.q[1]);
|
|
502
|
+
return e;
|
|
503
|
+
}
|
|
504
|
+
function resolveLane(e) {
|
|
505
|
+
const t = e.ie;
|
|
506
|
+
if (!t) return undefined;
|
|
507
|
+
const n = findLane(t);
|
|
508
|
+
if (C.has(n)) return n;
|
|
509
|
+
e.ie = undefined;
|
|
510
|
+
return undefined;
|
|
511
|
+
}
|
|
512
|
+
function hasActiveOverride(e) {
|
|
513
|
+
return !!(e.ge && e.le !== y);
|
|
514
|
+
}
|
|
515
|
+
function assignOrMergeLane(e, t) {
|
|
516
|
+
const n = findLane(t);
|
|
517
|
+
const r = e.ie;
|
|
518
|
+
if (r) {
|
|
519
|
+
if (r.T) {
|
|
520
|
+
e.ie = t;
|
|
521
|
+
return;
|
|
662
522
|
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
const e = t.K || 0;
|
|
671
|
-
const n = t.G || 0;
|
|
672
|
-
if (e <= n) t.ye = p;
|
|
673
|
-
}
|
|
674
|
-
if (!u || s || t.ye !== e) {
|
|
675
|
-
insertSubs(t, s || u);
|
|
676
|
-
}
|
|
677
|
-
} else if (u) {
|
|
678
|
-
t.J = p;
|
|
679
|
-
} else if (t.u != g) {
|
|
680
|
-
for (let e = t.P; e !== null; e = e.C) {
|
|
681
|
-
insertIntoHeapHeight(e.k, e.k._ & o ? b : _);
|
|
523
|
+
const i = findLane(r);
|
|
524
|
+
if (C.has(i)) {
|
|
525
|
+
if (i !== n && !hasActiveOverride(e)) {
|
|
526
|
+
if (n.pe && findLane(n.pe) === i) {
|
|
527
|
+
e.ie = t;
|
|
528
|
+
} else if (i.pe && findLane(i.pe) === n);
|
|
529
|
+
else mergeLanes(n, i);
|
|
682
530
|
}
|
|
531
|
+
return;
|
|
683
532
|
}
|
|
684
533
|
}
|
|
685
|
-
|
|
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));
|
|
534
|
+
e.ie = t;
|
|
688
535
|
}
|
|
689
536
|
function handleAsync(e, t, r) {
|
|
690
537
|
const i = typeof t === "object" && t !== null;
|
|
691
538
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
692
539
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
693
540
|
if (!o && !s) {
|
|
694
|
-
e.
|
|
541
|
+
e.we = null;
|
|
695
542
|
return t;
|
|
696
543
|
}
|
|
697
|
-
e.
|
|
544
|
+
e.we = t;
|
|
698
545
|
let u;
|
|
699
546
|
const handleError = n => {
|
|
700
|
-
if (e.
|
|
701
|
-
|
|
547
|
+
if (e.we !== t) return;
|
|
548
|
+
A.initTransition(e.re);
|
|
702
549
|
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
703
|
-
e.
|
|
550
|
+
e.ee = O;
|
|
704
551
|
};
|
|
705
552
|
const asyncWrite = (i, s) => {
|
|
706
|
-
if (e.
|
|
553
|
+
if (e.we !== t) return;
|
|
707
554
|
if (e._ & (n | f)) return;
|
|
708
|
-
|
|
555
|
+
A.initTransition(e.re);
|
|
709
556
|
clearStatus(e);
|
|
710
557
|
const o = resolveLane(e);
|
|
711
|
-
if (o) o.
|
|
558
|
+
if (o) o.M.delete(e);
|
|
712
559
|
if (r) r(i);
|
|
713
|
-
else if (e.
|
|
714
|
-
const t = e.
|
|
715
|
-
if (e.R) e.
|
|
560
|
+
else if (e.ge) {
|
|
561
|
+
const t = e.le !== y;
|
|
562
|
+
if (e.R) e.le = i;
|
|
716
563
|
if (!t) {
|
|
717
|
-
e.
|
|
564
|
+
e.ce = i;
|
|
718
565
|
insertSubs(e);
|
|
719
566
|
}
|
|
720
|
-
e.
|
|
567
|
+
e.ee = O;
|
|
721
568
|
} else if (o) {
|
|
722
|
-
const t = e.
|
|
723
|
-
const n = e.
|
|
569
|
+
const t = e.ce;
|
|
570
|
+
const n = e.Se;
|
|
724
571
|
if (!n || !n(i, t)) {
|
|
725
|
-
e.
|
|
726
|
-
e.
|
|
727
|
-
if (e.
|
|
728
|
-
setSignal(e.
|
|
572
|
+
e.ce = i;
|
|
573
|
+
e.ee = O;
|
|
574
|
+
if (e.me) {
|
|
575
|
+
setSignal(e.me, i);
|
|
729
576
|
}
|
|
730
577
|
insertSubs(e, true);
|
|
731
578
|
}
|
|
@@ -752,8 +599,8 @@ function handleAsync(e, t, r) {
|
|
|
752
599
|
);
|
|
753
600
|
r = false;
|
|
754
601
|
if (!n) {
|
|
755
|
-
|
|
756
|
-
throw new NotReadyError(
|
|
602
|
+
A.initTransition(e.re);
|
|
603
|
+
throw new NotReadyError(Q);
|
|
757
604
|
}
|
|
758
605
|
}
|
|
759
606
|
if (s) {
|
|
@@ -784,27 +631,27 @@ function handleAsync(e, t, r) {
|
|
|
784
631
|
};
|
|
785
632
|
const i = iterate();
|
|
786
633
|
if (!r && !i) {
|
|
787
|
-
|
|
788
|
-
throw new NotReadyError(
|
|
634
|
+
A.initTransition(e.re);
|
|
635
|
+
throw new NotReadyError(Q);
|
|
789
636
|
}
|
|
790
637
|
}
|
|
791
638
|
return u;
|
|
792
639
|
}
|
|
793
640
|
function clearStatus(e) {
|
|
794
|
-
e.
|
|
795
|
-
e.
|
|
641
|
+
e.ae = e.ae & a;
|
|
642
|
+
e.Z = null;
|
|
796
643
|
updatePendingSignal(e);
|
|
797
|
-
e.
|
|
644
|
+
e._e?.();
|
|
798
645
|
}
|
|
799
646
|
function notifyStatus(e, t, n, r, i) {
|
|
800
647
|
if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
801
648
|
n = new StatusError(e, n);
|
|
802
649
|
const s = n instanceof NotReadyError && n.t === e;
|
|
803
|
-
const o = t === l && e.
|
|
650
|
+
const o = t === l && e.ge && !s;
|
|
804
651
|
const u = o && hasActiveOverride(e);
|
|
805
652
|
if (!r) {
|
|
806
|
-
e.
|
|
807
|
-
e.
|
|
653
|
+
e.ae = t | (t !== c ? e.ae & a : 0);
|
|
654
|
+
e.Z = n;
|
|
808
655
|
updatePendingSignal(e);
|
|
809
656
|
}
|
|
810
657
|
if (i && !r) {
|
|
@@ -812,68 +659,249 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
812
659
|
}
|
|
813
660
|
if (u && x && n instanceof NotReadyError) {
|
|
814
661
|
const e = n.t;
|
|
815
|
-
if (!x
|
|
816
|
-
x
|
|
662
|
+
if (!x.$.includes(e)) {
|
|
663
|
+
x.$.push(e);
|
|
817
664
|
}
|
|
818
665
|
}
|
|
819
666
|
const f = r || u;
|
|
820
667
|
const d = r || o ? undefined : i;
|
|
821
|
-
if (e.
|
|
668
|
+
if (e._e) {
|
|
822
669
|
if (f) {
|
|
823
|
-
e.
|
|
670
|
+
e._e(t, n);
|
|
824
671
|
} else {
|
|
825
|
-
e.
|
|
672
|
+
e._e();
|
|
826
673
|
}
|
|
827
674
|
return;
|
|
828
675
|
}
|
|
829
|
-
for (let r = e.P; r !== null; r = r.
|
|
830
|
-
r.k.
|
|
831
|
-
if (r.k.
|
|
832
|
-
!r.k.
|
|
676
|
+
for (let r = e.P; r !== null; r = r.A) {
|
|
677
|
+
r.k.ee = O;
|
|
678
|
+
if (r.k.Z !== n) {
|
|
679
|
+
!r.k.re && A.B.push(r.k);
|
|
833
680
|
notifyStatus(r.k, t, n, f, d);
|
|
834
681
|
}
|
|
835
682
|
}
|
|
836
|
-
for (let r = e.
|
|
837
|
-
for (let e = r.P; e !== null; e = e.
|
|
838
|
-
e.k.
|
|
839
|
-
if (e.k.
|
|
840
|
-
!e.k.
|
|
683
|
+
for (let r = e.C; r !== null; r = r.W) {
|
|
684
|
+
for (let e = r.P; e !== null; e = e.A) {
|
|
685
|
+
e.k.ee = O;
|
|
686
|
+
if (e.k.Z !== n) {
|
|
687
|
+
!e.k.re && A.B.push(e.k);
|
|
841
688
|
notifyStatus(e.k, t, n, f, d);
|
|
842
689
|
}
|
|
843
690
|
}
|
|
844
691
|
}
|
|
845
692
|
}
|
|
846
|
-
function
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
693
|
+
function effect(e, t, n, r, i) {
|
|
694
|
+
let s = false;
|
|
695
|
+
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
696
|
+
...i,
|
|
697
|
+
equals: () => {
|
|
698
|
+
o.oe = !o.Z;
|
|
699
|
+
if (s) o.ue.enqueue(o.se, runEffect.bind(o));
|
|
700
|
+
return false;
|
|
701
|
+
},
|
|
702
|
+
lazy: true
|
|
703
|
+
});
|
|
704
|
+
o.be = r;
|
|
705
|
+
o.Oe = t;
|
|
706
|
+
o.xe = n;
|
|
707
|
+
o.ve = undefined;
|
|
708
|
+
o.se = i?.render ? d : p;
|
|
709
|
+
o._e = (e, t) => {
|
|
710
|
+
const n = e !== undefined ? e : o.ae;
|
|
711
|
+
const r = t !== undefined ? t : o.Z;
|
|
712
|
+
if (n & c) {
|
|
713
|
+
let e = r;
|
|
714
|
+
o.ue.notify(o, l, 0);
|
|
715
|
+
if (o.se === p) {
|
|
716
|
+
try {
|
|
717
|
+
return o.xe
|
|
718
|
+
? o.xe(e, () => {
|
|
719
|
+
o.ve?.();
|
|
720
|
+
o.ve = undefined;
|
|
721
|
+
})
|
|
722
|
+
: console.error(e);
|
|
723
|
+
} catch (t) {
|
|
724
|
+
e = t;
|
|
725
|
+
}
|
|
853
726
|
}
|
|
854
|
-
if (
|
|
855
|
-
|
|
727
|
+
if (!o.ue.notify(o, c, c)) throw e;
|
|
728
|
+
} else if (o.se === d) o.ue.notify(o, l | c, n, r);
|
|
729
|
+
};
|
|
730
|
+
recompute(o, true);
|
|
731
|
+
!i?.defer && (o.se === p ? o.ue.enqueue(o.se, runEffect.bind(o)) : runEffect.call(o));
|
|
732
|
+
s = true;
|
|
733
|
+
onCleanup(() => o.ve?.());
|
|
734
|
+
}
|
|
735
|
+
function runEffect() {
|
|
736
|
+
if (!this.oe || this._ & u) return;
|
|
737
|
+
this.ve?.();
|
|
738
|
+
this.ve = undefined;
|
|
739
|
+
try {
|
|
740
|
+
this.ve = this.Oe(this.ce, this.be);
|
|
741
|
+
} catch (e) {
|
|
742
|
+
if (!this.ue.notify(this, c, c)) throw e;
|
|
743
|
+
} finally {
|
|
744
|
+
this.be = this.ce;
|
|
745
|
+
this.oe = false;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function trackedEffect(e, t) {
|
|
749
|
+
const run = () => {
|
|
750
|
+
if (!n.oe || n._ & u) return;
|
|
751
|
+
n.oe = false;
|
|
752
|
+
recompute(n);
|
|
753
|
+
};
|
|
754
|
+
const n = computed(
|
|
755
|
+
() => {
|
|
756
|
+
try {
|
|
757
|
+
n.ve?.();
|
|
758
|
+
n.ve = undefined;
|
|
759
|
+
n.ve = staleValues(e) || undefined;
|
|
760
|
+
} finally {
|
|
856
761
|
}
|
|
762
|
+
},
|
|
763
|
+
undefined,
|
|
764
|
+
{ ...t, lazy: true, pureWrite: true }
|
|
765
|
+
);
|
|
766
|
+
n.ve = undefined;
|
|
767
|
+
n.oe = true;
|
|
768
|
+
n.se = h;
|
|
769
|
+
n.fe = run;
|
|
770
|
+
n.ue.enqueue(p, run);
|
|
771
|
+
onCleanup(() => n.ve?.());
|
|
772
|
+
}
|
|
773
|
+
const W = {};
|
|
774
|
+
function markDisposal(e) {
|
|
775
|
+
let t = e.Pe;
|
|
776
|
+
while (t) {
|
|
777
|
+
t._ |= o;
|
|
778
|
+
if (t._ & i) {
|
|
779
|
+
deleteFromHeap(t, _);
|
|
780
|
+
insertIntoHeap(t, b);
|
|
857
781
|
}
|
|
782
|
+
markDisposal(t);
|
|
783
|
+
t = t.Ae;
|
|
858
784
|
}
|
|
859
|
-
|
|
860
|
-
|
|
785
|
+
}
|
|
786
|
+
function dispose(e) {
|
|
787
|
+
let t = e.N || null;
|
|
788
|
+
do {
|
|
789
|
+
t = unlinkSubs(t);
|
|
790
|
+
} while (t !== null);
|
|
791
|
+
e.N = null;
|
|
792
|
+
e.ke = null;
|
|
793
|
+
disposeChildren(e, true);
|
|
794
|
+
}
|
|
795
|
+
function disposeChildren(e, t = false, n) {
|
|
796
|
+
if (e._ & u) return;
|
|
797
|
+
if (t) e._ = u;
|
|
798
|
+
let r = n ? e.Ce : e.Pe;
|
|
799
|
+
while (r) {
|
|
800
|
+
const e = r.Ae;
|
|
801
|
+
if (r.N) {
|
|
802
|
+
const e = r;
|
|
803
|
+
deleteFromHeap(e, e._ & o ? b : _);
|
|
804
|
+
let t = e.N;
|
|
805
|
+
do {
|
|
806
|
+
t = unlinkSubs(t);
|
|
807
|
+
} while (t !== null);
|
|
808
|
+
e.N = null;
|
|
809
|
+
e.ke = null;
|
|
810
|
+
}
|
|
811
|
+
disposeChildren(r, true);
|
|
812
|
+
r = e;
|
|
861
813
|
}
|
|
862
|
-
|
|
814
|
+
if (n) {
|
|
815
|
+
e.Ce = null;
|
|
816
|
+
} else {
|
|
817
|
+
e.Pe = null;
|
|
818
|
+
e.Ae = null;
|
|
819
|
+
}
|
|
820
|
+
runDisposal(e, n);
|
|
821
|
+
}
|
|
822
|
+
function runDisposal(e, t) {
|
|
823
|
+
let n = t ? e.We : e.Ee;
|
|
824
|
+
if (!n) return;
|
|
825
|
+
if (Array.isArray(n)) {
|
|
826
|
+
for (let e = 0; e < n.length; e++) {
|
|
827
|
+
const t = n[e];
|
|
828
|
+
t.call(t);
|
|
829
|
+
}
|
|
830
|
+
} else {
|
|
831
|
+
n.call(n);
|
|
832
|
+
}
|
|
833
|
+
t ? (e.We = null) : (e.Ee = null);
|
|
834
|
+
}
|
|
835
|
+
function getNextChildId(e) {
|
|
836
|
+
if (e.id != null) return formatId(e.id, e.je++);
|
|
837
|
+
throw new Error("Cannot get child id from owner without an id");
|
|
838
|
+
}
|
|
839
|
+
function formatId(e, t) {
|
|
840
|
+
const n = t.toString(36),
|
|
841
|
+
r = n.length - 1;
|
|
842
|
+
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
843
|
+
}
|
|
844
|
+
function getObserver() {
|
|
845
|
+
if (L || H) return W;
|
|
846
|
+
return E ? Q : null;
|
|
847
|
+
}
|
|
848
|
+
function getOwner() {
|
|
849
|
+
return Q;
|
|
850
|
+
}
|
|
851
|
+
function onCleanup(e) {
|
|
852
|
+
if (!Q) return e;
|
|
853
|
+
if (!Q.Ee) Q.Ee = e;
|
|
854
|
+
else if (Array.isArray(Q.Ee)) Q.Ee.push(e);
|
|
855
|
+
else Q.Ee = [Q.Ee, e];
|
|
856
|
+
return e;
|
|
857
|
+
}
|
|
858
|
+
function createOwner(e) {
|
|
859
|
+
const t = Q;
|
|
860
|
+
const n = {
|
|
861
|
+
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
862
|
+
i: true,
|
|
863
|
+
l: t?.i ? t.l : t,
|
|
864
|
+
Pe: null,
|
|
865
|
+
Ae: null,
|
|
866
|
+
Ee: null,
|
|
867
|
+
ue: t?.ue ?? A,
|
|
868
|
+
Ne: t?.Ne || w,
|
|
869
|
+
je: 0,
|
|
870
|
+
We: null,
|
|
871
|
+
Ce: null,
|
|
872
|
+
o: t,
|
|
873
|
+
dispose(e = true) {
|
|
874
|
+
disposeChildren(n, e);
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
if (t) {
|
|
878
|
+
const e = t.Pe;
|
|
879
|
+
if (e === null) {
|
|
880
|
+
t.Pe = n;
|
|
881
|
+
} else {
|
|
882
|
+
n.Ae = e;
|
|
883
|
+
t.Pe = n;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return n;
|
|
887
|
+
}
|
|
888
|
+
function createRoot(e, t) {
|
|
889
|
+
const n = createOwner(t);
|
|
890
|
+
return runWithOwner(n, () => e(n.dispose));
|
|
863
891
|
}
|
|
864
892
|
function unlinkSubs(e) {
|
|
865
893
|
const t = e.I;
|
|
866
894
|
const n = e.L;
|
|
867
|
-
const r = e.
|
|
868
|
-
const i = e.
|
|
869
|
-
if (r !== null) r.
|
|
870
|
-
else t.
|
|
871
|
-
if (i !== null) i.
|
|
895
|
+
const r = e.A;
|
|
896
|
+
const i = e.Le;
|
|
897
|
+
if (r !== null) r.Le = i;
|
|
898
|
+
else t.Ie = i;
|
|
899
|
+
if (i !== null) i.A = r;
|
|
872
900
|
else {
|
|
873
901
|
t.P = r;
|
|
874
902
|
if (r === null) {
|
|
875
|
-
t.
|
|
876
|
-
t.R && !t.
|
|
903
|
+
t.He?.();
|
|
904
|
+
t.R && !t.Qe && unobserved(t);
|
|
877
905
|
}
|
|
878
906
|
}
|
|
879
907
|
return n;
|
|
@@ -888,27 +916,27 @@ function unobserved(e) {
|
|
|
888
916
|
disposeChildren(e, true);
|
|
889
917
|
}
|
|
890
918
|
function link(e, t) {
|
|
891
|
-
const n = t.
|
|
919
|
+
const n = t.ke;
|
|
892
920
|
if (n !== null && n.I === e) return;
|
|
893
921
|
let i = null;
|
|
894
922
|
const s = t._ & r;
|
|
895
923
|
if (s) {
|
|
896
924
|
i = n !== null ? n.L : t.N;
|
|
897
925
|
if (i !== null && i.I === e) {
|
|
898
|
-
t.
|
|
926
|
+
t.ke = i;
|
|
899
927
|
return;
|
|
900
928
|
}
|
|
901
929
|
}
|
|
902
|
-
const o = e.
|
|
930
|
+
const o = e.Ie;
|
|
903
931
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
904
|
-
const u = (t.
|
|
932
|
+
const u = (t.ke = e.Ie = { I: e, k: t, L: i, Le: o, A: null });
|
|
905
933
|
if (n !== null) n.L = u;
|
|
906
934
|
else t.N = u;
|
|
907
|
-
if (o !== null) o.
|
|
935
|
+
if (o !== null) o.A = u;
|
|
908
936
|
else e.P = u;
|
|
909
937
|
}
|
|
910
938
|
function isValidLink(e, t) {
|
|
911
|
-
const n = t.
|
|
939
|
+
const n = t.ke;
|
|
912
940
|
if (n !== null) {
|
|
913
941
|
let r = t.N;
|
|
914
942
|
do {
|
|
@@ -919,117 +947,171 @@ function isValidLink(e, t) {
|
|
|
919
947
|
}
|
|
920
948
|
return false;
|
|
921
949
|
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
950
|
+
GlobalQueue.U = recompute;
|
|
951
|
+
GlobalQueue.J = disposeChildren;
|
|
952
|
+
let E = false;
|
|
953
|
+
let j = false;
|
|
954
|
+
let N = false;
|
|
955
|
+
let L = false;
|
|
956
|
+
let I = false;
|
|
957
|
+
let H = false;
|
|
958
|
+
let Q = null;
|
|
959
|
+
let R = null;
|
|
960
|
+
function recompute(t, n = false) {
|
|
961
|
+
const i = t.se;
|
|
962
|
+
if (!n) {
|
|
963
|
+
if (t.re && (!i || x) && x !== t.re) A.initTransition(t.re);
|
|
964
|
+
deleteFromHeap(t, t._ & o ? b : _);
|
|
965
|
+
if (t.re || i === h) disposeChildren(t);
|
|
966
|
+
else {
|
|
967
|
+
markDisposal(t);
|
|
968
|
+
t.We = t.Ee;
|
|
969
|
+
t.Ce = t.Pe;
|
|
970
|
+
t.Ee = null;
|
|
971
|
+
t.Pe = null;
|
|
929
972
|
}
|
|
930
|
-
markDisposal(t);
|
|
931
|
-
t = t.We;
|
|
932
973
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
e.
|
|
957
|
-
e.be = null;
|
|
974
|
+
const s = !!(t._ & f);
|
|
975
|
+
const u = hasActiveOverride(t);
|
|
976
|
+
const a = !!(t.ae & l);
|
|
977
|
+
const d = Q;
|
|
978
|
+
Q = t;
|
|
979
|
+
t.ke = null;
|
|
980
|
+
t._ = r;
|
|
981
|
+
t.ee = O;
|
|
982
|
+
let p = t.le === y ? t.ce : t.le;
|
|
983
|
+
let g = t.u;
|
|
984
|
+
let w = E;
|
|
985
|
+
let S = R;
|
|
986
|
+
E = true;
|
|
987
|
+
if (s) {
|
|
988
|
+
const e = resolveLane(t);
|
|
989
|
+
if (e) R = e;
|
|
990
|
+
}
|
|
991
|
+
try {
|
|
992
|
+
p = handleAsync(t, t.R(p));
|
|
993
|
+
clearStatus(t);
|
|
994
|
+
const e = resolveLane(t);
|
|
995
|
+
if (e) {
|
|
996
|
+
e.M.delete(t);
|
|
997
|
+
updatePendingSignal(e.t);
|
|
958
998
|
}
|
|
959
|
-
|
|
960
|
-
|
|
999
|
+
} catch (e) {
|
|
1000
|
+
if (e instanceof NotReadyError && R) {
|
|
1001
|
+
const e = findLane(R);
|
|
1002
|
+
if (e.t !== t) {
|
|
1003
|
+
e.M.add(t);
|
|
1004
|
+
t.ie = e;
|
|
1005
|
+
updatePendingSignal(e.t);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
notifyStatus(
|
|
1009
|
+
t,
|
|
1010
|
+
e instanceof NotReadyError ? l : c,
|
|
1011
|
+
e,
|
|
1012
|
+
undefined,
|
|
1013
|
+
e instanceof NotReadyError ? t.ie : undefined
|
|
1014
|
+
);
|
|
1015
|
+
} finally {
|
|
1016
|
+
E = w;
|
|
1017
|
+
t._ = e;
|
|
1018
|
+
Q = d;
|
|
961
1019
|
}
|
|
962
|
-
if (
|
|
963
|
-
e
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1020
|
+
if (!t.Z) {
|
|
1021
|
+
const e = t.ke;
|
|
1022
|
+
let r = e !== null ? e.L : t.N;
|
|
1023
|
+
if (r !== null) {
|
|
1024
|
+
do {
|
|
1025
|
+
r = unlinkSubs(r);
|
|
1026
|
+
} while (r !== null);
|
|
1027
|
+
if (e !== null) e.L = null;
|
|
1028
|
+
else t.N = null;
|
|
1029
|
+
}
|
|
1030
|
+
const f = u ? t.ce : t.le === y ? t.ce : t.le;
|
|
1031
|
+
const l = !t.Se || !t.Se(f, p);
|
|
1032
|
+
if (l) {
|
|
1033
|
+
const e = u ? t.ce : undefined;
|
|
1034
|
+
if (n || (i && x !== t.re) || s) t.ce = p;
|
|
1035
|
+
else t.le = p;
|
|
1036
|
+
if (u && !s && a) {
|
|
1037
|
+
const e = t.ye || 0;
|
|
1038
|
+
const n = t.he || 0;
|
|
1039
|
+
if (e <= n) t.ce = p;
|
|
1040
|
+
}
|
|
1041
|
+
if (!u || s || t.ce !== e) {
|
|
1042
|
+
insertSubs(t, s || u);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (u) {
|
|
1045
|
+
t.le = p;
|
|
1046
|
+
} else if (t.u != g) {
|
|
1047
|
+
for (let e = t.P; e !== null; e = e.A) {
|
|
1048
|
+
insertIntoHeapHeight(e.k, e.k._ & o ? b : _);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
967
1051
|
}
|
|
968
|
-
|
|
1052
|
+
R = S;
|
|
1053
|
+
(!n || t.ae & l) && !t.re && !(x && t.ge) && A.B.push(t);
|
|
1054
|
+
t.re && i && x !== t.re && runInTransition(t.re, () => recompute(t));
|
|
969
1055
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1056
|
+
function updateIfNecessary(r) {
|
|
1057
|
+
if (r._ & t) {
|
|
1058
|
+
for (let e = r.N; e; e = e.L) {
|
|
1059
|
+
const t = e.I;
|
|
1060
|
+
const i = t.H || t;
|
|
1061
|
+
if (i.R) {
|
|
1062
|
+
updateIfNecessary(i);
|
|
1063
|
+
}
|
|
1064
|
+
if (r._ & n) {
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
977
1067
|
}
|
|
978
|
-
} else {
|
|
979
|
-
n.call(n);
|
|
980
1068
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
throw new Error("Cannot get child id from owner without an id");
|
|
986
|
-
}
|
|
987
|
-
function formatId(e, t) {
|
|
988
|
-
const n = t.toString(36),
|
|
989
|
-
r = n.length - 1;
|
|
990
|
-
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
1069
|
+
if (r._ & (n | f) || (r.Z && r.ee < O)) {
|
|
1070
|
+
recompute(r);
|
|
1071
|
+
}
|
|
1072
|
+
r._ = e;
|
|
991
1073
|
}
|
|
992
1074
|
function computed(t, n, r) {
|
|
993
1075
|
const i = {
|
|
994
|
-
id: r?.id ?? (
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1076
|
+
id: r?.id ?? (Q?.id != null ? getNextChildId(Q) : undefined),
|
|
1077
|
+
Se: r?.equals != null ? r.equals : isEqual,
|
|
1078
|
+
Re: !!r?.pureWrite,
|
|
1079
|
+
He: r?.unobserved,
|
|
1080
|
+
Ee: null,
|
|
1081
|
+
ue: Q?.ue ?? A,
|
|
1082
|
+
Ne: Q?.Ne ?? w,
|
|
1001
1083
|
je: 0,
|
|
1002
1084
|
R: t,
|
|
1003
|
-
|
|
1085
|
+
ce: n,
|
|
1004
1086
|
u: 0,
|
|
1005
|
-
|
|
1087
|
+
C: null,
|
|
1006
1088
|
S: undefined,
|
|
1007
1089
|
h: null,
|
|
1008
1090
|
N: null,
|
|
1009
|
-
be: null,
|
|
1010
|
-
P: null,
|
|
1011
1091
|
ke: null,
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1092
|
+
P: null,
|
|
1093
|
+
Ie: null,
|
|
1094
|
+
o: Q,
|
|
1095
|
+
Ae: null,
|
|
1096
|
+
Pe: null,
|
|
1015
1097
|
_: e,
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1098
|
+
ae: a,
|
|
1099
|
+
ee: O,
|
|
1100
|
+
le: y,
|
|
1101
|
+
We: null,
|
|
1102
|
+
Ce: null,
|
|
1019
1103
|
we: null,
|
|
1020
|
-
|
|
1021
|
-
xe: null,
|
|
1022
|
-
B: null
|
|
1104
|
+
re: null
|
|
1023
1105
|
};
|
|
1024
1106
|
i.h = i;
|
|
1025
|
-
const s =
|
|
1026
|
-
if (
|
|
1027
|
-
const e =
|
|
1107
|
+
const s = Q?.i ? Q.l : Q;
|
|
1108
|
+
if (Q) {
|
|
1109
|
+
const e = Q.Pe;
|
|
1028
1110
|
if (e === null) {
|
|
1029
|
-
|
|
1111
|
+
Q.Pe = i;
|
|
1030
1112
|
} else {
|
|
1031
|
-
i.
|
|
1032
|
-
|
|
1113
|
+
i.Ae = e;
|
|
1114
|
+
Q.Pe = i;
|
|
1033
1115
|
}
|
|
1034
1116
|
}
|
|
1035
1117
|
if (s) i.u = s.u + 1;
|
|
@@ -1038,112 +1120,55 @@ function computed(t, n, r) {
|
|
|
1038
1120
|
}
|
|
1039
1121
|
function signal(e, t, n = null) {
|
|
1040
1122
|
const r = {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1123
|
+
Se: t?.equals != null ? t.equals : isEqual,
|
|
1124
|
+
Re: !!t?.pureWrite,
|
|
1125
|
+
He: t?.unobserved,
|
|
1126
|
+
ce: e,
|
|
1045
1127
|
P: null,
|
|
1046
|
-
|
|
1047
|
-
|
|
1128
|
+
Ie: null,
|
|
1129
|
+
ee: O,
|
|
1048
1130
|
H: n,
|
|
1049
|
-
W: n?.
|
|
1050
|
-
|
|
1131
|
+
W: n?.C || null,
|
|
1132
|
+
le: y
|
|
1051
1133
|
};
|
|
1052
|
-
n && (n.
|
|
1134
|
+
n && (n.C = r);
|
|
1053
1135
|
return r;
|
|
1054
1136
|
}
|
|
1055
1137
|
function optimisticSignal(e, t) {
|
|
1056
1138
|
const n = signal(e, t);
|
|
1057
|
-
n.
|
|
1139
|
+
n.ge = true;
|
|
1058
1140
|
return n;
|
|
1059
1141
|
}
|
|
1060
1142
|
function optimisticComputed(e, t, n) {
|
|
1061
1143
|
const r = computed(e, t, n);
|
|
1062
|
-
r.
|
|
1144
|
+
r.ge = true;
|
|
1063
1145
|
return r;
|
|
1064
1146
|
}
|
|
1065
|
-
function getPendingSignal(e) {
|
|
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);
|
|
1072
|
-
}
|
|
1073
|
-
return e.Qe;
|
|
1074
|
-
}
|
|
1075
|
-
function computePendingState(e) {
|
|
1076
|
-
const t = e;
|
|
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));
|
|
1087
|
-
}
|
|
1088
|
-
function getPendingValueComputed(e) {
|
|
1089
|
-
if (!e.ve) {
|
|
1090
|
-
const t = I;
|
|
1091
|
-
I = false;
|
|
1092
|
-
const n = L;
|
|
1093
|
-
L = false;
|
|
1094
|
-
const r = H;
|
|
1095
|
-
H = null;
|
|
1096
|
-
e.ve = optimisticComputed(() => read(e));
|
|
1097
|
-
e.ve.T = e;
|
|
1098
|
-
H = r;
|
|
1099
|
-
L = n;
|
|
1100
|
-
I = t;
|
|
1101
|
-
}
|
|
1102
|
-
return e.ve;
|
|
1103
|
-
}
|
|
1104
|
-
function updatePendingSignal(e) {
|
|
1105
|
-
if (e.Qe) {
|
|
1106
|
-
const t = computePendingState(e);
|
|
1107
|
-
const n = e.Qe;
|
|
1108
|
-
setSignal(n, t);
|
|
1109
|
-
if (!t && n.M) {
|
|
1110
|
-
const t = resolveLane(e);
|
|
1111
|
-
if (t && t.q.size > 0) {
|
|
1112
|
-
const e = findLane(n.M);
|
|
1113
|
-
if (e !== t) {
|
|
1114
|
-
mergeLanes(t, e);
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
clearLaneEntry(n);
|
|
1118
|
-
n.M = undefined;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
1147
|
function isEqual(e, t) {
|
|
1123
1148
|
return e === t;
|
|
1124
1149
|
}
|
|
1125
1150
|
function untrack(e) {
|
|
1126
|
-
if (!
|
|
1127
|
-
|
|
1151
|
+
if (!E) return e();
|
|
1152
|
+
E = false;
|
|
1128
1153
|
try {
|
|
1129
1154
|
return e();
|
|
1130
1155
|
} finally {
|
|
1131
|
-
|
|
1156
|
+
E = true;
|
|
1132
1157
|
}
|
|
1133
1158
|
}
|
|
1134
1159
|
function read(e) {
|
|
1135
|
-
if (
|
|
1160
|
+
if (H) {
|
|
1136
1161
|
const t = getPendingValueComputed(e);
|
|
1137
|
-
const n =
|
|
1138
|
-
|
|
1162
|
+
const n = H;
|
|
1163
|
+
H = false;
|
|
1139
1164
|
const r = read(t);
|
|
1140
|
-
|
|
1141
|
-
if (t.
|
|
1142
|
-
if (j &&
|
|
1143
|
-
const n = findLane(t.
|
|
1144
|
-
const r = findLane(
|
|
1145
|
-
if (n !== r && n.
|
|
1146
|
-
return e.
|
|
1165
|
+
H = n;
|
|
1166
|
+
if (t.ae & l) return e.ce;
|
|
1167
|
+
if (j && R && t.ie) {
|
|
1168
|
+
const n = findLane(t.ie);
|
|
1169
|
+
const r = findLane(R);
|
|
1170
|
+
if (n !== r && n.M.size > 0) {
|
|
1171
|
+
return e.ce;
|
|
1147
1172
|
}
|
|
1148
1173
|
}
|
|
1149
1174
|
return r;
|
|
@@ -1154,15 +1179,15 @@ function read(e) {
|
|
|
1154
1179
|
const r = L;
|
|
1155
1180
|
L = false;
|
|
1156
1181
|
if (read(n)) {
|
|
1157
|
-
|
|
1182
|
+
I = true;
|
|
1158
1183
|
}
|
|
1159
1184
|
L = r;
|
|
1160
|
-
return e.
|
|
1185
|
+
return e.ce;
|
|
1161
1186
|
}
|
|
1162
|
-
let t =
|
|
1187
|
+
let t = Q;
|
|
1163
1188
|
if (t?.i) t = t.l;
|
|
1164
1189
|
if (N && e.R) recompute(e);
|
|
1165
|
-
if (t &&
|
|
1190
|
+
if (t && E) {
|
|
1166
1191
|
if (e.R && e._ & u) recompute(e);
|
|
1167
1192
|
link(e, t);
|
|
1168
1193
|
const n = e.H || e;
|
|
@@ -1180,128 +1205,136 @@ function read(e) {
|
|
|
1180
1205
|
}
|
|
1181
1206
|
}
|
|
1182
1207
|
const n = e.H || e;
|
|
1183
|
-
if (t && n.
|
|
1184
|
-
if (
|
|
1185
|
-
const r = n.
|
|
1186
|
-
const i = findLane(
|
|
1208
|
+
if (t && n.ae & l && !(j && n.re && x !== n.re)) {
|
|
1209
|
+
if (R) {
|
|
1210
|
+
const r = n.ie;
|
|
1211
|
+
const i = findLane(R);
|
|
1187
1212
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1188
|
-
if (!
|
|
1189
|
-
throw n.
|
|
1213
|
+
if (!E) link(e, t);
|
|
1214
|
+
throw n.Z;
|
|
1190
1215
|
}
|
|
1191
1216
|
} else {
|
|
1192
|
-
if (!
|
|
1193
|
-
throw n.
|
|
1217
|
+
if (!E) link(e, t);
|
|
1218
|
+
throw n.Z;
|
|
1194
1219
|
}
|
|
1195
1220
|
}
|
|
1196
|
-
if (e.R && e.
|
|
1197
|
-
if (e.
|
|
1221
|
+
if (e.R && e.ae & c) {
|
|
1222
|
+
if (e.ee < O) {
|
|
1198
1223
|
recompute(e, true);
|
|
1199
1224
|
return read(e);
|
|
1200
|
-
} else throw e.
|
|
1225
|
+
} else throw e.Z;
|
|
1201
1226
|
}
|
|
1202
|
-
return !t ||
|
|
1227
|
+
return !t || R !== null || e.le === y || (j && e.re && x !== e.re) ? e.ce : e.le;
|
|
1203
1228
|
}
|
|
1204
1229
|
function setSignal(e, t) {
|
|
1205
|
-
if (e.
|
|
1206
|
-
const n = e.
|
|
1207
|
-
const r = n ? e.
|
|
1230
|
+
if (e.re && x !== e.re) A.initTransition(e.re);
|
|
1231
|
+
const n = e.ge && !P;
|
|
1232
|
+
const r = n ? e.ce : e.le === y ? e.ce : e.le;
|
|
1208
1233
|
if (typeof t === "function") t = t(r);
|
|
1209
|
-
const i = !e.
|
|
1234
|
+
const i = !e.Se || !e.Se(r, t);
|
|
1210
1235
|
if (!i) {
|
|
1211
|
-
if (n && e.
|
|
1236
|
+
if (n && e.le !== y && e.R) {
|
|
1212
1237
|
insertSubs(e, true);
|
|
1213
1238
|
schedule();
|
|
1214
1239
|
}
|
|
1215
1240
|
return t;
|
|
1216
1241
|
}
|
|
1217
1242
|
if (n) {
|
|
1218
|
-
const n =
|
|
1219
|
-
if (e.
|
|
1220
|
-
|
|
1243
|
+
const n = A.G.includes(e);
|
|
1244
|
+
if (e.re && n) {
|
|
1245
|
+
A.initTransition(e.re);
|
|
1221
1246
|
}
|
|
1222
|
-
if (e.
|
|
1223
|
-
e.
|
|
1247
|
+
if (e.le === y) {
|
|
1248
|
+
e.le = e.ce;
|
|
1224
1249
|
}
|
|
1225
1250
|
if (!n) {
|
|
1226
|
-
|
|
1251
|
+
A.G.push(e);
|
|
1227
1252
|
}
|
|
1228
|
-
e.
|
|
1253
|
+
e.ye = (e.ye || 0) + 1;
|
|
1229
1254
|
const r = getOrCreateLane(e);
|
|
1230
|
-
e.
|
|
1231
|
-
e.
|
|
1255
|
+
e.ie = r;
|
|
1256
|
+
e.ce = t;
|
|
1232
1257
|
} else {
|
|
1233
|
-
if (e.
|
|
1234
|
-
e.
|
|
1258
|
+
if (e.le === y) A.B.push(e);
|
|
1259
|
+
e.le = t;
|
|
1235
1260
|
}
|
|
1236
1261
|
updatePendingSignal(e);
|
|
1237
|
-
if (e.
|
|
1238
|
-
setSignal(e.
|
|
1262
|
+
if (e.me) {
|
|
1263
|
+
setSignal(e.me, t);
|
|
1239
1264
|
}
|
|
1240
|
-
e.
|
|
1265
|
+
e.ee = O;
|
|
1241
1266
|
insertSubs(e, n);
|
|
1242
1267
|
schedule();
|
|
1243
1268
|
return t;
|
|
1244
1269
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
else if (Array.isArray(H.Se)) H.Se.push(e);
|
|
1257
|
-
else H.Se = [H.Se, e];
|
|
1258
|
-
return e;
|
|
1270
|
+
function runWithOwner(e, t) {
|
|
1271
|
+
const n = Q;
|
|
1272
|
+
const r = E;
|
|
1273
|
+
Q = e;
|
|
1274
|
+
E = false;
|
|
1275
|
+
try {
|
|
1276
|
+
return t();
|
|
1277
|
+
} finally {
|
|
1278
|
+
Q = n;
|
|
1279
|
+
E = r;
|
|
1280
|
+
}
|
|
1259
1281
|
}
|
|
1260
|
-
function
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
l: t?.i ? t.l : t,
|
|
1266
|
-
_e: null,
|
|
1267
|
-
We: null,
|
|
1268
|
-
Se: null,
|
|
1269
|
-
pe: t?.pe ?? E,
|
|
1270
|
-
Le: t?.Le || w,
|
|
1271
|
-
je: 0,
|
|
1272
|
-
we: null,
|
|
1273
|
-
me: null,
|
|
1274
|
-
o: t,
|
|
1275
|
-
dispose(e = true) {
|
|
1276
|
-
disposeChildren(n, e);
|
|
1282
|
+
function getPendingSignal(e) {
|
|
1283
|
+
if (!e.Te) {
|
|
1284
|
+
e.Te = optimisticSignal(false, { pureWrite: true });
|
|
1285
|
+
if (e.de) {
|
|
1286
|
+
e.Te.de = e;
|
|
1277
1287
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1288
|
+
if (computePendingState(e)) setSignal(e.Te, true);
|
|
1289
|
+
}
|
|
1290
|
+
return e.Te;
|
|
1291
|
+
}
|
|
1292
|
+
function computePendingState(e) {
|
|
1293
|
+
const t = e;
|
|
1294
|
+
if (e.ge && e.le !== y) {
|
|
1295
|
+
if (t.ae & l && !(t.ae & a)) return true;
|
|
1296
|
+
if (e.de) {
|
|
1297
|
+
const t = e.ie ? findLane(e.ie) : null;
|
|
1298
|
+
return !!(t && t.M.size > 0);
|
|
1286
1299
|
}
|
|
1300
|
+
return true;
|
|
1287
1301
|
}
|
|
1288
|
-
return
|
|
1302
|
+
if (e.le !== y && !(t.ae & a)) return true;
|
|
1303
|
+
return !!(t.ae & l && !(t.ae & a));
|
|
1289
1304
|
}
|
|
1290
|
-
function
|
|
1291
|
-
|
|
1292
|
-
|
|
1305
|
+
function updatePendingSignal(e) {
|
|
1306
|
+
if (e.Te) {
|
|
1307
|
+
const t = computePendingState(e);
|
|
1308
|
+
const n = e.Te;
|
|
1309
|
+
setSignal(n, t);
|
|
1310
|
+
if (!t && n.ie) {
|
|
1311
|
+
const t = resolveLane(e);
|
|
1312
|
+
if (t && t.M.size > 0) {
|
|
1313
|
+
const e = findLane(n.ie);
|
|
1314
|
+
if (e !== t) {
|
|
1315
|
+
mergeLanes(t, e);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
k.delete(n);
|
|
1319
|
+
n.ie = undefined;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1293
1322
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1323
|
+
function getPendingValueComputed(e) {
|
|
1324
|
+
if (!e.me) {
|
|
1325
|
+
const t = H;
|
|
1326
|
+
H = false;
|
|
1327
|
+
const n = L;
|
|
1328
|
+
L = false;
|
|
1329
|
+
const r = Q;
|
|
1330
|
+
Q = null;
|
|
1331
|
+
e.me = optimisticComputed(() => read(e));
|
|
1332
|
+
e.me.de = e;
|
|
1333
|
+
Q = r;
|
|
1334
|
+
L = n;
|
|
1335
|
+
H = t;
|
|
1304
1336
|
}
|
|
1337
|
+
return e.me;
|
|
1305
1338
|
}
|
|
1306
1339
|
function staleValues(e, t = true) {
|
|
1307
1340
|
const n = j;
|
|
@@ -1313,27 +1346,27 @@ function staleValues(e, t = true) {
|
|
|
1313
1346
|
}
|
|
1314
1347
|
}
|
|
1315
1348
|
function pending(e) {
|
|
1316
|
-
const t =
|
|
1317
|
-
|
|
1349
|
+
const t = H;
|
|
1350
|
+
H = true;
|
|
1318
1351
|
try {
|
|
1319
1352
|
return e();
|
|
1320
1353
|
} finally {
|
|
1321
|
-
|
|
1354
|
+
H = t;
|
|
1322
1355
|
}
|
|
1323
1356
|
}
|
|
1324
1357
|
function isPending(e) {
|
|
1325
1358
|
const t = L;
|
|
1326
|
-
const n =
|
|
1359
|
+
const n = I;
|
|
1327
1360
|
L = true;
|
|
1328
|
-
|
|
1361
|
+
I = false;
|
|
1329
1362
|
try {
|
|
1330
1363
|
e();
|
|
1331
|
-
return
|
|
1364
|
+
return I;
|
|
1332
1365
|
} catch {
|
|
1333
|
-
return
|
|
1366
|
+
return I;
|
|
1334
1367
|
} finally {
|
|
1335
1368
|
L = t;
|
|
1336
|
-
|
|
1369
|
+
I = n;
|
|
1337
1370
|
}
|
|
1338
1371
|
}
|
|
1339
1372
|
function refresh(e) {
|
|
@@ -1362,7 +1395,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1362
1395
|
if (!t) {
|
|
1363
1396
|
throw new NoOwnerError();
|
|
1364
1397
|
}
|
|
1365
|
-
const n = hasContext(e, t) ? t.
|
|
1398
|
+
const n = hasContext(e, t) ? t.Ne[e.id] : e.defaultValue;
|
|
1366
1399
|
if (isUndefined(n)) {
|
|
1367
1400
|
throw new ContextNotFoundError();
|
|
1368
1401
|
}
|
|
@@ -1372,93 +1405,57 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1372
1405
|
if (!n) {
|
|
1373
1406
|
throw new NoOwnerError();
|
|
1374
1407
|
}
|
|
1375
|
-
n.
|
|
1408
|
+
n.Ne = { ...n.Ne, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1376
1409
|
}
|
|
1377
1410
|
function hasContext(e, t) {
|
|
1378
|
-
return !isUndefined(t?.
|
|
1411
|
+
return !isUndefined(t?.Ne[e.id]);
|
|
1379
1412
|
}
|
|
1380
1413
|
function isUndefined(e) {
|
|
1381
1414
|
return typeof e === "undefined";
|
|
1382
1415
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1416
|
+
function restoreTransition(e, t) {
|
|
1417
|
+
A.initTransition(e);
|
|
1418
|
+
const n = t();
|
|
1419
|
+
flush();
|
|
1420
|
+
return n;
|
|
1421
|
+
}
|
|
1422
|
+
function action(e) {
|
|
1423
|
+
return (...t) =>
|
|
1424
|
+
new Promise((n, r) => {
|
|
1425
|
+
const i = e(...t);
|
|
1426
|
+
A.initTransition();
|
|
1427
|
+
let s = x;
|
|
1428
|
+
s.te.push(i);
|
|
1429
|
+
const done = (e, t) => {
|
|
1430
|
+
s = currentTransition(s);
|
|
1431
|
+
const o = s.te.indexOf(i);
|
|
1432
|
+
if (o >= 0) s.te.splice(o, 1);
|
|
1433
|
+
setActiveTransition(s);
|
|
1434
|
+
schedule();
|
|
1435
|
+
t ? r(t) : n(e);
|
|
1436
|
+
};
|
|
1437
|
+
const step = (e, t) => {
|
|
1438
|
+
let n;
|
|
1406
1439
|
try {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
o.Te = undefined;
|
|
1411
|
-
})
|
|
1412
|
-
: console.error(e);
|
|
1413
|
-
} catch (t) {
|
|
1414
|
-
e = t;
|
|
1440
|
+
n = t ? i.throw(e) : i.next(e);
|
|
1441
|
+
} catch (e) {
|
|
1442
|
+
return done(undefined, e);
|
|
1415
1443
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
} catch (e) {
|
|
1432
|
-
if (!this.pe.notify(this, c, c)) throw e;
|
|
1433
|
-
} finally {
|
|
1434
|
-
this.Ie = this.ye;
|
|
1435
|
-
this.de = false;
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
function trackedEffect(e, t) {
|
|
1439
|
-
const run = () => {
|
|
1440
|
-
if (!n.de || n._ & u) return;
|
|
1441
|
-
n.de = false;
|
|
1442
|
-
recompute(n);
|
|
1443
|
-
};
|
|
1444
|
-
const n = computed(
|
|
1445
|
-
() => {
|
|
1446
|
-
try {
|
|
1447
|
-
n.Te?.();
|
|
1448
|
-
n.Te = undefined;
|
|
1449
|
-
n.Te = staleValues(e) || undefined;
|
|
1450
|
-
} finally {
|
|
1451
|
-
}
|
|
1452
|
-
},
|
|
1453
|
-
undefined,
|
|
1454
|
-
{ ...t, lazy: true, pureWrite: true }
|
|
1455
|
-
);
|
|
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?.());
|
|
1444
|
+
if (n instanceof Promise)
|
|
1445
|
+
return void n.then(run, e => restoreTransition(s, () => step(e, true)));
|
|
1446
|
+
run(n);
|
|
1447
|
+
};
|
|
1448
|
+
const run = e => {
|
|
1449
|
+
if (e.done) return done(e.value);
|
|
1450
|
+
if (e.value instanceof Promise)
|
|
1451
|
+
return void e.value.then(
|
|
1452
|
+
e => restoreTransition(s, () => step(e)),
|
|
1453
|
+
e => restoreTransition(s, () => step(e, true))
|
|
1454
|
+
);
|
|
1455
|
+
restoreTransition(s, () => step(e.value));
|
|
1456
|
+
};
|
|
1457
|
+
step();
|
|
1458
|
+
});
|
|
1462
1459
|
}
|
|
1463
1460
|
function createSignal(e, t, n) {
|
|
1464
1461
|
if (typeof e === "function") {
|
|
@@ -1523,7 +1520,7 @@ function createOptimistic(e, t, n) {
|
|
|
1523
1520
|
function onSettled(e) {
|
|
1524
1521
|
getOwner()
|
|
1525
1522
|
? createTrackedEffect(() => untrack(e))
|
|
1526
|
-
:
|
|
1523
|
+
: A.enqueue(p, () => {
|
|
1527
1524
|
const t = e();
|
|
1528
1525
|
t?.();
|
|
1529
1526
|
});
|
|
@@ -1690,7 +1687,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1690
1687
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1691
1688
|
});
|
|
1692
1689
|
});
|
|
1693
|
-
r.
|
|
1690
|
+
r.Qe = true;
|
|
1694
1691
|
return { store: s, node: r };
|
|
1695
1692
|
}
|
|
1696
1693
|
function createProjection(e, t = {}, n) {
|
|
@@ -1736,8 +1733,8 @@ const M = Symbol(0),
|
|
|
1736
1733
|
q = Symbol(0),
|
|
1737
1734
|
F = Symbol(0),
|
|
1738
1735
|
V = Symbol(0),
|
|
1739
|
-
|
|
1740
|
-
const
|
|
1736
|
+
D = Symbol(0);
|
|
1737
|
+
const B = new WeakMap();
|
|
1741
1738
|
const G = "v",
|
|
1742
1739
|
K = "o",
|
|
1743
1740
|
z = "x",
|
|
@@ -1790,7 +1787,7 @@ function getNode(e, t, n, r, i = isEqual, s) {
|
|
|
1790
1787
|
},
|
|
1791
1788
|
r
|
|
1792
1789
|
);
|
|
1793
|
-
if (s) o.
|
|
1790
|
+
if (s) o.ge = true;
|
|
1794
1791
|
return (e[t] = o);
|
|
1795
1792
|
}
|
|
1796
1793
|
function trackSelf(e, t = M) {
|
|
@@ -1802,7 +1799,7 @@ function getKeys(e, t, n = true) {
|
|
|
1802
1799
|
const i = new Set(r);
|
|
1803
1800
|
const s = Reflect.ownKeys(t);
|
|
1804
1801
|
for (const e of s) {
|
|
1805
|
-
if (t[e] !==
|
|
1802
|
+
if (t[e] !== D) i.add(e);
|
|
1806
1803
|
else i.delete(e);
|
|
1807
1804
|
}
|
|
1808
1805
|
return Array.from(i);
|
|
@@ -1810,7 +1807,7 @@ function getKeys(e, t, n = true) {
|
|
|
1810
1807
|
function getPropertyDescriptor(e, t, n) {
|
|
1811
1808
|
let r = e;
|
|
1812
1809
|
if (t && n in t) {
|
|
1813
|
-
if (r[n] ===
|
|
1810
|
+
if (r[n] === D) return void 0;
|
|
1814
1811
|
if (!(n in r)) r = t;
|
|
1815
1812
|
}
|
|
1816
1813
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
@@ -1836,15 +1833,15 @@ const re = {
|
|
|
1836
1833
|
if (e && e.get) return e.get.call(n);
|
|
1837
1834
|
}
|
|
1838
1835
|
if (writeOnly(n)) {
|
|
1839
|
-
let n = i && (o || !u) ? (i.
|
|
1840
|
-
n ===
|
|
1836
|
+
let n = i && (o || !u) ? (i.le !== y ? (i.ge ? i.ce : i.le) : i.ce) : f[t];
|
|
1837
|
+
n === D && (n = undefined);
|
|
1841
1838
|
if (!isWrappable(n)) return n;
|
|
1842
1839
|
const r = wrap(n, e);
|
|
1843
1840
|
ne?.add(r);
|
|
1844
1841
|
return r;
|
|
1845
1842
|
}
|
|
1846
1843
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1847
|
-
l ===
|
|
1844
|
+
l === D && (l = undefined);
|
|
1848
1845
|
if (!i) {
|
|
1849
1846
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1850
1847
|
let t;
|
|
@@ -1859,7 +1856,7 @@ const re = {
|
|
|
1859
1856
|
},
|
|
1860
1857
|
has(e, t) {
|
|
1861
1858
|
if (t === V || t === M || t === "__proto__") return true;
|
|
1862
|
-
const n = e[z] && t in e[z] ? e[z][t] !==
|
|
1859
|
+
const n = e[z] && t in e[z] ? e[z][t] !== D : e[K] && t in e[K] ? e[K][t] !== D : t in e[G];
|
|
1863
1860
|
getObserver() && read(getNode(getNodes(e, J), t, n, e[Z], isEqual, e[$]));
|
|
1864
1861
|
return n;
|
|
1865
1862
|
},
|
|
@@ -1868,8 +1865,8 @@ const re = {
|
|
|
1868
1865
|
if (writeOnly(r)) {
|
|
1869
1866
|
if (e[$]) {
|
|
1870
1867
|
const t = e[Z];
|
|
1871
|
-
if (t?.
|
|
1872
|
-
|
|
1868
|
+
if (t?.re) {
|
|
1869
|
+
A.initTransition(t.re);
|
|
1873
1870
|
}
|
|
1874
1871
|
}
|
|
1875
1872
|
untrack(() => {
|
|
@@ -1886,8 +1883,8 @@ const re = {
|
|
|
1886
1883
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
1887
1884
|
const a = isWrappable(l);
|
|
1888
1885
|
if (isWrappable(f)) {
|
|
1889
|
-
const e =
|
|
1890
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
1886
|
+
const e = B.get(f);
|
|
1887
|
+
e && (e instanceof Set ? e.delete(r) : B.delete(f));
|
|
1891
1888
|
}
|
|
1892
1889
|
if (recursivelyNotify(r, ee) && a) recursivelyAddParent(l, r);
|
|
1893
1890
|
e[J]?.[t] && setSignal(e[J][t], true);
|
|
@@ -1907,8 +1904,8 @@ const re = {
|
|
|
1907
1904
|
return true;
|
|
1908
1905
|
},
|
|
1909
1906
|
deleteProperty(e, t) {
|
|
1910
|
-
const n = e[z]?.[t] ===
|
|
1911
|
-
const r = e[K]?.[t] ===
|
|
1907
|
+
const n = e[z]?.[t] === D;
|
|
1908
|
+
const r = e[K]?.[t] === D;
|
|
1912
1909
|
if (writeOnly(e[V]) && !n && !r) {
|
|
1913
1910
|
untrack(() => {
|
|
1914
1911
|
const n = e[$] && !P;
|
|
@@ -1916,13 +1913,13 @@ const re = {
|
|
|
1916
1913
|
if (n) trackOptimisticStore(e[V]);
|
|
1917
1914
|
const i = e[z] && t in e[z] ? e[z][t] : e[K] && t in e[K] ? e[K][t] : e[G][t];
|
|
1918
1915
|
if (t in e[G] || (e[K] && t in e[K])) {
|
|
1919
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
1916
|
+
(e[r] || (e[r] = Object.create(null)))[t] = D;
|
|
1920
1917
|
} else if (e[r] && t in e[r]) {
|
|
1921
1918
|
delete e[r][t];
|
|
1922
1919
|
} else return true;
|
|
1923
1920
|
if (isWrappable(i)) {
|
|
1924
|
-
const t =
|
|
1925
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
1921
|
+
const t = B.get(i);
|
|
1922
|
+
t && (t instanceof Set ? t.delete(e) : B.delete(i));
|
|
1926
1923
|
}
|
|
1927
1924
|
if (e[J]?.[t]) setSignal(e[J][t], false);
|
|
1928
1925
|
const s = getNodes(e, U);
|
|
@@ -1938,7 +1935,7 @@ const re = {
|
|
|
1938
1935
|
if (e[z]) {
|
|
1939
1936
|
const n = new Set(t);
|
|
1940
1937
|
for (const t of Reflect.ownKeys(e[z])) {
|
|
1941
|
-
if (e[z][t] !==
|
|
1938
|
+
if (e[z][t] !== D) n.add(t);
|
|
1942
1939
|
else n.delete(t);
|
|
1943
1940
|
}
|
|
1944
1941
|
t = Array.from(n);
|
|
@@ -1948,7 +1945,7 @@ const re = {
|
|
|
1948
1945
|
getOwnPropertyDescriptor(e, t) {
|
|
1949
1946
|
if (t === V) return { value: e[V], writable: true, configurable: true };
|
|
1950
1947
|
if (e[z] && t in e[z]) {
|
|
1951
|
-
if (e[z][t] ===
|
|
1948
|
+
if (e[z][t] === D) return undefined;
|
|
1952
1949
|
const n = getPropertyDescriptor(e[G], e[K], t);
|
|
1953
1950
|
if (n) {
|
|
1954
1951
|
return { ...n, value: e[z][t] };
|
|
@@ -2000,7 +1997,7 @@ function recursivelyNotify(e, t) {
|
|
|
2000
1997
|
}
|
|
2001
1998
|
t = n[Y] || t;
|
|
2002
1999
|
}
|
|
2003
|
-
const i =
|
|
2000
|
+
const i = B.get(n?.[G] || e);
|
|
2004
2001
|
if (!i) return r;
|
|
2005
2002
|
if (i instanceof Set) {
|
|
2006
2003
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2015,10 +2012,10 @@ function recursivelyAddParent(e, t) {
|
|
|
2015
2012
|
e = r[G];
|
|
2016
2013
|
}
|
|
2017
2014
|
if (t) {
|
|
2018
|
-
let n =
|
|
2019
|
-
if (!n)
|
|
2015
|
+
let n = B.get(e);
|
|
2016
|
+
if (!n) B.set(e, t);
|
|
2020
2017
|
else if (n !== t) {
|
|
2021
|
-
if (!(n instanceof Set))
|
|
2018
|
+
if (!(n instanceof Set)) B.set(e, (n = new Set([n])));
|
|
2022
2019
|
else if (n.has(t)) return;
|
|
2023
2020
|
n.add(t);
|
|
2024
2021
|
} else return;
|
|
@@ -2043,7 +2040,7 @@ function deep(e) {
|
|
|
2043
2040
|
return e[q];
|
|
2044
2041
|
}
|
|
2045
2042
|
function createOptimisticStore(e, t, n) {
|
|
2046
|
-
GlobalQueue.
|
|
2043
|
+
GlobalQueue.X ||= clearOptimisticStore;
|
|
2047
2044
|
const r = typeof e === "function";
|
|
2048
2045
|
const i = (r ? t : e) ?? {};
|
|
2049
2046
|
const s = r ? e : undefined;
|
|
@@ -2060,14 +2057,14 @@ function clearOptimisticStore(e) {
|
|
|
2060
2057
|
if (r) {
|
|
2061
2058
|
for (const e of Reflect.ownKeys(n)) {
|
|
2062
2059
|
if (r[e]) {
|
|
2063
|
-
r[e].
|
|
2060
|
+
r[e].ie = undefined;
|
|
2064
2061
|
const n = t[K] && e in t[K] ? t[K][e] : t[G][e];
|
|
2065
|
-
const i = n ===
|
|
2062
|
+
const i = n === D ? undefined : n;
|
|
2066
2063
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2067
2064
|
}
|
|
2068
2065
|
}
|
|
2069
2066
|
if (r[M]) {
|
|
2070
|
-
r[M].
|
|
2067
|
+
r[M].ie = undefined;
|
|
2071
2068
|
setSignal(r[M], undefined);
|
|
2072
2069
|
}
|
|
2073
2070
|
}
|
|
@@ -2118,7 +2115,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2118
2115
|
setProjectionWriteActive(false);
|
|
2119
2116
|
}
|
|
2120
2117
|
});
|
|
2121
|
-
r.
|
|
2118
|
+
r.Qe = true;
|
|
2122
2119
|
}
|
|
2123
2120
|
return { store: s, node: r };
|
|
2124
2121
|
}
|
|
@@ -2141,7 +2138,7 @@ function snapshot(e, t, n) {
|
|
|
2141
2138
|
const r = s?.length || e.length;
|
|
2142
2139
|
for (let i = 0; i < r; i++) {
|
|
2143
2140
|
f = s && i in s ? s[i] : e[i];
|
|
2144
|
-
if (f ===
|
|
2141
|
+
if (f === D) continue;
|
|
2145
2142
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2146
2143
|
if (!o) t.set(e, (o = [...e]));
|
|
2147
2144
|
o[i] = u;
|
|
@@ -2303,8 +2300,8 @@ function mapArray(e, t, n) {
|
|
|
2303
2300
|
qe: 0,
|
|
2304
2301
|
Fe: e,
|
|
2305
2302
|
Ve: [],
|
|
2306
|
-
|
|
2307
|
-
|
|
2303
|
+
De: t,
|
|
2304
|
+
Be: [],
|
|
2308
2305
|
Ge: [],
|
|
2309
2306
|
Ke: r,
|
|
2310
2307
|
ze: r || n?.keyed === false ? [] : undefined,
|
|
@@ -2325,7 +2322,7 @@ function updateKeyedMap() {
|
|
|
2325
2322
|
? () => {
|
|
2326
2323
|
this.ze[r] = signal(e[r], oe);
|
|
2327
2324
|
this.Ue && (this.Ue[r] = signal(r, oe));
|
|
2328
|
-
return this.
|
|
2325
|
+
return this.De(
|
|
2329
2326
|
read.bind(null, this.ze[r]),
|
|
2330
2327
|
this.Ue ? read.bind(null, this.Ue[r]) : undefined
|
|
2331
2328
|
);
|
|
@@ -2334,31 +2331,31 @@ function updateKeyedMap() {
|
|
|
2334
2331
|
? () => {
|
|
2335
2332
|
const t = e[r];
|
|
2336
2333
|
this.Ue[r] = signal(r, oe);
|
|
2337
|
-
return this.
|
|
2334
|
+
return this.De(() => t, read.bind(null, this.Ue[r]));
|
|
2338
2335
|
}
|
|
2339
2336
|
: () => {
|
|
2340
2337
|
const t = e[r];
|
|
2341
|
-
return this.
|
|
2338
|
+
return this.De(() => t);
|
|
2342
2339
|
};
|
|
2343
2340
|
if (t === 0) {
|
|
2344
2341
|
if (this.qe !== 0) {
|
|
2345
2342
|
this.Me.dispose(false);
|
|
2346
2343
|
this.Ge = [];
|
|
2347
2344
|
this.Ve = [];
|
|
2348
|
-
this.
|
|
2345
|
+
this.Be = [];
|
|
2349
2346
|
this.qe = 0;
|
|
2350
2347
|
this.ze && (this.ze = []);
|
|
2351
2348
|
this.Ue && (this.Ue = []);
|
|
2352
2349
|
}
|
|
2353
|
-
if (this.Je && !this.
|
|
2354
|
-
this.
|
|
2350
|
+
if (this.Je && !this.Be[0]) {
|
|
2351
|
+
this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2355
2352
|
}
|
|
2356
2353
|
} else if (this.qe === 0) {
|
|
2357
2354
|
if (this.Ge[0]) this.Ge[0].dispose();
|
|
2358
|
-
this.
|
|
2355
|
+
this.Be = new Array(t);
|
|
2359
2356
|
for (r = 0; r < t; r++) {
|
|
2360
2357
|
this.Ve[r] = e[r];
|
|
2361
|
-
this.
|
|
2358
|
+
this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2362
2359
|
}
|
|
2363
2360
|
this.qe = t;
|
|
2364
2361
|
} else {
|
|
@@ -2387,7 +2384,7 @@ function updateKeyedMap() {
|
|
|
2387
2384
|
(this.Ve[o] === e[u] || (this.ze && compare(this.Ke, this.Ve[o], e[u])));
|
|
2388
2385
|
o--, u--
|
|
2389
2386
|
) {
|
|
2390
|
-
d[u] = this.
|
|
2387
|
+
d[u] = this.Be[o];
|
|
2391
2388
|
p[u] = this.Ge[o];
|
|
2392
2389
|
h && (h[u] = this.ze[o]);
|
|
2393
2390
|
y && (y[u] = this.Ue[o]);
|
|
@@ -2406,7 +2403,7 @@ function updateKeyedMap() {
|
|
|
2406
2403
|
l = this.Ke ? this.Ke(f) : f;
|
|
2407
2404
|
r = c.get(l);
|
|
2408
2405
|
if (r !== undefined && r !== -1) {
|
|
2409
|
-
d[r] = this.
|
|
2406
|
+
d[r] = this.Be[n];
|
|
2410
2407
|
p[r] = this.Ge[n];
|
|
2411
2408
|
h && (h[r] = this.ze[n]);
|
|
2412
2409
|
y && (y[r] = this.Ue[n]);
|
|
@@ -2416,7 +2413,7 @@ function updateKeyedMap() {
|
|
|
2416
2413
|
}
|
|
2417
2414
|
for (r = s; r < t; r++) {
|
|
2418
2415
|
if (r in d) {
|
|
2419
|
-
this.
|
|
2416
|
+
this.Be[r] = d[r];
|
|
2420
2417
|
this.Ge[r] = p[r];
|
|
2421
2418
|
if (h) {
|
|
2422
2419
|
this.ze[r] = h[r];
|
|
@@ -2427,14 +2424,14 @@ function updateKeyedMap() {
|
|
|
2427
2424
|
setSignal(this.Ue[r], r);
|
|
2428
2425
|
}
|
|
2429
2426
|
} else {
|
|
2430
|
-
this.
|
|
2427
|
+
this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2431
2428
|
}
|
|
2432
2429
|
}
|
|
2433
|
-
this.
|
|
2430
|
+
this.Be = this.Be.slice(0, (this.qe = t));
|
|
2434
2431
|
this.Ve = e.slice(0);
|
|
2435
2432
|
}
|
|
2436
2433
|
});
|
|
2437
|
-
return this.
|
|
2434
|
+
return this.Be;
|
|
2438
2435
|
}
|
|
2439
2436
|
function repeat(e, t, n) {
|
|
2440
2437
|
return updateRepeat.bind({
|
|
@@ -2442,9 +2439,9 @@ function repeat(e, t, n) {
|
|
|
2442
2439
|
qe: 0,
|
|
2443
2440
|
Xe: 0,
|
|
2444
2441
|
Ye: e,
|
|
2445
|
-
|
|
2442
|
+
De: t,
|
|
2446
2443
|
Ge: [],
|
|
2447
|
-
|
|
2444
|
+
Be: [],
|
|
2448
2445
|
Ze: n?.from,
|
|
2449
2446
|
Je: n?.fallback
|
|
2450
2447
|
});
|
|
@@ -2457,11 +2454,11 @@ function updateRepeat() {
|
|
|
2457
2454
|
if (this.qe !== 0) {
|
|
2458
2455
|
this.Me.dispose(false);
|
|
2459
2456
|
this.Ge = [];
|
|
2460
|
-
this.
|
|
2457
|
+
this.Be = [];
|
|
2461
2458
|
this.qe = 0;
|
|
2462
2459
|
}
|
|
2463
|
-
if (this.Je && !this.
|
|
2464
|
-
this.
|
|
2460
|
+
if (this.Je && !this.Be[0]) {
|
|
2461
|
+
this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2465
2462
|
}
|
|
2466
2463
|
return;
|
|
2467
2464
|
}
|
|
@@ -2473,147 +2470,96 @@ function updateRepeat() {
|
|
|
2473
2470
|
let e = this.Xe;
|
|
2474
2471
|
while (e < t && e < this.qe) this.Ge[e++].dispose();
|
|
2475
2472
|
this.Ge.splice(0, t - this.Xe);
|
|
2476
|
-
this.
|
|
2473
|
+
this.Be.splice(0, t - this.Xe);
|
|
2477
2474
|
} else if (this.Xe > t) {
|
|
2478
2475
|
let n = r - this.Xe - 1;
|
|
2479
2476
|
let i = this.Xe - t;
|
|
2480
|
-
this.Ge.length = this.
|
|
2477
|
+
this.Ge.length = this.Be.length = e;
|
|
2481
2478
|
while (n >= i) {
|
|
2482
2479
|
this.Ge[n] = this.Ge[n - i];
|
|
2483
|
-
this.
|
|
2480
|
+
this.Be[n] = this.Be[n - i];
|
|
2484
2481
|
n--;
|
|
2485
2482
|
}
|
|
2486
2483
|
for (let e = 0; e < i; e++) {
|
|
2487
|
-
this.
|
|
2484
|
+
this.Be[e] = runWithOwner((this.Ge[e] = createOwner()), () => this.De(e + t));
|
|
2488
2485
|
}
|
|
2489
2486
|
}
|
|
2490
2487
|
for (let e = r; e < n; e++) {
|
|
2491
|
-
this.
|
|
2488
|
+
this.Be[e - t] = runWithOwner((this.Ge[e - t] = createOwner()), () => this.De(e));
|
|
2492
2489
|
}
|
|
2493
|
-
this.
|
|
2490
|
+
this.Be = this.Be.slice(0, e);
|
|
2494
2491
|
this.Xe = t;
|
|
2495
2492
|
this.qe = e;
|
|
2496
2493
|
});
|
|
2497
|
-
return this.
|
|
2494
|
+
return this.Be;
|
|
2498
2495
|
}
|
|
2499
2496
|
function compare(e, t, n) {
|
|
2500
2497
|
return e ? e(t) === e(n) : true;
|
|
2501
2498
|
}
|
|
2502
2499
|
function boundaryComputed(e, t) {
|
|
2503
2500
|
const n = computed(e, undefined, { lazy: true });
|
|
2504
|
-
n.
|
|
2505
|
-
const r = e !== undefined ? e : n.
|
|
2506
|
-
const i = t !== undefined ? t : n.
|
|
2507
|
-
n.
|
|
2508
|
-
n.
|
|
2501
|
+
n._e = (e, t) => {
|
|
2502
|
+
const r = e !== undefined ? e : n.ae;
|
|
2503
|
+
const i = t !== undefined ? t : n.Z;
|
|
2504
|
+
n.ae &= ~n.$e;
|
|
2505
|
+
n.ue.notify(n, n.$e, r, i);
|
|
2509
2506
|
};
|
|
2510
2507
|
n.$e = t;
|
|
2511
|
-
n.
|
|
2508
|
+
n.Qe = true;
|
|
2512
2509
|
recompute(n, true);
|
|
2513
2510
|
return n;
|
|
2514
2511
|
}
|
|
2515
2512
|
function createBoundChildren(e, t, n, r) {
|
|
2516
|
-
const i = e.
|
|
2517
|
-
i.addChild((e.
|
|
2518
|
-
onCleanup(() => i.removeChild(e.
|
|
2513
|
+
const i = e.ue;
|
|
2514
|
+
i.addChild((e.ue = n));
|
|
2515
|
+
onCleanup(() => i.removeChild(e.ue));
|
|
2519
2516
|
return runWithOwner(e, () => {
|
|
2520
2517
|
const e = computed(t);
|
|
2521
2518
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2522
2519
|
});
|
|
2523
2520
|
}
|
|
2524
|
-
class
|
|
2521
|
+
class CollectionQueue extends Queue {
|
|
2525
2522
|
et;
|
|
2526
2523
|
tt = new Set();
|
|
2527
|
-
|
|
2524
|
+
nt = signal(false, { pureWrite: true });
|
|
2525
|
+
rt = false;
|
|
2528
2526
|
constructor(e) {
|
|
2529
2527
|
super();
|
|
2530
2528
|
this.et = e;
|
|
2531
2529
|
}
|
|
2532
2530
|
run(e) {
|
|
2533
|
-
if (!e || read(this.
|
|
2534
|
-
return super.run(e);
|
|
2535
|
-
}
|
|
2536
|
-
notify(e, t, n, r) {
|
|
2537
|
-
if (read(this.et)) {
|
|
2538
|
-
if (t & l) {
|
|
2539
|
-
if (n & l) {
|
|
2540
|
-
this.$.add(e);
|
|
2541
|
-
t &= ~l;
|
|
2542
|
-
} else if (this.$.delete(e)) t &= ~l;
|
|
2543
|
-
}
|
|
2544
|
-
if (t & c) {
|
|
2545
|
-
if (n & c) {
|
|
2546
|
-
this.tt.add(e);
|
|
2547
|
-
t &= ~c;
|
|
2548
|
-
} else if (this.tt.delete(e)) t &= ~c;
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
return t ? super.notify(e, t, n, r ?? e.oe) : true;
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
class CollectionQueue extends Queue {
|
|
2555
|
-
nt;
|
|
2556
|
-
rt = new Set();
|
|
2557
|
-
et = signal(false, { pureWrite: true });
|
|
2558
|
-
it = false;
|
|
2559
|
-
constructor(e) {
|
|
2560
|
-
super();
|
|
2561
|
-
this.nt = e;
|
|
2562
|
-
}
|
|
2563
|
-
run(e) {
|
|
2564
|
-
if (!e || read(this.et)) return;
|
|
2531
|
+
if (!e || read(this.nt)) return;
|
|
2565
2532
|
return super.run(e);
|
|
2566
2533
|
}
|
|
2567
2534
|
notify(e, t, n, r) {
|
|
2568
|
-
if (!(t & this.
|
|
2569
|
-
if (n & this.
|
|
2570
|
-
const t = r?.t || e.
|
|
2535
|
+
if (!(t & this.et) || (this.et & l && this.rt)) return super.notify(e, t, n, r);
|
|
2536
|
+
if (n & this.et) {
|
|
2537
|
+
const t = r?.t || e.Z?.t;
|
|
2571
2538
|
if (t) {
|
|
2572
|
-
const e = this.
|
|
2573
|
-
this.
|
|
2574
|
-
if (e) setSignal(this.
|
|
2539
|
+
const e = this.tt.size === 0;
|
|
2540
|
+
this.tt.add(t);
|
|
2541
|
+
if (e) setSignal(this.nt, true);
|
|
2575
2542
|
}
|
|
2576
2543
|
}
|
|
2577
|
-
t &= ~this.
|
|
2544
|
+
t &= ~this.et;
|
|
2578
2545
|
return t ? super.notify(e, t, n, r) : true;
|
|
2579
2546
|
}
|
|
2580
2547
|
checkSources() {
|
|
2581
|
-
for (const e of this.
|
|
2582
|
-
if (!(e.
|
|
2583
|
-
}
|
|
2584
|
-
if (!this.rt.size) setSignal(this.et, false);
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
var ue;
|
|
2588
|
-
(function (e) {
|
|
2589
|
-
e["VISIBLE"] = "visible";
|
|
2590
|
-
e["HIDDEN"] = "hidden";
|
|
2591
|
-
})(ue || (ue = {}));
|
|
2592
|
-
function createBoundary(e, t) {
|
|
2593
|
-
const n = createOwner();
|
|
2594
|
-
const r = new ConditionalQueue(computed(() => t() === ue.HIDDEN));
|
|
2595
|
-
const i = createBoundChildren(n, e, r, 0);
|
|
2596
|
-
computed(() => {
|
|
2597
|
-
const e = read(r.et);
|
|
2598
|
-
i.$e = e ? c | l : 0;
|
|
2599
|
-
if (!e) {
|
|
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();
|
|
2548
|
+
for (const e of this.tt) {
|
|
2549
|
+
if (!(e.ae & this.et)) this.tt.delete(e);
|
|
2604
2550
|
}
|
|
2605
|
-
|
|
2606
|
-
|
|
2551
|
+
if (!this.tt.size) setSignal(this.nt, false);
|
|
2552
|
+
}
|
|
2607
2553
|
}
|
|
2608
2554
|
function createCollectionBoundary(e, t, n) {
|
|
2609
2555
|
const r = createOwner();
|
|
2610
2556
|
const i = new CollectionQueue(e);
|
|
2611
2557
|
const s = createBoundChildren(r, t, i, e);
|
|
2612
2558
|
const o = computed(() => {
|
|
2613
|
-
if (!read(i.
|
|
2559
|
+
if (!read(i.nt)) {
|
|
2614
2560
|
const e = read(s);
|
|
2615
|
-
if (!untrack(() => read(i.
|
|
2616
|
-
i.
|
|
2561
|
+
if (!untrack(() => read(i.nt))) {
|
|
2562
|
+
i.rt = true;
|
|
2617
2563
|
return e;
|
|
2618
2564
|
}
|
|
2619
2565
|
}
|
|
@@ -2626,10 +2572,10 @@ function createLoadBoundary(e, t) {
|
|
|
2626
2572
|
}
|
|
2627
2573
|
function createErrorBoundary(e, t) {
|
|
2628
2574
|
return createCollectionBoundary(c, e, e => {
|
|
2629
|
-
let n = e.
|
|
2630
|
-
const r = n.
|
|
2575
|
+
let n = e.tt.values().next().value;
|
|
2576
|
+
const r = n.Z?.cause ?? n.Z;
|
|
2631
2577
|
return t(r, () => {
|
|
2632
|
-
for (const t of e.
|
|
2578
|
+
for (const t of e.tt) recompute(t);
|
|
2633
2579
|
schedule();
|
|
2634
2580
|
});
|
|
2635
2581
|
});
|
|
@@ -2691,7 +2637,6 @@ exports.NoOwnerError = NoOwnerError;
|
|
|
2691
2637
|
exports.NotReadyError = NotReadyError;
|
|
2692
2638
|
exports.SUPPORTS_PROXY = g;
|
|
2693
2639
|
exports.action = action;
|
|
2694
|
-
exports.createBoundary = createBoundary;
|
|
2695
2640
|
exports.createContext = createContext;
|
|
2696
2641
|
exports.createEffect = createEffect;
|
|
2697
2642
|
exports.createErrorBoundary = createErrorBoundary;
|
|
@@ -2699,6 +2644,7 @@ exports.createLoadBoundary = createLoadBoundary;
|
|
|
2699
2644
|
exports.createMemo = createMemo;
|
|
2700
2645
|
exports.createOptimistic = createOptimistic;
|
|
2701
2646
|
exports.createOptimisticStore = createOptimisticStore;
|
|
2647
|
+
exports.createOwner = createOwner;
|
|
2702
2648
|
exports.createProjection = createProjection;
|
|
2703
2649
|
exports.createReaction = createReaction;
|
|
2704
2650
|
exports.createRenderEffect = createRenderEffect;
|