@solidjs/signals 2.0.0-beta.10 → 2.0.0-beta.12
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 +777 -397
- package/dist/node.cjs +1862 -1540
- package/dist/prod.js +1555 -1222
- package/dist/types/boundaries.d.ts +2 -2
- package/dist/types/core/constants.d.ts +8 -6
- package/dist/types/core/core.d.ts +29 -8
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/effect.d.ts +1 -0
- package/dist/types/core/graph.d.ts +1 -0
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/scheduler.d.ts +19 -3
- package/dist/types/core/types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/map.d.ts +21 -5
- package/dist/types/signals.d.ts +25 -4
- package/dist/types/src/boundaries.d.ts +173 -0
- package/dist/types/src/core/action.d.ts +35 -0
- package/dist/types/src/core/async.d.ts +6 -0
- package/dist/types/src/core/constants.d.ts +51 -0
- package/dist/types/src/core/context.d.ts +36 -0
- package/dist/types/src/core/core.d.ts +174 -0
- package/dist/types/src/core/dev.d.ts +49 -0
- package/dist/types/src/core/effect.d.ts +32 -0
- package/dist/types/src/core/error.d.ts +38 -0
- package/dist/types/src/core/external.d.ts +45 -0
- package/dist/types/src/core/graph.d.ts +5 -0
- package/dist/types/src/core/heap.d.ts +14 -0
- package/dist/types/src/core/index.d.ts +12 -0
- package/dist/types/src/core/lanes.d.ts +54 -0
- package/dist/types/src/core/owner.d.ts +116 -0
- package/dist/types/src/core/scheduler.d.ts +122 -0
- package/dist/types/src/core/types.d.ts +85 -0
- package/dist/types/src/index.d.ts +9 -0
- package/dist/types/src/map.d.ts +53 -0
- package/dist/types/src/signals.d.ts +512 -0
- package/dist/types/src/store/index.d.ts +9 -0
- package/dist/types/src/store/optimistic.d.ts +45 -0
- package/dist/types/src/store/projection.d.ts +66 -0
- package/dist/types/src/store/reconcile.d.ts +23 -0
- package/dist/types/src/store/store.d.ts +125 -0
- package/dist/types/src/store/storePath.d.ts +58 -0
- package/dist/types/src/store/utils.d.ts +114 -0
- package/dist/types-cjs/boundaries.d.cts +2 -2
- package/dist/types-cjs/core/constants.d.cts +8 -6
- package/dist/types-cjs/core/core.d.cts +29 -8
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/effect.d.cts +1 -0
- package/dist/types-cjs/core/graph.d.cts +1 -0
- package/dist/types-cjs/core/index.d.cts +1 -1
- package/dist/types-cjs/core/scheduler.d.cts +19 -3
- package/dist/types-cjs/core/types.d.cts +2 -0
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/map.d.cts +21 -5
- package/dist/types-cjs/signals.d.cts +25 -4
- package/dist/types-cjs/src/boundaries.d.cts +173 -0
- package/dist/types-cjs/src/core/action.d.cts +35 -0
- package/dist/types-cjs/src/core/async.d.cts +6 -0
- package/dist/types-cjs/src/core/constants.d.cts +51 -0
- package/dist/types-cjs/src/core/context.d.cts +36 -0
- package/dist/types-cjs/src/core/core.d.cts +174 -0
- package/dist/types-cjs/src/core/dev.d.cts +49 -0
- package/dist/types-cjs/src/core/effect.d.cts +32 -0
- package/dist/types-cjs/src/core/error.d.cts +38 -0
- package/dist/types-cjs/src/core/external.d.cts +45 -0
- package/dist/types-cjs/src/core/graph.d.cts +5 -0
- package/dist/types-cjs/src/core/heap.d.cts +14 -0
- package/dist/types-cjs/src/core/index.d.cts +12 -0
- package/dist/types-cjs/src/core/lanes.d.cts +54 -0
- package/dist/types-cjs/src/core/owner.d.cts +116 -0
- package/dist/types-cjs/src/core/scheduler.d.cts +122 -0
- package/dist/types-cjs/src/core/types.d.cts +85 -0
- package/dist/types-cjs/src/index.d.cts +9 -0
- package/dist/types-cjs/src/map.d.cts +53 -0
- package/dist/types-cjs/src/signals.d.cts +512 -0
- package/dist/types-cjs/src/store/index.d.cts +9 -0
- package/dist/types-cjs/src/store/optimistic.d.cts +45 -0
- package/dist/types-cjs/src/store/projection.d.cts +66 -0
- package/dist/types-cjs/src/store/reconcile.d.cts +23 -0
- package/dist/types-cjs/src/store/store.d.cts +125 -0
- package/dist/types-cjs/src/store/storePath.d.cts +58 -0
- package/dist/types-cjs/src/store/utils.d.cts +114 -0
- package/package.json +4 -4
package/dist/node.cjs
CHANGED
|
@@ -31,27 +31,39 @@ const i = 1 << 3;
|
|
|
31
31
|
const s = 1 << 4;
|
|
32
32
|
const o = 1 << 5;
|
|
33
33
|
const u = 1 << 6;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
34
|
+
const l = 1 << 7;
|
|
35
|
+
const f = 1 << 8;
|
|
36
36
|
const c = 1 << 9;
|
|
37
|
-
const a = 1 <<
|
|
38
|
-
const d = 1 <<
|
|
39
|
-
const p = 1 <<
|
|
40
|
-
const h = 1 <<
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const w = 1 <<
|
|
45
|
-
const m = 1 <<
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const O =
|
|
49
|
-
const v =
|
|
37
|
+
const a = 1 << 10;
|
|
38
|
+
const d = 1 << 0;
|
|
39
|
+
const p = 1 << 1;
|
|
40
|
+
const h = 1 << 2;
|
|
41
|
+
const g = 1 << 3;
|
|
42
|
+
const S = 1 << 4;
|
|
43
|
+
const y = 1 << 5;
|
|
44
|
+
const w = 1 << 6;
|
|
45
|
+
const m = 1 << 0;
|
|
46
|
+
const _ = 1 << 1;
|
|
47
|
+
const b = 1 << 2;
|
|
48
|
+
const O = 1;
|
|
49
|
+
const v = 2;
|
|
50
|
+
const P = 3;
|
|
50
51
|
const x = {};
|
|
51
|
-
const P = "sp";
|
|
52
|
-
const k = typeof Proxy === "function";
|
|
53
52
|
const C = {};
|
|
54
|
-
const
|
|
53
|
+
const N = "sp";
|
|
54
|
+
const E = typeof Proxy === "function";
|
|
55
|
+
const k = {};
|
|
56
|
+
const j = Symbol("refresh");
|
|
57
|
+
const W = new Set();
|
|
58
|
+
const R = new Set();
|
|
59
|
+
let A = 0;
|
|
60
|
+
const I = undefined;
|
|
61
|
+
function emitDiagnostic(e) {
|
|
62
|
+
const t = { sequence: ++A, ...e };
|
|
63
|
+
for (const e of W) e(t);
|
|
64
|
+
for (const e of R) e.push(t);
|
|
65
|
+
return t;
|
|
66
|
+
}
|
|
55
67
|
function actualInsertIntoHeap(e, t) {
|
|
56
68
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
57
69
|
if (n >= e.o) e.o = n + 1;
|
|
@@ -68,7 +80,7 @@ function actualInsertIntoHeap(e, t) {
|
|
|
68
80
|
}
|
|
69
81
|
function insertIntoHeap(e, o) {
|
|
70
82
|
let u = e.m;
|
|
71
|
-
if (u & (i | r)) return;
|
|
83
|
+
if (u & (i | r | a)) return;
|
|
72
84
|
if (u & t) {
|
|
73
85
|
e.m = (u & -4) | n | i;
|
|
74
86
|
} else e.m = u | i;
|
|
@@ -76,7 +88,7 @@ function insertIntoHeap(e, o) {
|
|
|
76
88
|
}
|
|
77
89
|
function insertIntoHeapHeight(e, t) {
|
|
78
90
|
let n = e.m;
|
|
79
|
-
if (n & (i | r | s)) return;
|
|
91
|
+
if (n & (i | r | s | a)) return;
|
|
80
92
|
e.m = n | s;
|
|
81
93
|
actualInsertIntoHeap(e, t);
|
|
82
94
|
}
|
|
@@ -111,24 +123,24 @@ function markNode(e, r = n) {
|
|
|
111
123
|
if ((i & (t | n)) >= r) return;
|
|
112
124
|
e.m = (i & -4) | r;
|
|
113
125
|
for (let n = e.O; n !== null; n = n.P) {
|
|
114
|
-
markNode(n.
|
|
126
|
+
markNode(n.C, t);
|
|
115
127
|
}
|
|
116
|
-
if (e.
|
|
117
|
-
for (let n = e.
|
|
128
|
+
if (e.N !== null) {
|
|
129
|
+
for (let n = e.N; n !== null; n = n.k) {
|
|
118
130
|
for (let e = n.O; e !== null; e = e.P) {
|
|
119
|
-
markNode(e.
|
|
131
|
+
markNode(e.C, t);
|
|
120
132
|
}
|
|
121
133
|
}
|
|
122
134
|
}
|
|
123
135
|
}
|
|
124
136
|
function runHeap(e, t) {
|
|
125
137
|
e._ = false;
|
|
126
|
-
for (e.
|
|
127
|
-
let n = e.l[e.
|
|
138
|
+
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
139
|
+
let n = e.l[e.j];
|
|
128
140
|
while (n !== undefined) {
|
|
129
141
|
if (n.m & i) t(n);
|
|
130
142
|
else adjustHeight(n, e);
|
|
131
|
-
n = e.l[e.
|
|
143
|
+
n = e.l[e.j];
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
146
|
e.S = 0;
|
|
@@ -138,137 +150,211 @@ function adjustHeight(e, t) {
|
|
|
138
150
|
let n = e.o;
|
|
139
151
|
for (let t = e.W; t; t = t.R) {
|
|
140
152
|
const e = t.A;
|
|
141
|
-
const r = e.
|
|
142
|
-
if (r.
|
|
153
|
+
const r = e.I || e;
|
|
154
|
+
if (r.L && r.o >= n) n = r.o + 1;
|
|
143
155
|
}
|
|
144
156
|
if (e.o !== n) {
|
|
145
157
|
e.o = n;
|
|
146
158
|
for (let n = e.O; n !== null; n = n.P) {
|
|
147
|
-
insertIntoHeapHeight(n.
|
|
159
|
+
insertIntoHeapHeight(n.C, t);
|
|
148
160
|
}
|
|
149
161
|
}
|
|
150
162
|
}
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
const L = new WeakMap();
|
|
164
|
+
const T = new Set();
|
|
165
|
+
function getOrCreateLane(e) {
|
|
166
|
+
let t = L.get(e);
|
|
167
|
+
if (t) {
|
|
168
|
+
return findLane(t);
|
|
169
|
+
}
|
|
170
|
+
const n = e.T;
|
|
171
|
+
const r = n?.H ? findLane(n.H) : null;
|
|
172
|
+
t = { q: e, F: new Set(), M: [[], []], D: null, V: M, K: r };
|
|
173
|
+
L.set(e, t);
|
|
174
|
+
T.add(t);
|
|
175
|
+
e.B = false;
|
|
176
|
+
return t;
|
|
177
|
+
}
|
|
178
|
+
function findLane(e) {
|
|
179
|
+
while (e.D) e = e.D;
|
|
180
|
+
return e;
|
|
181
|
+
}
|
|
182
|
+
function mergeLanes(e, t) {
|
|
183
|
+
e = findLane(e);
|
|
184
|
+
t = findLane(t);
|
|
185
|
+
if (e === t) return e;
|
|
186
|
+
t.D = e;
|
|
187
|
+
for (const n of t.F) e.F.add(n);
|
|
188
|
+
e.M[0].push(...t.M[0]);
|
|
189
|
+
e.M[1].push(...t.M[1]);
|
|
190
|
+
return e;
|
|
191
|
+
}
|
|
192
|
+
function resolveLane(e) {
|
|
193
|
+
const t = e.H;
|
|
194
|
+
if (!t) return undefined;
|
|
195
|
+
const n = findLane(t);
|
|
196
|
+
if (T.has(n)) return n;
|
|
197
|
+
e.H = undefined;
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
function resolveTransition(e) {
|
|
201
|
+
return resolveLane(e)?.V ?? e.V;
|
|
202
|
+
}
|
|
203
|
+
function hasActiveOverride(e) {
|
|
204
|
+
return !!(e.G !== undefined && e.G !== x);
|
|
205
|
+
}
|
|
206
|
+
function assignOrMergeLane(e, t) {
|
|
207
|
+
const n = findLane(t);
|
|
208
|
+
const r = e.H;
|
|
209
|
+
if (r) {
|
|
210
|
+
if (r.D) {
|
|
211
|
+
e.H = t;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const i = findLane(r);
|
|
215
|
+
if (T.has(i)) {
|
|
216
|
+
if (i !== n && !hasActiveOverride(e)) {
|
|
217
|
+
if (n.K && findLane(n.K) === i) {
|
|
218
|
+
e.H = t;
|
|
219
|
+
} else if (i.K && findLane(i.K) === n);
|
|
220
|
+
else mergeLanes(n, i);
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
e.H = t;
|
|
226
|
+
}
|
|
227
|
+
const H = new Set();
|
|
228
|
+
const q = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
229
|
+
const Q = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
230
|
+
let F = 0;
|
|
231
|
+
let M = null;
|
|
232
|
+
let D = false;
|
|
233
|
+
let V = 0;
|
|
234
|
+
let K = false;
|
|
235
|
+
let B = null;
|
|
236
|
+
const G = new Set();
|
|
161
237
|
function registerTransientStoreNode(e) {
|
|
162
|
-
|
|
238
|
+
G.add(e);
|
|
239
|
+
}
|
|
240
|
+
function canUseSimpleSyncFlush(e) {
|
|
241
|
+
return (
|
|
242
|
+
H.size === 0 &&
|
|
243
|
+
T.size === 0 &&
|
|
244
|
+
e.U.length === 0 &&
|
|
245
|
+
e.J.length === 0 &&
|
|
246
|
+
e.X.size === 0 &&
|
|
247
|
+
G.size === 0
|
|
248
|
+
);
|
|
163
249
|
}
|
|
164
250
|
function sweepTransientStoreNodes() {
|
|
165
|
-
if (
|
|
166
|
-
for (const e of
|
|
251
|
+
if (G.size === 0) return;
|
|
252
|
+
for (const e of G) {
|
|
167
253
|
if (e.O !== null) {
|
|
168
|
-
|
|
254
|
+
G.delete(e);
|
|
169
255
|
continue;
|
|
170
256
|
}
|
|
171
|
-
if (e.
|
|
172
|
-
if (e.
|
|
173
|
-
|
|
174
|
-
e.
|
|
257
|
+
if (e.Y !== x) continue;
|
|
258
|
+
if (e.G !== undefined && e.G !== x) continue;
|
|
259
|
+
G.delete(e);
|
|
260
|
+
e.Z?.();
|
|
175
261
|
}
|
|
176
262
|
}
|
|
177
263
|
function enforceLoadingBoundary(e) {}
|
|
178
264
|
function shouldReadStashedOptimisticValue(e) {
|
|
179
|
-
return !!
|
|
265
|
+
return !!B?.has(e);
|
|
180
266
|
}
|
|
181
267
|
function runLaneEffects(e) {
|
|
182
|
-
for (const t of
|
|
183
|
-
if (t.
|
|
184
|
-
const n = t.
|
|
268
|
+
for (const t of T) {
|
|
269
|
+
if (t.D || t.F.size > 0) continue;
|
|
270
|
+
const n = t.M[e - 1];
|
|
185
271
|
if (n.length) {
|
|
186
|
-
t.
|
|
272
|
+
t.M[e - 1] = [];
|
|
187
273
|
runQueue(n, e);
|
|
188
274
|
}
|
|
189
275
|
}
|
|
190
276
|
}
|
|
191
277
|
function queueStashedOptimisticEffects(e) {
|
|
192
278
|
for (let t = e.O; t !== null; t = t.P) {
|
|
193
|
-
const e = t.
|
|
194
|
-
if (!e
|
|
195
|
-
if (e
|
|
196
|
-
if (!e.
|
|
197
|
-
e.
|
|
198
|
-
e.
|
|
279
|
+
const e = t.C;
|
|
280
|
+
if (!e.$) continue;
|
|
281
|
+
if (e.$ === P) {
|
|
282
|
+
if (!e.ee) {
|
|
283
|
+
e.ee = true;
|
|
284
|
+
e.te.enqueue(v, e.ne);
|
|
199
285
|
}
|
|
200
286
|
continue;
|
|
201
287
|
}
|
|
202
|
-
const n = e.m & o ?
|
|
203
|
-
if (n.
|
|
288
|
+
const n = e.m & o ? Q : q;
|
|
289
|
+
if (n.j > e.o) n.j = e.o;
|
|
204
290
|
insertIntoHeap(e, n);
|
|
205
291
|
}
|
|
206
292
|
}
|
|
207
293
|
function setProjectionWriteActive(e) {
|
|
208
|
-
|
|
294
|
+
K = e;
|
|
209
295
|
}
|
|
210
296
|
function mergeTransitionState(e, t) {
|
|
211
|
-
t.
|
|
297
|
+
t.re = e;
|
|
298
|
+
e.ie.push(...t.ie);
|
|
299
|
+
for (const n of T) if (n.V === t) n.V = e;
|
|
212
300
|
e.J.push(...t.J);
|
|
213
|
-
for (const n of
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
let t = e.$.get(n);
|
|
218
|
-
if (!t) e.$.set(n, (t = new Set()));
|
|
301
|
+
for (const n of t.X) e.X.add(n);
|
|
302
|
+
for (const [n, r] of t.se) {
|
|
303
|
+
let t = e.se.get(n);
|
|
304
|
+
if (!t) e.se.set(n, (t = new Set()));
|
|
219
305
|
for (const e of r) t.add(e);
|
|
220
306
|
}
|
|
221
|
-
for (const n of t.
|
|
307
|
+
for (const n of t.oe) e.oe.add(n);
|
|
222
308
|
}
|
|
223
309
|
function resolveOptimisticNodes(e) {
|
|
224
310
|
for (let t = 0; t < e.length; t++) {
|
|
225
311
|
const n = e[t];
|
|
226
|
-
n.
|
|
227
|
-
if (n.
|
|
228
|
-
n.
|
|
229
|
-
n.
|
|
312
|
+
n.H = undefined;
|
|
313
|
+
if (n.Y !== x) {
|
|
314
|
+
n.ue = n.Y;
|
|
315
|
+
n.Y = x;
|
|
230
316
|
}
|
|
231
|
-
const r = n.
|
|
232
|
-
n.
|
|
233
|
-
if (r !==
|
|
234
|
-
n.
|
|
317
|
+
const r = n.G;
|
|
318
|
+
n.G = x;
|
|
319
|
+
if (r !== x && n.ue !== r) insertSubs(n, true);
|
|
320
|
+
n.V = null;
|
|
235
321
|
}
|
|
236
322
|
e.length = 0;
|
|
237
323
|
}
|
|
238
324
|
function cleanupCompletedLanes(e) {
|
|
239
|
-
for (const t of
|
|
240
|
-
const n = e ? t.
|
|
325
|
+
for (const t of T) {
|
|
326
|
+
const n = e ? t.V === e : !t.V;
|
|
241
327
|
if (!n) continue;
|
|
242
|
-
if (!t.
|
|
243
|
-
if (t.
|
|
244
|
-
if (t.
|
|
328
|
+
if (!t.D) {
|
|
329
|
+
if (t.M[0].length) runQueue(t.M[0], O);
|
|
330
|
+
if (t.M[1].length) runQueue(t.M[1], v);
|
|
245
331
|
}
|
|
246
|
-
if (t.
|
|
247
|
-
t.
|
|
248
|
-
t.
|
|
249
|
-
t.
|
|
250
|
-
|
|
251
|
-
|
|
332
|
+
if (t.q.H === t) t.q.H = undefined;
|
|
333
|
+
t.F.clear();
|
|
334
|
+
t.M[0].length = 0;
|
|
335
|
+
t.M[1].length = 0;
|
|
336
|
+
T.delete(t);
|
|
337
|
+
L.delete(t.q);
|
|
252
338
|
}
|
|
253
339
|
}
|
|
254
340
|
function schedule() {
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
if (!
|
|
341
|
+
if (D) return;
|
|
342
|
+
D = true;
|
|
343
|
+
if (!V && !z.le && !K) queueMicrotask(flush);
|
|
258
344
|
}
|
|
259
345
|
class Queue {
|
|
260
346
|
i = null;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
created =
|
|
347
|
+
fe = [[], []];
|
|
348
|
+
U = [];
|
|
349
|
+
created = F;
|
|
264
350
|
addChild(e) {
|
|
265
|
-
this.
|
|
351
|
+
this.U.push(e);
|
|
266
352
|
e.i = this;
|
|
267
353
|
}
|
|
268
354
|
removeChild(e) {
|
|
269
|
-
const t = this.
|
|
355
|
+
const t = this.U.indexOf(e);
|
|
270
356
|
if (t >= 0) {
|
|
271
|
-
this.
|
|
357
|
+
this.U.splice(t, 1);
|
|
272
358
|
e.i = null;
|
|
273
359
|
}
|
|
274
360
|
}
|
|
@@ -277,122 +363,133 @@ class Queue {
|
|
|
277
363
|
return false;
|
|
278
364
|
}
|
|
279
365
|
run(e) {
|
|
280
|
-
if (this.
|
|
281
|
-
const t = this.
|
|
282
|
-
this.
|
|
366
|
+
if (this.fe[e - 1].length) {
|
|
367
|
+
const t = this.fe[e - 1];
|
|
368
|
+
this.fe[e - 1] = [];
|
|
283
369
|
runQueue(t, e);
|
|
284
370
|
}
|
|
285
|
-
for (let t = 0; t < this.
|
|
371
|
+
for (let t = 0; t < this.U.length; t++) this.U[t].run?.(e);
|
|
286
372
|
}
|
|
287
373
|
enqueue(e, t) {
|
|
288
374
|
if (e) {
|
|
289
|
-
if (
|
|
290
|
-
const n = findLane(
|
|
291
|
-
n.
|
|
375
|
+
if (re) {
|
|
376
|
+
const n = findLane(re);
|
|
377
|
+
n.M[e - 1].push(t);
|
|
292
378
|
} else {
|
|
293
|
-
this.
|
|
379
|
+
this.fe[e - 1].push(t);
|
|
294
380
|
}
|
|
295
381
|
}
|
|
296
382
|
schedule();
|
|
297
383
|
}
|
|
298
384
|
stashQueues(e) {
|
|
299
|
-
e.
|
|
300
|
-
e.
|
|
301
|
-
this.
|
|
302
|
-
for (let t = 0; t < this.
|
|
303
|
-
let n = this.
|
|
304
|
-
let r = e.
|
|
385
|
+
e.fe[0].push(...this.fe[0]);
|
|
386
|
+
e.fe[1].push(...this.fe[1]);
|
|
387
|
+
this.fe = [[], []];
|
|
388
|
+
for (let t = 0; t < this.U.length; t++) {
|
|
389
|
+
let n = this.U[t];
|
|
390
|
+
let r = e.U[t];
|
|
305
391
|
if (!r) {
|
|
306
|
-
r = {
|
|
307
|
-
e.
|
|
392
|
+
r = { fe: [[], []], U: [] };
|
|
393
|
+
e.U[t] = r;
|
|
308
394
|
}
|
|
309
395
|
n.stashQueues(r);
|
|
310
396
|
}
|
|
311
397
|
}
|
|
312
398
|
restoreQueues(e) {
|
|
313
|
-
this.
|
|
314
|
-
this.
|
|
315
|
-
for (let t = 0; t < e.
|
|
316
|
-
const n = e.
|
|
317
|
-
let r = this.
|
|
399
|
+
this.fe[0].push(...e.fe[0]);
|
|
400
|
+
this.fe[1].push(...e.fe[1]);
|
|
401
|
+
for (let t = 0; t < e.U.length; t++) {
|
|
402
|
+
const n = e.U[t];
|
|
403
|
+
let r = this.U[t];
|
|
318
404
|
if (r) r.restoreQueues(n);
|
|
319
405
|
}
|
|
320
406
|
}
|
|
321
407
|
}
|
|
322
408
|
class GlobalQueue extends Queue {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
static
|
|
329
|
-
static
|
|
409
|
+
le = false;
|
|
410
|
+
ce = null;
|
|
411
|
+
ae = [];
|
|
412
|
+
J = [];
|
|
413
|
+
X = new Set();
|
|
414
|
+
static de;
|
|
415
|
+
static pe;
|
|
416
|
+
static he;
|
|
417
|
+
static ge = null;
|
|
330
418
|
flush() {
|
|
331
|
-
if (this.
|
|
332
|
-
this.
|
|
419
|
+
if (this.le) return;
|
|
420
|
+
this.le = true;
|
|
333
421
|
try {
|
|
334
|
-
runHeap(
|
|
335
|
-
if (
|
|
336
|
-
const e = transitionComplete(
|
|
422
|
+
runHeap(q, GlobalQueue.de);
|
|
423
|
+
if (M) {
|
|
424
|
+
const e = transitionComplete(M);
|
|
337
425
|
if (!e) {
|
|
338
|
-
const e =
|
|
339
|
-
runHeap(
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
|
|
344
|
-
runLaneEffects(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
426
|
+
const e = M;
|
|
427
|
+
runHeap(Q, GlobalQueue.de);
|
|
428
|
+
this.ce = null;
|
|
429
|
+
this.ae = [];
|
|
430
|
+
this.J = [];
|
|
431
|
+
this.X = new Set();
|
|
432
|
+
runLaneEffects(O);
|
|
433
|
+
runLaneEffects(v);
|
|
434
|
+
this.stashQueues(e.Se);
|
|
435
|
+
F++;
|
|
436
|
+
D = q.S >= q.j;
|
|
437
|
+
reassignPendingTransition(e.ae);
|
|
438
|
+
M = null;
|
|
439
|
+
if (!e.ie.length && !e.se.size && e.J.length) {
|
|
440
|
+
B = new Set();
|
|
441
|
+
for (let t = 0; t < e.J.length; t++) {
|
|
442
|
+
const n = e.J[t];
|
|
443
|
+
if (n.L || n.ye & d) continue;
|
|
444
|
+
B.add(n);
|
|
356
445
|
queueStashedOptimisticEffects(n);
|
|
357
446
|
}
|
|
358
447
|
}
|
|
359
448
|
try {
|
|
360
449
|
finalizePureQueue(null, true);
|
|
361
450
|
} finally {
|
|
362
|
-
|
|
451
|
+
B = null;
|
|
363
452
|
}
|
|
364
453
|
return;
|
|
365
454
|
}
|
|
366
|
-
this.
|
|
367
|
-
this.restoreQueues(
|
|
368
|
-
|
|
369
|
-
const t =
|
|
370
|
-
|
|
371
|
-
reassignPendingTransition(this.
|
|
455
|
+
this.ae !== M.ae && this.ae.push(...M.ae);
|
|
456
|
+
this.restoreQueues(M.Se);
|
|
457
|
+
H.delete(M);
|
|
458
|
+
const t = M;
|
|
459
|
+
M = null;
|
|
460
|
+
reassignPendingTransition(this.ae);
|
|
372
461
|
finalizePureQueue(t);
|
|
373
462
|
} else {
|
|
374
|
-
if (
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
463
|
+
if (canUseSimpleSyncFlush(this)) {
|
|
464
|
+
commitPendingNodes();
|
|
465
|
+
if (q.S >= q.j) {
|
|
466
|
+
runHeap(q, GlobalQueue.de);
|
|
467
|
+
commitPendingNodes();
|
|
468
|
+
}
|
|
469
|
+
} else {
|
|
470
|
+
if (H.size) runHeap(Q, GlobalQueue.de);
|
|
471
|
+
finalizePureQueue();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
F++;
|
|
475
|
+
D = q.S >= q.j;
|
|
476
|
+
T.size && runLaneEffects(O);
|
|
477
|
+
this.run(O);
|
|
478
|
+
T.size && runLaneEffects(v);
|
|
479
|
+
this.run(v);
|
|
383
480
|
if (false);
|
|
384
481
|
} finally {
|
|
385
|
-
this.
|
|
482
|
+
this.le = false;
|
|
386
483
|
}
|
|
387
484
|
}
|
|
388
485
|
notify(e, t, n, r) {
|
|
389
|
-
if (t &
|
|
390
|
-
if (n &
|
|
391
|
-
const t = r !== undefined ? r : e.
|
|
392
|
-
if (
|
|
486
|
+
if (t & m) {
|
|
487
|
+
if (n & m) {
|
|
488
|
+
const t = r !== undefined ? r : e.we;
|
|
489
|
+
if (M && t) {
|
|
393
490
|
const n = t.source;
|
|
394
|
-
let r =
|
|
395
|
-
if (!r)
|
|
491
|
+
let r = M.se.get(n);
|
|
492
|
+
if (!r) M.se.set(n, (r = new Set()));
|
|
396
493
|
const i = r.size;
|
|
397
494
|
r.add(e);
|
|
398
495
|
if (r.size !== i) schedule();
|
|
@@ -404,123 +501,159 @@ class GlobalQueue extends Queue {
|
|
|
404
501
|
}
|
|
405
502
|
initTransition(e) {
|
|
406
503
|
if (e) e = currentTransition(e);
|
|
407
|
-
if (e && e ===
|
|
408
|
-
if (!e &&
|
|
409
|
-
if (!
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
Y: [],
|
|
415
|
-
Z: new Set(),
|
|
504
|
+
if (e && e === M) return;
|
|
505
|
+
if (!e && M && M.me === F) return;
|
|
506
|
+
if (!M) {
|
|
507
|
+
M = e ?? {
|
|
508
|
+
me: F,
|
|
509
|
+
ae: [],
|
|
510
|
+
se: new Map(),
|
|
416
511
|
J: [],
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
512
|
+
X: new Set(),
|
|
513
|
+
ie: [],
|
|
514
|
+
Se: { fe: [[], []], U: [] },
|
|
515
|
+
re: false,
|
|
516
|
+
oe: new Set()
|
|
420
517
|
};
|
|
421
518
|
} else if (e) {
|
|
422
|
-
const t =
|
|
519
|
+
const t = M;
|
|
423
520
|
mergeTransitionState(e, t);
|
|
424
|
-
|
|
425
|
-
|
|
521
|
+
H.delete(t);
|
|
522
|
+
M = e;
|
|
523
|
+
}
|
|
524
|
+
H.add(M);
|
|
525
|
+
M.me = F;
|
|
526
|
+
if (this.ce !== null) {
|
|
527
|
+
this.ce.V = M;
|
|
528
|
+
M.ae.push(this.ce);
|
|
529
|
+
this.ce = null;
|
|
426
530
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
t.X = L;
|
|
433
|
-
L.ue.push(t);
|
|
531
|
+
if (this.ae !== M.ae) {
|
|
532
|
+
for (let e = 0; e < this.ae.length; e++) {
|
|
533
|
+
const t = this.ae[e];
|
|
534
|
+
t.V = M;
|
|
535
|
+
M.ae.push(t);
|
|
434
536
|
}
|
|
435
|
-
this.
|
|
537
|
+
this.ae = M.ae;
|
|
436
538
|
}
|
|
437
|
-
if (this.
|
|
438
|
-
for (let e = 0; e < this.
|
|
439
|
-
const t = this.
|
|
440
|
-
t.
|
|
441
|
-
|
|
539
|
+
if (this.J !== M.J) {
|
|
540
|
+
for (let e = 0; e < this.J.length; e++) {
|
|
541
|
+
const t = this.J[e];
|
|
542
|
+
t.V = M;
|
|
543
|
+
M.J.push(t);
|
|
442
544
|
}
|
|
443
|
-
this.
|
|
545
|
+
this.J = M.J;
|
|
444
546
|
}
|
|
445
|
-
for (const e of
|
|
446
|
-
if (!e.
|
|
547
|
+
for (const e of T) {
|
|
548
|
+
if (!e.V) e.V = M;
|
|
447
549
|
}
|
|
448
|
-
if (this.
|
|
449
|
-
for (const e of this.
|
|
450
|
-
this.
|
|
550
|
+
if (this.X !== M.X) {
|
|
551
|
+
for (const e of this.X) M.X.add(e);
|
|
552
|
+
this.X = M.X;
|
|
451
553
|
}
|
|
452
554
|
}
|
|
453
555
|
}
|
|
556
|
+
function queuePendingNode(e) {
|
|
557
|
+
if (M) {
|
|
558
|
+
z.ae.push(e);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (z.ce === null && z.ae.length === 0) {
|
|
562
|
+
z.ce = e;
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (z.ce !== null) {
|
|
566
|
+
z.ae.push(z.ce);
|
|
567
|
+
z.ce = null;
|
|
568
|
+
}
|
|
569
|
+
z.ae.push(e);
|
|
570
|
+
}
|
|
454
571
|
function insertSubs(e, t = false) {
|
|
455
|
-
const n = e.
|
|
456
|
-
const r = e.
|
|
572
|
+
const n = e.H || re;
|
|
573
|
+
const r = e._e !== undefined;
|
|
457
574
|
for (let i = e.O; i !== null; i = i.P) {
|
|
458
|
-
if (r && i.
|
|
459
|
-
i.
|
|
575
|
+
if (r && i.C.ye & g) {
|
|
576
|
+
i.C.m |= f;
|
|
460
577
|
continue;
|
|
461
578
|
}
|
|
462
579
|
if (t && n) {
|
|
463
|
-
i.
|
|
464
|
-
assignOrMergeLane(i.
|
|
580
|
+
i.C.m |= l;
|
|
581
|
+
assignOrMergeLane(i.C, n);
|
|
465
582
|
} else if (t) {
|
|
466
|
-
i.
|
|
467
|
-
i.
|
|
583
|
+
i.C.m |= l;
|
|
584
|
+
i.C.H = undefined;
|
|
468
585
|
}
|
|
469
|
-
const e = i.
|
|
470
|
-
if (e
|
|
471
|
-
if (!e.
|
|
472
|
-
e.
|
|
473
|
-
e.
|
|
586
|
+
const e = i.C;
|
|
587
|
+
if (e.$ === P) {
|
|
588
|
+
if (!e.ee) {
|
|
589
|
+
e.ee = true;
|
|
590
|
+
e.te.enqueue(v, e.ne);
|
|
474
591
|
}
|
|
475
592
|
continue;
|
|
476
593
|
}
|
|
477
|
-
const s = i.
|
|
478
|
-
if (s.
|
|
479
|
-
insertIntoHeap(i.
|
|
594
|
+
const s = i.C.m & o ? Q : q;
|
|
595
|
+
if (s.j > i.C.o) s.j = i.C.o;
|
|
596
|
+
insertIntoHeap(i.C, s);
|
|
480
597
|
}
|
|
481
598
|
}
|
|
599
|
+
function commitPendingNode(e) {
|
|
600
|
+
const t = e;
|
|
601
|
+
if (!t.L) {
|
|
602
|
+
if (e.Y !== x) {
|
|
603
|
+
e.ue = e.Y;
|
|
604
|
+
e.Y = x;
|
|
605
|
+
}
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
if (e.Y !== x) {
|
|
609
|
+
e.ue = e.Y;
|
|
610
|
+
e.Y = x;
|
|
611
|
+
if (e.$ && e.$ !== P) e.ee = true;
|
|
612
|
+
}
|
|
613
|
+
t.m &= ~a;
|
|
614
|
+
if (!(t.be & m)) t.be &= ~b;
|
|
615
|
+
if (t.Oe !== null || t.ve !== null) GlobalQueue.pe(t, false, true);
|
|
616
|
+
}
|
|
482
617
|
function commitPendingNodes() {
|
|
483
|
-
|
|
618
|
+
if (z.ce !== null) {
|
|
619
|
+
commitPendingNode(z.ce);
|
|
620
|
+
z.ce = null;
|
|
621
|
+
}
|
|
622
|
+
const e = z.ae;
|
|
484
623
|
for (let t = 0; t < e.length; t++) {
|
|
485
|
-
|
|
486
|
-
if (n.T !== v) {
|
|
487
|
-
n.ne = n.T;
|
|
488
|
-
n.T = v;
|
|
489
|
-
if (n.F && n.F !== O) n.B = true;
|
|
490
|
-
}
|
|
491
|
-
if (!(n.ge & S)) n.ge &= ~m;
|
|
492
|
-
if (n.I) GlobalQueue.le(n, false, true);
|
|
624
|
+
commitPendingNode(e[t]);
|
|
493
625
|
}
|
|
494
626
|
e.length = 0;
|
|
495
627
|
}
|
|
496
628
|
function finalizePureQueue(e = null, t = false) {
|
|
497
629
|
const n = !t;
|
|
498
630
|
if (n) commitPendingNodes();
|
|
499
|
-
if (!t) checkBoundaryChildren(
|
|
500
|
-
|
|
631
|
+
if (!t && z.U.length) checkBoundaryChildren(z);
|
|
632
|
+
const r = q.S >= q.j;
|
|
633
|
+
if (r) runHeap(q, GlobalQueue.de);
|
|
501
634
|
if (n) {
|
|
502
|
-
commitPendingNodes();
|
|
503
|
-
resolveOptimisticNodes(e ? e.
|
|
504
|
-
if (e && e.
|
|
505
|
-
for (const t of e.
|
|
635
|
+
if (r) commitPendingNodes();
|
|
636
|
+
resolveOptimisticNodes(e ? e.J : z.J);
|
|
637
|
+
if (e && e.oe.size) {
|
|
638
|
+
for (const t of e.oe) {
|
|
506
639
|
if (t.m & u) continue;
|
|
507
|
-
if (t
|
|
508
|
-
if (!t.
|
|
509
|
-
t.
|
|
510
|
-
t.
|
|
640
|
+
if (t.$ === P) {
|
|
641
|
+
if (!t.ee) {
|
|
642
|
+
t.ee = true;
|
|
643
|
+
t.te.enqueue(v, t.ne);
|
|
511
644
|
}
|
|
512
645
|
continue;
|
|
513
646
|
}
|
|
514
|
-
const e = t.m & o ?
|
|
515
|
-
if (e.
|
|
647
|
+
const e = t.m & o ? Q : q;
|
|
648
|
+
if (e.j > t.o) e.j = t.o;
|
|
516
649
|
insertIntoHeap(t, e);
|
|
517
650
|
}
|
|
518
|
-
e.
|
|
651
|
+
e.oe.clear();
|
|
519
652
|
}
|
|
520
|
-
const t = e ? e.
|
|
521
|
-
if (GlobalQueue.
|
|
653
|
+
const t = e ? e.X : z.X;
|
|
654
|
+
if (GlobalQueue.ge && t.size) {
|
|
522
655
|
for (const e of t) {
|
|
523
|
-
GlobalQueue.
|
|
656
|
+
GlobalQueue.ge(e);
|
|
524
657
|
}
|
|
525
658
|
t.clear();
|
|
526
659
|
schedule();
|
|
@@ -530,27 +663,36 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
530
663
|
}
|
|
531
664
|
}
|
|
532
665
|
function checkBoundaryChildren(e) {
|
|
533
|
-
for (const t of e.
|
|
666
|
+
for (const t of e.U) {
|
|
534
667
|
t.checkSources?.();
|
|
535
668
|
checkBoundaryChildren(t);
|
|
536
669
|
}
|
|
537
670
|
}
|
|
538
671
|
function trackOptimisticStore(e) {
|
|
539
|
-
|
|
672
|
+
z.X.add(e);
|
|
540
673
|
schedule();
|
|
541
674
|
}
|
|
542
675
|
function reassignPendingTransition(e) {
|
|
543
676
|
for (let t = 0; t < e.length; t++) {
|
|
544
|
-
e[t].
|
|
677
|
+
e[t].V = M;
|
|
545
678
|
}
|
|
546
679
|
}
|
|
547
|
-
const
|
|
548
|
-
function flush() {
|
|
549
|
-
if (
|
|
680
|
+
const z = new GlobalQueue();
|
|
681
|
+
function flush(e) {
|
|
682
|
+
if (e) {
|
|
683
|
+
V++;
|
|
684
|
+
try {
|
|
685
|
+
return e();
|
|
686
|
+
} finally {
|
|
687
|
+
flush();
|
|
688
|
+
V--;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
if (z.le) {
|
|
550
692
|
return;
|
|
551
693
|
}
|
|
552
|
-
while (
|
|
553
|
-
|
|
694
|
+
while (D || M) {
|
|
695
|
+
z.flush();
|
|
554
696
|
}
|
|
555
697
|
}
|
|
556
698
|
function runQueue(e, t) {
|
|
@@ -558,21 +700,21 @@ function runQueue(e, t) {
|
|
|
558
700
|
}
|
|
559
701
|
function reporterBlocksSource(e, t) {
|
|
560
702
|
if (e.m & (o | u)) return false;
|
|
561
|
-
if (e.
|
|
703
|
+
if (e.Pe === t || e.xe?.has(t)) return true;
|
|
562
704
|
for (let n = e.W; n; n = n.R) {
|
|
563
705
|
let e = n.A;
|
|
564
706
|
while (e) {
|
|
565
|
-
if (e === t || e.
|
|
566
|
-
e = e.
|
|
707
|
+
if (e === t || e.I === t) return true;
|
|
708
|
+
e = e.T;
|
|
567
709
|
}
|
|
568
710
|
}
|
|
569
|
-
return !!(e.
|
|
711
|
+
return !!(e.be & m && e.we instanceof NotReadyError && e.we.source === t);
|
|
570
712
|
}
|
|
571
713
|
function transitionComplete(e) {
|
|
572
|
-
if (e.
|
|
573
|
-
if (e.
|
|
714
|
+
if (e.re) return true;
|
|
715
|
+
if (e.ie.length) return false;
|
|
574
716
|
let t = true;
|
|
575
|
-
for (const [n, r] of e
|
|
717
|
+
for (const [n, r] of e.se) {
|
|
576
718
|
let i = false;
|
|
577
719
|
for (const e of r) {
|
|
578
720
|
if (reporterBlocksSource(e, n)) {
|
|
@@ -581,181 +723,57 @@ function transitionComplete(e) {
|
|
|
581
723
|
}
|
|
582
724
|
r.delete(e);
|
|
583
725
|
}
|
|
584
|
-
if (!i) e
|
|
585
|
-
else if (n.
|
|
726
|
+
if (!i) e.se.delete(n);
|
|
727
|
+
else if (n.be & m && n.we?.source === n) {
|
|
586
728
|
t = false;
|
|
587
729
|
break;
|
|
588
730
|
}
|
|
589
731
|
}
|
|
590
732
|
if (t) {
|
|
591
|
-
for (let n = 0; n < e.
|
|
592
|
-
const r = e.
|
|
733
|
+
for (let n = 0; n < e.J.length; n++) {
|
|
734
|
+
const r = e.J[n];
|
|
593
735
|
if (
|
|
594
736
|
hasActiveOverride(r) &&
|
|
595
|
-
"
|
|
596
|
-
r.
|
|
597
|
-
r.
|
|
598
|
-
r.
|
|
737
|
+
"be" in r &&
|
|
738
|
+
r.be & m &&
|
|
739
|
+
r.we instanceof NotReadyError &&
|
|
740
|
+
r.we.source !== r
|
|
599
741
|
) {
|
|
600
742
|
t = false;
|
|
601
743
|
break;
|
|
602
744
|
}
|
|
603
745
|
}
|
|
604
746
|
}
|
|
605
|
-
t && (e.
|
|
747
|
+
t && (e.re = true);
|
|
606
748
|
return t;
|
|
607
749
|
}
|
|
608
750
|
function currentTransition(e) {
|
|
609
|
-
while (e.
|
|
751
|
+
while (e.re && typeof e.re === "object") e = e.re;
|
|
610
752
|
return e;
|
|
611
753
|
}
|
|
612
754
|
function setActiveTransition(e) {
|
|
613
|
-
|
|
755
|
+
M = e;
|
|
614
756
|
}
|
|
615
757
|
function runInTransition(e, t) {
|
|
616
|
-
const n =
|
|
758
|
+
const n = M;
|
|
617
759
|
try {
|
|
618
|
-
|
|
760
|
+
M = currentTransition(e);
|
|
619
761
|
return t();
|
|
620
762
|
} finally {
|
|
621
|
-
|
|
763
|
+
M = n;
|
|
622
764
|
}
|
|
623
765
|
}
|
|
624
|
-
const
|
|
625
|
-
const V = new Set();
|
|
626
|
-
function getOrCreateLane(e) {
|
|
627
|
-
let t = M.get(e);
|
|
628
|
-
if (t) {
|
|
629
|
-
return findLane(t);
|
|
630
|
-
}
|
|
631
|
-
const n = e.me;
|
|
632
|
-
const r = n?.te ? findLane(n.te) : null;
|
|
633
|
-
t = { re: e, V: new Set(), D: [[], []], M: null, X: L, be: r };
|
|
634
|
-
M.set(e, t);
|
|
635
|
-
V.add(t);
|
|
636
|
-
e._e = false;
|
|
637
|
-
return t;
|
|
638
|
-
}
|
|
639
|
-
function findLane(e) {
|
|
640
|
-
while (e.M) e = e.M;
|
|
641
|
-
return e;
|
|
642
|
-
}
|
|
643
|
-
function mergeLanes(e, t) {
|
|
644
|
-
e = findLane(e);
|
|
645
|
-
t = findLane(t);
|
|
646
|
-
if (e === t) return e;
|
|
647
|
-
t.M = e;
|
|
648
|
-
for (const n of t.V) e.V.add(n);
|
|
649
|
-
e.D[0].push(...t.D[0]);
|
|
650
|
-
e.D[1].push(...t.D[1]);
|
|
651
|
-
return e;
|
|
652
|
-
}
|
|
653
|
-
function resolveLane(e) {
|
|
654
|
-
const t = e.te;
|
|
655
|
-
if (!t) return undefined;
|
|
656
|
-
const n = findLane(t);
|
|
657
|
-
if (V.has(n)) return n;
|
|
658
|
-
e.te = undefined;
|
|
659
|
-
return undefined;
|
|
660
|
-
}
|
|
661
|
-
function resolveTransition(e) {
|
|
662
|
-
return resolveLane(e)?.X ?? e.X;
|
|
663
|
-
}
|
|
664
|
-
function hasActiveOverride(e) {
|
|
665
|
-
return !!(e.H !== undefined && e.H !== v);
|
|
666
|
-
}
|
|
667
|
-
function assignOrMergeLane(e, t) {
|
|
668
|
-
const n = findLane(t);
|
|
669
|
-
const r = e.te;
|
|
670
|
-
if (r) {
|
|
671
|
-
if (r.M) {
|
|
672
|
-
e.te = t;
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
const i = findLane(r);
|
|
676
|
-
if (V.has(i)) {
|
|
677
|
-
if (i !== n && !hasActiveOverride(e)) {
|
|
678
|
-
if (n.be && findLane(n.be) === i) {
|
|
679
|
-
e.te = t;
|
|
680
|
-
} else if (i.be && findLane(i.be) === n);
|
|
681
|
-
else mergeLanes(n, i);
|
|
682
|
-
}
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
e.te = t;
|
|
687
|
-
}
|
|
688
|
-
function unlinkSubs(e) {
|
|
689
|
-
const t = e.A;
|
|
690
|
-
const n = e.R;
|
|
691
|
-
const r = e.P;
|
|
692
|
-
const i = e.Oe;
|
|
693
|
-
if (r !== null) r.Oe = i;
|
|
694
|
-
else t.ve = i;
|
|
695
|
-
if (i !== null) i.P = r;
|
|
696
|
-
else {
|
|
697
|
-
t.O = r;
|
|
698
|
-
if (r === null) {
|
|
699
|
-
t.q?.();
|
|
700
|
-
const e = t;
|
|
701
|
-
e.I && e.de & g && !(e.m & o) && unobserved(e);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
return n;
|
|
705
|
-
}
|
|
706
|
-
function unobserved(e) {
|
|
707
|
-
deleteFromHeap(e, e.m & o ? R : W);
|
|
708
|
-
let t = e.W;
|
|
709
|
-
while (t !== null) {
|
|
710
|
-
t = unlinkSubs(t);
|
|
711
|
-
}
|
|
712
|
-
e.W = null;
|
|
713
|
-
e.xe = null;
|
|
714
|
-
disposeChildren(e, true);
|
|
715
|
-
}
|
|
716
|
-
function link(e, t) {
|
|
717
|
-
const n = t.xe;
|
|
718
|
-
if (n !== null && n.A === e) return;
|
|
719
|
-
let i = null;
|
|
720
|
-
const s = t.m & r;
|
|
721
|
-
if (s) {
|
|
722
|
-
i = n !== null ? n.R : t.W;
|
|
723
|
-
if (i !== null && i.A === e) {
|
|
724
|
-
t.xe = i;
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
const o = e.ve;
|
|
729
|
-
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
730
|
-
const u = (t.xe = e.ve = { A: e, k: t, R: i, Oe: o, P: null });
|
|
731
|
-
if (n !== null) n.R = u;
|
|
732
|
-
else t.W = u;
|
|
733
|
-
if (o !== null) o.P = u;
|
|
734
|
-
else e.O = u;
|
|
735
|
-
}
|
|
736
|
-
function isValidLink(e, t) {
|
|
737
|
-
const n = t.xe;
|
|
738
|
-
if (n !== null) {
|
|
739
|
-
let r = t.W;
|
|
740
|
-
do {
|
|
741
|
-
if (r === e) return true;
|
|
742
|
-
if (r === n) break;
|
|
743
|
-
r = r.R;
|
|
744
|
-
} while (r !== null);
|
|
745
|
-
}
|
|
746
|
-
return false;
|
|
747
|
-
}
|
|
748
|
-
const D = {};
|
|
766
|
+
const U = {};
|
|
749
767
|
function markDisposal(e) {
|
|
750
|
-
let t = e.
|
|
768
|
+
let t = e.Ce;
|
|
751
769
|
while (t) {
|
|
752
770
|
t.m |= o;
|
|
753
771
|
if (t.m & i) {
|
|
754
|
-
deleteFromHeap(t,
|
|
755
|
-
insertIntoHeap(t,
|
|
772
|
+
deleteFromHeap(t, q);
|
|
773
|
+
insertIntoHeap(t, Q);
|
|
756
774
|
}
|
|
757
775
|
markDisposal(t);
|
|
758
|
-
t = t.
|
|
776
|
+
t = t.Ne;
|
|
759
777
|
}
|
|
760
778
|
}
|
|
761
779
|
function dispose(e) {
|
|
@@ -764,39 +782,48 @@ function dispose(e) {
|
|
|
764
782
|
t = unlinkSubs(t);
|
|
765
783
|
} while (t !== null);
|
|
766
784
|
e.W = null;
|
|
767
|
-
e.
|
|
785
|
+
e.Ee = null;
|
|
768
786
|
disposeChildren(e, true);
|
|
769
787
|
}
|
|
770
788
|
function disposeChildren(e, t = false, n) {
|
|
771
|
-
|
|
772
|
-
if (
|
|
773
|
-
if (t
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
789
|
+
const r = e.m;
|
|
790
|
+
if (r & u) return;
|
|
791
|
+
if (t) e.m = r | u;
|
|
792
|
+
if (t && e.L) e.ke = null;
|
|
793
|
+
let i = n ? e.Oe : e.Ce;
|
|
794
|
+
while (i) {
|
|
795
|
+
const e = i.Ne;
|
|
796
|
+
if (i.W) {
|
|
797
|
+
const e = i;
|
|
798
|
+
deleteFromHeap(e, e.m & o ? Q : q);
|
|
780
799
|
let t = e.W;
|
|
781
800
|
do {
|
|
782
801
|
t = unlinkSubs(t);
|
|
783
802
|
} while (t !== null);
|
|
784
803
|
e.W = null;
|
|
785
|
-
e.
|
|
804
|
+
e.Ee = null;
|
|
786
805
|
}
|
|
787
|
-
disposeChildren(
|
|
788
|
-
|
|
806
|
+
disposeChildren(i, true);
|
|
807
|
+
i = e;
|
|
789
808
|
}
|
|
790
809
|
if (n) {
|
|
791
|
-
e.
|
|
810
|
+
e.Oe = null;
|
|
792
811
|
} else {
|
|
793
|
-
e.
|
|
812
|
+
e.Ce = null;
|
|
794
813
|
e.je = 0;
|
|
795
814
|
}
|
|
815
|
+
if (t && !n && !(r & o) && e.i !== null && !(e.i.m & u)) {
|
|
816
|
+
const t = e.We;
|
|
817
|
+
const n = e.Ne;
|
|
818
|
+
if (t !== null) t.Ne = n;
|
|
819
|
+
else e.i.Ce = n;
|
|
820
|
+
if (n !== null) n.We = t;
|
|
821
|
+
e.We = null;
|
|
822
|
+
}
|
|
796
823
|
runDisposal(e, n);
|
|
797
824
|
}
|
|
798
825
|
function runDisposal(e, t) {
|
|
799
|
-
let n = t ? e.
|
|
826
|
+
let n = t ? e.ve : e.Re;
|
|
800
827
|
if (!n) return;
|
|
801
828
|
if (Array.isArray(n)) {
|
|
802
829
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -806,11 +833,11 @@ function runDisposal(e, t) {
|
|
|
806
833
|
} else {
|
|
807
834
|
n.call(n);
|
|
808
835
|
}
|
|
809
|
-
t ? (e.
|
|
836
|
+
t ? (e.ve = null) : (e.Re = null);
|
|
810
837
|
}
|
|
811
838
|
function childId(e, t) {
|
|
812
839
|
let n = e;
|
|
813
|
-
while (n.
|
|
840
|
+
while (n.ye & h && n.i) n = n.i;
|
|
814
841
|
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
815
842
|
throw new Error("Cannot get child id from owner without an id");
|
|
816
843
|
}
|
|
@@ -826,110 +853,184 @@ function formatId(e, t) {
|
|
|
826
853
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
827
854
|
}
|
|
828
855
|
function getObserver() {
|
|
829
|
-
if (
|
|
830
|
-
return
|
|
856
|
+
if ($ || te) return U;
|
|
857
|
+
return X ? ne : null;
|
|
831
858
|
}
|
|
832
859
|
function getOwner() {
|
|
833
|
-
return
|
|
860
|
+
return ne;
|
|
834
861
|
}
|
|
835
862
|
function cleanup(e) {
|
|
836
|
-
if (!
|
|
837
|
-
if (!
|
|
838
|
-
else if (Array.isArray(
|
|
839
|
-
else
|
|
863
|
+
if (!ne) return e;
|
|
864
|
+
if (!ne.Re) ne.Re = e;
|
|
865
|
+
else if (Array.isArray(ne.Re)) ne.Re.push(e);
|
|
866
|
+
else ne.Re = [ne.Re, e];
|
|
840
867
|
return e;
|
|
841
868
|
}
|
|
842
869
|
function isDisposed(e) {
|
|
843
870
|
return !!(e.m & (u | o));
|
|
844
871
|
}
|
|
872
|
+
function disposeRootSelf(e = true) {
|
|
873
|
+
disposeChildren(this, e);
|
|
874
|
+
}
|
|
845
875
|
function createOwner(e) {
|
|
846
|
-
const t =
|
|
876
|
+
const t = ne;
|
|
847
877
|
const n = e?.transparent ?? false;
|
|
848
878
|
const r = {
|
|
849
879
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
850
|
-
|
|
880
|
+
ye: n ? h : 0,
|
|
851
881
|
t: true,
|
|
852
882
|
u: t?.t ? t.u : t,
|
|
853
|
-
|
|
854
|
-
|
|
883
|
+
Ce: null,
|
|
884
|
+
Ne: null,
|
|
855
885
|
We: null,
|
|
856
|
-
|
|
857
|
-
|
|
886
|
+
Re: null,
|
|
887
|
+
te: t?.te ?? z,
|
|
888
|
+
Ae: t?.Ae || k,
|
|
858
889
|
je: 0,
|
|
859
|
-
|
|
860
|
-
|
|
890
|
+
ve: null,
|
|
891
|
+
Oe: null,
|
|
861
892
|
i: t,
|
|
862
|
-
dispose
|
|
863
|
-
disposeChildren(r, e);
|
|
864
|
-
}
|
|
893
|
+
dispose: disposeRootSelf
|
|
865
894
|
};
|
|
866
895
|
if (t) {
|
|
867
|
-
const e = t.
|
|
896
|
+
const e = t.Ce;
|
|
868
897
|
if (e === null) {
|
|
869
|
-
t.
|
|
898
|
+
t.Ce = r;
|
|
870
899
|
} else {
|
|
871
|
-
r.
|
|
872
|
-
|
|
900
|
+
r.Ne = e;
|
|
901
|
+
e.We = r;
|
|
902
|
+
t.Ce = r;
|
|
873
903
|
}
|
|
874
904
|
}
|
|
875
905
|
return r;
|
|
876
906
|
}
|
|
877
907
|
function createRoot(e, t) {
|
|
878
908
|
const n = createOwner(t);
|
|
879
|
-
return runWithOwner(n, () => e(n.dispose));
|
|
909
|
+
return runWithOwner(n, () => e(() => n.dispose()));
|
|
910
|
+
}
|
|
911
|
+
function unlinkSubs(e) {
|
|
912
|
+
const t = e.A;
|
|
913
|
+
const n = e.R;
|
|
914
|
+
const r = e.P;
|
|
915
|
+
const i = e.Ie;
|
|
916
|
+
if (r !== null) r.Ie = i;
|
|
917
|
+
else t.Le = i;
|
|
918
|
+
if (i !== null) i.P = r;
|
|
919
|
+
else {
|
|
920
|
+
t.O = r;
|
|
921
|
+
if (r === null) {
|
|
922
|
+
t.Z?.();
|
|
923
|
+
const e = t;
|
|
924
|
+
e.L && e.ye & y && !(e.m & o) && unobserved(e);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
return n;
|
|
928
|
+
}
|
|
929
|
+
function trimStaleDeps(e) {
|
|
930
|
+
const t = e.Ee;
|
|
931
|
+
let n = t !== null ? t.R : e.W;
|
|
932
|
+
if (n !== null) {
|
|
933
|
+
do {
|
|
934
|
+
n = unlinkSubs(n);
|
|
935
|
+
} while (n !== null);
|
|
936
|
+
if (t !== null) t.R = null;
|
|
937
|
+
else e.W = null;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function unobserved(e) {
|
|
941
|
+
deleteFromHeap(e, e.m & o ? Q : q);
|
|
942
|
+
let t = e.W;
|
|
943
|
+
while (t !== null) {
|
|
944
|
+
t = unlinkSubs(t);
|
|
945
|
+
}
|
|
946
|
+
e.W = null;
|
|
947
|
+
e.Ee = null;
|
|
948
|
+
disposeChildren(e, true);
|
|
949
|
+
}
|
|
950
|
+
function link(e, t) {
|
|
951
|
+
const n = t.Ee;
|
|
952
|
+
if (n !== null && n.A === e) return;
|
|
953
|
+
let i = null;
|
|
954
|
+
const s = t.m & r;
|
|
955
|
+
if (s) {
|
|
956
|
+
i = n !== null ? n.R : t.W;
|
|
957
|
+
if (i !== null && i.A === e) {
|
|
958
|
+
t.Ee = i;
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
const o = e.Le;
|
|
963
|
+
if (o !== null && o.C === t && (!s || isValidLink(o, t))) return;
|
|
964
|
+
const u = (t.Ee = e.Le = { A: e, C: t, R: i, Ie: o, P: null });
|
|
965
|
+
if (n !== null) n.R = u;
|
|
966
|
+
else t.W = u;
|
|
967
|
+
if (o !== null) o.P = u;
|
|
968
|
+
else e.O = u;
|
|
969
|
+
}
|
|
970
|
+
function isValidLink(e, t) {
|
|
971
|
+
const n = t.Ee;
|
|
972
|
+
if (n !== null) {
|
|
973
|
+
let r = t.W;
|
|
974
|
+
do {
|
|
975
|
+
if (r === e) return true;
|
|
976
|
+
if (r === n) break;
|
|
977
|
+
r = r.R;
|
|
978
|
+
} while (r !== null);
|
|
979
|
+
}
|
|
980
|
+
return false;
|
|
880
981
|
}
|
|
881
982
|
function addPendingSource(e, t) {
|
|
882
|
-
if (e.
|
|
883
|
-
if (!e.
|
|
884
|
-
e.
|
|
983
|
+
if (e.Pe === t || e.xe?.has(t)) return false;
|
|
984
|
+
if (!e.Pe) {
|
|
985
|
+
e.Pe = t;
|
|
885
986
|
return true;
|
|
886
987
|
}
|
|
887
|
-
if (!e.
|
|
888
|
-
e.
|
|
988
|
+
if (!e.xe) {
|
|
989
|
+
e.xe = new Set([e.Pe, t]);
|
|
889
990
|
} else {
|
|
890
|
-
e.
|
|
991
|
+
e.xe.add(t);
|
|
891
992
|
}
|
|
892
|
-
e.
|
|
993
|
+
e.Pe = undefined;
|
|
893
994
|
return true;
|
|
894
995
|
}
|
|
895
996
|
function removePendingSource(e, t) {
|
|
896
|
-
if (e.
|
|
897
|
-
if (e.
|
|
898
|
-
e.
|
|
997
|
+
if (e.Pe) {
|
|
998
|
+
if (e.Pe !== t) return false;
|
|
999
|
+
e.Pe = undefined;
|
|
899
1000
|
return true;
|
|
900
1001
|
}
|
|
901
|
-
if (!e.
|
|
902
|
-
if (e.
|
|
903
|
-
e.
|
|
904
|
-
e.
|
|
905
|
-
} else if (e.
|
|
906
|
-
e.
|
|
1002
|
+
if (!e.xe?.delete(t)) return false;
|
|
1003
|
+
if (e.xe.size === 1) {
|
|
1004
|
+
e.Pe = e.xe.values().next().value;
|
|
1005
|
+
e.xe = undefined;
|
|
1006
|
+
} else if (e.xe.size === 0) {
|
|
1007
|
+
e.xe = undefined;
|
|
907
1008
|
}
|
|
908
1009
|
return true;
|
|
909
1010
|
}
|
|
910
1011
|
function clearPendingSources(e) {
|
|
911
|
-
e.
|
|
912
|
-
e.
|
|
913
|
-
e.
|
|
1012
|
+
e.Pe = undefined;
|
|
1013
|
+
e.xe?.clear();
|
|
1014
|
+
e.xe = undefined;
|
|
914
1015
|
}
|
|
915
1016
|
function setPendingError(e, t, n) {
|
|
916
1017
|
if (!t) {
|
|
917
|
-
e.
|
|
1018
|
+
e.we = null;
|
|
918
1019
|
return;
|
|
919
1020
|
}
|
|
920
1021
|
if (n instanceof NotReadyError && n.source === t) {
|
|
921
|
-
e.
|
|
1022
|
+
e.we = n;
|
|
922
1023
|
return;
|
|
923
1024
|
}
|
|
924
|
-
const r = e.
|
|
1025
|
+
const r = e.we;
|
|
925
1026
|
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
926
|
-
e.
|
|
1027
|
+
e.we = new NotReadyError(t);
|
|
927
1028
|
}
|
|
928
1029
|
}
|
|
929
1030
|
function forEachDependent(e, t) {
|
|
930
|
-
for (let n = e.O; n !== null; n = n.P) t(n.
|
|
931
|
-
for (let n = e.
|
|
932
|
-
for (let e = n.O; e !== null; e = e.P) t(e.
|
|
1031
|
+
for (let n = e.O; n !== null; n = n.P) t(n.C);
|
|
1032
|
+
for (let n = e.N; n !== null; n = n.k) {
|
|
1033
|
+
for (let e = n.O; e !== null; e = e.P) t(e.C);
|
|
933
1034
|
}
|
|
934
1035
|
}
|
|
935
1036
|
function settlePendingSource(e) {
|
|
@@ -938,30 +1039,30 @@ function settlePendingSource(e) {
|
|
|
938
1039
|
const settle = r => {
|
|
939
1040
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
940
1041
|
n.add(r);
|
|
941
|
-
r.
|
|
942
|
-
const i = r.
|
|
1042
|
+
r.me = F;
|
|
1043
|
+
const i = r.Pe ?? r.xe?.values().next().value;
|
|
943
1044
|
if (i) {
|
|
944
1045
|
setPendingError(r, i);
|
|
945
1046
|
updatePendingSignal(r);
|
|
946
1047
|
} else {
|
|
947
|
-
r.
|
|
1048
|
+
r.be &= ~m;
|
|
948
1049
|
setPendingError(r);
|
|
949
1050
|
updatePendingSignal(r);
|
|
950
|
-
if (r.
|
|
951
|
-
if (r
|
|
1051
|
+
if (r.Te) {
|
|
1052
|
+
if (r.$ === P) {
|
|
952
1053
|
const e = r;
|
|
953
|
-
if (!e.
|
|
954
|
-
e.
|
|
955
|
-
e.
|
|
1054
|
+
if (!e.ee) {
|
|
1055
|
+
e.ee = true;
|
|
1056
|
+
e.te.enqueue(v, e.ne);
|
|
956
1057
|
}
|
|
957
1058
|
} else {
|
|
958
|
-
const e = r.m & o ?
|
|
959
|
-
if (e.
|
|
1059
|
+
const e = r.m & o ? Q : q;
|
|
1060
|
+
if (e.j > r.o) e.j = r.o;
|
|
960
1061
|
insertIntoHeap(r, e);
|
|
961
1062
|
}
|
|
962
1063
|
t = true;
|
|
963
1064
|
}
|
|
964
|
-
r.
|
|
1065
|
+
r.Te = false;
|
|
965
1066
|
}
|
|
966
1067
|
forEachDependent(r, settle);
|
|
967
1068
|
};
|
|
@@ -969,46 +1070,52 @@ function settlePendingSource(e) {
|
|
|
969
1070
|
if (t) schedule();
|
|
970
1071
|
}
|
|
971
1072
|
function handleAsync(e, t, r) {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1073
|
+
let i = false;
|
|
1074
|
+
let s = false;
|
|
1075
|
+
if (typeof t === "object" && t !== null) {
|
|
1076
|
+
untrack(() => {
|
|
1077
|
+
i = t[Symbol.asyncIterator];
|
|
1078
|
+
s = !i && typeof t.then === "function";
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
if (!s && !i) {
|
|
1082
|
+
e.ke = null;
|
|
977
1083
|
return t;
|
|
978
1084
|
}
|
|
979
|
-
e.
|
|
980
|
-
let
|
|
1085
|
+
e.ke = t;
|
|
1086
|
+
let o;
|
|
981
1087
|
const handleError = n => {
|
|
982
|
-
if (e.
|
|
983
|
-
|
|
984
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
985
|
-
e.
|
|
1088
|
+
if (e.ke !== t) return;
|
|
1089
|
+
z.initTransition(resolveTransition(e));
|
|
1090
|
+
notifyStatus(e, n instanceof NotReadyError ? m : _, n);
|
|
1091
|
+
e.me = F;
|
|
986
1092
|
};
|
|
987
1093
|
const asyncWrite = (i, s) => {
|
|
988
|
-
if (e.
|
|
989
|
-
if (e.m & (n |
|
|
990
|
-
|
|
991
|
-
const o = !!(e.
|
|
1094
|
+
if (e.ke !== t) return;
|
|
1095
|
+
if (e.m & (n | l)) return;
|
|
1096
|
+
z.initTransition(resolveTransition(e));
|
|
1097
|
+
const o = !!(e.be & b);
|
|
1098
|
+
trimStaleDeps(e);
|
|
992
1099
|
clearStatus(e);
|
|
993
1100
|
const u = resolveLane(e);
|
|
994
|
-
if (u) u.
|
|
1101
|
+
if (u) u.F.delete(e);
|
|
995
1102
|
if (r) r(i);
|
|
996
|
-
else if (e.
|
|
997
|
-
if (e.
|
|
1103
|
+
else if (e.G !== undefined) {
|
|
1104
|
+
if (e.G !== undefined && e.G !== x) e.Y = i;
|
|
998
1105
|
else {
|
|
999
|
-
e.
|
|
1106
|
+
e.ue = i;
|
|
1000
1107
|
insertSubs(e);
|
|
1001
1108
|
}
|
|
1002
|
-
e.
|
|
1109
|
+
e.me = F;
|
|
1003
1110
|
} else if (u) {
|
|
1004
|
-
const t = e
|
|
1005
|
-
const n = e.
|
|
1006
|
-
const r = e.
|
|
1111
|
+
const t = e.$;
|
|
1112
|
+
const n = e.ue;
|
|
1113
|
+
const r = e.He;
|
|
1007
1114
|
if ((!t && o) || !r || !r(i, n)) {
|
|
1008
|
-
e.
|
|
1009
|
-
e.
|
|
1010
|
-
if (e.
|
|
1011
|
-
setSignal(e.
|
|
1115
|
+
e.ue = i;
|
|
1116
|
+
e.me = F;
|
|
1117
|
+
if (e.qe) {
|
|
1118
|
+
setSignal(e.qe, i);
|
|
1012
1119
|
}
|
|
1013
1120
|
insertSubs(e, true);
|
|
1014
1121
|
}
|
|
@@ -1020,13 +1127,13 @@ function handleAsync(e, t, r) {
|
|
|
1020
1127
|
flush();
|
|
1021
1128
|
s?.();
|
|
1022
1129
|
};
|
|
1023
|
-
if (
|
|
1130
|
+
if (s) {
|
|
1024
1131
|
let n = false,
|
|
1025
1132
|
r = true;
|
|
1026
1133
|
t.then(
|
|
1027
1134
|
e => {
|
|
1028
1135
|
if (r) {
|
|
1029
|
-
|
|
1136
|
+
o = e;
|
|
1030
1137
|
n = true;
|
|
1031
1138
|
} else asyncWrite(e);
|
|
1032
1139
|
},
|
|
@@ -1036,11 +1143,11 @@ function handleAsync(e, t, r) {
|
|
|
1036
1143
|
);
|
|
1037
1144
|
r = false;
|
|
1038
1145
|
if (!n) {
|
|
1039
|
-
|
|
1040
|
-
throw new NotReadyError(
|
|
1146
|
+
z.initTransition(resolveTransition(e));
|
|
1147
|
+
throw new NotReadyError(ne);
|
|
1041
1148
|
}
|
|
1042
1149
|
}
|
|
1043
|
-
if (
|
|
1150
|
+
if (i) {
|
|
1044
1151
|
const n = t[Symbol.asyncIterator]();
|
|
1045
1152
|
let r = false;
|
|
1046
1153
|
let i = false;
|
|
@@ -1056,15 +1163,15 @@ function handleAsync(e, t, r) {
|
|
|
1056
1163
|
});
|
|
1057
1164
|
const iterate = () => {
|
|
1058
1165
|
let s,
|
|
1059
|
-
|
|
1060
|
-
|
|
1166
|
+
u = false,
|
|
1167
|
+
l = true;
|
|
1061
1168
|
n.next().then(
|
|
1062
1169
|
n => {
|
|
1063
|
-
if (
|
|
1170
|
+
if (l) {
|
|
1064
1171
|
s = n;
|
|
1065
|
-
|
|
1172
|
+
u = true;
|
|
1066
1173
|
if (n.done) i = true;
|
|
1067
|
-
} else if (e.
|
|
1174
|
+
} else if (e.ke !== t) {
|
|
1068
1175
|
return;
|
|
1069
1176
|
} else if (!n.done) asyncWrite(n.value, iterate);
|
|
1070
1177
|
else {
|
|
@@ -1074,88 +1181,88 @@ function handleAsync(e, t, r) {
|
|
|
1074
1181
|
}
|
|
1075
1182
|
},
|
|
1076
1183
|
n => {
|
|
1077
|
-
if (!
|
|
1184
|
+
if (!l && e.ke === t) {
|
|
1078
1185
|
i = true;
|
|
1079
1186
|
handleError(n);
|
|
1080
1187
|
}
|
|
1081
1188
|
}
|
|
1082
1189
|
);
|
|
1083
|
-
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
1190
|
+
l = false;
|
|
1191
|
+
if (u && !s.done) {
|
|
1192
|
+
o = s.value;
|
|
1086
1193
|
r = true;
|
|
1087
1194
|
return iterate();
|
|
1088
1195
|
}
|
|
1089
|
-
return
|
|
1196
|
+
return u && s.done;
|
|
1090
1197
|
};
|
|
1091
1198
|
const s = iterate();
|
|
1092
1199
|
if (!r && !s) {
|
|
1093
|
-
|
|
1094
|
-
throw new NotReadyError(
|
|
1200
|
+
z.initTransition(resolveTransition(e));
|
|
1201
|
+
throw new NotReadyError(ne);
|
|
1095
1202
|
}
|
|
1096
1203
|
}
|
|
1097
|
-
return
|
|
1204
|
+
return o;
|
|
1098
1205
|
}
|
|
1099
1206
|
function clearStatus(e, t = false) {
|
|
1100
|
-
clearPendingSources(e);
|
|
1101
|
-
e.
|
|
1102
|
-
e.
|
|
1103
|
-
setPendingError(e);
|
|
1104
|
-
updatePendingSignal(e);
|
|
1105
|
-
e.
|
|
1207
|
+
if (e.Pe || e.xe) clearPendingSources(e);
|
|
1208
|
+
if (e.Te) e.Te = false;
|
|
1209
|
+
e.be = t ? 0 : e.be & b;
|
|
1210
|
+
if (e.we) setPendingError(e);
|
|
1211
|
+
if (e.Qe) updatePendingSignal(e);
|
|
1212
|
+
if (e.Fe) e.Fe();
|
|
1106
1213
|
}
|
|
1107
1214
|
function notifyStatus(e, t, n, r, i) {
|
|
1108
|
-
if (t ===
|
|
1215
|
+
if (t === _ && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
1109
1216
|
n = new StatusError(e, n);
|
|
1110
|
-
const s = t ===
|
|
1217
|
+
const s = t === m && n instanceof NotReadyError ? n.source : undefined;
|
|
1111
1218
|
const o = s === e;
|
|
1112
|
-
const u = t ===
|
|
1113
|
-
const
|
|
1219
|
+
const u = t === m && e.G !== undefined && !o;
|
|
1220
|
+
const l = u && hasActiveOverride(e);
|
|
1114
1221
|
if (!r) {
|
|
1115
|
-
if (t ===
|
|
1222
|
+
if (t === m && s) {
|
|
1116
1223
|
addPendingSource(e, s);
|
|
1117
|
-
e.
|
|
1224
|
+
e.be = m | (e.be & b);
|
|
1118
1225
|
setPendingError(e, s, n);
|
|
1119
1226
|
} else {
|
|
1120
1227
|
clearPendingSources(e);
|
|
1121
|
-
e.
|
|
1122
|
-
e.
|
|
1228
|
+
e.be = t | (t !== _ ? e.be & b : 0);
|
|
1229
|
+
e.we = n;
|
|
1123
1230
|
}
|
|
1124
1231
|
updatePendingSignal(e);
|
|
1125
1232
|
}
|
|
1126
1233
|
if (i && !r) {
|
|
1127
1234
|
assignOrMergeLane(e, i);
|
|
1128
1235
|
}
|
|
1129
|
-
const
|
|
1236
|
+
const f = r || l;
|
|
1130
1237
|
const c = r || u ? undefined : i;
|
|
1131
|
-
if (e.
|
|
1132
|
-
if (r && t ===
|
|
1238
|
+
if (e.Fe) {
|
|
1239
|
+
if (r && t === m) {
|
|
1133
1240
|
return;
|
|
1134
1241
|
}
|
|
1135
|
-
if (
|
|
1136
|
-
e.
|
|
1242
|
+
if (f) {
|
|
1243
|
+
e.Fe(t, n);
|
|
1137
1244
|
} else {
|
|
1138
|
-
e.
|
|
1245
|
+
e.Fe();
|
|
1139
1246
|
}
|
|
1140
1247
|
return;
|
|
1141
1248
|
}
|
|
1142
1249
|
forEachDependent(e, e => {
|
|
1143
|
-
e.
|
|
1250
|
+
e.me = F;
|
|
1144
1251
|
if (
|
|
1145
|
-
(t ===
|
|
1146
|
-
(t !==
|
|
1252
|
+
(t === m && s && e.Pe !== s && !e.xe?.has(s)) ||
|
|
1253
|
+
(t !== m && (e.we !== n || e.Pe || e.xe))
|
|
1147
1254
|
) {
|
|
1148
|
-
if (!
|
|
1149
|
-
notifyStatus(e, t, n,
|
|
1255
|
+
if (!f && !e.V) queuePendingNode(e);
|
|
1256
|
+
notifyStatus(e, t, n, f, c);
|
|
1150
1257
|
}
|
|
1151
1258
|
});
|
|
1152
1259
|
}
|
|
1153
|
-
let
|
|
1260
|
+
let J = null;
|
|
1154
1261
|
function enableExternalSource(e) {
|
|
1155
1262
|
const { factory: t, untrack: n = e => e() } = e;
|
|
1156
|
-
if (
|
|
1157
|
-
const { factory: e, untrack: r } =
|
|
1158
|
-
|
|
1263
|
+
if (J) {
|
|
1264
|
+
const { factory: e, untrack: r } = J;
|
|
1265
|
+
J = {
|
|
1159
1266
|
factory: (n, r) => {
|
|
1160
1267
|
const i = e(n, r);
|
|
1161
1268
|
const s = t(e => i.track(e), r);
|
|
@@ -1170,192 +1277,203 @@ function enableExternalSource(e) {
|
|
|
1170
1277
|
untrack: e => r(() => n(e))
|
|
1171
1278
|
};
|
|
1172
1279
|
} else {
|
|
1173
|
-
|
|
1280
|
+
J = { factory: t, untrack: n };
|
|
1174
1281
|
}
|
|
1175
1282
|
}
|
|
1176
|
-
GlobalQueue.
|
|
1177
|
-
GlobalQueue.
|
|
1178
|
-
let
|
|
1179
|
-
let
|
|
1180
|
-
let G = false;
|
|
1181
|
-
let z = false;
|
|
1182
|
-
let U = false;
|
|
1183
|
-
let J = false;
|
|
1184
|
-
let X = null;
|
|
1185
|
-
let Y = null;
|
|
1283
|
+
GlobalQueue.de = recompute;
|
|
1284
|
+
GlobalQueue.pe = disposeChildren;
|
|
1285
|
+
let X = false;
|
|
1286
|
+
let Y = false;
|
|
1186
1287
|
let Z = false;
|
|
1187
|
-
let $ =
|
|
1288
|
+
let $ = false;
|
|
1289
|
+
let ee = false;
|
|
1290
|
+
let te = false;
|
|
1291
|
+
let ne = null;
|
|
1292
|
+
let re = null;
|
|
1293
|
+
let ie = false;
|
|
1294
|
+
let se = null;
|
|
1188
1295
|
function ownerInSnapshotScope(e) {
|
|
1189
1296
|
while (e) {
|
|
1190
|
-
if (e.
|
|
1297
|
+
if (e.Me) return true;
|
|
1191
1298
|
e = e.i;
|
|
1192
1299
|
}
|
|
1193
1300
|
return false;
|
|
1194
1301
|
}
|
|
1195
1302
|
function setSnapshotCapture(e) {
|
|
1196
|
-
|
|
1197
|
-
if (e &&
|
|
1303
|
+
ie = e;
|
|
1304
|
+
if (e && !se) se = new Set();
|
|
1198
1305
|
}
|
|
1199
1306
|
function markSnapshotScope(e) {
|
|
1200
|
-
e.
|
|
1307
|
+
e.Me = true;
|
|
1201
1308
|
}
|
|
1202
1309
|
function releaseSnapshotScope(e) {
|
|
1203
|
-
e.
|
|
1310
|
+
e.Me = false;
|
|
1204
1311
|
releaseSubtree(e);
|
|
1205
1312
|
schedule();
|
|
1206
1313
|
}
|
|
1207
1314
|
function releaseSubtree(e) {
|
|
1208
|
-
let t = e.
|
|
1315
|
+
let t = e.Ce;
|
|
1209
1316
|
while (t) {
|
|
1210
|
-
if (t.
|
|
1211
|
-
t = t.
|
|
1317
|
+
if (t.Me) {
|
|
1318
|
+
t = t.Ne;
|
|
1212
1319
|
continue;
|
|
1213
1320
|
}
|
|
1214
|
-
if (t.
|
|
1321
|
+
if (t.L) {
|
|
1215
1322
|
const e = t;
|
|
1216
|
-
e.
|
|
1217
|
-
if (e.m &
|
|
1218
|
-
e.m &= ~
|
|
1323
|
+
e.ye &= ~g;
|
|
1324
|
+
if (e.m & f) {
|
|
1325
|
+
e.m &= ~f;
|
|
1219
1326
|
e.m |= n;
|
|
1220
|
-
if (
|
|
1221
|
-
insertIntoHeap(e,
|
|
1327
|
+
if (q.j > e.o) q.j = e.o;
|
|
1328
|
+
insertIntoHeap(e, q);
|
|
1222
1329
|
}
|
|
1223
1330
|
}
|
|
1224
1331
|
releaseSubtree(t);
|
|
1225
|
-
t = t.
|
|
1332
|
+
t = t.Ne;
|
|
1226
1333
|
}
|
|
1227
1334
|
}
|
|
1228
1335
|
function clearSnapshots() {
|
|
1229
|
-
if (
|
|
1230
|
-
for (const e of
|
|
1231
|
-
delete e.
|
|
1232
|
-
delete e[
|
|
1336
|
+
if (se) {
|
|
1337
|
+
for (const e of se) {
|
|
1338
|
+
delete e._e;
|
|
1339
|
+
delete e[N];
|
|
1233
1340
|
}
|
|
1234
|
-
|
|
1341
|
+
se = null;
|
|
1235
1342
|
}
|
|
1236
|
-
|
|
1343
|
+
ie = false;
|
|
1237
1344
|
}
|
|
1238
1345
|
function recompute(t, n = false) {
|
|
1239
|
-
const i = t
|
|
1346
|
+
const i = t.$;
|
|
1240
1347
|
if (!n) {
|
|
1241
|
-
if (t.
|
|
1242
|
-
deleteFromHeap(t, t.m & o ?
|
|
1243
|
-
t.
|
|
1244
|
-
if (t.
|
|
1245
|
-
else {
|
|
1348
|
+
if (t.V && (!i || M) && M !== t.V) z.initTransition(t.V);
|
|
1349
|
+
deleteFromHeap(t, t.m & o ? Q : q);
|
|
1350
|
+
t.ke = null;
|
|
1351
|
+
if (t.V || i === P) disposeChildren(t);
|
|
1352
|
+
else if (t.Ce !== null || t.Re !== null) {
|
|
1246
1353
|
markDisposal(t);
|
|
1247
|
-
t.
|
|
1248
|
-
t.
|
|
1249
|
-
t.
|
|
1250
|
-
t.
|
|
1354
|
+
t.ve = t.Re;
|
|
1355
|
+
t.Oe = t.Ce;
|
|
1356
|
+
t.Re = null;
|
|
1357
|
+
t.Ce = null;
|
|
1251
1358
|
t.je = 0;
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
let s = !!(t.m &
|
|
1255
|
-
const u = t.
|
|
1256
|
-
const c = !!(t.
|
|
1257
|
-
const a = !!(t.
|
|
1258
|
-
const d =
|
|
1259
|
-
|
|
1260
|
-
t.
|
|
1359
|
+
} else;
|
|
1360
|
+
}
|
|
1361
|
+
let s = !!(t.m & l);
|
|
1362
|
+
const u = t.G !== undefined && t.G !== x;
|
|
1363
|
+
const c = !!(t.be & m);
|
|
1364
|
+
const a = !!(t.be & b);
|
|
1365
|
+
const d = ne;
|
|
1366
|
+
ne = t;
|
|
1367
|
+
t.Ee = null;
|
|
1261
1368
|
t.m = r;
|
|
1262
|
-
t.
|
|
1263
|
-
let p = t.
|
|
1369
|
+
t.me = F;
|
|
1370
|
+
let p = t.Y === x ? t.ue : t.Y;
|
|
1264
1371
|
let h = t.o;
|
|
1265
|
-
let
|
|
1266
|
-
let
|
|
1267
|
-
|
|
1372
|
+
let g = X;
|
|
1373
|
+
let S = re;
|
|
1374
|
+
X = true;
|
|
1268
1375
|
if (s) {
|
|
1269
1376
|
const e = resolveLane(t);
|
|
1270
|
-
if (e)
|
|
1271
|
-
} else if (
|
|
1377
|
+
if (e) re = e;
|
|
1378
|
+
} else if (M && !n && M.J.length) {
|
|
1272
1379
|
for (let e = t.W; e; e = e.R) {
|
|
1273
1380
|
const n = e.A;
|
|
1274
|
-
if (n.m &
|
|
1381
|
+
if (n.m & l) {
|
|
1275
1382
|
const e = resolveLane(n);
|
|
1276
1383
|
if (e) {
|
|
1277
1384
|
s = true;
|
|
1278
|
-
|
|
1279
|
-
t.m |=
|
|
1385
|
+
re = e;
|
|
1386
|
+
t.m |= l;
|
|
1280
1387
|
assignOrMergeLane(t, e);
|
|
1281
1388
|
break;
|
|
1282
1389
|
}
|
|
1283
1390
|
}
|
|
1284
1391
|
}
|
|
1285
1392
|
}
|
|
1393
|
+
const y = i && i !== v;
|
|
1394
|
+
const O = Y;
|
|
1395
|
+
if (y) Y = true;
|
|
1286
1396
|
try {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1397
|
+
if (!false && t.ye & w) {
|
|
1398
|
+
p = t.L(p);
|
|
1399
|
+
t.ke = null;
|
|
1400
|
+
} else {
|
|
1401
|
+
const e = t.ke;
|
|
1402
|
+
const n = t.L(p);
|
|
1403
|
+
const r = typeof n === "object" && n !== null;
|
|
1404
|
+
const i = t.ke !== e;
|
|
1405
|
+
p = i || !r ? n : handleAsync(t, n);
|
|
1406
|
+
if (!i && !r) t.ke = null;
|
|
1407
|
+
}
|
|
1290
1408
|
clearStatus(t, n);
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1409
|
+
if (t.H) {
|
|
1410
|
+
const e = resolveLane(t);
|
|
1411
|
+
if (e) {
|
|
1412
|
+
e.F.delete(t);
|
|
1413
|
+
updatePendingSignal(e.q);
|
|
1414
|
+
}
|
|
1295
1415
|
}
|
|
1296
1416
|
} catch (e) {
|
|
1297
|
-
if (e instanceof NotReadyError &&
|
|
1298
|
-
const e = findLane(
|
|
1299
|
-
if (e.
|
|
1300
|
-
e.
|
|
1301
|
-
t.
|
|
1302
|
-
updatePendingSignal(e.
|
|
1417
|
+
if (e instanceof NotReadyError && re) {
|
|
1418
|
+
const e = findLane(re);
|
|
1419
|
+
if (e.q !== t) {
|
|
1420
|
+
e.F.add(t);
|
|
1421
|
+
t.H = e;
|
|
1422
|
+
updatePendingSignal(e.q);
|
|
1303
1423
|
}
|
|
1304
1424
|
}
|
|
1305
|
-
if (e instanceof NotReadyError) t.
|
|
1425
|
+
if (e instanceof NotReadyError) t.Te = true;
|
|
1306
1426
|
notifyStatus(
|
|
1307
1427
|
t,
|
|
1308
|
-
e instanceof NotReadyError ?
|
|
1428
|
+
e instanceof NotReadyError ? m : _,
|
|
1309
1429
|
e,
|
|
1310
1430
|
undefined,
|
|
1311
|
-
e instanceof NotReadyError ? t.
|
|
1431
|
+
e instanceof NotReadyError ? t.H : undefined
|
|
1312
1432
|
);
|
|
1313
1433
|
} finally {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
if (
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
const e = u ? t.H : undefined;
|
|
1332
|
-
if (n || (i && L !== t.X) || s) {
|
|
1333
|
-
t.ne = p;
|
|
1434
|
+
X = g;
|
|
1435
|
+
if (y) Y = O;
|
|
1436
|
+
t.m = e | (n ? t.m & f : 0);
|
|
1437
|
+
ne = d;
|
|
1438
|
+
}
|
|
1439
|
+
if (!t.we) {
|
|
1440
|
+
trimStaleDeps(t);
|
|
1441
|
+
const e = u ? t.G : t.Y === x ? t.ue : t.Y;
|
|
1442
|
+
const r = (!i && a) || !t.He || !t.He(e, p);
|
|
1443
|
+
if (i && r) {
|
|
1444
|
+
t.ee = !t.we;
|
|
1445
|
+
if (!n) t.te.enqueue(i, GlobalQueue.he.bind(null, t));
|
|
1446
|
+
}
|
|
1447
|
+
if (r) {
|
|
1448
|
+
const e = u ? t.G : undefined;
|
|
1449
|
+
if (n || (i && M !== t.V) || s) {
|
|
1450
|
+
t.ue = p;
|
|
1334
1451
|
if (u && s) {
|
|
1335
|
-
t.
|
|
1336
|
-
t.
|
|
1452
|
+
t.G = p;
|
|
1453
|
+
t.Y = p;
|
|
1337
1454
|
}
|
|
1338
|
-
} else t.
|
|
1339
|
-
if (u && !s && c && !t.
|
|
1340
|
-
if (!u || s || t.
|
|
1455
|
+
} else t.Y = p;
|
|
1456
|
+
if (u && !s && c && !t.B) t.G = p;
|
|
1457
|
+
if (!u || s || t.G !== e) insertSubs(t, s || u);
|
|
1341
1458
|
} else if (u) {
|
|
1342
|
-
t.
|
|
1459
|
+
t.Y = p;
|
|
1343
1460
|
} else if (t.o != h) {
|
|
1344
1461
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1345
|
-
insertIntoHeapHeight(e.
|
|
1462
|
+
insertIntoHeapHeight(e.C, e.C.m & o ? Q : q);
|
|
1346
1463
|
}
|
|
1347
1464
|
}
|
|
1348
1465
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
t.
|
|
1466
|
+
re = S;
|
|
1467
|
+
const C = t.Y !== x || t.Oe !== null || t.ve !== null || !!(t.be & (m | b));
|
|
1468
|
+
C && (!n || t.be & m) && !t.V && !(M && u) && queuePendingNode(t);
|
|
1469
|
+
t.V && i && M !== t.V && runInTransition(t.V, () => recompute(t));
|
|
1352
1470
|
}
|
|
1353
1471
|
function updateIfNecessary(e) {
|
|
1354
1472
|
if (e.m & t) {
|
|
1355
1473
|
for (let t = e.W; t; t = t.R) {
|
|
1356
1474
|
const r = t.A;
|
|
1357
|
-
const i = r.
|
|
1358
|
-
if (i.
|
|
1475
|
+
const i = r.I || r;
|
|
1476
|
+
if (i.L) {
|
|
1359
1477
|
updateIfNecessary(i);
|
|
1360
1478
|
}
|
|
1361
1479
|
if (e.m & n) {
|
|
@@ -1363,175 +1481,230 @@ function updateIfNecessary(e) {
|
|
|
1363
1481
|
}
|
|
1364
1482
|
}
|
|
1365
1483
|
}
|
|
1366
|
-
if (e.m & (n |
|
|
1484
|
+
if (e.m & (n | l) || (e.we && e.me < F && !e.ke)) {
|
|
1367
1485
|
recompute(e);
|
|
1368
1486
|
}
|
|
1369
|
-
e.m = e.m & (
|
|
1487
|
+
e.m = e.m & (f | i | s);
|
|
1370
1488
|
}
|
|
1371
1489
|
function computed(t, n) {
|
|
1372
1490
|
const r = n?.transparent ?? false;
|
|
1373
1491
|
const i = {
|
|
1374
|
-
id: n?.id ?? (r ?
|
|
1375
|
-
|
|
1376
|
-
(r ?
|
|
1377
|
-
(n?.ownedWrite ?
|
|
1378
|
-
(!
|
|
1379
|
-
(
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1492
|
+
id: n?.id ?? (r ? ne?.id : ne?.id != null ? getNextChildId(ne) : undefined),
|
|
1493
|
+
ye:
|
|
1494
|
+
(r ? h : 0) |
|
|
1495
|
+
(n?.ownedWrite ? d : 0) |
|
|
1496
|
+
(!ne || n?.lazy ? y : 0) |
|
|
1497
|
+
(n?.sync ? w : 0) |
|
|
1498
|
+
(ie && ownerInSnapshotScope(ne) ? g : 0),
|
|
1499
|
+
He: n?.equals != null ? n.equals : isEqual,
|
|
1500
|
+
Z: n?.unobserved,
|
|
1501
|
+
Re: null,
|
|
1502
|
+
te: ne?.te ?? z,
|
|
1503
|
+
Ae: ne?.Ae ?? k,
|
|
1385
1504
|
je: 0,
|
|
1386
|
-
|
|
1387
|
-
|
|
1505
|
+
L: t,
|
|
1506
|
+
ue: undefined,
|
|
1388
1507
|
o: 0,
|
|
1389
|
-
|
|
1508
|
+
N: null,
|
|
1390
1509
|
h: undefined,
|
|
1391
1510
|
p: null,
|
|
1392
1511
|
W: null,
|
|
1393
|
-
|
|
1512
|
+
Ee: null,
|
|
1394
1513
|
O: null,
|
|
1514
|
+
Le: null,
|
|
1515
|
+
i: ne,
|
|
1516
|
+
Ne: null,
|
|
1517
|
+
We: null,
|
|
1518
|
+
Ce: null,
|
|
1519
|
+
m: n?.lazy ? c : e,
|
|
1520
|
+
be: b,
|
|
1521
|
+
me: F,
|
|
1522
|
+
Y: x,
|
|
1395
1523
|
ve: null,
|
|
1396
|
-
|
|
1524
|
+
Oe: null,
|
|
1397
1525
|
ke: null,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1526
|
+
V: null
|
|
1527
|
+
};
|
|
1528
|
+
setupComputedNode(i, n);
|
|
1529
|
+
return i;
|
|
1530
|
+
}
|
|
1531
|
+
function createEffectNode(e, t, n, r, i, s) {
|
|
1532
|
+
const o = s?.transparent ?? false;
|
|
1533
|
+
const u = {
|
|
1534
|
+
id: s?.id ?? (o ? ne?.id : ne?.id != null ? getNextChildId(ne) : undefined),
|
|
1535
|
+
ye:
|
|
1536
|
+
(o ? h : 0) |
|
|
1537
|
+
(s?.ownedWrite ? d : 0) |
|
|
1538
|
+
(s?.sync ? w : 0) |
|
|
1539
|
+
(ie && ownerInSnapshotScope(ne) ? g : 0),
|
|
1540
|
+
He: false,
|
|
1541
|
+
Z: s?.unobserved,
|
|
1542
|
+
Re: null,
|
|
1543
|
+
te: ne?.te ?? z,
|
|
1544
|
+
Ae: ne?.Ae ?? k,
|
|
1545
|
+
je: 0,
|
|
1546
|
+
L: e,
|
|
1547
|
+
ue: undefined,
|
|
1548
|
+
o: 0,
|
|
1549
|
+
N: null,
|
|
1550
|
+
h: undefined,
|
|
1551
|
+
p: null,
|
|
1552
|
+
W: null,
|
|
1404
1553
|
Ee: null,
|
|
1554
|
+
O: null,
|
|
1555
|
+
Le: null,
|
|
1556
|
+
i: ne,
|
|
1557
|
+
Ne: null,
|
|
1558
|
+
We: null,
|
|
1405
1559
|
Ce: null,
|
|
1406
|
-
|
|
1560
|
+
m: c,
|
|
1561
|
+
be: b,
|
|
1562
|
+
me: F,
|
|
1563
|
+
Y: x,
|
|
1564
|
+
ve: null,
|
|
1565
|
+
Oe: null,
|
|
1566
|
+
ke: null,
|
|
1567
|
+
V: null,
|
|
1568
|
+
ee: false,
|
|
1569
|
+
De: undefined,
|
|
1570
|
+
Ve: t,
|
|
1571
|
+
Ke: n,
|
|
1572
|
+
Be: undefined,
|
|
1573
|
+
Ge: false,
|
|
1574
|
+
$: r,
|
|
1575
|
+
Fe: i
|
|
1407
1576
|
};
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1577
|
+
setupComputedNode(u, oe);
|
|
1578
|
+
return u;
|
|
1579
|
+
}
|
|
1580
|
+
const oe = { lazy: true };
|
|
1581
|
+
function setupComputedNode(e, t) {
|
|
1582
|
+
e.p = e;
|
|
1583
|
+
const n = ne?.t ? ne.u : ne;
|
|
1584
|
+
if (ne) {
|
|
1585
|
+
const t = ne.Ce;
|
|
1586
|
+
if (t === null) {
|
|
1587
|
+
ne.Ce = e;
|
|
1414
1588
|
} else {
|
|
1415
|
-
|
|
1416
|
-
|
|
1589
|
+
e.Ne = t;
|
|
1590
|
+
t.We = e;
|
|
1591
|
+
ne.Ce = e;
|
|
1417
1592
|
}
|
|
1418
1593
|
}
|
|
1419
|
-
if (
|
|
1420
|
-
if (
|
|
1421
|
-
const
|
|
1422
|
-
const
|
|
1423
|
-
setSignal(
|
|
1594
|
+
if (n) e.o = n.o + 1;
|
|
1595
|
+
if (J) {
|
|
1596
|
+
const t = signal(undefined, { equals: false, ownedWrite: true });
|
|
1597
|
+
const n = J.factory(e.L, () => {
|
|
1598
|
+
setSignal(t, undefined);
|
|
1424
1599
|
});
|
|
1425
|
-
cleanup(() =>
|
|
1426
|
-
|
|
1427
|
-
read(
|
|
1428
|
-
return
|
|
1600
|
+
cleanup(() => n.dispose());
|
|
1601
|
+
e.L = e => {
|
|
1602
|
+
read(t);
|
|
1603
|
+
return n.track(e);
|
|
1429
1604
|
};
|
|
1430
1605
|
}
|
|
1431
|
-
!
|
|
1432
|
-
if (
|
|
1433
|
-
if (!(
|
|
1434
|
-
|
|
1435
|
-
|
|
1606
|
+
!t?.lazy && recompute(e, true);
|
|
1607
|
+
if (ie && !t?.lazy) {
|
|
1608
|
+
if (!(e.be & m)) {
|
|
1609
|
+
e._e = e.ue === undefined ? C : e.ue;
|
|
1610
|
+
se.add(e);
|
|
1436
1611
|
}
|
|
1437
1612
|
}
|
|
1438
|
-
return i;
|
|
1439
1613
|
}
|
|
1440
1614
|
function signal(e, t, n = null) {
|
|
1441
1615
|
const r = {
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1616
|
+
He: t?.equals != null ? t.equals : isEqual,
|
|
1617
|
+
ye: (t?.ownedWrite ? d : 0) | (t?.ze ? p : 0),
|
|
1618
|
+
Z: t?.unobserved,
|
|
1619
|
+
ue: e,
|
|
1446
1620
|
O: null,
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1621
|
+
Le: null,
|
|
1622
|
+
me: F,
|
|
1623
|
+
I: n,
|
|
1624
|
+
k: n?.N || null,
|
|
1625
|
+
Y: x
|
|
1452
1626
|
};
|
|
1453
|
-
n && (n.
|
|
1454
|
-
if (
|
|
1455
|
-
r.
|
|
1456
|
-
|
|
1627
|
+
n && (n.N = r);
|
|
1628
|
+
if (ie && !(r.ye & p) && !((n?.be ?? 0) & m)) {
|
|
1629
|
+
r._e = e === undefined ? C : e;
|
|
1630
|
+
se.add(r);
|
|
1457
1631
|
}
|
|
1458
1632
|
return r;
|
|
1459
1633
|
}
|
|
1460
1634
|
function optimisticSignal(e, t) {
|
|
1461
1635
|
const n = signal(e, t);
|
|
1462
|
-
n.
|
|
1636
|
+
n.G = x;
|
|
1463
1637
|
return n;
|
|
1464
1638
|
}
|
|
1465
1639
|
function optimisticComputed(e, t) {
|
|
1466
1640
|
const n = computed(e, t);
|
|
1467
|
-
n.
|
|
1641
|
+
n.G = x;
|
|
1468
1642
|
return n;
|
|
1469
1643
|
}
|
|
1470
1644
|
function isEqual(e, t) {
|
|
1471
1645
|
return e === t;
|
|
1472
1646
|
}
|
|
1473
1647
|
function untrack(e, t) {
|
|
1474
|
-
if (!
|
|
1475
|
-
const n =
|
|
1476
|
-
|
|
1648
|
+
if (!J && !X && true) return e();
|
|
1649
|
+
const n = X;
|
|
1650
|
+
X = false;
|
|
1477
1651
|
try {
|
|
1478
|
-
if (
|
|
1652
|
+
if (J) return J.untrack(e);
|
|
1479
1653
|
return e();
|
|
1480
1654
|
} finally {
|
|
1481
|
-
|
|
1655
|
+
X = n;
|
|
1482
1656
|
}
|
|
1483
1657
|
}
|
|
1484
1658
|
function read(e) {
|
|
1485
|
-
if (
|
|
1659
|
+
if (te) {
|
|
1486
1660
|
const t = getLatestValueComputed(e);
|
|
1487
|
-
const n =
|
|
1488
|
-
|
|
1489
|
-
const r = e.
|
|
1661
|
+
const n = te;
|
|
1662
|
+
te = false;
|
|
1663
|
+
const r = e.G !== undefined && e.G !== x ? e.G : e.ue;
|
|
1490
1664
|
let i;
|
|
1491
1665
|
try {
|
|
1492
1666
|
i = read(t);
|
|
1493
1667
|
} catch (e) {
|
|
1494
|
-
if (!
|
|
1668
|
+
if (!ne && e instanceof NotReadyError) return r;
|
|
1495
1669
|
throw e;
|
|
1496
1670
|
} finally {
|
|
1497
|
-
|
|
1671
|
+
te = n;
|
|
1498
1672
|
}
|
|
1499
|
-
if (t.
|
|
1500
|
-
if (
|
|
1501
|
-
const e = findLane(t.
|
|
1502
|
-
const n = findLane(
|
|
1503
|
-
if (e !== n && e.
|
|
1673
|
+
if (t.be & m) return r;
|
|
1674
|
+
if (Y && re && t.H) {
|
|
1675
|
+
const e = findLane(t.H);
|
|
1676
|
+
const n = findLane(re);
|
|
1677
|
+
if (e !== n && e.F.size > 0) {
|
|
1504
1678
|
return r;
|
|
1505
1679
|
}
|
|
1506
1680
|
}
|
|
1507
1681
|
return i;
|
|
1508
1682
|
}
|
|
1509
|
-
if (
|
|
1510
|
-
const t = e.
|
|
1511
|
-
const n =
|
|
1512
|
-
|
|
1513
|
-
if (t && e.
|
|
1514
|
-
if (e.
|
|
1515
|
-
|
|
1516
|
-
}
|
|
1517
|
-
let n =
|
|
1683
|
+
if ($) {
|
|
1684
|
+
const t = e.I;
|
|
1685
|
+
const n = $;
|
|
1686
|
+
$ = false;
|
|
1687
|
+
if (t && e.G !== undefined) {
|
|
1688
|
+
if (e.G !== x && (t.ke || !!(t.be & m))) {
|
|
1689
|
+
ee = true;
|
|
1690
|
+
}
|
|
1691
|
+
let n = ne;
|
|
1518
1692
|
if (n?.t) n = n.u;
|
|
1519
|
-
if (n &&
|
|
1693
|
+
if (n && X) link(e, n);
|
|
1520
1694
|
read(getPendingSignal(e));
|
|
1521
1695
|
read(getPendingSignal(t));
|
|
1522
1696
|
} else {
|
|
1523
|
-
if (read(getPendingSignal(e)))
|
|
1524
|
-
if (t && read(getPendingSignal(t)))
|
|
1697
|
+
if (read(getPendingSignal(e))) ee = true;
|
|
1698
|
+
if (t && read(getPendingSignal(t))) ee = true;
|
|
1525
1699
|
}
|
|
1526
|
-
|
|
1527
|
-
return e.
|
|
1700
|
+
$ = n;
|
|
1701
|
+
return e.ue;
|
|
1528
1702
|
}
|
|
1529
|
-
let t =
|
|
1703
|
+
let t = ne;
|
|
1530
1704
|
if (t?.t) t = t.u;
|
|
1531
1705
|
const n = e;
|
|
1532
|
-
if (typeof n.
|
|
1706
|
+
if (typeof n.L === "function") {
|
|
1533
1707
|
const t = e;
|
|
1534
|
-
if (G && !(t.m & u)) recompute(t);
|
|
1535
1708
|
if (t.m & c) {
|
|
1536
1709
|
t.m &= ~c;
|
|
1537
1710
|
recompute(t, true);
|
|
@@ -1539,14 +1712,27 @@ function read(e) {
|
|
|
1539
1712
|
recompute(t, true);
|
|
1540
1713
|
}
|
|
1541
1714
|
}
|
|
1542
|
-
const r = e.
|
|
1543
|
-
if (
|
|
1715
|
+
const r = e.I || e;
|
|
1716
|
+
if (
|
|
1717
|
+
!n.L &&
|
|
1718
|
+
r === e &&
|
|
1719
|
+
e.G === undefined &&
|
|
1720
|
+
e._e === undefined &&
|
|
1721
|
+
M === null &&
|
|
1722
|
+
re === null &&
|
|
1723
|
+
!ie &&
|
|
1724
|
+
true
|
|
1725
|
+
) {
|
|
1726
|
+
if (t && X) link(e, t);
|
|
1727
|
+
return !t || e.Y === x ? e.ue : e.Y;
|
|
1728
|
+
}
|
|
1729
|
+
if (t && X) {
|
|
1544
1730
|
link(e, t);
|
|
1545
|
-
if (r.
|
|
1731
|
+
if (r.L) {
|
|
1546
1732
|
const n = e.m & o;
|
|
1547
|
-
if (r.o >= (n ?
|
|
1733
|
+
if (r.o >= (n ? Q.j : q.j)) {
|
|
1548
1734
|
markNode(t);
|
|
1549
|
-
markHeap(n ?
|
|
1735
|
+
markHeap(n ? Q : q);
|
|
1550
1736
|
updateIfNecessary(r);
|
|
1551
1737
|
}
|
|
1552
1738
|
const i = r.o;
|
|
@@ -1555,226 +1741,236 @@ function read(e) {
|
|
|
1555
1741
|
}
|
|
1556
1742
|
}
|
|
1557
1743
|
}
|
|
1558
|
-
if (r.
|
|
1559
|
-
if (t && !(
|
|
1560
|
-
if (
|
|
1561
|
-
const n = r.
|
|
1562
|
-
const i = findLane(
|
|
1744
|
+
if (r.be & m) {
|
|
1745
|
+
if (t && !(Y && r.V && M !== r.V)) {
|
|
1746
|
+
if (re) {
|
|
1747
|
+
const n = r.H;
|
|
1748
|
+
const i = findLane(re);
|
|
1563
1749
|
if (n && findLane(n) === i && !hasActiveOverride(r)) {
|
|
1564
|
-
if (!
|
|
1565
|
-
throw r.
|
|
1750
|
+
if (!X && e !== t) link(e, t);
|
|
1751
|
+
throw r.we;
|
|
1566
1752
|
}
|
|
1567
1753
|
} else {
|
|
1568
|
-
if (!
|
|
1569
|
-
throw r.
|
|
1754
|
+
if (!X && e !== t) link(e, t);
|
|
1755
|
+
throw r.we;
|
|
1570
1756
|
}
|
|
1571
|
-
} else if (t && r !== e && r.
|
|
1572
|
-
if (!
|
|
1573
|
-
throw r.
|
|
1574
|
-
} else if (!t && r.
|
|
1575
|
-
throw r.
|
|
1757
|
+
} else if (t && r !== e && r.be & b) {
|
|
1758
|
+
if (!X && e !== t) link(e, t);
|
|
1759
|
+
throw r.we;
|
|
1760
|
+
} else if (!t && r.be & b) {
|
|
1761
|
+
throw r.we;
|
|
1576
1762
|
}
|
|
1577
1763
|
}
|
|
1578
|
-
if (e.
|
|
1579
|
-
if (e.
|
|
1764
|
+
if (e.L && e.be & _) {
|
|
1765
|
+
if (e.me < F) {
|
|
1580
1766
|
recompute(e);
|
|
1581
1767
|
return read(e);
|
|
1582
|
-
} else throw e.
|
|
1768
|
+
} else throw e.we;
|
|
1583
1769
|
}
|
|
1584
|
-
if (
|
|
1585
|
-
const n = e.
|
|
1770
|
+
if (ie && t && t.ye & g) {
|
|
1771
|
+
const n = e._e;
|
|
1586
1772
|
if (n !== undefined) {
|
|
1587
|
-
const r = n ===
|
|
1588
|
-
const i = e.
|
|
1589
|
-
if (i !== r) t.m |=
|
|
1773
|
+
const r = n === C ? undefined : n;
|
|
1774
|
+
const i = e.Y !== x ? e.Y : e.ue;
|
|
1775
|
+
if (i !== r) t.m |= f;
|
|
1590
1776
|
return r;
|
|
1591
1777
|
}
|
|
1592
1778
|
}
|
|
1593
|
-
if (e.
|
|
1594
|
-
if (t &&
|
|
1595
|
-
return e.
|
|
1779
|
+
if (e.G !== undefined && e.G !== x) {
|
|
1780
|
+
if (t && Y && shouldReadStashedOptimisticValue(e)) return e.ue;
|
|
1781
|
+
return e.G;
|
|
1596
1782
|
}
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1599
|
-
return e.
|
|
1783
|
+
if (M !== null && re !== null && !te && e.Y !== x && r === e && !e.L && t) {
|
|
1784
|
+
M.oe.add(t);
|
|
1785
|
+
return e.ue;
|
|
1600
1786
|
}
|
|
1601
1787
|
const i =
|
|
1602
1788
|
!t ||
|
|
1603
|
-
(
|
|
1604
|
-
e.
|
|
1605
|
-
(
|
|
1606
|
-
? e.
|
|
1607
|
-
: e.
|
|
1608
|
-
if (!t && r === e && typeof n.
|
|
1789
|
+
(re !== null && (e.G !== undefined || e.H || (r === e && Y) || !!(r.be & m))) ||
|
|
1790
|
+
e.Y === x ||
|
|
1791
|
+
(Y && e.V && M !== e.V)
|
|
1792
|
+
? e.ue
|
|
1793
|
+
: e.Y;
|
|
1794
|
+
if (!t && r === e && typeof n.L === "function" && e.ye & y && !(r.be & m) && !e.O) {
|
|
1609
1795
|
unobserved(e);
|
|
1610
1796
|
}
|
|
1611
1797
|
return i;
|
|
1612
1798
|
}
|
|
1613
1799
|
function setSignal(e, t) {
|
|
1614
|
-
if (e.
|
|
1615
|
-
const n = e.
|
|
1616
|
-
const r = e.
|
|
1617
|
-
const i = n ? (r ? e.
|
|
1800
|
+
if (e.V && M !== e.V) z.initTransition(e.V);
|
|
1801
|
+
const n = e.G !== undefined && !K;
|
|
1802
|
+
const r = e.G !== undefined && e.G !== x;
|
|
1803
|
+
const i = n ? (r ? e.G : e.ue) : e.Y === x ? e.ue : e.Y;
|
|
1618
1804
|
if (typeof t === "function") t = t(i);
|
|
1619
|
-
const s = !e.
|
|
1805
|
+
const s = !e.He || !e.He(i, t) || !!(e.be & b);
|
|
1620
1806
|
if (!s) {
|
|
1621
|
-
if (n && r && e.
|
|
1807
|
+
if (n && r && e.L) {
|
|
1622
1808
|
insertSubs(e, true);
|
|
1623
1809
|
schedule();
|
|
1624
1810
|
}
|
|
1625
1811
|
return t;
|
|
1626
1812
|
}
|
|
1627
1813
|
if (n) {
|
|
1628
|
-
const n = e.
|
|
1629
|
-
if (!n)
|
|
1814
|
+
const n = e.G === x;
|
|
1815
|
+
if (!n) z.initTransition(resolveTransition(e));
|
|
1630
1816
|
if (n) {
|
|
1631
|
-
e.
|
|
1632
|
-
|
|
1817
|
+
e.Y = e.ue;
|
|
1818
|
+
z.J.push(e);
|
|
1633
1819
|
}
|
|
1634
|
-
e.
|
|
1820
|
+
e.B = true;
|
|
1635
1821
|
const r = getOrCreateLane(e);
|
|
1636
|
-
e.
|
|
1637
|
-
e.
|
|
1822
|
+
e.H = r;
|
|
1823
|
+
e.G = t;
|
|
1638
1824
|
} else {
|
|
1639
|
-
if (e.
|
|
1640
|
-
e.
|
|
1825
|
+
if (e.Y === x) queuePendingNode(e);
|
|
1826
|
+
e.Y = t;
|
|
1641
1827
|
}
|
|
1642
|
-
updatePendingSignal(e);
|
|
1643
|
-
if (e.
|
|
1644
|
-
setSignal(e.
|
|
1828
|
+
if (e.Qe) updatePendingSignal(e);
|
|
1829
|
+
if (e.qe) {
|
|
1830
|
+
setSignal(e.qe, t);
|
|
1645
1831
|
}
|
|
1646
|
-
e.
|
|
1832
|
+
e.me = F;
|
|
1647
1833
|
insertSubs(e, n);
|
|
1648
1834
|
schedule();
|
|
1649
1835
|
return t;
|
|
1650
1836
|
}
|
|
1837
|
+
function suppressComputedRecompute(e) {
|
|
1838
|
+
deleteFromHeap(e, e.m & o ? Q : q);
|
|
1839
|
+
if (!(e.m & a) && e.Y === x) queuePendingNode(e);
|
|
1840
|
+
e.m = (e.m & -4) | a;
|
|
1841
|
+
}
|
|
1842
|
+
function setMemo(e, t) {
|
|
1843
|
+
const n = setSignal(e, t);
|
|
1844
|
+
suppressComputedRecompute(e);
|
|
1845
|
+
return n;
|
|
1846
|
+
}
|
|
1651
1847
|
function runWithOwner(e, t) {
|
|
1652
|
-
const n =
|
|
1653
|
-
const r =
|
|
1654
|
-
|
|
1655
|
-
|
|
1848
|
+
const n = ne;
|
|
1849
|
+
const r = X;
|
|
1850
|
+
ne = e;
|
|
1851
|
+
X = false;
|
|
1656
1852
|
try {
|
|
1657
1853
|
return t();
|
|
1658
1854
|
} finally {
|
|
1659
|
-
|
|
1660
|
-
|
|
1855
|
+
ne = n;
|
|
1856
|
+
X = r;
|
|
1661
1857
|
}
|
|
1662
1858
|
}
|
|
1663
1859
|
function getPendingSignal(e) {
|
|
1664
|
-
if (!e.
|
|
1665
|
-
e.
|
|
1666
|
-
if (e.
|
|
1667
|
-
e.
|
|
1860
|
+
if (!e.Qe) {
|
|
1861
|
+
e.Qe = optimisticSignal(false, { ownedWrite: true });
|
|
1862
|
+
if (e.T) {
|
|
1863
|
+
e.Qe.T = e;
|
|
1668
1864
|
}
|
|
1669
|
-
if (computePendingState(e)) setSignal(e.
|
|
1865
|
+
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
1670
1866
|
}
|
|
1671
|
-
return e.
|
|
1867
|
+
return e.Qe;
|
|
1672
1868
|
}
|
|
1673
1869
|
function computePendingState(e) {
|
|
1674
1870
|
const t = e;
|
|
1675
|
-
const n = e.
|
|
1676
|
-
if (n && e.
|
|
1677
|
-
return !n.
|
|
1871
|
+
const n = e.I;
|
|
1872
|
+
if (n && e.Y !== x) {
|
|
1873
|
+
return !n.ke && !(n.be & m);
|
|
1678
1874
|
}
|
|
1679
|
-
if (e.
|
|
1680
|
-
if (t.
|
|
1681
|
-
if (e.
|
|
1682
|
-
const t = e.
|
|
1683
|
-
return !!(t && t.
|
|
1875
|
+
if (e.G !== undefined && e.G !== x) {
|
|
1876
|
+
if (t.be & m && !(t.be & b)) return true;
|
|
1877
|
+
if (e.T) {
|
|
1878
|
+
const t = e.H ? findLane(e.H) : null;
|
|
1879
|
+
return !!(t && t.F.size > 0);
|
|
1684
1880
|
}
|
|
1685
1881
|
return true;
|
|
1686
1882
|
}
|
|
1687
|
-
if (e.
|
|
1883
|
+
if (e.G !== undefined && e.G === x && !e.T) {
|
|
1688
1884
|
return false;
|
|
1689
1885
|
}
|
|
1690
|
-
if (e.
|
|
1691
|
-
return !!(t.
|
|
1886
|
+
if (e.Y !== x && !(t.be & b)) return true;
|
|
1887
|
+
return !!(t.be & m && !(t.be & b));
|
|
1692
1888
|
}
|
|
1693
1889
|
function updatePendingSignal(e) {
|
|
1694
|
-
if (e.
|
|
1890
|
+
if (e.Qe) {
|
|
1695
1891
|
const t = computePendingState(e);
|
|
1696
|
-
const n = e.
|
|
1892
|
+
const n = e.Qe;
|
|
1697
1893
|
setSignal(n, t);
|
|
1698
|
-
if (!t && n.
|
|
1894
|
+
if (!t && n.H) {
|
|
1699
1895
|
const t = resolveLane(e);
|
|
1700
|
-
if (t && t.
|
|
1701
|
-
const e = findLane(n.
|
|
1896
|
+
if (t && t.F.size > 0) {
|
|
1897
|
+
const e = findLane(n.H);
|
|
1702
1898
|
if (e !== t) {
|
|
1703
1899
|
mergeLanes(t, e);
|
|
1704
1900
|
}
|
|
1705
1901
|
}
|
|
1706
|
-
|
|
1707
|
-
n.
|
|
1902
|
+
L.delete(n);
|
|
1903
|
+
n.H = undefined;
|
|
1708
1904
|
}
|
|
1709
1905
|
}
|
|
1710
1906
|
}
|
|
1711
1907
|
function getLatestValueComputed(e) {
|
|
1712
|
-
if (!e.
|
|
1713
|
-
const t =
|
|
1714
|
-
|
|
1715
|
-
const n =
|
|
1716
|
-
|
|
1717
|
-
const r =
|
|
1718
|
-
|
|
1719
|
-
e.
|
|
1720
|
-
e.
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1908
|
+
if (!e.qe) {
|
|
1909
|
+
const t = te;
|
|
1910
|
+
te = false;
|
|
1911
|
+
const n = $;
|
|
1912
|
+
$ = false;
|
|
1913
|
+
const r = ne;
|
|
1914
|
+
ne = null;
|
|
1915
|
+
e.qe = optimisticComputed(() => read(e));
|
|
1916
|
+
e.qe.T = e;
|
|
1917
|
+
ne = r;
|
|
1918
|
+
$ = n;
|
|
1919
|
+
te = t;
|
|
1724
1920
|
}
|
|
1725
|
-
return e.
|
|
1921
|
+
return e.qe;
|
|
1726
1922
|
}
|
|
1727
1923
|
function staleValues(e, t = true) {
|
|
1728
|
-
const n =
|
|
1729
|
-
|
|
1924
|
+
const n = Y;
|
|
1925
|
+
Y = t;
|
|
1730
1926
|
try {
|
|
1731
1927
|
return e();
|
|
1732
1928
|
} finally {
|
|
1733
|
-
|
|
1929
|
+
Y = n;
|
|
1734
1930
|
}
|
|
1735
1931
|
}
|
|
1736
1932
|
function latest(e) {
|
|
1737
|
-
const t =
|
|
1738
|
-
|
|
1933
|
+
const t = te;
|
|
1934
|
+
te = true;
|
|
1739
1935
|
try {
|
|
1740
1936
|
return e();
|
|
1741
1937
|
} finally {
|
|
1742
|
-
|
|
1938
|
+
te = t;
|
|
1743
1939
|
}
|
|
1744
1940
|
}
|
|
1745
1941
|
function isPending(e) {
|
|
1746
|
-
const t =
|
|
1747
|
-
const n =
|
|
1748
|
-
|
|
1749
|
-
|
|
1942
|
+
const t = $;
|
|
1943
|
+
const n = ee;
|
|
1944
|
+
$ = true;
|
|
1945
|
+
ee = false;
|
|
1750
1946
|
try {
|
|
1751
1947
|
e();
|
|
1752
|
-
return
|
|
1948
|
+
return ee;
|
|
1753
1949
|
} catch {
|
|
1754
|
-
return
|
|
1950
|
+
return ee;
|
|
1755
1951
|
} finally {
|
|
1756
|
-
|
|
1757
|
-
|
|
1952
|
+
$ = t;
|
|
1953
|
+
ee = n;
|
|
1758
1954
|
}
|
|
1759
1955
|
}
|
|
1760
1956
|
function refresh(e) {
|
|
1761
|
-
let t =
|
|
1762
|
-
|
|
1957
|
+
let t = Z;
|
|
1958
|
+
Z = true;
|
|
1763
1959
|
try {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1960
|
+
const t = e?.[j];
|
|
1961
|
+
if (false && !t);
|
|
1962
|
+
if (t && typeof t.L === "function" && !(t.m & u)) {
|
|
1963
|
+
recompute(t);
|
|
1767
1964
|
}
|
|
1768
|
-
return untrack(e);
|
|
1769
1965
|
} finally {
|
|
1770
|
-
|
|
1966
|
+
Z = t;
|
|
1771
1967
|
if (!t) {
|
|
1772
1968
|
schedule();
|
|
1773
1969
|
}
|
|
1774
1970
|
}
|
|
1775
1971
|
}
|
|
1776
1972
|
function isRefreshing() {
|
|
1777
|
-
return
|
|
1973
|
+
return Z;
|
|
1778
1974
|
}
|
|
1779
1975
|
function createContext(e, t) {
|
|
1780
1976
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1783,7 +1979,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1783
1979
|
if (!t) {
|
|
1784
1980
|
throw new NoOwnerError();
|
|
1785
1981
|
}
|
|
1786
|
-
const n = hasContext(e, t) ? t.
|
|
1982
|
+
const n = hasContext(e, t) ? t.Ae[e.id] : e.defaultValue;
|
|
1787
1983
|
if (isUndefined(n)) {
|
|
1788
1984
|
throw new ContextNotFoundError();
|
|
1789
1985
|
}
|
|
@@ -1793,113 +1989,102 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1793
1989
|
if (!n) {
|
|
1794
1990
|
throw new NoOwnerError();
|
|
1795
1991
|
}
|
|
1796
|
-
n.
|
|
1992
|
+
n.Ae = { ...n.Ae, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1797
1993
|
}
|
|
1798
1994
|
function hasContext(e, t) {
|
|
1799
|
-
return !isUndefined(t?.
|
|
1995
|
+
return !isUndefined(t?.Ae[e.id]);
|
|
1800
1996
|
}
|
|
1801
1997
|
function isUndefined(e) {
|
|
1802
1998
|
return typeof e === "undefined";
|
|
1803
1999
|
}
|
|
1804
2000
|
function effect(e, t, n, r) {
|
|
1805
|
-
|
|
1806
|
-
const s =
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
o.K.notify(o, S, 0);
|
|
1828
|
-
if (o.F === _) {
|
|
1829
|
-
try {
|
|
1830
|
-
return o.De
|
|
1831
|
-
? o.De(e, () => {
|
|
1832
|
-
o.Fe?.();
|
|
1833
|
-
o.Fe = undefined;
|
|
1834
|
-
})
|
|
1835
|
-
: console.error(e);
|
|
1836
|
-
} catch (t) {
|
|
1837
|
-
e = t;
|
|
1838
|
-
}
|
|
2001
|
+
const i = !!r?.user;
|
|
2002
|
+
const s = createEffectNode(e, t, n, i ? v : O, notifyEffectStatus, r);
|
|
2003
|
+
recompute(s, true);
|
|
2004
|
+
!r?.defer &&
|
|
2005
|
+
(s.$ === v || r?.schedule ? s.te.enqueue(s.$, runEffect.bind(null, s)) : runEffect(s));
|
|
2006
|
+
}
|
|
2007
|
+
function notifyEffectStatus(e, t) {
|
|
2008
|
+
const n = e !== undefined ? e : this.be;
|
|
2009
|
+
const r = t !== undefined ? t : this.we;
|
|
2010
|
+
if (n & _) {
|
|
2011
|
+
let e = r;
|
|
2012
|
+
this.te.notify(this, m, 0);
|
|
2013
|
+
if (this.$ === v) {
|
|
2014
|
+
try {
|
|
2015
|
+
return this.Ke
|
|
2016
|
+
? this.Ke(e, () => {
|
|
2017
|
+
this.Be?.();
|
|
2018
|
+
this.Be = undefined;
|
|
2019
|
+
})
|
|
2020
|
+
: console.error(e);
|
|
2021
|
+
} catch (t) {
|
|
2022
|
+
e = t;
|
|
1839
2023
|
}
|
|
1840
|
-
if (!o.K.notify(o, w, w)) throw e;
|
|
1841
|
-
} else if (o.F === b) {
|
|
1842
|
-
o.K.notify(o, S | w, n, r);
|
|
1843
2024
|
}
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
this.Fe = undefined;
|
|
2025
|
+
if (!this.te.notify(this, _, _)) throw e;
|
|
2026
|
+
} else if (this.$ === O) {
|
|
2027
|
+
this.te.notify(this, m | _, n, r);
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
function runEffect(e) {
|
|
2031
|
+
if (!e.ee || e.m & u) return;
|
|
2032
|
+
e.Be?.();
|
|
2033
|
+
e.Be = undefined;
|
|
1854
2034
|
try {
|
|
1855
|
-
const
|
|
1856
|
-
if (false &&
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
2035
|
+
const t = e.Ve(e.ue, e.De);
|
|
2036
|
+
if (false && t !== undefined && typeof t !== "function");
|
|
2037
|
+
e.Be = t;
|
|
2038
|
+
if (e.Be && !e.Ge) {
|
|
2039
|
+
e.Ge = true;
|
|
2040
|
+
runWithOwner(e.i, () => cleanup(() => e.Be?.()));
|
|
2041
|
+
}
|
|
2042
|
+
} catch (t) {
|
|
2043
|
+
e.we = new StatusError(e, t);
|
|
2044
|
+
e.be |= _;
|
|
2045
|
+
if (!e.te.notify(e, _, _)) throw t;
|
|
1862
2046
|
} finally {
|
|
1863
|
-
|
|
1864
|
-
|
|
2047
|
+
e.De = e.ue;
|
|
2048
|
+
e.ee = false;
|
|
1865
2049
|
}
|
|
1866
2050
|
}
|
|
2051
|
+
GlobalQueue.he = runEffect;
|
|
1867
2052
|
function trackedEffect(e, t) {
|
|
1868
2053
|
const run = () => {
|
|
1869
|
-
if (!n.
|
|
2054
|
+
if (!n.ee || n.m & u) return;
|
|
1870
2055
|
try {
|
|
1871
|
-
n.
|
|
2056
|
+
n.ee = false;
|
|
1872
2057
|
recompute(n);
|
|
1873
2058
|
} finally {
|
|
1874
2059
|
}
|
|
1875
2060
|
};
|
|
1876
2061
|
const n = computed(
|
|
1877
2062
|
() => {
|
|
1878
|
-
n.
|
|
1879
|
-
n.
|
|
2063
|
+
n.Be?.();
|
|
2064
|
+
n.Be = undefined;
|
|
1880
2065
|
const t = staleValues(e);
|
|
1881
|
-
n.
|
|
2066
|
+
n.Be = t;
|
|
1882
2067
|
},
|
|
1883
2068
|
{ ...t, lazy: true }
|
|
1884
2069
|
);
|
|
1885
|
-
n.
|
|
1886
|
-
n.
|
|
1887
|
-
n.
|
|
1888
|
-
n
|
|
1889
|
-
n.
|
|
1890
|
-
const r = e !== undefined ? e : n.
|
|
1891
|
-
if (r &
|
|
1892
|
-
n.
|
|
1893
|
-
const e = t !== undefined ? t : n.
|
|
1894
|
-
if (!n.
|
|
2070
|
+
n.Be = undefined;
|
|
2071
|
+
n.ye = (n.ye & ~y) | S;
|
|
2072
|
+
n.ee = true;
|
|
2073
|
+
n.$ = P;
|
|
2074
|
+
n.Fe = (e, t) => {
|
|
2075
|
+
const r = e !== undefined ? e : n.be;
|
|
2076
|
+
if (r & _) {
|
|
2077
|
+
n.te.notify(n, m, 0);
|
|
2078
|
+
const e = t !== undefined ? t : n.we;
|
|
2079
|
+
if (!n.te.notify(n, _, _)) throw e;
|
|
1895
2080
|
}
|
|
1896
2081
|
};
|
|
1897
|
-
n.
|
|
1898
|
-
n.
|
|
1899
|
-
cleanup(() => n.
|
|
2082
|
+
n.ne = run;
|
|
2083
|
+
n.te.enqueue(v, run);
|
|
2084
|
+
cleanup(() => n.Be?.());
|
|
1900
2085
|
}
|
|
1901
2086
|
function restoreTransition(e, t) {
|
|
1902
|
-
|
|
2087
|
+
z.initTransition(e);
|
|
1903
2088
|
const n = t();
|
|
1904
2089
|
flush();
|
|
1905
2090
|
return n;
|
|
@@ -1908,13 +2093,13 @@ function action(e) {
|
|
|
1908
2093
|
return (...t) =>
|
|
1909
2094
|
new Promise((n, r) => {
|
|
1910
2095
|
const i = e(...t);
|
|
1911
|
-
|
|
1912
|
-
let s =
|
|
1913
|
-
s.
|
|
2096
|
+
z.initTransition();
|
|
2097
|
+
let s = M;
|
|
2098
|
+
s.ie.push(i);
|
|
1914
2099
|
const done = (e, t) => {
|
|
1915
2100
|
s = currentTransition(s);
|
|
1916
|
-
const o = s.
|
|
1917
|
-
if (o >= 0) s.
|
|
2101
|
+
const o = s.ie.indexOf(i);
|
|
2102
|
+
if (o >= 0) s.ie.splice(o, 1);
|
|
1918
2103
|
setActiveTransition(s);
|
|
1919
2104
|
schedule();
|
|
1920
2105
|
t ? r(t) : n(e);
|
|
@@ -1946,13 +2131,15 @@ function onCleanup(e) {
|
|
|
1946
2131
|
return cleanup(e);
|
|
1947
2132
|
}
|
|
1948
2133
|
function accessor(e) {
|
|
1949
|
-
|
|
2134
|
+
const t = read.bind(null, e);
|
|
2135
|
+
t[j] = e;
|
|
2136
|
+
return t;
|
|
1950
2137
|
}
|
|
1951
2138
|
function createSignal(e, t) {
|
|
1952
2139
|
if (typeof e === "function") {
|
|
1953
2140
|
const n = computed(e, t);
|
|
1954
|
-
n.
|
|
1955
|
-
return [accessor(n),
|
|
2141
|
+
n.ye &= ~y;
|
|
2142
|
+
return [accessor(n), setMemo.bind(null, n)];
|
|
1956
2143
|
}
|
|
1957
2144
|
const n = signal(e, t);
|
|
1958
2145
|
return [accessor(n), setSignal.bind(null, n)];
|
|
@@ -2008,7 +2195,7 @@ function resolve(e) {
|
|
|
2008
2195
|
function createOptimistic(e, t) {
|
|
2009
2196
|
if (typeof e === "function") {
|
|
2010
2197
|
const n = optimisticComputed(e, t);
|
|
2011
|
-
n.
|
|
2198
|
+
n.ye &= ~y;
|
|
2012
2199
|
return [accessor(n), setSignal.bind(null, n)];
|
|
2013
2200
|
}
|
|
2014
2201
|
const n = optimisticSignal(e, t);
|
|
@@ -2016,19 +2203,19 @@ function createOptimistic(e, t) {
|
|
|
2016
2203
|
}
|
|
2017
2204
|
function onSettled(e) {
|
|
2018
2205
|
const t = getOwner();
|
|
2019
|
-
t && !(t.
|
|
2206
|
+
t && !(t.ye & S)
|
|
2020
2207
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
2021
|
-
:
|
|
2208
|
+
: z.enqueue(v, () => {
|
|
2022
2209
|
const t = e();
|
|
2023
2210
|
t?.();
|
|
2024
2211
|
});
|
|
2025
2212
|
}
|
|
2026
2213
|
function unwrap(e) {
|
|
2027
|
-
return e?.[
|
|
2214
|
+
return e?.[le]?.[he] ?? e;
|
|
2028
2215
|
}
|
|
2029
|
-
function getOverrideValue(e, t, n, r
|
|
2030
|
-
if (
|
|
2031
|
-
return t &&
|
|
2216
|
+
function getOverrideValue(e, t, n, r) {
|
|
2217
|
+
if (r && n in r) return r[n];
|
|
2218
|
+
return t && n in t ? t[n] : e[n];
|
|
2032
2219
|
}
|
|
2033
2220
|
function getAllKeys(e, t, n) {
|
|
2034
2221
|
const r = getKeys(e, t);
|
|
@@ -2036,114 +2223,223 @@ function getAllKeys(e, t, n) {
|
|
|
2036
2223
|
return Array.from(new Set([...r, ...i]));
|
|
2037
2224
|
}
|
|
2038
2225
|
function applyState(e, t, n) {
|
|
2039
|
-
const r = t?.[
|
|
2226
|
+
const r = t?.[le];
|
|
2040
2227
|
if (!r) return;
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
r
|
|
2049
|
-
if (
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2228
|
+
if (r[de] || r[pe]) {
|
|
2229
|
+
applyStateSlow(e, r, n);
|
|
2230
|
+
} else {
|
|
2231
|
+
applyStateFast(e, r, n);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
function applyStateFast(e, t, n) {
|
|
2235
|
+
const r = t[ae];
|
|
2236
|
+
if (e === r) return;
|
|
2237
|
+
(t[we] || be).set(e, t[fe]);
|
|
2238
|
+
t[ae] = e;
|
|
2239
|
+
if (Array.isArray(r)) {
|
|
2240
|
+
let i = false;
|
|
2241
|
+
const s = r.length;
|
|
2242
|
+
if (e.length && s && e[0] && n(e[0]) != null) {
|
|
2243
|
+
let o, u, l, f, c, a, d, p;
|
|
2054
2244
|
for (
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
a++
|
|
2245
|
+
l = 0, f = Math.min(s, e.length);
|
|
2246
|
+
l < f && ((a = r[l]) === e[l] || (a && e[l] && n(a) === n(e[l])));
|
|
2247
|
+
l++
|
|
2059
2248
|
) {
|
|
2060
|
-
applyState(e[
|
|
2249
|
+
applyState(e[l], wrap(a, t), n);
|
|
2250
|
+
}
|
|
2251
|
+
const h = new Array(e.length),
|
|
2252
|
+
g = new Map();
|
|
2253
|
+
for (
|
|
2254
|
+
f = s - 1, c = e.length - 1;
|
|
2255
|
+
f >= l && c >= l && ((a = r[f]) === e[c] || (a && e[c] && n(a) === n(e[c])));
|
|
2256
|
+
f--, c--
|
|
2257
|
+
) {
|
|
2258
|
+
h[c] = a;
|
|
2259
|
+
}
|
|
2260
|
+
if (l > c || l > f) {
|
|
2261
|
+
for (u = l; u <= c; u++) {
|
|
2262
|
+
i = true;
|
|
2263
|
+
t[he][u] && setSignal(t[he][u], wrap(e[u], t));
|
|
2264
|
+
}
|
|
2265
|
+
for (; u < e.length; u++) {
|
|
2266
|
+
i = true;
|
|
2267
|
+
const r = wrap(h[u], t);
|
|
2268
|
+
t[he][u] && setSignal(t[he][u], r);
|
|
2269
|
+
applyState(e[u], r, n);
|
|
2270
|
+
}
|
|
2271
|
+
i && t[he][ue] && setSignal(t[he][ue], void 0);
|
|
2272
|
+
s !== e.length && t[he].length && setSignal(t[he].length, e.length);
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
d = new Array(c + 1);
|
|
2276
|
+
for (u = c; u >= l; u--) {
|
|
2277
|
+
a = e[u];
|
|
2278
|
+
p = a ? n(a) : a;
|
|
2279
|
+
o = g.get(p);
|
|
2280
|
+
d[u] = o === undefined ? -1 : o;
|
|
2281
|
+
g.set(p, u);
|
|
2282
|
+
}
|
|
2283
|
+
for (o = l; o <= f; o++) {
|
|
2284
|
+
a = r[o];
|
|
2285
|
+
p = a ? n(a) : a;
|
|
2286
|
+
u = g.get(p);
|
|
2287
|
+
if (u !== undefined && u !== -1) {
|
|
2288
|
+
h[u] = a;
|
|
2289
|
+
u = d[u];
|
|
2290
|
+
g.set(p, u);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
for (u = l; u < e.length; u++) {
|
|
2294
|
+
if (u in h) {
|
|
2295
|
+
const r = wrap(h[u], t);
|
|
2296
|
+
t[he][u] && setSignal(t[he][u], r);
|
|
2297
|
+
applyState(e[u], r, n);
|
|
2298
|
+
} else t[he][u] && setSignal(t[he][u], wrap(e[u], t));
|
|
2299
|
+
}
|
|
2300
|
+
if (l < e.length) i = true;
|
|
2301
|
+
} else if (e.length) {
|
|
2302
|
+
for (let i = 0, s = e.length; i < s; i++) {
|
|
2303
|
+
const s = r[i];
|
|
2304
|
+
isWrappable(s) ? applyState(e[i], wrap(s, t), n) : t[he][i] && setSignal(t[he][i], e[i]);
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
if (s !== e.length) {
|
|
2308
|
+
i = true;
|
|
2309
|
+
t[he].length && setSignal(t[he].length, e.length);
|
|
2310
|
+
}
|
|
2311
|
+
i && t[he][ue] && setSignal(t[he][ue], void 0);
|
|
2312
|
+
return;
|
|
2313
|
+
}
|
|
2314
|
+
let i = t[he];
|
|
2315
|
+
if (i) {
|
|
2316
|
+
const s = i[ue];
|
|
2317
|
+
const o = s ? getAllKeys(r, undefined, e) : Object.keys(i);
|
|
2318
|
+
for (let u = 0, l = o.length; u < l; u++) {
|
|
2319
|
+
const l = o[u];
|
|
2320
|
+
const f = i[l];
|
|
2321
|
+
const c = unwrap(r[l]);
|
|
2322
|
+
let a = unwrap(e[l]);
|
|
2323
|
+
if (c === a) continue;
|
|
2324
|
+
if (!c || !isWrappable(c) || !isWrappable(a) || (n(c) != null && n(c) !== n(a))) {
|
|
2325
|
+
s && setSignal(s, void 0);
|
|
2326
|
+
f && setSignal(f, isWrappable(a) ? wrap(a, t) : a);
|
|
2327
|
+
} else applyState(a, wrap(c, t), n);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
if ((i = t[ge])) {
|
|
2331
|
+
const t = Object.keys(i);
|
|
2332
|
+
for (let n = 0, r = t.length; n < r; n++) {
|
|
2333
|
+
const r = t[n];
|
|
2334
|
+
setSignal(i[r], r in e);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
function applyStateSlow(e, t, n) {
|
|
2339
|
+
const r = t[ae];
|
|
2340
|
+
const i = t[de];
|
|
2341
|
+
const s = t[pe];
|
|
2342
|
+
let o = t[he];
|
|
2343
|
+
(t[we] || be).set(e, t[fe]);
|
|
2344
|
+
t[ae] = e;
|
|
2345
|
+
t[de] = undefined;
|
|
2346
|
+
if (Array.isArray(r)) {
|
|
2347
|
+
let o = false;
|
|
2348
|
+
const u = getOverrideValue(r, i, "length", s);
|
|
2349
|
+
if (e.length && u && e[0] && n(e[0]) != null) {
|
|
2350
|
+
let l, f, c, a, d, p, h, g;
|
|
2351
|
+
for (
|
|
2352
|
+
c = 0, a = Math.min(u, e.length);
|
|
2353
|
+
c < a && ((p = getOverrideValue(r, i, c, s)) === e[c] || (p && e[c] && n(p) === n(e[c])));
|
|
2354
|
+
c++
|
|
2355
|
+
) {
|
|
2356
|
+
applyState(e[c], wrap(p, t), n);
|
|
2061
2357
|
}
|
|
2062
2358
|
const S = new Array(e.length),
|
|
2063
|
-
|
|
2359
|
+
y = new Map();
|
|
2064
2360
|
for (
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
((
|
|
2069
|
-
|
|
2361
|
+
a = u - 1, d = e.length - 1;
|
|
2362
|
+
a >= c &&
|
|
2363
|
+
d >= c &&
|
|
2364
|
+
((p = getOverrideValue(r, i, a, s)) === e[d] || (p && e[d] && n(p) === n(e[d])));
|
|
2365
|
+
a--, d--
|
|
2070
2366
|
) {
|
|
2071
|
-
S[
|
|
2367
|
+
S[d] = p;
|
|
2072
2368
|
}
|
|
2073
|
-
if (
|
|
2074
|
-
for (
|
|
2075
|
-
|
|
2076
|
-
|
|
2369
|
+
if (c > d || c > a) {
|
|
2370
|
+
for (f = c; f <= d; f++) {
|
|
2371
|
+
o = true;
|
|
2372
|
+
t[he][f] && setSignal(t[he][f], wrap(e[f], t));
|
|
2077
2373
|
}
|
|
2078
|
-
for (;
|
|
2079
|
-
|
|
2080
|
-
const
|
|
2081
|
-
|
|
2082
|
-
applyState(e[
|
|
2374
|
+
for (; f < e.length; f++) {
|
|
2375
|
+
o = true;
|
|
2376
|
+
const r = wrap(S[f], t);
|
|
2377
|
+
t[he][f] && setSignal(t[he][f], r);
|
|
2378
|
+
applyState(e[f], r, n);
|
|
2083
2379
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2380
|
+
o && t[he][ue] && setSignal(t[he][ue], void 0);
|
|
2381
|
+
u !== e.length && t[he].length && setSignal(t[he].length, e.length);
|
|
2086
2382
|
return;
|
|
2087
2383
|
}
|
|
2088
|
-
|
|
2089
|
-
for (
|
|
2090
|
-
|
|
2091
|
-
g =
|
|
2092
|
-
l =
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
}
|
|
2096
|
-
for (l =
|
|
2097
|
-
|
|
2098
|
-
g =
|
|
2099
|
-
|
|
2100
|
-
if (
|
|
2101
|
-
S[
|
|
2102
|
-
|
|
2103
|
-
|
|
2384
|
+
h = new Array(d + 1);
|
|
2385
|
+
for (f = d; f >= c; f--) {
|
|
2386
|
+
p = e[f];
|
|
2387
|
+
g = p ? n(p) : p;
|
|
2388
|
+
l = y.get(g);
|
|
2389
|
+
h[f] = l === undefined ? -1 : l;
|
|
2390
|
+
y.set(g, f);
|
|
2391
|
+
}
|
|
2392
|
+
for (l = c; l <= a; l++) {
|
|
2393
|
+
p = getOverrideValue(r, i, l, s);
|
|
2394
|
+
g = p ? n(p) : p;
|
|
2395
|
+
f = y.get(g);
|
|
2396
|
+
if (f !== undefined && f !== -1) {
|
|
2397
|
+
S[f] = p;
|
|
2398
|
+
f = h[f];
|
|
2399
|
+
y.set(g, f);
|
|
2104
2400
|
}
|
|
2105
2401
|
}
|
|
2106
|
-
for (
|
|
2107
|
-
if (
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
applyState(e[
|
|
2111
|
-
} else
|
|
2402
|
+
for (f = c; f < e.length; f++) {
|
|
2403
|
+
if (f in S) {
|
|
2404
|
+
const r = wrap(S[f], t);
|
|
2405
|
+
t[he][f] && setSignal(t[he][f], r);
|
|
2406
|
+
applyState(e[f], r, n);
|
|
2407
|
+
} else t[he][f] && setSignal(t[he][f], wrap(e[f], t));
|
|
2112
2408
|
}
|
|
2113
|
-
if (
|
|
2409
|
+
if (c < e.length) o = true;
|
|
2114
2410
|
} else if (e.length) {
|
|
2115
|
-
for (let
|
|
2116
|
-
const
|
|
2117
|
-
isWrappable(
|
|
2411
|
+
for (let o = 0, u = e.length; o < u; o++) {
|
|
2412
|
+
const u = getOverrideValue(r, i, o, s);
|
|
2413
|
+
isWrappable(u) ? applyState(e[o], wrap(u, t), n) : t[he][o] && setSignal(t[he][o], e[o]);
|
|
2118
2414
|
}
|
|
2119
2415
|
}
|
|
2120
|
-
if (
|
|
2121
|
-
|
|
2122
|
-
|
|
2416
|
+
if (u !== e.length) {
|
|
2417
|
+
o = true;
|
|
2418
|
+
t[he].length && setSignal(t[he].length, e.length);
|
|
2123
2419
|
}
|
|
2124
|
-
|
|
2420
|
+
o && t[he][ue] && setSignal(t[he][ue], void 0);
|
|
2125
2421
|
return;
|
|
2126
2422
|
}
|
|
2127
|
-
if (
|
|
2128
|
-
const
|
|
2129
|
-
const
|
|
2130
|
-
for (let
|
|
2131
|
-
const c = f
|
|
2132
|
-
const a =
|
|
2133
|
-
const d = unwrap(getOverrideValue(
|
|
2423
|
+
if (o) {
|
|
2424
|
+
const u = o[ue];
|
|
2425
|
+
const l = u ? getAllKeys(r, i, e) : Object.keys(o);
|
|
2426
|
+
for (let f = 0, c = l.length; f < c; f++) {
|
|
2427
|
+
const c = l[f];
|
|
2428
|
+
const a = o[c];
|
|
2429
|
+
const d = unwrap(getOverrideValue(r, i, c, s));
|
|
2134
2430
|
let p = unwrap(e[c]);
|
|
2135
2431
|
if (d === p) continue;
|
|
2136
2432
|
if (!d || !isWrappable(d) || !isWrappable(p) || (n(d) != null && n(d) !== n(p))) {
|
|
2137
|
-
|
|
2138
|
-
a && setSignal(a, isWrappable(p) ? wrap(p,
|
|
2139
|
-
} else applyState(p, wrap(d,
|
|
2433
|
+
u && setSignal(u, void 0);
|
|
2434
|
+
a && setSignal(a, isWrappable(p) ? wrap(p, t) : p);
|
|
2435
|
+
} else applyState(p, wrap(d, t), n);
|
|
2140
2436
|
}
|
|
2141
2437
|
}
|
|
2142
|
-
if ((
|
|
2143
|
-
const t = Object.keys(
|
|
2438
|
+
if ((o = t[ge])) {
|
|
2439
|
+
const t = Object.keys(o);
|
|
2144
2440
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2145
2441
|
const r = t[n];
|
|
2146
|
-
setSignal(
|
|
2442
|
+
setSignal(o[r], r in e);
|
|
2147
2443
|
}
|
|
2148
2444
|
}
|
|
2149
2445
|
}
|
|
@@ -2161,9 +2457,9 @@ function createProjectionInternal(e, t, n) {
|
|
|
2161
2457
|
let r;
|
|
2162
2458
|
const i = new WeakMap();
|
|
2163
2459
|
const wrapper = e => {
|
|
2164
|
-
e[
|
|
2165
|
-
e[
|
|
2166
|
-
Object.defineProperty(e,
|
|
2460
|
+
e[ye] = wrapProjection;
|
|
2461
|
+
e[we] = i;
|
|
2462
|
+
Object.defineProperty(e, me, {
|
|
2167
2463
|
get() {
|
|
2168
2464
|
return r;
|
|
2169
2465
|
},
|
|
@@ -2172,8 +2468,8 @@ function createProjectionInternal(e, t, n) {
|
|
|
2172
2468
|
};
|
|
2173
2469
|
const wrapProjection = e => {
|
|
2174
2470
|
if (i.has(e)) return i.get(e);
|
|
2175
|
-
if (e[
|
|
2176
|
-
const t = createStoreProxy(e,
|
|
2471
|
+
if (e[le]?.[ye] === wrapProjection) return e;
|
|
2472
|
+
const t = createStoreProxy(e, Pe, wrapper);
|
|
2177
2473
|
i.set(e, t);
|
|
2178
2474
|
return t;
|
|
2179
2475
|
};
|
|
@@ -2182,7 +2478,7 @@ function createProjectionInternal(e, t, n) {
|
|
|
2182
2478
|
if (!r) r = getOwner();
|
|
2183
2479
|
runProjectionComputed(s, e, n?.key || "id");
|
|
2184
2480
|
}, undefined);
|
|
2185
|
-
r.
|
|
2481
|
+
r.ye &= ~y;
|
|
2186
2482
|
return { store: s, node: r };
|
|
2187
2483
|
}
|
|
2188
2484
|
function createProjection(e, t, n) {
|
|
@@ -2194,7 +2490,7 @@ function runProjectionComputed(e, t, n, r) {
|
|
|
2194
2490
|
let o;
|
|
2195
2491
|
const u = new Proxy(
|
|
2196
2492
|
e,
|
|
2197
|
-
createWriteTraps(() => !s || i.
|
|
2493
|
+
createWriteTraps(() => !s || i.ke === o)
|
|
2198
2494
|
);
|
|
2199
2495
|
storeSetter(u, u => {
|
|
2200
2496
|
o = t(u);
|
|
@@ -2261,59 +2557,56 @@ function createWriteTraps(e) {
|
|
|
2261
2557
|
};
|
|
2262
2558
|
return t;
|
|
2263
2559
|
}
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
function createStoreProxy(e, t =
|
|
2560
|
+
const ue = Symbol(0),
|
|
2561
|
+
le = Symbol(0),
|
|
2562
|
+
fe = Symbol(0),
|
|
2563
|
+
ce = Symbol(0);
|
|
2564
|
+
const ae = "v",
|
|
2565
|
+
de = "o",
|
|
2566
|
+
pe = "x",
|
|
2567
|
+
he = "n",
|
|
2568
|
+
ge = "h",
|
|
2569
|
+
Se = "c",
|
|
2570
|
+
ye = "w",
|
|
2571
|
+
we = "l",
|
|
2572
|
+
me = "f",
|
|
2573
|
+
_e = "p";
|
|
2574
|
+
function createStoreProxy(e, t = Pe, n) {
|
|
2279
2575
|
let r;
|
|
2280
2576
|
if (Array.isArray(e)) {
|
|
2281
2577
|
r = [];
|
|
2282
2578
|
r.v = e;
|
|
2283
|
-
} else
|
|
2284
|
-
|
|
2579
|
+
} else {
|
|
2580
|
+
r = { v: e };
|
|
2581
|
+
const t = e?.[le]?.[ae] ?? e;
|
|
2582
|
+
const n = Object.getPrototypeOf(t);
|
|
2583
|
+
if (n !== null && n !== Object.prototype) {
|
|
2584
|
+
r[Se] = true;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2285
2587
|
n && n(r);
|
|
2286
|
-
return (r[
|
|
2588
|
+
return (r[fe] = new Proxy(r, t));
|
|
2287
2589
|
}
|
|
2288
|
-
const
|
|
2590
|
+
const be = new WeakMap();
|
|
2289
2591
|
function wrap(e, t) {
|
|
2290
|
-
if (t?.[
|
|
2291
|
-
let n = e[
|
|
2292
|
-
if (!n)
|
|
2592
|
+
if (t?.[ye]) return t[ye](e, t);
|
|
2593
|
+
let n = e[fe] || be.get(e);
|
|
2594
|
+
if (!n) be.set(e, (n = createStoreProxy(e)));
|
|
2293
2595
|
return n;
|
|
2294
2596
|
}
|
|
2295
2597
|
function isWrappable(e) {
|
|
2296
|
-
return
|
|
2297
|
-
|
|
2298
|
-
typeof e === "object" &&
|
|
2299
|
-
!Object.isFrozen(e) &&
|
|
2300
|
-
!(typeof Node !== "undefined" && e instanceof Node)
|
|
2301
|
-
);
|
|
2598
|
+
if (e == null || typeof e !== "object" || Object.isFrozen(e)) return false;
|
|
2599
|
+
return typeof Node === "undefined" || !(e instanceof Node);
|
|
2302
2600
|
}
|
|
2303
|
-
let
|
|
2601
|
+
let Oe = false;
|
|
2304
2602
|
function setWriteOverride(e) {
|
|
2305
|
-
|
|
2603
|
+
Oe = e;
|
|
2306
2604
|
}
|
|
2307
2605
|
function writeOnly(e) {
|
|
2308
|
-
return
|
|
2606
|
+
return Oe || !!ve?.has(e);
|
|
2309
2607
|
}
|
|
2310
2608
|
function unwrapStoreValue(e) {
|
|
2311
|
-
return e?.[
|
|
2312
|
-
}
|
|
2313
|
-
function hasCustomPrototype(e) {
|
|
2314
|
-
if (Array.isArray(e)) return false;
|
|
2315
|
-
const t = Object.getPrototypeOf(e);
|
|
2316
|
-
return t !== null && t !== Object.prototype;
|
|
2609
|
+
return e?.[le]?.[ae] ?? e;
|
|
2317
2610
|
}
|
|
2318
2611
|
function hasInheritedAccessor(e, t) {
|
|
2319
2612
|
let n = Object.getPrototypeOf(e);
|
|
@@ -2342,17 +2635,17 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2342
2635
|
r
|
|
2343
2636
|
);
|
|
2344
2637
|
if (s) {
|
|
2345
|
-
u.
|
|
2638
|
+
u.G = x;
|
|
2346
2639
|
}
|
|
2347
2640
|
if (o && t in o) {
|
|
2348
2641
|
const e = o[t];
|
|
2349
|
-
u.
|
|
2350
|
-
|
|
2642
|
+
u._e = e === undefined ? C : e;
|
|
2643
|
+
se?.add(u);
|
|
2351
2644
|
}
|
|
2352
2645
|
return (e[t] = u);
|
|
2353
2646
|
}
|
|
2354
|
-
function trackSelf(e, t =
|
|
2355
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2647
|
+
function trackSelf(e, t = ue) {
|
|
2648
|
+
getObserver() && read(getNode(getNodes(e, he), t, undefined, e[me], false, e[_e]));
|
|
2356
2649
|
}
|
|
2357
2650
|
function getKeys(e, t, n = true) {
|
|
2358
2651
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2360,102 +2653,117 @@ function getKeys(e, t, n = true) {
|
|
|
2360
2653
|
const i = new Set(r);
|
|
2361
2654
|
const s = Reflect.ownKeys(t);
|
|
2362
2655
|
for (const e of s) {
|
|
2363
|
-
if (t[e] !==
|
|
2656
|
+
if (t[e] !== ce) i.add(e);
|
|
2364
2657
|
else i.delete(e);
|
|
2365
2658
|
}
|
|
2366
2659
|
return Array.from(i);
|
|
2367
2660
|
}
|
|
2368
2661
|
function getPropertyDescriptor(e, t, n) {
|
|
2369
2662
|
if (t && n in t) {
|
|
2370
|
-
if (t[n] ===
|
|
2663
|
+
if (t[n] === ce) return void 0;
|
|
2371
2664
|
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2372
2665
|
if (r?.get || r?.set || !(n in e)) return r;
|
|
2373
2666
|
}
|
|
2374
2667
|
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2375
2668
|
}
|
|
2376
2669
|
function prepareStoreWrite(e, t, n) {
|
|
2377
|
-
if (e[
|
|
2378
|
-
const t = e[
|
|
2379
|
-
if (t?.
|
|
2380
|
-
|
|
2670
|
+
if (e[_e]) {
|
|
2671
|
+
const t = e[me];
|
|
2672
|
+
if (t?.V) {
|
|
2673
|
+
z.initTransition(t.V);
|
|
2381
2674
|
}
|
|
2382
2675
|
}
|
|
2383
|
-
const r = e[
|
|
2676
|
+
const r = e[ae];
|
|
2384
2677
|
const i = r[n];
|
|
2385
|
-
if (
|
|
2386
|
-
if (!e[
|
|
2387
|
-
e[
|
|
2388
|
-
|
|
2678
|
+
if (ie && typeof n !== "symbol" && !((e[me]?.be ?? 0) & m)) {
|
|
2679
|
+
if (!e[N]) {
|
|
2680
|
+
e[N] = Object.create(null);
|
|
2681
|
+
se?.add(e);
|
|
2389
2682
|
}
|
|
2390
|
-
if (!(n in e[
|
|
2391
|
-
e[
|
|
2683
|
+
if (!(n in e[N])) {
|
|
2684
|
+
e[N][n] = i;
|
|
2392
2685
|
}
|
|
2393
2686
|
}
|
|
2394
|
-
const s = e[
|
|
2395
|
-
const o = s ?
|
|
2687
|
+
const s = e[_e] && !K;
|
|
2688
|
+
const o = s ? pe : de;
|
|
2396
2689
|
if (s) trackOptimisticStore(t);
|
|
2397
2690
|
return { base: i, overrideKey: o, state: r };
|
|
2398
2691
|
}
|
|
2399
2692
|
function upsertStoreNode(e, t, n, r, i) {
|
|
2400
2693
|
if (t[n]) return t[n];
|
|
2401
2694
|
const s = isWrappable(r) ? wrap(r, e) : r;
|
|
2402
|
-
const o = getNode(t, n, s, e[
|
|
2695
|
+
const o = getNode(t, n, s, e[me], isEqual, e[_e], i);
|
|
2403
2696
|
registerTransientStoreNode(o);
|
|
2404
2697
|
return o;
|
|
2405
2698
|
}
|
|
2406
2699
|
function notifyStoreProperty(e, t, n, r, i, s) {
|
|
2407
|
-
const o =
|
|
2700
|
+
const o = K || e[_e];
|
|
2408
2701
|
const u = n !== "delete";
|
|
2409
|
-
const
|
|
2410
|
-
if (
|
|
2411
|
-
setSignal(
|
|
2702
|
+
const l = e[ge]?.[t];
|
|
2703
|
+
if (l) {
|
|
2704
|
+
setSignal(l, u);
|
|
2412
2705
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2413
|
-
const n = upsertStoreNode(e, getNodes(e,
|
|
2706
|
+
const n = upsertStoreNode(e, getNodes(e, ge), t, s);
|
|
2414
2707
|
setSignal(n, u);
|
|
2415
2708
|
}
|
|
2416
|
-
const
|
|
2709
|
+
const f = getNodes(e, he);
|
|
2417
2710
|
if (n === "set") {
|
|
2418
|
-
if (
|
|
2419
|
-
setSignal(
|
|
2711
|
+
if (f[t]) {
|
|
2712
|
+
setSignal(f[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2420
2713
|
} else if (!o) {
|
|
2421
|
-
const n = upsertStoreNode(e,
|
|
2714
|
+
const n = upsertStoreNode(e, f, t, i, e[N]);
|
|
2422
2715
|
setSignal(n, () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2423
2716
|
}
|
|
2424
2717
|
} else if (n === "invalidate") {
|
|
2425
|
-
if (
|
|
2426
|
-
setSignal(
|
|
2427
|
-
delete
|
|
2718
|
+
if (f[t]) {
|
|
2719
|
+
setSignal(f[t], {});
|
|
2720
|
+
delete f[t];
|
|
2428
2721
|
}
|
|
2429
2722
|
} else {
|
|
2430
|
-
if (
|
|
2431
|
-
setSignal(
|
|
2723
|
+
if (f[t]) {
|
|
2724
|
+
setSignal(f[t], undefined);
|
|
2432
2725
|
} else if (!o) {
|
|
2433
|
-
const n = upsertStoreNode(e,
|
|
2726
|
+
const n = upsertStoreNode(e, f, t, i, e[N]);
|
|
2434
2727
|
setSignal(n, undefined);
|
|
2435
2728
|
}
|
|
2436
2729
|
}
|
|
2437
|
-
|
|
2730
|
+
f[ue] && setSignal(f[ue], undefined);
|
|
2438
2731
|
}
|
|
2439
|
-
let
|
|
2440
|
-
const
|
|
2732
|
+
let ve = null;
|
|
2733
|
+
const Pe = {
|
|
2441
2734
|
get(e, t, n) {
|
|
2442
|
-
if (t ===
|
|
2443
|
-
if (t ===
|
|
2444
|
-
if (t ===
|
|
2445
|
-
if (t ===
|
|
2735
|
+
if (t === le) return e;
|
|
2736
|
+
if (t === fe) return n;
|
|
2737
|
+
if (t === j) return e[me];
|
|
2738
|
+
if (t === ue) {
|
|
2446
2739
|
trackSelf(e);
|
|
2447
2740
|
return n;
|
|
2448
2741
|
}
|
|
2449
|
-
const r = getNodes(e,
|
|
2742
|
+
const r = getNodes(e, he);
|
|
2450
2743
|
const i = r[t];
|
|
2451
|
-
const s = e[
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2744
|
+
const s = e[ae];
|
|
2745
|
+
if (
|
|
2746
|
+
!i &&
|
|
2747
|
+
!e[de] &&
|
|
2748
|
+
!e[pe] &&
|
|
2749
|
+
!e[Se] &&
|
|
2750
|
+
!e[_e] &&
|
|
2751
|
+
!e[N] &&
|
|
2752
|
+
!s[le] &&
|
|
2753
|
+
!(t in s) &&
|
|
2754
|
+
getObserver() &&
|
|
2755
|
+
!writeOnly(n)
|
|
2756
|
+
) {
|
|
2757
|
+
return read(getNode(r, t, undefined, e[me]));
|
|
2758
|
+
}
|
|
2759
|
+
const o = e[pe] && t in e[pe];
|
|
2760
|
+
const u = o || (e[de] && t in e[de]);
|
|
2761
|
+
const l = !!e[ae][le];
|
|
2762
|
+
const f = o ? e[pe] : e[de] && t in e[de] ? e[de] : e[ae];
|
|
2455
2763
|
if (!i) {
|
|
2456
2764
|
const r = Object.getOwnPropertyDescriptor(f, t);
|
|
2457
2765
|
if (r && r.get) return r.get.call(n);
|
|
2458
|
-
if (!r && !
|
|
2766
|
+
if (!r && !u && e[Se]) {
|
|
2459
2767
|
const e = unwrapStoreValue(f);
|
|
2460
2768
|
if (hasInheritedAccessor(e, t)) {
|
|
2461
2769
|
return Reflect.get(f, t, n);
|
|
@@ -2464,76 +2772,76 @@ const Se = {
|
|
|
2464
2772
|
}
|
|
2465
2773
|
if (writeOnly(n)) {
|
|
2466
2774
|
let n =
|
|
2467
|
-
i && (
|
|
2468
|
-
n ===
|
|
2775
|
+
i && (u || !l) ? (i.G !== undefined && i.G !== x ? i.G : i.Y !== x ? i.Y : i.ue) : f[t];
|
|
2776
|
+
n === ce && (n = undefined);
|
|
2469
2777
|
if (!isWrappable(n)) return n;
|
|
2470
2778
|
const r = wrap(n, e);
|
|
2471
|
-
|
|
2779
|
+
ve?.add(r);
|
|
2472
2780
|
return r;
|
|
2473
2781
|
}
|
|
2474
|
-
let
|
|
2475
|
-
|
|
2782
|
+
let c = i ? (u || !l ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2783
|
+
c === ce && (c = undefined);
|
|
2476
2784
|
if (!i) {
|
|
2477
|
-
if (!
|
|
2785
|
+
if (!u && typeof c === "function" && !f.hasOwnProperty(t)) {
|
|
2478
2786
|
let t;
|
|
2479
|
-
return !Array.isArray(e[
|
|
2480
|
-
?
|
|
2481
|
-
:
|
|
2787
|
+
return !Array.isArray(e[ae]) && (t = Object.getPrototypeOf(e[ae])) && t !== Object.prototype
|
|
2788
|
+
? c.bind(f)
|
|
2789
|
+
: c;
|
|
2482
2790
|
} else if (getObserver()) {
|
|
2483
|
-
return read(getNode(r, t, isWrappable(
|
|
2791
|
+
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[me], isEqual, e[_e], e[N]));
|
|
2484
2792
|
}
|
|
2485
2793
|
}
|
|
2486
|
-
return isWrappable(
|
|
2794
|
+
return isWrappable(c) ? wrap(c, e) : c;
|
|
2487
2795
|
},
|
|
2488
2796
|
has(e, t) {
|
|
2489
|
-
if (t ===
|
|
2797
|
+
if (t === fe || t === ue || t === "__proto__") return true;
|
|
2490
2798
|
const n =
|
|
2491
|
-
e[
|
|
2492
|
-
if (writeOnly(e[
|
|
2493
|
-
const r = getNodes(e,
|
|
2799
|
+
e[pe] && t in e[pe] ? e[pe][t] !== ce : e[de] && t in e[de] ? e[de][t] !== ce : t in e[ae];
|
|
2800
|
+
if (writeOnly(e[fe])) return n;
|
|
2801
|
+
const r = getNodes(e, ge);
|
|
2494
2802
|
if (r[t]) return read(r[t]);
|
|
2495
2803
|
if (getObserver()) {
|
|
2496
|
-
return read(getNode(r, t, n, e[
|
|
2804
|
+
return read(getNode(r, t, n, e[me], isEqual, e[_e]));
|
|
2497
2805
|
}
|
|
2498
2806
|
return n;
|
|
2499
2807
|
},
|
|
2500
2808
|
set(e, t, n) {
|
|
2501
|
-
const r = e[
|
|
2809
|
+
const r = e[fe];
|
|
2502
2810
|
if (writeOnly(r)) {
|
|
2503
2811
|
untrack(() => {
|
|
2504
2812
|
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2505
|
-
const u = e[
|
|
2506
|
-
const
|
|
2507
|
-
e[
|
|
2508
|
-
? e[
|
|
2509
|
-
: e[
|
|
2510
|
-
? e[
|
|
2511
|
-
: t in e[
|
|
2512
|
-
const
|
|
2813
|
+
const u = e[pe] && t in e[pe] ? e[pe][t] : e[de] && t in e[de] ? e[de][t] : i;
|
|
2814
|
+
const l =
|
|
2815
|
+
e[pe] && t in e[pe]
|
|
2816
|
+
? e[pe][t] !== ce
|
|
2817
|
+
: e[de] && t in e[de]
|
|
2818
|
+
? e[de][t] !== ce
|
|
2819
|
+
: t in e[ae];
|
|
2820
|
+
const f = unwrapStoreValue(n);
|
|
2513
2821
|
const c = Array.isArray(o) && t !== "length";
|
|
2514
2822
|
const a = c ? parseInt(t) + 1 : 0;
|
|
2515
2823
|
const d =
|
|
2516
2824
|
c &&
|
|
2517
|
-
(e[
|
|
2518
|
-
? e[
|
|
2519
|
-
: e[
|
|
2520
|
-
? e[
|
|
2825
|
+
(e[pe] && "length" in e[pe]
|
|
2826
|
+
? e[pe].length
|
|
2827
|
+
: e[de] && "length" in e[de]
|
|
2828
|
+
? e[de].length
|
|
2521
2829
|
: o.length);
|
|
2522
2830
|
const p = c && a > d ? a : undefined;
|
|
2523
|
-
if (u ===
|
|
2524
|
-
if (
|
|
2831
|
+
if (u === f && p === undefined) return true;
|
|
2832
|
+
if (f !== undefined && f === i && p === undefined) delete e[s]?.[t];
|
|
2525
2833
|
else {
|
|
2526
2834
|
const n = e[s] || (e[s] = Object.create(null));
|
|
2527
|
-
n[t] =
|
|
2835
|
+
n[t] = f;
|
|
2528
2836
|
if (p !== undefined) n.length = p;
|
|
2529
2837
|
}
|
|
2530
|
-
notifyStoreProperty(e, t, "set",
|
|
2838
|
+
notifyStoreProperty(e, t, "set", f, u, l);
|
|
2531
2839
|
if (Array.isArray(o) && t !== "length" && p !== undefined) {
|
|
2532
|
-
const t = getNodes(e,
|
|
2840
|
+
const t = getNodes(e, he);
|
|
2533
2841
|
if (t.length) {
|
|
2534
2842
|
setSignal(t.length, p);
|
|
2535
|
-
} else if (!
|
|
2536
|
-
const n = upsertStoreNode(e, t, "length", d, e[
|
|
2843
|
+
} else if (!K && !e[_e]) {
|
|
2844
|
+
const n = upsertStoreNode(e, t, "length", d, e[N]);
|
|
2537
2845
|
setSignal(n, p);
|
|
2538
2846
|
}
|
|
2539
2847
|
}
|
|
@@ -2543,7 +2851,7 @@ const Se = {
|
|
|
2543
2851
|
return true;
|
|
2544
2852
|
},
|
|
2545
2853
|
defineProperty(e, t, n) {
|
|
2546
|
-
const r = e[
|
|
2854
|
+
const r = e[fe];
|
|
2547
2855
|
if (writeOnly(r)) {
|
|
2548
2856
|
untrack(() => {
|
|
2549
2857
|
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
@@ -2556,16 +2864,16 @@ const Se = {
|
|
|
2556
2864
|
return true;
|
|
2557
2865
|
},
|
|
2558
2866
|
deleteProperty(e, t) {
|
|
2559
|
-
const n = e[
|
|
2560
|
-
const r = e[
|
|
2561
|
-
if (writeOnly(e[
|
|
2867
|
+
const n = e[pe]?.[t] === ce;
|
|
2868
|
+
const r = e[de]?.[t] === ce;
|
|
2869
|
+
if (writeOnly(e[fe]) && !n && !r) {
|
|
2562
2870
|
untrack(() => {
|
|
2563
|
-
const n = e[
|
|
2564
|
-
const r = n ?
|
|
2565
|
-
if (n) trackOptimisticStore(e[
|
|
2566
|
-
const i = e[
|
|
2567
|
-
if (t in e[
|
|
2568
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2871
|
+
const n = e[_e] && !K;
|
|
2872
|
+
const r = n ? pe : de;
|
|
2873
|
+
if (n) trackOptimisticStore(e[fe]);
|
|
2874
|
+
const i = e[pe] && t in e[pe] ? e[pe][t] : e[de] && t in e[de] ? e[de][t] : e[ae][t];
|
|
2875
|
+
if (t in e[ae] || (e[de] && t in e[de])) {
|
|
2876
|
+
(e[r] || (e[r] = Object.create(null)))[t] = ce;
|
|
2569
2877
|
} else if (e[r] && t in e[r]) {
|
|
2570
2878
|
delete e[r][t];
|
|
2571
2879
|
} else return true;
|
|
@@ -2576,11 +2884,11 @@ const Se = {
|
|
|
2576
2884
|
},
|
|
2577
2885
|
ownKeys(e) {
|
|
2578
2886
|
trackSelf(e);
|
|
2579
|
-
let t = getKeys(e[
|
|
2580
|
-
if (e[
|
|
2887
|
+
let t = getKeys(e[ae], e[de], false);
|
|
2888
|
+
if (e[pe]) {
|
|
2581
2889
|
const n = new Set(t);
|
|
2582
|
-
for (const t of Reflect.ownKeys(e[
|
|
2583
|
-
if (e[
|
|
2890
|
+
for (const t of Reflect.ownKeys(e[pe])) {
|
|
2891
|
+
if (e[pe][t] !== ce) n.add(t);
|
|
2584
2892
|
else n.delete(t);
|
|
2585
2893
|
}
|
|
2586
2894
|
t = Array.from(n);
|
|
@@ -2588,27 +2896,27 @@ const Se = {
|
|
|
2588
2896
|
return t;
|
|
2589
2897
|
},
|
|
2590
2898
|
getOwnPropertyDescriptor(e, t) {
|
|
2591
|
-
if (t ===
|
|
2592
|
-
if (e[
|
|
2593
|
-
if (e[
|
|
2594
|
-
const n = Reflect.getOwnPropertyDescriptor(e[
|
|
2595
|
-
if (n?.get || n?.set || !(t in e[
|
|
2596
|
-
const r = getPropertyDescriptor(e[
|
|
2899
|
+
if (t === fe) return { value: e[fe], writable: true, configurable: true };
|
|
2900
|
+
if (e[pe] && t in e[pe]) {
|
|
2901
|
+
if (e[pe][t] === ce) return undefined;
|
|
2902
|
+
const n = Reflect.getOwnPropertyDescriptor(e[pe], t);
|
|
2903
|
+
if (n?.get || n?.set || !(t in e[ae])) return n;
|
|
2904
|
+
const r = getPropertyDescriptor(e[ae], e[de], t);
|
|
2597
2905
|
if (r) {
|
|
2598
|
-
return { ...r, value: e[
|
|
2906
|
+
return { ...r, value: e[pe][t] };
|
|
2599
2907
|
}
|
|
2600
|
-
return { value: e[
|
|
2908
|
+
return { value: e[pe][t], writable: true, enumerable: true, configurable: true };
|
|
2601
2909
|
}
|
|
2602
|
-
return getPropertyDescriptor(e[
|
|
2910
|
+
return getPropertyDescriptor(e[ae], e[de], t);
|
|
2603
2911
|
},
|
|
2604
2912
|
getPrototypeOf(e) {
|
|
2605
|
-
return Object.getPrototypeOf(e[
|
|
2913
|
+
return Object.getPrototypeOf(e[ae]);
|
|
2606
2914
|
}
|
|
2607
2915
|
};
|
|
2608
2916
|
function storeSetter(e, t) {
|
|
2609
|
-
const n =
|
|
2610
|
-
|
|
2611
|
-
|
|
2917
|
+
const n = ve;
|
|
2918
|
+
ve = new Set();
|
|
2919
|
+
ve.add(e);
|
|
2612
2920
|
try {
|
|
2613
2921
|
const n = t(e);
|
|
2614
2922
|
if (n !== e && n !== undefined) {
|
|
@@ -2624,17 +2932,20 @@ function storeSetter(e, t) {
|
|
|
2624
2932
|
}
|
|
2625
2933
|
}
|
|
2626
2934
|
} finally {
|
|
2627
|
-
|
|
2628
|
-
|
|
2935
|
+
ve.clear();
|
|
2936
|
+
ve = n;
|
|
2629
2937
|
}
|
|
2630
2938
|
}
|
|
2631
2939
|
function createStore(e, t, n) {
|
|
2632
2940
|
const r = typeof e === "function",
|
|
2633
2941
|
i = r ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
2634
|
-
return [
|
|
2942
|
+
return [
|
|
2943
|
+
i,
|
|
2944
|
+
r ? e => (storeSetter(i, e), suppressComputedRecompute(i[j])) : e => storeSetter(i, e)
|
|
2945
|
+
];
|
|
2635
2946
|
}
|
|
2636
2947
|
function createOptimisticStore(e, t, n) {
|
|
2637
|
-
GlobalQueue.
|
|
2948
|
+
GlobalQueue.ge ||= clearOptimisticStore;
|
|
2638
2949
|
const r = typeof e === "function";
|
|
2639
2950
|
const i = r ? t : e;
|
|
2640
2951
|
const s = r ? e : undefined;
|
|
@@ -2642,39 +2953,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2642
2953
|
return [o, e => storeSetter(o, e)];
|
|
2643
2954
|
}
|
|
2644
2955
|
function clearOptimisticStore(e) {
|
|
2645
|
-
const t = e[
|
|
2646
|
-
if (!t || !t[
|
|
2647
|
-
const n = t[
|
|
2648
|
-
const r = t[
|
|
2956
|
+
const t = e[le];
|
|
2957
|
+
if (!t || !t[pe]) return;
|
|
2958
|
+
const n = t[pe];
|
|
2959
|
+
const r = t[he];
|
|
2649
2960
|
setProjectionWriteActive(true);
|
|
2650
2961
|
try {
|
|
2651
2962
|
if (r) {
|
|
2652
2963
|
for (const e of Reflect.ownKeys(n)) {
|
|
2653
2964
|
if (r[e]) {
|
|
2654
|
-
r[e].
|
|
2655
|
-
const n = t[
|
|
2656
|
-
const i = n ===
|
|
2965
|
+
r[e].H = undefined;
|
|
2966
|
+
const n = t[de] && e in t[de] ? t[de][e] : t[ae][e];
|
|
2967
|
+
const i = n === ce ? undefined : n;
|
|
2657
2968
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2658
2969
|
}
|
|
2659
2970
|
}
|
|
2660
|
-
if (r[
|
|
2661
|
-
r[
|
|
2662
|
-
setSignal(r[
|
|
2971
|
+
if (r[ue]) {
|
|
2972
|
+
r[ue].H = undefined;
|
|
2973
|
+
setSignal(r[ue], undefined);
|
|
2663
2974
|
}
|
|
2664
2975
|
}
|
|
2665
2976
|
} finally {
|
|
2666
2977
|
setProjectionWriteActive(false);
|
|
2667
2978
|
}
|
|
2668
|
-
delete t[
|
|
2979
|
+
delete t[pe];
|
|
2669
2980
|
}
|
|
2670
2981
|
function createOptimisticProjectionInternal(e, t, n) {
|
|
2671
2982
|
let r;
|
|
2672
2983
|
const i = new WeakMap();
|
|
2673
2984
|
const wrapper = e => {
|
|
2674
|
-
e[
|
|
2675
|
-
e[
|
|
2676
|
-
e[
|
|
2677
|
-
Object.defineProperty(e,
|
|
2985
|
+
e[ye] = wrapProjection;
|
|
2986
|
+
e[we] = i;
|
|
2987
|
+
e[_e] = true;
|
|
2988
|
+
Object.defineProperty(e, me, {
|
|
2678
2989
|
get() {
|
|
2679
2990
|
return r;
|
|
2680
2991
|
},
|
|
@@ -2683,8 +2994,8 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
2683
2994
|
};
|
|
2684
2995
|
const wrapProjection = e => {
|
|
2685
2996
|
if (i.has(e)) return i.get(e);
|
|
2686
|
-
if (e[
|
|
2687
|
-
const t = createStoreProxy(e,
|
|
2997
|
+
if (e[le]?.[ye] === wrapProjection) return e;
|
|
2998
|
+
const t = createStoreProxy(e, Pe, wrapper);
|
|
2688
2999
|
i.set(e, t);
|
|
2689
3000
|
return t;
|
|
2690
3001
|
};
|
|
@@ -2706,11 +3017,11 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
2706
3017
|
setProjectionWriteActive(false);
|
|
2707
3018
|
}
|
|
2708
3019
|
}, undefined);
|
|
2709
|
-
r.
|
|
3020
|
+
r.ye &= ~y;
|
|
2710
3021
|
}
|
|
2711
3022
|
return { store: s, node: r };
|
|
2712
3023
|
}
|
|
2713
|
-
const
|
|
3024
|
+
const xe = Symbol(0);
|
|
2714
3025
|
function isPrototypePollutionKey(e) {
|
|
2715
3026
|
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
2716
3027
|
}
|
|
@@ -2758,7 +3069,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2758
3069
|
if (s === i) return;
|
|
2759
3070
|
}
|
|
2760
3071
|
if (r === undefined && s == undefined) return;
|
|
2761
|
-
if (s ===
|
|
3072
|
+
if (s === xe) {
|
|
2762
3073
|
delete e[r];
|
|
2763
3074
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2764
3075
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2774,26 +3085,26 @@ function updatePath(e, t, n = 0) {
|
|
|
2774
3085
|
e[r] = s;
|
|
2775
3086
|
}
|
|
2776
3087
|
}
|
|
2777
|
-
const
|
|
3088
|
+
const Ce = Object.assign(
|
|
2778
3089
|
function storePath(...e) {
|
|
2779
3090
|
return t => {
|
|
2780
3091
|
updatePath(t, e);
|
|
2781
3092
|
};
|
|
2782
3093
|
},
|
|
2783
|
-
{ DELETE:
|
|
3094
|
+
{ DELETE: xe }
|
|
2784
3095
|
);
|
|
2785
3096
|
function snapshotImpl(e, t, n, r) {
|
|
2786
|
-
let i, s, o, u,
|
|
3097
|
+
let i, s, o, u, l, f;
|
|
2787
3098
|
if (!isWrappable(e)) return e;
|
|
2788
3099
|
if (n && n.has(e)) return n.get(e);
|
|
2789
3100
|
if (!n) n = new Map();
|
|
2790
|
-
if ((i = e[
|
|
2791
|
-
if (t) trackSelf(i,
|
|
2792
|
-
o = i[
|
|
2793
|
-
s = Array.isArray(i[
|
|
2794
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
2795
|
-
e = i[
|
|
2796
|
-
r =
|
|
3101
|
+
if ((i = e[le] || r?.get(e)?.[le])) {
|
|
3102
|
+
if (t) trackSelf(i, ue);
|
|
3103
|
+
o = i[de];
|
|
3104
|
+
s = Array.isArray(i[ae]);
|
|
3105
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[ae]))) : i[ae]);
|
|
3106
|
+
e = i[ae];
|
|
3107
|
+
r = be;
|
|
2797
3108
|
} else {
|
|
2798
3109
|
s = Array.isArray(e);
|
|
2799
3110
|
n.set(e, e);
|
|
@@ -2801,12 +3112,12 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2801
3112
|
if (s) {
|
|
2802
3113
|
const s = o?.length || e.length;
|
|
2803
3114
|
for (let c = 0; c < s; c++) {
|
|
2804
|
-
|
|
2805
|
-
if (
|
|
2806
|
-
if (t && isWrappable(
|
|
2807
|
-
if ((
|
|
3115
|
+
f = o && c in o ? o[c] : e[c];
|
|
3116
|
+
if (f === ce) continue;
|
|
3117
|
+
if (t && isWrappable(f)) wrap(f, i);
|
|
3118
|
+
if ((l = snapshotImpl(f, t, n, r)) !== f || u) {
|
|
2808
3119
|
if (!u) n.set(e, (u = [...e]));
|
|
2809
|
-
u[c] =
|
|
3120
|
+
u[c] = l;
|
|
2810
3121
|
}
|
|
2811
3122
|
}
|
|
2812
3123
|
} else {
|
|
@@ -2815,14 +3126,14 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2815
3126
|
let a = s[c];
|
|
2816
3127
|
const d = getPropertyDescriptor(e, o, a);
|
|
2817
3128
|
if (d.get) continue;
|
|
2818
|
-
|
|
2819
|
-
if (t && isWrappable(
|
|
2820
|
-
if ((
|
|
3129
|
+
f = o && a in o ? o[a] : e[a];
|
|
3130
|
+
if (t && isWrappable(f)) wrap(f, i);
|
|
3131
|
+
if ((l = snapshotImpl(f, t, n, r)) !== e[a] || u) {
|
|
2821
3132
|
if (!u) {
|
|
2822
3133
|
u = Object.create(Object.getPrototypeOf(e));
|
|
2823
3134
|
Object.assign(u, e);
|
|
2824
3135
|
}
|
|
2825
|
-
u[a] =
|
|
3136
|
+
u[a] = l;
|
|
2826
3137
|
}
|
|
2827
3138
|
}
|
|
2828
3139
|
}
|
|
@@ -2837,13 +3148,13 @@ function deep(e) {
|
|
|
2837
3148
|
function trueFn() {
|
|
2838
3149
|
return true;
|
|
2839
3150
|
}
|
|
2840
|
-
const
|
|
3151
|
+
const Ne = {
|
|
2841
3152
|
get(e, t, n) {
|
|
2842
|
-
if (t ===
|
|
3153
|
+
if (t === fe) return n;
|
|
2843
3154
|
return e.get(t);
|
|
2844
3155
|
},
|
|
2845
3156
|
has(e, t) {
|
|
2846
|
-
if (t ===
|
|
3157
|
+
if (t === fe) return true;
|
|
2847
3158
|
return e.has(t);
|
|
2848
3159
|
},
|
|
2849
3160
|
set: trueFn,
|
|
@@ -2866,23 +3177,24 @@ const be = {
|
|
|
2866
3177
|
function resolveSource(e) {
|
|
2867
3178
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2868
3179
|
}
|
|
2869
|
-
const
|
|
3180
|
+
const Ee = Symbol(0);
|
|
2870
3181
|
function merge(...e) {
|
|
2871
3182
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2872
3183
|
let t = false;
|
|
2873
3184
|
const n = [];
|
|
2874
3185
|
for (let r = 0; r < e.length; r++) {
|
|
2875
3186
|
const i = e[r];
|
|
2876
|
-
t = t || (!!i &&
|
|
2877
|
-
const s = !!i && i[
|
|
2878
|
-
if (s)
|
|
2879
|
-
|
|
3187
|
+
t = t || (!!i && fe in i);
|
|
3188
|
+
const s = !!i && i[Ee];
|
|
3189
|
+
if (s) {
|
|
3190
|
+
for (let e = 0; e < s.length; e++) n.push(s[e]);
|
|
3191
|
+
} else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2880
3192
|
}
|
|
2881
|
-
if (
|
|
3193
|
+
if (E && t) {
|
|
2882
3194
|
return new Proxy(
|
|
2883
3195
|
{
|
|
2884
3196
|
get(e) {
|
|
2885
|
-
if (e ===
|
|
3197
|
+
if (e === Ee) return n;
|
|
2886
3198
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2887
3199
|
const r = resolveSource(n[t]);
|
|
2888
3200
|
if (e in r) return r[e];
|
|
@@ -2895,12 +3207,15 @@ function merge(...e) {
|
|
|
2895
3207
|
return false;
|
|
2896
3208
|
},
|
|
2897
3209
|
keys() {
|
|
2898
|
-
const e =
|
|
2899
|
-
for (let t = 0; t < n.length; t++)
|
|
2900
|
-
|
|
3210
|
+
const e = new Set();
|
|
3211
|
+
for (let t = 0; t < n.length; t++) {
|
|
3212
|
+
const r = Object.keys(resolveSource(n[t]));
|
|
3213
|
+
for (let t = 0; t < r.length; t++) e.add(r[t]);
|
|
3214
|
+
}
|
|
3215
|
+
return [...e];
|
|
2901
3216
|
}
|
|
2902
3217
|
},
|
|
2903
|
-
|
|
3218
|
+
Ne
|
|
2904
3219
|
);
|
|
2905
3220
|
}
|
|
2906
3221
|
const r = Object.create(null);
|
|
@@ -2932,325 +3247,332 @@ function merge(...e) {
|
|
|
2932
3247
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2933
3248
|
else o[t] = n.value;
|
|
2934
3249
|
}
|
|
2935
|
-
o[
|
|
3250
|
+
o[Ee] = n;
|
|
2936
3251
|
return o;
|
|
2937
3252
|
}
|
|
2938
3253
|
function omit(e, ...t) {
|
|
2939
|
-
|
|
2940
|
-
if (k && ne in e) {
|
|
3254
|
+
if (E && fe in e) {
|
|
2941
3255
|
return new Proxy(
|
|
2942
3256
|
{
|
|
2943
|
-
get(
|
|
2944
|
-
return
|
|
3257
|
+
get(n) {
|
|
3258
|
+
return t.includes(n) ? undefined : e[n];
|
|
2945
3259
|
},
|
|
2946
|
-
has(
|
|
2947
|
-
return !
|
|
3260
|
+
has(n) {
|
|
3261
|
+
return !t.includes(n) && n in e;
|
|
2948
3262
|
},
|
|
2949
3263
|
keys() {
|
|
2950
|
-
return Object.keys(e).filter(e => !
|
|
3264
|
+
return Object.keys(e).filter(e => !t.includes(e));
|
|
2951
3265
|
}
|
|
2952
3266
|
},
|
|
2953
|
-
|
|
3267
|
+
Ne
|
|
2954
3268
|
);
|
|
2955
3269
|
}
|
|
2956
|
-
const
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
3270
|
+
const n = {};
|
|
3271
|
+
const r = Object.getOwnPropertyNames(e);
|
|
3272
|
+
const i = t.length > 4 && r.length > t.length ? new Set(t) : undefined;
|
|
3273
|
+
for (const s of r) {
|
|
3274
|
+
if (i ? !i.has(s) : !t.includes(s)) {
|
|
3275
|
+
const t = Object.getOwnPropertyDescriptor(e, s);
|
|
3276
|
+
!t.get && !t.set && t.enumerable && t.writable && t.configurable
|
|
3277
|
+
? (n[s] = t.value)
|
|
3278
|
+
: Object.defineProperty(n, s, t);
|
|
2963
3279
|
}
|
|
2964
3280
|
}
|
|
2965
|
-
return
|
|
3281
|
+
return n;
|
|
2966
3282
|
}
|
|
2967
3283
|
function mapArray(e, t, n) {
|
|
2968
3284
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2969
3285
|
const i = t.length > 1;
|
|
2970
3286
|
const s = t;
|
|
2971
3287
|
const o = {
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
3288
|
+
Ue: createOwner(),
|
|
3289
|
+
Je: 0,
|
|
3290
|
+
Xe: e,
|
|
3291
|
+
Ye: [],
|
|
3292
|
+
Ze: s,
|
|
3293
|
+
$e: [],
|
|
3294
|
+
et: [],
|
|
3295
|
+
tt: r,
|
|
3296
|
+
nt: r || n?.keyed === false ? [] : undefined,
|
|
3297
|
+
rt: i && n?.keyed !== false ? [] : undefined,
|
|
3298
|
+
it: n?.keyed === false,
|
|
3299
|
+
st: n?.fallback
|
|
2983
3300
|
};
|
|
2984
3301
|
const u = computed(updateKeyedMap.bind(o));
|
|
2985
|
-
o.
|
|
2986
|
-
u.
|
|
3302
|
+
o.Ue.u = u;
|
|
3303
|
+
u.ye &= ~y;
|
|
2987
3304
|
return accessor(u);
|
|
2988
3305
|
}
|
|
2989
|
-
const
|
|
3306
|
+
const ke = { ownedWrite: true };
|
|
2990
3307
|
function updateKeyedMap() {
|
|
2991
|
-
const e = this.
|
|
3308
|
+
const e = this.Xe() || [],
|
|
2992
3309
|
t = e.length;
|
|
2993
|
-
e[
|
|
2994
|
-
runWithOwner(this.
|
|
3310
|
+
e[ue];
|
|
3311
|
+
runWithOwner(this.Ue, () => {
|
|
2995
3312
|
let n,
|
|
2996
3313
|
r,
|
|
2997
|
-
i = this.
|
|
2998
|
-
?
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3314
|
+
i = this.nt
|
|
3315
|
+
? this.it
|
|
3316
|
+
? () => {
|
|
3317
|
+
this.nt[r] = signal(e[r], ke);
|
|
3318
|
+
return this.Ze(accessor(this.nt[r]), r);
|
|
3319
|
+
}
|
|
3320
|
+
: () => {
|
|
3321
|
+
this.nt[r] = signal(e[r], ke);
|
|
3322
|
+
this.rt && (this.rt[r] = signal(r, ke));
|
|
3323
|
+
return this.Ze(accessor(this.nt[r]), this.rt ? accessor(this.rt[r]) : undefined);
|
|
3324
|
+
}
|
|
3325
|
+
: this.rt
|
|
3004
3326
|
? () => {
|
|
3005
3327
|
const t = e[r];
|
|
3006
|
-
this
|
|
3007
|
-
return this.
|
|
3328
|
+
this.rt[r] = signal(r, ke);
|
|
3329
|
+
return this.Ze(t, accessor(this.rt[r]));
|
|
3008
3330
|
}
|
|
3009
3331
|
: () => {
|
|
3010
3332
|
const t = e[r];
|
|
3011
|
-
return this.
|
|
3333
|
+
return this.Ze(t);
|
|
3012
3334
|
};
|
|
3013
3335
|
if (t === 0) {
|
|
3014
|
-
if (this.
|
|
3015
|
-
this.
|
|
3016
|
-
this.
|
|
3017
|
-
this.
|
|
3018
|
-
this
|
|
3019
|
-
this.
|
|
3020
|
-
this.
|
|
3021
|
-
this
|
|
3022
|
-
}
|
|
3023
|
-
if (this.
|
|
3024
|
-
this
|
|
3025
|
-
}
|
|
3026
|
-
} else if (this.
|
|
3027
|
-
if (this.
|
|
3028
|
-
this
|
|
3336
|
+
if (this.Je !== 0) {
|
|
3337
|
+
this.Ue.dispose(false);
|
|
3338
|
+
this.et = [];
|
|
3339
|
+
this.Ye = [];
|
|
3340
|
+
this.$e = [];
|
|
3341
|
+
this.Je = 0;
|
|
3342
|
+
this.nt && (this.nt = []);
|
|
3343
|
+
this.rt && (this.rt = []);
|
|
3344
|
+
}
|
|
3345
|
+
if (this.st && !this.$e[0]) {
|
|
3346
|
+
this.$e[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3347
|
+
}
|
|
3348
|
+
} else if (this.Je === 0) {
|
|
3349
|
+
if (this.et[0]) this.et[0].dispose();
|
|
3350
|
+
this.$e = new Array(t);
|
|
3029
3351
|
for (r = 0; r < t; r++) {
|
|
3030
|
-
this.
|
|
3031
|
-
this
|
|
3352
|
+
this.Ye[r] = e[r];
|
|
3353
|
+
this.$e[r] = runWithOwner((this.et[r] = createOwner()), i);
|
|
3032
3354
|
}
|
|
3033
|
-
this.
|
|
3355
|
+
this.Je = t;
|
|
3034
3356
|
} else {
|
|
3035
3357
|
let s,
|
|
3036
3358
|
o,
|
|
3037
3359
|
u,
|
|
3038
|
-
f,
|
|
3039
3360
|
l,
|
|
3361
|
+
f,
|
|
3040
3362
|
c,
|
|
3041
3363
|
a,
|
|
3042
3364
|
d = new Array(t),
|
|
3043
3365
|
p = new Array(t),
|
|
3044
|
-
h = this.
|
|
3045
|
-
|
|
3366
|
+
h = this.nt ? new Array(t) : undefined,
|
|
3367
|
+
g = this.rt ? new Array(t) : undefined;
|
|
3046
3368
|
for (
|
|
3047
|
-
s = 0, o = Math.min(this.
|
|
3048
|
-
s < o && (this.
|
|
3369
|
+
s = 0, o = Math.min(this.Je, t);
|
|
3370
|
+
s < o && (this.Ye[s] === e[s] || (this.nt && compare(this.tt, this.Ye[s], e[s])));
|
|
3049
3371
|
s++
|
|
3050
3372
|
) {
|
|
3051
|
-
if (this.
|
|
3373
|
+
if (this.nt) setSignal(this.nt[s], e[s]);
|
|
3052
3374
|
}
|
|
3053
3375
|
for (
|
|
3054
|
-
o = this.
|
|
3376
|
+
o = this.Je - 1, u = t - 1;
|
|
3055
3377
|
o >= s &&
|
|
3056
3378
|
u >= s &&
|
|
3057
|
-
(this.
|
|
3379
|
+
(this.Ye[o] === e[u] || (this.nt && compare(this.tt, this.Ye[o], e[u])));
|
|
3058
3380
|
o--, u--
|
|
3059
3381
|
) {
|
|
3060
|
-
d[u] = this
|
|
3061
|
-
p[u] = this.
|
|
3062
|
-
h && (h[u] = this.
|
|
3063
|
-
|
|
3382
|
+
d[u] = this.$e[o];
|
|
3383
|
+
p[u] = this.et[o];
|
|
3384
|
+
h && (h[u] = this.nt[o]);
|
|
3385
|
+
g && (g[u] = this.rt[o]);
|
|
3064
3386
|
}
|
|
3065
3387
|
c = new Map();
|
|
3066
3388
|
a = new Array(u + 1);
|
|
3067
3389
|
for (r = u; r >= s; r--) {
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
n = c.get(
|
|
3390
|
+
l = e[r];
|
|
3391
|
+
f = this.tt ? this.tt(l) : l;
|
|
3392
|
+
n = c.get(f);
|
|
3071
3393
|
a[r] = n === undefined ? -1 : n;
|
|
3072
|
-
c.set(
|
|
3394
|
+
c.set(f, r);
|
|
3073
3395
|
}
|
|
3074
3396
|
for (n = s; n <= o; n++) {
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
r = c.get(
|
|
3397
|
+
l = this.Ye[n];
|
|
3398
|
+
f = this.tt ? this.tt(l) : l;
|
|
3399
|
+
r = c.get(f);
|
|
3078
3400
|
if (r !== undefined && r !== -1) {
|
|
3079
|
-
d[r] = this
|
|
3080
|
-
p[r] = this.
|
|
3081
|
-
h && (h[r] = this.
|
|
3082
|
-
|
|
3401
|
+
d[r] = this.$e[n];
|
|
3402
|
+
p[r] = this.et[n];
|
|
3403
|
+
h && (h[r] = this.nt[n]);
|
|
3404
|
+
g && (g[r] = this.rt[n]);
|
|
3083
3405
|
r = a[r];
|
|
3084
|
-
c.set(
|
|
3085
|
-
} else this.
|
|
3406
|
+
c.set(f, r);
|
|
3407
|
+
} else this.et[n].dispose();
|
|
3086
3408
|
}
|
|
3087
3409
|
for (r = s; r < t; r++) {
|
|
3088
3410
|
if (r in d) {
|
|
3089
|
-
this
|
|
3090
|
-
this.
|
|
3411
|
+
this.$e[r] = d[r];
|
|
3412
|
+
this.et[r] = p[r];
|
|
3091
3413
|
if (h) {
|
|
3092
|
-
this.
|
|
3093
|
-
setSignal(this.
|
|
3414
|
+
this.nt[r] = h[r];
|
|
3415
|
+
setSignal(this.nt[r], e[r]);
|
|
3094
3416
|
}
|
|
3095
|
-
if (
|
|
3096
|
-
this
|
|
3097
|
-
setSignal(this
|
|
3417
|
+
if (g) {
|
|
3418
|
+
this.rt[r] = g[r];
|
|
3419
|
+
setSignal(this.rt[r], r);
|
|
3098
3420
|
}
|
|
3099
3421
|
} else {
|
|
3100
|
-
this
|
|
3422
|
+
this.$e[r] = runWithOwner((this.et[r] = createOwner()), i);
|
|
3101
3423
|
}
|
|
3102
3424
|
}
|
|
3103
|
-
this
|
|
3104
|
-
this.
|
|
3425
|
+
this.$e = this.$e.slice(0, (this.Je = t));
|
|
3426
|
+
this.Ye = e.slice(0);
|
|
3105
3427
|
}
|
|
3106
3428
|
});
|
|
3107
|
-
return this
|
|
3429
|
+
return this.$e;
|
|
3108
3430
|
}
|
|
3109
3431
|
function repeat(e, t, n) {
|
|
3110
3432
|
const r = t;
|
|
3111
3433
|
const i = computed(
|
|
3112
3434
|
updateRepeat.bind({
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3435
|
+
Ue: createOwner(),
|
|
3436
|
+
Je: 0,
|
|
3437
|
+
ot: 0,
|
|
3438
|
+
ut: e,
|
|
3439
|
+
Ze: r,
|
|
3440
|
+
et: [],
|
|
3441
|
+
$e: [],
|
|
3442
|
+
lt: n?.from,
|
|
3443
|
+
st: n?.fallback
|
|
3122
3444
|
})
|
|
3123
3445
|
);
|
|
3124
|
-
i.
|
|
3446
|
+
i.ye &= ~y;
|
|
3125
3447
|
return accessor(i);
|
|
3126
3448
|
}
|
|
3127
3449
|
function updateRepeat() {
|
|
3128
|
-
const e = this.
|
|
3129
|
-
const t = this.
|
|
3130
|
-
runWithOwner(this.
|
|
3450
|
+
const e = this.ut();
|
|
3451
|
+
const t = this.lt?.() || 0;
|
|
3452
|
+
runWithOwner(this.Ue, () => {
|
|
3131
3453
|
if (e === 0) {
|
|
3132
|
-
if (this.
|
|
3133
|
-
this.
|
|
3134
|
-
this.
|
|
3135
|
-
this
|
|
3136
|
-
this.
|
|
3454
|
+
if (this.Je !== 0) {
|
|
3455
|
+
this.Ue.dispose(false);
|
|
3456
|
+
this.et = [];
|
|
3457
|
+
this.$e = [];
|
|
3458
|
+
this.Je = 0;
|
|
3137
3459
|
}
|
|
3138
|
-
if (this.
|
|
3139
|
-
this
|
|
3460
|
+
if (this.st && !this.$e[0]) {
|
|
3461
|
+
this.$e[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3140
3462
|
}
|
|
3141
3463
|
return;
|
|
3142
3464
|
}
|
|
3143
3465
|
const n = t + e;
|
|
3144
|
-
const r = this.
|
|
3145
|
-
if (this.
|
|
3146
|
-
for (let e = n; e < r; e++) this.
|
|
3147
|
-
if (this.
|
|
3148
|
-
let e = this.
|
|
3149
|
-
while (e < t && e < this.
|
|
3150
|
-
this.
|
|
3151
|
-
this.
|
|
3152
|
-
} else if (this.
|
|
3153
|
-
let n = r - this.
|
|
3154
|
-
let i = this.
|
|
3155
|
-
this.
|
|
3466
|
+
const r = this.ot + this.Je;
|
|
3467
|
+
if (this.Je === 0 && this.et[0]) this.et[0].dispose();
|
|
3468
|
+
for (let e = n; e < r; e++) this.et[e - this.ot].dispose();
|
|
3469
|
+
if (this.ot < t) {
|
|
3470
|
+
let e = this.ot;
|
|
3471
|
+
while (e < t && e < this.Je) this.et[e++].dispose();
|
|
3472
|
+
this.et.splice(0, t - this.ot);
|
|
3473
|
+
this.$e.splice(0, t - this.ot);
|
|
3474
|
+
} else if (this.ot > t) {
|
|
3475
|
+
let n = r - this.ot - 1;
|
|
3476
|
+
let i = this.ot - t;
|
|
3477
|
+
this.et.length = this.$e.length = e;
|
|
3156
3478
|
while (n >= i) {
|
|
3157
|
-
this.
|
|
3158
|
-
this
|
|
3479
|
+
this.et[n] = this.et[n - i];
|
|
3480
|
+
this.$e[n] = this.$e[n - i];
|
|
3159
3481
|
n--;
|
|
3160
3482
|
}
|
|
3161
3483
|
for (let e = 0; e < i; e++) {
|
|
3162
|
-
this
|
|
3484
|
+
this.$e[e] = runWithOwner((this.et[e] = createOwner()), () => this.Ze(e + t));
|
|
3163
3485
|
}
|
|
3164
3486
|
}
|
|
3165
3487
|
for (let e = r; e < n; e++) {
|
|
3166
|
-
this
|
|
3488
|
+
this.$e[e - t] = runWithOwner((this.et[e - t] = createOwner()), () => this.Ze(e));
|
|
3167
3489
|
}
|
|
3168
|
-
this
|
|
3169
|
-
this.
|
|
3170
|
-
this.
|
|
3490
|
+
this.$e = this.$e.slice(0, e);
|
|
3491
|
+
this.ot = t;
|
|
3492
|
+
this.Je = e;
|
|
3171
3493
|
});
|
|
3172
|
-
return this
|
|
3494
|
+
return this.$e;
|
|
3173
3495
|
}
|
|
3174
3496
|
function compare(e, t, n) {
|
|
3175
3497
|
return e ? e(t) === e(n) : true;
|
|
3176
3498
|
}
|
|
3177
3499
|
function boundaryComputed(e, t) {
|
|
3178
3500
|
const n = computed(e, { lazy: true });
|
|
3179
|
-
n.
|
|
3180
|
-
const r = e !== undefined ? e : n.
|
|
3181
|
-
const i = t !== undefined ? t : n.
|
|
3182
|
-
n.
|
|
3183
|
-
n.
|
|
3501
|
+
n.Fe = (e, t) => {
|
|
3502
|
+
const r = e !== undefined ? e : n.be;
|
|
3503
|
+
const i = t !== undefined ? t : n.we;
|
|
3504
|
+
n.be &= ~n.ft;
|
|
3505
|
+
n.te.notify(n, n.ft, r, i);
|
|
3184
3506
|
};
|
|
3185
|
-
n.
|
|
3186
|
-
n.
|
|
3507
|
+
n.ft = t;
|
|
3508
|
+
n.ye &= ~y;
|
|
3187
3509
|
recompute(n, true);
|
|
3188
3510
|
return n;
|
|
3189
3511
|
}
|
|
3190
3512
|
function createBoundChildren(e, t, n, r) {
|
|
3191
|
-
const i = e.
|
|
3192
|
-
i.addChild((e.
|
|
3193
|
-
cleanup(() => i.removeChild(e.
|
|
3513
|
+
const i = e.te;
|
|
3514
|
+
i.addChild((e.te = n));
|
|
3515
|
+
cleanup(() => i.removeChild(e.te));
|
|
3194
3516
|
return runWithOwner(e, () => {
|
|
3195
3517
|
const e = computed(t);
|
|
3196
3518
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
3197
3519
|
});
|
|
3198
3520
|
}
|
|
3199
|
-
const
|
|
3200
|
-
const
|
|
3201
|
-
let
|
|
3521
|
+
const je = Symbol();
|
|
3522
|
+
const We = createContext(null);
|
|
3523
|
+
let Re = false;
|
|
3202
3524
|
const FALSE_ACCESSOR = () => false;
|
|
3203
3525
|
const SEQUENTIAL_ACCESSOR = () => "sequential";
|
|
3204
3526
|
function isRevealController(e) {
|
|
3205
3527
|
return e instanceof RevealController;
|
|
3206
3528
|
}
|
|
3207
3529
|
function isSlotReady(e) {
|
|
3208
|
-
return isRevealController(e) ? e.isReady() : e.
|
|
3530
|
+
return isRevealController(e) ? e.isReady() : e.ct.size === 0 && !e.dt;
|
|
3209
3531
|
}
|
|
3210
3532
|
function isSlotMinimallyReady(e) {
|
|
3211
3533
|
return isRevealController(e) ? e.isMinimallyReady() : isSlotReady(e);
|
|
3212
3534
|
}
|
|
3213
3535
|
function setSlotState(e, t, n, r) {
|
|
3214
|
-
setSignal(e.
|
|
3215
|
-
setSignal(e.
|
|
3536
|
+
setSignal(e.ht, n);
|
|
3537
|
+
setSignal(e.gt, r);
|
|
3216
3538
|
if (isRevealController(e)) {
|
|
3217
|
-
if (!n && e.
|
|
3539
|
+
if (!n && e.St === t) e.St = undefined;
|
|
3218
3540
|
return e.evaluate(n, r);
|
|
3219
3541
|
}
|
|
3220
|
-
if (!n && e.
|
|
3542
|
+
if (!n && e.yt === t && e.wt) e.yt = undefined;
|
|
3221
3543
|
}
|
|
3222
3544
|
class RevealController {
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3545
|
+
_t;
|
|
3546
|
+
bt;
|
|
3547
|
+
Ot = [];
|
|
3548
|
+
St;
|
|
3549
|
+
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3550
|
+
gt = signal(false, { ownedWrite: true, ze: true });
|
|
3551
|
+
vt = true;
|
|
3552
|
+
Pt = true;
|
|
3553
|
+
xt = false;
|
|
3232
3554
|
constructor(e, t) {
|
|
3233
|
-
this.
|
|
3234
|
-
this.
|
|
3555
|
+
this._t = e;
|
|
3556
|
+
this.bt = t;
|
|
3235
3557
|
}
|
|
3236
|
-
|
|
3237
|
-
for (let t = 0; t < this.
|
|
3238
|
-
const n = this.
|
|
3239
|
-
if ((isRevealController(n) ? n.
|
|
3558
|
+
Ct(e) {
|
|
3559
|
+
for (let t = 0; t < this.Ot.length; t++) {
|
|
3560
|
+
const n = this.Ot[t];
|
|
3561
|
+
if ((isRevealController(n) ? n.St : n.yt) !== this) continue;
|
|
3240
3562
|
if (e(n) === false) return false;
|
|
3241
3563
|
}
|
|
3242
3564
|
return true;
|
|
3243
3565
|
}
|
|
3244
3566
|
isReady() {
|
|
3245
|
-
return this.
|
|
3567
|
+
return this.Ct(isSlotReady);
|
|
3246
3568
|
}
|
|
3247
3569
|
isMinimallyReady() {
|
|
3248
|
-
const e = untrack(this.
|
|
3570
|
+
const e = untrack(this._t);
|
|
3249
3571
|
if (e === "together") return this.isReady();
|
|
3250
3572
|
if (e === "natural") {
|
|
3251
3573
|
let e = false;
|
|
3252
3574
|
let t = false;
|
|
3253
|
-
this.
|
|
3575
|
+
this.Ct(n => {
|
|
3254
3576
|
e = true;
|
|
3255
3577
|
if (isSlotMinimallyReady(n)) {
|
|
3256
3578
|
t = true;
|
|
@@ -3260,58 +3582,58 @@ class RevealController {
|
|
|
3260
3582
|
return !e || t;
|
|
3261
3583
|
}
|
|
3262
3584
|
let t = true;
|
|
3263
|
-
this.
|
|
3585
|
+
this.Ct(e => {
|
|
3264
3586
|
t = isSlotMinimallyReady(e);
|
|
3265
3587
|
return false;
|
|
3266
3588
|
});
|
|
3267
3589
|
return t;
|
|
3268
3590
|
}
|
|
3269
3591
|
register(e) {
|
|
3270
|
-
if (this.
|
|
3271
|
-
this.
|
|
3272
|
-
const t = untrack(this.
|
|
3273
|
-
(setSignal(e.
|
|
3592
|
+
if (this.Ot.includes(e)) return;
|
|
3593
|
+
this.Ot.push(e);
|
|
3594
|
+
const t = untrack(this._t);
|
|
3595
|
+
(setSignal(e.ht, true), setSignal(e.gt, t === "sequential" ? !!untrack(this.bt) : false));
|
|
3274
3596
|
untrack(() => this.evaluate());
|
|
3275
3597
|
}
|
|
3276
3598
|
unregister(e) {
|
|
3277
|
-
const t = this.
|
|
3278
|
-
if (t >= 0) this.
|
|
3599
|
+
const t = this.Ot.indexOf(e);
|
|
3600
|
+
if (t >= 0) this.Ot.splice(t, 1);
|
|
3279
3601
|
untrack(() => this.evaluate());
|
|
3280
3602
|
}
|
|
3281
3603
|
evaluate(e, t) {
|
|
3282
|
-
if (this.
|
|
3283
|
-
this.
|
|
3284
|
-
const n = this.
|
|
3285
|
-
const r = this.
|
|
3604
|
+
if (this.xt) return;
|
|
3605
|
+
this.xt = true;
|
|
3606
|
+
const n = this.vt;
|
|
3607
|
+
const r = this.Pt;
|
|
3286
3608
|
try {
|
|
3287
|
-
const n = e ?? read(this.
|
|
3288
|
-
r = untrack(this.
|
|
3289
|
-
i = r === "sequential" && !!untrack(this.
|
|
3609
|
+
const n = e ?? read(this.ht),
|
|
3610
|
+
r = untrack(this._t),
|
|
3611
|
+
i = r === "sequential" && !!untrack(this.bt),
|
|
3290
3612
|
s = t ?? i;
|
|
3291
3613
|
if (n) {
|
|
3292
|
-
this.
|
|
3614
|
+
this.Ct(e => setSlotState(e, this, true, s));
|
|
3293
3615
|
} else if (r === "natural") {
|
|
3294
|
-
this.
|
|
3616
|
+
this.Ct(e => {
|
|
3295
3617
|
if (isRevealController(e)) {
|
|
3296
|
-
setSignal(e.
|
|
3297
|
-
setSignal(e.
|
|
3618
|
+
setSignal(e.gt, false);
|
|
3619
|
+
setSignal(e.ht, false);
|
|
3298
3620
|
e.evaluate(false, false);
|
|
3299
3621
|
} else {
|
|
3300
3622
|
setSlotState(e, this, !isSlotReady(e), false);
|
|
3301
3623
|
}
|
|
3302
3624
|
});
|
|
3303
3625
|
} else if (r === "together") {
|
|
3304
|
-
const e = this.
|
|
3305
|
-
this.
|
|
3626
|
+
const e = this.Ct(isSlotMinimallyReady);
|
|
3627
|
+
this.Ct(t => setSlotState(t, this, !e, false));
|
|
3306
3628
|
} else {
|
|
3307
3629
|
let e = false;
|
|
3308
|
-
this.
|
|
3630
|
+
this.Ct(t => {
|
|
3309
3631
|
if (e) return setSlotState(t, this, true, i);
|
|
3310
3632
|
if (isSlotReady(t)) return setSlotState(t, this, false, false);
|
|
3311
3633
|
e = true;
|
|
3312
3634
|
if (isRevealController(t)) {
|
|
3313
|
-
setSignal(t.
|
|
3314
|
-
setSignal(t.
|
|
3635
|
+
setSignal(t.gt, false);
|
|
3636
|
+
setSignal(t.ht, false);
|
|
3315
3637
|
t.evaluate(false, false);
|
|
3316
3638
|
} else {
|
|
3317
3639
|
setSlotState(t, this, true, false);
|
|
@@ -3319,92 +3641,92 @@ class RevealController {
|
|
|
3319
3641
|
});
|
|
3320
3642
|
}
|
|
3321
3643
|
} finally {
|
|
3322
|
-
this.
|
|
3323
|
-
this.
|
|
3324
|
-
this.
|
|
3644
|
+
this.vt = this.isReady();
|
|
3645
|
+
this.Pt = this.isMinimallyReady();
|
|
3646
|
+
this.xt = false;
|
|
3325
3647
|
}
|
|
3326
|
-
if (this.
|
|
3648
|
+
if (this.St && (n !== this.vt || r !== this.Pt)) this.St.evaluate();
|
|
3327
3649
|
}
|
|
3328
3650
|
}
|
|
3329
3651
|
class CollectionQueue extends Queue {
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3652
|
+
Nt;
|
|
3653
|
+
ct = new Set();
|
|
3654
|
+
Et;
|
|
3655
|
+
dt = true;
|
|
3656
|
+
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3657
|
+
gt = signal(false, { ownedWrite: true, ze: true });
|
|
3658
|
+
yt;
|
|
3659
|
+
wt = false;
|
|
3660
|
+
kt;
|
|
3661
|
+
jt = je;
|
|
3340
3662
|
constructor(e) {
|
|
3341
3663
|
super();
|
|
3342
|
-
this.
|
|
3664
|
+
this.Nt = e;
|
|
3343
3665
|
}
|
|
3344
3666
|
run(e) {
|
|
3345
|
-
if (!e || (read(this.
|
|
3667
|
+
if (!e || (read(this.ht) && (!Re || read(this.gt)))) return;
|
|
3346
3668
|
return super.run(e);
|
|
3347
3669
|
}
|
|
3348
3670
|
notify(e, t, n, r) {
|
|
3349
|
-
if (!(t & this.
|
|
3350
|
-
if (this.
|
|
3671
|
+
if (!(t & this.Nt)) return super.notify(e, t, n, r);
|
|
3672
|
+
if (this.wt && this.kt) {
|
|
3351
3673
|
const e = untrack(() => {
|
|
3352
3674
|
try {
|
|
3353
|
-
return this.
|
|
3675
|
+
return this.kt();
|
|
3354
3676
|
} catch {
|
|
3355
|
-
return
|
|
3677
|
+
return je;
|
|
3356
3678
|
}
|
|
3357
3679
|
});
|
|
3358
|
-
if (e !== this.
|
|
3359
|
-
this.
|
|
3360
|
-
this.
|
|
3361
|
-
this.
|
|
3680
|
+
if (e !== this.jt) {
|
|
3681
|
+
this.jt = e;
|
|
3682
|
+
this.wt = false;
|
|
3683
|
+
this.ct.clear();
|
|
3362
3684
|
}
|
|
3363
3685
|
}
|
|
3364
|
-
if (this.
|
|
3365
|
-
if (this.
|
|
3366
|
-
return super.notify(e,
|
|
3686
|
+
if (this.Nt & m && this.wt) return super.notify(e, t, n, r);
|
|
3687
|
+
if (this.Nt & m && n & _) {
|
|
3688
|
+
return super.notify(e, _, n, r);
|
|
3367
3689
|
}
|
|
3368
|
-
if (n & this.
|
|
3369
|
-
this.
|
|
3370
|
-
const t = r?.source || e.
|
|
3690
|
+
if (n & this.Nt) {
|
|
3691
|
+
this.dt = true;
|
|
3692
|
+
const t = r?.source || e.we?.source;
|
|
3371
3693
|
if (t) {
|
|
3372
|
-
const e = this.
|
|
3373
|
-
this.
|
|
3374
|
-
if (e) setSignal(this.
|
|
3694
|
+
const e = this.ct.size === 0;
|
|
3695
|
+
this.ct.add(t);
|
|
3696
|
+
if (e) setSignal(this.ht, true);
|
|
3375
3697
|
}
|
|
3376
3698
|
}
|
|
3377
|
-
t &= ~this.
|
|
3699
|
+
t &= ~this.Nt;
|
|
3378
3700
|
return t ? super.notify(e, t, n, r) : true;
|
|
3379
3701
|
}
|
|
3380
3702
|
checkSources() {
|
|
3381
|
-
for (const e of this.
|
|
3382
|
-
if (e.m & u || (!(e.
|
|
3703
|
+
for (const e of this.ct) {
|
|
3704
|
+
if (e.m & u || (!(e.be & this.Nt) && !(this.Nt & _ && e.be & m))) this.ct.delete(e);
|
|
3383
3705
|
}
|
|
3384
|
-
if (!this.
|
|
3385
|
-
if (this.
|
|
3386
|
-
this.
|
|
3706
|
+
if (!this.ct.size) {
|
|
3707
|
+
if (this.Nt & m && this.dt && !this.wt && this.Et) {
|
|
3708
|
+
this.dt = !!(this.Et.be & this.Nt);
|
|
3387
3709
|
} else {
|
|
3388
|
-
this.
|
|
3710
|
+
this.dt = false;
|
|
3389
3711
|
}
|
|
3390
|
-
if (!this.
|
|
3391
|
-
setSignal(this.
|
|
3392
|
-
if (this.
|
|
3712
|
+
if (!this.dt) {
|
|
3713
|
+
setSignal(this.ht, false);
|
|
3714
|
+
if (this.kt) {
|
|
3393
3715
|
try {
|
|
3394
|
-
this.
|
|
3716
|
+
this.jt = untrack(() => this.kt());
|
|
3395
3717
|
} catch {}
|
|
3396
3718
|
}
|
|
3397
3719
|
}
|
|
3398
3720
|
}
|
|
3399
|
-
if (
|
|
3721
|
+
if (Re) this.yt?.evaluate();
|
|
3400
3722
|
}
|
|
3401
3723
|
}
|
|
3402
3724
|
function createCollectionBoundary(e, t, n, r) {
|
|
3403
3725
|
const i = createOwner();
|
|
3404
|
-
if (
|
|
3726
|
+
if (Re) setContext(We, null, i);
|
|
3405
3727
|
const s = new CollectionQueue(e);
|
|
3406
|
-
if (r) s.
|
|
3407
|
-
const o = (s.
|
|
3728
|
+
if (r) s.kt = r;
|
|
3729
|
+
const o = (s.Et = createBoundChildren(i, t, s, e));
|
|
3408
3730
|
untrack(() => {
|
|
3409
3731
|
let t = false;
|
|
3410
3732
|
try {
|
|
@@ -3413,46 +3735,46 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3413
3735
|
if (e instanceof NotReadyError) t = true;
|
|
3414
3736
|
else throw e;
|
|
3415
3737
|
}
|
|
3416
|
-
s.
|
|
3738
|
+
s.dt = t || !!(o.be & e) || o.we instanceof NotReadyError;
|
|
3417
3739
|
});
|
|
3418
|
-
const u =
|
|
3740
|
+
const u = Re && e === m ? getContext(We) : null;
|
|
3419
3741
|
if (u) {
|
|
3420
|
-
s.
|
|
3742
|
+
s.yt = u;
|
|
3421
3743
|
u.register(s);
|
|
3422
3744
|
cleanup(() => u.unregister(s));
|
|
3423
3745
|
}
|
|
3424
3746
|
return accessor(
|
|
3425
3747
|
computed(() => {
|
|
3426
|
-
if (!read(s.
|
|
3748
|
+
if (!read(s.ht)) {
|
|
3427
3749
|
const e = read(o);
|
|
3428
|
-
if (!untrack(() => read(s.
|
|
3750
|
+
if (!untrack(() => read(s.ht))) return ((s.wt = true), e);
|
|
3429
3751
|
}
|
|
3430
|
-
if (
|
|
3752
|
+
if (Re && read(s.gt)) return undefined;
|
|
3431
3753
|
return n(s);
|
|
3432
3754
|
})
|
|
3433
3755
|
);
|
|
3434
3756
|
}
|
|
3435
3757
|
function createLoadingBoundary(e, t, n) {
|
|
3436
|
-
return createCollectionBoundary(
|
|
3758
|
+
return createCollectionBoundary(m, e, () => t(), n?.on);
|
|
3437
3759
|
}
|
|
3438
3760
|
function createErrorBoundary(e, t) {
|
|
3439
|
-
return createCollectionBoundary(
|
|
3440
|
-
let n = e.
|
|
3441
|
-
const r = n.
|
|
3761
|
+
return createCollectionBoundary(_, e, e => {
|
|
3762
|
+
let n = e.ct.values().next().value;
|
|
3763
|
+
const r = n.we?.cause ?? n.we;
|
|
3442
3764
|
return t(r, () => {
|
|
3443
|
-
for (const t of e.
|
|
3765
|
+
for (const t of e.ct) recompute(t);
|
|
3444
3766
|
schedule();
|
|
3445
3767
|
});
|
|
3446
3768
|
});
|
|
3447
3769
|
}
|
|
3448
3770
|
function createRevealOrder(e, t) {
|
|
3449
|
-
|
|
3771
|
+
Re = true;
|
|
3450
3772
|
const n = createOwner();
|
|
3451
|
-
const r = getContext(
|
|
3773
|
+
const r = getContext(We);
|
|
3452
3774
|
const i = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3453
3775
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3454
3776
|
const o = new RevealController(i, s);
|
|
3455
|
-
setContext(
|
|
3777
|
+
setContext(We, o, n);
|
|
3456
3778
|
return runWithOwner(n, () => {
|
|
3457
3779
|
const t = e();
|
|
3458
3780
|
computed(() => {
|
|
@@ -3461,7 +3783,7 @@ function createRevealOrder(e, t) {
|
|
|
3461
3783
|
o.evaluate();
|
|
3462
3784
|
});
|
|
3463
3785
|
if (r) {
|
|
3464
|
-
o.
|
|
3786
|
+
o.St = r;
|
|
3465
3787
|
r.register(o);
|
|
3466
3788
|
cleanup(() => r.unregister(o));
|
|
3467
3789
|
}
|
|
@@ -3517,16 +3839,16 @@ function flattenArray(e, t = [], n) {
|
|
|
3517
3839
|
if (r) throw r;
|
|
3518
3840
|
return i;
|
|
3519
3841
|
}
|
|
3520
|
-
const
|
|
3521
|
-
exports.$PROXY =
|
|
3522
|
-
exports.$REFRESH =
|
|
3523
|
-
exports.$TARGET =
|
|
3524
|
-
exports.$TRACK =
|
|
3842
|
+
const Ae = undefined;
|
|
3843
|
+
exports.$PROXY = fe;
|
|
3844
|
+
exports.$REFRESH = j;
|
|
3845
|
+
exports.$TARGET = le;
|
|
3846
|
+
exports.$TRACK = ue;
|
|
3525
3847
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3526
|
-
exports.DEV =
|
|
3848
|
+
exports.DEV = Ae;
|
|
3527
3849
|
exports.NoOwnerError = NoOwnerError;
|
|
3528
3850
|
exports.NotReadyError = NotReadyError;
|
|
3529
|
-
exports.SUPPORTS_PROXY =
|
|
3851
|
+
exports.SUPPORTS_PROXY = E;
|
|
3530
3852
|
exports.action = action;
|
|
3531
3853
|
exports.clearSnapshots = clearSnapshots;
|
|
3532
3854
|
exports.createContext = createContext;
|
|
@@ -3576,5 +3898,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3576
3898
|
exports.setContext = setContext;
|
|
3577
3899
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3578
3900
|
exports.snapshot = snapshot;
|
|
3579
|
-
exports.storePath =
|
|
3901
|
+
exports.storePath = Ce;
|
|
3580
3902
|
exports.untrack = untrack;
|