@maptiler/geocoding-control 2.1.6 → 3.0.0-rc.1

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 (333) hide show
  1. package/CODE_OF_CONDUCT.md +46 -0
  2. package/CONTRIBUTING.md +72 -0
  3. package/README.md +36 -22
  4. package/SECURITY.md +16 -0
  5. package/dist/index.js +856 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.umd.js +263 -0
  8. package/dist/index.umd.js.map +1 -0
  9. package/dist/leaflet.public.js +1273 -0
  10. package/dist/leaflet.public.js.map +1 -0
  11. package/dist/leaflet.public.umd.js +276 -0
  12. package/dist/leaflet.public.umd.js.map +1 -0
  13. package/dist/maplibregl.js +1297 -0
  14. package/dist/maplibregl.js.map +1 -0
  15. package/dist/maplibregl.umd.js +276 -0
  16. package/dist/maplibregl.umd.js.map +1 -0
  17. package/dist/maptilersdk.js +1305 -0
  18. package/dist/maptilersdk.js.map +1 -0
  19. package/dist/maptilersdk.umd.js +276 -0
  20. package/dist/maptilersdk.umd.js.map +1 -0
  21. package/dist/src/components/clear-icon.d.ts +10 -0
  22. package/dist/src/components/fail-icon.d.ts +10 -0
  23. package/dist/src/components/loading-icon.d.ts +10 -0
  24. package/dist/src/components/marker.d.ts +10 -0
  25. package/dist/src/components/reverse-geocoding-icon.d.ts +10 -0
  26. package/dist/src/components/search-icon.d.ts +10 -0
  27. package/dist/src/controls/leaflet-control.d.ts +58 -0
  28. package/dist/src/controls/leaflet-events.d.ts +42 -0
  29. package/dist/src/controls/leaflet-options.d.ts +84 -0
  30. package/dist/src/controls/maplibregl-control.d.ts +55 -0
  31. package/dist/src/controls/maplibregl-events.d.ts +44 -0
  32. package/dist/src/controls/maplibregl-options.d.ts +104 -0
  33. package/dist/src/controls/maptilersdk-control.d.ts +6 -0
  34. package/dist/src/controls/maptilersdk-events.d.ts +2 -0
  35. package/dist/src/controls/maptilersdk-options.d.ts +10 -0
  36. package/dist/src/geocoder/geocoder-events.d.ts +46 -0
  37. package/dist/src/geocoder/geocoder-feature-item.d.ts +22 -0
  38. package/{svelte/types.d.ts → dist/src/geocoder/geocoder-options.d.ts} +12 -148
  39. package/dist/src/geocoder/geocoder.d.ts +112 -0
  40. package/dist/src/index.d.ts +9 -0
  41. package/dist/src/leaflet.public.d.ts +7 -0
  42. package/dist/src/maplibregl.d.ts +7 -0
  43. package/dist/src/maptilersdk.d.ts +7 -0
  44. package/dist/src/types.d.ts +45 -0
  45. package/dist/src/utils/geo-utils.d.ts +6 -0
  46. package/dist/src/utils/mask.d.ts +2 -0
  47. package/dist/src/utils/proximity.d.ts +2 -0
  48. package/package.json +84 -116
  49. package/MapLibreBasedGeocodingControl.d.ts +0 -3072
  50. package/geo-coordinates-parser.t.d.ts +0 -8
  51. package/geoUtils.d.ts +0 -3
  52. package/leaflet-controller.d.ts +0 -12
  53. package/leaflet-controller.js +0 -2475
  54. package/leaflet-controller.js.map +0 -1
  55. package/leaflet-controller.umd.js +0 -2
  56. package/leaflet-controller.umd.js.map +0 -1
  57. package/leaflet.d.ts +0 -131
  58. package/leaflet.js +0 -5055
  59. package/leaflet.js.map +0 -1
  60. package/leaflet.umd.js +0 -14
  61. package/leaflet.umd.js.map +0 -1
  62. package/maplibregl-controller.d.ts +0 -19
  63. package/maplibregl-controller.js +0 -2418
  64. package/maplibregl-controller.js.map +0 -1
  65. package/maplibregl-controller.umd.js +0 -2
  66. package/maplibregl-controller.umd.js.map +0 -1
  67. package/maplibregl.d.ts +0 -2509
  68. package/maplibregl.js +0 -5115
  69. package/maplibregl.js.map +0 -1
  70. package/maplibregl.umd.js +0 -14
  71. package/maplibregl.umd.js.map +0 -1
  72. package/maptilersdk.d.ts +0 -2504
  73. package/maptilersdk.js +0 -5125
  74. package/maptilersdk.js.map +0 -1
  75. package/maptilersdk.umd.js +0 -14
  76. package/maptilersdk.umd.js.map +0 -1
  77. package/mask.d.ts +0 -2
  78. package/openlayers-controller.d.ts +0 -15
  79. package/openlayers-controller.js +0 -2174
  80. package/openlayers-controller.js.map +0 -1
  81. package/openlayers-controller.umd.js +0 -2
  82. package/openlayers-controller.umd.js.map +0 -1
  83. package/openlayers.d.ts +0 -109
  84. package/openlayers.js +0 -5018
  85. package/openlayers.js.map +0 -1
  86. package/openlayers.umd.js +0 -14
  87. package/openlayers.umd.js.map +0 -1
  88. package/proximity.d.ts +0 -2
  89. package/react.d.ts +0 -45
  90. package/react.js +0 -2768
  91. package/react.js.map +0 -1
  92. package/react.umd.js +0 -14
  93. package/react.umd.js.map +0 -1
  94. package/style.css +0 -1
  95. package/svelte/ClearIcon.svelte +0 -12
  96. package/svelte/ClearIcon.svelte.d.ts +0 -25
  97. package/svelte/FailIcon.svelte +0 -12
  98. package/svelte/FailIcon.svelte.d.ts +0 -25
  99. package/svelte/FeatureItem.svelte +0 -246
  100. package/svelte/FeatureItem.svelte.d.ts +0 -26
  101. package/svelte/GeocodingControl.svelte +0 -919
  102. package/svelte/GeocodingControl.svelte.d.ts +0 -105
  103. package/svelte/LoadingIcon.svelte +0 -40
  104. package/svelte/LoadingIcon.svelte.d.ts +0 -25
  105. package/svelte/MapLibreBasedGeocodingControl.d.ts +0 -3072
  106. package/svelte/MapLibreBasedGeocodingControl.js +0 -210
  107. package/svelte/MarkerIcon.svelte +0 -71
  108. package/svelte/MarkerIcon.svelte.d.ts +0 -18
  109. package/svelte/ReverseGeocodingIcon.svelte +0 -12
  110. package/svelte/ReverseGeocodingIcon.svelte.d.ts +0 -25
  111. package/svelte/SearchIcon.svelte +0 -26
  112. package/svelte/SearchIcon.svelte.d.ts +0 -25
  113. package/svelte/geo-coordinates-parser.t.d.ts +0 -8
  114. package/svelte/geo-coordinates-parser.t.js +0 -1
  115. package/svelte/geoUtils.d.ts +0 -3
  116. package/svelte/geoUtils.js +0 -18
  117. package/svelte/info.json +0 -1
  118. package/svelte/leaflet-controller.d.ts +0 -12
  119. package/svelte/leaflet-controller.js +0 -274
  120. package/svelte/leaflet.d.ts +0 -131
  121. package/svelte/leaflet.js +0 -116
  122. package/svelte/maplibregl-controller.d.ts +0 -19
  123. package/svelte/maplibregl-controller.js +0 -279
  124. package/svelte/maplibregl.d.ts +0 -2509
  125. package/svelte/maplibregl.js +0 -17
  126. package/svelte/maptilersdk.d.ts +0 -2504
  127. package/svelte/maptilersdk.js +0 -32
  128. package/svelte/mask.d.ts +0 -2
  129. package/svelte/mask.js +0 -54
  130. package/svelte/openlayers-controller.d.ts +0 -15
  131. package/svelte/openlayers-controller.js +0 -283
  132. package/svelte/openlayers.d.ts +0 -109
  133. package/svelte/openlayers.js +0 -178
  134. package/svelte/proximity.d.ts +0 -2
  135. package/svelte/proximity.js +0 -60
  136. package/svelte/react.d.ts +0 -45
  137. package/svelte/react.js +0 -106
  138. package/svelte/types.js +0 -1
  139. package/svelte/vanilla.d.ts +0 -61
  140. package/svelte/vanilla.js +0 -101
  141. package/svelte/vite-env.d.ts +0 -2
  142. package/types.d.ts +0 -391
  143. package/vanilla.d.ts +0 -61
  144. package/vanilla.js +0 -2772
  145. package/vanilla.js.map +0 -1
  146. package/vanilla.umd.js +0 -14
  147. package/vanilla.umd.js.map +0 -1
  148. /package/{icons → dist/icons}/10pin.svg +0 -0
  149. /package/{icons → dist/icons}/9pin.svg +0 -0
  150. /package/{icons → dist/icons}/advertising_column.svg +0 -0
  151. /package/{icons → dist/icons}/aerodrome.svg +0 -0
  152. /package/{icons → dist/icons}/alcohol.svg +0 -0
  153. /package/{icons → dist/icons}/alpine_hut.svg +0 -0
  154. /package/{icons → dist/icons}/amusement_arcade.svg +0 -0
  155. /package/{icons → dist/icons}/amusement_park.svg +0 -0
  156. /package/{icons → dist/icons}/apartment.svg +0 -0
  157. /package/{icons → dist/icons}/archaeological_site.svg +0 -0
  158. /package/{icons → dist/icons}/area.svg +0 -0
  159. /package/{icons → dist/icons}/art.svg +0 -0
  160. /package/{icons → dist/icons}/arts_centre.svg +0 -0
  161. /package/{icons → dist/icons}/artwork.svg +0 -0
  162. /package/{icons → dist/icons}/audioguide.svg +0 -0
  163. /package/{icons → dist/icons}/bag.svg +0 -0
  164. /package/{icons → dist/icons}/beauty.svg +0 -0
  165. /package/{icons → dist/icons}/bed.svg +0 -0
  166. /package/{icons → dist/icons}/bell_tower.svg +0 -0
  167. /package/{icons → dist/icons}/beverages.svg +0 -0
  168. /package/{icons → dist/icons}/bicycle_repair_station.svg +0 -0
  169. /package/{icons → dist/icons}/biergarten.svg +0 -0
  170. /package/{icons → dist/icons}/bird_hide.svg +0 -0
  171. /package/{icons → dist/icons}/boat_rental.svg +0 -0
  172. /package/{icons → dist/icons}/bookmaker.svg +0 -0
  173. /package/{icons → dist/icons}/books.svg +0 -0
  174. /package/{icons → dist/icons}/bowl.svg +0 -0
  175. /package/{icons → dist/icons}/bowling_alley.svg +0 -0
  176. /package/{icons → dist/icons}/bunker.svg +0 -0
  177. /package/{icons → dist/icons}/bureau_de_change.svg +0 -0
  178. /package/{icons → dist/icons}/bus_station.svg +0 -0
  179. /package/{icons → dist/icons}/bust.svg +0 -0
  180. /package/{icons → dist/icons}/camping.svg +0 -0
  181. /package/{icons → dist/icons}/car_parts.svg +0 -0
  182. /package/{icons → dist/icons}/car_wash.svg +0 -0
  183. /package/{icons → dist/icons}/caravan_park.svg +0 -0
  184. /package/{icons → dist/icons}/carpet.svg +0 -0
  185. /package/{icons → dist/icons}/cattle_grid.svg +0 -0
  186. /package/{icons → dist/icons}/cave_entrance.svg +0 -0
  187. /package/{icons → dist/icons}/chalet.svg +0 -0
  188. /package/{icons → dist/icons}/charity.svg +0 -0
  189. /package/{icons → dist/icons}/chemist.svg +0 -0
  190. /package/{icons → dist/icons}/chimney.svg +0 -0
  191. /package/{icons → dist/icons}/church.svg +0 -0
  192. /package/{icons → dist/icons}/city_gate.svg +0 -0
  193. /package/{icons → dist/icons}/clinic.svg +0 -0
  194. /package/{icons → dist/icons}/clothes.svg +0 -0
  195. /package/{icons → dist/icons}/coffee.svg +0 -0
  196. /package/{icons → dist/icons}/community_centre.svg +0 -0
  197. /package/{icons → dist/icons}/computer.svg +0 -0
  198. /package/{icons → dist/icons}/consulate.svg +0 -0
  199. /package/{icons → dist/icons}/copyshop.svg +0 -0
  200. /package/{icons → dist/icons}/cosmetics.svg +0 -0
  201. /package/{icons → dist/icons}/courthouse.svg +0 -0
  202. /package/{icons → dist/icons}/crane.svg +0 -0
  203. /package/{icons → dist/icons}/dairy.svg +0 -0
  204. /package/{icons → dist/icons}/deli.svg +0 -0
  205. /package/{icons → dist/icons}/department_store.svg +0 -0
  206. /package/{icons → dist/icons}/diy.svg +0 -0
  207. /package/{icons → dist/icons}/electronics.svg +0 -0
  208. /package/{icons → dist/icons}/embankment.svg +0 -0
  209. /package/{icons → dist/icons}/embassy.svg +0 -0
  210. /package/{icons → dist/icons}/excrement_bags.svg +0 -0
  211. /package/{icons → dist/icons}/fabric.svg +0 -0
  212. /package/{icons → dist/icons}/farmyard.svg +0 -0
  213. /package/{icons → dist/icons}/ferry.svg +0 -0
  214. /package/{icons → dist/icons}/firepit.svg +0 -0
  215. /package/{icons → dist/icons}/firestation.svg +0 -0
  216. /package/{icons → dist/icons}/fishing.svg +0 -0
  217. /package/{icons → dist/icons}/fitness.svg +0 -0
  218. /package/{icons → dist/icons}/ford.svg +0 -0
  219. /package/{icons → dist/icons}/fort.svg +0 -0
  220. /package/{icons → dist/icons}/fortress.svg +0 -0
  221. /package/{icons → dist/icons}/full-height_turnstile.svg +0 -0
  222. /package/{icons → dist/icons}/generator_wind.svg +0 -0
  223. /package/{icons → dist/icons}/golf_pin.svg +0 -0
  224. /package/{icons → dist/icons}/greengrocer.svg +0 -0
  225. /package/{icons → dist/icons}/guest_house.svg +0 -0
  226. /package/{icons → dist/icons}/helipad.svg +0 -0
  227. /package/{icons → dist/icons}/hifi.svg +0 -0
  228. /package/{icons → dist/icons}/hostel.svg +0 -0
  229. /package/{icons → dist/icons}/hotel.svg +0 -0
  230. /package/{icons → dist/icons}/housenumber.svg +0 -0
  231. /package/{icons → dist/icons}/houseware.svg +0 -0
  232. /package/{icons → dist/icons}/hunting_stand.svg +0 -0
  233. /package/{icons → dist/icons}/interior_decoration.svg +0 -0
  234. /package/{icons → dist/icons}/internet_cafe.svg +0 -0
  235. /package/{icons → dist/icons}/kindergarten.svg +0 -0
  236. /package/{icons → dist/icons}/kissing_gate.svg +0 -0
  237. /package/{icons → dist/icons}/manor.svg +0 -0
  238. /package/{icons → dist/icons}/map.svg +0 -0
  239. /package/{icons → dist/icons}/marker_reverse.svg +0 -0
  240. /package/{icons → dist/icons}/marker_selected.svg +0 -0
  241. /package/{icons → dist/icons}/marker_unselected.svg +0 -0
  242. /package/{icons → dist/icons}/marketplace.svg +0 -0
  243. /package/{icons → dist/icons}/massage.svg +0 -0
  244. /package/{icons → dist/icons}/mast.svg +0 -0
  245. /package/{icons → dist/icons}/mast_communications.svg +0 -0
  246. /package/{icons → dist/icons}/mast_lighting.svg +0 -0
  247. /package/{icons → dist/icons}/medical_supply.svg +0 -0
  248. /package/{icons → dist/icons}/memorial.svg +0 -0
  249. /package/{icons → dist/icons}/miniature_golf.svg +0 -0
  250. /package/{icons → dist/icons}/motel.svg +0 -0
  251. /package/{icons → dist/icons}/mountain_range.svg +0 -0
  252. /package/{icons → dist/icons}/multifaith.svg +0 -0
  253. /package/{icons → dist/icons}/musical_instrument.svg +0 -0
  254. /package/{icons → dist/icons}/newsagent.svg +0 -0
  255. /package/{icons → dist/icons}/nightclub.svg +0 -0
  256. /package/{icons → dist/icons}/ocean.svg +0 -0
  257. /package/{icons → dist/icons}/office.svg +0 -0
  258. /package/{icons → dist/icons}/outdoor_seating.svg +0 -0
  259. /package/{icons → dist/icons}/palace.svg +0 -0
  260. /package/{icons → dist/icons}/parcel_locker.svg +0 -0
  261. /package/{icons → dist/icons}/parking_space.svg +0 -0
  262. /package/{icons → dist/icons}/parking_tickets.svg +0 -0
  263. /package/{icons → dist/icons}/pet.svg +0 -0
  264. /package/{icons → dist/icons}/photo.svg +0 -0
  265. /package/{icons → dist/icons}/picnic.svg +0 -0
  266. /package/{icons → dist/icons}/plaque.svg +0 -0
  267. /package/{icons → dist/icons}/poi.svg +0 -0
  268. /package/{icons → dist/icons}/post_box.svg +0 -0
  269. /package/{icons → dist/icons}/post_office.svg +0 -0
  270. /package/{icons → dist/icons}/postal_code.svg +0 -0
  271. /package/{icons → dist/icons}/pub.svg +0 -0
  272. /package/{icons → dist/icons}/public_bath.svg +0 -0
  273. /package/{icons → dist/icons}/public_bookcase.svg +0 -0
  274. /package/{icons → dist/icons}/public_building.svg +0 -0
  275. /package/{icons → dist/icons}/public_transport_tickets.svg +0 -0
  276. /package/{icons → dist/icons}/reverse.svg +0 -0
  277. /package/{icons → dist/icons}/river.svg +0 -0
  278. /package/{icons → dist/icons}/road.svg +0 -0
  279. /package/{icons → dist/icons}/saddle.svg +0 -0
  280. /package/{icons → dist/icons}/sauna.svg +0 -0
  281. /package/{icons → dist/icons}/sea.svg +0 -0
  282. /package/{icons → dist/icons}/second_hand.svg +0 -0
  283. /package/{icons → dist/icons}/shintoist.svg +0 -0
  284. /package/{icons → dist/icons}/shoe.svg +0 -0
  285. /package/{icons → dist/icons}/shower.svg +0 -0
  286. /package/{icons → dist/icons}/shrine.svg +0 -0
  287. /package/{icons → dist/icons}/sikhist.svg +0 -0
  288. /package/{icons → dist/icons}/slipway.svg +0 -0
  289. /package/{icons → dist/icons}/snowmobile.svg +0 -0
  290. /package/{icons → dist/icons}/social_facility.svg +0 -0
  291. /package/{icons → dist/icons}/sports.svg +0 -0
  292. /package/{icons → dist/icons}/sprite.json +0 -0
  293. /package/{icons → dist/icons}/sprite.png +0 -0
  294. /package/{icons → dist/icons}/sprite@2x.json +0 -0
  295. /package/{icons → dist/icons}/sprite@2x.png +0 -0
  296. /package/{icons → dist/icons}/stationery.svg +0 -0
  297. /package/{icons → dist/icons}/stile.svg +0 -0
  298. /package/{icons → dist/icons}/stone.svg +0 -0
  299. /package/{icons → dist/icons}/storage_tank.svg +0 -0
  300. /package/{icons → dist/icons}/stream.svg +0 -0
  301. /package/{icons → dist/icons}/street.svg +0 -0
  302. /package/{icons → dist/icons}/supermarket.svg +0 -0
  303. /package/{icons → dist/icons}/tea.svg +0 -0
  304. /package/{icons → dist/icons}/telescope_dish.svg +0 -0
  305. /package/{icons → dist/icons}/telescope_dome.svg +0 -0
  306. /package/{icons → dist/icons}/ticket.svg +0 -0
  307. /package/{icons → dist/icons}/tobacco.svg +0 -0
  308. /package/{icons → dist/icons}/tower_cantilever_communication.svg +0 -0
  309. /package/{icons → dist/icons}/tower_cooling.svg +0 -0
  310. /package/{icons → dist/icons}/tower_dish.svg +0 -0
  311. /package/{icons → dist/icons}/tower_dome.svg +0 -0
  312. /package/{icons → dist/icons}/tower_generic.svg +0 -0
  313. /package/{icons → dist/icons}/tower_lattice.svg +0 -0
  314. /package/{icons → dist/icons}/tower_lattice_communication.svg +0 -0
  315. /package/{icons → dist/icons}/tower_lattice_lighting.svg +0 -0
  316. /package/{icons → dist/icons}/tower_lighting.svg +0 -0
  317. /package/{icons → dist/icons}/townhall.svg +0 -0
  318. /package/{icons → dist/icons}/toys.svg +0 -0
  319. /package/{icons → dist/icons}/trade.svg +0 -0
  320. /package/{icons → dist/icons}/traffic_light.svg +0 -0
  321. /package/{icons → dist/icons}/train_station.svg +0 -0
  322. /package/{icons → dist/icons}/travel_agency.svg +0 -0
  323. /package/{icons → dist/icons}/tyres.svg +0 -0
  324. /package/{icons → dist/icons}/university.svg +0 -0
  325. /package/{icons → dist/icons}/variety_store.svg +0 -0
  326. /package/{icons → dist/icons}/vehicle_inspection.svg +0 -0
  327. /package/{icons → dist/icons}/vending_machine.svg +0 -0
  328. /package/{icons → dist/icons}/video.svg +0 -0
  329. /package/{icons → dist/icons}/video_games.svg +0 -0
  330. /package/{icons → dist/icons}/waste_disposal.svg +0 -0
  331. /package/{icons → dist/icons}/water_well.svg +0 -0
  332. /package/{icons → dist/icons}/waterfall.svg +0 -0
  333. /package/{icons → dist/icons}/wilderness_hut.svg +0 -0
