@maptiler/geocoding-control 2.1.7 → 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 +34 -26
  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} +11 -147
  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 +80 -113
  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 -5082
  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 -5142
  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 -5152
  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 -5045
  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 -2795
  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 -921
  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 -2799
  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
package/openlayers.umd.js DELETED
@@ -1,14 +0,0 @@
1
- (function(F,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],$):(F=typeof globalThis<"u"?globalThis:F||self,$(F.openlayersMaptilerGeocoder={},F.ol.control,F.ol.events.Event,F.ol,F.ol.geom,F.ol.layer.Vector,F.ol.proj,F.ol.source.Vector,F.ol.style.Fill,F.ol.style.Icon,F.ol.style.Stroke,F.ol.style.Style,F.ol.style.Text))})(this,function(F,$,ne,Te,Me,On,Qe,Pn,bi,Rn,wi,In,An){"use strict";var zs=Object.defineProperty;var Nn=F=>{throw TypeError(F)};var Ds=(F,$,ne)=>$ in F?zs(F,$,{enumerable:!0,configurable:!0,writable:!0,value:ne}):F[$]=ne;var O=(F,$,ne)=>Ds(F,typeof $!="symbol"?$+"":$,ne),Cn=(F,$,ne)=>$.has(F)||Nn("Cannot "+ne);var de=(F,$,ne)=>(Cn(F,$,"read from private field"),ne?ne.call(F):$.get(F)),yi=(F,$,ne)=>$.has(F)?Nn("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(F):$.set(F,ne),pi=(F,$,ne,Te)=>(Cn(F,$,"write to private field"),Te?Te.call(F,ne):$.set(F,ne),ne);var bn,wn,ce,lt;function oe(){}function Gn(i,e){for(const t in e)i[t]=e[t];return i}function Ei(i){return i()}function Li(){return Object.create(null)}function Ue(i){i.forEach(Ei)}function Si(i){return typeof i=="function"}function it(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Pt;function ve(i,e){return i===e?!0:(Pt||(Pt=document.createElement("a")),Pt.href=e,i===Pt.href)}function Bn(i){return Object.keys(i).length===0}function Wn(i,e,t,n){if(i){const r=_i(i,e,t,n);return i[0](r)}}function _i(i,e,t,n){return i[1]&&n?Gn(t.ctx.slice(),i[1](n(e))):t.ctx}function Fn(i,e,t,n){return i[2],e.dirty}function zn(i,e,t,n,r,u){if(r){const a=_i(e,t,n,u);i.p(a,r)}}function Dn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Rt(i){return i??""}function Z(i,e){i.appendChild(e)}function ie(i,e,t){i.insertBefore(e,t||null)}function ee(i){i.parentNode&&i.parentNode.removeChild(i)}function Y(i){return document.createElement(i)}function qe(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Xe(i){return document.createTextNode(i)}function Ee(){return Xe(" ")}function Un(){return Xe("")}function ge(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function qn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Vn(i){return Array.from(i.childNodes)}function pt(i,e){e=""+e,i.data!==e&&(i.data=e)}function xi(i,e){i.value=e??""}function ct(i,e,t){i.classList.toggle(e,!!t)}function jn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let vt;function bt(i){vt=i}function Ti(){if(!vt)throw new Error("Function called outside component initialization");return vt}function Hn(i){Ti().$$.on_destroy.push(i)}function Mi(){const i=Ti();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=jn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,u)}),!u.defaultPrevented}return!0}}function Zn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ht=[],Kt=[];let dt=[];const Ni=[],Kn=Promise.resolve();let Yt=!1;function Yn(){Yt||(Yt=!0,Kn.then(Ci))}function Qt(i){dt.push(i)}const Xt=new Set;let gt=0;function Ci(){if(gt!==0)return;const i=vt;do{try{for(;gt<ht.length;){const e=ht[gt];gt++,bt(e),Qn(e.$$)}}catch(e){throw ht.length=0,gt=0,e}for(bt(null),ht.length=0,gt=0;Kt.length;)Kt.pop()();for(let e=0;e<dt.length;e+=1){const t=dt[e];Xt.has(t)||(Xt.add(t),t())}dt.length=0}while(ht.length);for(;Ni.length;)Ni.pop()();Yt=!1,Xt.clear(),bt(i)}function Qn(i){if(i.fragment!==null){i.update(),Ue(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Qt)}}function Xn(i){const e=[],t=[];dt.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),dt=e}const It=new Set;let nt;function wt(){nt={r:0,c:[],p:nt}}function Et(){nt.r||Ue(nt.c),nt=nt.p}function re(i,e){i&&i.i&&(It.delete(i),i.i(e))}function fe(i,e,t,n){if(i&&i.o){if(It.has(i))return;It.add(i),nt.c.push(()=>{It.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ki(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Jn(i,e){fe(i,1,1,()=>{e.delete(i.key)})}function $n(i,e,t,n,r,u,a,s,m,c,b,S){let M=i.length,k=u.length,N=M;const C={};for(;N--;)C[i[N].key]=N;const P=[],I=new Map,_=new Map,W=[];for(N=k;N--;){const A=S(r,u,N),o=t(A);let l=a.get(o);l?W.push(()=>l.p(A,e)):(l=c(o,A),l.c()),I.set(o,P[N]=l),o in C&&_.set(o,Math.abs(N-C[o]))}const z=new Set,D=new Set;function U(A){re(A,1),A.m(s,b),a.set(A.key,A),b=A.first,k--}for(;M&&k;){const A=P[k-1],o=i[M-1],l=A.key,f=o.key;A===o?(b=A.first,M--,k--):I.has(f)?!a.has(l)||z.has(l)?U(A):D.has(f)?M--:_.get(l)>_.get(f)?(D.add(l),U(A)):(z.add(f),M--):(m(o,a),M--)}for(;M--;){const A=i[M];I.has(A.key)||m(A,a)}for(;k;)U(P[k-1]);return Ue(W),P}function Je(i){i&&i.c()}function Ve(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Qt(()=>{const u=i.$$.on_mount.map(Ei).filter(Si);i.$$.on_destroy?i.$$.on_destroy.push(...u):Ue(u),i.$$.on_mount=[]}),r.forEach(Qt)}function je(i,e){const t=i.$$;t.fragment!==null&&(Xn(t.after_update),Ue(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function er(i,e){i.$$.dirty[0]===-1&&(ht.push(i),Yn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function rt(i,e,t,n,r,u,a=null,s=[-1]){const m=vt;bt(i);const c=i.$$={fragment:null,ctx:[],props:u,update:oe,not_equal:r,bound:Li(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(m?m.$$.context:[])),callbacks:Li(),dirty:s,skip_bound:!1,root:e.target||m.$$.root};a&&a(c.root);let b=!1;if(c.ctx=t?t(i,e.props||{},(S,M,...k)=>{const N=k.length?k[0]:M;return c.ctx&&r(c.ctx[S],c.ctx[S]=N)&&(!c.skip_bound&&c.bound[S]&&c.bound[S](N),b&&er(i,S)),M}):[],c.update(),b=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const S=Vn(e.target);c.fragment&&c.fragment.l(S),S.forEach(ee)}else c.fragment&&c.fragment.c();e.intro&&re(i.$$.fragment),Ve(i,e.target,e.anchor),Ci()}bt(m)}class st{constructor(){O(this,"$$");O(this,"$$set")}$destroy(){je(this,1),this.$destroy=oe}$on(e,t){if(!Si(t))return oe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Bn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const tr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(tr);function ir(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){ie(n,e,r),Z(e,t)},p:oe,i:oe,o:oe,d(n){n&&ee(e)}}}class Oi extends st{constructor(e){super(),rt(this,e,null,ir,it,{})}}function nr(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){ie(n,e,r),Z(e,t)},p:oe,i:oe,o:oe,d(n){n&&ee(e)}}}class Pi extends st{constructor(e){super(),rt(this,e,null,nr,it,{})}}function rr(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function sr(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function or(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function lr(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function ur(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function ar(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function fr(i){let e,t;return{c(){e=Y("img"),ve(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ie(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function cr(i){let e,t,n,r;return{c(){e=Y("img"),ve(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(u,a){ie(u,e,a),n||(r=ge(e,"error",i[14]),n=!0)},p(u,a){a&32&&!ve(e.src,t=u[5])&&x(e,"src",t),a&16&&x(e,"alt",u[4]),a&128&&x(e,"title",u[7])},d(u){u&&ee(e),n=!1,r()}}}function hr(i){let e,t;return{c(){e=Y("div"),x(e,"class","sprite-icon svelte-w9y5n9"),x(e,"style",t=`
2
- width: ${i[6].width/Ne}px;
3
- height: ${i[6].height/Ne}px;
4
- background-image: url(${i[3]}sprite${Jt}.png);
5
- background-position: -${i[6].x/Ne}px -${i[6].y/Ne}px;
6
- background-size: ${Re.width/Ne}px ${Re.height/Ne}px;
7
- `),x(e,"title",i[7])},m(n,r){ie(n,e,r)},p(n,r){r&72&&t!==(t=`
8
- width: ${n[6].width/Ne}px;
9
- height: ${n[6].height/Ne}px;
10
- background-image: url(${n[3]}sprite${Jt}.png);
11
- background-position: -${n[6].x/Ne}px -${n[6].y/Ne}px;
12
- background-size: ${Re.width/Ne}px ${Re.height/Ne}px;
13
- `)&&x(e,"style",t),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Ri(i){let e,t;return{c(){e=Y("span"),t=Xe(i[7]),x(e,"class","secondary svelte-w9y5n9")},m(n,r){ie(n,e,r),Z(e,t)},p(n,r){r&128&&pt(t,n[7])},d(n){n&&ee(e)}}}function dr(i){let e,t,n,r,u,a,s,m,c,b=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,M,k=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],N,C,P=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",I,_,W,z,D,U;function A(g,h){return h&1&&(t=null),h&1&&(n=null),h&1&&(r=null),h&1&&(u=null),Re&&g[6]?hr:g[5]?cr:g[0].address?fr:(t==null&&(t=!!g[0].id.startsWith("road.")),t?ar:(n==null&&(n=!!g[0].id.startsWith("address.")),n?ur:(r==null&&(r=!!g[0].id.startsWith("postal_code.")),r?lr:(u==null&&(u=!!g[0].id.startsWith("poi.")),u?or:g[8]?sr:rr))))}let o=A(i,-1),l=o(i),f=k&&Ri(i);return{c(){e=Y("li"),l.c(),a=Ee(),s=Y("span"),m=Y("span"),c=Y("span"),S=Xe(b),M=Ee(),f&&f.c(),N=Ee(),C=Y("span"),I=Xe(P),x(c,"class","primary svelte-w9y5n9"),x(m,"class","svelte-w9y5n9"),x(C,"class","line2 svelte-w9y5n9"),x(s,"class","texts svelte-w9y5n9"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",_=i[1]==="selected"),x(e,"aria-checked",W=i[1]==="picked"),x(e,"class",z=Rt(i[1])+" svelte-w9y5n9")},m(g,h){ie(g,e,h),l.m(e,null),Z(e,a),Z(e,s),Z(s,m),Z(m,c),Z(c,S),Z(m,M),f&&f.m(m,null),Z(s,N),Z(s,C),Z(C,I),D||(U=[ge(e,"mouseenter",i[13]),ge(e,"focus",i[15]),ge(e,"click",i[16])],D=!0)},p(g,[h]){o===(o=A(g,h))&&l?l.p(g,h):(l.d(1),l=o(g),l&&(l.c(),l.m(e,a))),h&257&&b!==(b=(g[8]?g[0].place_name:g[0].place_name.replace(/,.*/,""))+"")&&pt(S,b),h&293&&(k=g[2]==="always"||g[2]!=="never"&&!g[0].address&&!g[0].id.startsWith("road.")&&!g[0].id.startsWith("address.")&&!g[0].id.startsWith("postal_code.")&&(!g[0].id.startsWith("poi.")||!g[5])&&!g[8]),k?f?f.p(g,h):(f=Ri(g),f.c(),f.m(m,null)):f&&(f.d(1),f=null),h&257&&P!==(P=(g[8]?"":g[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&pt(I,P),h&2&&_!==(_=g[1]==="selected")&&x(e,"aria-selected",_),h&2&&W!==(W=g[1]==="picked")&&x(e,"aria-checked",W),h&2&&z!==(z=Rt(g[1])+" svelte-w9y5n9")&&x(e,"class",z)},i:oe,o:oe,d(g){g&&ee(e),l.d(),f&&f.d(),D=!1,Ue(U)}}}const Ii=typeof devicePixelRatio>"u"?1:devicePixelRatio>1.25,Jt=Ii?"@2x":"",Ne=Ii?2:1;let Re,At;function gr(i,e,t){let n,r,u,{feature:a}=e,{style:s="default"}=e,{showPlaceType:m}=e,{missingIconsCache:c}=e,{iconsBaseUrl:b}=e;const S=Mi();let M,k,N,C;function P(){At??(At=fetch(`${b}sprite${Jt}.json`).then(o=>o.json()).then(o=>{Re=o}).catch(()=>{Re=null}))}function I(){k&&c.add(k),_()}function _(){Re!==void 0?W():(P(),At==null||At.then(W))}function W(){do{if(C--,t(4,M=n==null?void 0:n[C]),t(6,N=M?Re==null?void 0:Re.icons[M]:void 0),N)break;t(5,k=M?b+M.replace(/ /g,"_")+".svg":void 0)}while(C>-1&&(!k||c.has(k)))}function z(o){Zn.call(this,i,o)}const D=()=>I(),U=()=>S("select",void 0),A=o=>{document.activeElement!==o.target&&S("select",void 0)};return i.$$set=o=>{"feature"in o&&t(0,a=o.feature),"style"in o&&t(1,s=o.style),"showPlaceType"in o&&t(2,m=o.showPlaceType),"missingIconsCache"in o&&t(11,c=o.missingIconsCache),"iconsBaseUrl"in o&&t(3,b=o.iconsBaseUrl)},i.$$.update=()=>{var o,l,f,g,h;i.$$.dirty&1&&t(12,n=(o=a.properties)==null?void 0:o.categories),i.$$.dirty&1&&t(8,r=a.place_type[0]==="reverse"),i.$$.dirty&1&&t(7,u=((f=(l=a.properties)==null?void 0:l.categories)==null?void 0:f.join(", "))??((h=(g=a.properties)==null?void 0:g.place_type_name)==null?void 0:h[0])??a.place_type[0]),i.$$.dirty&4096&&(C=(n==null?void 0:n.length)??0,_())},[a,s,m,b,M,k,N,u,r,S,I,c,n,z,D,U,A]}class mr extends st{constructor(e){super(),rt(this,e,gr,dr,it,{feature:0,style:1,showPlaceType:2,missingIconsCache:11,iconsBaseUrl:3})}}function yr(i){let e;return{c(){e=Y("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="loading-icon svelte-1ocfouu"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-1ocfouu")},m(t,n){ie(t,e,n)},p:oe,i:oe,o:oe,d(t){t&&ee(e)}}}class pr extends st{constructor(e){super(),rt(this,e,null,yr,it,{})}}function vr(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){ie(n,e,r),Z(e,t)},p:oe,i:oe,o:oe,d(n){n&&ee(e)}}}class br extends st{constructor(e){super(),rt(this,e,null,vr,it,{})}}function wr(i){let e,t,n;return{c(){e=qe("svg"),t=qe("circle"),n=qe("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){ie(r,e,u),Z(e,t),Z(e,n)},p:oe,i:oe,o:oe,d(r){r&&ee(e)}}}class Er extends st{constructor(e){super(),rt(this,e,null,wr,it,{})}}function Lr(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function Gt(i){const e=[...i];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}let Lt;async function Sr(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Lt&&r.cachedLocationExpiry&&Lt.time+r.cachedLocationExpiry>Date.now()){if(!Lt.coords)break e;return Lt.coords}let u;try{return u=await new Promise((a,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(m=>{a([m.coords.longitude,m.coords.latitude].map(c=>c.toFixed(6)).join(","))},m=>{s(m)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(Lt={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const _r=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Ai=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Gi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,Bi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Wi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Fi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function xr(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(k=>Number(k.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),a=t>0?"N":"S",s=n>0?"E":"W";let m;i=="DD"&&(m=`${r}° ${a}, ${u}° ${s}`);const c=Math.floor(r),b=Math.floor(u),S=(r-c)*60,M=(u-b)*60;if(i=="DM"){let k=zi(S,3).toFixed(3).padStart(6,"0"),N=zi(M,3).toFixed(3).padStart(6,"0");k.endsWith(".000")&&N.endsWith(".000")&&(k=k.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),m=`${c}° ${k}' ${a}, ${b}° ${N}' ${s}`}if(i=="DMS"){const k=Math.floor(S),N=Math.floor(M);let C=((S-k)*60).toFixed(1).padStart(4,"0"),P=((M-N)*60).toFixed(1).padStart(4,"0");const I=k.toString().padStart(2,"0"),_=N.toString().padStart(2,"0");C.endsWith(".0")&&P.endsWith(".0")&&(C=C.replace(/\.0$/,""),P=P.replace(/\.0$/,"")),m=`${c}° ${I}' ${C}" ${a}, ${b}° ${_}' ${P}" ${s}`}return m}else throw new Error("no decimal coordinates to convert")}function zi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function $t(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",a=null,s=[],m=!1;if(_r.test(i))throw new Error("invalid coordinate value");if(Ai.test(i))if(s=Ai.exec(i),m=St(s),m)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),a="DM";else throw new Error("invalid coordinate format");else if(Gi.test(i))if(s=Gi.exec(i),m=St(s),m){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),a="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],u=s[5]):s[4]&&(r=s[4],u=s[8])}else throw new Error("invalid decimal coordinate format");else if(Bi.test(i))if(s=Bi.exec(i),m=St(s),m)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],u=s[8]):s[7]&&(r=s[7],u=s[14]);else throw new Error("invalid DMS coordinates format");else if(Wi.test(i))if(s=Wi.exec(i),m=St(s),m)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6]/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid DMS coordinates format");else if(Fi.test(i)){if(s=Fi.exec(i),m=St(s),s.filter(c=>c).length<=5)throw new Error("invalid coordinates format");if(m)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid coordinates format")}if(m){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let c=/S|SOUTH/i;c.test(r)&&t>0&&(t=-1*t),c=/W|WEST/i,c.test(u)&&n>0&&(n=-1*n);const b=s[0].trim();let S,M;const k=/[,/;\u0020]/g,N=b.match(k);if(N==null){const I=Math.floor(i.length/2);S=b.substring(0,I).trim(),M=b.substring(I).trim()}else{let I;N.length%2==1?I=Math.floor(N.length/2):I=N.length/2-1;let _=0;if(I==0)_=b.indexOf(N[0]),S=b.substring(0,_).trim(),M=b.substring(_+1).trim();else{let W=0,z=0;for(;W<=I;)_=b.indexOf(N[W],z),z=_+1,W++;S=b.substring(0,_).trim(),M=b.substring(_+1).trim()}}const C=S.split(".");if(C.length==2&&C[1]==0&&C[1].length!=2)throw new Error("invalid coordinates format");const P=M.split(".");if(P.length==2&&P[1]==0&&P[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(M))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:b,verbatimLatitude:S,verbatimLongitude:M,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:Tr,toCoordinateFormat:xr})}else throw new Error("coordinates pattern match failed")}function St(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let u=0;u<r;u++){const a=e[u],s=e[u+r],m=t.test(a)&&t.test(s),c=n.test(a)&&n.test(s),b=a==s;if(!(a==null&&s==null)){if(a==null||s==null)return!1;if(m||c||b)continue;return!1}}return!0}function Di(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function Tr(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Di(this.decimalLatitude,Number(e[0]))&&Di(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Mr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});$t.to=Mr;const Nr=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Cr={decimalLatitude:40.123,decimalLongitude:-74.123},kr=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Or=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function Pr(){const i=[];return Nr.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Cr})}),[...i,...kr,...Or]}const Rr=Pr();$t.formats=Rr.map(i=>i.verbatimCoordinates);const Ir=$t;function Ui(i,e,t){const n=i.slice();return n[97]=e[t],n[99]=t,n}function qi(i){let e,t,n,r,u;return t=new Oi({}),{c(){e=Y("button"),Je(t.$$.fragment),x(e,"type","button"),x(e,"title",i[3]),x(e,"class","svelte-bz0zu3")},m(a,s){ie(a,e,s),Ve(t,e,null),n=!0,r||(u=ge(e,"click",i[78]),r=!0)},p(a,s){(!n||s[0]&8)&&x(e,"title",a[3])},i(a){n||(re(t.$$.fragment,a),n=!0)},o(a){fe(t.$$.fragment,a),n=!1},d(a){a&&ee(e),je(t),r=!1,u()}}}function Vi(i){let e,t;return e=new pr({}),{c(){Je(e.$$.fragment)},m(n,r){Ve(e,n,r),t=!0},i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){fe(e.$$.fragment,n),t=!1},d(n){je(e,n)}}}function ji(i){let e,t,n,r,u;return t=new br({}),{c(){e=Y("button"),Je(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),ct(e,"active",i[0])},m(a,s){ie(a,e,s),Ve(t,e,null),n=!0,r||(u=ge(e,"click",i[79]),r=!0)},p(a,s){(!n||s[0]&1024)&&x(e,"title",a[10]),(!n||s[0]&1)&&ct(e,"active",a[0])},i(a){n||(re(t.$$.fragment,a),n=!0)},o(a){fe(t.$$.fragment,a),n=!1},d(a){a&&ee(e),je(t),r=!1,u()}}}function Ar(i){let e,t=[],n=new Map,r,u,a,s=ki(i[13]);const m=c=>c[97].id+(c[97].address?","+c[97].address:"");for(let c=0;c<s.length;c+=1){let b=Ui(i,s,c),S=m(b);n.set(S,t[c]=Hi(S,b))}return{c(){e=Y("ul");for(let c=0;c<t.length;c+=1)t[c].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(c,b){ie(c,e,b);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(a=[ge(e,"mouseleave",i[27]),ge(e,"blur",i[83]),ge(e,"keydown",i[23])],u=!0)},p(c,b){b[0]&102823936&&(s=ki(c[13]),wt(),t=$n(t,b,m,1,c,s,n,e,Jn,Hi,null,Ui),Et())},i(c){if(!r){for(let b=0;b<s.length;b+=1)re(t[b]);r=!0}},o(c){for(let b=0;b<t.length;b+=1)fe(t[b]);r=!1},d(c){c&&ee(e);for(let b=0;b<t.length;b+=1)t[b].d();u=!1,Ue(a)}}}function Gr(i){let e,t,n,r,u,a;return t=new Pi({}),{c(){e=Y("div"),Je(t.$$.fragment),n=Ee(),r=Y("div"),u=Xe(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(s,m){ie(s,e,m),Ve(t,e,null),Z(e,n),Z(e,r),Z(r,u),a=!0},p(s,m){(!a||m[0]&256)&&pt(u,s[8])},i(s){a||(re(t.$$.fragment,s),a=!0)},o(s){fe(t.$$.fragment,s),a=!1},d(s){s&&ee(e),je(t)}}}function Br(i){let e="",t;return{c(){t=Xe(e)},m(n,r){ie(n,t,r)},p:oe,i:oe,o:oe,d(n){n&&ee(t)}}}function Wr(i){let e,t,n,r,u,a,s,m,c,b,S;return t=new Pi({}),m=new Oi({}),{c(){e=Y("div"),Je(t.$$.fragment),n=Ee(),r=Y("div"),u=Xe(i[7]),a=Ee(),s=Y("button"),Je(m.$$.fragment),x(r,"class","svelte-bz0zu3"),x(s,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(M,k){ie(M,e,k),Ve(t,e,null),Z(e,n),Z(e,r),Z(r,u),Z(e,a),Z(e,s),Ve(m,s,null),c=!0,b||(S=ge(s,"click",i[80]),b=!0)},p(M,k){(!c||k[0]&128)&&pt(u,M[7])},i(M){c||(re(t.$$.fragment,M),re(m.$$.fragment,M),c=!0)},o(M){fe(t.$$.fragment,M),fe(m.$$.fragment,M),c=!1},d(M){M&&ee(e),je(t),je(m),b=!1,S()}}}function Hi(i,e){var s;let t,n,r;function u(){return e[81](e[99])}function a(){return e[82](e[97])}return n=new mr({props:{feature:e[97],showPlaceType:e[11],style:e[15]===e[99]?"selected":((s=e[14])==null?void 0:s.id)===e[97].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",a),{key:i,first:null,c(){t=Un(),Je(n.$$.fragment),this.first=t},m(m,c){ie(m,t,c),Ve(n,m,c),r=!0},p(m,c){var S;e=m;const b={};c[0]&8192&&(b.feature=e[97]),c[0]&2048&&(b.showPlaceType=e[11]),c[0]&57344&&(b.style=e[15]===e[99]?"selected":((S=e[14])==null?void 0:S.id)===e[97].id?"picked":"default"),c[0]&4096&&(b.iconsBaseUrl=e[12]),n.$set(b)},i(m){r||(re(n.$$.fragment,m),r=!0)},o(m){fe(n.$$.fragment,m),r=!1},d(m){m&&ee(t),je(n,m)}}}function Fr(i){let e,t,n,r,u,a,s,m,c,b,S,M,k,N,C,P,I,_,W,z=!1;u=new Er({});let D=!i[20]&&qi(i),U=i[20]&&Vi(),A=i[6]==="button"&&ji(i);const o=i[70].default,l=Wn(o,i,i[69],null),f=[Wr,Br,Gr,Ar],g=[];function h(d,v){var y,p;return d[19]?0:!d[16]&&!d[4]?1:((y=d[13])==null?void 0:y.length)===0?2:(p=d[13])!=null&&p.length&&(d[16]||d[4])?3:-1}return~(N=h(i))&&(C=g[N]=f[N](i)),{c(){e=Ee(),t=Y("form"),n=Y("div"),r=Y("button"),Je(u.$$.fragment),a=Ee(),s=Y("input"),m=Ee(),c=Y("div"),D&&D.c(),b=Ee(),U&&U.c(),S=Ee(),A&&A.c(),M=Ee(),l&&l.c(),k=Ee(),C&&C.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(s,"placeholder",i[9]),x(s,"aria-label",i[9]),x(s,"class","svelte-bz0zu3"),x(c,"class","clear-button-container svelte-bz0zu3"),ct(c,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",P=Rt(i[2])+" svelte-bz0zu3"),ct(t,"can-collapse",i[5]&&i[1]==="")},m(d,v){ie(d,e,v),ie(d,t,v),Z(t,n),Z(n,r),Ve(u,r,null),Z(n,a),Z(n,s),i[72](s),xi(s,i[1]),Z(n,m),Z(n,c),D&&D.m(c,null),Z(c,b),U&&U.m(c,null),Z(n,S),A&&A.m(n,null),Z(n,M),l&&l.m(n,null),Z(t,k),~N&&g[N].m(t,null),I=!0,_||(W=[ge(r,"click",i[71]),ge(s,"input",i[73]),ge(s,"focus",i[74]),ge(s,"blur",i[75]),ge(s,"click",i[76]),ge(s,"keydown",i[23]),ge(s,"input",i[24]),ge(s,"change",i[77]),ge(t,"submit",qn(i[22]))],_=!0)},p(d,v){(!I||v[0]&512)&&x(s,"placeholder",d[9]),(!I||v[0]&512)&&x(s,"aria-label",d[9]),v[0]&2&&s.value!==d[1]&&xi(s,d[1]),d[20]?D&&(wt(),fe(D,1,1,()=>{D=null}),Et()):D?(D.p(d,v),v[0]&1048576&&re(D,1)):(D=qi(d),D.c(),re(D,1),D.m(c,b)),d[20]?U?v[0]&1048576&&re(U,1):(U=Vi(),U.c(),re(U,1),U.m(c,null)):U&&(wt(),fe(U,1,1,()=>{U=null}),Et()),(!I||v[0]&2)&&ct(c,"displayable",d[1]!==""),d[6]==="button"?A?(A.p(d,v),v[0]&64&&re(A,1)):(A=ji(d),A.c(),re(A,1),A.m(n,M)):A&&(wt(),fe(A,1,1,()=>{A=null}),Et()),l&&l.p&&(!I||v[2]&128)&&zn(l,o,d,d[69],I?Fn(o,d[69],v,null):Dn(d[69]),null);let y=N;N=h(d),N===y?~N&&g[N].p(d,v):(C&&(wt(),fe(g[y],1,1,()=>{g[y]=null}),Et()),~N?(C=g[N],C?C.p(d,v):(C=g[N]=f[N](d),C.c()),re(C,1),C.m(t,null)):C=null),(!I||v[0]&4&&P!==(P=Rt(d[2])+" svelte-bz0zu3"))&&x(t,"class",P),(!I||v[0]&38)&&ct(t,"can-collapse",d[5]&&d[1]==="")},i(d){I||(re(z),re(u.$$.fragment,d),re(D),re(U),re(A),re(l,d),re(C),I=!0)},o(d){fe(z),fe(u.$$.fragment,d),fe(D),fe(U),fe(A),fe(l,d),fe(C),I=!1},d(d){d&&(ee(e),ee(t)),je(u),i[72](null),D&&D.d(),U&&U.d(),A&&A.d(),l&&l.d(d),~N&&g[N].d(),_=!1,Ue(W)}}}function zr(i,e,t){let n,r,u,{$$slots:a={},$$scope:s}=e;const m={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:c=void 0}=e,{apiKey:b=void 0}=e,{bbox:S=void 0}=e,{clearButtonTitle:M="clear"}=e,{clearOnBlur:k=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:C=!1}=e,{collapsed:P=!1}=e,{country:I=void 0}=e,{debounceSearch:_=200}=e,{enableReverse:W="never"}=e,{errorMessage:z="Something went wrong…"}=e,{filter:D=()=>!0}=e,{flyTo:U=!0}=e,{fuzzyMatch:A=!0}=e,{language:o=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:g=f}=e,{mapController:h=void 0}=e,{minLength:d=2}=e,{noResultsMessage:v="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:y="Search"}=e,{proximity:p=[{type:"server-geolocation"}]}=e,{reverseActive:w=W==="always"}=e,{reverseButtonTitle:E="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:R="full-geometry"}=e,{showPlaceType:G="if-needed"}=e,{showResultsWhileTyping:H=!0}=e,{selectFirst:Q=!0}=e,{flyToSelected:se=!1}=e,{markerOnSelected:j=!0}=e,{types:K=void 0}=e;const me=[];let{reverseGeocodingTypes:Ke=me}=e,{exhaustiveReverseGeocoding:ut=!1}=e,{excludeTypes:at=!1}=e;const Se=void 0;let{reverseGeocodingExcludeTypes:We=Se}=e,{zoom:pe=m}=e,{apiUrl:ye="https://api.maptiler.com/geocoding"}=e,{fetchParameters:te={}}=e,{iconsBaseUrl:En="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.7/icons/"}=e,{adjustUrlQuery:ui=()=>{}}=e,{adjustUrl:ai=()=>{}}=e;function ps(L){Ae.focus(L)}function vs(){Ae.blur()}function Ln(L,ue=!0,ae=!1){t(1,T=L),ue?(t(15,X=-1),_n()):(xn(void 0,!ae,ae),setTimeout(()=>{Ae.focus(),Ae.select()}))}function bs(){t(13,V=void 0),t(14,B=void 0),t(15,X=-1)}function ws(){t(64,he=[]),t(14,B=void 0)}let V,he,B,Sn="",Ae,X=-1,Fe,jt=[],ft,mt,yt,fi,Ye=!1;const Es=new Set,et=Mi();Hn(()=>{h&&(h.setEventHandler(void 0),h.indicateReverse(!1),h.setSelectedMarker(-1),h.setFeatures(void 0,void 0,!1))});function _n(L){if(t(17,Ye=!1),mt&&(clearTimeout(mt),mt=void 0),X>-1&&V)t(14,B=V[X]),t(1,T=B.place_type[0]==="reverse"?B.place_name:B.place_name.replace(/,.*/,"")),t(19,Fe=void 0),t(64,he=void 0),t(15,X=-1);else if(T){const ue=L||!ci(T);hi(T,{exact:!0}).then(()=>{t(64,he=V),t(14,B=void 0),ue&&Ls()}).catch(ae=>t(19,Fe=ae))}}function ci(L){try{return Ir(L,6)}catch{return!1}}async function hi(L,{byId:ue=!1,exact:ae=!1}={}){var xe,ze,tt;t(19,Fe=void 0),ft==null||ft.abort();const _e=new AbortController;t(20,ft=_e);try{const J=ci(L),Nt=new URL(ye+"/"+encodeURIComponent(J?J.decimalLongitude+","+J.decimalLatitude:L)+".json"),Pe=Nt.searchParams;o!==void 0&&Pe.set("language",Array.isArray(o)?o.join(","):o??"");const[mi]=(h==null?void 0:h.getCenterAndZoom())??[];let De=(xe=!J||Ke===me?K:Ke)==null?void 0:xe.map(be=>typeof be=="string"?be:mi===void 0||(be[0]??0)<=mi&&mi<(be[1]??1/0)?be[2]:void 0).filter(be=>be!==void 0);De&&(De=[...new Set(De)],Pe.set("types",De.join(",")));const Mn=!J||We===Se?at:We;if(Mn&&Pe.set("excludeTypes",String(Mn)),S&&Pe.set("bbox",S.map(be=>be.toFixed(6)).join(",")),I&&Pe.set("country",Array.isArray(I)?I.join(","):I),!ue&&!J){const be=await Sr(h,p,_e);be&&Pe.set("proximity",be),(ae||!H)&&Pe.set("autocomplete","false"),Pe.set("fuzzyMatch",String(A))}const Ct=g===f?l:g;Ct!==void 0&&Ct>1&&(De==null?void 0:De.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),J?(Ct===1||Ct!==void 0&&(ut||(De==null?void 0:De.length)===1))&&Pe.set("limit",String(Ct)):l!==void 0&&Pe.set("limit",String(l)),b&&Pe.set("key",b),ui(Pe),ai(Nt);const Fs=Nt.searchParams.get("types")===""&&Nt.searchParams.get("excludeTypes")!=="true",Ht=Nt.toString();if(Ht===Sn){ue?(N&&t(13,V=void 0),t(14,B=jt[0])):(t(13,V=jt),((ze=V[X])==null?void 0:ze.id)!==(r==null?void 0:r.id)&&t(15,X=-1));return}Sn=Ht;let kt;if(Fs)kt={type:"FeatureCollection",features:[]};else{const be=await fetch(Ht,{signal:_e.signal,...te});if(!be.ok)throw new Error(await be.text());kt=await be.json()}et("response",{url:Ht,featureCollection:kt}),ue?(N&&t(13,V=void 0),t(14,B=kt.features[0]),jt=[B]):(t(13,V=kt.features.filter(D)),J&&V.unshift({type:"Feature",properties:{},id:"reverse_"+J.decimalLongitude+"_"+J.decimalLatitude,text:J.decimalLatitude+", "+J.decimalLongitude,place_name:J.decimalLatitude+", "+J.decimalLongitude,place_type:["reverse"],center:[J.decimalLongitude,J.decimalLatitude],bbox:[J.decimalLongitude,J.decimalLatitude,J.decimalLongitude,J.decimalLatitude],geometry:{type:"Point",coordinates:[J.decimalLongitude,J.decimalLatitude]}}),jt=V,((tt=V[X])==null?void 0:tt.id)!==(r==null?void 0:r.id)&&t(15,X=-1),J&&Ae.focus())}catch(J){if(J&&typeof J=="object"&&"name"in J&&J.name==="AbortError")return;throw J}finally{_e===ft&&t(20,ft=void 0)}}function Ls(){var _e;if(!(he!=null&&he.length)||!U)return;const L=[180,90,-180,-90],ue=!he.some(xe=>!xe.matching_text);let ae;for(const xe of he){const ze=Mt(xe);if(ae=ae===void 0?ze:ze===void 0?ae:Math.max(ae,ze),ue||!xe.matching_text)for(const tt of[0,1,2,3])L[tt]=Math[tt<2?"min":"max"](L[tt],((_e=xe.bbox)==null?void 0:_e[tt])??xe.center[tt%2])}h&&he.length>0&&(B&&L[0]===L[2]&&L[1]===L[3]?h.flyTo(B.center,Mt(B)):h.fitBounds(Gt(L),50,ae))}function di(){!B||!h||(!B.bbox||B.bbox[0]===B.bbox[2]&&B.bbox[1]===B.bbox[3]?h.flyTo(B.center,Mt(B)):h.fitBounds(Gt(B.bbox),50,Mt(B)))}function Mt(L){var ae;if(!L.bbox||L.bbox[0]!==L.bbox[2]&&L.bbox[1]!==L.bbox[3])return;const ue=L.id.replace(/\..*/,"");return(Array.isArray((ae=L.properties)==null?void 0:ae.categories)?L.properties.categories.reduce((_e,xe)=>{const ze=pe[ue+"."+xe];return _e===void 0?ze:ze===void 0?_e:Math.max(_e,ze)},void 0):void 0)??pe[ue]}function Ss(L){t(0,w=W==="always"),t(13,V=void 0),t(14,B=void 0),t(15,X=-1),Ln(L[1].toFixed(6)+", "+Lr(L[0],[-180,180],!0).toFixed(6),!1,!0)}function _s(L){if(!V)return;let ue=L.key==="ArrowDown"?1:L.key==="ArrowUp"?-1:0;ue&&(Ae.focus(),t(17,Ye=!0),L.preventDefault(),B&&X===-1&&t(15,X=V.findIndex(ae=>ae.id===(B==null?void 0:B.id))),X===(B||Q?0:-1)&&ue===-1&&t(15,X=V.length),t(15,X+=ue),X>=V.length&&t(15,X=-1),X<0&&(B||Q)&&t(15,X=0))}function xn(L,ue=!0,ae=!1){if(t(19,Fe=void 0),t(14,B=void 0),t(17,Ye=!0),H||ae){if(mt&&clearTimeout(mt),T.length<d)return;const _e=T;mt=window.setTimeout(()=>{hi(_e).catch(xe=>t(19,Fe=xe))},ue?_:0)}else t(13,V=void 0),t(19,Fe=void 0)}function gi(L){B&&(B==null?void 0:B.id)===(L==null?void 0:L.id)?di():(t(14,B=L),t(1,T=L.place_name))}function Tn(L){t(15,X=L)}function xs(){(!Q||B)&&t(15,X=-1),se&&di()}const Ts=()=>Ae.focus();function Ms(L){Kt[L?"unshift":"push"](()=>{Ae=L,t(18,Ae)})}function Ns(){T=this.value,t(1,T),t(17,Ye),t(31,k),t(16,yt)}const Cs=()=>t(17,Ye=!0),ks=()=>t(17,Ye=!1),Os=()=>t(17,Ye=!0),Ps=()=>t(14,B=void 0),Rs=()=>{t(1,T=""),t(14,B=void 0),Ae.focus()},Is=()=>t(0,w=!w),As=()=>t(19,Fe=void 0),Gs=L=>Tn(L),Bs=L=>gi(L),Ws=()=>{};return i.$$set=L=>{"class"in L&&t(2,c=L.class),"apiKey"in L&&t(29,b=L.apiKey),"bbox"in L&&t(30,S=L.bbox),"clearButtonTitle"in L&&t(3,M=L.clearButtonTitle),"clearOnBlur"in L&&t(31,k=L.clearOnBlur),"clearListOnPick"in L&&t(32,N=L.clearListOnPick),"keepListOpen"in L&&t(4,C=L.keepListOpen),"collapsed"in L&&t(5,P=L.collapsed),"country"in L&&t(33,I=L.country),"debounceSearch"in L&&t(34,_=L.debounceSearch),"enableReverse"in L&&t(6,W=L.enableReverse),"errorMessage"in L&&t(7,z=L.errorMessage),"filter"in L&&t(35,D=L.filter),"flyTo"in L&&t(36,U=L.flyTo),"fuzzyMatch"in L&&t(37,A=L.fuzzyMatch),"language"in L&&t(38,o=L.language),"limit"in L&&t(39,l=L.limit),"reverseGeocodingLimit"in L&&t(40,g=L.reverseGeocodingLimit),"mapController"in L&&t(41,h=L.mapController),"minLength"in L&&t(42,d=L.minLength),"noResultsMessage"in L&&t(8,v=L.noResultsMessage),"placeholder"in L&&t(9,y=L.placeholder),"proximity"in L&&t(43,p=L.proximity),"reverseActive"in L&&t(0,w=L.reverseActive),"reverseButtonTitle"in L&&t(10,E=L.reverseButtonTitle),"searchValue"in L&&t(1,T=L.searchValue),"pickedResultStyle"in L&&t(44,R=L.pickedResultStyle),"showPlaceType"in L&&t(11,G=L.showPlaceType),"showResultsWhileTyping"in L&&t(45,H=L.showResultsWhileTyping),"selectFirst"in L&&t(46,Q=L.selectFirst),"flyToSelected"in L&&t(47,se=L.flyToSelected),"markerOnSelected"in L&&t(48,j=L.markerOnSelected),"types"in L&&t(49,K=L.types),"reverseGeocodingTypes"in L&&t(50,Ke=L.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in L&&t(51,ut=L.exhaustiveReverseGeocoding),"excludeTypes"in L&&t(52,at=L.excludeTypes),"reverseGeocodingExcludeTypes"in L&&t(53,We=L.reverseGeocodingExcludeTypes),"zoom"in L&&t(54,pe=L.zoom),"apiUrl"in L&&t(55,ye=L.apiUrl),"fetchParameters"in L&&t(56,te=L.fetchParameters),"iconsBaseUrl"in L&&t(12,En=L.iconsBaseUrl),"adjustUrlQuery"in L&&t(57,ui=L.adjustUrlQuery),"adjustUrl"in L&&t(58,ai=L.adjustUrl),"$$scope"in L&&t(69,s=L.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=W==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&R!=="marker-only"&&B&&!B.address&&B.geometry.type==="Point"&&B.place_type[0]!=="reverse"&&hi(B.id,{byId:!0}).catch(L=>t(19,Fe=L)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&8&&(h&&B&&B.id!==fi&&U&&(di(),N&&t(13,V=void 0),t(64,he=void 0),t(15,X=-1)),t(65,fi=B==null?void 0:B.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,yt=Ye),k&&!yt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<d&&(t(13,V=void 0),t(19,Fe=void 0),t(64,he=V)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&Q&&V!=null&&V.length&&X==-1&&!B&&t(15,X=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&4&&he!==V&&t(64,he=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&h&&h.setEventHandler(L=>{switch(L.type){case"mapClick":w&&Ss(L.coordinates);break;case"markerClick":{const ue=V==null?void 0:V.find(ae=>ae.id===L.id);ue&&gi(ue)}break;case"markerMouseEnter":he&&t(15,X=yt?(V==null?void 0:V.findIndex(ue=>ue.id===L.id))??-1:-1);break;case"markerMouseLeave":he&&t(15,X=-1);break}}),i.$$.dirty[0]&40960&&t(66,r=V==null?void 0:V[X]),i.$$.dirty[1]&66592|i.$$.dirty[2]&16&&h&&r&&U&&se&&h.flyTo(r.center,Mt(r)),i.$$.dirty[1]&8192&&t(68,n=R==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&132096|i.$$.dirty[2]&64&&(j||h==null||h.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&132096|i.$$.dirty[2]&84&&h&&j&&!he&&(h.setFeatures(r?[r]:void 0,B,n),h.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&68&&h&&h.setFeatures(he,B,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&he&&h&&h.setSelectedMarker(X),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&h){const L=ci(T);h.setReverseMarker(L?[L.decimalLongitude,L.decimalLatitude]:void 0)}i.$$.dirty[2]&16&&et("select",{feature:r}),i.$$.dirty[0]&16384&&et("pick",{feature:B}),i.$$.dirty[0]&73744&&t(67,u=!!(V!=null&&V.length)&&(yt||C)),i.$$.dirty[2]&32&&et("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&et("featureslisted",{features:V}),i.$$.dirty[2]&4&&et("featuresmarked",{features:he}),i.$$.dirty[0]&1&&et("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&et("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&h&&h.indicateReverse(w)},[w,T,c,M,C,P,W,z,v,y,E,G,En,V,B,X,yt,Ye,Ae,Fe,ft,Es,_n,_s,xn,gi,Tn,xs,m,b,S,k,N,I,_,D,U,A,o,l,g,h,d,p,R,H,Q,se,j,K,Ke,ut,at,We,pe,ye,te,ui,ai,ps,vs,Ln,bs,ws,he,fi,r,u,n,s,a,Ts,Ms,Ns,Cs,ks,Os,Ps,Rs,Is,As,Gs,Bs,Ws]}let Dr=class extends st{constructor(e){super(),rt(this,e,zr,Fr,it,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,selectFirst:46,flyToSelected:47,markerOnSelected:48,types:49,reverseGeocodingTypes:50,exhaustiveReverseGeocoding:51,excludeTypes:52,reverseGeocodingExcludeTypes:53,zoom:54,apiUrl:55,fetchParameters:56,iconsBaseUrl:12,adjustUrlQuery:57,adjustUrl:58,focus:59,blur:60,setQuery:61,clearList:62,clearMap:63},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[59]}get blur(){return this.$$.ctx[60]}get setQuery(){return this.$$.ctx[61]}get clearList(){return this.$$.ctx[62]}get clearMap(){return this.$$.ctx[63]}};function Bt(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function ei(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;u<r[r.length-1].length;u++)if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.")}return Bt({type:"Polygon",coordinates:i},e,t)}function ti(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Zi(i,e,t={}){return Bt({type:"MultiPolygon",coordinates:i},e,t)}function Ki(i,e,t){if(i!==null)for(var n,r,u,a,s,m,c,b=0,S=0,M,k=i.type,N=k==="FeatureCollection",C=k==="Feature",P=N?i.features.length:1,I=0;I<P;I++){c=N?i.features[I].geometry:C?i.geometry:i,M=c?c.type==="GeometryCollection":!1,s=M?c.geometries.length:1;for(var _=0;_<s;_++){var W=0,z=0;if(a=M?c.geometries[_]:c,a!==null){m=a.coordinates;var D=a.type;switch(b=0,D){case null:break;case"Point":if(e(m,S,I,W,z)===!1)return!1;S++,W++;break;case"LineString":case"MultiPoint":for(n=0;n<m.length;n++){if(e(m[n],S,I,W,z)===!1)return!1;S++,D==="MultiPoint"&&W++}D==="LineString"&&W++;break;case"Polygon":case"MultiLineString":for(n=0;n<m.length;n++){for(r=0;r<m[n].length-b;r++){if(e(m[n][r],S,I,W,z)===!1)return!1;S++}D==="MultiLineString"&&W++,D==="Polygon"&&z++}D==="Polygon"&&W++;break;case"MultiPolygon":for(n=0;n<m.length;n++){for(z=0,r=0;r<m[n].length;r++){for(u=0;u<m[n][r].length-b;u++){if(e(m[n][r][u],S,I,W,z)===!1)return!1;S++}z++}W++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Ki(a.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ii(i,e){var t,n,r,u,a,s,m,c,b,S,M=0,k=i.type==="FeatureCollection",N=i.type==="Feature",C=k?i.features.length:1;for(t=0;t<C;t++){for(s=k?i.features[t].geometry:N?i.geometry:i,c=k?i.features[t].properties:N?i.properties:{},b=k?i.features[t].bbox:N?i.bbox:void 0,S=k?i.features[t].id:N?i.id:void 0,m=s?s.type==="GeometryCollection":!1,a=m?s.geometries.length:1,r=0;r<a;r++){if(u=m?s.geometries[r]:s,u===null){if(e(null,M,c,b,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,M,c,b,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],M,c,b,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Ur(i,e){ii(i,function(t,n,r,u,a){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Bt(t,r,{bbox:u,id:a}),n,0)===!1?!1:void 0}var m;switch(s){case"MultiPoint":m="Point";break;case"MultiLineString":m="LineString";break;case"MultiPolygon":m="Polygon";break}for(var c=0;c<t.coordinates.length;c++){var b=t.coordinates[c],S={type:m,coordinates:b};if(e(Bt(S,r),n,c)===!1)return!1}})}function qr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ki(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var Yi=qr,Vr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ni=Math.ceil,Ce=Math.floor,we="[BigNumber Error] ",Qi=we+"Number primitive has more than 15 significant digits: ",Ie=1e14,q=14,Xi=9007199254740991,ri=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],$e=1e7,Le=1e9;function Ji(i){var e,t,n,r=_.prototype={constructor:_,toString:null,valueOf:null},u=new _(1),a=20,s=4,m=-7,c=21,b=-1e7,S=1e7,M=!1,k=1,N=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},P="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function _(o,l){var f,g,h,d,v,y,p,w,E=this;if(!(E instanceof _))return new _(o,l);if(l==null){if(o&&o._isBigNumber===!0){E.s=o.s,!o.c||o.e>S?E.c=E.e=null:o.e<b?E.c=[E.e=0]:(E.e=o.e,E.c=o.c.slice());return}if((y=typeof o=="number")&&o*0==0){if(E.s=1/o<0?(o=-o,-1):1,o===~~o){for(d=0,v=o;v>=10;v/=10,d++);d>S?E.c=E.e=null:(E.e=d,E.c=[o]);return}w=String(o)}else{if(!Vr.test(w=String(o)))return n(E,w,y);E.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(d=w.indexOf("."))>-1&&(w=w.replace(".","")),(v=w.search(/e/i))>0?(d<0&&(d=v),d+=+w.slice(v+1),w=w.substring(0,v)):d<0&&(d=w.length)}else{if(le(l,2,P.length,"Base"),l==10&&I)return E=new _(o),U(E,a+E.e+1,s);if(w=String(o),y=typeof o=="number"){if(o*0!=0)return n(E,w,y,l);if(E.s=1/o<0?(w=w.slice(1),-1):1,_.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Qi+o)}else E.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=P.slice(0,l),d=v=0,p=w.length;v<p;v++)if(f.indexOf(g=w.charAt(v))<0){if(g=="."){if(v>d){d=p;continue}}else if(!h&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){h=!0,v=-1,d=0;continue}return n(E,String(o),y,l)}y=!1,w=t(w,l,10,E.s),(d=w.indexOf("."))>-1?w=w.replace(".",""):d=w.length}for(v=0;w.charCodeAt(v)===48;v++);for(p=w.length;w.charCodeAt(--p)===48;);if(w=w.slice(v,++p)){if(p-=v,y&&_.DEBUG&&p>15&&(o>Xi||o!==Ce(o)))throw Error(Qi+E.s*o);if((d=d-v-1)>S)E.c=E.e=null;else if(d<b)E.c=[E.e=0];else{if(E.e=d,E.c=[],v=(d+1)%q,d<0&&(v+=q),v<p){for(v&&E.c.push(+w.slice(0,v)),p-=q;v<p;)E.c.push(+w.slice(v,v+=q));v=q-(w=w.slice(v)).length}else v-=p;for(;v--;w+="0");E.c.push(+w)}}else E.c=[E.e=0]}_.clone=Ji,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(o){var l,f;if(o!=null)if(typeof o=="object"){if(o.hasOwnProperty(l="DECIMAL_PLACES")&&(f=o[l],le(f,0,Le,l),a=f),o.hasOwnProperty(l="ROUNDING_MODE")&&(f=o[l],le(f,0,8,l),s=f),o.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=o[l],f&&f.pop?(le(f[0],-1e9,0,l),le(f[1],0,Le,l),m=f[0],c=f[1]):(le(f,-1e9,Le,l),m=-(c=f<0?-f:f))),o.hasOwnProperty(l="RANGE"))if(f=o[l],f&&f.pop)le(f[0],-1e9,-1,l),le(f[1],1,Le,l),b=f[0],S=f[1];else if(le(f,-1e9,Le,l),f)b=-(S=f<0?-f:f);else throw Error(we+l+" cannot be zero: "+f);if(o.hasOwnProperty(l="CRYPTO"))if(f=o[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))M=f;else throw M=!f,Error(we+"crypto unavailable");else M=f;else throw Error(we+l+" not true or false: "+f);if(o.hasOwnProperty(l="MODULO_MODE")&&(f=o[l],le(f,0,9,l),k=f),o.hasOwnProperty(l="POW_PRECISION")&&(f=o[l],le(f,0,Le,l),N=f),o.hasOwnProperty(l="FORMAT"))if(f=o[l],typeof f=="object")C=f;else throw Error(we+l+" not an object: "+f);if(o.hasOwnProperty(l="ALPHABET"))if(f=o[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))I=f.slice(0,10)=="0123456789",P=f;else throw Error(we+l+" invalid: "+f)}else throw Error(we+"Object expected: "+o);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[m,c],RANGE:[b,S],CRYPTO:M,MODULO_MODE:k,POW_PRECISION:N,FORMAT:C,ALPHABET:P}},_.isBigNumber=function(o){if(!o||o._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var l,f,g=o.c,h=o.e,d=o.s;e:if({}.toString.call(g)=="[object Array]"){if((d===1||d===-1)&&h>=-1e9&&h<=Le&&h===Ce(h)){if(g[0]===0){if(h===0&&g.length===1)return!0;break e}if(l=(h+1)%q,l<1&&(l+=q),String(g[0]).length==l){for(l=0;l<g.length;l++)if(f=g[l],f<0||f>=Ie||f!==Ce(f))break e;if(f!==0)return!0}}}else if(g===null&&h===null&&(d===null||d===1||d===-1))return!0;throw Error(we+"Invalid BigNumber: "+o)},_.maximum=_.max=function(){return z(arguments,-1)},_.minimum=_.min=function(){return z(arguments,1)},_.random=function(){var o=9007199254740992,l=Math.random()*o&2097151?function(){return Ce(Math.random()*o)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var g,h,d,v,y,p=0,w=[],E=new _(u);if(f==null?f=a:le(f,0,Le),v=ni(f/q),M)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(v*=2));p<v;)y=g[p]*131072+(g[p+1]>>>11),y>=9e15?(h=crypto.getRandomValues(new Uint32Array(2)),g[p]=h[0],g[p+1]=h[1]):(w.push(y%1e14),p+=2);p=v/2}else if(crypto.randomBytes){for(g=crypto.randomBytes(v*=7);p<v;)y=(g[p]&31)*281474976710656+g[p+1]*1099511627776+g[p+2]*4294967296+g[p+3]*16777216+(g[p+4]<<16)+(g[p+5]<<8)+g[p+6],y>=9e15?crypto.randomBytes(7).copy(g,p):(w.push(y%1e14),p+=7);p=v/7}else throw M=!1,Error(we+"crypto unavailable");if(!M)for(;p<v;)y=l(),y<9e15&&(w[p++]=y%1e14);for(v=w[--p],f%=q,v&&f&&(y=ri[q-f],w[p]=Ce(v/y)*y);w[p]===0;w.pop(),p--);if(p<0)w=[d=0];else{for(d=-1;w[0]===0;w.splice(0,1),d-=q);for(p=1,y=w[0];y>=10;y/=10,p++);p<q&&(d-=q-p)}return E.e=d,E.c=w,E}}(),_.sum=function(){for(var o=1,l=arguments,f=new _(l[0]);o<l.length;)f=f.plus(l[o++]);return f},t=function(){var o="0123456789";function l(f,g,h,d){for(var v,y=[0],p,w=0,E=f.length;w<E;){for(p=y.length;p--;y[p]*=g);for(y[0]+=d.indexOf(f.charAt(w++)),v=0;v<y.length;v++)y[v]>h-1&&(y[v+1]==null&&(y[v+1]=0),y[v+1]+=y[v]/h|0,y[v]%=h)}return y.reverse()}return function(f,g,h,d,v){var y,p,w,E,T,R,G,H,Q=f.indexOf("."),se=a,j=s;for(Q>=0&&(E=N,N=0,f=f.replace(".",""),H=new _(g),R=H.pow(f.length-Q),N=E,H.c=l(He(Oe(R.c),R.e,"0"),10,h,o),H.e=H.c.length),G=l(f,g,h,v?(y=P,o):(y=o,P)),w=E=G.length;G[--E]==0;G.pop());if(!G[0])return y.charAt(0);if(Q<0?--w:(R.c=G,R.e=w,R.s=d,R=e(R,H,se,j,h),G=R.c,T=R.r,w=R.e),p=w+se+1,Q=G[p],E=h/2,T=T||p<0||G[p+1]!=null,T=j<4?(Q!=null||T)&&(j==0||j==(R.s<0?3:2)):Q>E||Q==E&&(j==4||T||j==6&&G[p-1]&1||j==(R.s<0?8:7)),p<1||!G[0])f=T?He(y.charAt(1),-se,y.charAt(0)):y.charAt(0);else{if(G.length=p,T)for(--h;++G[--p]>h;)G[p]=0,p||(++w,G=[1].concat(G));for(E=G.length;!G[--E];);for(Q=0,f="";Q<=E;f+=y.charAt(G[Q++]));f=He(f,w,y.charAt(0))}return f}}(),e=function(){function o(g,h,d){var v,y,p,w,E=0,T=g.length,R=h%$e,G=h/$e|0;for(g=g.slice();T--;)p=g[T]%$e,w=g[T]/$e|0,v=G*p+w*R,y=R*p+v%$e*$e+E,E=(y/d|0)+(v/$e|0)+G*w,g[T]=y%d;return E&&(g=[E].concat(g)),g}function l(g,h,d,v){var y,p;if(d!=v)p=d>v?1:-1;else for(y=p=0;y<d;y++)if(g[y]!=h[y]){p=g[y]>h[y]?1:-1;break}return p}function f(g,h,d,v){for(var y=0;d--;)g[d]-=y,y=g[d]<h[d]?1:0,g[d]=y*v+g[d]-h[d];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,h,d,v,y){var p,w,E,T,R,G,H,Q,se,j,K,me,Ke,ut,at,Se,We,pe=g.s==h.s?1:-1,ye=g.c,te=h.c;if(!ye||!ye[0]||!te||!te[0])return new _(!g.s||!h.s||(ye?te&&ye[0]==te[0]:!te)?NaN:ye&&ye[0]==0||!te?pe*0:pe/0);for(Q=new _(pe),se=Q.c=[],w=g.e-h.e,pe=d+w+1,y||(y=Ie,w=ke(g.e/q)-ke(h.e/q),pe=pe/q|0),E=0;te[E]==(ye[E]||0);E++);if(te[E]>(ye[E]||0)&&w--,pe<0)se.push(1),T=!0;else{for(ut=ye.length,Se=te.length,E=0,pe+=2,R=Ce(y/(te[0]+1)),R>1&&(te=o(te,R,y),ye=o(ye,R,y),Se=te.length,ut=ye.length),Ke=Se,j=ye.slice(0,Se),K=j.length;K<Se;j[K++]=0);We=te.slice(),We=[0].concat(We),at=te[0],te[1]>=y/2&&at++;do{if(R=0,p=l(te,j,Se,K),p<0){if(me=j[0],Se!=K&&(me=me*y+(j[1]||0)),R=Ce(me/at),R>1)for(R>=y&&(R=y-1),G=o(te,R,y),H=G.length,K=j.length;l(G,j,H,K)==1;)R--,f(G,Se<H?We:te,H,y),H=G.length,p=1;else R==0&&(p=R=1),G=te.slice(),H=G.length;if(H<K&&(G=[0].concat(G)),f(j,G,K,y),K=j.length,p==-1)for(;l(te,j,Se,K)<1;)R++,f(j,Se<K?We:te,K,y),K=j.length}else p===0&&(R++,j=[0]);se[E++]=R,j[0]?j[K++]=ye[Ke]||0:(j=[ye[Ke]],K=1)}while((Ke++<ut||j[0]!=null)&&pe--);T=j[0]!=null,se[0]||se.splice(0,1)}if(y==Ie){for(E=1,pe=se[0];pe>=10;pe/=10,E++);U(Q,d+(Q.e=E+w*q-1)+1,v,T)}else Q.e=w,Q.r=+T;return Q}}();function W(o,l,f,g){var h,d,v,y,p;if(f==null?f=s:le(f,0,8),!o.c)return o.toString();if(h=o.c[0],v=o.e,l==null)p=Oe(o.c),p=g==1||g==2&&(v<=m||v>=c)?Ft(p,v):He(p,v,"0");else if(o=U(new _(o),l,f),d=o.e,p=Oe(o.c),y=p.length,g==1||g==2&&(l<=d||d<=m)){for(;y<l;p+="0",y++);p=Ft(p,d)}else if(l-=v,p=He(p,d,"0"),d+1>y){if(--l>0)for(p+=".";l--;p+="0");}else if(l+=d-y,l>0)for(d+1==y&&(p+=".");l--;p+="0");return o.s<0&&h?"-"+p:p}function z(o,l){for(var f,g,h=1,d=new _(o[0]);h<o.length;h++)g=new _(o[h]),(!g.s||(f=ot(d,g))===l||f===0&&d.s===l)&&(d=g);return d}function D(o,l,f){for(var g=1,h=l.length;!l[--h];l.pop());for(h=l[0];h>=10;h/=10,g++);return(f=g+f*q-1)>S?o.c=o.e=null:f<b?o.c=[o.e=0]:(o.e=f,o.c=l),o}n=function(){var o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(d,v,y,p){var w,E=y?v:v.replace(h,"");if(g.test(E))d.s=isNaN(E)?null:E<0?-1:1;else{if(!y&&(E=E.replace(o,function(T,R,G){return w=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!p||p==w?R:T}),p&&(w=p,E=E.replace(l,"$1").replace(f,"0.$1")),v!=E))return new _(E,w);if(_.DEBUG)throw Error(we+"Not a"+(p?" base "+p:"")+" number: "+v);d.s=null}d.c=d.e=null}}();function U(o,l,f,g){var h,d,v,y,p,w,E,T=o.c,R=ri;if(T){e:{for(h=1,y=T[0];y>=10;y/=10,h++);if(d=l-h,d<0)d+=q,v=l,p=T[w=0],E=Ce(p/R[h-v-1]%10);else if(w=ni((d+1)/q),w>=T.length)if(g){for(;T.length<=w;T.push(0));p=E=0,h=1,d%=q,v=d-q+1}else break e;else{for(p=y=T[w],h=1;y>=10;y/=10,h++);d%=q,v=d-q+h,E=v<0?0:Ce(p/R[h-v-1]%10)}if(g=g||l<0||T[w+1]!=null||(v<0?p:p%R[h-v-1]),g=f<4?(E||g)&&(f==0||f==(o.s<0?3:2)):E>5||E==5&&(f==4||g||f==6&&(d>0?v>0?p/R[h-v]:0:T[w-1])%10&1||f==(o.s<0?8:7)),l<1||!T[0])return T.length=0,g?(l-=o.e+1,T[0]=R[(q-l%q)%q],o.e=-l||0):T[0]=o.e=0,o;if(d==0?(T.length=w,y=1,w--):(T.length=w+1,y=R[q-d],T[w]=v>0?Ce(p/R[h-v]%R[v])*y:0),g)for(;;)if(w==0){for(d=1,v=T[0];v>=10;v/=10,d++);for(v=T[0]+=y,y=1;v>=10;v/=10,y++);d!=y&&(o.e++,T[0]==Ie&&(T[0]=1));break}else{if(T[w]+=y,T[w]!=Ie)break;T[w--]=0,y=1}for(d=T.length;T[--d]===0;T.pop());}o.e>S?o.c=o.e=null:o.e<b&&(o.c=[o.e=0])}return o}function A(o){var l,f=o.e;return f===null?o.toString():(l=Oe(o.c),l=f<=m||f>=c?Ft(l,f):He(l,f,"0"),o.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var o=new _(this);return o.s<0&&(o.s=1),o},r.comparedTo=function(o,l){return ot(this,new _(o,l))},r.decimalPlaces=r.dp=function(o,l){var f,g,h,d=this;if(o!=null)return le(o,0,Le),l==null?l=s:le(l,0,8),U(new _(d),o+d.e+1,l);if(!(f=d.c))return null;if(g=((h=f.length-1)-ke(this.e/q))*q,h=f[h])for(;h%10==0;h/=10,g--);return g<0&&(g=0),g},r.dividedBy=r.div=function(o,l){return e(this,new _(o,l),a,s)},r.dividedToIntegerBy=r.idiv=function(o,l){return e(this,new _(o,l),0,1)},r.exponentiatedBy=r.pow=function(o,l){var f,g,h,d,v,y,p,w,E,T=this;if(o=new _(o),o.c&&!o.isInteger())throw Error(we+"Exponent not an integer: "+A(o));if(l!=null&&(l=new _(l)),y=o.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!o.c||!o.c[0])return E=new _(Math.pow(+A(T),y?o.s*(2-Wt(o)):+A(o))),l?E.mod(l):E;if(p=o.s<0,l){if(l.c?!l.c[0]:!l.s)return new _(NaN);g=!p&&T.isInteger()&&l.isInteger(),g&&(T=T.mod(l))}else{if(o.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||y&&T.c[1]>=24e7:T.c[0]<8e13||y&&T.c[0]<=9999975e7)))return d=T.s<0&&Wt(o)?-0:0,T.e>-1&&(d=1/d),new _(p?1/d:d);N&&(d=ni(N/q+2))}for(y?(f=new _(.5),p&&(o.s=1),w=Wt(o)):(h=Math.abs(+A(o)),w=h%2),E=new _(u);;){if(w){if(E=E.times(T),!E.c)break;d?E.c.length>d&&(E.c.length=d):g&&(E=E.mod(l))}if(h){if(h=Ce(h/2),h===0)break;w=h%2}else if(o=o.times(f),U(o,o.e+1,1),o.e>14)w=Wt(o);else{if(h=+A(o),h===0)break;w=h%2}T=T.times(T),d?T.c&&T.c.length>d&&(T.c.length=d):g&&(T=T.mod(l))}return g?E:(p&&(E=u.div(E)),l?E.mod(l):d?U(E,N,s,v):E)},r.integerValue=function(o){var l=new _(this);return o==null?o=s:le(o,0,8),U(l,l.e+1,o)},r.isEqualTo=r.eq=function(o,l){return ot(this,new _(o,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(o,l){return ot(this,new _(o,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(o,l){return(l=ot(this,new _(o,l)))===1||l===0},r.isInteger=function(){return!!this.c&&ke(this.e/q)>this.c.length-2},r.isLessThan=r.lt=function(o,l){return ot(this,new _(o,l))<0},r.isLessThanOrEqualTo=r.lte=function(o,l){return(l=ot(this,new _(o,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(o,l){var f,g,h,d,v=this,y=v.s;if(o=new _(o,l),l=o.s,!y||!l)return new _(NaN);if(y!=l)return o.s=-l,v.plus(o);var p=v.e/q,w=o.e/q,E=v.c,T=o.c;if(!p||!w){if(!E||!T)return E?(o.s=-l,o):new _(T?v:NaN);if(!E[0]||!T[0])return T[0]?(o.s=-l,o):new _(E[0]?v:s==3?-0:0)}if(p=ke(p),w=ke(w),E=E.slice(),y=p-w){for((d=y<0)?(y=-y,h=E):(w=p,h=T),h.reverse(),l=y;l--;h.push(0));h.reverse()}else for(g=(d=(y=E.length)<(l=T.length))?y:l,y=l=0;l<g;l++)if(E[l]!=T[l]){d=E[l]<T[l];break}if(d&&(h=E,E=T,T=h,o.s=-o.s),l=(g=T.length)-(f=E.length),l>0)for(;l--;E[f++]=0);for(l=Ie-1;g>y;){if(E[--g]<T[g]){for(f=g;f&&!E[--f];E[f]=l);--E[f],E[g]+=Ie}E[g]-=T[g]}for(;E[0]==0;E.splice(0,1),--w);return E[0]?D(o,E,w):(o.s=s==3?-1:1,o.c=[o.e=0],o)},r.modulo=r.mod=function(o,l){var f,g,h=this;return o=new _(o,l),!h.c||!o.s||o.c&&!o.c[0]?new _(NaN):!o.c||h.c&&!h.c[0]?new _(h):(k==9?(g=o.s,o.s=1,f=e(h,o,0,3),o.s=g,f.s*=g):f=e(h,o,0,k),o=h.minus(f.times(o)),!o.c[0]&&k==1&&(o.s=h.s),o)},r.multipliedBy=r.times=function(o,l){var f,g,h,d,v,y,p,w,E,T,R,G,H,Q,se,j=this,K=j.c,me=(o=new _(o,l)).c;if(!K||!me||!K[0]||!me[0])return!j.s||!o.s||K&&!K[0]&&!me||me&&!me[0]&&!K?o.c=o.e=o.s=null:(o.s*=j.s,!K||!me?o.c=o.e=null:(o.c=[0],o.e=0)),o;for(g=ke(j.e/q)+ke(o.e/q),o.s*=j.s,p=K.length,T=me.length,p<T&&(H=K,K=me,me=H,h=p,p=T,T=h),h=p+T,H=[];h--;H.push(0));for(Q=Ie,se=$e,h=T;--h>=0;){for(f=0,R=me[h]%se,G=me[h]/se|0,v=p,d=h+v;d>h;)w=K[--v]%se,E=K[v]/se|0,y=G*w+E*R,w=R*w+y%se*se+H[d]+f,f=(w/Q|0)+(y/se|0)+G*E,H[d--]=w%Q;H[d]=f}return f?++g:H.splice(0,1),D(o,H,g)},r.negated=function(){var o=new _(this);return o.s=-o.s||null,o},r.plus=function(o,l){var f,g=this,h=g.s;if(o=new _(o,l),l=o.s,!h||!l)return new _(NaN);if(h!=l)return o.s=-l,g.minus(o);var d=g.e/q,v=o.e/q,y=g.c,p=o.c;if(!d||!v){if(!y||!p)return new _(h/0);if(!y[0]||!p[0])return p[0]?o:new _(y[0]?g:h*0)}if(d=ke(d),v=ke(v),y=y.slice(),h=d-v){for(h>0?(v=d,f=p):(h=-h,f=y),f.reverse();h--;f.push(0));f.reverse()}for(h=y.length,l=p.length,h-l<0&&(f=p,p=y,y=f,l=h),h=0;l;)h=(y[--l]=y[l]+p[l]+h)/Ie|0,y[l]=Ie===y[l]?0:y[l]%Ie;return h&&(y=[h].concat(y),++v),D(o,y,v)},r.precision=r.sd=function(o,l){var f,g,h,d=this;if(o!=null&&o!==!!o)return le(o,1,Le),l==null?l=s:le(l,0,8),U(new _(d),o,l);if(!(f=d.c))return null;if(h=f.length-1,g=h*q+1,h=f[h]){for(;h%10==0;h/=10,g--);for(h=f[0];h>=10;h/=10,g++);}return o&&d.e+1>g&&(g=d.e+1),g},r.shiftedBy=function(o){return le(o,-9007199254740991,Xi),this.times("1e"+o)},r.squareRoot=r.sqrt=function(){var o,l,f,g,h,d=this,v=d.c,y=d.s,p=d.e,w=a+4,E=new _("0.5");if(y!==1||!v||!v[0])return new _(!y||y<0&&(!v||v[0])?NaN:v?d:1/0);if(y=Math.sqrt(+A(d)),y==0||y==1/0?(l=Oe(v),(l.length+p)%2==0&&(l+="0"),y=Math.sqrt(+l),p=ke((p+1)/2)-(p<0||p%2),y==1/0?l="5e"+p:(l=y.toExponential(),l=l.slice(0,l.indexOf("e")+1)+p),f=new _(l)):f=new _(y+""),f.c[0]){for(p=f.e,y=p+w,y<3&&(y=0);;)if(h=f,f=E.times(h.plus(e(d,h,w,1))),Oe(h.c).slice(0,y)===(l=Oe(f.c)).slice(0,y))if(f.e<p&&--y,l=l.slice(y-3,y+1),l=="9999"||!g&&l=="4999"){if(!g&&(U(h,h.e+a+2,0),h.times(h).eq(d))){f=h;break}w+=4,y+=4,g=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(U(f,f.e+a+2,1),o=!f.times(f).eq(d));break}}return U(f,f.e+a+1,s,o)},r.toExponential=function(o,l){return o!=null&&(le(o,0,Le),o++),W(this,o,l,1)},r.toFixed=function(o,l){return o!=null&&(le(o,0,Le),o=o+this.e+1),W(this,o,l)},r.toFormat=function(o,l,f){var g,h=this;if(f==null)o!=null&&l&&typeof l=="object"?(f=l,l=null):o&&typeof o=="object"?(f=o,o=l=null):f=C;else if(typeof f!="object")throw Error(we+"Argument not an object: "+f);if(g=h.toFixed(o,l),h.c){var d,v=g.split("."),y=+f.groupSize,p=+f.secondaryGroupSize,w=f.groupSeparator||"",E=v[0],T=v[1],R=h.s<0,G=R?E.slice(1):E,H=G.length;if(p&&(d=y,y=p,p=d,H-=d),y>0&&H>0){for(d=H%y||y,E=G.substr(0,d);d<H;d+=y)E+=w+G.substr(d,y);p>0&&(E+=w+G.slice(d)),R&&(E="-"+E)}g=T?E+(f.decimalSeparator||"")+((p=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+p+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):E}return(f.prefix||"")+g+(f.suffix||"")},r.toFraction=function(o){var l,f,g,h,d,v,y,p,w,E,T,R,G=this,H=G.c;if(o!=null&&(y=new _(o),!y.isInteger()&&(y.c||y.s!==1)||y.lt(u)))throw Error(we+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+A(y));if(!H)return new _(G);for(l=new _(u),w=f=new _(u),g=p=new _(u),R=Oe(H),d=l.e=R.length-G.e-1,l.c[0]=ri[(v=d%q)<0?q+v:v],o=!o||y.comparedTo(l)>0?d>0?l:w:y,v=S,S=1/0,y=new _(R),p.c[0]=0;E=e(y,l,0,1),h=f.plus(E.times(g)),h.comparedTo(o)!=1;)f=g,g=h,w=p.plus(E.times(h=w)),p=h,l=y.minus(E.times(h=l)),y=h;return h=e(o.minus(f),g,0,1),p=p.plus(h.times(w)),f=f.plus(h.times(g)),p.s=w.s=G.s,d=d*2,T=e(w,g,d,s).minus(G).abs().comparedTo(e(p,f,d,s).minus(G).abs())<1?[w,g]:[p,f],S=v,T},r.toNumber=function(){return+A(this)},r.toPrecision=function(o,l){return o!=null&&le(o,1,Le),W(this,o,l,2)},r.toString=function(o){var l,f=this,g=f.s,h=f.e;return h===null?g?(l="Infinity",g<0&&(l="-"+l)):l="NaN":(o==null?l=h<=m||h>=c?Ft(Oe(f.c),h):He(Oe(f.c),h,"0"):o===10&&I?(f=U(new _(f),a+h+1,s),l=He(Oe(f.c),f.e,"0")):(le(o,2,P.length,"Base"),l=t(He(Oe(f.c),h,"0"),10,o,g,!0)),g<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return A(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&_.set(i),_}function ke(i){var e=i|0;return i>0||i===e?e:e-1}function Oe(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=q-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function ot(i,e){var t,n,r=i.c,u=e.c,a=i.s,s=e.s,m=i.e,c=e.e;if(!a||!s)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-s:a;if(a!=s)return a;if(t=a<0,n=m==c,!r||!u)return n?0:!r^t?1:-1;if(!n)return m>c^t?1:-1;for(s=(m=r.length)<(c=u.length)?m:c,a=0;a<s;a++)if(r[a]!=u[a])return r[a]>u[a]^t?1:-1;return m==c?0:m>c^t?1:-1}function le(i,e,t,n){if(i<e||i>t||i!==Ce(i))throw Error(we+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function Wt(i){var e=i.c.length-1;return ke(i.e/q)==e&&i.c[e]%2!=0}function Ft(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function He(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Ge=Ji(),jr=class{constructor(i){O(this,"key");O(this,"left",null);O(this,"right",null);this.key=i}},_t=class extends jr{constructor(i){super(i)}},Hr=class{constructor(){O(this,"size",0);O(this,"modificationCount",0);O(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,a=e;const s=this.compare;let m;for(;;)if(m=s(a.key,i),m>0){let c=a.left;if(c==null||(m=s(c.key,i),m>0&&(a.left=c.right,c.right=a,a=c,c=a.left,c==null)))break;t==null?n=a:t.left=a,t=a,a=c}else if(m<0){let c=a.right;if(c==null||(m=s(c.key,i),m<0&&(a.right=c.left,c.left=a,a=c,c=a.right,c==null)))break;r==null?u=a:r.right=a,r=a,a=c}else break;return r!=null&&(r.right=a.left,a.left=u),t!=null&&(t.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),m}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},zt=class Ot extends Hr{constructor(t,n){super();O(this,"root",null);O(this,"compare");O(this,"validKey");O(this,bn,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new _t(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new _t(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let u=r.right;for(;u!=null;)r=u,u=r.right;return r.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let u=r.left;for(;u!=null;)r=u,u=r.left;return r.key}retainAll(t){const n=new Ot(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Ot(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Ot(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Ot(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,a){let s,m;do{if(s=u.left,m=u.right,s!=null){const c=new _t(s.key);a.left=c,n(s,c)}if(m!=null){const c=new _t(m.key);a.right=c,u=m,a=c}}while(m!=null)}const r=new _t(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Kr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(wn=Symbol.iterator,bn=Symbol.toStringTag,wn)](){return new Zr(this.wrap())}},$i=class{constructor(i){O(this,"tree");O(this,"path",new Array);O(this,"modificationCount",null);O(this,"splayCount");this.tree=i,this.splayCount=i.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let i=this.path[this.path.length-1],e=i.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===i;)i=this.path.pop();return this.path.length>0}},Zr=class extends $i{getValue(i){return i.key}},Kr=class extends $i{getValue(i){return[i.key,i.key]}},en=i=>()=>i,si=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):en(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Yr(i){const e=i?(t,n,r,u,a)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):en(!1);return(t,n,r)=>{const u=t.x,a=t.y,s=r.x,m=r.y,c=a.minus(m).times(n.x.minus(s)).minus(u.minus(s).times(n.y.minus(m)));return e(c,u,a,s,m)?0:c.comparedTo(0)}}var Qr=i=>i,Xr=i=>{if(i){const e=new zt(si(i)),t=new zt(si(i)),n=(u,a)=>a.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Ge(0),y:new Ge(0)}),r}return Qr},oi=i=>({set:e=>{Ze=oi(e)},reset:()=>oi(i),compare:si(i),snap:Xr(i),orient:Yr(i)}),Ze=oi(),xt=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),li=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},Dt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),tn=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Ut=i=>tn(i,i).sqrt(),Jr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Dt(r,n).div(Ut(r)).div(Ut(n))},$r=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return tn(r,n).div(Ut(r)).div(Ut(n))},nn=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},rn=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},es=(i,e,t,n)=>{if(e.x.isZero())return rn(t,n,i.x);if(n.x.isZero())return rn(i,e,t.x);if(e.y.isZero())return nn(t,n,i.y);if(n.y.isZero())return nn(i,e,t.y);const r=Dt(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=Dt(u,e).div(r),s=Dt(u,n).div(r),m=i.x.plus(s.times(e.x)),c=t.x.plus(a.times(n.x)),b=i.y.plus(s.times(e.y)),S=t.y.plus(a.times(n.y)),M=m.plus(c).div(2),k=b.plus(S).div(2);return{x:M,y:k}},Be=class kn{constructor(e,t){O(this,"point");O(this,"isLeft");O(this,"segment");O(this,"otherSE");O(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=kn.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Vt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const u=t[n];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const u=r.otherSE;t.set(r,{sine:Jr(this.point,e.point,u.point),cosine:$r(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:a,cosine:s}=t.get(r),{sine:m,cosine:c}=t.get(u);return a.isGreaterThanOrEqualTo(0)&&m.isGreaterThanOrEqualTo(0)?s.isLessThan(c)?1:s.isGreaterThan(c)?-1:0:a.isLessThan(0)&&m.isLessThan(0)?s.isLessThan(c)?-1:s.isGreaterThan(c)?1:0:m.isLessThan(a)?-1:m.isGreaterThan(a)?1:0}}},ts=class vi{constructor(e){O(this,"events");O(this,"poly");O(this,"_isExteriorRing");O(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let a=null,s=u.leftSE,m=u.rightSE;const c=[s],b=s.point,S=[];for(;a=s,s=m,c.push(s),s.point!==b;)for(;;){const M=s.getAvailableLinkedEvents();if(M.length===0){const C=c[0].point,P=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${P.x}, ${P.y}].`)}if(M.length===1){m=M[0].otherSE;break}let k=null;for(let C=0,P=S.length;C<P;C++)if(S[C].point===s.point){k=C;break}if(k!==null){const C=S.splice(k)[0],P=c.splice(C.index);P.unshift(P[0].otherSE),t.push(new vi(P.reverse()));continue}S.push({index:c.length,point:s.point});const N=s.getLeftmostComparator(a);m=M.sort(N)[0].otherSE;break}t.push(new vi(c))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let c=1,b=this.events.length-1;c<b;c++){const S=this.events[c].point,M=this.events[c+1].point;Ze.orient(S,e,M)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];Ze.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,m=[];for(let c=a;c!=s;c+=u)m.push([t[c].x.toNumber(),t[c].y.toNumber()]);return m}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){var r,u;let e=this.events[0];for(let a=1,s=this.events.length;a<s;a++){const m=this.events[a];Be.compare(e,m)>0&&(e=m)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},sn=class{constructor(i){O(this,"exteriorRing");O(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},is=class{constructor(i){O(this,"rings");O(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new sn(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new sn(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(u)}}return e}},ns=class{constructor(i,e=Vt.compare){O(this,"queue");O(this,"tree");O(this,"segments");this.queue=i,this.tree=new zt(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const s=n.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(u=s),!n.isAnEndpoint(s))){const m=this._splitSafely(n,s);for(let c=0,b=m.length;c<b;c++)t.push(m[c])}}let a=null;if(r){const s=r.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(a=s),!r.isAnEndpoint(s))){const m=this._splitSafely(r,s);for(let c=0,b=m.length;c<b;c++)t.push(m[c])}}if(u!==null||a!==null){let s=null;u===null?s=a:a===null?s=u:s=Be.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const m=e.split(s);for(let c=0,b=m.length;c<b;c++)t.push(m[c])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const a=this._splitSafely(n,u);for(let s=0,m=a.length;s<m;s++)t.push(a[s])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let s=0,m=a.length;s<m;s++)t.push(a[s])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},rs=class{constructor(){O(this,"type");O(this,"numMultiPolys")}run(i,e,t){Tt.type=i;const n=[new ln(e,!0)];for(let c=0,b=t.length;c<b;c++)n.push(new ln(t[c],!1));if(Tt.numMultiPolys=n.length,Tt.type==="difference"){const c=n[0];let b=1;for(;b<n.length;)li(n[b].bbox,c.bbox)!==null?b++:n.splice(b,1)}if(Tt.type==="intersection")for(let c=0,b=n.length;c<b;c++){const S=n[c];for(let M=c+1,k=n.length;M<k;M++)if(li(S.bbox,n[M].bbox)===null)return[]}const r=new zt(Be.compare);for(let c=0,b=n.length;c<b;c++){const S=n[c].getSweepEvents();for(let M=0,k=S.length;M<k;M++)r.add(S[M])}const u=new ns(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const c=u.process(a);for(let b=0,S=c.length;b<S;b++){const M=c[b];M.consumedBy===void 0&&r.add(M)}r.size!=0?(a=r.first(),r.delete(a)):a=null}Ze.reset();const s=ts.factory(u.segments);return new is(s).getGeom()}},Tt=new rs,qt=Tt,ss=0,Vt=class Zt{constructor(e,t,n,r){O(this,"id");O(this,"leftSE");O(this,"rightSE");O(this,"rings");O(this,"windings");O(this,"ringOut");O(this,"consumedBy");O(this,"prev");O(this,"_prevInResult");O(this,"_beforeState");O(this,"_afterState");O(this,"_isInResult");this.id=++ss,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,a=t.rightSE.point.x;if(a.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const s=e.leftSE.point.y,m=t.leftSE.point.y,c=e.rightSE.point.y,b=t.rightSE.point.y;if(n.isLessThan(r)){if(m.isLessThan(s)&&m.isLessThan(c))return 1;if(m.isGreaterThan(s)&&m.isGreaterThan(c))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const M=t.comparePoint(e.rightSE.point);return M!==0?M:-1}if(n.isGreaterThan(r)){if(s.isLessThan(m)&&s.isLessThan(b))return-1;if(s.isGreaterThan(m)&&s.isGreaterThan(b))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const M=e.comparePoint(t.rightSE.point);return M<0?1:M>0?-1:1}if(s.isLessThan(m))return-1;if(s.isGreaterThan(m))return 1;if(u.isLessThan(a)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(a)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(a)){const S=c.minus(s),M=u.minus(n),k=b.minus(m),N=a.minus(r);if(S.isGreaterThan(M)&&k.isLessThan(N))return 1;if(S.isLessThan(M)&&k.isGreaterThan(N))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||c.isLessThan(b)?-1:c.isGreaterThan(b)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,a;const s=Be.comparePoints(e,t);if(s<0)r=e,u=t,a=1;else if(s>0)r=t,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const m=new Be(r,!0),c=new Be(u,!1);return new Zt(m,c,[n],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return Ze.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=li(t,n);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,m=e.rightSE.point,c=xt(t,s)&&this.comparePoint(s)===0,b=xt(n,u)&&e.comparePoint(u)===0,S=xt(t,m)&&this.comparePoint(m)===0,M=xt(n,a)&&e.comparePoint(a)===0;if(b&&c)return M&&!S?a:!M&&S?m:null;if(b)return S&&u.x.eq(m.x)&&u.y.eq(m.y)?null:u;if(c)return M&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(M&&S)return null;if(M)return a;if(S)return m;const k=es(u,this.vector(),s,e.vector());return k===null||!xt(r,k)?null:Ze.snap(k)}split(e){const t=[],n=e.events!==void 0,r=new Be(e,!0),u=new Be(e,!1),a=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const s=new Zt(r,a,this.rings.slice(),this.windings.slice());return Be.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Be.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Zt.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,a=n.rings.length;u<a;u++){const s=n.rings[u],m=n.windings[u],c=t.rings.indexOf(s);c===-1?(t.rings.push(s),t.windings.push(m)):t.windings[c]+=m}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,m=this.rings.length;s<m;s++){const c=this.rings[s],b=this.windings[s],S=t.indexOf(c);S===-1?(t.push(c),n.push(b)):n[S]+=b}const u=[],a=[];for(let s=0,m=t.length;s<m;s++){if(n[s]===0)continue;const c=t[s],b=c.poly;if(a.indexOf(b)===-1)if(c.isExterior)u.push(b);else{a.indexOf(b)===-1&&a.push(b);const S=u.indexOf(c.poly);S!==-1&&u.splice(S,1)}}for(let s=0,m=u.length;s<m;s++){const c=u[s].multiPoly;r.indexOf(c)===-1&&r.push(c)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(qt.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===qt.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},on=class{constructor(i,e,t){O(this,"poly");O(this,"isExterior");O(this,"segments");O(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=Ze.snap({x:new Ge(i[0][0]),y:new Ge(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,a=i.length;u<a;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const s=Ze.snap({x:new Ge(i[u][0]),y:new Ge(i[u][1])});s.x.eq(r.x)&&s.y.eq(r.y)||(this.segments.push(Vt.fromRing(r,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),r=s)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Vt.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},os=class{constructor(i,e){O(this,"multiPoly");O(this,"exteriorRing");O(this,"interiorRings");O(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new on(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,n=i.length;t<n;t++){const r=new on(i[t],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},ln=class{constructor(i,e){O(this,"isSubject");O(this,"polys");O(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Ge(Number.POSITIVE_INFINITY),y:new Ge(Number.POSITIVE_INFINITY)},ur:{x:new Ge(Number.NEGATIVE_INFINITY),y:new Ge(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new os(i[t],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},ls=(i,...e)=>qt.run("union",i,e),us=(i,...e)=>qt.run("difference",i,e);Ze.set;function as(i){const e=[];if(ii(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=us(e[0],...e.slice(1));return n.length===0?null:n.length===1?ei(n[0],t):Zi(n,t)}var fs=as;function cs(i){if(!i)throw new Error("geojson is required");var e=[];return Ur(i,function(t){e.push(t)}),ti(e)}var hs=cs;function ds(i,e={}){const t=[];if(ii(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=ls(t[0],...t.slice(1));return n.length===0?null:n.length===1?ei(n[0],e.properties):Zi(n,e.properties)}var gs=ds;function un(i,e){const t=fs(ti([ei([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Gt(Yi(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,a=n[2]>180,s=hs(i);if(s.features.length>1&&(u||a))for(const m of s.features){const c=Gt(Yi(m));if(a&&c[0]<-180+r)for(const b of m.geometry.coordinates)for(const S of b)S[0]+=360-r;if(u&&c[2]>180-r)for(const b of m.geometry.coordinates)for(const S of b)S[0]-=360-r}e(ti([s.features.length<2?i:gs(s)??i,t]))}const an="EPSG:4326";function ms(i){var u;const e=i.getProperties(),{isMask:t}=e,n=(u=i.getGeometry())==null?void 0:u.getType(),r=t?0:n==="LineString"||n==="MultiLineString"?3:2;return new In({stroke:t?void 0:new wi({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new bi({color:"#00000020"}):void 0,image:new Rn({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new An({backgroundFill:new bi({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new wi({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function fn(i,e={},t={},n=ms){let r=-1,u,a,s,m=!1;const c=new On({updateWhileAnimating:!0});i.addLayer(c);const b=new Pn({});c.setSource(b),c.setStyle(n),i.on("click",N=>{i.forEachFeatureAtPixel(N.pixel,C=>{const P=C.getId();if(P)return N.stopPropagation(),a==null||a({type:"markerClick",id:P}),C})}),i.on("pointermove",N=>{const C=i.forEachFeatureAtPixel(N.pixel,P=>P.getId());u!==C&&(u&&(a==null||a({type:"markerMouseLeave",id:u})),C&&(a==null||a({type:"markerMouseEnter",id:C})),i.getTargetElement().style.cursor=C?"pointer":m?"crosshair":"",u=C)});function S(){return Qe.getUserProjection()??i.getView().getProjection()}function M(N){return N.transform(an,S())}const k=N=>{a==null||a({type:"mapClick",coordinates:Qe.toLonLat(N.coordinate,S())})};return{setEventHandler(N){N?(a=N,i.on("click",k)):(a=void 0,i.un("click",k))},flyTo(N,C){i.getView().animate({center:Qe.fromLonLat(N,S()),...C?{zoom:C}:{},duration:2e3,...e})},fitBounds(N,C,P){i.getView().fit(Qe.transformExtent(N,an,S()),{padding:[C,C,C,C],...P?{maxZoom:P}:{},duration:2e3,...t})},indicateReverse(N){m=N,i.getTargetElement().style.cursor=N?"crosshair":""},setReverseMarker(N){s?N?s.getGeometry().setCoordinates(Qe.fromLonLat(N,S())):(b.removeFeature(s),s.dispose(),s=void 0):N&&(s=new Te.Feature(new Me.Point(Qe.fromLonLat(N,S()))),s.setProperties({isReverse:!0}),b.addFeature(s))},setFeatures(N,C,P){function I(_){var W;if(_)for(const z of _.features){const D=z.geometry.type==="Polygon"?new Me.Polygon(z.geometry.coordinates):z.geometry.type==="MultiPolygon"?new Me.MultiPolygon(z.geometry.coordinates):null;D&&b.addFeature(new Te.Feature({isMask:!!((W=z.properties)!=null&&W.isMask),geometry:M(D)}))}}b.clear(),s&&b.addFeature(s);e:if(C){let _=!1;if(C.geometry.type==="GeometryCollection"){const W=C.geometry.geometries.map(z=>z.type==="Polygon"?new Me.Polygon(z.coordinates):z.type==="MultiPolygon"?new Me.MultiPolygon(z.coordinates):null).filter(z=>!!z);if(W.length>0)b.addFeature(new Te.Feature(M(new Me.GeometryCollection(W)))),_=!0;else for(const z of C.geometry.geometries)z.type==="LineString"?(b.addFeature(new Te.Feature(M(new Me.LineString(z.coordinates)))),_=!0):z.type==="MultiLineString"&&b.addFeature(new Te.Feature(M(new Me.MultiLineString(z.coordinates)))),_=!0}if(!_){if(C.geometry.type==="Polygon")un(C,I);else if(C.geometry.type==="MultiPolygon")un(C,I);else if(C.geometry.type==="LineString"){b.addFeature(new Te.Feature(M(new Me.LineString(C.geometry.coordinates))));break e}else if(C.geometry.type==="MultiLineString"){b.addFeature(new Te.Feature(M(new Me.MultiLineString(C.geometry.coordinates))));break e}}if(!P&&!C.geometry.type.endsWith("Point"))break e;b.addFeature(new Te.Feature(M(new Me.Point(C.center))))}for(const _ of N??[]){if(_===C)continue;const W=new Te.Feature(new Me.Point(Qe.fromLonLat(_.center,S())));W.setId(_.id),W.setProperties({fuzzy:!!_.matching_text,tooltip:_.place_type[0]==="reverse"?_.place_name:_.place_name.replace(/,.*/,"")}),b.addFeature(W)}},setSelectedMarker(N){var I,_,W;const C=b.getFeatures(),P=(I=C[0])!=null&&I.getProperties().isReverse?1:0;r>-1&&((_=C[r+P])==null||_.setProperties({isSelected:!1})),N>-1&&((W=C[N+P])==null||W.setProperties({isSelected:!0})),r=N},getCenterAndZoom(){const N=i.getView(),C=N.getCenter(),P=N.getZoom();if(!(!C||P===void 0))return[P,...Qe.toLonLat(C,S())]}}}class ys extends $.Control{constructor(t){const n=document.createElement("div");n.className="ol-search";super({element:n,target:t.target});yi(this,ce);yi(this,lt);const{flyTo:r,fullGeometryStyle:u,...a}=t;pi(this,ce,new Dr({target:n,props:{flyTo:r===void 0?!0:!!r,...a}})),de(this,ce).$on("select",s=>{this.dispatchEvent(new cn(s.detail.feature))}),de(this,ce).$on("pick",s=>{this.dispatchEvent(new mn(s.detail.feature))}),de(this,ce).$on("featureslisted",s=>{this.dispatchEvent(new hn(s.detail.features))}),de(this,ce).$on("featuresmarked",s=>{this.dispatchEvent(new dn(s.detail.features))}),de(this,ce).$on("response",s=>{this.dispatchEvent(new pn(s.detail.url,s.detail.featureCollection))}),de(this,ce).$on("optionsvisibilitychange",s=>{this.dispatchEvent(new gn(s.detail.optionsVisible))}),de(this,ce).$on("reversetoggle",s=>{this.dispatchEvent(new vn(s.detail.reverse))}),de(this,ce).$on("querychange",s=>{this.dispatchEvent(new yn(s.detail.query))}),pi(this,lt,t)}setMap(t){var n;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:u}=de(this,lt),a=fn(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,u);(n=de(this,ce))==null||n.$set({mapController:a})}}setOptions(t){var a;Object.assign(de(this,lt),t);const{flyTo:n,fullGeometryStyle:r,...u}=de(this,lt);(a=de(this,ce))==null||a.$set({...u,flyTo:n===void 0?!0:!!n})}setQuery(t,n=!0){var r;(r=de(this,ce))==null||r.setQuery(t,n)}clearMap(){var t;(t=de(this,ce))==null||t.clearMap()}clearList(){var t;(t=de(this,ce))==null||t.clearList()}setReverseMode(t){var n;(n=de(this,ce))==null||n.$set({reverseActive:t})}focus(t){var n;(n=de(this,ce))==null||n.focus(t)}blur(){var t;(t=de(this,ce))==null||t.blur()}}ce=new WeakMap,lt=new WeakMap;class cn extends ne{constructor(t){super("select");O(this,"feature");this.feature=t}}class hn extends ne{constructor(t){super("featureslisted");O(this,"features");this.features=t}}class dn extends ne{constructor(t){super("featuresmarked");O(this,"features");this.features=t}}class gn extends ne{constructor(t){super("optionsvisibilitychange");O(this,"optionsVisible");this.optionsVisible=t}}class mn extends ne{constructor(t){super("pick");O(this,"feature");this.feature=t}}class yn extends ne{constructor(t){super("querychange");O(this,"query");this.query=t}}class pn extends ne{constructor(t,n){super("response");O(this,"url");O(this,"featureCollection");this.url=t,this.featureCollection=n}}class vn extends ne{constructor(t){super("reversetoggle");O(this,"reverse");this.reverse=t}}F.FeaturesListedEvent=hn,F.FeaturesMarkedEvent=dn,F.GeocodingControl=ys,F.OptionsVisibilityChangeEvent=gn,F.PickEvent=mn,F.QueryChangeEvent=yn,F.ResponseEvent=pn,F.ReverseToggleEvent=vn,F.SelectEvent=cn,F.createOpenLayersMapController=fn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
14
- //# sourceMappingURL=openlayers.umd.js.map