@fxi/zartigl 0.10.2 → 0.10.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.
- package/dist/catalog.d.ts +19 -0
- package/dist/catalog.js +24 -21
- package/dist/{index-RrmAk1JY.js → index-vBlS9sIT.js} +158 -139
- package/dist/zartigl.d.ts +5 -0
- package/dist/zartigl.js +72 -70
- package/package.json +1 -1
package/dist/catalog.d.ts
CHANGED
|
@@ -138,6 +138,12 @@ export declare function compareVersions(a: string, b: string): number;
|
|
|
138
138
|
/** The keys of `style` whose value differs from `base`'s. */
|
|
139
139
|
export declare function diffStyle(style: LayerStyleInput, base: LayerStyle): LayerStyleInput;
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* The legend header of a layer: its title, the provider of the source
|
|
143
|
+
* `sourceId` (else of the first source naming one) and its description.
|
|
144
|
+
*/
|
|
145
|
+
export declare function entryHeader(entry: CatalogEntry, sourceId?: string, defaultLocale?: string): LegendHeader;
|
|
146
|
+
|
|
141
147
|
export declare function findCatalogEntries(selector: CatalogEntrySelector, data?: Catalog): CatalogEntry[];
|
|
142
148
|
|
|
143
149
|
export declare function formatTime(ms: number): string;
|
|
@@ -180,6 +186,13 @@ export declare interface LayerStyleInput {
|
|
|
180
186
|
raster?: Partial<RasterStyle>;
|
|
181
187
|
}
|
|
182
188
|
|
|
189
|
+
/** What a legend shows for a layer: its title, provider and description. */
|
|
190
|
+
export declare interface LegendHeader {
|
|
191
|
+
title: LocalizedText;
|
|
192
|
+
subtitle?: LocalizedText;
|
|
193
|
+
description?: LocalizedText;
|
|
194
|
+
}
|
|
195
|
+
|
|
183
196
|
/**
|
|
184
197
|
* The live catalog, or `fallback` (the bundled catalog) when it cannot be
|
|
185
198
|
* fetched or is not a schema 2 catalog. A catalog that needs a newer engine
|
|
@@ -283,6 +296,12 @@ export declare function pickPreferredSource(entry: CatalogEntry, request?: Sourc
|
|
|
283
296
|
*/
|
|
284
297
|
export declare function pickSourceByPriority(entry: CatalogEntry, priority: readonly CatalogSource["type"][], request?: SourceTimeRequest): CatalogSource | undefined;
|
|
285
298
|
|
|
299
|
+
/** Display names of the `provenance.provider` slugs. */
|
|
300
|
+
export declare const PROVIDER_LABELS: Record<string, string>;
|
|
301
|
+
|
|
302
|
+
/** A provider's display name; an unknown slug is returned as is. */
|
|
303
|
+
export declare function providerLabel(provider: string): string;
|
|
304
|
+
|
|
286
305
|
/** A published catalog: the catalog plus the oldest engine that renders it all. */
|
|
287
306
|
export declare type PublishedCatalog = Catalog & {
|
|
288
307
|
minEngine?: string;
|
package/dist/catalog.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { C as s, L as r, P as t,
|
|
1
|
+
import { C as s, L as r, P as t, h as o, R as l, i, j as y, g as L, k as S, l as E, n as c, o as g, q as T, t as d, m, a as n, p as C, e as R, d as _, u as f, v as p, r as A, w as v, c as Y, x as u, b as P, s as k } from "./index-vBlS9sIT.js";
|
|
2
2
|
export {
|
|
3
3
|
s as CATALOG_URL,
|
|
4
4
|
r as LAYER_STYLE_DEFAULTS,
|
|
5
5
|
t as PARTICLE_STYLE_KEYS,
|
|
6
|
-
o as
|
|
7
|
-
l as
|
|
8
|
-
i as
|
|
9
|
-
y as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
c as
|
|
14
|
-
g as
|
|
15
|
-
T as
|
|
16
|
-
|
|
6
|
+
o as PROVIDER_LABELS,
|
|
7
|
+
l as RASTER_STYLE_KEYS,
|
|
8
|
+
i as catalog,
|
|
9
|
+
y as compareVersions,
|
|
10
|
+
L as diffStyle,
|
|
11
|
+
S as entryHeader,
|
|
12
|
+
E as findCatalogEntries,
|
|
13
|
+
c as formatTime,
|
|
14
|
+
g as formatVertical,
|
|
15
|
+
T as getCatalogEntry,
|
|
16
|
+
d as loadCatalog,
|
|
17
|
+
m as mergeStyles,
|
|
18
|
+
n as migrateLegacyStyle,
|
|
17
19
|
C as parseLayerStyle,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
f as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
R as pickPreferredSource,
|
|
21
|
+
_ as pickSourceByPriority,
|
|
22
|
+
f as providerLabel,
|
|
23
|
+
p as requireCatalogEntry,
|
|
24
|
+
A as resolveEntryStyle,
|
|
25
|
+
v as resolveLayerStyle,
|
|
26
|
+
Y as resolveLocalizedText,
|
|
27
|
+
u as searchCatalog,
|
|
28
|
+
P as sourceCoversTime,
|
|
29
|
+
k as styleForKind
|
|
27
30
|
};
|
|
@@ -3,7 +3,7 @@ const O = 2, U = "en", G = /* @__PURE__ */ JSON.parse('[{"id":"61a81ddd-6c8e-402
|
|
|
3
3
|
schemaVersion: O,
|
|
4
4
|
defaultLocale: U,
|
|
5
5
|
layers: G
|
|
6
|
-
},
|
|
6
|
+
}, u = Object.freeze({
|
|
7
7
|
reversePalette: !1,
|
|
8
8
|
renderMode: "particles",
|
|
9
9
|
particles: Object.freeze({
|
|
@@ -22,7 +22,7 @@ const O = 2, U = "en", G = /* @__PURE__ */ JSON.parse('[{"id":"61a81ddd-6c8e-402
|
|
|
22
22
|
alphaFadeHigh: 0,
|
|
23
23
|
alphaFadeCurve: "linear"
|
|
24
24
|
})
|
|
25
|
-
}), w = ["particles", "raster"],
|
|
25
|
+
}), w = ["particles", "raster"], g = (e) => Object.fromEntries(
|
|
26
26
|
Object.entries(e ?? {}).filter(([, a]) => a !== void 0)
|
|
27
27
|
), z = {
|
|
28
28
|
"heat-alert": { palette: "heat", raster: { alphaFadeLow: 0.25 } }
|
|
@@ -37,58 +37,58 @@ function A(e) {
|
|
|
37
37
|
}
|
|
38
38
|
function H(...e) {
|
|
39
39
|
const a = {
|
|
40
|
-
reversePalette:
|
|
41
|
-
renderMode:
|
|
42
|
-
particles: { ...
|
|
43
|
-
raster: { ...
|
|
40
|
+
reversePalette: u.reversePalette,
|
|
41
|
+
renderMode: u.renderMode,
|
|
42
|
+
particles: { ...u.particles },
|
|
43
|
+
raster: { ...u.raster }
|
|
44
44
|
};
|
|
45
|
-
for (const
|
|
46
|
-
const t = A(
|
|
47
|
-
t && (t.palette !== void 0 && (a.palette = t.palette), t.reversePalette !== void 0 && (a.reversePalette = t.reversePalette), t.renderMode !== void 0 && (a.renderMode = t.renderMode), Object.assign(a.particles,
|
|
45
|
+
for (const i of e) {
|
|
46
|
+
const t = A(i);
|
|
47
|
+
t && (t.palette !== void 0 && (a.palette = t.palette), t.reversePalette !== void 0 && (a.reversePalette = t.reversePalette), t.renderMode !== void 0 && (a.renderMode = t.renderMode), Object.assign(a.particles, g(t.particles)), Object.assign(a.raster, g(t.raster)));
|
|
48
48
|
}
|
|
49
|
-
const { grade:
|
|
50
|
-
return typeof
|
|
49
|
+
const { grade: o, backdrop: r } = a.particles;
|
|
50
|
+
return typeof o == "object" && (a.particles.grade = { ...o }), a.particles.backdrop = R(r), a;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function te(...e) {
|
|
53
53
|
const a = {};
|
|
54
|
-
for (const
|
|
55
|
-
const r = A(
|
|
54
|
+
for (const o of e) {
|
|
55
|
+
const r = A(o);
|
|
56
56
|
if (r) {
|
|
57
57
|
r.palette !== void 0 && (a.palette = r.palette), r.reversePalette !== void 0 && (a.reversePalette = r.reversePalette), r.renderMode !== void 0 && (a.renderMode = r.renderMode);
|
|
58
|
-
for (const
|
|
59
|
-
const t =
|
|
60
|
-
Object.keys(t).length && (a[
|
|
58
|
+
for (const i of w) {
|
|
59
|
+
const t = g(r[i]);
|
|
60
|
+
Object.keys(t).length && (a[i] = { ...a[i], ...t });
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return a;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
66
|
+
function ce(e, a) {
|
|
67
|
+
const o = (i, t) => JSON.stringify(i) === JSON.stringify(t), r = {};
|
|
68
68
|
e.palette !== void 0 && e.palette !== a.palette && (r.palette = e.palette), e.reversePalette !== void 0 && e.reversePalette !== a.reversePalette && (r.reversePalette = e.reversePalette), e.renderMode !== void 0 && e.renderMode !== a.renderMode && (r.renderMode = e.renderMode);
|
|
69
|
-
for (const
|
|
70
|
-
const t = Object.entries(
|
|
71
|
-
([c, n]) => !
|
|
69
|
+
for (const i of w) {
|
|
70
|
+
const t = Object.entries(g(e[i])).filter(
|
|
71
|
+
([c, n]) => !o(n, a[i][c])
|
|
72
72
|
);
|
|
73
|
-
t.length && (r[
|
|
73
|
+
t.length && (r[i] = Object.fromEntries(t));
|
|
74
74
|
}
|
|
75
75
|
return r;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function de(e, a) {
|
|
78
78
|
if (a !== "scalar")
|
|
79
79
|
return e;
|
|
80
|
-
const { particles:
|
|
81
|
-
return r === "raster" ? { ...
|
|
80
|
+
const { particles: o, renderMode: r, ...i } = e;
|
|
81
|
+
return r === "raster" ? { ...i, renderMode: r } : i;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
return e?.kind === "scalar" && (
|
|
83
|
+
function se(e, ...a) {
|
|
84
|
+
const o = H(e?.defaults, ...a);
|
|
85
|
+
return e?.kind === "scalar" && (o.renderMode = "raster"), o;
|
|
86
86
|
}
|
|
87
87
|
const M = [
|
|
88
88
|
"particles",
|
|
89
89
|
"raster",
|
|
90
90
|
"raster+particles"
|
|
91
|
-
], W = ["off", "vibrant"], E = ["linear", "log", "exp"], T = (e) => typeof e == "number" && Number.isFinite(e), p = (e, a,
|
|
91
|
+
], W = ["off", "vibrant"], E = ["linear", "log", "exp"], T = (e) => typeof e == "number" && Number.isFinite(e), p = (e, a, o = !1) => (r) => T(r) && (o ? r > e : r >= e) && r <= a, k = {
|
|
92
92
|
density: [p(0, 0.2, !0), "a number in (0, 0.2]"],
|
|
93
93
|
speed: [p(0, 10, !0), "a number in (0, 10]"],
|
|
94
94
|
fade: [p(0, 1), "a number in [0, 1]"],
|
|
@@ -118,57 +118,57 @@ const M = [
|
|
|
118
118
|
enabled: (e) => typeof e == "boolean",
|
|
119
119
|
color: x,
|
|
120
120
|
opacity: p(0, 1)
|
|
121
|
-
},
|
|
121
|
+
}, me = Object.keys(
|
|
122
122
|
k
|
|
123
|
-
),
|
|
123
|
+
), ne = Object.keys(
|
|
124
124
|
I
|
|
125
|
-
),
|
|
125
|
+
), h = (e) => typeof e == "object" && e !== null && !Array.isArray(e), B = (e) => h(e) && Object.entries(e).every(([a, o]) => {
|
|
126
126
|
const r = Object.prototype.hasOwnProperty.call(v, a) ? v[a] : void 0;
|
|
127
|
-
return r !== void 0 && p(r[0], r[1])(
|
|
128
|
-
}), V = (e) =>
|
|
129
|
-
([a,
|
|
127
|
+
return r !== void 0 && p(r[0], r[1])(o);
|
|
128
|
+
}), V = (e) => h(e) && Object.entries(e).every(
|
|
129
|
+
([a, o]) => Object.prototype.hasOwnProperty.call(P, a) && P[a](o)
|
|
130
130
|
);
|
|
131
131
|
function _(e) {
|
|
132
132
|
throw new Error(e);
|
|
133
133
|
}
|
|
134
|
-
function C(e, a,
|
|
135
|
-
|
|
134
|
+
function C(e, a, o, r, i) {
|
|
135
|
+
h(e) || _(`${a} must be an object`);
|
|
136
136
|
const t = {};
|
|
137
137
|
for (const [c, n] of Object.entries(e)) {
|
|
138
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
139
|
-
|
|
138
|
+
if (!Object.prototype.hasOwnProperty.call(o, c)) {
|
|
139
|
+
i(`${a}.${c}`);
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
142
142
|
r && !r.includes(c) && _(`${a}.${c} is not supported here`);
|
|
143
|
-
const [s, d] =
|
|
143
|
+
const [s, d] = o[c];
|
|
144
144
|
s(n) || _(`${a}.${c} must be ${d}`), t[c] = n;
|
|
145
145
|
}
|
|
146
146
|
return t;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const { kind: r, supports:
|
|
148
|
+
function _e(e, a, o = {}) {
|
|
149
|
+
const { kind: r, supports: i, unknownKeys: t = "throw" } = o, c = o.warn ?? ((d) => console.warn(d)), n = (d) => {
|
|
150
150
|
t === "throw" && _(`${d} is not a style key`), c(`${d} is not a style key of this zartigl version: ignored`);
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
h(e) || _(`${a} must be an object`);
|
|
153
153
|
const s = {};
|
|
154
154
|
for (const [d, l] of Object.entries(e)) {
|
|
155
155
|
const m = `${a}.${d}`;
|
|
156
156
|
switch (d) {
|
|
157
157
|
case "palette":
|
|
158
|
-
|
|
158
|
+
i && !i.palette && _(`${m} is not supported here`), (typeof l != "string" || !l) && _(`${m} must be a string`);
|
|
159
159
|
break;
|
|
160
160
|
case "reversePalette":
|
|
161
|
-
|
|
161
|
+
i && !i.palette && _(`${m} is not supported here`), typeof l != "boolean" && _(`${m} must be a boolean`);
|
|
162
162
|
break;
|
|
163
163
|
case "renderMode":
|
|
164
|
-
|
|
164
|
+
i && !i.renderMode && _(`${m} is not supported here`), M.includes(l) || _(`${m} must be one of ${M.join(", ")}`), r === "scalar" && l !== "raster" && _(`${m} must be "raster" on a scalar layer`);
|
|
165
165
|
break;
|
|
166
166
|
case "particles":
|
|
167
167
|
r === "scalar" && _(`${m} needs a vector layer`), s[d] = C(
|
|
168
168
|
l,
|
|
169
169
|
m,
|
|
170
170
|
k,
|
|
171
|
-
|
|
171
|
+
i && (i.particles ?? []),
|
|
172
172
|
n
|
|
173
173
|
);
|
|
174
174
|
continue;
|
|
@@ -177,7 +177,7 @@ function me(e, a, i = {}) {
|
|
|
177
177
|
l,
|
|
178
178
|
m,
|
|
179
179
|
I,
|
|
180
|
-
|
|
180
|
+
i && (i.raster ?? []),
|
|
181
181
|
n
|
|
182
182
|
);
|
|
183
183
|
continue;
|
|
@@ -189,28 +189,28 @@ function me(e, a, i = {}) {
|
|
|
189
189
|
}
|
|
190
190
|
return A(s);
|
|
191
191
|
}
|
|
192
|
-
const S = "0.10.
|
|
192
|
+
const S = "0.10.3", N = { "maplibre-gl": "^5.17.0" }, le = {
|
|
193
193
|
version: S,
|
|
194
194
|
devDependencies: N
|
|
195
195
|
}, F = "https://sos-ch-gva-2.exo.io/mapx-zartigl/catalog/v2/catalog.json";
|
|
196
196
|
function q(e, a) {
|
|
197
|
-
const
|
|
197
|
+
const o = (t) => t.split(/[.-]/).slice(0, 3).map((c) => Number(c) || 0), [r, i] = [o(e), o(a)];
|
|
198
198
|
for (let t = 0; t < 3; t++)
|
|
199
|
-
if (r[t] !==
|
|
200
|
-
return r[t] <
|
|
199
|
+
if (r[t] !== i[t])
|
|
200
|
+
return r[t] < i[t] ? -1 : 1;
|
|
201
201
|
return 0;
|
|
202
202
|
}
|
|
203
203
|
function j(e) {
|
|
204
204
|
const a = e;
|
|
205
205
|
return typeof a == "object" && a !== null && a.schemaVersion === 2 && Array.isArray(a.layers);
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function pe(e = F, a = {}) {
|
|
208
208
|
const {
|
|
209
|
-
timeoutMs:
|
|
209
|
+
timeoutMs: o = 5e3,
|
|
210
210
|
fallback: r = L,
|
|
211
|
-
warn:
|
|
211
|
+
warn: i = (s) => console.warn(s),
|
|
212
212
|
fetch: t = globalThis.fetch
|
|
213
|
-
} = a, c = new AbortController(), n = setTimeout(() => c.abort(),
|
|
213
|
+
} = a, c = new AbortController(), n = setTimeout(() => c.abort(), o);
|
|
214
214
|
try {
|
|
215
215
|
const s = await t(e, { signal: c.signal });
|
|
216
216
|
if (!s.ok)
|
|
@@ -218,67 +218,83 @@ async function _e(e = F, a = {}) {
|
|
|
218
218
|
const d = await s.json();
|
|
219
219
|
if (!j(d))
|
|
220
220
|
throw new Error("not a schema 2 catalog");
|
|
221
|
-
return d.minEngine && q(S, d.minEngine) < 0 &&
|
|
221
|
+
return d.minEngine && q(S, d.minEngine) < 0 && i(
|
|
222
222
|
`[zartigl] the catalog at ${e} needs zartigl ${d.minEngine}; this is ${S}: newer style keys are ignored`
|
|
223
223
|
), { catalog: d, source: "remote" };
|
|
224
224
|
} catch (s) {
|
|
225
|
-
return
|
|
225
|
+
return i(
|
|
226
226
|
`[zartigl] live catalog unavailable (${s instanceof Error ? s.message : String(s)}): using the bundled catalog`
|
|
227
227
|
), { catalog: r, source: "bundled" };
|
|
228
228
|
} finally {
|
|
229
229
|
clearTimeout(n);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
function
|
|
232
|
+
const f = L;
|
|
233
|
+
function b(e, a, o = "en") {
|
|
234
234
|
if (!e)
|
|
235
235
|
return "";
|
|
236
236
|
const r = a.toLowerCase().split("-")[0];
|
|
237
|
-
return e[a] ?? e[r] ?? e[
|
|
237
|
+
return e[a] ?? e[r] ?? e[o] ?? Object.values(e)[0] ?? "";
|
|
238
|
+
}
|
|
239
|
+
const Z = {
|
|
240
|
+
"copernicus-marine": "Copernicus Marine Service",
|
|
241
|
+
"copernicus-atmosphere": "Copernicus Atmosphere Monitoring Service",
|
|
242
|
+
"noaa-coral-reef-watch": "NOAA Coral Reef Watch"
|
|
243
|
+
};
|
|
244
|
+
function $(e) {
|
|
245
|
+
return Z[e] ?? e;
|
|
246
|
+
}
|
|
247
|
+
function fe(e, a = e.defaults.sourceId, o = f.defaultLocale) {
|
|
248
|
+
const r = (e.sources.find((i) => i.id === a)?.provenance ?? e.sources.find((i) => i.provenance)?.provenance)?.provider;
|
|
249
|
+
return {
|
|
250
|
+
title: e.title,
|
|
251
|
+
...r ? { subtitle: { [o]: $(r) } } : {},
|
|
252
|
+
...e.description ? { description: e.description } : {}
|
|
253
|
+
};
|
|
238
254
|
}
|
|
239
|
-
function
|
|
240
|
-
return a.layers.find((
|
|
255
|
+
function K(e, a = f) {
|
|
256
|
+
return a.layers.find((o) => o.id === e);
|
|
241
257
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
if (!
|
|
258
|
+
function ue(e, a = f) {
|
|
259
|
+
const o = K(e, a);
|
|
260
|
+
if (!o)
|
|
245
261
|
throw new Error(`Unknown zartigl catalog entry: ${e}`);
|
|
246
|
-
return
|
|
262
|
+
return o;
|
|
247
263
|
}
|
|
248
|
-
const
|
|
264
|
+
const J = [
|
|
249
265
|
"geovideo",
|
|
250
266
|
"zarr",
|
|
251
267
|
"wmts"
|
|
252
|
-
],
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
268
|
+
], X = ["geovideo", "zarr"];
|
|
269
|
+
function Q(e, a = {}) {
|
|
270
|
+
const o = e.temporal;
|
|
271
|
+
if (o?.mode !== "fixed")
|
|
256
272
|
return !0;
|
|
257
|
-
const r =
|
|
258
|
-
return a.time != null && (a.time < r || a.time >
|
|
273
|
+
const r = o.start ? Date.parse(o.start) : -1 / 0, i = o.end ? Date.parse(o.end) : 1 / 0;
|
|
274
|
+
return a.time != null && (a.time < r || a.time > i) ? !1 : (a.start ?? -1 / 0) <= i && (a.end ?? 1 / 0) >= r;
|
|
259
275
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
276
|
+
function be(e, a) {
|
|
277
|
+
return ee(
|
|
262
278
|
e,
|
|
263
|
-
e.kind === "vector" ?
|
|
279
|
+
e.kind === "vector" ? X : J,
|
|
264
280
|
a
|
|
265
281
|
) ?? e.sources[0];
|
|
266
282
|
}
|
|
267
|
-
function
|
|
283
|
+
function ee(e, a, o) {
|
|
268
284
|
const r = e.sources.filter(
|
|
269
|
-
(
|
|
285
|
+
(i) => Q(i, o)
|
|
270
286
|
);
|
|
271
|
-
for (const
|
|
287
|
+
for (const i of [r, e.sources])
|
|
272
288
|
for (const t of a) {
|
|
273
|
-
const c =
|
|
289
|
+
const c = i.filter((n) => n.type === t);
|
|
274
290
|
if (c.length)
|
|
275
|
-
return
|
|
291
|
+
return ae(c);
|
|
276
292
|
}
|
|
277
293
|
}
|
|
278
|
-
function
|
|
279
|
-
const a = (
|
|
294
|
+
function ae(e) {
|
|
295
|
+
const a = (o) => o.temporal?.mode === "fixed" && o.temporal.end ? Date.parse(o.temporal.end) : 1 / 0;
|
|
280
296
|
return e.reduce(
|
|
281
|
-
(
|
|
297
|
+
(o, r) => a(r) > a(o) ? r : o
|
|
282
298
|
);
|
|
283
299
|
}
|
|
284
300
|
function Y(e) {
|
|
@@ -289,46 +305,46 @@ function Y(e) {
|
|
|
289
305
|
(a) => !!a
|
|
290
306
|
);
|
|
291
307
|
}
|
|
292
|
-
function
|
|
293
|
-
return a.layers.filter((
|
|
294
|
-
([
|
|
308
|
+
function re(e, a = f) {
|
|
309
|
+
return a.layers.filter((o) => e.category && o.category !== e.category ? !1 : o.sources.some((r) => e.sourceType && r.type !== e.sourceType || e.provider && r.provenance?.provider !== e.provider || e.variableId && !Y(r).includes(e.variableId) ? !1 : !e.identifiers || Object.entries(e.identifiers).every(
|
|
310
|
+
([i, t]) => r.provenance?.identifiers?.[i] === t
|
|
295
311
|
)));
|
|
296
312
|
}
|
|
297
|
-
function
|
|
298
|
-
const r = e.sources.flatMap((
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
...Object.entries(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
...
|
|
307
|
-
...
|
|
313
|
+
function oe(e, a, o) {
|
|
314
|
+
const r = e.sources.flatMap((i) => [
|
|
315
|
+
i.id,
|
|
316
|
+
i.type,
|
|
317
|
+
b(i.title, a, o),
|
|
318
|
+
i.provenance?.provider,
|
|
319
|
+
...Object.entries(i.provenance?.identifiers ?? {}).flat(),
|
|
320
|
+
i.temporal?.cadence,
|
|
321
|
+
i.temporal?.mode,
|
|
322
|
+
...i.type === "zarr" ? Y(i) : [],
|
|
323
|
+
...i.type === "wmts" ? [i.layer] : []
|
|
308
324
|
]);
|
|
309
325
|
return [
|
|
310
326
|
e.id,
|
|
311
|
-
|
|
312
|
-
|
|
327
|
+
b(e.title, a, o),
|
|
328
|
+
b(e.description, a, o),
|
|
313
329
|
e.category,
|
|
314
330
|
...e.aliases ?? [],
|
|
315
331
|
...e.tags ?? [],
|
|
316
332
|
...r
|
|
317
333
|
].filter(Boolean).join(" ").toLocaleLowerCase(a);
|
|
318
334
|
}
|
|
319
|
-
function
|
|
320
|
-
const r = a.locale ??
|
|
321
|
-
return
|
|
322
|
-
const n =
|
|
323
|
-
if (!
|
|
335
|
+
function ge(e, a = {}, o = f) {
|
|
336
|
+
const r = a.locale ?? o.defaultLocale, i = e.trim().toLocaleLowerCase(r).split(/\s+/).filter(Boolean);
|
|
337
|
+
return re(a, o).map((t, c) => {
|
|
338
|
+
const n = oe(t, r, o.defaultLocale);
|
|
339
|
+
if (!i.every((m) => n.includes(m)))
|
|
324
340
|
return null;
|
|
325
|
-
const s =
|
|
341
|
+
const s = b(
|
|
326
342
|
t.title,
|
|
327
343
|
r,
|
|
328
|
-
|
|
344
|
+
o.defaultLocale
|
|
329
345
|
).toLocaleLowerCase(r), d = (t.aliases ?? []).map(
|
|
330
346
|
(m) => m.toLocaleLowerCase(r)
|
|
331
|
-
), l =
|
|
347
|
+
), l = i.reduce(
|
|
332
348
|
(m, y) => m + (s === y ? 100 : d.includes(y) ? 50 : s.includes(y) ? 20 : 1),
|
|
333
349
|
0
|
|
334
350
|
);
|
|
@@ -337,40 +353,43 @@ function fe(e, a = {}, i = h) {
|
|
|
337
353
|
(t) => !!t
|
|
338
354
|
).sort((t, c) => c.score - t.score || t.index - c.index).map(({ entry: t }) => t);
|
|
339
355
|
}
|
|
340
|
-
function
|
|
341
|
-
const a = new Date(e),
|
|
342
|
-
return `${a.getUTCFullYear()}-${
|
|
356
|
+
function he(e) {
|
|
357
|
+
const a = new Date(e), o = (r) => String(r).padStart(2, "0");
|
|
358
|
+
return `${a.getUTCFullYear()}-${o(a.getUTCMonth() + 1)}-${o(
|
|
343
359
|
a.getUTCDate()
|
|
344
|
-
)} ${
|
|
360
|
+
)} ${o(a.getUTCHours())}:${o(a.getUTCMinutes())} UTC`;
|
|
345
361
|
}
|
|
346
|
-
function
|
|
347
|
-
const r =
|
|
362
|
+
function ye(e, a, o) {
|
|
363
|
+
const r = o?.trim();
|
|
348
364
|
return a === "pressure" ? `${Math.round(e)} ${r || "hPa"}` : r && r !== "m" ? `${Number(e.toPrecision(5))} ${r}` : e < 10 ? `${e.toFixed(2)} m` : e < 100 ? `${e.toFixed(1)} m` : `${Math.round(e)} m`;
|
|
349
365
|
}
|
|
350
366
|
export {
|
|
351
367
|
F as C,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
368
|
+
u as L,
|
|
369
|
+
me as P,
|
|
370
|
+
ne as R,
|
|
355
371
|
A as a,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
h,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
Q as b,
|
|
373
|
+
b as c,
|
|
374
|
+
ee as d,
|
|
375
|
+
be as e,
|
|
376
|
+
le as f,
|
|
377
|
+
ce as g,
|
|
378
|
+
Z as h,
|
|
379
|
+
f as i,
|
|
380
|
+
q as j,
|
|
381
|
+
fe as k,
|
|
382
|
+
re as l,
|
|
383
|
+
te as m,
|
|
384
|
+
he as n,
|
|
385
|
+
ye as o,
|
|
386
|
+
_e as p,
|
|
387
|
+
K as q,
|
|
388
|
+
se as r,
|
|
389
|
+
de as s,
|
|
390
|
+
pe as t,
|
|
391
|
+
$ as u,
|
|
392
|
+
ue as v,
|
|
393
|
+
H as w,
|
|
394
|
+
ge as x
|
|
376
395
|
};
|
package/dist/zartigl.d.ts
CHANGED
|
@@ -582,6 +582,11 @@ declare type LocalizedText = Record<string, string>;
|
|
|
582
582
|
export declare interface MapxWidgetSnippetOptions {
|
|
583
583
|
layerId: string;
|
|
584
584
|
layerKind: CatalogEntry["kind"];
|
|
585
|
+
/** Legend header (MapX widget only); MapX derives it from the layer when unset. */
|
|
586
|
+
title?: LocalizedText | string;
|
|
587
|
+
subtitle?: LocalizedText | string;
|
|
588
|
+
/** Shown as the legend title's tooltip. */
|
|
589
|
+
description?: LocalizedText | string;
|
|
585
590
|
/**
|
|
586
591
|
* The layer's own style, the catalog `defaults`: only override keys that
|
|
587
592
|
* differ from it are written. Unknown, the whole override is written.
|
package/dist/zartigl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as xA, p as hB, s as yB, a as yg, b as rg, r as VI, c as NC, d as dA, e as RC, f as rB, g as UC } from "./index-
|
|
1
|
+
import { m as xA, p as hB, s as yB, a as yg, b as rg, r as VI, c as NC, d as dA, e as RC, f as rB, g as UC } from "./index-vBlS9sIT.js";
|
|
2
2
|
import { T as dC, g as LC, r as lC, d as kC, c as SA, a as JC, b as EI, e as MC, f as XA, h as ng, i as cA, v as YA, j as HA, s as OI, k as zI, G as nB, l as Fg, m as mI, n as KC, o as uI, p as qC, q as FB, t as EA, u as wg, w as YC, x as HC, y as fC, z as cg, A as CI, B as mC, C as uC, D as pC, E as TC } from "./geovideo-index-BqOLqzgA.js";
|
|
3
3
|
import { F as Ji, H as Mi } from "./geovideo-index-BqOLqzgA.js";
|
|
4
4
|
import { B as xC, C as WC, b as bC, c as vC, r as wB, a as cB, d as PC, g as ZC } from "./backdrop-DctkJ45Q.js";
|
|
@@ -2057,7 +2057,7 @@ const bQ = 0, MB = 1, KB = 2, {
|
|
|
2057
2057
|
Z_MEM_ERROR: YB,
|
|
2058
2058
|
Z_BUF_ERROR: VQ,
|
|
2059
2059
|
Z_DEFLATED: lg
|
|
2060
|
-
} = lB, tI = 16180, kg = 16181, Jg = 16182, Mg = 16183, Kg = 16184, qg = 16185, Yg = 16186, Hg = 16187, fg = 16188, mg = 16189, oI = 16190,
|
|
2060
|
+
} = lB, tI = 16180, kg = 16181, Jg = 16182, Mg = 16183, Kg = 16184, qg = 16185, Yg = 16186, Hg = 16187, fg = 16188, mg = 16189, oI = 16190, nA = 16191, RI = 16192, ug = 16193, UI = 16194, pg = 16195, Tg = 16196, xg = 16197, Wg = 16198, II = 16199, gI = 16200, bg = 16201, vg = 16202, Pg = 16203, Zg = 16204, Vg = 16205, dI = 16206, Og = 16207, zg = 16208, v = 16209, HB = 16210, fB = 16211, OQ = 852, zQ = 592, jQ = 15, XQ = jQ, jg = (B) => (B >>> 24 & 255) + (B >>> 8 & 65280) + ((B & 65280) << 8) + ((B & 255) << 24);
|
|
2061
2061
|
function _Q() {
|
|
2062
2062
|
this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
|
2063
2063
|
}
|
|
@@ -2122,7 +2122,7 @@ const AE = (B) => {
|
|
|
2122
2122
|
);
|
|
2123
2123
|
if (RA(B) || !B.output || !B.input && B.avail_in !== 0)
|
|
2124
2124
|
return BA;
|
|
2125
|
-
I = B.state, I.mode ===
|
|
2125
|
+
I = B.state, I.mode === nA && (I.mode = RI), o = B.next_out, C = B.output, t = B.avail_out, Q = B.next_in, g = B.input, a = B.avail_in, i = I.hold, E = I.bits, r = a, n = t, J = NA;
|
|
2126
2126
|
A:
|
|
2127
2127
|
for (; ; )
|
|
2128
2128
|
switch (I.mode) {
|
|
@@ -2153,7 +2153,7 @@ const AE = (B) => {
|
|
|
2153
2153
|
B.msg = "invalid window size", I.mode = v;
|
|
2154
2154
|
break;
|
|
2155
2155
|
}
|
|
2156
|
-
I.dmax = 1 << I.wbits, I.flags = 0, B.adler = I.check = 1, I.mode = i & 512 ? mg :
|
|
2156
|
+
I.dmax = 1 << I.wbits, I.flags = 0, B.adler = I.check = 1, I.mode = i & 512 ? mg : nA, i = 0, E = 0;
|
|
2157
2157
|
break;
|
|
2158
2158
|
case kg:
|
|
2159
2159
|
for (; E < 16; ) {
|
|
@@ -2251,7 +2251,7 @@ const AE = (B) => {
|
|
|
2251
2251
|
}
|
|
2252
2252
|
i = 0, E = 0;
|
|
2253
2253
|
}
|
|
2254
|
-
I.head && (I.head.hcrc = I.flags >> 9 & 1, I.head.done = !0), B.adler = I.check = 0, I.mode =
|
|
2254
|
+
I.head && (I.head.hcrc = I.flags >> 9 & 1, I.head.done = !0), B.adler = I.check = 0, I.mode = nA;
|
|
2255
2255
|
break;
|
|
2256
2256
|
case mg:
|
|
2257
2257
|
for (; E < 32; ) {
|
|
@@ -2264,9 +2264,9 @@ const AE = (B) => {
|
|
|
2264
2264
|
case oI:
|
|
2265
2265
|
if (I.havedict === 0)
|
|
2266
2266
|
return B.next_out = o, B.avail_out = t, B.next_in = Q, B.avail_in = a, I.hold = i, I.bits = E, ZQ;
|
|
2267
|
-
B.adler = I.check = 1, I.mode =
|
|
2267
|
+
B.adler = I.check = 1, I.mode = nA;
|
|
2268
2268
|
/* falls through */
|
|
2269
|
-
case
|
|
2269
|
+
case nA:
|
|
2270
2270
|
if (A === vQ || A === AI)
|
|
2271
2271
|
break A;
|
|
2272
2272
|
/* falls through */
|
|
@@ -2321,7 +2321,7 @@ const AE = (B) => {
|
|
|
2321
2321
|
C.set(g.subarray(Q, Q + e), o), a -= e, Q += e, t -= e, o += e, I.length -= e;
|
|
2322
2322
|
break;
|
|
2323
2323
|
}
|
|
2324
|
-
I.mode =
|
|
2324
|
+
I.mode = nA;
|
|
2325
2325
|
break;
|
|
2326
2326
|
case Tg:
|
|
2327
2327
|
for (; E < 14; ) {
|
|
@@ -2418,7 +2418,7 @@ const AE = (B) => {
|
|
|
2418
2418
|
/* falls through */
|
|
2419
2419
|
case gI:
|
|
2420
2420
|
if (a >= 6 && t >= 258) {
|
|
2421
|
-
B.next_out = o, B.avail_out = t, B.next_in = Q, B.avail_in = a, I.hold = i, I.bits = E, mQ(B, n), o = B.next_out, C = B.output, t = B.avail_out, Q = B.next_in, g = B.input, a = B.avail_in, i = I.hold, E = I.bits, I.mode ===
|
|
2421
|
+
B.next_out = o, B.avail_out = t, B.next_in = Q, B.avail_in = a, I.hold = i, I.bits = E, mQ(B, n), o = B.next_out, C = B.output, t = B.avail_out, Q = B.next_in, g = B.input, a = B.avail_in, i = I.hold, E = I.bits, I.mode === nA && (I.back = -1);
|
|
2422
2422
|
break;
|
|
2423
2423
|
}
|
|
2424
2424
|
for (I.back = 0; w = I.lencode[i & (1 << I.lenbits) - 1], R = w >>> 24, q = w >>> 16 & 255, k = w & 65535, !(R <= E); ) {
|
|
@@ -2439,7 +2439,7 @@ const AE = (B) => {
|
|
|
2439
2439
|
break;
|
|
2440
2440
|
}
|
|
2441
2441
|
if (q & 32) {
|
|
2442
|
-
I.back = -1, I.mode =
|
|
2442
|
+
I.back = -1, I.mode = nA;
|
|
2443
2443
|
break;
|
|
2444
2444
|
}
|
|
2445
2445
|
if (q & 64) {
|
|
@@ -2561,7 +2561,7 @@ const AE = (B) => {
|
|
|
2561
2561
|
return BA;
|
|
2562
2562
|
}
|
|
2563
2563
|
return B.next_out = o, B.avail_out = t, B.next_in = Q, B.avail_in = a, I.hold = i, I.bits = E, (I.wsize || n !== B.avail_out && I.mode < v && (I.mode < dI || A !== Lg)) && xB(B, B.output, B.next_out, n - B.avail_out), r -= B.avail_in, n -= B.avail_out, B.total_in += r, B.total_out += n, I.total += n, I.wrap & 4 && n && (B.adler = I.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
|
|
2564
|
-
I.flags ? iA(I.check, C, n, B.next_out - n) : xI(I.check, C, n, B.next_out - n)), B.data_type = I.bits + (I.last ? 64 : 0) + (I.mode ===
|
|
2564
|
+
I.flags ? iA(I.check, C, n, B.next_out - n) : xI(I.check, C, n, B.next_out - n)), B.data_type = I.bits + (I.last ? 64 : 0) + (I.mode === nA ? 128 : 0) + (I.mode === II || I.mode === UI ? 256 : 0), (r === 0 && n === 0 || A === Lg) && J === NA && (J = VQ), J;
|
|
2565
2565
|
}, gE = (B) => {
|
|
2566
2566
|
if (RA(B))
|
|
2567
2567
|
return BA;
|
|
@@ -2577,7 +2577,7 @@ const AE = (B) => {
|
|
|
2577
2577
|
let g, C, Q;
|
|
2578
2578
|
return RA(B) || (g = B.state, g.wrap !== 0 && g.mode !== oI) ? BA : g.mode === oI && (C = 1, C = xI(C, A, I, 0), C !== g.check) ? qB : (Q = xB(B, A, I, I), Q ? (g.mode = HB, YB) : (g.havedict = 1, NA));
|
|
2579
2579
|
};
|
|
2580
|
-
var QE = uB, EE = pB, iE = mB, oE = $Q, aE = TB, sE = IE, tE = gE, eE = BE, DE = CE, hE = "pako inflate (from Nodeca project)",
|
|
2580
|
+
var QE = uB, EE = pB, iE = mB, oE = $Q, aE = TB, sE = IE, tE = gE, eE = BE, DE = CE, hE = "pako inflate (from Nodeca project)", FA = {
|
|
2581
2581
|
inflateReset: QE,
|
|
2582
2582
|
inflateReset2: EE,
|
|
2583
2583
|
inflateResetKeep: iE,
|
|
@@ -2611,13 +2611,13 @@ function eI(B) {
|
|
|
2611
2611
|
}, B || {});
|
|
2612
2612
|
const A = this.options;
|
|
2613
2613
|
A.raw && A.windowBits >= 0 && A.windowBits < 16 && (A.windowBits = -A.windowBits, A.windowBits === 0 && (A.windowBits = -15)), A.windowBits >= 0 && A.windowBits < 16 && !(B && B.windowBits) && (A.windowBits += 32), A.windowBits > 15 && A.windowBits < 48 && (A.windowBits & 15) === 0 && (A.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new HQ(), this.strm.avail_out = 0;
|
|
2614
|
-
let I =
|
|
2614
|
+
let I = FA.inflateInit2(
|
|
2615
2615
|
this.strm,
|
|
2616
2616
|
A.windowBits
|
|
2617
2617
|
);
|
|
2618
2618
|
if (I !== ZA)
|
|
2619
2619
|
throw new Error(WI[I]);
|
|
2620
|
-
if (this.header = new rE(),
|
|
2620
|
+
if (this.header = new rE(), FA.inflateGetHeader(this.strm, this.header), A.dictionary && (typeof A.dictionary == "string" ? A.dictionary = bI.string2buf(A.dictionary) : WB.call(A.dictionary) === "[object ArrayBuffer]" && (A.dictionary = new Uint8Array(A.dictionary)), A.raw && (I = FA.inflateSetDictionary(this.strm, A.dictionary), I !== ZA)))
|
|
2621
2621
|
throw new Error(WI[I]);
|
|
2622
2622
|
}
|
|
2623
2623
|
eI.prototype.push = function(B, A) {
|
|
@@ -2625,8 +2625,8 @@ eI.prototype.push = function(B, A) {
|
|
|
2625
2625
|
let Q, o, a;
|
|
2626
2626
|
if (this.ended) return !1;
|
|
2627
2627
|
for (A === ~~A ? o = A : o = A === !0 ? FE : nE, WB.call(B) === "[object ArrayBuffer]" ? I.input = new Uint8Array(B) : I.input = B, I.next_in = 0, I.avail_in = I.input.length; ; ) {
|
|
2628
|
-
for (I.avail_out === 0 && (I.output = new Uint8Array(g), I.next_out = 0, I.avail_out = g), Q =
|
|
2629
|
-
|
|
2628
|
+
for (I.avail_out === 0 && (I.output = new Uint8Array(g), I.next_out = 0, I.avail_out = g), Q = FA.inflate(I, o), Q === JI && C && (Q = FA.inflateSetDictionary(I, C), Q === ZA ? Q = FA.inflate(I, o) : Q === _g && (Q = JI)); I.avail_in > 0 && Q === kI && I.state.wrap > 0 && B[I.next_in] !== 0; )
|
|
2629
|
+
FA.inflateReset(I), Q = FA.inflate(I, o);
|
|
2630
2630
|
switch (Q) {
|
|
2631
2631
|
case wE:
|
|
2632
2632
|
case _g:
|
|
@@ -2642,7 +2642,7 @@ eI.prototype.push = function(B, A) {
|
|
|
2642
2642
|
this.onData(I.output.length === I.next_out ? I.output : I.output.subarray(0, I.next_out));
|
|
2643
2643
|
if (!(Q === ZA && a === 0)) {
|
|
2644
2644
|
if (Q === kI)
|
|
2645
|
-
return Q =
|
|
2645
|
+
return Q = FA.inflateEnd(this.strm), this.onEnd(Q), this.ended = !0, !0;
|
|
2646
2646
|
if (I.avail_in === 0) break;
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
@@ -2740,14 +2740,14 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
2740
2740
|
for (var h = ""; n[s]; )
|
|
2741
2741
|
h += wA[n[s++]];
|
|
2742
2742
|
return h;
|
|
2743
|
-
},
|
|
2743
|
+
}, eA = {}, GA = {}, OA = {}, X, $B = (s) => {
|
|
2744
2744
|
throw new X(s);
|
|
2745
2745
|
}, DI, AC = (s, h) => {
|
|
2746
2746
|
function y(H) {
|
|
2747
2747
|
if (H = h(H), H.length !== S.length)
|
|
2748
2748
|
throw new DI("Mismatched type converter count");
|
|
2749
2749
|
for (var d = 0; d < S.length; ++d)
|
|
2750
|
-
|
|
2750
|
+
DA(S[d], H[d]);
|
|
2751
2751
|
}
|
|
2752
2752
|
var S = [];
|
|
2753
2753
|
S.forEach(function(H) {
|
|
@@ -2755,7 +2755,7 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
2755
2755
|
});
|
|
2756
2756
|
var G = Array(s.length), L = [], Y = 0;
|
|
2757
2757
|
s.forEach((H, d) => {
|
|
2758
|
-
GA.hasOwnProperty(H) ? G[d] = GA[H] : (L.push(H),
|
|
2758
|
+
GA.hasOwnProperty(H) ? G[d] = GA[H] : (L.push(H), eA.hasOwnProperty(H) || (eA[H] = []), eA[H].push(() => {
|
|
2759
2759
|
G[d] = GA[H], ++Y, Y === L.length && y(G);
|
|
2760
2760
|
}));
|
|
2761
2761
|
}), L.length === 0 && y(G);
|
|
@@ -2769,9 +2769,9 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
2769
2769
|
return;
|
|
2770
2770
|
throw new X(`Cannot register type '${S}' twice`);
|
|
2771
2771
|
}
|
|
2772
|
-
GA[s] = h, delete OA[s],
|
|
2772
|
+
GA[s] = h, delete OA[s], eA.hasOwnProperty(s) && (h = eA[s], delete eA[s], h.forEach((G) => G()));
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function DA(s, h, y = {}) {
|
|
2775
2775
|
if (!("argPackAdvance" in h))
|
|
2776
2776
|
throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
2777
2777
|
IC(s, h, y);
|
|
@@ -2872,7 +2872,7 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
2872
2872
|
}, Bg, Cg = (s) => {
|
|
2873
2873
|
s = sg(s);
|
|
2874
2874
|
var h = j(s);
|
|
2875
|
-
return
|
|
2875
|
+
return yA(s), h;
|
|
2876
2876
|
}, sC = (s, h) => {
|
|
2877
2877
|
function y(L) {
|
|
2878
2878
|
G[L] || GA[L] || (OA[L] ? OA[L].forEach(y) : (S.push(L), G[L] = !0));
|
|
@@ -3026,7 +3026,7 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
3026
3026
|
o: () => {
|
|
3027
3027
|
},
|
|
3028
3028
|
l: (s, h, y, S) => {
|
|
3029
|
-
h = j(h),
|
|
3029
|
+
h = j(h), DA(s, { name: h, fromWireType: function(G) {
|
|
3030
3030
|
return !!G;
|
|
3031
3031
|
}, toWireType: function(G, L) {
|
|
3032
3032
|
return L ? y : S;
|
|
@@ -3035,7 +3035,7 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
3035
3035
|
}, G: null });
|
|
3036
3036
|
},
|
|
3037
3037
|
k: (s, h) => {
|
|
3038
|
-
h = j(h),
|
|
3038
|
+
h = j(h), DA(s, { name: h, fromWireType: (y) => {
|
|
3039
3039
|
if (!y)
|
|
3040
3040
|
throw new X("Cannot use deleted val. handle = " + y);
|
|
3041
3041
|
var S = IA.get(y).value;
|
|
@@ -3043,7 +3043,7 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
3043
3043
|
}, toWireType: (y, S) => Ag(S), argPackAdvance: 8, readValueFromPointer: Ig, G: null });
|
|
3044
3044
|
},
|
|
3045
3045
|
i: (s, h, y) => {
|
|
3046
|
-
h = j(h),
|
|
3046
|
+
h = j(h), DA(s, { name: h, fromWireType: (S) => S, toWireType: (S, G) => G, argPackAdvance: 8, readValueFromPointer: gC(h, y), G: null });
|
|
3047
3047
|
},
|
|
3048
3048
|
d: (s, h, y, S, G, L, Y) => {
|
|
3049
3049
|
var H = iC(h, y);
|
|
@@ -3055,14 +3055,14 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
3055
3055
|
var Z = G, p = d.length;
|
|
3056
3056
|
if (2 > p)
|
|
3057
3057
|
throw new X("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
3058
|
-
var _ = d[1] !== null && !1,
|
|
3058
|
+
var _ = d[1] !== null && !1, rA = gg(d), eg = d[0].name !== "void";
|
|
3059
3059
|
Z = [$B, Z, L, BC, d[0], d[1]];
|
|
3060
3060
|
for (var $ = 0; $ < p - 2; ++$)
|
|
3061
3061
|
Z.push(d[$ + 2]);
|
|
3062
|
-
if (!
|
|
3062
|
+
if (!rA)
|
|
3063
3063
|
for ($ = _ ? 1 : 2; $ < d.length; ++$)
|
|
3064
3064
|
d[$].G !== null && Z.push(d[$].G);
|
|
3065
|
-
|
|
3065
|
+
rA = gg(d), $ = d.length;
|
|
3066
3066
|
var QA = "", UA = "";
|
|
3067
3067
|
for (p = 0; p < $ - 2; ++p)
|
|
3068
3068
|
QA += (p !== 0 ? ", " : "") + "arg" + p, UA += (p !== 0 ? ", " : "") + "arg" + p + "Wired";
|
|
@@ -3070,15 +3070,15 @@ var UE = RE, dE = /* @__PURE__ */ (() => {
|
|
|
3070
3070
|
return function (${QA}) {
|
|
3071
3071
|
if (arguments.length !== ${$ - 2}) {
|
|
3072
3072
|
throwBindingError('function ${x} called with ' + arguments.length + ' arguments, expected ${$ - 2}');
|
|
3073
|
-
}`,
|
|
3073
|
+
}`, rA && (QA += `var destructors = [];
|
|
3074
3074
|
`);
|
|
3075
|
-
var Dg =
|
|
3075
|
+
var Dg = rA ? "destructors" : "null", wI = "throwBindingError invoker fn runDestructors retType classParam".split(" ");
|
|
3076
3076
|
for (_ && (QA += "var thisWired = classParam['toWireType'](" + Dg + `, this);
|
|
3077
3077
|
`), p = 0; p < $ - 2; ++p)
|
|
3078
3078
|
QA += "var arg" + p + "Wired = argType" + p + "['toWireType'](" + Dg + ", arg" + p + "); // " + d[p + 2].name + `
|
|
3079
3079
|
`, wI.push("argType" + p);
|
|
3080
3080
|
if (_ && (UA = "thisWired" + (0 < UA.length ? ", " : "") + UA), QA += (eg || Y ? "var rv = " : "") + "invoker(fn" + (0 < UA.length ? ", " : "") + UA + `);
|
|
3081
|
-
`,
|
|
3081
|
+
`, rA)
|
|
3082
3082
|
QA += `runDestructors(destructors);
|
|
3083
3083
|
`;
|
|
3084
3084
|
else
|
|
@@ -3105,7 +3105,7 @@ return ret;
|
|
|
3105
3105
|
} : function(H, d) {
|
|
3106
3106
|
return d;
|
|
3107
3107
|
};
|
|
3108
|
-
|
|
3108
|
+
DA(s, {
|
|
3109
3109
|
name: h,
|
|
3110
3110
|
fromWireType: G,
|
|
3111
3111
|
toWireType: Y,
|
|
@@ -3119,12 +3119,12 @@ return ret;
|
|
|
3119
3119
|
return new G(r.buffer, w[L + 4 >> 2], w[L >> 2]);
|
|
3120
3120
|
}
|
|
3121
3121
|
var G = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][h];
|
|
3122
|
-
y = j(y),
|
|
3122
|
+
y = j(y), DA(s, { name: y, fromWireType: S, argPackAdvance: 8, readValueFromPointer: S }, { P: !0 });
|
|
3123
3123
|
},
|
|
3124
3124
|
e: (s, h) => {
|
|
3125
3125
|
h = j(h);
|
|
3126
3126
|
var y = h === "std::string";
|
|
3127
|
-
|
|
3127
|
+
DA(s, { name: h, fromWireType: function(S) {
|
|
3128
3128
|
var G = w[S >> 2], L = S + 4;
|
|
3129
3129
|
if (y)
|
|
3130
3130
|
for (var Y = L, H = 0; H <= G; ++H) {
|
|
@@ -3142,7 +3142,7 @@ return ret;
|
|
|
3142
3142
|
u[H] = String.fromCharCode(n[L + H]);
|
|
3143
3143
|
u = u.join("");
|
|
3144
3144
|
}
|
|
3145
|
-
return
|
|
3145
|
+
return yA(S), u;
|
|
3146
3146
|
}, toWireType: function(S, G) {
|
|
3147
3147
|
G instanceof ArrayBuffer && (G = new Uint8Array(G));
|
|
3148
3148
|
var L, Y = typeof G == "string";
|
|
@@ -3194,15 +3194,15 @@ return ret;
|
|
|
3194
3194
|
} else if (Y)
|
|
3195
3195
|
for (Y = 0; Y < L; ++Y) {
|
|
3196
3196
|
if (u = G.charCodeAt(Y), 255 < u)
|
|
3197
|
-
throw
|
|
3197
|
+
throw yA(d), new X("String has UTF-16 code units that do not fit in 8 bits");
|
|
3198
3198
|
n[d + Y] = u;
|
|
3199
3199
|
}
|
|
3200
3200
|
else
|
|
3201
3201
|
for (Y = 0; Y < L; ++Y)
|
|
3202
3202
|
n[d + Y] = G[Y];
|
|
3203
|
-
return S !== null && S.push(
|
|
3203
|
+
return S !== null && S.push(yA, H), H;
|
|
3204
3204
|
}, argPackAdvance: 8, readValueFromPointer: DC, G(S) {
|
|
3205
|
-
|
|
3205
|
+
yA(S);
|
|
3206
3206
|
} });
|
|
3207
3207
|
},
|
|
3208
3208
|
c: (s, h, y) => {
|
|
@@ -3210,23 +3210,23 @@ return ret;
|
|
|
3210
3210
|
var S = hC, G = yC, L = rC, Y = () => F, H = 1;
|
|
3211
3211
|
else
|
|
3212
3212
|
h === 4 && (S = nC, G = FC, L = wC, Y = () => w, H = 2);
|
|
3213
|
-
|
|
3213
|
+
DA(s, { name: y, fromWireType: (d) => {
|
|
3214
3214
|
for (var u = w[d >> 2], x = Y(), Z, p = d + 4, _ = 0; _ <= u; ++_) {
|
|
3215
|
-
var
|
|
3216
|
-
(_ == u || x[
|
|
3215
|
+
var rA = d + 4 + _ * h;
|
|
3216
|
+
(_ == u || x[rA >> H] == 0) && (p = S(p, rA - p), Z === void 0 ? Z = p : (Z += "\0", Z += p), p = rA + h);
|
|
3217
3217
|
}
|
|
3218
|
-
return
|
|
3218
|
+
return yA(d), Z;
|
|
3219
3219
|
}, toWireType: (d, u) => {
|
|
3220
3220
|
if (typeof u != "string")
|
|
3221
3221
|
throw new X(`Cannot pass non-string to C++ string type ${y}`);
|
|
3222
3222
|
var x = L(u), Z = FI(4 + x + h);
|
|
3223
|
-
return w[Z >> 2] = x >> H, G(u, Z + 4, x + h), d !== null && d.push(
|
|
3223
|
+
return w[Z >> 2] = x >> H, G(u, Z + 4, x + h), d !== null && d.push(yA, Z), Z;
|
|
3224
3224
|
}, argPackAdvance: 8, readValueFromPointer: Ig, G(d) {
|
|
3225
|
-
|
|
3225
|
+
yA(d);
|
|
3226
3226
|
} });
|
|
3227
3227
|
},
|
|
3228
3228
|
m: (s, h) => {
|
|
3229
|
-
h = j(h),
|
|
3229
|
+
h = j(h), DA(s, { R: !0, name: h, argPackAdvance: 0, fromWireType: () => {
|
|
3230
3230
|
}, toWireType: () => {
|
|
3231
3231
|
} });
|
|
3232
3232
|
},
|
|
@@ -3299,9 +3299,9 @@ return ret;
|
|
|
3299
3299
|
}
|
|
3300
3300
|
return w[S >> 2] = G, 0;
|
|
3301
3301
|
}
|
|
3302
|
-
},
|
|
3302
|
+
}, hA = (function() {
|
|
3303
3303
|
function s(y) {
|
|
3304
|
-
return
|
|
3304
|
+
return hA = y.exports, i = hA.w, k(), yI = hA.A, N.unshift(hA.x), J--, A.monitorRunDependencies?.(J), J == 0 && M && (y = M, M = null, y()), hA;
|
|
3305
3305
|
}
|
|
3306
3306
|
var h = { a: SC };
|
|
3307
3307
|
if (J++, A.monitorRunDependencies?.(J), A.instantiateWasm)
|
|
@@ -3316,8 +3316,8 @@ return ret;
|
|
|
3316
3316
|
return V(h, function(y) {
|
|
3317
3317
|
s(y.instance);
|
|
3318
3318
|
}).catch(g), {};
|
|
3319
|
-
})(), FI = (s) => (FI =
|
|
3320
|
-
A.dynCall_jiji = (s, h, y, S, G) => (A.dynCall_jiji =
|
|
3319
|
+
})(), FI = (s) => (FI = hA.y)(s), yA = (s) => (yA = hA.z)(s), sg = (s) => (sg = hA.B)(s);
|
|
3320
|
+
A.dynCall_jiji = (s, h, y, S, G) => (A.dynCall_jiji = hA.D)(s, h, y, S, G);
|
|
3321
3321
|
var jA;
|
|
3322
3322
|
M = function s() {
|
|
3323
3323
|
jA || tg(), jA || (M = s);
|
|
@@ -4435,14 +4435,14 @@ class z {
|
|
|
4435
4435
|
longitudeChunkIndex: CA.lonIdx
|
|
4436
4436
|
});
|
|
4437
4437
|
wA.missing && (wA.status != null && D.push(wA.status), w.push(wA.url)), e++, I?.(e, F);
|
|
4438
|
-
const j = this.zarrSource.getChunkShape(W),
|
|
4438
|
+
const j = this.zarrSource.getChunkShape(W), eA = j[n];
|
|
4439
4439
|
return {
|
|
4440
4440
|
data: wA.data,
|
|
4441
4441
|
latStart: CA.latIdx * j[r],
|
|
4442
|
-
lonStart: CA.lonIdx *
|
|
4442
|
+
lonStart: CA.lonIdx * eA,
|
|
4443
4443
|
latSize: CA.latSize,
|
|
4444
4444
|
lonSize: CA.lonSize,
|
|
4445
|
-
lonChunkSize:
|
|
4445
|
+
lonChunkSize: eA
|
|
4446
4446
|
};
|
|
4447
4447
|
}), [q, k] = this.vectorDerivation ? xE(
|
|
4448
4448
|
await Promise.all(
|
|
@@ -6854,19 +6854,19 @@ const zB = rB.devDependencies["maplibre-gl"].replace(
|
|
|
6854
6854
|
}
|
|
6855
6855
|
]
|
|
6856
6856
|
}`;
|
|
6857
|
-
function
|
|
6857
|
+
function tA(B) {
|
|
6858
6858
|
return JSON.stringify(B);
|
|
6859
6859
|
}
|
|
6860
6860
|
function ri(B) {
|
|
6861
6861
|
return JSON.stringify(B, null, 2);
|
|
6862
6862
|
}
|
|
6863
6863
|
function jB(B) {
|
|
6864
|
-
return B instanceof Date ? `new Date(${
|
|
6864
|
+
return B instanceof Date ? `new Date(${tA(B.toISOString())})` : typeof B == "string" ? `new Date(${tA(B)})` : String(B);
|
|
6865
6865
|
}
|
|
6866
6866
|
function TA(B, A = 6) {
|
|
6867
6867
|
return String(Number(B.toFixed(A)));
|
|
6868
6868
|
}
|
|
6869
|
-
function
|
|
6869
|
+
function sA(B, A) {
|
|
6870
6870
|
const I = " ".repeat(A);
|
|
6871
6871
|
return ri(B).split(`
|
|
6872
6872
|
`).map((g) => `${I}${g}`).join(`
|
|
@@ -6898,13 +6898,15 @@ function di(B) {
|
|
|
6898
6898
|
const A = B.source ?? "auto", I = XB(B), g = _B(B), C = [
|
|
6899
6899
|
" idView: widget.opt.view.id,",
|
|
6900
6900
|
" map: widget.opt.map,",
|
|
6901
|
-
` layer: ${
|
|
6902
|
-
` source: ${
|
|
6901
|
+
` layer: ${tA(B.layerId)},`,
|
|
6902
|
+
` source: ${tA(A)},`
|
|
6903
6903
|
];
|
|
6904
|
-
|
|
6905
|
-
`
|
|
6904
|
+
for (const Q of ["title", "subtitle", "description"])
|
|
6905
|
+
B[Q] != null && C.push(` ${Q}: ${sA(B[Q], 10)},`);
|
|
6906
|
+
return B.entry && C.push(` entry: ${sA(B.entry, 10)},`), I && C.push(` style: ${sA(I, 10)},`), g && C.push(` settings: ${sA(g, 10)},`), B.time != null && C.push(` time: ${jB(B.time)},`), B.timeRange != null && C.push(
|
|
6907
|
+
` timeRange: ${sA(B.timeRange, 10)},`
|
|
6906
6908
|
), B.geoVideo != null && C.push(
|
|
6907
|
-
` geoVideo: ${
|
|
6909
|
+
` geoVideo: ${sA(B.geoVideo, 10)},`
|
|
6908
6910
|
), B.depth != null && C.push(` depth: ${B.depth},`), C.push(
|
|
6909
6911
|
" elLegend: elLegend,",
|
|
6910
6912
|
" elInputs: widget.elContent,"
|
|
@@ -6941,13 +6943,13 @@ ${C.join(`
|
|
|
6941
6943
|
}`;
|
|
6942
6944
|
}
|
|
6943
6945
|
function wi(B) {
|
|
6944
|
-
const A = B.moduleBaseUrl ?? `https://cdn.jsdelivr.net/npm/@fxi/zartigl@${rB.version}/dist`, I = B.source ?? "auto", g = XB(B), C = _B(B), Q = B.timeRange == null ? "" : ` timeRange: ${
|
|
6945
|
-
`, o = B.geoVideo == null ? "" : ` geoVideo: ${
|
|
6946
|
-
`, a = g == null ? "" : ` style: ${
|
|
6947
|
-
`, t = C == null ? "" : ` settings: ${
|
|
6946
|
+
const A = B.moduleBaseUrl ?? `https://cdn.jsdelivr.net/npm/@fxi/zartigl@${rB.version}/dist`, I = B.source ?? "auto", g = XB(B), C = _B(B), Q = B.timeRange == null ? "" : ` timeRange: ${sA(B.timeRange, 2)},
|
|
6947
|
+
`, o = B.geoVideo == null ? "" : ` geoVideo: ${sA(B.geoVideo, 2)},
|
|
6948
|
+
`, a = g == null ? "" : ` style: ${sA(g, 2)},
|
|
6949
|
+
`, t = C == null ? "" : ` settings: ${sA(C, 2)},
|
|
6948
6950
|
`, i = B.time == null ? "" : ` time: ${jB(B.time)},
|
|
6949
6951
|
`, E = B.depth == null ? "" : ` depth: ${B.depth},
|
|
6950
|
-
`, r = B.center ?? [0, 20], n = B.projection ?? "mercator", e = B.mapStyle == null ? yi :
|
|
6952
|
+
`, r = B.center ?? [0, 20], n = B.projection ?? "mercator", e = B.mapStyle == null ? yi : tA(B.mapStyle), F = `map.setProjection({ type: ${tA(n)} });
|
|
6951
6953
|
map.jumpTo({
|
|
6952
6954
|
center: [${TA(r[0])}, ${TA(r[1])}],
|
|
6953
6955
|
zoom: ${TA(B.zoom ?? 2, 3)},
|
|
@@ -6974,12 +6976,12 @@ const z = new Zartigl({
|
|
|
6974
6976
|
id: "zartigl-demo",
|
|
6975
6977
|
map,
|
|
6976
6978
|
catalog,
|
|
6977
|
-
layer: ${
|
|
6978
|
-
source: ${
|
|
6979
|
+
layer: ${tA(B.layerId)},
|
|
6980
|
+
source: ${tA(I)},
|
|
6979
6981
|
${Q}${o}${a}${t}${i}${E}});
|
|
6980
6982
|
|
|
6981
6983
|
await z.init();`;
|
|
6982
|
-
return `import maplibregl from ${
|
|
6984
|
+
return `import maplibregl from ${tA(Di)};
|
|
6983
6985
|
import { Zartigl } from "${A}/zartigl.js";
|
|
6984
6986
|
import { catalog } from "${A}/catalog.js";
|
|
6985
6987
|
|
|
@@ -7002,7 +7004,7 @@ function Li(B) {
|
|
|
7002
7004
|
<meta charset="UTF-8" />
|
|
7003
7005
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7004
7006
|
<title>Zartigl demo</title>
|
|
7005
|
-
<link rel="stylesheet" href=${
|
|
7007
|
+
<link rel="stylesheet" href=${tA(hi)} />
|
|
7006
7008
|
<style>
|
|
7007
7009
|
html, body, #map {
|
|
7008
7010
|
width: 100%;
|