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