@eox/drawtools 1.1.1 → 1.1.2

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.
@@ -4,7 +4,7 @@ var Ut = (i) => {
4
4
  };
5
5
  var ki = (i, e, t) => e in i ? vi(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
6
6
  var I = (i, e, t) => ki(i, typeof e != "symbol" ? e + "" : e, t), Yt = (i, e, t) => e.has(i) || Ut("Cannot " + t);
7
- var S = (i, e, t) => (Yt(i, e, "read from private field"), t ? t.call(i) : e.get(i)), A = (i, e, t) => e.has(i) ? Ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), P = (i, e, t, r) => (Yt(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t);
7
+ var M = (i, e, t) => (Yt(i, e, "read from private field"), t ? t.call(i) : e.get(i)), A = (i, e, t) => e.has(i) ? Ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), P = (i, e, t, r) => (Yt(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t);
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2019 Google LLC
@@ -45,7 +45,7 @@ const _i = (i) => new xi(typeof i == "string" ? i : i + "", void 0, _r), wi = (i
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: zi, defineProperty: Ci, getOwnPropertyDescriptor: Mi, getOwnPropertyNames: Si, getOwnPropertySymbols: $i, getPrototypeOf: Pi } = Object, L = globalThis, qt = L.trustedTypes, Ei = qt ? qt.emptyScript : "", De = L.reactiveElementPolyfillSupport, he = (i, e) => i, st = { toAttribute(i, e) {
48
+ const { is: zi, defineProperty: Ci, getOwnPropertyDescriptor: Si, getOwnPropertyNames: Mi, getOwnPropertySymbols: $i, getPrototypeOf: Pi } = Object, L = globalThis, qt = L.trustedTypes, Ei = qt ? qt.emptyScript : "", De = L.reactiveElementPolyfillSupport, he = (i, e) => i, st = { toAttribute(i, e) {
49
49
  switch (e) {
50
50
  case Boolean:
51
51
  i = i ? Ei : null;
@@ -89,7 +89,7 @@ class ee extends HTMLElement {
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(e, t, r) {
92
- const { get: n, set: o } = Mi(this.prototype, e) ?? { get() {
92
+ const { get: n, set: o } = Si(this.prototype, e) ?? { get() {
93
93
  return this[t];
94
94
  }, set(a) {
95
95
  this[t] = a;
@@ -112,7 +112,7 @@ class ee extends HTMLElement {
112
112
  static finalize() {
113
113
  if (this.hasOwnProperty(he("finalized"))) return;
114
114
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(he("properties"))) {
115
- const t = this.properties, r = [...Si(t), ...$i(t)];
115
+ const t = this.properties, r = [...Mi(t), ...$i(t)];
116
116
  for (const n of r) this.createProperty(n, t[n]);
117
117
  }
118
118
  const e = this[Symbol.metadata];
@@ -281,8 +281,8 @@ ee.elementStyles = [], ee.shadowRootOptions = { mode: "open" }, ee[he("elementPr
281
281
  */
282
282
  const me = globalThis, Ie = me.trustedTypes, Wt = Ie ? Ie.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, zr = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, Cr = "?" + F, Ai = `<${Cr}>`, U = document, pe = () => U.createComment(""), ge = (i) => i === null || typeof i != "object" && typeof i != "function", bt = Array.isArray, Fi = (i) => bt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Qe = `[
283
283
  \f\r]`, ue = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Zt = /-->/g, Kt = />/g, R = RegExp(`>|${Qe}(?:([^\\s"'>=/]+)(${Qe}*=${Qe}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Qt = /"/g, Mr = /^(?:script|style|textarea|title)$/i, Li = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), k = Li(1), ae = Symbol.for("lit-noChange"), x = Symbol.for("lit-nothing"), er = /* @__PURE__ */ new WeakMap(), T = U.createTreeWalker(U, 129);
285
- function Sr(i, e) {
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Qt = /"/g, Sr = /^(?:script|style|textarea|title)$/i, Li = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), k = Li(1), ae = Symbol.for("lit-noChange"), x = Symbol.for("lit-nothing"), er = /* @__PURE__ */ new WeakMap(), T = U.createTreeWalker(U, 129);
285
+ function Mr(i, e) {
286
286
  if (!bt(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
287
  return Wt !== void 0 ? Wt.createHTML(e) : e;
288
288
  }
@@ -292,11 +292,11 @@ const Gi = (i, e) => {
292
292
  for (let s = 0; s < t; s++) {
293
293
  const l = i[s];
294
294
  let c, d, u = -1, h = 0;
295
- for (; h < l.length && (a.lastIndex = h, d = a.exec(l), d !== null); ) h = a.lastIndex, a === ue ? d[1] === "!--" ? a = Zt : d[1] !== void 0 ? a = Kt : d[2] !== void 0 ? (Mr.test(d[2]) && (n = RegExp("</" + d[2], "g")), a = R) : d[3] !== void 0 && (a = R) : a === R ? d[0] === ">" ? (a = n ?? ue, u = -1) : d[1] === void 0 ? u = -2 : (u = a.lastIndex - d[2].length, c = d[1], a = d[3] === void 0 ? R : d[3] === '"' ? Qt : Dt) : a === Qt || a === Dt ? a = R : a === Zt || a === Kt ? a = ue : (a = R, n = void 0);
295
+ for (; h < l.length && (a.lastIndex = h, d = a.exec(l), d !== null); ) h = a.lastIndex, a === ue ? d[1] === "!--" ? a = Zt : d[1] !== void 0 ? a = Kt : d[2] !== void 0 ? (Sr.test(d[2]) && (n = RegExp("</" + d[2], "g")), a = R) : d[3] !== void 0 && (a = R) : a === R ? d[0] === ">" ? (a = n ?? ue, u = -1) : d[1] === void 0 ? u = -2 : (u = a.lastIndex - d[2].length, c = d[1], a = d[3] === void 0 ? R : d[3] === '"' ? Qt : Dt) : a === Qt || a === Dt ? a = R : a === Zt || a === Kt ? a = ue : (a = R, n = void 0);
296
296
  const m = a === R && i[s + 1].startsWith("/>") ? " " : "";
297
297
  o += a === ue ? l + Ai : u >= 0 ? (r.push(c), l.slice(0, u) + zr + l.slice(u) + F + m) : l + F + (u === -2 ? s : m);
298
298
  }
299
- return [Sr(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
299
+ return [Mr(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
300
300
  };
301
301
  class fe {
302
302
  constructor({ strings: e, _$litType$: t }, r) {
@@ -314,7 +314,7 @@ class fe {
314
314
  const h = d[a++], m = n.getAttribute(u).split(F), p = /([.?@])?(.*)/.exec(h);
315
315
  l.push({ type: 1, index: o, name: p[2], strings: m, ctor: p[1] === "." ? Ri : p[1] === "?" ? Ni : p[1] === "@" ? Ti : Ve }), n.removeAttribute(u);
316
316
  } else u.startsWith(F) && (l.push({ type: 6, index: o }), n.removeAttribute(u));
317
- if (Mr.test(n.tagName)) {
317
+ if (Sr.test(n.tagName)) {
318
318
  const u = n.textContent.split(F), h = u.length - 1;
319
319
  if (h > 0) {
320
320
  n.textContent = Ie ? Ie.emptyScript : "";
@@ -402,7 +402,7 @@ let Ii = class {
402
402
  }
403
403
  $(e) {
404
404
  var o;
405
- const { values: t, _$litType$: r } = e, n = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(Sr(r.h, r.h[0]), this.options)), r);
405
+ const { values: t, _$litType$: r } = e, n = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(Mr(r.h, r.h[0]), this.options)), r);
406
406
  if (((o = this._$AH) == null ? void 0 : o._$AD) === n) this._$AH.p(t);
407
407
  else {
408
408
  const a = new Ii(n, this), s = a.u(this.options);
@@ -1631,7 +1631,7 @@ class zt {
1631
1631
  return this.getPointResolutionFunc_;
1632
1632
  }
1633
1633
  }
1634
- const Se = 6378137, te = Math.PI * Se, xn = [-te, -te, te, te], _n = [-180, -85, 180, 85], Ee = Se * Math.log(Math.tan(Math.PI / 2));
1634
+ const Me = 6378137, te = Math.PI * Me, xn = [-te, -te, te, te], _n = [-180, -85, 180, 85], Ee = Me * Math.log(Math.tan(Math.PI / 2));
1635
1635
  class D extends zt {
1636
1636
  /**
1637
1637
  * @param {string} code Code.
@@ -1644,7 +1644,7 @@ class D extends zt {
1644
1644
  global: !0,
1645
1645
  worldExtent: _n,
1646
1646
  getPointResolution: function(t, r) {
1647
- return t / Math.cosh(r[1] / Se);
1647
+ return t / Math.cosh(r[1] / Me);
1648
1648
  }
1649
1649
  });
1650
1650
  }
@@ -1662,7 +1662,7 @@ function wn(i, e, t, r) {
1662
1662
  t = t > 1 ? t : 2, r = r ?? t, e === void 0 && (t > 2 ? e = i.slice() : e = new Array(n));
1663
1663
  for (let o = 0; o < n; o += r) {
1664
1664
  e[o] = te * i[o] / 180;
1665
- let a = Se * Math.log(Math.tan(Math.PI * (+i[o + 1] + 90) / 360));
1665
+ let a = Me * Math.log(Math.tan(Math.PI * (+i[o + 1] + 90) / 360));
1666
1666
  a > Ee ? a = Ee : a < -Ee && (a = -Ee), e[o + 1] = a;
1667
1667
  }
1668
1668
  return e;
@@ -1671,10 +1671,10 @@ function zn(i, e, t, r) {
1671
1671
  const n = i.length;
1672
1672
  t = t > 1 ? t : 2, r = r ?? t, e === void 0 && (t > 2 ? e = i.slice() : e = new Array(n));
1673
1673
  for (let o = 0; o < n; o += r)
1674
- e[o] = 180 * i[o] / te, e[o + 1] = 360 * Math.atan(Math.exp(i[o + 1] / Se)) / Math.PI - 90;
1674
+ e[o] = 180 * i[o] / te, e[o + 1] = 360 * Math.atan(Math.exp(i[o + 1] / Me)) / Math.PI - 90;
1675
1675
  return e;
1676
1676
  }
1677
- const Cn = 6378137, cr = [-180, -90, 180, 90], Mn = Math.PI * Cn / 180;
1677
+ const Cn = 6378137, cr = [-180, -90, 180, 90], Sn = Math.PI * Cn / 180;
1678
1678
  class N extends zt {
1679
1679
  /**
1680
1680
  * @param {string} code Code.
@@ -1687,7 +1687,7 @@ class N extends zt {
1687
1687
  extent: cr,
1688
1688
  axisOrientation: t,
1689
1689
  global: !0,
1690
- metersPerUnit: Mn,
1690
+ metersPerUnit: Sn,
1691
1691
  worldExtent: cr
1692
1692
  });
1693
1693
  }
@@ -1702,7 +1702,7 @@ const dr = [
1702
1702
  new N("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
1703
1703
  ];
1704
1704
  let ct = {};
1705
- function Sn(i) {
1705
+ function Mn(i) {
1706
1706
  return ct[i] || ct[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
1707
1707
  }
1708
1708
  function $n(i, e) {
@@ -1716,9 +1716,9 @@ function ye(i, e, t) {
1716
1716
  function rt(i, e) {
1717
1717
  return i in re && e in re[i] ? re[i][e] : null;
1718
1718
  }
1719
- const Te = 0.9996, M = 669438e-8, Xe = M * M, Be = Xe * M, O = M / (1 - M), ur = Math.sqrt(1 - M), ce = (1 - ur) / (1 + ur), Hr = ce * ce, Ct = Hr * ce, Mt = Ct * ce, jr = Mt * ce, Vr = 1 - M / 4 - 3 * Xe / 64 - 5 * Be / 256, Pn = 3 * M / 8 + 3 * Xe / 32 + 45 * Be / 1024, En = 15 * Xe / 256 + 45 * Be / 1024, An = 35 * Be / 3072, Fn = 3 / 2 * ce - 27 / 32 * Ct + 269 / 512 * jr, Ln = 21 / 16 * Hr - 55 / 32 * Mt, Gn = 151 / 96 * Ct - 417 / 128 * jr, In = 1097 / 512 * Mt, Oe = 6378137;
1719
+ const Te = 0.9996, S = 669438e-8, Xe = S * S, Be = Xe * S, O = S / (1 - S), ur = Math.sqrt(1 - S), ce = (1 - ur) / (1 + ur), Hr = ce * ce, Ct = Hr * ce, St = Ct * ce, jr = St * ce, Vr = 1 - S / 4 - 3 * Xe / 64 - 5 * Be / 256, Pn = 3 * S / 8 + 3 * Xe / 32 + 45 * Be / 1024, En = 15 * Xe / 256 + 45 * Be / 1024, An = 35 * Be / 3072, Fn = 3 / 2 * ce - 27 / 32 * Ct + 269 / 512 * jr, Ln = 21 / 16 * Hr - 55 / 32 * St, Gn = 151 / 96 * Ct - 417 / 128 * jr, In = 1097 / 512 * St, Oe = 6378137;
1720
1720
  function Rn(i, e, t) {
1721
- const r = i - 5e5, a = (t.north ? e : e - 1e7) / Te / (Oe * Vr), s = a + Fn * Math.sin(2 * a) + Ln * Math.sin(4 * a) + Gn * Math.sin(6 * a) + In * Math.sin(8 * a), l = Math.sin(s), c = l * l, d = Math.cos(s), u = l / d, h = u * u, m = h * h, p = 1 - M * c, g = Math.sqrt(1 - M * c), f = Oe / g, _ = (1 - M) / p, v = O * d ** 2, $ = v * v, z = r / (f * Te), G = z * z, de = G * z, jt = de * z, Vt = jt * z, bi = Vt * z, yi = s - u / _ * (G / 2 - jt / 24 * (5 + 3 * h + 10 * v - 4 * $ - 9 * O)) + bi / 720 * (61 + 90 * h + 298 * v + 45 * m - 252 * O - 3 * $);
1721
+ const r = i - 5e5, a = (t.north ? e : e - 1e7) / Te / (Oe * Vr), s = a + Fn * Math.sin(2 * a) + Ln * Math.sin(4 * a) + Gn * Math.sin(6 * a) + In * Math.sin(8 * a), l = Math.sin(s), c = l * l, d = Math.cos(s), u = l / d, h = u * u, m = h * h, p = 1 - S * c, g = Math.sqrt(1 - S * c), f = Oe / g, _ = (1 - S) / p, v = O * d ** 2, $ = v * v, z = r / (f * Te), G = z * z, de = G * z, jt = de * z, Vt = jt * z, bi = Vt * z, yi = s - u / _ * (G / 2 - jt / 24 * (5 + 3 * h + 10 * v - 4 * $ - 9 * O)) + bi / 720 * (61 + 90 * h + 298 * v + 45 * m - 252 * O - 3 * $);
1722
1722
  let Ke = (z - de / 6 * (1 + 2 * h + v) + Vt / 120 * (5 - 2 * v + 28 * h - 3 * $ + 8 * O + 24 * m)) / d;
1723
1723
  return Ke = lt(
1724
1724
  Ke + Ge(Ur(t.number)),
@@ -1729,7 +1729,7 @@ function Rn(i, e, t) {
1729
1729
  const hr = -80, mr = 84, Nn = -180, Tn = 180;
1730
1730
  function On(i, e, t) {
1731
1731
  i = lt(i, Nn, Tn), e < hr ? e = hr : e > mr && (e = mr);
1732
- const r = Ge(e), n = Math.sin(r), o = Math.cos(r), a = n / o, s = a * a, l = s * s, c = Ge(i), d = Ur(t.number), u = Ge(d), h = Oe / Math.sqrt(1 - M * n ** 2), m = O * o ** 2, p = o * lt(c - u, -Math.PI, Math.PI), g = p * p, f = g * p, _ = f * p, v = _ * p, $ = v * p, z = Oe * (Vr * r - Pn * Math.sin(2 * r) + En * Math.sin(4 * r) - An * Math.sin(6 * r)), G = Te * h * (p + f / 6 * (1 - s + m) + v / 120 * (5 - 18 * s + l + 72 * m - 58 * O)) + 5e5;
1732
+ const r = Ge(e), n = Math.sin(r), o = Math.cos(r), a = n / o, s = a * a, l = s * s, c = Ge(i), d = Ur(t.number), u = Ge(d), h = Oe / Math.sqrt(1 - S * n ** 2), m = O * o ** 2, p = o * lt(c - u, -Math.PI, Math.PI), g = p * p, f = g * p, _ = f * p, v = _ * p, $ = v * p, z = Oe * (Vr * r - Pn * Math.sin(2 * r) + En * Math.sin(4 * r) - An * Math.sin(6 * r)), G = Te * h * (p + f / 6 * (1 - s + m) + v / 120 * (5 - 18 * s + l + 72 * m - 58 * O)) + 5e5;
1733
1733
  let de = Te * (z + h * a * (g / 2 + _ / 24 * (5 - s + 9 * m + 4 * m ** 2) + $ / 720 * (61 - 58 * s + l + 600 * m - 330 * O)));
1734
1734
  return t.north || (de += 1e7), [G, de];
1735
1735
  }
@@ -1777,7 +1777,7 @@ function Vn(i) {
1777
1777
  } : null;
1778
1778
  }
1779
1779
  const Un = [Vn], Yn = [jn];
1780
- function St(i, e) {
1780
+ function Mt(i, e) {
1781
1781
  if (e !== void 0) {
1782
1782
  for (let t = 0, r = i.length; t < r; ++t)
1783
1783
  e[t] = i[t];
@@ -1787,7 +1787,7 @@ function St(i, e) {
1787
1787
  return e;
1788
1788
  }
1789
1789
  function dt(i) {
1790
- $n(i.getCode(), i), ye(i, i, St);
1790
+ $n(i.getCode(), i), ye(i, i, Mt);
1791
1791
  }
1792
1792
  function Xn(i) {
1793
1793
  i.forEach(dt);
@@ -1795,7 +1795,7 @@ function Xn(i) {
1795
1795
  function C(i) {
1796
1796
  if (typeof i != "string")
1797
1797
  return i;
1798
- const e = Sn(i);
1798
+ const e = Mn(i);
1799
1799
  if (e)
1800
1800
  return e;
1801
1801
  for (const t of Yn) {
@@ -1808,7 +1808,7 @@ function C(i) {
1808
1808
  function gr(i) {
1809
1809
  Xn(i), i.forEach(function(e) {
1810
1810
  i.forEach(function(t) {
1811
- e !== t && ye(e, t, St);
1811
+ e !== t && ye(e, t, Mt);
1812
1812
  });
1813
1813
  });
1814
1814
  }
@@ -1823,7 +1823,7 @@ function qn(i, e) {
1823
1823
  if (i === e)
1824
1824
  return !0;
1825
1825
  const t = i.getUnits() === e.getUnits();
1826
- return (i.getCode() === e.getCode() || Xr(i, e) === St) && t;
1826
+ return (i.getCode() === e.getCode() || Xr(i, e) === Mt) && t;
1827
1827
  }
1828
1828
  function Xr(i, e) {
1829
1829
  const t = i.getCode(), r = e.getCode();
@@ -5664,7 +5664,7 @@ function Ot(i, e) {
5664
5664
  break;
5665
5665
  }
5666
5666
  case "Polygon": {
5667
- t = So(
5667
+ t = Mo(
5668
5668
  /** @type {GeoJSONPolygon} */
5669
5669
  i
5670
5670
  );
@@ -5685,7 +5685,7 @@ function Ot(i, e) {
5685
5685
  break;
5686
5686
  }
5687
5687
  case "MultiPolygon": {
5688
- t = Mo(
5688
+ t = So(
5689
5689
  /** @type {GeoJSONMultiPolygon} */
5690
5690
  i
5691
5691
  );
@@ -5755,7 +5755,7 @@ function Co(i) {
5755
5755
  layout: K(((t = e[0]) == null ? void 0 : t.length) || 2)
5756
5756
  };
5757
5757
  }
5758
- function Mo(i) {
5758
+ function So(i) {
5759
5759
  var o, a;
5760
5760
  const e = i.coordinates, t = [], r = ((a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a[0].length) || 2, n = Zr(
5761
5761
  t,
@@ -5770,7 +5770,7 @@ function Mo(i) {
5770
5770
  layout: K(r)
5771
5771
  };
5772
5772
  }
5773
- function So(i) {
5773
+ function Mo(i) {
5774
5774
  var o, a;
5775
5775
  const e = i.coordinates, t = [], r = (a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a.length, n = $e(t, 0, e, r);
5776
5776
  return {
@@ -6761,7 +6761,7 @@ class mi extends j {
6761
6761
  data-cy="drawBtn"
6762
6762
  class="transparent square primary-text no-margin small"
6763
6763
  title="${this.unstyled ? this.select ? "Select" : "Draw" : ""}"
6764
- ?disabled="${S(this, we) || x}"
6764
+ ?disabled="${M(this, we) || x}"
6765
6765
  @click="${() => this.drawFunc.start()}"
6766
6766
  >
6767
6767
  ${this.unstyled ? t : k`
@@ -6779,7 +6779,7 @@ class mi extends j {
6779
6779
  data-cy="discardBtn"
6780
6780
  class="transparent square error-text no-margin small"
6781
6781
  title="${this.unstyled ? "Discard" : ""}"
6782
- ?disabled="${S(this, ze) || x}"
6782
+ ?disabled="${M(this, ze) || x}"
6783
6783
  @click="${() => this.drawFunc.discard()}"
6784
6784
  >
6785
6785
  ${this.unstyled ? "discard" : k`
@@ -6920,8 +6920,19 @@ const pi = '@import"https://eox.at/fonts/inter/inter.css";@import"https://eox.at
6920
6920
  }
6921
6921
  }, Ko = (i) => {
6922
6922
  let e;
6923
- return typeof i == "string" ? e = /** @type {HTMLElement} */
6924
- document.querySelector(i) : e = i, e;
6923
+ if (typeof i == "string") {
6924
+ const t = (r) => (
6925
+ /** @type {HTMLElement} */
6926
+ r.querySelector(i)
6927
+ );
6928
+ if (e = t(document), !e) {
6929
+ const r = document.querySelectorAll("html *");
6930
+ for (let n = 0; n < r.length && !(r[n].shadowRoot && (e = t(r[n].shadowRoot), e)); n++)
6931
+ ;
6932
+ }
6933
+ } else
6934
+ e = i;
6935
+ return e;
6925
6936
  };
6926
6937
  Zo();
6927
6938
  const Do = `
@@ -7190,7 +7201,7 @@ function sa(i, e) {
7190
7201
  typeof t.result == "string" && e.handleFeatureChange(t.result);
7191
7202
  };
7192
7203
  }
7193
- var ie, ne, Ce, oe, Me;
7204
+ var ie, ne, Ce, oe, Se;
7194
7205
  class la extends j {
7195
7206
  constructor() {
7196
7207
  super();
@@ -7213,7 +7224,7 @@ class la extends j {
7213
7224
  /**
7214
7225
  * @type boolean
7215
7226
  */
7216
- A(this, Me);
7227
+ A(this, Se);
7217
7228
  this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.layerId = "", this.drawnFeatures = [], this.featureName = "Feature", this.featureNameKey = null, this.featureStyles = null, this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.projection = "EPSG:4326", this.type = "Polygon", this.selectionEvents = null, this.format = "feature", this.unstyled = !1, this.noShadow = !1;
7218
7229
  }
7219
7230
  // Define properties with defaults and types
@@ -7248,20 +7259,20 @@ class la extends j {
7248
7259
  * @type {boolean}
7249
7260
  */
7250
7261
  set continuous(t) {
7251
- P(this, Me, t), t && (this.multipleFeatures = !0);
7262
+ P(this, Se, t), t && (this.multipleFeatures = !0);
7252
7263
  }
7253
7264
  get continuous() {
7254
- return S(this, Me);
7265
+ return M(this, Se);
7255
7266
  }
7256
7267
  /**
7257
7268
  * Enables selection mode for the passed layer
7258
7269
  * @type {string}
7259
7270
  */
7260
7271
  set layerId(t) {
7261
- na(this, this.eoxMap, t, S(this, oe)), P(this, oe, t);
7272
+ na(this, this.eoxMap, t, M(this, oe)), P(this, oe, t);
7262
7273
  }
7263
7274
  get layerId() {
7264
- return S(this, oe);
7275
+ return M(this, oe);
7265
7276
  }
7266
7277
  /**
7267
7278
  * @onClick Event handler triggered to start drawing on the map.
@@ -7345,10 +7356,10 @@ class la extends j {
7345
7356
  }
7346
7357
  }
7347
7358
  get eoxMap() {
7348
- return S(this, ie);
7359
+ return M(this, ie);
7349
7360
  }
7350
7361
  set eoxMap(t) {
7351
- const r = S(this, ie);
7362
+ const r = M(this, ie);
7352
7363
  P(this, ie, t), this.requestUpdate("eoxMap", r);
7353
7364
  }
7354
7365
  connectedCallback() {
@@ -7391,7 +7402,7 @@ class la extends j {
7391
7402
  .multipleFeatures=${this.multipleFeatures}
7392
7403
  .importFeatures=${this.importFeatures}
7393
7404
  .showEditor=${this.showEditor}
7394
- .geoJSON=${S(this, Ce)}
7405
+ .geoJSON=${M(this, Ce)}
7395
7406
  .type=${this.type}
7396
7407
  ></eox-drawtools-controller>
7397
7408
 
@@ -7399,7 +7410,7 @@ class la extends j {
7399
7410
  ${this.showList && ((t = this.drawnFeatures) != null && t.length) ? k`<eox-drawtools-list
7400
7411
  .eoxDrawTools=${this}
7401
7412
  .eoxMap=${this.eoxMap}
7402
- .olMap=${S(this, ne)}
7413
+ .olMap=${M(this, ne)}
7403
7414
  .draw=${this.draw}
7404
7415
  .drawLayer=${this.drawLayer}
7405
7416
  .drawnFeatures=${this.drawnFeatures}
@@ -7414,7 +7425,7 @@ class la extends j {
7414
7425
  `;
7415
7426
  }
7416
7427
  }
7417
- ie = new WeakMap(), ne = new WeakMap(), Ce = new WeakMap(), oe = new WeakMap(), Me = new WeakMap();
7428
+ ie = new WeakMap(), ne = new WeakMap(), Ce = new WeakMap(), oe = new WeakMap(), Se = new WeakMap();
7418
7429
  customElements.define("eox-drawtools", la);
7419
7430
  export {
7420
7431
  la as EOxDrawTools
@@ -1,12 +1,12 @@
1
- (function(x,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(x=typeof globalThis<"u"?globalThis:x||self,v(x["eox-drawtools"]={}))})(this,function(x){"use strict";var la=Object.defineProperty;var fi=x=>{throw TypeError(x)};var ca=(x,v,z)=>v in x?la(x,v,{enumerable:!0,configurable:!0,writable:!0,value:z}):x[v]=z;var ee=(x,v,z)=>ca(x,typeof v!="symbol"?v+"":v,z),bi=(x,v,z)=>v.has(x)||fi("Cannot "+z);var E=(x,v,z)=>(bi(x,v,"read from private field"),z?z.call(x):v.get(x)),R=(x,v,z)=>v.has(x)?fi("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(x):v.set(x,z),L=(x,v,z,me)=>(bi(x,v,"write to private field"),me?me.call(x,z):v.set(x,z),z);/**
1
+ (function(k,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(k=typeof globalThis<"u"?globalThis:k||self,v(k["eox-drawtools"]={}))})(this,function(k){"use strict";var la=Object.defineProperty;var fi=k=>{throw TypeError(k)};var ca=(k,v,z)=>v in k?la(k,v,{enumerable:!0,configurable:!0,writable:!0,value:z}):k[v]=z;var ee=(k,v,z)=>ca(k,typeof v!="symbol"?v+"":v,z),bi=(k,v,z)=>v.has(k)||fi("Cannot "+z);var E=(k,v,z)=>(bi(k,v,"read from private field"),z?z.call(k):v.get(k)),R=(k,v,z)=>v.has(k)?fi("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(k):v.set(k,z),L=(k,v,z,me)=>(bi(k,v,"write to private field"),me?me.call(k,z):v.set(k,z),z);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var mi,$e,Ee,de,ue,Ae,he,Fe;const v=globalThis,z=v.ShadowRoot&&(v.ShadyCSS===void 0||v.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,me=Symbol(),Ut=new WeakMap;let vi=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==me)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(z&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Ut.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Ut.set(t,e))}return e}toString(){return this.cssText}};const xi=i=>new vi(typeof i=="string"?i:i+"",void 0,me),ki=(i,e)=>{if(z)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=v.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Yt=z?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return xi(t)})(i):i;/**
5
+ */var mi,$e,Ee,de,ue,Ae,he,Fe;const v=globalThis,z=v.ShadowRoot&&(v.ShadyCSS===void 0||v.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,me=Symbol(),Ut=new WeakMap;let vi=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==me)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(z&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Ut.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Ut.set(t,e))}return e}toString(){return this.cssText}};const ki=i=>new vi(typeof i=="string"?i:i+"",void 0,me),xi=(i,e)=>{if(z)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=v.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Yt=z?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return ki(t)})(i):i;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:_i,defineProperty:wi,getOwnPropertyDescriptor:zi,getOwnPropertyNames:Ci,getOwnPropertySymbols:Si,getPrototypeOf:Mi}=Object,G=globalThis,Xt=G.trustedTypes,Pi=Xt?Xt.emptyScript:"",et=G.reactiveElementPolyfillSupport,pe=(i,e)=>i,tt={toAttribute(i,e){switch(e){case Boolean:i=i?Pi:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Bt=(i,e)=>!_i(i,e),qt={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:Bt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);class te extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=qt){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&wi(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:o}=zi(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get(){return n==null?void 0:n.call(this)},set(a){const s=n==null?void 0:n.call(this);o.call(this,a),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??qt}static _$Ei(){if(this.hasOwnProperty(pe("elementProperties")))return;const e=Mi(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(pe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(pe("properties"))){const t=this.properties,r=[...Ci(t),...Si(t)];for(const n of r)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const n of r)t.unshift(Yt(n))}else e!==void 0&&t.push(Yt(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ki(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var o;const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){const a=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:tt).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(e,t){var o;const r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const a=r.getPropertyOptions(n),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:tt;this._$Em=n,this[n]=s.fromAttribute(t,a.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??Bt)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,a]of n)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EU()}catch(n){throw e=!1,this._$EU(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}te.elementStyles=[],te.shadowRootOptions={mode:"open"},te[pe("elementProperties")]=new Map,te[pe("finalized")]=new Map,et==null||et({ReactiveElement:te}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:_i,defineProperty:wi,getOwnPropertyDescriptor:zi,getOwnPropertyNames:Ci,getOwnPropertySymbols:Si,getPrototypeOf:Mi}=Object,G=globalThis,Xt=G.trustedTypes,Pi=Xt?Xt.emptyScript:"",et=G.reactiveElementPolyfillSupport,pe=(i,e)=>i,tt={toAttribute(i,e){switch(e){case Boolean:i=i?Pi:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Bt=(i,e)=>!_i(i,e),qt={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:Bt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);class te extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=qt){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&wi(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:o}=zi(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get(){return n==null?void 0:n.call(this)},set(a){const s=n==null?void 0:n.call(this);o.call(this,a),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??qt}static _$Ei(){if(this.hasOwnProperty(pe("elementProperties")))return;const e=Mi(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(pe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(pe("properties"))){const t=this.properties,r=[...Ci(t),...Si(t)];for(const n of r)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const n of r)t.unshift(Yt(n))}else e!==void 0&&t.push(Yt(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xi(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var o;const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){const a=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:tt).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(e,t){var o;const r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const a=r.getPropertyOptions(n),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:tt;this._$Em=n,this[n]=s.fromAttribute(t,a.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??Bt)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,a]of n)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EU()}catch(n){throw e=!1,this._$EU(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}te.elementStyles=[],te.shadowRootOptions={mode:"open"},te[pe("elementProperties")]=new Map,te[pe("finalized")]=new Map,et==null||et({ReactiveElement:te}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
@@ -59,7 +59,7 @@
59
59
  </li>
60
60
  `)})}
61
61
  </ul>
62
- `}}ee(ar,"properties",{eoxDrawTools:{attribute:!1,state:!0},eoxMap:{attribute:!1,state:!0},olMap:{attribute:!1,state:!0},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},featureName:{attribute:!1,state:!0,type:String},featureNameKey:{attribute:!1,state:!0,type:String},modify:{attribute:!1,state:!0},unstyled:{type:Boolean}}),customElements.define("eox-drawtools-list",ar);const Ji=i=>{const{multipleFeatures:e,drawnFeatures:t,currentlyDrawing:r}=i,n=!e&&(t==null?void 0:t.length)>0||r,o=!(t!=null&&t.length)&&!r;return{drawDisabled:n,discardDisabled:o}};function Wi(i){navigator.clipboard.writeText(i).then(function(){},function(e){console.error("Could not copy text: ",e)})}const Zi={PROPERTYCHANGE:"propertychange"},st={CHANGE:"change"};class Ki{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Di(i,e,t){let r,n;t=t||sr;let o=0,a=i.length,s=!1;for(;o<a;)r=o+(a-o>>1),n=+t(i[r],e),n<0?o=r+1:(a=r,s=!n);return s?o:~o}function sr(i,e){return i>e?1:i<e?-1:0}function A(i,e){const t=Array.isArray(e)?e:[e],r=t.length;for(let n=0;n<r;n++)i[i.length]=t[n]}function Qi(i,e){const t=i.length;if(t!==e.length)return!1;for(let r=0;r<t;r++)if(i[r]!==e[r])return!1;return!0}function lr(){}function cr(i){let e,t,r;return function(){const n=Array.prototype.slice.call(arguments);return(!t||this!==r||!Qi(n,t))&&(r=this,t=n,e=i.apply(this,arguments)),e}}function dr(i){for(const e in i)delete i[e]}function ur(i){let e;for(e in i)return!1;return!e}class hr{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class en extends Ki{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const r=this.listeners_||(this.listeners_={}),n=r[e]||(r[e]=[]);n.includes(t)||n.push(t)}dispatchEvent(e){const t=typeof e=="string",r=t?e:e.type,n=this.listeners_&&this.listeners_[r];if(!n)return;const o=t?new hr(e):e;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,s[r]=0),++a[r];let l;for(let c=0,d=n.length;c<d;++c)if("handleEvent"in n[c]?l=n[c].handleEvent(o):l=n[c].call(this,o),l===!1||o.propagationStopped){l=!1;break}if(--a[r]===0){let c=s[r];for(delete s[r];c--;)this.removeEventListener(r,lr);delete a[r]}return l}disposeInternal(){this.listeners_&&dr(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const n=r.indexOf(t);n!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[n]=lr,++this.pendingRemovals_[e]):(r.splice(n,1),r.length===0&&delete this.listeners_[e]))}}function xe(i,e,t,r,n){if(n){const a=t;t=function(s){return i.removeEventListener(e,t),a.call(r??this,s)}}else r&&r!==i&&(t=t.bind(r));const o={target:i,type:e,listener:t};return i.addEventListener(e,t),o}function mr(i,e,t,r){return xe(i,e,t,r,!0)}function Re(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),dr(i))}class Ne extends en{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(st.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const r=e.length,n=new Array(r);for(let o=0;o<r;++o)n[o]=xe(this,e[o],t);return n}return xe(this,e,t)}onceInternal(e,t){let r;if(Array.isArray(e)){const n=e.length;r=new Array(n);for(let o=0;o<n;++o)r[o]=mr(this,e[o],t)}else r=mr(this,e,t);return t.ol_key=r,r}unInternal(e,t){const r=t.ol_key;if(r)tn(r);else if(Array.isArray(e))for(let n=0,o=e.length;n<o;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}}Ne.prototype.on,Ne.prototype.once,Ne.prototype.un;function tn(i){if(Array.isArray(i))for(let e=0,t=i.length;e<t;++e)Re(i[e]);else Re(i)}function f(){throw new Error("Unimplemented abstract method.")}let rn=0;function nn(i){return i.ol_uid||(i.ol_uid=String(++rn))}class pr extends hr{constructor(e,t,r){super(e),this.key=t,this.oldValue=r}}class gr extends Ne{constructor(e){super(),this.on,this.once,this.un,nn(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new pr(r,e,t)),r=Zi.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new pr(r,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,r){const n=this.values_||(this.values_={});if(r)n[e]=t;else{const o=n[e];n[e]=t,o!==t&&this.notify(e,o)}}setProperties(e,t){for(const r in e)this.set(r,e[r],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],ur(this.values_)&&(this.values_=null),t||this.notify(e,r)}}}function on(i,e){if(!i)throw new Error(e)}class ne extends gr{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new ne(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Re(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=xe(e,st.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?an(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function an(i){if(typeof i=="function")return i;let e;return Array.isArray(i)?e=i:(on(typeof i.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[i]),function(){return e}}const C={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function j(i,e,t){let r,n;return e<i[0]?r=i[0]-e:i[2]<e?r=e-i[2]:r=0,t<i[1]?n=i[1]-t:i[3]<t?n=t-i[3]:n=0,r*r+n*n}function fr(i,e,t){return i[0]<=e&&e<=i[2]&&i[1]<=t&&t<=i[3]}function br(i,e){const t=i[0],r=i[1],n=i[2],o=i[3],a=e[0],s=e[1];let l=C.UNKNOWN;return a<t?l=l|C.LEFT:a>n&&(l=l|C.RIGHT),s<r?l=l|C.BELOW:s>o&&(l=l|C.ABOVE),l===C.UNKNOWN&&(l=C.INTERSECTING),l}function lt(){return[1/0,1/0,-1/0,-1/0]}function yr(i,e,t,r,n){return n?(n[0]=i,n[1]=e,n[2]=t,n[3]=r,n):[i,e,t,r]}function ct(i){return yr(1/0,1/0,-1/0,-1/0,i)}function vr(i,e){const t=i[0],r=i[1];return yr(t,r,t,r,e)}function dt(i,e,t,r,n){const o=ct(n);return xr(o,i,e,t,r)}function sn(i,e){return e[0]<i[0]&&(i[0]=e[0]),e[2]>i[2]&&(i[2]=e[2]),e[1]<i[1]&&(i[1]=e[1]),e[3]>i[3]&&(i[3]=e[3]),i}function xr(i,e,t,r,n){for(;t<r;t+=n)ln(i,e[t],e[t+1]);return i}function ln(i,e,t){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}function cn(i,e){let t;return t=e(dn(i)),t||(t=e(un(i)),t)||(t=e(mn(i)),t)||(t=e(hn(i)),t)?t:!1}function dn(i){return[i[0],i[1]]}function un(i){return[i[2],i[1]]}function Te(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Oe(i){return i[3]-i[1]}function hn(i){return[i[0],i[3]]}function mn(i){return[i[2],i[3]]}function pn(i,e){return i[0]<=e[2]&&i[2]>=e[0]&&i[1]<=e[3]&&i[3]>=e[1]}function gn(i,e){return e?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e):i}function fn(i,e,t){let r=!1;const n=br(i,e),o=br(i,t);if(n===C.INTERSECTING||o===C.INTERSECTING)r=!0;else{const a=i[0],s=i[1],l=i[2],c=i[3],d=e[0],u=e[1],h=t[0],m=t[1],p=(m-u)/(h-d);let g,b;o&C.ABOVE&&!(n&C.ABOVE)&&(g=h-(m-c)/p,r=g>=a&&g<=l),!r&&o&C.RIGHT&&!(n&C.RIGHT)&&(b=m-(h-l)*p,r=b>=s&&b<=c),!r&&o&C.BELOW&&!(n&C.BELOW)&&(g=h-(m-s)/p,r=g>=a&&g<=l),!r&&o&C.LEFT&&!(n&C.LEFT)&&(b=m-(h-a)*p,r=b>=s&&b<=c)}return r}function bn(i,e,t,r,n,o){const a=n-t,s=o-r;if(a!==0||s!==0){const l=((i-t)*a+(e-r)*s)/(a*a+s*s);l>1?(t=n,r=o):l>0&&(t+=a*l,r+=s*l)}return V(i,e,t,r)}function V(i,e,t,r){const n=t-i,o=r-e;return n*n+o*o}function kr(i){return i*180/Math.PI}function He(i){return i*Math.PI/180}function ut(i,e,t){return i+t*(e-i)}function ht(i,e,t){if(i>=e&&i<t)return i;const r=t-e;return((i-e)%r+r)%r+e}const yn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class mt{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||yn[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ke=6378137,oe=Math.PI*ke,vn=[-oe,-oe,oe,oe],xn=[-180,-85,180,85],je=ke*Math.log(Math.tan(Math.PI/2));class ae extends mt{constructor(e){super({code:e,units:"m",extent:vn,global:!0,worldExtent:xn,getPointResolution:function(t,r){return t/Math.cosh(r[1]/ke)}})}}const _r=[new ae("EPSG:3857"),new ae("EPSG:102100"),new ae("EPSG:102113"),new ae("EPSG:900913"),new ae("http://www.opengis.net/def/crs/EPSG/0/3857"),new ae("http://www.opengis.net/gml/srs/epsg.xml#3857")];function kn(i,e,t,r){const n=i.length;t=t>1?t:2,r=r??t,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let o=0;o<n;o+=r){e[o]=oe*i[o]/180;let a=ke*Math.log(Math.tan(Math.PI*(+i[o+1]+90)/360));a>je?a=je:a<-je&&(a=-je),e[o+1]=a}return e}function _n(i,e,t,r){const n=i.length;t=t>1?t:2,r=r??t,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let o=0;o<n;o+=r)e[o]=180*i[o]/oe,e[o+1]=360*Math.atan(Math.exp(i[o+1]/ke))/Math.PI-90;return e}const wn=6378137,wr=[-180,-90,180,90],zn=Math.PI*wn/180;class U extends mt{constructor(e,t){super({code:e,units:"degrees",extent:wr,axisOrientation:t,global:!0,metersPerUnit:zn,worldExtent:wr})}}const zr=[new U("CRS:84"),new U("EPSG:4326","neu"),new U("urn:ogc:def:crs:OGC:1.3:CRS84"),new U("urn:ogc:def:crs:OGC:2:84"),new U("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new U("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new U("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let pt={};function Cn(i){return pt[i]||pt[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Sn(i,e){pt[i]=e}let se={};function _e(i,e,t){const r=i.getCode(),n=e.getCode();r in se||(se[r]={}),se[r][n]=t}function gt(i,e){return i in se&&e in se[i]?se[i][e]:null}const Ve=.9996,P=.00669438,Ue=P*P,Ye=Ue*P,Y=P/(1-P),Cr=Math.sqrt(1-P),le=(1-Cr)/(1+Cr),Sr=le*le,ft=Sr*le,bt=ft*le,Mr=bt*le,Pr=1-P/4-3*Ue/64-5*Ye/256,Mn=3*P/8+3*Ue/32+45*Ye/1024,Pn=15*Ue/256+45*Ye/1024,$n=35*Ye/3072,En=3/2*le-27/32*ft+269/512*Mr,An=21/16*Sr-55/32*bt,Fn=151/96*ft-417/128*Mr,Ln=1097/512*bt,Xe=6378137;function Gn(i,e,t){const r=i-5e5,a=(t.north?e:e-1e7)/Ve/(Xe*Pr),s=a+En*Math.sin(2*a)+An*Math.sin(4*a)+Fn*Math.sin(6*a)+Ln*Math.sin(8*a),l=Math.sin(s),c=l*l,d=Math.cos(s),u=l/d,h=u*u,m=h*h,p=1-P*c,g=Math.sqrt(1-P*c),b=Xe/g,S=(1-P)/p,k=Y*d**2,F=k*k,M=r/(b*Ve),Q=M*M,Le=Q*M,pi=Le*M,gi=pi*M,aa=gi*M,sa=s-u/S*(Q/2-pi/24*(5+3*h+10*k-4*F-9*Y))+aa/720*(61+90*h+298*k+45*m-252*Y-3*F);let Vt=(M-Le/6*(1+2*h+k)+gi/120*(5-2*k+28*h-3*F+8*Y+24*m))/d;return Vt=ht(Vt+He(Ar(t.number)),-Math.PI,Math.PI),[kr(Vt),kr(sa)]}const $r=-80,Er=84,In=-180,Rn=180;function Nn(i,e,t){i=ht(i,In,Rn),e<$r?e=$r:e>Er&&(e=Er);const r=He(e),n=Math.sin(r),o=Math.cos(r),a=n/o,s=a*a,l=s*s,c=He(i),d=Ar(t.number),u=He(d),h=Xe/Math.sqrt(1-P*n**2),m=Y*o**2,p=o*ht(c-u,-Math.PI,Math.PI),g=p*p,b=g*p,S=b*p,k=S*p,F=k*p,M=Xe*(Pr*r-Mn*Math.sin(2*r)+Pn*Math.sin(4*r)-$n*Math.sin(6*r)),Q=Ve*h*(p+b/6*(1-s+m)+k/120*(5-18*s+l+72*m-58*Y))+5e5;let Le=Ve*(M+h*a*(g/2+S/24*(5-s+9*m+4*m**2)+F/720*(61-58*s+l+600*m-330*Y)));return t.north||(Le+=1e7),[Q,Le]}function Ar(i){return(i-1)*6-180+3}const Tn=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Fr(i){let e=0;for(const n of Tn){const o=i.match(n);if(o){e=parseInt(o[1]);break}}if(!e)return null;let t=0,r=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(r=!0,t=e-32600),t?{number:t,north:r}:null}function Lr(i,e){return function(t,r,n,o){const a=t.length;n=n>1?n:2,o=o??n,r||(n>2?r=t.slice():r=new Array(a));for(let s=0;s<a;s+=o){const l=t[s],c=t[s+1],d=i(l,c,e);r[s]=d[0],r[s+1]=d[1]}return r}}function On(i){return Fr(i)?new mt({code:i,units:"m"}):null}function Hn(i){const e=Fr(i.getCode());return e?{forward:Lr(Nn,e),inverse:Lr(Gn,e)}:null}const jn=[Hn],Vn=[On];function yt(i,e){if(e!==void 0){for(let t=0,r=i.length;t<r;++t)e[t]=i[t];e=e}else e=i.slice();return e}function vt(i){Sn(i.getCode(),i),_e(i,i,yt)}function Un(i){i.forEach(vt)}function $(i){if(typeof i!="string")return i;const e=Cn(i);if(e)return e;for(const t of Vn){const r=t(i);if(r)return r}return null}function Gr(i){Un(i),i.forEach(function(e){i.forEach(function(t){e!==t&&_e(e,t,yt)})})}function Yn(i,e,t,r){i.forEach(function(n){e.forEach(function(o){_e(n,o,t),_e(o,n,r)})})}function Xn(i,e){if(i===e)return!0;const t=i.getUnits()===e.getUnits();return(i.getCode()===e.getCode()||Ir(i,e)===yt)&&t}function Ir(i,e){const t=i.getCode(),r=e.getCode();let n=gt(t,r);if(n)return n;let o=null,a=null;for(const l of jn)o||(o=l(i)),a||(a=l(e));if(!o&&!a)return null;const s="EPSG:4326";if(a)if(o)n=xt(o.inverse,a.forward);else{const l=gt(t,s);l&&(n=xt(l,a.forward))}else{const l=gt(s,r);l&&(n=xt(o.inverse,l))}return n&&(vt(i),vt(e),_e(i,e,n)),n}function xt(i,e){return function(t,r,n,o){return r=i(t,r,n,o),e(r,r,n,o)}}function kt(i,e){const t=$(i),r=$(e);return Ir(t,r)}function Bn(){Gr(_r),Gr(zr),Yn(zr,_r,kn,_n)}Bn(),new Array(6);function Rr(){return[1,0,0,1,0,0]}function Nr(i,e,t,r,n,o,a,s){const l=Math.sin(o),c=Math.cos(o);return i[0]=r*c,i[1]=n*l,i[2]=-r*l,i[3]=n*c,i[4]=a*r*c-s*r*l+e,i[5]=a*n*l+s*n*c+t,i}function Tr(i,e,t,r,n,o,a){o=o||[],a=a||2;let s=0;for(let l=e;l<t;l+=r){const c=i[l],d=i[l+1];o[s++]=n[0]*c+n[2]*d+n[4],o[s++]=n[1]*c+n[3]*d+n[5];for(let u=2;u<a;u++)o[s++]=i[l+u]}return o&&o.length!=s&&(o.length=s),o}function qn(i,e,t,r,n,o,a){a=a||[];const s=Math.cos(n),l=Math.sin(n),c=o[0],d=o[1];let u=0;for(let h=e;h<t;h+=r){const m=i[h]-c,p=i[h+1]-d;a[u++]=c+m*s-p*l,a[u++]=d+m*l+p*s;for(let g=h+2;g<h+r;++g)a[u++]=i[g]}return a&&a.length!=u&&(a.length=u),a}function Jn(i,e,t,r,n,o,a,s){s=s||[];const l=a[0],c=a[1];let d=0;for(let u=e;u<t;u+=r){const h=i[u]-l,m=i[u+1]-c;s[d++]=l+n*h,s[d++]=c+o*m;for(let p=u+2;p<u+r;++p)s[d++]=i[p]}return s&&s.length!=d&&(s.length=d),s}function Wn(i,e,t,r,n,o,a){a=a||[];let s=0;for(let l=e;l<t;l+=r){a[s++]=i[l]+n,a[s++]=i[l+1]+o;for(let c=l+2;c<l+r;++c)a[s++]=i[c]}return a&&a.length!=s&&(a.length=s),a}const Or=Rr(),Zn=[NaN,NaN];class Hr extends gr{constructor(){super(),this.extent_=lt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=cr((e,t,r)=>{if(!r)return this.getSimplifiedGeometry(t);const n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return f()}closestPointXY(e,t,r,n){return f()}containsXY(e,t){return this.closestPointXY(e,t,Zn,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return f()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&ct(t),this.extentRevision_=this.getRevision()}return gn(this.extent_,e)}rotate(e,t){f()}scale(e,t,r){f()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return f()}getType(){return f()}applyTransform(e){f()}intersectsExtent(e){return f()}translate(e,t){f()}transform(e,t){const r=$(e),n=r.getUnits()=="tile-pixels"?function(o,a,s){const l=r.getExtent(),c=r.getWorldExtent(),d=Oe(c)/Oe(l);Nr(Or,c[0],c[3],d,-d,0,0,0);const u=Tr(o,0,o.length,s,Or,a),h=kt(r,t);return h?h(u,u,s):u}:kt(r,t);return this.applyTransform(n),this}}class X extends Hr{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return f()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=jr(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){f()}setLayout(e,t,r){let n;if(e)n=jr(e);else{for(let o=0;o<r;++o){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}n=t.length,e=B(n)}this.layout=e,this.stride=n}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const r=this.getFlatCoordinates();if(r){const n=this.getStride();qn(r,0,r.length,n,e,t,r),this.changed()}}scale(e,t,r){t===void 0&&(t=e),r||(r=Te(this.getExtent()));const n=this.getFlatCoordinates();if(n){const o=this.getStride();Jn(n,0,n.length,o,e,t,r,n),this.changed()}}translate(e,t){const r=this.getFlatCoordinates();if(r){const n=this.getStride();Wn(r,0,r.length,n,e,t,r),this.changed()}}}function B(i){let e;return i==2?e="XY":i==3?e="XYZ":i==4&&(e="XYZM"),e}function jr(i){let e;return i=="XY"?e=2:i=="XYZ"||i=="XYM"?e=3:i=="XYZM"&&(e=4),e}function Kn(i,e,t,r){for(let n=0,o=t.length;n<o;++n)i[e++]=t[n];return e}function Be(i,e,t,r){for(let n=0,o=t.length;n<o;++n){const a=t[n];for(let s=0;s<r;++s)i[e++]=a[s]}return e}function we(i,e,t,r,n){n=n||[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=Be(i,e,t[a],r);n[o++]=l,e=l}return n.length=o,n}function Vr(i,e,t,r,n){n=n||[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=we(i,e,t[a],r,n[o]);l.length===0&&(l[0]=e),n[o++]=l,e=l[l.length-1]}return n.length=o,n}function Ur(i,e,t,r){const n=[];let o=lt();for(let a=0,s=t.length;a<s;++a){const l=t[a];o=dt(i,e,l[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return n}function Dn(i,e,t,r,n){return!cn(n,function(a){return!q(i,e,t,r,a[0],a[1])})}function q(i,e,t,r,n,o){let a=0,s=i[t-r],l=i[t-r+1];for(;e<t;e+=r){const c=i[e],d=i[e+1];l<=o?d>o&&(c-s)*(o-l)-(n-s)*(d-l)>0&&a++:d<=o&&(c-s)*(o-l)-(n-s)*(d-l)<0&&a--,s=c,l=d}return a!==0}function _t(i,e,t,r,n,o){if(t.length===0||!q(i,e,t[0],r,n,o))return!1;for(let a=1,s=t.length;a<s;++a)if(q(i,t[a-1],t[a],r,n,o))return!1;return!0}function Qn(i,e,t,r,n,o){if(t.length===0)return!1;for(let a=0,s=t.length;a<s;++a){const l=t[a];if(_t(i,e,l,r,n,o))return!0;e=l[l.length-1]}return!1}function wt(i,e,t,r,n,o,a){let s,l,c,d,u,h,m;const p=n[o+1],g=[];for(let k=0,F=t.length;k<F;++k){const M=t[k];for(d=i[M-r],h=i[M-r+1],s=e;s<M;s+=r)u=i[s],m=i[s+1],(p<=h&&m<=p||h<=p&&p<=m)&&(c=(p-h)/(m-h)*(u-d)+d,g.push(c)),d=u,h=m}let b=NaN,S=-1/0;for(g.sort(sr),d=g[0],s=1,l=g.length;s<l;++s){u=g[s];const k=Math.abs(u-d);k>S&&(c=(d+u)/2,_t(i,e,t,r,c,p)&&(b=c,S=k)),d=u}return isNaN(b)&&(b=n[o]),a?(a.push(b,p,S),a):[b,p,S]}function Yr(i,e,t,r,n){let o=[];for(let a=0,s=t.length;a<s;++a){const l=t[a];o=wt(i,e,l,r,n,2*a,o),e=l[l.length-1]}return o}function qe(i,e,t,r,n,o,a){let s,l;const c=(t-e)/r;if(c===1)s=e;else if(c===2)s=e,l=n;else if(c!==0){let d=i[e],u=i[e+1],h=0;const m=[0];for(let b=e+r;b<t;b+=r){const S=i[b],k=i[b+1];h+=Math.sqrt((S-d)*(S-d)+(k-u)*(k-u)),m.push(h),d=S,u=k}const p=n*h,g=Di(m,p);g<0?(l=(p-m[-g-2])/(m[-g-1]-m[-g-2]),s=e+(-g-2)*r):s=e+g*r}a=a>1?a:2,o=o||new Array(a);for(let d=0;d<a;++d)o[d]=s===void 0?NaN:l===void 0?i[s+d]:ut(i[s+d],i[s+r+d],l);return o}function zt(i,e,t,r,n,o){if(t==e)return null;let a;if(n<i[e+r-1])return o?(a=i.slice(e,e+r),a[r-1]=n,a):null;if(i[t-1]<n)return o?(a=i.slice(t-r,t),a[r-1]=n,a):null;if(n==i[e+r-1])return i.slice(e,e+r);let s=e/r,l=t/r;for(;s<l;){const h=s+l>>1;n<i[(h+1)*r-1]?l=h:s=h+1}const c=i[s*r-1];if(n==c)return i.slice((s-1)*r,(s-1)*r+r);const d=i[(s+1)*r-1],u=(n-c)/(d-c);a=[];for(let h=0;h<r-1;++h)a.push(ut(i[(s-1)*r+h],i[s*r+h],u));return a.push(n),a}function eo(i,e,t,r,n,o,a){if(a)return zt(i,e,t[t.length-1],r,n,o);let s;if(n<i[r-1])return o?(s=i.slice(0,r),s[r-1]=n,s):null;if(i[i.length-1]<n)return o?(s=i.slice(i.length-r),s[r-1]=n,s):null;for(let l=0,c=t.length;l<c;++l){const d=t[l];if(e!=d){if(n<i[e+r-1])return null;if(n<=i[d-1])return zt(i,e,d,r,n,!1);e=d}}return null}function to(i,e,t,r){for(;e<t-r;){for(let n=0;n<r;++n){const o=i[e+n];i[e+n]=i[t-r+n],i[t-r+n]=o}e+=r,t-=r}}function Ct(i,e,t,r){let n=0,o=i[t-r],a=i[t-r+1];for(;e<t;e+=r){const s=i[e],l=i[e+1];n+=(s-o)*(l+a),o=s,a=l}return n===0?void 0:n>0}function St(i,e,t,r,n){n=n!==void 0?n:!1;for(let o=0,a=t.length;o<a;++o){const s=t[o],l=Ct(i,e,s,r);if(o===0){if(n&&l||!n&&!l)return!1}else if(n&&!l||!n&&l)return!1;e=s}return!0}function Xr(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];if(!St(i,e,s,r,n))return!1;s.length&&(e=s[s.length-1])}return!0}function Je(i,e,t,r,n){n=n!==void 0?n:!1;for(let o=0,a=t.length;o<a;++o){const s=t[o],l=Ct(i,e,s,r);(o===0?n&&l||!n&&!l:n&&!l||!n&&l)&&to(i,e,s,r),e=s}return e}function Mt(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o)e=Je(i,e,t[o],r,n);return e}function ro(i,e){const t=[];let r=0,n=0,o;for(let a=0,s=e.length;a<s;++a){const l=e[a],c=Ct(i,r,l,2);if(o===void 0&&(o=c),c===o)t.push(e.slice(n,a+1));else{if(t.length===0)continue;t[t.length-1].push(e[n])}n=a+1,r=l}return t}function We(i,e,t,r,n,o,a){const s=(t-e)/r;if(s<3){for(;e<t;e+=r)o[a++]=i[e],o[a++]=i[e+1];return a}const l=new Array(s);l[0]=1,l[s-1]=1;const c=[e,t-r];let d=0;for(;c.length>0;){const u=c.pop(),h=c.pop();let m=0;const p=i[h],g=i[h+1],b=i[u],S=i[u+1];for(let k=h+r;k<u;k+=r){const F=i[k],M=i[k+1],Q=bn(F,M,p,g,b,S);Q>m&&(d=k,m=Q)}m>n&&(l[(d-e)/r]=1,h+r<d&&c.push(h,d),d+r<u&&c.push(d,u))}for(let u=0;u<s;++u)l[u]&&(o[a++]=i[e+u*r],o[a++]=i[e+u*r+1]);return a}function Br(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l];a=We(i,e,d,r,n,o,a),s.push(a),e=d}return a}function ce(i,e){return e*Math.round(i/e)}function io(i,e,t,r,n,o,a){if(e==t)return a;let s=ce(i[e],n),l=ce(i[e+1],n);e+=r,o[a++]=s,o[a++]=l;let c,d;do if(c=ce(i[e],n),d=ce(i[e+1],n),e+=r,e==t)return o[a++]=c,o[a++]=d,a;while(c==s&&d==l);for(;e<t;){const u=ce(i[e],n),h=ce(i[e+1],n);if(e+=r,u==c&&h==d)continue;const m=c-s,p=d-l,g=u-s,b=h-l;if(m*b==p*g&&(m<0&&g<m||m==g||m>0&&g>m)&&(p<0&&b<p||p==b||p>0&&b>p)){c=u,d=h;continue}o[a++]=c,o[a++]=d,s=c,l=d,c=u,d=h}return o[a++]=c,o[a++]=d,a}function Pt(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l];a=io(i,e,d,r,n,o,a),s.push(a),e=d}return a}function no(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l],u=[];a=Pt(i,e,d,r,n,o,a,u),s.push(u),e=d[d.length-1]}return a}class J extends Hr{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Re),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,r=e.length;t<r;++t)this.changeEventsKeys_.push(xe(e[t],st.CHANGE,this.changed,this))}clone(){const e=new J($t(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,r,n){if(n<j(this.getExtent(),e,t))return n;const o=this.geometries_;for(let a=0,s=o.length;a<s;++a)n=o[a].closestPointXY(e,t,r,n);return n}containsXY(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)if(r[n].containsXY(e,t))return!0;return!1}computeExtent(e){ct(e);const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)sn(e,t[r].getExtent());return e}getGeometries(){return $t(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],r=this.geometries_;let n=!1;for(let o=0,a=r.length;o<a;++o){const s=r[o],l=s.getSimplifiedGeometry(e);t.push(l),l!==s&&(n=!0)}return n?new J(t):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)if(t[r].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)r[n].rotate(e,t);this.changed()}scale(e,t,r){r||(r=Te(this.getExtent()));const n=this.geometries_;for(let o=0,a=n.length;o<a;++o)n[o].scale(e,t,r);this.changed()}setGeometries(e){this.setGeometriesArray($t(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)t[r].applyTransform(e);this.changed()}translate(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)r[n].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function $t(i){return i.map(e=>e.clone())}function qr(i,e,t,r){let n=0;const o=i[t-r],a=i[t-r+1];let s=0,l=0;for(;e<t;e+=r){const c=i[e]-o,d=i[e+1]-a;n+=l*c-s*d,s=c,l=d}return n/2}function Jr(i,e,t,r){let n=0;for(let o=0,a=t.length;o<a;++o){const s=t[o];n+=qr(i,e,s,r),e=s}return n}function oo(i,e,t,r){let n=0;for(let o=0,a=t.length;o<a;++o){const s=t[o];n+=Jr(i,e,s,r),e=s[s.length-1]}return n}function Wr(i,e,t,r,n,o,a){const s=i[e],l=i[e+1],c=i[t]-s,d=i[t+1]-l;let u;if(c===0&&d===0)u=e;else{const h=((n-s)*c+(o-l)*d)/(c*c+d*d);if(h>1)u=t;else if(h>0){for(let m=0;m<r;++m)a[m]=ut(i[e+m],i[t+m],h);a.length=r;return}else u=e}for(let h=0;h<r;++h)a[h]=i[u+h];a.length=r}function Et(i,e,t,r,n){let o=i[e],a=i[e+1];for(e+=r;e<t;e+=r){const s=i[e],l=i[e+1],c=V(o,a,s,l);c>n&&(n=c),o=s,a=l}return n}function At(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];n=Et(i,e,s,r,n),e=s}return n}function ao(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];n=At(i,e,s,r,n),e=s[s.length-1]}return n}function Ft(i,e,t,r,n,o,a,s,l,c,d){if(e==t)return c;let u,h;if(n===0){if(h=V(a,s,i[e],i[e+1]),h<c){for(u=0;u<r;++u)l[u]=i[e+u];return l.length=r,h}return c}d=d||[NaN,NaN];let m=e+r;for(;m<t;)if(Wr(i,m-r,m,r,a,s,d),h=V(a,s,d[0],d[1]),h<c){for(c=h,u=0;u<r;++u)l[u]=d[u];l.length=r,m+=r}else m+=r*Math.max((Math.sqrt(h)-Math.sqrt(c))/n|0,1);if(o&&(Wr(i,t-r,e,r,a,s,d),h=V(a,s,d[0],d[1]),h<c)){for(c=h,u=0;u<r;++u)l[u]=d[u];l.length=r}return c}function Lt(i,e,t,r,n,o,a,s,l,c,d){d=d||[NaN,NaN];for(let u=0,h=t.length;u<h;++u){const m=t[u];c=Ft(i,e,m,r,n,o,a,s,l,c,d),e=m}return c}function so(i,e,t,r,n,o,a,s,l,c,d){d=d||[NaN,NaN];for(let u=0,h=t.length;u<h;++u){const m=t[u];c=Lt(i,e,m,r,n,o,a,s,l,c,d),e=m[m.length-1]}return c}function Ze(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=e;a<t;a+=r)n[o++]=i.slice(a,a+r);return n.length=o,n}function Gt(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a];n[o++]=Ze(i,e,l,r,n[o]),e=l}return n.length=o,n}function lo(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a];n[o++]=l.length===1&&l[0]===e?[]:Gt(i,e,l,r,n[o]),e=l[l.length-1]}return n.length=o,n}class ze extends X{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new ze(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Et(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,r,n))}getArea(){return qr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=We(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new ze(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}function Zr(i,e,t,r,n){let o;for(e+=r;e<t;e+=r)if(o=n(i.slice(e-r,e),i.slice(e,e+r)),o)return o;return!1}function Ke(i,e,t,r,n,o){return o=o??xr(lt(),i,e,t,r),pn(n,o)?o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Zr(i,e,t,r,function(a,s){return fn(n,a,s)}):!1}function co(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){if(Ke(i,e,t[o],r,n))return!0;e=t[o]}return!1}function uo(i,e,t,r,n){return!!(Ke(i,e,t,r,n)||q(i,e,t,r,n[0],n[1])||q(i,e,t,r,n[0],n[3])||q(i,e,t,r,n[2],n[1])||q(i,e,t,r,n[2],n[3]))}function Kr(i,e,t,r,n){if(!uo(i,e,t[0],r,n))return!1;if(t.length===1)return!0;for(let o=1,a=t.length;o<a;++o)if(Dn(i,t[o-1],t[o],r,n)&&!Ke(i,t[o-1],t[o],r,n))return!1;return!0}function ho(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];if(Kr(i,e,s,r,n))return!0;e=s[s.length-1]}return!1}function mo(i,e,t,r){let n=i[e],o=i[e+1],a=0;for(let s=e+r;s<t;s+=r){const l=i[s],c=i[s+1];a+=Math.sqrt((l-n)*(l-n)+(c-o)*(c-o)),n=l,o=c}return a}class W extends X{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){A(this.flatCoordinates,e),this.changed()}clone(){const e=new W(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Et(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,r,n))}forEachSegment(e){return Zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!="XYM"&&this.layout!="XYZM"?null:(t=t!==void 0?t:!1,zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return mo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=We(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new W(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return Ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}class Ce extends X{constructor(e,t,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&r)this.setFlatCoordinates(t,e),this.ends_=r;else{const n=e,o=[],a=[];for(let l=0,c=n.length;l<c;++l){const d=n[l];A(o,d.getFlatCoordinates()),a.push(o.length)}const s=n.length===0?this.getLayout():n[0].getLayout();this.setFlatCoordinates(s,o),this.ends_=a}}appendLineString(e){A(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Ce(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(At(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lt(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,r,n))}getCoordinateAtM(e,t,r){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(t=t!==void 0?t:!1,r=r!==void 0?r:!1,eo(this.flatCoordinates,0,this.ends_,this.stride,e,t,r))}getCoordinates(){return Gt(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new W(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,r=this.layout,n=[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a],c=new W(e.slice(o,l),r);n.push(c),o=l}return n}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let r=0;const n=this.ends_,o=this.stride;for(let a=0,s=n.length;a<s;++a){const l=n[a],c=qe(t,r,l,o,.5);A(e,c),r=l}return e}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=Br(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,r),new Ce(t,"XY",r)}getType(){return"MultiLineString"}intersectsExtent(e){return co(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=we(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Z extends X{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new Z(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){const o=this.flatCoordinates,a=V(e,t,o[0],o[1]);if(a<n){const s=this.stride;for(let l=0;l<s;++l)r[l]=o[l];return r.length=s,a}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return vr(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return fr(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Kn(this.flatCoordinates,0,e,this.stride),this.changed()}}class Se extends X{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){A(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new Se(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){if(n<j(this.getExtent(),e,t))return n;const o=this.flatCoordinates,a=this.stride;for(let s=0,l=o.length;s<l;s+=a){const c=V(e,t,o[s],o[s+1]);if(c<n){n=c;for(let d=0;d<a;++d)r[d]=o[s+d];r.length=a}}return n}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new Z(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,r=this.stride,n=[];for(let o=0,a=e.length;o<a;o+=r){const s=new Z(e.slice(o,o+r),t);n.push(s)}return n}getType(){return"MultiPoint"}intersectsExtent(e){const t=this.flatCoordinates,r=this.stride;for(let n=0,o=t.length;n<o;n+=r){const a=t[n],s=t[n+1];if(fr(e,a,s))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}class K extends X{constructor(e,t,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&r?(this.setFlatCoordinates(t,e),this.ends_=r):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?A(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new K(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(At(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lt(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,r,n))}containsXY(e,t){return _t(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Jr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Je(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,Gt(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=Te(this.getExtent());this.flatInteriorPoint_=wt(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Z(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new ze(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,r=this.ends_,n=[];let o=0;for(let a=0,s=r.length;a<s;++a){const l=r[a],c=new ze(t.slice(o,l),e);n.push(c),o=l}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;St(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Je(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=Pt(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,r),new K(t,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return Kr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=we(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Me extends X{constructor(e,t,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){const n=e,o=[],a=[];for(let s=0,l=n.length;s<l;++s){const c=n[s],d=o.length,u=c.getEnds();for(let h=0,m=u.length;h<m;++h)u[h]+=d;A(o,c.getFlatCoordinates()),a.push(u)}t=n.length===0?this.getLayout():n[0].getLayout(),e=o,r=a}t!==void 0&&r?(this.setFlatCoordinates(t,e),this.endss_=r):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const r=this.flatCoordinates.length;A(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let n=0,o=t.length;n<o;++n)t[n]+=r}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let n=0;n<e;++n)t[n]=this.endss_[n].slice();const r=new Me(this.flatCoordinates.slice(),this.layout,t);return r.applyProperties(this),r}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ao(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,r,n))}containsXY(e,t){return Qn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return oo(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Mt(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,lo(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=Ur(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Yr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Se(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Xr(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Mt(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=no(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,r),new Me(t,"XY",r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const o=this.endss_[e-1];t=o[o.length-1]}const r=this.endss_[e].slice(),n=r[r.length-1];if(t!==0)for(let o=0,a=r.length;o<a;++o)r[o]-=t;return new K(this.flatCoordinates.slice(t,n),this.layout,r)}getPolygons(){const e=this.layout,t=this.flatCoordinates,r=this.endss_,n=[];let o=0;for(let a=0,s=r.length;a<s;++a){const l=r[a].slice(),c=l[l.length-1];if(o!==0)for(let u=0,h=l.length;u<h;++u)l[u]-=o;const d=new K(t.slice(o,c),e,l);n.push(d),o=c}return n}getType(){return"MultiPolygon"}intersectsExtent(e){return ho(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const r=Vr(this.flatCoordinates,0,e,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{const n=r[r.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const Dr=Rr();class D{constructor(e,t,r,n,o,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r||null,this.properties_=o,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?vr(this.flatCoordinates_):dt(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=Te(this.getExtent());this.flatInteriorPoints_=wt(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=ro(this.flatCoordinates_,this.ends_),t=Ur(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Yr(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=qe(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const r=this.ends_;for(let n=0,o=r.length;n<o;++n){const a=r[n],s=qe(e,t,a,2,.5);A(this.flatMidpoints_,s),t=a}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=$(e);const t=e.getExtent(),r=e.getWorldExtent();if(t&&r){const n=Oe(r)/Oe(t);Nr(Dr,r[0],r[3],n,-n,0,0,0),Tr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Dr,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new D(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=cr((e,t)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),t&&this.simplifiedGeometry_.applyTransform(t);const r=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":r.length=We(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,r,0),n=[r.length];break;case"MultiLineString":n=[],r.length=Br(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,r,0,n);break;case"Polygon":n=[],r.length=Pt(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),r,0,n);break}return n&&(this.simplifiedGeometry_=new D(this.type_,r,n,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}D.prototype.getFlatCoordinates=D.prototype.getOrientedFlatCoordinates;class Qr{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ne,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let r=t.dataProjection?$(t.dataProjection):this.readProjection(e);t.extent&&r&&r.getUnits()==="tile-pixels"&&(r=$(r),r.setWorldExtent(t.extent)),t={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return f()}readFeature(e,t){return f()}readFeatures(e,t){return f()}readGeometry(e,t){return f()}readProjection(e){return f()}writeFeature(e,t){return f()}writeFeatures(e,t){return f()}writeGeometry(e,t){return f()}}function Pe(i,e,t){const r=t?$(t.featureProjection):null,n=t?$(t.dataProjection):null;let o=i;if(r&&n&&!Xn(r,n)){e&&(o=i.clone());const a=e?r:n,s=e?n:r;a.getUnits()==="tile-pixels"?o.transform(a,s):o.applyTransform(kt(a,s))}if(e&&t&&t.decimals!==void 0){const a=Math.pow(10,t.decimals),s=function(l){for(let c=0,d=l.length;c<d;++c)l[c]=Math.round(l[c]*a)/a;return l};o===i&&(o=i.clone()),o.applyTransform(s)}return o}const po={Point:Z,LineString:W,Polygon:K,MultiPoint:Se,MultiLineString:Ce,MultiPolygon:Me};function go(i,e,t){return Array.isArray(e[0])?(Xr(i,0,e,t)||(i=i.slice(),Mt(i,0,e,t)),i):(St(i,0,e,t)||(i=i.slice(),Je(i,0,e,t)),i)}function ei(i,e){var o;const t=i.geometry;if(!t)return[];if(Array.isArray(t))return t.map(a=>ei({...i,geometry:a})).flat();const r=t.type==="MultiPolygon"?"Polygon":t.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const n=t.layout.length;return Pe(new D(r,r==="Polygon"?go(t.flatCoordinates,t.ends,n):t.flatCoordinates,(o=t.ends)==null?void 0:o.flat(),n,i.properties||{},i.id).enableSimplifyTransformed(),!1,e)}function It(i,e){if(!i)return null;if(Array.isArray(i)){const r=i.map(n=>It(n,e));return new J(r)}const t=po[i.type];return Pe(new t(i.flatCoordinates,i.layout||"XY",i.ends),!1,e)}class fo extends Qr{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(De(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(De(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return f()}readFeaturesFromObject(e,t){return f()}readGeometry(e,t){return this.readGeometryFromObject(De(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return f()}readProjection(e){return this.readProjectionFromObject(De(e))}readProjectionFromObject(e){return f()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return f()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return f()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return f()}}function De(i){if(typeof i=="string"){const e=JSON.parse(i);return e||null}return i!==null?i:null}class bo extends fo{constructor(e){e=e||{},super(),this.dataProjection=$(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=$(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const n=Rt(r.geometry);if(this.featureClass===D)return ei({geometry:n,id:r.id,properties:r.properties},t);const o=new ne;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&o.setGeometryName(r.geometry_name),o.setGeometry(It(n,t)),"id"in r&&o.setId(r.id),r.properties&&o.setProperties(r.properties,!0),o}readFeaturesFromObject(e,t){const r=e;let n=null;if(r.type==="FeatureCollection"){const o=e;n=[];const a=o.features;for(let s=0,l=a.length;s<l;++s){const c=this.readFeatureFromObject(a[s],t);c&&n.push(c)}}else n=[this.readFeatureFromObject(e,t)];return n.flat()}readGeometryFromObject(e,t){return yo(e,t)}readProjectionFromObject(e){const t=e.crs;let r;if(t)if(t.type=="name")r=$(t.properties.name);else if(t.type==="EPSG")r=$("EPSG:"+t.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,t){t=this.adaptOptions(t);const r={type:"Feature",geometry:null,properties:null},n=e.getId();if(n!==void 0&&(r.id=n),!e.hasProperties())return r;const o=e.getProperties(),a=e.getGeometry();return a&&(r.geometry=Nt(a,t),delete o[e.getGeometryName()]),ur(o)||(r.properties=o),r}writeFeaturesObject(e,t){t=this.adaptOptions(t);const r=[];for(let n=0,o=e.length;n<o;++n)r.push(this.writeFeatureObject(e[n],t));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,t){return Nt(e,this.adaptOptions(t))}}function Rt(i,e){if(!i)return null;let t;switch(i.type){case"Point":{t=xo(i);break}case"LineString":{t=ko(i);break}case"Polygon":{t=Co(i);break}case"MultiPoint":{t=wo(i);break}case"MultiLineString":{t=_o(i);break}case"MultiPolygon":{t=zo(i);break}case"GeometryCollection":{t=vo(i);break}default:throw new Error("Unsupported GeoJSON type: "+i.type)}return t}function yo(i,e){const t=Rt(i);return It(t,e)}function vo(i,e){return i.geometries.map(function(r){return Rt(r)})}function xo(i){const e=i.coordinates;return{type:"Point",flatCoordinates:e,layout:B(e.length)}}function ko(i){var r;const e=i.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:B(((r=e[0])==null?void 0:r.length)||2)}}function _o(i){var o,a;const e=i.coordinates,t=((a=(o=e[0])==null?void 0:o[0])==null?void 0:a.length)||2,r=[],n=we(r,0,e,t);return{type:"MultiLineString",flatCoordinates:r,ends:n,layout:B(t)}}function wo(i){var t;const e=i.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:B(((t=e[0])==null?void 0:t.length)||2)}}function zo(i){var o,a;const e=i.coordinates,t=[],r=((a=(o=e[0])==null?void 0:o[0])==null?void 0:a[0].length)||2,n=Vr(t,0,e,r);return{type:"MultiPolygon",flatCoordinates:t,ends:n,layout:B(r)}}function Co(i){var o,a;const e=i.coordinates,t=[],r=(a=(o=e[0])==null?void 0:o[0])==null?void 0:a.length,n=we(t,0,e,r);return{type:"Polygon",flatCoordinates:t,ends:n,layout:B(r)}}function Nt(i,e){i=Pe(i,!0,e);const t=i.getType();let r;switch(t){case"Point":{r=Ao(i);break}case"LineString":{r=Mo(i);break}case"Polygon":{r=Fo(i,e);break}case"MultiPoint":{r=$o(i);break}case"MultiLineString":{r=Po(i);break}case"MultiPolygon":{r=Eo(i,e);break}case"GeometryCollection":{r=So(i,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return r}function So(i,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:i.getGeometriesArray().map(function(r){return Nt(r,e)})}}function Mo(i,e){return{type:"LineString",coordinates:i.getCoordinates()}}function Po(i,e){return{type:"MultiLineString",coordinates:i.getCoordinates()}}function $o(i,e){return{type:"MultiPoint",coordinates:i.getCoordinates()}}function Eo(i,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:i.getCoordinates(t)}}function Ao(i,e){return{type:"Point",coordinates:i.getCoordinates()}}function Fo(i,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:i.getCoordinates(t)}}const Lo=(i,e)=>new bo().writeFeaturesObject(i,e);class Go extends Qr{constructor(){super()}getType(){return"text"}readFeature(e,t){return this.readFeatureFromText(Qe(e),this.adaptOptions(t))}readFeatureFromText(e,t){return f()}readFeatures(e,t){return this.readFeaturesFromText(Qe(e),this.adaptOptions(t))}readFeaturesFromText(e,t){return f()}readGeometry(e,t){return this.readGeometryFromText(Qe(e),this.adaptOptions(t))}readGeometryFromText(e,t){return f()}readProjection(e){return this.readProjectionFromText(Qe(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,t){return this.writeFeatureText(e,this.adaptOptions(t))}writeFeatureText(e,t){return f()}writeFeatures(e,t){return this.writeFeaturesText(e,this.adaptOptions(t))}writeFeaturesText(e,t){return f()}writeGeometry(e,t){return this.writeGeometryText(e,this.adaptOptions(t))}writeGeometryText(e,t){return f()}}function Qe(i){return typeof i=="string"?i:""}const Io={POINT:Z,LINESTRING:W,POLYGON:K,MULTIPOINT:Se,MULTILINESTRING:Ce,MULTIPOLYGON:Me},ti="EMPTY",ri="Z",ii="M",Ro="ZM",y={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},No={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class To{constructor(e){this.wkt=e,this.index_=-1}isAlpha_(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}isNumeric_(e,t){return t=t!==void 0?t:!1,e>="0"&&e<="9"||e=="."&&!t}isWhiteSpace_(e){return e==" "||e==" "||e=="\r"||e==`
62
+ `}}ee(ar,"properties",{eoxDrawTools:{attribute:!1,state:!0},eoxMap:{attribute:!1,state:!0},olMap:{attribute:!1,state:!0},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},featureName:{attribute:!1,state:!0,type:String},featureNameKey:{attribute:!1,state:!0,type:String},modify:{attribute:!1,state:!0},unstyled:{type:Boolean}}),customElements.define("eox-drawtools-list",ar);const Ji=i=>{const{multipleFeatures:e,drawnFeatures:t,currentlyDrawing:r}=i,n=!e&&(t==null?void 0:t.length)>0||r,o=!(t!=null&&t.length)&&!r;return{drawDisabled:n,discardDisabled:o}};function Wi(i){navigator.clipboard.writeText(i).then(function(){},function(e){console.error("Could not copy text: ",e)})}const Zi={PROPERTYCHANGE:"propertychange"},st={CHANGE:"change"};class Ki{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Di(i,e,t){let r,n;t=t||sr;let o=0,a=i.length,s=!1;for(;o<a;)r=o+(a-o>>1),n=+t(i[r],e),n<0?o=r+1:(a=r,s=!n);return s?o:~o}function sr(i,e){return i>e?1:i<e?-1:0}function A(i,e){const t=Array.isArray(e)?e:[e],r=t.length;for(let n=0;n<r;n++)i[i.length]=t[n]}function Qi(i,e){const t=i.length;if(t!==e.length)return!1;for(let r=0;r<t;r++)if(i[r]!==e[r])return!1;return!0}function lr(){}function cr(i){let e,t,r;return function(){const n=Array.prototype.slice.call(arguments);return(!t||this!==r||!Qi(n,t))&&(r=this,t=n,e=i.apply(this,arguments)),e}}function dr(i){for(const e in i)delete i[e]}function ur(i){let e;for(e in i)return!1;return!e}class hr{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class en extends Ki{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const r=this.listeners_||(this.listeners_={}),n=r[e]||(r[e]=[]);n.includes(t)||n.push(t)}dispatchEvent(e){const t=typeof e=="string",r=t?e:e.type,n=this.listeners_&&this.listeners_[r];if(!n)return;const o=t?new hr(e):e;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,s[r]=0),++a[r];let l;for(let c=0,d=n.length;c<d;++c)if("handleEvent"in n[c]?l=n[c].handleEvent(o):l=n[c].call(this,o),l===!1||o.propagationStopped){l=!1;break}if(--a[r]===0){let c=s[r];for(delete s[r];c--;)this.removeEventListener(r,lr);delete a[r]}return l}disposeInternal(){this.listeners_&&dr(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const n=r.indexOf(t);n!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[n]=lr,++this.pendingRemovals_[e]):(r.splice(n,1),r.length===0&&delete this.listeners_[e]))}}function ke(i,e,t,r,n){if(n){const a=t;t=function(s){return i.removeEventListener(e,t),a.call(r??this,s)}}else r&&r!==i&&(t=t.bind(r));const o={target:i,type:e,listener:t};return i.addEventListener(e,t),o}function mr(i,e,t,r){return ke(i,e,t,r,!0)}function Re(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),dr(i))}class Ne extends en{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(st.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const r=e.length,n=new Array(r);for(let o=0;o<r;++o)n[o]=ke(this,e[o],t);return n}return ke(this,e,t)}onceInternal(e,t){let r;if(Array.isArray(e)){const n=e.length;r=new Array(n);for(let o=0;o<n;++o)r[o]=mr(this,e[o],t)}else r=mr(this,e,t);return t.ol_key=r,r}unInternal(e,t){const r=t.ol_key;if(r)tn(r);else if(Array.isArray(e))for(let n=0,o=e.length;n<o;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}}Ne.prototype.on,Ne.prototype.once,Ne.prototype.un;function tn(i){if(Array.isArray(i))for(let e=0,t=i.length;e<t;++e)Re(i[e]);else Re(i)}function f(){throw new Error("Unimplemented abstract method.")}let rn=0;function nn(i){return i.ol_uid||(i.ol_uid=String(++rn))}class pr extends hr{constructor(e,t,r){super(e),this.key=t,this.oldValue=r}}class gr extends Ne{constructor(e){super(),this.on,this.once,this.un,nn(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new pr(r,e,t)),r=Zi.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new pr(r,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,r){const n=this.values_||(this.values_={});if(r)n[e]=t;else{const o=n[e];n[e]=t,o!==t&&this.notify(e,o)}}setProperties(e,t){for(const r in e)this.set(r,e[r],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],ur(this.values_)&&(this.values_=null),t||this.notify(e,r)}}}function on(i,e){if(!i)throw new Error(e)}class ne extends gr{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new ne(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Re(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ke(e,st.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?an(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function an(i){if(typeof i=="function")return i;let e;return Array.isArray(i)?e=i:(on(typeof i.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[i]),function(){return e}}const C={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function j(i,e,t){let r,n;return e<i[0]?r=i[0]-e:i[2]<e?r=e-i[2]:r=0,t<i[1]?n=i[1]-t:i[3]<t?n=t-i[3]:n=0,r*r+n*n}function fr(i,e,t){return i[0]<=e&&e<=i[2]&&i[1]<=t&&t<=i[3]}function br(i,e){const t=i[0],r=i[1],n=i[2],o=i[3],a=e[0],s=e[1];let l=C.UNKNOWN;return a<t?l=l|C.LEFT:a>n&&(l=l|C.RIGHT),s<r?l=l|C.BELOW:s>o&&(l=l|C.ABOVE),l===C.UNKNOWN&&(l=C.INTERSECTING),l}function lt(){return[1/0,1/0,-1/0,-1/0]}function yr(i,e,t,r,n){return n?(n[0]=i,n[1]=e,n[2]=t,n[3]=r,n):[i,e,t,r]}function ct(i){return yr(1/0,1/0,-1/0,-1/0,i)}function vr(i,e){const t=i[0],r=i[1];return yr(t,r,t,r,e)}function dt(i,e,t,r,n){const o=ct(n);return kr(o,i,e,t,r)}function sn(i,e){return e[0]<i[0]&&(i[0]=e[0]),e[2]>i[2]&&(i[2]=e[2]),e[1]<i[1]&&(i[1]=e[1]),e[3]>i[3]&&(i[3]=e[3]),i}function kr(i,e,t,r,n){for(;t<r;t+=n)ln(i,e[t],e[t+1]);return i}function ln(i,e,t){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}function cn(i,e){let t;return t=e(dn(i)),t||(t=e(un(i)),t)||(t=e(mn(i)),t)||(t=e(hn(i)),t)?t:!1}function dn(i){return[i[0],i[1]]}function un(i){return[i[2],i[1]]}function Te(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Oe(i){return i[3]-i[1]}function hn(i){return[i[0],i[3]]}function mn(i){return[i[2],i[3]]}function pn(i,e){return i[0]<=e[2]&&i[2]>=e[0]&&i[1]<=e[3]&&i[3]>=e[1]}function gn(i,e){return e?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e):i}function fn(i,e,t){let r=!1;const n=br(i,e),o=br(i,t);if(n===C.INTERSECTING||o===C.INTERSECTING)r=!0;else{const a=i[0],s=i[1],l=i[2],c=i[3],d=e[0],u=e[1],h=t[0],m=t[1],p=(m-u)/(h-d);let g,b;o&C.ABOVE&&!(n&C.ABOVE)&&(g=h-(m-c)/p,r=g>=a&&g<=l),!r&&o&C.RIGHT&&!(n&C.RIGHT)&&(b=m-(h-l)*p,r=b>=s&&b<=c),!r&&o&C.BELOW&&!(n&C.BELOW)&&(g=h-(m-s)/p,r=g>=a&&g<=l),!r&&o&C.LEFT&&!(n&C.LEFT)&&(b=m-(h-a)*p,r=b>=s&&b<=c)}return r}function bn(i,e,t,r,n,o){const a=n-t,s=o-r;if(a!==0||s!==0){const l=((i-t)*a+(e-r)*s)/(a*a+s*s);l>1?(t=n,r=o):l>0&&(t+=a*l,r+=s*l)}return V(i,e,t,r)}function V(i,e,t,r){const n=t-i,o=r-e;return n*n+o*o}function xr(i){return i*180/Math.PI}function He(i){return i*Math.PI/180}function ut(i,e,t){return i+t*(e-i)}function ht(i,e,t){if(i>=e&&i<t)return i;const r=t-e;return((i-e)%r+r)%r+e}const yn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class mt{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||yn[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const xe=6378137,oe=Math.PI*xe,vn=[-oe,-oe,oe,oe],kn=[-180,-85,180,85],je=xe*Math.log(Math.tan(Math.PI/2));class ae extends mt{constructor(e){super({code:e,units:"m",extent:vn,global:!0,worldExtent:kn,getPointResolution:function(t,r){return t/Math.cosh(r[1]/xe)}})}}const _r=[new ae("EPSG:3857"),new ae("EPSG:102100"),new ae("EPSG:102113"),new ae("EPSG:900913"),new ae("http://www.opengis.net/def/crs/EPSG/0/3857"),new ae("http://www.opengis.net/gml/srs/epsg.xml#3857")];function xn(i,e,t,r){const n=i.length;t=t>1?t:2,r=r??t,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let o=0;o<n;o+=r){e[o]=oe*i[o]/180;let a=xe*Math.log(Math.tan(Math.PI*(+i[o+1]+90)/360));a>je?a=je:a<-je&&(a=-je),e[o+1]=a}return e}function _n(i,e,t,r){const n=i.length;t=t>1?t:2,r=r??t,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let o=0;o<n;o+=r)e[o]=180*i[o]/oe,e[o+1]=360*Math.atan(Math.exp(i[o+1]/xe))/Math.PI-90;return e}const wn=6378137,wr=[-180,-90,180,90],zn=Math.PI*wn/180;class U extends mt{constructor(e,t){super({code:e,units:"degrees",extent:wr,axisOrientation:t,global:!0,metersPerUnit:zn,worldExtent:wr})}}const zr=[new U("CRS:84"),new U("EPSG:4326","neu"),new U("urn:ogc:def:crs:OGC:1.3:CRS84"),new U("urn:ogc:def:crs:OGC:2:84"),new U("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new U("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new U("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let pt={};function Cn(i){return pt[i]||pt[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Sn(i,e){pt[i]=e}let se={};function _e(i,e,t){const r=i.getCode(),n=e.getCode();r in se||(se[r]={}),se[r][n]=t}function gt(i,e){return i in se&&e in se[i]?se[i][e]:null}const Ve=.9996,P=.00669438,Ue=P*P,Ye=Ue*P,Y=P/(1-P),Cr=Math.sqrt(1-P),le=(1-Cr)/(1+Cr),Sr=le*le,ft=Sr*le,bt=ft*le,Mr=bt*le,Pr=1-P/4-3*Ue/64-5*Ye/256,Mn=3*P/8+3*Ue/32+45*Ye/1024,Pn=15*Ue/256+45*Ye/1024,$n=35*Ye/3072,En=3/2*le-27/32*ft+269/512*Mr,An=21/16*Sr-55/32*bt,Fn=151/96*ft-417/128*Mr,Ln=1097/512*bt,Xe=6378137;function Gn(i,e,t){const r=i-5e5,a=(t.north?e:e-1e7)/Ve/(Xe*Pr),s=a+En*Math.sin(2*a)+An*Math.sin(4*a)+Fn*Math.sin(6*a)+Ln*Math.sin(8*a),l=Math.sin(s),c=l*l,d=Math.cos(s),u=l/d,h=u*u,m=h*h,p=1-P*c,g=Math.sqrt(1-P*c),b=Xe/g,S=(1-P)/p,x=Y*d**2,F=x*x,M=r/(b*Ve),Q=M*M,Le=Q*M,pi=Le*M,gi=pi*M,aa=gi*M,sa=s-u/S*(Q/2-pi/24*(5+3*h+10*x-4*F-9*Y))+aa/720*(61+90*h+298*x+45*m-252*Y-3*F);let Vt=(M-Le/6*(1+2*h+x)+gi/120*(5-2*x+28*h-3*F+8*Y+24*m))/d;return Vt=ht(Vt+He(Ar(t.number)),-Math.PI,Math.PI),[xr(Vt),xr(sa)]}const $r=-80,Er=84,In=-180,Rn=180;function Nn(i,e,t){i=ht(i,In,Rn),e<$r?e=$r:e>Er&&(e=Er);const r=He(e),n=Math.sin(r),o=Math.cos(r),a=n/o,s=a*a,l=s*s,c=He(i),d=Ar(t.number),u=He(d),h=Xe/Math.sqrt(1-P*n**2),m=Y*o**2,p=o*ht(c-u,-Math.PI,Math.PI),g=p*p,b=g*p,S=b*p,x=S*p,F=x*p,M=Xe*(Pr*r-Mn*Math.sin(2*r)+Pn*Math.sin(4*r)-$n*Math.sin(6*r)),Q=Ve*h*(p+b/6*(1-s+m)+x/120*(5-18*s+l+72*m-58*Y))+5e5;let Le=Ve*(M+h*a*(g/2+S/24*(5-s+9*m+4*m**2)+F/720*(61-58*s+l+600*m-330*Y)));return t.north||(Le+=1e7),[Q,Le]}function Ar(i){return(i-1)*6-180+3}const Tn=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Fr(i){let e=0;for(const n of Tn){const o=i.match(n);if(o){e=parseInt(o[1]);break}}if(!e)return null;let t=0,r=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(r=!0,t=e-32600),t?{number:t,north:r}:null}function Lr(i,e){return function(t,r,n,o){const a=t.length;n=n>1?n:2,o=o??n,r||(n>2?r=t.slice():r=new Array(a));for(let s=0;s<a;s+=o){const l=t[s],c=t[s+1],d=i(l,c,e);r[s]=d[0],r[s+1]=d[1]}return r}}function On(i){return Fr(i)?new mt({code:i,units:"m"}):null}function Hn(i){const e=Fr(i.getCode());return e?{forward:Lr(Nn,e),inverse:Lr(Gn,e)}:null}const jn=[Hn],Vn=[On];function yt(i,e){if(e!==void 0){for(let t=0,r=i.length;t<r;++t)e[t]=i[t];e=e}else e=i.slice();return e}function vt(i){Sn(i.getCode(),i),_e(i,i,yt)}function Un(i){i.forEach(vt)}function $(i){if(typeof i!="string")return i;const e=Cn(i);if(e)return e;for(const t of Vn){const r=t(i);if(r)return r}return null}function Gr(i){Un(i),i.forEach(function(e){i.forEach(function(t){e!==t&&_e(e,t,yt)})})}function Yn(i,e,t,r){i.forEach(function(n){e.forEach(function(o){_e(n,o,t),_e(o,n,r)})})}function Xn(i,e){if(i===e)return!0;const t=i.getUnits()===e.getUnits();return(i.getCode()===e.getCode()||Ir(i,e)===yt)&&t}function Ir(i,e){const t=i.getCode(),r=e.getCode();let n=gt(t,r);if(n)return n;let o=null,a=null;for(const l of jn)o||(o=l(i)),a||(a=l(e));if(!o&&!a)return null;const s="EPSG:4326";if(a)if(o)n=kt(o.inverse,a.forward);else{const l=gt(t,s);l&&(n=kt(l,a.forward))}else{const l=gt(s,r);l&&(n=kt(o.inverse,l))}return n&&(vt(i),vt(e),_e(i,e,n)),n}function kt(i,e){return function(t,r,n,o){return r=i(t,r,n,o),e(r,r,n,o)}}function xt(i,e){const t=$(i),r=$(e);return Ir(t,r)}function Bn(){Gr(_r),Gr(zr),Yn(zr,_r,xn,_n)}Bn(),new Array(6);function Rr(){return[1,0,0,1,0,0]}function Nr(i,e,t,r,n,o,a,s){const l=Math.sin(o),c=Math.cos(o);return i[0]=r*c,i[1]=n*l,i[2]=-r*l,i[3]=n*c,i[4]=a*r*c-s*r*l+e,i[5]=a*n*l+s*n*c+t,i}function Tr(i,e,t,r,n,o,a){o=o||[],a=a||2;let s=0;for(let l=e;l<t;l+=r){const c=i[l],d=i[l+1];o[s++]=n[0]*c+n[2]*d+n[4],o[s++]=n[1]*c+n[3]*d+n[5];for(let u=2;u<a;u++)o[s++]=i[l+u]}return o&&o.length!=s&&(o.length=s),o}function qn(i,e,t,r,n,o,a){a=a||[];const s=Math.cos(n),l=Math.sin(n),c=o[0],d=o[1];let u=0;for(let h=e;h<t;h+=r){const m=i[h]-c,p=i[h+1]-d;a[u++]=c+m*s-p*l,a[u++]=d+m*l+p*s;for(let g=h+2;g<h+r;++g)a[u++]=i[g]}return a&&a.length!=u&&(a.length=u),a}function Jn(i,e,t,r,n,o,a,s){s=s||[];const l=a[0],c=a[1];let d=0;for(let u=e;u<t;u+=r){const h=i[u]-l,m=i[u+1]-c;s[d++]=l+n*h,s[d++]=c+o*m;for(let p=u+2;p<u+r;++p)s[d++]=i[p]}return s&&s.length!=d&&(s.length=d),s}function Wn(i,e,t,r,n,o,a){a=a||[];let s=0;for(let l=e;l<t;l+=r){a[s++]=i[l]+n,a[s++]=i[l+1]+o;for(let c=l+2;c<l+r;++c)a[s++]=i[c]}return a&&a.length!=s&&(a.length=s),a}const Or=Rr(),Zn=[NaN,NaN];class Hr extends gr{constructor(){super(),this.extent_=lt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=cr((e,t,r)=>{if(!r)return this.getSimplifiedGeometry(t);const n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return f()}closestPointXY(e,t,r,n){return f()}containsXY(e,t){return this.closestPointXY(e,t,Zn,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return f()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&ct(t),this.extentRevision_=this.getRevision()}return gn(this.extent_,e)}rotate(e,t){f()}scale(e,t,r){f()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return f()}getType(){return f()}applyTransform(e){f()}intersectsExtent(e){return f()}translate(e,t){f()}transform(e,t){const r=$(e),n=r.getUnits()=="tile-pixels"?function(o,a,s){const l=r.getExtent(),c=r.getWorldExtent(),d=Oe(c)/Oe(l);Nr(Or,c[0],c[3],d,-d,0,0,0);const u=Tr(o,0,o.length,s,Or,a),h=xt(r,t);return h?h(u,u,s):u}:xt(r,t);return this.applyTransform(n),this}}class X extends Hr{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return f()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=jr(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){f()}setLayout(e,t,r){let n;if(e)n=jr(e);else{for(let o=0;o<r;++o){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}n=t.length,e=B(n)}this.layout=e,this.stride=n}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const r=this.getFlatCoordinates();if(r){const n=this.getStride();qn(r,0,r.length,n,e,t,r),this.changed()}}scale(e,t,r){t===void 0&&(t=e),r||(r=Te(this.getExtent()));const n=this.getFlatCoordinates();if(n){const o=this.getStride();Jn(n,0,n.length,o,e,t,r,n),this.changed()}}translate(e,t){const r=this.getFlatCoordinates();if(r){const n=this.getStride();Wn(r,0,r.length,n,e,t,r),this.changed()}}}function B(i){let e;return i==2?e="XY":i==3?e="XYZ":i==4&&(e="XYZM"),e}function jr(i){let e;return i=="XY"?e=2:i=="XYZ"||i=="XYM"?e=3:i=="XYZM"&&(e=4),e}function Kn(i,e,t,r){for(let n=0,o=t.length;n<o;++n)i[e++]=t[n];return e}function Be(i,e,t,r){for(let n=0,o=t.length;n<o;++n){const a=t[n];for(let s=0;s<r;++s)i[e++]=a[s]}return e}function we(i,e,t,r,n){n=n||[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=Be(i,e,t[a],r);n[o++]=l,e=l}return n.length=o,n}function Vr(i,e,t,r,n){n=n||[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=we(i,e,t[a],r,n[o]);l.length===0&&(l[0]=e),n[o++]=l,e=l[l.length-1]}return n.length=o,n}function Ur(i,e,t,r){const n=[];let o=lt();for(let a=0,s=t.length;a<s;++a){const l=t[a];o=dt(i,e,l[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return n}function Dn(i,e,t,r,n){return!cn(n,function(a){return!q(i,e,t,r,a[0],a[1])})}function q(i,e,t,r,n,o){let a=0,s=i[t-r],l=i[t-r+1];for(;e<t;e+=r){const c=i[e],d=i[e+1];l<=o?d>o&&(c-s)*(o-l)-(n-s)*(d-l)>0&&a++:d<=o&&(c-s)*(o-l)-(n-s)*(d-l)<0&&a--,s=c,l=d}return a!==0}function _t(i,e,t,r,n,o){if(t.length===0||!q(i,e,t[0],r,n,o))return!1;for(let a=1,s=t.length;a<s;++a)if(q(i,t[a-1],t[a],r,n,o))return!1;return!0}function Qn(i,e,t,r,n,o){if(t.length===0)return!1;for(let a=0,s=t.length;a<s;++a){const l=t[a];if(_t(i,e,l,r,n,o))return!0;e=l[l.length-1]}return!1}function wt(i,e,t,r,n,o,a){let s,l,c,d,u,h,m;const p=n[o+1],g=[];for(let x=0,F=t.length;x<F;++x){const M=t[x];for(d=i[M-r],h=i[M-r+1],s=e;s<M;s+=r)u=i[s],m=i[s+1],(p<=h&&m<=p||h<=p&&p<=m)&&(c=(p-h)/(m-h)*(u-d)+d,g.push(c)),d=u,h=m}let b=NaN,S=-1/0;for(g.sort(sr),d=g[0],s=1,l=g.length;s<l;++s){u=g[s];const x=Math.abs(u-d);x>S&&(c=(d+u)/2,_t(i,e,t,r,c,p)&&(b=c,S=x)),d=u}return isNaN(b)&&(b=n[o]),a?(a.push(b,p,S),a):[b,p,S]}function Yr(i,e,t,r,n){let o=[];for(let a=0,s=t.length;a<s;++a){const l=t[a];o=wt(i,e,l,r,n,2*a,o),e=l[l.length-1]}return o}function qe(i,e,t,r,n,o,a){let s,l;const c=(t-e)/r;if(c===1)s=e;else if(c===2)s=e,l=n;else if(c!==0){let d=i[e],u=i[e+1],h=0;const m=[0];for(let b=e+r;b<t;b+=r){const S=i[b],x=i[b+1];h+=Math.sqrt((S-d)*(S-d)+(x-u)*(x-u)),m.push(h),d=S,u=x}const p=n*h,g=Di(m,p);g<0?(l=(p-m[-g-2])/(m[-g-1]-m[-g-2]),s=e+(-g-2)*r):s=e+g*r}a=a>1?a:2,o=o||new Array(a);for(let d=0;d<a;++d)o[d]=s===void 0?NaN:l===void 0?i[s+d]:ut(i[s+d],i[s+r+d],l);return o}function zt(i,e,t,r,n,o){if(t==e)return null;let a;if(n<i[e+r-1])return o?(a=i.slice(e,e+r),a[r-1]=n,a):null;if(i[t-1]<n)return o?(a=i.slice(t-r,t),a[r-1]=n,a):null;if(n==i[e+r-1])return i.slice(e,e+r);let s=e/r,l=t/r;for(;s<l;){const h=s+l>>1;n<i[(h+1)*r-1]?l=h:s=h+1}const c=i[s*r-1];if(n==c)return i.slice((s-1)*r,(s-1)*r+r);const d=i[(s+1)*r-1],u=(n-c)/(d-c);a=[];for(let h=0;h<r-1;++h)a.push(ut(i[(s-1)*r+h],i[s*r+h],u));return a.push(n),a}function eo(i,e,t,r,n,o,a){if(a)return zt(i,e,t[t.length-1],r,n,o);let s;if(n<i[r-1])return o?(s=i.slice(0,r),s[r-1]=n,s):null;if(i[i.length-1]<n)return o?(s=i.slice(i.length-r),s[r-1]=n,s):null;for(let l=0,c=t.length;l<c;++l){const d=t[l];if(e!=d){if(n<i[e+r-1])return null;if(n<=i[d-1])return zt(i,e,d,r,n,!1);e=d}}return null}function to(i,e,t,r){for(;e<t-r;){for(let n=0;n<r;++n){const o=i[e+n];i[e+n]=i[t-r+n],i[t-r+n]=o}e+=r,t-=r}}function Ct(i,e,t,r){let n=0,o=i[t-r],a=i[t-r+1];for(;e<t;e+=r){const s=i[e],l=i[e+1];n+=(s-o)*(l+a),o=s,a=l}return n===0?void 0:n>0}function St(i,e,t,r,n){n=n!==void 0?n:!1;for(let o=0,a=t.length;o<a;++o){const s=t[o],l=Ct(i,e,s,r);if(o===0){if(n&&l||!n&&!l)return!1}else if(n&&!l||!n&&l)return!1;e=s}return!0}function Xr(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];if(!St(i,e,s,r,n))return!1;s.length&&(e=s[s.length-1])}return!0}function Je(i,e,t,r,n){n=n!==void 0?n:!1;for(let o=0,a=t.length;o<a;++o){const s=t[o],l=Ct(i,e,s,r);(o===0?n&&l||!n&&!l:n&&!l||!n&&l)&&to(i,e,s,r),e=s}return e}function Mt(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o)e=Je(i,e,t[o],r,n);return e}function ro(i,e){const t=[];let r=0,n=0,o;for(let a=0,s=e.length;a<s;++a){const l=e[a],c=Ct(i,r,l,2);if(o===void 0&&(o=c),c===o)t.push(e.slice(n,a+1));else{if(t.length===0)continue;t[t.length-1].push(e[n])}n=a+1,r=l}return t}function We(i,e,t,r,n,o,a){const s=(t-e)/r;if(s<3){for(;e<t;e+=r)o[a++]=i[e],o[a++]=i[e+1];return a}const l=new Array(s);l[0]=1,l[s-1]=1;const c=[e,t-r];let d=0;for(;c.length>0;){const u=c.pop(),h=c.pop();let m=0;const p=i[h],g=i[h+1],b=i[u],S=i[u+1];for(let x=h+r;x<u;x+=r){const F=i[x],M=i[x+1],Q=bn(F,M,p,g,b,S);Q>m&&(d=x,m=Q)}m>n&&(l[(d-e)/r]=1,h+r<d&&c.push(h,d),d+r<u&&c.push(d,u))}for(let u=0;u<s;++u)l[u]&&(o[a++]=i[e+u*r],o[a++]=i[e+u*r+1]);return a}function Br(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l];a=We(i,e,d,r,n,o,a),s.push(a),e=d}return a}function ce(i,e){return e*Math.round(i/e)}function io(i,e,t,r,n,o,a){if(e==t)return a;let s=ce(i[e],n),l=ce(i[e+1],n);e+=r,o[a++]=s,o[a++]=l;let c,d;do if(c=ce(i[e],n),d=ce(i[e+1],n),e+=r,e==t)return o[a++]=c,o[a++]=d,a;while(c==s&&d==l);for(;e<t;){const u=ce(i[e],n),h=ce(i[e+1],n);if(e+=r,u==c&&h==d)continue;const m=c-s,p=d-l,g=u-s,b=h-l;if(m*b==p*g&&(m<0&&g<m||m==g||m>0&&g>m)&&(p<0&&b<p||p==b||p>0&&b>p)){c=u,d=h;continue}o[a++]=c,o[a++]=d,s=c,l=d,c=u,d=h}return o[a++]=c,o[a++]=d,a}function Pt(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l];a=io(i,e,d,r,n,o,a),s.push(a),e=d}return a}function no(i,e,t,r,n,o,a,s){for(let l=0,c=t.length;l<c;++l){const d=t[l],u=[];a=Pt(i,e,d,r,n,o,a,u),s.push(u),e=d[d.length-1]}return a}class J extends Hr{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Re),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,r=e.length;t<r;++t)this.changeEventsKeys_.push(ke(e[t],st.CHANGE,this.changed,this))}clone(){const e=new J($t(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,r,n){if(n<j(this.getExtent(),e,t))return n;const o=this.geometries_;for(let a=0,s=o.length;a<s;++a)n=o[a].closestPointXY(e,t,r,n);return n}containsXY(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)if(r[n].containsXY(e,t))return!0;return!1}computeExtent(e){ct(e);const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)sn(e,t[r].getExtent());return e}getGeometries(){return $t(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],r=this.geometries_;let n=!1;for(let o=0,a=r.length;o<a;++o){const s=r[o],l=s.getSimplifiedGeometry(e);t.push(l),l!==s&&(n=!0)}return n?new J(t):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)if(t[r].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)r[n].rotate(e,t);this.changed()}scale(e,t,r){r||(r=Te(this.getExtent()));const n=this.geometries_;for(let o=0,a=n.length;o<a;++o)n[o].scale(e,t,r);this.changed()}setGeometries(e){this.setGeometriesArray($t(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let r=0,n=t.length;r<n;++r)t[r].applyTransform(e);this.changed()}translate(e,t){const r=this.geometries_;for(let n=0,o=r.length;n<o;++n)r[n].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function $t(i){return i.map(e=>e.clone())}function qr(i,e,t,r){let n=0;const o=i[t-r],a=i[t-r+1];let s=0,l=0;for(;e<t;e+=r){const c=i[e]-o,d=i[e+1]-a;n+=l*c-s*d,s=c,l=d}return n/2}function Jr(i,e,t,r){let n=0;for(let o=0,a=t.length;o<a;++o){const s=t[o];n+=qr(i,e,s,r),e=s}return n}function oo(i,e,t,r){let n=0;for(let o=0,a=t.length;o<a;++o){const s=t[o];n+=Jr(i,e,s,r),e=s[s.length-1]}return n}function Wr(i,e,t,r,n,o,a){const s=i[e],l=i[e+1],c=i[t]-s,d=i[t+1]-l;let u;if(c===0&&d===0)u=e;else{const h=((n-s)*c+(o-l)*d)/(c*c+d*d);if(h>1)u=t;else if(h>0){for(let m=0;m<r;++m)a[m]=ut(i[e+m],i[t+m],h);a.length=r;return}else u=e}for(let h=0;h<r;++h)a[h]=i[u+h];a.length=r}function Et(i,e,t,r,n){let o=i[e],a=i[e+1];for(e+=r;e<t;e+=r){const s=i[e],l=i[e+1],c=V(o,a,s,l);c>n&&(n=c),o=s,a=l}return n}function At(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];n=Et(i,e,s,r,n),e=s}return n}function ao(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];n=At(i,e,s,r,n),e=s[s.length-1]}return n}function Ft(i,e,t,r,n,o,a,s,l,c,d){if(e==t)return c;let u,h;if(n===0){if(h=V(a,s,i[e],i[e+1]),h<c){for(u=0;u<r;++u)l[u]=i[e+u];return l.length=r,h}return c}d=d||[NaN,NaN];let m=e+r;for(;m<t;)if(Wr(i,m-r,m,r,a,s,d),h=V(a,s,d[0],d[1]),h<c){for(c=h,u=0;u<r;++u)l[u]=d[u];l.length=r,m+=r}else m+=r*Math.max((Math.sqrt(h)-Math.sqrt(c))/n|0,1);if(o&&(Wr(i,t-r,e,r,a,s,d),h=V(a,s,d[0],d[1]),h<c)){for(c=h,u=0;u<r;++u)l[u]=d[u];l.length=r}return c}function Lt(i,e,t,r,n,o,a,s,l,c,d){d=d||[NaN,NaN];for(let u=0,h=t.length;u<h;++u){const m=t[u];c=Ft(i,e,m,r,n,o,a,s,l,c,d),e=m}return c}function so(i,e,t,r,n,o,a,s,l,c,d){d=d||[NaN,NaN];for(let u=0,h=t.length;u<h;++u){const m=t[u];c=Lt(i,e,m,r,n,o,a,s,l,c,d),e=m[m.length-1]}return c}function Ze(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=e;a<t;a+=r)n[o++]=i.slice(a,a+r);return n.length=o,n}function Gt(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a];n[o++]=Ze(i,e,l,r,n[o]),e=l}return n.length=o,n}function lo(i,e,t,r,n){n=n!==void 0?n:[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a];n[o++]=l.length===1&&l[0]===e?[]:Gt(i,e,l,r,n[o]),e=l[l.length-1]}return n.length=o,n}class ze extends X{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new ze(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Et(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,r,n))}getArea(){return qr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=We(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new ze(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}function Zr(i,e,t,r,n){let o;for(e+=r;e<t;e+=r)if(o=n(i.slice(e-r,e),i.slice(e,e+r)),o)return o;return!1}function Ke(i,e,t,r,n,o){return o=o??kr(lt(),i,e,t,r),pn(n,o)?o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Zr(i,e,t,r,function(a,s){return fn(n,a,s)}):!1}function co(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){if(Ke(i,e,t[o],r,n))return!0;e=t[o]}return!1}function uo(i,e,t,r,n){return!!(Ke(i,e,t,r,n)||q(i,e,t,r,n[0],n[1])||q(i,e,t,r,n[0],n[3])||q(i,e,t,r,n[2],n[1])||q(i,e,t,r,n[2],n[3]))}function Kr(i,e,t,r,n){if(!uo(i,e,t[0],r,n))return!1;if(t.length===1)return!0;for(let o=1,a=t.length;o<a;++o)if(Dn(i,t[o-1],t[o],r,n)&&!Ke(i,t[o-1],t[o],r,n))return!1;return!0}function ho(i,e,t,r,n){for(let o=0,a=t.length;o<a;++o){const s=t[o];if(Kr(i,e,s,r,n))return!0;e=s[s.length-1]}return!1}function mo(i,e,t,r){let n=i[e],o=i[e+1],a=0;for(let s=e+r;s<t;s+=r){const l=i[s],c=i[s+1];a+=Math.sqrt((l-n)*(l-n)+(c-o)*(c-o)),n=l,o=c}return a}class W extends X{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){A(this.flatCoordinates,e),this.changed()}clone(){const e=new W(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Et(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,r,n))}forEachSegment(e){return Zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!="XYM"&&this.layout!="XYZM"?null:(t=t!==void 0?t:!1,zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return mo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=We(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new W(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return Ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}class Ce extends X{constructor(e,t,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&r)this.setFlatCoordinates(t,e),this.ends_=r;else{const n=e,o=[],a=[];for(let l=0,c=n.length;l<c;++l){const d=n[l];A(o,d.getFlatCoordinates()),a.push(o.length)}const s=n.length===0?this.getLayout():n[0].getLayout();this.setFlatCoordinates(s,o),this.ends_=a}}appendLineString(e){A(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Ce(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(At(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lt(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,r,n))}getCoordinateAtM(e,t,r){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(t=t!==void 0?t:!1,r=r!==void 0?r:!1,eo(this.flatCoordinates,0,this.ends_,this.stride,e,t,r))}getCoordinates(){return Gt(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new W(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,r=this.layout,n=[];let o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a],c=new W(e.slice(o,l),r);n.push(c),o=l}return n}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let r=0;const n=this.ends_,o=this.stride;for(let a=0,s=n.length;a<s;++a){const l=n[a],c=qe(t,r,l,o,.5);A(e,c),r=l}return e}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=Br(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,r),new Ce(t,"XY",r)}getType(){return"MultiLineString"}intersectsExtent(e){return co(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=we(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Z extends X{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new Z(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){const o=this.flatCoordinates,a=V(e,t,o[0],o[1]);if(a<n){const s=this.stride;for(let l=0;l<s;++l)r[l]=o[l];return r.length=s,a}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return vr(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return fr(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Kn(this.flatCoordinates,0,e,this.stride),this.changed()}}class Se extends X{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){A(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new Se(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,n){if(n<j(this.getExtent(),e,t))return n;const o=this.flatCoordinates,a=this.stride;for(let s=0,l=o.length;s<l;s+=a){const c=V(e,t,o[s],o[s+1]);if(c<n){n=c;for(let d=0;d<a;++d)r[d]=o[s+d];r.length=a}}return n}getCoordinates(){return Ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new Z(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,r=this.stride,n=[];for(let o=0,a=e.length;o<a;o+=r){const s=new Z(e.slice(o,o+r),t);n.push(s)}return n}getType(){return"MultiPoint"}intersectsExtent(e){const t=this.flatCoordinates,r=this.stride;for(let n=0,o=t.length;n<o;n+=r){const a=t[n],s=t[n+1];if(fr(e,a,s))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Be(this.flatCoordinates,0,e,this.stride),this.changed()}}class K extends X{constructor(e,t,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&r?(this.setFlatCoordinates(t,e),this.ends_=r):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?A(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new K(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(At(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lt(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,r,n))}containsXY(e,t){return _t(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Jr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Je(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,Gt(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=Te(this.getExtent());this.flatInteriorPoint_=wt(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Z(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new ze(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,r=this.ends_,n=[];let o=0;for(let a=0,s=r.length;a<s;++a){const l=r[a],c=new ze(t.slice(o,l),e);n.push(c),o=l}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;St(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Je(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=Pt(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,r),new K(t,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return Kr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=we(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Me extends X{constructor(e,t,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){const n=e,o=[],a=[];for(let s=0,l=n.length;s<l;++s){const c=n[s],d=o.length,u=c.getEnds();for(let h=0,m=u.length;h<m;++h)u[h]+=d;A(o,c.getFlatCoordinates()),a.push(u)}t=n.length===0?this.getLayout():n[0].getLayout(),e=o,r=a}t!==void 0&&r?(this.setFlatCoordinates(t,e),this.endss_=r):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const r=this.flatCoordinates.length;A(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let n=0,o=t.length;n<o;++n)t[n]+=r}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let n=0;n<e;++n)t[n]=this.endss_[n].slice();const r=new Me(this.flatCoordinates.slice(),this.layout,t);return r.applyProperties(this),r}closestPointXY(e,t,r,n){return n<j(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ao(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,r,n))}containsXY(e,t){return Qn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return oo(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Mt(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,lo(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=Ur(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Yr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Se(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Xr(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Mt(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],r=[];return t.length=no(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,r),new Me(t,"XY",r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const o=this.endss_[e-1];t=o[o.length-1]}const r=this.endss_[e].slice(),n=r[r.length-1];if(t!==0)for(let o=0,a=r.length;o<a;++o)r[o]-=t;return new K(this.flatCoordinates.slice(t,n),this.layout,r)}getPolygons(){const e=this.layout,t=this.flatCoordinates,r=this.endss_,n=[];let o=0;for(let a=0,s=r.length;a<s;++a){const l=r[a].slice(),c=l[l.length-1];if(o!==0)for(let u=0,h=l.length;u<h;++u)l[u]-=o;const d=new K(t.slice(o,c),e,l);n.push(d),o=c}return n}getType(){return"MultiPolygon"}intersectsExtent(e){return ho(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const r=Vr(this.flatCoordinates,0,e,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{const n=r[r.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const Dr=Rr();class D{constructor(e,t,r,n,o,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r||null,this.properties_=o,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?vr(this.flatCoordinates_):dt(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=Te(this.getExtent());this.flatInteriorPoints_=wt(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=ro(this.flatCoordinates_,this.ends_),t=Ur(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Yr(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=qe(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const r=this.ends_;for(let n=0,o=r.length;n<o;++n){const a=r[n],s=qe(e,t,a,2,.5);A(this.flatMidpoints_,s),t=a}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=$(e);const t=e.getExtent(),r=e.getWorldExtent();if(t&&r){const n=Oe(r)/Oe(t);Nr(Dr,r[0],r[3],n,-n,0,0,0),Tr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Dr,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new D(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=cr((e,t)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),t&&this.simplifiedGeometry_.applyTransform(t);const r=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":r.length=We(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,r,0),n=[r.length];break;case"MultiLineString":n=[],r.length=Br(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,r,0,n);break;case"Polygon":n=[],r.length=Pt(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),r,0,n);break}return n&&(this.simplifiedGeometry_=new D(this.type_,r,n,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}D.prototype.getFlatCoordinates=D.prototype.getOrientedFlatCoordinates;class Qr{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ne,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let r=t.dataProjection?$(t.dataProjection):this.readProjection(e);t.extent&&r&&r.getUnits()==="tile-pixels"&&(r=$(r),r.setWorldExtent(t.extent)),t={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return f()}readFeature(e,t){return f()}readFeatures(e,t){return f()}readGeometry(e,t){return f()}readProjection(e){return f()}writeFeature(e,t){return f()}writeFeatures(e,t){return f()}writeGeometry(e,t){return f()}}function Pe(i,e,t){const r=t?$(t.featureProjection):null,n=t?$(t.dataProjection):null;let o=i;if(r&&n&&!Xn(r,n)){e&&(o=i.clone());const a=e?r:n,s=e?n:r;a.getUnits()==="tile-pixels"?o.transform(a,s):o.applyTransform(xt(a,s))}if(e&&t&&t.decimals!==void 0){const a=Math.pow(10,t.decimals),s=function(l){for(let c=0,d=l.length;c<d;++c)l[c]=Math.round(l[c]*a)/a;return l};o===i&&(o=i.clone()),o.applyTransform(s)}return o}const po={Point:Z,LineString:W,Polygon:K,MultiPoint:Se,MultiLineString:Ce,MultiPolygon:Me};function go(i,e,t){return Array.isArray(e[0])?(Xr(i,0,e,t)||(i=i.slice(),Mt(i,0,e,t)),i):(St(i,0,e,t)||(i=i.slice(),Je(i,0,e,t)),i)}function ei(i,e){var o;const t=i.geometry;if(!t)return[];if(Array.isArray(t))return t.map(a=>ei({...i,geometry:a})).flat();const r=t.type==="MultiPolygon"?"Polygon":t.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const n=t.layout.length;return Pe(new D(r,r==="Polygon"?go(t.flatCoordinates,t.ends,n):t.flatCoordinates,(o=t.ends)==null?void 0:o.flat(),n,i.properties||{},i.id).enableSimplifyTransformed(),!1,e)}function It(i,e){if(!i)return null;if(Array.isArray(i)){const r=i.map(n=>It(n,e));return new J(r)}const t=po[i.type];return Pe(new t(i.flatCoordinates,i.layout||"XY",i.ends),!1,e)}class fo extends Qr{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(De(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(De(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return f()}readFeaturesFromObject(e,t){return f()}readGeometry(e,t){return this.readGeometryFromObject(De(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return f()}readProjection(e){return this.readProjectionFromObject(De(e))}readProjectionFromObject(e){return f()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return f()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return f()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return f()}}function De(i){if(typeof i=="string"){const e=JSON.parse(i);return e||null}return i!==null?i:null}class bo extends fo{constructor(e){e=e||{},super(),this.dataProjection=$(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=$(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const n=Rt(r.geometry);if(this.featureClass===D)return ei({geometry:n,id:r.id,properties:r.properties},t);const o=new ne;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&o.setGeometryName(r.geometry_name),o.setGeometry(It(n,t)),"id"in r&&o.setId(r.id),r.properties&&o.setProperties(r.properties,!0),o}readFeaturesFromObject(e,t){const r=e;let n=null;if(r.type==="FeatureCollection"){const o=e;n=[];const a=o.features;for(let s=0,l=a.length;s<l;++s){const c=this.readFeatureFromObject(a[s],t);c&&n.push(c)}}else n=[this.readFeatureFromObject(e,t)];return n.flat()}readGeometryFromObject(e,t){return yo(e,t)}readProjectionFromObject(e){const t=e.crs;let r;if(t)if(t.type=="name")r=$(t.properties.name);else if(t.type==="EPSG")r=$("EPSG:"+t.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,t){t=this.adaptOptions(t);const r={type:"Feature",geometry:null,properties:null},n=e.getId();if(n!==void 0&&(r.id=n),!e.hasProperties())return r;const o=e.getProperties(),a=e.getGeometry();return a&&(r.geometry=Nt(a,t),delete o[e.getGeometryName()]),ur(o)||(r.properties=o),r}writeFeaturesObject(e,t){t=this.adaptOptions(t);const r=[];for(let n=0,o=e.length;n<o;++n)r.push(this.writeFeatureObject(e[n],t));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,t){return Nt(e,this.adaptOptions(t))}}function Rt(i,e){if(!i)return null;let t;switch(i.type){case"Point":{t=ko(i);break}case"LineString":{t=xo(i);break}case"Polygon":{t=Co(i);break}case"MultiPoint":{t=wo(i);break}case"MultiLineString":{t=_o(i);break}case"MultiPolygon":{t=zo(i);break}case"GeometryCollection":{t=vo(i);break}default:throw new Error("Unsupported GeoJSON type: "+i.type)}return t}function yo(i,e){const t=Rt(i);return It(t,e)}function vo(i,e){return i.geometries.map(function(r){return Rt(r)})}function ko(i){const e=i.coordinates;return{type:"Point",flatCoordinates:e,layout:B(e.length)}}function xo(i){var r;const e=i.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:B(((r=e[0])==null?void 0:r.length)||2)}}function _o(i){var o,a;const e=i.coordinates,t=((a=(o=e[0])==null?void 0:o[0])==null?void 0:a.length)||2,r=[],n=we(r,0,e,t);return{type:"MultiLineString",flatCoordinates:r,ends:n,layout:B(t)}}function wo(i){var t;const e=i.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:B(((t=e[0])==null?void 0:t.length)||2)}}function zo(i){var o,a;const e=i.coordinates,t=[],r=((a=(o=e[0])==null?void 0:o[0])==null?void 0:a[0].length)||2,n=Vr(t,0,e,r);return{type:"MultiPolygon",flatCoordinates:t,ends:n,layout:B(r)}}function Co(i){var o,a;const e=i.coordinates,t=[],r=(a=(o=e[0])==null?void 0:o[0])==null?void 0:a.length,n=we(t,0,e,r);return{type:"Polygon",flatCoordinates:t,ends:n,layout:B(r)}}function Nt(i,e){i=Pe(i,!0,e);const t=i.getType();let r;switch(t){case"Point":{r=Ao(i);break}case"LineString":{r=Mo(i);break}case"Polygon":{r=Fo(i,e);break}case"MultiPoint":{r=$o(i);break}case"MultiLineString":{r=Po(i);break}case"MultiPolygon":{r=Eo(i,e);break}case"GeometryCollection":{r=So(i,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return r}function So(i,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:i.getGeometriesArray().map(function(r){return Nt(r,e)})}}function Mo(i,e){return{type:"LineString",coordinates:i.getCoordinates()}}function Po(i,e){return{type:"MultiLineString",coordinates:i.getCoordinates()}}function $o(i,e){return{type:"MultiPoint",coordinates:i.getCoordinates()}}function Eo(i,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:i.getCoordinates(t)}}function Ao(i,e){return{type:"Point",coordinates:i.getCoordinates()}}function Fo(i,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:i.getCoordinates(t)}}const Lo=(i,e)=>new bo().writeFeaturesObject(i,e);class Go extends Qr{constructor(){super()}getType(){return"text"}readFeature(e,t){return this.readFeatureFromText(Qe(e),this.adaptOptions(t))}readFeatureFromText(e,t){return f()}readFeatures(e,t){return this.readFeaturesFromText(Qe(e),this.adaptOptions(t))}readFeaturesFromText(e,t){return f()}readGeometry(e,t){return this.readGeometryFromText(Qe(e),this.adaptOptions(t))}readGeometryFromText(e,t){return f()}readProjection(e){return this.readProjectionFromText(Qe(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,t){return this.writeFeatureText(e,this.adaptOptions(t))}writeFeatureText(e,t){return f()}writeFeatures(e,t){return this.writeFeaturesText(e,this.adaptOptions(t))}writeFeaturesText(e,t){return f()}writeGeometry(e,t){return this.writeGeometryText(e,this.adaptOptions(t))}writeGeometryText(e,t){return f()}}function Qe(i){return typeof i=="string"?i:""}const Io={POINT:Z,LINESTRING:W,POLYGON:K,MULTIPOINT:Se,MULTILINESTRING:Ce,MULTIPOLYGON:Me},ti="EMPTY",ri="Z",ii="M",Ro="ZM",y={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},No={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class To{constructor(e){this.wkt=e,this.index_=-1}isAlpha_(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}isNumeric_(e,t){return t=t!==void 0?t:!1,e>="0"&&e<="9"||e=="."&&!t}isWhiteSpace_(e){return e==" "||e==" "||e=="\r"||e==`
63
63
  `}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const e=this.nextChar_(),t=this.index_;let r=e,n;if(e=="(")n=y.LEFT_PAREN;else if(e==",")n=y.COMMA;else if(e==")")n=y.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")n=y.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))n=y.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")n=y.EOF;else throw new Error("Unexpected character: "+e)}return{position:t,value:r,type:n}}readNumber_(){let e;const t=this.index_;let r=!1,n=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(n=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!n&&(e=="e"||e=="E")||n&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(t,this.index_--))}readText_(){let e;const t=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(t,this.index_--).toUpperCase()}}class Oo{constructor(e){this.lexer_=e,this.token_={position:0,type:y.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(e){return this.token_.type==e}match(e){const t=this.isTokenType(e);return t&&this.consume_(),t}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let e="XY";const t=this.token_;if(this.isTokenType(y.TEXT)){const r=t.value;r===ri?e="XYZ":r===ii?e="XYM":r===Ro&&(e="XYZM"),e!=="XY"&&this.consume_()}return e}parseGeometryCollectionText_(){if(this.match(y.LEFT_PAREN)){const e=[];do e.push(this.parseGeometry_());while(this.match(y.COMMA));if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(y.LEFT_PAREN)){const e=this.parsePoint_();if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(y.LEFT_PAREN)){const e=this.parsePointList_();if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(y.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(y.LEFT_PAREN)){let e;if(this.token_.type==y.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(y.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(y.LEFT_PAREN)){const e=this.parsePolygonTextList_();if(this.match(y.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePoint_(){const e=[],t=this.layout_.length;for(let r=0;r<t;++r){const n=this.token_;if(this.match(y.NUMBER))e.push(n.value);else break}if(e.length==t)return e;throw new Error(this.formatErrorMessage_())}parsePointList_(){const e=[this.parsePoint_()];for(;this.match(y.COMMA);)e.push(this.parsePoint_());return e}parsePointTextList_(){const e=[this.parsePointText_()];for(;this.match(y.COMMA);)e.push(this.parsePointText_());return e}parseLineStringTextList_(){const e=[this.parseLineStringText_()];for(;this.match(y.COMMA);)e.push(this.parseLineStringText_());return e}parsePolygonTextList_(){const e=[this.parsePolygonText_()];for(;this.match(y.COMMA);)e.push(this.parsePolygonText_());return e}isEmptyGeometry_(){const e=this.isTokenType(y.TEXT)&&this.token_.value==ti;return e&&this.consume_(),e}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const e=this.token_;if(this.match(y.TEXT)){const t=e.value;this.layout_=this.parseGeometryLayout_();const r=this.isEmptyGeometry_();if(t=="GEOMETRYCOLLECTION"){if(r)return new J([]);const a=this.parseGeometryCollectionText_();return new J(a)}const n=Io[t];if(!n)throw new Error("Invalid geometry type: "+t);let o;if(r)t=="POINT"?o=[NaN,NaN]:o=[];else switch(t){case"POINT":{o=this.parsePointText_();break}case"LINESTRING":{o=this.parseLineStringText_();break}case"POLYGON":{o=this.parsePolygonText_();break}case"MULTIPOINT":{o=this.parseMultiPointText_();break}case"MULTILINESTRING":{o=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{o=this.parseMultiPolygonText_();break}}return new n(o,this.layout_)}throw new Error(this.formatErrorMessage_())}}class Ho extends Go{constructor(e){super(),e=e||{},this.splitCollection_=e.splitCollection!==void 0?e.splitCollection:!1}parse_(e){const t=new To(e);return new Oo(t).parse()}readFeatureFromText(e,t){const r=this.readGeometryFromText(e,t),n=new ne;return n.setGeometry(r),n}readFeaturesFromText(e,t){let r=[];const n=this.readGeometryFromText(e,t);this.splitCollection_&&n.getType()=="GeometryCollection"?r=n.getGeometriesArray():r=[n];const o=[];for(let a=0,s=r.length;a<s;++a){const l=new ne;l.setGeometry(r[a]),o.push(l)}return o}readGeometryFromText(e,t){const r=this.parse_(e);return Pe(r,!1,t)}writeFeatureText(e,t){const r=e.getGeometry();return r?this.writeGeometryText(r,t):""}writeFeaturesText(e,t){if(e.length==1)return this.writeFeatureText(e[0],t);const r=[];for(let o=0,a=e.length;o<a;++o)r.push(e[o].getGeometry());const n=new J(r);return this.writeGeometryText(n,t)}writeGeometryText(e,t){return ai(Pe(e,!0,t))}}function ni(i){const e=i.getCoordinates();return e.length===0?"":e.join(" ")}function jo(i){const e=[],t=i.getPoints();for(let r=0,n=t.length;r<n;++r)e.push("("+ni(t[r])+")");return e.join(",")}function Vo(i){const e=[],t=i.getGeometries();for(let r=0,n=t.length;r<n;++r)e.push(ai(t[r]));return e.join(",")}function Tt(i){const e=i.getCoordinates(),t=[];for(let r=0,n=e.length;r<n;++r)t.push(e[r].join(" "));return t.join(",")}function Uo(i){const e=[],t=i.getLineStrings();for(let r=0,n=t.length;r<n;++r)e.push("("+Tt(t[r])+")");return e.join(",")}function oi(i){const e=[],t=i.getLinearRings();for(let r=0,n=t.length;r<n;++r)e.push("("+Tt(t[r])+")");return e.join(",")}function Yo(i){const e=[],t=i.getPolygons();for(let r=0,n=t.length;r<n;++r)e.push("("+oi(t[r])+")");return e.join(",")}function Xo(i){const e=i.getLayout();let t="";return(e==="XYZ"||e==="XYZM")&&(t+=ri),(e==="XYM"||e==="XYZM")&&(t+=ii),t}const Bo={Point:ni,LineString:Tt,Polygon:oi,MultiPoint:jo,MultiLineString:Uo,MultiPolygon:Yo,GeometryCollection:Vo};function ai(i){const e=i.getType(),t=Bo[e],r=t(i);let n=No[e];if(typeof i.getFlatCoordinates=="function"){const o=Xo(i);o.length>0&&(n+=" "+o)}return r.length===0?n+" "+ti:n+"("+r+")"}const qo=(i,e)=>new Ho().writeFeatures(i,e);/**
64
64
  * @license
65
65
  * Copyright 2021 Google LLC
@@ -266,7 +266,7 @@
266
266
  letter-spacing: .0313rem;
267
267
  }
268
268
  ${t}
269
- `,document.head.appendChild(r)}},Wo=i=>{let e;return typeof i=="string"?e=document.querySelector(i):e=i,e};Jo();const Zo=`
269
+ `,document.head.appendChild(r)}},Wo=i=>{let e;if(typeof i=="string"){const t=r=>r.querySelector(i);if(e=t(document),!e){const r=document.querySelectorAll("html *");for(let n=0;n<r.length&&!(r[n].shadowRoot&&(e=t(r[n].shadowRoot),e));n++);}}else e=i;return e};Jo();const Zo=`
270
270
  ${li}
271
271
  :host {
272
272
  --padding: 0.5rem;
@@ -318,4 +318,4 @@
318
318
  .unstyled=${this.unstyled}
319
319
  @changed=${()=>{this.updateGeoJSON(),this.requestUpdate()}}
320
320
  ></eox-drawtools-list>`:w}
321
- `}}de=new WeakMap,ue=new WeakMap,Ae=new WeakMap,he=new WeakMap,Fe=new WeakMap,customElements.define("eox-drawtools",hi),x.EOxDrawTools=hi,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
321
+ `}}de=new WeakMap,ue=new WeakMap,Ae=new WeakMap,he=new WeakMap,Fe=new WeakMap,customElements.define("eox-drawtools",hi),k.EOxDrawTools=hi,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/drawtools",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/map": "*",
@@ -34,7 +34,7 @@
34
34
  "watch": "vite build --watch"
35
35
  },
36
36
  "dependencies": {
37
- "@eox/elements-utils": "^1.0.0",
37
+ "@eox/elements-utils": "^1.1.0",
38
38
  "@eox/ui": "^0.3.6",
39
39
  "lit": "^3.2.0",
40
40
  "ol": "^10.4.0"