@nika-js/onlymap 0.8.4 → 0.9.1

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +56 -3
  3. package/dist/{LercDecode.es-BKustV-1.js → LercDecode.es-IEPCRZOv.js} +1 -1
  4. package/dist/{basemap-B0SwrOqQ.js → basemap-DL0mk9Bf.js} +780 -780
  5. package/dist/dem-decode.d.ts +58 -0
  6. package/dist/elements/om-map.d.ts +12 -0
  7. package/dist/{geoparquet-C5E6N6G0.js → geoparquet-DJxZA0if.js} +1 -1
  8. package/dist/hillshade-DR3TxO1a.js +186 -0
  9. package/dist/hillshade-apron-Bem3DWyJ.js +40 -0
  10. package/dist/hillshade-apron.d.ts +54 -0
  11. package/dist/hillshade-shader-n_zManfZ.js +160 -0
  12. package/dist/hillshade-shader.d.ts +152 -0
  13. package/dist/hillshade.d.ts +133 -0
  14. package/dist/html-data.d.ts +2 -2
  15. package/dist/{index-BLIjrGOE.js → index-BjcPjICh.js} +28 -28
  16. package/dist/{index-xUVMTGZG.js → index-CvuDsvnk.js} +23 -23
  17. package/dist/index-DO_w0tqR.js +514 -0
  18. package/dist/{index-BnQDfKfE.js → index-DdTZSuAb.js} +1 -1
  19. package/dist/{index-D5Fqn_eZ.js → index-oY3XHIux.js} +13145 -12484
  20. package/dist/{index-CaM1C93G.js → index-vLXZuog4.js} +1 -1
  21. package/dist/index.d.ts +3 -0
  22. package/dist/lerc-Bph62dCb.js +22 -0
  23. package/dist/onlymap.standalone.js +28919 -27259
  24. package/dist/onlymapjs.js +95 -92
  25. package/dist/post-process/catalogue.d.ts +61 -0
  26. package/dist/post-process/compile.d.ts +37 -0
  27. package/dist/post-process/index.d.ts +71 -0
  28. package/dist/post-process/ops.d.ts +22 -0
  29. package/dist/post-process/presets.d.ts +33 -0
  30. package/dist/post-process/validate.d.ts +8 -0
  31. package/dist/programmatic.d.ts +11 -0
  32. package/dist/{raster-B_wekCHv.js → raster-D-eTzCE3.js} +609 -499
  33. package/dist/raster-hillshade.d.ts +119 -0
  34. package/dist/{raster-pipeline-Dn2fkLYx.js → raster-pipeline-BlOnMPJe.js} +510 -484
  35. package/dist/raster-pipeline.d.ts +10 -0
  36. package/dist/raster.d.ts +5 -0
  37. package/dist/runtime-core.d.ts +39 -1
  38. package/dist/terrain-heightfield.d.ts +0 -16
  39. package/dist/terrain-sample.d.ts +0 -13
  40. package/dist/version.d.ts +1 -1
  41. package/dist/volumetrics.d.ts +7 -0
  42. package/dist/{zarr-Dan2ab-l.js → zarr-BGDoEtFb.js} +2 -2
  43. package/docs/cartograph.md +2 -2
  44. package/docs/design/hillshade.md +290 -0
  45. package/docs/effects.md +208 -0
  46. package/docs/hillshade.md +203 -0
  47. package/llms.txt +3 -1
  48. package/onlymapjs.attributes.json +27 -2
  49. package/onlymapjs.html-data.json +207 -6
  50. package/package.json +13 -9
  51. package/skills/onlymapjs/SKILL.md +4 -2
  52. package/skills/onlymapjs/references/syntax.md +17 -2
  53. package/dist/lerc-TxsFLMlC.js +0 -30
