@mapcreator/sdk 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -202,36 +202,35 @@ function ee(e, t = F.MAPLIBRE_COMPAT) {
202
202
  }
203
203
  //#endregion
204
204
  //#region src/utils/helpers.ts
205
- var L = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?\s*$/;
206
- function R(e) {
205
+ function L(e) {
207
206
  return e / 180 * Math.PI;
208
207
  }
209
- function z(e) {
208
+ function R(e) {
210
209
  return e * 180 / Math.PI;
211
210
  }
212
- function B(e, t) {
211
+ function z(e, t) {
213
212
  let n = Math.PI / 180, r = e.lat * n, i = t.lat * n, a = Math.sin(r) * Math.sin(i) + Math.cos(r) * Math.cos(i) * Math.cos((t.lng - e.lng) * n);
214
213
  return 6371e3 * Math.acos(Math.min(a, 1));
215
214
  }
216
- function V(e) {
215
+ function B(e) {
217
216
  let t = 0;
218
217
  for (let n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t &= t;
219
218
  return Math.abs(t);
220
219
  }
221
- function te(e, t) {
222
- return e.startsWith("$") ? ne(t[e.slice(1)]) : e;
220
+ function V(e, t) {
221
+ return e.startsWith("$") ? H(t[e.slice(1)]) : e;
223
222
  }
224
- function ne(e) {
223
+ function H(e) {
225
224
  return typeof e == "string" ? e : typeof e == "number" ? String(e) : typeof e == "boolean" ? String(e).toUpperCase() : typeof e == "object" && e && (e.t === "n" || e.t === "d") ? e.w ?? "" : "";
226
225
  }
227
- function re(e) {
228
- return typeof e == "string" && L.test(e) ? Number(e) : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : typeof e == "object" && e && e.t === "n" ? e.v : null;
226
+ function te(e) {
227
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : typeof e == "object" && e && e.t === "n" ? e.v : null;
229
228
  }
230
- function ie(e) {
229
+ function ne(e) {
231
230
  return e = e.trim(), /^\$?[\w\-_]+$/.test(e) ? e : (/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)&?/.exec(e) || [])[1];
232
231
  }
233
- var ae = 72;
234
- function oe(e, t, n) {
232
+ var re = 72;
233
+ function ie(e, t, n) {
235
234
  if (e === t) return n;
236
235
  let r = {
237
236
  millimeter: 1,
@@ -242,70 +241,70 @@ function oe(e, t, n) {
242
241
  mile: 6.21371e-7,
243
242
  nauticalMile: 5.39957e-7,
244
243
  inch: .0393701,
245
- pixel: .0393701 * ae,
244
+ pixel: .0393701 * re,
246
245
  pica: .236222
247
246
  };
248
247
  return n / r[e] * r[t];
249
248
  }
250
- function se(e, t = "pixel", n = ae) {
251
- return t === "pixel" ? e : oe(t, "pixel", e) * (n / ae);
249
+ function ae(e, t = "pixel", n = re) {
250
+ return t === "pixel" ? e : ie(t, "pixel", e) * (n / re);
252
251
  }
253
- var ce;
254
- function le() {
255
- if (ce === void 0) {
252
+ var oe;
253
+ function se() {
254
+ if (oe === void 0) {
256
255
  let e = document.createElement("canvas").getContext("webgl");
257
256
  try {
258
- ce = e ? e.getParameter(e.MAX_TEXTURE_SIZE) : 4096;
257
+ oe = e ? e.getParameter(e.MAX_TEXTURE_SIZE) : 4096;
259
258
  } catch {
260
- ce = 4096;
259
+ oe = 4096;
261
260
  } finally {
262
261
  e?.getExtension("WEBGL_lose_context")?.loseContext();
263
262
  }
264
263
  }
265
- return [ce, ce];
264
+ return [oe, oe];
266
265
  }
267
- function ue(e) {
266
+ function ce(e) {
268
267
  return 2 * Math.round(e / 2);
269
268
  }
270
- function H(e, t, n) {
269
+ function U(e, t, n) {
271
270
  return e + (t - e) * n;
272
271
  }
273
- function de(e, t, n) {
272
+ function le(e, t, n) {
274
273
  return (n - e) / (t - e);
275
274
  }
276
- function U(e, t, n) {
275
+ function ue(e, t, n) {
277
276
  return Math.max(Math.min(e, n), t);
278
277
  }
279
- function fe(e) {
278
+ function de(e) {
280
279
  return Array.from(new Set(e));
281
280
  }
282
- function pe(e) {
281
+ function fe(e) {
283
282
  let t = e.split("").map((e) => e.charCodeAt(0)).reduce((e, t) => (e ^= t, e + (e << 1) + (e << 4) + (e << 7) + (e << 8) + (e << 24)), 2166136261);
284
283
  return t ^= t << 3, t += t >> 5, t ^= t << 4, t += t >> 17, t ^= t << 25, t += t >> 6, `0000000${(t >>> 0).toString(16)}`.substr(-8);
285
284
  }
286
- function me(e, t, n, r) {
285
+ function pe(e, t, n, r) {
287
286
  if (t.clientWidth > 0 && t.clientHeight > 0) {
288
287
  let i = e.export?.size ?? [600, 400], a = e.export?.unit, o = [
289
288
  "jpg",
290
289
  "png",
291
290
  "tiff"
292
- ].includes(r), s = se(i[0], a), c = se(i[1], a);
293
- return Math.min(t.clientWidth / (n === "video" ? ue(s) : o ? Math.round(s) : s), t.clientHeight / (n === "video" ? ue(c) : o ? Math.round(c) : c));
291
+ ].includes(r), s = ae(i[0], a), c = ae(i[1], a);
292
+ return Math.min(t.clientWidth / (n === "video" ? ce(s) : o ? Math.round(s) : s), t.clientHeight / (n === "video" ? ce(c) : o ? Math.round(c) : c));
294
293
  }
295
294
  return 1;
296
295
  }
297
- function he(e, t, n = 1e-4) {
296
+ function me(e, t, n = 1e-4) {
298
297
  return Math.abs(e - t) < n;
299
298
  }
300
- function ge(e, t, n) {
301
- let { lng: r, lat: i } = e.getCenter(), a = e.getPitch() * Math.PI / 180, o = e.getBearing() * Math.PI / 180, s = _e(r, i), c = _e(t, n), l = ve(s, ye(xe(be([
299
+ function he(e, t, n) {
300
+ let { lng: r, lat: i } = e.getCenter(), a = e.getPitch() * Math.PI / 180, o = e.getBearing() * Math.PI / 180, s = ge(r, i), c = ge(t, n), l = _e(s, ve(be(ye([
302
301
  0,
303
302
  0,
304
303
  1
305
304
  ], s)), o), a);
306
305
  return l[0] * c[0] + l[1] * c[1] + l[2] * c[2] > .3;
307
306
  }
308
- function _e(e, t) {
307
+ function ge(e, t) {
309
308
  let n = t * Math.PI / 180, r = e * Math.PI / 180;
310
309
  return [
311
310
  Math.cos(n) * Math.cos(r),
@@ -313,7 +312,7 @@ function _e(e, t) {
313
312
  Math.sin(n)
314
313
  ];
315
314
  }
316
- function ve(e, t, n) {
315
+ function _e(e, t, n) {
317
316
  let [r, i, a] = e, [o, s, c] = t, l = Math.cos(n), u = Math.sin(n), d = r * o + i * s + a * c;
318
317
  return [
319
318
  r * l + (s * a - c * i) * u + o * d * (1 - l),
@@ -321,7 +320,7 @@ function ve(e, t, n) {
321
320
  a * l + (o * i - s * r) * u + c * d * (1 - l)
322
321
  ];
323
322
  }
324
- function ye(e, t) {
323
+ function ve(e, t) {
325
324
  let [n, r, i] = e, a = Math.cos(t), o = Math.sin(t);
326
325
  return [
327
326
  n * a - r * o,
@@ -329,7 +328,7 @@ function ye(e, t) {
329
328
  i
330
329
  ];
331
330
  }
332
- function be(e, t) {
331
+ function ye(e, t) {
333
332
  let [n, r, i] = e, [a, o, s] = t;
334
333
  return [
335
334
  r * s - i * o,
@@ -337,7 +336,7 @@ function be(e, t) {
337
336
  n * o - r * a
338
337
  ];
339
338
  }
340
- function xe(e) {
339
+ function be(e) {
341
340
  let [t, n, r] = e, i = Math.hypot(t, n, r);
342
341
  return [
343
342
  t / i,
@@ -347,7 +346,7 @@ function xe(e) {
347
346
  }
348
347
  //#endregion
349
348
  //#region src/utils/labelFreeAreas.ts
350
- function Se(e, t) {
349
+ function xe(e, t) {
351
350
  if (t === "video") return;
352
351
  let n = Array.from(e.getContainer().querySelectorAll(".adornment, .maplibregl-ctrl-attrib")), r = e.getCanvas().getBoundingClientRect(), i = n.map((e) => {
353
352
  let t = e.getBoundingClientRect(), n = t.x - r.x, i = t.y - r.y;
@@ -382,13 +381,14 @@ function Se(e, t) {
382
381
  }
383
382
  //#endregion
384
383
  //#region src/adornments/customAdornment.ts
384
+ var Se = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?\s*$/;
385
385
  function Ce(e, t, n) {
386
386
  let r = document.createElement("div");
387
387
  r.className = "adornment";
388
388
  let { svg: i, scale: a = 1 } = e, o = new DOMParser().parseFromString(i, "image/svg+xml").querySelector("svg");
389
389
  if (o) {
390
- let i = new RegExp(L.toString().replace(/^\/\^|\$\/$/g, "").replace(/.*/, "^($&)[, ]($&)[, ]($&)[, ]($&)$$")), s = o.getAttribute("width"), c = o.getAttribute("height"), l, u;
391
- if (s && c && L.test(s) && L.test(c)) l = Number(s), u = Number(c);
390
+ let i = new RegExp(Se.toString().replace(/^\/\^|\$\/$/g, "").replace(/.*/, "^($&)[, ]($&)[, ]($&)[, ]($&)$$")), s = o.getAttribute("width"), c = o.getAttribute("height"), l, u;
391
+ if (s && c && Se.test(s) && Se.test(c)) l = Number(s), u = Number(c);
392
392
  else {
393
393
  let e = i.exec(o.getAttribute("viewBox"));
394
394
  l = e ? Number(e[3]) : 300, u = e ? Number(e[4]) : 150;
@@ -734,7 +734,7 @@ var $e = class {
734
734
  });
735
735
  else {
736
736
  let { rgba: t } = r, n = i.getAttribute("fill-opacity");
737
- t[3] *= n ? U(Number(n), 0, 1) : 1, e.push({
737
+ t[3] *= n ? ue(Number(n), 0, 1) : 1, e.push({
738
738
  name: `fill#${a}`,
739
739
  color: st.fromRGB(t)
740
740
  });
@@ -750,7 +750,7 @@ var $e = class {
750
750
  });
751
751
  else {
752
752
  let { rgba: t } = n, r = i.getAttribute("stroke-opacity");
753
- t[3] *= r ? U(Number(r), 0, 1) : 1, e.push({
753
+ t[3] *= r ? ue(Number(r), 0, 1) : 1, e.push({
754
754
  name: `stroke#${a}`,
755
755
  color: st.fromRGB(t)
756
756
  });
@@ -1142,7 +1142,7 @@ var $e = class {
1142
1142
  let r = n.get(e);
1143
1143
  if (!r) {
1144
1144
  let i = e + t, a = new $e(e).getSvgSize(), o = Math.max(a[0] * t, 1), s = Math.max(a[1] * t, 1);
1145
- r = `mc-image-${pe(i)}`, this.promises.push(Be(e, o, s, this.fonts).then((e) => void this.map.addImage(r, e, { pixelRatio: t })).catch((e) => console.log(e))), n.set(e, r);
1145
+ r = `mc-image-${fe(i)}`, this.promises.push(Be(e, o, s, this.fonts).then((e) => void this.map.addImage(r, e, { pixelRatio: t })).catch((e) => console.log(e))), n.set(e, r);
1146
1146
  }
1147
1147
  return r;
1148
1148
  }
@@ -1176,11 +1176,11 @@ function it(e, t, n) {
1176
1176
  };
1177
1177
  }
1178
1178
  function q(e, t, n, r, i) {
1179
- let a = n ?? t, o = !r, s = a?.match(/\$\{([^}]+)}/)?.[1], c = s ? o ? ne(e[s]) : re(e[s]) : null, l = s ? o ? c : typeof c != "boolean" && c !== null && c !== "" ? r(c) : i : a;
1179
+ let a = n ?? t, o = !r, s = a?.match(/\$\{([^}]+)}/)?.[1], c = s ? o ? H(e[s]) : te(e[s]) : null, l = s ? o ? c : typeof c != "boolean" && c !== null && c !== "" ? r(c) : i : a;
1180
1180
  return l && !new st(l).badValue ? l : "#000000";
1181
1181
  }
1182
1182
  function at(e, t, n) {
1183
- return (n ?? t)?.split(Ue).map((t, n) => n & 1 ? ne(e[t]) : t).join("") || void 0;
1183
+ return (n ?? t)?.split(Ue).map((t, n) => n & 1 ? H(e[t]) : t).join("") || void 0;
1184
1184
  }
1185
1185
  function ot(e, t, n) {
1186
1186
  let r = t;
@@ -2215,7 +2215,7 @@ function bt(e, t) {
2215
2215
  }
2216
2216
  function xt(e, t, n) {
2217
2217
  let r = [], i = t / 100;
2218
- for (let t = 0; t <= 100; t++) r.push(St(e, t * i, R(n)));
2218
+ for (let t = 0; t <= 100; t++) r.push(St(e, t * i, L(n)));
2219
2219
  return S(vt(r), [
2220
2220
  -Infinity,
2221
2221
  -85.051129,
@@ -2224,17 +2224,17 @@ function xt(e, t, n) {
2224
2224
  ]).geometry.coordinates;
2225
2225
  }
2226
2226
  function St(e, t, n) {
2227
- let r = t / 6378.1, i = R(e.lng), a = R(e.lat), o = Math.asin(Math.sin(a) * Math.cos(r) + Math.cos(a) * Math.sin(r) * Math.cos(n));
2228
- return [z(i + Math.atan2(Math.sin(n) * Math.sin(r) * Math.cos(a), Math.cos(r) - Math.sin(a) * Math.sin(o))), z(o)];
2227
+ let r = t / 6378.1, i = L(e.lng), a = L(e.lat), o = Math.asin(Math.sin(a) * Math.cos(r) + Math.cos(a) * Math.sin(r) * Math.cos(n));
2228
+ return [R(i + Math.atan2(Math.sin(n) * Math.sin(r) * Math.cos(a), Math.cos(r) - Math.sin(a) * Math.sin(o))), R(o)];
2229
2229
  }
2230
2230
  function Ct(e, t) {
2231
- return B(e, {
2231
+ return z(e, {
2232
2232
  lng: 0,
2233
2233
  lat: 90
2234
2234
  }) / 1e3 < t;
2235
2235
  }
2236
2236
  function wt(e, t) {
2237
- return B(e, {
2237
+ return z(e, {
2238
2238
  lng: 0,
2239
2239
  lat: -90
2240
2240
  }) / 1e3 < t;
@@ -2244,15 +2244,15 @@ function Tt(e) {
2244
2244
  return t === "smooth" ? x(_t(n), { iterations: 4 }).features?.[0]?.geometry?.coordinates ?? n.slice() : n.slice();
2245
2245
  }
2246
2246
  function Et(e, t) {
2247
- return `${e}-${pe(`${t.vectorUrl}/${t.sourceLayerId}`)}`;
2247
+ return `${e}-${fe(`${t.vectorUrl}/${t.sourceLayerId}`)}`;
2248
2248
  }
2249
2249
  function Dt(e) {
2250
- return `custom-area-${pe(e.vectorUrl)}`;
2250
+ return `custom-area-${fe(e.vectorUrl)}`;
2251
2251
  }
2252
2252
  function Ot(e, t) {
2253
2253
  return e.reduce((e, n) => {
2254
2254
  let r = n.dataBindings?.[t];
2255
- return typeof r == "object" && r && r.t === "n" ? e.push(r.v) : typeof r == "number" ? e.push(r) : typeof r == "string" && r && e.push(L.test(r) ? Number(r) : r), e;
2255
+ return typeof r == "object" && r && r.t === "n" ? e.push(r.v) : (typeof r == "number" || typeof r == "string" && r) && e.push(r), e;
2256
2256
  }, []);
2257
2257
  }
2258
2258
  function kt(e, t) {
@@ -2435,7 +2435,7 @@ function Kt(e, t, n, r, i) {
2435
2435
  width: Math.max(0, ...k.map((e) => e.width)),
2436
2436
  height: Math.max(0, ...k.map((e) => e.height)),
2437
2437
  ascent: Math.max(0, ...k.map((e) => e.ascent))
2438
- }, F = N ? M.height + 10 : 0, I = N ? M.width : 0, ee = E.length - 1, L = U(45 * ee, Math.ceil(x ? (P.width + 10) * ee : (P.height + 10) * ee), Math.floor(x ? n.getContainer().clientWidth / r - 10 - Z * 2 : n.getContainer().clientHeight / r - 10 - Z * 2 - F)), R = Math.ceil(x ? Z * 2 + Math.max(I, L) : Z * 2 + Math.max(I, 25 + P.width)), z = Math.ceil(x ? Z * 2 + F + 20 + 5 + P.ascent : Z * 2 + F + L);
2438
+ }, F = N ? M.height + 10 : 0, I = N ? M.width : 0, ee = E.length - 1, L = ue(45 * ee, Math.ceil(x ? (P.width + 10) * ee : (P.height + 10) * ee), Math.floor(x ? n.getContainer().clientWidth / r - 10 - Z * 2 : n.getContainer().clientHeight / r - 10 - Z * 2 - F)), R = Math.ceil(x ? Z * 2 + Math.max(I, L) : Z * 2 + Math.max(I, 25 + P.width)), z = Math.ceil(x ? Z * 2 + F + 20 + 5 + P.ascent : Z * 2 + F + L);
2439
2439
  g && C.push(`
2440
2440
  <rect
2441
2441
  x="0"
@@ -2470,7 +2470,7 @@ function Kt(e, t, n, r, i) {
2470
2470
  />
2471
2471
  `);
2472
2472
  for (let e = 1; e < E.length - 1; e++) {
2473
- let t = E[e], n = O[e], r = k[e], i = H(0, L, de(w, T, t));
2473
+ let t = E[e], n = O[e], r = k[e], i = U(0, L, le(w, T, t));
2474
2474
  i > a && i < L - a && C.push(`
2475
2475
  <line
2476
2476
  x1="${x ? Math.floor(B + i) + .5 : B}"
@@ -2513,7 +2513,7 @@ function qt(e, t, n, r, i) {
2513
2513
  height: Math.max(0, ...T.map((e) => e.height)),
2514
2514
  ascent: Math.max(0, ...T.map((e) => e.ascent))
2515
2515
  }, k = D ? E.height + 10 : 0, A = D ? E.width : 0, j = o.length, M = 45, N = 15 / 2;
2516
- x ? (M = U(M, Math.ceil(O.height) + 10, Math.floor((n.getContainer().clientHeight / r - 10 - Z * 2 - k) / j)), c = Math.ceil(Z * 2 + k + j * M), l = Math.ceil(Z * 2 + Math.max(A, 25 + O.width))) : (M = U(M, Math.ceil(O.width) + 10, Math.floor((n.getContainer().clientWidth / r - 10 - Z * 2) / j)), l = Math.ceil(Z * 2 + Math.max(A, j * M)), c = Math.ceil(Z * 2 + k + 15 + 10 + O.ascent)), _ && s.push(`
2516
+ x ? (M = ue(M, Math.ceil(O.height) + 10, Math.floor((n.getContainer().clientHeight / r - 10 - Z * 2 - k) / j)), c = Math.ceil(Z * 2 + k + j * M), l = Math.ceil(Z * 2 + Math.max(A, 25 + O.width))) : (M = ue(M, Math.ceil(O.width) + 10, Math.floor((n.getContainer().clientWidth / r - 10 - Z * 2) / j)), l = Math.ceil(Z * 2 + Math.max(A, j * M)), c = Math.ceil(Z * 2 + k + 15 + 10 + O.ascent)), _ && s.push(`
2517
2517
  <rect
2518
2518
  x="0"
2519
2519
  y="0"
@@ -2668,7 +2668,7 @@ function Qt(e, t, n) {
2668
2668
  return a(), t.on("move", a), n !== "interactive" && t.on("resize", a), r;
2669
2669
  }
2670
2670
  function $t(e, t, n) {
2671
- let r = t.getPitch(), i = t.getBearing(), a = Math.cos(R(r));
2671
+ let r = t.getPitch(), i = t.getBearing(), a = Math.cos(L(r));
2672
2672
  return `
2673
2673
  <svg class="adornment-svg" data-adornment-name="${G(e.name)}" width="${n}" height="${n}" viewBox="-5 -5 30 30" xmlns="http://www.w3.org/2000/svg">
2674
2674
  <g class="tilt" transform="matrix(1 0 0 ${a} 0 ${10 * (1 - a)})">
@@ -2696,7 +2696,7 @@ function nn(e, t) {
2696
2696
  className: "control-button toggle-adornments-button",
2697
2697
  content: en,
2698
2698
  onClick: () => {
2699
- t.querySelectorAll(".adornment:not(.web-control)").forEach((e) => e.classList.toggle("hide")), t.querySelector(".toggle-adornments-button")?.classList.toggle("active"), Se(e, "interactive");
2699
+ t.querySelectorAll(".adornment:not(.web-control)").forEach((e) => e.classList.toggle("hide")), t.querySelector(".toggle-adornments-button")?.classList.toggle("active"), xe(e, "interactive");
2700
2700
  }
2701
2701
  });
2702
2702
  }
@@ -3442,19 +3442,19 @@ function Xn(e) {
3442
3442
  function Zn(e) {
3443
3443
  let { clientWidth: t, clientHeight: n } = e.getCanvas(), r = [];
3444
3444
  for (let n = 0; n < 64; n++) {
3445
- let { lng: i, lat: a } = e.unprojectWithScaleCorrection([H(0, t, n / 64), 0]);
3445
+ let { lng: i, lat: a } = e.unprojectWithScaleCorrection([U(0, t, n / 64), 0]);
3446
3446
  r.push([i, a]);
3447
3447
  }
3448
3448
  for (let i = 0; i < 64; i++) {
3449
- let { lng: a, lat: o } = e.unprojectWithScaleCorrection([t, H(0, n, i / 64)]);
3449
+ let { lng: a, lat: o } = e.unprojectWithScaleCorrection([t, U(0, n, i / 64)]);
3450
3450
  r.push([a, o]);
3451
3451
  }
3452
3452
  for (let i = 0; i < 64; i++) {
3453
- let { lng: a, lat: o } = e.unprojectWithScaleCorrection([H(t, 0, i / 64), n]);
3453
+ let { lng: a, lat: o } = e.unprojectWithScaleCorrection([U(t, 0, i / 64), n]);
3454
3454
  r.push([a, o]);
3455
3455
  }
3456
3456
  for (let t = 0; t < 64; t++) {
3457
- let { lng: i, lat: a } = e.unprojectWithScaleCorrection([0, H(n, 0, t / 64)]);
3457
+ let { lng: i, lat: a } = e.unprojectWithScaleCorrection([0, U(n, 0, t / 64)]);
3458
3458
  r.push([i, a]);
3459
3459
  }
3460
3460
  let { lng: i, lat: a } = e.unprojectWithScaleCorrection([0, 0]);
@@ -3521,8 +3521,8 @@ function rr(e, t, n, r) {
3521
3521
  };
3522
3522
  }
3523
3523
  function ir(e, t, n, r, i) {
3524
- let { maxWidth: a = 100, fontSize: o = 8, color: s = "#000000", unit: c = "metric_and_imperial" } = t, l = i.resolve(t.font ?? r, "700"), u = e.getCenter(), d = e.project(u), f = B(u, e.unproject([d.x + a, d.y])), p = Object.fromEntries(Object.entries(nr).map(([e, t]) => {
3525
- let n = oe("meter", e, f), r = er(n) || 0;
3524
+ let { maxWidth: a = 100, fontSize: o = 8, color: s = "#000000", unit: c = "metric_and_imperial" } = t, l = i.resolve(t.font ?? r, "700"), u = e.getCenter(), d = e.project(u), f = z(u, e.unproject([d.x + a, d.y])), p = Object.fromEntries(Object.entries(nr).map(([e, t]) => {
3525
+ let n = ie("meter", e, f), r = er(n) || 0;
3526
3526
  return [e, {
3527
3527
  value: n,
3528
3528
  ratio: n ? r / n : 0,
@@ -3940,8 +3940,38 @@ function Q(e, t, n, r) {
3940
3940
  i?.[a].hasChildNodes() || (r = a), (i?.[r])?.appendChild(t);
3941
3941
  }
3942
3942
  //#endregion
3943
- //#region src/utils/mapstyle.ts
3943
+ //#region src/utils/jobObject.ts
3944
3944
  function xr(e) {
3945
+ let t = e.registry, n = t?.models;
3946
+ if (!n) return {
3947
+ ...e,
3948
+ version: 2
3949
+ };
3950
+ let r = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?\s*$/, i = (e) => typeof e == "string" && r.test(e) && isFinite(e) ? {
3951
+ t: "n",
3952
+ v: Number(e),
3953
+ w: e,
3954
+ z: "custom"
3955
+ } : e, a = Object.fromEntries(Object.entries(n).map(([e, t]) => [e, t?.map((e) => ({
3956
+ ...e,
3957
+ models: e.models.map((e) => ({
3958
+ ...e,
3959
+ dataBindings: e.dataBindings && Object.fromEntries(Object.entries(e.dataBindings).map(([e, t]) => [e, i(t)]))
3960
+ }))
3961
+ }))]));
3962
+ return {
3963
+ ...e,
3964
+ registry: {
3965
+ ...t,
3966
+ models: a
3967
+ },
3968
+ version: 2
3969
+ };
3970
+ }
3971
+ var Sr = [(e) => e, xr], Cr = (e) => Sr.slice(e.version || 1).reduce((e, t) => t(e), e);
3972
+ //#endregion
3973
+ //#region src/utils/mapstyle.ts
3974
+ function wr(e) {
3945
3975
  for (let t of dr) {
3946
3976
  let n = fr[t];
3947
3977
  e.layers.find((e) => e.id === n) === void 0 && (e.sources.empty === void 0 && (e.sources.empty = {
@@ -3960,12 +3990,12 @@ function xr(e) {
3960
3990
  }
3961
3991
  //#endregion
3962
3992
  //#region src/models/polygon.ts
3963
- function Sr(e, t, n, r, i) {
3993
+ function Tr(e, t, n, r, i) {
3964
3994
  e.addSource(t.id, {
3965
3995
  type: "geojson",
3966
3996
  data: {
3967
3997
  type: "FeatureCollection",
3968
- features: t.models.filter((e) => e.visible ?? !0).map((e) => Cr(t, e, r, i))
3998
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => Er(t, e, r, i))
3969
3999
  }
3970
4000
  }), e.addLayer({
3971
4001
  id: t.id,
@@ -4023,11 +4053,11 @@ function Sr(e, t, n, r, i) {
4023
4053
  }
4024
4054
  }, n);
4025
4055
  }
4026
- function Cr(e, t, n, r) {
4056
+ function Er(e, t, n, r) {
4027
4057
  let i = t.fillPattern === void 0 ? void 0 : r.getMapLibreImageKey(n[t.fillPattern], 2 * window.devicePixelRatio);
4028
4058
  return {
4029
4059
  type: "Feature",
4030
- id: V(t.id),
4060
+ id: B(t.id),
4031
4061
  properties: {
4032
4062
  id: t.id,
4033
4063
  "fill-color": e.fillColor || t.fillColor ? q(t.dataBindings ?? {}, t.fillColor, e.fillColor) : "#000000",
@@ -4043,12 +4073,12 @@ function Cr(e, t, n, r) {
4043
4073
  }
4044
4074
  //#endregion
4045
4075
  //#region src/models/circle.ts
4046
- function wr(e, t, n, r, i) {
4076
+ function Dr(e, t, n, r, i) {
4047
4077
  e.addSource(t.id, {
4048
4078
  type: "geojson",
4049
4079
  data: {
4050
4080
  type: "FeatureCollection",
4051
- features: t.models.filter((e) => e.visible ?? !0).map((e) => Tr(t, e, 1, r, i))
4081
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => Or(t, e, 1, r, i))
4052
4082
  }
4053
4083
  }), e.addLayer({
4054
4084
  id: t.id,
@@ -4142,11 +4172,11 @@ function wr(e, t, n, r, i) {
4142
4172
  }
4143
4173
  }, n);
4144
4174
  }
4145
- function Tr(e, t, n, r, i) {
4175
+ function Or(e, t, n, r, i) {
4146
4176
  let a = t.fillPattern === void 0 ? void 0 : i.getMapLibreImageKey(r[t.fillPattern], 2 * window.devicePixelRatio);
4147
4177
  return {
4148
4178
  type: "Feature",
4149
- id: V(t.id),
4179
+ id: B(t.id),
4150
4180
  properties: {
4151
4181
  id: t.id,
4152
4182
  "fill-color": e.fillColor || t.fillColor ? q(t.dataBindings ?? {}, t.fillColor, e.fillColor) : "#000000",
@@ -4171,13 +4201,13 @@ function Tr(e, t, n, r, i) {
4171
4201
  }
4172
4202
  //#endregion
4173
4203
  //#region src/models/marker.ts
4174
- var Er = "Roboto-Regular";
4175
- function Dr(e, t, n, r, i, a) {
4204
+ var kr = "Roboto-Regular";
4205
+ function Ar(e, t, n, r, i, a) {
4176
4206
  let o = [], s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = ["match", ["get", "text-font"]], u = !!t.clustering;
4177
- for (let n of t.models) (n.visible ?? !0) && o.push(kr(e, t, n, 1, r, i)), s.add(n.textFont), c.add(n.textLineHeight ?? 1.2);
4207
+ for (let n of t.models) (n.visible ?? !0) && o.push(Mr(e, t, n, 1, r, i)), s.add(n.textFont), c.add(n.textLineHeight ?? 1.2);
4178
4208
  if (Array.from(s).length > 0) {
4179
- for (let e of Array.from(s)) l.push(e, ["literal", [e, Er]]);
4180
- l.push(["literal", [Er]]);
4209
+ for (let e of Array.from(s)) l.push(e, ["literal", [e, kr]]);
4210
+ l.push(["literal", [kr]]);
4181
4211
  }
4182
4212
  e.addSource(t.id, {
4183
4213
  type: "geojson",
@@ -4274,7 +4304,7 @@ function Dr(e, t, n, r, i, a) {
4274
4304
  stops: t.clusterTextColor ?? []
4275
4305
  } },
4276
4306
  layout: {
4277
- "text-font": ["literal", [Er]],
4307
+ "text-font": ["literal", [kr]],
4278
4308
  "text-field": "{point_count_abbreviated}",
4279
4309
  "text-size": {
4280
4310
  property: "point_count",
@@ -4345,9 +4375,9 @@ function Dr(e, t, n, r, i, a) {
4345
4375
  ["!", ["has", "point_count"]]
4346
4376
  ]
4347
4377
  });
4348
- }), Or(e, t)));
4378
+ }), jr(e, t)));
4349
4379
  }
4350
- function Or(e, t) {
4380
+ function jr(e, t) {
4351
4381
  e.on("click", `${t.id}-circle-cluster`, async (t) => {
4352
4382
  let n = e.queryRenderedFeatures(t.point).find((e) => e.properties.cluster);
4353
4383
  if (!n) return;
@@ -4360,11 +4390,11 @@ function Or(e, t) {
4360
4390
  });
4361
4391
  });
4362
4392
  }
4363
- function kr(e, t, n, r, i, a) {
4393
+ function Mr(e, t, n, r, i, a) {
4364
4394
  let o = n.svg === void 0 ? void 0 : ot(n.dataBindings ?? {}, i[n.svg], t.svg ? i[t.svg] : void 0), s = o === void 0 ? void 0 : a.getMapLibreImageKey(o, window.devicePixelRatio * (n.iconScale ?? 1) * e.getScale()), c = o === void 0 ? void 0 : Qe(o);
4365
4395
  return {
4366
4396
  type: "Feature",
4367
- id: V(n.id),
4397
+ id: B(n.id),
4368
4398
  properties: {
4369
4399
  id: n.id,
4370
4400
  "mc-image-key": s,
@@ -4401,25 +4431,25 @@ function kr(e, t, n, r, i, a) {
4401
4431
  }
4402
4432
  //#endregion
4403
4433
  //#region src/utils/overlays.ts
4404
- async function Ar(e, t, n, r, i, a) {
4405
- let o = await Promise.all(t.map((e) => `${r}/styles/${e}.json?access_token=${i}`).map((e) => fetch(e).then((e) => e.json()))), s = fe(o.map((e) => e.sprite).filter((e) => typeof e == "string"));
4434
+ async function Nr(e, t, n, r, i, a) {
4435
+ let o = await Promise.all(t.map((e) => `${r}/styles/${e}.json?access_token=${i}`).map((e) => fetch(e).then((e) => e.json()))), s = de(o.map((e) => e.sprite).filter((e) => typeof e == "string"));
4406
4436
  await Promise.all(s.map((e) => n.loadSprite(e).then((e) => n.addImages(e)).catch(() => {})));
4407
4437
  for (let t = 0; t < e.length; t++) {
4408
4438
  let r = e[t], i = o[t];
4409
4439
  for (let e of i.layers) e.metadata === void 0 && (e.metadata = {}), e.metadata["mc-original-layer-id"] = e.id, e.id = `${r} | ${e.id}`;
4410
- jr(i, n, a);
4440
+ Pr(i, n, a);
4411
4441
  }
4412
4442
  return o;
4413
4443
  }
4414
- function jr(e, t, n) {
4444
+ function Pr(e, t, n) {
4415
4445
  for (let n in e.sources) t.getSource(n) === void 0 && t.addSource(n, e.sources[n]);
4416
4446
  for (let r of e.layers) {
4417
4447
  t.getLayer(r.id) !== void 0 && t.removeLayer(r.id);
4418
4448
  let e = r.metadata?.["mc-add-before"] ?? "mc-before-none";
4419
- t.addLayer(Mr(r, n), e);
4449
+ t.addLayer(Fr(r, n), e);
4420
4450
  }
4421
4451
  }
4422
- function Mr(e, t) {
4452
+ function Fr(e, t) {
4423
4453
  let n = t ?? {}, r = e.metadata?.["mc-original-layer-id"], i = r === void 0 ? {} : n[r] ?? {}, a = {
4424
4454
  ...e,
4425
4455
  layout: {
@@ -4439,23 +4469,23 @@ function Mr(e, t) {
4439
4469
  }
4440
4470
  //#endregion
4441
4471
  //#region src/images/popup-previous.svg?raw
4442
- var Nr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m0 4.647 4.282 4.4a.814.814 0 0 0 1.166-1.134L2.27 4.647l3.178-3.266A.814.814 0 1 0 4.282.246z\"/></svg>\n", Pr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"11\" viewBox=\"0 0 10 11\" fill=\"currentColor\"><path d=\"M.21.71a.714.714 0 0 1 1.011 0l3.78 3.78L8.778.71a.715.715 0 0 1 1.013 1.01L6.01 5.501l3.78 3.778a.715.715 0 0 1-1.01 1.012L5 6.51l-3.779 3.78A.716.716 0 0 1 .21 9.28L3.99 5.5.21 1.721A.714.714 0 0 1 .21.71\"/></svg>\n", Fr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m5.678 4.647-4.282 4.4A.814.814 0 1 1 .23 7.914l3.177-3.266L.23 1.381A.814.814 0 1 1 1.396.246z\"/></svg>\n", Ir = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 40 40\" stroke=\"currentColor\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 4.167 1.667 35.834h36.667z\" stroke-width=\"2\" stroke-linejoin=\"round\"/><path d=\"M20 29.167v.834m0-14.167.007 8.333\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n";
4472
+ var Ir = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m0 4.647 4.282 4.4a.814.814 0 0 0 1.166-1.134L2.27 4.647l3.178-3.266A.814.814 0 1 0 4.282.246z\"/></svg>\n", Lr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"11\" viewBox=\"0 0 10 11\" fill=\"currentColor\"><path d=\"M.21.71a.714.714 0 0 1 1.011 0l3.78 3.78L8.778.71a.715.715 0 0 1 1.013 1.01L6.01 5.501l3.78 3.778a.715.715 0 0 1-1.01 1.012L5 6.51l-3.779 3.78A.716.716 0 0 1 .21 9.28L3.99 5.5.21 1.721A.714.714 0 0 1 .21.71\"/></svg>\n", Rr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m5.678 4.647-4.282 4.4A.814.814 0 1 1 .23 7.914l3.177-3.266L.23 1.381A.814.814 0 1 1 1.396.246z\"/></svg>\n", zr = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 40 40\" stroke=\"currentColor\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 4.167 1.667 35.834h36.667z\" stroke-width=\"2\" stroke-linejoin=\"round\"/><path d=\"M20 29.167v.834m0-14.167.007 8.333\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n";
4443
4473
  //#endregion
4444
4474
  //#region src/utils/youtube.ts
4445
- function Lr(e, t) {
4446
- let { allowFullscreen: n, loop: r } = e, i = te(e.src, t), a, o = i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];
4475
+ function Br(e, t) {
4476
+ let { allowFullscreen: n, loop: r } = e, i = V(e.src, t), a, o = i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];
4447
4477
  a = o ? `https://www.youtube.com/embed/${o}` : i;
4448
4478
  let s = [];
4449
- if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a = zr(a), a = Rr(a), s.length) {
4479
+ if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a = Hr(a), a = Vr(a), s.length) {
4450
4480
  let e = a.includes("?") ? "&" : "?";
4451
4481
  a += `${e}${s.join("&")}`;
4452
4482
  }
4453
4483
  return a;
4454
4484
  }
4455
- function Rr(e) {
4485
+ function Vr(e) {
4456
4486
  return e.replace(/([?&])si=[^&]+(&)?/, (e, t, n) => t === "?" && !n ? "" : t === "?" && n ? "?" : n ? "&" : "");
4457
4487
  }
4458
- function zr(e) {
4488
+ function Hr(e) {
4459
4489
  let t = new URL(e), n = t.searchParams.get("t");
4460
4490
  if (!n) return e;
4461
4491
  let r = 0, i = /^((\d+)m)?((\d+)s)?$/;
@@ -4471,18 +4501,18 @@ function zr(e) {
4471
4501
  }
4472
4502
  //#endregion
4473
4503
  //#region src/utils/template.ts
4474
- function Br(e, t, n, r) {
4504
+ function Ur(e, t, n, r) {
4475
4505
  let i;
4476
- if (t?.type === "video") i = r ? Gr(t.src, n) : `
4506
+ if (t?.type === "video") i = r ? Jr(t.src, n) : `
4477
4507
  <div class="youtube-container">
4478
4508
  <iframe
4479
- src="${Lr(t, n)}"
4509
+ src="${Br(t, n)}"
4480
4510
  width="100%" height="300" style="border: none" allowfullscreen>
4481
4511
  </iframe>
4482
4512
  </div>
4483
4513
  `;
4484
4514
  else if (t?.type === "image") {
4485
- let e = te(t.src, n), r = te(t.alt, n);
4515
+ let e = V(t.src, n), r = V(t.alt, n);
4486
4516
  i = `
4487
4517
  <div class="image-container ${t.fill ? "fill" : ""}">
4488
4518
  <img src="${e}" alt="${r}" />
@@ -4490,7 +4520,7 @@ function Br(e, t, n, r) {
4490
4520
  `;
4491
4521
  }
4492
4522
  i = i ? `<div class="media-content">${i}</div>` : "";
4493
- let a = e ? `<div class="text-content">${Ur(e, n)}</div>` : "";
4523
+ let a = e ? `<div class="text-content">${Kr(e, n)}</div>` : "";
4494
4524
  return `
4495
4525
  <div class="popup-scroll-wrapper">
4496
4526
  <div class="mc-popup">
@@ -4500,38 +4530,38 @@ function Br(e, t, n, r) {
4500
4530
  </div>
4501
4531
  `;
4502
4532
  }
4503
- var Vr = `
4533
+ var Wr = `
4504
4534
  <button class="mc-popup-button close">
4505
- ${Pr}
4535
+ ${Lr}
4506
4536
  </button>
4507
- `, Hr = `
4537
+ `, Gr = `
4508
4538
  <div class="cycle-buttons">
4509
4539
  <button class="mc-popup-button prev">
4510
- ${Nr}
4540
+ ${Ir}
4511
4541
  </button>
4512
4542
  <button class="mc-popup-button next">
4513
- ${Fr}
4543
+ ${Rr}
4514
4544
  </button>
4515
4545
  </div>
4516
4546
  `;
4517
- function Ur(e, t) {
4547
+ function Kr(e, t) {
4518
4548
  return e ? (e = e.replace(/placeholder="[^"]+"/, ""), e = e.replace(/onerror="[^"]+"/, ""), e = e.replace(/youtube\.com\/embed\/\$([^"'<>\\]+)/gi, (e, n) => {
4519
- let r = ne(t[n]);
4520
- return r ? `youtube.com/embed/${ie(r)}?` : "";
4549
+ let r = H(t[n]);
4550
+ return r ? `youtube.com/embed/${ne(r)}?` : "";
4521
4551
  }), e = e.replace(/(\S+?)\s*=\s*"\$([^"]+?)"/g, (e, n, r) => {
4522
- let i = ne(t[r]);
4523
- return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${Wr(i)}"` : ` ${n}="${i}"`;
4524
- }), e = e.replace(/>\$(.+?)</gi, (e, n) => `>${ne(t[n])}<`), e = e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim, (e, t) => t), e) : "";
4552
+ let i = H(t[r]);
4553
+ return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${qr(i)}"` : ` ${n}="${i}"`;
4554
+ }), e = e.replace(/>\$(.+?)</gi, (e, n) => `>${H(t[n])}<`), e = e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim, (e, t) => t), e) : "";
4525
4555
  }
4526
- function Wr(e) {
4556
+ function qr(e) {
4527
4557
  return /^https?:\/\//i.test(e) ? e : `https://${e}`;
4528
4558
  }
4529
- function Gr(e, t) {
4559
+ function Jr(e, t) {
4530
4560
  return `
4531
4561
  <div class="youtube-placeholder">
4532
- <img src="${`https://img.youtube.com/vi/${ie(te(e, t))}/hqdefault.jpg`}" />
4562
+ <img src="${`https://img.youtube.com/vi/${ne(V(e, t))}/hqdefault.jpg`}" />
4533
4563
  <div class="popup-alert">
4534
- <div class="alert-icon">${Ir}</div>
4564
+ <div class="alert-icon">${zr}</div>
4535
4565
  <div>${Pn("videoAlert")}</div>
4536
4566
  </div>
4537
4567
  </div>
@@ -4539,14 +4569,14 @@ function Gr(e, t) {
4539
4569
  }
4540
4570
  //#endregion
4541
4571
  //#region src/Registry.ts
4542
- var Kr = [
4572
+ var Yr = [
4543
4573
  "area",
4544
4574
  "circle",
4545
4575
  "dot",
4546
4576
  "line",
4547
4577
  "marker",
4548
4578
  "polygon"
4549
- ], qr = class {
4579
+ ], Xr = class {
4550
4580
  models;
4551
4581
  groups;
4552
4582
  customGroupIds;
@@ -4566,7 +4596,7 @@ var Kr = [
4566
4596
  marker: {},
4567
4597
  polygon: {}
4568
4598
  };
4569
- for (let t of Kr) for (let n of e.registry?.models?.[t] ?? []) {
4599
+ for (let t of Yr) for (let n of e.registry?.models?.[t] ?? []) {
4570
4600
  this.models[t][n.id] = {}, this.groups[t][n.id] = n;
4571
4601
  for (let e of n.models) {
4572
4602
  if (t === "area") {
@@ -4612,7 +4642,7 @@ var Kr = [
4612
4642
  }
4613
4643
  return e.reverse();
4614
4644
  }
4615
- }, Jr = class {
4645
+ }, Zr = class {
4616
4646
  map;
4617
4647
  popupElements;
4618
4648
  currentPopupElement;
@@ -4728,7 +4758,7 @@ var Kr = [
4728
4758
  ]), n.forEach((n) => {
4729
4759
  this.map.setFeatureState({
4730
4760
  source: e,
4731
- id: V(n.modelId)
4761
+ id: B(n.modelId)
4732
4762
  }, { highlighted: n.modelId === t });
4733
4763
  }));
4734
4764
  }
@@ -4764,7 +4794,7 @@ var Kr = [
4764
4794
  e.getNorthEast(),
4765
4795
  e.getNorthWest(),
4766
4796
  e.getSouthEast()
4767
- ].some((e) => !ge(this.map, e.lng, e.lat))) {
4797
+ ].some((e) => !he(this.map, e.lng, e.lat))) {
4768
4798
  i.easeTo({
4769
4799
  center: e.getCenter(),
4770
4800
  duration: 500
@@ -4796,7 +4826,7 @@ var Kr = [
4796
4826
  });
4797
4827
  }
4798
4828
  }
4799
- }, Yr = class {
4829
+ }, Qr = class {
4800
4830
  map;
4801
4831
  youTubePlaceholder;
4802
4832
  language = "en";
@@ -4817,7 +4847,7 @@ var Kr = [
4817
4847
  this.map = e, this.youTubePlaceholder = t, this.mapContainer = this.map.getContainer(), this.popupContainer = document.createElement("div"), this.popupContainer.classList.add("popup-container"), this.map.on("mousemove", (e) => this.onMouseMove(e)), this.map.on("click", (e) => this.onClick(e));
4818
4848
  }
4819
4849
  setJobObject(e) {
4820
- this.registry = new qr(e);
4850
+ this.registry = new Xr(e);
4821
4851
  }
4822
4852
  setParams(e, t, n, r) {
4823
4853
  this.popupPosition = e, this.language = t, this.restrictMapMovement = n, this.center = r;
@@ -4829,7 +4859,7 @@ var Kr = [
4829
4859
  this.popupElements = this.registry.getPopupElements();
4830
4860
  }
4831
4861
  setHighlightManager() {
4832
- this.highlightManager = new Jr(this.map, this.popupElements);
4862
+ this.highlightManager = new Zr(this.map, this.popupElements);
4833
4863
  }
4834
4864
  onMouseMove(e) {
4835
4865
  this.feature = this.getInteractiveFeature(e), this.feature ? this.map.getCanvas().style.cursor = "pointer" : this.map.getCanvas().style.cursor = "";
@@ -4875,7 +4905,7 @@ var Kr = [
4875
4905
  }
4876
4906
  getTemplate(e) {
4877
4907
  let { layer: t } = e, n, r = this.registry.getModel(e);
4878
- if (r?.popup || r?.popupMedia) n = Br(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder);
4908
+ if (r?.popup || r?.popupMedia) n = Ur(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder);
4879
4909
  else {
4880
4910
  let r = [];
4881
4911
  this.publication && (r.push(`:${this.publication}-${this.language}`), r.push(`:${this.publication}-:en`)), r.push(`:${this.language}`), r.push(":en"), r.push("");
@@ -4899,11 +4929,11 @@ var Kr = [
4899
4929
  return t.innerHTML = e.trim(), t.content.firstElementChild;
4900
4930
  }
4901
4931
  addPopupControls() {
4902
- let e = this.htmlToElement(Vr);
4932
+ let e = this.htmlToElement(Wr);
4903
4933
  if (e && (e.addEventListener("click", () => {
4904
4934
  this.hidePopup(), this.highlightManager.highlight(void 0);
4905
4935
  }), this.popupContainer.appendChild(e)), this.popupElements.length > 1) {
4906
- let e = this.htmlToElement(Hr);
4936
+ let e = this.htmlToElement(Gr);
4907
4937
  e && (e.querySelector(".prev")?.addEventListener("click", () => this.cyclePopups(!1)), e.querySelector(".next")?.addEventListener("click", () => this.cyclePopups()), this.popupContainer.appendChild(e));
4908
4938
  }
4909
4939
  }
@@ -4940,17 +4970,17 @@ var Kr = [
4940
4970
  n = e ? t === this.popupElements.length - 1 ? 0 : t + 1 : t === 0 ? this.popupElements.length - 1 : t - 1;
4941
4971
  let r = this.popupElements?.[n];
4942
4972
  this.currentModelId = r.modelId, this.highlightManager.highlight(r, !0);
4943
- let i = Br(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder), a = this.popupContainer;
4973
+ let i = Ur(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder), a = this.popupContainer;
4944
4974
  this.popupContainer.remove(), a.innerHTML = i, this.mapContainer.appendChild(a), this.addPopupControls(), e ? this.popupContainer.querySelector(".mc-popup-button.next")?.focus() : this.popupContainer.querySelector(".mc-popup-button.prev")?.focus();
4945
4975
  }
4946
4976
  }
4947
- }, Xr = class {
4977
+ }, $r = class {
4948
4978
  line;
4949
4979
  mercatorLine;
4950
4980
  distances;
4951
4981
  totalLength;
4952
4982
  constructor(e) {
4953
- this.line = e.filter((t, n) => n === 0 || e[n][0] !== e[n - 1][0] || e[n][1] !== e[n - 1][1]), this.mercatorLine = this.line.map((e) => a.fromLngLat(e)), this.distances = Zr(this.mercatorLine), this.totalLength = this.distances[this.distances.length - 1];
4983
+ this.line = e.filter((t, n) => n === 0 || e[n][0] !== e[n - 1][0] || e[n][1] !== e[n - 1][1]), this.mercatorLine = this.line.map((e) => a.fromLngLat(e)), this.distances = ei(this.mercatorLine), this.totalLength = this.distances[this.distances.length - 1];
4954
4984
  }
4955
4985
  sample(e) {
4956
4986
  let t = this.mercatorLine, n = this.distances;
@@ -4960,7 +4990,7 @@ var Kr = [
4960
4990
  let i = t[r - 1], o = t[r], s = n[r - 1], c = n[r];
4961
4991
  if (c >= e) {
4962
4992
  let t = (e - s) / (c - s);
4963
- return new a(H(i.x, o.x, t), H(i.y, o.y, t));
4993
+ return new a(U(i.x, o.x, t), U(i.y, o.y, t));
4964
4994
  }
4965
4995
  }
4966
4996
  return new a(t[t.length - 1].x, t[t.length - 1].y);
@@ -4970,11 +5000,11 @@ var Kr = [
4970
5000
  let n = this.mercatorLine.filter((n, r) => this.distances[r] >= e * this.totalLength && this.distances[r] <= t * this.totalLength);
4971
5001
  if (e > 0) {
4972
5002
  let t = this.sample(e);
4973
- Qr(t, n[0]) || n.unshift(t);
5003
+ ti(t, n[0]) || n.unshift(t);
4974
5004
  }
4975
5005
  if (t < 1) {
4976
5006
  let e = this.sample(t);
4977
- Qr(e, n[n.length - 1]) || n.push(e);
5007
+ ti(e, n[n.length - 1]) || n.push(e);
4978
5008
  }
4979
5009
  return n.map((e) => {
4980
5010
  let { lng: t, lat: n } = e.toLngLat();
@@ -4985,7 +5015,7 @@ var Kr = [
4985
5015
  return this.totalLength;
4986
5016
  }
4987
5017
  };
4988
- function Zr(e) {
5018
+ function ei(e) {
4989
5019
  let t = 0, n = [t];
4990
5020
  for (let r = 1; r < e.length; ++r) {
4991
5021
  let i = e[r - 1], a = e[r], o = a.x - i.x, s = a.y - i.y;
@@ -4993,24 +5023,24 @@ function Zr(e) {
4993
5023
  }
4994
5024
  return n;
4995
5025
  }
4996
- function Qr(e, t) {
5026
+ function ti(e, t) {
4997
5027
  return e.x === t.x && e.y === t.y;
4998
5028
  }
4999
5029
  //#endregion
5000
5030
  //#region src/models/line.ts
5001
- var $r = {
5031
+ var ni = {
5002
5032
  solid: [1, 0],
5003
5033
  dotted: [.7, .3],
5004
5034
  dashed: [3.5, 1.5]
5005
5035
  };
5006
- function ei(e, t, n, r, i) {
5036
+ function ri(e, t, n, r, i) {
5007
5037
  e.addSource(t.id, {
5008
5038
  type: "geojson",
5009
5039
  data: {
5010
5040
  type: "FeatureCollection",
5011
- features: t.models.filter((e) => e.visible ?? !0).map((n) => ti(e, t, n, 1, r))
5041
+ features: t.models.filter((e) => e.visible ?? !0).map((n) => ii(e, t, n, 1, r))
5012
5042
  }
5013
- }), Object.entries($r).forEach(([r, i]) => {
5043
+ }), Object.entries(ni).forEach(([r, i]) => {
5014
5044
  t.models.some((e) => (e.lineStyle ?? "solid") === r) && e.addLayer({
5015
5045
  id: `${t.id}-${r}`,
5016
5046
  type: "line",
@@ -5093,11 +5123,11 @@ function ei(e, t, n, r, i) {
5093
5123
  ]
5094
5124
  }, n);
5095
5125
  }
5096
- function ti(e, t, n, r, i) {
5097
- let a = new Xr(n.geometry).slice(0, r), o = n.svg !== void 0 && a.length > 1 ? ot(n.dataBindings ?? {}, n.svg, void 0) : void 0, s = o === void 0 ? void 0 : i.getMapLibreImageKey(o, window.devicePixelRatio * (n.iconScale ?? 1) * e.getScale());
5126
+ function ii(e, t, n, r, i) {
5127
+ let a = new $r(n.geometry).slice(0, r), o = n.svg !== void 0 && a.length > 1 ? ot(n.dataBindings ?? {}, n.svg, void 0) : void 0, s = o === void 0 ? void 0 : i.getMapLibreImageKey(o, window.devicePixelRatio * (n.iconScale ?? 1) * e.getScale());
5098
5128
  return {
5099
5129
  type: "Feature",
5100
- id: V(n.id),
5130
+ id: B(n.id),
5101
5131
  properties: {
5102
5132
  id: n.id,
5103
5133
  "line-width": n.lineWidth ?? 3,
@@ -5105,7 +5135,7 @@ function ti(e, t, n, r, i) {
5105
5135
  "line-style": n.lineStyle ?? "solid",
5106
5136
  "mc-image-key": s,
5107
5137
  "mc-svg-string": o,
5108
- "icon-rotate": ni(n, a, e),
5138
+ "icon-rotate": ai(n, a, e),
5109
5139
  "icon-offset": n.iconOffset,
5110
5140
  "icon-size": n.iconScale
5111
5141
  },
@@ -5121,12 +5151,12 @@ function ti(e, t, n, r, i) {
5121
5151
  }
5122
5152
  };
5123
5153
  }
5124
- function ni(e, t, n) {
5154
+ function ai(e, t, n) {
5125
5155
  return e.iconRotation ? e.iconAlign ? kt(t, n) + e.iconRotation : e.iconRotation : 0;
5126
5156
  }
5127
5157
  //#endregion
5128
5158
  //#region src/models/area.ts
5129
- function ri(e, t, n, r, i, a, o) {
5159
+ function oi(e, t, n, r, i, a, o) {
5130
5160
  let s = It(t), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
5131
5161
  for (let e of t.models) {
5132
5162
  let n = e.featureId, a = t.id, o = [], u = Dt(e), d = Et(a, e), f = l.get(d) ?? {
@@ -5294,12 +5324,12 @@ function ri(e, t, n, r, i, a, o) {
5294
5324
  }
5295
5325
  //#endregion
5296
5326
  //#region src/models/dot.ts
5297
- function ii(e, t, n) {
5327
+ function si(e, t, n) {
5298
5328
  e.addSource(t.id, {
5299
5329
  type: "geojson",
5300
5330
  data: {
5301
5331
  type: "FeatureCollection",
5302
- features: t.models.filter((e) => e.visible ?? !0).map((e) => ai(t, e))
5332
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => ci(t, e))
5303
5333
  }
5304
5334
  }), e.addLayer({
5305
5335
  id: t.id,
@@ -5320,7 +5350,7 @@ function ii(e, t, n) {
5320
5350
  }
5321
5351
  }, n);
5322
5352
  }
5323
- function ai(e, t) {
5353
+ function ci(e, t) {
5324
5354
  return {
5325
5355
  type: "Feature",
5326
5356
  id: t.id,
@@ -5337,7 +5367,7 @@ function ai(e, t) {
5337
5367
  }
5338
5368
  //#endregion
5339
5369
  //#region src/utils/pdfFonts.ts
5340
- function oi(e) {
5370
+ function li(e) {
5341
5371
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
5342
5372
  function i(n) {
5343
5373
  return t.get(n) ?? t.set(n, e.load(n)).get(n);
@@ -5380,18 +5410,18 @@ function oi(e) {
5380
5410
  }
5381
5411
  //#endregion
5382
5412
  //#region src/utils/svg2pdf.ts
5383
- function si(e, t, n) {
5384
- let r = e.metadata?.colorconversion, i = r ? new Map(r.map((e) => [ci(e.rgbin.split(" ").map((e) => Number(e))), e.cmykout.split(" ").map((e) => Number(e) * 100)])) : null;
5413
+ function ui(e, t, n) {
5414
+ let r = e.metadata?.colorconversion, i = r ? new Map(r.map((e) => [di(e.rgbin.split(" ").map((e) => Number(e))), e.cmykout.split(" ").map((e) => Number(e) * 100)])) : null;
5385
5415
  return {
5386
- colorCallback: li.bind(null, i),
5387
- fontCallback: ui(t, n),
5416
+ colorCallback: fi.bind(null, i),
5417
+ fontCallback: pi(t, n),
5388
5418
  assumePt: !0
5389
5419
  };
5390
5420
  }
5391
- var ci = ([e, t, n]) => `R${e}G${t}B${n}`;
5392
- function li(e, t) {
5421
+ var di = ([e, t, n]) => `R${e}G${t}B${n}`;
5422
+ function fi(e, t) {
5393
5423
  if (!t) return;
5394
- let n = t[0], r = ci(n), i = e?.get(r);
5424
+ let n = t[0], r = di(n), i = e?.get(r);
5395
5425
  if (i) return [i, t[1]];
5396
5426
  let a = (255 - n[0]) / 255, o = (255 - n[1]) / 255, s = (255 - n[2]) / 255, c = Math.min(a, o, s);
5397
5427
  return [[
@@ -5401,8 +5431,8 @@ function li(e, t) {
5401
5431
  c * 100
5402
5432
  ], t[1]];
5403
5433
  }
5404
- function ui(e, t) {
5405
- return oi({
5434
+ function pi(e, t) {
5435
+ return li({
5406
5436
  registered: (t, n, r) => {
5407
5437
  let i = Fe(e.fontMap.values(), t, n, r) ?? e.getDirectFont(t);
5408
5438
  return i && {
@@ -5411,7 +5441,7 @@ function ui(e, t) {
5411
5441
  style: i.style
5412
5442
  };
5413
5443
  },
5414
- search: async (e, n, r) => (await di(t, {
5444
+ search: async (e, n, r) => (await mi(t, {
5415
5445
  family: e,
5416
5446
  weight: String(n),
5417
5447
  style: r
@@ -5425,7 +5455,7 @@ function ui(e, t) {
5425
5455
  }
5426
5456
  });
5427
5457
  }
5428
- async function di(e, t) {
5458
+ async function mi(e, t) {
5429
5459
  let n = new URLSearchParams(Object.entries(t).map(([e, t]) => [e, String(t)])), r = `${e.apiUrl ?? "https://api.mapcreator.io"}/v1/fonts/search?${n}`, i = {
5430
5460
  Accept: "application/json",
5431
5461
  Authorization: e.bearerToken.startsWith("Bearer ") ? e.bearerToken : `Bearer ${e.bearerToken}`
@@ -5444,10 +5474,10 @@ async function di(e, t) {
5444
5474
  }
5445
5475
  //#endregion
5446
5476
  //#region src/utils/geoTiff.ts
5447
- function fi(e, { width: t, height: n }) {
5477
+ function hi(e, { width: t, height: n }) {
5448
5478
  let r = [];
5449
5479
  for (let i = 0; i <= 2; i++) for (let s = 0; s <= 2; s++) {
5450
- let c = i / 2 * t, l = s / 2 * n, { x: u, y: d } = pi(a.fromLngLat(e.unprojectWithScaleCorrection(new o(c, l))));
5480
+ let c = i / 2 * t, l = s / 2 * n, { x: u, y: d } = gi(a.fromLngLat(e.unprojectWithScaleCorrection(new o(c, l))));
5451
5481
  r.push(c, l, 0, u, d, 0);
5452
5482
  }
5453
5483
  return {
@@ -5460,15 +5490,15 @@ function fi(e, { width: t, height: n }) {
5460
5490
  ModelPixelScale: []
5461
5491
  };
5462
5492
  }
5463
- function pi(e) {
5493
+ function gi(e) {
5464
5494
  return {
5465
- x: H(-20037508.34, 20037508.34, e.x),
5466
- y: H(20037508.34, -20037508.34, e.y)
5495
+ x: U(-20037508.34, 20037508.34, e.x),
5496
+ y: U(20037508.34, -20037508.34, e.y)
5467
5497
  };
5468
5498
  }
5469
5499
  //#endregion
5470
5500
  //#region src/Image.ts
5471
- var mi = class {
5501
+ var _i = class {
5472
5502
  mcMap;
5473
5503
  format;
5474
5504
  svgCache;
@@ -5494,45 +5524,45 @@ var mi = class {
5494
5524
  };
5495
5525
  //#endregion
5496
5526
  //#region src/utils/video/index.ts
5497
- function hi(e) {
5498
- let t = e.length > 0 ? [gi(e[0])] : [], n = 0, r = 0;
5527
+ function vi(e) {
5528
+ let t = e.length > 0 ? [yi(e[0])] : [], n = 0, r = 0;
5499
5529
  for (let i = 1; i < e.length; ++i) {
5500
- let a = gi(e[i]);
5501
- n += _i(e[i - 1].center[0], a.center[0]), r += _i(e[i - 1].bearing, a.bearing), a.center[0] += n * 360, a.x += n, a.bearing += r * 360, t.push(a);
5530
+ let a = yi(e[i]);
5531
+ n += bi(e[i - 1].center[0], a.center[0]), r += bi(e[i - 1].bearing, a.bearing), a.center[0] += n * 360, a.x += n, a.bearing += r * 360, t.push(a);
5502
5532
  }
5503
5533
  return t;
5504
5534
  }
5505
- function gi(e) {
5535
+ function yi(e) {
5506
5536
  return {
5507
5537
  ...e,
5508
5538
  center: [e.center[0], e.center[1]]
5509
5539
  };
5510
5540
  }
5511
- function _i(e, t) {
5541
+ function bi(e, t) {
5512
5542
  if (Math.abs(e) + Math.abs(t) > 180) {
5513
5543
  if (e > 0 && t < 0) return 1;
5514
5544
  if (e < 0 && t > 0) return -1;
5515
5545
  }
5516
5546
  return 0;
5517
5547
  }
5518
- function vi(e) {
5548
+ function xi(e) {
5519
5549
  return 2 ** -e;
5520
5550
  }
5521
- function yi(e) {
5551
+ function Si(e) {
5522
5552
  return e.length > 0 ? e[e.length - 1].time : 0;
5523
5553
  }
5524
- function bi(e) {
5554
+ function Ci(e) {
5525
5555
  return `${String(Math.floor(e % 36e5 / 6e4)).padStart(2, "0")}:${String(Math.floor(e % 6e4 / 1e3)).padStart(2, "0")}`;
5526
5556
  }
5527
- function xi(e) {
5528
- return he(e, 23.976) ? 24e3 / 1001 : he(e, 29.97) ? 3e4 / 1001 : he(e, 59.94) ? 6e4 / 1001 : e;
5557
+ function wi(e) {
5558
+ return me(e, 23.976) ? 24e3 / 1001 : me(e, 29.97) ? 3e4 / 1001 : me(e, 59.94) ? 6e4 / 1001 : e;
5529
5559
  }
5530
- function Si(e, t) {
5560
+ function Ti(e, t) {
5531
5561
  return e === void 0 || t === void 0 ? e === t : e.center.lat === t.center.lat && e.center.lng === t.center.lng && e.zoom === t.zoom && e.bearing === t.bearing && e.pitch === t.pitch && e.fov === t.fov && e.elevation === t.elevation;
5532
5562
  }
5533
5563
  //#endregion
5534
5564
  //#region src/VideoPreloadOverlay.ts
5535
- var Ci = `
5565
+ var Ei = `
5536
5566
  <div class="preload-bar-vertical"></div>
5537
5567
  <div class="preload-bar-horizontal"></div>
5538
5568
  <div class="preload-badge">
@@ -5546,11 +5576,11 @@ var Ci = `
5546
5576
  <div class="preload-label">${Pn("loadingMap")}</div>
5547
5577
  </div>
5548
5578
  </div>
5549
- `, wi = class {
5579
+ `, Di = class {
5550
5580
  container;
5551
5581
  percentage;
5552
5582
  constructor(e) {
5553
- this.container = document.createElement("div"), this.container.className = "preload-overlay", this.container.innerHTML = Ci, this.percentage = this.container.querySelector(".preload-percentage"), e.getContainer().appendChild(this.container);
5583
+ this.container = document.createElement("div"), this.container.className = "preload-overlay", this.container.innerHTML = Ei, this.percentage = this.container.querySelector(".preload-percentage"), e.getContainer().appendChild(this.container);
5554
5584
  }
5555
5585
  remove() {
5556
5586
  this.container.remove();
@@ -5558,11 +5588,11 @@ var Ci = `
5558
5588
  setProgress(e) {
5559
5589
  this.percentage.innerText = `${Math.floor(e * 100)}%`;
5560
5590
  }
5561
- }, Ti = class {
5591
+ }, Oi = class {
5562
5592
  segments;
5563
5593
  constructor(e) {
5564
5594
  this.segments = [];
5565
- let t = new Ei(), n = A(t);
5595
+ let t = new ki(), n = A(t);
5566
5596
  n.lineStart();
5567
5597
  for (let t of e) n.point(t.x, t.y);
5568
5598
  n.lineEnd(), this.segments = t.segments;
@@ -5570,14 +5600,14 @@ var Ci = `
5570
5600
  sample(e) {
5571
5601
  if (e <= 0) return this.segments[0].startY;
5572
5602
  if (e >= this.segments[this.segments.length - 1].endX) return this.segments[this.segments.length - 1].endY;
5573
- let t = this.segments.find((t) => e >= t.startX && e < t.endX), n = de(t.startX, t.endX, e);
5574
- return t.startY !== t.endY && t.easing !== void 0 ? H(t.startY, t.endY, t.easing(n)) : H(t.startY, t.endY, n);
5603
+ let t = this.segments.find((t) => e >= t.startX && e < t.endX), n = le(t.startX, t.endX, e);
5604
+ return t.startY !== t.endY && t.easing !== void 0 ? U(t.startY, t.endY, t.easing(n)) : U(t.startY, t.endY, n);
5575
5605
  }
5576
5606
  solve(e, t) {
5577
5607
  let n = M((t) => this.sample(t) - e, t);
5578
5608
  return n === !1 ? t : n;
5579
5609
  }
5580
- }, Ei = class {
5610
+ }, ki = class {
5581
5611
  previousPoint = {
5582
5612
  x: 0,
5583
5613
  y: 0
@@ -5622,25 +5652,25 @@ var Ci = `
5622
5652
  };
5623
5653
  //#endregion
5624
5654
  //#region src/utils/video/easings.ts
5625
- function Di(e, t, n, r) {
5655
+ function Ai(e, t, n, r) {
5626
5656
  return t + n / r * e;
5627
5657
  }
5628
- function Oi(e, t, n, r) {
5658
+ function ji(e, t, n, r) {
5629
5659
  return n * ((e = e / r - 1) * e * e + 1) + t;
5630
5660
  }
5631
- function ki(e, t, n, r) {
5661
+ function Mi(e, t, n, r) {
5632
5662
  let i = 1.70158, a = 0, o = n;
5633
5663
  return e === 0 ? t : (e /= r) === 1 ? t + n : (a ||= r * .3, o < Math.abs(n) ? (o = n, i = a / 4) : i = a / (2 * Math.PI) * Math.asin(n / o), o * 2 ** (-10 * e) * Math.sin((e * r - i) * (2 * Math.PI) / a) + n + t);
5634
5664
  }
5635
- function Ai(e, t, n, r, i) {
5665
+ function Ni(e, t, n, r, i) {
5636
5666
  return i === void 0 && (i = 1.70158), n * ((e = e / r - 1) * e * ((i + 1) * e + i) + 1) + t;
5637
5667
  }
5638
- function ji(e, t, n, r) {
5668
+ function Pi(e, t, n, r) {
5639
5669
  return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t;
5640
5670
  }
5641
5671
  //#endregion
5642
5672
  //#region src/utils/video/cameraCurve.ts
5643
- var Mi = class {
5673
+ var Fi = class {
5644
5674
  script;
5645
5675
  xCurve;
5646
5676
  yCurve;
@@ -5651,10 +5681,10 @@ var Mi = class {
5651
5681
  altitudeCurve;
5652
5682
  elevationCurve;
5653
5683
  constructor(e) {
5654
- this.script = hi(e), this.xCurve = this.createMonotonicCurve(this.script, "x"), this.yCurve = this.createMonotonicCurve(this.script, "y"), this.fovCurve = this.createMonotonicCurve(this.script, "fov"), this.zoomCurve = this.createMonotonicCurve(this.script, "zoom"), this.pitchCurve = this.createMonotonicCurve(this.script, "pitch"), this.bearingCurve = this.createMonotonicCurve(this.script, "bearing"), this.altitudeCurve = this.createMonotonicCurve(this.script, "altitude"), this.elevationCurve = this.createMonotonicCurve(this.script, "elevation");
5684
+ this.script = vi(e), this.xCurve = this.createMonotonicCurve(this.script, "x"), this.yCurve = this.createMonotonicCurve(this.script, "y"), this.fovCurve = this.createMonotonicCurve(this.script, "fov"), this.zoomCurve = this.createMonotonicCurve(this.script, "zoom"), this.pitchCurve = this.createMonotonicCurve(this.script, "pitch"), this.bearingCurve = this.createMonotonicCurve(this.script, "bearing"), this.altitudeCurve = this.createMonotonicCurve(this.script, "altitude"), this.elevationCurve = this.createMonotonicCurve(this.script, "elevation");
5655
5685
  }
5656
5686
  sample(e) {
5657
- let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(vi(t), e), r = this.xCurve.sample(n), i = this.yCurve.sample(n), o = this.elevationCurve.sample(n), s = this.bearingCurve.sample(e), c = this.pitchCurve.sample(e), l = this.fovCurve.sample(e);
5687
+ let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(xi(t), e), r = this.xCurve.sample(n), i = this.yCurve.sample(n), o = this.elevationCurve.sample(n), s = this.bearingCurve.sample(e), c = this.pitchCurve.sample(e), l = this.fovCurve.sample(e);
5658
5688
  return {
5659
5689
  center: new a(r, i).toLngLat(),
5660
5690
  zoom: t,
@@ -5678,13 +5708,13 @@ var Mi = class {
5678
5708
  x: o.time + .1,
5679
5709
  y: l
5680
5710
  }), !a) if (o.transition === "linear") {
5681
- let e = o.time + .1, r = s.time - .1, i = de(o.time, s.time, e), a = de(o.time, s.time, r), c = this.getKeyframeValue(s, t);
5711
+ let e = o.time + .1, r = s.time - .1, i = le(o.time, s.time, e), a = le(o.time, s.time, r), c = this.getKeyframeValue(s, t);
5682
5712
  n.push({
5683
5713
  x: e,
5684
- y: H(l, c, i)
5714
+ y: U(l, c, i)
5685
5715
  }), n.push({
5686
5716
  x: r,
5687
- y: H(l, c, a)
5717
+ y: U(l, c, a)
5688
5718
  });
5689
5719
  } else o.transition === "instant" && (n.push({
5690
5720
  x: o.time + .1,
@@ -5698,7 +5728,7 @@ var Mi = class {
5698
5728
  y: l
5699
5729
  });
5700
5730
  }
5701
- return new Ti(n);
5731
+ return new Oi(n);
5702
5732
  }
5703
5733
  sampleAutoHideOpacity(e) {
5704
5734
  let t = this.script;
@@ -5709,12 +5739,12 @@ var Mi = class {
5709
5739
  if (r.hideLabels === (a?.hideLabels ?? !1)) o = r.hideLabels ? 0 : 1;
5710
5740
  else {
5711
5741
  let t = e - r.time, n = Math.min(400, i.time - r.time);
5712
- o = U(Oi(t, r.hideLabels ? 1 : 0, r.hideLabels ? -1 : 1, n), 0, 1);
5742
+ o = ue(ji(t, r.hideLabels ? 1 : 0, r.hideLabels ? -1 : 1, n), 0, 1);
5713
5743
  }
5714
5744
  let s;
5715
5745
  if (n === t.length - 2 && r.hideLabels) {
5716
5746
  let t = Math.max(r.time, i.time - 400);
5717
- s = U(Oi(e - t, 0, 1, i.time - t), 0, 1);
5747
+ s = ue(ji(e - t, 0, 1, i.time - t), 0, 1);
5718
5748
  } else s = 0;
5719
5749
  return Math.max(o, s);
5720
5750
  }
@@ -5726,9 +5756,9 @@ var Mi = class {
5726
5756
  }
5727
5757
  }
5728
5758
  getKeyframeValue(e, t) {
5729
- return t === "altitude" ? vi(e.zoom) : e[t];
5759
+ return t === "altitude" ? xi(e.zoom) : e[t];
5730
5760
  }
5731
- }, Ni = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\"><path d=\"M2.83545 2.66675V6.00008H6.00078M3.38078 5.33341C3.99882 4.26305 4.96943 3.44057 6.1267 3.00656C7.28398 2.57255 8.55607 2.55396 9.72553 2.95397C10.895 3.35397 11.8892 4.14774 12.5383 5.19959C13.1873 6.25144 13.4509 7.49606 13.2839 8.72072C13.117 9.94537 12.5298 11.074 11.6229 11.9137C10.716 12.7535 9.54555 13.2521 8.31169 13.3245C7.07782 13.3968 5.85714 13.0384 4.85828 12.3104C3.85942 11.5824 3.1444 10.5302 2.83545 9.33341\" stroke-width=\"1.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n", Pi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"currentColor\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.991136 3.66807e-08C1.53861 1.64225e-08 1.98242 0.474849 1.98242 1.06061L1.98242 10.6061C1.98242 11.1918 1.53861 11.6667 0.991137 11.6667C0.443665 11.6667 -0.000148911 11.1918 -0.000148941 10.6061L-0.000149434 1.06061C-0.000149464 0.47485 0.443664 5.69389e-08 0.991136 3.66807e-08Z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.92082 3.66807e-08C9.4683 1.64225e-08 9.91211 0.474849 9.91211 1.06061L9.91211 10.6061C9.91211 11.1918 9.4683 11.6667 8.92082 11.6667C8.37335 11.6667 7.92954 11.1918 7.92954 10.6061L7.92954 1.06061C7.92954 0.47485 8.37335 5.69389e-08 8.92082 3.66807e-08Z\"/></svg>\n", Fi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M4.88141 14.9874C4.58039 14.9874 4.2919 14.9121 4.01596 14.774C3.38883 14.4475 3 13.8072 3 13.104V2.88322C3 2.18007 3.38883 1.5397 4.01596 1.21323C4.6431 0.886771 5.39567 0.936996 5.97263 1.35135L13.2098 6.46175C13.7115 6.81332 14 7.39091 14 8.00617C14 8.62142 13.699 9.18645 13.2098 9.55059L5.97263 14.6484C5.64652 14.8744 5.27024 15 4.89396 15L4.88141 14.9874ZM4.88141 2.2554C4.78107 2.2554 4.68073 2.28052 4.59293 2.33074C4.3797 2.44375 4.25428 2.64465 4.25428 2.88322V13.104C4.25428 13.3426 4.3797 13.556 4.59293 13.6565C4.80616 13.7695 5.04447 13.7444 5.24515 13.6063L12.4823 8.49586C12.5634 8.4368 12.6294 8.35937 12.6749 8.2699C12.7204 8.18043 12.7442 8.08145 12.7442 7.98105C12.7442 7.88065 12.7204 7.78168 12.6749 7.69221C12.6294 7.60274 12.5634 7.52531 12.4823 7.46625L5.24515 2.36841C5.1378 2.29542 5.01118 2.25608 4.88141 2.2554Z\"/></svg>\n", Ii = (e) => `
5761
+ }, Ii = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\"><path d=\"M2.83545 2.66675V6.00008H6.00078M3.38078 5.33341C3.99882 4.26305 4.96943 3.44057 6.1267 3.00656C7.28398 2.57255 8.55607 2.55396 9.72553 2.95397C10.895 3.35397 11.8892 4.14774 12.5383 5.19959C13.1873 6.25144 13.4509 7.49606 13.2839 8.72072C13.117 9.94537 12.5298 11.074 11.6229 11.9137C10.716 12.7535 9.54555 13.2521 8.31169 13.3245C7.07782 13.3968 5.85714 13.0384 4.85828 12.3104C3.85942 11.5824 3.1444 10.5302 2.83545 9.33341\" stroke-width=\"1.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n", Li = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"currentColor\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.991136 3.66807e-08C1.53861 1.64225e-08 1.98242 0.474849 1.98242 1.06061L1.98242 10.6061C1.98242 11.1918 1.53861 11.6667 0.991137 11.6667C0.443665 11.6667 -0.000148911 11.1918 -0.000148941 10.6061L-0.000149434 1.06061C-0.000149464 0.47485 0.443664 5.69389e-08 0.991136 3.66807e-08Z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.92082 3.66807e-08C9.4683 1.64225e-08 9.91211 0.474849 9.91211 1.06061L9.91211 10.6061C9.91211 11.1918 9.4683 11.6667 8.92082 11.6667C8.37335 11.6667 7.92954 11.1918 7.92954 10.6061L7.92954 1.06061C7.92954 0.47485 8.37335 5.69389e-08 8.92082 3.66807e-08Z\"/></svg>\n", Ri = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M4.88141 14.9874C4.58039 14.9874 4.2919 14.9121 4.01596 14.774C3.38883 14.4475 3 13.8072 3 13.104V2.88322C3 2.18007 3.38883 1.5397 4.01596 1.21323C4.6431 0.886771 5.39567 0.936996 5.97263 1.35135L13.2098 6.46175C13.7115 6.81332 14 7.39091 14 8.00617C14 8.62142 13.699 9.18645 13.2098 9.55059L5.97263 14.6484C5.64652 14.8744 5.27024 15 4.89396 15L4.88141 14.9874ZM4.88141 2.2554C4.78107 2.2554 4.68073 2.28052 4.59293 2.33074C4.3797 2.44375 4.25428 2.64465 4.25428 2.88322V13.104C4.25428 13.3426 4.3797 13.556 4.59293 13.6565C4.80616 13.7695 5.04447 13.7444 5.24515 13.6063L12.4823 8.49586C12.5634 8.4368 12.6294 8.35937 12.6749 8.2699C12.7204 8.18043 12.7442 8.08145 12.7442 7.98105C12.7442 7.88065 12.7204 7.78168 12.6749 7.69221C12.6294 7.60274 12.5634 7.52531 12.4823 7.46625L5.24515 2.36841C5.1378 2.29542 5.01118 2.25608 4.88141 2.2554Z\"/></svg>\n", zi = (e) => `
5732
5762
  <div class="video-slider-container">
5733
5763
  <div class="video-slider-line-wrapper">
5734
5764
  <div class="video-slider-line-left"></div>
@@ -5738,21 +5768,21 @@ var Mi = class {
5738
5768
  </div>
5739
5769
  <div class="video-controls-row">
5740
5770
  <button class="video-button play">
5741
- <span class="video-icon play-icon">${Fi}</span>
5742
- <span class="video-icon pause-icon">${Pi}</span>
5771
+ <span class="video-icon play-icon">${Ri}</span>
5772
+ <span class="video-icon pause-icon">${Li}</span>
5743
5773
  </button>
5744
5774
  <button class="video-button restart">
5745
- ${Ni}
5775
+ ${Ii}
5746
5776
  </button>
5747
5777
  <div class="video-time">
5748
- <span class="video-playhead">${bi(0)}</span> /
5749
- <span class="video-duration">${bi(e)}</span>
5778
+ <span class="video-playhead">${Ci(0)}</span> /
5779
+ <span class="video-duration">${Ci(e)}</span>
5750
5780
  </div>
5751
5781
  <button class="video-button fullscreen">
5752
5782
  ${_n}
5753
5783
  </button>
5754
5784
  </div>
5755
- `, Li = class {
5785
+ `, Bi = class {
5756
5786
  callbacks;
5757
5787
  duration;
5758
5788
  container;
@@ -5766,7 +5796,7 @@ var Mi = class {
5766
5796
  playhead = 0;
5767
5797
  isPlaying = !1;
5768
5798
  constructor(e, t, n) {
5769
- this.duration = t, this.callbacks = n, this.mapContainer = e.getContainer(), this.container = document.createElement("div"), this.container.className = "video-controls", this.container.innerHTML = Ii(t), this.playButton = this.container.querySelector(".video-button.play"), this.restartButton = this.container.querySelector(".video-button.restart"), this.fullscreenButton = this.container.querySelector(".video-button.fullscreen"), this.slider = this.container.querySelector(".video-slider"), this.sliderFill = this.container.querySelector(".video-slider-line-left"), this.playheadLabel = this.container.querySelector(".video-playhead"), this.playButton.addEventListener("click", () => this.callbacks.playPause()), this.restartButton.addEventListener("click", () => this.callbacks.restart()), this.fullscreenButton.addEventListener("click", () => Sn(this.mapContainer)), this.slider.addEventListener("input", () => {
5799
+ this.duration = t, this.callbacks = n, this.mapContainer = e.getContainer(), this.container = document.createElement("div"), this.container.className = "video-controls", this.container.innerHTML = zi(t), this.playButton = this.container.querySelector(".video-button.play"), this.restartButton = this.container.querySelector(".video-button.restart"), this.fullscreenButton = this.container.querySelector(".video-button.fullscreen"), this.slider = this.container.querySelector(".video-slider"), this.sliderFill = this.container.querySelector(".video-slider-line-left"), this.playheadLabel = this.container.querySelector(".video-playhead"), this.playButton.addEventListener("click", () => this.callbacks.playPause()), this.restartButton.addEventListener("click", () => this.callbacks.restart()), this.fullscreenButton.addEventListener("click", () => Sn(this.mapContainer)), this.slider.addEventListener("input", () => {
5770
5800
  this.duration > 0 && this.callbacks.seek(Number(this.slider.value));
5771
5801
  }), this.mapContainer.appendChild(this.container), this.update();
5772
5802
  }
@@ -5778,39 +5808,39 @@ var Mi = class {
5778
5808
  }
5779
5809
  update() {
5780
5810
  let { duration: e, playhead: t } = this;
5781
- this.playButton.classList.toggle("playing", this.isPlaying), this.restartButton.classList.toggle("disabled", t === 0), this.slider.value = String(t), this.sliderFill.style.width = `${de(0, e, t) * 100}%`, this.playheadLabel.textContent = bi(t);
5811
+ this.playButton.classList.toggle("playing", this.isPlaying), this.restartButton.classList.toggle("disabled", t === 0), this.slider.value = String(t), this.sliderFill.style.width = `${le(0, e, t) * 100}%`, this.playheadLabel.textContent = Ci(t);
5782
5812
  }
5783
- }, Ri = class extends t {
5813
+ }, Vi = class extends t {
5784
5814
  time;
5785
5815
  constructor(e, t) {
5786
5816
  super(e), this.time = t;
5787
5817
  }
5788
- }, zi = {
5789
- linear: Di,
5790
- easeOutCubic: Oi,
5791
- easeOutBack: Ai,
5792
- easeOutBounce: ji,
5793
- easeOutElastic: ki
5818
+ }, Hi = {
5819
+ linear: Ai,
5820
+ easeOutCubic: ji,
5821
+ easeOutBack: Ni,
5822
+ easeOutBounce: Pi,
5823
+ easeOutElastic: Mi
5794
5824
  };
5795
- function Bi(e) {
5825
+ function Ui(e) {
5796
5826
  return e.entryType === "fade" || e.exitType === "fade" || e.entryType === "instant" || e.exitType === "instant";
5797
5827
  }
5798
- function Vi(e) {
5828
+ function Wi(e) {
5799
5829
  return e.entryType === "grow" || e.exitType === "grow";
5800
5830
  }
5801
5831
  function $(e, t, n) {
5802
5832
  let { entry: r, entryDuration: i, exit: a, exitDuration: o } = e, { entryType: s, entryEasing: c, exitType: l, exitEasing: u } = e;
5803
- return n < r && (s === t || s === "instant" && t === "fade") || n > a && (l === t || l === "instant" && t === "fade") ? 0 : i > 0 && n < r + i && s === t ? zi[c](n - r, 0, 1, i) : o > 0 && n > a - o && l === t ? zi[u](n - (a - o), 1, -1, o) : 1;
5833
+ return n < r && (s === t || s === "instant" && t === "fade") || n > a && (l === t || l === "instant" && t === "fade") ? 0 : i > 0 && n < r + i && s === t ? Hi[c](n - r, 0, 1, i) : o > 0 && n > a - o && l === t ? Hi[u](n - (a - o), 1, -1, o) : 1;
5804
5834
  }
5805
- function Hi(e) {
5835
+ function Gi(e) {
5806
5836
  return e.target.type === "model";
5807
5837
  }
5808
- function Ui(e) {
5838
+ function Ki(e) {
5809
5839
  return e.target.type === "layer" || e.target.type === "overlay";
5810
5840
  }
5811
5841
  //#endregion
5812
5842
  //#region src/Video.ts
5813
- var Wi = class {
5843
+ var qi = class {
5814
5844
  mcMap;
5815
5845
  cameraCurve;
5816
5846
  registryAnimations;
@@ -5841,11 +5871,11 @@ var Wi = class {
5841
5871
  elevation: e.elevation ?? 0
5842
5872
  };
5843
5873
  }), u = t.video?.animations ?? [];
5844
- this.layerAnimations = u.filter(Ui);
5845
- let d = u.filter(Hi);
5846
- this.registryAnimations = [...d.filter((e) => e.target.modelId === void 0), ...d.filter((e) => e.target.modelId !== void 0)], this.duration = yi(l), this.frameRate = xi(t.export?.frameRate ?? 60), this.cameraCurve = new Mi(l), this.registry = new qr(t), this.svgs = n, this.svgCache = r, this.mapstyle = i, this.overlays = o, this.layerInfo = s, this.backgroundColor = c;
5874
+ this.layerAnimations = u.filter(Ki);
5875
+ let d = u.filter(Gi);
5876
+ this.registryAnimations = [...d.filter((e) => e.target.modelId === void 0), ...d.filter((e) => e.target.modelId !== void 0)], this.duration = Si(l), this.frameRate = wi(t.export?.frameRate ?? 60), this.cameraCurve = new Fi(l), this.registry = new Xr(t), this.svgs = n, this.svgCache = r, this.mapstyle = i, this.overlays = o, this.layerInfo = s, this.backgroundColor = c;
5847
5877
  let f = t.export?.format === "web_video";
5848
- this.loop = f && (t.web?.loop ?? !1), f && t.web?.controls && (this.controls = new Li(e.map, this.duration, {
5878
+ this.loop = f && (t.web?.loop ?? !1), f && t.web?.controls && (this.controls = new Bi(e.map, this.duration, {
5849
5879
  playPause: () => this.playbackContext === void 0 ? this.play() : this.pause(),
5850
5880
  restart: () => {
5851
5881
  this.seekTo(0), this.play();
@@ -5867,13 +5897,13 @@ var Wi = class {
5867
5897
  this.playbackContext === void 0 && this.duration > 0 && (this.playhead >= this.duration && (this.playhead = 0), this.playbackContext = {
5868
5898
  startTime: Date.now(),
5869
5899
  startPlayhead: this.playhead
5870
- }, this.mcMap.fire(new Ri("playstart", this.playhead)), this.controls?.setPlaying(!0), this.playFrame());
5900
+ }, this.mcMap.fire(new Vi("playstart", this.playhead)), this.controls?.setPlaying(!0), this.playFrame());
5871
5901
  }
5872
5902
  pause() {
5873
- this.playbackContext !== void 0 && (this.playbackContext = void 0, this.mcMap.fire(new Ri("playend", this.playhead)), this.controls?.setPlaying(!1));
5903
+ this.playbackContext !== void 0 && (this.playbackContext = void 0, this.mcMap.fire(new Vi("playend", this.playhead)), this.controls?.setPlaying(!1));
5874
5904
  }
5875
5905
  seekTo(e) {
5876
- this.duration > 0 && (e = U(e, 0, this.duration), this.setFrame(e), this.playbackContext !== void 0 && (this.playbackContext = {
5906
+ this.duration > 0 && (e = ue(e, 0, this.duration), this.setFrame(e), this.playbackContext !== void 0 && (this.playbackContext = {
5877
5907
  startTime: Date.now(),
5878
5908
  startPlayhead: e
5879
5909
  }));
@@ -5901,13 +5931,13 @@ var Wi = class {
5901
5931
  });
5902
5932
  }
5903
5933
  }
5904
- this.preloadOverlay = new wi(this.mcMap.map), e._fadeDuration = 0;
5934
+ this.preloadOverlay = new Di(this.mcMap.map), e._fadeDuration = 0;
5905
5935
  try {
5906
5936
  let i, a = /* @__PURE__ */ new Set();
5907
5937
  for (let o = 0; o < t; o++) {
5908
5938
  this.preloadOverlay?.setProgress(o / t);
5909
5939
  let s = this.cameraCurve.sample(o * 1e3 / this.frameRate);
5910
- if (Si(i, s)) continue;
5940
+ if (Ti(i, s)) continue;
5911
5941
  this.setCamera(s);
5912
5942
  let c = new Set([...n].flatMap(([t, n]) => e.coveringTiles(n).map((e) => `${t}/${e.key}`)));
5913
5943
  if (i !== void 0 && [...a].some((e) => !r.has(e) && !c.has(e))) {
@@ -5927,13 +5957,13 @@ var Wi = class {
5927
5957
  playFrame() {
5928
5958
  if (this.playbackContext !== void 0) {
5929
5959
  let e = this.playbackContext.startPlayhead + (Date.now() - this.playbackContext.startTime);
5930
- e > this.duration ? this.loop ? (this.seekTo(0), requestAnimationFrame(() => this.playFrame())) : (this.setFrame(this.duration), this.playbackContext = void 0, this.mcMap.fire(new Ri("playend", this.playhead)), this.controls?.setPlaying(!1)) : (this.setFrame(e), requestAnimationFrame(() => this.playFrame()));
5960
+ e > this.duration ? this.loop ? (this.seekTo(0), requestAnimationFrame(() => this.playFrame())) : (this.setFrame(this.duration), this.playbackContext = void 0, this.mcMap.fire(new Vi("playend", this.playhead)), this.controls?.setPlaying(!1)) : (this.setFrame(e), requestAnimationFrame(() => this.playFrame()));
5931
5961
  }
5932
5962
  }
5933
5963
  setFrame(e) {
5934
5964
  this.playhead = e;
5935
5965
  let t = this.cameraCurve.sample(e);
5936
- this.setCamera(t), this.applyAnimations(e), this.mcMap.fire(new Ri("play", e)), this.controls?.setPlayhead(e);
5966
+ this.setCamera(t), this.applyAnimations(e), this.mcMap.fire(new Vi("play", e)), this.controls?.setPlayhead(e);
5937
5967
  }
5938
5968
  setCamera(e) {
5939
5969
  let t = this.mcMap.map, n = t.getCenter(), r = t.getZoom(), i = t.getBearing(), a = t.getPitch(), o = t.getCenterElevation(), s = t.getVerticalFieldOfView();
@@ -5943,7 +5973,7 @@ var Wi = class {
5943
5973
  let t = this.mcMap.map, { svgs: n, svgCache: r, registryAnimations: i } = this;
5944
5974
  for (let n of i) {
5945
5975
  let { target: r } = n;
5946
- if (!Bi(n)) continue;
5976
+ if (!Ui(n)) continue;
5947
5977
  let { modelType: i, groupId: a, modelId: o } = r, s = $(n, "fade", e);
5948
5978
  if (i === "area") {
5949
5979
  let e = this.registry.models.area[a] ?? {}, n = o === void 0 ? Object.values(e) : e[o] ? [e[o]] : [];
@@ -5956,7 +5986,7 @@ var Wi = class {
5956
5986
  let e = this.registry.models[i][a] ?? {}, n = o === void 0 ? Object.keys(e) : [o];
5957
5987
  for (let e of n) t.setFeatureState({
5958
5988
  source: a,
5959
- id: V(e)
5989
+ id: B(e)
5960
5990
  }, { opacity: s });
5961
5991
  }
5962
5992
  }
@@ -5966,7 +5996,7 @@ var Wi = class {
5966
5996
  type: "FeatureCollection",
5967
5997
  features: i.models.filter((e) => e.visible ?? !0).map((t) => {
5968
5998
  let a = o.get(t.id);
5969
- return Tr(i, t, a === void 0 ? s : $(a, "grow", e), n, r);
5999
+ return Or(i, t, a === void 0 ? s : $(a, "grow", e), n, r);
5970
6000
  })
5971
6001
  });
5972
6002
  }
@@ -5976,7 +6006,7 @@ var Wi = class {
5976
6006
  type: "FeatureCollection",
5977
6007
  features: n.models.filter((e) => e.visible ?? !0).map((i) => {
5978
6008
  let s = a.get(i.id);
5979
- return ti(t, n, i, s === void 0 ? o : $(s, "grow", e), r);
6009
+ return ii(t, n, i, s === void 0 ? o : $(s, "grow", e), r);
5980
6010
  })
5981
6011
  });
5982
6012
  }
@@ -5986,7 +6016,7 @@ var Wi = class {
5986
6016
  type: "FeatureCollection",
5987
6017
  features: i.models.filter((e) => e.visible ?? !0).map((a) => {
5988
6018
  let c = o.get(a.id);
5989
- return kr(t, i, a, c === void 0 ? s : $(c, "grow", e), n, r);
6019
+ return Mr(t, i, a, c === void 0 ? s : $(c, "grow", e), n, r);
5990
6020
  })
5991
6021
  });
5992
6022
  }
@@ -6004,7 +6034,7 @@ var Wi = class {
6004
6034
  let r, i = /* @__PURE__ */ new Map();
6005
6035
  for (let a of this.registryAnimations) {
6006
6036
  let { target: o } = a;
6007
- o.modelType === e && o.groupId === t && (n === "opacity" && Bi(a) || n === "scale" && Vi(a)) && (o.modelId === void 0 ? r = a : i.set(o.modelId, a));
6037
+ o.modelType === e && o.groupId === t && (n === "opacity" && Ui(a) || n === "scale" && Wi(a)) && (o.modelId === void 0 ? r = a : i.set(o.modelId, a));
6008
6038
  }
6009
6039
  return {
6010
6040
  groupAnimation: r,
@@ -6029,7 +6059,7 @@ var Wi = class {
6029
6059
  let t = this.mcMap.map, n = ur[e.type], r = this.layerInfo[e.id]?.opacity;
6030
6060
  for (let i of n.props) t.setPaintProperty(e.id, i, r ?? e.paint?.[i] ?? n.defaultValue);
6031
6061
  }
6032
- }, Gi = class extends n {
6062
+ }, Ji = class extends n {
6033
6063
  map;
6034
6064
  format;
6035
6065
  mapstyle;
@@ -6040,7 +6070,7 @@ var Wi = class {
6040
6070
  image;
6041
6071
  video;
6042
6072
  constructor(e, t, n, r, i, a, o, s, c, l, u, d) {
6043
- super(), this.map = e, this.format = t, this.mapstyle = o, this.svgCache = a, this.backgroundColor = l, this.vapiUrl = u, this.accessToken = d, this.image = new mi(this, t, a, l), n === "video" && (r.video?.keyframes ?? []).length > 0 && (this.video = new Wi(this, r, i, a, o, s, c, l));
6073
+ super(), this.map = e, this.format = t, this.mapstyle = o, this.svgCache = a, this.backgroundColor = l, this.vapiUrl = u, this.accessToken = d, this.image = new _i(this, t, a, l), n === "video" && (r.video?.keyframes ?? []).length > 0 && (this.video = new qi(this, r, i, a, o, s, c, l));
6044
6074
  }
6045
6075
  play() {
6046
6076
  this.video?.play();
@@ -6058,7 +6088,7 @@ var Wi = class {
6058
6088
  return this.video?.preload() ?? Promise.resolve();
6059
6089
  }
6060
6090
  geoTiffMetadata(e) {
6061
- return fi(this.map, e);
6091
+ return hi(this.map, e);
6062
6092
  }
6063
6093
  svgExportOptions(e, t, n) {
6064
6094
  return {
@@ -6076,7 +6106,7 @@ var Wi = class {
6076
6106
  };
6077
6107
  }
6078
6108
  pdfExportOptions(e) {
6079
- return si(this.mapstyle, this.svgCache.fonts, {
6109
+ return ui(this.mapstyle, this.svgCache.fonts, {
6080
6110
  vapiUrl: this.vapiUrl,
6081
6111
  accessToken: this.accessToken,
6082
6112
  apiUrl: e.href,
@@ -6090,9 +6120,9 @@ var Wi = class {
6090
6120
  };
6091
6121
  //#endregion
6092
6122
  //#region src/initMap.ts
6093
- async function Ki(t) {
6094
- let { accessToken: n, env: r = "production" } = t, a = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", o = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", s = typeof t.job == "string" ? await qi(t.job, o, n) : t.job, c = s.export?.format ?? "png", l = pr[c] ?? "static";
6095
- await Ji();
6123
+ async function Yi(t) {
6124
+ let { accessToken: n, env: r = "production" } = t, a = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", o = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", s = Cr(typeof t.job == "string" ? await Xi(t.job, o, n) : t.job), c = s.export?.format ?? "png", l = pr[c] ?? "static";
6125
+ await Zi();
6096
6126
  let u = {
6097
6127
  container: t.container,
6098
6128
  attributionControl: !1,
@@ -6110,22 +6140,22 @@ async function Ki(t) {
6110
6140
  "CooperativeGesturesHandler.MacHelpText": Pn("macHelpText"),
6111
6141
  "CooperativeGesturesHandler.MobileHelpText": Pn("mobileHelpText")
6112
6142
  },
6113
- maxCanvasSize: le(),
6143
+ maxCanvasSize: se(),
6114
6144
  canvasContextAttributes: { preserveDrawingBuffer: t.preserveDrawingBuffer ?? !1 }
6115
6145
  };
6116
6146
  l === "video" && (u.maxTileCacheSize = Infinity, u.maxTileCacheZoomLevels = Infinity, u.refreshExpiredTiles = !1);
6117
6147
  let d = new i(u), f = d.getContainer();
6118
6148
  f.classList.add("mc-map"), l === "interactive" && f.classList.add("mc-mode-web");
6119
- let p = l === "interactive" ? new Yr(d, t.youTubePlaceholder ?? !1) : void 0, { map: { language: m, hideBasemap: h, detailLevel: g = 0, projection: _ = "mercator", terrain: v = !1, terrainExaggeration: y = 1 }, registry: b = {}, web: x, positionOffsets: S } = s, { models: C = {}, slots: w = {}, svgs: T = {} } = b, E = new et(d, await Oe(r, a, n), a, n);
6149
+ let p = l === "interactive" ? new Qr(d, t.youTubePlaceholder ?? !1) : void 0, { map: { language: m, hideBasemap: h, detailLevel: g = 0, projection: _ = "mercator", terrain: v = !1, terrainExaggeration: y = 1 }, registry: b = {}, web: x, positionOffsets: S } = s, { models: C = {}, slots: w = {}, svgs: T = {} } = b, E = new et(d, await Oe(r, a, n), a, n);
6120
6150
  d.resize();
6121
6151
  let D = l === "video" ? s.video?.keyframes[0] : void 0, O = D?.pitch ?? s.map.pitch ?? 0, k = D?.bearing ?? s.map.rotation ?? 0, A = D?.zoom ?? s.map.zoom, j = D?.center === void 0 ? s.map.center : {
6122
6152
  lng: D.center[0],
6123
6153
  lat: D.center[1]
6124
6154
  };
6125
6155
  d.setPitch(O), d.setBearing(k);
6126
- let M = me(s, f, l, c), P, I;
6156
+ let M = pe(s, f, l, c), P, I;
6127
6157
  l === "interactive" ? (I = A - g + Math.log2(M), P = 1) : (I = A - g, P = M, d.on("resize", () => {
6128
- let e = me(s, f, l, c);
6158
+ let e = pe(s, f, l, c);
6129
6159
  e !== d.getScale() && d.setScale(e);
6130
6160
  })), d.setScale(P), d.setZoom(I), d.setCenter(j), d.setDetailLevel(g), d.setMinZoom(g), d.addControl(new e({ compact: !1 })), await _r(s, S ?? cr, d, E, {
6131
6161
  center: j,
@@ -6140,22 +6170,22 @@ async function Ki(t) {
6140
6170
  sources: {},
6141
6171
  layers: []
6142
6172
  } : await fetch(`${a}/styles/${R}.json?access_token=${n}`).then((e) => e.json());
6143
- xr(z), d.setStyle(null), d.setStyle(z), await d.once("style.load"), Se(d, l), d.on("moveend", () => Se(d, l)), d.on("resize", () => Se(d, l)), d.on("attributionchange", () => Se(d, l)), N(m, d);
6173
+ wr(z), d.setStyle(null), d.setStyle(z), await d.once("style.load"), xe(d, l), d.on("moveend", () => xe(d, l)), d.on("resize", () => xe(d, l)), d.on("attributionchange", () => xe(d, l)), N(m, d);
6144
6174
  let B = s.map.overlays ?? [], V = s.meta?.layers ?? [];
6145
6175
  B.length !== V.length && (B = [], V = []);
6146
- let te = await Ar(B, V, d, a, n, z.metadata?.styleOverride), ne = B.reduce((e, t, n) => e.set(t, te[n]), /* @__PURE__ */ new Map());
6147
- ea(d, E, C, w, T, a, n, l), N(m, d), p?.setPublication(z.metadata?.publication), p?.setpopupElements(), p?.setHighlightManager(), d.setProjection({ type: _ === "globe" ? "globe" : "mercator" });
6148
- let re = Yi(d, _);
6149
- Xi(d, re), v && Zi(d, a, n, y);
6150
- let ie = Qi(s.map.layerInfo, z, te);
6151
- $i(d, ie, !h);
6152
- let ae = new Gi(d, c, l, s, T, E, z, ne, ie, re, a, n);
6153
- return await E.settledImages(), ae;
6154
- }
6155
- function qi(e, t, n) {
6176
+ let H = await Nr(B, V, d, a, n, z.metadata?.styleOverride), te = B.reduce((e, t, n) => e.set(t, H[n]), /* @__PURE__ */ new Map());
6177
+ ra(d, E, C, w, T, a, n, l), N(m, d), p?.setPublication(z.metadata?.publication), p?.setpopupElements(), p?.setHighlightManager(), d.setProjection({ type: _ === "globe" ? "globe" : "mercator" });
6178
+ let ne = Qi(d, _);
6179
+ $i(d, ne), v && ea(d, a, n, y);
6180
+ let re = ta(s.map.layerInfo, z, H);
6181
+ na(d, re, !h);
6182
+ let ie = new Ji(d, c, l, s, T, E, z, te, re, ne, a, n);
6183
+ return await E.settledImages(), ie;
6184
+ }
6185
+ function Xi(e, t, n) {
6156
6186
  return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then((e) => e.json());
6157
6187
  }
6158
- function Ji() {
6188
+ function Zi() {
6159
6189
  return new Promise((e) => {
6160
6190
  let t = () => {
6161
6191
  window.innerWidth > 0 && window.innerHeight > 0 && (window.removeEventListener("resize", t), e());
@@ -6163,18 +6193,18 @@ function Ji() {
6163
6193
  window.addEventListener("resize", t), t();
6164
6194
  });
6165
6195
  }
6166
- function Yi(e, t) {
6196
+ function Qi(e, t) {
6167
6197
  let n = e.getStyle().metadata ?? {}, r = n["mc:background-color"] ?? "#f8f8f8", i = n["mc:background-color-globe"] ?? "#000000";
6168
6198
  return t === "globe" ? i : r;
6169
6199
  }
6170
- function Xi(e, t) {
6200
+ function $i(e, t) {
6171
6201
  e.getContainer().style.backgroundColor = t, e.setSky(e.getStyle().sky ?? sr), e.setLight({ position: [
6172
6202
  1.15,
6173
6203
  210,
6174
6204
  45
6175
6205
  ] });
6176
6206
  }
6177
- function Zi(e, t, n, r) {
6207
+ function ea(e, t, n, r) {
6178
6208
  e.addSource("mc-dem", {
6179
6209
  type: "raster-dem",
6180
6210
  tiles: [`${t}/dataset/jaxa_terrainrgb/{z}/{x}/{y}?access_token=${n}`],
@@ -6186,7 +6216,7 @@ function Zi(e, t, n, r) {
6186
6216
  exaggeration: r
6187
6217
  });
6188
6218
  }
6189
- function Qi(e, t, n) {
6219
+ function ta(e, t, n) {
6190
6220
  let r = e?.reduce((e, t) => (e[t.id] = {
6191
6221
  visibility: t.visibility,
6192
6222
  ...t.opacity !== void 0 && { opacity: t.opacity }
@@ -6195,7 +6225,7 @@ function Qi(e, t, n) {
6195
6225
  for (let e of n) for (let t of e.layers) i[t.id] = r[t.id] ?? { visibility: !1 };
6196
6226
  return i;
6197
6227
  }
6198
- function $i(e, t, n) {
6228
+ function na(e, t, n) {
6199
6229
  for (let r in t) {
6200
6230
  let i = e.getLayer(r);
6201
6231
  if (i !== void 0) {
@@ -6207,41 +6237,41 @@ function $i(e, t, n) {
6207
6237
  }
6208
6238
  }
6209
6239
  }
6210
- function ea(e, t, n, r, i, a, o, s) {
6240
+ function ra(e, t, n, r, i, a, o, s) {
6211
6241
  let { beforeNone: c = [], beforeNames: l = [], beforeBoundaries: u = [], beforeWaters: d = [] } = r;
6212
6242
  c.forEach((r) => {
6213
- ta(e, t, n, r, i, "mc-before-none", a, o, s);
6243
+ ia(e, t, n, r, i, "mc-before-none", a, o, s);
6214
6244
  }), l.forEach((r) => {
6215
- ta(e, t, n, r, i, "mc-before-names", a, o, s);
6245
+ ia(e, t, n, r, i, "mc-before-names", a, o, s);
6216
6246
  }), u.forEach((r) => {
6217
- ta(e, t, n, r, i, "mc-before-boundaries", a, o, s);
6247
+ ia(e, t, n, r, i, "mc-before-boundaries", a, o, s);
6218
6248
  }), d.forEach((r) => {
6219
- ta(e, t, n, r, i, "mc-before-waters", a, o, s);
6249
+ ia(e, t, n, r, i, "mc-before-waters", a, o, s);
6220
6250
  });
6221
6251
  }
6222
- function ta(e, t, n, r, i, a, o, s, c) {
6252
+ function ia(e, t, n, r, i, a, o, s, c) {
6223
6253
  if (r.type === "marker") {
6224
6254
  let o = n.marker?.find((e) => e.id === r.groupId);
6225
- o && Dr(e, o, a, i, t, c);
6255
+ o && Ar(e, o, a, i, t, c);
6226
6256
  } else if (r.type === "polygon") {
6227
6257
  let o = n.polygon?.find((e) => e.id === r.groupId);
6228
- o && Sr(e, o, a, i, t);
6258
+ o && Tr(e, o, a, i, t);
6229
6259
  } else if (r.type === "circle") {
6230
6260
  let o = n.circle?.find((e) => e.id === r.groupId);
6231
- o && wr(e, o, a, i, t);
6261
+ o && Dr(e, o, a, i, t);
6232
6262
  } else if (r.type === "line") {
6233
6263
  let i = n.line?.find((e) => e.id === r.groupId);
6234
- i && ei(e, i, a, t, c);
6264
+ i && ri(e, i, a, t, c);
6235
6265
  } else if (r.type === "dot") {
6236
6266
  let t = n.dot?.find((e) => e.id === r.groupId);
6237
- t && ii(e, t, a);
6267
+ t && si(e, t, a);
6238
6268
  } else if (r.type === "area") {
6239
6269
  let c = n.area?.find((e) => e.id === r.groupId);
6240
- c && ri(e, c, a, i, t, o, s);
6270
+ c && oi(e, c, a, i, t, o, s);
6241
6271
  }
6242
6272
  }
6243
6273
  //#endregion
6244
6274
  //#region src/index.bundler.ts
6245
6275
  c() || l(new URL("./mapcreator-sdk-worker.mjs",import.meta.url).href);
6246
6276
  //#endregion
6247
- export { Ki as initMap };
6277
+ export { Yi as initMap };