@@ -0,0 +1,1273 @@
1
+ import { css as I, LitElement as M, svg as R, html as m, unsafeCSS as ce, nothing as J } from "lit";
2
+ import { customElement as C, property as p, state as b, query as Ae } from "lit/decorators.js";
3
+ import { convert as We } from "geo-coordinates-parser";
4
+ import { classMap as A } from "lit/directives/class-map.js";
5
+ import { repeat as Ve } from "lit/directives/repeat.js";
6
+ import qe from "@turf/clone";
7
+ import { styleMap as Ne } from "lit/directives/style-map.js";
8
+ import X from "@turf/bbox";
9
+ import { featureCollection as q, polygon as Ze, feature as Qe } from "@turf/helpers";
10
+ import _e from "@turf/union";
11
+ import { Evented as Ke, Control as He, DomEvent as xe, Popup as Ye, GeoJSON as Je, DivIcon as Xe, Marker as et } from "leaflet";
12
+ import tt from "@turf/difference";
13
+ import it from "@turf/flatten";
14
+ var st = Object.getOwnPropertyDescriptor, ot = (t, e, i, r) => {
15
+ for (var o = r > 1 ? void 0 : r ? st(e, i) : e, s = t.length - 1, a; s >= 0; s--)
16
+ (a = t[s]) && (o = a(o) || o);
17
+ return o;
18
+ };
19
+ let ee = class extends M {
20
+ render() {
21
+ return R`
22
+ <svg viewBox="0 0 14 14" width="13" height="13">
23
+ <path
24
+ 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"
25
+ />
26
+ </svg>
27
+ `;
28
+ }
29
+ };
30
+ ee.styles = I`
31
+ svg {
32
+ display: block;
33
+ fill: var(--color-icon-button);
34
+ }
35
+ `;
36
+ ee = ot([
37
+ C("maptiler-geocode-clear-icon")
38
+ ], ee);
39
+ var rt = Object.getOwnPropertyDescriptor, at = (t, e, i, r) => {
40
+ for (var o = r > 1 ? void 0 : r ? rt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
41
+ (a = t[s]) && (o = a(o) || o);
42
+ return o;
43
+ };
44
+ let te = class extends M {
45
+ render() {
46
+ return R`
47
+ <svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
48
+ <path
49
+ 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"
50
+ />
51
+ </svg>
52
+ `;
53
+ }
54
+ };
55
+ te.styles = I`
56
+ svg {
57
+ display: block;
58
+ fill: #e15042;
59
+ }
60
+ `;
61
+ te = at([
62
+ C("maptiler-geocode-fail-icon")
63
+ ], te);
64
+ var nt = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
65
+ for (var o = r > 1 ? void 0 : r ? nt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
66
+ (a = t[s]) && (o = a(o) || o);
67
+ return o;
68
+ };
69
+ let ie = class extends M {
70
+ render() {
71
+ return m`
72
+ <div>
73
+ <svg viewBox="0 0 18 18" width="24" height="24" class="loading-icon">
74
+ <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" />
75
+ <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" />
76
+ </svg>
77
+ </div>
78
+ `;
79
+ }
80
+ };
81
+ ie.styles = I`
82
+ div {
83
+ position: absolute;
84
+ left: 50%;
85
+ top: 50%;
86
+ transform: translate(-50%, -50%);
87
+ pointer-events: none;
88
+
89
+ display: flex;
90
+ align-items: center;
91
+ }
92
+
93
+ .loading-icon {
94
+ animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
95
+ }
96
+
97
+ @keyframes rotate {
98
+ from {
99
+ -webkit-transform: rotate(0);
100
+ transform: rotate(0);
101
+ }
102
+ to {
103
+ -webkit-transform: rotate(360deg);
104
+ transform: rotate(360deg);
105
+ }
106
+ }
107
+ `;
108
+ ie = lt([
109
+ C("maptiler-geocode-loading-icon")
110
+ ], ie);
111
+ var ct = Object.getOwnPropertyDescriptor, ht = (t, e, i, r) => {
112
+ for (var o = r > 1 ? void 0 : r ? ct(e, i) : e, s = t.length - 1, a; s >= 0; s--)
113
+ (a = t[s]) && (o = a(o) || o);
114
+ return o;
115
+ };
116
+ let se = class extends M {
117
+ render() {
118
+ return R`
119
+ <svg viewBox="0 0 60.006 21.412" width="14" height="20">
120
+ <path
121
+ 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"
122
+ />
123
+ </svg>
124
+ `;
125
+ }
126
+ };
127
+ se.styles = I`
128
+ svg {
129
+ display: block;
130
+ fill: var(--color-icon-button);
131
+ }
132
+ `;
133
+ se = ht([
134
+ C("maptiler-geocode-reverse-geocoding-icon")
135
+ ], se);
136
+ var pt = Object.getOwnPropertyDescriptor, dt = (t, e, i, r) => {
137
+ for (var o = r > 1 ? void 0 : r ? pt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
138
+ (a = t[s]) && (o = a(o) || o);
139
+ return o;
140
+ };
141
+ let oe = class extends M {
142
+ render() {
143
+ return R`
144
+ <svg
145
+ xmlns="http://www.w3.org/2000/svg"
146
+ width="13"
147
+ height="13"
148
+ viewBox="0 0 13 13"
149
+ >
150
+ <circle cx="4.789" cy="4.787" r="3.85" />
151
+ <path d="M12.063 12.063 7.635 7.635" />
152
+ </svg>
153
+ `;
154
+ }
155
+ };
156
+ oe.styles = I`
157
+ circle {
158
+ stroke-width: 1.875;
159
+ fill: none;
160
+ }
161
+
162
+ path {
163
+ stroke-width: 1.875;
164
+ stroke-linecap: round;
165
+ }
166
+
167
+ svg {
168
+ display: block;
169
+ stroke: var(--color-icon-button);
170
+ }
171
+ `;
172
+ oe = dt([
173
+ C("maptiler-geocode-search-icon")
174
+ ], oe);
175
+ function ut(t, e, i) {
176
+ const r = e[1], o = e[0], s = r - o;
177
+ return t === r && i ? t : ((t - o) % s + s) % s + o;
178
+ }
179
+ function U(t) {
180
+ const e = [...t];
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
+ }
183
+ function be(t, e) {
184
+ const i = qe(t);
185
+ for (const r of i.features)
186
+ if (r.geometry.type == "MultiPolygon")
187
+ for (const o of r.geometry.coordinates)
188
+ ke(o, e);
189
+ else
190
+ ke(r.geometry.coordinates, e);
191
+ return i;
192
+ }
193
+ function ke(t, e) {
194
+ for (const i of t)
195
+ for (const r of i)
196
+ r[0] += e;
197
+ }
198
+ let B;
199
+ async function ft(t, e, i) {
200
+ for (const r of e ?? [])
201
+ if (!(t && (r.minZoom != null && r.minZoom > t[0] || r.maxZoom != null && r.maxZoom < t[0]))) {
202
+ if (r.type === "fixed")
203
+ return r.coordinates.join(",");
204
+ if (r.type === "client-geolocation")
205
+ if (B && r.cachedLocationExpiry && B.time + r.cachedLocationExpiry > Date.now()) {
206
+ if (B.coords)
207
+ return B.coords;
208
+ } else {
209
+ let o;
210
+ try {
211
+ return o = await new Promise((s, a) => {
212
+ i.signal.addEventListener("abort", () => {
213
+ a(Error("aborted"));
214
+ }), navigator.geolocation.getCurrentPosition(
215
+ (u) => {
216
+ s([u.coords.longitude, u.coords.latitude].map((k) => k.toFixed(6)).join(","));
217
+ },
218
+ (u) => {
219
+ a(u);
220
+ },
221
+ r
222
+ );
223
+ }), o;
224
+ } catch {
225
+ } finally {
226
+ r.cachedLocationExpiry && (B = {
227
+ time: Date.now(),
228
+ coords: o
229
+ });
230
+ }
231
+ if (i.signal.aborted)
232
+ return;
233
+ }
234
+ if (r.type === "server-geolocation")
235
+ return "ip";
236
+ if (t && r.type === "map-center")
237
+ return t[1].toFixed(6) + "," + t[2].toFixed(6);
238
+ }
239
+ }
240
+ const mt = ".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)}}";
241
+ var gt = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, $e = (t) => {
242
+ throw TypeError(t);
243
+ }, $ = (t, e, i, r) => {
244
+ for (var o = r > 1 ? void 0 : r ? yt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
245
+ (a = t[s]) && (o = (r ? a(e, i, o) : a(o)) || o);
246
+ return r && o && gt(e, i, o), o;
247
+ }, Le = (t, e, i) => e.has(t) || $e("Cannot " + i), f = (t, e, i) => (Le(t, e, "read from private field"), i ? i.call(t) : e.get(t)), vt = (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) => (Le(t, e, "access private method"), i), d, N, G, g, Ie, Me, he, re;
248
+ const Ce = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Oe = Ce ? "@2x" : "", F = Ce ? 2 : 1;
249
+ let O, Te, _ = class extends M {
250
+ constructor() {
251
+ super(...arguments), vt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
252
+ }
253
+ willUpdate(t) {
254
+ t.has("feature") && f(this, d, N) && (this.index = f(this, d, N).length, E(this, d, he).call(this));
255
+ }
256
+ render() {
257
+ return m`
258
+ <li
259
+ tabindex="-1"
260
+ role="option"
261
+ aria-selected=${this.itemStyle === "selected"}
262
+ aria-checked=${this.itemStyle === "picked"}
263
+ class=${this.itemStyle}
264
+ @click=${() => this.dispatchEvent(new CustomEvent("select"))}
265
+ >
266
+ ${O && this.spriteIcon ? m`
267
+ <div
268
+ class="sprite-icon"
269
+ style=${Ne({
270
+ width: `${this.spriteIcon.width / F}px`,
271
+ height: `${this.spriteIcon.height / F}px`,
272
+ backgroundImage: `url(${this.iconsBaseUrl}sprite${Oe}.png)`,
273
+ backgroundPosition: `-${this.spriteIcon.x / F}px -${this.spriteIcon.y / F}px`,
274
+ backgroundSize: `${O.width / F}px ${O.height / F}px`
275
+ })}
276
+ title=${f(this, d, g)}
277
+ />
278
+ ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, d, g)} @error=${E(this, d, Me)} />` : 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, G) ? 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)} /> `}
279
+
280
+ <span class="texts">
281
+ <span>
282
+ <span class="primary"> ${f(this, d, G) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
283
+
284
+ ${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, G) ? m` <span class="secondary"> ${f(this, d, g)} </span> ` : J}
285
+ </span>
286
+
287
+ <span class="line2"> ${f(this, d, G) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
288
+ </span>
289
+ </li>
290
+ `;
291
+ }
292
+ };
293
+ d = /* @__PURE__ */ new WeakSet();
294
+ N = function() {
295
+ return this.feature?.properties?.categories;
296
+ };
297
+ G = function() {
298
+ return this.feature?.place_type[0] === "reverse";
299
+ };
300
+ g = function() {
301
+ return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
302
+ };
303
+ Ie = function() {
304
+ Te ??= fetch(`${this.iconsBaseUrl}sprite${Oe}.json`).then((t) => t.json()).then((t) => {
305
+ O = t;
306
+ }).catch(() => {
307
+ O = null;
308
+ });
309
+ };
310
+ Me = function() {
311
+ this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, d, he).call(this);
312
+ };
313
+ he = function() {
314
+ O !== void 0 ? E(this, d, re).call(this) : (E(this, d, Ie).call(this), Te?.then(() => {
315
+ E(this, d, re).call(this);
316
+ }));
317
+ };
318
+ re = function() {
319
+ do {
320
+ if (this.index--, this.category = f(this, d, N)?.[this.index], this.spriteIcon = this.category ? O?.icons[this.category] : void 0, this.spriteIcon)
321
+ break;
322
+ this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
323
+ } while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
324
+ };
325
+ _.styles = I`
326
+ ${ce(mt)}
327
+ `;
328
+ $([
329
+ p({ type: Object })
330
+ ], _.prototype, "feature", 2);
331
+ $([
332
+ p({ type: String })
333
+ ], _.prototype, "itemStyle", 2);
334
+ $([
335
+ p({ type: String })
336
+ ], _.prototype, "showPlaceType", 2);
337
+ $([
338
+ p({ attribute: !1 })
339
+ ], _.prototype, "missingIconsCache", 2);
340
+ $([
341
+ p({ type: String })
342
+ ], _.prototype, "iconsBaseUrl", 2);
343
+ $([
344
+ b()
345
+ ], _.prototype, "category", 2);
346
+ $([
347
+ b()
348
+ ], _.prototype, "imageUrl", 2);
349
+ $([
350
+ b()
351
+ ], _.prototype, "spriteIcon", 2);
352
+ $([
353
+ b()
354
+ ], _.prototype, "index", 2);
355
+ _ = $([
356
+ C("maptiler-geocoder-feature-item")
357
+ ], _);
358
+ const xt = "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}";
359
+ var bt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, Fe = (t) => {
360
+ throw TypeError(t);
361
+ }, c = (t, e, i, r) => {
362
+ for (var o = r > 1 ? void 0 : r ? kt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
363
+ (a = t[s]) && (o = (r ? a(e, i, o) : a(o)) || o);
364
+ return r && o && bt(e, i, o), o;
365
+ }, pe = (t, e, i) => e.has(t) || Fe("Cannot " + i), x = (t, e, i) => (pe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), S = (t, e, i) => e.has(t) ? Fe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, r) => (pe(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (pe(t, e, "access private method"), i), Z, V, z, ae, D, n, Q, Se, Ee, de, v, ue, K, fe, me, L, ge, H, Pe, ne, Be, Ge, Ue, ze, De;
366
+ let l = class extends M {
367
+ constructor() {
368
+ super(...arguments), S(this, n), 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, S(this, Z, !1), S(this, V, !1), S(this, z), S(this, ae, /* @__PURE__ */ new Set()), S(this, D);
369
+ }
370
+ firstUpdated() {
371
+ W(this, Z, !0);
372
+ }
373
+ /**
374
+ * Set the options of this instance.
375
+ *
376
+ * @param options options to set
377
+ */
378
+ setOptions(t) {
379
+ const e = { ...t };
380
+ for (const i of Object.keys(e))
381
+ wt.includes(i) || delete e[i];
382
+ Object.assign(this, e);
383
+ }
384
+ /**
385
+ * Set the content of search input box.
386
+ *
387
+ * @param value text to set
388
+ */
389
+ setQuery(t) {
390
+ h(this, n, me).call(this, t), h(this, n, fe).call(this);
391
+ }
392
+ /**
393
+ * Set the content of search input box and immediately submit it.
394
+ *
395
+ * @param value text to set and submit
396
+ */
397
+ submitQuery(t) {
398
+ h(this, n, ge).call(this, t);
399
+ }
400
+ /**
401
+ * Clear search result list.
402
+ */
403
+ clearList() {
404
+ h(this, n, L).call(this), this.picked = void 0, this.selectedItemIndex = -1;
405
+ }
406
+ /**
407
+ * Focus the search input box.
408
+ *
409
+ * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
410
+ */
411
+ focus(t) {
412
+ this.input.focus(t);
413
+ }
414
+ /**
415
+ * Blur the search input box.
416
+ */
417
+ blur() {
418
+ this.input.blur();
419
+ }
420
+ addEventListener(t, e, i) {
421
+ super.addEventListener(t, e, i);
422
+ }
423
+ removeEventListener(t, e, i) {
424
+ super.removeEventListener(t, e, i);
425
+ }
426
+ /** @internal */
427
+ handleMapChange(t) {
428
+ W(this, D, t);
429
+ }
430
+ /** @internal */
431
+ handleMapClick(t) {
432
+ this.reverseActive && h(this, n, Pe).call(this, t);
433
+ }
434
+ willUpdate(t) {
435
+ 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, n, L).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && x(this, n, de) && (h(this, n, L).call(this), this.error = void 0), ["focused"].some((e) => t.has(e)) && setTimeout(() => {
436
+ this.focusedDelayed = this.focused, this.clearOnBlur && !this.focused && (this.searchValue = "");
437
+ }, 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, n, v).call(this, "select", { feature: x(this, n, Q) }), ["picked"].some((e) => t.has(e)) && this.picked && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, n, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
438
+ () => {
439
+ h(this, n, v).call(this, "pick", { feature: this.picked });
440
+ },
441
+ (e) => {
442
+ e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, n, v).call(this, "pick", { feature: this.picked }));
443
+ }
444
+ ), ["listFeatures", "focusedDelayed"].some((e) => t.has(e)) && (x(this, n, Se) ? (h(this, n, v).call(this, "featuresshow"), W(this, V, !0)) : x(this, V) && h(this, n, v).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, n, v).call(this, "reversetoggle", { reverse: this.reverseActive });
445
+ }
446
+ render() {
447
+ return m`
448
+ <form @submit=${h(this, n, ue)} class=${A({ "can-collapse": this.collapsed && this.searchValue === "" })}>
449
+ <div class="input-group">
450
+ <button
451
+ class="search-button"
452
+ type="button"
453
+ @click=${() => {
454
+ this.input.focus();
455
+ }}
456
+ >
457
+ <maptiler-geocode-search-icon></maptiler-geocode-search-icon>
458
+ </button>
459
+
460
+ <input
461
+ .value=${this.searchValue}
462
+ @focus=${() => this.focused = !0}
463
+ @blur=${() => this.focused = !1}
464
+ @click=${() => this.focused = !0}
465
+ @keydown=${h(this, n, ne)}
466
+ @input=${h(this, n, Be)}
467
+ @change=${() => this.picked = void 0}
468
+ placeholder=${this.placeholder ?? "Search"}
469
+ aria-label=${this.placeholder ?? "Search"}
470
+ />
471
+
472
+ <div class="clear-button-container ${A({ displayable: this.searchValue !== "" })}">
473
+ ${x(this, n, Ee) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
474
+ <button type="button" @click=${h(this, n, De)} title=${this.clearButtonTitle ?? "clear"}>
475
+ <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
476
+ </button>
477
+ `}
478
+ </div>
479
+
480
+ ${this.enableReverse === "button" ? m`
481
+ <button
482
+ type="button"
483
+ class=${A({ active: this.reverseActive })}
484
+ title=${this.reverseButtonTitle ?? "toggle reverse geocoding"}
485
+ @click=${() => this.reverseActive = !this.reverseActive}
486
+ >
487
+ <maptiler-geocode-reverse-geocoding-icon></maptiler-geocode-reverse-geocoding-icon>
488
+ </button>
489
+ ` : J}
490
+
491
+ <!-- <slot /> -->
492
+ </div>
493
+
494
+ ${this.error ? m`
495
+ <div class="error">
496
+ <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
497
+
498
+ <div>${this.errorMessage ?? "Something went wrong…"}</div>
499
+
500
+ <button @click=${() => this.error = void 0}>
501
+ <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
502
+ </button>
503
+ </div>
504
+ ` : !this.focusedDelayed && !this.keepListOpen || this.listFeatures === void 0 ? J : this.listFeatures.length === 0 ? m`
505
+ <div class="no-results">
506
+ <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
507
+
508
+ <div>
509
+ ${this.noResultsMessage ?? "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!"}
510
+ </div>
511
+ </div>
512
+ ` : m`
513
+ <ul class="options ${A({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, n, ze)} @keydown=${h(this, n, ne)} role="listbox">
514
+ ${Ve(
515
+ this.listFeatures,
516
+ (t) => t.id + (t.address ? "," + t.address : ""),
517
+ (t, e) => m`
518
+ <maptiler-geocoder-feature-item
519
+ .feature=${t}
520
+ .showPlaceType=${this.showPlaceType ?? "if-needed"}
521
+ itemStyle=${this.selectedItemIndex === e ? "selected" : this.picked?.id === t.id ? "picked" : "default"}
522
+ @mouseenter=${() => {
523
+ h(this, n, Ue).call(this, e);
524
+ }}
525
+ @select=${() => {
526
+ h(this, n, Ge).call(this, t);
527
+ }}
528
+ .missingIconsCache=${x(this, ae)}
529
+ .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.1/icons/"}
530
+ >
531
+ ${t.place_name}
532
+ </maptiler-geocoder-feature-item>
533
+ `
534
+ )}
535
+ </ul>
536
+ `}
537
+ </form>
538
+ `;
539
+ }
540
+ };
541
+ Z = /* @__PURE__ */ new WeakMap();
542
+ V = /* @__PURE__ */ new WeakMap();
543
+ z = /* @__PURE__ */ new WeakMap();
544
+ ae = /* @__PURE__ */ new WeakMap();
545
+ D = /* @__PURE__ */ new WeakMap();
546
+ n = /* @__PURE__ */ new WeakSet();
547
+ Q = function() {
548
+ return this.listFeatures?.[this.selectedItemIndex];
549
+ };
550
+ Se = function() {
551
+ return !!this.listFeatures?.length && (this.focusedDelayed || this.keepListOpen);
552
+ };
553
+ Ee = function() {
554
+ return this.abortController !== void 0;
555
+ };
556
+ de = function() {
557
+ return this.searchValue.length < (this.minLength ?? 2);
558
+ };
559
+ v = function(t, ...[e]) {
560
+ x(this, Z) && this.dispatchEvent(
561
+ new CustomEvent(t, {
562
+ bubbles: !0,
563
+ composed: !0,
564
+ detail: e
565
+ })
566
+ );
567
+ };
568
+ ue = function(t) {
569
+ t?.preventDefault(), this.focused = !1, clearTimeout(x(this, z)), 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, n, H).call(this, this.searchValue, { exact: !0 }).then(() => {
570
+ this.picked = void 0;
571
+ }).catch((e) => this.error = e);
572
+ };
573
+ K = function(t) {
574
+ try {
575
+ return We(t, 6);
576
+ } catch {
577
+ return !1;
578
+ }
579
+ };
580
+ fe = function() {
581
+ setTimeout(() => {
582
+ this.input.focus(), this.focused = !0, this.input.select();
583
+ });
584
+ };
585
+ me = function(t) {
586
+ if (this.searchValue = t, h(this, n, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, n, K).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
587
+ if (clearTimeout(x(this, z)), x(this, n, de))
588
+ return;
589
+ const e = this.searchValue;
590
+ W(this, z, window.setTimeout(() => {
591
+ h(this, n, H).call(this, e).catch((i) => this.error = i);
592
+ }, this.debounceSearch ?? 200));
593
+ } else
594
+ h(this, n, L).call(this);
595
+ };
596
+ L = function() {
597
+ this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, n, v).call(this, "featuresclear"));
598
+ };
599
+ ge = function(t) {
600
+ this.searchValue = t, h(this, n, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, n, K).call(this, t) }), this.selectedItemIndex = -1, h(this, n, ue).call(this);
601
+ };
602
+ H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
603
+ this.error = void 0, this.abortController?.abort();
604
+ const r = new AbortController();
605
+ this.abortController = r;
606
+ try {
607
+ const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", s = h(this, n, K).call(this, t), a = new URL(o + "/" + encodeURIComponent(s ? `${s.decimalLongitude},${s.decimalLatitude}` : t) + ".json"), u = a.searchParams;
608
+ this.language !== void 0 && u.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
609
+ const [k] = x(this, D) ?? [void 0];
610
+ let w = (!s || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
611
+ (y) => typeof y == "string" ? y : k === void 0 || (y[0] ?? 0) <= k && k < (y[1] ?? 1 / 0) ? y[2] : void 0
612
+ ).filter((y) => y !== void 0);
613
+ w && (w = [...new Set(w)], u.set("types", w.join(",")));
614
+ const T = !s || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
615
+ if (T && u.set("excludeTypes", String(T)), this.bbox && u.set("bbox", this.bbox.map((y) => y.toFixed(6)).join(",")), this.country && u.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), !e && !s) {
616
+ const y = this.proximity ?? [{ type: "server-geolocation" }], ve = await ft(x(this, D), y, r);
617
+ ve && u.set("proximity", ve), (i || this.showResultsWhileTyping === !1) && u.set("autocomplete", "false"), u.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
618
+ }
619
+ const ye = this.limit ?? 5, Y = this.reverseGeocodingLimit ?? ye;
620
+ Y > 1 && w?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), s ? (Y === 1 || this.exhaustiveReverseGeocoding || w?.length === 1) && u.set("limit", String(Y)) : u.set("limit", String(ye)), this.apiKey && u.set("key", this.apiKey), this.adjustUrl?.(a);
621
+ const je = a.searchParams.get("types") === "" && a.searchParams.get("excludeTypes") !== "true", j = a.toString();
622
+ if (j === this.lastSearchUrl) {
623
+ e ? (this.clearListOnPick && h(this, n, L).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, n, v).call(this, "featureslisted", { features: this.listFeatures }), this.listFeatures[this.selectedItemIndex]?.id !== x(this, n, Q)?.id && (this.selectedItemIndex = -1));
624
+ return;
625
+ }
626
+ h(this, n, v).call(this, "request", { urlObj: a }), this.lastSearchUrl = j;
627
+ let P;
628
+ if (je)
629
+ P = { type: "FeatureCollection", features: [] };
630
+ else {
631
+ const y = await fetch(j, {
632
+ signal: r.signal,
633
+ ...this.fetchParameters
634
+ });
635
+ if (!y.ok)
636
+ throw new Error(await y.text());
637
+ P = await y.json();
638
+ }
639
+ h(this, n, v).call(this, "response", { url: j, featureCollection: P }), e ? (this.clearListOnPick && h(this, n, L).call(this), this.picked = P.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = P.features.filter(this.filter ?? (() => !0)), s && this.listFeatures.unshift({
640
+ type: "Feature",
641
+ properties: {},
642
+ /* eslint-disable @typescript-eslint/restrict-template-expressions */
643
+ id: `reverse_${s.decimalLongitude}_${s.decimalLatitude}`,
644
+ text: `${s.decimalLatitude}, ${s.decimalLongitude}`,
645
+ place_name: s.toCoordinateFormat("DMS"),
646
+ /* eslint-enable @typescript-eslint/restrict-template-expressions */
647
+ place_type: ["reverse"],
648
+ place_type_name: ["reverse"],
649
+ center: [s.decimalLongitude, s.decimalLatitude],
650
+ bbox: [s.decimalLongitude, s.decimalLatitude, s.decimalLongitude, s.decimalLatitude],
651
+ geometry: {
652
+ type: "Point",
653
+ coordinates: [s.decimalLongitude, s.decimalLatitude]
654
+ }
655
+ }), h(this, n, v).call(this, "featureslisted", { features: this.listFeatures }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== x(this, n, Q)?.id && (this.selectedItemIndex = -1), s && this.input.focus());
656
+ } catch (o) {
657
+ if (o && typeof o == "object" && "name" in o && o.name === "AbortError")
658
+ return;
659
+ throw o;
660
+ } finally {
661
+ r === this.abortController && (this.abortController = void 0);
662
+ }
663
+ };
664
+ Pe = function(t) {
665
+ this.reverseActive = this.enableReverse === "always", h(this, n, L).call(this), this.picked = void 0, h(this, n, ge).call(this, `${t[1].toFixed(6)}, ${ut(t[0], [-180, 180], !0).toFixed(6)}`), h(this, n, fe).call(this);
666
+ };
667
+ ne = function(t) {
668
+ if (!this.listFeatures)
669
+ return;
670
+ const e = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
671
+ 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));
672
+ };
673
+ Be = function(t) {
674
+ h(this, n, me).call(this, t.target.value);
675
+ };
676
+ Ge = function(t) {
677
+ (!this.picked || this.picked.id !== t.id) && (this.picked = t, this.searchValue = t.place_name);
678
+ };
679
+ Ue = function(t) {
680
+ this.selectedItemIndex = t;
681
+ };
682
+ ze = function() {
683
+ (!this.selectFirst || this.picked) && (this.selectedItemIndex = -1);
684
+ };
685
+ De = function() {
686
+ this.searchValue = "", h(this, n, v).call(this, "queryclear"), this.picked = void 0, this.input.focus();
687
+ };
688
+ l.styles = I`
689
+ ${ce(xt)}
690
+ `;
691
+ c([
692
+ p({ attribute: !1 })
693
+ ], l.prototype, "adjustUrl", 2);
694
+ c([
695
+ p({ type: String })
696
+ ], l.prototype, "apiKey", 2);
697
+ c([
698
+ p({ type: String })
699
+ ], l.prototype, "apiUrl", 2);
700
+ c([
701
+ p({ type: Array })
702
+ ], l.prototype, "bbox", 2);
703
+ c([
704
+ p({ type: String })
705
+ ], l.prototype, "clearButtonTitle", 2);
706
+ c([
707
+ p({ type: Boolean })
708
+ ], l.prototype, "clearListOnPick", 2);
709
+ c([
710
+ p({ type: Boolean })
711
+ ], l.prototype, "clearOnBlur", 2);
712
+ c([
713
+ p({ type: Boolean })
714
+ ], l.prototype, "collapsed", 2);
715
+ c([
716
+ p({ attribute: !1 })
717
+ ], l.prototype, "country", 2);
718
+ c([
719
+ p({ type: Number })
720
+ ], l.prototype, "debounceSearch", 2);
721
+ c([
722
+ p({ type: String })
723
+ ], l.prototype, "enableReverse", 2);
724
+ c([
725
+ p({ type: String })
726
+ ], l.prototype, "errorMessage", 2);
727
+ c([
728
+ p({ type: Boolean })
729
+ ], l.prototype, "excludeTypes", 2);
730
+ c([
731
+ p({ type: Boolean })
732
+ ], l.prototype, "exhaustiveReverseGeocoding", 2);
733
+ c([
734
+ p({ type: Boolean })
735
+ ], l.prototype, "fetchFullGeometryOnPick", 2);
736
+ c([
737
+ p({ type: Object })
738
+ ], l.prototype, "fetchParameters", 2);
739
+ c([
740
+ p({ attribute: !1 })
741
+ ], l.prototype, "filter", 2);
742
+ c([
743
+ p({ type: Object })
744
+ ], l.prototype, "fuzzyMatch", 2);
745
+ c([
746
+ p({ type: String })
747
+ ], l.prototype, "iconsBaseUrl", 2);
748
+ c([
749
+ p({ type: Boolean })
750
+ ], l.prototype, "keepListOpen", 2);
751
+ c([
752
+ p({ attribute: !1 })
753
+ ], l.prototype, "language", 2);
754
+ c([
755
+ p({ type: Number })
756
+ ], l.prototype, "limit", 2);
757
+ c([
758
+ p({ type: Number })
759
+ ], l.prototype, "minLength", 2);
760
+ c([
761
+ p({ type: String })
762
+ ], l.prototype, "noResultsMessage", 2);
763
+ c([
764
+ p({ type: Boolean })
765
+ ], l.prototype, "openListOnTop", 2);
766
+ c([
767
+ p({ type: String })
768
+ ], l.prototype, "placeholder", 2);
769
+ c([
770
+ p({ type: Array })
771
+ ], l.prototype, "proximity", 2);
772
+ c([
773
+ p({ type: Boolean })
774
+ ], l.prototype, "reverseActive", 2);
775
+ c([
776
+ p({ type: String })
777
+ ], l.prototype, "reverseButtonTitle", 2);
778
+ c([
779
+ p({ type: Object })
780
+ ], l.prototype, "reverseGeocodingExcludeTypes", 2);
781
+ c([
782
+ p({ type: Number })
783
+ ], l.prototype, "reverseGeocodingLimit", 2);
784
+ c([
785
+ p({ type: Array })
786
+ ], l.prototype, "reverseGeocodingTypes", 2);
787
+ c([
788
+ p({ type: Object })
789
+ ], l.prototype, "selectFirst", 2);
790
+ c([
791
+ p({ type: String })
792
+ ], l.prototype, "showPlaceType", 2);
793
+ c([
794
+ p({ type: Object })
795
+ ], l.prototype, "showResultsWhileTyping", 2);
796
+ c([
797
+ p({ type: Array })
798
+ ], l.prototype, "types", 2);
799
+ c([
800
+ Ae("input")
801
+ ], l.prototype, "input", 2);
802
+ c([
803
+ b()
804
+ ], l.prototype, "searchValue", 2);
805
+ c([
806
+ b()
807
+ ], l.prototype, "listFeatures", 2);
808
+ c([
809
+ b()
810
+ ], l.prototype, "selectedItemIndex", 2);
811
+ c([
812
+ b()
813
+ ], l.prototype, "picked", 2);
814
+ c([
815
+ b()
816
+ ], l.prototype, "cachedFeatures", 2);
817
+ c([
818
+ b()
819
+ ], l.prototype, "lastSearchUrl", 2);
820
+ c([
821
+ b()
822
+ ], l.prototype, "error", 2);
823
+ c([
824
+ b()
825
+ ], l.prototype, "abortController", 2);
826
+ c([
827
+ b()
828
+ ], l.prototype, "focused", 2);
829
+ c([
830
+ b()
831
+ ], l.prototype, "focusedDelayed", 2);
832
+ l = c([
833
+ C("maptiler-geocoder")
834
+ ], l);
835
+ const wt = [
836
+ "adjustUrl",
837
+ "apiKey",
838
+ "apiUrl",
839
+ "bbox",
840
+ "clearButtonTitle",
841
+ "clearListOnPick",
842
+ "clearOnBlur",
843
+ "collapsed",
844
+ "country",
845
+ "debounceSearch",
846
+ "enableReverse",
847
+ "errorMessage",
848
+ "excludeTypes",
849
+ "reverseGeocodingExcludeTypes",
850
+ "exhaustiveReverseGeocoding",
851
+ "fetchParameters",
852
+ "fetchFullGeometryOnPick",
853
+ "filter",
854
+ "fuzzyMatch",
855
+ "iconsBaseUrl",
856
+ "keepListOpen",
857
+ "language",
858
+ "limit",
859
+ "reverseGeocodingLimit",
860
+ "minLength",
861
+ "noResultsMessage",
862
+ "openListOnTop",
863
+ "placeholder",
864
+ "proximity",
865
+ "reverseActive",
866
+ "reverseButtonTitle",
867
+ "selectFirst",
868
+ "showPlaceType",
869
+ "showResultsWhileTyping",
870
+ "types",
871
+ "reverseGeocodingTypes"
872
+ ], _t = "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-reverse-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-reverse-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)}";
873
+ var $t = Object.getOwnPropertyDescriptor, Lt = (t, e, i, r) => {
874
+ for (var o = r > 1 ? void 0 : r ? $t(e, i) : e, s = t.length - 1, a; s >= 0; s--)
875
+ (a = t[s]) && (o = a(o) || o);
876
+ return o;
877
+ };
878
+ let le = class extends M {
879
+ render() {
880
+ return R`
881
+ <svg
882
+ viewBox="0 0 70 85"
883
+ fill="none"
884
+ class:in-map={displayIn !== "list"}
885
+ >
886
+ <path
887
+ stroke-width="4"
888
+ d="M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"
889
+ />
890
+ </svg>
891
+ `;
892
+ }
893
+ };
894
+ le.styles = I`
895
+ ${ce(_t)}
896
+ `;
897
+ le = Lt([
898
+ C("maptiler-geocode-marker")
899
+ ], le);
900
+ function we(t) {
901
+ const e = tt(
902
+ q([
903
+ Ze([
904
+ [
905
+ [180, 90],
906
+ [-180, 90],
907
+ [-180, -90],
908
+ [180, -90],
909
+ [180, 90]
910
+ ]
911
+ ]),
912
+ t
913
+ ])
914
+ );
915
+ if (!e)
916
+ return;
917
+ e.properties = { isMask: !0 };
918
+ const i = U(X(t)), r = (i[2] - i[0]) / 360 / 1e3, o = i[0] < -180, s = i[2] > 180, a = it(t);
919
+ if (a.features.length > 1 && (o || s))
920
+ for (const u of a.features) {
921
+ const k = U(X(u));
922
+ if (s && k[0] < -180 + r)
923
+ for (const w of u.geometry.coordinates)
924
+ for (const T of w)
925
+ T[0] += 360 - r;
926
+ if (o && k[2] > 180 - r)
927
+ for (const w of u.geometry.coordinates)
928
+ for (const T of w)
929
+ T[0] -= 360 - r;
930
+ }
931
+ return q([a.features.length < 2 ? t : _e(a) ?? t, e]);
932
+ }
933
+ const It = {
934
+ continental_marine: 4,
935
+ country: 4,
936
+ major_landform: 8,
937
+ region: 5,
938
+ subregion: 6,
939
+ county: 7,
940
+ joint_municipality: 8,
941
+ joint_submunicipality: 9,
942
+ municipality: 10,
943
+ municipal_district: 11,
944
+ locality: 12,
945
+ neighbourhood: 13,
946
+ place: 14,
947
+ postal_code: 14,
948
+ road: 16,
949
+ poi: 17,
950
+ address: 18,
951
+ "poi.peak": 15,
952
+ "poi.shop": 18,
953
+ "poi.cafe": 18,
954
+ "poi.restaurant": 18,
955
+ "poi.aerodrome": 13
956
+ // TODO add many more
957
+ }, Mt = (t) => {
958
+ const e = t?.geometry.type, i = t?.properties?.isMask, r = i ? 0 : e === "LineString" || e === "MultiLineString" ? 3 : 2;
959
+ return {
960
+ color: "#3170fe",
961
+ fillColor: "#000",
962
+ fillOpacity: i ? 0.1 : 0,
963
+ weight: r,
964
+ dashArray: [r, r],
965
+ lineCap: "butt"
966
+ };
967
+ };
968
+ class Re extends He {
969
+ }
970
+ Object.assign(Re.prototype, Ke.prototype);
971
+ class jt extends Re {
972
+ #e;
973
+ #t;
974
+ constructor(e = {}) {
975
+ super(e);
976
+ }
977
+ onAdd(e) {
978
+ this.#e = e, this.#t = e.getContainer().ownerDocument.createElement("maptiler-geocoder"), this.#t.classList.add("leaflet-geocoder"), this.#m(), this.#x(), this.#I();
979
+ const i = e.getContainer().ownerDocument.createElement("div");
980
+ return i.classList.add("leaflet-ctrl-geocoder", "leaflet-bar"), i.style.zIndex = "850", i.appendChild(this.#t), xe.disableClickPropagation(i), xe.disableScrollPropagation(i), i;
981
+ }
982
+ onRemove() {
983
+ this.#b(), this.#M(), this.#e = void 0, this.#t = void 0;
984
+ }
985
+ /**
986
+ * Update the control options.
987
+ *
988
+ * @param options options to update
989
+ */
990
+ setOptions(e) {
991
+ Object.assign(this.options, e), this.#m();
992
+ }
993
+ /**
994
+ * Set the content of search input box.
995
+ *
996
+ * @param value text to set
997
+ */
998
+ setQuery(e) {
999
+ this.#t?.setQuery(e);
1000
+ }
1001
+ /**
1002
+ * Set the content of search input box and immediately submit it.
1003
+ *
1004
+ * @param value text to set and submit
1005
+ */
1006
+ submitQuery(e) {
1007
+ this.#t?.submitQuery(e);
1008
+ }
1009
+ /**
1010
+ * Clear geocoding search results from the map.
1011
+ */
1012
+ clearMap() {
1013
+ this.#r = [], this.#c(void 0, void 0);
1014
+ }
1015
+ /**
1016
+ * Clear search result list.
1017
+ */
1018
+ clearList() {
1019
+ this.#t?.clearList();
1020
+ }
1021
+ /**
1022
+ * Set reverse geocoding mode.
1023
+ *
1024
+ * @param reverseActive reverse geocoding active
1025
+ */
1026
+ setReverseMode(e) {
1027
+ this.setOptions({ reverseActive: e });
1028
+ }
1029
+ /**
1030
+ * Focus the search input box.
1031
+ *
1032
+ * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
1033
+ */
1034
+ focus(e) {
1035
+ this.#t?.focus(e);
1036
+ }
1037
+ /**
1038
+ * Blur the search input box.
1039
+ */
1040
+ blur() {
1041
+ this.#t?.blur();
1042
+ }
1043
+ /** Markers currently displayed on the map */
1044
+ #a = /* @__PURE__ */ new Map();
1045
+ /** Marker representing the selected feature */
1046
+ #n;
1047
+ /** Marker representing the picked feature */
1048
+ #o;
1049
+ /** Features currently marked on the map */
1050
+ #r;
1051
+ /** Remember last feature that the map flew to as to not do it again */
1052
+ #d;
1053
+ /** Layer used for showing geometry results */
1054
+ #s;
1055
+ #u = {
1056
+ reversetoggle: (e) => {
1057
+ const i = this.#e?.getContainer();
1058
+ i && (i.style.cursor = e.detail.reverse ? "crosshair" : ""), this.#i("reversetoggle", e.detail);
1059
+ },
1060
+ querychange: (e) => {
1061
+ const i = e.detail.reverseCoords;
1062
+ this.#v(i ? { lng: i.decimalLongitude, lat: i.decimalLatitude } : void 0), this.#i("querychange", e.detail);
1063
+ },
1064
+ queryclear: () => {
1065
+ this.#v(void 0), this.#i("queryclear");
1066
+ },
1067
+ request: (e) => {
1068
+ this.#i("request", e.detail);
1069
+ },
1070
+ response: (e) => {
1071
+ this.#i("response", e.detail);
1072
+ },
1073
+ select: (e) => {
1074
+ const i = e.detail.feature;
1075
+ i && this.#h && this.options.flyToSelected && this.#g({ lng: i.center[0], lat: i.center[1] }, this.#l(i)), this.#r && i && this.#L(i), this.#i("select", e.detail);
1076
+ },
1077
+ pick: (e) => {
1078
+ const i = e.detail.feature;
1079
+ i && i.id !== this.#d && this.#h && (this.#k(i), this.#c(this.#r, i)), this.#d = i?.id, this.#i("pick", e.detail);
1080
+ },
1081
+ featuresshow: () => {
1082
+ this.#i("featuresshow");
1083
+ },
1084
+ featureshide: () => {
1085
+ this.#i("featureshide");
1086
+ },
1087
+ featureslisted: (e) => {
1088
+ const i = e.detail.features;
1089
+ this.#r = i, this.#c(this.#r, void 0), this.#w(i), this.#i("featureslisted", e.detail);
1090
+ },
1091
+ featuresclear: () => {
1092
+ this.#r = void 0, this.#c(void 0, void 0), this.#i("featuresclear");
1093
+ },
1094
+ focusin: () => {
1095
+ this.#i("focusin");
1096
+ },
1097
+ focusout: () => {
1098
+ this.#i("focusout");
1099
+ }
1100
+ };
1101
+ #f = {
1102
+ render: () => {
1103
+ const e = this.#e?.getZoom(), i = this.#e?.getCenter();
1104
+ this.#t?.handleMapChange(e && i ? [e, i.lng, i.lat] : void 0);
1105
+ },
1106
+ click: (e) => {
1107
+ this.#t?.handleMapClick([e.latlng.lng, e.latlng.lat]);
1108
+ }
1109
+ };
1110
+ #m() {
1111
+ this.#t && (this.#t.setOptions(this.options), this.#t.fetchFullGeometryOnPick = this.options.pickedResultStyle !== "marker-only", this.#t.openListOnTop = this.options.position === "bottomleft" || this.options.position === "bottomright");
1112
+ }
1113
+ #x() {
1114
+ if (!(!this.#t || !this.#e)) {
1115
+ for (const [e, i] of Object.entries(this.#u))
1116
+ this.#t.addEventListener(e, i);
1117
+ this.#e.on(this.#f);
1118
+ }
1119
+ }
1120
+ #b() {
1121
+ if (!(!this.#t || !this.#e)) {
1122
+ for (const [e, i] of Object.entries(this.#u))
1123
+ this.#t.removeEventListener(e, i);
1124
+ this.#e.off(this.#f);
1125
+ }
1126
+ }
1127
+ #i(e, i) {
1128
+ return super.fire(e, i);
1129
+ }
1130
+ #k(e) {
1131
+ e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#g({ lng: e.center[0], lat: e.center[1] }, this.#l(e)) : this.#y(U(e.bbox), 50, this.#l(e));
1132
+ }
1133
+ #w(e) {
1134
+ if (!e || e.length === 0 || !this.#h) return;
1135
+ const i = e.every((s) => s.matching_text), r = e.reduce(
1136
+ (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,
1137
+ [180, 90, -180, -90]
1138
+ ), o = e.map((s) => this.#l(s)).filter((s) => s !== void 0).reduce((s, a) => s === void 0 ? a : Math.max(s, a), void 0);
1139
+ this.#y(U(r), 50, o);
1140
+ }
1141
+ #l(e) {
1142
+ if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
1143
+ return;
1144
+ const i = e.id.replace(/\..*/, ""), r = this.options.zoom ?? It;
1145
+ return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((o, s) => {
1146
+ const a = r[i + "." + s];
1147
+ return o === void 0 ? a : a === void 0 ? o : Math.max(o, a);
1148
+ }, void 0) : void 0) ?? r[i];
1149
+ }
1150
+ get #h() {
1151
+ return !!this.options.flyTo || this.options.flyTo === void 0;
1152
+ }
1153
+ get #_() {
1154
+ return typeof this.options.flyTo == "boolean" ? {} : this.options.flyTo;
1155
+ }
1156
+ get #$() {
1157
+ return typeof this.options.flyTo == "boolean" ? {} : this.options.flyTo;
1158
+ }
1159
+ #g(e, i) {
1160
+ this.#e?.flyTo(e, i, this.#_ ?? void 0);
1161
+ }
1162
+ #y(e, i, r) {
1163
+ this.#e?.fitBounds(
1164
+ [
1165
+ [e[1], e[0]],
1166
+ [e[3], e[2]]
1167
+ ],
1168
+ { padding: [i, i], ...r ? { maxZoom: r } : {}, ...this.#$ }
1169
+ );
1170
+ }
1171
+ #v(e) {
1172
+ if (!(this.options.marker === !1 || this.options.marker === null || !this.#e)) {
1173
+ if (!e) {
1174
+ this.#o?.remove(), this.#o = void 0;
1175
+ return;
1176
+ }
1177
+ this.#o || (this.options.marker instanceof Function ? this.#o = this.options.marker(this.#e) ?? void 0 : (this.#o = this.#p(e, this.options.marker).addTo(this.#e), this.#o.getElement()?.classList.add("marker-reverse"))), this.#o?.setLatLng(e);
1178
+ }
1179
+ }
1180
+ #c(e, i) {
1181
+ if (!this.#e)
1182
+ return;
1183
+ for (const o of this.#a.values())
1184
+ o.remove();
1185
+ this.#a = /* @__PURE__ */ new Map(), this.#s?.clearLayers();
1186
+ const r = () => {
1187
+ if (!i || !this.#e || this.options.marker === !1 || this.options.marker === null) return;
1188
+ const o = this.options.marker instanceof Function ? this.options.marker(this.#e, i) : this.#p({ lng: i.center[0], lat: i.center[1] }, this.options.marker).addTo(this.#e);
1189
+ o && this.#a.set(i, o);
1190
+ };
1191
+ if (i?.geometry.type === "GeometryCollection") {
1192
+ const o = i.geometry.geometries.filter(
1193
+ (s) => s.type === "Polygon" || s.type === "MultiPolygon"
1194
+ );
1195
+ if (o.length > 0) {
1196
+ const s = _e(q(o.map((a) => Qe(a))));
1197
+ if (s) {
1198
+ const a = we({ ...i, geometry: s.geometry });
1199
+ if (a) {
1200
+ const u = [...a.features], k = U(X(i)), w = k[2] - k[0];
1201
+ k[0] - w / 4 < -180 && u.push(...be(a, -360).features), k[2] + w / 4 > 180 && u.push(...be(a, 360).features), this.#s?.addData(q(u));
1202
+ }
1203
+ }
1204
+ } else {
1205
+ const s = i.geometry.geometries.filter(
1206
+ (a) => a.type === "LineString" || a.type === "MultiLineString"
1207
+ );
1208
+ s.length > 0 && this.#s?.addData({
1209
+ ...i,
1210
+ geometry: { type: "GeometryCollection", geometries: s }
1211
+ });
1212
+ }
1213
+ } else if (i?.geometry.type.endsWith("Polygon")) {
1214
+ const o = we(i);
1215
+ o && this.#s?.addData(o), this.options.pickedResultStyle === "full-geometry-including-polygon-center-marker" && r();
1216
+ } else i?.geometry.type.endsWith("LineString") ? this.#s?.addData(i) : i?.geometry.type.endsWith("Point") && r();
1217
+ if (this.options.showResultMarkers !== !1 && this.options.showResultMarkers !== null)
1218
+ for (const o of e ?? []) {
1219
+ if (o.id === i?.id || o.place_type.includes("reverse"))
1220
+ continue;
1221
+ let s;
1222
+ if (this.options.showResultMarkers instanceof Function) {
1223
+ if (s = this.options.showResultMarkers(this.#e, o), !s)
1224
+ continue;
1225
+ } else
1226
+ s = this.#p({ lng: o.center[0], lat: o.center[1] }, this.options.showResultMarkers).bindPopup(
1227
+ new Ye({
1228
+ offset: [0.3, -21],
1229
+ closeButton: !1,
1230
+ closeOnMove: !0,
1231
+ className: "maptiler-gc-popup"
1232
+ }).setContent(o.place_type[0] === "reverse" ? o.place_name : o.place_name.replace(/,.*/, ""))
1233
+ ).addTo(this.#e), s.getElement()?.classList.add("marker-interactive");
1234
+ const a = s.getElement();
1235
+ a?.addEventListener("click", (u) => {
1236
+ u.stopPropagation(), this.#i("markerclick", { feature: o, marker: s });
1237
+ }), a?.addEventListener("mouseenter", () => {
1238
+ this.#i("markermouseenter", { feature: o, marker: s }), s.togglePopup();
1239
+ }), a?.addEventListener("mouseleave", () => {
1240
+ this.#i("markermouseleave", { feature: o, marker: s }), s.togglePopup();
1241
+ }), a?.classList.toggle("marker-fuzzy", !!o.matching_text), this.#a.set(o, s);
1242
+ }
1243
+ }
1244
+ #L(e) {
1245
+ this.#n?.getElement()?.classList.toggle("marker-selected", !1), this.#n = void 0, this.options.markerOnSelected !== !1 && (this.#n = this.#a.get(e), this.#n?.getElement()?.classList.toggle("marker-selected", !0));
1246
+ }
1247
+ #I() {
1248
+ this.#e && (this.#s = new Je(void 0, {
1249
+ style: this.options.fullGeometryStyle === !0 ? Mt : this.options.fullGeometryStyle === !1 ? void 0 : this.options.fullGeometryStyle ?? void 0,
1250
+ interactive: !1
1251
+ }).addTo(this.#e));
1252
+ }
1253
+ #M() {
1254
+ this.#e && (this.#s?.removeFrom(this.#e), this.#s = void 0);
1255
+ }
1256
+ #p(e, i) {
1257
+ return typeof i != "object" && (i = { icon: new Xe({ html: this.#e?.getContainer().ownerDocument.createElement("maptiler-geocode-marker"), iconAnchor: [12.3, 30], className: "" }) }), new et(e, i);
1258
+ }
1259
+ }
1260
+ export {
1261
+ Mt as DEFAULT_GEOMETRY_STYLE,
1262
+ jt as GeocodingControl,
1263
+ jt as LeafletGeocodingControl,
1264
+ ee as MaptilerGeocodeClearIconElement,
1265
+ te as MaptilerGeocodeFailIconElement,
1266
+ ie as MaptilerGeocodeLoadingIconElement,
1267
+ le as MaptilerGeocodeMarkerElement,
1268
+ se as MaptilerGeocodeReverseGeocodingIconElement,
1269
+ oe as MaptilerGeocodeSearchIconElement,
1270
+ l as MaptilerGeocoderElement,
1271
+ It as ZOOM_DEFAULTS
1272
+ };
1273
+ //# sourceMappingURL=leaflet.public.js.map