@@ -0,0 +1,514 @@
1
+ import { M as k, G as M, u as j, P as L, i as F, o as z, a as E, b as O, E as R, c as I } from "./index-oY3XHIux.js";
2
+ import { e as ao, O as fo, h as uo, j as po } from "./index-oY3XHIux.js";
3
+ const B = (
4
+ /* wgsl */
5
+ `struct VertexInputs {
6
+ @location(0) clipSpacePositions: vec2<f32>,
7
+ @location(1) texCoords: vec2<f32>,
8
+ @location(2) coordinates: vec2<f32>
9
+ }
10
+
11
+ struct FragmentInputs {
12
+ @builtin(position) Position : vec4<f32>,
13
+ @location(0) position : vec2<f32>,
14
+ @location(1) coordinate : vec2<f32>,
15
+ @location(2) uv : vec2<f32>
16
+ };
17
+
18
+ @vertex
19
+ fn vertexMain(inputs: VertexInputs) -> FragmentInputs {
20
+ var outputs: FragmentInputs;
21
+ outputs.Position = vec4(inputs.clipSpacePositions, 0., 1.);
22
+ outputs.position = inputs.clipSpacePositions;
23
+ outputs.coordinate = inputs.coordinates;
24
+ outputs.uv = inputs.texCoords;
25
+ return outputs;
26
+ }
27
+ `
28
+ ), N = (
29
+ /* glsl */
30
+ `#version 300 es
31
+ in vec2 clipSpacePositions;
32
+ in vec2 texCoords;
33
+ in vec2 coordinates;
34
+
35
+ out vec2 position;
36
+ out vec2 coordinate;
37
+ out vec2 uv;
38
+
39
+ void main(void) {
40
+ gl_Position = vec4(clipSpacePositions, 0., 1.);
41
+ position = clipSpacePositions;
42
+ coordinate = coordinates;
43
+ uv = texCoords;
44
+ }
45
+ `
46
+ ), $ = [-1, -1, 1, -1, -1, 1, 1, 1];
47
+ class U extends k {
48
+ constructor(e, t) {
49
+ const n = $.map((r) => r === -1 ? 0 : r);
50
+ t.source && (t = { ...t, source: `${B}
51
+ ${t.source}` }), super(e, {
52
+ id: t.id || j("clip-space"),
53
+ ...t,
54
+ vs: N,
55
+ vertexCount: 4,
56
+ geometry: new M({
57
+ topology: "triangle-strip",
58
+ vertexCount: 4,
59
+ attributes: {
60
+ clipSpacePositions: { size: 2, value: new Float32Array($) },
61
+ texCoords: { size: 2, value: new Float32Array(n) },
62
+ coordinates: { size: 2, value: new Float32Array(n) }
63
+ }
64
+ })
65
+ });
66
+ }
67
+ }
68
+ const D = `layout(std140) uniform screenUniforms {
69
+ vec2 texSize;
70
+ } screen;
71
+ `, G = {
72
+ name: "screen",
73
+ fs: D,
74
+ uniformTypes: {
75
+ texSize: "vec2<f32>"
76
+ }
77
+ };
78
+ class V extends L {
79
+ constructor(e, t) {
80
+ super(e, t);
81
+ const { module: n, fs: r, id: i } = t, c = {
82
+ depthWriteEnabled: !1,
83
+ depthCompare: "always",
84
+ depthBias: 0,
85
+ blend: !0,
86
+ blendColorSrcFactor: "one",
87
+ blendColorDstFactor: "one-minus-src-alpha",
88
+ blendAlphaSrcFactor: "one",
89
+ blendAlphaDstFactor: "one-minus-src-alpha",
90
+ blendColorOperation: "add",
91
+ blendAlphaOperation: "add"
92
+ };
93
+ this.model = new U(e, { id: i, fs: r, modules: [n, G], parameters: c });
94
+ }
95
+ render(e) {
96
+ this._renderPass(this.device, e);
97
+ }
98
+ delete() {
99
+ this.model.destroy(), this.model = null;
100
+ }
101
+ // Private methods
102
+ /**
103
+ * Renders the pass.
104
+ * This is an abstract method that should be overridden.
105
+ * @param inputBuffer - Frame buffer that contains the result of the previous pass
106
+ * @param outputBuffer - Frame buffer that serves as the output render target
107
+ */
108
+ _renderPass(e, t) {
109
+ const { clearCanvas: n, inputBuffer: r, outputBuffer: i } = t, c = [r.width, r.height], s = {
110
+ texSrc: r.colorAttachments[0],
111
+ texSize: c
112
+ };
113
+ this.model.shaderInputs.setProps({
114
+ screen: s,
115
+ ...t.moduleProps
116
+ });
117
+ const l = this.device.beginRenderPass({
118
+ framebuffer: i,
119
+ parameters: { viewport: [0, 0, ...c] },
120
+ clearColor: n ? [0, 0, 0, 0] : !1,
121
+ clearDepth: 1,
122
+ clearStencil: !1
123
+ });
124
+ this.model.draw(l), l.end();
125
+ }
126
+ }
127
+ class P {
128
+ constructor(e, t) {
129
+ this.id = `${e.name}-pass`, this.props = t, F(e), this.module = e;
130
+ }
131
+ setup({ device: e }) {
132
+ this.passes = q(e, this.module, this.id);
133
+ }
134
+ setProps(e) {
135
+ this.props = e;
136
+ }
137
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
138
+ preRender() {
139
+ }
140
+ postRender(e) {
141
+ const t = this.passes, { target: n } = e;
142
+ let r = e.inputBuffer, i = e.swapBuffer;
143
+ for (let c = 0; c < t.length; c++) {
144
+ const s = c === t.length - 1, l = n !== void 0 && s;
145
+ l && (i = n);
146
+ const f = !l || !!e.clearCanvas, u = {}, m = this.module.passes[c].uniforms;
147
+ u[this.module.name] = { ...this.props, ...m }, t[c].render({ clearCanvas: f, inputBuffer: r, outputBuffer: i, moduleProps: u });
148
+ const v = i;
149
+ i = r, r = v;
150
+ }
151
+ return r;
152
+ }
153
+ cleanup() {
154
+ if (this.passes) {
155
+ for (const e of this.passes)
156
+ e.delete();
157
+ this.passes = void 0;
158
+ }
159
+ }
160
+ }
161
+ function q(o, e, t) {
162
+ return e.passes.map((n, r) => {
163
+ const i = H(e, n), c = `${t}-${r}`;
164
+ return new V(o, { id: c, module: e, fs: i });
165
+ });
166
+ }
167
+ const C = `#version 300 es
168
+ uniform sampler2D texSrc;
169
+
170
+ in vec2 position;
171
+ in vec2 coordinate;
172
+ in vec2 uv;
173
+
174
+ out vec4 fragColor;
175
+ `, J = (o) => `${C}
176
+ void main() {
177
+ fragColor = texture(texSrc, coordinate);
178
+ fragColor = ${o}(fragColor, screen.texSize, coordinate);
179
+ }
180
+ `, X = (o) => `${C}
181
+ void main() {
182
+ fragColor = ${o}(texSrc, screen.texSize, coordinate);
183
+ }
184
+ `;
185
+ function H(o, e) {
186
+ if (e.filter) {
187
+ const t = typeof e.filter == "string" ? e.filter : `${o.name}_filterColor_ext`;
188
+ return J(t);
189
+ }
190
+ if (e.sampler) {
191
+ const t = typeof e.sampler == "string" ? e.sampler : `${o.name}_sampleColor`;
192
+ return X(t);
193
+ }
194
+ return "";
195
+ }
196
+ const W = `
197
+ float omfx_lum(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
198
+ float omfx_hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
199
+ `, S = {
200
+ tint: (o) => `
201
+ {
202
+ float L = omfx_lum(color.rgb);
203
+ float sat = max(max(color.r, color.g), color.b) - min(min(color.r, color.g), color.b);
204
+ vec3 duo = mix(${o("ink")}.rgb, ${o("paper")}.rgb, smoothstep(0.0, 1.0, L));
205
+ float keep = clamp(sat * 2.5, 0.0, 1.0) * ${o("keep-color")};
206
+ color.rgb = mix(color.rgb, mix(duo, color.rgb, keep), ${o("amount")});
207
+ }`,
208
+ levels: (o) => `
209
+ {
210
+ color.rgb = clamp((color.rgb - 0.5) * ${o("contrast")} + 0.5 + ${o("brightness")}, 0.0, 1.0);
211
+ color.rgb = pow(max(color.rgb, vec3(0.0)), vec3(1.0 / max(${o("gamma")}, 0.0001)));
212
+ }`,
213
+ saturation: (o) => `
214
+ {
215
+ color.rgb = mix(vec3(omfx_lum(color.rgb)), color.rgb, ${o("amount")});
216
+ }`,
217
+ posterize: (o) => `
218
+ {
219
+ float n = max(${o("levels")}, 2.0);
220
+ color.rgb = floor(color.rgb * n + 0.5) / n;
221
+ }`,
222
+ vignette: (o) => `
223
+ {
224
+ float r = length(coord - 0.5) * 1.41421356;
225
+ float v = smoothstep(${o("radius")}, ${o("radius")} + max(${o("softness")}, 0.0001), r);
226
+ color.rgb *= 1.0 - ${o("amount")} * v;
227
+ }`,
228
+ grain: (o, e) => `
229
+ {
230
+ float cell = max(${o("size")} * ${e}, 1.0);
231
+ vec2 g = floor(coord * texSize / cell) + ${o("seed")};
232
+ float n = omfx_hash(g) - 0.5;
233
+ vec3 nz = ${o("mono")} > 0.5
234
+ ? vec3(n)
235
+ : vec3(n, omfx_hash(g + 17.0) - 0.5, omfx_hash(g + 41.0) - 0.5);
236
+ color.rgb = clamp(color.rgb + nz * ${o("amount")}, 0.0, 1.0);
237
+ }`,
238
+ edges: (o, e) => `
239
+ {
240
+ vec2 o = max(${o("width")} * ${e}, 1.0) / texSize;
241
+ float tl = omfx_lum(texture(src, coord + o * vec2(-1.0, 1.0)).rgb);
242
+ float t = omfx_lum(texture(src, coord + o * vec2( 0.0, 1.0)).rgb);
243
+ float tr = omfx_lum(texture(src, coord + o * vec2( 1.0, 1.0)).rgb);
244
+ float l = omfx_lum(texture(src, coord + o * vec2(-1.0, 0.0)).rgb);
245
+ float r = omfx_lum(texture(src, coord + o * vec2( 1.0, 0.0)).rgb);
246
+ float bl = omfx_lum(texture(src, coord + o * vec2(-1.0, -1.0)).rgb);
247
+ float b = omfx_lum(texture(src, coord + o * vec2( 0.0, -1.0)).rgb);
248
+ float br = omfx_lum(texture(src, coord + o * vec2( 1.0, -1.0)).rgb);
249
+ float gx = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl);
250
+ float gy = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr);
251
+ float e = clamp(sqrt(gx * gx + gy * gy) * 2.0, 0.0, 1.0);
252
+ color.rgb = mix(color.rgb, ${o("color")}.rgb, e * ${o("amount")});
253
+ }`,
254
+ blur: (o, e) => `
255
+ {
256
+ vec2 o = max(${o("radius")} * ${e}, 0.5) / texSize;
257
+ vec4 sum = vec4(0.0);
258
+ float wsum = 0.0;
259
+ for (int i = -2; i <= 2; i++) {
260
+ for (int j = -2; j <= 2; j++) {
261
+ float w = exp(-float(i * i + j * j) / 4.0);
262
+ sum += texture(src, coord + o * vec2(float(i), float(j))) * w;
263
+ wsum += w;
264
+ }
265
+ }
266
+ color = sum / wsum;
267
+ }`,
268
+ sharpen: (o, e) => `
269
+ {
270
+ vec2 o = max(${o("radius")} * ${e}, 0.5) / texSize;
271
+ vec4 soft = vec4(0.0);
272
+ float wsum = 0.0;
273
+ for (int i = -1; i <= 1; i++) {
274
+ for (int j = -1; j <= 1; j++) {
275
+ float w = (i == 0 && j == 0) ? 4.0 : 1.0;
276
+ soft += texture(src, coord + o * vec2(float(i), float(j))) * w;
277
+ wsum += w;
278
+ }
279
+ }
280
+ soft /= wsum;
281
+ color.rgb = clamp(color.rgb + (color.rgb - soft.rgb) * ${o("amount")}, 0.0, 1.0);
282
+ }`,
283
+ halftone: (o, e) => `
284
+ {
285
+ float cell = max(${o("cell")} * ${e}, 2.0);
286
+ float a = radians(${o("angle")});
287
+ float ca = cos(a);
288
+ float sa = sin(a);
289
+ mat2 rot = mat2(ca, -sa, sa, ca);
290
+ mat2 inv = mat2(ca, sa, -sa, ca);
291
+ vec2 p = coord * texSize;
292
+ vec2 rp = rot * p;
293
+ vec2 centre = inv * ((floor(rp / cell) + 0.5) * cell);
294
+ vec4 c = texture(src, clamp(centre / texSize, vec2(0.0), vec2(1.0)));
295
+ float radius = sqrt(clamp(1.0 - omfx_lum(c.rgb), 0.0, 1.0)) * 0.5;
296
+ float d = length(fract(rp / cell) - 0.5);
297
+ float cov = 1.0 - smoothstep(radius - 0.08, radius + 0.08, d);
298
+ vec3 screened = mix(${o("paper")}.rgb, c.rgb, cov);
299
+ color.rgb = mix(color.rgb, screened, ${o("amount")});
300
+ }`
301
+ };
302
+ function x(o) {
303
+ const e = z(o), t = Object.prototype.hasOwnProperty.call(S, o) ? S[o] : void 0;
304
+ return e && t ? { ...e, glsl: t } : void 0;
305
+ }
306
+ const _ = ` float omfxAlpha = inColor.a;
307
+ vec4 color = vec4(omfxAlpha > 0.0 ? inColor.rgb / omfxAlpha : vec3(0.0), omfxAlpha);`, w = " return vec4(color.rgb * omfxAlpha, omfxAlpha);";
308
+ function Y(o) {
309
+ const e = [];
310
+ let t = [];
311
+ const n = () => {
312
+ t.length > 0 && e.push({ kind: "pointwise", ops: t }), t = [];
313
+ };
314
+ return o.forEach((r, i) => {
315
+ if (r.def.kind === "pointwise") {
316
+ t.push(i);
317
+ return;
318
+ }
319
+ n(), e.push({ kind: "neighbourhood", op: i });
320
+ }), n(), e;
321
+ }
322
+ function K(o, e) {
323
+ if (o.length === 0) return null;
324
+ const t = [], n = [], r = /* @__PURE__ */ new Map();
325
+ o.forEach((a, p) => {
326
+ for (const g of a.def.params) {
327
+ const h = a.values[g.name];
328
+ let d;
329
+ g.kind === "color" ? (d = `c${t.length}`, t.push({ key: d, value: Array.isArray(h) ? h : [0, 0, 0, 1] })) : (d = `f${n.length}`, n.push({ key: d, value: typeof h == "number" ? h : 0 })), r.set(`${p}:${g.name}`, `${e}.${d}`);
330
+ }
331
+ });
332
+ const i = {}, c = {}, s = [];
333
+ for (const { key: a, value: p } of t)
334
+ i[a] = p, c[a] = "vec4<f32>", s.push(` vec4 ${a};`);
335
+ for (const { key: a, value: p } of n)
336
+ i[a] = p, c[a] = "f32", s.push(` float ${a};`);
337
+ i.pxPerMm = E, c.pxPerMm = "f32", s.push(" float pxPerMm;");
338
+ const l = `${e}.pxPerMm`, f = (a) => (p) => r.get(`${a}:${p}`) ?? "0.0", u = [], m = [];
339
+ Y(o).forEach((a, p) => {
340
+ if (a.kind === "pointwise") {
341
+ const d = `${e}_p${p}`, T = a.ops.map((b) => o[b].def.glsl(f(b), l)).join(`
342
+ `);
343
+ u.push(
344
+ `vec4 ${d}(vec4 inColor, vec2 texSize, vec2 coord) {
345
+ ${_}
346
+ ${T}
347
+ ${w}
348
+ }`
349
+ ), m.push({ filter: d });
350
+ return;
351
+ }
352
+ const g = `${e}_n${p}`, h = o[a.op].def.glsl(f(a.op), l);
353
+ u.push(
354
+ `vec4 ${g}(sampler2D src, vec2 texSize, vec2 coord) {
355
+ vec4 inColor = texture(src, coord);
356
+ ${_}
357
+ ${h}
358
+ ${w}
359
+ }`
360
+ ), m.push({ sampler: g });
361
+ });
362
+ const v = [
363
+ `layout(std140) uniform ${e}Uniforms {`,
364
+ ...s,
365
+ `} ${e};`,
366
+ W,
367
+ ...u
368
+ ].join(`
369
+ `);
370
+ return {
371
+ // A multi-pass module names the function each pass runs, which deck's
372
+ // runtime reads (`typeof pass.filter === 'string' ? pass.filter : …`) but
373
+ // its `ShaderSubPass` type declares as a boolean — a deck typing gap, not
374
+ // a runtime one, the same shape as `maxZoom` on the standalone controller.
375
+ module: { name: e, fs: v, uniformTypes: c, passes: m },
376
+ uniforms: i,
377
+ passCount: m.length
378
+ };
379
+ }
380
+ const Q = /^\s*(-?[\d.]+)\s*(mm)?\s*$/i, Z = /^\s*(-?[\d.]+)\s*(deg)?\s*$/i;
381
+ function A(o, e) {
382
+ if (o.kind === "color") {
383
+ const n = I(e);
384
+ if (!n) return;
385
+ const [r, i, c, s] = n;
386
+ return [r / 255, i / 255, c / 255, s === void 0 ? 1 : s > 1 ? s / 255 : s];
387
+ }
388
+ if (o.kind === "length" || o.kind === "angle") {
389
+ const n = (o.kind === "length" ? Q : Z).exec(e);
390
+ if (!n) return;
391
+ const r = Number(n[1]);
392
+ return Number.isFinite(r) ? r : void 0;
393
+ }
394
+ const t = Number(e);
395
+ return Number.isFinite(t) ? t : void 0;
396
+ }
397
+ function oo(o) {
398
+ return A(o, String(o.default)) ?? 0;
399
+ }
400
+ function y(o, e) {
401
+ const t = x(o);
402
+ if (!t) return null;
403
+ const n = {};
404
+ for (const r of t.params) {
405
+ const i = e(r.name), c = i === null ? void 0 : A(r, i);
406
+ n[r.name] = c ?? oo(r);
407
+ }
408
+ return { op: o, values: n };
409
+ }
410
+ function eo(o) {
411
+ if (!o || typeof o != "object") return !1;
412
+ const e = o;
413
+ return typeof e.name == "string" && typeof e.fs == "string" && Array.isArray(e.passes) && e.passes.length > 0;
414
+ }
415
+ function no(o) {
416
+ const e = [];
417
+ for (const t of Array.from(o.querySelectorAll(":scope > om-effect"))) {
418
+ const n = t.getAttribute("preset"), r = t.getAttribute("op"), i = t.querySelector(":scope > script[type='application/json']");
419
+ if (n !== null && n !== "") {
420
+ if (!O(n)) {
421
+ console.warn(`[onlymapjs] <om-effect preset="${n}"> is not a known preset — skipped.`, t);
422
+ continue;
423
+ }
424
+ const c = R[n].map(({ op: s, params: l }) => x(s) ? y(s, (u) => {
425
+ const m = t.getAttribute(`${s}-${u}`);
426
+ if (m !== null) return m;
427
+ const v = l[u];
428
+ return v === void 0 ? null : String(v);
429
+ }) : null).filter((s) => s !== null);
430
+ e.push({ ops: c });
431
+ continue;
432
+ }
433
+ if (r !== null && r !== "") {
434
+ const c = y(r, (s) => t.getAttribute(s));
435
+ if (!c) {
436
+ console.warn(`[onlymapjs] <om-effect op="${r}"> is not a known op — skipped.`, t);
437
+ continue;
438
+ }
439
+ e.push({ ops: [c] });
440
+ continue;
441
+ }
442
+ if (i) {
443
+ let c;
444
+ try {
445
+ c = JSON.parse(i.textContent ?? "");
446
+ } catch (f) {
447
+ console.warn(`[onlymapjs] <om-effect>'s inline module is not valid JSON — skipped. ${String(f)}`, t);
448
+ continue;
449
+ }
450
+ if (!eo(c)) {
451
+ console.warn(
452
+ "[onlymapjs] <om-effect>'s inline module needs `name`, `fs` and a non-empty `passes` — skipped.",
453
+ t
454
+ );
455
+ continue;
456
+ }
457
+ let s = {};
458
+ const l = t.getAttribute("uniforms");
459
+ if (l)
460
+ try {
461
+ s = JSON.parse(l);
462
+ } catch (f) {
463
+ console.warn(`[onlymapjs] <om-effect uniforms> is not valid JSON — ignored. ${String(f)}`, t);
464
+ }
465
+ e.push({ raw: { module: c, uniforms: s } });
466
+ continue;
467
+ }
468
+ console.warn("[onlymapjs] <om-effect> needs `preset`, `op`, or an inline module — skipped.", t);
469
+ }
470
+ return e;
471
+ }
472
+ let to = 0;
473
+ const ro = () => to++;
474
+ function co(o, e = E) {
475
+ const t = [], n = [];
476
+ let r = [];
477
+ const i = ro(), c = () => {
478
+ if (r.length === 0) return;
479
+ const s = K(r, `omfx${i}_${t.length}`);
480
+ if (r = [], !s) return;
481
+ const l = { ...s.uniforms, pxPerMm: e }, f = new P(s.module, l);
482
+ n.push({ effect: f, uniforms: s.uniforms }), t.push(f);
483
+ };
484
+ for (const s of o) {
485
+ if (s.ops) {
486
+ for (const { op: l, values: f } of s.ops) {
487
+ const u = x(l);
488
+ u && r.push({ def: u, values: f });
489
+ }
490
+ continue;
491
+ }
492
+ s.raw && (c(), t.push(new P(s.raw.module, s.raw.uniforms)));
493
+ }
494
+ return c(), {
495
+ effects: t,
496
+ setPixelsPerMm(s) {
497
+ for (const { effect: l, uniforms: f } of n) l.setProps({ ...f, pxPerMm: s });
498
+ }
499
+ };
500
+ }
501
+ export {
502
+ E as CSS_PX_PER_MM,
503
+ R as EFFECT_PRESETS,
504
+ ao as EFFECT_PRESET_NAMES,
505
+ fo as OP_META,
506
+ uo as OP_NAMES,
507
+ co as buildPostProcessEffects,
508
+ A as coerceParam,
509
+ po as expandPreset,
510
+ O as isEffectPreset,
511
+ x as opDef,
512
+ z as opMeta,
513
+ no as parseEffectEls
514
+ };
@@ -1,4 +1,4 @@
1
- import { ak as Bt, az as Xt, aA as Yt, aB as Us } from "./index-D5Fqn_eZ.js";
1
+ import { aF as Bt, aS as Xt, aT as Yt, aU as Us } from "./index-oY3XHIux.js";
2
2
  import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
3
3
  import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
4
4
  import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";