@solidjs/signals 0.9.8 → 0.9.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/dist/dev.js +442 -184
- package/dist/node.cjs +1198 -959
- package/dist/prod.js +1000 -767
- package/dist/types/boundaries.d.ts +3 -2
- package/dist/types/core/core.d.ts +4 -2
- package/dist/types/core/error.d.ts +6 -2
- package/dist/types/core/scheduler.d.ts +67 -16
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
class NotReadyError extends Error {
|
|
3
|
-
|
|
3
|
+
t;
|
|
4
4
|
constructor(e) {
|
|
5
5
|
super();
|
|
6
|
-
this.
|
|
6
|
+
this.t = e;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
class StatusError extends Error {
|
|
10
|
+
t;
|
|
11
|
+
constructor(e, t) {
|
|
12
|
+
super(t instanceof Error ? t.message : String(t), { cause: t });
|
|
13
|
+
this.t = e;
|
|
7
14
|
}
|
|
8
15
|
}
|
|
9
16
|
class NoOwnerError extends Error {
|
|
@@ -24,258 +31,329 @@ const i = 1 << 3;
|
|
|
24
31
|
const s = 1 << 4;
|
|
25
32
|
const o = 1 << 5;
|
|
26
33
|
const u = 1 << 6;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const c = 1 <<
|
|
30
|
-
const a = 1 <<
|
|
31
|
-
const d = 1
|
|
32
|
-
const p =
|
|
33
|
-
const h =
|
|
34
|
-
const y =
|
|
35
|
-
const g =
|
|
36
|
-
const w =
|
|
37
|
-
const S =
|
|
38
|
-
const m = Symbol("refresh");
|
|
34
|
+
const f = 1 << 7;
|
|
35
|
+
const l = 1 << 0;
|
|
36
|
+
const c = 1 << 1;
|
|
37
|
+
const a = 1 << 2;
|
|
38
|
+
const d = 1;
|
|
39
|
+
const p = 2;
|
|
40
|
+
const h = 3;
|
|
41
|
+
const y = {};
|
|
42
|
+
const g = typeof Proxy === "function";
|
|
43
|
+
const w = {};
|
|
44
|
+
const S = Symbol("refresh");
|
|
39
45
|
function actualInsertIntoHeap(e, t) {
|
|
40
|
-
const n = (e.i
|
|
41
|
-
if (n >= e.
|
|
42
|
-
const r = e.
|
|
43
|
-
const i = t.
|
|
44
|
-
if (i === undefined) t.
|
|
46
|
+
const n = (e.o?.i ? e.o.l?.u : e.o?.u) ?? -1;
|
|
47
|
+
if (n >= e.u) e.u = n + 1;
|
|
48
|
+
const r = e.u;
|
|
49
|
+
const i = t.p[r];
|
|
50
|
+
if (i === undefined) t.p[r] = e;
|
|
45
51
|
else {
|
|
46
|
-
const t = i.
|
|
47
|
-
t.
|
|
48
|
-
e.
|
|
49
|
-
i.
|
|
52
|
+
const t = i.h;
|
|
53
|
+
t.S = e;
|
|
54
|
+
e.h = t;
|
|
55
|
+
i.h = e;
|
|
50
56
|
}
|
|
51
|
-
if (r > t.
|
|
57
|
+
if (r > t.m) t.m = r;
|
|
52
58
|
}
|
|
53
59
|
function insertIntoHeap(e, o) {
|
|
54
|
-
let u = e.
|
|
60
|
+
let u = e._;
|
|
55
61
|
if (u & (i | r)) return;
|
|
56
62
|
if (u & t) {
|
|
57
|
-
e.
|
|
58
|
-
} else e.
|
|
63
|
+
e._ = (u & -4) | n | i;
|
|
64
|
+
} else e._ = u | i;
|
|
59
65
|
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
60
66
|
}
|
|
61
67
|
function insertIntoHeapHeight(e, t) {
|
|
62
|
-
let n = e.
|
|
68
|
+
let n = e._;
|
|
63
69
|
if (n & (i | r | s)) return;
|
|
64
|
-
e.
|
|
70
|
+
e._ = n | s;
|
|
65
71
|
actualInsertIntoHeap(e, t);
|
|
66
72
|
}
|
|
67
73
|
function deleteFromHeap(e, t) {
|
|
68
|
-
const n = e.
|
|
74
|
+
const n = e._;
|
|
69
75
|
if (!(n & (i | s))) return;
|
|
70
|
-
e.
|
|
71
|
-
const r = e.
|
|
72
|
-
if (e.
|
|
76
|
+
e._ = n & -25;
|
|
77
|
+
const r = e.u;
|
|
78
|
+
if (e.h === e) t.p[r] = undefined;
|
|
73
79
|
else {
|
|
74
|
-
const n = e.
|
|
75
|
-
const i = t.
|
|
80
|
+
const n = e.S;
|
|
81
|
+
const i = t.p[r];
|
|
76
82
|
const s = n ?? i;
|
|
77
|
-
if (e === i) t.
|
|
78
|
-
else e.
|
|
79
|
-
s.
|
|
83
|
+
if (e === i) t.p[r] = n;
|
|
84
|
+
else e.h.S = n;
|
|
85
|
+
s.h = e.h;
|
|
80
86
|
}
|
|
81
|
-
e.
|
|
82
|
-
e.
|
|
87
|
+
e.h = e;
|
|
88
|
+
e.S = undefined;
|
|
83
89
|
}
|
|
84
90
|
function markHeap(e) {
|
|
85
|
-
if (e.
|
|
86
|
-
e.
|
|
87
|
-
for (let t = 0; t <= e.
|
|
88
|
-
for (let n = e.
|
|
89
|
-
if (n.
|
|
91
|
+
if (e.O) return;
|
|
92
|
+
e.O = true;
|
|
93
|
+
for (let t = 0; t <= e.m; t++) {
|
|
94
|
+
for (let n = e.p[t]; n !== undefined; n = n.S) {
|
|
95
|
+
if (n._ & i) markNode(n);
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
function markNode(e, r = n) {
|
|
94
|
-
const i = e.
|
|
100
|
+
const i = e._;
|
|
95
101
|
if ((i & (t | n)) >= r) return;
|
|
96
|
-
e.
|
|
97
|
-
for (let n = e.
|
|
98
|
-
markNode(n.
|
|
99
|
-
}
|
|
100
|
-
if (e.
|
|
101
|
-
for (let n = e.
|
|
102
|
-
for (let e = n.
|
|
103
|
-
markNode(e.
|
|
102
|
+
e._ = (i & -4) | r;
|
|
103
|
+
for (let n = e.P; n !== null; n = n.C) {
|
|
104
|
+
markNode(n.k, t);
|
|
105
|
+
}
|
|
106
|
+
if (e.A !== null) {
|
|
107
|
+
for (let n = e.A; n !== null; n = n.W) {
|
|
108
|
+
for (let e = n.P; e !== null; e = e.C) {
|
|
109
|
+
markNode(e.k, t);
|
|
104
110
|
}
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
function runHeap(e, t) {
|
|
109
|
-
e.
|
|
110
|
-
for (e.
|
|
111
|
-
let n = e.
|
|
115
|
+
e.O = false;
|
|
116
|
+
for (e.j = 0; e.j <= e.m; e.j++) {
|
|
117
|
+
let n = e.p[e.j];
|
|
112
118
|
while (n !== undefined) {
|
|
113
|
-
if (n.
|
|
119
|
+
if (n._ & i) t(n);
|
|
114
120
|
else adjustHeight(n, e);
|
|
115
|
-
n = e.
|
|
121
|
+
n = e.p[e.j];
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
|
-
e.
|
|
124
|
+
e.m = 0;
|
|
119
125
|
}
|
|
120
126
|
function adjustHeight(e, t) {
|
|
121
127
|
deleteFromHeap(e, t);
|
|
122
|
-
let n = e.
|
|
123
|
-
for (let t = e.
|
|
124
|
-
const e = t.
|
|
125
|
-
const r = e.
|
|
126
|
-
if (r.R && r.
|
|
128
|
+
let n = e.u;
|
|
129
|
+
for (let t = e.N; t; t = t.L) {
|
|
130
|
+
const e = t.I;
|
|
131
|
+
const r = e.H || e;
|
|
132
|
+
if (r.R && r.u >= n) n = r.u + 1;
|
|
127
133
|
}
|
|
128
|
-
if (e.
|
|
129
|
-
e.
|
|
130
|
-
for (let n = e.
|
|
131
|
-
insertIntoHeapHeight(n.
|
|
134
|
+
if (e.u !== n) {
|
|
135
|
+
e.u = n;
|
|
136
|
+
for (let n = e.P; n !== null; n = n.C) {
|
|
137
|
+
insertIntoHeapHeight(n.k, t);
|
|
132
138
|
}
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
|
-
const
|
|
136
|
-
const _ = {
|
|
137
|
-
const
|
|
138
|
-
let
|
|
139
|
-
let
|
|
141
|
+
const m = new Set();
|
|
142
|
+
const _ = { p: new Array(2e3).fill(undefined), O: false, j: 0, m: 0 };
|
|
143
|
+
const b = { p: new Array(2e3).fill(undefined), O: false, j: 0, m: 0 };
|
|
144
|
+
let O = 0;
|
|
145
|
+
let x = null;
|
|
146
|
+
let v = false;
|
|
140
147
|
let P = false;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
const C = new WeakMap();
|
|
149
|
+
const k = new Set();
|
|
150
|
+
let A = null;
|
|
151
|
+
function setCurrentOptimisticLane(e) {
|
|
152
|
+
A = e;
|
|
153
|
+
}
|
|
154
|
+
function getOrCreateLane(e) {
|
|
155
|
+
let t = C.get(e);
|
|
156
|
+
if (t) {
|
|
157
|
+
return findLane(t);
|
|
158
|
+
}
|
|
159
|
+
const n = e.T;
|
|
160
|
+
const r = n?.M ? findLane(n.M) : null;
|
|
161
|
+
t = { t: e, q: new Set(), F: [[], []], V: null, B: x, D: r };
|
|
162
|
+
C.set(e, t);
|
|
163
|
+
k.add(t);
|
|
164
|
+
e.G = e.K || 0;
|
|
165
|
+
return t;
|
|
166
|
+
}
|
|
167
|
+
function findLane(e) {
|
|
168
|
+
while (e.V) e = e.V;
|
|
169
|
+
return e;
|
|
170
|
+
}
|
|
171
|
+
function mergeLanes(e, t) {
|
|
172
|
+
e = findLane(e);
|
|
173
|
+
t = findLane(t);
|
|
174
|
+
if (e === t) return e;
|
|
175
|
+
t.V = e;
|
|
176
|
+
for (const n of t.q) e.q.add(n);
|
|
177
|
+
e.F[0].push(...t.F[0]);
|
|
178
|
+
e.F[1].push(...t.F[1]);
|
|
179
|
+
return e;
|
|
180
|
+
}
|
|
181
|
+
function clearLaneEntry(e) {
|
|
182
|
+
C.delete(e);
|
|
183
|
+
}
|
|
184
|
+
function resolveLane(e) {
|
|
185
|
+
const t = e.M;
|
|
186
|
+
if (!t) return undefined;
|
|
187
|
+
const n = findLane(t);
|
|
188
|
+
if (k.has(n)) return n;
|
|
189
|
+
e.M = undefined;
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
function hasActiveOverride(e) {
|
|
193
|
+
return !!(e.U && e.J !== y);
|
|
194
|
+
}
|
|
195
|
+
function assignOrMergeLane(e, t) {
|
|
196
|
+
const n = findLane(t);
|
|
197
|
+
const r = e.M;
|
|
198
|
+
if (r) {
|
|
199
|
+
if (r.V) {
|
|
200
|
+
e.M = t;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const i = findLane(r);
|
|
204
|
+
if (k.has(i)) {
|
|
205
|
+
if (i !== n && !hasActiveOverride(e)) {
|
|
206
|
+
if (n.D && findLane(n.D) === i) {
|
|
207
|
+
e.M = t;
|
|
208
|
+
} else if (i.D && findLane(i.D) === n);
|
|
209
|
+
else {
|
|
210
|
+
mergeLanes(n, i);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
e.M = t;
|
|
217
|
+
}
|
|
218
|
+
function runLaneEffects(e) {
|
|
219
|
+
for (const t of k) {
|
|
220
|
+
if (t.V || t.q.size > 0) continue;
|
|
221
|
+
const n = t.F[e - 1];
|
|
222
|
+
if (n.length) {
|
|
223
|
+
t.F[e - 1] = [];
|
|
224
|
+
runQueue(n, e);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
145
227
|
}
|
|
146
228
|
function setProjectionWriteActive(e) {
|
|
147
|
-
|
|
229
|
+
P = e;
|
|
148
230
|
}
|
|
149
231
|
function schedule() {
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
if (!
|
|
232
|
+
if (v) return;
|
|
233
|
+
v = true;
|
|
234
|
+
if (!E.X) queueMicrotask(flush);
|
|
153
235
|
}
|
|
154
236
|
class Queue {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
created = x;
|
|
237
|
+
o = null;
|
|
238
|
+
Y = [[], []];
|
|
239
|
+
Z = [];
|
|
240
|
+
created = O;
|
|
160
241
|
addChild(e) {
|
|
161
|
-
this.
|
|
162
|
-
e.
|
|
242
|
+
this.Z.push(e);
|
|
243
|
+
e.o = this;
|
|
163
244
|
}
|
|
164
245
|
removeChild(e) {
|
|
165
|
-
const t = this.
|
|
246
|
+
const t = this.Z.indexOf(e);
|
|
166
247
|
if (t >= 0) {
|
|
167
|
-
this.
|
|
168
|
-
e.
|
|
248
|
+
this.Z.splice(t, 1);
|
|
249
|
+
e.o = null;
|
|
169
250
|
}
|
|
170
251
|
}
|
|
171
|
-
notify(e, t, n) {
|
|
172
|
-
if (this.
|
|
252
|
+
notify(e, t, n, r) {
|
|
253
|
+
if (this.o) return this.o.notify(e, t, n, r);
|
|
173
254
|
return false;
|
|
174
255
|
}
|
|
175
|
-
M(e, t, n) {
|
|
176
|
-
if (t[e - 1].length) {
|
|
177
|
-
const n = t[e - 1];
|
|
178
|
-
t[e - 1] = [];
|
|
179
|
-
runQueue(n, e);
|
|
180
|
-
}
|
|
181
|
-
for (let t = 0; t < this.V.length; t++) {
|
|
182
|
-
this.V[t][n]?.(e);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
256
|
run(e) {
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
257
|
+
if (this.Y[e - 1].length) {
|
|
258
|
+
const t = this.Y[e - 1];
|
|
259
|
+
this.Y[e - 1] = [];
|
|
260
|
+
runQueue(t, e);
|
|
261
|
+
}
|
|
262
|
+
for (let t = 0; t < this.Z.length; t++) this.Z[t].run?.(e);
|
|
190
263
|
}
|
|
191
264
|
enqueue(e, t) {
|
|
192
265
|
if (e) {
|
|
193
|
-
|
|
194
|
-
|
|
266
|
+
if (A) {
|
|
267
|
+
const n = findLane(A);
|
|
268
|
+
n.F[e - 1].push(t);
|
|
269
|
+
} else {
|
|
270
|
+
this.Y[e - 1].push(t);
|
|
271
|
+
}
|
|
195
272
|
}
|
|
196
273
|
schedule();
|
|
197
274
|
}
|
|
198
275
|
stashQueues(e) {
|
|
199
|
-
e.
|
|
200
|
-
e.
|
|
201
|
-
this.
|
|
202
|
-
for (let t = 0; t < this.
|
|
203
|
-
let n = this.
|
|
204
|
-
let r = e.
|
|
276
|
+
e.Y[0].push(...this.Y[0]);
|
|
277
|
+
e.Y[1].push(...this.Y[1]);
|
|
278
|
+
this.Y = [[], []];
|
|
279
|
+
for (let t = 0; t < this.Z.length; t++) {
|
|
280
|
+
let n = this.Z[t];
|
|
281
|
+
let r = e.Z[t];
|
|
205
282
|
if (!r) {
|
|
206
|
-
r = {
|
|
207
|
-
e.
|
|
283
|
+
r = { Y: [[], []], Z: [] };
|
|
284
|
+
e.Z[t] = r;
|
|
208
285
|
}
|
|
209
286
|
n.stashQueues(r);
|
|
210
287
|
}
|
|
211
288
|
}
|
|
212
289
|
restoreQueues(e) {
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
for (let t = 0; t < e.
|
|
216
|
-
const n = e.
|
|
217
|
-
let r = this.
|
|
290
|
+
this.Y[0].push(...e.Y[0]);
|
|
291
|
+
this.Y[1].push(...e.Y[1]);
|
|
292
|
+
for (let t = 0; t < e.Z.length; t++) {
|
|
293
|
+
const n = e.Z[t];
|
|
294
|
+
let r = this.Z[t];
|
|
218
295
|
if (r) r.restoreQueues(n);
|
|
219
296
|
}
|
|
220
297
|
}
|
|
221
298
|
}
|
|
222
299
|
class GlobalQueue extends Queue {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
static
|
|
228
|
-
static
|
|
229
|
-
static
|
|
300
|
+
X = false;
|
|
301
|
+
$ = [];
|
|
302
|
+
ee = [];
|
|
303
|
+
te = new Set();
|
|
304
|
+
static ne;
|
|
305
|
+
static re;
|
|
306
|
+
static ie = null;
|
|
230
307
|
flush() {
|
|
231
|
-
if (this.
|
|
232
|
-
this.
|
|
308
|
+
if (this.X) return;
|
|
309
|
+
this.X = true;
|
|
233
310
|
try {
|
|
234
|
-
runHeap(_, GlobalQueue.
|
|
235
|
-
if (
|
|
236
|
-
const e = transitionComplete(
|
|
311
|
+
runHeap(_, GlobalQueue.ne);
|
|
312
|
+
if (x) {
|
|
313
|
+
const e = transitionComplete(x);
|
|
237
314
|
if (!e) {
|
|
238
|
-
let e =
|
|
239
|
-
runHeap(
|
|
240
|
-
this
|
|
241
|
-
this.
|
|
242
|
-
this.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
this.stashQueues(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
315
|
+
let e = x;
|
|
316
|
+
runHeap(b, GlobalQueue.ne);
|
|
317
|
+
this.$ = [];
|
|
318
|
+
this.ee = [];
|
|
319
|
+
this.te = new Set();
|
|
320
|
+
runLaneEffects(d);
|
|
321
|
+
runLaneEffects(p);
|
|
322
|
+
this.stashQueues(x.se);
|
|
323
|
+
O++;
|
|
324
|
+
v = _.m >= _.j;
|
|
325
|
+
reassignPendingTransition(x.$);
|
|
326
|
+
x = null;
|
|
250
327
|
finalizePureQueue(null, true);
|
|
251
328
|
return;
|
|
252
329
|
}
|
|
253
|
-
this
|
|
254
|
-
this.restoreQueues(
|
|
255
|
-
|
|
256
|
-
const t =
|
|
257
|
-
|
|
258
|
-
|
|
330
|
+
this.$ !== x.$ && this.$.push(...x.$);
|
|
331
|
+
this.restoreQueues(x.se);
|
|
332
|
+
m.delete(x);
|
|
333
|
+
const t = x;
|
|
334
|
+
x = null;
|
|
335
|
+
reassignPendingTransition(this.$);
|
|
259
336
|
finalizePureQueue(t);
|
|
260
337
|
} else {
|
|
261
|
-
if (
|
|
338
|
+
if (m.size) runHeap(b, GlobalQueue.ne);
|
|
262
339
|
finalizePureQueue();
|
|
263
340
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
341
|
+
O++;
|
|
342
|
+
v = _.m >= _.j;
|
|
343
|
+
runLaneEffects(d);
|
|
344
|
+
this.run(d);
|
|
345
|
+
runLaneEffects(p);
|
|
267
346
|
this.run(p);
|
|
268
|
-
this.runOptimistic(h);
|
|
269
|
-
this.run(h);
|
|
270
347
|
} finally {
|
|
271
|
-
this.
|
|
348
|
+
this.X = false;
|
|
272
349
|
}
|
|
273
350
|
}
|
|
274
|
-
notify(e, t, n) {
|
|
275
|
-
if (t &
|
|
276
|
-
if (n &
|
|
277
|
-
|
|
278
|
-
|
|
351
|
+
notify(e, t, n, r) {
|
|
352
|
+
if (t & l) {
|
|
353
|
+
if (n & l) {
|
|
354
|
+
const t = r !== undefined ? r : e.oe;
|
|
355
|
+
if (x && t && !x.ue.includes(t.t)) {
|
|
356
|
+
x.ue.push(t.t);
|
|
279
357
|
schedule();
|
|
280
358
|
}
|
|
281
359
|
}
|
|
@@ -285,146 +363,184 @@ class GlobalQueue extends Queue {
|
|
|
285
363
|
}
|
|
286
364
|
initTransition(e) {
|
|
287
365
|
if (e) e = currentTransition(e);
|
|
288
|
-
if (e && e ===
|
|
289
|
-
if (!e &&
|
|
290
|
-
if (!
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
366
|
+
if (e && e === x) return;
|
|
367
|
+
if (!e && x && x.fe === O) return;
|
|
368
|
+
if (!x) {
|
|
369
|
+
x = e ?? {
|
|
370
|
+
fe: O,
|
|
371
|
+
$: [],
|
|
372
|
+
ue: [],
|
|
373
|
+
ee: [],
|
|
374
|
+
te: new Set(),
|
|
375
|
+
le: [],
|
|
376
|
+
se: { Y: [[], []], Z: [] },
|
|
377
|
+
ce: false
|
|
300
378
|
};
|
|
301
379
|
} else if (e) {
|
|
302
|
-
|
|
303
|
-
e
|
|
304
|
-
|
|
305
|
-
|
|
380
|
+
const t = x;
|
|
381
|
+
t.ce = e;
|
|
382
|
+
e.le.push(...t.le);
|
|
383
|
+
for (const n of k) {
|
|
384
|
+
if (n.B === t) n.B = e;
|
|
385
|
+
}
|
|
386
|
+
e.ee.push(...t.ee);
|
|
387
|
+
for (const n of t.te) {
|
|
388
|
+
e.te.add(n);
|
|
389
|
+
}
|
|
390
|
+
m.delete(t);
|
|
391
|
+
x = e;
|
|
306
392
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
for (let e = 0; e < this
|
|
310
|
-
const t = this
|
|
311
|
-
t.
|
|
312
|
-
|
|
393
|
+
m.add(x);
|
|
394
|
+
x.fe = O;
|
|
395
|
+
for (let e = 0; e < this.$.length; e++) {
|
|
396
|
+
const t = this.$[e];
|
|
397
|
+
t.B = x;
|
|
398
|
+
x.$.push(t);
|
|
313
399
|
}
|
|
314
|
-
this
|
|
315
|
-
for (let e = 0; e < this.
|
|
316
|
-
const t = this.
|
|
317
|
-
t.
|
|
318
|
-
|
|
400
|
+
this.$ = x.$;
|
|
401
|
+
for (let e = 0; e < this.ee.length; e++) {
|
|
402
|
+
const t = this.ee[e];
|
|
403
|
+
t.B = x;
|
|
404
|
+
x.ee.push(t);
|
|
319
405
|
}
|
|
320
|
-
this.
|
|
321
|
-
for (const e of
|
|
322
|
-
|
|
406
|
+
this.ee = x.ee;
|
|
407
|
+
for (const e of k) {
|
|
408
|
+
if (!e.B) e.B = x;
|
|
323
409
|
}
|
|
324
|
-
this.
|
|
410
|
+
for (const e of this.te) x.te.add(e);
|
|
411
|
+
this.te = x.te;
|
|
325
412
|
}
|
|
326
413
|
}
|
|
327
414
|
function insertSubs(e, t = false) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
415
|
+
const n = e.M || A;
|
|
416
|
+
for (let r = e.P; r !== null; r = r.C) {
|
|
417
|
+
if (t && n) {
|
|
418
|
+
r.k._ |= f;
|
|
419
|
+
assignOrMergeLane(r.k, n);
|
|
420
|
+
} else if (t) {
|
|
421
|
+
r.k._ |= f;
|
|
422
|
+
r.k.M = undefined;
|
|
423
|
+
}
|
|
424
|
+
const e = r.k;
|
|
425
|
+
if (e.ae === h) {
|
|
426
|
+
if (!e.de) {
|
|
427
|
+
e.de = true;
|
|
428
|
+
e.pe.enqueue(p, e.he);
|
|
335
429
|
}
|
|
336
430
|
continue;
|
|
337
431
|
}
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
insertIntoHeap(
|
|
432
|
+
const i = r.k._ & o ? b : _;
|
|
433
|
+
if (i.j > r.k.u) i.j = r.k.u;
|
|
434
|
+
insertIntoHeap(r.k, i);
|
|
341
435
|
}
|
|
342
436
|
}
|
|
343
437
|
function finalizePureQueue(e = null, t = false) {
|
|
344
438
|
let n = !t;
|
|
345
|
-
if (
|
|
346
|
-
|
|
347
|
-
}
|
|
439
|
+
if (!t) checkBoundaryChildren(E);
|
|
440
|
+
if (_.m >= _.j) runHeap(_, GlobalQueue.ne);
|
|
348
441
|
if (n) {
|
|
349
|
-
const t =
|
|
442
|
+
const t = E.$;
|
|
350
443
|
for (let e = 0; e < t.length; e++) {
|
|
351
444
|
const n = t[e];
|
|
352
|
-
if (n.
|
|
353
|
-
n.
|
|
354
|
-
n.
|
|
355
|
-
if (n.
|
|
445
|
+
if (n.J !== y) {
|
|
446
|
+
n.ye = n.J;
|
|
447
|
+
n.J = y;
|
|
448
|
+
if (n.ae && n.ae !== h) n.de = true;
|
|
356
449
|
}
|
|
357
|
-
|
|
450
|
+
n.ge &= ~a;
|
|
451
|
+
if (n.R) GlobalQueue.re(n, false, true);
|
|
358
452
|
}
|
|
359
453
|
t.length = 0;
|
|
360
|
-
const n = e ? e.
|
|
454
|
+
const n = e ? e.ee : E.ee;
|
|
361
455
|
for (let e = 0; e < n.length; e++) {
|
|
362
456
|
const t = n[e];
|
|
363
|
-
const r = t.
|
|
364
|
-
|
|
365
|
-
|
|
457
|
+
const r = t.J;
|
|
458
|
+
t.M = undefined;
|
|
459
|
+
if (r !== y && t.ye !== r) {
|
|
460
|
+
t.ye = r;
|
|
366
461
|
insertSubs(t, true);
|
|
367
462
|
}
|
|
368
|
-
t.
|
|
369
|
-
t.
|
|
463
|
+
t.J = y;
|
|
464
|
+
t.B = null;
|
|
370
465
|
}
|
|
371
466
|
n.length = 0;
|
|
372
|
-
const r = e ? e.
|
|
373
|
-
if (GlobalQueue.
|
|
467
|
+
const r = e ? e.te : E.te;
|
|
468
|
+
if (GlobalQueue.ie && r.size) {
|
|
374
469
|
for (const e of r) {
|
|
375
|
-
GlobalQueue.
|
|
470
|
+
GlobalQueue.ie(e);
|
|
376
471
|
}
|
|
377
472
|
r.clear();
|
|
378
473
|
schedule();
|
|
379
474
|
}
|
|
475
|
+
for (const t of k) {
|
|
476
|
+
const n = e ? t.B === e : !t.B;
|
|
477
|
+
if (!n) continue;
|
|
478
|
+
if (!t.V) {
|
|
479
|
+
if (t.F[0].length) runQueue(t.F[0], d);
|
|
480
|
+
if (t.F[1].length) runQueue(t.F[1], p);
|
|
481
|
+
}
|
|
482
|
+
if (t.t.M === t) t.t.M = undefined;
|
|
483
|
+
t.q.clear();
|
|
484
|
+
t.F[0].length = 0;
|
|
485
|
+
t.F[1].length = 0;
|
|
486
|
+
k.delete(t);
|
|
487
|
+
C.delete(t.t);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function checkBoundaryChildren(e) {
|
|
492
|
+
for (const t of e.Z) {
|
|
493
|
+
t.checkSources?.();
|
|
494
|
+
checkBoundaryChildren(t);
|
|
380
495
|
}
|
|
381
496
|
}
|
|
382
497
|
function trackOptimisticStore(e) {
|
|
383
|
-
|
|
498
|
+
E.te.add(e);
|
|
384
499
|
schedule();
|
|
385
500
|
}
|
|
386
|
-
function
|
|
501
|
+
function reassignPendingTransition(e) {
|
|
387
502
|
for (let t = 0; t < e.length; t++) {
|
|
388
|
-
e[t].
|
|
503
|
+
e[t].B = x;
|
|
389
504
|
}
|
|
390
505
|
}
|
|
391
|
-
const
|
|
506
|
+
const E = new GlobalQueue();
|
|
392
507
|
function flush() {
|
|
393
|
-
while (
|
|
394
|
-
|
|
508
|
+
while (v) {
|
|
509
|
+
E.flush();
|
|
395
510
|
}
|
|
396
511
|
}
|
|
397
512
|
function runQueue(e, t) {
|
|
398
513
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
399
514
|
}
|
|
400
515
|
function transitionComplete(e) {
|
|
401
|
-
if (e.
|
|
402
|
-
if (e.
|
|
516
|
+
if (e.ce) return true;
|
|
517
|
+
if (e.le.length) return false;
|
|
403
518
|
let t = true;
|
|
404
|
-
for (let n = 0; n < e.
|
|
405
|
-
|
|
519
|
+
for (let n = 0; n < e.ue.length; n++) {
|
|
520
|
+
const r = e.ue[n];
|
|
521
|
+
if (r.ge & l && r.oe?.t === r) {
|
|
406
522
|
t = false;
|
|
407
523
|
break;
|
|
408
524
|
}
|
|
409
525
|
}
|
|
410
|
-
t && (e.
|
|
526
|
+
t && (e.ce = true);
|
|
411
527
|
return t;
|
|
412
528
|
}
|
|
413
529
|
function currentTransition(e) {
|
|
414
|
-
while (e.
|
|
530
|
+
while (e.ce && typeof e.ce === "object") e = e.ce;
|
|
415
531
|
return e;
|
|
416
532
|
}
|
|
417
533
|
function runInTransition(e, t) {
|
|
418
|
-
const n =
|
|
534
|
+
const n = x;
|
|
419
535
|
try {
|
|
420
|
-
|
|
536
|
+
x = currentTransition(e);
|
|
421
537
|
return t();
|
|
422
538
|
} finally {
|
|
423
|
-
|
|
539
|
+
x = n;
|
|
424
540
|
}
|
|
425
541
|
}
|
|
426
542
|
function restoreTransition(e, t) {
|
|
427
|
-
|
|
543
|
+
E.initTransition(e);
|
|
428
544
|
const n = t();
|
|
429
545
|
flush();
|
|
430
546
|
return n;
|
|
@@ -433,14 +549,14 @@ function action(e) {
|
|
|
433
549
|
return (...t) =>
|
|
434
550
|
new Promise((n, r) => {
|
|
435
551
|
const i = e(...t);
|
|
436
|
-
|
|
437
|
-
let s =
|
|
438
|
-
s.
|
|
552
|
+
E.initTransition();
|
|
553
|
+
let s = x;
|
|
554
|
+
s.le.push(i);
|
|
439
555
|
const done = (e, t) => {
|
|
440
556
|
s = currentTransition(s);
|
|
441
|
-
const o = s.
|
|
442
|
-
if (o >= 0) s.
|
|
443
|
-
|
|
557
|
+
const o = s.le.indexOf(i);
|
|
558
|
+
if (o >= 0) s.le.splice(o, 1);
|
|
559
|
+
x = s;
|
|
444
560
|
schedule();
|
|
445
561
|
t ? r(t) : n(e);
|
|
446
562
|
};
|
|
@@ -467,124 +583,168 @@ function action(e) {
|
|
|
467
583
|
step();
|
|
468
584
|
});
|
|
469
585
|
}
|
|
470
|
-
GlobalQueue.
|
|
471
|
-
GlobalQueue.
|
|
586
|
+
GlobalQueue.ne = recompute;
|
|
587
|
+
GlobalQueue.re = disposeChildren;
|
|
472
588
|
let W = false;
|
|
473
589
|
let j = false;
|
|
474
590
|
let N = false;
|
|
475
|
-
let
|
|
476
|
-
let
|
|
591
|
+
let L = false;
|
|
592
|
+
let Q = false;
|
|
477
593
|
let I = false;
|
|
478
|
-
let
|
|
594
|
+
let H = null;
|
|
479
595
|
function recompute(t, n = false) {
|
|
480
|
-
const i = t.
|
|
596
|
+
const i = t.ae;
|
|
481
597
|
if (!n) {
|
|
482
|
-
if (t.
|
|
483
|
-
deleteFromHeap(t, t.
|
|
484
|
-
if (t.
|
|
598
|
+
if (t.B && (!i || x) && x !== t.B) E.initTransition(t.B);
|
|
599
|
+
deleteFromHeap(t, t._ & o ? b : _);
|
|
600
|
+
if (t.B || i === h) disposeChildren(t);
|
|
485
601
|
else {
|
|
486
602
|
markDisposal(t);
|
|
487
|
-
t.
|
|
488
|
-
t.
|
|
489
|
-
t.
|
|
490
|
-
t.
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
const s = !!(t.
|
|
494
|
-
const u = t
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
t.
|
|
499
|
-
t.
|
|
500
|
-
|
|
501
|
-
let p = t.
|
|
502
|
-
let
|
|
503
|
-
let
|
|
603
|
+
t.we = t.Se;
|
|
604
|
+
t.me = t._e;
|
|
605
|
+
t.Se = null;
|
|
606
|
+
t._e = null;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
const s = !!(t._ & f);
|
|
610
|
+
const u = hasActiveOverride(t);
|
|
611
|
+
const a = !!(t.ge & l);
|
|
612
|
+
const d = H;
|
|
613
|
+
H = t;
|
|
614
|
+
t.be = null;
|
|
615
|
+
t._ = r;
|
|
616
|
+
t.fe = O;
|
|
617
|
+
let p = t.J === y ? t.ye : t.J;
|
|
618
|
+
let g = t.u;
|
|
619
|
+
let w = W;
|
|
620
|
+
let S = A;
|
|
504
621
|
W = true;
|
|
505
|
-
if (s)
|
|
622
|
+
if (s) {
|
|
623
|
+
const e = resolveLane(t);
|
|
624
|
+
if (e) setCurrentOptimisticLane(e);
|
|
625
|
+
}
|
|
506
626
|
try {
|
|
507
|
-
|
|
627
|
+
p = handleAsync(t, t.R(p));
|
|
508
628
|
clearStatus(t);
|
|
629
|
+
const e = resolveLane(t);
|
|
630
|
+
if (e) {
|
|
631
|
+
e.q.delete(t);
|
|
632
|
+
updatePendingSignal(e.t);
|
|
633
|
+
}
|
|
509
634
|
} catch (e) {
|
|
510
|
-
if (e instanceof NotReadyError) {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
635
|
+
if (e instanceof NotReadyError && A) {
|
|
636
|
+
const e = findLane(A);
|
|
637
|
+
if (e.t !== t) {
|
|
638
|
+
e.q.add(t);
|
|
639
|
+
t.M = e;
|
|
640
|
+
updatePendingSignal(e.t);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
notifyStatus(
|
|
644
|
+
t,
|
|
645
|
+
e instanceof NotReadyError ? l : c,
|
|
646
|
+
e,
|
|
647
|
+
undefined,
|
|
648
|
+
e instanceof NotReadyError ? t.M : undefined
|
|
649
|
+
);
|
|
514
650
|
} finally {
|
|
515
|
-
W =
|
|
516
|
-
t.
|
|
517
|
-
|
|
651
|
+
W = w;
|
|
652
|
+
t._ = e;
|
|
653
|
+
H = d;
|
|
518
654
|
}
|
|
519
|
-
if (!t.
|
|
520
|
-
const e = t.
|
|
521
|
-
let r = e !== null ? e.
|
|
655
|
+
if (!t.oe) {
|
|
656
|
+
const e = t.be;
|
|
657
|
+
let r = e !== null ? e.L : t.N;
|
|
522
658
|
if (r !== null) {
|
|
523
659
|
do {
|
|
524
660
|
r = unlinkSubs(r);
|
|
525
661
|
} while (r !== null);
|
|
526
|
-
if (e !== null) e.
|
|
527
|
-
else t.
|
|
662
|
+
if (e !== null) e.L = null;
|
|
663
|
+
else t.N = null;
|
|
528
664
|
}
|
|
529
|
-
const
|
|
665
|
+
const f = u ? t.ye : t.J === y ? t.ye : t.J;
|
|
666
|
+
const l = !t.Oe || !t.Oe(f, p);
|
|
530
667
|
if (l) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
668
|
+
const e = u ? t.ye : undefined;
|
|
669
|
+
if (n || (i && x !== t.B) || s) t.ye = p;
|
|
670
|
+
else t.J = p;
|
|
671
|
+
if (u && !s && a) {
|
|
672
|
+
const e = t.K || 0;
|
|
673
|
+
const n = t.G || 0;
|
|
674
|
+
if (e <= n) t.ye = p;
|
|
675
|
+
}
|
|
676
|
+
if (!u || s || t.ye !== e) {
|
|
677
|
+
insertSubs(t, s || u);
|
|
678
|
+
}
|
|
679
|
+
} else if (u) {
|
|
680
|
+
t.J = p;
|
|
681
|
+
} else if (t.u != g) {
|
|
682
|
+
for (let e = t.P; e !== null; e = e.C) {
|
|
683
|
+
insertIntoHeapHeight(e.k, e.k._ & o ? b : _);
|
|
537
684
|
}
|
|
538
685
|
}
|
|
539
686
|
}
|
|
540
|
-
|
|
541
|
-
(!n || t.
|
|
542
|
-
t.
|
|
687
|
+
setCurrentOptimisticLane(S);
|
|
688
|
+
(!n || t.ge & l) && !t.B && !(x && t.U) && E.$.push(t);
|
|
689
|
+
t.B && i && x !== t.B && runInTransition(t.B, () => recompute(t));
|
|
543
690
|
}
|
|
544
|
-
function handleAsync(e, t,
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
if (!
|
|
549
|
-
e.
|
|
691
|
+
function handleAsync(e, t, r) {
|
|
692
|
+
const i = typeof t === "object" && t !== null;
|
|
693
|
+
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
694
|
+
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
695
|
+
if (!o && !s) {
|
|
696
|
+
e.xe = null;
|
|
550
697
|
return t;
|
|
551
698
|
}
|
|
552
|
-
e.
|
|
553
|
-
let
|
|
699
|
+
e.xe = t;
|
|
700
|
+
let u;
|
|
554
701
|
const handleError = n => {
|
|
555
|
-
if (e.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
notifyStatus(e, c, n);
|
|
560
|
-
} else notifyStatus(e, a, n);
|
|
561
|
-
e.ce = x;
|
|
702
|
+
if (e.xe !== t) return;
|
|
703
|
+
E.initTransition(e.B);
|
|
704
|
+
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
705
|
+
e.fe = O;
|
|
562
706
|
};
|
|
563
|
-
const asyncWrite = (
|
|
564
|
-
if (e.
|
|
565
|
-
|
|
707
|
+
const asyncWrite = (i, s) => {
|
|
708
|
+
if (e.xe !== t) return;
|
|
709
|
+
if (e._ & (n | f)) return;
|
|
710
|
+
E.initTransition(e.B);
|
|
566
711
|
clearStatus(e);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
712
|
+
const o = resolveLane(e);
|
|
713
|
+
if (o) o.q.delete(e);
|
|
714
|
+
if (r) r(i);
|
|
715
|
+
else if (e.U) {
|
|
716
|
+
const t = e.J !== y;
|
|
717
|
+
if (e.R) e.J = i;
|
|
571
718
|
if (!t) {
|
|
572
|
-
e.
|
|
719
|
+
e.ye = i;
|
|
573
720
|
insertSubs(e);
|
|
574
721
|
}
|
|
575
|
-
e.
|
|
576
|
-
|
|
577
|
-
|
|
722
|
+
e.fe = O;
|
|
723
|
+
} else if (o) {
|
|
724
|
+
const t = e.ye;
|
|
725
|
+
const n = e.Oe;
|
|
726
|
+
if (!n || !n(i, t)) {
|
|
727
|
+
e.ye = i;
|
|
728
|
+
e.fe = O;
|
|
729
|
+
if (e.ve) {
|
|
730
|
+
setSignal(e.ve, i);
|
|
731
|
+
}
|
|
732
|
+
insertSubs(e, true);
|
|
733
|
+
}
|
|
734
|
+
} else {
|
|
735
|
+
setSignal(e, () => i);
|
|
736
|
+
}
|
|
737
|
+
schedule();
|
|
578
738
|
flush();
|
|
579
|
-
|
|
739
|
+
s?.();
|
|
580
740
|
};
|
|
581
|
-
if (
|
|
741
|
+
if (o) {
|
|
582
742
|
let n = false,
|
|
583
743
|
r = true;
|
|
584
744
|
t.then(
|
|
585
745
|
e => {
|
|
586
746
|
if (r) {
|
|
587
|
-
|
|
747
|
+
u = e;
|
|
588
748
|
n = true;
|
|
589
749
|
} else asyncWrite(e);
|
|
590
750
|
},
|
|
@@ -594,11 +754,11 @@ function handleAsync(e, t, n) {
|
|
|
594
754
|
);
|
|
595
755
|
r = false;
|
|
596
756
|
if (!n) {
|
|
597
|
-
|
|
598
|
-
throw new NotReadyError(
|
|
757
|
+
E.initTransition(e.B);
|
|
758
|
+
throw new NotReadyError(H);
|
|
599
759
|
}
|
|
600
760
|
}
|
|
601
|
-
if (
|
|
761
|
+
if (s) {
|
|
602
762
|
const n = t[Symbol.asyncIterator]();
|
|
603
763
|
let r = false;
|
|
604
764
|
const iterate = () => {
|
|
@@ -618,7 +778,7 @@ function handleAsync(e, t, n) {
|
|
|
618
778
|
);
|
|
619
779
|
i = false;
|
|
620
780
|
if (t && !e.done) {
|
|
621
|
-
|
|
781
|
+
u = e.value;
|
|
622
782
|
r = true;
|
|
623
783
|
return iterate();
|
|
624
784
|
}
|
|
@@ -626,177 +786,191 @@ function handleAsync(e, t, n) {
|
|
|
626
786
|
};
|
|
627
787
|
const i = iterate();
|
|
628
788
|
if (!r && !i) {
|
|
629
|
-
|
|
630
|
-
throw new NotReadyError(
|
|
789
|
+
E.initTransition(e.B);
|
|
790
|
+
throw new NotReadyError(H);
|
|
631
791
|
}
|
|
632
792
|
}
|
|
633
|
-
return
|
|
793
|
+
return u;
|
|
634
794
|
}
|
|
635
795
|
function clearStatus(e) {
|
|
636
|
-
e.
|
|
637
|
-
e.
|
|
796
|
+
e.ge = e.ge & a;
|
|
797
|
+
e.oe = null;
|
|
638
798
|
updatePendingSignal(e);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
799
|
+
e.Pe?.();
|
|
800
|
+
}
|
|
801
|
+
function notifyStatus(e, t, n, r, i) {
|
|
802
|
+
if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
803
|
+
n = new StatusError(e, n);
|
|
804
|
+
const s = n instanceof NotReadyError && n.t === e;
|
|
805
|
+
const o = t === l && e.U && !s;
|
|
806
|
+
const u = o && hasActiveOverride(e);
|
|
807
|
+
if (!r) {
|
|
808
|
+
e.ge = t | (t !== c ? e.ge & a : 0);
|
|
809
|
+
e.oe = n;
|
|
810
|
+
updatePendingSignal(e);
|
|
811
|
+
}
|
|
812
|
+
if (i && !r) {
|
|
813
|
+
assignOrMergeLane(e, i);
|
|
814
|
+
}
|
|
815
|
+
if (u && x && n instanceof NotReadyError) {
|
|
816
|
+
const e = n.t;
|
|
817
|
+
if (!x.ue.includes(e)) {
|
|
818
|
+
x.ue.push(e);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
const f = r || u;
|
|
822
|
+
const d = r || o ? undefined : i;
|
|
823
|
+
if (e.Pe) {
|
|
824
|
+
if (f) {
|
|
825
|
+
e.Pe(t, n);
|
|
826
|
+
} else {
|
|
827
|
+
e.Pe();
|
|
648
828
|
}
|
|
649
|
-
|
|
829
|
+
return;
|
|
650
830
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
if (e.pe) return e.pe();
|
|
657
|
-
for (let r = e.O; r !== null; r = r.P) {
|
|
658
|
-
r.C.ce = x;
|
|
659
|
-
if (r.C.J !== n) {
|
|
660
|
-
!r.C.X && A.D.push(r.C);
|
|
661
|
-
notifyStatus(r.C, t, n);
|
|
831
|
+
for (let r = e.P; r !== null; r = r.C) {
|
|
832
|
+
r.k.fe = O;
|
|
833
|
+
if (r.k.oe !== n) {
|
|
834
|
+
!r.k.B && E.$.push(r.k);
|
|
835
|
+
notifyStatus(r.k, t, n, f, d);
|
|
662
836
|
}
|
|
663
837
|
}
|
|
664
|
-
for (let r = e.
|
|
665
|
-
for (let e = r.
|
|
666
|
-
e.
|
|
667
|
-
if (e.
|
|
668
|
-
!e.
|
|
669
|
-
notifyStatus(e.
|
|
838
|
+
for (let r = e.A; r !== null; r = r.W) {
|
|
839
|
+
for (let e = r.P; e !== null; e = e.C) {
|
|
840
|
+
e.k.fe = O;
|
|
841
|
+
if (e.k.oe !== n) {
|
|
842
|
+
!e.k.B && E.$.push(e.k);
|
|
843
|
+
notifyStatus(e.k, t, n, f, d);
|
|
670
844
|
}
|
|
671
845
|
}
|
|
672
846
|
}
|
|
673
847
|
}
|
|
674
848
|
function updateIfNecessary(r) {
|
|
675
|
-
if (r.
|
|
676
|
-
for (let e = r.
|
|
677
|
-
const t = e.
|
|
678
|
-
const i = t.
|
|
849
|
+
if (r._ & t) {
|
|
850
|
+
for (let e = r.N; e; e = e.L) {
|
|
851
|
+
const t = e.I;
|
|
852
|
+
const i = t.H || t;
|
|
679
853
|
if (i.R) {
|
|
680
854
|
updateIfNecessary(i);
|
|
681
855
|
}
|
|
682
|
-
if (r.
|
|
856
|
+
if (r._ & n) {
|
|
683
857
|
break;
|
|
684
858
|
}
|
|
685
859
|
}
|
|
686
860
|
}
|
|
687
|
-
if (r.
|
|
861
|
+
if (r._ & (n | f) || (r.oe && r.fe < O)) {
|
|
688
862
|
recompute(r);
|
|
689
863
|
}
|
|
690
|
-
r.
|
|
864
|
+
r._ = e;
|
|
691
865
|
}
|
|
692
866
|
function unlinkSubs(e) {
|
|
693
|
-
const t = e.
|
|
694
|
-
const n = e.
|
|
695
|
-
const r = e.
|
|
696
|
-
const i = e.
|
|
697
|
-
if (r !== null) r.
|
|
698
|
-
else t.
|
|
699
|
-
if (i !== null) i.
|
|
867
|
+
const t = e.I;
|
|
868
|
+
const n = e.L;
|
|
869
|
+
const r = e.C;
|
|
870
|
+
const i = e.Ce;
|
|
871
|
+
if (r !== null) r.Ce = i;
|
|
872
|
+
else t.ke = i;
|
|
873
|
+
if (i !== null) i.C = r;
|
|
700
874
|
else {
|
|
701
|
-
t.
|
|
875
|
+
t.P = r;
|
|
702
876
|
if (r === null) {
|
|
703
|
-
t.
|
|
704
|
-
t.R && !t.
|
|
877
|
+
t.Ae?.();
|
|
878
|
+
t.R && !t.Ee && unobserved(t);
|
|
705
879
|
}
|
|
706
880
|
}
|
|
707
881
|
return n;
|
|
708
882
|
}
|
|
709
883
|
function unobserved(e) {
|
|
710
|
-
deleteFromHeap(e, e.
|
|
711
|
-
let t = e.
|
|
884
|
+
deleteFromHeap(e, e._ & o ? b : _);
|
|
885
|
+
let t = e.N;
|
|
712
886
|
while (t !== null) {
|
|
713
887
|
t = unlinkSubs(t);
|
|
714
888
|
}
|
|
715
|
-
e.
|
|
889
|
+
e.N = null;
|
|
716
890
|
disposeChildren(e, true);
|
|
717
891
|
}
|
|
718
892
|
function link(e, t) {
|
|
719
|
-
const n = t.
|
|
720
|
-
if (n !== null && n.
|
|
893
|
+
const n = t.be;
|
|
894
|
+
if (n !== null && n.I === e) return;
|
|
721
895
|
let i = null;
|
|
722
|
-
const s = t.
|
|
896
|
+
const s = t._ & r;
|
|
723
897
|
if (s) {
|
|
724
|
-
i = n !== null ? n.
|
|
725
|
-
if (i !== null && i.
|
|
726
|
-
t.
|
|
898
|
+
i = n !== null ? n.L : t.N;
|
|
899
|
+
if (i !== null && i.I === e) {
|
|
900
|
+
t.be = i;
|
|
727
901
|
return;
|
|
728
902
|
}
|
|
729
903
|
}
|
|
730
|
-
const o = e.
|
|
731
|
-
if (o !== null && o.
|
|
732
|
-
const u = (t.
|
|
733
|
-
if (n !== null) n.
|
|
734
|
-
else t.
|
|
735
|
-
if (o !== null) o.
|
|
736
|
-
else e.
|
|
904
|
+
const o = e.ke;
|
|
905
|
+
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
906
|
+
const u = (t.be = e.ke = { I: e, k: t, L: i, Ce: o, C: null });
|
|
907
|
+
if (n !== null) n.L = u;
|
|
908
|
+
else t.N = u;
|
|
909
|
+
if (o !== null) o.C = u;
|
|
910
|
+
else e.P = u;
|
|
737
911
|
}
|
|
738
912
|
function isValidLink(e, t) {
|
|
739
|
-
const n = t.
|
|
913
|
+
const n = t.be;
|
|
740
914
|
if (n !== null) {
|
|
741
|
-
let r = t.
|
|
915
|
+
let r = t.N;
|
|
742
916
|
do {
|
|
743
917
|
if (r === e) return true;
|
|
744
918
|
if (r === n) break;
|
|
745
|
-
r = r.
|
|
919
|
+
r = r.L;
|
|
746
920
|
} while (r !== null);
|
|
747
921
|
}
|
|
748
922
|
return false;
|
|
749
923
|
}
|
|
750
924
|
function markDisposal(e) {
|
|
751
|
-
let t = e.
|
|
925
|
+
let t = e._e;
|
|
752
926
|
while (t) {
|
|
753
|
-
t.
|
|
754
|
-
if (t.
|
|
927
|
+
t._ |= o;
|
|
928
|
+
if (t._ & i) {
|
|
755
929
|
deleteFromHeap(t, _);
|
|
756
|
-
insertIntoHeap(t,
|
|
930
|
+
insertIntoHeap(t, b);
|
|
757
931
|
}
|
|
758
932
|
markDisposal(t);
|
|
759
|
-
t = t.
|
|
933
|
+
t = t.We;
|
|
760
934
|
}
|
|
761
935
|
}
|
|
762
936
|
function dispose(e) {
|
|
763
|
-
let t = e.
|
|
937
|
+
let t = e.N || null;
|
|
764
938
|
do {
|
|
765
939
|
t = unlinkSubs(t);
|
|
766
940
|
} while (t !== null);
|
|
767
|
-
e.
|
|
768
|
-
e.
|
|
941
|
+
e.N = null;
|
|
942
|
+
e.be = null;
|
|
769
943
|
disposeChildren(e, true);
|
|
770
944
|
}
|
|
771
945
|
function disposeChildren(e, t = false, n) {
|
|
772
|
-
if (e.
|
|
773
|
-
if (t) e.
|
|
774
|
-
let r = n ? e.
|
|
946
|
+
if (e._ & u) return;
|
|
947
|
+
if (t) e._ = u;
|
|
948
|
+
let r = n ? e.me : e._e;
|
|
775
949
|
while (r) {
|
|
776
|
-
const e = r.
|
|
777
|
-
if (r.
|
|
950
|
+
const e = r.We;
|
|
951
|
+
if (r.N) {
|
|
778
952
|
const e = r;
|
|
779
|
-
deleteFromHeap(e, e.
|
|
780
|
-
let t = e.
|
|
953
|
+
deleteFromHeap(e, e._ & o ? b : _);
|
|
954
|
+
let t = e.N;
|
|
781
955
|
do {
|
|
782
956
|
t = unlinkSubs(t);
|
|
783
957
|
} while (t !== null);
|
|
784
|
-
e.
|
|
785
|
-
e.
|
|
958
|
+
e.N = null;
|
|
959
|
+
e.be = null;
|
|
786
960
|
}
|
|
787
961
|
disposeChildren(r, true);
|
|
788
962
|
r = e;
|
|
789
963
|
}
|
|
790
964
|
if (n) {
|
|
791
|
-
e.
|
|
965
|
+
e.me = null;
|
|
792
966
|
} else {
|
|
793
|
-
e.
|
|
794
|
-
e.
|
|
967
|
+
e._e = null;
|
|
968
|
+
e.We = null;
|
|
795
969
|
}
|
|
796
970
|
runDisposal(e, n);
|
|
797
971
|
}
|
|
798
972
|
function runDisposal(e, t) {
|
|
799
|
-
let n = t ? e.
|
|
973
|
+
let n = t ? e.we : e.Se;
|
|
800
974
|
if (!n) return;
|
|
801
975
|
if (Array.isArray(n)) {
|
|
802
976
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -806,10 +980,10 @@ function runDisposal(e, t) {
|
|
|
806
980
|
} else {
|
|
807
981
|
n.call(n);
|
|
808
982
|
}
|
|
809
|
-
t ? (e.
|
|
983
|
+
t ? (e.we = null) : (e.Se = null);
|
|
810
984
|
}
|
|
811
985
|
function getNextChildId(e) {
|
|
812
|
-
if (e.id != null) return formatId(e.id, e.
|
|
986
|
+
if (e.id != null) return formatId(e.id, e.je++);
|
|
813
987
|
throw new Error("Cannot get child id from owner without an id");
|
|
814
988
|
}
|
|
815
989
|
function formatId(e, t) {
|
|
@@ -819,103 +993,133 @@ function formatId(e, t) {
|
|
|
819
993
|
}
|
|
820
994
|
function computed(t, n, r) {
|
|
821
995
|
const i = {
|
|
822
|
-
id: r?.id ?? (
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
se: null,
|
|
827
|
-
$: Q?.$ ?? A,
|
|
828
|
-
_e: Q?._e ?? S,
|
|
829
|
-
me: 0,
|
|
830
|
-
R: t,
|
|
831
|
-
ne: n,
|
|
832
|
-
o: 0,
|
|
833
|
-
k: null,
|
|
834
|
-
h: undefined,
|
|
835
|
-
p: null,
|
|
836
|
-
j: null,
|
|
837
|
-
fe: null,
|
|
838
|
-
O: null,
|
|
839
|
-
ye: null,
|
|
840
|
-
i: Q,
|
|
996
|
+
id: r?.id ?? (H?.id != null ? getNextChildId(H) : undefined),
|
|
997
|
+
Oe: r?.equals != null ? r.equals : isEqual,
|
|
998
|
+
Ne: !!r?.pureWrite,
|
|
999
|
+
Ae: r?.unobserved,
|
|
841
1000
|
Se: null,
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1001
|
+
pe: H?.pe ?? E,
|
|
1002
|
+
Le: H?.Le ?? w,
|
|
1003
|
+
je: 0,
|
|
1004
|
+
R: t,
|
|
1005
|
+
ye: n,
|
|
1006
|
+
u: 0,
|
|
1007
|
+
A: null,
|
|
1008
|
+
S: undefined,
|
|
1009
|
+
h: null,
|
|
1010
|
+
N: null,
|
|
1011
|
+
be: null,
|
|
1012
|
+
P: null,
|
|
1013
|
+
ke: null,
|
|
1014
|
+
o: H,
|
|
1015
|
+
We: null,
|
|
1016
|
+
_e: null,
|
|
1017
|
+
_: e,
|
|
1018
|
+
ge: a,
|
|
1019
|
+
fe: O,
|
|
1020
|
+
J: y,
|
|
1021
|
+
we: null,
|
|
1022
|
+
me: null,
|
|
1023
|
+
xe: null,
|
|
1024
|
+
B: null
|
|
851
1025
|
};
|
|
852
|
-
i.
|
|
853
|
-
const s =
|
|
854
|
-
if (
|
|
855
|
-
const e =
|
|
1026
|
+
i.h = i;
|
|
1027
|
+
const s = H?.i ? H.l : H;
|
|
1028
|
+
if (H) {
|
|
1029
|
+
const e = H._e;
|
|
856
1030
|
if (e === null) {
|
|
857
|
-
|
|
1031
|
+
H._e = i;
|
|
858
1032
|
} else {
|
|
859
|
-
i.
|
|
860
|
-
|
|
1033
|
+
i.We = e;
|
|
1034
|
+
H._e = i;
|
|
861
1035
|
}
|
|
862
1036
|
}
|
|
863
|
-
if (s) i.
|
|
1037
|
+
if (s) i.u = s.u + 1;
|
|
864
1038
|
!r?.lazy && recompute(i, true);
|
|
865
1039
|
return i;
|
|
866
1040
|
}
|
|
867
1041
|
function signal(e, t, n = null) {
|
|
868
1042
|
const r = {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1043
|
+
Oe: t?.equals != null ? t.equals : isEqual,
|
|
1044
|
+
Ne: !!t?.pureWrite,
|
|
1045
|
+
Ae: t?.unobserved,
|
|
1046
|
+
ye: e,
|
|
1047
|
+
P: null,
|
|
1048
|
+
ke: null,
|
|
1049
|
+
fe: O,
|
|
1050
|
+
H: n,
|
|
1051
|
+
W: n?.A || null,
|
|
1052
|
+
J: y
|
|
879
1053
|
};
|
|
880
|
-
n && (n.
|
|
1054
|
+
n && (n.A = r);
|
|
881
1055
|
return r;
|
|
882
1056
|
}
|
|
883
1057
|
function optimisticSignal(e, t) {
|
|
884
1058
|
const n = signal(e, t);
|
|
885
|
-
n.
|
|
1059
|
+
n.U = true;
|
|
886
1060
|
return n;
|
|
887
1061
|
}
|
|
888
1062
|
function optimisticComputed(e, t, n) {
|
|
889
1063
|
const r = computed(e, t, n);
|
|
890
|
-
r.
|
|
1064
|
+
r.U = true;
|
|
891
1065
|
return r;
|
|
892
1066
|
}
|
|
893
1067
|
function getPendingSignal(e) {
|
|
894
|
-
if (!e.
|
|
895
|
-
e.
|
|
896
|
-
if (
|
|
1068
|
+
if (!e.Qe) {
|
|
1069
|
+
e.Qe = optimisticSignal(false, { pureWrite: true });
|
|
1070
|
+
if (e.T) {
|
|
1071
|
+
e.Qe.T = e;
|
|
1072
|
+
}
|
|
1073
|
+
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
897
1074
|
}
|
|
898
|
-
return e.
|
|
1075
|
+
return e.Qe;
|
|
899
1076
|
}
|
|
900
1077
|
function computePendingState(e) {
|
|
901
|
-
if (e.te !== g) return true;
|
|
902
1078
|
const t = e;
|
|
903
|
-
|
|
1079
|
+
if (e.U && e.J !== y) {
|
|
1080
|
+
if (t.ge & l && !(t.ge & a)) return true;
|
|
1081
|
+
if (e.T) {
|
|
1082
|
+
const t = e.M ? findLane(e.M) : null;
|
|
1083
|
+
return !!(t && t.q.size > 0);
|
|
1084
|
+
}
|
|
1085
|
+
return true;
|
|
1086
|
+
}
|
|
1087
|
+
if (e.J !== y && !(t.ge & a)) return true;
|
|
1088
|
+
return !!(t.ge & l && !(t.ge & a));
|
|
904
1089
|
}
|
|
905
1090
|
function getPendingValueComputed(e) {
|
|
906
|
-
if (!e.
|
|
1091
|
+
if (!e.ve) {
|
|
907
1092
|
const t = I;
|
|
908
1093
|
I = false;
|
|
909
|
-
const n =
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1094
|
+
const n = L;
|
|
1095
|
+
L = false;
|
|
1096
|
+
const r = H;
|
|
1097
|
+
H = null;
|
|
1098
|
+
e.ve = optimisticComputed(() => read(e));
|
|
1099
|
+
e.ve.T = e;
|
|
1100
|
+
H = r;
|
|
1101
|
+
L = n;
|
|
913
1102
|
I = t;
|
|
914
1103
|
}
|
|
915
|
-
return e.
|
|
1104
|
+
return e.ve;
|
|
916
1105
|
}
|
|
917
1106
|
function updatePendingSignal(e) {
|
|
918
|
-
if (e.
|
|
1107
|
+
if (e.Qe) {
|
|
1108
|
+
const t = computePendingState(e);
|
|
1109
|
+
const n = e.Qe;
|
|
1110
|
+
setSignal(n, t);
|
|
1111
|
+
if (!t && n.M) {
|
|
1112
|
+
const t = resolveLane(e);
|
|
1113
|
+
if (t && t.q.size > 0) {
|
|
1114
|
+
const e = findLane(n.M);
|
|
1115
|
+
if (e !== t) {
|
|
1116
|
+
mergeLanes(t, e);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
clearLaneEntry(n);
|
|
1120
|
+
n.M = undefined;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
919
1123
|
}
|
|
920
1124
|
function isEqual(e, t) {
|
|
921
1125
|
return e === t;
|
|
@@ -930,129 +1134,157 @@ function untrack(e) {
|
|
|
930
1134
|
}
|
|
931
1135
|
}
|
|
932
1136
|
function read(e) {
|
|
933
|
-
if (E) {
|
|
934
|
-
const t = e.I || e;
|
|
935
|
-
const n = getPendingSignal(t);
|
|
936
|
-
const r = E;
|
|
937
|
-
E = false;
|
|
938
|
-
if (read(n)) {
|
|
939
|
-
H = true;
|
|
940
|
-
}
|
|
941
|
-
E = r;
|
|
942
|
-
return e.ne;
|
|
943
|
-
}
|
|
944
1137
|
if (I) {
|
|
945
1138
|
const t = getPendingValueComputed(e);
|
|
946
1139
|
const n = I;
|
|
947
1140
|
I = false;
|
|
948
1141
|
const r = read(t);
|
|
949
1142
|
I = n;
|
|
950
|
-
if (t.
|
|
1143
|
+
if (t.ge & l) return e.ye;
|
|
1144
|
+
if (j && A && t.M) {
|
|
1145
|
+
const n = findLane(t.M);
|
|
1146
|
+
const r = findLane(A);
|
|
1147
|
+
if (n !== r && n.q.size > 0) {
|
|
1148
|
+
return e.ye;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
951
1151
|
return r;
|
|
952
1152
|
}
|
|
953
|
-
|
|
954
|
-
|
|
1153
|
+
if (L) {
|
|
1154
|
+
const t = e.H || e;
|
|
1155
|
+
const n = getPendingSignal(t);
|
|
1156
|
+
const r = L;
|
|
1157
|
+
L = false;
|
|
1158
|
+
if (read(n)) {
|
|
1159
|
+
Q = true;
|
|
1160
|
+
}
|
|
1161
|
+
L = r;
|
|
1162
|
+
return e.ye;
|
|
1163
|
+
}
|
|
1164
|
+
let t = H;
|
|
1165
|
+
if (t?.i) t = t.l;
|
|
955
1166
|
if (N && e.R) recompute(e);
|
|
956
1167
|
if (t && W) {
|
|
957
|
-
if (e.R && e.
|
|
1168
|
+
if (e.R && e._ & u) recompute(e);
|
|
958
1169
|
link(e, t);
|
|
959
|
-
const n = e.
|
|
1170
|
+
const n = e.H || e;
|
|
960
1171
|
if (n.R) {
|
|
961
|
-
const r = e.
|
|
962
|
-
if (n.
|
|
1172
|
+
const r = e._ & o;
|
|
1173
|
+
if (n.u >= (r ? b.j : _.j)) {
|
|
963
1174
|
markNode(t);
|
|
964
|
-
markHeap(r ?
|
|
1175
|
+
markHeap(r ? b : _);
|
|
965
1176
|
updateIfNecessary(n);
|
|
966
1177
|
}
|
|
967
|
-
const i = n.
|
|
968
|
-
if (i >= t.
|
|
969
|
-
t.
|
|
1178
|
+
const i = n.u;
|
|
1179
|
+
if (i >= t.u && e.o !== t) {
|
|
1180
|
+
t.u = i + 1;
|
|
970
1181
|
}
|
|
971
1182
|
}
|
|
972
1183
|
}
|
|
973
|
-
const n = e.
|
|
974
|
-
if (t &&
|
|
975
|
-
|
|
976
|
-
|
|
1184
|
+
const n = e.H || e;
|
|
1185
|
+
if (t && n.ge & l && !(j && n.B && x !== n.B)) {
|
|
1186
|
+
if (A) {
|
|
1187
|
+
const r = n.M;
|
|
1188
|
+
const i = findLane(A);
|
|
1189
|
+
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1190
|
+
if (!W) link(e, t);
|
|
1191
|
+
throw n.oe;
|
|
1192
|
+
}
|
|
1193
|
+
} else {
|
|
1194
|
+
if (!W) link(e, t);
|
|
1195
|
+
throw n.oe;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
if (e.R && e.ge & c) {
|
|
1199
|
+
if (e.fe < O) {
|
|
977
1200
|
recompute(e, true);
|
|
978
1201
|
return read(e);
|
|
979
|
-
} else throw e.
|
|
1202
|
+
} else throw e.oe;
|
|
980
1203
|
}
|
|
981
|
-
return !t ||
|
|
1204
|
+
return !t || A !== null || e.J === y || (j && e.B && x !== e.B) ? e.ye : e.J;
|
|
982
1205
|
}
|
|
983
1206
|
function setSignal(e, t) {
|
|
984
|
-
if (e.
|
|
985
|
-
const n = e.
|
|
986
|
-
const r = n ? e.
|
|
1207
|
+
if (e.B && x !== e.B) E.initTransition(e.B);
|
|
1208
|
+
const n = e.U && !P;
|
|
1209
|
+
const r = n ? e.ye : e.J === y ? e.ye : e.J;
|
|
987
1210
|
if (typeof t === "function") t = t(r);
|
|
988
|
-
const i = !e.
|
|
989
|
-
if (!i)
|
|
1211
|
+
const i = !e.Oe || !e.Oe(r, t);
|
|
1212
|
+
if (!i) {
|
|
1213
|
+
if (n && e.J !== y && e.R) {
|
|
1214
|
+
insertSubs(e, true);
|
|
1215
|
+
schedule();
|
|
1216
|
+
}
|
|
1217
|
+
return t;
|
|
1218
|
+
}
|
|
990
1219
|
if (n) {
|
|
991
|
-
const n =
|
|
992
|
-
if (e.
|
|
993
|
-
|
|
1220
|
+
const n = E.ee.includes(e);
|
|
1221
|
+
if (e.B && n) {
|
|
1222
|
+
E.initTransition(e.B);
|
|
994
1223
|
}
|
|
995
|
-
if (e.
|
|
996
|
-
e.
|
|
1224
|
+
if (e.J === y) {
|
|
1225
|
+
e.J = e.ye;
|
|
997
1226
|
}
|
|
998
1227
|
if (!n) {
|
|
999
|
-
|
|
1228
|
+
E.ee.push(e);
|
|
1000
1229
|
}
|
|
1001
|
-
e.
|
|
1230
|
+
e.K = (e.K || 0) + 1;
|
|
1231
|
+
const r = getOrCreateLane(e);
|
|
1232
|
+
e.M = r;
|
|
1233
|
+
e.ye = t;
|
|
1002
1234
|
} else {
|
|
1003
|
-
if (e.
|
|
1004
|
-
e.
|
|
1235
|
+
if (e.J === y) E.$.push(e);
|
|
1236
|
+
e.J = t;
|
|
1005
1237
|
}
|
|
1006
1238
|
updatePendingSignal(e);
|
|
1007
|
-
if (e.
|
|
1008
|
-
setSignal(e.
|
|
1239
|
+
if (e.ve) {
|
|
1240
|
+
setSignal(e.ve, t);
|
|
1009
1241
|
}
|
|
1010
|
-
e.
|
|
1242
|
+
e.fe = O;
|
|
1011
1243
|
insertSubs(e, n);
|
|
1012
1244
|
schedule();
|
|
1013
1245
|
return t;
|
|
1014
1246
|
}
|
|
1015
1247
|
const R = {};
|
|
1016
1248
|
function getObserver() {
|
|
1017
|
-
if (
|
|
1018
|
-
return W ?
|
|
1249
|
+
if (L || I) return R;
|
|
1250
|
+
return W ? H : null;
|
|
1019
1251
|
}
|
|
1020
1252
|
function getOwner() {
|
|
1021
|
-
return
|
|
1253
|
+
return H;
|
|
1022
1254
|
}
|
|
1023
1255
|
function onCleanup(e) {
|
|
1024
|
-
if (!
|
|
1025
|
-
if (!
|
|
1026
|
-
else if (Array.isArray(
|
|
1027
|
-
else
|
|
1256
|
+
if (!H) return e;
|
|
1257
|
+
if (!H.Se) H.Se = e;
|
|
1258
|
+
else if (Array.isArray(H.Se)) H.Se.push(e);
|
|
1259
|
+
else H.Se = [H.Se, e];
|
|
1028
1260
|
return e;
|
|
1029
1261
|
}
|
|
1030
1262
|
function createOwner(e) {
|
|
1031
|
-
const t =
|
|
1263
|
+
const t = H;
|
|
1032
1264
|
const n = {
|
|
1033
1265
|
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1266
|
+
i: true,
|
|
1267
|
+
l: t?.i ? t.l : t,
|
|
1268
|
+
_e: null,
|
|
1269
|
+
We: null,
|
|
1037
1270
|
Se: null,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
i: t,
|
|
1271
|
+
pe: t?.pe ?? E,
|
|
1272
|
+
Le: t?.Le || w,
|
|
1273
|
+
je: 0,
|
|
1274
|
+
we: null,
|
|
1275
|
+
me: null,
|
|
1276
|
+
o: t,
|
|
1045
1277
|
dispose(e = true) {
|
|
1046
1278
|
disposeChildren(n, e);
|
|
1047
1279
|
}
|
|
1048
1280
|
};
|
|
1049
1281
|
if (t) {
|
|
1050
|
-
const e = t.
|
|
1282
|
+
const e = t._e;
|
|
1051
1283
|
if (e === null) {
|
|
1052
|
-
t.
|
|
1284
|
+
t._e = n;
|
|
1053
1285
|
} else {
|
|
1054
|
-
n.
|
|
1055
|
-
t.
|
|
1286
|
+
n.We = e;
|
|
1287
|
+
t._e = n;
|
|
1056
1288
|
}
|
|
1057
1289
|
}
|
|
1058
1290
|
return n;
|
|
@@ -1062,14 +1294,14 @@ function createRoot(e, t) {
|
|
|
1062
1294
|
return runWithOwner(n, () => e(n.dispose));
|
|
1063
1295
|
}
|
|
1064
1296
|
function runWithOwner(e, t) {
|
|
1065
|
-
const n =
|
|
1297
|
+
const n = H;
|
|
1066
1298
|
const r = W;
|
|
1067
|
-
|
|
1299
|
+
H = e;
|
|
1068
1300
|
W = false;
|
|
1069
1301
|
try {
|
|
1070
1302
|
return t();
|
|
1071
1303
|
} finally {
|
|
1072
|
-
|
|
1304
|
+
H = n;
|
|
1073
1305
|
W = r;
|
|
1074
1306
|
}
|
|
1075
1307
|
}
|
|
@@ -1092,16 +1324,18 @@ function pending(e) {
|
|
|
1092
1324
|
}
|
|
1093
1325
|
}
|
|
1094
1326
|
function isPending(e) {
|
|
1095
|
-
const t =
|
|
1096
|
-
const n =
|
|
1097
|
-
|
|
1098
|
-
|
|
1327
|
+
const t = L;
|
|
1328
|
+
const n = Q;
|
|
1329
|
+
L = true;
|
|
1330
|
+
Q = false;
|
|
1099
1331
|
try {
|
|
1100
1332
|
e();
|
|
1101
|
-
return
|
|
1333
|
+
return Q;
|
|
1334
|
+
} catch {
|
|
1335
|
+
return Q;
|
|
1102
1336
|
} finally {
|
|
1103
|
-
|
|
1104
|
-
|
|
1337
|
+
L = t;
|
|
1338
|
+
Q = n;
|
|
1105
1339
|
}
|
|
1106
1340
|
}
|
|
1107
1341
|
function refresh(e) {
|
|
@@ -1109,7 +1343,7 @@ function refresh(e) {
|
|
|
1109
1343
|
N = true;
|
|
1110
1344
|
try {
|
|
1111
1345
|
if (typeof e !== "function") {
|
|
1112
|
-
recompute(e[
|
|
1346
|
+
recompute(e[S]);
|
|
1113
1347
|
return e;
|
|
1114
1348
|
}
|
|
1115
1349
|
return untrack(e);
|
|
@@ -1130,7 +1364,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1130
1364
|
if (!t) {
|
|
1131
1365
|
throw new NoOwnerError();
|
|
1132
1366
|
}
|
|
1133
|
-
const n = hasContext(e, t) ? t.
|
|
1367
|
+
const n = hasContext(e, t) ? t.Le[e.id] : e.defaultValue;
|
|
1134
1368
|
if (isUndefined(n)) {
|
|
1135
1369
|
throw new ContextNotFoundError();
|
|
1136
1370
|
}
|
|
@@ -1140,10 +1374,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1140
1374
|
if (!n) {
|
|
1141
1375
|
throw new NoOwnerError();
|
|
1142
1376
|
}
|
|
1143
|
-
n.
|
|
1377
|
+
n.Le = { ...n.Le, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1144
1378
|
}
|
|
1145
1379
|
function hasContext(e, t) {
|
|
1146
|
-
return !isUndefined(t?.
|
|
1380
|
+
return !isUndefined(t?.Le[e.id]);
|
|
1147
1381
|
}
|
|
1148
1382
|
function isUndefined(e) {
|
|
1149
1383
|
return typeof e === "undefined";
|
|
@@ -1153,78 +1387,80 @@ function effect(e, t, n, r, i) {
|
|
|
1153
1387
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
1154
1388
|
...i,
|
|
1155
1389
|
equals: () => {
|
|
1156
|
-
o.
|
|
1157
|
-
if (s) o
|
|
1390
|
+
o.de = !o.oe;
|
|
1391
|
+
if (s) o.pe.enqueue(o.ae, runEffect.bind(o));
|
|
1158
1392
|
return false;
|
|
1159
1393
|
},
|
|
1160
1394
|
lazy: true
|
|
1161
1395
|
});
|
|
1162
|
-
o.
|
|
1163
|
-
o.
|
|
1164
|
-
o.
|
|
1165
|
-
o.
|
|
1166
|
-
o.
|
|
1167
|
-
o.
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1396
|
+
o.Ie = r;
|
|
1397
|
+
o.He = t;
|
|
1398
|
+
o.Re = n;
|
|
1399
|
+
o.Te = undefined;
|
|
1400
|
+
o.ae = i?.render ? d : p;
|
|
1401
|
+
o.Pe = (e, t) => {
|
|
1402
|
+
const n = e !== undefined ? e : o.ge;
|
|
1403
|
+
const r = t !== undefined ? t : o.oe;
|
|
1404
|
+
if (n & c) {
|
|
1405
|
+
let e = r;
|
|
1406
|
+
o.pe.notify(o, l, 0);
|
|
1407
|
+
if (o.ae === p) {
|
|
1172
1408
|
try {
|
|
1173
|
-
return o.
|
|
1174
|
-
? o.
|
|
1175
|
-
o.
|
|
1176
|
-
o.
|
|
1409
|
+
return o.Re
|
|
1410
|
+
? o.Re(e, () => {
|
|
1411
|
+
o.Te?.();
|
|
1412
|
+
o.Te = undefined;
|
|
1177
1413
|
})
|
|
1178
1414
|
: console.error(e);
|
|
1179
1415
|
} catch (t) {
|
|
1180
1416
|
e = t;
|
|
1181
1417
|
}
|
|
1182
1418
|
}
|
|
1183
|
-
if (!o
|
|
1184
|
-
} else if (o.
|
|
1419
|
+
if (!o.pe.notify(o, c, c)) throw e;
|
|
1420
|
+
} else if (o.ae === d) o.pe.notify(o, l | c, n, r);
|
|
1185
1421
|
};
|
|
1186
1422
|
recompute(o, true);
|
|
1187
|
-
!i?.defer && (o.
|
|
1423
|
+
!i?.defer && (o.ae === p ? o.pe.enqueue(o.ae, runEffect.bind(o)) : runEffect.call(o));
|
|
1188
1424
|
s = true;
|
|
1189
|
-
onCleanup(() => o.
|
|
1425
|
+
onCleanup(() => o.Te?.());
|
|
1190
1426
|
}
|
|
1191
1427
|
function runEffect() {
|
|
1192
|
-
if (!this.
|
|
1193
|
-
this.
|
|
1194
|
-
this.
|
|
1428
|
+
if (!this.de || this._ & u) return;
|
|
1429
|
+
this.Te?.();
|
|
1430
|
+
this.Te = undefined;
|
|
1195
1431
|
try {
|
|
1196
|
-
this.
|
|
1432
|
+
this.Te = this.He(this.ye, this.Ie);
|
|
1197
1433
|
} catch (e) {
|
|
1198
|
-
if (!this
|
|
1434
|
+
if (!this.pe.notify(this, c, c)) throw e;
|
|
1199
1435
|
} finally {
|
|
1200
|
-
this.
|
|
1201
|
-
this.
|
|
1436
|
+
this.Ie = this.ye;
|
|
1437
|
+
this.de = false;
|
|
1202
1438
|
}
|
|
1203
1439
|
}
|
|
1204
1440
|
function trackedEffect(e, t) {
|
|
1205
1441
|
const run = () => {
|
|
1206
|
-
if (!n.
|
|
1207
|
-
n.
|
|
1442
|
+
if (!n.de || n._ & u) return;
|
|
1443
|
+
n.de = false;
|
|
1208
1444
|
recompute(n);
|
|
1209
1445
|
};
|
|
1210
1446
|
const n = computed(
|
|
1211
1447
|
() => {
|
|
1212
1448
|
try {
|
|
1213
|
-
n.
|
|
1214
|
-
n.
|
|
1215
|
-
n.
|
|
1449
|
+
n.Te?.();
|
|
1450
|
+
n.Te = undefined;
|
|
1451
|
+
n.Te = staleValues(e) || undefined;
|
|
1216
1452
|
} finally {
|
|
1217
1453
|
}
|
|
1218
1454
|
},
|
|
1219
1455
|
undefined,
|
|
1220
1456
|
{ ...t, lazy: true, pureWrite: true }
|
|
1221
1457
|
);
|
|
1222
|
-
n.
|
|
1223
|
-
n.
|
|
1224
|
-
n.
|
|
1225
|
-
n.
|
|
1226
|
-
n
|
|
1227
|
-
onCleanup(() => n.
|
|
1458
|
+
n.Te = undefined;
|
|
1459
|
+
n.de = true;
|
|
1460
|
+
n.ae = h;
|
|
1461
|
+
n.he = run;
|
|
1462
|
+
n.pe.enqueue(p, run);
|
|
1463
|
+
onCleanup(() => n.Te?.());
|
|
1228
1464
|
}
|
|
1229
1465
|
function createSignal(e, t, n) {
|
|
1230
1466
|
if (typeof e === "function") {
|
|
@@ -1289,13 +1525,13 @@ function createOptimistic(e, t, n) {
|
|
|
1289
1525
|
function onSettled(e) {
|
|
1290
1526
|
getOwner()
|
|
1291
1527
|
? createTrackedEffect(() => untrack(e))
|
|
1292
|
-
:
|
|
1528
|
+
: E.enqueue(p, () => {
|
|
1293
1529
|
const t = e();
|
|
1294
1530
|
t?.();
|
|
1295
1531
|
});
|
|
1296
1532
|
}
|
|
1297
1533
|
function unwrap(e) {
|
|
1298
|
-
return e?.[
|
|
1534
|
+
return e?.[F]?.[U] ?? e;
|
|
1299
1535
|
}
|
|
1300
1536
|
function getOverrideValue(e, t, n, r) {
|
|
1301
1537
|
return t && r in t ? t[r] : e[r];
|
|
@@ -1306,22 +1542,22 @@ function getAllKeys(e, t, n) {
|
|
|
1306
1542
|
return Array.from(new Set([...r, ...i]));
|
|
1307
1543
|
}
|
|
1308
1544
|
function applyState(e, t, n, r) {
|
|
1309
|
-
const i = t?.[
|
|
1545
|
+
const i = t?.[F];
|
|
1310
1546
|
if (!i) return;
|
|
1311
1547
|
const s = i[G];
|
|
1312
1548
|
const o = i[K];
|
|
1313
1549
|
let u = i[U];
|
|
1314
1550
|
if (e === s && !o) return;
|
|
1315
|
-
(i[
|
|
1551
|
+
(i[Y] || ee).set(e, i[V]);
|
|
1316
1552
|
i[G] = e;
|
|
1317
1553
|
i[K] = undefined;
|
|
1318
1554
|
if (Array.isArray(s)) {
|
|
1319
1555
|
let t = false;
|
|
1320
|
-
const
|
|
1321
|
-
if (e.length &&
|
|
1322
|
-
let
|
|
1556
|
+
const f = getOverrideValue(s, o, u, "length");
|
|
1557
|
+
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1558
|
+
let l, c, a, d, p, h, y, g;
|
|
1323
1559
|
for (
|
|
1324
|
-
a = 0, d = Math.min(
|
|
1560
|
+
a = 0, d = Math.min(f, e.length);
|
|
1325
1561
|
a < d && ((h = getOverrideValue(s, o, u, a)) === e[a] || (h && e[a] && n(h) === n(e[a])));
|
|
1326
1562
|
a++
|
|
1327
1563
|
) {
|
|
@@ -1330,7 +1566,7 @@ function applyState(e, t, n, r) {
|
|
|
1330
1566
|
const w = new Array(e.length),
|
|
1331
1567
|
S = new Map();
|
|
1332
1568
|
for (
|
|
1333
|
-
d =
|
|
1569
|
+
d = f - 1, p = e.length - 1;
|
|
1334
1570
|
d >= a &&
|
|
1335
1571
|
p >= a &&
|
|
1336
1572
|
((h = getOverrideValue(s, o, u, d)) === e[p] || (h && e[p] && n(h) === n(e[p])));
|
|
@@ -1349,20 +1585,20 @@ function applyState(e, t, n, r) {
|
|
|
1349
1585
|
i[U][c] && setSignal(i[U][c], s);
|
|
1350
1586
|
applyState(e[c], s, n, r);
|
|
1351
1587
|
}
|
|
1352
|
-
t && i[U][
|
|
1353
|
-
|
|
1588
|
+
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1589
|
+
f !== e.length && i[U].length && setSignal(i[U].length, e.length);
|
|
1354
1590
|
return;
|
|
1355
1591
|
}
|
|
1356
1592
|
y = new Array(p + 1);
|
|
1357
1593
|
for (c = p; c >= a; c--) {
|
|
1358
1594
|
h = e[c];
|
|
1359
1595
|
g = h ? n(h) : h;
|
|
1360
|
-
|
|
1361
|
-
y[c] =
|
|
1596
|
+
l = S.get(g);
|
|
1597
|
+
y[c] = l === undefined ? -1 : l;
|
|
1362
1598
|
S.set(g, c);
|
|
1363
1599
|
}
|
|
1364
|
-
for (
|
|
1365
|
-
h = getOverrideValue(s, o, u,
|
|
1600
|
+
for (l = a; l <= d; l++) {
|
|
1601
|
+
h = getOverrideValue(s, o, u, l);
|
|
1366
1602
|
g = h ? n(h) : h;
|
|
1367
1603
|
c = S.get(g);
|
|
1368
1604
|
if (c !== undefined && c !== -1) {
|
|
@@ -1380,23 +1616,23 @@ function applyState(e, t, n, r) {
|
|
|
1380
1616
|
}
|
|
1381
1617
|
if (a < e.length) t = true;
|
|
1382
1618
|
} else if (e.length) {
|
|
1383
|
-
for (let t = 0,
|
|
1384
|
-
const
|
|
1385
|
-
isWrappable(
|
|
1619
|
+
for (let t = 0, f = e.length; t < f; t++) {
|
|
1620
|
+
const f = getOverrideValue(s, o, u, t);
|
|
1621
|
+
isWrappable(f) ? applyState(e[t], wrap(f, i), n, r) : i[U][t] && setSignal(i[U][t], e[t]);
|
|
1386
1622
|
}
|
|
1387
1623
|
}
|
|
1388
|
-
if (
|
|
1624
|
+
if (f !== e.length) {
|
|
1389
1625
|
t = true;
|
|
1390
1626
|
i[U].length && setSignal(i[U].length, e.length);
|
|
1391
1627
|
}
|
|
1392
|
-
t && i[U][
|
|
1628
|
+
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1393
1629
|
return;
|
|
1394
1630
|
}
|
|
1395
1631
|
if (u) {
|
|
1396
|
-
const t = u[
|
|
1397
|
-
const
|
|
1398
|
-
for (let
|
|
1399
|
-
const c = l
|
|
1632
|
+
const t = u[M];
|
|
1633
|
+
const f = t || r ? getAllKeys(s, o, e) : Object.keys(u);
|
|
1634
|
+
for (let l = 0, c = f.length; l < c; l++) {
|
|
1635
|
+
const c = f[l];
|
|
1400
1636
|
const a = u[c];
|
|
1401
1637
|
const d = unwrap(getOverrideValue(s, o, u, c));
|
|
1402
1638
|
let p = unwrap(e[c]);
|
|
@@ -1407,7 +1643,7 @@ function applyState(e, t, n, r) {
|
|
|
1407
1643
|
} else applyState(p, wrap(d, i), n, r);
|
|
1408
1644
|
}
|
|
1409
1645
|
}
|
|
1410
|
-
if ((u = i[
|
|
1646
|
+
if ((u = i[J])) {
|
|
1411
1647
|
const t = Object.keys(u);
|
|
1412
1648
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1413
1649
|
const r = t[n];
|
|
@@ -1429,9 +1665,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1429
1665
|
let r;
|
|
1430
1666
|
const i = new WeakMap();
|
|
1431
1667
|
const wrapper = e => {
|
|
1432
|
-
e[
|
|
1433
|
-
e[
|
|
1434
|
-
Object.defineProperty(e,
|
|
1668
|
+
e[X] = wrapProjection;
|
|
1669
|
+
e[Y] = i;
|
|
1670
|
+
Object.defineProperty(e, Z, {
|
|
1435
1671
|
get() {
|
|
1436
1672
|
return r;
|
|
1437
1673
|
},
|
|
@@ -1440,8 +1676,8 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1440
1676
|
};
|
|
1441
1677
|
const wrapProjection = e => {
|
|
1442
1678
|
if (i.has(e)) return i.get(e);
|
|
1443
|
-
if (e[
|
|
1444
|
-
const t = createStoreProxy(e,
|
|
1679
|
+
if (e[F]?.[X] === wrapProjection) return e;
|
|
1680
|
+
const t = createStoreProxy(e, re, wrapper);
|
|
1445
1681
|
i.set(e, t);
|
|
1446
1682
|
return t;
|
|
1447
1683
|
};
|
|
@@ -1456,7 +1692,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1456
1692
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1457
1693
|
});
|
|
1458
1694
|
});
|
|
1459
|
-
r.
|
|
1695
|
+
r.Ee = true;
|
|
1460
1696
|
return { store: s, node: r };
|
|
1461
1697
|
}
|
|
1462
1698
|
function createProjection(e, t = {}, n) {
|
|
@@ -1498,46 +1734,46 @@ const T = {
|
|
|
1498
1734
|
return true;
|
|
1499
1735
|
}
|
|
1500
1736
|
};
|
|
1501
|
-
const
|
|
1737
|
+
const M = Symbol(0),
|
|
1738
|
+
q = Symbol(0),
|
|
1502
1739
|
F = Symbol(0),
|
|
1503
1740
|
V = Symbol(0),
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
const B = new WeakMap();
|
|
1741
|
+
B = Symbol(0);
|
|
1742
|
+
const D = new WeakMap();
|
|
1507
1743
|
const G = "v",
|
|
1508
1744
|
K = "o",
|
|
1509
1745
|
z = "x",
|
|
1510
1746
|
U = "n",
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
function createStoreProxy(e, t =
|
|
1747
|
+
J = "h",
|
|
1748
|
+
X = "w",
|
|
1749
|
+
Y = "l",
|
|
1750
|
+
Z = "f",
|
|
1751
|
+
$ = "p";
|
|
1752
|
+
function createStoreProxy(e, t = re, n) {
|
|
1517
1753
|
let r;
|
|
1518
1754
|
if (Array.isArray(e)) {
|
|
1519
1755
|
r = [];
|
|
1520
1756
|
r.v = e;
|
|
1521
1757
|
} else r = { v: e };
|
|
1522
1758
|
n && n(r);
|
|
1523
|
-
return (r[
|
|
1759
|
+
return (r[V] = new Proxy(r, t));
|
|
1524
1760
|
}
|
|
1525
|
-
const
|
|
1761
|
+
const ee = new WeakMap();
|
|
1526
1762
|
function wrap(e, t) {
|
|
1527
|
-
if (t?.[
|
|
1528
|
-
let n = e[
|
|
1529
|
-
if (!n)
|
|
1763
|
+
if (t?.[X]) return t[X](e, t);
|
|
1764
|
+
let n = e[V] || ee.get(e);
|
|
1765
|
+
if (!n) ee.set(e, (n = createStoreProxy(e)));
|
|
1530
1766
|
return n;
|
|
1531
1767
|
}
|
|
1532
1768
|
function isWrappable(e) {
|
|
1533
1769
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1534
1770
|
}
|
|
1535
|
-
let
|
|
1771
|
+
let te = false;
|
|
1536
1772
|
function setWriteOverride(e) {
|
|
1537
|
-
|
|
1773
|
+
te = e;
|
|
1538
1774
|
}
|
|
1539
1775
|
function writeOnly(e) {
|
|
1540
|
-
return
|
|
1776
|
+
return te || !!ne?.has(e);
|
|
1541
1777
|
}
|
|
1542
1778
|
function getNodes(e, t) {
|
|
1543
1779
|
let n = e[t];
|
|
@@ -1556,11 +1792,11 @@ function getNode(e, t, n, r, i = isEqual, s) {
|
|
|
1556
1792
|
},
|
|
1557
1793
|
r
|
|
1558
1794
|
);
|
|
1559
|
-
if (s) o.
|
|
1795
|
+
if (s) o.U = true;
|
|
1560
1796
|
return (e[t] = o);
|
|
1561
1797
|
}
|
|
1562
|
-
function trackSelf(e, t =
|
|
1563
|
-
getObserver() && read(getNode(getNodes(e, U), t, undefined, e[
|
|
1798
|
+
function trackSelf(e, t = M) {
|
|
1799
|
+
getObserver() && read(getNode(getNodes(e, U), t, undefined, e[Z], false, e[$]));
|
|
1564
1800
|
}
|
|
1565
1801
|
function getKeys(e, t, n = true) {
|
|
1566
1802
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1568,7 +1804,7 @@ function getKeys(e, t, n = true) {
|
|
|
1568
1804
|
const i = new Set(r);
|
|
1569
1805
|
const s = Reflect.ownKeys(t);
|
|
1570
1806
|
for (const e of s) {
|
|
1571
|
-
if (t[e] !==
|
|
1807
|
+
if (t[e] !== B) i.add(e);
|
|
1572
1808
|
else i.delete(e);
|
|
1573
1809
|
}
|
|
1574
1810
|
return Array.from(i);
|
|
@@ -1576,18 +1812,18 @@ function getKeys(e, t, n = true) {
|
|
|
1576
1812
|
function getPropertyDescriptor(e, t, n) {
|
|
1577
1813
|
let r = e;
|
|
1578
1814
|
if (t && n in t) {
|
|
1579
|
-
if (r[n] ===
|
|
1815
|
+
if (r[n] === B) return void 0;
|
|
1580
1816
|
if (!(n in r)) r = t;
|
|
1581
1817
|
}
|
|
1582
1818
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1583
1819
|
}
|
|
1584
|
-
let
|
|
1585
|
-
const
|
|
1820
|
+
let ne = null;
|
|
1821
|
+
const re = {
|
|
1586
1822
|
get(e, t, n) {
|
|
1587
|
-
if (t ===
|
|
1588
|
-
if (t ===
|
|
1589
|
-
if (t ===
|
|
1590
|
-
if (t ===
|
|
1823
|
+
if (t === F) return e;
|
|
1824
|
+
if (t === V) return n;
|
|
1825
|
+
if (t === S) return e[Z];
|
|
1826
|
+
if (t === M || t === q) {
|
|
1591
1827
|
trackSelf(e, t);
|
|
1592
1828
|
return n;
|
|
1593
1829
|
}
|
|
@@ -1595,105 +1831,105 @@ const ne = {
|
|
|
1595
1831
|
const i = r[t];
|
|
1596
1832
|
const s = e[z] && t in e[z];
|
|
1597
1833
|
const o = s || (e[K] && t in e[K]);
|
|
1598
|
-
const u = !!e[G][
|
|
1599
|
-
const
|
|
1834
|
+
const u = !!e[G][F];
|
|
1835
|
+
const f = s ? e[z] : e[K] && t in e[K] ? e[K] : e[G];
|
|
1600
1836
|
if (!i) {
|
|
1601
|
-
const e = Object.getOwnPropertyDescriptor(
|
|
1837
|
+
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1602
1838
|
if (e && e.get) return e.get.call(n);
|
|
1603
1839
|
}
|
|
1604
1840
|
if (writeOnly(n)) {
|
|
1605
|
-
let n = i && (o || !u) ? (i.
|
|
1606
|
-
n ===
|
|
1841
|
+
let n = i && (o || !u) ? (i.J !== y ? (i.U ? i.ye : i.J) : i.ye) : f[t];
|
|
1842
|
+
n === B && (n = undefined);
|
|
1607
1843
|
if (!isWrappable(n)) return n;
|
|
1608
1844
|
const r = wrap(n, e);
|
|
1609
|
-
|
|
1845
|
+
ne?.add(r);
|
|
1610
1846
|
return r;
|
|
1611
1847
|
}
|
|
1612
|
-
let
|
|
1613
|
-
|
|
1848
|
+
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1849
|
+
l === B && (l = undefined);
|
|
1614
1850
|
if (!i) {
|
|
1615
|
-
if (!o && typeof
|
|
1851
|
+
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1616
1852
|
let t;
|
|
1617
1853
|
return !Array.isArray(e[G]) && (t = Object.getPrototypeOf(e[G])) && t !== Object.prototype
|
|
1618
|
-
?
|
|
1619
|
-
:
|
|
1854
|
+
? l.bind(f)
|
|
1855
|
+
: l;
|
|
1620
1856
|
} else if (getObserver()) {
|
|
1621
|
-
return read(getNode(r, t, isWrappable(
|
|
1857
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[Z], isEqual, e[$]));
|
|
1622
1858
|
}
|
|
1623
1859
|
}
|
|
1624
|
-
return isWrappable(
|
|
1860
|
+
return isWrappable(l) ? wrap(l, e) : l;
|
|
1625
1861
|
},
|
|
1626
1862
|
has(e, t) {
|
|
1627
|
-
if (t ===
|
|
1628
|
-
const n = e[z] && t in e[z] ? e[z][t] !==
|
|
1629
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1863
|
+
if (t === V || t === M || t === "__proto__") return true;
|
|
1864
|
+
const n = e[z] && t in e[z] ? e[z][t] !== B : e[K] && t in e[K] ? e[K][t] !== B : t in e[G];
|
|
1865
|
+
getObserver() && read(getNode(getNodes(e, J), t, n, e[Z], isEqual, e[$]));
|
|
1630
1866
|
return n;
|
|
1631
1867
|
},
|
|
1632
1868
|
set(e, t, n) {
|
|
1633
|
-
const r = e[
|
|
1869
|
+
const r = e[V];
|
|
1634
1870
|
if (writeOnly(r)) {
|
|
1635
|
-
if (e[
|
|
1636
|
-
const t = e[
|
|
1637
|
-
if (t?.
|
|
1638
|
-
|
|
1871
|
+
if (e[$]) {
|
|
1872
|
+
const t = e[Z];
|
|
1873
|
+
if (t?.B) {
|
|
1874
|
+
E.initTransition(t.B);
|
|
1639
1875
|
}
|
|
1640
1876
|
}
|
|
1641
1877
|
untrack(() => {
|
|
1642
1878
|
const i = e[G];
|
|
1643
1879
|
const s = i[t];
|
|
1644
|
-
const o = e[
|
|
1880
|
+
const o = e[$] && !P;
|
|
1645
1881
|
const u = o ? z : K;
|
|
1646
1882
|
if (o) trackOptimisticStore(r);
|
|
1647
|
-
const
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1883
|
+
const f = e[z] && t in e[z] ? e[z][t] : e[K] && t in e[K] ? e[K][t] : s;
|
|
1884
|
+
const l = n?.[F]?.[G] ?? n;
|
|
1885
|
+
if (f === l) return true;
|
|
1650
1886
|
const c = e[z]?.length || e[K]?.length || i.length;
|
|
1651
|
-
if (
|
|
1652
|
-
else (e[u] || (e[u] = Object.create(null)))[t] =
|
|
1653
|
-
const a = isWrappable(
|
|
1654
|
-
if (isWrappable(
|
|
1655
|
-
const e =
|
|
1656
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
1887
|
+
if (l !== undefined && l === s) delete e[u][t];
|
|
1888
|
+
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
1889
|
+
const a = isWrappable(l);
|
|
1890
|
+
if (isWrappable(f)) {
|
|
1891
|
+
const e = D.get(f);
|
|
1892
|
+
e && (e instanceof Set ? e.delete(r) : D.delete(f));
|
|
1657
1893
|
}
|
|
1658
|
-
if (recursivelyNotify(r,
|
|
1659
|
-
e[
|
|
1894
|
+
if (recursivelyNotify(r, ee) && a) recursivelyAddParent(l, r);
|
|
1895
|
+
e[J]?.[t] && setSignal(e[J][t], true);
|
|
1660
1896
|
const d = getNodes(e, U);
|
|
1661
|
-
d[t] && setSignal(d[t], () => (a ? wrap(
|
|
1897
|
+
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
1662
1898
|
if (Array.isArray(i)) {
|
|
1663
1899
|
if (t === "length") {
|
|
1664
|
-
d.length && setSignal(d.length,
|
|
1900
|
+
d.length && setSignal(d.length, l);
|
|
1665
1901
|
} else {
|
|
1666
1902
|
const e = parseInt(t) + 1;
|
|
1667
1903
|
if (e > c) d.length && setSignal(d.length, e);
|
|
1668
1904
|
}
|
|
1669
1905
|
}
|
|
1670
|
-
d[
|
|
1906
|
+
d[M] && setSignal(d[M], undefined);
|
|
1671
1907
|
});
|
|
1672
1908
|
}
|
|
1673
1909
|
return true;
|
|
1674
1910
|
},
|
|
1675
1911
|
deleteProperty(e, t) {
|
|
1676
|
-
const n = e[z]?.[t] ===
|
|
1677
|
-
const r = e[K]?.[t] ===
|
|
1678
|
-
if (writeOnly(e[
|
|
1912
|
+
const n = e[z]?.[t] === B;
|
|
1913
|
+
const r = e[K]?.[t] === B;
|
|
1914
|
+
if (writeOnly(e[V]) && !n && !r) {
|
|
1679
1915
|
untrack(() => {
|
|
1680
|
-
const n = e[
|
|
1916
|
+
const n = e[$] && !P;
|
|
1681
1917
|
const r = n ? z : K;
|
|
1682
|
-
if (n) trackOptimisticStore(e[
|
|
1918
|
+
if (n) trackOptimisticStore(e[V]);
|
|
1683
1919
|
const i = e[z] && t in e[z] ? e[z][t] : e[K] && t in e[K] ? e[K][t] : e[G][t];
|
|
1684
1920
|
if (t in e[G] || (e[K] && t in e[K])) {
|
|
1685
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
1921
|
+
(e[r] || (e[r] = Object.create(null)))[t] = B;
|
|
1686
1922
|
} else if (e[r] && t in e[r]) {
|
|
1687
1923
|
delete e[r][t];
|
|
1688
1924
|
} else return true;
|
|
1689
1925
|
if (isWrappable(i)) {
|
|
1690
|
-
const t =
|
|
1691
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
1926
|
+
const t = D.get(i);
|
|
1927
|
+
t && (t instanceof Set ? t.delete(e) : D.delete(i));
|
|
1692
1928
|
}
|
|
1693
|
-
if (e[
|
|
1929
|
+
if (e[J]?.[t]) setSignal(e[J][t], false);
|
|
1694
1930
|
const s = getNodes(e, U);
|
|
1695
1931
|
s[t] && setSignal(s[t], undefined);
|
|
1696
|
-
s[
|
|
1932
|
+
s[M] && setSignal(s[M], undefined);
|
|
1697
1933
|
});
|
|
1698
1934
|
}
|
|
1699
1935
|
return true;
|
|
@@ -1704,7 +1940,7 @@ const ne = {
|
|
|
1704
1940
|
if (e[z]) {
|
|
1705
1941
|
const n = new Set(t);
|
|
1706
1942
|
for (const t of Reflect.ownKeys(e[z])) {
|
|
1707
|
-
if (e[z][t] !==
|
|
1943
|
+
if (e[z][t] !== B) n.add(t);
|
|
1708
1944
|
else n.delete(t);
|
|
1709
1945
|
}
|
|
1710
1946
|
t = Array.from(n);
|
|
@@ -1712,9 +1948,9 @@ const ne = {
|
|
|
1712
1948
|
return t;
|
|
1713
1949
|
},
|
|
1714
1950
|
getOwnPropertyDescriptor(e, t) {
|
|
1715
|
-
if (t ===
|
|
1951
|
+
if (t === V) return { value: e[V], writable: true, configurable: true };
|
|
1716
1952
|
if (e[z] && t in e[z]) {
|
|
1717
|
-
if (e[z][t] ===
|
|
1953
|
+
if (e[z][t] === B) return undefined;
|
|
1718
1954
|
const n = getPropertyDescriptor(e[G], e[K], t);
|
|
1719
1955
|
if (n) {
|
|
1720
1956
|
return { ...n, value: e[z][t] };
|
|
@@ -1728,9 +1964,9 @@ const ne = {
|
|
|
1728
1964
|
}
|
|
1729
1965
|
};
|
|
1730
1966
|
function storeSetter(e, t) {
|
|
1731
|
-
const n =
|
|
1732
|
-
|
|
1733
|
-
|
|
1967
|
+
const n = ne;
|
|
1968
|
+
ne = new Set();
|
|
1969
|
+
ne.add(e);
|
|
1734
1970
|
try {
|
|
1735
1971
|
const n = t(e);
|
|
1736
1972
|
if (n !== e && n !== undefined) {
|
|
@@ -1746,8 +1982,8 @@ function storeSetter(e, t) {
|
|
|
1746
1982
|
}
|
|
1747
1983
|
}
|
|
1748
1984
|
} finally {
|
|
1749
|
-
|
|
1750
|
-
|
|
1985
|
+
ne.clear();
|
|
1986
|
+
ne = n;
|
|
1751
1987
|
}
|
|
1752
1988
|
}
|
|
1753
1989
|
function createStore(e, t, n) {
|
|
@@ -1756,17 +1992,17 @@ function createStore(e, t, n) {
|
|
|
1756
1992
|
return [i, e => storeSetter(i, e)];
|
|
1757
1993
|
}
|
|
1758
1994
|
function recursivelyNotify(e, t) {
|
|
1759
|
-
let n = e[
|
|
1995
|
+
let n = e[F] || t?.get(e)?.[F];
|
|
1760
1996
|
let r = false;
|
|
1761
1997
|
if (n) {
|
|
1762
|
-
const e = getNodes(n, U)[
|
|
1998
|
+
const e = getNodes(n, U)[q];
|
|
1763
1999
|
if (e) {
|
|
1764
2000
|
setSignal(e, undefined);
|
|
1765
2001
|
r = true;
|
|
1766
2002
|
}
|
|
1767
|
-
t = n[
|
|
2003
|
+
t = n[Y] || t;
|
|
1768
2004
|
}
|
|
1769
|
-
const i =
|
|
2005
|
+
const i = D.get(n?.[G] || e);
|
|
1770
2006
|
if (!i) return r;
|
|
1771
2007
|
if (i instanceof Set) {
|
|
1772
2008
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -1775,16 +2011,16 @@ function recursivelyNotify(e, t) {
|
|
|
1775
2011
|
}
|
|
1776
2012
|
function recursivelyAddParent(e, t) {
|
|
1777
2013
|
let n;
|
|
1778
|
-
const r = e[
|
|
2014
|
+
const r = e[F];
|
|
1779
2015
|
if (r) {
|
|
1780
2016
|
n = r[K];
|
|
1781
2017
|
e = r[G];
|
|
1782
2018
|
}
|
|
1783
2019
|
if (t) {
|
|
1784
|
-
let n =
|
|
1785
|
-
if (!n)
|
|
2020
|
+
let n = D.get(e);
|
|
2021
|
+
if (!n) D.set(e, t);
|
|
1786
2022
|
else if (n !== t) {
|
|
1787
|
-
if (!(n instanceof Set))
|
|
2023
|
+
if (!(n instanceof Set)) D.set(e, (n = new Set([n])));
|
|
1788
2024
|
else if (n.has(t)) return;
|
|
1789
2025
|
n.add(t);
|
|
1790
2026
|
} else return;
|
|
@@ -1806,10 +2042,10 @@ function recursivelyAddParent(e, t) {
|
|
|
1806
2042
|
}
|
|
1807
2043
|
function deep(e) {
|
|
1808
2044
|
recursivelyAddParent(e);
|
|
1809
|
-
return e[
|
|
2045
|
+
return e[q];
|
|
1810
2046
|
}
|
|
1811
2047
|
function createOptimisticStore(e, t, n) {
|
|
1812
|
-
GlobalQueue.
|
|
2048
|
+
GlobalQueue.ie ||= clearOptimisticStore;
|
|
1813
2049
|
const r = typeof e === "function";
|
|
1814
2050
|
const i = (r ? t : e) ?? {};
|
|
1815
2051
|
const s = r ? e : undefined;
|
|
@@ -1817,19 +2053,28 @@ function createOptimisticStore(e, t, n) {
|
|
|
1817
2053
|
return [o, e => storeSetter(o, e)];
|
|
1818
2054
|
}
|
|
1819
2055
|
function clearOptimisticStore(e) {
|
|
1820
|
-
const t = e[
|
|
2056
|
+
const t = e[F];
|
|
1821
2057
|
if (!t || !t[z]) return;
|
|
1822
2058
|
const n = t[z];
|
|
1823
2059
|
const r = t[U];
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
2060
|
+
setProjectionWriteActive(true);
|
|
2061
|
+
try {
|
|
2062
|
+
if (r) {
|
|
2063
|
+
for (const e of Reflect.ownKeys(n)) {
|
|
2064
|
+
if (r[e]) {
|
|
2065
|
+
r[e].M = undefined;
|
|
2066
|
+
const n = t[K] && e in t[K] ? t[K][e] : t[G][e];
|
|
2067
|
+
const i = n === B ? undefined : n;
|
|
2068
|
+
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
if (r[M]) {
|
|
2072
|
+
r[M].M = undefined;
|
|
2073
|
+
setSignal(r[M], undefined);
|
|
1830
2074
|
}
|
|
1831
2075
|
}
|
|
1832
|
-
|
|
2076
|
+
} finally {
|
|
2077
|
+
setProjectionWriteActive(false);
|
|
1833
2078
|
}
|
|
1834
2079
|
delete t[z];
|
|
1835
2080
|
}
|
|
@@ -1837,10 +2082,10 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
1837
2082
|
let r;
|
|
1838
2083
|
const i = new WeakMap();
|
|
1839
2084
|
const wrapper = e => {
|
|
1840
|
-
e[
|
|
1841
|
-
e[
|
|
1842
|
-
e[
|
|
1843
|
-
Object.defineProperty(e,
|
|
2085
|
+
e[X] = wrapProjection;
|
|
2086
|
+
e[Y] = i;
|
|
2087
|
+
e[$] = true;
|
|
2088
|
+
Object.defineProperty(e, Z, {
|
|
1844
2089
|
get() {
|
|
1845
2090
|
return r;
|
|
1846
2091
|
},
|
|
@@ -1849,8 +2094,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
1849
2094
|
};
|
|
1850
2095
|
const wrapProjection = e => {
|
|
1851
2096
|
if (i.has(e)) return i.get(e);
|
|
1852
|
-
if (e[
|
|
1853
|
-
const t = createStoreProxy(e,
|
|
2097
|
+
if (e[F]?.[X] === wrapProjection) return e;
|
|
2098
|
+
const t = createStoreProxy(e, re, wrapper);
|
|
1854
2099
|
i.set(e, t);
|
|
1855
2100
|
return t;
|
|
1856
2101
|
};
|
|
@@ -1875,21 +2120,21 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
1875
2120
|
setProjectionWriteActive(false);
|
|
1876
2121
|
}
|
|
1877
2122
|
});
|
|
1878
|
-
r.
|
|
2123
|
+
r.Ee = true;
|
|
1879
2124
|
}
|
|
1880
2125
|
return { store: s, node: r };
|
|
1881
2126
|
}
|
|
1882
2127
|
function snapshot(e, t, n) {
|
|
1883
|
-
let r, i, s, o, u,
|
|
2128
|
+
let r, i, s, o, u, f;
|
|
1884
2129
|
if (!isWrappable(e)) return e;
|
|
1885
2130
|
if (t && t.has(e)) return t.get(e);
|
|
1886
2131
|
if (!t) t = new Map();
|
|
1887
|
-
if ((r = e[
|
|
2132
|
+
if ((r = e[F] || n?.get(e)?.[F])) {
|
|
1888
2133
|
s = r[K];
|
|
1889
2134
|
i = Array.isArray(r[G]);
|
|
1890
2135
|
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[G]))) : r[G]);
|
|
1891
2136
|
e = r[G];
|
|
1892
|
-
n =
|
|
2137
|
+
n = ee;
|
|
1893
2138
|
} else {
|
|
1894
2139
|
i = Array.isArray(e);
|
|
1895
2140
|
t.set(e, e);
|
|
@@ -1897,26 +2142,26 @@ function snapshot(e, t, n) {
|
|
|
1897
2142
|
if (i) {
|
|
1898
2143
|
const r = s?.length || e.length;
|
|
1899
2144
|
for (let i = 0; i < r; i++) {
|
|
1900
|
-
|
|
1901
|
-
if (
|
|
1902
|
-
if ((u = snapshot(
|
|
2145
|
+
f = s && i in s ? s[i] : e[i];
|
|
2146
|
+
if (f === B) continue;
|
|
2147
|
+
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
1903
2148
|
if (!o) t.set(e, (o = [...e]));
|
|
1904
2149
|
o[i] = u;
|
|
1905
2150
|
}
|
|
1906
2151
|
}
|
|
1907
2152
|
} else {
|
|
1908
2153
|
const r = getKeys(e, s);
|
|
1909
|
-
for (let i = 0,
|
|
1910
|
-
let
|
|
1911
|
-
const c = getPropertyDescriptor(e, s,
|
|
2154
|
+
for (let i = 0, l = r.length; i < l; i++) {
|
|
2155
|
+
let l = r[i];
|
|
2156
|
+
const c = getPropertyDescriptor(e, s, l);
|
|
1912
2157
|
if (c.get) continue;
|
|
1913
|
-
|
|
1914
|
-
if ((u = snapshot(
|
|
2158
|
+
f = s && l in s ? s[l] : e[l];
|
|
2159
|
+
if ((u = snapshot(f, t, n)) !== e[l] || o) {
|
|
1915
2160
|
if (!o) {
|
|
1916
2161
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1917
2162
|
Object.assign(o, e);
|
|
1918
2163
|
}
|
|
1919
|
-
o[
|
|
2164
|
+
o[l] = u;
|
|
1920
2165
|
}
|
|
1921
2166
|
}
|
|
1922
2167
|
}
|
|
@@ -1925,13 +2170,13 @@ function snapshot(e, t, n) {
|
|
|
1925
2170
|
function trueFn() {
|
|
1926
2171
|
return true;
|
|
1927
2172
|
}
|
|
1928
|
-
const
|
|
2173
|
+
const ie = {
|
|
1929
2174
|
get(e, t, n) {
|
|
1930
|
-
if (t ===
|
|
2175
|
+
if (t === V) return n;
|
|
1931
2176
|
return e.get(t);
|
|
1932
2177
|
},
|
|
1933
2178
|
has(e, t) {
|
|
1934
|
-
if (t ===
|
|
2179
|
+
if (t === V) return true;
|
|
1935
2180
|
return e.has(t);
|
|
1936
2181
|
},
|
|
1937
2182
|
set: trueFn,
|
|
@@ -1954,23 +2199,23 @@ const re = {
|
|
|
1954
2199
|
function resolveSource(e) {
|
|
1955
2200
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
1956
2201
|
}
|
|
1957
|
-
const
|
|
2202
|
+
const se = Symbol(0);
|
|
1958
2203
|
function merge(...e) {
|
|
1959
2204
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
1960
2205
|
let t = false;
|
|
1961
2206
|
const n = [];
|
|
1962
2207
|
for (let r = 0; r < e.length; r++) {
|
|
1963
2208
|
const i = e[r];
|
|
1964
|
-
t = t || (!!i &&
|
|
1965
|
-
const s = !!i && i[
|
|
2209
|
+
t = t || (!!i && V in i);
|
|
2210
|
+
const s = !!i && i[se];
|
|
1966
2211
|
if (s) n.push(...s);
|
|
1967
2212
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
1968
2213
|
}
|
|
1969
|
-
if (
|
|
2214
|
+
if (g && t) {
|
|
1970
2215
|
return new Proxy(
|
|
1971
2216
|
{
|
|
1972
2217
|
get(e) {
|
|
1973
|
-
if (e ===
|
|
2218
|
+
if (e === se) return n;
|
|
1974
2219
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
1975
2220
|
const r = resolveSource(n[t]);
|
|
1976
2221
|
if (e in r) return r[e];
|
|
@@ -1988,7 +2233,7 @@ function merge(...e) {
|
|
|
1988
2233
|
return [...new Set(e)];
|
|
1989
2234
|
}
|
|
1990
2235
|
},
|
|
1991
|
-
|
|
2236
|
+
ie
|
|
1992
2237
|
);
|
|
1993
2238
|
}
|
|
1994
2239
|
const r = Object.create(null);
|
|
@@ -2020,12 +2265,12 @@ function merge(...e) {
|
|
|
2020
2265
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2021
2266
|
else o[t] = n.value;
|
|
2022
2267
|
}
|
|
2023
|
-
o[
|
|
2268
|
+
o[se] = n;
|
|
2024
2269
|
return o;
|
|
2025
2270
|
}
|
|
2026
2271
|
function omit(e, ...t) {
|
|
2027
2272
|
const n = new Set(t);
|
|
2028
|
-
if (
|
|
2273
|
+
if (g && V in e) {
|
|
2029
2274
|
return new Proxy(
|
|
2030
2275
|
{
|
|
2031
2276
|
get(t) {
|
|
@@ -2038,7 +2283,7 @@ function omit(e, ...t) {
|
|
|
2038
2283
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2039
2284
|
}
|
|
2040
2285
|
},
|
|
2041
|
-
|
|
2286
|
+
ie
|
|
2042
2287
|
);
|
|
2043
2288
|
}
|
|
2044
2289
|
const r = {};
|
|
@@ -2056,313 +2301,321 @@ function mapArray(e, t, n) {
|
|
|
2056
2301
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2057
2302
|
return createMemo(
|
|
2058
2303
|
updateKeyedMap.bind({
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2304
|
+
Me: createOwner(),
|
|
2305
|
+
qe: 0,
|
|
2306
|
+
Fe: e,
|
|
2307
|
+
Ve: [],
|
|
2308
|
+
Be: t,
|
|
2309
|
+
De: [],
|
|
2310
|
+
Ge: [],
|
|
2311
|
+
Ke: r,
|
|
2312
|
+
ze: r || n?.keyed === false ? [] : undefined,
|
|
2313
|
+
Ue: t.length > 1 ? [] : undefined,
|
|
2314
|
+
Je: n?.fallback
|
|
2070
2315
|
})
|
|
2071
2316
|
);
|
|
2072
2317
|
}
|
|
2073
|
-
const
|
|
2318
|
+
const oe = { pureWrite: true };
|
|
2074
2319
|
function updateKeyedMap() {
|
|
2075
|
-
const e = this.
|
|
2320
|
+
const e = this.Fe() || [],
|
|
2076
2321
|
t = e.length;
|
|
2077
|
-
e[
|
|
2078
|
-
runWithOwner(this.
|
|
2322
|
+
e[M];
|
|
2323
|
+
runWithOwner(this.Me, () => {
|
|
2079
2324
|
let n,
|
|
2080
2325
|
r,
|
|
2081
|
-
i = this.
|
|
2326
|
+
i = this.ze
|
|
2082
2327
|
? () => {
|
|
2083
|
-
this.
|
|
2084
|
-
this.
|
|
2085
|
-
return this.
|
|
2086
|
-
read.bind(null, this.
|
|
2087
|
-
this.
|
|
2328
|
+
this.ze[r] = signal(e[r], oe);
|
|
2329
|
+
this.Ue && (this.Ue[r] = signal(r, oe));
|
|
2330
|
+
return this.Be(
|
|
2331
|
+
read.bind(null, this.ze[r]),
|
|
2332
|
+
this.Ue ? read.bind(null, this.Ue[r]) : undefined
|
|
2088
2333
|
);
|
|
2089
2334
|
}
|
|
2090
|
-
: this.
|
|
2335
|
+
: this.Ue
|
|
2091
2336
|
? () => {
|
|
2092
2337
|
const t = e[r];
|
|
2093
|
-
this.
|
|
2094
|
-
return this.
|
|
2338
|
+
this.Ue[r] = signal(r, oe);
|
|
2339
|
+
return this.Be(() => t, read.bind(null, this.Ue[r]));
|
|
2095
2340
|
}
|
|
2096
2341
|
: () => {
|
|
2097
2342
|
const t = e[r];
|
|
2098
|
-
return this.
|
|
2343
|
+
return this.Be(() => t);
|
|
2099
2344
|
};
|
|
2100
2345
|
if (t === 0) {
|
|
2101
|
-
if (this.
|
|
2102
|
-
this.
|
|
2103
|
-
this.
|
|
2104
|
-
this.
|
|
2105
|
-
this.
|
|
2106
|
-
this.
|
|
2107
|
-
this.
|
|
2108
|
-
this.
|
|
2109
|
-
}
|
|
2110
|
-
if (this.
|
|
2111
|
-
this.
|
|
2112
|
-
}
|
|
2113
|
-
} else if (this.
|
|
2114
|
-
if (this.
|
|
2115
|
-
this.
|
|
2346
|
+
if (this.qe !== 0) {
|
|
2347
|
+
this.Me.dispose(false);
|
|
2348
|
+
this.Ge = [];
|
|
2349
|
+
this.Ve = [];
|
|
2350
|
+
this.De = [];
|
|
2351
|
+
this.qe = 0;
|
|
2352
|
+
this.ze && (this.ze = []);
|
|
2353
|
+
this.Ue && (this.Ue = []);
|
|
2354
|
+
}
|
|
2355
|
+
if (this.Je && !this.De[0]) {
|
|
2356
|
+
this.De[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2357
|
+
}
|
|
2358
|
+
} else if (this.qe === 0) {
|
|
2359
|
+
if (this.Ge[0]) this.Ge[0].dispose();
|
|
2360
|
+
this.De = new Array(t);
|
|
2116
2361
|
for (r = 0; r < t; r++) {
|
|
2117
|
-
this.
|
|
2118
|
-
this.
|
|
2362
|
+
this.Ve[r] = e[r];
|
|
2363
|
+
this.De[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2119
2364
|
}
|
|
2120
|
-
this.
|
|
2365
|
+
this.qe = t;
|
|
2121
2366
|
} else {
|
|
2122
2367
|
let s,
|
|
2123
2368
|
o,
|
|
2124
2369
|
u,
|
|
2125
|
-
l,
|
|
2126
2370
|
f,
|
|
2371
|
+
l,
|
|
2127
2372
|
c,
|
|
2128
2373
|
a,
|
|
2129
2374
|
d = new Array(t),
|
|
2130
2375
|
p = new Array(t),
|
|
2131
|
-
h = this.
|
|
2132
|
-
y = this.
|
|
2376
|
+
h = this.ze ? new Array(t) : undefined,
|
|
2377
|
+
y = this.Ue ? new Array(t) : undefined;
|
|
2133
2378
|
for (
|
|
2134
|
-
s = 0, o = Math.min(this.
|
|
2135
|
-
s < o && (this.
|
|
2379
|
+
s = 0, o = Math.min(this.qe, t);
|
|
2380
|
+
s < o && (this.Ve[s] === e[s] || (this.ze && compare(this.Ke, this.Ve[s], e[s])));
|
|
2136
2381
|
s++
|
|
2137
2382
|
) {
|
|
2138
|
-
if (this.
|
|
2383
|
+
if (this.ze) setSignal(this.ze[s], e[s]);
|
|
2139
2384
|
}
|
|
2140
2385
|
for (
|
|
2141
|
-
o = this.
|
|
2386
|
+
o = this.qe - 1, u = t - 1;
|
|
2142
2387
|
o >= s &&
|
|
2143
2388
|
u >= s &&
|
|
2144
|
-
(this.
|
|
2389
|
+
(this.Ve[o] === e[u] || (this.ze && compare(this.Ke, this.Ve[o], e[u])));
|
|
2145
2390
|
o--, u--
|
|
2146
2391
|
) {
|
|
2147
|
-
d[u] = this.
|
|
2148
|
-
p[u] = this.
|
|
2149
|
-
h && (h[u] = this.
|
|
2150
|
-
y && (y[u] = this.
|
|
2392
|
+
d[u] = this.De[o];
|
|
2393
|
+
p[u] = this.Ge[o];
|
|
2394
|
+
h && (h[u] = this.ze[o]);
|
|
2395
|
+
y && (y[u] = this.Ue[o]);
|
|
2151
2396
|
}
|
|
2152
2397
|
c = new Map();
|
|
2153
2398
|
a = new Array(u + 1);
|
|
2154
2399
|
for (r = u; r >= s; r--) {
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
n = c.get(
|
|
2400
|
+
f = e[r];
|
|
2401
|
+
l = this.Ke ? this.Ke(f) : f;
|
|
2402
|
+
n = c.get(l);
|
|
2158
2403
|
a[r] = n === undefined ? -1 : n;
|
|
2159
|
-
c.set(
|
|
2404
|
+
c.set(l, r);
|
|
2160
2405
|
}
|
|
2161
2406
|
for (n = s; n <= o; n++) {
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
r = c.get(
|
|
2407
|
+
f = this.Ve[n];
|
|
2408
|
+
l = this.Ke ? this.Ke(f) : f;
|
|
2409
|
+
r = c.get(l);
|
|
2165
2410
|
if (r !== undefined && r !== -1) {
|
|
2166
|
-
d[r] = this.
|
|
2167
|
-
p[r] = this.
|
|
2168
|
-
h && (h[r] = this.
|
|
2169
|
-
y && (y[r] = this.
|
|
2411
|
+
d[r] = this.De[n];
|
|
2412
|
+
p[r] = this.Ge[n];
|
|
2413
|
+
h && (h[r] = this.ze[n]);
|
|
2414
|
+
y && (y[r] = this.Ue[n]);
|
|
2170
2415
|
r = a[r];
|
|
2171
|
-
c.set(
|
|
2172
|
-
} else this.
|
|
2416
|
+
c.set(l, r);
|
|
2417
|
+
} else this.Ge[n].dispose();
|
|
2173
2418
|
}
|
|
2174
2419
|
for (r = s; r < t; r++) {
|
|
2175
2420
|
if (r in d) {
|
|
2176
|
-
this.
|
|
2177
|
-
this.
|
|
2421
|
+
this.De[r] = d[r];
|
|
2422
|
+
this.Ge[r] = p[r];
|
|
2178
2423
|
if (h) {
|
|
2179
|
-
this.
|
|
2180
|
-
setSignal(this.
|
|
2424
|
+
this.ze[r] = h[r];
|
|
2425
|
+
setSignal(this.ze[r], e[r]);
|
|
2181
2426
|
}
|
|
2182
2427
|
if (y) {
|
|
2183
|
-
this.
|
|
2184
|
-
setSignal(this.
|
|
2428
|
+
this.Ue[r] = y[r];
|
|
2429
|
+
setSignal(this.Ue[r], r);
|
|
2185
2430
|
}
|
|
2186
2431
|
} else {
|
|
2187
|
-
this.
|
|
2432
|
+
this.De[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2188
2433
|
}
|
|
2189
2434
|
}
|
|
2190
|
-
this.
|
|
2191
|
-
this.
|
|
2435
|
+
this.De = this.De.slice(0, (this.qe = t));
|
|
2436
|
+
this.Ve = e.slice(0);
|
|
2192
2437
|
}
|
|
2193
2438
|
});
|
|
2194
|
-
return this.
|
|
2439
|
+
return this.De;
|
|
2195
2440
|
}
|
|
2196
2441
|
function repeat(e, t, n) {
|
|
2197
2442
|
return updateRepeat.bind({
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2443
|
+
Me: createOwner(),
|
|
2444
|
+
qe: 0,
|
|
2445
|
+
Xe: 0,
|
|
2446
|
+
Ye: e,
|
|
2447
|
+
Be: t,
|
|
2448
|
+
Ge: [],
|
|
2449
|
+
De: [],
|
|
2450
|
+
Ze: n?.from,
|
|
2451
|
+
Je: n?.fallback
|
|
2207
2452
|
});
|
|
2208
2453
|
}
|
|
2209
2454
|
function updateRepeat() {
|
|
2210
|
-
const e = this.
|
|
2211
|
-
const t = this.
|
|
2212
|
-
runWithOwner(this.
|
|
2455
|
+
const e = this.Ye();
|
|
2456
|
+
const t = this.Ze?.() || 0;
|
|
2457
|
+
runWithOwner(this.Me, () => {
|
|
2213
2458
|
if (e === 0) {
|
|
2214
|
-
if (this.
|
|
2215
|
-
this.
|
|
2216
|
-
this.
|
|
2217
|
-
this.
|
|
2218
|
-
this.
|
|
2459
|
+
if (this.qe !== 0) {
|
|
2460
|
+
this.Me.dispose(false);
|
|
2461
|
+
this.Ge = [];
|
|
2462
|
+
this.De = [];
|
|
2463
|
+
this.qe = 0;
|
|
2219
2464
|
}
|
|
2220
|
-
if (this.
|
|
2221
|
-
this.
|
|
2465
|
+
if (this.Je && !this.De[0]) {
|
|
2466
|
+
this.De[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2222
2467
|
}
|
|
2223
2468
|
return;
|
|
2224
2469
|
}
|
|
2225
2470
|
const n = t + e;
|
|
2226
|
-
const r = this.
|
|
2227
|
-
if (this.
|
|
2228
|
-
for (let e = n; e < r; e++) this.
|
|
2229
|
-
if (this.
|
|
2230
|
-
let e = this.
|
|
2231
|
-
while (e < t && e < this.
|
|
2232
|
-
this.
|
|
2233
|
-
this.
|
|
2234
|
-
} else if (this.
|
|
2235
|
-
let n = r - this.
|
|
2236
|
-
let i = this.
|
|
2237
|
-
this.
|
|
2471
|
+
const r = this.Xe + this.qe;
|
|
2472
|
+
if (this.qe === 0 && this.Ge[0]) this.Ge[0].dispose();
|
|
2473
|
+
for (let e = n; e < r; e++) this.Ge[e - this.Xe].dispose();
|
|
2474
|
+
if (this.Xe < t) {
|
|
2475
|
+
let e = this.Xe;
|
|
2476
|
+
while (e < t && e < this.qe) this.Ge[e++].dispose();
|
|
2477
|
+
this.Ge.splice(0, t - this.Xe);
|
|
2478
|
+
this.De.splice(0, t - this.Xe);
|
|
2479
|
+
} else if (this.Xe > t) {
|
|
2480
|
+
let n = r - this.Xe - 1;
|
|
2481
|
+
let i = this.Xe - t;
|
|
2482
|
+
this.Ge.length = this.De.length = e;
|
|
2238
2483
|
while (n >= i) {
|
|
2239
|
-
this.
|
|
2240
|
-
this.
|
|
2484
|
+
this.Ge[n] = this.Ge[n - i];
|
|
2485
|
+
this.De[n] = this.De[n - i];
|
|
2241
2486
|
n--;
|
|
2242
2487
|
}
|
|
2243
2488
|
for (let e = 0; e < i; e++) {
|
|
2244
|
-
this.
|
|
2489
|
+
this.De[e] = runWithOwner((this.Ge[e] = createOwner()), () => this.Be(e + t));
|
|
2245
2490
|
}
|
|
2246
2491
|
}
|
|
2247
2492
|
for (let e = r; e < n; e++) {
|
|
2248
|
-
this.
|
|
2493
|
+
this.De[e - t] = runWithOwner((this.Ge[e - t] = createOwner()), () => this.Be(e));
|
|
2249
2494
|
}
|
|
2250
|
-
this.
|
|
2251
|
-
this.
|
|
2252
|
-
this.
|
|
2495
|
+
this.De = this.De.slice(0, e);
|
|
2496
|
+
this.Xe = t;
|
|
2497
|
+
this.qe = e;
|
|
2253
2498
|
});
|
|
2254
|
-
return this.
|
|
2499
|
+
return this.De;
|
|
2255
2500
|
}
|
|
2256
2501
|
function compare(e, t, n) {
|
|
2257
2502
|
return e ? e(t) === e(n) : true;
|
|
2258
2503
|
}
|
|
2259
2504
|
function boundaryComputed(e, t) {
|
|
2260
2505
|
const n = computed(e, undefined, { lazy: true });
|
|
2261
|
-
n.
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2264
|
-
n
|
|
2506
|
+
n.Pe = (e, t) => {
|
|
2507
|
+
const r = e !== undefined ? e : n.ge;
|
|
2508
|
+
const i = t !== undefined ? t : n.oe;
|
|
2509
|
+
n.ge &= ~n.$e;
|
|
2510
|
+
n.pe.notify(n, n.$e, r, i);
|
|
2265
2511
|
};
|
|
2266
|
-
n
|
|
2267
|
-
n.
|
|
2512
|
+
n.$e = t;
|
|
2513
|
+
n.Ee = true;
|
|
2268
2514
|
recompute(n, true);
|
|
2269
2515
|
return n;
|
|
2270
2516
|
}
|
|
2271
2517
|
function createBoundChildren(e, t, n, r) {
|
|
2272
|
-
const i = e
|
|
2273
|
-
i.addChild((e
|
|
2274
|
-
onCleanup(() => i.removeChild(e
|
|
2518
|
+
const i = e.pe;
|
|
2519
|
+
i.addChild((e.pe = n));
|
|
2520
|
+
onCleanup(() => i.removeChild(e.pe));
|
|
2275
2521
|
return runWithOwner(e, () => {
|
|
2276
2522
|
const e = computed(t);
|
|
2277
2523
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2278
2524
|
});
|
|
2279
2525
|
}
|
|
2280
2526
|
class ConditionalQueue extends Queue {
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2527
|
+
et;
|
|
2528
|
+
tt = new Set();
|
|
2529
|
+
$ = new Set();
|
|
2284
2530
|
constructor(e) {
|
|
2285
2531
|
super();
|
|
2286
|
-
this.
|
|
2532
|
+
this.et = e;
|
|
2287
2533
|
}
|
|
2288
2534
|
run(e) {
|
|
2289
|
-
if (!e || read(this.
|
|
2535
|
+
if (!e || read(this.et)) return;
|
|
2290
2536
|
return super.run(e);
|
|
2291
2537
|
}
|
|
2292
|
-
notify(e, t, n) {
|
|
2293
|
-
if (read(this.
|
|
2538
|
+
notify(e, t, n, r) {
|
|
2539
|
+
if (read(this.et)) {
|
|
2540
|
+
if (t & l) {
|
|
2541
|
+
if (n & l) {
|
|
2542
|
+
this.$.add(e);
|
|
2543
|
+
t &= ~l;
|
|
2544
|
+
} else if (this.$.delete(e)) t &= ~l;
|
|
2545
|
+
}
|
|
2294
2546
|
if (t & c) {
|
|
2295
2547
|
if (n & c) {
|
|
2296
|
-
this.
|
|
2548
|
+
this.tt.add(e);
|
|
2297
2549
|
t &= ~c;
|
|
2298
|
-
} else if (this.
|
|
2299
|
-
}
|
|
2300
|
-
if (t & a) {
|
|
2301
|
-
if (n & a) {
|
|
2302
|
-
this.Ge.add(e);
|
|
2303
|
-
t &= ~a;
|
|
2304
|
-
} else if (this.Ge.delete(e)) t &= ~a;
|
|
2550
|
+
} else if (this.tt.delete(e)) t &= ~c;
|
|
2305
2551
|
}
|
|
2306
2552
|
}
|
|
2307
|
-
return t ? super.notify(e, t, n) : true;
|
|
2553
|
+
return t ? super.notify(e, t, n, r ?? e.oe) : true;
|
|
2308
2554
|
}
|
|
2309
2555
|
}
|
|
2310
2556
|
class CollectionQueue extends Queue {
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2557
|
+
nt;
|
|
2558
|
+
rt = new Set();
|
|
2559
|
+
et = signal(false, { pureWrite: true });
|
|
2560
|
+
it = false;
|
|
2315
2561
|
constructor(e) {
|
|
2316
2562
|
super();
|
|
2317
|
-
this.
|
|
2563
|
+
this.nt = e;
|
|
2318
2564
|
}
|
|
2319
2565
|
run(e) {
|
|
2320
|
-
if (!e || read(this.
|
|
2566
|
+
if (!e || read(this.et)) return;
|
|
2321
2567
|
return super.run(e);
|
|
2322
2568
|
}
|
|
2323
|
-
notify(e, t, n) {
|
|
2324
|
-
if (!(t & this.
|
|
2325
|
-
if (n & this.
|
|
2326
|
-
|
|
2327
|
-
if (
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2569
|
+
notify(e, t, n, r) {
|
|
2570
|
+
if (!(t & this.nt) || (this.nt & l && this.it)) return super.notify(e, t, n, r);
|
|
2571
|
+
if (n & this.nt) {
|
|
2572
|
+
const t = r?.t || e.oe?.t;
|
|
2573
|
+
if (t) {
|
|
2574
|
+
const e = this.rt.size === 0;
|
|
2575
|
+
this.rt.add(t);
|
|
2576
|
+
if (e) setSignal(this.et, true);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
t &= ~this.nt;
|
|
2580
|
+
return t ? super.notify(e, t, n, r) : true;
|
|
2581
|
+
}
|
|
2582
|
+
checkSources() {
|
|
2583
|
+
for (const e of this.rt) {
|
|
2584
|
+
if (!(e.ge & this.nt)) this.rt.delete(e);
|
|
2331
2585
|
}
|
|
2332
|
-
|
|
2333
|
-
return t ? super.notify(e, t, n) : true;
|
|
2586
|
+
if (!this.rt.size) setSignal(this.et, false);
|
|
2334
2587
|
}
|
|
2335
2588
|
}
|
|
2336
|
-
var
|
|
2589
|
+
var ue;
|
|
2337
2590
|
(function (e) {
|
|
2338
2591
|
e["VISIBLE"] = "visible";
|
|
2339
2592
|
e["HIDDEN"] = "hidden";
|
|
2340
|
-
})(
|
|
2593
|
+
})(ue || (ue = {}));
|
|
2341
2594
|
function createBoundary(e, t) {
|
|
2342
2595
|
const n = createOwner();
|
|
2343
|
-
const r = new ConditionalQueue(computed(() => t() ===
|
|
2596
|
+
const r = new ConditionalQueue(computed(() => t() === ue.HIDDEN));
|
|
2344
2597
|
const i = createBoundChildren(n, e, r, 0);
|
|
2345
2598
|
computed(() => {
|
|
2346
|
-
const e = read(r.
|
|
2347
|
-
i
|
|
2599
|
+
const e = read(r.et);
|
|
2600
|
+
i.$e = e ? c | l : 0;
|
|
2348
2601
|
if (!e) {
|
|
2349
|
-
r
|
|
2350
|
-
r.
|
|
2351
|
-
r
|
|
2352
|
-
r.
|
|
2602
|
+
r.$.forEach(e => r.notify(e, l, l, e.oe));
|
|
2603
|
+
r.tt.forEach(e => r.notify(e, c, c, e.oe));
|
|
2604
|
+
r.$.clear();
|
|
2605
|
+
r.tt.clear();
|
|
2353
2606
|
}
|
|
2354
2607
|
});
|
|
2355
|
-
return () => (read(r.
|
|
2608
|
+
return () => (read(r.et) ? undefined : read(i));
|
|
2356
2609
|
}
|
|
2357
2610
|
function createCollectionBoundary(e, t, n) {
|
|
2358
2611
|
const r = createOwner();
|
|
2359
2612
|
const i = new CollectionQueue(e);
|
|
2360
2613
|
const s = createBoundChildren(r, t, i, e);
|
|
2361
2614
|
const o = computed(() => {
|
|
2362
|
-
if (!read(i.
|
|
2615
|
+
if (!read(i.et)) {
|
|
2363
2616
|
const e = read(s);
|
|
2364
|
-
if (!untrack(() => read(i.
|
|
2365
|
-
i.
|
|
2617
|
+
if (!untrack(() => read(i.et))) {
|
|
2618
|
+
i.it = true;
|
|
2366
2619
|
return e;
|
|
2367
2620
|
}
|
|
2368
2621
|
}
|
|
@@ -2371,28 +2624,14 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2371
2624
|
return read.bind(null, o);
|
|
2372
2625
|
}
|
|
2373
2626
|
function createLoadBoundary(e, t) {
|
|
2374
|
-
return createCollectionBoundary(
|
|
2375
|
-
}
|
|
2376
|
-
function collectErrorSources(e, t) {
|
|
2377
|
-
let n = true;
|
|
2378
|
-
let r = e.j;
|
|
2379
|
-
while (r !== null) {
|
|
2380
|
-
const e = r.H;
|
|
2381
|
-
if (e.j && e.re & a) {
|
|
2382
|
-
n = false;
|
|
2383
|
-
collectErrorSources(e, t);
|
|
2384
|
-
}
|
|
2385
|
-
r = r.N;
|
|
2386
|
-
}
|
|
2387
|
-
n && t.push(e);
|
|
2627
|
+
return createCollectionBoundary(l, e, () => t());
|
|
2388
2628
|
}
|
|
2389
2629
|
function createErrorBoundary(e, t) {
|
|
2390
|
-
return createCollectionBoundary(
|
|
2391
|
-
let n = e.
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
for (const
|
|
2395
|
-
for (const e of t) recompute(e);
|
|
2630
|
+
return createCollectionBoundary(c, e, e => {
|
|
2631
|
+
let n = e.rt.values().next().value;
|
|
2632
|
+
const r = n.oe?.cause ?? n.oe;
|
|
2633
|
+
return t(r, () => {
|
|
2634
|
+
for (const t of e.rt) recompute(t);
|
|
2396
2635
|
schedule();
|
|
2397
2636
|
});
|
|
2398
2637
|
});
|
|
@@ -2446,13 +2685,13 @@ function flattenArray(e, t = [], n) {
|
|
|
2446
2685
|
if (r) throw r;
|
|
2447
2686
|
return i;
|
|
2448
2687
|
}
|
|
2449
|
-
exports.$PROXY =
|
|
2450
|
-
exports.$TARGET =
|
|
2451
|
-
exports.$TRACK =
|
|
2688
|
+
exports.$PROXY = V;
|
|
2689
|
+
exports.$TARGET = F;
|
|
2690
|
+
exports.$TRACK = M;
|
|
2452
2691
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2453
2692
|
exports.NoOwnerError = NoOwnerError;
|
|
2454
2693
|
exports.NotReadyError = NotReadyError;
|
|
2455
|
-
exports.SUPPORTS_PROXY =
|
|
2694
|
+
exports.SUPPORTS_PROXY = g;
|
|
2456
2695
|
exports.action = action;
|
|
2457
2696
|
exports.createBoundary = createBoundary;
|
|
2458
2697
|
exports.createContext = createContext;
|