@maptiler/geocoding-control 3.0.0-rc.4 → 3.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/index.js +307 -307
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.js +25 -25
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/leaflet.public.js +314 -313
  6. package/dist/leaflet.public.js.map +1 -1
  7. package/dist/leaflet.public.umd.js +28 -28
  8. package/dist/leaflet.public.umd.js.map +1 -1
  9. package/dist/maplibregl.js +296 -295
  10. package/dist/maplibregl.js.map +1 -1
  11. package/dist/maplibregl.umd.js +26 -26
  12. package/dist/maplibregl.umd.js.map +1 -1
  13. package/dist/maptilersdk.js +310 -309
  14. package/dist/maptilersdk.js.map +1 -1
  15. package/dist/maptilersdk.umd.js +29 -29
  16. package/dist/maptilersdk.umd.js.map +1 -1
  17. package/dist/openlayers.public.js +343 -341
  18. package/dist/openlayers.public.js.map +1 -1
  19. package/dist/openlayers.public.umd.js +41 -41
  20. package/dist/openlayers.public.umd.js.map +1 -1
  21. package/dist/src/controls/leaflet-events.d.ts +55 -26
  22. package/dist/src/controls/leaflet-options.d.ts +11 -1
  23. package/dist/src/controls/maplibregl-events.d.ts +54 -25
  24. package/dist/src/controls/maplibregl-options.d.ts +12 -2
  25. package/dist/src/controls/maptilersdk-control.d.ts +11 -1
  26. package/dist/src/controls/maptilersdk-events.d.ts +72 -2
  27. package/dist/src/controls/openlayers-control.d.ts +4 -4
  28. package/dist/src/controls/openlayers-events.d.ts +55 -25
  29. package/dist/src/controls/openlayers-options.d.ts +11 -1
  30. package/dist/src/geocoder/geocoder-events.d.ts +41 -27
  31. package/dist/src/geocoder/geocoder-options.d.ts +1 -3
  32. package/dist/src/leaflet.public.d.ts +1 -1
  33. package/dist/src/maplibregl.d.ts +1 -1
  34. package/dist/src/maptilersdk.d.ts +1 -1
  35. package/dist/src/openlayers.public.d.ts +1 -1
  36. package/dist/src/types.d.ts +1 -0
  37. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
1
  import { css as I, LitElement as M, svg as z, html as m, unsafeCSS as ce, nothing as X } from "lit";
2
- import { customElement as O, property as p, state as b, query as Ae } from "lit/decorators.js";
3
- import { convert as We } from "geo-coordinates-parser";
2
+ import { customElement as O, property as p, state as k, query as We } from "lit/decorators.js";
3
+ import { convert as Ve } from "geo-coordinates-parser";
4
4
  import { classMap as D } from "lit/directives/class-map.js";
5
- import { repeat as Ve } from "lit/directives/repeat.js";
5
+ import { repeat as qe } from "lit/directives/repeat.js";
6
6
  import "@turf/clone";
7
- import { styleMap as qe } from "lit/directives/style-map.js";
8
- import { featureCollection as q, polygon as Ne, feature as Ze } from "@turf/helpers";
9
- import Le from "@turf/union";
7
+ import { styleMap as Ne } from "lit/directives/style-map.js";
8
+ import { featureCollection as q, polygon as Ze, feature as Qe } from "@turf/helpers";
9
+ import $e from "@turf/union";
10
10
  import he from "maplibre-gl";
