@solidjs/signals 0.13.11 → 0.13.13
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 +323 -91
- package/dist/node.cjs +1150 -1139
- package/dist/prod.js +827 -810
- package/dist/types/core/dev.d.ts +26 -0
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/scheduler.d.ts +1 -1
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -38,13 +38,13 @@ const a = 1 << 0;
|
|
|
38
38
|
const d = 1 << 1;
|
|
39
39
|
const h = 1 << 2;
|
|
40
40
|
const p = 1;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const y = 2;
|
|
42
|
+
const g = 3;
|
|
43
43
|
const S = {};
|
|
44
44
|
const w = {};
|
|
45
45
|
const m = "sp";
|
|
46
|
-
const
|
|
47
|
-
const
|
|
46
|
+
const b = typeof Proxy === "function";
|
|
47
|
+
const _ = {};
|
|
48
48
|
const O = Symbol("refresh");
|
|
49
49
|
function actualInsertIntoHeap(e, t) {
|
|
50
50
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
@@ -117,12 +117,12 @@ function markNode(e, r = n) {
|
|
|
117
117
|
}
|
|
118
118
|
function runHeap(e, t) {
|
|
119
119
|
e._ = false;
|
|
120
|
-
for (e.
|
|
121
|
-
let n = e.l[e.
|
|
120
|
+
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
121
|
+
let n = e.l[e.j];
|
|
122
122
|
while (n !== undefined) {
|
|
123
123
|
if (n.m & i) t(n);
|
|
124
124
|
else adjustHeight(n, e);
|
|
125
|
-
n = e.l[e.
|
|
125
|
+
n = e.l[e.j];
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
e.S = 0;
|
|
@@ -130,7 +130,7 @@ 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.A; t; t = t.N) {
|
|
134
134
|
const e = t.R;
|
|
135
135
|
const r = e.L || e;
|
|
136
136
|
if (r.I && r.o >= n) n = r.o + 1;
|
|
@@ -142,66 +142,25 @@ function adjustHeight(e, t) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const x =
|
|
146
|
-
const v =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
function getChildren(e) {
|
|
155
|
-
const t = [];
|
|
156
|
-
let n = e.T;
|
|
157
|
-
while (n) {
|
|
158
|
-
t.push(n);
|
|
159
|
-
n = n.H;
|
|
160
|
-
}
|
|
161
|
-
return t;
|
|
162
|
-
}
|
|
163
|
-
function getSignals(e) {
|
|
164
|
-
return e.q ? [...e.q] : [];
|
|
165
|
-
}
|
|
166
|
-
function getParent(e) {
|
|
167
|
-
return e.i;
|
|
168
|
-
}
|
|
169
|
-
function getSources(e) {
|
|
170
|
-
const t = [];
|
|
171
|
-
let n = e.N;
|
|
172
|
-
while (n) {
|
|
173
|
-
t.push(n.R);
|
|
174
|
-
n = n.j;
|
|
175
|
-
}
|
|
176
|
-
return t;
|
|
177
|
-
}
|
|
178
|
-
function getObservers(e) {
|
|
179
|
-
const t = [];
|
|
180
|
-
let n = e.O;
|
|
181
|
-
while (n) {
|
|
182
|
-
t.push(n.k);
|
|
183
|
-
n = n.P;
|
|
184
|
-
}
|
|
185
|
-
return t;
|
|
186
|
-
}
|
|
187
|
-
const P = new Set();
|
|
188
|
-
const k = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
189
|
-
const E = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
190
|
-
let C = 0;
|
|
191
|
-
let W = null;
|
|
192
|
-
let A = false;
|
|
193
|
-
let N = false;
|
|
194
|
-
let j = null;
|
|
145
|
+
const x = undefined;
|
|
146
|
+
const v = new Set();
|
|
147
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
+
const k = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
149
|
+
let E = 0;
|
|
150
|
+
let C = null;
|
|
151
|
+
let W = false;
|
|
152
|
+
let j = false;
|
|
153
|
+
let A = null;
|
|
195
154
|
function enforceLoadingBoundary(e) {}
|
|
196
155
|
function shouldReadStashedOptimisticValue(e) {
|
|
197
|
-
return !!
|
|
156
|
+
return !!A?.has(e);
|
|
198
157
|
}
|
|
199
158
|
function runLaneEffects(e) {
|
|
200
|
-
for (const t of
|
|
201
|
-
if (t.
|
|
202
|
-
const n = t.
|
|
159
|
+
for (const t of L) {
|
|
160
|
+
if (t.T || t.H.size > 0) continue;
|
|
161
|
+
const n = t.q[e - 1];
|
|
203
162
|
if (n.length) {
|
|
204
|
-
t.
|
|
163
|
+
t.q[e - 1] = [];
|
|
205
164
|
runQueue(n, e);
|
|
206
165
|
}
|
|
207
166
|
}
|
|
@@ -209,83 +168,83 @@ function runLaneEffects(e) {
|
|
|
209
168
|
function queueStashedOptimisticEffects(e) {
|
|
210
169
|
for (let t = e.O; t !== null; t = t.P) {
|
|
211
170
|
const e = t.k;
|
|
212
|
-
if (!e.
|
|
213
|
-
if (e.
|
|
214
|
-
if (!e.
|
|
215
|
-
e.
|
|
216
|
-
e.
|
|
171
|
+
if (!e.D) continue;
|
|
172
|
+
if (e.D === g) {
|
|
173
|
+
if (!e.F) {
|
|
174
|
+
e.F = true;
|
|
175
|
+
e.M.enqueue(y, e.V);
|
|
217
176
|
}
|
|
218
177
|
continue;
|
|
219
178
|
}
|
|
220
|
-
const n = e.m & o ?
|
|
221
|
-
if (n.
|
|
179
|
+
const n = e.m & o ? k : P;
|
|
180
|
+
if (n.j > e.o) n.j = e.o;
|
|
222
181
|
insertIntoHeap(e, n);
|
|
223
182
|
}
|
|
224
183
|
}
|
|
225
184
|
function setProjectionWriteActive(e) {
|
|
226
|
-
|
|
185
|
+
j = e;
|
|
227
186
|
}
|
|
228
187
|
function mergeTransitionState(e, t) {
|
|
229
|
-
t.
|
|
230
|
-
e.
|
|
231
|
-
for (const n of
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
188
|
+
t.B = e;
|
|
189
|
+
e.K.push(...t.K);
|
|
190
|
+
for (const n of L) if (n.G === t) n.G = e;
|
|
191
|
+
e.U.push(...t.U);
|
|
192
|
+
for (const n of t.J) e.J.add(n);
|
|
193
|
+
for (const [n, r] of t.X) {
|
|
194
|
+
let t = e.X.get(n);
|
|
195
|
+
if (!t) e.X.set(n, (t = new Set()));
|
|
196
|
+
for (const e of r) t.add(e);
|
|
238
197
|
}
|
|
239
198
|
}
|
|
240
199
|
function resolveOptimisticNodes(e) {
|
|
241
200
|
for (let t = 0; t < e.length; t++) {
|
|
242
201
|
const n = e[t];
|
|
243
|
-
n.
|
|
244
|
-
if (n.
|
|
245
|
-
n
|
|
246
|
-
n.
|
|
202
|
+
n.Y = undefined;
|
|
203
|
+
if (n.Z !== S) {
|
|
204
|
+
n.$ = n.Z;
|
|
205
|
+
n.Z = S;
|
|
247
206
|
}
|
|
248
|
-
const r = n.
|
|
249
|
-
n.
|
|
250
|
-
if (r !== S && n
|
|
251
|
-
n.
|
|
207
|
+
const r = n.ee;
|
|
208
|
+
n.ee = S;
|
|
209
|
+
if (r !== S && n.$ !== r) insertSubs(n, true);
|
|
210
|
+
n.G = null;
|
|
252
211
|
}
|
|
253
212
|
e.length = 0;
|
|
254
213
|
}
|
|
255
214
|
function cleanupCompletedLanes(e) {
|
|
256
|
-
for (const t of
|
|
257
|
-
const n = e ? t.
|
|
215
|
+
for (const t of L) {
|
|
216
|
+
const n = e ? t.G === e : !t.G;
|
|
258
217
|
if (!n) continue;
|
|
259
|
-
if (!t.
|
|
260
|
-
if (t.
|
|
261
|
-
if (t.
|
|
218
|
+
if (!t.T) {
|
|
219
|
+
if (t.q[0].length) runQueue(t.q[0], p);
|
|
220
|
+
if (t.q[1].length) runQueue(t.q[1], y);
|
|
262
221
|
}
|
|
263
|
-
if (t.
|
|
264
|
-
t.
|
|
265
|
-
t.
|
|
266
|
-
t.
|
|
267
|
-
|
|
268
|
-
|
|
222
|
+
if (t.te.Y === t) t.te.Y = undefined;
|
|
223
|
+
t.H.clear();
|
|
224
|
+
t.q[0].length = 0;
|
|
225
|
+
t.q[1].length = 0;
|
|
226
|
+
L.delete(t);
|
|
227
|
+
R.delete(t.te);
|
|
269
228
|
}
|
|
270
229
|
}
|
|
271
230
|
function schedule() {
|
|
272
|
-
if (
|
|
273
|
-
|
|
274
|
-
if (!
|
|
231
|
+
if (W) return;
|
|
232
|
+
W = true;
|
|
233
|
+
if (!N.ne && !j) queueMicrotask(flush);
|
|
275
234
|
}
|
|
276
235
|
class Queue {
|
|
277
236
|
i = null;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
created =
|
|
237
|
+
re = [[], []];
|
|
238
|
+
ie = [];
|
|
239
|
+
created = E;
|
|
281
240
|
addChild(e) {
|
|
282
|
-
this.
|
|
241
|
+
this.ie.push(e);
|
|
283
242
|
e.i = this;
|
|
284
243
|
}
|
|
285
244
|
removeChild(e) {
|
|
286
|
-
const t = this.
|
|
245
|
+
const t = this.ie.indexOf(e);
|
|
287
246
|
if (t >= 0) {
|
|
288
|
-
this.
|
|
247
|
+
this.ie.splice(t, 1);
|
|
289
248
|
e.i = null;
|
|
290
249
|
}
|
|
291
250
|
}
|
|
@@ -294,124 +253,125 @@ class Queue {
|
|
|
294
253
|
return false;
|
|
295
254
|
}
|
|
296
255
|
run(e) {
|
|
297
|
-
if (this.
|
|
298
|
-
const t = this.
|
|
299
|
-
this.
|
|
256
|
+
if (this.re[e - 1].length) {
|
|
257
|
+
const t = this.re[e - 1];
|
|
258
|
+
this.re[e - 1] = [];
|
|
300
259
|
runQueue(t, e);
|
|
301
260
|
}
|
|
302
|
-
for (let t = 0; t < this.
|
|
261
|
+
for (let t = 0; t < this.ie.length; t++) this.ie[t].run?.(e);
|
|
303
262
|
}
|
|
304
263
|
enqueue(e, t) {
|
|
305
264
|
if (e) {
|
|
306
|
-
if (
|
|
307
|
-
const n = findLane(
|
|
308
|
-
n.
|
|
265
|
+
if (B) {
|
|
266
|
+
const n = findLane(B);
|
|
267
|
+
n.q[e - 1].push(t);
|
|
309
268
|
} else {
|
|
310
|
-
this.
|
|
269
|
+
this.re[e - 1].push(t);
|
|
311
270
|
}
|
|
312
271
|
}
|
|
313
272
|
schedule();
|
|
314
273
|
}
|
|
315
274
|
stashQueues(e) {
|
|
316
|
-
e.
|
|
317
|
-
e.
|
|
318
|
-
this.
|
|
319
|
-
for (let t = 0; t < this.
|
|
320
|
-
let n = this.
|
|
321
|
-
let r = e.
|
|
275
|
+
e.re[0].push(...this.re[0]);
|
|
276
|
+
e.re[1].push(...this.re[1]);
|
|
277
|
+
this.re = [[], []];
|
|
278
|
+
for (let t = 0; t < this.ie.length; t++) {
|
|
279
|
+
let n = this.ie[t];
|
|
280
|
+
let r = e.ie[t];
|
|
322
281
|
if (!r) {
|
|
323
|
-
r = {
|
|
324
|
-
e.
|
|
282
|
+
r = { re: [[], []], ie: [] };
|
|
283
|
+
e.ie[t] = r;
|
|
325
284
|
}
|
|
326
285
|
n.stashQueues(r);
|
|
327
286
|
}
|
|
328
287
|
}
|
|
329
288
|
restoreQueues(e) {
|
|
330
|
-
this.
|
|
331
|
-
this.
|
|
332
|
-
for (let t = 0; t < e.
|
|
333
|
-
const n = e.
|
|
334
|
-
let r = this.
|
|
289
|
+
this.re[0].push(...e.re[0]);
|
|
290
|
+
this.re[1].push(...e.re[1]);
|
|
291
|
+
for (let t = 0; t < e.ie.length; t++) {
|
|
292
|
+
const n = e.ie[t];
|
|
293
|
+
let r = this.ie[t];
|
|
335
294
|
if (r) r.restoreQueues(n);
|
|
336
295
|
}
|
|
337
296
|
}
|
|
338
297
|
}
|
|
339
298
|
class GlobalQueue extends Queue {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
static
|
|
345
|
-
static
|
|
346
|
-
static
|
|
299
|
+
ne = false;
|
|
300
|
+
se = [];
|
|
301
|
+
U = [];
|
|
302
|
+
J = new Set();
|
|
303
|
+
static oe;
|
|
304
|
+
static ue;
|
|
305
|
+
static fe = null;
|
|
347
306
|
flush() {
|
|
348
|
-
if (this.
|
|
349
|
-
this.
|
|
307
|
+
if (this.ne) return;
|
|
308
|
+
this.ne = true;
|
|
350
309
|
try {
|
|
351
|
-
runHeap(
|
|
352
|
-
if (
|
|
353
|
-
const e = transitionComplete(
|
|
310
|
+
runHeap(P, GlobalQueue.oe);
|
|
311
|
+
if (C) {
|
|
312
|
+
const e = transitionComplete(C);
|
|
354
313
|
if (!e) {
|
|
355
|
-
const e =
|
|
356
|
-
runHeap(
|
|
357
|
-
this.
|
|
358
|
-
this.
|
|
359
|
-
this.
|
|
314
|
+
const e = C;
|
|
315
|
+
runHeap(k, GlobalQueue.oe);
|
|
316
|
+
this.se = [];
|
|
317
|
+
this.U = [];
|
|
318
|
+
this.J = new Set();
|
|
360
319
|
runLaneEffects(p);
|
|
361
|
-
runLaneEffects(
|
|
362
|
-
this.stashQueues(e.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
reassignPendingTransition(e.
|
|
366
|
-
|
|
367
|
-
if (!e.
|
|
368
|
-
|
|
369
|
-
for (let t = 0; t < e.
|
|
370
|
-
const n = e.
|
|
371
|
-
if (n.I || n.
|
|
372
|
-
|
|
320
|
+
runLaneEffects(y);
|
|
321
|
+
this.stashQueues(e.le);
|
|
322
|
+
E++;
|
|
323
|
+
W = P.S >= P.j;
|
|
324
|
+
reassignPendingTransition(e.se);
|
|
325
|
+
C = null;
|
|
326
|
+
if (!e.K.length && e.U.length) {
|
|
327
|
+
A = new Set();
|
|
328
|
+
for (let t = 0; t < e.U.length; t++) {
|
|
329
|
+
const n = e.U[t];
|
|
330
|
+
if (n.I || n.ce) continue;
|
|
331
|
+
A.add(n);
|
|
373
332
|
queueStashedOptimisticEffects(n);
|
|
374
333
|
}
|
|
375
334
|
}
|
|
376
335
|
try {
|
|
377
336
|
finalizePureQueue(null, true);
|
|
378
337
|
} finally {
|
|
379
|
-
|
|
338
|
+
A = null;
|
|
380
339
|
}
|
|
381
340
|
return;
|
|
382
341
|
}
|
|
383
|
-
this.
|
|
384
|
-
this.restoreQueues(
|
|
385
|
-
|
|
386
|
-
const t =
|
|
387
|
-
|
|
388
|
-
reassignPendingTransition(this.
|
|
342
|
+
this.se !== C.se && this.se.push(...C.se);
|
|
343
|
+
this.restoreQueues(C.le);
|
|
344
|
+
v.delete(C);
|
|
345
|
+
const t = C;
|
|
346
|
+
C = null;
|
|
347
|
+
reassignPendingTransition(this.se);
|
|
389
348
|
finalizePureQueue(t);
|
|
390
349
|
} else {
|
|
391
|
-
if (
|
|
350
|
+
if (v.size) runHeap(k, GlobalQueue.oe);
|
|
392
351
|
finalizePureQueue();
|
|
393
352
|
}
|
|
394
|
-
|
|
395
|
-
|
|
353
|
+
E++;
|
|
354
|
+
W = P.S >= P.j;
|
|
396
355
|
runLaneEffects(p);
|
|
397
356
|
this.run(p);
|
|
398
|
-
runLaneEffects(
|
|
399
|
-
this.run(
|
|
357
|
+
runLaneEffects(y);
|
|
358
|
+
this.run(y);
|
|
400
359
|
if (false);
|
|
401
360
|
} finally {
|
|
402
|
-
this.
|
|
361
|
+
this.ne = false;
|
|
403
362
|
}
|
|
404
363
|
}
|
|
405
364
|
notify(e, t, n, r) {
|
|
406
365
|
if (t & a) {
|
|
407
366
|
if (n & a) {
|
|
408
|
-
const t = r !== undefined ? r : e.
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
367
|
+
const t = r !== undefined ? r : e.ae;
|
|
368
|
+
if (C && t) {
|
|
369
|
+
const n = t.source;
|
|
370
|
+
let r = C.X.get(n);
|
|
371
|
+
if (!r) C.X.set(n, (r = new Set()));
|
|
372
|
+
const i = r.size;
|
|
373
|
+
r.add(e);
|
|
374
|
+
if (r.size !== i) schedule();
|
|
415
375
|
}
|
|
416
376
|
}
|
|
417
377
|
return true;
|
|
@@ -420,57 +380,57 @@ class GlobalQueue extends Queue {
|
|
|
420
380
|
}
|
|
421
381
|
initTransition(e) {
|
|
422
382
|
if (e) e = currentTransition(e);
|
|
423
|
-
if (e && e ===
|
|
424
|
-
if (!e &&
|
|
425
|
-
if (!
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
383
|
+
if (e && e === C) return;
|
|
384
|
+
if (!e && C && C.de === E) return;
|
|
385
|
+
if (!C) {
|
|
386
|
+
C = e ?? {
|
|
387
|
+
de: E,
|
|
388
|
+
se: [],
|
|
389
|
+
X: new Map(),
|
|
390
|
+
U: [],
|
|
391
|
+
J: new Set(),
|
|
392
|
+
K: [],
|
|
393
|
+
le: { re: [[], []], ie: [] },
|
|
394
|
+
B: false
|
|
435
395
|
};
|
|
436
396
|
} else if (e) {
|
|
437
|
-
const t =
|
|
397
|
+
const t = C;
|
|
438
398
|
mergeTransitionState(e, t);
|
|
439
|
-
|
|
440
|
-
|
|
399
|
+
v.delete(t);
|
|
400
|
+
C = e;
|
|
441
401
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (this.
|
|
445
|
-
for (let e = 0; e < this.
|
|
446
|
-
const t = this.
|
|
447
|
-
t.
|
|
448
|
-
|
|
402
|
+
v.add(C);
|
|
403
|
+
C.de = E;
|
|
404
|
+
if (this.se !== C.se) {
|
|
405
|
+
for (let e = 0; e < this.se.length; e++) {
|
|
406
|
+
const t = this.se[e];
|
|
407
|
+
t.G = C;
|
|
408
|
+
C.se.push(t);
|
|
449
409
|
}
|
|
450
|
-
this.
|
|
410
|
+
this.se = C.se;
|
|
451
411
|
}
|
|
452
|
-
if (this.
|
|
453
|
-
for (let e = 0; e < this.
|
|
454
|
-
const t = this.
|
|
455
|
-
t.
|
|
456
|
-
|
|
412
|
+
if (this.U !== C.U) {
|
|
413
|
+
for (let e = 0; e < this.U.length; e++) {
|
|
414
|
+
const t = this.U[e];
|
|
415
|
+
t.G = C;
|
|
416
|
+
C.U.push(t);
|
|
457
417
|
}
|
|
458
|
-
this.
|
|
418
|
+
this.U = C.U;
|
|
459
419
|
}
|
|
460
|
-
for (const e of
|
|
461
|
-
if (!e.
|
|
420
|
+
for (const e of L) {
|
|
421
|
+
if (!e.G) e.G = C;
|
|
462
422
|
}
|
|
463
|
-
if (this.
|
|
464
|
-
for (const e of this.
|
|
465
|
-
this.
|
|
423
|
+
if (this.J !== C.J) {
|
|
424
|
+
for (const e of this.J) C.J.add(e);
|
|
425
|
+
this.J = C.J;
|
|
466
426
|
}
|
|
467
427
|
}
|
|
468
428
|
}
|
|
469
429
|
function insertSubs(e, t = false) {
|
|
470
|
-
const n = e.
|
|
471
|
-
const r = e.
|
|
430
|
+
const n = e.Y || B;
|
|
431
|
+
const r = e.he !== undefined;
|
|
472
432
|
for (let i = e.O; i !== null; i = i.P) {
|
|
473
|
-
if (r && i.k.
|
|
433
|
+
if (r && i.k.pe) {
|
|
474
434
|
i.k.m |= l;
|
|
475
435
|
continue;
|
|
476
436
|
}
|
|
@@ -479,47 +439,47 @@ function insertSubs(e, t = false) {
|
|
|
479
439
|
assignOrMergeLane(i.k, n);
|
|
480
440
|
} else if (t) {
|
|
481
441
|
i.k.m |= f;
|
|
482
|
-
i.k.
|
|
442
|
+
i.k.Y = undefined;
|
|
483
443
|
}
|
|
484
444
|
const e = i.k;
|
|
485
|
-
if (e.
|
|
486
|
-
if (!e.
|
|
487
|
-
e.
|
|
488
|
-
e.
|
|
445
|
+
if (e.D === g) {
|
|
446
|
+
if (!e.F) {
|
|
447
|
+
e.F = true;
|
|
448
|
+
e.M.enqueue(y, e.V);
|
|
489
449
|
}
|
|
490
450
|
continue;
|
|
491
451
|
}
|
|
492
|
-
const s = i.k.m & o ?
|
|
493
|
-
if (s.
|
|
452
|
+
const s = i.k.m & o ? k : P;
|
|
453
|
+
if (s.j > i.k.o) s.j = i.k.o;
|
|
494
454
|
insertIntoHeap(i.k, s);
|
|
495
455
|
}
|
|
496
456
|
}
|
|
497
457
|
function commitPendingNodes() {
|
|
498
|
-
const e =
|
|
458
|
+
const e = N.se;
|
|
499
459
|
for (let t = 0; t < e.length; t++) {
|
|
500
460
|
const n = e[t];
|
|
501
|
-
if (n.
|
|
502
|
-
n
|
|
503
|
-
n.
|
|
504
|
-
if (n.
|
|
461
|
+
if (n.Z !== S) {
|
|
462
|
+
n.$ = n.Z;
|
|
463
|
+
n.Z = S;
|
|
464
|
+
if (n.D && n.D !== g) n.F = true;
|
|
505
465
|
}
|
|
506
|
-
if (!(n.
|
|
507
|
-
if (n.I) GlobalQueue.
|
|
466
|
+
if (!(n.ye & a)) n.ye &= ~h;
|
|
467
|
+
if (n.I) GlobalQueue.ue(n, false, true);
|
|
508
468
|
}
|
|
509
469
|
e.length = 0;
|
|
510
470
|
}
|
|
511
471
|
function finalizePureQueue(e = null, t = false) {
|
|
512
472
|
const n = !t;
|
|
513
473
|
if (n) commitPendingNodes();
|
|
514
|
-
if (!t) checkBoundaryChildren(
|
|
515
|
-
if (
|
|
474
|
+
if (!t) checkBoundaryChildren(N);
|
|
475
|
+
if (P.S >= P.j) runHeap(P, GlobalQueue.oe);
|
|
516
476
|
if (n) {
|
|
517
477
|
commitPendingNodes();
|
|
518
|
-
resolveOptimisticNodes(e ? e.
|
|
519
|
-
const t = e ? e.
|
|
520
|
-
if (GlobalQueue.
|
|
478
|
+
resolveOptimisticNodes(e ? e.U : N.U);
|
|
479
|
+
const t = e ? e.J : N.J;
|
|
480
|
+
if (GlobalQueue.fe && t.size) {
|
|
521
481
|
for (const e of t) {
|
|
522
|
-
GlobalQueue.
|
|
482
|
+
GlobalQueue.fe(e);
|
|
523
483
|
}
|
|
524
484
|
t.clear();
|
|
525
485
|
schedule();
|
|
@@ -528,246 +488,266 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
528
488
|
}
|
|
529
489
|
}
|
|
530
490
|
function checkBoundaryChildren(e) {
|
|
531
|
-
for (const t of e.
|
|
491
|
+
for (const t of e.ie) {
|
|
532
492
|
t.checkSources?.();
|
|
533
493
|
checkBoundaryChildren(t);
|
|
534
494
|
}
|
|
535
495
|
}
|
|
536
496
|
function trackOptimisticStore(e) {
|
|
537
|
-
|
|
497
|
+
N.J.add(e);
|
|
538
498
|
schedule();
|
|
539
499
|
}
|
|
540
500
|
function reassignPendingTransition(e) {
|
|
541
501
|
for (let t = 0; t < e.length; t++) {
|
|
542
|
-
e[t].
|
|
502
|
+
e[t].G = C;
|
|
543
503
|
}
|
|
544
504
|
}
|
|
545
|
-
const
|
|
505
|
+
const N = new GlobalQueue();
|
|
546
506
|
function flush() {
|
|
547
|
-
if (
|
|
507
|
+
if (N.ne) {
|
|
548
508
|
return;
|
|
549
509
|
}
|
|
550
|
-
while (
|
|
551
|
-
|
|
510
|
+
while (W || C) {
|
|
511
|
+
N.flush();
|
|
552
512
|
}
|
|
553
513
|
}
|
|
554
514
|
function runQueue(e, t) {
|
|
555
515
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
556
516
|
}
|
|
517
|
+
function reporterBlocksSource(e, t) {
|
|
518
|
+
if (e.m & (o | u)) return false;
|
|
519
|
+
if (e.ge === t || e.Se?.has(t)) return true;
|
|
520
|
+
for (let n = e.A; n; n = n.N) {
|
|
521
|
+
let e = n.R;
|
|
522
|
+
while (e) {
|
|
523
|
+
if (e === t || e.L === t) return true;
|
|
524
|
+
e = e.we;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return !!(e.ye & a && e.ae instanceof NotReadyError && e.ae.source === t);
|
|
528
|
+
}
|
|
557
529
|
function transitionComplete(e) {
|
|
558
|
-
if (e.
|
|
559
|
-
if (e.
|
|
530
|
+
if (e.B) return true;
|
|
531
|
+
if (e.K.length) return false;
|
|
560
532
|
let t = true;
|
|
561
|
-
for (
|
|
562
|
-
|
|
563
|
-
|
|
533
|
+
for (const [n, r] of e.X) {
|
|
534
|
+
let i = false;
|
|
535
|
+
for (const e of r) {
|
|
536
|
+
if (reporterBlocksSource(e, n)) {
|
|
537
|
+
i = true;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
r.delete(e);
|
|
541
|
+
}
|
|
542
|
+
if (!i) e.X.delete(n);
|
|
543
|
+
else if (n.ye & a && n.ae?.source === n) {
|
|
564
544
|
t = false;
|
|
565
545
|
break;
|
|
566
546
|
}
|
|
567
547
|
}
|
|
568
548
|
if (t) {
|
|
569
|
-
for (let n = 0; n < e.
|
|
570
|
-
const r = e.
|
|
549
|
+
for (let n = 0; n < e.U.length; n++) {
|
|
550
|
+
const r = e.U[n];
|
|
571
551
|
if (
|
|
572
552
|
hasActiveOverride(r) &&
|
|
573
|
-
"
|
|
574
|
-
r.
|
|
575
|
-
r.
|
|
576
|
-
r.
|
|
553
|
+
"ye" in r &&
|
|
554
|
+
r.ye & a &&
|
|
555
|
+
r.ae instanceof NotReadyError &&
|
|
556
|
+
r.ae.source !== r
|
|
577
557
|
) {
|
|
578
558
|
t = false;
|
|
579
559
|
break;
|
|
580
560
|
}
|
|
581
561
|
}
|
|
582
562
|
}
|
|
583
|
-
t && (e.
|
|
563
|
+
t && (e.B = true);
|
|
584
564
|
return t;
|
|
585
565
|
}
|
|
586
566
|
function currentTransition(e) {
|
|
587
|
-
while (e.
|
|
567
|
+
while (e.B && typeof e.B === "object") e = e.B;
|
|
588
568
|
return e;
|
|
589
569
|
}
|
|
590
570
|
function setActiveTransition(e) {
|
|
591
|
-
|
|
571
|
+
C = e;
|
|
592
572
|
}
|
|
593
573
|
function runInTransition(e, t) {
|
|
594
|
-
const n =
|
|
574
|
+
const n = C;
|
|
595
575
|
try {
|
|
596
|
-
|
|
576
|
+
C = currentTransition(e);
|
|
597
577
|
return t();
|
|
598
578
|
} finally {
|
|
599
|
-
|
|
579
|
+
C = n;
|
|
600
580
|
}
|
|
601
581
|
}
|
|
602
|
-
const
|
|
603
|
-
const
|
|
582
|
+
const R = new WeakMap();
|
|
583
|
+
const L = new Set();
|
|
604
584
|
function getOrCreateLane(e) {
|
|
605
|
-
let t =
|
|
585
|
+
let t = R.get(e);
|
|
606
586
|
if (t) {
|
|
607
587
|
return findLane(t);
|
|
608
588
|
}
|
|
609
|
-
const n = e.
|
|
610
|
-
const r = n?.
|
|
611
|
-
t = {
|
|
612
|
-
|
|
613
|
-
|
|
589
|
+
const n = e.we;
|
|
590
|
+
const r = n?.Y ? findLane(n.Y) : null;
|
|
591
|
+
t = { te: e, H: new Set(), q: [[], []], T: null, G: C, me: r };
|
|
592
|
+
R.set(e, t);
|
|
593
|
+
L.add(t);
|
|
614
594
|
e.be = false;
|
|
615
595
|
return t;
|
|
616
596
|
}
|
|
617
597
|
function findLane(e) {
|
|
618
|
-
while (e.
|
|
598
|
+
while (e.T) e = e.T;
|
|
619
599
|
return e;
|
|
620
600
|
}
|
|
621
601
|
function mergeLanes(e, t) {
|
|
622
602
|
e = findLane(e);
|
|
623
603
|
t = findLane(t);
|
|
624
604
|
if (e === t) return e;
|
|
625
|
-
t.
|
|
626
|
-
for (const n of t.
|
|
627
|
-
e.
|
|
628
|
-
e.
|
|
605
|
+
t.T = e;
|
|
606
|
+
for (const n of t.H) e.H.add(n);
|
|
607
|
+
e.q[0].push(...t.q[0]);
|
|
608
|
+
e.q[1].push(...t.q[1]);
|
|
629
609
|
return e;
|
|
630
610
|
}
|
|
631
611
|
function resolveLane(e) {
|
|
632
|
-
const t = e.
|
|
612
|
+
const t = e.Y;
|
|
633
613
|
if (!t) return undefined;
|
|
634
614
|
const n = findLane(t);
|
|
635
|
-
if (
|
|
636
|
-
e.
|
|
615
|
+
if (L.has(n)) return n;
|
|
616
|
+
e.Y = undefined;
|
|
637
617
|
return undefined;
|
|
638
618
|
}
|
|
639
619
|
function resolveTransition(e) {
|
|
640
|
-
return resolveLane(e)?.
|
|
620
|
+
return resolveLane(e)?.G ?? e.G;
|
|
641
621
|
}
|
|
642
622
|
function hasActiveOverride(e) {
|
|
643
|
-
return !!(e.
|
|
623
|
+
return !!(e.ee !== undefined && e.ee !== S);
|
|
644
624
|
}
|
|
645
625
|
function assignOrMergeLane(e, t) {
|
|
646
626
|
const n = findLane(t);
|
|
647
|
-
const r = e.
|
|
627
|
+
const r = e.Y;
|
|
648
628
|
if (r) {
|
|
649
|
-
if (r.
|
|
650
|
-
e.
|
|
629
|
+
if (r.T) {
|
|
630
|
+
e.Y = t;
|
|
651
631
|
return;
|
|
652
632
|
}
|
|
653
633
|
const i = findLane(r);
|
|
654
|
-
if (
|
|
634
|
+
if (L.has(i)) {
|
|
655
635
|
if (i !== n && !hasActiveOverride(e)) {
|
|
656
|
-
if (n.
|
|
657
|
-
e.
|
|
658
|
-
} else if (i.
|
|
636
|
+
if (n.me && findLane(n.me) === i) {
|
|
637
|
+
e.Y = t;
|
|
638
|
+
} else if (i.me && findLane(i.me) === n);
|
|
659
639
|
else mergeLanes(n, i);
|
|
660
640
|
}
|
|
661
641
|
return;
|
|
662
642
|
}
|
|
663
643
|
}
|
|
664
|
-
e.
|
|
644
|
+
e.Y = t;
|
|
665
645
|
}
|
|
666
646
|
function unlinkSubs(e) {
|
|
667
647
|
const t = e.R;
|
|
668
|
-
const n = e.
|
|
648
|
+
const n = e.N;
|
|
669
649
|
const r = e.P;
|
|
670
|
-
const i = e.
|
|
671
|
-
if (r !== null) r.
|
|
672
|
-
else t.
|
|
650
|
+
const i = e._e;
|
|
651
|
+
if (r !== null) r._e = i;
|
|
652
|
+
else t.Oe = i;
|
|
673
653
|
if (i !== null) i.P = r;
|
|
674
654
|
else {
|
|
675
655
|
t.O = r;
|
|
676
656
|
if (r === null) {
|
|
677
|
-
t.
|
|
678
|
-
t.I && !t.
|
|
657
|
+
t.xe?.();
|
|
658
|
+
t.I && !t.ve && !(t.m & o) && unobserved(t);
|
|
679
659
|
}
|
|
680
660
|
}
|
|
681
661
|
return n;
|
|
682
662
|
}
|
|
683
663
|
function unobserved(e) {
|
|
684
|
-
deleteFromHeap(e, e.m & o ?
|
|
685
|
-
let t = e.
|
|
664
|
+
deleteFromHeap(e, e.m & o ? k : P);
|
|
665
|
+
let t = e.A;
|
|
686
666
|
while (t !== null) {
|
|
687
667
|
t = unlinkSubs(t);
|
|
688
668
|
}
|
|
689
|
-
e.
|
|
669
|
+
e.A = null;
|
|
690
670
|
disposeChildren(e, true);
|
|
691
671
|
}
|
|
692
672
|
function link(e, t) {
|
|
693
|
-
const n = t.
|
|
673
|
+
const n = t.Pe;
|
|
694
674
|
if (n !== null && n.R === e) return;
|
|
695
675
|
let i = null;
|
|
696
676
|
const s = t.m & r;
|
|
697
677
|
if (s) {
|
|
698
|
-
i = n !== null ? n.
|
|
678
|
+
i = n !== null ? n.N : t.A;
|
|
699
679
|
if (i !== null && i.R === e) {
|
|
700
|
-
t.
|
|
680
|
+
t.Pe = i;
|
|
701
681
|
return;
|
|
702
682
|
}
|
|
703
683
|
}
|
|
704
|
-
const o = e.
|
|
684
|
+
const o = e.Oe;
|
|
705
685
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
706
|
-
const u = (t.
|
|
707
|
-
if (n !== null) n.
|
|
708
|
-
else t.
|
|
686
|
+
const u = (t.Pe = e.Oe = { R: e, k: t, N: i, _e: o, P: null });
|
|
687
|
+
if (n !== null) n.N = u;
|
|
688
|
+
else t.A = u;
|
|
709
689
|
if (o !== null) o.P = u;
|
|
710
690
|
else e.O = u;
|
|
711
691
|
}
|
|
712
692
|
function isValidLink(e, t) {
|
|
713
|
-
const n = t.
|
|
693
|
+
const n = t.Pe;
|
|
714
694
|
if (n !== null) {
|
|
715
|
-
let r = t.
|
|
695
|
+
let r = t.A;
|
|
716
696
|
do {
|
|
717
697
|
if (r === e) return true;
|
|
718
698
|
if (r === n) break;
|
|
719
|
-
r = r.
|
|
699
|
+
r = r.N;
|
|
720
700
|
} while (r !== null);
|
|
721
701
|
}
|
|
722
702
|
return false;
|
|
723
703
|
}
|
|
724
|
-
const
|
|
704
|
+
const I = {};
|
|
725
705
|
function markDisposal(e) {
|
|
726
|
-
let t = e.
|
|
706
|
+
let t = e.ke;
|
|
727
707
|
while (t) {
|
|
728
708
|
t.m |= o;
|
|
729
709
|
if (t.m & i) {
|
|
730
|
-
deleteFromHeap(t,
|
|
731
|
-
insertIntoHeap(t,
|
|
710
|
+
deleteFromHeap(t, P);
|
|
711
|
+
insertIntoHeap(t, k);
|
|
732
712
|
}
|
|
733
713
|
markDisposal(t);
|
|
734
|
-
t = t.
|
|
714
|
+
t = t.Ee;
|
|
735
715
|
}
|
|
736
716
|
}
|
|
737
717
|
function dispose(e) {
|
|
738
|
-
let t = e.
|
|
718
|
+
let t = e.A || null;
|
|
739
719
|
do {
|
|
740
720
|
t = unlinkSubs(t);
|
|
741
721
|
} while (t !== null);
|
|
742
|
-
e.
|
|
743
|
-
e.
|
|
722
|
+
e.A = null;
|
|
723
|
+
e.Pe = null;
|
|
744
724
|
disposeChildren(e, true);
|
|
745
725
|
}
|
|
746
726
|
function disposeChildren(e, t = false, n) {
|
|
747
727
|
if (e.m & u) return;
|
|
748
728
|
if (t) e.m = u;
|
|
749
|
-
if (t && e.I) e.
|
|
750
|
-
let r = n ? e.
|
|
729
|
+
if (t && e.I) e.Ce = null;
|
|
730
|
+
let r = n ? e.We : e.ke;
|
|
751
731
|
while (r) {
|
|
752
|
-
const e = r.
|
|
753
|
-
if (r.
|
|
732
|
+
const e = r.Ee;
|
|
733
|
+
if (r.A) {
|
|
754
734
|
const e = r;
|
|
755
|
-
deleteFromHeap(e, e.m & o ?
|
|
756
|
-
let t = e.
|
|
735
|
+
deleteFromHeap(e, e.m & o ? k : P);
|
|
736
|
+
let t = e.A;
|
|
757
737
|
do {
|
|
758
738
|
t = unlinkSubs(t);
|
|
759
739
|
} while (t !== null);
|
|
760
|
-
e.
|
|
761
|
-
e.
|
|
740
|
+
e.A = null;
|
|
741
|
+
e.Pe = null;
|
|
762
742
|
}
|
|
763
743
|
disposeChildren(r, true);
|
|
764
744
|
r = e;
|
|
765
745
|
}
|
|
766
746
|
if (n) {
|
|
767
|
-
e.
|
|
747
|
+
e.We = null;
|
|
768
748
|
} else {
|
|
769
|
-
e.
|
|
770
|
-
e.
|
|
749
|
+
e.ke = null;
|
|
750
|
+
e.je = 0;
|
|
771
751
|
}
|
|
772
752
|
runDisposal(e, n);
|
|
773
753
|
}
|
|
@@ -786,8 +766,8 @@ function runDisposal(e, t) {
|
|
|
786
766
|
}
|
|
787
767
|
function childId(e, t) {
|
|
788
768
|
let n = e;
|
|
789
|
-
while (n.
|
|
790
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
769
|
+
while (n.Re && n.i) n = n.i;
|
|
770
|
+
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
791
771
|
throw new Error("Cannot get child id from owner without an id");
|
|
792
772
|
}
|
|
793
773
|
function getNextChildId(e) {
|
|
@@ -802,50 +782,50 @@ function formatId(e, t) {
|
|
|
802
782
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
803
783
|
}
|
|
804
784
|
function getObserver() {
|
|
805
|
-
if (
|
|
806
|
-
return
|
|
785
|
+
if (D || M) return I;
|
|
786
|
+
return H ? V : null;
|
|
807
787
|
}
|
|
808
788
|
function getOwner() {
|
|
809
|
-
return
|
|
789
|
+
return V;
|
|
810
790
|
}
|
|
811
791
|
function cleanup(e) {
|
|
812
|
-
if (!
|
|
813
|
-
if (!
|
|
814
|
-
else if (Array.isArray(
|
|
815
|
-
else
|
|
792
|
+
if (!V) return e;
|
|
793
|
+
if (!V.Ne) V.Ne = e;
|
|
794
|
+
else if (Array.isArray(V.Ne)) V.Ne.push(e);
|
|
795
|
+
else V.Ne = [V.Ne, e];
|
|
816
796
|
return e;
|
|
817
797
|
}
|
|
818
798
|
function isDisposed(e) {
|
|
819
799
|
return !!(e.m & (u | o));
|
|
820
800
|
}
|
|
821
801
|
function createOwner(e) {
|
|
822
|
-
const t =
|
|
802
|
+
const t = V;
|
|
823
803
|
const n = e?.transparent ?? false;
|
|
824
804
|
const r = {
|
|
825
805
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
826
|
-
|
|
806
|
+
Re: n || undefined,
|
|
827
807
|
t: true,
|
|
828
808
|
u: t?.t ? t.u : t,
|
|
829
|
-
|
|
830
|
-
|
|
809
|
+
ke: null,
|
|
810
|
+
Ee: null,
|
|
831
811
|
Ne: null,
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
812
|
+
M: t?.M ?? N,
|
|
813
|
+
Le: t?.Le || _,
|
|
814
|
+
je: 0,
|
|
835
815
|
Ae: null,
|
|
836
|
-
|
|
816
|
+
We: null,
|
|
837
817
|
i: t,
|
|
838
818
|
dispose(e = true) {
|
|
839
819
|
disposeChildren(r, e);
|
|
840
820
|
}
|
|
841
821
|
};
|
|
842
822
|
if (t) {
|
|
843
|
-
const e = t.
|
|
823
|
+
const e = t.ke;
|
|
844
824
|
if (e === null) {
|
|
845
|
-
t.
|
|
825
|
+
t.ke = r;
|
|
846
826
|
} else {
|
|
847
|
-
r.
|
|
848
|
-
t.
|
|
827
|
+
r.Ee = e;
|
|
828
|
+
t.ke = r;
|
|
849
829
|
}
|
|
850
830
|
}
|
|
851
831
|
return r;
|
|
@@ -855,51 +835,51 @@ function createRoot(e, t) {
|
|
|
855
835
|
return runWithOwner(n, () => e(n.dispose));
|
|
856
836
|
}
|
|
857
837
|
function addPendingSource(e, t) {
|
|
858
|
-
if (e.
|
|
859
|
-
if (!e.
|
|
860
|
-
e.
|
|
838
|
+
if (e.ge === t || e.Se?.has(t)) return false;
|
|
839
|
+
if (!e.ge) {
|
|
840
|
+
e.ge = t;
|
|
861
841
|
return true;
|
|
862
842
|
}
|
|
863
|
-
if (!e.
|
|
864
|
-
e.
|
|
843
|
+
if (!e.Se) {
|
|
844
|
+
e.Se = new Set([e.ge, t]);
|
|
865
845
|
} else {
|
|
866
|
-
e.
|
|
846
|
+
e.Se.add(t);
|
|
867
847
|
}
|
|
868
|
-
e.
|
|
848
|
+
e.ge = undefined;
|
|
869
849
|
return true;
|
|
870
850
|
}
|
|
871
851
|
function removePendingSource(e, t) {
|
|
872
|
-
if (e.
|
|
873
|
-
if (e.
|
|
874
|
-
e.
|
|
852
|
+
if (e.ge) {
|
|
853
|
+
if (e.ge !== t) return false;
|
|
854
|
+
e.ge = undefined;
|
|
875
855
|
return true;
|
|
876
856
|
}
|
|
877
|
-
if (!e.
|
|
878
|
-
if (e.
|
|
879
|
-
e.
|
|
880
|
-
e.
|
|
881
|
-
} else if (e.
|
|
882
|
-
e.
|
|
857
|
+
if (!e.Se?.delete(t)) return false;
|
|
858
|
+
if (e.Se.size === 1) {
|
|
859
|
+
e.ge = e.Se.values().next().value;
|
|
860
|
+
e.Se = undefined;
|
|
861
|
+
} else if (e.Se.size === 0) {
|
|
862
|
+
e.Se = undefined;
|
|
883
863
|
}
|
|
884
864
|
return true;
|
|
885
865
|
}
|
|
886
866
|
function clearPendingSources(e) {
|
|
887
|
-
e.
|
|
888
|
-
e.
|
|
889
|
-
e.
|
|
867
|
+
e.ge = undefined;
|
|
868
|
+
e.Se?.clear();
|
|
869
|
+
e.Se = undefined;
|
|
890
870
|
}
|
|
891
871
|
function setPendingError(e, t, n) {
|
|
892
872
|
if (!t) {
|
|
893
|
-
e.
|
|
873
|
+
e.ae = null;
|
|
894
874
|
return;
|
|
895
875
|
}
|
|
896
876
|
if (n instanceof NotReadyError && n.source === t) {
|
|
897
|
-
e.
|
|
877
|
+
e.ae = n;
|
|
898
878
|
return;
|
|
899
879
|
}
|
|
900
|
-
const r = e.
|
|
880
|
+
const r = e.ae;
|
|
901
881
|
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
902
|
-
e.
|
|
882
|
+
e.ae = new NotReadyError(t);
|
|
903
883
|
}
|
|
904
884
|
}
|
|
905
885
|
function forEachDependent(e, t) {
|
|
@@ -914,30 +894,30 @@ function settlePendingSource(e) {
|
|
|
914
894
|
const settle = r => {
|
|
915
895
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
916
896
|
n.add(r);
|
|
917
|
-
r.
|
|
918
|
-
const i = r.
|
|
897
|
+
r.de = E;
|
|
898
|
+
const i = r.ge ?? r.Se?.values().next().value;
|
|
919
899
|
if (i) {
|
|
920
900
|
setPendingError(r, i);
|
|
921
901
|
updatePendingSignal(r);
|
|
922
902
|
} else {
|
|
923
|
-
r.
|
|
903
|
+
r.ye &= ~a;
|
|
924
904
|
setPendingError(r);
|
|
925
905
|
updatePendingSignal(r);
|
|
926
|
-
if (r.
|
|
927
|
-
if (r.
|
|
906
|
+
if (r.Ie) {
|
|
907
|
+
if (r.D === g) {
|
|
928
908
|
const e = r;
|
|
929
|
-
if (!e.
|
|
930
|
-
e.
|
|
931
|
-
e.
|
|
909
|
+
if (!e.F) {
|
|
910
|
+
e.F = true;
|
|
911
|
+
e.M.enqueue(y, e.V);
|
|
932
912
|
}
|
|
933
913
|
} else {
|
|
934
|
-
const e = r.m & o ?
|
|
935
|
-
if (e.
|
|
914
|
+
const e = r.m & o ? k : P;
|
|
915
|
+
if (e.j > r.o) e.j = r.o;
|
|
936
916
|
insertIntoHeap(r, e);
|
|
937
917
|
}
|
|
938
918
|
t = true;
|
|
939
919
|
}
|
|
940
|
-
r.
|
|
920
|
+
r.Ie = false;
|
|
941
921
|
}
|
|
942
922
|
forEachDependent(r, settle);
|
|
943
923
|
};
|
|
@@ -949,40 +929,42 @@ function handleAsync(e, t, r) {
|
|
|
949
929
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
950
930
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
951
931
|
if (!o && !s) {
|
|
952
|
-
e.
|
|
932
|
+
e.Ce = null;
|
|
953
933
|
return t;
|
|
954
934
|
}
|
|
955
|
-
e.
|
|
935
|
+
e.Ce = t;
|
|
956
936
|
let u;
|
|
957
937
|
const handleError = n => {
|
|
958
|
-
if (e.
|
|
959
|
-
|
|
938
|
+
if (e.Ce !== t) return;
|
|
939
|
+
N.initTransition(resolveTransition(e));
|
|
960
940
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
961
|
-
e.
|
|
941
|
+
e.de = E;
|
|
962
942
|
};
|
|
963
943
|
const asyncWrite = (i, s) => {
|
|
964
|
-
if (e.
|
|
944
|
+
if (e.Ce !== t) return;
|
|
965
945
|
if (e.m & (n | f)) return;
|
|
966
|
-
|
|
946
|
+
N.initTransition(resolveTransition(e));
|
|
947
|
+
const o = !!(e.ye & h);
|
|
967
948
|
clearStatus(e);
|
|
968
|
-
const
|
|
969
|
-
if (
|
|
949
|
+
const u = resolveLane(e);
|
|
950
|
+
if (u) u.H.delete(e);
|
|
970
951
|
if (r) r(i);
|
|
971
|
-
else if (e.
|
|
972
|
-
if (e.
|
|
952
|
+
else if (e.ee !== undefined) {
|
|
953
|
+
if (e.ee !== undefined && e.ee !== S) e.Z = i;
|
|
973
954
|
else {
|
|
974
|
-
e
|
|
955
|
+
e.$ = i;
|
|
975
956
|
insertSubs(e);
|
|
976
957
|
}
|
|
977
|
-
e.
|
|
978
|
-
} else if (
|
|
979
|
-
const t = e.
|
|
980
|
-
const n = e
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
e
|
|
984
|
-
|
|
985
|
-
|
|
958
|
+
e.de = E;
|
|
959
|
+
} else if (u) {
|
|
960
|
+
const t = e.D;
|
|
961
|
+
const n = e.$;
|
|
962
|
+
const r = e.Te;
|
|
963
|
+
if ((!t && o) || !r || !r(i, n)) {
|
|
964
|
+
e.$ = i;
|
|
965
|
+
e.de = E;
|
|
966
|
+
if (e.He) {
|
|
967
|
+
setSignal(e.He, i);
|
|
986
968
|
}
|
|
987
969
|
insertSubs(e, true);
|
|
988
970
|
}
|
|
@@ -1010,8 +992,8 @@ function handleAsync(e, t, r) {
|
|
|
1010
992
|
);
|
|
1011
993
|
r = false;
|
|
1012
994
|
if (!n) {
|
|
1013
|
-
|
|
1014
|
-
throw new NotReadyError(
|
|
995
|
+
N.initTransition(resolveTransition(e));
|
|
996
|
+
throw new NotReadyError(V);
|
|
1015
997
|
}
|
|
1016
998
|
}
|
|
1017
999
|
if (s) {
|
|
@@ -1038,7 +1020,7 @@ function handleAsync(e, t, r) {
|
|
|
1038
1020
|
s = n;
|
|
1039
1021
|
o = true;
|
|
1040
1022
|
if (n.done) i = true;
|
|
1041
|
-
} else if (e.
|
|
1023
|
+
} else if (e.Ce !== t) {
|
|
1042
1024
|
return;
|
|
1043
1025
|
} else if (!n.done) asyncWrite(n.value, iterate);
|
|
1044
1026
|
else {
|
|
@@ -1048,7 +1030,7 @@ function handleAsync(e, t, r) {
|
|
|
1048
1030
|
}
|
|
1049
1031
|
},
|
|
1050
1032
|
n => {
|
|
1051
|
-
if (!f && e.
|
|
1033
|
+
if (!f && e.Ce === t) {
|
|
1052
1034
|
i = true;
|
|
1053
1035
|
handleError(n);
|
|
1054
1036
|
}
|
|
@@ -1064,36 +1046,36 @@ function handleAsync(e, t, r) {
|
|
|
1064
1046
|
};
|
|
1065
1047
|
const s = iterate();
|
|
1066
1048
|
if (!r && !s) {
|
|
1067
|
-
|
|
1068
|
-
throw new NotReadyError(
|
|
1049
|
+
N.initTransition(resolveTransition(e));
|
|
1050
|
+
throw new NotReadyError(V);
|
|
1069
1051
|
}
|
|
1070
1052
|
}
|
|
1071
1053
|
return u;
|
|
1072
1054
|
}
|
|
1073
1055
|
function clearStatus(e, t = false) {
|
|
1074
1056
|
clearPendingSources(e);
|
|
1075
|
-
e.
|
|
1076
|
-
e.
|
|
1057
|
+
e.Ie = false;
|
|
1058
|
+
e.ye = t ? 0 : e.ye & h;
|
|
1077
1059
|
setPendingError(e);
|
|
1078
1060
|
updatePendingSignal(e);
|
|
1079
|
-
e.
|
|
1061
|
+
e.Qe?.();
|
|
1080
1062
|
}
|
|
1081
1063
|
function notifyStatus(e, t, n, r, i) {
|
|
1082
1064
|
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
1083
1065
|
n = new StatusError(e, n);
|
|
1084
1066
|
const s = t === a && n instanceof NotReadyError ? n.source : undefined;
|
|
1085
1067
|
const o = s === e;
|
|
1086
|
-
const u = t === a && e.
|
|
1068
|
+
const u = t === a && e.ee !== undefined && !o;
|
|
1087
1069
|
const f = u && hasActiveOverride(e);
|
|
1088
1070
|
if (!r) {
|
|
1089
1071
|
if (t === a && s) {
|
|
1090
1072
|
addPendingSource(e, s);
|
|
1091
|
-
e.
|
|
1073
|
+
e.ye = a | (e.ye & h);
|
|
1092
1074
|
setPendingError(e, s, n);
|
|
1093
1075
|
} else {
|
|
1094
1076
|
clearPendingSources(e);
|
|
1095
|
-
e.
|
|
1096
|
-
e.
|
|
1077
|
+
e.ye = t | (t !== d ? e.ye & h : 0);
|
|
1078
|
+
e.ae = n;
|
|
1097
1079
|
}
|
|
1098
1080
|
updatePendingSignal(e);
|
|
1099
1081
|
}
|
|
@@ -1102,34 +1084,34 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1102
1084
|
}
|
|
1103
1085
|
const l = r || f;
|
|
1104
1086
|
const c = r || u ? undefined : i;
|
|
1105
|
-
if (e.
|
|
1087
|
+
if (e.Qe) {
|
|
1106
1088
|
if (r && t === a) {
|
|
1107
1089
|
return;
|
|
1108
1090
|
}
|
|
1109
1091
|
if (l) {
|
|
1110
|
-
e.
|
|
1092
|
+
e.Qe(t, n);
|
|
1111
1093
|
} else {
|
|
1112
|
-
e.
|
|
1094
|
+
e.Qe();
|
|
1113
1095
|
}
|
|
1114
1096
|
return;
|
|
1115
1097
|
}
|
|
1116
1098
|
forEachDependent(e, e => {
|
|
1117
|
-
e.
|
|
1099
|
+
e.de = E;
|
|
1118
1100
|
if (
|
|
1119
|
-
(t === a && s && e.
|
|
1120
|
-
(t !== a && (e.
|
|
1101
|
+
(t === a && s && e.ge !== s && !e.Se?.has(s)) ||
|
|
1102
|
+
(t !== a && (e.ae !== n || e.ge || e.Se))
|
|
1121
1103
|
) {
|
|
1122
|
-
if (!l && !e.
|
|
1104
|
+
if (!l && !e.G) N.se.push(e);
|
|
1123
1105
|
notifyStatus(e, t, n, l, c);
|
|
1124
1106
|
}
|
|
1125
1107
|
});
|
|
1126
1108
|
}
|
|
1127
|
-
let
|
|
1109
|
+
let T = null;
|
|
1128
1110
|
function enableExternalSource(e) {
|
|
1129
1111
|
const { factory: t, untrack: n = e => e() } = e;
|
|
1130
|
-
if (
|
|
1131
|
-
const { factory: e, untrack: r } =
|
|
1132
|
-
|
|
1112
|
+
if (T) {
|
|
1113
|
+
const { factory: e, untrack: r } = T;
|
|
1114
|
+
T = {
|
|
1133
1115
|
factory: (n, r) => {
|
|
1134
1116
|
const i = e(n, r);
|
|
1135
1117
|
const s = t(e => i.track(e), r);
|
|
@@ -1144,172 +1126,173 @@ function enableExternalSource(e) {
|
|
|
1144
1126
|
untrack: e => r(() => n(e))
|
|
1145
1127
|
};
|
|
1146
1128
|
} else {
|
|
1147
|
-
|
|
1129
|
+
T = { factory: t, untrack: n };
|
|
1148
1130
|
}
|
|
1149
1131
|
}
|
|
1150
|
-
GlobalQueue.
|
|
1151
|
-
GlobalQueue.
|
|
1132
|
+
GlobalQueue.oe = recompute;
|
|
1133
|
+
GlobalQueue.ue = disposeChildren;
|
|
1134
|
+
let H = false;
|
|
1152
1135
|
let Q = false;
|
|
1153
1136
|
let q = false;
|
|
1154
1137
|
let D = false;
|
|
1155
1138
|
let F = false;
|
|
1156
|
-
let V = false;
|
|
1157
1139
|
let M = false;
|
|
1140
|
+
let V = null;
|
|
1158
1141
|
let B = null;
|
|
1159
|
-
let G = null;
|
|
1160
1142
|
let K = false;
|
|
1161
|
-
let
|
|
1143
|
+
let G = null;
|
|
1162
1144
|
function ownerInSnapshotScope(e) {
|
|
1163
1145
|
while (e) {
|
|
1164
|
-
if (e.
|
|
1146
|
+
if (e.qe) return true;
|
|
1165
1147
|
e = e.i;
|
|
1166
1148
|
}
|
|
1167
1149
|
return false;
|
|
1168
1150
|
}
|
|
1169
1151
|
function setSnapshotCapture(e) {
|
|
1170
1152
|
K = e;
|
|
1171
|
-
if (e && !
|
|
1153
|
+
if (e && !G) G = new Set();
|
|
1172
1154
|
}
|
|
1173
1155
|
function markSnapshotScope(e) {
|
|
1174
|
-
e.
|
|
1156
|
+
e.qe = true;
|
|
1175
1157
|
}
|
|
1176
1158
|
function releaseSnapshotScope(e) {
|
|
1177
|
-
e.
|
|
1159
|
+
e.qe = false;
|
|
1178
1160
|
releaseSubtree(e);
|
|
1179
1161
|
schedule();
|
|
1180
1162
|
}
|
|
1181
1163
|
function releaseSubtree(e) {
|
|
1182
|
-
let t = e.
|
|
1164
|
+
let t = e.ke;
|
|
1183
1165
|
while (t) {
|
|
1184
|
-
if (t.
|
|
1185
|
-
t = t.
|
|
1166
|
+
if (t.qe) {
|
|
1167
|
+
t = t.Ee;
|
|
1186
1168
|
continue;
|
|
1187
1169
|
}
|
|
1188
1170
|
if (t.I) {
|
|
1189
1171
|
const e = t;
|
|
1190
|
-
e.
|
|
1172
|
+
e.pe = false;
|
|
1191
1173
|
if (e.m & l) {
|
|
1192
1174
|
e.m &= ~l;
|
|
1193
1175
|
e.m |= n;
|
|
1194
|
-
if (
|
|
1195
|
-
insertIntoHeap(e,
|
|
1176
|
+
if (P.j > e.o) P.j = e.o;
|
|
1177
|
+
insertIntoHeap(e, P);
|
|
1196
1178
|
}
|
|
1197
1179
|
}
|
|
1198
1180
|
releaseSubtree(t);
|
|
1199
|
-
t = t.
|
|
1181
|
+
t = t.Ee;
|
|
1200
1182
|
}
|
|
1201
1183
|
}
|
|
1202
1184
|
function clearSnapshots() {
|
|
1203
|
-
if (
|
|
1204
|
-
for (const e of
|
|
1205
|
-
delete e.
|
|
1185
|
+
if (G) {
|
|
1186
|
+
for (const e of G) {
|
|
1187
|
+
delete e.he;
|
|
1206
1188
|
delete e[m];
|
|
1207
1189
|
}
|
|
1208
|
-
|
|
1190
|
+
G = null;
|
|
1209
1191
|
}
|
|
1210
1192
|
K = false;
|
|
1211
1193
|
}
|
|
1212
1194
|
function recompute(t, n = false) {
|
|
1213
|
-
const i = t.
|
|
1195
|
+
const i = t.D;
|
|
1214
1196
|
if (!n) {
|
|
1215
|
-
if (t.
|
|
1216
|
-
deleteFromHeap(t, t.m & o ?
|
|
1217
|
-
t.
|
|
1218
|
-
if (t.
|
|
1197
|
+
if (t.G && (!i || C) && C !== t.G) N.initTransition(t.G);
|
|
1198
|
+
deleteFromHeap(t, t.m & o ? k : P);
|
|
1199
|
+
t.Ce = null;
|
|
1200
|
+
if (t.G || i === g) disposeChildren(t);
|
|
1219
1201
|
else {
|
|
1220
1202
|
markDisposal(t);
|
|
1221
1203
|
t.Ae = t.Ne;
|
|
1222
|
-
t.
|
|
1204
|
+
t.We = t.ke;
|
|
1223
1205
|
t.Ne = null;
|
|
1224
|
-
t.
|
|
1225
|
-
t.
|
|
1206
|
+
t.ke = null;
|
|
1207
|
+
t.je = 0;
|
|
1226
1208
|
}
|
|
1227
1209
|
}
|
|
1228
1210
|
const s = !!(t.m & f);
|
|
1229
|
-
const u = t.
|
|
1230
|
-
const c = !!(t.
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
|
|
1211
|
+
const u = t.ee !== undefined && t.ee !== S;
|
|
1212
|
+
const c = !!(t.ye & a);
|
|
1213
|
+
const p = !!(t.ye & h);
|
|
1214
|
+
const y = V;
|
|
1215
|
+
V = t;
|
|
1216
|
+
t.Pe = null;
|
|
1234
1217
|
t.m = r;
|
|
1235
|
-
t.
|
|
1236
|
-
let
|
|
1237
|
-
let
|
|
1238
|
-
let
|
|
1239
|
-
let
|
|
1240
|
-
|
|
1218
|
+
t.de = E;
|
|
1219
|
+
let w = t.Z === S ? t.$ : t.Z;
|
|
1220
|
+
let m = t.o;
|
|
1221
|
+
let b = H;
|
|
1222
|
+
let _ = B;
|
|
1223
|
+
H = true;
|
|
1241
1224
|
if (s) {
|
|
1242
1225
|
const e = resolveLane(t);
|
|
1243
|
-
if (e)
|
|
1226
|
+
if (e) B = e;
|
|
1244
1227
|
}
|
|
1245
1228
|
try {
|
|
1246
|
-
|
|
1229
|
+
w = handleAsync(t, t.I(w));
|
|
1247
1230
|
clearStatus(t, n);
|
|
1248
1231
|
const e = resolveLane(t);
|
|
1249
1232
|
if (e) {
|
|
1250
|
-
e.
|
|
1251
|
-
updatePendingSignal(e.
|
|
1233
|
+
e.H.delete(t);
|
|
1234
|
+
updatePendingSignal(e.te);
|
|
1252
1235
|
}
|
|
1253
1236
|
} catch (e) {
|
|
1254
|
-
if (e instanceof NotReadyError &&
|
|
1255
|
-
const e = findLane(
|
|
1256
|
-
if (e.
|
|
1257
|
-
e.
|
|
1258
|
-
t.
|
|
1259
|
-
updatePendingSignal(e.
|
|
1237
|
+
if (e instanceof NotReadyError && B) {
|
|
1238
|
+
const e = findLane(B);
|
|
1239
|
+
if (e.te !== t) {
|
|
1240
|
+
e.H.add(t);
|
|
1241
|
+
t.Y = e;
|
|
1242
|
+
updatePendingSignal(e.te);
|
|
1260
1243
|
}
|
|
1261
1244
|
}
|
|
1262
|
-
if (e instanceof NotReadyError) t.
|
|
1245
|
+
if (e instanceof NotReadyError) t.Ie = true;
|
|
1263
1246
|
notifyStatus(
|
|
1264
1247
|
t,
|
|
1265
1248
|
e instanceof NotReadyError ? a : d,
|
|
1266
1249
|
e,
|
|
1267
1250
|
undefined,
|
|
1268
|
-
e instanceof NotReadyError ? t.
|
|
1251
|
+
e instanceof NotReadyError ? t.Y : undefined
|
|
1269
1252
|
);
|
|
1270
1253
|
} finally {
|
|
1271
|
-
|
|
1254
|
+
H = b;
|
|
1272
1255
|
t.m = e | (n ? t.m & l : 0);
|
|
1273
|
-
|
|
1256
|
+
V = y;
|
|
1274
1257
|
}
|
|
1275
|
-
if (!t.
|
|
1276
|
-
const e = t.
|
|
1277
|
-
let r = e !== null ? e.
|
|
1258
|
+
if (!t.ae) {
|
|
1259
|
+
const e = t.Pe;
|
|
1260
|
+
let r = e !== null ? e.N : t.A;
|
|
1278
1261
|
if (r !== null) {
|
|
1279
1262
|
do {
|
|
1280
1263
|
r = unlinkSubs(r);
|
|
1281
1264
|
} while (r !== null);
|
|
1282
|
-
if (e !== null) e.
|
|
1283
|
-
else t.
|
|
1265
|
+
if (e !== null) e.N = null;
|
|
1266
|
+
else t.A = null;
|
|
1284
1267
|
}
|
|
1285
|
-
const f = u ? t.
|
|
1286
|
-
const l = !t.
|
|
1268
|
+
const f = u ? t.ee : t.Z === S ? t.$ : t.Z;
|
|
1269
|
+
const l = (!i && p) || !t.Te || !t.Te(f, w);
|
|
1287
1270
|
if (l) {
|
|
1288
|
-
const e = u ? t.
|
|
1289
|
-
if (n || (i &&
|
|
1290
|
-
t
|
|
1271
|
+
const e = u ? t.ee : undefined;
|
|
1272
|
+
if (n || (i && C !== t.G) || s) {
|
|
1273
|
+
t.$ = w;
|
|
1291
1274
|
if (u && s) {
|
|
1292
|
-
t.
|
|
1293
|
-
t.
|
|
1275
|
+
t.ee = w;
|
|
1276
|
+
t.Z = w;
|
|
1294
1277
|
}
|
|
1295
|
-
} else t.
|
|
1296
|
-
if (u && !s && c && !t.be) t.
|
|
1297
|
-
if (!u || s || t.
|
|
1278
|
+
} else t.Z = w;
|
|
1279
|
+
if (u && !s && c && !t.be) t.ee = w;
|
|
1280
|
+
if (!u || s || t.ee !== e) insertSubs(t, s || u);
|
|
1298
1281
|
} else if (u) {
|
|
1299
|
-
t.
|
|
1300
|
-
} else if (t.o !=
|
|
1282
|
+
t.Z = w;
|
|
1283
|
+
} else if (t.o != m) {
|
|
1301
1284
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1302
|
-
insertIntoHeapHeight(e.k, e.k.m & o ?
|
|
1285
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? k : P);
|
|
1303
1286
|
}
|
|
1304
1287
|
}
|
|
1305
1288
|
}
|
|
1306
|
-
|
|
1307
|
-
(!n || t.
|
|
1308
|
-
t.
|
|
1289
|
+
B = _;
|
|
1290
|
+
(!n || t.ye & a) && !t.G && !(C && u) && N.se.push(t);
|
|
1291
|
+
t.G && i && C !== t.G && runInTransition(t.G, () => recompute(t));
|
|
1309
1292
|
}
|
|
1310
1293
|
function updateIfNecessary(e) {
|
|
1311
1294
|
if (e.m & t) {
|
|
1312
|
-
for (let t = e.
|
|
1295
|
+
for (let t = e.A; t; t = t.N) {
|
|
1313
1296
|
const r = t.R;
|
|
1314
1297
|
const i = r.L || r;
|
|
1315
1298
|
if (i.I) {
|
|
@@ -1320,7 +1303,7 @@ function updateIfNecessary(e) {
|
|
|
1320
1303
|
}
|
|
1321
1304
|
}
|
|
1322
1305
|
}
|
|
1323
|
-
if (e.m & (n | f) || (e.
|
|
1306
|
+
if (e.m & (n | f) || (e.ae && e.de < E && !e.Ce)) {
|
|
1324
1307
|
recompute(e);
|
|
1325
1308
|
}
|
|
1326
1309
|
e.m = e.m & (l | i | s);
|
|
@@ -1328,53 +1311,53 @@ function updateIfNecessary(e) {
|
|
|
1328
1311
|
function computed(t, n, r) {
|
|
1329
1312
|
const i = r?.transparent ?? false;
|
|
1330
1313
|
const s = {
|
|
1331
|
-
id: r?.id ?? (i ?
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1314
|
+
id: r?.id ?? (i ? V?.id : V?.id != null ? getNextChildId(V) : undefined),
|
|
1315
|
+
Re: i || undefined,
|
|
1316
|
+
Te: r?.equals != null ? r.equals : isEqual,
|
|
1317
|
+
ce: !!r?.pureWrite,
|
|
1318
|
+
xe: r?.unobserved,
|
|
1336
1319
|
Ne: null,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1320
|
+
M: V?.M ?? N,
|
|
1321
|
+
Le: V?.Le ?? _,
|
|
1322
|
+
je: 0,
|
|
1340
1323
|
I: t,
|
|
1341
|
-
|
|
1324
|
+
$: n,
|
|
1342
1325
|
o: 0,
|
|
1343
1326
|
C: null,
|
|
1344
1327
|
p: undefined,
|
|
1345
1328
|
h: null,
|
|
1346
|
-
|
|
1347
|
-
|
|
1329
|
+
A: null,
|
|
1330
|
+
Pe: null,
|
|
1348
1331
|
O: null,
|
|
1349
|
-
|
|
1350
|
-
i:
|
|
1351
|
-
|
|
1352
|
-
|
|
1332
|
+
Oe: null,
|
|
1333
|
+
i: V,
|
|
1334
|
+
Ee: null,
|
|
1335
|
+
ke: null,
|
|
1353
1336
|
m: r?.lazy ? c : e,
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1337
|
+
ye: h,
|
|
1338
|
+
de: E,
|
|
1339
|
+
Z: S,
|
|
1357
1340
|
Ae: null,
|
|
1341
|
+
We: null,
|
|
1358
1342
|
Ce: null,
|
|
1359
|
-
|
|
1360
|
-
X: null
|
|
1343
|
+
G: null
|
|
1361
1344
|
};
|
|
1362
1345
|
s.h = s;
|
|
1363
|
-
const o =
|
|
1364
|
-
if (
|
|
1365
|
-
const e =
|
|
1346
|
+
const o = V?.t ? V.u : V;
|
|
1347
|
+
if (V) {
|
|
1348
|
+
const e = V.ke;
|
|
1366
1349
|
if (e === null) {
|
|
1367
|
-
|
|
1350
|
+
V.ke = s;
|
|
1368
1351
|
} else {
|
|
1369
|
-
s.
|
|
1370
|
-
|
|
1352
|
+
s.Ee = e;
|
|
1353
|
+
V.ke = s;
|
|
1371
1354
|
}
|
|
1372
1355
|
}
|
|
1373
1356
|
if (o) s.o = o.o + 1;
|
|
1374
|
-
if (K && ownerInSnapshotScope(
|
|
1375
|
-
if (
|
|
1357
|
+
if (K && ownerInSnapshotScope(V)) s.pe = true;
|
|
1358
|
+
if (T) {
|
|
1376
1359
|
const e = signal(undefined, { equals: false, pureWrite: true });
|
|
1377
|
-
const t =
|
|
1360
|
+
const t = T.factory(s.I, () => {
|
|
1378
1361
|
setSignal(e, undefined);
|
|
1379
1362
|
});
|
|
1380
1363
|
cleanup(() => t.dispose());
|
|
@@ -1385,56 +1368,56 @@ function computed(t, n, r) {
|
|
|
1385
1368
|
}
|
|
1386
1369
|
!r?.lazy && recompute(s, true);
|
|
1387
1370
|
if (K && !r?.lazy) {
|
|
1388
|
-
if (!(s.
|
|
1389
|
-
s.
|
|
1390
|
-
|
|
1371
|
+
if (!(s.ye & a)) {
|
|
1372
|
+
s.he = s.$ === undefined ? w : s.$;
|
|
1373
|
+
G.add(s);
|
|
1391
1374
|
}
|
|
1392
1375
|
}
|
|
1393
1376
|
return s;
|
|
1394
1377
|
}
|
|
1395
1378
|
function signal(e, t, n = null) {
|
|
1396
1379
|
const r = {
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1380
|
+
Te: t?.equals != null ? t.equals : isEqual,
|
|
1381
|
+
ce: !!t?.pureWrite,
|
|
1382
|
+
De: !!t?.De,
|
|
1383
|
+
xe: t?.unobserved,
|
|
1384
|
+
$: e,
|
|
1402
1385
|
O: null,
|
|
1403
|
-
|
|
1404
|
-
|
|
1386
|
+
Oe: null,
|
|
1387
|
+
de: E,
|
|
1405
1388
|
L: n,
|
|
1406
1389
|
W: n?.C || null,
|
|
1407
|
-
|
|
1390
|
+
Z: S
|
|
1408
1391
|
};
|
|
1409
1392
|
n && (n.C = r);
|
|
1410
|
-
if (K && !r.
|
|
1411
|
-
r.
|
|
1412
|
-
|
|
1393
|
+
if (K && !r.De && !((n?.ye ?? 0) & a)) {
|
|
1394
|
+
r.he = e === undefined ? w : e;
|
|
1395
|
+
G.add(r);
|
|
1413
1396
|
}
|
|
1414
1397
|
return r;
|
|
1415
1398
|
}
|
|
1416
1399
|
function optimisticSignal(e, t) {
|
|
1417
1400
|
const n = signal(e, t);
|
|
1418
|
-
n.
|
|
1401
|
+
n.ee = S;
|
|
1419
1402
|
return n;
|
|
1420
1403
|
}
|
|
1421
1404
|
function optimisticComputed(e, t, n) {
|
|
1422
1405
|
const r = computed(e, t, n);
|
|
1423
|
-
r.
|
|
1406
|
+
r.ee = S;
|
|
1424
1407
|
return r;
|
|
1425
1408
|
}
|
|
1426
1409
|
function isEqual(e, t) {
|
|
1427
1410
|
return e === t;
|
|
1428
1411
|
}
|
|
1429
1412
|
function untrack(e, t) {
|
|
1430
|
-
if (!
|
|
1431
|
-
const n =
|
|
1432
|
-
|
|
1413
|
+
if (!T && !H && true) return e();
|
|
1414
|
+
const n = H;
|
|
1415
|
+
H = false;
|
|
1433
1416
|
try {
|
|
1434
|
-
if (
|
|
1417
|
+
if (T) return T.untrack(e);
|
|
1435
1418
|
return e();
|
|
1436
1419
|
} finally {
|
|
1437
|
-
|
|
1420
|
+
H = n;
|
|
1438
1421
|
}
|
|
1439
1422
|
}
|
|
1440
1423
|
function read(e) {
|
|
@@ -1442,62 +1425,62 @@ function read(e) {
|
|
|
1442
1425
|
const t = getLatestValueComputed(e);
|
|
1443
1426
|
const n = M;
|
|
1444
1427
|
M = false;
|
|
1445
|
-
const r = e.
|
|
1428
|
+
const r = e.ee !== undefined && e.ee !== S ? e.ee : e.$;
|
|
1446
1429
|
let i;
|
|
1447
1430
|
try {
|
|
1448
1431
|
i = read(t);
|
|
1449
1432
|
} catch (e) {
|
|
1450
|
-
if (!
|
|
1433
|
+
if (!V && e instanceof NotReadyError) return r;
|
|
1451
1434
|
throw e;
|
|
1452
1435
|
} finally {
|
|
1453
1436
|
M = n;
|
|
1454
1437
|
}
|
|
1455
|
-
if (t.
|
|
1456
|
-
if (
|
|
1457
|
-
const e = findLane(t.
|
|
1458
|
-
const n = findLane(
|
|
1459
|
-
if (e !== n && e.
|
|
1438
|
+
if (t.ye & a) return r;
|
|
1439
|
+
if (Q && B && t.Y) {
|
|
1440
|
+
const e = findLane(t.Y);
|
|
1441
|
+
const n = findLane(B);
|
|
1442
|
+
if (e !== n && e.H.size > 0) {
|
|
1460
1443
|
return r;
|
|
1461
1444
|
}
|
|
1462
1445
|
}
|
|
1463
1446
|
return i;
|
|
1464
1447
|
}
|
|
1465
|
-
if (
|
|
1448
|
+
if (D) {
|
|
1466
1449
|
const t = e.L;
|
|
1467
|
-
const n =
|
|
1468
|
-
|
|
1469
|
-
if (t && e.
|
|
1470
|
-
if (e.
|
|
1471
|
-
|
|
1450
|
+
const n = D;
|
|
1451
|
+
D = false;
|
|
1452
|
+
if (t && e.ee !== undefined) {
|
|
1453
|
+
if (e.ee !== S && (t.Ce || !!(t.ye & a))) {
|
|
1454
|
+
F = true;
|
|
1472
1455
|
}
|
|
1473
|
-
let n =
|
|
1456
|
+
let n = V;
|
|
1474
1457
|
if (n?.t) n = n.u;
|
|
1475
|
-
if (n &&
|
|
1458
|
+
if (n && H) link(e, n);
|
|
1476
1459
|
read(getPendingSignal(e));
|
|
1477
1460
|
read(getPendingSignal(t));
|
|
1478
1461
|
} else {
|
|
1479
|
-
if (read(getPendingSignal(e)))
|
|
1480
|
-
if (t && read(getPendingSignal(t)))
|
|
1462
|
+
if (read(getPendingSignal(e))) F = true;
|
|
1463
|
+
if (t && read(getPendingSignal(t))) F = true;
|
|
1481
1464
|
}
|
|
1482
|
-
|
|
1483
|
-
return e
|
|
1465
|
+
D = n;
|
|
1466
|
+
return e.$;
|
|
1484
1467
|
}
|
|
1485
|
-
let t =
|
|
1468
|
+
let t = V;
|
|
1486
1469
|
if (t?.t) t = t.u;
|
|
1487
|
-
if (
|
|
1470
|
+
if (q && e.I) recompute(e);
|
|
1488
1471
|
if (e.m & c) {
|
|
1489
1472
|
e.m &= ~c;
|
|
1490
1473
|
recompute(e, true);
|
|
1491
1474
|
}
|
|
1492
1475
|
const n = e.L || e;
|
|
1493
|
-
if (t &&
|
|
1476
|
+
if (t && H) {
|
|
1494
1477
|
if (e.I && e.m & u) recompute(e);
|
|
1495
1478
|
link(e, t);
|
|
1496
1479
|
if (n.I) {
|
|
1497
1480
|
const r = e.m & o;
|
|
1498
|
-
if (n.o >= (r ?
|
|
1481
|
+
if (n.o >= (r ? k.j : P.j)) {
|
|
1499
1482
|
markNode(t);
|
|
1500
|
-
markHeap(r ?
|
|
1483
|
+
markHeap(r ? k : P);
|
|
1501
1484
|
updateIfNecessary(n);
|
|
1502
1485
|
}
|
|
1503
1486
|
const i = n.o;
|
|
@@ -1506,59 +1489,59 @@ function read(e) {
|
|
|
1506
1489
|
}
|
|
1507
1490
|
}
|
|
1508
1491
|
}
|
|
1509
|
-
if (n.
|
|
1510
|
-
if (t && !(
|
|
1511
|
-
if (
|
|
1512
|
-
const r = n.
|
|
1513
|
-
const i = findLane(
|
|
1492
|
+
if (n.ye & a) {
|
|
1493
|
+
if (t && !(Q && n.G && C !== n.G)) {
|
|
1494
|
+
if (B) {
|
|
1495
|
+
const r = n.Y;
|
|
1496
|
+
const i = findLane(B);
|
|
1514
1497
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1515
|
-
if (!
|
|
1516
|
-
throw n.
|
|
1498
|
+
if (!H && e !== t) link(e, t);
|
|
1499
|
+
throw n.ae;
|
|
1517
1500
|
}
|
|
1518
1501
|
} else {
|
|
1519
|
-
if (!
|
|
1520
|
-
throw n.
|
|
1502
|
+
if (!H && e !== t) link(e, t);
|
|
1503
|
+
throw n.ae;
|
|
1521
1504
|
}
|
|
1522
|
-
} else if (t && n !== e && n.
|
|
1523
|
-
if (!
|
|
1524
|
-
throw n.
|
|
1525
|
-
} else if (!t && n.
|
|
1526
|
-
throw n.
|
|
1505
|
+
} else if (t && n !== e && n.ye & h) {
|
|
1506
|
+
if (!H && e !== t) link(e, t);
|
|
1507
|
+
throw n.ae;
|
|
1508
|
+
} else if (!t && n.ye & h) {
|
|
1509
|
+
throw n.ae;
|
|
1527
1510
|
}
|
|
1528
1511
|
}
|
|
1529
|
-
if (e.I && e.
|
|
1530
|
-
if (e.
|
|
1512
|
+
if (e.I && e.ye & d) {
|
|
1513
|
+
if (e.de < E) {
|
|
1531
1514
|
recompute(e);
|
|
1532
1515
|
return read(e);
|
|
1533
|
-
} else throw e.
|
|
1516
|
+
} else throw e.ae;
|
|
1534
1517
|
}
|
|
1535
|
-
if (K && t && t.
|
|
1536
|
-
const n = e.
|
|
1518
|
+
if (K && t && t.pe) {
|
|
1519
|
+
const n = e.he;
|
|
1537
1520
|
if (n !== undefined) {
|
|
1538
1521
|
const r = n === w ? undefined : n;
|
|
1539
|
-
const i = e.
|
|
1522
|
+
const i = e.Z !== S ? e.Z : e.$;
|
|
1540
1523
|
if (i !== r) t.m |= l;
|
|
1541
1524
|
return r;
|
|
1542
1525
|
}
|
|
1543
1526
|
}
|
|
1544
|
-
if (e.
|
|
1545
|
-
if (t &&
|
|
1546
|
-
return e.
|
|
1527
|
+
if (e.ee !== undefined && e.ee !== S) {
|
|
1528
|
+
if (t && Q && shouldReadStashedOptimisticValue(e)) return e.$;
|
|
1529
|
+
return e.ee;
|
|
1547
1530
|
}
|
|
1548
1531
|
return !t ||
|
|
1549
|
-
(
|
|
1550
|
-
e.
|
|
1551
|
-
(
|
|
1552
|
-
? e
|
|
1553
|
-
: e.
|
|
1532
|
+
(B !== null && (e.ee !== undefined || e.Y || (n === e && Q) || !!(n.ye & a))) ||
|
|
1533
|
+
e.Z === S ||
|
|
1534
|
+
(Q && e.G && C !== e.G)
|
|
1535
|
+
? e.$
|
|
1536
|
+
: e.Z;
|
|
1554
1537
|
}
|
|
1555
1538
|
function setSignal(e, t) {
|
|
1556
|
-
if (e.
|
|
1557
|
-
const n = e.
|
|
1558
|
-
const r = e.
|
|
1559
|
-
const i = n ? (r ? e.
|
|
1539
|
+
if (e.G && C !== e.G) N.initTransition(e.G);
|
|
1540
|
+
const n = e.ee !== undefined && !j;
|
|
1541
|
+
const r = e.ee !== undefined && e.ee !== S;
|
|
1542
|
+
const i = n ? (r ? e.ee : e.$) : e.Z === S ? e.$ : e.Z;
|
|
1560
1543
|
if (typeof t === "function") t = t(i);
|
|
1561
|
-
const s = !e.
|
|
1544
|
+
const s = !e.Te || !e.Te(i, t) || !!(e.ye & h);
|
|
1562
1545
|
if (!s) {
|
|
1563
1546
|
if (n && r && e.I) {
|
|
1564
1547
|
insertSubs(e, true);
|
|
@@ -1567,112 +1550,112 @@ function setSignal(e, t) {
|
|
|
1567
1550
|
return t;
|
|
1568
1551
|
}
|
|
1569
1552
|
if (n) {
|
|
1570
|
-
const n = e.
|
|
1571
|
-
if (!n)
|
|
1553
|
+
const n = e.ee === S;
|
|
1554
|
+
if (!n) N.initTransition(resolveTransition(e));
|
|
1572
1555
|
if (n) {
|
|
1573
|
-
e.
|
|
1574
|
-
|
|
1556
|
+
e.Z = e.$;
|
|
1557
|
+
N.U.push(e);
|
|
1575
1558
|
}
|
|
1576
1559
|
e.be = true;
|
|
1577
1560
|
const r = getOrCreateLane(e);
|
|
1578
|
-
e.
|
|
1579
|
-
e.
|
|
1561
|
+
e.Y = r;
|
|
1562
|
+
e.ee = t;
|
|
1580
1563
|
} else {
|
|
1581
|
-
if (e.
|
|
1582
|
-
e.
|
|
1564
|
+
if (e.Z === S) N.se.push(e);
|
|
1565
|
+
e.Z = t;
|
|
1583
1566
|
}
|
|
1584
1567
|
updatePendingSignal(e);
|
|
1585
|
-
if (e.
|
|
1586
|
-
setSignal(e.
|
|
1568
|
+
if (e.He) {
|
|
1569
|
+
setSignal(e.He, t);
|
|
1587
1570
|
}
|
|
1588
|
-
e.
|
|
1571
|
+
e.de = E;
|
|
1589
1572
|
insertSubs(e, n);
|
|
1590
1573
|
schedule();
|
|
1591
1574
|
return t;
|
|
1592
1575
|
}
|
|
1593
1576
|
function runWithOwner(e, t) {
|
|
1594
|
-
const n =
|
|
1595
|
-
const r =
|
|
1596
|
-
|
|
1597
|
-
|
|
1577
|
+
const n = V;
|
|
1578
|
+
const r = H;
|
|
1579
|
+
V = e;
|
|
1580
|
+
H = false;
|
|
1598
1581
|
try {
|
|
1599
1582
|
return t();
|
|
1600
1583
|
} finally {
|
|
1601
|
-
|
|
1602
|
-
|
|
1584
|
+
V = n;
|
|
1585
|
+
H = r;
|
|
1603
1586
|
}
|
|
1604
1587
|
}
|
|
1605
1588
|
function getPendingSignal(e) {
|
|
1606
|
-
if (!e.
|
|
1607
|
-
e.
|
|
1608
|
-
if (e.
|
|
1609
|
-
e.
|
|
1589
|
+
if (!e.Fe) {
|
|
1590
|
+
e.Fe = optimisticSignal(false, { pureWrite: true });
|
|
1591
|
+
if (e.we) {
|
|
1592
|
+
e.Fe.we = e;
|
|
1610
1593
|
}
|
|
1611
|
-
if (computePendingState(e)) setSignal(e.
|
|
1594
|
+
if (computePendingState(e)) setSignal(e.Fe, true);
|
|
1612
1595
|
}
|
|
1613
|
-
return e.
|
|
1596
|
+
return e.Fe;
|
|
1614
1597
|
}
|
|
1615
1598
|
function computePendingState(e) {
|
|
1616
1599
|
const t = e;
|
|
1617
1600
|
const n = e.L;
|
|
1618
|
-
if (n && e.
|
|
1619
|
-
return !n.
|
|
1601
|
+
if (n && e.Z !== S) {
|
|
1602
|
+
return !n.Ce && !(n.ye & a);
|
|
1620
1603
|
}
|
|
1621
|
-
if (e.
|
|
1622
|
-
if (t.
|
|
1623
|
-
if (e.
|
|
1624
|
-
const t = e.
|
|
1625
|
-
return !!(t && t.
|
|
1604
|
+
if (e.ee !== undefined && e.ee !== S) {
|
|
1605
|
+
if (t.ye & a && !(t.ye & h)) return true;
|
|
1606
|
+
if (e.we) {
|
|
1607
|
+
const t = e.Y ? findLane(e.Y) : null;
|
|
1608
|
+
return !!(t && t.H.size > 0);
|
|
1626
1609
|
}
|
|
1627
1610
|
return true;
|
|
1628
1611
|
}
|
|
1629
|
-
if (e.
|
|
1612
|
+
if (e.ee !== undefined && e.ee === S && !e.we) {
|
|
1630
1613
|
return false;
|
|
1631
1614
|
}
|
|
1632
|
-
if (e.
|
|
1633
|
-
return !!(t.
|
|
1615
|
+
if (e.Z !== S && !(t.ye & h)) return true;
|
|
1616
|
+
return !!(t.ye & a && !(t.ye & h));
|
|
1634
1617
|
}
|
|
1635
1618
|
function updatePendingSignal(e) {
|
|
1636
|
-
if (e.
|
|
1619
|
+
if (e.Fe) {
|
|
1637
1620
|
const t = computePendingState(e);
|
|
1638
|
-
const n = e.
|
|
1621
|
+
const n = e.Fe;
|
|
1639
1622
|
setSignal(n, t);
|
|
1640
|
-
if (!t && n.
|
|
1623
|
+
if (!t && n.Y) {
|
|
1641
1624
|
const t = resolveLane(e);
|
|
1642
|
-
if (t && t.
|
|
1643
|
-
const e = findLane(n.
|
|
1625
|
+
if (t && t.H.size > 0) {
|
|
1626
|
+
const e = findLane(n.Y);
|
|
1644
1627
|
if (e !== t) {
|
|
1645
1628
|
mergeLanes(t, e);
|
|
1646
1629
|
}
|
|
1647
1630
|
}
|
|
1648
|
-
|
|
1649
|
-
n.
|
|
1631
|
+
R.delete(n);
|
|
1632
|
+
n.Y = undefined;
|
|
1650
1633
|
}
|
|
1651
1634
|
}
|
|
1652
1635
|
}
|
|
1653
1636
|
function getLatestValueComputed(e) {
|
|
1654
|
-
if (!e.
|
|
1637
|
+
if (!e.He) {
|
|
1655
1638
|
const t = M;
|
|
1656
1639
|
M = false;
|
|
1657
|
-
const n =
|
|
1658
|
-
|
|
1659
|
-
const r =
|
|
1660
|
-
|
|
1661
|
-
e.
|
|
1662
|
-
e.
|
|
1663
|
-
|
|
1664
|
-
|
|
1640
|
+
const n = D;
|
|
1641
|
+
D = false;
|
|
1642
|
+
const r = V;
|
|
1643
|
+
V = null;
|
|
1644
|
+
e.He = optimisticComputed(() => read(e));
|
|
1645
|
+
e.He.we = e;
|
|
1646
|
+
V = r;
|
|
1647
|
+
D = n;
|
|
1665
1648
|
M = t;
|
|
1666
1649
|
}
|
|
1667
|
-
return e.
|
|
1650
|
+
return e.He;
|
|
1668
1651
|
}
|
|
1669
1652
|
function staleValues(e, t = true) {
|
|
1670
|
-
const n =
|
|
1671
|
-
|
|
1653
|
+
const n = Q;
|
|
1654
|
+
Q = t;
|
|
1672
1655
|
try {
|
|
1673
1656
|
return e();
|
|
1674
1657
|
} finally {
|
|
1675
|
-
|
|
1658
|
+
Q = n;
|
|
1676
1659
|
}
|
|
1677
1660
|
}
|
|
1678
1661
|
function latest(e) {
|
|
@@ -1685,23 +1668,23 @@ function latest(e) {
|
|
|
1685
1668
|
}
|
|
1686
1669
|
}
|
|
1687
1670
|
function isPending(e) {
|
|
1688
|
-
const t =
|
|
1689
|
-
const n =
|
|
1690
|
-
|
|
1691
|
-
|
|
1671
|
+
const t = D;
|
|
1672
|
+
const n = F;
|
|
1673
|
+
D = true;
|
|
1674
|
+
F = false;
|
|
1692
1675
|
try {
|
|
1693
1676
|
e();
|
|
1694
|
-
return
|
|
1677
|
+
return F;
|
|
1695
1678
|
} catch {
|
|
1696
|
-
return
|
|
1679
|
+
return F;
|
|
1697
1680
|
} finally {
|
|
1698
|
-
|
|
1699
|
-
|
|
1681
|
+
D = t;
|
|
1682
|
+
F = n;
|
|
1700
1683
|
}
|
|
1701
1684
|
}
|
|
1702
1685
|
function refresh(e) {
|
|
1703
|
-
let t =
|
|
1704
|
-
|
|
1686
|
+
let t = q;
|
|
1687
|
+
q = true;
|
|
1705
1688
|
try {
|
|
1706
1689
|
if (typeof e !== "function") {
|
|
1707
1690
|
recompute(e[O]);
|
|
@@ -1709,14 +1692,14 @@ function refresh(e) {
|
|
|
1709
1692
|
}
|
|
1710
1693
|
return untrack(e);
|
|
1711
1694
|
} finally {
|
|
1712
|
-
|
|
1695
|
+
q = t;
|
|
1713
1696
|
if (!t) {
|
|
1714
1697
|
schedule();
|
|
1715
1698
|
}
|
|
1716
1699
|
}
|
|
1717
1700
|
}
|
|
1718
1701
|
function isRefreshing() {
|
|
1719
|
-
return
|
|
1702
|
+
return q;
|
|
1720
1703
|
}
|
|
1721
1704
|
function createContext(e, t) {
|
|
1722
1705
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1725,7 +1708,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1725
1708
|
if (!t) {
|
|
1726
1709
|
throw new NoOwnerError();
|
|
1727
1710
|
}
|
|
1728
|
-
const n = hasContext(e, t) ? t.
|
|
1711
|
+
const n = hasContext(e, t) ? t.Le[e.id] : e.defaultValue;
|
|
1729
1712
|
if (isUndefined(n)) {
|
|
1730
1713
|
throw new ContextNotFoundError();
|
|
1731
1714
|
}
|
|
@@ -1735,10 +1718,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1735
1718
|
if (!n) {
|
|
1736
1719
|
throw new NoOwnerError();
|
|
1737
1720
|
}
|
|
1738
|
-
n.
|
|
1721
|
+
n.Le = { ...n.Le, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1739
1722
|
}
|
|
1740
1723
|
function hasContext(e, t) {
|
|
1741
|
-
return !isUndefined(t?.
|
|
1724
|
+
return !isUndefined(t?.Le[e.id]);
|
|
1742
1725
|
}
|
|
1743
1726
|
function isUndefined(e) {
|
|
1744
1727
|
return typeof e === "undefined";
|
|
@@ -1748,27 +1731,27 @@ function effect(e, t, n, r, i) {
|
|
|
1748
1731
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
1749
1732
|
...i,
|
|
1750
1733
|
equals: () => {
|
|
1751
|
-
o.
|
|
1752
|
-
if (s) o.
|
|
1734
|
+
o.F = !o.ae;
|
|
1735
|
+
if (s) o.M.enqueue(o.D, runEffect.bind(o));
|
|
1753
1736
|
return false;
|
|
1754
1737
|
},
|
|
1755
1738
|
lazy: true
|
|
1756
1739
|
});
|
|
1757
1740
|
o.Me = r;
|
|
1758
|
-
o.
|
|
1759
|
-
o.
|
|
1741
|
+
o.Ve = t;
|
|
1742
|
+
o.Be = n;
|
|
1760
1743
|
o.Ke = undefined;
|
|
1761
|
-
o.
|
|
1762
|
-
o.
|
|
1763
|
-
const n = e !== undefined ? e : o.
|
|
1764
|
-
const r = t !== undefined ? t : o.
|
|
1744
|
+
o.D = i?.render ? p : y;
|
|
1745
|
+
o.Qe = (e, t) => {
|
|
1746
|
+
const n = e !== undefined ? e : o.ye;
|
|
1747
|
+
const r = t !== undefined ? t : o.ae;
|
|
1765
1748
|
if (n & d) {
|
|
1766
1749
|
let e = r;
|
|
1767
|
-
o.
|
|
1768
|
-
if (o.
|
|
1750
|
+
o.M.notify(o, a, 0);
|
|
1751
|
+
if (o.D === y) {
|
|
1769
1752
|
try {
|
|
1770
|
-
return o.
|
|
1771
|
-
? o.
|
|
1753
|
+
return o.Be
|
|
1754
|
+
? o.Be(e, () => {
|
|
1772
1755
|
o.Ke?.();
|
|
1773
1756
|
o.Ke = undefined;
|
|
1774
1757
|
})
|
|
@@ -1777,38 +1760,38 @@ function effect(e, t, n, r, i) {
|
|
|
1777
1760
|
e = t;
|
|
1778
1761
|
}
|
|
1779
1762
|
}
|
|
1780
|
-
if (!o.
|
|
1781
|
-
} else if (o.
|
|
1782
|
-
o.
|
|
1763
|
+
if (!o.M.notify(o, d, d)) throw e;
|
|
1764
|
+
} else if (o.D === p) {
|
|
1765
|
+
o.M.notify(o, a | d, n, r);
|
|
1783
1766
|
}
|
|
1784
1767
|
};
|
|
1785
1768
|
recompute(o, true);
|
|
1786
|
-
!i?.defer && (o.
|
|
1769
|
+
!i?.defer && (o.D === y ? o.M.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
|
|
1787
1770
|
s = true;
|
|
1788
1771
|
cleanup(() => o.Ke?.());
|
|
1789
1772
|
}
|
|
1790
1773
|
function runEffect() {
|
|
1791
|
-
if (!this.
|
|
1774
|
+
if (!this.F || this.m & u) return;
|
|
1792
1775
|
this.Ke?.();
|
|
1793
1776
|
this.Ke = undefined;
|
|
1794
1777
|
try {
|
|
1795
|
-
const e = this.
|
|
1778
|
+
const e = this.Ve(this.$, this.Me);
|
|
1796
1779
|
if (false && e !== undefined && typeof e !== "function");
|
|
1797
1780
|
this.Ke = e;
|
|
1798
1781
|
} catch (e) {
|
|
1799
|
-
this.
|
|
1800
|
-
this.
|
|
1801
|
-
if (!this.
|
|
1782
|
+
this.ae = new StatusError(this, e);
|
|
1783
|
+
this.ye |= d;
|
|
1784
|
+
if (!this.M.notify(this, d, d)) throw e;
|
|
1802
1785
|
} finally {
|
|
1803
|
-
this.Me = this
|
|
1804
|
-
this.
|
|
1786
|
+
this.Me = this.$;
|
|
1787
|
+
this.F = false;
|
|
1805
1788
|
}
|
|
1806
1789
|
}
|
|
1807
1790
|
function trackedEffect(e, t) {
|
|
1808
1791
|
const run = () => {
|
|
1809
|
-
if (!n.
|
|
1792
|
+
if (!n.F || n.m & u) return;
|
|
1810
1793
|
try {
|
|
1811
|
-
n.
|
|
1794
|
+
n.F = false;
|
|
1812
1795
|
recompute(n);
|
|
1813
1796
|
} finally {
|
|
1814
1797
|
}
|
|
@@ -1824,23 +1807,23 @@ function trackedEffect(e, t) {
|
|
|
1824
1807
|
{ ...t, lazy: true }
|
|
1825
1808
|
);
|
|
1826
1809
|
n.Ke = undefined;
|
|
1827
|
-
n.
|
|
1828
|
-
n.
|
|
1829
|
-
n.
|
|
1830
|
-
n.
|
|
1831
|
-
const r = e !== undefined ? e : n.
|
|
1810
|
+
n.Ge = true;
|
|
1811
|
+
n.F = true;
|
|
1812
|
+
n.D = g;
|
|
1813
|
+
n.Qe = (e, t) => {
|
|
1814
|
+
const r = e !== undefined ? e : n.ye;
|
|
1832
1815
|
if (r & d) {
|
|
1833
|
-
n.
|
|
1834
|
-
const e = t !== undefined ? t : n.
|
|
1835
|
-
if (!n.
|
|
1816
|
+
n.M.notify(n, a, 0);
|
|
1817
|
+
const e = t !== undefined ? t : n.ae;
|
|
1818
|
+
if (!n.M.notify(n, d, d)) throw e;
|
|
1836
1819
|
}
|
|
1837
1820
|
};
|
|
1838
|
-
n.
|
|
1839
|
-
n.
|
|
1821
|
+
n.V = run;
|
|
1822
|
+
n.M.enqueue(y, run);
|
|
1840
1823
|
cleanup(() => n.Ke?.());
|
|
1841
1824
|
}
|
|
1842
1825
|
function restoreTransition(e, t) {
|
|
1843
|
-
|
|
1826
|
+
N.initTransition(e);
|
|
1844
1827
|
const n = t();
|
|
1845
1828
|
flush();
|
|
1846
1829
|
return n;
|
|
@@ -1849,13 +1832,13 @@ function action(e) {
|
|
|
1849
1832
|
return (...t) =>
|
|
1850
1833
|
new Promise((n, r) => {
|
|
1851
1834
|
const i = e(...t);
|
|
1852
|
-
|
|
1853
|
-
let s =
|
|
1854
|
-
s.
|
|
1835
|
+
N.initTransition();
|
|
1836
|
+
let s = C;
|
|
1837
|
+
s.K.push(i);
|
|
1855
1838
|
const done = (e, t) => {
|
|
1856
1839
|
s = currentTransition(s);
|
|
1857
|
-
const o = s.
|
|
1858
|
-
if (o >= 0) s.
|
|
1840
|
+
const o = s.K.indexOf(i);
|
|
1841
|
+
if (o >= 0) s.K.splice(o, 1);
|
|
1859
1842
|
setActiveTransition(s);
|
|
1860
1843
|
schedule();
|
|
1861
1844
|
t ? r(t) : n(e);
|
|
@@ -1959,15 +1942,15 @@ function createOptimistic(e, t, n) {
|
|
|
1959
1942
|
}
|
|
1960
1943
|
function onSettled(e) {
|
|
1961
1944
|
const t = getOwner();
|
|
1962
|
-
t && !t.
|
|
1945
|
+
t && !t.Ge
|
|
1963
1946
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
1964
|
-
:
|
|
1947
|
+
: N.enqueue(y, () => {
|
|
1965
1948
|
const t = e();
|
|
1966
1949
|
t?.();
|
|
1967
1950
|
});
|
|
1968
1951
|
}
|
|
1969
1952
|
function unwrap(e) {
|
|
1970
|
-
return e?.[
|
|
1953
|
+
return e?.[U]?.[ee] ?? e;
|
|
1971
1954
|
}
|
|
1972
1955
|
function getOverrideValue(e, t, n, r, i) {
|
|
1973
1956
|
if (i && r in i) return i[r];
|
|
@@ -1979,21 +1962,21 @@ function getAllKeys(e, t, n) {
|
|
|
1979
1962
|
return Array.from(new Set([...r, ...i]));
|
|
1980
1963
|
}
|
|
1981
1964
|
function applyState(e, t, n) {
|
|
1982
|
-
const r = t?.[
|
|
1965
|
+
const r = t?.[U];
|
|
1983
1966
|
if (!r) return;
|
|
1984
|
-
const i = r[
|
|
1985
|
-
const s = r[
|
|
1986
|
-
const o = r[
|
|
1987
|
-
let u = r[
|
|
1967
|
+
const i = r[Y];
|
|
1968
|
+
const s = r[Z];
|
|
1969
|
+
const o = r[$];
|
|
1970
|
+
let u = r[ee];
|
|
1988
1971
|
if (e === i && !s && !o) return;
|
|
1989
|
-
(r[
|
|
1990
|
-
r[
|
|
1991
|
-
r[
|
|
1972
|
+
(r[re] || oe).set(e, r[J]);
|
|
1973
|
+
r[Y] = e;
|
|
1974
|
+
r[Z] = undefined;
|
|
1992
1975
|
if (Array.isArray(i)) {
|
|
1993
1976
|
let t = false;
|
|
1994
1977
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
1995
1978
|
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1996
|
-
let l, c, a, d, h, p,
|
|
1979
|
+
let l, c, a, d, h, p, y, g;
|
|
1997
1980
|
for (
|
|
1998
1981
|
a = 0, d = Math.min(f, e.length);
|
|
1999
1982
|
a < d &&
|
|
@@ -2016,59 +1999,59 @@ function applyState(e, t, n) {
|
|
|
2016
1999
|
if (a > h || a > d) {
|
|
2017
2000
|
for (c = a; c <= h; c++) {
|
|
2018
2001
|
t = true;
|
|
2019
|
-
r[
|
|
2002
|
+
r[ee][c] && setSignal(r[ee][c], wrap(e[c], r));
|
|
2020
2003
|
}
|
|
2021
2004
|
for (; c < e.length; c++) {
|
|
2022
2005
|
t = true;
|
|
2023
2006
|
const i = wrap(S[c], r);
|
|
2024
|
-
r[
|
|
2007
|
+
r[ee][c] && setSignal(r[ee][c], i);
|
|
2025
2008
|
applyState(e[c], i, n);
|
|
2026
2009
|
}
|
|
2027
|
-
t && r[
|
|
2028
|
-
f !== e.length && r[
|
|
2010
|
+
t && r[ee][z] && setSignal(r[ee][z], void 0);
|
|
2011
|
+
f !== e.length && r[ee].length && setSignal(r[ee].length, e.length);
|
|
2029
2012
|
return;
|
|
2030
2013
|
}
|
|
2031
|
-
|
|
2014
|
+
y = new Array(h + 1);
|
|
2032
2015
|
for (c = h; c >= a; c--) {
|
|
2033
2016
|
p = e[c];
|
|
2034
|
-
|
|
2035
|
-
l = w.get(
|
|
2036
|
-
|
|
2037
|
-
w.set(
|
|
2017
|
+
g = p ? n(p) : p;
|
|
2018
|
+
l = w.get(g);
|
|
2019
|
+
y[c] = l === undefined ? -1 : l;
|
|
2020
|
+
w.set(g, c);
|
|
2038
2021
|
}
|
|
2039
2022
|
for (l = a; l <= d; l++) {
|
|
2040
2023
|
p = getOverrideValue(i, s, u, l, o);
|
|
2041
|
-
|
|
2042
|
-
c = w.get(
|
|
2024
|
+
g = p ? n(p) : p;
|
|
2025
|
+
c = w.get(g);
|
|
2043
2026
|
if (c !== undefined && c !== -1) {
|
|
2044
2027
|
S[c] = p;
|
|
2045
|
-
c =
|
|
2046
|
-
w.set(
|
|
2028
|
+
c = y[c];
|
|
2029
|
+
w.set(g, c);
|
|
2047
2030
|
}
|
|
2048
2031
|
}
|
|
2049
2032
|
for (c = a; c < e.length; c++) {
|
|
2050
2033
|
if (c in S) {
|
|
2051
2034
|
const t = wrap(S[c], r);
|
|
2052
|
-
r[
|
|
2035
|
+
r[ee][c] && setSignal(r[ee][c], t);
|
|
2053
2036
|
applyState(e[c], t, n);
|
|
2054
|
-
} else r[
|
|
2037
|
+
} else r[ee][c] && setSignal(r[ee][c], wrap(e[c], r));
|
|
2055
2038
|
}
|
|
2056
2039
|
if (a < e.length) t = true;
|
|
2057
2040
|
} else if (e.length) {
|
|
2058
2041
|
for (let t = 0, f = e.length; t < f; t++) {
|
|
2059
2042
|
const f = getOverrideValue(i, s, u, t, o);
|
|
2060
|
-
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[
|
|
2043
|
+
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[ee][t] && setSignal(r[ee][t], e[t]);
|
|
2061
2044
|
}
|
|
2062
2045
|
}
|
|
2063
2046
|
if (f !== e.length) {
|
|
2064
2047
|
t = true;
|
|
2065
|
-
r[
|
|
2048
|
+
r[ee].length && setSignal(r[ee].length, e.length);
|
|
2066
2049
|
}
|
|
2067
|
-
t && r[
|
|
2050
|
+
t && r[ee][z] && setSignal(r[ee][z], void 0);
|
|
2068
2051
|
return;
|
|
2069
2052
|
}
|
|
2070
2053
|
if (u) {
|
|
2071
|
-
const t = u[
|
|
2054
|
+
const t = u[z];
|
|
2072
2055
|
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
2073
2056
|
for (let l = 0, c = f.length; l < c; l++) {
|
|
2074
2057
|
const c = f[l];
|
|
@@ -2082,7 +2065,7 @@ function applyState(e, t, n) {
|
|
|
2082
2065
|
} else applyState(h, wrap(d, r), n);
|
|
2083
2066
|
}
|
|
2084
2067
|
}
|
|
2085
|
-
if ((u = r[
|
|
2068
|
+
if ((u = r[te])) {
|
|
2086
2069
|
const t = Object.keys(u);
|
|
2087
2070
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2088
2071
|
const r = t[n];
|
|
@@ -2104,9 +2087,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2104
2087
|
let r;
|
|
2105
2088
|
const i = new WeakMap();
|
|
2106
2089
|
const wrapper = e => {
|
|
2107
|
-
e[
|
|
2108
|
-
e[
|
|
2109
|
-
Object.defineProperty(e,
|
|
2090
|
+
e[ne] = wrapProjection;
|
|
2091
|
+
e[re] = i;
|
|
2092
|
+
Object.defineProperty(e, ie, {
|
|
2110
2093
|
get() {
|
|
2111
2094
|
return r;
|
|
2112
2095
|
},
|
|
@@ -2115,8 +2098,8 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2115
2098
|
};
|
|
2116
2099
|
const wrapProjection = e => {
|
|
2117
2100
|
if (i.has(e)) return i.get(e);
|
|
2118
|
-
if (e[
|
|
2119
|
-
const t = createStoreProxy(e,
|
|
2101
|
+
if (e[U]?.[ne] === wrapProjection) return e;
|
|
2102
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
2120
2103
|
i.set(e, t);
|
|
2121
2104
|
return t;
|
|
2122
2105
|
};
|
|
@@ -2127,7 +2110,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2127
2110
|
let i;
|
|
2128
2111
|
const o = new Proxy(
|
|
2129
2112
|
s,
|
|
2130
|
-
createWriteTraps(() => !r || t.
|
|
2113
|
+
createWriteTraps(() => !r || t.Ce === i)
|
|
2131
2114
|
);
|
|
2132
2115
|
storeSetter(o, o => {
|
|
2133
2116
|
i = e(o);
|
|
@@ -2138,7 +2121,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2138
2121
|
u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
|
|
2139
2122
|
});
|
|
2140
2123
|
});
|
|
2141
|
-
r.
|
|
2124
|
+
r.ve = true;
|
|
2142
2125
|
return { store: s, node: r };
|
|
2143
2126
|
}
|
|
2144
2127
|
function createProjection(e, t = {}, n) {
|
|
@@ -2197,33 +2180,33 @@ function createWriteTraps(e) {
|
|
|
2197
2180
|
};
|
|
2198
2181
|
return t;
|
|
2199
2182
|
}
|
|
2200
|
-
const
|
|
2183
|
+
const z = Symbol(0),
|
|
2184
|
+
U = Symbol(0),
|
|
2201
2185
|
J = Symbol(0),
|
|
2202
|
-
X = Symbol(0)
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
$ = "
|
|
2206
|
-
ee = "
|
|
2207
|
-
te = "
|
|
2208
|
-
ne = "
|
|
2209
|
-
re = "
|
|
2210
|
-
ie = "
|
|
2211
|
-
se = "
|
|
2212
|
-
|
|
2213
|
-
function createStoreProxy(e, t = ce, n) {
|
|
2186
|
+
X = Symbol(0);
|
|
2187
|
+
const Y = "v",
|
|
2188
|
+
Z = "o",
|
|
2189
|
+
$ = "x",
|
|
2190
|
+
ee = "n",
|
|
2191
|
+
te = "h",
|
|
2192
|
+
ne = "w",
|
|
2193
|
+
re = "l",
|
|
2194
|
+
ie = "f",
|
|
2195
|
+
se = "p";
|
|
2196
|
+
function createStoreProxy(e, t = le, n) {
|
|
2214
2197
|
let r;
|
|
2215
2198
|
if (Array.isArray(e)) {
|
|
2216
2199
|
r = [];
|
|
2217
2200
|
r.v = e;
|
|
2218
2201
|
} else r = { v: e };
|
|
2219
2202
|
n && n(r);
|
|
2220
|
-
return (r[
|
|
2203
|
+
return (r[J] = new Proxy(r, t));
|
|
2221
2204
|
}
|
|
2222
|
-
const
|
|
2205
|
+
const oe = new WeakMap();
|
|
2223
2206
|
function wrap(e, t) {
|
|
2224
|
-
if (t?.[
|
|
2225
|
-
let n = e[
|
|
2226
|
-
if (!n)
|
|
2207
|
+
if (t?.[ne]) return t[ne](e, t);
|
|
2208
|
+
let n = e[J] || oe.get(e);
|
|
2209
|
+
if (!n) oe.set(e, (n = createStoreProxy(e)));
|
|
2227
2210
|
return n;
|
|
2228
2211
|
}
|
|
2229
2212
|
function isWrappable(e) {
|
|
@@ -2234,12 +2217,12 @@ function isWrappable(e) {
|
|
|
2234
2217
|
!(typeof Node !== "undefined" && e instanceof Node)
|
|
2235
2218
|
);
|
|
2236
2219
|
}
|
|
2237
|
-
let
|
|
2220
|
+
let ue = false;
|
|
2238
2221
|
function setWriteOverride(e) {
|
|
2239
|
-
|
|
2222
|
+
ue = e;
|
|
2240
2223
|
}
|
|
2241
2224
|
function writeOnly(e) {
|
|
2242
|
-
return
|
|
2225
|
+
return ue || !!fe?.has(e);
|
|
2243
2226
|
}
|
|
2244
2227
|
function getNodes(e, t) {
|
|
2245
2228
|
let n = e[t];
|
|
@@ -2259,17 +2242,17 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2259
2242
|
r
|
|
2260
2243
|
);
|
|
2261
2244
|
if (s) {
|
|
2262
|
-
u.
|
|
2245
|
+
u.ee = S;
|
|
2263
2246
|
}
|
|
2264
2247
|
if (o && t in o) {
|
|
2265
2248
|
const e = o[t];
|
|
2266
|
-
u.
|
|
2267
|
-
|
|
2249
|
+
u.he = e === undefined ? w : e;
|
|
2250
|
+
G?.add(u);
|
|
2268
2251
|
}
|
|
2269
2252
|
return (e[t] = u);
|
|
2270
2253
|
}
|
|
2271
|
-
function trackSelf(e, t =
|
|
2272
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2254
|
+
function trackSelf(e, t = z) {
|
|
2255
|
+
getObserver() && read(getNode(getNodes(e, ee), t, undefined, e[ie], false, e[se]));
|
|
2273
2256
|
}
|
|
2274
2257
|
function getKeys(e, t, n = true) {
|
|
2275
2258
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2277,162 +2260,182 @@ function getKeys(e, t, n = true) {
|
|
|
2277
2260
|
const i = new Set(r);
|
|
2278
2261
|
const s = Reflect.ownKeys(t);
|
|
2279
2262
|
for (const e of s) {
|
|
2280
|
-
if (t[e] !==
|
|
2263
|
+
if (t[e] !== X) i.add(e);
|
|
2281
2264
|
else i.delete(e);
|
|
2282
2265
|
}
|
|
2283
2266
|
return Array.from(i);
|
|
2284
2267
|
}
|
|
2285
2268
|
function getPropertyDescriptor(e, t, n) {
|
|
2286
|
-
let r = e;
|
|
2287
2269
|
if (t && n in t) {
|
|
2288
|
-
if (
|
|
2289
|
-
|
|
2270
|
+
if (t[n] === X) return void 0;
|
|
2271
|
+
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2272
|
+
if (r?.get || r?.set || !(n in e)) return r;
|
|
2273
|
+
}
|
|
2274
|
+
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2275
|
+
}
|
|
2276
|
+
function prepareStoreWrite(e, t, n) {
|
|
2277
|
+
if (e[se]) {
|
|
2278
|
+
const t = e[ie];
|
|
2279
|
+
if (t?.G) {
|
|
2280
|
+
N.initTransition(t.G);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
const r = e[Y];
|
|
2284
|
+
const i = r[n];
|
|
2285
|
+
if (K && typeof n !== "symbol" && !((e[ie]?.ye ?? 0) & a)) {
|
|
2286
|
+
if (!e[m]) {
|
|
2287
|
+
e[m] = Object.create(null);
|
|
2288
|
+
G?.add(e);
|
|
2289
|
+
}
|
|
2290
|
+
if (!(n in e[m])) {
|
|
2291
|
+
e[m][n] = i;
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
const s = e[se] && !j;
|
|
2295
|
+
const o = s ? $ : Z;
|
|
2296
|
+
if (s) trackOptimisticStore(t);
|
|
2297
|
+
return { base: i, overrideKey: o, state: r };
|
|
2298
|
+
}
|
|
2299
|
+
function notifyStoreProperty(e, t, n, r) {
|
|
2300
|
+
if (e[te]?.[t]) setSignal(e[te][t], n !== "delete");
|
|
2301
|
+
const i = getNodes(e, ee);
|
|
2302
|
+
if (n === "set") {
|
|
2303
|
+
i[t] && setSignal(i[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2304
|
+
} else if (n === "invalidate") {
|
|
2305
|
+
if (i[t]) {
|
|
2306
|
+
setSignal(i[t], {});
|
|
2307
|
+
delete i[t];
|
|
2308
|
+
}
|
|
2309
|
+
} else {
|
|
2310
|
+
i[t] && setSignal(i[t], undefined);
|
|
2290
2311
|
}
|
|
2291
|
-
|
|
2312
|
+
i[z] && setSignal(i[z], undefined);
|
|
2292
2313
|
}
|
|
2293
|
-
let
|
|
2294
|
-
const
|
|
2314
|
+
let fe = null;
|
|
2315
|
+
const le = {
|
|
2295
2316
|
get(e, t, n) {
|
|
2296
|
-
if (t ===
|
|
2297
|
-
if (t ===
|
|
2298
|
-
if (t === O) return e[
|
|
2299
|
-
if (t ===
|
|
2317
|
+
if (t === U) return e;
|
|
2318
|
+
if (t === J) return n;
|
|
2319
|
+
if (t === O) return e[ie];
|
|
2320
|
+
if (t === z) {
|
|
2300
2321
|
trackSelf(e);
|
|
2301
2322
|
return n;
|
|
2302
2323
|
}
|
|
2303
|
-
const r = getNodes(e,
|
|
2324
|
+
const r = getNodes(e, ee);
|
|
2304
2325
|
const i = r[t];
|
|
2305
|
-
const s = e[
|
|
2306
|
-
const o = s || (e[
|
|
2307
|
-
const u = !!e[
|
|
2308
|
-
const f = s ? e[
|
|
2326
|
+
const s = e[$] && t in e[$];
|
|
2327
|
+
const o = s || (e[Z] && t in e[Z]);
|
|
2328
|
+
const u = !!e[Y][U];
|
|
2329
|
+
const f = s ? e[$] : e[Z] && t in e[Z] ? e[Z] : e[Y];
|
|
2309
2330
|
if (!i) {
|
|
2310
2331
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
2311
2332
|
if (e && e.get) return e.get.call(n);
|
|
2312
2333
|
}
|
|
2313
2334
|
if (writeOnly(n)) {
|
|
2314
2335
|
let n =
|
|
2315
|
-
i && (o || !u)
|
|
2316
|
-
|
|
2317
|
-
? i.re
|
|
2318
|
-
: i.te !== S
|
|
2319
|
-
? i.te
|
|
2320
|
-
: i.ne
|
|
2321
|
-
: f[t];
|
|
2322
|
-
n === Y && (n = undefined);
|
|
2336
|
+
i && (o || !u) ? (i.ee !== undefined && i.ee !== S ? i.ee : i.Z !== S ? i.Z : i.$) : f[t];
|
|
2337
|
+
n === X && (n = undefined);
|
|
2323
2338
|
if (!isWrappable(n)) return n;
|
|
2324
2339
|
const r = wrap(n, e);
|
|
2325
|
-
|
|
2340
|
+
fe?.add(r);
|
|
2326
2341
|
return r;
|
|
2327
2342
|
}
|
|
2328
2343
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2329
|
-
l ===
|
|
2344
|
+
l === X && (l = undefined);
|
|
2330
2345
|
if (!i) {
|
|
2331
2346
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
2332
2347
|
let t;
|
|
2333
|
-
return !Array.isArray(e[
|
|
2348
|
+
return !Array.isArray(e[Y]) && (t = Object.getPrototypeOf(e[Y])) && t !== Object.prototype
|
|
2334
2349
|
? l.bind(f)
|
|
2335
2350
|
: l;
|
|
2336
2351
|
} else if (getObserver()) {
|
|
2337
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
2352
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[ie], isEqual, e[se], e[m]));
|
|
2338
2353
|
}
|
|
2339
2354
|
}
|
|
2340
2355
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
2341
2356
|
},
|
|
2342
2357
|
has(e, t) {
|
|
2343
|
-
if (t ===
|
|
2344
|
-
const n = e[
|
|
2345
|
-
if (!writeOnly(e[
|
|
2346
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2358
|
+
if (t === J || t === z || t === "__proto__") return true;
|
|
2359
|
+
const n = e[$] && t in e[$] ? e[$][t] !== X : e[Z] && t in e[Z] ? e[Z][t] !== X : t in e[Y];
|
|
2360
|
+
if (!writeOnly(e[J])) {
|
|
2361
|
+
getObserver() && read(getNode(getNodes(e, te), t, n, e[ie], isEqual, e[se]));
|
|
2347
2362
|
}
|
|
2348
2363
|
return n;
|
|
2349
2364
|
},
|
|
2350
2365
|
set(e, t, n) {
|
|
2351
|
-
const r = e[
|
|
2366
|
+
const r = e[J];
|
|
2352
2367
|
if (writeOnly(r)) {
|
|
2353
|
-
if (e[oe]) {
|
|
2354
|
-
const t = e[se];
|
|
2355
|
-
if (t?.X) {
|
|
2356
|
-
R.initTransition(t.X);
|
|
2357
|
-
}
|
|
2358
|
-
}
|
|
2359
2368
|
untrack(() => {
|
|
2360
|
-
const i = e
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
e[
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
const
|
|
2373
|
-
if (
|
|
2374
|
-
|
|
2375
|
-
const l = n?.[J]?.[Z] ?? n;
|
|
2376
|
-
const c = Array.isArray(i) && t !== "length";
|
|
2377
|
-
const d = c ? parseInt(t) + 1 : 0;
|
|
2378
|
-
const h =
|
|
2379
|
-
c &&
|
|
2380
|
-
(e[ee] && "length" in e[ee]
|
|
2381
|
-
? e[ee].length
|
|
2382
|
-
: e[$] && "length" in e[$]
|
|
2383
|
-
? e[$].length
|
|
2384
|
-
: i.length);
|
|
2385
|
-
const p = c && d > h ? d : undefined;
|
|
2386
|
-
if (f === l && p === undefined) return true;
|
|
2387
|
-
if (l !== undefined && l === s && p === undefined) delete e[u]?.[t];
|
|
2369
|
+
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2370
|
+
const u = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : i;
|
|
2371
|
+
const f = n?.[U]?.[Y] ?? n;
|
|
2372
|
+
const l = Array.isArray(o) && t !== "length";
|
|
2373
|
+
const c = l ? parseInt(t) + 1 : 0;
|
|
2374
|
+
const a =
|
|
2375
|
+
l &&
|
|
2376
|
+
(e[$] && "length" in e[$]
|
|
2377
|
+
? e[$].length
|
|
2378
|
+
: e[Z] && "length" in e[Z]
|
|
2379
|
+
? e[Z].length
|
|
2380
|
+
: o.length);
|
|
2381
|
+
const d = l && c > a ? c : undefined;
|
|
2382
|
+
if (u === f && d === undefined) return true;
|
|
2383
|
+
if (f !== undefined && f === i && d === undefined) delete e[s]?.[t];
|
|
2388
2384
|
else {
|
|
2389
|
-
const n = e[
|
|
2390
|
-
n[t] =
|
|
2391
|
-
if (
|
|
2385
|
+
const n = e[s] || (e[s] = Object.create(null));
|
|
2386
|
+
n[t] = f;
|
|
2387
|
+
if (d !== undefined) n.length = d;
|
|
2392
2388
|
}
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
const e = t === "length" ? l : p;
|
|
2399
|
-
e !== undefined && y.length && setSignal(y.length, e);
|
|
2389
|
+
notifyStoreProperty(e, t, "set", f);
|
|
2390
|
+
if (Array.isArray(o)) {
|
|
2391
|
+
const n = getNodes(e, ee);
|
|
2392
|
+
const r = t === "length" ? f : d;
|
|
2393
|
+
r !== undefined && n.length && setSignal(n.length, r);
|
|
2400
2394
|
}
|
|
2401
|
-
|
|
2395
|
+
if (false);
|
|
2396
|
+
});
|
|
2397
|
+
}
|
|
2398
|
+
return true;
|
|
2399
|
+
},
|
|
2400
|
+
defineProperty(e, t, n) {
|
|
2401
|
+
const r = e[J];
|
|
2402
|
+
if (writeOnly(r)) {
|
|
2403
|
+
untrack(() => {
|
|
2404
|
+
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
2405
|
+
const o = "value" in n ? { ...n, value: n.value?.[U]?.[Y] ?? n.value } : n;
|
|
2406
|
+
Object.defineProperty(e[s] || (e[s] = Object.create(null)), t, o);
|
|
2407
|
+
notifyStoreProperty(e, t, "invalidate");
|
|
2402
2408
|
if (false);
|
|
2403
2409
|
});
|
|
2404
2410
|
}
|
|
2405
2411
|
return true;
|
|
2406
2412
|
},
|
|
2407
2413
|
deleteProperty(e, t) {
|
|
2408
|
-
const n = e[
|
|
2409
|
-
const r = e[
|
|
2410
|
-
if (writeOnly(e[
|
|
2414
|
+
const n = e[$]?.[t] === X;
|
|
2415
|
+
const r = e[Z]?.[t] === X;
|
|
2416
|
+
if (writeOnly(e[J]) && !n && !r) {
|
|
2411
2417
|
untrack(() => {
|
|
2412
|
-
const n = e[
|
|
2413
|
-
const r = n ?
|
|
2414
|
-
if (n) trackOptimisticStore(e[
|
|
2415
|
-
const i = e[
|
|
2416
|
-
if (t in e[
|
|
2417
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2418
|
+
const n = e[se] && !j;
|
|
2419
|
+
const r = n ? $ : Z;
|
|
2420
|
+
if (n) trackOptimisticStore(e[J]);
|
|
2421
|
+
const i = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : e[Y][t];
|
|
2422
|
+
if (t in e[Y] || (e[Z] && t in e[Z])) {
|
|
2423
|
+
(e[r] || (e[r] = Object.create(null)))[t] = X;
|
|
2418
2424
|
} else if (e[r] && t in e[r]) {
|
|
2419
2425
|
delete e[r][t];
|
|
2420
2426
|
} else return true;
|
|
2421
|
-
|
|
2422
|
-
const s = getNodes(e, te);
|
|
2423
|
-
s[t] && setSignal(s[t], undefined);
|
|
2424
|
-
s[U] && setSignal(s[U], undefined);
|
|
2427
|
+
notifyStoreProperty(e, t, "delete");
|
|
2425
2428
|
});
|
|
2426
2429
|
}
|
|
2427
2430
|
return true;
|
|
2428
2431
|
},
|
|
2429
2432
|
ownKeys(e) {
|
|
2430
2433
|
trackSelf(e);
|
|
2431
|
-
let t = getKeys(e[
|
|
2432
|
-
if (e[
|
|
2434
|
+
let t = getKeys(e[Y], e[Z], false);
|
|
2435
|
+
if (e[$]) {
|
|
2433
2436
|
const n = new Set(t);
|
|
2434
|
-
for (const t of Reflect.ownKeys(e[
|
|
2435
|
-
if (e[
|
|
2437
|
+
for (const t of Reflect.ownKeys(e[$])) {
|
|
2438
|
+
if (e[$][t] !== X) n.add(t);
|
|
2436
2439
|
else n.delete(t);
|
|
2437
2440
|
}
|
|
2438
2441
|
t = Array.from(n);
|
|
@@ -2440,25 +2443,27 @@ const ce = {
|
|
|
2440
2443
|
return t;
|
|
2441
2444
|
},
|
|
2442
2445
|
getOwnPropertyDescriptor(e, t) {
|
|
2443
|
-
if (t ===
|
|
2444
|
-
if (e[
|
|
2445
|
-
if (e[
|
|
2446
|
-
const n =
|
|
2447
|
-
if (n)
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2446
|
+
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2447
|
+
if (e[$] && t in e[$]) {
|
|
2448
|
+
if (e[$][t] === X) return undefined;
|
|
2449
|
+
const n = Reflect.getOwnPropertyDescriptor(e[$], t);
|
|
2450
|
+
if (n?.get || n?.set || !(t in e[Y])) return n;
|
|
2451
|
+
const r = getPropertyDescriptor(e[Y], e[Z], t);
|
|
2452
|
+
if (r) {
|
|
2453
|
+
return { ...r, value: e[$][t] };
|
|
2454
|
+
}
|
|
2455
|
+
return { value: e[$][t], writable: true, enumerable: true, configurable: true };
|
|
2456
|
+
}
|
|
2457
|
+
return getPropertyDescriptor(e[Y], e[Z], t);
|
|
2453
2458
|
},
|
|
2454
2459
|
getPrototypeOf(e) {
|
|
2455
|
-
return Object.getPrototypeOf(e[
|
|
2460
|
+
return Object.getPrototypeOf(e[Y]);
|
|
2456
2461
|
}
|
|
2457
2462
|
};
|
|
2458
2463
|
function storeSetter(e, t) {
|
|
2459
|
-
const n =
|
|
2460
|
-
|
|
2461
|
-
|
|
2464
|
+
const n = fe;
|
|
2465
|
+
fe = new Set();
|
|
2466
|
+
fe.add(e);
|
|
2462
2467
|
try {
|
|
2463
2468
|
const n = t(e);
|
|
2464
2469
|
if (n !== e && n !== undefined) {
|
|
@@ -2474,8 +2479,8 @@ function storeSetter(e, t) {
|
|
|
2474
2479
|
}
|
|
2475
2480
|
}
|
|
2476
2481
|
} finally {
|
|
2477
|
-
|
|
2478
|
-
|
|
2482
|
+
fe.clear();
|
|
2483
|
+
fe = n;
|
|
2479
2484
|
}
|
|
2480
2485
|
}
|
|
2481
2486
|
function createStore(e, t, n) {
|
|
@@ -2484,7 +2489,7 @@ function createStore(e, t, n) {
|
|
|
2484
2489
|
return [i, e => storeSetter(i, e)];
|
|
2485
2490
|
}
|
|
2486
2491
|
function createOptimisticStore(e, t, n) {
|
|
2487
|
-
GlobalQueue.
|
|
2492
|
+
GlobalQueue.fe ||= clearOptimisticStore;
|
|
2488
2493
|
const r = typeof e === "function";
|
|
2489
2494
|
const i = (r ? t : e) ?? {};
|
|
2490
2495
|
const s = r ? e : undefined;
|
|
@@ -2492,39 +2497,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2492
2497
|
return [o, e => storeSetter(o, e)];
|
|
2493
2498
|
}
|
|
2494
2499
|
function clearOptimisticStore(e) {
|
|
2495
|
-
const t = e[
|
|
2496
|
-
if (!t || !t[
|
|
2497
|
-
const n = t[
|
|
2498
|
-
const r = t[
|
|
2500
|
+
const t = e[U];
|
|
2501
|
+
if (!t || !t[$]) return;
|
|
2502
|
+
const n = t[$];
|
|
2503
|
+
const r = t[ee];
|
|
2499
2504
|
setProjectionWriteActive(true);
|
|
2500
2505
|
try {
|
|
2501
2506
|
if (r) {
|
|
2502
2507
|
for (const e of Reflect.ownKeys(n)) {
|
|
2503
2508
|
if (r[e]) {
|
|
2504
|
-
r[e].
|
|
2505
|
-
const n = t[
|
|
2506
|
-
const i = n ===
|
|
2509
|
+
r[e].Y = undefined;
|
|
2510
|
+
const n = t[Z] && e in t[Z] ? t[Z][e] : t[Y][e];
|
|
2511
|
+
const i = n === X ? undefined : n;
|
|
2507
2512
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2508
2513
|
}
|
|
2509
2514
|
}
|
|
2510
|
-
if (r[
|
|
2511
|
-
r[
|
|
2512
|
-
setSignal(r[
|
|
2515
|
+
if (r[z]) {
|
|
2516
|
+
r[z].Y = undefined;
|
|
2517
|
+
setSignal(r[z], undefined);
|
|
2513
2518
|
}
|
|
2514
2519
|
}
|
|
2515
2520
|
} finally {
|
|
2516
2521
|
setProjectionWriteActive(false);
|
|
2517
2522
|
}
|
|
2518
|
-
delete t[
|
|
2523
|
+
delete t[$];
|
|
2519
2524
|
}
|
|
2520
2525
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2521
2526
|
let r;
|
|
2522
2527
|
const i = new WeakMap();
|
|
2523
2528
|
const wrapper = e => {
|
|
2524
|
-
e[
|
|
2525
|
-
e[
|
|
2526
|
-
e[
|
|
2527
|
-
Object.defineProperty(e,
|
|
2529
|
+
e[ne] = wrapProjection;
|
|
2530
|
+
e[re] = i;
|
|
2531
|
+
e[se] = true;
|
|
2532
|
+
Object.defineProperty(e, ie, {
|
|
2528
2533
|
get() {
|
|
2529
2534
|
return r;
|
|
2530
2535
|
},
|
|
@@ -2533,8 +2538,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2533
2538
|
};
|
|
2534
2539
|
const wrapProjection = e => {
|
|
2535
2540
|
if (i.has(e)) return i.get(e);
|
|
2536
|
-
if (e[
|
|
2537
|
-
const t = createStoreProxy(e,
|
|
2541
|
+
if (e[U]?.[ne] === wrapProjection) return e;
|
|
2542
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
2538
2543
|
i.set(e, t);
|
|
2539
2544
|
return t;
|
|
2540
2545
|
};
|
|
@@ -2546,7 +2551,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2546
2551
|
let i;
|
|
2547
2552
|
const o = new Proxy(
|
|
2548
2553
|
s,
|
|
2549
|
-
createWriteTraps(() => !r || t.
|
|
2554
|
+
createWriteTraps(() => !r || t.Ce === i)
|
|
2550
2555
|
);
|
|
2551
2556
|
setProjectionWriteActive(true);
|
|
2552
2557
|
try {
|
|
@@ -2567,11 +2572,11 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2567
2572
|
setProjectionWriteActive(false);
|
|
2568
2573
|
}
|
|
2569
2574
|
});
|
|
2570
|
-
r.
|
|
2575
|
+
r.ve = true;
|
|
2571
2576
|
}
|
|
2572
2577
|
return { store: s, node: r };
|
|
2573
2578
|
}
|
|
2574
|
-
const
|
|
2579
|
+
const ce = Symbol(0);
|
|
2575
2580
|
function updatePath(e, t, n = 0) {
|
|
2576
2581
|
let r,
|
|
2577
2582
|
i = e;
|
|
@@ -2615,36 +2620,41 @@ function updatePath(e, t, n = 0) {
|
|
|
2615
2620
|
if (s === i) return;
|
|
2616
2621
|
}
|
|
2617
2622
|
if (r === undefined && s == undefined) return;
|
|
2618
|
-
if (s ===
|
|
2623
|
+
if (s === ce) {
|
|
2619
2624
|
delete e[r];
|
|
2620
2625
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2621
2626
|
const t = r !== undefined ? e[r] : e;
|
|
2622
2627
|
const n = Object.keys(s);
|
|
2623
|
-
for (let e = 0; e < n.length; e++)
|
|
2628
|
+
for (let e = 0; e < n.length; e++) {
|
|
2629
|
+
const r = n[e];
|
|
2630
|
+
const i = Object.getOwnPropertyDescriptor(s, r);
|
|
2631
|
+
if (i.get || i.set) Object.defineProperty(t, r, i);
|
|
2632
|
+
else t[r] = i.value;
|
|
2633
|
+
}
|
|
2624
2634
|
} else {
|
|
2625
2635
|
e[r] = s;
|
|
2626
2636
|
}
|
|
2627
2637
|
}
|
|
2628
|
-
const
|
|
2638
|
+
const ae = Object.assign(
|
|
2629
2639
|
function storePath(...e) {
|
|
2630
2640
|
return t => {
|
|
2631
2641
|
updatePath(t, e);
|
|
2632
2642
|
};
|
|
2633
2643
|
},
|
|
2634
|
-
{ DELETE:
|
|
2644
|
+
{ DELETE: ce }
|
|
2635
2645
|
);
|
|
2636
2646
|
function snapshotImpl(e, t, n, r) {
|
|
2637
2647
|
let i, s, o, u, f, l;
|
|
2638
2648
|
if (!isWrappable(e)) return e;
|
|
2639
2649
|
if (n && n.has(e)) return n.get(e);
|
|
2640
2650
|
if (!n) n = new Map();
|
|
2641
|
-
if ((i = e[
|
|
2642
|
-
if (t) trackSelf(i,
|
|
2643
|
-
o = i[
|
|
2644
|
-
s = Array.isArray(i[
|
|
2645
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
2646
|
-
e = i[
|
|
2647
|
-
r =
|
|
2651
|
+
if ((i = e[U] || r?.get(e)?.[U])) {
|
|
2652
|
+
if (t) trackSelf(i, z);
|
|
2653
|
+
o = i[Z];
|
|
2654
|
+
s = Array.isArray(i[Y]);
|
|
2655
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[Y]))) : i[Y]);
|
|
2656
|
+
e = i[Y];
|
|
2657
|
+
r = oe;
|
|
2648
2658
|
} else {
|
|
2649
2659
|
s = Array.isArray(e);
|
|
2650
2660
|
n.set(e, e);
|
|
@@ -2653,7 +2663,7 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2653
2663
|
const s = o?.length || e.length;
|
|
2654
2664
|
for (let c = 0; c < s; c++) {
|
|
2655
2665
|
l = o && c in o ? o[c] : e[c];
|
|
2656
|
-
if (l ===
|
|
2666
|
+
if (l === X) continue;
|
|
2657
2667
|
if (t && isWrappable(l)) wrap(l, i);
|
|
2658
2668
|
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
2659
2669
|
if (!u) n.set(e, (u = [...e]));
|
|
@@ -2688,13 +2698,13 @@ function deep(e) {
|
|
|
2688
2698
|
function trueFn() {
|
|
2689
2699
|
return true;
|
|
2690
2700
|
}
|
|
2691
|
-
const
|
|
2701
|
+
const de = {
|
|
2692
2702
|
get(e, t, n) {
|
|
2693
|
-
if (t ===
|
|
2703
|
+
if (t === J) return n;
|
|
2694
2704
|
return e.get(t);
|
|
2695
2705
|
},
|
|
2696
2706
|
has(e, t) {
|
|
2697
|
-
if (t ===
|
|
2707
|
+
if (t === J) return true;
|
|
2698
2708
|
return e.has(t);
|
|
2699
2709
|
},
|
|
2700
2710
|
set: trueFn,
|
|
@@ -2717,23 +2727,23 @@ const he = {
|
|
|
2717
2727
|
function resolveSource(e) {
|
|
2718
2728
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2719
2729
|
}
|
|
2720
|
-
const
|
|
2730
|
+
const he = Symbol(0);
|
|
2721
2731
|
function merge(...e) {
|
|
2722
2732
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2723
2733
|
let t = false;
|
|
2724
2734
|
const n = [];
|
|
2725
2735
|
for (let r = 0; r < e.length; r++) {
|
|
2726
2736
|
const i = e[r];
|
|
2727
|
-
t = t || (!!i &&
|
|
2728
|
-
const s = !!i && i[
|
|
2737
|
+
t = t || (!!i && J in i);
|
|
2738
|
+
const s = !!i && i[he];
|
|
2729
2739
|
if (s) n.push(...s);
|
|
2730
2740
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2731
2741
|
}
|
|
2732
|
-
if (
|
|
2742
|
+
if (b && t) {
|
|
2733
2743
|
return new Proxy(
|
|
2734
2744
|
{
|
|
2735
2745
|
get(e) {
|
|
2736
|
-
if (e ===
|
|
2746
|
+
if (e === he) return n;
|
|
2737
2747
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2738
2748
|
const r = resolveSource(n[t]);
|
|
2739
2749
|
if (e in r) return r[e];
|
|
@@ -2751,7 +2761,7 @@ function merge(...e) {
|
|
|
2751
2761
|
return [...new Set(e)];
|
|
2752
2762
|
}
|
|
2753
2763
|
},
|
|
2754
|
-
|
|
2764
|
+
de
|
|
2755
2765
|
);
|
|
2756
2766
|
}
|
|
2757
2767
|
const r = Object.create(null);
|
|
@@ -2783,12 +2793,12 @@ function merge(...e) {
|
|
|
2783
2793
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2784
2794
|
else o[t] = n.value;
|
|
2785
2795
|
}
|
|
2786
|
-
o[
|
|
2796
|
+
o[he] = n;
|
|
2787
2797
|
return o;
|
|
2788
2798
|
}
|
|
2789
2799
|
function omit(e, ...t) {
|
|
2790
2800
|
const n = new Set(t);
|
|
2791
|
-
if (
|
|
2801
|
+
if (b && J in e) {
|
|
2792
2802
|
return new Proxy(
|
|
2793
2803
|
{
|
|
2794
2804
|
get(t) {
|
|
@@ -2801,7 +2811,7 @@ function omit(e, ...t) {
|
|
|
2801
2811
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2802
2812
|
}
|
|
2803
2813
|
},
|
|
2804
|
-
|
|
2814
|
+
de
|
|
2805
2815
|
);
|
|
2806
2816
|
}
|
|
2807
2817
|
const r = {};
|
|
@@ -2821,65 +2831,65 @@ function mapArray(e, t, n) {
|
|
|
2821
2831
|
const s = t;
|
|
2822
2832
|
return createMemo(
|
|
2823
2833
|
updateKeyedMap.bind({
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2834
|
+
ze: createOwner(),
|
|
2835
|
+
Ue: 0,
|
|
2836
|
+
Je: e,
|
|
2837
|
+
Xe: [],
|
|
2838
|
+
Ye: s,
|
|
2839
|
+
Ze: [],
|
|
2829
2840
|
$e: [],
|
|
2830
|
-
et:
|
|
2831
|
-
tt: r,
|
|
2832
|
-
nt:
|
|
2833
|
-
rt:
|
|
2834
|
-
it: n?.fallback
|
|
2841
|
+
et: r,
|
|
2842
|
+
tt: r || n?.keyed === false ? [] : undefined,
|
|
2843
|
+
nt: i ? [] : undefined,
|
|
2844
|
+
rt: n?.fallback
|
|
2835
2845
|
})
|
|
2836
2846
|
);
|
|
2837
2847
|
}
|
|
2838
|
-
const
|
|
2848
|
+
const pe = { pureWrite: true };
|
|
2839
2849
|
function updateKeyedMap() {
|
|
2840
|
-
const e = this.
|
|
2850
|
+
const e = this.Je() || [],
|
|
2841
2851
|
t = e.length;
|
|
2842
|
-
e[
|
|
2843
|
-
runWithOwner(this.
|
|
2852
|
+
e[z];
|
|
2853
|
+
runWithOwner(this.ze, () => {
|
|
2844
2854
|
let n,
|
|
2845
2855
|
r,
|
|
2846
|
-
i = this.
|
|
2856
|
+
i = this.tt
|
|
2847
2857
|
? () => {
|
|
2848
|
-
this.
|
|
2849
|
-
this.
|
|
2850
|
-
return this.
|
|
2858
|
+
this.tt[r] = signal(e[r], pe);
|
|
2859
|
+
this.nt && (this.nt[r] = signal(r, pe));
|
|
2860
|
+
return this.Ye(accessor(this.tt[r]), this.nt ? accessor(this.nt[r]) : undefined);
|
|
2851
2861
|
}
|
|
2852
|
-
: this.
|
|
2862
|
+
: this.nt
|
|
2853
2863
|
? () => {
|
|
2854
2864
|
const t = e[r];
|
|
2855
|
-
this.
|
|
2856
|
-
return this.
|
|
2865
|
+
this.nt[r] = signal(r, pe);
|
|
2866
|
+
return this.Ye(() => t, accessor(this.nt[r]));
|
|
2857
2867
|
}
|
|
2858
2868
|
: () => {
|
|
2859
2869
|
const t = e[r];
|
|
2860
|
-
return this.
|
|
2870
|
+
return this.Ye(() => t);
|
|
2861
2871
|
};
|
|
2862
2872
|
if (t === 0) {
|
|
2863
|
-
if (this.
|
|
2864
|
-
this.
|
|
2865
|
-
this.et = [];
|
|
2866
|
-
this.Ye = [];
|
|
2873
|
+
if (this.Ue !== 0) {
|
|
2874
|
+
this.ze.dispose(false);
|
|
2867
2875
|
this.$e = [];
|
|
2868
|
-
this.
|
|
2876
|
+
this.Xe = [];
|
|
2877
|
+
this.Ze = [];
|
|
2878
|
+
this.Ue = 0;
|
|
2879
|
+
this.tt && (this.tt = []);
|
|
2869
2880
|
this.nt && (this.nt = []);
|
|
2870
|
-
this.rt && (this.rt = []);
|
|
2871
2881
|
}
|
|
2872
|
-
if (this.
|
|
2873
|
-
this
|
|
2882
|
+
if (this.rt && !this.Ze[0]) {
|
|
2883
|
+
this.Ze[0] = runWithOwner((this.$e[0] = createOwner()), this.rt);
|
|
2874
2884
|
}
|
|
2875
|
-
} else if (this.
|
|
2876
|
-
if (this
|
|
2877
|
-
this
|
|
2885
|
+
} else if (this.Ue === 0) {
|
|
2886
|
+
if (this.$e[0]) this.$e[0].dispose();
|
|
2887
|
+
this.Ze = new Array(t);
|
|
2878
2888
|
for (r = 0; r < t; r++) {
|
|
2879
|
-
this.
|
|
2880
|
-
this
|
|
2889
|
+
this.Xe[r] = e[r];
|
|
2890
|
+
this.Ze[r] = runWithOwner((this.$e[r] = createOwner()), i);
|
|
2881
2891
|
}
|
|
2882
|
-
this.
|
|
2892
|
+
this.Ue = t;
|
|
2883
2893
|
} else {
|
|
2884
2894
|
let s,
|
|
2885
2895
|
o,
|
|
@@ -2890,205 +2900,205 @@ function updateKeyedMap() {
|
|
|
2890
2900
|
a,
|
|
2891
2901
|
d = new Array(t),
|
|
2892
2902
|
h = new Array(t),
|
|
2893
|
-
p = this.
|
|
2894
|
-
|
|
2903
|
+
p = this.tt ? new Array(t) : undefined,
|
|
2904
|
+
y = this.nt ? new Array(t) : undefined;
|
|
2895
2905
|
for (
|
|
2896
|
-
s = 0, o = Math.min(this.
|
|
2897
|
-
s < o && (this.
|
|
2906
|
+
s = 0, o = Math.min(this.Ue, t);
|
|
2907
|
+
s < o && (this.Xe[s] === e[s] || (this.tt && compare(this.et, this.Xe[s], e[s])));
|
|
2898
2908
|
s++
|
|
2899
2909
|
) {
|
|
2900
|
-
if (this.
|
|
2910
|
+
if (this.tt) setSignal(this.tt[s], e[s]);
|
|
2901
2911
|
}
|
|
2902
2912
|
for (
|
|
2903
|
-
o = this.
|
|
2913
|
+
o = this.Ue - 1, u = t - 1;
|
|
2904
2914
|
o >= s &&
|
|
2905
2915
|
u >= s &&
|
|
2906
|
-
(this.
|
|
2916
|
+
(this.Xe[o] === e[u] || (this.tt && compare(this.et, this.Xe[o], e[u])));
|
|
2907
2917
|
o--, u--
|
|
2908
2918
|
) {
|
|
2909
|
-
d[u] = this
|
|
2910
|
-
h[u] = this
|
|
2911
|
-
p && (p[u] = this.
|
|
2912
|
-
|
|
2919
|
+
d[u] = this.Ze[o];
|
|
2920
|
+
h[u] = this.$e[o];
|
|
2921
|
+
p && (p[u] = this.tt[o]);
|
|
2922
|
+
y && (y[u] = this.nt[o]);
|
|
2913
2923
|
}
|
|
2914
2924
|
c = new Map();
|
|
2915
2925
|
a = new Array(u + 1);
|
|
2916
2926
|
for (r = u; r >= s; r--) {
|
|
2917
2927
|
f = e[r];
|
|
2918
|
-
l = this.
|
|
2928
|
+
l = this.et ? this.et(f) : f;
|
|
2919
2929
|
n = c.get(l);
|
|
2920
2930
|
a[r] = n === undefined ? -1 : n;
|
|
2921
2931
|
c.set(l, r);
|
|
2922
2932
|
}
|
|
2923
2933
|
for (n = s; n <= o; n++) {
|
|
2924
|
-
f = this.
|
|
2925
|
-
l = this.
|
|
2934
|
+
f = this.Xe[n];
|
|
2935
|
+
l = this.et ? this.et(f) : f;
|
|
2926
2936
|
r = c.get(l);
|
|
2927
2937
|
if (r !== undefined && r !== -1) {
|
|
2928
|
-
d[r] = this
|
|
2929
|
-
h[r] = this
|
|
2930
|
-
p && (p[r] = this.
|
|
2931
|
-
|
|
2938
|
+
d[r] = this.Ze[n];
|
|
2939
|
+
h[r] = this.$e[n];
|
|
2940
|
+
p && (p[r] = this.tt[n]);
|
|
2941
|
+
y && (y[r] = this.nt[n]);
|
|
2932
2942
|
r = a[r];
|
|
2933
2943
|
c.set(l, r);
|
|
2934
|
-
} else this
|
|
2944
|
+
} else this.$e[n].dispose();
|
|
2935
2945
|
}
|
|
2936
2946
|
for (r = s; r < t; r++) {
|
|
2937
2947
|
if (r in d) {
|
|
2938
|
-
this
|
|
2939
|
-
this
|
|
2948
|
+
this.Ze[r] = d[r];
|
|
2949
|
+
this.$e[r] = h[r];
|
|
2940
2950
|
if (p) {
|
|
2941
|
-
this.
|
|
2942
|
-
setSignal(this.
|
|
2951
|
+
this.tt[r] = p[r];
|
|
2952
|
+
setSignal(this.tt[r], e[r]);
|
|
2943
2953
|
}
|
|
2944
|
-
if (
|
|
2945
|
-
this.
|
|
2946
|
-
setSignal(this.
|
|
2954
|
+
if (y) {
|
|
2955
|
+
this.nt[r] = y[r];
|
|
2956
|
+
setSignal(this.nt[r], r);
|
|
2947
2957
|
}
|
|
2948
2958
|
} else {
|
|
2949
|
-
this
|
|
2959
|
+
this.Ze[r] = runWithOwner((this.$e[r] = createOwner()), i);
|
|
2950
2960
|
}
|
|
2951
2961
|
}
|
|
2952
|
-
this
|
|
2953
|
-
this.
|
|
2962
|
+
this.Ze = this.Ze.slice(0, (this.Ue = t));
|
|
2963
|
+
this.Xe = e.slice(0);
|
|
2954
2964
|
}
|
|
2955
2965
|
});
|
|
2956
|
-
return this
|
|
2966
|
+
return this.Ze;
|
|
2957
2967
|
}
|
|
2958
2968
|
function repeat(e, t, n) {
|
|
2959
2969
|
const r = t;
|
|
2960
2970
|
return updateRepeat.bind({
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
et: [],
|
|
2971
|
+
ze: createOwner(),
|
|
2972
|
+
Ue: 0,
|
|
2973
|
+
it: 0,
|
|
2974
|
+
st: e,
|
|
2975
|
+
Ye: r,
|
|
2967
2976
|
$e: [],
|
|
2968
|
-
|
|
2969
|
-
|
|
2977
|
+
Ze: [],
|
|
2978
|
+
ot: n?.from,
|
|
2979
|
+
rt: n?.fallback
|
|
2970
2980
|
});
|
|
2971
2981
|
}
|
|
2972
2982
|
function updateRepeat() {
|
|
2973
|
-
const e = this.
|
|
2974
|
-
const t = this.
|
|
2975
|
-
runWithOwner(this.
|
|
2983
|
+
const e = this.st();
|
|
2984
|
+
const t = this.ot?.() || 0;
|
|
2985
|
+
runWithOwner(this.ze, () => {
|
|
2976
2986
|
if (e === 0) {
|
|
2977
|
-
if (this.
|
|
2978
|
-
this.
|
|
2979
|
-
this.et = [];
|
|
2987
|
+
if (this.Ue !== 0) {
|
|
2988
|
+
this.ze.dispose(false);
|
|
2980
2989
|
this.$e = [];
|
|
2981
|
-
this.
|
|
2990
|
+
this.Ze = [];
|
|
2991
|
+
this.Ue = 0;
|
|
2982
2992
|
}
|
|
2983
|
-
if (this.
|
|
2984
|
-
this
|
|
2993
|
+
if (this.rt && !this.Ze[0]) {
|
|
2994
|
+
this.Ze[0] = runWithOwner((this.$e[0] = createOwner()), this.rt);
|
|
2985
2995
|
}
|
|
2986
2996
|
return;
|
|
2987
2997
|
}
|
|
2988
2998
|
const n = t + e;
|
|
2989
|
-
const r = this.
|
|
2990
|
-
if (this.
|
|
2991
|
-
for (let e = n; e < r; e++) this
|
|
2992
|
-
if (this.
|
|
2993
|
-
let e = this.
|
|
2994
|
-
while (e < t && e < this.
|
|
2995
|
-
this.
|
|
2996
|
-
this
|
|
2997
|
-
} else if (this.
|
|
2998
|
-
let n = r - this.
|
|
2999
|
-
let i = this.
|
|
3000
|
-
this.
|
|
2999
|
+
const r = this.it + this.Ue;
|
|
3000
|
+
if (this.Ue === 0 && this.$e[0]) this.$e[0].dispose();
|
|
3001
|
+
for (let e = n; e < r; e++) this.$e[e - this.it].dispose();
|
|
3002
|
+
if (this.it < t) {
|
|
3003
|
+
let e = this.it;
|
|
3004
|
+
while (e < t && e < this.Ue) this.$e[e++].dispose();
|
|
3005
|
+
this.$e.splice(0, t - this.it);
|
|
3006
|
+
this.Ze.splice(0, t - this.it);
|
|
3007
|
+
} else if (this.it > t) {
|
|
3008
|
+
let n = r - this.it - 1;
|
|
3009
|
+
let i = this.it - t;
|
|
3010
|
+
this.$e.length = this.Ze.length = e;
|
|
3001
3011
|
while (n >= i) {
|
|
3002
|
-
this.et[n] = this.et[n - i];
|
|
3003
3012
|
this.$e[n] = this.$e[n - i];
|
|
3013
|
+
this.Ze[n] = this.Ze[n - i];
|
|
3004
3014
|
n--;
|
|
3005
3015
|
}
|
|
3006
3016
|
for (let e = 0; e < i; e++) {
|
|
3007
|
-
this
|
|
3017
|
+
this.Ze[e] = runWithOwner((this.$e[e] = createOwner()), () => this.Ye(e + t));
|
|
3008
3018
|
}
|
|
3009
3019
|
}
|
|
3010
3020
|
for (let e = r; e < n; e++) {
|
|
3011
|
-
this
|
|
3021
|
+
this.Ze[e - t] = runWithOwner((this.$e[e - t] = createOwner()), () => this.Ye(e));
|
|
3012
3022
|
}
|
|
3013
|
-
this
|
|
3014
|
-
this.
|
|
3015
|
-
this.
|
|
3023
|
+
this.Ze = this.Ze.slice(0, e);
|
|
3024
|
+
this.it = t;
|
|
3025
|
+
this.Ue = e;
|
|
3016
3026
|
});
|
|
3017
|
-
return this
|
|
3027
|
+
return this.Ze;
|
|
3018
3028
|
}
|
|
3019
3029
|
function compare(e, t, n) {
|
|
3020
3030
|
return e ? e(t) === e(n) : true;
|
|
3021
3031
|
}
|
|
3022
3032
|
function boundaryComputed(e, t) {
|
|
3023
3033
|
const n = computed(e, undefined, { lazy: true });
|
|
3024
|
-
n.
|
|
3025
|
-
const r = e !== undefined ? e : n.
|
|
3026
|
-
const i = t !== undefined ? t : n.
|
|
3027
|
-
n.
|
|
3028
|
-
n.
|
|
3034
|
+
n.Qe = (e, t) => {
|
|
3035
|
+
const r = e !== undefined ? e : n.ye;
|
|
3036
|
+
const i = t !== undefined ? t : n.ae;
|
|
3037
|
+
n.ye &= ~n.ut;
|
|
3038
|
+
n.M.notify(n, n.ut, r, i);
|
|
3029
3039
|
};
|
|
3030
|
-
n.
|
|
3031
|
-
n.
|
|
3040
|
+
n.ut = t;
|
|
3041
|
+
n.ve = true;
|
|
3032
3042
|
recompute(n, true);
|
|
3033
3043
|
return n;
|
|
3034
3044
|
}
|
|
3035
3045
|
function createBoundChildren(e, t, n, r) {
|
|
3036
|
-
const i = e.
|
|
3037
|
-
i.addChild((e.
|
|
3038
|
-
cleanup(() => i.removeChild(e.
|
|
3046
|
+
const i = e.M;
|
|
3047
|
+
i.addChild((e.M = n));
|
|
3048
|
+
cleanup(() => i.removeChild(e.M));
|
|
3039
3049
|
return runWithOwner(e, () => {
|
|
3040
3050
|
const e = computed(t);
|
|
3041
3051
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
3042
3052
|
});
|
|
3043
3053
|
}
|
|
3044
3054
|
const ye = Symbol();
|
|
3045
|
-
const
|
|
3046
|
-
let
|
|
3055
|
+
const ge = createContext(null);
|
|
3056
|
+
let Se = false;
|
|
3047
3057
|
const FALSE_ACCESSOR = () => false;
|
|
3048
3058
|
function isRevealController(e) {
|
|
3049
3059
|
return e instanceof RevealController;
|
|
3050
3060
|
}
|
|
3051
3061
|
function isSlotReady(e) {
|
|
3052
|
-
return isRevealController(e) ? e.isReady() : e.
|
|
3062
|
+
return isRevealController(e) ? e.isReady() : e.ft.size === 0 && !e.lt;
|
|
3053
3063
|
}
|
|
3054
3064
|
function setSlotState(e, t, n, r) {
|
|
3055
|
-
setSignal(e.
|
|
3056
|
-
setSignal(e.
|
|
3065
|
+
setSignal(e.ct, n);
|
|
3066
|
+
setSignal(e.dt, r);
|
|
3057
3067
|
if (isRevealController(e)) {
|
|
3058
|
-
if (!n && e.
|
|
3068
|
+
if (!n && e.ht === t) e.ht = undefined;
|
|
3059
3069
|
return e.evaluate(n, r);
|
|
3060
3070
|
}
|
|
3061
|
-
if (!n && e.yt === t && e.
|
|
3071
|
+
if (!n && e.yt === t && e.gt) e.yt = undefined;
|
|
3062
3072
|
}
|
|
3063
3073
|
class RevealController {
|
|
3074
|
+
St;
|
|
3064
3075
|
wt;
|
|
3065
|
-
_t;
|
|
3066
3076
|
bt = [];
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3077
|
+
ht;
|
|
3078
|
+
ct = signal(false, { pureWrite: true, De: true });
|
|
3079
|
+
dt = signal(false, { pureWrite: true, De: true });
|
|
3080
|
+
_t = true;
|
|
3081
|
+
Ot = false;
|
|
3072
3082
|
constructor(e, t) {
|
|
3073
|
-
this.
|
|
3074
|
-
this.
|
|
3083
|
+
this.St = e;
|
|
3084
|
+
this.wt = t;
|
|
3075
3085
|
}
|
|
3076
|
-
|
|
3086
|
+
xt(e) {
|
|
3077
3087
|
for (let t = 0; t < this.bt.length; t++) {
|
|
3078
3088
|
const n = this.bt[t];
|
|
3079
|
-
if ((isRevealController(n) ? n.
|
|
3089
|
+
if ((isRevealController(n) ? n.ht : n.yt) !== this) continue;
|
|
3080
3090
|
if (e(n) === false) return false;
|
|
3081
3091
|
}
|
|
3082
3092
|
return true;
|
|
3083
3093
|
}
|
|
3084
3094
|
isReady() {
|
|
3085
|
-
return this.
|
|
3095
|
+
return this.xt(isSlotReady);
|
|
3086
3096
|
}
|
|
3087
3097
|
register(e) {
|
|
3088
3098
|
if (this.bt.includes(e)) return;
|
|
3089
3099
|
this.bt.push(e);
|
|
3090
|
-
const t = !!untrack(this.
|
|
3091
|
-
setSignal(e.
|
|
3100
|
+
const t = !!untrack(this.St);
|
|
3101
|
+
setSignal(e.ct, true), setSignal(e.dt, t ? false : !!untrack(this.wt));
|
|
3092
3102
|
untrack(() => this.evaluate());
|
|
3093
3103
|
}
|
|
3094
3104
|
unregister(e) {
|
|
@@ -3097,20 +3107,20 @@ class RevealController {
|
|
|
3097
3107
|
untrack(() => this.evaluate());
|
|
3098
3108
|
}
|
|
3099
3109
|
evaluate(e, t) {
|
|
3100
|
-
if (this.
|
|
3101
|
-
this.
|
|
3102
|
-
const n = this.
|
|
3110
|
+
if (this.Ot) return;
|
|
3111
|
+
this.Ot = true;
|
|
3112
|
+
const n = this._t;
|
|
3103
3113
|
try {
|
|
3104
|
-
const n = e ?? read(this.
|
|
3105
|
-
r = !!untrack(this.
|
|
3114
|
+
const n = e ?? read(this.ct),
|
|
3115
|
+
r = !!untrack(this.wt),
|
|
3106
3116
|
i = t ?? r;
|
|
3107
|
-
if (n && i) this.
|
|
3108
|
-
else if (!!untrack(this.
|
|
3117
|
+
if (n && i) this.xt(e => setSlotState(e, this, true, true));
|
|
3118
|
+
else if (!!untrack(this.St)) {
|
|
3109
3119
|
const e = this.isReady();
|
|
3110
|
-
this.
|
|
3120
|
+
this.xt(t => setSlotState(t, this, !e, false));
|
|
3111
3121
|
} else {
|
|
3112
3122
|
let e = false;
|
|
3113
|
-
this.
|
|
3123
|
+
this.xt(t => {
|
|
3114
3124
|
if (e) return setSlotState(t, this, true, r);
|
|
3115
3125
|
if (isSlotReady(t)) return setSlotState(t, this, false, false);
|
|
3116
3126
|
e = true;
|
|
@@ -3118,91 +3128,91 @@ class RevealController {
|
|
|
3118
3128
|
});
|
|
3119
3129
|
}
|
|
3120
3130
|
} finally {
|
|
3121
|
-
this.
|
|
3122
|
-
this.
|
|
3131
|
+
this._t = this.isReady();
|
|
3132
|
+
this.Ot = false;
|
|
3123
3133
|
}
|
|
3124
|
-
if (this.
|
|
3134
|
+
if (this.ht && n !== this._t) this.ht.evaluate();
|
|
3125
3135
|
}
|
|
3126
3136
|
}
|
|
3127
3137
|
class CollectionQueue extends Queue {
|
|
3138
|
+
vt;
|
|
3139
|
+
ft = new Set();
|
|
3128
3140
|
Pt;
|
|
3129
|
-
lt =
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
dt = signal(false, { pureWrite: true, Fe: true });
|
|
3133
|
-
ht = signal(false, { pureWrite: true, Fe: true });
|
|
3141
|
+
lt = true;
|
|
3142
|
+
ct = signal(false, { pureWrite: true, De: true });
|
|
3143
|
+
dt = signal(false, { pureWrite: true, De: true });
|
|
3134
3144
|
yt;
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3145
|
+
gt = false;
|
|
3146
|
+
kt;
|
|
3147
|
+
Et = ye;
|
|
3138
3148
|
constructor(e) {
|
|
3139
3149
|
super();
|
|
3140
|
-
this.
|
|
3150
|
+
this.vt = e;
|
|
3141
3151
|
}
|
|
3142
3152
|
run(e) {
|
|
3143
|
-
if (!e || (read(this.
|
|
3153
|
+
if (!e || (read(this.ct) && (!Se || read(this.dt)))) return;
|
|
3144
3154
|
return super.run(e);
|
|
3145
3155
|
}
|
|
3146
3156
|
notify(e, t, n, r) {
|
|
3147
|
-
if (!(t & this.
|
|
3148
|
-
if (this.
|
|
3157
|
+
if (!(t & this.vt)) return super.notify(e, t, n, r);
|
|
3158
|
+
if (this.gt && this.kt) {
|
|
3149
3159
|
const e = untrack(() => {
|
|
3150
3160
|
try {
|
|
3151
|
-
return this.
|
|
3161
|
+
return this.kt();
|
|
3152
3162
|
} catch {
|
|
3153
3163
|
return ye;
|
|
3154
3164
|
}
|
|
3155
3165
|
});
|
|
3156
|
-
if (e !== this.
|
|
3157
|
-
this.
|
|
3158
|
-
this.
|
|
3159
|
-
this.
|
|
3166
|
+
if (e !== this.Et) {
|
|
3167
|
+
this.Et = e;
|
|
3168
|
+
this.gt = false;
|
|
3169
|
+
this.ft.clear();
|
|
3160
3170
|
}
|
|
3161
3171
|
}
|
|
3162
|
-
if (this.
|
|
3163
|
-
if (this.
|
|
3172
|
+
if (this.vt & a && this.gt) return super.notify(e, t, n, r);
|
|
3173
|
+
if (this.vt & a && n & d) {
|
|
3164
3174
|
return super.notify(e, d, n, r);
|
|
3165
3175
|
}
|
|
3166
|
-
if (n & this.
|
|
3167
|
-
this.
|
|
3168
|
-
const t = r?.source || e.
|
|
3176
|
+
if (n & this.vt) {
|
|
3177
|
+
this.lt = true;
|
|
3178
|
+
const t = r?.source || e.ae?.source;
|
|
3169
3179
|
if (t) {
|
|
3170
|
-
const e = this.
|
|
3171
|
-
this.
|
|
3172
|
-
if (e) setSignal(this.
|
|
3180
|
+
const e = this.ft.size === 0;
|
|
3181
|
+
this.ft.add(t);
|
|
3182
|
+
if (e) setSignal(this.ct, true);
|
|
3173
3183
|
}
|
|
3174
3184
|
}
|
|
3175
|
-
t &= ~this.
|
|
3185
|
+
t &= ~this.vt;
|
|
3176
3186
|
return t ? super.notify(e, t, n, r) : true;
|
|
3177
3187
|
}
|
|
3178
3188
|
checkSources() {
|
|
3179
|
-
for (const e of this.
|
|
3180
|
-
if (e.m & u || (!(e.
|
|
3189
|
+
for (const e of this.ft) {
|
|
3190
|
+
if (e.m & u || (!(e.ye & this.vt) && !(this.vt & d && e.ye & a))) this.ft.delete(e);
|
|
3181
3191
|
}
|
|
3182
|
-
if (!this.
|
|
3183
|
-
if (this.
|
|
3184
|
-
this.
|
|
3192
|
+
if (!this.ft.size) {
|
|
3193
|
+
if (this.vt & a && this.lt && !this.gt && this.Pt) {
|
|
3194
|
+
this.lt = !!(this.Pt.ye & this.vt);
|
|
3185
3195
|
} else {
|
|
3186
|
-
this.
|
|
3196
|
+
this.lt = false;
|
|
3187
3197
|
}
|
|
3188
|
-
if (!this.
|
|
3189
|
-
setSignal(this.
|
|
3190
|
-
if (this.
|
|
3198
|
+
if (!this.lt) {
|
|
3199
|
+
setSignal(this.ct, false);
|
|
3200
|
+
if (this.kt) {
|
|
3191
3201
|
try {
|
|
3192
|
-
this.
|
|
3202
|
+
this.Et = untrack(() => this.kt());
|
|
3193
3203
|
} catch {}
|
|
3194
3204
|
}
|
|
3195
3205
|
}
|
|
3196
3206
|
}
|
|
3197
|
-
if (
|
|
3207
|
+
if (Se) this.yt?.evaluate();
|
|
3198
3208
|
}
|
|
3199
3209
|
}
|
|
3200
3210
|
function createCollectionBoundary(e, t, n, r) {
|
|
3201
3211
|
const i = createOwner();
|
|
3202
|
-
if (
|
|
3212
|
+
if (Se) setContext(ge, null, i);
|
|
3203
3213
|
const s = new CollectionQueue(e);
|
|
3204
|
-
if (r) s.
|
|
3205
|
-
const o = (s.
|
|
3214
|
+
if (r) s.kt = r;
|
|
3215
|
+
const o = (s.Pt = createBoundChildren(i, t, s, e));
|
|
3206
3216
|
untrack(() => {
|
|
3207
3217
|
let t = false;
|
|
3208
3218
|
try {
|
|
@@ -3211,20 +3221,20 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3211
3221
|
if (e instanceof NotReadyError) t = true;
|
|
3212
3222
|
else throw e;
|
|
3213
3223
|
}
|
|
3214
|
-
s.
|
|
3224
|
+
s.lt = t || !!(o.ye & e) || o.ae instanceof NotReadyError;
|
|
3215
3225
|
});
|
|
3216
|
-
const u =
|
|
3226
|
+
const u = Se && e === a ? getContext(ge) : null;
|
|
3217
3227
|
if (u) {
|
|
3218
3228
|
s.yt = u;
|
|
3219
3229
|
u.register(s);
|
|
3220
3230
|
cleanup(() => u.unregister(s));
|
|
3221
3231
|
}
|
|
3222
3232
|
const f = computed(() => {
|
|
3223
|
-
if (!read(s.
|
|
3233
|
+
if (!read(s.ct)) {
|
|
3224
3234
|
const e = read(o);
|
|
3225
|
-
if (!untrack(() => read(s.
|
|
3235
|
+
if (!untrack(() => read(s.ct))) return (s.gt = true), e;
|
|
3226
3236
|
}
|
|
3227
|
-
if (
|
|
3237
|
+
if (Se && read(s.dt)) return undefined;
|
|
3228
3238
|
return n(s);
|
|
3229
3239
|
});
|
|
3230
3240
|
return accessor(f);
|
|
@@ -3234,22 +3244,22 @@ function createLoadingBoundary(e, t, n) {
|
|
|
3234
3244
|
}
|
|
3235
3245
|
function createErrorBoundary(e, t) {
|
|
3236
3246
|
return createCollectionBoundary(d, e, e => {
|
|
3237
|
-
let n = e.
|
|
3238
|
-
const r = n.
|
|
3247
|
+
let n = e.ft.values().next().value;
|
|
3248
|
+
const r = n.ae?.cause ?? n.ae;
|
|
3239
3249
|
return t(r, () => {
|
|
3240
|
-
for (const t of e.
|
|
3250
|
+
for (const t of e.ft) recompute(t);
|
|
3241
3251
|
schedule();
|
|
3242
3252
|
});
|
|
3243
3253
|
});
|
|
3244
3254
|
}
|
|
3245
3255
|
function createRevealOrder(e, t) {
|
|
3246
|
-
|
|
3256
|
+
Se = true;
|
|
3247
3257
|
const n = createOwner();
|
|
3248
|
-
const r = getContext(
|
|
3258
|
+
const r = getContext(ge);
|
|
3249
3259
|
const i = t?.together || FALSE_ACCESSOR,
|
|
3250
3260
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3251
3261
|
const o = new RevealController(i, s);
|
|
3252
|
-
setContext(
|
|
3262
|
+
setContext(ge, o, n);
|
|
3253
3263
|
return runWithOwner(n, () => {
|
|
3254
3264
|
const t = e();
|
|
3255
3265
|
computed(() => {
|
|
@@ -3258,7 +3268,7 @@ function createRevealOrder(e, t) {
|
|
|
3258
3268
|
o.evaluate();
|
|
3259
3269
|
});
|
|
3260
3270
|
if (r) {
|
|
3261
|
-
o.
|
|
3271
|
+
o.ht = r;
|
|
3262
3272
|
r.register(o);
|
|
3263
3273
|
cleanup(() => r.unregister(o));
|
|
3264
3274
|
}
|
|
@@ -3314,15 +3324,16 @@ function flattenArray(e, t = [], n) {
|
|
|
3314
3324
|
if (r) throw r;
|
|
3315
3325
|
return i;
|
|
3316
3326
|
}
|
|
3317
|
-
|
|
3327
|
+
const we = undefined;
|
|
3328
|
+
exports.$PROXY = J;
|
|
3318
3329
|
exports.$REFRESH = O;
|
|
3319
|
-
exports.$TARGET =
|
|
3320
|
-
exports.$TRACK =
|
|
3330
|
+
exports.$TARGET = U;
|
|
3331
|
+
exports.$TRACK = z;
|
|
3321
3332
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3322
|
-
exports.DEV =
|
|
3333
|
+
exports.DEV = we;
|
|
3323
3334
|
exports.NoOwnerError = NoOwnerError;
|
|
3324
3335
|
exports.NotReadyError = NotReadyError;
|
|
3325
|
-
exports.SUPPORTS_PROXY =
|
|
3336
|
+
exports.SUPPORTS_PROXY = b;
|
|
3326
3337
|
exports.action = action;
|
|
3327
3338
|
exports.clearSnapshots = clearSnapshots;
|
|
3328
3339
|
exports.createContext = createContext;
|
|
@@ -3372,5 +3383,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3372
3383
|
exports.setContext = setContext;
|
|
3373
3384
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3374
3385
|
exports.snapshot = snapshot;
|
|
3375
|
-
exports.storePath =
|
|
3386
|
+
exports.storePath = ae;
|
|
3376
3387
|
exports.untrack = untrack;
|