@solidjs/signals 0.13.2 → 0.13.4
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 +515 -312
- package/dist/node.cjs +1271 -1106
- package/dist/prod.js +970 -798
- package/dist/types/core/async.d.ts +2 -1
- package/dist/types/core/effect.d.ts +2 -2
- package/dist/types/core/lanes.d.ts +4 -0
- package/dist/types/core/scheduler.d.ts +3 -0
- package/dist/types/core/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -32,14 +32,14 @@ const s = 1 << 4;
|
|
|
32
32
|
const o = 1 << 5;
|
|
33
33
|
const u = 1 << 6;
|
|
34
34
|
const f = 1 << 7;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const c = 1 << 8;
|
|
36
|
+
const l = 1 << 9;
|
|
37
37
|
const a = 1 << 0;
|
|
38
38
|
const d = 1 << 1;
|
|
39
39
|
const p = 1 << 2;
|
|
40
40
|
const h = 1;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const g = 2;
|
|
42
|
+
const y = 3;
|
|
43
43
|
const S = {};
|
|
44
44
|
const w = {};
|
|
45
45
|
const m = "sp";
|
|
@@ -130,10 +130,10 @@ function runHeap(e, t) {
|
|
|
130
130
|
function adjustHeight(e, t) {
|
|
131
131
|
deleteFromHeap(e, t);
|
|
132
132
|
let n = e.o;
|
|
133
|
-
for (let t = e.
|
|
133
|
+
for (let t = e.N; t; t = t.W) {
|
|
134
134
|
const e = t.L;
|
|
135
135
|
const r = e.I || e;
|
|
136
|
-
if (r.
|
|
136
|
+
if (r.T && r.o >= n) n = r.o + 1;
|
|
137
137
|
}
|
|
138
138
|
if (e.o !== n) {
|
|
139
139
|
e.o = n;
|
|
@@ -145,14 +145,18 @@ function adjustHeight(e, t) {
|
|
|
145
145
|
const x = new Set();
|
|
146
146
|
const P = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
147
147
|
const v = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
148
|
-
let
|
|
149
|
-
let
|
|
150
|
-
let
|
|
148
|
+
let E = 0;
|
|
149
|
+
let k = null;
|
|
150
|
+
let C = false;
|
|
151
151
|
let j = false;
|
|
152
|
+
let A = null;
|
|
152
153
|
function enforceLoadingBoundary(e) {}
|
|
154
|
+
function shouldReadStashedOptimisticValue(e) {
|
|
155
|
+
return !!A?.has(e);
|
|
156
|
+
}
|
|
153
157
|
function runLaneEffects(e) {
|
|
154
|
-
for (const t of
|
|
155
|
-
if (t.R || t.
|
|
158
|
+
for (const t of L) {
|
|
159
|
+
if (t.R || t.H.size > 0) continue;
|
|
156
160
|
const n = t.q[e - 1];
|
|
157
161
|
if (n.length) {
|
|
158
162
|
t.q[e - 1] = [];
|
|
@@ -160,27 +164,100 @@ function runLaneEffects(e) {
|
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
}
|
|
167
|
+
function queueStashedOptimisticEffects(e) {
|
|
168
|
+
for (let t = e.O; t !== null; t = t.P) {
|
|
169
|
+
const e = t.k;
|
|
170
|
+
if (!e.D) continue;
|
|
171
|
+
if (e.D === y) {
|
|
172
|
+
if (!e.V) {
|
|
173
|
+
e.V = true;
|
|
174
|
+
e.B.enqueue(g, e.F);
|
|
175
|
+
}
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
const n = e.m & o ? v : P;
|
|
179
|
+
if (n.A > e.o) n.A = e.o;
|
|
180
|
+
insertIntoHeap(e, n);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
163
183
|
function setProjectionWriteActive(e) {
|
|
164
184
|
j = e;
|
|
165
185
|
}
|
|
186
|
+
function mergeTransitionState(e, t) {
|
|
187
|
+
t.M = e;
|
|
188
|
+
e.G.push(...t.G);
|
|
189
|
+
for (const n of L) {
|
|
190
|
+
if (n.K === t) n.K = e;
|
|
191
|
+
}
|
|
192
|
+
e.U.push(...t.U);
|
|
193
|
+
for (const n of t.J) e.J.add(n);
|
|
194
|
+
for (const n of t.X) {
|
|
195
|
+
if (!e.X.includes(n)) e.X.push(n);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function resolveOptimisticNodes(e) {
|
|
199
|
+
for (let t = 0; t < e.length; t++) {
|
|
200
|
+
const n = e[t];
|
|
201
|
+
n.Y = undefined;
|
|
202
|
+
if (n.Z !== S) {
|
|
203
|
+
n.$ = n.Z;
|
|
204
|
+
n.Z = S;
|
|
205
|
+
}
|
|
206
|
+
const r = n.ee;
|
|
207
|
+
n.ee = S;
|
|
208
|
+
if (r !== S && n.$ !== r) insertSubs(n, true);
|
|
209
|
+
n.K = null;
|
|
210
|
+
}
|
|
211
|
+
e.length = 0;
|
|
212
|
+
}
|
|
213
|
+
function cleanupCompletedLanes(e) {
|
|
214
|
+
for (const t of L) {
|
|
215
|
+
const n = e ? t.K === e : !t.K;
|
|
216
|
+
if (!n) continue;
|
|
217
|
+
if (!t.R) {
|
|
218
|
+
if (t.q[0].length) runQueue(t.q[0], h);
|
|
219
|
+
if (t.q[1].length) runQueue(t.q[1], g);
|
|
220
|
+
}
|
|
221
|
+
if (t.te.Y === t) t.te.Y = undefined;
|
|
222
|
+
t.H.clear();
|
|
223
|
+
t.q[0].length = 0;
|
|
224
|
+
t.q[1].length = 0;
|
|
225
|
+
L.delete(t);
|
|
226
|
+
W.delete(t.te);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
166
229
|
function schedule() {
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
if (!
|
|
230
|
+
if (C) return;
|
|
231
|
+
C = true;
|
|
232
|
+
if (!N.ne && !j) queueMicrotask(flush);
|
|
233
|
+
}
|
|
234
|
+
function addTransitionBlocker(e) {
|
|
235
|
+
if (k && !k.X.includes(e)) {
|
|
236
|
+
k.X.push(e);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function removeTransitionBlocker(e) {
|
|
240
|
+
const remove = t => {
|
|
241
|
+
if (!t) return;
|
|
242
|
+
const n = t.indexOf(e);
|
|
243
|
+
if (n >= 0) t.splice(n, 1);
|
|
244
|
+
};
|
|
245
|
+
remove(e.K?.X);
|
|
246
|
+
remove(k?.X);
|
|
170
247
|
}
|
|
171
248
|
class Queue {
|
|
172
249
|
i = null;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
created =
|
|
250
|
+
re = [[], []];
|
|
251
|
+
ie = [];
|
|
252
|
+
created = E;
|
|
176
253
|
addChild(e) {
|
|
177
|
-
this.
|
|
254
|
+
this.ie.push(e);
|
|
178
255
|
e.i = this;
|
|
179
256
|
}
|
|
180
257
|
removeChild(e) {
|
|
181
|
-
const t = this.
|
|
258
|
+
const t = this.ie.indexOf(e);
|
|
182
259
|
if (t >= 0) {
|
|
183
|
-
this.
|
|
260
|
+
this.ie.splice(t, 1);
|
|
184
261
|
e.i = null;
|
|
185
262
|
}
|
|
186
263
|
}
|
|
@@ -189,107 +266,123 @@ class Queue {
|
|
|
189
266
|
return false;
|
|
190
267
|
}
|
|
191
268
|
run(e) {
|
|
192
|
-
if (this.
|
|
193
|
-
const t = this.
|
|
194
|
-
this.
|
|
269
|
+
if (this.re[e - 1].length) {
|
|
270
|
+
const t = this.re[e - 1];
|
|
271
|
+
this.re[e - 1] = [];
|
|
195
272
|
runQueue(t, e);
|
|
196
273
|
}
|
|
197
|
-
for (let t = 0; t < this.
|
|
274
|
+
for (let t = 0; t < this.ie.length; t++) this.ie[t].run?.(e);
|
|
198
275
|
}
|
|
199
276
|
enqueue(e, t) {
|
|
200
277
|
if (e) {
|
|
201
|
-
if (
|
|
202
|
-
const n = findLane(
|
|
278
|
+
if (F) {
|
|
279
|
+
const n = findLane(F);
|
|
203
280
|
n.q[e - 1].push(t);
|
|
204
281
|
} else {
|
|
205
|
-
this.
|
|
282
|
+
this.re[e - 1].push(t);
|
|
206
283
|
}
|
|
207
284
|
}
|
|
208
285
|
schedule();
|
|
209
286
|
}
|
|
210
287
|
stashQueues(e) {
|
|
211
|
-
e.
|
|
212
|
-
e.
|
|
213
|
-
this.
|
|
214
|
-
for (let t = 0; t < this.
|
|
215
|
-
let n = this.
|
|
216
|
-
let r = e.
|
|
288
|
+
e.re[0].push(...this.re[0]);
|
|
289
|
+
e.re[1].push(...this.re[1]);
|
|
290
|
+
this.re = [[], []];
|
|
291
|
+
for (let t = 0; t < this.ie.length; t++) {
|
|
292
|
+
let n = this.ie[t];
|
|
293
|
+
let r = e.ie[t];
|
|
217
294
|
if (!r) {
|
|
218
|
-
r = {
|
|
219
|
-
e.
|
|
295
|
+
r = { re: [[], []], ie: [] };
|
|
296
|
+
e.ie[t] = r;
|
|
220
297
|
}
|
|
221
298
|
n.stashQueues(r);
|
|
222
299
|
}
|
|
223
300
|
}
|
|
224
301
|
restoreQueues(e) {
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
227
|
-
for (let t = 0; t < e.
|
|
228
|
-
const n = e.
|
|
229
|
-
let r = this.
|
|
302
|
+
this.re[0].push(...e.re[0]);
|
|
303
|
+
this.re[1].push(...e.re[1]);
|
|
304
|
+
for (let t = 0; t < e.ie.length; t++) {
|
|
305
|
+
const n = e.ie[t];
|
|
306
|
+
let r = this.ie[t];
|
|
230
307
|
if (r) r.restoreQueues(n);
|
|
231
308
|
}
|
|
232
309
|
}
|
|
233
310
|
}
|
|
234
311
|
class GlobalQueue extends Queue {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
static
|
|
240
|
-
static
|
|
241
|
-
static
|
|
312
|
+
ne = false;
|
|
313
|
+
se = [];
|
|
314
|
+
U = [];
|
|
315
|
+
J = new Set();
|
|
316
|
+
static oe;
|
|
317
|
+
static ue;
|
|
318
|
+
static fe = null;
|
|
242
319
|
flush() {
|
|
243
|
-
if (this.
|
|
244
|
-
this.
|
|
320
|
+
if (this.ne) return;
|
|
321
|
+
this.ne = true;
|
|
245
322
|
try {
|
|
246
|
-
runHeap(P, GlobalQueue.
|
|
247
|
-
if (
|
|
248
|
-
const e = transitionComplete(
|
|
323
|
+
runHeap(P, GlobalQueue.oe);
|
|
324
|
+
if (k) {
|
|
325
|
+
const e = transitionComplete(k);
|
|
249
326
|
if (!e) {
|
|
250
|
-
|
|
251
|
-
runHeap(v, GlobalQueue.
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
this.
|
|
327
|
+
const e = k;
|
|
328
|
+
runHeap(v, GlobalQueue.oe);
|
|
329
|
+
this.se = [];
|
|
330
|
+
this.U = [];
|
|
331
|
+
this.J = new Set();
|
|
255
332
|
runLaneEffects(h);
|
|
256
|
-
runLaneEffects(
|
|
257
|
-
this.stashQueues(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
reassignPendingTransition(
|
|
261
|
-
|
|
262
|
-
|
|
333
|
+
runLaneEffects(g);
|
|
334
|
+
this.stashQueues(e.ce);
|
|
335
|
+
E++;
|
|
336
|
+
C = P.S >= P.A;
|
|
337
|
+
reassignPendingTransition(e.se);
|
|
338
|
+
k = null;
|
|
339
|
+
if (!e.G.length && e.U.length) {
|
|
340
|
+
A = new Set();
|
|
341
|
+
for (let t = 0; t < e.U.length; t++) {
|
|
342
|
+
const n = e.U[t];
|
|
343
|
+
if (n.T || n.le) continue;
|
|
344
|
+
A.add(n);
|
|
345
|
+
queueStashedOptimisticEffects(n);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
try {
|
|
349
|
+
finalizePureQueue(null, true);
|
|
350
|
+
} finally {
|
|
351
|
+
A = null;
|
|
352
|
+
}
|
|
263
353
|
return;
|
|
264
354
|
}
|
|
265
|
-
this.
|
|
266
|
-
this.restoreQueues(
|
|
267
|
-
x.delete(
|
|
268
|
-
const t =
|
|
269
|
-
|
|
270
|
-
reassignPendingTransition(this.
|
|
355
|
+
this.se !== k.se && this.se.push(...k.se);
|
|
356
|
+
this.restoreQueues(k.ce);
|
|
357
|
+
x.delete(k);
|
|
358
|
+
const t = k;
|
|
359
|
+
k = null;
|
|
360
|
+
reassignPendingTransition(this.se);
|
|
271
361
|
finalizePureQueue(t);
|
|
272
362
|
} else {
|
|
273
|
-
if (x.size) runHeap(v, GlobalQueue.
|
|
363
|
+
if (x.size) runHeap(v, GlobalQueue.oe);
|
|
274
364
|
finalizePureQueue();
|
|
275
365
|
}
|
|
276
|
-
|
|
277
|
-
|
|
366
|
+
E++;
|
|
367
|
+
C = P.S >= P.A;
|
|
278
368
|
runLaneEffects(h);
|
|
279
369
|
this.run(h);
|
|
280
|
-
runLaneEffects(
|
|
281
|
-
this.run(
|
|
370
|
+
runLaneEffects(g);
|
|
371
|
+
this.run(g);
|
|
282
372
|
} finally {
|
|
283
|
-
this.
|
|
373
|
+
this.ne = false;
|
|
284
374
|
}
|
|
285
375
|
}
|
|
286
376
|
notify(e, t, n, r) {
|
|
287
377
|
if (t & a) {
|
|
288
378
|
if (n & a) {
|
|
289
|
-
const t = r !== undefined ? r : e.
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
|
|
379
|
+
const t = r !== undefined ? r : e.ae;
|
|
380
|
+
if (k && t) {
|
|
381
|
+
const e = t.source;
|
|
382
|
+
if (!k.X.includes(e)) {
|
|
383
|
+
k.X.push(e);
|
|
384
|
+
schedule();
|
|
385
|
+
}
|
|
293
386
|
}
|
|
294
387
|
}
|
|
295
388
|
return true;
|
|
@@ -298,60 +391,58 @@ class GlobalQueue extends Queue {
|
|
|
298
391
|
}
|
|
299
392
|
initTransition(e) {
|
|
300
393
|
if (e) e = currentTransition(e);
|
|
301
|
-
if (e && e ===
|
|
302
|
-
if (!e &&
|
|
303
|
-
if (!
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
394
|
+
if (e && e === k) return;
|
|
395
|
+
if (!e && k && k.de === E) return;
|
|
396
|
+
if (!k) {
|
|
397
|
+
k = e ?? {
|
|
398
|
+
de: E,
|
|
399
|
+
se: [],
|
|
400
|
+
X: [],
|
|
401
|
+
U: [],
|
|
402
|
+
J: new Set(),
|
|
403
|
+
G: [],
|
|
404
|
+
ce: { re: [[], []], ie: [] },
|
|
405
|
+
M: false
|
|
313
406
|
};
|
|
314
407
|
} else if (e) {
|
|
315
|
-
const t =
|
|
316
|
-
t
|
|
317
|
-
e.ee.push(...t.ee);
|
|
318
|
-
for (const n of N) {
|
|
319
|
-
if (n.ne === t) n.ne = e;
|
|
320
|
-
}
|
|
321
|
-
e.B.push(...t.B);
|
|
322
|
-
for (const n of t.G) {
|
|
323
|
-
e.G.add(n);
|
|
324
|
-
}
|
|
408
|
+
const t = k;
|
|
409
|
+
mergeTransitionState(e, t);
|
|
325
410
|
x.delete(t);
|
|
326
|
-
|
|
411
|
+
k = e;
|
|
412
|
+
}
|
|
413
|
+
x.add(k);
|
|
414
|
+
k.de = E;
|
|
415
|
+
if (this.se !== k.se) {
|
|
416
|
+
for (let e = 0; e < this.se.length; e++) {
|
|
417
|
+
const t = this.se[e];
|
|
418
|
+
t.K = k;
|
|
419
|
+
k.se.push(t);
|
|
420
|
+
}
|
|
421
|
+
this.se = k.se;
|
|
327
422
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
423
|
+
if (this.U !== k.U) {
|
|
424
|
+
for (let e = 0; e < this.U.length; e++) {
|
|
425
|
+
const t = this.U[e];
|
|
426
|
+
t.K = k;
|
|
427
|
+
k.U.push(t);
|
|
428
|
+
}
|
|
429
|
+
this.U = k.U;
|
|
334
430
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const t = this.B[e];
|
|
338
|
-
t.ne = C;
|
|
339
|
-
C.B.push(t);
|
|
431
|
+
for (const e of L) {
|
|
432
|
+
if (!e.K) e.K = k;
|
|
340
433
|
}
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
434
|
+
if (this.J !== k.J) {
|
|
435
|
+
for (const e of this.J) k.J.add(e);
|
|
436
|
+
this.J = k.J;
|
|
344
437
|
}
|
|
345
|
-
for (const e of this.G) C.G.add(e);
|
|
346
|
-
this.G = C.G;
|
|
347
438
|
}
|
|
348
439
|
}
|
|
349
440
|
function insertSubs(e, t = false) {
|
|
350
|
-
const n = e.
|
|
351
|
-
const r = e.
|
|
441
|
+
const n = e.Y || F;
|
|
442
|
+
const r = e.pe !== undefined;
|
|
352
443
|
for (let i = e.O; i !== null; i = i.P) {
|
|
353
|
-
if (r && i.k.
|
|
354
|
-
i.k.m |=
|
|
444
|
+
if (r && i.k.he) {
|
|
445
|
+
i.k.m |= c;
|
|
355
446
|
continue;
|
|
356
447
|
}
|
|
357
448
|
if (t && n) {
|
|
@@ -359,13 +450,13 @@ function insertSubs(e, t = false) {
|
|
|
359
450
|
assignOrMergeLane(i.k, n);
|
|
360
451
|
} else if (t) {
|
|
361
452
|
i.k.m |= f;
|
|
362
|
-
i.k.
|
|
453
|
+
i.k.Y = undefined;
|
|
363
454
|
}
|
|
364
455
|
const e = i.k;
|
|
365
|
-
if (e.
|
|
366
|
-
if (!e.
|
|
367
|
-
e.
|
|
368
|
-
e.
|
|
456
|
+
if (e.D === y) {
|
|
457
|
+
if (!e.V) {
|
|
458
|
+
e.V = true;
|
|
459
|
+
e.B.enqueue(g, e.F);
|
|
369
460
|
}
|
|
370
461
|
continue;
|
|
371
462
|
}
|
|
@@ -375,137 +466,105 @@ function insertSubs(e, t = false) {
|
|
|
375
466
|
}
|
|
376
467
|
}
|
|
377
468
|
function commitPendingNodes() {
|
|
378
|
-
const e =
|
|
469
|
+
const e = N.se;
|
|
379
470
|
for (let t = 0; t < e.length; t++) {
|
|
380
471
|
const n = e[t];
|
|
381
|
-
if (n.
|
|
382
|
-
n
|
|
383
|
-
n.
|
|
384
|
-
if (n.
|
|
472
|
+
if (n.Z !== S) {
|
|
473
|
+
n.$ = n.Z;
|
|
474
|
+
n.Z = S;
|
|
475
|
+
if (n.D && n.D !== y) n.V = true;
|
|
385
476
|
}
|
|
386
|
-
if (n.
|
|
387
|
-
|
|
388
|
-
if (e && !(e.de & a)) {
|
|
389
|
-
n.de &= -6;
|
|
390
|
-
n.Y = null;
|
|
391
|
-
}
|
|
392
|
-
} else n.de &= ~p;
|
|
393
|
-
if (n.H) GlobalQueue.U(n, false, true);
|
|
477
|
+
if (!(n.ge & a)) n.ge &= ~p;
|
|
478
|
+
if (n.T) GlobalQueue.ue(n, false, true);
|
|
394
479
|
}
|
|
395
480
|
e.length = 0;
|
|
396
481
|
}
|
|
397
482
|
function finalizePureQueue(e = null, t = false) {
|
|
398
|
-
|
|
483
|
+
const n = !t;
|
|
399
484
|
if (n) commitPendingNodes();
|
|
400
|
-
if (!t) checkBoundaryChildren(
|
|
401
|
-
if (P.S >= P.A) runHeap(P, GlobalQueue.
|
|
485
|
+
if (!t) checkBoundaryChildren(N);
|
|
486
|
+
if (P.S >= P.A) runHeap(P, GlobalQueue.oe);
|
|
402
487
|
if (n) {
|
|
403
488
|
commitPendingNodes();
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
n.ae = n.ce;
|
|
410
|
-
n.ce = S;
|
|
411
|
-
}
|
|
412
|
-
const r = n.pe;
|
|
413
|
-
n.pe = S;
|
|
414
|
-
if (r !== S && n.ae !== r) insertSubs(n, true);
|
|
415
|
-
n.ne = null;
|
|
416
|
-
}
|
|
417
|
-
t.length = 0;
|
|
418
|
-
const n = e ? e.G : A.G;
|
|
419
|
-
if (GlobalQueue.J && n.size) {
|
|
420
|
-
for (const e of n) {
|
|
421
|
-
GlobalQueue.J(e);
|
|
422
|
-
}
|
|
423
|
-
n.clear();
|
|
424
|
-
schedule();
|
|
425
|
-
}
|
|
426
|
-
for (const t of N) {
|
|
427
|
-
const n = e ? t.ne === e : !t.ne;
|
|
428
|
-
if (!n) continue;
|
|
429
|
-
if (!t.R) {
|
|
430
|
-
if (t.q[0].length) runQueue(t.q[0], h);
|
|
431
|
-
if (t.q[1].length) runQueue(t.q[1], y);
|
|
489
|
+
resolveOptimisticNodes(e ? e.U : N.U);
|
|
490
|
+
const t = e ? e.J : N.J;
|
|
491
|
+
if (GlobalQueue.fe && t.size) {
|
|
492
|
+
for (const e of t) {
|
|
493
|
+
GlobalQueue.fe(e);
|
|
432
494
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
t.q[0].length = 0;
|
|
436
|
-
t.q[1].length = 0;
|
|
437
|
-
N.delete(t);
|
|
438
|
-
W.delete(t.he);
|
|
495
|
+
t.clear();
|
|
496
|
+
schedule();
|
|
439
497
|
}
|
|
498
|
+
cleanupCompletedLanes(e);
|
|
440
499
|
}
|
|
441
500
|
}
|
|
442
501
|
function checkBoundaryChildren(e) {
|
|
443
|
-
for (const t of e.
|
|
502
|
+
for (const t of e.ie) {
|
|
444
503
|
t.checkSources?.();
|
|
445
504
|
checkBoundaryChildren(t);
|
|
446
505
|
}
|
|
447
506
|
}
|
|
448
507
|
function trackOptimisticStore(e) {
|
|
449
|
-
|
|
508
|
+
N.J.add(e);
|
|
450
509
|
schedule();
|
|
451
510
|
}
|
|
452
511
|
function reassignPendingTransition(e) {
|
|
453
512
|
for (let t = 0; t < e.length; t++) {
|
|
454
|
-
e[t].
|
|
513
|
+
e[t].K = k;
|
|
455
514
|
}
|
|
456
515
|
}
|
|
457
|
-
const
|
|
516
|
+
const N = new GlobalQueue();
|
|
458
517
|
function flush() {
|
|
459
|
-
while (
|
|
460
|
-
|
|
518
|
+
while (C || k) {
|
|
519
|
+
N.flush();
|
|
461
520
|
}
|
|
462
521
|
}
|
|
463
522
|
function runQueue(e, t) {
|
|
464
523
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
465
524
|
}
|
|
466
525
|
function transitionComplete(e) {
|
|
467
|
-
if (e.
|
|
468
|
-
if (e.
|
|
526
|
+
if (e.M) return true;
|
|
527
|
+
if (e.G.length) return false;
|
|
469
528
|
let t = true;
|
|
470
|
-
for (let n = 0; n < e.
|
|
471
|
-
const r = e.
|
|
472
|
-
if (r.
|
|
529
|
+
for (let n = 0; n < e.X.length; n++) {
|
|
530
|
+
const r = e.X[n];
|
|
531
|
+
if (r.ge & a && r.ae?.source === r) {
|
|
473
532
|
t = false;
|
|
474
533
|
break;
|
|
475
534
|
}
|
|
476
535
|
}
|
|
477
|
-
t && (e.
|
|
536
|
+
t && (e.M = true);
|
|
478
537
|
return t;
|
|
479
538
|
}
|
|
480
539
|
function currentTransition(e) {
|
|
481
|
-
while (e.
|
|
540
|
+
while (e.M && typeof e.M === "object") e = e.M;
|
|
482
541
|
return e;
|
|
483
542
|
}
|
|
484
543
|
function setActiveTransition(e) {
|
|
485
|
-
|
|
544
|
+
k = e;
|
|
486
545
|
}
|
|
487
546
|
function runInTransition(e, t) {
|
|
488
|
-
const n =
|
|
547
|
+
const n = k;
|
|
489
548
|
try {
|
|
490
|
-
|
|
549
|
+
k = currentTransition(e);
|
|
491
550
|
return t();
|
|
492
551
|
} finally {
|
|
493
|
-
|
|
552
|
+
k = n;
|
|
494
553
|
}
|
|
495
554
|
}
|
|
496
555
|
const W = new WeakMap();
|
|
497
|
-
const
|
|
556
|
+
const L = new Set();
|
|
498
557
|
function getOrCreateLane(e) {
|
|
499
558
|
let t = W.get(e);
|
|
500
559
|
if (t) {
|
|
501
560
|
return findLane(t);
|
|
502
561
|
}
|
|
503
562
|
const n = e.ye;
|
|
504
|
-
const r = n?.
|
|
505
|
-
t = {
|
|
563
|
+
const r = n?.Y ? findLane(n.Y) : null;
|
|
564
|
+
t = { te: e, H: new Set(), q: [[], []], R: null, K: k, Se: r };
|
|
506
565
|
W.set(e, t);
|
|
507
|
-
|
|
508
|
-
e.
|
|
566
|
+
L.add(t);
|
|
567
|
+
e.we = false;
|
|
509
568
|
return t;
|
|
510
569
|
}
|
|
511
570
|
function findLane(e) {
|
|
@@ -517,88 +576,182 @@ function mergeLanes(e, t) {
|
|
|
517
576
|
t = findLane(t);
|
|
518
577
|
if (e === t) return e;
|
|
519
578
|
t.R = e;
|
|
520
|
-
for (const n of t.
|
|
579
|
+
for (const n of t.H) e.H.add(n);
|
|
521
580
|
e.q[0].push(...t.q[0]);
|
|
522
581
|
e.q[1].push(...t.q[1]);
|
|
523
582
|
return e;
|
|
524
583
|
}
|
|
525
584
|
function resolveLane(e) {
|
|
526
|
-
const t = e.
|
|
585
|
+
const t = e.Y;
|
|
527
586
|
if (!t) return undefined;
|
|
528
587
|
const n = findLane(t);
|
|
529
|
-
if (
|
|
530
|
-
e.
|
|
588
|
+
if (L.has(n)) return n;
|
|
589
|
+
e.Y = undefined;
|
|
531
590
|
return undefined;
|
|
532
591
|
}
|
|
592
|
+
function resolveTransition(e) {
|
|
593
|
+
return resolveLane(e)?.K ?? e.K;
|
|
594
|
+
}
|
|
533
595
|
function hasActiveOverride(e) {
|
|
534
|
-
return !!(e.
|
|
596
|
+
return !!(e.ee !== undefined && e.ee !== S);
|
|
535
597
|
}
|
|
536
598
|
function assignOrMergeLane(e, t) {
|
|
537
599
|
const n = findLane(t);
|
|
538
|
-
const r = e.
|
|
600
|
+
const r = e.Y;
|
|
539
601
|
if (r) {
|
|
540
602
|
if (r.R) {
|
|
541
|
-
e.
|
|
603
|
+
e.Y = t;
|
|
542
604
|
return;
|
|
543
605
|
}
|
|
544
606
|
const i = findLane(r);
|
|
545
|
-
if (
|
|
607
|
+
if (L.has(i)) {
|
|
546
608
|
if (i !== n && !hasActiveOverride(e)) {
|
|
547
|
-
if (n.
|
|
548
|
-
e.
|
|
549
|
-
} else if (i.
|
|
609
|
+
if (n.Se && findLane(n.Se) === i) {
|
|
610
|
+
e.Y = t;
|
|
611
|
+
} else if (i.Se && findLane(i.Se) === n);
|
|
550
612
|
else mergeLanes(n, i);
|
|
551
613
|
}
|
|
552
614
|
return;
|
|
553
615
|
}
|
|
554
616
|
}
|
|
555
|
-
e.
|
|
617
|
+
e.Y = t;
|
|
618
|
+
}
|
|
619
|
+
function addPendingSource(e, t) {
|
|
620
|
+
if (e.me === t || e.be?.has(t)) return false;
|
|
621
|
+
if (!e.me) {
|
|
622
|
+
e.me = t;
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
if (!e.be) {
|
|
626
|
+
e.be = new Set([e.me, t]);
|
|
627
|
+
} else {
|
|
628
|
+
e.be.add(t);
|
|
629
|
+
}
|
|
630
|
+
e.me = undefined;
|
|
631
|
+
return true;
|
|
632
|
+
}
|
|
633
|
+
function removePendingSource(e, t) {
|
|
634
|
+
if (e.me) {
|
|
635
|
+
if (e.me !== t) return false;
|
|
636
|
+
e.me = undefined;
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
if (!e.be?.delete(t)) return false;
|
|
640
|
+
if (e.be.size === 1) {
|
|
641
|
+
e.me = e.be.values().next().value;
|
|
642
|
+
e.be = undefined;
|
|
643
|
+
} else if (e.be.size === 0) {
|
|
644
|
+
e.be = undefined;
|
|
645
|
+
}
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
648
|
+
function clearPendingSources(e) {
|
|
649
|
+
e.me = undefined;
|
|
650
|
+
e.be?.clear();
|
|
651
|
+
e.be = undefined;
|
|
652
|
+
}
|
|
653
|
+
function setPendingError(e, t, n) {
|
|
654
|
+
if (!t) {
|
|
655
|
+
e.ae = null;
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (n instanceof NotReadyError && n.source === t) {
|
|
659
|
+
e.ae = n;
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
const r = e.ae;
|
|
663
|
+
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
664
|
+
e.ae = new NotReadyError(t);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function forEachDependent(e, t) {
|
|
668
|
+
for (let n = e.O; n !== null; n = n.P) t(n.k);
|
|
669
|
+
for (let n = e.C; n !== null; n = n.j) {
|
|
670
|
+
for (let e = n.O; e !== null; e = e.P) t(e.k);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
function settlePendingSource(e) {
|
|
674
|
+
let t = false;
|
|
675
|
+
const n = new Set();
|
|
676
|
+
const settle = r => {
|
|
677
|
+
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
678
|
+
n.add(r);
|
|
679
|
+
r.de = E;
|
|
680
|
+
const i = r.me ?? r.be?.values().next().value;
|
|
681
|
+
if (i) {
|
|
682
|
+
setPendingError(r, i);
|
|
683
|
+
updatePendingSignal(r);
|
|
684
|
+
} else {
|
|
685
|
+
r.ge &= ~a;
|
|
686
|
+
setPendingError(r);
|
|
687
|
+
updatePendingSignal(r);
|
|
688
|
+
if (r._e) {
|
|
689
|
+
if (r.D === y) {
|
|
690
|
+
const e = r;
|
|
691
|
+
if (!e.V) {
|
|
692
|
+
e.V = true;
|
|
693
|
+
e.B.enqueue(g, e.F);
|
|
694
|
+
}
|
|
695
|
+
} else {
|
|
696
|
+
const e = r.m & o ? v : P;
|
|
697
|
+
if (e.A > r.o) e.A = r.o;
|
|
698
|
+
insertIntoHeap(r, e);
|
|
699
|
+
}
|
|
700
|
+
t = true;
|
|
701
|
+
}
|
|
702
|
+
r._e = false;
|
|
703
|
+
}
|
|
704
|
+
forEachDependent(r, settle);
|
|
705
|
+
};
|
|
706
|
+
forEachDependent(e, settle);
|
|
707
|
+
if (t) schedule();
|
|
556
708
|
}
|
|
557
709
|
function handleAsync(e, t, r) {
|
|
558
710
|
const i = typeof t === "object" && t !== null;
|
|
559
711
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
560
712
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
561
713
|
if (!o && !s) {
|
|
562
|
-
e.
|
|
714
|
+
e.Oe = null;
|
|
563
715
|
return t;
|
|
564
716
|
}
|
|
565
|
-
e.
|
|
717
|
+
e.Oe = t;
|
|
566
718
|
let u;
|
|
567
719
|
const handleError = n => {
|
|
568
|
-
if (e.
|
|
569
|
-
|
|
720
|
+
if (e.Oe !== t) return;
|
|
721
|
+
N.initTransition(resolveTransition(e));
|
|
570
722
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
571
|
-
e
|
|
723
|
+
e.de = E;
|
|
572
724
|
};
|
|
573
725
|
const asyncWrite = (i, s) => {
|
|
574
|
-
if (e.
|
|
726
|
+
if (e.Oe !== t) return;
|
|
575
727
|
if (e.m & (n | f)) return;
|
|
576
|
-
|
|
728
|
+
N.initTransition(resolveTransition(e));
|
|
577
729
|
clearStatus(e);
|
|
578
730
|
const o = resolveLane(e);
|
|
579
|
-
if (o) o.
|
|
731
|
+
if (o) o.H.delete(e);
|
|
580
732
|
if (r) r(i);
|
|
581
|
-
else if (e.
|
|
582
|
-
if (e.
|
|
733
|
+
else if (e.ee !== undefined) {
|
|
734
|
+
if (e.ee !== undefined && e.ee !== S) e.Z = i;
|
|
583
735
|
else {
|
|
584
|
-
e
|
|
736
|
+
e.$ = i;
|
|
585
737
|
insertSubs(e);
|
|
586
738
|
}
|
|
587
|
-
e
|
|
739
|
+
e.de = E;
|
|
588
740
|
} else if (o) {
|
|
589
|
-
const t = e
|
|
590
|
-
const n = e.
|
|
741
|
+
const t = e.$;
|
|
742
|
+
const n = e.xe;
|
|
591
743
|
if (!n || !n(i, t)) {
|
|
592
|
-
e
|
|
593
|
-
e
|
|
594
|
-
if (e.
|
|
595
|
-
setSignal(e.
|
|
744
|
+
e.$ = i;
|
|
745
|
+
e.de = E;
|
|
746
|
+
if (e.Pe) {
|
|
747
|
+
setSignal(e.Pe, i);
|
|
596
748
|
}
|
|
597
749
|
insertSubs(e, true);
|
|
598
750
|
}
|
|
599
751
|
} else {
|
|
600
752
|
setSignal(e, () => i);
|
|
601
753
|
}
|
|
754
|
+
settlePendingSource(e);
|
|
602
755
|
schedule();
|
|
603
756
|
flush();
|
|
604
757
|
s?.();
|
|
@@ -619,8 +772,8 @@ function handleAsync(e, t, r) {
|
|
|
619
772
|
);
|
|
620
773
|
r = false;
|
|
621
774
|
if (!n) {
|
|
622
|
-
|
|
623
|
-
throw new NotReadyError(
|
|
775
|
+
N.initTransition(resolveTransition(e));
|
|
776
|
+
throw new NotReadyError(B);
|
|
624
777
|
}
|
|
625
778
|
}
|
|
626
779
|
if (s) {
|
|
@@ -655,126 +808,92 @@ function handleAsync(e, t, r) {
|
|
|
655
808
|
};
|
|
656
809
|
const i = iterate();
|
|
657
810
|
if (!r && !i) {
|
|
658
|
-
|
|
659
|
-
throw new NotReadyError(
|
|
811
|
+
N.initTransition(resolveTransition(e));
|
|
812
|
+
throw new NotReadyError(B);
|
|
660
813
|
}
|
|
661
814
|
}
|
|
662
815
|
return u;
|
|
663
816
|
}
|
|
664
|
-
function clearStatus(e) {
|
|
665
|
-
e
|
|
666
|
-
e
|
|
817
|
+
function clearStatus(e, t = false) {
|
|
818
|
+
clearPendingSources(e);
|
|
819
|
+
removeTransitionBlocker(e);
|
|
820
|
+
e._e = false;
|
|
821
|
+
e.ge = t ? 0 : e.ge & p;
|
|
822
|
+
setPendingError(e);
|
|
667
823
|
updatePendingSignal(e);
|
|
668
|
-
e.
|
|
824
|
+
e.ve?.();
|
|
669
825
|
}
|
|
670
826
|
function notifyStatus(e, t, n, r, i) {
|
|
671
827
|
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
672
828
|
n = new StatusError(e, n);
|
|
673
|
-
const s = n instanceof NotReadyError
|
|
674
|
-
const o =
|
|
675
|
-
const u =
|
|
829
|
+
const s = t === a && n instanceof NotReadyError ? n.source : undefined;
|
|
830
|
+
const o = s === e;
|
|
831
|
+
const u = t === a && e.ee !== undefined && !o;
|
|
832
|
+
const f = u && hasActiveOverride(e);
|
|
676
833
|
if (!r) {
|
|
677
|
-
|
|
678
|
-
|
|
834
|
+
if (t === a && s) {
|
|
835
|
+
addPendingSource(e, s);
|
|
836
|
+
e.ge = a | (e.ge & p);
|
|
837
|
+
setPendingError(e, e.me ?? e.be?.values().next().value, n);
|
|
838
|
+
if (s === e) addTransitionBlocker(e);
|
|
839
|
+
} else {
|
|
840
|
+
clearPendingSources(e);
|
|
841
|
+
removeTransitionBlocker(e);
|
|
842
|
+
e.ge = t | (t !== d ? e.ge & p : 0);
|
|
843
|
+
e.ae = n;
|
|
844
|
+
}
|
|
679
845
|
updatePendingSignal(e);
|
|
680
846
|
}
|
|
681
847
|
if (i && !r) {
|
|
682
848
|
assignOrMergeLane(e, i);
|
|
683
849
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
const f = r || u;
|
|
691
|
-
const l = r || o ? undefined : i;
|
|
692
|
-
if (e._e) {
|
|
693
|
-
if (f) {
|
|
694
|
-
e._e(t, n);
|
|
850
|
+
const c = r || f;
|
|
851
|
+
const l = r || u ? undefined : i;
|
|
852
|
+
if (e.ve) {
|
|
853
|
+
if (c) {
|
|
854
|
+
e.ve(t, n);
|
|
695
855
|
} else {
|
|
696
|
-
e.
|
|
856
|
+
e.ve();
|
|
697
857
|
}
|
|
698
858
|
return;
|
|
699
859
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
for (let e = r.O; e !== null; e = e.P) {
|
|
709
|
-
e.k.$ = k;
|
|
710
|
-
if (e.k.Y !== n) {
|
|
711
|
-
!e.k.ne && A.D.push(e.k);
|
|
712
|
-
notifyStatus(e.k, t, n, f, l);
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
function unlinkSubs(e) {
|
|
718
|
-
const t = e.L;
|
|
719
|
-
const n = e.N;
|
|
720
|
-
const r = e.P;
|
|
721
|
-
const i = e.Oe;
|
|
722
|
-
if (r !== null) r.Oe = i;
|
|
723
|
-
else t.xe = i;
|
|
724
|
-
if (i !== null) i.P = r;
|
|
725
|
-
else {
|
|
726
|
-
t.O = r;
|
|
727
|
-
if (r === null) {
|
|
728
|
-
t.Pe?.();
|
|
729
|
-
t.H && !t.ve && !(t.m & o) && unobserved(t);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
return n;
|
|
733
|
-
}
|
|
734
|
-
function unobserved(e) {
|
|
735
|
-
deleteFromHeap(e, e.m & o ? v : P);
|
|
736
|
-
let t = e.W;
|
|
737
|
-
while (t !== null) {
|
|
738
|
-
t = unlinkSubs(t);
|
|
739
|
-
}
|
|
740
|
-
e.W = null;
|
|
741
|
-
disposeChildren(e, true);
|
|
742
|
-
}
|
|
743
|
-
function link(e, t) {
|
|
744
|
-
const n = t.ke;
|
|
745
|
-
if (n !== null && n.L === e) return;
|
|
746
|
-
let i = null;
|
|
747
|
-
const s = t.m & r;
|
|
748
|
-
if (s) {
|
|
749
|
-
i = n !== null ? n.N : t.W;
|
|
750
|
-
if (i !== null && i.L === e) {
|
|
751
|
-
t.ke = i;
|
|
752
|
-
return;
|
|
860
|
+
forEachDependent(e, e => {
|
|
861
|
+
e.de = E;
|
|
862
|
+
if (
|
|
863
|
+
(t === a && s && e.me !== s && !e.be?.has(s)) ||
|
|
864
|
+
(t !== a && (e.ae !== n || e.me || e.be))
|
|
865
|
+
) {
|
|
866
|
+
!e.K && N.se.push(e);
|
|
867
|
+
notifyStatus(e, t, n, c, l);
|
|
753
868
|
}
|
|
754
|
-
}
|
|
755
|
-
const o = e.xe;
|
|
756
|
-
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
757
|
-
const u = (t.ke = e.xe = { L: e, k: t, N: i, Oe: o, P: null });
|
|
758
|
-
if (n !== null) n.N = u;
|
|
759
|
-
else t.W = u;
|
|
760
|
-
if (o !== null) o.P = u;
|
|
761
|
-
else e.O = u;
|
|
869
|
+
});
|
|
762
870
|
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
871
|
+
let I = null;
|
|
872
|
+
function enableExternalSource(e) {
|
|
873
|
+
const { factory: t, untrack: n = e => e() } = e;
|
|
874
|
+
if (I) {
|
|
875
|
+
const { factory: e, untrack: r } = I;
|
|
876
|
+
I = {
|
|
877
|
+
factory: (n, r) => {
|
|
878
|
+
const i = e(n, r);
|
|
879
|
+
const s = t(e => i.track(e), r);
|
|
880
|
+
return {
|
|
881
|
+
track: e => s.track(e),
|
|
882
|
+
dispose() {
|
|
883
|
+
s.dispose();
|
|
884
|
+
i.dispose();
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
},
|
|
888
|
+
untrack: e => r(() => n(e))
|
|
889
|
+
};
|
|
890
|
+
} else {
|
|
891
|
+
I = { factory: t, untrack: n };
|
|
772
892
|
}
|
|
773
|
-
return false;
|
|
774
893
|
}
|
|
775
|
-
const
|
|
894
|
+
const T = {};
|
|
776
895
|
function markDisposal(e) {
|
|
777
|
-
let t = e.
|
|
896
|
+
let t = e.Ee;
|
|
778
897
|
while (t) {
|
|
779
898
|
t.m |= o;
|
|
780
899
|
if (t.m & i) {
|
|
@@ -782,33 +901,33 @@ function markDisposal(e) {
|
|
|
782
901
|
insertIntoHeap(t, v);
|
|
783
902
|
}
|
|
784
903
|
markDisposal(t);
|
|
785
|
-
t = t.
|
|
904
|
+
t = t.ke;
|
|
786
905
|
}
|
|
787
906
|
}
|
|
788
907
|
function dispose(e) {
|
|
789
|
-
let t = e.
|
|
908
|
+
let t = e.N || null;
|
|
790
909
|
do {
|
|
791
910
|
t = unlinkSubs(t);
|
|
792
911
|
} while (t !== null);
|
|
793
|
-
e.
|
|
794
|
-
e.
|
|
912
|
+
e.N = null;
|
|
913
|
+
e.Ce = null;
|
|
795
914
|
disposeChildren(e, true);
|
|
796
915
|
}
|
|
797
916
|
function disposeChildren(e, t = false, n) {
|
|
798
917
|
if (e.m & u) return;
|
|
799
918
|
if (t) e.m = u;
|
|
800
|
-
let r = n ? e.je : e.
|
|
919
|
+
let r = n ? e.je : e.Ee;
|
|
801
920
|
while (r) {
|
|
802
|
-
const e = r.
|
|
803
|
-
if (r.
|
|
921
|
+
const e = r.ke;
|
|
922
|
+
if (r.N) {
|
|
804
923
|
const e = r;
|
|
805
924
|
deleteFromHeap(e, e.m & o ? v : P);
|
|
806
|
-
let t = e.
|
|
925
|
+
let t = e.N;
|
|
807
926
|
do {
|
|
808
927
|
t = unlinkSubs(t);
|
|
809
928
|
} while (t !== null);
|
|
810
|
-
e.
|
|
811
|
-
e.
|
|
929
|
+
e.N = null;
|
|
930
|
+
e.Ce = null;
|
|
812
931
|
}
|
|
813
932
|
disposeChildren(r, true);
|
|
814
933
|
r = e;
|
|
@@ -816,13 +935,13 @@ function disposeChildren(e, t = false, n) {
|
|
|
816
935
|
if (n) {
|
|
817
936
|
e.je = null;
|
|
818
937
|
} else {
|
|
819
|
-
e.
|
|
938
|
+
e.Ee = null;
|
|
820
939
|
e.Ae = 0;
|
|
821
940
|
}
|
|
822
941
|
runDisposal(e, n);
|
|
823
942
|
}
|
|
824
943
|
function runDisposal(e, t) {
|
|
825
|
-
let n = t ? e.
|
|
944
|
+
let n = t ? e.Ne : e.We;
|
|
826
945
|
if (!n) return;
|
|
827
946
|
if (Array.isArray(n)) {
|
|
828
947
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -832,7 +951,7 @@ function runDisposal(e, t) {
|
|
|
832
951
|
} else {
|
|
833
952
|
n.call(n);
|
|
834
953
|
}
|
|
835
|
-
t ? (e.
|
|
954
|
+
t ? (e.Ne = null) : (e.We = null);
|
|
836
955
|
}
|
|
837
956
|
function childId(e, t) {
|
|
838
957
|
let n = e;
|
|
@@ -852,37 +971,39 @@ function formatId(e, t) {
|
|
|
852
971
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
853
972
|
}
|
|
854
973
|
function getObserver() {
|
|
855
|
-
if (
|
|
856
|
-
return
|
|
974
|
+
if (q || V) return T;
|
|
975
|
+
return R ? B : null;
|
|
857
976
|
}
|
|
858
977
|
function getOwner() {
|
|
859
|
-
return
|
|
978
|
+
return B;
|
|
860
979
|
}
|
|
861
980
|
function onCleanup(e) {
|
|
862
|
-
if (!
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
981
|
+
if (!B) {
|
|
982
|
+
return e;
|
|
983
|
+
}
|
|
984
|
+
if (!B.We) B.We = e;
|
|
985
|
+
else if (Array.isArray(B.We)) B.We.push(e);
|
|
986
|
+
else B.We = [B.We, e];
|
|
866
987
|
return e;
|
|
867
988
|
}
|
|
868
989
|
function isDisposed(e) {
|
|
869
990
|
return !!(e.m & (u | o));
|
|
870
991
|
}
|
|
871
992
|
function createOwner(e) {
|
|
872
|
-
const t =
|
|
993
|
+
const t = B;
|
|
873
994
|
const n = e?.transparent ?? false;
|
|
874
995
|
const r = {
|
|
875
996
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
876
997
|
Le: n || undefined,
|
|
877
998
|
t: true,
|
|
878
999
|
u: t?.t ? t.u : t,
|
|
879
|
-
Ce: null,
|
|
880
1000
|
Ee: null,
|
|
881
|
-
|
|
882
|
-
|
|
1001
|
+
ke: null,
|
|
1002
|
+
We: null,
|
|
1003
|
+
B: t?.B ?? N,
|
|
883
1004
|
Ie: t?.Ie || _,
|
|
884
1005
|
Ae: 0,
|
|
885
|
-
|
|
1006
|
+
Ne: null,
|
|
886
1007
|
je: null,
|
|
887
1008
|
i: t,
|
|
888
1009
|
dispose(e = true) {
|
|
@@ -890,12 +1011,12 @@ function createOwner(e) {
|
|
|
890
1011
|
}
|
|
891
1012
|
};
|
|
892
1013
|
if (t) {
|
|
893
|
-
const e = t.
|
|
1014
|
+
const e = t.Ee;
|
|
894
1015
|
if (e === null) {
|
|
895
|
-
t.
|
|
1016
|
+
t.Ee = r;
|
|
896
1017
|
} else {
|
|
897
|
-
r.
|
|
898
|
-
t.
|
|
1018
|
+
r.ke = e;
|
|
1019
|
+
t.Ee = r;
|
|
899
1020
|
}
|
|
900
1021
|
}
|
|
901
1022
|
return r;
|
|
@@ -904,125 +1025,76 @@ function createRoot(e, t) {
|
|
|
904
1025
|
const n = createOwner(t);
|
|
905
1026
|
return runWithOwner(n, () => e(n.dispose));
|
|
906
1027
|
}
|
|
907
|
-
function
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
o.Qe = n;
|
|
921
|
-
o.Te = undefined;
|
|
922
|
-
o.oe = i?.render ? h : y;
|
|
923
|
-
o._e = (e, t) => {
|
|
924
|
-
const n = e !== undefined ? e : o.de;
|
|
925
|
-
const r = t !== undefined ? t : o.Y;
|
|
926
|
-
if (n & d) {
|
|
927
|
-
let e = r;
|
|
928
|
-
o.fe.notify(o, a, 0);
|
|
929
|
-
if (o.oe === y) {
|
|
930
|
-
try {
|
|
931
|
-
return o.Qe
|
|
932
|
-
? o.Qe(e, () => {
|
|
933
|
-
o.Te?.();
|
|
934
|
-
o.Te = undefined;
|
|
935
|
-
})
|
|
936
|
-
: console.error(e);
|
|
937
|
-
} catch (t) {
|
|
938
|
-
e = t;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
if (!o.fe.notify(o, d, d)) throw e;
|
|
942
|
-
} else if (o.oe === h) {
|
|
943
|
-
o.fe.notify(o, a | d, n, r);
|
|
1028
|
+
function unlinkSubs(e) {
|
|
1029
|
+
const t = e.L;
|
|
1030
|
+
const n = e.W;
|
|
1031
|
+
const r = e.P;
|
|
1032
|
+
const i = e.Te;
|
|
1033
|
+
if (r !== null) r.Te = i;
|
|
1034
|
+
else t.Re = i;
|
|
1035
|
+
if (i !== null) i.P = r;
|
|
1036
|
+
else {
|
|
1037
|
+
t.O = r;
|
|
1038
|
+
if (r === null) {
|
|
1039
|
+
t.He?.();
|
|
1040
|
+
t.T && !t.Qe && !(t.m & o) && unobserved(t);
|
|
944
1041
|
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
!i?.defer && (o.oe === y ? o.fe.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
|
|
948
|
-
s = true;
|
|
949
|
-
onCleanup(() => o.Te?.());
|
|
1042
|
+
}
|
|
1043
|
+
return n;
|
|
950
1044
|
}
|
|
951
|
-
function
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
this.Te = this.Re(this.ae, this.He);
|
|
957
|
-
} catch (e) {
|
|
958
|
-
this.Y = new StatusError(this, e);
|
|
959
|
-
this.de |= d;
|
|
960
|
-
if (!this.fe.notify(this, d, d)) throw e;
|
|
961
|
-
} finally {
|
|
962
|
-
this.He = this.ae;
|
|
963
|
-
this.ue = false;
|
|
1045
|
+
function unobserved(e) {
|
|
1046
|
+
deleteFromHeap(e, e.m & o ? v : P);
|
|
1047
|
+
let t = e.N;
|
|
1048
|
+
while (t !== null) {
|
|
1049
|
+
t = unlinkSubs(t);
|
|
964
1050
|
}
|
|
1051
|
+
e.N = null;
|
|
1052
|
+
disposeChildren(e, true);
|
|
965
1053
|
}
|
|
966
|
-
function
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
()
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
);
|
|
984
|
-
|
|
985
|
-
n.ue = true;
|
|
986
|
-
n.oe = g;
|
|
987
|
-
n.le = run;
|
|
988
|
-
n.fe.enqueue(y, run);
|
|
989
|
-
onCleanup(() => n.Te?.());
|
|
1054
|
+
function link(e, t) {
|
|
1055
|
+
const n = t.Ce;
|
|
1056
|
+
if (n !== null && n.L === e) return;
|
|
1057
|
+
let i = null;
|
|
1058
|
+
const s = t.m & r;
|
|
1059
|
+
if (s) {
|
|
1060
|
+
i = n !== null ? n.W : t.N;
|
|
1061
|
+
if (i !== null && i.L === e) {
|
|
1062
|
+
t.Ce = i;
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
const o = e.Re;
|
|
1067
|
+
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
1068
|
+
const u = (t.Ce = e.Re = { L: e, k: t, W: i, Te: o, P: null });
|
|
1069
|
+
if (n !== null) n.W = u;
|
|
1070
|
+
else t.N = u;
|
|
1071
|
+
if (o !== null) o.P = u;
|
|
1072
|
+
else e.O = u;
|
|
990
1073
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
return {
|
|
1001
|
-
track: e => s.track(e),
|
|
1002
|
-
dispose() {
|
|
1003
|
-
s.dispose();
|
|
1004
|
-
i.dispose();
|
|
1005
|
-
}
|
|
1006
|
-
};
|
|
1007
|
-
},
|
|
1008
|
-
untrack: e => r(() => n(e))
|
|
1009
|
-
};
|
|
1010
|
-
} else {
|
|
1011
|
-
I = { factory: t, untrack: n };
|
|
1074
|
+
function isValidLink(e, t) {
|
|
1075
|
+
const n = t.Ce;
|
|
1076
|
+
if (n !== null) {
|
|
1077
|
+
let r = t.N;
|
|
1078
|
+
do {
|
|
1079
|
+
if (r === e) return true;
|
|
1080
|
+
if (r === n) break;
|
|
1081
|
+
r = r.W;
|
|
1082
|
+
} while (r !== null);
|
|
1012
1083
|
}
|
|
1084
|
+
return false;
|
|
1013
1085
|
}
|
|
1014
|
-
GlobalQueue.
|
|
1015
|
-
GlobalQueue.
|
|
1016
|
-
let H = false;
|
|
1086
|
+
GlobalQueue.oe = recompute;
|
|
1087
|
+
GlobalQueue.ue = disposeChildren;
|
|
1017
1088
|
let R = false;
|
|
1089
|
+
let H = false;
|
|
1018
1090
|
let Q = false;
|
|
1019
|
-
let T = false;
|
|
1020
1091
|
let q = false;
|
|
1021
|
-
let F = false;
|
|
1022
|
-
let M = null;
|
|
1023
|
-
let V = null;
|
|
1024
1092
|
let D = false;
|
|
1093
|
+
let V = false;
|
|
1025
1094
|
let B = null;
|
|
1095
|
+
let F = null;
|
|
1096
|
+
let M = false;
|
|
1097
|
+
let G = null;
|
|
1026
1098
|
function ownerInSnapshotScope(e) {
|
|
1027
1099
|
while (e) {
|
|
1028
1100
|
if (e.qe) return true;
|
|
@@ -1031,8 +1103,8 @@ function ownerInSnapshotScope(e) {
|
|
|
1031
1103
|
return false;
|
|
1032
1104
|
}
|
|
1033
1105
|
function setSnapshotCapture(e) {
|
|
1034
|
-
|
|
1035
|
-
if (e && !
|
|
1106
|
+
M = e;
|
|
1107
|
+
if (e && !G) G = new Set();
|
|
1036
1108
|
}
|
|
1037
1109
|
function markSnapshotScope(e) {
|
|
1038
1110
|
e.qe = true;
|
|
@@ -1043,138 +1115,139 @@ function releaseSnapshotScope(e) {
|
|
|
1043
1115
|
schedule();
|
|
1044
1116
|
}
|
|
1045
1117
|
function releaseSubtree(e) {
|
|
1046
|
-
let t = e.
|
|
1118
|
+
let t = e.Ee;
|
|
1047
1119
|
while (t) {
|
|
1048
1120
|
if (t.qe) {
|
|
1049
|
-
t = t.
|
|
1121
|
+
t = t.ke;
|
|
1050
1122
|
continue;
|
|
1051
1123
|
}
|
|
1052
|
-
if (t.
|
|
1124
|
+
if (t.T) {
|
|
1053
1125
|
const e = t;
|
|
1054
|
-
e.
|
|
1055
|
-
if (e.m &
|
|
1056
|
-
e.m &= ~
|
|
1126
|
+
e.he = false;
|
|
1127
|
+
if (e.m & c) {
|
|
1128
|
+
e.m &= ~c;
|
|
1057
1129
|
e.m |= n;
|
|
1058
1130
|
if (P.A > e.o) P.A = e.o;
|
|
1059
1131
|
insertIntoHeap(e, P);
|
|
1060
1132
|
}
|
|
1061
1133
|
}
|
|
1062
1134
|
releaseSubtree(t);
|
|
1063
|
-
t = t.
|
|
1135
|
+
t = t.ke;
|
|
1064
1136
|
}
|
|
1065
1137
|
}
|
|
1066
1138
|
function clearSnapshots() {
|
|
1067
|
-
if (
|
|
1068
|
-
for (const e of
|
|
1069
|
-
delete e.
|
|
1139
|
+
if (G) {
|
|
1140
|
+
for (const e of G) {
|
|
1141
|
+
delete e.pe;
|
|
1070
1142
|
delete e[m];
|
|
1071
1143
|
}
|
|
1072
|
-
|
|
1144
|
+
G = null;
|
|
1073
1145
|
}
|
|
1074
|
-
|
|
1146
|
+
M = false;
|
|
1075
1147
|
}
|
|
1076
1148
|
function recompute(t, n = false) {
|
|
1077
|
-
const i = t.
|
|
1149
|
+
const i = t.D;
|
|
1078
1150
|
if (!n) {
|
|
1079
|
-
if (t.
|
|
1151
|
+
if (t.K && (!i || k) && k !== t.K) N.initTransition(t.K);
|
|
1080
1152
|
deleteFromHeap(t, t.m & o ? v : P);
|
|
1081
|
-
if (t.
|
|
1153
|
+
if (t.K || i === y) disposeChildren(t);
|
|
1082
1154
|
else {
|
|
1083
1155
|
markDisposal(t);
|
|
1084
|
-
t.
|
|
1085
|
-
t.je = t.
|
|
1086
|
-
t.
|
|
1087
|
-
t.
|
|
1156
|
+
t.Ne = t.We;
|
|
1157
|
+
t.je = t.Ee;
|
|
1158
|
+
t.We = null;
|
|
1159
|
+
t.Ee = null;
|
|
1088
1160
|
t.Ae = 0;
|
|
1089
1161
|
}
|
|
1090
1162
|
}
|
|
1091
1163
|
const s = !!(t.m & f);
|
|
1092
|
-
const u = t.
|
|
1093
|
-
const
|
|
1094
|
-
const p =
|
|
1095
|
-
|
|
1096
|
-
t.
|
|
1164
|
+
const u = t.ee !== undefined && t.ee !== S;
|
|
1165
|
+
const l = !!(t.ge & a);
|
|
1166
|
+
const p = B;
|
|
1167
|
+
B = t;
|
|
1168
|
+
t.Ce = null;
|
|
1097
1169
|
t.m = r;
|
|
1098
|
-
t
|
|
1099
|
-
let h = t.
|
|
1100
|
-
let
|
|
1101
|
-
let w =
|
|
1102
|
-
let m =
|
|
1103
|
-
|
|
1170
|
+
t.de = E;
|
|
1171
|
+
let h = t.Z === S ? t.$ : t.Z;
|
|
1172
|
+
let g = t.o;
|
|
1173
|
+
let w = R;
|
|
1174
|
+
let m = F;
|
|
1175
|
+
R = true;
|
|
1104
1176
|
if (s) {
|
|
1105
1177
|
const e = resolveLane(t);
|
|
1106
|
-
if (e)
|
|
1178
|
+
if (e) F = e;
|
|
1107
1179
|
}
|
|
1108
1180
|
try {
|
|
1109
|
-
h = handleAsync(t, t.
|
|
1110
|
-
clearStatus(t);
|
|
1181
|
+
h = handleAsync(t, t.T(h));
|
|
1182
|
+
clearStatus(t, n);
|
|
1111
1183
|
const e = resolveLane(t);
|
|
1112
1184
|
if (e) {
|
|
1113
|
-
e.
|
|
1114
|
-
updatePendingSignal(e.
|
|
1185
|
+
e.H.delete(t);
|
|
1186
|
+
updatePendingSignal(e.te);
|
|
1115
1187
|
}
|
|
1116
1188
|
} catch (e) {
|
|
1117
|
-
if (e instanceof NotReadyError &&
|
|
1118
|
-
const e = findLane(
|
|
1119
|
-
if (e.
|
|
1120
|
-
e.
|
|
1121
|
-
t.
|
|
1122
|
-
updatePendingSignal(e.
|
|
1189
|
+
if (e instanceof NotReadyError && F) {
|
|
1190
|
+
const e = findLane(F);
|
|
1191
|
+
if (e.te !== t) {
|
|
1192
|
+
e.H.add(t);
|
|
1193
|
+
t.Y = e;
|
|
1194
|
+
updatePendingSignal(e.te);
|
|
1123
1195
|
}
|
|
1124
1196
|
}
|
|
1197
|
+
if (e instanceof NotReadyError) t._e = true;
|
|
1125
1198
|
notifyStatus(
|
|
1126
1199
|
t,
|
|
1127
1200
|
e instanceof NotReadyError ? a : d,
|
|
1128
1201
|
e,
|
|
1129
1202
|
undefined,
|
|
1130
|
-
e instanceof NotReadyError ? t.
|
|
1203
|
+
e instanceof NotReadyError ? t.Y : undefined
|
|
1131
1204
|
);
|
|
1132
1205
|
} finally {
|
|
1133
|
-
|
|
1134
|
-
t.m = e | (n ? t.m &
|
|
1135
|
-
|
|
1206
|
+
R = w;
|
|
1207
|
+
t.m = e | (n ? t.m & c : 0);
|
|
1208
|
+
B = p;
|
|
1136
1209
|
}
|
|
1137
|
-
if (!t.
|
|
1138
|
-
const e = t.
|
|
1139
|
-
let r = e !== null ? e.
|
|
1210
|
+
if (!t.ae) {
|
|
1211
|
+
const e = t.Ce;
|
|
1212
|
+
let r = e !== null ? e.W : t.N;
|
|
1140
1213
|
if (r !== null) {
|
|
1141
1214
|
do {
|
|
1142
1215
|
r = unlinkSubs(r);
|
|
1143
1216
|
} while (r !== null);
|
|
1144
|
-
if (e !== null) e.
|
|
1145
|
-
else t.
|
|
1146
|
-
}
|
|
1147
|
-
const f = u ? t.
|
|
1148
|
-
const
|
|
1149
|
-
if (
|
|
1150
|
-
const e = u ? t.
|
|
1151
|
-
if (n || (i &&
|
|
1152
|
-
t
|
|
1217
|
+
if (e !== null) e.W = null;
|
|
1218
|
+
else t.N = null;
|
|
1219
|
+
}
|
|
1220
|
+
const f = u ? t.ee : t.Z === S ? t.$ : t.Z;
|
|
1221
|
+
const c = !t.xe || !t.xe(f, h);
|
|
1222
|
+
if (c) {
|
|
1223
|
+
const e = u ? t.ee : undefined;
|
|
1224
|
+
if (n || (i && k !== t.K) || s) {
|
|
1225
|
+
t.$ = h;
|
|
1153
1226
|
if (u && s) {
|
|
1154
|
-
t.
|
|
1155
|
-
t.
|
|
1227
|
+
t.ee = h;
|
|
1228
|
+
t.Z = h;
|
|
1156
1229
|
}
|
|
1157
|
-
} else t.
|
|
1158
|
-
if (u && !s &&
|
|
1159
|
-
if (!u || s || t.
|
|
1230
|
+
} else t.Z = h;
|
|
1231
|
+
if (u && !s && l && !t.we) t.ee = h;
|
|
1232
|
+
if (!u || s || t.ee !== e) insertSubs(t, s || u);
|
|
1160
1233
|
} else if (u) {
|
|
1161
|
-
t.
|
|
1162
|
-
} else if (t.o !=
|
|
1234
|
+
t.Z = h;
|
|
1235
|
+
} else if (t.o != g) {
|
|
1163
1236
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1164
1237
|
insertIntoHeapHeight(e.k, e.k.m & o ? v : P);
|
|
1165
1238
|
}
|
|
1166
1239
|
}
|
|
1167
1240
|
}
|
|
1168
|
-
|
|
1169
|
-
(!n || t.
|
|
1170
|
-
t.
|
|
1241
|
+
F = m;
|
|
1242
|
+
(!n || t.ge & a) && !t.K && !(k && u) && N.se.push(t);
|
|
1243
|
+
t.K && i && k !== t.K && runInTransition(t.K, () => recompute(t));
|
|
1171
1244
|
}
|
|
1172
1245
|
function updateIfNecessary(r) {
|
|
1173
1246
|
if (r.m & t) {
|
|
1174
|
-
for (let e = r.
|
|
1247
|
+
for (let e = r.N; e; e = e.W) {
|
|
1175
1248
|
const t = e.L;
|
|
1176
1249
|
const i = t.I || t;
|
|
1177
|
-
if (i.
|
|
1250
|
+
if (i.T) {
|
|
1178
1251
|
updateIfNecessary(i);
|
|
1179
1252
|
}
|
|
1180
1253
|
if (r.m & n) {
|
|
@@ -1182,170 +1255,169 @@ function updateIfNecessary(r) {
|
|
|
1182
1255
|
}
|
|
1183
1256
|
}
|
|
1184
1257
|
}
|
|
1185
|
-
if (r.m & (n | f) || (r.
|
|
1258
|
+
if (r.m & (n | f) || (r.ae && r.de < E && !r.Oe)) {
|
|
1186
1259
|
recompute(r);
|
|
1187
1260
|
}
|
|
1188
|
-
r.m = e | (r.m &
|
|
1261
|
+
r.m = e | (r.m & c);
|
|
1189
1262
|
}
|
|
1190
1263
|
function computed(t, n, r) {
|
|
1191
1264
|
const i = r?.transparent ?? false;
|
|
1192
1265
|
const s = {
|
|
1193
|
-
id: r?.id ?? (i ?
|
|
1266
|
+
id: r?.id ?? (i ? B?.id : B?.id != null ? getNextChildId(B) : undefined),
|
|
1194
1267
|
Le: i || undefined,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
Ie:
|
|
1268
|
+
xe: r?.equals != null ? r.equals : isEqual,
|
|
1269
|
+
le: !!r?.pureWrite,
|
|
1270
|
+
He: r?.unobserved,
|
|
1271
|
+
We: null,
|
|
1272
|
+
B: B?.B ?? N,
|
|
1273
|
+
Ie: B?.Ie ?? _,
|
|
1201
1274
|
Ae: 0,
|
|
1202
|
-
|
|
1203
|
-
|
|
1275
|
+
T: t,
|
|
1276
|
+
$: n,
|
|
1204
1277
|
o: 0,
|
|
1205
1278
|
C: null,
|
|
1206
1279
|
h: undefined,
|
|
1207
1280
|
p: null,
|
|
1208
|
-
|
|
1209
|
-
|
|
1281
|
+
N: null,
|
|
1282
|
+
Ce: null,
|
|
1210
1283
|
O: null,
|
|
1211
|
-
|
|
1212
|
-
i:
|
|
1284
|
+
Re: null,
|
|
1285
|
+
i: B,
|
|
1286
|
+
ke: null,
|
|
1213
1287
|
Ee: null,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
de:
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
We: null,
|
|
1288
|
+
m: r?.lazy ? l : e,
|
|
1289
|
+
ge: p,
|
|
1290
|
+
de: E,
|
|
1291
|
+
Z: S,
|
|
1292
|
+
Ne: null,
|
|
1220
1293
|
je: null,
|
|
1221
|
-
|
|
1222
|
-
|
|
1294
|
+
Oe: null,
|
|
1295
|
+
K: null
|
|
1223
1296
|
};
|
|
1224
1297
|
s.p = s;
|
|
1225
|
-
const o =
|
|
1226
|
-
if (
|
|
1227
|
-
const e =
|
|
1298
|
+
const o = B?.t ? B.u : B;
|
|
1299
|
+
if (B) {
|
|
1300
|
+
const e = B.Ee;
|
|
1228
1301
|
if (e === null) {
|
|
1229
|
-
|
|
1302
|
+
B.Ee = s;
|
|
1230
1303
|
} else {
|
|
1231
|
-
s.
|
|
1232
|
-
|
|
1304
|
+
s.ke = e;
|
|
1305
|
+
B.Ee = s;
|
|
1233
1306
|
}
|
|
1234
1307
|
}
|
|
1235
1308
|
if (o) s.o = o.o + 1;
|
|
1236
|
-
if (
|
|
1309
|
+
if (M && ownerInSnapshotScope(B)) s.he = true;
|
|
1237
1310
|
if (I) {
|
|
1238
1311
|
const e = signal(undefined, { equals: false, pureWrite: true });
|
|
1239
|
-
const t = I.factory(s.
|
|
1312
|
+
const t = I.factory(s.T, () => {
|
|
1240
1313
|
setSignal(e, undefined);
|
|
1241
1314
|
});
|
|
1242
1315
|
onCleanup(() => t.dispose());
|
|
1243
|
-
s.
|
|
1316
|
+
s.T = n => {
|
|
1244
1317
|
read(e);
|
|
1245
1318
|
return t.track(n);
|
|
1246
1319
|
};
|
|
1247
1320
|
}
|
|
1248
1321
|
!r?.lazy && recompute(s, true);
|
|
1249
|
-
if (
|
|
1250
|
-
if (!(s.
|
|
1251
|
-
s.
|
|
1252
|
-
|
|
1322
|
+
if (M && !r?.lazy) {
|
|
1323
|
+
if (!(s.ge & a)) {
|
|
1324
|
+
s.pe = s.$ === undefined ? w : s.$;
|
|
1325
|
+
G.add(s);
|
|
1253
1326
|
}
|
|
1254
1327
|
}
|
|
1255
1328
|
return s;
|
|
1256
1329
|
}
|
|
1257
1330
|
function signal(e, t, n = null) {
|
|
1258
1331
|
const r = {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1332
|
+
xe: t?.equals != null ? t.equals : isEqual,
|
|
1333
|
+
le: !!t?.pureWrite,
|
|
1334
|
+
De: !!t?.De,
|
|
1335
|
+
He: t?.unobserved,
|
|
1336
|
+
$: e,
|
|
1263
1337
|
O: null,
|
|
1264
|
-
|
|
1265
|
-
|
|
1338
|
+
Re: null,
|
|
1339
|
+
de: E,
|
|
1266
1340
|
I: n,
|
|
1267
1341
|
j: n?.C || null,
|
|
1268
|
-
|
|
1342
|
+
Z: S
|
|
1269
1343
|
};
|
|
1270
1344
|
n && (n.C = r);
|
|
1271
|
-
if (
|
|
1272
|
-
r.
|
|
1273
|
-
|
|
1345
|
+
if (M && !r.De && !((n?.ge ?? 0) & a)) {
|
|
1346
|
+
r.pe = e === undefined ? w : e;
|
|
1347
|
+
G.add(r);
|
|
1274
1348
|
}
|
|
1275
1349
|
return r;
|
|
1276
1350
|
}
|
|
1277
1351
|
function optimisticSignal(e, t) {
|
|
1278
1352
|
const n = signal(e, t);
|
|
1279
|
-
n.
|
|
1353
|
+
n.ee = S;
|
|
1280
1354
|
return n;
|
|
1281
1355
|
}
|
|
1282
1356
|
function optimisticComputed(e, t, n) {
|
|
1283
1357
|
const r = computed(e, t, n);
|
|
1284
|
-
r.
|
|
1358
|
+
r.ee = S;
|
|
1285
1359
|
return r;
|
|
1286
1360
|
}
|
|
1287
1361
|
function isEqual(e, t) {
|
|
1288
1362
|
return e === t;
|
|
1289
1363
|
}
|
|
1290
1364
|
function untrack(e, t) {
|
|
1291
|
-
if (!I && !
|
|
1292
|
-
const n =
|
|
1293
|
-
|
|
1365
|
+
if (!I && !R && true) return e();
|
|
1366
|
+
const n = R;
|
|
1367
|
+
R = false;
|
|
1294
1368
|
try {
|
|
1295
1369
|
if (I) return I.untrack(e);
|
|
1296
1370
|
return e();
|
|
1297
1371
|
} finally {
|
|
1298
|
-
|
|
1372
|
+
R = n;
|
|
1299
1373
|
}
|
|
1300
1374
|
}
|
|
1301
1375
|
function read(e) {
|
|
1302
|
-
if (
|
|
1376
|
+
if (V) {
|
|
1303
1377
|
const t = getLatestValueComputed(e);
|
|
1304
|
-
const n =
|
|
1305
|
-
|
|
1306
|
-
const r = e.
|
|
1378
|
+
const n = V;
|
|
1379
|
+
V = false;
|
|
1380
|
+
const r = e.ee !== undefined && e.ee !== S ? e.ee : e.$;
|
|
1307
1381
|
let i;
|
|
1308
1382
|
try {
|
|
1309
1383
|
i = read(t);
|
|
1310
1384
|
} catch (e) {
|
|
1311
|
-
if (!
|
|
1385
|
+
if (!B && e instanceof NotReadyError) return r;
|
|
1312
1386
|
throw e;
|
|
1313
1387
|
} finally {
|
|
1314
|
-
|
|
1388
|
+
V = n;
|
|
1315
1389
|
}
|
|
1316
|
-
if (t.
|
|
1317
|
-
if (
|
|
1318
|
-
const e = findLane(t.
|
|
1319
|
-
const n = findLane(
|
|
1320
|
-
if (e !== n && e.
|
|
1390
|
+
if (t.ge & a) return r;
|
|
1391
|
+
if (H && F && t.Y) {
|
|
1392
|
+
const e = findLane(t.Y);
|
|
1393
|
+
const n = findLane(F);
|
|
1394
|
+
if (e !== n && e.H.size > 0) {
|
|
1321
1395
|
return r;
|
|
1322
1396
|
}
|
|
1323
1397
|
}
|
|
1324
1398
|
return i;
|
|
1325
1399
|
}
|
|
1326
|
-
if (
|
|
1327
|
-
const t = e.I
|
|
1328
|
-
const n =
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
if (read(
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
T = r;
|
|
1335
|
-
return e.ae;
|
|
1400
|
+
if (q) {
|
|
1401
|
+
const t = e.I;
|
|
1402
|
+
const n = q;
|
|
1403
|
+
q = false;
|
|
1404
|
+
if (read(getPendingSignal(e))) D = true;
|
|
1405
|
+
if (t && read(getPendingSignal(t))) D = true;
|
|
1406
|
+
q = n;
|
|
1407
|
+
return e.$;
|
|
1336
1408
|
}
|
|
1337
|
-
let t =
|
|
1409
|
+
let t = B;
|
|
1338
1410
|
if (t?.t) t = t.u;
|
|
1339
|
-
if (Q && e.
|
|
1340
|
-
if (e.m &
|
|
1341
|
-
e.m &= ~
|
|
1411
|
+
if (Q && e.T) recompute(e);
|
|
1412
|
+
if (e.m & l) {
|
|
1413
|
+
e.m &= ~l;
|
|
1342
1414
|
recompute(e, true);
|
|
1343
1415
|
}
|
|
1344
1416
|
const n = e.I || e;
|
|
1345
|
-
if (t &&
|
|
1346
|
-
if (e.
|
|
1417
|
+
if (t && R) {
|
|
1418
|
+
if (e.T && e.m & u) recompute(e);
|
|
1347
1419
|
link(e, t);
|
|
1348
|
-
if (n.
|
|
1420
|
+
if (n.T) {
|
|
1349
1421
|
const r = e.m & o;
|
|
1350
1422
|
if (n.o >= (r ? v.A : P.A)) {
|
|
1351
1423
|
markNode(t);
|
|
@@ -1358,186 +1430,191 @@ function read(e) {
|
|
|
1358
1430
|
}
|
|
1359
1431
|
}
|
|
1360
1432
|
}
|
|
1361
|
-
if (n.
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
const r = n.re;
|
|
1367
|
-
const i = findLane(V);
|
|
1433
|
+
if (n.ge & a) {
|
|
1434
|
+
if (t && !(H && n.K && k !== n.K)) {
|
|
1435
|
+
if (F) {
|
|
1436
|
+
const r = n.Y;
|
|
1437
|
+
const i = findLane(F);
|
|
1368
1438
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1369
|
-
if (!
|
|
1370
|
-
throw n.
|
|
1439
|
+
if (!R && e !== t) link(e, t);
|
|
1440
|
+
throw n.ae;
|
|
1371
1441
|
}
|
|
1372
1442
|
} else {
|
|
1373
|
-
if (!
|
|
1374
|
-
throw n.
|
|
1443
|
+
if (!R && e !== t) link(e, t);
|
|
1444
|
+
throw n.ae;
|
|
1375
1445
|
}
|
|
1376
|
-
} else if (!t && n.
|
|
1377
|
-
throw n.
|
|
1446
|
+
} else if (!t && n.ge & p) {
|
|
1447
|
+
throw n.ae;
|
|
1378
1448
|
}
|
|
1379
1449
|
}
|
|
1380
|
-
if (e.
|
|
1381
|
-
if (e
|
|
1450
|
+
if (e.T && e.ge & d) {
|
|
1451
|
+
if (e.de < E) {
|
|
1382
1452
|
recompute(e, true);
|
|
1383
1453
|
return read(e);
|
|
1384
|
-
} else throw e.
|
|
1454
|
+
} else throw e.ae;
|
|
1385
1455
|
}
|
|
1386
|
-
if (
|
|
1387
|
-
const n = e.
|
|
1456
|
+
if (M && t && t.he) {
|
|
1457
|
+
const n = e.pe;
|
|
1388
1458
|
if (n !== undefined) {
|
|
1389
1459
|
const r = n === w ? undefined : n;
|
|
1390
|
-
const i = e.
|
|
1391
|
-
if (i !== r) t.m |=
|
|
1460
|
+
const i = e.Z !== S ? e.Z : e.$;
|
|
1461
|
+
if (i !== r) t.m |= c;
|
|
1392
1462
|
return r;
|
|
1393
1463
|
}
|
|
1394
1464
|
}
|
|
1395
|
-
if (e.
|
|
1465
|
+
if (e.ee !== undefined && e.ee !== S) {
|
|
1466
|
+
if (t && H && shouldReadStashedOptimisticValue(e)) return e.$;
|
|
1467
|
+
return e.ee;
|
|
1468
|
+
}
|
|
1396
1469
|
return !t ||
|
|
1397
|
-
(
|
|
1398
|
-
e.
|
|
1399
|
-
(
|
|
1400
|
-
? e
|
|
1401
|
-
: e.
|
|
1470
|
+
(F !== null && (e.ee !== undefined || e.Y || (n === e && H) || !!(n.ge & a))) ||
|
|
1471
|
+
e.Z === S ||
|
|
1472
|
+
(H && e.K && k !== e.K)
|
|
1473
|
+
? e.$
|
|
1474
|
+
: e.Z;
|
|
1402
1475
|
}
|
|
1403
1476
|
function setSignal(e, t) {
|
|
1404
|
-
if (e.
|
|
1405
|
-
const n = e.
|
|
1406
|
-
const r = e.
|
|
1407
|
-
const i = n ? (r ? e.
|
|
1477
|
+
if (e.K && k !== e.K) N.initTransition(e.K);
|
|
1478
|
+
const n = e.ee !== undefined && !j;
|
|
1479
|
+
const r = e.ee !== undefined && e.ee !== S;
|
|
1480
|
+
const i = n ? (r ? e.ee : e.$) : e.Z === S ? e.$ : e.Z;
|
|
1408
1481
|
if (typeof t === "function") t = t(i);
|
|
1409
|
-
const s = !e.
|
|
1482
|
+
const s = !e.xe || !e.xe(i, t) || !!(e.ge & p);
|
|
1410
1483
|
if (!s) {
|
|
1411
|
-
if (n && r && e.
|
|
1484
|
+
if (n && r && e.T) {
|
|
1412
1485
|
insertSubs(e, true);
|
|
1413
1486
|
schedule();
|
|
1414
1487
|
}
|
|
1415
1488
|
return t;
|
|
1416
1489
|
}
|
|
1417
1490
|
if (n) {
|
|
1418
|
-
const n = e.
|
|
1419
|
-
if (!n
|
|
1491
|
+
const n = e.ee === S;
|
|
1492
|
+
if (!n) N.initTransition(resolveTransition(e));
|
|
1420
1493
|
if (n) {
|
|
1421
|
-
e.
|
|
1422
|
-
|
|
1494
|
+
e.Z = e.$;
|
|
1495
|
+
N.U.push(e);
|
|
1423
1496
|
}
|
|
1424
|
-
e.
|
|
1497
|
+
e.we = true;
|
|
1425
1498
|
const r = getOrCreateLane(e);
|
|
1426
|
-
e.
|
|
1427
|
-
e.
|
|
1499
|
+
e.Y = r;
|
|
1500
|
+
e.ee = t;
|
|
1428
1501
|
} else {
|
|
1429
|
-
if (e.
|
|
1430
|
-
e.
|
|
1502
|
+
if (e.Z === S) N.se.push(e);
|
|
1503
|
+
e.Z = t;
|
|
1431
1504
|
}
|
|
1432
1505
|
updatePendingSignal(e);
|
|
1433
|
-
if (e.
|
|
1434
|
-
setSignal(e.
|
|
1506
|
+
if (e.Pe) {
|
|
1507
|
+
setSignal(e.Pe, t);
|
|
1435
1508
|
}
|
|
1436
|
-
e
|
|
1509
|
+
e.de = E;
|
|
1437
1510
|
insertSubs(e, n);
|
|
1438
1511
|
schedule();
|
|
1439
1512
|
return t;
|
|
1440
1513
|
}
|
|
1441
1514
|
function runWithOwner(e, t) {
|
|
1442
|
-
const n =
|
|
1443
|
-
const r =
|
|
1444
|
-
|
|
1445
|
-
|
|
1515
|
+
const n = B;
|
|
1516
|
+
const r = R;
|
|
1517
|
+
B = e;
|
|
1518
|
+
R = false;
|
|
1446
1519
|
try {
|
|
1447
1520
|
return t();
|
|
1448
1521
|
} finally {
|
|
1449
|
-
|
|
1450
|
-
|
|
1522
|
+
B = n;
|
|
1523
|
+
R = r;
|
|
1451
1524
|
}
|
|
1452
1525
|
}
|
|
1453
1526
|
function getPendingSignal(e) {
|
|
1454
|
-
if (!e.
|
|
1455
|
-
e.
|
|
1527
|
+
if (!e.Ve) {
|
|
1528
|
+
e.Ve = optimisticSignal(false, { pureWrite: true });
|
|
1456
1529
|
if (e.ye) {
|
|
1457
|
-
e.
|
|
1530
|
+
e.Ve.ye = e;
|
|
1458
1531
|
}
|
|
1459
|
-
if (computePendingState(e)) setSignal(e.
|
|
1532
|
+
if (computePendingState(e)) setSignal(e.Ve, true);
|
|
1460
1533
|
}
|
|
1461
|
-
return e.
|
|
1534
|
+
return e.Ve;
|
|
1462
1535
|
}
|
|
1463
1536
|
function computePendingState(e) {
|
|
1464
1537
|
const t = e;
|
|
1465
|
-
|
|
1466
|
-
|
|
1538
|
+
const n = e.I;
|
|
1539
|
+
if (n && e.Z !== S) {
|
|
1540
|
+
return !n.Oe && !(n.ge & a);
|
|
1541
|
+
}
|
|
1542
|
+
if (e.ee !== undefined && e.ee !== S) {
|
|
1543
|
+
if (t.ge & a && !(t.ge & p)) return true;
|
|
1467
1544
|
if (e.ye) {
|
|
1468
|
-
const t = e.
|
|
1469
|
-
return !!(t && t.
|
|
1545
|
+
const t = e.Y ? findLane(e.Y) : null;
|
|
1546
|
+
return !!(t && t.H.size > 0);
|
|
1470
1547
|
}
|
|
1471
1548
|
return true;
|
|
1472
1549
|
}
|
|
1473
|
-
if (e.
|
|
1474
|
-
return !!(t.
|
|
1550
|
+
if (e.Z !== S && !(t.ge & p)) return true;
|
|
1551
|
+
return !!(t.ge & a && !(t.ge & p));
|
|
1475
1552
|
}
|
|
1476
1553
|
function updatePendingSignal(e) {
|
|
1477
|
-
if (e.
|
|
1554
|
+
if (e.Ve) {
|
|
1478
1555
|
const t = computePendingState(e);
|
|
1479
|
-
const n = e.
|
|
1556
|
+
const n = e.Ve;
|
|
1480
1557
|
setSignal(n, t);
|
|
1481
|
-
if (!t && n.
|
|
1558
|
+
if (!t && n.Y) {
|
|
1482
1559
|
const t = resolveLane(e);
|
|
1483
|
-
if (t && t.
|
|
1484
|
-
const e = findLane(n.
|
|
1560
|
+
if (t && t.H.size > 0) {
|
|
1561
|
+
const e = findLane(n.Y);
|
|
1485
1562
|
if (e !== t) {
|
|
1486
1563
|
mergeLanes(t, e);
|
|
1487
1564
|
}
|
|
1488
1565
|
}
|
|
1489
1566
|
W.delete(n);
|
|
1490
|
-
n.
|
|
1567
|
+
n.Y = undefined;
|
|
1491
1568
|
}
|
|
1492
1569
|
}
|
|
1493
1570
|
}
|
|
1494
1571
|
function getLatestValueComputed(e) {
|
|
1495
|
-
if (!e.
|
|
1496
|
-
const t =
|
|
1497
|
-
|
|
1498
|
-
const n =
|
|
1499
|
-
|
|
1500
|
-
const r =
|
|
1501
|
-
|
|
1502
|
-
e.
|
|
1503
|
-
e.
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1508
|
-
return e.
|
|
1572
|
+
if (!e.Pe) {
|
|
1573
|
+
const t = V;
|
|
1574
|
+
V = false;
|
|
1575
|
+
const n = q;
|
|
1576
|
+
q = false;
|
|
1577
|
+
const r = B;
|
|
1578
|
+
B = null;
|
|
1579
|
+
e.Pe = optimisticComputed(() => read(e));
|
|
1580
|
+
e.Pe.ye = e;
|
|
1581
|
+
B = r;
|
|
1582
|
+
q = n;
|
|
1583
|
+
V = t;
|
|
1584
|
+
}
|
|
1585
|
+
return e.Pe;
|
|
1509
1586
|
}
|
|
1510
1587
|
function staleValues(e, t = true) {
|
|
1511
|
-
const n =
|
|
1512
|
-
|
|
1588
|
+
const n = H;
|
|
1589
|
+
H = t;
|
|
1513
1590
|
try {
|
|
1514
1591
|
return e();
|
|
1515
1592
|
} finally {
|
|
1516
|
-
|
|
1593
|
+
H = n;
|
|
1517
1594
|
}
|
|
1518
1595
|
}
|
|
1519
1596
|
function latest(e) {
|
|
1520
|
-
const t =
|
|
1521
|
-
|
|
1597
|
+
const t = V;
|
|
1598
|
+
V = true;
|
|
1522
1599
|
try {
|
|
1523
1600
|
return e();
|
|
1524
1601
|
} finally {
|
|
1525
|
-
|
|
1602
|
+
V = t;
|
|
1526
1603
|
}
|
|
1527
1604
|
}
|
|
1528
1605
|
function isPending(e) {
|
|
1529
|
-
const t =
|
|
1530
|
-
const n =
|
|
1531
|
-
|
|
1532
|
-
|
|
1606
|
+
const t = q;
|
|
1607
|
+
const n = D;
|
|
1608
|
+
q = true;
|
|
1609
|
+
D = false;
|
|
1533
1610
|
try {
|
|
1534
1611
|
e();
|
|
1535
|
-
return
|
|
1612
|
+
return D;
|
|
1536
1613
|
} catch {
|
|
1537
|
-
return
|
|
1614
|
+
return D;
|
|
1538
1615
|
} finally {
|
|
1539
|
-
|
|
1540
|
-
|
|
1616
|
+
q = t;
|
|
1617
|
+
D = n;
|
|
1541
1618
|
}
|
|
1542
1619
|
}
|
|
1543
1620
|
function refresh(e) {
|
|
@@ -1584,8 +1661,98 @@ function hasContext(e, t) {
|
|
|
1584
1661
|
function isUndefined(e) {
|
|
1585
1662
|
return typeof e === "undefined";
|
|
1586
1663
|
}
|
|
1664
|
+
function effect(e, t, n, r, i) {
|
|
1665
|
+
let s = false;
|
|
1666
|
+
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
1667
|
+
...i,
|
|
1668
|
+
equals: () => {
|
|
1669
|
+
o.V = !o.ae;
|
|
1670
|
+
if (s) o.B.enqueue(o.D, runEffect.bind(o));
|
|
1671
|
+
return false;
|
|
1672
|
+
},
|
|
1673
|
+
lazy: true
|
|
1674
|
+
});
|
|
1675
|
+
o.Be = r;
|
|
1676
|
+
o.Fe = t;
|
|
1677
|
+
o.Me = n;
|
|
1678
|
+
o.Ge = undefined;
|
|
1679
|
+
o.D = i?.render ? h : g;
|
|
1680
|
+
o.ve = (e, t) => {
|
|
1681
|
+
const n = e !== undefined ? e : o.ge;
|
|
1682
|
+
const r = t !== undefined ? t : o.ae;
|
|
1683
|
+
if (n & d) {
|
|
1684
|
+
let e = r;
|
|
1685
|
+
o.B.notify(o, a, 0);
|
|
1686
|
+
if (o.D === g) {
|
|
1687
|
+
try {
|
|
1688
|
+
return o.Me
|
|
1689
|
+
? o.Me(e, () => {
|
|
1690
|
+
o.Ge?.();
|
|
1691
|
+
o.Ge = undefined;
|
|
1692
|
+
})
|
|
1693
|
+
: console.error(e);
|
|
1694
|
+
} catch (t) {
|
|
1695
|
+
e = t;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
if (!o.B.notify(o, d, d)) throw e;
|
|
1699
|
+
} else if (o.D === h) {
|
|
1700
|
+
o.B.notify(o, a | d, n, r);
|
|
1701
|
+
}
|
|
1702
|
+
};
|
|
1703
|
+
recompute(o, true);
|
|
1704
|
+
!i?.defer && (o.D === g ? o.B.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
|
|
1705
|
+
s = true;
|
|
1706
|
+
onCleanup(() => o.Ge?.());
|
|
1707
|
+
}
|
|
1708
|
+
function runEffect() {
|
|
1709
|
+
if (!this.V || this.m & u) return;
|
|
1710
|
+
this.Ge?.();
|
|
1711
|
+
this.Ge = undefined;
|
|
1712
|
+
try {
|
|
1713
|
+
this.Ge = this.Fe(this.$, this.Be);
|
|
1714
|
+
} catch (e) {
|
|
1715
|
+
this.ae = new StatusError(this, e);
|
|
1716
|
+
this.ge |= d;
|
|
1717
|
+
if (!this.B.notify(this, d, d)) throw e;
|
|
1718
|
+
} finally {
|
|
1719
|
+
this.Be = this.$;
|
|
1720
|
+
this.V = false;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
function trackedEffect(e, t) {
|
|
1724
|
+
const run = () => {
|
|
1725
|
+
if (!n.V || n.m & u) return;
|
|
1726
|
+
n.V = false;
|
|
1727
|
+
recompute(n);
|
|
1728
|
+
};
|
|
1729
|
+
const n = computed(
|
|
1730
|
+
() => {
|
|
1731
|
+
n.Ge?.();
|
|
1732
|
+
n.Ge = undefined;
|
|
1733
|
+
n.Ge = staleValues(e) || undefined;
|
|
1734
|
+
},
|
|
1735
|
+
undefined,
|
|
1736
|
+
{ ...t, lazy: true }
|
|
1737
|
+
);
|
|
1738
|
+
n.Ge = undefined;
|
|
1739
|
+
n.Ke = true;
|
|
1740
|
+
n.V = true;
|
|
1741
|
+
n.D = y;
|
|
1742
|
+
n.ve = (e, t) => {
|
|
1743
|
+
const r = e !== undefined ? e : n.ge;
|
|
1744
|
+
if (r & d) {
|
|
1745
|
+
n.B.notify(n, a, 0);
|
|
1746
|
+
const e = t !== undefined ? t : n.ae;
|
|
1747
|
+
if (!n.B.notify(n, d, d)) throw e;
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
n.F = run;
|
|
1751
|
+
n.B.enqueue(g, run);
|
|
1752
|
+
onCleanup(() => n.Ge?.());
|
|
1753
|
+
}
|
|
1587
1754
|
function restoreTransition(e, t) {
|
|
1588
|
-
|
|
1755
|
+
N.initTransition(e);
|
|
1589
1756
|
const n = t();
|
|
1590
1757
|
flush();
|
|
1591
1758
|
return n;
|
|
@@ -1594,13 +1761,13 @@ function action(e) {
|
|
|
1594
1761
|
return (...t) =>
|
|
1595
1762
|
new Promise((n, r) => {
|
|
1596
1763
|
const i = e(...t);
|
|
1597
|
-
|
|
1598
|
-
let s =
|
|
1599
|
-
s.
|
|
1764
|
+
N.initTransition();
|
|
1765
|
+
let s = k;
|
|
1766
|
+
s.G.push(i);
|
|
1600
1767
|
const done = (e, t) => {
|
|
1601
1768
|
s = currentTransition(s);
|
|
1602
|
-
const o = s.
|
|
1603
|
-
if (o >= 0) s.
|
|
1769
|
+
const o = s.G.indexOf(i);
|
|
1770
|
+
if (o >= 0) s.G.splice(o, 1);
|
|
1604
1771
|
setActiveTransition(s);
|
|
1605
1772
|
schedule();
|
|
1606
1773
|
t ? r(t) : n(e);
|
|
@@ -1694,15 +1861,16 @@ function createOptimistic(e, t, n) {
|
|
|
1694
1861
|
return [accessor(r), setSignal.bind(null, r)];
|
|
1695
1862
|
}
|
|
1696
1863
|
function onSettled(e) {
|
|
1697
|
-
getOwner()
|
|
1864
|
+
const t = getOwner();
|
|
1865
|
+
t && !t.Ke
|
|
1698
1866
|
? createTrackedEffect(() => untrack(e))
|
|
1699
|
-
:
|
|
1867
|
+
: N.enqueue(g, () => {
|
|
1700
1868
|
const t = e();
|
|
1701
1869
|
t?.();
|
|
1702
1870
|
});
|
|
1703
1871
|
}
|
|
1704
1872
|
function unwrap(e) {
|
|
1705
|
-
return e?.[
|
|
1873
|
+
return e?.[U]?.[ee] ?? e;
|
|
1706
1874
|
}
|
|
1707
1875
|
function getOverrideValue(e, t, n, r, i) {
|
|
1708
1876
|
if (i && r in i) return i[r];
|
|
@@ -1714,21 +1882,21 @@ function getAllKeys(e, t, n) {
|
|
|
1714
1882
|
return Array.from(new Set([...r, ...i]));
|
|
1715
1883
|
}
|
|
1716
1884
|
function applyState(e, t, n) {
|
|
1717
|
-
const r = t?.[
|
|
1885
|
+
const r = t?.[U];
|
|
1718
1886
|
if (!r) return;
|
|
1719
|
-
const i = r[
|
|
1720
|
-
const s = r[
|
|
1721
|
-
const o = r[
|
|
1722
|
-
let u = r[
|
|
1887
|
+
const i = r[Y];
|
|
1888
|
+
const s = r[Z];
|
|
1889
|
+
const o = r[$];
|
|
1890
|
+
let u = r[ee];
|
|
1723
1891
|
if (e === i && !s && !o) return;
|
|
1724
|
-
(r[
|
|
1725
|
-
r[
|
|
1726
|
-
r[
|
|
1892
|
+
(r[re] || oe).set(e, r[J]);
|
|
1893
|
+
r[Y] = e;
|
|
1894
|
+
r[Z] = undefined;
|
|
1727
1895
|
if (Array.isArray(i)) {
|
|
1728
1896
|
let t = false;
|
|
1729
1897
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
1730
1898
|
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1731
|
-
let
|
|
1899
|
+
let c, l, a, d, p, h, g, y;
|
|
1732
1900
|
for (
|
|
1733
1901
|
a = 0, d = Math.min(f, e.length);
|
|
1734
1902
|
a < d &&
|
|
@@ -1749,67 +1917,67 @@ function applyState(e, t, n) {
|
|
|
1749
1917
|
S[p] = h;
|
|
1750
1918
|
}
|
|
1751
1919
|
if (a > p || a > d) {
|
|
1752
|
-
for (
|
|
1920
|
+
for (l = a; l <= p; l++) {
|
|
1753
1921
|
t = true;
|
|
1754
|
-
r[
|
|
1922
|
+
r[ee][l] && setSignal(r[ee][l], wrap(e[l], r));
|
|
1755
1923
|
}
|
|
1756
|
-
for (;
|
|
1924
|
+
for (; l < e.length; l++) {
|
|
1757
1925
|
t = true;
|
|
1758
|
-
const i = wrap(S[
|
|
1759
|
-
r[
|
|
1760
|
-
applyState(e[
|
|
1926
|
+
const i = wrap(S[l], r);
|
|
1927
|
+
r[ee][l] && setSignal(r[ee][l], i);
|
|
1928
|
+
applyState(e[l], i, n);
|
|
1761
1929
|
}
|
|
1762
|
-
t && r[
|
|
1763
|
-
f !== e.length && r[
|
|
1930
|
+
t && r[ee][z] && setSignal(r[ee][z], void 0);
|
|
1931
|
+
f !== e.length && r[ee].length && setSignal(r[ee].length, e.length);
|
|
1764
1932
|
return;
|
|
1765
1933
|
}
|
|
1766
|
-
|
|
1767
|
-
for (
|
|
1768
|
-
h = e[
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
w.set(
|
|
1773
|
-
}
|
|
1774
|
-
for (
|
|
1775
|
-
h = getOverrideValue(i, s, u,
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
if (
|
|
1779
|
-
S[
|
|
1780
|
-
|
|
1781
|
-
w.set(
|
|
1934
|
+
g = new Array(p + 1);
|
|
1935
|
+
for (l = p; l >= a; l--) {
|
|
1936
|
+
h = e[l];
|
|
1937
|
+
y = h ? n(h) : h;
|
|
1938
|
+
c = w.get(y);
|
|
1939
|
+
g[l] = c === undefined ? -1 : c;
|
|
1940
|
+
w.set(y, l);
|
|
1941
|
+
}
|
|
1942
|
+
for (c = a; c <= d; c++) {
|
|
1943
|
+
h = getOverrideValue(i, s, u, c, o);
|
|
1944
|
+
y = h ? n(h) : h;
|
|
1945
|
+
l = w.get(y);
|
|
1946
|
+
if (l !== undefined && l !== -1) {
|
|
1947
|
+
S[l] = h;
|
|
1948
|
+
l = g[l];
|
|
1949
|
+
w.set(y, l);
|
|
1782
1950
|
}
|
|
1783
1951
|
}
|
|
1784
|
-
for (
|
|
1785
|
-
if (
|
|
1786
|
-
const t = wrap(S[
|
|
1787
|
-
r[
|
|
1788
|
-
applyState(e[
|
|
1789
|
-
} else r[
|
|
1952
|
+
for (l = a; l < e.length; l++) {
|
|
1953
|
+
if (l in S) {
|
|
1954
|
+
const t = wrap(S[l], r);
|
|
1955
|
+
r[ee][l] && setSignal(r[ee][l], t);
|
|
1956
|
+
applyState(e[l], t, n);
|
|
1957
|
+
} else r[ee][l] && setSignal(r[ee][l], wrap(e[l], r));
|
|
1790
1958
|
}
|
|
1791
1959
|
if (a < e.length) t = true;
|
|
1792
1960
|
} else if (e.length) {
|
|
1793
1961
|
for (let t = 0, f = e.length; t < f; t++) {
|
|
1794
1962
|
const f = getOverrideValue(i, s, u, t, o);
|
|
1795
|
-
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[
|
|
1963
|
+
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[ee][t] && setSignal(r[ee][t], e[t]);
|
|
1796
1964
|
}
|
|
1797
1965
|
}
|
|
1798
1966
|
if (f !== e.length) {
|
|
1799
1967
|
t = true;
|
|
1800
|
-
r[
|
|
1968
|
+
r[ee].length && setSignal(r[ee].length, e.length);
|
|
1801
1969
|
}
|
|
1802
|
-
t && r[
|
|
1970
|
+
t && r[ee][z] && setSignal(r[ee][z], void 0);
|
|
1803
1971
|
return;
|
|
1804
1972
|
}
|
|
1805
1973
|
if (u) {
|
|
1806
|
-
const t = u[
|
|
1974
|
+
const t = u[z];
|
|
1807
1975
|
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
1808
|
-
for (let
|
|
1809
|
-
const
|
|
1810
|
-
const a = u[
|
|
1811
|
-
const d = unwrap(getOverrideValue(i, s, u,
|
|
1812
|
-
let p = unwrap(e[
|
|
1976
|
+
for (let c = 0, l = f.length; c < l; c++) {
|
|
1977
|
+
const l = f[c];
|
|
1978
|
+
const a = u[l];
|
|
1979
|
+
const d = unwrap(getOverrideValue(i, s, u, l, o));
|
|
1980
|
+
let p = unwrap(e[l]);
|
|
1813
1981
|
if (d === p) continue;
|
|
1814
1982
|
if (!d || !isWrappable(d) || !isWrappable(p) || (n(d) != null && n(d) !== n(p))) {
|
|
1815
1983
|
t && setSignal(t, void 0);
|
|
@@ -1817,7 +1985,7 @@ function applyState(e, t, n) {
|
|
|
1817
1985
|
} else applyState(p, wrap(d, r), n);
|
|
1818
1986
|
}
|
|
1819
1987
|
}
|
|
1820
|
-
if ((u = r[
|
|
1988
|
+
if ((u = r[te])) {
|
|
1821
1989
|
const t = Object.keys(u);
|
|
1822
1990
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1823
1991
|
const r = t[n];
|
|
@@ -1839,9 +2007,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1839
2007
|
let r;
|
|
1840
2008
|
const i = new WeakMap();
|
|
1841
2009
|
const wrapper = e => {
|
|
1842
|
-
e[
|
|
1843
|
-
e[
|
|
1844
|
-
Object.defineProperty(e,
|
|
2010
|
+
e[ne] = wrapProjection;
|
|
2011
|
+
e[re] = i;
|
|
2012
|
+
Object.defineProperty(e, ie, {
|
|
1845
2013
|
get() {
|
|
1846
2014
|
return r;
|
|
1847
2015
|
},
|
|
@@ -1850,28 +2018,28 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1850
2018
|
};
|
|
1851
2019
|
const wrapProjection = e => {
|
|
1852
2020
|
if (i.has(e)) return i.get(e);
|
|
1853
|
-
if (e[
|
|
1854
|
-
const t = createStoreProxy(e,
|
|
2021
|
+
if (e[U]?.[ne] === wrapProjection) return e;
|
|
2022
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
1855
2023
|
i.set(e, t);
|
|
1856
2024
|
return t;
|
|
1857
2025
|
};
|
|
1858
2026
|
const s = wrapProjection(t);
|
|
1859
2027
|
r = computed(() => {
|
|
1860
2028
|
const t = getOwner();
|
|
1861
|
-
storeSetter(new Proxy(s,
|
|
2029
|
+
storeSetter(new Proxy(s, K), r => {
|
|
1862
2030
|
const i = handleAsync(t, e(r), e => {
|
|
1863
2031
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
|
|
1864
2032
|
});
|
|
1865
2033
|
i !== r && i !== undefined && reconcile(i, n?.key || "id")(s);
|
|
1866
2034
|
});
|
|
1867
2035
|
});
|
|
1868
|
-
r.
|
|
2036
|
+
r.Qe = true;
|
|
1869
2037
|
return { store: s, node: r };
|
|
1870
2038
|
}
|
|
1871
2039
|
function createProjection(e, t = {}, n) {
|
|
1872
2040
|
return createProjectionInternal(e, t, n).store;
|
|
1873
2041
|
}
|
|
1874
|
-
const
|
|
2042
|
+
const K = {
|
|
1875
2043
|
get(e, t) {
|
|
1876
2044
|
let n;
|
|
1877
2045
|
setWriteOverride(true);
|
|
@@ -1882,7 +2050,7 @@ const G = {
|
|
|
1882
2050
|
setWriteOverride(false);
|
|
1883
2051
|
setProjectionWriteActive(false);
|
|
1884
2052
|
}
|
|
1885
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
2053
|
+
return typeof n === "object" && n !== null ? new Proxy(n, K) : n;
|
|
1886
2054
|
},
|
|
1887
2055
|
set(e, t, n) {
|
|
1888
2056
|
setWriteOverride(true);
|
|
@@ -1907,44 +2075,44 @@ const G = {
|
|
|
1907
2075
|
return true;
|
|
1908
2076
|
}
|
|
1909
2077
|
};
|
|
1910
|
-
const
|
|
1911
|
-
z = Symbol(0),
|
|
2078
|
+
const z = Symbol(0),
|
|
1912
2079
|
U = Symbol(0),
|
|
1913
|
-
J = Symbol(0)
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
Z = "
|
|
1917
|
-
$ = "
|
|
1918
|
-
ee = "
|
|
1919
|
-
te = "
|
|
1920
|
-
ne = "
|
|
1921
|
-
re = "
|
|
1922
|
-
ie = "
|
|
1923
|
-
|
|
2080
|
+
J = Symbol(0),
|
|
2081
|
+
X = Symbol(0);
|
|
2082
|
+
const Y = "v",
|
|
2083
|
+
Z = "o",
|
|
2084
|
+
$ = "x",
|
|
2085
|
+
ee = "n",
|
|
2086
|
+
te = "h",
|
|
2087
|
+
ne = "w",
|
|
2088
|
+
re = "l",
|
|
2089
|
+
ie = "f",
|
|
2090
|
+
se = "p";
|
|
2091
|
+
function createStoreProxy(e, t = ce, n) {
|
|
1924
2092
|
let r;
|
|
1925
2093
|
if (Array.isArray(e)) {
|
|
1926
2094
|
r = [];
|
|
1927
2095
|
r.v = e;
|
|
1928
2096
|
} else r = { v: e };
|
|
1929
2097
|
n && n(r);
|
|
1930
|
-
return (r[
|
|
2098
|
+
return (r[J] = new Proxy(r, t));
|
|
1931
2099
|
}
|
|
1932
|
-
const
|
|
2100
|
+
const oe = new WeakMap();
|
|
1933
2101
|
function wrap(e, t) {
|
|
1934
|
-
if (t?.[
|
|
1935
|
-
let n = e[
|
|
1936
|
-
if (!n)
|
|
2102
|
+
if (t?.[ne]) return t[ne](e, t);
|
|
2103
|
+
let n = e[J] || oe.get(e);
|
|
2104
|
+
if (!n) oe.set(e, (n = createStoreProxy(e)));
|
|
1937
2105
|
return n;
|
|
1938
2106
|
}
|
|
1939
2107
|
function isWrappable(e) {
|
|
1940
2108
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1941
2109
|
}
|
|
1942
|
-
let
|
|
2110
|
+
let ue = false;
|
|
1943
2111
|
function setWriteOverride(e) {
|
|
1944
|
-
|
|
2112
|
+
ue = e;
|
|
1945
2113
|
}
|
|
1946
2114
|
function writeOnly(e) {
|
|
1947
|
-
return
|
|
2115
|
+
return ue || !!fe?.has(e);
|
|
1948
2116
|
}
|
|
1949
2117
|
function getNodes(e, t) {
|
|
1950
2118
|
let n = e[t];
|
|
@@ -1964,17 +2132,17 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1964
2132
|
r
|
|
1965
2133
|
);
|
|
1966
2134
|
if (s) {
|
|
1967
|
-
u.
|
|
2135
|
+
u.ee = S;
|
|
1968
2136
|
}
|
|
1969
2137
|
if (o && t in o) {
|
|
1970
2138
|
const e = o[t];
|
|
1971
|
-
u.
|
|
1972
|
-
|
|
2139
|
+
u.pe = e === undefined ? w : e;
|
|
2140
|
+
G?.add(u);
|
|
1973
2141
|
}
|
|
1974
2142
|
return (e[t] = u);
|
|
1975
2143
|
}
|
|
1976
|
-
function trackSelf(e, t =
|
|
1977
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2144
|
+
function trackSelf(e, t = z) {
|
|
2145
|
+
getObserver() && read(getNode(getNodes(e, ee), t, undefined, e[ie], false, e[se]));
|
|
1978
2146
|
}
|
|
1979
2147
|
function getKeys(e, t, n = true) {
|
|
1980
2148
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1982,7 +2150,7 @@ function getKeys(e, t, n = true) {
|
|
|
1982
2150
|
const i = new Set(r);
|
|
1983
2151
|
const s = Reflect.ownKeys(t);
|
|
1984
2152
|
for (const e of s) {
|
|
1985
|
-
if (t[e] !==
|
|
2153
|
+
if (t[e] !== X) i.add(e);
|
|
1986
2154
|
else i.delete(e);
|
|
1987
2155
|
}
|
|
1988
2156
|
return Array.from(i);
|
|
@@ -1990,142 +2158,136 @@ function getKeys(e, t, n = true) {
|
|
|
1990
2158
|
function getPropertyDescriptor(e, t, n) {
|
|
1991
2159
|
let r = e;
|
|
1992
2160
|
if (t && n in t) {
|
|
1993
|
-
if (r[n] ===
|
|
2161
|
+
if (r[n] === X) return void 0;
|
|
1994
2162
|
if (!(n in r)) r = t;
|
|
1995
2163
|
}
|
|
1996
2164
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1997
2165
|
}
|
|
1998
|
-
let
|
|
1999
|
-
const
|
|
2166
|
+
let fe = null;
|
|
2167
|
+
const ce = {
|
|
2000
2168
|
get(e, t, n) {
|
|
2001
|
-
if (t ===
|
|
2002
|
-
if (t ===
|
|
2003
|
-
if (t === O) return e[
|
|
2004
|
-
if (t ===
|
|
2169
|
+
if (t === U) return e;
|
|
2170
|
+
if (t === J) return n;
|
|
2171
|
+
if (t === O) return e[ie];
|
|
2172
|
+
if (t === z) {
|
|
2005
2173
|
trackSelf(e);
|
|
2006
2174
|
return n;
|
|
2007
2175
|
}
|
|
2008
|
-
const r = getNodes(e,
|
|
2176
|
+
const r = getNodes(e, ee);
|
|
2009
2177
|
const i = r[t];
|
|
2010
|
-
const s = e[
|
|
2011
|
-
const o = s || (e[
|
|
2012
|
-
const u = !!e[
|
|
2013
|
-
const f = s ? e[
|
|
2178
|
+
const s = e[$] && t in e[$];
|
|
2179
|
+
const o = s || (e[Z] && t in e[Z]);
|
|
2180
|
+
const u = !!e[Y][U];
|
|
2181
|
+
const f = s ? e[$] : e[Z] && t in e[Z] ? e[Z] : e[Y];
|
|
2014
2182
|
if (!i) {
|
|
2015
2183
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
2016
2184
|
if (e && e.get) return e.get.call(n);
|
|
2017
2185
|
}
|
|
2018
2186
|
if (writeOnly(n)) {
|
|
2019
2187
|
let n =
|
|
2020
|
-
i && (o || !u)
|
|
2021
|
-
|
|
2022
|
-
? i.pe
|
|
2023
|
-
: i.ce !== S
|
|
2024
|
-
? i.ce
|
|
2025
|
-
: i.ae
|
|
2026
|
-
: f[t];
|
|
2027
|
-
n === J && (n = undefined);
|
|
2188
|
+
i && (o || !u) ? (i.ee !== undefined && i.ee !== S ? i.ee : i.Z !== S ? i.Z : i.$) : f[t];
|
|
2189
|
+
n === X && (n = undefined);
|
|
2028
2190
|
if (!isWrappable(n)) return n;
|
|
2029
2191
|
const r = wrap(n, e);
|
|
2030
|
-
|
|
2192
|
+
fe?.add(r);
|
|
2031
2193
|
return r;
|
|
2032
2194
|
}
|
|
2033
|
-
let
|
|
2034
|
-
|
|
2195
|
+
let c = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2196
|
+
c === X && (c = undefined);
|
|
2035
2197
|
if (!i) {
|
|
2036
|
-
if (!o && typeof
|
|
2198
|
+
if (!o && typeof c === "function" && !f.hasOwnProperty(t)) {
|
|
2037
2199
|
let t;
|
|
2038
|
-
return !Array.isArray(e[
|
|
2039
|
-
?
|
|
2040
|
-
:
|
|
2200
|
+
return !Array.isArray(e[Y]) && (t = Object.getPrototypeOf(e[Y])) && t !== Object.prototype
|
|
2201
|
+
? c.bind(f)
|
|
2202
|
+
: c;
|
|
2041
2203
|
} else if (getObserver()) {
|
|
2042
|
-
return read(getNode(r, t, isWrappable(
|
|
2204
|
+
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[ie], isEqual, e[se], e[m]));
|
|
2043
2205
|
}
|
|
2044
2206
|
}
|
|
2045
|
-
return isWrappable(
|
|
2207
|
+
return isWrappable(c) ? wrap(c, e) : c;
|
|
2046
2208
|
},
|
|
2047
2209
|
has(e, t) {
|
|
2048
|
-
if (t ===
|
|
2049
|
-
const n = e[
|
|
2050
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2210
|
+
if (t === J || t === z || t === "__proto__") return true;
|
|
2211
|
+
const n = e[$] && t in e[$] ? e[$][t] !== X : e[Z] && t in e[Z] ? e[Z][t] !== X : t in e[Y];
|
|
2212
|
+
getObserver() && read(getNode(getNodes(e, te), t, n, e[ie], isEqual, e[se]));
|
|
2051
2213
|
return n;
|
|
2052
2214
|
},
|
|
2053
2215
|
set(e, t, n) {
|
|
2054
|
-
const r = e[
|
|
2216
|
+
const r = e[J];
|
|
2055
2217
|
if (writeOnly(r)) {
|
|
2056
|
-
if (e[
|
|
2057
|
-
const t = e[
|
|
2058
|
-
if (t?.
|
|
2059
|
-
|
|
2218
|
+
if (e[se]) {
|
|
2219
|
+
const t = e[ie];
|
|
2220
|
+
if (t?.K) {
|
|
2221
|
+
N.initTransition(t.K);
|
|
2060
2222
|
}
|
|
2061
2223
|
}
|
|
2062
2224
|
untrack(() => {
|
|
2063
|
-
const i = e[
|
|
2225
|
+
const i = e[Y];
|
|
2064
2226
|
const s = i[t];
|
|
2065
|
-
if (
|
|
2227
|
+
if (M && typeof t !== "symbol" && !((e[ie]?.ge ?? 0) & a)) {
|
|
2066
2228
|
if (!e[m]) {
|
|
2067
2229
|
e[m] = Object.create(null);
|
|
2068
|
-
|
|
2230
|
+
G?.add(e);
|
|
2069
2231
|
}
|
|
2070
2232
|
if (!(t in e[m])) {
|
|
2071
2233
|
e[m][t] = s;
|
|
2072
2234
|
}
|
|
2073
2235
|
}
|
|
2074
|
-
const o = e[
|
|
2075
|
-
const u = o ?
|
|
2236
|
+
const o = e[se] && !j;
|
|
2237
|
+
const u = o ? $ : Z;
|
|
2076
2238
|
if (o) trackOptimisticStore(r);
|
|
2077
|
-
const f = e[
|
|
2078
|
-
const
|
|
2079
|
-
if (f ===
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2082
|
-
else (e[u] || (e[u] = Object.create(null)))[t] =
|
|
2083
|
-
const d = isWrappable(
|
|
2084
|
-
e[
|
|
2085
|
-
const p = getNodes(e,
|
|
2086
|
-
p[t] && setSignal(p[t], () => (d ? wrap(
|
|
2239
|
+
const f = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : s;
|
|
2240
|
+
const c = n?.[U]?.[Y] ?? n;
|
|
2241
|
+
if (f === c) return true;
|
|
2242
|
+
const l = e[$]?.length || e[Z]?.length || i.length;
|
|
2243
|
+
if (c !== undefined && c === s) delete e[u][t];
|
|
2244
|
+
else (e[u] || (e[u] = Object.create(null)))[t] = c;
|
|
2245
|
+
const d = isWrappable(c);
|
|
2246
|
+
e[te]?.[t] && setSignal(e[te][t], true);
|
|
2247
|
+
const p = getNodes(e, ee);
|
|
2248
|
+
p[t] && setSignal(p[t], () => (d ? wrap(c, e) : c));
|
|
2087
2249
|
if (Array.isArray(i)) {
|
|
2088
2250
|
if (t === "length") {
|
|
2089
|
-
p.length && setSignal(p.length,
|
|
2251
|
+
p.length && setSignal(p.length, c);
|
|
2090
2252
|
} else {
|
|
2091
2253
|
const e = parseInt(t) + 1;
|
|
2092
|
-
if (e >
|
|
2254
|
+
if (e > l) p.length && setSignal(p.length, e);
|
|
2093
2255
|
}
|
|
2094
2256
|
}
|
|
2095
|
-
p[
|
|
2257
|
+
p[z] && setSignal(p[z], undefined);
|
|
2096
2258
|
});
|
|
2097
2259
|
}
|
|
2098
2260
|
return true;
|
|
2099
2261
|
},
|
|
2100
2262
|
deleteProperty(e, t) {
|
|
2101
|
-
const n = e[
|
|
2102
|
-
const r = e[
|
|
2103
|
-
if (writeOnly(e[
|
|
2263
|
+
const n = e[$]?.[t] === X;
|
|
2264
|
+
const r = e[Z]?.[t] === X;
|
|
2265
|
+
if (writeOnly(e[J]) && !n && !r) {
|
|
2104
2266
|
untrack(() => {
|
|
2105
|
-
const n = e[
|
|
2106
|
-
const r = n ?
|
|
2107
|
-
if (n) trackOptimisticStore(e[
|
|
2108
|
-
const i = e[
|
|
2109
|
-
if (t in e[
|
|
2110
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2267
|
+
const n = e[se] && !j;
|
|
2268
|
+
const r = n ? $ : Z;
|
|
2269
|
+
if (n) trackOptimisticStore(e[J]);
|
|
2270
|
+
const i = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : e[Y][t];
|
|
2271
|
+
if (t in e[Y] || (e[Z] && t in e[Z])) {
|
|
2272
|
+
(e[r] || (e[r] = Object.create(null)))[t] = X;
|
|
2111
2273
|
} else if (e[r] && t in e[r]) {
|
|
2112
2274
|
delete e[r][t];
|
|
2113
2275
|
} else return true;
|
|
2114
|
-
if (e[
|
|
2115
|
-
const s = getNodes(e,
|
|
2276
|
+
if (e[te]?.[t]) setSignal(e[te][t], false);
|
|
2277
|
+
const s = getNodes(e, ee);
|
|
2116
2278
|
s[t] && setSignal(s[t], undefined);
|
|
2117
|
-
s[
|
|
2279
|
+
s[z] && setSignal(s[z], undefined);
|
|
2118
2280
|
});
|
|
2119
2281
|
}
|
|
2120
2282
|
return true;
|
|
2121
2283
|
},
|
|
2122
2284
|
ownKeys(e) {
|
|
2123
2285
|
trackSelf(e);
|
|
2124
|
-
let t = getKeys(e[
|
|
2125
|
-
if (e[
|
|
2286
|
+
let t = getKeys(e[Y], e[Z], false);
|
|
2287
|
+
if (e[$]) {
|
|
2126
2288
|
const n = new Set(t);
|
|
2127
|
-
for (const t of Reflect.ownKeys(e[
|
|
2128
|
-
if (e[
|
|
2289
|
+
for (const t of Reflect.ownKeys(e[$])) {
|
|
2290
|
+
if (e[$][t] !== X) n.add(t);
|
|
2129
2291
|
else n.delete(t);
|
|
2130
2292
|
}
|
|
2131
2293
|
t = Array.from(n);
|
|
@@ -2133,25 +2295,25 @@ const fe = {
|
|
|
2133
2295
|
return t;
|
|
2134
2296
|
},
|
|
2135
2297
|
getOwnPropertyDescriptor(e, t) {
|
|
2136
|
-
if (t ===
|
|
2137
|
-
if (e[
|
|
2138
|
-
if (e[
|
|
2139
|
-
const n = getPropertyDescriptor(e[
|
|
2298
|
+
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2299
|
+
if (e[$] && t in e[$]) {
|
|
2300
|
+
if (e[$][t] === X) return undefined;
|
|
2301
|
+
const n = getPropertyDescriptor(e[Y], e[Z], t);
|
|
2140
2302
|
if (n) {
|
|
2141
|
-
return { ...n, value: e[
|
|
2303
|
+
return { ...n, value: e[$][t] };
|
|
2142
2304
|
}
|
|
2143
|
-
return { value: e[
|
|
2305
|
+
return { value: e[$][t], writable: true, enumerable: true, configurable: true };
|
|
2144
2306
|
}
|
|
2145
|
-
return getPropertyDescriptor(e[
|
|
2307
|
+
return getPropertyDescriptor(e[Y], e[Z], t);
|
|
2146
2308
|
},
|
|
2147
2309
|
getPrototypeOf(e) {
|
|
2148
|
-
return Object.getPrototypeOf(e[
|
|
2310
|
+
return Object.getPrototypeOf(e[Y]);
|
|
2149
2311
|
}
|
|
2150
2312
|
};
|
|
2151
2313
|
function storeSetter(e, t) {
|
|
2152
|
-
const n =
|
|
2153
|
-
|
|
2154
|
-
|
|
2314
|
+
const n = fe;
|
|
2315
|
+
fe = new Set();
|
|
2316
|
+
fe.add(e);
|
|
2155
2317
|
try {
|
|
2156
2318
|
const n = t(e);
|
|
2157
2319
|
if (n !== e && n !== undefined) {
|
|
@@ -2167,8 +2329,8 @@ function storeSetter(e, t) {
|
|
|
2167
2329
|
}
|
|
2168
2330
|
}
|
|
2169
2331
|
} finally {
|
|
2170
|
-
|
|
2171
|
-
|
|
2332
|
+
fe.clear();
|
|
2333
|
+
fe = n;
|
|
2172
2334
|
}
|
|
2173
2335
|
}
|
|
2174
2336
|
function createStore(e, t, n) {
|
|
@@ -2177,7 +2339,7 @@ function createStore(e, t, n) {
|
|
|
2177
2339
|
return [i, e => storeSetter(i, e)];
|
|
2178
2340
|
}
|
|
2179
2341
|
function createOptimisticStore(e, t, n) {
|
|
2180
|
-
GlobalQueue.
|
|
2342
|
+
GlobalQueue.fe ||= clearOptimisticStore;
|
|
2181
2343
|
const r = typeof e === "function";
|
|
2182
2344
|
const i = (r ? t : e) ?? {};
|
|
2183
2345
|
const s = r ? e : undefined;
|
|
@@ -2185,39 +2347,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2185
2347
|
return [o, e => storeSetter(o, e)];
|
|
2186
2348
|
}
|
|
2187
2349
|
function clearOptimisticStore(e) {
|
|
2188
|
-
const t = e[
|
|
2189
|
-
if (!t || !t[
|
|
2190
|
-
const n = t[
|
|
2191
|
-
const r = t[
|
|
2350
|
+
const t = e[U];
|
|
2351
|
+
if (!t || !t[$]) return;
|
|
2352
|
+
const n = t[$];
|
|
2353
|
+
const r = t[ee];
|
|
2192
2354
|
setProjectionWriteActive(true);
|
|
2193
2355
|
try {
|
|
2194
2356
|
if (r) {
|
|
2195
2357
|
for (const e of Reflect.ownKeys(n)) {
|
|
2196
2358
|
if (r[e]) {
|
|
2197
|
-
r[e].
|
|
2198
|
-
const n = t[
|
|
2199
|
-
const i = n ===
|
|
2359
|
+
r[e].Y = undefined;
|
|
2360
|
+
const n = t[Z] && e in t[Z] ? t[Z][e] : t[Y][e];
|
|
2361
|
+
const i = n === X ? undefined : n;
|
|
2200
2362
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2201
2363
|
}
|
|
2202
2364
|
}
|
|
2203
|
-
if (r[
|
|
2204
|
-
r[
|
|
2205
|
-
setSignal(r[
|
|
2365
|
+
if (r[z]) {
|
|
2366
|
+
r[z].Y = undefined;
|
|
2367
|
+
setSignal(r[z], undefined);
|
|
2206
2368
|
}
|
|
2207
2369
|
}
|
|
2208
2370
|
} finally {
|
|
2209
2371
|
setProjectionWriteActive(false);
|
|
2210
2372
|
}
|
|
2211
|
-
delete t[
|
|
2373
|
+
delete t[$];
|
|
2212
2374
|
}
|
|
2213
2375
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2214
2376
|
let r;
|
|
2215
2377
|
const i = new WeakMap();
|
|
2216
2378
|
const wrapper = e => {
|
|
2217
|
-
e[
|
|
2218
|
-
e[
|
|
2219
|
-
e[
|
|
2220
|
-
Object.defineProperty(e,
|
|
2379
|
+
e[ne] = wrapProjection;
|
|
2380
|
+
e[re] = i;
|
|
2381
|
+
e[se] = true;
|
|
2382
|
+
Object.defineProperty(e, ie, {
|
|
2221
2383
|
get() {
|
|
2222
2384
|
return r;
|
|
2223
2385
|
},
|
|
@@ -2226,8 +2388,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2226
2388
|
};
|
|
2227
2389
|
const wrapProjection = e => {
|
|
2228
2390
|
if (i.has(e)) return i.get(e);
|
|
2229
|
-
if (e[
|
|
2230
|
-
const t = createStoreProxy(e,
|
|
2391
|
+
if (e[U]?.[ne] === wrapProjection) return e;
|
|
2392
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
2231
2393
|
i.set(e, t);
|
|
2232
2394
|
return t;
|
|
2233
2395
|
};
|
|
@@ -2237,7 +2399,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2237
2399
|
const t = getOwner();
|
|
2238
2400
|
setProjectionWriteActive(true);
|
|
2239
2401
|
try {
|
|
2240
|
-
storeSetter(new Proxy(s,
|
|
2402
|
+
storeSetter(new Proxy(s, K), r => {
|
|
2241
2403
|
const i = handleAsync(t, e(r), e => {
|
|
2242
2404
|
setProjectionWriteActive(true);
|
|
2243
2405
|
try {
|
|
@@ -2252,7 +2414,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2252
2414
|
setProjectionWriteActive(false);
|
|
2253
2415
|
}
|
|
2254
2416
|
});
|
|
2255
|
-
r.
|
|
2417
|
+
r.Qe = true;
|
|
2256
2418
|
}
|
|
2257
2419
|
return { store: s, node: r };
|
|
2258
2420
|
}
|
|
@@ -2310,7 +2472,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2310
2472
|
e[r] = s;
|
|
2311
2473
|
}
|
|
2312
2474
|
}
|
|
2313
|
-
const
|
|
2475
|
+
const ae = Object.assign(
|
|
2314
2476
|
function storePath(...e) {
|
|
2315
2477
|
return t => {
|
|
2316
2478
|
updatePath(t, e);
|
|
@@ -2319,41 +2481,41 @@ const ce = Object.assign(
|
|
|
2319
2481
|
{ DELETE: le }
|
|
2320
2482
|
);
|
|
2321
2483
|
function snapshotImpl(e, t, n, r) {
|
|
2322
|
-
let i, s, o, u, f,
|
|
2484
|
+
let i, s, o, u, f, c;
|
|
2323
2485
|
if (!isWrappable(e)) return e;
|
|
2324
2486
|
if (n && n.has(e)) return n.get(e);
|
|
2325
2487
|
if (!n) n = new Map();
|
|
2326
|
-
if ((i = e[
|
|
2327
|
-
if (t) trackSelf(i,
|
|
2328
|
-
o = i[
|
|
2329
|
-
s = Array.isArray(i[
|
|
2330
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
2331
|
-
e = i[
|
|
2332
|
-
r =
|
|
2488
|
+
if ((i = e[U] || r?.get(e)?.[U])) {
|
|
2489
|
+
if (t) trackSelf(i, z);
|
|
2490
|
+
o = i[Z];
|
|
2491
|
+
s = Array.isArray(i[Y]);
|
|
2492
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[Y]))) : i[Y]);
|
|
2493
|
+
e = i[Y];
|
|
2494
|
+
r = oe;
|
|
2333
2495
|
} else {
|
|
2334
2496
|
s = Array.isArray(e);
|
|
2335
2497
|
n.set(e, e);
|
|
2336
2498
|
}
|
|
2337
2499
|
if (s) {
|
|
2338
2500
|
const s = o?.length || e.length;
|
|
2339
|
-
for (let
|
|
2340
|
-
|
|
2341
|
-
if (
|
|
2342
|
-
if (t && isWrappable(
|
|
2343
|
-
if ((f = snapshotImpl(
|
|
2501
|
+
for (let l = 0; l < s; l++) {
|
|
2502
|
+
c = o && l in o ? o[l] : e[l];
|
|
2503
|
+
if (c === X) continue;
|
|
2504
|
+
if (t && isWrappable(c)) wrap(c, i);
|
|
2505
|
+
if ((f = snapshotImpl(c, t, n, r)) !== c || u) {
|
|
2344
2506
|
if (!u) n.set(e, (u = [...e]));
|
|
2345
|
-
u[
|
|
2507
|
+
u[l] = f;
|
|
2346
2508
|
}
|
|
2347
2509
|
}
|
|
2348
2510
|
} else {
|
|
2349
2511
|
const s = getKeys(e, o);
|
|
2350
|
-
for (let
|
|
2351
|
-
let a = s[
|
|
2512
|
+
for (let l = 0, a = s.length; l < a; l++) {
|
|
2513
|
+
let a = s[l];
|
|
2352
2514
|
const d = getPropertyDescriptor(e, o, a);
|
|
2353
2515
|
if (d.get) continue;
|
|
2354
|
-
|
|
2355
|
-
if (t && isWrappable(
|
|
2356
|
-
if ((f = snapshotImpl(
|
|
2516
|
+
c = o && a in o ? o[a] : e[a];
|
|
2517
|
+
if (t && isWrappable(c)) wrap(c, i);
|
|
2518
|
+
if ((f = snapshotImpl(c, t, n, r)) !== e[a] || u) {
|
|
2357
2519
|
if (!u) {
|
|
2358
2520
|
u = Object.create(Object.getPrototypeOf(e));
|
|
2359
2521
|
Object.assign(u, e);
|
|
@@ -2373,13 +2535,13 @@ function deep(e) {
|
|
|
2373
2535
|
function trueFn() {
|
|
2374
2536
|
return true;
|
|
2375
2537
|
}
|
|
2376
|
-
const
|
|
2538
|
+
const de = {
|
|
2377
2539
|
get(e, t, n) {
|
|
2378
|
-
if (t ===
|
|
2540
|
+
if (t === J) return n;
|
|
2379
2541
|
return e.get(t);
|
|
2380
2542
|
},
|
|
2381
2543
|
has(e, t) {
|
|
2382
|
-
if (t ===
|
|
2544
|
+
if (t === J) return true;
|
|
2383
2545
|
return e.has(t);
|
|
2384
2546
|
},
|
|
2385
2547
|
set: trueFn,
|
|
@@ -2402,15 +2564,15 @@ const ae = {
|
|
|
2402
2564
|
function resolveSource(e) {
|
|
2403
2565
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2404
2566
|
}
|
|
2405
|
-
const
|
|
2567
|
+
const pe = Symbol(0);
|
|
2406
2568
|
function merge(...e) {
|
|
2407
2569
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2408
2570
|
let t = false;
|
|
2409
2571
|
const n = [];
|
|
2410
2572
|
for (let r = 0; r < e.length; r++) {
|
|
2411
2573
|
const i = e[r];
|
|
2412
|
-
t = t || (!!i &&
|
|
2413
|
-
const s = !!i && i[
|
|
2574
|
+
t = t || (!!i && J in i);
|
|
2575
|
+
const s = !!i && i[pe];
|
|
2414
2576
|
if (s) n.push(...s);
|
|
2415
2577
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2416
2578
|
}
|
|
@@ -2418,7 +2580,7 @@ function merge(...e) {
|
|
|
2418
2580
|
return new Proxy(
|
|
2419
2581
|
{
|
|
2420
2582
|
get(e) {
|
|
2421
|
-
if (e ===
|
|
2583
|
+
if (e === pe) return n;
|
|
2422
2584
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2423
2585
|
const r = resolveSource(n[t]);
|
|
2424
2586
|
if (e in r) return r[e];
|
|
@@ -2436,7 +2598,7 @@ function merge(...e) {
|
|
|
2436
2598
|
return [...new Set(e)];
|
|
2437
2599
|
}
|
|
2438
2600
|
},
|
|
2439
|
-
|
|
2601
|
+
de
|
|
2440
2602
|
);
|
|
2441
2603
|
}
|
|
2442
2604
|
const r = Object.create(null);
|
|
@@ -2468,12 +2630,12 @@ function merge(...e) {
|
|
|
2468
2630
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2469
2631
|
else o[t] = n.value;
|
|
2470
2632
|
}
|
|
2471
|
-
o[
|
|
2633
|
+
o[pe] = n;
|
|
2472
2634
|
return o;
|
|
2473
2635
|
}
|
|
2474
2636
|
function omit(e, ...t) {
|
|
2475
2637
|
const n = new Set(t);
|
|
2476
|
-
if (b &&
|
|
2638
|
+
if (b && J in e) {
|
|
2477
2639
|
return new Proxy(
|
|
2478
2640
|
{
|
|
2479
2641
|
get(t) {
|
|
@@ -2486,7 +2648,7 @@ function omit(e, ...t) {
|
|
|
2486
2648
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2487
2649
|
}
|
|
2488
2650
|
},
|
|
2489
|
-
|
|
2651
|
+
de
|
|
2490
2652
|
);
|
|
2491
2653
|
}
|
|
2492
2654
|
const r = {};
|
|
@@ -2506,279 +2668,282 @@ function mapArray(e, t, n) {
|
|
|
2506
2668
|
const s = t;
|
|
2507
2669
|
return createMemo(
|
|
2508
2670
|
updateKeyedMap.bind({
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2671
|
+
ze: createOwner(),
|
|
2672
|
+
Ue: 0,
|
|
2673
|
+
Je: e,
|
|
2674
|
+
Xe: [],
|
|
2675
|
+
Ye: s,
|
|
2676
|
+
Ze: [],
|
|
2677
|
+
$e: [],
|
|
2678
|
+
et: r,
|
|
2679
|
+
tt: r || n?.keyed === false ? [] : undefined,
|
|
2680
|
+
nt: i ? [] : undefined,
|
|
2681
|
+
rt: n?.fallback
|
|
2520
2682
|
})
|
|
2521
2683
|
);
|
|
2522
2684
|
}
|
|
2523
|
-
const
|
|
2685
|
+
const he = { pureWrite: true };
|
|
2524
2686
|
function updateKeyedMap() {
|
|
2525
|
-
const e = this.
|
|
2687
|
+
const e = this.Je() || [],
|
|
2526
2688
|
t = e.length;
|
|
2527
|
-
e[
|
|
2528
|
-
runWithOwner(this.
|
|
2689
|
+
e[z];
|
|
2690
|
+
runWithOwner(this.ze, () => {
|
|
2529
2691
|
let n,
|
|
2530
2692
|
r,
|
|
2531
|
-
i = this.
|
|
2693
|
+
i = this.tt
|
|
2532
2694
|
? () => {
|
|
2533
|
-
this.
|
|
2534
|
-
this.
|
|
2535
|
-
return this.
|
|
2695
|
+
this.tt[r] = signal(e[r], he);
|
|
2696
|
+
this.nt && (this.nt[r] = signal(r, he));
|
|
2697
|
+
return this.Ye(accessor(this.tt[r]), this.nt ? accessor(this.nt[r]) : undefined);
|
|
2536
2698
|
}
|
|
2537
|
-
: this.
|
|
2699
|
+
: this.nt
|
|
2538
2700
|
? () => {
|
|
2539
2701
|
const t = e[r];
|
|
2540
|
-
this.
|
|
2541
|
-
return this.
|
|
2702
|
+
this.nt[r] = signal(r, he);
|
|
2703
|
+
return this.Ye(() => t, accessor(this.nt[r]));
|
|
2542
2704
|
}
|
|
2543
2705
|
: () => {
|
|
2544
2706
|
const t = e[r];
|
|
2545
|
-
return this.
|
|
2707
|
+
return this.Ye(() => t);
|
|
2546
2708
|
};
|
|
2547
2709
|
if (t === 0) {
|
|
2548
|
-
if (this.
|
|
2549
|
-
this.
|
|
2550
|
-
this
|
|
2551
|
-
this.
|
|
2552
|
-
this.
|
|
2553
|
-
this.
|
|
2554
|
-
this.
|
|
2555
|
-
this.
|
|
2556
|
-
}
|
|
2557
|
-
if (this.
|
|
2558
|
-
this.
|
|
2559
|
-
}
|
|
2560
|
-
} else if (this.
|
|
2561
|
-
if (this
|
|
2562
|
-
this.
|
|
2710
|
+
if (this.Ue !== 0) {
|
|
2711
|
+
this.ze.dispose(false);
|
|
2712
|
+
this.$e = [];
|
|
2713
|
+
this.Xe = [];
|
|
2714
|
+
this.Ze = [];
|
|
2715
|
+
this.Ue = 0;
|
|
2716
|
+
this.tt && (this.tt = []);
|
|
2717
|
+
this.nt && (this.nt = []);
|
|
2718
|
+
}
|
|
2719
|
+
if (this.rt && !this.Ze[0]) {
|
|
2720
|
+
this.Ze[0] = runWithOwner((this.$e[0] = createOwner()), this.rt);
|
|
2721
|
+
}
|
|
2722
|
+
} else if (this.Ue === 0) {
|
|
2723
|
+
if (this.$e[0]) this.$e[0].dispose();
|
|
2724
|
+
this.Ze = new Array(t);
|
|
2563
2725
|
for (r = 0; r < t; r++) {
|
|
2564
|
-
this.
|
|
2565
|
-
this.
|
|
2726
|
+
this.Xe[r] = e[r];
|
|
2727
|
+
this.Ze[r] = runWithOwner((this.$e[r] = createOwner()), i);
|
|
2566
2728
|
}
|
|
2567
|
-
this.
|
|
2729
|
+
this.Ue = t;
|
|
2568
2730
|
} else {
|
|
2569
2731
|
let s,
|
|
2570
2732
|
o,
|
|
2571
2733
|
u,
|
|
2572
2734
|
f,
|
|
2573
|
-
l,
|
|
2574
2735
|
c,
|
|
2736
|
+
l,
|
|
2575
2737
|
a,
|
|
2576
2738
|
d = new Array(t),
|
|
2577
2739
|
p = new Array(t),
|
|
2578
|
-
h = this.
|
|
2579
|
-
|
|
2740
|
+
h = this.tt ? new Array(t) : undefined,
|
|
2741
|
+
g = this.nt ? new Array(t) : undefined;
|
|
2580
2742
|
for (
|
|
2581
|
-
s = 0, o = Math.min(this.
|
|
2582
|
-
s < o && (this.
|
|
2743
|
+
s = 0, o = Math.min(this.Ue, t);
|
|
2744
|
+
s < o && (this.Xe[s] === e[s] || (this.tt && compare(this.et, this.Xe[s], e[s])));
|
|
2583
2745
|
s++
|
|
2584
2746
|
) {
|
|
2585
|
-
if (this.
|
|
2747
|
+
if (this.tt) setSignal(this.tt[s], e[s]);
|
|
2586
2748
|
}
|
|
2587
2749
|
for (
|
|
2588
|
-
o = this.
|
|
2750
|
+
o = this.Ue - 1, u = t - 1;
|
|
2589
2751
|
o >= s &&
|
|
2590
2752
|
u >= s &&
|
|
2591
|
-
(this.
|
|
2753
|
+
(this.Xe[o] === e[u] || (this.tt && compare(this.et, this.Xe[o], e[u])));
|
|
2592
2754
|
o--, u--
|
|
2593
2755
|
) {
|
|
2594
|
-
d[u] = this.
|
|
2595
|
-
p[u] = this
|
|
2596
|
-
h && (h[u] = this.
|
|
2597
|
-
|
|
2756
|
+
d[u] = this.Ze[o];
|
|
2757
|
+
p[u] = this.$e[o];
|
|
2758
|
+
h && (h[u] = this.tt[o]);
|
|
2759
|
+
g && (g[u] = this.nt[o]);
|
|
2598
2760
|
}
|
|
2599
|
-
|
|
2761
|
+
l = new Map();
|
|
2600
2762
|
a = new Array(u + 1);
|
|
2601
2763
|
for (r = u; r >= s; r--) {
|
|
2602
2764
|
f = e[r];
|
|
2603
|
-
|
|
2604
|
-
n =
|
|
2765
|
+
c = this.et ? this.et(f) : f;
|
|
2766
|
+
n = l.get(c);
|
|
2605
2767
|
a[r] = n === undefined ? -1 : n;
|
|
2606
|
-
|
|
2768
|
+
l.set(c, r);
|
|
2607
2769
|
}
|
|
2608
2770
|
for (n = s; n <= o; n++) {
|
|
2609
|
-
f = this.
|
|
2610
|
-
|
|
2611
|
-
r =
|
|
2771
|
+
f = this.Xe[n];
|
|
2772
|
+
c = this.et ? this.et(f) : f;
|
|
2773
|
+
r = l.get(c);
|
|
2612
2774
|
if (r !== undefined && r !== -1) {
|
|
2613
|
-
d[r] = this.
|
|
2614
|
-
p[r] = this
|
|
2615
|
-
h && (h[r] = this.
|
|
2616
|
-
|
|
2775
|
+
d[r] = this.Ze[n];
|
|
2776
|
+
p[r] = this.$e[n];
|
|
2777
|
+
h && (h[r] = this.tt[n]);
|
|
2778
|
+
g && (g[r] = this.nt[n]);
|
|
2617
2779
|
r = a[r];
|
|
2618
|
-
|
|
2619
|
-
} else this
|
|
2780
|
+
l.set(c, r);
|
|
2781
|
+
} else this.$e[n].dispose();
|
|
2620
2782
|
}
|
|
2621
2783
|
for (r = s; r < t; r++) {
|
|
2622
2784
|
if (r in d) {
|
|
2623
|
-
this.
|
|
2624
|
-
this
|
|
2785
|
+
this.Ze[r] = d[r];
|
|
2786
|
+
this.$e[r] = p[r];
|
|
2625
2787
|
if (h) {
|
|
2626
|
-
this.
|
|
2627
|
-
setSignal(this.
|
|
2788
|
+
this.tt[r] = h[r];
|
|
2789
|
+
setSignal(this.tt[r], e[r]);
|
|
2628
2790
|
}
|
|
2629
|
-
if (
|
|
2630
|
-
this.
|
|
2631
|
-
setSignal(this.
|
|
2791
|
+
if (g) {
|
|
2792
|
+
this.nt[r] = g[r];
|
|
2793
|
+
setSignal(this.nt[r], r);
|
|
2632
2794
|
}
|
|
2633
2795
|
} else {
|
|
2634
|
-
this.
|
|
2796
|
+
this.Ze[r] = runWithOwner((this.$e[r] = createOwner()), i);
|
|
2635
2797
|
}
|
|
2636
2798
|
}
|
|
2637
|
-
this.
|
|
2638
|
-
this.
|
|
2799
|
+
this.Ze = this.Ze.slice(0, (this.Ue = t));
|
|
2800
|
+
this.Xe = e.slice(0);
|
|
2639
2801
|
}
|
|
2640
2802
|
});
|
|
2641
|
-
return this.
|
|
2803
|
+
return this.Ze;
|
|
2642
2804
|
}
|
|
2643
2805
|
function repeat(e, t, n) {
|
|
2644
2806
|
const r = t;
|
|
2645
2807
|
return updateRepeat.bind({
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2808
|
+
ze: createOwner(),
|
|
2809
|
+
Ue: 0,
|
|
2810
|
+
it: 0,
|
|
2811
|
+
st: e,
|
|
2812
|
+
Ye: r,
|
|
2813
|
+
$e: [],
|
|
2814
|
+
Ze: [],
|
|
2815
|
+
ot: n?.from,
|
|
2816
|
+
rt: n?.fallback
|
|
2655
2817
|
});
|
|
2656
2818
|
}
|
|
2657
2819
|
function updateRepeat() {
|
|
2658
|
-
const e = this.
|
|
2659
|
-
const t = this.
|
|
2660
|
-
runWithOwner(this.
|
|
2820
|
+
const e = this.st();
|
|
2821
|
+
const t = this.ot?.() || 0;
|
|
2822
|
+
runWithOwner(this.ze, () => {
|
|
2661
2823
|
if (e === 0) {
|
|
2662
|
-
if (this.
|
|
2663
|
-
this.
|
|
2664
|
-
this
|
|
2665
|
-
this.
|
|
2666
|
-
this.
|
|
2824
|
+
if (this.Ue !== 0) {
|
|
2825
|
+
this.ze.dispose(false);
|
|
2826
|
+
this.$e = [];
|
|
2827
|
+
this.Ze = [];
|
|
2828
|
+
this.Ue = 0;
|
|
2667
2829
|
}
|
|
2668
|
-
if (this.
|
|
2669
|
-
this.
|
|
2830
|
+
if (this.rt && !this.Ze[0]) {
|
|
2831
|
+
this.Ze[0] = runWithOwner((this.$e[0] = createOwner()), this.rt);
|
|
2670
2832
|
}
|
|
2671
2833
|
return;
|
|
2672
2834
|
}
|
|
2673
2835
|
const n = t + e;
|
|
2674
|
-
const r = this
|
|
2675
|
-
if (this.
|
|
2676
|
-
for (let e = n; e < r; e++) this
|
|
2677
|
-
if (this
|
|
2678
|
-
let e = this
|
|
2679
|
-
while (e < t && e < this.
|
|
2680
|
-
this.
|
|
2681
|
-
this.
|
|
2682
|
-
} else if (this
|
|
2683
|
-
let n = r - this
|
|
2684
|
-
let i = this
|
|
2685
|
-
this.
|
|
2836
|
+
const r = this.it + this.Ue;
|
|
2837
|
+
if (this.Ue === 0 && this.$e[0]) this.$e[0].dispose();
|
|
2838
|
+
for (let e = n; e < r; e++) this.$e[e - this.it].dispose();
|
|
2839
|
+
if (this.it < t) {
|
|
2840
|
+
let e = this.it;
|
|
2841
|
+
while (e < t && e < this.Ue) this.$e[e++].dispose();
|
|
2842
|
+
this.$e.splice(0, t - this.it);
|
|
2843
|
+
this.Ze.splice(0, t - this.it);
|
|
2844
|
+
} else if (this.it > t) {
|
|
2845
|
+
let n = r - this.it - 1;
|
|
2846
|
+
let i = this.it - t;
|
|
2847
|
+
this.$e.length = this.Ze.length = e;
|
|
2686
2848
|
while (n >= i) {
|
|
2687
|
-
this
|
|
2688
|
-
this.
|
|
2849
|
+
this.$e[n] = this.$e[n - i];
|
|
2850
|
+
this.Ze[n] = this.Ze[n - i];
|
|
2689
2851
|
n--;
|
|
2690
2852
|
}
|
|
2691
2853
|
for (let e = 0; e < i; e++) {
|
|
2692
|
-
this.
|
|
2854
|
+
this.Ze[e] = runWithOwner((this.$e[e] = createOwner()), () => this.Ye(e + t));
|
|
2693
2855
|
}
|
|
2694
2856
|
}
|
|
2695
2857
|
for (let e = r; e < n; e++) {
|
|
2696
|
-
this.
|
|
2858
|
+
this.Ze[e - t] = runWithOwner((this.$e[e - t] = createOwner()), () => this.Ye(e));
|
|
2697
2859
|
}
|
|
2698
|
-
this.
|
|
2699
|
-
this
|
|
2700
|
-
this.
|
|
2860
|
+
this.Ze = this.Ze.slice(0, e);
|
|
2861
|
+
this.it = t;
|
|
2862
|
+
this.Ue = e;
|
|
2701
2863
|
});
|
|
2702
|
-
return this.
|
|
2864
|
+
return this.Ze;
|
|
2703
2865
|
}
|
|
2704
2866
|
function compare(e, t, n) {
|
|
2705
2867
|
return e ? e(t) === e(n) : true;
|
|
2706
2868
|
}
|
|
2707
2869
|
function boundaryComputed(e, t) {
|
|
2708
2870
|
const n = computed(e, undefined, { lazy: true });
|
|
2709
|
-
n.
|
|
2710
|
-
const r = e !== undefined ? e : n.
|
|
2711
|
-
const i = t !== undefined ? t : n.
|
|
2712
|
-
n.
|
|
2713
|
-
n.
|
|
2871
|
+
n.ve = (e, t) => {
|
|
2872
|
+
const r = e !== undefined ? e : n.ge;
|
|
2873
|
+
const i = t !== undefined ? t : n.ae;
|
|
2874
|
+
n.ge &= ~n.ut;
|
|
2875
|
+
n.B.notify(n, n.ut, r, i);
|
|
2714
2876
|
};
|
|
2715
|
-
n.
|
|
2716
|
-
n.
|
|
2877
|
+
n.ut = t;
|
|
2878
|
+
n.Qe = true;
|
|
2717
2879
|
recompute(n, true);
|
|
2718
2880
|
return n;
|
|
2719
2881
|
}
|
|
2720
2882
|
function createBoundChildren(e, t, n, r) {
|
|
2721
|
-
const i = e.
|
|
2722
|
-
i.addChild((e.
|
|
2723
|
-
onCleanup(() => i.removeChild(e.
|
|
2883
|
+
const i = e.B;
|
|
2884
|
+
i.addChild((e.B = n));
|
|
2885
|
+
onCleanup(() => i.removeChild(e.B));
|
|
2724
2886
|
return runWithOwner(e, () => {
|
|
2725
2887
|
const e = computed(t);
|
|
2726
2888
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2727
2889
|
});
|
|
2728
2890
|
}
|
|
2729
|
-
const
|
|
2891
|
+
const ge = Symbol();
|
|
2730
2892
|
class CollectionQueue extends Queue {
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2893
|
+
ft;
|
|
2894
|
+
ct = new Set();
|
|
2895
|
+
lt = signal(false, { pureWrite: true, De: true });
|
|
2896
|
+
dt = false;
|
|
2897
|
+
ht;
|
|
2898
|
+
gt = ge;
|
|
2737
2899
|
constructor(e) {
|
|
2738
2900
|
super();
|
|
2739
|
-
this.
|
|
2901
|
+
this.ft = e;
|
|
2740
2902
|
}
|
|
2741
2903
|
run(e) {
|
|
2742
|
-
if (!e || read(this.
|
|
2904
|
+
if (!e || read(this.lt)) return;
|
|
2743
2905
|
return super.run(e);
|
|
2744
2906
|
}
|
|
2745
2907
|
notify(e, t, n, r) {
|
|
2746
|
-
if (!(t & this.
|
|
2747
|
-
if (this.
|
|
2908
|
+
if (!(t & this.ft)) return super.notify(e, t, n, r);
|
|
2909
|
+
if (this.dt && this.ht) {
|
|
2748
2910
|
const e = untrack(() => {
|
|
2749
2911
|
try {
|
|
2750
|
-
return this.
|
|
2912
|
+
return this.ht();
|
|
2751
2913
|
} catch {
|
|
2752
|
-
return
|
|
2914
|
+
return ge;
|
|
2753
2915
|
}
|
|
2754
2916
|
});
|
|
2755
|
-
if (e !== this.
|
|
2756
|
-
this.
|
|
2757
|
-
this.
|
|
2758
|
-
this.
|
|
2917
|
+
if (e !== this.gt) {
|
|
2918
|
+
this.gt = e;
|
|
2919
|
+
this.dt = false;
|
|
2920
|
+
this.ct.clear();
|
|
2759
2921
|
}
|
|
2760
2922
|
}
|
|
2761
|
-
if (this.
|
|
2762
|
-
if (n &
|
|
2763
|
-
|
|
2923
|
+
if (this.ft & a && this.dt) return super.notify(e, t, n, r);
|
|
2924
|
+
if (this.ft & a && n & d) {
|
|
2925
|
+
return super.notify(e, d, n, r);
|
|
2926
|
+
}
|
|
2927
|
+
if (n & this.ft) {
|
|
2928
|
+
const t = r?.source || e.ae?.source;
|
|
2764
2929
|
if (t) {
|
|
2765
|
-
const e = this.
|
|
2766
|
-
this.
|
|
2767
|
-
if (e) setSignal(this.
|
|
2930
|
+
const e = this.ct.size === 0;
|
|
2931
|
+
this.ct.add(t);
|
|
2932
|
+
if (e) setSignal(this.lt, true);
|
|
2768
2933
|
}
|
|
2769
2934
|
}
|
|
2770
|
-
t &= ~this.
|
|
2935
|
+
t &= ~this.ft;
|
|
2771
2936
|
return t ? super.notify(e, t, n, r) : true;
|
|
2772
2937
|
}
|
|
2773
2938
|
checkSources() {
|
|
2774
|
-
for (const e of this.
|
|
2775
|
-
if (!(e.
|
|
2939
|
+
for (const e of this.ct) {
|
|
2940
|
+
if (!(e.ge & this.ft) && !(this.ft & d && e.ge & a)) this.ct.delete(e);
|
|
2776
2941
|
}
|
|
2777
|
-
if (!this.
|
|
2778
|
-
setSignal(this.
|
|
2779
|
-
if (this.
|
|
2942
|
+
if (!this.ct.size) {
|
|
2943
|
+
setSignal(this.lt, false);
|
|
2944
|
+
if (this.ht) {
|
|
2780
2945
|
try {
|
|
2781
|
-
this.
|
|
2946
|
+
this.gt = untrack(() => this.ht());
|
|
2782
2947
|
} catch {}
|
|
2783
2948
|
}
|
|
2784
2949
|
}
|
|
@@ -2787,13 +2952,13 @@ class CollectionQueue extends Queue {
|
|
|
2787
2952
|
function createCollectionBoundary(e, t, n, r) {
|
|
2788
2953
|
const i = createOwner();
|
|
2789
2954
|
const s = new CollectionQueue(e);
|
|
2790
|
-
if (r) s.
|
|
2955
|
+
if (r) s.ht = r;
|
|
2791
2956
|
const o = createBoundChildren(i, t, s, e);
|
|
2792
2957
|
const u = computed(() => {
|
|
2793
|
-
if (!read(s.
|
|
2958
|
+
if (!read(s.lt)) {
|
|
2794
2959
|
const e = read(o);
|
|
2795
|
-
if (!untrack(() => read(s.
|
|
2796
|
-
s.
|
|
2960
|
+
if (!untrack(() => read(s.lt))) {
|
|
2961
|
+
s.dt = true;
|
|
2797
2962
|
return e;
|
|
2798
2963
|
}
|
|
2799
2964
|
}
|
|
@@ -2806,10 +2971,10 @@ function createLoadingBoundary(e, t, n) {
|
|
|
2806
2971
|
}
|
|
2807
2972
|
function createErrorBoundary(e, t) {
|
|
2808
2973
|
return createCollectionBoundary(d, e, e => {
|
|
2809
|
-
let n = e.
|
|
2810
|
-
const r = n.
|
|
2974
|
+
let n = e.ct.values().next().value;
|
|
2975
|
+
const r = n.ae?.cause ?? n.ae;
|
|
2811
2976
|
return t(r, () => {
|
|
2812
|
-
for (const t of e.
|
|
2977
|
+
for (const t of e.ct) recompute(t);
|
|
2813
2978
|
schedule();
|
|
2814
2979
|
});
|
|
2815
2980
|
});
|
|
@@ -2863,10 +3028,10 @@ function flattenArray(e, t = [], n) {
|
|
|
2863
3028
|
if (r) throw r;
|
|
2864
3029
|
return i;
|
|
2865
3030
|
}
|
|
2866
|
-
exports.$PROXY =
|
|
3031
|
+
exports.$PROXY = J;
|
|
2867
3032
|
exports.$REFRESH = O;
|
|
2868
|
-
exports.$TARGET =
|
|
2869
|
-
exports.$TRACK =
|
|
3033
|
+
exports.$TARGET = U;
|
|
3034
|
+
exports.$TRACK = z;
|
|
2870
3035
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2871
3036
|
exports.NoOwnerError = NoOwnerError;
|
|
2872
3037
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2919,5 +3084,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
2919
3084
|
exports.setContext = setContext;
|
|
2920
3085
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2921
3086
|
exports.snapshot = snapshot;
|
|
2922
|
-
exports.storePath =
|
|
3087
|
+
exports.storePath = ae;
|
|
2923
3088
|
exports.untrack = untrack;
|