@mapcreator/sdk 0.0.0-video.2 → 0.0.0-video.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38240,6 +38240,47 @@ var Qc = {
38240
38240
  "fog-ground-blend": .5,
38241
38241
  "atmosphere-blend": 1
38242
38242
  }, $c = {
38243
+ top_left: {
38244
+ x: 5,
38245
+ y: 5,
38246
+ unit: "px"
38247
+ },
38248
+ top_center: {
38249
+ x: 0,
38250
+ y: 5,
38251
+ unit: "px"
38252
+ },
38253
+ top_right: {
38254
+ x: 5,
38255
+ y: 5,
38256
+ unit: "px"
38257
+ },
38258
+ right_center: {
38259
+ x: 5,
38260
+ y: 0,
38261
+ unit: "px"
38262
+ },
38263
+ bottom_right: {
38264
+ x: 5,
38265
+ y: 5,
38266
+ unit: "px"
38267
+ },
38268
+ bottom_center: {
38269
+ x: 0,
38270
+ y: 5,
38271
+ unit: "px"
38272
+ },
38273
+ bottom_left: {
38274
+ x: 5,
38275
+ y: 5,
38276
+ unit: "px"
38277
+ },
38278
+ left_center: {
38279
+ x: 5,
38280
+ y: 0,
38281
+ unit: "px"
38282
+ }
38283
+ }, el = {
38243
38284
  top_left: {
38244
38285
  x: "left",
38245
38286
  y: "top"
@@ -38272,7 +38313,7 @@ var Qc = {
38272
38313
  x: "left",
38273
38314
  y: "center"
38274
38315
  }
38275
- }, el = [
38316
+ }, tl = [
38276
38317
  "top_left",
38277
38318
  "top_right",
38278
38319
  "bottom_left",
@@ -38281,35 +38322,37 @@ var Qc = {
38281
38322
  "left_center",
38282
38323
  "right_center",
38283
38324
  "bottom_center"
38284
- ], tl = /* @__PURE__ */ new Map();
38285
- function nl(e, t, n, r, i, a, o) {
38286
- let { adornments: s = [] } = e;
38287
- rl(n, t), s.forEach((t) => {
38288
- t.type === "custom" ? al(j(t), t.position, t.stacking) : t.type === "scalebar" ? al(Jc(t, n), t.position, t.stacking) : t.type === "northArrow" ? al(oi(t, n), t.position, t.stacking) : t.type === "webControls" && t.buttons ? al(Ri(t, n, r), t.position, t.stacking) : t.type === "insetMap" ? al(Rc(t, n, a), t.position, t.stacking) : t.type === "heading" ? al(Xc(t, i, o), t.position, t.stacking) : t.type === "manualLegend" ? al(ai(t, i, o), t.position, t.stacking) : t.type === "connectedLegend" && al(Zr(t, e, n, i, o), t.position, t.stacking);
38289
- }), ol(n), n.on("moveend", () => ol(n));
38290
- }
38291
- function rl(e, t) {
38292
- let n = e.getContainer();
38293
- for (let e of el) {
38294
- let r = document.createElement("div");
38295
- r.classList.add("adornment-container", `${e}`), t?.[e] && (r.style.cssText = il(e, t));
38296
- let i = document.createElement("div"), a = document.createElement("div");
38297
- r.classList.add("adornment-container", e), i.classList.add("inner"), a.classList.add("inner", "vertical"), r.append(i, a), n.appendChild(r), tl.set(e, {
38298
- horizontal: i,
38299
- vertical: a
38325
+ ], nl = /* @__PURE__ */ new Map();
38326
+ function rl(e, t, n, r, i, a, o, s, c) {
38327
+ let { adornments: l = [] } = e;
38328
+ il(n, t, s, c), l.forEach((t) => {
38329
+ t.type === "custom" ? ol(j(t), t.position, t.stacking) : t.type === "scalebar" ? ol(Jc(t, n), t.position, t.stacking) : t.type === "northArrow" ? ol(oi(t, n), t.position, t.stacking) : t.type === "webControls" && t.buttons ? ol(Ri(t, n, r), t.position, t.stacking) : t.type === "insetMap" ? ol(Rc(t, n, a), t.position, t.stacking) : t.type === "heading" ? ol(Xc(t, i, o), t.position, t.stacking) : t.type === "manualLegend" ? ol(ai(t, i, o), t.position, t.stacking) : t.type === "connectedLegend" && ol(Zr(t, e, n, i, o), t.position, t.stacking);
38330
+ }), sl(n), n.on("moveend", () => sl(n));
38331
+ }
38332
+ function il(e, t, n, r) {
38333
+ let i = e.getContainer();
38334
+ for (let e of tl) {
38335
+ let a = document.createElement("div");
38336
+ a.classList.add("adornment-container", e), a.style.cssText = al(e, t[e], n, r);
38337
+ let o = document.createElement("div"), s = document.createElement("div");
38338
+ o.classList.add("inner"), s.classList.add("inner", "vertical"), a.append(o, s), i.appendChild(a), nl.set(e, {
38339
+ horizontal: o,
38340
+ vertical: s
38300
38341
  });
38301
38342
  }
38302
38343
  }
38303
- function il(e, t) {
38304
- let n = $c[e], { x: r, y: i, unit: a } = t[e], o = "", s = [];
38305
- return n.x === "center" ? s.push(`translateX(${r}${a})`) : o += `${n.x}: ${r}${a};`, n.y === "center" ? s.push(`translateY(${i}${a})`) : e === "bottom_right" ? o += `${n.y}: max(${i}${a}, 25px);` : o += `${n.y}: ${i}${a};`, s.length && (o += `transform: ${s.join(" ")};`), o;
38344
+ function al(e, t, n, r) {
38345
+ let i = el[e], a = "", o = [], s = t.x * n, c = t.y * n;
38346
+ o.push(`scale(${n})`);
38347
+ let { unit: l } = t;
38348
+ return i.x === "center" ? o.push(`translateX(${s}${l})`) : a += `${i.x}: ${s}${l};`, i.y === "center" ? o.push(`translateY(${c}${l})`) : e === "bottom_right" && r !== "video" ? a += `${i.y}: max(${c}${l}, 25px);` : a += `${i.y}: ${c}${l};`, o.length && (a += `transform: ${o.join(" ")};`), a;
38306
38349
  }
38307
- function al(e, t, n) {
38350
+ function ol(e, t, n) {
38308
38351
  n ||= ["left_center", "right_center"].includes(t) ? "vertical" : "horizontal";
38309
- let r = tl.get(t), i = t === "left_center" || t === "right_center" ? "vertical" : "horizontal";
38352
+ let r = nl.get(t), i = t === "left_center" || t === "right_center" ? "vertical" : "horizontal";
38310
38353
  r?.[i].hasChildNodes() || (n = i), (r?.[n])?.appendChild(e);
38311
38354
  }
38312
- function ol(e) {
38355
+ function sl(e) {
38313
38356
  let t = Array.from(document.querySelectorAll(".adornment, .maplibregl-ctrl-attrib")), n = [];
38314
38357
  t.forEach((e) => {
38315
38358
  let t = e.getBoundingClientRect();
@@ -38323,12 +38366,12 @@ function ol(e) {
38323
38366
  }
38324
38367
  //#endregion
38325
38368
  //#region src/models/polygon.ts
38326
- function sl(e, t, n, r, i) {
38369
+ function cl(e, t, n, r, i) {
38327
38370
  e.addSource(t.id, {
38328
38371
  type: "geojson",
38329
38372
  data: {
38330
38373
  type: "FeatureCollection",
38331
- features: t.models.filter((e) => e.visible ?? !0).map((e) => cl(t, e, r, i))
38374
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => ll(t, e, r, i))
38332
38375
  }
38333
38376
  }), e.addLayer({
38334
38377
  id: t.id,
@@ -38367,7 +38410,7 @@ function sl(e, t, n, r, i) {
38367
38410
  }
38368
38411
  }, n);
38369
38412
  }
38370
- function cl(e, t, n, r) {
38413
+ function ll(e, t, n, r) {
38371
38414
  let i = t.fillPattern === void 0 ? void 0 : r.getMapLibreImageKey(n[t.fillPattern], 2 * window.devicePixelRatio);
38372
38415
  return {
38373
38416
  type: "Feature",
@@ -38387,12 +38430,12 @@ function cl(e, t, n, r) {
38387
38430
  }
38388
38431
  //#endregion
38389
38432
  //#region src/models/circle.ts
38390
- function ll(e, t, n, r, i) {
38433
+ function ul(e, t, n, r, i) {
38391
38434
  e.addSource(t.id, {
38392
38435
  type: "geojson",
38393
38436
  data: {
38394
38437
  type: "FeatureCollection",
38395
- features: t.models.filter((e) => e.visible ?? !0).map((e) => ul(t, e, r, i))
38438
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => dl(t, e, r, i))
38396
38439
  }
38397
38440
  }), e.addLayer({
38398
38441
  id: t.id,
@@ -38462,7 +38505,7 @@ function ll(e, t, n, r, i) {
38462
38505
  }
38463
38506
  }, n);
38464
38507
  }
38465
- function ul(e, t, n, r) {
38508
+ function dl(e, t, n, r) {
38466
38509
  let i = t.fillPattern === void 0 ? void 0 : r.getMapLibreImageKey(n[t.fillPattern], 2 * window.devicePixelRatio);
38467
38510
  return {
38468
38511
  type: "Feature",
@@ -38491,13 +38534,13 @@ function ul(e, t, n, r) {
38491
38534
  }
38492
38535
  //#endregion
38493
38536
  //#region src/models/marker.ts
38494
- var dl = "Roboto-Regular";
38495
- function fl(e, t, n, r, i) {
38537
+ var fl = "Roboto-Regular";
38538
+ function pl(e, t, n, r, i) {
38496
38539
  let a = [], o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = ["match", ["get", "text-font"]], l = !!t.clustering;
38497
- for (let e of t.models) (e.visible ?? !0) && a.push(ml(t, e, r, i)), o.add(e.textFont), s.add(e.textLineHeight ?? 1.2);
38540
+ for (let e of t.models) (e.visible ?? !0) && a.push(hl(t, e, r, i)), o.add(e.textFont), s.add(e.textLineHeight ?? 1.2);
38498
38541
  if (Array.from(o).length > 0) {
38499
- for (let e of Array.from(o)) c.push(e, ["literal", [e, dl]]);
38500
- c.push(["literal", [dl]]);
38542
+ for (let e of Array.from(o)) c.push(e, ["literal", [e, fl]]);
38543
+ c.push(["literal", [fl]]);
38501
38544
  }
38502
38545
  e.addSource(t.id, {
38503
38546
  type: "geojson",
@@ -38581,7 +38624,7 @@ function fl(e, t, n, r, i) {
38581
38624
  stops: t.clusterTextColor ?? []
38582
38625
  } },
38583
38626
  layout: {
38584
- "text-font": ["literal", [dl]],
38627
+ "text-font": ["literal", [fl]],
38585
38628
  "text-field": "{point_count_abbreviated}",
38586
38629
  "text-size": {
38587
38630
  property: "point_count",
@@ -38589,9 +38632,9 @@ function fl(e, t, n, r, i) {
38589
38632
  stops: t.clusterTextSize ?? []
38590
38633
  }
38591
38634
  }
38592
- }), pl(e, t));
38635
+ }), ml(e, t));
38593
38636
  }
38594
- function pl(e, t) {
38637
+ function ml(e, t) {
38595
38638
  e.on("click", `${t.id}-circle-cluster`, async (t) => {
38596
38639
  let n = e.queryRenderedFeatures(t.point).find((e) => e.properties.cluster);
38597
38640
  if (!n) return;
@@ -38604,7 +38647,7 @@ function pl(e, t) {
38604
38647
  });
38605
38648
  });
38606
38649
  }
38607
- function ml(e, t, n, r) {
38650
+ function hl(e, t, n, r) {
38608
38651
  let i = t.svg === void 0 ? void 0 : r.getMapLibreImageKey(Vr(t.dataBindings ?? {}, n[t.svg], e.svg ? n[e.svg] : void 0), window.devicePixelRatio * (t.iconScale ?? 1));
38609
38652
  return {
38610
38653
  type: "Feature",
@@ -38638,20 +38681,20 @@ function ml(e, t, n, r) {
38638
38681
  }
38639
38682
  //#endregion
38640
38683
  //#region src/utils/overlays.ts
38641
- async function hl(e, t, n, r, i) {
38684
+ async function gl(e, t, n, r, i) {
38642
38685
  let a = e.map((e) => `${n}/styles/${e}.json?access_token=${r}`).map((e) => fetch(e).then((e) => e.json())), o = await Promise.all(a);
38643
- await Promise.all(o.map((e) => gl(e, t, r, i)));
38686
+ await Promise.all(o.map((e) => _l(e, t, r, i)));
38644
38687
  }
38645
- async function gl(e, t, n, r) {
38688
+ async function _l(e, t, n, r) {
38646
38689
  for (let n in e.sources) t.getSource(n) === void 0 && t.addSource(n, e.sources[n]);
38647
- e.sprite !== void 0 && await vl(t, e.sprite, n);
38690
+ e.sprite !== void 0 && await yl(t, e.sprite, n);
38648
38691
  for (let n of e.layers) {
38649
38692
  t.getLayer(n.id) !== void 0 && t.removeLayer(n.id);
38650
38693
  let e = n.metadata?.["mc-add-before"] ?? "mc-before-none";
38651
- t.addLayer(_l(n, r), e);
38694
+ t.addLayer(vl(n, r), e);
38652
38695
  }
38653
38696
  }
38654
- function _l(e, t) {
38697
+ function vl(e, t) {
38655
38698
  let n = (t ?? {})[e.id] ?? {}, r = {
38656
38699
  ...e,
38657
38700
  layout: {
@@ -38669,7 +38712,7 @@ function _l(e, t) {
38669
38712
  };
38670
38713
  return n.minzoom !== void 0 && (r.minzoom = n.minzoom), n.maxzoom !== void 0 && (r.maxzoom = n.maxzoom), "filter" in n && r.type !== "background" && (r.filter = n.filter), r;
38671
38714
  }
38672
- async function vl(e, t, n) {
38715
+ async function yl(e, t, n) {
38673
38716
  try {
38674
38717
  let r = `${t}.json?access_token=${n}`, i = `${t}.png?access_token=${n}`, [a, o] = await Promise.all([fetch(r), fetch(i)]);
38675
38718
  if (!a.ok || !o.ok) throw Error(`Failed to load sprite from ${t}`);
@@ -38691,23 +38734,23 @@ async function vl(e, t, n) {
38691
38734
  }
38692
38735
  //#endregion
38693
38736
  //#region src/images/popup-previous.svg?raw
38694
- var yl = "<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", bl = "<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", xl = "<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", Sl = "<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";
38737
+ var bl = "<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", xl = "<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", Sl = "<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", Cl = "<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";
38695
38738
  //#endregion
38696
38739
  //#region src/utils/youtube.ts
38697
- function Cl(e, t) {
38740
+ function wl(e, t) {
38698
38741
  let { allowFullscreen: n, loop: r } = e, i = b(e.src, t), a, o = i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];
38699
38742
  a = o ? `https://www.youtube.com/embed/${o}` : i;
38700
38743
  let s = [];
38701
- if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a = Tl(a), a = wl(a), s.length) {
38744
+ if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a = El(a), a = Tl(a), s.length) {
38702
38745
  let e = a.includes("?") ? "&" : "?";
38703
38746
  a += `${e}${s.join("&")}`;
38704
38747
  }
38705
38748
  return a;
38706
38749
  }
38707
- function wl(e) {
38750
+ function Tl(e) {
38708
38751
  return e.replace(/([?&])si=[^&]+(&)?/, (e, t, n) => t === "?" && !n ? "" : t === "?" && n ? "?" : n ? "&" : "");
38709
38752
  }
38710
- function Tl(e) {
38753
+ function El(e) {
38711
38754
  let t = new URL(e), n = t.searchParams.get("t");
38712
38755
  if (!n) return e;
38713
38756
  let r = 0, i = /^((\d+)m)?((\d+)s)?$/;
@@ -38723,12 +38766,12 @@ function Tl(e) {
38723
38766
  }
38724
38767
  //#endregion
38725
38768
  //#region src/utils/template.ts
38726
- function El(e, t, n, r) {
38769
+ function Dl(e, t, n, r) {
38727
38770
  let i;
38728
- if (t?.type === "video") i = r === "preview" ? jl(t.src, n) : `
38771
+ if (t?.type === "video") i = r === "preview" ? Ml(t.src, n) : `
38729
38772
  <div class="youtube-container">
38730
38773
  <iframe
38731
- src="${Cl(t, n)}"
38774
+ src="${wl(t, n)}"
38732
38775
  width="100%" height="300" style="border: none" allowfullscreen>
38733
38776
  </iframe>
38734
38777
  </div>
@@ -38742,7 +38785,7 @@ function El(e, t, n, r) {
38742
38785
  `;
38743
38786
  }
38744
38787
  i = i ? `<div class="media-content">${i}</div>` : "";
38745
- let a = e ? `<div class="text-content">${kl(e, n)}</div>` : "";
38788
+ let a = e ? `<div class="text-content">${Al(e, n)}</div>` : "";
38746
38789
  return `
38747
38790
  <div class="popup-scroll-wrapper">
38748
38791
  <div class="mc-popup">
@@ -38752,38 +38795,38 @@ function El(e, t, n, r) {
38752
38795
  </div>
38753
38796
  `;
38754
38797
  }
38755
- var Dl = `
38798
+ var Ol = `
38756
38799
  <button class="mc-popup-button close">
38757
- ${bl}
38800
+ ${xl}
38758
38801
  </button>
38759
- `, Ol = `
38802
+ `, kl = `
38760
38803
  <div class="cycle-buttons">
38761
38804
  <button class="mc-popup-button prev">
38762
- ${yl}
38805
+ ${bl}
38763
38806
  </button>
38764
38807
  <button class="mc-popup-button next">
38765
- ${xl}
38808
+ ${Sl}
38766
38809
  </button>
38767
38810
  </div>
38768
38811
  `;
38769
- function kl(e, t) {
38812
+ function Al(e, t) {
38770
38813
  return e ? (e = e.replace(/placeholder="[^"]+"/, ""), e = e.replace(/onerror="[^"]+"/, ""), e = e.replace(/youtube\.com\/embed\/\$([^"'<>\\]+)/gi, (e, n) => {
38771
38814
  let r = x(t[n]);
38772
38815
  return r ? `youtube.com/embed/${C(r)}?` : "";
38773
38816
  }), e = e.replace(/(\S+?)\s*=\s*"\$([^"]+?)"/g, (e, n, r) => {
38774
38817
  let i = x(t[r]);
38775
- return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${Al(i)}"` : ` ${n}="${i}"`;
38818
+ return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${jl(i)}"` : ` ${n}="${i}"`;
38776
38819
  }), e = e.replace(/>\$(.+?)</gi, (e, n) => `>${x(t[n])}<`), e = e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim, (e, t) => t), e) : "";
38777
38820
  }
38778
- function Al(e) {
38821
+ function jl(e) {
38779
38822
  return /^https?:\/\//i.test(e) ? e : `https://${e}`;
38780
38823
  }
38781
- function jl(e, t) {
38824
+ function Ml(e, t) {
38782
38825
  return `
38783
38826
  <div class="youtube-placeholder">
38784
38827
  <img src="${`https://img.youtube.com/vi/${C(b(e, t))}/hqdefault.jpg`}" />
38785
38828
  <div class="popup-alert">
38786
- <div class="alert-icon">${Sl}</div>
38829
+ <div class="alert-icon">${Cl}</div>
38787
38830
  <div>${Fi("videoAlert")}</div>
38788
38831
  </div>
38789
38832
  </div>
@@ -38791,14 +38834,14 @@ function jl(e, t) {
38791
38834
  }
38792
38835
  //#endregion
38793
38836
  //#region src/Registry.ts
38794
- var Ml = [
38837
+ var Nl = [
38795
38838
  "area",
38796
38839
  "circle",
38797
38840
  "dot",
38798
38841
  "line",
38799
38842
  "marker",
38800
38843
  "polygon"
38801
- ], Nl = class {
38844
+ ], Pl = class {
38802
38845
  data;
38803
38846
  customGroupIds;
38804
38847
  constructor(e) {
@@ -38810,7 +38853,7 @@ var Ml = [
38810
38853
  marker: {},
38811
38854
  polygon: {}
38812
38855
  };
38813
- for (let t of Ml) for (let n of e.registry?.models?.[t] ?? []) {
38856
+ for (let t of Nl) for (let n of e.registry?.models?.[t] ?? []) {
38814
38857
  this.data[t][n.id] = {};
38815
38858
  for (let e of n.models) {
38816
38859
  if (t === "area") {
@@ -38856,7 +38899,7 @@ var Ml = [
38856
38899
  }
38857
38900
  return e.reverse();
38858
38901
  }
38859
- }, Pl = class {
38902
+ }, Fl = class {
38860
38903
  map;
38861
38904
  popupElements;
38862
38905
  markerLayerIds;
@@ -39005,7 +39048,7 @@ var Ml = [
39005
39048
  r / i
39006
39049
  ];
39007
39050
  }
39008
- }, Fl = class {
39051
+ }, Il = class {
39009
39052
  map;
39010
39053
  popupPosition = "bottomLeft";
39011
39054
  mapContainer;
@@ -39027,7 +39070,7 @@ var Ml = [
39027
39070
  this.map = e, this.mode = 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));
39028
39071
  }
39029
39072
  setJobObject(e) {
39030
- this.registry = new Nl(e);
39073
+ this.registry = new Pl(e);
39031
39074
  }
39032
39075
  setParams(e, t, n, r) {
39033
39076
  this.popupPosition = e, this.language = t, this.restrictMapMovement = n, this.center = r;
@@ -39039,7 +39082,7 @@ var Ml = [
39039
39082
  this.popupElements = this.registry.getPopupElements();
39040
39083
  }
39041
39084
  setHighlightManager() {
39042
- this.highlightManager = new Pl(this.map, this.registry.getPopupElements());
39085
+ this.highlightManager = new Fl(this.map, this.registry.getPopupElements());
39043
39086
  }
39044
39087
  onMouseMove(e) {
39045
39088
  this.feature = this.getInteractiveFeature(e), this.feature ? this.map.getCanvas().style.cursor = "pointer" : this.map.getCanvas().style.cursor = "";
@@ -39093,7 +39136,7 @@ var Ml = [
39093
39136
  }
39094
39137
  getTemplate(e) {
39095
39138
  let { layer: t } = e, n, r = this.registry.getModel(e);
39096
- if (r?.popup || r?.popupMedia) n = El(r.popup, r.popupMedia, r.dataBindings ?? {}, this.mode);
39139
+ if (r?.popup || r?.popupMedia) n = Dl(r.popup, r.popupMedia, r.dataBindings ?? {}, this.mode);
39097
39140
  else {
39098
39141
  let r = [];
39099
39142
  this.publication && (r.push(`:${this.publication}-${this.language}`), r.push(`:${this.publication}-:en`)), r.push(`:${this.language}`), r.push(":en"), r.push("");
@@ -39117,11 +39160,11 @@ var Ml = [
39117
39160
  return t.innerHTML = e.trim(), t.content.firstElementChild;
39118
39161
  }
39119
39162
  addPopupControls() {
39120
- let e = this.htmlToElement(Dl);
39163
+ let e = this.htmlToElement(Ol);
39121
39164
  if (e && (e.addEventListener("click", () => {
39122
39165
  this.hidePopup(), this.highlightManager.highlight(void 0);
39123
39166
  }), this.popupContainer.appendChild(e)), this.popupElements.length < 2) return;
39124
- let t = this.htmlToElement(Ol);
39167
+ let t = this.htmlToElement(kl);
39125
39168
  t && (t.querySelector(".prev")?.addEventListener("click", () => this.cyclePopups(!1)), t.querySelector(".next")?.addEventListener("click", () => this.cyclePopups()), this.popupContainer.appendChild(t));
39126
39169
  }
39127
39170
  fillDatalayerTemplate(e, t, n) {
@@ -39157,23 +39200,23 @@ var Ml = [
39157
39200
  n = e ? t === this.popupElements.length - 1 ? 0 : t + 1 : t === 0 ? this.popupElements.length - 1 : t - 1;
39158
39201
  let r = this.popupElements?.[n];
39159
39202
  this.highlightManager.highlight(r);
39160
- let i = El(r.popup, r.popupMedia, r.dataBindings ?? {}, this.mode), a = this.popupContainer;
39203
+ let i = Dl(r.popup, r.popupMedia, r.dataBindings ?? {}, this.mode), a = this.popupContainer;
39161
39204
  this.popupContainer.remove(), a.innerHTML = i, this.mapContainer.appendChild(a), this.currentModelId = r.modelId, this.addPopupControls(), e ? this.popupContainer.querySelector(".mc-popup-button.next")?.focus() : this.popupContainer.querySelector(".mc-popup-button.prev")?.focus(), this.currentFeatureId = void 0;
39162
39205
  }
39163
39206
  }
39164
- }, Il = {
39207
+ }, Ll = {
39165
39208
  solid: [1, 0],
39166
39209
  dotted: [.7, .3],
39167
39210
  dashed: [3.5, 1.5]
39168
39211
  };
39169
- function Ll(e, t, n, r) {
39212
+ function Rl(e, t, n, r) {
39170
39213
  e.addSource(t.id, {
39171
39214
  type: "geojson",
39172
39215
  data: {
39173
39216
  type: "FeatureCollection",
39174
- features: t.models.filter((e) => e.visible ?? !0).map((n) => Rl(e, t, n, r))
39217
+ features: t.models.filter((e) => e.visible ?? !0).map((n) => zl(e, t, n, r))
39175
39218
  }
39176
- }), Object.entries(Il).forEach(([r, i]) => {
39219
+ }), Object.entries(Ll).forEach(([r, i]) => {
39177
39220
  t.models.some((e) => (e.lineStyle ?? "solid") === r) && e.addLayer({
39178
39221
  id: `${t.id}-${r}`,
39179
39222
  type: "line",
@@ -39246,7 +39289,7 @@ function Ll(e, t, n, r) {
39246
39289
  ]
39247
39290
  }, n);
39248
39291
  }
39249
- function Rl(e, t, n, r) {
39292
+ function zl(e, t, n, r) {
39250
39293
  let i = n.svg === void 0 ? void 0 : r.getMapLibreImageKey(Vr(n.dataBindings ?? {}, n.svg, void 0), window.devicePixelRatio * (n.iconScale ?? 1));
39251
39294
  return {
39252
39295
  type: "Feature",
@@ -39257,7 +39300,7 @@ function Rl(e, t, n, r) {
39257
39300
  "line-color": t.lineColor || n.lineColor ? zr(n.dataBindings ?? {}, n.lineColor, t.lineColor) : "#000000",
39258
39301
  "line-style": n.lineStyle ?? "solid",
39259
39302
  "mc-image-key": i,
39260
- "icon-rotate": zl(n, e),
39303
+ "icon-rotate": Bl(n, e),
39261
39304
  "icon-offset": n.iconOffset,
39262
39305
  "icon-size": n.iconScale
39263
39306
  },
@@ -39273,12 +39316,12 @@ function Rl(e, t, n, r) {
39273
39316
  }
39274
39317
  };
39275
39318
  }
39276
- function zl(e, t) {
39319
+ function Bl(e, t) {
39277
39320
  return e.iconRotation ? e.iconAlign ? ar(e.geometry, t) + e.iconRotation : e.iconRotation : 0;
39278
39321
  }
39279
39322
  //#endregion
39280
39323
  //#region src/models/area.ts
39281
- function Bl(e, t, n, r, i, a, o) {
39324
+ function Vl(e, t, n, r, i, a, o) {
39282
39325
  let s = fr(t), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
39283
39326
  for (let e of t.models) {
39284
39327
  let n = e.featureId, a = t.id, o = [], u = rr(e), d = nr(a, e), f = l.get(d) ?? {
@@ -39428,12 +39471,12 @@ function Bl(e, t, n, r, i, a, o) {
39428
39471
  }
39429
39472
  //#endregion
39430
39473
  //#region src/models/dot.ts
39431
- function Vl(e, t, n) {
39474
+ function Hl(e, t, n) {
39432
39475
  e.addSource(t.id, {
39433
39476
  type: "geojson",
39434
39477
  data: {
39435
39478
  type: "FeatureCollection",
39436
- features: t.models.filter((e) => e.visible ?? !0).map((e) => Hl(t, e))
39479
+ features: t.models.filter((e) => e.visible ?? !0).map((e) => Ul(t, e))
39437
39480
  }
39438
39481
  }), e.addLayer({
39439
39482
  id: t.id,
@@ -39449,7 +39492,7 @@ function Vl(e, t, n) {
39449
39492
  }
39450
39493
  }, n);
39451
39494
  }
39452
- function Hl(e, t) {
39495
+ function Ul(e, t) {
39453
39496
  return {
39454
39497
  type: "Feature",
39455
39498
  id: t.id,
@@ -39466,54 +39509,54 @@ function Hl(e, t) {
39466
39509
  }
39467
39510
  //#endregion
39468
39511
  //#region src/utils/video/index.ts
39469
- function Ul(e) {
39470
- let t = e.length > 0 ? [Wl(e[0])] : [], n = 0, r = 0;
39512
+ function Wl(e) {
39513
+ let t = e.length > 0 ? [Gl(e[0])] : [], n = 0, r = 0;
39471
39514
  for (let i = 1; i < e.length; ++i) {
39472
- let a = Wl(e[i]);
39473
- n += Gl(e[i - 1].center[0], a.center[0]), r += Gl(e[i - 1].bearing, a.bearing), a.center[0] += n * 360, a.x += n, a.bearing += r * 360, t.push(a);
39515
+ let a = Gl(e[i]);
39516
+ n += Kl(e[i - 1].center[0], a.center[0]), r += Kl(e[i - 1].bearing, a.bearing), a.center[0] += n * 360, a.x += n, a.bearing += r * 360, t.push(a);
39474
39517
  }
39475
39518
  return t;
39476
39519
  }
39477
- function Wl(e) {
39520
+ function Gl(e) {
39478
39521
  return {
39479
39522
  ...e,
39480
39523
  center: [e.center[0], e.center[1]]
39481
39524
  };
39482
39525
  }
39483
- function Gl(e, t) {
39526
+ function Kl(e, t) {
39484
39527
  if (Math.abs(e) + Math.abs(t) > 180) {
39485
39528
  if (e > 0 && t < 0) return 1;
39486
39529
  if (e < 0 && t > 0) return -1;
39487
39530
  }
39488
39531
  return 0;
39489
39532
  }
39490
- function Kl(e) {
39533
+ function ql(e) {
39491
39534
  return 2 ** -e;
39492
39535
  }
39493
- function ql(e) {
39536
+ function Jl(e) {
39494
39537
  return e.length > 0 ? e[e.length - 1].time : 0;
39495
39538
  }
39496
39539
  //#endregion
39497
39540
  //#region node_modules/d3-shape/src/curve/monotone.js
39498
- function Jl(e) {
39541
+ function Yl(e) {
39499
39542
  return e < 0 ? -1 : 1;
39500
39543
  }
39501
- function Yl(e, t, n) {
39544
+ function Xl(e, t, n) {
39502
39545
  var r = e._x1 - e._x0, i = t - e._x1, a = (e._y1 - e._y0) / (r || i < 0 && -0), o = (n - e._y1) / (i || r < 0 && -0), s = (a * i + o * r) / (r + i);
39503
- return (Jl(a) + Jl(o)) * Math.min(Math.abs(a), Math.abs(o), .5 * Math.abs(s)) || 0;
39546
+ return (Yl(a) + Yl(o)) * Math.min(Math.abs(a), Math.abs(o), .5 * Math.abs(s)) || 0;
39504
39547
  }
39505
- function Xl(e, t) {
39548
+ function Zl(e, t) {
39506
39549
  var n = e._x1 - e._x0;
39507
39550
  return n ? (3 * (e._y1 - e._y0) / n - t) / 2 : t;
39508
39551
  }
39509
- function Zl(e, t, n) {
39552
+ function Ql(e, t, n) {
39510
39553
  var r = e._x0, i = e._y0, a = e._x1, o = e._y1, s = (a - r) / 3;
39511
39554
  e._context.bezierCurveTo(r + s, i + s * t, a - s, o - s * n, a, o);
39512
39555
  }
39513
- function Ql(e) {
39556
+ function $l(e) {
39514
39557
  this._context = e;
39515
39558
  }
39516
- Ql.prototype = {
39559
+ $l.prototype = {
39517
39560
  areaStart: function() {
39518
39561
  this._line = 0;
39519
39562
  },
@@ -39529,7 +39572,7 @@ Ql.prototype = {
39529
39572
  this._context.lineTo(this._x1, this._y1);
39530
39573
  break;
39531
39574
  case 3:
39532
- Zl(this, this._t0, Xl(this, this._t0));
39575
+ Ql(this, this._t0, Zl(this, this._t0));
39533
39576
  break;
39534
39577
  }
39535
39578
  (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
@@ -39545,26 +39588,26 @@ Ql.prototype = {
39545
39588
  this._point = 2;
39546
39589
  break;
39547
39590
  case 2:
39548
- this._point = 3, Zl(this, Xl(this, n = Yl(this, e, t)), n);
39591
+ this._point = 3, Ql(this, Zl(this, n = Xl(this, e, t)), n);
39549
39592
  break;
39550
39593
  default:
39551
- Zl(this, this._t0, n = Yl(this, e, t));
39594
+ Ql(this, this._t0, n = Xl(this, e, t));
39552
39595
  break;
39553
39596
  }
39554
39597
  this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t, this._t0 = n;
39555
39598
  }
39556
39599
  }
39557
39600
  };
39558
- function $l(e) {
39559
- this._context = new eu(e);
39601
+ function eu(e) {
39602
+ this._context = new tu(e);
39560
39603
  }
39561
- ($l.prototype = Object.create(Ql.prototype)).point = function(e, t) {
39562
- Ql.prototype.point.call(this, t, e);
39604
+ (eu.prototype = Object.create($l.prototype)).point = function(e, t) {
39605
+ $l.prototype.point.call(this, t, e);
39563
39606
  };
39564
- function eu(e) {
39607
+ function tu(e) {
39565
39608
  this._context = e;
39566
39609
  }
39567
- eu.prototype = {
39610
+ tu.prototype = {
39568
39611
  moveTo: function(e, t) {
39569
39612
  this._context.moveTo(t, e);
39570
39613
  },
@@ -39578,34 +39621,34 @@ eu.prototype = {
39578
39621
  this._context.bezierCurveTo(t, e, r, n, a, i);
39579
39622
  }
39580
39623
  };
39581
- function tu(e) {
39582
- return new Ql(e);
39624
+ function nu(e) {
39625
+ return new $l(e);
39583
39626
  }
39584
39627
  //#endregion
39585
39628
  //#region node_modules/bezier-easing/src/index.js
39586
- function nu(e) {
39629
+ function ru(e) {
39587
39630
  return e;
39588
39631
  }
39589
- var { cbrt: ru, sqrt: iu, PI: au } = Math, ou = (e, t, n, r, i) => {
39632
+ var { cbrt: iu, sqrt: au, PI: ou } = Math, su = (e, t, n, r, i) => {
39590
39633
  let a = t + n * e, o = a ** 2 + r;
39591
39634
  if (o > 0) {
39592
- let e = iu(o);
39593
- return ru(a + e) + ru(a - e) - i;
39635
+ let e = au(o);
39636
+ return iu(a + e) + iu(a - e) - i;
39594
39637
  }
39595
- let s = ru(iu(a * a - o)), c = a ? Math.atan(iu(-o) / a) : -au / 2, l;
39596
- return l = n < 0 ? (a > 0 ? 2 * au : au) - c : i < 0 ? (a > 0 ? 2 * au : -3 * au) + c : (a > 0 ? 0 : au) + c, 2 * s * Math.cos(l / 3) - i;
39597
- }, su = (e, t, n, r) => ((t * e + 3 * n) * e + r) * e;
39598
- function cu(e, t, n, r) {
39638
+ let s = iu(au(a * a - o)), c = a ? Math.atan(au(-o) / a) : -ou / 2, l;
39639
+ return l = n < 0 ? (a > 0 ? 2 * ou : ou) - c : i < 0 ? (a > 0 ? 2 * ou : -3 * ou) + c : (a > 0 ? 0 : ou) + c, 2 * s * Math.cos(l / 3) - i;
39640
+ }, cu = (e, t, n, r) => ((t * e + 3 * n) * e + r) * e;
39641
+ function lu(e, t, n, r) {
39599
39642
  if (!(0 <= e && e <= 1 && 0 <= n && n <= 1)) throw Error("bezier x values must be in [0, 1] range");
39600
- if (e === t && n === r) return nu;
39601
- let i = 6 * (3 * e - 3 * n + 1), a = 6 * (n - 2 * e), o = 3 * e, s = i * i, c = a * a, l = a / i, u = 3 * a * o / s - c * a / (s * i), d = 2 * o / i - c / s, f = d * d * d, p = 3 / i, m = 3 * t - 3 * r + 1, h = r - 2 * t, g = 3 * t, _ = i ? ou : nu;
39643
+ if (e === t && n === r) return ru;
39644
+ let i = 6 * (3 * e - 3 * n + 1), a = 6 * (n - 2 * e), o = 3 * e, s = i * i, c = a * a, l = a / i, u = 3 * a * o / s - c * a / (s * i), d = 2 * o / i - c / s, f = d * d * d, p = 3 / i, m = 3 * t - 3 * r + 1, h = r - 2 * t, g = 3 * t, _ = i ? su : ru;
39602
39645
  return function(e) {
39603
- return e === 0 || e === 1 ? e : su(_(e, u, p, f, l), m, h, g);
39646
+ return e === 0 || e === 1 ? e : cu(_(e, u, p, f, l), m, h, g);
39604
39647
  };
39605
39648
  }
39606
39649
  //#endregion
39607
39650
  //#region src/utils/video/monotonicCurve.ts
39608
- var lu = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
39651
+ var uu = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
39609
39652
  t.exports = n;
39610
39653
  function n(e, t, n, r) {
39611
39654
  var i, a, o, s, c, l, u, d, f, p, m, h, g, _;
@@ -39616,11 +39659,11 @@ var lu = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
39616
39659
  }
39617
39660
  return g && console.log("Newton-Raphson: Maximum iterations reached (" + c + ")"), !1;
39618
39661
  }
39619
- })))(), 1), uu = class {
39662
+ })))(), 1), du = class {
39620
39663
  segments;
39621
39664
  constructor(e) {
39622
39665
  this.segments = [];
39623
- let t = new du(), n = tu(t);
39666
+ let t = new fu(), n = nu(t);
39624
39667
  n.lineStart();
39625
39668
  for (let t of e) n.point(t.x, t.y);
39626
39669
  n.lineEnd(), this.segments = t.segments;
@@ -39632,17 +39675,17 @@ var lu = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
39632
39675
  return t.startY !== t.endY && t.easing !== void 0 ? E(t.startY, t.endY, t.easing(n)) : E(t.startY, t.endY, n);
39633
39676
  }
39634
39677
  solve(e, t) {
39635
- let n = (0, lu.default)((t) => this.sample(t) - e, t);
39678
+ let n = (0, uu.default)((t) => this.sample(t) - e, t);
39636
39679
  return n === !1 ? t : n;
39637
39680
  }
39638
- }, du = class {
39681
+ }, fu = class {
39639
39682
  previousPoint = {
39640
39683
  x: 0,
39641
39684
  y: 0
39642
39685
  };
39643
39686
  segments = [];
39644
39687
  bezierCurveTo(e, t, n, r, i, a) {
39645
- let o = this.previousPoint.x, s = this.previousPoint.y, c = i === o ? void 0 : cu((e - o) / (i - o), (t - s) / (a - s), (n - o) / (i - o), (r - s) / (a - s));
39688
+ let o = this.previousPoint.x, s = this.previousPoint.y, c = i === o ? void 0 : lu((e - o) / (i - o), (t - s) / (a - s), (n - o) / (i - o), (r - s) / (a - s));
39646
39689
  this.segments.push({
39647
39690
  startX: o,
39648
39691
  endX: i,
@@ -39680,12 +39723,12 @@ var lu = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
39680
39723
  };
39681
39724
  //#endregion
39682
39725
  //#region src/utils/video/easings.ts
39683
- function fu(e, t, n, r) {
39726
+ function pu(e, t, n, r) {
39684
39727
  return n * ((e = e / r - 1) * e * e + 1) + t;
39685
39728
  }
39686
39729
  //#endregion
39687
39730
  //#region src/utils/video/cameraCurve.ts
39688
- var pu = class {
39731
+ var mu = class {
39689
39732
  script;
39690
39733
  xCurve;
39691
39734
  yCurve;
@@ -39696,10 +39739,10 @@ var pu = class {
39696
39739
  altitudeCurve;
39697
39740
  elevationCurve;
39698
39741
  constructor(e) {
39699
- this.script = Ul(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");
39742
+ this.script = Wl(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");
39700
39743
  }
39701
39744
  sample(e) {
39702
- let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(Kl(t), e), r = this.xCurve.sample(n), i = this.yCurve.sample(n), a = this.elevationCurve.sample(n), o = this.bearingCurve.sample(e), s = this.pitchCurve.sample(e), c = this.fovCurve.sample(e);
39745
+ let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(ql(t), e), r = this.xCurve.sample(n), i = this.yCurve.sample(n), a = this.elevationCurve.sample(n), o = this.bearingCurve.sample(e), s = this.pitchCurve.sample(e), c = this.fovCurve.sample(e);
39703
39746
  return {
39704
39747
  center: new l.MercatorCoordinate(r, i).toLngLat(),
39705
39748
  zoom: t,
@@ -39743,7 +39786,7 @@ var pu = class {
39743
39786
  y: l
39744
39787
  });
39745
39788
  }
39746
- return new uu(n);
39789
+ return new du(n);
39747
39790
  }
39748
39791
  sampleAutoHideOpacity(e) {
39749
39792
  let t = this.script;
@@ -39754,12 +39797,12 @@ var pu = class {
39754
39797
  if (r.hideLabels === (a?.hideLabels ?? !1)) o = r.hideLabels ? 0 : 1;
39755
39798
  else {
39756
39799
  let t = e - r.time, n = Math.min(400, i.time - r.time);
39757
- o = O(fu(t, r.hideLabels ? 1 : 0, r.hideLabels ? -1 : 1, n), 0, 1);
39800
+ o = O(pu(t, r.hideLabels ? 1 : 0, r.hideLabels ? -1 : 1, n), 0, 1);
39758
39801
  }
39759
39802
  let s;
39760
39803
  if (n === t.length - 2 && r.hideLabels) {
39761
39804
  let t = Math.max(r.time, i.time - 400);
39762
- s = O(fu(e - t, 0, 1, i.time - t), 0, 1);
39805
+ s = O(pu(e - t, 0, 1, i.time - t), 0, 1);
39763
39806
  } else s = 0;
39764
39807
  return Math.max(o, s);
39765
39808
  }
@@ -39771,10 +39814,10 @@ var pu = class {
39771
39814
  }
39772
39815
  }
39773
39816
  getKeyframeValue(e, t) {
39774
- return t === "altitude" ? Kl(e.zoom) : e[t];
39817
+ return t === "altitude" ? ql(e.zoom) : e[t];
39775
39818
  }
39776
- }, mu = hu;
39777
- function hu(e, t, n) {
39819
+ }, hu = gu;
39820
+ function gu(e, t, n) {
39778
39821
  var r = null, i = null, a = function() {
39779
39822
  r &&= (clearTimeout(r), i = null, null);
39780
39823
  }, o = function() {
@@ -39796,15 +39839,14 @@ function hu(e, t, n) {
39796
39839
  }
39797
39840
  //#endregion
39798
39841
  //#region src/MCMap.ts
39799
- var gu = class extends l.Evented {
39842
+ var _u = class extends l.Evented {
39800
39843
  map;
39801
- jobObject;
39802
39844
  cameraCurve;
39803
39845
  duration;
39804
39846
  playhead;
39805
39847
  playbackContext;
39806
39848
  constructor(e, t) {
39807
- super(), this.map = e, this.jobObject = t, this.playhead = 0, this.playbackContext = void 0;
39849
+ super(), this.map = e, this.playhead = 0, this.playbackContext = void 0;
39808
39850
  let n = (t.video?.keyframes ?? []).map((e) => {
39809
39851
  let { x: t, y: n } = l.MercatorCoordinate.fromLngLat(e.center);
39810
39852
  return {
@@ -39815,7 +39857,7 @@ var gu = class extends l.Evented {
39815
39857
  elevation: e.elevation ?? 0
39816
39858
  };
39817
39859
  });
39818
- this.duration = ql(n), this.cameraCurve = new pu(n);
39860
+ this.duration = Jl(n), this.cameraCurve = new mu(n);
39819
39861
  }
39820
39862
  on(e, t) {
39821
39863
  return super.on(e, t);
@@ -39854,8 +39896,8 @@ var gu = class extends l.Evented {
39854
39896
  this.playhead = e;
39855
39897
  let t = this.map, n = this.cameraCurve;
39856
39898
  this.prepareForPlayback();
39857
- let r = n.sample(e), i = t.getCenter(), a = t.getZoom(), o = t.getBearing(), s = t.getPitch(), c = t.getCenterElevation(), l = t.getVerticalFieldOfView(), u = t.getScale(), d = A(this.jobObject, t.getContainer());
39858
- d !== t.getScale() && t.setScale(d), r.center.lat !== i.lat || r.center.lng !== i.lng || r.zoom !== a || r.bearing !== o || r.pitch !== s || r.elevation !== c || r.fov !== l || d !== u ? (t.setVerticalFieldOfView(r.fov), t.jumpTo(r)) : t.triggerRepaint(), this.fire("play", { time: e });
39899
+ let r = n.sample(e), i = t.getCenter(), a = t.getZoom(), o = t.getBearing(), s = t.getPitch(), c = t.getCenterElevation(), l = t.getVerticalFieldOfView();
39900
+ r.center.lat !== i.lat || r.center.lng !== i.lng || r.zoom !== a || r.bearing !== o || r.pitch !== s || r.elevation !== c || r.fov !== l ? (t.setVerticalFieldOfView(r.fov), t.jumpTo(r)) : t.triggerRepaint(), this.fire("play", { time: e });
39859
39901
  }
39860
39902
  prepareForPlayback() {
39861
39903
  this.map.setCenterClampedToGround(!1), this.map.style?.stylesheet && (this.map.style.stylesheet.transition = {
@@ -39863,15 +39905,15 @@ var gu = class extends l.Evented {
39863
39905
  delay: 0
39864
39906
  }), this.restoreAfterPlayback();
39865
39907
  }
39866
- restoreAfterPlayback = mu(() => {
39908
+ restoreAfterPlayback = hu(() => {
39867
39909
  this.map.setCenterClampedToGround(!0), this.map.style?.stylesheet && (this.map.style.stylesheet.transition = void 0);
39868
39910
  }, 300);
39869
39911
  };
39870
39912
  //#endregion
39871
39913
  //#region src/initMap.ts
39872
- async function _u(e) {
39873
- let { accessToken: t, mode: n = "sdk", env: r = "production" } = e, i = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", a = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", o = typeof e.job == "string" ? await vu(e.job, a, t) : e.job;
39874
- await yu();
39914
+ async function vu(e) {
39915
+ let { accessToken: t, mode: n = "sdk", env: r = "production" } = e, i = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", a = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", o = typeof e.job == "string" ? await yu(e.job, a, t) : e.job;
39916
+ await bu();
39875
39917
  let s = new l.Map({
39876
39918
  container: e.container,
39877
39919
  attributionControl: !1,
@@ -39890,26 +39932,26 @@ async function _u(e) {
39890
39932
  "CooperativeGesturesHandler.MobileHelpText": Fi("mobileHelpText")
39891
39933
  }
39892
39934
  }), c = s.getContainer();
39893
- c.classList.add("mc-map");
39894
- let d = new Pr(s), p = new Fl(s, n), { map: { language: h, pitch: g = 0, rotation: _ = 0, center: v, hideBasemap: y, layerInfo: b = [], detailLevel: x = 0, projection: S = "mercator", terrain: C = !1, terrainExaggeration: w = 1 }, registry: T = {}, web: E, positionOffsets: D, title: O } = o, { models: k = {}, slots: j = {}, svgs: M = {} } = T;
39895
- Su(r, i, t), s.resize(), n === "app" && (document.title = O ? `${O} - Mapcreator` : "Mapcreator"), s.setPitch(g), s.setBearing(_);
39896
- let N = Math.log2(A(o, c)), P = o.map.zoom - x + N;
39897
- if (s.setZoom(P), s.setCenter(v), s.setDetailLevel(x), s.setMinZoom(x), s.addControl(new l.AttributionControl({ compact: !1 })), n === "app" && s.cooperativeGestures.enable(), nl(o, D, s, {
39935
+ c.classList.add("mc-map"), c.classList.add(`mc-mode-${n}`);
39936
+ let d = new Pr(s), p = new Il(s, n), { map: { language: h, pitch: g = 0, rotation: _ = 0, center: v, hideBasemap: y, layerInfo: b = [], detailLevel: x = 0, projection: S = "mercator", terrain: C = !1, terrainExaggeration: w = 1 }, registry: T = {}, web: E, positionOffsets: D, title: O } = o, { models: k = {}, slots: j = {}, svgs: M = {} } = T;
39937
+ Cu(r, i, t), s.resize(), n === "app" && (document.title = O ? `${O} - Mapcreator` : "Mapcreator"), s.setPitch(g), s.setBearing(_);
39938
+ let N = A(o, c), P, F;
39939
+ if (n === "video" ? (F = o.map.zoom - x, P = N) : (F = o.map.zoom - x + Math.log2(N), P = 1), s.setScale(P), s.setZoom(F), s.setCenter(v), s.setDetailLevel(x), s.setMinZoom(x), s.addControl(new l.AttributionControl({ compact: !1 })), n === "app" && s.cooperativeGestures.enable(), rl(o, D ?? $c, s, {
39898
39940
  center: v,
39899
- zoom: P,
39941
+ zoom: F,
39900
39942
  pitch: g,
39901
39943
  rotation: _
39902
- }, i, a, t), p.setJobObject(o), E) {
39944
+ }, i, a, t, P, n), p.setJobObject(o), E) {
39903
39945
  let { restrictMapMovement: e, popupPosition: t } = E;
39904
39946
  e && (s.boxZoom.disable(), s.doubleClickZoom.disable(), s.dragPan.disable(), s.dragRotate.disable(), s.keyboard.disable(), s.scrollZoom.disable(), s.touchPitch.disable(), s.touchZoomRotate.disable()), p.setParams(t, m(h, f.TWO), e, v);
39905
39947
  }
39906
- let F = await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then((e) => e.json());
39907
- return s.setStyle(null), s.setStyle(F), await s.once("style.load"), n === "app" && Cu(s.getStyle().metadata?.customCssFilePath, t), u(h, s), await hl(o.meta.layers ?? [], s, i, t, F.metadata?.styleOverride), Tu(s, d, k, j, M, i, t), u(h, s), p.setPublication(F.metadata?.publication), p.setpopupElements(), p.setHighlightManager(), s.setProjection({ type: S === "globe" ? "globe" : "mercator" }), bu(s, S), C && xu(s, i, t, w), wu(s, s.getStyle(), b, !y), new gu(s, o);
39948
+ let ee = await fetch(`${i}/styles/${o.meta.mapstyleSet}.json?access_token=${t}`).then((e) => e.json());
39949
+ return s.setStyle(null), s.setStyle(ee), await s.once("style.load"), n === "app" && wu(s.getStyle().metadata?.customCssFilePath, t), u(h, s), await gl(o.meta.layers ?? [], s, i, t, ee.metadata?.styleOverride), Eu(s, d, k, j, M, i, t), u(h, s), p.setPublication(ee.metadata?.publication), p.setpopupElements(), p.setHighlightManager(), s.setProjection({ type: S === "globe" ? "globe" : "mercator" }), xu(s, S), C && Su(s, i, t, w), Tu(s, s.getStyle(), b, !y), new _u(s, o);
39908
39950
  }
39909
- function vu(e, t, n) {
39951
+ function yu(e, t, n) {
39910
39952
  return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then((e) => e.json());
39911
39953
  }
39912
- function yu() {
39954
+ function bu() {
39913
39955
  return new Promise((e) => {
39914
39956
  let t = () => {
39915
39957
  window.innerWidth > 0 && window.innerHeight > 0 && (window.removeEventListener("resize", t), e());
@@ -39917,7 +39959,7 @@ function yu() {
39917
39959
  window.addEventListener("resize", t), t();
39918
39960
  });
39919
39961
  }
39920
- function bu(e, t) {
39962
+ function xu(e, t) {
39921
39963
  let n = e.getStyle().metadata ?? {}, r = n["mc:background-color"] ?? "#f8f8f8", i = n["mc:background-color-globe"] ?? "#000000";
39922
39964
  e.getContainer().style.backgroundColor = t === "globe" ? i : r, e.setSky(e.getStyle().sky ?? Qc), e.setLight({ position: [
39923
39965
  1.15,
@@ -39925,7 +39967,7 @@ function bu(e, t) {
39925
39967
  45
39926
39968
  ] });
39927
39969
  }
39928
- function xu(e, t, n, r) {
39970
+ function Su(e, t, n, r) {
39929
39971
  e.addSource("mc-dem", {
39930
39972
  type: "raster-dem",
39931
39973
  tiles: [`${t}/dataset/jaxa_terrainrgb/{z}/{x}/{y}?access_token=${n}`],
@@ -39937,54 +39979,54 @@ function xu(e, t, n, r) {
39937
39979
  exaggeration: r
39938
39980
  });
39939
39981
  }
39940
- function Su(e, t, n) {
39982
+ function Cu(e, t, n) {
39941
39983
  let r = `${t}/stylesheets/ff-${e === "beta" ? "b-" : ""}${n}.css?access_token=${n}`, i = document.createElement("link");
39942
39984
  i.setAttribute("rel", "stylesheet"), i.setAttribute("href", r), i.setAttribute("type", "text/css"), document.head.insertBefore(i, document.head.firstChild);
39943
39985
  }
39944
- function Cu(e, t) {
39986
+ function wu(e, t) {
39945
39987
  if (document.getElementById("custom-style")?.remove(), !e) return;
39946
39988
  let n;
39947
39989
  e.startsWith("http") ? (e = `${e}?access_token=${t}`, n = document.createElement("link"), n.setAttribute("rel", "stylesheet"), n.setAttribute("href", e.replace(/https?:/, ""))) : (n = document.createElement("style"), n.appendChild(document.createTextNode(e))), n.setAttribute("id", "custom-style"), n.setAttribute("type", "text/css"), document.head.appendChild(n);
39948
39990
  }
39949
- function wu(e, t, n, r) {
39991
+ function Tu(e, t, n, r) {
39950
39992
  for (let i of n) {
39951
39993
  let n = t.layers.find((e) => i.id === e.id || i.id.endsWith(` | ${e.id}`));
39952
39994
  n && e.setLayoutProperty(n.id, "visibility", i.visibility && r ? "visible" : "none");
39953
39995
  }
39954
39996
  }
39955
- function Tu(e, t, n, r, i, a, o) {
39997
+ function Eu(e, t, n, r, i, a, o) {
39956
39998
  let { beforeNone: s = [], beforeNames: c = [], beforeBoundaries: l = [], beforeWaters: u = [] } = r;
39957
39999
  s.forEach((r) => {
39958
- Eu(e, t, n, r, i, "mc-before-none", a, o);
40000
+ Du(e, t, n, r, i, "mc-before-none", a, o);
39959
40001
  }), c.forEach((r) => {
39960
- Eu(e, t, n, r, i, "mc-before-names", a, o);
40002
+ Du(e, t, n, r, i, "mc-before-names", a, o);
39961
40003
  }), l.forEach((r) => {
39962
- Eu(e, t, n, r, i, "mc-before-boundaries", a, o);
40004
+ Du(e, t, n, r, i, "mc-before-boundaries", a, o);
39963
40005
  }), u.forEach((r) => {
39964
- Eu(e, t, n, r, i, "mc-before-waters", a, o);
40006
+ Du(e, t, n, r, i, "mc-before-waters", a, o);
39965
40007
  });
39966
40008
  }
39967
- function Eu(e, t, n, r, i, a, o, s) {
40009
+ function Du(e, t, n, r, i, a, o, s) {
39968
40010
  if (r.type === "marker") {
39969
40011
  let o = n.marker?.find((e) => e.id === r.groupId);
39970
- o && fl(e, o, a, i, t);
40012
+ o && pl(e, o, a, i, t);
39971
40013
  } else if (r.type === "polygon") {
39972
40014
  let o = n.polygon?.find((e) => e.id === r.groupId);
39973
- o && sl(e, o, a, i, t);
40015
+ o && cl(e, o, a, i, t);
39974
40016
  } else if (r.type === "circle") {
39975
40017
  let o = n.circle?.find((e) => e.id === r.groupId);
39976
- o && ll(e, o, a, i, t);
40018
+ o && ul(e, o, a, i, t);
39977
40019
  } else if (r.type === "line") {
39978
40020
  let i = n.line?.find((e) => e.id === r.groupId);
39979
- i && Ll(e, i, a, t);
40021
+ i && Rl(e, i, a, t);
39980
40022
  } else if (r.type === "dot") {
39981
40023
  let t = n.dot?.find((e) => e.id === r.groupId);
39982
- t && Vl(e, t, a);
40024
+ t && Hl(e, t, a);
39983
40025
  } else if (r.type === "area") {
39984
40026
  let c = n.area?.find((e) => e.id === r.groupId);
39985
- c && Bl(e, c, a, i, t, o, s);
40027
+ c && Vl(e, c, a, i, t, o, s);
39986
40028
  }
39987
40029
  }
39988
40030
  //#endregion
39989
- var Du = l.setRTLTextPlugin;
39990
- export { _u as initMap, Du as setRTLTextPlugin };
40031
+ var Ou = l.setRTLTextPlugin;
40032
+ export { vu as initMap, Ou as setRTLTextPlugin };