var ni = Object.defineProperty;
var oi = (i, e, t) => e in i ? ni(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var Xe = (i, e, t) => (oi(i, typeof e != "symbol" ? e + "" : e, t), t), ct = (i, e, t) => {
  if (!e.has(i))
    throw TypeError("Cannot " + t);
};
var ie = (i, e, t) => (ct(i, e, "read from private field"), t ? t.call(i) : e.get(i)), ut = (i, e, t) => {
  if (e.has(i))
    throw TypeError("Cannot add the same private member more than once");
  e instanceof WeakSet ? e.add(i) : e.set(i, t);
}, dt = (i, e, t, r) => (ct(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t);
function U() {
}
function si(i, e) {
  for (const t in e)
    i[t] = e[t];
  return (
    /** @type {T & S} */
    i
  );
}
function Mt(i) {
  return i();
}
function ft() {
  return /* @__PURE__ */ Object.create(null);
}
function oe(i) {
  i.forEach(Mt);
}
function It(i) {
  return typeof i == "function";
}
function ge(i, e) {
  return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function";
}
let Ae;
function Q(i, e) {
  return i === e ? !0 : (Ae || (Ae = document.createElement("a")), Ae.href = e, i === Ae.href);
}
function ai(i) {
  return Object.keys(i).length === 0;
}
function li(i, e, t, r) {
  if (i) {
    const n = Ot(i, e, t, r);
    return i[0](n);
  }
}
function Ot(i, e, t, r) {
  return i[1] && r ? si(t.ctx.slice(), i[1](r(e))) : t.ctx;
}
function ci(i, e, t, r) {
  if (i[2] && r) {
    const n = i[2](r(t));
    if (e.dirty === void 0)
      return n;
    if (typeof n == "object") {
      const l = [], o = Math.max(e.dirty.length, n.length);
      for (let a = 0; a < o; a += 1)
        l[a] = e.dirty[a] | n[a];
      return l;
    }
    return e.dirty | n;
  }
  return e.dirty;
}
function ui(i, e, t, r, n, l) {
  if (n) {
    const o = Ot(e, t, r, l);
    i.p(o, n);
  }
}
function di(i) {
  if (i.ctx.length > 32) {
    const e = [], t = i.ctx.length / 32;
    for (let r = 0; r < t; r++)
      e[r] = -1;
    return e;
  }
  return -1;
}
function mt(i) {
  return i ?? "";
}
function C(i, e) {
  i.appendChild(e);
}
function B(i, e, t) {
  i.insertBefore(e, t || null);
}
function D(i) {
  i.parentNode && i.parentNode.removeChild(i);
}
function I(i) {
  return document.createElement(i);
}
function le(i) {
  return document.createElementNS("http://www.w3.org/2000/svg", i);
}
function ce(i) {
  return document.createTextNode(i);
}
function K() {
  return ce(" ");
}
function fi() {
  return ce("");
}
function q(i, e, t, r) {
  return i.addEventListener(e, t, r), () => i.removeEventListener(e, t, r);
}
function mi(i) {
  return function(e) {
    return e.preventDefault(), i.call(this, e);
  };
}
function c(i, e, t) {
  t == null ? i.removeAttribute(e) : i.getAttribute(e) !== t && i.setAttribute(e, t);
}
function hi(i) {
  return Array.from(i.childNodes);
}
function We(i, e) {
  e = "" + e, i.data !== e && (i.data = /** @type {string} */
  e);
}
function ht(i, e) {
  i.value = e ?? "";
}
function ae(i, e, t) {
  i.classList.toggle(e, !!t);
}
function gi(i, e, { bubbles: t = !1, cancelable: r = !1 } = {}) {
  return new CustomEvent(i, { detail: e, bubbles: t, cancelable: r });
}
let Me;
function Te(i) {
  Me = i;
}
function Rt() {
  if (!Me)
    throw new Error("Function called outside component initialization");
  return Me;
}
function bi(i) {
  Rt().$$.on_destroy.push(i);
}
function vi() {
  const i = Rt();
  return (e, t, { cancelable: r = !1 } = {}) => {
    const n = i.$$.callbacks[e];
    if (n) {
      const l = gi(
        /** @type {string} */
        e,
        t,
        { cancelable: r }
      );
      return n.slice().forEach((o) => {
        o.call(i, l);
      }), !l.defaultPrevented;
    }
    return !0;
  };
}
function gt(i, e) {
  const t = i.$$.callbacks[e.type];
  t && t.slice().forEach((r) => r.call(this, e));
}
const ke = [], $e = [];
let Ne = [];
const bt = [], _i = /* @__PURE__ */ Promise.resolve();
let et = !1;
function Li() {
  et || (et = !0, _i.then(Ut));
}
function tt(i) {
  Ne.push(i);
}
const Ye = /* @__PURE__ */ new Set();
let Se = 0;
function Ut() {
  if (Se !== 0)
    return;
  const i = Me;
  do {
    try {
      for (; Se < ke.length; ) {
        const e = ke[Se];
        Se++, Te(e), yi(e.$$);
      }
    } catch (e) {
      throw ke.length = 0, Se = 0, e;
    }
    for (Te(null), ke.length = 0, Se = 0; $e.length; )
      $e.pop()();
    for (let e = 0; e < Ne.length; e += 1) {
      const t = Ne[e];
      Ye.has(t) || (Ye.add(t), t());
    }
    Ne.length = 0;
  } while (ke.length);
  for (; bt.length; )
    bt.pop()();
  et = !1, Ye.clear(), Te(i);
}
function yi(i) {
  if (i.fragment !== null) {
    i.update(), oe(i.before_update);
    const e = i.dirty;
    i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, e), i.after_update.forEach(tt);
  }
}
function wi(i) {
  const e = [], t = [];
  Ne.forEach((r) => i.indexOf(r) === -1 ? e.push(r) : t.push(r)), t.forEach((r) => r()), Ne = e;
}
const ze = /* @__PURE__ */ new Set();
let he;
function Fe() {
  he = {
    r: 0,
    c: [],
    p: he
    // parent group
  };
}
function Pe() {
  he.r || oe(he.c), he = he.p;
}
function F(i, e) {
  i && i.i && (ze.delete(i), i.i(e));
}
function Z(i, e, t, r) {
  if (i && i.o) {
    if (ze.has(i))
      return;
    ze.add(i), he.c.push(() => {
      ze.delete(i), r && (t && i.d(1), r());
    }), i.o(e);
  } else
    r && r();
}
function vt(i) {
  return (i == null ? void 0 : i.length) !== void 0 ? i : Array.from(i);
}
function Ei(i, e) {
  Z(i, 1, 1, () => {
    e.delete(i.key);
  });
}
function Si(i, e, t, r, n, l, o, a, f, u, d, v) {
  let b = i.length, S = l.length, p = b;
  const P = {};
  for (; p--; )
    P[i[p].key] = p;
  const w = [], E = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), h = [];
  for (p = S; p--; ) {
    const L = v(n, l, p), k = t(L);
    let g = o.get(k);
    g ? r && h.push(() => g.p(L, e)) : (g = u(k, L), g.c()), E.set(k, w[p] = g), k in P && A.set(k, Math.abs(p - P[k]));
  }
  const H = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
  function M(L) {
    F(L, 1), L.m(a, d), o.set(L.key, L), d = L.first, S--;
  }
  for (; b && S; ) {
    const L = w[S - 1], k = i[b - 1], g = L.key, y = k.key;
    L === k ? (d = L.first, b--, S--) : E.has(y) ? !o.has(g) || H.has(g) ? M(L) : m.has(y) ? b-- : A.get(g) > A.get(y) ? (m.add(g), M(L)) : (H.add(y), b--) : (f(k, o), b--);
  }
  for (; b--; ) {
    const L = i[b];
    E.has(L.key) || f(L, o);
  }
  for (; S; )
    M(w[S - 1]);
  return oe(h), w;
}
function ue(i) {
  i && i.c();
}
function re(i, e, t) {
  const { fragment: r, after_update: n } = i.$$;
  r && r.m(e, t), tt(() => {
    const l = i.$$.on_mount.map(Mt).filter(It);
    i.$$.on_destroy ? i.$$.on_destroy.push(...l) : oe(l), i.$$.on_mount = [];
  }), n.forEach(tt);
}
function ne(i, e) {
  const t = i.$$;
  t.fragment !== null && (wi(t.after_update), oe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
}
function ki(i, e) {
  i.$$.dirty[0] === -1 && (ke.push(i), Li(), i.$$.dirty.fill(0)), i.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function be(i, e, t, r, n, l, o = null, a = [-1]) {
  const f = Me;
  Te(i);
  const u = i.$$ = {
    fragment: null,
    ctx: [],
    // state
    props: l,
    update: U,
    not_equal: n,
    bound: ft(),
    // lifecycle
    on_mount: [],
    on_destroy: [],
    on_disconnect: [],
    before_update: [],
    after_update: [],
    context: new Map(e.context || (f ? f.$$.context : [])),
    // everything else
    callbacks: ft(),
    dirty: a,
    skip_bound: !1,
    root: e.target || f.$$.root
  };
  o && o(u.root);
  let d = !1;
  if (u.ctx = t ? t(i, e.props || {}, (v, b, ...S) => {
    const p = S.length ? S[0] : b;
    return u.ctx && n(u.ctx[v], u.ctx[v] = p) && (!u.skip_bound && u.bound[v] && u.bound[v](p), d && ki(i, v)), b;
  }) : [], u.update(), d = !0, oe(u.before_update), u.fragment = r ? r(u.ctx) : !1, e.target) {
    if (e.hydrate) {
      const v = hi(e.target);
      u.fragment && u.fragment.l(v), v.forEach(D);
    } else
      u.fragment && u.fragment.c();
    e.intro && F(i.$$.fragment), re(i, e.target, e.anchor), Ut();
  }
  Te(f);
}
class ve {
  constructor() {
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    Xe(this, "$$");
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    Xe(this, "$$set");
  }
  /** @returns {void} */
  $destroy() {
    ne(this, 1), this.$destroy = U;
  }
  /**
   * @template {Extract<keyof Events, string>} K
   * @param {K} type
   * @param {((e: Events[K]) => void) | null | undefined} callback
   * @returns {() => void}
   */
  $on(e, t) {
    if (!It(t))
      return U;
    const r = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
    return r.push(t), () => {
      const n = r.indexOf(t);
      n !== -1 && r.splice(n, 1);
    };
  }
  /**
   * @param {Partial<Props>} props
   * @returns {void}
   */
  $set(e) {
    this.$$set && !ai(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
  }
}
const Ni = "4";
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ni);
function Ci(i) {
  let e, t;
  return {
    c() {
      e = le("svg"), t = le("path"), c(t, "d", "M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"), c(e, "viewBox", "0 0 14 14"), c(e, "width", "13"), c(e, "height", "13"), c(e, "class", "svelte-en2qvf");
    },
    m(r, n) {
      B(r, e, n), C(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && D(e);
    }
  };
}
class Dt extends ve {
  constructor(e) {
    super(), be(this, e, null, Ci, ge, {});
  }
}
function pi(i) {
  let e, t;
  return {
    c() {
      e = le("svg"), t = le("path"), c(t, "d", "M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"), c(e, "viewBox", "0 0 30 30"), c(e, "fill", "none"), c(e, "xmlns", "http://www.w3.org/2000/svg"), c(e, "class", "svelte-d2loi5");
    },
    m(r, n) {
      B(r, e, n), C(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && D(e);
    }
  };
}
class At extends ve {
  constructor(e) {
    super(), be(this, e, null, pi, ge, {});
  }
}
function Ti(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "area.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "area.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Wi(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "poi.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "poi.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Mi(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "postal_code.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "postal_code.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Ii(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "street.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "street.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Oi(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "road.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "road.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Ri(i) {
  let e, t;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*iconsBaseUrl*/
      i[3] + "housenumber.svg") || c(e, "src", t), c(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n);
    },
    p(r, n) {
      n & /*iconsBaseUrl*/
      8 && !Q(e.src, t = /*iconsBaseUrl*/
      r[3] + "housenumber.svg") && c(e, "src", t), n & /*placeType*/
      64 && c(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Ui(i) {
  let e, t, r, n;
  return {
    c() {
      e = I("img"), Q(e.src, t = /*imageUrl*/
      i[5]) || c(e, "src", t), c(
        e,
        "alt",
        /*category*/
        i[4]
      ), c(e, "class", "svelte-ltkwvy");
    },
    m(l, o) {
      B(l, e, o), r || (n = q(
        e,
        "error",
        /*error_handler*/
        i[13]
      ), r = !0);
    },
    p(l, o) {
      o & /*imageUrl*/
      32 && !Q(e.src, t = /*imageUrl*/
      l[5]) && c(e, "src", t), o & /*category*/
      16 && c(
        e,
        "alt",
        /*category*/
        l[4]
      );
    },
    d(l) {
      l && D(e), r = !1, n();
    }
  };
}
function _t(i) {
  let e, t;
  return {
    c() {
      e = I("span"), t = ce(
        /*placeType*/
        i[6]
      ), c(e, "class", "secondary svelte-ltkwvy");
    },
    m(r, n) {
      B(r, e, n), C(e, t);
    },
    p(r, n) {
      n & /*placeType*/
      64 && We(
        t,
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && D(e);
    }
  };
}
function Di(i) {
  var L, k;
  let e, t, r, n, l, o, a, f, u = (
    /*feature*/
    i[0].place_name.replace(/,.*/, "") + ""
  ), d, v, b = (
    /*showPlaceType*/
    i[2] === "always" || /*showPlaceType*/
    i[2] && !/*feature*/
    i[0].address && /*feature*/
    ((L = i[0].properties) == null ? void 0 : L.kind) !== "road" && /*feature*/
    ((k = i[0].properties) == null ? void 0 : k.kind) !== "road_relation" && !/*feature*/
    i[0].id.startsWith("address.") && !/*feature*/
    i[0].id.startsWith("postal_code.") && (!/*feature*/
    i[0].id.startsWith("poi.") || !/*imageUrl*/
    i[5])
  ), S, p, P = (
    /*feature*/
    i[0].place_name.replace(/[^,]*,?\s*/, "") + ""
  ), w, E, A;
  function h(g, y) {
    var Y, T;
    return y & /*feature*/
    1 && (t = null), y & /*feature*/
    1 && (r = null), y & /*feature*/
    1 && (n = null), /*imageUrl*/
    g[5] ? Ui : (
      /*feature*/
      g[0].address ? Ri : (
        /*feature*/
        ((Y = g[0].properties) == null ? void 0 : Y.kind) === "road" || /*feature*/
        ((T = g[0].properties) == null ? void 0 : T.kind) === "road_relation" ? Oi : (t == null && (t = !!/*feature*/
        g[0].id.startsWith("address.")), t ? Ii : (r == null && (r = !!/*feature*/
        g[0].id.startsWith("postal_code.")), r ? Mi : (n == null && (n = !!/*feature*/
        g[0].id.startsWith("poi.")), n ? Wi : Ti)))
      )
    );
  }
  let H = h(i, -1), m = H(i), M = b && _t(i);
  return {
    c() {
      e = I("li"), m.c(), l = K(), o = I("span"), a = I("span"), f = I("span"), d = ce(u), v = K(), M && M.c(), S = K(), p = I("span"), w = ce(P), c(f, "class", "primary svelte-ltkwvy"), c(a, "class", "svelte-ltkwvy"), c(p, "class", "line2 svelte-ltkwvy"), c(o, "class", "texts svelte-ltkwvy"), c(e, "tabindex", "0"), c(
        e,
        "data-selected",
        /*selected*/
        i[1]
      ), c(e, "class", "svelte-ltkwvy"), ae(
        e,
        "selected",
        /*selected*/
        i[1]
      );
    },
    m(g, y) {
      B(g, e, y), m.m(e, null), C(e, l), C(e, o), C(o, a), C(a, f), C(f, d), C(a, v), M && M.m(a, null), C(o, S), C(o, p), C(p, w), E || (A = [
        q(
          e,
          "mouseenter",
          /*mouseenter_handler*/
          i[11]
        ),
        q(
          e,
          "focus",
          /*focus_handler*/
          i[12]
        )
      ], E = !0);
    },
    p(g, [y]) {
      var Y, T;
      H === (H = h(g, y)) && m ? m.p(g, y) : (m.d(1), m = H(g), m && (m.c(), m.m(e, l))), y & /*feature*/
      1 && u !== (u = /*feature*/
      g[0].place_name.replace(/,.*/, "") + "") && We(d, u), y & /*showPlaceType, feature, imageUrl*/
      37 && (b = /*showPlaceType*/
      g[2] === "always" || /*showPlaceType*/
      g[2] && !/*feature*/
      g[0].address && /*feature*/
      ((Y = g[0].properties) == null ? void 0 : Y.kind) !== "road" && /*feature*/
      ((T = g[0].properties) == null ? void 0 : T.kind) !== "road_relation" && !/*feature*/
      g[0].id.startsWith("address.") && !/*feature*/
      g[0].id.startsWith("postal_code.") && (!/*feature*/
      g[0].id.startsWith("poi.") || !/*imageUrl*/
      g[5])), b ? M ? M.p(g, y) : (M = _t(g), M.c(), M.m(a, null)) : M && (M.d(1), M = null), y & /*feature*/
      1 && P !== (P = /*feature*/
      g[0].place_name.replace(/[^,]*,?\s*/, "") + "") && We(w, P), y & /*selected*/
      2 && c(
        e,
        "data-selected",
        /*selected*/
        g[1]
      ), y & /*selected*/
      2 && ae(
        e,
        "selected",
        /*selected*/
        g[1]
      );
    },
    i: U,
    o: U,
    d(g) {
      g && D(e), m.d(), M && M.d(), E = !1, oe(A);
    }
  };
}
function Ai(i, e, t) {
  var A;
  let r, n, { feature: l } = e, { selected: o = !1 } = e, { showPlaceType: a } = e, { missingIconsCache: f } = e, { iconsBaseUrl: u } = e;
  const d = (A = l.properties) == null ? void 0 : A.categories;
  let v, b, S = 0;
  function p(h) {
    b && f.add(b), t(9, S++, S);
  }
  function P(h) {
    gt.call(this, i, h);
  }
  function w(h) {
    gt.call(this, i, h);
  }
  const E = (h) => p(h.currentTarget);
  return i.$$set = (h) => {
    "feature" in h && t(0, l = h.feature), "selected" in h && t(1, o = h.selected), "showPlaceType" in h && t(2, a = h.showPlaceType), "missingIconsCache" in h && t(8, f = h.missingIconsCache), "iconsBaseUrl" in h && t(3, u = h.iconsBaseUrl);
  }, i.$$.update = () => {
    var h, H, m, M;
    if (i.$$.dirty & /*loadIconAttempt, index, category, iconsBaseUrl, imageUrl, missingIconsCache*/
    1848)
      do
        t(10, r--, r), t(4, v = d == null ? void 0 : d[r]), t(5, b = v ? u + v.replace(/ /g, "_") + ".svg" : void 0);
      while (r > -1 && (!b || f.has(b)));
    i.$$.dirty & /*feature*/
    1 && t(6, n = l.id.startsWith("poi.") ? (H = (h = l.properties) == null ? void 0 : h.categories) == null ? void 0 : H.join(", ") : ((M = (m = l.properties) == null ? void 0 : m.place_type_name) == null ? void 0 : M[0]) ?? l.place_type[0]);
  }, t(10, r = (d == null ? void 0 : d.length) ?? 0), [
    l,
    o,
    a,
    u,
    v,
    b,
    n,
    p,
    f,
    S,
    r,
    P,
    w,
    E
  ];
}
class Bi extends ve {
  constructor(e) {
    super(), be(this, e, Ai, Di, ge, {
      feature: 0,
      selected: 1,
      showPlaceType: 2,
      missingIconsCache: 8,
      iconsBaseUrl: 3
    });
  }
}
function zi(i) {
  let e;
  return {
    c() {
      e = I("div"), e.innerHTML = '<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>', c(e, "class", "svelte-7cmwmc");
    },
    m(t, r) {
      B(t, e, r);
    },
    p: U,
    i: U,
    o: U,
    d(t) {
      t && D(e);
    }
  };
}
class Fi extends ve {
  constructor(e) {
    super(), be(this, e, null, zi, ge, {});
  }
}
function Pi(i) {
  let e, t;
  return {
    c() {
      e = le("svg"), t = le("path"), c(t, "d", "M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"), c(e, "viewBox", "0 0 60.006 21.412"), c(e, "width", "14"), c(e, "height", "20"), c(e, "class", "svelte-en2qvf");
    },
    m(r, n) {
      B(r, e, n), C(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && D(e);
    }
  };
}
class ji extends ve {
  constructor(e) {
    super(), be(this, e, null, Pi, ge, {});
  }
}
function Hi(i) {
  let e, t;
  return {
    c() {
      e = le("svg"), t = le("path"), c(t, "d", "M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"), c(e, "width", "14"), c(e, "height", "14"), c(e, "viewBox", "0 0 15 15"), c(e, "class", "svelte-en2qvf");
    },
    m(r, n) {
      B(r, e, n), C(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && D(e);
    }
  };
}
class Zi extends ve {
  constructor(e) {
    super(), be(this, e, null, Hi, ge, {});
  }
}
function Gi(i, e, t) {
  const r = e[1], n = e[0], l = r - n;
  return i === r && t ? i : ((i - n) % l + l) % l + n;
}
function Lt(i) {
  const e = [...i];
  return e[2] < e[0] && (e[2] += 360), e;
}
let pe;
async function qi(i, e, t) {
  const r = i == null ? void 0 : i.getCenterAndZoom();
  for (const n of e ?? [])
    if (!(r && (n.minZoom != null && n.minZoom > r[0] || n.maxZoom != null && n.maxZoom < r[0]))) {
      if (n.type === "fixed")
        return n.coordinates.join(",");
      e:
        if (n.type === "client-geolocation") {
          if (pe && n.cachedLocationExpiry && pe.time + n.cachedLocationExpiry > Date.now()) {
            if (!pe.coords)
              break e;
            return pe.coords;
          }
          let l;
          try {
            return l = await new Promise((o, a) => {
              t.signal.addEventListener("abort", () => {
                a(Error("aborted"));
              }), navigator.geolocation.getCurrentPosition(
                (f) => {
                  o(
                    [f.coords.longitude, f.coords.latitude].map((u) => u.toFixed(6)).join(",")
                  );
                },
                (f) => {
                  a(f);
                },
                n
              );
            }), l;
          } catch {
          } finally {
            n.cachedLocationExpiry && (pe = {
              time: Date.now(),
              coords: l
            });
          }
          if (t.signal.aborted)
            return;
        }
      if (n.type === "server-geolocation")
        return "ip";
      if (r && n.type === "map-center")
        return r[1].toFixed(6) + "," + r[2].toFixed(6);
    }
}
const yt = /(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i, wt = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i, Et = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i, St = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;
function Qi(i) {
  if (!["DMS", "DM", "DD"].includes(i))
    throw new Error("invalid format specified");
  if (this.decimalCoordinates && this.decimalCoordinates.trim()) {
    if (i == "DD")
      return this.decimalCoordinates;
    const e = this.decimalCoordinates.split(",").map((o) => Number(o.trim()));
    let t = kt(e[0], i), r = kt(e[1], i);
    t.endsWith('.0"') && r.endsWith('.0"') && (t = t.replace(/\.0"$/, '"'), r = r.replace(/\.0"$/, '"'));
    const n = e[0] >= 0 ? " N" : " S", l = e[1] >= 0 ? " E" : " W";
    return `${t + n}, ${r + l}`;
  } else
    throw new Error("no decimal coordinates to convert");
}
function kt(i, e) {
  const t = Math.abs(i), r = Math.floor(t), n = (t - r) * 60;
  if (e == "DM") {
    let a = Vi(n, 3).toFixed(3).padStart(6, "0");
    return `${r}° ${a}'`;
  }
  let l = Math.floor(n), o = ((n - l) * 60).toFixed(1).padStart(4, "0");
  return l = l.toString().padStart(2, "0"), `${r}° ${l}' ${o}"`;
}
function Vi(i, e) {
  const t = Math.pow(10, e);
  return Math.round((i + Number.EPSILON) * t) / t;
}
function it(i, e) {
  e || (e = 5), i = i.replace(/\s+/g, " ").trim();
  let t = null, r = null, n = "", l = "", o = [], a = !1;
  if (yt.test(i))
    if (o = yt.exec(i), a = Be(o), a) {
      if (t = o[2], r = o[6], t.includes(",") && (t = t.replace(",", ".")), r.includes(",") && (r = r.replace(",", ".")), Number(Math.round(t)) == Number(t))
        throw new Error("integer only coordinate provided");
      if (Number(Math.round(r)) == Number(r))
        throw new Error("integer only coordinate provided");
      o[1] ? (n = o[1], l = o[5]) : o[4] && (n = o[4], l = o[8]);
    } else
      throw new Error("invalid decimal coordinate format");
  else if (wt.test(i))
    if (o = wt.exec(i), a = Be(o), a)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60), o[6] && (t += o[6].replace(",", ".") / 3600), parseInt(o[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(o[9])), o[11] && (r += o[11] / 60), o[13] && (r += o[13].replace(",", ".") / 3600), parseInt(o[9]) < 0 && (r = -1 * r), o[1] ? (n = o[1], l = o[8]) : o[7] && (n = o[7], l = o[14]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (Et.test(i))
    if (o = Et.exec(i), a = Be(o), a)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60), o[6] && (t += o[6] / 3600), parseInt(o[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(o[10])), o[12] && (r += o[12] / 60), o[14] && (r += o[14] / 3600), parseInt(o[10]) < 0 && (r = -1 * r), o[1] ? (n = o[1], l = o[9]) : o[8] && (n = o[8], l = o[16]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (St.test(i))
    if (o = St.exec(i), a = Be(o), a)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60), o[6] && (t += o[6] / 3600), parseInt(o[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(o[10])), o[12] && (r += o[12] / 60), o[14] && (r += o[14] / 3600), parseInt(o[10]) < 0 && (r = -1 * r), o[1] ? (n = o[1], l = o[9]) : o[8] && (n = o[8], l = o[16]);
    else
      throw new Error("invalid coordinates format");
  if (a) {
    if (Math.abs(r) >= 180)
      throw new Error("invalid longitude value");
    if (Math.abs(t) >= 90)
      throw new Error("invalid latitude value");
    if ((n || l) && (!n || !l))
      throw new Error("invalid coordinates format");
    if (n && n == l)
      throw new Error("invalid coordinates format");
    let f = /S|SOUTH/i;
    f.test(n) && t > 0 && (t = -1 * t), f = /W|WEST/i, f.test(l) && r > 0 && (r = -1 * r);
    const u = o[0].trim();
    let d, v;
    const b = /[,/;\u0020]/g, S = u.match(b);
    if (S == null) {
      const w = Math.floor(i.length / 2);
      d = u.substring(0, w).trim(), v = u.substring(w).trim();
    } else {
      let w;
      S.length % 2 == 1 ? w = Math.floor(S.length / 2) : w = S.length / 2 - 1;
      let E = 0;
      if (w == 0)
        E = u.indexOf(S[0]), d = u.substring(0, E).trim(), v = u.substring(E + 1).trim();
      else {
        let A = 0, h = 0;
        for (; A <= w; )
          E = u.indexOf(S[A], h), h = E + 1, A++;
        d = u.substring(0, E).trim(), v = u.substring(E + 1).trim();
      }
    }
    const p = d.split(".");
    if (p.length == 2 && p[1] == 0 && p[1].length != 2)
      throw new Error("invalid coordinates format");
    const P = v.split(".");
    if (P.length == 2 && P[1] == 0 && P[1].length != 2)
      throw new Error("invalid coordinates format");
    if (/^\d+$/.test(d) || /^\d+$/.test(v))
      throw new Error("degree only coordinate/s provided");
    return isNaN(t) && t.includes(",") && (t = t.replace(",", ".")), t = Number(Number(t).toFixed(e)), isNaN(r) && r.includes(",") && (r = r.replace(",", ".")), r = Number(Number(r).toFixed(e)), Object.freeze({
      verbatimCoordinates: u,
      verbatimLatitude: d,
      verbatimLongitude: v,
      decimalLatitude: t,
      decimalLongitude: r,
      decimalCoordinates: `${t},${r}`,
      closeEnough: Ki,
      toCoordinateFormat: Qi
    });
  } else
    throw new Error("coordinates pattern match failed");
}
function Be(i) {
  if (!isNaN(i[0]))
    return !1;
  const e = [...i];
  if (e.shift(), e.length % 2 > 0)
    return !1;
  const t = /^[-+]?\d+([\.,]\d+)?$/, r = /[eastsouthnorthwest]+/i, n = e.length / 2;
  for (let l = 0; l < n; l++) {
    const o = e[l], a = e[l + n], f = t.test(o) && t.test(a), u = r.test(o) && r.test(a), d = o == a;
    if (!(o == null && a == null)) {
      if (o == null || a == null)
        return !1;
      if (f || u || d)
        continue;
      return !1;
    }
  }
  return !0;
}
function Nt(i, e) {
  const t = Math.abs(i - e);
  return Number(t.toFixed(6)) <= 1e-5;
}
function Ki(i) {
  if (i.includes(",")) {
    const e = i.split(",");
    if (Number(e[0]) == NaN || Number(e[1]) == NaN)
      throw new Error("coords are not valid decimals");
    return Nt(this.decimalLatitude, Number(e[0])) && Nt(this.decimalLongitude, e[1]);
  } else
    throw new Error("coords being tested must be separated by a comma");
}
const Ji = Object.freeze({
  DMS: "DMS",
  DM: "DM",
  DD: "DD"
});
it.to = Ji;
const Xi = [
  {
    verbatimCoordinates: "40.123, -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: '40° 7´ 22.8" N 74° 7´ 22.8" W',
    verbatimLatitude: '40° 7´ 22.8" N',
    verbatimLongitude: '74° 7´ 22.8" W'
  },
  {
    verbatimCoordinates: "40° 7.38’ , -74° 7.38’",
    verbatimLatitude: "40° 7.38’",
    verbatimLongitude: "-74° 7.38’"
  },
  {
    verbatimCoordinates: "N40°7’22.8’’, W74°7’22.8’’",
    verbatimLatitude: "N40°7’22.8’’",
    verbatimLongitude: "W74°7’22.8’’"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: `40°7'22.8"N, 74°7'22.8"W`,
    verbatimLatitude: `40°7'22.8"N`,
    verbatimLongitude: `74°7'22.8"W`
  },
  {
    verbatimCoordinates: "40 7 22.8, -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  },
  {
    verbatimCoordinates: "40.123 -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123°,-74.123°",
    verbatimLatitude: "40.123°",
    verbatimLongitude: "-74.123°"
  },
  {
    verbatimCoordinates: "40.123N74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "4007.38N7407.38W",
    verbatimLatitude: "4007.38N",
    verbatimLongitude: "7407.38W"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: "400722.8N740722.8W",
    verbatimLatitude: "400722.8N",
    verbatimLongitude: "740722.8W"
  },
  {
    verbatimCoordinates: "N 40 7.38 W 74 7.38",
    verbatimLatitude: "N 40 7.38",
    verbatimLongitude: "W 74 7.38"
  },
  {
    verbatimCoordinates: "40:7:22.8N 74:7:22.8W",
    verbatimLatitude: "40:7:22.8N",
    verbatimLongitude: "74:7:22.8W"
  },
  {
    verbatimCoordinates: "40:7:23N,74:7:23W",
    verbatimLatitude: "40:7:23N",
    verbatimLongitude: "74:7:23W",
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.1230555555
  },
  {
    verbatimCoordinates: '40°7’23"N 74°7’23"W',
    verbatimLatitude: '40°7’23"N',
    verbatimLongitude: '74°7’23"W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23"S 74°7’23"E',
    verbatimLatitude: '40°7’23"S',
    verbatimLongitude: '74°7’23"E',
    decimalLatitude: -40.1230555555,
    decimalLongitude: 74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23" -74°7’23"',
    verbatimLatitude: '40°7’23"',
    verbatimLongitude: '-74°7’23"',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: '40d 7’ 23" N 74d 7’ 23" W',
    verbatimLatitude: '40d 7’ 23" N',
    verbatimLongitude: '74d 7’ 23" W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: "40.123N 74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40 7 22.8; -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  }
], Yi = {
  decimalLatitude: 40.123,
  decimalLongitude: -74.123
}, xi = [
  {
    verbatimCoordinates: `50°4'17.698"south, 14°24'2.826"east`,
    verbatimLatitude: `50°4'17.698"south`,
    verbatimLongitude: `14°24'2.826"east`,
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "50d4m17.698S 14d24m2.826E",
    verbatimLatitude: "50d4m17.698S",
    verbatimLongitude: "14d24m2.826E",
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "40:26:46N,79:56:55W",
    verbatimLatitude: "40:26:46N",
    verbatimLongitude: "79:56:55W",
    decimalLatitude: 40.44611111111111,
    decimalLongitude: -79.9486111111111
  },
  {
    verbatimCoordinates: "40:26:46.302N 79:56:55.903W",
    verbatimLatitude: "40:26:46.302N",
    verbatimLongitude: "79:56:55.903W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.94886194444445
  },
  {
    verbatimCoordinates: "40°26′47″N 79°58′36″W",
    verbatimLatitude: "40°26′47″N",
    verbatimLongitude: "79°58′36″W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40d 26′ 47″ N 79d 58′ 36″ W",
    verbatimLatitude: "40d 26′ 47″ N",
    verbatimLongitude: "79d 58′ 36″ W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40.446195N 79.948862W",
    verbatimLatitude: "40.446195N",
    verbatimLongitude: "79.948862W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40,446195° 79,948862°",
    verbatimLatitude: "40,446195°",
    verbatimLongitude: "79,948862°",
    decimalLatitude: 40.446195,
    decimalLongitude: 79.948862
  },
  {
    verbatimCoordinates: "40° 26.7717, -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.446195, -79.948862",
    verbatimLatitude: "40.446195",
    verbatimLongitude: "-79.948862",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.123256; -74.123256",
    verbatimLatitude: "40.123256",
    verbatimLongitude: "-74.123256",
    decimalLatitude: 40.123256,
    decimalLongitude: -74.123256
  },
  {
    verbatimCoordinates: "18°24S 22°45E",
    verbatimLatitude: "18°24S",
    verbatimLongitude: "22°45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  }
], $i = [
  // additional formats we've encountered
  {
    verbatimCoordinates: "10.432342S 10.6345345E",
    verbatimLatitude: "10.432342S",
    verbatimLongitude: "10.6345345E",
    decimalLatitude: -10.432342,
    decimalLongitude: 10.6345345
  },
  {
    verbatimCoordinates: "10.00S 10.00E",
    verbatimLatitude: "10.00S",
    verbatimLongitude: "10.00E",
    decimalLatitude: -10,
    decimalLongitude: 10
  },
  {
    verbatimCoordinates: "00.00S 01.00E",
    verbatimLatitude: "00.00S",
    verbatimLongitude: "01.00E",
    decimalLatitude: 0,
    decimalLongitude: 1
  },
  {
    verbatimCoordinates: "18.24S 22.45E",
    verbatimLatitude: "18.24S",
    verbatimLongitude: "22.45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  },
  {
    verbatimCoordinates: "27deg 15min 45.2sec S 18deg 32min 53.7sec E",
    verbatimLatitude: "27deg 15min 45.2sec S",
    verbatimLongitude: "18deg 32min 53.7sec E",
    decimalLatitude: -27.262555555555554,
    decimalLongitude: 18.54825
  },
  {
    verbatimCoordinates: "-23.3245° S / 28.2344° E",
    verbatimLatitude: "-23.3245° S",
    verbatimLongitude: "28.2344° E",
    decimalLatitude: -23.3245,
    decimalLongitude: 28.2344
  },
  {
    verbatimCoordinates: "40° 26.7717 -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "27.15.45S 18.32.53E",
    verbatimLatitude: "27.15.45S",
    verbatimLongitude: "18.32.53E",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "-27.15.45 18.32.53",
    verbatimLatitude: "-27.15.45",
    verbatimLongitude: "18.32.53",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "27.15.45.2S 18.32.53.4E",
    verbatimLatitude: "27.15.45.2S",
    verbatimLongitude: "18.32.53.4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "27.15.45,2S 18.32.53,4E",
    verbatimLatitude: "27.15.45,2S",
    verbatimLongitude: "18.32.53,4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "S23.43563 °  E22.45634 °",
    verbatimLatitude: "S23.43563 °",
    verbatimLongitude: "E22.45634 °",
    decimalLatitude: -23.43563,
    decimalLongitude: 22.45634
  },
  {
    verbatimCoordinates: "27,71372° S 23,07771° E",
    verbatimLatitude: "27,71372° S",
    verbatimLongitude: "23,07771° E",
    decimalLatitude: -27.71372,
    decimalLongitude: 23.07771
  },
  {
    verbatimCoordinates: "27.45.34 S 23.23.23 E",
    verbatimLatitude: "27.45.34 S",
    verbatimLongitude: "23.23.23 E",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  },
  {
    verbatimCoordinates: "S 27.45.34 E 23.23.23",
    verbatimLatitude: "S 27.45.34",
    verbatimLongitude: "E 23.23.23",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  }
];
function er() {
  const i = [];
  return Xi.forEach((e) => {
    e.decimalLatitude ? i.push(e) : i.push({ ...e, ...Yi });
  }), [...i, ...xi, ...$i];
}
const tr = er();
it.formats = tr.map((i) => i.verbatimCoordinates);
const xe = it;
function Ct(i, e, t) {
  const r = i.slice();
  return r[81] = e[t], r[83] = t, r;
}
function pt(i) {
  let e, t;
  return e = new Fi({}), {
    c() {
      ue(e.$$.fragment);
    },
    m(r, n) {
      re(e, r, n), t = !0;
    },
    i(r) {
      t || (F(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Z(e.$$.fragment, r), t = !1;
    },
    d(r) {
      ne(e, r);
    }
  };
}
function Tt(i) {
  let e, t, r, n, l;
  return t = new ji({}), {
    c() {
      e = I("button"), ue(t.$$.fragment), c(e, "type", "button"), c(
        e,
        "title",
        /*reverseButtonTitle*/
        i[9]
      ), c(e, "class", "svelte-1r7dvt7"), ae(
        e,
        "active",
        /*reverseActive*/
        i[0]
      );
    },
    m(o, a) {
      B(o, e, a), re(t, e, null), r = !0, n || (l = q(
        e,
        "click",
        /*click_handler_2*/
        i[67]
      ), n = !0);
    },
    p(o, a) {
      (!r || a[0] & /*reverseButtonTitle*/
      512) && c(
        e,
        "title",
        /*reverseButtonTitle*/
        o[9]
      ), (!r || a[0] & /*reverseActive*/
      1) && ae(
        e,
        "active",
        /*reverseActive*/
        o[0]
      );
    },
    i(o) {
      r || (F(t.$$.fragment, o), r = !0);
    },
    o(o) {
      Z(t.$$.fragment, o), r = !1;
    },
    d(o) {
      o && D(e), ne(t), n = !1, l();
    }
  };
}
function ir(i) {
  let e, t = [], r = /* @__PURE__ */ new Map(), n, l, o, a = vt(
    /*listFeatures*/
    i[13]
  );
  const f = (u) => (
    /*feature*/
    u[81].id + /*feature*/
    (u[81].address ? "," + /*feature*/
    u[81].address : "")
  );
  for (let u = 0; u < a.length; u += 1) {
    let d = Ct(i, a, u), v = f(d);
    r.set(v, t[u] = Wt(v, d));
  }
  return {
    c() {
      e = I("ul");
      for (let u = 0; u < t.length; u += 1)
        t[u].c();
      c(e, "class", "svelte-1r7dvt7");
    },
    m(u, d) {
      B(u, e, d);
      for (let v = 0; v < t.length; v += 1)
        t[v] && t[v].m(e, null);
      n = !0, l || (o = [
        q(
          e,
          "mouseleave",
          /*mouseleave_handler*/
          i[71]
        ),
        q(
          e,
          "blur",
          /*blur_handler_1*/
          i[72]
        )
      ], l = !0);
    },
    p(u, d) {
      d[0] & /*listFeatures, showPlaceType, selectedItemIndex, missingIconsCache, iconsBaseUrl, pick*/
      17869824 && (a = vt(
        /*listFeatures*/
        u[13]
      ), Fe(), t = Si(t, d, f, 1, u, a, r, e, Ei, Wt, null, Ct), Pe());
    },
    i(u) {
      if (!n) {
        for (let d = 0; d < a.length; d += 1)
          F(t[d]);
        n = !0;
      }
    },
    o(u) {
      for (let d = 0; d < t.length; d += 1)
        Z(t[d]);
      n = !1;
    },
    d(u) {
      u && D(e);
      for (let d = 0; d < t.length; d += 1)
        t[d].d();
      l = !1, oe(o);
    }
  };
}
function rr(i) {
  let e, t, r, n, l, o;
  return t = new At({}), {
    c() {
      e = I("div"), ue(t.$$.fragment), r = K(), n = I("div"), l = ce(
        /*noResultsMessage*/
        i[7]
      ), c(n, "class", "svelte-1r7dvt7"), c(e, "class", "no-results svelte-1r7dvt7");
    },
    m(a, f) {
      B(a, e, f), re(t, e, null), C(e, r), C(e, n), C(n, l), o = !0;
    },
    p(a, f) {
      (!o || f[0] & /*noResultsMessage*/
      128) && We(
        l,
        /*noResultsMessage*/
        a[7]
      );
    },
    i(a) {
      o || (F(t.$$.fragment, a), o = !0);
    },
    o(a) {
      Z(t.$$.fragment, a), o = !1;
    },
    d(a) {
      a && D(e), ne(t);
    }
  };
}
function nr(i) {
  let e = "", t;
  return {
    c() {
      t = ce(e);
    },
    m(r, n) {
      B(r, t, n);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && D(t);
    }
  };
}
function or(i) {
  let e, t, r, n, l, o, a, f, u, d, v;
  return t = new At({}), f = new Dt({}), {
    c() {
      e = I("div"), ue(t.$$.fragment), r = K(), n = I("div"), l = ce(
        /*errorMessage*/
        i[6]
      ), o = K(), a = I("button"), ue(f.$$.fragment), c(n, "class", "svelte-1r7dvt7"), c(a, "class", "svelte-1r7dvt7"), c(e, "class", "error svelte-1r7dvt7");
    },
    m(b, S) {
      B(b, e, S), re(t, e, null), C(e, r), C(e, n), C(n, l), C(e, o), C(e, a), re(f, a, null), u = !0, d || (v = q(
        a,
        "click",
        /*click_handler_3*/
        i[68]
      ), d = !0);
    },
    p(b, S) {
      (!u || S[0] & /*errorMessage*/
      64) && We(
        l,
        /*errorMessage*/
        b[6]
      );
    },
    i(b) {
      u || (F(t.$$.fragment, b), F(f.$$.fragment, b), u = !0);
    },
    o(b) {
      Z(t.$$.fragment, b), Z(f.$$.fragment, b), u = !1;
    },
    d(b) {
      b && D(e), ne(t), ne(f), d = !1, v();
    }
  };
}
function Wt(i, e) {
  let t, r, n;
  function l() {
    return (
      /*mouseenter_handler*/
      e[69](
        /*i*/
        e[83]
      )
    );
  }
  function o() {
    return (
      /*focus_handler_1*/
      e[70](
        /*feature*/
        e[81]
      )
    );
  }
  return r = new Bi({
    props: {
      feature: (
        /*feature*/
        e[81]
      ),
      showPlaceType: (
        /*showPlaceType*/
        e[10]
      ),
      selected: (
        /*selectedItemIndex*/
        e[15] === /*i*/
        e[83]
      ),
      missingIconsCache: (
        /*missingIconsCache*/
        e[20]
      ),
      iconsBaseUrl: (
        /*iconsBaseUrl*/
        e[11]
      )
    }
  }), r.$on("mouseenter", l), r.$on("focus", o), {
    key: i,
    first: null,
    c() {
      t = fi(), ue(r.$$.fragment), this.first = t;
    },
    m(a, f) {
      B(a, t, f), re(r, a, f), n = !0;
    },
    p(a, f) {
      e = a;
      const u = {};
      f[0] & /*listFeatures*/
      8192 && (u.feature = /*feature*/
      e[81]), f[0] & /*showPlaceType*/
      1024 && (u.showPlaceType = /*showPlaceType*/
      e[10]), f[0] & /*selectedItemIndex, listFeatures*/
      40960 && (u.selected = /*selectedItemIndex*/
      e[15] === /*i*/
      e[83]), f[0] & /*iconsBaseUrl*/
      2048 && (u.iconsBaseUrl = /*iconsBaseUrl*/
      e[11]), r.$set(u);
    },
    i(a) {
      n || (F(r.$$.fragment, a), n = !0);
    },
    o(a) {
      Z(r.$$.fragment, a), n = !1;
    },
    d(a) {
      a && D(t), ne(r, a);
    }
  };
}
function sr(i) {
  let e, t, r, n, l, o, a, f, u, d, v, b, S, p, P, w, E, A, h, H, m, M = !1;
  l = new Zi({}), v = new Dt({});
  let L = (
    /*abortController*/
    i[19] && pt()
  ), k = (
    /*enableReverse*/
    i[5] === !0 && Tt(i)
  );
  const g = (
    /*#slots*/
    i[59].default
  ), y = li(
    g,
    i,
    /*$$scope*/
    i[58],
    null
  ), Y = [or, nr, rr, ir], T = [];
  function _e(_, O) {
    var V, Le;
    return (
      /*error*/
      _[18] ? 0 : (
        /*focusedDelayed*/
        _[16] ? (
          /*listFeatures*/
          ((V = _[13]) == null ? void 0 : V.length) === 0 ? 2 : (
            /*focusedDelayed*/
            _[16] && /*listFeatures*/
            ((Le = _[13]) != null && Le.length) ? 3 : -1
          )
        ) : 1
      )
    );
  }
  return ~(w = _e(i)) && (E = T[w] = Y[w](i)), {
    c() {
      e = K(), t = I("form"), r = I("div"), n = I("button"), ue(l.$$.fragment), o = K(), a = I("input"), f = K(), u = I("div"), d = I("button"), ue(v.$$.fragment), b = K(), L && L.c(), S = K(), k && k.c(), p = K(), y && y.c(), P = K(), E && E.c(), c(n, "class", "search-button svelte-1r7dvt7"), c(n, "type", "button"), c(
        a,
        "placeholder",
        /*placeholder*/
        i[8]
      ), c(
        a,
        "aria-label",
        /*placeholder*/
        i[8]
      ), c(a, "class", "svelte-1r7dvt7"), c(d, "type", "button"), c(
        d,
        "title",
        /*clearButtonTitle*/
        i[3]
      ), c(d, "class", "svelte-1r7dvt7"), c(u, "class", "clear-button-container svelte-1r7dvt7"), ae(
        u,
        "displayable",
        /*searchValue*/
        i[1] !== ""
      ), c(r, "class", "input-group svelte-1r7dvt7"), c(t, "tabindex", "0"), c(t, "class", A = mt(
        /*className*/
        i[2]
      ) + " svelte-1r7dvt7"), ae(
        t,
        "can-collapse",
        /*collapsed*/
        i[4] && /*searchValue*/
        i[1] === ""
      );
    },
    m(_, O) {
      B(_, e, O), B(_, t, O), C(t, r), C(r, n), re(l, n, null), C(r, o), C(r, a), i[61](a), ht(
        a,
        /*searchValue*/
        i[1]
      ), C(r, f), C(r, u), C(u, d), re(v, d, null), C(u, b), L && L.m(u, null), C(r, S), k && k.m(r, null), C(r, p), y && y.m(r, null), C(t, P), ~w && T[w].m(t, null), h = !0, H || (m = [
        q(
          n,
          "click",
          /*click_handler*/
          i[60]
        ),
        q(
          a,
          "input",
          /*input_1_input_handler*/
          i[62]
        ),
        q(
          a,
          "focus",
          /*focus_handler*/
          i[63]
        ),
        q(
          a,
          "blur",
          /*blur_handler*/
          i[64]
        ),
        q(
          a,
          "keydown",
          /*handleKeyDown*/
          i[22]
        ),
        q(
          a,
          "input",
          /*input_handler*/
          i[65]
        ),
        q(
          d,
          "click",
          /*click_handler_1*/
          i[66]
        ),
        q(t, "submit", mi(
          /*handleOnSubmit*/
          i[21]
        ))
      ], H = !0);
    },
    p(_, O) {
      (!h || O[0] & /*placeholder*/
      256) && c(
        a,
        "placeholder",
        /*placeholder*/
        _[8]
      ), (!h || O[0] & /*placeholder*/
      256) && c(
        a,
        "aria-label",
        /*placeholder*/
        _[8]
      ), O[0] & /*searchValue*/
      2 && a.value !== /*searchValue*/
      _[1] && ht(
        a,
        /*searchValue*/
        _[1]
      ), (!h || O[0] & /*clearButtonTitle*/
      8) && c(
        d,
        "title",
        /*clearButtonTitle*/
        _[3]
      ), /*abortController*/
      _[19] ? L ? O[0] & /*abortController*/
      524288 && F(L, 1) : (L = pt(), L.c(), F(L, 1), L.m(u, null)) : L && (Fe(), Z(L, 1, 1, () => {
        L = null;
      }), Pe()), (!h || O[0] & /*searchValue*/
      2) && ae(
        u,
        "displayable",
        /*searchValue*/
        _[1] !== ""
      ), /*enableReverse*/
      _[5] === !0 ? k ? (k.p(_, O), O[0] & /*enableReverse*/
      32 && F(k, 1)) : (k = Tt(_), k.c(), F(k, 1), k.m(r, p)) : k && (Fe(), Z(k, 1, 1, () => {
        k = null;
      }), Pe()), y && y.p && (!h || O[1] & /*$$scope*/
      134217728) && ui(
        y,
        g,
        _,
        /*$$scope*/
        _[58],
        h ? ci(
          g,
          /*$$scope*/
          _[58],
          O,
          null
        ) : di(
          /*$$scope*/
          _[58]
        ),
        null
      );
      let V = w;
      w = _e(_), w === V ? ~w && T[w].p(_, O) : (E && (Fe(), Z(T[V], 1, 1, () => {
        T[V] = null;
      }), Pe()), ~w ? (E = T[w], E ? E.p(_, O) : (E = T[w] = Y[w](_), E.c()), F(E, 1), E.m(t, null)) : E = null), (!h || O[0] & /*className*/
      4 && A !== (A = mt(
        /*className*/
        _[2]
      ) + " svelte-1r7dvt7")) && c(t, "class", A), (!h || O[0] & /*className, collapsed, searchValue*/
      22) && ae(
        t,
        "can-collapse",
        /*collapsed*/
        _[4] && /*searchValue*/
        _[1] === ""
      );
    },
    i(_) {
      h || (F(M), F(l.$$.fragment, _), F(v.$$.fragment, _), F(L), F(k), F(y, _), F(E), h = !0);
    },
    o(_) {
      Z(M), Z(l.$$.fragment, _), Z(v.$$.fragment, _), Z(L), Z(k), Z(y, _), Z(E), h = !1;
    },
    d(_) {
      _ && (D(e), D(t)), ne(l), i[61](null), ne(v), L && L.d(), k && k.d(), y && y.d(_), ~w && T[w].d(), H = !1, oe(m);
    }
  };
}
function ar(i, e, t) {
  let r, { $$slots: n = {}, $$scope: l } = e, { class: o = void 0 } = e, { apiKey: a } = e, { bbox: f = void 0 } = e, { clearButtonTitle: u = "clear" } = e, { clearOnBlur: d = !1 } = e, { collapsed: v = !1 } = e, { country: b = void 0 } = e, { debounceSearch: S = 200 } = e, { enableReverse: p = !1 } = e, { errorMessage: P = "Something went wrong…" } = e, { filter: w = () => !0 } = e, { flyTo: E = !0 } = e, { fuzzyMatch: A = !0 } = e, { language: h = void 0 } = e, { limit: H = void 0 } = e, { mapController: m = void 0 } = e, { minLength: M = 2 } = e, { noResultsMessage: L = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: k = "Search" } = e, { proximity: g = [{ type: "server-geolocation" }] } = e, { reverseActive: y = p === "always" } = e, { reverseButtonTitle: Y = "toggle reverse geocoding" } = e, { searchValue: T = "" } = e, { showFullGeometry: _e = !0 } = e, { showPlaceType: _ = "ifNeeded" } = e, { showResultsWhileTyping: O = !0 } = e, { selectFirst: V = !0 } = e, { flyToSelected: Le = !1 } = e, { markerOnSelected: Ie = !0 } = e, { types: de = void 0 } = e, { excludeTypes: Oe = !1 } = e, { zoom: Ce = 16 } = e, { maxZoom: ye = 18 } = e, { apiUrl: je = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: He = {} } = e, { iconsBaseUrl: rt = "https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.0-rc5/icons/" } = e, { adjustUrlQuery: Ze = (s) => {
  } } = e;
  function Bt() {
    x.focus();
  }
  function zt() {
    x.blur();
  }
  function nt(s, j = !0) {
    t(1, T = s), j ? (t(15, R = -1), st()) : (Qe(), setTimeout(() => {
      x.focus(), x.select();
    }));
  }
  function Ft() {
    t(13, W = void 0), t(55, N = void 0), t(15, R = -1);
  }
  function Pt() {
    t(14, z = []), t(55, N = void 0);
  }
  let we = !1, W, z, N, ot = "", x, R = -1, $, Re = [], fe, Ee, Ue, Ge;
  const jt = /* @__PURE__ */ new Set(), se = vi();
  bi(() => {
    m && (m.setEventHandler(void 0), m.indicateReverse(!1), m.setSelectedMarker(-1), m.setMarkers(void 0, void 0));
  });
  function st(s) {
    if (Ee && (clearTimeout(Ee), Ee = void 0), R > -1 && W)
      t(55, N = W[R]), t(1, T = N.place_name.replace(/,.*/, "")), t(18, $ = void 0), t(14, z = void 0), t(15, R = -1);
    else if (T) {
      const j = s || !at();
      qe(T, { exact: !0 }).then(() => {
        t(14, z = W), t(55, N = void 0), j && Ht();
      }).catch((ee) => t(18, $ = ee));
    }
  }
  function at() {
    try {
      return xe(T, 6), !0;
    } catch {
      return !1;
    }
  }
  async function qe(s, { byId: j = !1, exact: ee = !1 } = {}) {
    t(18, $ = void 0), fe == null || fe.abort();
    const te = new AbortController();
    t(19, fe = te);
    try {
      const G = at(), J = new URLSearchParams();
      if (h !== void 0 && J.set("language", Array.isArray(h) ? h.join(",") : h ?? ""), de && J.set("types", de.join(",")), Oe && J.set("excludeTypes", String(Oe)), f && J.set("bbox", f.map((me) => me.toFixed(6)).join(",")), b && J.set("country", Array.isArray(b) ? b.join(",") : b), !j && !G) {
        const me = await qi(m, g, te);
        me && J.set("proximity", me), (ee || !O) && J.set("autocomplete", "false"), J.set("fuzzyMatch", String(A));
      }
      H !== void 0 && (!G || (de == null ? void 0 : de.length) === 1) && J.set("limit", String(H)), J.set("key", a), Ze(J);
      let Ke;
      try {
        const me = xe(s, 6);
        Ke = me.decimalLongitude + "," + me.decimalLatitude;
      } catch {
        Ke = s;
      }
      const De = je + "/" + encodeURIComponent(Ke) + ".json?" + J.toString();
      if (De === ot) {
        j ? (t(13, W = void 0), t(55, N = Re[0])) : t(13, W = Re);
        return;
      }
      ot = De;
      const lt = await fetch(De, { signal: te.signal, ...He });
      if (!lt.ok)
        throw new Error();
      const Je = await lt.json();
      se("response", { url: De, featureCollection: Je }), j ? (t(13, W = void 0), t(55, N = Je.features[0]), Re = [N]) : (t(13, W = Je.features.filter(w)), Re = W, G && x.focus());
    } catch (G) {
      if (G && typeof G == "object" && "name" in G && G.name === "AbortError")
        return;
      throw G;
    } finally {
      te === fe && t(19, fe = void 0);
    }
  }
  function Ht() {
    var ee;
    if (!(z != null && z.length) || !E)
      return;
    const s = [180, 90, -180, -90], j = !z.some((te) => !te.matching_text);
    for (const te of z)
      if (j || !te.matching_text)
        for (const G of [0, 1, 2, 3])
          s[G] = Math[G < 2 ? "min" : "max"](s[G], ((ee = te.bbox) == null ? void 0 : ee[G]) ?? te.center[G % 2]);
    m && z.length > 0 && (N && s[0] === s[2] && s[1] === s[3] ? m.flyTo(N.center, Ce) : m.fitBounds(Lt(s), 50, ye));
  }
  function Zt(s) {
    t(0, y = p === "always"), nt(s[1].toFixed(6) + ", " + Gi(s[0], [-180, 180], !0).toFixed(6));
  }
  function Gt(s) {
    if (!W)
      return;
    let j = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
    j && (R === (V ? 0 : -1) && j === -1 && t(15, R = W.length), t(15, R += j), R >= W.length && t(15, R = -1), R < 0 && V && t(15, R = 0), s.preventDefault());
  }
  function Qe(s = !0) {
    if (t(18, $ = void 0), O) {
      if (Ee && clearTimeout(Ee), T.length < M)
        return;
      const j = T;
      Ee = window.setTimeout(
        () => {
          qe(j).catch((ee) => t(18, $ = ee));
        },
        s ? S : 0
      );
    } else
      t(13, W = void 0), t(18, $ = void 0);
  }
  function Ve(s) {
    t(55, N = s), t(1, T = s.place_name), t(15, R = -1);
  }
  const qt = () => x.focus();
  function Qt(s) {
    $e[s ? "unshift" : "push"](() => {
      x = s, t(17, x);
    });
  }
  function Vt() {
    T = this.value, t(1, T), t(12, we), t(27, d);
  }
  const Kt = () => t(12, we = !0), Jt = () => t(12, we = !1), Xt = () => Qe(), Yt = () => {
    t(1, T = ""), x.focus();
  }, xt = () => t(0, y = !y), $t = () => t(18, $ = void 0), ei = (s) => t(15, R = s), ti = (s) => Ve(s), ii = () => {
    z && t(15, R = -1);
  }, ri = () => {
  };
  return i.$$set = (s) => {
    "class" in s && t(2, o = s.class), "apiKey" in s && t(25, a = s.apiKey), "bbox" in s && t(26, f = s.bbox), "clearButtonTitle" in s && t(3, u = s.clearButtonTitle), "clearOnBlur" in s && t(27, d = s.clearOnBlur), "collapsed" in s && t(4, v = s.collapsed), "country" in s && t(28, b = s.country), "debounceSearch" in s && t(29, S = s.debounceSearch), "enableReverse" in s && t(5, p = s.enableReverse), "errorMessage" in s && t(6, P = s.errorMessage), "filter" in s && t(30, w = s.filter), "flyTo" in s && t(31, E = s.flyTo), "fuzzyMatch" in s && t(32, A = s.fuzzyMatch), "language" in s && t(33, h = s.language), "limit" in s && t(34, H = s.limit), "mapController" in s && t(35, m = s.mapController), "minLength" in s && t(36, M = s.minLength), "noResultsMessage" in s && t(7, L = s.noResultsMessage), "placeholder" in s && t(8, k = s.placeholder), "proximity" in s && t(37, g = s.proximity), "reverseActive" in s && t(0, y = s.reverseActive), "reverseButtonTitle" in s && t(9, Y = s.reverseButtonTitle), "searchValue" in s && t(1, T = s.searchValue), "showFullGeometry" in s && t(38, _e = s.showFullGeometry), "showPlaceType" in s && t(10, _ = s.showPlaceType), "showResultsWhileTyping" in s && t(39, O = s.showResultsWhileTyping), "selectFirst" in s && t(40, V = s.selectFirst), "flyToSelected" in s && t(41, Le = s.flyToSelected), "markerOnSelected" in s && t(42, Ie = s.markerOnSelected), "types" in s && t(43, de = s.types), "excludeTypes" in s && t(44, Oe = s.excludeTypes), "zoom" in s && t(45, Ce = s.zoom), "maxZoom" in s && t(46, ye = s.maxZoom), "apiUrl" in s && t(47, je = s.apiUrl), "fetchParameters" in s && t(48, He = s.fetchParameters), "iconsBaseUrl" in s && t(11, rt = s.iconsBaseUrl), "adjustUrlQuery" in s && t(49, Ze = s.adjustUrlQuery), "$$scope" in s && t(58, l = s.$$scope);
  }, i.$$.update = () => {
    if (i.$$.dirty[0] & /*focused, clearOnBlur*/
    134221824 && setTimeout(() => {
      t(16, Ue = we), d && !we && t(1, T = "");
    }), i.$$.dirty[0] & /*searchValue, listFeatures*/
    8194 | i.$$.dirty[1] & /*minLength*/
    32 && T.length < M && (t(55, N = void 0), t(13, W = void 0), t(18, $ = void 0), t(14, z = W)), i.$$.dirty[1] & /*showFullGeometry, picked*/
    16777344 && _e && N && !N.address && N.geometry.type === "Point" && qe(N.id, { byId: !0 }).catch((s) => t(18, $ = s)), i.$$.dirty[1] & /*mapController, picked, prevIdToFly, flyTo, maxZoom, zoom*/
    50380817 && (m && N && N.id !== Ge && E && (!N.bbox || N.bbox[0] === N.bbox[2] && N.bbox[1] === N.bbox[3] ? m.flyTo(N.center, N.id.startsWith("poi.") || N.id.startsWith("address.") ? ye : Ce) : m.fitBounds(Lt(N.bbox), 50, ye), t(13, W = void 0), t(14, z = void 0), t(15, R = -1)), t(56, Ge = N == null ? void 0 : N.id)), i.$$.dirty[0] & /*listFeatures*/
    8192 | i.$$.dirty[1] & /*selectFirst*/
    512 && V && W != null && W.length && t(15, R = 0), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*selectFirst*/
    512 && (V || t(15, R = -1)), i.$$.dirty[0] & /*markedFeatures, listFeatures*/
    24576 && z !== W && t(14, z = void 0), i.$$.dirty[0] & /*reverseActive, listFeatures, markedFeatures, focusedDelayed*/
    90113 | i.$$.dirty[1] & /*mapController*/
    16 && m && m.setEventHandler((s) => {
      switch (s.type) {
        case "mapClick":
          y && Zt(s.coordinates);
          break;
        case "markerClick":
          {
            const j = W == null ? void 0 : W.find((ee) => ee.id === s.id);
            j && Ve(j);
          }
          break;
        case "markerMouseEnter":
          z && t(15, R = Ue ? (W == null ? void 0 : W.findIndex((j) => j.id === s.id)) ?? -1 : -1);
          break;
        case "markerMouseLeave":
          z && t(15, R = -1);
          break;
      }
    }), i.$$.dirty[0] & /*listFeatures, selectedItemIndex*/
    40960 && t(57, r = W == null ? void 0 : W[R]), i.$$.dirty[1] & /*mapController, selected, flyTo, flyToSelected, maxZoom, zoom*/
    67159057 && m && r && E && Le && m.flyTo(r.center, r.id.startsWith("poi.") || r.id.startsWith("address.") ? ye : Ce), i.$$.dirty[1] & /*markerOnSelected, mapController*/
    2064 && (Ie || m == null || m.setMarkers(void 0, void 0)), i.$$.dirty[0] & /*markedFeatures*/
    16384 | i.$$.dirty[1] & /*mapController, markerOnSelected, selected*/
    67110928 && m && Ie && !z && (m.setMarkers(r ? [r] : void 0, void 0), m.setSelectedMarker(r ? 0 : -1)), i.$$.dirty[0] & /*markedFeatures*/
    16384 | i.$$.dirty[1] & /*mapController, picked*/
    16777232 && m && m.setMarkers(z, N), i.$$.dirty[0] & /*markedFeatures, selectedItemIndex*/
    49152 | i.$$.dirty[1] & /*mapController*/
    16 && z && m && m.setSelectedMarker(R), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*mapController*/
    16 && m) {
      let s;
      try {
        s = xe(T, 6);
      } catch {
      }
      m.setReverseMarker(s ? [s.decimalLongitude, s.decimalLatitude] : void 0);
    }
    i.$$.dirty[1] & /*selected*/
    67108864 && se("select", r), i.$$.dirty[1] & /*picked*/
    16777216 && se("pick", N), i.$$.dirty[0] & /*focusedDelayed, listFeatures*/
    73728 && se("optionsVisibilityChange", Ue && !!W), i.$$.dirty[0] & /*listFeatures*/
    8192 && se("featuresListed", W), i.$$.dirty[0] & /*markedFeatures*/
    16384 && se("featuresMarked", z), i.$$.dirty[0] & /*reverseActive*/
    1 && se("reverseToggle", y), i.$$.dirty[0] & /*searchValue*/
    2 && se("queryChange", T), i.$$.dirty[0] & /*reverseActive*/
    1 | i.$$.dirty[1] & /*mapController*/
    16 && m && m.indicateReverse(y);
  }, [
    y,
    T,
    o,
    u,
    v,
    p,
    P,
    L,
    k,
    Y,
    _,
    rt,
    we,
    W,
    z,
    R,
    Ue,
    x,
    $,
    fe,
    jt,
    st,
    Gt,
    Qe,
    Ve,
    a,
    f,
    d,
    b,
    S,
    w,
    E,
    A,
    h,
    H,
    m,
    M,
    g,
    _e,
    O,
    V,
    Le,
    Ie,
    de,
    Oe,
    Ce,
    ye,
    je,
    He,
    Ze,
    Bt,
    zt,
    nt,
    Ft,
    Pt,
    N,
    Ge,
    r,
    l,
    n,
    qt,
    Qt,
    Vt,
    Kt,
    Jt,
    Xt,
    Yt,
    xt,
    $t,
    ei,
    ti,
    ii,
    ri
  ];
}
let lr = class extends ve {
  constructor(e) {
    super(), be(
      this,
      e,
      ar,
      sr,
      ge,
      {
        class: 2,
        apiKey: 25,
        bbox: 26,
        clearButtonTitle: 3,
        clearOnBlur: 27,
        collapsed: 4,
        country: 28,
        debounceSearch: 29,
        enableReverse: 5,
        errorMessage: 6,
        filter: 30,
        flyTo: 31,
        fuzzyMatch: 32,
        language: 33,
        limit: 34,
        mapController: 35,
        minLength: 36,
        noResultsMessage: 7,
        placeholder: 8,
        proximity: 37,
        reverseActive: 0,
        reverseButtonTitle: 9,
        searchValue: 1,
        showFullGeometry: 38,
        showPlaceType: 10,
        showResultsWhileTyping: 39,
        selectFirst: 40,
        flyToSelected: 41,
        markerOnSelected: 42,
        types: 43,
        excludeTypes: 44,
        zoom: 45,
        maxZoom: 46,
        apiUrl: 47,
        fetchParameters: 48,
        iconsBaseUrl: 11,
        adjustUrlQuery: 49,
        focus: 50,
        blur: 51,
        setQuery: 52,
        clearList: 53,
        clearMap: 54
      },
      null,
      [-1, -1, -1]
    );
  }
  get focus() {
    return this.$$.ctx[50];
  }
  get blur() {
    return this.$$.ctx[51];
  }
  get setQuery() {
    return this.$$.ctx[52];
  }
  get clearList() {
    return this.$$.ctx[53];
  }
  get clearMap() {
    return this.$$.ctx[54];
  }
};
const cr = new FinalizationRegistry((i) => {
  i.$destroy();
});
var X;
class fr extends EventTarget {
  constructor({ target: t, ...r }) {
    super();
    ut(this, X, void 0);
    dt(this, X, new lr({
      target: t,
      props: r
    }));
    for (const n of [
      "select",
      "pick",
      "featuresListed",
      "featuresMarked",
      "response",
      "optionsVisibilityChange",
      "reverseToggle",
      "queryChange"
    ])
      ie(this, X).$on(n, (l) => this.dispatchEvent(l));
    cr.register(this, ie(this, X));
  }
  setOptions(t) {
    ie(this, X).$set(t);
  }
  setQuery(t, r = !0) {
    var n;
    (n = ie(this, X)) == null || n.setQuery(t, r);
  }
  clearMap() {
    var t;
    (t = ie(this, X)) == null || t.clearMap();
  }
  clearList() {
    var t;
    (t = ie(this, X)) == null || t.clearList();
  }
  focus() {
    var t;
    (t = ie(this, X)) == null || t.focus();
  }
  blur() {
    var t;
    (t = ie(this, X)) == null || t.blur();
  }
}
X = new WeakMap();
export {
  fr as GeocodingControl
};
//# sourceMappingURL=vanilla.js.map
