@genome-spy/app 0.86.0 → 0.88.0
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/{agentApi-DgopQbMV.js → agentApi-BYFBKiRQ.js} +8170 -7390
- package/dist/agentApi.es.js +3945 -3862
- package/dist/agentShared.es.js +7 -7
- package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-BVQ7-2eJ.js} +141 -140
- package/dist/{canvas2d-8uxuN_vx.js → canvas2d-D7SZK3xv.js} +117 -116
- package/dist/clipOptions-BWHr3aTa.js +2675 -0
- package/dist/{clipOptions-BQfNhxgP.js → clipOptions-DTMcB_9z.js} +1147 -731
- package/dist/{debug-D_VtWQ6l.js → debug-CVpoEOWx.js} +2 -2
- package/dist/{debug-Bzc3SoRg.js → debug-DYAMZZKl.js} +2 -2
- package/dist/index.es.js +3398 -3428
- package/dist/index.js +441 -411
- package/dist/{indexer-qy_dq5l5.js → indexer-CXjZDo2Q.js} +1 -1
- package/dist/{indexer-qiFctgR3.js → indexer-DAH_ruVn.js} +1 -1
- package/dist/{nativeText-vT3AWE14.js → order-C5CzA37O.js} +144 -86
- package/dist/{nativeText-DFV5XIx8.js → order-DvY7KNcu.js} +133 -75
- package/dist/{rasterExport-B8pVoOsj.js → rasterExport-BgZ98e6U.js} +1 -1
- package/dist/{rasterExport-C4r4xjQT.js → rasterExport-DEr8fOLm.js} +1 -1
- package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-DtcJjqpB.js} +109 -96
- package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-DxturTEW.js} +108 -95
- package/dist/schema.json +10839 -2862
- package/dist/{svg-C-Sw6E6G.js → svg-CyrLfa9e.js} +389 -428
- package/dist/{svg-CKHwwKRt.js → svg-SDJMzL--.js} +389 -428
- package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-f7DJ3UO0.js} +1 -1
- package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-mWK7HTkx.js} +1 -1
- package/dist/{vega-scale-D46-iCaL.js → vega-scale-CypF85iS.js} +894 -1191
- package/dist/{vega-scale-CK0_al6O.js → vega-scale-DLKCwWRs.js} +893 -1190
- package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-DIDo44XQ.js} +1 -1
- package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-Dl-vMN9I.js} +1 -1
- package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-CymbZyE6.js} +692 -459
- package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DNiDip5e.js} +667 -434
- package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-BrJLIj2o.js} +3032 -2332
- package/dist/{webgl-BaA3jSa2.js → webgl-CqTDifWM.js} +1087 -1056
- package/dist/{webgl-FP-4EsBL.js → webgl-jaC2m0Zr.js} +1113 -1082
- package/package.json +5 -5
- package/src/embedTypes.d.ts +1 -1
- package/dist/clipOptions-taFzEljc.js +0 -2259
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as e, Dt as t, Ot as n, Pt as r, b as i, ct as a, dn as o, fn as s, jt as c, k as l, o as u, sn as d, st as f, t as p, u as m, un as h, vn as ee } from "./clipOptions-DTMcB_9z.js";
|
|
2
2
|
import { a as g, n as te, r as ne, t as _ } from "./viewError-BiR9VCgL.js";
|
|
3
|
-
import { U as re,
|
|
3
|
+
import { U as re, m as ie, rt as ae, y as v } from "./vega-scale-DLKCwWRs.js";
|
|
4
|
+
import { t as oe } from "./warning-CpIIpk8e.js";
|
|
4
5
|
//#region ../core/src/view/layout/flexLayout.js
|
|
5
|
-
function
|
|
6
|
+
function se(e, t, { spacing: n, devicePixelRatio: r, offset: i, reverse: a } = {}) {
|
|
6
7
|
n ||= 0, i ||= 0;
|
|
7
8
|
let o = he(e, t, n), s = 0, c = 0;
|
|
8
|
-
for (let t = 0; t < e.length; t++) s += o[t],
|
|
9
|
+
for (let t = 0; t < e.length; t++) s += o[t], S(e[t]) || c++;
|
|
9
10
|
let l = s + Math.max(0, c - 1) * n, u = r === void 0 ? (e) => e : (e) => Math.round(e * r) / r, d = 0, f = [], p = (e) => {
|
|
10
11
|
let t = d;
|
|
11
12
|
if (!t) return;
|
|
@@ -17,13 +18,13 @@ function oe(e, t, { spacing: n, devicePixelRatio: r, offset: i, reverse: a } = {
|
|
|
17
18
|
});
|
|
18
19
|
m += r, d = 0;
|
|
19
20
|
}, m = a ? Math.max(t, l) : 0 + i;
|
|
20
|
-
if (e.length == 1 &&
|
|
21
|
+
if (e.length == 1 && S(e[0])) return [{
|
|
21
22
|
location: m,
|
|
22
23
|
size: 0
|
|
23
24
|
}];
|
|
24
25
|
for (let t = 0; t < e.length; t++) {
|
|
25
26
|
let r = e[t];
|
|
26
|
-
if (
|
|
27
|
+
if (S(r)) d++;
|
|
27
28
|
else {
|
|
28
29
|
p(f.length > 0);
|
|
29
30
|
let e = o[t];
|
|
@@ -35,34 +36,34 @@ function oe(e, t, { spacing: n, devicePixelRatio: r, offset: i, reverse: a } = {
|
|
|
35
36
|
}
|
|
36
37
|
return m += a ? n : -n, p(!1), f;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function ce(e, { spacing: t } = { spacing: 0 }) {
|
|
39
40
|
let n = 0;
|
|
40
|
-
for (let r of e) n +=
|
|
41
|
+
for (let r of e) n += T(r) + (S(r) ? 0 : t);
|
|
41
42
|
return Math.max(0, n - t);
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function le(e, t, { spacing: n = 0 } = {}) {
|
|
44
45
|
let r = [], i = [], a = 0, o = 0;
|
|
45
46
|
for (let [s, c] of e.entries()) {
|
|
46
|
-
let e =
|
|
47
|
+
let e = T(c), l = !S(c), u = o && l ? n : 0;
|
|
47
48
|
i.length && a + u + e > t && (r.push(i), i = [], a = 0, o = 0), i.push(s), a += (o && l ? n : 0) + e, o += +!!l;
|
|
48
49
|
}
|
|
49
50
|
return i.length && r.push(i), r;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function ue(e) {
|
|
52
53
|
let t = 0, n = 0, r = 0, i, a = !0;
|
|
53
54
|
for (let o of e) {
|
|
54
|
-
t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r,
|
|
55
|
-
let e =
|
|
55
|
+
t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r, T(o));
|
|
56
|
+
let e = E(o);
|
|
56
57
|
e === void 0 ? a = !1 : i = i === void 0 ? e : Math.max(i, e);
|
|
57
58
|
}
|
|
58
|
-
return
|
|
59
|
+
return O({
|
|
59
60
|
px: t,
|
|
60
61
|
grow: n,
|
|
61
62
|
minPx: r,
|
|
62
63
|
maxPx: a ? i : void 0
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function de(e) {
|
|
66
67
|
let t = {
|
|
67
68
|
px: 0,
|
|
68
69
|
grow: 0,
|
|
@@ -70,11 +71,11 @@ function ue(e) {
|
|
|
70
71
|
maxPx: 0
|
|
71
72
|
}, n = !0;
|
|
72
73
|
for (let r of e) {
|
|
73
|
-
t.px +=
|
|
74
|
-
let e =
|
|
74
|
+
t.px += C(r.px), t.grow += C(r.grow), t.minPx += T(r);
|
|
75
|
+
let e = E(r);
|
|
75
76
|
e === void 0 ? n = !1 : t.maxPx += e;
|
|
76
77
|
}
|
|
77
|
-
return n || delete t.maxPx,
|
|
78
|
+
return n || delete t.maxPx, O(t);
|
|
78
79
|
}
|
|
79
80
|
var y = class e {
|
|
80
81
|
constructor(e, t) {
|
|
@@ -87,7 +88,7 @@ var y = class e {
|
|
|
87
88
|
return this.#e(-e.width, -e.height);
|
|
88
89
|
}
|
|
89
90
|
#e(t, n) {
|
|
90
|
-
return new e(
|
|
91
|
+
return new e(D(this.width, t), D(this.height, n));
|
|
91
92
|
}
|
|
92
93
|
isGrowing() {
|
|
93
94
|
return !!(this.width.grow || this.height.grow);
|
|
@@ -95,23 +96,23 @@ var y = class e {
|
|
|
95
96
|
}, b = Object.freeze({
|
|
96
97
|
px: 0,
|
|
97
98
|
grow: 0
|
|
98
|
-
}),
|
|
99
|
-
function
|
|
99
|
+
}), x = new y(b, b);
|
|
100
|
+
function S(e) {
|
|
100
101
|
return !e.px && !e.grow && !e.minPx;
|
|
101
102
|
}
|
|
102
103
|
function fe(e, t) {
|
|
103
104
|
return !e || !t ? !1 : e.px === t.px && e.grow === t.grow && e.minPx === t.minPx && e.maxPx === t.maxPx;
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function C(e) {
|
|
106
107
|
return e || 0;
|
|
107
108
|
}
|
|
108
109
|
function pe(e) {
|
|
109
|
-
return e && (
|
|
110
|
+
return e && (h(e.px) || h(e.grow) || h(e.minPx) || h(e.maxPx));
|
|
110
111
|
}
|
|
111
112
|
function me(e) {
|
|
112
|
-
if (
|
|
113
|
-
if (pe(e)) return _e(e),
|
|
114
|
-
if (
|
|
113
|
+
if (J(e)) throw Error("parseSizeDef does not accept step-based sizes.");
|
|
114
|
+
if (pe(e)) return _e(e), O(e);
|
|
115
|
+
if (h(e)) return {
|
|
115
116
|
px: e,
|
|
116
117
|
grow: 0
|
|
117
118
|
};
|
|
@@ -123,26 +124,26 @@ function me(e) {
|
|
|
123
124
|
}
|
|
124
125
|
function he(e, t, n) {
|
|
125
126
|
let r = !1;
|
|
126
|
-
for (let t of e) _e(t), r ||=
|
|
127
|
+
for (let t of e) _e(t), r ||= ve(t);
|
|
127
128
|
if (!r) return ge(e, t, n);
|
|
128
129
|
let i = Array(e.length).fill(0), a = [];
|
|
129
|
-
for (let t = 0; t < e.length; t++)
|
|
130
|
+
for (let t = 0; t < e.length; t++) S(e[t]) || a.push(t);
|
|
130
131
|
let o = Math.max(0, a.length - 1) * n, s = Math.max(0, t - o), c = /* @__PURE__ */ new Set();
|
|
131
132
|
for (let t of a) {
|
|
132
133
|
let n = e[t];
|
|
133
|
-
|
|
134
|
+
C(n.grow) || (i[t] = w(C(n.px), n), c.add(t));
|
|
134
135
|
}
|
|
135
136
|
for (;;) {
|
|
136
137
|
let t = 0, n = 0, r = 0;
|
|
137
|
-
for (let o of a) c.has(o) ? r += i[o] : (t +=
|
|
138
|
+
for (let o of a) c.has(o) ? r += i[o] : (t += C(e[o].px), n += C(e[o].grow));
|
|
138
139
|
if (!n) {
|
|
139
|
-
for (let t of a) c.has(t) || (i[t] = C(
|
|
140
|
+
for (let t of a) c.has(t) || (i[t] = w(C(e[t].px), e[t]), c.add(t));
|
|
140
141
|
break;
|
|
141
142
|
}
|
|
142
143
|
let o = Math.max(0, s - r - t), l = 0, u = [], d = [];
|
|
143
144
|
for (let t of a) {
|
|
144
145
|
if (c.has(t)) continue;
|
|
145
|
-
let r = e[t], a =
|
|
146
|
+
let r = e[t], a = C(r.px) + C(r.grow) / n * o, s = w(a, r);
|
|
146
147
|
i[t] = s;
|
|
147
148
|
let f = s - a;
|
|
148
149
|
l += f, f > 0 ? u.push(t) : f < 0 && d.push(t);
|
|
@@ -156,45 +157,45 @@ function he(e, t, n) {
|
|
|
156
157
|
}
|
|
157
158
|
function ge(e, t, n) {
|
|
158
159
|
let r = 0, i = 0;
|
|
159
|
-
for (let t of e) r +=
|
|
160
|
+
for (let t of e) r += C(t.px) + (S(t) ? 0 : n), i += C(t.grow);
|
|
160
161
|
r -= n;
|
|
161
162
|
let a = Math.max(0, t - r), o = Array(e.length);
|
|
162
163
|
for (let t = 0; t < e.length; t++) {
|
|
163
164
|
let n = e[t];
|
|
164
|
-
o[t] =
|
|
165
|
+
o[t] = S(n) ? 0 : C(n.px) + (i ? C(n.grow) / i * a : 0);
|
|
165
166
|
}
|
|
166
167
|
return o;
|
|
167
168
|
}
|
|
168
169
|
function _e(e) {
|
|
169
170
|
if (e.minPx !== void 0 && e.maxPx !== void 0 && e.minPx > e.maxPx) throw Error("SizeDef minPx cannot be greater than maxPx.");
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function w(e, t) {
|
|
172
173
|
return Math.min(Math.max(e, t.minPx ?? 0), t.maxPx ?? Infinity);
|
|
173
174
|
}
|
|
174
|
-
function w(e) {
|
|
175
|
-
return C(S(e.px), e);
|
|
176
|
-
}
|
|
177
175
|
function T(e) {
|
|
178
|
-
return
|
|
176
|
+
return w(C(e.px), e);
|
|
179
177
|
}
|
|
180
178
|
function E(e) {
|
|
179
|
+
return e.maxPx ?? (C(e.grow) ? void 0 : T(e));
|
|
180
|
+
}
|
|
181
|
+
function ve(e) {
|
|
181
182
|
return e.minPx !== void 0 || e.maxPx !== void 0;
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
return
|
|
184
|
+
function D(e, t) {
|
|
185
|
+
return O({
|
|
185
186
|
px: (e.px ?? 0) + t,
|
|
186
187
|
grow: e.grow,
|
|
187
188
|
minPx: e.minPx === void 0 ? void 0 : Math.max(0, e.minPx + t),
|
|
188
189
|
maxPx: e.maxPx === void 0 ? void 0 : Math.max(0, e.maxPx + t)
|
|
189
190
|
});
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i =
|
|
193
|
-
return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx >
|
|
192
|
+
function O(e) {
|
|
193
|
+
let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = ve(e);
|
|
194
|
+
return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > C(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (C(t.grow) || e.maxPx < C(e.px)) && (t.maxPx = e.maxPx), t;
|
|
194
195
|
}
|
|
195
196
|
//#endregion
|
|
196
197
|
//#region ../core/src/view/layout/padding.js
|
|
197
|
-
var
|
|
198
|
+
var k = class e {
|
|
198
199
|
constructor(e, t, n, r) {
|
|
199
200
|
this.top = e || 0, this.right = t || 0, this.bottom = n || 0, this.left = r || 0;
|
|
200
201
|
}
|
|
@@ -229,35 +230,35 @@ var O = class e {
|
|
|
229
230
|
return this.top + this.bottom;
|
|
230
231
|
}
|
|
231
232
|
static createFromConfig(e) {
|
|
232
|
-
return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) :
|
|
233
|
+
return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : A;
|
|
233
234
|
}
|
|
234
235
|
static createFromRecord(t) {
|
|
235
236
|
return new e(t.top, t.right, t.bottom, t.left);
|
|
236
237
|
}
|
|
237
238
|
static zero() {
|
|
238
|
-
return
|
|
239
|
+
return A;
|
|
239
240
|
}
|
|
240
241
|
static createUniformPadding(t) {
|
|
241
242
|
return new e(t, t, t, t);
|
|
242
243
|
}
|
|
243
244
|
};
|
|
244
245
|
function ye(e, t) {
|
|
245
|
-
return t ? new
|
|
246
|
+
return t ? new k(t.top === !1 ? 0 : e.top, t.right === !1 ? 0 : e.right, t.bottom === !1 ? 0 : e.bottom, t.left === !1 ? 0 : e.left) : e;
|
|
246
247
|
}
|
|
247
|
-
var
|
|
248
|
-
Object.freeze(
|
|
248
|
+
var A = k.createUniformPadding(0);
|
|
249
|
+
Object.freeze(A);
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region ../core/src/utils/url.js
|
|
251
252
|
var be = /^([A-Za-z]+:)?\/\//;
|
|
252
|
-
function
|
|
253
|
+
function j(e, t) {
|
|
253
254
|
if (t && be.test(t)) return t;
|
|
254
255
|
let n = typeof e == "function" ? e() : e;
|
|
255
256
|
if (!n) return t;
|
|
256
257
|
if (!t) return n;
|
|
257
258
|
if (/[#?]/.test(n)) throw Error(`Cannot append to a url with query or hash. Append: ${t}, base: ${n}`);
|
|
258
|
-
return
|
|
259
|
+
return M(n) + t;
|
|
259
260
|
}
|
|
260
|
-
function xe(e, t, n =
|
|
261
|
+
function xe(e, t, n = Se()) {
|
|
261
262
|
let r = typeof e == "function" ? e() : e;
|
|
262
263
|
if (!t) return r;
|
|
263
264
|
try {
|
|
@@ -266,19 +267,19 @@ function xe(e, t, n = Ce()) {
|
|
|
266
267
|
return new URL(t, e).href;
|
|
267
268
|
} else if (n) return new URL(t, n).href;
|
|
268
269
|
} catch {}
|
|
269
|
-
return
|
|
270
|
+
return j(r, t);
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
+
function M(e) {
|
|
272
273
|
let t = e.replace(/[^/]*$/, "");
|
|
273
274
|
return t === "" ? void 0 : t.endsWith("://") ? e + "/" : t;
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function Se() {
|
|
276
277
|
if (typeof document < "u" && document.baseURI) return document.baseURI;
|
|
277
278
|
if (typeof window < "u" && window.location?.href) return window.location.href;
|
|
278
279
|
}
|
|
279
280
|
//#endregion
|
|
280
281
|
//#region ../../node_modules/flatqueue/index.js
|
|
281
|
-
var
|
|
282
|
+
var N = class {
|
|
282
283
|
constructor(e = Infinity, t = Float64Array, n = Uint32Array) {
|
|
283
284
|
let r = e !== Infinity;
|
|
284
285
|
this.ids = r ? new n(e) : [], this.values = r ? new t(e) : [], this.capacity = e, this.length = 0;
|
|
@@ -319,13 +320,11 @@ var j = class {
|
|
|
319
320
|
shrink() {
|
|
320
321
|
Array.isArray(this.ids) && (this.ids.length = this.length), Array.isArray(this.values) && (this.values.length = this.length);
|
|
321
322
|
}
|
|
322
|
-
},
|
|
323
|
-
function
|
|
324
|
-
return e ? (t, n) =>
|
|
325
|
-
e.addDisposer(t, n);
|
|
326
|
-
} : () => void 0;
|
|
323
|
+
}, P = Symbol("runtimeNode"), F = 1e6;
|
|
324
|
+
function Ce(e) {
|
|
325
|
+
return e ? (t, n) => e.addDisposer(t, n) : () => () => void 0;
|
|
327
326
|
}
|
|
328
|
-
function
|
|
327
|
+
function I(e, t) {
|
|
329
328
|
let n = {
|
|
330
329
|
id: e.id,
|
|
331
330
|
name: e.name,
|
|
@@ -339,7 +338,7 @@ function Te(e, t) {
|
|
|
339
338
|
};
|
|
340
339
|
}
|
|
341
340
|
};
|
|
342
|
-
return Object.defineProperty(n,
|
|
341
|
+
return Object.defineProperty(n, P, {
|
|
343
342
|
enumerable: !1,
|
|
344
343
|
configurable: !1,
|
|
345
344
|
writable: !1,
|
|
@@ -348,31 +347,37 @@ function Te(e, t) {
|
|
|
348
347
|
t(e);
|
|
349
348
|
} }) : n;
|
|
350
349
|
}
|
|
351
|
-
function
|
|
352
|
-
let t = e[
|
|
350
|
+
function we(e) {
|
|
351
|
+
let t = e[P];
|
|
353
352
|
if (!t) throw Error("ParamRef is not bound to this graph runtime. Expected runtime-created ref.");
|
|
354
353
|
return t;
|
|
355
354
|
}
|
|
356
|
-
function
|
|
357
|
-
return typeof e.rank == "number" ? e.rank :
|
|
355
|
+
function Te(e) {
|
|
356
|
+
return typeof e.rank == "number" ? e.rank : we(e).rank;
|
|
358
357
|
}
|
|
359
|
-
function
|
|
358
|
+
function Ee(e) {
|
|
360
359
|
for (let t of e) t();
|
|
361
360
|
}
|
|
362
|
-
var
|
|
361
|
+
var De = class {
|
|
363
362
|
#e = 1;
|
|
364
363
|
#t = 1;
|
|
365
364
|
#n = 0;
|
|
366
|
-
#r =
|
|
365
|
+
#r = 0;
|
|
367
366
|
#i = !1;
|
|
368
|
-
#a =
|
|
369
|
-
#o =
|
|
370
|
-
#s =
|
|
371
|
-
#c =
|
|
372
|
-
#l = /* @__PURE__ */ new
|
|
373
|
-
#u;
|
|
367
|
+
#a = !1;
|
|
368
|
+
#o = !1;
|
|
369
|
+
#s = 0;
|
|
370
|
+
#c = !1;
|
|
371
|
+
#l = /* @__PURE__ */ new Map();
|
|
372
|
+
#u = /* @__PURE__ */ new Map();
|
|
373
|
+
#d = /* @__PURE__ */ new Set();
|
|
374
|
+
#f = /* @__PURE__ */ new Set();
|
|
375
|
+
#p = new N();
|
|
376
|
+
#m = new N();
|
|
377
|
+
#h = /* @__PURE__ */ new Set();
|
|
378
|
+
#g;
|
|
374
379
|
constructor(e = {}) {
|
|
375
|
-
this.#
|
|
380
|
+
this.#g = Ce(e.lifecycleRegistry);
|
|
376
381
|
}
|
|
377
382
|
createWritable(e, t, n, r, i = {}) {
|
|
378
383
|
let a = "n" + this.#e++, o = i.notify ?? !0, s = {
|
|
@@ -388,121 +393,219 @@ var ke = class {
|
|
|
388
393
|
s.listeners.delete(e);
|
|
389
394
|
};
|
|
390
395
|
}
|
|
391
|
-
}
|
|
392
|
-
return this.#u(e, () => {
|
|
393
|
-
s.disposed = !0, s.listeners.clear();
|
|
394
|
-
}), Te(s, (e) => {
|
|
396
|
+
}, c = (e) => {
|
|
395
397
|
if (s.disposed) throw Error("Cannot set disposed parameter \"" + t + "\" (" + a + ").");
|
|
396
|
-
e !== s.value && (s.value = e, o &&
|
|
397
|
-
})
|
|
398
|
+
e !== s.value && (s.value = e, o && this.#v(s.listeners));
|
|
399
|
+
}, l = () => {
|
|
400
|
+
s.disposed = !0, s.listeners.clear(), u();
|
|
401
|
+
}, u = this.#g(e, l);
|
|
402
|
+
return Object.assign(I(s, c), { dispose: l });
|
|
398
403
|
}
|
|
399
|
-
computed(e, t, n, r) {
|
|
400
|
-
|
|
404
|
+
computed(e, t, n, r, i = {}) {
|
|
405
|
+
return this.#_(e, t, n, r, i);
|
|
406
|
+
}
|
|
407
|
+
operation(e, t, n, r, i, a = {}) {
|
|
408
|
+
return this.#_(e, t, n, r, a, i);
|
|
409
|
+
}
|
|
410
|
+
#_(e, t, n, r, i, a) {
|
|
411
|
+
let o = this.#b(() => s.dependencies), s = {
|
|
401
412
|
id: "n" + this.#e++,
|
|
402
413
|
name: t,
|
|
403
414
|
kind: "derived",
|
|
404
|
-
rank
|
|
415
|
+
get rank() {
|
|
416
|
+
return o();
|
|
417
|
+
},
|
|
418
|
+
dependencies: n,
|
|
405
419
|
value: r(),
|
|
406
420
|
disposed: !1,
|
|
407
421
|
listeners: /* @__PURE__ */ new Set(),
|
|
408
422
|
fn: r,
|
|
423
|
+
apply: a,
|
|
424
|
+
equals: i.equals ?? ((e, t) => e === t),
|
|
409
425
|
subscribe(e) {
|
|
410
|
-
return
|
|
411
|
-
|
|
426
|
+
return s.listeners.add(e), () => {
|
|
427
|
+
s.listeners.delete(e);
|
|
412
428
|
};
|
|
413
429
|
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
430
|
+
};
|
|
431
|
+
a?.(s.value);
|
|
432
|
+
let c = () => s.dependencies.map((e) => e.subscribe(() => {
|
|
433
|
+
s.disposed || (this.#x(s), e.propagation === "sync" && this.flushNow());
|
|
434
|
+
})), l = c(), u = () => {
|
|
435
|
+
s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
|
|
436
|
+
}, d = this.#g(e, u);
|
|
437
|
+
return Object.assign(I(s), {
|
|
438
|
+
dispose: u,
|
|
439
|
+
rebind: (e, n) => {
|
|
440
|
+
if (s.disposed) throw Error("Cannot rebind disposed operation: " + t);
|
|
441
|
+
let r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
442
|
+
let n = e[P];
|
|
443
|
+
if (n === s) throw Error("Reactive dependency cycle: " + t);
|
|
444
|
+
if (!r.has(n)) {
|
|
445
|
+
r.add(n);
|
|
446
|
+
for (let e of n?.dependencies ?? []) i(e);
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#x(s), this.#p.clear();
|
|
450
|
+
for (let e of this.#d) this.#p.push(e, this.#C(e.rank));
|
|
451
|
+
this.#m.clear();
|
|
452
|
+
for (let e of this.#f) this.#m.push(e, this.#C(e.rank));
|
|
453
|
+
}
|
|
454
|
+
});
|
|
420
455
|
}
|
|
421
456
|
effect(e, t, n) {
|
|
422
|
-
let r =
|
|
457
|
+
let r = this.#b(() => t), i = {
|
|
423
458
|
id: "n" + this.#e++,
|
|
424
|
-
rank
|
|
459
|
+
get rank() {
|
|
460
|
+
return r();
|
|
461
|
+
},
|
|
425
462
|
disposed: !1,
|
|
426
463
|
fn: n
|
|
427
|
-
}, a = () => {
|
|
428
|
-
i.disposed || this.#
|
|
429
|
-
}
|
|
430
|
-
i.disposed || (i.disposed = !0,
|
|
431
|
-
};
|
|
432
|
-
return
|
|
464
|
+
}, a = t.map((e) => e.subscribe(() => {
|
|
465
|
+
i.disposed || (this.#S(i), e.propagation === "sync" && this.flushNow());
|
|
466
|
+
})), o = () => {
|
|
467
|
+
i.disposed || (i.disposed = !0, s(), a.forEach((e) => e()), this.#f.delete(i));
|
|
468
|
+
}, s = this.#g(e, o);
|
|
469
|
+
return o;
|
|
433
470
|
}
|
|
434
471
|
runInTransaction(e) {
|
|
435
|
-
this.#
|
|
472
|
+
this.#r += 1;
|
|
436
473
|
try {
|
|
437
474
|
return e();
|
|
438
475
|
} finally {
|
|
439
|
-
--this.#
|
|
476
|
+
--this.#r, this.#r === 0 && (this.#i ? (this.#i = !1, this.flushNow()) : this.#w());
|
|
440
477
|
}
|
|
441
478
|
}
|
|
442
|
-
flushNow() {
|
|
443
|
-
if (
|
|
444
|
-
this.#
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
479
|
+
flushNow({ afterTransaction: e = !1 } = {}) {
|
|
480
|
+
if (e && this.#r > 0 && (this.#i = !0), this.#s > 0) {
|
|
481
|
+
this.#c = !0;
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (this.#r > 0 || this.#o) return;
|
|
485
|
+
this.#a = !1, this.#o = !0;
|
|
486
|
+
let t;
|
|
487
|
+
try {
|
|
488
|
+
for (; this.#p.length || this.#l.size || this.#m.length;) {
|
|
489
|
+
for (; this.#p.length;) {
|
|
490
|
+
let e = this.#p.pop();
|
|
491
|
+
if (this.#d.delete(e), e.disposed) continue;
|
|
492
|
+
this.#y(e, e.name);
|
|
493
|
+
let t, n;
|
|
494
|
+
try {
|
|
495
|
+
t = e.fn(), n = !e.equals(t, e.value), n && e.apply?.(t);
|
|
496
|
+
} catch (t) {
|
|
497
|
+
throw this.#x(e), t;
|
|
454
498
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
499
|
+
n && (e.value = t, this.#v(e.listeners));
|
|
500
|
+
}
|
|
501
|
+
if (this.#l.size) {
|
|
502
|
+
let e = Infinity, n;
|
|
503
|
+
for (let [t, { rank: r }] of this.#l) r < e && (n = t, e = r);
|
|
504
|
+
let r = /* @__PURE__ */ new Set();
|
|
505
|
+
for (;;) {
|
|
506
|
+
if (r.has(n)) throw Error("Cyclic streaming publication dependencies");
|
|
507
|
+
r.add(n);
|
|
508
|
+
let e;
|
|
509
|
+
for (let t of this.#l.get(n).prerequisites?.() ?? []) if (this.#l.has(t)) {
|
|
510
|
+
e = t;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
if (!e) break;
|
|
514
|
+
n = e;
|
|
459
515
|
}
|
|
516
|
+
t = this.#l.get(n).onError, this.#l.delete(n), this.#y(n, "streaming update"), n(), t = void 0;
|
|
517
|
+
} else if (this.#m.length) {
|
|
518
|
+
let e = this.#m.pop();
|
|
519
|
+
this.#f.delete(e), e.disposed || (this.#y(e, "effect " + e.id), e.fn());
|
|
460
520
|
}
|
|
461
|
-
} finally {
|
|
462
|
-
this.#i = !1, this.#g();
|
|
463
521
|
}
|
|
522
|
+
} catch (e) {
|
|
523
|
+
let n = Array.from(this.#l.values());
|
|
524
|
+
this.#l.clear(), t?.(e);
|
|
525
|
+
for (let t of n) t.onError?.(e);
|
|
526
|
+
for (let t of this.#h) t.reject(e);
|
|
527
|
+
throw this.#h.clear(), e;
|
|
528
|
+
} finally {
|
|
529
|
+
this.#u.clear(), this.#o = !1, this.#E();
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
requestUpdate(e, t = 0, n, r) {
|
|
533
|
+
this.#l.set(e, {
|
|
534
|
+
rank: t,
|
|
535
|
+
onError: n,
|
|
536
|
+
prerequisites: r
|
|
537
|
+
}), this.#w();
|
|
538
|
+
}
|
|
539
|
+
cancelUpdate(e) {
|
|
540
|
+
this.#l.delete(e);
|
|
541
|
+
}
|
|
542
|
+
#v(e) {
|
|
543
|
+
this.#s++;
|
|
544
|
+
try {
|
|
545
|
+
Ee(e);
|
|
546
|
+
} finally {
|
|
547
|
+
this.#s--, !this.#s && this.#c && (this.#c = !1, this.flushNow());
|
|
464
548
|
}
|
|
465
549
|
}
|
|
550
|
+
#y(e, t) {
|
|
551
|
+
let n = (this.#u.get(e) ?? 0) + 1;
|
|
552
|
+
if (n > 100) throw Error("Reactive propagation did not settle: " + t);
|
|
553
|
+
this.#u.set(e, n);
|
|
554
|
+
}
|
|
466
555
|
whenPropagated(e = {}) {
|
|
467
|
-
if (this.#
|
|
556
|
+
if (this.#T()) return Promise.resolve();
|
|
468
557
|
let { signal: t, timeoutMs: n } = e;
|
|
469
558
|
return t?.aborted ? Promise.reject(/* @__PURE__ */ Error("whenPropagated aborted")) : new Promise((e, r) => {
|
|
470
|
-
let i = {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
559
|
+
let i, a = () => {
|
|
560
|
+
this.#h.delete(o), t?.removeEventListener("abort", s), i !== void 0 && clearTimeout(i);
|
|
561
|
+
}, o = {
|
|
562
|
+
resolve: () => {
|
|
563
|
+
a(), e();
|
|
564
|
+
},
|
|
565
|
+
reject: (e) => {
|
|
566
|
+
a(), r(e);
|
|
567
|
+
}
|
|
568
|
+
}, s = () => o.reject(/* @__PURE__ */ Error("whenPropagated aborted"));
|
|
569
|
+
t?.addEventListener("abort", s, { once: !0 }), n != null && (i = setTimeout(() => o.reject(/* @__PURE__ */ Error("whenPropagated timeout after " + n + " ms")), n)), this.#h.add(o);
|
|
479
570
|
});
|
|
480
571
|
}
|
|
481
|
-
#
|
|
482
|
-
|
|
572
|
+
#b(e) {
|
|
573
|
+
let t = -1, n = 0;
|
|
574
|
+
return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, Te(t)), 0), t = this.#n), n);
|
|
483
575
|
}
|
|
484
|
-
#
|
|
485
|
-
|
|
576
|
+
#x(e) {
|
|
577
|
+
if (this.#d.has(e)) {
|
|
578
|
+
this.#w();
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
this.#d.add(e), this.#p.push(e, this.#C(e.rank)), this.#w();
|
|
486
582
|
}
|
|
487
|
-
#
|
|
488
|
-
|
|
489
|
-
|
|
583
|
+
#S(e) {
|
|
584
|
+
if (this.#f.has(e)) {
|
|
585
|
+
this.#w();
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
this.#f.add(e), this.#m.push(e, this.#C(e.rank)), this.#w();
|
|
490
589
|
}
|
|
491
|
-
#
|
|
492
|
-
|
|
493
|
-
|
|
590
|
+
#C(e) {
|
|
591
|
+
let t = this.#t % F;
|
|
592
|
+
return this.#t += 1, e * F + t;
|
|
593
|
+
}
|
|
594
|
+
#w() {
|
|
595
|
+
this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
|
|
596
|
+
this.#a && this.flushNow();
|
|
494
597
|
}));
|
|
495
598
|
}
|
|
496
|
-
#
|
|
497
|
-
return this.#
|
|
599
|
+
#T() {
|
|
600
|
+
return this.#r === 0 && !this.#a && !this.#o && this.#p.length === 0 && this.#m.length === 0 && this.#d.size === 0 && this.#f.size === 0 && this.#l.size === 0;
|
|
498
601
|
}
|
|
499
|
-
#
|
|
500
|
-
if (this.#
|
|
501
|
-
for (let e of this.#
|
|
502
|
-
this.#
|
|
602
|
+
#E() {
|
|
603
|
+
if (this.#T()) {
|
|
604
|
+
for (let e of this.#h) e.resolve();
|
|
605
|
+
this.#h.clear();
|
|
503
606
|
}
|
|
504
607
|
}
|
|
505
|
-
},
|
|
608
|
+
}, Oe = class {
|
|
506
609
|
#e = 1;
|
|
507
610
|
#t = /* @__PURE__ */ new Map();
|
|
508
611
|
createOwner(e, t) {
|
|
@@ -512,7 +615,9 @@ var ke = class {
|
|
|
512
615
|
addDisposer(e, t) {
|
|
513
616
|
let n = this.#t.get(e);
|
|
514
617
|
if (!n) throw Error("Unknown owner: " + e);
|
|
515
|
-
n.add(t)
|
|
618
|
+
return n.add(t), () => {
|
|
619
|
+
n.delete(t);
|
|
620
|
+
};
|
|
516
621
|
}
|
|
517
622
|
disposeOwner(e) {
|
|
518
623
|
let t = this.#t.get(e);
|
|
@@ -521,13 +626,14 @@ var ke = class {
|
|
|
521
626
|
t.clear(), this.#t.delete(e);
|
|
522
627
|
}
|
|
523
628
|
}
|
|
524
|
-
},
|
|
629
|
+
}, ke = class {
|
|
525
630
|
#e = 1;
|
|
526
631
|
#t = /* @__PURE__ */ new Map();
|
|
527
632
|
createRootScope(e) {
|
|
528
633
|
let t = "scope:" + this.#e++;
|
|
529
634
|
return this.#t.set(t, {
|
|
530
635
|
params: /* @__PURE__ */ new Map(),
|
|
636
|
+
initializers: /* @__PURE__ */ new Map(),
|
|
531
637
|
ownerId: e
|
|
532
638
|
}), t;
|
|
533
639
|
}
|
|
@@ -537,6 +643,7 @@ var ke = class {
|
|
|
537
643
|
return this.#t.set(n, {
|
|
538
644
|
parentScope: t,
|
|
539
645
|
params: /* @__PURE__ */ new Map(),
|
|
646
|
+
initializers: /* @__PURE__ */ new Map(),
|
|
540
647
|
ownerId: e
|
|
541
648
|
}), n;
|
|
542
649
|
}
|
|
@@ -548,36 +655,57 @@ var ke = class {
|
|
|
548
655
|
clearScope(e) {
|
|
549
656
|
let t = this.#t.get(e);
|
|
550
657
|
if (!t) throw Error("Unknown scope: " + e);
|
|
551
|
-
t.params.clear();
|
|
658
|
+
t.params.clear(), t.initializers.clear();
|
|
659
|
+
}
|
|
660
|
+
registerInitializer(e, t, n) {
|
|
661
|
+
r(t);
|
|
662
|
+
let i = this.#t.get(e);
|
|
663
|
+
if (!i) throw Error("Unknown scope: " + e);
|
|
664
|
+
if (i.params.has(t) || i.initializers.has(t)) throw Error(`Parameter "${t}" already exists in scope ${e}`);
|
|
665
|
+
i.initializers.set(t, {
|
|
666
|
+
initialize: n,
|
|
667
|
+
initializing: !1
|
|
668
|
+
});
|
|
552
669
|
}
|
|
553
670
|
register(e, t, n) {
|
|
554
|
-
|
|
555
|
-
let
|
|
556
|
-
if (!
|
|
557
|
-
if (
|
|
558
|
-
return
|
|
671
|
+
r(t);
|
|
672
|
+
let i = this.#t.get(e);
|
|
673
|
+
if (!i) throw Error("Unknown scope: " + e);
|
|
674
|
+
if (i.params.has(t) || i.initializers.get(t)?.initializing === !1) throw Error("Parameter \"" + t + "\" already exists in scope " + e);
|
|
675
|
+
return i.params.set(t, n), n;
|
|
559
676
|
}
|
|
560
677
|
resolve(e, t) {
|
|
561
|
-
|
|
678
|
+
r(t);
|
|
562
679
|
let n = e;
|
|
563
680
|
for (; n;) {
|
|
564
681
|
let e = this.#t.get(n);
|
|
565
682
|
if (!e) throw Error("Unknown scope: " + n);
|
|
566
|
-
let r = e.
|
|
567
|
-
if (r)
|
|
683
|
+
let r = e.initializers.get(t);
|
|
684
|
+
if (r) {
|
|
685
|
+
if (r.initializing) throw Error(`Parameter dependency cycle while initializing "${t}" in ${n}.`);
|
|
686
|
+
r.initializing = !0;
|
|
687
|
+
try {
|
|
688
|
+
if (r.initialize(), !e.params.has(t)) throw Error(`Initializer did not register parameter "${t}".`);
|
|
689
|
+
e.initializers.delete(t);
|
|
690
|
+
} finally {
|
|
691
|
+
r.initializing = !1;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
let i = e.params.get(t);
|
|
695
|
+
if (i) return i;
|
|
568
696
|
n = e.parentScope;
|
|
569
697
|
}
|
|
570
698
|
}
|
|
571
699
|
};
|
|
572
700
|
//#endregion
|
|
573
701
|
//#region ../core/src/paramRuntime/expressionCompiler.js
|
|
574
|
-
function
|
|
575
|
-
return
|
|
702
|
+
function Ae(e, t = {}, n = {}) {
|
|
703
|
+
return a(e, t, n);
|
|
576
704
|
}
|
|
577
705
|
//#endregion
|
|
578
706
|
//#region ../core/src/paramRuntime/expressionRef.js
|
|
579
|
-
function
|
|
580
|
-
let r = {}, i =
|
|
707
|
+
function L(e, t, n = {}) {
|
|
708
|
+
let r = {}, i = Ae(e, r, n), a = /* @__PURE__ */ new Map();
|
|
581
709
|
for (let n of i.globals) {
|
|
582
710
|
if (a.has(n)) continue;
|
|
583
711
|
let i = t(n);
|
|
@@ -601,17 +729,17 @@ function Ne(e, t, n = {}) {
|
|
|
601
729
|
}, i.invalidate = () => {
|
|
602
730
|
for (let e of o) e();
|
|
603
731
|
o.clear();
|
|
604
|
-
}, i.identifier = () => i.code + "|" + Array.from(a.values()).map((e) => e.id).concat((i.scaleDependencies ?? []).map((e) => e.id)).join(","), {
|
|
732
|
+
}, i.identifier = () => i.code + "|" + Array.from(a.values()).map((e) => e.id).concat((i.scaleDependencies ?? []).map((e) => e.id)).join(","), i.dependencies = Array.from(a.values()).concat(i.scaleDependencies ?? []), {
|
|
605
733
|
expression: i,
|
|
606
|
-
dependencies:
|
|
734
|
+
dependencies: i.dependencies
|
|
607
735
|
};
|
|
608
736
|
}
|
|
609
737
|
//#endregion
|
|
610
738
|
//#region ../core/src/paramRuntime/paramRuntime.js
|
|
611
|
-
var
|
|
612
|
-
#e = new
|
|
613
|
-
#t = new
|
|
614
|
-
#n = new
|
|
739
|
+
var je = class {
|
|
740
|
+
#e = new Oe();
|
|
741
|
+
#t = new De({ lifecycleRegistry: this.#e });
|
|
742
|
+
#n = new ke();
|
|
615
743
|
createScope(e) {
|
|
616
744
|
let t = this.#e.createOwner("scope", e ?? "root");
|
|
617
745
|
return e ? this.#n.createChildScope(t, e) : this.#n.createRootScope(t);
|
|
@@ -624,6 +752,9 @@ var Pe = class {
|
|
|
624
752
|
let n = this.#n.getOwnerId(e);
|
|
625
753
|
this.#e.addDisposer(n, t);
|
|
626
754
|
}
|
|
755
|
+
registerInitializer(e, t, n) {
|
|
756
|
+
this.#n.registerInitializer(e, t, n);
|
|
757
|
+
}
|
|
627
758
|
registerBase(e, t, n, r) {
|
|
628
759
|
let i = this.#n.getOwnerId(e), a = this.#t.createWritable(i, t, "base", n, r);
|
|
629
760
|
return this.#n.register(e, t, a);
|
|
@@ -633,30 +764,48 @@ var Pe = class {
|
|
|
633
764
|
return this.#n.register(e, t, a);
|
|
634
765
|
}
|
|
635
766
|
registerDerived(e, t, n, r) {
|
|
636
|
-
let { expression: i, dependencies: a } =
|
|
767
|
+
let { expression: i, dependencies: a } = L(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
|
|
637
768
|
return this.#n.register(e, t, s);
|
|
638
769
|
}
|
|
639
770
|
createExpression(e, t, n) {
|
|
640
|
-
let { expression: r } =
|
|
771
|
+
let { expression: r } = L(t, (t) => this.resolve(e, t), n);
|
|
641
772
|
return r;
|
|
642
773
|
}
|
|
643
774
|
resolve(e, t) {
|
|
644
775
|
return this.#n.resolve(e, t);
|
|
645
776
|
}
|
|
777
|
+
signal(e, t, n) {
|
|
778
|
+
return this.#t.createWritable(this.#n.getOwnerId(e), t, "base", n);
|
|
779
|
+
}
|
|
780
|
+
computed(e, t, n, r, i) {
|
|
781
|
+
return this.#t.computed(this.#n.getOwnerId(e), t, n, r, i);
|
|
782
|
+
}
|
|
783
|
+
operation(e, t, n, r, i, a) {
|
|
784
|
+
return this.#t.operation(this.#n.getOwnerId(e), t, n, r, i, a);
|
|
785
|
+
}
|
|
786
|
+
effect(e, t, n) {
|
|
787
|
+
return this.#t.effect(this.#n.getOwnerId(e), t, n);
|
|
788
|
+
}
|
|
789
|
+
requestUpdate(e, t = 0, n, r) {
|
|
790
|
+
this.#t.requestUpdate(e, t, n, r);
|
|
791
|
+
}
|
|
792
|
+
cancelUpdate(e) {
|
|
793
|
+
this.#t.cancelUpdate(e);
|
|
794
|
+
}
|
|
646
795
|
runInTransaction(e) {
|
|
647
796
|
return this.#t.runInTransaction(e);
|
|
648
797
|
}
|
|
649
|
-
flushNow() {
|
|
650
|
-
this.#t.flushNow();
|
|
798
|
+
flushNow(e) {
|
|
799
|
+
this.#t.flushNow(e);
|
|
651
800
|
}
|
|
652
801
|
whenPropagated(e) {
|
|
653
802
|
return this.#t.whenPropagated(e);
|
|
654
803
|
}
|
|
655
|
-
},
|
|
656
|
-
function
|
|
804
|
+
}, Me = (e) => new Promise((t) => setTimeout(t, e));
|
|
805
|
+
function Ne() {
|
|
657
806
|
return { canceled: !1 };
|
|
658
807
|
}
|
|
659
|
-
function
|
|
808
|
+
function Pe(e) {
|
|
660
809
|
let t = e.requestAnimationFrame || window.requestAnimationFrame, n = e.signal, r = e.cancelToken, i = () => new Promise((i, a) => {
|
|
661
810
|
if (r?.canceled) return i();
|
|
662
811
|
if (n?.aborted) return a("aborted");
|
|
@@ -669,11 +818,11 @@ function Le(e) {
|
|
|
669
818
|
};
|
|
670
819
|
t(m);
|
|
671
820
|
});
|
|
672
|
-
return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") :
|
|
821
|
+
return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") : Me(e.delay).then(i) : i();
|
|
673
822
|
}
|
|
674
823
|
//#endregion
|
|
675
824
|
//#region ../core/src/utils/animator.js
|
|
676
|
-
var
|
|
825
|
+
var Fe = class {
|
|
677
826
|
constructor(e) {
|
|
678
827
|
this._renderCallback = e, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
|
|
679
828
|
}
|
|
@@ -699,13 +848,13 @@ var Re = class {
|
|
|
699
848
|
this._finalized = !0, this._renderRequested = !1, this.transitions = [], this._animationFrameRequest !== void 0 && (window.cancelAnimationFrame(this._animationFrameRequest), this._animationFrameRequest = void 0);
|
|
700
849
|
}
|
|
701
850
|
transition(e) {
|
|
702
|
-
return
|
|
851
|
+
return Pe({
|
|
703
852
|
requestAnimationFrame: (e) => this.requestTransition(e),
|
|
704
853
|
...e
|
|
705
854
|
});
|
|
706
855
|
}
|
|
707
856
|
};
|
|
708
|
-
function
|
|
857
|
+
function R(e, t, n, r, i) {
|
|
709
858
|
let a = 0, o = !0, s = !1, c = structuredClone(i), l = c;
|
|
710
859
|
function u(e, t, n, r) {
|
|
711
860
|
return t + (e - t) * 2 ** (-n / r);
|
|
@@ -724,7 +873,7 @@ function ze(e, t, n, r, i) {
|
|
|
724
873
|
s || (s = !0, e.requestTransition(d));
|
|
725
874
|
}
|
|
726
875
|
function p(n) {
|
|
727
|
-
l = n, e.transitionsEnabled === !1 ? (c = l, o = !0, s = !1, e.cancelTransition(d), t(c)) : o && (o = !1, a =
|
|
876
|
+
l = n, e.transitionsEnabled === !1 ? (c = l, o = !0, s = !1, e.cancelTransition(d), t(c)) : o && (o = !1, a = Ie(), d(a));
|
|
728
877
|
}
|
|
729
878
|
return p.stop = () => {
|
|
730
879
|
o = !0, s = !1, e.cancelTransition(d);
|
|
@@ -732,93 +881,131 @@ function ze(e, t, n, r, i) {
|
|
|
732
881
|
l = e, c = e, p.stop(), t(c);
|
|
733
882
|
}, p;
|
|
734
883
|
}
|
|
735
|
-
function
|
|
884
|
+
function Ie() {
|
|
736
885
|
let e = globalThis.document?.timeline?.currentTime;
|
|
737
886
|
return typeof e == "number" ? e : performance.now();
|
|
738
887
|
}
|
|
739
888
|
//#endregion
|
|
740
889
|
//#region ../core/src/paramRuntime/viewParamRuntime.js
|
|
741
|
-
var
|
|
890
|
+
var z = class {
|
|
742
891
|
#e;
|
|
743
892
|
#t;
|
|
744
893
|
#n = /* @__PURE__ */ new Map();
|
|
745
894
|
#r = /* @__PURE__ */ new Map();
|
|
746
895
|
#i = /* @__PURE__ */ new Map();
|
|
747
|
-
#a = /* @__PURE__ */ new
|
|
748
|
-
#o;
|
|
749
|
-
#s;
|
|
896
|
+
#a = /* @__PURE__ */ new Set();
|
|
897
|
+
#o = /* @__PURE__ */ new Map();
|
|
898
|
+
#s = /* @__PURE__ */ new Map();
|
|
750
899
|
#c;
|
|
751
900
|
#l;
|
|
752
|
-
#u
|
|
901
|
+
#u;
|
|
902
|
+
#d;
|
|
903
|
+
#f = !1;
|
|
753
904
|
constructor(e, t, n, r = {}) {
|
|
754
|
-
this.#
|
|
755
|
-
let i = this.#
|
|
756
|
-
i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
let n
|
|
905
|
+
this.#c = e ?? (() => void 0), this.#l = t ?? (() => void 0), this.#u = n, this.#d = r.snapTransitionedUpdates ?? !1;
|
|
906
|
+
let i = this.#c();
|
|
907
|
+
i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new je(), this.#t = this.#e.createScope());
|
|
908
|
+
}
|
|
909
|
+
get #p() {
|
|
910
|
+
return { resolveScaleResolution: this.#l };
|
|
911
|
+
}
|
|
912
|
+
registerParam(e, t = {}) {
|
|
913
|
+
let n = e.name;
|
|
914
|
+
if (r(n), this.#i.has(n) || this.#a.has(n)) throw Error("Parameter \"" + n + "\" already registered in this scope.");
|
|
915
|
+
if (Re(e), t.defer) {
|
|
916
|
+
if (!("expr" in e)) throw Error("Only expression parameters can be deferred.");
|
|
917
|
+
return this.#e.registerInitializer(this.#t, n, () => {
|
|
918
|
+
this.#m(e);
|
|
919
|
+
}), this.#i.set(n, e), () => {
|
|
920
|
+
throw Error("Cannot set derived parameter \"" + n + "\".");
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
return this.#m(e);
|
|
924
|
+
}
|
|
925
|
+
registerLazyExpression(e, t, n) {
|
|
926
|
+
this.#e.registerInitializer(this.#t, e, () => {
|
|
927
|
+
n?.();
|
|
928
|
+
let r = this.#e.registerDerived(this.#t, e, t, this.#p);
|
|
929
|
+
this.#r.set(e, r);
|
|
930
|
+
}), this.#a.add(e);
|
|
931
|
+
}
|
|
932
|
+
registerScopedExpression(e, t, n) {
|
|
933
|
+
if (this.#e !== n.#e) throw Error("Scoped expressions must share a parameter runtime.");
|
|
934
|
+
if (this.#i.has(e)) throw Error("Parameter \"" + e + "\" already registered in this scope.");
|
|
935
|
+
this.#e.registerInitializer(this.#t, e, () => {
|
|
936
|
+
let r = this.#e.registerDerived(this.#t, e, t, {
|
|
937
|
+
expressionScope: n.#t,
|
|
938
|
+
...n.#p
|
|
939
|
+
});
|
|
940
|
+
this.#r.set(e, r);
|
|
941
|
+
}), this.#i.set(e, {
|
|
942
|
+
name: e,
|
|
943
|
+
expr: t
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
#m(e) {
|
|
947
|
+
let n = e.name, r, i;
|
|
763
948
|
if (e.push == "outer") {
|
|
764
|
-
let
|
|
765
|
-
if (!
|
|
766
|
-
let
|
|
767
|
-
if (!
|
|
768
|
-
if ("expr" in
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}, this.#n.set(
|
|
772
|
-
} else if ("value" in e)
|
|
949
|
+
let a = this.findRuntimeForParam(n);
|
|
950
|
+
if (!a) throw Error(`Parameter "${n}" not found in outer scope!`);
|
|
951
|
+
let o = a.paramConfigs.get(n);
|
|
952
|
+
if (!o) throw Error(`Outer parameter "${n}" exists as a value but has no registered config.`);
|
|
953
|
+
if ("expr" in o || "select" in o || "ruler" in o) throw Error(`The outer parameter "${n}" must not have expr, select, or ruler properties!`);
|
|
954
|
+
r = (e) => {
|
|
955
|
+
a.setValue(n, e);
|
|
956
|
+
}, this.#n.set(n, r), "ruler" in e && (i = t(e, this), r(i));
|
|
957
|
+
} else if ("value" in e) i = t(e, this), r = "transition" in e ? this.#g(n, i, e.transition) : this.#h(n, i);
|
|
773
958
|
else if ("expr" in e) {
|
|
774
|
-
if ("transition" in e) this.#
|
|
959
|
+
if ("transition" in e) this.#_(n, e.expr, e.transition);
|
|
775
960
|
else {
|
|
776
|
-
let
|
|
777
|
-
this.#r.set(
|
|
961
|
+
let t = this.#e.registerDerived(this.#t, n, e.expr, this.#p);
|
|
962
|
+
this.#r.set(n, t);
|
|
778
963
|
}
|
|
779
|
-
|
|
780
|
-
throw Error("Cannot set derived parameter \"" +
|
|
964
|
+
r = () => {
|
|
965
|
+
throw Error("Cannot set derived parameter \"" + n + "\".");
|
|
781
966
|
};
|
|
782
|
-
} else
|
|
967
|
+
} else i = t(e, this), r = this.#h(n, i);
|
|
783
968
|
if ("select" in e) {
|
|
784
|
-
if (
|
|
785
|
-
let e = this.#e.registerSelection(this.#t,
|
|
786
|
-
this.#r.set(
|
|
969
|
+
if (i ??= t(e, this), !this.#n.has(n)) {
|
|
970
|
+
let e = this.#e.registerSelection(this.#t, n, i);
|
|
971
|
+
this.#r.set(n, e), this.#n.set(n, (t) => {
|
|
787
972
|
e.set(t), this.#e.flushNow();
|
|
788
|
-
}),
|
|
973
|
+
}), r = this.#n.get(n);
|
|
789
974
|
}
|
|
790
|
-
|
|
975
|
+
r(i);
|
|
791
976
|
}
|
|
792
|
-
return this.#i.set(
|
|
977
|
+
return this.#i.set(n, e), r;
|
|
793
978
|
}
|
|
794
979
|
allocateSetter(e, t, n = !1) {
|
|
795
|
-
if (
|
|
796
|
-
let
|
|
797
|
-
this.#r.set(e,
|
|
798
|
-
let
|
|
799
|
-
|
|
980
|
+
if (r(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
|
|
981
|
+
let i = this.#e.registerBase(this.#t, e, t, { notify: !n });
|
|
982
|
+
this.#r.set(e, i);
|
|
983
|
+
let a = (e) => {
|
|
984
|
+
i.set(e), this.#e.flushNow();
|
|
800
985
|
};
|
|
801
|
-
return this.#n.set(e,
|
|
986
|
+
return this.#n.set(e, a), a;
|
|
802
987
|
}
|
|
803
988
|
setValue(e, t, n) {
|
|
804
|
-
|
|
805
|
-
let
|
|
806
|
-
if (!
|
|
807
|
-
|
|
989
|
+
r(e);
|
|
990
|
+
let i = this.#n.get(e);
|
|
991
|
+
if (!i) throw Error("Writable parameter not found in this scope: " + e);
|
|
992
|
+
i(t, n);
|
|
808
993
|
}
|
|
809
994
|
getValue(e) {
|
|
810
|
-
return this.#r.get(e)?.get();
|
|
995
|
+
return !this.#r.has(e) && this.hasLocalParam(e) && this.#e.resolve(this.#t, e), this.#r.get(e)?.get();
|
|
996
|
+
}
|
|
997
|
+
getParamRef(e) {
|
|
998
|
+
r(e);
|
|
999
|
+
let t = this.findRuntimeForParam(e);
|
|
1000
|
+
if (t) return t.#r.has(e) || t.#e.resolve(t.#t, e), t.#r.get(e);
|
|
811
1001
|
}
|
|
812
1002
|
getTargetValue(e) {
|
|
813
|
-
return
|
|
1003
|
+
return r(e), this.#s.get(e)?.target ?? this.getValue(e);
|
|
814
1004
|
}
|
|
815
1005
|
subscribe(e, t) {
|
|
816
|
-
|
|
817
|
-
let n = this.findRuntimeForParam(e);
|
|
1006
|
+
let n = this.getParamRef(e);
|
|
818
1007
|
if (!n) throw Error("Parameter not found: " + e);
|
|
819
|
-
|
|
820
|
-
if (!r) throw Error("Parameter found without local reference: " + e);
|
|
821
|
-
return r.subscribe(t);
|
|
1008
|
+
return n.subscribe(t);
|
|
822
1009
|
}
|
|
823
1010
|
findValue(e) {
|
|
824
1011
|
return this.findRuntimeForParam(e)?.getValue(e);
|
|
@@ -830,13 +1017,39 @@ var P = class {
|
|
|
830
1017
|
return this.#i;
|
|
831
1018
|
}
|
|
832
1019
|
hasLocalParam(e) {
|
|
833
|
-
|
|
1020
|
+
r(e);
|
|
1021
|
+
let t = this.#i.get(e);
|
|
1022
|
+
return this.#r.has(e) || this.#a.has(e) || t !== void 0 && "expr" in t;
|
|
1023
|
+
}
|
|
1024
|
+
isPendingParam(e) {
|
|
1025
|
+
let t = this.findRuntimeForParam(e);
|
|
1026
|
+
return t !== void 0 && !t.#r.has(e);
|
|
834
1027
|
}
|
|
835
1028
|
hasConfiguredParamInScopeChain(e) {
|
|
836
|
-
return
|
|
1029
|
+
return r(e), this.#i.has(e) ? !0 : this.#c()?.hasConfiguredParamInScopeChain(e) ?? !1;
|
|
837
1030
|
}
|
|
838
1031
|
findRuntimeForParam(e) {
|
|
839
|
-
return this
|
|
1032
|
+
return this.hasLocalParam(e) ? this : this.#c()?.findRuntimeForParam(e);
|
|
1033
|
+
}
|
|
1034
|
+
findConfiguredParam(e) {
|
|
1035
|
+
let t = this.#i.get(e);
|
|
1036
|
+
return t ? {
|
|
1037
|
+
runtime: this,
|
|
1038
|
+
config: t
|
|
1039
|
+
} : this.#c()?.findConfiguredParam(e);
|
|
1040
|
+
}
|
|
1041
|
+
registerSelectionController(e, t) {
|
|
1042
|
+
let n = this.#o.get(e);
|
|
1043
|
+
return n || (n = /* @__PURE__ */ new Set(), this.#o.set(e, n)), n.add(t), () => {
|
|
1044
|
+
n.delete(t), n.size === 0 && this.#o.delete(e);
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
getSelectionController(e) {
|
|
1048
|
+
let t = this.#o.get(e);
|
|
1049
|
+
if (t) {
|
|
1050
|
+
if (t.size > 1) throw Error(`Selection "${e}" has ambiguous interaction ownership.`);
|
|
1051
|
+
return t.values().next().value;
|
|
1052
|
+
}
|
|
840
1053
|
}
|
|
841
1054
|
getDebugState() {
|
|
842
1055
|
let e = [];
|
|
@@ -844,28 +1057,49 @@ var P = class {
|
|
|
844
1057
|
let r = this.#i.get(t);
|
|
845
1058
|
e.push({
|
|
846
1059
|
name: t,
|
|
847
|
-
kind:
|
|
1060
|
+
kind: Le(r),
|
|
848
1061
|
value: n.get(),
|
|
849
1062
|
writable: this.#n.has(t),
|
|
850
1063
|
configured: !!r,
|
|
851
1064
|
config: r ? structuredClone(r) : void 0,
|
|
852
|
-
target: this.#
|
|
1065
|
+
target: this.#s.get(t)?.target
|
|
853
1066
|
});
|
|
854
1067
|
}
|
|
855
1068
|
return {
|
|
856
1069
|
scopeId: this.#t,
|
|
857
|
-
disposed: this.#
|
|
1070
|
+
disposed: this.#f,
|
|
858
1071
|
params: e
|
|
859
1072
|
};
|
|
860
1073
|
}
|
|
861
1074
|
createExpression(e) {
|
|
862
|
-
return this.#e.createExpression(this.#t, e,
|
|
1075
|
+
return this.#e.createExpression(this.#t, e, this.#p);
|
|
863
1076
|
}
|
|
864
1077
|
watchExpression(e, t, n = {}) {
|
|
865
1078
|
let r = this.createExpression(e), i = r.subscribe(t);
|
|
866
1079
|
return (n.scopeOwned ?? !0) && this.#e.addScopeDisposer(this.#t, i), n.registerDisposer?.(i), r;
|
|
867
1080
|
}
|
|
868
|
-
|
|
1081
|
+
signal(e, t) {
|
|
1082
|
+
return this.#e.signal(this.#t, e, t);
|
|
1083
|
+
}
|
|
1084
|
+
computed(e, t, n, r) {
|
|
1085
|
+
return this.#e.computed(this.#t, e, t, n, r);
|
|
1086
|
+
}
|
|
1087
|
+
operation(e, t, n, r, i) {
|
|
1088
|
+
return this.#e.operation(this.#t, e, t, n, r, i);
|
|
1089
|
+
}
|
|
1090
|
+
effect(e, t) {
|
|
1091
|
+
return this.#e.effect(this.#t, e, t);
|
|
1092
|
+
}
|
|
1093
|
+
get updateScheduler() {
|
|
1094
|
+
return this.#e;
|
|
1095
|
+
}
|
|
1096
|
+
requestUpdate(e, t = 0, n, r) {
|
|
1097
|
+
this.#e.requestUpdate(e, t, n, r);
|
|
1098
|
+
}
|
|
1099
|
+
cancelUpdate(e) {
|
|
1100
|
+
this.#e.cancelUpdate(e);
|
|
1101
|
+
}
|
|
1102
|
+
#h(e, t) {
|
|
869
1103
|
let n = this.#e.registerBase(this.#t, e, t);
|
|
870
1104
|
this.#r.set(e, n);
|
|
871
1105
|
let r = (e) => {
|
|
@@ -873,36 +1107,36 @@ var P = class {
|
|
|
873
1107
|
};
|
|
874
1108
|
return this.#n.set(e, r), r;
|
|
875
1109
|
}
|
|
876
|
-
#
|
|
877
|
-
let r = this.#
|
|
878
|
-
this.#
|
|
1110
|
+
#g(e, t, n) {
|
|
1111
|
+
let r = this.#v(e, t, n), i = (t, n) => {
|
|
1112
|
+
this.#y(e, r, t, n);
|
|
879
1113
|
};
|
|
880
1114
|
return this.#n.set(e, i), i;
|
|
881
1115
|
}
|
|
882
|
-
#
|
|
883
|
-
let r = this.createExpression(t), i = this.#
|
|
884
|
-
this.#
|
|
1116
|
+
#_(e, t, n) {
|
|
1117
|
+
let r = this.createExpression(t), i = this.#v(e, r(null), n), a = r.subscribe(() => {
|
|
1118
|
+
this.#y(e, i, r(null), { animate: !this.#d });
|
|
885
1119
|
});
|
|
886
1120
|
this.#e.addScopeDisposer(this.#t, a);
|
|
887
1121
|
}
|
|
888
|
-
#
|
|
889
|
-
let r =
|
|
1122
|
+
#v(e, t, n) {
|
|
1123
|
+
let r = B(e, t), i = this.#e.registerBase(this.#t, e, r);
|
|
890
1124
|
this.#r.set(e, i);
|
|
891
|
-
let a = this.#
|
|
1125
|
+
let a = this.#u;
|
|
892
1126
|
if (!a) throw Error(`The parameter "${e}" uses transition but no animator is available.`);
|
|
893
|
-
let o =
|
|
1127
|
+
let o = R(a, ({ value: e }) => {
|
|
894
1128
|
i.set(e), this.#e.flushNow();
|
|
895
1129
|
}, n.halfLife ?? 80, n.epsilon ?? .01, { value: i.get() }), s = {
|
|
896
1130
|
target: i.get(),
|
|
897
1131
|
smoother: o,
|
|
898
1132
|
dispose: () => {
|
|
899
|
-
o.stop(), this.#
|
|
1133
|
+
o.stop(), this.#s.delete(e);
|
|
900
1134
|
}
|
|
901
1135
|
};
|
|
902
|
-
return this.#
|
|
1136
|
+
return this.#s.set(e, s), this.#e.addScopeDisposer(this.#t, s.dispose), s;
|
|
903
1137
|
}
|
|
904
|
-
#
|
|
905
|
-
let i =
|
|
1138
|
+
#y(e, t, n, r = {}) {
|
|
1139
|
+
let i = B(e, n);
|
|
906
1140
|
t.target = i, r.animate === !1 ? t.smoother.snap({ value: i }) : t.smoother({ value: i });
|
|
907
1141
|
}
|
|
908
1142
|
evaluateAndGet(e) {
|
|
@@ -911,32 +1145,32 @@ var P = class {
|
|
|
911
1145
|
runInTransaction(e) {
|
|
912
1146
|
return this.#e.runInTransaction(e);
|
|
913
1147
|
}
|
|
914
|
-
flushNow() {
|
|
915
|
-
this.#e.flushNow();
|
|
1148
|
+
flushNow(e) {
|
|
1149
|
+
this.#e.flushNow(e);
|
|
916
1150
|
}
|
|
917
1151
|
whenPropagated(e) {
|
|
918
1152
|
return this.#e.whenPropagated(e);
|
|
919
1153
|
}
|
|
920
1154
|
finalizeInitialization() {
|
|
921
|
-
this.#
|
|
1155
|
+
this.#d = !1;
|
|
922
1156
|
}
|
|
923
1157
|
dispose() {
|
|
924
|
-
this.#
|
|
1158
|
+
this.#f || (this.#f = !0, this.#e.disposeScope(this.#t), this.#n.clear(), this.#r.clear(), this.#i.clear(), this.#a.clear(), this.#o.clear(), this.#s.clear());
|
|
925
1159
|
}
|
|
926
1160
|
hasPointSelections() {
|
|
927
|
-
for (let
|
|
928
|
-
let
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
931
|
-
} else if (
|
|
1161
|
+
for (let t of this.#i.values()) if (e(t)) {
|
|
1162
|
+
let e = t.select;
|
|
1163
|
+
if (s(e)) {
|
|
1164
|
+
if (e == "point") return !0;
|
|
1165
|
+
} else if (e.type == "point") return !0;
|
|
932
1166
|
}
|
|
933
1167
|
return !1;
|
|
934
1168
|
}
|
|
935
1169
|
};
|
|
936
|
-
function
|
|
1170
|
+
function Le(e) {
|
|
937
1171
|
return e ? e.push === "outer" ? "push" : "select" in e ? "selection" : "ruler" in e ? "ruler" : "expr" in e ? "derived" : "base" : "auto";
|
|
938
1172
|
}
|
|
939
|
-
function
|
|
1173
|
+
function Re(e) {
|
|
940
1174
|
let t = e.name;
|
|
941
1175
|
if ("value" in e && "expr" in e) throw Error(`The parameter "${t}" must not have both value and expr properties!`);
|
|
942
1176
|
if ("expr" in e && "bind" in e) throw Error(`The parameter "${t}" must not have both expr and bind properties!`);
|
|
@@ -949,62 +1183,62 @@ function He(e) {
|
|
|
949
1183
|
if (n.halfLife != null && (!Number.isFinite(n.halfLife) || n.halfLife <= 0)) throw Error(`The transition halfLife for parameter "${t}" must be a positive finite number.`);
|
|
950
1184
|
if (n.epsilon != null && (!Number.isFinite(n.epsilon) || n.epsilon < 0)) throw Error(`The transition epsilon for parameter "${t}" must be a non-negative finite number.`);
|
|
951
1185
|
}
|
|
952
|
-
function
|
|
1186
|
+
function B(e, t) {
|
|
953
1187
|
if (typeof t != "number" || !Number.isFinite(t)) throw Error(`Transitioned parameter "${e}" must have a finite numeric value.`);
|
|
954
1188
|
return t;
|
|
955
1189
|
}
|
|
956
1190
|
//#endregion
|
|
957
1191
|
//#region ../core/src/utils/addBaseUrl.js
|
|
958
|
-
function
|
|
1192
|
+
function ze(e, t) {
|
|
959
1193
|
return !t || /^(data:|([A-Za-z]+:)?\/\/)/.test(e) || e.startsWith("/") ? e : (t.endsWith("/") || (t += "/"), t + e);
|
|
960
1194
|
}
|
|
961
|
-
function
|
|
1195
|
+
function Be(e) {
|
|
962
1196
|
if (!e) return e;
|
|
963
1197
|
if (/[?#]/.test(e)) throw Error(`Invalid base URL: ${e} - cannot contain query or hash.`);
|
|
964
1198
|
return e.endsWith("/") ? e : e + "/";
|
|
965
1199
|
}
|
|
966
1200
|
//#endregion
|
|
967
1201
|
//#region ../core/src/config/mergeConfig.js
|
|
968
|
-
function
|
|
969
|
-
return
|
|
1202
|
+
function V(e) {
|
|
1203
|
+
return o(e) && !Array.isArray(e);
|
|
970
1204
|
}
|
|
971
|
-
function
|
|
1205
|
+
function Ve(e) {
|
|
972
1206
|
let t = {};
|
|
973
|
-
for (let [n, r] of Object.entries(e)) t[n] =
|
|
1207
|
+
for (let [n, r] of Object.entries(e)) t[n] = H(r);
|
|
974
1208
|
return t;
|
|
975
1209
|
}
|
|
976
|
-
function
|
|
977
|
-
return Array.isArray(e) ? e.map(
|
|
1210
|
+
function H(e) {
|
|
1211
|
+
return Array.isArray(e) ? e.map(H) : V(e) ? Ve(e) : e;
|
|
978
1212
|
}
|
|
979
|
-
function
|
|
1213
|
+
function U(e, t) {
|
|
980
1214
|
for (let [n, r] of Object.entries(t)) {
|
|
981
1215
|
if (r === void 0) continue;
|
|
982
1216
|
let t = e[n];
|
|
983
|
-
|
|
1217
|
+
V(r) && V(t) ? U(t, r) : e[n] = H(r);
|
|
984
1218
|
}
|
|
985
1219
|
return e;
|
|
986
1220
|
}
|
|
987
|
-
function
|
|
1221
|
+
function He(e) {
|
|
988
1222
|
let t = {};
|
|
989
|
-
for (let n of e) n &&
|
|
1223
|
+
for (let n of e) n && U(t, n);
|
|
990
1224
|
return t;
|
|
991
1225
|
}
|
|
992
1226
|
//#endregion
|
|
993
1227
|
//#region ../core/src/view/viewChrome.js
|
|
994
|
-
var
|
|
995
|
-
function
|
|
996
|
-
|
|
1228
|
+
var W = /* @__PURE__ */ new WeakMap();
|
|
1229
|
+
function Ue(e, t) {
|
|
1230
|
+
W.set(e, t);
|
|
997
1231
|
}
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1232
|
+
function We(e) {
|
|
1233
|
+
return W.get(e);
|
|
1000
1234
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return
|
|
1235
|
+
function Ge(e) {
|
|
1236
|
+
return W.has(e);
|
|
1003
1237
|
}
|
|
1004
|
-
function
|
|
1238
|
+
function Ke(e) {
|
|
1005
1239
|
let t = e;
|
|
1006
1240
|
for (; t;) {
|
|
1007
|
-
let n =
|
|
1241
|
+
let n = W.get(t);
|
|
1008
1242
|
if (n === "excludeSubtree" || t === e && n === "exclude") return !0;
|
|
1009
1243
|
t = t.layoutParent;
|
|
1010
1244
|
}
|
|
@@ -1012,12 +1246,12 @@ function H(e) {
|
|
|
1012
1246
|
}
|
|
1013
1247
|
//#endregion
|
|
1014
1248
|
//#region ../core/src/view/postScaleParams.js
|
|
1015
|
-
var
|
|
1249
|
+
var qe = /* @__PURE__ */ new WeakMap();
|
|
1016
1250
|
function Je(e, t) {
|
|
1017
|
-
|
|
1251
|
+
qe.set(e, t);
|
|
1018
1252
|
}
|
|
1019
1253
|
function Ye(e) {
|
|
1020
|
-
return
|
|
1254
|
+
return qe.get(e);
|
|
1021
1255
|
}
|
|
1022
1256
|
//#endregion
|
|
1023
1257
|
//#region ../core/src/data/namedDataScope.js
|
|
@@ -1087,7 +1321,7 @@ var Xe = class {
|
|
|
1087
1321
|
for (let e of this.#t.values()) e.dispose();
|
|
1088
1322
|
this.#t.clear();
|
|
1089
1323
|
}
|
|
1090
|
-
},
|
|
1324
|
+
}, G = "VISIT_SKIP", K = "VISIT_STOP", q = (e) => e, Qe = class {
|
|
1091
1325
|
spec;
|
|
1092
1326
|
namedDataScope;
|
|
1093
1327
|
#e;
|
|
@@ -1102,16 +1336,16 @@ var Xe = class {
|
|
|
1102
1336
|
#l = void 0;
|
|
1103
1337
|
#u = !1;
|
|
1104
1338
|
#d = [];
|
|
1105
|
-
opacityFunction =
|
|
1339
|
+
opacityFunction = q;
|
|
1106
1340
|
#f = [];
|
|
1107
1341
|
#p = "none";
|
|
1108
1342
|
#m = /* @__PURE__ */ new Map();
|
|
1109
|
-
facetCoords = new
|
|
1343
|
+
facetCoords = new ae([], JSON.stringify);
|
|
1110
1344
|
constructor(e, t, n, r, i, a = {}) {
|
|
1111
1345
|
if (!e) throw Error("View spec must be defined!");
|
|
1112
1346
|
if (this.context = t, this.layoutParent = n, this.dataParent = r, this.#t = i, this.spec = e, this.namedDataScope = new Ze(this), r && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
|
|
1113
1347
|
let o = r ? r.getConfigScopes() : [t.getBaseConfig()], s = e.config;
|
|
1114
|
-
|
|
1348
|
+
this.#e = [...o, s].filter((e) => !!e), this.resolutions = {
|
|
1115
1349
|
scale: {},
|
|
1116
1350
|
axis: {},
|
|
1117
1351
|
legend: {}
|
|
@@ -1122,18 +1356,17 @@ var Xe = class {
|
|
|
1122
1356
|
}, this.flowHandle = void 0, this.needsAxes = {
|
|
1123
1357
|
x: !1,
|
|
1124
1358
|
y: !1
|
|
1125
|
-
}, this.paramRuntime = new
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
}
|
|
1359
|
+
}, this.paramRuntime = new z(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, { snapTransitionedUpdates: !0 }), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => oe("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
|
|
1360
|
+
let c = [...e.params ?? [], ...Ye(e) ?? []];
|
|
1361
|
+
for (let e of c) {
|
|
1362
|
+
if ("expr" in e) {
|
|
1363
|
+
let { usesScaleHelper: t, globals: n } = f(e.expr), r = n.some((e) => this.paramRuntime.isPendingParam(e));
|
|
1364
|
+
if (t || r) {
|
|
1365
|
+
this.paramRuntime.registerParam(e, { defer: !0 }), this.#d.push(e.name);
|
|
1366
|
+
continue;
|
|
1134
1367
|
}
|
|
1135
|
-
this.paramRuntime.registerParam(n);
|
|
1136
1368
|
}
|
|
1369
|
+
this.paramRuntime.registerParam(e);
|
|
1137
1370
|
}
|
|
1138
1371
|
this.options.layoutSizeParams !== "inherit" && (this.#a = this.#h("width"), this.#o = this.#h("height"));
|
|
1139
1372
|
}
|
|
@@ -1153,20 +1386,20 @@ var Xe = class {
|
|
|
1153
1386
|
return this.#t;
|
|
1154
1387
|
}
|
|
1155
1388
|
getConfig() {
|
|
1156
|
-
return
|
|
1389
|
+
return He(this.#e);
|
|
1157
1390
|
}
|
|
1158
1391
|
getCursorSpec() {
|
|
1159
1392
|
return this.spec.cursor;
|
|
1160
1393
|
}
|
|
1161
1394
|
getCursor() {
|
|
1162
|
-
let
|
|
1163
|
-
return e
|
|
1395
|
+
let e = this.getCursorSpec();
|
|
1396
|
+
return n(e) ? this.paramRuntime.evaluateAndGet(e.expr) : e;
|
|
1164
1397
|
}
|
|
1165
|
-
watchCursor(
|
|
1398
|
+
watchCursor(e, t) {
|
|
1166
1399
|
let r = this.getCursorSpec();
|
|
1167
|
-
|
|
1400
|
+
n(r) && this.paramRuntime.watchExpression(r.expr, e, {
|
|
1168
1401
|
scopeOwned: !1,
|
|
1169
|
-
registerDisposer:
|
|
1402
|
+
registerDisposer: t
|
|
1170
1403
|
});
|
|
1171
1404
|
}
|
|
1172
1405
|
getConfigScopes() {
|
|
@@ -1176,25 +1409,25 @@ var Xe = class {
|
|
|
1176
1409
|
return this.facetCoords.values().next().value;
|
|
1177
1410
|
}
|
|
1178
1411
|
getPadding() {
|
|
1179
|
-
return this._cache("size/padding", () =>
|
|
1412
|
+
return this._cache("size/padding", () => k.createFromConfig(this.spec.padding));
|
|
1180
1413
|
}
|
|
1181
1414
|
getOverhang() {
|
|
1182
|
-
return
|
|
1415
|
+
return k.zero();
|
|
1183
1416
|
}
|
|
1184
1417
|
isScrollable() {
|
|
1185
1418
|
return this.spec.viewportWidth != null || this.spec.viewportHeight != null;
|
|
1186
1419
|
}
|
|
1187
1420
|
getSize() {
|
|
1188
|
-
return this._cache("size/size", () => this.isConfiguredVisible() ? new y(this.#g("width"), this.#g("height")) :
|
|
1421
|
+
return this._cache("size/size", () => this.isConfiguredVisible() ? new y(this.#g("width"), this.#g("height")) : x);
|
|
1189
1422
|
}
|
|
1190
1423
|
getViewportSize() {
|
|
1191
1424
|
if (!this.isScrollable()) return this.getSize();
|
|
1192
|
-
if (!this.isConfiguredVisible()) return
|
|
1425
|
+
if (!this.isConfiguredVisible()) return x;
|
|
1193
1426
|
let e = this.getSize();
|
|
1194
1427
|
return new y(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
|
|
1195
1428
|
}
|
|
1196
1429
|
#g(e) {
|
|
1197
|
-
let { value: t, implicit: n } = this.#_(e), r = this.resolveSizeValue(e, t), i =
|
|
1430
|
+
let { value: t, implicit: n } = this.#_(e), r = this.resolveSizeValue(e, t), i = J(r), a = e == "viewportWidth" || e == "viewportHeight";
|
|
1198
1431
|
if (i) {
|
|
1199
1432
|
if (a) throw new _(`Cannot use step-based size with "${e}"!`, this);
|
|
1200
1433
|
let t = this.#x(e, r), i = this.getScaleResolution(e == "width" ? "x" : "y")?.getScale();
|
|
@@ -1203,14 +1436,14 @@ var Xe = class {
|
|
|
1203
1436
|
if (v(i.type)) n = i.domain().length;
|
|
1204
1437
|
else if (["locus", "index"].includes(i.type)) {
|
|
1205
1438
|
let e = i.domain();
|
|
1206
|
-
n =
|
|
1439
|
+
n = m(e) - e[0];
|
|
1207
1440
|
} else throw new _(`Cannot use step-based size with "${i.type}" scale!`, this);
|
|
1208
1441
|
let a = i;
|
|
1209
|
-
n =
|
|
1442
|
+
n = ie(n, a.paddingInner(), a.paddingOuter());
|
|
1210
1443
|
let o = e == "width" ? "xOffset" : "yOffset", s = this.getScaleResolution(o)?.getScale(), c = r.for ?? (s && v(s.type) ? "offset" : "position"), l = t;
|
|
1211
1444
|
if (c == "offset") {
|
|
1212
1445
|
if (!s || !v(s.type)) throw new _(`Cannot use ${e}.step.for = "offset" without a discrete ${o} scale!`, this);
|
|
1213
|
-
let t = s, n =
|
|
1446
|
+
let t = s, n = ie(s.domain().length, t.paddingInner(), t.paddingOuter());
|
|
1214
1447
|
l *= n / (1 - a.paddingInner());
|
|
1215
1448
|
}
|
|
1216
1449
|
return {
|
|
@@ -1238,24 +1471,24 @@ var Xe = class {
|
|
|
1238
1471
|
};
|
|
1239
1472
|
}
|
|
1240
1473
|
#v(e) {
|
|
1241
|
-
if (
|
|
1474
|
+
if (Ke(this)) return;
|
|
1242
1475
|
let t = this.getConfig().view;
|
|
1243
1476
|
if (!t) return;
|
|
1244
1477
|
let n = e == "width" ? "x" : "y", r = this.getScaleResolution(n)?.getResolvedScaleType();
|
|
1245
1478
|
return r && !v(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
|
|
1246
1479
|
}
|
|
1247
|
-
resolveSizeValue(
|
|
1248
|
-
if (!
|
|
1249
|
-
let r = this.#C(
|
|
1480
|
+
resolveSizeValue(e, t) {
|
|
1481
|
+
if (!n(t)) return t;
|
|
1482
|
+
let r = this.#C(e)();
|
|
1250
1483
|
if (rt(r) || r === "container") return r;
|
|
1251
|
-
throw new _(`"${
|
|
1484
|
+
throw new _(`"${e}" ExprRef must resolve to a finite number or "container"!`, this);
|
|
1252
1485
|
}
|
|
1253
1486
|
registerSizeInvalidation() {
|
|
1254
1487
|
this.#y("width", "x"), this.#y("height", "y"), this.#b("width"), this.#b("height"), this.#b("viewportWidth"), this.#b("viewportHeight");
|
|
1255
1488
|
}
|
|
1256
1489
|
#y(e, t) {
|
|
1257
1490
|
let { value: n, implicit: r } = this.#_(e);
|
|
1258
|
-
if (!
|
|
1491
|
+
if (!J(n)) return;
|
|
1259
1492
|
let i = this.getScaleResolution(t);
|
|
1260
1493
|
if (!i) {
|
|
1261
1494
|
if (r) return;
|
|
@@ -1272,14 +1505,14 @@ var Xe = class {
|
|
|
1272
1505
|
n && v(n.getResolvedScaleType()) && (n.addEventListener("domain", a), this.registerDisposer(() => n.removeEventListener("domain", a)));
|
|
1273
1506
|
}
|
|
1274
1507
|
}
|
|
1275
|
-
#b(
|
|
1276
|
-
let { value:
|
|
1277
|
-
|
|
1508
|
+
#b(e) {
|
|
1509
|
+
let { value: t } = this.#_(e);
|
|
1510
|
+
n(t) ? this.#S(e, t.expr) : J(t) && n(t.step) && this.#S(e + ".step", t.step.expr);
|
|
1278
1511
|
}
|
|
1279
|
-
#x(
|
|
1280
|
-
let r =
|
|
1512
|
+
#x(e, t) {
|
|
1513
|
+
let r = n(t.step) ? this.#C(e + ".step")() : t.step;
|
|
1281
1514
|
if (rt(r)) return r;
|
|
1282
|
-
throw new _(`"${
|
|
1515
|
+
throw new _(`"${e}.step" ExprRef must resolve to a finite number!`, this);
|
|
1283
1516
|
}
|
|
1284
1517
|
#S(e, t) {
|
|
1285
1518
|
if (!this.#m.has(e)) {
|
|
@@ -1324,7 +1557,7 @@ var Xe = class {
|
|
|
1324
1557
|
return this.opacityFunction(1);
|
|
1325
1558
|
}
|
|
1326
1559
|
hasLocalOpacity() {
|
|
1327
|
-
return this.opacityFunction !==
|
|
1560
|
+
return this.opacityFunction !== q;
|
|
1328
1561
|
}
|
|
1329
1562
|
getPathString() {
|
|
1330
1563
|
return this.getLayoutAncestors().map((e) => e.name).reverse().join("/");
|
|
@@ -1400,17 +1633,17 @@ var Xe = class {
|
|
|
1400
1633
|
}, this.visit(e);
|
|
1401
1634
|
}
|
|
1402
1635
|
configurePostScaleParams() {
|
|
1403
|
-
let e =
|
|
1636
|
+
let e = this.#d;
|
|
1404
1637
|
if (e.length && !this.#u) {
|
|
1405
1638
|
this.#u = !0, this.#l = !1;
|
|
1406
|
-
for (let t of e) this.paramRuntime.
|
|
1639
|
+
for (let t of e) this.paramRuntime.getValue(t);
|
|
1407
1640
|
this.registerDisposer(this._addBroadcastHandler("subtreeDataReady", () => {
|
|
1408
1641
|
this.#l = !0, this.#T();
|
|
1409
1642
|
}));
|
|
1410
1643
|
}
|
|
1411
1644
|
}
|
|
1412
1645
|
configureViewOpacity() {
|
|
1413
|
-
(!this.opacityFunction || this.opacityFunction ===
|
|
1646
|
+
(!this.opacityFunction || this.opacityFunction === q) && (this.opacityFunction = et(this));
|
|
1414
1647
|
}
|
|
1415
1648
|
finalizeParamRuntimeInitialization() {
|
|
1416
1649
|
this.#l === void 0 ? this.paramRuntime.finalizeInitialization() : this.#T();
|
|
@@ -1422,8 +1655,8 @@ var Xe = class {
|
|
|
1422
1655
|
return this.#s;
|
|
1423
1656
|
}
|
|
1424
1657
|
arrange(e, t, n = {}) {
|
|
1425
|
-
if (n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId,
|
|
1426
|
-
let e = this.getOverhang(), n = this.layoutParent ?
|
|
1658
|
+
if (n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, p(t, u(n))), this.#a || this.#o) {
|
|
1659
|
+
let e = this.getOverhang(), n = this.layoutParent ? k.zero() : this.getPadding();
|
|
1427
1660
|
this.#a?.(t.width - e.width - n.width), this.#o?.(t.height - e.height - n.height);
|
|
1428
1661
|
}
|
|
1429
1662
|
this.#c = !0, this.#T();
|
|
@@ -1444,7 +1677,7 @@ var Xe = class {
|
|
|
1444
1677
|
}
|
|
1445
1678
|
getFacetFields(e) {
|
|
1446
1679
|
let t = this.getEncoding().sample;
|
|
1447
|
-
return
|
|
1680
|
+
return l(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
|
|
1448
1681
|
}
|
|
1449
1682
|
usesSampleFacetRendering() {
|
|
1450
1683
|
return this.layoutParent?.usesSampleFacetRendering() ?? !1;
|
|
@@ -1456,15 +1689,15 @@ var Xe = class {
|
|
|
1456
1689
|
};
|
|
1457
1690
|
}
|
|
1458
1691
|
getScaleResolution(e) {
|
|
1459
|
-
let t =
|
|
1692
|
+
let t = i(e);
|
|
1460
1693
|
return this.getDataAncestors().map((e) => e.resolutions.scale[t]).find((e) => e);
|
|
1461
1694
|
}
|
|
1462
1695
|
getAxisResolution(e) {
|
|
1463
|
-
let t =
|
|
1696
|
+
let t = i(e);
|
|
1464
1697
|
return this.getDataAncestors().map((e) => e.resolutions.axis[t]).find((e) => e);
|
|
1465
1698
|
}
|
|
1466
1699
|
getLegendResolution(e) {
|
|
1467
|
-
let t =
|
|
1700
|
+
let t = i(e);
|
|
1468
1701
|
return this.getDataAncestors().map((e) => e.resolutions.legend[t]).find((e) => e);
|
|
1469
1702
|
}
|
|
1470
1703
|
getConfiguredResolution(e, t) {
|
|
@@ -1477,14 +1710,14 @@ var Xe = class {
|
|
|
1477
1710
|
return "independent";
|
|
1478
1711
|
}
|
|
1479
1712
|
getBaseUrl() {
|
|
1480
|
-
return
|
|
1713
|
+
return j(() => this.dataParent?.getBaseUrl(), Be(this.spec.baseUrl));
|
|
1481
1714
|
}
|
|
1482
1715
|
isPickingSupported() {
|
|
1483
1716
|
return !0;
|
|
1484
1717
|
}
|
|
1485
1718
|
getTitleText() {
|
|
1486
|
-
let
|
|
1487
|
-
if (
|
|
1719
|
+
let e = this.spec.title;
|
|
1720
|
+
if (e) return s(e) ? e : n(e.text) ? this.paramRuntime.evaluateAndGet(e.text.expr) : e.text;
|
|
1488
1721
|
}
|
|
1489
1722
|
_cache(e, t) {
|
|
1490
1723
|
return te(this, e, t);
|
|
@@ -1511,13 +1744,13 @@ var Xe = class {
|
|
|
1511
1744
|
function $e(e) {
|
|
1512
1745
|
return "unitsPerPixel" in e;
|
|
1513
1746
|
}
|
|
1514
|
-
function et(
|
|
1515
|
-
let
|
|
1516
|
-
if (
|
|
1517
|
-
if (
|
|
1518
|
-
if ($e(
|
|
1519
|
-
let r = (
|
|
1520
|
-
let n =
|
|
1747
|
+
function et(e) {
|
|
1748
|
+
let t = "opacity" in e.spec ? e.spec.opacity : void 0;
|
|
1749
|
+
if (t !== void 0) {
|
|
1750
|
+
if (h(t)) return (e) => e * t;
|
|
1751
|
+
if ($e(t)) {
|
|
1752
|
+
let r = (t) => {
|
|
1753
|
+
let n = e.getScaleResolution(t), r = n?.getScale();
|
|
1521
1754
|
if ([
|
|
1522
1755
|
"linear",
|
|
1523
1756
|
"index",
|
|
@@ -1526,42 +1759,42 @@ function et(t) {
|
|
|
1526
1759
|
scale: r,
|
|
1527
1760
|
scaleResolution: n
|
|
1528
1761
|
};
|
|
1529
|
-
},
|
|
1530
|
-
if (!
|
|
1531
|
-
let
|
|
1532
|
-
let
|
|
1533
|
-
|
|
1762
|
+
}, i = nt(t.values, "opacity.values", e);
|
|
1763
|
+
if (!d(t.unitsPerPixel)) throw new _("\"opacity.unitsPerPixel\" must be an array.", e);
|
|
1764
|
+
let a = () => 1, o = [], s = () => {
|
|
1765
|
+
let t = tt(nt(o.map((e) => e()), "opacity.unitsPerPixel", e), i, e), n = re().domain(t.unitsPerPixel).range(t.values).clamp(!0);
|
|
1766
|
+
a = (e) => n(e);
|
|
1534
1767
|
};
|
|
1535
|
-
|
|
1536
|
-
if (
|
|
1537
|
-
let
|
|
1538
|
-
|
|
1768
|
+
o = t.unitsPerPixel.map((t) => {
|
|
1769
|
+
if (n(t)) {
|
|
1770
|
+
let n = e.paramRuntime.watchExpression(t.expr, () => {
|
|
1771
|
+
s(), e.context.animator.requestRender();
|
|
1539
1772
|
});
|
|
1540
|
-
return () =>
|
|
1541
|
-
} else return () =>
|
|
1542
|
-
}),
|
|
1543
|
-
let
|
|
1773
|
+
return () => n(null);
|
|
1774
|
+
} else return () => t;
|
|
1775
|
+
}), s();
|
|
1776
|
+
let c = (e) => {
|
|
1544
1777
|
let t = e.scaleResolution.getAxisLength() || 1e3;
|
|
1545
|
-
return
|
|
1546
|
-
},
|
|
1547
|
-
if (
|
|
1548
|
-
let
|
|
1549
|
-
if (
|
|
1550
|
-
else if (
|
|
1551
|
-
else if (n)
|
|
1552
|
-
else throw new _("Cannot find a resolved quantitative x or y scale for dynamic opacity!",
|
|
1778
|
+
return ee(e.scale.domain()) / t;
|
|
1779
|
+
}, l;
|
|
1780
|
+
if (t.channel === "auto") {
|
|
1781
|
+
let t = r("x"), n = r("y");
|
|
1782
|
+
if (t && n) l = () => (c(t) + c(n)) / 2;
|
|
1783
|
+
else if (t) l = () => c(t);
|
|
1784
|
+
else if (n) l = () => c(n);
|
|
1785
|
+
else throw new _("Cannot find a resolved quantitative x or y scale for dynamic opacity!", e);
|
|
1553
1786
|
} else {
|
|
1554
|
-
let
|
|
1555
|
-
if (!
|
|
1556
|
-
|
|
1787
|
+
let n = t.channel ? r(t.channel) : r("x") ?? r("y");
|
|
1788
|
+
if (!n) throw new _("Cannot find a resolved quantitative scale for dynamic opacity!", e);
|
|
1789
|
+
l = () => c(n);
|
|
1557
1790
|
}
|
|
1558
|
-
return (e) =>
|
|
1559
|
-
} else if (
|
|
1560
|
-
let
|
|
1561
|
-
return (
|
|
1791
|
+
return (e) => a(l()) * e;
|
|
1792
|
+
} else if (n(t)) {
|
|
1793
|
+
let n = e.paramRuntime.watchExpression(t.expr, () => e.context.animator.requestRender());
|
|
1794
|
+
return (e) => n(null) * e;
|
|
1562
1795
|
}
|
|
1563
1796
|
}
|
|
1564
|
-
return
|
|
1797
|
+
return q;
|
|
1565
1798
|
}
|
|
1566
1799
|
function tt(e, t, n) {
|
|
1567
1800
|
if (!e.length) throw new _("\"opacity.unitsPerPixel\" must contain at least one stop.", n);
|
|
@@ -1581,50 +1814,50 @@ function tt(e, t, n) {
|
|
|
1581
1814
|
values: a
|
|
1582
1815
|
};
|
|
1583
1816
|
}
|
|
1584
|
-
function nt(e, t,
|
|
1585
|
-
if (!
|
|
1586
|
-
return e.map((e,
|
|
1587
|
-
if (!
|
|
1817
|
+
function nt(e, t, n) {
|
|
1818
|
+
if (!d(e)) throw new _("\"" + t + "\" must evaluate to an array.", n);
|
|
1819
|
+
return e.map((e, r) => {
|
|
1820
|
+
if (!h(e) || !Number.isFinite(e)) throw new _("Invalid " + t + " value at index " + r + ". Expected a finite number.", n);
|
|
1588
1821
|
return e;
|
|
1589
1822
|
});
|
|
1590
1823
|
}
|
|
1591
|
-
var
|
|
1824
|
+
var J = (e) => !!e && typeof e == "object" && "step" in e;
|
|
1592
1825
|
function rt(e) {
|
|
1593
1826
|
return typeof e == "number" && Number.isFinite(e);
|
|
1594
1827
|
}
|
|
1595
|
-
var
|
|
1828
|
+
var Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap();
|
|
1596
1829
|
function it(e, t) {
|
|
1597
|
-
|
|
1830
|
+
ot(e, t, "Import");
|
|
1598
1831
|
}
|
|
1599
1832
|
function at(e, t) {
|
|
1600
|
-
|
|
1833
|
+
ot(e, t, "View");
|
|
1601
1834
|
}
|
|
1602
|
-
function
|
|
1835
|
+
function ot(e, t, n) {
|
|
1603
1836
|
if (t !== null && typeof t != "string") throw Error(n + " scope name must be a string or null.");
|
|
1604
|
-
|
|
1837
|
+
Y.set(e, { name: t });
|
|
1605
1838
|
}
|
|
1606
|
-
function
|
|
1607
|
-
return
|
|
1839
|
+
function st(e) {
|
|
1840
|
+
return Y.get(e);
|
|
1608
1841
|
}
|
|
1609
|
-
function
|
|
1842
|
+
function ct(e, t = {}) {
|
|
1610
1843
|
let n = t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude";
|
|
1611
|
-
|
|
1844
|
+
X.set(e, n);
|
|
1612
1845
|
}
|
|
1613
|
-
function
|
|
1614
|
-
|
|
1846
|
+
function lt(e, t = {}) {
|
|
1847
|
+
Ue(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
|
|
1615
1848
|
}
|
|
1616
|
-
function
|
|
1617
|
-
return e.getLayoutAncestors().some(
|
|
1849
|
+
function ut(e) {
|
|
1850
|
+
return e.getLayoutAncestors().some(Ge);
|
|
1618
1851
|
}
|
|
1619
1852
|
function Z(e) {
|
|
1620
1853
|
let t = e.getDataAncestors(), n = [];
|
|
1621
1854
|
for (let e = t.length - 1; e >= 0; --e) {
|
|
1622
|
-
let r =
|
|
1855
|
+
let r = Y.get(t[e]);
|
|
1623
1856
|
r && typeof r.name == "string" && n.push(r.name);
|
|
1624
1857
|
}
|
|
1625
1858
|
return n;
|
|
1626
1859
|
}
|
|
1627
|
-
function
|
|
1860
|
+
function dt(e) {
|
|
1628
1861
|
let t = e.explicitName;
|
|
1629
1862
|
if (!t) throw Error("Cannot build a selector for a view without a name.");
|
|
1630
1863
|
return {
|
|
@@ -1632,43 +1865,43 @@ function ut(e) {
|
|
|
1632
1865
|
view: t
|
|
1633
1866
|
};
|
|
1634
1867
|
}
|
|
1635
|
-
function
|
|
1868
|
+
function ft(e, t) {
|
|
1636
1869
|
if (!t) throw Error("Cannot build a selector for a parameter without a name.");
|
|
1637
1870
|
return {
|
|
1638
1871
|
scope: Z(e),
|
|
1639
1872
|
param: t
|
|
1640
1873
|
};
|
|
1641
1874
|
}
|
|
1642
|
-
function
|
|
1643
|
-
return
|
|
1875
|
+
function pt(e) {
|
|
1876
|
+
return xt(e), "p:" + JSON.stringify({
|
|
1644
1877
|
scope: e.scope,
|
|
1645
1878
|
param: e.param
|
|
1646
1879
|
});
|
|
1647
1880
|
}
|
|
1648
|
-
function
|
|
1881
|
+
function mt(e, t) {
|
|
1649
1882
|
e.visit((e) => {
|
|
1650
|
-
let n =
|
|
1651
|
-
if (n === "excludeSubtree") return
|
|
1883
|
+
let n = We(e);
|
|
1884
|
+
if (n === "excludeSubtree") return G;
|
|
1652
1885
|
if (n !== "exclude") return t(e);
|
|
1653
1886
|
});
|
|
1654
1887
|
}
|
|
1655
|
-
function
|
|
1888
|
+
function ht(e, t) {
|
|
1656
1889
|
e.visit((e) => {
|
|
1657
|
-
let n =
|
|
1658
|
-
if (n === "excludeSubtree") return
|
|
1890
|
+
let n = X.get(e);
|
|
1891
|
+
if (n === "excludeSubtree") return G;
|
|
1659
1892
|
if (n !== "exclude") return t(e);
|
|
1660
1893
|
});
|
|
1661
1894
|
}
|
|
1662
|
-
function
|
|
1663
|
-
if (
|
|
1895
|
+
function gt(e, t) {
|
|
1896
|
+
if (St(t), !At(e, t.scope)) return;
|
|
1664
1897
|
let n = [];
|
|
1665
1898
|
if ($(e, t.scope, (e) => {
|
|
1666
1899
|
e.explicitName === t.view && n.push(e);
|
|
1667
1900
|
}, { includeNamedImportRoots: !0 }), n.length === 1) return n[0];
|
|
1668
1901
|
if (n.length !== 0) throw Error("View selector is ambiguous for view \"" + t.view + "\" in scope " + JSON.stringify(t.scope));
|
|
1669
1902
|
}
|
|
1670
|
-
function
|
|
1671
|
-
if (
|
|
1903
|
+
function _t(e, t) {
|
|
1904
|
+
if (xt(t), !At(e, t.scope)) return;
|
|
1672
1905
|
let n = [];
|
|
1673
1906
|
if ($(e, t.scope, (e) => {
|
|
1674
1907
|
for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Q(i) && n.push({
|
|
@@ -1678,54 +1911,54 @@ function gt(e, t) {
|
|
|
1678
1911
|
}), n.length === 1) return n[0];
|
|
1679
1912
|
if (n.length !== 0) throw Error("Param selector is ambiguous for param \"" + t.param + "\" in scope " + JSON.stringify(t.scope));
|
|
1680
1913
|
}
|
|
1681
|
-
function
|
|
1914
|
+
function vt(e, t) {
|
|
1682
1915
|
e.visit((e) => {
|
|
1683
|
-
let n =
|
|
1684
|
-
if (n === "excludeSubtree") return
|
|
1916
|
+
let n = X.get(e);
|
|
1917
|
+
if (n === "excludeSubtree") return G;
|
|
1685
1918
|
if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Q(r) && t({
|
|
1686
1919
|
view: e,
|
|
1687
1920
|
param: r,
|
|
1688
|
-
selector:
|
|
1921
|
+
selector: ft(e, n)
|
|
1689
1922
|
});
|
|
1690
1923
|
});
|
|
1691
1924
|
}
|
|
1692
|
-
function
|
|
1925
|
+
function yt(e) {
|
|
1693
1926
|
let t = [];
|
|
1694
|
-
return
|
|
1927
|
+
return vt(e, (e) => t.push(e)), t;
|
|
1695
1928
|
}
|
|
1696
|
-
function
|
|
1929
|
+
function bt(e) {
|
|
1697
1930
|
let t = [];
|
|
1698
|
-
for (let n of
|
|
1699
|
-
let r =
|
|
1700
|
-
|
|
1931
|
+
for (let n of Ct(e)) {
|
|
1932
|
+
let r = wt(n);
|
|
1933
|
+
Et(e, r, t), Dt(e, r, t);
|
|
1701
1934
|
}
|
|
1702
1935
|
return t;
|
|
1703
1936
|
}
|
|
1704
|
-
function
|
|
1937
|
+
function xt(e) {
|
|
1705
1938
|
if (!e || !Array.isArray(e.scope)) throw Error("Param selector scope must be an array.");
|
|
1706
1939
|
if (typeof e.param != "string" || !e.param.length) throw Error("Param selector param must be a non-empty string.");
|
|
1707
1940
|
}
|
|
1708
|
-
function
|
|
1941
|
+
function St(e) {
|
|
1709
1942
|
if (!e || !Array.isArray(e.scope)) throw Error("View selector scope must be an array.");
|
|
1710
1943
|
if (typeof e.view != "string" || !e.view.length) throw Error("View selector view must be a non-empty string.");
|
|
1711
1944
|
}
|
|
1712
|
-
function Q(
|
|
1713
|
-
return
|
|
1945
|
+
function Q(t) {
|
|
1946
|
+
return t.persist === !1 ? !1 : e(t) ? !0 : c(t) ? !!t.bind : !1;
|
|
1714
1947
|
}
|
|
1715
|
-
function
|
|
1948
|
+
function Ct(e) {
|
|
1716
1949
|
let t = /* @__PURE__ */ new Set([e]);
|
|
1717
1950
|
return e.visit((e) => {
|
|
1718
|
-
let n =
|
|
1951
|
+
let n = Y.get(e);
|
|
1719
1952
|
n && typeof n.name == "string" && t.add(e);
|
|
1720
1953
|
}), Array.from(t);
|
|
1721
1954
|
}
|
|
1722
|
-
function
|
|
1955
|
+
function wt(e) {
|
|
1723
1956
|
return Z(e);
|
|
1724
1957
|
}
|
|
1725
|
-
function
|
|
1958
|
+
function Tt(e) {
|
|
1726
1959
|
return e.length ? "import scope [" + e.join(" / ") + "]" : "import scope (root)";
|
|
1727
1960
|
}
|
|
1728
|
-
function
|
|
1961
|
+
function Et(e, t, n) {
|
|
1729
1962
|
let r = /* @__PURE__ */ new Map();
|
|
1730
1963
|
$(e, t, (e) => {
|
|
1731
1964
|
for (let [t, n] of e.paramRuntime.paramConfigs) {
|
|
@@ -1738,53 +1971,53 @@ function Tt(e, t, n) {
|
|
|
1738
1971
|
if (i.length <= 1) continue;
|
|
1739
1972
|
let r = i.map((e) => e.getPathString()).join(", ");
|
|
1740
1973
|
n.push({
|
|
1741
|
-
message: "Bookmarkable parameter \"" + e + "\" is not unique within " +
|
|
1974
|
+
message: "Bookmarkable parameter \"" + e + "\" is not unique within " + Tt(t) + ". Found in: " + r + ".",
|
|
1742
1975
|
scope: t
|
|
1743
1976
|
});
|
|
1744
1977
|
}
|
|
1745
1978
|
}
|
|
1746
|
-
function
|
|
1747
|
-
let r =
|
|
1979
|
+
function Dt(e, t, n) {
|
|
1980
|
+
let r = Ot(e, t);
|
|
1748
1981
|
if (!r.length) return;
|
|
1749
|
-
let i = r.filter((e) =>
|
|
1982
|
+
let i = r.filter((e) => kt(e));
|
|
1750
1983
|
if (i.length <= 1) return;
|
|
1751
1984
|
let a = /* @__PURE__ */ new Map();
|
|
1752
1985
|
for (let e of i) {
|
|
1753
|
-
let t =
|
|
1986
|
+
let t = Y.get(e), n = t ? t.name : void 0;
|
|
1754
1987
|
typeof n != "string" || !n.length || a.set(n, (a.get(n) ?? 0) + 1);
|
|
1755
1988
|
}
|
|
1756
1989
|
for (let [e, r] of a) r > 1 && n.push({
|
|
1757
|
-
message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " +
|
|
1990
|
+
message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + Tt(t) + ".",
|
|
1758
1991
|
scope: t
|
|
1759
1992
|
});
|
|
1760
1993
|
}
|
|
1761
|
-
function
|
|
1994
|
+
function Ot(e, t) {
|
|
1762
1995
|
let n = [];
|
|
1763
1996
|
return $(e, t, (e) => {
|
|
1764
1997
|
if (Z(e).length !== t.length + 1) return;
|
|
1765
|
-
let r =
|
|
1998
|
+
let r = Y.get(e);
|
|
1766
1999
|
!r || typeof r.name != "string" || n.push(e);
|
|
1767
2000
|
}, { includeNamedImportRoots: !0 }), n;
|
|
1768
2001
|
}
|
|
1769
|
-
function
|
|
2002
|
+
function kt(e) {
|
|
1770
2003
|
let t = !1;
|
|
1771
2004
|
return e.visit((e) => {
|
|
1772
|
-
let n =
|
|
1773
|
-
if (n === "excludeSubtree") return
|
|
2005
|
+
let n = X.get(e);
|
|
2006
|
+
if (n === "excludeSubtree") return G;
|
|
1774
2007
|
if (n !== "exclude") {
|
|
1775
|
-
for (let n of e.paramRuntime.paramConfigs.values()) if (Q(n)) return t = !0,
|
|
2008
|
+
for (let n of e.paramRuntime.paramConfigs.values()) if (Q(n)) return t = !0, K;
|
|
1776
2009
|
}
|
|
1777
2010
|
}), t;
|
|
1778
2011
|
}
|
|
1779
|
-
function
|
|
2012
|
+
function At(e, t) {
|
|
1780
2013
|
let n = e, r = [];
|
|
1781
2014
|
for (let i of t) {
|
|
1782
2015
|
if (typeof i != "string" || !i.length) throw Error("Scope names must be non-empty strings.");
|
|
1783
2016
|
let t, a = !1;
|
|
1784
2017
|
if ($(e, r, (e) => {
|
|
1785
|
-
let n =
|
|
2018
|
+
let n = Y.get(e);
|
|
1786
2019
|
if (!(!n || n.name !== i) && Z(e).length === r.length + 1) {
|
|
1787
|
-
if (t) return a = !0,
|
|
2020
|
+
if (t) return a = !0, K;
|
|
1788
2021
|
t = e;
|
|
1789
2022
|
}
|
|
1790
2023
|
}, { includeNamedImportRoots: !0 }), a) throw Error("Multiple import instances named \"" + i + "\" in scope.");
|
|
@@ -1796,22 +2029,22 @@ function kt(e, t) {
|
|
|
1796
2029
|
function $(e, t, n, r = {}) {
|
|
1797
2030
|
let i = r.includeNamedImportRoots ?? !1;
|
|
1798
2031
|
e.visit((e) => {
|
|
1799
|
-
let r =
|
|
1800
|
-
if (a === "excludeSubtree") return
|
|
1801
|
-
if (a !== "exclude" &&
|
|
2032
|
+
let r = Y.get(e), a = X.get(e);
|
|
2033
|
+
if (a === "excludeSubtree") return G;
|
|
2034
|
+
if (a !== "exclude" && jt(e, t, r, i)) return n(e);
|
|
1802
2035
|
});
|
|
1803
2036
|
}
|
|
1804
|
-
function
|
|
2037
|
+
function jt(e, t, n, r) {
|
|
1805
2038
|
let i = Z(e);
|
|
1806
|
-
return
|
|
1807
|
-
}
|
|
1808
|
-
function jt(e, t) {
|
|
1809
|
-
return e.length === t.length && Mt(e, t);
|
|
2039
|
+
return Mt(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : Nt(t, i);
|
|
1810
2040
|
}
|
|
1811
2041
|
function Mt(e, t) {
|
|
2042
|
+
return e.length === t.length && Nt(e, t);
|
|
2043
|
+
}
|
|
2044
|
+
function Nt(e, t) {
|
|
1812
2045
|
if (e.length > t.length) return !1;
|
|
1813
2046
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
1814
2047
|
return !0;
|
|
1815
2048
|
}
|
|
1816
2049
|
//#endregion
|
|
1817
|
-
export {
|
|
2050
|
+
export { M as A, se as B, ze as C, Ne as D, R as E, b as F, de as H, ue as I, ce as L, k as M, ye as N, N as O, y as P, E as R, He as S, Fe as T, le as U, me as V, K as _, ut as a, Ge as b, ct as c, _t as d, gt as f, G as g, mt as h, dt as i, xe as j, j as k, it as l, ht as m, st as n, pt as o, bt as p, Z as r, lt as s, yt as t, at as u, Qe as v, z as w, Ke as x, Je as y, T as z };
|