@solidjs/signals 0.8.3 → 0.8.5
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 +761 -815
- package/dist/node.cjs +1614 -1858
- package/dist/prod.js +1635 -1790
- package/dist/types/boundaries.d.ts +1 -1
- package/dist/types/core/constants.d.ts +16 -21
- package/dist/types/core/core.d.ts +6 -5
- package/dist/types/core/heap.d.ts +1 -2
- package/dist/types/core/scheduler.d.ts +3 -3
- package/package.json +8 -3
package/dist/prod.js
CHANGED
|
@@ -1,728 +1,645 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
constructor(
|
|
1
|
+
class NotReadyError extends Error {
|
|
2
|
+
cause;
|
|
3
|
+
constructor(e) {
|
|
4
4
|
super();
|
|
5
|
-
this.cause =
|
|
5
|
+
this.cause = e;
|
|
6
6
|
}
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
}
|
|
8
|
+
class NoOwnerError extends Error {
|
|
9
9
|
constructor() {
|
|
10
10
|
super("");
|
|
11
11
|
}
|
|
12
|
-
};
|
|
13
|
-
var ContextNotFoundError = class extends Error {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(
|
|
16
|
-
""
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// src/core/constants.ts
|
|
22
|
-
var NOT_PENDING = {};
|
|
23
|
-
var SUPPORTS_PROXY = typeof Proxy === "function";
|
|
24
|
-
|
|
25
|
-
// src/core/heap.ts
|
|
26
|
-
function actualInsertIntoHeap(n, heap) {
|
|
27
|
-
const parentHeight = (n.w?.$ ? n.w.aa?.c : n.w?.c) ?? -1;
|
|
28
|
-
if (parentHeight >= n.c)
|
|
29
|
-
n.c = parentHeight + 1;
|
|
30
|
-
const height = n.c;
|
|
31
|
-
const heapAtHeight = heap.s[height];
|
|
32
|
-
if (heapAtHeight === void 0) {
|
|
33
|
-
heap.s[height] = n;
|
|
34
|
-
} else {
|
|
35
|
-
const tail = heapAtHeight.z;
|
|
36
|
-
tail.Q = n;
|
|
37
|
-
n.z = tail;
|
|
38
|
-
heapAtHeight.z = n;
|
|
39
|
-
}
|
|
40
|
-
if (height > heap.L) {
|
|
41
|
-
heap.L = height;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function insertIntoHeap(n, heap) {
|
|
45
|
-
let flags = n.b;
|
|
46
|
-
if (flags & (8 /* InHeap */ | 4 /* RecomputingDeps */))
|
|
47
|
-
return;
|
|
48
|
-
if (flags & 1 /* Check */) {
|
|
49
|
-
n.b = flags & ~(1 /* Check */ | 2 /* Dirty */) | 2 /* Dirty */ | 8 /* InHeap */;
|
|
50
|
-
} else
|
|
51
|
-
n.b = flags | 8 /* InHeap */;
|
|
52
|
-
if (!(flags & 16 /* InHeapHeight */)) {
|
|
53
|
-
actualInsertIntoHeap(n, heap);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function insertIntoHeapHeight(n, heap) {
|
|
57
|
-
let flags = n.b;
|
|
58
|
-
if (flags & (8 /* InHeap */ | 4 /* RecomputingDeps */ | 16 /* InHeapHeight */))
|
|
59
|
-
return;
|
|
60
|
-
n.b = flags | 16 /* InHeapHeight */;
|
|
61
|
-
actualInsertIntoHeap(n, heap);
|
|
62
|
-
}
|
|
63
|
-
function deleteFromHeap(n, heap) {
|
|
64
|
-
const flags = n.b;
|
|
65
|
-
if (!(flags & (8 /* InHeap */ | 16 /* InHeapHeight */)))
|
|
66
|
-
return;
|
|
67
|
-
n.b = flags & ~(8 /* InHeap */ | 16 /* InHeapHeight */);
|
|
68
|
-
const height = n.c;
|
|
69
|
-
if (n.z === n) {
|
|
70
|
-
heap.s[height] = void 0;
|
|
71
|
-
} else {
|
|
72
|
-
const next = n.Q;
|
|
73
|
-
const dhh = heap.s[height];
|
|
74
|
-
const end = next ?? dhh;
|
|
75
|
-
if (n === dhh) {
|
|
76
|
-
heap.s[height] = next;
|
|
77
|
-
} else {
|
|
78
|
-
n.z.Q = next;
|
|
79
|
-
}
|
|
80
|
-
end.z = n.z;
|
|
81
|
-
}
|
|
82
|
-
n.z = n;
|
|
83
|
-
n.Q = void 0;
|
|
84
12
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
heap.ba = true;
|
|
89
|
-
for (let i = 0; i <= heap.L; i++) {
|
|
90
|
-
for (let el = heap.s[i]; el !== void 0; el = el.Q) {
|
|
91
|
-
if (el.b & 8 /* InHeap */)
|
|
92
|
-
markNode(el);
|
|
93
|
-
}
|
|
13
|
+
class ContextNotFoundError extends Error {
|
|
14
|
+
constructor() {
|
|
15
|
+
super("");
|
|
94
16
|
}
|
|
95
17
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
18
|
+
const REACTIVE_NONE = 0;
|
|
19
|
+
const REACTIVE_CHECK = 1 << 0;
|
|
20
|
+
const REACTIVE_DIRTY = 1 << 1;
|
|
21
|
+
const REACTIVE_RECOMPUTING_DEPS = 1 << 2;
|
|
22
|
+
const REACTIVE_IN_HEAP = 1 << 3;
|
|
23
|
+
const REACTIVE_IN_HEAP_HEIGHT = 1 << 4;
|
|
24
|
+
const REACTIVE_ZOMBIE = 1 << 5;
|
|
25
|
+
const REACTIVE_DISPOSED = 1 << 6;
|
|
26
|
+
const STATUS_NONE = 0;
|
|
27
|
+
const STATUS_PENDING = 1 << 0;
|
|
28
|
+
const STATUS_ERROR = 1 << 1;
|
|
29
|
+
const STATUS_UNINITIALIZED = 1 << 2;
|
|
30
|
+
const EFFECT_RENDER = 1;
|
|
31
|
+
const EFFECT_USER = 2;
|
|
32
|
+
const NOT_PENDING = {};
|
|
33
|
+
const SUPPORTS_PROXY = typeof Proxy === "function";
|
|
34
|
+
const defaultContext = {};
|
|
35
|
+
function actualInsertIntoHeap(e, t) {
|
|
36
|
+
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
37
|
+
if (n >= e.o) e.o = n + 1;
|
|
38
|
+
const i = e.o;
|
|
39
|
+
const r = t.l[i];
|
|
40
|
+
if (r === undefined) t.l[i] = e;
|
|
41
|
+
else {
|
|
42
|
+
const t = r.T;
|
|
43
|
+
t.R = e;
|
|
44
|
+
e.T = t;
|
|
45
|
+
r.T = e;
|
|
46
|
+
}
|
|
47
|
+
if (i > t.h) t.h = i;
|
|
48
|
+
}
|
|
49
|
+
function insertIntoHeap(e, t) {
|
|
50
|
+
let n = e._;
|
|
51
|
+
if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS)) return;
|
|
52
|
+
if (n & REACTIVE_CHECK) {
|
|
53
|
+
e._ = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
|
|
54
|
+
} else e._ = n | REACTIVE_IN_HEAP;
|
|
55
|
+
if (!(n & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
|
|
56
|
+
}
|
|
57
|
+
function insertIntoHeapHeight(e, t) {
|
|
58
|
+
let n = e._;
|
|
59
|
+
if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT)) return;
|
|
60
|
+
e._ = n | REACTIVE_IN_HEAP_HEIGHT;
|
|
61
|
+
actualInsertIntoHeap(e, t);
|
|
62
|
+
}
|
|
63
|
+
function deleteFromHeap(e, t) {
|
|
64
|
+
const n = e._;
|
|
65
|
+
if (!(n & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
|
|
66
|
+
e._ = n & -25;
|
|
67
|
+
const i = e.o;
|
|
68
|
+
if (e.T === e) t.l[i] = undefined;
|
|
69
|
+
else {
|
|
70
|
+
const n = e.R;
|
|
71
|
+
const r = t.l[i];
|
|
72
|
+
const s = n ?? r;
|
|
73
|
+
if (e === r) t.l[i] = n;
|
|
74
|
+
else e.T.R = n;
|
|
75
|
+
s.T = e.T;
|
|
76
|
+
}
|
|
77
|
+
e.T = e;
|
|
78
|
+
e.R = undefined;
|
|
79
|
+
}
|
|
80
|
+
function markHeap(e) {
|
|
81
|
+
if (e.S) return;
|
|
82
|
+
e.S = true;
|
|
83
|
+
for (let t = 0; t <= e.h; t++) {
|
|
84
|
+
for (let n = e.l[t]; n !== undefined; n = n.R) {
|
|
85
|
+
if (n._ & REACTIVE_IN_HEAP) markNode(n);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function markNode(e, t = REACTIVE_DIRTY) {
|
|
90
|
+
const n = e._;
|
|
91
|
+
if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
|
|
92
|
+
e._ = (n & -4) | t;
|
|
93
|
+
for (let t = e.O; t !== null; t = t.p) {
|
|
94
|
+
markNode(t.A, REACTIVE_CHECK);
|
|
95
|
+
}
|
|
96
|
+
if (e.N !== null) {
|
|
97
|
+
for (let t = e.N; t !== null; t = t.I) {
|
|
98
|
+
for (let e = t.O; e !== null; e = e.p) {
|
|
99
|
+
markNode(e.A, REACTIVE_CHECK);
|
|
108
100
|
}
|
|
109
101
|
}
|
|
110
102
|
}
|
|
111
103
|
}
|
|
112
|
-
function runHeap(
|
|
113
|
-
|
|
114
|
-
for (
|
|
115
|
-
let
|
|
116
|
-
while (
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
adjustHeight(el, heap);
|
|
121
|
-
}
|
|
122
|
-
el = heap.s[heap.q];
|
|
104
|
+
function runHeap(e, t) {
|
|
105
|
+
e.S = false;
|
|
106
|
+
for (e.C = 0; e.C <= e.h; e.C++) {
|
|
107
|
+
let n = e.l[e.C];
|
|
108
|
+
while (n !== undefined) {
|
|
109
|
+
if (n._ & REACTIVE_IN_HEAP) t(n);
|
|
110
|
+
else adjustHeight(n, e);
|
|
111
|
+
n = e.l[e.C];
|
|
123
112
|
}
|
|
124
113
|
}
|
|
125
|
-
|
|
114
|
+
e.h = 0;
|
|
126
115
|
}
|
|
127
|
-
function adjustHeight(
|
|
128
|
-
deleteFromHeap(
|
|
129
|
-
let
|
|
130
|
-
for (let
|
|
131
|
-
const
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
if (dep.c >= newHeight) {
|
|
135
|
-
newHeight = dep.c + 1;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
116
|
+
function adjustHeight(e, t) {
|
|
117
|
+
deleteFromHeap(e, t);
|
|
118
|
+
let n = e.o;
|
|
119
|
+
for (let t = e.D; t; t = t.P) {
|
|
120
|
+
const e = t.V;
|
|
121
|
+
const i = e.U || e;
|
|
122
|
+
if (i.m && i.o >= n) n = i.o + 1;
|
|
138
123
|
}
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
for (let
|
|
142
|
-
insertIntoHeapHeight(
|
|
124
|
+
if (e.o !== n) {
|
|
125
|
+
e.o = n;
|
|
126
|
+
for (let n = e.O; n !== null; n = n.p) {
|
|
127
|
+
insertIntoHeapHeight(n.A, t);
|
|
143
128
|
}
|
|
144
129
|
}
|
|
145
130
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
131
|
+
const transitions = new Set();
|
|
132
|
+
const dirtyQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, h: 0 };
|
|
133
|
+
const zombieQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, h: 0 };
|
|
134
|
+
let clock = 0;
|
|
135
|
+
let activeTransition = null;
|
|
136
|
+
let scheduled = false;
|
|
152
137
|
function schedule() {
|
|
153
|
-
if (scheduled)
|
|
154
|
-
return;
|
|
138
|
+
if (scheduled) return;
|
|
155
139
|
scheduled = true;
|
|
156
|
-
if (!globalQueue.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
q: 0,
|
|
163
|
-
L: 0
|
|
164
|
-
};
|
|
165
|
-
var zombieQueue = {
|
|
166
|
-
s: new Array(2e3).fill(void 0),
|
|
167
|
-
ba: false,
|
|
168
|
-
q: 0,
|
|
169
|
-
L: 0
|
|
170
|
-
};
|
|
171
|
-
var Queue = class {
|
|
172
|
-
w = null;
|
|
173
|
-
k = [[], []];
|
|
174
|
-
m = [];
|
|
140
|
+
if (!globalQueue.k) queueMicrotask(flush);
|
|
141
|
+
}
|
|
142
|
+
class Queue {
|
|
143
|
+
i = null;
|
|
144
|
+
G = [[], []];
|
|
145
|
+
H = [];
|
|
175
146
|
created = clock;
|
|
176
|
-
addChild(
|
|
177
|
-
this.
|
|
178
|
-
|
|
147
|
+
addChild(e) {
|
|
148
|
+
this.H.push(e);
|
|
149
|
+
e.i = this;
|
|
179
150
|
}
|
|
180
|
-
removeChild(
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
this.
|
|
184
|
-
|
|
151
|
+
removeChild(e) {
|
|
152
|
+
const t = this.H.indexOf(e);
|
|
153
|
+
if (t >= 0) {
|
|
154
|
+
this.H.splice(t, 1);
|
|
155
|
+
e.i = null;
|
|
185
156
|
}
|
|
186
157
|
}
|
|
187
|
-
notify(
|
|
188
|
-
if (this.
|
|
189
|
-
return this.w.notify(node, mask, flags);
|
|
158
|
+
notify(e, t, n) {
|
|
159
|
+
if (this.i) return this.i.notify(e, t, n);
|
|
190
160
|
return false;
|
|
191
161
|
}
|
|
192
|
-
run(
|
|
193
|
-
if (this.
|
|
194
|
-
const
|
|
195
|
-
this.
|
|
196
|
-
runQueue(
|
|
162
|
+
run(e) {
|
|
163
|
+
if (this.G[e - 1].length) {
|
|
164
|
+
const t = this.G[e - 1];
|
|
165
|
+
this.G[e - 1] = [];
|
|
166
|
+
runQueue(t, e);
|
|
197
167
|
}
|
|
198
|
-
for (let
|
|
199
|
-
this.
|
|
168
|
+
for (let t = 0; t < this.H.length; t++) {
|
|
169
|
+
this.H[t].run(e);
|
|
200
170
|
}
|
|
201
171
|
}
|
|
202
|
-
enqueue(
|
|
203
|
-
if (
|
|
204
|
-
this.k[type - 1].push(fn);
|
|
172
|
+
enqueue(e, t) {
|
|
173
|
+
if (e) this.G[e - 1].push(t);
|
|
205
174
|
schedule();
|
|
206
175
|
}
|
|
207
|
-
stashQueues(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
for (let
|
|
212
|
-
let
|
|
213
|
-
let
|
|
214
|
-
if (!
|
|
215
|
-
|
|
216
|
-
|
|
176
|
+
stashQueues(e) {
|
|
177
|
+
e.G[0].push(...this.G[0]);
|
|
178
|
+
e.G[1].push(...this.G[1]);
|
|
179
|
+
this.G = [[], []];
|
|
180
|
+
for (let t = 0; t < this.H.length; t++) {
|
|
181
|
+
let n = this.H[t];
|
|
182
|
+
let i = e.H[t];
|
|
183
|
+
if (!i) {
|
|
184
|
+
i = { G: [[], []], H: [] };
|
|
185
|
+
e.H[t] = i;
|
|
217
186
|
}
|
|
218
|
-
|
|
187
|
+
n.stashQueues(i);
|
|
219
188
|
}
|
|
220
189
|
}
|
|
221
|
-
restoreQueues(
|
|
222
|
-
this.
|
|
223
|
-
this.
|
|
224
|
-
for (let
|
|
225
|
-
const
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
228
|
-
child.restoreQueues(childStub);
|
|
190
|
+
restoreQueues(e) {
|
|
191
|
+
this.G[0].push(...e.G[0]);
|
|
192
|
+
this.G[1].push(...e.G[1]);
|
|
193
|
+
for (let t = 0; t < e.H.length; t++) {
|
|
194
|
+
const n = e.H[t];
|
|
195
|
+
let i = this.H[t];
|
|
196
|
+
if (i) i.restoreQueues(n);
|
|
229
197
|
}
|
|
230
198
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
static
|
|
236
|
-
static
|
|
199
|
+
}
|
|
200
|
+
class GlobalQueue extends Queue {
|
|
201
|
+
k = false;
|
|
202
|
+
$ = [];
|
|
203
|
+
static L;
|
|
204
|
+
static F;
|
|
237
205
|
flush() {
|
|
238
|
-
if (this.
|
|
239
|
-
|
|
240
|
-
this.da = true;
|
|
206
|
+
if (this.k) return;
|
|
207
|
+
this.k = true;
|
|
241
208
|
try {
|
|
242
|
-
runHeap(dirtyQueue,
|
|
209
|
+
runHeap(dirtyQueue, GlobalQueue.L);
|
|
243
210
|
if (activeTransition) {
|
|
244
211
|
if (!transitionComplete(activeTransition)) {
|
|
245
|
-
runHeap(zombieQueue,
|
|
246
|
-
|
|
247
|
-
|
|
212
|
+
runHeap(zombieQueue, GlobalQueue.L);
|
|
213
|
+
this.$ = [];
|
|
214
|
+
this.stashQueues(activeTransition.queueStash);
|
|
248
215
|
clock++;
|
|
249
216
|
scheduled = false;
|
|
250
217
|
runPending(activeTransition.pendingNodes, true);
|
|
251
218
|
activeTransition = null;
|
|
252
219
|
return;
|
|
253
220
|
}
|
|
254
|
-
|
|
255
|
-
|
|
221
|
+
this.$.push(...activeTransition.pendingNodes);
|
|
222
|
+
this.restoreQueues(activeTransition.queueStash);
|
|
256
223
|
transitions.delete(activeTransition);
|
|
257
224
|
activeTransition = null;
|
|
258
|
-
if (runPending(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
n.e = NOT_PENDING;
|
|
225
|
+
if (runPending(this.$, false)) runHeap(dirtyQueue, GlobalQueue.L);
|
|
226
|
+
} else if (transitions.size) runHeap(zombieQueue, GlobalQueue.L);
|
|
227
|
+
for (let e = 0; e < this.$.length; e++) {
|
|
228
|
+
const t = this.$[e];
|
|
229
|
+
if (t.W !== NOT_PENDING) {
|
|
230
|
+
t.j = t.W;
|
|
231
|
+
t.W = NOT_PENDING;
|
|
232
|
+
if (t.K) t.M = true;
|
|
267
233
|
}
|
|
268
|
-
if (
|
|
269
|
-
_GlobalQueue.la(n, false, true);
|
|
234
|
+
if (t.m) GlobalQueue.F(t, false, true);
|
|
270
235
|
}
|
|
271
|
-
|
|
236
|
+
this.$.length = 0;
|
|
272
237
|
clock++;
|
|
273
238
|
scheduled = false;
|
|
274
|
-
this.run(
|
|
275
|
-
this.run(
|
|
239
|
+
this.run(EFFECT_RENDER);
|
|
240
|
+
this.run(EFFECT_USER);
|
|
276
241
|
} finally {
|
|
277
|
-
this.
|
|
242
|
+
this.k = false;
|
|
278
243
|
}
|
|
279
244
|
}
|
|
280
|
-
notify(
|
|
281
|
-
if (
|
|
282
|
-
if (
|
|
283
|
-
if (activeTransition && !activeTransition.asyncNodes.includes(
|
|
284
|
-
activeTransition.asyncNodes.push(
|
|
245
|
+
notify(e, t, n) {
|
|
246
|
+
if (t & STATUS_PENDING) {
|
|
247
|
+
if (n & STATUS_PENDING) {
|
|
248
|
+
if (activeTransition && !activeTransition.asyncNodes.includes(e.Y.cause)) {
|
|
249
|
+
activeTransition.asyncNodes.push(e.Y.cause);
|
|
250
|
+
schedule();
|
|
251
|
+
}
|
|
285
252
|
}
|
|
286
253
|
return true;
|
|
287
254
|
}
|
|
288
255
|
return false;
|
|
289
256
|
}
|
|
290
|
-
initTransition(
|
|
291
|
-
if (activeTransition && activeTransition.time === clock)
|
|
292
|
-
return;
|
|
257
|
+
initTransition(e) {
|
|
258
|
+
if (activeTransition && activeTransition.time === clock) return;
|
|
293
259
|
if (!activeTransition) {
|
|
294
|
-
activeTransition =
|
|
260
|
+
activeTransition = e.B ?? {
|
|
295
261
|
time: clock,
|
|
296
262
|
pendingNodes: [],
|
|
297
263
|
asyncNodes: [],
|
|
298
|
-
queueStash: {
|
|
264
|
+
queueStash: { G: [[], []], H: [] }
|
|
299
265
|
};
|
|
300
266
|
}
|
|
301
267
|
transitions.add(activeTransition);
|
|
302
268
|
activeTransition.time = clock;
|
|
303
|
-
for (let
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
activeTransition.pendingNodes.push(
|
|
269
|
+
for (let e = 0; e < this.$.length; e++) {
|
|
270
|
+
const t = this.$[e];
|
|
271
|
+
t.B = activeTransition;
|
|
272
|
+
activeTransition.pendingNodes.push(t);
|
|
307
273
|
}
|
|
308
|
-
|
|
274
|
+
this.$ = activeTransition.pendingNodes;
|
|
309
275
|
}
|
|
310
|
-
}
|
|
311
|
-
function runPending(
|
|
312
|
-
let
|
|
313
|
-
const
|
|
314
|
-
for (let
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
|
|
276
|
+
}
|
|
277
|
+
function runPending(e, t) {
|
|
278
|
+
let n = false;
|
|
279
|
+
const i = e.slice();
|
|
280
|
+
for (let e = 0; e < i.length; e++) {
|
|
281
|
+
const r = i[e];
|
|
282
|
+
r.B = activeTransition;
|
|
283
|
+
if (r.X) {
|
|
284
|
+
r.X.q(t);
|
|
285
|
+
n = true;
|
|
286
|
+
}
|
|
287
|
+
if (r.Z && r.Z.W !== NOT_PENDING) {
|
|
288
|
+
r.Z.q(r.Z.W);
|
|
289
|
+
r.Z.W = NOT_PENDING;
|
|
290
|
+
n = true;
|
|
320
291
|
}
|
|
321
292
|
}
|
|
322
|
-
return
|
|
293
|
+
return n;
|
|
323
294
|
}
|
|
324
|
-
|
|
295
|
+
const globalQueue = new GlobalQueue();
|
|
325
296
|
function flush() {
|
|
326
297
|
while (scheduled) {
|
|
327
298
|
globalQueue.flush();
|
|
328
299
|
}
|
|
329
300
|
}
|
|
330
|
-
function runQueue(
|
|
331
|
-
for (let
|
|
332
|
-
queue[i](type);
|
|
301
|
+
function runQueue(e, t) {
|
|
302
|
+
for (let n = 0; n < e.length; n++) e[n](t);
|
|
333
303
|
}
|
|
334
|
-
function transitionComplete(
|
|
335
|
-
let
|
|
336
|
-
for (let
|
|
337
|
-
if (
|
|
338
|
-
|
|
304
|
+
function transitionComplete(e) {
|
|
305
|
+
let t = true;
|
|
306
|
+
for (let n = 0; n < e.asyncNodes.length; n++) {
|
|
307
|
+
if (e.asyncNodes[n].J & STATUS_PENDING) {
|
|
308
|
+
t = false;
|
|
339
309
|
break;
|
|
340
310
|
}
|
|
341
311
|
}
|
|
342
|
-
return
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
312
|
+
return t;
|
|
313
|
+
}
|
|
314
|
+
function runInTransition(e, t) {
|
|
315
|
+
const n = activeTransition;
|
|
316
|
+
activeTransition = e.B;
|
|
317
|
+
t(e);
|
|
318
|
+
activeTransition = n;
|
|
319
|
+
}
|
|
320
|
+
GlobalQueue.L = recompute;
|
|
321
|
+
GlobalQueue.F = disposeChildren;
|
|
322
|
+
let tracking = false;
|
|
323
|
+
let stale = false;
|
|
324
|
+
let pendingValueCheck = false;
|
|
325
|
+
let pendingCheck = null;
|
|
326
|
+
let context = null;
|
|
327
|
+
function notifySubs(e) {
|
|
328
|
+
for (let t = e.O; t !== null; t = t.p) {
|
|
329
|
+
const e = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
330
|
+
if (e.C > t.A.o) e.C = t.A.o;
|
|
331
|
+
insertIntoHeap(t.A, e);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function recompute(e, t = false) {
|
|
335
|
+
deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
336
|
+
if (e.W !== NOT_PENDING || e.ee || e.te) disposeChildren(e);
|
|
366
337
|
else {
|
|
367
|
-
markDisposal(
|
|
368
|
-
globalQueue
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
374
|
-
const
|
|
375
|
-
context =
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
let
|
|
380
|
-
let
|
|
381
|
-
let
|
|
382
|
-
let
|
|
383
|
-
let
|
|
384
|
-
|
|
338
|
+
markDisposal(e);
|
|
339
|
+
globalQueue.$.push(e);
|
|
340
|
+
e.te = e.ne;
|
|
341
|
+
e.ee = e.ie;
|
|
342
|
+
e.ne = null;
|
|
343
|
+
e.ie = null;
|
|
344
|
+
}
|
|
345
|
+
const n = context;
|
|
346
|
+
context = e;
|
|
347
|
+
e.re = null;
|
|
348
|
+
e._ = REACTIVE_RECOMPUTING_DEPS;
|
|
349
|
+
e.se = clock;
|
|
350
|
+
let i = e.W === NOT_PENDING ? e.j : e.W;
|
|
351
|
+
let r = e.o;
|
|
352
|
+
let s = e.J;
|
|
353
|
+
let o = e.Y;
|
|
354
|
+
let u = tracking;
|
|
355
|
+
setStatusFlags(e, STATUS_NONE | (s & STATUS_UNINITIALIZED));
|
|
385
356
|
tracking = true;
|
|
386
357
|
try {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
setStatusFlags(
|
|
393
|
-
} else
|
|
394
|
-
setError(el, e);
|
|
395
|
-
}
|
|
358
|
+
i = e.m(i);
|
|
359
|
+
e.J &= ~STATUS_UNINITIALIZED;
|
|
360
|
+
} catch (t) {
|
|
361
|
+
if (t instanceof NotReadyError) {
|
|
362
|
+
if (t.cause !== e) link(t.cause, e);
|
|
363
|
+
setStatusFlags(e, (s & ~STATUS_ERROR) | STATUS_PENDING, t);
|
|
364
|
+
} else setStatusFlags(e, STATUS_ERROR, t);
|
|
396
365
|
} finally {
|
|
397
|
-
tracking =
|
|
366
|
+
tracking = u;
|
|
398
367
|
}
|
|
399
|
-
|
|
400
|
-
context =
|
|
401
|
-
const
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
368
|
+
e._ = REACTIVE_NONE;
|
|
369
|
+
context = n;
|
|
370
|
+
const l = e.re;
|
|
371
|
+
let c = l !== null ? l.P : e.D;
|
|
372
|
+
if (c !== null) {
|
|
404
373
|
do {
|
|
405
|
-
|
|
406
|
-
} while (
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (valueChanged) {
|
|
418
|
-
if (create || el.ja || el.K)
|
|
419
|
-
el.g = value;
|
|
374
|
+
c = unlinkSubs(c);
|
|
375
|
+
} while (c !== null);
|
|
376
|
+
if (l !== null) l.P = null;
|
|
377
|
+
else e.D = null;
|
|
378
|
+
}
|
|
379
|
+
const a = e.K && e.B != activeTransition;
|
|
380
|
+
const f = !e.oe || !e.oe(e.W === NOT_PENDING || e.ue || a ? e.j : e.W, i);
|
|
381
|
+
const E = e.J !== s || e.Y !== o;
|
|
382
|
+
e.le?.(E, s);
|
|
383
|
+
if (f || E) {
|
|
384
|
+
if (f) {
|
|
385
|
+
if (t || e.ue || a) e.j = i;
|
|
420
386
|
else {
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
-
el.e = value;
|
|
387
|
+
if (e.W === NOT_PENDING) globalQueue.$.push(e);
|
|
388
|
+
e.W = i;
|
|
424
389
|
}
|
|
425
|
-
if (
|
|
426
|
-
el.C.ea(value);
|
|
390
|
+
if (e.Z) e.Z.q(i);
|
|
427
391
|
}
|
|
428
|
-
for (let
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
insertIntoHeap(s.j, queue);
|
|
392
|
+
for (let t = e.O; t !== null; t = t.p) {
|
|
393
|
+
const n = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
394
|
+
if (t.A.o < e.o && n.C > t.A.o) n.C = t.A.o;
|
|
395
|
+
insertIntoHeap(t.A, n);
|
|
433
396
|
}
|
|
434
|
-
} else if (
|
|
435
|
-
for (let
|
|
436
|
-
insertIntoHeapHeight(
|
|
397
|
+
} else if (e.o != r) {
|
|
398
|
+
for (let t = e.O; t !== null; t = t.p) {
|
|
399
|
+
insertIntoHeapHeight(t.A, t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
437
400
|
}
|
|
438
401
|
}
|
|
402
|
+
if (e.B && a) runInTransition(e, recompute);
|
|
439
403
|
}
|
|
440
|
-
function updateIfNecessary(
|
|
441
|
-
if (
|
|
442
|
-
for (let
|
|
443
|
-
const
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
updateIfNecessary(
|
|
404
|
+
function updateIfNecessary(e) {
|
|
405
|
+
if (e._ & REACTIVE_CHECK) {
|
|
406
|
+
for (let t = e.D; t; t = t.P) {
|
|
407
|
+
const n = t.V;
|
|
408
|
+
const i = n.U || n;
|
|
409
|
+
if (i.m) {
|
|
410
|
+
updateIfNecessary(i);
|
|
447
411
|
}
|
|
448
|
-
if (
|
|
412
|
+
if (e._ & REACTIVE_DIRTY) {
|
|
449
413
|
break;
|
|
450
414
|
}
|
|
451
415
|
}
|
|
452
416
|
}
|
|
453
|
-
if (
|
|
454
|
-
recompute(
|
|
455
|
-
}
|
|
456
|
-
el.b = 0 /* None */;
|
|
457
|
-
}
|
|
458
|
-
function unlinkSubs(link2) {
|
|
459
|
-
const dep = link2.R;
|
|
460
|
-
const nextDep = link2.E;
|
|
461
|
-
const nextSub = link2.A;
|
|
462
|
-
const prevSub = link2.na;
|
|
463
|
-
if (nextSub !== null) {
|
|
464
|
-
nextSub.na = prevSub;
|
|
465
|
-
} else {
|
|
466
|
-
dep.W = prevSub;
|
|
467
|
-
}
|
|
468
|
-
if (prevSub !== null) {
|
|
469
|
-
prevSub.A = nextSub;
|
|
470
|
-
} else {
|
|
471
|
-
dep.x = nextSub;
|
|
472
|
-
if (nextSub === null) {
|
|
473
|
-
dep.ta?.();
|
|
474
|
-
dep.H && unobserved(dep);
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
return nextDep;
|
|
478
|
-
}
|
|
479
|
-
function unobserved(el) {
|
|
480
|
-
deleteFromHeap(el, el.b & 32 /* Zombie */ ? zombieQueue : dirtyQueue);
|
|
481
|
-
let dep = el.l;
|
|
482
|
-
while (dep !== null) {
|
|
483
|
-
dep = unlinkSubs(dep);
|
|
417
|
+
if (e._ & REACTIVE_DIRTY) {
|
|
418
|
+
recompute(e);
|
|
484
419
|
}
|
|
485
|
-
|
|
486
|
-
runDisposal(el);
|
|
420
|
+
e._ = REACTIVE_NONE;
|
|
487
421
|
}
|
|
488
|
-
function
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
422
|
+
function unlinkSubs(e) {
|
|
423
|
+
const t = e.V;
|
|
424
|
+
const n = e.P;
|
|
425
|
+
const i = e.p;
|
|
426
|
+
const r = e.ce;
|
|
427
|
+
if (i !== null) i.ce = r;
|
|
428
|
+
else t.ae = r;
|
|
429
|
+
if (r !== null) r.p = i;
|
|
430
|
+
else {
|
|
431
|
+
t.O = i;
|
|
432
|
+
if (i === null) {
|
|
433
|
+
t.fe?.();
|
|
434
|
+
t.m && unobserved(t);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return n;
|
|
438
|
+
}
|
|
439
|
+
function unobserved(e) {
|
|
440
|
+
deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
441
|
+
let t = e.D;
|
|
442
|
+
while (t !== null) {
|
|
443
|
+
t = unlinkSubs(t);
|
|
444
|
+
}
|
|
445
|
+
e.D = null;
|
|
446
|
+
runDisposal(e);
|
|
447
|
+
}
|
|
448
|
+
function link(e, t) {
|
|
449
|
+
const n = t.re;
|
|
450
|
+
if (n !== null && n.V === e) return;
|
|
451
|
+
let i = null;
|
|
452
|
+
const r = t._ & REACTIVE_RECOMPUTING_DEPS;
|
|
453
|
+
if (r) {
|
|
454
|
+
i = n !== null ? n.P : t.D;
|
|
455
|
+
if (i !== null && i.V === e) {
|
|
456
|
+
t.re = i;
|
|
499
457
|
return;
|
|
500
458
|
}
|
|
501
459
|
}
|
|
502
|
-
const
|
|
503
|
-
if (
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
E: nextDep,
|
|
510
|
-
na: prevSub,
|
|
511
|
-
A: null
|
|
512
|
-
};
|
|
513
|
-
if (prevDep !== null) {
|
|
514
|
-
prevDep.E = newLink;
|
|
515
|
-
} else {
|
|
516
|
-
sub.l = newLink;
|
|
517
|
-
}
|
|
518
|
-
if (prevSub !== null) {
|
|
519
|
-
prevSub.A = newLink;
|
|
520
|
-
} else {
|
|
521
|
-
dep.x = newLink;
|
|
522
|
-
}
|
|
460
|
+
const s = e.ae;
|
|
461
|
+
if (s !== null && s.A === t && (!r || isValidLink(s, t))) return;
|
|
462
|
+
const o = (t.re = e.ae = { V: e, A: t, P: i, ce: s, p: null });
|
|
463
|
+
if (n !== null) n.P = o;
|
|
464
|
+
else t.D = o;
|
|
465
|
+
if (s !== null) s.p = o;
|
|
466
|
+
else e.O = o;
|
|
523
467
|
}
|
|
524
|
-
function isValidLink(
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
let
|
|
468
|
+
function isValidLink(e, t) {
|
|
469
|
+
const n = t.re;
|
|
470
|
+
if (n !== null) {
|
|
471
|
+
let i = t.D;
|
|
528
472
|
do {
|
|
529
|
-
if (
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
535
|
-
link2 = link2.E;
|
|
536
|
-
} while (link2 !== null);
|
|
473
|
+
if (i === e) return true;
|
|
474
|
+
if (i === n) break;
|
|
475
|
+
i = i.P;
|
|
476
|
+
} while (i !== null);
|
|
537
477
|
}
|
|
538
478
|
return false;
|
|
539
479
|
}
|
|
540
|
-
function setStatusFlags(
|
|
541
|
-
|
|
542
|
-
|
|
480
|
+
function setStatusFlags(e, t, n = null) {
|
|
481
|
+
e.J = t;
|
|
482
|
+
e.Y = n;
|
|
543
483
|
}
|
|
544
|
-
function
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
let child = el.r;
|
|
552
|
-
while (child) {
|
|
553
|
-
child.b |= 32 /* Zombie */;
|
|
554
|
-
const inHeap = child.b & 8 /* InHeap */;
|
|
555
|
-
if (inHeap) {
|
|
556
|
-
deleteFromHeap(child, dirtyQueue);
|
|
557
|
-
insertIntoHeap(child, zombieQueue);
|
|
484
|
+
function markDisposal(e) {
|
|
485
|
+
let t = e.ie;
|
|
486
|
+
while (t) {
|
|
487
|
+
t._ |= REACTIVE_ZOMBIE;
|
|
488
|
+
if (t._ & REACTIVE_IN_HEAP) {
|
|
489
|
+
deleteFromHeap(t, dirtyQueue);
|
|
490
|
+
insertIntoHeap(t, zombieQueue);
|
|
558
491
|
}
|
|
559
|
-
markDisposal(
|
|
560
|
-
|
|
492
|
+
markDisposal(t);
|
|
493
|
+
t = t.Ee;
|
|
561
494
|
}
|
|
562
495
|
}
|
|
563
|
-
function dispose(
|
|
564
|
-
let
|
|
496
|
+
function dispose(e) {
|
|
497
|
+
let t = e.D || null;
|
|
565
498
|
do {
|
|
566
|
-
|
|
567
|
-
} while (
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
disposeChildren(
|
|
571
|
-
}
|
|
572
|
-
function disposeChildren(
|
|
573
|
-
if (
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
deleteFromHeap(n, n.b & 32 /* Zombie */ ? zombieQueue : dirtyQueue);
|
|
583
|
-
let toRemove = n.l;
|
|
499
|
+
t = unlinkSubs(t);
|
|
500
|
+
} while (t !== null);
|
|
501
|
+
e.D = null;
|
|
502
|
+
e.re = null;
|
|
503
|
+
disposeChildren(e, true);
|
|
504
|
+
}
|
|
505
|
+
function disposeChildren(e, t = false, n) {
|
|
506
|
+
if (e._ & REACTIVE_DISPOSED) return;
|
|
507
|
+
if (t) e._ = REACTIVE_DISPOSED;
|
|
508
|
+
let i = n ? e.ee : e.ie;
|
|
509
|
+
while (i) {
|
|
510
|
+
const e = i.Ee;
|
|
511
|
+
if (i.D) {
|
|
512
|
+
const e = i;
|
|
513
|
+
deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
514
|
+
let t = e.D;
|
|
584
515
|
do {
|
|
585
|
-
|
|
586
|
-
} while (
|
|
587
|
-
|
|
588
|
-
|
|
516
|
+
t = unlinkSubs(t);
|
|
517
|
+
} while (t !== null);
|
|
518
|
+
e.D = null;
|
|
519
|
+
e.re = null;
|
|
589
520
|
}
|
|
590
|
-
disposeChildren(
|
|
591
|
-
|
|
521
|
+
disposeChildren(i, true);
|
|
522
|
+
i = e;
|
|
592
523
|
}
|
|
593
|
-
if (
|
|
594
|
-
|
|
524
|
+
if (n) {
|
|
525
|
+
e.ee = null;
|
|
595
526
|
} else {
|
|
596
|
-
|
|
597
|
-
|
|
527
|
+
e.ie = null;
|
|
528
|
+
e.Ee = null;
|
|
598
529
|
}
|
|
599
|
-
runDisposal(
|
|
530
|
+
runDisposal(e, n);
|
|
600
531
|
}
|
|
601
|
-
function runDisposal(
|
|
602
|
-
let
|
|
603
|
-
if (!
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
callable.call(callable);
|
|
532
|
+
function runDisposal(e, t) {
|
|
533
|
+
let n = t ? e.te : e.ne;
|
|
534
|
+
if (!n) return;
|
|
535
|
+
if (Array.isArray(n)) {
|
|
536
|
+
for (let e = 0; e < n.length; e++) {
|
|
537
|
+
const t = n[e];
|
|
538
|
+
t.call(t);
|
|
609
539
|
}
|
|
610
540
|
} else {
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
function withOptions(obj, options) {
|
|
616
|
-
obj.id = options?.id ?? (context?.id != null ? getNextChildId(context) : void 0);
|
|
617
|
-
obj.fa = options?.equals != null ? options.equals : isEqual;
|
|
618
|
-
obj.za = !!options?.pureWrite;
|
|
619
|
-
obj.ta = options?.unobserved;
|
|
620
|
-
if (options?.ka)
|
|
621
|
-
Object.assign(obj, options.ka);
|
|
622
|
-
return obj;
|
|
623
|
-
}
|
|
624
|
-
function getNextChildId(owner) {
|
|
625
|
-
if (owner.id != null)
|
|
626
|
-
return formatId(owner.id, owner.oa++);
|
|
627
|
-
throw new Error("Cannot get child id from owner without an id");
|
|
541
|
+
n.call(n);
|
|
542
|
+
}
|
|
543
|
+
t ? (e.te = null) : (e.ne = null);
|
|
628
544
|
}
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
|
|
545
|
+
function getNextChildId(e) {
|
|
546
|
+
if (e.id != null) return formatId(e.id, e.de++);
|
|
547
|
+
throw new Error("Cannot get child id from owner without an id");
|
|
632
548
|
}
|
|
633
|
-
function
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
549
|
+
function formatId(e, t) {
|
|
550
|
+
const n = t.toString(36),
|
|
551
|
+
i = n.length - 1;
|
|
552
|
+
return e + (i ? String.fromCharCode(64 + i) : "") + n;
|
|
553
|
+
}
|
|
554
|
+
function computed(e, t, n) {
|
|
555
|
+
const i = {
|
|
556
|
+
id: n?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
|
|
557
|
+
oe: n?.equals != null ? n.equals : isEqual,
|
|
558
|
+
Te: !!n?.pureWrite,
|
|
559
|
+
fe: n?.unobserved,
|
|
560
|
+
ne: null,
|
|
561
|
+
Re: context?.Re ?? globalQueue,
|
|
562
|
+
he: context?.he ?? defaultContext,
|
|
563
|
+
de: 0,
|
|
564
|
+
m: e,
|
|
565
|
+
j: t,
|
|
566
|
+
o: 0,
|
|
567
|
+
N: null,
|
|
568
|
+
R: undefined,
|
|
569
|
+
T: null,
|
|
570
|
+
D: null,
|
|
571
|
+
re: null,
|
|
572
|
+
O: null,
|
|
573
|
+
ae: null,
|
|
574
|
+
i: context,
|
|
575
|
+
Ee: null,
|
|
576
|
+
ie: null,
|
|
577
|
+
_: REACTIVE_NONE,
|
|
578
|
+
J: STATUS_UNINITIALIZED,
|
|
579
|
+
se: clock,
|
|
580
|
+
W: NOT_PENDING,
|
|
581
|
+
te: null,
|
|
582
|
+
ee: null,
|
|
583
|
+
B: null
|
|
584
|
+
};
|
|
585
|
+
if (n?._e) Object.assign(i, n._e);
|
|
586
|
+
i.T = i;
|
|
587
|
+
const r = context?.t ? context.u : context;
|
|
664
588
|
if (context) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
if (lastChild === null) {
|
|
669
|
-
context.r = self;
|
|
589
|
+
const e = context.ie;
|
|
590
|
+
if (e === null) {
|
|
591
|
+
context.ie = i;
|
|
670
592
|
} else {
|
|
671
|
-
|
|
672
|
-
context.
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
if (
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
let
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
globalQueue.initTransition(self);
|
|
697
|
-
setSignal(self, () => v);
|
|
593
|
+
i.Ee = e;
|
|
594
|
+
context.ie = i;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (r) i.o = r.o + 1;
|
|
598
|
+
recompute(i, true);
|
|
599
|
+
return i;
|
|
600
|
+
}
|
|
601
|
+
function asyncComputed(e, t, n) {
|
|
602
|
+
let i = undefined;
|
|
603
|
+
let r = false;
|
|
604
|
+
const fn = t => {
|
|
605
|
+
const n = e(t, r);
|
|
606
|
+
r = false;
|
|
607
|
+
i = n;
|
|
608
|
+
const o = n instanceof Promise;
|
|
609
|
+
const u = n[Symbol.asyncIterator];
|
|
610
|
+
if (!o && !u) {
|
|
611
|
+
return n;
|
|
612
|
+
}
|
|
613
|
+
if (o) {
|
|
614
|
+
n.then(e => {
|
|
615
|
+
if (i !== n) return;
|
|
616
|
+
globalQueue.initTransition(s);
|
|
617
|
+
setSignal(s, () => e);
|
|
698
618
|
flush();
|
|
699
|
-
}).catch(
|
|
700
|
-
if (
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
notifySubs(self);
|
|
619
|
+
}).catch(e => {
|
|
620
|
+
if (i !== n) return;
|
|
621
|
+
globalQueue.initTransition(s);
|
|
622
|
+
setStatusFlags(s, STATUS_ERROR, e);
|
|
623
|
+
s.se = clock;
|
|
624
|
+
notifySubs(s);
|
|
706
625
|
schedule();
|
|
707
626
|
flush();
|
|
708
627
|
});
|
|
709
628
|
} else {
|
|
710
629
|
(async () => {
|
|
711
630
|
try {
|
|
712
|
-
for await (let
|
|
713
|
-
if (
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
setSignal(self, () => value);
|
|
631
|
+
for await (let e of n) {
|
|
632
|
+
if (i !== n) return;
|
|
633
|
+
globalQueue.initTransition(s);
|
|
634
|
+
setSignal(s, () => e);
|
|
717
635
|
flush();
|
|
718
636
|
}
|
|
719
|
-
} catch (
|
|
720
|
-
if (
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
notifySubs(self);
|
|
637
|
+
} catch (e) {
|
|
638
|
+
if (i !== n) return;
|
|
639
|
+
globalQueue.initTransition(s);
|
|
640
|
+
setStatusFlags(s, STATUS_ERROR, e);
|
|
641
|
+
s.se = clock;
|
|
642
|
+
notifySubs(s);
|
|
726
643
|
schedule();
|
|
727
644
|
flush();
|
|
728
645
|
}
|
|
@@ -731,150 +648,128 @@ function asyncComputed(asyncFn, initialValue, options) {
|
|
|
731
648
|
globalQueue.initTransition(context);
|
|
732
649
|
throw new NotReadyError(context);
|
|
733
650
|
};
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
recompute(
|
|
651
|
+
const s = computed(fn, t, n);
|
|
652
|
+
s.Se = () => {
|
|
653
|
+
r = true;
|
|
654
|
+
recompute(s);
|
|
655
|
+
schedule();
|
|
738
656
|
flush();
|
|
739
657
|
};
|
|
740
|
-
return
|
|
741
|
-
}
|
|
742
|
-
function signal(
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
{
|
|
760
|
-
g: v,
|
|
761
|
-
x: null,
|
|
762
|
-
W: null,
|
|
763
|
-
f: 0 /* None */,
|
|
764
|
-
J: clock,
|
|
765
|
-
e: NOT_PENDING
|
|
766
|
-
},
|
|
767
|
-
options
|
|
768
|
-
);
|
|
769
|
-
}
|
|
658
|
+
return s;
|
|
659
|
+
}
|
|
660
|
+
function signal(e, t, n = null) {
|
|
661
|
+
const i = {
|
|
662
|
+
id: t?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
|
|
663
|
+
oe: t?.equals != null ? t.equals : isEqual,
|
|
664
|
+
Te: !!t?.pureWrite,
|
|
665
|
+
fe: t?.unobserved,
|
|
666
|
+
j: e,
|
|
667
|
+
O: null,
|
|
668
|
+
ae: null,
|
|
669
|
+
J: STATUS_NONE,
|
|
670
|
+
se: clock,
|
|
671
|
+
U: n,
|
|
672
|
+
I: n?.N || null,
|
|
673
|
+
W: NOT_PENDING
|
|
674
|
+
};
|
|
675
|
+
n && (n.N = i);
|
|
676
|
+
return i;
|
|
770
677
|
}
|
|
771
|
-
function isEqual(
|
|
772
|
-
return
|
|
678
|
+
function isEqual(e, t) {
|
|
679
|
+
return e === t;
|
|
773
680
|
}
|
|
774
|
-
function untrack(
|
|
775
|
-
if (!tracking)
|
|
776
|
-
return fn();
|
|
681
|
+
function untrack(e) {
|
|
682
|
+
if (!tracking) return e();
|
|
777
683
|
tracking = false;
|
|
778
684
|
try {
|
|
779
|
-
return
|
|
685
|
+
return e();
|
|
780
686
|
} finally {
|
|
781
687
|
tracking = true;
|
|
782
688
|
}
|
|
783
689
|
}
|
|
784
|
-
function read(
|
|
785
|
-
let
|
|
786
|
-
if (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
updateIfNecessary(owner);
|
|
690
|
+
function read(e) {
|
|
691
|
+
let t = context;
|
|
692
|
+
if (t?.t) t = t.u;
|
|
693
|
+
if (t && tracking && !pendingCheck && !pendingValueCheck) {
|
|
694
|
+
link(e, t);
|
|
695
|
+
const n = e.U || e;
|
|
696
|
+
if (n.m) {
|
|
697
|
+
const i = e._ & REACTIVE_ZOMBIE;
|
|
698
|
+
if (n.o >= (i ? zombieQueue.C : dirtyQueue.C)) {
|
|
699
|
+
markNode(t);
|
|
700
|
+
markHeap(i ? zombieQueue : dirtyQueue);
|
|
701
|
+
updateIfNecessary(n);
|
|
797
702
|
}
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
|
|
703
|
+
const r = n.o;
|
|
704
|
+
if (r >= t.o && e.i !== t) {
|
|
705
|
+
t.o = r + 1;
|
|
801
706
|
}
|
|
802
707
|
}
|
|
803
708
|
}
|
|
804
709
|
if (pendingCheck) {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
el.I.ea = (v) => setSignal(el.I, v);
|
|
710
|
+
if (!e.X) {
|
|
711
|
+
e.X = signal(false);
|
|
712
|
+
e.X.ue = true;
|
|
713
|
+
e.X.q = t => setSignal(e.X, t);
|
|
810
714
|
}
|
|
811
|
-
const
|
|
715
|
+
const t = pendingCheck;
|
|
812
716
|
pendingCheck = null;
|
|
813
|
-
read(
|
|
814
|
-
pendingCheck =
|
|
815
|
-
prev.g = pendingResult || prev.g;
|
|
717
|
+
t.j = read(e.X) || t.j;
|
|
718
|
+
pendingCheck = t;
|
|
816
719
|
}
|
|
817
720
|
if (pendingValueCheck) {
|
|
818
|
-
if (!
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
);
|
|
822
|
-
el.C.ja = true;
|
|
823
|
-
el.C.ea = (v) => queueMicrotask(() => queueMicrotask(() => setSignal(el.C, v)));
|
|
721
|
+
if (!e.Z) {
|
|
722
|
+
e.Z = signal(e.j);
|
|
723
|
+
e.Z.ue = true;
|
|
724
|
+
e.Z.q = t => setSignal(e.Z, t);
|
|
824
725
|
}
|
|
825
726
|
pendingValueCheck = false;
|
|
826
727
|
try {
|
|
827
|
-
return read(
|
|
728
|
+
return read(e.Z);
|
|
828
729
|
} finally {
|
|
829
730
|
pendingValueCheck = true;
|
|
830
731
|
}
|
|
831
732
|
}
|
|
832
|
-
if (
|
|
833
|
-
if (
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
setStatusFlags(
|
|
837
|
-
c,
|
|
838
|
-
c.f | 1,
|
|
839
|
-
el.B
|
|
840
|
-
);
|
|
733
|
+
if (e.J & STATUS_PENDING && !pendingCheck) {
|
|
734
|
+
if ((t && !stale) || e.J & STATUS_UNINITIALIZED) throw e.Y;
|
|
735
|
+
else if (t && stale) {
|
|
736
|
+
setStatusFlags(t, t.J | 1, e.Y);
|
|
841
737
|
}
|
|
842
738
|
}
|
|
843
|
-
if (
|
|
844
|
-
if (
|
|
845
|
-
recompute(
|
|
846
|
-
return read(
|
|
739
|
+
if (e.J & STATUS_ERROR) {
|
|
740
|
+
if (e.se < clock) {
|
|
741
|
+
recompute(e, true);
|
|
742
|
+
return read(e);
|
|
847
743
|
} else {
|
|
848
|
-
throw
|
|
744
|
+
throw e.Y;
|
|
849
745
|
}
|
|
850
746
|
}
|
|
851
|
-
return !
|
|
747
|
+
return !t ||
|
|
748
|
+
e.ue ||
|
|
749
|
+
e.W === NOT_PENDING ||
|
|
750
|
+
(stale && !pendingCheck && e.B && activeTransition !== e.B)
|
|
751
|
+
? e.j
|
|
752
|
+
: e.W;
|
|
852
753
|
}
|
|
853
|
-
function setSignal(
|
|
854
|
-
if (typeof
|
|
855
|
-
|
|
856
|
-
el.e === NOT_PENDING ? el.g : el.e
|
|
857
|
-
);
|
|
754
|
+
function setSignal(e, t) {
|
|
755
|
+
if (typeof t === "function") {
|
|
756
|
+
t = t(e.W === NOT_PENDING ? e.j : e.W);
|
|
858
757
|
}
|
|
859
|
-
const
|
|
860
|
-
if (!
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
if (el.ja)
|
|
864
|
-
el.g = v;
|
|
758
|
+
const n = !e.oe || !e.oe(e.W === NOT_PENDING || e.ue ? e.j : e.W, t);
|
|
759
|
+
if (!n && !e.J) return t;
|
|
760
|
+
if (n) {
|
|
761
|
+
if (e.ue) e.j = t;
|
|
865
762
|
else {
|
|
866
|
-
if (
|
|
867
|
-
|
|
868
|
-
el.e = v;
|
|
763
|
+
if (e.W === NOT_PENDING) globalQueue.$.push(e);
|
|
764
|
+
e.W = t;
|
|
869
765
|
}
|
|
870
|
-
if (
|
|
871
|
-
el.C.ea(v);
|
|
766
|
+
if (e.Z) e.Z.W = t;
|
|
872
767
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
notifySubs(
|
|
768
|
+
setStatusFlags(e, STATUS_NONE);
|
|
769
|
+
e.se = clock;
|
|
770
|
+
notifySubs(e);
|
|
876
771
|
schedule();
|
|
877
|
-
return
|
|
772
|
+
return t;
|
|
878
773
|
}
|
|
879
774
|
function getObserver() {
|
|
880
775
|
return tracking ? context : null;
|
|
@@ -882,1351 +777,1301 @@ function getObserver() {
|
|
|
882
777
|
function getOwner() {
|
|
883
778
|
return context;
|
|
884
779
|
}
|
|
885
|
-
function onCleanup(
|
|
886
|
-
if (!context)
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
node.t.push(fn);
|
|
780
|
+
function onCleanup(e) {
|
|
781
|
+
if (!context) return e;
|
|
782
|
+
const t = context;
|
|
783
|
+
if (!t.ne) {
|
|
784
|
+
t.ne = e;
|
|
785
|
+
} else if (Array.isArray(t.ne)) {
|
|
786
|
+
t.ne.push(e);
|
|
893
787
|
} else {
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
return
|
|
897
|
-
}
|
|
898
|
-
function createOwner(
|
|
899
|
-
const
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
id:
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
dispose(
|
|
914
|
-
disposeChildren(
|
|
788
|
+
t.ne = [t.ne, e];
|
|
789
|
+
}
|
|
790
|
+
return e;
|
|
791
|
+
}
|
|
792
|
+
function createOwner(e) {
|
|
793
|
+
const t = context;
|
|
794
|
+
const n = {
|
|
795
|
+
t: true,
|
|
796
|
+
u: t?.t ? t.u : t,
|
|
797
|
+
ie: null,
|
|
798
|
+
Ee: null,
|
|
799
|
+
ne: null,
|
|
800
|
+
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
801
|
+
Re: t?.Re ?? globalQueue,
|
|
802
|
+
he: t?.he || defaultContext,
|
|
803
|
+
de: 0,
|
|
804
|
+
te: null,
|
|
805
|
+
ee: null,
|
|
806
|
+
i: t,
|
|
807
|
+
dispose(e = true) {
|
|
808
|
+
disposeChildren(n, e);
|
|
915
809
|
}
|
|
916
810
|
};
|
|
917
|
-
if (
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
|
|
811
|
+
if (t) {
|
|
812
|
+
const e = t.ie;
|
|
813
|
+
if (e === null) {
|
|
814
|
+
t.ie = n;
|
|
921
815
|
} else {
|
|
922
|
-
|
|
923
|
-
|
|
816
|
+
n.Ee = e;
|
|
817
|
+
t.ie = n;
|
|
924
818
|
}
|
|
925
819
|
}
|
|
926
|
-
return
|
|
820
|
+
return n;
|
|
927
821
|
}
|
|
928
|
-
function createRoot(
|
|
929
|
-
const
|
|
930
|
-
return runWithOwner(
|
|
822
|
+
function createRoot(e, t) {
|
|
823
|
+
const n = createOwner(t);
|
|
824
|
+
return runWithOwner(n, () => e(n.dispose));
|
|
931
825
|
}
|
|
932
|
-
function runWithOwner(
|
|
933
|
-
const
|
|
934
|
-
context =
|
|
826
|
+
function runWithOwner(e, t) {
|
|
827
|
+
const n = context;
|
|
828
|
+
context = e;
|
|
935
829
|
try {
|
|
936
|
-
return
|
|
830
|
+
return t();
|
|
937
831
|
} finally {
|
|
938
|
-
context =
|
|
832
|
+
context = n;
|
|
939
833
|
}
|
|
940
834
|
}
|
|
941
|
-
function staleValues(
|
|
942
|
-
const
|
|
943
|
-
stale =
|
|
835
|
+
function staleValues(e, t = true) {
|
|
836
|
+
const n = stale;
|
|
837
|
+
stale = t;
|
|
944
838
|
try {
|
|
945
|
-
return
|
|
839
|
+
return e();
|
|
946
840
|
} finally {
|
|
947
|
-
stale =
|
|
841
|
+
stale = n;
|
|
948
842
|
}
|
|
949
843
|
}
|
|
950
|
-
function pending(
|
|
951
|
-
const
|
|
844
|
+
function pending(e) {
|
|
845
|
+
const t = pendingValueCheck;
|
|
952
846
|
pendingValueCheck = true;
|
|
953
847
|
try {
|
|
954
|
-
return staleValues(
|
|
848
|
+
return staleValues(e, false);
|
|
955
849
|
} finally {
|
|
956
|
-
pendingValueCheck =
|
|
850
|
+
pendingValueCheck = t;
|
|
957
851
|
}
|
|
958
852
|
}
|
|
959
|
-
function isPending(
|
|
960
|
-
const
|
|
961
|
-
pendingCheck = {
|
|
853
|
+
function isPending(e) {
|
|
854
|
+
const t = pendingCheck;
|
|
855
|
+
pendingCheck = { j: false };
|
|
962
856
|
try {
|
|
963
|
-
staleValues(
|
|
964
|
-
return pendingCheck.
|
|
965
|
-
} catch (
|
|
966
|
-
if (!(
|
|
967
|
-
|
|
968
|
-
if (loadingValue !== void 0)
|
|
969
|
-
return loadingValue;
|
|
970
|
-
throw err;
|
|
857
|
+
staleValues(e);
|
|
858
|
+
return pendingCheck.j;
|
|
859
|
+
} catch (e) {
|
|
860
|
+
if (!(e instanceof NotReadyError)) return false;
|
|
861
|
+
throw e;
|
|
971
862
|
} finally {
|
|
972
|
-
pendingCheck =
|
|
863
|
+
pendingCheck = t;
|
|
973
864
|
}
|
|
974
865
|
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
function createContext(defaultValue, description) {
|
|
978
|
-
return { id: Symbol(description), defaultValue };
|
|
866
|
+
function createContext(e, t) {
|
|
867
|
+
return { id: Symbol(t), defaultValue: e };
|
|
979
868
|
}
|
|
980
|
-
function getContext(
|
|
981
|
-
if (!
|
|
869
|
+
function getContext(e, t = getOwner()) {
|
|
870
|
+
if (!t) {
|
|
982
871
|
throw new NoOwnerError();
|
|
983
872
|
}
|
|
984
|
-
const
|
|
985
|
-
if (isUndefined(
|
|
873
|
+
const n = hasContext(e, t) ? t.he[e.id] : e.defaultValue;
|
|
874
|
+
if (isUndefined(n)) {
|
|
986
875
|
throw new ContextNotFoundError();
|
|
987
876
|
}
|
|
988
|
-
return
|
|
877
|
+
return n;
|
|
989
878
|
}
|
|
990
|
-
function setContext(
|
|
991
|
-
if (!
|
|
879
|
+
function setContext(e, t, n = getOwner()) {
|
|
880
|
+
if (!n) {
|
|
992
881
|
throw new NoOwnerError();
|
|
993
882
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
1001
|
-
}
|
|
1002
|
-
function
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
K: options?.render ? 1 /* Render */ : 2 /* User */,
|
|
1019
|
-
ma(statusFlagsChanged, prevStatusFlags) {
|
|
1020
|
-
if (initialized) {
|
|
1021
|
-
const errorChanged = this.f && this.f === prevStatusFlags && statusFlagsChanged;
|
|
1022
|
-
this.ga = !(this.f & 2 /* Error */) && !(this.f & 1 /* Pending */ & ~prevStatusFlags) && !errorChanged;
|
|
1023
|
-
if (this.ga)
|
|
1024
|
-
this.i.enqueue(this.K, runEffect.bind(this));
|
|
883
|
+
n.he = { ...n.he, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
884
|
+
}
|
|
885
|
+
function hasContext(e, t) {
|
|
886
|
+
return !isUndefined(t?.he[e.id]);
|
|
887
|
+
}
|
|
888
|
+
function isUndefined(e) {
|
|
889
|
+
return typeof e === "undefined";
|
|
890
|
+
}
|
|
891
|
+
function effect(e, t, n, i, r) {
|
|
892
|
+
let s = false;
|
|
893
|
+
const o = computed(e, i, {
|
|
894
|
+
...r,
|
|
895
|
+
_e: {
|
|
896
|
+
M: true,
|
|
897
|
+
Oe: i,
|
|
898
|
+
pe: t,
|
|
899
|
+
Ae: n,
|
|
900
|
+
Ne: undefined,
|
|
901
|
+
K: r?.render ? EFFECT_RENDER : EFFECT_USER,
|
|
902
|
+
le(e, t) {
|
|
903
|
+
if (s) {
|
|
904
|
+
const n = this.J && this.J === t && e;
|
|
905
|
+
this.M = !(this.J & STATUS_ERROR) && !(this.J & STATUS_PENDING & ~t) && !n;
|
|
906
|
+
if (this.M) this.Re.enqueue(this.K, runEffect.bind(this));
|
|
1025
907
|
}
|
|
1026
|
-
if (this.
|
|
1027
|
-
let
|
|
1028
|
-
this.
|
|
1029
|
-
if (this.K ===
|
|
908
|
+
if (this.J & STATUS_ERROR) {
|
|
909
|
+
let e = this.Y;
|
|
910
|
+
this.Re.notify(this, STATUS_PENDING, 0);
|
|
911
|
+
if (this.K === EFFECT_USER) {
|
|
1030
912
|
try {
|
|
1031
|
-
return this.
|
|
1032
|
-
this.
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
913
|
+
return this.Ae
|
|
914
|
+
? this.Ae(e, () => {
|
|
915
|
+
this.Ne?.();
|
|
916
|
+
this.Ne = undefined;
|
|
917
|
+
})
|
|
918
|
+
: console.error(e);
|
|
919
|
+
} catch (t) {
|
|
920
|
+
e = t;
|
|
1037
921
|
}
|
|
1038
922
|
}
|
|
1039
|
-
if (!this.
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
this.i.notify(
|
|
1043
|
-
this,
|
|
1044
|
-
1 /* Pending */ | 2 /* Error */,
|
|
1045
|
-
this.f
|
|
1046
|
-
);
|
|
923
|
+
if (!this.Re.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
924
|
+
} else if (this.K === EFFECT_RENDER) {
|
|
925
|
+
this.Re.notify(this, STATUS_PENDING | STATUS_ERROR, this.J);
|
|
1047
926
|
}
|
|
1048
927
|
}
|
|
1049
928
|
}
|
|
1050
929
|
});
|
|
1051
|
-
|
|
1052
|
-
if (
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
930
|
+
s = true;
|
|
931
|
+
if (o.K === EFFECT_RENDER) o.m = t => staleValues(() => e(t));
|
|
932
|
+
!r?.defer &&
|
|
933
|
+
!(o.J & (STATUS_ERROR | STATUS_PENDING)) &&
|
|
934
|
+
(o.K === EFFECT_USER ? o.Re.enqueue(o.K, runEffect.bind(o)) : runEffect.call(o));
|
|
935
|
+
onCleanup(() => o.Ne?.());
|
|
1056
936
|
}
|
|
1057
937
|
function runEffect() {
|
|
1058
|
-
if (!this.
|
|
1059
|
-
|
|
1060
|
-
this.
|
|
1061
|
-
this.N = void 0;
|
|
938
|
+
if (!this.M || this._ & REACTIVE_DISPOSED) return;
|
|
939
|
+
this.Ne?.();
|
|
940
|
+
this.Ne = undefined;
|
|
1062
941
|
try {
|
|
1063
|
-
this.
|
|
1064
|
-
} catch (
|
|
1065
|
-
if (!this.
|
|
1066
|
-
throw error;
|
|
942
|
+
this.Ne = this.pe(this.j, this.Oe);
|
|
943
|
+
} catch (e) {
|
|
944
|
+
if (!this.Re.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
1067
945
|
} finally {
|
|
1068
|
-
this.
|
|
1069
|
-
this.
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
);
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
}
|
|
1118
|
-
function createTrackedEffect(compute, options) {
|
|
1119
|
-
}
|
|
1120
|
-
function createReaction(effectFn, options) {
|
|
1121
|
-
let cleanup = void 0;
|
|
1122
|
-
onCleanup(() => cleanup?.());
|
|
1123
|
-
return (tracking2) => {
|
|
1124
|
-
effect(
|
|
1125
|
-
() => (tracking2(), getOwner()),
|
|
1126
|
-
(node) => {
|
|
1127
|
-
cleanup?.();
|
|
1128
|
-
cleanup = (effectFn.effect || effectFn)?.();
|
|
1129
|
-
dispose(node);
|
|
1130
|
-
},
|
|
1131
|
-
effectFn.error,
|
|
1132
|
-
void 0,
|
|
1133
|
-
{
|
|
1134
|
-
defer: true,
|
|
1135
|
-
...options
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
946
|
+
this.Oe = this.j;
|
|
947
|
+
this.M = false;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
function createSignal(e, t, n) {
|
|
951
|
+
if (typeof e === "function") {
|
|
952
|
+
const i = computed(e, t, n);
|
|
953
|
+
return [read.bind(null, i), setSignal.bind(null, i)];
|
|
954
|
+
}
|
|
955
|
+
const i = getOwner();
|
|
956
|
+
const r = i?.id != null;
|
|
957
|
+
const s = signal(e, r ? { id: getNextChildId(i), ...t } : t);
|
|
958
|
+
return [read.bind(null, s), setSignal.bind(null, s)];
|
|
959
|
+
}
|
|
960
|
+
function createMemo(e, t, n) {
|
|
961
|
+
let i = computed(e, t, n);
|
|
962
|
+
return read.bind(null, i);
|
|
963
|
+
}
|
|
964
|
+
function createAsync(e, t, n) {
|
|
965
|
+
const i = asyncComputed(e, t, n);
|
|
966
|
+
const r = read.bind(null, i);
|
|
967
|
+
r.refresh = i.Se;
|
|
968
|
+
return r;
|
|
969
|
+
}
|
|
970
|
+
function createEffect(e, t, n, i) {
|
|
971
|
+
void effect(e, t.effect || t, t.error, n, i);
|
|
972
|
+
}
|
|
973
|
+
function createRenderEffect(e, t, n, i) {
|
|
974
|
+
void effect(e, t, undefined, n, { render: true, ...i });
|
|
975
|
+
}
|
|
976
|
+
function createTrackedEffect(e, t) {}
|
|
977
|
+
function createReaction(e, t) {
|
|
978
|
+
let n = undefined;
|
|
979
|
+
onCleanup(() => n?.());
|
|
980
|
+
const i = getOwner();
|
|
981
|
+
return r => {
|
|
982
|
+
runWithOwner(i, () => {
|
|
983
|
+
effect(
|
|
984
|
+
() => (r(), getOwner()),
|
|
985
|
+
t => {
|
|
986
|
+
n?.();
|
|
987
|
+
n = (e.effect || e)?.();
|
|
988
|
+
dispose(t);
|
|
989
|
+
},
|
|
990
|
+
e.error,
|
|
991
|
+
undefined,
|
|
992
|
+
{ defer: true, ...(false ? { ...t, name: t?.name ?? "effect" } : t) }
|
|
993
|
+
);
|
|
994
|
+
});
|
|
1138
995
|
};
|
|
1139
996
|
}
|
|
1140
|
-
function resolve(
|
|
1141
|
-
return new Promise((
|
|
1142
|
-
createRoot(
|
|
997
|
+
function resolve(e) {
|
|
998
|
+
return new Promise((t, n) => {
|
|
999
|
+
createRoot(i => {
|
|
1143
1000
|
computed(() => {
|
|
1144
1001
|
try {
|
|
1145
|
-
|
|
1146
|
-
} catch (
|
|
1147
|
-
if (
|
|
1148
|
-
|
|
1149
|
-
rej(err);
|
|
1002
|
+
t(e());
|
|
1003
|
+
} catch (e) {
|
|
1004
|
+
if (e instanceof NotReadyError) throw e;
|
|
1005
|
+
n(e);
|
|
1150
1006
|
}
|
|
1151
|
-
|
|
1007
|
+
i();
|
|
1152
1008
|
});
|
|
1153
1009
|
});
|
|
1154
1010
|
});
|
|
1155
1011
|
}
|
|
1156
|
-
function createOptimistic(
|
|
1012
|
+
function createOptimistic(e, t, n) {
|
|
1157
1013
|
return {};
|
|
1158
1014
|
}
|
|
1159
|
-
function onSettled(
|
|
1160
|
-
let
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
!o && cleanup?.();
|
|
1015
|
+
function onSettled(e) {
|
|
1016
|
+
let t;
|
|
1017
|
+
const n = getOwner();
|
|
1018
|
+
if (n) onCleanup(() => t?.());
|
|
1019
|
+
globalQueue.enqueue(EFFECT_USER, () => {
|
|
1020
|
+
t = e();
|
|
1021
|
+
!n && t?.();
|
|
1167
1022
|
});
|
|
1168
1023
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
applyState(
|
|
1024
|
+
function unwrap(e) {
|
|
1025
|
+
return e?.[$TARGET]?.[STORE_NODE] ?? e;
|
|
1026
|
+
}
|
|
1027
|
+
function getOverrideValue(e, t, n, i) {
|
|
1028
|
+
return n && i in n ? read(n[i]) : t && i in t ? t[i] : e[i];
|
|
1029
|
+
}
|
|
1030
|
+
function getAllKeys(e, t, n) {
|
|
1031
|
+
const i = getKeys(e, t);
|
|
1032
|
+
const r = Object.keys(n);
|
|
1033
|
+
return Array.from(new Set([...i, ...r]));
|
|
1034
|
+
}
|
|
1035
|
+
function applyState(e, t, n, i) {
|
|
1036
|
+
const r = t?.[$TARGET];
|
|
1037
|
+
if (!r) return;
|
|
1038
|
+
const s = r[STORE_VALUE];
|
|
1039
|
+
const o = r[STORE_OVERRIDE];
|
|
1040
|
+
let u = r[STORE_NODE];
|
|
1041
|
+
if (e === s && !o) return;
|
|
1042
|
+
(r[STORE_LOOKUP] || storeLookup).set(e, r[$PROXY]);
|
|
1043
|
+
r[STORE_VALUE] = e;
|
|
1044
|
+
r[STORE_OVERRIDE] = undefined;
|
|
1045
|
+
if (Array.isArray(s)) {
|
|
1046
|
+
let t = false;
|
|
1047
|
+
const l = getOverrideValue(s, o, u, "length");
|
|
1048
|
+
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1049
|
+
let c, a, f, E, d, T, R, h;
|
|
1050
|
+
for (
|
|
1051
|
+
f = 0, E = Math.min(l, e.length);
|
|
1052
|
+
f < E && ((T = getOverrideValue(s, o, u, f)) === e[f] || (T && e[f] && n(T) === n(e[f])));
|
|
1053
|
+
f++
|
|
1054
|
+
) {
|
|
1055
|
+
applyState(e[f], wrap(T, r), n, i);
|
|
1201
1056
|
}
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
|
|
1057
|
+
const _ = new Array(e.length),
|
|
1058
|
+
S = new Map();
|
|
1059
|
+
for (
|
|
1060
|
+
E = l - 1, d = e.length - 1;
|
|
1061
|
+
E >= f &&
|
|
1062
|
+
d >= f &&
|
|
1063
|
+
((T = getOverrideValue(s, o, u, E)) === e[d] || (T && e[d] && n(T) === n(e[d])));
|
|
1064
|
+
E--, d--
|
|
1065
|
+
) {
|
|
1066
|
+
_[d] = T;
|
|
1205
1067
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
for (
|
|
1208
|
-
|
|
1209
|
-
|
|
1068
|
+
if (f > d || f > E) {
|
|
1069
|
+
for (a = f; a <= d; a++) {
|
|
1070
|
+
t = true;
|
|
1071
|
+
r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], wrap(e[a], r));
|
|
1210
1072
|
}
|
|
1211
|
-
for (;
|
|
1212
|
-
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
applyState(
|
|
1073
|
+
for (; a < e.length; a++) {
|
|
1074
|
+
t = true;
|
|
1075
|
+
const s = wrap(_[a], r);
|
|
1076
|
+
r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], s);
|
|
1077
|
+
applyState(e[a], s, n, i);
|
|
1216
1078
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1079
|
+
t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
|
|
1080
|
+
l !== e.length && r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
|
|
1219
1081
|
return;
|
|
1220
1082
|
}
|
|
1221
|
-
|
|
1222
|
-
for (
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1083
|
+
R = new Array(d + 1);
|
|
1084
|
+
for (a = d; a >= f; a--) {
|
|
1085
|
+
T = e[a];
|
|
1086
|
+
h = T ? n(T) : T;
|
|
1087
|
+
c = S.get(h);
|
|
1088
|
+
R[a] = c === undefined ? -1 : c;
|
|
1089
|
+
S.set(h, a);
|
|
1228
1090
|
}
|
|
1229
|
-
for (
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
if (
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1091
|
+
for (c = f; c <= E; c++) {
|
|
1092
|
+
T = getOverrideValue(s, o, u, c);
|
|
1093
|
+
h = T ? n(T) : T;
|
|
1094
|
+
a = S.get(h);
|
|
1095
|
+
if (a !== undefined && a !== -1) {
|
|
1096
|
+
_[a] = T;
|
|
1097
|
+
a = R[a];
|
|
1098
|
+
S.set(h, a);
|
|
1237
1099
|
}
|
|
1238
1100
|
}
|
|
1239
|
-
for (
|
|
1240
|
-
if (
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
applyState(
|
|
1244
|
-
} else
|
|
1245
|
-
target[STORE_NODE][j] && setSignal(target[STORE_NODE][j], wrap(next[j], target));
|
|
1101
|
+
for (a = f; a < e.length; a++) {
|
|
1102
|
+
if (a in _) {
|
|
1103
|
+
const t = wrap(_[a], r);
|
|
1104
|
+
r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], t);
|
|
1105
|
+
applyState(e[a], t, n, i);
|
|
1106
|
+
} else r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], wrap(e[a], r));
|
|
1246
1107
|
}
|
|
1247
|
-
if (
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
isWrappable(item) && applyState(next[i], wrap(item, target), keyFn, all);
|
|
1108
|
+
if (f < e.length) t = true;
|
|
1109
|
+
} else if (l && e.length) {
|
|
1110
|
+
for (let t = 0, l = e.length; t < l; t++) {
|
|
1111
|
+
const l = getOverrideValue(s, o, u, t);
|
|
1112
|
+
isWrappable(l) && applyState(e[t], wrap(l, r), n, i);
|
|
1253
1113
|
}
|
|
1254
1114
|
}
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1257
|
-
|
|
1115
|
+
if (l !== e.length) {
|
|
1116
|
+
t = true;
|
|
1117
|
+
r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
|
|
1258
1118
|
}
|
|
1259
|
-
|
|
1119
|
+
t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
|
|
1260
1120
|
return;
|
|
1261
1121
|
}
|
|
1262
|
-
if (
|
|
1263
|
-
const
|
|
1264
|
-
const
|
|
1265
|
-
for (let
|
|
1266
|
-
const
|
|
1267
|
-
const
|
|
1268
|
-
const
|
|
1269
|
-
let
|
|
1270
|
-
if (
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
const keyFn = typeof key === "string" ? (item) => item[key] : key;
|
|
1292
|
-
const eq = keyFn(state);
|
|
1293
|
-
if (eq !== void 0 && keyFn(value) !== keyFn(state))
|
|
1122
|
+
if (u) {
|
|
1123
|
+
const t = u[$TRACK];
|
|
1124
|
+
const l = t || i ? getAllKeys(s, o, e) : Object.keys(u);
|
|
1125
|
+
for (let c = 0, a = l.length; c < a; c++) {
|
|
1126
|
+
const a = l[c];
|
|
1127
|
+
const f = u[a];
|
|
1128
|
+
const E = unwrap(getOverrideValue(s, o, u, a));
|
|
1129
|
+
let d = unwrap(e[a]);
|
|
1130
|
+
if (E === d) continue;
|
|
1131
|
+
if (!E || !isWrappable(E) || (n(E) != null && n(E) !== n(d))) {
|
|
1132
|
+
t && setSignal(t, void 0);
|
|
1133
|
+
f && setSignal(f, isWrappable(d) ? wrap(d, r) : d);
|
|
1134
|
+
} else applyState(d, wrap(E, r), n, i);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
if ((u = r[STORE_HAS])) {
|
|
1138
|
+
const t = Object.keys(u);
|
|
1139
|
+
for (let n = 0, i = t.length; n < i; n++) {
|
|
1140
|
+
const i = t[n];
|
|
1141
|
+
setSignal(u[i], i in e);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
function reconcile(e, t, n = false) {
|
|
1146
|
+
return i => {
|
|
1147
|
+
if (i == null) throw new Error("Cannot reconcile null or undefined state");
|
|
1148
|
+
const r = typeof t === "string" ? e => e[t] : t;
|
|
1149
|
+
const s = r(i);
|
|
1150
|
+
if (s !== undefined && r(e) !== r(i))
|
|
1294
1151
|
throw new Error("Cannot reconcile states with different identity");
|
|
1295
|
-
applyState(
|
|
1152
|
+
applyState(e, i, r, n);
|
|
1296
1153
|
};
|
|
1297
1154
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
return wrappedMap.get(source);
|
|
1306
|
-
if (source[$TARGET]?.[STORE_WRAP] === wrapProjection)
|
|
1307
|
-
return source;
|
|
1308
|
-
const wrapped = createStoreProxy(source, storeTraps, {
|
|
1155
|
+
function createProjectionInternal(e, t = {}, n) {
|
|
1156
|
+
let i;
|
|
1157
|
+
const r = new WeakMap();
|
|
1158
|
+
const wrapProjection = e => {
|
|
1159
|
+
if (r.has(e)) return r.get(e);
|
|
1160
|
+
if (e[$TARGET]?.[STORE_WRAP] === wrapProjection) return e;
|
|
1161
|
+
const t = createStoreProxy(e, storeTraps, {
|
|
1309
1162
|
[STORE_WRAP]: wrapProjection,
|
|
1310
|
-
[STORE_LOOKUP]:
|
|
1163
|
+
[STORE_LOOKUP]: r,
|
|
1311
1164
|
[STORE_FIREWALL]() {
|
|
1312
|
-
return
|
|
1165
|
+
return i;
|
|
1313
1166
|
}
|
|
1314
1167
|
});
|
|
1315
|
-
|
|
1316
|
-
return
|
|
1168
|
+
r.set(e, t);
|
|
1169
|
+
return t;
|
|
1317
1170
|
};
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1320
|
-
storeSetter(
|
|
1321
|
-
const
|
|
1322
|
-
if (
|
|
1323
|
-
reconcile(
|
|
1171
|
+
const s = wrapProjection(t);
|
|
1172
|
+
i = computed(() => {
|
|
1173
|
+
storeSetter(s, t => {
|
|
1174
|
+
const i = e(t);
|
|
1175
|
+
if (i !== t && i !== undefined) {
|
|
1176
|
+
reconcile(i, n?.key || "id", n?.all)(t);
|
|
1324
1177
|
}
|
|
1325
1178
|
});
|
|
1326
1179
|
});
|
|
1327
|
-
return { store:
|
|
1328
|
-
}
|
|
1329
|
-
function createProjection(
|
|
1330
|
-
return createProjectionInternal(
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
return
|
|
1368
|
-
}
|
|
1369
|
-
function
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
return nodes;
|
|
1374
|
-
}
|
|
1375
|
-
function getNode(nodes, property, value, firewall, equals = isEqual) {
|
|
1376
|
-
if (nodes[property])
|
|
1377
|
-
return nodes[property];
|
|
1378
|
-
return nodes[property] = signal(
|
|
1379
|
-
value,
|
|
1180
|
+
return { store: s, node: i };
|
|
1181
|
+
}
|
|
1182
|
+
function createProjection(e, t = {}, n) {
|
|
1183
|
+
return createProjectionInternal(e, t, n).store;
|
|
1184
|
+
}
|
|
1185
|
+
const $TRACK = Symbol(0),
|
|
1186
|
+
$DEEP = Symbol(0),
|
|
1187
|
+
$TARGET = Symbol(0),
|
|
1188
|
+
$PROXY = Symbol(0),
|
|
1189
|
+
$DELETED = Symbol(0);
|
|
1190
|
+
const PARENTS = new WeakMap();
|
|
1191
|
+
const STORE_VALUE = "v",
|
|
1192
|
+
STORE_OVERRIDE = "o",
|
|
1193
|
+
STORE_NODE = "n",
|
|
1194
|
+
STORE_HAS = "h",
|
|
1195
|
+
STORE_WRAP = "w",
|
|
1196
|
+
STORE_LOOKUP = "l",
|
|
1197
|
+
STORE_FIREWALL = "f";
|
|
1198
|
+
function createStoreProxy(e, t = storeTraps, n) {
|
|
1199
|
+
let i;
|
|
1200
|
+
if (Array.isArray(e)) {
|
|
1201
|
+
i = [];
|
|
1202
|
+
i.v = e;
|
|
1203
|
+
} else i = { v: e };
|
|
1204
|
+
n && Object.assign(i, n);
|
|
1205
|
+
return (i[$PROXY] = new Proxy(i, t));
|
|
1206
|
+
}
|
|
1207
|
+
const storeLookup = new WeakMap();
|
|
1208
|
+
function wrap(e, t) {
|
|
1209
|
+
if (t?.[STORE_WRAP]) return t[STORE_WRAP](e, t);
|
|
1210
|
+
let n = e[$PROXY] || storeLookup.get(e);
|
|
1211
|
+
if (!n) storeLookup.set(e, (n = createStoreProxy(e)));
|
|
1212
|
+
return n;
|
|
1213
|
+
}
|
|
1214
|
+
function isWrappable(e) {
|
|
1215
|
+
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1216
|
+
}
|
|
1217
|
+
function getNodes(e, t) {
|
|
1218
|
+
let n = e[t];
|
|
1219
|
+
if (!n) e[t] = n = Object.create(null);
|
|
1220
|
+
return n;
|
|
1221
|
+
}
|
|
1222
|
+
function getNode(e, t, n, i, r = isEqual) {
|
|
1223
|
+
if (e[t]) return e[t];
|
|
1224
|
+
return (e[t] = signal(
|
|
1225
|
+
n,
|
|
1380
1226
|
{
|
|
1381
|
-
equals,
|
|
1227
|
+
equals: r,
|
|
1382
1228
|
unobserved() {
|
|
1383
|
-
delete
|
|
1229
|
+
delete e[t];
|
|
1384
1230
|
}
|
|
1385
1231
|
},
|
|
1386
|
-
|
|
1387
|
-
);
|
|
1388
|
-
}
|
|
1389
|
-
function trackSelf(
|
|
1390
|
-
getObserver() &&
|
|
1391
|
-
getNode(getNodes(
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
return
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
let value = tracked ? overridden || !proxySource ? read(nodes[property]) : (read(nodes[property]), storeValue[property]) : storeValue[property];
|
|
1449
|
-
value === $DELETED && (value = void 0);
|
|
1450
|
-
if (!tracked) {
|
|
1451
|
-
if (!overridden && typeof value === "function" && !storeValue.hasOwnProperty(property)) {
|
|
1452
|
-
let proto;
|
|
1453
|
-
return !Array.isArray(target[STORE_VALUE]) && (proto = Object.getPrototypeOf(target[STORE_VALUE])) && proto !== Object.prototype ? value.bind(storeValue) : value;
|
|
1232
|
+
i
|
|
1233
|
+
));
|
|
1234
|
+
}
|
|
1235
|
+
function trackSelf(e, t = $TRACK) {
|
|
1236
|
+
getObserver() &&
|
|
1237
|
+
read(getNode(getNodes(e, STORE_NODE), t, undefined, e[STORE_FIREWALL]?.(), false));
|
|
1238
|
+
}
|
|
1239
|
+
function getKeys(e, t, n = true) {
|
|
1240
|
+
const i = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
1241
|
+
if (!t) return i;
|
|
1242
|
+
const r = new Set(i);
|
|
1243
|
+
const s = Reflect.ownKeys(t);
|
|
1244
|
+
for (const e of s) {
|
|
1245
|
+
if (t[e] !== $DELETED) r.add(e);
|
|
1246
|
+
else r.delete(e);
|
|
1247
|
+
}
|
|
1248
|
+
return Array.from(r);
|
|
1249
|
+
}
|
|
1250
|
+
function getPropertyDescriptor(e, t, n) {
|
|
1251
|
+
let i = e;
|
|
1252
|
+
if (t && n in t) {
|
|
1253
|
+
if (i[n] === $DELETED) return void 0;
|
|
1254
|
+
if (!(n in i)) i = t;
|
|
1255
|
+
}
|
|
1256
|
+
return Reflect.getOwnPropertyDescriptor(i, n);
|
|
1257
|
+
}
|
|
1258
|
+
let Writing = null;
|
|
1259
|
+
const storeTraps = {
|
|
1260
|
+
get(e, t, n) {
|
|
1261
|
+
if (t === $TARGET) return e;
|
|
1262
|
+
if (t === $PROXY) return n;
|
|
1263
|
+
if (t === $TRACK || t === $DEEP) {
|
|
1264
|
+
trackSelf(e, t);
|
|
1265
|
+
return n;
|
|
1266
|
+
}
|
|
1267
|
+
const i = getNodes(e, STORE_NODE);
|
|
1268
|
+
const r = i[t];
|
|
1269
|
+
const s = e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE];
|
|
1270
|
+
const o = !!e[STORE_VALUE][$TARGET];
|
|
1271
|
+
const u = s ? e[STORE_OVERRIDE] : e[STORE_VALUE];
|
|
1272
|
+
if (!r) {
|
|
1273
|
+
const e = Object.getOwnPropertyDescriptor(u, t);
|
|
1274
|
+
if (e && e.get) return e.get.call(n);
|
|
1275
|
+
}
|
|
1276
|
+
if (Writing?.has(n)) {
|
|
1277
|
+
let n = r && (s || !o) ? (r.W !== NOT_PENDING ? r.W : r.j) : u[t];
|
|
1278
|
+
n === $DELETED && (n = undefined);
|
|
1279
|
+
if (!isWrappable(n)) return n;
|
|
1280
|
+
const i = wrap(n, e);
|
|
1281
|
+
Writing.add(i);
|
|
1282
|
+
return i;
|
|
1283
|
+
}
|
|
1284
|
+
let l = r ? (s || !o ? read(i[t]) : (read(i[t]), u[t])) : u[t];
|
|
1285
|
+
l === $DELETED && (l = undefined);
|
|
1286
|
+
if (!r) {
|
|
1287
|
+
if (!s && typeof l === "function" && !u.hasOwnProperty(t)) {
|
|
1288
|
+
let t;
|
|
1289
|
+
return !Array.isArray(e[STORE_VALUE]) &&
|
|
1290
|
+
(t = Object.getPrototypeOf(e[STORE_VALUE])) &&
|
|
1291
|
+
t !== Object.prototype
|
|
1292
|
+
? l.bind(u)
|
|
1293
|
+
: l;
|
|
1454
1294
|
} else if (getObserver()) {
|
|
1455
|
-
return read(
|
|
1456
|
-
getNode(
|
|
1457
|
-
nodes,
|
|
1458
|
-
property,
|
|
1459
|
-
isWrappable(value) ? wrap(value, target) : value,
|
|
1460
|
-
target[STORE_FIREWALL]?.()
|
|
1461
|
-
)
|
|
1462
|
-
);
|
|
1295
|
+
return read(getNode(i, t, isWrappable(l) ? wrap(l, e) : l, e[STORE_FIREWALL]?.()));
|
|
1463
1296
|
}
|
|
1464
1297
|
}
|
|
1465
|
-
return isWrappable(
|
|
1298
|
+
return isWrappable(l) ? wrap(l, e) : l;
|
|
1466
1299
|
},
|
|
1467
|
-
has(
|
|
1468
|
-
if (
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1300
|
+
has(e, t) {
|
|
1301
|
+
if (t === $PROXY || t === $TRACK || t === "__proto__") return true;
|
|
1302
|
+
const n =
|
|
1303
|
+
e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
1304
|
+
? e[STORE_OVERRIDE][t] !== $DELETED
|
|
1305
|
+
: t in e[STORE_VALUE];
|
|
1306
|
+
getObserver() && read(getNode(getNodes(e, STORE_HAS), t, n, e[STORE_FIREWALL]?.()));
|
|
1307
|
+
return n;
|
|
1473
1308
|
},
|
|
1474
|
-
set(
|
|
1475
|
-
const
|
|
1476
|
-
if (Writing?.has(
|
|
1309
|
+
set(e, t, n) {
|
|
1310
|
+
const i = e[$PROXY];
|
|
1311
|
+
if (Writing?.has(e[$PROXY])) {
|
|
1477
1312
|
untrack(() => {
|
|
1478
|
-
const
|
|
1479
|
-
const
|
|
1480
|
-
const
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
if (isWrappable(prev)) {
|
|
1491
|
-
const parents = PARENTS.get(prev);
|
|
1492
|
-
parents && (parents instanceof Set ? parents.delete(store) : PARENTS.delete(prev));
|
|
1313
|
+
const r = e[STORE_VALUE];
|
|
1314
|
+
const s = r[t];
|
|
1315
|
+
const o = e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE] ? e[STORE_OVERRIDE][t] : s;
|
|
1316
|
+
const u = n?.[$TARGET]?.[STORE_VALUE] ?? n;
|
|
1317
|
+
if (o === u) return true;
|
|
1318
|
+
const l = e[STORE_OVERRIDE]?.length || r.length;
|
|
1319
|
+
if (u !== undefined && u === s) delete e[STORE_OVERRIDE][t];
|
|
1320
|
+
else (e[STORE_OVERRIDE] || (e[STORE_OVERRIDE] = Object.create(null)))[t] = u;
|
|
1321
|
+
const c = isWrappable(u);
|
|
1322
|
+
if (isWrappable(o)) {
|
|
1323
|
+
const e = PARENTS.get(o);
|
|
1324
|
+
e && (e instanceof Set ? e.delete(i) : PARENTS.delete(o));
|
|
1493
1325
|
}
|
|
1494
|
-
if (recursivelyNotify(
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
if (index > len)
|
|
1502
|
-
nodes.length && setSignal(nodes.length, index);
|
|
1326
|
+
if (recursivelyNotify(i, storeLookup) && c) recursivelyAddParent(u, i);
|
|
1327
|
+
e[STORE_HAS]?.[t] && setSignal(e[STORE_HAS][t], true);
|
|
1328
|
+
const a = getNodes(e, STORE_NODE);
|
|
1329
|
+
a[t] && setSignal(a[t], () => (c ? wrap(u, e) : u));
|
|
1330
|
+
if (Array.isArray(r)) {
|
|
1331
|
+
const e = parseInt(t) + 1;
|
|
1332
|
+
if (e > l) a.length && setSignal(a.length, e);
|
|
1503
1333
|
}
|
|
1504
|
-
|
|
1334
|
+
a[$TRACK] && setSignal(a[$TRACK], undefined);
|
|
1505
1335
|
});
|
|
1506
1336
|
}
|
|
1507
1337
|
return true;
|
|
1508
1338
|
},
|
|
1509
|
-
deleteProperty(
|
|
1510
|
-
if (Writing?.has(
|
|
1339
|
+
deleteProperty(e, t) {
|
|
1340
|
+
if (Writing?.has(e[$PROXY]) && e[STORE_OVERRIDE]?.[t] !== $DELETED) {
|
|
1511
1341
|
untrack(() => {
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
if (isWrappable(
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1342
|
+
const n =
|
|
1343
|
+
e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE] ? e[STORE_OVERRIDE][t] : e[STORE_VALUE][t];
|
|
1344
|
+
if (t in e[STORE_VALUE]) {
|
|
1345
|
+
(e[STORE_OVERRIDE] || (e[STORE_OVERRIDE] = Object.create(null)))[t] = $DELETED;
|
|
1346
|
+
} else if (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]) {
|
|
1347
|
+
delete e[STORE_OVERRIDE][t];
|
|
1348
|
+
} else return true;
|
|
1349
|
+
if (isWrappable(n)) {
|
|
1350
|
+
const t = PARENTS.get(n);
|
|
1351
|
+
t && (t instanceof Set ? t.delete(e) : PARENTS.delete(n));
|
|
1522
1352
|
}
|
|
1523
|
-
if (
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
nodes[$TRACK] && setSignal(nodes[$TRACK], void 0);
|
|
1353
|
+
if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], false);
|
|
1354
|
+
const i = getNodes(e, STORE_NODE);
|
|
1355
|
+
i[t] && setSignal(i[t], undefined);
|
|
1356
|
+
i[$TRACK] && setSignal(i[$TRACK], undefined);
|
|
1528
1357
|
});
|
|
1529
1358
|
}
|
|
1530
1359
|
return true;
|
|
1531
1360
|
},
|
|
1532
|
-
ownKeys(
|
|
1533
|
-
trackSelf(
|
|
1534
|
-
return getKeys(
|
|
1361
|
+
ownKeys(e) {
|
|
1362
|
+
trackSelf(e);
|
|
1363
|
+
return getKeys(e[STORE_VALUE], e[STORE_OVERRIDE], false);
|
|
1535
1364
|
},
|
|
1536
|
-
getOwnPropertyDescriptor(
|
|
1537
|
-
if (
|
|
1538
|
-
|
|
1539
|
-
return getPropertyDescriptor(target[STORE_VALUE], target[STORE_OVERRIDE], property);
|
|
1365
|
+
getOwnPropertyDescriptor(e, t) {
|
|
1366
|
+
if (t === $PROXY) return { value: e[$PROXY], writable: true, configurable: true };
|
|
1367
|
+
return getPropertyDescriptor(e[STORE_VALUE], e[STORE_OVERRIDE], t);
|
|
1540
1368
|
},
|
|
1541
|
-
getPrototypeOf(
|
|
1542
|
-
return Object.getPrototypeOf(
|
|
1369
|
+
getPrototypeOf(e) {
|
|
1370
|
+
return Object.getPrototypeOf(e[STORE_VALUE]);
|
|
1543
1371
|
}
|
|
1544
1372
|
};
|
|
1545
|
-
function storeSetter(
|
|
1546
|
-
const
|
|
1547
|
-
Writing =
|
|
1548
|
-
Writing.add(
|
|
1373
|
+
function storeSetter(e, t) {
|
|
1374
|
+
const n = Writing;
|
|
1375
|
+
Writing = new Set();
|
|
1376
|
+
Writing.add(e);
|
|
1549
1377
|
try {
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
if (Array.isArray(
|
|
1553
|
-
for (let
|
|
1554
|
-
|
|
1555
|
-
store.length = value.length;
|
|
1378
|
+
const n = t(e);
|
|
1379
|
+
if (n !== e && n !== undefined) {
|
|
1380
|
+
if (Array.isArray(n)) {
|
|
1381
|
+
for (let t = 0, i = n.length; t < i; t++) e[t] = n[t];
|
|
1382
|
+
e.length = n.length;
|
|
1556
1383
|
} else {
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1561
|
-
else
|
|
1562
|
-
delete store[key];
|
|
1384
|
+
const t = new Set([...Object.keys(e), ...Object.keys(n)]);
|
|
1385
|
+
t.forEach(t => {
|
|
1386
|
+
if (t in n) e[t] = n[t];
|
|
1387
|
+
else delete e[t];
|
|
1563
1388
|
});
|
|
1564
1389
|
}
|
|
1565
1390
|
}
|
|
1566
1391
|
} finally {
|
|
1567
1392
|
Writing.clear();
|
|
1568
|
-
Writing =
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
function createStore(
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
let
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
if (
|
|
1590
|
-
for (let
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}
|
|
1616
|
-
if (Array.isArray(state)) {
|
|
1617
|
-
const len = override?.length || state.length;
|
|
1618
|
-
for (let i = 0; i < len; i++) {
|
|
1619
|
-
const item = override && i in override ? override[i] : state[i];
|
|
1620
|
-
isWrappable(item) && recursivelyAddParent(item, state);
|
|
1393
|
+
Writing = n;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
function createStore(e, t, n) {
|
|
1397
|
+
const i = typeof e === "function",
|
|
1398
|
+
r = i ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
1399
|
+
return [r, e => storeSetter(r, e)];
|
|
1400
|
+
}
|
|
1401
|
+
function recursivelyNotify(e, t) {
|
|
1402
|
+
let n = e[$TARGET] || t?.get(e)?.[$TARGET];
|
|
1403
|
+
let i = false;
|
|
1404
|
+
if (n) {
|
|
1405
|
+
const e = getNodes(n, STORE_NODE)[$DEEP];
|
|
1406
|
+
if (e) {
|
|
1407
|
+
setSignal(e, undefined);
|
|
1408
|
+
i = true;
|
|
1409
|
+
}
|
|
1410
|
+
t = n[STORE_LOOKUP] || t;
|
|
1411
|
+
}
|
|
1412
|
+
const r = PARENTS.get(n?.[STORE_VALUE] || e);
|
|
1413
|
+
if (!r) return i;
|
|
1414
|
+
if (r instanceof Set) {
|
|
1415
|
+
for (let e of r) i = recursivelyNotify(e, t) || i;
|
|
1416
|
+
} else i = recursivelyNotify(r, t) || i;
|
|
1417
|
+
return i;
|
|
1418
|
+
}
|
|
1419
|
+
function recursivelyAddParent(e, t) {
|
|
1420
|
+
let n;
|
|
1421
|
+
const i = e[$TARGET];
|
|
1422
|
+
if (i) {
|
|
1423
|
+
n = i[STORE_OVERRIDE];
|
|
1424
|
+
e = i[STORE_VALUE];
|
|
1425
|
+
}
|
|
1426
|
+
if (t) {
|
|
1427
|
+
let n = PARENTS.get(e);
|
|
1428
|
+
if (!n) PARENTS.set(e, t);
|
|
1429
|
+
else if (n !== t) {
|
|
1430
|
+
if (!(n instanceof Set)) PARENTS.set(e, (n = new Set([n])));
|
|
1431
|
+
else if (n.has(t)) return;
|
|
1432
|
+
n.add(t);
|
|
1433
|
+
} else return;
|
|
1434
|
+
}
|
|
1435
|
+
if (Array.isArray(e)) {
|
|
1436
|
+
const t = n?.length || e.length;
|
|
1437
|
+
for (let i = 0; i < t; i++) {
|
|
1438
|
+
const t = n && i in n ? n[i] : e[i];
|
|
1439
|
+
isWrappable(t) && recursivelyAddParent(t, e);
|
|
1621
1440
|
}
|
|
1622
1441
|
} else {
|
|
1623
|
-
const
|
|
1624
|
-
for (let i = 0; i <
|
|
1625
|
-
const
|
|
1626
|
-
const
|
|
1627
|
-
isWrappable(
|
|
1442
|
+
const t = getKeys(e, n);
|
|
1443
|
+
for (let i = 0; i < t.length; i++) {
|
|
1444
|
+
const r = t[i];
|
|
1445
|
+
const s = n && r in n ? n[r] : e[r];
|
|
1446
|
+
isWrappable(s) && recursivelyAddParent(s, e);
|
|
1628
1447
|
}
|
|
1629
1448
|
}
|
|
1630
1449
|
}
|
|
1631
|
-
function deep(
|
|
1632
|
-
recursivelyAddParent(
|
|
1633
|
-
return
|
|
1450
|
+
function deep(e) {
|
|
1451
|
+
recursivelyAddParent(e);
|
|
1452
|
+
return e[$DEEP];
|
|
1634
1453
|
}
|
|
1635
|
-
|
|
1636
|
-
// src/store/optimistic.ts
|
|
1637
|
-
function createOptimisticStore(first, second, options) {
|
|
1454
|
+
function createOptimisticStore(e, t, n) {
|
|
1638
1455
|
return [];
|
|
1639
1456
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
if (!
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
override = target[STORE_OVERRIDE];
|
|
1652
|
-
isArray = Array.isArray(target[STORE_VALUE]);
|
|
1653
|
-
map.set(
|
|
1654
|
-
item,
|
|
1655
|
-
override ? result = isArray ? [] : Object.create(Object.getPrototypeOf(target[STORE_VALUE])) : target[STORE_VALUE]
|
|
1457
|
+
function snapshot(e, t, n) {
|
|
1458
|
+
let i, r, s, o, u, l;
|
|
1459
|
+
if (!isWrappable(e)) return e;
|
|
1460
|
+
if (t && t.has(e)) return t.get(e);
|
|
1461
|
+
if (!t) t = new Map();
|
|
1462
|
+
if ((i = e[$TARGET] || n?.get(e)?.[$TARGET])) {
|
|
1463
|
+
s = i[STORE_OVERRIDE];
|
|
1464
|
+
r = Array.isArray(i[STORE_VALUE]);
|
|
1465
|
+
t.set(
|
|
1466
|
+
e,
|
|
1467
|
+
s ? (o = r ? [] : Object.create(Object.getPrototypeOf(i[STORE_VALUE]))) : i[STORE_VALUE]
|
|
1656
1468
|
);
|
|
1657
|
-
|
|
1658
|
-
|
|
1469
|
+
e = i[STORE_VALUE];
|
|
1470
|
+
n = storeLookup;
|
|
1659
1471
|
} else {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
}
|
|
1663
|
-
if (
|
|
1664
|
-
const
|
|
1665
|
-
for (let
|
|
1666
|
-
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
map.set(item, result = [...item]);
|
|
1672
|
-
result[i] = unwrapped;
|
|
1472
|
+
r = Array.isArray(e);
|
|
1473
|
+
t.set(e, e);
|
|
1474
|
+
}
|
|
1475
|
+
if (r) {
|
|
1476
|
+
const i = s?.length || e.length;
|
|
1477
|
+
for (let r = 0; r < i; r++) {
|
|
1478
|
+
l = s && r in s ? s[r] : e[r];
|
|
1479
|
+
if (l === $DELETED) continue;
|
|
1480
|
+
if ((u = snapshot(l, t, n)) !== l || o) {
|
|
1481
|
+
if (!o) t.set(e, (o = [...e]));
|
|
1482
|
+
o[r] = u;
|
|
1673
1483
|
}
|
|
1674
1484
|
}
|
|
1675
1485
|
} else {
|
|
1676
|
-
const
|
|
1677
|
-
for (let
|
|
1678
|
-
let
|
|
1679
|
-
const
|
|
1680
|
-
if (
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
Object.assign(result, item);
|
|
1486
|
+
const i = getKeys(e, s);
|
|
1487
|
+
for (let r = 0, c = i.length; r < c; r++) {
|
|
1488
|
+
let c = i[r];
|
|
1489
|
+
const a = getPropertyDescriptor(e, s, c);
|
|
1490
|
+
if (a.get) continue;
|
|
1491
|
+
l = s && c in s ? s[c] : e[c];
|
|
1492
|
+
if ((u = snapshot(l, t, n)) !== e[c] || o) {
|
|
1493
|
+
if (!o) {
|
|
1494
|
+
o = Object.create(Object.getPrototypeOf(e));
|
|
1495
|
+
Object.assign(o, e);
|
|
1687
1496
|
}
|
|
1688
|
-
|
|
1497
|
+
o[c] = u;
|
|
1689
1498
|
}
|
|
1690
1499
|
}
|
|
1691
1500
|
}
|
|
1692
|
-
return
|
|
1501
|
+
return o || e;
|
|
1693
1502
|
}
|
|
1694
1503
|
function trueFn() {
|
|
1695
1504
|
return true;
|
|
1696
1505
|
}
|
|
1697
|
-
|
|
1698
|
-
get(
|
|
1699
|
-
if (
|
|
1700
|
-
|
|
1701
|
-
return _.get(property);
|
|
1506
|
+
const propTraps = {
|
|
1507
|
+
get(e, t, n) {
|
|
1508
|
+
if (t === $PROXY) return n;
|
|
1509
|
+
return e.get(t);
|
|
1702
1510
|
},
|
|
1703
|
-
has(
|
|
1704
|
-
if (
|
|
1705
|
-
|
|
1706
|
-
return _.has(property);
|
|
1511
|
+
has(e, t) {
|
|
1512
|
+
if (t === $PROXY) return true;
|
|
1513
|
+
return e.has(t);
|
|
1707
1514
|
},
|
|
1708
1515
|
set: trueFn,
|
|
1709
1516
|
deleteProperty: trueFn,
|
|
1710
|
-
getOwnPropertyDescriptor(
|
|
1517
|
+
getOwnPropertyDescriptor(e, t) {
|
|
1711
1518
|
return {
|
|
1712
1519
|
configurable: true,
|
|
1713
1520
|
enumerable: true,
|
|
1714
1521
|
get() {
|
|
1715
|
-
return
|
|
1522
|
+
return e.get(t);
|
|
1716
1523
|
},
|
|
1717
1524
|
set: trueFn,
|
|
1718
1525
|
deleteProperty: trueFn
|
|
1719
1526
|
};
|
|
1720
1527
|
},
|
|
1721
|
-
ownKeys(
|
|
1722
|
-
return
|
|
1528
|
+
ownKeys(e) {
|
|
1529
|
+
return e.keys();
|
|
1723
1530
|
}
|
|
1724
1531
|
};
|
|
1725
|
-
function resolveSource(
|
|
1726
|
-
return !(
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
function merge(...
|
|
1730
|
-
if (
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
flattened.push(
|
|
1742
|
-
typeof s === "function" ? (proxy = true, createMemo(s)) : s
|
|
1743
|
-
);
|
|
1744
|
-
}
|
|
1745
|
-
if (SUPPORTS_PROXY && proxy) {
|
|
1532
|
+
function resolveSource(e) {
|
|
1533
|
+
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
1534
|
+
}
|
|
1535
|
+
const $SOURCES = Symbol(0);
|
|
1536
|
+
function merge(...e) {
|
|
1537
|
+
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
1538
|
+
let t = false;
|
|
1539
|
+
const n = [];
|
|
1540
|
+
for (let i = 0; i < e.length; i++) {
|
|
1541
|
+
const r = e[i];
|
|
1542
|
+
t = t || (!!r && $PROXY in r);
|
|
1543
|
+
const s = !!r && r[$SOURCES];
|
|
1544
|
+
if (s) n.push(...s);
|
|
1545
|
+
else n.push(typeof r === "function" ? ((t = true), createMemo(r)) : r);
|
|
1546
|
+
}
|
|
1547
|
+
if (SUPPORTS_PROXY && t) {
|
|
1746
1548
|
return new Proxy(
|
|
1747
1549
|
{
|
|
1748
|
-
get(
|
|
1749
|
-
if (
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
if (property in s)
|
|
1754
|
-
return s[property];
|
|
1550
|
+
get(e) {
|
|
1551
|
+
if (e === $SOURCES) return n;
|
|
1552
|
+
for (let t = n.length - 1; t >= 0; t--) {
|
|
1553
|
+
const i = resolveSource(n[t]);
|
|
1554
|
+
if (e in i) return i[e];
|
|
1755
1555
|
}
|
|
1756
1556
|
},
|
|
1757
|
-
has(
|
|
1758
|
-
for (let
|
|
1759
|
-
if (
|
|
1760
|
-
return true;
|
|
1557
|
+
has(e) {
|
|
1558
|
+
for (let t = n.length - 1; t >= 0; t--) {
|
|
1559
|
+
if (e in resolveSource(n[t])) return true;
|
|
1761
1560
|
}
|
|
1762
1561
|
return false;
|
|
1763
1562
|
},
|
|
1764
1563
|
keys() {
|
|
1765
|
-
const
|
|
1766
|
-
for (let
|
|
1767
|
-
|
|
1768
|
-
return [...new Set(keys)];
|
|
1564
|
+
const e = [];
|
|
1565
|
+
for (let t = 0; t < n.length; t++) e.push(...Object.keys(resolveSource(n[t])));
|
|
1566
|
+
return [...new Set(e)];
|
|
1769
1567
|
}
|
|
1770
1568
|
},
|
|
1771
1569
|
propTraps
|
|
1772
1570
|
);
|
|
1773
1571
|
}
|
|
1774
|
-
const
|
|
1775
|
-
let
|
|
1776
|
-
let
|
|
1777
|
-
for (let
|
|
1778
|
-
const
|
|
1779
|
-
if (!
|
|
1780
|
-
|
|
1572
|
+
const i = Object.create(null);
|
|
1573
|
+
let r = false;
|
|
1574
|
+
let s = n.length - 1;
|
|
1575
|
+
for (let e = s; e >= 0; e--) {
|
|
1576
|
+
const t = n[e];
|
|
1577
|
+
if (!t) {
|
|
1578
|
+
e === s && s--;
|
|
1781
1579
|
continue;
|
|
1782
1580
|
}
|
|
1783
|
-
const
|
|
1784
|
-
for (let
|
|
1785
|
-
const
|
|
1786
|
-
if (
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
defined[key] = desc.get ? {
|
|
1792
|
-
enumerable: true,
|
|
1793
|
-
configurable: true,
|
|
1794
|
-
get: desc.get.bind(source)
|
|
1795
|
-
} : desc;
|
|
1581
|
+
const o = Object.getOwnPropertyNames(t);
|
|
1582
|
+
for (let n = o.length - 1; n >= 0; n--) {
|
|
1583
|
+
const u = o[n];
|
|
1584
|
+
if (u === "__proto__" || u === "constructor") continue;
|
|
1585
|
+
if (!i[u]) {
|
|
1586
|
+
r = r || e !== s;
|
|
1587
|
+
const n = Object.getOwnPropertyDescriptor(t, u);
|
|
1588
|
+
i[u] = n.get ? { enumerable: true, configurable: true, get: n.get.bind(t) } : n;
|
|
1796
1589
|
}
|
|
1797
1590
|
}
|
|
1798
1591
|
}
|
|
1799
|
-
if (!
|
|
1800
|
-
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
if (
|
|
1806
|
-
|
|
1807
|
-
else
|
|
1808
|
-
target[key] = desc.value;
|
|
1592
|
+
if (!r) return n[s];
|
|
1593
|
+
const o = {};
|
|
1594
|
+
const u = Object.keys(i);
|
|
1595
|
+
for (let e = u.length - 1; e >= 0; e--) {
|
|
1596
|
+
const t = u[e],
|
|
1597
|
+
n = i[t];
|
|
1598
|
+
if (n.get) Object.defineProperty(o, t, n);
|
|
1599
|
+
else o[t] = n.value;
|
|
1809
1600
|
}
|
|
1810
|
-
|
|
1811
|
-
return
|
|
1601
|
+
o[$SOURCES] = n;
|
|
1602
|
+
return o;
|
|
1812
1603
|
}
|
|
1813
|
-
function omit(
|
|
1814
|
-
const
|
|
1815
|
-
if (SUPPORTS_PROXY && $PROXY in
|
|
1604
|
+
function omit(e, ...t) {
|
|
1605
|
+
const n = new Set(t);
|
|
1606
|
+
if (SUPPORTS_PROXY && $PROXY in e) {
|
|
1816
1607
|
return new Proxy(
|
|
1817
1608
|
{
|
|
1818
|
-
get(
|
|
1819
|
-
return
|
|
1609
|
+
get(t) {
|
|
1610
|
+
return n.has(t) ? undefined : e[t];
|
|
1820
1611
|
},
|
|
1821
|
-
has(
|
|
1822
|
-
return !
|
|
1612
|
+
has(t) {
|
|
1613
|
+
return !n.has(t) && t in e;
|
|
1823
1614
|
},
|
|
1824
1615
|
keys() {
|
|
1825
|
-
return Object.keys(
|
|
1616
|
+
return Object.keys(e).filter(e => !n.has(e));
|
|
1826
1617
|
}
|
|
1827
1618
|
},
|
|
1828
1619
|
propTraps
|
|
1829
1620
|
);
|
|
1830
1621
|
}
|
|
1831
|
-
const
|
|
1832
|
-
for (const
|
|
1833
|
-
if (!
|
|
1834
|
-
const
|
|
1835
|
-
!
|
|
1622
|
+
const i = {};
|
|
1623
|
+
for (const t of Object.getOwnPropertyNames(e)) {
|
|
1624
|
+
if (!n.has(t)) {
|
|
1625
|
+
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
1626
|
+
!n.get && !n.set && n.enumerable && n.writable && n.configurable
|
|
1627
|
+
? (i[t] = n.value)
|
|
1628
|
+
: Object.defineProperty(i, t, n);
|
|
1836
1629
|
}
|
|
1837
1630
|
}
|
|
1838
|
-
return
|
|
1631
|
+
return i;
|
|
1839
1632
|
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
function mapArray(list, map, options) {
|
|
1843
|
-
const keyFn = typeof options?.keyed === "function" ? options.keyed : void 0;
|
|
1633
|
+
function mapArray(e, t, n) {
|
|
1634
|
+
const i = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
1844
1635
|
return createMemo(
|
|
1845
1636
|
updateKeyedMap.bind({
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1637
|
+
Ie: createOwner(),
|
|
1638
|
+
ge: 0,
|
|
1639
|
+
ye: e,
|
|
1640
|
+
Ce: [],
|
|
1641
|
+
De: t,
|
|
1642
|
+
Pe: [],
|
|
1643
|
+
we: [],
|
|
1644
|
+
be: i,
|
|
1645
|
+
Ve: i || n?.keyed === false ? [] : undefined,
|
|
1646
|
+
Ue: t.length > 1 ? [] : undefined,
|
|
1647
|
+
me: n?.fallback
|
|
1857
1648
|
})
|
|
1858
1649
|
);
|
|
1859
1650
|
}
|
|
1860
|
-
|
|
1651
|
+
const pureOptions = { pureWrite: true };
|
|
1861
1652
|
function updateKeyedMap() {
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
this.
|
|
1890
|
-
this.
|
|
1891
|
-
this.
|
|
1653
|
+
const e = this.ye() || [],
|
|
1654
|
+
t = e.length;
|
|
1655
|
+
e[$TRACK];
|
|
1656
|
+
runWithOwner(this.Ie, () => {
|
|
1657
|
+
let n,
|
|
1658
|
+
i,
|
|
1659
|
+
r = this.Ve
|
|
1660
|
+
? () => {
|
|
1661
|
+
this.Ve[i] = signal(e[i], pureOptions);
|
|
1662
|
+
this.Ue && (this.Ue[i] = signal(i, pureOptions));
|
|
1663
|
+
return this.De(
|
|
1664
|
+
read.bind(null, this.Ve[i]),
|
|
1665
|
+
this.Ue ? read.bind(null, this.Ue[i]) : undefined
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
: this.Ue
|
|
1669
|
+
? () => {
|
|
1670
|
+
const t = e[i];
|
|
1671
|
+
this.Ue[i] = signal(i, pureOptions);
|
|
1672
|
+
return this.De(() => t, read.bind(null, this.Ue[i]));
|
|
1673
|
+
}
|
|
1674
|
+
: () => {
|
|
1675
|
+
const t = e[i];
|
|
1676
|
+
return this.De(() => t);
|
|
1677
|
+
};
|
|
1678
|
+
if (t === 0) {
|
|
1679
|
+
if (this.ge !== 0) {
|
|
1680
|
+
this.Ie.dispose(false);
|
|
1681
|
+
this.we = [];
|
|
1682
|
+
this.Ce = [];
|
|
1683
|
+
this.Pe = [];
|
|
1684
|
+
this.ge = 0;
|
|
1685
|
+
this.Ve && (this.Ve = []);
|
|
1686
|
+
this.Ue && (this.Ue = []);
|
|
1892
1687
|
}
|
|
1893
|
-
if (this.
|
|
1894
|
-
this.
|
|
1895
|
-
this.a[0] = createOwner(),
|
|
1896
|
-
this.Y
|
|
1897
|
-
);
|
|
1688
|
+
if (this.me && !this.Pe[0]) {
|
|
1689
|
+
this.Pe[0] = runWithOwner((this.we[0] = createOwner()), this.me);
|
|
1898
1690
|
}
|
|
1899
|
-
} else if (this.
|
|
1900
|
-
if (this.
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
this.
|
|
1905
|
-
this.d[j] = runWithOwner(this.a[j] = createOwner(), mapper);
|
|
1691
|
+
} else if (this.ge === 0) {
|
|
1692
|
+
if (this.we[0]) this.we[0].dispose();
|
|
1693
|
+
this.Pe = new Array(t);
|
|
1694
|
+
for (i = 0; i < t; i++) {
|
|
1695
|
+
this.Ce[i] = e[i];
|
|
1696
|
+
this.Pe[i] = runWithOwner((this.we[i] = createOwner()), r);
|
|
1906
1697
|
}
|
|
1907
|
-
this.
|
|
1698
|
+
this.ge = t;
|
|
1908
1699
|
} else {
|
|
1909
|
-
let
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1700
|
+
let s,
|
|
1701
|
+
o,
|
|
1702
|
+
u,
|
|
1703
|
+
l,
|
|
1704
|
+
c,
|
|
1705
|
+
a,
|
|
1706
|
+
f,
|
|
1707
|
+
E = new Array(t),
|
|
1708
|
+
d = new Array(t),
|
|
1709
|
+
T = this.Ve ? new Array(t) : undefined,
|
|
1710
|
+
R = this.Ue ? new Array(t) : undefined;
|
|
1711
|
+
for (
|
|
1712
|
+
s = 0, o = Math.min(this.ge, t);
|
|
1713
|
+
s < o && (this.Ce[s] === e[s] || (this.Ve && compare(this.be, this.Ce[s], e[s])));
|
|
1714
|
+
s++
|
|
1715
|
+
) {
|
|
1716
|
+
if (this.Ve) setSignal(this.Ve[s], e[s]);
|
|
1913
1717
|
}
|
|
1914
|
-
for (
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1718
|
+
for (
|
|
1719
|
+
o = this.ge - 1, u = t - 1;
|
|
1720
|
+
o >= s &&
|
|
1721
|
+
u >= s &&
|
|
1722
|
+
(this.Ce[o] === e[u] || (this.Ve && compare(this.be, this.Ce[o], e[u])));
|
|
1723
|
+
o--, u--
|
|
1724
|
+
) {
|
|
1725
|
+
E[u] = this.Pe[o];
|
|
1726
|
+
d[u] = this.we[o];
|
|
1727
|
+
T && (T[u] = this.Ve[o]);
|
|
1728
|
+
R && (R[u] = this.Ue[o]);
|
|
1919
1729
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
for (
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1730
|
+
a = new Map();
|
|
1731
|
+
f = new Array(u + 1);
|
|
1732
|
+
for (i = u; i >= s; i--) {
|
|
1733
|
+
l = e[i];
|
|
1734
|
+
c = this.be ? this.be(l) : l;
|
|
1735
|
+
n = a.get(c);
|
|
1736
|
+
f[i] = n === undefined ? -1 : n;
|
|
1737
|
+
a.set(c, i);
|
|
1928
1738
|
}
|
|
1929
|
-
for (
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
} else
|
|
1941
|
-
this.a[i].dispose();
|
|
1739
|
+
for (n = s; n <= o; n++) {
|
|
1740
|
+
l = this.Ce[n];
|
|
1741
|
+
c = this.be ? this.be(l) : l;
|
|
1742
|
+
i = a.get(c);
|
|
1743
|
+
if (i !== undefined && i !== -1) {
|
|
1744
|
+
E[i] = this.Pe[n];
|
|
1745
|
+
d[i] = this.we[n];
|
|
1746
|
+
T && (T[i] = this.Ve[n]);
|
|
1747
|
+
R && (R[i] = this.Ue[n]);
|
|
1748
|
+
i = f[i];
|
|
1749
|
+
a.set(c, i);
|
|
1750
|
+
} else this.we[n].dispose();
|
|
1942
1751
|
}
|
|
1943
|
-
for (
|
|
1944
|
-
if (
|
|
1945
|
-
this.
|
|
1946
|
-
this.
|
|
1947
|
-
if (
|
|
1948
|
-
this.
|
|
1949
|
-
setSignal(this.
|
|
1752
|
+
for (i = s; i < t; i++) {
|
|
1753
|
+
if (i in E) {
|
|
1754
|
+
this.Pe[i] = E[i];
|
|
1755
|
+
this.we[i] = d[i];
|
|
1756
|
+
if (T) {
|
|
1757
|
+
this.Ve[i] = T[i];
|
|
1758
|
+
setSignal(this.Ve[i], e[i]);
|
|
1950
1759
|
}
|
|
1951
|
-
if (
|
|
1952
|
-
this.
|
|
1953
|
-
setSignal(this.
|
|
1760
|
+
if (R) {
|
|
1761
|
+
this.Ue[i] = R[i];
|
|
1762
|
+
setSignal(this.Ue[i], i);
|
|
1954
1763
|
}
|
|
1955
1764
|
} else {
|
|
1956
|
-
this.
|
|
1765
|
+
this.Pe[i] = runWithOwner((this.we[i] = createOwner()), r);
|
|
1957
1766
|
}
|
|
1958
1767
|
}
|
|
1959
|
-
this.
|
|
1960
|
-
this.
|
|
1768
|
+
this.Pe = this.Pe.slice(0, (this.ge = t));
|
|
1769
|
+
this.Ce = e.slice(0);
|
|
1961
1770
|
}
|
|
1962
1771
|
});
|
|
1963
|
-
return this.
|
|
1772
|
+
return this.Pe;
|
|
1964
1773
|
}
|
|
1965
|
-
function repeat(
|
|
1774
|
+
function repeat(e, t, n) {
|
|
1966
1775
|
return updateRepeat.bind({
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1776
|
+
Ie: createOwner(),
|
|
1777
|
+
ge: 0,
|
|
1778
|
+
ke: 0,
|
|
1779
|
+
ve: e,
|
|
1780
|
+
De: t,
|
|
1781
|
+
we: [],
|
|
1782
|
+
Pe: [],
|
|
1783
|
+
xe: n?.from,
|
|
1784
|
+
me: n?.fallback
|
|
1976
1785
|
});
|
|
1977
1786
|
}
|
|
1978
1787
|
function updateRepeat() {
|
|
1979
|
-
const
|
|
1980
|
-
const
|
|
1981
|
-
runWithOwner(this.
|
|
1982
|
-
if (
|
|
1983
|
-
if (this.
|
|
1984
|
-
this.
|
|
1985
|
-
this.
|
|
1986
|
-
this.
|
|
1987
|
-
this.
|
|
1788
|
+
const e = this.ve();
|
|
1789
|
+
const t = this.xe?.() || 0;
|
|
1790
|
+
runWithOwner(this.Ie, () => {
|
|
1791
|
+
if (e === 0) {
|
|
1792
|
+
if (this.ge !== 0) {
|
|
1793
|
+
this.Ie.dispose(false);
|
|
1794
|
+
this.we = [];
|
|
1795
|
+
this.Pe = [];
|
|
1796
|
+
this.ge = 0;
|
|
1988
1797
|
}
|
|
1989
|
-
if (this.
|
|
1990
|
-
this.
|
|
1991
|
-
this.a[0] = createOwner(),
|
|
1992
|
-
this.Y
|
|
1993
|
-
);
|
|
1798
|
+
if (this.me && !this.Pe[0]) {
|
|
1799
|
+
this.Pe[0] = runWithOwner((this.we[0] = createOwner()), this.me);
|
|
1994
1800
|
}
|
|
1995
1801
|
return;
|
|
1996
1802
|
}
|
|
1997
|
-
const
|
|
1998
|
-
const
|
|
1999
|
-
if (this.
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
this.
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
this.a[i] = this.a[i - difference];
|
|
2015
|
-
this.d[i] = this.d[i - difference];
|
|
2016
|
-
i--;
|
|
1803
|
+
const n = t + e;
|
|
1804
|
+
const i = this.ke + this.ge;
|
|
1805
|
+
if (this.ge === 0 && this.we[0]) this.we[0].dispose();
|
|
1806
|
+
for (let e = n; e < i; e++) this.we[e - this.ke].dispose();
|
|
1807
|
+
if (this.ke < t) {
|
|
1808
|
+
let e = this.ke;
|
|
1809
|
+
while (e < t && e < this.ge) this.we[e++].dispose();
|
|
1810
|
+
this.we.splice(0, t - this.ke);
|
|
1811
|
+
this.Pe.splice(0, t - this.ke);
|
|
1812
|
+
} else if (this.ke > t) {
|
|
1813
|
+
let n = i - this.ke - 1;
|
|
1814
|
+
let r = this.ke - t;
|
|
1815
|
+
this.we.length = this.Pe.length = e;
|
|
1816
|
+
while (n >= r) {
|
|
1817
|
+
this.we[n] = this.we[n - r];
|
|
1818
|
+
this.Pe[n] = this.Pe[n - r];
|
|
1819
|
+
n--;
|
|
2017
1820
|
}
|
|
2018
|
-
for (let
|
|
2019
|
-
this.
|
|
2020
|
-
this.a[i2] = createOwner(),
|
|
2021
|
-
() => this.O(i2 + from)
|
|
2022
|
-
);
|
|
1821
|
+
for (let e = 0; e < r; e++) {
|
|
1822
|
+
this.Pe[e] = runWithOwner((this.we[e] = createOwner()), () => this.De(e + t));
|
|
2023
1823
|
}
|
|
2024
1824
|
}
|
|
2025
|
-
for (let
|
|
2026
|
-
this.
|
|
2027
|
-
this.a[i - from] = createOwner(),
|
|
2028
|
-
() => this.O(i)
|
|
2029
|
-
);
|
|
1825
|
+
for (let e = i; e < n; e++) {
|
|
1826
|
+
this.Pe[e - t] = runWithOwner((this.we[e - t] = createOwner()), () => this.De(e));
|
|
2030
1827
|
}
|
|
2031
|
-
this.
|
|
2032
|
-
this.
|
|
2033
|
-
this.
|
|
1828
|
+
this.Pe = this.Pe.slice(0, e);
|
|
1829
|
+
this.ke = t;
|
|
1830
|
+
this.ge = e;
|
|
2034
1831
|
});
|
|
2035
|
-
return this.
|
|
2036
|
-
}
|
|
2037
|
-
function compare(
|
|
2038
|
-
return
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
if (this.Z & 1 /* Pending */ && !(this.f & 4 /* Uninitialized */)) {
|
|
2049
|
-
flags &= ~1 /* Pending */;
|
|
1832
|
+
return this.Pe;
|
|
1833
|
+
}
|
|
1834
|
+
function compare(e, t, n) {
|
|
1835
|
+
return e ? e(t) === e(n) : true;
|
|
1836
|
+
}
|
|
1837
|
+
function boundaryComputed(e, t) {
|
|
1838
|
+
const n = computed(e, undefined, {
|
|
1839
|
+
_e: {
|
|
1840
|
+
le() {
|
|
1841
|
+
let e = this.J;
|
|
1842
|
+
this.J &= ~this.Ge;
|
|
1843
|
+
if (this.Ge & STATUS_PENDING && !(this.J & STATUS_UNINITIALIZED)) {
|
|
1844
|
+
e &= ~STATUS_PENDING;
|
|
2050
1845
|
}
|
|
2051
|
-
this.
|
|
1846
|
+
this.Re.notify(this, this.Ge, e);
|
|
2052
1847
|
},
|
|
2053
|
-
|
|
1848
|
+
Ge: t
|
|
2054
1849
|
}
|
|
2055
1850
|
});
|
|
2056
|
-
|
|
2057
|
-
return
|
|
2058
|
-
}
|
|
2059
|
-
function createBoundChildren(
|
|
2060
|
-
const
|
|
2061
|
-
|
|
2062
|
-
onCleanup(() =>
|
|
2063
|
-
return runWithOwner(
|
|
2064
|
-
const
|
|
2065
|
-
return boundaryComputed(() => staleValues(() => flatten(read(
|
|
1851
|
+
n.Ge = t;
|
|
1852
|
+
return n;
|
|
1853
|
+
}
|
|
1854
|
+
function createBoundChildren(e, t, n, i) {
|
|
1855
|
+
const r = e.Re;
|
|
1856
|
+
r.addChild((e.Re = n));
|
|
1857
|
+
onCleanup(() => r.removeChild(e.Re));
|
|
1858
|
+
return runWithOwner(e, () => {
|
|
1859
|
+
const e = computed(t);
|
|
1860
|
+
return boundaryComputed(() => staleValues(() => flatten(read(e))), i);
|
|
2066
1861
|
});
|
|
2067
1862
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
constructor(
|
|
1863
|
+
class ConditionalQueue extends Queue {
|
|
1864
|
+
He;
|
|
1865
|
+
Qe = new Set();
|
|
1866
|
+
$ = new Set();
|
|
1867
|
+
constructor(e) {
|
|
2073
1868
|
super();
|
|
2074
|
-
this.
|
|
2075
|
-
}
|
|
2076
|
-
run(
|
|
2077
|
-
if (!
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
} else if (this.h.delete(node))
|
|
2088
|
-
type &= ~1 /* Pending */;
|
|
1869
|
+
this.He = e;
|
|
1870
|
+
}
|
|
1871
|
+
run(e) {
|
|
1872
|
+
if (!e || read(this.He)) return;
|
|
1873
|
+
return super.run(e);
|
|
1874
|
+
}
|
|
1875
|
+
notify(e, t, n) {
|
|
1876
|
+
if (read(this.He)) {
|
|
1877
|
+
if (t & STATUS_PENDING) {
|
|
1878
|
+
if (n & STATUS_PENDING) {
|
|
1879
|
+
this.$.add(e);
|
|
1880
|
+
t &= ~STATUS_PENDING;
|
|
1881
|
+
} else if (this.$.delete(e)) t &= ~STATUS_PENDING;
|
|
2089
1882
|
}
|
|
2090
|
-
if (
|
|
2091
|
-
if (
|
|
2092
|
-
this.
|
|
2093
|
-
|
|
2094
|
-
} else if (this.
|
|
2095
|
-
type &= ~2 /* Error */;
|
|
1883
|
+
if (t & STATUS_ERROR) {
|
|
1884
|
+
if (n & STATUS_ERROR) {
|
|
1885
|
+
this.Qe.add(e);
|
|
1886
|
+
t &= ~STATUS_ERROR;
|
|
1887
|
+
} else if (this.Qe.delete(e)) t &= ~STATUS_ERROR;
|
|
2096
1888
|
}
|
|
2097
1889
|
}
|
|
2098
|
-
return
|
|
1890
|
+
return t ? super.notify(e, t, n) : true;
|
|
2099
1891
|
}
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
constructor(
|
|
1892
|
+
}
|
|
1893
|
+
class CollectionQueue extends Queue {
|
|
1894
|
+
$e;
|
|
1895
|
+
we = new Set();
|
|
1896
|
+
He = signal(false, { pureWrite: true });
|
|
1897
|
+
Le = false;
|
|
1898
|
+
constructor(e) {
|
|
2107
1899
|
super();
|
|
2108
|
-
this
|
|
2109
|
-
}
|
|
2110
|
-
run(
|
|
2111
|
-
if (!
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
if (
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
const
|
|
2134
|
-
const
|
|
1900
|
+
this.$e = e;
|
|
1901
|
+
}
|
|
1902
|
+
run(e) {
|
|
1903
|
+
if (!e || read(this.He)) return;
|
|
1904
|
+
return super.run(e);
|
|
1905
|
+
}
|
|
1906
|
+
notify(e, t, n) {
|
|
1907
|
+
if (!(t & this.$e) || (this.$e & STATUS_PENDING && this.Le)) return super.notify(e, t, n);
|
|
1908
|
+
if (n & this.$e) {
|
|
1909
|
+
this.we.add(e);
|
|
1910
|
+
if (this.we.size === 1) setSignal(this.He, true);
|
|
1911
|
+
} else if (this.we.size > 0) {
|
|
1912
|
+
this.we.delete(e);
|
|
1913
|
+
if (this.we.size === 0) setSignal(this.He, false);
|
|
1914
|
+
}
|
|
1915
|
+
t &= ~this.$e;
|
|
1916
|
+
return t ? super.notify(e, t, n) : true;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
var BoundaryMode;
|
|
1920
|
+
(function (e) {
|
|
1921
|
+
e["VISIBLE"] = "visible";
|
|
1922
|
+
e["HIDDEN"] = "hidden";
|
|
1923
|
+
})(BoundaryMode || (BoundaryMode = {}));
|
|
1924
|
+
function createBoundary(e, t) {
|
|
1925
|
+
const n = createOwner();
|
|
1926
|
+
const i = new ConditionalQueue(computed(() => t() === BoundaryMode.HIDDEN));
|
|
1927
|
+
const r = createBoundChildren(n, e, i, 0);
|
|
2135
1928
|
computed(() => {
|
|
2136
|
-
const
|
|
2137
|
-
|
|
2138
|
-
if (!
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
);
|
|
2142
|
-
|
|
2143
|
-
queue.h.clear();
|
|
2144
|
-
queue.ha.clear();
|
|
1929
|
+
const e = read(i.He);
|
|
1930
|
+
r.Ge = e ? STATUS_ERROR | STATUS_PENDING : 0;
|
|
1931
|
+
if (!e) {
|
|
1932
|
+
i.$.forEach(e => i.notify(e, STATUS_PENDING, STATUS_PENDING));
|
|
1933
|
+
i.Qe.forEach(e => i.notify(e, STATUS_ERROR, STATUS_ERROR));
|
|
1934
|
+
i.$.clear();
|
|
1935
|
+
i.Qe.clear();
|
|
2145
1936
|
}
|
|
2146
1937
|
});
|
|
2147
|
-
return () => read(
|
|
2148
|
-
}
|
|
2149
|
-
function createCollectionBoundary(
|
|
2150
|
-
const
|
|
2151
|
-
const
|
|
2152
|
-
const
|
|
2153
|
-
const
|
|
2154
|
-
if (!read(
|
|
2155
|
-
const
|
|
2156
|
-
if (!untrack(() => read(
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
return fallback(queue);
|
|
1938
|
+
return () => (read(i.He) ? undefined : read(r));
|
|
1939
|
+
}
|
|
1940
|
+
function createCollectionBoundary(e, t, n) {
|
|
1941
|
+
const i = createOwner();
|
|
1942
|
+
const r = new CollectionQueue(e);
|
|
1943
|
+
const s = createBoundChildren(i, t, r, e);
|
|
1944
|
+
const o = computed(() => {
|
|
1945
|
+
if (!read(r.He)) {
|
|
1946
|
+
const e = read(s);
|
|
1947
|
+
if (!untrack(() => read(r.He))) r.Le = true;
|
|
1948
|
+
return e;
|
|
1949
|
+
}
|
|
1950
|
+
return n(r);
|
|
2161
1951
|
});
|
|
2162
|
-
return read.bind(null,
|
|
2163
|
-
}
|
|
2164
|
-
function createLoadBoundary(
|
|
2165
|
-
return createCollectionBoundary(
|
|
2166
|
-
}
|
|
2167
|
-
function
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
1952
|
+
return read.bind(null, o);
|
|
1953
|
+
}
|
|
1954
|
+
function createLoadBoundary(e, t) {
|
|
1955
|
+
return createCollectionBoundary(STATUS_PENDING, e, () => t());
|
|
1956
|
+
}
|
|
1957
|
+
function collectErrorSources(e, t) {
|
|
1958
|
+
let n = true;
|
|
1959
|
+
let i = e.D;
|
|
1960
|
+
while (i !== null) {
|
|
1961
|
+
const e = i.V;
|
|
1962
|
+
if (e.D && e.J & STATUS_ERROR) {
|
|
1963
|
+
n = false;
|
|
1964
|
+
collectErrorSources(e, t);
|
|
1965
|
+
}
|
|
1966
|
+
i = i.P;
|
|
1967
|
+
}
|
|
1968
|
+
n && t.push(e);
|
|
1969
|
+
}
|
|
1970
|
+
function createErrorBoundary(e, t) {
|
|
1971
|
+
return createCollectionBoundary(STATUS_ERROR, e, e => {
|
|
1972
|
+
let n = e.we.values().next().value;
|
|
1973
|
+
return t(n.Y, () => {
|
|
1974
|
+
const t = [];
|
|
1975
|
+
for (const n of e.we) collectErrorSources(n, t);
|
|
1976
|
+
for (const e of t) recompute(e);
|
|
1977
|
+
schedule();
|
|
2174
1978
|
});
|
|
2175
1979
|
});
|
|
2176
1980
|
}
|
|
2177
|
-
function flatten(
|
|
2178
|
-
if (typeof
|
|
2179
|
-
if (
|
|
2180
|
-
return children;
|
|
1981
|
+
function flatten(e, t) {
|
|
1982
|
+
if (typeof e === "function" && !e.length) {
|
|
1983
|
+
if (t?.doNotUnwrap) return e;
|
|
2181
1984
|
do {
|
|
2182
|
-
|
|
2183
|
-
} while (typeof
|
|
1985
|
+
e = e();
|
|
1986
|
+
} while (typeof e === "function" && !e.length);
|
|
2184
1987
|
}
|
|
2185
|
-
if (
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
if (flattenArray(children, results, options)) {
|
|
1988
|
+
if (t?.skipNonRendered && (e == null || e === true || e === false || e === "")) return;
|
|
1989
|
+
if (Array.isArray(e)) {
|
|
1990
|
+
let n = [];
|
|
1991
|
+
if (flattenArray(e, n, t)) {
|
|
2190
1992
|
return () => {
|
|
2191
|
-
let
|
|
2192
|
-
flattenArray(
|
|
2193
|
-
return
|
|
1993
|
+
let e = [];
|
|
1994
|
+
flattenArray(n, e, { ...t, doNotUnwrap: false });
|
|
1995
|
+
return e;
|
|
2194
1996
|
};
|
|
2195
1997
|
}
|
|
2196
|
-
return
|
|
1998
|
+
return n;
|
|
2197
1999
|
}
|
|
2198
|
-
return
|
|
2000
|
+
return e;
|
|
2199
2001
|
}
|
|
2200
|
-
function flattenArray(
|
|
2201
|
-
let
|
|
2202
|
-
let
|
|
2203
|
-
for (let
|
|
2002
|
+
function flattenArray(e, t = [], n) {
|
|
2003
|
+
let i = null;
|
|
2004
|
+
let r = false;
|
|
2005
|
+
for (let s = 0; s < e.length; s++) {
|
|
2204
2006
|
try {
|
|
2205
|
-
let
|
|
2206
|
-
if (typeof
|
|
2207
|
-
if (
|
|
2208
|
-
|
|
2209
|
-
|
|
2007
|
+
let i = e[s];
|
|
2008
|
+
if (typeof i === "function" && !i.length) {
|
|
2009
|
+
if (n?.doNotUnwrap) {
|
|
2010
|
+
t.push(i);
|
|
2011
|
+
r = true;
|
|
2210
2012
|
continue;
|
|
2211
2013
|
}
|
|
2212
2014
|
do {
|
|
2213
|
-
|
|
2214
|
-
} while (typeof
|
|
2015
|
+
i = i();
|
|
2016
|
+
} while (typeof i === "function" && !i.length);
|
|
2215
2017
|
}
|
|
2216
|
-
if (Array.isArray(
|
|
2217
|
-
|
|
2218
|
-
} else if (
|
|
2219
|
-
} else
|
|
2220
|
-
results.push(child);
|
|
2018
|
+
if (Array.isArray(i)) {
|
|
2019
|
+
r = flattenArray(i, t, n);
|
|
2020
|
+
} else if (n?.skipNonRendered && (i == null || i === true || i === false || i === "")) {
|
|
2021
|
+
} else t.push(i);
|
|
2221
2022
|
} catch (e) {
|
|
2222
|
-
if (!(e instanceof NotReadyError))
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2023
|
+
if (!(e instanceof NotReadyError)) throw e;
|
|
2024
|
+
i = e;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
if (i) throw i;
|
|
2028
|
+
return r;
|
|
2029
|
+
}
|
|
2030
|
+
export {
|
|
2031
|
+
$PROXY,
|
|
2032
|
+
$TARGET,
|
|
2033
|
+
$TRACK,
|
|
2034
|
+
ContextNotFoundError,
|
|
2035
|
+
NoOwnerError,
|
|
2036
|
+
NotReadyError,
|
|
2037
|
+
SUPPORTS_PROXY,
|
|
2038
|
+
createAsync,
|
|
2039
|
+
createBoundary,
|
|
2040
|
+
createContext,
|
|
2041
|
+
createEffect,
|
|
2042
|
+
createErrorBoundary,
|
|
2043
|
+
createLoadBoundary,
|
|
2044
|
+
createMemo,
|
|
2045
|
+
createOptimistic,
|
|
2046
|
+
createOptimisticStore,
|
|
2047
|
+
createProjection,
|
|
2048
|
+
createReaction,
|
|
2049
|
+
createRenderEffect,
|
|
2050
|
+
createRoot,
|
|
2051
|
+
createSignal,
|
|
2052
|
+
createStore,
|
|
2053
|
+
createTrackedEffect,
|
|
2054
|
+
deep,
|
|
2055
|
+
flatten,
|
|
2056
|
+
flush,
|
|
2057
|
+
getContext,
|
|
2058
|
+
getNextChildId,
|
|
2059
|
+
getObserver,
|
|
2060
|
+
getOwner,
|
|
2061
|
+
isEqual,
|
|
2062
|
+
isPending,
|
|
2063
|
+
isWrappable,
|
|
2064
|
+
mapArray,
|
|
2065
|
+
merge,
|
|
2066
|
+
omit,
|
|
2067
|
+
onCleanup,
|
|
2068
|
+
onSettled,
|
|
2069
|
+
pending,
|
|
2070
|
+
reconcile,
|
|
2071
|
+
repeat,
|
|
2072
|
+
resolve,
|
|
2073
|
+
runWithOwner,
|
|
2074
|
+
setContext,
|
|
2075
|
+
snapshot,
|
|
2076
|
+
untrack
|
|
2077
|
+
};
|