11
- import be from "@turf/bbox";
12
- import Qe from "@turf/difference";
13
- import Ke from "@turf/flatten";
14
- var Ye = Object.getOwnPropertyDescriptor, He = (t, e, i, o) => {
15
- for (var r = o > 1 ? void 0 : o ? Ye(e, i) : e, s = t.length - 1, a; s >= 0; s--)
16
- (a = t[s]) && (r = a(r) || r);
17
- return r;
11
+ import ke from "@turf/bbox";
12
+ import Ke from "@turf/difference";
13
+ import Ye from "@turf/flatten";
14
+ var He = Object.getOwnPropertyDescriptor, Je = (t, e, i, a) => {
15
+ for (var s = a > 1 ? void 0 : a ? He(e, i) : e, o = t.length - 1, r; o >= 0; o--)
16
+ (r = t[o]) && (s = r(s) || s);
17
+ return s;
18
18
  };
19
19
  let ee = class extends M {
20
20
  render() {
@@ -33,13 +33,13 @@ ee.styles = I`
33
33
  fill: var(--color-icon-button);
34
34
  }
35
35
  `;
36
- ee = He([
36
+ ee = Je([
37
37
  O("maptiler-geocode-clear-icon")
38
38
  ], ee);
39
- var Je = Object.getOwnPropertyDescriptor, Xe = (t, e, i, o) => {
40
- for (var r = o > 1 ? void 0 : o ? Je(e, i) : e, s = t.length - 1, a; s >= 0; s--)
41
- (a = t[s]) && (r = a(r) || r);
42
- return r;
39
+ var Xe = Object.getOwnPropertyDescriptor, et = (t, e, i, a) => {
40
+ for (var s = a > 1 ? void 0 : a ? Xe(e, i) : e, o = t.length - 1, r; o >= 0; o--)
41
+ (r = t[o]) && (s = r(s) || s);
42
+ return s;
43
43
  };
44
44
  let te = class extends M {
45
45
  render() {
@@ -58,13 +58,13 @@ te.styles = I`
58
58
  fill: #e15042;
59
59
  }
60
60
  `;
61
- te = Xe([
61
+ te = et([
62
62
  O("maptiler-geocode-fail-icon")
63
63
  ], te);
64
- var et = Object.getOwnPropertyDescriptor, tt = (t, e, i, o) => {
65
- for (var r = o > 1 ? void 0 : o ? et(e, i) : e, s = t.length - 1, a; s >= 0; s--)
66
- (a = t[s]) && (r = a(r) || r);
67
- return r;
64
+ var tt = Object.getOwnPropertyDescriptor, it = (t, e, i, a) => {
65
+ for (var s = a > 1 ? void 0 : a ? tt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
66
+ (r = t[o]) && (s = r(s) || s);
67
+ return s;
68
68
  };
69
69
  let ie = class extends M {
70
70
  render() {
@@ -105,13 +105,13 @@ ie.styles = I`
105
105
  }
106
106
  }
107
107
  `;
108
- ie = tt([
108
+ ie = it([
109
109
  O("maptiler-geocode-loading-icon")
110
110
  ], ie);
111
- var it = Object.getOwnPropertyDescriptor, st = (t, e, i, o) => {
112
- for (var r = o > 1 ? void 0 : o ? it(e, i) : e, s = t.length - 1, a; s >= 0; s--)
113
- (a = t[s]) && (r = a(r) || r);
114
- return r;
111
+ var st = Object.getOwnPropertyDescriptor, rt = (t, e, i, a) => {
112
+ for (var s = a > 1 ? void 0 : a ? st(e, i) : e, o = t.length - 1, r; o >= 0; o--)
113
+ (r = t[o]) && (s = r(s) || s);
114
+ return s;
115
115
  };
116
116
  let se = class extends M {
117
117
  render() {
@@ -130,13 +130,13 @@ se.styles = I`
130
130
  fill: var(--color-icon-button);
131
131
  }
132
132
  `;
133
- se = st([
133
+ se = rt([
134
134
  O("maptiler-geocode-reverse-geocoding-icon")
135
135
  ], se);
136
- var rt = Object.getOwnPropertyDescriptor, ot = (t, e, i, o) => {
137
- for (var r = o > 1 ? void 0 : o ? rt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
138
- (a = t[s]) && (r = a(r) || r);
139
- return r;
136
+ var ot = Object.getOwnPropertyDescriptor, at = (t, e, i, a) => {
137
+ for (var s = a > 1 ? void 0 : a ? ot(e, i) : e, o = t.length - 1, r; o >= 0; o--)
138
+ (r = t[o]) && (s = r(s) || s);
139
+ return s;
140
140
  };
141
141
  let re = class extends M {
142
142
  render() {
@@ -169,74 +169,74 @@ re.styles = I`
169
169
  stroke: var(--color-icon-button);
170
170
  }
171
171
  `;
172
- re = ot([
172
+ re = at([
173
173
  O("maptiler-geocode-search-icon")
174
174
  ], re);
175
- function at(t, e, i) {
176
- const o = e[1], r = e[0], s = o - r;
177
- return t === o && i ? t : ((t - r) % s + s) % s + r;
175
+ function lt(t, e, i) {
176
+ const a = e[1], s = e[0], o = a - s;
177
+ return t === a && i ? t : ((t - s) % o + o) % o + s;
178
178
  }
179
179
  function N(t) {
180
180
  const e = [...t];
181
181
  return e[2] < e[0] && (Math.abs((e[0] + e[2] + 360) / 2) > Math.abs((e[0] - 360 + e[2]) / 2) ? e[0] -= 360 : e[2] += 360), e;
182
182
  }
183
183
  let U;
184
- async function lt(t, e, i) {
185
- for (const o of e ?? [])
186
- if (!(t && (o.minZoom != null && o.minZoom > t[0] || o.maxZoom != null && o.maxZoom < t[0]))) {
187
- if (o.type === "fixed")
188
- return o.coordinates.join(",");
189
- if (o.type === "client-geolocation")
190
- if (U && o.cachedLocationExpiry && U.time + o.cachedLocationExpiry > Date.now()) {
184
+ async function nt(t, e, i) {
185
+ for (const a of e ?? [])
186
+ if (!(t && (a.minZoom != null && a.minZoom > t[0] || a.maxZoom != null && a.maxZoom < t[0]))) {
187
+ if (a.type === "fixed")
188
+ return a.coordinates.join(",");
189
+ if (a.type === "client-geolocation")
190
+ if (U && a.cachedLocationExpiry && U.time + a.cachedLocationExpiry > Date.now()) {
191
191
  if (U.coords)
192
192
  return U.coords;
193
193
  } else {
194
- let r;
194
+ let s;
195
195
  try {
196
- return r = await new Promise((s, a) => {
196
+ return s = await new Promise((o, r) => {
197
197
  i.signal.addEventListener("abort", () => {
198
- a(Error("aborted"));
198
+ r(Error("aborted"));
199
199
  }), navigator.geolocation.getCurrentPosition(
200
- (f) => {
201
- s([f.coords.longitude, f.coords.latitude].map((L) => L.toFixed(6)).join(","));
200
+ (u) => {
201
+ o([u.coords.longitude, u.coords.latitude].map((y) => y.toFixed(6)).join(","));
202
202
  },
203
- (f) => {
204
- a(f);
203
+ (u) => {
204
+ r(u);
205
205
  },
206
- o
206
+ a
207
207
  );
208
- }), r;
208
+ }), s;
209
209
  } catch {
210
210
  } finally {
211
- o.cachedLocationExpiry && (U = {
211
+ a.cachedLocationExpiry && (U = {
212
212
  time: Date.now(),
213
- coords: r
213
+ coords: s
214
214
  });
215
215
  }
216
216
  if (i.signal.aborted)
217
217
  return;
218
218
  }
219
- if (o.type === "server-geolocation")
219
+ if (a.type === "server-geolocation")
220
220
  return "ip";
221
- if (t && o.type === "map-center")
221
+ if (t && a.type === "map-center")
222
222
  return t[1].toFixed(6) + "," + t[2].toFixed(6);
223
223
  }
224
224
  }
225
- const nt = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
226
- var ct = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, $e = (t) => {
225
+ const ct = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
226
+ var ht = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, Ie = (t) => {
227
227
  throw TypeError(t);
228
- }, _ = (t, e, i, o) => {
229
- for (var r = o > 1 ? void 0 : o ? ht(e, i) : e, s = t.length - 1, a; s >= 0; s--)
230
- (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
231
- return o && r && ct(e, i, r), r;
232
- }, Ie = (t, e, i) => e.has(t) || $e("Cannot " + i), u = (t, e, i) => (Ie(t, e, "read from private field"), i ? i.call(t) : e.get(t)), pt = (t, e, i) => e.has(t) ? $e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i) => (Ie(t, e, "access private method"), i), d, Z, B, g, Me, Oe, pe, oe;
233
- const Te = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Se = Te ? "@2x" : "", F = Te ? 2 : 1;
234
- let T, Fe, k = class extends M {
228
+ }, L = (t, e, i, a) => {
229
+ for (var s = a > 1 ? void 0 : a ? pt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
230
+ (r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
231
+ return a && s && ht(e, i, s), s;
232
+ }, Me = (t, e, i) => e.has(t) || Ie("Cannot " + i), f = (t, e, i) => (Me(t, e, "read from private field"), i ? i.call(t) : e.get(t)), dt = (t, e, i) => e.has(t) ? Ie("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i) => (Me(t, e, "access private method"), i), d, Z, B, g, Oe, Te, pe, oe;
233
+ const Fe = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Se = Fe ? "@2x" : "", S = Fe ? 2 : 1;
234
+ let F, Ce, w = class extends M {
235
235
  constructor() {
236
- super(...arguments), pt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
236
+ super(...arguments), dt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
237
237
  }
238
238
  willUpdate(t) {
239
- t.has("feature") && u(this, d, Z) && (this.index = u(this, d, Z).length, E(this, d, pe).call(this));
239
+ t.has("feature") && f(this, d, Z) && (this.index = f(this, d, Z).length, E(this, d, pe).call(this));
240
240
  }
241
241
  render() {
242
242
  return m`
@@ -248,28 +248,28 @@ let T, Fe, k = class extends M {
248
248
  class=${this.itemStyle}
249
249
  @click=${() => this.dispatchEvent(new CustomEvent("select"))}
250
250
  >
251
- ${T && this.spriteIcon ? m`
251
+ ${F && this.spriteIcon ? m`
252
252
  <div
253
253
  class="sprite-icon"
254
- style=${qe({
255
- width: `${this.spriteIcon.width / F}px`,
256
- height: `${this.spriteIcon.height / F}px`,
254
+ style=${Ne({
255
+ width: `${this.spriteIcon.width / S}px`,
256
+ height: `${this.spriteIcon.height / S}px`,
257
257
  backgroundImage: `url(${this.iconsBaseUrl}sprite${Se}.png)`,
258
- backgroundPosition: `-${this.spriteIcon.x / F}px -${this.spriteIcon.y / F}px`,
259
- backgroundSize: `${T.width / F}px ${T.height / F}px`
258
+ backgroundPosition: `-${this.spriteIcon.x / S}px -${this.spriteIcon.y / S}px`,
259
+ backgroundSize: `${F.width / S}px ${F.height / S}px`
260
260
  })}
261
- title=${u(this, d, g)}
261
+ title=${f(this, d, g)}
262
262
  />
263
- ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${u(this, d, g)} @error=${E(this, d, Oe)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : u(this, d, B) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> `}
263
+ ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, d, g)} @error=${E(this, d, Te)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : f(this, d, B) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> `}
264
264
 
265
265
  <span class="texts">
266
266
  <span>
267
- <span class="primary"> ${u(this, d, B) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
267
+ <span class="primary"> ${f(this, d, B) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
268
268
 
269
- ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !u(this, d, B) ? m` <span class="secondary"> ${u(this, d, g)} </span> ` : X}
269
+ ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !f(this, d, B) ? m` <span class="secondary"> ${f(this, d, g)} </span> ` : X}
270
270
  </span>
271
271
 
272
- <span class="line2"> ${u(this, d, B) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
272
+ <span class="line2"> ${f(this, d, B) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
273
273
  </span>
274
274
  </li>
275
275
  `;
@@ -285,69 +285,69 @@ B = function() {
285
285
  g = function() {
286
286
  return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
287
287
  };
288
- Me = function() {
289
- Fe ??= fetch(`${this.iconsBaseUrl}sprite${Se}.json`).then((t) => t.json()).then((t) => {
290
- T = t;
288
+ Oe = function() {
289
+ Ce ??= fetch(`${this.iconsBaseUrl}sprite${Se}.json`).then((t) => t.json()).then((t) => {
290
+ F = t;
291
291
  }).catch(() => {
292
- T = null;
292
+ F = null;
293
293
  });
294
294
  };
295
- Oe = function() {
295
+ Te = function() {
296
296
  this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, d, pe).call(this);
297
297
  };
298
298
  pe = function() {
299
- T !== void 0 ? E(this, d, oe).call(this) : (E(this, d, Me).call(this), Fe?.then(() => {
299
+ F !== void 0 ? E(this, d, oe).call(this) : (E(this, d, Oe).call(this), Ce?.then(() => {
300
300
  E(this, d, oe).call(this);
301
301
  }));
302
302
  };
303
303
  oe = function() {
304
304
  do {
305
- if (this.index--, this.category = u(this, d, Z)?.[this.index], this.spriteIcon = this.category ? T?.icons[this.category] : void 0, this.spriteIcon)
305
+ if (this.index--, this.category = f(this, d, Z)?.[this.index], this.spriteIcon = this.category ? F?.icons[this.category] : void 0, this.spriteIcon)
306
306
  break;
307
307
  this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
308
308
  } while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
309
309
  };
310
- k.styles = I`
311
- ${ce(nt)}
310
+ w.styles = I`
311
+ ${ce(ct)}
312
312
  `;
313
- _([
313
+ L([
314
314
  p({ type: Object })
315
- ], k.prototype, "feature", 2);
316
- _([
315
+ ], w.prototype, "feature", 2);
316
+ L([
317
317
  p({ type: String })
318
- ], k.prototype, "itemStyle", 2);
319
- _([
318
+ ], w.prototype, "itemStyle", 2);
319
+ L([
320
320
  p({ type: String })
321
- ], k.prototype, "showPlaceType", 2);
322
- _([
321
+ ], w.prototype, "showPlaceType", 2);
322
+ L([
323
323
  p({ attribute: !1 })
324
- ], k.prototype, "missingIconsCache", 2);
325
- _([
324
+ ], w.prototype, "missingIconsCache", 2);
325
+ L([
326
326
  p({ type: String })
327
- ], k.prototype, "iconsBaseUrl", 2);
328
- _([
329
- b()
330
- ], k.prototype, "category", 2);
331
- _([
332
- b()
333
- ], k.prototype, "imageUrl", 2);
334
- _([
335
- b()
336
- ], k.prototype, "spriteIcon", 2);
337
- _([
338
- b()
339
- ], k.prototype, "index", 2);
340
- k = _([
327
+ ], w.prototype, "iconsBaseUrl", 2);
328
+ L([
329
+ k()
330
+ ], w.prototype, "category", 2);
331
+ L([
332
+ k()
333
+ ], w.prototype, "imageUrl", 2);
334
+ L([
335
+ k()
336
+ ], w.prototype, "spriteIcon", 2);
337
+ L([
338
+ k()
339
+ ], w.prototype, "index", 2);
340
+ w = L([
341
341
  O("maptiler-geocoder-feature-item")
342
- ], k);
343
- const dt = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
344
- var ut = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Ce = (t) => {
342
+ ], w);
343
+ const ut = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
344
+ var ft = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, Ee = (t) => {
345
345
  throw TypeError(t);
346
- }, c = (t, e, i, o) => {
347
- for (var r = o > 1 ? void 0 : o ? ft(e, i) : e, s = t.length - 1, a; s >= 0; s--)
348
- (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
349
- return o && r && ut(e, i, r), r;
350
- }, de = (t, e, i) => e.has(t) || Ce("Cannot " + i), x = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), C = (t, e, i) => e.has(t) ? Ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, o) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), Q, V, G, ae, R, l, K, Ee, Pe, ue, v, fe, Y, me, ge, $, ye, H, Ue, le, Be, Ge, Re, ze, je;
346
+ }, c = (t, e, i, a) => {
347
+ for (var s = a > 1 ? void 0 : a ? mt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
348
+ (r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
349
+ return a && s && ft(e, i, s), s;
350
+ }, de = (t, e, i) => e.has(t) || Ee("Cannot " + i), b = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), C = (t, e, i) => e.has(t) ? Ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, a) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), Q, V, G, ae, R, l, K, Pe, Ue, ue, x, fe, Y, me, ge, $, ye, H, Be, le, Ge, Re, ze, je, De;
351
351
  let n = class extends M {
352
352
  constructor() {
353
353
  super(...arguments), C(this, l), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.focusedDelayed = !1, C(this, Q, !1), C(this, V, !1), C(this, G), C(this, ae, /* @__PURE__ */ new Set()), C(this, R);
@@ -363,7 +363,7 @@ let n = class extends M {
363
363
  setOptions(t) {
364
364
  const e = { ...t };
365
365
  for (const i of Object.keys(e))
366
- mt.includes(i) || delete e[i];
366
+ gt.includes(i) || delete e[i];
367
367
  Object.assign(this, e);
368
368
  }
369
369
  /**
@@ -372,7 +372,7 @@ let n = class extends M {
372
372
  * @param value text to set
373
373
  */
374
374
  setQuery(t) {
375
- h(this, l, ge).call(this, t), h(this, l, me).call(this);
375
+ h(this, l, ge).call(this, t, { external: !0 }), h(this, l, me).call(this);
376
376
  }
377
377
  /**
378
378
  * Set the content of search input box and immediately submit it.
@@ -414,19 +414,19 @@ let n = class extends M {
414
414
  }
415
415
  /** @internal */
416
416
  handleMapClick(t) {
417
- this.reverseActive && h(this, l, Ue).call(this, t);
417
+ this.reverseActive && h(this, l, Be).call(this, t);
418
418
  }
419
419
  willUpdate(t) {
420
- t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && x(this, l, ue) && (h(this, l, $).call(this), this.error = void 0), ["focused"].some((e) => t.has(e)) && setTimeout(() => {
420
+ t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && b(this, l, ue) && (h(this, l, $).call(this), this.error = void 0), ["focused"].some((e) => t.has(e)) && setTimeout(() => {
421
421
  this.focusedDelayed = this.focused, this.clearOnBlur && !this.focused && (this.searchValue = "");
422
- }, 100), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, v).call(this, "select", { feature: x(this, l, K) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
422
+ }, 100), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, x).call(this, "select", { feature: b(this, l, K) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
423
423
  () => {
424
- h(this, l, v).call(this, "pick", { feature: this.picked });
424
+ h(this, l, x).call(this, "pick", { feature: this.picked });
425
425
  },
426
426
  (e) => {
427
- e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, l, v).call(this, "pick", { feature: this.picked }));
427
+ e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, l, x).call(this, "pick", { feature: this.picked }));
428
428
  }
429
- ), ["listFeatures", "focusedDelayed"].some((e) => t.has(e)) && (x(this, l, Ee) ? (h(this, l, v).call(this, "featuresshow"), W(this, V, !0)) : x(this, V) && h(this, l, v).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, l, v).call(this, "reversetoggle", { reverse: this.reverseActive });
429
+ ), ["listFeatures", "focusedDelayed"].some((e) => t.has(e)) && (b(this, l, Pe) ? (h(this, l, x).call(this, "featuresshow"), W(this, V, !0)) : b(this, V) && h(this, l, x).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, l, x).call(this, "reversetoggle", { reverse: this.reverseActive });
430
430
  }
431
431
  render() {
432
432
  return m`
@@ -448,15 +448,15 @@ let n = class extends M {
448
448
  @blur=${() => this.focused = !1}
449
449
  @click=${() => this.focused = !0}
450
450
  @keydown=${h(this, l, le)}
451
- @input=${h(this, l, Be)}
451
+ @input=${h(this, l, Ge)}
452
452
  @change=${() => this.picked = void 0}
453
453
  placeholder=${this.placeholder ?? "Search"}
454
454
  aria-label=${this.placeholder ?? "Search"}
455
455
  />
456
456
 
457
457
  <div class="clear-button-container ${D({ displayable: this.searchValue !== "" })}">
458
- ${x(this, l, Pe) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
459
- <button type="button" @click=${h(this, l, je)} title=${this.clearButtonTitle ?? "clear"}>
458
+ ${b(this, l, Ue) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
459
+ <button type="button" @click=${h(this, l, De)} title=${this.clearButtonTitle ?? "clear"}>
460
460
  <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
461
461
  </button>
462
462
  `}
@@ -495,8 +495,8 @@ let n = class extends M {
495
495
  </div>
496
496
  </div>
497
497
  ` : m`
498
- <ul class="options ${D({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, l, ze)} @keydown=${h(this, l, le)} role="listbox">
499
- ${Ve(
498
+ <ul class="options ${D({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, l, je)} @keydown=${h(this, l, le)} role="listbox">
499
+ ${qe(
500
500
  this.listFeatures,
501
501
  (t) => t.id + (t.address ? "," + t.address : ""),
502
502
  (t, e) => m`
@@ -505,13 +505,13 @@ let n = class extends M {
505
505
  .showPlaceType=${this.showPlaceType ?? "if-needed"}
506
506
  itemStyle=${this.selectedItemIndex === e ? "selected" : this.picked?.id === t.id ? "picked" : "default"}
507
507
  @mouseenter=${() => {
508
- h(this, l, Re).call(this, e);
508
+ h(this, l, ze).call(this, e);
509
509
  }}
510
510
  @select=${() => {
511
- h(this, l, Ge).call(this, t);
511
+ h(this, l, Re).call(this, t);
512
512
  }}
513
- .missingIconsCache=${x(this, ae)}
514
- .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.4/icons/"}
513
+ .missingIconsCache=${b(this, ae)}
514
+ .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.6/icons/"}
515
515
  >
516
516
  ${t.place_name}
517
517
  </maptiler-geocoder-feature-item>
@@ -532,17 +532,17 @@ l = /* @__PURE__ */ new WeakSet();
532
532
  K = function() {
533
533
  return this.listFeatures?.[this.selectedItemIndex];
534
534
  };
535
- Ee = function() {
535
+ Pe = function() {
536
536
  return !!this.listFeatures?.length && (this.focusedDelayed || this.keepListOpen);
537
537
  };
538
- Pe = function() {
538
+ Ue = function() {
539
539
  return this.abortController !== void 0;
540
540
  };
541
541
  ue = function() {
542
542
  return this.searchValue.length < (this.minLength ?? 2);
543
543
  };
544
- v = function(t, ...[e]) {
545
- x(this, Q) && this.dispatchEvent(
544
+ x = function(t, ...[e]) {
545
+ b(this, Q) && this.dispatchEvent(
546
546
  new CustomEvent(t, {
547
547
  bubbles: !0,
548
548
  composed: !0,
@@ -551,13 +551,13 @@ v = function(t, ...[e]) {
551
551
  );
552
552
  };
553
553
  fe = function(t) {
554
- t?.preventDefault(), this.focused = !1, clearTimeout(x(this, G)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, l, H).call(this, this.searchValue, { exact: !0 }).then(() => {
554
+ t?.preventDefault(), this.focused = !1, clearTimeout(b(this, G)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, l, H).call(this, this.searchValue, { exact: !0, external: t === void 0 }).then(() => {
555
555
  this.picked = void 0;
556
556
  }).catch((e) => this.error = e);
557
557
  };
558
558
  Y = function(t) {
559
559
  try {
560
- return We(t, 6);
560
+ return Ve(t, 6);
561
561
  } catch {
562
562
  return !1;
563
563
  }
@@ -567,87 +567,87 @@ me = function() {
567
567
  this.input.focus(), this.focused = !0, this.input.select();
568
568
  });
569
569
  };
570
- ge = function(t) {
571
- if (this.searchValue = t, h(this, l, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
572
- if (clearTimeout(x(this, G)), x(this, l, ue))
570
+ ge = function(t, { external: e = !1 } = {}) {
571
+ if (this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
572
+ if (clearTimeout(b(this, G)), b(this, l, ue))
573
573
  return;
574
- const e = this.searchValue;
574
+ const i = this.searchValue;
575
575
  W(this, G, window.setTimeout(() => {
576
- h(this, l, H).call(this, e).catch((i) => this.error = i);
576
+ h(this, l, H).call(this, i, { external: e }).catch((a) => this.error = a);
577
577
  }, this.debounceSearch ?? 200));
578
578
  } else
579
579
  h(this, l, $).call(this);
580
580
  };
581
581
  $ = function() {
582
- this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, l, v).call(this, "featuresclear"));
582
+ this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, l, x).call(this, "featuresclear"));
583
583
  };
584
584
  ye = function(t) {
585
- this.searchValue = t, h(this, l, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.selectedItemIndex = -1, h(this, l, fe).call(this);
585
+ this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.selectedItemIndex = -1, h(this, l, fe).call(this);
586
586
  };
587
- H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
587
+ H = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
588
588
  this.error = void 0, this.abortController?.abort();
589
- const o = new AbortController();
590
- this.abortController = o;
589
+ const s = new AbortController();
590
+ this.abortController = s;
591
591
  try {
592
- const r = this.apiUrl ?? "https://api.maptiler.com/geocoding", s = h(this, l, Y).call(this, t), a = new URL(r + "/" + encodeURIComponent(s ? `${s.decimalLongitude},${s.decimalLatitude}` : t) + ".json"), f = a.searchParams;
593
- this.language !== void 0 && f.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
594
- const [L] = x(this, R) ?? [void 0];
595
- let w = (!s || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
596
- (y) => typeof y == "string" ? y : L === void 0 || (y[0] ?? 0) <= L && L < (y[1] ?? 1 / 0) ? y[2] : void 0
597
- ).filter((y) => y !== void 0);
598
- w && (w = [...new Set(w)], f.set("types", w.join(",")));
599
- const S = !s || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
600
- if (S && f.set("excludeTypes", String(S)), this.bbox && f.set("bbox", this.bbox.map((y) => y.toFixed(6)).join(",")), this.country && f.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && f.set("worldview", this.worldview), !e && !s) {
601
- const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await lt(x(this, R), y, o);
602
- xe && f.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && f.set("autocomplete", "false"), f.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
592
+ const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", r = h(this, l, Y).call(this, t), u = new URL(o + "/" + encodeURIComponent(r ? `${r.decimalLongitude},${r.decimalLatitude}` : t) + ".json"), y = u.searchParams;
593
+ this.language !== void 0 && y.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
594
+ const [T] = b(this, R) ?? [void 0];
595
+ let _ = (!r || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
596
+ (v) => typeof v == "string" ? v : T === void 0 || (v[0] ?? 0) <= T && T < (v[1] ?? 1 / 0) ? v[2] : void 0
597
+ ).filter((v) => v !== void 0);
598
+ _ && (_ = [...new Set(_)], y.set("types", _.join(",")));
599
+ const ve = !r || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
600
+ if (ve && y.set("excludeTypes", String(ve)), this.bbox && y.set("bbox", this.bbox.map((v) => v.toFixed(6)).join(",")), this.country && y.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && y.set("worldview", this.worldview), !e && !r) {
601
+ const v = this.proximity ?? [{ type: "server-geolocation" }], be = await nt(b(this, R), v, s);
602
+ be && y.set("proximity", be), (i || this.showResultsWhileTyping === !1) && y.set("autocomplete", "false"), y.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
603
603
  }
604
- const ve = this.limit ?? 5, J = this.reverseGeocodingLimit ?? ve;
605
- J > 1 && w?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), s ? (J === 1 || this.exhaustiveReverseGeocoding || w?.length === 1) && f.set("limit", String(J)) : f.set("limit", String(ve)), this.apiKey && f.set("key", this.apiKey), this.adjustUrl?.(a);
606
- const De = a.searchParams.get("types") === "" && a.searchParams.get("excludeTypes") !== "true", j = a.toString();
604
+ const xe = this.limit ?? 5, J = this.reverseGeocodingLimit ?? xe;
605
+ J > 1 && _?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), r ? (J === 1 || this.exhaustiveReverseGeocoding || _?.length === 1) && y.set("limit", String(J)) : y.set("limit", String(xe)), this.apiKey && y.set("key", this.apiKey), this.adjustUrl?.(u);
606
+ const Ae = u.searchParams.get("types") === "" && u.searchParams.get("excludeTypes") !== "true", j = u.toString();
607
607
  if (j === this.lastSearchUrl) {
608
- e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, v).call(this, "featureslisted", { features: this.listFeatures }), this.listFeatures[this.selectedItemIndex]?.id !== x(this, l, K)?.id && (this.selectedItemIndex = -1));
608
+ e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.listFeatures[this.selectedItemIndex]?.id !== b(this, l, K)?.id && (this.selectedItemIndex = -1));
609
609
  return;
610
610
  }
611
- h(this, l, v).call(this, "request", { urlObj: a }), this.lastSearchUrl = j;
611
+ h(this, l, x).call(this, "request", { urlObj: u }), this.lastSearchUrl = j;
612
612
  let P;
613
- if (De)
613
+ if (Ae)
614
614
  P = { type: "FeatureCollection", features: [] };
615
615
  else {
616
- const y = await fetch(j, {
617
- signal: o.signal,
616
+ const v = await fetch(j, {
617
+ signal: s.signal,
618
618
  ...this.fetchParameters
619
619
  });
620
- if (!y.ok)
621
- throw new Error(await y.text());
622
- P = await y.json();
620
+ if (!v.ok)
621
+ throw new Error(await v.text());
622
+ P = await v.json();
623
623
  }
624
- h(this, l, v).call(this, "response", { url: j, featureCollection: P }), e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = P.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = P.features.filter(this.filter ?? (() => !0)), s && this.listFeatures.unshift({
624
+ h(this, l, x).call(this, "response", { url: j, featureCollection: P }), e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = P.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = P.features.filter(this.filter ?? (() => !0)), r && this.listFeatures.unshift({
625
625
  type: "Feature",
626
626
  properties: {},
627
627
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
628
- id: `reverse_${s.decimalLongitude}_${s.decimalLatitude}`,
629
- text: `${s.decimalLatitude}, ${s.decimalLongitude}`,
630
- place_name: s.toCoordinateFormat("DMS"),
628
+ id: `reverse_${r.decimalLongitude}_${r.decimalLatitude}`,
629
+ text: `${r.decimalLatitude}, ${r.decimalLongitude}`,
630
+ place_name: r.toCoordinateFormat("DMS"),
631
631
  /* eslint-enable @typescript-eslint/restrict-template-expressions */
632
632
  place_type: ["reverse"],
633
633
  place_type_name: ["reverse"],
634
- center: [s.decimalLongitude, s.decimalLatitude],
635
- bbox: [s.decimalLongitude, s.decimalLatitude, s.decimalLongitude, s.decimalLatitude],
634
+ center: [r.decimalLongitude, r.decimalLatitude],
635
+ bbox: [r.decimalLongitude, r.decimalLatitude, r.decimalLongitude, r.decimalLatitude],
636
636
  geometry: {
637
637
  type: "Point",
638
- coordinates: [s.decimalLongitude, s.decimalLatitude]
638
+ coordinates: [r.decimalLongitude, r.decimalLatitude]
639
639
  }
640
- }), h(this, l, v).call(this, "featureslisted", { features: this.listFeatures }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== x(this, l, K)?.id && (this.selectedItemIndex = -1), s && this.input.focus());
641
- } catch (r) {
642
- if (r && typeof r == "object" && "name" in r && r.name === "AbortError")
640
+ }), h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== b(this, l, K)?.id && (this.selectedItemIndex = -1), r && this.input.focus());
641
+ } catch (o) {
642
+ if (o && typeof o == "object" && "name" in o && o.name === "AbortError")
643
643
  return;
644
- throw r;
644
+ throw o;
645
645
  } finally {
646
- o === this.abortController && (this.abortController = void 0);
646
+ s === this.abortController && (this.abortController = void 0);
647
647
  }
648
648
  };
649
- Ue = function(t) {
650
- this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${at(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, me).call(this);
649
+ Be = function(t) {
650
+ this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${lt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, me).call(this);
651
651
  };
652
652
  le = function(t) {
653
653
  if (!this.listFeatures)
@@ -655,23 +655,23 @@ le = function(t) {
655
655
  const e = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
656
656
  e && (this.input.focus(), this.focused = !0, t.preventDefault(), this.picked && this.selectedItemIndex === -1 && (this.selectedItemIndex = this.listFeatures.findIndex((i) => i.id === this.picked?.id)), this.selectedItemIndex === (this.picked || this.selectFirst !== !1 ? 0 : -1) && e === -1 && (this.selectedItemIndex = this.listFeatures.length), this.selectedItemIndex += e, this.selectedItemIndex >= this.listFeatures.length && (this.selectedItemIndex = -1), this.selectedItemIndex < 0 && (this.picked || this.selectFirst !== !1) && (this.selectedItemIndex = 0));
657
657
  };
658
- Be = function(t) {
658
+ Ge = function(t) {
659
659
  h(this, l, ge).call(this, t.target.value);
660
660
  };
661
- Ge = function(t) {
661
+ Re = function(t) {
662
662
  (!this.picked || this.picked.id !== t.id) && (this.picked = t, this.searchValue = t.place_name);
663
663
  };
664
- Re = function(t) {
664
+ ze = function(t) {
665
665
  this.selectedItemIndex = t;
666
666
  };
667
- ze = function() {
667
+ je = function() {
668
668
  (!this.selectFirst || this.picked) && (this.selectedItemIndex = -1);
669
669
  };
670
- je = function() {
671
- this.searchValue = "", h(this, l, v).call(this, "queryclear"), this.picked = void 0, this.input.focus();
670
+ De = function() {
671
+ this.searchValue = "", h(this, l, x).call(this, "queryclear"), this.picked = void 0, this.input.focus();
672
672
  };
673
673
  n.styles = I`
674
- ${ce(dt)}
674
+ ${ce(ut)}
675
675
  `;
676
676
  c([
677
677
  p({ attribute: !1 })
@@ -785,42 +785,42 @@ c([
785
785
  p({ type: String })
786
786
  ], n.prototype, "worldview", 2);
787
787
  c([
788
- Ae("input")
788
+ We("input")
789
789
  ], n.prototype, "input", 2);
790
790
  c([
791
- b()
791
+ k()
792
792
  ], n.prototype, "searchValue", 2);
793
793
  c([
794
- b()
794
+ k()
795
795
  ], n.prototype, "listFeatures", 2);
796
796
  c([
797
- b()
797
+ k()
798
798
  ], n.prototype, "selectedItemIndex", 2);
799
799
  c([
800
- b()
800
+ k()
801
801
  ], n.prototype, "picked", 2);
802
802
  c([
803
- b()
803
+ k()
804
804
  ], n.prototype, "cachedFeatures", 2);
805
805
  c([
806
- b()
806
+ k()
807
807
  ], n.prototype, "lastSearchUrl", 2);
808
808
  c([
809
- b()
809
+ k()
810
810
  ], n.prototype, "error", 2);
811
811
  c([
812
- b()
812
+ k()
813
813
  ], n.prototype, "abortController", 2);
814
814
  c([
815
- b()
815
+ k()
816
816
  ], n.prototype, "focused", 2);
817
817
  c([
818
- b()
818
+ k()
819
819
  ], n.prototype, "focusedDelayed", 2);
820
820
  n = c([
821
821
  O("maptiler-geocoder")
822
822
  ], n);
823
- const mt = [
823
+ const gt = [
824
824
  "adjustUrl",
825
825
  "apiKey",
826
826
  "apiUrl",
@@ -858,11 +858,11 @@ const mt = [
858
858
  "types",
859
859
  "reverseGeocodingTypes",
860
860
  "worldview"
861
- ], gt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
862
- var yt = Object.getOwnPropertyDescriptor, vt = (t, e, i, o) => {
863
- for (var r = o > 1 ? void 0 : o ? yt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
864
- (a = t[s]) && (r = a(r) || r);
865
- return r;
861
+ ], yt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
862
+ var vt = Object.getOwnPropertyDescriptor, xt = (t, e, i, a) => {
863
+ for (var s = a > 1 ? void 0 : a ? vt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
864
+ (r = t[o]) && (s = r(s) || s);
865
+ return s;
866
866
  };
867
867
  let ne = class extends M {
868
868
  render() {
@@ -881,15 +881,15 @@ let ne = class extends M {
881
881
  }
882
882
  };
883
883
  ne.styles = I`
884
- ${ce(gt)}
884
+ ${ce(yt)}
885
885
  `;
886
- ne = vt([
886
+ ne = xt([
887
887
  O("maptiler-geocode-marker")
888
888
  ], ne);
889
- function ke(t) {
890
- const e = Qe(
889
+ function we(t) {
890
+ const e = Ke(
891
891
  q([
892
- Ne([
892
+ Ze([
893
893
  [
894
894
  [180, 90],
895
895
  [-180, 90],
@@ -904,22 +904,22 @@ function ke(t) {
904
904
  if (!e)
905
905
  return;
906
906
  e.properties = { isMask: !0 };
907
- const i = N(be(t)), o = (i[2] - i[0]) / 360 / 1e3, r = i[0] < -180, s = i[2] > 180, a = Ke(t);
908
- if (a.features.length > 1 && (r || s))
909
- for (const f of a.features) {
910
- const L = N(be(f));
911
- if (s && L[0] < -180 + o)
912
- for (const w of f.geometry.coordinates)
913
- for (const S of w)
914
- S[0] += 360 - o;
915
- if (r && L[2] > 180 - o)
916
- for (const w of f.geometry.coordinates)
917
- for (const S of w)
918
- S[0] -= 360 - o;
907
+ const i = N(ke(t)), a = (i[2] - i[0]) / 360 / 1e3, s = i[0] < -180, o = i[2] > 180, r = Ye(t);
908
+ if (r.features.length > 1 && (s || o))
909
+ for (const u of r.features) {
910
+ const y = N(ke(u));
911
+ if (o && y[0] < -180 + a)
912
+ for (const T of u.geometry.coordinates)
913
+ for (const _ of T)
914
+ _[0] += 360 - a;
915
+ if (s && y[2] > 180 - a)
916
+ for (const T of u.geometry.coordinates)
917
+ for (const _ of T)
918
+ _[0] -= 360 - a;
919
919
  }
920
- return q([a.features.length < 2 ? t : Le(a) ?? t, e]);
920
+ return q([r.features.length < 2 ? t : $e(r) ?? t, e]);
921
921
  }
922
- const xt = {
922
+ const bt = {
923
923
  continental_marine: 4,
924
924
  country: 4,
925
925
  major_landform: 8,
@@ -943,7 +943,7 @@ const xt = {
943
943
  "poi.restaurant": 18,
944
944
  "poi.aerodrome": 13
945
945
  // TODO add many more
946
- }, bt = {
946
+ }, kt = {
947
947
  fill: {
948
948
  paint: {
949
949
  "fill-color": "#000",
@@ -962,8 +962,8 @@ const xt = {
962
962
  },
963
963
  filter: ["!", ["has", "isMask"]]
964
964
  }
965
- }, A = "mtlr-gc-full-geom", we = "mtlr-gc-full-geom-fill", _e = "mtlr-gc-full-geom-line", kt = he.Evented, wt = he.Marker, _t = he.Popup;
966
- class Gt extends kt {
965
+ }, A = "mtlr-gc-full-geom", _e = "mtlr-gc-full-geom-fill", Le = "mtlr-gc-full-geom-line", wt = he.Evented, _t = he.Marker, Lt = he.Popup;
966
+ class Rt extends wt {
967
967
  #e = {};
968
968
  #t;
969
969
  #i;
@@ -1053,7 +1053,7 @@ class Gt extends kt {
1053
1053
  },
1054
1054
  featureslisted: (e) => {
1055
1055
  const i = e.detail.features;
1056
- this.#o = i, this.#p(this.#o, void 0), this.#$(i), this.#s("featureslisted", e.detail);
1056
+ this.#o = i, this.#p(this.#o, void 0), this.#$(e), this.#s("featureslisted", e.detail);
1057
1057
  },
1058
1058
  featuresclear: () => {
1059
1059
  this.#o = void 0, this.#p(void 0, void 0), this.#s("featuresclear");
@@ -1104,22 +1104,23 @@ class Gt extends kt {
1104
1104
  #L(e) {
1105
1105
  e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(N(e.bbox), 50, this.#h(e));
1106
1106
  }
1107
- #$(e) {
1108
- if (!e || e.length === 0 || !this.#d) return;
1109
- const i = e.every((s) => s.matching_text), o = e.reduce(
1110
- (s, a) => i || !a.matching_text ? [Math.min(s[0], a.bbox[0]), Math.min(s[1], a.bbox[1]), Math.max(s[2], a.bbox[2]), Math.max(s[3], a.bbox[3])] : s,
1107
+ #$({ detail: { features: e, external: i } }) {
1108
+ if (!e || e.length === 0 || !this.#d || this.#e.flyToFeatures === !1 || this.#e.flyToFeatures === "never" || !i && (this.#e.flyToFeatures === void 0 || this.#e.flyToFeatures === "external"))
1109
+ return;
1110
+ const a = e.every((r) => r.matching_text), s = e.reduce(
1111
+ (r, u) => a || !u.matching_text ? [Math.min(r[0], u.bbox[0]), Math.min(r[1], u.bbox[1]), Math.max(r[2], u.bbox[2]), Math.max(r[3], u.bbox[3])] : r,
1111
1112
  [180, 90, -180, -90]
1112
- ), r = e.map((s) => this.#h(s)).filter((s) => s !== void 0).reduce((s, a) => s === void 0 ? a : Math.max(s, a), void 0);
1113
- this.#b(N(o), 50, r);
1113
+ ), o = e.map((r) => this.#h(r)).filter((r) => r !== void 0).reduce((r, u) => r === void 0 ? u : Math.max(r, u), void 0);
1114
+ this.#b(N(s), 50, o);
1114
1115
  }
1115
1116
  #h(e) {
1116
1117
  if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
1117
1118
  return;
1118
- const i = e.id.replace(/\..*/, ""), o = this.#e.zoom ?? xt;
1119
- return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((r, s) => {
1120
- const a = o[i + "." + s];
1121
- return r === void 0 ? a : a === void 0 ? r : Math.max(r, a);
1122
- }, void 0) : void 0) ?? o[i];
1119
+ const i = e.id.replace(/\..*/, ""), a = this.#e.zoom ?? bt;
1120
+ return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((s, o) => {
1121
+ const r = a[i + "." + o];
1122
+ return s === void 0 ? r : r === void 0 ? s : Math.max(s, r);
1123
+ }, void 0) : void 0) ?? a[i];
1123
1124
  }
1124
1125
  get #d() {
1125
1126
  return !!this.#e.flyTo || this.#e.flyTo === void 0;
@@ -1133,13 +1134,13 @@ class Gt extends kt {
1133
1134
  #x(e, i) {
1134
1135
  this.#t?.flyTo({ center: e, ...i ? { zoom: i } : {}, ...this.#I });
1135
1136
  }
1136
- #b(e, i, o) {
1137
+ #b(e, i, a) {
1137
1138
  this.#t?.fitBounds(
1138
1139
  [
1139
1140
  [e[0], e[1]],
1140
1141
  [e[2], e[3]]
1141
1142
  ],
1142
- { padding: i, ...o ? { maxZoom: o } : {}, ...this.#M }
1143
+ { padding: i, ...a ? { maxZoom: a } : {}, ...this.#M }
1143
1144
  );
1144
1145
  }
1145
1146
  #k(e) {
@@ -1154,62 +1155,62 @@ class Gt extends kt {
1154
1155
  #p(e, i) {
1155
1156
  if (!this.#t)
1156
1157
  return;
1157
- for (const r of this.#l.values())
1158
- r.remove();
1158
+ for (const s of this.#l.values())
1159
+ s.remove();
1159
1160
  this.#l = /* @__PURE__ */ new Map(), this.#n(void 0);
1160
- const o = () => {
1161
+ const a = () => {
1161
1162
  if (!i || !this.#t || this.#e.marker === !1 || this.#e.marker === null) return;
1162
- const r = this.#e.marker instanceof Function ? this.#e.marker(this.#t, i) : this.#f(this.#e.marker).setLngLat(i.center).addTo(this.#t);
1163
- r && this.#l.set(i, r);
1163
+ const s = this.#e.marker instanceof Function ? this.#e.marker(this.#t, i) : this.#f(this.#e.marker).setLngLat(i.center).addTo(this.#t);
1164
+ s && this.#l.set(i, s);
1164
1165
  };
1165
1166
  if (i?.geometry.type === "GeometryCollection") {
1166
- const r = i.geometry.geometries.filter(
1167
- (s) => s.type === "Polygon" || s.type === "MultiPolygon"
1167
+ const s = i.geometry.geometries.filter(
1168
+ (o) => o.type === "Polygon" || o.type === "MultiPolygon"
1168
1169
  );
1169
- if (r.length > 0) {
1170
- const s = Le(q(r.map((a) => Ze(a))));
1171
- if (s) {
1172
- const a = ke({ ...i, geometry: s.geometry });
1173
- a && this.#n(a);
1170
+ if (s.length > 0) {
1171
+ const o = $e(q(s.map((r) => Qe(r))));
1172
+ if (o) {
1173
+ const r = we({ ...i, geometry: o.geometry });
1174
+ r && this.#n(r);
1174
1175
  }
1175
1176
  } else {
1176
- const s = i.geometry.geometries.filter(
1177
- (a) => a.type === "LineString" || a.type === "MultiLineString"
1177
+ const o = i.geometry.geometries.filter(
1178
+ (r) => r.type === "LineString" || r.type === "MultiLineString"
1178
1179
  );
1179
- s.length > 0 && this.#n({
1180
+ o.length > 0 && this.#n({
1180
1181
  ...i,
1181
- geometry: { type: "GeometryCollection", geometries: s }
1182
+ geometry: { type: "GeometryCollection", geometries: o }
1182
1183
  });
1183
1184
  }
1184
1185
  } else if (i?.geometry.type.endsWith("Polygon")) {
1185
- const r = ke(i);
1186
- r && this.#n(r), this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && o();
1187
- } else i?.geometry.type.endsWith("LineString") ? this.#n(i) : i?.geometry.type.endsWith("Point") && o();
1186
+ const s = we(i);
1187
+ s && this.#n(s), this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && a();
1188
+ } else i?.geometry.type.endsWith("LineString") ? this.#n(i) : i?.geometry.type.endsWith("Point") && a();
1188
1189
  if (this.#e.showResultMarkers !== !1 && this.#e.showResultMarkers !== null)
1189
- for (const r of e ?? []) {
1190
- if (r.id === i?.id || r.place_type.includes("reverse"))
1190
+ for (const s of e ?? []) {
1191
+ if (s.id === i?.id || s.place_type.includes("reverse"))
1191
1192
  continue;
1192
- let s;
1193
+ let o;
1193
1194
  if (this.#e.showResultMarkers instanceof Function) {
1194
- if (s = this.#e.showResultMarkers(this.#t, r), !s)
1195
+ if (o = this.#e.showResultMarkers(this.#t, s), !o)
1195
1196
  continue;
1196
1197
  } else
1197
- s = this.#f(this.#e.showResultMarkers).setLngLat(r.center).setPopup(
1198
- new _t({
1198
+ o = this.#f(this.#e.showResultMarkers).setLngLat(s.center).setPopup(
1199
+ new Lt({
1199
1200
  offset: [1, -27],
1200
1201
  closeButton: !1,
1201
1202
  closeOnMove: !0,
1202
1203
  className: "maptiler-gc-popup"
1203
- }).setText(r.place_type[0] === "reverse" ? r.place_name : r.place_name.replace(/,.*/, ""))
1204
- ).addTo(this.#t), s.getElement().classList.add("marker-interactive");
1205
- const a = s.getElement();
1206
- a.addEventListener("click", (f) => {
1207
- f.stopPropagation(), this.#s("markerclick", { feature: r, marker: s });
1208
- }), a.addEventListener("mouseenter", () => {
1209
- this.#s("markermouseenter", { feature: r, marker: s }), s.togglePopup();
1210
- }), a.addEventListener("mouseleave", () => {
1211
- this.#s("markermouseleave", { feature: r, marker: s }), s.togglePopup();
1212
- }), a.classList.toggle("marker-fuzzy", !!r.matching_text), this.#l.set(r, s);
1204
+ }).setText(s.place_type[0] === "reverse" ? s.place_name : s.place_name.replace(/,.*/, ""))
1205
+ ).addTo(this.#t), o.getElement().classList.add("marker-interactive");
1206
+ const r = o.getElement();
1207
+ r.addEventListener("click", (u) => {
1208
+ u.stopPropagation(), this.#s("markerclick", { feature: s, marker: o });
1209
+ }), r.addEventListener("mouseenter", () => {
1210
+ this.#s("markermouseenter", { feature: s, marker: o }), o.togglePopup();
1211
+ }), r.addEventListener("mouseleave", () => {
1212
+ this.#s("markermouseleave", { feature: s, marker: o }), o.togglePopup();
1213
+ }), r.classList.toggle("marker-fuzzy", !!s.matching_text), this.#l.set(s, o);
1213
1214
  }
1214
1215
  }
1215
1216
  #O(e) {
@@ -1226,14 +1227,14 @@ class Gt extends kt {
1226
1227
  !e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ?? q([])) : this.#a && this.#t.addSource(A, {
1227
1228
  type: "geojson",
1228
1229
  data: this.#a
1229
- }), !this.#t.getLayer(we) && e.fill && this.#t.addLayer({
1230
+ }), !this.#t.getLayer(_e) && e.fill && this.#t.addLayer({
1230
1231
  ...e.fill,
1231
- id: we,
1232
+ id: _e,
1232
1233
  type: "fill",
1233
1234
  source: A
1234
- }), !this.#t.getLayer(_e) && e.line && this.#t.addLayer({
1235
+ }), !this.#t.getLayer(Le) && e.line && this.#t.addLayer({
1235
1236
  ...e.line,
1236
- id: _e,
1237
+ id: Le,
1237
1238
  type: "line",
1238
1239
  source: A
1239
1240
  }));
@@ -1242,19 +1243,19 @@ class Gt extends kt {
1242
1243
  this.#a = e, this.#u();
1243
1244
  }
1244
1245
  #f(e) {
1245
- return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new wt(e);
1246
+ return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new _t(e);
1246
1247
  }
1247
1248
  #T() {
1248
1249
  const { fullGeometryStyle: e } = this.#e;
1249
- if (e === !0 || e === void 0) return bt;
1250
+ if (e === !0 || e === void 0) return kt;
1250
1251
  if (!(e === !1 || e === null))
1251
1252
  return e;
1252
1253
  }
1253
1254
  }
1254
1255
  export {
1255
- bt as DEFAULT_GEOMETRY_STYLE,
1256
- Gt as GeocodingControl,
1257
- Gt as MaplibreglGeocodingControl,
1256
+ kt as DEFAULT_GEOMETRY_STYLE,
1257
+ Rt as GeocodingControl,
1258
+ Rt as MaplibreglGeocodingControl,
1258
1259
  ee as MaptilerGeocodeClearIconElement,
1259
1260
  te as MaptilerGeocodeFailIconElement,
1260
1261
  ie as MaptilerGeocodeLoadingIconElement,
@@ -1262,9 +1263,9 @@ export {
1262
1263
  se as MaptilerGeocodeReverseGeocodingIconElement,
1263
1264
  re as MaptilerGeocodeSearchIconElement,
1264
1265
  n as MaptilerGeocoderElement,
1265
- we as RESULT_LAYER_FILL,
1266
- _e as RESULT_LAYER_LINE,
1266
+ _e as RESULT_LAYER_FILL,
1267
+ Le as RESULT_LAYER_LINE,
1267
1268
  A as RESULT_SOURCE,
1268
- xt as ZOOM_DEFAULTS
1269
+ bt as ZOOM_DEFAULTS
1269
1270
  };
1270
1271
  //# sourceMappingURL=maplibregl.js.map