@urban-toolkit/autk-grammar 0.1.1 → 0.1.3

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.
@@ -1,83 +1,83 @@
1
- import { NormalizationMode as R, createEngine as v } from "@urban-toolkit/the-urban-grammar";
2
- import { ColorMapInterpolator as K, NormalizationMode as X } from "@urban-toolkit/the-urban-grammar";
3
- import { AutkDb as L, DEFAULT_WORKSPACE_COORDINATE_FORMAT as C } from "@urban-toolkit/autk-db";
4
- import { AutkMap as P, MapStyle as N, ColorMapDomainStrategy as g, MapEvent as T } from "@urban-toolkit/autk-map";
5
- import { AutkPlot as x } from "@urban-toolkit/autk-plot";
6
- import { AutkComputeEngine as F } from "@urban-toolkit/autk-compute";
7
- function S(n, i) {
8
- function r(s, e) {
9
- if (!e || !e.db)
1
+ import { NormalizationMode as qe, createEngine as Ue } from "@urban-toolkit/the-urban-grammar";
2
+ import { ColorMapInterpolator as va, NormalizationMode as wa } from "@urban-toolkit/the-urban-grammar";
3
+ import { AutkDb as Je, DEFAULT_WORKSPACE_COORDINATE_FORMAT as Te } from "@urban-toolkit/autk-db";
4
+ import { AutkMap as Xe, MapStyle as Ke, MapEvent as be } from "@urban-toolkit/autk-map";
5
+ import { AutkPlot as We, PlotEvent as K } from "@urban-toolkit/autk-plot";
6
+ import { AutkComputeEngine as Ve } from "@urban-toolkit/autk-compute";
7
+ function Qe(e, f) {
8
+ function a(d, c) {
9
+ if (!c || !c.db)
10
10
  return;
11
- const t = document.getElementById(e.db);
11
+ const t = document.getElementById(c.db);
12
12
  if (t) {
13
- const c = s.tables;
13
+ const b = d.tables;
14
14
  t.innerHTML += "<ul>";
15
- for (const u of c)
16
- t.innerHTML += `<li>${u.name}: (${u.source}, ${u.type}) </li>`;
17
- t.innerHTML += "</ul>", t.innerHTML += `<p>Number of tables: ${c.length}</p>`;
15
+ for (const n of b)
16
+ t.innerHTML += `<li>${n.name}: (${n.source}, ${n.type}) </li>`;
17
+ t.innerHTML += "</ul>", t.innerHTML += `<p>Number of tables: ${b.length}</p>`;
18
18
  }
19
19
  }
20
20
  return {
21
- async resolveSource(s, e) {
22
- let t = s;
23
- t || (t = new L(), await t.init());
24
- let { type: c, ...u } = e;
25
- switch (c) {
21
+ async resolveSource(d, c) {
22
+ let t = d;
23
+ t || (t = new Je(), await t.init());
24
+ let { type: b, ...n } = c;
25
+ switch (b) {
26
26
  case "osm":
27
- return await t.loadOsm(u), r(t, n), t;
27
+ return await t.loadOsm(n), a(t, e), t;
28
28
  case "csv":
29
- return await t.loadCsv(u), r(t, n), t;
29
+ return await t.loadCsv(n), a(t, e), t;
30
30
  case "json":
31
- return await t.loadJson(u), r(t, n), t;
31
+ return await t.loadJson(n), a(t, e), t;
32
32
  case "geojson": {
33
- const a = u;
33
+ const r = n;
34
34
  let l;
35
- a.geojsonFileUrl ? l = await (await fetch(a.geojsonFileUrl)).json() : l = a.geojsonObject, i && l && i.set(a.outputTableName, l);
36
- const p = l ? (() => {
37
- const o = { ...a, geojsonObject: l };
38
- return delete o.geojsonFileUrl, o;
39
- })() : a;
35
+ r.geojsonFileUrl ? l = await (await fetch(r.geojsonFileUrl)).json() : l = r.geojsonObject, f && l && f.set(r.outputTableName, l);
36
+ const h = l ? (() => {
37
+ const i = { ...r, geojsonObject: l };
38
+ return delete i.geojsonFileUrl, i;
39
+ })() : r;
40
40
  try {
41
- await t.loadGeojson(p);
42
- } catch (o) {
43
- const m = p.coordinateFormat ? `coordinateFormat is set to "${p.coordinateFormat}"` : "no coordinateFormat was specified — defaulting to EPSG:4326 (WGS84 per RFC 7946)";
41
+ await t.loadGeojson(h);
42
+ } catch (i) {
43
+ const p = h.coordinateFormat ? `coordinateFormat is set to "${h.coordinateFormat}"` : "no coordinateFormat was specified — defaulting to EPSG:4326 (WGS84 per RFC 7946)";
44
44
  throw new Error(
45
- `Failed to load GeoJSON layer "${p.outputTableName}": ${o instanceof Error ? o.message : String(o)}. ${m}. Verify that coordinateFormat matches the actual CRS of the input data.`
45
+ `Failed to load GeoJSON layer "${h.outputTableName}": ${i instanceof Error ? i.message : String(i)}. ${p}. Verify that coordinateFormat matches the actual CRS of the input data.`
46
46
  );
47
47
  }
48
48
  try {
49
- const o = await t.getBoundingBoxFromLayer(p.outputTableName), m = 25e6;
50
- if (!isFinite(o.minLon) || !isFinite(o.minLat) || !isFinite(o.maxLon) || !isFinite(o.maxLat) || Math.abs(o.minLon) > m || Math.abs(o.maxLon) > m || Math.abs(o.minLat) > m || Math.abs(o.maxLat) > m)
49
+ const i = await t.getBoundingBoxFromLayer(h.outputTableName), p = 25e6;
50
+ if (!isFinite(i.minLon) || !isFinite(i.minLat) || !isFinite(i.maxLon) || !isFinite(i.maxLat) || Math.abs(i.minLon) > p || Math.abs(i.maxLon) > p || Math.abs(i.minLat) > p || Math.abs(i.maxLat) > p)
51
51
  throw new Error(
52
- `Geometry bounding box after transform is invalid for layer "${p.outputTableName}" (bbox: [${o.minLon}, ${o.minLat}, ${o.maxLon}, ${o.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${C}; input is expected in EPSG:4326 by default.`
52
+ `Geometry bounding box after transform is invalid for layer "${h.outputTableName}" (bbox: [${i.minLon}, ${i.minLat}, ${i.maxLon}, ${i.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${Te}; input is expected in EPSG:4326 by default.`
53
53
  );
54
- } catch (o) {
55
- if (o instanceof Error && o.message.includes("bounding box after transform")) throw o;
54
+ } catch (i) {
55
+ if (i instanceof Error && i.message.includes("bounding box after transform")) throw i;
56
56
  }
57
- return r(t, n), t;
57
+ return a(t, e), t;
58
58
  }
59
59
  case "heatmap": {
60
- const a = u;
60
+ const r = n;
61
61
  return await t.buildHeatmap({
62
- tableJoinName: a.tableJoinName,
63
- near: { distance: a.near.distance },
64
- outputTableName: a.outputTableName,
65
- grid: a.grid,
66
- ...a.groupBy && { groupBy: a.groupBy }
67
- }), r(t, n), t;
62
+ tableJoinName: r.tableJoinName,
63
+ near: { distance: r.near.distance },
64
+ outputTableName: r.outputTableName,
65
+ grid: r.grid,
66
+ ...r.groupBy && { groupBy: r.groupBy }
67
+ }), a(t, e), t;
68
68
  }
69
69
  case "join": {
70
- const a = u;
70
+ const r = n;
71
71
  if (await t.spatialQuery({
72
- tableRootName: a.tableRootName,
73
- tableJoinName: a.tableJoinName,
74
- ...a.near && { near: a.near },
75
- ...a.groupBy && { groupBy: a.groupBy }
76
- }), i) {
77
- const l = await t.getLayer(a.tableRootName);
78
- i.set(a.tableRootName, l);
72
+ tableRootName: r.tableRootName,
73
+ tableJoinName: r.tableJoinName,
74
+ ...r.near && { near: r.near },
75
+ ...r.groupBy && { groupBy: r.groupBy }
76
+ }), f) {
77
+ const l = await t.getLayer(r.tableRootName);
78
+ f.set(r.tableRootName, l);
79
79
  }
80
- return r(t, n), t;
80
+ return a(t, e), t;
81
81
  }
82
82
  default:
83
83
  return;
@@ -85,81 +85,1060 @@ function S(n, i) {
85
85
  }
86
86
  };
87
87
  }
88
- function I(n, i) {
89
- return i && i.length > 0 ? { type: g.USER, params: i } : n?.mode === R.PERCENTILE ? n.lowerPercentile !== void 0 || n.upperPercentile !== void 0 ? {
90
- type: g.PERCENTILE,
91
- params: [n.lowerPercentile ?? 0, n.upperPercentile ?? 100]
92
- } : { type: g.PERCENTILE } : { type: g.MIN_MAX };
93
- }
94
- function j(n, i) {
95
- return i.split(".").reduce((r, s) => {
96
- if (!(r == null || typeof r != "object"))
97
- return r[s];
98
- }, n);
99
- }
100
- function $(n, i, r) {
101
- const s = i.split("."), e = { ...n };
102
- let t = e;
103
- for (let c = 0; c < s.length - 1; c++)
104
- t[s[c]] = { ...t[s[c]] ?? {} }, t = t[s[c]];
105
- return t[s[s.length - 1]] = r, e;
106
- }
107
- function k(n, i, r) {
108
- async function s(e, t, c) {
109
- let u = {};
110
- for (const a of t.tables)
111
- a.type !== void 0 && (u[a.name] = a.type);
112
- for (const a of c.layerRefs) {
113
- const l = a.dataRef, p = u[l], o = a.getFnv, m = r?.get(l) ?? await t.getLayer(l), f = {
114
- ...m,
115
- features: (m.features ?? []).filter((d) => d.geometry != null)
88
+ var W = /* @__PURE__ */ (function(e) {
89
+ return e.USER = "user", e.MIN_MAX = "minMax", e.PERCENTILE = "percentile", e;
90
+ })({});
91
+ function ae(e, f, a) {
92
+ e.prototype = f.prototype = a, a.constructor = e;
93
+ }
94
+ function ne(e, f) {
95
+ var a = Object.create(e.prototype);
96
+ for (var d in f) a[d] = f[d];
97
+ return a;
98
+ }
99
+ function z() {
100
+ }
101
+ var T = 0.7, B = 1 / T, H = "\\s*([+-]?\\d+)\\s*", D = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", R = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ye = /^#([0-9a-f]{3,8})$/, Ze = RegExp(`^rgb\\(${H},${H},${H}\\)$`), ef = RegExp(`^rgb\\(${R},${R},${R}\\)$`), ff = RegExp(`^rgba\\(${H},${H},${H},${D}\\)$`), af = RegExp(`^rgba\\(${R},${R},${R},${D}\\)$`), df = RegExp(`^hsl\\(${D},${R},${R}\\)$`), cf = RegExp(`^hsla\\(${D},${R},${R},${D}\\)$`), ye = {
102
+ aliceblue: 15792383,
103
+ antiquewhite: 16444375,
104
+ aqua: 65535,
105
+ aquamarine: 8388564,
106
+ azure: 15794175,
107
+ beige: 16119260,
108
+ bisque: 16770244,
109
+ black: 0,
110
+ blanchedalmond: 16772045,
111
+ blue: 255,
112
+ blueviolet: 9055202,
113
+ brown: 10824234,
114
+ burlywood: 14596231,
115
+ cadetblue: 6266528,
116
+ chartreuse: 8388352,
117
+ chocolate: 13789470,
118
+ coral: 16744272,
119
+ cornflowerblue: 6591981,
120
+ cornsilk: 16775388,
121
+ crimson: 14423100,
122
+ cyan: 65535,
123
+ darkblue: 139,
124
+ darkcyan: 35723,
125
+ darkgoldenrod: 12092939,
126
+ darkgray: 11119017,
127
+ darkgreen: 25600,
128
+ darkgrey: 11119017,
129
+ darkkhaki: 12433259,
130
+ darkmagenta: 9109643,
131
+ darkolivegreen: 5597999,
132
+ darkorange: 16747520,
133
+ darkorchid: 10040012,
134
+ darkred: 9109504,
135
+ darksalmon: 15308410,
136
+ darkseagreen: 9419919,
137
+ darkslateblue: 4734347,
138
+ darkslategray: 3100495,
139
+ darkslategrey: 3100495,
140
+ darkturquoise: 52945,
141
+ darkviolet: 9699539,
142
+ deeppink: 16716947,
143
+ deepskyblue: 49151,
144
+ dimgray: 6908265,
145
+ dimgrey: 6908265,
146
+ dodgerblue: 2003199,
147
+ firebrick: 11674146,
148
+ floralwhite: 16775920,
149
+ forestgreen: 2263842,
150
+ fuchsia: 16711935,
151
+ gainsboro: 14474460,
152
+ ghostwhite: 16316671,
153
+ gold: 16766720,
154
+ goldenrod: 14329120,
155
+ gray: 8421504,
156
+ green: 32768,
157
+ greenyellow: 11403055,
158
+ grey: 8421504,
159
+ honeydew: 15794160,
160
+ hotpink: 16738740,
161
+ indianred: 13458524,
162
+ indigo: 4915330,
163
+ ivory: 16777200,
164
+ khaki: 15787660,
165
+ lavender: 15132410,
166
+ lavenderblush: 16773365,
167
+ lawngreen: 8190976,
168
+ lemonchiffon: 16775885,
169
+ lightblue: 11393254,
170
+ lightcoral: 15761536,
171
+ lightcyan: 14745599,
172
+ lightgoldenrodyellow: 16448210,
173
+ lightgray: 13882323,
174
+ lightgreen: 9498256,
175
+ lightgrey: 13882323,
176
+ lightpink: 16758465,
177
+ lightsalmon: 16752762,
178
+ lightseagreen: 2142890,
179
+ lightskyblue: 8900346,
180
+ lightslategray: 7833753,
181
+ lightslategrey: 7833753,
182
+ lightsteelblue: 11584734,
183
+ lightyellow: 16777184,
184
+ lime: 65280,
185
+ limegreen: 3329330,
186
+ linen: 16445670,
187
+ magenta: 16711935,
188
+ maroon: 8388608,
189
+ mediumaquamarine: 6737322,
190
+ mediumblue: 205,
191
+ mediumorchid: 12211667,
192
+ mediumpurple: 9662683,
193
+ mediumseagreen: 3978097,
194
+ mediumslateblue: 8087790,
195
+ mediumspringgreen: 64154,
196
+ mediumturquoise: 4772300,
197
+ mediumvioletred: 13047173,
198
+ midnightblue: 1644912,
199
+ mintcream: 16121850,
200
+ mistyrose: 16770273,
201
+ moccasin: 16770229,
202
+ navajowhite: 16768685,
203
+ navy: 128,
204
+ oldlace: 16643558,
205
+ olive: 8421376,
206
+ olivedrab: 7048739,
207
+ orange: 16753920,
208
+ orangered: 16729344,
209
+ orchid: 14315734,
210
+ palegoldenrod: 15657130,
211
+ palegreen: 10025880,
212
+ paleturquoise: 11529966,
213
+ palevioletred: 14381203,
214
+ papayawhip: 16773077,
215
+ peachpuff: 16767673,
216
+ peru: 13468991,
217
+ pink: 16761035,
218
+ plum: 14524637,
219
+ powderblue: 11591910,
220
+ purple: 8388736,
221
+ rebeccapurple: 6697881,
222
+ red: 16711680,
223
+ rosybrown: 12357519,
224
+ royalblue: 4286945,
225
+ saddlebrown: 9127187,
226
+ salmon: 16416882,
227
+ sandybrown: 16032864,
228
+ seagreen: 3050327,
229
+ seashell: 16774638,
230
+ sienna: 10506797,
231
+ silver: 12632256,
232
+ skyblue: 8900331,
233
+ slateblue: 6970061,
234
+ slategray: 7372944,
235
+ slategrey: 7372944,
236
+ snow: 16775930,
237
+ springgreen: 65407,
238
+ steelblue: 4620980,
239
+ tan: 13808780,
240
+ teal: 32896,
241
+ thistle: 14204888,
242
+ tomato: 16737095,
243
+ turquoise: 4251856,
244
+ violet: 15631086,
245
+ wheat: 16113331,
246
+ white: 16777215,
247
+ whitesmoke: 16119285,
248
+ yellow: 16776960,
249
+ yellowgreen: 10145074
250
+ };
251
+ ae(z, ie, {
252
+ copy(e) {
253
+ return Object.assign(new this.constructor(), this, e);
254
+ },
255
+ displayable() {
256
+ return this.rgb().displayable();
257
+ },
258
+ hex: ve,
259
+ formatHex: ve,
260
+ formatHex8: tf,
261
+ formatHsl: bf,
262
+ formatRgb: we,
263
+ toString: we
264
+ });
265
+ function ve() {
266
+ return this.rgb().formatHex();
267
+ }
268
+ function tf() {
269
+ return this.rgb().formatHex8();
270
+ }
271
+ function bf() {
272
+ return Fe(this).formatHsl();
273
+ }
274
+ function we() {
275
+ return this.rgb().formatRgb();
276
+ }
277
+ function ie(e) {
278
+ var f, a;
279
+ return e = (e + "").trim().toLowerCase(), (f = Ye.exec(e)) ? (a = f[1].length, f = parseInt(f[1], 16), a === 6 ? Me(f) : a === 3 ? new g(f >> 8 & 15 | f >> 4 & 240, f >> 4 & 15 | f & 240, (f & 15) << 4 | f & 15, 1) : a === 8 ? V(f >> 24 & 255, f >> 16 & 255, f >> 8 & 255, (f & 255) / 255) : a === 4 ? V(f >> 12 & 15 | f >> 8 & 240, f >> 8 & 15 | f >> 4 & 240, f >> 4 & 15 | f & 240, ((f & 15) << 4 | f & 15) / 255) : null) : (f = Ze.exec(e)) ? new g(f[1], f[2], f[3], 1) : (f = ef.exec(e)) ? new g(f[1] * 255 / 100, f[2] * 255 / 100, f[3] * 255 / 100, 1) : (f = ff.exec(e)) ? V(f[1], f[2], f[3], f[4]) : (f = af.exec(e)) ? V(f[1] * 255 / 100, f[2] * 255 / 100, f[3] * 255 / 100, f[4]) : (f = df.exec(e)) ? ke(f[1], f[2] / 100, f[3] / 100, 1) : (f = cf.exec(e)) ? ke(f[1], f[2] / 100, f[3] / 100, f[4]) : ye.hasOwnProperty(e) ? Me(ye[e]) : e === "transparent" ? new g(NaN, NaN, NaN, 0) : null;
280
+ }
281
+ function Me(e) {
282
+ return new g(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
283
+ }
284
+ function V(e, f, a, d) {
285
+ return d <= 0 && (e = f = a = NaN), new g(e, f, a, d);
286
+ }
287
+ function je(e) {
288
+ return e instanceof z || (e = ie(e)), e ? (e = e.rgb(), new g(e.r, e.g, e.b, e.opacity)) : new g();
289
+ }
290
+ function G(e, f, a, d) {
291
+ return arguments.length === 1 ? je(e) : new g(e, f, a, d ?? 1);
292
+ }
293
+ function g(e, f, a, d) {
294
+ this.r = +e, this.g = +f, this.b = +a, this.opacity = +d;
295
+ }
296
+ ae(g, G, ne(z, {
297
+ brighter(e) {
298
+ return e = e == null ? B : B ** +e, new g(this.r * e, this.g * e, this.b * e, this.opacity);
299
+ },
300
+ darker(e) {
301
+ return e = e == null ? T : T ** +e, new g(this.r * e, this.g * e, this.b * e, this.opacity);
302
+ },
303
+ rgb() {
304
+ return this;
305
+ },
306
+ clamp() {
307
+ return new g(L(this.r), L(this.g), L(this.b), Z(this.opacity));
308
+ },
309
+ displayable() {
310
+ return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
311
+ },
312
+ hex: Ne,
313
+ formatHex: Ne,
314
+ formatHex8: rf,
315
+ formatRgb: xe,
316
+ toString: xe
317
+ }));
318
+ function Ne() {
319
+ return `#${P(this.r)}${P(this.g)}${P(this.b)}`;
320
+ }
321
+ function rf() {
322
+ return `#${P(this.r)}${P(this.g)}${P(this.b)}${P((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
323
+ }
324
+ function xe() {
325
+ let e = Z(this.opacity);
326
+ return `${e === 1 ? "rgb(" : "rgba("}${L(this.r)}, ${L(this.g)}, ${L(this.b)}${e === 1 ? ")" : `, ${e})`}`;
327
+ }
328
+ function Z(e) {
329
+ return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
330
+ }
331
+ function L(e) {
332
+ return Math.max(0, Math.min(255, Math.round(e) || 0));
333
+ }
334
+ function P(e) {
335
+ return e = L(e), (e < 16 ? "0" : "") + e.toString(16);
336
+ }
337
+ function ke(e, f, a, d) {
338
+ return d <= 0 ? e = f = a = NaN : a <= 0 || a >= 1 ? e = f = NaN : f <= 0 && (e = NaN), new x(e, f, a, d);
339
+ }
340
+ function Fe(e) {
341
+ if (e instanceof x) return new x(e.h, e.s, e.l, e.opacity);
342
+ if (e instanceof z || (e = ie(e)), !e) return new x();
343
+ if (e instanceof x) return e;
344
+ e = e.rgb();
345
+ var f = e.r / 255, a = e.g / 255, d = e.b / 255, c = Math.min(f, a, d), t = Math.max(f, a, d), b = NaN, n = t - c, r = (t + c) / 2;
346
+ return n ? (b = f === t ? (a - d) / n + (a < d) * 6 : a === t ? (d - f) / n + 2 : (f - a) / n + 4, n /= r < 0.5 ? t + c : 2 - t - c, b *= 60) : n = r > 0 && r < 1 ? 0 : b, new x(b, n, r, e.opacity);
347
+ }
348
+ function nf(e, f, a, d) {
349
+ return arguments.length === 1 ? Fe(e) : new x(e, f, a, d ?? 1);
350
+ }
351
+ function x(e, f, a, d) {
352
+ this.h = +e, this.s = +f, this.l = +a, this.opacity = +d;
353
+ }
354
+ ae(x, nf, ne(z, {
355
+ brighter(e) {
356
+ return e = e == null ? B : B ** +e, new x(this.h, this.s, this.l * e, this.opacity);
357
+ },
358
+ darker(e) {
359
+ return e = e == null ? T : T ** +e, new x(this.h, this.s, this.l * e, this.opacity);
360
+ },
361
+ rgb() {
362
+ var e = this.h % 360 + (this.h < 0) * 360, f = isNaN(e) || isNaN(this.s) ? 0 : this.s, a = this.l, d = a + (a < 0.5 ? a : 1 - a) * f, c = 2 * a - d;
363
+ return new g(te(e >= 240 ? e - 240 : e + 120, c, d), te(e, c, d), te(e < 120 ? e + 240 : e - 120, c, d), this.opacity);
364
+ },
365
+ clamp() {
366
+ return new x(Re(this.h), Q(this.s), Q(this.l), Z(this.opacity));
367
+ },
368
+ displayable() {
369
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
370
+ },
371
+ formatHsl() {
372
+ let e = Z(this.opacity);
373
+ return `${e === 1 ? "hsl(" : "hsla("}${Re(this.h)}, ${Q(this.s) * 100}%, ${Q(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
374
+ }
375
+ }));
376
+ function Re(e) {
377
+ return e = (e || 0) % 360, e < 0 ? e + 360 : e;
378
+ }
379
+ function Q(e) {
380
+ return Math.max(0, Math.min(1, e || 0));
381
+ }
382
+ function te(e, f, a) {
383
+ return (e < 60 ? f + (a - f) * e / 60 : e < 180 ? a : e < 240 ? f + (a - f) * (240 - e) / 60 : f) * 255;
384
+ }
385
+ var of = Math.PI / 180, sf = 180 / Math.PI, He = -0.14861, oe = 1.78277, se = -0.29227, de = -0.90649, q = 1.97294, $e = q * de, Ee = q * oe, Ae = oe * se - de * He;
386
+ function lf(e) {
387
+ if (e instanceof I) return new I(e.h, e.s, e.l, e.opacity);
388
+ e instanceof g || (e = je(e));
389
+ var f = e.r / 255, a = e.g / 255, d = e.b / 255, c = (Ae * d + $e * f - Ee * a) / (Ae + $e - Ee), t = d - c, b = (q * (a - c) - se * t) / de, n = Math.sqrt(b * b + t * t) / (q * c * (1 - c)), r = n ? Math.atan2(b, t) * sf - 120 : NaN;
390
+ return new I(r < 0 ? r + 360 : r, n, c, e.opacity);
391
+ }
392
+ function $(e, f, a, d) {
393
+ return arguments.length === 1 ? lf(e) : new I(e, f, a, d ?? 1);
394
+ }
395
+ function I(e, f, a, d) {
396
+ this.h = +e, this.s = +f, this.l = +a, this.opacity = +d;
397
+ }
398
+ ae(I, $, ne(z, {
399
+ brighter(e) {
400
+ return e = e == null ? B : B ** +e, new I(this.h, this.s, this.l * e, this.opacity);
401
+ },
402
+ darker(e) {
403
+ return e = e == null ? T : T ** +e, new I(this.h, this.s, this.l * e, this.opacity);
404
+ },
405
+ rgb() {
406
+ var e = isNaN(this.h) ? 0 : (this.h + 120) * of, f = +this.l, a = isNaN(this.s) ? 0 : this.s * f * (1 - f), d = Math.cos(e), c = Math.sin(e);
407
+ return new g(255 * (f + a * (He * d + oe * c)), 255 * (f + a * (se * d + de * c)), 255 * (f + q * d * a), this.opacity);
408
+ }
409
+ }));
410
+ function uf(e) {
411
+ return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
412
+ }
413
+ function ee(e, f) {
414
+ if (!isFinite(e) || e === 0) return null;
415
+ var a = (e = f ? e.toExponential(f - 1) : e.toExponential()).indexOf("e"), d = e.slice(0, a);
416
+ return [d.length > 1 ? d[0] + d.slice(2) : d, +e.slice(a + 1)];
417
+ }
418
+ function hf(e) {
419
+ return e = ee(Math.abs(e)), e ? e[1] : NaN;
420
+ }
421
+ function pf(e, f) {
422
+ return function(a, d) {
423
+ for (var c = a.length, t = [], b = 0, n = e[0], r = 0; c > 0 && n > 0 && (r + n + 1 > d && (n = Math.max(1, d - r)), t.push(a.substring(c -= n, c + n)), !((r += n + 1) > d)); ) n = e[b = (b + 1) % e.length];
424
+ return t.reverse().join(f);
425
+ };
426
+ }
427
+ function mf(e) {
428
+ return function(f) {
429
+ return f.replace(/[0-9]/g, function(a) {
430
+ return e[+a];
431
+ });
432
+ };
433
+ }
434
+ var gf = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
435
+ function re(e) {
436
+ if (!(f = gf.exec(e))) throw Error("invalid format: " + e);
437
+ var f;
438
+ return new le({
439
+ fill: f[1],
440
+ align: f[2],
441
+ sign: f[3],
442
+ symbol: f[4],
443
+ zero: f[5],
444
+ width: f[6],
445
+ comma: f[7],
446
+ precision: f[8] && f[8].slice(1),
447
+ trim: f[9],
448
+ type: f[10]
449
+ });
450
+ }
451
+ re.prototype = le.prototype;
452
+ function le(e) {
453
+ this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
454
+ }
455
+ le.prototype.toString = function() {
456
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
457
+ };
458
+ function yf(e) {
459
+ e: for (var f = e.length, a = 1, d = -1, c; a < f; ++a) switch (e[a]) {
460
+ case ".":
461
+ d = c = a;
462
+ break;
463
+ case "0":
464
+ d === 0 && (d = a), c = a;
465
+ break;
466
+ default:
467
+ if (!+e[a]) break e;
468
+ d > 0 && (d = 0);
469
+ break;
470
+ }
471
+ return d > 0 ? e.slice(0, d) + e.slice(c + 1) : e;
472
+ }
473
+ var fe;
474
+ function vf(e, f) {
475
+ var a = ee(e, f);
476
+ if (!a) return fe = void 0, e.toPrecision(f);
477
+ var d = a[0], c = a[1], t = c - (fe = Math.max(-8, Math.min(8, Math.floor(c / 3))) * 3) + 1, b = d.length;
478
+ return t === b ? d : t > b ? d + Array(t - b + 1).join("0") : t > 0 ? d.slice(0, t) + "." + d.slice(t) : "0." + Array(1 - t).join("0") + ee(e, Math.max(0, f + t - 1))[0];
479
+ }
480
+ function _e(e, f) {
481
+ var a = ee(e, f);
482
+ if (!a) return e + "";
483
+ var d = a[0], c = a[1];
484
+ return c < 0 ? "0." + Array(-c).join("0") + d : d.length > c + 1 ? d.slice(0, c + 1) + "." + d.slice(c + 1) : d + Array(c - d.length + 2).join("0");
485
+ }
486
+ var Ce = {
487
+ "%": (e, f) => (e * 100).toFixed(f),
488
+ b: (e) => Math.round(e).toString(2),
489
+ c: (e) => e + "",
490
+ d: uf,
491
+ e: (e, f) => e.toExponential(f),
492
+ f: (e, f) => e.toFixed(f),
493
+ g: (e, f) => e.toPrecision(f),
494
+ o: (e) => Math.round(e).toString(8),
495
+ p: (e, f) => _e(e * 100, f),
496
+ r: _e,
497
+ s: vf,
498
+ X: (e) => Math.round(e).toString(16).toUpperCase(),
499
+ x: (e) => Math.round(e).toString(16)
500
+ };
501
+ function Se(e) {
502
+ return e;
503
+ }
504
+ var Pe = Array.prototype.map, Le = [
505
+ "y",
506
+ "z",
507
+ "a",
508
+ "f",
509
+ "p",
510
+ "n",
511
+ "µ",
512
+ "m",
513
+ "",
514
+ "k",
515
+ "M",
516
+ "G",
517
+ "T",
518
+ "P",
519
+ "E",
520
+ "Z",
521
+ "Y"
522
+ ];
523
+ function wf(e) {
524
+ var f = e.grouping === void 0 || e.thousands === void 0 ? Se : pf(Pe.call(e.grouping, Number), e.thousands + ""), a = e.currency === void 0 ? "" : e.currency[0] + "", d = e.currency === void 0 ? "" : e.currency[1] + "", c = e.decimal === void 0 ? "." : e.decimal + "", t = e.numerals === void 0 ? Se : mf(Pe.call(e.numerals, String)), b = e.percent === void 0 ? "%" : e.percent + "", n = e.minus === void 0 ? "−" : e.minus + "", r = e.nan === void 0 ? "NaN" : e.nan + "";
525
+ function l(i, p) {
526
+ i = re(i);
527
+ var m = i.fill, v = i.align, y = i.sign, A = i.symbol, _ = i.zero, w = i.width, C = i.comma, k = i.precision, j = i.trim, M = i.type;
528
+ M === "n" ? (C = !0, M = "g") : Ce[M] || (k === void 0 && (k = 12), j = !0, M = "g"), (_ || m === "0" && v === "=") && (_ = !0, m = "0", v = "=");
529
+ var ze = (p && p.prefix !== void 0 ? p.prefix : "") + (A === "$" ? a : A === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : ""), De = (A === "$" ? d : /[%p]/.test(M) ? b : "") + (p && p.suffix !== void 0 ? p.suffix : ""), pe = Ce[M], Ge = /[defgprs%]/.test(M);
530
+ k = k === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, k)) : Math.max(0, Math.min(20, k));
531
+ function me(s) {
532
+ var S = ze, N = De, F, ge, U;
533
+ if (M === "c") N = pe(s) + N, s = "";
534
+ else {
535
+ s = +s;
536
+ var J = s < 0 || 1 / s < 0;
537
+ if (s = isNaN(s) ? r : pe(Math.abs(s), k), j && (s = yf(s)), J && +s == 0 && y !== "+" && (J = !1), S = (J ? y === "(" ? y : n : y === "-" || y === "(" ? "" : y) + S, N = (M === "s" && !isNaN(s) && fe !== void 0 ? Le[8 + fe / 3] : "") + N + (J && y === "(" ? ")" : ""), Ge) {
538
+ for (F = -1, ge = s.length; ++F < ge; ) if (U = s.charCodeAt(F), 48 > U || U > 57) {
539
+ N = (U === 46 ? c + s.slice(F + 1) : s.slice(F)) + N, s = s.slice(0, F);
540
+ break;
541
+ }
542
+ }
543
+ }
544
+ C && !_ && (s = f(s, 1 / 0));
545
+ var X = S.length + s.length + N.length, E = X < w ? Array(w - X + 1).join(m) : "";
546
+ switch (C && _ && (s = f(E + s, E.length ? w - N.length : 1 / 0), E = ""), v) {
547
+ case "<":
548
+ s = S + s + N + E;
549
+ break;
550
+ case "=":
551
+ s = S + E + s + N;
552
+ break;
553
+ case "^":
554
+ s = E.slice(0, X = E.length >> 1) + S + s + N + E.slice(X);
555
+ break;
556
+ default:
557
+ s = E + S + s + N;
558
+ break;
559
+ }
560
+ return t(s);
561
+ }
562
+ return me.toString = function() {
563
+ return i + "";
564
+ }, me;
565
+ }
566
+ function h(i, p) {
567
+ var m = Math.max(-8, Math.min(8, Math.floor(hf(p) / 3))) * 3, v = 10 ** -m, y = l((i = re(i), i.type = "f", i), { suffix: Le[8 + m / 3] });
568
+ return function(A) {
569
+ return y(v * A);
570
+ };
571
+ }
572
+ return {
573
+ format: l,
574
+ formatPrefix: h
575
+ };
576
+ }
577
+ var Y;
578
+ Mf({
579
+ thousands: ",",
580
+ grouping: [3],
581
+ currency: ["$", ""]
582
+ });
583
+ function Mf(e) {
584
+ return Y = wf(e), Y.format, Y.formatPrefix, Y;
585
+ }
586
+ function Nf(e, f, a, d, c) {
587
+ var t = e * e, b = t * e;
588
+ return ((1 - 3 * e + 3 * t - b) * f + (4 - 6 * t + 3 * b) * a + (1 + 3 * e + 3 * t - 3 * b) * d + b * c) / 6;
589
+ }
590
+ function xf(e) {
591
+ var f = e.length - 1;
592
+ return function(a) {
593
+ var d = a <= 0 ? a = 0 : a >= 1 ? (a = 1, f - 1) : Math.floor(a * f), c = e[d], t = e[d + 1], b = d > 0 ? e[d - 1] : 2 * c - t, n = d < f - 1 ? e[d + 2] : 2 * t - c;
594
+ return Nf((a - d / f) * f, b, c, t, n);
595
+ };
596
+ }
597
+ var ue = (e) => () => e;
598
+ function Oe(e, f) {
599
+ return function(a) {
600
+ return e + a * f;
601
+ };
602
+ }
603
+ function kf(e, f, a) {
604
+ return e **= +a, f = f ** +a - e, a = 1 / a, function(d) {
605
+ return (e + d * f) ** +a;
606
+ };
607
+ }
608
+ function Rf(e, f) {
609
+ var a = f - e;
610
+ return a ? Oe(e, a > 180 || a < -180 ? a - 360 * Math.round(a / 360) : a) : ue(isNaN(e) ? f : e);
611
+ }
612
+ function $f(e) {
613
+ return (e = +e) == 1 ? O : function(f, a) {
614
+ return a - f ? kf(f, a, e) : ue(isNaN(f) ? a : f);
615
+ };
616
+ }
617
+ function O(e, f) {
618
+ var a = f - e;
619
+ return a ? Oe(e, a) : ue(isNaN(e) ? f : e);
620
+ }
621
+ (function e(f) {
622
+ var a = $f(f);
623
+ function d(c, t) {
624
+ var b = a((c = G(c)).r, (t = G(t)).r), n = a(c.g, t.g), r = a(c.b, t.b), l = O(c.opacity, t.opacity);
625
+ return function(h) {
626
+ return c.r = b(h), c.g = n(h), c.b = r(h), c.opacity = l(h), c + "";
627
+ };
628
+ }
629
+ return d.gamma = e, d;
630
+ })(1);
631
+ function Ef(e) {
632
+ return function(f) {
633
+ var a = f.length, d = Array(a), c = Array(a), t = Array(a), b, n;
634
+ for (b = 0; b < a; ++b) n = G(f[b]), d[b] = n.r || 0, c[b] = n.g || 0, t[b] = n.b || 0;
635
+ return d = e(d), c = e(c), t = e(t), n.opacity = 1, function(r) {
636
+ return n.r = d(r), n.g = c(r), n.b = t(r), n + "";
637
+ };
638
+ };
639
+ }
640
+ var Af = Ef(xf);
641
+ function Be(e) {
642
+ return (function f(a) {
643
+ a = +a;
644
+ function d(c, t) {
645
+ var b = e((c = $(c)).h, (t = $(t)).h), n = O(c.s, t.s), r = O(c.l, t.l), l = O(c.opacity, t.opacity);
646
+ return function(h) {
647
+ return c.h = b(h), c.s = n(h), c.l = r(h ** +a), c.opacity = l(h), c + "";
116
648
  };
117
- p === "raster" ? e.loadCollection(l, { collection: f, type: "raster", property: o ?? "" }) : e.loadCollection(l, { collection: f, type: p }), a.opacity != null && e.updateRenderInfo(l, { opacity: a.opacity }), a.isColorMap && e.updateRenderInfo(l, { isColorMap: !0 }), a.isPick && e.updateRenderInfo(l, { isPick: !0 }), a.isSkip && e.updateRenderInfo(l, { isSkip: !0 });
118
- const { catchAllCategory: y, colorMapDomain: h } = a;
119
- let E = f, A = h;
120
- if (o && y && h?.length) {
121
- const d = new Set(h);
122
- E = {
123
- ...f,
124
- features: f.features.map((b) => {
125
- const M = b.properties, w = j(M, o);
126
- return w == null || !d.has(String(w)) ? { ...b, properties: $(M, o, y) } : b;
649
+ }
650
+ return d.gamma = f, d;
651
+ })(1);
652
+ }
653
+ Be(Rf);
654
+ var he = Be(O);
655
+ function o(e) {
656
+ for (var f = e.length / 6 | 0, a = Array(f), d = 0; d < f; ) a[d] = "#" + e.slice(d * 6, ++d * 6);
657
+ return a;
658
+ }
659
+ o("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
660
+ o("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
661
+ o("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
662
+ o("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");
663
+ o("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
664
+ o("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
665
+ o("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
666
+ o("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
667
+ o("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
668
+ o("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");
669
+ o("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
670
+ var u = (e) => Af(e[e.length - 1]), _f = [
671
+ ,
672
+ ,
673
+ ,
674
+ "d8b365f5f5f55ab4ac",
675
+ "a6611adfc27d80cdc1018571",
676
+ "a6611adfc27df5f5f580cdc1018571",
677
+ "8c510ad8b365f6e8c3c7eae55ab4ac01665e",
678
+ "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
679
+ "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
680
+ "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
681
+ "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
682
+ "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
683
+ ].map(o);
684
+ u(_f);
685
+ var Cf = [
686
+ ,
687
+ ,
688
+ ,
689
+ "af8dc3f7f7f77fbf7b",
690
+ "7b3294c2a5cfa6dba0008837",
691
+ "7b3294c2a5cff7f7f7a6dba0008837",
692
+ "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
693
+ "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
694
+ "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
695
+ "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
696
+ "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
697
+ "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
698
+ ].map(o);
699
+ u(Cf);
700
+ var Sf = [
701
+ ,
702
+ ,
703
+ ,
704
+ "e9a3c9f7f7f7a1d76a",
705
+ "d01c8bf1b6dab8e1864dac26",
706
+ "d01c8bf1b6daf7f7f7b8e1864dac26",
707
+ "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
708
+ "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
709
+ "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
710
+ "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
711
+ "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
712
+ "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
713
+ ].map(o);
714
+ u(Sf);
715
+ var Pf = [
716
+ ,
717
+ ,
718
+ ,
719
+ "998ec3f7f7f7f1a340",
720
+ "5e3c99b2abd2fdb863e66101",
721
+ "5e3c99b2abd2f7f7f7fdb863e66101",
722
+ "542788998ec3d8daebfee0b6f1a340b35806",
723
+ "542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
724
+ "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
725
+ "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
726
+ "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
727
+ "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
728
+ ].map(o);
729
+ u(Pf);
730
+ var Lf = [
731
+ ,
732
+ ,
733
+ ,
734
+ "ef8a62f7f7f767a9cf",
735
+ "ca0020f4a58292c5de0571b0",
736
+ "ca0020f4a582f7f7f792c5de0571b0",
737
+ "b2182bef8a62fddbc7d1e5f067a9cf2166ac",
738
+ "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
739
+ "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
740
+ "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
741
+ "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
742
+ "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
743
+ ].map(o);
744
+ u(Lf);
745
+ var If = [
746
+ ,
747
+ ,
748
+ ,
749
+ "ef8a62ffffff999999",
750
+ "ca0020f4a582bababa404040",
751
+ "ca0020f4a582ffffffbababa404040",
752
+ "b2182bef8a62fddbc7e0e0e09999994d4d4d",
753
+ "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
754
+ "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
755
+ "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
756
+ "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
757
+ "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
758
+ ].map(o);
759
+ u(If);
760
+ var Tf = [
761
+ ,
762
+ ,
763
+ ,
764
+ "fc8d59ffffbf91bfdb",
765
+ "d7191cfdae61abd9e92c7bb6",
766
+ "d7191cfdae61ffffbfabd9e92c7bb6",
767
+ "d73027fc8d59fee090e0f3f891bfdb4575b4",
768
+ "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
769
+ "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
770
+ "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
771
+ "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
772
+ "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
773
+ ].map(o);
774
+ u(Tf);
775
+ var jf = [
776
+ ,
777
+ ,
778
+ ,
779
+ "fc8d59ffffbf91cf60",
780
+ "d7191cfdae61a6d96a1a9641",
781
+ "d7191cfdae61ffffbfa6d96a1a9641",
782
+ "d73027fc8d59fee08bd9ef8b91cf601a9850",
783
+ "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
784
+ "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
785
+ "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
786
+ "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
787
+ "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
788
+ ].map(o);
789
+ u(jf);
790
+ var Ff = [
791
+ ,
792
+ ,
793
+ ,
794
+ "fc8d59ffffbf99d594",
795
+ "d7191cfdae61abdda42b83ba",
796
+ "d7191cfdae61ffffbfabdda42b83ba",
797
+ "d53e4ffc8d59fee08be6f59899d5943288bd",
798
+ "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
799
+ "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
800
+ "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
801
+ "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
802
+ "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
803
+ ].map(o);
804
+ u(Ff);
805
+ var Hf = [
806
+ ,
807
+ ,
808
+ ,
809
+ "e5f5f999d8c92ca25f",
810
+ "edf8fbb2e2e266c2a4238b45",
811
+ "edf8fbb2e2e266c2a42ca25f006d2c",
812
+ "edf8fbccece699d8c966c2a42ca25f006d2c",
813
+ "edf8fbccece699d8c966c2a441ae76238b45005824",
814
+ "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
815
+ "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
816
+ ].map(o);
817
+ u(Hf);
818
+ var Of = [
819
+ ,
820
+ ,
821
+ ,
822
+ "e0ecf49ebcda8856a7",
823
+ "edf8fbb3cde38c96c688419d",
824
+ "edf8fbb3cde38c96c68856a7810f7c",
825
+ "edf8fbbfd3e69ebcda8c96c68856a7810f7c",
826
+ "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
827
+ "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
828
+ "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
829
+ ].map(o);
830
+ u(Of);
831
+ var Bf = [
832
+ ,
833
+ ,
834
+ ,
835
+ "e0f3dba8ddb543a2ca",
836
+ "f0f9e8bae4bc7bccc42b8cbe",
837
+ "f0f9e8bae4bc7bccc443a2ca0868ac",
838
+ "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
839
+ "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
840
+ "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
841
+ "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
842
+ ].map(o);
843
+ u(Bf);
844
+ var zf = [
845
+ ,
846
+ ,
847
+ ,
848
+ "fee8c8fdbb84e34a33",
849
+ "fef0d9fdcc8afc8d59d7301f",
850
+ "fef0d9fdcc8afc8d59e34a33b30000",
851
+ "fef0d9fdd49efdbb84fc8d59e34a33b30000",
852
+ "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
853
+ "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
854
+ "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
855
+ ].map(o);
856
+ u(zf);
857
+ var Df = [
858
+ ,
859
+ ,
860
+ ,
861
+ "ece2f0a6bddb1c9099",
862
+ "f6eff7bdc9e167a9cf02818a",
863
+ "f6eff7bdc9e167a9cf1c9099016c59",
864
+ "f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
865
+ "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
866
+ "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
867
+ "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
868
+ ].map(o);
869
+ u(Df);
870
+ var Gf = [
871
+ ,
872
+ ,
873
+ ,
874
+ "ece7f2a6bddb2b8cbe",
875
+ "f1eef6bdc9e174a9cf0570b0",
876
+ "f1eef6bdc9e174a9cf2b8cbe045a8d",
877
+ "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
878
+ "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
879
+ "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
880
+ "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
881
+ ].map(o);
882
+ u(Gf);
883
+ var qf = [
884
+ ,
885
+ ,
886
+ ,
887
+ "e7e1efc994c7dd1c77",
888
+ "f1eef6d7b5d8df65b0ce1256",
889
+ "f1eef6d7b5d8df65b0dd1c77980043",
890
+ "f1eef6d4b9dac994c7df65b0dd1c77980043",
891
+ "f1eef6d4b9dac994c7df65b0e7298ace125691003f",
892
+ "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
893
+ "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
894
+ ].map(o);
895
+ u(qf);
896
+ var Uf = [
897
+ ,
898
+ ,
899
+ ,
900
+ "fde0ddfa9fb5c51b8a",
901
+ "feebe2fbb4b9f768a1ae017e",
902
+ "feebe2fbb4b9f768a1c51b8a7a0177",
903
+ "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
904
+ "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
905
+ "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
906
+ "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
907
+ ].map(o);
908
+ u(Uf);
909
+ var Jf = [
910
+ ,
911
+ ,
912
+ ,
913
+ "edf8b17fcdbb2c7fb8",
914
+ "ffffcca1dab441b6c4225ea8",
915
+ "ffffcca1dab441b6c42c7fb8253494",
916
+ "ffffccc7e9b47fcdbb41b6c42c7fb8253494",
917
+ "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
918
+ "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
919
+ "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
920
+ ].map(o);
921
+ u(Jf);
922
+ var Xf = [
923
+ ,
924
+ ,
925
+ ,
926
+ "f7fcb9addd8e31a354",
927
+ "ffffccc2e69978c679238443",
928
+ "ffffccc2e69978c67931a354006837",
929
+ "ffffccd9f0a3addd8e78c67931a354006837",
930
+ "ffffccd9f0a3addd8e78c67941ab5d238443005a32",
931
+ "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
932
+ "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
933
+ ].map(o);
934
+ u(Xf);
935
+ var Kf = [
936
+ ,
937
+ ,
938
+ ,
939
+ "fff7bcfec44fd95f0e",
940
+ "ffffd4fed98efe9929cc4c02",
941
+ "ffffd4fed98efe9929d95f0e993404",
942
+ "ffffd4fee391fec44ffe9929d95f0e993404",
943
+ "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
944
+ "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
945
+ "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
946
+ ].map(o);
947
+ u(Kf);
948
+ var Wf = [
949
+ ,
950
+ ,
951
+ ,
952
+ "ffeda0feb24cf03b20",
953
+ "ffffb2fecc5cfd8d3ce31a1c",
954
+ "ffffb2fecc5cfd8d3cf03b20bd0026",
955
+ "ffffb2fed976feb24cfd8d3cf03b20bd0026",
956
+ "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
957
+ "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
958
+ "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
959
+ ].map(o);
960
+ u(Wf);
961
+ var Vf = [
962
+ ,
963
+ ,
964
+ ,
965
+ "deebf79ecae13182bd",
966
+ "eff3ffbdd7e76baed62171b5",
967
+ "eff3ffbdd7e76baed63182bd08519c",
968
+ "eff3ffc6dbef9ecae16baed63182bd08519c",
969
+ "eff3ffc6dbef9ecae16baed64292c62171b5084594",
970
+ "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
971
+ "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
972
+ ].map(o);
973
+ u(Vf);
974
+ var Qf = [
975
+ ,
976
+ ,
977
+ ,
978
+ "e5f5e0a1d99b31a354",
979
+ "edf8e9bae4b374c476238b45",
980
+ "edf8e9bae4b374c47631a354006d2c",
981
+ "edf8e9c7e9c0a1d99b74c47631a354006d2c",
982
+ "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
983
+ "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
984
+ "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
985
+ ].map(o);
986
+ u(Qf);
987
+ var Yf = [
988
+ ,
989
+ ,
990
+ ,
991
+ "f0f0f0bdbdbd636363",
992
+ "f7f7f7cccccc969696525252",
993
+ "f7f7f7cccccc969696636363252525",
994
+ "f7f7f7d9d9d9bdbdbd969696636363252525",
995
+ "f7f7f7d9d9d9bdbdbd969696737373525252252525",
996
+ "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
997
+ "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
998
+ ].map(o);
999
+ u(Yf);
1000
+ var Zf = [
1001
+ ,
1002
+ ,
1003
+ ,
1004
+ "efedf5bcbddc756bb1",
1005
+ "f2f0f7cbc9e29e9ac86a51a3",
1006
+ "f2f0f7cbc9e29e9ac8756bb154278f",
1007
+ "f2f0f7dadaebbcbddc9e9ac8756bb154278f",
1008
+ "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
1009
+ "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
1010
+ "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
1011
+ ].map(o);
1012
+ u(Zf);
1013
+ var ea = [
1014
+ ,
1015
+ ,
1016
+ ,
1017
+ "fee0d2fc9272de2d26",
1018
+ "fee5d9fcae91fb6a4acb181d",
1019
+ "fee5d9fcae91fb6a4ade2d26a50f15",
1020
+ "fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
1021
+ "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
1022
+ "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
1023
+ "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
1024
+ ].map(o);
1025
+ u(ea);
1026
+ var fa = [
1027
+ ,
1028
+ ,
1029
+ ,
1030
+ "fee6cefdae6be6550d",
1031
+ "feeddefdbe85fd8d3cd94701",
1032
+ "feeddefdbe85fd8d3ce6550da63603",
1033
+ "feeddefdd0a2fdae6bfd8d3ce6550da63603",
1034
+ "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
1035
+ "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
1036
+ "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
1037
+ ].map(o);
1038
+ u(fa);
1039
+ he($(300, 0.5, 0), $(-240, 0.5, 1));
1040
+ he($(-100, 0.75, 0.35), $(80, 1.5, 0.8));
1041
+ he($(260, 0.75, 0.35), $(80, 1.5, 0.8));
1042
+ $();
1043
+ G();
1044
+ function ce(e) {
1045
+ var f = e.length;
1046
+ return function(a) {
1047
+ return e[Math.max(0, Math.min(f - 1, Math.floor(a * f)))];
1048
+ };
1049
+ }
1050
+ ce(o("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
1051
+ ce(o("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
1052
+ ce(o("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
1053
+ ce(o("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
1054
+ var Ie = typeof Float32Array < "u" ? Float32Array : Array;
1055
+ function aa() {
1056
+ var e = new Ie(3);
1057
+ return Ie != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0), e;
1058
+ }
1059
+ (function() {
1060
+ var e = aa();
1061
+ return function(f, a, d, c, t, b) {
1062
+ var n, r;
1063
+ for (a ||= 3, d ||= 0, r = c ? Math.min(c * a + d, f.length) : f.length, n = d; n < r; n += a) e[0] = f[n], e[1] = f[n + 1], e[2] = f[n + 2], t(e, e, b), f[n] = e[0], f[n + 1] = e[1], f[n + 2] = e[2];
1064
+ return f;
1065
+ };
1066
+ })();
1067
+ function da(e, f) {
1068
+ return f && f.length > 0 ? { type: W.USER, params: f } : e?.mode === qe.PERCENTILE ? e.lowerPercentile !== void 0 || e.upperPercentile !== void 0 ? {
1069
+ type: W.PERCENTILE,
1070
+ params: [e.lowerPercentile ?? 0, e.upperPercentile ?? 100]
1071
+ } : { type: W.PERCENTILE } : { type: W.MIN_MAX };
1072
+ }
1073
+ function ca(e, f) {
1074
+ return f.split(".").reduce((a, d) => {
1075
+ if (!(a == null || typeof a != "object"))
1076
+ return a[d];
1077
+ }, e);
1078
+ }
1079
+ function ta(e, f, a) {
1080
+ const d = f.split("."), c = { ...e };
1081
+ let t = c;
1082
+ for (let b = 0; b < d.length - 1; b++)
1083
+ t[d[b]] = { ...t[d[b]] ?? {} }, t = t[d[b]];
1084
+ return t[d[d.length - 1]] = a, c;
1085
+ }
1086
+ function ba(e, f, a) {
1087
+ async function d(c, t, b) {
1088
+ let n = {};
1089
+ for (const r of t.tables)
1090
+ r.type !== void 0 && (n[r.name] = r.type);
1091
+ for (const r of b.layerRefs) {
1092
+ const l = r.dataRef, h = n[l], i = r.getFnv, p = a?.get(l) ?? await t.getLayer(l), m = {
1093
+ ...p,
1094
+ features: (p.features ?? []).filter((w) => w.geometry != null)
1095
+ };
1096
+ h === "raster" ? c.loadCollection(l, { collection: m, type: "raster", property: i ?? "" }) : c.loadCollection(l, { collection: m, type: h }), r.opacity != null && c.updateRenderInfo(l, { opacity: r.opacity }), r.isColorMap && c.updateRenderInfo(l, { isColorMap: !0 }), r.isPick && c.updateRenderInfo(l, { isPick: !0 }), r.isSkip && c.updateRenderInfo(l, { isSkip: !0 });
1097
+ const { catchAllCategory: v, colorMapDomain: y } = r;
1098
+ let A = m, _ = y;
1099
+ if (i && v && y?.length) {
1100
+ const w = new Set(y);
1101
+ A = {
1102
+ ...m,
1103
+ features: m.features.map((C) => {
1104
+ const k = C.properties, j = ca(k, i);
1105
+ return j == null || !w.has(String(j)) ? { ...C, properties: ta(k, i, v) } : C;
127
1106
  })
128
- }, A = d.has(y) ? h : [...h, y];
1107
+ }, _ = w.has(v) ? y : [...y, v];
129
1108
  }
130
- if (a.colorMapInterpolator) {
131
- const d = {
1109
+ if (r.colorMapInterpolator) {
1110
+ const w = {
132
1111
  // urban-grammar ColorMapInterpolator values are string-compatible
133
1112
  // with autk-core ColorMapInterpolator at runtime
134
- interpolator: a.colorMapInterpolator,
135
- domainSpec: I(a.normalization, A)
1113
+ interpolator: r.colorMapInterpolator,
1114
+ domainSpec: da(r.normalization, _)
136
1115
  };
137
- e.updateRenderInfo(l, { colormap: { config: d }, isColorMap: !0 });
1116
+ c.updateRenderInfo(l, { colormap: { config: w }, isColorMap: !0 });
138
1117
  }
139
- if (o && p !== "raster") {
140
- const d = o.startsWith("properties.") ? o : `properties.${o}`;
141
- e.updateThematic(l, { collection: E, property: d });
1118
+ if (i && h !== "raster") {
1119
+ const w = i.startsWith("properties.") ? i : `properties.${i}`;
1120
+ c.updateThematic(l, { collection: A, property: w });
142
1121
  }
143
1122
  }
144
1123
  }
145
1124
  return {
146
- async resolveMap(e, t, c = 0) {
147
- if (n && n.map && e) {
148
- let u;
149
- if (Array.isArray(n.map) ? u = document.getElementById(n.map[c]) : u = document.getElementById(n.map), !u)
150
- throw new Error("Could not find rendering target for map: " + n.map);
151
- if (!(u instanceof HTMLCanvasElement))
152
- throw new Error("Target for map is not a canvas: " + n.map);
153
- const a = new P(u);
154
- if (t.style && N.setPredefinedStyle(t.style), await a.init(), await s(a, e, t), i)
1125
+ async resolveMap(c, t, b = 0) {
1126
+ if (e && e.map && c) {
1127
+ let n;
1128
+ if (Array.isArray(e.map) ? n = document.getElementById(e.map[b]) : n = document.getElementById(e.map), !n)
1129
+ throw new Error("Could not find rendering target for map: " + e.map);
1130
+ if (!(n instanceof HTMLCanvasElement))
1131
+ throw new Error("Target for map is not a canvas: " + e.map);
1132
+ const r = new Xe(n);
1133
+ if (t.style && Ke.setPredefinedStyle(t.style), await r.init(), await d(r, c, t), f)
155
1134
  for (const l of t.layerRefs)
156
- i.set(l.dataRef, a);
157
- a.draw();
1135
+ f.set(l.dataRef, r);
1136
+ r.draw();
158
1137
  }
159
1138
  }
160
1139
  };
161
1140
  }
162
- function B(n) {
1141
+ function ra(e) {
163
1142
  return {
164
1143
  scatter: "scatterplot",
165
1144
  bar: "barchart",
@@ -168,64 +1147,76 @@ function B(n) {
168
1147
  "parallel-coordinates": "parallel-coordinates",
169
1148
  table: "table",
170
1149
  heatmatrix: "heatmatrix"
171
- }[n];
1150
+ }[e];
172
1151
  }
173
- function _(n, i, r) {
1152
+ function na(e, f, a, d, c) {
174
1153
  return {
175
- async resolvePlot(s, e) {
176
- if (!n || !n.plot) return;
177
- const t = document.getElementById(n.plot);
178
- if (!t) throw new Error(`Could not find plot target: ${n.plot}`);
179
- const c = s;
180
- if (!c) throw new Error("No data context available for plot.");
181
- const u = r?.get(e.dataRef) ?? await c.getLayer(e.dataRef), a = e.events ?? [], l = new x(t, {
182
- type: B(e.mark),
183
- collection: u,
184
- attributes: { axis: e.axis, ...e.color && { color: e.color } },
185
- labels: { axis: e.axis, title: e.title },
186
- events: a,
187
- ...e.width && { width: e.width },
188
- ...e.height && { height: e.height },
189
- ...e.margins && { margins: e.margins },
190
- ...e.transform && { transform: e.transform }
1154
+ async resolvePlot(t, b) {
1155
+ if (!e || !e.plot) return;
1156
+ const n = document.getElementById(e.plot);
1157
+ if (!n) throw new Error(`Could not find plot target: ${e.plot}`);
1158
+ const r = t;
1159
+ if (!r) throw new Error("No data context available for plot.");
1160
+ const l = c?.get(b.dataRef) ?? await r.getLayer(b.dataRef), h = b.events ?? [], i = new We(n, {
1161
+ type: ra(b.mark),
1162
+ collection: l,
1163
+ attributes: { axis: b.axis, ...b.color && { color: b.color } },
1164
+ labels: { axis: b.axis, title: b.title },
1165
+ events: h,
1166
+ ...b.width && { width: b.width },
1167
+ ...b.height && { height: b.height },
1168
+ ...b.margins && { margins: b.margins },
1169
+ ...b.transform && { transform: b.transform }
191
1170
  });
192
- if (e.mapRef && i) {
193
- const p = i.get(e.mapRef);
1171
+ if (a?.set(b.dataRef, i), b.mapRef && d?.set(b.dataRef, b.mapRef), b.mapRef && f) {
1172
+ const p = f.get(b.mapRef);
194
1173
  if (p) {
195
- p.updateRenderInfo(e.mapRef, { isPick: !0 }), p.events.on(T.PICKING, ({ selection: o }) => {
196
- l.setSelection(o);
1174
+ p.updateRenderInfo(b.mapRef, { isPick: !0 }), p.events.on(be.PICKING, ({ selection: m }) => {
1175
+ i.setSelection(m);
197
1176
  });
198
- for (const o of a)
199
- l.events.on(o, ({ selection: m }) => {
200
- p.setHighlightedIds(e.mapRef, m);
1177
+ for (const m of h)
1178
+ i.events.on(m, ({ selection: v }) => {
1179
+ p.setHighlightedIds(b.mapRef, v);
201
1180
  });
202
1181
  }
203
1182
  }
204
1183
  }
205
1184
  };
206
1185
  }
207
- function D(n) {
1186
+ function ia(e) {
208
1187
  return {
209
- async resolveCompute(i, r) {
210
- if (i) {
211
- const s = await i.getLayer(r.dataRef), t = await new F().gpgpuPipeline({
212
- collection: s,
213
- variableMapping: r.attributes,
214
- wgslBody: r.wglsFunction,
215
- ...r.outputColumnName && { resultField: r.outputColumnName },
216
- ...r.outputColumns && { outputColumns: r.outputColumns },
217
- ...r.attributeArrays && { attributeArrays: r.attributeArrays },
218
- ...r.attributeMatrices && { attributeMatrices: r.attributeMatrices },
219
- ...r.uniforms && { uniforms: r.uniforms },
220
- ...r.uniformArrays && { uniformArrays: r.uniformArrays },
221
- ...r.uniformMatrices && { uniformMatrices: r.uniformMatrices }
1188
+ async resolveCompute(f, a) {
1189
+ if (f) {
1190
+ const d = await f.getLayer(a.dataRef), t = await new Ve().gpgpuPipeline({
1191
+ collection: d,
1192
+ variableMapping: a.attributes,
1193
+ wgslBody: a.wglsFunction,
1194
+ ...a.outputColumnName && { resultField: a.outputColumnName },
1195
+ ...a.outputColumns && { outputColumns: a.outputColumns },
1196
+ ...a.attributeArrays && { attributeArrays: a.attributeArrays },
1197
+ ...a.attributeMatrices && { attributeMatrices: a.attributeMatrices },
1198
+ ...a.uniforms && { uniforms: a.uniforms },
1199
+ ...a.uniformArrays && { uniformArrays: a.uniformArrays },
1200
+ ...a.uniformMatrices && { uniformMatrices: a.uniformMatrices }
222
1201
  });
223
- return n && n.set(r.dataRef, t), i;
1202
+ return e && e.set(a.dataRef, t), f;
224
1203
  }
225
1204
  }
226
1205
  };
227
1206
  }
228
- class W {
1207
+ class oa {
1208
+ _listeners = /* @__PURE__ */ new Map();
1209
+ on(f, a) {
1210
+ this._listeners.has(f) || this._listeners.set(f, /* @__PURE__ */ new Set());
1211
+ const d = this._listeners.get(f);
1212
+ return d.add(a), () => d.delete(a);
1213
+ }
1214
+ /** @internal */
1215
+ emit(f, a) {
1216
+ this._listeners.get(f)?.forEach((d) => d(a));
1217
+ }
1218
+ }
1219
+ class ma {
229
1220
  dataAdapter;
230
1221
  mapAdapter;
231
1222
  plotAdapter;
@@ -233,9 +1224,14 @@ class W {
233
1224
  grammarEngine;
234
1225
  _computeCache = /* @__PURE__ */ new Map();
235
1226
  _data = {};
236
- constructor(i) {
237
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
238
- this.dataAdapter = S(i, s), this.mapAdapter = k(i, r, this._computeCache), this.plotAdapter = _(i, r, s), this.computeAdapter = D(this._computeCache);
1227
+ _mapRegistry = /* @__PURE__ */ new Map();
1228
+ _plotRegistry = /* @__PURE__ */ new Map();
1229
+ _fwdCleanups = [];
1230
+ _plotMapLinks = /* @__PURE__ */ new Map();
1231
+ interactions = new oa();
1232
+ constructor(f) {
1233
+ const a = /* @__PURE__ */ new Map();
1234
+ this.dataAdapter = Qe(f, a), this.mapAdapter = ba(f, this._mapRegistry, this._computeCache), this.plotAdapter = na(f, this._mapRegistry, this._plotRegistry, this._plotMapLinks, a), this.computeAdapter = ia(this._computeCache);
239
1235
  }
240
1236
  /**
241
1237
  * The coordinate reference system used internally by the autk workspace.
@@ -246,12 +1242,12 @@ class W {
246
1242
  * instead of hard-coding a CRS string.
247
1243
  */
248
1244
  get workspaceCrs() {
249
- return C;
1245
+ return Te;
250
1246
  }
251
1247
  get data() {
252
1248
  return this._data;
253
1249
  }
254
- async run(i) {
1250
+ async run(f) {
255
1251
  if (!this.dataAdapter)
256
1252
  throw new Error("Database adapter not initialized. Please call the constructor first.");
257
1253
  if (!this.mapAdapter)
@@ -260,36 +1256,97 @@ class W {
260
1256
  throw new Error("Plot adapter not initialized. Please call the constructor first.");
261
1257
  if (!this.computeAdapter)
262
1258
  throw new Error("Compute adapter not initialized. Please call the constructor first.");
263
- this.grammarEngine = v({
264
- spec: i,
1259
+ this._mapRegistry.clear(), this._plotRegistry.clear(), this._plotMapLinks.clear(), this.grammarEngine = Ue({
1260
+ spec: f,
265
1261
  adapters: {
266
1262
  db: this.dataAdapter,
267
1263
  map: this.mapAdapter,
268
1264
  plot: this.plotAdapter,
269
1265
  compute: this.computeAdapter
270
1266
  }
271
- }), await this.grammarEngine.run();
272
- const r = this.grammarEngine.context;
273
- if (!r) {
1267
+ }), await this.grammarEngine.run(), this._rewireInteractions();
1268
+ const a = this.grammarEngine.context;
1269
+ if (!a) {
274
1270
  console.warn("Grammar engine produced no data context."), this._data = {};
275
1271
  return;
276
1272
  }
277
- const s = {};
278
- for (const e of r.getLayerTables())
279
- Object.defineProperty(s, e.name, {
1273
+ const d = {};
1274
+ for (const c of a.getLayerTables())
1275
+ Object.defineProperty(d, c.name, {
280
1276
  get: () => {
281
- const t = this._computeCache.get(e.name);
282
- return t ? Promise.resolve(t) : r.getLayer(e.name);
1277
+ const t = this._computeCache.get(c.name);
1278
+ return t ? Promise.resolve(t) : a.getLayer(c.name);
283
1279
  },
284
1280
  enumerable: !0,
285
1281
  configurable: !0
286
1282
  });
287
- this._data = s;
1283
+ this._data = d;
1284
+ }
1285
+ /**
1286
+ * Highlights features on the map layer identified by `layerId`.
1287
+ * If that layer is linked to a plot via `mapRef`, the plot selection is updated too.
1288
+ */
1289
+ highlightOnMap(f, a) {
1290
+ this._mapRegistry.get(f)?.setHighlightedIds(f, a);
1291
+ for (const [d, c] of this._plotMapLinks)
1292
+ c === f && this._plotRegistry.get(d)?.setSelection(a);
1293
+ }
1294
+ /**
1295
+ * Clears highlighted features on the map layer identified by `layerId`.
1296
+ * If that layer is linked to a plot via `mapRef`, the plot selection is cleared too.
1297
+ */
1298
+ clearHighlightOnMap(f) {
1299
+ this._mapRegistry.get(f)?.clearHighlightedIds(f);
1300
+ for (const [a, d] of this._plotMapLinks)
1301
+ d === f && this._plotRegistry.get(a)?.setSelection([]);
1302
+ }
1303
+ /**
1304
+ * Clears the selection on the plot identified by `plotId` (its dataRef).
1305
+ * If that plot is linked to a map via `mapRef`, the map highlight is cleared too.
1306
+ */
1307
+ clearHighlightOnPlot(f) {
1308
+ this._plotRegistry.get(f)?.setSelection([]);
1309
+ const a = this._plotMapLinks.get(f);
1310
+ a && this._mapRegistry.get(a)?.clearHighlightedIds(a);
1311
+ }
1312
+ /**
1313
+ * Applies a selection to the plot identified by `plotId` (its dataRef).
1314
+ * If that plot is linked to a map via `mapRef`, the map highlight is updated too.
1315
+ */
1316
+ setPlotSelection(f, a) {
1317
+ this._plotRegistry.get(f)?.setSelection(a);
1318
+ const d = this._plotMapLinks.get(f);
1319
+ d && this._mapRegistry.get(d)?.setHighlightedIds(d, a);
1320
+ }
1321
+ _rewireInteractions() {
1322
+ for (const a of this._fwdCleanups) a();
1323
+ this._fwdCleanups = [];
1324
+ const f = /* @__PURE__ */ new Set();
1325
+ for (const [a, d] of this._mapRegistry) {
1326
+ if (f.has(d)) continue;
1327
+ f.add(d);
1328
+ const c = ({ selection: t }) => {
1329
+ this.interactions.emit("map:picking", { layerId: a, selection: t });
1330
+ };
1331
+ d.events.on(be.PICKING, c), this._fwdCleanups.push(() => d.events.off(be.PICKING, c));
1332
+ }
1333
+ for (const [a, d] of this._plotRegistry)
1334
+ for (const c of [K.CLICK, K.BRUSH, K.BRUSH_X, K.BRUSH_Y]) {
1335
+ const t = ({ selection: b }) => {
1336
+ this.interactions.emit("plot:selection", {
1337
+ plotId: a,
1338
+ event: c,
1339
+ selection: b
1340
+ });
1341
+ };
1342
+ d.events.on(c, t), this._fwdCleanups.push(() => d.events.off(c, t));
1343
+ }
288
1344
  }
289
1345
  }
290
1346
  export {
291
- W as AutkGrammar,
292
- K as ColorMapInterpolator,
293
- X as NormalizationMode
1347
+ ma as AutkGrammar,
1348
+ va as ColorMapInterpolator,
1349
+ oa as GrammarEventEmitter,
1350
+ wa as NormalizationMode
294
1351
  };
295
1352
  //# sourceMappingURL=autk-grammar.js.map