@maptiler/geocoding-control 2.1.1 → 2.1.3-rc1

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 (283) hide show
  1. package/icons/sprite.json +259 -0
  2. package/icons/sprite.png +0 -0
  3. package/icons/sprite@2x.json +259 -0
  4. package/icons/sprite@2x.png +0 -0
  5. package/leaflet.js +1668 -1581
  6. package/leaflet.js.map +1 -1
  7. package/leaflet.umd.js +13 -1
  8. package/leaflet.umd.js.map +1 -1
  9. package/maplibregl.js +1405 -1318
  10. package/maplibregl.js.map +1 -1
  11. package/maplibregl.umd.js +13 -1
  12. package/maplibregl.umd.js.map +1 -1
  13. package/maptilersdk.js +1406 -1320
  14. package/maptilersdk.js.map +1 -1
  15. package/maptilersdk.umd.js +13 -1
  16. package/maptilersdk.umd.js.map +1 -1
  17. package/openlayers.js +1471 -1384
  18. package/openlayers.js.map +1 -1
  19. package/openlayers.umd.js +13 -1
  20. package/openlayers.umd.js.map +1 -1
  21. package/package.json +9 -9
  22. package/react.js +985 -898
  23. package/react.js.map +1 -1
  24. package/react.umd.js +13 -1
  25. package/react.umd.js.map +1 -1
  26. package/style.css +1 -1
  27. package/svelte/FeatureItem.svelte +70 -18
  28. package/svelte/GeocodingControl.svelte +46 -17
  29. package/svelte/GeocodingControl.svelte.d.ts +1 -0
  30. package/svelte/info.json +1 -0
  31. package/svelte/maptilersdk.js +1 -1
  32. package/svelte/types.d.ts +1 -0
  33. package/{src/types.d.ts → types.d.ts} +1 -0
  34. package/vanilla.js +1028 -941
  35. package/vanilla.js.map +1 -1
  36. package/vanilla.umd.js +13 -1
  37. package/vanilla.umd.js.map +1 -1
  38. package/icons/aerialway.svg +0 -1
  39. package/icons/airfield.svg +0 -1
  40. package/icons/airport.svg +0 -6
  41. package/icons/alcohol_shop.svg +0 -1
  42. package/icons/american_football.svg +0 -1
  43. package/icons/animal_shelter.svg +0 -4
  44. package/icons/aquarium.svg +0 -1
  45. package/icons/art_gallery.svg +0 -4
  46. package/icons/atm.svg +0 -5
  47. package/icons/attraction.svg +0 -1
  48. package/icons/bakery.svg +0 -1
  49. package/icons/bank.svg +0 -1
  50. package/icons/bar.svg +0 -1
  51. package/icons/barrier.svg +0 -4
  52. package/icons/baseball.svg +0 -4
  53. package/icons/basketball.svg +0 -4
  54. package/icons/bbq.svg +0 -4
  55. package/icons/beach.svg +0 -4
  56. package/icons/beer.svg +0 -4
  57. package/icons/bench.svg +0 -4
  58. package/icons/bicycle.svg +0 -4
  59. package/icons/bicycle_parking.svg +0 -5
  60. package/icons/bicycle_rental.svg +0 -5
  61. package/icons/bicycle_share.svg +0 -1
  62. package/icons/billiards.svg +0 -4
  63. package/icons/board.svg +0 -4
  64. package/icons/bollard.svg +0 -4
  65. package/icons/bowling.svg +0 -4
  66. package/icons/buddhist.svg +0 -1
  67. package/icons/building.svg +0 -4
  68. package/icons/bulldozer.svg +0 -4
  69. package/icons/bus_guided.svg +0 -4
  70. package/icons/bus_stop.svg +0 -1
  71. package/icons/bus_trolley.svg +0 -4
  72. package/icons/butcher.svg +0 -4
  73. package/icons/cafe.svg +0 -1
  74. package/icons/camper_trailer.svg +0 -4
  75. package/icons/campfire.svg +0 -4
  76. package/icons/campsite.svg +0 -1
  77. package/icons/car.svg +0 -1
  78. package/icons/car_rental.svg +0 -1
  79. package/icons/car_repair.svg +0 -14
  80. package/icons/casino.svg +0 -1
  81. package/icons/castle.svg +0 -1
  82. package/icons/caution.svg +0 -4
  83. package/icons/cemetery.svg +0 -4
  84. package/icons/charging_station.svg +0 -4
  85. package/icons/christian.svg +0 -5
  86. package/icons/cinema.svg +0 -1
  87. package/icons/circle-dot.svg +0 -4
  88. package/icons/circle-stroke.svg +0 -4
  89. package/icons/circle.svg +0 -4
  90. package/icons/city.svg +0 -4
  91. package/icons/clothing_store.svg +0 -1
  92. package/icons/college.svg +0 -1
  93. package/icons/commercial.svg +0 -1
  94. package/icons/communications_tower.svg +0 -4
  95. package/icons/confectionery.svg +0 -4
  96. package/icons/construction.svg +0 -4
  97. package/icons/convenience.svg +0 -1
  98. package/icons/cricket.svg +0 -4
  99. package/icons/cross.svg +0 -4
  100. package/icons/cycle_barrier.svg +0 -4
  101. package/icons/dam.svg +0 -4
  102. package/icons/danger.svg +0 -4
  103. package/icons/defibrillator.svg +0 -1
  104. package/icons/dentist.svg +0 -1
  105. package/icons/diamond.svg +0 -4
  106. package/icons/diamond_stroked.svg +0 -4
  107. package/icons/diplomatic.svg +0 -1
  108. package/icons/doctors.svg +0 -1
  109. package/icons/dog_park.svg +0 -1
  110. package/icons/dot.svg +0 -4
  111. package/icons/drinking_water.svg +0 -4
  112. package/icons/elevator.svg +0 -1
  113. package/icons/emergency_phone.svg +0 -4
  114. package/icons/entrance.svg +0 -4
  115. package/icons/farm.svg +0 -4
  116. package/icons/fast_food.svg +0 -1
  117. package/icons/fence.svg +0 -4
  118. package/icons/ferry_terminal.svg +0 -1
  119. package/icons/fire_station.svg +0 -1
  120. package/icons/fitness_centre.svg +0 -1
  121. package/icons/florist.svg +0 -4
  122. package/icons/fountain.svg +0 -1
  123. package/icons/fuel.svg +0 -1
  124. package/icons/furniture.svg +0 -4
  125. package/icons/gaming.svg +0 -4
  126. package/icons/garden.svg +0 -4
  127. package/icons/garden_centre.svg +0 -4
  128. package/icons/gate.svg +0 -4
  129. package/icons/gift.svg +0 -1
  130. package/icons/globe.svg +0 -4
  131. package/icons/golf.svg +0 -1
  132. package/icons/golf_green.svg +0 -4
  133. package/icons/gondola.svg +0 -4
  134. package/icons/grocery.svg +0 -1
  135. package/icons/guidepost.svg +0 -4
  136. package/icons/hairdresser.svg +0 -1
  137. package/icons/harbor.svg +0 -1
  138. package/icons/hardware.svg +0 -4
  139. package/icons/heart.svg +0 -4
  140. package/icons/heliport.svg +0 -4
  141. package/icons/highway_rest_area.svg +0 -4
  142. package/icons/hinduist.svg +0 -1
  143. package/icons/historic.svg +0 -1
  144. package/icons/home.svg +0 -4
  145. package/icons/horse_riding.svg +0 -1
  146. package/icons/hospital.svg +0 -1
  147. package/icons/hot_spring.svg +0 -4
  148. package/icons/hut.svg +0 -1
  149. package/icons/ice_cream.svg +0 -1
  150. package/icons/industry.svg +0 -4
  151. package/icons/information.svg +0 -1
  152. package/icons/jewelry.svg +0 -1
  153. package/icons/jewish.svg +0 -1
  154. package/icons/karaoke.svg +0 -4
  155. package/icons/landmark.svg +0 -1
  156. package/icons/laundry.svg +0 -1
  157. package/icons/library.svg +0 -1
  158. package/icons/lift_gate.svg +0 -4
  159. package/icons/light_rail.svg +0 -4
  160. package/icons/lighthouse.svg +0 -4
  161. package/icons/lodging.svg +0 -1
  162. package/icons/marker.svg +0 -4
  163. package/icons/marker_stroked.svg +0 -4
  164. package/icons/mobile_phone.svg +0 -1
  165. package/icons/monorail.svg +0 -4
  166. package/icons/monument.svg +0 -1
  167. package/icons/motorcycle.svg +0 -4
  168. package/icons/motorcycle_parking.svg +0 -4
  169. package/icons/motorcycle_rental.svg +0 -4
  170. package/icons/motorcycle_repair.svg +0 -4
  171. package/icons/museum.svg +0 -1
  172. package/icons/music.svg +0 -1
  173. package/icons/muslim.svg +0 -1
  174. package/icons/natural.svg +0 -4
  175. package/icons/noodle.svg +0 -4
  176. package/icons/obelisk.svg +0 -4
  177. package/icons/observation_tower.svg +0 -4
  178. package/icons/oneway.svg +0 -4
  179. package/icons/optician.svg +0 -4
  180. package/icons/outdoor.svg +0 -1
  181. package/icons/paint.svg +0 -1
  182. package/icons/park.svg +0 -4
  183. package/icons/parking.svg +0 -1
  184. package/icons/parking_garage.svg +0 -1
  185. package/icons/parking_paid.svg +0 -4
  186. package/icons/peak.svg +0 -1
  187. package/icons/perfumery.svg +0 -1
  188. package/icons/pharmacy.svg +0 -1
  189. package/icons/picnic_site.svg +0 -1
  190. package/icons/pin.svg +0 -4
  191. package/icons/pipe.svg +0 -4
  192. package/icons/pitch.svg +0 -1
  193. package/icons/pizza.svg +0 -4
  194. package/icons/place_of_worship.svg +0 -4
  195. package/icons/playground.svg +0 -4
  196. package/icons/police.svg +0 -1
  197. package/icons/post.svg +0 -1
  198. package/icons/prison.svg +0 -1
  199. package/icons/racetrack.svg +0 -4
  200. package/icons/radiation.svg +0 -4
  201. package/icons/railway.svg +0 -4
  202. package/icons/ranger_station.svg +0 -4
  203. package/icons/recycling.svg +0 -4
  204. package/icons/restaurant.svg +0 -1
  205. package/icons/road_accident.svg +0 -4
  206. package/icons/roadblock.svg +0 -4
  207. package/icons/rocket.svg +0 -4
  208. package/icons/school.svg +0 -1
  209. package/icons/school_bus.svg +0 -4
  210. package/icons/scooter.svg +0 -1
  211. package/icons/sculpture.svg +0 -4
  212. package/icons/seafood.svg +0 -4
  213. package/icons/shelter.svg +0 -4
  214. package/icons/shinto.svg +0 -1
  215. package/icons/shoes.svg +0 -4
  216. package/icons/shop.svg +0 -1
  217. package/icons/sikh.svg +0 -4
  218. package/icons/skateboard.svg +0 -1
  219. package/icons/snow.svg +0 -4
  220. package/icons/soccer.svg +0 -4
  221. package/icons/spring.svg +0 -4
  222. package/icons/square.svg +0 -4
  223. package/icons/square_stroked.svg +0 -4
  224. package/icons/stadium.svg +0 -1
  225. package/icons/star.svg +0 -4
  226. package/icons/star_stroked.svg +0 -4
  227. package/icons/statue.svg +0 -4
  228. package/icons/subway.svg +0 -4
  229. package/icons/suitcase.svg +0 -1
  230. package/icons/sushi.svg +0 -4
  231. package/icons/swimming.svg +0 -5
  232. package/icons/swimming_pool.svg +0 -8
  233. package/icons/tako.svg +0 -4
  234. package/icons/taoist.svg +0 -1
  235. package/icons/taxi.svg +0 -4
  236. package/icons/teahouse.svg +0 -4
  237. package/icons/telephone.svg +0 -1
  238. package/icons/tennis.svg +0 -1
  239. package/icons/terminal.svg +0 -4
  240. package/icons/theatre.svg +0 -1
  241. package/icons/theme_park.svg +0 -4
  242. package/icons/toilets.svg +0 -1
  243. package/icons/toll.svg +0 -1
  244. package/icons/town.svg +0 -4
  245. package/icons/town_hall.svg +0 -4
  246. package/icons/tram_stop.svg +0 -4
  247. package/icons/tramway.svg +0 -1
  248. package/icons/transit.svg +0 -4
  249. package/icons/triangle.svg +0 -4
  250. package/icons/triangle_stroked.svg +0 -4
  251. package/icons/truck.svg +0 -4
  252. package/icons/tunnel.svg +0 -4
  253. package/icons/veterinary.svg +0 -4
  254. package/icons/viewpoint.svg +0 -4
  255. package/icons/village.svg +0 -4
  256. package/icons/volcano.svg +0 -1
  257. package/icons/volleyball.svg +0 -4
  258. package/icons/warehouse.svg +0 -4
  259. package/icons/waste_basket.svg +0 -1
  260. package/icons/watches.svg +0 -1
  261. package/icons/water.svg +0 -4
  262. package/icons/water_park.svg +0 -6
  263. package/icons/water_tower.svg +0 -4
  264. package/icons/watermill.svg +0 -4
  265. package/icons/wetland.svg +0 -4
  266. package/icons/wheelchair.svg +0 -1
  267. package/icons/windmill.svg +0 -1
  268. package/icons/wine.svg +0 -4
  269. package/icons/zoo.svg +0 -1
  270. /package/{src/MapLibreBasedGeocodingControl.d.ts → MapLibreBasedGeocodingControl.d.ts} +0 -0
  271. /package/{src/geo-coordinates-parser.t.d.ts → geo-coordinates-parser.t.d.ts} +0 -0
  272. /package/{src/geoUtils.d.ts → geoUtils.d.ts} +0 -0
  273. /package/{src/leaflet-controller.d.ts → leaflet-controller.d.ts} +0 -0
  274. /package/{src/leaflet.d.ts → leaflet.d.ts} +0 -0
  275. /package/{src/maplibregl-controller.d.ts → maplibregl-controller.d.ts} +0 -0
  276. /package/{src/maplibregl.d.ts → maplibregl.d.ts} +0 -0
  277. /package/{src/maptilersdk.d.ts → maptilersdk.d.ts} +0 -0
  278. /package/{src/mask.d.ts → mask.d.ts} +0 -0
  279. /package/{src/openlayers-controller.d.ts → openlayers-controller.d.ts} +0 -0
  280. /package/{src/openlayers.d.ts → openlayers.d.ts} +0 -0
  281. /package/{src/proximity.d.ts → proximity.d.ts} +0 -0
  282. /package/{src/react.d.ts → react.d.ts} +0 -0
  283. /package/{src/vanilla.d.ts → vanilla.d.ts} +0 -0
package/leaflet.umd.js CHANGED
@@ -1,2 +1,14 @@
1
- (function(K,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],$):(K=typeof globalThis<"u"?globalThis:K||self,$(K.leafletMaptilerGeocoder={},K.L))})(this,function(K,$){"use strict";var Ns=Object.defineProperty;var vn=K=>{throw TypeError(K)};var Os=(K,$,ge)=>$ in K?Ns(K,$,{enumerable:!0,configurable:!0,writable:!0,value:ge}):K[$]=ge;var I=(K,$,ge)=>Os(K,typeof $!="symbol"?$+"":$,ge),wn=(K,$,ge)=>$.has(K)||vn("Cannot "+ge);var Te=(K,$,ge)=>(wn(K,$,"read from private field"),ge?ge.call(K):$.get(K)),hi=(K,$,ge)=>$.has(K)?vn("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(K):$.set(K,ge),di=(K,$,ge,be)=>(wn(K,$,"write to private field"),be?be.call(K,ge):$.set(K,ge),ge);var fn,cn,Le,rt;function ge(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const be=ge($);function te(){}function Ln(i,e){for(const t in e)i[t]=e[t];return i}function mi(i){return i()}function pi(){return Object.create(null)}function Ue(i){i.forEach(mi)}function yi(i){return typeof i=="function"}function Ke(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Nt;function pe(i,e){return i===e?!0:(Nt||(Nt=document.createElement("a")),Nt.href=e,i===Nt.href)}function _n(i){return Object.keys(i).length===0}function Sn(i,e,t,n){if(i){const r=bi(i,e,t,n);return i[0](r)}}function bi(i,e,t,n){return i[1]&&n?Ln(t.ctx.slice(),i[1](n(e))):t.ctx}function xn(i,e,t,n){return i[2],e.dirty}function Tn(i,e,t,n,r,l){if(r){const a=bi(e,t,n,l);i.p(a,r)}}function Mn(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 Ot(i){return i??""}function Z(i,e){i.appendChild(e)}function ne(i,e,t){i.insertBefore(e,t||null)}function ie(i){i.parentNode&&i.parentNode.removeChild(i)}function J(i){return document.createElement(i)}function ke(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ye(i){return document.createTextNode(i)}function we(){return Ye(" ")}function Cn(){return Ye("")}function fe(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Nn(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 On(i){return Array.from(i.childNodes)}function dt(i,e){e=""+e,i.data!==e&&(i.data=e)}function vi(i,e){i.value=e??""}function Ae(i,e,t){i.classList.toggle(e,!!t)}function kn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let gt;function mt(i){gt=i}function wi(){if(!gt)throw new Error("Function called outside component initialization");return gt}function Rn(i){wi().$$.on_destroy.push(i)}function Ei(){const i=wi();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const l=kn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,l)}),!l.defaultPrevented}return!0}}function Pn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ut=[],jt=[];let at=[];const Li=[],An=Promise.resolve();let Zt=!1;function In(){Zt||(Zt=!0,An.then(_i))}function Ht(i){at.push(i)}const Vt=new Set;let ft=0;function _i(){if(ft!==0)return;const i=gt;do{try{for(;ft<ut.length;){const e=ut[ft];ft++,mt(e),Bn(e.$$)}}catch(e){throw ut.length=0,ft=0,e}for(mt(null),ut.length=0,ft=0;jt.length;)jt.pop()();for(let e=0;e<at.length;e+=1){const t=at[e];Vt.has(t)||(Vt.add(t),t())}at.length=0}while(ut.length);for(;Li.length;)Li.pop()();Zt=!1,Vt.clear(),mt(i)}function Bn(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(Ht)}}function Gn(i){const e=[],t=[];at.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),at=e}const kt=new Set;let it;function Rt(){it={r:0,c:[],p:it}}function Pt(){it.r||Ue(it.c),it=it.p}function le(i,e){i&&i.i&&(kt.delete(i),i.i(e))}function de(i,e,t,n){if(i&&i.o){if(kt.has(i))return;kt.add(i),it.c.push(()=>{kt.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Si(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function zn(i,e){de(i,1,1,()=>{e.delete(i.key)})}function Wn(i,e,t,n,r,l,a,o,d,c,L,_){let C=i.length,M=l.length,N=C;const A={};for(;N--;)A[i[N].key]=N;const k=[],O=new Map,S=new Map,R=[];for(N=M;N--;){const B=_(r,l,N),s=t(B);let u=a.get(s);u?R.push(()=>u.p(B,e)):(u=c(s,B),u.c()),O.set(s,k[N]=u),s in A&&S.set(s,Math.abs(N-A[s]))}const W=new Set,H=new Set;function D(B){le(B,1),B.m(o,L),a.set(B.key,B),L=B.first,M--}for(;C&&M;){const B=k[M-1],s=i[C-1],u=B.key,f=s.key;B===s?(L=B.first,C--,M--):O.has(f)?!a.has(u)||W.has(u)?D(B):H.has(f)?C--:S.get(u)>S.get(f)?(H.add(u),D(B)):(W.add(f),C--):(d(s,a),C--)}for(;C--;){const B=i[C];O.has(B.key)||d(B,a)}for(;M;)D(k[M-1]);return Ue(R),k}function Xe(i){i&&i.c()}function Fe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Ht(()=>{const l=i.$$.on_mount.map(mi).filter(yi);i.$$.on_destroy?i.$$.on_destroy.push(...l):Ue(l),i.$$.on_mount=[]}),r.forEach(Ht)}function qe(i,e){const t=i.$$;t.fragment!==null&&(Gn(t.after_update),Ue(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Dn(i,e){i.$$.dirty[0]===-1&&(ut.push(i),In(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Qe(i,e,t,n,r,l,a=null,o=[-1]){const d=gt;mt(i);const c=i.$$={fragment:null,ctx:[],props:l,update:te,not_equal:r,bound:pi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(d?d.$$.context:[])),callbacks:pi(),dirty:o,skip_bound:!1,root:e.target||d.$$.root};a&&a(c.root);let L=!1;if(c.ctx=t?t(i,e.props||{},(_,C,...M)=>{const N=M.length?M[0]:C;return c.ctx&&r(c.ctx[_],c.ctx[_]=N)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](N),L&&Dn(i,_)),C}):[],c.update(),L=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=On(e.target);c.fragment&&c.fragment.l(_),_.forEach(ie)}else c.fragment&&c.fragment.c();e.intro&&le(i.$$.fragment),Fe(i,e.target,e.anchor),_i()}mt(d)}class Je{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){qe(this,1),this.$destroy=te}$on(e,t){if(!yi(t))return te;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&&!_n(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Un="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Un);function Fn(i){let e,t;return{c(){e=ke("svg"),t=ke("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){ne(n,e,r),Z(e,t)},p:te,i:te,o:te,d(n){n&&ie(e)}}}class xi extends Je{constructor(e){super(),Qe(this,e,null,Fn,Ke,{})}}function qn(i){let e,t;return{c(){e=ke("svg"),t=ke("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){ne(n,e,r),Z(e,t)},p:te,i:te,o:te,d(n){n&&ie(e)}}}class Ti extends Je{constructor(e){super(),Qe(this,e,null,qn,Ke,{})}}function jn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Zn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Hn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Vn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Kn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Yn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Xn(i){let e,t;return{c(){e=J("img"),pe(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!pe(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function Qn(i){let e,t,n,r;return{c(){e=J("img"),pe(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(l,a){ne(l,e,a),n||(r=fe(e,"error",i[14]),n=!0)},p(l,a){a&32&&!pe(e.src,t=l[5])&&x(e,"src",t),a&16&&x(e,"alt",l[4]),a&64&&x(e,"title",l[6])},d(l){l&&ie(e),n=!1,r()}}}function Mi(i){let e,t;return{c(){e=J("span"),t=Ye(i[6]),x(e,"class","secondary svelte-z7p9pp")},m(n,r){ne(n,e,r),Z(e,t)},p(n,r){r&64&&dt(t,n[6])},d(n){n&&ie(e)}}}function Jn(i){let e,t,n,r,l,a,o,d,c,L=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",_,C,M=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,A,k=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",O,S,R,W,H,D;function B(m,h){return h&1&&(t=null),h&1&&(n=null),h&1&&(r=null),h&1&&(l=null),m[5]?Qn:m[0].address?Xn:(t==null&&(t=!!m[0].id.startsWith("road.")),t?Yn:(n==null&&(n=!!m[0].id.startsWith("address.")),n?Kn:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?Vn:(l==null&&(l=!!m[0].id.startsWith("poi.")),l?Hn:m[8]?Zn:jn))))}let s=B(i,-1),u=s(i),f=M&&Mi(i);return{c(){e=J("li"),u.c(),a=we(),o=J("span"),d=J("span"),c=J("span"),_=Ye(L),C=we(),f&&f.c(),N=we(),A=J("span"),O=Ye(k),x(c,"class","primary svelte-z7p9pp"),x(d,"class","svelte-z7p9pp"),x(A,"class","line2 svelte-z7p9pp"),x(o,"class","texts svelte-z7p9pp"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",S=i[1]==="selected"),x(e,"aria-checked",R=i[1]==="picked"),x(e,"class",W=Ot(i[1])+" svelte-z7p9pp")},m(m,h){ne(m,e,h),u.m(e,null),Z(e,a),Z(e,o),Z(o,d),Z(d,c),Z(c,_),Z(d,C),f&&f.m(d,null),Z(o,N),Z(o,A),Z(A,O),H||(D=[fe(e,"mouseenter",i[13]),fe(e,"focus",i[15]),fe(e,"click",i[16])],H=!0)},p(m,[h]){s===(s=B(m,h))&&u?u.p(m,h):(u.d(1),u=s(m),u&&(u.c(),u.m(e,a))),h&1&&L!==(L=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&dt(_,L),h&37&&(M=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),M?f?f.p(m,h):(f=Mi(m),f.c(),f.m(d,null)):f&&(f.d(1),f=null),h&1&&k!==(k=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&dt(O,k),h&2&&S!==(S=m[1]==="selected")&&x(e,"aria-selected",S),h&2&&R!==(R=m[1]==="picked")&&x(e,"aria-checked",R),h&2&&W!==(W=Ot(m[1])+" svelte-z7p9pp")&&x(e,"class",W)},i:te,o:te,d(m){m&&ie(e),u.d(),f&&f.d(),H=!1,Ue(D)}}}function $n(i,e,t){var H;let n,r,{feature:l}=e,{style:a="default"}=e,{showPlaceType:o}=e,{missingIconsCache:d}=e,{iconsBaseUrl:c}=e;const L=Ei(),_=(H=l.properties)==null?void 0:H.categories;let C,M,N=0,A=l.place_type[0]==="reverse";function k(){M&&d.add(M),t(11,N++,N)}function O(D){Pn.call(this,i,D)}const S=()=>k(),R=()=>L("select",void 0),W=D=>{document.activeElement!==D.target&&L("select",void 0)};return i.$$set=D=>{"feature"in D&&t(0,l=D.feature),"style"in D&&t(1,a=D.style),"showPlaceType"in D&&t(2,o=D.showPlaceType),"missingIconsCache"in D&&t(10,d=D.missingIconsCache),"iconsBaseUrl"in D&&t(3,c=D.iconsBaseUrl)},i.$$.update=()=>{var D,B,s,u;if(i.$$.dirty&7224)do t(12,n--,n),t(4,C=_==null?void 0:_[n]),t(5,M=C?c+C.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!M||d.has(M)));i.$$.dirty&1&&t(6,r=((B=(D=l.properties)==null?void 0:D.categories)==null?void 0:B.join(", "))??((u=(s=l.properties)==null?void 0:s.place_type_name)==null?void 0:u[0])??l.place_type[0])},t(12,n=(_==null?void 0:_.length)??0),[l,a,o,c,C,M,r,L,A,k,d,N,n,O,S,R,W]}class er extends Je{constructor(e){super(),Qe(this,e,$n,Jn,Ke,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function tr(i){let e;return{c(){e=J("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){ne(t,e,n)},p:te,i:te,o:te,d(t){t&&ie(e)}}}class ir extends Je{constructor(e){super(),Qe(this,e,null,tr,Ke,{})}}function nr(i){let e,t,n;return{c(){e=ke("svg"),t=ke("path"),x(t,"stroke-width","4"),x(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),x(t,"class","svelte-gzo3ar"),x(e,"width",n=i[0]==="list"?20:void 0),x(e,"viewBox","0 0 70 85"),x(e,"fill","none"),x(e,"class","svelte-gzo3ar"),Ae(e,"in-map",i[0]!=="list"),Ae(e,"list-icon",i[0]==="list")},m(r,l){ne(r,e,l),Z(e,t)},p(r,[l]){l&1&&n!==(n=r[0]==="list"?20:void 0)&&x(e,"width",n),l&1&&Ae(e,"in-map",r[0]!=="list"),l&1&&Ae(e,"list-icon",r[0]==="list")},i:te,o:te,d(r){r&&ie(e)}}}function rr(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class sr extends Je{constructor(e){super(),Qe(this,e,rr,nr,Ke,{displayIn:0})}}function or(i){let e,t;return{c(){e=ke("svg"),t=ke("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){ne(n,e,r),Z(e,t)},p:te,i:te,o:te,d(n){n&&ie(e)}}}class lr extends Je{constructor(e){super(),Qe(this,e,null,or,Ke,{})}}function ur(i){let e,t,n;return{c(){e=ke("svg"),t=ke("circle"),n=ke("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,l){ne(r,e,l),Z(e,t),Z(e,n)},p:te,i:te,o:te,d(r){r&&ie(e)}}}class ar extends Je{constructor(e){super(),Qe(this,e,null,ur,Ke,{})}}function fr(i,e,t){const n=e[1],r=e[0],l=n-r;return i===n&&t?i:((i-r)%l+l)%l+r}function pt(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 yt;async function cr(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(yt&&r.cachedLocationExpiry&&yt.time+r.cachedLocationExpiry>Date.now()){if(!yt.coords)break e;return yt.coords}let l;try{return l=await new Promise((a,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(d=>{a([d.coords.longitude,d.coords.latitude].map(c=>c.toFixed(6)).join(","))},d=>{o(d)},r)}),l}catch{}finally{r.cachedLocationExpiry&&(yt={time:Date.now(),coords:l})}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 hr=/^(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,Ci=/^([+-]?[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,})$/,Ni=/^(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,Oi=/^(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,ki=/^(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,Ri=/^(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 dr(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(M=>Number(M.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),l=Math.abs(n),a=t>0?"N":"S",o=n>0?"E":"W";let d;i=="DD"&&(d=`${r}° ${a}, ${l}° ${o}`);const c=Math.floor(r),L=Math.floor(l),_=(r-c)*60,C=(l-L)*60;if(i=="DM"){let M=Pi(_,3).toFixed(3).padStart(6,"0"),N=Pi(C,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&N.endsWith(".000")&&(M=M.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),d=`${c}° ${M}' ${a}, ${L}° ${N}' ${o}`}if(i=="DMS"){const M=Math.floor(_),N=Math.floor(C);let A=((_-M)*60).toFixed(1).padStart(4,"0"),k=((C-N)*60).toFixed(1).padStart(4,"0");const O=M.toString().padStart(2,"0"),S=N.toString().padStart(2,"0");A.endsWith(".0")&&k.endsWith(".0")&&(A=A.replace(/\.0$/,""),k=k.replace(/\.0$/,"")),d=`${c}° ${O}' ${A}" ${a}, ${L}° ${S}' ${k}" ${o}`}return d}else throw new Error("no decimal coordinates to convert")}function Pi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function Kt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",l="",a=null,o=[],d=!1;if(hr.test(i))throw new Error("invalid coordinate value");if(Ci.test(i))if(o=Ci.exec(i),d=bt(o),d)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1),a="DM";else throw new Error("invalid coordinate format");else if(Ni.test(i))if(o=Ni.exec(i),d=bt(o),d){if(t=o[2],n=o[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");o[1]?(r=o[1],l=o[5]):o[4]&&(r=o[4],l=o[8])}else throw new Error("invalid decimal coordinate format");else if(Oi.test(i))if(o=Oi.exec(i),d=bt(o),d)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],l=o[8]):o[7]&&(r=o[7],l=o[14]);else throw new Error("invalid DMS coordinates format");else if(ki.test(i))if(o=ki.exec(i),d=bt(o),d)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6]/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],l=o[9]):o[8]&&(r=o[8],l=o[16]);else throw new Error("invalid DMS coordinates format");else if(Ri.test(i)){if(o=Ri.exec(i),d=bt(o),o.filter(c=>c).length<=5)throw new Error("invalid coordinates format");if(d)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],l=o[9]):o[8]&&(r=o[8],l=o[16]);else throw new Error("invalid coordinates format")}if(d){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!l||!r&&l)throw new Error("invalid coordinates value");if(r&&r==l)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(l)&&n>0&&(n=-1*n);const L=o[0].trim();let _,C;const M=/[,/;\u0020]/g,N=L.match(M);if(N==null){const O=Math.floor(i.length/2);_=L.substring(0,O).trim(),C=L.substring(O).trim()}else{let O;N.length%2==1?O=Math.floor(N.length/2):O=N.length/2-1;let S=0;if(O==0)S=L.indexOf(N[0]),_=L.substring(0,S).trim(),C=L.substring(S+1).trim();else{let R=0,W=0;for(;R<=O;)S=L.indexOf(N[R],W),W=S+1,R++;_=L.substring(0,S).trim(),C=L.substring(S+1).trim()}}const A=_.split(".");if(A.length==2&&A[1]==0&&A[1].length!=2)throw new Error("invalid coordinates format");const k=C.split(".");if(k.length==2&&k[1]==0&&k[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(_)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:L,verbatimLatitude:_,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:gr,toCoordinateFormat:dr})}else throw new Error("coordinates pattern match failed")}function bt(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 l=0;l<r;l++){const a=e[l],o=e[l+r],d=t.test(a)&&t.test(o),c=n.test(a)&&n.test(o),L=a==o;if(!(a==null&&o==null)){if(a==null||o==null)return!1;if(d||c||L)continue;return!1}}return!0}function Ai(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function gr(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 Ai(this.decimalLatitude,Number(e[0]))&&Ai(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"});Kt.to=mr;const pr=[{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"}],yr={decimalLatitude:40.123,decimalLongitude:-74.123},br=[{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}],vr=[{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 wr(){const i=[];return pr.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...yr})}),[...i,...br,...vr]}const Er=wr();Kt.formats=Er.map(i=>i.verbatimCoordinates);const Lr=Kt;function Ii(i,e,t){const n=i.slice();return n[97]=e[t],n[99]=t,n}function Bi(i){let e,t;return e=new ir({}),{c(){Xe(e.$$.fragment)},m(n,r){Fe(e,n,r),t=!0},i(n){t||(le(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){qe(e,n)}}}function Gi(i){let e,t,n,r,l;return t=new lr({}),{c(){e=J("button"),Xe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),Ae(e,"active",i[0])},m(a,o){ne(a,e,o),Fe(t,e,null),n=!0,r||(l=fe(e,"click",i[79]),r=!0)},p(a,o){(!n||o[0]&1024)&&x(e,"title",a[10]),(!n||o[0]&1)&&Ae(e,"active",a[0])},i(a){n||(le(t.$$.fragment,a),n=!0)},o(a){de(t.$$.fragment,a),n=!1},d(a){a&&ie(e),qe(t),r=!1,l()}}}function _r(i){let e,t=[],n=new Map,r,l,a,o=Si(i[13]);const d=c=>c[97].id+(c[97].address?","+c[97].address:"");for(let c=0;c<o.length;c+=1){let L=Ii(i,o,c),_=d(L);n.set(_,t[c]=zi(_,L))}return{c(){e=J("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,L){ne(c,e,L);for(let _=0;_<t.length;_+=1)t[_]&&t[_].m(e,null);r=!0,l||(a=[fe(e,"mouseleave",i[27]),fe(e,"blur",i[83]),fe(e,"keydown",i[23])],l=!0)},p(c,L){L[0]&102823936&&(o=Si(c[13]),Rt(),t=Wn(t,L,d,1,c,o,n,e,zn,zi,null,Ii),Pt())},i(c){if(!r){for(let L=0;L<o.length;L+=1)le(t[L]);r=!0}},o(c){for(let L=0;L<t.length;L+=1)de(t[L]);r=!1},d(c){c&&ie(e);for(let L=0;L<t.length;L+=1)t[L].d();l=!1,Ue(a)}}}function Sr(i){let e,t,n,r,l,a;return t=new Ti({}),{c(){e=J("div"),Xe(t.$$.fragment),n=we(),r=J("div"),l=Ye(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(o,d){ne(o,e,d),Fe(t,e,null),Z(e,n),Z(e,r),Z(r,l),a=!0},p(o,d){(!a||d[0]&256)&&dt(l,o[8])},i(o){a||(le(t.$$.fragment,o),a=!0)},o(o){de(t.$$.fragment,o),a=!1},d(o){o&&ie(e),qe(t)}}}function xr(i){let e="",t;return{c(){t=Ye(e)},m(n,r){ne(n,t,r)},p:te,i:te,o:te,d(n){n&&ie(t)}}}function Tr(i){let e,t,n,r,l,a,o,d,c,L,_;return t=new Ti({}),d=new xi({}),{c(){e=J("div"),Xe(t.$$.fragment),n=we(),r=J("div"),l=Ye(i[7]),a=we(),o=J("button"),Xe(d.$$.fragment),x(r,"class","svelte-bz0zu3"),x(o,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(C,M){ne(C,e,M),Fe(t,e,null),Z(e,n),Z(e,r),Z(r,l),Z(e,a),Z(e,o),Fe(d,o,null),c=!0,L||(_=fe(o,"click",i[80]),L=!0)},p(C,M){(!c||M[0]&128)&&dt(l,C[7])},i(C){c||(le(t.$$.fragment,C),le(d.$$.fragment,C),c=!0)},o(C){de(t.$$.fragment,C),de(d.$$.fragment,C),c=!1},d(C){C&&ie(e),qe(t),qe(d),L=!1,_()}}}function zi(i,e){var o;let t,n,r;function l(){return e[81](e[99])}function a(){return e[82](e[97])}return n=new er({props:{feature:e[97],showPlaceType:e[11],style:e[15]===e[99]?"selected":((o=e[14])==null?void 0:o.id)===e[97].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",l),n.$on("select",a),{key:i,first:null,c(){t=Cn(),Xe(n.$$.fragment),this.first=t},m(d,c){ne(d,t,c),Fe(n,d,c),r=!0},p(d,c){var _;e=d;const L={};c[0]&8192&&(L.feature=e[97]),c[0]&2048&&(L.showPlaceType=e[11]),c[0]&57344&&(L.style=e[15]===e[99]?"selected":((_=e[14])==null?void 0:_.id)===e[97].id?"picked":"default"),c[0]&4096&&(L.iconsBaseUrl=e[12]),n.$set(L)},i(d){r||(le(n.$$.fragment,d),r=!0)},o(d){de(n.$$.fragment,d),r=!1},d(d){d&&ie(t),qe(n,d)}}}function Mr(i){let e,t,n,r,l,a,o,d,c,L,_,C,M,N,A,k,O,S,R,W,H,D=!1;l=new ar({}),_=new xi({});let B=i[20]&&Bi(),s=i[6]==="button"&&Gi(i);const u=i[70].default,f=Sn(u,i,i[69],null),m=[Tr,xr,Sr,_r],h=[];function b(p,g){var y,v;return p[19]?0:!p[16]&&!p[4]?1:((y=p[13])==null?void 0:y.length)===0?2:(v=p[13])!=null&&v.length&&(p[16]||p[4])?3:-1}return~(k=b(i))&&(O=h[k]=m[k](i)),{c(){e=we(),t=J("form"),n=J("div"),r=J("button"),Xe(l.$$.fragment),a=we(),o=J("input"),d=we(),c=J("div"),L=J("button"),Xe(_.$$.fragment),C=we(),B&&B.c(),M=we(),s&&s.c(),N=we(),f&&f.c(),A=we(),O&&O.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(o,"placeholder",i[9]),x(o,"aria-label",i[9]),x(o,"class","svelte-bz0zu3"),x(L,"type","button"),x(L,"title",i[3]),x(L,"class","svelte-bz0zu3"),x(c,"class","clear-button-container svelte-bz0zu3"),Ae(c,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",S=Ot(i[2])+" svelte-bz0zu3"),Ae(t,"can-collapse",i[5]&&i[1]==="")},m(p,g){ne(p,e,g),ne(p,t,g),Z(t,n),Z(n,r),Fe(l,r,null),Z(n,a),Z(n,o),i[72](o),vi(o,i[1]),Z(n,d),Z(n,c),Z(c,L),Fe(_,L,null),Z(c,C),B&&B.m(c,null),Z(n,M),s&&s.m(n,null),Z(n,N),f&&f.m(n,null),Z(t,A),~k&&h[k].m(t,null),R=!0,W||(H=[fe(r,"click",i[71]),fe(o,"input",i[73]),fe(o,"focus",i[74]),fe(o,"blur",i[75]),fe(o,"click",i[76]),fe(o,"keydown",i[23]),fe(o,"input",i[24]),fe(o,"change",i[77]),fe(L,"click",i[78]),fe(t,"submit",Nn(i[22]))],W=!0)},p(p,g){(!R||g[0]&512)&&x(o,"placeholder",p[9]),(!R||g[0]&512)&&x(o,"aria-label",p[9]),g[0]&2&&o.value!==p[1]&&vi(o,p[1]),(!R||g[0]&8)&&x(L,"title",p[3]),p[20]?B?g[0]&1048576&&le(B,1):(B=Bi(),B.c(),le(B,1),B.m(c,null)):B&&(Rt(),de(B,1,1,()=>{B=null}),Pt()),(!R||g[0]&2)&&Ae(c,"displayable",p[1]!==""),p[6]==="button"?s?(s.p(p,g),g[0]&64&&le(s,1)):(s=Gi(p),s.c(),le(s,1),s.m(n,N)):s&&(Rt(),de(s,1,1,()=>{s=null}),Pt()),f&&f.p&&(!R||g[2]&128)&&Tn(f,u,p,p[69],R?xn(u,p[69],g,null):Mn(p[69]),null);let y=k;k=b(p),k===y?~k&&h[k].p(p,g):(O&&(Rt(),de(h[y],1,1,()=>{h[y]=null}),Pt()),~k?(O=h[k],O?O.p(p,g):(O=h[k]=m[k](p),O.c()),le(O,1),O.m(t,null)):O=null),(!R||g[0]&4&&S!==(S=Ot(p[2])+" svelte-bz0zu3"))&&x(t,"class",S),(!R||g[0]&38)&&Ae(t,"can-collapse",p[5]&&p[1]==="")},i(p){R||(le(D),le(l.$$.fragment,p),le(_.$$.fragment,p),le(B),le(s),le(f,p),le(O),R=!0)},o(p){de(D),de(l.$$.fragment,p),de(_.$$.fragment,p),de(B),de(s),de(f,p),de(O),R=!1},d(p){p&&(ie(e),ie(t)),qe(l),i[72](null),qe(_),B&&B.d(),s&&s.d(),f&&f.d(p),~k&&h[k].d(),W=!1,Ue(H)}}}function Cr(i,e,t){let n,r,l,{$$slots:a={},$$scope:o}=e;const d={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:L}=e,{bbox:_=void 0}=e,{clearButtonTitle:C="clear"}=e,{clearOnBlur:M=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:A=!1}=e,{collapsed:k=!1}=e,{country:O=void 0}=e,{debounceSearch:S=200}=e,{enableReverse:R="never"}=e,{errorMessage:W="Something went wrong…"}=e,{filter:H=()=>!0}=e,{flyTo:D=!0}=e,{fuzzyMatch:B=!0}=e,{language:s=void 0}=e,{limit:u=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:h=void 0}=e,{minLength:b=2}=e,{noResultsMessage:p="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:g="Search"}=e,{proximity:y=[{type:"server-geolocation"}]}=e,{reverseActive:v=R==="always"}=e,{reverseButtonTitle:w="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:P="full-geometry"}=e,{showPlaceType:G="if-needed"}=e,{showResultsWhileTyping:j=!0}=e,{selectFirst:Y=!0}=e,{flyToSelected:re=!1}=e,{markerOnSelected:q=!0}=e,{types:V=void 0}=e;const ce=[];let{reverseGeocodingTypes:He=ce}=e,{exhaustiveReverseGeocoding:st=!1}=e,{excludeTypes:ot=!1}=e;const _e=void 0;let{reverseGeocodingExcludeTypes:Ge=_e}=e,{zoom:me=d}=e,{apiUrl:he="https://api.maptiler.com/geocoding"}=e,{fetchParameters:ee={}}=e,{iconsBaseUrl:hn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.1/icons/"}=e,{adjustUrlQuery:ri=()=>{}}=e,{adjustUrl:si=()=>{}}=e;function os(E){Pe.focus(E)}function ls(){Pe.blur()}function dn(E,oe=!0,ue=!1){t(1,T=E),oe?(t(15,X=-1),mn()):(pn(void 0,!ue,ue),setTimeout(()=>{Pe.focus(),Pe.select()}))}function us(){t(13,F=void 0),t(14,z=void 0),t(15,X=-1)}function as(){t(64,ae=[]),t(14,z=void 0)}let F,ae,z,gn="",Pe,X=-1,ze,Ut=[],lt,ct,ht,oi,Ve=!1;const fs=new Set,et=Ei();Rn(()=>{h&&(h.setEventHandler(void 0),h.indicateReverse(!1),h.setSelectedMarker(-1),h.setFeatures(void 0,void 0,!1))});function mn(E){if(t(17,Ve=!1),ct&&(clearTimeout(ct),ct=void 0),X>-1&&F)t(14,z=F[X]),t(1,T=z.place_type[0]==="reverse"?z.place_name:z.place_name.replace(/,.*/,"")),t(19,ze=void 0),t(64,ae=void 0),t(15,X=-1);else if(T){const oe=E||!li(T);ui(T,{exact:!0}).then(()=>{t(64,ae=F),t(14,z=void 0),oe&&cs()}).catch(ue=>t(19,ze=ue))}}function li(E){try{return Lr(E,6)}catch{return!1}}async function ui(E,{byId:oe=!1,exact:ue=!1}={}){var xe,We,tt;t(19,ze=void 0),lt==null||lt.abort();const Se=new AbortController;t(20,lt=Se);try{const Q=li(E),xt=new URL(he+"/"+encodeURIComponent(Q?Q.decimalLongitude+","+Q.decimalLatitude:E)+".json"),Oe=xt.searchParams;s!==void 0&&Oe.set("language",Array.isArray(s)?s.join(","):s??"");const[ci]=(h==null?void 0:h.getCenterAndZoom())??[];let De=(xe=!Q||He===ce?V:He)==null?void 0:xe.map(ye=>typeof ye=="string"?ye:ci===void 0||(ye[0]??0)<=ci&&ci<(ye[1]??1/0)?ye[2]:void 0).filter(ye=>ye!==void 0);De&&(De=[...new Set(De)],Oe.set("types",De.join(",")));const bn=!Q||Ge===_e?ot:Ge;if(bn&&Oe.set("excludeTypes",String(bn)),_&&Oe.set("bbox",_.map(ye=>ye.toFixed(6)).join(",")),O&&Oe.set("country",Array.isArray(O)?O.join(","):O),!oe&&!Q){const ye=await cr(h,y,Se);ye&&Oe.set("proximity",ye),(ue||!j)&&Oe.set("autocomplete","false"),Oe.set("fuzzyMatch",String(B))}const Tt=m===f?u:m;Tt!==void 0&&Tt>1&&(De==null?void 0:De.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),Q?(Tt===1||Tt!==void 0&&(st||(De==null?void 0:De.length)===1))&&Oe.set("limit",String(Tt)):u!==void 0&&Oe.set("limit",String(u)),Oe.set("key",L),ri(Oe),si(xt);const Cs=xt.searchParams.get("types")===""&&xt.searchParams.get("excludeTypes")!=="true",Ft=xt.toString();if(Ft===gn){oe?(N&&t(13,F=void 0),t(14,z=Ut[0])):(t(13,F=Ut),((We=F[X])==null?void 0:We.id)!==(r==null?void 0:r.id)&&t(15,X=-1));return}gn=Ft;let Mt;if(Cs)Mt={type:"FeatureCollection",features:[]};else{const ye=await fetch(Ft,{signal:Se.signal,...ee});if(!ye.ok)throw new Error(await ye.text());Mt=await ye.json()}et("response",{url:Ft,featureCollection:Mt}),oe?(N&&t(13,F=void 0),t(14,z=Mt.features[0]),Ut=[z]):(t(13,F=Mt.features.filter(H)),Q&&F.unshift({type:"Feature",properties:{},id:"reverse_"+Q.decimalLongitude+"_"+Q.decimalLatitude,text:Q.decimalLatitude+", "+Q.decimalLongitude,place_name:Q.decimalLatitude+", "+Q.decimalLongitude,place_type:["reverse"],center:[Q.decimalLongitude,Q.decimalLatitude],bbox:[Q.decimalLongitude,Q.decimalLatitude,Q.decimalLongitude,Q.decimalLatitude],geometry:{type:"Point",coordinates:[Q.decimalLongitude,Q.decimalLatitude]}}),Ut=F,((tt=F[X])==null?void 0:tt.id)!==(r==null?void 0:r.id)&&t(15,X=-1),Q&&Pe.focus())}catch(Q){if(Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError")return;throw Q}finally{Se===lt&&t(20,lt=void 0)}}function cs(){var Se;if(!(ae!=null&&ae.length)||!D)return;const E=[180,90,-180,-90],oe=!ae.some(xe=>!xe.matching_text);let ue;for(const xe of ae){const We=St(xe);if(ue=ue===void 0?We:We===void 0?ue:Math.max(ue,We),oe||!xe.matching_text)for(const tt of[0,1,2,3])E[tt]=Math[tt<2?"min":"max"](E[tt],((Se=xe.bbox)==null?void 0:Se[tt])??xe.center[tt%2])}h&&ae.length>0&&(z&&E[0]===E[2]&&E[1]===E[3]?h.flyTo(z.center,St(z)):h.fitBounds(pt(E),50,ue))}function ai(){!z||!h||(!z.bbox||z.bbox[0]===z.bbox[2]&&z.bbox[1]===z.bbox[3]?h.flyTo(z.center,St(z)):h.fitBounds(pt(z.bbox),50,St(z)))}function St(E){var ue;if(!E.bbox||E.bbox[0]!==E.bbox[2]&&E.bbox[1]!==E.bbox[3])return;const oe=E.id.replace(/\..*/,"");return(Array.isArray((ue=E.properties)==null?void 0:ue.categories)?E.properties.categories.reduce((Se,xe)=>{const We=me[oe+"."+xe];return Se===void 0?We:We===void 0?Se:Math.max(Se,We)},void 0):void 0)??me[oe]}function hs(E){t(0,v=R==="always"),t(13,F=void 0),t(14,z=void 0),t(15,X=-1),dn(E[1].toFixed(6)+", "+fr(E[0],[-180,180],!0).toFixed(6),!1,!0)}function ds(E){if(!F)return;let oe=E.key==="ArrowDown"?1:E.key==="ArrowUp"?-1:0;oe&&(Pe.focus(),t(17,Ve=!0),E.preventDefault(),z&&X===-1&&t(15,X=F.findIndex(ue=>ue.id===(z==null?void 0:z.id))),X===(z||Y?0:-1)&&oe===-1&&t(15,X=F.length),t(15,X+=oe),X>=F.length&&t(15,X=-1),X<0&&(z||Y)&&t(15,X=0))}function pn(E,oe=!0,ue=!1){if(t(19,ze=void 0),t(14,z=void 0),t(17,Ve=!0),j||ue){if(ct&&clearTimeout(ct),T.length<b)return;const Se=T;ct=window.setTimeout(()=>{ui(Se).catch(xe=>t(19,ze=xe))},oe?S:0)}else t(13,F=void 0),t(19,ze=void 0)}function fi(E){z&&(z==null?void 0:z.id)===(E==null?void 0:E.id)?ai():(t(14,z=E),t(1,T=E.place_name))}function yn(E){t(15,X=E)}function gs(){(!Y||z)&&t(15,X=-1),re&&ai()}const ms=()=>Pe.focus();function ps(E){jt[E?"unshift":"push"](()=>{Pe=E,t(18,Pe)})}function ys(){T=this.value,t(1,T),t(17,Ve),t(31,M),t(16,ht)}const bs=()=>t(17,Ve=!0),vs=()=>t(17,Ve=!1),ws=()=>t(17,Ve=!0),Es=()=>t(14,z=void 0),Ls=()=>{t(1,T=""),Pe.focus()},_s=()=>t(0,v=!v),Ss=()=>t(19,ze=void 0),xs=E=>yn(E),Ts=E=>fi(E),Ms=()=>{};return i.$$set=E=>{"class"in E&&t(2,c=E.class),"apiKey"in E&&t(29,L=E.apiKey),"bbox"in E&&t(30,_=E.bbox),"clearButtonTitle"in E&&t(3,C=E.clearButtonTitle),"clearOnBlur"in E&&t(31,M=E.clearOnBlur),"clearListOnPick"in E&&t(32,N=E.clearListOnPick),"keepListOpen"in E&&t(4,A=E.keepListOpen),"collapsed"in E&&t(5,k=E.collapsed),"country"in E&&t(33,O=E.country),"debounceSearch"in E&&t(34,S=E.debounceSearch),"enableReverse"in E&&t(6,R=E.enableReverse),"errorMessage"in E&&t(7,W=E.errorMessage),"filter"in E&&t(35,H=E.filter),"flyTo"in E&&t(36,D=E.flyTo),"fuzzyMatch"in E&&t(37,B=E.fuzzyMatch),"language"in E&&t(38,s=E.language),"limit"in E&&t(39,u=E.limit),"reverseGeocodingLimit"in E&&t(40,m=E.reverseGeocodingLimit),"mapController"in E&&t(41,h=E.mapController),"minLength"in E&&t(42,b=E.minLength),"noResultsMessage"in E&&t(8,p=E.noResultsMessage),"placeholder"in E&&t(9,g=E.placeholder),"proximity"in E&&t(43,y=E.proximity),"reverseActive"in E&&t(0,v=E.reverseActive),"reverseButtonTitle"in E&&t(10,w=E.reverseButtonTitle),"searchValue"in E&&t(1,T=E.searchValue),"pickedResultStyle"in E&&t(44,P=E.pickedResultStyle),"showPlaceType"in E&&t(11,G=E.showPlaceType),"showResultsWhileTyping"in E&&t(45,j=E.showResultsWhileTyping),"selectFirst"in E&&t(46,Y=E.selectFirst),"flyToSelected"in E&&t(47,re=E.flyToSelected),"markerOnSelected"in E&&t(48,q=E.markerOnSelected),"types"in E&&t(49,V=E.types),"reverseGeocodingTypes"in E&&t(50,He=E.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in E&&t(51,st=E.exhaustiveReverseGeocoding),"excludeTypes"in E&&t(52,ot=E.excludeTypes),"reverseGeocodingExcludeTypes"in E&&t(53,Ge=E.reverseGeocodingExcludeTypes),"zoom"in E&&t(54,me=E.zoom),"apiUrl"in E&&t(55,he=E.apiUrl),"fetchParameters"in E&&t(56,ee=E.fetchParameters),"iconsBaseUrl"in E&&t(12,hn=E.iconsBaseUrl),"adjustUrlQuery"in E&&t(57,ri=E.adjustUrlQuery),"adjustUrl"in E&&t(58,si=E.adjustUrl),"$$scope"in E&&t(69,o=E.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,v=R==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&P!=="marker-only"&&z&&!z.address&&z.geometry.type==="Point"&&z.place_type[0]!=="reverse"&&ui(z.id,{byId:!0}).catch(E=>t(19,ze=E)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&8&&(h&&z&&z.id!==oi&&D&&(ai(),N&&t(13,F=void 0),t(64,ae=void 0),t(15,X=-1)),t(65,oi=z==null?void 0:z.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,ht=Ve),M&&!ht&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<b&&(t(13,F=void 0),t(19,ze=void 0),t(64,ae=F)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&Y&&F!=null&&F.length&&X==-1&&!z&&t(15,X=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&4&&ae!==F&&t(64,ae=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&h&&h.setEventHandler(E=>{switch(E.type){case"mapClick":v&&hs(E.coordinates);break;case"markerClick":{const oe=F==null?void 0:F.find(ue=>ue.id===E.id);oe&&fi(oe)}break;case"markerMouseEnter":ae&&t(15,X=ht?(F==null?void 0:F.findIndex(oe=>oe.id===E.id))??-1:-1);break;case"markerMouseLeave":ae&&t(15,X=-1);break}}),i.$$.dirty[0]&40960&&t(66,r=F==null?void 0:F[X]),i.$$.dirty[1]&66592|i.$$.dirty[2]&16&&h&&r&&D&&re&&h.flyTo(r.center,St(r)),i.$$.dirty[1]&8192&&t(68,n=P==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&132096|i.$$.dirty[2]&64&&(q||h==null||h.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&132096|i.$$.dirty[2]&84&&h&&q&&!ae&&(h.setFeatures(r?[r]:void 0,z,n),h.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&68&&h&&h.setFeatures(ae,z,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&ae&&h&&h.setSelectedMarker(X),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&h){const E=li(T);h.setReverseMarker(E?[E.decimalLongitude,E.decimalLatitude]:void 0)}i.$$.dirty[2]&16&&et("select",{feature:r}),i.$$.dirty[0]&16384&&et("pick",{feature:z}),i.$$.dirty[0]&73744&&t(67,l=!!(F!=null&&F.length)&&(ht||A)),i.$$.dirty[2]&32&&et("optionsvisibilitychange",{optionsVisible:l}),i.$$.dirty[0]&8192&&et("featureslisted",{features:F}),i.$$.dirty[2]&4&&et("featuresmarked",{features:ae}),i.$$.dirty[0]&1&&et("reversetoggle",{reverse:v}),i.$$.dirty[0]&2&&et("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&h&&h.indicateReverse(v)},[v,T,c,C,A,k,R,W,p,g,w,G,hn,F,z,X,ht,Ve,Pe,ze,lt,fs,mn,ds,pn,fi,yn,gs,d,L,_,M,N,O,S,H,D,B,s,u,m,h,b,y,P,j,Y,re,q,V,He,st,ot,Ge,me,he,ee,ri,si,os,ls,dn,us,as,ae,oi,r,l,n,o,a,ms,ps,ys,bs,vs,ws,Es,Ls,_s,Ss,xs,Ts,Ms]}let Nr=class extends Je{constructor(e){super(),Qe(this,e,Cr,Mr,Ke,{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 vt(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 Yt(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 l=0;l<r[r.length-1].length;l++)if(r[r.length-1][l]!==r[0][l])throw new Error("First and last Position are not equivalent.")}return vt({type:"Polygon",coordinates:i},e,t)}function wt(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Wi(i,e,t={}){return vt({type:"MultiPolygon",coordinates:i},e,t)}function Di(i,e,t){if(i!==null)for(var n,r,l,a,o,d,c,L=0,_=0,C,M=i.type,N=M==="FeatureCollection",A=M==="Feature",k=N?i.features.length:1,O=0;O<k;O++){c=N?i.features[O].geometry:A?i.geometry:i,C=c?c.type==="GeometryCollection":!1,o=C?c.geometries.length:1;for(var S=0;S<o;S++){var R=0,W=0;if(a=C?c.geometries[S]:c,a!==null){d=a.coordinates;var H=a.type;switch(L=0,H){case null:break;case"Point":if(e(d,_,O,R,W)===!1)return!1;_++,R++;break;case"LineString":case"MultiPoint":for(n=0;n<d.length;n++){if(e(d[n],_,O,R,W)===!1)return!1;_++,H==="MultiPoint"&&R++}H==="LineString"&&R++;break;case"Polygon":case"MultiLineString":for(n=0;n<d.length;n++){for(r=0;r<d[n].length-L;r++){if(e(d[n][r],_,O,R,W)===!1)return!1;_++}H==="MultiLineString"&&R++,H==="Polygon"&&W++}H==="Polygon"&&R++;break;case"MultiPolygon":for(n=0;n<d.length;n++){for(W=0,r=0;r<d[n].length;r++){for(l=0;l<d[n][r].length-L;l++){if(e(d[n][r][l],_,O,R,W)===!1)return!1;_++}W++}R++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Di(a.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Xt(i,e){var t,n,r,l,a,o,d,c,L,_,C=0,M=i.type==="FeatureCollection",N=i.type==="Feature",A=M?i.features.length:1;for(t=0;t<A;t++){for(o=M?i.features[t].geometry:N?i.geometry:i,c=M?i.features[t].properties:N?i.properties:{},L=M?i.features[t].bbox:N?i.bbox:void 0,_=M?i.features[t].id:N?i.id:void 0,d=o?o.type==="GeometryCollection":!1,a=d?o.geometries.length:1,r=0;r<a;r++){if(l=d?o.geometries[r]:o,l===null){if(e(null,C,c,L,_)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(l,C,c,L,_)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<l.geometries.length;n++)if(e(l.geometries[n],C,c,L,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function Or(i,e){Xt(i,function(t,n,r,l,a){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(vt(t,r,{bbox:l,id:a}),n,0)===!1?!1:void 0}var d;switch(o){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var c=0;c<t.coordinates.length;c++){var L=t.coordinates[c],_={type:d,coordinates:L};if(e(vt(_,r),n,c)===!1)return!1}})}function kr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Di(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 Qt=kr;function Rr(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return Ui(i);case"FeatureCollection":return Pr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Jt(i);default:throw new Error("unknown GeoJSON type")}}function Ui(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=Fi(i.properties),i.geometry==null?e.geometry=null:e.geometry=Jt(i.geometry),e}function Fi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=Fi(n):e[t]=n}),e}function Pr(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>Ui(t)),e}function Jt(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Jt(t)),e):(e.coordinates=qi(i.coordinates),e)}function qi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>qi(t))}var Ar=Rr,Ir=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$t=Math.ceil,Me=Math.floor,ve="[BigNumber Error] ",ji=ve+"Number primitive has more than 15 significant digits: ",Re=1e14,U=14,Zi=9007199254740991,ei=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],$e=1e7,Ee=1e9;function Hi(i){var e,t,n,r=S.prototype={constructor:S,toString:null,valueOf:null},l=new S(1),a=20,o=4,d=-7,c=21,L=-1e7,_=1e7,C=!1,M=1,N=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function S(s,u){var f,m,h,b,p,g,y,v,w=this;if(!(w instanceof S))return new S(s,u);if(u==null){if(s&&s._isBigNumber===!0){w.s=s.s,!s.c||s.e>_?w.c=w.e=null:s.e<L?w.c=[w.e=0]:(w.e=s.e,w.c=s.c.slice());return}if((g=typeof s=="number")&&s*0==0){if(w.s=1/s<0?(s=-s,-1):1,s===~~s){for(b=0,p=s;p>=10;p/=10,b++);b>_?w.c=w.e=null:(w.e=b,w.c=[s]);return}v=String(s)}else{if(!Ir.test(v=String(s)))return n(w,v,g);w.s=v.charCodeAt(0)==45?(v=v.slice(1),-1):1}(b=v.indexOf("."))>-1&&(v=v.replace(".","")),(p=v.search(/e/i))>0?(b<0&&(b=p),b+=+v.slice(p+1),v=v.substring(0,p)):b<0&&(b=v.length)}else{if(se(u,2,k.length,"Base"),u==10&&O)return w=new S(s),D(w,a+w.e+1,o);if(v=String(s),g=typeof s=="number"){if(s*0!=0)return n(w,v,g,u);if(w.s=1/s<0?(v=v.slice(1),-1):1,S.DEBUG&&v.replace(/^0\.0*|\./,"").length>15)throw Error(ji+s)}else w.s=v.charCodeAt(0)===45?(v=v.slice(1),-1):1;for(f=k.slice(0,u),b=p=0,y=v.length;p<y;p++)if(f.indexOf(m=v.charAt(p))<0){if(m=="."){if(p>b){b=y;continue}}else if(!h&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){h=!0,p=-1,b=0;continue}return n(w,String(s),g,u)}g=!1,v=t(v,u,10,w.s),(b=v.indexOf("."))>-1?v=v.replace(".",""):b=v.length}for(p=0;v.charCodeAt(p)===48;p++);for(y=v.length;v.charCodeAt(--y)===48;);if(v=v.slice(p,++y)){if(y-=p,g&&S.DEBUG&&y>15&&(s>Zi||s!==Me(s)))throw Error(ji+w.s*s);if((b=b-p-1)>_)w.c=w.e=null;else if(b<L)w.c=[w.e=0];else{if(w.e=b,w.c=[],p=(b+1)%U,b<0&&(p+=U),p<y){for(p&&w.c.push(+v.slice(0,p)),y-=U;p<y;)w.c.push(+v.slice(p,p+=U));p=U-(v=v.slice(p)).length}else p-=y;for(;p--;v+="0");w.c.push(+v)}}else w.c=[w.e=0]}S.clone=Hi,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(s){var u,f;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(u="DECIMAL_PLACES")&&(f=s[u],se(f,0,Ee,u),a=f),s.hasOwnProperty(u="ROUNDING_MODE")&&(f=s[u],se(f,0,8,u),o=f),s.hasOwnProperty(u="EXPONENTIAL_AT")&&(f=s[u],f&&f.pop?(se(f[0],-1e9,0,u),se(f[1],0,Ee,u),d=f[0],c=f[1]):(se(f,-1e9,Ee,u),d=-(c=f<0?-f:f))),s.hasOwnProperty(u="RANGE"))if(f=s[u],f&&f.pop)se(f[0],-1e9,-1,u),se(f[1],1,Ee,u),L=f[0],_=f[1];else if(se(f,-1e9,Ee,u),f)L=-(_=f<0?-f:f);else throw Error(ve+u+" cannot be zero: "+f);if(s.hasOwnProperty(u="CRYPTO"))if(f=s[u],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))C=f;else throw C=!f,Error(ve+"crypto unavailable");else C=f;else throw Error(ve+u+" not true or false: "+f);if(s.hasOwnProperty(u="MODULO_MODE")&&(f=s[u],se(f,0,9,u),M=f),s.hasOwnProperty(u="POW_PRECISION")&&(f=s[u],se(f,0,Ee,u),N=f),s.hasOwnProperty(u="FORMAT"))if(f=s[u],typeof f=="object")A=f;else throw Error(ve+u+" not an object: "+f);if(s.hasOwnProperty(u="ALPHABET"))if(f=s[u],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))O=f.slice(0,10)=="0123456789",k=f;else throw Error(ve+u+" invalid: "+f)}else throw Error(ve+"Object expected: "+s);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[d,c],RANGE:[L,_],CRYPTO:C,MODULO_MODE:M,POW_PRECISION:N,FORMAT:A,ALPHABET:k}},S.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!S.DEBUG)return!0;var u,f,m=s.c,h=s.e,b=s.s;e:if({}.toString.call(m)=="[object Array]"){if((b===1||b===-1)&&h>=-1e9&&h<=Ee&&h===Me(h)){if(m[0]===0){if(h===0&&m.length===1)return!0;break e}if(u=(h+1)%U,u<1&&(u+=U),String(m[0]).length==u){for(u=0;u<m.length;u++)if(f=m[u],f<0||f>=Re||f!==Me(f))break e;if(f!==0)return!0}}}else if(m===null&&h===null&&(b===null||b===1||b===-1))return!0;throw Error(ve+"Invalid BigNumber: "+s)},S.maximum=S.max=function(){return W(arguments,-1)},S.minimum=S.min=function(){return W(arguments,1)},S.random=function(){var s=9007199254740992,u=Math.random()*s&2097151?function(){return Me(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,h,b,p,g,y=0,v=[],w=new S(l);if(f==null?f=a:se(f,0,Ee),p=$t(f/U),C)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));y<p;)g=m[y]*131072+(m[y+1]>>>11),g>=9e15?(h=crypto.getRandomValues(new Uint32Array(2)),m[y]=h[0],m[y+1]=h[1]):(v.push(g%1e14),y+=2);y=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);y<p;)g=(m[y]&31)*281474976710656+m[y+1]*1099511627776+m[y+2]*4294967296+m[y+3]*16777216+(m[y+4]<<16)+(m[y+5]<<8)+m[y+6],g>=9e15?crypto.randomBytes(7).copy(m,y):(v.push(g%1e14),y+=7);y=p/7}else throw C=!1,Error(ve+"crypto unavailable");if(!C)for(;y<p;)g=u(),g<9e15&&(v[y++]=g%1e14);for(p=v[--y],f%=U,p&&f&&(g=ei[U-f],v[y]=Me(p/g)*g);v[y]===0;v.pop(),y--);if(y<0)v=[b=0];else{for(b=-1;v[0]===0;v.splice(0,1),b-=U);for(y=1,g=v[0];g>=10;g/=10,y++);y<U&&(b-=U-y)}return w.e=b,w.c=v,w}}(),S.sum=function(){for(var s=1,u=arguments,f=new S(u[0]);s<u.length;)f=f.plus(u[s++]);return f},t=function(){var s="0123456789";function u(f,m,h,b){for(var p,g=[0],y,v=0,w=f.length;v<w;){for(y=g.length;y--;g[y]*=m);for(g[0]+=b.indexOf(f.charAt(v++)),p=0;p<g.length;p++)g[p]>h-1&&(g[p+1]==null&&(g[p+1]=0),g[p+1]+=g[p]/h|0,g[p]%=h)}return g.reverse()}return function(f,m,h,b,p){var g,y,v,w,T,P,G,j,Y=f.indexOf("."),re=a,q=o;for(Y>=0&&(w=N,N=0,f=f.replace(".",""),j=new S(m),P=j.pow(f.length-Y),N=w,j.c=u(je(Ne(P.c),P.e,"0"),10,h,s),j.e=j.c.length),G=u(f,m,h,p?(g=k,s):(g=s,k)),v=w=G.length;G[--w]==0;G.pop());if(!G[0])return g.charAt(0);if(Y<0?--v:(P.c=G,P.e=v,P.s=b,P=e(P,j,re,q,h),G=P.c,T=P.r,v=P.e),y=v+re+1,Y=G[y],w=h/2,T=T||y<0||G[y+1]!=null,T=q<4?(Y!=null||T)&&(q==0||q==(P.s<0?3:2)):Y>w||Y==w&&(q==4||T||q==6&&G[y-1]&1||q==(P.s<0?8:7)),y<1||!G[0])f=T?je(g.charAt(1),-re,g.charAt(0)):g.charAt(0);else{if(G.length=y,T)for(--h;++G[--y]>h;)G[y]=0,y||(++v,G=[1].concat(G));for(w=G.length;!G[--w];);for(Y=0,f="";Y<=w;f+=g.charAt(G[Y++]));f=je(f,v,g.charAt(0))}return f}}(),e=function(){function s(m,h,b){var p,g,y,v,w=0,T=m.length,P=h%$e,G=h/$e|0;for(m=m.slice();T--;)y=m[T]%$e,v=m[T]/$e|0,p=G*y+v*P,g=P*y+p%$e*$e+w,w=(g/b|0)+(p/$e|0)+G*v,m[T]=g%b;return w&&(m=[w].concat(m)),m}function u(m,h,b,p){var g,y;if(b!=p)y=b>p?1:-1;else for(g=y=0;g<b;g++)if(m[g]!=h[g]){y=m[g]>h[g]?1:-1;break}return y}function f(m,h,b,p){for(var g=0;b--;)m[b]-=g,g=m[b]<h[b]?1:0,m[b]=g*p+m[b]-h[b];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,h,b,p,g){var y,v,w,T,P,G,j,Y,re,q,V,ce,He,st,ot,_e,Ge,me=m.s==h.s?1:-1,he=m.c,ee=h.c;if(!he||!he[0]||!ee||!ee[0])return new S(!m.s||!h.s||(he?ee&&he[0]==ee[0]:!ee)?NaN:he&&he[0]==0||!ee?me*0:me/0);for(Y=new S(me),re=Y.c=[],v=m.e-h.e,me=b+v+1,g||(g=Re,v=Ce(m.e/U)-Ce(h.e/U),me=me/U|0),w=0;ee[w]==(he[w]||0);w++);if(ee[w]>(he[w]||0)&&v--,me<0)re.push(1),T=!0;else{for(st=he.length,_e=ee.length,w=0,me+=2,P=Me(g/(ee[0]+1)),P>1&&(ee=s(ee,P,g),he=s(he,P,g),_e=ee.length,st=he.length),He=_e,q=he.slice(0,_e),V=q.length;V<_e;q[V++]=0);Ge=ee.slice(),Ge=[0].concat(Ge),ot=ee[0],ee[1]>=g/2&&ot++;do{if(P=0,y=u(ee,q,_e,V),y<0){if(ce=q[0],_e!=V&&(ce=ce*g+(q[1]||0)),P=Me(ce/ot),P>1)for(P>=g&&(P=g-1),G=s(ee,P,g),j=G.length,V=q.length;u(G,q,j,V)==1;)P--,f(G,_e<j?Ge:ee,j,g),j=G.length,y=1;else P==0&&(y=P=1),G=ee.slice(),j=G.length;if(j<V&&(G=[0].concat(G)),f(q,G,V,g),V=q.length,y==-1)for(;u(ee,q,_e,V)<1;)P++,f(q,_e<V?Ge:ee,V,g),V=q.length}else y===0&&(P++,q=[0]);re[w++]=P,q[0]?q[V++]=he[He]||0:(q=[he[He]],V=1)}while((He++<st||q[0]!=null)&&me--);T=q[0]!=null,re[0]||re.splice(0,1)}if(g==Re){for(w=1,me=re[0];me>=10;me/=10,w++);D(Y,b+(Y.e=w+v*U-1)+1,p,T)}else Y.e=v,Y.r=+T;return Y}}();function R(s,u,f,m){var h,b,p,g,y;if(f==null?f=o:se(f,0,8),!s.c)return s.toString();if(h=s.c[0],p=s.e,u==null)y=Ne(s.c),y=m==1||m==2&&(p<=d||p>=c)?It(y,p):je(y,p,"0");else if(s=D(new S(s),u,f),b=s.e,y=Ne(s.c),g=y.length,m==1||m==2&&(u<=b||b<=d)){for(;g<u;y+="0",g++);y=It(y,b)}else if(u-=p,y=je(y,b,"0"),b+1>g){if(--u>0)for(y+=".";u--;y+="0");}else if(u+=b-g,u>0)for(b+1==g&&(y+=".");u--;y+="0");return s.s<0&&h?"-"+y:y}function W(s,u){for(var f,m,h=1,b=new S(s[0]);h<s.length;h++)m=new S(s[h]),(!m.s||(f=nt(b,m))===u||f===0&&b.s===u)&&(b=m);return b}function H(s,u,f){for(var m=1,h=u.length;!u[--h];u.pop());for(h=u[0];h>=10;h/=10,m++);return(f=m+f*U-1)>_?s.c=s.e=null:f<L?s.c=[s.e=0]:(s.e=f,s.c=u),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(b,p,g,y){var v,w=g?p:p.replace(h,"");if(m.test(w))b.s=isNaN(w)?null:w<0?-1:1;else{if(!g&&(w=w.replace(s,function(T,P,G){return v=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!y||y==v?P:T}),y&&(v=y,w=w.replace(u,"$1").replace(f,"0.$1")),p!=w))return new S(w,v);if(S.DEBUG)throw Error(ve+"Not a"+(y?" base "+y:"")+" number: "+p);b.s=null}b.c=b.e=null}}();function D(s,u,f,m){var h,b,p,g,y,v,w,T=s.c,P=ei;if(T){e:{for(h=1,g=T[0];g>=10;g/=10,h++);if(b=u-h,b<0)b+=U,p=u,y=T[v=0],w=Me(y/P[h-p-1]%10);else if(v=$t((b+1)/U),v>=T.length)if(m){for(;T.length<=v;T.push(0));y=w=0,h=1,b%=U,p=b-U+1}else break e;else{for(y=g=T[v],h=1;g>=10;g/=10,h++);b%=U,p=b-U+h,w=p<0?0:Me(y/P[h-p-1]%10)}if(m=m||u<0||T[v+1]!=null||(p<0?y:y%P[h-p-1]),m=f<4?(w||m)&&(f==0||f==(s.s<0?3:2)):w>5||w==5&&(f==4||m||f==6&&(b>0?p>0?y/P[h-p]:0:T[v-1])%10&1||f==(s.s<0?8:7)),u<1||!T[0])return T.length=0,m?(u-=s.e+1,T[0]=P[(U-u%U)%U],s.e=-u||0):T[0]=s.e=0,s;if(b==0?(T.length=v,g=1,v--):(T.length=v+1,g=P[U-b],T[v]=p>0?Me(y/P[h-p]%P[p])*g:0),m)for(;;)if(v==0){for(b=1,p=T[0];p>=10;p/=10,b++);for(p=T[0]+=g,g=1;p>=10;p/=10,g++);b!=g&&(s.e++,T[0]==Re&&(T[0]=1));break}else{if(T[v]+=g,T[v]!=Re)break;T[v--]=0,g=1}for(b=T.length;T[--b]===0;T.pop());}s.e>_?s.c=s.e=null:s.e<L&&(s.c=[s.e=0])}return s}function B(s){var u,f=s.e;return f===null?s.toString():(u=Ne(s.c),u=f<=d||f>=c?It(u,f):je(u,f,"0"),s.s<0?"-"+u:u)}return r.absoluteValue=r.abs=function(){var s=new S(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,u){return nt(this,new S(s,u))},r.decimalPlaces=r.dp=function(s,u){var f,m,h,b=this;if(s!=null)return se(s,0,Ee),u==null?u=o:se(u,0,8),D(new S(b),s+b.e+1,u);if(!(f=b.c))return null;if(m=((h=f.length-1)-Ce(this.e/U))*U,h=f[h])for(;h%10==0;h/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,u){return e(this,new S(s,u),a,o)},r.dividedToIntegerBy=r.idiv=function(s,u){return e(this,new S(s,u),0,1)},r.exponentiatedBy=r.pow=function(s,u){var f,m,h,b,p,g,y,v,w,T=this;if(s=new S(s),s.c&&!s.isInteger())throw Error(ve+"Exponent not an integer: "+B(s));if(u!=null&&(u=new S(u)),g=s.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!s.c||!s.c[0])return w=new S(Math.pow(+B(T),g?s.s*(2-At(s)):+B(s))),u?w.mod(u):w;if(y=s.s<0,u){if(u.c?!u.c[0]:!u.s)return new S(NaN);m=!y&&T.isInteger()&&u.isInteger(),m&&(T=T.mod(u))}else{if(s.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||g&&T.c[1]>=24e7:T.c[0]<8e13||g&&T.c[0]<=9999975e7)))return b=T.s<0&&At(s)?-0:0,T.e>-1&&(b=1/b),new S(y?1/b:b);N&&(b=$t(N/U+2))}for(g?(f=new S(.5),y&&(s.s=1),v=At(s)):(h=Math.abs(+B(s)),v=h%2),w=new S(l);;){if(v){if(w=w.times(T),!w.c)break;b?w.c.length>b&&(w.c.length=b):m&&(w=w.mod(u))}if(h){if(h=Me(h/2),h===0)break;v=h%2}else if(s=s.times(f),D(s,s.e+1,1),s.e>14)v=At(s);else{if(h=+B(s),h===0)break;v=h%2}T=T.times(T),b?T.c&&T.c.length>b&&(T.c.length=b):m&&(T=T.mod(u))}return m?w:(y&&(w=l.div(w)),u?w.mod(u):b?D(w,N,o,p):w)},r.integerValue=function(s){var u=new S(this);return s==null?s=o:se(s,0,8),D(u,u.e+1,s)},r.isEqualTo=r.eq=function(s,u){return nt(this,new S(s,u))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,u){return nt(this,new S(s,u))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,u){return(u=nt(this,new S(s,u)))===1||u===0},r.isInteger=function(){return!!this.c&&Ce(this.e/U)>this.c.length-2},r.isLessThan=r.lt=function(s,u){return nt(this,new S(s,u))<0},r.isLessThanOrEqualTo=r.lte=function(s,u){return(u=nt(this,new S(s,u)))===-1||u===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(s,u){var f,m,h,b,p=this,g=p.s;if(s=new S(s,u),u=s.s,!g||!u)return new S(NaN);if(g!=u)return s.s=-u,p.plus(s);var y=p.e/U,v=s.e/U,w=p.c,T=s.c;if(!y||!v){if(!w||!T)return w?(s.s=-u,s):new S(T?p:NaN);if(!w[0]||!T[0])return T[0]?(s.s=-u,s):new S(w[0]?p:o==3?-0:0)}if(y=Ce(y),v=Ce(v),w=w.slice(),g=y-v){for((b=g<0)?(g=-g,h=w):(v=y,h=T),h.reverse(),u=g;u--;h.push(0));h.reverse()}else for(m=(b=(g=w.length)<(u=T.length))?g:u,g=u=0;u<m;u++)if(w[u]!=T[u]){b=w[u]<T[u];break}if(b&&(h=w,w=T,T=h,s.s=-s.s),u=(m=T.length)-(f=w.length),u>0)for(;u--;w[f++]=0);for(u=Re-1;m>g;){if(w[--m]<T[m]){for(f=m;f&&!w[--f];w[f]=u);--w[f],w[m]+=Re}w[m]-=T[m]}for(;w[0]==0;w.splice(0,1),--v);return w[0]?H(s,w,v):(s.s=o==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,u){var f,m,h=this;return s=new S(s,u),!h.c||!s.s||s.c&&!s.c[0]?new S(NaN):!s.c||h.c&&!h.c[0]?new S(h):(M==9?(m=s.s,s.s=1,f=e(h,s,0,3),s.s=m,f.s*=m):f=e(h,s,0,M),s=h.minus(f.times(s)),!s.c[0]&&M==1&&(s.s=h.s),s)},r.multipliedBy=r.times=function(s,u){var f,m,h,b,p,g,y,v,w,T,P,G,j,Y,re,q=this,V=q.c,ce=(s=new S(s,u)).c;if(!V||!ce||!V[0]||!ce[0])return!q.s||!s.s||V&&!V[0]&&!ce||ce&&!ce[0]&&!V?s.c=s.e=s.s=null:(s.s*=q.s,!V||!ce?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=Ce(q.e/U)+Ce(s.e/U),s.s*=q.s,y=V.length,T=ce.length,y<T&&(j=V,V=ce,ce=j,h=y,y=T,T=h),h=y+T,j=[];h--;j.push(0));for(Y=Re,re=$e,h=T;--h>=0;){for(f=0,P=ce[h]%re,G=ce[h]/re|0,p=y,b=h+p;b>h;)v=V[--p]%re,w=V[p]/re|0,g=G*v+w*P,v=P*v+g%re*re+j[b]+f,f=(v/Y|0)+(g/re|0)+G*w,j[b--]=v%Y;j[b]=f}return f?++m:j.splice(0,1),H(s,j,m)},r.negated=function(){var s=new S(this);return s.s=-s.s||null,s},r.plus=function(s,u){var f,m=this,h=m.s;if(s=new S(s,u),u=s.s,!h||!u)return new S(NaN);if(h!=u)return s.s=-u,m.minus(s);var b=m.e/U,p=s.e/U,g=m.c,y=s.c;if(!b||!p){if(!g||!y)return new S(h/0);if(!g[0]||!y[0])return y[0]?s:new S(g[0]?m:h*0)}if(b=Ce(b),p=Ce(p),g=g.slice(),h=b-p){for(h>0?(p=b,f=y):(h=-h,f=g),f.reverse();h--;f.push(0));f.reverse()}for(h=g.length,u=y.length,h-u<0&&(f=y,y=g,g=f,u=h),h=0;u;)h=(g[--u]=g[u]+y[u]+h)/Re|0,g[u]=Re===g[u]?0:g[u]%Re;return h&&(g=[h].concat(g),++p),H(s,g,p)},r.precision=r.sd=function(s,u){var f,m,h,b=this;if(s!=null&&s!==!!s)return se(s,1,Ee),u==null?u=o:se(u,0,8),D(new S(b),s,u);if(!(f=b.c))return null;if(h=f.length-1,m=h*U+1,h=f[h]){for(;h%10==0;h/=10,m--);for(h=f[0];h>=10;h/=10,m++);}return s&&b.e+1>m&&(m=b.e+1),m},r.shiftedBy=function(s){return se(s,-9007199254740991,Zi),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,u,f,m,h,b=this,p=b.c,g=b.s,y=b.e,v=a+4,w=new S("0.5");if(g!==1||!p||!p[0])return new S(!g||g<0&&(!p||p[0])?NaN:p?b:1/0);if(g=Math.sqrt(+B(b)),g==0||g==1/0?(u=Ne(p),(u.length+y)%2==0&&(u+="0"),g=Math.sqrt(+u),y=Ce((y+1)/2)-(y<0||y%2),g==1/0?u="5e"+y:(u=g.toExponential(),u=u.slice(0,u.indexOf("e")+1)+y),f=new S(u)):f=new S(g+""),f.c[0]){for(y=f.e,g=y+v,g<3&&(g=0);;)if(h=f,f=w.times(h.plus(e(b,h,v,1))),Ne(h.c).slice(0,g)===(u=Ne(f.c)).slice(0,g))if(f.e<y&&--g,u=u.slice(g-3,g+1),u=="9999"||!m&&u=="4999"){if(!m&&(D(h,h.e+a+2,0),h.times(h).eq(b))){f=h;break}v+=4,g+=4,m=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(D(f,f.e+a+2,1),s=!f.times(f).eq(b));break}}return D(f,f.e+a+1,o,s)},r.toExponential=function(s,u){return s!=null&&(se(s,0,Ee),s++),R(this,s,u,1)},r.toFixed=function(s,u){return s!=null&&(se(s,0,Ee),s=s+this.e+1),R(this,s,u)},r.toFormat=function(s,u,f){var m,h=this;if(f==null)s!=null&&u&&typeof u=="object"?(f=u,u=null):s&&typeof s=="object"?(f=s,s=u=null):f=A;else if(typeof f!="object")throw Error(ve+"Argument not an object: "+f);if(m=h.toFixed(s,u),h.c){var b,p=m.split("."),g=+f.groupSize,y=+f.secondaryGroupSize,v=f.groupSeparator||"",w=p[0],T=p[1],P=h.s<0,G=P?w.slice(1):w,j=G.length;if(y&&(b=g,g=y,y=b,j-=b),g>0&&j>0){for(b=j%g||g,w=G.substr(0,b);b<j;b+=g)w+=v+G.substr(b,g);y>0&&(w+=v+G.slice(b)),P&&(w="-"+w)}m=T?w+(f.decimalSeparator||"")+((y=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+y+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):w}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(s){var u,f,m,h,b,p,g,y,v,w,T,P,G=this,j=G.c;if(s!=null&&(g=new S(s),!g.isInteger()&&(g.c||g.s!==1)||g.lt(l)))throw Error(ve+"Argument "+(g.isInteger()?"out of range: ":"not an integer: ")+B(g));if(!j)return new S(G);for(u=new S(l),v=f=new S(l),m=y=new S(l),P=Ne(j),b=u.e=P.length-G.e-1,u.c[0]=ei[(p=b%U)<0?U+p:p],s=!s||g.comparedTo(u)>0?b>0?u:v:g,p=_,_=1/0,g=new S(P),y.c[0]=0;w=e(g,u,0,1),h=f.plus(w.times(m)),h.comparedTo(s)!=1;)f=m,m=h,v=y.plus(w.times(h=v)),y=h,u=g.minus(w.times(h=u)),g=h;return h=e(s.minus(f),m,0,1),y=y.plus(h.times(v)),f=f.plus(h.times(m)),y.s=v.s=G.s,b=b*2,T=e(v,m,b,o).minus(G).abs().comparedTo(e(y,f,b,o).minus(G).abs())<1?[v,m]:[y,f],_=p,T},r.toNumber=function(){return+B(this)},r.toPrecision=function(s,u){return s!=null&&se(s,1,Ee),R(this,s,u,2)},r.toString=function(s){var u,f=this,m=f.s,h=f.e;return h===null?m?(u="Infinity",m<0&&(u="-"+u)):u="NaN":(s==null?u=h<=d||h>=c?It(Ne(f.c),h):je(Ne(f.c),h,"0"):s===10&&O?(f=D(new S(f),a+h+1,o),u=je(Ne(f.c),f.e,"0")):(se(s,2,k.length,"Base"),u=t(je(Ne(f.c),h,"0"),10,s,m,!0)),m<0&&f.c[0]&&(u="-"+u)),u},r.valueOf=r.toJSON=function(){return B(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&S.set(i),S}function Ce(i){var e=i|0;return i>0||i===e?e:e-1}function Ne(i){for(var e,t,n=1,r=i.length,l=i[0]+"";n<r;){for(e=i[n++]+"",t=U-e.length;t--;e="0"+e);l+=e}for(r=l.length;l.charCodeAt(--r)===48;);return l.slice(0,r+1||1)}function nt(i,e){var t,n,r=i.c,l=e.c,a=i.s,o=e.s,d=i.e,c=e.e;if(!a||!o)return null;if(t=r&&!r[0],n=l&&!l[0],t||n)return t?n?0:-o:a;if(a!=o)return a;if(t=a<0,n=d==c,!r||!l)return n?0:!r^t?1:-1;if(!n)return d>c^t?1:-1;for(o=(d=r.length)<(c=l.length)?d:c,a=0;a<o;a++)if(r[a]!=l[a])return r[a]>l[a]^t?1:-1;return d==c?0:d>c^t?1:-1}function se(i,e,t,n){if(i<e||i>t||i!==Me(i))throw Error(ve+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function At(i){var e=i.c.length-1;return Ce(i.e/U)==e&&i.c[e]%2!=0}function It(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function je(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 Ie=Hi(),Br=class{constructor(i){I(this,"key");I(this,"left",null);I(this,"right",null);this.key=i}},Et=class extends Br{constructor(i){super(i)}},Gr=class{constructor(){I(this,"size",0);I(this,"modificationCount",0);I(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,l=null,a=e;const o=this.compare;let d;for(;;)if(d=o(a.key,i),d>0){let c=a.left;if(c==null||(d=o(c.key,i),d>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(d<0){let c=a.right;if(c==null||(d=o(c.key,i),d<0&&(a.right=c.left,c.left=a,a=c,c=a.right,c==null)))break;r==null?l=a:r.right=a,r=a,a=c}else break;return r!=null&&(r.right=a.left,a.left=l),t!=null&&(t.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),d}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 l=t.right;t=this.splayMax(r),t.right=l,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)}}},Bt=class Ct extends Gr{constructor(t,n){super();I(this,"root",null);I(this,"compare");I(this,"validKey");I(this,fn,"[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 Et(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new Et(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 l=r.right;for(;l!=null;)r=l,l=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 l=r.left;for(;l!=null;)r=l,l=r.left;return r.key}retainAll(t){const n=new Ct(this.compare,this.validKey),r=this.modificationCount;for(const l of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(l)&&this.splay(l)==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 Ct(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Ct(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 Ct(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(l,a){let o,d;do{if(o=l.left,d=l.right,o!=null){const c=new Et(o.key);a.left=c,n(o,c)}if(d!=null){const c=new Et(d.key);a.right=c,l=d,a=c}}while(d!=null)}const r=new Et(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Wr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(cn=Symbol.iterator,fn=Symbol.toStringTag,cn)](){return new zr(this.wrap())}},Vi=class{constructor(i){I(this,"tree");I(this,"path",new Array);I(this,"modificationCount",null);I(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 Vi{getValue(i){return i.key}},Wr=class extends Vi{getValue(i){return[i.key,i.key]}},Ki=i=>()=>i,ti=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):Ki(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Dr(i){const e=i?(t,n,r,l,a)=>t.exponentiatedBy(2).isLessThanOrEqualTo(l.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):Ki(!1);return(t,n,r)=>{const l=t.x,a=t.y,o=r.x,d=r.y,c=a.minus(d).times(n.x.minus(o)).minus(l.minus(o).times(n.y.minus(d)));return e(c,l,a,o,d)?0:c.comparedTo(0)}}var Ur=i=>i,Fr=i=>{if(i){const e=new Bt(ti(i)),t=new Bt(ti(i)),n=(l,a)=>a.addAndReturn(l),r=l=>({x:n(l.x,e),y:n(l.y,t)});return r({x:new Ie(0),y:new Ie(0)}),r}return Ur},ii=i=>({set:e=>{Ze=ii(e)},reset:()=>ii(i),compare:ti(i),snap:Fr(i),orient:Dr(i)}),Ze=ii(),Lt=(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),ni=(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,l=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:l}}},Gt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Yi=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),zt=i=>Yi(i,i).sqrt(),qr=(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 Gt(r,n).div(zt(r)).div(zt(n))},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 Yi(r,n).div(zt(r)).div(zt(n))},Xi=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Qi=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},Zr=(i,e,t,n)=>{if(e.x.isZero())return Qi(t,n,i.x);if(n.x.isZero())return Qi(i,e,t.x);if(e.y.isZero())return Xi(t,n,i.y);if(n.y.isZero())return Xi(i,e,t.y);const r=Gt(e,n);if(r.isZero())return null;const l={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=Gt(l,e).div(r),o=Gt(l,n).div(r),d=i.x.plus(o.times(e.x)),c=t.x.plus(a.times(n.x)),L=i.y.plus(o.times(e.y)),_=t.y.plus(a.times(n.y)),C=d.plus(c).div(2),M=L.plus(_).div(2);return{x:C,y:M}},Be=class En{constructor(e,t){I(this,"point");I(this,"isLeft");I(this,"segment");I(this,"otherSE");I(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=En.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Dt.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 l=t[n];this.point.events.push(l),l.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 l=this.point.events[r];l.consumedBy===void 0&&n.otherSE.point.events===l.otherSE.point.events&&n.segment.consume(l.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 l=r.otherSE;t.set(r,{sine:qr(this.point,e.point,l.point),cosine:jr(this.point,e.point,l.point)})};return(r,l)=>{t.has(r)||n(r),t.has(l)||n(l);const{sine:a,cosine:o}=t.get(r),{sine:d,cosine:c}=t.get(l);return a.isGreaterThanOrEqualTo(0)&&d.isGreaterThanOrEqualTo(0)?o.isLessThan(c)?1:o.isGreaterThan(c)?-1:0:a.isLessThan(0)&&d.isLessThan(0)?o.isLessThan(c)?-1:o.isGreaterThan(c)?1:0:d.isLessThan(a)?-1:d.isGreaterThan(a)?1:0}}},Hr=class gi{constructor(e){I(this,"events");I(this,"poly");I(this,"_isExteriorRing");I(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 l=e[n];if(!l.isInResult()||l.ringOut)continue;let a=null,o=l.leftSE,d=l.rightSE;const c=[o],L=o.point,_=[];for(;a=o,o=d,c.push(o),o.point!==L;)for(;;){const C=o.getAvailableLinkedEvents();if(C.length===0){const A=c[0].point,k=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${A.x}, ${A.y}]. Last matching segment found ends at [${k.x}, ${k.y}].`)}if(C.length===1){d=C[0].otherSE;break}let M=null;for(let A=0,k=_.length;A<k;A++)if(_[A].point===o.point){M=A;break}if(M!==null){const A=_.splice(M)[0],k=c.splice(A.index);k.unshift(k[0].otherSE),t.push(new gi(k.reverse()));continue}_.push({index:c.length,point:o.point});const N=o.getLeftmostComparator(a);d=C.sort(N)[0].otherSE;break}t.push(new gi(c))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let c=1,L=this.events.length-1;c<L;c++){const _=this.events[c].point,C=this.events[c+1].point;Ze.orient(_,e,C)!==0&&(t.push(_),e=_)}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 l=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,d=[];for(let c=a;c!=o;c+=l)d.push([t[c].x.toNumber(),t[c].y.toNumber()]);return d}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,l;let e=this.events[0];for(let a=1,o=this.events.length;a<o;a++){const d=this.events[a];Be.compare(e,d)>0&&(e=d)}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:(l=t.ringOut)==null?void 0:l.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Ji=class{constructor(i){I(this,"exteriorRing");I(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}},Vr=class{constructor(i){I(this,"rings");I(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 l=i[n];if(!l.poly)if(l.isExteriorRing())e.push(new Ji(l));else{const a=l.enclosingRing();a!=null&&a.poly||e.push(new Ji(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(l)}}return e}},Kr=class{constructor(i,e=Dt.compare){I(this,"queue");I(this,"tree");I(this,"segments");this.queue=i,this.tree=new Bt(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 l=null;if(n){const o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(l=o),!n.isAnEndpoint(o))){const d=this._splitSafely(n,o);for(let c=0,L=d.length;c<L;c++)t.push(d[c])}}let a=null;if(r){const o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(a=o),!r.isAnEndpoint(o))){const d=this._splitSafely(r,o);for(let c=0,L=d.length;c<L;c++)t.push(d[c])}}if(l!==null||a!==null){let o=null;l===null?o=a:a===null?o=l:o=Be.comparePoints(l,a)<=0?l:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const d=e.split(o);for(let c=0,L=d.length;c<L;c++)t.push(d[c])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const l=n.getIntersection(r);if(l!==null){if(!n.isAnEndpoint(l)){const a=this._splitSafely(n,l);for(let o=0,d=a.length;o<d;o++)t.push(a[o])}if(!r.isAnEndpoint(l)){const a=this._splitSafely(r,l);for(let o=0,d=a.length;o<d;o++)t.push(a[o])}}}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}},Yr=class{constructor(){I(this,"type");I(this,"numMultiPolys")}run(i,e,t){_t.type=i;const n=[new en(e,!0)];for(let c=0,L=t.length;c<L;c++)n.push(new en(t[c],!1));if(_t.numMultiPolys=n.length,_t.type==="difference"){const c=n[0];let L=1;for(;L<n.length;)ni(n[L].bbox,c.bbox)!==null?L++:n.splice(L,1)}if(_t.type==="intersection")for(let c=0,L=n.length;c<L;c++){const _=n[c];for(let C=c+1,M=n.length;C<M;C++)if(ni(_.bbox,n[C].bbox)===null)return[]}const r=new Bt(Be.compare);for(let c=0,L=n.length;c<L;c++){const _=n[c].getSweepEvents();for(let C=0,M=_.length;C<M;C++)r.add(_[C])}const l=new Kr(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const c=l.process(a);for(let L=0,_=c.length;L<_;L++){const C=c[L];C.consumedBy===void 0&&r.add(C)}r.size!=0?(a=r.first(),r.delete(a)):a=null}Ze.reset();const o=Hr.factory(l.segments);return new Vr(o).getGeom()}},_t=new Yr,Wt=_t,Xr=0,Dt=class qt{constructor(e,t,n,r){I(this,"id");I(this,"leftSE");I(this,"rightSE");I(this,"rings");I(this,"windings");I(this,"ringOut");I(this,"consumedBy");I(this,"prev");I(this,"_prevInResult");I(this,"_beforeState");I(this,"_afterState");I(this,"_isInResult");this.id=++Xr,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,l=e.rightSE.point.x,a=t.rightSE.point.x;if(a.isLessThan(n))return 1;if(l.isLessThan(r))return-1;const o=e.leftSE.point.y,d=t.leftSE.point.y,c=e.rightSE.point.y,L=t.rightSE.point.y;if(n.isLessThan(r)){if(d.isLessThan(o)&&d.isLessThan(c))return 1;if(d.isGreaterThan(o)&&d.isGreaterThan(c))return-1;const _=e.comparePoint(t.leftSE.point);if(_<0)return 1;if(_>0)return-1;const C=t.comparePoint(e.rightSE.point);return C!==0?C:-1}if(n.isGreaterThan(r)){if(o.isLessThan(d)&&o.isLessThan(L))return-1;if(o.isGreaterThan(d)&&o.isGreaterThan(L))return 1;const _=t.comparePoint(e.leftSE.point);if(_!==0)return _;const C=e.comparePoint(t.rightSE.point);return C<0?1:C>0?-1:1}if(o.isLessThan(d))return-1;if(o.isGreaterThan(d))return 1;if(l.isLessThan(a)){const _=t.comparePoint(e.rightSE.point);if(_!==0)return _}if(l.isGreaterThan(a)){const _=e.comparePoint(t.rightSE.point);if(_<0)return 1;if(_>0)return-1}if(!l.eq(a)){const _=c.minus(o),C=l.minus(n),M=L.minus(d),N=a.minus(r);if(_.isGreaterThan(C)&&M.isLessThan(N))return 1;if(_.isLessThan(C)&&M.isGreaterThan(N))return-1}return l.isGreaterThan(a)?1:l.isLessThan(a)||c.isLessThan(L)?-1:c.isGreaterThan(L)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,l,a;const o=Be.comparePoints(e,t);if(o<0)r=e,l=t,a=1;else if(o>0)r=t,l=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const d=new Be(r,!0),c=new Be(l,!1);return new qt(d,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=ni(t,n);if(r===null)return null;const l=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,d=e.rightSE.point,c=Lt(t,o)&&this.comparePoint(o)===0,L=Lt(n,l)&&e.comparePoint(l)===0,_=Lt(t,d)&&this.comparePoint(d)===0,C=Lt(n,a)&&e.comparePoint(a)===0;if(L&&c)return C&&!_?a:!C&&_?d:null;if(L)return _&&l.x.eq(d.x)&&l.y.eq(d.y)?null:l;if(c)return C&&a.x.eq(o.x)&&a.y.eq(o.y)?null:o;if(C&&_)return null;if(C)return a;if(_)return d;const M=Zr(l,this.vector(),o,e.vector());return M===null||!Lt(r,M)?null:Ze.snap(M)}split(e){const t=[],n=e.events!==void 0,r=new Be(e,!0),l=new Be(e,!1),a=this.rightSE;this.replaceRightSE(l),t.push(l),t.push(r);const o=new qt(r,a,this.rings.slice(),this.windings.slice());return Be.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),Be.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),l.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=qt.compare(t,n);if(r!==0){if(r>0){const l=t;t=n,n=l}if(t.prev===n){const l=t;t=n,n=l}for(let l=0,a=n.rings.length;l<a;l++){const o=n.rings[l],d=n.windings[l],c=t.rings.indexOf(o);c===-1?(t.rings.push(o),t.windings.push(d)):t.windings[c]+=d}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 o=0,d=this.rings.length;o<d;o++){const c=this.rings[o],L=this.windings[o],_=t.indexOf(c);_===-1?(t.push(c),n.push(L)):n[_]+=L}const l=[],a=[];for(let o=0,d=t.length;o<d;o++){if(n[o]===0)continue;const c=t[o],L=c.poly;if(a.indexOf(L)===-1)if(c.isExterior)l.push(L);else{a.indexOf(L)===-1&&a.push(L);const _=l.indexOf(c.poly);_!==-1&&l.splice(_,1)}}for(let o=0,d=l.length;o<d;o++){const c=l[o].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(Wt.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===Wt.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}},$i=class{constructor(i,e,t){I(this,"poly");I(this,"isExterior");I(this,"segments");I(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 Ie(i[0][0]),y:new Ie(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let l=1,a=i.length;l<a;l++){if(typeof i[l][0]!="number"||typeof i[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ze.snap({x:new Ie(i[l][0]),y:new Ie(i[l][1])});o.x.eq(r.x)&&o.y.eq(r.y)||(this.segments.push(Dt.fromRing(r,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),r=o)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Dt.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}},Qr=class{constructor(i,e){I(this,"multiPoly");I(this,"exteriorRing");I(this,"interiorRings");I(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $i(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 $i(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,l=n.length;r<l;r++)i.push(n[r])}return i}},en=class{constructor(i,e){I(this,"isSubject");I(this,"polys");I(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 Ie(Number.POSITIVE_INFINITY),y:new Ie(Number.POSITIVE_INFINITY)},ur:{x:new Ie(Number.NEGATIVE_INFINITY),y:new Ie(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new Qr(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,l=n.length;r<l;r++)i.push(n[r])}return i}},Jr=(i,...e)=>Wt.run("union",i,e),$r=(i,...e)=>Wt.run("difference",i,e);Ze.set;function es(i,e={}){const t=[];if(Xt(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Jr(t[0],...t.slice(1));return n.length===0?null:n.length===1?Yt(n[0],e.properties):Wi(n,e.properties)}var tn=es;function ts(i){const e=[];if(Xt(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=$r(e[0],...e.slice(1));return n.length===0?null:n.length===1?Yt(n[0],t):Wi(n,t)}var is=ts;function ns(i){if(!i)throw new Error("geojson is required");var e=[];return Or(i,function(t){e.push(t)}),wt(e)}var rs=ns;function nn(i,e){const t=is(wt([Yt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=pt(Qt(i)),r=(n[2]-n[0])/360/1e3,l=n[0]<-180,a=n[2]>180,o=rs(i);if(o.features.length>1&&(l||a))for(const d of o.features){const c=pt(Qt(d));if(a&&c[0]<-180+r)for(const L of d.geometry.coordinates)for(const _ of L)_[0]+=360-r;if(l&&c[2]>180-r)for(const L of d.geometry.coordinates)for(const _ of L)_[0]-=360-r}e(wt([o.features.length<2?i:tn(o)??i,t]))}const rn=i=>{var n,r,l;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(l=i==null?void 0:i.properties)!=null&&l.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function sn(i,e=!0,t=!0,n={},r={},l=rn){let a;const o=[];let d,c;const L=be.geoJSON(void 0,{style:l===!0?rn:l===!1?void 0:l??void 0,interactive:!1}).addTo(i),_=M=>{a==null||a({type:"mapClick",coordinates:[M.latlng.lng,M.latlng.lat]})};function C(M,N=!1){const A=document.createElement("div");return new sr({props:{displayIn:"leaflet"},target:A}),new be.Marker(M,{interactive:N,icon:new be.DivIcon({html:A,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(M){M?(a=M,i.on("click",_)):(a=void 0,i.off("click",_))},flyTo(M,N){i.flyTo([M[1],M[0]],N,{duration:2,...n})},fitBounds(M,N,A){i.flyToBounds([[M[1],M[0]],[M[3],M[2]]],{padding:[N,N],duration:2,...A?{maxZoom:A}:{},...r})},indicateReverse(M){i.getContainer().style.cursor=M?"crosshair":""},setReverseMarker(M){var A;if(!e)return;const N=M&&[M[1],M[0]];c?N?c.setLatLng(N):(c.remove(),c=void 0):N&&(e instanceof Function?c=e(i)??void 0:(c=(typeof e=="object"?new be.Marker(N,e):C(N)).addTo(i),(A=c.getElement())==null||A.classList.add("marker-reverse")))},setFeatures(M,N,A){function k(O){L.clearLayers(),O&&L.addData(O)}for(const O of o)O.remove();o.length=0,k();e:if(N){let O=!1;if(N.geometry.type==="GeometryCollection"){const S=N.geometry.geometries.filter(R=>R.type==="Polygon"||R.type==="MultiPolygon");t:if(S.length>0){const R=tn(wt(S.map(W=>vt(W))));if(!R)break t;nn({...N,geometry:R.geometry},k),O=!0}else{const R=N.geometry.geometries.filter(W=>W.type==="LineString"||W.type==="MultiLineString");R.length>0&&(k({...N,geometry:{type:"GeometryCollection",geometries:R}}),O=!0)}}if(!O){if(N.geometry.type==="Polygon"||N.geometry.type==="MultiPolygon")nn(N,S=>{if(!S)return;const R=[...S.features],W=pt(Qt(N)),H=W[2]-W[0];W[0]-H/4<-180&&R.push(...on(S,-360).features),W[2]+H/4>180&&R.push(...on(S,360).features),k(wt(R))});else if(N.geometry.type==="LineString"||N.geometry.type==="MultiLineString"){k(N);break e}}if(!A&&N.geometry.type!=="Point")break e;if(e instanceof Function){const S=e(i,N);S&&o.push(S.addTo(i))}else if(e){const S=[N.center[1],N.center[0]];o.push(typeof e=="object"?new be.Marker(S,e):C(S).addTo(i))}}if(t)for(const O of M??[]){if(O===N)continue;const S=[O.center[1],O.center[0]];let R;if(t instanceof Function){if(R=t(i,O),!R)continue}else R=(typeof t=="object"?new be.Marker(S,t):C(S,!0)).addTo(i).bindTooltip(O.place_type[0]==="reverse"?O.place_name:O.place_name.replace(/,.*/,""),{direction:"top"});const W=R.getElement();W&&(W.addEventListener("click",H=>{H.stopPropagation(),a==null||a({type:"markerClick",id:O.id})}),W.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:O.id})}),W.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:O.id})}),W.classList.toggle("marker-fuzzy",!!O.matching_text)),o.push(R)}},setSelectedMarker(M){var N,A;d&&((N=d.getElement())==null||N.classList.toggle("marker-selected",!1)),d=M>-1?o[M]:void 0,(A=d==null?void 0:d.getElement())==null||A.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const M=i.getCenter();return[i.getZoom(),M.lng,M.lat]}}}function on(i,e){const t=Ar(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)ln(r,e);else ln(n.geometry.coordinates,e);return t}function ln(i,e){for(const t of i)for(const n of t)n[0]+=e}class un extends be.Control{}be.Util.extend(un.prototype,be.Evented.prototype);class an extends un{constructor(t){super(t);hi(this,Le);hi(this,rt);di(this,rt,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",be.DomEvent.disableClickPropagation(n),be.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:l,flyTo:a,fullGeometryStyle:o,position:d,...c}=Te(this,rt),L=typeof a=="boolean"?{}:a,_=sn(t,r,l,L,L,o);di(this,Le,new Nr({target:n,props:{mapController:_,flyTo:a===void 0?!0:!!a,...c}}));const C={select:void 0,pick:void 0,featureslisted:void 0,featuresmarked:void 0,response:void 0,optionsvisibilitychange:void 0,reversetoggle:void 0,querychange:void 0};for(const M in C)Te(this,Le).$on(M,N=>this.fire(M,N.detail));return n}setOptions(t){var d;Object.assign(Te(this,rt),t);const{marker:n,showResultMarkers:r,flyTo:l,fullGeometryStyle:a,...o}=Te(this,rt);(d=Te(this,Le))==null||d.$set(o)}setQuery(t,n=!0){var r;(r=Te(this,Le))==null||r.setQuery(t,n)}clearMap(){var t;(t=Te(this,Le))==null||t.clearMap()}clearList(){var t;(t=Te(this,Le))==null||t.clearList()}setReverseMode(t){var n;(n=Te(this,Le))==null||n.$set({reverseActive:t})}focus(t){var n;(n=Te(this,Le))==null||n.focus(t)}blur(){var t;(t=Te(this,Le))==null||t.blur()}onRemove(){var t;(t=Te(this,Le))==null||t.$destroy()}}Le=new WeakMap,rt=new WeakMap;function ss(...i){return new an(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=ss),K.GeocodingControl=an,K.createLeafletMapController=sn,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
1
+ (function(V,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],$):(V=typeof globalThis<"u"?globalThis:V||self,$(V.leafletMaptilerGeocoder={},V.L))})(this,function(V,$){"use strict";var Ds=Object.defineProperty;var Mn=V=>{throw TypeError(V)};var zs=(V,$,ge)=>$ in V?Ds(V,$,{enumerable:!0,configurable:!0,writable:!0,value:ge}):V[$]=ge;var I=(V,$,ge)=>zs(V,typeof $!="symbol"?$+"":$,ge),Cn=(V,$,ge)=>$.has(V)||Mn("Cannot "+ge);var xe=(V,$,ge)=>(Cn(V,$,"read from private field"),ge?ge.call(V):$.get(V)),bi=(V,$,ge)=>$.has(V)?Mn("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(V):$.set(V,ge),vi=(V,$,ge,ve)=>(Cn(V,$,"write to private field"),ve?ve.call(V,ge):$.set(V,ge),ge);var yn,bn,Se,ut;function ge(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const ve=ge($);function ne(){}function kn(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 qe(i){i.forEach(Ei)}function _i(i){return typeof i=="function"}function Ye(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Pt;function ye(i,e){return i===e?!0:(Pt||(Pt=document.createElement("a")),Pt.href=e,i===Pt.href)}function On(i){return Object.keys(i).length===0}function Rn(i,e,t,n){if(i){const r=Si(i,e,t,n);return i[0](r)}}function Si(i,e,t,n){return i[1]&&n?kn(t.ctx.slice(),i[1](n(e))):t.ctx}function Pn(i,e,t,n){return i[2],e.dirty}function An(i,e,t,n,r,u){if(r){const a=Si(e,t,n,u);i.p(a,r)}}function In(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 At(i){return i??""}function j(i,e){i.appendChild(e)}function re(i,e,t){i.insertBefore(e,t||null)}function ee(i){i.parentNode&&i.parentNode.removeChild(i)}function X(i){return document.createElement(i)}function Re(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Xe(i){return document.createTextNode(i)}function Le(){return Xe(" ")}function Bn(){return Xe("")}function de(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Gn(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 Wn(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 Ge(i,e,t){i.classList.toggle(e,!!t)}function Dn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let yt;function bt(i){yt=i}function Ti(){if(!yt)throw new Error("Function called outside component initialization");return yt}function zn(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=Dn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,u)}),!u.defaultPrevented}return!0}}function Un(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const dt=[],Yt=[];let ht=[];const Ci=[],Fn=Promise.resolve();let Xt=!1;function qn(){Xt||(Xt=!0,Fn.then(Ni))}function Qt(i){ht.push(i)}const Jt=new Set;let gt=0;function Ni(){if(gt!==0)return;const i=yt;do{try{for(;gt<dt.length;){const e=dt[gt];gt++,bt(e),jn(e.$$)}}catch(e){throw dt.length=0,gt=0,e}for(bt(null),dt.length=0,gt=0;Yt.length;)Yt.pop()();for(let e=0;e<ht.length;e+=1){const t=ht[e];Jt.has(t)||(Jt.add(t),t())}ht.length=0}while(dt.length);for(;Ci.length;)Ci.pop()();Xt=!1,Jt.clear(),bt(i)}function jn(i){if(i.fragment!==null){i.update(),qe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Qt)}}function Zn(i){const e=[],t=[];ht.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ht=e}const It=new Set;let ot;function Bt(){ot={r:0,c:[],p:ot}}function Gt(){ot.r||qe(ot.c),ot=ot.p}function le(i,e){i&&i.i&&(It.delete(i),i.i(e))}function he(i,e,t,n){if(i&&i.o){if(It.has(i))return;It.add(i),ot.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 Hn(i,e){he(i,1,1,()=>{e.delete(i.key)})}function Vn(i,e,t,n,r,u,a,o,g,c,L,_){let C=i.length,M=u.length,N=C;const P={};for(;N--;)P[i[N].key]=N;const R=[],k=new Map,S=new Map,O=[];for(N=M;N--;){const G=_(r,u,N),s=t(G);let l=a.get(s);l?O.push(()=>l.p(G,e)):(l=c(s,G),l.c()),k.set(s,R[N]=l),s in P&&S.set(s,Math.abs(N-P[s]))}const D=new Set,H=new Set;function K(G){le(G,1),G.m(o,L),a.set(G.key,G),L=G.first,M--}for(;C&&M;){const G=R[M-1],s=i[C-1],l=G.key,f=s.key;G===s?(L=G.first,C--,M--):k.has(f)?!a.has(l)||D.has(l)?K(G):H.has(f)?C--:S.get(l)>S.get(f)?(H.add(l),K(G)):(D.add(f),C--):(g(s,a),C--)}for(;C--;){const G=i[C];k.has(G.key)||g(G,a)}for(;M;)K(R[M-1]);return qe(O),R}function Qe(i){i&&i.c()}function je(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Qt(()=>{const u=i.$$.on_mount.map(Ei).filter(_i);i.$$.on_destroy?i.$$.on_destroy.push(...u):qe(u),i.$$.on_mount=[]}),r.forEach(Qt)}function Ze(i,e){const t=i.$$;t.fragment!==null&&(Zn(t.after_update),qe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Kn(i,e){i.$$.dirty[0]===-1&&(dt.push(i),qn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Je(i,e,t,n,r,u,a=null,o=[-1]){const g=yt;bt(i);const c=i.$$={fragment:null,ctx:[],props:u,update:ne,not_equal:r,bound:Li(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:Li(),dirty:o,skip_bound:!1,root:e.target||g.$$.root};a&&a(c.root);let L=!1;if(c.ctx=t?t(i,e.props||{},(_,C,...M)=>{const N=M.length?M[0]:C;return c.ctx&&r(c.ctx[_],c.ctx[_]=N)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](N),L&&Kn(i,_)),C}):[],c.update(),L=!0,qe(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=Wn(e.target);c.fragment&&c.fragment.l(_),_.forEach(ee)}else c.fragment&&c.fragment.c();e.intro&&le(i.$$.fragment),je(i,e.target,e.anchor),Ni()}bt(g)}class $e{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){Ze(this,1),this.$destroy=ne}$on(e,t){if(!_i(t))return ne;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&&!On(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Yn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Yn);function Xn(i){let e,t;return{c(){e=Re("svg"),t=Re("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){re(n,e,r),j(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class Oi extends $e{constructor(e){super(),Je(this,e,null,Xn,Ye,{})}}function Qn(i){let e,t;return{c(){e=Re("svg"),t=Re("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){re(n,e,r),j(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class Ri extends $e{constructor(e){super(),Je(this,e,null,Qn,Ye,{})}}function Jn(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 $n(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 er(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 tr(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 ir(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 nr(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 rr(i){let e,t;return{c(){e=X("img"),ye(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){re(n,e,r)},p(n,r){r&8&&!ye(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 sr(i){let e,t,n,r;return{c(){e=X("img"),ye(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){re(u,e,a),n||(r=de(e,"error",i[14]),n=!0)},p(u,a){a&32&&!ye(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 or(i){let e,t;return{c(){e=X("div"),x(e,"class","sprite-icon svelte-w9y5n9"),x(e,"style",t=`
2
+ width: ${i[6].width/Te}px;
3
+ height: ${i[6].height/Te}px;
4
+ background-image: url(${i[3]}sprite${$t}.png);
5
+ background-position: -${i[6].x/Te}px -${i[6].y/Te}px;
6
+ background-size: ${Pe.width/Te}px ${Pe.height/Te}px;
7
+ `),x(e,"title",i[7])},m(n,r){re(n,e,r)},p(n,r){r&72&&t!==(t=`
8
+ width: ${n[6].width/Te}px;
9
+ height: ${n[6].height/Te}px;
10
+ background-image: url(${n[3]}sprite${$t}.png);
11
+ background-position: -${n[6].x/Te}px -${n[6].y/Te}px;
12
+ background-size: ${Pe.width/Te}px ${Pe.height/Te}px;
13
+ `)&&x(e,"style",t),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Pi(i){let e,t;return{c(){e=X("span"),t=Xe(i[7]),x(e,"class","secondary svelte-w9y5n9")},m(n,r){re(n,e,r),j(e,t)},p(n,r){r&128&&pt(t,n[7])},d(n){n&&ee(e)}}}function lr(i){let e,t,n,r,u,a,o,g,c,L=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",_,C,M=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,P,R=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",k,S,O,D,H,K;function G(m,d){return d&1&&(t=null),d&1&&(n=null),d&1&&(r=null),d&1&&(u=null),Pe&&m[6]?or:m[5]?sr:m[0].address?rr:(t==null&&(t=!!m[0].id.startsWith("road.")),t?nr:(n==null&&(n=!!m[0].id.startsWith("address.")),n?ir:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?tr:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?er:m[8]?$n:Jn))))}let s=G(i,-1),l=s(i),f=M&&Pi(i);return{c(){e=X("li"),l.c(),a=Le(),o=X("span"),g=X("span"),c=X("span"),_=Xe(L),C=Le(),f&&f.c(),N=Le(),P=X("span"),k=Xe(R),x(c,"class","primary svelte-w9y5n9"),x(g,"class","svelte-w9y5n9"),x(P,"class","line2 svelte-w9y5n9"),x(o,"class","texts svelte-w9y5n9"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",S=i[1]==="selected"),x(e,"aria-checked",O=i[1]==="picked"),x(e,"class",D=At(i[1])+" svelte-w9y5n9")},m(m,d){re(m,e,d),l.m(e,null),j(e,a),j(e,o),j(o,g),j(g,c),j(c,_),j(g,C),f&&f.m(g,null),j(o,N),j(o,P),j(P,k),H||(K=[de(e,"mouseenter",i[13]),de(e,"focus",i[15]),de(e,"click",i[16])],H=!0)},p(m,[d]){s===(s=G(m,d))&&l?l.p(m,d):(l.d(1),l=s(m),l&&(l.c(),l.m(e,a))),d&257&&L!==(L=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&pt(_,L),d&293&&(M=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),M?f?f.p(m,d):(f=Pi(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),d&257&&R!==(R=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&pt(k,R),d&2&&S!==(S=m[1]==="selected")&&x(e,"aria-selected",S),d&2&&O!==(O=m[1]==="picked")&&x(e,"aria-checked",O),d&2&&D!==(D=At(m[1])+" svelte-w9y5n9")&&x(e,"class",D)},i:ne,o:ne,d(m){m&&ee(e),l.d(),f&&f.d(),H=!1,qe(K)}}}const Ai=devicePixelRatio>1.25,$t=Ai?"@2x":"",Te=Ai?2:1;let Pe,Wt;function ur(i,e,t){let n,r,u,{feature:a}=e,{style:o="default"}=e,{showPlaceType:g}=e,{missingIconsCache:c}=e,{iconsBaseUrl:L}=e;const _=Mi();let C,M,N,P;function R(){Wt??(Wt=fetch(`${L}/sprite${$t}.json`).then(s=>s.json()).then(s=>{Pe=s}).catch(()=>{Pe=null}))}function k(){M&&c.add(M),S()}function S(){Pe!==void 0?O():(R(),Wt==null||Wt.then(O))}function O(){do{if(P--,t(4,C=n==null?void 0:n[P]),t(6,N=C?Pe==null?void 0:Pe.icons[C]:void 0),N)break;t(5,M=C?L+C.replace(/ /g,"_")+".svg":void 0)}while(P>-1&&(!M||c.has(M)))}function D(s){Un.call(this,i,s)}const H=()=>k(),K=()=>_("select",void 0),G=s=>{document.activeElement!==s.target&&_("select",void 0)};return i.$$set=s=>{"feature"in s&&t(0,a=s.feature),"style"in s&&t(1,o=s.style),"showPlaceType"in s&&t(2,g=s.showPlaceType),"missingIconsCache"in s&&t(11,c=s.missingIconsCache),"iconsBaseUrl"in s&&t(3,L=s.iconsBaseUrl)},i.$$.update=()=>{var s,l,f,m,d;i.$$.dirty&1&&t(12,n=(s=a.properties)==null?void 0:s.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(", "))??((d=(m=a.properties)==null?void 0:m.place_type_name)==null?void 0:d[0])??a.place_type[0]),i.$$.dirty&4096&&(P=(n==null?void 0:n.length)??0,S())},[a,o,g,L,C,M,N,u,r,_,k,c,n,D,H,K,G]}class ar extends $e{constructor(e){super(),Je(this,e,ur,lr,Ye,{feature:0,style:1,showPlaceType:2,missingIconsCache:11,iconsBaseUrl:3})}}function fr(i){let e;return{c(){e=X("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){re(t,e,n)},p:ne,i:ne,o:ne,d(t){t&&ee(e)}}}class cr extends $e{constructor(e){super(),Je(this,e,null,fr,Ye,{})}}function dr(i){let e,t,n;return{c(){e=Re("svg"),t=Re("path"),x(t,"stroke-width","4"),x(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),x(t,"class","svelte-gzo3ar"),x(e,"width",n=i[0]==="list"?20:void 0),x(e,"viewBox","0 0 70 85"),x(e,"fill","none"),x(e,"class","svelte-gzo3ar"),Ge(e,"in-map",i[0]!=="list"),Ge(e,"list-icon",i[0]==="list")},m(r,u){re(r,e,u),j(e,t)},p(r,[u]){u&1&&n!==(n=r[0]==="list"?20:void 0)&&x(e,"width",n),u&1&&Ge(e,"in-map",r[0]!=="list"),u&1&&Ge(e,"list-icon",r[0]==="list")},i:ne,o:ne,d(r){r&&ee(e)}}}function hr(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class gr extends $e{constructor(e){super(),Je(this,e,hr,dr,Ye,{displayIn:0})}}function mr(i){let e,t;return{c(){e=Re("svg"),t=Re("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){re(n,e,r),j(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class pr extends $e{constructor(e){super(),Je(this,e,null,mr,Ye,{})}}function yr(i){let e,t,n;return{c(){e=Re("svg"),t=Re("circle"),n=Re("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){re(r,e,u),j(e,t),j(e,n)},p:ne,i:ne,o:ne,d(r){r&&ee(e)}}}class br extends $e{constructor(e){super(),Je(this,e,null,yr,Ye,{})}}function vr(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 vt(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 wt;async function wr(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(wt&&r.cachedLocationExpiry&&wt.time+r.cachedLocationExpiry>Date.now()){if(!wt.coords)break e;return wt.coords}let u;try{return u=await new Promise((a,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{a([g.coords.longitude,g.coords.latitude].map(c=>c.toFixed(6)).join(","))},g=>{o(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(wt={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 Er=/^(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,Ii=/^([+-]?[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,})$/,Bi=/^(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,Gi=/^(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,Di=/^(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 Lr(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(M=>Number(M.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),a=t>0?"N":"S",o=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${a}, ${u}° ${o}`);const c=Math.floor(r),L=Math.floor(u),_=(r-c)*60,C=(u-L)*60;if(i=="DM"){let M=zi(_,3).toFixed(3).padStart(6,"0"),N=zi(C,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&N.endsWith(".000")&&(M=M.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),g=`${c}° ${M}' ${a}, ${L}° ${N}' ${o}`}if(i=="DMS"){const M=Math.floor(_),N=Math.floor(C);let P=((_-M)*60).toFixed(1).padStart(4,"0"),R=((C-N)*60).toFixed(1).padStart(4,"0");const k=M.toString().padStart(2,"0"),S=N.toString().padStart(2,"0");P.endsWith(".0")&&R.endsWith(".0")&&(P=P.replace(/\.0$/,""),R=R.replace(/\.0$/,"")),g=`${c}° ${k}' ${P}" ${a}, ${L}° ${S}' ${R}" ${o}`}return g}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 ei(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",a=null,o=[],g=!1;if(Er.test(i))throw new Error("invalid coordinate value");if(Ii.test(i))if(o=Ii.exec(i),g=Et(o),g)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1),a="DM";else throw new Error("invalid coordinate format");else if(Bi.test(i))if(o=Bi.exec(i),g=Et(o),g){if(t=o[2],n=o[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");o[1]?(r=o[1],u=o[5]):o[4]&&(r=o[4],u=o[8])}else throw new Error("invalid decimal coordinate format");else if(Gi.test(i))if(o=Gi.exec(i),g=Et(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],u=o[8]):o[7]&&(r=o[7],u=o[14]);else throw new Error("invalid DMS coordinates format");else if(Wi.test(i))if(o=Wi.exec(i),g=Et(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6]/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid DMS coordinates format");else if(Di.test(i)){if(o=Di.exec(i),g=Et(o),o.filter(c=>c).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid coordinates format")}if(g){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 L=o[0].trim();let _,C;const M=/[,/;\u0020]/g,N=L.match(M);if(N==null){const k=Math.floor(i.length/2);_=L.substring(0,k).trim(),C=L.substring(k).trim()}else{let k;N.length%2==1?k=Math.floor(N.length/2):k=N.length/2-1;let S=0;if(k==0)S=L.indexOf(N[0]),_=L.substring(0,S).trim(),C=L.substring(S+1).trim();else{let O=0,D=0;for(;O<=k;)S=L.indexOf(N[O],D),D=S+1,O++;_=L.substring(0,S).trim(),C=L.substring(S+1).trim()}}const P=_.split(".");if(P.length==2&&P[1]==0&&P[1].length!=2)throw new Error("invalid coordinates format");const R=C.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(_)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:L,verbatimLatitude:_,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:_r,toCoordinateFormat:Lr})}else throw new Error("coordinates pattern match failed")}function Et(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],o=e[u+r],g=t.test(a)&&t.test(o),c=n.test(a)&&n.test(o),L=a==o;if(!(a==null&&o==null)){if(a==null||o==null)return!1;if(g||c||L)continue;return!1}}return!0}function Ui(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function _r(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 Ui(this.decimalLatitude,Number(e[0]))&&Ui(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Sr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});ei.to=Sr;const xr=[{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"}],Tr={decimalLatitude:40.123,decimalLongitude:-74.123},Mr=[{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}],Cr=[{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 Nr(){const i=[];return xr.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Tr})}),[...i,...Mr,...Cr]}const kr=Nr();ei.formats=kr.map(i=>i.verbatimCoordinates);const Or=ei;function Fi(i,e,t){const n=i.slice();return n[100]=e[t],n[102]=t,n}function qi(i){let e,t;return e=new cr({}),{c(){Qe(e.$$.fragment)},m(n,r){je(e,n,r),t=!0},i(n){t||(le(e.$$.fragment,n),t=!0)},o(n){he(e.$$.fragment,n),t=!1},d(n){Ze(e,n)}}}function ji(i){let e,t,n,r,u;return t=new pr({}),{c(){e=X("button"),Qe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),Ge(e,"active",i[0])},m(a,o){re(a,e,o),je(t,e,null),n=!0,r||(u=de(e,"click",i[81]),r=!0)},p(a,o){(!n||o[0]&1024)&&x(e,"title",a[10]),(!n||o[0]&1)&&Ge(e,"active",a[0])},i(a){n||(le(t.$$.fragment,a),n=!0)},o(a){he(t.$$.fragment,a),n=!1},d(a){a&&ee(e),Ze(t),r=!1,u()}}}function Rr(i){let e,t=[],n=new Map,r,u,a,o=ki(i[13]);const g=c=>c[100].id+(c[100].address?","+c[100].address:"");for(let c=0;c<o.length;c+=1){let L=Fi(i,o,c),_=g(L);n.set(_,t[c]=Zi(_,L))}return{c(){e=X("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,L){re(c,e,L);for(let _=0;_<t.length;_+=1)t[_]&&t[_].m(e,null);r=!0,u||(a=[de(e,"mouseleave",i[27]),de(e,"blur",i[85]),de(e,"keydown",i[23])],u=!0)},p(c,L){L[0]&102823936&&(o=ki(c[13]),Bt(),t=Vn(t,L,g,1,c,o,n,e,Hn,Zi,null,Fi),Gt())},i(c){if(!r){for(let L=0;L<o.length;L+=1)le(t[L]);r=!0}},o(c){for(let L=0;L<t.length;L+=1)he(t[L]);r=!1},d(c){c&&ee(e);for(let L=0;L<t.length;L+=1)t[L].d();u=!1,qe(a)}}}function Pr(i){let e,t,n,r,u,a;return t=new Ri({}),{c(){e=X("div"),Qe(t.$$.fragment),n=Le(),r=X("div"),u=Xe(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(o,g){re(o,e,g),je(t,e,null),j(e,n),j(e,r),j(r,u),a=!0},p(o,g){(!a||g[0]&256)&&pt(u,o[8])},i(o){a||(le(t.$$.fragment,o),a=!0)},o(o){he(t.$$.fragment,o),a=!1},d(o){o&&ee(e),Ze(t)}}}function Ar(i){let e="",t;return{c(){t=Xe(e)},m(n,r){re(n,t,r)},p:ne,i:ne,o:ne,d(n){n&&ee(t)}}}function Ir(i){let e,t,n,r,u,a,o,g,c,L,_;return t=new Ri({}),g=new Oi({}),{c(){e=X("div"),Qe(t.$$.fragment),n=Le(),r=X("div"),u=Xe(i[7]),a=Le(),o=X("button"),Qe(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(o,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(C,M){re(C,e,M),je(t,e,null),j(e,n),j(e,r),j(r,u),j(e,a),j(e,o),je(g,o,null),c=!0,L||(_=de(o,"click",i[82]),L=!0)},p(C,M){(!c||M[0]&128)&&pt(u,C[7])},i(C){c||(le(t.$$.fragment,C),le(g.$$.fragment,C),c=!0)},o(C){he(t.$$.fragment,C),he(g.$$.fragment,C),c=!1},d(C){C&&ee(e),Ze(t),Ze(g),L=!1,_()}}}function Zi(i,e){var o;let t,n,r;function u(){return e[83](e[102])}function a(){return e[84](e[100])}return n=new ar({props:{feature:e[100],showPlaceType:e[11],style:e[15]===e[102]?"selected":((o=e[14])==null?void 0:o.id)===e[100].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",a),{key:i,first:null,c(){t=Bn(),Qe(n.$$.fragment),this.first=t},m(g,c){re(g,t,c),je(n,g,c),r=!0},p(g,c){var _;e=g;const L={};c[0]&8192&&(L.feature=e[100]),c[0]&2048&&(L.showPlaceType=e[11]),c[0]&57344&&(L.style=e[15]===e[102]?"selected":((_=e[14])==null?void 0:_.id)===e[100].id?"picked":"default"),c[0]&4096&&(L.iconsBaseUrl=e[12]),n.$set(L)},i(g){r||(le(n.$$.fragment,g),r=!0)},o(g){he(n.$$.fragment,g),r=!1},d(g){g&&ee(t),Ze(n,g)}}}function Br(i){let e,t,n,r,u,a,o,g,c,L,_,C,M,N,P,R,k,S,O,D,H,K=!1;u=new br({}),_=new Oi({});let G=i[20]&&qi(),s=i[6]==="button"&&ji(i);const l=i[72].default,f=Rn(l,i,i[71],null),m=[Ir,Ar,Pr,Rr],d=[];function b(p,h){var y,v;return p[19]?0:!p[16]&&!p[4]?1:((y=p[13])==null?void 0:y.length)===0?2:(v=p[13])!=null&&v.length&&(p[16]||p[4])?3:-1}return~(R=b(i))&&(k=d[R]=m[R](i)),{c(){e=Le(),t=X("form"),n=X("div"),r=X("button"),Qe(u.$$.fragment),a=Le(),o=X("input"),g=Le(),c=X("div"),L=X("button"),Qe(_.$$.fragment),C=Le(),G&&G.c(),M=Le(),s&&s.c(),N=Le(),f&&f.c(),P=Le(),k&&k.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(o,"placeholder",i[9]),x(o,"aria-label",i[9]),x(o,"class","svelte-bz0zu3"),x(L,"type","button"),x(L,"title",i[3]),x(L,"class","svelte-bz0zu3"),x(c,"class","clear-button-container svelte-bz0zu3"),Ge(c,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",S=At(i[2])+" svelte-bz0zu3"),Ge(t,"can-collapse",i[5]&&i[1]==="")},m(p,h){re(p,e,h),re(p,t,h),j(t,n),j(n,r),je(u,r,null),j(n,a),j(n,o),i[74](o),xi(o,i[1]),j(n,g),j(n,c),j(c,L),je(_,L,null),j(c,C),G&&G.m(c,null),j(n,M),s&&s.m(n,null),j(n,N),f&&f.m(n,null),j(t,P),~R&&d[R].m(t,null),O=!0,D||(H=[de(r,"click",i[73]),de(o,"input",i[75]),de(o,"focus",i[76]),de(o,"blur",i[77]),de(o,"click",i[78]),de(o,"keydown",i[23]),de(o,"input",i[24]),de(o,"change",i[79]),de(L,"click",i[80]),de(t,"submit",Gn(i[22]))],D=!0)},p(p,h){(!O||h[0]&512)&&x(o,"placeholder",p[9]),(!O||h[0]&512)&&x(o,"aria-label",p[9]),h[0]&2&&o.value!==p[1]&&xi(o,p[1]),(!O||h[0]&8)&&x(L,"title",p[3]),p[20]?G?h[0]&1048576&&le(G,1):(G=qi(),G.c(),le(G,1),G.m(c,null)):G&&(Bt(),he(G,1,1,()=>{G=null}),Gt()),(!O||h[0]&2)&&Ge(c,"displayable",p[1]!==""),p[6]==="button"?s?(s.p(p,h),h[0]&64&&le(s,1)):(s=ji(p),s.c(),le(s,1),s.m(n,N)):s&&(Bt(),he(s,1,1,()=>{s=null}),Gt()),f&&f.p&&(!O||h[2]&512)&&An(f,l,p,p[71],O?Pn(l,p[71],h,null):In(p[71]),null);let y=R;R=b(p),R===y?~R&&d[R].p(p,h):(k&&(Bt(),he(d[y],1,1,()=>{d[y]=null}),Gt()),~R?(k=d[R],k?k.p(p,h):(k=d[R]=m[R](p),k.c()),le(k,1),k.m(t,null)):k=null),(!O||h[0]&4&&S!==(S=At(p[2])+" svelte-bz0zu3"))&&x(t,"class",S),(!O||h[0]&38)&&Ge(t,"can-collapse",p[5]&&p[1]==="")},i(p){O||(le(K),le(u.$$.fragment,p),le(_.$$.fragment,p),le(G),le(s),le(f,p),le(k),O=!0)},o(p){he(K),he(u.$$.fragment,p),he(_.$$.fragment,p),he(G),he(s),he(f,p),he(k),O=!1},d(p){p&&(ee(e),ee(t)),Ze(u),i[74](null),Ze(_),G&&G.d(),s&&s.d(),f&&f.d(p),~R&&d[R].d(),D=!1,qe(H)}}}function Gr(i,e,t){let n,r,u,{$$slots:a={},$$scope:o}=e;const g={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:L}=e,{bbox:_=void 0}=e,{clearButtonTitle:C="clear"}=e,{clearOnBlur:M=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:P=!1}=e,{collapsed:R=!1}=e,{country:k=void 0}=e,{debounceSearch:S=200}=e,{enableReverse:O="never"}=e,{errorMessage:D="Something went wrong…"}=e,{filter:H=()=>!0}=e,{flyTo:K=!0}=e,{fuzzyMatch:G=!0}=e,{language:s=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:d=void 0}=e,{minLength:b=2}=e,{noResultsMessage:p="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:h="Search"}=e,{proximity:y=[{type:"server-geolocation"}]}=e,{reverseActive:v=O==="always"}=e,{reverseButtonTitle:w="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:A="full-geometry"}=e,{showPlaceType:B="if-needed"}=e,{showResultsWhileTyping:q=!0}=e,{autocompleteTimeout:te=void 0}=e,{selectFirst:J=!0}=e,{flyToSelected:F=!1}=e,{markerOnSelected:Z=!0}=e,{types:ae=void 0}=e;const at=[];let{reverseGeocodingTypes:tt=at}=e,{exhaustiveReverseGeocoding:ft=!1}=e,{excludeTypes:Ee=!1}=e;const it=void 0;let{reverseGeocodingExcludeTypes:me=it}=e,{zoom:fe=g}=e,{apiUrl:ie="https://api.maptiler.com/geocoding"}=e,{fetchParameters:fi={}}=e,{iconsBaseUrl:vn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.3-rc1/icons/"}=e,{adjustUrlQuery:ci=()=>{}}=e,{adjustUrl:di=()=>{}}=e;function ms(E){Ie.focus(E)}function ps(){Ie.blur()}function wn(E,oe=!0,ue=!1){t(1,T=E),oe?(t(15,Y=-1),Ln()):(_n(void 0,!ue,ue),setTimeout(()=>{Ie.focus(),Ie.select()}))}function ys(){t(13,U=void 0),t(14,W=void 0),t(15,Y=-1)}function bs(){t(65,ce=[]),t(14,W=void 0)}let U,ce,W,En="",Ie,Y=-1,ze,Ht=[],ct,nt,ke,mt,hi,Ke=!1;const vs=new Set,rt=Mi();function ws(){return!!ke}zn(()=>{d&&(d.setEventHandler(void 0),d.indicateReverse(!1),d.setSelectedMarker(-1),d.setFeatures(void 0,void 0,!1))});function Ln(E){if(t(17,Ke=!1),nt&&(window.clearTimeout(nt),nt=void 0),ke){window.clearTimeout(ke),t(66,ke=void 0),Mt(T,{appendSpace:!0});return}if(Y>-1&&U)t(14,W=U[Y]),t(1,T=W.place_type[0]==="reverse"?W.place_name:W.place_name.replace(/,.*/,"")),t(19,ze=void 0),t(65,ce=void 0),t(15,Y=-1);else if(T){const oe=E||!gi(T);Mt(T,{exact:!0}).then(()=>{t(65,ce=U),t(14,W=void 0),oe&&Es()}).catch(ue=>t(19,ze=ue))}}function gi(E){try{return Or(E,6)}catch{return!1}}async function Mt(E,{byId:oe=!1,exact:ue=!1,appendSpace:Be=!1}={}){var Ue,st,xn;t(19,ze=void 0),ct==null||ct.abort();const pe=new AbortController;t(20,ct=pe);try{const Q=gi(E),Nt=new URL(ie+"/"+encodeURIComponent(Q?Q.decimalLongitude+","+Q.decimalLatitude:E+(Be?" ":""))+".json"),Oe=Nt.searchParams;s!==void 0&&Oe.set("language",Array.isArray(s)?s.join(","):s??"");const[yi]=(d==null?void 0:d.getCenterAndZoom())??[];let Fe=(Ue=!Q||tt===at?ae:tt)==null?void 0:Ue.map(be=>typeof be=="string"?be:yi===void 0||(be[0]??0)<=yi&&yi<(be[1]??1/0)?be[2]:void 0).filter(be=>be!==void 0);Fe&&(Fe=[...new Set(Fe)],Oe.set("types",Fe.join(",")));const Tn=!Q||me===it?Ee:me;if(Tn&&Oe.set("excludeTypes",String(Tn)),_&&Oe.set("bbox",_.map(be=>be.toFixed(6)).join(",")),k&&Oe.set("country",Array.isArray(k)?k.join(","):k),!oe&&!Q){const be=await wr(d,y,pe);be&&Oe.set("proximity",be),(ue||!q)&&Oe.set("autocomplete","false"),Oe.set("fuzzyMatch",String(G))}const kt=m===f?l:m;kt!==void 0&&kt>1&&(Fe==null?void 0:Fe.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),Q?(kt===1||kt!==void 0&&(ft||(Fe==null?void 0:Fe.length)===1))&&Oe.set("limit",String(kt)):l!==void 0&&Oe.set("limit",String(l)),Oe.set("key",L),ci(Oe),di(Nt);const Ws=Nt.searchParams.get("types")===""&&Nt.searchParams.get("excludeTypes")!=="true",Vt=Nt.toString();if(Vt===En){oe?(N&&t(13,U=void 0),t(14,W=Ht[0])):(t(13,U=Ht),((st=U[Y])==null?void 0:st.id)!==(r==null?void 0:r.id)&&t(15,Y=-1));return}En=Vt;let Ot;if(Ws)Ot={type:"FeatureCollection",features:[]};else{const be=await fetch(Vt,{signal:pe.signal,...fi});if(!be.ok)throw new Error(await be.text());Ot=await be.json()}rt("response",{url:Vt,featureCollection:Ot}),oe?(N&&t(13,U=void 0),t(14,W=Ot.features[0]),Ht=[W]):(t(13,U=Ot.features.filter(H)),Q&&U.unshift({type:"Feature",properties:{},id:"reverse_"+Q.decimalLongitude+"_"+Q.decimalLatitude,text:Q.decimalLatitude+", "+Q.decimalLongitude,place_name:Q.decimalLatitude+", "+Q.decimalLongitude,place_type:["reverse"],center:[Q.decimalLongitude,Q.decimalLatitude],bbox:[Q.decimalLongitude,Q.decimalLatitude,Q.decimalLongitude,Q.decimalLatitude],geometry:{type:"Point",coordinates:[Q.decimalLongitude,Q.decimalLatitude]}}),Ht=U,((xn=U[Y])==null?void 0:xn.id)!==(r==null?void 0:r.id)&&t(15,Y=-1),Q&&Ie.focus())}catch(Q){if(Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError")return;throw Q}finally{pe===ct&&t(20,ct=void 0)}}function Es(){var Be;if(!(ce!=null&&ce.length)||!K)return;const E=[180,90,-180,-90],oe=!ce.some(pe=>!pe.matching_text);let ue;for(const pe of ce){const Ue=Ct(pe);if(ue=ue===void 0?Ue:Ue===void 0?ue:Math.max(ue,Ue),oe||!pe.matching_text)for(const st of[0,1,2,3])E[st]=Math[st<2?"min":"max"](E[st],((Be=pe.bbox)==null?void 0:Be[st])??pe.center[st%2])}d&&ce.length>0&&(W&&E[0]===E[2]&&E[1]===E[3]?d.flyTo(W.center,Ct(W)):d.fitBounds(vt(E),50,ue))}function mi(){!W||!d||(!W.bbox||W.bbox[0]===W.bbox[2]&&W.bbox[1]===W.bbox[3]?d.flyTo(W.center,Ct(W)):d.fitBounds(vt(W.bbox),50,Ct(W)))}function Ct(E){var ue;if(!E.bbox||E.bbox[0]!==E.bbox[2]&&E.bbox[1]!==E.bbox[3])return;const oe=E.id.replace(/\..*/,"");return(Array.isArray((ue=E.properties)==null?void 0:ue.categories)?E.properties.categories.reduce((Be,pe)=>{const Ue=fe[oe+"."+pe];return Be===void 0?Ue:Ue===void 0?Be:Math.max(Be,Ue)},void 0):void 0)??fe[oe]}function Ls(E){t(0,v=O==="always"),t(13,U=void 0),t(14,W=void 0),t(15,Y=-1),wn(E[1].toFixed(6)+", "+vr(E[0],[-180,180],!0).toFixed(6),!1,!0)}function _s(E){if(!U)return;let oe=E.key==="ArrowDown"?1:E.key==="ArrowUp"?-1:0;oe&&(Ie.focus(),t(17,Ke=!0),E.preventDefault(),W&&Y===-1&&t(15,Y=U.findIndex(ue=>ue.id===(W==null?void 0:W.id))),Y===(W||J?0:-1)&&oe===-1&&t(15,Y=U.length),t(15,Y+=oe),Y>=U.length&&t(15,Y=-1),Y<0&&(W||J)&&t(15,Y=0))}function _n(E,oe=!0,ue=!1){if(t(19,ze=void 0),t(14,W=void 0),t(17,Ke=!0),nt&&(window.clearTimeout(nt),nt=void 0),ke&&(window.clearTimeout(ke),t(66,ke=void 0)),!q&&!ue||T.length<b){t(13,U=void 0);return}const Be=T;nt=window.setTimeout(()=>{nt=void 0,Mt(Be).catch(pe=>t(19,ze=pe))},oe?S:0),T.endsWith(" ")||t(66,ke=window.setTimeout(()=>{t(66,ke=void 0),Mt(Be,{appendSpace:!0}).catch(pe=>t(19,ze=pe))},te))}function pi(E){W&&(W==null?void 0:W.id)===(E==null?void 0:E.id)?mi():(t(14,W=E),t(1,T=E.place_name))}function Sn(E){t(15,Y=E)}function Ss(){(!J||W)&&t(15,Y=-1),F&&mi()}const xs=()=>Ie.focus();function Ts(E){Yt[E?"unshift":"push"](()=>{Ie=E,t(18,Ie)})}function Ms(){T=this.value,t(1,T),t(17,Ke),t(31,M),t(16,mt)}const Cs=()=>t(17,Ke=!0),Ns=()=>t(17,Ke=!1),ks=()=>t(17,Ke=!0),Os=()=>t(14,W=void 0),Rs=()=>{t(1,T=""),t(14,W=void 0),Ie.focus()},Ps=()=>t(0,v=!v),As=()=>t(19,ze=void 0),Is=E=>Sn(E),Bs=E=>pi(E),Gs=()=>{};return i.$$set=E=>{"class"in E&&t(2,c=E.class),"apiKey"in E&&t(29,L=E.apiKey),"bbox"in E&&t(30,_=E.bbox),"clearButtonTitle"in E&&t(3,C=E.clearButtonTitle),"clearOnBlur"in E&&t(31,M=E.clearOnBlur),"clearListOnPick"in E&&t(32,N=E.clearListOnPick),"keepListOpen"in E&&t(4,P=E.keepListOpen),"collapsed"in E&&t(5,R=E.collapsed),"country"in E&&t(33,k=E.country),"debounceSearch"in E&&t(34,S=E.debounceSearch),"enableReverse"in E&&t(6,O=E.enableReverse),"errorMessage"in E&&t(7,D=E.errorMessage),"filter"in E&&t(35,H=E.filter),"flyTo"in E&&t(36,K=E.flyTo),"fuzzyMatch"in E&&t(37,G=E.fuzzyMatch),"language"in E&&t(38,s=E.language),"limit"in E&&t(39,l=E.limit),"reverseGeocodingLimit"in E&&t(40,m=E.reverseGeocodingLimit),"mapController"in E&&t(41,d=E.mapController),"minLength"in E&&t(42,b=E.minLength),"noResultsMessage"in E&&t(8,p=E.noResultsMessage),"placeholder"in E&&t(9,h=E.placeholder),"proximity"in E&&t(43,y=E.proximity),"reverseActive"in E&&t(0,v=E.reverseActive),"reverseButtonTitle"in E&&t(10,w=E.reverseButtonTitle),"searchValue"in E&&t(1,T=E.searchValue),"pickedResultStyle"in E&&t(44,A=E.pickedResultStyle),"showPlaceType"in E&&t(11,B=E.showPlaceType),"showResultsWhileTyping"in E&&t(45,q=E.showResultsWhileTyping),"autocompleteTimeout"in E&&t(46,te=E.autocompleteTimeout),"selectFirst"in E&&t(47,J=E.selectFirst),"flyToSelected"in E&&t(48,F=E.flyToSelected),"markerOnSelected"in E&&t(49,Z=E.markerOnSelected),"types"in E&&t(50,ae=E.types),"reverseGeocodingTypes"in E&&t(51,tt=E.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in E&&t(52,ft=E.exhaustiveReverseGeocoding),"excludeTypes"in E&&t(53,Ee=E.excludeTypes),"reverseGeocodingExcludeTypes"in E&&t(54,me=E.reverseGeocodingExcludeTypes),"zoom"in E&&t(55,fe=E.zoom),"apiUrl"in E&&t(56,ie=E.apiUrl),"fetchParameters"in E&&t(57,fi=E.fetchParameters),"iconsBaseUrl"in E&&t(12,vn=E.iconsBaseUrl),"adjustUrlQuery"in E&&t(58,ci=E.adjustUrlQuery),"adjustUrl"in E&&t(59,di=E.adjustUrl),"$$scope"in E&&t(71,o=E.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,v=O==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&A!=="marker-only"&&W&&!W.address&&W.geometry.type==="Point"&&W.place_type[0]!=="reverse"&&Mt(W.id,{byId:!0}).catch(E=>t(19,ze=E)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&32&&(d&&W&&W.id!==hi&&K&&(mi(),N&&t(13,U=void 0),t(65,ce=void 0),t(15,Y=-1)),t(67,hi=W==null?void 0:W.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,mt=Ke),M&&!mt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<b&&(t(13,U=void 0),t(19,ze=void 0),t(65,ce=U)),i.$$.dirty[0]&8192|i.$$.dirty[1]&65536&&J&&U!=null&&U.length&&(ws()||t(15,Y=0)),i.$$.dirty[0]&57344|i.$$.dirty[1]&65536&&J&&U!=null&&U.length&&Y==-1&&!W&&t(15,Y=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&8&&ce!==U&&t(65,ce=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&d&&d.setEventHandler(E=>{switch(E.type){case"mapClick":v&&Ls(E.coordinates);break;case"markerClick":{const oe=U==null?void 0:U.find(ue=>ue.id===E.id);oe&&pi(oe)}break;case"markerMouseEnter":ce&&t(15,Y=mt?(U==null?void 0:U.findIndex(oe=>oe.id===E.id))??-1:-1);break;case"markerMouseLeave":ce&&t(15,Y=-1);break}}),i.$$.dirty[0]&40960&&t(68,r=U==null?void 0:U[Y]),i.$$.dirty[1]&132128|i.$$.dirty[2]&64&&d&&r&&K&&F&&d.flyTo(r.center,Ct(r)),i.$$.dirty[1]&8192&&t(70,n=A==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&263168|i.$$.dirty[2]&256&&(Z||d==null||d.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&263168|i.$$.dirty[2]&328&&d&&Z&&!ce&&(d.setFeatures(r?[r]:void 0,W,n),d.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&264&&d&&d.setFeatures(ce,W,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&ce&&d&&d.setSelectedMarker(Y),i.$$.dirty[2]&80&&r&&(window.clearTimeout(ke),t(66,ke=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&d){const E=gi(T);d.setReverseMarker(E?[E.decimalLongitude,E.decimalLatitude]:void 0)}i.$$.dirty[2]&64&&rt("select",{feature:r}),i.$$.dirty[0]&16384&&rt("pick",{feature:W}),i.$$.dirty[0]&73744&&t(69,u=!!(U!=null&&U.length)&&(mt||P)),i.$$.dirty[2]&128&&rt("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&rt("featureslisted",{features:U}),i.$$.dirty[2]&8&&rt("featuresmarked",{features:ce}),i.$$.dirty[0]&1&&rt("reversetoggle",{reverse:v}),i.$$.dirty[0]&2&&rt("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&d&&d.indicateReverse(v)},[v,T,c,C,P,R,O,D,p,h,w,B,vn,U,W,Y,mt,Ke,Ie,ze,ct,vs,Ln,_s,_n,pi,Sn,Ss,g,L,_,M,N,k,S,H,K,G,s,l,m,d,b,y,A,q,te,J,F,Z,ae,tt,ft,Ee,me,fe,ie,fi,ci,di,ms,ps,wn,ys,bs,ce,ke,hi,r,u,n,o,a,xs,Ts,Ms,Cs,Ns,ks,Os,Rs,Ps,As,Is,Bs,Gs]}let Wr=class extends $e{constructor(e){super(),Je(this,e,Gr,Br,Ye,{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,autocompleteTimeout:46,selectFirst:47,flyToSelected:48,markerOnSelected:49,types:50,reverseGeocodingTypes:51,exhaustiveReverseGeocoding:52,excludeTypes:53,reverseGeocodingExcludeTypes:54,zoom:55,apiUrl:56,fetchParameters:57,iconsBaseUrl:12,adjustUrlQuery:58,adjustUrl:59,focus:60,blur:61,setQuery:62,clearList:63,clearMap:64},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[60]}get blur(){return this.$$.ctx[61]}get setQuery(){return this.$$.ctx[62]}get clearList(){return this.$$.ctx[63]}get clearMap(){return this.$$.ctx[64]}};function Lt(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 ti(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 Lt({type:"Polygon",coordinates:i},e,t)}function _t(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Hi(i,e,t={}){return Lt({type:"MultiPolygon",coordinates:i},e,t)}function Vi(i,e,t){if(i!==null)for(var n,r,u,a,o,g,c,L=0,_=0,C,M=i.type,N=M==="FeatureCollection",P=M==="Feature",R=N?i.features.length:1,k=0;k<R;k++){c=N?i.features[k].geometry:P?i.geometry:i,C=c?c.type==="GeometryCollection":!1,o=C?c.geometries.length:1;for(var S=0;S<o;S++){var O=0,D=0;if(a=C?c.geometries[S]:c,a!==null){g=a.coordinates;var H=a.type;switch(L=0,H){case null:break;case"Point":if(e(g,_,k,O,D)===!1)return!1;_++,O++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],_,k,O,D)===!1)return!1;_++,H==="MultiPoint"&&O++}H==="LineString"&&O++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-L;r++){if(e(g[n][r],_,k,O,D)===!1)return!1;_++}H==="MultiLineString"&&O++,H==="Polygon"&&D++}H==="Polygon"&&O++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(D=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-L;u++){if(e(g[n][r][u],_,k,O,D)===!1)return!1;_++}D++}O++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Vi(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,o,g,c,L,_,C=0,M=i.type==="FeatureCollection",N=i.type==="Feature",P=M?i.features.length:1;for(t=0;t<P;t++){for(o=M?i.features[t].geometry:N?i.geometry:i,c=M?i.features[t].properties:N?i.properties:{},L=M?i.features[t].bbox:N?i.bbox:void 0,_=M?i.features[t].id:N?i.id:void 0,g=o?o.type==="GeometryCollection":!1,a=g?o.geometries.length:1,r=0;r<a;r++){if(u=g?o.geometries[r]:o,u===null){if(e(null,C,c,L,_)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,C,c,L,_)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],C,c,L,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function Dr(i,e){ii(i,function(t,n,r,u,a){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(Lt(t,r,{bbox:u,id:a}),n,0)===!1?!1:void 0}var g;switch(o){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var c=0;c<t.coordinates.length;c++){var L=t.coordinates[c],_={type:g,coordinates:L};if(e(Lt(_,r),n,c)===!1)return!1}})}function zr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Vi(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 ni=zr;function Ur(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return Ki(i);case"FeatureCollection":return Fr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ri(i);default:throw new Error("unknown GeoJSON type")}}function Ki(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=Yi(i.properties),i.geometry==null?e.geometry=null:e.geometry=ri(i.geometry),e}function Yi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=Yi(n):e[t]=n}),e}function Fr(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>Ki(t)),e}function ri(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>ri(t)),e):(e.coordinates=Xi(i.coordinates),e)}function Xi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>Xi(t))}var qr=Ur,jr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,si=Math.ceil,Me=Math.floor,we="[BigNumber Error] ",Qi=we+"Number primitive has more than 15 significant digits: ",Ae=1e14,z=14,Ji=9007199254740991,oi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],et=1e7,_e=1e9;function $i(i){var e,t,n,r=S.prototype={constructor:S,toString:null,valueOf:null},u=new S(1),a=20,o=4,g=-7,c=21,L=-1e7,_=1e7,C=!1,M=1,N=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function S(s,l){var f,m,d,b,p,h,y,v,w=this;if(!(w instanceof S))return new S(s,l);if(l==null){if(s&&s._isBigNumber===!0){w.s=s.s,!s.c||s.e>_?w.c=w.e=null:s.e<L?w.c=[w.e=0]:(w.e=s.e,w.c=s.c.slice());return}if((h=typeof s=="number")&&s*0==0){if(w.s=1/s<0?(s=-s,-1):1,s===~~s){for(b=0,p=s;p>=10;p/=10,b++);b>_?w.c=w.e=null:(w.e=b,w.c=[s]);return}v=String(s)}else{if(!jr.test(v=String(s)))return n(w,v,h);w.s=v.charCodeAt(0)==45?(v=v.slice(1),-1):1}(b=v.indexOf("."))>-1&&(v=v.replace(".","")),(p=v.search(/e/i))>0?(b<0&&(b=p),b+=+v.slice(p+1),v=v.substring(0,p)):b<0&&(b=v.length)}else{if(se(l,2,R.length,"Base"),l==10&&k)return w=new S(s),K(w,a+w.e+1,o);if(v=String(s),h=typeof s=="number"){if(s*0!=0)return n(w,v,h,l);if(w.s=1/s<0?(v=v.slice(1),-1):1,S.DEBUG&&v.replace(/^0\.0*|\./,"").length>15)throw Error(Qi+s)}else w.s=v.charCodeAt(0)===45?(v=v.slice(1),-1):1;for(f=R.slice(0,l),b=p=0,y=v.length;p<y;p++)if(f.indexOf(m=v.charAt(p))<0){if(m=="."){if(p>b){b=y;continue}}else if(!d&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){d=!0,p=-1,b=0;continue}return n(w,String(s),h,l)}h=!1,v=t(v,l,10,w.s),(b=v.indexOf("."))>-1?v=v.replace(".",""):b=v.length}for(p=0;v.charCodeAt(p)===48;p++);for(y=v.length;v.charCodeAt(--y)===48;);if(v=v.slice(p,++y)){if(y-=p,h&&S.DEBUG&&y>15&&(s>Ji||s!==Me(s)))throw Error(Qi+w.s*s);if((b=b-p-1)>_)w.c=w.e=null;else if(b<L)w.c=[w.e=0];else{if(w.e=b,w.c=[],p=(b+1)%z,b<0&&(p+=z),p<y){for(p&&w.c.push(+v.slice(0,p)),y-=z;p<y;)w.c.push(+v.slice(p,p+=z));p=z-(v=v.slice(p)).length}else p-=y;for(;p--;v+="0");w.c.push(+v)}}else w.c=[w.e=0]}S.clone=$i,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(s){var l,f;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(l="DECIMAL_PLACES")&&(f=s[l],se(f,0,_e,l),a=f),s.hasOwnProperty(l="ROUNDING_MODE")&&(f=s[l],se(f,0,8,l),o=f),s.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=s[l],f&&f.pop?(se(f[0],-1e9,0,l),se(f[1],0,_e,l),g=f[0],c=f[1]):(se(f,-1e9,_e,l),g=-(c=f<0?-f:f))),s.hasOwnProperty(l="RANGE"))if(f=s[l],f&&f.pop)se(f[0],-1e9,-1,l),se(f[1],1,_e,l),L=f[0],_=f[1];else if(se(f,-1e9,_e,l),f)L=-(_=f<0?-f:f);else throw Error(we+l+" cannot be zero: "+f);if(s.hasOwnProperty(l="CRYPTO"))if(f=s[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))C=f;else throw C=!f,Error(we+"crypto unavailable");else C=f;else throw Error(we+l+" not true or false: "+f);if(s.hasOwnProperty(l="MODULO_MODE")&&(f=s[l],se(f,0,9,l),M=f),s.hasOwnProperty(l="POW_PRECISION")&&(f=s[l],se(f,0,_e,l),N=f),s.hasOwnProperty(l="FORMAT"))if(f=s[l],typeof f=="object")P=f;else throw Error(we+l+" not an object: "+f);if(s.hasOwnProperty(l="ALPHABET"))if(f=s[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))k=f.slice(0,10)=="0123456789",R=f;else throw Error(we+l+" invalid: "+f)}else throw Error(we+"Object expected: "+s);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[g,c],RANGE:[L,_],CRYPTO:C,MODULO_MODE:M,POW_PRECISION:N,FORMAT:P,ALPHABET:R}},S.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!S.DEBUG)return!0;var l,f,m=s.c,d=s.e,b=s.s;e:if({}.toString.call(m)=="[object Array]"){if((b===1||b===-1)&&d>=-1e9&&d<=_e&&d===Me(d)){if(m[0]===0){if(d===0&&m.length===1)return!0;break e}if(l=(d+1)%z,l<1&&(l+=z),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Ae||f!==Me(f))break e;if(f!==0)return!0}}}else if(m===null&&d===null&&(b===null||b===1||b===-1))return!0;throw Error(we+"Invalid BigNumber: "+s)},S.maximum=S.max=function(){return D(arguments,-1)},S.minimum=S.min=function(){return D(arguments,1)},S.random=function(){var s=9007199254740992,l=Math.random()*s&2097151?function(){return Me(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,d,b,p,h,y=0,v=[],w=new S(u);if(f==null?f=a:se(f,0,_e),p=si(f/z),C)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));y<p;)h=m[y]*131072+(m[y+1]>>>11),h>=9e15?(d=crypto.getRandomValues(new Uint32Array(2)),m[y]=d[0],m[y+1]=d[1]):(v.push(h%1e14),y+=2);y=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);y<p;)h=(m[y]&31)*281474976710656+m[y+1]*1099511627776+m[y+2]*4294967296+m[y+3]*16777216+(m[y+4]<<16)+(m[y+5]<<8)+m[y+6],h>=9e15?crypto.randomBytes(7).copy(m,y):(v.push(h%1e14),y+=7);y=p/7}else throw C=!1,Error(we+"crypto unavailable");if(!C)for(;y<p;)h=l(),h<9e15&&(v[y++]=h%1e14);for(p=v[--y],f%=z,p&&f&&(h=oi[z-f],v[y]=Me(p/h)*h);v[y]===0;v.pop(),y--);if(y<0)v=[b=0];else{for(b=-1;v[0]===0;v.splice(0,1),b-=z);for(y=1,h=v[0];h>=10;h/=10,y++);y<z&&(b-=z-y)}return w.e=b,w.c=v,w}}(),S.sum=function(){for(var s=1,l=arguments,f=new S(l[0]);s<l.length;)f=f.plus(l[s++]);return f},t=function(){var s="0123456789";function l(f,m,d,b){for(var p,h=[0],y,v=0,w=f.length;v<w;){for(y=h.length;y--;h[y]*=m);for(h[0]+=b.indexOf(f.charAt(v++)),p=0;p<h.length;p++)h[p]>d-1&&(h[p+1]==null&&(h[p+1]=0),h[p+1]+=h[p]/d|0,h[p]%=d)}return h.reverse()}return function(f,m,d,b,p){var h,y,v,w,T,A,B,q,te=f.indexOf("."),J=a,F=o;for(te>=0&&(w=N,N=0,f=f.replace(".",""),q=new S(m),A=q.pow(f.length-te),N=w,q.c=l(He(Ne(A.c),A.e,"0"),10,d,s),q.e=q.c.length),B=l(f,m,d,p?(h=R,s):(h=s,R)),v=w=B.length;B[--w]==0;B.pop());if(!B[0])return h.charAt(0);if(te<0?--v:(A.c=B,A.e=v,A.s=b,A=e(A,q,J,F,d),B=A.c,T=A.r,v=A.e),y=v+J+1,te=B[y],w=d/2,T=T||y<0||B[y+1]!=null,T=F<4?(te!=null||T)&&(F==0||F==(A.s<0?3:2)):te>w||te==w&&(F==4||T||F==6&&B[y-1]&1||F==(A.s<0?8:7)),y<1||!B[0])f=T?He(h.charAt(1),-J,h.charAt(0)):h.charAt(0);else{if(B.length=y,T)for(--d;++B[--y]>d;)B[y]=0,y||(++v,B=[1].concat(B));for(w=B.length;!B[--w];);for(te=0,f="";te<=w;f+=h.charAt(B[te++]));f=He(f,v,h.charAt(0))}return f}}(),e=function(){function s(m,d,b){var p,h,y,v,w=0,T=m.length,A=d%et,B=d/et|0;for(m=m.slice();T--;)y=m[T]%et,v=m[T]/et|0,p=B*y+v*A,h=A*y+p%et*et+w,w=(h/b|0)+(p/et|0)+B*v,m[T]=h%b;return w&&(m=[w].concat(m)),m}function l(m,d,b,p){var h,y;if(b!=p)y=b>p?1:-1;else for(h=y=0;h<b;h++)if(m[h]!=d[h]){y=m[h]>d[h]?1:-1;break}return y}function f(m,d,b,p){for(var h=0;b--;)m[b]-=h,h=m[b]<d[b]?1:0,m[b]=h*p+m[b]-d[b];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,d,b,p,h){var y,v,w,T,A,B,q,te,J,F,Z,ae,at,tt,ft,Ee,it,me=m.s==d.s?1:-1,fe=m.c,ie=d.c;if(!fe||!fe[0]||!ie||!ie[0])return new S(!m.s||!d.s||(fe?ie&&fe[0]==ie[0]:!ie)?NaN:fe&&fe[0]==0||!ie?me*0:me/0);for(te=new S(me),J=te.c=[],v=m.e-d.e,me=b+v+1,h||(h=Ae,v=Ce(m.e/z)-Ce(d.e/z),me=me/z|0),w=0;ie[w]==(fe[w]||0);w++);if(ie[w]>(fe[w]||0)&&v--,me<0)J.push(1),T=!0;else{for(tt=fe.length,Ee=ie.length,w=0,me+=2,A=Me(h/(ie[0]+1)),A>1&&(ie=s(ie,A,h),fe=s(fe,A,h),Ee=ie.length,tt=fe.length),at=Ee,F=fe.slice(0,Ee),Z=F.length;Z<Ee;F[Z++]=0);it=ie.slice(),it=[0].concat(it),ft=ie[0],ie[1]>=h/2&&ft++;do{if(A=0,y=l(ie,F,Ee,Z),y<0){if(ae=F[0],Ee!=Z&&(ae=ae*h+(F[1]||0)),A=Me(ae/ft),A>1)for(A>=h&&(A=h-1),B=s(ie,A,h),q=B.length,Z=F.length;l(B,F,q,Z)==1;)A--,f(B,Ee<q?it:ie,q,h),q=B.length,y=1;else A==0&&(y=A=1),B=ie.slice(),q=B.length;if(q<Z&&(B=[0].concat(B)),f(F,B,Z,h),Z=F.length,y==-1)for(;l(ie,F,Ee,Z)<1;)A++,f(F,Ee<Z?it:ie,Z,h),Z=F.length}else y===0&&(A++,F=[0]);J[w++]=A,F[0]?F[Z++]=fe[at]||0:(F=[fe[at]],Z=1)}while((at++<tt||F[0]!=null)&&me--);T=F[0]!=null,J[0]||J.splice(0,1)}if(h==Ae){for(w=1,me=J[0];me>=10;me/=10,w++);K(te,b+(te.e=w+v*z-1)+1,p,T)}else te.e=v,te.r=+T;return te}}();function O(s,l,f,m){var d,b,p,h,y;if(f==null?f=o:se(f,0,8),!s.c)return s.toString();if(d=s.c[0],p=s.e,l==null)y=Ne(s.c),y=m==1||m==2&&(p<=g||p>=c)?zt(y,p):He(y,p,"0");else if(s=K(new S(s),l,f),b=s.e,y=Ne(s.c),h=y.length,m==1||m==2&&(l<=b||b<=g)){for(;h<l;y+="0",h++);y=zt(y,b)}else if(l-=p,y=He(y,b,"0"),b+1>h){if(--l>0)for(y+=".";l--;y+="0");}else if(l+=b-h,l>0)for(b+1==h&&(y+=".");l--;y+="0");return s.s<0&&d?"-"+y:y}function D(s,l){for(var f,m,d=1,b=new S(s[0]);d<s.length;d++)m=new S(s[d]),(!m.s||(f=lt(b,m))===l||f===0&&b.s===l)&&(b=m);return b}function H(s,l,f){for(var m=1,d=l.length;!l[--d];l.pop());for(d=l[0];d>=10;d/=10,m++);return(f=m+f*z-1)>_?s.c=s.e=null:f<L?s.c=[s.e=0]:(s.e=f,s.c=l),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(b,p,h,y){var v,w=h?p:p.replace(d,"");if(m.test(w))b.s=isNaN(w)?null:w<0?-1:1;else{if(!h&&(w=w.replace(s,function(T,A,B){return v=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!y||y==v?A:T}),y&&(v=y,w=w.replace(l,"$1").replace(f,"0.$1")),p!=w))return new S(w,v);if(S.DEBUG)throw Error(we+"Not a"+(y?" base "+y:"")+" number: "+p);b.s=null}b.c=b.e=null}}();function K(s,l,f,m){var d,b,p,h,y,v,w,T=s.c,A=oi;if(T){e:{for(d=1,h=T[0];h>=10;h/=10,d++);if(b=l-d,b<0)b+=z,p=l,y=T[v=0],w=Me(y/A[d-p-1]%10);else if(v=si((b+1)/z),v>=T.length)if(m){for(;T.length<=v;T.push(0));y=w=0,d=1,b%=z,p=b-z+1}else break e;else{for(y=h=T[v],d=1;h>=10;h/=10,d++);b%=z,p=b-z+d,w=p<0?0:Me(y/A[d-p-1]%10)}if(m=m||l<0||T[v+1]!=null||(p<0?y:y%A[d-p-1]),m=f<4?(w||m)&&(f==0||f==(s.s<0?3:2)):w>5||w==5&&(f==4||m||f==6&&(b>0?p>0?y/A[d-p]:0:T[v-1])%10&1||f==(s.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=s.e+1,T[0]=A[(z-l%z)%z],s.e=-l||0):T[0]=s.e=0,s;if(b==0?(T.length=v,h=1,v--):(T.length=v+1,h=A[z-b],T[v]=p>0?Me(y/A[d-p]%A[p])*h:0),m)for(;;)if(v==0){for(b=1,p=T[0];p>=10;p/=10,b++);for(p=T[0]+=h,h=1;p>=10;p/=10,h++);b!=h&&(s.e++,T[0]==Ae&&(T[0]=1));break}else{if(T[v]+=h,T[v]!=Ae)break;T[v--]=0,h=1}for(b=T.length;T[--b]===0;T.pop());}s.e>_?s.c=s.e=null:s.e<L&&(s.c=[s.e=0])}return s}function G(s){var l,f=s.e;return f===null?s.toString():(l=Ne(s.c),l=f<=g||f>=c?zt(l,f):He(l,f,"0"),s.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var s=new S(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,l){return lt(this,new S(s,l))},r.decimalPlaces=r.dp=function(s,l){var f,m,d,b=this;if(s!=null)return se(s,0,_e),l==null?l=o:se(l,0,8),K(new S(b),s+b.e+1,l);if(!(f=b.c))return null;if(m=((d=f.length-1)-Ce(this.e/z))*z,d=f[d])for(;d%10==0;d/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,l){return e(this,new S(s,l),a,o)},r.dividedToIntegerBy=r.idiv=function(s,l){return e(this,new S(s,l),0,1)},r.exponentiatedBy=r.pow=function(s,l){var f,m,d,b,p,h,y,v,w,T=this;if(s=new S(s),s.c&&!s.isInteger())throw Error(we+"Exponent not an integer: "+G(s));if(l!=null&&(l=new S(l)),h=s.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!s.c||!s.c[0])return w=new S(Math.pow(+G(T),h?s.s*(2-Dt(s)):+G(s))),l?w.mod(l):w;if(y=s.s<0,l){if(l.c?!l.c[0]:!l.s)return new S(NaN);m=!y&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(s.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||h&&T.c[1]>=24e7:T.c[0]<8e13||h&&T.c[0]<=9999975e7)))return b=T.s<0&&Dt(s)?-0:0,T.e>-1&&(b=1/b),new S(y?1/b:b);N&&(b=si(N/z+2))}for(h?(f=new S(.5),y&&(s.s=1),v=Dt(s)):(d=Math.abs(+G(s)),v=d%2),w=new S(u);;){if(v){if(w=w.times(T),!w.c)break;b?w.c.length>b&&(w.c.length=b):m&&(w=w.mod(l))}if(d){if(d=Me(d/2),d===0)break;v=d%2}else if(s=s.times(f),K(s,s.e+1,1),s.e>14)v=Dt(s);else{if(d=+G(s),d===0)break;v=d%2}T=T.times(T),b?T.c&&T.c.length>b&&(T.c.length=b):m&&(T=T.mod(l))}return m?w:(y&&(w=u.div(w)),l?w.mod(l):b?K(w,N,o,p):w)},r.integerValue=function(s){var l=new S(this);return s==null?s=o:se(s,0,8),K(l,l.e+1,s)},r.isEqualTo=r.eq=function(s,l){return lt(this,new S(s,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,l){return lt(this,new S(s,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,l){return(l=lt(this,new S(s,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Ce(this.e/z)>this.c.length-2},r.isLessThan=r.lt=function(s,l){return lt(this,new S(s,l))<0},r.isLessThanOrEqualTo=r.lte=function(s,l){return(l=lt(this,new S(s,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(s,l){var f,m,d,b,p=this,h=p.s;if(s=new S(s,l),l=s.s,!h||!l)return new S(NaN);if(h!=l)return s.s=-l,p.plus(s);var y=p.e/z,v=s.e/z,w=p.c,T=s.c;if(!y||!v){if(!w||!T)return w?(s.s=-l,s):new S(T?p:NaN);if(!w[0]||!T[0])return T[0]?(s.s=-l,s):new S(w[0]?p:o==3?-0:0)}if(y=Ce(y),v=Ce(v),w=w.slice(),h=y-v){for((b=h<0)?(h=-h,d=w):(v=y,d=T),d.reverse(),l=h;l--;d.push(0));d.reverse()}else for(m=(b=(h=w.length)<(l=T.length))?h:l,h=l=0;l<m;l++)if(w[l]!=T[l]){b=w[l]<T[l];break}if(b&&(d=w,w=T,T=d,s.s=-s.s),l=(m=T.length)-(f=w.length),l>0)for(;l--;w[f++]=0);for(l=Ae-1;m>h;){if(w[--m]<T[m]){for(f=m;f&&!w[--f];w[f]=l);--w[f],w[m]+=Ae}w[m]-=T[m]}for(;w[0]==0;w.splice(0,1),--v);return w[0]?H(s,w,v):(s.s=o==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,l){var f,m,d=this;return s=new S(s,l),!d.c||!s.s||s.c&&!s.c[0]?new S(NaN):!s.c||d.c&&!d.c[0]?new S(d):(M==9?(m=s.s,s.s=1,f=e(d,s,0,3),s.s=m,f.s*=m):f=e(d,s,0,M),s=d.minus(f.times(s)),!s.c[0]&&M==1&&(s.s=d.s),s)},r.multipliedBy=r.times=function(s,l){var f,m,d,b,p,h,y,v,w,T,A,B,q,te,J,F=this,Z=F.c,ae=(s=new S(s,l)).c;if(!Z||!ae||!Z[0]||!ae[0])return!F.s||!s.s||Z&&!Z[0]&&!ae||ae&&!ae[0]&&!Z?s.c=s.e=s.s=null:(s.s*=F.s,!Z||!ae?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=Ce(F.e/z)+Ce(s.e/z),s.s*=F.s,y=Z.length,T=ae.length,y<T&&(q=Z,Z=ae,ae=q,d=y,y=T,T=d),d=y+T,q=[];d--;q.push(0));for(te=Ae,J=et,d=T;--d>=0;){for(f=0,A=ae[d]%J,B=ae[d]/J|0,p=y,b=d+p;b>d;)v=Z[--p]%J,w=Z[p]/J|0,h=B*v+w*A,v=A*v+h%J*J+q[b]+f,f=(v/te|0)+(h/J|0)+B*w,q[b--]=v%te;q[b]=f}return f?++m:q.splice(0,1),H(s,q,m)},r.negated=function(){var s=new S(this);return s.s=-s.s||null,s},r.plus=function(s,l){var f,m=this,d=m.s;if(s=new S(s,l),l=s.s,!d||!l)return new S(NaN);if(d!=l)return s.s=-l,m.minus(s);var b=m.e/z,p=s.e/z,h=m.c,y=s.c;if(!b||!p){if(!h||!y)return new S(d/0);if(!h[0]||!y[0])return y[0]?s:new S(h[0]?m:d*0)}if(b=Ce(b),p=Ce(p),h=h.slice(),d=b-p){for(d>0?(p=b,f=y):(d=-d,f=h),f.reverse();d--;f.push(0));f.reverse()}for(d=h.length,l=y.length,d-l<0&&(f=y,y=h,h=f,l=d),d=0;l;)d=(h[--l]=h[l]+y[l]+d)/Ae|0,h[l]=Ae===h[l]?0:h[l]%Ae;return d&&(h=[d].concat(h),++p),H(s,h,p)},r.precision=r.sd=function(s,l){var f,m,d,b=this;if(s!=null&&s!==!!s)return se(s,1,_e),l==null?l=o:se(l,0,8),K(new S(b),s,l);if(!(f=b.c))return null;if(d=f.length-1,m=d*z+1,d=f[d]){for(;d%10==0;d/=10,m--);for(d=f[0];d>=10;d/=10,m++);}return s&&b.e+1>m&&(m=b.e+1),m},r.shiftedBy=function(s){return se(s,-9007199254740991,Ji),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,l,f,m,d,b=this,p=b.c,h=b.s,y=b.e,v=a+4,w=new S("0.5");if(h!==1||!p||!p[0])return new S(!h||h<0&&(!p||p[0])?NaN:p?b:1/0);if(h=Math.sqrt(+G(b)),h==0||h==1/0?(l=Ne(p),(l.length+y)%2==0&&(l+="0"),h=Math.sqrt(+l),y=Ce((y+1)/2)-(y<0||y%2),h==1/0?l="5e"+y:(l=h.toExponential(),l=l.slice(0,l.indexOf("e")+1)+y),f=new S(l)):f=new S(h+""),f.c[0]){for(y=f.e,h=y+v,h<3&&(h=0);;)if(d=f,f=w.times(d.plus(e(b,d,v,1))),Ne(d.c).slice(0,h)===(l=Ne(f.c)).slice(0,h))if(f.e<y&&--h,l=l.slice(h-3,h+1),l=="9999"||!m&&l=="4999"){if(!m&&(K(d,d.e+a+2,0),d.times(d).eq(b))){f=d;break}v+=4,h+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(K(f,f.e+a+2,1),s=!f.times(f).eq(b));break}}return K(f,f.e+a+1,o,s)},r.toExponential=function(s,l){return s!=null&&(se(s,0,_e),s++),O(this,s,l,1)},r.toFixed=function(s,l){return s!=null&&(se(s,0,_e),s=s+this.e+1),O(this,s,l)},r.toFormat=function(s,l,f){var m,d=this;if(f==null)s!=null&&l&&typeof l=="object"?(f=l,l=null):s&&typeof s=="object"?(f=s,s=l=null):f=P;else if(typeof f!="object")throw Error(we+"Argument not an object: "+f);if(m=d.toFixed(s,l),d.c){var b,p=m.split("."),h=+f.groupSize,y=+f.secondaryGroupSize,v=f.groupSeparator||"",w=p[0],T=p[1],A=d.s<0,B=A?w.slice(1):w,q=B.length;if(y&&(b=h,h=y,y=b,q-=b),h>0&&q>0){for(b=q%h||h,w=B.substr(0,b);b<q;b+=h)w+=v+B.substr(b,h);y>0&&(w+=v+B.slice(b)),A&&(w="-"+w)}m=T?w+(f.decimalSeparator||"")+((y=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+y+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):w}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(s){var l,f,m,d,b,p,h,y,v,w,T,A,B=this,q=B.c;if(s!=null&&(h=new S(s),!h.isInteger()&&(h.c||h.s!==1)||h.lt(u)))throw Error(we+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+G(h));if(!q)return new S(B);for(l=new S(u),v=f=new S(u),m=y=new S(u),A=Ne(q),b=l.e=A.length-B.e-1,l.c[0]=oi[(p=b%z)<0?z+p:p],s=!s||h.comparedTo(l)>0?b>0?l:v:h,p=_,_=1/0,h=new S(A),y.c[0]=0;w=e(h,l,0,1),d=f.plus(w.times(m)),d.comparedTo(s)!=1;)f=m,m=d,v=y.plus(w.times(d=v)),y=d,l=h.minus(w.times(d=l)),h=d;return d=e(s.minus(f),m,0,1),y=y.plus(d.times(v)),f=f.plus(d.times(m)),y.s=v.s=B.s,b=b*2,T=e(v,m,b,o).minus(B).abs().comparedTo(e(y,f,b,o).minus(B).abs())<1?[v,m]:[y,f],_=p,T},r.toNumber=function(){return+G(this)},r.toPrecision=function(s,l){return s!=null&&se(s,1,_e),O(this,s,l,2)},r.toString=function(s){var l,f=this,m=f.s,d=f.e;return d===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(s==null?l=d<=g||d>=c?zt(Ne(f.c),d):He(Ne(f.c),d,"0"):s===10&&k?(f=K(new S(f),a+d+1,o),l=He(Ne(f.c),f.e,"0")):(se(s,2,R.length,"Base"),l=t(He(Ne(f.c),d,"0"),10,s,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return G(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&S.set(i),S}function Ce(i){var e=i|0;return i>0||i===e?e:e-1}function Ne(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=z-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function lt(i,e){var t,n,r=i.c,u=e.c,a=i.s,o=e.s,g=i.e,c=e.e;if(!a||!o)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-o:a;if(a!=o)return a;if(t=a<0,n=g==c,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>c^t?1:-1;for(o=(g=r.length)<(c=u.length)?g:c,a=0;a<o;a++)if(r[a]!=u[a])return r[a]>u[a]^t?1:-1;return g==c?0:g>c^t?1:-1}function se(i,e,t,n){if(i<e||i>t||i!==Me(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 Dt(i){var e=i.c.length-1;return Ce(i.e/z)==e&&i.c[e]%2!=0}function zt(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 We=$i(),Zr=class{constructor(i){I(this,"key");I(this,"left",null);I(this,"right",null);this.key=i}},St=class extends Zr{constructor(i){super(i)}},Hr=class{constructor(){I(this,"size",0);I(this,"modificationCount",0);I(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 o=this.compare;let g;for(;;)if(g=o(a.key,i),g>0){let c=a.left;if(c==null||(g=o(c.key,i),g>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(g<0){let c=a.right;if(c==null||(g=o(c.key,i),g<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++),g}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)}}},Ut=class Rt extends Hr{constructor(t,n){super();I(this,"root",null);I(this,"compare");I(this,"validKey");I(this,yn,"[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 St(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new St(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 Rt(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 Rt(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Rt(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 Rt(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 o,g;do{if(o=u.left,g=u.right,o!=null){const c=new St(o.key);a.left=c,n(o,c)}if(g!=null){const c=new St(g.key);a.right=c,u=g,a=c}}while(g!=null)}const r=new St(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]()}[(bn=Symbol.iterator,yn=Symbol.toStringTag,bn)](){return new Vr(this.wrap())}},en=class{constructor(i){I(this,"tree");I(this,"path",new Array);I(this,"modificationCount",null);I(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}},Vr=class extends en{getValue(i){return i.key}},Kr=class extends en{getValue(i){return[i.key,i.key]}},tn=i=>()=>i,li=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):tn(!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)):tn(!1);return(t,n,r)=>{const u=t.x,a=t.y,o=r.x,g=r.y,c=a.minus(g).times(n.x.minus(o)).minus(u.minus(o).times(n.y.minus(g)));return e(c,u,a,o,g)?0:c.comparedTo(0)}}var Xr=i=>i,Qr=i=>{if(i){const e=new Ut(li(i)),t=new Ut(li(i)),n=(u,a)=>a.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new We(0),y:new We(0)}),r}return Xr},ui=i=>({set:e=>{Ve=ui(e)},reset:()=>ui(i),compare:li(i),snap:Qr(i),orient:Yr(i)}),Ve=ui(),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),ai=(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}}},Ft=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),nn=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),qt=i=>nn(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 Ft(r,n).div(qt(r)).div(qt(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 nn(r,n).div(qt(r)).div(qt(n))},rn=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},sn=(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 sn(t,n,i.x);if(n.x.isZero())return sn(i,e,t.x);if(e.y.isZero())return rn(t,n,i.y);if(n.y.isZero())return rn(i,e,t.y);const r=Ft(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=Ft(u,e).div(r),o=Ft(u,n).div(r),g=i.x.plus(o.times(e.x)),c=t.x.plus(a.times(n.x)),L=i.y.plus(o.times(e.y)),_=t.y.plus(a.times(n.y)),C=g.plus(c).div(2),M=L.plus(_).div(2);return{x:C,y:M}},De=class Nn{constructor(e,t){I(this,"point");I(this,"isLeft");I(this,"segment");I(this,"otherSE");I(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=Nn.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Zt.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:o}=t.get(r),{sine:g,cosine:c}=t.get(u);return a.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?o.isLessThan(c)?1:o.isGreaterThan(c)?-1:0:a.isLessThan(0)&&g.isLessThan(0)?o.isLessThan(c)?-1:o.isGreaterThan(c)?1:0:g.isLessThan(a)?-1:g.isGreaterThan(a)?1:0}}},ts=class wi{constructor(e){I(this,"events");I(this,"poly");I(this,"_isExteriorRing");I(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,o=u.leftSE,g=u.rightSE;const c=[o],L=o.point,_=[];for(;a=o,o=g,c.push(o),o.point!==L;)for(;;){const C=o.getAvailableLinkedEvents();if(C.length===0){const P=c[0].point,R=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${P.x}, ${P.y}]. Last matching segment found ends at [${R.x}, ${R.y}].`)}if(C.length===1){g=C[0].otherSE;break}let M=null;for(let P=0,R=_.length;P<R;P++)if(_[P].point===o.point){M=P;break}if(M!==null){const P=_.splice(M)[0],R=c.splice(P.index);R.unshift(R[0].otherSE),t.push(new wi(R.reverse()));continue}_.push({index:c.length,point:o.point});const N=o.getLeftmostComparator(a);g=C.sort(N)[0].otherSE;break}t.push(new wi(c))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let c=1,L=this.events.length-1;c<L;c++){const _=this.events[c].point,C=this.events[c+1].point;Ve.orient(_,e,C)!==0&&(t.push(_),e=_)}if(t.length===1)return null;const n=t[0],r=t[1];Ve.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,g=[];for(let c=a;c!=o;c+=u)g.push([t[c].x.toNumber(),t[c].y.toNumber()]);return g}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,o=this.events.length;a<o;a++){const g=this.events[a];De.compare(e,g)>0&&(e=g)}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}}},on=class{constructor(i){I(this,"exteriorRing");I(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){I(this,"rings");I(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 on(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new on(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(u)}}return e}},ns=class{constructor(i,e=Zt.compare){I(this,"queue");I(this,"tree");I(this,"segments");this.queue=i,this.tree=new Ut(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 o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(u=o),!n.isAnEndpoint(o))){const g=this._splitSafely(n,o);for(let c=0,L=g.length;c<L;c++)t.push(g[c])}}let a=null;if(r){const o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(a=o),!r.isAnEndpoint(o))){const g=this._splitSafely(r,o);for(let c=0,L=g.length;c<L;c++)t.push(g[c])}}if(u!==null||a!==null){let o=null;u===null?o=a:a===null?o=u:o=De.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(o);for(let c=0,L=g.length;c<L;c++)t.push(g[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 o=0,g=a.length;o<g;o++)t.push(a[o])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let o=0,g=a.length;o<g;o++)t.push(a[o])}}}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(){I(this,"type");I(this,"numMultiPolys")}run(i,e,t){Tt.type=i;const n=[new un(e,!0)];for(let c=0,L=t.length;c<L;c++)n.push(new un(t[c],!1));if(Tt.numMultiPolys=n.length,Tt.type==="difference"){const c=n[0];let L=1;for(;L<n.length;)ai(n[L].bbox,c.bbox)!==null?L++:n.splice(L,1)}if(Tt.type==="intersection")for(let c=0,L=n.length;c<L;c++){const _=n[c];for(let C=c+1,M=n.length;C<M;C++)if(ai(_.bbox,n[C].bbox)===null)return[]}const r=new Ut(De.compare);for(let c=0,L=n.length;c<L;c++){const _=n[c].getSweepEvents();for(let C=0,M=_.length;C<M;C++)r.add(_[C])}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 L=0,_=c.length;L<_;L++){const C=c[L];C.consumedBy===void 0&&r.add(C)}r.size!=0?(a=r.first(),r.delete(a)):a=null}Ve.reset();const o=ts.factory(u.segments);return new is(o).getGeom()}},Tt=new rs,jt=Tt,ss=0,Zt=class Kt{constructor(e,t,n,r){I(this,"id");I(this,"leftSE");I(this,"rightSE");I(this,"rings");I(this,"windings");I(this,"ringOut");I(this,"consumedBy");I(this,"prev");I(this,"_prevInResult");I(this,"_beforeState");I(this,"_afterState");I(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 o=e.leftSE.point.y,g=t.leftSE.point.y,c=e.rightSE.point.y,L=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(o)&&g.isLessThan(c))return 1;if(g.isGreaterThan(o)&&g.isGreaterThan(c))return-1;const _=e.comparePoint(t.leftSE.point);if(_<0)return 1;if(_>0)return-1;const C=t.comparePoint(e.rightSE.point);return C!==0?C:-1}if(n.isGreaterThan(r)){if(o.isLessThan(g)&&o.isLessThan(L))return-1;if(o.isGreaterThan(g)&&o.isGreaterThan(L))return 1;const _=t.comparePoint(e.leftSE.point);if(_!==0)return _;const C=e.comparePoint(t.rightSE.point);return C<0?1:C>0?-1:1}if(o.isLessThan(g))return-1;if(o.isGreaterThan(g))return 1;if(u.isLessThan(a)){const _=t.comparePoint(e.rightSE.point);if(_!==0)return _}if(u.isGreaterThan(a)){const _=e.comparePoint(t.rightSE.point);if(_<0)return 1;if(_>0)return-1}if(!u.eq(a)){const _=c.minus(o),C=u.minus(n),M=L.minus(g),N=a.minus(r);if(_.isGreaterThan(C)&&M.isLessThan(N))return 1;if(_.isLessThan(C)&&M.isGreaterThan(N))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||c.isLessThan(L)?-1:c.isGreaterThan(L)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,a;const o=De.comparePoints(e,t);if(o<0)r=e,u=t,a=1;else if(o>0)r=t,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new De(r,!0),c=new De(u,!1);return new Kt(g,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 Ve.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=ai(t,n);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,g=e.rightSE.point,c=xt(t,o)&&this.comparePoint(o)===0,L=xt(n,u)&&e.comparePoint(u)===0,_=xt(t,g)&&this.comparePoint(g)===0,C=xt(n,a)&&e.comparePoint(a)===0;if(L&&c)return C&&!_?a:!C&&_?g:null;if(L)return _&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(c)return C&&a.x.eq(o.x)&&a.y.eq(o.y)?null:o;if(C&&_)return null;if(C)return a;if(_)return g;const M=es(u,this.vector(),o,e.vector());return M===null||!xt(r,M)?null:Ve.snap(M)}split(e){const t=[],n=e.events!==void 0,r=new De(e,!0),u=new De(e,!1),a=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const o=new Kt(r,a,this.rings.slice(),this.windings.slice());return De.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),De.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=Kt.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 o=n.rings[u],g=n.windings[u],c=t.rings.indexOf(o);c===-1?(t.rings.push(o),t.windings.push(g)):t.windings[c]+=g}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 o=0,g=this.rings.length;o<g;o++){const c=this.rings[o],L=this.windings[o],_=t.indexOf(c);_===-1?(t.push(c),n.push(L)):n[_]+=L}const u=[],a=[];for(let o=0,g=t.length;o<g;o++){if(n[o]===0)continue;const c=t[o],L=c.poly;if(a.indexOf(L)===-1)if(c.isExterior)u.push(L);else{a.indexOf(L)===-1&&a.push(L);const _=u.indexOf(c.poly);_!==-1&&u.splice(_,1)}}for(let o=0,g=u.length;o<g;o++){const c=u[o].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(jt.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===jt.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}},ln=class{constructor(i,e,t){I(this,"poly");I(this,"isExterior");I(this,"segments");I(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=Ve.snap({x:new We(i[0][0]),y:new We(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 o=Ve.snap({x:new We(i[u][0]),y:new We(i[u][1])});o.x.eq(r.x)&&o.y.eq(r.y)||(this.segments.push(Zt.fromRing(r,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),r=o)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Zt.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){I(this,"multiPoly");I(this,"exteriorRing");I(this,"interiorRings");I(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ln(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 ln(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}},un=class{constructor(i,e){I(this,"isSubject");I(this,"polys");I(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 We(Number.POSITIVE_INFINITY),y:new We(Number.POSITIVE_INFINITY)},ur:{x:new We(Number.NEGATIVE_INFINITY),y:new We(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)=>jt.run("union",i,e),us=(i,...e)=>jt.run("difference",i,e);Ve.set;function as(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?ti(n[0],e.properties):Hi(n,e.properties)}var an=as;function fs(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?ti(n[0],t):Hi(n,t)}var cs=fs;function ds(i){if(!i)throw new Error("geojson is required");var e=[];return Dr(i,function(t){e.push(t)}),_t(e)}var hs=ds;function fn(i,e){const t=cs(_t([ti([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=vt(ni(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,a=n[2]>180,o=hs(i);if(o.features.length>1&&(u||a))for(const g of o.features){const c=vt(ni(g));if(a&&c[0]<-180+r)for(const L of g.geometry.coordinates)for(const _ of L)_[0]+=360-r;if(u&&c[2]>180-r)for(const L of g.geometry.coordinates)for(const _ of L)_[0]-=360-r}e(_t([o.features.length<2?i:an(o)??i,t]))}const cn=i=>{var n,r,u;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(u=i==null?void 0:i.properties)!=null&&u.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function dn(i,e=!0,t=!0,n={},r={},u=cn){let a;const o=[];let g,c;const L=ve.geoJSON(void 0,{style:u===!0?cn:u===!1?void 0:u??void 0,interactive:!1}).addTo(i),_=M=>{a==null||a({type:"mapClick",coordinates:[M.latlng.lng,M.latlng.lat]})};function C(M,N=!1){const P=document.createElement("div");return new gr({props:{displayIn:"leaflet"},target:P}),new ve.Marker(M,{interactive:N,icon:new ve.DivIcon({html:P,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(M){M?(a=M,i.on("click",_)):(a=void 0,i.off("click",_))},flyTo(M,N){i.flyTo([M[1],M[0]],N,{duration:2,...n})},fitBounds(M,N,P){i.flyToBounds([[M[1],M[0]],[M[3],M[2]]],{padding:[N,N],duration:2,...P?{maxZoom:P}:{},...r})},indicateReverse(M){i.getContainer().style.cursor=M?"crosshair":""},setReverseMarker(M){var P;if(!e)return;const N=M&&[M[1],M[0]];c?N?c.setLatLng(N):(c.remove(),c=void 0):N&&(e instanceof Function?c=e(i)??void 0:(c=(typeof e=="object"?new ve.Marker(N,e):C(N)).addTo(i),(P=c.getElement())==null||P.classList.add("marker-reverse")))},setFeatures(M,N,P){function R(k){L.clearLayers(),k&&L.addData(k)}for(const k of o)k.remove();o.length=0,R();e:if(N){let k=!1;if(N.geometry.type==="GeometryCollection"){const S=N.geometry.geometries.filter(O=>O.type==="Polygon"||O.type==="MultiPolygon");t:if(S.length>0){const O=an(_t(S.map(D=>Lt(D))));if(!O)break t;fn({...N,geometry:O.geometry},R),k=!0}else{const O=N.geometry.geometries.filter(D=>D.type==="LineString"||D.type==="MultiLineString");O.length>0&&(R({...N,geometry:{type:"GeometryCollection",geometries:O}}),k=!0)}}if(!k){if(N.geometry.type==="Polygon"||N.geometry.type==="MultiPolygon")fn(N,S=>{if(!S)return;const O=[...S.features],D=vt(ni(N)),H=D[2]-D[0];D[0]-H/4<-180&&O.push(...hn(S,-360).features),D[2]+H/4>180&&O.push(...hn(S,360).features),R(_t(O))});else if(N.geometry.type==="LineString"||N.geometry.type==="MultiLineString"){R(N);break e}}if(!P&&N.geometry.type!=="Point")break e;if(e instanceof Function){const S=e(i,N);S&&o.push(S.addTo(i))}else if(e){const S=[N.center[1],N.center[0]];o.push(typeof e=="object"?new ve.Marker(S,e):C(S).addTo(i))}}if(t)for(const k of M??[]){if(k===N)continue;const S=[k.center[1],k.center[0]];let O;if(t instanceof Function){if(O=t(i,k),!O)continue}else O=(typeof t=="object"?new ve.Marker(S,t):C(S,!0)).addTo(i).bindTooltip(k.place_type[0]==="reverse"?k.place_name:k.place_name.replace(/,.*/,""),{direction:"top"});const D=O.getElement();D&&(D.addEventListener("click",H=>{H.stopPropagation(),a==null||a({type:"markerClick",id:k.id})}),D.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:k.id})}),D.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:k.id})}),D.classList.toggle("marker-fuzzy",!!k.matching_text)),o.push(O)}},setSelectedMarker(M){var N,P;g&&((N=g.getElement())==null||N.classList.toggle("marker-selected",!1)),g=M>-1?o[M]:void 0,(P=g==null?void 0:g.getElement())==null||P.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const M=i.getCenter();return[i.getZoom(),M.lng,M.lat]}}}function hn(i,e){const t=qr(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)gn(r,e);else gn(n.geometry.coordinates,e);return t}function gn(i,e){for(const t of i)for(const n of t)n[0]+=e}class mn extends ve.Control{}ve.Util.extend(mn.prototype,ve.Evented.prototype);class pn extends mn{constructor(t){super(t);bi(this,Se);bi(this,ut);vi(this,ut,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ve.DomEvent.disableClickPropagation(n),ve.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:u,flyTo:a,fullGeometryStyle:o,position:g,...c}=xe(this,ut),L=typeof a=="boolean"?{}:a,_=dn(t,r,u,L,L,o);vi(this,Se,new Wr({target:n,props:{mapController:_,flyTo:a===void 0?!0:!!a,...c}}));const C={select:void 0,pick:void 0,featureslisted:void 0,featuresmarked:void 0,response:void 0,optionsvisibilitychange:void 0,reversetoggle:void 0,querychange:void 0};for(const M in C)xe(this,Se).$on(M,N=>this.fire(M,N.detail));return n}setOptions(t){var g;Object.assign(xe(this,ut),t);const{marker:n,showResultMarkers:r,flyTo:u,fullGeometryStyle:a,...o}=xe(this,ut);(g=xe(this,Se))==null||g.$set(o)}setQuery(t,n=!0){var r;(r=xe(this,Se))==null||r.setQuery(t,n)}clearMap(){var t;(t=xe(this,Se))==null||t.clearMap()}clearList(){var t;(t=xe(this,Se))==null||t.clearList()}setReverseMode(t){var n;(n=xe(this,Se))==null||n.$set({reverseActive:t})}focus(t){var n;(n=xe(this,Se))==null||n.focus(t)}blur(){var t;(t=xe(this,Se))==null||t.blur()}onRemove(){var t;(t=xe(this,Se))==null||t.$destroy()}}Se=new WeakMap,ut=new WeakMap;function gs(...i){return new pn(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=gs),V.GeocodingControl=pn,V.createLeafletMapController=dn,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
2
14
  //# sourceMappingURL=leaflet.umd.js.map